@redsift/table 12.4.0-muiv6 → 12.4.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.
@@ -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-pro';
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
- className: filterButtonProps !== null && filterButtonProps !== void 0 && filterButtonProps.className ? `${filterButtonProps === null || filterButtonProps === void 0 ? void 0 : filterButtonProps.className} redsift-condensed` : 'redsift-condensed'
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
- className: filterButtonProps !== null && filterButtonProps !== void 0 && filterButtonProps.className ? `${filterButtonProps === null || filterButtonProps === void 0 ? void 0 : filterButtonProps.className} redsift-condensed` : 'redsift-condensed'
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
- className: filterButtonProps !== null && filterButtonProps !== void 0 && filterButtonProps.className ? `${filterButtonProps === null || filterButtonProps === void 0 ? void 0 : filterButtonProps.className} redsift-condensed` : 'redsift-condensed'
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
- className: filterButtonProps !== null && filterButtonProps !== void 0 && filterButtonProps.className ? `${filterButtonProps === null || filterButtonProps === void 0 ? void 0 : filterButtonProps.className} redsift-condensed` : 'redsift-condensed'
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;;ACKD;AACA;AACA;AACA;;AAUA;;AAEaC,MAAAA,OAA+B,GAAIC,KAAK,IAAK;EACxD,MAAM;AACJC,IAAAA,eAAe,GAAG,IAAI;IACtBC,iBAAiB;IACjBC,eAAe;AACfC,IAAAA,eAAe,GAAG,IAAI;IACtBC,iBAAiB;IACjBC,eAAe;AACfC,IAAAA,gBAAgB,GAAG,IAAI;IACvBC,kBAAkB;IAClBC,gBAAgB;AAChBC,IAAAA,gBAAgB,GAAG,IAAI;IACvBC,kBAAkB;IAClBC,gBAAgB;IAChBC,mBAAmB;AACnBC,IAAAA,mBAAmB,GAAGC,SAAS;AAC/BC,IAAAA,eAAAA;AACF,GAAC,GAAGhB,KAAK,CAAA;EAET,IAAIc,mBAAmB,IAAID,mBAAmB,EAAE;IAC9CC,mBAAmB,CAACD,mBAAmB,GAAGA,mBAAmB,CAAA;AAC/D,GAAA;AAEA,EAAA,oBACEI,cAAA,CAAAC,aAAA,CAACtB,kBAAkB,qBACjBqB,cAAA,CAAAC,aAAA,CAACC,oBAAoB,EACnBF,IAAAA,eAAAA,cAAA,CAAAC,aAAA,CAACE,OAAO,EAAA;AAACC,IAAAA,GAAG,EAAC,GAAA;GACVjB,EAAAA,eAAe,gBACda,cAAA,CAAAC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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","GridToolbarFilterSemanticField"],"mappings":";;;;;;;AAEA;AACA;AACA;AACO,MAAMA,kBAAkB,GAAGC,MAAM,CAACC,GAAI,CAAA;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;ACKD;AACA;AACA;AACA;;AAUA;;AAEaC,MAAAA,OAA+B,GAAIC,KAAK,IAAK;EAAA,IAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA,CAAA;EACxD,MAAM;AACJC,IAAAA,eAAe,GAAG,IAAI;IACtBC,iBAAiB;IACjBC,eAAe;AACfC,IAAAA,eAAe,GAAG,IAAI;IACtBC,iBAAiB;IACjBC,eAAe;AACfC,IAAAA,gBAAgB,GAAG,IAAI;IACvBC,kBAAkB;IAClBC,gBAAgB;AAChBC,IAAAA,gBAAgB,GAAG,IAAI;IACvBC,kBAAkB;IAClBC,gBAAgB;IAChBC,mBAAmB;AACnBC,IAAAA,mBAAmB,GAAGC,SAAS;AAC/BC,IAAAA,eAAAA;AACF,GAAC,GAAG5B,KAAK,CAAA;EAET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KAAA,CAAA;GAEJ,CAAA,CAAC,GACA,IAAI,eACRX,cAAA,CAAAC,aAAA,CAACE,OAAO,EAAA;AAACqB,IAAAA,UAAU,EAAC,KAAA;AAAK,GAAA,EAAEzB,eAAe,gBAAGC,cAAA,CAAAC,aAAA,CAACwB,sBAAsB,EAAE,IAAA,CAAC,GAAG,IAAc,CACjF,CAAC,eACVzB,cAAA,CAAAC,aAAA,CAACE,OAAO,EAAA;AAACuB,IAAAA,QAAQ,EAAE,CAAA;AAAE,GAAA,EAClB7B,mBAAmB,gBAAGG,cAAA,CAAAC,aAAA,CAAC0B,8BAA8B,EAAK9B,mBAAsB,CAAC,GAAG,IAC9E,CACW,CACJ,CAAC,CAAA;AAEzB;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { a as _objectWithoutProperties, b as _extends } from './_rollupPluginBabelHelpers.js';
2
2
  import React__default from 'react';
3
- import { S as ServerSideControlledPagination, C as ControlledPagination } from './ControlledPagination.js';
3
+ import { S as ServerSideControlledPagination, C as ControlledPagination } from './ServerSideControlledPagination.js';
4
4
 
5
5
  const _excluded = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "paginationModel", "onPaginationModelChange", "pageSizeOptions", "paginationProps", "paginationMode", "rowCount"];
