wcz-layout 9.7.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-C7nAQyMO.mjs +510 -0
- package/dist/AggregatedCell-C7nAQyMO.mjs.map +1 -0
- package/dist/Approval-C-hF4jbT.mjs.map +1 -1
- package/dist/DialogsContext-DLqA8RJ_.mjs.map +1 -1
- package/dist/Email-BzQQkbe9.mjs.map +1 -1
- package/dist/FileMeta-DDqUju1Y.mjs.map +1 -1
- package/dist/LayoutTable-BkrjgpW_.d.mts +758 -0
- package/dist/{QueryClientParam-Cbb0MIKg.d.mts → QueryClientParam-JcH0mJWl.d.mts} +2 -2
- package/dist/RouterListItemButton-ULMlaQh6.mjs.map +1 -1
- package/dist/{User-1gKoYJvW.d.mts → User-D4__w1I1.d.mts} +4 -2
- package/dist/approval-BYryxFOW.mjs +84 -0
- package/dist/approval-BYryxFOW.mjs.map +1 -0
- package/dist/auth.d.mts +21 -11
- package/dist/auth.mjs +43 -26
- package/dist/auth.mjs.map +1 -1
- package/dist/components.d.mts +22 -30
- package/dist/components.mjs +813 -140
- package/dist/components.mjs.map +1 -1
- package/dist/createApi-DGJJ4I_R.mjs +27 -0
- package/dist/createApi-DGJJ4I_R.mjs.map +1 -0
- package/dist/data/client.d.mts +690 -1176
- package/dist/data/client.mjs +4 -3
- package/dist/data/client.mjs.map +1 -1
- package/dist/data/server.d.mts +3 -3
- package/dist/data/server.mjs +4 -2
- package/dist/data/server.mjs.map +1 -1
- package/dist/{file-DimNsRly.mjs → file-C14fhUeg.mjs} +6 -7
- package/dist/file-C14fhUeg.mjs.map +1 -0
- package/dist/{file-BWcNzq55.mjs → file-C5BOj1q8.mjs} +5 -24
- package/dist/file-C5BOj1q8.mjs.map +1 -0
- package/dist/hooks.d.mts +7 -46
- package/dist/hooks.mjs +2587 -239
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.d.mts +28 -9
- package/dist/index.mjs +1248 -500
- package/dist/index.mjs.map +1 -1
- package/dist/middleware.d.mts +20 -19
- package/dist/middleware.mjs +47 -2
- package/dist/middleware.mjs.map +1 -1
- package/dist/models.d.mts +17 -10
- package/dist/models.mjs.map +1 -1
- package/dist/{peoplesoft-CskGsqd6.d.mts → peoplesoft-BY_75WTS.d.mts} +2 -2
- package/dist/{peoplesoft-DTPGpN2h.mjs → peoplesoft-BkJMCcHb.mjs} +24 -81
- package/dist/peoplesoft-BkJMCcHb.mjs.map +1 -0
- package/dist/providers-DrairEO2.mjs +74 -0
- package/dist/providers-DrairEO2.mjs.map +1 -0
- package/dist/tokens-BLRreL1j.mjs +143 -0
- package/dist/tokens-BLRreL1j.mjs.map +1 -0
- package/dist/{utils-DjdexspV.mjs → utils-BUpDoqme.mjs} +73 -51
- package/dist/utils-BUpDoqme.mjs.map +1 -0
- package/dist/{utils-5x4uNxsX.d.mts → utils-Bhi0KiBx.d.mts} +18 -6
- package/dist/utils.d.mts +2 -2
- package/dist/utils.mjs +2 -2
- package/dist/vite.d.mts +1 -2
- package/dist/vite.mjs +3 -3
- package/dist/vite.mjs.map +1 -1
- package/package.json +130 -128
- package/skills/client-db/SKILL.md +104 -96
- package/skills/db-schema/SKILL.md +46 -33
- package/skills/dialogs/SKILL.md +21 -27
- package/skills/forms/SKILL.md +60 -39
- package/skills/general/SKILL.md +122 -94
- package/skills/general/references/exports.md +106 -0
- package/skills/migrations/SKILL.md +53 -2
- package/skills/migrations/versions/migrate-v9-to-v10.md +582 -0
- package/skills/routing/SKILL.md +50 -60
- package/skills/server-functions/SKILL.md +36 -56
- package/skills/services/SKILL.md +7 -4
- package/skills/services/docs/approval.md +2 -2
- package/skills/services/docs/peoplesoft.md +114 -110
- package/skills/start/SKILL.md +9 -5
- package/skills/start/steps/05-database-setup.md +52 -52
- package/skills/start/steps/06-entra-setup.md +1 -1
- package/skills/start/steps/07-vault-setup.md +5 -12
- package/skills/table/SKILL.md +263 -0
- package/skills/unslop/SKILL.md +80 -0
- package/dist/NotificationContext-CgwUOeW0.mjs +0 -7
- package/dist/NotificationContext-CgwUOeW0.mjs.map +0 -1
- package/dist/authMiddleware-DPly0b_T.mjs +0 -48
- package/dist/authMiddleware-DPly0b_T.mjs.map +0 -1
- package/dist/entra-CJSyeQsx.mjs +0 -109
- package/dist/entra-CJSyeQsx.mjs.map +0 -1
- package/dist/file-BWcNzq55.mjs.map +0 -1
- package/dist/file-DimNsRly.mjs.map +0 -1
- package/dist/msalServer-DLwA7_ta.mjs +0 -30
- package/dist/msalServer-DLwA7_ta.mjs.map +0 -1
- package/dist/peoplesoft-DTPGpN2h.mjs.map +0 -1
- package/dist/useDialogs-BUzVrTSP.mjs +0 -248
- package/dist/useDialogs-BUzVrTSP.mjs.map +0 -1
- package/dist/user-Dzv0N9fj.d.mts +0 -16
- package/dist/utils-DjdexspV.mjs.map +0 -1
- package/skills/data-grid/SKILL.md +0 -142
- package/skills/migrations/versions/migrate-v9-to-v10.tsx +0 -9
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
import { t as DialogsContext } from "./DialogsContext-DLqA8RJ_.mjs";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, Typography, useEventCallback } from "@mui/material";
|
|
4
|
+
import dayjs from "dayjs";
|
|
5
|
+
import { useContext } from "react";
|
|
6
|
+
import { useTranslation } from "react-i18next";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { formatForDisplay } from "@tanstack/react-hotkeys";
|
|
9
|
+
import { defaultRangeExtractor } from "@tanstack/react-virtual";
|
|
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";
|
|
11
|
+
//#region src/hooks/useDialogs.tsx
|
|
12
|
+
function AlertDialog(t0) {
|
|
13
|
+
const $ = c(23);
|
|
14
|
+
if ($[0] !== "40306a49a490b7e6c84c5f6c47439f8c7b6ee1f8cf1389e00101b53c362d1875") {
|
|
15
|
+
for (let $i = 0; $i < 23; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
16
|
+
$[0] = "40306a49a490b7e6c84c5f6c47439f8c7b6ee1f8cf1389e00101b53c362d1875";
|
|
17
|
+
}
|
|
18
|
+
const { open, payload, onClose } = t0;
|
|
19
|
+
const { t } = useTranslation();
|
|
20
|
+
let t1;
|
|
21
|
+
if ($[1] !== onClose) {
|
|
22
|
+
t1 = () => onClose();
|
|
23
|
+
$[1] = onClose;
|
|
24
|
+
$[2] = t1;
|
|
25
|
+
} else t1 = $[2];
|
|
26
|
+
let t2;
|
|
27
|
+
if ($[3] !== payload.title || $[4] !== t) {
|
|
28
|
+
t2 = payload.title ?? t("Layout.Dialog.Alert");
|
|
29
|
+
$[3] = payload.title;
|
|
30
|
+
$[4] = t;
|
|
31
|
+
$[5] = t2;
|
|
32
|
+
} else t2 = $[5];
|
|
33
|
+
let t3;
|
|
34
|
+
if ($[6] !== t2) {
|
|
35
|
+
t3 = /* @__PURE__ */ jsx(DialogTitle, { children: t2 });
|
|
36
|
+
$[6] = t2;
|
|
37
|
+
$[7] = t3;
|
|
38
|
+
} else t3 = $[7];
|
|
39
|
+
let t4;
|
|
40
|
+
if ($[8] !== payload.message) {
|
|
41
|
+
t4 = /* @__PURE__ */ jsx(DialogContent, { children: payload.message });
|
|
42
|
+
$[8] = payload.message;
|
|
43
|
+
$[9] = t4;
|
|
44
|
+
} else t4 = $[9];
|
|
45
|
+
let t5;
|
|
46
|
+
if ($[10] !== onClose) {
|
|
47
|
+
t5 = () => onClose();
|
|
48
|
+
$[10] = onClose;
|
|
49
|
+
$[11] = t5;
|
|
50
|
+
} else t5 = $[11];
|
|
51
|
+
let t6;
|
|
52
|
+
if ($[12] !== t) {
|
|
53
|
+
t6 = t("Layout.Dialog.Confirm");
|
|
54
|
+
$[12] = t;
|
|
55
|
+
$[13] = t6;
|
|
56
|
+
} else t6 = $[13];
|
|
57
|
+
let t7;
|
|
58
|
+
if ($[14] !== t5 || $[15] !== t6) {
|
|
59
|
+
t7 = /* @__PURE__ */ jsx(DialogActions, { children: /* @__PURE__ */ jsx(Button, {
|
|
60
|
+
onClick: t5,
|
|
61
|
+
autoFocus: true,
|
|
62
|
+
children: t6
|
|
63
|
+
}) });
|
|
64
|
+
$[14] = t5;
|
|
65
|
+
$[15] = t6;
|
|
66
|
+
$[16] = t7;
|
|
67
|
+
} else t7 = $[16];
|
|
68
|
+
let t8;
|
|
69
|
+
if ($[17] !== open || $[18] !== t1 || $[19] !== t3 || $[20] !== t4 || $[21] !== t7) {
|
|
70
|
+
t8 = /* @__PURE__ */ jsxs(Dialog, {
|
|
71
|
+
maxWidth: "xs",
|
|
72
|
+
fullWidth: true,
|
|
73
|
+
open,
|
|
74
|
+
onClose: t1,
|
|
75
|
+
disableRestoreFocus: true,
|
|
76
|
+
children: [
|
|
77
|
+
t3,
|
|
78
|
+
t4,
|
|
79
|
+
t7
|
|
80
|
+
]
|
|
81
|
+
});
|
|
82
|
+
$[17] = open;
|
|
83
|
+
$[18] = t1;
|
|
84
|
+
$[19] = t3;
|
|
85
|
+
$[20] = t4;
|
|
86
|
+
$[21] = t7;
|
|
87
|
+
$[22] = t8;
|
|
88
|
+
} else t8 = $[22];
|
|
89
|
+
return t8;
|
|
90
|
+
}
|
|
91
|
+
function ConfirmDialog(t0) {
|
|
92
|
+
const $ = c(34);
|
|
93
|
+
if ($[0] !== "40306a49a490b7e6c84c5f6c47439f8c7b6ee1f8cf1389e00101b53c362d1875") {
|
|
94
|
+
for (let $i = 0; $i < 34; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
95
|
+
$[0] = "40306a49a490b7e6c84c5f6c47439f8c7b6ee1f8cf1389e00101b53c362d1875";
|
|
96
|
+
}
|
|
97
|
+
const { open, payload, onClose } = t0;
|
|
98
|
+
const { t } = useTranslation();
|
|
99
|
+
let t1;
|
|
100
|
+
if ($[1] !== onClose) {
|
|
101
|
+
t1 = () => onClose(false);
|
|
102
|
+
$[1] = onClose;
|
|
103
|
+
$[2] = t1;
|
|
104
|
+
} else t1 = $[2];
|
|
105
|
+
let t2;
|
|
106
|
+
if ($[3] !== payload.title || $[4] !== t) {
|
|
107
|
+
t2 = payload.title ?? t("Layout.Dialog.Confirm");
|
|
108
|
+
$[3] = payload.title;
|
|
109
|
+
$[4] = t;
|
|
110
|
+
$[5] = t2;
|
|
111
|
+
} else t2 = $[5];
|
|
112
|
+
let t3;
|
|
113
|
+
if ($[6] !== t2) {
|
|
114
|
+
t3 = /* @__PURE__ */ jsx(DialogTitle, { children: t2 });
|
|
115
|
+
$[6] = t2;
|
|
116
|
+
$[7] = t3;
|
|
117
|
+
} else t3 = $[7];
|
|
118
|
+
let t4;
|
|
119
|
+
if ($[8] !== payload.message) {
|
|
120
|
+
t4 = /* @__PURE__ */ jsx(DialogContent, { children: payload.message });
|
|
121
|
+
$[8] = payload.message;
|
|
122
|
+
$[9] = t4;
|
|
123
|
+
} else t4 = $[9];
|
|
124
|
+
let t5;
|
|
125
|
+
if ($[10] !== onClose) {
|
|
126
|
+
t5 = () => onClose(false);
|
|
127
|
+
$[10] = onClose;
|
|
128
|
+
$[11] = t5;
|
|
129
|
+
} else t5 = $[11];
|
|
130
|
+
let t6;
|
|
131
|
+
if ($[12] !== payload.cancelText || $[13] !== t) {
|
|
132
|
+
t6 = payload.cancelText ?? t("Layout.Dialog.Cancel");
|
|
133
|
+
$[12] = payload.cancelText;
|
|
134
|
+
$[13] = t;
|
|
135
|
+
$[14] = t6;
|
|
136
|
+
} else t6 = $[14];
|
|
137
|
+
let t7;
|
|
138
|
+
if ($[15] !== t5 || $[16] !== t6) {
|
|
139
|
+
t7 = /* @__PURE__ */ jsx(Button, {
|
|
140
|
+
onClick: t5,
|
|
141
|
+
children: t6
|
|
142
|
+
});
|
|
143
|
+
$[15] = t5;
|
|
144
|
+
$[16] = t6;
|
|
145
|
+
$[17] = t7;
|
|
146
|
+
} else t7 = $[17];
|
|
147
|
+
let t8;
|
|
148
|
+
if ($[18] !== onClose) {
|
|
149
|
+
t8 = () => onClose(true);
|
|
150
|
+
$[18] = onClose;
|
|
151
|
+
$[19] = t8;
|
|
152
|
+
} else t8 = $[19];
|
|
153
|
+
let t9;
|
|
154
|
+
if ($[20] !== t) {
|
|
155
|
+
t9 = t("Layout.Dialog.Confirm");
|
|
156
|
+
$[20] = t;
|
|
157
|
+
$[21] = t9;
|
|
158
|
+
} else t9 = $[21];
|
|
159
|
+
let t10;
|
|
160
|
+
if ($[22] !== t8 || $[23] !== t9) {
|
|
161
|
+
t10 = /* @__PURE__ */ jsx(Button, {
|
|
162
|
+
onClick: t8,
|
|
163
|
+
autoFocus: true,
|
|
164
|
+
children: t9
|
|
165
|
+
});
|
|
166
|
+
$[22] = t8;
|
|
167
|
+
$[23] = t9;
|
|
168
|
+
$[24] = t10;
|
|
169
|
+
} else t10 = $[24];
|
|
170
|
+
let t11;
|
|
171
|
+
if ($[25] !== t10 || $[26] !== t7) {
|
|
172
|
+
t11 = /* @__PURE__ */ jsxs(DialogActions, { children: [t7, t10] });
|
|
173
|
+
$[25] = t10;
|
|
174
|
+
$[26] = t7;
|
|
175
|
+
$[27] = t11;
|
|
176
|
+
} else t11 = $[27];
|
|
177
|
+
let t12;
|
|
178
|
+
if ($[28] !== open || $[29] !== t1 || $[30] !== t11 || $[31] !== t3 || $[32] !== t4) {
|
|
179
|
+
t12 = /* @__PURE__ */ jsxs(Dialog, {
|
|
180
|
+
maxWidth: "xs",
|
|
181
|
+
fullWidth: true,
|
|
182
|
+
open,
|
|
183
|
+
onClose: t1,
|
|
184
|
+
disableRestoreFocus: true,
|
|
185
|
+
children: [
|
|
186
|
+
t3,
|
|
187
|
+
t4,
|
|
188
|
+
t11
|
|
189
|
+
]
|
|
190
|
+
});
|
|
191
|
+
$[28] = open;
|
|
192
|
+
$[29] = t1;
|
|
193
|
+
$[30] = t11;
|
|
194
|
+
$[31] = t3;
|
|
195
|
+
$[32] = t4;
|
|
196
|
+
$[33] = t12;
|
|
197
|
+
} else t12 = $[33];
|
|
198
|
+
return t12;
|
|
199
|
+
}
|
|
200
|
+
function useDialogs() {
|
|
201
|
+
const $ = c(10);
|
|
202
|
+
if ($[0] !== "40306a49a490b7e6c84c5f6c47439f8c7b6ee1f8cf1389e00101b53c362d1875") {
|
|
203
|
+
for (let $i = 0; $i < 10; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
204
|
+
$[0] = "40306a49a490b7e6c84c5f6c47439f8c7b6ee1f8cf1389e00101b53c362d1875";
|
|
205
|
+
}
|
|
206
|
+
const { open, close } = useContext(DialogsContext);
|
|
207
|
+
let t0;
|
|
208
|
+
if ($[1] !== open) {
|
|
209
|
+
t0 = (message, t1) => {
|
|
210
|
+
const { ...options } = t1 === void 0 ? {} : t1;
|
|
211
|
+
return open(AlertDialog, {
|
|
212
|
+
...options,
|
|
213
|
+
message
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
$[1] = open;
|
|
217
|
+
$[2] = t0;
|
|
218
|
+
} else t0 = $[2];
|
|
219
|
+
const alert = useEventCallback(t0);
|
|
220
|
+
let t1;
|
|
221
|
+
if ($[3] !== open) {
|
|
222
|
+
t1 = (message_0, t2) => {
|
|
223
|
+
const { ...options_0 } = t2 === void 0 ? {} : t2;
|
|
224
|
+
return open(ConfirmDialog, {
|
|
225
|
+
...options_0,
|
|
226
|
+
message: message_0
|
|
227
|
+
});
|
|
228
|
+
};
|
|
229
|
+
$[3] = open;
|
|
230
|
+
$[4] = t1;
|
|
231
|
+
} else t1 = $[4];
|
|
232
|
+
const confirm = useEventCallback(t1);
|
|
233
|
+
let t2;
|
|
234
|
+
if ($[5] !== alert || $[6] !== close || $[7] !== confirm || $[8] !== open) {
|
|
235
|
+
t2 = {
|
|
236
|
+
alert,
|
|
237
|
+
confirm,
|
|
238
|
+
open,
|
|
239
|
+
close
|
|
240
|
+
};
|
|
241
|
+
$[5] = alert;
|
|
242
|
+
$[6] = close;
|
|
243
|
+
$[7] = confirm;
|
|
244
|
+
$[8] = open;
|
|
245
|
+
$[9] = t2;
|
|
246
|
+
} else t2 = $[9];
|
|
247
|
+
return t2;
|
|
248
|
+
}
|
|
249
|
+
//#endregion
|
|
250
|
+
//#region src/components/table/utils.ts
|
|
251
|
+
const shortcutLabel = (label, hotkey) => `${label} (${formatForDisplay(hotkey)})`;
|
|
252
|
+
const columnLabel = (column) => {
|
|
253
|
+
const meta = column.columnDef.meta;
|
|
254
|
+
if (meta?.label) return meta.label;
|
|
255
|
+
return typeof column.columnDef.header === "string" ? column.columnDef.header : column.id;
|
|
256
|
+
};
|
|
257
|
+
const hasColumnLabel = (column) => Boolean(column.columnDef.meta?.label) || typeof column.columnDef.header === "string";
|
|
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;
|
|
261
|
+
const moveColumn = (column, delta) => {
|
|
262
|
+
const { table } = column;
|
|
263
|
+
const current = table.atoms.columnOrder.get();
|
|
264
|
+
const order = current.length ? [...current] : table.getAllLeafColumns().map(({ id }) => id);
|
|
265
|
+
const from = order.indexOf(column.id);
|
|
266
|
+
const to = from + delta;
|
|
267
|
+
if (from < 0 || to < 0 || to >= order.length) return;
|
|
268
|
+
order.splice(to, 0, ...order.splice(from, 1));
|
|
269
|
+
table.setColumnOrder(order);
|
|
270
|
+
};
|
|
271
|
+
const pinnedSx = (column, isHeader = false) => {
|
|
272
|
+
const pinned = column.getIsPinned();
|
|
273
|
+
if (!pinned) return {};
|
|
274
|
+
return {
|
|
275
|
+
position: "sticky",
|
|
276
|
+
zIndex: isHeader ? 4 : 2,
|
|
277
|
+
insetInlineStart: pinned === "start" ? column.getStart("start") : void 0,
|
|
278
|
+
insetInlineEnd: pinned === "end" ? column.getAfter("end") : void 0,
|
|
279
|
+
bgcolor: "background.paper",
|
|
280
|
+
...!isHeader && {
|
|
281
|
+
".MuiTableRow-root:hover > &": { backgroundImage: (theme) => `linear-gradient(${theme.palette.action.hover}, ${theme.palette.action.hover})` },
|
|
282
|
+
".MuiTableRow-root.Mui-selected > &": { backgroundImage: (theme) => `linear-gradient(${theme.palette.action.selected}, ${theme.palette.action.selected})` }
|
|
283
|
+
},
|
|
284
|
+
...pinned === "start" && column.getIsLastColumn("start") && {
|
|
285
|
+
borderInlineEnd: 1,
|
|
286
|
+
borderInlineEndStyle: "solid",
|
|
287
|
+
borderColor: "divider"
|
|
288
|
+
},
|
|
289
|
+
...pinned === "end" && column.getIsFirstColumn("end") && {
|
|
290
|
+
borderInlineStart: 1,
|
|
291
|
+
borderInlineStartStyle: "solid",
|
|
292
|
+
borderColor: "divider"
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
const cellSelectionSx = (cell) => {
|
|
297
|
+
if (!cell.getIsSelected()) return {};
|
|
298
|
+
const edges = cell.getSelectionEdges();
|
|
299
|
+
const outline = (theme) => [
|
|
300
|
+
edges.top && `inset 0 2px 0 0 ${theme.palette.primary.main}`,
|
|
301
|
+
edges.bottom && `inset 0 -2px 0 0 ${theme.palette.primary.main}`,
|
|
302
|
+
edges.left && `inset 2px 0 0 0 ${theme.palette.primary.main}`,
|
|
303
|
+
edges.right && `inset -2px 0 0 0 ${theme.palette.primary.main}`
|
|
304
|
+
].filter(Boolean).join(", ") || "none";
|
|
305
|
+
return {
|
|
306
|
+
backgroundImage: (theme) => `linear-gradient(${theme.palette.action.selected}, ${theme.palette.action.selected})`,
|
|
307
|
+
boxShadow: outline
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
/** Spreadsheet TSV quoting, so a cell holding a tab or a newline stays one cell. */
|
|
311
|
+
const quoteTsv = (text) => /["\t\n\r]/.test(text) ? `"${text.replaceAll("\"", "\"\"")}"` : text;
|
|
312
|
+
const toClipboardValue = (value) => {
|
|
313
|
+
if (value == null) return "";
|
|
314
|
+
if (typeof value === "string") return quoteTsv(value);
|
|
315
|
+
if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") return quoteTsv(String(value));
|
|
316
|
+
if (value instanceof Date) return quoteTsv(value.toISOString());
|
|
317
|
+
return quoteTsv(JSON.stringify(value) ?? "");
|
|
318
|
+
};
|
|
319
|
+
/**
|
|
320
|
+
* Serializes `table.getSelectedCellRangesData()` as TSV, which is what Excel,
|
|
321
|
+
* Google Sheets and LibreOffice all paste as a grid. Disjoint selection regions
|
|
322
|
+
* are separated by a blank line.
|
|
323
|
+
*/
|
|
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
|
+
};
|
|
335
|
+
//#endregion
|
|
336
|
+
//#region src/components/table/formatValue.ts
|
|
337
|
+
const formatValue = (value, dateFormat = "L LT") => {
|
|
338
|
+
if (value === null || value === void 0) return "";
|
|
339
|
+
if (value instanceof Date) return dayjs(value).format(dateFormat);
|
|
340
|
+
if (typeof value === "string") return value;
|
|
341
|
+
if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") return value.toString();
|
|
342
|
+
return JSON.stringify(value) ?? "";
|
|
343
|
+
};
|
|
344
|
+
//#endregion
|
|
345
|
+
//#region src/components/table/context.ts
|
|
346
|
+
const layoutTableFeatures = tableFeatures({
|
|
347
|
+
...stockFeatures,
|
|
348
|
+
columnMeta: metaHelper(),
|
|
349
|
+
filteredRowModel: createFilteredRowModel(),
|
|
350
|
+
sortedRowModel: createSortedRowModel(),
|
|
351
|
+
paginatedRowModel: createPaginatedRowModel(),
|
|
352
|
+
expandedRowModel: createExpandedRowModel(),
|
|
353
|
+
groupedRowModel: createGroupedRowModel(),
|
|
354
|
+
facetedRowModel: createFacetedRowModel(),
|
|
355
|
+
facetedUniqueValues: createFacetedUniqueValues(),
|
|
356
|
+
facetedMinMaxValues: createFacetedMinMaxValues(),
|
|
357
|
+
filterFns: {
|
|
358
|
+
arrHas: filterFn_arrHas,
|
|
359
|
+
arrIncludes: filterFn_arrIncludes,
|
|
360
|
+
arrIncludesAll: filterFn_arrIncludesAll,
|
|
361
|
+
arrIncludesSome: filterFn_arrIncludesSome,
|
|
362
|
+
between: filterFn_between,
|
|
363
|
+
betweenInclusive: filterFn_betweenInclusive,
|
|
364
|
+
empty: filterFn_empty,
|
|
365
|
+
endsWith: filterFn_endsWith,
|
|
366
|
+
equals: filterFn_equals,
|
|
367
|
+
equalsString: filterFn_equalsString,
|
|
368
|
+
equalsStringSensitive: filterFn_equalsStringSensitive,
|
|
369
|
+
greaterThan: filterFn_greaterThan,
|
|
370
|
+
greaterThanOrEqualTo: filterFn_greaterThanOrEqualTo,
|
|
371
|
+
inDateRange: filterFn_inDateRange,
|
|
372
|
+
inNumberRange: filterFn_inNumberRange,
|
|
373
|
+
includesString: filterFn_includesString,
|
|
374
|
+
includesStringSensitive: filterFn_includesStringSensitive,
|
|
375
|
+
lessThan: filterFn_lessThan,
|
|
376
|
+
lessThanOrEqualTo: filterFn_lessThanOrEqualTo,
|
|
377
|
+
notEmpty: filterFn_notEmpty,
|
|
378
|
+
startsWith: filterFn_startsWith,
|
|
379
|
+
weakEquals: filterFn_weakEquals
|
|
380
|
+
},
|
|
381
|
+
sortFns: {
|
|
382
|
+
alphanumeric: sortFn_alphanumeric,
|
|
383
|
+
alphanumericCaseSensitive: sortFn_alphanumericCaseSensitive,
|
|
384
|
+
basic: sortFn_basic,
|
|
385
|
+
datetime: sortFn_datetime,
|
|
386
|
+
text: sortFn_text,
|
|
387
|
+
textCaseSensitive: sortFn_textCaseSensitive
|
|
388
|
+
},
|
|
389
|
+
aggregationFns: {
|
|
390
|
+
sum: aggregationFn_sum,
|
|
391
|
+
min: aggregationFn_min,
|
|
392
|
+
max: aggregationFn_max,
|
|
393
|
+
extent: aggregationFn_extent,
|
|
394
|
+
mean: aggregationFn_mean,
|
|
395
|
+
median: aggregationFn_median,
|
|
396
|
+
unique: aggregationFn_unique,
|
|
397
|
+
uniqueCount: aggregationFn_uniqueCount,
|
|
398
|
+
count: aggregationFn_count,
|
|
399
|
+
first: aggregationFn_first,
|
|
400
|
+
last: aggregationFn_last
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
const { tableContext, cellContext, headerContext, useTableContext, useCellContext, useHeaderContext } = createTableHookContexts();
|
|
404
|
+
//#endregion
|
|
405
|
+
//#region src/components/table/cells/formatters/AggregatedCell.tsx
|
|
406
|
+
const AggregatedCell = (t0) => {
|
|
407
|
+
const $ = c(30);
|
|
408
|
+
if ($[0] !== "4277c795cc5aa79cb8c9da3c17c3eca0172b2cb25ae31116d08eb0a5b925c1d5") {
|
|
409
|
+
for (let $i = 0; $i < 30; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
410
|
+
$[0] = "4277c795cc5aa79cb8c9da3c17c3eca0172b2cb25ae31116d08eb0a5b925c1d5";
|
|
411
|
+
}
|
|
412
|
+
let dateFormat;
|
|
413
|
+
let options;
|
|
414
|
+
let props;
|
|
415
|
+
let t1;
|
|
416
|
+
if ($[1] !== t0) {
|
|
417
|
+
({prefix: t1, options, dateFormat, ...props} = t0);
|
|
418
|
+
$[1] = t0;
|
|
419
|
+
$[2] = dateFormat;
|
|
420
|
+
$[3] = options;
|
|
421
|
+
$[4] = props;
|
|
422
|
+
$[5] = t1;
|
|
423
|
+
} else {
|
|
424
|
+
dateFormat = $[2];
|
|
425
|
+
options = $[3];
|
|
426
|
+
props = $[4];
|
|
427
|
+
t1 = $[5];
|
|
428
|
+
}
|
|
429
|
+
const prefix = t1 === void 0 ? "" : t1;
|
|
430
|
+
const cell = useCellContext();
|
|
431
|
+
let T0;
|
|
432
|
+
let t2;
|
|
433
|
+
let t3;
|
|
434
|
+
let t4;
|
|
435
|
+
let t5;
|
|
436
|
+
let t6;
|
|
437
|
+
let t7;
|
|
438
|
+
let t8;
|
|
439
|
+
if ($[6] !== cell || $[7] !== dateFormat || $[8] !== options || $[9] !== prefix || $[10] !== props) {
|
|
440
|
+
t8 = Symbol.for("react.early_return_sentinel");
|
|
441
|
+
bb0: {
|
|
442
|
+
const value = cell.getValue();
|
|
443
|
+
if (value === null || value === void 0 || value === "") {
|
|
444
|
+
t8 = null;
|
|
445
|
+
break bb0;
|
|
446
|
+
}
|
|
447
|
+
let t9;
|
|
448
|
+
if ($[19] !== dateFormat || $[20] !== options) {
|
|
449
|
+
t9 = (entry) => typeof entry === "number" ? entry.toLocaleString(void 0, options) : formatValue(entry, dateFormat);
|
|
450
|
+
$[19] = dateFormat;
|
|
451
|
+
$[20] = options;
|
|
452
|
+
$[21] = t9;
|
|
453
|
+
} else t9 = $[21];
|
|
454
|
+
const format = t9;
|
|
455
|
+
T0 = Typography;
|
|
456
|
+
t2 = "body2";
|
|
457
|
+
t3 = "text.secondary";
|
|
458
|
+
t4 = true;
|
|
459
|
+
t5 = props;
|
|
460
|
+
t6 = prefix;
|
|
461
|
+
t7 = Array.isArray(value) ? value.map(format).join(" – ") : format(value);
|
|
462
|
+
}
|
|
463
|
+
$[6] = cell;
|
|
464
|
+
$[7] = dateFormat;
|
|
465
|
+
$[8] = options;
|
|
466
|
+
$[9] = prefix;
|
|
467
|
+
$[10] = props;
|
|
468
|
+
$[11] = T0;
|
|
469
|
+
$[12] = t2;
|
|
470
|
+
$[13] = t3;
|
|
471
|
+
$[14] = t4;
|
|
472
|
+
$[15] = t5;
|
|
473
|
+
$[16] = t6;
|
|
474
|
+
$[17] = t7;
|
|
475
|
+
$[18] = t8;
|
|
476
|
+
} else {
|
|
477
|
+
T0 = $[11];
|
|
478
|
+
t2 = $[12];
|
|
479
|
+
t3 = $[13];
|
|
480
|
+
t4 = $[14];
|
|
481
|
+
t5 = $[15];
|
|
482
|
+
t6 = $[16];
|
|
483
|
+
t7 = $[17];
|
|
484
|
+
t8 = $[18];
|
|
485
|
+
}
|
|
486
|
+
if (t8 !== Symbol.for("react.early_return_sentinel")) return t8;
|
|
487
|
+
let t9;
|
|
488
|
+
if ($[22] !== T0 || $[23] !== t2 || $[24] !== t3 || $[25] !== t4 || $[26] !== t5 || $[27] !== t6 || $[28] !== t7) {
|
|
489
|
+
t9 = /* @__PURE__ */ jsxs(T0, {
|
|
490
|
+
variant: t2,
|
|
491
|
+
color: t3,
|
|
492
|
+
noWrap: t4,
|
|
493
|
+
...t5,
|
|
494
|
+
children: [t6, t7]
|
|
495
|
+
});
|
|
496
|
+
$[22] = T0;
|
|
497
|
+
$[23] = t2;
|
|
498
|
+
$[24] = t3;
|
|
499
|
+
$[25] = t4;
|
|
500
|
+
$[26] = t5;
|
|
501
|
+
$[27] = t6;
|
|
502
|
+
$[28] = t7;
|
|
503
|
+
$[29] = t9;
|
|
504
|
+
} else t9 = $[29];
|
|
505
|
+
return t9;
|
|
506
|
+
};
|
|
507
|
+
//#endregion
|
|
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 };
|
|
509
|
+
|
|
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,EA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