wcz-layout 10.0.0 → 10.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AggregatedCell-BtKC5-m6.mjs → AggregatedCell-C7nAQyMO.mjs} +15 -2
- package/dist/AggregatedCell-C7nAQyMO.mjs.map +1 -0
- package/dist/{LayoutTable-4DLs-NI-.d.mts → LayoutTable-BkrjgpW_.d.mts} +10 -4
- package/dist/{approval-DFExxyAJ.mjs → approval-BYryxFOW.mjs} +2 -2
- package/dist/{approval-DFExxyAJ.mjs.map → approval-BYryxFOW.mjs.map} +1 -1
- package/dist/auth.mjs +4 -4
- package/dist/components.d.mts +1 -1
- package/dist/components.mjs +47 -21
- package/dist/components.mjs.map +1 -1
- package/dist/{createApi-CLYWCzR2.mjs → createApi-DGJJ4I_R.mjs} +3 -3
- package/dist/{createApi-CLYWCzR2.mjs.map → createApi-DGJJ4I_R.mjs.map} +1 -1
- package/dist/data/client.d.mts +0 -36
- package/dist/data/client.mjs +4 -4
- package/dist/data/client.mjs.map +1 -1
- package/dist/data/server.mjs +4 -4
- package/dist/{file-aSQto2rw.mjs → file-C14fhUeg.mjs} +4 -4
- package/dist/{file-aSQto2rw.mjs.map → file-C14fhUeg.mjs.map} +1 -1
- package/dist/{file-CZwQfvTU.mjs → file-C5BOj1q8.mjs} +4 -4
- package/dist/{file-CZwQfvTU.mjs.map → file-C5BOj1q8.mjs.map} +1 -1
- package/dist/hooks.d.mts +1 -1
- package/dist/hooks.mjs +456 -447
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/middleware.mjs +2 -2
- package/dist/{peoplesoft-CQnc01Hc.mjs → peoplesoft-BkJMCcHb.mjs} +3 -3
- package/dist/{peoplesoft-CQnc01Hc.mjs.map → peoplesoft-BkJMCcHb.mjs.map} +1 -1
- package/dist/{providers-Dbl95AxR.mjs → providers-DrairEO2.mjs} +2 -2
- package/dist/{providers-Dbl95AxR.mjs.map → providers-DrairEO2.mjs.map} +1 -1
- package/dist/{tokens-D8CVIFTb.mjs → tokens-BLRreL1j.mjs} +3 -3
- package/dist/{tokens-D8CVIFTb.mjs.map → tokens-BLRreL1j.mjs.map} +1 -1
- package/dist/{utils-KaM5VMTJ.mjs → utils-BUpDoqme.mjs} +13 -13
- package/dist/utils-BUpDoqme.mjs.map +1 -0
- package/dist/utils.mjs +1 -1
- package/package.json +130 -128
- package/skills/general/SKILL.md +122 -125
- package/skills/migrations/versions/migrate-v9-to-v10.md +3 -2
- package/skills/services/docs/peoplesoft.md +114 -110
- package/skills/table/SKILL.md +18 -30
- package/dist/AggregatedCell-BtKC5-m6.mjs.map +0 -1
- package/dist/utils-KaM5VMTJ.mjs.map +0 -1
|
@@ -6,6 +6,7 @@ import { useContext } from "react";
|
|
|
6
6
|
import { useTranslation } from "react-i18next";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { formatForDisplay } from "@tanstack/react-hotkeys";
|
|
9
|
+
import { defaultRangeExtractor } from "@tanstack/react-virtual";
|
|
9
10
|
import { aggregationFn_count, aggregationFn_extent, aggregationFn_first, aggregationFn_last, aggregationFn_max, aggregationFn_mean, aggregationFn_median, aggregationFn_min, aggregationFn_sum, aggregationFn_unique, aggregationFn_uniqueCount, createExpandedRowModel, createFacetedMinMaxValues, createFacetedRowModel, createFacetedUniqueValues, createFilteredRowModel, createGroupedRowModel, createPaginatedRowModel, createSortedRowModel, createTableHookContexts, filterFn_arrHas, filterFn_arrIncludes, filterFn_arrIncludesAll, filterFn_arrIncludesSome, filterFn_between, filterFn_betweenInclusive, filterFn_empty, filterFn_endsWith, filterFn_equals, filterFn_equalsString, filterFn_equalsStringSensitive, filterFn_greaterThan, filterFn_greaterThanOrEqualTo, filterFn_inDateRange, filterFn_inNumberRange, filterFn_includesString, filterFn_includesStringSensitive, filterFn_lessThan, filterFn_lessThanOrEqualTo, filterFn_notEmpty, filterFn_startsWith, filterFn_weakEquals, metaHelper, sortFn_alphanumeric, sortFn_alphanumericCaseSensitive, sortFn_basic, sortFn_datetime, sortFn_text, sortFn_textCaseSensitive, stockFeatures, tableFeatures } from "@tanstack/react-table";
|
|
10
11
|
//#region src/hooks/useDialogs.tsx
|
|
11
12
|
function AlertDialog(t0) {
|
|
@@ -255,6 +256,8 @@ const columnLabel = (column) => {
|
|
|
255
256
|
};
|
|
256
257
|
const hasColumnLabel = (column) => Boolean(column.columnDef.meta?.label) || typeof column.columnDef.header === "string";
|
|
257
258
|
const columnAlign = (column) => column.columnDef.meta?.align ?? (hasColumnLabel(column) ? "left" : "center");
|
|
259
|
+
/** The column's `meta.flex`, or 0 once the user has resized it to a fixed width. */
|
|
260
|
+
const columnFlex = (column) => Object.hasOwn(column.table.atoms.columnSizing.get(), column.id) ? 0 : column.columnDef.meta?.flex ?? 0;
|
|
258
261
|
const moveColumn = (column, delta) => {
|
|
259
262
|
const { table } = column;
|
|
260
263
|
const current = table.atoms.columnOrder.get();
|
|
@@ -319,6 +322,16 @@ const toClipboardValue = (value) => {
|
|
|
319
322
|
* are separated by a blank line.
|
|
320
323
|
*/
|
|
321
324
|
const toClipboardText = (regions) => regions.map((rows) => rows.map((cells) => cells.map(toClipboardValue).join(" ")).join("\n")).join("\n\n");
|
|
325
|
+
const lookaheadRange = (range, direction, lookahead) => {
|
|
326
|
+
const behind = direction ? 0 : range.overscan;
|
|
327
|
+
const ahead = direction ? lookahead : range.overscan;
|
|
328
|
+
return defaultRangeExtractor({
|
|
329
|
+
...range,
|
|
330
|
+
startIndex: range.startIndex - (direction === "backward" ? ahead : behind),
|
|
331
|
+
endIndex: range.endIndex + (direction === "backward" ? behind : ahead),
|
|
332
|
+
overscan: 0
|
|
333
|
+
});
|
|
334
|
+
};
|
|
322
335
|
//#endregion
|
|
323
336
|
//#region src/components/table/formatValue.ts
|
|
324
337
|
const formatValue = (value, dateFormat = "L LT") => {
|
|
@@ -492,6 +505,6 @@ const AggregatedCell = (t0) => {
|
|
|
492
505
|
return t9;
|
|
493
506
|
};
|
|
494
507
|
//#endregion
|
|
495
|
-
export {
|
|
508
|
+
export { pinnedSx as _, tableContext as a, useDialogs as b, useTableContext as c, columnAlign as d, columnFlex as f, moveColumn as g, lookaheadRange as h, layoutTableFeatures as i, formatValue as l, hasColumnLabel as m, cellContext as n, useCellContext as o, columnLabel as p, headerContext as r, useHeaderContext as s, AggregatedCell as t, cellSelectionSx as u, shortcutLabel as v, toClipboardText as y };
|
|
496
509
|
|
|
497
|
-
//# sourceMappingURL=AggregatedCell-
|
|
510
|
+
//# sourceMappingURL=AggregatedCell-C7nAQyMO.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AggregatedCell-C7nAQyMO.mjs","names":["Button","Dialog","DialogActions","DialogContent","DialogTitle","useEventCallback","useContext","useTranslation","DialogsContext","ReactNode","OpenDialogOptions","onClose","result","TResult","Promise","AlertOptions","title","ConfirmOptions","cancelText","DialogProps","payload","TPayload","open","OpenAlertDialog","message","options","OpenConfirmDialog","DialogComponent","React","ComponentType","OpenDialog","Component","CloseDialog","dialog","AlertDialogPayload","AlertDialogProps","AlertDialog","t0","$","_c","$i","Symbol","for","t","t1","t2","t3","t4","t5","t6","t7","t8","ConfirmDialogPayload","ConfirmDialogProps","ConfirmDialog","t9","t10","t11","t12","DialogHook","alert","confirm","close","useDialogs","undefined","message_0","options_0","Theme","formatForDisplay","Cell","CellData","Column","RowData","Range","defaultRangeExtractor","LayoutTableFeatures","LayoutColumnMeta","shortcutLabel","label","hotkey","AnyColumn","TData","TValue","columnLabel","column","meta","columnDef","header","id","hasColumnLabel","Boolean","columnAlign","align","columnFlex","Object","hasOwn","table","atoms","columnSizing","get","flex","moveColumn","delta","current","columnOrder","order","length","getAllLeafColumns","map","from","indexOf","to","splice","setColumnOrder","pinnedSx","isHeader","pinned","getIsPinned","position","zIndex","insetInlineStart","getStart","undefined","insetInlineEnd","getAfter","bgcolor","backgroundImage","theme","palette","action","hover","selected","getIsLastColumn","borderInlineEnd","borderInlineEndStyle","borderColor","getIsFirstColumn","borderInlineStart","borderInlineStartStyle","cellSelectionSx","cell","getIsSelected","edges","getSelectionEdges","outline","top","primary","main","bottom","left","right","filter","join","boxShadow","quoteTsv","text","test","replaceAll","toClipboardValue","value","String","Date","toISOString","JSON","stringify","toClipboardText","regions","Array","rows","cells","lookaheadRange","range","direction","lookahead","behind","overscan","ahead","startIndex","endIndex","dayjs","formatValue","value","dateFormat","undefined","Date","format","toString","JSON","stringify","aggregationFn_count","aggregationFn_extent","aggregationFn_first","aggregationFn_last","aggregationFn_max","aggregationFn_mean","aggregationFn_median","aggregationFn_min","aggregationFn_sum","aggregationFn_unique","aggregationFn_uniqueCount","createExpandedRowModel","createFacetedMinMaxValues","createFacetedRowModel","createFacetedUniqueValues","createFilteredRowModel","createGroupedRowModel","createPaginatedRowModel","createSortedRowModel","createTableHookContexts","filterFn_arrHas","filterFn_arrIncludes","filterFn_arrIncludesAll","filterFn_arrIncludesSome","filterFn_between","filterFn_betweenInclusive","filterFn_empty","filterFn_endsWith","filterFn_equals","filterFn_equalsString","filterFn_equalsStringSensitive","filterFn_greaterThan","filterFn_greaterThanOrEqualTo","filterFn_inDateRange","filterFn_inNumberRange","filterFn_includesString","filterFn_includesStringSensitive","filterFn_lessThan","filterFn_lessThanOrEqualTo","filterFn_notEmpty","filterFn_startsWith","filterFn_weakEquals","metaHelper","sortFn_alphanumeric","sortFn_alphanumericCaseSensitive","sortFn_basic","sortFn_datetime","sortFn_text","sortFn_textCaseSensitive","stockFeatures","tableFeatures","LayoutColumnMeta","layoutTableFeatures","columnMeta","filteredRowModel","sortedRowModel","paginatedRowModel","expandedRowModel","groupedRowModel","facetedRowModel","facetedUniqueValues","facetedMinMaxValues","filterFns","arrHas","arrIncludes","arrIncludesAll","arrIncludesSome","between","betweenInclusive","empty","endsWith","equals","equalsString","equalsStringSensitive","greaterThan","greaterThanOrEqualTo","inDateRange","inNumberRange","includesString","includesStringSensitive","lessThan","lessThanOrEqualTo","notEmpty","startsWith","weakEquals","sortFns","alphanumeric","alphanumericCaseSensitive","basic","datetime","text","textCaseSensitive","aggregationFns","sum","min","max","extent","mean","median","unique","uniqueCount","count","first","last","LayoutTableFeatures","tableContext","cellContext","headerContext","useTableContext","useCellContext","useHeaderContext","TypographyProps","Typography","FC","formatValue","useCellContext","AggregatedCell","prefix","options","Intl","NumberFormatOptions","dateFormat","t0","$","_c","$i","Symbol","for","props","t1","undefined","cell","T0","t2","t3","t4","t5","t6","t7","t8","bb0","value","getValue","t9","entry","toLocaleString","format","Array","isArray","map","join"],"sources":["../src/hooks/useDialogs.tsx","../src/components/table/utils.ts","../src/components/table/formatValue.ts","../src/components/table/context.ts","../src/components/table/cells/formatters/AggregatedCell.tsx"],"sourcesContent":["import {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n useEventCallback,\n} from \"@mui/material\";\nimport { useContext } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { DialogsContext } from \"../contexts/DialogsContext\";\nimport type { ReactNode } from \"react\";\n\nexport interface OpenDialogOptions<TResult> {\n onClose?: (result: TResult) => Promise<void>;\n}\n\nexport interface AlertOptions {\n title?: ReactNode;\n}\n\nexport interface ConfirmOptions {\n title?: ReactNode;\n cancelText?: ReactNode;\n}\n\nexport interface DialogProps<TPayload = undefined, TResult = void> {\n payload: TPayload;\n open: boolean;\n onClose: (result: TResult) => Promise<void>;\n}\n\nexport type OpenAlertDialog = (message: ReactNode, options?: AlertOptions) => Promise<void>;\n\nexport type OpenConfirmDialog = (message: ReactNode, options?: ConfirmOptions) => Promise<boolean>;\n\nexport type DialogComponent<TPayload, TResult> = React.ComponentType<\n DialogProps<TPayload, TResult>\n>;\n\nexport interface OpenDialog {\n <TPayload extends undefined, TResult>(\n Component: DialogComponent<TPayload, TResult>,\n payload?: TPayload,\n options?: OpenDialogOptions<TResult>,\n ): Promise<TResult>;\n <TPayload, TResult>(\n Component: DialogComponent<TPayload, TResult>,\n payload: TPayload,\n options?: OpenDialogOptions<TResult>,\n ): Promise<TResult>;\n}\n\nexport type CloseDialog = <TResult>(dialog: Promise<TResult>, result: TResult) => Promise<TResult>;\n\nexport interface AlertDialogPayload extends AlertOptions {\n message: ReactNode;\n}\n\nexport type AlertDialogProps = DialogProps<AlertDialogPayload, void>;\n\nexport function AlertDialog({ open, payload, onClose }: Readonly<AlertDialogProps>) {\n const { t } = useTranslation();\n\n return (\n <Dialog maxWidth=\"xs\" fullWidth open={open} onClose={() => onClose()} disableRestoreFocus>\n <DialogTitle>{payload.title ?? t(\"Layout.Dialog.Alert\")}</DialogTitle>\n <DialogContent>{payload.message}</DialogContent>\n <DialogActions>\n <Button onClick={() => onClose()} autoFocus>\n {t(\"Layout.Dialog.Confirm\")}\n </Button>\n </DialogActions>\n </Dialog>\n );\n}\n\nexport interface ConfirmDialogPayload extends ConfirmOptions {\n message: ReactNode;\n}\n\nexport type ConfirmDialogProps = DialogProps<ConfirmDialogPayload, boolean>;\n\nexport function ConfirmDialog({ open, payload, onClose }: Readonly<ConfirmDialogProps>) {\n const { t } = useTranslation();\n\n return (\n <Dialog maxWidth=\"xs\" fullWidth open={open} onClose={() => onClose(false)} disableRestoreFocus>\n <DialogTitle>{payload.title ?? t(\"Layout.Dialog.Confirm\")}</DialogTitle>\n <DialogContent>{payload.message}</DialogContent>\n <DialogActions>\n <Button onClick={() => onClose(false)}>\n {payload.cancelText ?? t(\"Layout.Dialog.Cancel\")}\n </Button>\n <Button onClick={() => onClose(true)} autoFocus>\n {t(\"Layout.Dialog.Confirm\")}\n </Button>\n </DialogActions>\n </Dialog>\n );\n}\n\ninterface DialogHook {\n alert: OpenAlertDialog;\n confirm: OpenConfirmDialog;\n open: OpenDialog;\n close: CloseDialog;\n}\n\nexport function useDialogs(): DialogHook {\n const { open, close } = useContext(DialogsContext);\n\n const alert = useEventCallback<OpenAlertDialog>((message, { ...options } = {}) =>\n open(AlertDialog, { ...options, message }),\n );\n\n const confirm = useEventCallback<OpenConfirmDialog>((message, { ...options } = {}) =>\n open(ConfirmDialog, { ...options, message }),\n );\n\n return { alert, confirm, open, close };\n}\n","import type { Theme } from \"@mui/material\";\r\nimport { formatForDisplay } from \"@tanstack/react-hotkeys\";\r\nimport type { Cell, CellData, Column, RowData } from \"@tanstack/react-table\";\r\nimport type { Range } from \"@tanstack/react-virtual\";\r\nimport { defaultRangeExtractor } from \"@tanstack/react-virtual\";\r\nimport type { LayoutTableFeatures } from \"~/components/table/context\";\r\nimport type { LayoutColumnMeta } from \"./types\";\r\n\r\nexport const shortcutLabel = (label: string, hotkey: string): string =>\r\n `${label} (${formatForDisplay(hotkey)})`;\r\n\r\ntype AnyColumn<TData extends RowData, TValue extends CellData> = Column<\r\n LayoutTableFeatures,\r\n TData,\r\n TValue\r\n>;\r\n\r\nexport const columnLabel = <TData extends RowData, TValue extends CellData>(\r\n column: AnyColumn<TData, TValue>,\r\n): string => {\r\n const meta = column.columnDef.meta as LayoutColumnMeta | undefined;\r\n if (meta?.label) return meta.label;\r\n\r\n return typeof column.columnDef.header === \"string\" ? column.columnDef.header : column.id;\r\n};\r\n\r\nexport const hasColumnLabel = <TData extends RowData, TValue extends CellData>(\r\n column: AnyColumn<TData, TValue>,\r\n): boolean =>\r\n Boolean((column.columnDef.meta as LayoutColumnMeta | undefined)?.label) ||\r\n typeof column.columnDef.header === \"string\";\r\n\r\nexport const columnAlign = <TData extends RowData, TValue extends CellData>(\r\n column: AnyColumn<TData, TValue>,\r\n): \"left\" | \"center\" | \"right\" =>\r\n (column.columnDef.meta as LayoutColumnMeta | undefined)?.align ??\r\n (hasColumnLabel(column) ? \"left\" : \"center\");\r\n\r\n/** The column's `meta.flex`, or 0 once the user has resized it to a fixed width. */\r\nexport const columnFlex = <TData extends RowData, TValue extends CellData>(\r\n column: AnyColumn<TData, TValue>,\r\n): number =>\r\n Object.hasOwn(column.table.atoms.columnSizing.get(), column.id)\r\n ? 0\r\n : ((column.columnDef.meta as LayoutColumnMeta | undefined)?.flex ?? 0);\r\n\r\nexport const moveColumn = <TData extends RowData, TValue extends CellData>(\r\n column: AnyColumn<TData, TValue>,\r\n delta: number,\r\n): void => {\r\n const { table } = column;\r\n const current = table.atoms.columnOrder.get();\r\n const order = current.length ? [...current] : table.getAllLeafColumns().map(({ id }) => id);\r\n const from = order.indexOf(column.id);\r\n const to = from + delta;\r\n if (from < 0 || to < 0 || to >= order.length) return;\r\n\r\n order.splice(to, 0, ...order.splice(from, 1));\r\n table.setColumnOrder(order);\r\n};\r\n\r\nexport const pinnedSx = <TData extends RowData, TValue extends CellData>(\r\n column: AnyColumn<TData, TValue>,\r\n isHeader = false,\r\n) => {\r\n const pinned = column.getIsPinned();\r\n if (!pinned) return {};\r\n\r\n return {\r\n position: \"sticky\",\r\n zIndex: isHeader ? 4 : 2,\r\n insetInlineStart: pinned === \"start\" ? column.getStart(\"start\") : undefined,\r\n insetInlineEnd: pinned === \"end\" ? column.getAfter(\"end\") : undefined,\r\n bgcolor: \"background.paper\",\r\n ...(!isHeader && {\r\n \".MuiTableRow-root:hover > &\": {\r\n backgroundImage: (theme: Theme) =>\r\n `linear-gradient(${theme.palette.action.hover}, ${theme.palette.action.hover})`,\r\n },\r\n \".MuiTableRow-root.Mui-selected > &\": {\r\n backgroundImage: (theme: Theme) =>\r\n `linear-gradient(${theme.palette.action.selected}, ${theme.palette.action.selected})`,\r\n },\r\n }),\r\n ...(pinned === \"start\" &&\r\n column.getIsLastColumn(\"start\") && {\r\n borderInlineEnd: 1,\r\n borderInlineEndStyle: \"solid\",\r\n borderColor: \"divider\",\r\n }),\r\n ...(pinned === \"end\" &&\r\n column.getIsFirstColumn(\"end\") && {\r\n borderInlineStart: 1,\r\n borderInlineStartStyle: \"solid\",\r\n borderColor: \"divider\",\r\n }),\r\n };\r\n};\r\n\r\nexport const cellSelectionSx = <TData extends RowData, TValue extends CellData>(\r\n cell: Cell<LayoutTableFeatures, TData, TValue>,\r\n) => {\r\n if (!cell.getIsSelected()) return {};\r\n\r\n const edges = cell.getSelectionEdges();\r\n const outline = (theme: Theme) =>\r\n [\r\n edges.top && `inset 0 2px 0 0 ${theme.palette.primary.main}`,\r\n edges.bottom && `inset 0 -2px 0 0 ${theme.palette.primary.main}`,\r\n edges.left && `inset 2px 0 0 0 ${theme.palette.primary.main}`,\r\n edges.right && `inset -2px 0 0 0 ${theme.palette.primary.main}`,\r\n ]\r\n .filter(Boolean)\r\n .join(\", \") || \"none\";\r\n\r\n return {\r\n backgroundImage: (theme: Theme) =>\r\n `linear-gradient(${theme.palette.action.selected}, ${theme.palette.action.selected})`,\r\n boxShadow: outline,\r\n };\r\n};\r\n\r\n/** Spreadsheet TSV quoting, so a cell holding a tab or a newline stays one cell. */\r\nconst quoteTsv = (text: string): string =>\r\n /[\"\\t\\n\\r]/.test(text) ? `\"${text.replaceAll('\"', '\"\"')}\"` : text;\r\n\r\nconst toClipboardValue = (value: unknown): string => {\r\n if (value == null) return \"\";\r\n if (typeof value === \"string\") return quoteTsv(value);\r\n if (typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"bigint\")\r\n return quoteTsv(String(value));\r\n if (value instanceof Date) return quoteTsv(value.toISOString());\r\n\r\n // Everything else — objects, and the odd symbol or function — as JSON or blank.\r\n return quoteTsv(JSON.stringify(value) ?? \"\");\r\n};\r\n\r\n/**\r\n * Serializes `table.getSelectedCellRangesData()` as TSV, which is what Excel,\r\n * Google Sheets and LibreOffice all paste as a grid. Disjoint selection regions\r\n * are separated by a blank line.\r\n */\r\nexport const toClipboardText = (regions: Array<Array<Array<unknown>>>): string =>\r\n regions\r\n .map((rows) => rows.map((cells) => cells.map(toClipboardValue).join(\"\\t\")).join(\"\\n\"))\r\n .join(\"\\n\\n\");\r\n\r\nexport const lookaheadRange = (\r\n range: Range,\r\n direction: \"forward\" | \"backward\" | null,\r\n lookahead: number,\r\n): Array<number> => {\r\n const behind = direction ? 0 : range.overscan;\r\n const ahead = direction ? lookahead : range.overscan;\r\n\r\n return defaultRangeExtractor({\r\n ...range,\r\n startIndex: range.startIndex - (direction === \"backward\" ? ahead : behind),\r\n endIndex: range.endIndex + (direction === \"backward\" ? behind : ahead),\r\n overscan: 0,\r\n });\r\n};\r\n","import dayjs from \"dayjs\";\n\nexport const formatValue = (value: unknown, dateFormat = \"L LT\"): string => {\n if (value === null || value === undefined) return \"\";\n if (value instanceof Date) return dayjs(value).format(dateFormat);\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"bigint\") {\n return value.toString();\n }\n\n return JSON.stringify(value) ?? \"\";\n};\n","import {\n aggregationFn_count,\n aggregationFn_extent,\n aggregationFn_first,\n aggregationFn_last,\n aggregationFn_max,\n aggregationFn_mean,\n aggregationFn_median,\n aggregationFn_min,\n aggregationFn_sum,\n aggregationFn_unique,\n aggregationFn_uniqueCount,\n createExpandedRowModel,\n createFacetedMinMaxValues,\n createFacetedRowModel,\n createFacetedUniqueValues,\n createFilteredRowModel,\n createGroupedRowModel,\n createPaginatedRowModel,\n createSortedRowModel,\n createTableHookContexts,\n filterFn_arrHas,\n filterFn_arrIncludes,\n filterFn_arrIncludesAll,\n filterFn_arrIncludesSome,\n filterFn_between,\n filterFn_betweenInclusive,\n filterFn_empty,\n filterFn_endsWith,\n filterFn_equals,\n filterFn_equalsString,\n filterFn_equalsStringSensitive,\n filterFn_greaterThan,\n filterFn_greaterThanOrEqualTo,\n filterFn_inDateRange,\n filterFn_inNumberRange,\n filterFn_includesString,\n filterFn_includesStringSensitive,\n filterFn_lessThan,\n filterFn_lessThanOrEqualTo,\n filterFn_notEmpty,\n filterFn_startsWith,\n filterFn_weakEquals,\n metaHelper,\n sortFn_alphanumeric,\n sortFn_alphanumericCaseSensitive,\n sortFn_basic,\n sortFn_datetime,\n sortFn_text,\n sortFn_textCaseSensitive,\n stockFeatures,\n tableFeatures,\n} from \"@tanstack/react-table\";\nimport type { LayoutColumnMeta } from \"~/components/table/types\";\n\nexport const layoutTableFeatures = tableFeatures({\n ...stockFeatures,\n columnMeta: metaHelper<LayoutColumnMeta>(),\n filteredRowModel: createFilteredRowModel(),\n sortedRowModel: createSortedRowModel(),\n paginatedRowModel: createPaginatedRowModel(),\n expandedRowModel: createExpandedRowModel(),\n groupedRowModel: createGroupedRowModel(),\n facetedRowModel: createFacetedRowModel(),\n facetedUniqueValues: createFacetedUniqueValues(),\n facetedMinMaxValues: createFacetedMinMaxValues(),\n filterFns: {\n arrHas: filterFn_arrHas,\n arrIncludes: filterFn_arrIncludes,\n arrIncludesAll: filterFn_arrIncludesAll,\n arrIncludesSome: filterFn_arrIncludesSome,\n between: filterFn_between,\n betweenInclusive: filterFn_betweenInclusive,\n empty: filterFn_empty,\n endsWith: filterFn_endsWith,\n equals: filterFn_equals,\n equalsString: filterFn_equalsString,\n equalsStringSensitive: filterFn_equalsStringSensitive,\n greaterThan: filterFn_greaterThan,\n greaterThanOrEqualTo: filterFn_greaterThanOrEqualTo,\n inDateRange: filterFn_inDateRange,\n inNumberRange: filterFn_inNumberRange,\n includesString: filterFn_includesString,\n includesStringSensitive: filterFn_includesStringSensitive,\n lessThan: filterFn_lessThan,\n lessThanOrEqualTo: filterFn_lessThanOrEqualTo,\n notEmpty: filterFn_notEmpty,\n startsWith: filterFn_startsWith,\n weakEquals: filterFn_weakEquals,\n },\n sortFns: {\n alphanumeric: sortFn_alphanumeric,\n alphanumericCaseSensitive: sortFn_alphanumericCaseSensitive,\n basic: sortFn_basic,\n datetime: sortFn_datetime,\n text: sortFn_text,\n textCaseSensitive: sortFn_textCaseSensitive,\n },\n aggregationFns: {\n sum: aggregationFn_sum,\n min: aggregationFn_min,\n max: aggregationFn_max,\n extent: aggregationFn_extent,\n mean: aggregationFn_mean,\n median: aggregationFn_median,\n unique: aggregationFn_unique,\n uniqueCount: aggregationFn_uniqueCount,\n count: aggregationFn_count,\n first: aggregationFn_first,\n last: aggregationFn_last,\n },\n});\n\nexport type LayoutTableFeatures = typeof layoutTableFeatures;\n\nexport const {\n tableContext,\n cellContext,\n headerContext,\n useTableContext,\n useCellContext,\n useHeaderContext,\n} = createTableHookContexts<LayoutTableFeatures>();\n","import type { TypographyProps } from \"@mui/material\";\nimport { Typography } from \"@mui/material\";\nimport type { FC } from \"react\";\nimport { formatValue } from \"~/components/table/formatValue\";\nimport { useCellContext } from \"~/components/table/context\";\n\nexport const AggregatedCell: FC<\n TypographyProps & {\n prefix?: string;\n options?: Intl.NumberFormatOptions;\n dateFormat?: string;\n }\n> = ({ prefix = \"\", options, dateFormat, ...props }) => {\n const cell = useCellContext();\n const value = cell.getValue();\n if (value === null || value === undefined || value === \"\") return null;\n\n const format = (entry: unknown) =>\n typeof entry === \"number\"\n ? entry.toLocaleString(undefined, options)\n : formatValue(entry, dateFormat);\n\n return (\n <Typography variant=\"body2\" color=\"text.secondary\" noWrap {...props}>\n {prefix}\n {/* `extent` — the default aggregate for anything non-numeric — is a [min, max] pair. */}\n {Array.isArray(value) ? value.map(format).join(\" – \") : format(value)}\n </Typography>\n );\n};\n"],"mappings":";;;;;;;;;;;AA6DA,SAAOoC,YAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAD,EAAA,OAAA,oEAAA;EAAA,KAAA,IAAAE,KAAA,GAAAA,KAAA,IAAAA,MAAA,GAAAF,EAAAE,MAAAC,OAAAC,IAAA,2BAAA;EAAAJ,EAAA,KAAA;CAAA;CAAqB,MAAA,EAAAhB,MAAAF,SAAAT,YAAA0B;CAC1B,MAAA,EAAAM,MAAcpC,eAAe;CAAE,IAAAqC;CAAA,IAAAN,EAAA,OAAA3B,SAAA;EAGwBiC,WAAMjC,QAAQ;EAAC2B,EAAA,KAAA3B;EAAA2B,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAA,IAAAO;CAAA,IAAAP,EAAA,OAAAlB,QAAAJ,SAAAsB,EAAA,OAAAK,GAAA;EACpDE,KAAAzB,QAAOJ,SAAU2B,EAAE,qBAAqB;EAACL,EAAA,KAAAlB,QAAAJ;EAAAsB,EAAA,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AA,IAAApB,EAAA,QAAAS,MAAAT,EAAA,QAAAU,MAAAV,EAAA,QAAAW,MAAAX,EAAA,QAAAY,MAAAZ,EAAA,QAAAa,MAAAb,EAAA,QAAAc,MAAAd,EAAA,QAAAe,IAAA;EAHvEK,KAAA,qBAAC,IAAD;GAAoB,SAAAV;GAAc,OAAAC;GAAiB,QAAAC;GAAM,GAAKP;GAA9D,UAAA,CACGX,IAEAqB,EAHQ;;EAIEf,EAAA,MAAAS;EAAAT,EAAA,MAAAU;EAAAV,EAAA,MAAAW;EAAAX,EAAA,MAAAY;EAAAZ,EAAA,MAAAa;EAAAb,EAAA,MAAAc;EAAAd,EAAA,MAAAe;EAAAf,EAAA,MAAAoB;CAAA,OAAAA,KAAApB,EAAA;CAAA,OAJboB;AAIa"}
|
|
@@ -11,6 +11,7 @@ type FilterOperator = "includesString" | "notIncludesString" | "equalsString" |
|
|
|
11
11
|
type LayoutColumnMeta = {
|
|
12
12
|
label?: string;
|
|
13
13
|
align?: "left" | "center" | "right";
|
|
14
|
+
flex?: number;
|
|
14
15
|
variant?: TableFilterVariant;
|
|
15
16
|
options?: Array<TableFilterOption>;
|
|
16
17
|
};
|
|
@@ -311,11 +312,16 @@ declare const tableContext: import("react").Context<import("@tanstack/react-tabl
|
|
|
311
312
|
//#region src/components/table/cells/features/ActionsCell.d.ts
|
|
312
313
|
type RowAction<TData = any> = {
|
|
313
314
|
label: string;
|
|
314
|
-
icon?: ReactElement;
|
|
315
315
|
onClick: (row: TData) => void;
|
|
316
|
-
divider?: boolean;
|
|
317
316
|
disabled?: boolean;
|
|
318
|
-
|
|
317
|
+
divider?: boolean;
|
|
318
|
+
} & ({
|
|
319
|
+
showInMenu?: false;
|
|
320
|
+
icon: ReactElement;
|
|
321
|
+
} | {
|
|
322
|
+
showInMenu: true;
|
|
323
|
+
icon?: ReactElement;
|
|
324
|
+
});
|
|
319
325
|
//#endregion
|
|
320
326
|
//#region src/components/table/table/Pagination.d.ts
|
|
321
327
|
type PaginationProps = Omit<TablePaginationProps, "count" | "page" | "rowsPerPage" | "onPageChange" | "onRowsPerPageChange" | "rowsPerPageOptions"> & {
|
|
@@ -749,4 +755,4 @@ type LayoutTableProps<TData extends RowData> = TableToolbarProps & {
|
|
|
749
755
|
declare function LayoutTable<TData extends RowData>({ table, loading, pagination, pageSizeOptions, showToolbar, disableColumnMenu, onRowClick, onRowDoubleClick, sx, ...toolbar }: LayoutTableProps<TData>): import("react").JSX.Element;
|
|
750
756
|
//#endregion
|
|
751
757
|
export { AggregatedCell as a, layoutTableFeatures as c, useTableContext as d, FilterOperator as f, TableFilterVariant as h, useLayoutTable as i, useCellContext as l, TableFilterOption as m, LayoutTableProps as n, RowAction as o, LayoutColumnMeta as p, createLayoutColumnHelper as r, LayoutTableFeatures as s, LayoutTable as t, useHeaderContext as u };
|
|
752
|
-
//# sourceMappingURL=LayoutTable-
|
|
758
|
+
//# sourceMappingURL=LayoutTable-BkrjgpW_.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createApi } from "./createApi-
|
|
1
|
+
import { t as createApi } from "./createApi-DGJJ4I_R.mjs";
|
|
2
2
|
import { a as ResubmitApprovalSchema, c as ApprovalStatus, i as CreateApprovalSchema, n as ApproveApprovalSchema, o as WithdrawApprovalSchema, r as CancelApprovalSchema, u as ApprovalStepResult } from "./Approval-C-hF4jbT.mjs";
|
|
3
3
|
import { z as z$1 } from "zod";
|
|
4
4
|
import { createServerOnlyFn } from "@tanstack/react-start";
|
|
@@ -81,4 +81,4 @@ const cancelApproval = createServerOnlyFn(async ({ data }) => {
|
|
|
81
81
|
//#endregion
|
|
82
82
|
export { createApproval as a, resubmitApproval as c, cancelApproval as i, withdrawApproval as l, GetApprovalsSchema as n, getApproval as o, approveApproval as r, getApprovals as s, GetApprovalSchema as t };
|
|
83
83
|
|
|
84
|
-
//# sourceMappingURL=approval-
|
|
84
|
+
//# sourceMappingURL=approval-BYryxFOW.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approval-
|
|
1
|
+
{"version":3,"file":"approval-BYryxFOW.mjs","names":["createServerOnlyFn","z","createApi","ApproveApprovalSchema","CancelApprovalSchema","CreateApprovalSchema","ResubmitApprovalSchema","WithdrawApprovalSchema","Approval","ApprovalStatus","ApprovalStepResult","GetApprovalsSchema","object","appName","string","min","max","status","optional","approverEmployeeId","stepResult","GetApprovalSchema","id","uuid","approvalApi","baseURL","scopeKey","getApprovals","data","input","Promise","Array","parse","queryParams","URLSearchParams","append","toString","api","approvals","request","url","method","getApproval","approval","createApproval","approveApproval","resubmitApproval","withdrawApproval","cancelApproval"],"sources":["../src/data/server/approval.ts"],"sourcesContent":["import { createServerOnlyFn } from \"@tanstack/react-start\";\nimport { z } from \"zod\";\nimport { createApi } from \"~/lib/createApi\";\nimport {\n ApproveApprovalSchema,\n CancelApprovalSchema,\n CreateApprovalSchema,\n ResubmitApprovalSchema,\n WithdrawApprovalSchema,\n} from \"~/models/approval/Approval\";\nimport type { Approval } from \"~/models/approval/Approval\";\nimport { ApprovalStatus } from \"~/models/approval/ApprovalStatus\";\nimport { ApprovalStepResult } from \"~/models/approval/ApprovalStepResult\";\n\nexport const GetApprovalsSchema = z.object({\n appName: z.string().min(1).max(255),\n status: ApprovalStatus.optional(),\n approverEmployeeId: z.string().min(1).max(20).optional(),\n stepResult: ApprovalStepResult.optional(),\n});\n\nexport const GetApprovalSchema = z.object({\n id: z.uuid(),\n});\n\nconst approvalApi = () => createApi({ baseURL: \"APPROVAL_BASE_URL\", scopeKey: \"approval\" });\n\nexport const getApprovals = createServerOnlyFn(\n async ({ data }: { data: z.input<typeof GetApprovalsSchema> }): Promise<Array<Approval>> => {\n const input = GetApprovalsSchema.parse(data);\n const queryParams = new URLSearchParams();\n queryParams.append(\"applicationName\", input.appName);\n if (input.status) queryParams.append(\"status\", input.status.toString());\n if (input.approverEmployeeId)\n queryParams.append(\"approverEmployeeId\", input.approverEmployeeId);\n if (input.stepResult) queryParams.append(\"stepResult\", input.stepResult.toString());\n\n const api = await approvalApi();\n const { data: approvals } = await api.request<Array<Approval>>({\n url: `/Requests/Requests?${queryParams.toString()}`,\n method: \"GET\",\n });\n return approvals;\n },\n);\n\nexport const getApproval = createServerOnlyFn(\n async ({ data }: { data: z.input<typeof GetApprovalSchema> }): Promise<Approval> => {\n const input = GetApprovalSchema.parse(data);\n const api = await approvalApi();\n const { data: approval } = await api.request<Approval>({\n url: `/Requests/${input.id}`,\n method: \"GET\",\n });\n return approval;\n },\n);\n\nexport const createApproval = createServerOnlyFn(\n async ({ data }: { data: z.input<typeof CreateApprovalSchema> }): Promise<Approval> => {\n const input = CreateApprovalSchema.parse(data);\n const api = await approvalApi();\n const { data: approval } = await api.request<Approval>({\n url: `/Requests`,\n method: \"POST\",\n data: input,\n });\n return approval;\n },\n);\n\nexport const approveApproval = createServerOnlyFn(\n async ({ data }: { data: z.input<typeof ApproveApprovalSchema> }): Promise<Approval> => {\n const input = ApproveApprovalSchema.parse(data);\n const api = await approvalApi();\n const { data: approval } = await api.request<Approval>({\n url: `/Requests/${input.id}/single-approval`,\n method: \"POST\",\n data: input,\n });\n return approval;\n },\n);\n\nexport const resubmitApproval = createServerOnlyFn(\n async ({ data }: { data: z.input<typeof ResubmitApprovalSchema> }): Promise<Approval> => {\n const input = ResubmitApprovalSchema.parse(data);\n const api = await approvalApi();\n const { data: approval } = await api.request<Approval>({\n url: `/Requests/${input.id}/resubmit`,\n method: \"POST\",\n data: input,\n });\n return approval;\n },\n);\n\nexport const withdrawApproval = createServerOnlyFn(\n async ({ data }: { data: z.input<typeof WithdrawApprovalSchema> }): Promise<void> => {\n const input = WithdrawApprovalSchema.parse(data);\n const api = await approvalApi();\n await api.request<void>({\n url: `/Requests/${input.id}/withdraw`,\n method: \"POST\",\n data: input,\n });\n },\n);\n\nexport const cancelApproval = createServerOnlyFn(\n async ({ data }: { data: z.input<typeof CancelApprovalSchema> }): Promise<void> => {\n const input = CancelApprovalSchema.parse(data);\n const api = await appro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,EAAA,CACpBe,QAAc;EACtBC,KAAK,aAAaX,MAAMP,GAAE;EAC1BmB,QAAQ;EACRb,MAAMC;CACR,CAAC;AACH,CACF"}
|
package/dist/auth.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as providers, t as getProvider } from "./providers-
|
|
2
|
-
import { d as sanitizeReturnTo, g as getAppSession, i as buildUser } from "./utils-
|
|
3
|
-
import { a as createState, i as createPkce, n as getAppToken, o as exchangeCode, r as buildAuthUrl, t as getAccessToken } from "./tokens-
|
|
1
|
+
import { r as providers, t as getProvider } from "./providers-DrairEO2.mjs";
|
|
2
|
+
import { d as sanitizeReturnTo, g as getAppSession, i as buildUser } from "./utils-BUpDoqme.mjs";
|
|
3
|
+
import { a as createState, i as createPkce, n as getAppToken, o as exchangeCode, r as buildAuthUrl, t as getAccessToken } from "./tokens-BLRreL1j.mjs";
|
|
4
4
|
import * as jose from "jose";
|
|
5
5
|
//#region src/lib/auth/authHandlers.ts
|
|
6
6
|
/**
|
|
@@ -73,7 +73,7 @@ async function handleCallback() {
|
|
|
73
73
|
const claims = jose.decodeJwt(result.id_token);
|
|
74
74
|
const user = buildUser(claims, providerId);
|
|
75
75
|
if (providerId === "aws" && user.employeeId) {
|
|
76
|
-
const { getEmployeeByEmployeeId } = await import("./peoplesoft-
|
|
76
|
+
const { getEmployeeByEmployeeId } = await import("./peoplesoft-BkJMCcHb.mjs").then((n) => n.v);
|
|
77
77
|
const employee = await getEmployeeByEmployeeId({ data: { employeeId: user.employeeId } });
|
|
78
78
|
user.name = employee.nameTitleCase;
|
|
79
79
|
user.department = employee.departmentId.toUpperCase();
|
package/dist/components.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as FileMeta } from "./FileMeta-Be9viU7D.mjs";
|
|
2
|
-
import { a as AggregatedCell, f as FilterOperator, h as TableFilterVariant, m as TableFilterOption, n as LayoutTableProps, o as RowAction, p as LayoutColumnMeta, t as LayoutTable } from "./LayoutTable-
|
|
2
|
+
import { a as AggregatedCell, f as FilterOperator, h as TableFilterVariant, m as TableFilterOption, n as LayoutTableProps, o as RowAction, p as LayoutColumnMeta, t as LayoutTable } from "./LayoutTable-BkrjgpW_.mjs";
|
|
3
3
|
import { BoxProps, ButtonProps, FabProps, IconButtonProps, LinkProps, ListItemButtonProps, SxProps, TabProps, Theme } from "@mui/material";
|
|
4
4
|
import React$1, { ComponentType, FC, ReactNode } from "react";
|
|
5
5
|
import * as z$2 from "zod";
|
package/dist/components.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { d as sanitizeReturnTo, m as loginProvidersQueryOptions } from "./utils-
|
|
1
|
+
import { d as sanitizeReturnTo, m as loginProvidersQueryOptions } from "./utils-BUpDoqme.mjs";
|
|
2
2
|
import { n as RouterIconButton, t as RouterListItemButton } from "./RouterListItemButton-ULMlaQh6.mjs";
|
|
3
|
-
import { a as fileQueryOptions, i as fileMetasQueryOptions, n as deleteFileMutationOptions, o as fileThumbnailQueryOptions, r as downloadFileMutationOptions, s as openFileMutationOptions } from "./file-
|
|
4
|
-
import { _ as
|
|
3
|
+
import { a as fileQueryOptions, i as fileMetasQueryOptions, n as deleteFileMutationOptions, o as fileThumbnailQueryOptions, r as downloadFileMutationOptions, s as openFileMutationOptions } from "./file-C14fhUeg.mjs";
|
|
4
|
+
import { _ as pinnedSx, b as useDialogs, d as columnAlign, f as columnFlex, h as lookaheadRange, m as hasColumnLabel, t as AggregatedCell, u as cellSelectionSx, y as toClipboardText } from "./AggregatedCell-C7nAQyMO.mjs";
|
|
5
5
|
import { c } from "react/compiler-runtime";
|
|
6
6
|
import { Box, Button, Card, CardContent, CircularProgress, Dialog, Divider, Fab, IconButton, ImageListItem, ImageListItemBar, Link, List, ListItemButton, ListItemIcon, ListItemText, Menu, Paper, Skeleton, Stack, Tab, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TableRow, Tooltip, Typography, alpha, useTheme } from "@mui/material";
|
|
7
7
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
8
|
-
import React, { Fragment, createContext, useContext, useEffect, useEffectEvent, useLayoutEffect, useRef, useState } from "react";
|
|
8
|
+
import React, { Fragment, createContext, useContext, useEffect, useEffectEvent, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
10
10
|
import { manifest } from "virtual:wcz-layout";
|
|
11
11
|
import { createLink, rootRouteId, useLocation, useMatch } from "@tanstack/react-router";
|
|
@@ -1362,6 +1362,7 @@ const ROW_HEIGHT = 52;
|
|
|
1362
1362
|
const COLUMN_HEADER_HEIGHT = 56;
|
|
1363
1363
|
/** Rows and columns kept mounted past the viewport edge so scrolling never shows a gap. */
|
|
1364
1364
|
const ROW_OVERSCAN = 6;
|
|
1365
|
+
const ROW_LOOKAHEAD = 15;
|
|
1365
1366
|
const COLUMN_OVERSCAN = 3;
|
|
1366
1367
|
const JUSTIFY = {
|
|
1367
1368
|
left: "flex-start",
|
|
@@ -1423,6 +1424,21 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
|
|
|
1423
1424
|
const centerColumns = table.getCenterVisibleLeafColumns();
|
|
1424
1425
|
const startPinnedWidth = pinnedWidth(startColumns);
|
|
1425
1426
|
const endPinnedWidth = pinnedWidth(endColumns);
|
|
1427
|
+
const [containerWidth, setContainerWidth] = useState(0);
|
|
1428
|
+
useLayoutEffect(() => {
|
|
1429
|
+
const container = containerRef.current;
|
|
1430
|
+
if (!container) return;
|
|
1431
|
+
const measure = () => setContainerWidth(container.clientWidth);
|
|
1432
|
+
measure();
|
|
1433
|
+
const observer = new ResizeObserver(measure);
|
|
1434
|
+
observer.observe(container);
|
|
1435
|
+
return () => observer.disconnect();
|
|
1436
|
+
}, []);
|
|
1437
|
+
const flexColumns = table.getVisibleLeafColumns().filter((column_0) => columnFlex(column_0) > 0);
|
|
1438
|
+
const totalFlex = flexColumns.reduce((total, column_1) => total + columnFlex(column_1), 0);
|
|
1439
|
+
const flexSpace = Math.max(containerWidth - table.getTotalSize(), 0);
|
|
1440
|
+
const flexWidths = new Map(flexColumns.map((column_2) => [column_2.id, Math.floor(flexSpace * columnFlex(column_2) / totalFlex)]));
|
|
1441
|
+
const headerWidth = (header) => header.column.getLeafColumns().reduce((width, column_3) => width + (flexWidths.get(column_3.id) ?? 0), header.getSize());
|
|
1426
1442
|
const virtualizeColumns = headerGroups.length === 1 && !loading;
|
|
1427
1443
|
const rowVirtualizer = useVirtualizer({
|
|
1428
1444
|
count: rows.length,
|
|
@@ -1430,6 +1446,7 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
|
|
|
1430
1446
|
estimateSize: () => ROW_HEIGHT,
|
|
1431
1447
|
getItemKey: (index) => rows[index].id,
|
|
1432
1448
|
overscan: ROW_OVERSCAN,
|
|
1449
|
+
rangeExtractor: (range) => lookaheadRange(range, rowVirtualizer.scrollDirection, ROW_LOOKAHEAD),
|
|
1433
1450
|
scrollMargin: headerHeight,
|
|
1434
1451
|
scrollPaddingStart: headerHeight
|
|
1435
1452
|
});
|
|
@@ -1461,7 +1478,7 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
|
|
|
1461
1478
|
}
|
|
1462
1479
|
const rowIndex = rows.findIndex((row_0) => row_0.id === focusedRowId);
|
|
1463
1480
|
if (rowIndex >= 0) rowVirtualizer.scrollToIndex(rowIndex);
|
|
1464
|
-
const columnIndex = centerColumns.findIndex((
|
|
1481
|
+
const columnIndex = centerColumns.findIndex((column_4) => column_4.id === focusedColumnId);
|
|
1465
1482
|
if (columnIndex >= 0) columnVirtualizer.scrollToIndex(columnIndex);
|
|
1466
1483
|
}, [focusedRowId, focusedColumnId]);
|
|
1467
1484
|
const hasCellSelection = table.state.cellSelection.length > 0;
|
|
@@ -1542,32 +1559,32 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
|
|
|
1542
1559
|
end: []
|
|
1543
1560
|
};
|
|
1544
1561
|
/** Absorbs the width of the columns the centre window skipped. */
|
|
1545
|
-
const skippedColumns = (
|
|
1562
|
+
const skippedColumns = (width_0) => width_0 > 0 ? /* @__PURE__ */ jsx(TableCell, {
|
|
1546
1563
|
"aria-hidden": true,
|
|
1547
|
-
style: { width },
|
|
1564
|
+
style: { width: width_0 },
|
|
1548
1565
|
sx: { p: 0 }
|
|
1549
1566
|
}) : null;
|
|
1550
1567
|
const renderHeader = (h, groupIndex) => /* @__PURE__ */ jsx(table.AppHeader, {
|
|
1551
1568
|
header: h,
|
|
1552
|
-
children: (
|
|
1553
|
-
const align = columnAlign(
|
|
1554
|
-
const labelled = hasColumnLabel(
|
|
1569
|
+
children: (header_0) => {
|
|
1570
|
+
const align = columnAlign(header_0.column);
|
|
1571
|
+
const labelled = hasColumnLabel(header_0.column);
|
|
1555
1572
|
return /* @__PURE__ */ jsxs(TableCell, {
|
|
1556
|
-
colSpan:
|
|
1573
|
+
colSpan: header_0.colSpan,
|
|
1557
1574
|
align,
|
|
1558
|
-
sortDirection:
|
|
1575
|
+
sortDirection: header_0.column.getIsSorted(),
|
|
1559
1576
|
sx: {
|
|
1560
1577
|
position: "sticky",
|
|
1561
1578
|
top: groupIndex * COLUMN_HEADER_HEIGHT,
|
|
1562
1579
|
zIndex: 3,
|
|
1563
1580
|
bgcolor: "background.paper",
|
|
1564
|
-
width:
|
|
1581
|
+
width: headerWidth(header_0),
|
|
1565
1582
|
whiteSpace: "nowrap",
|
|
1566
1583
|
overflow: "hidden",
|
|
1567
1584
|
...labelled ? CELL_SX : UTILITY_SX,
|
|
1568
|
-
...pinnedSx(
|
|
1585
|
+
...pinnedSx(header_0.column, true)
|
|
1569
1586
|
},
|
|
1570
|
-
children: [
|
|
1587
|
+
children: [header_0.isPlaceholder ? null : /* @__PURE__ */ jsxs(Box, {
|
|
1571
1588
|
sx: {
|
|
1572
1589
|
display: "flex",
|
|
1573
1590
|
alignItems: "center",
|
|
@@ -1587,9 +1604,9 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
|
|
|
1587
1604
|
textOverflow: "ellipsis"
|
|
1588
1605
|
}
|
|
1589
1606
|
},
|
|
1590
|
-
children: /* @__PURE__ */ jsx(
|
|
1591
|
-
}), !disableColumnMenu && /* @__PURE__ */ jsx(
|
|
1592
|
-
}), /* @__PURE__ */ jsx(
|
|
1607
|
+
children: /* @__PURE__ */ jsx(header_0.HeaderSortLabel, { children: /* @__PURE__ */ jsx(header_0.FlexRender, {}) })
|
|
1608
|
+
}), !disableColumnMenu && /* @__PURE__ */ jsx(header_0.HeaderMenu, {})]
|
|
1609
|
+
}), /* @__PURE__ */ jsx(header_0.HeaderResizeHandle, {})]
|
|
1593
1610
|
});
|
|
1594
1611
|
}
|
|
1595
1612
|
}, h.id);
|
|
@@ -1651,6 +1668,15 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
|
|
|
1651
1668
|
]
|
|
1652
1669
|
}, row_1.id);
|
|
1653
1670
|
};
|
|
1671
|
+
const rowCache = useMemo(() => ({ current: /* @__PURE__ */ new Map() }), [
|
|
1672
|
+
table,
|
|
1673
|
+
firstColumn?.index,
|
|
1674
|
+
lastColumn?.index,
|
|
1675
|
+
paddingStart,
|
|
1676
|
+
paddingEnd
|
|
1677
|
+
]);
|
|
1678
|
+
const bodyRows = virtualRows.map(({ index: index_2 }) => rowCache.current.get(rows[index_2].id) ?? renderRow(rows[index_2]));
|
|
1679
|
+
rowCache.current = new Map(bodyRows.map((row_2) => [row_2.key, row_2]));
|
|
1654
1680
|
/** Reserves the scroll height of the rows outside the virtual window. */
|
|
1655
1681
|
const skippedRows = (height) => height > 0 ? /* @__PURE__ */ jsx(TableRow, {
|
|
1656
1682
|
"aria-hidden": true,
|
|
@@ -1701,7 +1727,7 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
|
|
|
1701
1727
|
},
|
|
1702
1728
|
children: [
|
|
1703
1729
|
/* @__PURE__ */ jsx(TableHead, { children: headerGroups.map((headerGroup, groupIndex_0) => {
|
|
1704
|
-
const headers = windowColumns(headerGroup.headers.filter((
|
|
1730
|
+
const headers = windowColumns(headerGroup.headers.filter((header_1) => header_1.column.getIsVisible()));
|
|
1705
1731
|
return /* @__PURE__ */ jsxs(TableRow, {
|
|
1706
1732
|
sx: { height: COLUMN_HEADER_HEIGHT },
|
|
1707
1733
|
children: [
|
|
@@ -1725,7 +1751,7 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
|
|
|
1725
1751
|
}) }),
|
|
1726
1752
|
/* @__PURE__ */ jsxs(TableBody, { children: [loading ? /* @__PURE__ */ jsx(table.Skeleton, { rowHeight: ROW_HEIGHT }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1727
1753
|
skippedRows(paddingTop),
|
|
1728
|
-
|
|
1754
|
+
bodyRows,
|
|
1729
1755
|
skippedRows(paddingBottom)
|
|
1730
1756
|
] }), isEmpty && /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, {
|
|
1731
1757
|
colSpan: visibleColumnCount + 1,
|
|
@@ -1778,7 +1804,7 @@ function LayoutTable({ table, loading = false, pagination = false, pageSizeOptio
|
|
|
1778
1804
|
})
|
|
1779
1805
|
}) })] }),
|
|
1780
1806
|
hasFooter && /* @__PURE__ */ jsx(TableFooter, { children: table.getFooterGroups().map((footerGroup) => {
|
|
1781
|
-
const footers = windowColumns(footerGroup.headers.filter((
|
|
1807
|
+
const footers = windowColumns(footerGroup.headers.filter((header_2) => header_2.column.getIsVisible()));
|
|
1782
1808
|
return /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
1783
1809
|
footers.start.map(renderFooter),
|
|
1784
1810
|
skippedColumns(paddingStart),
|