6
6
  const ToolbarWrapper = _ref => {
@@ -1,208 +1,5 @@
1
- import { P as PropTypes, z as exactProp, x as useTheme$1, a as _extends, _ as _objectWithoutPropertiesLoose, T as THEME_ID } from './Portal.js';
2
- import * as React from 'react';
3
- import { useState, useEffect } from 'react';
4
- import { j as jsxRuntimeExports } from './jsx-runtime.js';
5
- import { ThemeContext as ThemeContext$2 } from '@emotion/react';
6
1
  import styled, { css } from 'styled-components';
7
-
8
- /* eslint-disable */
9
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
10
- var ponyfillGlobal = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
11
-
12
- const ThemeContext = /*#__PURE__*/React.createContext(null);
13
- if (process.env.NODE_ENV !== 'production') {
14
- ThemeContext.displayName = 'ThemeContext';
15
- }
16
- var ThemeContext$1 = ThemeContext;
17
-
18
- function useTheme() {
19
- const theme = React.useContext(ThemeContext$1);
20
- if (process.env.NODE_ENV !== 'production') {
21
- // eslint-disable-next-line react-hooks/rules-of-hooks
22
- React.useDebugValue(theme);
23
- }
24
- return theme;
25
- }
26
-
27
- const hasSymbol = typeof Symbol === 'function' && Symbol.for;
28
- var nested = hasSymbol ? Symbol.for('mui.nested') : '__THEME_NESTED__';
29
-
30
- function mergeOuterLocalTheme(outerTheme, localTheme) {
31
- if (typeof localTheme === 'function') {
32
- const mergedTheme = localTheme(outerTheme);
33
- if (process.env.NODE_ENV !== 'production') {
34
- if (!mergedTheme) {
35
- console.error(['MUI: You should return an object from your theme function, i.e.', '<ThemeProvider theme={() => ({})} />'].join('\n'));
36
- }
37
- }
38
- return mergedTheme;
39
- }
40
- return {
41
- ...outerTheme,
42
- ...localTheme
43
- };
44
- }
45
-
46
- /**
47
- * This component takes a `theme` prop.
48
- * It makes the `theme` available down the React tree thanks to React context.
49
- * This component should preferably be used at **the root of your component tree**.
50
- */
51
- function ThemeProvider$2(props) {
52
- const {
53
- children,
54
- theme: localTheme
55
- } = props;
56
- const outerTheme = useTheme();
57
- if (process.env.NODE_ENV !== 'production') {
58
- if (outerTheme === null && typeof localTheme === 'function') {
59
- 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'));
60
- }
61
- }
62
- const theme = React.useMemo(() => {
63
- const output = outerTheme === null ? localTheme : mergeOuterLocalTheme(outerTheme, localTheme);
64
- if (output != null) {
65
- output[nested] = outerTheme !== null;
66
- }
67
- return output;
68
- }, [localTheme, outerTheme]);
69
- return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeContext$1.Provider, {
70
- value: theme,
71
- children: children
72
- });
73
- }
74
- process.env.NODE_ENV !== "production" ? ThemeProvider$2.propTypes = {
75
- /**
76
- * Your component tree.
77
- */
78
- children: PropTypes.node,
79
- /**
80
- * A theme object. You can provide a function to extend the outer theme.
81
- */
82
- theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired
83
- } : void 0;
84
- if (process.env.NODE_ENV !== 'production') {
85
- process.env.NODE_ENV !== "production" ? ThemeProvider$2.propTypes = exactProp(ThemeProvider$2.propTypes) : void 0;
86
- }
87
-
88
- const EMPTY_THEME = {};
89
- function useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {
90
- return React.useMemo(() => {
91
- const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;
92
- if (typeof localTheme === 'function') {
93
- const mergedTheme = localTheme(resolvedTheme);
94
- const result = themeId ? _extends({}, upperTheme, {
95
- [themeId]: mergedTheme
96
- }) : mergedTheme;
97
- // must return a function for the private theme to NOT merge with the upper theme.
98
- // see the test case "use provided theme from a callback" in ThemeProvider.test.js
99
- if (isPrivate) {
100
- return () => result;
101
- }
102
- return result;
103
- }
104
- return themeId ? _extends({}, upperTheme, {
105
- [themeId]: localTheme
106
- }) : _extends({}, upperTheme, localTheme);
107
- }, [themeId, upperTheme, localTheme, isPrivate]);
108
- }
109
-
110
- /**
111
- * This component makes the `theme` available down the React tree.
112
- * It should preferably be used at **the root of your component tree**.
113
- *
114
- * <ThemeProvider theme={theme}> // existing use case
115
- * <ThemeProvider theme={{ id: theme }}> // theme scoping
116
- */
117
- function ThemeProvider$1(props) {
118
- const {
119
- children,
120
- theme: localTheme,
121
- themeId
122
- } = props;
123
- const upperTheme = useTheme$1(EMPTY_THEME);
124
- const upperPrivateTheme = useTheme() || EMPTY_THEME;
125
- if (process.env.NODE_ENV !== 'production') {
126
- if (upperTheme === null && typeof localTheme === 'function' || themeId && upperTheme && !upperTheme[themeId] && typeof localTheme === 'function') {
127
- 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'));
128
- }
129
- }
130
- const engineTheme = useThemeScoping(themeId, upperTheme, localTheme);
131
- const privateTheme = useThemeScoping(themeId, upperPrivateTheme, localTheme, true);
132
- return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$2, {
133
- theme: privateTheme,
134
- children: /*#__PURE__*/jsxRuntimeExports.jsx(ThemeContext$2.Provider, {
135
- value: engineTheme,
136
- children: children
137
- })
138
- });
139
- }
140
- process.env.NODE_ENV !== "production" ? ThemeProvider$1.propTypes /* remove-proptypes */ = {
141
- // ----------------------------- Warning --------------------------------
142
- // | These PropTypes are generated from the TypeScript type definitions |
143
- // | To update them edit the d.ts file and run "yarn proptypes" |
144
- // ----------------------------------------------------------------------
145
- /**
146
- * Your component tree.
147
- */
148
- children: PropTypes.node,
149
- /**
150
- * A theme object. You can provide a function to extend the outer theme.
151
- */
152
- theme: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).isRequired,
153
- /**
154
- * The design system's unique id for getting the corresponded theme when there are multiple design systems.
155
- */
156
- themeId: PropTypes.string
157
- } : void 0;
158
- if (process.env.NODE_ENV !== 'production') {
159
- process.env.NODE_ENV !== "production" ? ThemeProvider$1.propTypes = exactProp(ThemeProvider$1.propTypes) : void 0;
160
- }
161
-
162
- const _excluded = ["theme"];
163
- function ThemeProvider(_ref) {
164
- let {
165
- theme: themeInput
166
- } = _ref,
167
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
168
- const scopedTheme = themeInput[THEME_ID];
169
- return /*#__PURE__*/jsxRuntimeExports.jsx(ThemeProvider$1, _extends({}, props, {
170
- themeId: scopedTheme ? THEME_ID : undefined,
171
- theme: scopedTheme || themeInput
172
- }));
173
- }
174
- process.env.NODE_ENV !== "production" ? ThemeProvider.propTypes = {
175
- /**
176
- * Your component tree.
177
- */
178
- children: PropTypes.node,
179
- /**
180
- * A theme object. You can provide a function to extend the outer theme.
181
- */
182
- theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired
183
- } : void 0;
184
-
185
- // Store the license information in a global, so it can be shared
186
- // when module duplication occurs. The duplication of the modules can happen
187
- // if using multiple version of MUI X at the same time of the bundler
188
- // decide to duplicate to improve the size of the chunks.
189
- // eslint-disable-next-line no-underscore-dangle
190
- ponyfillGlobal.__MUI_LICENSE_INFO__ = ponyfillGlobal.__MUI_LICENSE_INFO__ || {
191
- key: undefined
192
- };
193
- class LicenseInfo {
194
- static getLicenseInfo() {
195
- // eslint-disable-next-line no-underscore-dangle
196
- return ponyfillGlobal.__MUI_LICENSE_INFO__;
197
- }
198
- static getLicenseKey() {
199
- return LicenseInfo.getLicenseInfo().key;
200
- }
201
- static setLicenseKey(key) {
202
- const licenseInfo = LicenseInfo.getLicenseInfo();
203
- licenseInfo.key = key;
204
- }
205
- }
2
+ import { useState, useEffect } from 'react';
206
3
 
