@redsift/table 11.5.0-muiv5 → 11.6.0-alpha.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.
Files changed (46) hide show
  1. package/_internal/BaseComponents.js +3 -0
  2. package/_internal/BaseComponents.js.map +1 -0
  3. package/_internal/BasePopper.js +2448 -0
  4. package/_internal/BasePopper.js.map +1 -0
  5. package/_internal/BaseTextField.js +26 -0
  6. package/_internal/BaseTextField.js.map +1 -0
  7. package/_internal/ControlledPagination.js +10492 -0
  8. package/_internal/ControlledPagination.js.map +1 -0
  9. package/_internal/DataGrid.js +2 -0
  10. package/_internal/DataGrid.js.map +1 -0
  11. package/_internal/DataGrid2.js +316 -0
  12. package/_internal/DataGrid2.js.map +1 -0
  13. package/_internal/GridToolbarFilterSemanticField.js +2 -0
  14. package/_internal/GridToolbarFilterSemanticField.js.map +1 -0
  15. package/_internal/GridToolbarFilterSemanticField2.js +5581 -0
  16. package/_internal/GridToolbarFilterSemanticField2.js.map +1 -0
  17. package/_internal/Pagination.js +2 -0
  18. package/_internal/Pagination.js.map +1 -0
  19. package/_internal/Portal.js +4363 -0
  20. package/_internal/Portal.js.map +1 -0
  21. package/_internal/StatefulDataGrid.js +2 -0
  22. package/_internal/StatefulDataGrid.js.map +1 -0
  23. package/_internal/StatefulDataGrid2.js +3088 -0
  24. package/_internal/StatefulDataGrid2.js.map +1 -0
  25. package/_internal/TextCell.js +2 -0
  26. package/_internal/TextCell.js.map +1 -0
  27. package/_internal/TextCell2.js +66 -0
  28. package/_internal/TextCell2.js.map +1 -0
  29. package/_internal/Toolbar.js +2 -0
  30. package/_internal/Toolbar.js.map +1 -0
  31. package/_internal/Toolbar2.js +85 -0
  32. package/_internal/Toolbar2.js.map +1 -0
  33. package/_internal/ToolbarWrapper.js +2 -0
  34. package/_internal/ToolbarWrapper.js.map +1 -0
  35. package/_internal/ToolbarWrapper2.js +53 -0
  36. package/_internal/ToolbarWrapper2.js.map +1 -0
  37. package/_internal/_rollupPluginBabelHelpers.js +93 -0
  38. package/_internal/_rollupPluginBabelHelpers.js.map +1 -0
  39. package/_internal/jsx-runtime.js +1342 -0
  40. package/_internal/jsx-runtime.js.map +1 -0
  41. package/_internal/useControlledDatagridState.js +368 -0
  42. package/_internal/useControlledDatagridState.js.map +1 -0
  43. package/index.d.ts +54 -54
  44. package/index.js +37 -28350
  45. package/index.js.map +1 -1
  46. package/package.json +6 -6
