@mui/x-data-grid 7.0.0-beta.2 → 7.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +298 -23
- package/DataGrid/DataGrid.js +0 -6
- package/colDef/gridActionsColDef.js +1 -0
- package/colDef/gridBooleanColDef.js +1 -0
- package/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/components/GridRow.d.ts +3 -1
- package/components/GridRow.js +10 -2
- package/components/GridScrollbarFillerCell.js +6 -21
- package/components/cell/GridCell.js +10 -12
- package/components/columnSelection/GridCellCheckboxRenderer.js +1 -2
- package/components/containers/GridRootStyles.js +51 -23
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.js +6 -4
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +8 -2
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +6 -4
- package/components/panel/filterPanel/GridFilterInputValue.js +4 -3
- package/components/virtualization/GridVirtualScrollerRenderZone.js +10 -3
- package/constants/gridClasses.d.ts +24 -8
- package/constants/gridClasses.js +1 -1
- package/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +5 -5
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +46 -48
- package/hooks/features/editing/useGridCellEditing.js +3 -4
- package/hooks/features/editing/useGridRowEditing.js +3 -4
- package/hooks/features/sorting/useGridSorting.js +1 -2
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +9 -0
- package/hooks/features/virtualization/gridVirtualizationSelectors.js +7 -0
- package/hooks/features/virtualization/useGridVirtualScroller.js +19 -16
- package/hooks/features/virtualization/useGridVirtualization.d.ts +8 -0
- package/hooks/features/virtualization/useGridVirtualization.js +6 -1
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +1 -1
- package/models/colDef/gridColDef.d.ts +6 -0
- package/models/events/gridEventLookup.d.ts +1 -8
- package/models/props/DataGridProps.d.ts +0 -6
- package/modern/DataGrid/DataGrid.js +0 -6
- package/modern/colDef/gridActionsColDef.js +1 -0
- package/modern/colDef/gridBooleanColDef.js +1 -0
- package/modern/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/modern/components/GridRow.js +10 -2
- package/modern/components/GridScrollbarFillerCell.js +6 -21
- package/modern/components/cell/GridCell.js +10 -12
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +1 -2
- package/modern/components/containers/GridRootStyles.js +51 -23
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +6 -4
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +8 -2
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +6 -4
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +4 -3
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +10 -3
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +46 -48
- package/modern/hooks/features/editing/useGridCellEditing.js +3 -4
- package/modern/hooks/features/editing/useGridRowEditing.js +3 -4
- package/modern/hooks/features/sorting/useGridSorting.js +1 -2
- package/modern/hooks/features/virtualization/gridVirtualizationSelectors.js +7 -0
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +18 -14
- package/modern/hooks/features/virtualization/useGridVirtualization.js +6 -1
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -1
- package/modern/utils/keyboardUtils.js +20 -11
- package/node/DataGrid/DataGrid.js +0 -6
- package/node/colDef/gridActionsColDef.js +1 -0
- package/node/colDef/gridBooleanColDef.js +1 -0
- package/node/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/node/components/GridRow.js +10 -2
- package/node/components/GridScrollbarFillerCell.js +5 -20
- package/node/components/cell/GridCell.js +10 -12
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +1 -2
- package/node/components/containers/GridRootStyles.js +51 -23
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +6 -4
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +8 -2
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +6 -4
- package/node/components/panel/filterPanel/GridFilterInputValue.js +4 -3
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +10 -3
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +45 -47
- package/node/hooks/features/editing/useGridCellEditing.js +2 -3
- package/node/hooks/features/editing/useGridRowEditing.js +2 -3
- package/node/hooks/features/sorting/useGridSorting.js +1 -2
- package/node/hooks/features/virtualization/gridVirtualizationSelectors.js +8 -1
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +17 -13
- package/node/hooks/features/virtualization/useGridVirtualization.js +7 -2
- package/node/index.js +1 -1
- package/node/internals/index.js +7 -0
- package/node/utils/keyboardUtils.js +25 -20
- package/package.json +3 -3
- package/utils/keyboardUtils.d.ts +7 -6
- package/utils/keyboardUtils.js +20 -11
- package/legacy/DataGrid/DataGrid.js +0 -670
- package/legacy/DataGrid/index.js +0 -2
- package/legacy/DataGrid/useDataGridComponent.js +0 -81
- package/legacy/DataGrid/useDataGridProps.js +0 -98
- package/legacy/colDef/gridActionsColDef.js +0 -18
- package/legacy/colDef/gridBooleanColDef.js +0 -42
- package/legacy/colDef/gridBooleanOperators.js +0 -16
- package/legacy/colDef/gridCheckboxSelectionColDef.js +0 -33
- package/legacy/colDef/gridDateColDef.js +0 -62
- package/legacy/colDef/gridDateOperators.js +0 -115
- package/legacy/colDef/gridDefaultColumnTypes.js +0 -19
- package/legacy/colDef/gridNumericColDef.js +0 -19
- package/legacy/colDef/gridNumericOperators.js +0 -145
- package/legacy/colDef/gridSingleSelectColDef.js +0 -64
- package/legacy/colDef/gridSingleSelectOperators.js +0 -46
- package/legacy/colDef/gridStringColDef.js +0 -27
- package/legacy/colDef/gridStringOperators.js +0 -112
- package/legacy/colDef/index.js +0 -13
- package/legacy/components/GridApiContext.js +0 -5
- package/legacy/components/GridColumnHeaders.js +0 -94
- package/legacy/components/GridDetailPanels.js +0 -4
- package/legacy/components/GridFooter.js +0 -42
- package/legacy/components/GridHeader.js +0 -13
- package/legacy/components/GridHeaders.js +0 -53
- package/legacy/components/GridLoadingOverlay.js +0 -21
- package/legacy/components/GridNoResultsOverlay.js +0 -14
- package/legacy/components/GridNoRowsOverlay.js +0 -23
- package/legacy/components/GridPagination.js +0 -85
- package/legacy/components/GridPinnedRows.js +0 -4
- package/legacy/components/GridRow.js +0 -457
- package/legacy/components/GridRowCount.js +0 -63
- package/legacy/components/GridScrollbarFillerCell.js +0 -34
- package/legacy/components/GridSelectedRowCount.js +0 -66
- package/legacy/components/base/GridBody.js +0 -2
- package/legacy/components/base/GridFooterPlaceholder.js +0 -12
- package/legacy/components/base/GridOverlays.js +0 -122
- package/legacy/components/base/index.js +0 -3
- package/legacy/components/cell/GridActionsCell.js +0 -294
- package/legacy/components/cell/GridActionsCellItem.js +0 -69
- package/legacy/components/cell/GridBooleanCell.js +0 -121
- package/legacy/components/cell/GridCell.js +0 -350
- package/legacy/components/cell/GridEditBooleanCell.js +0 -174
- package/legacy/components/cell/GridEditDateCell.js +0 -230
- package/legacy/components/cell/GridEditInputCell.js +0 -198
- package/legacy/components/cell/GridEditSingleSelectCell.js +0 -231
- package/legacy/components/cell/GridSkeletonCell.js +0 -52
- package/legacy/components/cell/index.js +0 -9
- package/legacy/components/columnHeaders/ColumnHeaderMenuIcon.js +0 -59
- package/legacy/components/columnHeaders/GridBaseColumnHeaders.js +0 -41
- package/legacy/components/columnHeaders/GridColumnGroupHeader.js +0 -132
- package/legacy/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -93
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +0 -212
- package/legacy/components/columnHeaders/GridColumnHeaderSeparator.js +0 -71
- package/legacy/components/columnHeaders/GridColumnHeaderSortIcon.js +0 -79
- package/legacy/components/columnHeaders/GridColumnHeaderTitle.js +0 -84
- package/legacy/components/columnHeaders/GridColumnHeadersInner.js +0 -55
- package/legacy/components/columnHeaders/GridGenericColumnHeaderItem.js +0 -107
- package/legacy/components/columnHeaders/GridIconButtonContainer.js +0 -41
- package/legacy/components/columnHeaders/index.js +0 -5
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +0 -160
- package/legacy/components/columnSelection/GridHeaderCheckbox.js +0 -134
- package/legacy/components/columnSelection/index.js +0 -2
- package/legacy/components/columnsManagement/GridColumnsManagement.js +0 -307
- package/legacy/components/columnsManagement/index.js +0 -1
- package/legacy/components/columnsManagement/utils.js +0 -22
- package/legacy/components/containers/GridFooterContainer.js +0 -50
- package/legacy/components/containers/GridOverlay.js +0 -52
- package/legacy/components/containers/GridRoot.js +0 -79
- package/legacy/components/containers/GridRootStyles.js +0 -398
- package/legacy/components/containers/GridToolbarContainer.js +0 -59
- package/legacy/components/containers/index.js +0 -4
- package/legacy/components/index.js +0 -19
- package/legacy/components/menu/GridMenu.js +0 -132
- package/legacy/components/menu/columnMenu/GridColumnHeaderMenu.js +0 -61
- package/legacy/components/menu/columnMenu/GridColumnMenu.js +0 -81
- package/legacy/components/menu/columnMenu/GridColumnMenuContainer.js +0 -56
- package/legacy/components/menu/columnMenu/GridColumnMenuItemProps.js +0 -1
- package/legacy/components/menu/columnMenu/GridColumnMenuProps.js +0 -1
- package/legacy/components/menu/columnMenu/index.js +0 -9
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.js +0 -21
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +0 -41
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +0 -60
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +0 -41
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +0 -80
- package/legacy/components/menu/columnMenu/menuItems/index.js +0 -5
- package/legacy/components/menu/index.js +0 -2
- package/legacy/components/panel/GridColumnsPanel.js +0 -22
- package/legacy/components/panel/GridPanel.js +0 -137
- package/legacy/components/panel/GridPanelContent.js +0 -49
- package/legacy/components/panel/GridPanelFooter.js +0 -50
- package/legacy/components/panel/GridPanelHeader.js +0 -48
- package/legacy/components/panel/GridPanelWrapper.js +0 -64
- package/legacy/components/panel/GridPreferencesPanel.js +0 -26
- package/legacy/components/panel/filterPanel/GridFilterForm.js +0 -528
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +0 -115
- package/legacy/components/panel/filterPanel/GridFilterInputDate.js +0 -121
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -116
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +0 -102
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +0 -146
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +0 -104
- package/legacy/components/panel/filterPanel/GridFilterInputValueProps.js +0 -1
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +0 -264
- package/legacy/components/panel/filterPanel/filterPanelUtils.js +0 -22
- package/legacy/components/panel/filterPanel/index.js +0 -9
- package/legacy/components/panel/index.js +0 -7
- package/legacy/components/reexportable.js +0 -1
- package/legacy/components/toolbar/GridToolbar.js +0 -64
- package/legacy/components/toolbar/GridToolbarColumnsButton.js +0 -68
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +0 -142
- package/legacy/components/toolbar/GridToolbarExport.js +0 -80
- package/legacy/components/toolbar/GridToolbarExportContainer.js +0 -105
- package/legacy/components/toolbar/GridToolbarFilterButton.js +0 -136
- package/legacy/components/toolbar/GridToolbarQuickFilter.js +0 -164
- package/legacy/components/toolbar/index.js +0 -7
- package/legacy/components/virtualization/GridBottomContainer.js +0 -25
- package/legacy/components/virtualization/GridMainContainer.js +0 -20
- package/legacy/components/virtualization/GridTopContainer.js +0 -35
- package/legacy/components/virtualization/GridVirtualScrollbar.js +0 -129
- package/legacy/components/virtualization/GridVirtualScroller.js +0 -93
- package/legacy/components/virtualization/GridVirtualScrollerContent.js +0 -35
- package/legacy/components/virtualization/GridVirtualScrollerFiller.js +0 -70
- package/legacy/components/virtualization/GridVirtualScrollerRenderZone.js +0 -42
- package/legacy/constants/defaultGridSlotsComponents.js +0 -33
- package/legacy/constants/envConstants.js +0 -19
- package/legacy/constants/gridClasses.js +0 -5
- package/legacy/constants/gridDetailPanelToggleField.js +0 -2
- package/legacy/constants/index.js +0 -3
- package/legacy/constants/localeTextConstants.js +0 -158
- package/legacy/context/GridContextProvider.js +0 -21
- package/legacy/context/GridRootPropsContext.js +0 -6
- package/legacy/context/index.js +0 -1
- package/legacy/hooks/core/gridCoreSelector.js +0 -7
- package/legacy/hooks/core/index.js +0 -1
- package/legacy/hooks/core/pipeProcessing/gridPipeProcessingApi.js +0 -1
- package/legacy/hooks/core/pipeProcessing/index.js +0 -4
- package/legacy/hooks/core/pipeProcessing/useGridPipeProcessing.js +0 -114
- package/legacy/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +0 -26
- package/legacy/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +0 -26
- package/legacy/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +0 -1
- package/legacy/hooks/core/strategyProcessing/index.js +0 -3
- package/legacy/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.js +0 -18
- package/legacy/hooks/core/strategyProcessing/useGridStrategyProcessing.js +0 -116
- package/legacy/hooks/core/useGridApiInitialization.js +0 -124
- package/legacy/hooks/core/useGridInitialization.js +0 -26
- package/legacy/hooks/core/useGridLocaleText.js +0 -12
- package/legacy/hooks/core/useGridLoggerFactory.js +0 -51
- package/legacy/hooks/core/useGridRefs.js +0 -13
- package/legacy/hooks/core/useGridStateInitialization.js +0 -106
- package/legacy/hooks/core/useGridTheme.js +0 -21
- package/legacy/hooks/features/clipboard/useGridClipboard.js +0 -92
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsInterfaces.js +0 -1
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsSelector.js +0 -24
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsUtils.js +0 -92
- package/legacy/hooks/features/columnGrouping/index.js +0 -2
- package/legacy/hooks/features/columnGrouping/useGridColumnGrouping.js +0 -140
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +0 -275
- package/legacy/hooks/features/columnMenu/columnMenuInterfaces.js +0 -1
- package/legacy/hooks/features/columnMenu/columnMenuSelector.js +0 -3
- package/legacy/hooks/features/columnMenu/index.js +0 -2
- package/legacy/hooks/features/columnMenu/useGridColumnMenu.js +0 -108
- package/legacy/hooks/features/columnMenu/useGridColumnMenuSlots.js +0 -71
- package/legacy/hooks/features/columns/gridColumnsInterfaces.js +0 -9
- package/legacy/hooks/features/columns/gridColumnsSelector.js +0 -174
- package/legacy/hooks/features/columns/gridColumnsUtils.js +0 -338
- package/legacy/hooks/features/columns/index.js +0 -2
- package/legacy/hooks/features/columns/useGridColumnSpanning.js +0 -105
- package/legacy/hooks/features/columns/useGridColumns.js +0 -319
- package/legacy/hooks/features/density/densitySelector.js +0 -10
- package/legacy/hooks/features/density/densityState.js +0 -1
- package/legacy/hooks/features/density/index.js +0 -2
- package/legacy/hooks/features/density/useGridDensity.js +0 -48
- package/legacy/hooks/features/dimensions/gridDimensionsApi.js +0 -1
- package/legacy/hooks/features/dimensions/gridDimensionsSelectors.js +0 -3
- package/legacy/hooks/features/dimensions/index.js +0 -2
- package/legacy/hooks/features/dimensions/useGridDimensions.js +0 -302
- package/legacy/hooks/features/editing/gridEditingSelectors.js +0 -4
- package/legacy/hooks/features/editing/useGridCellEditing.js +0 -456
- package/legacy/hooks/features/editing/useGridEditing.js +0 -145
- package/legacy/hooks/features/editing/useGridRowEditing.js +0 -567
- package/legacy/hooks/features/events/useGridEvents.js +0 -23
- package/legacy/hooks/features/export/serializers/csvSerializer.js +0 -155
- package/legacy/hooks/features/export/useGridCsvExport.js +0 -75
- package/legacy/hooks/features/export/useGridPrintExport.js +0 -313
- package/legacy/hooks/features/export/utils.js +0 -49
- package/legacy/hooks/features/filter/gridFilterSelector.js +0 -165
- package/legacy/hooks/features/filter/gridFilterState.js +0 -20
- package/legacy/hooks/features/filter/gridFilterUtils.js +0 -330
- package/legacy/hooks/features/filter/index.js +0 -2
- package/legacy/hooks/features/filter/useGridFilter.js +0 -378
- package/legacy/hooks/features/focus/gridFocusState.js +0 -1
- package/legacy/hooks/features/focus/gridFocusStateSelector.js +0 -31
- package/legacy/hooks/features/focus/index.js +0 -2
- package/legacy/hooks/features/focus/useGridFocus.js +0 -408
- package/legacy/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +0 -10
- package/legacy/hooks/features/headerFiltering/index.js +0 -1
- package/legacy/hooks/features/headerFiltering/useGridHeaderFiltering.js +0 -93
- package/legacy/hooks/features/index.js +0 -16
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +0 -565
- package/legacy/hooks/features/pagination/gridPaginationInterfaces.js +0 -1
- package/legacy/hooks/features/pagination/gridPaginationSelector.js +0 -115
- package/legacy/hooks/features/pagination/gridPaginationUtils.js +0 -31
- package/legacy/hooks/features/pagination/index.js +0 -2
- package/legacy/hooks/features/pagination/useGridPagination.js +0 -175
- package/legacy/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +0 -3
- package/legacy/hooks/features/preferencesPanel/gridPreferencePanelState.js +0 -1
- package/legacy/hooks/features/preferencesPanel/gridPreferencePanelsValue.js +0 -6
- package/legacy/hooks/features/preferencesPanel/index.js +0 -3
- package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +0 -125
- package/legacy/hooks/features/rowSelection/gridRowSelectionSelector.js +0 -19
- package/legacy/hooks/features/rowSelection/index.js +0 -1
- package/legacy/hooks/features/rowSelection/useGridRowSelection.js +0 -419
- package/legacy/hooks/features/rowSelection/useGridRowSelectionPreProcessors.js +0 -45
- package/legacy/hooks/features/rowSelection/utils.js +0 -8
- package/legacy/hooks/features/rows/gridRowsInterfaces.js +0 -1
- package/legacy/hooks/features/rows/gridRowsMetaSelector.js +0 -3
- package/legacy/hooks/features/rows/gridRowsMetaState.js +0 -1
- package/legacy/hooks/features/rows/gridRowsSelector.js +0 -90
- package/legacy/hooks/features/rows/gridRowsUtils.js +0 -294
- package/legacy/hooks/features/rows/index.js +0 -4
- package/legacy/hooks/features/rows/useGridParamsApi.js +0 -142
- package/legacy/hooks/features/rows/useGridRows.js +0 -466
- package/legacy/hooks/features/rows/useGridRowsMeta.js +0 -236
- package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +0 -82
- package/legacy/hooks/features/scroll/useGridScroll.js +0 -133
- package/legacy/hooks/features/sorting/gridSortingSelector.js +0 -56
- package/legacy/hooks/features/sorting/gridSortingState.js +0 -1
- package/legacy/hooks/features/sorting/gridSortingUtils.js +0 -154
- package/legacy/hooks/features/sorting/index.js +0 -2
- package/legacy/hooks/features/sorting/useGridSorting.js +0 -276
- package/legacy/hooks/features/statePersistence/gridStatePersistenceInterface.js +0 -1
- package/legacy/hooks/features/statePersistence/index.js +0 -1
- package/legacy/hooks/features/statePersistence/useGridStatePersistence.js +0 -25
- package/legacy/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -52
- package/legacy/hooks/features/virtualization/index.js +0 -2
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +0 -643
- package/legacy/hooks/features/virtualization/useGridVirtualization.js +0 -58
- package/legacy/hooks/index.js +0 -3
- package/legacy/hooks/utils/index.js +0 -9
- package/legacy/hooks/utils/useFirstRender.js +0 -8
- package/legacy/hooks/utils/useGridApiContext.js +0 -9
- package/legacy/hooks/utils/useGridApiEventHandler.js +0 -105
- package/legacy/hooks/utils/useGridApiMethod.js +0 -11
- package/legacy/hooks/utils/useGridApiRef.js +0 -7
- package/legacy/hooks/utils/useGridAriaAttributes.js +0 -25
- package/legacy/hooks/utils/useGridInitializeState.js +0 -8
- package/legacy/hooks/utils/useGridLogger.js +0 -10
- package/legacy/hooks/utils/useGridNativeEventListener.js +0 -32
- package/legacy/hooks/utils/useGridPrivateApiContext.js +0 -12
- package/legacy/hooks/utils/useGridRootProps.js +0 -9
- package/legacy/hooks/utils/useGridSelector.js +0 -54
- package/legacy/hooks/utils/useGridVisibleRows.js +0 -42
- package/legacy/hooks/utils/useLazyRef.js +0 -11
- package/legacy/hooks/utils/useOnMount.js +0 -7
- package/legacy/hooks/utils/useResizeObserver.js +0 -36
- package/legacy/hooks/utils/useRunOnce.js +0 -18
- package/legacy/hooks/utils/useTimeout.js +0 -38
- package/legacy/index.js +0 -38
- package/legacy/internals/index.js +0 -68
- package/legacy/internals/utils/computeSlots.js +0 -17
- package/legacy/internals/utils/index.js +0 -3
- package/legacy/internals/utils/propValidation.js +0 -21
- package/legacy/internals/utils/useProps.js +0 -32
- package/legacy/joy/icons.js +0 -432
- package/legacy/joy/index.js +0 -2
- package/legacy/joy/joySlots.js +0 -420
- package/legacy/locales/arSD.js +0 -160
- package/legacy/locales/beBY.js +0 -184
- package/legacy/locales/bgBG.js +0 -160
- package/legacy/locales/coreLocales.js +0 -62
- package/legacy/locales/csCZ.js +0 -181
- package/legacy/locales/daDK.js +0 -160
- package/legacy/locales/deDE.js +0 -160
- package/legacy/locales/elGR.js +0 -160
- package/legacy/locales/enUS.js +0 -4
- package/legacy/locales/esES.js +0 -160
- package/legacy/locales/faIR.js +0 -160
- package/legacy/locales/fiFI.js +0 -160
- package/legacy/locales/frFR.js +0 -160
- package/legacy/locales/heIL.js +0 -160
- package/legacy/locales/hrHR.js +0 -160
- package/legacy/locales/huHU.js +0 -160
- package/legacy/locales/index.js +0 -35
- package/legacy/locales/itIT.js +0 -160
- package/legacy/locales/jaJP.js +0 -160
- package/legacy/locales/koKR.js +0 -162
- package/legacy/locales/nbNO.js +0 -162
- package/legacy/locales/nlNL.js +0 -160
- package/legacy/locales/plPL.js +0 -163
- package/legacy/locales/ptBR.js +0 -160
- package/legacy/locales/ptPT.js +0 -160
- package/legacy/locales/roRO.js +0 -160
- package/legacy/locales/ruRU.js +0 -181
- package/legacy/locales/skSK.js +0 -181
- package/legacy/locales/svSE.js +0 -160
- package/legacy/locales/trTR.js +0 -161
- package/legacy/locales/ukUA.js +0 -182
- package/legacy/locales/urPK.js +0 -160
- package/legacy/locales/viVN.js +0 -160
- package/legacy/locales/zhCN.js +0 -160
- package/legacy/locales/zhHK.js +0 -160
- package/legacy/locales/zhTW.js +0 -160
- package/legacy/material/components/MUISelectOption.js +0 -14
- package/legacy/material/icons/GridColumnUnsortedIcon.js +0 -16
- package/legacy/material/icons/index.js +0 -89
- package/legacy/material/index.js +0 -69
- package/legacy/models/api/gridApiCommon.js +0 -1
- package/legacy/models/api/gridApiCommunity.js +0 -1
- package/legacy/models/api/gridCallbackDetails.js +0 -1
- package/legacy/models/api/gridColumnApi.js +0 -1
- package/legacy/models/api/gridColumnGroupingApi.js +0 -1
- package/legacy/models/api/gridColumnMenuApi.js +0 -1
- package/legacy/models/api/gridColumnSpanning.js +0 -1
- package/legacy/models/api/gridCoreApi.js +0 -1
- package/legacy/models/api/gridCsvExportApi.js +0 -1
- package/legacy/models/api/gridDensityApi.js +0 -1
- package/legacy/models/api/gridEditingApi.js +0 -1
- package/legacy/models/api/gridFilterApi.js +0 -1
- package/legacy/models/api/gridFocusApi.js +0 -1
- package/legacy/models/api/gridHeaderFilteringApi.js +0 -1
- package/legacy/models/api/gridLocaleTextApi.js +0 -1
- package/legacy/models/api/gridLoggerApi.js +0 -1
- package/legacy/models/api/gridParamsApi.js +0 -1
- package/legacy/models/api/gridPreferencesPanelApi.js +0 -1
- package/legacy/models/api/gridPrintExportApi.js +0 -1
- package/legacy/models/api/gridRowApi.js +0 -1
- package/legacy/models/api/gridRowSelectionApi.js +0 -1
- package/legacy/models/api/gridRowsMetaApi.js +0 -1
- package/legacy/models/api/gridScrollApi.js +0 -1
- package/legacy/models/api/gridSortApi.js +0 -1
- package/legacy/models/api/gridStateApi.js +0 -1
- package/legacy/models/api/gridVirtualizationApi.js +0 -1
- package/legacy/models/api/index.js +0 -16
- package/legacy/models/colDef/gridColDef.js +0 -1
- package/legacy/models/colDef/gridColType.js +0 -1
- package/legacy/models/colDef/gridColumnTypesRecord.js +0 -1
- package/legacy/models/colDef/index.js +0 -6
- package/legacy/models/controlStateItem.js +0 -1
- package/legacy/models/cursorCoordinates.js +0 -1
- package/legacy/models/elementSize.js +0 -1
- package/legacy/models/events/gridEventListener.js +0 -1
- package/legacy/models/events/gridEventLookup.js +0 -1
- package/legacy/models/events/gridEventPublisher.js +0 -1
- package/legacy/models/events/index.js +0 -3
- package/legacy/models/gridApiCaches.js +0 -1
- package/legacy/models/gridCell.js +0 -1
- package/legacy/models/gridCellClass.js +0 -1
- package/legacy/models/gridColumnGrouping.js +0 -11
- package/legacy/models/gridColumnHeaderClass.js +0 -1
- package/legacy/models/gridColumnSpanning.js +0 -1
- package/legacy/models/gridDensity.js +0 -1
- package/legacy/models/gridEditRowModel.js +0 -16
- package/legacy/models/gridExport.js +0 -1
- package/legacy/models/gridFeatureMode.js +0 -1
- package/legacy/models/gridFilterItem.js +0 -11
- package/legacy/models/gridFilterModel.js +0 -1
- package/legacy/models/gridFilterOperator.js +0 -1
- package/legacy/models/gridHeaderFilteringModel.js +0 -1
- package/legacy/models/gridIconSlotsComponent.js +0 -1
- package/legacy/models/gridPaginationProps.js +0 -1
- package/legacy/models/gridRenderContextProps.js +0 -1
- package/legacy/models/gridRowSelectionModel.js +0 -1
- package/legacy/models/gridRows.js +0 -1
- package/legacy/models/gridSlotsComponent.js +0 -1
- package/legacy/models/gridSlotsComponentsProps.js +0 -1
- package/legacy/models/gridSortModel.js +0 -1
- package/legacy/models/gridStateCommunity.js +0 -1
- package/legacy/models/index.js +0 -29
- package/legacy/models/logger.js +0 -1
- package/legacy/models/muiEvent.js +0 -1
- package/legacy/models/params/gridCellParams.js +0 -1
- package/legacy/models/params/gridColumnGroupHeaderParams.js +0 -1
- package/legacy/models/params/gridColumnHeaderParams.js +0 -1
- package/legacy/models/params/gridColumnOrderChangeParams.js +0 -1
- package/legacy/models/params/gridColumnResizeParams.js +0 -1
- package/legacy/models/params/gridEditCellParams.js +0 -27
- package/legacy/models/params/gridHeaderSelectionCheckboxParams.js +0 -1
- package/legacy/models/params/gridMenuParams.js +0 -1
- package/legacy/models/params/gridPreferencePanelParams.js +0 -1
- package/legacy/models/params/gridRowParams.js +0 -44
- package/legacy/models/params/gridRowSelectionCheckboxParams.js +0 -1
- package/legacy/models/params/gridScrollParams.js +0 -1
- package/legacy/models/params/gridValueOptionsParams.js +0 -1
- package/legacy/models/params/index.js +0 -13
- package/legacy/models/props/DataGridProps.js +0 -1
- package/legacy/themeAugmentation/index.js +0 -4
- package/legacy/themeAugmentation/overrides.js +0 -1
- package/legacy/themeAugmentation/props.js +0 -1
- package/legacy/utils/EventManager.js +0 -91
- package/legacy/utils/Store.js +0 -34
- package/legacy/utils/cleanupTracking/CleanupTracking.js +0 -1
- package/legacy/utils/cleanupTracking/FinalizationRegistryBasedCleanupTracking.js +0 -29
- package/legacy/utils/cleanupTracking/TimerBasedCleanupTracking.js +0 -52
- package/legacy/utils/createControllablePromise.js +0 -11
- package/legacy/utils/createSelector.js +0 -120
- package/legacy/utils/doesSupportPreventScroll.js +0 -13
- package/legacy/utils/domUtils.js +0 -49
- package/legacy/utils/exportAs.js +0 -40
- package/legacy/utils/fastMemo.js +0 -5
- package/legacy/utils/fastObjectShallowCompare.js +0 -32
- package/legacy/utils/getGridLocalization.js +0 -15
- package/legacy/utils/getPublicApiRef.js +0 -5
- package/legacy/utils/index.js +0 -1
- package/legacy/utils/keyboardUtils.js +0 -60
- package/legacy/utils/utils.js +0 -189
- package/legacy/utils/warning.js +0 -25
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "InputProps", "isFilterActive", "clearButton", "tabIndex", "disabled"];
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
|
-
import { unstable_useId as useId } from '@mui/utils';
|
|
8
|
-
import { useTimeout } from '../../../hooks/utils/useTimeout';
|
|
9
|
-
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
function convertFilterItemValueToInputValue(itemValue, inputType) {
|
|
12
|
-
if (itemValue == null) {
|
|
13
|
-
return '';
|
|
14
|
-
}
|
|
15
|
-
var dateCopy = new Date(itemValue);
|
|
16
|
-
// The date picker expects the date to be in the local timezone.
|
|
17
|
-
// But .toISOString() converts it to UTC with zero offset.
|
|
18
|
-
// So we need to subtract the timezone offset.
|
|
19
|
-
dateCopy.setMinutes(dateCopy.getMinutes() - dateCopy.getTimezoneOffset());
|
|
20
|
-
if (inputType === 'date') {
|
|
21
|
-
return dateCopy.toISOString().substring(0, 10);
|
|
22
|
-
}
|
|
23
|
-
if (inputType === 'datetime-local') {
|
|
24
|
-
return dateCopy.toISOString().substring(0, 19);
|
|
25
|
-
}
|
|
26
|
-
return dateCopy.toISOString().substring(0, 10);
|
|
27
|
-
}
|
|
28
|
-
function GridFilterInputDate(props) {
|
|
29
|
-
var _rootProps$slotProps;
|
|
30
|
-
var item = props.item,
|
|
31
|
-
applyValue = props.applyValue,
|
|
32
|
-
type = props.type,
|
|
33
|
-
apiRef = props.apiRef,
|
|
34
|
-
focusElementRef = props.focusElementRef,
|
|
35
|
-
InputProps = props.InputProps,
|
|
36
|
-
isFilterActive = props.isFilterActive,
|
|
37
|
-
clearButton = props.clearButton,
|
|
38
|
-
tabIndex = props.tabIndex,
|
|
39
|
-
disabled = props.disabled,
|
|
40
|
-
other = _objectWithoutProperties(props, _excluded);
|
|
41
|
-
var filterTimeout = useTimeout();
|
|
42
|
-
var _React$useState = React.useState(function () {
|
|
43
|
-
return convertFilterItemValueToInputValue(item.value, type);
|
|
44
|
-
}),
|
|
45
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
46
|
-
filterValueState = _React$useState2[0],
|
|
47
|
-
setFilterValueState = _React$useState2[1];
|
|
48
|
-
var _React$useState3 = React.useState(false),
|
|
49
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
50
|
-
applying = _React$useState4[0],
|
|
51
|
-
setIsApplying = _React$useState4[1];
|
|
52
|
-
var id = useId();
|
|
53
|
-
var rootProps = useGridRootProps();
|
|
54
|
-
var onFilterChange = React.useCallback(function (event) {
|
|
55
|
-
filterTimeout.clear();
|
|
56
|
-
var value = event.target.value;
|
|
57
|
-
setFilterValueState(value);
|
|
58
|
-
setIsApplying(true);
|
|
59
|
-
filterTimeout.start(rootProps.filterDebounceMs, function () {
|
|
60
|
-
applyValue(_extends({}, item, {
|
|
61
|
-
value: new Date(value)
|
|
62
|
-
}));
|
|
63
|
-
setIsApplying(false);
|
|
64
|
-
});
|
|
65
|
-
}, [applyValue, item, rootProps.filterDebounceMs, filterTimeout]);
|
|
66
|
-
React.useEffect(function () {
|
|
67
|
-
var value = convertFilterItemValueToInputValue(item.value, type);
|
|
68
|
-
setFilterValueState(value);
|
|
69
|
-
}, [item.value, type]);
|
|
70
|
-
return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
|
|
71
|
-
fullWidth: true,
|
|
72
|
-
id: id,
|
|
73
|
-
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
74
|
-
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
75
|
-
value: filterValueState,
|
|
76
|
-
onChange: onFilterChange,
|
|
77
|
-
variant: "standard",
|
|
78
|
-
type: type || 'text',
|
|
79
|
-
InputLabelProps: {
|
|
80
|
-
shrink: true
|
|
81
|
-
},
|
|
82
|
-
inputRef: focusElementRef,
|
|
83
|
-
InputProps: _extends({}, applying || clearButton ? {
|
|
84
|
-
endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
85
|
-
fontSize: "small",
|
|
86
|
-
color: "action"
|
|
87
|
-
}) : clearButton
|
|
88
|
-
} : {}, {
|
|
89
|
-
disabled: disabled
|
|
90
|
-
}, InputProps, {
|
|
91
|
-
inputProps: _extends({
|
|
92
|
-
max: type === 'datetime-local' ? '9999-12-31T23:59' : '9999-12-31',
|
|
93
|
-
tabIndex: tabIndex
|
|
94
|
-
}, InputProps == null ? void 0 : InputProps.inputProps)
|
|
95
|
-
})
|
|
96
|
-
}, other, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseTextField));
|
|
97
|
-
}
|
|
98
|
-
process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes = {
|
|
99
|
-
// ----------------------------- Warning --------------------------------
|
|
100
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
101
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
102
|
-
// ----------------------------------------------------------------------
|
|
103
|
-
apiRef: PropTypes.shape({
|
|
104
|
-
current: PropTypes.object.isRequired
|
|
105
|
-
}).isRequired,
|
|
106
|
-
applyValue: PropTypes.func.isRequired,
|
|
107
|
-
clearButton: PropTypes.node,
|
|
108
|
-
focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
|
|
109
|
-
/**
|
|
110
|
-
* It is `true` if the filter either has a value or an operator with no value
|
|
111
|
-
* required is selected (e.g. `isEmpty`)
|
|
112
|
-
*/
|
|
113
|
-
isFilterActive: PropTypes.bool,
|
|
114
|
-
item: PropTypes.shape({
|
|
115
|
-
field: PropTypes.string.isRequired,
|
|
116
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
117
|
-
operator: PropTypes.string.isRequired,
|
|
118
|
-
value: PropTypes.any
|
|
119
|
-
}).isRequired
|
|
120
|
-
} : void 0;
|
|
121
|
-
export { GridFilterInputDate };
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant"];
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
|
-
import Autocomplete, { createFilterOptions } from '@mui/material/Autocomplete';
|
|
7
|
-
import { unstable_useId as useId } from '@mui/utils';
|
|
8
|
-
import { getValueOptions, isSingleSelectColDef } from './filterPanelUtils';
|
|
9
|
-
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
var filter = createFilterOptions();
|
|
12
|
-
function GridFilterInputMultipleSingleSelect(props) {
|
|
13
|
-
var _resolvedColumn, _resolvedColumn2;
|
|
14
|
-
var item = props.item,
|
|
15
|
-
applyValue = props.applyValue,
|
|
16
|
-
type = props.type,
|
|
17
|
-
apiRef = props.apiRef,
|
|
18
|
-
focusElementRef = props.focusElementRef,
|
|
19
|
-
color = props.color,
|
|
20
|
-
error = props.error,
|
|
21
|
-
helperText = props.helperText,
|
|
22
|
-
size = props.size,
|
|
23
|
-
_props$variant = props.variant,
|
|
24
|
-
variant = _props$variant === void 0 ? 'standard' : _props$variant,
|
|
25
|
-
other = _objectWithoutProperties(props, _excluded);
|
|
26
|
-
var TextFieldProps = {
|
|
27
|
-
color: color,
|
|
28
|
-
error: error,
|
|
29
|
-
helperText: helperText,
|
|
30
|
-
size: size,
|
|
31
|
-
variant: variant
|
|
32
|
-
};
|
|
33
|
-
var id = useId();
|
|
34
|
-
var rootProps = useGridRootProps();
|
|
35
|
-
var resolvedColumn = null;
|
|
36
|
-
if (item.field) {
|
|
37
|
-
var column = apiRef.current.getColumn(item.field);
|
|
38
|
-
if (isSingleSelectColDef(column)) {
|
|
39
|
-
resolvedColumn = column;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
var getOptionValue = (_resolvedColumn = resolvedColumn) == null ? void 0 : _resolvedColumn.getOptionValue;
|
|
43
|
-
var getOptionLabel = (_resolvedColumn2 = resolvedColumn) == null ? void 0 : _resolvedColumn2.getOptionLabel;
|
|
44
|
-
var isOptionEqualToValue = React.useCallback(function (option, value) {
|
|
45
|
-
return getOptionValue(option) === getOptionValue(value);
|
|
46
|
-
}, [getOptionValue]);
|
|
47
|
-
var resolvedValueOptions = React.useMemo(function () {
|
|
48
|
-
return getValueOptions(resolvedColumn) || [];
|
|
49
|
-
}, [resolvedColumn]);
|
|
50
|
-
|
|
51
|
-
// The value is computed from the item.value and used directly
|
|
52
|
-
// If it was done by a useEffect/useState, the Autocomplete could receive incoherent value and options
|
|
53
|
-
var filteredValues = React.useMemo(function () {
|
|
54
|
-
if (!Array.isArray(item.value)) {
|
|
55
|
-
return [];
|
|
56
|
-
}
|
|
57
|
-
return item.value;
|
|
58
|
-
}, [item.value]);
|
|
59
|
-
var handleChange = React.useCallback(function (event, value) {
|
|
60
|
-
applyValue(_extends({}, item, {
|
|
61
|
-
value: value.map(getOptionValue)
|
|
62
|
-
}));
|
|
63
|
-
}, [applyValue, item, getOptionValue]);
|
|
64
|
-
return /*#__PURE__*/_jsx(Autocomplete, _extends({
|
|
65
|
-
multiple: true,
|
|
66
|
-
options: resolvedValueOptions,
|
|
67
|
-
isOptionEqualToValue: isOptionEqualToValue,
|
|
68
|
-
filterOptions: filter,
|
|
69
|
-
id: id,
|
|
70
|
-
value: filteredValues,
|
|
71
|
-
onChange: handleChange,
|
|
72
|
-
getOptionLabel: getOptionLabel,
|
|
73
|
-
renderTags: function renderTags(value, getTagProps) {
|
|
74
|
-
return value.map(function (option, index) {
|
|
75
|
-
return /*#__PURE__*/_jsx(rootProps.slots.baseChip, _extends({
|
|
76
|
-
variant: "outlined",
|
|
77
|
-
size: "small",
|
|
78
|
-
label: getOptionLabel(option)
|
|
79
|
-
}, getTagProps({
|
|
80
|
-
index: index
|
|
81
|
-
})));
|
|
82
|
-
});
|
|
83
|
-
},
|
|
84
|
-
renderInput: function renderInput(params) {
|
|
85
|
-
var _rootProps$slotProps;
|
|
86
|
-
return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({}, params, {
|
|
87
|
-
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
88
|
-
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
89
|
-
InputLabelProps: _extends({}, params.InputLabelProps, {
|
|
90
|
-
shrink: true
|
|
91
|
-
}),
|
|
92
|
-
inputRef: focusElementRef,
|
|
93
|
-
type: "singleSelect"
|
|
94
|
-
}, TextFieldProps, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseTextField));
|
|
95
|
-
}
|
|
96
|
-
}, other));
|
|
97
|
-
}
|
|
98
|
-
process.env.NODE_ENV !== "production" ? GridFilterInputMultipleSingleSelect.propTypes = {
|
|
99
|
-
// ----------------------------- Warning --------------------------------
|
|
100
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
101
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
102
|
-
// ----------------------------------------------------------------------
|
|
103
|
-
apiRef: PropTypes.shape({
|
|
104
|
-
current: PropTypes.object.isRequired
|
|
105
|
-
}).isRequired,
|
|
106
|
-
applyValue: PropTypes.func.isRequired,
|
|
107
|
-
focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
|
|
108
|
-
item: PropTypes.shape({
|
|
109
|
-
field: PropTypes.string.isRequired,
|
|
110
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
111
|
-
operator: PropTypes.string.isRequired,
|
|
112
|
-
value: PropTypes.any
|
|
113
|
-
}).isRequired,
|
|
114
|
-
type: PropTypes.oneOf(['singleSelect'])
|
|
115
|
-
} : void 0;
|
|
116
|
-
export { GridFilterInputMultipleSingleSelect };
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "color", "error", "helperText", "size", "variant"];
|
|
6
|
-
import * as React from 'react';
|
|
7
|
-
import PropTypes from 'prop-types';
|
|
8
|
-
import Autocomplete from '@mui/material/Autocomplete';
|
|
9
|
-
import { unstable_useId as useId } from '@mui/utils';
|
|
10
|
-
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
11
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
function GridFilterInputMultipleValue(props) {
|
|
13
|
-
var item = props.item,
|
|
14
|
-
applyValue = props.applyValue,
|
|
15
|
-
type = props.type,
|
|
16
|
-
apiRef = props.apiRef,
|
|
17
|
-
focusElementRef = props.focusElementRef,
|
|
18
|
-
color = props.color,
|
|
19
|
-
error = props.error,
|
|
20
|
-
helperText = props.helperText,
|
|
21
|
-
size = props.size,
|
|
22
|
-
variant = props.variant,
|
|
23
|
-
other = _objectWithoutProperties(props, _excluded);
|
|
24
|
-
var TextFieldProps = {
|
|
25
|
-
color: color,
|
|
26
|
-
error: error,
|
|
27
|
-
helperText: helperText,
|
|
28
|
-
size: size,
|
|
29
|
-
variant: variant
|
|
30
|
-
};
|
|
31
|
-
var _React$useState = React.useState(item.value || []),
|
|
32
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
33
|
-
filterValueState = _React$useState2[0],
|
|
34
|
-
setFilterValueState = _React$useState2[1];
|
|
35
|
-
var id = useId();
|
|
36
|
-
var rootProps = useGridRootProps();
|
|
37
|
-
React.useEffect(function () {
|
|
38
|
-
var _item$value;
|
|
39
|
-
var itemValue = (_item$value = item.value) != null ? _item$value : [];
|
|
40
|
-
setFilterValueState(itemValue.map(String));
|
|
41
|
-
}, [item.value]);
|
|
42
|
-
var handleChange = React.useCallback(function (event, value) {
|
|
43
|
-
setFilterValueState(value.map(String));
|
|
44
|
-
applyValue(_extends({}, item, {
|
|
45
|
-
value: _toConsumableArray(value)
|
|
46
|
-
}));
|
|
47
|
-
}, [applyValue, item]);
|
|
48
|
-
return /*#__PURE__*/_jsx(Autocomplete, _extends({
|
|
49
|
-
multiple: true,
|
|
50
|
-
freeSolo: true,
|
|
51
|
-
options: [],
|
|
52
|
-
filterOptions: function filterOptions(options, params) {
|
|
53
|
-
var inputValue = params.inputValue;
|
|
54
|
-
return inputValue == null || inputValue === '' ? [] : [inputValue];
|
|
55
|
-
},
|
|
56
|
-
id: id,
|
|
57
|
-
value: filterValueState,
|
|
58
|
-
onChange: handleChange,
|
|
59
|
-
renderTags: function renderTags(value, getTagProps) {
|
|
60
|
-
return value.map(function (option, index) {
|
|
61
|
-
return /*#__PURE__*/_jsx(rootProps.slots.baseChip, _extends({
|
|
62
|
-
variant: "outlined",
|
|
63
|
-
size: "small",
|
|
64
|
-
label: option
|
|
65
|
-
}, getTagProps({
|
|
66
|
-
index: index
|
|
67
|
-
})));
|
|
68
|
-
});
|
|
69
|
-
},
|
|
70
|
-
renderInput: function renderInput(params) {
|
|
71
|
-
var _rootProps$slotProps;
|
|
72
|
-
return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({}, params, {
|
|
73
|
-
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
74
|
-
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
75
|
-
InputLabelProps: _extends({}, params.InputLabelProps, {
|
|
76
|
-
shrink: true
|
|
77
|
-
}),
|
|
78
|
-
inputRef: focusElementRef,
|
|
79
|
-
type: type || 'text'
|
|
80
|
-
}, TextFieldProps, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseTextField));
|
|
81
|
-
}
|
|
82
|
-
}, other));
|
|
83
|
-
}
|
|
84
|
-
process.env.NODE_ENV !== "production" ? GridFilterInputMultipleValue.propTypes = {
|
|
85
|
-
// ----------------------------- Warning --------------------------------
|
|
86
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
87
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
88
|
-
// ----------------------------------------------------------------------
|
|
89
|
-
apiRef: PropTypes.shape({
|
|
90
|
-
current: PropTypes.object.isRequired
|
|
91
|
-
}).isRequired,
|
|
92
|
-
applyValue: PropTypes.func.isRequired,
|
|
93
|
-
focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
|
|
94
|
-
item: PropTypes.shape({
|
|
95
|
-
field: PropTypes.string.isRequired,
|
|
96
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
97
|
-
operator: PropTypes.string.isRequired,
|
|
98
|
-
value: PropTypes.any
|
|
99
|
-
}).isRequired,
|
|
100
|
-
type: PropTypes.oneOf(['number', 'text'])
|
|
101
|
-
} : void 0;
|
|
102
|
-
export { GridFilterInputMultipleValue };
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
5
|
-
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "placeholder", "tabIndex", "label", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
6
|
-
import * as React from 'react';
|
|
7
|
-
import PropTypes from 'prop-types';
|
|
8
|
-
import { unstable_useId as useId } from '@mui/utils';
|
|
9
|
-
import { styled } from '@mui/material/styles';
|
|
10
|
-
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
11
|
-
import { getValueFromValueOptions, getValueOptions, isSingleSelectColDef } from './filterPanelUtils';
|
|
12
|
-
import { createElement as _createElement } from "react";
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
-
var renderSingleSelectOptions = function renderSingleSelectOptions(_ref) {
|
|
16
|
-
var column = _ref.column,
|
|
17
|
-
OptionComponent = _ref.OptionComponent,
|
|
18
|
-
getOptionLabel = _ref.getOptionLabel,
|
|
19
|
-
getOptionValue = _ref.getOptionValue,
|
|
20
|
-
isSelectNative = _ref.isSelectNative,
|
|
21
|
-
baseSelectOptionProps = _ref.baseSelectOptionProps;
|
|
22
|
-
var iterableColumnValues = [''].concat(_toConsumableArray(getValueOptions(column) || []));
|
|
23
|
-
return iterableColumnValues.map(function (option) {
|
|
24
|
-
var value = getOptionValue(option);
|
|
25
|
-
var label = getOptionLabel(option);
|
|
26
|
-
if (label === '') {
|
|
27
|
-
label = ' '; // To force the height of the empty option
|
|
28
|
-
}
|
|
29
|
-
return /*#__PURE__*/_createElement(OptionComponent, _extends({}, baseSelectOptionProps, {
|
|
30
|
-
native: isSelectNative,
|
|
31
|
-
key: value,
|
|
32
|
-
value: value
|
|
33
|
-
}), label);
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
var SingleSelectOperatorContainer = styled('div')(_defineProperty({
|
|
37
|
-
display: 'flex',
|
|
38
|
-
alignItems: 'flex-end',
|
|
39
|
-
width: '100%'
|
|
40
|
-
}, "& button", {
|
|
41
|
-
margin: 'auto 0px 5px 5px'
|
|
42
|
-
}));
|
|
43
|
-
function GridFilterInputSingleSelect(props) {
|
|
44
|
-
var _item$value, _rootProps$slotProps$, _rootProps$slotProps, _resolvedColumn, _resolvedColumn2, _rootProps$slotProps2, _rootProps$slotProps3, _rootProps$slotProps4;
|
|
45
|
-
var item = props.item,
|
|
46
|
-
applyValue = props.applyValue,
|
|
47
|
-
type = props.type,
|
|
48
|
-
apiRef = props.apiRef,
|
|
49
|
-
focusElementRef = props.focusElementRef,
|
|
50
|
-
placeholder = props.placeholder,
|
|
51
|
-
tabIndex = props.tabIndex,
|
|
52
|
-
labelProp = props.label,
|
|
53
|
-
isFilterActive = props.isFilterActive,
|
|
54
|
-
clearButton = props.clearButton,
|
|
55
|
-
InputLabelProps = props.InputLabelProps,
|
|
56
|
-
others = _objectWithoutProperties(props, _excluded);
|
|
57
|
-
var filterValue = (_item$value = item.value) != null ? _item$value : '';
|
|
58
|
-
var id = useId();
|
|
59
|
-
var labelId = useId();
|
|
60
|
-
var rootProps = useGridRootProps();
|
|
61
|
-
var isSelectNative = (_rootProps$slotProps$ = (_rootProps$slotProps = rootProps.slotProps) == null || (_rootProps$slotProps = _rootProps$slotProps.baseSelect) == null ? void 0 : _rootProps$slotProps.native) != null ? _rootProps$slotProps$ : false;
|
|
62
|
-
var resolvedColumn = null;
|
|
63
|
-
if (item.field) {
|
|
64
|
-
var column = apiRef.current.getColumn(item.field);
|
|
65
|
-
if (isSingleSelectColDef(column)) {
|
|
66
|
-
resolvedColumn = column;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
var getOptionValue = (_resolvedColumn = resolvedColumn) == null ? void 0 : _resolvedColumn.getOptionValue;
|
|
70
|
-
var getOptionLabel = (_resolvedColumn2 = resolvedColumn) == null ? void 0 : _resolvedColumn2.getOptionLabel;
|
|
71
|
-
var currentValueOptions = React.useMemo(function () {
|
|
72
|
-
return getValueOptions(resolvedColumn);
|
|
73
|
-
}, [resolvedColumn]);
|
|
74
|
-
var onFilterChange = React.useCallback(function (event) {
|
|
75
|
-
var value = event.target.value;
|
|
76
|
-
|
|
77
|
-
// NativeSelect casts the value to a string.
|
|
78
|
-
value = getValueFromValueOptions(value, currentValueOptions, getOptionValue);
|
|
79
|
-
applyValue(_extends({}, item, {
|
|
80
|
-
value: value
|
|
81
|
-
}));
|
|
82
|
-
}, [currentValueOptions, getOptionValue, applyValue, item]);
|
|
83
|
-
if (!isSingleSelectColDef(resolvedColumn)) {
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
var label = labelProp != null ? labelProp : apiRef.current.getLocaleText('filterPanelInputLabel');
|
|
87
|
-
return /*#__PURE__*/_jsxs(SingleSelectOperatorContainer, {
|
|
88
|
-
children: [/*#__PURE__*/_jsxs(rootProps.slots.baseFormControl, {
|
|
89
|
-
fullWidth: true,
|
|
90
|
-
children: [/*#__PURE__*/_jsx(rootProps.slots.baseInputLabel, _extends({}, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseInputLabel, {
|
|
91
|
-
id: labelId,
|
|
92
|
-
htmlFor: id,
|
|
93
|
-
shrink: true,
|
|
94
|
-
variant: "standard",
|
|
95
|
-
children: label
|
|
96
|
-
})), /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
|
|
97
|
-
id: id,
|
|
98
|
-
label: label,
|
|
99
|
-
labelId: labelId,
|
|
100
|
-
value: filterValue,
|
|
101
|
-
onChange: onFilterChange,
|
|
102
|
-
variant: "standard",
|
|
103
|
-
type: type || 'text',
|
|
104
|
-
inputProps: {
|
|
105
|
-
tabIndex: tabIndex,
|
|
106
|
-
ref: focusElementRef,
|
|
107
|
-
placeholder: placeholder != null ? placeholder : apiRef.current.getLocaleText('filterPanelInputPlaceholder')
|
|
108
|
-
},
|
|
109
|
-
native: isSelectNative
|
|
110
|
-
}, others /* FIXME: typing error */, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseSelect, {
|
|
111
|
-
children: renderSingleSelectOptions({
|
|
112
|
-
column: resolvedColumn,
|
|
113
|
-
OptionComponent: rootProps.slots.baseSelectOption,
|
|
114
|
-
getOptionLabel: getOptionLabel,
|
|
115
|
-
getOptionValue: getOptionValue,
|
|
116
|
-
isSelectNative: isSelectNative,
|
|
117
|
-
baseSelectOptionProps: (_rootProps$slotProps4 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps4.baseSelectOption
|
|
118
|
-
})
|
|
119
|
-
}))]
|
|
120
|
-
}), clearButton]
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes = {
|
|
124
|
-
// ----------------------------- Warning --------------------------------
|
|
125
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
126
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
127
|
-
// ----------------------------------------------------------------------
|
|
128
|
-
apiRef: PropTypes.shape({
|
|
129
|
-
current: PropTypes.object.isRequired
|
|
130
|
-
}).isRequired,
|
|
131
|
-
applyValue: PropTypes.func.isRequired,
|
|
132
|
-
clearButton: PropTypes.node,
|
|
133
|
-
focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
|
|
134
|
-
/**
|
|
135
|
-
* It is `true` if the filter either has a value or an operator with no value
|
|
136
|
-
* required is selected (e.g. `isEmpty`)
|
|
137
|
-
*/
|
|
138
|
-
isFilterActive: PropTypes.bool,
|
|
139
|
-
item: PropTypes.shape({
|
|
140
|
-
field: PropTypes.string.isRequired,
|
|
141
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
142
|
-
operator: PropTypes.string.isRequired,
|
|
143
|
-
value: PropTypes.any
|
|
144
|
-
}).isRequired
|
|
145
|
-
} : void 0;
|
|
146
|
-
export { GridFilterInputSingleSelect };
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "tabIndex", "disabled", "isFilterActive", "clearButton", "InputProps"];
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
|
-
import { unstable_useId as useId } from '@mui/utils';
|
|
8
|
-
import { useTimeout } from '../../../hooks/utils/useTimeout';
|
|
9
|
-
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
function GridFilterInputValue(props) {
|
|
12
|
-
var _item$value, _rootProps$slotProps;
|
|
13
|
-
var item = props.item,
|
|
14
|
-
applyValue = props.applyValue,
|
|
15
|
-
type = props.type,
|
|
16
|
-
apiRef = props.apiRef,
|
|
17
|
-
focusElementRef = props.focusElementRef,
|
|
18
|
-
tabIndex = props.tabIndex,
|
|
19
|
-
disabled = props.disabled,
|
|
20
|
-
isFilterActive = props.isFilterActive,
|
|
21
|
-
clearButton = props.clearButton,
|
|
22
|
-
InputProps = props.InputProps,
|
|
23
|
-
others = _objectWithoutProperties(props, _excluded);
|
|
24
|
-
var filterTimeout = useTimeout();
|
|
25
|
-
var _React$useState = React.useState((_item$value = item.value) != null ? _item$value : ''),
|
|
26
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
27
|
-
filterValueState = _React$useState2[0],
|
|
28
|
-
setFilterValueState = _React$useState2[1];
|
|
29
|
-
var _React$useState3 = React.useState(false),
|
|
30
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
31
|
-
applying = _React$useState4[0],
|
|
32
|
-
setIsApplying = _React$useState4[1];
|
|
33
|
-
var id = useId();
|
|
34
|
-
var rootProps = useGridRootProps();
|
|
35
|
-
var onFilterChange = React.useCallback(function (event) {
|
|
36
|
-
var value = event.target.value;
|
|
37
|
-
setFilterValueState(String(value));
|
|
38
|
-
setIsApplying(true);
|
|
39
|
-
filterTimeout.start(rootProps.filterDebounceMs, function () {
|
|
40
|
-
var newItem = _extends({}, item, {
|
|
41
|
-
value: value,
|
|
42
|
-
fromInput: id
|
|
43
|
-
});
|
|
44
|
-
applyValue(newItem);
|
|
45
|
-
setIsApplying(false);
|
|
46
|
-
});
|
|
47
|
-
}, [id, applyValue, item, rootProps.filterDebounceMs, filterTimeout]);
|
|
48
|
-
React.useEffect(function () {
|
|
49
|
-
var itemPlusTag = item;
|
|
50
|
-
if (itemPlusTag.fromInput !== id || item.value === undefined) {
|
|
51
|
-
var _item$value2;
|
|
52
|
-
setFilterValueState(String((_item$value2 = item.value) != null ? _item$value2 : ''));
|
|
53
|
-
}
|
|
54
|
-
}, [id, item]);
|
|
55
|
-
return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
|
|
56
|
-
id: id,
|
|
57
|
-
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
58
|
-
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
59
|
-
value: filterValueState,
|
|
60
|
-
onChange: onFilterChange,
|
|
61
|
-
variant: "standard",
|
|
62
|
-
type: type || 'text',
|
|
63
|
-
InputProps: _extends({}, applying || clearButton ? {
|
|
64
|
-
endAdornment: applying ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
65
|
-
fontSize: "small",
|
|
66
|
-
color: "action"
|
|
67
|
-
}) : clearButton
|
|
68
|
-
} : {}, {
|
|
69
|
-
disabled: disabled
|
|
70
|
-
}, InputProps, {
|
|
71
|
-
inputProps: _extends({
|
|
72
|
-
tabIndex: tabIndex
|
|
73
|
-
}, InputProps == null ? void 0 : InputProps.inputProps)
|
|
74
|
-
}),
|
|
75
|
-
InputLabelProps: {
|
|
76
|
-
shrink: true
|
|
77
|
-
},
|
|
78
|
-
inputRef: focusElementRef
|
|
79
|
-
}, others, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseTextField));
|
|
80
|
-
}
|
|
81
|
-
process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes = {
|
|
82
|
-
// ----------------------------- Warning --------------------------------
|
|
83
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
84
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
85
|
-
// ----------------------------------------------------------------------
|
|
86
|
-
apiRef: PropTypes.shape({
|
|
87
|
-
current: PropTypes.object.isRequired
|
|
88
|
-
}).isRequired,
|
|
89
|
-
applyValue: PropTypes.func.isRequired,
|
|
90
|
-
clearButton: PropTypes.node,
|
|
91
|
-
focusElementRef: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.func, PropTypes.object]),
|
|
92
|
-
/**
|
|
93
|
-
* It is `true` if the filter either has a value or an operator with no value
|
|
94
|
-
* required is selected (e.g. `isEmpty`)
|
|
95
|
-
*/
|
|
96
|
-
isFilterActive: PropTypes.bool,
|
|
97
|
-
item: PropTypes.shape({
|
|
98
|
-
field: PropTypes.string.isRequired,
|
|
99
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
100
|
-
operator: PropTypes.string.isRequired,
|
|
101
|
-
value: PropTypes.any
|
|
102
|
-
}).isRequired
|
|
103
|
-
} : void 0;
|
|
104
|
-
export { GridFilterInputValue };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|