@redsift/table 12.5.5-alpha.2 → 12.5.5-muiv6

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.
@@ -1,126 +0,0 @@
1
- import { a as _objectWithoutProperties, b as _extends } from './_rollupPluginBabelHelpers.js';
2
- import React__default, { forwardRef } from 'react';
3
- import { ButtonsColorPalette, IconButton, Button, Checkbox, Icon } from '@redsift/design-system';
4
- import { mdiFilterVariant, mdiViewColumn, mdiArrowUp, mdiArrowDown, mdiViewHeadline, mdiViewSequential, mdiViewStream, mdiChevronDown, mdiChevronRight, mdiTrayArrowDown } from '@redsift/icons';
5
-
6
- const _excluded$3 = ["children", "color", "onClick", "startIcon"];
7
- const BaseButton = /*#__PURE__*/forwardRef((props, ref) => {
8
- var _props$className;
9
- const {
10
- children,
11
- color: propsColor,
12
- onClick,
13
- startIcon
14
- } = props,
15
- forwardedProps = _objectWithoutProperties(props, _excluded$3);
16
- const color = Object.keys(ButtonsColorPalette).includes(propsColor) ? propsColor : 'primary';
17
- if ((_props$className = props.className) !== null && _props$className !== void 0 && _props$className.includes('redsift-condensed')) {
18
- return /*#__PURE__*/React__default.createElement(IconButton, _extends({}, forwardedProps, {
19
- color: color,
20
- onClick: onClick,
21
- ref: ref,
22
- variant: "unstyled",
23
- isActive: props['aria-expanded'] === 'true',
24
- icon: typeof startIcon !== 'string' ? /*#__PURE__*/React__default.cloneElement(startIcon, {
25
- fontSize: 'medium'
26
- }) : startIcon,
27
- "aria-label": children,
28
- size: "medium"
29
- }));
30
- }
31
- return /*#__PURE__*/React__default.createElement(Button, _extends({}, forwardedProps, {
32
- color: color,
33
- onClick: onClick,
34
- ref: ref,
35
- variant: "unstyled",
36
- isActive: props['aria-expanded'] === 'true',
37
- leftIcon: startIcon
38
- }), children);
39
- });
40
-
41
- const _excluded$2 = ["checked", "indeterminate", "disabled", "onChange", "label", "slotProps", "material", "field", "isSelected", "inputProps", "touchRippleRef"];
42
- const BaseCheckbox = /*#__PURE__*/forwardRef((props, ref) => {
43
- const {
44
- checked,
45
- indeterminate,
46
- disabled,
47
- onChange,
48
- label,
49
- // MUI DataGrid v8 injects these props — strip them to avoid DOM warnings
50
- slotProps,
51
- material,
52
- field,
53
- isSelected,
54
- inputProps,
55
- touchRippleRef
56
- } = props,
57
- forwardedProps = _objectWithoutProperties(props, _excluded$2);
58
- return /*#__PURE__*/React__default.createElement(Checkbox, _extends({}, forwardedProps, inputProps, {
59
- isSelected: checked && !indeterminate,
60
- isDisabled: disabled,
61
- isIndeterminate: indeterminate,
62
- ref: ref,
63
- onChange: (isChecked, value, name, event) => onChange(event),
64
- "aria-label": label || 'Select row'
65
- }), label);
66
- });
67
-
68
- const _excluded$1 = ["displayName"];
69
- const muiIconToDSIcon = {
70
- columnFilteredIcon: mdiFilterVariant,
71
- columnSelectorIcon: mdiViewColumn,
72
- columnSortedAscendingIcon: mdiArrowUp,
73
- columnSortedDescendingIcon: mdiArrowDown,
74
- densityCompactIcon: mdiViewHeadline,
75
- densityStandardIcon: mdiViewSequential,
76
- densityComfortableIcon: mdiViewStream,
77
- detailPanelCollapseIcon: mdiChevronDown,
78
- detailPanelExpandIcon: mdiChevronRight,
79
- exportIcon: mdiTrayArrowDown,
80
- openFilterButtonIcon: mdiFilterVariant
81
- };
82
- const BaseIcon = /*#__PURE__*/forwardRef((props, ref) => {
83
- const {
84
- displayName
85
- } = props,
86
- forwardedProps = _objectWithoutProperties(props, _excluded$1);
87
- return /*#__PURE__*/React__default.createElement(Icon, _extends({}, forwardedProps, forwardedProps.inputProps, {
88
- ref: ref,
89
- size: forwardedProps.fontSize,
90
- icon: muiIconToDSIcon[displayName]
91
- }));
92
- });
93
-
94
- const _excluded = ["children", "color", "onClick", "field"];
95
- const BaseIconButton = /*#__PURE__*/forwardRef((props, ref) => {
96
- const {
97
- children,
98
- color: propsColor,
99
- onClick,
100
- field
101
- } = props,
102
- forwardedProps = _objectWithoutProperties(props, _excluded);
103
- const color = Object.keys(ButtonsColorPalette).includes(propsColor) ? propsColor : 'primary';
104
-
105
- // MUI passes the icon as children (already rendered), but DS IconButton expects an icon prop
106
- // We pass children directly as the icon - the Icon component can handle ReactElements
107
- return /*#__PURE__*/React__default.createElement(IconButton, _extends({}, forwardedProps, {
108
- color: color,
109
- onClick: onClick,
110
- ref: ref,
111
- variant: "unstyled",
112
- isActive: props['aria-expanded'] === 'true',
113
- icon: children,
114
- size: "medium",
115
- iconProps: {
116
- style: {
117
- display: 'flex',
118
- alignItems: 'center',
119
- justifyContent: 'center'
120
- }
121
- }
122
- }));
123
- });
124
-
125
- export { BaseButton as B, BaseCheckbox as a, BaseIcon as b, BaseIconButton as c, muiIconToDSIcon as m };
126
- //# sourceMappingURL=BaseIconButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseIconButton.js","sources":["../../src/components/BaseComponents/BaseButton.tsx","../../src/components/BaseComponents/BaseCheckbox.tsx","../../src/components/BaseComponents/BaseIcon.tsx","../../src/components/BaseComponents/BaseIconButton.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { Button, ButtonsColorPalette, IconButton } from '@redsift/design-system';\n\nexport const BaseButton: React.JSXElementConstructor<any> = forwardRef((props, ref) => {\n const { children, color: propsColor, onClick, startIcon, ...forwardedProps } = props;\n\n const color = Object.keys(ButtonsColorPalette).includes(propsColor) ? propsColor : 'primary';\n\n if (props.className?.includes('redsift-condensed')) {\n return (\n <IconButton\n {...forwardedProps}\n color={color}\n onClick={onClick}\n ref={ref}\n variant=\"unstyled\"\n isActive={props['aria-expanded'] === 'true'}\n icon={typeof startIcon !== 'string' ? React.cloneElement(startIcon, { fontSize: 'medium' }) : startIcon}\n aria-label={children}\n size=\"medium\"\n />\n );\n }\n\n return (\n <Button\n {...forwardedProps}\n color={color}\n onClick={onClick}\n ref={ref}\n variant=\"unstyled\"\n isActive={props['aria-expanded'] === 'true'}\n leftIcon={startIcon}\n >\n {children}\n </Button>\n );\n});\n","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport React, { forwardRef, MutableRefObject } from 'react';\nimport { Checkbox } from '@redsift/design-system';\n\nexport const BaseCheckbox: React.JSXElementConstructor<any> = forwardRef((props, ref) => {\n const {\n checked,\n indeterminate,\n disabled,\n onChange,\n label,\n // MUI DataGrid v8 injects these props — strip them to avoid DOM warnings\n slotProps,\n material,\n field,\n isSelected,\n inputProps,\n touchRippleRef,\n ...forwardedProps\n } = props;\n\n return (\n <Checkbox\n {...forwardedProps}\n {...inputProps}\n isSelected={checked && !indeterminate}\n isDisabled={disabled}\n isIndeterminate={indeterminate}\n ref={ref as MutableRefObject<HTMLLabelElement>}\n onChange={(isChecked, value, name, event) => onChange(event)}\n aria-label={label || 'Select row'}\n >\n {label}\n </Checkbox>\n );\n});\n","import React, { forwardRef } from 'react';\nimport { Icon } from '@redsift/design-system';\nimport {\n mdiArrowDown,\n mdiArrowUp,\n mdiChevronDown,\n mdiChevronRight,\n mdiFilterVariant,\n mdiTrayArrowDown,\n mdiViewColumn,\n mdiViewHeadline,\n mdiViewSequential,\n mdiViewStream,\n} from '@redsift/icons';\nimport { GridSlotsComponent } from '@mui/x-data-grid-premium';\n\nexport const muiIconToDSIcon: Partial<Record<keyof GridSlotsComponent, string>> = {\n columnFilteredIcon: mdiFilterVariant,\n columnSelectorIcon: mdiViewColumn,\n columnSortedAscendingIcon: mdiArrowUp,\n columnSortedDescendingIcon: mdiArrowDown,\n densityCompactIcon: mdiViewHeadline,\n densityStandardIcon: mdiViewSequential,\n densityComfortableIcon: mdiViewStream,\n detailPanelCollapseIcon: mdiChevronDown,\n detailPanelExpandIcon: mdiChevronRight,\n exportIcon: mdiTrayArrowDown,\n openFilterButtonIcon: mdiFilterVariant,\n};\n\nexport const BaseIcon: React.JSXElementConstructor<any> = forwardRef((props, ref) => {\n const { displayName, ...forwardedProps } = props;\n\n return (\n <Icon\n {...forwardedProps}\n {...forwardedProps.inputProps}\n ref={ref}\n size={forwardedProps.fontSize}\n icon={muiIconToDSIcon[displayName as keyof GridSlotsComponent]}\n />\n );\n});\n","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport React, { forwardRef } from 'react';\nimport { IconButton, ButtonsColorPalette } from '@redsift/design-system';\n\nexport const BaseIconButton: React.JSXElementConstructor<any> = forwardRef((props, ref) => {\n const { children, color: propsColor, onClick, field, ...forwardedProps } = props;\n\n const color = Object.keys(ButtonsColorPalette).includes(propsColor) ? propsColor : 'primary';\n\n // MUI passes the icon as children (already rendered), but DS IconButton expects an icon prop\n // We pass children directly as the icon - the Icon component can handle ReactElements\n return (\n <IconButton\n {...forwardedProps}\n color={color}\n onClick={onClick}\n ref={ref}\n variant=\"unstyled\"\n isActive={props['aria-expanded'] === 'true'}\n icon={children}\n size=\"medium\"\n iconProps={{ style: { display: 'flex', alignItems: 'center', justifyContent: 'center' } }}\n />\n );\n});\n"],"names":["BaseButton","forwardRef","props","ref","_props$className","children","color","propsColor","onClick","startIcon","forwardedProps","_objectWithoutProperties","_excluded","Object","keys","ButtonsColorPalette","includes","className","React","createElement","IconButton","_extends","variant","isActive","icon","cloneElement","fontSize","size","Button","leftIcon","BaseCheckbox","checked","indeterminate","disabled","onChange","label","slotProps","material","field","isSelected","inputProps","touchRippleRef","Checkbox","isDisabled","isIndeterminate","isChecked","value","name","event","muiIconToDSIcon","columnFilteredIcon","mdiFilterVariant","columnSelectorIcon","mdiViewColumn","columnSortedAscendingIcon","mdiArrowUp","columnSortedDescendingIcon","mdiArrowDown","densityCompactIcon","mdiViewHeadline","densityStandardIcon","mdiViewSequential","densityComfortableIcon","mdiViewStream","detailPanelCollapseIcon","mdiChevronDown","detailPanelExpandIcon","mdiChevronRight","exportIcon","mdiTrayArrowDown","openFilterButtonIcon","BaseIcon","displayName","Icon","BaseIconButton","iconProps","style","display","alignItems","justifyContent"],"mappings":";;;;;;AAGO,MAAMA,UAA4C,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;AAAA,EAAA,IAAAC,gBAAA,CAAA;EACrF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KAAM;AACbE,IAAAA,OAAO,EAAEA,OAAQ;AACjBL,IAAAA,GAAG,EAAEA,GAAI;AACTmB,IAAAA,OAAO,EAAC,UAAU;AAClBC,IAAAA,QAAQ,EAAErB,KAAK,CAAC,eAAe,CAAC,KAAK,MAAO;AAC5CsB,IAAAA,IAAI,EAAEnB,QAAS;AACfsB,IAAAA,IAAI,EAAC,QAAQ;AACbgD,IAAAA,SAAS,EAAE;AAAEC,MAAAA,KAAK,EAAE;AAAEC,QAAAA,OAAO,EAAE,MAAM;AAAEC,QAAAA,UAAU,EAAE,QAAQ;AAAEC,QAAAA,cAAc,EAAE,QAAA;AAAS,OAAA;AAAE,KAAA;AAAE,GAAA,CAC3F,CAAC,CAAA;AAEN,CAAC;;;;"}
@@ -1,324 +0,0 @@
1
- import { b as _extends } from './_rollupPluginBabelHelpers.js';
2
- import React__default from 'react';
3
- import { Flexbox, Text, LinkButton } from '@redsift/design-system';
4
- import { gridFilteredSortedRowEntriesSelector, gridFilteredSortedRowIdsSelector, gridExpandedSortedRowEntriesSelector } from '@mui/x-data-grid-premium';
5
- import TablePagination from '@mui/material/TablePagination';
6
-
7
- /**
8
- * Type for legacy array-based row selection (v7 and earlier)
9
- */
10
-
11
- /**
12
- * Type that accepts both legacy array format and new v8 object format
13
- */
14
-
15
- /**
16
- * Default empty row selection model for MUI DataGrid v8+
17
- * In v8, GridRowSelectionModel changed from GridRowId[] to { type: 'include' | 'exclude'; ids: Set<GridRowId> }
18
- */
19
- const EMPTY_ROW_SELECTION_MODEL = {
20
- type: 'include',
21
- ids: new Set()
22
- };
23
-
24
- /**
25
- * Creates a new row selection model with the given ids
26
- */
27
- const createRowSelectionModel = ids => ({
28
- type: 'include',
29
- ids: ids instanceof Set ? ids : new Set(ids)
30
- });
31
-
32
- /**
33
- * Normalizes a row selection model input to the v8 GridRowSelectionModel format.
34
- * Accepts both legacy array format (v7) and new object format (v8).
35
- * This allows consumers to continue using arrays while internally using the v8 format.
36
- */
37
- const normalizeRowSelectionModel = input => {
38
- if (!input) {
39
- return EMPTY_ROW_SELECTION_MODEL;
40
- }
41
- // If it's an array (legacy v7 format), convert to v8 format
42
- if (Array.isArray(input)) {
43
- return createRowSelectionModel(input);
44
- }
45
- // Already in v8 format
46
- return input;
47
- };
48
-
49
- /**
50
- * Gets the size/count of selected rows from a selection model
51
- */
52
- const getSelectionCount = model => {
53
- return model.ids.size;
54
- };
55
-
56
- /**
57
- * Checks if a row is selected in the given selection model
58
- */
59
- const isRowSelected = (model, rowId) => {
60
- if (model.type === 'include') {
61
- return model.ids.has(rowId);
62
- }
63
- // For 'exclude' type, row is selected if it's NOT in the ids set
64
- return !model.ids.has(rowId);
65
- };
66
-
67
- /**
68
- * Converts a selection model to an array of selected row IDs
69
- * Note: For 'exclude' type, this only returns the ids that are explicitly excluded,
70
- * not the actual selected rows (which would require knowing all row ids)
71
- */
72
- const getSelectedIds = model => {
73
- return Array.from(model.ids);
74
- };
75
-
76
- const getSelectableRowsInTable = (apiRef, isRowSelectable) => {
77
- if (!apiRef.current) {
78
- return [];
79
- }
80
- return isRowSelectable && typeof isRowSelectable === 'function' ? gridFilteredSortedRowEntriesSelector(apiRef).filter(_ref => {
81
- let {
82
- model
83
- } = _ref;
84
- return isRowSelectable === null || isRowSelectable === void 0 ? void 0 : isRowSelectable({
85
- row: model
86
- });
87
- }).map(_ref2 => {
88
- let {
89
- id
90
- } = _ref2;
91
- return id;
92
- }) : gridFilteredSortedRowIdsSelector(apiRef);
93
- };
94
- const ControlledPagination = _ref3 => {
95
- let {
96
- displaySelection = false,
97
- displayRowsPerPage = false,
98
- displayPagination = false,
99
- selectionStatus,
100
- apiRef,
101
- paginationModel,
102
- onPaginationModelChange,
103
- pageSizeOptions,
104
- isRowSelectable,
105
- paginationProps
106
- } = _ref3;
107
- const filteredRowsInTable = getSelectableRowsInTable(apiRef);
108
- const selectableRowsInTable = getSelectableRowsInTable(apiRef, isRowSelectable);
109
- const numberOfFilteredRowsInTable = filteredRowsInTable.length;
110
- const numberOfSelectableRowsInTable = selectableRowsInTable.length;
111
- return /*#__PURE__*/React__default.createElement(Flexbox, {
112
- flexDirection: "row",
113
- alignItems: "center",
114
- justifyContent: "space-between",
115
- marginBottom: "7px"
116
- }, displaySelection ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, selectionStatus.type === 'page' ? /*#__PURE__*/React__default.createElement(Text, {
117
- fontSize: "14px"
118
- }, `All ${selectionStatus.numberOfSelectedRows}${numberOfFilteredRowsInTable !== numberOfSelectableRowsInTable ? ' selectable' : ''} rows on this page are selected. `, /*#__PURE__*/React__default.createElement(LinkButton, {
119
- onClick: () => {
120
- var _apiRef$current, _apiRef$current2;
121
- (_apiRef$current = apiRef.current) === null || _apiRef$current === void 0 ? void 0 : _apiRef$current.selectRows(numberOfSelectableRowsInTable ? selectableRowsInTable : (_apiRef$current2 = apiRef.current) === null || _apiRef$current2 === void 0 ? void 0 : _apiRef$current2.getAllRowIds());
122
- }
123
- }, "Select all ", numberOfSelectableRowsInTable, numberOfFilteredRowsInTable !== numberOfSelectableRowsInTable ? ' selectable' : '', " rows in the table.")) : selectionStatus.type === 'table' ? /*#__PURE__*/React__default.createElement(Text, {
124
- fontSize: "14px"
125
- }, `All ${selectionStatus.numberOfSelectedRows}${numberOfFilteredRowsInTable !== numberOfSelectableRowsInTable ? ' selectable' : ''} rows in the table are selected. `, /*#__PURE__*/React__default.createElement(LinkButton, {
126
- onClick: () => {
127
- var _apiRef$current3;
128
- (_apiRef$current3 = apiRef.current) === null || _apiRef$current3 === void 0 ? void 0 : _apiRef$current3.selectRows([], false, true);
129
- }
130
- }, "Clear selection.")) : selectionStatus.type === 'other' ? /*#__PURE__*/React__default.createElement(Text, {
131
- fontSize: "14px"
132
- }, `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination, _extends({
133
- component: "div",
134
- count: numberOfFilteredRowsInTable,
135
- page: paginationModel.page,
136
- onPageChange: (event, page) => {
137
- onPaginationModelChange({
138
- page,
139
- pageSize: paginationModel.pageSize
140
- }, {
141
- reason: 'setPaginationModel'
142
- });
143
- },
144
- rowsPerPage: paginationModel.pageSize,
145
- onRowsPerPageChange: event => {
146
- // Reset to page 0 when pageSize changes — keeping the same page index would
147
- // commonly leave the user past the end of the data.
148
- onPaginationModelChange({
149
- page: 0,
150
- pageSize: parseInt(event.target.value, 10)
151
- }, {
152
- reason: 'setPaginationModel'
153
- });
154
- },
155
- rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
156
- }, paginationProps)) : null);
157
- };
158
-
159
- /**
160
- * Get the IDs of all selectable rows currently loaded in the grid (i.e. the current page for server-side).
161
- */
162
- const getSelectableRowIdsInPage = (apiRef, isRowSelectable) => {
163
- const rowsInPage = Array.from(gridExpandedSortedRowEntriesSelector(apiRef));
164
- return isRowSelectable ? rowsInPage.filter(_ref => {
165
- let {
166
- id,
167
- model
168
- } = _ref;
169
- return isRowSelectable({
170
- id,
171
- row: model
172
- });
173
- }).map(_ref2 => {
174
- let {
175
- id
176
- } = _ref2;
177
- return id;
178
- }) : rowsInPage.map(_ref3 => {
179
- let {
180
- id
181
- } = _ref3;
182
- return id;
183
- });
184
- };
185
-
186
- /**
187
- * Intercept MUI's `onRowSelectionModelChange` for server-side pagination to fix the
188
- * header checkbox behavior when cross-page selections exist.
189
- *
190
- * Problem: With `checkboxSelectionVisibleOnly=false` and `keepNonExistentRowsSelected`,
191
- * the header checkbox shows "indeterminate" when rows from other pages are selected but
192
- * none on the current page. Clicking it makes MUI deselect everything (treating it as a
193
- * global toggle-off), but the user's intent is to select the current page.
194
- *
195
- * Fix: When MUI empties the selection model and the previous status was 'other' (cross-page
196
- * selections with 0 selected on current page), we merge all current page rows with the
197
- * existing cross-page selections instead.
198
- */
199
- const fixServerSideHeaderCheckboxSelection = (newSelectionModel, previousSelectionModel, selectionStatus, apiRef, isRowSelectable) => {
200
- // Detect: MUI cleared everything, but we had cross-page selections with 0 on current page.
201
- // This means the header checkbox was clicked in indeterminate state → user wants to select current page.
202
- if (getSelectionCount(newSelectionModel) === 0 && getSelectionCount(previousSelectionModel) > 0 && selectionStatus.current.type === 'other' && selectionStatus.current.numberOfSelectedRowsInPage === 0) {
203
- const selectableInPage = getSelectableRowIdsInPage(apiRef, isRowSelectable);
204
- // Merge: keep existing cross-page selections + add all current page rows
205
- const mergedIds = new Set(previousSelectionModel.ids);
206
- for (const id of selectableInPage) {
207
- mergedIds.add(id);
208
- }
209
- return {
210
- type: 'include',
211
- ids: mergedIds
212
- };
213
- }
214
- return newSelectionModel;
215
- };
216
- const onServerSideSelectionStatusChange = (newSelectionModel, apiRef, selectionStatus, forceUpdate, isRowSelectable, page, pageSize) => {
217
- if (!apiRef.current) {
218
- return;
219
- }
220
-
221
- // We can't rely on the gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef) function to fetch the list of visible rows
222
- // as it doesn't work properly when all rows are selected on a page via checkbox
223
- // and then navigate to another page.
224
- // So instead we fetch the visible rows directly from the apiRef state, since the logic in `onServerSideSelectionStatusChange` applies
225
- // to server-side pagination only and visible rows are all loaded rows.
226
- // The bug may have been latent for several MUI releases now, as it seems to have been fixed in MUI v7.
227
- // See https://github.com/mui/mui-x/pull/14083
228
- const selectableRowsInPage = getSelectableRowIdsInPage(apiRef, isRowSelectable);
229
- const numberOfSelectableRowsInPage = selectableRowsInPage.length;
230
- const numberOfSelectedRows = getSelectionCount(newSelectionModel);
231
- const selectedRowsInPage = selectableRowsInPage.filter(rowId => isRowSelected(newSelectionModel, rowId));
232
- const numberOfSelectedRowsInPage = selectedRowsInPage.length;
233
- const isSamePage = (selectionStatus === null || selectionStatus === void 0 ? void 0 : selectionStatus.current.page) == page;
234
- const isSamePageSize = (selectionStatus === null || selectionStatus === void 0 ? void 0 : selectionStatus.current.pageSize) == pageSize;
235
-
236
- // if previous status is `page`,
237
- // if page and pageSize didn't change
238
- // and all the rows are selected, deselect all row
239
- if (selectionStatus.current.type === 'page' && isSamePage && isSamePageSize && numberOfSelectedRowsInPage === numberOfSelectableRowsInPage) {
240
- setTimeout(() => {
241
- var _apiRef$current;
242
- (_apiRef$current = apiRef.current) === null || _apiRef$current === void 0 ? void 0 : _apiRef$current.selectRows(selectedRowsInPage, false, false);
243
- }, 0);
244
- }
245
- if (numberOfSelectedRowsInPage === numberOfSelectableRowsInPage && numberOfSelectableRowsInPage != 0) {
246
- selectionStatus.current = {
247
- type: 'page',
248
- numberOfSelectedRows,
249
- numberOfSelectedRowsInPage,
250
- page,
251
- pageSize
252
- };
253
- } else if (numberOfSelectedRows > 0) {
254
- selectionStatus.current = {
255
- type: 'other',
256
- numberOfSelectedRows,
257
- numberOfSelectedRowsInPage,
258
- page,
259
- pageSize
260
- };
261
- } else {
262
- selectionStatus.current = {
263
- type: 'none',
264
- numberOfSelectedRows,
265
- numberOfSelectedRowsInPage,
266
- page,
267
- pageSize
268
- };
269
- }
270
-
271
- // Force a re-render to update the UI with the new selection status
272
- forceUpdate(v => v + 1);
273
- };
274
- const ServerSideControlledPagination = _ref4 => {
275
- let {
276
- selectionStatus,
277
- displaySelection,
278
- displayPagination,
279
- paginationModel,
280
- onPaginationModelChange,
281
- pageSizeOptions,
282
- displayRowsPerPage,
283
- paginationProps,
284
- rowCount
285
- } = _ref4;
286
- const totalNumberOfRowsInTable = rowCount;
287
- const totalRowsLabel = `${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected`;
288
- const pageRowsLabel = `All ${selectionStatus.numberOfSelectedRowsInPage} selectable rows on this page are selected${selectionStatus.numberOfSelectedRows != selectionStatus.numberOfSelectedRowsInPage ? ` (${selectionStatus.numberOfSelectedRows} row${selectionStatus.numberOfSelectedRows > 1 ? 's' : ''} selected in total)` : ''}.`;
289
- return /*#__PURE__*/React__default.createElement(Flexbox, {
290
- flexDirection: "row",
291
- alignItems: "center",
292
- justifyContent: "space-between",
293
- marginBottom: "7px"
294
- }, displaySelection ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, selectionStatus.type === 'page' && selectionStatus.numberOfSelectedRowsInPage != 0 ? /*#__PURE__*/React__default.createElement(Text, {
295
- fontSize: "14px"
296
- }, pageRowsLabel) : selectionStatus.type === 'other' ? /*#__PURE__*/React__default.createElement(Text, {
297
- fontSize: "14px"
298
- }, totalRowsLabel) : /*#__PURE__*/React__default.createElement(Text, null)) : null, displayPagination ? /*#__PURE__*/React__default.createElement(TablePagination, _extends({
299
- component: "div",
300
- count: totalNumberOfRowsInTable,
301
- page: paginationModel.page,
302
- onPageChange: (event, page) => onPaginationModelChange({
303
- page,
304
- pageSize: paginationModel.pageSize
305
- }, {
306
- reason: 'setPaginationModel'
307
- }),
308
- rowsPerPage: paginationModel.pageSize,
309
- onRowsPerPageChange: event =>
310
- // Reset to page 0 when pageSize changes — keeping the same page index would
311
- // commonly leave the user past the end of the data (e.g. page 2 of 50 → page 2
312
- // of 100 when there are only 84 total rows), producing a "101-84 of 84" label.
313
- onPaginationModelChange({
314
- page: 0,
315
- pageSize: parseInt(event.target.value, 10)
316
- }, {
317
- reason: 'setPaginationModel'
318
- }),
319
- rowsPerPageOptions: displayRowsPerPage ? pageSizeOptions : []
320
- }, paginationProps)) : null);
321
- };
322
-
323
- export { ControlledPagination as C, EMPTY_ROW_SELECTION_MODEL as E, ServerSideControlledPagination as S, getSelectedIds as a, getSelectableRowIdsInPage as b, createRowSelectionModel as c, fixServerSideHeaderCheckboxSelection as f, getSelectionCount as g, isRowSelected as i, normalizeRowSelectionModel as n, onServerSideSelectionStatusChange as o };
324
- //# sourceMappingURL=ServerSideControlledPagination.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ServerSideControlledPagination.js","sources":["../../src/utils/rowSelection.ts","../../src/components/Pagination/ControlledPagination.tsx","../../src/components/Pagination/ServerSideControlledPagination.tsx"],"sourcesContent":["import { GridRowId, GridRowSelectionModel } from '@mui/x-data-grid-premium';\n\n/**\n * Type for legacy array-based row selection (v7 and earlier)\n */\nexport type LegacyRowSelectionModel = GridRowId[];\n\n/**\n * Type that accepts both legacy array format and new v8 object format\n */\nexport type RowSelectionModelInput = LegacyRowSelectionModel | GridRowSelectionModel;\n\n/**\n * Default empty row selection model for MUI DataGrid v8+\n * In v8, GridRowSelectionModel changed from GridRowId[] to { type: 'include' | 'exclude'; ids: Set<GridRowId> }\n */\nexport const EMPTY_ROW_SELECTION_MODEL: GridRowSelectionModel = {\n type: 'include',\n ids: new Set(),\n};\n\n/**\n * Creates a new row selection model with the given ids\n */\nexport const createRowSelectionModel = (ids: GridRowId[] | Set<GridRowId>): GridRowSelectionModel => ({\n type: 'include',\n ids: ids instanceof Set ? ids : new Set(ids),\n});\n\n/**\n * Normalizes a row selection model input to the v8 GridRowSelectionModel format.\n * Accepts both legacy array format (v7) and new object format (v8).\n * This allows consumers to continue using arrays while internally using the v8 format.\n */\nexport const normalizeRowSelectionModel = (input: RowSelectionModelInput | undefined | null): GridRowSelectionModel => {\n if (!input) {\n return EMPTY_ROW_SELECTION_MODEL;\n }\n // If it's an array (legacy v7 format), convert to v8 format\n if (Array.isArray(input)) {\n return createRowSelectionModel(input);\n }\n // Already in v8 format\n return input;\n};\n\n/**\n * Gets the size/count of selected rows from a selection model\n */\nexport const getSelectionCount = (model: GridRowSelectionModel): number => {\n return model.ids.size;\n};\n\n/**\n * Checks if a row is selected in the given selection model\n */\nexport const isRowSelected = (model: GridRowSelectionModel, rowId: GridRowId): boolean => {\n if (model.type === 'include') {\n return model.ids.has(rowId);\n }\n // For 'exclude' type, row is selected if it's NOT in the ids set\n return !model.ids.has(rowId);\n};\n\n/**\n * Converts a selection model to an array of selected row IDs\n * Note: For 'exclude' type, this only returns the ids that are explicitly excluded,\n * not the actual selected rows (which would require knowing all row ids)\n */\nexport const getSelectedIds = (model: GridRowSelectionModel): GridRowId[] => {\n return Array.from(model.ids);\n};\n","import React, { MutableRefObject } from 'react';\nimport { Flexbox, LinkButton, Text } from '@redsift/design-system';\nimport {\n GridCallbackDetails,\n gridFilteredSortedRowEntriesSelector,\n gridFilteredSortedRowIdsSelector,\n GridPaginationModel,\n GridRowParams,\n GridApiPremium,\n} from '@mui/x-data-grid-premium';\n\nimport { DataGridProps, SelectionStatus } from '../DataGrid/types';\nimport TablePagination from '@mui/material/TablePagination';\n\nconst getSelectableRowsInTable = (\n apiRef: React.MutableRefObject<GridApiPremium | null>,\n isRowSelectable?: DataGridProps['isRowSelectable']\n) => {\n if (!apiRef.current) {\n return [];\n }\n return isRowSelectable && typeof isRowSelectable === 'function'\n ? gridFilteredSortedRowEntriesSelector(apiRef)\n .filter(({ model }) => isRowSelectable?.({ row: model } as GridRowParams))\n .map(({ id }) => id)\n : gridFilteredSortedRowIdsSelector(apiRef);\n};\n\nexport type ControlledPaginationProps = {\n displaySelection?: boolean;\n displayRowsPerPage?: boolean;\n displayPagination?: boolean;\n selectionStatus: SelectionStatus;\n apiRef: MutableRefObject<GridApiPremium | null>;\n paginationModel: GridPaginationModel;\n onPaginationModelChange: (model: GridPaginationModel, details: GridCallbackDetails<'pagination'>) => void;\n pageSizeOptions?: number[];\n isRowSelectable?: DataGridProps['isRowSelectable'];\n paginationProps?: DataGridProps['paginationProps'];\n};\n\nexport const ControlledPagination: React.FC<ControlledPaginationProps> = ({\n displaySelection = false,\n displayRowsPerPage = false,\n displayPagination = false,\n selectionStatus,\n apiRef,\n paginationModel,\n onPaginationModelChange,\n pageSizeOptions,\n isRowSelectable,\n paginationProps,\n}) => {\n const filteredRowsInTable = getSelectableRowsInTable(apiRef);\n const selectableRowsInTable = getSelectableRowsInTable(apiRef, isRowSelectable);\n const numberOfFilteredRowsInTable = filteredRowsInTable.length;\n const numberOfSelectableRowsInTable = selectableRowsInTable.length;\n\n return (\n <Flexbox flexDirection=\"row\" alignItems=\"center\" justifyContent=\"space-between\" marginBottom=\"7px\">\n {displaySelection ? (\n <>\n {selectionStatus.type === 'page' ? (\n <Text fontSize=\"14px\">\n {`All ${selectionStatus.numberOfSelectedRows}${\n numberOfFilteredRowsInTable !== numberOfSelectableRowsInTable ? ' selectable' : ''\n } rows on this page are selected. `}\n <LinkButton\n onClick={() => {\n apiRef.current?.selectRows(\n numberOfSelectableRowsInTable ? selectableRowsInTable : apiRef.current?.getAllRowIds()\n );\n }}\n >\n Select all {numberOfSelectableRowsInTable}\n {numberOfFilteredRowsInTable !== numberOfSelectableRowsInTable ? ' selectable' : ''} rows in the table.\n </LinkButton>\n </Text>\n ) : selectionStatus.type === 'table' ? (\n <Text fontSize=\"14px\">\n {`All ${selectionStatus.numberOfSelectedRows}${\n numberOfFilteredRowsInTable !== numberOfSelectableRowsInTable ? ' selectable' : ''\n } rows in the table are selected. `}\n <LinkButton\n onClick={() => {\n apiRef.current?.selectRows([], false, true);\n }}\n >\n Clear selection.\n </LinkButton>\n </Text>\n ) : selectionStatus.type === 'other' ? (\n <Text fontSize=\"14px\">{`${selectionStatus.numberOfSelectedRows} row${\n selectionStatus.numberOfSelectedRows > 1 ? 's' : ''\n } selected`}</Text>\n ) : (\n <Text />\n )}\n </>\n ) : null}\n {displayPagination ? (\n <TablePagination\n component=\"div\"\n count={numberOfFilteredRowsInTable}\n page={paginationModel.page}\n onPageChange={(event: React.MouseEvent<HTMLButtonElement> | null, page: number) => {\n onPaginationModelChange({ page, pageSize: paginationModel.pageSize }, {\n reason: 'setPaginationModel',\n } as GridCallbackDetails<'pagination'>);\n }}\n rowsPerPage={paginationModel.pageSize}\n onRowsPerPageChange={(event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n // Reset to page 0 when pageSize changes — keeping the same page index would\n // commonly leave the user past the end of the data.\n onPaginationModelChange({ page: 0, pageSize: parseInt(event.target.value, 10) }, {\n reason: 'setPaginationModel',\n } as GridCallbackDetails<'pagination'>);\n }}\n rowsPerPageOptions={displayRowsPerPage ? pageSizeOptions : []}\n {...paginationProps}\n />\n ) : null}\n </Flexbox>\n );\n};\n","import React from 'react';\nimport { Flexbox, Text } from '@redsift/design-system';\n\nimport { DataGridProps, SelectionStatus } from '../DataGrid/types';\nimport TablePagination from '@mui/material/TablePagination';\nimport {\n GridApiPremium,\n GridCallbackDetails,\n gridExpandedSortedRowEntriesSelector,\n GridPaginationModel,\n GridRowId,\n GridRowParams,\n GridRowSelectionModel,\n} from '@mui/x-data-grid-premium';\nimport { getSelectionCount, isRowSelected } from '../../utils/rowSelection';\n\nexport type ServerSideControlledPaginationProps = {\n displaySelection?: boolean;\n displayRowsPerPage?: boolean;\n displayPagination?: boolean;\n selectionStatus: SelectionStatus;\n paginationModel: GridPaginationModel;\n onPaginationModelChange: (model: GridPaginationModel, details: GridCallbackDetails<'pagination'>) => void;\n pageSizeOptions?: number[];\n paginationProps?: DataGridProps['paginationProps'];\n rowCount: number;\n loading?: boolean;\n};\n\n/**\n * Get the IDs of all selectable rows currently loaded in the grid (i.e. the current page for server-side).\n */\nexport const getSelectableRowIdsInPage = (\n apiRef: React.MutableRefObject<GridApiPremium>,\n isRowSelectable: ((params: GridRowParams<any>) => boolean) | undefined\n): GridRowId[] => {\n const rowsInPage = Array.from(gridExpandedSortedRowEntriesSelector(apiRef));\n return isRowSelectable\n ? rowsInPage.filter(({ id, model }) => isRowSelectable({ id, row: model } as GridRowParams)).map(({ id }) => id)\n : rowsInPage.map(({ id }) => id);\n};\n\n/**\n * Intercept MUI's `onRowSelectionModelChange` for server-side pagination to fix the\n * header checkbox behavior when cross-page selections exist.\n *\n * Problem: With `checkboxSelectionVisibleOnly=false` and `keepNonExistentRowsSelected`,\n * the header checkbox shows \"indeterminate\" when rows from other pages are selected but\n * none on the current page. Clicking it makes MUI deselect everything (treating it as a\n * global toggle-off), but the user's intent is to select the current page.\n *\n * Fix: When MUI empties the selection model and the previous status was 'other' (cross-page\n * selections with 0 selected on current page), we merge all current page rows with the\n * existing cross-page selections instead.\n */\nexport const fixServerSideHeaderCheckboxSelection = (\n newSelectionModel: GridRowSelectionModel,\n previousSelectionModel: GridRowSelectionModel,\n selectionStatus: React.MutableRefObject<SelectionStatus>,\n apiRef: React.MutableRefObject<GridApiPremium>,\n isRowSelectable: ((params: GridRowParams<any>) => boolean) | undefined\n): GridRowSelectionModel => {\n // Detect: MUI cleared everything, but we had cross-page selections with 0 on current page.\n // This means the header checkbox was clicked in indeterminate state → user wants to select current page.\n if (\n getSelectionCount(newSelectionModel) === 0 &&\n getSelectionCount(previousSelectionModel) > 0 &&\n selectionStatus.current.type === 'other' &&\n selectionStatus.current.numberOfSelectedRowsInPage === 0\n ) {\n const selectableInPage = getSelectableRowIdsInPage(apiRef, isRowSelectable);\n // Merge: keep existing cross-page selections + add all current page rows\n const mergedIds = new Set(previousSelectionModel.ids);\n for (const id of selectableInPage) {\n mergedIds.add(id);\n }\n return { type: 'include', ids: mergedIds };\n }\n\n return newSelectionModel;\n};\n\nexport const onServerSideSelectionStatusChange = (\n newSelectionModel: GridRowSelectionModel,\n apiRef: React.MutableRefObject<GridApiPremium | null>,\n selectionStatus: React.MutableRefObject<SelectionStatus>,\n forceUpdate: React.Dispatch<React.SetStateAction<number>>,\n isRowSelectable: ((params: GridRowParams<any>) => boolean) | undefined,\n page: number,\n pageSize: number\n) => {\n if (!apiRef.current) {\n return;\n }\n\n // We can't rely on the gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef) function to fetch the list of visible rows\n // as it doesn't work properly when all rows are selected on a page via checkbox\n // and then navigate to another page.\n // So instead we fetch the visible rows directly from the apiRef state, since the logic in `onServerSideSelectionStatusChange` applies\n // to server-side pagination only and visible rows are all loaded rows.\n // The bug may have been latent for several MUI releases now, as it seems to have been fixed in MUI v7.\n // See https://github.com/mui/mui-x/pull/14083\n const selectableRowsInPage = getSelectableRowIdsInPage(\n apiRef as React.MutableRefObject<GridApiPremium>,\n isRowSelectable\n );\n const numberOfSelectableRowsInPage = selectableRowsInPage.length;\n\n const numberOfSelectedRows = getSelectionCount(newSelectionModel);\n\n const selectedRowsInPage = selectableRowsInPage.filter((rowId) => isRowSelected(newSelectionModel, rowId));\n const numberOfSelectedRowsInPage = selectedRowsInPage.length;\n\n const isSamePage = selectionStatus?.current.page == page;\n const isSamePageSize = selectionStatus?.current.pageSize == pageSize;\n\n // if previous status is `page`,\n // if page and pageSize didn't change\n // and all the rows are selected, deselect all row\n if (\n selectionStatus.current.type === 'page' &&\n isSamePage &&\n isSamePageSize &&\n numberOfSelectedRowsInPage === numberOfSelectableRowsInPage\n ) {\n setTimeout(() => {\n apiRef.current?.selectRows(selectedRowsInPage, false, false);\n }, 0);\n }\n\n if (numberOfSelectedRowsInPage === numberOfSelectableRowsInPage && numberOfSelectableRowsInPage != 0) {\n selectionStatus.current = {\n type: 'page',\n numberOfSelectedRows,\n numberOfSelectedRowsInPage,\n page,\n pageSize,\n };\n } else if (numberOfSelectedRows > 0) {\n selectionStatus.current = {\n type: 'other',\n numberOfSelectedRows,\n numberOfSelectedRowsInPage,\n page,\n pageSize,\n };\n } else {\n selectionStatus.current = {\n type: 'none',\n numberOfSelectedRows,\n numberOfSelectedRowsInPage,\n page,\n pageSize,\n };\n }\n\n // Force a re-render to update the UI with the new selection status\n forceUpdate((v) => v + 1);\n};\n\nexport const ServerSideControlledPagination: React.FC<ServerSideControlledPaginationProps> = ({\n selectionStatus,\n displaySelection,\n displayPagination,\n paginationModel,\n onPaginationModelChange,\n pageSizeOptions,\n displayRowsPerPage,\n paginationProps,\n rowCount,\n}) => {\n const totalNumberOfRowsInTable = rowCount;\n\n const totalRowsLabel = `${selectionStatus.numberOfSelectedRows} row${\n selectionStatus.numberOfSelectedRows > 1 ? 's' : ''\n } selected`;\n\n const pageRowsLabel = `All ${selectionStatus.numberOfSelectedRowsInPage} selectable rows on this page are selected${\n selectionStatus.numberOfSelectedRows != selectionStatus.numberOfSelectedRowsInPage\n ? ` (${selectionStatus.numberOfSelectedRows} row${\n selectionStatus.numberOfSelectedRows > 1 ? 's' : ''\n } selected in total)`\n : ''\n }.`;\n\n return (\n <Flexbox flexDirection=\"row\" alignItems=\"center\" justifyContent=\"space-between\" marginBottom=\"7px\">\n {displaySelection ? (\n <>\n {selectionStatus.type === 'page' && selectionStatus.numberOfSelectedRowsInPage != 0 ? (\n <Text fontSize=\"14px\">{pageRowsLabel}</Text>\n ) : selectionStatus.type === 'other' ? (\n <Text fontSize=\"14px\">{totalRowsLabel}</Text>\n ) : (\n <Text />\n )}\n </>\n ) : null}\n {displayPagination ? (\n <TablePagination\n component=\"div\"\n count={totalNumberOfRowsInTable}\n page={paginationModel.page}\n onPageChange={(event: React.MouseEvent<HTMLButtonElement> | null, page: number) =>\n onPaginationModelChange({ page, pageSize: paginationModel.pageSize }, {\n reason: 'setPaginationModel',\n } as GridCallbackDetails<'pagination'>)\n }\n rowsPerPage={paginationModel.pageSize}\n onRowsPerPageChange={(event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) =>\n // Reset to page 0 when pageSize changes — keeping the same page index would\n // commonly leave the user past the end of the data (e.g. page 2 of 50 → page 2\n // of 100 when there are only 84 total rows), producing a \"101-84 of 84\" label.\n onPaginationModelChange({ page: 0, pageSize: parseInt(event.target.value, 10) }, {\n reason: 'setPaginationModel',\n } as GridCallbackDetails<'pagination'>)\n }\n rowsPerPageOptions={displayRowsPerPage ? pageSizeOptions : []}\n {...paginationProps}\n />\n ) : null}\n </Flexbox>\n );\n};\n"],"names":["EMPTY_ROW_SELECTION_MODEL","type","ids","Set","createRowSelectionModel","normalizeRowSelectionModel","input","Array","isArray","getSelectionCount","model","size","isRowSelected","rowId","has","getSelectedIds","from","getSelectableRowsInTable","apiRef","isRowSelectable","current","gridFilteredSortedRowEntriesSelector","filter","_ref","row","map","_ref2","id","gridFilteredSortedRowIdsSelector","ControlledPagination","_ref3","displaySelection","displayRowsPerPage","displayPagination","selectionStatus","paginationModel","onPaginationModelChange","pageSizeOptions","paginationProps","filteredRowsInTable","selectableRowsInTable","numberOfFilteredRowsInTable","length","numberOfSelectableRowsInTable","React","createElement","Flexbox","flexDirection","alignItems","justifyContent","marginBottom","Fragment","Text","fontSize","numberOfSelectedRows","LinkButton","onClick","_apiRef$current","_apiRef$current2","selectRows","getAllRowIds","_apiRef$current3","TablePagination","_extends","component","count","page","onPageChange","event","pageSize","reason","rowsPerPage","onRowsPerPageChange","parseInt","target","value","rowsPerPageOptions","getSelectableRowIdsInPage","rowsInPage","gridExpandedSortedRowEntriesSelector","fixServerSideHeaderCheckboxSelection","newSelectionModel","previousSelectionModel","numberOfSelectedRowsInPage","selectableInPage","mergedIds","add","onServerSideSelectionStatusChange","forceUpdate","selectableRowsInPage","numberOfSelectableRowsInPage","selectedRowsInPage","isSamePage","isSamePageSize","setTimeout","v","ServerSideControlledPagination","_ref4","rowCount","totalNumberOfRowsInTable","totalRowsLabel","pageRowsLabel"],"mappings":";;;;;;AAEA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACO,MAAMA,yBAAgD,GAAG;AAC9DC,EAAAA,IAAI,EAAE,SAAS;EACfC,GAAG,EAAE,IAAIC,GAAG,EAAC;AACf,EAAC;;AAED;AACA;AACA;AACaC,MAAAA,uBAAuB,GAAIF,GAAiC,KAA6B;AACpGD,EAAAA,IAAI,EAAE,SAAS;EACfC,GAAG,EAAEA,GAAG,YAAYC,GAAG,GAAGD,GAAG,GAAG,IAAIC,GAAG,CAACD,GAAG,CAAA;AAC7C,CAAC,EAAC;;AAEF;AACA;AACA;AACA;AACA;AACaG,MAAAA,0BAA0B,GAAIC,KAAgD,IAA4B;EACrH,IAAI,CAACA,KAAK,EAAE;AACV,IAAA,OAAON,yBAAyB,CAAA;AAClC,GAAA;AACA;AACA,EAAA,IAAIO,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;IACxB,OAAOF,uBAAuB,CAACE,KAAK,CAAC,CAAA;AACvC,GAAA;AACA;AACA,EAAA,OAAOA,KAAK,CAAA;AACd,EAAC;;AAED;AACA;AACA;AACaG,MAAAA,iBAAiB,GAAIC,KAA4B,IAAa;AACzE,EAAA,OAAOA,K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