neue Homepage auf react basis

This commit is contained in:
2026-08-07 21:39:30 +02:00
parent 164bdd19ad
commit ee89442c04
52191 changed files with 1230242 additions and 58 deletions
File diff suppressed because it is too large Load Diff
+16
View File
@@ -0,0 +1,16 @@
import * as React from 'react';
import type { DataGridProps } from "../models/props/DataGridProps.mjs";
import type { GridValidRowModel } from "../models/gridRows.mjs";
export type { GridSlotsComponent as GridSlots } from "../models/index.mjs";
interface DataGridComponent {
<R extends GridValidRowModel = any>(props: DataGridProps<R> & React.RefAttributes<HTMLDivElement>): React.JSX.Element;
propTypes?: any;
}
/**
* Features:
* - [DataGrid](https://mui.com/x/react-data-grid/features/)
*
* API:
* - [DataGrid API](https://mui.com/x/api/data-grid/data-grid/)
*/
export declare const DataGrid: DataGridComponent;
+16
View File
@@ -0,0 +1,16 @@
import * as React from 'react';
import type { DataGridProps } from "../models/props/DataGridProps.js";
import type { GridValidRowModel } from "../models/gridRows.js";
export type { GridSlotsComponent as GridSlots } from "../models/index.js";
interface DataGridComponent {
<R extends GridValidRowModel = any>(props: DataGridProps<R> & React.RefAttributes<HTMLDivElement>): React.JSX.Element;
propTypes?: any;
}
/**
* Features:
* - [DataGrid](https://mui.com/x/react-data-grid/features/)
*
* API:
* - [DataGrid API](https://mui.com/x/api/data-grid/data-grid/)
*/
export declare const DataGrid: DataGridComponent;
+901
View File
@@ -0,0 +1,901 @@
"use strict";
'use client';
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DataGrid = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var React = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _forwardRef = require("@mui/x-internals/forwardRef");
var _components = require("../components");
var _useGridAriaAttributes = require("../hooks/utils/useGridAriaAttributes");
var _useGridRowAriaAttributes = require("../hooks/features/rows/useGridRowAriaAttributes");
var _useGridRowsOverridableMethods = require("../hooks/features/rows/useGridRowsOverridableMethods");
var _useGridParamsOverridableMethods = require("../hooks/features/rows/useGridParamsOverridableMethods");
var _useGridCellEditable = require("../hooks/features/editing/useGridCellEditable");
var _GridContextProvider = require("../context/GridContextProvider");
var _useDataGridComponent = require("./useDataGridComponent");
var _useDataGridProps = require("./useDataGridProps");
var _propValidation = require("../internals/utils/propValidation");
var _variables = require("../material/variables");
var _useGridApiInitialization = require("../hooks/core/useGridApiInitialization");
var _jsxRuntime = require("react/jsx-runtime");
const configuration = {
hooks: {
useCSSVariables: _variables.useMaterialCSSVariables,
useGridAriaAttributes: _useGridAriaAttributes.useGridAriaAttributes,
useGridRowAriaAttributes: _useGridRowAriaAttributes.useGridRowAriaAttributes,
useGridRowsOverridableMethods: _useGridRowsOverridableMethods.useGridRowsOverridableMethods,
useGridParamsOverridableMethods: _useGridParamsOverridableMethods.useGridParamsOverridableMethods,
useIsCellEditable: _useGridCellEditable.useIsCellEditable,
useCellAggregationResult: () => null,
useFilterValueGetter: apiRef => apiRef.current.getRowValue
}
};
const DataGridRaw = function DataGrid(inProps, ref) {
const props = (0, _useDataGridProps.useDataGridProps)(inProps);
const privateApiRef = (0, _useGridApiInitialization.useGridApiInitialization)(props.apiRef, props);
(0, _useDataGridComponent.useDataGridComponent)(privateApiRef, props, configuration);
if (process.env.NODE_ENV !== 'production') {
(0, _propValidation.validateProps)(props, _propValidation.propValidatorsDataGrid);
}
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridContextProvider.GridContextProvider, {
privateApiRef: privateApiRef,
configuration: configuration,
props: props,
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.GridRoot, (0, _extends2.default)({
className: props.className,
style: props.style,
sx: props.sx
}, props.slotProps?.root, {
ref: ref
}))
});
};
if (process.env.NODE_ENV !== "production") DataGridRaw.displayName = "DataGridRaw";
/**
* Features:
* - [DataGrid](https://mui.com/x/react-data-grid/features/)
*
* API:
* - [DataGrid API](https://mui.com/x/api/data-grid/data-grid/)
*/
const DataGrid = exports.DataGrid = /*#__PURE__*/React.memo((0, _forwardRef.forwardRef)(DataGridRaw));
if (process.env.NODE_ENV !== "production") DataGrid.displayName = "DataGrid";
process.env.NODE_ENV !== "production" ? DataGridRaw.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "pnpm proptypes" |
// ----------------------------------------------------------------------
/**
* The ref object that allows Data Grid manipulation. Can be instantiated with `useGridApiRef()`.
*/
apiRef: _propTypes.default.shape({
current: _propTypes.default.object
}),
/**
* The `aria-label` of the Data Grid.
*/
'aria-label': _propTypes.default.string,
/**
* The `id` of the element containing a label for the Data Grid.
*/
'aria-labelledby': _propTypes.default.string,
/**
* If `true`, the Data Grid height is dynamic and takes as much space as it needs to display all rows.
* Use it instead of a flex parent container approach, if:
* - you don't need to set a minimum or maximum height for the Data Grid
* - you want to avoid the scrollbar flickering when the content changes
* @default false
*/
autoHeight: _propTypes.default.bool,
/**
* If `true`, the pageSize is calculated according to the container size and the max number of rows to avoid rendering a vertical scroll bar.
* @default false
*/
autoPageSize: _propTypes.default.bool,
/**
* If `true`, columns are autosized after the datagrid is mounted.
* @default false
*/
autosizeOnMount: _propTypes.default.bool,
/**
* The options for autosize when user-initiated.
*/
autosizeOptions: _propTypes.default.shape({
columns: _propTypes.default.arrayOf(_propTypes.default.string),
disableColumnVirtualization: _propTypes.default.bool,
expand: _propTypes.default.bool,
includeHeaderFilters: _propTypes.default.bool,
includeHeaders: _propTypes.default.bool,
includeOutliers: _propTypes.default.bool,
outliersFactor: _propTypes.default.number
}),
/**
* Controls the modes of the cells.
*/
cellModesModel: _propTypes.default.object,
/**
* Definition of the column rendered when the `checkboxSelection` prop is enabled.
*
* @warning
* Be careful when overriding `renderHeader` or `renderCell` in the `checkboxColDef` prop.
* The default implementation of these properties includes the logic for selecting all rows and selecting a single row, respectively.
* Overriding them without providing the same functionality will break the row selection.
*/
checkboxColDef: _propTypes.default.shape({
align: _propTypes.default.oneOf(['center', 'left', 'right']),
cellClassName: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
colSpan: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.number]),
description: _propTypes.default.string,
disableColumnMenu: _propTypes.default.bool,
disableExport: _propTypes.default.bool,
disableReorder: _propTypes.default.bool,
display: _propTypes.default.oneOf(['flex', 'text']),
editable: _propTypes.default.bool,
examples: _propTypes.default.array,
filterable: _propTypes.default.bool,
filterOperators: _propTypes.default.arrayOf(_propTypes.default.shape({
getApplyFilterFn: _propTypes.default.func.isRequired,
getValueAsString: _propTypes.default.func,
headerLabel: _propTypes.default.string,
InputComponent: _propTypes.default.elementType,
InputComponentProps: _propTypes.default.object,
label: _propTypes.default.string,
requiresFilterValue: _propTypes.default.bool,
value: _propTypes.default.string.isRequired
})),
flex: _propTypes.default.number,
getApplyQuickFilterFn: _propTypes.default.func,
getSortComparator: _propTypes.default.func,
groupable: _propTypes.default.bool,
headerAlign: _propTypes.default.oneOf(['center', 'left', 'right']),
headerClassName: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
headerName: _propTypes.default.string,
hideable: _propTypes.default.bool,
hideSortIcons: _propTypes.default.bool,
maxWidth: _propTypes.default.number,
minWidth: _propTypes.default.number,
pinnable: _propTypes.default.bool,
preProcessEditCellProps: _propTypes.default.func,
renderCell: _propTypes.default.func,
renderEditCell: _propTypes.default.func,
renderHeader: _propTypes.default.func,
resizable: _propTypes.default.bool,
rowSpanValueGetter: _propTypes.default.func,
sortable: _propTypes.default.bool,
sortComparator: _propTypes.default.func,
sortingOrder: _propTypes.default.arrayOf(_propTypes.default.oneOf(['asc', 'desc'])),
valueFormatter: _propTypes.default.func,
valueGetter: _propTypes.default.func,
valueParser: _propTypes.default.func,
valueSetter: _propTypes.default.func,
width: _propTypes.default.number
}),
/**
* If `true`, the Data Grid will display an extra column with checkboxes for selecting rows.
* @default false
*/
checkboxSelection: _propTypes.default.bool,
/**
* Override or extend the styles applied to the component.
*/
classes: _propTypes.default.object,
className: _propTypes.default.string,
/**
* The character used to separate cell values when copying to the clipboard.
* @default '\t'
*/
clipboardCopyCellDelimiter: _propTypes.default.string,
/**
* Column region in pixels to render before/after the viewport
* @default 150
*/
columnBufferPx: _propTypes.default.number,
/**
* The milliseconds delay to wait after a keystroke before triggering filtering in the columns menu.
* @default 150
*/
columnFilterDebounceMs: _propTypes.default.number,
/**
* Sets the height in pixels of the column group headers in the Data Grid.
* Inherits the `columnHeaderHeight` value if not set.
*/
columnGroupHeaderHeight: _propTypes.default.number,
columnGroupingModel: _propTypes.default.arrayOf(_propTypes.default.object),
/**
* Sets the height in pixel of the column headers in the Data Grid.
* @default 56
*/
columnHeaderHeight: _propTypes.default.number,
/**
* Set of columns of type [[GridColDef]][].
*/
columns: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
/**
* Set the column visibility model of the Data Grid.
* If defined, the Data Grid will ignore the `hide` property in [[GridColDef]].
*/
columnVisibilityModel: _propTypes.default.object,
/**
* The data source object.
*/
dataSource: _propTypes.default.shape({
getRows: _propTypes.default.func.isRequired,
updateRow: _propTypes.default.func
}),
/**
* Data source cache object.
*/
dataSourceCache: _propTypes.default.shape({
clear: _propTypes.default.func.isRequired,
get: _propTypes.default.func.isRequired,
set: _propTypes.default.func.isRequired
}),
/**
* If `true`, the previously displayed rows are kept visible while new rows are being fetched after pagination, sorting, or filtering changes.
* The loading overlay is rendered on top of the previous rows.
* Only applies to flat data; tree data and row grouping always reset the rows on refetch to keep the order consistent with the new response.
* @default false
*/
dataSourceKeepPreviousData: _propTypes.default.bool,
/**
* If positive, the Data Grid will periodically revalidate data source rows by re-fetching them from the server when the cache entry has expired.
* If the refetched rows are different from the current rows, the grid will update the rows.
* Set to `0` to disable polling.
* @default 0
*/
dataSourceRevalidateMs: _propTypes.default.number,
/**
* Set the density of the Data Grid.
* @default "standard"
*/
density: _propTypes.default.oneOf(['comfortable', 'compact', 'standard']),
/**
* If `true`, column autosizing on header separator double-click is disabled.
* @default false
*/
disableAutosize: _propTypes.default.bool,
/**
* If `true`, column filters are disabled.
* @default false
*/
disableColumnFilter: _propTypes.default.bool,
/**
* If `true`, the column menu is disabled.
* @default false
*/
disableColumnMenu: _propTypes.default.bool,
/**
* If `true`, resizing columns is disabled.
* @default false
*/
disableColumnResize: _propTypes.default.bool,
/**
* If `true`, hiding/showing columns is disabled.
* @default false
*/
disableColumnSelector: _propTypes.default.bool,
/**
* If `true`, the column sorting feature will be disabled.
* @default false
*/
disableColumnSorting: _propTypes.default.bool,
/**
* If `true`, the density selector is disabled.
* @default false
*/
disableDensitySelector: _propTypes.default.bool,
/**
* If `true`, `eval()` is not used for performance optimization.
* @default false
*/
disableEval: _propTypes.default.bool,
/**
* If `true`, multiple selection using the Ctrl/CMD or Shift key is disabled.
* The MIT DataGrid will ignore this prop, unless `checkboxSelection` is enabled.
* @default false (`!props.checkboxSelection` for MIT Data Grid)
*/
disableMultipleRowSelection: _propTypes.default.bool,
/**
* If `true`, the Data Grid will not use the exclude model optimization when selecting all rows.
* @default false
*/
disableRowSelectionExcludeModel: _propTypes.default.bool,
/**
* If `true`, the selection on click on a row or cell is disabled.
* @default false
*/
disableRowSelectionOnClick: _propTypes.default.bool,
/**
* If `true`, the virtualization is disabled.
* @default false
*/
disableVirtualization: _propTypes.default.bool,
/**
* Controls whether to use the cell or row editing.
* @default "cell"
*/
editMode: _propTypes.default.oneOf(['cell', 'row']),
/**
* Use if the actual rowCount is not known upfront, but an estimation is available.
* If some rows have children (for instance in the tree data), this number represents the amount of top level rows.
* Applicable only with `paginationMode="server"` and when `rowCount="-1"`
*/
estimatedRowCount: _propTypes.default.number,
/**
* Unstable features, breaking changes might be introduced.
* For each feature, if the flag is not explicitly set to `true`, the feature will be fully disabled and any property / method call will not have any effect.
*/
experimentalFeatures: _propTypes.default.shape({
virtualizerLayoutMode: _propTypes.default.oneOf(['controlled', 'uncontrolled']),
warnIfFocusStateIsNotSynced: _propTypes.default.bool
}),
/**
* The milliseconds delay to wait after a keystroke before triggering filtering.
* @default 150
*/
filterDebounceMs: _propTypes.default.number,
/**
* Filtering can be processed on the server or client-side.
* Set it to 'server' if you would like to handle filtering on the server-side.
* @default "client"
*/
filterMode: _propTypes.default.oneOf(['client', 'server']),
/**
* Set the filter model of the Data Grid.
*/
filterModel: _propTypes.default.shape({
items: _propTypes.default.arrayOf(_propTypes.default.shape({
field: _propTypes.default.string.isRequired,
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
operator: _propTypes.default.string.isRequired,
value: _propTypes.default.any
})).isRequired,
logicOperator: _propTypes.default.oneOf(['and', 'or']),
quickFilterExcludeHiddenColumns: _propTypes.default.bool,
quickFilterLogicOperator: _propTypes.default.oneOf(['and', 'or']),
quickFilterValues: _propTypes.default.array
}),
/**
* Function that applies CSS classes dynamically on cells.
* @param {GridCellParams} params With all properties from [[GridCellParams]].
* @returns {string} The CSS class to apply to the cell.
*/
getCellClassName: _propTypes.default.func,
/**
* Function that returns the element to render in row detail.
* @param {GridRowParams} params With all properties from [[GridRowParams]].
* @returns {React.JSX.Element} The row detail element.
*/
getDetailPanelContent: _propTypes.default.func,
/**
* Function that returns the estimated height for a row.
* Only works if dynamic row height is used.
* Once the row height is measured this value is discarded.
* @param {GridRowHeightParams} params With all properties from [[GridRowHeightParams]].
* @returns {number | null} The estimated row height value. If `null` or `undefined` then the default row height, based on the density, is applied.
*/
getEstimatedRowHeight: _propTypes.default.func,
/**
* Function that applies CSS classes dynamically on rows.
* @param {GridRowClassNameParams} params With all properties from [[GridRowClassNameParams]].
* @returns {string} The CSS class to apply to the row.
*/
getRowClassName: _propTypes.default.func,
/**
* Function that sets the row height per row.
* @param {GridRowHeightParams} params With all properties from [[GridRowHeightParams]].
* @returns {GridRowHeightReturnValue} The row height value. If `null` or `undefined` then the default row height is applied. If "auto" then the row height is calculated based on the content.
*/
getRowHeight: _propTypes.default.func,
/**
* Return the id of a given [[GridRowModel]].
* Ensure the reference of this prop is stable to avoid performance implications.
* It could be done by either defining the prop outside of the component or by memoizing it.
*/
getRowId: _propTypes.default.func,
/**
* Function that allows to specify the spacing between rows.
* @param {GridRowSpacingParams} params With all properties from [[GridRowSpacingParams]].
* @returns {GridRowSpacing} The row spacing values.
*/
getRowSpacing: _propTypes.default.func,
/**
* If `true`, the footer component is hidden.
* @default false
*/
hideFooter: _propTypes.default.bool,
/**
* If `true`, the pagination component in the footer is hidden.
* @default false
*/
hideFooterPagination: _propTypes.default.bool,
/**
* If `true`, the selected row count in the footer is hidden.
* @default false
*/
hideFooterSelectedRowCount: _propTypes.default.bool,
/**
* If `true`, the diacritics (accents) are ignored when filtering or quick filtering.
* E.g. when filter value is `cafe`, the rows with `café` will be visible.
* @default false
*/
ignoreDiacritics: _propTypes.default.bool,
/**
* If `true`, the Data Grid will not use `valueFormatter` when exporting to CSV or copying to clipboard.
* If an object is provided, you can choose to ignore the `valueFormatter` for CSV export or clipboard export.
* @default false
*/
ignoreValueFormatterDuringExport: _propTypes.default.oneOfType([_propTypes.default.shape({
clipboardExport: _propTypes.default.bool,
csvExport: _propTypes.default.bool
}), _propTypes.default.bool]),
/**
* The initial state of the DataGrid.
* The data in it will be set in the state on initialization but will not be controlled.
* If one of the data in `initialState` is also being controlled, then the control state wins.
*/
initialState: _propTypes.default.object,
/**
* Callback fired when a cell is rendered, returns true if the cell is editable.
* @param {GridCellParams} params With all properties from [[GridCellParams]].
* @returns {boolean} A boolean indicating if the cell is editable.
*/
isCellEditable: _propTypes.default.func,
/**
* Determines if a row can be selected.
* @param {GridRowParams} params With all properties from [[GridRowParams]].
* @returns {boolean} A boolean indicating if the row is selectable.
*/
isRowSelectable: _propTypes.default.func,
/**
* If `true`, the selection model will retain selected rows that do not exist.
* Useful when using server side pagination and row selections need to be retained
* when changing pages.
* @default false
*/
keepNonExistentRowsSelected: _propTypes.default.bool,
/**
* The label of the Data Grid.
* If the `showToolbar` prop is `true`, the label will be displayed in the toolbar and applied to the `aria-label` attribute of the grid.
* If the `showToolbar` prop is `false`, the label will not be visible but will be applied to the `aria-label` attribute of the grid.
*/
label: _propTypes.default.string,
/**
* If `true`, a loading overlay is displayed.
* @default false
*/
loading: _propTypes.default.bool,
/**
* Set the locale text of the Data Grid.
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/HEAD/packages/x-data-grid/src/constants/localeTextConstants.ts) in the GitHub repository.
*/
localeText: _propTypes.default.object,
/**
* Pass a custom logger in the components that implements the [[Logger]] interface.
* @default console
*/
logger: _propTypes.default.shape({
debug: _propTypes.default.func.isRequired,
error: _propTypes.default.func.isRequired,
info: _propTypes.default.func.isRequired,
warn: _propTypes.default.func.isRequired
}),
/**
* Allows to pass the logging level or false to turn off logging.
* @default "error" ("warn" in dev mode)
*/
logLevel: _propTypes.default.oneOf(['debug', 'error', 'info', 'warn', false]),
/**
* Nonce of the inline styles for [Content Security Policy](https://www.w3.org/TR/2016/REC-CSP2-20161215/#script-src-the-nonce-attribute).
*/
nonce: _propTypes.default.string,
/**
* Callback fired when any cell is clicked.
* @param {GridCellParams} params With all properties from [[GridCellParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onCellClick: _propTypes.default.func,
/**
* Callback fired when a double click event comes from a cell element.
* @param {GridCellParams} params With all properties from [[GridCellParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onCellDoubleClick: _propTypes.default.func,
/**
* Callback fired when the cell turns to edit mode.
* @param {GridCellParams} params With all properties from [[GridCellParams]].
* @param {MuiEvent<React.KeyboardEvent | React.MouseEvent>} event The event that caused this prop to be called.
*/
onCellEditStart: _propTypes.default.func,
/**
* Callback fired when the cell turns to view mode.
* @param {GridCellParams} params With all properties from [[GridCellParams]].
* @param {MuiEvent<MuiBaseEvent>} event The event that caused this prop to be called.
*/
onCellEditStop: _propTypes.default.func,
/**
* Callback fired when a keydown event comes from a cell element.
* @param {GridCellParams} params With all properties from [[GridCellParams]].
* @param {MuiEvent<React.KeyboardEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onCellKeyDown: _propTypes.default.func,
/**
* Callback fired when the `cellModesModel` prop changes.
* @param {GridCellModesModel} cellModesModel Object containing which cells are in "edit" mode.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onCellModesModelChange: _propTypes.default.func,
/**
* Callback called when the data is copied to the clipboard.
* @param {string} data The data copied to the clipboard.
*/
onClipboardCopy: _propTypes.default.func,
/**
* Callback fired when a click event comes from a column header element.
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onColumnHeaderClick: _propTypes.default.func,
/**
* Callback fired when a contextmenu event comes from a column header element.
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
*/
onColumnHeaderContextMenu: _propTypes.default.func,
/**
* Callback fired when a double click event comes from a column header element.
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onColumnHeaderDoubleClick: _propTypes.default.func,
/**
* Callback fired when a mouse enter event comes from a column header element.
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onColumnHeaderEnter: _propTypes.default.func,
/**
* Callback fired when a mouse leave event comes from a column header element.
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onColumnHeaderLeave: _propTypes.default.func,
/**
* Callback fired when a mouseout event comes from a column header element.
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onColumnHeaderOut: _propTypes.default.func,
/**
* Callback fired when a mouseover event comes from a column header element.
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onColumnHeaderOver: _propTypes.default.func,
/**
* Callback fired when a column is reordered.
* @param {GridColumnOrderChangeParams} params With all properties from [[GridColumnOrderChangeParams]].
* @param {MuiEvent<{}>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onColumnOrderChange: _propTypes.default.func,
/**
* Callback fired while a column is being resized.
* @param {GridColumnResizeParams} params With all properties from [[GridColumnResizeParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onColumnResize: _propTypes.default.func,
/**
* Callback fired when the column visibility model changes.
* @param {GridColumnVisibilityModel} model The new model.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onColumnVisibilityModelChange: _propTypes.default.func,
/**
* Callback fired when the width of a column is changed.
* @param {GridColumnResizeParams} params With all properties from [[GridColumnResizeParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onColumnWidthChange: _propTypes.default.func,
/**
* Callback fired when a data source request fails.
* @param {GridGetRowsError | GridUpdateRowError} error The data source error object.
*/
onDataSourceError: _propTypes.default.func,
/**
* Callback fired when the density changes.
* @param {GridDensity} density New density value.
*/
onDensityChange: _propTypes.default.func,
/**
* Callback fired when the Filter model changes before the filters are applied.
* @param {GridFilterModel} model With all properties from [[GridFilterModel]].
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onFilterModelChange: _propTypes.default.func,
/**
* Callback fired when the menu is closed.
* @param {GridMenuParams} params With all properties from [[GridMenuParams]].
* @param {MuiEvent<{}>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onMenuClose: _propTypes.default.func,
/**
* Callback fired when the menu is opened.
* @param {GridMenuParams} params With all properties from [[GridMenuParams]].
* @param {MuiEvent<{}>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onMenuOpen: _propTypes.default.func,
/**
* Callback fired when the pagination meta has changed.
* @param {GridPaginationMeta} paginationMeta Updated pagination meta.
*/
onPaginationMetaChange: _propTypes.default.func,
/**
* Callback fired when the pagination model has changed.
* @param {GridPaginationModel} model Updated pagination model.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onPaginationModelChange: _propTypes.default.func,
/**
* Callback fired when the preferences panel is closed.
* @param {GridPreferencePanelParams} params With all properties from [[GridPreferencePanelParams]].
* @param {MuiEvent<{}>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onPreferencePanelClose: _propTypes.default.func,
/**
* Callback fired when the preferences panel is opened.
* @param {GridPreferencePanelParams} params With all properties from [[GridPreferencePanelParams]].
* @param {MuiEvent<{}>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onPreferencePanelOpen: _propTypes.default.func,
/**
* Callback called when `processRowUpdate()` throws an error or rejects.
* @param {any} error The error thrown.
*/
onProcessRowUpdateError: _propTypes.default.func,
/**
* Callback fired when the Data Grid is resized.
* @param {ElementSize} containerSize With all properties from [[ElementSize]].
* @param {MuiEvent<{}>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onResize: _propTypes.default.func,
/**
* Callback fired when a row is clicked.
* Not called if the target clicked is an interactive element added by the built-in columns.
* @param {GridRowParams} params With all properties from [[GridRowParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onRowClick: _propTypes.default.func,
/**
* Callback fired when the row count has changed.
* @param {number} count Updated row count.
*/
onRowCountChange: _propTypes.default.func,
/**
* Callback fired when a double click event comes from a row container element.
* @param {GridRowParams} params With all properties from [[RowParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onRowDoubleClick: _propTypes.default.func,
/**
* Callback fired when the row turns to edit mode.
* @param {GridRowParams} params With all properties from [[GridRowParams]].
* @param {MuiEvent<React.KeyboardEvent | React.MouseEvent>} event The event that caused this prop to be called.
*/
onRowEditStart: _propTypes.default.func,
/**
* Callback fired when the row turns to view mode.
* @param {GridRowParams} params With all properties from [[GridRowParams]].
* @param {MuiEvent<MuiBaseEvent>} event The event that caused this prop to be called.
*/
onRowEditStop: _propTypes.default.func,
/**
* Callback fired when the `rowModesModel` prop changes.
* @param {GridRowModesModel} rowModesModel Object containing which rows are in "edit" mode.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onRowModesModelChange: _propTypes.default.func,
/**
* Callback fired when the selection state of one or multiple rows changes.
* @param {GridRowSelectionModel} rowSelectionModel With all the row ids [[GridSelectionModel]].
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onRowSelectionModelChange: _propTypes.default.func,
/**
* Callback fired when the sort model changes before a column is sorted.
* @param {GridSortModel} model With all properties from [[GridSortModel]].
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onSortModelChange: _propTypes.default.func,
/**
* Callback fired when the state of the Data Grid is updated.
* @param {GridState} state The new state.
* @param {MuiEvent<{}>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
* @ignore - do not document.
*/
onStateChange: _propTypes.default.func,
/**
* Select the pageSize dynamically using the component UI.
* @default [25, 50, 100]
*/
pageSizeOptions: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
label: _propTypes.default.string.isRequired,
value: _propTypes.default.number.isRequired
})]).isRequired),
pagination: _propTypes.default.oneOf([true]),
/**
* The extra information about the pagination state of the Data Grid.
* Only applicable with `paginationMode="server"`.
*/
paginationMeta: _propTypes.default.shape({
hasNextPage: _propTypes.default.bool
}),
/**
* Pagination can be processed on the server or client-side.
* Set it to 'client' if you would like to handle the pagination on the client-side.
* Set it to 'server' if you would like to handle the pagination on the server-side.
* @default "client"
*/
paginationMode: _propTypes.default.oneOf(['client', 'server']),
/**
* The pagination model of type [[GridPaginationModel]] which refers to current `page` and `pageSize`.
*/
paginationModel: _propTypes.default.shape({
page: _propTypes.default.number.isRequired,
pageSize: _propTypes.default.number.isRequired
}),
/**
* Callback called before updating a row with new values in the row and cell editing.
* @template R
* @param {R} newRow Row object with the new values.
* @param {R} oldRow Row object with the old values.
* @param {{ rowId: GridRowId }} params Additional parameters.
* @returns {Promise<R> | R} The final values to update the row.
*/
processRowUpdate: _propTypes.default.func,
/**
* The milliseconds throttle delay for resizing the grid.
* @default 60
*/
resizeThrottleMs: _propTypes.default.number,
/**
* Row region in pixels to render before/after the viewport
* @default 150
*/
rowBufferPx: _propTypes.default.number,
/**
* Set the total number of rows, if it is different from the length of the value `rows` prop.
* If some rows have children (for instance in the tree data), this number represents the amount of top level rows.
* Only works with `paginationMode="server"`, ignored when `paginationMode="client"`.
*/
rowCount: _propTypes.default.number,
/**
* Sets the height in pixel of a row in the Data Grid.
* @default 52
*/
rowHeight: _propTypes.default.number,
/**
* Controls the modes of the rows.
*/
rowModesModel: _propTypes.default.object,
/**
* Set of rows of type [[GridRowsProp]].
* @default []
*/
rows: _propTypes.default.arrayOf(_propTypes.default.object),
/**
* If `false`, the row selection mode is disabled.
* @default true
*/
rowSelection: _propTypes.default.bool,
/**
* Sets the row selection model of the Data Grid.
*/
rowSelectionModel: _propTypes.default /* @typescript-to-proptypes-ignore */.shape({
ids: _propTypes.default.instanceOf(Set).isRequired,
type: _propTypes.default.oneOf(['exclude', 'include']).isRequired
}),
/**
* Sets the type of space between rows added by `getRowSpacing`.
* @default "margin"
*/
rowSpacingType: _propTypes.default.oneOf(['border', 'margin']),
/**
* If `true`, the Data Grid will auto span the cells over the rows having the same value.
* @default false
*/
rowSpanning: _propTypes.default.bool,
/**
* Override the height/width of the Data Grid inner scrollbar.
*/
scrollbarSize: _propTypes.default.number,
/**
* If `true`, vertical borders will be displayed between cells.
* @default false
*/
showCellVerticalBorder: _propTypes.default.bool,
/**
* If `true`, vertical borders will be displayed between column header items.
* @default false
*/
showColumnVerticalBorder: _propTypes.default.bool,
/**
* If `true`, the toolbar is displayed.
* @default false
*/
showToolbar: _propTypes.default.bool,
/**
* Overridable components props dynamically passed to the component at rendering.
*/
slotProps: _propTypes.default.object,
/**
* Overridable components.
*/
slots: _propTypes.default.object,
/**
* Sorting can be processed on the server or client-side.
* Set it to 'client' if you would like to handle sorting on the client-side.
* Set it to 'server' if you would like to handle sorting on the server-side.
* @default "client"
*/
sortingMode: _propTypes.default.oneOf(['client', 'server']),
/**
* The order of the sorting sequence.
* @default ['asc', 'desc', null]
*/
sortingOrder: _propTypes.default.arrayOf(_propTypes.default.oneOf(['asc', 'desc'])),
/**
* Set the sort model of the Data Grid.
*/
sortModel: _propTypes.default.arrayOf(_propTypes.default.shape({
field: _propTypes.default.string.isRequired,
sort: _propTypes.default.oneOf(['asc', 'desc'])
})),
style: _propTypes.default.object,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
/**
* Sets the tab navigation behavior for the Data Grid.
* - "none": No Data Grid specific tab navigation. Pressing the tab key will move the focus to the next element in the tab sequence.
* - "content": Pressing the tab key will move the focus to the next cell in the same row or the first cell in the next row. Shift+Tab will move the focus to the previous cell in the same row or the last cell in the previous row. Tab navigation is not enabled for the header.
* - "header": Pressing the tab key will move the focus to the next column group, column header or header filter. Shift+Tab will move the focus to the previous column group, column header or header filter. Tab navigation is not enabled for the content.
* - "all": Combines the "content" and "header" behavior.
* @default "none"
*/
tabNavigation: _propTypes.default.oneOf(['all', 'content', 'header', 'none']),
/**
* If `true`, the Data Grid enables column virtualization when `getRowHeight` is set to `() => 'auto'`.
* By default, column virtualization is disabled when dynamic row height is enabled to measure the row height correctly.
* For datasets with a large number of columns, this can cause performance issues.
* The downside of enabling this prop is that the row height will be estimated based the cells that are currently rendered, which can cause row height change when scrolling horizontally.
* @default false
*/
virtualizeColumnsWithAutoRowHeight: _propTypes.default.bool
} : void 0;
+894
View File
@@ -0,0 +1,894 @@
'use client';
import _extends from "@babel/runtime/helpers/esm/extends";
import * as React from 'react';
import PropTypes from 'prop-types';
import { forwardRef } from '@mui/x-internals/forwardRef';
import { GridRoot } from "../components/index.mjs";
import { useGridAriaAttributes } from "../hooks/utils/useGridAriaAttributes.mjs";
import { useGridRowAriaAttributes } from "../hooks/features/rows/useGridRowAriaAttributes.mjs";
import { useGridRowsOverridableMethods } from "../hooks/features/rows/useGridRowsOverridableMethods.mjs";
import { useGridParamsOverridableMethods } from "../hooks/features/rows/useGridParamsOverridableMethods.mjs";
import { useIsCellEditable } from "../hooks/features/editing/useGridCellEditable.mjs";
import { GridContextProvider } from "../context/GridContextProvider.mjs";
import { useDataGridComponent } from "./useDataGridComponent.mjs";
import { useDataGridProps } from "./useDataGridProps.mjs";
import { propValidatorsDataGrid, validateProps } from "../internals/utils/propValidation.mjs";
import { useMaterialCSSVariables } from "../material/variables.mjs";
import { useGridApiInitialization } from "../hooks/core/useGridApiInitialization.mjs";
import { jsx as _jsx } from "react/jsx-runtime";
const configuration = {
hooks: {
useCSSVariables: useMaterialCSSVariables,
useGridAriaAttributes,
useGridRowAriaAttributes,
useGridRowsOverridableMethods,
useGridParamsOverridableMethods,
useIsCellEditable,
useCellAggregationResult: () => null,
useFilterValueGetter: apiRef => apiRef.current.getRowValue
}
};
const DataGridRaw = function DataGrid(inProps, ref) {
const props = useDataGridProps(inProps);
const privateApiRef = useGridApiInitialization(props.apiRef, props);
useDataGridComponent(privateApiRef, props, configuration);
if (process.env.NODE_ENV !== 'production') {
validateProps(props, propValidatorsDataGrid);
}
return /*#__PURE__*/_jsx(GridContextProvider, {
privateApiRef: privateApiRef,
configuration: configuration,
props: props,
children: /*#__PURE__*/_jsx(GridRoot, _extends({
className: props.className,
style: props.style,
sx: props.sx
}, props.slotProps?.root, {
ref: ref
}))
});
};
if (process.env.NODE_ENV !== "production") DataGridRaw.displayName = "DataGridRaw";
/**
* Features:
* - [DataGrid](https://mui.com/x/react-data-grid/features/)
*
* API:
* - [DataGrid API](https://mui.com/x/api/data-grid/data-grid/)
*/
export const DataGrid = /*#__PURE__*/React.memo(forwardRef(DataGridRaw));
if (process.env.NODE_ENV !== "production") DataGrid.displayName = "DataGrid";
process.env.NODE_ENV !== "production" ? DataGridRaw.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "pnpm proptypes" |
// ----------------------------------------------------------------------
/**
* The ref object that allows Data Grid manipulation. Can be instantiated with `useGridApiRef()`.
*/
apiRef: PropTypes.shape({
current: PropTypes.object
}),
/**
* The `aria-label` of the Data Grid.
*/
'aria-label': PropTypes.string,
/**
* The `id` of the element containing a label for the Data Grid.
*/
'aria-labelledby': PropTypes.string,
/**
* If `true`, the Data Grid height is dynamic and takes as much space as it needs to display all rows.
* Use it instead of a flex parent container approach, if:
* - you don't need to set a minimum or maximum height for the Data Grid
* - you want to avoid the scrollbar flickering when the content changes
* @default false
*/
autoHeight: PropTypes.bool,
/**
* If `true`, the pageSize is calculated according to the container size and the max number of rows to avoid rendering a vertical scroll bar.
* @default false
*/
autoPageSize: PropTypes.bool,
/**
* If `true`, columns are autosized after the datagrid is mounted.
* @default false
*/
autosizeOnMount: PropTypes.bool,
/**
* The options for autosize when user-initiated.
*/
autosizeOptions: PropTypes.shape({
columns: PropTypes.arrayOf(PropTypes.string),
disableColumnVirtualization: PropTypes.bool,
expand: PropTypes.bool,
includeHeaderFilters: PropTypes.bool,
includeHeaders: PropTypes.bool,
includeOutliers: PropTypes.bool,
outliersFactor: PropTypes.number
}),
/**
* Controls the modes of the cells.
*/
cellModesModel: PropTypes.object,
/**
* Definition of the column rendered when the `checkboxSelection` prop is enabled.
*
* @warning
* Be careful when overriding `renderHeader` or `renderCell` in the `checkboxColDef` prop.
* The default implementation of these properties includes the logic for selecting all rows and selecting a single row, respectively.
* Overriding them without providing the same functionality will break the row selection.
*/
checkboxColDef: PropTypes.shape({
align: PropTypes.oneOf(['center', 'left', 'right']),
cellClassName: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
colSpan: PropTypes.oneOfType([PropTypes.func, PropTypes.number]),
description: PropTypes.string,
disableColumnMenu: PropTypes.bool,
disableExport: PropTypes.bool,
disableReorder: PropTypes.bool,
display: PropTypes.oneOf(['flex', 'text']),
editable: PropTypes.bool,
examples: PropTypes.array,
filterable: PropTypes.bool,
filterOperators: PropTypes.arrayOf(PropTypes.shape({
getApplyFilterFn: PropTypes.func.isRequired,
getValueAsString: PropTypes.func,
headerLabel: PropTypes.string,
InputComponent: PropTypes.elementType,
InputComponentProps: PropTypes.object,
label: PropTypes.string,
requiresFilterValue: PropTypes.bool,
value: PropTypes.string.isRequired
})),
flex: PropTypes.number,
getApplyQuickFilterFn: PropTypes.func,
getSortComparator: PropTypes.func,
groupable: PropTypes.bool,
headerAlign: PropTypes.oneOf(['center', 'left', 'right']),
headerClassName: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
headerName: PropTypes.string,
hideable: PropTypes.bool,
hideSortIcons: PropTypes.bool,
maxWidth: PropTypes.number,
minWidth: PropTypes.number,
pinnable: PropTypes.bool,
preProcessEditCellProps: PropTypes.func,
renderCell: PropTypes.func,
renderEditCell: PropTypes.func,
renderHeader: PropTypes.func,
resizable: PropTypes.bool,
rowSpanValueGetter: PropTypes.func,
sortable: PropTypes.bool,
sortComparator: PropTypes.func,
sortingOrder: PropTypes.arrayOf(PropTypes.oneOf(['asc', 'desc'])),
valueFormatter: PropTypes.func,
valueGetter: PropTypes.func,
valueParser: PropTypes.func,
valueSetter: PropTypes.func,
width: PropTypes.number
}),
/**
* If `true`, the Data Grid will display an extra column with checkboxes for selecting rows.
* @default false
*/
checkboxSelection: PropTypes.bool,
/**
* Override or extend the styles applied to the component.
*/
classes: PropTypes.object,
className: PropTypes.string,
/**
* The character used to separate cell values when copying to the clipboard.
* @default '\t'
*/
clipboardCopyCellDelimiter: PropTypes.string,
/**
* Column region in pixels to render before/after the viewport
* @default 150
*/
columnBufferPx: PropTypes.number,
/**
* The milliseconds delay to wait after a keystroke before triggering filtering in the columns menu.
* @default 150
*/
columnFilterDebounceMs: PropTypes.number,
/**
* Sets the height in pixels of the column group headers in the Data Grid.
* Inherits the `columnHeaderHeight` value if not set.
*/
columnGroupHeaderHeight: PropTypes.number,
columnGroupingModel: PropTypes.arrayOf(PropTypes.object),
/**
* Sets the height in pixel of the column headers in the Data Grid.
* @default 56
*/
columnHeaderHeight: PropTypes.number,
/**
* Set of columns of type [[GridColDef]][].
*/
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
/**
* Set the column visibility model of the Data Grid.
* If defined, the Data Grid will ignore the `hide` property in [[GridColDef]].
*/
columnVisibilityModel: PropTypes.object,
/**
* The data source object.
*/
dataSource: PropTypes.shape({
getRows: PropTypes.func.isRequired,
updateRow: PropTypes.func
}),
/**
* Data source cache object.
*/
dataSourceCache: PropTypes.shape({
clear: PropTypes.func.isRequired,
get: PropTypes.func.isRequired,
set: PropTypes.func.isRequired
}),
/**
* If `true`, the previously displayed rows are kept visible while new rows are being fetched after pagination, sorting, or filtering changes.
* The loading overlay is rendered on top of the previous rows.
* Only applies to flat data; tree data and row grouping always reset the rows on refetch to keep the order consistent with the new response.
* @default false
*/
dataSourceKeepPreviousData: PropTypes.bool,
/**
* If positive, the Data Grid will periodically revalidate data source rows by re-fetching them from the server when the cache entry has expired.
* If the refetched rows are different from the current rows, the grid will update the rows.
* Set to `0` to disable polling.
* @default 0
*/
dataSourceRevalidateMs: PropTypes.number,
/**
* Set the density of the Data Grid.
* @default "standard"
*/
density: PropTypes.oneOf(['comfortable', 'compact', 'standard']),
/**
* If `true`, column autosizing on header separator double-click is disabled.
* @default false
*/
disableAutosize: PropTypes.bool,
/**
* If `true`, column filters are disabled.
* @default false
*/
disableColumnFilter: PropTypes.bool,
/**
* If `true`, the column menu is disabled.
* @default false
*/
disableColumnMenu: PropTypes.bool,
/**
* If `true`, resizing columns is disabled.
* @default false
*/
disableColumnResize: PropTypes.bool,
/**
* If `true`, hiding/showing columns is disabled.
* @default false
*/
disableColumnSelector: PropTypes.bool,
/**
* If `true`, the column sorting feature will be disabled.
* @default false
*/
disableColumnSorting: PropTypes.bool,
/**
* If `true`, the density selector is disabled.
* @default false
*/
disableDensitySelector: PropTypes.bool,
/**
* If `true`, `eval()` is not used for performance optimization.
* @default false
*/
disableEval: PropTypes.bool,
/**
* If `true`, multiple selection using the Ctrl/CMD or Shift key is disabled.
* The MIT DataGrid will ignore this prop, unless `checkboxSelection` is enabled.
* @default false (`!props.checkboxSelection` for MIT Data Grid)
*/
disableMultipleRowSelection: PropTypes.bool,
/**
* If `true`, the Data Grid will not use the exclude model optimization when selecting all rows.
* @default false
*/
disableRowSelectionExcludeModel: PropTypes.bool,
/**
* If `true`, the selection on click on a row or cell is disabled.
* @default false
*/
disableRowSelectionOnClick: PropTypes.bool,
/**
* If `true`, the virtualization is disabled.
* @default false
*/
disableVirtualization: PropTypes.bool,
/**
* Controls whether to use the cell or row editing.
* @default "cell"
*/
editMode: PropTypes.oneOf(['cell', 'row']),
/**
* Use if the actual rowCount is not known upfront, but an estimation is available.
* If some rows have children (for instance in the tree data), this number represents the amount of top level rows.
* Applicable only with `paginationMode="server"` and when `rowCount="-1"`
*/
estimatedRowCount: PropTypes.number,
/**
* Unstable features, breaking changes might be introduced.
* For each feature, if the flag is not explicitly set to `true`, the feature will be fully disabled and any property / method call will not have any effect.
*/
experimentalFeatures: PropTypes.shape({
virtualizerLayoutMode: PropTypes.oneOf(['controlled', 'uncontrolled']),
warnIfFocusStateIsNotSynced: PropTypes.bool
}),
/**
* The milliseconds delay to wait after a keystroke before triggering filtering.
* @default 150
*/
filterDebounceMs: PropTypes.number,
/**
* Filtering can be processed on the server or client-side.
* Set it to 'server' if you would like to handle filtering on the server-side.
* @default "client"
*/
filterMode: PropTypes.oneOf(['client', 'server']),
/**
* Set the filter model of the Data Grid.
*/
filterModel: PropTypes.shape({
items: PropTypes.arrayOf(PropTypes.shape({
field: PropTypes.string.isRequired,
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
operator: PropTypes.string.isRequired,
value: PropTypes.any
})).isRequired,
logicOperator: PropTypes.oneOf(['and', 'or']),
quickFilterExcludeHiddenColumns: PropTypes.bool,
quickFilterLogicOperator: PropTypes.oneOf(['and', 'or']),
quickFilterValues: PropTypes.array
}),
/**
* Function that applies CSS classes dynamically on cells.
* @param {GridCellParams} params With all properties from [[GridCellParams]].
* @returns {string} The CSS class to apply to the cell.
*/
getCellClassName: PropTypes.func,
/**
* Function that returns the element to render in row detail.
* @param {GridRowParams} params With all properties from [[GridRowParams]].
* @returns {React.JSX.Element} The row detail element.
*/
getDetailPanelContent: PropTypes.func,
/**
* Function that returns the estimated height for a row.
* Only works if dynamic row height is used.
* Once the row height is measured this value is discarded.
* @param {GridRowHeightParams} params With all properties from [[GridRowHeightParams]].
* @returns {number | null} The estimated row height value. If `null` or `undefined` then the default row height, based on the density, is applied.
*/
getEstimatedRowHeight: PropTypes.func,
/**
* Function that applies CSS classes dynamically on rows.
* @param {GridRowClassNameParams} params With all properties from [[GridRowClassNameParams]].
* @returns {string} The CSS class to apply to the row.
*/
getRowClassName: PropTypes.func,
/**
* Function that sets the row height per row.
* @param {GridRowHeightParams} params With all properties from [[GridRowHeightParams]].
* @returns {GridRowHeightReturnValue} The row height value. If `null` or `undefined` then the default row height is applied. If "auto" then the row height is calculated based on the content.
*/
getRowHeight: PropTypes.func,
/**
* Return the id of a given [[GridRowModel]].
* Ensure the reference of this prop is stable to avoid performance implications.
* It could be done by either defining the prop outside of the component or by memoizing it.
*/
getRowId: PropTypes.func,
/**
* Function that allows to specify the spacing between rows.
* @param {GridRowSpacingParams} params With all properties from [[GridRowSpacingParams]].
* @returns {GridRowSpacing} The row spacing values.
*/
getRowSpacing: PropTypes.func,
/**
* If `true`, the footer component is hidden.
* @default false
*/
hideFooter: PropTypes.bool,
/**
* If `true`, the pagination component in the footer is hidden.
* @default false
*/
hideFooterPagination: PropTypes.bool,
/**
* If `true`, the selected row count in the footer is hidden.
* @default false
*/
hideFooterSelectedRowCount: PropTypes.bool,
/**
* If `true`, the diacritics (accents) are ignored when filtering or quick filtering.
* E.g. when filter value is `cafe`, the rows with `café` will be visible.
* @default false
*/
ignoreDiacritics: PropTypes.bool,
/**
* If `true`, the Data Grid will not use `valueFormatter` when exporting to CSV or copying to clipboard.
* If an object is provided, you can choose to ignore the `valueFormatter` for CSV export or clipboard export.
* @default false
*/
ignoreValueFormatterDuringExport: PropTypes.oneOfType([PropTypes.shape({
clipboardExport: PropTypes.bool,
csvExport: PropTypes.bool
}), PropTypes.bool]),
/**
* The initial state of the DataGrid.
* The data in it will be set in the state on initialization but will not be controlled.
* If one of the data in `initialState` is also being controlled, then the control state wins.
*/
initialState: PropTypes.object,
/**
* Callback fired when a cell is rendered, returns true if the cell is editable.
* @param {GridCellParams} params With all properties from [[GridCellParams]].
* @returns {boolean} A boolean indicating if the cell is editable.
*/
isCellEditable: PropTypes.func,
/**
* Determines if a row can be selected.
* @param {GridRowParams} params With all properties from [[GridRowParams]].
* @returns {boolean} A boolean indicating if the row is selectable.
*/
isRowSelectable: PropTypes.func,
/**
* If `true`, the selection model will retain selected rows that do not exist.
* Useful when using server side pagination and row selections need to be retained
* when changing pages.
* @default false
*/
keepNonExistentRowsSelected: PropTypes.bool,
/**
* The label of the Data Grid.
* If the `showToolbar` prop is `true`, the label will be displayed in the toolbar and applied to the `aria-label` attribute of the grid.
* If the `showToolbar` prop is `false`, the label will not be visible but will be applied to the `aria-label` attribute of the grid.
*/
label: PropTypes.string,
/**
* If `true`, a loading overlay is displayed.
* @default false
*/
loading: PropTypes.bool,
/**
* Set the locale text of the Data Grid.
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/HEAD/packages/x-data-grid/src/constants/localeTextConstants.ts) in the GitHub repository.
*/
localeText: PropTypes.object,
/**
* Pass a custom logger in the components that implements the [[Logger]] interface.
* @default console
*/
logger: PropTypes.shape({
debug: PropTypes.func.isRequired,
error: PropTypes.func.isRequired,
info: PropTypes.func.isRequired,
warn: PropTypes.func.isRequired
}),
/**
* Allows to pass the logging level or false to turn off logging.
* @default "error" ("warn" in dev mode)
*/
logLevel: PropTypes.oneOf(['debug', 'error', 'info', 'warn', false]),
/**
* Nonce of the inline styles for [Content Security Policy](https://www.w3.org/TR/2016/REC-CSP2-20161215/#script-src-the-nonce-attribute).
*/
nonce: PropTypes.string,
/**
* Callback fired when any cell is clicked.
* @param {GridCellParams} params With all properties from [[GridCellParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onCellClick: PropTypes.func,
/**
* Callback fired when a double click event comes from a cell element.
* @param {GridCellParams} params With all properties from [[GridCellParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onCellDoubleClick: PropTypes.func,
/**
* Callback fired when the cell turns to edit mode.
* @param {GridCellParams} params With all properties from [[GridCellParams]].
* @param {MuiEvent<React.KeyboardEvent | React.MouseEvent>} event The event that caused this prop to be called.
*/
onCellEditStart: PropTypes.func,
/**
* Callback fired when the cell turns to view mode.
* @param {GridCellParams} params With all properties from [[GridCellParams]].
* @param {MuiEvent<MuiBaseEvent>} event The event that caused this prop to be called.
*/
onCellEditStop: PropTypes.func,
/**
* Callback fired when a keydown event comes from a cell element.
* @param {GridCellParams} params With all properties from [[GridCellParams]].
* @param {MuiEvent<React.KeyboardEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onCellKeyDown: PropTypes.func,
/**
* Callback fired when the `cellModesModel` prop changes.
* @param {GridCellModesModel} cellModesModel Object containing which cells are in "edit" mode.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onCellModesModelChange: PropTypes.func,
/**
* Callback called when the data is copied to the clipboard.
* @param {string} data The data copied to the clipboard.
*/
onClipboardCopy: PropTypes.func,
/**
* Callback fired when a click event comes from a column header element.
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onColumnHeaderClick: PropTypes.func,
/**
* Callback fired when a contextmenu event comes from a column header element.
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
*/
onColumnHeaderContextMenu: PropTypes.func,
/**
* Callback fired when a double click event comes from a column header element.
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onColumnHeaderDoubleClick: PropTypes.func,
/**
* Callback fired when a mouse enter event comes from a column header element.
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onColumnHeaderEnter: PropTypes.func,
/**
* Callback fired when a mouse leave event comes from a column header element.
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onColumnHeaderLeave: PropTypes.func,
/**
* Callback fired when a mouseout event comes from a column header element.
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onColumnHeaderOut: PropTypes.func,
/**
* Callback fired when a mouseover event comes from a column header element.
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onColumnHeaderOver: PropTypes.func,
/**
* Callback fired when a column is reordered.
* @param {GridColumnOrderChangeParams} params With all properties from [[GridColumnOrderChangeParams]].
* @param {MuiEvent<{}>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onColumnOrderChange: PropTypes.func,
/**
* Callback fired while a column is being resized.
* @param {GridColumnResizeParams} params With all properties from [[GridColumnResizeParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onColumnResize: PropTypes.func,
/**
* Callback fired when the column visibility model changes.
* @param {GridColumnVisibilityModel} model The new model.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onColumnVisibilityModelChange: PropTypes.func,
/**
* Callback fired when the width of a column is changed.
* @param {GridColumnResizeParams} params With all properties from [[GridColumnResizeParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onColumnWidthChange: PropTypes.func,
/**
* Callback fired when a data source request fails.
* @param {GridGetRowsError | GridUpdateRowError} error The data source error object.
*/
onDataSourceError: PropTypes.func,
/**
* Callback fired when the density changes.
* @param {GridDensity} density New density value.
*/
onDensityChange: PropTypes.func,
/**
* Callback fired when the Filter model changes before the filters are applied.
* @param {GridFilterModel} model With all properties from [[GridFilterModel]].
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onFilterModelChange: PropTypes.func,
/**
* Callback fired when the menu is closed.
* @param {GridMenuParams} params With all properties from [[GridMenuParams]].
* @param {MuiEvent<{}>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onMenuClose: PropTypes.func,
/**
* Callback fired when the menu is opened.
* @param {GridMenuParams} params With all properties from [[GridMenuParams]].
* @param {MuiEvent<{}>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onMenuOpen: PropTypes.func,
/**
* Callback fired when the pagination meta has changed.
* @param {GridPaginationMeta} paginationMeta Updated pagination meta.
*/
onPaginationMetaChange: PropTypes.func,
/**
* Callback fired when the pagination model has changed.
* @param {GridPaginationModel} model Updated pagination model.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onPaginationModelChange: PropTypes.func,
/**
* Callback fired when the preferences panel is closed.
* @param {GridPreferencePanelParams} params With all properties from [[GridPreferencePanelParams]].
* @param {MuiEvent<{}>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onPreferencePanelClose: PropTypes.func,
/**
* Callback fired when the preferences panel is opened.
* @param {GridPreferencePanelParams} params With all properties from [[GridPreferencePanelParams]].
* @param {MuiEvent<{}>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onPreferencePanelOpen: PropTypes.func,
/**
* Callback called when `processRowUpdate()` throws an error or rejects.
* @param {any} error The error thrown.
*/
onProcessRowUpdateError: PropTypes.func,
/**
* Callback fired when the Data Grid is resized.
* @param {ElementSize} containerSize With all properties from [[ElementSize]].
* @param {MuiEvent<{}>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onResize: PropTypes.func,
/**
* Callback fired when a row is clicked.
* Not called if the target clicked is an interactive element added by the built-in columns.
* @param {GridRowParams} params With all properties from [[GridRowParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onRowClick: PropTypes.func,
/**
* Callback fired when the row count has changed.
* @param {number} count Updated row count.
*/
onRowCountChange: PropTypes.func,
/**
* Callback fired when a double click event comes from a row container element.
* @param {GridRowParams} params With all properties from [[RowParams]].
* @param {MuiEvent<React.MouseEvent>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onRowDoubleClick: PropTypes.func,
/**
* Callback fired when the row turns to edit mode.
* @param {GridRowParams} params With all properties from [[GridRowParams]].
* @param {MuiEvent<React.KeyboardEvent | React.MouseEvent>} event The event that caused this prop to be called.
*/
onRowEditStart: PropTypes.func,
/**
* Callback fired when the row turns to view mode.
* @param {GridRowParams} params With all properties from [[GridRowParams]].
* @param {MuiEvent<MuiBaseEvent>} event The event that caused this prop to be called.
*/
onRowEditStop: PropTypes.func,
/**
* Callback fired when the `rowModesModel` prop changes.
* @param {GridRowModesModel} rowModesModel Object containing which rows are in "edit" mode.
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onRowModesModelChange: PropTypes.func,
/**
* Callback fired when the selection state of one or multiple rows changes.
* @param {GridRowSelectionModel} rowSelectionModel With all the row ids [[GridSelectionModel]].
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onRowSelectionModelChange: PropTypes.func,
/**
* Callback fired when the sort model changes before a column is sorted.
* @param {GridSortModel} model With all properties from [[GridSortModel]].
* @param {GridCallbackDetails} details Additional details for this callback.
*/
onSortModelChange: PropTypes.func,
/**
* Callback fired when the state of the Data Grid is updated.
* @param {GridState} state The new state.
* @param {MuiEvent<{}>} event The event object.
* @param {GridCallbackDetails} details Additional details for this callback.
* @ignore - do not document.
*/
onStateChange: PropTypes.func,
/**
* Select the pageSize dynamically using the component UI.
* @default [25, 50, 100]
*/
pageSizeOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
label: PropTypes.string.isRequired,
value: PropTypes.number.isRequired
})]).isRequired),
pagination: PropTypes.oneOf([true]),
/**
* The extra information about the pagination state of the Data Grid.
* Only applicable with `paginationMode="server"`.
*/
paginationMeta: PropTypes.shape({
hasNextPage: PropTypes.bool
}),
/**
* Pagination can be processed on the server or client-side.
* Set it to 'client' if you would like to handle the pagination on the client-side.
* Set it to 'server' if you would like to handle the pagination on the server-side.
* @default "client"
*/
paginationMode: PropTypes.oneOf(['client', 'server']),
/**
* The pagination model of type [[GridPaginationModel]] which refers to current `page` and `pageSize`.
*/
paginationModel: PropTypes.shape({
page: PropTypes.number.isRequired,
pageSize: PropTypes.number.isRequired
}),
/**
* Callback called before updating a row with new values in the row and cell editing.
* @template R
* @param {R} newRow Row object with the new values.
* @param {R} oldRow Row object with the old values.
* @param {{ rowId: GridRowId }} params Additional parameters.
* @returns {Promise<R> | R} The final values to update the row.
*/
processRowUpdate: PropTypes.func,
/**
* The milliseconds throttle delay for resizing the grid.
* @default 60
*/
resizeThrottleMs: PropTypes.number,
/**
* Row region in pixels to render before/after the viewport
* @default 150
*/
rowBufferPx: PropTypes.number,
/**
* Set the total number of rows, if it is different from the length of the value `rows` prop.
* If some rows have children (for instance in the tree data), this number represents the amount of top level rows.
* Only works with `paginationMode="server"`, ignored when `paginationMode="client"`.
*/
rowCount: PropTypes.number,
/**
* Sets the height in pixel of a row in the Data Grid.
* @default 52
*/
rowHeight: PropTypes.number,
/**
* Controls the modes of the rows.
*/
rowModesModel: PropTypes.object,
/**
* Set of rows of type [[GridRowsProp]].
* @default []
*/
rows: PropTypes.arrayOf(PropTypes.object),
/**
* If `false`, the row selection mode is disabled.
* @default true
*/
rowSelection: PropTypes.bool,
/**
* Sets the row selection model of the Data Grid.
*/
rowSelectionModel: PropTypes /* @typescript-to-proptypes-ignore */.shape({
ids: PropTypes.instanceOf(Set).isRequired,
type: PropTypes.oneOf(['exclude', 'include']).isRequired
}),
/**
* Sets the type of space between rows added by `getRowSpacing`.
* @default "margin"
*/
rowSpacingType: PropTypes.oneOf(['border', 'margin']),
/**
* If `true`, the Data Grid will auto span the cells over the rows having the same value.
* @default false
*/
rowSpanning: PropTypes.bool,
/**
* Override the height/width of the Data Grid inner scrollbar.
*/
scrollbarSize: PropTypes.number,
/**
* If `true`, vertical borders will be displayed between cells.
* @default false
*/
showCellVerticalBorder: PropTypes.bool,
/**
* If `true`, vertical borders will be displayed between column header items.
* @default false
*/
showColumnVerticalBorder: PropTypes.bool,
/**
* If `true`, the toolbar is displayed.
* @default false
*/
showToolbar: PropTypes.bool,
/**
* Overridable components props dynamically passed to the component at rendering.
*/
slotProps: PropTypes.object,
/**
* Overridable components.
*/
slots: PropTypes.object,
/**
* Sorting can be processed on the server or client-side.
* Set it to 'client' if you would like to handle sorting on the client-side.
* Set it to 'server' if you would like to handle sorting on the server-side.
* @default "client"
*/
sortingMode: PropTypes.oneOf(['client', 'server']),
/**
* The order of the sorting sequence.
* @default ['asc', 'desc', null]
*/
sortingOrder: PropTypes.arrayOf(PropTypes.oneOf(['asc', 'desc'])),
/**
* Set the sort model of the Data Grid.
*/
sortModel: PropTypes.arrayOf(PropTypes.shape({
field: PropTypes.string.isRequired,
sort: PropTypes.oneOf(['asc', 'desc'])
})),
style: PropTypes.object,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
/**
* Sets the tab navigation behavior for the Data Grid.
* - "none": No Data Grid specific tab navigation. Pressing the tab key will move the focus to the next element in the tab sequence.
* - "content": Pressing the tab key will move the focus to the next cell in the same row or the first cell in the next row. Shift+Tab will move the focus to the previous cell in the same row or the last cell in the previous row. Tab navigation is not enabled for the header.
* - "header": Pressing the tab key will move the focus to the next column group, column header or header filter. Shift+Tab will move the focus to the previous column group, column header or header filter. Tab navigation is not enabled for the content.
* - "all": Combines the "content" and "header" behavior.
* @default "none"
*/
tabNavigation: PropTypes.oneOf(['all', 'content', 'header', 'none']),
/**
* If `true`, the Data Grid enables column virtualization when `getRowHeight` is set to `() => 'auto'`.
* By default, column virtualization is disabled when dynamic row height is enabled to measure the row height correctly.
* For datasets with a large number of columns, this can cause performance issues.
* The downside of enabling this prop is that the row height will be estimated based the cells that are currently rendered, which can cause row height change when scrolling horizontally.
* @default false
*/
virtualizeColumnsWithAutoRowHeight: PropTypes.bool
} : void 0;
+1
View File
@@ -0,0 +1 @@
export * from "./DataGrid.mjs";
+1
View File
@@ -0,0 +1 @@
export * from "./DataGrid.js";
+16
View File
@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _DataGrid = require("./DataGrid");
Object.keys(_DataGrid).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _DataGrid[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _DataGrid[key];
}
});
});
+1
View File
@@ -0,0 +1 @@
export * from "./DataGrid.mjs";
@@ -0,0 +1,5 @@
import type { RefObject } from '@mui/x-internals/types';
import type { DataGridProcessedProps } from "../models/props/DataGridProps.mjs";
import type { GridPrivateApiCommunity } from "../models/api/gridApiCommunity.mjs";
import type { GridConfiguration } from "../models/configuration/gridConfiguration.mjs";
export declare const useDataGridComponent: (apiRef: RefObject<GridPrivateApiCommunity>, props: DataGridProcessedProps, configuration: GridConfiguration) => void;
@@ -0,0 +1,5 @@
import type { RefObject } from '@mui/x-internals/types';
import type { DataGridProcessedProps } from "../models/props/DataGridProps.js";
import type { GridPrivateApiCommunity } from "../models/api/gridApiCommunity.js";
import type { GridConfiguration } from "../models/configuration/gridConfiguration.js";
export declare const useDataGridComponent: (apiRef: RefObject<GridPrivateApiCommunity>, props: DataGridProcessedProps, configuration: GridConfiguration) => void;
+111
View File
@@ -0,0 +1,111 @@
"use strict";
'use client';
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useDataGridComponent = void 0;
var React = _interopRequireWildcard(require("react"));
var _useFirstRender = require("@mui/x-internals/useFirstRender");
var _useGridInitialization = require("../hooks/core/useGridInitialization");
var _useGridInitializeState = require("../hooks/utils/useGridInitializeState");
var _useGridClipboard = require("../hooks/features/clipboard/useGridClipboard");
var _useGridColumnMenu = require("../hooks/features/columnMenu/useGridColumnMenu");
var _useGridColumns = require("../hooks/features/columns/useGridColumns");
var _useGridDensity = require("../hooks/features/density/useGridDensity");
var _useGridCsvExport = require("../hooks/features/export/useGridCsvExport");
var _useGridPrintExport = require("../hooks/features/export/useGridPrintExport");
var _useGridFilter = require("../hooks/features/filter/useGridFilter");
var _useGridFocus = require("../hooks/features/focus/useGridFocus");
var _useGridKeyboardNavigation = require("../hooks/features/keyboardNavigation/useGridKeyboardNavigation");
var _useGridPagination = require("../hooks/features/pagination/useGridPagination");
var _useGridPreferencesPanel = require("../hooks/features/preferencesPanel/useGridPreferencesPanel");
var _useGridEditing = require("../hooks/features/editing/useGridEditing");
var _useGridRows = require("../hooks/features/rows/useGridRows");
var _useGridRowsPreProcessors = require("../hooks/features/rows/useGridRowsPreProcessors");
var _useGridParamsApi = require("../hooks/features/rows/useGridParamsApi");
var _useGridRowSelection = require("../hooks/features/rowSelection/useGridRowSelection");
var _useGridRowSelectionPreProcessors = require("../hooks/features/rowSelection/useGridRowSelectionPreProcessors");
var _useGridSorting = require("../hooks/features/sorting/useGridSorting");
var _useGridScroll = require("../hooks/features/scroll/useGridScroll");
var _useGridEvents = require("../hooks/features/events/useGridEvents");
var _useGridDimensions = require("../hooks/features/dimensions/useGridDimensions");
var _useGridRowsMeta = require("../hooks/features/rows/useGridRowsMeta");
var _useGridStatePersistence = require("../hooks/features/statePersistence/useGridStatePersistence");
var _useGridColumnSpanning = require("../hooks/features/columns/useGridColumnSpanning");
var _useGridColumnGrouping = require("../hooks/features/columnGrouping/useGridColumnGrouping");
var _virtualization = require("../hooks/features/virtualization");
var _useGridColumnResize = require("../hooks/features/columnResize/useGridColumnResize");
var _useGridRowSpanning = require("../hooks/features/rows/useGridRowSpanning");
var _useGridListView = require("../hooks/features/listView/useGridListView");
var _useGridProps = require("../hooks/core/useGridProps");
var _useGridDataSource = require("../hooks/features/dataSource/useGridDataSource");
const useDataGridComponent = (apiRef, props, configuration) => {
(0, _useGridInitialization.useGridInitialization)(apiRef, props);
/**
* Register all pre-processors called during state initialization here.
*/
(0, _useGridRowSelectionPreProcessors.useGridRowSelectionPreProcessors)(apiRef, props);
(0, _useGridRowsPreProcessors.useGridRowsPreProcessors)(apiRef);
/**
* Register all state initializers here.
*/
(0, _useGridInitializeState.useGridInitializeState)(_useGridProps.propsStateInitializer, apiRef, props);
(0, _useGridInitializeState.useGridInitializeState)(_useGridRowSelection.rowSelectionStateInitializer, apiRef, props);
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumns.columnsStateInitializer, apiRef, props);
(0, _useGridInitializeState.useGridInitializeState)(_useGridRows.rowsStateInitializer, apiRef, props);
(0, _useGridInitializeState.useGridInitializeState)(_useGridPagination.paginationStateInitializer, apiRef, props);
(0, _useGridInitializeState.useGridInitializeState)(_useGridEditing.editingStateInitializer, apiRef, props);
(0, _useGridInitializeState.useGridInitializeState)(_useGridFocus.focusStateInitializer, apiRef, props);
(0, _useGridInitializeState.useGridInitializeState)(_useGridSorting.sortingStateInitializer, apiRef, props);
(0, _useGridInitializeState.useGridInitializeState)(_useGridPreferencesPanel.preferencePanelStateInitializer, apiRef, props);
(0, _useGridInitializeState.useGridInitializeState)(_useGridFilter.filterStateInitializer, apiRef, props);
(0, _useGridInitializeState.useGridInitializeState)(_useGridRowSpanning.rowSpanningStateInitializer, apiRef, props);
(0, _useGridInitializeState.useGridInitializeState)(_useGridDensity.densityStateInitializer, apiRef, props);
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumnResize.columnResizeStateInitializer, apiRef, props);
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumnMenu.columnMenuStateInitializer, apiRef, props);
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumnGrouping.columnGroupsStateInitializer, apiRef, props);
(0, _useGridInitializeState.useGridInitializeState)(_virtualization.virtualizationStateInitializer, apiRef, props);
(0, _useGridInitializeState.useGridInitializeState)(_useGridDimensions.dimensionsStateInitializer, apiRef, props);
(0, _useGridInitializeState.useGridInitializeState)(_useGridRowsMeta.rowsMetaStateInitializer, apiRef, props);
(0, _useGridInitializeState.useGridInitializeState)(_useGridListView.listViewStateInitializer, apiRef, props);
(0, _useGridKeyboardNavigation.useGridKeyboardNavigation)(apiRef, props);
(0, _useGridRowSelection.useGridRowSelection)(apiRef, props);
(0, _useGridColumns.useGridColumns)(apiRef, props);
(0, _useGridRows.useGridRows)(apiRef, props, configuration);
(0, _useGridRowSpanning.useGridRowSpanning)(apiRef, props);
(0, _useGridParamsApi.useGridParamsApi)(apiRef, props, configuration);
(0, _useGridColumnSpanning.useGridColumnSpanning)(apiRef);
(0, _useGridColumnGrouping.useGridColumnGrouping)(apiRef, props);
(0, _useGridEditing.useGridEditing)(apiRef, props, configuration);
(0, _useGridFocus.useGridFocus)(apiRef, props);
(0, _useGridPreferencesPanel.useGridPreferencesPanel)(apiRef, props);
(0, _useGridFilter.useGridFilter)(apiRef, props, configuration);
(0, _useGridSorting.useGridSorting)(apiRef, props);
(0, _useGridDensity.useGridDensity)(apiRef, props);
(0, _useGridColumnResize.useGridColumnResize)(apiRef, props);
(0, _useGridPagination.useGridPagination)(apiRef, props);
(0, _useGridScroll.useGridScroll)(apiRef, props);
(0, _useGridColumnMenu.useGridColumnMenu)(apiRef);
(0, _useGridCsvExport.useGridCsvExport)(apiRef, props);
(0, _useGridPrintExport.useGridPrintExport)(apiRef, props);
(0, _useGridClipboard.useGridClipboard)(apiRef, props);
(0, _useGridDimensions.useGridDimensions)(apiRef, props);
(0, _useGridEvents.useGridEvents)(apiRef, props);
(0, _useGridStatePersistence.useGridStatePersistence)(apiRef);
(0, _virtualization.useGridVirtualization)(apiRef, props);
(0, _useGridListView.useGridListView)(apiRef, props);
(0, _useGridDataSource.useGridDataSource)(apiRef, props);
// Should be the last thing to run, because all pre-processors should have been registered by now.
(0, _useFirstRender.useFirstRender)(() => {
apiRef.current.runAppliersForPendingProcessors();
});
React.useEffect(() => {
apiRef.current.runAppliersForPendingProcessors();
});
};
exports.useDataGridComponent = useDataGridComponent;
+104
View File
@@ -0,0 +1,104 @@
'use client';
import * as React from 'react';
import { useFirstRender } from '@mui/x-internals/useFirstRender';
import { useGridInitialization } from "../hooks/core/useGridInitialization.mjs";
import { useGridInitializeState } from "../hooks/utils/useGridInitializeState.mjs";
import { useGridClipboard } from "../hooks/features/clipboard/useGridClipboard.mjs";
import { columnMenuStateInitializer, useGridColumnMenu } from "../hooks/features/columnMenu/useGridColumnMenu.mjs";
import { useGridColumns, columnsStateInitializer } from "../hooks/features/columns/useGridColumns.mjs";
import { densityStateInitializer, useGridDensity } from "../hooks/features/density/useGridDensity.mjs";
import { useGridCsvExport } from "../hooks/features/export/useGridCsvExport.mjs";
import { useGridPrintExport } from "../hooks/features/export/useGridPrintExport.mjs";
import { useGridFilter, filterStateInitializer } from "../hooks/features/filter/useGridFilter.mjs";
import { focusStateInitializer, useGridFocus } from "../hooks/features/focus/useGridFocus.mjs";
import { useGridKeyboardNavigation } from "../hooks/features/keyboardNavigation/useGridKeyboardNavigation.mjs";
import { useGridPagination, paginationStateInitializer } from "../hooks/features/pagination/useGridPagination.mjs";
import { useGridPreferencesPanel, preferencePanelStateInitializer } from "../hooks/features/preferencesPanel/useGridPreferencesPanel.mjs";
import { useGridEditing, editingStateInitializer } from "../hooks/features/editing/useGridEditing.mjs";
import { useGridRows, rowsStateInitializer } from "../hooks/features/rows/useGridRows.mjs";
import { useGridRowsPreProcessors } from "../hooks/features/rows/useGridRowsPreProcessors.mjs";
import { useGridParamsApi } from "../hooks/features/rows/useGridParamsApi.mjs";
import { rowSelectionStateInitializer, useGridRowSelection } from "../hooks/features/rowSelection/useGridRowSelection.mjs";
import { useGridRowSelectionPreProcessors } from "../hooks/features/rowSelection/useGridRowSelectionPreProcessors.mjs";
import { useGridSorting, sortingStateInitializer } from "../hooks/features/sorting/useGridSorting.mjs";
import { useGridScroll } from "../hooks/features/scroll/useGridScroll.mjs";
import { useGridEvents } from "../hooks/features/events/useGridEvents.mjs";
import { dimensionsStateInitializer, useGridDimensions } from "../hooks/features/dimensions/useGridDimensions.mjs";
import { rowsMetaStateInitializer } from "../hooks/features/rows/useGridRowsMeta.mjs";
import { useGridStatePersistence } from "../hooks/features/statePersistence/useGridStatePersistence.mjs";
import { useGridColumnSpanning } from "../hooks/features/columns/useGridColumnSpanning.mjs";
import { useGridColumnGrouping, columnGroupsStateInitializer } from "../hooks/features/columnGrouping/useGridColumnGrouping.mjs";
import { useGridVirtualization, virtualizationStateInitializer } from "../hooks/features/virtualization/index.mjs";
import { columnResizeStateInitializer, useGridColumnResize } from "../hooks/features/columnResize/useGridColumnResize.mjs";
import { rowSpanningStateInitializer, useGridRowSpanning } from "../hooks/features/rows/useGridRowSpanning.mjs";
import { listViewStateInitializer, useGridListView } from "../hooks/features/listView/useGridListView.mjs";
import { propsStateInitializer } from "../hooks/core/useGridProps.mjs";
import { useGridDataSource } from "../hooks/features/dataSource/useGridDataSource.mjs";
export const useDataGridComponent = (apiRef, props, configuration) => {
useGridInitialization(apiRef, props);
/**
* Register all pre-processors called during state initialization here.
*/
useGridRowSelectionPreProcessors(apiRef, props);
useGridRowsPreProcessors(apiRef);
/**
* Register all state initializers here.
*/
useGridInitializeState(propsStateInitializer, apiRef, props);
useGridInitializeState(rowSelectionStateInitializer, apiRef, props);
useGridInitializeState(columnsStateInitializer, apiRef, props);
useGridInitializeState(rowsStateInitializer, apiRef, props);
useGridInitializeState(paginationStateInitializer, apiRef, props);
useGridInitializeState(editingStateInitializer, apiRef, props);
useGridInitializeState(focusStateInitializer, apiRef, props);
useGridInitializeState(sortingStateInitializer, apiRef, props);
useGridInitializeState(preferencePanelStateInitializer, apiRef, props);
useGridInitializeState(filterStateInitializer, apiRef, props);
useGridInitializeState(rowSpanningStateInitializer, apiRef, props);
useGridInitializeState(densityStateInitializer, apiRef, props);
useGridInitializeState(columnResizeStateInitializer, apiRef, props);
useGridInitializeState(columnMenuStateInitializer, apiRef, props);
useGridInitializeState(columnGroupsStateInitializer, apiRef, props);
useGridInitializeState(virtualizationStateInitializer, apiRef, props);
useGridInitializeState(dimensionsStateInitializer, apiRef, props);
useGridInitializeState(rowsMetaStateInitializer, apiRef, props);
useGridInitializeState(listViewStateInitializer, apiRef, props);
useGridKeyboardNavigation(apiRef, props);
useGridRowSelection(apiRef, props);
useGridColumns(apiRef, props);
useGridRows(apiRef, props, configuration);
useGridRowSpanning(apiRef, props);
useGridParamsApi(apiRef, props, configuration);
useGridColumnSpanning(apiRef);
useGridColumnGrouping(apiRef, props);
useGridEditing(apiRef, props, configuration);
useGridFocus(apiRef, props);
useGridPreferencesPanel(apiRef, props);
useGridFilter(apiRef, props, configuration);
useGridSorting(apiRef, props);
useGridDensity(apiRef, props);
useGridColumnResize(apiRef, props);
useGridPagination(apiRef, props);
useGridScroll(apiRef, props);
useGridColumnMenu(apiRef);
useGridCsvExport(apiRef, props);
useGridPrintExport(apiRef, props);
useGridClipboard(apiRef, props);
useGridDimensions(apiRef, props);
useGridEvents(apiRef, props);
useGridStatePersistence(apiRef);
useGridVirtualization(apiRef, props);
useGridListView(apiRef, props);
useGridDataSource(apiRef, props);
// Should be the last thing to run, because all pre-processors should have been registered by now.
useFirstRender(() => {
apiRef.current.runAppliersForPendingProcessors();
});
React.useEffect(() => {
apiRef.current.runAppliersForPendingProcessors();
});
};
@@ -0,0 +1,3 @@
import type { DataGridProcessedProps, DataGridProps } from "../models/props/DataGridProps.mjs";
import type { GridValidRowModel } from "../models/index.mjs";
export declare const useDataGridProps: <R extends GridValidRowModel>(inProps: DataGridProps<R>) => DataGridProcessedProps<R>;
+3
View File
@@ -0,0 +1,3 @@
import type { DataGridProcessedProps, DataGridProps } from "../models/props/DataGridProps.js";
import type { GridValidRowModel } from "../models/index.js";
export declare const useDataGridProps: <R extends GridValidRowModel>(inProps: DataGridProps<R>) => DataGridProcessedProps<R>;
+59
View File
@@ -0,0 +1,59 @@
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useDataGridProps = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var React = _interopRequireWildcard(require("react"));
var _styles = require("@mui/material/styles");
var _system = require("@mui/system");
var _constants = require("../constants");
var _defaultGridSlotsComponents = require("../constants/defaultGridSlotsComponents");
var _utils = require("../internals/utils");
var _dataGridPropsDefaultValues = require("../constants/dataGridPropsDefaultValues");
const DATA_GRID_FORCED_PROPS = {
disableMultipleColumnsFiltering: true,
disableMultipleColumnsSorting: true,
throttleRowsMs: undefined,
hideFooterRowCount: false,
pagination: true,
checkboxSelectionVisibleOnly: false,
disableColumnReorder: true,
keepColumnPositionIfDraggedOutside: false,
signature: 'DataGrid',
listView: false
};
const getDataGridForcedProps = themedProps => (0, _extends2.default)({}, DATA_GRID_FORCED_PROPS, themedProps.dataSource ? {
filterMode: 'server',
sortingMode: 'server',
paginationMode: 'server'
} : {});
const defaultSlots = _defaultGridSlotsComponents.DATA_GRID_DEFAULT_SLOTS_COMPONENTS;
const useDataGridProps = inProps => {
const theme = (0, _styles.useTheme)();
const themedProps = React.useMemo(() => (0, _system.getThemeProps)({
props: inProps,
theme,
name: 'MuiDataGrid'
}), [theme, inProps]);
const localeText = React.useMemo(() => (0, _extends2.default)({}, _constants.GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText), [themedProps.localeText]);
const slots = React.useMemo(() => (0, _utils.computeSlots)({
defaultSlots,
slots: themedProps.slots
}), [themedProps.slots]);
const injectDefaultProps = React.useMemo(() => {
return Object.keys(_dataGridPropsDefaultValues.DATA_GRID_PROPS_DEFAULT_VALUES).reduce((acc, key) => {
// @ts-ignore
acc[key] = themedProps[key] ?? _dataGridPropsDefaultValues.DATA_GRID_PROPS_DEFAULT_VALUES[key];
return acc;
}, {});
}, [themedProps]);
return React.useMemo(() => (0, _extends2.default)({}, themedProps, injectDefaultProps, {
localeText,
slots
}, getDataGridForcedProps(themedProps)), [themedProps, localeText, slots, injectDefaultProps]);
};
exports.useDataGridProps = useDataGridProps;
+50
View File
@@ -0,0 +1,50 @@
import _extends from "@babel/runtime/helpers/esm/extends";
import * as React from 'react';
import { useTheme } from '@mui/material/styles';
import { getThemeProps } from '@mui/system';
import { GRID_DEFAULT_LOCALE_TEXT } from "../constants/index.mjs";
import { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from "../constants/defaultGridSlotsComponents.mjs";
import { computeSlots } from "../internals/utils/index.mjs";
import { DATA_GRID_PROPS_DEFAULT_VALUES } from "../constants/dataGridPropsDefaultValues.mjs";
const DATA_GRID_FORCED_PROPS = {
disableMultipleColumnsFiltering: true,
disableMultipleColumnsSorting: true,
throttleRowsMs: undefined,
hideFooterRowCount: false,
pagination: true,
checkboxSelectionVisibleOnly: false,
disableColumnReorder: true,
keepColumnPositionIfDraggedOutside: false,
signature: 'DataGrid',
listView: false
};
const getDataGridForcedProps = themedProps => _extends({}, DATA_GRID_FORCED_PROPS, themedProps.dataSource ? {
filterMode: 'server',
sortingMode: 'server',
paginationMode: 'server'
} : {});
const defaultSlots = DATA_GRID_DEFAULT_SLOTS_COMPONENTS;
export const useDataGridProps = inProps => {
const theme = useTheme();
const themedProps = React.useMemo(() => getThemeProps({
props: inProps,
theme,
name: 'MuiDataGrid'
}), [theme, inProps]);
const localeText = React.useMemo(() => _extends({}, GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText), [themedProps.localeText]);
const slots = React.useMemo(() => computeSlots({
defaultSlots,
slots: themedProps.slots
}), [themedProps.slots]);
const injectDefaultProps = React.useMemo(() => {
return Object.keys(DATA_GRID_PROPS_DEFAULT_VALUES).reduce((acc, key) => {
// @ts-ignore
acc[key] = themedProps[key] ?? DATA_GRID_PROPS_DEFAULT_VALUES[key];
return acc;
}, {});
}, [themedProps]);
return React.useMemo(() => _extends({}, themedProps, injectDefaultProps, {
localeText,
slots
}, getDataGridForcedProps(themedProps)), [themedProps, localeText, slots, injectDefaultProps]);
};
+23
View File
@@ -0,0 +1,23 @@
# License
MIT License
Copyright (c) 2020 Material-UI SAS
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+16
View File
@@ -0,0 +1,16 @@
# MUI X Data Grid
This package is the Community plan edition of the Data Grid components.
It's part of [MUI X](https://mui.com/x/), an open-core extension of our Core libraries, with advanced components.
## Installation
Install the package in your project directory with:
```bash
npm install @mui/x-data-grid @mui/material @emotion/react @emotion/styled
```
## Documentation
Visit [https://mui.com/x/react-data-grid/](https://mui.com/x/react-data-grid/) to view the full documentation.
+3
View File
@@ -0,0 +1,3 @@
import type { GridColTypeDef } from "../models/colDef/gridColDef.mjs";
export declare const GRID_ACTIONS_COLUMN_TYPE = "actions";
export declare const GRID_ACTIONS_COL_DEF: GridColTypeDef;
+3
View File
@@ -0,0 +1,3 @@
import type { GridColTypeDef } from "../models/colDef/gridColDef.js";
export declare const GRID_ACTIONS_COLUMN_TYPE = "actions";
export declare const GRID_ACTIONS_COL_DEF: GridColTypeDef;
+27
View File
@@ -0,0 +1,27 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GRID_ACTIONS_COL_DEF = exports.GRID_ACTIONS_COLUMN_TYPE = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _gridStringColDef = require("./gridStringColDef");
var _GridActionsCell = require("../components/cell/GridActionsCell");
const GRID_ACTIONS_COLUMN_TYPE = exports.GRID_ACTIONS_COLUMN_TYPE = 'actions';
const GRID_ACTIONS_COL_DEF = exports.GRID_ACTIONS_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_STRING_COL_DEF, {
sortable: false,
filterable: false,
// @ts-ignore
aggregable: false,
chartable: false,
width: 100,
display: 'flex',
align: 'center',
headerAlign: 'center',
headerName: '',
disableColumnMenu: true,
disableExport: true,
renderCell: _GridActionsCell.renderActionsCell,
getApplyQuickFilterFn: () => null
});
+20
View File
@@ -0,0 +1,20 @@
import _extends from "@babel/runtime/helpers/esm/extends";
import { GRID_STRING_COL_DEF } from "./gridStringColDef.mjs";
import { renderActionsCell } from "../components/cell/GridActionsCell.mjs";
export const GRID_ACTIONS_COLUMN_TYPE = 'actions';
export const GRID_ACTIONS_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
sortable: false,
filterable: false,
// @ts-ignore
aggregable: false,
chartable: false,
width: 100,
display: 'flex',
align: 'center',
headerAlign: 'center',
headerName: '',
disableColumnMenu: true,
disableExport: true,
renderCell: renderActionsCell,
getApplyQuickFilterFn: () => null
});
+2
View File
@@ -0,0 +1,2 @@
import type { GridColTypeDef } from "../models/colDef/gridColDef.mjs";
export declare const GRID_BOOLEAN_COL_DEF: GridColTypeDef<boolean | null, any>;
+2
View File
@@ -0,0 +1,2 @@
import type { GridColTypeDef } from "../models/colDef/gridColDef.js";
export declare const GRID_BOOLEAN_COL_DEF: GridColTypeDef<boolean | null, any>;
+48
View File
@@ -0,0 +1,48 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GRID_BOOLEAN_COL_DEF = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _gridStringColDef = require("./gridStringColDef");
var _GridBooleanCell = require("../components/cell/GridBooleanCell");
var _GridEditBooleanCell = require("../components/cell/GridEditBooleanCell");
var _gridSortingUtils = require("../hooks/features/sorting/gridSortingUtils");
var _gridBooleanOperators = require("./gridBooleanOperators");
const gridBooleanFormatter = (value, row, column, apiRef) => {
return value ? apiRef.current.getLocaleText('booleanCellTrueLabel') : apiRef.current.getLocaleText('booleanCellFalseLabel');
};
const stringToBoolean = value => {
switch (value.toLowerCase().trim()) {
case 'true':
case 'yes':
case '1':
return true;
case 'false':
case 'no':
case '0':
case 'null':
case 'undefined':
return false;
default:
return undefined;
}
};
const GRID_BOOLEAN_COL_DEF = exports.GRID_BOOLEAN_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_STRING_COL_DEF, {
type: 'boolean',
display: 'flex',
align: 'center',
headerAlign: 'center',
renderCell: _GridBooleanCell.renderBooleanCell,
renderEditCell: _GridEditBooleanCell.renderEditBooleanCell,
sortComparator: _gridSortingUtils.gridNumberComparator,
valueFormatter: gridBooleanFormatter,
filterOperators: (0, _gridBooleanOperators.getGridBooleanOperators)(),
getApplyQuickFilterFn: () => null,
// @ts-ignore
chartable: false,
// @ts-ignore
pastedValueParser: value => stringToBoolean(value)
});
+41
View File
@@ -0,0 +1,41 @@
import _extends from "@babel/runtime/helpers/esm/extends";
import { GRID_STRING_COL_DEF } from "./gridStringColDef.mjs";
import { renderBooleanCell } from "../components/cell/GridBooleanCell.mjs";
import { renderEditBooleanCell } from "../components/cell/GridEditBooleanCell.mjs";
import { gridNumberComparator } from "../hooks/features/sorting/gridSortingUtils.mjs";
import { getGridBooleanOperators } from "./gridBooleanOperators.mjs";
const gridBooleanFormatter = (value, row, column, apiRef) => {
return value ? apiRef.current.getLocaleText('booleanCellTrueLabel') : apiRef.current.getLocaleText('booleanCellFalseLabel');
};
const stringToBoolean = value => {
switch (value.toLowerCase().trim()) {
case 'true':
case 'yes':
case '1':
return true;
case 'false':
case 'no':
case '0':
case 'null':
case 'undefined':
return false;
default:
return undefined;
}
};
export const GRID_BOOLEAN_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
type: 'boolean',
display: 'flex',
align: 'center',
headerAlign: 'center',
renderCell: renderBooleanCell,
renderEditCell: renderEditBooleanCell,
sortComparator: gridNumberComparator,
valueFormatter: gridBooleanFormatter,
filterOperators: getGridBooleanOperators(),
getApplyQuickFilterFn: () => null,
// @ts-ignore
chartable: false,
// @ts-ignore
pastedValueParser: value => stringToBoolean(value)
});
@@ -0,0 +1,2 @@
import type { GridFilterOperator } from "../models/gridFilterOperator.mjs";
export declare const getGridBooleanOperators: () => GridFilterOperator<any, boolean | null, any>[];
@@ -0,0 +1,2 @@
import type { GridFilterOperator } from "../models/gridFilterOperator.js";
export declare const getGridBooleanOperators: () => GridFilterOperator<any, boolean | null, any>[];
+19
View File
@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getGridBooleanOperators = void 0;
var _GridFilterInputBoolean = require("../components/panel/filterPanel/GridFilterInputBoolean");
const getGridBooleanOperators = () => [{
value: 'is',
getApplyFilterFn: filterItem => {
const sanitizedValue = (0, _GridFilterInputBoolean.sanitizeFilterItemValue)(filterItem.value);
if (sanitizedValue === undefined) {
return null;
}
return value => Boolean(value) === sanitizedValue;
},
InputComponent: _GridFilterInputBoolean.GridFilterInputBoolean
}];
exports.getGridBooleanOperators = getGridBooleanOperators;
+12
View File
@@ -0,0 +1,12 @@
import { GridFilterInputBoolean, sanitizeFilterItemValue } from "../components/panel/filterPanel/GridFilterInputBoolean.mjs";
export const getGridBooleanOperators = () => [{
value: 'is',
getApplyFilterFn: filterItem => {
const sanitizedValue = sanitizeFilterItemValue(filterItem.value);
if (sanitizedValue === undefined) {
return null;
}
return value => Boolean(value) === sanitizedValue;
},
InputComponent: GridFilterInputBoolean
}];
@@ -0,0 +1,3 @@
import type { GridColDef } from "../models/colDef/gridColDef.mjs";
export declare const GRID_CHECKBOX_SELECTION_FIELD = "__check__";
export declare const GRID_CHECKBOX_SELECTION_COL_DEF: GridColDef;
@@ -0,0 +1,3 @@
import type { GridColDef } from "../models/colDef/gridColDef.js";
export declare const GRID_CHECKBOX_SELECTION_FIELD = "__check__";
export declare const GRID_CHECKBOX_SELECTION_COL_DEF: GridColDef;
@@ -0,0 +1,37 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GRID_CHECKBOX_SELECTION_FIELD = exports.GRID_CHECKBOX_SELECTION_COL_DEF = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _GridCellCheckboxRenderer = require("../components/columnSelection/GridCellCheckboxRenderer");
var _GridHeaderCheckbox = require("../components/columnSelection/GridHeaderCheckbox");
var _gridBooleanColDef = require("./gridBooleanColDef");
var _gridPropsSelectors = require("../hooks/core/gridPropsSelectors");
var _jsxRuntime = require("react/jsx-runtime");
const GRID_CHECKBOX_SELECTION_FIELD = exports.GRID_CHECKBOX_SELECTION_FIELD = '__check__';
const GRID_CHECKBOX_SELECTION_COL_DEF = exports.GRID_CHECKBOX_SELECTION_COL_DEF = (0, _extends2.default)({}, _gridBooleanColDef.GRID_BOOLEAN_COL_DEF, {
type: 'custom',
field: GRID_CHECKBOX_SELECTION_FIELD,
width: 50,
resizable: false,
sortable: false,
filterable: false,
// @ts-ignore
aggregable: false,
chartable: false,
disableColumnMenu: true,
disableReorder: true,
disableExport: true,
getApplyQuickFilterFn: () => null,
display: 'flex',
valueGetter: (value, row, column, apiRef) => {
const rowId = (0, _gridPropsSelectors.gridRowIdSelector)(apiRef, row);
return apiRef.current.isRowSelected(rowId);
},
rowSpanValueGetter: (_, row, column, apiRef) => (0, _gridPropsSelectors.gridRowIdSelector)(apiRef, row),
renderHeader: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridHeaderCheckbox.GridHeaderCheckbox, (0, _extends2.default)({}, params)),
renderCell: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridCellCheckboxRenderer.GridCellCheckboxRenderer, (0, _extends2.default)({}, params))
});
@@ -0,0 +1,30 @@
import _extends from "@babel/runtime/helpers/esm/extends";
import { GridCellCheckboxRenderer } from "../components/columnSelection/GridCellCheckboxRenderer.mjs";
import { GridHeaderCheckbox } from "../components/columnSelection/GridHeaderCheckbox.mjs";
import { GRID_BOOLEAN_COL_DEF } from "./gridBooleanColDef.mjs";
import { gridRowIdSelector } from "../hooks/core/gridPropsSelectors.mjs";
import { jsx as _jsx } from "react/jsx-runtime";
export const GRID_CHECKBOX_SELECTION_FIELD = '__check__';
export const GRID_CHECKBOX_SELECTION_COL_DEF = _extends({}, GRID_BOOLEAN_COL_DEF, {
type: 'custom',
field: GRID_CHECKBOX_SELECTION_FIELD,
width: 50,
resizable: false,
sortable: false,
filterable: false,
// @ts-ignore
aggregable: false,
chartable: false,
disableColumnMenu: true,
disableReorder: true,
disableExport: true,
getApplyQuickFilterFn: () => null,
display: 'flex',
valueGetter: (value, row, column, apiRef) => {
const rowId = gridRowIdSelector(apiRef, row);
return apiRef.current.isRowSelected(rowId);
},
rowSpanValueGetter: (_, row, column, apiRef) => gridRowIdSelector(apiRef, row),
renderHeader: params => /*#__PURE__*/_jsx(GridHeaderCheckbox, _extends({}, params)),
renderCell: params => /*#__PURE__*/_jsx(GridCellCheckboxRenderer, _extends({}, params))
});
@@ -0,0 +1,8 @@
import type { GridColType } from "../models/colDef/gridColType.mjs";
import type { GridColTypeDef } from "../models/colDef/gridColDef.mjs";
import type { GridColumnTypesRecord } from "../models/colDef/gridColumnTypesRecord.mjs";
export declare const DEFAULT_GRID_COL_TYPE_KEY = "string";
export declare const isCommunityColumnType: (type: GridColType | undefined) => boolean;
export declare const registerGridColumnTypes: (columnTypes: Partial<GridColumnTypesRecord>) => void;
export declare const getGridColumnTypesRegistry: () => Record<string, GridColTypeDef>;
export declare const getRegisteredColumnTypeDef: (type: GridColType | undefined) => GridColTypeDef;
@@ -0,0 +1,8 @@
import type { GridColType } from "../models/colDef/gridColType.js";
import type { GridColTypeDef } from "../models/colDef/gridColDef.js";
import type { GridColumnTypesRecord } from "../models/colDef/gridColumnTypesRecord.js";
export declare const DEFAULT_GRID_COL_TYPE_KEY = "string";
export declare const isCommunityColumnType: (type: GridColType | undefined) => boolean;
export declare const registerGridColumnTypes: (columnTypes: Partial<GridColumnTypesRecord>) => void;
export declare const getGridColumnTypesRegistry: () => Record<string, GridColTypeDef>;
export declare const getRegisteredColumnTypeDef: (type: GridColType | undefined) => GridColTypeDef;
@@ -0,0 +1,44 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.registerGridColumnTypes = exports.isCommunityColumnType = exports.getRegisteredColumnTypeDef = exports.getGridColumnTypesRegistry = exports.DEFAULT_GRID_COL_TYPE_KEY = void 0;
var _gridStringColDef = require("./gridStringColDef");
var _gridNumericColDef = require("./gridNumericColDef");
var _gridDateColDef = require("./gridDateColDef");
var _gridBooleanColDef = require("./gridBooleanColDef");
var _gridSingleSelectColDef = require("./gridSingleSelectColDef");
var _gridActionsColDef = require("./gridActionsColDef");
var _gridLongTextColDef = require("./gridLongTextColDef");
const DEFAULT_GRID_COL_TYPE_KEY = exports.DEFAULT_GRID_COL_TYPE_KEY = 'string';
// Mutable registry seeded with the community column types. Pro/Premium packages append
// their own types at module load via `registerGridColumnTypes`, so a community-only bundle
// never references them at runtime.
const columnTypesRegistry = {
string: _gridStringColDef.GRID_STRING_COL_DEF,
number: _gridNumericColDef.GRID_NUMERIC_COL_DEF,
date: _gridDateColDef.GRID_DATE_COL_DEF,
dateTime: _gridDateColDef.GRID_DATETIME_COL_DEF,
boolean: _gridBooleanColDef.GRID_BOOLEAN_COL_DEF,
singleSelect: _gridSingleSelectColDef.GRID_SINGLE_SELECT_COL_DEF,
[_gridActionsColDef.GRID_ACTIONS_COLUMN_TYPE]: _gridActionsColDef.GRID_ACTIONS_COL_DEF,
custom: _gridStringColDef.GRID_STRING_COL_DEF,
longText: _gridLongTextColDef.GRID_LONG_TEXT_COL_DEF
};
// Captured before any `registerGridColumnTypes` call, so it reflects the community-native types
// only. Used to keep Pro/Premium-registered types (e.g. `multiSelect`) from resolving in a
// community `DataGrid` even when a Pro grid registered them globally in the same bundle.
const COMMUNITY_COLUMN_TYPE_KEYS = new Set(Object.keys(columnTypesRegistry));
const isCommunityColumnType = type => type == null || COMMUNITY_COLUMN_TYPE_KEYS.has(type);
exports.isCommunityColumnType = isCommunityColumnType;
const registerGridColumnTypes = columnTypes => {
Object.assign(columnTypesRegistry, columnTypes);
};
exports.registerGridColumnTypes = registerGridColumnTypes;
const getGridColumnTypesRegistry = () => columnTypesRegistry;
exports.getGridColumnTypesRegistry = getGridColumnTypesRegistry;
const getRegisteredColumnTypeDef = type => (type ? columnTypesRegistry[type] : undefined) ?? columnTypesRegistry[DEFAULT_GRID_COL_TYPE_KEY];
exports.getRegisteredColumnTypeDef = getRegisteredColumnTypeDef;
@@ -0,0 +1,34 @@
import { GRID_STRING_COL_DEF } from "./gridStringColDef.mjs";
import { GRID_NUMERIC_COL_DEF } from "./gridNumericColDef.mjs";
import { GRID_DATE_COL_DEF, GRID_DATETIME_COL_DEF } from "./gridDateColDef.mjs";
import { GRID_BOOLEAN_COL_DEF } from "./gridBooleanColDef.mjs";
import { GRID_SINGLE_SELECT_COL_DEF } from "./gridSingleSelectColDef.mjs";
import { GRID_ACTIONS_COL_DEF, GRID_ACTIONS_COLUMN_TYPE } from "./gridActionsColDef.mjs";
import { GRID_LONG_TEXT_COL_DEF } from "./gridLongTextColDef.mjs";
export const DEFAULT_GRID_COL_TYPE_KEY = 'string';
// Mutable registry seeded with the community column types. Pro/Premium packages append
// their own types at module load via `registerGridColumnTypes`, so a community-only bundle
// never references them at runtime.
const columnTypesRegistry = {
string: GRID_STRING_COL_DEF,
number: GRID_NUMERIC_COL_DEF,
date: GRID_DATE_COL_DEF,
dateTime: GRID_DATETIME_COL_DEF,
boolean: GRID_BOOLEAN_COL_DEF,
singleSelect: GRID_SINGLE_SELECT_COL_DEF,
[GRID_ACTIONS_COLUMN_TYPE]: GRID_ACTIONS_COL_DEF,
custom: GRID_STRING_COL_DEF,
longText: GRID_LONG_TEXT_COL_DEF
};
// Captured before any `registerGridColumnTypes` call, so it reflects the community-native types
// only. Used to keep Pro/Premium-registered types (e.g. `multiSelect`) from resolving in a
// community `DataGrid` even when a Pro grid registered them globally in the same bundle.
const COMMUNITY_COLUMN_TYPE_KEYS = new Set(Object.keys(columnTypesRegistry));
export const isCommunityColumnType = type => type == null || COMMUNITY_COLUMN_TYPE_KEYS.has(type);
export const registerGridColumnTypes = columnTypes => {
Object.assign(columnTypesRegistry, columnTypes);
};
export const getGridColumnTypesRegistry = () => columnTypesRegistry;
export const getRegisteredColumnTypeDef = type => (type ? columnTypesRegistry[type] : undefined) ?? columnTypesRegistry[DEFAULT_GRID_COL_TYPE_KEY];
+5
View File
@@ -0,0 +1,5 @@
import type { GridColTypeDef, GridValueFormatter } from "../models/colDef/gridColDef.mjs";
export declare const gridDateFormatter: GridValueFormatter;
export declare const gridDateTimeFormatter: GridValueFormatter;
export declare const GRID_DATE_COL_DEF: GridColTypeDef<Date, string>;
export declare const GRID_DATETIME_COL_DEF: GridColTypeDef<Date, string>;
+5
View File
@@ -0,0 +1,5 @@
import type { GridColTypeDef, GridValueFormatter } from "../models/colDef/gridColDef.js";
export declare const gridDateFormatter: GridValueFormatter;
export declare const gridDateTimeFormatter: GridValueFormatter;
export declare const GRID_DATE_COL_DEF: GridColTypeDef<Date, string>;
export declare const GRID_DATETIME_COL_DEF: GridColTypeDef<Date, string>;
+77
View File
@@ -0,0 +1,77 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.gridDateTimeFormatter = exports.gridDateFormatter = exports.GRID_DATE_COL_DEF = exports.GRID_DATETIME_COL_DEF = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _formatErrorMessage2 = _interopRequireDefault(require("@mui/x-internals/formatErrorMessage"));
var _gridSortingUtils = require("../hooks/features/sorting/gridSortingUtils");
var _gridDateOperators = require("./gridDateOperators");
var _gridStringColDef = require("./gridStringColDef");
var _GridEditDateCell = require("../components/cell/GridEditDateCell");
var _gridPropsSelectors = require("../hooks/core/gridPropsSelectors");
var _gridRowsUtils = require("../hooks/features/rows/gridRowsUtils");
function throwIfNotDateObject({
value,
columnType,
rowId,
field
}) {
if (!(value instanceof Date)) {
throw new Error(process.env.NODE_ENV !== "production" ? `MUI X Data Grid: The "${columnType}" column type only accepts Date objects as values. ` + `Received value of type "${typeof value}" for row ID "${rowId}", field "${field}". ` + 'Use valueGetter to transform the value into a Date object.' : (0, _formatErrorMessage2.default)(54, columnType, typeof value, rowId, field));
}
}
const gridDateFormatter = (value, row, column, apiRef) => {
if (!value) {
return '';
}
const rowId = (0, _gridPropsSelectors.gridRowIdSelector)(apiRef, row);
if ((0, _gridRowsUtils.isAutogeneratedRow)(row) && !(value instanceof Date)) {
return value;
}
throwIfNotDateObject({
value,
columnType: 'date',
rowId,
field: column.field
});
return value.toLocaleDateString();
};
exports.gridDateFormatter = gridDateFormatter;
const gridDateTimeFormatter = (value, row, column, apiRef) => {
if (!value) {
return '';
}
const rowId = (0, _gridPropsSelectors.gridRowIdSelector)(apiRef, row);
if ((0, _gridRowsUtils.isAutogeneratedRow)(row) && !(value instanceof Date)) {
return value;
}
throwIfNotDateObject({
value,
columnType: 'dateTime',
rowId,
field: column.field
});
return value.toLocaleString();
};
exports.gridDateTimeFormatter = gridDateTimeFormatter;
const GRID_DATE_COL_DEF = exports.GRID_DATE_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_STRING_COL_DEF, {
type: 'date',
sortComparator: _gridSortingUtils.gridDateComparator,
valueFormatter: gridDateFormatter,
filterOperators: (0, _gridDateOperators.getGridDateOperators)(),
renderEditCell: _GridEditDateCell.renderEditDateCell,
// @ts-ignore
pastedValueParser: value => new Date(value)
});
const GRID_DATETIME_COL_DEF = exports.GRID_DATETIME_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_STRING_COL_DEF, {
type: 'dateTime',
sortComparator: _gridSortingUtils.gridDateComparator,
valueFormatter: gridDateTimeFormatter,
filterOperators: (0, _gridDateOperators.getGridDateOperators)(true),
renderEditCell: _GridEditDateCell.renderEditDateCell,
// @ts-ignore
pastedValueParser: value => new Date(value)
});
+68
View File
@@ -0,0 +1,68 @@
import _extends from "@babel/runtime/helpers/esm/extends";
import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
import { gridDateComparator } from "../hooks/features/sorting/gridSortingUtils.mjs";
import { getGridDateOperators } from "./gridDateOperators.mjs";
import { GRID_STRING_COL_DEF } from "./gridStringColDef.mjs";
import { renderEditDateCell } from "../components/cell/GridEditDateCell.mjs";
import { gridRowIdSelector } from "../hooks/core/gridPropsSelectors.mjs";
import { isAutogeneratedRow } from "../hooks/features/rows/gridRowsUtils.mjs";
function throwIfNotDateObject({
value,
columnType,
rowId,
field
}) {
if (!(value instanceof Date)) {
throw new Error(process.env.NODE_ENV !== "production" ? `MUI X Data Grid: The "${columnType}" column type only accepts Date objects as values. ` + `Received value of type "${typeof value}" for row ID "${rowId}", field "${field}". ` + 'Use valueGetter to transform the value into a Date object.' : _formatErrorMessage(54, columnType, typeof value, rowId, field));
}
}
export const gridDateFormatter = (value, row, column, apiRef) => {
if (!value) {
return '';
}
const rowId = gridRowIdSelector(apiRef, row);
if (isAutogeneratedRow(row) && !(value instanceof Date)) {
return value;
}
throwIfNotDateObject({
value,
columnType: 'date',
rowId,
field: column.field
});
return value.toLocaleDateString();
};
export const gridDateTimeFormatter = (value, row, column, apiRef) => {
if (!value) {
return '';
}
const rowId = gridRowIdSelector(apiRef, row);
if (isAutogeneratedRow(row) && !(value instanceof Date)) {
return value;
}
throwIfNotDateObject({
value,
columnType: 'dateTime',
rowId,
field: column.field
});
return value.toLocaleString();
};
export const GRID_DATE_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
type: 'date',
sortComparator: gridDateComparator,
valueFormatter: gridDateFormatter,
filterOperators: getGridDateOperators(),
renderEditCell: renderEditDateCell,
// @ts-ignore
pastedValueParser: value => new Date(value)
});
export const GRID_DATETIME_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
type: 'dateTime',
sortComparator: gridDateComparator,
valueFormatter: gridDateTimeFormatter,
filterOperators: getGridDateOperators(true),
renderEditCell: renderEditDateCell,
// @ts-ignore
pastedValueParser: value => new Date(value)
});
+3
View File
@@ -0,0 +1,3 @@
import type { GridFilterInputDateProps } from "../components/panel/filterPanel/GridFilterInputDate.mjs";
import type { GridFilterOperator } from "../models/gridFilterOperator.mjs";
export declare const getGridDateOperators: (showTime?: boolean) => GridFilterOperator<any, Date, any, GridFilterInputDateProps>[];
+3
View File
@@ -0,0 +1,3 @@
import type { GridFilterInputDateProps } from "../components/panel/filterPanel/GridFilterInputDate.js";
import type { GridFilterOperator } from "../models/gridFilterOperator.js";
export declare const getGridDateOperators: (showTime?: boolean) => GridFilterOperator<any, Date, any, GridFilterInputDateProps>[];
+115
View File
@@ -0,0 +1,115 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getGridDateOperators = void 0;
var _GridFilterInputDate = require("../components/panel/filterPanel/GridFilterInputDate");
function buildApplyFilterFn(filterItem, compareFn, showTime, keepRawComparison) {
if (!filterItem.value) {
return null;
}
const date = new Date(filterItem.value);
if (showTime) {
date.setSeconds(0, 0);
} else {
// In GMT-X timezone, the date will be one day behind.
// For 2022-08-16:
// GMT+2: Tue Aug 16 2022 02:00:00 GMT+0200
// GMT-4: Mon Aug 15 2022 20:00:00 GMT-0400
//
// We need to add the offset before resetting the hours.
date.setMinutes(date.getMinutes() + date.getTimezoneOffset());
date.setHours(0, 0, 0, 0);
}
const time = date.getTime();
return value => {
if (!value) {
return false;
}
if (keepRawComparison) {
return compareFn(value.getTime(), time);
}
// Make a copy of the date to not reset the hours in the original object
const dateCopy = new Date(value);
if (showTime) {
dateCopy.setSeconds(0, 0);
} else {
dateCopy.setHours(0, 0, 0, 0);
}
return compareFn(dateCopy.getTime(), time);
};
}
const getGridDateOperators = showTime => [{
value: 'is',
getApplyFilterFn: filterItem => {
return buildApplyFilterFn(filterItem, (value1, value2) => value1 === value2, showTime);
},
InputComponent: _GridFilterInputDate.GridFilterInputDate,
InputComponentProps: {
type: showTime ? 'datetime-local' : 'date'
}
}, {
value: 'not',
getApplyFilterFn: filterItem => {
return buildApplyFilterFn(filterItem, (value1, value2) => value1 !== value2, showTime);
},
InputComponent: _GridFilterInputDate.GridFilterInputDate,
InputComponentProps: {
type: showTime ? 'datetime-local' : 'date'
}
}, {
value: 'after',
getApplyFilterFn: filterItem => {
return buildApplyFilterFn(filterItem, (value1, value2) => value1 > value2, showTime, showTime);
},
InputComponent: _GridFilterInputDate.GridFilterInputDate,
InputComponentProps: {
type: showTime ? 'datetime-local' : 'date'
}
}, {
value: 'onOrAfter',
getApplyFilterFn: filterItem => {
return buildApplyFilterFn(filterItem, (value1, value2) => value1 >= value2, showTime, showTime);
},
InputComponent: _GridFilterInputDate.GridFilterInputDate,
InputComponentProps: {
type: showTime ? 'datetime-local' : 'date'
}
}, {
value: 'before',
getApplyFilterFn: filterItem => {
return buildApplyFilterFn(filterItem, (value1, value2) => value1 < value2, showTime, true);
},
InputComponent: _GridFilterInputDate.GridFilterInputDate,
InputComponentProps: {
type: showTime ? 'datetime-local' : 'date'
}
}, {
value: 'onOrBefore',
getApplyFilterFn: filterItem => {
return buildApplyFilterFn(filterItem, (value1, value2) => value1 <= value2, showTime, showTime);
},
InputComponent: _GridFilterInputDate.GridFilterInputDate,
InputComponentProps: {
type: showTime ? 'datetime-local' : 'date'
}
}, {
value: 'isEmpty',
getApplyFilterFn: () => {
return value => {
return value == null;
};
},
requiresFilterValue: false
}, {
value: 'isNotEmpty',
getApplyFilterFn: () => {
return value => {
return value != null;
};
},
requiresFilterValue: false
}];
exports.getGridDateOperators = getGridDateOperators;
+108
View File
@@ -0,0 +1,108 @@
import { GridFilterInputDate } from "../components/panel/filterPanel/GridFilterInputDate.mjs";
function buildApplyFilterFn(filterItem, compareFn, showTime, keepRawComparison) {
if (!filterItem.value) {
return null;
}
const date = new Date(filterItem.value);
if (showTime) {
date.setSeconds(0, 0);
} else {
// In GMT-X timezone, the date will be one day behind.
// For 2022-08-16:
// GMT+2: Tue Aug 16 2022 02:00:00 GMT+0200
// GMT-4: Mon Aug 15 2022 20:00:00 GMT-0400
//
// We need to add the offset before resetting the hours.
date.setMinutes(date.getMinutes() + date.getTimezoneOffset());
date.setHours(0, 0, 0, 0);
}
const time = date.getTime();
return value => {
if (!value) {
return false;
}
if (keepRawComparison) {
return compareFn(value.getTime(), time);
}
// Make a copy of the date to not reset the hours in the original object
const dateCopy = new Date(value);
if (showTime) {
dateCopy.setSeconds(0, 0);
} else {
dateCopy.setHours(0, 0, 0, 0);
}
return compareFn(dateCopy.getTime(), time);
};
}
export const getGridDateOperators = showTime => [{
value: 'is',
getApplyFilterFn: filterItem => {
return buildApplyFilterFn(filterItem, (value1, value2) => value1 === value2, showTime);
},
InputComponent: GridFilterInputDate,
InputComponentProps: {
type: showTime ? 'datetime-local' : 'date'
}
}, {
value: 'not',
getApplyFilterFn: filterItem => {
return buildApplyFilterFn(filterItem, (value1, value2) => value1 !== value2, showTime);
},
InputComponent: GridFilterInputDate,
InputComponentProps: {
type: showTime ? 'datetime-local' : 'date'
}
}, {
value: 'after',
getApplyFilterFn: filterItem => {
return buildApplyFilterFn(filterItem, (value1, value2) => value1 > value2, showTime, showTime);
},
InputComponent: GridFilterInputDate,
InputComponentProps: {
type: showTime ? 'datetime-local' : 'date'
}
}, {
value: 'onOrAfter',
getApplyFilterFn: filterItem => {
return buildApplyFilterFn(filterItem, (value1, value2) => value1 >= value2, showTime, showTime);
},
InputComponent: GridFilterInputDate,
InputComponentProps: {
type: showTime ? 'datetime-local' : 'date'
}
}, {
value: 'before',
getApplyFilterFn: filterItem => {
return buildApplyFilterFn(filterItem, (value1, value2) => value1 < value2, showTime, true);
},
InputComponent: GridFilterInputDate,
InputComponentProps: {
type: showTime ? 'datetime-local' : 'date'
}
}, {
value: 'onOrBefore',
getApplyFilterFn: filterItem => {
return buildApplyFilterFn(filterItem, (value1, value2) => value1 <= value2, showTime, showTime);
},
InputComponent: GridFilterInputDate,
InputComponentProps: {
type: showTime ? 'datetime-local' : 'date'
}
}, {
value: 'isEmpty',
getApplyFilterFn: () => {
return value => {
return value == null;
};
},
requiresFilterValue: false
}, {
value: 'isNotEmpty',
getApplyFilterFn: () => {
return value => {
return value != null;
};
},
requiresFilterValue: false
}];
@@ -0,0 +1,3 @@
import type { GridColumnTypesRecord } from "../models/colDef/gridColumnTypesRecord.mjs";
export { DEFAULT_GRID_COL_TYPE_KEY } from "./gridColumnTypesRegistry.mjs";
export declare const getGridDefaultColumnTypes: () => GridColumnTypesRecord;
@@ -0,0 +1,3 @@
import type { GridColumnTypesRecord } from "../models/colDef/gridColumnTypesRecord.js";
export { DEFAULT_GRID_COL_TYPE_KEY } from "./gridColumnTypesRegistry.js";
export declare const getGridDefaultColumnTypes: () => GridColumnTypesRecord;
+17
View File
@@ -0,0 +1,17 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "DEFAULT_GRID_COL_TYPE_KEY", {
enumerable: true,
get: function () {
return _gridColumnTypesRegistry.DEFAULT_GRID_COL_TYPE_KEY;
}
});
exports.getGridDefaultColumnTypes = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _gridColumnTypesRegistry = require("./gridColumnTypesRegistry");
const getGridDefaultColumnTypes = () => (0, _extends2.default)({}, (0, _gridColumnTypesRegistry.getGridColumnTypesRegistry)());
exports.getGridDefaultColumnTypes = getGridDefaultColumnTypes;
@@ -0,0 +1,4 @@
import _extends from "@babel/runtime/helpers/esm/extends";
import { getGridColumnTypesRegistry } from "./gridColumnTypesRegistry.mjs";
export { DEFAULT_GRID_COL_TYPE_KEY } from "./gridColumnTypesRegistry.mjs";
export const getGridDefaultColumnTypes = () => _extends({}, getGridColumnTypesRegistry());
@@ -0,0 +1,2 @@
import type { GridColTypeDef } from "../models/colDef/gridColDef.mjs";
export declare const GRID_LONG_TEXT_COL_DEF: GridColTypeDef<string | null, any>;
+2
View File
@@ -0,0 +1,2 @@
import type { GridColTypeDef } from "../models/colDef/gridColDef.js";
export declare const GRID_LONG_TEXT_COL_DEF: GridColTypeDef<string | null, any>;
+17
View File
@@ -0,0 +1,17 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GRID_LONG_TEXT_COL_DEF = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _gridStringColDef = require("./gridStringColDef");
var _GridLongTextCell = require("../components/cell/GridLongTextCell");
var _GridEditLongTextCell = require("../components/cell/GridEditLongTextCell");
const GRID_LONG_TEXT_COL_DEF = exports.GRID_LONG_TEXT_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_STRING_COL_DEF, {
type: 'longText',
display: 'flex',
renderCell: _GridLongTextCell.renderLongTextCell,
renderEditCell: _GridEditLongTextCell.renderEditLongTextCell
});
+10
View File
@@ -0,0 +1,10 @@
import _extends from "@babel/runtime/helpers/esm/extends";
import { GRID_STRING_COL_DEF } from "./gridStringColDef.mjs";
import { renderLongTextCell } from "../components/cell/GridLongTextCell.mjs";
import { renderEditLongTextCell } from "../components/cell/GridEditLongTextCell.mjs";
export const GRID_LONG_TEXT_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
type: 'longText',
display: 'flex',
renderCell: renderLongTextCell,
renderEditCell: renderEditLongTextCell
});
+2
View File
@@ -0,0 +1,2 @@
import type { GridColTypeDef } from "../models/colDef/gridColDef.mjs";
export declare const GRID_NUMERIC_COL_DEF: GridColTypeDef<number | string | null, string>;
+2
View File
@@ -0,0 +1,2 @@
import type { GridColTypeDef } from "../models/colDef/gridColDef.js";
export declare const GRID_NUMERIC_COL_DEF: GridColTypeDef<number | string | null, string>;
+22
View File
@@ -0,0 +1,22 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GRID_NUMERIC_COL_DEF = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _gridSortingUtils = require("../hooks/features/sorting/gridSortingUtils");
var _utils = require("../utils/utils");
var _gridNumericOperators = require("./gridNumericOperators");
var _gridStringColDef = require("./gridStringColDef");
const GRID_NUMERIC_COL_DEF = exports.GRID_NUMERIC_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_STRING_COL_DEF, {
type: 'number',
align: 'right',
headerAlign: 'right',
sortComparator: _gridSortingUtils.gridNumberComparator,
valueParser: value => value === '' ? null : Number(value),
valueFormatter: value => (0, _utils.isNumber)(value) ? value.toLocaleString() : value || '',
filterOperators: (0, _gridNumericOperators.getGridNumericOperators)(),
getApplyQuickFilterFn: _gridNumericOperators.getGridNumericQuickFilterFn
});
+15
View File
@@ -0,0 +1,15 @@
import _extends from "@babel/runtime/helpers/esm/extends";
import { gridNumberComparator } from "../hooks/features/sorting/gridSortingUtils.mjs";
import { isNumber } from "../utils/utils.mjs";
import { getGridNumericOperators, getGridNumericQuickFilterFn } from "./gridNumericOperators.mjs";
import { GRID_STRING_COL_DEF } from "./gridStringColDef.mjs";
export const GRID_NUMERIC_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
type: 'number',
align: 'right',
headerAlign: 'right',
sortComparator: gridNumberComparator,
valueParser: value => value === '' ? null : Number(value),
valueFormatter: value => isNumber(value) ? value.toLocaleString() : value || '',
filterOperators: getGridNumericOperators(),
getApplyQuickFilterFn: getGridNumericQuickFilterFn
});
@@ -0,0 +1,7 @@
import type { GridFilterOperator } from "../models/gridFilterOperator.mjs";
import type { GridFilterInputValueProps } from "../models/gridFilterInputComponent.mjs";
import type { GetApplyQuickFilterFn } from "../models/colDef/gridColDef.mjs";
export declare const getGridNumericQuickFilterFn: GetApplyQuickFilterFn<any, number | string | null>;
export declare const getGridNumericOperators: () => GridFilterOperator<any, number | string | null, any, GridFilterInputValueProps & {
type?: 'number';
}>[];
@@ -0,0 +1,7 @@
import type { GridFilterOperator } from "../models/gridFilterOperator.js";
import type { GridFilterInputValueProps } from "../models/gridFilterInputComponent.js";
import type { GetApplyQuickFilterFn } from "../models/colDef/gridColDef.js";
export declare const getGridNumericQuickFilterFn: GetApplyQuickFilterFn<any, number | string | null>;
export declare const getGridNumericOperators: () => GridFilterOperator<any, number | string | null, any, GridFilterInputValueProps & {
type?: 'number';
}>[];
+151
View File
@@ -0,0 +1,151 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getGridNumericQuickFilterFn = exports.getGridNumericOperators = void 0;
var _GridFilterInputValue = require("../components/panel/filterPanel/GridFilterInputValue");
var _GridFilterInputMultipleValue = require("../components/panel/filterPanel/GridFilterInputMultipleValue");
const parseNumericValue = value => {
if (value == null) {
return null;
}
return Number(value);
};
const getGridNumericQuickFilterFn = value => {
if (value == null || Number.isNaN(value) || value === '') {
return null;
}
return columnValue => {
return parseNumericValue(columnValue) === parseNumericValue(value);
};
};
exports.getGridNumericQuickFilterFn = getGridNumericQuickFilterFn;
const getGridNumericOperators = () => [{
value: '=',
getApplyFilterFn: filterItem => {
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
return null;
}
return value => {
return parseNumericValue(value) === filterItem.value;
};
},
InputComponent: _GridFilterInputValue.GridFilterInputValue,
InputComponentProps: {
type: 'number'
}
}, {
value: '!=',
getApplyFilterFn: filterItem => {
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
return null;
}
return value => {
return parseNumericValue(value) !== filterItem.value;
};
},
InputComponent: _GridFilterInputValue.GridFilterInputValue,
InputComponentProps: {
type: 'number'
}
}, {
value: '>',
getApplyFilterFn: filterItem => {
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
return null;
}
return value => {
if (value == null) {
return false;
}
return parseNumericValue(value) > filterItem.value;
};
},
InputComponent: _GridFilterInputValue.GridFilterInputValue,
InputComponentProps: {
type: 'number'
}
}, {
value: '>=',
getApplyFilterFn: filterItem => {
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
return null;
}
return value => {
if (value == null) {
return false;
}
return parseNumericValue(value) >= filterItem.value;
};
},
InputComponent: _GridFilterInputValue.GridFilterInputValue,
InputComponentProps: {
type: 'number'
}
}, {
value: '<',
getApplyFilterFn: filterItem => {
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
return null;
}
return value => {
if (value == null) {
return false;
}
return parseNumericValue(value) < filterItem.value;
};
},
InputComponent: _GridFilterInputValue.GridFilterInputValue,
InputComponentProps: {
type: 'number'
}
}, {
value: '<=',
getApplyFilterFn: filterItem => {
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
return null;
}
return value => {
if (value == null) {
return false;
}
return parseNumericValue(value) <= filterItem.value;
};
},
InputComponent: _GridFilterInputValue.GridFilterInputValue,
InputComponentProps: {
type: 'number'
}
}, {
value: 'isEmpty',
getApplyFilterFn: () => {
return value => {
return value == null;
};
},
requiresFilterValue: false
}, {
value: 'isNotEmpty',
getApplyFilterFn: () => {
return value => {
return value != null;
};
},
requiresFilterValue: false
}, {
value: 'isAnyOf',
getApplyFilterFn: filterItem => {
if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {
return null;
}
return value => {
return value != null && filterItem.value.includes(Number(value));
};
},
InputComponent: _GridFilterInputMultipleValue.GridFilterInputMultipleValue,
InputComponentProps: {
type: 'number'
}
}];
exports.getGridNumericOperators = getGridNumericOperators;
+143
View File
@@ -0,0 +1,143 @@
import { GridFilterInputValue } from "../components/panel/filterPanel/GridFilterInputValue.mjs";
import { GridFilterInputMultipleValue } from "../components/panel/filterPanel/GridFilterInputMultipleValue.mjs";
const parseNumericValue = value => {
if (value == null) {
return null;
}
return Number(value);
};
export const getGridNumericQuickFilterFn = value => {
if (value == null || Number.isNaN(value) || value === '') {
return null;
}
return columnValue => {
return parseNumericValue(columnValue) === parseNumericValue(value);
};
};
export const getGridNumericOperators = () => [{
value: '=',
getApplyFilterFn: filterItem => {
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
return null;
}
return value => {
return parseNumericValue(value) === filterItem.value;
};
},
InputComponent: GridFilterInputValue,
InputComponentProps: {
type: 'number'
}
}, {
value: '!=',
getApplyFilterFn: filterItem => {
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
return null;
}
return value => {
return parseNumericValue(value) !== filterItem.value;
};
},
InputComponent: GridFilterInputValue,
InputComponentProps: {
type: 'number'
}
}, {
value: '>',
getApplyFilterFn: filterItem => {
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
return null;
}
return value => {
if (value == null) {
return false;
}
return parseNumericValue(value) > filterItem.value;
};
},
InputComponent: GridFilterInputValue,
InputComponentProps: {
type: 'number'
}
}, {
value: '>=',
getApplyFilterFn: filterItem => {
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
return null;
}
return value => {
if (value == null) {
return false;
}
return parseNumericValue(value) >= filterItem.value;
};
},
InputComponent: GridFilterInputValue,
InputComponentProps: {
type: 'number'
}
}, {
value: '<',
getApplyFilterFn: filterItem => {
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
return null;
}
return value => {
if (value == null) {
return false;
}
return parseNumericValue(value) < filterItem.value;
};
},
InputComponent: GridFilterInputValue,
InputComponentProps: {
type: 'number'
}
}, {
value: '<=',
getApplyFilterFn: filterItem => {
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
return null;
}
return value => {
if (value == null) {
return false;
}
return parseNumericValue(value) <= filterItem.value;
};
},
InputComponent: GridFilterInputValue,
InputComponentProps: {
type: 'number'
}
}, {
value: 'isEmpty',
getApplyFilterFn: () => {
return value => {
return value == null;
};
},
requiresFilterValue: false
}, {
value: 'isNotEmpty',
getApplyFilterFn: () => {
return value => {
return value != null;
};
},
requiresFilterValue: false
}, {
value: 'isAnyOf',
getApplyFilterFn: filterItem => {
if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {
return null;
}
return value => {
return value != null && filterItem.value.includes(Number(value));
};
},
InputComponent: GridFilterInputMultipleValue,
InputComponentProps: {
type: 'number'
}
}];
@@ -0,0 +1,2 @@
import type { GridSingleSelectColDef } from "../models/colDef/gridColDef.mjs";
export declare const GRID_SINGLE_SELECT_COL_DEF: Omit<GridSingleSelectColDef, 'field'>;
@@ -0,0 +1,2 @@
import type { GridSingleSelectColDef } from "../models/colDef/gridColDef.js";
export declare const GRID_SINGLE_SELECT_COL_DEF: Omit<GridSingleSelectColDef, 'field'>;
+68
View File
@@ -0,0 +1,68 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GRID_SINGLE_SELECT_COL_DEF = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _gridStringColDef = require("./gridStringColDef");
var _GridEditSingleSelectCell = require("../components/cell/GridEditSingleSelectCell");
var _gridSingleSelectOperators = require("./gridSingleSelectOperators");
var _filterPanelUtils = require("../components/panel/filterPanel/filterPanelUtils");
var _utils = require("../utils/utils");
var _gridPropsSelectors = require("../hooks/core/gridPropsSelectors");
const isArrayOfObjects = options => {
return typeof options[0] === 'object';
};
const defaultGetOptionValue = value => {
return (0, _utils.isObject)(value) ? value.value : value;
};
const defaultGetOptionLabel = value => {
return (0, _utils.isObject)(value) ? value.label : String(value);
};
const GRID_SINGLE_SELECT_COL_DEF = exports.GRID_SINGLE_SELECT_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_STRING_COL_DEF, {
type: 'singleSelect',
getOptionLabel: defaultGetOptionLabel,
getOptionValue: defaultGetOptionValue,
valueFormatter(value, row, colDef, apiRef) {
const rowId = (0, _gridPropsSelectors.gridRowIdSelector)(apiRef, row);
if (!(0, _filterPanelUtils.isSingleSelectColDef)(colDef)) {
return '';
}
const valueOptions = (0, _filterPanelUtils.getValueOptions)(colDef, {
id: rowId,
row
});
if (value == null) {
return '';
}
if (!valueOptions) {
return value;
}
if (!isArrayOfObjects(valueOptions)) {
return colDef.getOptionLabel(value);
}
const valueOption = valueOptions.find(option => colDef.getOptionValue(option) === value);
return valueOption ? colDef.getOptionLabel(valueOption) : '';
},
renderEditCell: _GridEditSingleSelectCell.renderEditSingleSelectCell,
filterOperators: (0, _gridSingleSelectOperators.getGridSingleSelectOperators)(),
// @ts-ignore
pastedValueParser: (value, row, column) => {
const colDef = column;
const valueOptions = (0, _filterPanelUtils.getValueOptions)(colDef) || [];
const getOptionValue = colDef.getOptionValue;
const valueOption = valueOptions.find(option => {
if (getOptionValue(option) === value) {
return true;
}
return false;
});
if (valueOption) {
return value;
}
// do not paste the value if it is not in the valueOptions
return undefined;
}
});
@@ -0,0 +1,61 @@
import _extends from "@babel/runtime/helpers/esm/extends";
import { GRID_STRING_COL_DEF } from "./gridStringColDef.mjs";
import { renderEditSingleSelectCell } from "../components/cell/GridEditSingleSelectCell.mjs";
import { getGridSingleSelectOperators } from "./gridSingleSelectOperators.mjs";
import { getValueOptions, isSingleSelectColDef } from "../components/panel/filterPanel/filterPanelUtils.mjs";
import { isObject } from "../utils/utils.mjs";
import { gridRowIdSelector } from "../hooks/core/gridPropsSelectors.mjs";
const isArrayOfObjects = options => {
return typeof options[0] === 'object';
};
const defaultGetOptionValue = value => {
return isObject(value) ? value.value : value;
};
const defaultGetOptionLabel = value => {
return isObject(value) ? value.label : String(value);
};
export const GRID_SINGLE_SELECT_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
type: 'singleSelect',
getOptionLabel: defaultGetOptionLabel,
getOptionValue: defaultGetOptionValue,
valueFormatter(value, row, colDef, apiRef) {
const rowId = gridRowIdSelector(apiRef, row);
if (!isSingleSelectColDef(colDef)) {
return '';
}
const valueOptions = getValueOptions(colDef, {
id: rowId,
row
});
if (value == null) {
return '';
}
if (!valueOptions) {
return value;
}
if (!isArrayOfObjects(valueOptions)) {
return colDef.getOptionLabel(value);
}
const valueOption = valueOptions.find(option => colDef.getOptionValue(option) === value);
return valueOption ? colDef.getOptionLabel(valueOption) : '';
},
renderEditCell: renderEditSingleSelectCell,
filterOperators: getGridSingleSelectOperators(),
// @ts-ignore
pastedValueParser: (value, row, column) => {
const colDef = column;
const valueOptions = getValueOptions(colDef) || [];
const getOptionValue = colDef.getOptionValue;
const valueOption = valueOptions.find(option => {
if (getOptionValue(option) === value) {
return true;
}
return false;
});
if (valueOption) {
return value;
}
// do not paste the value if it is not in the valueOptions
return undefined;
}
});
@@ -0,0 +1,2 @@
import type { GridFilterOperator } from "../models/gridFilterOperator.mjs";
export declare const getGridSingleSelectOperators: () => GridFilterOperator[];
@@ -0,0 +1,2 @@
import type { GridFilterOperator } from "../models/gridFilterOperator.js";
export declare const getGridSingleSelectOperators: () => GridFilterOperator[];
@@ -0,0 +1,45 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getGridSingleSelectOperators = void 0;
var _GridFilterInputSingleSelect = require("../components/panel/filterPanel/GridFilterInputSingleSelect");
var _GridFilterInputMultipleSingleSelect = require("../components/panel/filterPanel/GridFilterInputMultipleSingleSelect");
var _utils = require("../utils/utils");
const parseObjectValue = value => {
if (value == null || !(0, _utils.isObject)(value)) {
return value;
}
return value.value;
};
const getGridSingleSelectOperators = () => [{
value: 'is',
getApplyFilterFn: filterItem => {
if (filterItem.value == null || filterItem.value === '') {
return null;
}
return value => parseObjectValue(value) === parseObjectValue(filterItem.value);
},
InputComponent: _GridFilterInputSingleSelect.GridFilterInputSingleSelect
}, {
value: 'not',
getApplyFilterFn: filterItem => {
if (filterItem.value == null || filterItem.value === '') {
return null;
}
return value => parseObjectValue(value) !== parseObjectValue(filterItem.value);
},
InputComponent: _GridFilterInputSingleSelect.GridFilterInputSingleSelect
}, {
value: 'isAnyOf',
getApplyFilterFn: filterItem => {
if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {
return null;
}
const filterItemValues = filterItem.value.map(parseObjectValue);
return value => filterItemValues.includes(parseObjectValue(value));
},
InputComponent: _GridFilterInputMultipleSingleSelect.GridFilterInputMultipleSingleSelect
}];
exports.getGridSingleSelectOperators = getGridSingleSelectOperators;
@@ -0,0 +1,38 @@
import { GridFilterInputSingleSelect } from "../components/panel/filterPanel/GridFilterInputSingleSelect.mjs";
import { GridFilterInputMultipleSingleSelect } from "../components/panel/filterPanel/GridFilterInputMultipleSingleSelect.mjs";
import { isObject } from "../utils/utils.mjs";
const parseObjectValue = value => {
if (value == null || !isObject(value)) {
return value;
}
return value.value;
};
export const getGridSingleSelectOperators = () => [{
value: 'is',
getApplyFilterFn: filterItem => {
if (filterItem.value == null || filterItem.value === '') {
return null;
}
return value => parseObjectValue(value) === parseObjectValue(filterItem.value);
},
InputComponent: GridFilterInputSingleSelect
}, {
value: 'not',
getApplyFilterFn: filterItem => {
if (filterItem.value == null || filterItem.value === '') {
return null;
}
return value => parseObjectValue(value) !== parseObjectValue(filterItem.value);
},
InputComponent: GridFilterInputSingleSelect
}, {
value: 'isAnyOf',
getApplyFilterFn: filterItem => {
if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {
return null;
}
const filterItemValues = filterItem.value.map(parseObjectValue);
return value => filterItemValues.includes(parseObjectValue(value));
},
InputComponent: GridFilterInputMultipleSingleSelect
}];
+5
View File
@@ -0,0 +1,5 @@
import type { GridColTypeDef } from "../models/colDef/gridColDef.mjs";
/**
* TODO: Move pro and premium properties outside of this Community file
*/
export declare const GRID_STRING_COL_DEF: GridColTypeDef<any, any>;
+5
View File
@@ -0,0 +1,5 @@
import type { GridColTypeDef } from "../models/colDef/gridColDef.js";
/**
* TODO: Move pro and premium properties outside of this Community file
*/
export declare const GRID_STRING_COL_DEF: GridColTypeDef<any, any>;
+33
View File
@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GRID_STRING_COL_DEF = void 0;
var _GridEditInputCell = require("../components/cell/GridEditInputCell");
var _gridSortingUtils = require("../hooks/features/sorting/gridSortingUtils");
var _gridStringOperators = require("./gridStringOperators");
/**
* TODO: Move pro and premium properties outside of this Community file
*/
const GRID_STRING_COL_DEF = exports.GRID_STRING_COL_DEF = {
width: 100,
minWidth: 50,
maxWidth: Infinity,
hideable: true,
sortable: true,
resizable: true,
filterable: true,
groupable: true,
pinnable: true,
// @ts-ignore
aggregable: true,
chartable: true,
editable: false,
sortComparator: _gridSortingUtils.gridStringOrNumberComparator,
type: 'string',
align: 'left',
filterOperators: (0, _gridStringOperators.getGridStringOperators)(),
renderEditCell: _GridEditInputCell.renderEditInputCell,
getApplyQuickFilterFn: _gridStringOperators.getGridStringQuickFilterFn
};
+28
View File
@@ -0,0 +1,28 @@
import { renderEditInputCell } from "../components/cell/GridEditInputCell.mjs";
import { gridStringOrNumberComparator } from "../hooks/features/sorting/gridSortingUtils.mjs";
import { getGridStringOperators, getGridStringQuickFilterFn } from "./gridStringOperators.mjs";
/**
* TODO: Move pro and premium properties outside of this Community file
*/
export const GRID_STRING_COL_DEF = {
width: 100,
minWidth: 50,
maxWidth: Infinity,
hideable: true,
sortable: true,
resizable: true,
filterable: true,
groupable: true,
pinnable: true,
// @ts-ignore
aggregable: true,
chartable: true,
editable: false,
sortComparator: gridStringOrNumberComparator,
type: 'string',
align: 'left',
filterOperators: getGridStringOperators(),
renderEditCell: renderEditInputCell,
getApplyQuickFilterFn: getGridStringQuickFilterFn
};
@@ -0,0 +1,4 @@
import type { GetApplyQuickFilterFn } from "../models/colDef/gridColDef.mjs";
import type { GridFilterOperator } from "../models/gridFilterOperator.mjs";
export declare const getGridStringQuickFilterFn: GetApplyQuickFilterFn<any, unknown>;
export declare const getGridStringOperators: (disableTrim?: boolean) => GridFilterOperator<any, number | string | null, any>[];
@@ -0,0 +1,4 @@
import type { GetApplyQuickFilterFn } from "../models/colDef/gridColDef.js";
import type { GridFilterOperator } from "../models/gridFilterOperator.js";
export declare const getGridStringQuickFilterFn: GetApplyQuickFilterFn<any, unknown>;
export declare const getGridStringOperators: (disableTrim?: boolean) => GridFilterOperator<any, number | string | null, any>[];
+129
View File
@@ -0,0 +1,129 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getGridStringQuickFilterFn = exports.getGridStringOperators = void 0;
var _GridFilterInputValue = require("../components/panel/filterPanel/GridFilterInputValue");
var _utils = require("../utils/utils");
var _GridFilterInputMultipleValue = require("../components/panel/filterPanel/GridFilterInputMultipleValue");
var _gridFilterUtils = require("../hooks/features/filter/gridFilterUtils");
const getGridStringQuickFilterFn = value => {
if (!value) {
return null;
}
const filterRegex = new RegExp((0, _utils.escapeRegExp)(value), 'i');
return (_, row, column, apiRef) => {
let columnValue = apiRef.current.getRowFormattedValue(row, column);
if (apiRef.current.ignoreDiacritics) {
columnValue = (0, _gridFilterUtils.removeDiacritics)(columnValue);
}
return columnValue != null ? filterRegex.test(columnValue.toString()) : false;
};
};
exports.getGridStringQuickFilterFn = getGridStringQuickFilterFn;
const createContainsFilterFn = (disableTrim, negate) => filterItem => {
if (!filterItem.value) {
return null;
}
const trimmedValue = disableTrim ? filterItem.value : filterItem.value.trim();
const filterRegex = new RegExp((0, _utils.escapeRegExp)(trimmedValue), 'i');
return value => {
if (value == null) {
return negate;
}
const matches = filterRegex.test(String(value));
return negate ? !matches : matches;
};
};
const createEqualityFilterFn = (disableTrim, negate) => filterItem => {
if (!filterItem.value) {
return null;
}
const trimmedValue = disableTrim ? filterItem.value : filterItem.value.trim();
const collator = new Intl.Collator(undefined, {
sensitivity: 'base',
usage: 'search'
});
return value => {
if (value == null) {
return negate;
}
const isEqual = collator.compare(trimmedValue, value.toString()) === 0;
return negate ? !isEqual : isEqual;
};
};
const createEmptyFilterFn = negate => () => {
return value => {
const isEmpty = value === '' || value == null;
return negate ? !isEmpty : isEmpty;
};
};
const getGridStringOperators = (disableTrim = false) => [{
value: 'contains',
getApplyFilterFn: createContainsFilterFn(disableTrim, false),
InputComponent: _GridFilterInputValue.GridFilterInputValue
}, {
value: 'doesNotContain',
getApplyFilterFn: createContainsFilterFn(disableTrim, true),
InputComponent: _GridFilterInputValue.GridFilterInputValue
}, {
value: 'equals',
getApplyFilterFn: createEqualityFilterFn(disableTrim, false),
InputComponent: _GridFilterInputValue.GridFilterInputValue
}, {
value: 'doesNotEqual',
getApplyFilterFn: createEqualityFilterFn(disableTrim, true),
InputComponent: _GridFilterInputValue.GridFilterInputValue
}, {
value: 'startsWith',
getApplyFilterFn: filterItem => {
if (!filterItem.value) {
return null;
}
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
const filterRegex = new RegExp(`^${(0, _utils.escapeRegExp)(filterItemValue)}.*$`, 'i');
return value => {
return value != null ? filterRegex.test(value.toString()) : false;
};
},
InputComponent: _GridFilterInputValue.GridFilterInputValue
}, {
value: 'endsWith',
getApplyFilterFn: filterItem => {
if (!filterItem.value) {
return null;
}
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
const filterRegex = new RegExp(`.*${(0, _utils.escapeRegExp)(filterItemValue)}$`, 'i');
return value => {
return value != null ? filterRegex.test(value.toString()) : false;
};
},
InputComponent: _GridFilterInputValue.GridFilterInputValue
}, {
value: 'isEmpty',
getApplyFilterFn: createEmptyFilterFn(false),
requiresFilterValue: false
}, {
value: 'isNotEmpty',
getApplyFilterFn: createEmptyFilterFn(true),
requiresFilterValue: false
}, {
value: 'isAnyOf',
getApplyFilterFn: filterItem => {
if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {
return null;
}
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.map(val => val.trim());
const collator = new Intl.Collator(undefined, {
sensitivity: 'base',
usage: 'search'
});
return value => value != null ? filterItemValue.some(filterValue => {
return collator.compare(filterValue, value.toString() || '') === 0;
}) : false;
},
InputComponent: _GridFilterInputMultipleValue.GridFilterInputMultipleValue
}];
exports.getGridStringOperators = getGridStringOperators;
+121
View File
@@ -0,0 +1,121 @@
import { GridFilterInputValue } from "../components/panel/filterPanel/GridFilterInputValue.mjs";
import { escapeRegExp } from "../utils/utils.mjs";
import { GridFilterInputMultipleValue } from "../components/panel/filterPanel/GridFilterInputMultipleValue.mjs";
import { removeDiacritics } from "../hooks/features/filter/gridFilterUtils.mjs";
export const getGridStringQuickFilterFn = value => {
if (!value) {
return null;
}
const filterRegex = new RegExp(escapeRegExp(value), 'i');
return (_, row, column, apiRef) => {
let columnValue = apiRef.current.getRowFormattedValue(row, column);
if (apiRef.current.ignoreDiacritics) {
columnValue = removeDiacritics(columnValue);
}
return columnValue != null ? filterRegex.test(columnValue.toString()) : false;
};
};
const createContainsFilterFn = (disableTrim, negate) => filterItem => {
if (!filterItem.value) {
return null;
}
const trimmedValue = disableTrim ? filterItem.value : filterItem.value.trim();
const filterRegex = new RegExp(escapeRegExp(trimmedValue), 'i');
return value => {
if (value == null) {
return negate;
}
const matches = filterRegex.test(String(value));
return negate ? !matches : matches;
};
};
const createEqualityFilterFn = (disableTrim, negate) => filterItem => {
if (!filterItem.value) {
return null;
}
const trimmedValue = disableTrim ? filterItem.value : filterItem.value.trim();
const collator = new Intl.Collator(undefined, {
sensitivity: 'base',
usage: 'search'
});
return value => {
if (value == null) {
return negate;
}
const isEqual = collator.compare(trimmedValue, value.toString()) === 0;
return negate ? !isEqual : isEqual;
};
};
const createEmptyFilterFn = negate => () => {
return value => {
const isEmpty = value === '' || value == null;
return negate ? !isEmpty : isEmpty;
};
};
export const getGridStringOperators = (disableTrim = false) => [{
value: 'contains',
getApplyFilterFn: createContainsFilterFn(disableTrim, false),
InputComponent: GridFilterInputValue
}, {
value: 'doesNotContain',
getApplyFilterFn: createContainsFilterFn(disableTrim, true),
InputComponent: GridFilterInputValue
}, {
value: 'equals',
getApplyFilterFn: createEqualityFilterFn(disableTrim, false),
InputComponent: GridFilterInputValue
}, {
value: 'doesNotEqual',
getApplyFilterFn: createEqualityFilterFn(disableTrim, true),
InputComponent: GridFilterInputValue
}, {
value: 'startsWith',
getApplyFilterFn: filterItem => {
if (!filterItem.value) {
return null;
}
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
const filterRegex = new RegExp(`^${escapeRegExp(filterItemValue)}.*$`, 'i');
return value => {
return value != null ? filterRegex.test(value.toString()) : false;
};
},
InputComponent: GridFilterInputValue
}, {
value: 'endsWith',
getApplyFilterFn: filterItem => {
if (!filterItem.value) {
return null;
}
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.trim();
const filterRegex = new RegExp(`.*${escapeRegExp(filterItemValue)}$`, 'i');
return value => {
return value != null ? filterRegex.test(value.toString()) : false;
};
},
InputComponent: GridFilterInputValue
}, {
value: 'isEmpty',
getApplyFilterFn: createEmptyFilterFn(false),
requiresFilterValue: false
}, {
value: 'isNotEmpty',
getApplyFilterFn: createEmptyFilterFn(true),
requiresFilterValue: false
}, {
value: 'isAnyOf',
getApplyFilterFn: filterItem => {
if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {
return null;
}
const filterItemValue = disableTrim ? filterItem.value : filterItem.value.map(val => val.trim());
const collator = new Intl.Collator(undefined, {
sensitivity: 'base',
usage: 'search'
});
return value => value != null ? filterItemValue.some(filterValue => {
return collator.compare(filterValue, value.toString() || '') === 0;
}) : false;
},
InputComponent: GridFilterInputMultipleValue
}];
+14
View File
@@ -0,0 +1,14 @@
export * from "./gridActionsColDef.mjs";
export * from "./gridBooleanColDef.mjs";
export * from "./gridCheckboxSelectionColDef.mjs";
export * from "./gridDateColDef.mjs";
export * from "./gridNumericColDef.mjs";
export * from "./gridSingleSelectColDef.mjs";
export * from "./gridStringColDef.mjs";
export * from "./gridLongTextColDef.mjs";
export * from "./gridBooleanOperators.mjs";
export * from "./gridDateOperators.mjs";
export * from "./gridNumericOperators.mjs";
export * from "./gridSingleSelectOperators.mjs";
export * from "./gridStringOperators.mjs";
export * from "./gridDefaultColumnTypes.mjs";
+14
View File
@@ -0,0 +1,14 @@
export * from "./gridActionsColDef.js";
export * from "./gridBooleanColDef.js";
export * from "./gridCheckboxSelectionColDef.js";
export * from "./gridDateColDef.js";
export * from "./gridNumericColDef.js";
export * from "./gridSingleSelectColDef.js";
export * from "./gridStringColDef.js";
export * from "./gridLongTextColDef.js";
export * from "./gridBooleanOperators.js";
export * from "./gridDateOperators.js";
export * from "./gridNumericOperators.js";
export * from "./gridSingleSelectOperators.js";
export * from "./gridStringOperators.js";
export * from "./gridDefaultColumnTypes.js";
+159
View File
@@ -0,0 +1,159 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _gridActionsColDef = require("./gridActionsColDef");
Object.keys(_gridActionsColDef).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _gridActionsColDef[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _gridActionsColDef[key];
}
});
});
var _gridBooleanColDef = require("./gridBooleanColDef");
Object.keys(_gridBooleanColDef).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _gridBooleanColDef[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _gridBooleanColDef[key];
}
});
});
var _gridCheckboxSelectionColDef = require("./gridCheckboxSelectionColDef");
Object.keys(_gridCheckboxSelectionColDef).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _gridCheckboxSelectionColDef[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _gridCheckboxSelectionColDef[key];
}
});
});
var _gridDateColDef = require("./gridDateColDef");
Object.keys(_gridDateColDef).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _gridDateColDef[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _gridDateColDef[key];
}
});
});
var _gridNumericColDef = require("./gridNumericColDef");
Object.keys(_gridNumericColDef).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _gridNumericColDef[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _gridNumericColDef[key];
}
});
});
var _gridSingleSelectColDef = require("./gridSingleSelectColDef");
Object.keys(_gridSingleSelectColDef).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _gridSingleSelectColDef[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _gridSingleSelectColDef[key];
}
});
});
var _gridStringColDef = require("./gridStringColDef");
Object.keys(_gridStringColDef).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _gridStringColDef[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _gridStringColDef[key];
}
});
});
var _gridLongTextColDef = require("./gridLongTextColDef");
Object.keys(_gridLongTextColDef).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _gridLongTextColDef[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _gridLongTextColDef[key];
}
});
});
var _gridBooleanOperators = require("./gridBooleanOperators");
Object.keys(_gridBooleanOperators).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _gridBooleanOperators[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _gridBooleanOperators[key];
}
});
});
var _gridDateOperators = require("./gridDateOperators");
Object.keys(_gridDateOperators).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _gridDateOperators[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _gridDateOperators[key];
}
});
});
var _gridNumericOperators = require("./gridNumericOperators");
Object.keys(_gridNumericOperators).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _gridNumericOperators[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _gridNumericOperators[key];
}
});
});
var _gridSingleSelectOperators = require("./gridSingleSelectOperators");
Object.keys(_gridSingleSelectOperators).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _gridSingleSelectOperators[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _gridSingleSelectOperators[key];
}
});
});
var _gridStringOperators = require("./gridStringOperators");
Object.keys(_gridStringOperators).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _gridStringOperators[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _gridStringOperators[key];
}
});
});
var _gridDefaultColumnTypes = require("./gridDefaultColumnTypes");
Object.keys(_gridDefaultColumnTypes).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _gridDefaultColumnTypes[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _gridDefaultColumnTypes[key];
}
});
});
+14
View File
@@ -0,0 +1,14 @@
export * from "./gridActionsColDef.mjs";
export * from "./gridBooleanColDef.mjs";
export * from "./gridCheckboxSelectionColDef.mjs";
export * from "./gridDateColDef.mjs";
export * from "./gridNumericColDef.mjs";
export * from "./gridSingleSelectColDef.mjs";
export * from "./gridStringColDef.mjs";
export * from "./gridLongTextColDef.mjs";
export * from "./gridBooleanOperators.mjs";
export * from "./gridDateOperators.mjs";
export * from "./gridNumericOperators.mjs";
export * from "./gridSingleSelectOperators.mjs";
export * from "./gridStringOperators.mjs";
export * from "./gridDefaultColumnTypes.mjs";
@@ -0,0 +1,2 @@
import * as React from 'react';
export declare const GridApiContext: React.Context<unknown>;
+2
View File
@@ -0,0 +1,2 @@
import * as React from 'react';
export declare const GridApiContext: React.Context<unknown>;
+11
View File
@@ -0,0 +1,11 @@
"use strict";
'use client';
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GridApiContext = void 0;
var React = _interopRequireWildcard(require("react"));
const GridApiContext = exports.GridApiContext = /*#__PURE__*/React.createContext(undefined);
if (process.env.NODE_ENV !== "production") GridApiContext.displayName = "GridApiContext";
+5
View File
@@ -0,0 +1,5 @@
'use client';
import * as React from 'react';
export const GridApiContext = /*#__PURE__*/React.createContext(undefined);
if (process.env.NODE_ENV !== "production") GridApiContext.displayName = "GridApiContext";
@@ -0,0 +1,7 @@
import * as React from 'react';
import type { UseGridColumnHeadersProps } from "../hooks/features/columnHeaders/useGridColumnHeaders.mjs";
export interface GridColumnHeadersProps extends React.HTMLAttributes<HTMLDivElement>, UseGridColumnHeadersProps {
ref?: React.Ref<HTMLDivElement>;
}
declare const MemoizedGridColumnHeaders: React.ForwardRefExoticComponent<GridColumnHeadersProps> | React.ForwardRefExoticComponent<Omit<GridColumnHeadersProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
export { MemoizedGridColumnHeaders as GridColumnHeaders };
@@ -0,0 +1,7 @@
import * as React from 'react';
import type { UseGridColumnHeadersProps } from "../hooks/features/columnHeaders/useGridColumnHeaders.js";
export interface GridColumnHeadersProps extends React.HTMLAttributes<HTMLDivElement>, UseGridColumnHeadersProps {
ref?: React.Ref<HTMLDivElement>;
}
declare const MemoizedGridColumnHeaders: React.ForwardRefExoticComponent<GridColumnHeadersProps> | React.ForwardRefExoticComponent<Omit<GridColumnHeadersProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
export { MemoizedGridColumnHeaders as GridColumnHeaders };
+94
View File
@@ -0,0 +1,94 @@
"use strict";
'use client';
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GridColumnHeaders = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _fastMemo = require("@mui/x-internals/fastMemo");
var _forwardRef = require("@mui/x-internals/forwardRef");
var _useGridColumnHeaders = require("../hooks/features/columnHeaders/useGridColumnHeaders");
var _GridBaseColumnHeaders = require("./columnHeaders/GridBaseColumnHeaders");
var _jsxRuntime = require("react/jsx-runtime");
const _excluded = ["className", "visibleColumns", "sortColumnLookup", "filterColumnLookup", "columnHeaderTabIndexState", "columnGroupHeaderTabIndexState", "columnHeaderFocus", "columnGroupHeaderFocus", "headerGroupingMaxDepth", "columnMenuState", "columnVisibility", "columnGroupsHeaderStructure", "hasOtherElementInTabSequence"];
const GridColumnHeaders = (0, _forwardRef.forwardRef)(function GridColumnHeaders(props, ref) {
const {
visibleColumns,
sortColumnLookup,
filterColumnLookup,
columnHeaderTabIndexState,
columnGroupHeaderTabIndexState,
columnHeaderFocus,
columnGroupHeaderFocus,
headerGroupingMaxDepth,
columnMenuState,
columnVisibility,
columnGroupsHeaderStructure,
hasOtherElementInTabSequence
} = props,
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
const {
getInnerProps,
getColumnHeadersRow,
getColumnGroupHeadersRows
} = (0, _useGridColumnHeaders.useGridColumnHeaders)({
visibleColumns,
sortColumnLookup,
filterColumnLookup,
columnHeaderTabIndexState,
columnGroupHeaderTabIndexState,
columnHeaderFocus,
columnGroupHeaderFocus,
headerGroupingMaxDepth,
columnMenuState,
columnVisibility,
columnGroupsHeaderStructure,
hasOtherElementInTabSequence
});
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_GridBaseColumnHeaders.GridBaseColumnHeaders, (0, _extends2.default)({}, other, getInnerProps(), {
ref: ref,
children: [getColumnGroupHeadersRows(), getColumnHeadersRow()]
}));
});
if (process.env.NODE_ENV !== "production") GridColumnHeaders.displayName = "GridColumnHeaders";
process.env.NODE_ENV !== "production" ? GridColumnHeaders.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "pnpm proptypes" |
// ----------------------------------------------------------------------
columnGroupHeaderFocus: _propTypes.default.shape({
depth: _propTypes.default.number.isRequired,
field: _propTypes.default.string.isRequired
}),
columnGroupHeaderTabIndexState: _propTypes.default.shape({
depth: _propTypes.default.number.isRequired,
field: _propTypes.default.string.isRequired
}),
columnGroupsHeaderStructure: _propTypes.default.arrayOf(_propTypes.default.arrayOf(_propTypes.default.shape({
columnFields: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
groupId: _propTypes.default.string
}))).isRequired,
columnHeaderFocus: _propTypes.default.shape({
field: _propTypes.default.string.isRequired
}),
columnHeaderTabIndexState: _propTypes.default.shape({
field: _propTypes.default.string.isRequired
}),
columnMenuState: _propTypes.default.shape({
field: _propTypes.default.string,
open: _propTypes.default.bool.isRequired
}).isRequired,
columnVisibility: _propTypes.default.object.isRequired,
filterColumnLookup: _propTypes.default.object.isRequired,
hasOtherElementInTabSequence: _propTypes.default.bool.isRequired,
headerGroupingMaxDepth: _propTypes.default.number.isRequired,
sortColumnLookup: _propTypes.default.object.isRequired,
visibleColumns: _propTypes.default.arrayOf(_propTypes.default.object).isRequired
} : void 0;
const MemoizedGridColumnHeaders = exports.GridColumnHeaders = (0, _fastMemo.fastMemo)(GridColumnHeaders);
+88
View File
@@ -0,0 +1,88 @@
'use client';
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
const _excluded = ["className", "visibleColumns", "sortColumnLookup", "filterColumnLookup", "columnHeaderTabIndexState", "columnGroupHeaderTabIndexState", "columnHeaderFocus", "columnGroupHeaderFocus", "headerGroupingMaxDepth", "columnMenuState", "columnVisibility", "columnGroupsHeaderStructure", "hasOtherElementInTabSequence"];
import * as React from 'react';
import PropTypes from 'prop-types';
import { fastMemo } from '@mui/x-internals/fastMemo';
import { forwardRef } from '@mui/x-internals/forwardRef';
import { useGridColumnHeaders } from "../hooks/features/columnHeaders/useGridColumnHeaders.mjs";
import { GridBaseColumnHeaders } from "./columnHeaders/GridBaseColumnHeaders.mjs";
import { jsxs as _jsxs } from "react/jsx-runtime";
const GridColumnHeaders = forwardRef(function GridColumnHeaders(props, ref) {
const {
visibleColumns,
sortColumnLookup,
filterColumnLookup,
columnHeaderTabIndexState,
columnGroupHeaderTabIndexState,
columnHeaderFocus,
columnGroupHeaderFocus,
headerGroupingMaxDepth,
columnMenuState,
columnVisibility,
columnGroupsHeaderStructure,
hasOtherElementInTabSequence
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
const {
getInnerProps,
getColumnHeadersRow,
getColumnGroupHeadersRows
} = useGridColumnHeaders({
visibleColumns,
sortColumnLookup,
filterColumnLookup,
columnHeaderTabIndexState,
columnGroupHeaderTabIndexState,
columnHeaderFocus,
columnGroupHeaderFocus,
headerGroupingMaxDepth,
columnMenuState,
columnVisibility,
columnGroupsHeaderStructure,
hasOtherElementInTabSequence
});
return /*#__PURE__*/_jsxs(GridBaseColumnHeaders, _extends({}, other, getInnerProps(), {
ref: ref,
children: [getColumnGroupHeadersRows(), getColumnHeadersRow()]
}));
});
if (process.env.NODE_ENV !== "production") GridColumnHeaders.displayName = "GridColumnHeaders";
process.env.NODE_ENV !== "production" ? GridColumnHeaders.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "pnpm proptypes" |
// ----------------------------------------------------------------------
columnGroupHeaderFocus: PropTypes.shape({
depth: PropTypes.number.isRequired,
field: PropTypes.string.isRequired
}),
columnGroupHeaderTabIndexState: PropTypes.shape({
depth: PropTypes.number.isRequired,
field: PropTypes.string.isRequired
}),
columnGroupsHeaderStructure: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.shape({
columnFields: PropTypes.arrayOf(PropTypes.string).isRequired,
groupId: PropTypes.string
}))).isRequired,
columnHeaderFocus: PropTypes.shape({
field: PropTypes.string.isRequired
}),
columnHeaderTabIndexState: PropTypes.shape({
field: PropTypes.string.isRequired
}),
columnMenuState: PropTypes.shape({
field: PropTypes.string,
open: PropTypes.bool.isRequired
}).isRequired,
columnVisibility: PropTypes.object.isRequired,
filterColumnLookup: PropTypes.object.isRequired,
hasOtherElementInTabSequence: PropTypes.bool.isRequired,
headerGroupingMaxDepth: PropTypes.number.isRequired,
sortColumnLookup: PropTypes.object.isRequired,
visibleColumns: PropTypes.arrayOf(PropTypes.object).isRequired
} : void 0;
const MemoizedGridColumnHeaders = fastMemo(GridColumnHeaders);
export { MemoizedGridColumnHeaders as GridColumnHeaders };
@@ -0,0 +1,16 @@
import * as React from 'react';
import type { GridSlotProps } from "../models/index.mjs";
import type { GridSortDirection } from "../models/gridSortModel.mjs";
export type GridColumnSortButtonProps = GridSlotProps['baseIconButton'] & {
field: string;
direction: GridSortDirection;
index?: number;
sortingOrder: readonly GridSortDirection[];
disabled?: boolean;
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
};
declare function GridColumnSortButton(props: GridColumnSortButtonProps): React.JSX.Element | null;
declare namespace GridColumnSortButton {
var propTypes: any;
}
export { GridColumnSortButton };
@@ -0,0 +1,16 @@
import * as React from 'react';
import type { GridSlotProps } from "../models/index.js";
import type { GridSortDirection } from "../models/gridSortModel.js";
export type GridColumnSortButtonProps = GridSlotProps['baseIconButton'] & {
field: string;
direction: GridSortDirection;
index?: number;
sortingOrder: readonly GridSortDirection[];
disabled?: boolean;
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
};
declare function GridColumnSortButton(props: GridColumnSortButtonProps): React.JSX.Element | null;
declare namespace GridColumnSortButton {
var propTypes: any;
}
export { GridColumnSortButton };
@@ -0,0 +1,112 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GridColumnSortButton = GridColumnSortButton;
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var React = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
var _styles = require("@mui/material/styles");
var _clsx = _interopRequireDefault(require("clsx"));
var _useGridApiContext = require("../hooks/utils/useGridApiContext");
var _gridClasses = require("../constants/gridClasses");
var _useGridRootProps = require("../hooks/utils/useGridRootProps");
var _cssVariables = require("../constants/cssVariables");
var _assert = require("../utils/assert");
var _jsxRuntime = require("react/jsx-runtime");
const _excluded = ["direction", "index", "sortingOrder", "disabled", "className"];
const useUtilityClasses = ownerState => {
const {
classes
} = ownerState;
const slots = {
root: ['sortButton'],
icon: ['sortIcon']
};
return (0, _composeClasses.default)(slots, _gridClasses.getDataGridUtilityClass, classes);
};
const GridColumnSortButtonRoot = (0, _styles.styled)(_assert.NotRendered, {
name: 'MuiDataGrid',
slot: 'SortButton'
})({
transition: _cssVariables.vars.transition(['opacity'], {
duration: _cssVariables.vars.transitions.duration.short,
easing: _cssVariables.vars.transitions.easing.easeInOut
})
});
function getIcon(icons, direction, className, sortingOrder) {
let Icon;
const iconProps = {};
if (direction === 'asc') {
Icon = icons.columnSortedAscendingIcon;
} else if (direction === 'desc') {
Icon = icons.columnSortedDescendingIcon;
} else {
Icon = icons.columnUnsortedIcon;
iconProps.sortingOrder = sortingOrder;
}
return Icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, (0, _extends2.default)({
fontSize: "small",
className: className
}, iconProps)) : null;
}
function GridColumnSortButton(props) {
const {
direction,
index,
sortingOrder,
disabled,
className
} = props,
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
const apiRef = (0, _useGridApiContext.useGridApiContext)();
const rootProps = (0, _useGridRootProps.useGridRootProps)();
const ownerState = (0, _extends2.default)({}, props, {
classes: rootProps.classes
});
const classes = useUtilityClasses(ownerState);
const iconElement = getIcon(rootProps.slots, direction, classes.icon, sortingOrder);
if (!iconElement) {
return null;
}
const iconButton = /*#__PURE__*/(0, _jsxRuntime.jsx)(GridColumnSortButtonRoot, (0, _extends2.default)({
as: rootProps.slots.baseIconButton,
ownerState: ownerState,
"aria-label": apiRef.current.getLocaleText('columnHeaderSortIconLabel'),
size: "small",
disabled: disabled,
className: (0, _clsx.default)(classes.root, className)
}, rootProps.slotProps?.baseIconButton, other, {
children: iconElement
}));
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTooltip, (0, _extends2.default)({
title: apiRef.current.getLocaleText('columnHeaderSortIconLabel'),
enterDelay: 1000
}, rootProps.slotProps?.baseTooltip, {
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
children: [index != null && /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseBadge, {
badgeContent: index,
color: "default",
overlap: "circular",
children: iconButton
}), index == null && iconButton]
})
}));
}
process.env.NODE_ENV !== "production" ? GridColumnSortButton.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "pnpm proptypes" |
// ----------------------------------------------------------------------
direction: _propTypes.default.oneOf(['asc', 'desc']),
disabled: _propTypes.default.bool,
field: _propTypes.default.string.isRequired,
index: _propTypes.default.number,
onClick: _propTypes.default.func,
sortingOrder: _propTypes.default.arrayOf(_propTypes.default.oneOf(['asc', 'desc'])).isRequired
} : void 0;
@@ -0,0 +1,105 @@
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
import _extends from "@babel/runtime/helpers/esm/extends";
const _excluded = ["direction", "index", "sortingOrder", "disabled", "className"];
import * as React from 'react';
import PropTypes from 'prop-types';
import composeClasses from '@mui/utils/composeClasses';
import { styled } from '@mui/material/styles';
import clsx from 'clsx';
import { useGridApiContext } from "../hooks/utils/useGridApiContext.mjs";
import { getDataGridUtilityClass } from "../constants/gridClasses.mjs";
import { useGridRootProps } from "../hooks/utils/useGridRootProps.mjs";
import { vars } from "../constants/cssVariables.mjs";
import { NotRendered } from "../utils/assert.mjs";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
const useUtilityClasses = ownerState => {
const {
classes
} = ownerState;
const slots = {
root: ['sortButton'],
icon: ['sortIcon']
};
return composeClasses(slots, getDataGridUtilityClass, classes);
};
const GridColumnSortButtonRoot = styled(NotRendered, {
name: 'MuiDataGrid',
slot: 'SortButton'
})({
transition: vars.transition(['opacity'], {
duration: vars.transitions.duration.short,
easing: vars.transitions.easing.easeInOut
})
});
function getIcon(icons, direction, className, sortingOrder) {
let Icon;
const iconProps = {};
if (direction === 'asc') {
Icon = icons.columnSortedAscendingIcon;
} else if (direction === 'desc') {
Icon = icons.columnSortedDescendingIcon;
} else {
Icon = icons.columnUnsortedIcon;
iconProps.sortingOrder = sortingOrder;
}
return Icon ? /*#__PURE__*/_jsx(Icon, _extends({
fontSize: "small",
className: className
}, iconProps)) : null;
}
function GridColumnSortButton(props) {
const {
direction,
index,
sortingOrder,
disabled,
className
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
const apiRef = useGridApiContext();
const rootProps = useGridRootProps();
const ownerState = _extends({}, props, {
classes: rootProps.classes
});
const classes = useUtilityClasses(ownerState);
const iconElement = getIcon(rootProps.slots, direction, classes.icon, sortingOrder);
if (!iconElement) {
return null;
}
const iconButton = /*#__PURE__*/_jsx(GridColumnSortButtonRoot, _extends({
as: rootProps.slots.baseIconButton,
ownerState: ownerState,
"aria-label": apiRef.current.getLocaleText('columnHeaderSortIconLabel'),
size: "small",
disabled: disabled,
className: clsx(classes.root, className)
}, rootProps.slotProps?.baseIconButton, other, {
children: iconElement
}));
return /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({
title: apiRef.current.getLocaleText('columnHeaderSortIconLabel'),
enterDelay: 1000
}, rootProps.slotProps?.baseTooltip, {
children: /*#__PURE__*/_jsxs("span", {
children: [index != null && /*#__PURE__*/_jsx(rootProps.slots.baseBadge, {
badgeContent: index,
color: "default",
overlap: "circular",
children: iconButton
}), index == null && iconButton]
})
}));
}
process.env.NODE_ENV !== "production" ? GridColumnSortButton.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "pnpm proptypes" |
// ----------------------------------------------------------------------
direction: PropTypes.oneOf(['asc', 'desc']),
disabled: PropTypes.bool,
field: PropTypes.string.isRequired,
index: PropTypes.number,
onClick: PropTypes.func,
sortingOrder: PropTypes.arrayOf(PropTypes.oneOf(['asc', 'desc'])).isRequired
} : void 0;
export { GridColumnSortButton };
@@ -0,0 +1,11 @@
import * as React from 'react';
import type { GridBaseIconProps } from "../models/gridSlotsComponentsProps.mjs";
import type { GridSortDirection } from "../models/gridSortModel.mjs";
export interface GridColumnUnsortedIconProps extends GridBaseIconProps {
sortingOrder: GridSortDirection[];
}
declare function GridColumnUnsortedIcon(props: GridColumnUnsortedIconProps): React.JSX.Element | null;
declare namespace GridColumnUnsortedIcon {
var propTypes: any;
}
export { GridColumnUnsortedIcon };
@@ -0,0 +1,11 @@
import * as React from 'react';
import type { GridBaseIconProps } from "../models/gridSlotsComponentsProps.js";
import type { GridSortDirection } from "../models/gridSortModel.js";
export interface GridColumnUnsortedIconProps extends GridBaseIconProps {
sortingOrder: GridSortDirection[];
}
declare function GridColumnUnsortedIcon(props: GridColumnUnsortedIconProps): React.JSX.Element | null;
declare namespace GridColumnUnsortedIcon {
var propTypes: any;
}
export { GridColumnUnsortedIcon };
@@ -0,0 +1,39 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.GridColumnUnsortedIcon = GridColumnUnsortedIcon;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _useGridRootProps = require("../hooks/utils/useGridRootProps");
var _jsxRuntime = require("react/jsx-runtime");
const _excluded = ["sortingOrder"];
function GridColumnUnsortedIcon(props) {
const {
sortingOrder
} = props,
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
const {
slots
} = (0, _useGridRootProps.useGridRootProps)();
const [nextSortDirection] = sortingOrder;
const Icon = nextSortDirection === 'asc' ? slots.columnSortedAscendingIcon : slots.columnSortedDescendingIcon;
return Icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, (0, _extends2.default)({}, other)) : null;
}
process.env.NODE_ENV !== "production" ? GridColumnUnsortedIcon.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "pnpm proptypes" |
// ----------------------------------------------------------------------
className: _propTypes.default.string,
color: _propTypes.default.string,
fontSize: _propTypes.default.oneOf(['inherit', 'large', 'medium', 'small']),
sortingOrder: _propTypes.default.arrayOf(_propTypes.default.oneOf(['asc', 'desc'])).isRequired,
style: _propTypes.default.object,
titleAccess: _propTypes.default.string
} : void 0;
@@ -0,0 +1,32 @@
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
const _excluded = ["sortingOrder"];
import * as React from 'react';
import PropTypes from 'prop-types';
import { useGridRootProps } from "../hooks/utils/useGridRootProps.mjs";
import { jsx as _jsx } from "react/jsx-runtime";
function GridColumnUnsortedIcon(props) {
const {
sortingOrder
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
const {
slots
} = useGridRootProps();
const [nextSortDirection] = sortingOrder;
const Icon = nextSortDirection === 'asc' ? slots.columnSortedAscendingIcon : slots.columnSortedDescendingIcon;
return Icon ? /*#__PURE__*/_jsx(Icon, _extends({}, other)) : null;
}
process.env.NODE_ENV !== "production" ? GridColumnUnsortedIcon.propTypes /* remove-proptypes */ = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the TypeScript types and run "pnpm proptypes" |
// ----------------------------------------------------------------------
className: PropTypes.string,
color: PropTypes.string,
fontSize: PropTypes.oneOf(['inherit', 'large', 'medium', 'small']),
sortingOrder: PropTypes.arrayOf(PropTypes.oneOf(['asc', 'desc'])).isRequired,
style: PropTypes.object,
titleAccess: PropTypes.string
} : void 0;
export { GridColumnUnsortedIcon };
@@ -0,0 +1,2 @@
import * as React from 'react';
export declare const GridConfigurationContext: React.Context<unknown>;

Some files were not shown because too many files have changed in this diff Show More