@mui/x-data-grid 8.7.0 → 8.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/components/GridScrollArea.d.ts +1 -1
  3. package/components/GridScrollArea.js +134 -28
  4. package/components/containers/GridRootStyles.js +2 -0
  5. package/components/virtualization/GridVirtualScroller.js +4 -0
  6. package/constants/gridClasses.d.ts +8 -0
  7. package/constants/gridClasses.js +1 -1
  8. package/esm/components/GridScrollArea.d.ts +1 -1
  9. package/esm/components/GridScrollArea.js +134 -28
  10. package/esm/components/containers/GridRootStyles.js +2 -0
  11. package/esm/components/virtualization/GridVirtualScroller.js +4 -0
  12. package/esm/constants/gridClasses.d.ts +8 -0
  13. package/esm/constants/gridClasses.js +1 -1
  14. package/esm/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
  15. package/esm/hooks/features/dataSource/useGridDataSourceBase.js +3 -0
  16. package/esm/hooks/features/dataSource/utils.js +3 -0
  17. package/esm/hooks/utils/useGridSelector.js +4 -0
  18. package/esm/index.js +1 -1
  19. package/esm/internals/utils/cache.d.ts +9 -0
  20. package/esm/internals/utils/cache.js +19 -0
  21. package/esm/internals/utils/index.d.ts +2 -1
  22. package/esm/internals/utils/index.js +2 -1
  23. package/esm/locales/idID.d.ts +4 -0
  24. package/esm/locales/idID.js +261 -0
  25. package/esm/locales/index.d.ts +2 -1
  26. package/esm/locales/index.js +2 -1
  27. package/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
  28. package/hooks/features/dataSource/useGridDataSourceBase.js +3 -0
  29. package/hooks/features/dataSource/utils.js +3 -0
  30. package/hooks/utils/useGridSelector.js +4 -0
  31. package/index.js +1 -1
  32. package/internals/utils/cache.d.ts +9 -0
  33. package/internals/utils/cache.js +26 -0
  34. package/internals/utils/index.d.ts +2 -1
  35. package/internals/utils/index.js +11 -0
  36. package/locales/idID.d.ts +4 -0
  37. package/locales/idID.js +267 -0
  38. package/locales/index.d.ts +2 -1
  39. package/locales/index.js +11 -0
  40. package/package.json +3 -3
