1 line
6.7 KiB
JSON
1 line
6.7 KiB
JSON
{"ast":null,"code":"import { createSelector as reselectCreateSelector } from 'reselect';\nimport { buildWarning } from './warning';\nconst cacheContainer = {\n cache: null\n};\nconst missingInstanceIdWarning = buildWarning(['MUI: A selector was called without passing the instance ID, which may impact the performance of the grid.', 'To fix, call it with `apiRef`, e.g. `mySelector(apiRef)`, or pass the instance ID explicitly, e.g `mySelector(state, apiRef.current.instanceId)`.']);\nexport const createSelector = (...args) => {\n if (cacheContainer.cache === null) {\n cacheContainer.cache = {};\n }\n const selector = (...selectorArgs) => {\n const [stateOrApiRef, instanceId] = selectorArgs;\n const isApiRef = !!stateOrApiRef.current;\n const cacheKey = isApiRef ? stateOrApiRef.current.instanceId : instanceId != null ? instanceId : 'default';\n const state = isApiRef ? stateOrApiRef.current.state : stateOrApiRef;\n if (process.env.NODE_ENV !== 'production') {\n if (cacheKey === 'default') {\n missingInstanceIdWarning();\n }\n }\n if (cacheContainer.cache === null) {\n cacheContainer.cache = {};\n }\n const {\n cache\n } = cacheContainer;\n if (cache[cacheKey] && cache[cacheKey].get(args)) {\n // We pass the cache key because the called selector might have as\n // dependency another selector created with this `createSelector`.\n return cache[cacheKey].get(args)(state, cacheKey);\n }\n const newSelector = reselectCreateSelector(...args);\n if (!cache[cacheKey]) {\n cache[cacheKey] = new Map();\n }\n cache[cacheKey].set(args, newSelector);\n return newSelector(state, cacheKey);\n }; // We use this property to detect if the selector was created with createSelector\n // or it's only a simple function the receives the state and returns part of it.\n\n selector.acceptsApiRef = true;\n return selector;\n}; // eslint-disable-next-line @typescript-eslint/naming-convention\n\nexport const unstable_resetCreateSelectorCache = cacheKey => {\n if (typeof cacheKey !== 'undefined') {\n if (cacheContainer.cache && cacheContainer.cache[cacheKey]) {\n delete cacheContainer.cache[cacheKey];\n }\n } else {\n cacheContainer.cache = null;\n }\n};","map":{"version":3,"names":["createSelector","reselectCreateSelector","buildWarning","cacheContainer","cache","missingInstanceIdWarning","args","selector","selectorArgs","stateOrApiRef","instanceId","isApiRef","current","cacheKey","state","process","env","NODE_ENV","get","newSelector","Map","set","acceptsApiRef","unstable_resetCreateSelectorCache"],"sources":["/home/gnx/Desktop/ETB/ETB-FrontEnd/node_modules/@mui/x-data-grid/utils/createSelector.js"],"sourcesContent":["import { createSelector as reselectCreateSelector } from 'reselect';\nimport { buildWarning } from './warning';\nconst cacheContainer = {\n cache: null\n};\nconst missingInstanceIdWarning = buildWarning(['MUI: A selector was called without passing the instance ID, which may impact the performance of the grid.', 'To fix, call it with `apiRef`, e.g. `mySelector(apiRef)`, or pass the instance ID explicitly, e.g `mySelector(state, apiRef.current.instanceId)`.']);\nexport const createSelector = (...args) => {\n if (cacheContainer.cache === null) {\n cacheContainer.cache = {};\n }\n\n const selector = (...selectorArgs) => {\n const [stateOrApiRef, instanceId] = selectorArgs;\n const isApiRef = !!stateOrApiRef.current;\n const cacheKey = isApiRef ? stateOrApiRef.current.instanceId : instanceId != null ? instanceId : 'default';\n const state = isApiRef ? stateOrApiRef.current.state : stateOrApiRef;\n\n if (process.env.NODE_ENV !== 'production') {\n if (cacheKey === 'default') {\n missingInstanceIdWarning();\n }\n }\n\n if (cacheContainer.cache === null) {\n cacheContainer.cache = {};\n }\n\n const {\n cache\n } = cacheContainer;\n\n if (cache[cacheKey] && cache[cacheKey].get(args)) {\n // We pass the cache key because the called selector might have as\n // dependency another selector created with this `createSelector`.\n return cache[cacheKey].get(args)(state, cacheKey);\n }\n\n const newSelector = reselectCreateSelector(...args);\n\n if (!cache[cacheKey]) {\n cache[cacheKey] = new Map();\n }\n\n cache[cacheKey].set(args, newSelector);\n return newSelector(state, cacheKey);\n }; // We use this property to detect if the selector was created with createSelector\n // or it's only a simple function the receives the state and returns part of it.\n\n\n selector.acceptsApiRef = true;\n return selector;\n}; // eslint-disable-next-line @typescript-eslint/naming-convention\n\nexport const unstable_resetCreateSelectorCache = cacheKey => {\n if (typeof cacheKey !== 'undefined') {\n if (cacheContainer.cache && cacheContainer.cache[cache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