@mui/x-data-grid 8.0.0-alpha.13 → 8.0.0-alpha.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/CHANGELOG.md +131 -0
  2. package/colDef/gridActionsColDef.js +1 -1
  3. package/colDef/gridBooleanColDef.js +1 -1
  4. package/colDef/gridCheckboxSelectionColDef.js +1 -1
  5. package/components/columnsManagement/GridColumnsManagement.js +1 -0
  6. package/components/columnsPanel/ColumnsPanelTrigger.d.ts +33 -0
  7. package/components/columnsPanel/ColumnsPanelTrigger.js +209 -0
  8. package/components/columnsPanel/index.d.ts +1 -0
  9. package/components/columnsPanel/index.js +16 -0
  10. package/components/export/ExportCsv.d.ts +30 -0
  11. package/components/export/ExportCsv.js +196 -0
  12. package/components/export/ExportPrint.d.ts +30 -0
  13. package/components/export/ExportPrint.js +196 -0
  14. package/components/export/index.d.ts +2 -0
  15. package/components/export/index.js +27 -0
  16. package/components/filterPanel/FilterPanelTrigger.d.ts +37 -0
  17. package/components/filterPanel/FilterPanelTrigger.js +212 -0
  18. package/components/filterPanel/index.d.ts +1 -0
  19. package/components/filterPanel/index.js +16 -0
  20. package/components/index.d.ts +6 -1
  21. package/components/index.js +60 -0
  22. package/components/quickFilter/QuickFilter.d.ts +41 -0
  23. package/components/quickFilter/QuickFilter.js +110 -0
  24. package/components/quickFilter/QuickFilterClear.d.ts +28 -0
  25. package/components/quickFilter/QuickFilterClear.js +161 -0
  26. package/components/quickFilter/QuickFilterContext.d.ts +13 -0
  27. package/components/quickFilter/QuickFilterContext.js +17 -0
  28. package/components/quickFilter/QuickFilterControl.d.ts +28 -0
  29. package/components/quickFilter/QuickFilterControl.js +104 -0
  30. package/components/quickFilter/index.d.ts +3 -0
  31. package/components/quickFilter/index.js +38 -0
  32. package/components/toolbar/GridToolbar.d.ts +1 -1
  33. package/components/toolbar/GridToolbar.js +2 -2
  34. package/components/toolbar/GridToolbarQuickFilter.js +54 -87
  35. package/components/toolbarV8/GridToolbar.d.ts +11 -0
  36. package/components/toolbarV8/GridToolbar.js +142 -0
  37. package/components/toolbarV8/Toolbar.d.ts +32 -0
  38. package/components/toolbarV8/Toolbar.js +132 -0
  39. package/components/toolbarV8/ToolbarButton.d.ts +23 -0
  40. package/components/toolbarV8/ToolbarButton.js +179 -0
  41. package/components/toolbarV8/ToolbarContext.d.ts +9 -0
  42. package/components/toolbarV8/ToolbarContext.js +17 -0
  43. package/components/toolbarV8/index.d.ts +2 -0
  44. package/components/toolbarV8/index.js +27 -0
  45. package/components/virtualization/GridVirtualScrollbar.js +7 -1
  46. package/constants/defaultGridSlotsComponents.js +2 -1
  47. package/constants/gridClasses.d.ts +4 -0
  48. package/esm/colDef/gridActionsColDef.js +1 -1
  49. package/esm/colDef/gridBooleanColDef.js +1 -1
  50. package/esm/colDef/gridCheckboxSelectionColDef.js +1 -1
  51. package/esm/components/columnsManagement/GridColumnsManagement.js +1 -0
  52. package/esm/components/columnsPanel/ColumnsPanelTrigger.d.ts +33 -0
  53. package/esm/components/columnsPanel/ColumnsPanelTrigger.js +202 -0
  54. package/esm/components/columnsPanel/index.d.ts +1 -0
  55. package/esm/components/columnsPanel/index.js +1 -0
  56. package/esm/components/export/ExportCsv.d.ts +30 -0
  57. package/esm/components/export/ExportCsv.js +189 -0
  58. package/esm/components/export/ExportPrint.d.ts +30 -0
  59. package/esm/components/export/ExportPrint.js +189 -0
  60. package/esm/components/export/index.d.ts +2 -0
  61. package/esm/components/export/index.js +2 -0
  62. package/esm/components/filterPanel/FilterPanelTrigger.d.ts +37 -0
  63. package/esm/components/filterPanel/FilterPanelTrigger.js +205 -0
  64. package/esm/components/filterPanel/index.d.ts +1 -0
  65. package/esm/components/filterPanel/index.js +1 -0
  66. package/esm/components/index.d.ts +6 -1
  67. package/esm/components/index.js +6 -1
  68. package/esm/components/quickFilter/QuickFilter.d.ts +41 -0
  69. package/esm/components/quickFilter/QuickFilter.js +103 -0
  70. package/esm/components/quickFilter/QuickFilterClear.d.ts +28 -0
  71. package/esm/components/quickFilter/QuickFilterClear.js +154 -0
  72. package/esm/components/quickFilter/QuickFilterContext.d.ts +13 -0
  73. package/esm/components/quickFilter/QuickFilterContext.js +9 -0
  74. package/esm/components/quickFilter/QuickFilterControl.d.ts +28 -0
  75. package/esm/components/quickFilter/QuickFilterControl.js +97 -0
  76. package/esm/components/quickFilter/index.d.ts +3 -0
  77. package/esm/components/quickFilter/index.js +3 -0
  78. package/esm/components/toolbar/GridToolbar.d.ts +1 -1
  79. package/esm/components/toolbar/GridToolbar.js +2 -2
  80. package/esm/components/toolbar/GridToolbarQuickFilter.js +56 -87
  81. package/esm/components/toolbarV8/GridToolbar.d.ts +11 -0
  82. package/esm/components/toolbarV8/GridToolbar.js +135 -0
  83. package/esm/components/toolbarV8/Toolbar.d.ts +32 -0
  84. package/esm/components/toolbarV8/Toolbar.js +125 -0
  85. package/esm/components/toolbarV8/ToolbarButton.d.ts +23 -0
  86. package/esm/components/toolbarV8/ToolbarButton.js +172 -0
  87. package/esm/components/toolbarV8/ToolbarContext.d.ts +9 -0
  88. package/esm/components/toolbarV8/ToolbarContext.js +9 -0
  89. package/esm/components/toolbarV8/index.d.ts +2 -0
  90. package/esm/components/toolbarV8/index.js +2 -0
  91. package/esm/components/virtualization/GridVirtualScrollbar.js +7 -1
  92. package/esm/constants/defaultGridSlotsComponents.js +2 -1
  93. package/esm/constants/gridClasses.d.ts +4 -0
  94. package/esm/hooks/features/rows/useGridRowsMeta.js +8 -0
  95. package/esm/hooks/features/virtualization/useGridVirtualScroller.d.ts +0 -2
  96. package/esm/hooks/features/virtualization/useGridVirtualScroller.js +0 -2
  97. package/esm/hooks/utils/index.d.ts +2 -1
  98. package/esm/hooks/utils/useGridComponentRenderer.d.ts +12 -0
  99. package/esm/hooks/utils/useGridComponentRenderer.js +36 -0
  100. package/esm/index.js +1 -1
  101. package/esm/internals/demo/TailwindDemoContainer.d.ts +11 -0
  102. package/esm/internals/demo/TailwindDemoContainer.js +55 -0
  103. package/esm/internals/demo/index.d.ts +1 -0
  104. package/esm/internals/demo/index.js +1 -0
  105. package/esm/internals/index.d.ts +4 -0
  106. package/esm/internals/index.js +3 -0
  107. package/esm/material/icons/index.d.ts +3 -3
  108. package/esm/material/icons/index.js +6 -6
  109. package/esm/material/index.js +3 -3
  110. package/esm/models/gridBaseSlots.d.ts +5 -1
  111. package/esm/models/gridIconSlotsComponent.d.ts +1 -1
  112. package/esm/models/gridSlotsComponent.d.ts +1 -2
  113. package/hooks/features/rows/useGridRowsMeta.js +8 -0
  114. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +0 -2
  115. package/hooks/features/virtualization/useGridVirtualScroller.js +0 -2
  116. package/hooks/utils/index.d.ts +2 -1
  117. package/hooks/utils/useGridComponentRenderer.d.ts +12 -0
  118. package/hooks/utils/useGridComponentRenderer.js +44 -0
  119. package/index.js +1 -1
  120. package/internals/demo/TailwindDemoContainer.d.ts +11 -0
  121. package/internals/demo/TailwindDemoContainer.js +63 -0
  122. package/internals/demo/index.d.ts +1 -0
  123. package/internals/demo/index.js +12 -0
  124. package/internals/index.d.ts +4 -0
  125. package/internals/index.js +28 -0
  126. package/material/icons/index.d.ts +3 -3
  127. package/material/icons/index.js +7 -7
  128. package/material/index.js +2 -2
  129. package/models/gridBaseSlots.d.ts +5 -1
  130. package/models/gridIconSlotsComponent.d.ts +1 -1
  131. package/models/gridSlotsComponent.d.ts +1 -2
  132. package/modern/colDef/gridActionsColDef.js +1 -1
  133. package/modern/colDef/gridBooleanColDef.js +1 -1
  134. package/modern/colDef/gridCheckboxSelectionColDef.js +1 -1
  135. package/modern/components/columnsManagement/GridColumnsManagement.js +1 -0
  136. package/modern/components/columnsPanel/ColumnsPanelTrigger.d.ts +33 -0
  137. package/modern/components/columnsPanel/ColumnsPanelTrigger.js +202 -0
  138. package/modern/components/columnsPanel/index.d.ts +1 -0
  139. package/modern/components/columnsPanel/index.js +1 -0
  140. package/modern/components/export/ExportCsv.d.ts +30 -0
  141. package/modern/components/export/ExportCsv.js +189 -0
  142. package/modern/components/export/ExportPrint.d.ts +30 -0
  143. package/modern/components/export/ExportPrint.js +189 -0
  144. package/modern/components/export/index.d.ts +2 -0
  145. package/modern/components/export/index.js +2 -0
  146. package/modern/components/filterPanel/FilterPanelTrigger.d.ts +37 -0
  147. package/modern/components/filterPanel/FilterPanelTrigger.js +205 -0
  148. package/modern/components/filterPanel/index.d.ts +1 -0
  149. package/modern/components/filterPanel/index.js +1 -0
  150. package/modern/components/index.d.ts +6 -1
  151. package/modern/components/index.js +6 -1
  152. package/modern/components/quickFilter/QuickFilter.d.ts +41 -0
  153. package/modern/components/quickFilter/QuickFilter.js +103 -0
  154. package/modern/components/quickFilter/QuickFilterClear.d.ts +28 -0
  155. package/modern/components/quickFilter/QuickFilterClear.js +154 -0
  156. package/modern/components/quickFilter/QuickFilterContext.d.ts +13 -0
  157. package/modern/components/quickFilter/QuickFilterContext.js +9 -0
  158. package/modern/components/quickFilter/QuickFilterControl.d.ts +28 -0
  159. package/modern/components/quickFilter/QuickFilterControl.js +97 -0
  160. package/modern/components/quickFilter/index.d.ts +3 -0
  161. package/modern/components/quickFilter/index.js +3 -0
  162. package/modern/components/toolbar/GridToolbar.d.ts +1 -1
  163. package/modern/components/toolbar/GridToolbar.js +2 -2
  164. package/modern/components/toolbar/GridToolbarQuickFilter.js +56 -87
  165. package/modern/components/toolbarV8/GridToolbar.d.ts +11 -0
  166. package/modern/components/toolbarV8/GridToolbar.js +135 -0
  167. package/modern/components/toolbarV8/Toolbar.d.ts +32 -0
  168. package/modern/components/toolbarV8/Toolbar.js +125 -0
  169. package/modern/components/toolbarV8/ToolbarButton.d.ts +23 -0
  170. package/modern/components/toolbarV8/ToolbarButton.js +172 -0
  171. package/modern/components/toolbarV8/ToolbarContext.d.ts +9 -0
  172. package/modern/components/toolbarV8/ToolbarContext.js +9 -0
  173. package/modern/components/toolbarV8/index.d.ts +2 -0
  174. package/modern/components/toolbarV8/index.js +2 -0
  175. package/modern/components/virtualization/GridVirtualScrollbar.js +7 -1
  176. package/modern/constants/defaultGridSlotsComponents.js +2 -1
  177. package/modern/constants/gridClasses.d.ts +4 -0
  178. package/modern/hooks/features/rows/useGridRowsMeta.js +8 -0
  179. package/modern/hooks/features/virtualization/useGridVirtualScroller.d.ts +0 -2
  180. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +0 -2
  181. package/modern/hooks/utils/index.d.ts +2 -1
  182. package/modern/hooks/utils/useGridComponentRenderer.d.ts +12 -0
  183. package/modern/hooks/utils/useGridComponentRenderer.js +36 -0
  184. package/modern/index.js +1 -1
  185. package/modern/internals/demo/TailwindDemoContainer.d.ts +11 -0
  186. package/modern/internals/demo/TailwindDemoContainer.js +55 -0
  187. package/modern/internals/demo/index.d.ts +1 -0
  188. package/modern/internals/demo/index.js +1 -0
  189. package/modern/internals/index.d.ts +4 -0
  190. package/modern/internals/index.js +3 -0
  191. package/modern/material/icons/index.d.ts +3 -3
  192. package/modern/material/icons/index.js +6 -6
  193. package/modern/material/index.js +3 -3
  194. package/modern/models/gridBaseSlots.d.ts +5 -1
  195. package/modern/models/gridIconSlotsComponent.d.ts +1 -1
  196. package/modern/models/gridSlotsComponent.d.ts +1 -2
  197. package/package.json +1 -1
  198. package/tsconfig.build.tsbuildinfo +1 -1
