1 line
4.3 KiB
JSON
1 line
4.3 KiB
JSON
{"ast":null,"code":"import { createSelector } from '../../../utils/createSelector';\nimport { gridRowsLookupSelector } from '../rows/gridRowsSelector';\n/**\n * @category Sorting\n * @ignore - do not document.\n */\n\nexport const gridSortingStateSelector = state => state.sorting;\n/**\n * Get the id of the rows after the sorting process.\n * @category Sorting\n */\n\nexport const gridSortedRowIdsSelector = createSelector(gridSortingStateSelector, sortingState => sortingState.sortedRows);\n/**\n * Get the id and the model of the rows after the sorting process.\n * @category Sorting\n */\n\nexport const gridSortedRowEntriesSelector = createSelector(gridSortedRowIdsSelector, gridRowsLookupSelector, (sortedIds, idRowsLookup) => sortedIds.map(id => ({\n id,\n model: idRowsLookup[id]\n})));\n/**\n * Get the current sorting model.\n * @category Sorting\n */\n\nexport const gridSortModelSelector = createSelector(gridSortingStateSelector, sorting => sorting.sortModel);\n\n/**\n * @category Sorting\n * @ignore - do not document.\n */\nexport const gridSortColumnLookupSelector = createSelector(gridSortModelSelector, sortModel => {\n const result = sortModel.reduce((res, sortItem, index) => {\n res[sortItem.field] = {\n sortDirection: sortItem.sort,\n sortIndex: sortModel.length > 1 ? index + 1 : undefined\n };\n return res;\n }, {});\n return result;\n});","map":{"version":3,"names":["createSelector","gridRowsLookupSelector","gridSortingStateSelector","state","sorting","gridSortedRowIdsSelector","sortingState","sortedRows","gridSortedRowEntriesSelector","sortedIds","idRowsLookup","map","id","model","gridSortModelSelector","sortModel","gridSortColumnLookupSelector","result","reduce","res","sortItem","index","field","sortDirection","sort","sortIndex","length","undefined"],"sources":["/home/gnx/Desktop/ETB/ETB-FrontEnd/node_modules/@mui/x-data-grid/hooks/features/sorting/gridSortingSelector.js"],"sourcesContent":["import { createSelector } from '../../../utils/createSelector';\nimport { gridRowsLookupSelector } from '../rows/gridRowsSelector';\n/**\n * @category Sorting\n * @ignore - do not document.\n */\n\nexport const gridSortingStateSelector = state => state.sorting;\n/**\n * Get the id of the rows after the sorting process.\n * @category Sorting\n */\n\nexport const gridSortedRowIdsSelector = createSelector(gridSortingStateSelector, sortingState => sortingState.sortedRows);\n/**\n * Get the id and the model of the rows after the sorting process.\n * @category Sorting\n */\n\nexport const gridSortedRowEntriesSelector = createSelector(gridSortedRowIdsSelector, gridRowsLookupSelector, (sortedIds, idRowsLookup) => sortedIds.map(id => ({\n id,\n model: idRowsLookup[id]\n})));\n/**\n * Get the current sorting model.\n * @category Sorting\n */\n\nexport const gridSortModelSelector = createSelector(gridSortingStateSelector, sorting => sorting.sortModel);\n\n/**\n * @category Sorting\n * @ignore - do not document.\n */\nexport const gridSortColumnLookupSelector = createSelector(gridSortModelSelector, sortModel => {\n const result = sortModel.reduce((res, sortItem, index) => {\n res[sortItem.field] = {\n sortDirection: sortItem.sort,\n sortIndex: sortModel.length > 1 ? index + 1 : undefined\n };\n return res;\n }, {});\n return result;\n});"],"mappings":"AAAA,SAASA,cAAc,QAAQ,+BAA+B;AAC9D,SAASC,sBAAsB,QAAQ,0BAA0B;AACjE;AACA;AACA;AACA;;AAEA,OAAO,MAAMC,wBAAwB,GAAGC,KAAK,IAAIA,KAAK,CAACC,OAAO;AAC9D;AACA;AACA;AACA;;AAEA,OAAO,MAAMC,wBAAwB,GAAGL,cAAc,CAACE,wBAAwB,EAAEI,YAAY,IAAIA,YAAY,CAACC,UAAU,CAAC;AACzH;AACA;AACA;AACA;;AAEA,OAAO,MAAMC,4BAA4B,GAAGR,cAAc,CAACK,wBAAwB,EAAEJ,sBAAsB,EAAE,CAACQ,SAAS,EAAEC,YAAY,KAAKD,SAAS,CAACE,GAAG,CAACC,EAAE,KAAK;EAC7JA,EAAE;EACFC,KAAK,EAAEH,YAAY,CAACE,EAAE;AACxB,CAAC,CAAC,CAAC,CAAC;AACJ;AACA;AACA;AACA;;AAEA,OAAO,MAAME,qBAAqB,GAAGd,cAAc,CAACE,wBAAwB,EAAEE,OAAO,IAAIA,OAAO,CAACW,SAAS,CAAC;;AAE3G;AACA;AACA;AACA;AACA,OAAO,MAAMC,4BAA4B,GAAGhB,cAAc,CAACc,qBAAqB,EAAEC,SAAS,IAAI;EAC7F,MAAME,MAAM,GAAGF,SAAS,CAACG,MAAM,CAAC,CAACC,GAAG,EAAEC,QAAQ,EAAEC,KAAK,KAAK;IACxDF,GAAG,CAACC,QAAQ,CAACE,KAAK,CAAC,GAAG;MACpBC,aAAa,EAAEH,QAAQ,CAACI,IAAI;MAC5BC,SAAS,EAAEV,SAAS,CAACW,MAAM,GAAG,CAAC,GAAGL,KAAK,GAAG,CAAC,GAAGM;IAChD,CAAC;IACD,OAAOR,GAAG;EACZ,CAAC,EAAE,CAAC,CAAC,CAAC;EACN,OAAOF,MAAM;AACf,CAAC,CAAC","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]} |