Files
ETB/ETB-FrontEnd/node_modules/.cache/babel-loader/b4bdf7e3c7449cda524809debde2e73dc9e7da102477d2acca9667483c14d977.json
Iliyan Angelov 306b20e24a Frontend start
2025-09-14 00:54:48 +03:00

1 line
14 KiB
JSON

{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"rowsBeforePartialUpdates\"];\nimport { gridPinnedRowsSelector } from './gridRowsSelector';\n/**\n * A helper function to check if the id provided is valid.\n * @param {GridRowId} id Id as [[GridRowId]].\n * @param {GridRowModel | Partial<GridRowModel>} row Row as [[GridRowModel]].\n * @param {string} detailErrorMessage A custom error message to display for invalid IDs\n */\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: 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 cache = {\n rowsBeforePartialUpdates: rows,\n loadingPropBeforePartialUpdates: loading,\n rowCountPropBeforePartialUpdates: rowCount,\n idRowsLookup: {},\n idToIdLookup: {},\n ids: []\n };\n for (let i = 0; i < rows.length; i += 1) {\n const row = rows[i];\n const id = getRowIdFromRowModel(row, getRowId);\n cache.idRowsLookup[id] = row;\n cache.idToIdLookup[id] = id;\n cache.ids.push(id);\n }\n return cache;\n};\nexport const getRowsStateFromCache = ({\n apiRef,\n previousTree,\n rowCountProp,\n loadingProp\n}) => {\n const _apiRef$current$unsta = apiRef.current.unstable_caches.rows,\n cacheForGrouping = _objectWithoutPropertiesLoose(_apiRef$current$unsta, _excluded);\n const rowCount = rowCountProp != null ? rowCountProp : 0;\n const groupingResponse = apiRef.current.unstable_applyStrategyProcessor('rowTreeCreation', _extends({}, cacheForGrouping, {\n previousTree\n }));\n const processedGroupingResponse = apiRef.current.unstable_applyPipeProcessors('hydrateRows', groupingResponse);\n const dataTopLevelRowCount = processedGroupingResponse.treeDepth === 1 ? processedGroupingResponse.ids.length : Object.values(processedGroupingResponse.tree).filter(node => node.parent == null && !node.isPinned).length;\n return _extends({}, processedGroupingResponse, {\n groupingResponseBeforeRowHydration: groupingResponse,\n loading: loadingProp,\n totalRowCount: Math.max(rowCount, processedGroupingResponse.ids.length),\n totalTopLevelRowCount: Math.max(rowCount, dataTopLevelRowCount)\n });\n};\nexport const getTreeNodeDescendants = (tree, parentId, skipAutoGeneratedRows) => {\n var _tree$parentId;\n const children = (_tree$parentId = tree[parentId]) == null ? void 0 : _tree$parentId.children;\n if (children == null) {\n return [];\n }\n const validDescendants = [];\n for (let i = 0; i < children.length; i += 1) {\n const child = children[i];\n const childNode = tree[child];\n if (!skipAutoGeneratedRows || !childNode.isAutoGenerated) {\n validDescendants.push(child);\n }\n validDescendants.push(...getTreeNodeDescendants(tree, childNode.id, skipAutoGeneratedRows));\n }\n return validDescendants;\n};\nexport function calculatePinnedRowsHeight(apiRef) {\n var _pinnedRows$top, _pinnedRows$bottom;\n const pinnedRows = gridPinnedRowsSelector(apiRef);\n const topPinnedRowsHeight = (pinnedRows == null ? void 0 : (_pinnedRows$top = pinnedRows.top) == null ? void 0 : _pinnedRows$top.reduce((acc, value) => {\n acc += apiRef.current.unstable_getRowHeight(value.id);\n return acc;\n }, 0)) || 0;\n const bottomPinnedRowsHeight = (pinnedRows == null ? void 0 : (_pinnedRows$bottom = pinnedRows.bottom) == null ? void 0 : _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}","map":{"version":3,"names":["_extends","_objectWithoutPropertiesLoose","_excluded","gridPinnedRowsSelector","checkGridRowIdIsValid","id","row","detailErrorMessage","Error","JSON","stringify","join","getRowIdFromRowModel","rowModel","getRowId","createRowsInternalCache","rows","loading","rowCount","cache","rowsBeforePartialUpdates","loadingPropBeforePartialUpdates","rowCountPropBeforePartialUpdates","idRowsLookup","idToIdLookup","ids","i","length","push","getRowsStateFromCache","apiRef","previousTree","rowCountProp","loadingProp","_apiRef$current$unsta","current","unstable_caches","cacheForGrouping","groupingResponse","unstable_applyStrategyProcessor","processedGroupingResponse","unstable_applyPipeProcessors","dataTopLevelRowCount","treeDepth","Object","values","tree","filter","node","parent","isPinned","groupingResponseBeforeRowHydration","totalRowCount","Math","max","totalTopLevelRowCount","getTreeNodeDescendants","parentId","skipAutoGeneratedRows","_tree$parentId","children","validDescendants","child","childNode","isAutoGenerated","calculatePinnedRowsHeight","_pinnedRows$top","_pinnedRows$bottom","pinnedRows","topPinnedRowsHeight","top","reduce","acc","value","unstable_getRowHeight","bottomPinnedRowsHeight","bottom"],"sources":["/home/gnx/Desktop/ETB/ETB-FrontEnd/node_modules/@mui/x-data-grid/hooks/features/rows/gridRowsUtils.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"rowsBeforePartialUpdates\"];\nimport { gridPinnedRowsSelector } from './gridRowsSelector';\n/**\n * A helper function to check if the id provided is valid.\n * @param {GridRowId} id Id as [[GridRowId]].\n * @param {GridRowModel | Partial<GridRowModel>} row Row as [[GridRowModel]].\n * @param {string} detailErrorMessage A custom error message to display for invalid IDs\n */\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: 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 cache = {\n rowsBeforePartialUpdates: rows,\n loadingPropBeforePartialUpdates: loading,\n rowCountPropBeforePartialUpdates: rowCount,\n idRowsLookup: {},\n idToIdLookup: {},\n ids: []\n };\n\n for (let i = 0; i < rows.length; i += 1) {\n const row = rows[i];\n const id = getRowIdFromRowModel(row, getRowId);\n cache.idRowsLookup[id] = row;\n cache.idToIdLookup[id] = id;\n cache.ids.push(id);\n }\n\n return cache;\n};\nexport const getRowsStateFromCache = ({\n apiRef,\n previousTree,\n rowCountProp,\n loadingProp\n}) => {\n const _apiRef$current$unsta = apiRef.current.unstable_caches.rows,\n cacheForGrouping = _objectWithoutPropertiesLoose(_apiRef$current$unsta, _excluded);\n\n const rowCount = rowCountProp != null ? rowCountProp : 0;\n const groupingResponse = apiRef.current.unstable_applyStrategyProcessor('rowTreeCreation', _extends({}, cacheForGrouping, {\n previousTree\n }));\n const processedGroupingResponse = apiRef.current.unstable_applyPipeProcessors('hydrateRows', groupingResponse);\n const dataTopLevelRowCount = processedGroupingResponse.treeDepth === 1 ? processedGroupingResponse.ids.length : Object.values(processedGroupingResponse.tree).filter(node => node.parent == null && !node.isPinned).length;\n return _extends({}, processedGroupingResponse, {\n groupingResponseBeforeRowHydration: groupingResponse,\n loading: loadingProp,\n totalRowCount: Math.max(rowCount, processedGroupingResponse.ids.length),\n totalTopLevelRowCount: Math.max(rowCount, dataTopLevelRowCount)\n });\n};\nexport const getTreeNodeDescendants = (tree, parentId, skipAutoGeneratedRows) => {\n var _tree$parentId;\n\n const children = (_tree$parentId = tree[parentId]) == null ? void 0 : _tree$parentId.children;\n\n if (children == null) {\n return [];\n }\n\n const validDescendants = [];\n\n for (let i = 0; i < children.length; i += 1) {\n const child = children[i];\n const childNode = tree[child];\n\n if (!skipAutoGeneratedRows || !childNode.isAutoGenerated) {\n validDescendants.push(child);\n }\n\n validDescendants.push(...getTreeNodeDescendants(tree, childNode.id, skipAutoGeneratedRows));\n }\n\n return validDescendants;\n};\nexport function calculatePinnedRowsHeight(apiRef) {\n var _pinnedRows$top, _pinnedRows$bottom;\n\n const pinnedRows = gridPinnedRowsSelector(apiRef);\n const topPinnedRowsHeight = (pinnedRows == null ? void 0 : (_pinnedRows$top = pinnedRows.top) == null ? void 0 : _pinnedRows$top.reduce((acc, value) => {\n acc += apiRef.current.unstable_getRowHeight(value.id);\n return acc;\n }, 0)) || 0;\n const bottomPinnedRowsHeight = (pinnedRows == null ? void 0 : (_pinnedRows$bottom = pinnedRows.bottom) == null ? void 0 : _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}"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,6BAA6B,MAAM,yDAAyD;AACnG,MAAMC,SAAS,GAAG,CAAC,0BAA0B,CAAC;AAC9C,SAASC,sBAAsB,QAAQ,oBAAoB;AAC3D;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASC,qBAAqBA,CAACC,EAAE,EAAEC,GAAG,EAAEC,kBAAkB,GAAG,iDAAiD,EAAE;EACrH,IAAIF,EAAE,IAAI,IAAI,EAAE;IACd,MAAM,IAAIG,KAAK,CAAC,CAAC,gFAAgF,EAAE,qFAAqF,EAAED,kBAAkB,EAAEE,IAAI,CAACC,SAAS,CAACJ,GAAG,CAAC,CAAC,CAACK,IAAI,CAAC,IAAI,CAAC,CAAC;EAChP;AACF;AACA,OAAO,MAAMC,oBAAoB,GAAGA,CAACC,QAAQ,EA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