1 line
9.8 KiB
JSON
1 line
9.8 KiB
JSON
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport TablePagination, { tablePaginationClasses } from '@mui/material/TablePagination';\nimport { styled } from '@mui/material/styles';\nimport { useGridSelector } from '../hooks/utils/useGridSelector';\nimport { useGridApiContext } from '../hooks/utils/useGridApiContext';\nimport { useGridRootProps } from '../hooks/utils/useGridRootProps';\nimport { gridPaginationSelector } from '../hooks/features/pagination/gridPaginationSelector';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst GridPaginationRoot = styled(TablePagination)(({\n theme\n}) => ({\n [`& .${tablePaginationClasses.selectLabel}`]: {\n display: 'none',\n [theme.breakpoints.up('sm')]: {\n display: 'block'\n }\n },\n [`& .${tablePaginationClasses.input}`]: {\n display: 'none',\n [theme.breakpoints.up('sm')]: {\n display: 'inline-flex'\n }\n }\n}));\nexport const GridPagination = /*#__PURE__*/React.forwardRef(function GridPagination(props, ref) {\n var _rootProps$rowsPerPag;\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const paginationState = useGridSelector(apiRef, gridPaginationSelector);\n const lastPage = React.useMemo(() => Math.floor(paginationState.rowCount / (paginationState.pageSize || 1)), [paginationState.rowCount, paginationState.pageSize]);\n const handlePageSizeChange = React.useCallback(event => {\n const newPageSize = Number(event.target.value);\n apiRef.current.setPageSize(newPageSize);\n }, [apiRef]);\n const handlePageChange = React.useCallback((event, page) => {\n apiRef.current.setPage(page);\n }, [apiRef]);\n if (process.env.NODE_ENV !== 'production') {\n var _rootProps$pageSize;\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const warnedOnceMissingPageSizeInRowsPerPageOptions = React.useRef(false);\n if (!warnedOnceMissingPageSizeInRowsPerPageOptions.current && !rootProps.autoPageSize && !rootProps.rowsPerPageOptions.includes((_rootProps$pageSize = rootProps.pageSize) != null ? _rootProps$pageSize : paginationState.pageSize)) {\n var _rootProps$pageSize2;\n console.warn([`MUI: The page size \\`${(_rootProps$pageSize2 = rootProps.pageSize) != null ? _rootProps$pageSize2 : paginationState.pageSize}\\` is not preset in the \\`rowsPerPageOptions\\``, `Add it to show the pagination select.`].join('\\n'));\n warnedOnceMissingPageSizeInRowsPerPageOptions.current = true;\n }\n }\n return /*#__PURE__*/_jsx(GridPaginationRoot, _extends({\n ref: ref,\n component: \"div\",\n count: paginationState.rowCount,\n page: paginationState.page <= lastPage ? paginationState.page : lastPage,\n rowsPerPageOptions: (_rootProps$rowsPerPag = rootProps.rowsPerPageOptions) != null && _rootProps$rowsPerPag.includes(paginationState.pageSize) ? rootProps.rowsPerPageOptions : [],\n rowsPerPage: paginationState.pageSize,\n onPageChange: handlePageChange,\n onRowsPerPageChange: handlePageSizeChange\n }, apiRef.current.getLocaleText('MuiTablePagination'), props));\n});","map":{"version":3,"names":["_extends","React","TablePagination","tablePaginationClasses","styled","useGridSelector","useGridApiContext","useGridRootProps","gridPaginationSelector","jsx","_jsx","GridPaginationRoot","theme","selectLabel","display","breakpoints","up","input","GridPagination","forwardRef","props","ref","_rootProps$rowsPerPag","apiRef","rootProps","paginationState","lastPage","useMemo","Math","floor","rowCount","pageSize","handlePageSizeChange","useCallback","event","newPageSize","Number","target","value","current","setPageSize","handlePageChange","page","setPage","process","env","NODE_ENV","_rootProps$pageSize","warnedOnceMissingPageSizeInRowsPerPageOptions","useRef","autoPageSize","rowsPerPageOptions","includes","_rootProps$pageSize2","console","warn","join","component","count","rowsPerPage","onPageChange","onRowsPerPageChange","getLocaleText"],"sources":["/home/gnx/Desktop/ETB/ETB-FrontEnd/node_modules/@mui/x-data-grid/components/GridPagination.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport TablePagination, { tablePaginationClasses } from '@mui/material/TablePagination';\nimport { styled } from '@mui/material/styles';\nimport { useGridSelector } from '../hooks/utils/useGridSelector';\nimport { useGridApiContext } from '../hooks/utils/useGridApiContext';\nimport { useGridRootProps } from '../hooks/utils/useGridRootProps';\nimport { gridPaginationSelector } from '../hooks/features/pagination/gridPaginationSelector';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst GridPaginationRoot = styled(TablePagination)(({\n theme\n}) => ({\n [`& .${tablePaginationClasses.selectLabel}`]: {\n display: 'none',\n [theme.breakpoints.up('sm')]: {\n display: 'block'\n }\n },\n [`& .${tablePaginationClasses.input}`]: {\n display: 'none',\n [theme.breakpoints.up('sm')]: {\n display: 'inline-flex'\n }\n }\n}));\nexport const GridPagination = /*#__PURE__*/React.forwardRef(function GridPagination(props, ref) {\n var _rootProps$rowsPerPag;\n\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const paginationState = useGridSelector(apiRef, gridPaginationSelector);\n const lastPage = React.useMemo(() => Math.floor(paginationState.rowCount / (paginationState.pageSize || 1)), [paginationState.rowCount, paginationState.pageSize]);\n const handlePageSizeChange = React.useCallback(event => {\n const newPageSize = Number(event.target.value);\n apiRef.current.setPageSize(newPageSize);\n }, [apiRef]);\n const handlePageChange = React.useCallback((event, page) => {\n apiRef.current.setPage(page);\n }, [apiRef]);\n\n if (process.env.NODE_ENV !== 'production') {\n var _rootProps$pageSize;\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const warnedOnceMissingPageSizeInRowsPerPageOptions = React.useRef(false);\n\n if (!warnedOnceMissingPageSizeInRowsPerPageOptions.current && !rootProps.autoPageSize && !rootProps.rowsPerPageOptions.includes((_rootProps$pageSize = rootProps.pageSize) != null ? _rootProps$pageSize : paginationState.pageSize)) {\n var _rootProps$pageSize2;\n\n console.warn([`MUI: The page size \\`${(_rootProps$pageSize2 = rootProps.pageSize) != null ? _rootProps$pageSize2 : paginationState.pageSize}\\` is not preset in the \\`rowsPerPageOptions\\``, `Add it to show the pagination select.`].join('\\n'));\n warnedOnceMissingPageSizeInRowsPerPageOptions.current = true;\n }\n }\n\n return /*#__PURE__*/_jsx(GridPaginationRoot, _extends({\n ref: ref,\n component: \"div\",\n count: paginationState.rowCount,\n page: paginationState.page <= lastPage ? paginationState.page : lastPage,\n rowsPerPageOptions: (_rootProps$rowsPerPag = rootProps.rowsPerPageOptions) != null && _rootProps$rowsPerPag.includes(paginationState.pageSize) ? rootProps.rowsPerPageOptions : [],\n rowsPerPage: paginationState.pageSize,\n onPageChange: handlePageChange,\n onRowsPerPageChange: handlePageSizeChange\n }, apiRef.current.getLocaleText('MuiTablePagination'), props));\n});"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,eAAe,IAAIC,sBAAsB,QAAQ,+BAA+B;AACvF,SAASC,MAAM,QAAQ,sBAAsB;AAC7C,SAASC,eAAe,QAAQ,gCAAgC;AAChE,SAASC,iBAAiB,QAAQ,kCAAkC;AACpE,SAASC,gBAAgB,QAAQ,iCAAiC;AAClE,SAASC,sBAAsB,QAAQ,qDAAqD;AAC5F,SAASC,GAAG,IAAIC,IAAI,QAAQ,mBAAmB;AAC/C,MAAMC,kBAAkB,GAAGP,MAAM,CAACF,eAAe,CAAC,CAAC,CAAC;EAClDU;AACF,CAAC,MAAM;EACL,CAAC,MAAMT,sBAAsB,CAACU,WAAW,EAAE,GAAG;IAC5CC,OAAO,EAAE,MAAM;IACf,CAACF,KAAK,CAACG,WAAW,CAACC,EAAE,CAAC,IAAI,CAAC,GAAG;MAC5BF,OAAO,EAAE;IACX;EACF,CAAC;EACD,CAAC,MAAMX,sBAAsB,CAACc,KAAK,EAAE,GAAG;IACtCH,OAAO,EAAE,MAAM;IACf,CAACF,KAAK,CAACG,WAAW,CAACC,EAAE,CAAC,IAAI,CAAC,GAAG;MAC5BF,OAAO,EAAE;IACX;EACF;AACF,CAAC,CAAC,CAAC;AACH,OAAO,MAAMI,cAAc,GAAG,aAAajB,KAAK,CAACkB,UAAU,CAAC,SAASD,cAAcA,CAACE,KAAK,EAAEC,GAAG,EAAE;EAC9F,IAAIC,qBAAqB;EAEzB,MAAMC,MAA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