@@ -836,6 +836,8 @@ export const GridRootStyles = styled('div', {
836
836
  [`&.${c['scrollbarFiller--pinnedRight']}`]: {
837
837
  backgroundColor: vars.cell.background.pinned,
838
838
  position: 'sticky',
839
+ zIndex: 40,
840
+ // Should be above the column separator
839
841
  right: 0
840
842
  }
841
843
  },
@@ -97,6 +97,10 @@ function GridVirtualScroller(props) {
97
97
  scrollDirection: "left"
98
98
  }, getScrollAreaProps())), /*#__PURE__*/_jsx(GridScrollArea, _extends({
99
99
  scrollDirection: "right"
100
+ }, getScrollAreaProps())), /*#__PURE__*/_jsx(GridScrollArea, _extends({
101
+ scrollDirection: "up"
102
+ }, getScrollAreaProps())), /*#__PURE__*/_jsx(GridScrollArea, _extends({
103
+ scrollDirection: "down"
100
104
  }, getScrollAreaProps())), /*#__PURE__*/_jsxs(Scroller, _extends({
101
105
  className: classes.scroller
102
106
  }, getScrollerProps(), {
@@ -639,6 +639,14 @@ export interface GridClasses {
639
639
  * Styles applied to the right scroll area element.
640
640
  */
641
641
  'scrollArea--right': string;
642
+ /**
643
+ * Styles applied to the top scroll area element.
644
+ */
645
+ 'scrollArea--up': string;
646
+ /**
647
+ * Styles applied to the bottom scroll area element.
648
+ */
649
+ 'scrollArea--down': string;
642
650
  /**
643
651
  * Styles applied to the scrollbars.
644
652
  */
@@ -3,4 +3,4 @@ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
3
3
  export function getDataGridUtilityClass(slot) {
4
4
  return generateUtilityClass('MuiDataGrid', slot);
5
5
  }
6
- export const gridClasses = generateUtilityClasses('MuiDataGrid', ['aiAssistantPanel', 'aiAssistantPanelHeader', 'aiAssistantPanelTitleContainer', 'aiAssistantPanelTitle', 'aiAssistantPanelBody', 'aiAssistantPanelEmptyText', 'aiAssistantPanelFooter', 'aiAssistantPanelConversation', 'aiAssistantPanelConversationList', 'aiAssistantPanelConversationTitle', 'aiAssistantPanelSuggestions', 'aiAssistantPanelSuggestionsList', 'aiAssistantPanelSuggestionsItem', 'aiAssistantPanelSuggestionsLabel', 'actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'aggregationRowOverlayWrapper', 'autoHeight', 'autosizing', 'mainContent', 'withSidePanel', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--flex', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell--pinnedLeft', 'cell--pinnedRight', 'cell--selectionMode', 'cell', 'cellCheckbox', 'cellEmpty', 'cellSkeleton', 'cellOffsetLeft', 'checkboxInput', 'collapsible', 'collapsibleTrigger', 'collapsibleIcon', 'collapsiblePanel', 'columnHeader', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader--pinnedLeft', 'columnHeader--pinnedRight', 'columnHeader--last', 'columnHeader--lastUnpinned', 'columnHeader--siblingFocused', 'columnHeader--filter', 'columnHeaderFilterInput', 'columnHeaderFilterOperatorLabel', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeaders', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsManagement', 'columnsManagementRow', 'columnsManagementHeader', 'columnsManagementSearchInput', 'columnsManagementFooter', 'columnsManagementScrollArea', 'columnsManagementEmptyText', 'container--top', 'container--bottom', 'detailPanel', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filler', 'filler--borderBottom', 'filler--pinnedLeft', 'filler--pinnedRight', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'headerFilterRow', 'iconButtonContainer', 'iconSeparator', 'main', 'main--hasPinnedRight', 'main--hiddenContent', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'root--noToolbar', 'row', 'row--editable', 'row--editing', 'row--firstVisible', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'row--borderBottom', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'rowReorderIcon', 'rowSkeleton', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'scrollbar', 'scrollbar--vertical', 'scrollbar--horizontal', 'scrollbarFiller', 'scrollbarFiller--header', 'scrollbarFiller--borderTop', 'scrollbarFiller--borderBottom', 'scrollbarFiller--pinnedRight', 'selectedRowCount', 'sortButton', 'sortIcon', 'shadowScrollArea', 'sidebar', 'sidebarHeader', 'toolbarContainer', 'toolbar', 'toolbarLabel', 'toolbarDivider', 'toolbarFilterList', 'toolbarQuickFilter', 'toolbarQuickFilterTrigger', 'toolbarQuickFilterControl', 'virtualScroller', 'virtualScroller--hasScrollX', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'withVerticalBorder', 'withBorderColor', 'cell--withRightBorder', 'cell--withLeftBorder', 'columnHeader--withRightBorder', 'columnHeader--withLeftBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'treeDataGroupingCellLoadingContainer', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'groupingCriteriaCellLoadingContainer', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pivotPanelAvailableFields', 'pivotPanelField', 'pivotPanelField--sorted', 'pivotPanelFieldActionContainer', 'pivotPanelFieldCheckbox', 'pivotPanelFieldDragIcon', 'pivotPanelFieldList', 'pivotPanelFieldName', 'pivotPanelHeader', 'pivotPanelPlaceholder', 'pivotPanelScrollArea', 'pivotPanelSearchContainer', 'pivotPanelSection', 'pivotPanelSectionTitle', 'pivotPanelSections', 'pivotPanelSwitch', 'pivotPanelSwitchLabel', 'prompt', 'promptContent', 'promptText', 'promptFeedback', 'promptChangeList', 'promptChangesToggle', 'promptChangesToggleIcon', 'promptIcon', 'promptIconContainer', 'promptError', 'promptAction']);
6
+ export const gridClasses = generateUtilityClasses('MuiDataGrid', ['aiAssistantPanel', 'aiAssistantPanelHeader', 'aiAssistantPanelTitleContainer', 'aiAssistantPanelTitle', 'aiAssistantPanelBody', 'aiAssistantPanelEmptyText', 'aiAssistantPanelFooter', 'aiAssistantPanelConversation', 'aiAssistantPanelConversationList', 'aiAssistantPanelConversationTitle', 'aiAssistantPanelSuggestions', 'aiAssistantPanelSuggestionsList', 'aiAssistantPanelSuggestionsItem', 'aiAssistantPanelSuggestionsLabel', 'actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'aggregationRowOverlayWrapper', 'autoHeight', 'autosizing', 'mainContent', 'withSidePanel', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--flex', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell--pinnedLeft', 'cell--pinnedRight', 'cell--selectionMode', 'cell', 'cellCheckbox', 'cellEmpty', 'cellSkeleton', 'cellOffsetLeft', 'checkboxInput', 'collapsible', 'collapsibleTrigger', 'collapsibleIcon', 'collapsiblePanel', 'columnHeader', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader--pinnedLeft', 'columnHeader--pinnedRight', 'columnHeader--last', 'columnHeader--lastUnpinned', 'columnHeader--siblingFocused', 'columnHeader--filter', 'columnHeaderFilterInput', 'columnHeaderFilterOperatorLabel', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeaders', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsManagement', 'columnsManagementRow', 'columnsManagementHeader', 'columnsManagementSearchInput', 'columnsManagementFooter', 'columnsManagementScrollArea', 'columnsManagementEmptyText', 'container--top', 'container--bottom', 'detailPanel', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filler', 'filler--borderBottom', 'filler--pinnedLeft', 'filler--pinnedRight', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'headerFilterRow', 'iconButtonContainer', 'iconSeparator', 'main', 'main--hasPinnedRight', 'main--hiddenContent', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'root--noToolbar', 'row', 'row--editable', 'row--editing', 'row--firstVisible', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'row--borderBottom', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'rowReorderIcon', 'rowSkeleton', 'scrollArea--left', 'scrollArea--right', 'scrollArea--up', 'scrollArea--down', 'scrollArea', 'scrollbar', 'scrollbar--vertical', 'scrollbar--horizontal', 'scrollbarFiller', 'scrollbarFiller--header', 'scrollbarFiller--borderTop', 'scrollbarFiller--borderBottom', 'scrollbarFiller--pinnedRight', 'selectedRowCount', 'sortButton', 'sortIcon', 'shadowScrollArea', 'sidebar', 'sidebarHeader', 'toolbarContainer', 'toolbar', 'toolbarLabel', 'toolbarDivider', 'toolbarFilterList', 'toolbarQuickFilter', 'toolbarQuickFilterTrigger', 'toolbarQuickFilterControl', 'virtualScroller', 'virtualScroller--hasScrollX', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'withVerticalBorder', 'withBorderColor', 'cell--withRightBorder', 'cell--withLeftBorder', 'columnHeader--withRightBorder', 'columnHeader--withLeftBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'treeDataGroupingCellLoadingContainer', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'groupingCriteriaCellLoadingContainer', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pivotPanelAvailableFields', 'pivotPanelField', 'pivotPanelField--sorted', 'pivotPanelFieldActionContainer', 'pivotPanelFieldCheckbox', 'pivotPanelFieldDragIcon', 'pivotPanelFieldList', 'pivotPanelFieldName', 'pivotPanelHeader', 'pivotPanelPlaceholder', 'pivotPanelScrollArea', 'pivotPanelSearchContainer', 'pivotPanelSection', 'pivotPanelSectionTitle', 'pivotPanelSections', 'pivotPanelSwitch', 'pivotPanelSwitchLabel', 'prompt', 'promptContent', 'promptText', 'promptFeedback', 'promptChangeList', 'promptChangesToggle', 'promptChangesToggleIcon', 'promptIcon', 'promptIconContainer', 'promptError', 'promptAction']);
@@ -6,7 +6,7 @@ import type { GridPrivateApiCommunity } from "../../../models/api/gridApiCommuni
6
6
  import type { DataGridProcessedProps } from "../../../models/props/DataGridProps.js";
7
7
  import type { GridStrategyProcessor } from "../../core/strategyProcessing/index.js";
8
8
  import type { GridEventListener } from "../../../models/events/index.js";
9
- export declare const useGridDataSourceBase: <Api extends GridPrivateApiCommunity>(apiRef: RefObject<Api>, props: Pick<DataGridProcessedProps, "dataSource" | "dataSourceCache" | "onDataSourceError" | "pageSizeOptions" | "signature">, options?: GridDataSourceBaseOptions) => {
9
+ export declare const useGridDataSourceBase: <Api extends GridPrivateApiCommunity>(apiRef: RefObject<Api>, props: Pick<DataGridProcessedProps, "dataSource" | "dataSourceCache" | "onDataSourceError" | "pageSizeOptions" | "pagination" | "signature">, options?: GridDataSourceBaseOptions) => {
10
10
  api: {
11
11
  public: GridDataSourceApi;
12
12
  };
@@ -35,6 +35,9 @@ export const useGridDataSourceBase = (apiRef, props, options = {}) => {
35
35
  const lastRequestId = React.useRef(0);
36
36
  const onDataSourceErrorProp = props.onDataSourceError;
37
37
  const cacheChunkManager = useLazyRef(() => {
38
+ if (!props.pagination) {
39
+ return new CacheChunkManager(paginationModel.pageSize);
40
+ }
38
41
  const sortedPageSizeOptions = props.pageSizeOptions.map(option => typeof option === 'number' ? option : option.value).sort((a, b) => a - b);
39
42
  const cacheChunkSize = Math.min(paginationModel.pageSize, sortedPageSizeOptions[0]);
40
43
  return new CacheChunkManager(cacheChunkSize);
@@ -37,6 +37,9 @@ export class CacheChunkManager {
37
37
  };
38
38
  this.splitResponse = (key, response) => {
39
39
  const cacheKeys = this.getCacheKeys(key);
40
+ if (cacheKeys.length === 1) {
41
+ return new Map([[key, response]]);
42
+ }
40
43
  const responses = new Map();
41
44
  cacheKeys.forEach(chunkKey => {
42
45
  const isLastChunk = chunkKey.end === key.end;
@@ -69,6 +69,10 @@ export function useGridSelector(apiRef, selector, args = undefined, equals = def
69
69
  // eslint-disable-next-line react-hooks/exhaustive-deps
70
70
  EMPTY);
71
71
  const unsubscribe = React.useCallback(() => {
72
+ // Fixes issue in React Strict Mode, where getSnapshot is not called
73
+ if (!refs.current.subscription) {
74
+ subscribe();
75
+ }
72
76
  return () => {
73
77
  if (refs.current.subscription) {
74
78
  refs.current.subscription();
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v8.7.0
2
+ * @mui/x-data-grid v8.8.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -0,0 +1,9 @@
1
+ import { GridGetRowsParams, GridGetRowsResponse } from "../../models/gridDataSource.js";
2
+ export declare class TestCache {
3
+ private cache;
4
+ constructor();
5
+ set(key: GridGetRowsParams, value: GridGetRowsResponse): void;
6
+ get(key: GridGetRowsParams): GridGetRowsResponse | undefined;
7
+ size(): number;
8
+ clear(): void;
9
+ }
@@ -0,0 +1,19 @@
1
+ import { getKeyDefault } from "../../hooks/features/dataSource/cache.js";
2
+ export class TestCache {
3
+ constructor() {
4
+ this.cache = void 0;
5
+ this.cache = new Map();
6
+ }
7
+ set(key, value) {
8
+ this.cache.set(getKeyDefault(key), value);
9
+ }
10
+ get(key) {
11
+ return this.cache.get(getKeyDefault(key));
12
+ }
13
+ size() {
14
+ return this.cache.size;
15
+ }
16
+ clear() {
17
+ this.cache.clear();
18
+ }
19
+ }
@@ -1,4 +1,5 @@
1
1
  export * from "./computeSlots.js";
2
2
  export * from "./propValidation.js";
3
3
  export * from "./gridRowGroupingUtils.js";
4
- export * from "./attachPinnedStyle.js";
4
+ export * from "./attachPinnedStyle.js";
5
+ export * from "./cache.js";
@@ -1,4 +1,5 @@
1
1
  export * from "./computeSlots.js";
2
2
  export * from "./propValidation.js";
3
3
  export * from "./gridRowGroupingUtils.js";
4
- export * from "./attachPinnedStyle.js";
4
+ export * from "./attachPinnedStyle.js";
5
+ export * from "./cache.js";
@@ -0,0 +1,4 @@
1
+ import { GridLocaleText } from "../models/api/gridLocaleTextApi.js";
2
+ import { Localization } from "../utils/getGridLocalization.js";
3
+ export declare const idIDGrid: GridLocaleText;
4
+ export declare const idID: Localization;
@@ -0,0 +1,261 @@
1
+ import { getGridLocalization } from "../utils/getGridLocalization.js";
2
+ export const idIDGrid = {
3
+ // Root
4
+ noRowsLabel: 'Tidak ad abaris',
5
+ noResultsOverlayLabel: 'Tidak ada hasil yang ditemukan.',
6
+ noColumnsOverlayLabel: 'Tidak ada kolom',
7
+ noColumnsOverlayManageColumns: 'Kelola columns',
8
+ emptyPivotOverlayLabel: 'Tambahkan bidang ke baris, kolom, dan nilai untuk membuat tabel pivot',
9
+ // Density selector toolbar button text
10
+ toolbarDensity: 'Kepadatan',
11
+ toolbarDensityLabel: 'Kepadatan',
12
+ toolbarDensityCompact: 'Ringkas',
13
+ toolbarDensityStandard: 'Standar',
14
+ toolbarDensityComfortable: 'Nyaman',
15
+ // Columns selector toolbar button text
16
+ toolbarColumns: 'Kolom',
17
+ toolbarColumnsLabel: 'Pilih kolom',
18
+ // Filters toolbar button text
19
+ toolbarFilters: 'Filter',
20
+ toolbarFiltersLabel: 'Tampilkan filter',
21
+ toolbarFiltersTooltipHide: 'Sembunyikan filter',
22
+ toolbarFiltersTooltipShow: 'Tampilkan filter',
23
+ toolbarFiltersTooltipActive: count => `${count} filter aktif`,
24
+ // Quick filter toolbar field
25
+ toolbarQuickFilterPlaceholder: 'Cari…',
26
+ toolbarQuickFilterLabel: 'Cari',
27
+ toolbarQuickFilterDeleteIconLabel: 'Hapus',
28
+ // Export selector toolbar button text
29
+ toolbarExport: 'Ekspor',
30
+ toolbarExportLabel: 'Ekspor',
31
+ toolbarExportCSV: 'Unduh sebagai CSV',
32
+ toolbarExportPrint: 'Cetak',
33
+ toolbarExportExcel: 'Unduh sebagai Excel',
34
+ // Toolbar pivot button
35
+ toolbarPivot: 'Pivot',
36
+ // Toolbar AI Assistant button
37
+ toolbarAssistant: 'Asisten AI',
38
+ // Columns management text
39
+ columnsManagementSearchTitle: 'Cari',
40
+ columnsManagementNoColumns: 'Tidak ada kolom',
41
+ columnsManagementShowHideAllText: 'Tampilkan/Sembunyikan Semua',
42
+ columnsManagementReset: 'Atur ulang',
43
+ columnsManagementDeleteIconLabel: 'Hapus',
44
+ // Filter panel text
45
+ filterPanelAddFilter: 'Tambahkan filter',
46
+ filterPanelRemoveAll: 'Hapus semua',
47
+ filterPanelDeleteIconLabel: 'Hapus',
48
+ filterPanelLogicOperator: 'Operator logika',
49
+ filterPanelOperator: 'Operator',
50
+ filterPanelOperatorAnd: 'Dan',
51
+ filterPanelOperatorOr: 'Atau',
52
+ filterPanelColumns: 'Kolom',
53
+ filterPanelInputLabel: 'Nilai',
54
+ filterPanelInputPlaceholder: 'Nilai filter',
55
+ // Filter operators text
56
+ filterOperatorContains: 'berisi',
57
+ filterOperatorDoesNotContain: 'tidak berisi',
58
+ filterOperatorEquals: 'sama dengan',
59
+ filterOperatorDoesNotEqual: 'tidak sama dengan',
60
+ filterOperatorStartsWith: 'diawali dengan',
61
+ filterOperatorEndsWith: 'diakhiri dengan',
62
+ filterOperatorIs: 'adalah',
63
+ filterOperatorNot: 'bukan',
64
+ filterOperatorAfter: 'setelah',
65
+ filterOperatorOnOrAfter: 'pada atau setelah',
66
+ filterOperatorBefore: 'sebelum',
67
+ filterOperatorOnOrBefore: 'pada atau sebelum',
68
+ filterOperatorIsEmpty: 'kosong',
69
+ filterOperatorIsNotEmpty: 'tidak kosong',
70
+ filterOperatorIsAnyOf: 'salah satu dari',
71
+ 'filterOperator=': '=',
72
+ 'filterOperator!=': '!=',
73
+ 'filterOperator>': '>',
74
+ 'filterOperator>=': '>=',
75
+ 'filterOperator<': '<',
76
+ 'filterOperator<=': '<=',
77
+ // Header filter operators text
78
+ headerFilterOperatorContains: 'Mengandung',
79
+ headerFilterOperatorDoesNotContain: 'Tidak mengandung',
80
+ headerFilterOperatorEquals: 'Sama dengan',
81
+ headerFilterOperatorDoesNotEqual: 'Tidak sama dengan',
82
+ headerFilterOperatorStartsWith: 'Diawali dengan',
83
+ headerFilterOperatorEndsWith: 'Diakhiri dengan',
84
+ headerFilterOperatorIs: 'Adalah',
85
+ headerFilterOperatorNot: 'Bukan',
86
+ headerFilterOperatorAfter: 'Setelah',
87
+ headerFilterOperatorOnOrAfter: 'Pada atau setelah',
88
+ headerFilterOperatorBefore: 'Sebelum',
89
+ headerFilterOperatorOnOrBefore: 'Pada atau sebelum',
90
+ headerFilterOperatorIsEmpty: 'Kosong',
91
+ headerFilterOperatorIsNotEmpty: 'Tidak kosong',
92
+ headerFilterOperatorIsAnyOf: 'Salah satu dari',
93
+ 'headerFilterOperator=': 'Sama dengan',
94
+ 'headerFilterOperator!=': 'Tidak sama dengan',
95
+ 'headerFilterOperator>': 'Lebih dari',
96
+ 'headerFilterOperator>=': 'Lebih dari atau sama dengan',
97
+ 'headerFilterOperator<': 'Kurang dari',
98
+ 'headerFilterOperator<=': 'Kurang dari atau sama dengan',
99
+ headerFilterClear: 'Hapus filter',
100
+ // Filter values text
101
+ filterValueAny: 'apa saja',
102
+ filterValueTrue: 'benar',
103
+ filterValueFalse: 'salah',
104
+ // Column menu text
105
+ columnMenuLabel: 'Menu',
106
+ columnMenuAriaLabel: columnName => `Menu kolom ${columnName}`,
107
+ columnMenuShowColumns: 'Tampilkan kolom',
108
+ columnMenuManageColumns: 'Kelola kolom',
109
+ columnMenuFilter: 'Filter',
110
+ columnMenuHideColumn: 'Sembunyikan kolom',
111
+ columnMenuUnsort: 'Batalkan urutan',
112
+ columnMenuSortAsc: 'Urutkan menaik',
113
+ columnMenuSortDesc: 'Urutkan menurun',
114
+ columnMenuManagePivot: 'Kelola pivot',
115
+ // Column header text
116
+ columnHeaderFiltersTooltipActive: count => `${count} filter aktif`,
117
+ columnHeaderFiltersLabel: 'Tampilkan filter',
118
+ columnHeaderSortIconLabel: 'Urutkan',
119
+ // Rows selected footer text
120
+ footerRowSelected: count => `${count.toLocaleString()} baris dipilih`,
121
+ // Total row amount footer text
122
+ footerTotalRows: 'Total Baris:',
123
+ // Total visible row amount footer text
124
+ footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} dari ${totalCount.toLocaleString()}`,
125
+ // Checkbox selection text
126
+ checkboxSelectionHeaderName: 'Pilihan kotak centang',
127
+ checkboxSelectionSelectAllRows: 'Pilih semua baris',
128
+ checkboxSelectionUnselectAllRows: 'Batal pilih semua baris',
129
+ checkboxSelectionSelectRow: 'Pilih baris',
130
+ checkboxSelectionUnselectRow: 'Batal pilih baris',
131
+ // Boolean cell text
132
+ booleanCellTrueLabel: 'ya',
133
+ booleanCellFalseLabel: 'tidak',
134
+ // Actions cell more text
135
+ actionsCellMore: 'lainnya',
136
+ // Column pinning text
137
+ pinToLeft: 'Sematkan ke kiri',
138
+ pinToRight: 'Sematkan ke kanan',
139
+ unpin: 'Lepas sematan',
140
+ // Tree Data
141
+ treeDataGroupingHeaderName: 'Kelompok',
142
+ treeDataExpand: 'lihat turunan',
143
+ treeDataCollapse: 'sembunyikan turunan',
144
+ // Grouping columns
145
+ groupingColumnHeaderName: 'Kelompok',
146
+ groupColumn: name => `Kelompokkan berdasarkan ${name}`,
147
+ unGroupColumn: name => `Hentikan pengelompokan berdasarkan ${name}`,
148
+ // Master/detail
149
+ detailPanelToggle: 'Pengalih panel detail',
150
+ expandDetailPanel: 'Perluas',
151
+ collapseDetailPanel: 'Ciutkan',
152
+ // Pagination
153
+ paginationRowsPerPage: 'Baris per halaman:',
154
+ paginationDisplayedRows: ({
155
+ from,
156
+ to,
157
+ count,
158
+ estimated
159
+ }) => {
160
+ if (!estimated) {
161
+ return `${from}–${to} dari ${count !== -1 ? count : `lebih dari ${to}`}`;
162
+ }
163
+ const estimatedLabel = estimated && estimated > to ? `sekitar ${estimated}` : `lebih dari ${to}`;
164
+ return `${from}–${to} dari ${count !== -1 ? count : estimatedLabel}`;
165
+ },
166
+ paginationItemAriaLabel: type => {
167
+ if (type === 'first') {
168
+ return 'Pergi ke halaman pertama';
169
+ }
170
+ if (type === 'last') {
171
+ return 'Pergi ke halaman terakhir';
172
+ }
173
+ if (type === 'next') {
174
+ return 'Pergi ke halaman berikutnya';
175
+ }
176
+ // if (type === 'previous') {
177
+ return 'Pergi ke halaman sebelumnya';
178
+ },
179
+ // Row reordering text
180
+ rowReorderingHeaderName: 'Pengurutan ulang baris',
181
+ // Aggregation
182
+ aggregationMenuItemHeader: 'Agregasi',
183
+ aggregationFunctionLabelSum: 'jumlah',
184
+ aggregationFunctionLabelAvg: 'rata-rata',
185
+ aggregationFunctionLabelMin: 'min',
186
+ aggregationFunctionLabelMax: 'maks',
187
+ aggregationFunctionLabelSize: 'ukuran',
188
+ // Pivot panel
189
+ pivotToggleLabel: 'Pivot',
190
+ pivotRows: 'Baris',
191
+ pivotColumns: 'Kolom',
192
+ pivotValues: 'Nilai',
193
+ pivotCloseButton: 'Tutup pengaturan pivot',
194
+ pivotSearchButton: 'Cari bidang',
195
+ pivotSearchControlPlaceholder: 'Cari bidang',
196
+ pivotSearchControlLabel: 'Cari bidang',
197
+ pivotSearchControlClear: 'Hapus pencarian',
198
+ pivotNoFields: 'Tidak ada bidang',
199
+ pivotMenuMoveUp: 'Pindah ke atas',
200
+ pivotMenuMoveDown: 'Pindah ke bawah',
201
+ pivotMenuMoveToTop: 'Pindah ke paling atas',
202
+ pivotMenuMoveToBottom: 'Pindah ke paling bawah',
203
+ pivotMenuRows: 'Baris',
204
+ pivotMenuColumns: 'Kolom',
205
+ pivotMenuValues: 'Nilai',
206
+ pivotMenuOptions: 'Opsi bidang',
207
+ pivotMenuAddToRows: 'Tambahkan ke Baris',
208
+ pivotMenuAddToColumns: 'Tambahkan ke Kolom',
209
+ pivotMenuAddToValues: 'Tambahkan ke Nilai',
210
+ pivotMenuRemove: 'Hapus',
211
+ pivotDragToRows: 'Seret ke sini untuk membuat baris',
212
+ pivotDragToColumns: 'Seret ke sini untuk membuat kolom',
213
+ pivotDragToValues: 'Seret ke sini untuk membuat nilai',
214
+ pivotYearColumnHeaderName: '(Tahun)',
215
+ pivotQuarterColumnHeaderName: '(Kuartal)',
216
+ // AI Assistant panel
217
+ aiAssistantPanelTitle: 'Asisten AI',
218
+ aiAssistantPanelClose: 'Tutup Asisten AI',
219
+ aiAssistantPanelNewConversation: 'Percakapan baru',
220
+ aiAssistantPanelConversationHistory: 'Riwayat percakapan',
221
+ aiAssistantPanelEmptyConversation: 'Tidak ada riwayat percakapan',
222
+ aiAssistantSuggestions: 'Saran',
223
+ // Prompt field
224
+ promptFieldLabel: 'Perintah',
225
+ promptFieldPlaceholder: 'Ketik perintah…',
226
+ promptFieldPlaceholderWithRecording: 'Ketik atau rekam perintah…',
227
+ promptFieldPlaceholderListening: 'Mendengarkan perintah',
228
+ promptFieldSpeechRecognitionNotSupported: 'Pengenalan suara tidak didukung di browser ini',
229
+ promptFieldSend: 'Kirim',
230
+ promptFieldRecord: 'Rekam',
231
+ promptFieldStopRecording: 'Hentikan perekaman',
232
+ // Prompt
233
+ promptRerun: 'Jalankan lagi',
234
+ promptProcessing: 'Memproses…',
235
+ promptAppliedChanges: 'Perubahan diterapkan',
236
+ // Prompt changes
237
+ promptChangeGroupDescription: column => `Kelompokkan berdasarkan ${column}`,
238
+ promptChangeAggregationLabel: (column, aggregation) => `${column} (${aggregation})`,
239
+ promptChangeAggregationDescription: (column, aggregation) => `Agregasikan ${column} (${aggregation})`,
240
+ promptChangeFilterLabel: (column, operator, value) => {
241
+ if (operator === 'is any of') {
242
+ return `${column} salah satu dari: ${value}`;
243
+ }
244
+ return `${column} ${operator} ${value}`;
245
+ },
246
+ promptChangeFilterDescription: (column, operator, value) => {
247
+ if (operator === 'is any of') {
248
+ return `Filter di mana ${column} salah satu dari: ${value}`;
249
+ }
250
+ return `Filter di mana ${column} ${operator} ${value}`;
251
+ },
252
+ promptChangeSortDescription: (column, direction) => `Urutkan berdasarkan ${column} (${direction})`,
253
+ promptChangePivotEnableLabel: 'Pivot',
254
+ promptChangePivotEnableDescription: 'Aktifkan pivot',
255
+ promptChangePivotColumnsLabel: count => `Kolom (${count})`,
256
+ promptChangePivotColumnsDescription: (column, direction) => `${column}${direction ? ` (${direction})` : ''}`,
257
+ promptChangePivotRowsLabel: count => `Baris (${count})`,
258
+ promptChangePivotValuesLabel: count => `Nilai (${count})`,
259
+ promptChangePivotValuesDescription: (column, aggregation) => `${column} (${aggregation})`
260
+ };
261
+ export const idID = getGridLocalization(idIDGrid);
@@ -35,4 +35,5 @@ export * from "./zhTW.js";
35
35
  export * from "./hrHR.js";
36
36
  export * from "./ptPT.js";
37
37
  export * from "./zhHK.js";
38
- export * from "./isIS.js";
38
+ export * from "./isIS.js";
39
+ export * from "./idID.js";
@@ -36,4 +36,5 @@ export * from "./zhTW.js";
36
36
  export * from "./hrHR.js";
37
37
  export * from "./ptPT.js";
38
38
  export * from "./zhHK.js";
39
- export * from "./isIS.js";
39
+ export * from "./isIS.js";
40
+ export * from "./idID.js";
@@ -6,7 +6,7 @@ import type { GridPrivateApiCommunity } from "../../../models/api/gridApiCommuni
6
6
  import type { DataGridProcessedProps } from "../../../models/props/DataGridProps.js";
7
7
  import type { GridStrategyProcessor } from "../../core/strategyProcessing/index.js";
8
8
  import type { GridEventListener } from "../../../models/events/index.js";
9
- export declare const useGridDataSourceBase: <Api extends GridPrivateApiCommunity>(apiRef: RefObject<Api>, props: Pick<DataGridProcessedProps, "dataSource" | "dataSourceCache" | "onDataSourceError" | "pageSizeOptions" | "signature">, options?: GridDataSourceBaseOptions) => {
9
+ export declare const useGridDataSourceBase: <Api extends GridPrivateApiCommunity>(apiRef: RefObject<Api>, props: Pick<DataGridProcessedProps, "dataSource" | "dataSourceCache" | "onDataSourceError" | "pageSizeOptions" | "pagination" | "signature">, options?: GridDataSourceBaseOptions) => {
10
10
  api: {
11
11
  public: GridDataSourceApi;
12
12
  };
@@ -42,6 +42,9 @@ const useGridDataSourceBase = (apiRef, props, options = {}) => {
42
42
  const lastRequestId = React.useRef(0);
43
43
  const onDataSourceErrorProp = props.onDataSourceError;
44
44
  const cacheChunkManager = (0, _useLazyRef.default)(() => {
45
+ if (!props.pagination) {
46
+ return new _utils2.CacheChunkManager(paginationModel.pageSize);
47
+ }
45
48
  const sortedPageSizeOptions = props.pageSizeOptions.map(option => typeof option === 'number' ? option : option.value).sort((a, b) => a - b);
46
49
  const cacheChunkSize = Math.min(paginationModel.pageSize, sortedPageSizeOptions[0]);
47
50
  return new _utils2.CacheChunkManager(cacheChunkSize);
@@ -43,6 +43,9 @@ class CacheChunkManager {
43
43
  };
44
44
  this.splitResponse = (key, response) => {
45
45
  const cacheKeys = this.getCacheKeys(key);
46
+ if (cacheKeys.length === 1) {
47
+ return new Map([[key, response]]);
48
+ }
46
49
  const responses = new Map();
47
50
  cacheKeys.forEach(chunkKey => {
48
51
  const isLastChunk = chunkKey.end === key.end;
@@ -77,6 +77,10 @@ function useGridSelector(apiRef, selector, args = undefined, equals = defaultCom
77
77
  // eslint-disable-next-line react-hooks/exhaustive-deps
78
78
  EMPTY);
79
79
  const unsubscribe = React.useCallback(() => {
80
+ // Fixes issue in React Strict Mode, where getSnapshot is not called
81
+ if (!refs.current.subscription) {
82
+ subscribe();
83
+ }
80
84
  return () => {
81
85
  if (refs.current.subscription) {
82
86
  refs.current.subscription();
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v8.7.0
2
+ * @mui/x-data-grid v8.8.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -0,0 +1,9 @@
1
+ import { GridGetRowsParams, GridGetRowsResponse } from "../../models/gridDataSource.js";
2
+ export declare class TestCache {
3
+ private cache;
4
+ constructor();
5
+ set(key: GridGetRowsParams, value: GridGetRowsResponse): void;
6
+ get(key: GridGetRowsParams): GridGetRowsResponse | undefined;
7
+ size(): number;
8
+ clear(): void;
9
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TestCache = void 0;
7
+ var _cache = require("../../hooks/features/dataSource/cache");
8
+ class TestCache {
9
+ constructor() {
10
+ this.cache = void 0;
11
+ this.cache = new Map();
12
+ }
13
+ set(key, value) {
14
+ this.cache.set((0, _cache.getKeyDefault)(key), value);
15
+ }
16
+ get(key) {
17
+ return this.cache.get((0, _cache.getKeyDefault)(key));
18
+ }
19
+ size() {
20
+ return this.cache.size;
21
+ }
22
+ clear() {
23
+ this.cache.clear();
24
+ }
25
+ }
26
+ exports.TestCache = TestCache;
@@ -1,4 +1,5 @@
1
1
  export * from "./computeSlots.js";
2
2
  export * from "./propValidation.js";
3
3
  export * from "./gridRowGroupingUtils.js";
4
- export * from "./attachPinnedStyle.js";
4
+ export * from "./attachPinnedStyle.js";
5
+ export * from "./cache.js";
@@ -46,4 +46,15 @@ Object.keys(_attachPinnedStyle).forEach(function (key) {
46
46
  return _attachPinnedStyle[key];
47
47
  }
48
48
  });
49
+ });
50
+ var _cache = require("./cache");
51
+ Object.keys(_cache).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (key in exports && exports[key] === _cache[key]) return;
54
+ Object.defineProperty(exports, key, {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _cache[key];
58
+ }
59
+ });
49
60
  });
@@ -0,0 +1,4 @@
1
+ import { GridLocaleText } from "../models/api/gridLocaleTextApi.js";
2
+ import { Localization } from "../utils/getGridLocalization.js";
3
+ export declare const idIDGrid: GridLocaleText;
4
+ export declare const idID: Localization;