@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,202 @@
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 { 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 columns panel.
15
+ * It renders the `baseButton` slot.
16
+ *
17
+ * Demos:
18
+ *
19
+ * - [Columns Panel](https://mui.com/x/react-data-grid/components/columns-panel/)
20
+ *
21
+ * API:
22
+ *
23
+ * - [ColumnsPanelTrigger API](https://mui.com/x/api/data-grid/columns-panel-trigger/)
24
+ */
25
+ const ColumnsPanelTrigger = forwardRef(function ColumnsPanelTrigger(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.columns;
39
+ const state = {
40
+ open
41
+ };
42
+ const resolvedClassName = typeof className === 'function' ? className(state) : className;
43
+ const handleClick = event => {
44
+ if (open) {
45
+ apiRef.current.hidePreferences();
46
+ } else {
47
+ apiRef.current.showPreferences(GridPreferencePanelsValue.columns, panelId, buttonId);
48
+ }
49
+ onClick?.(event);
50
+ };
51
+ const handlePointerUp = event => {
52
+ if (open) {
53
+ event.stopPropagation();
54
+ }
55
+ onPointerUp?.(event);
56
+ };
57
+ const element = useGridComponentRenderer(rootProps.slots.baseButton, render, _extends({}, rootProps.slotProps?.baseButton, {
58
+ id: buttonId,
59
+ 'aria-haspopup': 'true',
60
+ 'aria-expanded': open ? 'true' : undefined,
61
+ 'aria-controls': open ? panelId : undefined,
62
+ onClick: handleClick,
63
+ onPointerUp: handlePointerUp,
64
+ className: resolvedClassName
65
+ }, other, {
66
+ ref
67
+ }), state);
68
+ return /*#__PURE__*/_jsx(React.Fragment, {
69
+ children: element
70
+ });
71
+ });
72
+ process.env.NODE_ENV !== "production" ? ColumnsPanelTrigger.propTypes = {
73
+ // ----------------------------- Warning --------------------------------
74
+ // | These PropTypes are generated from the TypeScript type definitions |
75
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
76
+ // ----------------------------------------------------------------------
77
+ /**
78
+ * A ref for imperative actions.
79
+ * It currently only supports `focusVisible()` action.
80
+ */
81
+ action: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
82
+ current: PropTypes.shape({
83
+ focusVisible: PropTypes.func.isRequired
84
+ })
85
+ })]),
86
+ /**
87
+ * If `true`, the ripples are centered.
88
+ * They won't start at the cursor interaction position.
89
+ * @default false
90
+ */
91
+ centerRipple: PropTypes.bool,
92
+ /**
93
+ * Override or extend the styles applied to the component.
94
+ */
95
+ className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
96
+ /**
97
+ * The color of the component.
98
+ * It supports both default and custom theme colors, which can be added as shown in the
99
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
100
+ * @default 'primary'
101
+ */
102
+ color: PropTypes.oneOf(['error', 'info', 'inherit', 'primary', 'secondary', 'success', 'warning']),
103
+ component: PropTypes.elementType,
104
+ /**
105
+ * If `true`, the component is disabled.
106
+ */
107
+ disabled: PropTypes.bool,
108
+ /**
109
+ * If `true`, no elevation is used.
110
+ * @default false
111
+ */
112
+ disableElevation: PropTypes.bool,
113
+ /**
114
+ * If `true`, the keyboard focus ripple is disabled.
115
+ * @default false
116
+ */
117
+ disableFocusRipple: PropTypes.bool,
118
+ /**
119
+ * If `true`, the ripple effect is disabled.
120
+ *
121
+ * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
122
+ * to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
123
+ * @default false
124
+ */
125
+ disableRipple: PropTypes.bool,
126
+ /**
127
+ * If `true`, the touch ripple effect is disabled.
128
+ * @default false
129
+ */
130
+ disableTouchRipple: PropTypes.bool,
131
+ /**
132
+ * Element placed after the children.
133
+ */
134
+ endIcon: PropTypes.node,
135
+ /**
136
+ * If `true`, the base button will have a keyboard focus ripple.
137
+ * @default false
138
+ */
139
+ focusRipple: PropTypes.bool,
140
+ /**
141
+ * This prop can help identify which element has keyboard focus.
142
+ * The class name will be applied when the element gains the focus through keyboard interaction.
143
+ * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
144
+ * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
145
+ * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
146
+ * if needed.
147
+ */
148
+ focusVisibleClassName: PropTypes.string,
149
+ /**
150
+ * If `true`, the button will take up the full width of its container.
151
+ * @default false
152
+ */
153
+ fullWidth: PropTypes.bool,
154
+ /**
155
+ * The URL to link to when the button is clicked.
156
+ * If defined, an `a` element will be used as the root node.
157
+ */
158
+ href: PropTypes.string,
159
+ /**
160
+ * The component used to render a link when the `href` prop is provided.
161
+ * @default 'a'
162
+ */
163
+ LinkComponent: PropTypes.elementType,
164
+ /**
165
+ * Callback fired when the component is focused with a keyboard.
166
+ * We trigger a `onFocus` callback too.
167
+ */
168
+ onFocusVisible: PropTypes.func,
169
+ /**
170
+ * A function to customize rendering of the component.
171
+ */
172
+ render: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
173
+ /**
174
+ * The size of the component.
175
+ * `small` is equivalent to the dense button styling.
176
+ */
177
+ size: PropTypes.oneOf(['large', 'medium', 'small']),
178
+ /**
179
+ * Element placed before the children.
180
+ */
181
+ startIcon: PropTypes.node,
182
+ style: PropTypes.object,
183
+ /**
184
+ * The system prop that allows defining system overrides as well as additional CSS styles.
185
+ */
186
+ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
187
+ tabIndex: PropTypes.number,
188
+ /**
189
+ * Props applied to the `TouchRipple` element.
190
+ */
191
+ TouchRippleProps: PropTypes.object,
192
+ /**
193
+ * A ref that points to the `TouchRipple` element.
194
+ */
195
+ touchRippleRef: PropTypes.any,
196
+ /**
197
+ * The variant to use.
198
+ * @default 'text'
199
+ */
200
+ variant: PropTypes.oneOf(['contained', 'outlined', 'text'])
201
+ } : void 0;
202
+ export { ColumnsPanelTrigger };
@@ -0,0 +1 @@
1
+ export * from "./ColumnsPanelTrigger.js";
@@ -0,0 +1 @@
1
+ export * from "./ColumnsPanelTrigger.js";
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ import { RenderProp } from "../../hooks/utils/useGridComponentRenderer.js";
3
+ import { GridCsvExportOptions } from "../../models/gridExport.js";
4
+ import type { GridSlotProps } from '../../models';
5
+ export type ExportCsvProps = 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 CSV export.
12
+ * @demos
13
+ * - [CSV export](/x/react-data-grid/export/#csv-export)
14
+ */
15
+ options?: GridCsvExportOptions;
16
+ };
17
+ /**
18
+ * A button that triggers a CSV 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
+ * - [ExportCsv API](https://mui.com/x/api/data-grid/export-csv/)
28
+ */
29
+ declare const ExportCsv: React.ForwardRefExoticComponent<ExportCsvProps> | React.ForwardRefExoticComponent<Omit<ExportCsvProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
30
+ export { ExportCsv };
@@ -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 };