@redsift/table-pro 12.5.4
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/CONTRIBUTING.md +435 -0
- package/_internal/BaseComponents.js +3 -0
- package/_internal/BaseComponents.js.map +1 -0
- package/_internal/BaseIconButton.js +126 -0
- package/_internal/BaseIconButton.js.map +1 -0
- package/_internal/BaseTextField.js +26 -0
- package/_internal/BaseTextField.js.map +1 -0
- package/_internal/DataGrid.js +2 -0
- package/_internal/DataGrid.js.map +1 -0
- package/_internal/DataGrid2.js +507 -0
- package/_internal/DataGrid2.js.map +1 -0
- package/_internal/GridToolbarFilterSemanticField.js +2 -0
- package/_internal/GridToolbarFilterSemanticField.js.map +1 -0
- package/_internal/GridToolbarFilterSemanticField2.js +6962 -0
- package/_internal/GridToolbarFilterSemanticField2.js.map +1 -0
- package/_internal/Pagination.js +2 -0
- package/_internal/Pagination.js.map +1 -0
- package/_internal/ServerSideControlledPagination.js +324 -0
- package/_internal/ServerSideControlledPagination.js.map +1 -0
- package/_internal/StatefulDataGrid.js +2 -0
- package/_internal/StatefulDataGrid.js.map +1 -0
- package/_internal/StatefulDataGrid2.js +3237 -0
- package/_internal/StatefulDataGrid2.js.map +1 -0
- package/_internal/TextCell.js +2 -0
- package/_internal/TextCell.js.map +1 -0
- package/_internal/TextCell2.js +66 -0
- package/_internal/TextCell2.js.map +1 -0
- package/_internal/Toolbar.js +2 -0
- package/_internal/Toolbar.js.map +1 -0
- package/_internal/Toolbar2.js +102 -0
- package/_internal/Toolbar2.js.map +1 -0
- package/_internal/ToolbarWrapper.js +2 -0
- package/_internal/ToolbarWrapper.js.map +1 -0
- package/_internal/ToolbarWrapper2.js +53 -0
- package/_internal/ToolbarWrapper2.js.map +1 -0
- package/_internal/_rollupPluginBabelHelpers.js +93 -0
- package/_internal/_rollupPluginBabelHelpers.js.map +1 -0
- package/_internal/useControlledDatagridState.js +170 -0
- package/_internal/useControlledDatagridState.js.map +1 -0
- package/index.d.ts +1223 -0
- package/index.js +721 -0
- package/index.js.map +1 -0
- package/package.json +96 -0
- package/style/index.css +7 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextCell.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { a as _objectWithoutProperties, b as _extends } from './_rollupPluginBabelHelpers.js';
|
|
2
|
+
import React__default, { forwardRef, useRef } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { Shield, Icon } from '@redsift/design-system';
|
|
5
|
+
import styled from 'styled-components';
|
|
6
|
+
|
|
7
|
+
const StyledTextCell = styled.div`
|
|
8
|
+
align-items: center;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
display: flex;
|
|
11
|
+
gap: 8px;
|
|
12
|
+
justify-content: flex-start;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
text-overflow: ellipsis;
|
|
15
|
+
white-space: nowrap;
|
|
16
|
+
`;
|
|
17
|
+
const StyledTextCellText = styled.div`
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
line-height: normal;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
text-overflow: ellipsis;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
const _excluded = ["badge", "children", "className", "leftIcon", "leftIconColor", "rightIcon", "rightIconColor", "shieldVariant"];
|
|
26
|
+
const COMPONENT_NAME = 'DataGridCell';
|
|
27
|
+
const CLASSNAME = 'redsift-datagrid-cell';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The Cell component.
|
|
31
|
+
*/
|
|
32
|
+
const TextCell = /*#__PURE__*/forwardRef((props, ref) => {
|
|
33
|
+
const textCellRef = ref || useRef();
|
|
34
|
+
const {
|
|
35
|
+
badge,
|
|
36
|
+
children,
|
|
37
|
+
className,
|
|
38
|
+
leftIcon,
|
|
39
|
+
leftIconColor,
|
|
40
|
+
rightIcon,
|
|
41
|
+
rightIconColor,
|
|
42
|
+
shieldVariant
|
|
43
|
+
} = props,
|
|
44
|
+
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
45
|
+
return /*#__PURE__*/React__default.createElement(StyledTextCell, _extends({}, forwardedProps, {
|
|
46
|
+
className: classNames(TextCell.className, className),
|
|
47
|
+
ref: textCellRef
|
|
48
|
+
}), /*#__PURE__*/React__default.createElement(React__default.Fragment, null, shieldVariant ? /*#__PURE__*/React__default.createElement(Shield, {
|
|
49
|
+
variant: shieldVariant
|
|
50
|
+
}) : null, leftIcon ? /*#__PURE__*/React__default.createElement(Icon, {
|
|
51
|
+
icon: leftIcon,
|
|
52
|
+
"aria-hidden": "true",
|
|
53
|
+
size: "small",
|
|
54
|
+
color: leftIconColor
|
|
55
|
+
}) : null, /*#__PURE__*/React__default.createElement(StyledTextCellText, null, children), badge ? badge : null, rightIcon ? /*#__PURE__*/React__default.createElement(Icon, {
|
|
56
|
+
icon: rightIcon,
|
|
57
|
+
"aria-hidden": "true",
|
|
58
|
+
size: "small",
|
|
59
|
+
color: rightIconColor
|
|
60
|
+
}) : null));
|
|
61
|
+
});
|
|
62
|
+
TextCell.className = CLASSNAME;
|
|
63
|
+
TextCell.displayName = COMPONENT_NAME;
|
|
64
|
+
|
|
65
|
+
export { TextCell as T };
|
|
66
|
+
//# sourceMappingURL=TextCell2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextCell2.js","sources":["../../src/components/TextCell/styles.ts","../../src/components/TextCell/TextCell.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledTextCell = styled.div`\n align-items: center;\n box-sizing: border-box;\n display: flex;\n gap: 8px;\n justify-content: flex-start;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nexport const StyledTextCellText = styled.div`\n box-sizing: border-box;\n line-height: normal;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n","import React, { forwardRef, RefObject, useRef } from 'react';\nimport classNames from 'classnames';\nimport { Comp } from '@redsift/design-system';\nimport { Icon, Shield } from '@redsift/design-system';\n\nimport { StyledTextCell, StyledTextCellText } from './styles';\nimport { TextCellProps } from './types';\n\nconst COMPONENT_NAME = 'DataGridCell';\nconst CLASSNAME = 'redsift-datagrid-cell';\n\n/**\n * The Cell component.\n */\nexport const TextCell: Comp<TextCellProps, HTMLDivElement> = forwardRef(\n (props, ref) => {\n const textCellRef = ref || useRef<HTMLDivElement>();\n const {\n badge,\n children,\n className,\n leftIcon,\n leftIconColor,\n rightIcon,\n rightIconColor,\n shieldVariant,\n ...forwardedProps\n } = props;\n\n return (\n <StyledTextCell\n {...forwardedProps}\n className={classNames(TextCell.className, className)}\n ref={textCellRef as RefObject<HTMLDivElement>}\n >\n <>\n {shieldVariant ? <Shield variant={shieldVariant} /> : null}\n {leftIcon ? (\n <Icon\n icon={leftIcon}\n aria-hidden=\"true\"\n size=\"small\"\n color={leftIconColor}\n />\n ) : null}\n <StyledTextCellText>{children}</StyledTextCellText>\n {badge ? badge : null}\n {rightIcon ? (\n <Icon\n icon={rightIcon}\n aria-hidden=\"true\"\n size=\"small\"\n color={rightIconColor}\n />\n ) : null}\n </>\n </StyledTextCell>\n );\n }\n);\n\nTextCell.className = CLASSNAME;\nTextCell.displayName = COMPONENT_NAME;\n"],"names":["StyledTextCell","styled","div","StyledTextCellText","COMPONENT_NAME","CLASSNAME","TextCell","forwardRef","props","ref","textCellRef","useRef","badge","children","className","leftIcon","leftIconColor","rightIcon","rightIconColor","shieldVariant","forwardedProps","_objectWithoutProperties","_excluded","React","createElement","_extends","classNames","Fragment","Shield","variant","Icon","icon","size","color","displayName"],"mappings":";;;;;;AAEO,MAAMA,cAAc,GAAGC,MAAM,CAACC,GAAI,CAAA;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAA;AAEM,MAAMC,kBAAkB,GAAGF,MAAM,CAACC,GAAI,CAAA;AAC7C;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,CAACM,IAAI,EAAA;AACHC,IAAAA,IAAI,EAAEd,SAAU;AAChB,IAAA,aAAA,EAAY,MAAM;AAClBe,IAAAA,IAAI,EAAC,OAAO;AACZC,IAAAA,KAAK,EAAEf,cAAAA;AAAe,GACvB,CAAC,GACA,IACJ,CACY,CAAC,CAAA;AAErB,CACF,EAAC;AAEDZ,QAAQ,CAACQ,SAAS,GAAGT,SAAS,CAAA;AAC9BC,QAAQ,CAAC4B,WAAW,GAAG9B,cAAc;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toolbar.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { b as _extends, _ as _objectSpread2 } from './_rollupPluginBabelHelpers.js';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { GridToolbarContainer, GridToolbarFilterButton, GridToolbarColumnsButton, GridToolbarDensitySelector, GridToolbarExport, gridExpandedSortedRowIdsSelector, GridToolbarQuickFilter } from '@mui/x-data-grid-pro';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { Flexbox } from '@redsift/design-system';
|
|
6
|
+
import { G as GridToolbarFilterSemanticField } from './GridToolbarFilterSemanticField2.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Component style.
|
|
10
|
+
*/
|
|
11
|
+
const GridToolbarWrapper = styled.div`
|
|
12
|
+
.MuiButtonBase-root-JobBs.MuiButton-root {
|
|
13
|
+
svg {
|
|
14
|
+
path {
|
|
15
|
+
fill: var(--redsift-color-primary-n);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Temporary workaround for a type mismatch between react 17 and 18
|
|
23
|
+
* https://github.com/mui/material-ui/issues/35287#issuecomment-1337250566
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/** ------ */
|
|
27
|
+
|
|
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;
|
|
30
|
+
const {
|
|
31
|
+
hasExportButton = true,
|
|
32
|
+
exportButtonProps,
|
|
33
|
+
exportButtonRef,
|
|
34
|
+
hasFilterButton = true,
|
|
35
|
+
filterButtonProps,
|
|
36
|
+
filterButtonRef,
|
|
37
|
+
hasColumnsButton = true,
|
|
38
|
+
columnsButtonProps,
|
|
39
|
+
columnsButtonRef,
|
|
40
|
+
hasDensityButton = true,
|
|
41
|
+
densityButtonProps,
|
|
42
|
+
densityButtonRef,
|
|
43
|
+
onFilterModelChange,
|
|
44
|
+
semanticFilterProps = undefined,
|
|
45
|
+
showQuickFilter
|
|
46
|
+
} = props;
|
|
47
|
+
if (semanticFilterProps && onFilterModelChange) {
|
|
48
|
+
semanticFilterProps.onFilterModelChange = onFilterModelChange;
|
|
49
|
+
}
|
|
50
|
+
return /*#__PURE__*/React__default.createElement(GridToolbarWrapper, null, /*#__PURE__*/React__default.createElement(GridToolbarContainer, null, /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
51
|
+
gap: "0"
|
|
52
|
+
}, hasFilterButton ? /*#__PURE__*/React__default.createElement(GridToolbarFilterButton, _extends({}, filterButtonProps, {
|
|
53
|
+
ref: filterButtonRef,
|
|
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
|
+
})
|
|
59
|
+
})) : null, hasColumnsButton ? /*#__PURE__*/React__default.createElement(GridToolbarColumnsButton, _extends({}, columnsButtonProps, {
|
|
60
|
+
ref: columnsButtonRef,
|
|
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
|
+
})
|
|
66
|
+
})) : null, hasDensityButton ? /*#__PURE__*/React__default.createElement(GridToolbarDensitySelector, _extends({}, densityButtonProps, {
|
|
67
|
+
ref: densityButtonRef,
|
|
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
|
+
})
|
|
73
|
+
})) : null, hasExportButton ? /*#__PURE__*/React__default.createElement(GridToolbarExport, _extends({
|
|
74
|
+
csvOptions: {
|
|
75
|
+
allColumns: true,
|
|
76
|
+
fileName: 'csv',
|
|
77
|
+
getRowsToExport: _ref => {
|
|
78
|
+
let {
|
|
79
|
+
apiRef
|
|
80
|
+
} = _ref;
|
|
81
|
+
return gridExpandedSortedRowIdsSelector(apiRef);
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
printOptions: {
|
|
85
|
+
disableToolbarButton: true
|
|
86
|
+
}
|
|
87
|
+
}, exportButtonProps, {
|
|
88
|
+
ref: exportButtonRef,
|
|
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
|
+
})
|
|
94
|
+
})) : null, /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
95
|
+
marginLeft: "8px"
|
|
96
|
+
}, showQuickFilter ? /*#__PURE__*/React__default.createElement(GridToolbarQuickFilter, null) : null)), /*#__PURE__*/React__default.createElement(Flexbox, {
|
|
97
|
+
flexGrow: 3
|
|
98
|
+
}, semanticFilterProps ? /*#__PURE__*/React__default.createElement(GridToolbarFilterSemanticField, semanticFilterProps) : null)));
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export { Toolbar as T };
|
|
102
|
+
//# sourceMappingURL=Toolbar2.js.map
|
|
@@ -0,0 +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 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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A,EAAA,EAAA;AACvCC,QAAAA,SAAS,EAAE1B,iBAAiB,KAAjBA,IAAAA,IAAAA,iBAAiB,gBAAAH,sBAAA,GAAjBG,iBAAiB,CAAEuB,SAAS,MAAA1B,IAAAA,IAAAA,sBAAA,KAAAC,KAAAA,CAAAA,IAAAA,CAAAA,sBAAA,GAA5BD,sBAAA,CAA8B4B,MAAM,MAAA,IAAA,IAAA3B,sBAAA,KAAA,KAAA,CAAA,IAApCA,sBAAA,CAAsC4B,SAAS,GACrD,CAAA,EAAE1B,iBAAiB,CAACuB,SAAS,CAACE,MAAM,CAACC,SAAU,oBAAmB,GACnE,mBAAA;AAAmB,OAAA,CAAA;AACxB,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;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolbarWrapper.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { a as _objectWithoutProperties, b as _extends } from './_rollupPluginBabelHelpers.js';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { S as ServerSideControlledPagination, C as ControlledPagination } from './ServerSideControlledPagination.js';
|
|
4
|
+
|
|
5
|
+
const _excluded = ["hideToolbar", "RenderedToolbar", "filterModel", "onFilterModelChange", "pagination", "paginationPlacement", "selectionStatus", "apiRef", "isRowSelectable", "paginationModel", "onPaginationModelChange", "pageSizeOptions", "paginationProps", "paginationMode", "rowCount"];
|
|
6
|
+
const ToolbarWrapper = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
hideToolbar,
|
|
9
|
+
RenderedToolbar,
|
|
10
|
+
filterModel,
|
|
11
|
+
onFilterModelChange,
|
|
12
|
+
pagination,
|
|
13
|
+
paginationPlacement,
|
|
14
|
+
selectionStatus,
|
|
15
|
+
apiRef,
|
|
16
|
+
isRowSelectable,
|
|
17
|
+
paginationModel,
|
|
18
|
+
onPaginationModelChange,
|
|
19
|
+
pageSizeOptions,
|
|
20
|
+
paginationProps,
|
|
21
|
+
paginationMode = 'client',
|
|
22
|
+
rowCount
|
|
23
|
+
} = _ref,
|
|
24
|
+
forwardedProps = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, !hideToolbar ? /*#__PURE__*/React__default.createElement(RenderedToolbar, _extends({}, forwardedProps, {
|
|
26
|
+
filterModel: filterModel,
|
|
27
|
+
onFilterModelChange: onFilterModelChange
|
|
28
|
+
})) : null, pagination ? paginationMode == 'server' ? /*#__PURE__*/React__default.createElement(ServerSideControlledPagination, {
|
|
29
|
+
displaySelection: true,
|
|
30
|
+
displayRowsPerPage: false,
|
|
31
|
+
displayPagination: ['top', 'both'].includes(paginationPlacement),
|
|
32
|
+
selectionStatus: selectionStatus,
|
|
33
|
+
paginationModel: paginationModel,
|
|
34
|
+
onPaginationModelChange: onPaginationModelChange,
|
|
35
|
+
pageSizeOptions: pageSizeOptions,
|
|
36
|
+
paginationProps: paginationProps,
|
|
37
|
+
rowCount: rowCount
|
|
38
|
+
}) : /*#__PURE__*/React__default.createElement(ControlledPagination, {
|
|
39
|
+
displaySelection: true,
|
|
40
|
+
displayRowsPerPage: false,
|
|
41
|
+
displayPagination: ['top', 'both'].includes(paginationPlacement),
|
|
42
|
+
selectionStatus: selectionStatus,
|
|
43
|
+
apiRef: apiRef,
|
|
44
|
+
isRowSelectable: isRowSelectable,
|
|
45
|
+
paginationModel: paginationModel,
|
|
46
|
+
onPaginationModelChange: onPaginationModelChange,
|
|
47
|
+
pageSizeOptions: pageSizeOptions,
|
|
48
|
+
paginationProps: paginationProps
|
|
49
|
+
}) : null);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export { ToolbarWrapper as T };
|
|
53
|
+
//# sourceMappingURL=ToolbarWrapper2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolbarWrapper2.js","sources":["../../src/components/ToolbarWrapper/ToolbarWrapper.tsx"],"sourcesContent":["import React from 'react';\n\nimport { DataGridProps, SelectionStatus } from '../DataGrid/types';\nimport { ServerSideControlledPagination } from '../Pagination/ServerSideControlledPagination';\nimport { ControlledPagination } from '../Pagination/ControlledPagination';\n\nexport type ToolbarWrapperProps = {\n hideToolbar: DataGridProps['hideToolbar'];\n RenderedToolbar: React.JSXElementConstructor<any>;\n filterModel: DataGridProps['filterModel'];\n onFilterModelChange: DataGridProps['onFilterModelChange'];\n pagination: DataGridProps['pagination'];\n paginationPlacement: DataGridProps['paginationPlacement'];\n selectionStatus: SelectionStatus;\n apiRef: DataGridProps['apiRef'];\n isRowSelectable: DataGridProps['isRowSelectable'];\n paginationModel: DataGridProps['paginationModel'];\n onPaginationModelChange: DataGridProps['onPaginationModelChange'];\n pageSizeOptions: DataGridProps['pageSizeOptions'];\n paginationProps: DataGridProps['paginationProps'];\n paginationMode?: DataGridProps['paginationMode'];\n rowCount?: DataGridProps['rowCount'];\n};\n\nexport const ToolbarWrapper: React.FC<ToolbarWrapperProps> = ({\n hideToolbar,\n RenderedToolbar,\n filterModel,\n onFilterModelChange,\n pagination,\n paginationPlacement,\n selectionStatus,\n apiRef,\n isRowSelectable,\n paginationModel,\n onPaginationModelChange,\n pageSizeOptions,\n paginationProps,\n paginationMode = 'client',\n rowCount,\n ...forwardedProps\n}) => {\n return (\n <>\n {!hideToolbar ? (\n <RenderedToolbar {...forwardedProps} filterModel={filterModel} onFilterModelChange={onFilterModelChange} />\n ) : null}\n {pagination ? (\n paginationMode == 'server' ? (\n <ServerSideControlledPagination\n displaySelection={true}\n displayRowsPerPage={false}\n displayPagination={['top', 'both'].includes(paginationPlacement!)}\n selectionStatus={selectionStatus}\n paginationModel={paginationModel!}\n onPaginationModelChange={onPaginationModelChange as any}\n pageSizeOptions={pageSizeOptions as any as number[]}\n paginationProps={paginationProps}\n rowCount={rowCount!}\n />\n ) : (\n <ControlledPagination\n displaySelection={true}\n displayRowsPerPage={false}\n displayPagination={['top', 'both'].includes(paginationPlacement!)}\n selectionStatus={selectionStatus}\n apiRef={apiRef!}\n isRowSelectable={isRowSelectable}\n paginationModel={paginationModel!}\n onPaginationModelChange={onPaginationModelChange as any}\n pageSizeOptions={pageSizeOptions as any as number[]}\n paginationProps={paginationProps}\n />\n )\n ) : null}\n </>\n );\n};\n"],"names":["ToolbarWrapper","_ref","hideToolbar","RenderedToolbar","filterModel","onFilterModelChange","pagination","paginationPlacement","selectionStatus","apiRef","isRowSelectable","paginationModel","onPaginationModelChange","pageSizeOptions","paginationProps","paginationMode","rowCount","forwardedProps","_objectWithoutProperties","_excluded","React","createElement","Fragment","_extends","ServerSideControlledPagination","displaySelection","displayRowsPerPage","displayPagination","includes","ControlledPagination"],"mappings":";;;;;AAwBaA,MAAAA,cAA6C,GAAGC,IAAA,IAiBvD;EAAA,IAjBwD;MAC5DC,WAAW;MACXC,eAAe;MACfC,WAAW;MACXC,mBAAmB;MACnBC,UAAU;MACVC,mBAAmB;MACnBC,eAAe;MACfC,MAAM;MACNC,eAAe;MACfC,eAAe;MACfC,uBAAuB;MACvBC,eAAe;MACfC,eAAe;AACfC,MAAAA,cAAc,GAAG,QAAQ;AACzBC,MAAAA,QAAAA;AAEF,KAAC,GAAAf,IAAA;AADIgB,IAAAA,cAAc,GAAAC,wBAAA,CAAAjB,IAAA,EAAAkB,SAAA,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F,GACC,IACJ,CAAC,CAAA;AAEP;;;;"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
function ownKeys(object, enumerableOnly) {
|
|
2
|
+
var keys = Object.keys(object);
|
|
3
|
+
if (Object.getOwnPropertySymbols) {
|
|
4
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
5
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
6
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
7
|
+
})), keys.push.apply(keys, symbols);
|
|
8
|
+
}
|
|
9
|
+
return keys;
|
|
10
|
+
}
|
|
11
|
+
function _objectSpread2(target) {
|
|
12
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
13
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
14
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
15
|
+
_defineProperty(target, key, source[key]);
|
|
16
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
17
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return target;
|
|
21
|
+
}
|
|
22
|
+
function _defineProperty(obj, key, value) {
|
|
23
|
+
key = _toPropertyKey(key);
|
|
24
|
+
if (key in obj) {
|
|
25
|
+
Object.defineProperty(obj, key, {
|
|
26
|
+
value: value,
|
|
27
|
+
enumerable: true,
|
|
28
|
+
configurable: true,
|
|
29
|
+
writable: true
|
|
30
|
+
});
|
|
31
|
+
} else {
|
|
32
|
+
obj[key] = value;
|
|
33
|
+
}
|
|
34
|
+
return obj;
|
|
35
|
+
}
|
|
36
|
+
function _extends() {
|
|
37
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
38
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
39
|
+
var source = arguments[i];
|
|
40
|
+
for (var key in source) {
|
|
41
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
42
|
+
target[key] = source[key];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return target;
|
|
47
|
+
};
|
|
48
|
+
return _extends.apply(this, arguments);
|
|
49
|
+
}
|
|
50
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
51
|
+
if (source == null) return {};
|
|
52
|
+
var target = {};
|
|
53
|
+
var sourceKeys = Object.keys(source);
|
|
54
|
+
var key, i;
|
|
55
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
56
|
+
key = sourceKeys[i];
|
|
57
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
58
|
+
target[key] = source[key];
|
|
59
|
+
}
|
|
60
|
+
return target;
|
|
61
|
+
}
|
|
62
|
+
function _objectWithoutProperties(source, excluded) {
|
|
63
|
+
if (source == null) return {};
|
|
64
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
65
|
+
var key, i;
|
|
66
|
+
if (Object.getOwnPropertySymbols) {
|
|
67
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
68
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
69
|
+
key = sourceSymbolKeys[i];
|
|
70
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
71
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
72
|
+
target[key] = source[key];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return target;
|
|
76
|
+
}
|
|
77
|
+
function _toPrimitive(input, hint) {
|
|
78
|
+
if (typeof input !== "object" || input === null) return input;
|
|
79
|
+
var prim = input[Symbol.toPrimitive];
|
|
80
|
+
if (prim !== undefined) {
|
|
81
|
+
var res = prim.call(input, hint || "default");
|
|
82
|
+
if (typeof res !== "object") return res;
|
|
83
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
84
|
+
}
|
|
85
|
+
return (hint === "string" ? String : Number)(input);
|
|
86
|
+
}
|
|
87
|
+
function _toPropertyKey(arg) {
|
|
88
|
+
var key = _toPrimitive(arg, "string");
|
|
89
|
+
return typeof key === "symbol" ? key : String(key);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export { _objectSpread2 as _, _objectWithoutProperties as a, _extends as b };
|
|
93
|
+
//# sourceMappingURL=_rollupPluginBabelHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_rollupPluginBabelHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Component style.
|
|
6
|
+
*/
|
|
7
|
+
const StyledDataGrid = styled.div`
|
|
8
|
+
${_ref => {
|
|
9
|
+
let {
|
|
10
|
+
$height
|
|
11
|
+
} = _ref;
|
|
12
|
+
return $height ? css`
|
|
13
|
+
height: ${$height};
|
|
14
|
+
` : '';
|
|
15
|
+
}}
|
|
16
|
+
|
|
17
|
+
width: 100%;
|
|
18
|
+
|
|
19
|
+
.MuiDataGrid-root {
|
|
20
|
+
font-family: var(--redsift-typography-datagrid-header-font-family);
|
|
21
|
+
border: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.MuiDataGrid-row {
|
|
25
|
+
font-family: var(--redsift-typography-datagrid-cell-font-family);
|
|
26
|
+
font-size: var(--redsift-typography-datagrid-cell-font-size);
|
|
27
|
+
font-weight: var(--redsift-typography-datagrid-cell-font-weight);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.MuiDataGrid-columnHeaderTitle {
|
|
31
|
+
font-family: var(--redsift-typography-datagrid-header-font-family);
|
|
32
|
+
font-size: var(--redsift-typography-datagrid-header-font-size);
|
|
33
|
+
font-weight: var(--redsift-typography-datagrid-header-font-weight);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.MuiDataGrid-columnHeaders {
|
|
37
|
+
border-bottom-color: var(--redsift-color-primary-n);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.MuiDataGrid-columnSeparator {
|
|
41
|
+
display: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.MuiTablePagination-root {
|
|
45
|
+
.MuiTablePagination-selectLabel {
|
|
46
|
+
font-family: var(--redsift-typography-datagrid-header-font-family);
|
|
47
|
+
}
|
|
48
|
+
.MuiTablePagination-displayedRows {
|
|
49
|
+
font-family: var(--redsift-typography-datagrid-cell-font-family);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.MuiInputBase-root {
|
|
53
|
+
font-family: var(--redsift-typography-datagrid-cell-font-family);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.Mui-checked {
|
|
58
|
+
color: var(--redsift-color-primary-n);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.MuiDataGrid-rowCount {
|
|
62
|
+
font-family: var(--redsift-typography-datagrid-cell-font-family);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.MuiTablePagination-displayedRows {
|
|
66
|
+
font-family: var(--redsift-typography-datagrid-cell-font-family);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.MuiBadge-standard {
|
|
70
|
+
font-family: var(--redsift-typography-datagrid-cell-font-family);
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
|
|
74
|
+
const useControlledDatagridState = _ref => {
|
|
75
|
+
var _ref2, _ref3, _propsPaginationModel, _initialState$paginat, _initialState$paginat2, _pageSizeOptions$, _ref4, _propsPaginationModel2, _initialState$paginat3, _initialState$paginat4;
|
|
76
|
+
let {
|
|
77
|
+
initialState,
|
|
78
|
+
pageSizeOptions,
|
|
79
|
+
propsColumnVisibilityModel,
|
|
80
|
+
propsFilterModel,
|
|
81
|
+
propsOnColumnVisibilityModelChange,
|
|
82
|
+
propsOnFilterModelChange,
|
|
83
|
+
propsOnPaginationModelChange,
|
|
84
|
+
propsOnPinnedColumnsChange,
|
|
85
|
+
propsOnSortModelChange,
|
|
86
|
+
propsPaginationModel,
|
|
87
|
+
propsPinnedColumns,
|
|
88
|
+
propsSortModel
|
|
89
|
+
} = _ref;
|
|
90
|
+
// Internal state is a fallback for uncontrolled usage only.
|
|
91
|
+
const [internalFilterModel, setInternalFilterModel] = useState(propsFilterModel);
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
setInternalFilterModel(propsFilterModel);
|
|
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;
|
|
99
|
+
const onFilterModelChange = (model, details) => {
|
|
100
|
+
if (propsOnFilterModelChange) {
|
|
101
|
+
propsOnFilterModelChange(model, details);
|
|
102
|
+
} else {
|
|
103
|
+
setInternalFilterModel(model);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
const [columnVisibilityModel, setColumnVisibilityModel] = useState(propsColumnVisibilityModel);
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
setColumnVisibilityModel(propsColumnVisibilityModel);
|
|
109
|
+
}, [propsColumnVisibilityModel]);
|
|
110
|
+
const onColumnVisibilityModelChange = (model, details) => {
|
|
111
|
+
if (propsOnColumnVisibilityModelChange) {
|
|
112
|
+
propsOnColumnVisibilityModelChange(model, details);
|
|
113
|
+
} else {
|
|
114
|
+
setColumnVisibilityModel(model);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const [pinnedColumns, setPinnedColumns] = useState(propsPinnedColumns);
|
|
118
|
+
useEffect(() => {
|
|
119
|
+
setPinnedColumns(propsPinnedColumns);
|
|
120
|
+
}, [propsPinnedColumns]);
|
|
121
|
+
const onPinnedColumnsChange = (pinnedColumns, details) => {
|
|
122
|
+
if (propsOnPinnedColumnsChange) {
|
|
123
|
+
propsOnPinnedColumnsChange(pinnedColumns, details);
|
|
124
|
+
} else {
|
|
125
|
+
setPinnedColumns(pinnedColumns);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
const [sortModel, setSortModel] = useState(propsSortModel);
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
setSortModel(propsSortModel);
|
|
131
|
+
}, [propsSortModel]);
|
|
132
|
+
const onSortModelChange = (model, details) => {
|
|
133
|
+
if (propsOnSortModelChange) {
|
|
134
|
+
propsOnSortModelChange(model, details);
|
|
135
|
+
} else {
|
|
136
|
+
setSortModel(model);
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
const [paginationModel, setPaginationModel] = useState({
|
|
140
|
+
pageSize: (_ref2 = (_ref3 = (_propsPaginationModel = propsPaginationModel === null || propsPaginationModel === void 0 ? void 0 : propsPaginationModel.pageSize) !== null && _propsPaginationModel !== void 0 ? _propsPaginationModel : initialState === null || initialState === void 0 ? void 0 : (_initialState$paginat = initialState.pagination) === null || _initialState$paginat === void 0 ? void 0 : (_initialState$paginat2 = _initialState$paginat.paginationModel) === null || _initialState$paginat2 === void 0 ? void 0 : _initialState$paginat2.pageSize) !== null && _ref3 !== void 0 ? _ref3 : typeof (pageSizeOptions === null || pageSizeOptions === void 0 ? void 0 : pageSizeOptions[0]) === 'number' ? pageSizeOptions === null || pageSizeOptions === void 0 ? void 0 : pageSizeOptions[0] : pageSizeOptions === null || pageSizeOptions === void 0 ? void 0 : (_pageSizeOptions$ = pageSizeOptions[0]) === null || _pageSizeOptions$ === void 0 ? void 0 : _pageSizeOptions$.value) !== null && _ref2 !== void 0 ? _ref2 : 25,
|
|
141
|
+
page: (_ref4 = (_propsPaginationModel2 = propsPaginationModel === null || propsPaginationModel === void 0 ? void 0 : propsPaginationModel.page) !== null && _propsPaginationModel2 !== void 0 ? _propsPaginationModel2 : initialState === null || initialState === void 0 ? void 0 : (_initialState$paginat3 = initialState.pagination) === null || _initialState$paginat3 === void 0 ? void 0 : (_initialState$paginat4 = _initialState$paginat3.paginationModel) === null || _initialState$paginat4 === void 0 ? void 0 : _initialState$paginat4.page) !== null && _ref4 !== void 0 ? _ref4 : 0
|
|
142
|
+
});
|
|
143
|
+
const onPaginationModelChange = (model, details) => {
|
|
144
|
+
if (propsOnPaginationModelChange) {
|
|
145
|
+
propsOnPaginationModelChange(model, details);
|
|
146
|
+
} else {
|
|
147
|
+
setPaginationModel(model);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
useEffect(() => {
|
|
151
|
+
if (propsPaginationModel) {
|
|
152
|
+
setPaginationModel(propsPaginationModel);
|
|
153
|
+
}
|
|
154
|
+
}, [propsPaginationModel]);
|
|
155
|
+
return {
|
|
156
|
+
filterModel,
|
|
157
|
+
onFilterModelChange,
|
|
158
|
+
columnVisibilityModel,
|
|
159
|
+
onColumnVisibilityModelChange,
|
|
160
|
+
pinnedColumns,
|
|
161
|
+
onPinnedColumnsChange,
|
|
162
|
+
sortModel,
|
|
163
|
+
onSortModelChange,
|
|
164
|
+
paginationModel,
|
|
165
|
+
onPaginationModelChange
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export { StyledDataGrid as S, useControlledDatagridState as u };
|
|
170
|
+
//# sourceMappingURL=useControlledDatagridState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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-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 // 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,CAAC,GAAGC,QAAQ,CAACX,gBAAgB,CAAC,CAAA;AAChFY,EAAAA,SA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