207
4
  /**
208
5
  * Component style.
@@ -290,15 +87,20 @@ const useControlledDatagridState = _ref => {
290
87
  propsPinnedColumns,
291
88
  propsSortModel
292
89
  } = _ref;
293
- const [filterModel, setFilterModel] = useState(propsFilterModel);
90
+ // Internal state is a fallback for uncontrolled usage only.
91
+ const [internalFilterModel, setInternalFilterModel] = useState(propsFilterModel);
294
92
  useEffect(() => {
295
- setFilterModel(propsFilterModel);
93
+ setInternalFilterModel(propsFilterModel);
296
94
  }, [propsFilterModel]);
95
+
96
+ // In controlled mode (propsFilterModel provided), use it directly to avoid
97
+ // a one-frame delay from the useState + useEffect buffer.
98
+ const filterModel = propsFilterModel !== null && propsFilterModel !== void 0 ? propsFilterModel : internalFilterModel;
297
99
  const onFilterModelChange = (model, details) => {
298
100
  if (propsOnFilterModelChange) {
299
101
  propsOnFilterModelChange(model, details);
300
102
  } else {
301
- setFilterModel(model);
103
+ setInternalFilterModel(model);
302
104
  }
303
105
  };
304
106
  const [columnVisibilityModel, setColumnVisibilityModel] = useState(propsColumnVisibilityModel);
@@ -316,11 +118,11 @@ const useControlledDatagridState = _ref => {
316
118
  useEffect(() => {
317
119
  setPinnedColumns(propsPinnedColumns);
318
120
  }, [propsPinnedColumns]);
319
- const onPinnedColumnsChange = (model, details) => {
121
+ const onPinnedColumnsChange = (pinnedColumns, details) => {
320
122
  if (propsOnPinnedColumnsChange) {
321
- propsOnPinnedColumnsChange(model, details);
123
+ propsOnPinnedColumnsChange(pinnedColumns, details);
322
124
  } else {
323
- setPinnedColumns(model);
125
+ setPinnedColumns(pinnedColumns);
324
126
  }
325
127
  };
326
128
  const [sortModel, setSortModel] = useState(propsSortModel);
@@ -364,5 +166,5 @@ const useControlledDatagridState = _ref => {
364
166
  };
365
167
  };
366
168
 
367
- export { LicenseInfo as L, StyledDataGrid as S, ThemeProvider as T, useControlledDatagridState as u };
169
+ export { StyledDataGrid as S, useControlledDatagridState as u };
368
170
  //# sourceMappingURL=useControlledDatagridState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useControlledDatagridState.js","sources":["../../../../node_modules/@mui/utils/esm/ponyfillGlobal.js","../../../../node_modules/@mui/private-theming/useTheme/ThemeContext.js","../../../../node_modules/@mui/private-theming/useTheme/useTheme.js","../../../../node_modules/@mui/private-theming/ThemeProvider/nested.js","../../../../node_modules/@mui/private-theming/ThemeProvider/ThemeProvider.js","../../../../node_modules/@mui/system/esm/ThemeProvider/ThemeProvider.js","../../../../node_modules/@mui/material/styles/ThemeProvider.js","../../../../node_modules/@mui/x-license-pro/utils/licenseInfo.js","../../src/components/DataGrid/styles.ts","../../src/hooks/useControlledDatagridState.tsx"],"sourcesContent":["/* eslint-disable */\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nexport default typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();","import * as React from 'react';\nconst ThemeContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== 'production') {\n ThemeContext.displayName = 'ThemeContext';\n}\nexport default ThemeContext;","import * as React from 'react';\nimport ThemeContext from './ThemeContext';\nexport default function useTheme() {\n const theme = React.useContext(ThemeContext);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(theme);\n }\n return theme;\n}","const hasSymbol = typeof Symbol === 'function' && Symbol.for;\nexport default hasSymbol ? Symbol.for('mui.nested') : '__THEME_NESTED__';","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { exactProp } from '@mui/utils';\nimport ThemeContext from '../useTheme/ThemeContext';\nimport useTheme from '../useTheme';\nimport nested from './nested';\n\n// To support composition of theme.\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction mergeOuterLocalTheme(outerTheme, localTheme) {\n if (typeof localTheme === 'function') {\n const mergedTheme = localTheme(outerTheme);\n if (process.env.NODE_ENV !== 'production') {\n if (!mergedTheme) {\n console.error(['MUI: You should return an object from your theme function, i.e.', '<ThemeProvider theme={() => ({})} />'].join('\\n'));\n }\n }\n return mergedTheme;\n }\n return {\n ...outerTheme,\n ...localTheme\n };\n}\n\n/**\n * This component takes a `theme` prop.\n * It makes the `theme` available down the React tree thanks to React context.\n * This component should preferably be used at **the root of your component tree**.\n */\nfunction ThemeProvider(props) {\n const {\n children,\n theme: localTheme\n } = props;\n const outerTheme = useTheme();\n if (process.env.NODE_ENV !== 'production') {\n if (outerTheme === null && typeof localTheme === 'function') {\n 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'));\n }\n }\n const theme = React.useMemo(() => {\n const output = outerTheme === null ? localTheme : mergeOuterLocalTheme(outerTheme, localTheme);\n if (output != null) {\n output[nested] = outerTheme !== null;\n }\n return output;\n }, [localTheme, outerTheme]);\n return /*#__PURE__*/_jsx(ThemeContext.Provider, {\n value: theme,\n children: children\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = {\n /**\n * Your component tree.\n */\n children: PropTypes.node,\n /**\n * A theme object. You can provide a function to extend the outer theme.\n */\n theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired\n} : void 0;\nif (process.env.NODE_ENV !== 'production') {\n process.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = exactProp(ThemeProvider.propTypes) : void 0;\n}\nexport default ThemeProvider;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { ThemeProvider as MuiThemeProvider, useTheme as usePrivateTheme } from '@mui/private-theming';\nimport { exactProp } from '@mui/utils';\nimport { ThemeContext as StyledEngineThemeContext } from '@mui/styled-engine';\nimport useThemeWithoutDefault from '../useThemeWithoutDefault';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst EMPTY_THEME = {};\nfunction useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {\n return React.useMemo(() => {\n const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;\n if (typeof localTheme === 'function') {\n const mergedTheme = localTheme(resolvedTheme);\n const result = themeId ? _extends({}, upperTheme, {\n [themeId]: mergedTheme\n }) : mergedTheme;\n // must return a function for the private theme to NOT merge with the upper theme.\n // see the test case \"use provided theme from a callback\" in ThemeProvider.test.js\n if (isPrivate) {\n return () => result;\n }\n return result;\n }\n return themeId ? _extends({}, upperTheme, {\n [themeId]: localTheme\n }) : _extends({}, upperTheme, localTheme);\n }, [themeId, upperTheme, localTheme, isPrivate]);\n}\n\n/**\n * This component makes the `theme` available down the React tree.\n * It should preferably be used at **the root of your component tree**.\n *\n * <ThemeProvider theme={theme}> // existing use case\n * <ThemeProvider theme={{ id: theme }}> // theme scoping\n */\nfunction ThemeProvider(props) {\n const {\n children,\n theme: localTheme,\n themeId\n } = props;\n const upperTheme = useThemeWithoutDefault(EMPTY_THEME);\n const upperPrivateTheme = usePrivateTheme() || EMPTY_THEME;\n if (process.env.NODE_ENV !== 'production') {\n if (upperTheme === null && typeof localTheme === 'function' || themeId && upperTheme && !upperTheme[themeId] && typeof localTheme === 'function') {\n 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'));\n }\n }\n const engineTheme = useThemeScoping(themeId, upperTheme, localTheme);\n const privateTheme = useThemeScoping(themeId, upperPrivateTheme, localTheme, true);\n return /*#__PURE__*/_jsx(MuiThemeProvider, {\n theme: privateTheme,\n children: /*#__PURE__*/_jsx(StyledEngineThemeContext.Provider, {\n value: engineTheme,\n children: children\n })\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * Your component tree.\n */\n children: PropTypes.node,\n /**\n * A theme object. You can provide a function to extend the outer theme.\n */\n theme: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).isRequired,\n /**\n * The design system's unique id for getting the corresponded theme when there are multiple design systems.\n */\n themeId: PropTypes.string\n} : void 0;\nif (process.env.NODE_ENV !== 'production') {\n process.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = exactProp(ThemeProvider.propTypes) : void 0;\n}\nexport default ThemeProvider;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"theme\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { ThemeProvider as SystemThemeProvider } from '@mui/system';\nimport THEME_ID from './identifier';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default function ThemeProvider(_ref) {\n let {\n theme: themeInput\n } = _ref,\n props = _objectWithoutPropertiesLoose(_ref, _excluded);\n const scopedTheme = themeInput[THEME_ID];\n return /*#__PURE__*/_jsx(SystemThemeProvider, _extends({}, props, {\n themeId: scopedTheme ? THEME_ID : undefined,\n theme: scopedTheme || themeInput\n }));\n}\nprocess.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = {\n /**\n * Your component tree.\n */\n children: PropTypes.node,\n /**\n * A theme object. You can provide a function to extend the outer theme.\n */\n theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired\n} : void 0;","import { ponyfillGlobal } from '@mui/utils';\n// Store the license information in a global, so it can be shared\n// when module duplication occurs. The duplication of the modules can happen\n// if using multiple version of MUI X at the same time of the bundler\n// decide to duplicate to improve the size of the chunks.\n// eslint-disable-next-line no-underscore-dangle\nponyfillGlobal.__MUI_LICENSE_INFO__ = ponyfillGlobal.__MUI_LICENSE_INFO__ || {\n key: undefined\n};\nexport class LicenseInfo {\n static getLicenseInfo() {\n // eslint-disable-next-line no-underscore-dangle\n return ponyfillGlobal.__MUI_LICENSE_INFO__;\n }\n static getLicenseKey() {\n return LicenseInfo.getLicenseInfo().key;\n }\n static setLicenseKey(key) {\n const licenseInfo = LicenseInfo.getLicenseInfo();\n licenseInfo.key = key;\n }\n}","import styled, { css } from 'styled-components';\nimport { StyledDataGridProps } from './types';\n\n/**\n * Component style.\n */\nexport const StyledDataGrid = styled.div<StyledDataGridProps>`\n ${({ $height }) =>\n $height\n ? css`\n height: ${$height};\n `\n : ''}\n\n width: 100%;\n\n .MuiDataGrid-root {\n font-family: var(--redsift-typography-datagrid-header-font-family);\n border: none;\n }\n\n .MuiDataGrid-row {\n font-family: var(--redsift-typography-datagrid-cell-font-family);\n font-size: var(--redsift-typography-datagrid-cell-font-size);\n font-weight: var(--redsift-typography-datagrid-cell-font-weight);\n }\n\n .MuiDataGrid-columnHeaderTitle {\n font-family: var(--redsift-typography-datagrid-header-font-family);\n font-size: var(--redsift-typography-datagrid-header-font-size);\n font-weight: var(--redsift-typography-datagrid-header-font-weight);\n }\n\n .MuiDataGrid-columnHeaders {\n border-bottom-color: var(--redsift-color-primary-n);\n }\n\n .MuiDataGrid-columnSeparator {\n display: none;\n }\n\n .MuiTablePagination-root {\n .MuiTablePagination-selectLabel {\n font-family: var(--redsift-typography-datagrid-header-font-family);\n }\n .MuiTablePagination-displayedRows {\n font-family: var(--redsift-typography-datagrid-cell-font-family);\n }\n\n .MuiInputBase-root {\n font-family: var(--redsift-typography-datagrid-cell-font-family);\n }\n }\n\n .Mui-checked {\n color: var(--redsift-color-primary-n);\n }\n\n .MuiDataGrid-rowCount {\n font-family: var(--redsift-typography-datagrid-cell-font-family);\n }\n\n .MuiTablePagination-displayedRows {\n font-family: var(--redsift-typography-datagrid-cell-font-family);\n }\n\n .MuiBadge-standard {\n font-family: var(--redsift-typography-datagrid-cell-font-family);\n }\n`;\n","import {\n GridCallbackDetails,\n GridColumnVisibilityModel,\n GridFilterModel,\n GridPaginationModel,\n GridPinnedColumns,\n GridSortModel,\n} from '@mui/x-data-grid-pro';\nimport { useEffect, useState } from 'react';\nimport { DataGridProps } from '../components/DataGrid';\n\nexport interface UseControlledDatagridStateProps {\n initialState: DataGridProps['initialState'];\n pageSizeOptions: DataGridProps['pageSizeOptions'];\n propsColumnVisibilityModel: DataGridProps['columnVisibilityModel'];\n propsFilterModel: DataGridProps['filterModel'];\n propsOnColumnVisibilityModelChange: DataGridProps['onColumnVisibilityModelChange'];\n propsOnFilterModelChange: DataGridProps['onFilterModelChange'];\n propsOnPaginationModelChange: DataGridProps['onPaginationModelChange'];\n propsOnPinnedColumnsChange: DataGridProps['onPinnedColumnsChange'];\n propsOnSortModelChange: DataGridProps['onSortModelChange'];\n propsPaginationModel: DataGridProps['paginationModel'];\n propsPinnedColumns: DataGridProps['pinnedColumns'];\n propsSortModel: DataGridProps['sortModel'];\n}\n\nexport const useControlledDatagridState = ({\n initialState,\n pageSizeOptions,\n propsColumnVisibilityModel,\n propsFilterModel,\n propsOnColumnVisibilityModelChange,\n propsOnFilterModelChange,\n propsOnPaginationModelChange,\n propsOnPinnedColumnsChange,\n propsOnSortModelChange,\n propsPaginationModel,\n propsPinnedColumns,\n propsSortModel,\n}: UseControlledDatagridStateProps) => {\n const [filterModel, setFilterModel] = useState(propsFilterModel);\n useEffect(() => {\n setFilterModel(propsFilterModel);\n }, [propsFilterModel]);\n\n const onFilterModelChange = (model: GridFilterModel, details: GridCallbackDetails<'filter'>) => {\n if (propsOnFilterModelChange) {\n propsOnFilterModelChange(model, details);\n } else {\n setFilterModel(model);\n }\n };\n\n const [columnVisibilityModel, setColumnVisibilityModel] = useState(propsColumnVisibilityModel);\n useEffect(() => {\n setColumnVisibilityModel(propsColumnVisibilityModel);\n }, [propsColumnVisibilityModel]);\n\n const onColumnVisibilityModelChange = (model: GridColumnVisibilityModel, details: GridCallbackDetails<'filter'>) => {\n if (propsOnColumnVisibilityModelChange) {\n propsOnColumnVisibilityModelChange(model, details);\n } else {\n setColumnVisibilityModel(model);\n }\n };\n\n const [pinnedColumns, setPinnedColumns] = useState(propsPinnedColumns);\n useEffect(() => {\n setPinnedColumns(propsPinnedColumns);\n }, [propsPinnedColumns]);\n\n const onPinnedColumnsChange = (model: GridPinnedColumns, details: GridCallbackDetails<'filter'>) => {\n if (propsOnPinnedColumnsChange) {\n propsOnPinnedColumnsChange(model, details);\n } else {\n setPinnedColumns(model);\n }\n };\n\n const [sortModel, setSortModel] = useState(propsSortModel);\n useEffect(() => {\n setSortModel(propsSortModel);\n }, [propsSortModel]);\n\n const onSortModelChange = (model: GridSortModel, details: GridCallbackDetails<'filter'>) => {\n if (propsOnSortModelChange) {\n propsOnSortModelChange(model, details);\n } else {\n setSortModel(model);\n }\n };\n\n const [paginationModel, setPaginationModel] = useState({\n pageSize:\n propsPaginationModel?.pageSize ??\n initialState?.pagination?.paginationModel?.pageSize ??\n (typeof pageSizeOptions?.[0] === 'number' ? pageSizeOptions?.[0] : pageSizeOptions?.[0]?.value) ??\n 25,\n page: propsPaginationModel?.page ?? initialState?.pagination?.paginationModel?.page ?? 0,\n });\n\n const onPaginationModelChange = (model: GridPaginationModel, details: GridCallbackDetails) => {\n if (propsOnPaginationModelChange) {\n propsOnPaginationModelChange(model, details);\n } else {\n setPaginationModel(model);\n }\n };\n\n useEffect(() => {\n if (propsPaginationModel) {\n setPaginationModel(propsPaginationModel);\n }\n }, [propsPaginationModel]);\n\n return {\n filterModel,\n onFilterModelChange,\n columnVisibilityModel,\n onColumnVisibilityModelChange,\n pinnedColumns,\n onPinnedColumnsChange,\n sortModel,\n onSortModelChange,\n paginationModel,\n onPaginationModelChange,\n };\n};\n"],"names":["ThemeContext","ThemeProvider","_jsx","useThemeWithoutDefault","usePrivateTheme","MuiThemeProvider","StyledEngineThemeContext","SystemThemeProvider","StyledDataGrid","styled","div","_ref","$height","css","useControlledDatagridState","_ref2","_ref3","_propsPaginationModel","_initialState$paginat","_initialState$paginat2","_pageSizeOptions$","_ref4","_propsPaginationModel2","_initialState$paginat3","_initialState$paginat4","initialState","pageSizeOptions","propsColumnVisibilityModel","propsFilterModel","propsOnColumnVisibilityModelChange","propsOnFilterModelChange","propsOnPaginationModelChange","propsOnPinnedColumnsChange","propsOnSortModelChange","propsPaginationModel","propsPinnedColumns","propsSortModel","filterModel","setFilterModel","useState","useEffect","onFilterModelChange","model","details","columnVisibilityModel","setColumnVisibilityModel","onColumnVisibilityModelChange","pinnedColumns","setPinnedColumns","onPinnedColumnsChange","sortModel","setSortModel","onSortModelChange","paginationModel","setPaginationModel","pageSize","pagination","value","page","onPaginationModelChange"],"mappings":";;;;;;;AAAA;AACA;AACA,qBAAe,OAAO,MAAM,IAAI,WAAW,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI,GAAG,MAAM,GAAG,OAAO,IAAI,IAAI,WAAW,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,GAAG,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,EAAE;;ACDhK,MAAM,YAAY,gBAAgB,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,IAAApC,sBAAA,KAAAA,KAAAA,CAAAA,GAAAA,sBAAA,GAAIG,YAAY,KAAA,IAAA,IAAZA,YAAY,KAAAF,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,CAAAA,sBAAA,GAAZE,YAAY,CAAE+B,UAAU,MAAAjC,IAAAA,IAAAA,sBAAA,wBAAAC,sBAAA,GAAxBD,sBAAA,CAA0B8B,eAAe,cAAA7B,sBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAzCA,sBAAA,CAA2CkC,IAAI,cAAArC,KAAA,KAAA,KAAA,CAAA,GAAAA,KAAA,GAAI,CAAA;AACzF,GAAC,CAAC,CAAA;AAEF,EAAA,MAAMsC,uBAAuB,GAAGA,CAACjB,KAA0B,EAAEC,OAA4B,KAAK;AAC5F,IAAA,IAAIZ,4BAA4B,EAAE;AAChCA,MAAAA,4BAA4B,CAACW,KAAK,EAAEC,OAAO,CAAC,CAAA;AAC9C,KAAC,MAAM;MACLW,kBAAkB,CAACZ,KAAK,CAAC,CAAA;AAC3B,KAAA;GACD,CAAA;AAEDF,EAAAA,SAAS,CAAC,MAAM;AACd,IAAA,IAAIN,oBAAoB,EAAE;MACxBoB,kBAAkB,CAACpB,oBAAoB,CAAC,CAAA;AAC1C,KAAA;AACF,GAAC,EAAE,CAACA,oBAAoB,CAAC,CAAC,CAAA;EAE1B,OAAO;IACLG,WAAW;IACXI,mBAAmB;IACnBG,qBAAqB;IACrBE,6BAA6B;IAC7BC,aAAa;IACbE,qBAAqB;IACrBC,SAAS;IACTE,iBAAiB;IACjBC,eAAe;AACfM,IAAAA,uBAAAA;GACD,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"useControlledDatagridState.js","sources":["../../src/components/DataGrid/styles.ts","../../src/hooks/useControlledDatagridState.tsx"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { StyledDataGridProps } from './types';\n\n/**\n * Component style.\n */\nexport const StyledDataGrid = styled.div<StyledDataGridProps>`\n ${({ $height }) =>\n $height\n ? css`\n height: ${$height};\n `\n : ''}\n\n width: 100%;\n\n .MuiDataGrid-root {\n font-family: var(--redsift-typography-datagrid-header-font-family);\n border: none;\n }\n\n .MuiDataGrid-row {\n font-family: var(--redsift-typography-datagrid-cell-font-family);\n font-size: var(--redsift-typography-datagrid-cell-font-size);\n font-weight: var(--redsift-typography-datagrid-cell-font-weight);\n }\n\n .MuiDataGrid-columnHeaderTitle {\n font-family: var(--redsift-typography-datagrid-header-font-family);\n font-size: var(--redsift-typography-datagrid-header-font-size);\n font-weight: var(--redsift-typography-datagrid-header-font-weight);\n }\n\n .MuiDataGrid-columnHeaders {\n border-bottom-color: var(--redsift-color-primary-n);\n }\n\n .MuiDataGrid-columnSeparator {\n display: none;\n }\n\n .MuiTablePagination-root {\n .MuiTablePagination-selectLabel {\n font-family: var(--redsift-typography-datagrid-header-font-family);\n }\n .MuiTablePagination-displayedRows {\n font-family: var(--redsift-typography-datagrid-cell-font-family);\n }\n\n .MuiInputBase-root {\n font-family: var(--redsift-typography-datagrid-cell-font-family);\n }\n }\n\n .Mui-checked {\n color: var(--redsift-color-primary-n);\n }\n\n .MuiDataGrid-rowCount {\n font-family: var(--redsift-typography-datagrid-cell-font-family);\n }\n\n .MuiTablePagination-displayedRows {\n font-family: var(--redsift-typography-datagrid-cell-font-family);\n }\n\n .MuiBadge-standard {\n font-family: var(--redsift-typography-datagrid-cell-font-family);\n }\n`;\n","import {\n GridCallbackDetails,\n GridColumnVisibilityModel,\n GridFilterModel,\n GridPaginationModel,\n GridPinnedColumnFields,\n GridSortModel,\n} from '@mui/x-data-grid-premium';\nimport { useEffect, useState } from 'react';\nimport { DataGridProps } from '../components/DataGrid';\n\nexport interface UseControlledDatagridStateProps {\n initialState: DataGridProps['initialState'];\n pageSizeOptions: DataGridProps['pageSizeOptions'];\n propsColumnVisibilityModel: DataGridProps['columnVisibilityModel'];\n propsFilterModel: DataGridProps['filterModel'];\n propsOnColumnVisibilityModelChange: DataGridProps['onColumnVisibilityModelChange'];\n propsOnFilterModelChange: DataGridProps['onFilterModelChange'];\n propsOnPaginationModelChange: DataGridProps['onPaginationModelChange'];\n propsOnPinnedColumnsChange: DataGridProps['onPinnedColumnsChange'];\n propsOnSortModelChange: DataGridProps['onSortModelChange'];\n propsPaginationModel: DataGridProps['paginationModel'];\n propsPinnedColumns: DataGridProps['pinnedColumns'];\n propsSortModel: DataGridProps['sortModel'];\n}\n\nexport const useControlledDatagridState = ({\n initialState,\n pageSizeOptions,\n propsColumnVisibilityModel,\n propsFilterModel,\n propsOnColumnVisibilityModelChange,\n propsOnFilterModelChange,\n propsOnPaginationModelChange,\n propsOnPinnedColumnsChange,\n propsOnSortModelChange,\n propsPaginationModel,\n propsPinnedColumns,\n propsSortModel,\n}: UseControlledDatagridStateProps) => {\n // Internal state is a fallback for uncontrolled usage only.\n const [internalFilterModel, setInternalFilterModel] = useState(propsFilterModel);\n useEffect(() => {\n setInternalFilterModel(propsFilterModel);\n }, [propsFilterModel]);\n\n // In controlled mode (propsFilterModel provided), use it directly to avoid\n // a one-frame delay from the useState + useEffect buffer.\n const filterModel = propsFilterModel ?? internalFilterModel;\n\n const onFilterModelChange = (model: GridFilterModel, details: GridCallbackDetails<'filter'>) => {\n if (propsOnFilterModelChange) {\n propsOnFilterModelChange(model, details);\n } else {\n setInternalFilterModel(model);\n }\n };\n\n const [columnVisibilityModel, setColumnVisibilityModel] = useState(propsColumnVisibilityModel);\n useEffect(() => {\n setColumnVisibilityModel(propsColumnVisibilityModel);\n }, [propsColumnVisibilityModel]);\n\n const onColumnVisibilityModelChange = (model: GridColumnVisibilityModel, details: GridCallbackDetails<'filter'>) => {\n if (propsOnColumnVisibilityModelChange) {\n propsOnColumnVisibilityModelChange(model, details);\n } else {\n setColumnVisibilityModel(model);\n }\n };\n\n const [pinnedColumns, setPinnedColumns] = useState(propsPinnedColumns);\n useEffect(() => {\n setPinnedColumns(propsPinnedColumns);\n }, [propsPinnedColumns]);\n\n const onPinnedColumnsChange = (pinnedColumns: GridPinnedColumnFields, details: GridCallbackDetails) => {\n if (propsOnPinnedColumnsChange) {\n propsOnPinnedColumnsChange(pinnedColumns, details);\n } else {\n setPinnedColumns(pinnedColumns);\n }\n };\n\n const [sortModel, setSortModel] = useState(propsSortModel);\n useEffect(() => {\n setSortModel(propsSortModel);\n }, [propsSortModel]);\n\n const onSortModelChange = (model: GridSortModel, details: GridCallbackDetails<'filter'>) => {\n if (propsOnSortModelChange) {\n propsOnSortModelChange(model, details);\n } else {\n setSortModel(model);\n }\n };\n\n const [paginationModel, setPaginationModel] = useState({\n pageSize:\n propsPaginationModel?.pageSize ??\n initialState?.pagination?.paginationModel?.pageSize ??\n (typeof pageSizeOptions?.[0] === 'number' ? pageSizeOptions?.[0] : pageSizeOptions?.[0]?.value) ??\n 25,\n page: propsPaginationModel?.page ?? initialState?.pagination?.paginationModel?.page ?? 0,\n });\n\n const onPaginationModelChange = (model: GridPaginationModel, details: GridCallbackDetails) => {\n if (propsOnPaginationModelChange) {\n propsOnPaginationModelChange(model, details);\n } else {\n setPaginationModel(model);\n }\n };\n\n useEffect(() => {\n if (propsPaginationModel) {\n setPaginationModel(propsPaginationModel);\n }\n }, [propsPaginationModel]);\n\n return {\n filterModel,\n onFilterModelChange,\n columnVisibilityModel,\n onColumnVisibilityModelChange,\n pinnedColumns,\n onPinnedColumnsChange,\n sortModel,\n onSortModelChange,\n paginationModel,\n onPaginationModelChange,\n };\n};\n"],"names":["StyledDataGrid","styled","div","_ref","$height","css","useControlledDatagridState","_ref2","_ref3","_propsPaginationModel","_initialState$paginat","_initialState$paginat2","_pageSizeOptions$","_ref4","_propsPaginationModel2","_initialState$paginat3","_initialState$paginat4","initialState","pageSizeOptions","propsColumnVisibilityModel","propsFilterModel","propsOnColumnVisibilityModelChange","propsOnFilterModelChange","propsOnPaginationModelChange","propsOnPinnedColumnsChange","propsOnSortModelChange","propsPaginationModel","propsPinnedColumns","propsSortModel","internalFilterModel","setInternalFilterModel","useState","useEffect","filterModel","onFilterModelChange","model","details","columnVisibilityModel","setColumnVisibilityModel","onColumnVisibilityModelChange","pinnedColumns","setPinnedColumns","onPinnedColumnsChange","sortModel","setSortModel","onSortModelChange","paginationModel","setPaginationModel","pageSize","pagination","value","page","onPaginationModelChange"],"mappings":";;;AAGA;AACA;AACA;AACaA,MAAAA,cAAc,GAAGC,MAAM,CAACC,GAAyB,CAAA;AAC9D,EAAA,EAAIC,IAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,OAAAA;AAAQ,GAAC,GAAAD,IAAA,CAAA;EAAA,OACZC,OAAO,GACHC,GAAI,CAAA;AACZ,kBAAA,EAAoBD,OAAQ,CAAA;AAC5B,QAAA,CAAS,GACD,EAAE,CAAA;AAAA,CAAC,CAAA;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CaE,MAAAA,0BAA0B,GAAGH,IAAA,IAaH;AAAA,EAAA,IAAAI,KAAA,EAAAC,KAAA,EAAAC,qBAAA,EAAAC,qBAAA,EAAAC,sBAAA,EAAAC,iBAAA,EAAAC,KAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,CAAA;EAAA,IAbI;IACzCC,YAAY;IACZC,eAAe;IACfC,0BAA0B;IAC1BC,gBAAgB;IAChBC,kCAAkC;IAClCC,wBAAwB;IACxBC,4BAA4B;IAC5BC,0BAA0B;IAC1BC,sBAAsB;IACtBC,oBAAoB;IACpBC,kBAAkB;AAClBC,IAAAA,cAAAA;AAC+B,GAAC,GAAAzB,IAAA,CAAA;AAChC;EACA,MAAM,CAAC0B,mBAAmB,EAAEC,sBAAsB,CA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