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,EACJrjB,MAAO,EACP6V,OAAQ,KACRpH,KAAM,OACN+G,YAAa,KAEjB,CAIA,MAAM+I,EAAYxK,EAAK,MACvB,IAAIyK,EAAoB,IAAID,EAAU7I,YAAagC,EAAQC,QAO3D,OANIrI,OAAOC,OAAO4T,GAA0BniB,SAC1Cwd,EAAoBA,EAAkB1P,QAAO3P,IAAOgkB,EAAyBhkB,MAE/E4U,EAAK,OAAsB,OAAS,CAAC,EAAGwK,EAAW,CACjD7I,SAAU8I,IAEL,CACLvK,aAAc,KACdF,OACAI,WAAY,CACV,EAAGqK,EAAkBxd,QAEvB4T,WAAY4J,EACb,EAMM8E,CAAkB,CACvBrM,aAAc7W,EAAO6W,aACrBS,QAAStX,EAAOkW,QAAQoB,UAGf6L,EAA2BhmB,KACtC,OAAiCA,EAAQ,KAAuB,kBAAmB0lB,EAA0B,C","sources":["webpack:///./node_modules/@mui/x-data-grid/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/pagination/gridPaginationSelector.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/pagination/gridPaginationUtils.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/pagination/useGridRowCount.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/pagination/useGridPagination.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/pagination/useGridPaginationMeta.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/pagination/useGridPaginationModel.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/preferencesPanel/gridPreferencePanelSelector.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/preferencesPanel/gridPreferencePanelsValue.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/preferencesPanel/useGridPreferencesPanel.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/rowSelection/gridRowSelectionSelector.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/rowSelection/useGridRowSelection.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/rowSelection/useGridRowSelectionPreProcessors.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/rowSelection/utils.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/rows/gridRowsMetaSelector.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/rows/gridRowsSelector.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/rows/gridRowsUtils.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/rows/useGridParamsApi.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/rows/useGridRows.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/rows/useGridRowsMeta.js","webpack:///./node_modules/@mui/x-data-grid/hooks/features/rows/useGridRowsPreProcessors.js"],"sourcesContent":["import { createSelector } from '../../../utils/createSelector';\nexport const gridHeaderFilteringStateSelector = state => state.headerFiltering;\nexport const gridHeaderFilteringEnabledSelector = createSelector(gridHeaderFilteringStateSelector,\n// No initialization in MIT, so we need to default to false to be used by `getTotalHeaderHeight`\nheaderFilteringState => headerFilteringState?.enabled ?? false);\nexport const gridHeaderFilteringEditFieldSelector = createSelector(gridHeaderFilteringStateSelector, headerFilteringState => headerFilteringState.editing);\nexport const gridHeaderFilteringMenuSelector = createSelector(gridHeaderFilteringStateSelector, headerFilteringState => headerFilteringState.menuOpen);","import * as React from 'react';\nimport { useTheme } from '@mui/material/styles';\nimport { gridVisibleColumnDefinitionsSelector } from '../columns/gridColumnsSelector';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';\nimport { gridExpandedSortedRowEntriesSelector } from '../filter/gridFilterSelector';\nimport { useGridVisibleRows } from '../../utils/useGridVisibleRows';\nimport { GRID_CHECKBOX_SELECTION_COL_DEF } from '../../../colDef/gridCheckboxSelectionColDef';\nimport { gridClasses } from '../../../constants/gridClasses';\nimport { GridCellModes } from '../../../models/gridEditRowModel';\nimport { isNavigationKey } from '../../../utils/keyboardUtils';\nimport { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../../../constants/gridDetailPanelToggleField';\nimport { gridPinnedRowsSelector } from '../rows/gridRowsSelector';\nimport { gridFocusColumnGroupHeaderSelector } from '../focus';\nimport { gridColumnGroupsHeaderMaxDepthSelector } from '../columnGrouping/gridColumnGroupsSelector';\nimport { gridHeaderFilteringEditFieldSelector, gridHeaderFilteringMenuSelector } from '../headerFiltering/gridHeaderFilteringSelectors';\nimport { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';\nimport { isEventTargetInPortal } from '../../../utils/domUtils';\nfunction enrichPageRowsWithPinnedRows(apiRef, rows) {\n const pinnedRows = gridPinnedRowsSelector(apiRef) || {};\n return [...(pinnedRows.top || []), ...rows, ...(pinnedRows.bottom || [])];\n}\nconst getLeftColumnIndex = ({\n currentColIndex,\n firstColIndex,\n lastColIndex,\n direction\n}) => {\n if (direction === 'rtl') {\n if (currentColIndex < lastColIndex) {\n return currentColIndex + 1;\n }\n } else if (direction === 'ltr') {\n if (currentColIndex > firstColIndex) {\n return currentColIndex - 1;\n }\n }\n return null;\n};\nconst getRightColumnIndex = ({\n currentColIndex,\n firstColIndex,\n lastColIndex,\n direction\n}) => {\n if (direction === 'rtl') {\n if (currentColIndex > firstColIndex) {\n return currentColIndex - 1;\n }\n } else if (direction === 'ltr') {\n if (currentColIndex < lastColIndex) {\n return currentColIndex + 1;\n }\n }\n return null;\n};\n\n/**\n * @requires useGridSorting (method) - can be after\n * @requires useGridFilter (state) - can be after\n * @requires useGridColumns (state, method) - can be after\n * @requires useGridDimensions (method) - can be after\n * @requires useGridFocus (method) - can be after\n * @requires useGridScroll (method) - can be after\n * @requires useGridColumnSpanning (method) - can be after\n */\nexport const useGridKeyboardNavigation = (apiRef, props) => {\n const logger = useGridLogger(apiRef, 'useGridKeyboardNavigation');\n const initialCurrentPageRows = useGridVisibleRows(apiRef, props).rows;\n const theme = useTheme();\n const currentPageRows = React.useMemo(() => enrichPageRowsWithPinnedRows(apiRef, initialCurrentPageRows), [apiRef, initialCurrentPageRows]);\n const headerFilteringEnabled = props.signature !== 'DataGrid' && props.headerFilters;\n\n /**\n * @param {number} colIndex Index of the column to focus\n * @param {number} rowIndex index of the row to focus\n * @param {string} closestColumnToUse Which closest column cell to use when the cell is spanned by `colSpan`.\n * TODO replace with apiRef.current.moveFocusToRelativeCell()\n */\n const goToCell = React.useCallback((colIndex, rowId, closestColumnToUse = 'left') => {\n const visibleSortedRows = gridExpandedSortedRowEntriesSelector(apiRef);\n const nextCellColSpanInfo = apiRef.current.unstable_getCellColSpanInfo(rowId, colIndex);\n if (nextCellColSpanInfo && nextCellColSpanInfo.spannedByColSpan) {\n if (closestColumnToUse === 'left') {\n colIndex = nextCellColSpanInfo.leftVisibleCellIndex;\n } else if (closestColumnToUse === 'right') {\n colIndex = nextCellColSpanInfo.rightVisibleCellIndex;\n }\n }\n // `scrollToIndexes` requires a rowIndex relative to all visible rows.\n // Those rows do not include pinned rows, but pinned rows do not need scroll anyway.\n const rowIndexRelativeToAllRows = visibleSortedRows.findIndex(row => row.id === rowId);\n logger.debug(`Navigating to cell row ${rowIndexRelativeToAllRows}, col ${colIndex}`);\n apiRef.current.scrollToIndexes({\n colIndex,\n rowIndex: rowIndexRelativeToAllRows\n });\n const field = apiRef.current.getVisibleColumns()[colIndex].field;\n apiRef.current.setCellFocus(rowId, field);\n }, [apiRef, logger]);\n const goToHeader = React.useCallback((colIndex, event) => {\n logger.debug(`Navigating to header col ${colIndex}`);\n apiRef.current.scrollToIndexes({\n colIndex\n });\n const field = apiRef.current.getVisibleColumns()[colIndex].field;\n apiRef.current.setColumnHeaderFocus(field, event);\n }, [apiRef, logger]);\n const goToHeaderFilter = React.useCallback((colIndex, event) => {\n logger.debug(`Navigating to header filter col ${colIndex}`);\n apiRef.current.scrollToIndexes({\n colIndex\n });\n const field = apiRef.current.getVisibleColumns()[colIndex].field;\n apiRef.current.setColumnHeaderFilterFocus(field, event);\n }, [apiRef, logger]);\n const goToGroupHeader = React.useCallback((colIndex, depth, event) => {\n logger.debug(`Navigating to header col ${colIndex}`);\n apiRef.current.scrollToIndexes({\n colIndex\n });\n const {\n field\n } = apiRef.current.getVisibleColumns()[colIndex];\n apiRef.current.setColumnGroupHeaderFocus(field, depth, event);\n }, [apiRef, logger]);\n const getRowIdFromIndex = React.useCallback(rowIndex => {\n return currentPageRows[rowIndex]?.id;\n }, [currentPageRows]);\n const handleColumnHeaderKeyDown = React.useCallback((params, event) => {\n const headerTitleNode = event.currentTarget.querySelector(`.${gridClasses.columnHeaderTitleContainerContent}`);\n const isFromInsideContent = !!headerTitleNode && headerTitleNode.contains(event.target);\n if (isFromInsideContent && params.field !== GRID_CHECKBOX_SELECTION_COL_DEF.field) {\n // When focus is on a nested input, keyboard events have no effect to avoid conflicts with native events.\n // There is one exception for the checkBoxHeader\n return;\n }\n const viewportPageSize = apiRef.current.getViewportPageSize();\n const colIndexBefore = params.field ? apiRef.current.getColumnIndex(params.field) : 0;\n const firstRowIndexInPage = currentPageRows.length > 0 ? 0 : null;\n const lastRowIndexInPage = currentPageRows.length - 1;\n const firstColIndex = 0;\n const lastColIndex = gridVisibleColumnDefinitionsSelector(apiRef).length - 1;\n const columnGroupMaxDepth = gridColumnGroupsHeaderMaxDepthSelector(apiRef);\n let shouldPreventDefault = true;\n switch (event.key) {\n case 'ArrowDown':\n {\n if (firstRowIndexInPage !== null) {\n if (headerFilteringEnabled) {\n goToHeaderFilter(colIndexBefore, event);\n } else {\n goToCell(colIndexBefore, getRowIdFromIndex(firstRowIndexInPage));\n }\n }\n break;\n }\n case 'ArrowRight':\n {\n const rightColIndex = getRightColumnIndex({\n currentColIndex: colIndexBefore,\n firstColIndex,\n lastColIndex,\n direction: theme.direction\n });\n if (rightColIndex !== null) {\n goToHeader(rightColIndex, event);\n }\n break;\n }\n case 'ArrowLeft':\n {\n const leftColIndex = getLeftColumnIndex({\n currentColIndex: colIndexBefore,\n firstColIndex,\n lastColIndex,\n direction: theme.direction\n });\n if (leftColIndex !== null) {\n goToHeader(leftColIndex, event);\n }\n break;\n }\n case 'ArrowUp':\n {\n if (columnGroupMaxDepth > 0) {\n goToGroupHeader(colIndexBefore, columnGroupMaxDepth - 1, event);\n }\n break;\n }\n case 'PageDown':\n {\n if (firstRowIndexInPage !== null && lastRowIndexInPage !== null) {\n goToCell(colIndexBefore, getRowIdFromIndex(Math.min(firstRowIndexInPage + viewportPageSize, lastRowIndexInPage)));\n }\n break;\n }\n case 'Home':\n {\n goToHeader(firstColIndex, event);\n break;\n }\n case 'End':\n {\n goToHeader(lastColIndex, event);\n break;\n }\n case 'Enter':\n {\n if (event.ctrlKey || event.metaKey) {\n apiRef.current.toggleColumnMenu(params.field);\n }\n break;\n }\n case ' ':\n {\n // prevent Space event from scrolling\n break;\n }\n default:\n {\n shouldPreventDefault = false;\n }\n }\n if (shouldPreventDefault) {\n event.preventDefault();\n }\n }, [apiRef, currentPageRows.length, headerFilteringEnabled, goToHeaderFilter, goToCell, getRowIdFromIndex, theme.direction, goToHeader, goToGroupHeader]);\n const handleHeaderFilterKeyDown = React.useCallback((params, event) => {\n const isEditing = gridHeaderFilteringEditFieldSelector(apiRef) === params.field;\n const isHeaderMenuOpen = gridHeaderFilteringMenuSelector(apiRef) === params.field;\n if (isEditing || isHeaderMenuOpen || !isNavigationKey(event.key)) {\n return;\n }\n const viewportPageSize = apiRef.current.getViewportPageSize();\n const colIndexBefore = params.field ? apiRef.current.getColumnIndex(params.field) : 0;\n const firstRowIndexInPage = 0;\n const lastRowIndexInPage = currentPageRows.length - 1;\n const firstColIndex = 0;\n const lastColIndex = gridVisibleColumnDefinitionsSelector(apiRef).length - 1;\n let shouldPreventDefault = true;\n switch (event.key) {\n case 'ArrowDown':\n {\n const rowId = getRowIdFromIndex(firstRowIndexInPage);\n if (firstRowIndexInPage !== null && rowId != null) {\n goToCell(colIndexBefore, rowId);\n }\n break;\n }\n case 'ArrowRight':\n {\n const rightColIndex = getRightColumnIndex({\n currentColIndex: colIndexBefore,\n firstColIndex,\n lastColIndex,\n direction: theme.direction\n });\n if (rightColIndex !== null) {\n goToHeaderFilter(rightColIndex, event);\n }\n break;\n }\n case 'ArrowLeft':\n {\n const leftColIndex = getLeftColumnIndex({\n currentColIndex: colIndexBefore,\n firstColIndex,\n lastColIndex,\n direction: theme.direction\n });\n if (leftColIndex !== null) {\n goToHeaderFilter(leftColIndex, event);\n } else {\n apiRef.current.setColumnHeaderFilterFocus(params.field, event);\n }\n break;\n }\n case 'ArrowUp':\n {\n goToHeader(colIndexBefore, event);\n break;\n }\n case 'PageDown':\n {\n if (firstRowIndexInPage !== null && lastRowIndexInPage !== null) {\n goToCell(colIndexBefore, getRowIdFromIndex(Math.min(firstRowIndexInPage + viewportPageSize, lastRowIndexInPage)));\n }\n break;\n }\n case 'Home':\n {\n goToHeaderFilter(firstColIndex, event);\n break;\n }\n case 'End':\n {\n goToHeaderFilter(lastColIndex, event);\n break;\n }\n case ' ':\n {\n // prevent Space event from scrolling\n break;\n }\n default:\n {\n shouldPreventDefault = false;\n }\n }\n if (shouldPreventDefault) {\n event.preventDefault();\n }\n }, [apiRef, currentPageRows.length, goToHeaderFilter, theme.direction, goToHeader, goToCell, getRowIdFromIndex]);\n const handleColumnGroupHeaderKeyDown = React.useCallback((params, event) => {\n const focusedColumnGroup = gridFocusColumnGroupHeaderSelector(apiRef);\n if (focusedColumnGroup === null) {\n return;\n }\n const {\n field: currentField,\n depth: currentDepth\n } = focusedColumnGroup;\n const {\n fields,\n depth,\n maxDepth\n } = params;\n const viewportPageSize = apiRef.current.getViewportPageSize();\n const currentColIndex = apiRef.current.getColumnIndex(currentField);\n const colIndexBefore = currentField ? apiRef.current.getColumnIndex(currentField) : 0;\n const firstRowIndexInPage = 0;\n const lastRowIndexInPage = currentPageRows.length - 1;\n const firstColIndex = 0;\n const lastColIndex = gridVisibleColumnDefinitionsSelector(apiRef).length - 1;\n let shouldPreventDefault = true;\n switch (event.key) {\n case 'ArrowDown':\n {\n if (depth === maxDepth - 1) {\n goToHeader(currentColIndex, event);\n } else {\n goToGroupHeader(currentColIndex, currentDepth + 1, event);\n }\n break;\n }\n case 'ArrowUp':\n {\n if (depth > 0) {\n goToGroupHeader(currentColIndex, currentDepth - 1, event);\n }\n break;\n }\n case 'ArrowRight':\n {\n const remainingRightColumns = fields.length - fields.indexOf(currentField) - 1;\n if (currentColIndex + remainingRightColumns + 1 <= lastColIndex) {\n goToGroupHeader(currentColIndex + remainingRightColumns + 1, currentDepth, event);\n }\n break;\n }\n case 'ArrowLeft':\n {\n const remainingLeftColumns = fields.indexOf(currentField);\n if (currentColIndex - remainingLeftColumns - 1 >= firstColIndex) {\n goToGroupHeader(currentColIndex - remainingLeftColumns - 1, currentDepth, event);\n }\n break;\n }\n case 'PageDown':\n {\n if (firstRowIndexInPage !== null && lastRowIndexInPage !== null) {\n goToCell(colIndexBefore, getRowIdFromIndex(Math.min(firstRowIndexInPage + viewportPageSize, lastRowIndexInPage)));\n }\n break;\n }\n case 'Home':\n {\n goToGroupHeader(firstColIndex, currentDepth, event);\n break;\n }\n case 'End':\n {\n goToGroupHeader(lastColIndex, currentDepth, event);\n break;\n }\n case ' ':\n {\n // prevent Space event from scrolling\n break;\n }\n default:\n {\n shouldPreventDefault = false;\n }\n }\n if (shouldPreventDefault) {\n event.preventDefault();\n }\n }, [apiRef, currentPageRows.length, goToHeader, goToGroupHeader, goToCell, getRowIdFromIndex]);\n const handleCellKeyDown = React.useCallback((params, event) => {\n // Ignore portal\n if (isEventTargetInPortal(event)) {\n return;\n }\n\n // Get the most recent params because the cell mode may have changed by another listener\n const cellParams = apiRef.current.getCellParams(params.id, params.field);\n if (cellParams.cellMode === GridCellModes.Edit || !isNavigationKey(event.key)) {\n return;\n }\n const canUpdateFocus = apiRef.current.unstable_applyPipeProcessors('canUpdateFocus', true, {\n event,\n cell: cellParams\n });\n if (!canUpdateFocus) {\n return;\n }\n if (currentPageRows.length === 0) {\n return;\n }\n const direction = theme.direction;\n const viewportPageSize = apiRef.current.getViewportPageSize();\n const colIndexBefore = params.field ? apiRef.current.getColumnIndex(params.field) : 0;\n const rowIndexBefore = currentPageRows.findIndex(row => row.id === params.id);\n const firstRowIndexInPage = 0;\n const lastRowIndexInPage = currentPageRows.length - 1;\n const firstColIndex = 0;\n const lastColIndex = gridVisibleColumnDefinitionsSelector(apiRef).length - 1;\n let shouldPreventDefault = true;\n switch (event.key) {\n case 'ArrowDown':\n {\n // \"Enter\" is only triggered by the row / cell editing feature\n if (rowIndexBefore < lastRowIndexInPage) {\n goToCell(colIndexBefore, getRowIdFromIndex(rowIndexBefore + 1));\n }\n break;\n }\n case 'ArrowUp':\n {\n if (rowIndexBefore > firstRowIndexInPage) {\n goToCell(colIndexBefore, getRowIdFromIndex(rowIndexBefore - 1));\n } else if (headerFilteringEnabled) {\n goToHeaderFilter(colIndexBefore, event);\n } else {\n goToHeader(colIndexBefore, event);\n }\n break;\n }\n case 'ArrowRight':\n {\n const rightColIndex = getRightColumnIndex({\n currentColIndex: colIndexBefore,\n firstColIndex,\n lastColIndex,\n direction\n });\n if (rightColIndex !== null) {\n goToCell(rightColIndex, getRowIdFromIndex(rowIndexBefore), direction === 'rtl' ? 'left' : 'right');\n }\n break;\n }\n case 'ArrowLeft':\n {\n const leftColIndex = getLeftColumnIndex({\n currentColIndex: colIndexBefore,\n firstColIndex,\n lastColIndex,\n direction\n });\n if (leftColIndex !== null) {\n goToCell(leftColIndex, getRowIdFromIndex(rowIndexBefore), direction === 'rtl' ? 'right' : 'left');\n }\n break;\n }\n case 'Tab':\n {\n // \"Tab\" is only triggered by the row / cell editing feature\n if (event.shiftKey && colIndexBefore > firstColIndex) {\n goToCell(colIndexBefore - 1, getRowIdFromIndex(rowIndexBefore), 'left');\n } else if (!event.shiftKey && colIndexBefore < lastColIndex) {\n goToCell(colIndexBefore + 1, getRowIdFromIndex(rowIndexBefore), 'right');\n }\n break;\n }\n case ' ':\n {\n const field = params.field;\n if (field === GRID_DETAIL_PANEL_TOGGLE_FIELD) {\n break;\n }\n const colDef = params.colDef;\n if (colDef &&\n // `GRID_TREE_DATA_GROUPING_FIELD` from the Pro package\n colDef.field === '__tree_data_group__') {\n break;\n }\n if (!event.shiftKey && rowIndexBefore < lastRowIndexInPage) {\n goToCell(colIndexBefore, getRowIdFromIndex(Math.min(rowIndexBefore + viewportPageSize, lastRowIndexInPage)));\n }\n break;\n }\n case 'PageDown':\n {\n if (rowIndexBefore < lastRowIndexInPage) {\n goToCell(colIndexBefore, getRowIdFromIndex(Math.min(rowIndexBefore + viewportPageSize, lastRowIndexInPage)));\n }\n break;\n }\n case 'PageUp':\n {\n // Go to the first row before going to header\n const nextRowIndex = Math.max(rowIndexBefore - viewportPageSize, firstRowIndexInPage);\n if (nextRowIndex !== rowIndexBefore && nextRowIndex >= firstRowIndexInPage) {\n goToCell(colIndexBefore, getRowIdFromIndex(nextRowIndex));\n } else {\n goToHeader(colIndexBefore, event);\n }\n break;\n }\n case 'Home':\n {\n if (event.ctrlKey || event.metaKey || event.shiftKey) {\n goToCell(firstColIndex, getRowIdFromIndex(firstRowIndexInPage));\n } else {\n goToCell(firstColIndex, getRowIdFromIndex(rowIndexBefore));\n }\n break;\n }\n case 'End':\n {\n if (event.ctrlKey || event.metaKey || event.shiftKey) {\n goToCell(lastColIndex, getRowIdFromIndex(lastRowIndexInPage));\n } else {\n goToCell(lastColIndex, getRowIdFromIndex(rowIndexBefore));\n }\n break;\n }\n default:\n {\n shouldPreventDefault = false;\n }\n }\n if (shouldPreventDefault) {\n event.preventDefault();\n }\n }, [apiRef, currentPageRows, theme.direction, goToCell, getRowIdFromIndex, headerFilteringEnabled, goToHeaderFilter, goToHeader]);\n const checkIfCanStartEditing = React.useCallback((initialValue, {\n event\n }) => {\n if (event.key === ' ') {\n // Space scrolls to the last row\n return false;\n }\n return initialValue;\n }, []);\n useGridRegisterPipeProcessor(apiRef, 'canStartEditing', checkIfCanStartEditing);\n useGridApiEventHandler(apiRef, 'columnHeaderKeyDown', handleColumnHeaderKeyDown);\n useGridApiEventHandler(apiRef, 'headerFilterKeyDown', handleHeaderFilterKeyDown);\n useGridApiEventHandler(apiRef, 'columnGroupHeaderKeyDown', handleColumnGroupHeaderKeyDown);\n useGridApiEventHandler(apiRef, 'cellKeyDown', handleCellKeyDown);\n};","import { createSelector, createSelectorMemoized } from '../../../utils/createSelector';\nimport { gridExpandedSortedRowEntriesSelector, gridExpandedSortedRowIdsSelector, gridFilteredSortedTopLevelRowEntriesSelector } from '../filter/gridFilterSelector';\nimport { gridRowMaximumTreeDepthSelector, gridRowTreeSelector } from '../rows/gridRowsSelector';\nimport { getPageCount } from './gridPaginationUtils';\n\n/**\n * @category Pagination\n * @ignore - do not document.\n */\nexport const gridPaginationSelector = state => state.pagination;\n\n/**\n * Get the pagination model\n * @category Pagination\n */\nexport const gridPaginationModelSelector = createSelector(gridPaginationSelector, pagination => pagination.paginationModel);\n\n/**\n * Get the row count\n * @category Pagination\n */\nexport const gridPaginationRowCountSelector = createSelector(gridPaginationSelector, pagination => pagination.rowCount);\n\n/**\n * Get the pagination meta\n * @category Pagination\n */\nexport const gridPaginationMetaSelector = createSelector(gridPaginationSelector, pagination => pagination.meta);\n\n/**\n * Get the index of the page to render if the pagination is enabled\n * @category Pagination\n */\nexport const gridPageSelector = createSelector(gridPaginationModelSelector, paginationModel => paginationModel.page);\n\n/**\n * Get the maximum amount of rows to display on a single page if the pagination is enabled\n * @category Pagination\n */\nexport const gridPageSizeSelector = createSelector(gridPaginationModelSelector, paginationModel => paginationModel.pageSize);\n\n/**\n * Get the amount of pages needed to display all the rows if the pagination is enabled\n * @category Pagination\n */\nexport const gridPageCountSelector = createSelector(gridPaginationModelSelector, gridPaginationRowCountSelector, (paginationModel, rowCount) => getPageCount(rowCount, paginationModel.pageSize, paginationModel.page));\n\n/**\n * Get the index of the first and the last row to include in the current page if the pagination is enabled.\n * @category Pagination\n */\nexport const gridPaginationRowRangeSelector = createSelectorMemoized(gridPaginationModelSelector, gridRowTreeSelector, gridRowMaximumTreeDepthSelector, gridExpandedSortedRowEntriesSelector, gridFilteredSortedTopLevelRowEntriesSelector, (paginationModel, rowTree, rowTreeDepth, visibleSortedRowEntries, visibleSortedTopLevelRowEntries) => {\n const visibleTopLevelRowCount = visibleSortedTopLevelRowEntries.length;\n const topLevelFirstRowIndex = Math.min(paginationModel.pageSize * paginationModel.page, visibleTopLevelRowCount - 1);\n const topLevelLastRowIndex = Math.min(topLevelFirstRowIndex + paginationModel.pageSize - 1, visibleTopLevelRowCount - 1);\n\n // The range contains no element\n if (topLevelFirstRowIndex === -1 || topLevelLastRowIndex === -1) {\n return null;\n }\n\n // The tree is flat, there is no need to look for children\n if (rowTreeDepth < 2) {\n return {\n firstRowIndex: topLevelFirstRowIndex,\n lastRowIndex: topLevelLastRowIndex\n };\n }\n const topLevelFirstRow = visibleSortedTopLevelRowEntries[topLevelFirstRowIndex];\n const topLevelRowsInCurrentPageCount = topLevelLastRowIndex - topLevelFirstRowIndex + 1;\n const firstRowIndex = visibleSortedRowEntries.findIndex(row => row.id === topLevelFirstRow.id);\n let lastRowIndex = firstRowIndex;\n let topLevelRowAdded = 0;\n while (lastRowIndex < visibleSortedRowEntries.length && topLevelRowAdded <= topLevelRowsInCurrentPageCount) {\n const row = visibleSortedRowEntries[lastRowIndex];\n const depth = rowTree[row.id]?.depth;\n if (depth === undefined) {\n lastRowIndex += 1;\n } else {\n if (topLevelRowAdded < topLevelRowsInCurrentPageCount || depth > 0) {\n lastRowIndex += 1;\n }\n if (depth === 0) {\n topLevelRowAdded += 1;\n }\n }\n }\n return {\n firstRowIndex,\n lastRowIndex: lastRowIndex - 1\n };\n});\n\n/**\n * Get the id and the model of each row to include in the current page if the pagination is enabled.\n * @category Pagination\n */\nexport const gridPaginatedVisibleSortedGridRowEntriesSelector = createSelectorMemoized(gridExpandedSortedRowEntriesSelector, gridPaginationRowRangeSelector, (visibleSortedRowEntries, paginationRange) => {\n if (!paginationRange) {\n return [];\n }\n return visibleSortedRowEntries.slice(paginationRange.firstRowIndex, paginationRange.lastRowIndex + 1);\n});\n\n/**\n * Get the id of each row to include in the current page if the pagination is enabled.\n * @category Pagination\n */\nexport const gridPaginatedVisibleSortedGridRowIdsSelector = createSelectorMemoized(gridExpandedSortedRowIdsSelector, gridPaginationRowRangeSelector, (visibleSortedRowIds, paginationRange) => {\n if (!paginationRange) {\n return [];\n }\n return visibleSortedRowIds.slice(paginationRange.firstRowIndex, paginationRange.lastRowIndex + 1);\n});","import { GridSignature } from '../../utils';\nconst MAX_PAGE_SIZE = 100;\nexport const defaultPageSize = autoPageSize => autoPageSize ? 0 : 100;\nexport const getPageCount = (rowCount, pageSize, page) => {\n if (pageSize > 0 && rowCount > 0) {\n return Math.ceil(rowCount / pageSize);\n }\n if (rowCount === -1) {\n // With unknown row-count, we can assume a page after the current one\n return page + 2;\n }\n return 0;\n};\nexport const getDefaultGridPaginationModel = autoPageSize => ({\n page: 0,\n pageSize: autoPageSize ? 0 : 100\n});\nexport const getValidPage = (page, pageCount = 0) => {\n if (pageCount === 0) {\n return page;\n }\n return Math.max(Math.min(page, pageCount - 1), 0);\n};\nexport const throwIfPageSizeExceedsTheLimit = (pageSize, signatureProp) => {\n if (signatureProp === GridSignature.DataGrid && pageSize > MAX_PAGE_SIZE) {\n throw new Error(['MUI X: `pageSize` cannot exceed 100 in the MIT version of the DataGrid.', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\\n'));\n }\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport useLazyRef from '@mui/utils/useLazyRef';\nimport { gridFilteredTopLevelRowCountSelector } from '../filter';\nimport { useGridLogger, useGridSelector, useGridApiMethod, useGridApiEventHandler } from '../../utils';\nimport { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';\nimport { gridPaginationRowCountSelector, gridPaginationMetaSelector, gridPaginationModelSelector } from './gridPaginationSelector';\nexport const useGridRowCount = (apiRef, props) => {\n const logger = useGridLogger(apiRef, 'useGridRowCount');\n const visibleTopLevelRowCount = useGridSelector(apiRef, gridFilteredTopLevelRowCountSelector);\n const rowCountState = useGridSelector(apiRef, gridPaginationRowCountSelector);\n const paginationMeta = useGridSelector(apiRef, gridPaginationMetaSelector);\n const paginationModel = useGridSelector(apiRef, gridPaginationModelSelector);\n const previousPageSize = useLazyRef(() => gridPaginationModelSelector(apiRef).pageSize);\n apiRef.current.registerControlState({\n stateId: 'paginationRowCount',\n propModel: props.rowCount,\n propOnChange: props.onRowCountChange,\n stateSelector: gridPaginationRowCountSelector,\n changeEvent: 'rowCountChange'\n });\n\n /**\n * API METHODS\n */\n const setRowCount = React.useCallback(newRowCount => {\n if (rowCountState === newRowCount) {\n return;\n }\n logger.debug(\"Setting 'rowCount' to\", newRowCount);\n apiRef.current.setState(state => _extends({}, state, {\n pagination: _extends({}, state.pagination, {\n rowCount: newRowCount\n })\n }));\n }, [apiRef, logger, rowCountState]);\n const paginationRowCountApi = {\n setRowCount\n };\n useGridApiMethod(apiRef, paginationRowCountApi, 'public');\n\n /**\n * PRE-PROCESSING\n */\n const stateExportPreProcessing = React.useCallback((prevState, context) => {\n const exportedRowCount = gridPaginationRowCountSelector(apiRef);\n const shouldExportRowCount =\n // Always export if the `exportOnlyDirtyModels` property is not activated\n !context.exportOnlyDirtyModels ||\n // Always export if the `rowCount` is controlled\n props.rowCount != null ||\n // Always export if the `rowCount` has been initialized\n props.initialState?.pagination?.rowCount != null;\n if (!shouldExportRowCount) {\n return prevState;\n }\n return _extends({}, prevState, {\n pagination: _extends({}, prevState.pagination, {\n rowCount: exportedRowCount\n })\n });\n }, [apiRef, props.rowCount, props.initialState?.pagination?.rowCount]);\n const stateRestorePreProcessing = React.useCallback((params, context) => {\n const restoredRowCount = context.stateToRestore.pagination?.rowCount ? context.stateToRestore.pagination.rowCount : gridPaginationRowCountSelector(apiRef);\n apiRef.current.setState(state => _extends({}, state, {\n pagination: _extends({}, state.pagination, {\n rowCount: restoredRowCount\n })\n }));\n return params;\n }, [apiRef]);\n useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);\n useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);\n\n /**\n * EVENTS\n */\n const handlePaginationModelChange = React.useCallback(model => {\n if (props.paginationMode === 'client' || !previousPageSize.current) {\n return;\n }\n if (model.pageSize !== previousPageSize.current) {\n previousPageSize.current = model.pageSize;\n if (rowCountState === -1) {\n // Row count unknown and page size changed, reset the page\n apiRef.current.setPage(0);\n }\n }\n }, [props.paginationMode, previousPageSize, rowCountState, apiRef]);\n useGridApiEventHandler(apiRef, 'paginationModelChange', handlePaginationModelChange);\n\n /**\n * EFFECTS\n */\n React.useEffect(() => {\n if (props.paginationMode === 'client') {\n apiRef.current.setRowCount(visibleTopLevelRowCount);\n } else if (props.rowCount != null) {\n apiRef.current.setRowCount(props.rowCount);\n }\n }, [apiRef, props.paginationMode, visibleTopLevelRowCount, props.rowCount]);\n const isLastPage = paginationMeta.hasNextPage === false;\n React.useEffect(() => {\n if (isLastPage && rowCountState === -1) {\n apiRef.current.setRowCount(paginationModel.pageSize * paginationModel.page + visibleTopLevelRowCount);\n }\n }, [apiRef, visibleTopLevelRowCount, isLastPage, rowCountState, paginationModel]);\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { throwIfPageSizeExceedsTheLimit, getDefaultGridPaginationModel } from './gridPaginationUtils';\nimport { useGridPaginationModel } from './useGridPaginationModel';\nimport { useGridRowCount } from './useGridRowCount';\nimport { useGridPaginationMeta } from './useGridPaginationMeta';\nexport const paginationStateInitializer = (state, props) => {\n const paginationModel = _extends({}, getDefaultGridPaginationModel(props.autoPageSize), props.paginationModel ?? props.initialState?.pagination?.paginationModel);\n throwIfPageSizeExceedsTheLimit(paginationModel.pageSize, props.signature);\n const rowCount = props.rowCount ?? props.initialState?.pagination?.rowCount;\n const meta = props.paginationMeta ?? props.initialState?.pagination?.meta ?? {};\n return _extends({}, state, {\n pagination: {\n paginationModel,\n rowCount,\n meta\n }\n });\n};\n\n/**\n * @requires useGridFilter (state)\n * @requires useGridDimensions (event) - can be after\n */\nexport const useGridPagination = (apiRef, props) => {\n useGridPaginationMeta(apiRef, props);\n useGridPaginationModel(apiRef, props);\n useGridRowCount(apiRef, props);\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useGridLogger, useGridSelector, useGridApiMethod } from '../../utils';\nimport { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';\nimport { gridPaginationMetaSelector } from './gridPaginationSelector';\nexport const useGridPaginationMeta = (apiRef, props) => {\n const logger = useGridLogger(apiRef, 'useGridPaginationMeta');\n const paginationMeta = useGridSelector(apiRef, gridPaginationMetaSelector);\n apiRef.current.registerControlState({\n stateId: 'paginationMeta',\n propModel: props.paginationMeta,\n propOnChange: props.onPaginationMetaChange,\n stateSelector: gridPaginationMetaSelector,\n changeEvent: 'paginationMetaChange'\n });\n\n /**\n * API METHODS\n */\n const setPaginationMeta = React.useCallback(newPaginationMeta => {\n if (paginationMeta === newPaginationMeta) {\n return;\n }\n logger.debug(\"Setting 'paginationMeta' to\", newPaginationMeta);\n apiRef.current.setState(state => _extends({}, state, {\n pagination: _extends({}, state.pagination, {\n meta: newPaginationMeta\n })\n }));\n }, [apiRef, logger, paginationMeta]);\n const paginationMetaApi = {\n setPaginationMeta\n };\n useGridApiMethod(apiRef, paginationMetaApi, 'public');\n\n /**\n * PRE-PROCESSING\n */\n const stateExportPreProcessing = React.useCallback((prevState, context) => {\n const exportedPaginationMeta = gridPaginationMetaSelector(apiRef);\n const shouldExportRowCount =\n // Always export if the `exportOnlyDirtyModels` property is not activated\n !context.exportOnlyDirtyModels ||\n // Always export if the `paginationMeta` is controlled\n props.paginationMeta != null ||\n // Always export if the `paginationMeta` has been initialized\n props.initialState?.pagination?.meta != null;\n if (!shouldExportRowCount) {\n return prevState;\n }\n return _extends({}, prevState, {\n pagination: _extends({}, prevState.pagination, {\n meta: exportedPaginationMeta\n })\n });\n }, [apiRef, props.paginationMeta, props.initialState?.pagination?.meta]);\n const stateRestorePreProcessing = React.useCallback((params, context) => {\n const restoredPaginationMeta = context.stateToRestore.pagination?.meta ? context.stateToRestore.pagination.meta : gridPaginationMetaSelector(apiRef);\n apiRef.current.setState(state => _extends({}, state, {\n pagination: _extends({}, state.pagination, {\n meta: restoredPaginationMeta\n })\n }));\n return params;\n }, [apiRef]);\n useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);\n useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);\n\n /**\n * EFFECTS\n */\n React.useEffect(() => {\n if (props.paginationMeta) {\n apiRef.current.setPaginationMeta(props.paginationMeta);\n }\n }, [apiRef, props.paginationMeta]);\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { gridDensityFactorSelector } from '../density';\nimport { useGridLogger, useGridSelector, useGridApiMethod, useGridApiEventHandler } from '../../utils';\nimport { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';\nimport { gridPageCountSelector, gridPaginationModelSelector } from './gridPaginationSelector';\nimport { getPageCount, defaultPageSize, throwIfPageSizeExceedsTheLimit, getDefaultGridPaginationModel, getValidPage } from './gridPaginationUtils';\nexport const getDerivedPaginationModel = (paginationState, signature, paginationModelProp) => {\n let paginationModel = paginationState.paginationModel;\n const rowCount = paginationState.rowCount;\n const pageSize = paginationModelProp?.pageSize ?? paginationModel.pageSize;\n const page = paginationModelProp?.page ?? paginationModel.page;\n const pageCount = getPageCount(rowCount, pageSize, page);\n if (paginationModelProp && (paginationModelProp?.page !== paginationModel.page || paginationModelProp?.pageSize !== paginationModel.pageSize)) {\n paginationModel = paginationModelProp;\n }\n const validPage = getValidPage(paginationModel.page, pageCount);\n if (validPage !== paginationModel.page) {\n paginationModel = _extends({}, paginationModel, {\n page: validPage\n });\n }\n throwIfPageSizeExceedsTheLimit(paginationModel.pageSize, signature);\n return paginationModel;\n};\n\n/**\n * @requires useGridFilter (state)\n * @requires useGridDimensions (event) - can be after\n */\nexport const useGridPaginationModel = (apiRef, props) => {\n const logger = useGridLogger(apiRef, 'useGridPaginationModel');\n const densityFactor = useGridSelector(apiRef, gridDensityFactorSelector);\n const rowHeight = Math.floor(props.rowHeight * densityFactor);\n apiRef.current.registerControlState({\n stateId: 'paginationModel',\n propModel: props.paginationModel,\n propOnChange: props.onPaginationModelChange,\n stateSelector: gridPaginationModelSelector,\n changeEvent: 'paginationModelChange'\n });\n\n /**\n * API METHODS\n */\n const setPage = React.useCallback(page => {\n const currentModel = gridPaginationModelSelector(apiRef);\n if (page === currentModel.page) {\n return;\n }\n logger.debug(`Setting page to ${page}`);\n apiRef.current.setPaginationModel({\n page,\n pageSize: currentModel.pageSize\n });\n }, [apiRef, logger]);\n const setPageSize = React.useCallback(pageSize => {\n const currentModel = gridPaginationModelSelector(apiRef);\n if (pageSize === currentModel.pageSize) {\n return;\n }\n logger.debug(`Setting page size to ${pageSize}`);\n apiRef.current.setPaginationModel({\n pageSize,\n page: currentModel.page\n });\n }, [apiRef, logger]);\n const setPaginationModel = React.useCallback(paginationModel => {\n const currentModel = gridPaginationModelSelector(apiRef);\n if (paginationModel === currentModel) {\n return;\n }\n logger.debug(\"Setting 'paginationModel' to\", paginationModel);\n apiRef.current.setState(state => _extends({}, state, {\n pagination: _extends({}, state.pagination, {\n paginationModel: getDerivedPaginationModel(state.pagination, props.signature, paginationModel)\n })\n }));\n }, [apiRef, logger, props.signature]);\n const paginationModelApi = {\n setPage,\n setPageSize,\n setPaginationModel\n };\n useGridApiMethod(apiRef, paginationModelApi, 'public');\n\n /**\n * PRE-PROCESSING\n */\n const stateExportPreProcessing = React.useCallback((prevState, context) => {\n const paginationModel = gridPaginationModelSelector(apiRef);\n const shouldExportPaginationModel =\n // Always export if the `exportOnlyDirtyModels` property is not activated\n !context.exportOnlyDirtyModels ||\n // Always export if the `paginationModel` is controlled\n props.paginationModel != null ||\n // Always export if the `paginationModel` has been initialized\n props.initialState?.pagination?.paginationModel != null ||\n // Export if `page` or `pageSize` is not equal to the default value\n paginationModel.page !== 0 && paginationModel.pageSize !== defaultPageSize(props.autoPageSize);\n if (!shouldExportPaginationModel) {\n return prevState;\n }\n return _extends({}, prevState, {\n pagination: _extends({}, prevState.pagination, {\n paginationModel\n })\n });\n }, [apiRef, props.paginationModel, props.initialState?.pagination?.paginationModel, props.autoPageSize]);\n const stateRestorePreProcessing = React.useCallback((params, context) => {\n const paginationModel = context.stateToRestore.pagination?.paginationModel ? _extends({}, getDefaultGridPaginationModel(props.autoPageSize), context.stateToRestore.pagination?.paginationModel) : gridPaginationModelSelector(apiRef);\n apiRef.current.setState(state => _extends({}, state, {\n pagination: _extends({}, state.pagination, {\n paginationModel: getDerivedPaginationModel(state.pagination, props.signature, paginationModel)\n })\n }));\n return params;\n }, [apiRef, props.autoPageSize, props.signature]);\n useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);\n useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);\n\n /**\n * EVENTS\n */\n const handlePaginationModelChange = () => {\n const paginationModel = gridPaginationModelSelector(apiRef);\n if (apiRef.current.virtualScrollerRef?.current) {\n apiRef.current.scrollToIndexes({\n rowIndex: paginationModel.page * paginationModel.pageSize\n });\n }\n };\n const handleUpdateAutoPageSize = React.useCallback(() => {\n if (!props.autoPageSize) {\n return;\n }\n const dimensions = apiRef.current.getRootDimensions();\n const maximumPageSizeWithoutScrollBar = Math.floor(dimensions.viewportInnerSize.height / rowHeight);\n apiRef.current.setPageSize(maximumPageSizeWithoutScrollBar);\n }, [apiRef, props.autoPageSize, rowHeight]);\n const handleRowCountChange = React.useCallback(newRowCount => {\n if (newRowCount == null) {\n return;\n }\n const paginationModel = gridPaginationModelSelector(apiRef);\n const pageCount = gridPageCountSelector(apiRef);\n if (paginationModel.page > pageCount - 1) {\n apiRef.current.setPage(Math.max(0, pageCount - 1));\n }\n }, [apiRef]);\n useGridApiEventHandler(apiRef, 'viewportInnerSizeChange', handleUpdateAutoPageSize);\n useGridApiEventHandler(apiRef, 'paginationModelChange', handlePaginationModelChange);\n useGridApiEventHandler(apiRef, 'rowCountChange', handleRowCountChange);\n\n /**\n * EFFECTS\n */\n React.useEffect(() => {\n apiRef.current.setState(state => _extends({}, state, {\n pagination: _extends({}, state.pagination, {\n paginationModel: getDerivedPaginationModel(state.pagination, props.signature, props.paginationModel)\n })\n }));\n }, [apiRef, props.paginationModel, props.paginationMode, props.signature]);\n React.useEffect(handleUpdateAutoPageSize, [handleUpdateAutoPageSize]);\n};","export const gridPreferencePanelStateSelector = state => state.preferencePanel;","var GridPreferencePanelsValue = /*#__PURE__*/function (GridPreferencePanelsValue) {\n GridPreferencePanelsValue[\"filters\"] = \"filters\";\n GridPreferencePanelsValue[\"columns\"] = \"columns\";\n return GridPreferencePanelsValue;\n}(GridPreferencePanelsValue || {});\nexport { GridPreferencePanelsValue };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';\nimport { gridPreferencePanelStateSelector } from './gridPreferencePanelSelector';\nexport const preferencePanelStateInitializer = (state, props) => _extends({}, state, {\n preferencePanel: props.initialState?.preferencePanel ?? {\n open: false\n }\n});\n\n/**\n * TODO: Add a single `setPreferencePanel` method to avoid multiple `setState`\n */\nexport const useGridPreferencesPanel = (apiRef, props) => {\n const logger = useGridLogger(apiRef, 'useGridPreferencesPanel');\n const hideTimeout = React.useRef();\n const immediateTimeout = React.useRef();\n\n /**\n * API METHODS\n */\n const hidePreferences = React.useCallback(() => {\n logger.debug('Hiding Preferences Panel');\n const preferencePanelState = gridPreferencePanelStateSelector(apiRef.current.state);\n if (preferencePanelState.openedPanelValue) {\n apiRef.current.publishEvent('preferencePanelClose', {\n openedPanelValue: preferencePanelState.openedPanelValue\n });\n }\n apiRef.current.setState(state => _extends({}, state, {\n preferencePanel: {\n open: false\n }\n }));\n apiRef.current.forceUpdate();\n }, [apiRef, logger]);\n\n // This is to prevent the preferences from closing when you open a select box or another panel,\n // The issue is in MUI core V4 => Fixed in V5\n const doNotHidePanel = React.useCallback(() => {\n immediateTimeout.current = setTimeout(() => clearTimeout(hideTimeout.current), 0);\n }, []);\n\n // This is a hack for the issue with Core V4, by delaying hiding the panel on the clickAwayListener,\n // we can cancel the action if the trigger element still need the panel...\n const hidePreferencesDelayed = React.useCallback(() => {\n hideTimeout.current = setTimeout(hidePreferences, 100);\n }, [hidePreferences]);\n const showPreferences = React.useCallback((newValue, panelId, labelId) => {\n logger.debug('Opening Preferences Panel');\n doNotHidePanel();\n apiRef.current.setState(state => _extends({}, state, {\n preferencePanel: _extends({}, state.preferencePanel, {\n open: true,\n openedPanelValue: newValue,\n panelId,\n labelId\n })\n }));\n apiRef.current.publishEvent('preferencePanelOpen', {\n openedPanelValue: newValue\n });\n apiRef.current.forceUpdate();\n }, [logger, doNotHidePanel, apiRef]);\n useGridApiMethod(apiRef, {\n showPreferences,\n hidePreferences: hidePreferencesDelayed\n }, 'public');\n\n /**\n * PRE-PROCESSING\n */\n const stateExportPreProcessing = React.useCallback((prevState, context) => {\n const preferencePanelToExport = gridPreferencePanelStateSelector(apiRef.current.state);\n const shouldExportPreferencePanel =\n // Always export if the `exportOnlyDirtyModels` property is not activated\n !context.exportOnlyDirtyModels ||\n // Always export if the panel was initialized\n props.initialState?.preferencePanel != null ||\n // Always export if the panel is opened\n preferencePanelToExport.open;\n if (!shouldExportPreferencePanel) {\n return prevState;\n }\n return _extends({}, prevState, {\n preferencePanel: preferencePanelToExport\n });\n }, [apiRef, props.initialState?.preferencePanel]);\n const stateRestorePreProcessing = React.useCallback((params, context) => {\n const preferencePanel = context.stateToRestore.preferencePanel;\n if (preferencePanel != null) {\n apiRef.current.setState(state => _extends({}, state, {\n preferencePanel\n }));\n }\n return params;\n }, [apiRef]);\n useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);\n useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);\n\n /**\n * EFFECTS\n */\n React.useEffect(() => {\n return () => {\n clearTimeout(hideTimeout.current);\n clearTimeout(immediateTimeout.current);\n };\n }, []);\n};","import { createSelector, createSelectorMemoized } from '../../../utils/createSelector';\nimport { gridRowsLookupSelector } from '../rows/gridRowsSelector';\nexport const gridRowSelectionStateSelector = state => state.rowSelection;\nexport const selectedGridRowsCountSelector = createSelector(gridRowSelectionStateSelector, selection => selection.length);\nexport const selectedGridRowsSelector = createSelectorMemoized(gridRowSelectionStateSelector, gridRowsLookupSelector, (selectedRows, rowsLookup) => new Map(selectedRows.map(id => [id, rowsLookup[id]])));\nexport const selectedIdsLookupSelector = createSelectorMemoized(gridRowSelectionStateSelector, selection => selection.reduce((lookup, rowId) => {\n lookup[rowId] = rowId;\n return lookup;\n}, {}));","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { GridSignature, useGridApiEventHandler } from '../../utils/useGridApiEventHandler';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { gridRowsLookupSelector } from '../rows/gridRowsSelector';\nimport { gridRowSelectionStateSelector, selectedGridRowsSelector, selectedIdsLookupSelector } from './gridRowSelectionSelector';\nimport { gridPaginatedVisibleSortedGridRowIdsSelector } from '../pagination';\nimport { gridFocusCellSelector } from '../focus/gridFocusStateSelector';\nimport { gridExpandedSortedRowIdsSelector, gridFilterModelSelector } from '../filter/gridFilterSelector';\nimport { GRID_CHECKBOX_SELECTION_COL_DEF, GRID_ACTIONS_COLUMN_TYPE } from '../../../colDef';\nimport { GridCellModes } from '../../../models/gridEditRowModel';\nimport { isKeyboardEvent, isNavigationKey } from '../../../utils/keyboardUtils';\nimport { useGridVisibleRows } from '../../utils/useGridVisibleRows';\nimport { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../../../constants/gridDetailPanelToggleField';\nimport { gridClasses } from '../../../constants/gridClasses';\nimport { isEventTargetInPortal } from '../../../utils/domUtils';\nimport { isMultipleRowSelectionEnabled } from './utils';\nconst getSelectionModelPropValue = (selectionModelProp, prevSelectionModel) => {\n if (selectionModelProp == null) {\n return selectionModelProp;\n }\n if (Array.isArray(selectionModelProp)) {\n return selectionModelProp;\n }\n if (prevSelectionModel && prevSelectionModel[0] === selectionModelProp) {\n return prevSelectionModel;\n }\n return [selectionModelProp];\n};\nexport const rowSelectionStateInitializer = (state, props) => _extends({}, state, {\n rowSelection: props.rowSelection ? getSelectionModelPropValue(props.rowSelectionModel) ?? [] : []\n});\n\n/**\n * @requires useGridRows (state, method) - can be after\n * @requires useGridParamsApi (method) - can be after\n * @requires useGridFocus (state) - can be after\n * @requires useGridKeyboardNavigation (`cellKeyDown` event must first be consumed by it)\n */\nexport const useGridRowSelection = (apiRef, props) => {\n const logger = useGridLogger(apiRef, 'useGridSelection');\n const runIfRowSelectionIsEnabled = callback => (...args) => {\n if (props.rowSelection) {\n callback(...args);\n }\n };\n const propRowSelectionModel = React.useMemo(() => {\n return getSelectionModelPropValue(props.rowSelectionModel, gridRowSelectionStateSelector(apiRef.current.state));\n }, [apiRef, props.rowSelectionModel]);\n const lastRowToggled = React.useRef(null);\n apiRef.current.registerControlState({\n stateId: 'rowSelection',\n propModel: propRowSelectionModel,\n propOnChange: props.onRowSelectionModelChange,\n stateSelector: gridRowSelectionStateSelector,\n changeEvent: 'rowSelectionChange'\n });\n const {\n checkboxSelection,\n disableRowSelectionOnClick,\n isRowSelectable: propIsRowSelectable\n } = props;\n const canHaveMultipleSelection = isMultipleRowSelectionEnabled(props);\n const visibleRows = useGridVisibleRows(apiRef, props);\n const expandMouseRowRangeSelection = React.useCallback(id => {\n let endId = id;\n const startId = lastRowToggled.current ?? id;\n const isSelected = apiRef.current.isRowSelected(id);\n if (isSelected) {\n const visibleRowIds = gridExpandedSortedRowIdsSelector(apiRef);\n const startIndex = visibleRowIds.findIndex(rowId => rowId === startId);\n const endIndex = visibleRowIds.findIndex(rowId => rowId === endId);\n if (startIndex === endIndex) {\n return;\n }\n if (startIndex > endIndex) {\n endId = visibleRowIds[endIndex + 1];\n } else {\n endId = visibleRowIds[endIndex - 1];\n }\n }\n lastRowToggled.current = id;\n apiRef.current.selectRowRange({\n startId,\n endId\n }, !isSelected);\n }, [apiRef]);\n\n /**\n * API METHODS\n */\n const setRowSelectionModel = React.useCallback(model => {\n if (props.signature === GridSignature.DataGrid && !canHaveMultipleSelection && Array.isArray(model) && model.length > 1) {\n throw new Error(['MUI X: `rowSelectionModel` can only contain 1 item in DataGrid.', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock multiple selection.'].join('\\n'));\n }\n const currentModel = gridRowSelectionStateSelector(apiRef.current.state);\n if (currentModel !== model) {\n logger.debug(`Setting selection model`);\n apiRef.current.setState(state => _extends({}, state, {\n rowSelection: props.rowSelection ? model : []\n }));\n apiRef.current.forceUpdate();\n }\n }, [apiRef, logger, props.rowSelection, props.signature, canHaveMultipleSelection]);\n const isRowSelected = React.useCallback(id => gridRowSelectionStateSelector(apiRef.current.state).includes(id), [apiRef]);\n const isRowSelectable = React.useCallback(id => {\n if (propIsRowSelectable && !propIsRowSelectable(apiRef.current.getRowParams(id))) {\n return false;\n }\n const rowNode = apiRef.current.getRowNode(id);\n if (rowNode?.type === 'footer' || rowNode?.type === 'pinnedRow') {\n return false;\n }\n return true;\n }, [apiRef, propIsRowSelectable]);\n const getSelectedRows = React.useCallback(() => selectedGridRowsSelector(apiRef), [apiRef]);\n const selectRow = React.useCallback((id, isSelected = true, resetSelection = false) => {\n if (!apiRef.current.isRowSelectable(id)) {\n return;\n }\n lastRowToggled.current = id;\n if (resetSelection) {\n logger.debug(`Setting selection for row ${id}`);\n apiRef.current.setRowSelectionModel(isSelected ? [id] : []);\n } else {\n logger.debug(`Toggling selection for row ${id}`);\n const selection = gridRowSelectionStateSelector(apiRef.current.state);\n const newSelection = selection.filter(el => el !== id);\n if (isSelected) {\n newSelection.push(id);\n }\n const isSelectionValid = newSelection.length < 2 || canHaveMultipleSelection;\n if (isSelectionValid) {\n apiRef.current.setRowSelectionModel(newSelection);\n }\n }\n }, [apiRef, logger, canHaveMultipleSelection]);\n const selectRows = React.useCallback((ids, isSelected = true, resetSelection = false) => {\n logger.debug(`Setting selection for several rows`);\n const selectableIds = ids.filter(id => apiRef.current.isRowSelectable(id));\n let newSelection;\n if (resetSelection) {\n newSelection = isSelected ? selectableIds : [];\n } else {\n // We clone the existing object to avoid mutating the same object returned by the selector to others part of the project\n const selectionLookup = _extends({}, selectedIdsLookupSelector(apiRef));\n selectableIds.forEach(id => {\n if (isSelected) {\n selectionLookup[id] = id;\n } else {\n delete selectionLookup[id];\n }\n });\n newSelection = Object.values(selectionLookup);\n }\n const isSelectionValid = newSelection.length < 2 || canHaveMultipleSelection;\n if (isSelectionValid) {\n apiRef.current.setRowSelectionModel(newSelection);\n }\n }, [apiRef, logger, canHaveMultipleSelection]);\n const selectRowRange = React.useCallback(({\n startId,\n endId\n }, isSelected = true, resetSelection = false) => {\n if (!apiRef.current.getRow(startId) || !apiRef.current.getRow(endId)) {\n return;\n }\n logger.debug(`Expanding selection from row ${startId} to row ${endId}`);\n\n // Using rows from all pages allow to select a range across several pages\n const allPagesRowIds = gridExpandedSortedRowIdsSelector(apiRef);\n const startIndex = allPagesRowIds.indexOf(startId);\n const endIndex = allPagesRowIds.indexOf(endId);\n const [start, end] = startIndex > endIndex ? [endIndex, startIndex] : [startIndex, endIndex];\n const rowsBetweenStartAndEnd = allPagesRowIds.slice(start, end + 1);\n apiRef.current.selectRows(rowsBetweenStartAndEnd, isSelected, resetSelection);\n }, [apiRef, logger]);\n const selectionPublicApi = {\n selectRow,\n setRowSelectionModel,\n getSelectedRows,\n isRowSelected,\n isRowSelectable\n };\n const selectionPrivateApi = {\n selectRows,\n selectRowRange\n };\n useGridApiMethod(apiRef, selectionPublicApi, 'public');\n useGridApiMethod(apiRef, selectionPrivateApi, props.signature === GridSignature.DataGrid ? 'private' : 'public');\n\n /**\n * EVENTS\n */\n const removeOutdatedSelection = React.useCallback(() => {\n if (props.keepNonExistentRowsSelected) {\n return;\n }\n const currentSelection = gridRowSelectionStateSelector(apiRef.current.state);\n const rowsLookup = gridRowsLookupSelector(apiRef);\n\n // We clone the existing object to avoid mutating the same object returned by the selector to others part of the project\n const selectionLookup = _extends({}, selectedIdsLookupSelector(apiRef));\n let hasChanged = false;\n currentSelection.forEach(id => {\n if (!rowsLookup[id]) {\n delete selectionLookup[id];\n hasChanged = true;\n }\n });\n if (hasChanged) {\n apiRef.current.setRowSelectionModel(Object.values(selectionLookup));\n }\n }, [apiRef, props.keepNonExistentRowsSelected]);\n const handleSingleRowSelection = React.useCallback((id, event) => {\n const hasCtrlKey = event.metaKey || event.ctrlKey;\n\n // multiple selection is only allowed if:\n // - it is a checkboxSelection\n // - it is a keyboard selection\n // - Ctrl is pressed\n\n const isMultipleSelectionDisabled = !checkboxSelection && !hasCtrlKey && !isKeyboardEvent(event);\n const resetSelection = !canHaveMultipleSelection || isMultipleSelectionDisabled;\n const isSelected = apiRef.current.isRowSelected(id);\n if (resetSelection) {\n apiRef.current.selectRow(id, !isMultipleSelectionDisabled ? !isSelected : true, true);\n } else {\n apiRef.current.selectRow(id, !isSelected, false);\n }\n }, [apiRef, canHaveMultipleSelection, checkboxSelection]);\n const handleRowClick = React.useCallback((params, event) => {\n if (disableRowSelectionOnClick) {\n return;\n }\n const field = event.target.closest(`.${gridClasses.cell}`)?.getAttribute('data-field');\n if (field === GRID_CHECKBOX_SELECTION_COL_DEF.field) {\n // click on checkbox should not trigger row selection\n return;\n }\n if (field === GRID_DETAIL_PANEL_TOGGLE_FIELD) {\n // click to open the detail panel should not select the row\n return;\n }\n if (field) {\n const column = apiRef.current.getColumn(field);\n if (column?.type === GRID_ACTIONS_COLUMN_TYPE) {\n return;\n }\n }\n const rowNode = apiRef.current.getRowNode(params.id);\n if (rowNode.type === 'pinnedRow') {\n return;\n }\n if (event.shiftKey && canHaveMultipleSelection) {\n expandMouseRowRangeSelection(params.id);\n } else {\n handleSingleRowSelection(params.id, event);\n }\n }, [disableRowSelectionOnClick, canHaveMultipleSelection, apiRef, expandMouseRowRangeSelection, handleSingleRowSelection]);\n const preventSelectionOnShift = React.useCallback((params, event) => {\n if (canHaveMultipleSelection && event.shiftKey) {\n window.getSelection()?.removeAllRanges();\n }\n }, [canHaveMultipleSelection]);\n const handleRowSelectionCheckboxChange = React.useCallback((params, event) => {\n if (canHaveMultipleSelection && event.nativeEvent.shiftKey) {\n expandMouseRowRangeSelection(params.id);\n } else {\n apiRef.current.selectRow(params.id, params.value, !canHaveMultipleSelection);\n }\n }, [apiRef, expandMouseRowRangeSelection, canHaveMultipleSelection]);\n const handleHeaderSelectionCheckboxChange = React.useCallback(params => {\n const shouldLimitSelectionToCurrentPage = props.checkboxSelectionVisibleOnly && props.pagination;\n const rowsToBeSelected = shouldLimitSelectionToCurrentPage ? gridPaginatedVisibleSortedGridRowIdsSelector(apiRef) : gridExpandedSortedRowIdsSelector(apiRef);\n const filterModel = gridFilterModelSelector(apiRef);\n apiRef.current.selectRows(rowsToBeSelected, params.value, filterModel?.items.length > 0);\n }, [apiRef, props.checkboxSelectionVisibleOnly, props.pagination]);\n const handleCellKeyDown = React.useCallback((params, event) => {\n // Get the most recent cell mode because it may have been changed by another listener\n if (apiRef.current.getCellMode(params.id, params.field) === GridCellModes.Edit) {\n return;\n }\n\n // Ignore portal\n // Do not apply shortcuts if the focus is not on the cell root component\n if (isEventTargetInPortal(event)) {\n return;\n }\n if (isNavigationKey(event.key) && event.shiftKey) {\n // The cell that has focus after the keyboard navigation\n const focusCell = gridFocusCellSelector(apiRef);\n if (focusCell && focusCell.id !== params.id) {\n event.preventDefault();\n const isNextRowSelected = apiRef.current.isRowSelected(focusCell.id);\n if (!canHaveMultipleSelection) {\n apiRef.current.selectRow(focusCell.id, !isNextRowSelected, true);\n return;\n }\n const newRowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(focusCell.id);\n const previousRowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(params.id);\n let start;\n let end;\n if (newRowIndex > previousRowIndex) {\n if (isNextRowSelected) {\n // We are navigating to the bottom of the page and adding selected rows\n start = previousRowIndex;\n end = newRowIndex - 1;\n } else {\n // We are navigating to the bottom of the page and removing selected rows\n start = previousRowIndex;\n end = newRowIndex;\n }\n } else {\n // eslint-disable-next-line no-lonely-if\n if (isNextRowSelected) {\n // We are navigating to the top of the page and removing selected rows\n start = newRowIndex + 1;\n end = previousRowIndex;\n } else {\n // We are navigating to the top of the page and adding selected rows\n start = newRowIndex;\n end = previousRowIndex;\n }\n }\n const rowsBetweenStartAndEnd = visibleRows.rows.slice(start, end + 1).map(row => row.id);\n apiRef.current.selectRows(rowsBetweenStartAndEnd, !isNextRowSelected);\n return;\n }\n }\n if (event.key === ' ' && event.shiftKey) {\n event.preventDefault();\n handleSingleRowSelection(params.id, event);\n return;\n }\n if (event.key === 'a' && (event.ctrlKey || event.metaKey)) {\n event.preventDefault();\n selectRows(apiRef.current.getAllRowIds(), true);\n }\n }, [apiRef, handleSingleRowSelection, selectRows, visibleRows.rows, canHaveMultipleSelection]);\n useGridApiEventHandler(apiRef, 'sortedRowsSet', runIfRowSelectionIsEnabled(removeOutdatedSelection));\n useGridApiEventHandler(apiRef, 'rowClick', runIfRowSelectionIsEnabled(handleRowClick));\n useGridApiEventHandler(apiRef, 'rowSelectionCheckboxChange', runIfRowSelectionIsEnabled(handleRowSelectionCheckboxChange));\n useGridApiEventHandler(apiRef, 'headerSelectionCheckboxChange', handleHeaderSelectionCheckboxChange);\n useGridApiEventHandler(apiRef, 'cellMouseDown', runIfRowSelectionIsEnabled(preventSelectionOnShift));\n useGridApiEventHandler(apiRef, 'cellKeyDown', runIfRowSelectionIsEnabled(handleCellKeyDown));\n\n /**\n * EFFECTS\n */\n React.useEffect(() => {\n if (propRowSelectionModel !== undefined) {\n apiRef.current.setRowSelectionModel(propRowSelectionModel);\n }\n }, [apiRef, propRowSelectionModel, props.rowSelection]);\n React.useEffect(() => {\n if (!props.rowSelection) {\n apiRef.current.setRowSelectionModel([]);\n }\n }, [apiRef, props.rowSelection]);\n const isStateControlled = propRowSelectionModel != null;\n React.useEffect(() => {\n if (isStateControlled || !props.rowSelection) {\n return;\n }\n\n // props.isRowSelectable changed\n const currentSelection = gridRowSelectionStateSelector(apiRef.current.state);\n if (isRowSelectable) {\n const newSelection = currentSelection.filter(id => isRowSelectable(id));\n if (newSelection.length < currentSelection.length) {\n apiRef.current.setRowSelectionModel(newSelection);\n }\n }\n }, [apiRef, isRowSelectable, isStateControlled, props.rowSelection]);\n React.useEffect(() => {\n if (!props.rowSelection || isStateControlled) {\n return;\n }\n const currentSelection = gridRowSelectionStateSelector(apiRef.current.state);\n if (!canHaveMultipleSelection && currentSelection.length > 1) {\n // See https://github.com/mui/mui-x/issues/8455\n apiRef.current.setRowSelectionModel([]);\n }\n }, [apiRef, canHaveMultipleSelection, checkboxSelection, isStateControlled, props.rowSelection]);\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { unstable_composeClasses as composeClasses } from '@mui/utils';\nimport { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';\nimport { getDataGridUtilityClass } from '../../../constants';\nimport { GRID_CHECKBOX_SELECTION_COL_DEF, GRID_CHECKBOX_SELECTION_FIELD } from '../../../colDef';\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n return React.useMemo(() => {\n const slots = {\n cellCheckbox: ['cellCheckbox'],\n columnHeaderCheckbox: ['columnHeaderCheckbox']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n }, [classes]);\n};\nexport const useGridRowSelectionPreProcessors = (apiRef, props) => {\n const ownerState = {\n classes: props.classes\n };\n const classes = useUtilityClasses(ownerState);\n const updateSelectionColumn = React.useCallback(columnsState => {\n const selectionColumn = _extends({}, GRID_CHECKBOX_SELECTION_COL_DEF, {\n cellClassName: classes.cellCheckbox,\n headerClassName: classes.columnHeaderCheckbox,\n headerName: apiRef.current.getLocaleText('checkboxSelectionHeaderName')\n });\n const shouldHaveSelectionColumn = props.checkboxSelection;\n const haveSelectionColumn = columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD] != null;\n if (shouldHaveSelectionColumn && !haveSelectionColumn) {\n columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD] = selectionColumn;\n columnsState.orderedFields = [GRID_CHECKBOX_SELECTION_FIELD, ...columnsState.orderedFields];\n } else if (!shouldHaveSelectionColumn && haveSelectionColumn) {\n delete columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD];\n columnsState.orderedFields = columnsState.orderedFields.filter(field => field !== GRID_CHECKBOX_SELECTION_FIELD);\n } else if (shouldHaveSelectionColumn && haveSelectionColumn) {\n columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD] = _extends({}, selectionColumn, columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD]);\n }\n return columnsState;\n }, [apiRef, classes, props.checkboxSelection]);\n useGridRegisterPipeProcessor(apiRef, 'hydrateColumns', updateSelectionColumn);\n};","import { GridSignature } from '../../utils/useGridApiEventHandler';\nexport function isMultipleRowSelectionEnabled(props) {\n if (props.signature === GridSignature.DataGrid) {\n // DataGrid Community has multiple row selection enabled only if checkbox selection is enabled.\n return props.checkboxSelection && props.disableMultipleRowSelection !== true;\n }\n return !props.disableMultipleRowSelection;\n}","export const gridRowsMetaSelector = state => state.rowsMeta;","import { createSelector, createSelectorMemoized } from '../../../utils/createSelector';\nconst gridRowsStateSelector = state => state.rows;\nexport const gridRowCountSelector = createSelector(gridRowsStateSelector, rows => rows.totalRowCount);\nexport const gridRowsLoadingSelector = createSelector(gridRowsStateSelector, rows => rows.loading);\nexport const gridTopLevelRowCountSelector = createSelector(gridRowsStateSelector, rows => rows.totalTopLevelRowCount);\n\n// TODO rows v6: Rename\nexport const gridRowsLookupSelector = createSelector(gridRowsStateSelector, rows => rows.dataRowIdToModelLookup);\nexport const gridRowsDataRowIdToIdLookupSelector = createSelector(gridRowsStateSelector, rows => rows.dataRowIdToIdLookup);\nexport const gridRowTreeSelector = createSelector(gridRowsStateSelector, rows => rows.tree);\nexport const gridRowGroupingNameSelector = createSelector(gridRowsStateSelector, rows => rows.groupingName);\nexport const gridRowTreeDepthsSelector = createSelector(gridRowsStateSelector, rows => rows.treeDepths);\nexport const gridRowMaximumTreeDepthSelector = createSelectorMemoized(gridRowsStateSelector, rows => {\n const entries = Object.entries(rows.treeDepths);\n if (entries.length === 0) {\n return 1;\n }\n return entries.filter(([, nodeCount]) => nodeCount > 0).map(([depth]) => Number(depth)).sort((a, b) => b - a)[0] + 1;\n});\nexport const gridDataRowIdsSelector = createSelector(gridRowsStateSelector, rows => rows.dataRowIds);\n\n/**\n * @ignore - do not document.\n */\nexport const gridAdditionalRowGroupsSelector = createSelector(gridRowsStateSelector, rows => rows?.additionalRowGroups);\n\n/**\n * @ignore - do not document.\n */\nexport const gridPinnedRowsSelector = createSelectorMemoized(gridAdditionalRowGroupsSelector, additionalRowGroups => {\n const rawPinnedRows = additionalRowGroups?.pinnedRows;\n return {\n bottom: rawPinnedRows?.bottom?.map(rowEntry => ({\n id: rowEntry.id,\n model: rowEntry.model ?? {}\n })) ?? [],\n top: rawPinnedRows?.top?.map(rowEntry => ({\n id: rowEntry.id,\n model: rowEntry.model ?? {}\n })) ?? []\n };\n});\n\n/**\n * @ignore - do not document.\n */\nexport const gridPinnedRowsCountSelector = createSelector(gridPinnedRowsSelector, pinnedRows => {\n return (pinnedRows?.top?.length || 0) + (pinnedRows?.bottom?.length || 0);\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { gridPinnedRowsSelector } from './gridRowsSelector';\nimport { gridDimensionsSelector } from '../dimensions/gridDimensionsSelectors';\nexport const GRID_ROOT_GROUP_ID = `auto-generated-group-node-root`;\nexport const GRID_ID_AUTOGENERATED = Symbol('mui.id_autogenerated');\nexport const buildRootGroup = () => ({\n type: 'group',\n id: GRID_ROOT_GROUP_ID,\n depth: -1,\n groupingField: null,\n groupingKey: null,\n isAutoGenerated: true,\n children: [],\n childrenFromPath: {},\n childrenExpanded: true,\n parent: null\n});\n\n/**\n * A helper function to check if the id provided is valid.\n * @param {GridRowId} id Id as [[GridRowId]].\n * @param {GridRowModel | Partial} row Row as [[GridRowModel]].\n * @param {string} detailErrorMessage A custom error message to display for invalid IDs\n */\nexport function checkGridRowIdIsValid(id, row, detailErrorMessage = 'A row was provided without id in the rows prop:') {\n if (id == null) {\n throw new Error(['MUI X: The data grid component requires all rows to have a unique `id` property.', 'Alternatively, you can use the `getRowId` prop to specify a custom id for each row.', detailErrorMessage, JSON.stringify(row)].join('\\n'));\n }\n}\nexport const getRowIdFromRowModel = (rowModel, getRowId, detailErrorMessage) => {\n const id = getRowId ? getRowId(rowModel) : rowModel.id;\n checkGridRowIdIsValid(id, rowModel, detailErrorMessage);\n return id;\n};\nexport const createRowsInternalCache = ({\n rows,\n getRowId,\n loading,\n rowCount\n}) => {\n const updates = {\n type: 'full',\n rows: []\n };\n const dataRowIdToModelLookup = {};\n const dataRowIdToIdLookup = {};\n for (let i = 0; i < rows.length; i += 1) {\n const model = rows[i];\n const id = getRowIdFromRowModel(model, getRowId);\n dataRowIdToModelLookup[id] = model;\n dataRowIdToIdLookup[id] = id;\n updates.rows.push(id);\n }\n return {\n rowsBeforePartialUpdates: rows,\n loadingPropBeforePartialUpdates: loading,\n rowCountPropBeforePartialUpdates: rowCount,\n updates,\n dataRowIdToIdLookup,\n dataRowIdToModelLookup\n };\n};\nexport const getTopLevelRowCount = ({\n tree,\n rowCountProp = 0\n}) => {\n const rootGroupNode = tree[GRID_ROOT_GROUP_ID];\n return Math.max(rowCountProp, rootGroupNode.children.length + (rootGroupNode.footerId == null ? 0 : 1));\n};\nexport const getRowsStateFromCache = ({\n apiRef,\n rowCountProp = 0,\n loadingProp,\n previousTree,\n previousTreeDepths\n}) => {\n const cache = apiRef.current.caches.rows;\n\n // 1. Apply the \"rowTreeCreation\" family processing.\n const {\n tree: unProcessedTree,\n treeDepths: unProcessedTreeDepths,\n dataRowIds: unProcessedDataRowIds,\n groupingName\n } = apiRef.current.applyStrategyProcessor('rowTreeCreation', {\n previousTree,\n previousTreeDepths,\n updates: cache.updates,\n dataRowIdToIdLookup: cache.dataRowIdToIdLookup,\n dataRowIdToModelLookup: cache.dataRowIdToModelLookup\n });\n\n // 2. Apply the \"hydrateRows\" pipe-processing.\n const groupingParamsWithHydrateRows = apiRef.current.unstable_applyPipeProcessors('hydrateRows', {\n tree: unProcessedTree,\n treeDepths: unProcessedTreeDepths,\n dataRowIdToIdLookup: cache.dataRowIdToIdLookup,\n dataRowIds: unProcessedDataRowIds,\n dataRowIdToModelLookup: cache.dataRowIdToModelLookup\n });\n\n // 3. Reset the cache updates\n apiRef.current.caches.rows.updates = {\n type: 'partial',\n actions: {\n insert: [],\n modify: [],\n remove: []\n },\n idToActionLookup: {}\n };\n return _extends({}, groupingParamsWithHydrateRows, {\n totalRowCount: Math.max(rowCountProp, groupingParamsWithHydrateRows.dataRowIds.length),\n totalTopLevelRowCount: getTopLevelRowCount({\n tree: groupingParamsWithHydrateRows.tree,\n rowCountProp\n }),\n groupingName,\n loading: loadingProp\n });\n};\nexport const isAutoGeneratedRow = rowNode => rowNode.type === 'skeletonRow' || rowNode.type === 'footer' || rowNode.type === 'group' && rowNode.isAutoGenerated || rowNode.type === 'pinnedRow' && rowNode.isAutoGenerated;\nexport const getTreeNodeDescendants = (tree, parentId, skipAutoGeneratedRows) => {\n const node = tree[parentId];\n if (node.type !== 'group') {\n return [];\n }\n const validDescendants = [];\n for (let i = 0; i < node.children.length; i += 1) {\n const child = node.children[i];\n if (!skipAutoGeneratedRows || !isAutoGeneratedRow(tree[child])) {\n validDescendants.push(child);\n }\n const childDescendants = getTreeNodeDescendants(tree, child, skipAutoGeneratedRows);\n for (let j = 0; j < childDescendants.length; j += 1) {\n validDescendants.push(childDescendants[j]);\n }\n }\n if (!skipAutoGeneratedRows && node.footerId != null) {\n validDescendants.push(node.footerId);\n }\n return validDescendants;\n};\nexport const updateCacheWithNewRows = ({\n previousCache,\n getRowId,\n updates\n}) => {\n if (previousCache.updates.type === 'full') {\n throw new Error('MUI X: Unable to prepare a partial update if a full update is not applied yet.');\n }\n\n // Remove duplicate updates.\n // A server can batch updates, and send several updates for the same row in one fn call.\n const uniqueUpdates = new Map();\n updates.forEach(update => {\n const id = getRowIdFromRowModel(update, getRowId, 'A row was provided without id when calling updateRows():');\n if (uniqueUpdates.has(id)) {\n uniqueUpdates.set(id, _extends({}, uniqueUpdates.get(id), update));\n } else {\n uniqueUpdates.set(id, update);\n }\n });\n const partialUpdates = {\n type: 'partial',\n actions: {\n insert: [...(previousCache.updates.actions.insert ?? [])],\n modify: [...(previousCache.updates.actions.modify ?? [])],\n remove: [...(previousCache.updates.actions.remove ?? [])]\n },\n idToActionLookup: _extends({}, previousCache.updates.idToActionLookup)\n };\n const dataRowIdToModelLookup = _extends({}, previousCache.dataRowIdToModelLookup);\n const dataRowIdToIdLookup = _extends({}, previousCache.dataRowIdToIdLookup);\n const alreadyAppliedActionsToRemove = {\n insert: {},\n modify: {},\n remove: {}\n };\n\n // Depending on the action already applied to the data row,\n // We might want drop the already-applied-update.\n // For instance:\n // - if you delete then insert, then you don't want to apply the deletion in the tree.\n // - if you insert, then modify, then you just want to apply the insertion in the tree.\n uniqueUpdates.forEach((partialRow, id) => {\n const actionAlreadyAppliedToRow = partialUpdates.idToActionLookup[id];\n\n // Action === \"delete\"\n // eslint-disable-next-line no-underscore-dangle\n if (partialRow._action === 'delete') {\n // If the data row has been removed since the last state update,\n // Then do nothing.\n if (actionAlreadyAppliedToRow === 'remove' || !dataRowIdToModelLookup[id]) {\n return;\n }\n\n // If the data row has been inserted / modified since the last state update,\n // Then drop this \"insert\" / \"modify\" update.\n if (actionAlreadyAppliedToRow != null) {\n alreadyAppliedActionsToRemove[actionAlreadyAppliedToRow][id] = true;\n }\n\n // Remove the data row from the lookups and add it to the \"delete\" update.\n partialUpdates.actions.remove.push(id);\n delete dataRowIdToModelLookup[id];\n delete dataRowIdToIdLookup[id];\n return;\n }\n const oldRow = dataRowIdToModelLookup[id];\n\n // Action === \"modify\"\n if (oldRow) {\n // If the data row has been removed since the last state update,\n // Then drop this \"remove\" update and add it to the \"modify\" update instead.\n if (actionAlreadyAppliedToRow === 'remove') {\n alreadyAppliedActionsToRemove.remove[id] = true;\n partialUpdates.actions.modify.push(id);\n }\n // If the date has not been inserted / modified since the last state update,\n // Then add it to the \"modify\" update (if it has been inserted it should just remain \"inserted\").\n else if (actionAlreadyAppliedToRow == null) {\n partialUpdates.actions.modify.push(id);\n }\n\n // Update the data row lookups.\n dataRowIdToModelLookup[id] = _extends({}, oldRow, partialRow);\n return;\n }\n\n // Action === \"insert\"\n // If the data row has been removed since the last state update,\n // Then drop the \"remove\" update and add it to the \"insert\" update instead.\n if (actionAlreadyAppliedToRow === 'remove') {\n alreadyAppliedActionsToRemove.remove[id] = true;\n partialUpdates.actions.insert.push(id);\n }\n // If the data row has not been inserted since the last state update,\n // Then add it to the \"insert\" update.\n // `actionAlreadyAppliedToRow` can't be equal to \"modify\", otherwise we would have an `oldRow` above.\n else if (actionAlreadyAppliedToRow == null) {\n partialUpdates.actions.insert.push(id);\n }\n\n // Update the data row lookups.\n dataRowIdToModelLookup[id] = partialRow;\n dataRowIdToIdLookup[id] = id;\n });\n const actionTypeWithActionsToRemove = Object.keys(alreadyAppliedActionsToRemove);\n for (let i = 0; i < actionTypeWithActionsToRemove.length; i += 1) {\n const actionType = actionTypeWithActionsToRemove[i];\n const idsToRemove = alreadyAppliedActionsToRemove[actionType];\n if (Object.keys(idsToRemove).length > 0) {\n partialUpdates.actions[actionType] = partialUpdates.actions[actionType].filter(id => !idsToRemove[id]);\n }\n }\n return {\n dataRowIdToModelLookup,\n dataRowIdToIdLookup,\n updates: partialUpdates,\n rowsBeforePartialUpdates: previousCache.rowsBeforePartialUpdates,\n loadingPropBeforePartialUpdates: previousCache.loadingPropBeforePartialUpdates,\n rowCountPropBeforePartialUpdates: previousCache.rowCountPropBeforePartialUpdates\n };\n};\nexport function calculatePinnedRowsHeight(apiRef) {\n const pinnedRows = gridPinnedRowsSelector(apiRef);\n const topPinnedRowsHeight = pinnedRows?.top?.reduce((acc, value) => {\n acc += apiRef.current.unstable_getRowHeight(value.id);\n return acc;\n }, 0) || 0;\n const bottomPinnedRowsHeight = pinnedRows?.bottom?.reduce((acc, value) => {\n acc += apiRef.current.unstable_getRowHeight(value.id);\n return acc;\n }, 0) || 0;\n return {\n top: topPinnedRowsHeight,\n bottom: bottomPinnedRowsHeight\n };\n}\nexport function getMinimalContentHeight(apiRef) {\n const dimensions = gridDimensionsSelector(apiRef.current.state);\n return `var(--DataGrid-overlayHeight, ${2 * dimensions.rowHeight}px)`;\n}","import * as React from 'react';\nimport { getGridCellElement, getGridColumnHeaderElement, getGridRowElement } from '../../../utils/domUtils';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { gridFocusCellSelector, gridTabIndexCellSelector } from '../focus/gridFocusStateSelector';\nexport class MissingRowIdError extends Error {}\n\n/**\n * @requires useGridColumns (method)\n * @requires useGridRows (method)\n * @requires useGridFocus (state)\n * @requires useGridEditing (method)\n * TODO: Impossible priority - useGridEditing also needs to be after useGridParamsApi\n * TODO: Impossible priority - useGridFocus also needs to be after useGridParamsApi\n */\nexport function useGridParamsApi(apiRef) {\n const getColumnHeaderParams = React.useCallback(field => ({\n field,\n colDef: apiRef.current.getColumn(field)\n }), [apiRef]);\n const getRowParams = React.useCallback(id => {\n const row = apiRef.current.getRow(id);\n if (!row) {\n throw new MissingRowIdError(`No row with id #${id} found`);\n }\n const params = {\n id,\n columns: apiRef.current.getAllColumns(),\n row\n };\n return params;\n }, [apiRef]);\n const getCellParams = React.useCallback((id, field) => {\n const colDef = apiRef.current.getColumn(field);\n const row = apiRef.current.getRow(id);\n const rowNode = apiRef.current.getRowNode(id);\n if (!row || !rowNode) {\n throw new MissingRowIdError(`No row with id #${id} found`);\n }\n const rawValue = row[field];\n const value = colDef?.valueGetter ? colDef.valueGetter(rawValue, row, colDef, apiRef) : rawValue;\n const cellFocus = gridFocusCellSelector(apiRef);\n const cellTabIndex = gridTabIndexCellSelector(apiRef);\n const params = {\n id,\n field,\n row,\n rowNode,\n colDef,\n cellMode: apiRef.current.getCellMode(id, field),\n hasFocus: cellFocus !== null && cellFocus.field === field && cellFocus.id === id,\n tabIndex: cellTabIndex && cellTabIndex.field === field && cellTabIndex.id === id ? 0 : -1,\n value,\n formattedValue: value,\n isEditable: false\n };\n if (colDef && colDef.valueFormatter) {\n params.formattedValue = colDef.valueFormatter(value, row, colDef, apiRef);\n }\n params.isEditable = colDef && apiRef.current.isCellEditable(params);\n return params;\n }, [apiRef]);\n const getCellValue = React.useCallback((id, field) => {\n const colDef = apiRef.current.getColumn(field);\n const row = apiRef.current.getRow(id);\n if (!row) {\n throw new MissingRowIdError(`No row with id #${id} found`);\n }\n if (!colDef || !colDef.valueGetter) {\n return row[field];\n }\n return colDef.valueGetter(row[colDef.field], row, colDef, apiRef);\n }, [apiRef]);\n const getRowValue = React.useCallback((row, colDef) => {\n const field = colDef.field;\n if (!colDef || !colDef.valueGetter) {\n return row[field];\n }\n const value = row[colDef.field];\n return colDef.valueGetter(value, row, colDef, apiRef);\n }, [apiRef]);\n const getRowFormattedValue = React.useCallback((row, colDef) => {\n const value = getRowValue(row, colDef);\n if (!colDef || !colDef.valueFormatter) {\n return value;\n }\n return colDef.valueFormatter(value, row, colDef, apiRef);\n }, [apiRef, getRowValue]);\n const getColumnHeaderElement = React.useCallback(field => {\n if (!apiRef.current.rootElementRef.current) {\n return null;\n }\n return getGridColumnHeaderElement(apiRef.current.rootElementRef.current, field);\n }, [apiRef]);\n const getRowElement = React.useCallback(id => {\n if (!apiRef.current.rootElementRef.current) {\n return null;\n }\n return getGridRowElement(apiRef.current.rootElementRef.current, id);\n }, [apiRef]);\n const getCellElement = React.useCallback((id, field) => {\n if (!apiRef.current.rootElementRef.current) {\n return null;\n }\n return getGridCellElement(apiRef.current.rootElementRef.current, {\n id,\n field\n });\n }, [apiRef]);\n const paramsApi = {\n getCellValue,\n getCellParams,\n getCellElement,\n getRowValue,\n getRowFormattedValue,\n getRowParams,\n getRowElement,\n getColumnHeaderParams,\n getColumnHeaderElement\n };\n useGridApiMethod(apiRef, paramsApi, 'public');\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { gridRowCountSelector, gridRowsLookupSelector, gridRowTreeSelector, gridRowGroupingNameSelector, gridRowTreeDepthsSelector, gridDataRowIdsSelector, gridRowsDataRowIdToIdLookupSelector, gridRowMaximumTreeDepthSelector } from './gridRowsSelector';\nimport { useTimeout } from '../../utils/useTimeout';\nimport { GridSignature, useGridApiEventHandler } from '../../utils/useGridApiEventHandler';\nimport { useGridVisibleRows } from '../../utils/useGridVisibleRows';\nimport { gridSortedRowIdsSelector } from '../sorting/gridSortingSelector';\nimport { gridFilteredRowsLookupSelector } from '../filter/gridFilterSelector';\nimport { getTreeNodeDescendants, createRowsInternalCache, getRowsStateFromCache, isAutoGeneratedRow, GRID_ROOT_GROUP_ID, GRID_ID_AUTOGENERATED, updateCacheWithNewRows, getTopLevelRowCount, getRowIdFromRowModel } from './gridRowsUtils';\nimport { useGridRegisterPipeApplier } from '../../core/pipeProcessing';\nexport const rowsStateInitializer = (state, props, apiRef) => {\n apiRef.current.caches.rows = createRowsInternalCache({\n rows: props.rows,\n getRowId: props.getRowId,\n loading: props.loading,\n rowCount: props.rowCount\n });\n return _extends({}, state, {\n rows: getRowsStateFromCache({\n apiRef,\n rowCountProp: props.rowCount,\n loadingProp: props.loading,\n previousTree: null,\n previousTreeDepths: null\n })\n });\n};\nexport const useGridRows = (apiRef, props) => {\n if (process.env.NODE_ENV !== 'production') {\n try {\n // Freeze the `rows` prop so developers have a fast failure if they try to use Array.prototype.push().\n Object.freeze(props.rows);\n } catch (error) {\n // Sometimes, it's impossible to freeze, so we give up on it.\n }\n }\n const logger = useGridLogger(apiRef, 'useGridRows');\n const currentPage = useGridVisibleRows(apiRef, props);\n const lastUpdateMs = React.useRef(Date.now());\n const lastRowCount = React.useRef(props.rowCount);\n const timeout = useTimeout();\n const getRow = React.useCallback(id => {\n const model = gridRowsLookupSelector(apiRef)[id];\n if (model) {\n return model;\n }\n const node = apiRef.current.getRowNode(id);\n if (node && isAutoGeneratedRow(node)) {\n return {\n [GRID_ID_AUTOGENERATED]: id\n };\n }\n return null;\n }, [apiRef]);\n const getRowIdProp = props.getRowId;\n const getRowId = React.useCallback(row => {\n if (GRID_ID_AUTOGENERATED in row) {\n return row[GRID_ID_AUTOGENERATED];\n }\n if (getRowIdProp) {\n return getRowIdProp(row);\n }\n return row.id;\n }, [getRowIdProp]);\n const lookup = React.useMemo(() => currentPage.rows.reduce((acc, {\n id\n }, index) => {\n acc[id] = index;\n return acc;\n }, {}), [currentPage.rows]);\n const throttledRowsChange = React.useCallback(({\n cache,\n throttle\n }) => {\n const run = () => {\n lastUpdateMs.current = Date.now();\n apiRef.current.setState(state => _extends({}, state, {\n rows: getRowsStateFromCache({\n apiRef,\n rowCountProp: props.rowCount,\n loadingProp: props.loading,\n previousTree: gridRowTreeSelector(apiRef),\n previousTreeDepths: gridRowTreeDepthsSelector(apiRef)\n })\n }));\n apiRef.current.publishEvent('rowsSet');\n apiRef.current.forceUpdate();\n };\n timeout.clear();\n apiRef.current.caches.rows = cache;\n if (!throttle) {\n run();\n return;\n }\n const throttleRemainingTimeMs = props.throttleRowsMs - (Date.now() - lastUpdateMs.current);\n if (throttleRemainingTimeMs > 0) {\n timeout.start(throttleRemainingTimeMs, run);\n return;\n }\n run();\n }, [props.throttleRowsMs, props.rowCount, props.loading, apiRef, timeout]);\n\n /**\n * API METHODS\n */\n const setRows = React.useCallback(rows => {\n logger.debug(`Updating all rows, new length ${rows.length}`);\n const cache = createRowsInternalCache({\n rows,\n getRowId: props.getRowId,\n loading: props.loading,\n rowCount: props.rowCount\n });\n const prevCache = apiRef.current.caches.rows;\n cache.rowsBeforePartialUpdates = prevCache.rowsBeforePartialUpdates;\n throttledRowsChange({\n cache,\n throttle: true\n });\n }, [logger, props.getRowId, props.loading, props.rowCount, throttledRowsChange, apiRef]);\n const updateRows = React.useCallback(updates => {\n if (props.signature === GridSignature.DataGrid && updates.length > 1) {\n throw new Error(['MUI X: You cannot update several rows at once in `apiRef.current.updateRows` on the DataGrid.', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\\n'));\n }\n const nonPinnedRowsUpdates = [];\n updates.forEach(update => {\n const id = getRowIdFromRowModel(update, props.getRowId, 'A row was provided without id when calling updateRows():');\n const rowNode = apiRef.current.getRowNode(id);\n if (rowNode?.type === 'pinnedRow') {\n // @ts-ignore because otherwise `release:build` doesn't work\n const pinnedRowsCache = apiRef.current.caches.pinnedRows;\n const prevModel = pinnedRowsCache.idLookup[id];\n if (prevModel) {\n pinnedRowsCache.idLookup[id] = _extends({}, prevModel, update);\n }\n } else {\n nonPinnedRowsUpdates.push(update);\n }\n });\n const cache = updateCacheWithNewRows({\n updates: nonPinnedRowsUpdates,\n getRowId: props.getRowId,\n previousCache: apiRef.current.caches.rows\n });\n throttledRowsChange({\n cache,\n throttle: true\n });\n }, [props.signature, props.getRowId, throttledRowsChange, apiRef]);\n const getRowModels = React.useCallback(() => {\n const dataRows = gridDataRowIdsSelector(apiRef);\n const idRowsLookup = gridRowsLookupSelector(apiRef);\n return new Map(dataRows.map(id => [id, idRowsLookup[id] ?? {}]));\n }, [apiRef]);\n const getRowsCount = React.useCallback(() => gridRowCountSelector(apiRef), [apiRef]);\n const getAllRowIds = React.useCallback(() => gridDataRowIdsSelector(apiRef), [apiRef]);\n const getRowIndexRelativeToVisibleRows = React.useCallback(id => lookup[id], [lookup]);\n const setRowChildrenExpansion = React.useCallback((id, isExpanded) => {\n const currentNode = apiRef.current.getRowNode(id);\n if (!currentNode) {\n throw new Error(`MUI X: No row with id #${id} found.`);\n }\n if (currentNode.type !== 'group') {\n throw new Error('MUI X: Only group nodes can be expanded or collapsed.');\n }\n const newNode = _extends({}, currentNode, {\n childrenExpanded: isExpanded\n });\n apiRef.current.setState(state => {\n return _extends({}, state, {\n rows: _extends({}, state.rows, {\n tree: _extends({}, state.rows.tree, {\n [id]: newNode\n })\n })\n });\n });\n apiRef.current.forceUpdate();\n apiRef.current.publishEvent('rowExpansionChange', newNode);\n }, [apiRef]);\n const getRowNode = React.useCallback(id => gridRowTreeSelector(apiRef)[id] ?? null, [apiRef]);\n const getRowGroupChildren = React.useCallback(({\n skipAutoGeneratedRows = true,\n groupId,\n applySorting,\n applyFiltering\n }) => {\n const tree = gridRowTreeSelector(apiRef);\n let children;\n if (applySorting) {\n const groupNode = tree[groupId];\n if (!groupNode) {\n return [];\n }\n const sortedRowIds = gridSortedRowIdsSelector(apiRef);\n children = [];\n const startIndex = sortedRowIds.findIndex(id => id === groupId) + 1;\n for (let index = startIndex; index < sortedRowIds.length && tree[sortedRowIds[index]].depth > groupNode.depth; index += 1) {\n const id = sortedRowIds[index];\n if (!skipAutoGeneratedRows || !isAutoGeneratedRow(tree[id])) {\n children.push(id);\n }\n }\n } else {\n children = getTreeNodeDescendants(tree, groupId, skipAutoGeneratedRows);\n }\n if (applyFiltering) {\n const filteredRowsLookup = gridFilteredRowsLookupSelector(apiRef);\n children = children.filter(childId => filteredRowsLookup[childId] !== false);\n }\n return children;\n }, [apiRef]);\n const setRowIndex = React.useCallback((rowId, targetIndex) => {\n const node = apiRef.current.getRowNode(rowId);\n if (!node) {\n throw new Error(`MUI X: No row with id #${rowId} found.`);\n }\n if (node.parent !== GRID_ROOT_GROUP_ID) {\n throw new Error(`MUI X: The row reordering do not support reordering of grouped rows yet.`);\n }\n if (node.type !== 'leaf') {\n throw new Error(`MUI X: The row reordering do not support reordering of footer or grouping rows.`);\n }\n apiRef.current.setState(state => {\n const group = gridRowTreeSelector(state, apiRef.current.instanceId)[GRID_ROOT_GROUP_ID];\n const allRows = group.children;\n const oldIndex = allRows.findIndex(row => row === rowId);\n if (oldIndex === -1 || oldIndex === targetIndex) {\n return state;\n }\n logger.debug(`Moving row ${rowId} to index ${targetIndex}`);\n const updatedRows = [...allRows];\n updatedRows.splice(targetIndex, 0, updatedRows.splice(oldIndex, 1)[0]);\n return _extends({}, state, {\n rows: _extends({}, state.rows, {\n tree: _extends({}, state.rows.tree, {\n [GRID_ROOT_GROUP_ID]: _extends({}, group, {\n children: updatedRows\n })\n })\n })\n });\n });\n apiRef.current.publishEvent('rowsSet');\n }, [apiRef, logger]);\n const replaceRows = React.useCallback((firstRowToRender, newRows) => {\n if (props.signature === GridSignature.DataGrid && newRows.length > 1) {\n throw new Error(['MUI X: You cannot replace rows using `apiRef.current.unstable_replaceRows` on the DataGrid.', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\\n'));\n }\n if (newRows.length === 0) {\n return;\n }\n const treeDepth = gridRowMaximumTreeDepthSelector(apiRef);\n if (treeDepth > 1) {\n throw new Error('`apiRef.current.unstable_replaceRows` is not compatible with tree data and row grouping');\n }\n const tree = _extends({}, gridRowTreeSelector(apiRef));\n const dataRowIdToModelLookup = _extends({}, gridRowsLookupSelector(apiRef));\n const dataRowIdToIdLookup = _extends({}, gridRowsDataRowIdToIdLookupSelector(apiRef));\n const rootGroup = tree[GRID_ROOT_GROUP_ID];\n const rootGroupChildren = [...rootGroup.children];\n const seenIds = new Set();\n for (let i = 0; i < newRows.length; i += 1) {\n const rowModel = newRows[i];\n const rowId = getRowIdFromRowModel(rowModel, props.getRowId, 'A row was provided without id when calling replaceRows().');\n const [removedRowId] = rootGroupChildren.splice(firstRowToRender + i, 1, rowId);\n if (!seenIds.has(removedRowId)) {\n delete dataRowIdToModelLookup[removedRowId];\n delete dataRowIdToIdLookup[removedRowId];\n delete tree[removedRowId];\n }\n const rowTreeNodeConfig = {\n id: rowId,\n depth: 0,\n parent: GRID_ROOT_GROUP_ID,\n type: 'leaf',\n groupingKey: null\n };\n dataRowIdToModelLookup[rowId] = rowModel;\n dataRowIdToIdLookup[rowId] = rowId;\n tree[rowId] = rowTreeNodeConfig;\n seenIds.add(rowId);\n }\n tree[GRID_ROOT_GROUP_ID] = _extends({}, rootGroup, {\n children: rootGroupChildren\n });\n\n // Removes potential remaining skeleton rows from the dataRowIds.\n const dataRowIds = rootGroupChildren.filter(childId => tree[childId]?.type === 'leaf');\n apiRef.current.caches.rows.dataRowIdToModelLookup = dataRowIdToModelLookup;\n apiRef.current.caches.rows.dataRowIdToIdLookup = dataRowIdToIdLookup;\n apiRef.current.setState(state => _extends({}, state, {\n rows: _extends({}, state.rows, {\n dataRowIdToModelLookup,\n dataRowIdToIdLookup,\n dataRowIds,\n tree\n })\n }));\n apiRef.current.publishEvent('rowsSet');\n }, [apiRef, props.signature, props.getRowId]);\n const rowApi = {\n getRow,\n getRowId,\n getRowModels,\n getRowsCount,\n getAllRowIds,\n setRows,\n updateRows,\n getRowNode,\n getRowIndexRelativeToVisibleRows,\n unstable_replaceRows: replaceRows\n };\n const rowProApi = {\n setRowIndex,\n setRowChildrenExpansion,\n getRowGroupChildren\n };\n\n /**\n * EVENTS\n */\n const groupRows = React.useCallback(() => {\n logger.info(`Row grouping pre-processing have changed, regenerating the row tree`);\n let cache;\n if (apiRef.current.caches.rows.rowsBeforePartialUpdates === props.rows) {\n // The `props.rows` did not change since the last row grouping\n // We can use the current rows cache which contains the partial updates done recently.\n cache = _extends({}, apiRef.current.caches.rows, {\n updates: {\n type: 'full',\n rows: gridDataRowIdsSelector(apiRef)\n }\n });\n } else {\n // The `props.rows` has changed since the last row grouping\n // We must use the new `props.rows` on the new grouping\n // This occurs because this event is triggered before the `useEffect` on the rows when both the grouping pre-processing and the rows changes on the same render\n cache = createRowsInternalCache({\n rows: props.rows,\n getRowId: props.getRowId,\n loading: props.loading,\n rowCount: props.rowCount\n });\n }\n throttledRowsChange({\n cache,\n throttle: false\n });\n }, [logger, apiRef, props.rows, props.getRowId, props.loading, props.rowCount, throttledRowsChange]);\n const handleStrategyProcessorChange = React.useCallback(methodName => {\n if (methodName === 'rowTreeCreation') {\n groupRows();\n }\n }, [groupRows]);\n const handleStrategyActivityChange = React.useCallback(() => {\n // `rowTreeCreation` is the only processor ran when `strategyAvailabilityChange` is fired.\n // All the other processors listen to `rowsSet` which will be published by the `groupRows` method below.\n if (apiRef.current.getActiveStrategy('rowTree') !== gridRowGroupingNameSelector(apiRef)) {\n groupRows();\n }\n }, [apiRef, groupRows]);\n useGridApiEventHandler(apiRef, 'activeStrategyProcessorChange', handleStrategyProcessorChange);\n useGridApiEventHandler(apiRef, 'strategyAvailabilityChange', handleStrategyActivityChange);\n\n /**\n * APPLIERS\n */\n const applyHydrateRowsProcessor = React.useCallback(() => {\n apiRef.current.setState(state => {\n const response = apiRef.current.unstable_applyPipeProcessors('hydrateRows', {\n tree: gridRowTreeSelector(state, apiRef.current.instanceId),\n treeDepths: gridRowTreeDepthsSelector(state, apiRef.current.instanceId),\n dataRowIds: gridDataRowIdsSelector(state, apiRef.current.instanceId),\n dataRowIdToModelLookup: gridRowsLookupSelector(state, apiRef.current.instanceId),\n dataRowIdToIdLookup: gridRowsDataRowIdToIdLookupSelector(state, apiRef.current.instanceId)\n });\n return _extends({}, state, {\n rows: _extends({}, state.rows, response, {\n totalTopLevelRowCount: getTopLevelRowCount({\n tree: response.tree,\n rowCountProp: props.rowCount\n })\n })\n });\n });\n apiRef.current.publishEvent('rowsSet');\n apiRef.current.forceUpdate();\n }, [apiRef, props.rowCount]);\n useGridRegisterPipeApplier(apiRef, 'hydrateRows', applyHydrateRowsProcessor);\n useGridApiMethod(apiRef, rowApi, 'public');\n useGridApiMethod(apiRef, rowProApi, props.signature === GridSignature.DataGrid ? 'private' : 'public');\n\n // The effect do not track any value defined synchronously during the 1st render by hooks called after `useGridRows`\n // As a consequence, the state generated by the 1st run of this useEffect will always be equal to the initialization one\n const isFirstRender = React.useRef(true);\n React.useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false;\n return;\n }\n let isRowCountPropUpdated = false;\n if (props.rowCount !== lastRowCount.current) {\n isRowCountPropUpdated = true;\n lastRowCount.current = props.rowCount;\n }\n const areNewRowsAlreadyInState = apiRef.current.caches.rows.rowsBeforePartialUpdates === props.rows;\n const isNewLoadingAlreadyInState = apiRef.current.caches.rows.loadingPropBeforePartialUpdates === props.loading;\n const isNewRowCountAlreadyInState = apiRef.current.caches.rows.rowCountPropBeforePartialUpdates === props.rowCount;\n\n // The new rows have already been applied (most likely in the `'rowGroupsPreProcessingChange'` listener)\n if (areNewRowsAlreadyInState) {\n // If the loading prop has changed, we need to update its value in the state because it won't be done by `throttledRowsChange`\n if (!isNewLoadingAlreadyInState) {\n apiRef.current.setState(state => _extends({}, state, {\n rows: _extends({}, state.rows, {\n loading: props.loading\n })\n }));\n apiRef.current.caches.rows.loadingPropBeforePartialUpdates = props.loading;\n apiRef.current.forceUpdate();\n }\n if (!isNewRowCountAlreadyInState) {\n apiRef.current.setState(state => _extends({}, state, {\n rows: _extends({}, state.rows, {\n totalRowCount: Math.max(props.rowCount || 0, state.rows.totalRowCount),\n totalTopLevelRowCount: Math.max(props.rowCount || 0, state.rows.totalTopLevelRowCount)\n })\n }));\n apiRef.current.caches.rows.rowCountPropBeforePartialUpdates = props.rowCount;\n apiRef.current.forceUpdate();\n }\n if (!isRowCountPropUpdated) {\n return;\n }\n }\n logger.debug(`Updating all rows, new length ${props.rows.length}`);\n throttledRowsChange({\n cache: createRowsInternalCache({\n rows: props.rows,\n getRowId: props.getRowId,\n loading: props.loading,\n rowCount: props.rowCount\n }),\n throttle: false\n });\n }, [props.rows, props.rowCount, props.getRowId, props.loading, logger, throttledRowsChange, apiRef]);\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { unstable_debounce as debounce } from '@mui/utils';\nimport { useGridVisibleRows } from '../../utils/useGridVisibleRows';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { useGridSelector } from '../../utils/useGridSelector';\nimport { gridDensityFactorSelector } from '../density/densitySelector';\nimport { gridFilterModelSelector } from '../filter/gridFilterSelector';\nimport { gridPaginationSelector } from '../pagination/gridPaginationSelector';\nimport { gridSortModelSelector } from '../sorting/gridSortingSelector';\nimport { useGridRegisterPipeApplier } from '../../core/pipeProcessing';\nimport { gridPinnedRowsSelector } from './gridRowsSelector';\nimport { DATA_GRID_PROPS_DEFAULT_VALUES } from '../../../DataGrid/useDataGridProps';\n\n// TODO: I think the row heights can now be encoded as a single `size` instead of `sizes.baseXxxx`\n\nexport const rowsMetaStateInitializer = state => _extends({}, state, {\n rowsMeta: {\n currentPageTotalHeight: 0,\n positions: []\n }\n});\nlet warnedOnceInvalidRowHeight = false;\nconst getValidRowHeight = (rowHeightProp, defaultRowHeight, warningMessage) => {\n if (typeof rowHeightProp === 'number' && rowHeightProp > 0) {\n return rowHeightProp;\n }\n if (process.env.NODE_ENV !== 'production' && !warnedOnceInvalidRowHeight && typeof rowHeightProp !== 'undefined' && rowHeightProp !== null) {\n console.warn(warningMessage);\n warnedOnceInvalidRowHeight = true;\n }\n return defaultRowHeight;\n};\nconst rowHeightWarning = [`MUI X: The \\`rowHeight\\` prop should be a number greater than 0.`, `The default value will be used instead.`].join('\\n');\nconst getRowHeightWarning = [`MUI X: The \\`getRowHeight\\` prop should return a number greater than 0 or 'auto'.`, `The default value will be used instead.`].join('\\n');\n\n/**\n * @requires useGridPageSize (method)\n * @requires useGridPage (method)\n */\nexport const useGridRowsMeta = (apiRef, props) => {\n const {\n getRowHeight: getRowHeightProp,\n getRowSpacing,\n getEstimatedRowHeight\n } = props;\n const rowsHeightLookup = React.useRef(Object.create(null));\n\n // Inspired by https://github.com/bvaughn/react-virtualized/blob/master/source/Grid/utils/CellSizeAndPositionManager.js\n const lastMeasuredRowIndex = React.useRef(-1);\n const hasRowWithAutoHeight = React.useRef(false);\n const densityFactor = useGridSelector(apiRef, gridDensityFactorSelector);\n const filterModel = useGridSelector(apiRef, gridFilterModelSelector);\n const paginationState = useGridSelector(apiRef, gridPaginationSelector);\n const sortModel = useGridSelector(apiRef, gridSortModelSelector);\n const currentPage = useGridVisibleRows(apiRef, props);\n const pinnedRows = useGridSelector(apiRef, gridPinnedRowsSelector);\n const validRowHeight = getValidRowHeight(props.rowHeight, DATA_GRID_PROPS_DEFAULT_VALUES.rowHeight, rowHeightWarning);\n const rowHeight = Math.floor(validRowHeight * densityFactor);\n const hydrateRowsMeta = React.useCallback(() => {\n hasRowWithAutoHeight.current = false;\n const calculateRowProcessedSizes = row => {\n if (!rowsHeightLookup.current[row.id]) {\n rowsHeightLookup.current[row.id] = {\n sizes: {\n baseCenter: rowHeight\n },\n isResized: false,\n autoHeight: false,\n needsFirstMeasurement: true // Assume all rows will need to be measured by default\n };\n }\n const {\n isResized,\n needsFirstMeasurement,\n sizes\n } = rowsHeightLookup.current[row.id];\n let baseRowHeight = typeof rowHeight === 'number' && rowHeight > 0 ? rowHeight : 52;\n const existingBaseRowHeight = sizes.baseCenter;\n if (isResized) {\n // Do not recalculate resized row height and use the value from the lookup\n baseRowHeight = existingBaseRowHeight;\n } else if (getRowHeightProp) {\n const rowHeightFromUser = getRowHeightProp(_extends({}, row, {\n densityFactor\n }));\n if (rowHeightFromUser === 'auto') {\n if (needsFirstMeasurement) {\n const estimatedRowHeight = getEstimatedRowHeight ? getEstimatedRowHeight(_extends({}, row, {\n densityFactor\n })) : rowHeight;\n\n // If the row was not measured yet use the estimated row height\n baseRowHeight = estimatedRowHeight ?? rowHeight;\n } else {\n baseRowHeight = existingBaseRowHeight;\n }\n hasRowWithAutoHeight.current = true;\n rowsHeightLookup.current[row.id].autoHeight = true;\n } else {\n // Default back to base rowHeight if getRowHeight returns invalid value.\n baseRowHeight = getValidRowHeight(rowHeightFromUser, rowHeight, getRowHeightWarning);\n rowsHeightLookup.current[row.id].needsFirstMeasurement = false;\n rowsHeightLookup.current[row.id].autoHeight = false;\n }\n } else {\n rowsHeightLookup.current[row.id].needsFirstMeasurement = false;\n }\n const initialHeights = {\n baseCenter: baseRowHeight\n };\n if (getRowSpacing) {\n const indexRelativeToCurrentPage = apiRef.current.getRowIndexRelativeToVisibleRows(row.id);\n const spacing = getRowSpacing(_extends({}, row, {\n isFirstVisible: indexRelativeToCurrentPage === 0,\n isLastVisible: indexRelativeToCurrentPage === currentPage.rows.length - 1,\n indexRelativeToCurrentPage\n }));\n initialHeights.spacingTop = spacing.top ?? 0;\n initialHeights.spacingBottom = spacing.bottom ?? 0;\n }\n const processedSizes = apiRef.current.unstable_applyPipeProcessors('rowHeight', initialHeights, row);\n rowsHeightLookup.current[row.id].sizes = processedSizes;\n return processedSizes;\n };\n const positions = [];\n const currentPageTotalHeight = currentPage.rows.reduce((acc, row) => {\n positions.push(acc);\n let otherSizes = 0;\n const processedSizes = calculateRowProcessedSizes(row);\n /* eslint-disable-next-line no-restricted-syntax, guard-for-in */\n for (const key in processedSizes) {\n const value = processedSizes[key];\n if (key !== 'baseCenter') {\n otherSizes += value;\n }\n }\n return acc + processedSizes.baseCenter + otherSizes;\n }, 0);\n pinnedRows?.top?.forEach(row => {\n calculateRowProcessedSizes(row);\n });\n pinnedRows?.bottom?.forEach(row => {\n calculateRowProcessedSizes(row);\n });\n apiRef.current.setState(state => {\n return _extends({}, state, {\n rowsMeta: {\n currentPageTotalHeight,\n positions\n }\n });\n });\n if (!hasRowWithAutoHeight.current) {\n // No row has height=auto, so all rows are already measured\n lastMeasuredRowIndex.current = Infinity;\n }\n apiRef.current.forceUpdate();\n }, [apiRef, currentPage.rows, rowHeight, getRowHeightProp, getRowSpacing, getEstimatedRowHeight, pinnedRows, densityFactor]);\n const getRowHeight = React.useCallback(rowId => {\n const height = rowsHeightLookup.current[rowId];\n return height ? height.sizes.baseCenter : rowHeight;\n }, [rowHeight]);\n const getRowInternalSizes = rowId => rowsHeightLookup.current[rowId]?.sizes;\n const setRowHeight = React.useCallback((id, height) => {\n rowsHeightLookup.current[id].sizes.baseCenter = height;\n rowsHeightLookup.current[id].isResized = true;\n rowsHeightLookup.current[id].needsFirstMeasurement = false;\n hydrateRowsMeta();\n }, [hydrateRowsMeta]);\n const debouncedHydrateRowsMeta = React.useMemo(() => debounce(hydrateRowsMeta, props.rowPositionsDebounceMs), [hydrateRowsMeta, props.rowPositionsDebounceMs]);\n const storeMeasuredRowHeight = React.useCallback((id, height) => {\n if (!rowsHeightLookup.current[id] || !rowsHeightLookup.current[id].autoHeight) {\n return;\n }\n\n // Only trigger hydration if the value is different, otherwise we trigger a loop\n const needsHydration = rowsHeightLookup.current[id].sizes.baseCenter !== height;\n rowsHeightLookup.current[id].needsFirstMeasurement = false;\n rowsHeightLookup.current[id].sizes.baseCenter = height;\n if (needsHydration) {\n debouncedHydrateRowsMeta();\n }\n }, [debouncedHydrateRowsMeta]);\n const rowHasAutoHeight = React.useCallback(id => {\n return rowsHeightLookup.current[id]?.autoHeight || false;\n }, []);\n const getLastMeasuredRowIndex = React.useCallback(() => {\n return lastMeasuredRowIndex.current;\n }, []);\n const setLastMeasuredRowIndex = React.useCallback(index => {\n if (hasRowWithAutoHeight.current && index > lastMeasuredRowIndex.current) {\n lastMeasuredRowIndex.current = index;\n }\n }, []);\n const resetRowHeights = React.useCallback(() => {\n rowsHeightLookup.current = {};\n hydrateRowsMeta();\n }, [hydrateRowsMeta]);\n\n // The effect is used to build the rows meta data - currentPageTotalHeight and positions.\n // Because of variable row height this is needed for the virtualization\n React.useEffect(() => {\n hydrateRowsMeta();\n }, [rowHeight, filterModel, paginationState, sortModel, hydrateRowsMeta]);\n useGridRegisterPipeApplier(apiRef, 'rowHeight', hydrateRowsMeta);\n const rowsMetaApi = {\n unstable_setLastMeasuredRowIndex: setLastMeasuredRowIndex,\n unstable_getRowHeight: getRowHeight,\n unstable_getRowInternalSizes: getRowInternalSizes,\n unstable_setRowHeight: setRowHeight,\n unstable_storeRowHeightMeasurement: storeMeasuredRowHeight,\n resetRowHeights\n };\n const rowsMetaPrivateApi = {\n getLastMeasuredRowIndex,\n rowHasAutoHeight\n };\n useGridApiMethod(apiRef, rowsMetaApi, 'public');\n useGridApiMethod(apiRef, rowsMetaPrivateApi, 'private');\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { GRID_DEFAULT_STRATEGY, useGridRegisterStrategyProcessor } from '../../core/strategyProcessing';\nimport { buildRootGroup, GRID_ROOT_GROUP_ID } from './gridRowsUtils';\nconst createFlatRowTree = rows => {\n const tree = {\n [GRID_ROOT_GROUP_ID]: _extends({}, buildRootGroup(), {\n children: rows\n })\n };\n for (let i = 0; i < rows.length; i += 1) {\n const rowId = rows[i];\n tree[rowId] = {\n id: rowId,\n depth: 0,\n parent: GRID_ROOT_GROUP_ID,\n type: 'leaf',\n groupingKey: null\n };\n }\n return {\n groupingName: GRID_DEFAULT_STRATEGY,\n tree,\n treeDepths: {\n 0: rows.length\n },\n dataRowIds: rows\n };\n};\nconst updateFlatRowTree = ({\n previousTree,\n actions\n}) => {\n const tree = _extends({}, previousTree);\n const idsToRemoveFromRootGroup = {};\n for (let i = 0; i < actions.remove.length; i += 1) {\n const idToDelete = actions.remove[i];\n idsToRemoveFromRootGroup[idToDelete] = true;\n delete tree[idToDelete];\n }\n for (let i = 0; i < actions.insert.length; i += 1) {\n const idToInsert = actions.insert[i];\n tree[idToInsert] = {\n id: idToInsert,\n depth: 0,\n parent: GRID_ROOT_GROUP_ID,\n type: 'leaf',\n groupingKey: null\n };\n }\n\n // TODO rows v6: Support row unpinning\n\n const rootGroup = tree[GRID_ROOT_GROUP_ID];\n let rootGroupChildren = [...rootGroup.children, ...actions.insert];\n if (Object.values(idsToRemoveFromRootGroup).length) {\n rootGroupChildren = rootGroupChildren.filter(id => !idsToRemoveFromRootGroup[id]);\n }\n tree[GRID_ROOT_GROUP_ID] = _extends({}, rootGroup, {\n children: rootGroupChildren\n });\n return {\n groupingName: GRID_DEFAULT_STRATEGY,\n tree,\n treeDepths: {\n 0: rootGroupChildren.length\n },\n dataRowIds: rootGroupChildren\n };\n};\nconst flatRowTreeCreationMethod = params => {\n if (params.updates.type === 'full') {\n return createFlatRowTree(params.updates.rows);\n }\n return updateFlatRowTree({\n previousTree: params.previousTree,\n actions: params.updates.actions\n });\n};\nexport const useGridRowsPreProcessors = apiRef => {\n useGridRegisterStrategyProcessor(apiRef, GRID_DEFAULT_STRATEGY, 'rowTreeCreation', flatRowTreeCreationMethod);\n};"],"names":["gridHeaderFilteringStateSelector","state","headerFiltering","gridHeaderFilteringEnabledSelector","headerFilteringState","enabled","gridHeaderFilteringEditFieldSelector","editing","gridHeaderFilteringMenuSelector","menuOpen","getLeftColumnIndex","currentColIndex","firstColIndex","lastColIndex","direction","getRightColumnIndex","useGridKeyboardNavigation","apiRef","props","logger","initialCurrentPageRows","rows","theme","currentPageRows","pinnedRows","top","bottom","enrichPageRowsWithPinnedRows","headerFilteringEnabled","signature","headerFilters","goToCell","colIndex","rowId","closestColumnToUse","visibleSortedRows","nextCellColSpanInfo","current","unstable_getCellColSpanInfo","spannedByColSpan","leftVisibleCellIndex","rightVisibleCellIndex","rowIndexRelativeToAllRows","findIndex","row","id","debug","scrollToIndexes","rowIndex","field","getVisibleColumns","setCellFocus","goToHeader","event","setColumnHeaderFocus","goToHeaderFilter","setColumnHeaderFilterFocus","goToGroupHeader","depth","setColumnGroupHeaderFocus","getRowIdFromIndex","handleColumnHeaderKeyDown","params","headerTitleNode","currentTarget","querySelector","columnHeaderTitleContainerContent","contains","target","viewportPageSize","getViewportPageSize","colIndexBefore","getColumnIndex","firstRowIndexInPage","length","lastRowIndexInPage","columnGroupMaxDepth","shouldPreventDefault","key","rightColIndex","leftColIndex","Math","min","ctrlKey","metaKey","toggleColumnMenu","preventDefault","handleHeaderFilterKeyDown","isEditing","isHeaderMenuOpen","handleColumnGroupHeaderKeyDown","focusedColumnGroup","currentField","currentDepth","fields","maxDepth","remainingRightColumns","indexOf","remainingLeftColumns","handleCellKeyDown","cellParams","getCellParams","cellMode","Edit","unstable_applyPipeProcessors","cell","rowIndexBefore","shiftKey","colDef","nextRowIndex","max","checkIfCanStartEditing","initialValue","gridPaginationSelector","pagination","gridPaginationModelSelector","paginationModel","gridPaginationRowCountSelector","rowCount","gridPaginationMetaSelector","meta","gridPageSelector","page","gridPageSizeSelector","pageSize","gridPageCountSelector","gridPaginationRowRangeSelector","rowTree","rowTreeDepth","visibleSortedRowEntries","visibleSortedTopLevelRowEntries","visibleTopLevelRowCount","topLevelFirstRowIndex","topLevelLastRowIndex","firstRowIndex","lastRowIndex","topLevelFirstRow","topLevelRowsInCurrentPageCount","topLevelRowAdded","undefined","gridPaginatedVisibleSortedGridRowEntriesSelector","paginationRange","slice","gridPaginatedVisibleSortedGridRowIdsSelector","visibleSortedRowIds","defaultPageSize","autoPageSize","getPageCount","ceil","getDefaultGridPaginationModel","getValidPage","pageCount","throwIfPageSizeExceedsTheLimit","signatureProp","DataGrid","Error","join","paginationStateInitializer","initialState","paginationMeta","useGridPagination","useGridLogger","useGridSelector","registerControlState","stateId","propModel","propOnChange","onPaginationMetaChange","stateSelector","changeEvent","paginationMetaApi","setPaginationMeta","newPaginationMeta","setState","useGridApiMethod","stateExportPreProcessing","prevState","context","exportedPaginationMeta","exportOnlyDirtyModels","stateRestorePreProcessing","restoredPaginationMeta","stateToRestore","useGridRegisterPipeProcessor","useGridPaginationMeta","useGridPaginationModel","rowCountState","previousPageSize","useLazyRef","onRowCountChange","paginationRowCountApi","setRowCount","newRowCount","exportedRowCount","restoredRowCount","handlePaginationModelChange","model","paginationMode","setPage","useGridApiEventHandler","isLastPage","hasNextPage","useGridRowCount","getDerivedPaginationModel","paginationState","paginationModelProp","validPage","densityFactor","rowHeight","floor","onPaginationModelChange","paginationModelApi","currentModel","setPaginationModel","setPageSize","handleUpdateAutoPageSize","dimensions","getRootDimensions","maximumPageSizeWithoutScrollBar","viewportInnerSize","height","handleRowCountChange","virtualScrollerRef","gridPreferencePanelStateSelector","preferencePanel","GridPreferencePanelsValue","preferencePanelStateInitializer","open","useGridPreferencesPanel","hideTimeout","immediateTimeout","hidePreferences","preferencePanelState","openedPanelValue","publishEvent","forceUpdate","doNotHidePanel","setTimeout","clearTimeout","hidePreferencesDelayed","showPreferences","newValue","panelId","labelId","preferencePanelToExport","gridRowSelectionStateSelector","rowSelection","selectedGridRowsCountSelector","selection","selectedGridRowsSelector","selectedRows","rowsLookup","Map","map","selectedIdsLookupSelector","reduce","lookup","getSelectionModelPropValue","selectionModelProp","prevSelectionModel","Array","isArray","rowSelectionStateInitializer","rowSelectionModel","useGridRowSelection","runIfRowSelectionIsEnabled","callback","args","propRowSelectionModel","lastRowToggled","onRowSelectionModelChange","checkboxSelection","disableRowSelectionOnClick","isRowSelectable","propIsRowSelectable","canHaveMultipleSelection","visibleRows","expandMouseRowRangeSelection","endId","startId","isSelected","isRowSelected","visibleRowIds","startIndex","endIndex","selectRowRange","setRowSelectionModel","includes","getRowParams","rowNode","getRowNode","type","getSelectedRows","selectRow","resetSelection","newSelection","filter","el","push","selectRows","ids","selectableIds","selectionLookup","forEach","Object","values","getRow","allPagesRowIds","start","end","rowsBetweenStartAndEnd","selectionPublicApi","selectionPrivateApi","removeOutdatedSelection","keepNonExistentRowsSelected","currentSelection","hasChanged","handleSingleRowSelection","hasCtrlKey","isMultipleSelectionDisabled","handleRowClick","closest","getAttribute","column","getColumn","preventSelectionOnShift","window","getSelection","removeAllRanges","handleRowSelectionCheckboxChange","nativeEvent","value","handleHeaderSelectionCheckboxChange","rowsToBeSelected","checkboxSelectionVisibleOnly","filterModel","items","getCellMode","focusCell","isNextRowSelected","newRowIndex","getRowIndexRelativeToVisibleRows","previousRowIndex","getAllRowIds","isStateControlled","useGridRowSelectionPreProcessors","classes","ownerState","cellCheckbox","columnHeaderCheckbox","useUtilityClasses","updateSelectionColumn","columnsState","selectionColumn","cellClassName","headerClassName","headerName","getLocaleText","shouldHaveSelectionColumn","haveSelectionColumn","orderedFields","isMultipleRowSelectionEnabled","disableMultipleRowSelection","gridRowsMetaSelector","rowsMeta","gridRowsStateSelector","gridRowCountSelector","totalRowCount","gridRowsLoadingSelector","loading","gridTopLevelRowCountSelector","totalTopLevelRowCount","gridRowsLookupSelector","dataRowIdToModelLookup","gridRowsDataRowIdToIdLookupSelector","dataRowIdToIdLookup","gridRowTreeSelector","tree","gridRowGroupingNameSelector","groupingName","gridRowTreeDepthsSelector","treeDepths","gridRowMaximumTreeDepthSelector","entries","nodeCount","Number","sort","a","b","gridDataRowIdsSelector","dataRowIds","gridAdditionalRowGroupsSelector","additionalRowGroups","gridPinnedRowsSelector","rawPinnedRows","rowEntry","gridPinnedRowsCountSelector","GRID_ROOT_GROUP_ID","GRID_ID_AUTOGENERATED","Symbol","buildRootGroup","groupingField","groupingKey","isAutoGenerated","children","childrenFromPath","childrenExpanded","parent","getRowIdFromRowModel","rowModel","getRowId","detailErrorMessage","JSON","stringify","checkGridRowIdIsValid","createRowsInternalCache","updates","i","rowsBeforePartialUpdates","loadingPropBeforePartialUpdates","rowCountPropBeforePartialUpdates","getTopLevelRowCount","rowCountProp","rootGroupNode","footerId","getRowsStateFromCache","loadingProp","previousTree","previousTreeDepths","cache","caches","unProcessedTree","unProcessedTreeDepths","unProcessedDataRowIds","applyStrategyProcessor","groupingParamsWithHydrateRows","actions","insert","modify","remove","idToActionLookup","isAutoGeneratedRow","getTreeNodeDescendants","parentId","skipAutoGeneratedRows","node","validDescendants","child","childDescendants","j","updateCacheWithNewRows","previousCache","uniqueUpdates","update","has","set","get","partialUpdates","alreadyAppliedActionsToRemove","partialRow","actionAlreadyAppliedToRow","_action","oldRow","actionTypeWithActionsToRemove","keys","actionType","idsToRemove","calculatePinnedRowsHeight","acc","unstable_getRowHeight","getMinimalContentHeight","MissingRowIdError","useGridParamsApi","getColumnHeaderParams","columns","getAllColumns","rawValue","valueGetter","cellFocus","cellTabIndex","hasFocus","tabIndex","formattedValue","isEditable","valueFormatter","isCellEditable","getCellValue","getRowValue","getRowFormattedValue","getColumnHeaderElement","rootElementRef","getRowElement","paramsApi","getCellElement","rowsStateInitializer","useGridRows","currentPage","lastUpdateMs","Date","now","lastRowCount","timeout","getRowIdProp","index","throttledRowsChange","throttle","run","clear","throttleRemainingTimeMs","throttleRowsMs","setRows","prevCache","updateRows","nonPinnedRowsUpdates","pinnedRowsCache","prevModel","idLookup","getRowModels","dataRows","idRowsLookup","getRowsCount","setRowChildrenExpansion","isExpanded","currentNode","newNode","getRowGroupChildren","groupId","applySorting","applyFiltering","groupNode","sortedRowIds","filteredRowsLookup","childId","setRowIndex","targetIndex","group","instanceId","allRows","oldIndex","updatedRows","splice","rowApi","unstable_replaceRows","firstRowToRender","newRows","rootGroup","rootGroupChildren","seenIds","Set","removedRowId","rowTreeNodeConfig","add","rowProApi","groupRows","info","handleStrategyProcessorChange","methodName","handleStrategyActivityChange","getActiveStrategy","applyHydrateRowsProcessor","response","isFirstRender","isRowCountPropUpdated","areNewRowsAlreadyInState","isNewLoadingAlreadyInState","isNewRowCountAlreadyInState","rowsMetaStateInitializer","currentPageTotalHeight","positions","getValidRowHeight","rowHeightProp","defaultRowHeight","warningMessage","useGridRowsMeta","getRowHeight","getRowHeightProp","getRowSpacing","getEstimatedRowHeight","rowsHeightLookup","create","lastMeasuredRowIndex","hasRowWithAutoHeight","sortModel","validRowHeight","hydrateRowsMeta","calculateRowProcessedSizes","sizes","baseCenter","isResized","autoHeight","needsFirstMeasurement","baseRowHeight","existingBaseRowHeight","rowHeightFromUser","initialHeights","indexRelativeToCurrentPage","spacing","isFirstVisible","isLastVisible","spacingTop","spacingBottom","processedSizes","otherSizes","Infinity","setRowHeight","debouncedHydrateRowsMeta","rowPositionsDebounceMs","storeMeasuredRowHeight","needsHydration","rowHasAutoHeight","getLastMeasuredRowIndex","setLastMeasuredRowIndex","resetRowHeights","rowsMetaApi","unstable_setLastMeasuredRowIndex","unstable_getRowInternalSizes","unstable_setRowHeight","unstable_storeRowHeightMeasurement","rowsMetaPrivateApi","flatRowTreeCreationMethod","createFlatRowTree","idsToRemoveFromRootGroup","idToDelete","idToInsert","updateFlatRowTree","useGridRowsPreProcessors"],"sourceRoot":""}