@@ -0,0 +1,2 @@
1
+ export { T as TextCell } from './TextCell2.js';
2
+ //# sourceMappingURL=TextCell.js.map
@@ -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;AACA;AACA;AACA;AACA;AACA,CAAC;;;ACXD,MAAME,cAAc,GAAG,cAAc,CAAA;AACrC,MAAMC,SAAS,GAAG,uBAAuB,CAAA;;AAEzC;AACA;AACA;AACO,MAAMC,QAA6C,gBAAGC,UAAU,CACrE,CAACC,KAAK,EAAEC,GAAG,KAAK;AACd,EAAA,MAAMC,WAAW,GAAGD,GAAG,IAAIE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AAGT,SAAS,CAAA;AAC9BC,QAAQ,CAAC4B,WAAW,GAAG9B,cAAc;;;;"}
@@ -0,0 +1,2 @@
1
+ export { T as Toolbar } from './Toolbar2.js';
2
+ //# sourceMappingURL=Toolbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Toolbar.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,85 @@
1
+ import { b as _extends } 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
+ const {
30
+ hasExportButton = true,
31
+ exportButtonProps,
32
+ exportButtonRef,
33
+ hasFilterButton = true,
34
+ filterButtonProps,
35
+ filterButtonRef,
36
+ hasColumnsButton = true,
37
+ columnsButtonProps,
38
+ columnsButtonRef,
39
+ hasDensityButton = true,
40
+ densityButtonProps,
41
+ densityButtonRef,
42
+ onFilterModelChange,
43
+ semanticFilterProps = undefined,
44
+ showQuickFilter
45
+ } = props;
46
+ if (semanticFilterProps && onFilterModelChange) {
47
+ semanticFilterProps.onFilterModelChange = onFilterModelChange;
48
+ }
49
+ return /*#__PURE__*/React__default.createElement(GridToolbarWrapper, null, /*#__PURE__*/React__default.createElement(GridToolbarContainer, null, /*#__PURE__*/React__default.createElement(Flexbox, {
50
+ gap: "0"
51
+ }, hasFilterButton ? /*#__PURE__*/React__default.createElement(GridToolbarFilterButton, _extends({}, filterButtonProps, {
52
+ 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
+ })) : null, hasColumnsButton ? /*#__PURE__*/React__default.createElement(GridToolbarColumnsButton, _extends({}, columnsButtonProps, {
55
+ ref: columnsButtonRef,
56
+ className: filterButtonProps !== null && filterButtonProps !== void 0 && filterButtonProps.className ? `${filterButtonProps === null || filterButtonProps === void 0 ? void 0 : filterButtonProps.className} redsift-condensed` : 'redsift-condensed'
57
+ })) : null, hasDensityButton ? /*#__PURE__*/React__default.createElement(GridToolbarDensitySelector, _extends({}, densityButtonProps, {
58
+ ref: densityButtonRef,
59
+ className: filterButtonProps !== null && filterButtonProps !== void 0 && filterButtonProps.className ? `${filterButtonProps === null || filterButtonProps === void 0 ? void 0 : filterButtonProps.className} redsift-condensed` : 'redsift-condensed'
60
+ })) : null, hasExportButton ? /*#__PURE__*/React__default.createElement(GridToolbarExport, _extends({
61
+ csvOptions: {
62
+ allColumns: true,
63
+ fileName: 'csv',
64
+ getRowsToExport: _ref => {
65
+ let {
66
+ apiRef
67
+ } = _ref;
68
+ return gridExpandedSortedRowIdsSelector(apiRef);
69
+ }
70
+ },
71
+ printOptions: {
72
+ disableToolbarButton: true
73
+ }
74
+ }, exportButtonProps, {
75
+ ref: exportButtonRef,
76
+ className: filterButtonProps !== null && filterButtonProps !== void 0 && filterButtonProps.className ? `${filterButtonProps === null || filterButtonProps === void 0 ? void 0 : filterButtonProps.className} redsift-condensed` : 'redsift-condensed'
77
+ })) : null, /*#__PURE__*/React__default.createElement(Flexbox, {
78
+ marginLeft: "8px"
79
+ }, showQuickFilter ? /*#__PURE__*/React__default.createElement(GridToolbarQuickFilter, null) : null)), /*#__PURE__*/React__default.createElement(Flexbox, {
80
+ flexGrow: 3
81
+ }, semanticFilterProps ? /*#__PURE__*/React__default.createElement(GridToolbarFilterSemanticField, semanticFilterProps) : null)));
82
+ };
83
+
84
+ export { Toolbar as T };
85
+ //# 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 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,aAAA,CAACI,uBAAuB,EAAAC,QAAA,CAAA,EAAA,EAClBlB,iBAAiB,EAAA;AACrBmB,IAAAA,GAAG,EAAEl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AE;AACVC,MAAAA,UAAU,EAAE,IAAI;AAChBC,MAAAA,QAAQ,EAAE,KAAK;AACfC,MAAAA,eAAe,EAAEC,IAAA,IAAA;QAAA,IAAC;AAAEC,UAAAA,MAAAA;AAAqC,SAAC,GAAAD,IAAA,CAAA;QAAA,OAAKE,gCAAgC,CAACD,MAAM,CAAC,CAAA;AAAA,OAAA;KACvG;AACFE,IAAAA,YAAY,EAAE;AACZC,MAAAA,oBAAoB,EAAE,IAAA;AACxB,KAAA;AAAE,GAAA,EACEnC,iBAAiB,EAAA;AACrBsB,IAAAA,GAAG,EAAErB,eAAgB;AACrBsB,IAAAA,SAAS,EACPpB,iBAAiB,KAAA,IAAA,IAAjBA,iBAAiB,KAAjBA,KAAAA,CAAAA,IAAAA,iBAAiB,CAAEoB,SAAS,GAAI,CAAEpB,EAAAA,iBAAiB,aAAjBA,iBAAiB,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAjBA,iBAAiB,CAAEoB,SAAU,oBAAmB,GAAG,mBAAA;GAExF,CAAA,CAAC,GACA,IAAI,eACRR,cAAA,CAAAC,aAAA,CAACE,OAAO,EAAA;AAACkB,IAAAA,UAAU,EAAC,KAAA;AAAK,GAAA,EAAEtB,eAAe,gBAAGC,cAAA,CAAAC,aAAA,CAACqB,sBAAsB,EAAE,IAAA,CAAC,GAAG,IAAc,CACjF,CAAC,eACVtB,cAAA,CAAAC,aAAA,CAACE,OAAO,EAAA;AAACoB,IAAAA,QAAQ,EAAE,CAAA;AAAE,GAAA,EAClB1B,mBAAmB,gBAAGG,cAAA,CAAAC,aAAA,CAACuB,8BAA8B,EAAK3B,mBAAsB,CAAC,GAAG,IAC9E,CACW,CACJ,CAAC,CAAA;AAEzB;;;;"}
@@ -0,0 +1,2 @@
1
+ export { T as ToolbarWrapper } from './ToolbarWrapper2.js';
2
+ //# sourceMappingURL=ToolbarWrapper.js.map
@@ -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 './ControlledPagination.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.current,
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.current,
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: React.MutableRefObject<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.current}\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.current}\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","current","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,CAAA,CAAA;AAEjB,EAAA,oBACEC,cAAA,CAAAC,aAAA,CAAAD,cAAA,CAAAE,QAAA,EACG,IAAA,EAAA,CAACpB,WAAW,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.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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}