@redsift/table 12.5.13-muiv6 → 12.5.14
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/_internal/BaseComponents.js +1 -1
- package/_internal/BaseIconButton.js +126 -0
- package/_internal/BaseIconButton.js.map +1 -0
- package/_internal/DataGrid2.js +149 -81
- package/_internal/DataGrid2.js.map +1 -1
- package/_internal/GridToolbarFilterSemanticField2.js +1340 -3
- package/_internal/GridToolbarFilterSemanticField2.js.map +1 -1
- package/_internal/Pagination.js +1 -1
- package/_internal/ServerSideControlledPagination.js +337 -0
- package/_internal/ServerSideControlledPagination.js.map +1 -0
- package/_internal/StatefulDataGrid.js +1 -1
- package/_internal/StatefulDataGrid2.js +1151 -1561
- package/_internal/StatefulDataGrid2.js.map +1 -1
- package/_internal/Toolbar2.js +23 -6
- package/_internal/Toolbar2.js.map +1 -1
- package/_internal/ToolbarWrapper2.js +1 -1
- package/_internal/useControlledDatagridState.js +43 -308
- package/_internal/useControlledDatagridState.js.map +1 -1
- package/index.d.ts +520 -355
- package/index.js +46 -15
- package/index.js.map +1 -1
- package/package.json +9 -10
- package/_internal/BasePopper.js +0 -2469
- package/_internal/BasePopper.js.map +0 -1
- package/_internal/ControlledPagination.js +0 -11004
- package/_internal/ControlledPagination.js.map +0 -1
- package/_internal/Portal.js +0 -6538
- package/_internal/Portal.js.map +0 -1
- package/_internal/jsx-runtime.js +0 -1342
- package/_internal/jsx-runtime.js.map +0 -1
package/_internal/Toolbar2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as _extends } from './_rollupPluginBabelHelpers.js';
|
|
1
|
+
import { b as _extends, _ as _objectSpread2 } from './_rollupPluginBabelHelpers.js';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport, gridExpandedSortedRowIdsSelector, GridToolbarQuickFilter } from '@mui/x-data-grid-
|
|
3
|
+
import { GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport, gridExpandedSortedRowIdsSelector, GridToolbarQuickFilter } from '@mui/x-data-grid-premium';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { Flexbox } from '@redsift/design-system';
|
|
6
6
|
import { G as GridToolbarFilterSemanticField } from './GridToolbarFilterSemanticField2.js';
|
|
@@ -26,6 +26,7 @@ const GridToolbarWrapper = styled.div`
|
|
|
26
26
|
/** ------ */
|
|
27
27
|
|
|
28
28
|
const Toolbar = props => {
|
|
29
|
+
var _filterButtonProps$sl, _filterButtonProps$sl2, _filterButtonProps$sl3, _columnsButtonProps$s, _columnsButtonProps$s2, _columnsButtonProps$s3, _densityButtonProps$s, _densityButtonProps$s2, _densityButtonProps$s3, _exportButtonProps$sl, _exportButtonProps$sl2, _exportButtonProps$sl3;
|
|
29
30
|
const {
|
|
30
31
|
hasExportButton = true,
|
|
31
32
|
exportButtonProps,
|
|
@@ -50,13 +51,25 @@ const Toolbar = props => {
|
|
|
50
51
|
gap: "0"
|
|
51
52
|
}, hasFilterButton ? /*#__PURE__*/React__default.createElement(GridToolbarFilterButton, _extends({}, filterButtonProps, {
|
|
52
53
|
ref: filterButtonRef,
|
|
53
|
-
|
|
54
|
+
slotProps: _objectSpread2(_objectSpread2({}, filterButtonProps === null || filterButtonProps === void 0 ? void 0 : filterButtonProps.slotProps), {}, {
|
|
55
|
+
button: _objectSpread2(_objectSpread2({}, filterButtonProps === null || filterButtonProps === void 0 ? void 0 : (_filterButtonProps$sl = filterButtonProps.slotProps) === null || _filterButtonProps$sl === void 0 ? void 0 : _filterButtonProps$sl.button), {}, {
|
|
56
|
+
className: filterButtonProps !== null && filterButtonProps !== void 0 && (_filterButtonProps$sl2 = filterButtonProps.slotProps) !== null && _filterButtonProps$sl2 !== void 0 && (_filterButtonProps$sl3 = _filterButtonProps$sl2.button) !== null && _filterButtonProps$sl3 !== void 0 && _filterButtonProps$sl3.className ? `${filterButtonProps.slotProps.button.className} redsift-condensed` : 'redsift-condensed'
|
|
57
|
+
})
|
|
58
|
+
})
|
|
54
59
|
})) : null, hasColumnsButton ? /*#__PURE__*/React__default.createElement(GridToolbarColumnsButton, _extends({}, columnsButtonProps, {
|
|
55
60
|
ref: columnsButtonRef,
|
|
56
|
-
|
|
61
|
+
slotProps: _objectSpread2(_objectSpread2({}, columnsButtonProps === null || columnsButtonProps === void 0 ? void 0 : columnsButtonProps.slotProps), {}, {
|
|
62
|
+
button: _objectSpread2(_objectSpread2({}, columnsButtonProps === null || columnsButtonProps === void 0 ? void 0 : (_columnsButtonProps$s = columnsButtonProps.slotProps) === null || _columnsButtonProps$s === void 0 ? void 0 : _columnsButtonProps$s.button), {}, {
|
|
63
|
+
className: columnsButtonProps !== null && columnsButtonProps !== void 0 && (_columnsButtonProps$s2 = columnsButtonProps.slotProps) !== null && _columnsButtonProps$s2 !== void 0 && (_columnsButtonProps$s3 = _columnsButtonProps$s2.button) !== null && _columnsButtonProps$s3 !== void 0 && _columnsButtonProps$s3.className ? `${columnsButtonProps.slotProps.button.className} redsift-condensed` : 'redsift-condensed'
|
|
64
|
+
})
|
|
65
|
+
})
|
|
57
66
|
})) : null, hasDensityButton ? /*#__PURE__*/React__default.createElement(GridToolbarDensitySelector, _extends({}, densityButtonProps, {
|
|
58
67
|
ref: densityButtonRef,
|
|
59
|
-
|
|
68
|
+
slotProps: _objectSpread2(_objectSpread2({}, densityButtonProps === null || densityButtonProps === void 0 ? void 0 : densityButtonProps.slotProps), {}, {
|
|
69
|
+
button: _objectSpread2(_objectSpread2({}, densityButtonProps === null || densityButtonProps === void 0 ? void 0 : (_densityButtonProps$s = densityButtonProps.slotProps) === null || _densityButtonProps$s === void 0 ? void 0 : _densityButtonProps$s.button), {}, {
|
|
70
|
+
className: densityButtonProps !== null && densityButtonProps !== void 0 && (_densityButtonProps$s2 = densityButtonProps.slotProps) !== null && _densityButtonProps$s2 !== void 0 && (_densityButtonProps$s3 = _densityButtonProps$s2.button) !== null && _densityButtonProps$s3 !== void 0 && _densityButtonProps$s3.className ? `${densityButtonProps.slotProps.button.className} redsift-condensed` : 'redsift-condensed'
|
|
71
|
+
})
|
|
72
|
+
})
|
|
60
73
|
})) : null, hasExportButton ? /*#__PURE__*/React__default.createElement(GridToolbarExport, _extends({
|
|
61
74
|
csvOptions: {
|
|
62
75
|
allColumns: true,
|
|
@@ -73,7 +86,11 @@ const Toolbar = props => {
|
|
|
73
86
|
}
|
|
74
87
|
}, exportButtonProps, {
|
|
75
88
|
ref: exportButtonRef,
|
|
76
|
-
|
|
89
|
+
slotProps: _objectSpread2(_objectSpread2({}, exportButtonProps === null || exportButtonProps === void 0 ? void 0 : exportButtonProps.slotProps), {}, {
|
|
90
|
+
button: _objectSpread2(_objectSpread2({}, exportButtonProps === null || exportButtonProps === void 0 ? void 0 : (_exportButtonProps$sl = exportButtonProps.slotProps) === null || _exportButtonProps$sl === void 0 ? void 0 : _exportButtonProps$sl.button), {}, {
|
|
91
|
+
className: exportButtonProps !== null && exportButtonProps !== void 0 && (_exportButtonProps$sl2 = exportButtonProps.slotProps) !== null && _exportButtonProps$sl2 !== void 0 && (_exportButtonProps$sl3 = _exportButtonProps$sl2.button) !== null && _exportButtonProps$sl3 !== void 0 && _exportButtonProps$sl3.className ? `${exportButtonProps.slotProps.button.className} redsift-condensed` : 'redsift-condensed'
|
|
92
|
+
})
|
|
93
|
+
})
|
|
77
94
|
})) : null, /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
78
95
|
marginLeft: "8px"
|
|
79
96
|
}, showQuickFilter ? /*#__PURE__*/React__default.createElement(GridToolbarQuickFilter, null) : null)), /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar2.js","sources":["../../src/components/Toolbar/styles.ts","../../src/components/Toolbar/Toolbar.tsx"],"sourcesContent":["import styled from 'styled-components';\n\n/**\n * Component style.\n */\nexport const GridToolbarWrapper = styled.div`\n .MuiButtonBase-root-JobBs.MuiButton-root {\n svg {\n path {\n fill: var(--redsift-color-primary-n);\n }\n }\n }\n`;\n","import React from 'react';\n\nimport {\n GridToolbarContainer,\n GridToolbarColumnsButton,\n GridToolbarDensitySelector,\n GridToolbarFilterButton,\n GridToolbarExport,\n gridExpandedSortedRowIdsSelector,\n GridCsvGetRowsToExportParams,\n GridToolbarQuickFilter,\n} from '@mui/x-data-grid-pro';\n\nimport { GridToolbarWrapper } from './styles';\nimport { ToolbarProps } from './types';\nimport { Flexbox } from '@redsift/design-system';\nimport { GridToolbarFilterSemanticField } from '../GridToolbarFilterSemanticField';\n\n/**\n * Temporary workaround for a type mismatch between react 17 and 18\n * https://github.com/mui/material-ui/issues/35287#issuecomment-1337250566\n */\ndeclare global {\n namespace React {\n interface DOMAttributes<T> {\n onResize?: React.ReactEventHandler<T> | undefined;\n onResizeCapture?: React.ReactEventHandler<T> | undefined;\n nonce?: string | undefined;\n }\n }\n}\n/** ------ */\n\nexport const Toolbar: React.FC<ToolbarProps> = (props) => {\n const {\n hasExportButton = true,\n exportButtonProps,\n exportButtonRef,\n hasFilterButton = true,\n filterButtonProps,\n filterButtonRef,\n hasColumnsButton = true,\n columnsButtonProps,\n columnsButtonRef,\n hasDensityButton = true,\n densityButtonProps,\n densityButtonRef,\n onFilterModelChange,\n semanticFilterProps = undefined,\n showQuickFilter,\n } = props;\n\n if (semanticFilterProps && onFilterModelChange) {\n semanticFilterProps.onFilterModelChange = onFilterModelChange;\n }\n\n return (\n <GridToolbarWrapper>\n <GridToolbarContainer>\n <Flexbox gap=\"0\">\n {hasFilterButton ? (\n <GridToolbarFilterButton\n {...filterButtonProps}\n ref={filterButtonRef}\n className={\n filterButtonProps?.className ? `${filterButtonProps?.className} redsift-condensed` : 'redsift-condensed'\n }\n />\n ) : null}\n {hasColumnsButton ? (\n <GridToolbarColumnsButton\n {...columnsButtonProps}\n ref={columnsButtonRef}\n className={\n filterButtonProps?.className ? `${filterButtonProps?.className} redsift-condensed` : 'redsift-condensed'\n }\n />\n ) : null}\n {hasDensityButton ? (\n <GridToolbarDensitySelector\n {...densityButtonProps}\n ref={densityButtonRef}\n className={\n filterButtonProps?.className ? `${filterButtonProps?.className} redsift-condensed` : 'redsift-condensed'\n }\n />\n ) : null}\n {hasExportButton ? (\n <GridToolbarExport\n csvOptions={{\n allColumns: true,\n fileName: 'csv',\n getRowsToExport: ({ apiRef }: GridCsvGetRowsToExportParams) => gridExpandedSortedRowIdsSelector(apiRef),\n }}\n printOptions={{\n disableToolbarButton: true,\n }}\n {...exportButtonProps}\n ref={exportButtonRef}\n className={\n filterButtonProps?.className ? `${filterButtonProps?.className} redsift-condensed` : 'redsift-condensed'\n }\n />\n ) : null}\n <Flexbox marginLeft=\"8px\">{showQuickFilter ? <GridToolbarQuickFilter /> : null}</Flexbox>\n </Flexbox>\n <Flexbox flexGrow={3}>\n {semanticFilterProps ? <GridToolbarFilterSemanticField {...semanticFilterProps} /> : null}\n </Flexbox>\n </GridToolbarContainer>\n </GridToolbarWrapper>\n );\n};\n"],"names":["GridToolbarWrapper","styled","div","Toolbar","props","hasExportButton","exportButtonProps","exportButtonRef","hasFilterButton","filterButtonProps","filterButtonRef","hasColumnsButton","columnsButtonProps","columnsButtonRef","hasDensityButton","densityButtonProps","densityButtonRef","onFilterModelChange","semanticFilterProps","undefined","showQuickFilter","React","createElement","GridToolbarContainer","Flexbox","gap","GridToolbarFilterButton","_extends","ref","className","GridToolbarColumnsButton","GridToolbarDensitySelector","GridToolbarExport","csvOptions","allColumns","fileName","getRowsToExport","_ref","apiRef","gridExpandedSortedRowIdsSelector","printOptions","disableToolbarButton","marginLeft","GridToolbarQuickFilter","flexGrow","GridToolbarFilterSemanticField"],"mappings":";;;;;;;AAEA;AACA;AACA;AACO,MAAMA,kBAAkB,GAAGC,MAAM,CAACC,GAAI,CAAA;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;ACK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ErB,eAAgB;AACrBsB,IAAAA,SAAS,EACPpB,iBAAiB,KAAA,IAAA,IAAjBA,iBAAiB,KAAjBA,KAAAA,CAAAA,IAAAA,iBAAiB,CAAEoB,SAAS,GAAI,CAAEpB,EAAAA,iBAAiB,aAAjBA,iBAAiB,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAjBA,iBAAiB,CAAEoB,SAAU,oBAAmB,GAAG,mBAAA;GAExF,CAAA,CAAC,GACA,IAAI,eACRR,cAAA,CAAAC,aAAA,CAACE,OAAO,EAAA;AAACkB,IAAAA,UAAU,EAAC,KAAA;AAAK,GAAA,EAAEtB,eAAe,gBAAGC,cAAA,CAAAC,aAAA,CAACqB,sBAAsB,EAAE,IAAA,CAAC,GAAG,IAAc,CACjF,CAAC,eACVtB,cAAA,CAAAC,aAAA,CAACE,OAAO,EAAA;AAACoB,IAAAA,QAAQ,EAAE,CAAA;AAAE,GAAA,EAClB1B,mBAAmB,gBAAGG,cAAA,CAAAC,aAAA,CAACuB,8BAA8B,EAAK3B,mBAAsB,CAAC,GAAG,IAC9E,CACW,CACJ,CAAC,CAAA;AAEzB;;;;"}
|
|
1
|
+
{"version":3,"file":"Toolbar2.js","sources":["../../src/components/Toolbar/styles.ts","../../src/components/Toolbar/Toolbar.tsx"],"sourcesContent":["import styled from 'styled-components';\n\n/**\n * Component style.\n */\nexport const GridToolbarWrapper = styled.div`\n .MuiButtonBase-root-JobBs.MuiButton-root {\n svg {\n path {\n fill: var(--redsift-color-primary-n);\n }\n }\n }\n`;\n","import React from 'react';\n\nimport {\n GridToolbarContainer,\n GridToolbarColumnsButton,\n GridToolbarDensitySelector,\n GridToolbarFilterButton,\n GridToolbarExport,\n gridExpandedSortedRowIdsSelector,\n GridCsvGetRowsToExportParams,\n GridToolbarQuickFilter,\n} from '@mui/x-data-grid-premium';\n\nimport { GridToolbarWrapper } from './styles';\nimport { ToolbarProps } from './types';\nimport { Flexbox } from '@redsift/design-system';\nimport { GridToolbarFilterSemanticField } from '../GridToolbarFilterSemanticField';\n\n/**\n * Temporary workaround for a type mismatch between react 17 and 18\n * https://github.com/mui/material-ui/issues/35287#issuecomment-1337250566\n */\ndeclare global {\n namespace React {\n interface DOMAttributes<T> {\n onResize?: React.ReactEventHandler<T> | undefined;\n onResizeCapture?: React.ReactEventHandler<T> | undefined;\n nonce?: string | undefined;\n }\n }\n}\n/** ------ */\n\nexport const Toolbar: React.FC<ToolbarProps> = (props) => {\n const {\n hasExportButton = true,\n exportButtonProps,\n exportButtonRef,\n hasFilterButton = true,\n filterButtonProps,\n filterButtonRef,\n hasColumnsButton = true,\n columnsButtonProps,\n columnsButtonRef,\n hasDensityButton = true,\n densityButtonProps,\n densityButtonRef,\n onFilterModelChange,\n semanticFilterProps = undefined,\n showQuickFilter,\n } = props;\n\n if (semanticFilterProps && onFilterModelChange) {\n semanticFilterProps.onFilterModelChange = onFilterModelChange;\n }\n\n return (\n <GridToolbarWrapper>\n <GridToolbarContainer>\n <Flexbox gap=\"0\">\n {hasFilterButton ? (\n <GridToolbarFilterButton\n {...filterButtonProps}\n ref={filterButtonRef}\n slotProps={{\n ...filterButtonProps?.slotProps,\n button: {\n ...filterButtonProps?.slotProps?.button,\n className: filterButtonProps?.slotProps?.button?.className\n ? `${filterButtonProps.slotProps.button.className} redsift-condensed`\n : 'redsift-condensed',\n },\n }}\n />\n ) : null}\n {hasColumnsButton ? (\n <GridToolbarColumnsButton\n {...columnsButtonProps}\n ref={columnsButtonRef}\n slotProps={{\n ...columnsButtonProps?.slotProps,\n button: {\n ...columnsButtonProps?.slotProps?.button,\n className: columnsButtonProps?.slotProps?.button?.className\n ? `${columnsButtonProps.slotProps.button.className} redsift-condensed`\n : 'redsift-condensed',\n },\n }}\n />\n ) : null}\n {hasDensityButton ? (\n <GridToolbarDensitySelector\n {...densityButtonProps}\n ref={densityButtonRef}\n slotProps={{\n ...densityButtonProps?.slotProps,\n button: {\n ...densityButtonProps?.slotProps?.button,\n className: densityButtonProps?.slotProps?.button?.className\n ? `${densityButtonProps.slotProps.button.className} redsift-condensed`\n : 'redsift-condensed',\n },\n }}\n />\n ) : null}\n {hasExportButton ? (\n <GridToolbarExport\n csvOptions={{\n allColumns: true,\n fileName: 'csv',\n getRowsToExport: ({ apiRef }: GridCsvGetRowsToExportParams) => gridExpandedSortedRowIdsSelector(apiRef),\n }}\n printOptions={{\n disableToolbarButton: true,\n }}\n {...exportButtonProps}\n ref={exportButtonRef}\n slotProps={{\n ...exportButtonProps?.slotProps,\n button: {\n ...exportButtonProps?.slotProps?.button,\n className: exportButtonProps?.slotProps?.button?.className\n ? `${exportButtonProps.slotProps.button.className} redsift-condensed`\n : 'redsift-condensed',\n },\n }}\n />\n ) : null}\n <Flexbox marginLeft=\"8px\">{showQuickFilter ? <GridToolbarQuickFilter /> : null}</Flexbox>\n </Flexbox>\n <Flexbox flexGrow={3}>\n {semanticFilterProps ? <GridToolbarFilterSemanticField {...semanticFilterProps} /> : null}\n </Flexbox>\n </GridToolbarContainer>\n </GridToolbarWrapper>\n );\n};\n"],"names":["GridToolbarWrapper","styled","div","Toolbar","props","_filterButtonProps$sl","_filterButtonProps$sl2","_filterButtonProps$sl3","_columnsButtonProps$s","_columnsButtonProps$s2","_columnsButtonProps$s3","_densityButtonProps$s","_densityButtonProps$s2","_densityButtonProps$s3","_exportButtonProps$sl","_exportButtonProps$sl2","_exportButtonProps$sl3","hasExportButton","exportButtonProps","exportButtonRef","hasFilterButton","filterButtonProps","filterButtonRef","hasColumnsButton","columnsButtonProps","columnsButtonRef","hasDensityButton","densityButtonProps","densityButtonRef","onFilterModelChange","semanticFilterProps","undefined","showQuickFilter","React","createElement","GridToolbarContainer","Flexbox","gap","GridToolbarFilterButton","_extends","ref","slotProps","_objectSpread","button","className","GridToolbarColumnsButton","GridToolbarDensitySelector","GridToolbarExport","csvOptions","allColumns","fileName","getRowsToExport","_ref","apiRef","gridExpandedSortedRowIdsSelector","printOptions","disableToolbarButton","marginLeft","GridToolbarQuickFilter","flexGrow","G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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as _objectWithoutProperties, b as _extends } from './_rollupPluginBabelHelpers.js';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { Flexbox } from '@redsift/design-system';
|
|
4
|
-
import { S as ServerSideControlledPagination, C as ControlledPagination } from './
|
|
4
|
+
import { S as ServerSideControlledPagination, C as ControlledPagination } from './ServerSideControlledPagination.js';
|
|
5
5
|
|
|
6
6
|
const _excluded = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "displaySelection", "displayPagination", "displayRowsPerPage", "selectionStatus", "apiRef", "isRowSelectable", "paginationModel", "onPaginationModelChange", "pageSizeOptions", "paginationProps", "paginationMode", "rowCount"];
|
|
7
7
|
/**
|
|
@@ -1,286 +1,9 @@
|
|
|
1
|
-
import { P as PropTypes, E as exactProp, t as useEnhancedEffect, M as DefaultPropsProvider, b as _extends$1, i as _objectWithoutPropertiesLoose, T as THEME_ID, h as _extends$2 } from './Portal.js';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import React__default, { useState, useEffect } from 'react';
|
|
4
|
-
import { j as jsxRuntimeExports } from './jsx-runtime.js';
|
|
5
|
-
import { k as useTheme$1, e as useId, G as GlobalStyles, R as RtlProvider, S as ServerSideControlledPagination, C as ControlledPagination } from './ControlledPagination.js';
|
|
6
|
-
import { ThemeContext as ThemeContext$2 } from '@emotion/react';
|
|
7
1
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { b as _extends
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
14
|
-
var t = arguments[e];
|
|
15
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
16
|
-
}
|
|
17
|
-
return n;
|
|
18
|
-
}, _extends.apply(null, arguments);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/* eslint-disable */
|
|
22
|
-
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
23
|
-
var ponyfillGlobal = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
|
|
24
|
-
|
|
25
|
-
const ThemeContext = /*#__PURE__*/React.createContext(null);
|
|
26
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
27
|
-
ThemeContext.displayName = 'ThemeContext';
|
|
28
|
-
}
|
|
29
|
-
var ThemeContext$1 = ThemeContext;
|
|
30
|
-
|
|
31
|
-
function useTheme() {
|
|
32
|
-
const theme = React.useContext(ThemeContext$1);
|
|
33
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
34
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
35
|
-
React.useDebugValue(theme);
|
|
36
|
-
}
|
|
37
|
-
return theme;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
41
|
-
var nested = hasSymbol ? Symbol.for('mui.nested') : '__THEME_NESTED__';
|
|
42
|
-
|
|
43
|
-
function mergeOuterLocalTheme(outerTheme, localTheme) {
|
|
44
|
-
if (typeof localTheme === 'function') {
|
|
45
|
-
const mergedTheme = localTheme(outerTheme);
|
|
46
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
47
|
-
if (!mergedTheme) {
|
|
48
|
-
console.error(['MUI: You should return an object from your theme function, i.e.', '<ThemeProvider theme={() => ({})} />'].join('\n'));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return mergedTheme;
|
|
52
|
-
}
|
|
53
|
-
return _extends({}, outerTheme, localTheme);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* This component takes a `theme` prop.
|
|
58
|
-
* It makes the `theme` available down the React tree thanks to React context.
|
|
59
|
-
* This component should preferably be used at **the root of your component tree**.
|
|
60
|
-
*/
|
|
61
|
-
function ThemeProvider$2(props) {
|
|
62
|
-
const {
|
|
63
|
-
children,
|
|
64
|
-
theme: localTheme
|
|
65
|
-
} = props;
|
|
66
|
-
const outerTheme = useTheme();
|
|
67
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
68
|
-
if (outerTheme === null && typeof localTheme === 'function') {
|
|
69
|
-
console.error(['MUI: You are providing a theme function prop to the ThemeProvider component:', '<ThemeProvider theme={outerTheme => outerTheme} />', '', 'However, no outer theme is present.', 'Make sure a theme is already injected higher in the React tree ' + 'or provide a theme object.'].join('\n'));
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
const theme = React.useMemo(() => {
|
|
73
|
-
const output = outerTheme === null ? localTheme : mergeOuterLocalTheme(outerTheme, localTheme);
|
|
74
|
-
if (output != null) {
|
|
75
|
-
output[nested] = outerTheme !== null;
|
|
76
|
-
}
|
|
77
|
-
return output;
|
|
78
|
-
}, [localTheme, outerTheme]);
|
|
79
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeContext$1.Provider, {
|
|
80
|
-
value: theme,
|
|
81
|
-
children: children
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
process.env.NODE_ENV !== "production" ? ThemeProvider$2.propTypes = {
|
|
85
|
-
/**
|
|
86
|
-
* Your component tree.
|
|
87
|
-
*/
|
|
88
|
-
children: PropTypes.node,
|
|
89
|
-
/**
|
|
90
|
-
* A theme object. You can provide a function to extend the outer theme.
|
|
91
|
-
*/
|
|
92
|
-
theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired
|
|
93
|
-
} : void 0;
|
|
94
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
95
|
-
process.env.NODE_ENV !== "production" ? ThemeProvider$2.propTypes = exactProp(ThemeProvider$2.propTypes) : void 0;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function useLayerOrder(theme) {
|
|
99
|
-
const upperTheme = useTheme$1();
|
|
100
|
-
const id = useId() || '';
|
|
101
|
-
const {
|
|
102
|
-
modularCssLayers
|
|
103
|
-
} = theme;
|
|
104
|
-
let layerOrder = 'mui.global, mui.components, mui.theme, mui.custom, mui.sx';
|
|
105
|
-
if (!modularCssLayers || upperTheme !== null) {
|
|
106
|
-
// skip this hook if upper theme exists.
|
|
107
|
-
layerOrder = '';
|
|
108
|
-
} else if (typeof modularCssLayers === 'string') {
|
|
109
|
-
layerOrder = modularCssLayers.replace(/mui(?!\.)/g, layerOrder);
|
|
110
|
-
} else {
|
|
111
|
-
layerOrder = `@layer ${layerOrder};`;
|
|
112
|
-
}
|
|
113
|
-
useEnhancedEffect(() => {
|
|
114
|
-
const head = document.querySelector('head');
|
|
115
|
-
if (!head) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
const firstChild = head.firstChild;
|
|
119
|
-
if (layerOrder) {
|
|
120
|
-
var _firstChild$hasAttrib;
|
|
121
|
-
// Only insert if first child doesn't have data-mui-layer-order attribute
|
|
122
|
-
if (firstChild && (_firstChild$hasAttrib = firstChild.hasAttribute) != null && _firstChild$hasAttrib.call(firstChild, 'data-mui-layer-order') && firstChild.getAttribute('data-mui-layer-order') === id) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
const styleElement = document.createElement('style');
|
|
126
|
-
styleElement.setAttribute('data-mui-layer-order', id);
|
|
127
|
-
styleElement.textContent = layerOrder;
|
|
128
|
-
head.prepend(styleElement);
|
|
129
|
-
} else {
|
|
130
|
-
var _head$querySelector;
|
|
131
|
-
(_head$querySelector = head.querySelector(`style[data-mui-layer-order="${id}"]`)) == null || _head$querySelector.remove();
|
|
132
|
-
}
|
|
133
|
-
}, [layerOrder, id]);
|
|
134
|
-
if (!layerOrder) {
|
|
135
|
-
return null;
|
|
136
|
-
}
|
|
137
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(GlobalStyles, {
|
|
138
|
-
styles: layerOrder
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const EMPTY_THEME = {};
|
|
143
|
-
function useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {
|
|
144
|
-
return React.useMemo(() => {
|
|
145
|
-
const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;
|
|
146
|
-
if (typeof localTheme === 'function') {
|
|
147
|
-
const mergedTheme = localTheme(resolvedTheme);
|
|
148
|
-
const result = themeId ? _extends$1({}, upperTheme, {
|
|
149
|
-
[themeId]: mergedTheme
|
|
150
|
-
}) : mergedTheme;
|
|
151
|
-
// must return a function for the private theme to NOT merge with the upper theme.
|
|
152
|
-
// see the test case "use provided theme from a callback" in ThemeProvider.test.js
|
|
153
|
-
if (isPrivate) {
|
|
154
|
-
return () => result;
|
|
155
|
-
}
|
|
156
|
-
return result;
|
|
157
|
-
}
|
|
158
|
-
return themeId ? _extends$1({}, upperTheme, {
|
|
159
|
-
[themeId]: localTheme
|
|
160
|
-
}) : _extends$1({}, upperTheme, localTheme);
|
|
161
|
-
}, [themeId, upperTheme, localTheme, isPrivate]);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* This component makes the `theme` available down the React tree.
|
|
166
|
-
* It should preferably be used at **the root of your component tree**.
|
|
167
|
-
*
|
|
168
|
-
* <ThemeProvider theme={theme}> // existing use case
|
|
169
|
-
* <ThemeProvider theme={{ id: theme }}> // theme scoping
|
|
170
|
-
*/
|
|
171
|
-
function ThemeProvider$1(props) {
|
|
172
|
-
const {
|
|
173
|
-
children,
|
|
174
|
-
theme: localTheme,
|
|
175
|
-
themeId
|
|
176
|
-
} = props;
|
|
177
|
-
const upperTheme = useTheme$1(EMPTY_THEME);
|
|
178
|
-
const upperPrivateTheme = useTheme() || EMPTY_THEME;
|
|
179
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
180
|
-
if (upperTheme === null && typeof localTheme === 'function' || themeId && upperTheme && !upperTheme[themeId] && typeof localTheme === 'function') {
|
|
181
|
-
console.error(['MUI: You are providing a theme function prop to the ThemeProvider component:', '<ThemeProvider theme={outerTheme => outerTheme} />', '', 'However, no outer theme is present.', 'Make sure a theme is already injected higher in the React tree ' + 'or provide a theme object.'].join('\n'));
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
const engineTheme = useThemeScoping(themeId, upperTheme, localTheme);
|
|
185
|
-
const privateTheme = useThemeScoping(themeId, upperPrivateTheme, localTheme, true);
|
|
186
|
-
const rtlValue = engineTheme.direction === 'rtl';
|
|
187
|
-
const layerOrder = useLayerOrder(engineTheme);
|
|
188
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$2, {
|
|
189
|
-
theme: privateTheme,
|
|
190
|
-
children: /*#__PURE__*/jsxRuntimeExports.jsx(ThemeContext$2.Provider, {
|
|
191
|
-
value: engineTheme,
|
|
192
|
-
children: /*#__PURE__*/jsxRuntimeExports.jsx(RtlProvider, {
|
|
193
|
-
value: rtlValue,
|
|
194
|
-
children: /*#__PURE__*/jsxRuntimeExports.jsxs(DefaultPropsProvider, {
|
|
195
|
-
value: engineTheme == null ? void 0 : engineTheme.components,
|
|
196
|
-
children: [layerOrder, children]
|
|
197
|
-
})
|
|
198
|
-
})
|
|
199
|
-
})
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
process.env.NODE_ENV !== "production" ? ThemeProvider$1.propTypes /* remove-proptypes */ = {
|
|
203
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
204
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
205
|
-
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
206
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
207
|
-
/**
|
|
208
|
-
* Your component tree.
|
|
209
|
-
*/
|
|
210
|
-
children: PropTypes.node,
|
|
211
|
-
/**
|
|
212
|
-
* A theme object. You can provide a function to extend the outer theme.
|
|
213
|
-
*/
|
|
214
|
-
theme: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).isRequired,
|
|
215
|
-
/**
|
|
216
|
-
* The design system's unique id for getting the corresponded theme when there are multiple design systems.
|
|
217
|
-
*/
|
|
218
|
-
themeId: PropTypes.string
|
|
219
|
-
} : void 0;
|
|
220
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
221
|
-
process.env.NODE_ENV !== "production" ? ThemeProvider$1.propTypes = exactProp(ThemeProvider$1.propTypes) : void 0;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
const _excluded = ["theme"];
|
|
225
|
-
function ThemeProvider(_ref) {
|
|
226
|
-
let {
|
|
227
|
-
theme: themeInput
|
|
228
|
-
} = _ref,
|
|
229
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
230
|
-
const scopedTheme = themeInput[THEME_ID];
|
|
231
|
-
let finalTheme = scopedTheme || themeInput;
|
|
232
|
-
if (typeof themeInput !== 'function') {
|
|
233
|
-
if (scopedTheme && !scopedTheme.vars) {
|
|
234
|
-
finalTheme = _extends$2({}, scopedTheme, {
|
|
235
|
-
vars: null
|
|
236
|
-
});
|
|
237
|
-
} else if (themeInput && !themeInput.vars) {
|
|
238
|
-
finalTheme = _extends$2({}, themeInput, {
|
|
239
|
-
vars: null
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$1, _extends$2({}, props, {
|
|
244
|
-
themeId: scopedTheme ? THEME_ID : undefined,
|
|
245
|
-
theme: finalTheme
|
|
246
|
-
}));
|
|
247
|
-
}
|
|
248
|
-
process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes = {
|
|
249
|
-
/**
|
|
250
|
-
* Your component tree.
|
|
251
|
-
*/
|
|
252
|
-
children: PropTypes.node,
|
|
253
|
-
/**
|
|
254
|
-
* A theme object. You can provide a function to extend the outer theme.
|
|
255
|
-
*/
|
|
256
|
-
theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired
|
|
257
|
-
} : void 0;
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* @ignore - do not document.
|
|
261
|
-
*/
|
|
262
|
-
|
|
263
|
-
// Store the license information in a global, so it can be shared
|
|
264
|
-
// when module duplication occurs. The duplication of the modules can happen
|
|
265
|
-
// if using multiple version of MUI X at the same time of the bundler
|
|
266
|
-
// decide to duplicate to improve the size of the chunks.
|
|
267
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
268
|
-
ponyfillGlobal.__MUI_LICENSE_INFO__ = ponyfillGlobal.__MUI_LICENSE_INFO__ || {
|
|
269
|
-
key: undefined
|
|
270
|
-
};
|
|
271
|
-
class LicenseInfo {
|
|
272
|
-
static getLicenseInfo() {
|
|
273
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
274
|
-
return ponyfillGlobal.__MUI_LICENSE_INFO__;
|
|
275
|
-
}
|
|
276
|
-
static getLicenseKey() {
|
|
277
|
-
return LicenseInfo.getLicenseInfo().key;
|
|
278
|
-
}
|
|
279
|
-
static setLicenseKey(key) {
|
|
280
|
-
const licenseInfo = LicenseInfo.getLicenseInfo();
|
|
281
|
-
licenseInfo.key = key;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
2
|
+
import { b as _extends } from './_rollupPluginBabelHelpers.js';
|
|
3
|
+
import React__default, { useState, useEffect } from 'react';
|
|
4
|
+
import { B as BaseButton, a as BaseCheckbox, c as BaseIconButton, b as BaseIcon } from './BaseIconButton.js';
|
|
5
|
+
import { T as ToolbarWrapper } from './ToolbarWrapper2.js';
|
|
6
|
+
import { S as ServerSideControlledPagination, C as ControlledPagination } from './ServerSideControlledPagination.js';
|
|
284
7
|
|
|
285
8
|
/**
|
|
286
9
|
* Component style.
|
|
@@ -356,15 +79,15 @@ const StyledDataGrid = styled.div`
|
|
|
356
79
|
* Shared, referentially-stable default slots for `DataGrid` and `StatefulDataGrid`.
|
|
357
80
|
*
|
|
358
81
|
* MUI re-resolves a slot only when its COMPONENT identity changes, so a fresh inline function
|
|
359
|
-
* built on every render remounts that slot's whole subtree. For
|
|
360
|
-
*
|
|
361
|
-
*
|
|
362
|
-
*
|
|
363
|
-
*
|
|
82
|
+
* built on every render remounts that slot's whole subtree. For the toolbar that meant the
|
|
83
|
+
* quick-search input was torn down and rebuilt on every keystroke (focus lost); for pagination
|
|
84
|
+
* it remounted the pager/banner each render. Defining these once at module scope keeps the slot
|
|
85
|
+
* identities constant, so the grids RE-RENDER them (fresh data flows in via `slotProps`) instead
|
|
86
|
+
* of remounting them.
|
|
364
87
|
*/
|
|
365
88
|
|
|
366
89
|
const gridIcon = displayName => {
|
|
367
|
-
const Icon = props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends
|
|
90
|
+
const Icon = props => /*#__PURE__*/React__default.createElement(BaseIcon, _extends({}, props, {
|
|
368
91
|
displayName: displayName
|
|
369
92
|
}));
|
|
370
93
|
Icon.displayName = `GridIcon(${displayName})`;
|
|
@@ -375,23 +98,30 @@ const gridIcon = displayName => {
|
|
|
375
98
|
const baseGridSlots = {
|
|
376
99
|
baseButton: BaseButton,
|
|
377
100
|
baseCheckbox: BaseCheckbox,
|
|
378
|
-
|
|
379
|
-
columnFilteredIcon: gridIcon('
|
|
380
|
-
columnSelectorIcon: gridIcon('
|
|
381
|
-
columnSortedAscendingIcon: gridIcon('
|
|
382
|
-
columnSortedDescendingIcon: gridIcon('
|
|
383
|
-
densityCompactIcon: gridIcon('
|
|
384
|
-
densityStandardIcon: gridIcon('
|
|
385
|
-
densityComfortableIcon: gridIcon('
|
|
386
|
-
detailPanelCollapseIcon: gridIcon('
|
|
387
|
-
detailPanelExpandIcon: gridIcon('
|
|
388
|
-
exportIcon: gridIcon('
|
|
389
|
-
openFilterButtonIcon: gridIcon('
|
|
101
|
+
baseIconButton: BaseIconButton,
|
|
102
|
+
columnFilteredIcon: gridIcon('columnFilteredIcon'),
|
|
103
|
+
columnSelectorIcon: gridIcon('columnSelectorIcon'),
|
|
104
|
+
columnSortedAscendingIcon: gridIcon('columnSortedAscendingIcon'),
|
|
105
|
+
columnSortedDescendingIcon: gridIcon('columnSortedDescendingIcon'),
|
|
106
|
+
densityCompactIcon: gridIcon('densityCompactIcon'),
|
|
107
|
+
densityStandardIcon: gridIcon('densityStandardIcon'),
|
|
108
|
+
densityComfortableIcon: gridIcon('densityComfortableIcon'),
|
|
109
|
+
detailPanelCollapseIcon: gridIcon('detailPanelCollapseIcon'),
|
|
110
|
+
detailPanelExpandIcon: gridIcon('detailPanelExpandIcon'),
|
|
111
|
+
exportIcon: gridIcon('exportIcon'),
|
|
112
|
+
openFilterButtonIcon: gridIcon('openFilterButtonIcon')
|
|
390
113
|
};
|
|
391
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Stable `toolbar` slot for the belowToolbar layout. Props (the resolved RenderedToolbar plus
|
|
117
|
+
* per-render pagination/banner data) arrive via `slotProps.toolbar`; this component only has to
|
|
118
|
+
* exist with a constant identity. Typed `any` so it is assignable to MUI's toolbar slot type.
|
|
119
|
+
*/
|
|
120
|
+
const BelowToolbar = props => /*#__PURE__*/React__default.createElement(ToolbarWrapper, props);
|
|
121
|
+
|
|
392
122
|
/**
|
|
393
123
|
* Stable bottom-`pagination` slot. Per-render data arrives via `slotProps.pagination`. The body
|
|
394
|
-
* mirrors
|
|
124
|
+
* mirrors `ToolbarWrapper`'s own pagination block so server/client behaviour is identical; it is
|
|
395
125
|
* extracted here purely to give the slot a constant component identity.
|
|
396
126
|
*/
|
|
397
127
|
const BottomPagination = props => {
|
|
@@ -451,15 +181,20 @@ const useControlledDatagridState = _ref => {
|
|
|
451
181
|
propsPinnedColumns,
|
|
452
182
|
propsSortModel
|
|
453
183
|
} = _ref;
|
|
454
|
-
|
|
184
|
+
// Internal state is a fallback for uncontrolled usage only.
|
|
185
|
+
const [internalFilterModel, setInternalFilterModel] = useState(propsFilterModel);
|
|
455
186
|
useEffect(() => {
|
|
456
|
-
|
|
187
|
+
setInternalFilterModel(propsFilterModel);
|
|
457
188
|
}, [propsFilterModel]);
|
|
189
|
+
|
|
190
|
+
// In controlled mode (propsFilterModel provided), use it directly to avoid
|
|
191
|
+
// a one-frame delay from the useState + useEffect buffer.
|
|
192
|
+
const filterModel = propsFilterModel !== null && propsFilterModel !== void 0 ? propsFilterModel : internalFilterModel;
|
|
458
193
|
const onFilterModelChange = (model, details) => {
|
|
459
194
|
if (propsOnFilterModelChange) {
|
|
460
195
|
propsOnFilterModelChange(model, details);
|
|
461
196
|
} else {
|
|
462
|
-
|
|
197
|
+
setInternalFilterModel(model);
|
|
463
198
|
}
|
|
464
199
|
};
|
|
465
200
|
const [columnVisibilityModel, setColumnVisibilityModel] = useState(propsColumnVisibilityModel);
|
|
@@ -477,11 +212,11 @@ const useControlledDatagridState = _ref => {
|
|
|
477
212
|
useEffect(() => {
|
|
478
213
|
setPinnedColumns(propsPinnedColumns);
|
|
479
214
|
}, [propsPinnedColumns]);
|
|
480
|
-
const onPinnedColumnsChange = (
|
|
215
|
+
const onPinnedColumnsChange = (pinnedColumns, details) => {
|
|
481
216
|
if (propsOnPinnedColumnsChange) {
|
|
482
|
-
propsOnPinnedColumnsChange(
|
|
217
|
+
propsOnPinnedColumnsChange(pinnedColumns, details);
|
|
483
218
|
} else {
|
|
484
|
-
setPinnedColumns(
|
|
219
|
+
setPinnedColumns(pinnedColumns);
|
|
485
220
|
}
|
|
486
221
|
};
|
|
487
222
|
const [sortModel, setSortModel] = useState(propsSortModel);
|
|
@@ -525,5 +260,5 @@ const useControlledDatagridState = _ref => {
|
|
|
525
260
|
};
|
|
526
261
|
};
|
|
527
262
|
|
|
528
|
-
export { BottomPagination as B,
|
|
263
|
+
export { BottomPagination as B, StyledDataGrid as S, BelowToolbar as a, baseGridSlots as b, useControlledDatagridState as u };
|
|
529
264
|
//# sourceMappingURL=useControlledDatagridState.js.map
|