diff --git a/CHANGELOG.md b/CHANGELOG.md index a952f8650..fe17935d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Change history for stripes-components ## 12.2.0 IN PROGRESS - +* Add specific loading props to MCL to pass to Prev/Next pagination row, Refs STCOM-1305 * Exclude invalid additional currencies. Refs STCOM-1274. * Validate ref in `Paneset` before dereferencing it. Refs STCOM-1235. * Resolve bug with form control validation styles not rendering. Adjusted order of nested selectors. Refs STCOM-1284. diff --git a/lib/MultiColumnList/MCLRenderer.js b/lib/MultiColumnList/MCLRenderer.js index c4f6a9eae..53364cca1 100644 --- a/lib/MultiColumnList/MCLRenderer.js +++ b/lib/MultiColumnList/MCLRenderer.js @@ -241,7 +241,9 @@ class MCLRenderer extends React.Component { pageAmount: PropTypes.number, pagingButtonLabel: PropTypes.node, pagingCanGoNext: PropTypes.bool, + pagingCanGoNextLoading: PropTypes.bool, pagingCanGoPrevious: PropTypes.bool, + pagingCanGoPreviousLoading: PropTypes.bool, pagingOffset: PropTypes.number, pagingType: PropTypes.oneOf(Object.values(pagingTypes)), rowFormatter: PropTypes.func, @@ -266,7 +268,9 @@ class MCLRenderer extends React.Component { static defaultProps = { pagingCanGoNext: null, + pagingCanGoNextLoading: null, pagingCanGoPrevious: null, + pagingCanGoPreviousLoading: null, columnMapping: {}, columnOverflow: {}, columnWidths: {}, @@ -727,11 +731,16 @@ class MCLRenderer extends React.Component { getCanGoNext = () => { const { pagingCanGoNext, + pagingCanGoNextLoading, contentData, totalCount, pagingOffset, } = this.props; + if (pagingCanGoNextLoading) { + return false; + } + if (!isNil(pagingCanGoNext)) { return pagingCanGoNext; } @@ -753,10 +762,15 @@ class MCLRenderer extends React.Component { getCanGoPrevious = () => { const { pagingCanGoPrevious, + pagingCanGoPreviousLoading, contentData, pagingOffset } = this.props; + if (pagingCanGoPreviousLoading) { + return false; + } + if (!isNil(pagingCanGoPrevious)) { return pagingCanGoPrevious; } @@ -1853,6 +1867,8 @@ class MCLRenderer extends React.Component { totalCount, loading, hasMargin, + pagingCanGoNextLoading, + pagingCanGoPreviousLoading, pagingType, pageAmount, virtualize, @@ -1876,7 +1892,7 @@ class MCLRenderer extends React.Component { } // if contentData is empty, render empty message... - if (contentData.length === 0) { + if (contentData.length === 0 && !loading) { return (