@nebula.js/sn-table 1.6.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -13
- package/api-specifications/properties.json +1 -1
- package/core/esm/index.js +137 -96
- package/dist/sn-table.js +4 -4
- package/package.json +18 -22
package/README.md
CHANGED
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
# sn-table
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Table supernova for [nebula.js]
|
|
8
|
+
|
|
9
|
+
More specifics and information about the sn-table can be found in [the Qlik developer portal](https://qlik.dev/libraries-and-tools/visualizations/table).
|
|
8
10
|
|
|
9
11
|
## Mashup Usage
|
|
10
12
|
|
|
@@ -32,15 +34,13 @@ nuked.render({
|
|
|
32
34
|
});
|
|
33
35
|
```
|
|
34
36
|
|
|
35
|
-
Look into [Build a simple mashup using nebula.js](https://qlik.dev/tutorials/build-a-simple-mashup-using-nebulajs) to learn more.
|
|
37
|
+
Look into [Build a simple mashup using nebula.js](https://qlik.dev/tutorials/build-a-simple-mashup-using-nebulajs) and [Embed a visualization](https://qlik.dev/libraries-and-tools/nebulajs/rendering) to learn more.
|
|
36
38
|
|
|
37
|
-
[
|
|
38
|
-
|
|
39
|
-
More specifics and information about the sn-table can be found in [the Qlik developer portal](https://qlik.dev/libraries-and-tools/visualizations/table).
|
|
39
|
+
[Check full examples](./mashup-example) of the mashup usage.
|
|
40
40
|
|
|
41
41
|
## Visualization Extension Usage
|
|
42
42
|
|
|
43
|
-
###
|
|
43
|
+
### Building and adding the sn-table extension to Qlik Sense
|
|
44
44
|
|
|
45
45
|
Install all dependencies:
|
|
46
46
|
|
|
@@ -48,17 +48,13 @@ Install all dependencies:
|
|
|
48
48
|
yarn
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
Build nebula.js visualization:
|
|
51
|
+
Build a nebula.js visualization as a Qlik Sense extension:
|
|
52
52
|
|
|
53
53
|
```sh
|
|
54
54
|
yarn build
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
```sh
|
|
60
|
-
yarn sense
|
|
61
|
-
```
|
|
57
|
+
Compress the generated 'dist' folder into the 'application/zip' file format and rename it to 'sn-table-ext'.
|
|
62
58
|
|
|
63
59
|
| [Saas Edition of Qlik Sense] | [Qlik Sense Enterprise] | [Qlik Sense Desktop] |
|
|
64
60
|
| :-----------------------------------------------------------------------------: | :--------------------------------------------------------------: | :------------------------------------------------------------------------: |
|
|
@@ -70,7 +66,7 @@ The API can also be found in [the Qlik developer portal](https://qlik.dev/apis/j
|
|
|
70
66
|
|
|
71
67
|
## Contribution
|
|
72
68
|
|
|
73
|
-
|
|
69
|
+
To learn how to run a sn-table extension using nebula development server and develop, see our [contributing guide](./.github/CONTRIBUTION.md).
|
|
74
70
|
|
|
75
71
|
## Package
|
|
76
72
|
|
package/core/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-table v1.
|
|
2
|
+
* @nebula.js/sn-table v1.8.0
|
|
3
3
|
* Copyright (c) 2022 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -502,7 +502,7 @@ const properties$1 = {
|
|
|
502
502
|
* @type {string}
|
|
503
503
|
* @default
|
|
504
504
|
*/
|
|
505
|
-
version: "1.
|
|
505
|
+
version: "1.8.0",
|
|
506
506
|
|
|
507
507
|
/**
|
|
508
508
|
* Extends HyperCubeDef, see Engine API: HyperCubeDef
|
|
@@ -1045,12 +1045,12 @@ async function manageData(model, layout, pageInfo, setPageInfo) {
|
|
|
1045
1045
|
} = layout;
|
|
1046
1046
|
const size = qHyperCube.qSize;
|
|
1047
1047
|
const top = page * rowsPerPage;
|
|
1048
|
-
const
|
|
1049
|
-
const
|
|
1050
|
-
const height = Math.min(rowsPerPage,
|
|
1048
|
+
const totalHorizontalCount = size.qcx;
|
|
1049
|
+
const totalVerticalCount = size.qcy;
|
|
1050
|
+
const height = Math.min(rowsPerPage, totalVerticalCount - top); // When the number of rows is reduced (e.g. confirming selections),
|
|
1051
1051
|
// you can end up still being on a page that doesn't exist anymore, then go back to the first page and return null
|
|
1052
1052
|
|
|
1053
|
-
if (page > 0 && top >=
|
|
1053
|
+
if (page > 0 && top >= totalVerticalCount) {
|
|
1054
1054
|
setPageInfo({ ...pageInfo,
|
|
1055
1055
|
page: 0
|
|
1056
1056
|
});
|
|
@@ -1058,9 +1058,9 @@ async function manageData(model, layout, pageInfo, setPageInfo) {
|
|
|
1058
1058
|
} // If the number of cells exceeds 10k then we need to lower the rows per page to the maximum possible value
|
|
1059
1059
|
|
|
1060
1060
|
|
|
1061
|
-
if (height *
|
|
1061
|
+
if (height * totalHorizontalCount > MAX_CELLS) {
|
|
1062
1062
|
setPageInfo({ ...pageInfo,
|
|
1063
|
-
rowsPerPage: getHighestPossibleRpp(
|
|
1063
|
+
rowsPerPage: getHighestPossibleRpp(totalHorizontalCount, rowsPerPageOptions),
|
|
1064
1064
|
page: 0
|
|
1065
1065
|
});
|
|
1066
1066
|
return null;
|
|
@@ -1073,7 +1073,7 @@ async function manageData(model, layout, pageInfo, setPageInfo) {
|
|
|
1073
1073
|
qTop: top,
|
|
1074
1074
|
qLeft: 0,
|
|
1075
1075
|
qHeight: height,
|
|
1076
|
-
qWidth:
|
|
1076
|
+
qWidth: totalHorizontalCount
|
|
1077
1077
|
}]);
|
|
1078
1078
|
const rows = dataPages[0].qMatrix.map((r, rowIdx) => {
|
|
1079
1079
|
const row = {
|
|
@@ -7751,7 +7751,11 @@ function createStyled(input = {}) {
|
|
|
7751
7751
|
|
|
7752
7752
|
transformedStyleArg = [...styleArg, ...placeholders];
|
|
7753
7753
|
transformedStyleArg.raw = [...styleArg.raw, ...placeholders];
|
|
7754
|
-
} else if (typeof styleArg === 'function'
|
|
7754
|
+
} else if (typeof styleArg === 'function' && // On the server emotion doesn't use React.forwardRef for creating components, so the created
|
|
7755
|
+
// component stays as a function. This condition makes sure that we do not interpolate functions
|
|
7756
|
+
// which are basically components used as a selectors.
|
|
7757
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
7758
|
+
styleArg.__emotion_real !== styleArg) {
|
|
7755
7759
|
// If the type is function, we need to define the default theme.
|
|
7756
7760
|
transformedStyleArg = _ref2 => {
|
|
7757
7761
|
let {
|
|
@@ -8356,7 +8360,7 @@ function getContainer$1(container) {
|
|
|
8356
8360
|
*/
|
|
8357
8361
|
|
|
8358
8362
|
|
|
8359
|
-
const Portal = /*#__PURE__*/React.forwardRef(function Portal(props, ref) {
|
|
8363
|
+
const Portal$1 = /*#__PURE__*/React.forwardRef(function Portal(props, ref) {
|
|
8360
8364
|
const {
|
|
8361
8365
|
children,
|
|
8362
8366
|
container,
|
|
@@ -8392,7 +8396,7 @@ const Portal = /*#__PURE__*/React.forwardRef(function Portal(props, ref) {
|
|
|
8392
8396
|
|
|
8393
8397
|
return mountNode ? /*#__PURE__*/ReactDOM.createPortal(children, mountNode) : mountNode;
|
|
8394
8398
|
});
|
|
8395
|
-
Portal.propTypes
|
|
8399
|
+
Portal$1.propTypes
|
|
8396
8400
|
/* remove-proptypes */
|
|
8397
8401
|
= {
|
|
8398
8402
|
// ----------------------------- Warning --------------------------------
|
|
@@ -8425,10 +8429,10 @@ Portal.propTypes
|
|
|
8425
8429
|
|
|
8426
8430
|
{
|
|
8427
8431
|
// eslint-disable-next-line
|
|
8428
|
-
Portal['propTypes' + ''] = exactProp(Portal.propTypes);
|
|
8432
|
+
Portal$1['propTypes' + ''] = exactProp(Portal$1.propTypes);
|
|
8429
8433
|
}
|
|
8430
8434
|
|
|
8431
|
-
var Portal$
|
|
8435
|
+
var Portal$2 = Portal$1;
|
|
8432
8436
|
|
|
8433
8437
|
function isOverflowing(container) {
|
|
8434
8438
|
const doc = ownerDocument(container);
|
|
@@ -9245,7 +9249,7 @@ const ModalUnstyled = /*#__PURE__*/React.forwardRef(function ModalUnstyled(props
|
|
|
9245
9249
|
|
|
9246
9250
|
const Root = components.Root || component;
|
|
9247
9251
|
const rootProps = componentsProps.root || {};
|
|
9248
|
-
return /*#__PURE__*/jsxRuntime.exports.jsx(Portal$
|
|
9252
|
+
return /*#__PURE__*/jsxRuntime.exports.jsx(Portal$2, {
|
|
9249
9253
|
ref: handlePortalRef,
|
|
9250
9254
|
container: container,
|
|
9251
9255
|
disablePortal: disablePortal,
|
|
@@ -17494,6 +17498,7 @@ const SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {
|
|
|
17494
17498
|
color,
|
|
17495
17499
|
component,
|
|
17496
17500
|
fontSize,
|
|
17501
|
+
instanceFontSize: inProps.fontSize,
|
|
17497
17502
|
inheritViewBox,
|
|
17498
17503
|
viewBox
|
|
17499
17504
|
});
|
|
@@ -17636,7 +17641,9 @@ var ArrowDropDownIcon = createSvgIcon$1( /*#__PURE__*/jsxRuntime.exports.jsx("pa
|
|
|
17636
17641
|
function getInputUtilityClass(slot) {
|
|
17637
17642
|
return generateUtilityClass('MuiInput', slot);
|
|
17638
17643
|
}
|
|
17639
|
-
|
|
17644
|
+
|
|
17645
|
+
const inputClasses = _extends$6({}, inputBaseClasses$1, generateUtilityClasses('MuiInput', ['root', 'underline', 'input']));
|
|
17646
|
+
|
|
17640
17647
|
var inputClasses$1 = inputClasses;
|
|
17641
17648
|
|
|
17642
17649
|
const _excluded$g = ["disableUnderline", "components", "componentsProps", "fullWidth", "inputComponent", "multiline", "type"];
|
|
@@ -17967,7 +17974,9 @@ var Input$1 = Input;
|
|
|
17967
17974
|
function getFilledInputUtilityClass(slot) {
|
|
17968
17975
|
return generateUtilityClass('MuiFilledInput', slot);
|
|
17969
17976
|
}
|
|
17970
|
-
|
|
17977
|
+
|
|
17978
|
+
const filledInputClasses = _extends$6({}, inputBaseClasses$1, generateUtilityClasses('MuiFilledInput', ['root', 'underline', 'input']));
|
|
17979
|
+
|
|
17971
17980
|
var filledInputClasses$1 = filledInputClasses;
|
|
17972
17981
|
|
|
17973
17982
|
const _excluded$f = ["disableUnderline", "components", "componentsProps", "fullWidth", "hiddenLabel", "inputComponent", "multiline", "type"];
|
|
@@ -18391,7 +18400,9 @@ const NotchedOutlineLegend = styled$1('legend')(({
|
|
|
18391
18400
|
ownerState,
|
|
18392
18401
|
theme
|
|
18393
18402
|
}) => _extends$6({
|
|
18394
|
-
float: 'unset'
|
|
18403
|
+
float: 'unset',
|
|
18404
|
+
// Fix conflict with bootstrap
|
|
18405
|
+
overflow: 'hidden'
|
|
18395
18406
|
}, !ownerState.withLabel && {
|
|
18396
18407
|
padding: 0,
|
|
18397
18408
|
lineHeight: '11px',
|
|
@@ -18501,7 +18512,9 @@ NotchedOutline.propTypes = {
|
|
|
18501
18512
|
function getOutlinedInputUtilityClass(slot) {
|
|
18502
18513
|
return generateUtilityClass('MuiOutlinedInput', slot);
|
|
18503
18514
|
}
|
|
18504
|
-
|
|
18515
|
+
|
|
18516
|
+
const outlinedInputClasses = _extends$6({}, inputBaseClasses$1, generateUtilityClasses('MuiOutlinedInput', ['root', 'notchedOutline', 'input']));
|
|
18517
|
+
|
|
18505
18518
|
var outlinedInputClasses$1 = outlinedInputClasses;
|
|
18506
18519
|
|
|
18507
18520
|
const _excluded$d = ["components", "fullWidth", "inputComponent", "label", "multiline", "notched", "type"];
|
|
@@ -21831,7 +21844,7 @@ const preventDefaultBehavior = evt => {
|
|
|
21831
21844
|
};
|
|
21832
21845
|
const handleTableWrapperKeyDown = ({
|
|
21833
21846
|
evt,
|
|
21834
|
-
|
|
21847
|
+
totalVerticalCount,
|
|
21835
21848
|
page,
|
|
21836
21849
|
rowsPerPage,
|
|
21837
21850
|
handleChangePage,
|
|
@@ -21841,7 +21854,7 @@ const handleTableWrapperKeyDown = ({
|
|
|
21841
21854
|
}) => {
|
|
21842
21855
|
if (isCtrlShift(evt)) {
|
|
21843
21856
|
preventDefaultBehavior(evt);
|
|
21844
|
-
const lastPage = Math.ceil(
|
|
21857
|
+
const lastPage = Math.ceil(totalVerticalCount / rowsPerPage) - 1;
|
|
21845
21858
|
|
|
21846
21859
|
if (evt.key === 'ArrowRight' && page < lastPage) {
|
|
21847
21860
|
setShouldRefocus();
|
|
@@ -23220,8 +23233,18 @@ var interopRequireDefault = {exports: {}};
|
|
|
23220
23233
|
|
|
23221
23234
|
var createSvgIcon = {};
|
|
23222
23235
|
|
|
23236
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
23237
|
+
|
|
23238
|
+
const unstable_ClassNameGenerator = {
|
|
23239
|
+
configure: generator => {
|
|
23240
|
+
console.warn(['MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.', '', "You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead", '', 'The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401', '', 'The updated documentation: https://mui.com/guides/classname-generator/'].join('\n'));
|
|
23241
|
+
ClassNameGenerator$1.configure(generator);
|
|
23242
|
+
}
|
|
23243
|
+
};
|
|
23244
|
+
|
|
23223
23245
|
var utils = /*#__PURE__*/Object.freeze({
|
|
23224
23246
|
__proto__: null,
|
|
23247
|
+
unstable_ClassNameGenerator: unstable_ClassNameGenerator,
|
|
23225
23248
|
capitalize: capitalize,
|
|
23226
23249
|
createChainedFunction: createChainedFunction,
|
|
23227
23250
|
createSvgIcon: createSvgIcon$1,
|
|
@@ -23238,8 +23261,7 @@ var utils = /*#__PURE__*/Object.freeze({
|
|
|
23238
23261
|
useControlled: useControlled,
|
|
23239
23262
|
useEventCallback: useEventCallback,
|
|
23240
23263
|
useForkRef: useForkRef,
|
|
23241
|
-
useIsFocusVisible: useIsFocusVisible
|
|
23242
|
-
unstable_ClassNameGenerator: ClassNameGenerator$1
|
|
23264
|
+
useIsFocusVisible: useIsFocusVisible
|
|
23243
23265
|
});
|
|
23244
23266
|
|
|
23245
23267
|
var require$$0 = /*@__PURE__*/getAugmentedNamespace(utils);
|
|
@@ -23422,29 +23444,24 @@ function useDidUpdateEffect(fn, inputs) {
|
|
|
23422
23444
|
const handleHorizontalScroll = (evt, isRTL, memoedContainer) => {
|
|
23423
23445
|
evt.stopPropagation(); // scrollWidth is the width of an element's content, including content not visible on the screen due to overflow.
|
|
23424
23446
|
// offsetWidth is the element's CSS width, including any borders, padding, and vertical scrollbars
|
|
23425
|
-
|
|
23447
|
+
|
|
23448
|
+
const maxScrollableWidth = memoedContainer.scrollWidth - memoedContainer.offsetWidth; // scrollLeft is the number of pixels scrolled from its left edge
|
|
23449
|
+
// scrollLeft is 0 when the scrollbar is at its leftmost position
|
|
23450
|
+
// (at the start of the scrolled content),
|
|
23451
|
+
// and then increasingly negative as it is scrolled towards left.
|
|
23426
23452
|
|
|
23427
23453
|
let {
|
|
23428
23454
|
scrollLeft
|
|
23429
|
-
} = memoedContainer;
|
|
23430
|
-
|
|
23431
|
-
|
|
23432
|
-
|
|
23433
|
-
|
|
23434
|
-
|
|
23435
|
-
|
|
23436
|
-
|
|
23437
|
-
// evt.deltaX increasingly negative as you scroll towards left,
|
|
23438
|
-
// increasingly positive as you scroll towards right
|
|
23439
|
-
const scrollRight = maxScrollableWidth + ScrollLeftWidth;
|
|
23440
|
-
|
|
23441
|
-
if (maxScrollableWidth > 0 && (scrollRight <= 0 || scrollRight > maxScrollableWidth)) {
|
|
23442
|
-
evt.preventDefault();
|
|
23443
|
-
scrollLeft = Math.min(0, Math.min(maxScrollableWidth, scrollRight));
|
|
23444
|
-
}
|
|
23445
|
-
} else if (maxScrollableWidth > 0 && (ScrollLeftWidth < 0 || ScrollLeftWidth > maxScrollableWidth)) {
|
|
23455
|
+
} = memoedContainer; // evt.deltaX is the horizontal scroll amount
|
|
23456
|
+
// evt.deltaX increasingly negative as you scroll towards left,
|
|
23457
|
+
// increasingly positive as you scroll towards right
|
|
23458
|
+
|
|
23459
|
+
let scrolledDistance = scrollLeft + evt.deltaX;
|
|
23460
|
+
if (isRTL) scrolledDistance = maxScrollableWidth + scrolledDistance;
|
|
23461
|
+
|
|
23462
|
+
if (maxScrollableWidth > 0 && (scrolledDistance < 0 || scrolledDistance > maxScrollableWidth + 1)) {
|
|
23446
23463
|
evt.preventDefault();
|
|
23447
|
-
scrollLeft = Math.max(0, Math.min(maxScrollableWidth,
|
|
23464
|
+
scrollLeft = isRTL ? Math.min(0, Math.min(maxScrollableWidth, scrolledDistance)) : Math.max(0, Math.min(maxScrollableWidth, scrolledDistance));
|
|
23448
23465
|
}
|
|
23449
23466
|
};
|
|
23450
23467
|
const handleNavigateTop = ({
|
|
@@ -23542,6 +23559,11 @@ function announcementFactory(rootElement, translator, prevAnnounceEl) {
|
|
|
23542
23559
|
};
|
|
23543
23560
|
}
|
|
23544
23561
|
|
|
23562
|
+
const Portal = ({
|
|
23563
|
+
children,
|
|
23564
|
+
target
|
|
23565
|
+
}) => ReactDOM__default.createPortal(children, target);
|
|
23566
|
+
|
|
23545
23567
|
function TableWrapper(props) {
|
|
23546
23568
|
const {
|
|
23547
23569
|
rootElement,
|
|
@@ -23554,6 +23576,7 @@ function TableWrapper(props) {
|
|
|
23554
23576
|
keyboard,
|
|
23555
23577
|
rect,
|
|
23556
23578
|
direction,
|
|
23579
|
+
footerContainer,
|
|
23557
23580
|
announcer // this is only for testing purposes
|
|
23558
23581
|
|
|
23559
23582
|
} = props;
|
|
@@ -23562,6 +23585,8 @@ function TableWrapper(props) {
|
|
|
23562
23585
|
rows,
|
|
23563
23586
|
columns
|
|
23564
23587
|
} = tableData;
|
|
23588
|
+
const totalVerticalCount = size.qcy;
|
|
23589
|
+
const paginationNeeded = totalVerticalCount > 10;
|
|
23565
23590
|
const {
|
|
23566
23591
|
page,
|
|
23567
23592
|
rowsPerPage,
|
|
@@ -23571,11 +23596,10 @@ function TableWrapper(props) {
|
|
|
23571
23596
|
const shouldRefocus = useRef(false);
|
|
23572
23597
|
const tableContainerRef = useRef();
|
|
23573
23598
|
const tableWrapperRef = useRef();
|
|
23574
|
-
const fixedRowsPerPage = selectionsAPI.isModal() || rect.width < 550 || size.qcx > 100;
|
|
23575
23599
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
23576
23600
|
|
|
23577
23601
|
const announce = announcer || useMemo(() => announcementFactory(rootElement, translator), [translator.language]);
|
|
23578
|
-
const totalPages = Math.ceil(
|
|
23602
|
+
const totalPages = Math.ceil(totalVerticalCount / rowsPerPage);
|
|
23579
23603
|
const tableAriaLabel = `${translator.get('SNTable.Accessibility.RowsAndColumns', [rows.length + 1, columns.length])} ${translator.get('SNTable.Accessibility.NavigationInstructions')}`;
|
|
23580
23604
|
|
|
23581
23605
|
const setShouldRefocus = () => {
|
|
@@ -23650,18 +23674,15 @@ function TableWrapper(props) {
|
|
|
23650
23674
|
shouldAddTabstop: !keyboard.enabled || keyboard.active,
|
|
23651
23675
|
announce
|
|
23652
23676
|
});
|
|
23653
|
-
}, [rows.length,
|
|
23677
|
+
}, [rows.length, totalVerticalCount, size.qcx, page]);
|
|
23654
23678
|
const paperStyle = {
|
|
23655
23679
|
height: '100%',
|
|
23656
23680
|
backgroundColor: 'rgb(255, 255, 255)',
|
|
23657
23681
|
boxShadow: 'none'
|
|
23658
23682
|
};
|
|
23659
|
-
const tableContainerStyle =
|
|
23660
|
-
height: '100%',
|
|
23661
|
-
overflow: 'hidden'
|
|
23662
|
-
} : {
|
|
23663
|
-
height: 'calc(100% - 52px)',
|
|
23664
|
-
overflow: 'auto'
|
|
23683
|
+
const tableContainerStyle = {
|
|
23684
|
+
height: constraints.active || footerContainer || paginationNeeded ? 'calc(100% - 52px)' : '100%',
|
|
23685
|
+
overflow: constraints.active ? 'hidden' : 'auto'
|
|
23665
23686
|
};
|
|
23666
23687
|
const paperTablePaginationStyle = {
|
|
23667
23688
|
display: 'flex',
|
|
@@ -23673,13 +23694,69 @@ function TableWrapper(props) {
|
|
|
23673
23694
|
boxShadow: 'none',
|
|
23674
23695
|
alignItems: 'center'
|
|
23675
23696
|
};
|
|
23697
|
+
|
|
23698
|
+
const paginationContent = width => {
|
|
23699
|
+
const fixedRowsPerPage = selectionsAPI.isModal() || width < 550 || size.qcx > 100;
|
|
23700
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TablePagination$1, {
|
|
23701
|
+
sx: constraints.active && {
|
|
23702
|
+
display: 'none'
|
|
23703
|
+
},
|
|
23704
|
+
rowsPerPageOptions: fixedRowsPerPage ? [rowsPerPage] : rowsPerPageOptions,
|
|
23705
|
+
component: "div",
|
|
23706
|
+
count: totalVerticalCount,
|
|
23707
|
+
rowsPerPage: rowsPerPage,
|
|
23708
|
+
labelRowsPerPage: `${translator.get('SNTable.Pagination.RowsPerPage')}:`,
|
|
23709
|
+
page: page,
|
|
23710
|
+
SelectProps: {
|
|
23711
|
+
inputProps: {
|
|
23712
|
+
'aria-label': translator.get('SNTable.Pagination.RowsPerPage'),
|
|
23713
|
+
'data-testid': 'select',
|
|
23714
|
+
style: {
|
|
23715
|
+
color: '#404040'
|
|
23716
|
+
},
|
|
23717
|
+
tabIndex: !keyboard.enabled || keyboard.active ? 0 : -1
|
|
23718
|
+
},
|
|
23719
|
+
native: true
|
|
23720
|
+
},
|
|
23721
|
+
labelDisplayedRows: ({
|
|
23722
|
+
from,
|
|
23723
|
+
to,
|
|
23724
|
+
count
|
|
23725
|
+
}) => width > 250 && translator.get('SNTable.Pagination.DisplayedRowsLabel', [`${from} - ${to}`, count]),
|
|
23726
|
+
onRowsPerPageChange: handleChangeRowsPerPage,
|
|
23727
|
+
ActionsComponent: () => /*#__PURE__*/React__default.createElement("div", null, null),
|
|
23728
|
+
onPageChange: () => {}
|
|
23729
|
+
}), /*#__PURE__*/React__default.createElement(TablePaginationActions, {
|
|
23730
|
+
direction: direction,
|
|
23731
|
+
page: page,
|
|
23732
|
+
onPageChange: handleChangePage,
|
|
23733
|
+
lastPageIdx: Math.ceil(totalVerticalCount / rowsPerPage) - 1,
|
|
23734
|
+
keyboard: keyboard,
|
|
23735
|
+
isInSelectionMode: selectionsAPI.isModal(),
|
|
23736
|
+
tableWidth: width,
|
|
23737
|
+
translator: translator
|
|
23738
|
+
}));
|
|
23739
|
+
};
|
|
23740
|
+
|
|
23741
|
+
let paginationBar;
|
|
23742
|
+
|
|
23743
|
+
if (footerContainer) {
|
|
23744
|
+
paginationBar = /*#__PURE__*/React__default.createElement(Portal, {
|
|
23745
|
+
target: footerContainer
|
|
23746
|
+
}, paginationNeeded && paginationContent(footerContainer.getBoundingClientRect().width));
|
|
23747
|
+
} else {
|
|
23748
|
+
paginationBar = paginationNeeded && /*#__PURE__*/React__default.createElement(Paper$1, {
|
|
23749
|
+
sx: paperTablePaginationStyle
|
|
23750
|
+
}, paginationContent(rect.width));
|
|
23751
|
+
}
|
|
23752
|
+
|
|
23676
23753
|
return /*#__PURE__*/React__default.createElement(Paper$1, {
|
|
23677
23754
|
dir: direction,
|
|
23678
23755
|
sx: paperStyle,
|
|
23679
23756
|
ref: tableWrapperRef,
|
|
23680
23757
|
onKeyDown: evt => handleTableWrapperKeyDown({
|
|
23681
23758
|
evt,
|
|
23682
|
-
|
|
23759
|
+
totalVerticalCount,
|
|
23683
23760
|
page,
|
|
23684
23761
|
rowsPerPage,
|
|
23685
23762
|
handleChangePage,
|
|
@@ -23705,51 +23782,12 @@ function TableWrapper(props) {
|
|
|
23705
23782
|
setFocusedCellCoord: setFocusedCellCoord,
|
|
23706
23783
|
setShouldRefocus: setShouldRefocus,
|
|
23707
23784
|
tableWrapperRef: tableWrapperRef
|
|
23708
|
-
})))),
|
|
23709
|
-
sx: paperTablePaginationStyle
|
|
23710
|
-
}, /*#__PURE__*/React__default.createElement(TablePagination$1, {
|
|
23711
|
-
sx: constraints.active && {
|
|
23712
|
-
display: 'none'
|
|
23713
|
-
},
|
|
23714
|
-
rowsPerPageOptions: fixedRowsPerPage ? [rowsPerPage] : rowsPerPageOptions,
|
|
23715
|
-
component: "div",
|
|
23716
|
-
count: size.qcy,
|
|
23717
|
-
rowsPerPage: rowsPerPage,
|
|
23718
|
-
labelRowsPerPage: `${translator.get('SNTable.Pagination.RowsPerPage')}:`,
|
|
23719
|
-
page: page,
|
|
23720
|
-
SelectProps: {
|
|
23721
|
-
inputProps: {
|
|
23722
|
-
'aria-label': translator.get('SNTable.Pagination.RowsPerPage'),
|
|
23723
|
-
'data-testid': 'select',
|
|
23724
|
-
style: {
|
|
23725
|
-
color: '#404040'
|
|
23726
|
-
},
|
|
23727
|
-
tabIndex: !keyboard.enabled || keyboard.active ? 0 : -1
|
|
23728
|
-
},
|
|
23729
|
-
native: true
|
|
23730
|
-
},
|
|
23731
|
-
labelDisplayedRows: ({
|
|
23732
|
-
from,
|
|
23733
|
-
to,
|
|
23734
|
-
count
|
|
23735
|
-
}) => rect.width > 250 && translator.get('SNTable.Pagination.DisplayedRowsLabel', [`${from} - ${to}`, count]),
|
|
23736
|
-
onRowsPerPageChange: handleChangeRowsPerPage,
|
|
23737
|
-
ActionsComponent: () => /*#__PURE__*/React__default.createElement("div", null, null),
|
|
23738
|
-
onPageChange: () => {}
|
|
23739
|
-
}), /*#__PURE__*/React__default.createElement(TablePaginationActions, {
|
|
23740
|
-
direction: direction,
|
|
23741
|
-
page: page,
|
|
23742
|
-
onPageChange: handleChangePage,
|
|
23743
|
-
lastPageIdx: Math.ceil(size.qcy / rowsPerPage) - 1,
|
|
23744
|
-
keyboard: keyboard,
|
|
23745
|
-
isInSelectionMode: selectionsAPI.isModal(),
|
|
23746
|
-
tableWidth: rect.width,
|
|
23747
|
-
translator: translator
|
|
23748
|
-
})));
|
|
23785
|
+
})))), paginationBar);
|
|
23749
23786
|
}
|
|
23750
23787
|
TableWrapper.defaultProps = {
|
|
23751
23788
|
announcer: null,
|
|
23752
|
-
direction: null
|
|
23789
|
+
direction: null,
|
|
23790
|
+
footerContainer: null
|
|
23753
23791
|
};
|
|
23754
23792
|
TableWrapper.propTypes = {
|
|
23755
23793
|
rootElement: PropTypes.object.isRequired,
|
|
@@ -23761,6 +23799,7 @@ TableWrapper.propTypes = {
|
|
|
23761
23799
|
selectionsAPI: PropTypes.object.isRequired,
|
|
23762
23800
|
keyboard: PropTypes.object.isRequired,
|
|
23763
23801
|
rect: PropTypes.object.isRequired,
|
|
23802
|
+
footerContainer: PropTypes.object,
|
|
23764
23803
|
direction: PropTypes.string,
|
|
23765
23804
|
announcer: PropTypes.func
|
|
23766
23805
|
};
|
|
@@ -24478,7 +24517,8 @@ function supernova(env) {
|
|
|
24478
24517
|
const rootElement = useElement();
|
|
24479
24518
|
const layout = useStaleLayout();
|
|
24480
24519
|
const {
|
|
24481
|
-
direction
|
|
24520
|
+
direction,
|
|
24521
|
+
footerContainer
|
|
24482
24522
|
} = useOptions();
|
|
24483
24523
|
const model = useModel();
|
|
24484
24524
|
const constraints = useConstraints();
|
|
@@ -24512,7 +24552,8 @@ function supernova(env) {
|
|
|
24512
24552
|
theme,
|
|
24513
24553
|
changeSortOrder,
|
|
24514
24554
|
keyboard,
|
|
24515
|
-
rect
|
|
24555
|
+
rect,
|
|
24556
|
+
footerContainer
|
|
24516
24557
|
});
|
|
24517
24558
|
}
|
|
24518
24559
|
}, [tableData, constraints, direction, selectionsAPI.isModal(), theme.name(), keyboard.active, translator.language(), rect.width]);
|