@@ -0,0 +1,189 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ const _excluded = ["render", "options", "onClick"];
4
+ import * as React from 'react';
5
+ import PropTypes from 'prop-types';
6
+ import { forwardRef } from '@mui/x-internals/forwardRef';
7
+ import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
8
+ import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
9
+ import { useGridComponentRenderer } from "../../hooks/utils/useGridComponentRenderer.js";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ /**
12
+ * A button that triggers a CSV export.
13
+ * It renders the `baseButton` slot.
14
+ *
15
+ * Demos:
16
+ *
17
+ * - [Export](https://mui.com/x/react-data-grid/components/export/)
18
+ *
19
+ * API:
20
+ *
21
+ * - [ExportCsv API](https://mui.com/x/api/data-grid/export-csv/)
22
+ */
23
+ const ExportCsv = forwardRef(function ExportCsv(props, ref) {
24
+ const {
25
+ render,
26
+ options,
27
+ onClick
28
+ } = props,
29
+ other = _objectWithoutPropertiesLoose(props, _excluded);
30
+ const rootProps = useGridRootProps();
31
+ const apiRef = useGridApiContext();
32
+ const handleClick = event => {
33
+ apiRef.current.exportDataAsCsv(options);
34
+ onClick?.(event);
35
+ };
36
+ const element = useGridComponentRenderer(rootProps.slots.baseButton, render, _extends({}, rootProps.slotProps?.baseButton, {
37
+ onClick: handleClick
38
+ }, other, {
39
+ ref
40
+ }));
41
+ return /*#__PURE__*/_jsx(React.Fragment, {
42
+ children: element
43
+ });
44
+ });
45
+ process.env.NODE_ENV !== "production" ? ExportCsv.propTypes = {
46
+ // ----------------------------- Warning --------------------------------
47
+ // | These PropTypes are generated from the TypeScript type definitions |
48
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
49
+ // ----------------------------------------------------------------------
50
+ /**
51
+ * A ref for imperative actions.
52
+ * It currently only supports `focusVisible()` action.
53
+ */
54
+ action: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
55
+ current: PropTypes.shape({
56
+ focusVisible: PropTypes.func.isRequired
57
+ })
58
+ })]),
59
+ /**
60
+ * If `true`, the ripples are centered.
61
+ * They won't start at the cursor interaction position.
62
+ * @default false
63
+ */
64
+ centerRipple: PropTypes.bool,
65
+ className: PropTypes.string,
66
+ /**
67
+ * The color of the component.
68
+ * It supports both default and custom theme colors, which can be added as shown in the
69
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
70
+ * @default 'primary'
71
+ */
72
+ color: PropTypes.oneOf(['error', 'info', 'inherit', 'primary', 'secondary', 'success', 'warning']),
73
+ component: PropTypes.elementType,
74
+ /**
75
+ * If `true`, the component is disabled.
76
+ */
77
+ disabled: PropTypes.bool,
78
+ /**
79
+ * If `true`, no elevation is used.
80
+ * @default false
81
+ */
82
+ disableElevation: PropTypes.bool,
83
+ /**
84
+ * If `true`, the keyboard focus ripple is disabled.
85
+ * @default false
86
+ */
87
+ disableFocusRipple: PropTypes.bool,
88
+ /**
89
+ * If `true`, the ripple effect is disabled.
90
+ *
91
+ * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
92
+ * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
93
+ * @default false
94
+ */
95
+ disableRipple: PropTypes.bool,
96
+ /**
97
+ * If `true`, the touch ripple effect is disabled.
98
+ * @default false
99
+ */
100
+ disableTouchRipple: PropTypes.bool,
101
+ /**
102
+ * Element placed after the children.
103
+ */
104
+ endIcon: PropTypes.node,
105
+ /**
106
+ * If `true`, the base button will have a keyboard focus ripple.
107
+ * @default false
108
+ */
109
+ focusRipple: PropTypes.bool,
110
+ /**
111
+ * This prop can help identify which element has keyboard focus.
112
+ * The class name will be applied when the element gains the focus through keyboard interaction.
113
+ * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
114
+ * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
115
+ * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
116
+ * if needed.
117
+ */
118
+ focusVisibleClassName: PropTypes.string,
119
+ /**
120
+ * If `true`, the button will take up the full width of its container.
121
+ * @default false
122
+ */
123
+ fullWidth: PropTypes.bool,
124
+ /**
125
+ * The URL to link to when the button is clicked.
126
+ * If defined, an `a` element will be used as the root node.
127
+ */
128
+ href: PropTypes.string,
129
+ /**
130
+ * The component used to render a link when the `href` prop is provided.
131
+ * @default 'a'
132
+ */
133
+ LinkComponent: PropTypes.elementType,
134
+ /**
135
+ * Callback fired when the component is focused with a keyboard.
136
+ * We trigger a `onFocus` callback too.
137
+ */
138
+ onFocusVisible: PropTypes.func,
139
+ /**
140
+ * The options to apply on the CSV export.
141
+ * @demos
142
+ * - [CSV export](/x/react-data-grid/export/#csv-export)
143
+ */
144
+ options: PropTypes.shape({
145
+ allColumns: PropTypes.bool,
146
+ delimiter: PropTypes.string,
147
+ escapeFormulas: PropTypes.bool,
148
+ fields: PropTypes.arrayOf(PropTypes.string),
149
+ fileName: PropTypes.string,
150
+ getRowsToExport: PropTypes.func,
151
+ includeColumnGroupsHeaders: PropTypes.bool,
152
+ includeHeaders: PropTypes.bool,
153
+ shouldAppendQuotes: PropTypes.bool,
154
+ utf8WithBom: PropTypes.bool
155
+ }),
156
+ /**
157
+ * A function to customize rendering of the component.
158
+ */
159
+ render: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
160
+ /**
161
+ * The size of the component.
162
+ * `small` is equivalent to the dense button styling.
163
+ */
164
+ size: PropTypes.oneOf(['large', 'medium', 'small']),
165
+ /**
166
+ * Element placed before the children.
167
+ */
168
+ startIcon: PropTypes.node,
169
+ style: PropTypes.object,
170
+ /**
171
+ * The system prop that allows defining system overrides as well as additional CSS styles.
172
+ */
173
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
174
+ tabIndex: PropTypes.number,
175
+ /**
176
+ * Props applied to the `TouchRipple` element.
177
+ */
178
+ TouchRippleProps: PropTypes.object,
179
+ /**
180
+ * A ref that points to the `TouchRipple` element.
181
+ */
182
+ touchRippleRef: PropTypes.any,
183
+ /**
184
+ * The variant to use.
185
+ * @default 'text'
186
+ */
187
+ variant: PropTypes.oneOf(['contained', 'outlined', 'text'])
188
+ } : void 0;
189
+ export { ExportCsv };
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ import { RenderProp } from "../../hooks/utils/useGridComponentRenderer.js";
3
+ import { GridPrintExportOptions } from "../../models/gridExport.js";
4
+ import type { GridSlotProps } from '../../models';
5
+ export type ExportPrintProps = GridSlotProps['baseButton'] & {
6
+ /**
7
+ * A function to customize rendering of the component.
8
+ */
9
+ render?: RenderProp<GridSlotProps['baseButton']>;
10
+ /**
11
+ * The options to apply on the Print export.
12
+ * @demos
13
+ * - [Print export](/x/react-data-grid/export/#print-export)
14
+ */
15
+ options?: GridPrintExportOptions;
16
+ };
17
+ /**
18
+ * A button that triggers a print export.
19
+ * It renders the `baseButton` slot.
20
+ *
21
+ * Demos:
22
+ *
23
+ * - [Export](https://mui.com/x/react-data-grid/components/export/)
24
+ *
25
+ * API:
26
+ *
27
+ * - [ExportPrint API](https://mui.com/x/api/data-grid/export-print/)
28
+ */
29
+ declare const ExportPrint: React.ForwardRefExoticComponent<ExportPrintProps> | React.ForwardRefExoticComponent<Omit<ExportPrintProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
30
+ export { ExportPrint };
@@ -0,0 +1,189 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ const _excluded = ["render", "options", "onClick"];
4
+ import * as React from 'react';
5
+ import PropTypes from 'prop-types';
6
+ import { forwardRef } from '@mui/x-internals/forwardRef';
7
+ import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
8
+ import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
9
+ import { useGridComponentRenderer } from "../../hooks/utils/useGridComponentRenderer.js";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ /**
12
+ * A button that triggers a print export.
13
+ * It renders the `baseButton` slot.
14
+ *
15
+ * Demos:
16
+ *
17
+ * - [Export](https://mui.com/x/react-data-grid/components/export/)
18
+ *
19
+ * API:
20
+ *
21
+ * - [ExportPrint API](https://mui.com/x/api/data-grid/export-print/)
22
+ */
23
+ const ExportPrint = forwardRef(function ExportPrint(props, ref) {
24
+ const {
25
+ render,
26
+ options,
27
+ onClick
28
+ } = props,
29
+ other = _objectWithoutPropertiesLoose(props, _excluded);
30
+ const rootProps = useGridRootProps();
31
+ const apiRef = useGridApiContext();
32
+ const handleClick = event => {
33
+ apiRef.current.exportDataAsPrint(options);
34
+ onClick?.(event);
35
+ };
36
+ const element = useGridComponentRenderer(rootProps.slots.baseButton, render, _extends({}, rootProps.slotProps?.baseButton, {
37
+ onClick: handleClick
38
+ }, other, {
39
+ ref
40
+ }));
41
+ return /*#__PURE__*/_jsx(React.Fragment, {
42
+ children: element
43
+ });
44
+ });
45
+ process.env.NODE_ENV !== "production" ? ExportPrint.propTypes = {
46
+ // ----------------------------- Warning --------------------------------
47
+ // | These PropTypes are generated from the TypeScript type definitions |
48
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
49
+ // ----------------------------------------------------------------------
50
+ /**
51
+ * A ref for imperative actions.
52
+ * It currently only supports `focusVisible()` action.
53
+ */
54
+ action: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
55
+ current: PropTypes.shape({
56
+ focusVisible: PropTypes.func.isRequired
57
+ })
58
+ })]),
59
+ /**
60
+ * If `true`, the ripples are centered.
61
+ * They won't start at the cursor interaction position.
62
+ * @default false
63
+ */
64
+ centerRipple: PropTypes.bool,
65
+ className: PropTypes.string,
66
+ /**
67
+ * The color of the component.
68
+ * It supports both default and custom theme colors, which can be added as shown in the
69
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
70
+ * @default 'primary'
71
+ */
72
+ color: PropTypes.oneOf(['error', 'info', 'inherit', 'primary', 'secondary', 'success', 'warning']),
73
+ component: PropTypes.elementType,
74
+ /**
75
+ * If `true`, the component is disabled.
76
+ */
77
+ disabled: PropTypes.bool,
78
+ /**
79
+ * If `true`, no elevation is used.
80
+ * @default false
81
+ */
82
+ disableElevation: PropTypes.bool,
83
+ /**
84
+ * If `true`, the keyboard focus ripple is disabled.
85
+ * @default false
86
+ */
87
+ disableFocusRipple: PropTypes.bool,
88
+ /**
89
+ * If `true`, the ripple effect is disabled.
90
+ *
91
+ * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
92
+ * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
93
+ * @default false
94
+ */
95
+ disableRipple: PropTypes.bool,
96
+ /**
97
+ * If `true`, the touch ripple effect is disabled.
98
+ * @default false
99
+ */
100
+ disableTouchRipple: PropTypes.bool,
101
+ /**
102
+ * Element placed after the children.
103
+ */
104
+ endIcon: PropTypes.node,
105
+ /**
106
+ * If `true`, the base button will have a keyboard focus ripple.
107
+ * @default false
108
+ */
109
+ focusRipple: PropTypes.bool,
110
+ /**
111
+ * This prop can help identify which element has keyboard focus.
112
+ * The class name will be applied when the element gains the focus through keyboard interaction.
113
+ * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
114
+ * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
115
+ * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
116
+ * if needed.
117
+ */
118
+ focusVisibleClassName: PropTypes.string,
119
+ /**
120
+ * If `true`, the button will take up the full width of its container.
121
+ * @default false
122
+ */
123
+ fullWidth: PropTypes.bool,
124
+ /**
125
+ * The URL to link to when the button is clicked.
126
+ * If defined, an `a` element will be used as the root node.
127
+ */
128
+ href: PropTypes.string,
129
+ /**
130
+ * The component used to render a link when the `href` prop is provided.
131
+ * @default 'a'
132
+ */
133
+ LinkComponent: PropTypes.elementType,
134
+ /**
135
+ * Callback fired when the component is focused with a keyboard.
136
+ * We trigger a `onFocus` callback too.
137
+ */
138
+ onFocusVisible: PropTypes.func,
139
+ /**
140
+ * The options to apply on the Print export.
141
+ * @demos
142
+ * - [Print export](/x/react-data-grid/export/#print-export)
143
+ */
144
+ options: PropTypes.shape({
145
+ allColumns: PropTypes.bool,
146
+ bodyClassName: PropTypes.string,
147
+ copyStyles: PropTypes.bool,
148
+ fields: PropTypes.arrayOf(PropTypes.string),
149
+ fileName: PropTypes.string,
150
+ getRowsToExport: PropTypes.func,
151
+ hideFooter: PropTypes.bool,
152
+ hideToolbar: PropTypes.bool,
153
+ includeCheckboxes: PropTypes.bool,
154
+ pageStyle: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
155
+ }),
156
+ /**
157
+ * A function to customize rendering of the component.
158
+ */
159
+ render: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
160
+ /**
161
+ * The size of the component.
162
+ * `small` is equivalent to the dense button styling.
163
+ */
164
+ size: PropTypes.oneOf(['large', 'medium', 'small']),
165
+ /**
166
+ * Element placed before the children.
167
+ */
168
+ startIcon: PropTypes.node,
169
+ style: PropTypes.object,
170
+ /**
171
+ * The system prop that allows defining system overrides as well as additional CSS styles.
172
+ */
173
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
174
+ tabIndex: PropTypes.number,
175
+ /**
176
+ * Props applied to the `TouchRipple` element.
177
+ */
178
+ TouchRippleProps: PropTypes.object,
179
+ /**
180
+ * A ref that points to the `TouchRipple` element.
181
+ */
182
+ touchRippleRef: PropTypes.any,
183
+ /**
184
+ * The variant to use.
185
+ * @default 'text'
186
+ */
187
+ variant: PropTypes.oneOf(['contained', 'outlined', 'text'])
188
+ } : void 0;
189
+ export { ExportPrint };
@@ -0,0 +1,2 @@
1
+ export * from "./ExportCsv.js";
2
+ export * from "./ExportPrint.js";
@@ -0,0 +1,2 @@
1
+ export * from "./ExportCsv.js";
2
+ export * from "./ExportPrint.js";
@@ -0,0 +1,37 @@
1
+ import * as React from 'react';
2
+ import { RenderProp } from "../../hooks/utils/useGridComponentRenderer.js";
3
+ import type { GridSlotProps } from '../../models';
4
+ export interface FilterPanelState {
5
+ /**
6
+ * If `true`, the filter panel is open.
7
+ */
8
+ open: boolean;
9
+ /**
10
+ * The number of active filters.
11
+ */
12
+ filterCount: number;
13
+ }
14
+ export type FilterPanelTriggerProps = Omit<GridSlotProps['baseButton'], 'className'> & {
15
+ /**
16
+ * A function to customize rendering of the component.
17
+ */
18
+ render?: RenderProp<GridSlotProps['baseButton'], FilterPanelState>;
19
+ /**
20
+ * A function to customize rendering of the component.
21
+ */
22
+ className?: string | ((state: FilterPanelState) => string);
23
+ };
24
+ /**
25
+ * A button that opens and closes the filter panel.
26
+ * It renders the `baseButton` slot.
27
+ *
28
+ * Demos:
29
+ *
30
+ * - [Filter Panel](https://mui.com/x/react-data-grid/components/filter-panel/)
31
+ *
32
+ * API:
33
+ *
34
+ * - [FilterPanelTrigger API](https://mui.com/x/api/data-grid/filter-panel-trigger/)
35
+ */
36
+ declare const FilterPanelTrigger: React.ForwardRefExoticComponent<FilterPanelTriggerProps> | React.ForwardRefExoticComponent<Omit<FilterPanelTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
37
+ export { FilterPanelTrigger };
@@ -0,0 +1,205 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ const _excluded = ["render", "className", "onClick", "onPointerUp"];
4
+ import * as React from 'react';
5
+ import PropTypes from 'prop-types';
6
+ import useId from '@mui/utils/useId';
7
+ import { forwardRef } from '@mui/x-internals/forwardRef';
8
+ import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
9
+ import { gridFilterActiveItemsSelector, gridPreferencePanelStateSelector, GridPreferencePanelsValue, useGridSelector } from "../../hooks/index.js";
10
+ import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
11
+ import { useGridComponentRenderer } from "../../hooks/utils/useGridComponentRenderer.js";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ /**
14
+ * A button that opens and closes the filter panel.
15
+ * It renders the `baseButton` slot.
16
+ *
17
+ * Demos:
18
+ *
19
+ * - [Filter Panel](https://mui.com/x/react-data-grid/components/filter-panel/)
20
+ *
21
+ * API:
22
+ *
23
+ * - [FilterPanelTrigger API](https://mui.com/x/api/data-grid/filter-panel-trigger/)
24
+ */
25
+ const FilterPanelTrigger = forwardRef(function FilterPanelTrigger(props, ref) {
26
+ const {
27
+ render,
28
+ className,
29
+ onClick,
30
+ onPointerUp
31
+ } = props,
32
+ other = _objectWithoutPropertiesLoose(props, _excluded);
33
+ const rootProps = useGridRootProps();
34
+ const buttonId = useId();
35
+ const panelId = useId();
36
+ const apiRef = useGridApiContext();
37
+ const panelState = useGridSelector(apiRef, gridPreferencePanelStateSelector);
38
+ const open = panelState.open && panelState.openedPanelValue === GridPreferencePanelsValue.filters;
39
+ const activeFilters = useGridSelector(apiRef, gridFilterActiveItemsSelector);
40
+ const filterCount = activeFilters.length;
41
+ const state = {
42
+ open,
43
+ filterCount
44
+ };
45
+ const resolvedClassName = typeof className === 'function' ? className(state) : className;
46
+ const handleClick = event => {
47
+ if (open) {
48
+ apiRef.current.hidePreferences();
49
+ } else {
50
+ apiRef.current.showPreferences(GridPreferencePanelsValue.filters, panelId, buttonId);
51
+ }
52
+ onClick?.(event);
53
+ };
54
+ const handlePointerUp = event => {
55
+ if (open) {
56
+ event.stopPropagation();
57
+ }
58
+ onPointerUp?.(event);
59
+ };
60
+ const element = useGridComponentRenderer(rootProps.slots.baseButton, render, _extends({}, rootProps.slotProps?.baseButton, {
61
+ id: buttonId,
62
+ 'aria-haspopup': 'true',
63
+ 'aria-expanded': open ? 'true' : undefined,
64
+ 'aria-controls': open ? panelId : undefined,
65
+ onClick: handleClick,
66
+ onPointerUp: handlePointerUp,
67
+ className: resolvedClassName
68
+ }, other, {
69
+ ref
70
+ }), state);
71
+ return /*#__PURE__*/_jsx(React.Fragment, {
72
+ children: element
73
+ });
74
+ });
75
+ process.env.NODE_ENV !== "production" ? FilterPanelTrigger.propTypes = {
76
+ // ----------------------------- Warning --------------------------------
77
+ // | These PropTypes are generated from the TypeScript type definitions |
78
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
79
+ // ----------------------------------------------------------------------
80
+ /**
81
+ * A ref for imperative actions.
82
+ * It currently only supports `focusVisible()` action.
83
+ */
84
+ action: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
85
+ current: PropTypes.shape({
86
+ focusVisible: PropTypes.func.isRequired
87
+ })
88
+ })]),
89
+ /**
90
+ * If `true`, the ripples are centered.
91
+ * They won't start at the cursor interaction position.
92
+ * @default false
93
+ */
94
+ centerRipple: PropTypes.bool,
95
+ /**
96
+ * A function to customize rendering of the component.
97
+ */
98
+ className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
99
+ /**
100
+ * The color of the component.
101
+ * It supports both default and custom theme colors, which can be added as shown in the
102
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
103
+ * @default 'primary'
104
+ */
105
+ color: PropTypes.oneOf(['error', 'info', 'inherit', 'primary', 'secondary', 'success', 'warning']),
106
+ component: PropTypes.elementType,
107
+ /**
108
+ * If `true`, the component is disabled.
109
+ */
110
+ disabled: PropTypes.bool,
111
+ /**
112
+ * If `true`, no elevation is used.
113
+ * @default false
114
+ */
115
+ disableElevation: PropTypes.bool,
116
+ /**
117
+ * If `true`, the keyboard focus ripple is disabled.
118
+ * @default false
119
+ */
120
+ disableFocusRipple: PropTypes.bool,
121
+ /**
122
+ * If `true`, the ripple effect is disabled.
123
+ *
124
+ * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
125
+ * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
126
+ * @default false
127
+ */
128
+ disableRipple: PropTypes.bool,
129
+ /**
130
+ * If `true`, the touch ripple effect is disabled.
131
+ * @default false
132
+ */
133
+ disableTouchRipple: PropTypes.bool,
134
+ /**
135
+ * Element placed after the children.
136
+ */
137
+ endIcon: PropTypes.node,
138
+ /**
139
+ * If `true`, the base button will have a keyboard focus ripple.
140
+ * @default false
141
+ */
142
+ focusRipple: PropTypes.bool,
143
+ /**
144
+ * This prop can help identify which element has keyboard focus.
145
+ * The class name will be applied when the element gains the focus through keyboard interaction.
146
+ * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
147
+ * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
148
+ * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
149
+ * if needed.
150
+ */
151
+ focusVisibleClassName: PropTypes.string,
152
+ /**
153
+ * If `true`, the button will take up the full width of its container.
154
+ * @default false
155
+ */
156
+ fullWidth: PropTypes.bool,
157
+ /**
158
+ * The URL to link to when the button is clicked.
159
+ * If defined, an `a` element will be used as the root node.
160
+ */
161
+ href: PropTypes.string,
162
+ /**
163
+ * The component used to render a link when the `href` prop is provided.
164
+ * @default 'a'
165
+ */
166
+ LinkComponent: PropTypes.elementType,
167
+ /**
168
+ * Callback fired when the component is focused with a keyboard.
169
+ * We trigger a `onFocus` callback too.
170
+ */
171
+ onFocusVisible: PropTypes.func,
172
+ /**
173
+ * A function to customize rendering of the component.
174
+ */
175
+ render: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
176
+ /**
177
+ * The size of the component.
178
+ * `small` is equivalent to the dense button styling.
179
+ */
180
+ size: PropTypes.oneOf(['large', 'medium', 'small']),
181
+ /**
182
+ * Element placed before the children.
183
+ */
184
+ startIcon: PropTypes.node,
185
+ style: PropTypes.object,
186
+ /**
187
+ * The system prop that allows defining system overrides as well as additional CSS styles.
188
+ */
189
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
190
+ tabIndex: PropTypes.number,
191
+ /**
192
+ * Props applied to the `TouchRipple` element.
193
+ */
194
+ TouchRippleProps: PropTypes.object,
195
+ /**
196
+ * A ref that points to the `TouchRipple` element.
197
+ */
198
+ touchRippleRef: PropTypes.any,
199
+ /**
200
+ * The variant to use.
201
+ * @default 'text'
202
+ */
203
+ variant: PropTypes.oneOf(['contained', 'outlined', 'text'])
204
+ } : void 0;
205
+ export { FilterPanelTrigger };
@@ -0,0 +1 @@
1
+ export * from "./FilterPanelTrigger.js";
@@ -0,0 +1 @@
1
+ export * from "./FilterPanelTrigger.js";
@@ -17,4 +17,9 @@ export * from "./GridNoColumnsOverlay.js";
17
17
  export { GridPagination } from "./GridPagination.js";
18
18
  export * from "./GridRowCount.js";
19
19
  export * from "./GridRow.js";
20
- export * from "./GridSelectedRowCount.js";
20
+ export * from "./GridSelectedRowCount.js";
21
+ export * from "./columnsPanel/index.js";
22
+ export * from "./export/index.js";
23
+ export * from "./filterPanel/index.js";
24
+ export * from "./toolbarV8/index.js";
25
+ export * from "./quickFilter/index.js";
@@ -17,4 +17,9 @@ export * from "./GridNoColumnsOverlay.js";
17
17
  export { GridPagination } from "./GridPagination.js";
18
18
  export * from "./GridRowCount.js";
19
19
  export * from "./GridRow.js";
20
- export * from "./GridSelectedRowCount.js";
20
+ export * from "./GridSelectedRowCount.js";
21
+ export * from "./columnsPanel/index.js";
22
+ export * from "./export/index.js";
23
+ export * from "./filterPanel/index.js";
24
+ export * from "./toolbarV8/index.js";
25
+ export * from "./quickFilter/index.js";