@gen-epix/ui-client-common 4.8.0 → 4.9.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/_chunks/CrudPage.js +3 -3
- package/dist/_chunks/CrudPage.js.map +1 -1
- package/dist/_chunks/GeoFilter.js +1 -1
- package/dist/_chunks/QueryClientProvider.js +1 -1
- package/dist/_chunks/QueryClientProvider.js.map +1 -1
- package/dist/_chunks/QueryClientService.js +39 -35
- package/dist/_chunks/QueryClientService.js.map +1 -1
- package/dist/_chunks/Table.js +258 -242
- package/dist/_chunks/Table.js.map +1 -1
- package/dist/_chunks/TableUtil.js +1668 -1659
- package/dist/_chunks/TableUtil.js.map +1 -1
- package/dist/_chunks/TextFilter.js +41 -32
- package/dist/_chunks/TextFilter.js.map +1 -1
- package/dist/_chunks/UserInvitationsAdminPage.js +3 -3
- package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
- package/dist/_chunks/{_cacheHas.js → _arrayIncludesWith.js} +17 -17
- package/dist/_chunks/_arrayIncludesWith.js.map +1 -0
- package/dist/_chunks/{isArrayLike.js → _arrayMap.js} +94 -94
- package/dist/_chunks/_arrayMap.js.map +1 -0
- package/dist/_chunks/_baseGet.js +61 -61
- package/dist/_chunks/_baseGet.js.map +1 -1
- package/dist/_chunks/_baseIteratee.js +28 -28
- package/dist/_chunks/_baseIteratee.js.map +1 -1
- package/dist/_chunks/_setToString.js +7 -7
- package/dist/_chunks/_setToString.js.map +1 -1
- package/dist/_chunks/middleware.js +1 -1
- package/dist/_chunks/middleware.js.map +1 -1
- package/dist/_chunks/omit.js +74 -58
- package/dist/_chunks/omit.js.map +1 -1
- package/dist/_chunks/query.js +264 -262
- package/dist/_chunks/query.js.map +1 -1
- package/dist/_chunks/react.js +1 -1
- package/dist/_chunks/react.js.map +1 -1
- package/dist/_chunks/tableStore.js +46 -21
- package/dist/_chunks/tableStore.js.map +1 -1
- package/dist/_chunks/uniq.js +2 -2
- package/dist/_chunks/uniq.js.map +1 -1
- package/dist/_chunks/useMutation.js +17 -17
- package/dist/_chunks/useMutation.js.map +1 -1
- package/dist/_chunks/useQueryMemo.js +103 -103
- package/dist/_chunks/useQueryMemo.js.map +1 -1
- package/dist/_chunks/vanilla.js +1 -1
- package/dist/_chunks/vanilla.js.map +1 -1
- package/dist/_chunks/yup.js +2 -2
- package/dist/_chunks/yup.js.map +1 -1
- package/dist/classes/filters/MultiSelectFilter.d.ts +8 -6
- package/dist/classes/services/EmotionCacheService/index.js +3 -1
- package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
- package/dist/components/app/App/index.js +1 -1
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +1 -1
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
- package/dist/components/ui/ApplicationBar/index.js +2 -0
- package/dist/components/ui/ApplicationBar/index.js.map +1 -1
- package/dist/components/ui/GenericErrorMessage/index.js +1 -0
- package/dist/components/ui/GenericErrorMessage/index.js.map +1 -1
- package/dist/components/ui/OrganizationSwitcherDialog/index.js +1 -1
- package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -1
- package/dist/dataHooks/useSitesQuery/index.d.ts +1 -0
- package/dist/dataHooks/useSitesQuery/index.js +18 -0
- package/dist/dataHooks/useSitesQuery/index.js.map +1 -0
- package/dist/dataHooks/useSitesQuery/useSitesQuery.d.ts +5 -0
- package/dist/locale/en.json +2 -0
- package/dist/locale/nl.json +2 -0
- package/dist/models/table.models.d.ts +1 -1
- package/dist/models/table.models.js.map +1 -1
- package/dist/pages/CrudPage/CrudPage.d.ts +1 -1
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +12 -11
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js.map +1 -1
- package/dist/pages/OutagesAdminPage/index.js +55 -55
- package/dist/pages/OutagesAdminPage/index.js.map +1 -1
- package/dist/pages/UsersAdminPage/index.js +90 -90
- package/dist/pages/UsersAdminPage/index.js.map +1 -1
- package/dist/theme/demoTheme/index.js +1 -1
- package/dist/theme/demoTheme/index.js.map +1 -1
- package/dist/utils/TableUtil/TableUtil.d.ts +8 -1
- package/package.json +33 -27
- package/dist/_chunks/_baseFlatten.js +0 -26
- package/dist/_chunks/_baseFlatten.js.map +0 -1
- package/dist/_chunks/_cacheHas.js.map +0 -1
- package/dist/_chunks/isArrayLike.js.map +0 -1
- package/dist/test/lib/index.d.ts +0 -1
- package/dist/test/lib/render.d.ts +0 -2
package/dist/_chunks/Table.js
CHANGED
|
@@ -7,7 +7,7 @@ import { t as m } from "./react.js";
|
|
|
7
7
|
import { PageEventBusService as h } from "../classes/services/PageEventBusService/index.js";
|
|
8
8
|
import { useConfig as g } from "../hooks/useConfig/index.js";
|
|
9
9
|
import { l as _, t as v } from "./tableStore.js";
|
|
10
|
-
import { f as y } from "./
|
|
10
|
+
import { f as y } from "./_arrayMap.js";
|
|
11
11
|
import { t as b } from "./GeoFilter.js";
|
|
12
12
|
import { BooleanFilterField as x } from "../components/filters/BooleanFilterField/index.js";
|
|
13
13
|
import { DateFilterField as S } from "../components/filters/DateFilterField/index.js";
|
|
@@ -33,25 +33,25 @@ import Te from "@mui/icons-material/ArrowDownward";
|
|
|
33
33
|
import Ee from "@mui/icons-material/FilterAlt";
|
|
34
34
|
import { FormProvider as De, useController as Oe, useForm as ke, useFormContext as Ae, useWatch as je } from "react-hook-form";
|
|
35
35
|
import Me from "@mui/icons-material/MoreVert";
|
|
36
|
-
import { withDialog as
|
|
37
|
-
import { DndContext as
|
|
38
|
-
import { SortableContext as
|
|
39
|
-
import { CSS as
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import { NestedDropdown as
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import
|
|
36
|
+
import { withDialog as Ne } from "@gen-epix/ui-core-components/hoc/withDialog";
|
|
37
|
+
import { DndContext as J, DragOverlay as Pe, KeyboardSensor as Fe, PointerSensor as Ie, defaultDropAnimationSideEffects as Y, useSensor as Le, useSensors as Re } from "@dnd-kit/core";
|
|
38
|
+
import { SortableContext as ze, arrayMove as Be, sortableKeyboardCoordinates as Ve, useSortable as He } from "@dnd-kit/sortable";
|
|
39
|
+
import { CSS as Ue } from "@dnd-kit/utilities";
|
|
40
|
+
import We from "@mui/icons-material/DragIndicator";
|
|
41
|
+
import X from "@mui/icons-material/IndeterminateCheckBox";
|
|
42
|
+
import Ge from "@mui/icons-material/Check";
|
|
43
|
+
import Ke from "@mui/icons-material/RestartAlt";
|
|
44
|
+
import qe from "@mui/icons-material/Close";
|
|
45
|
+
import { NestedDropdown as Je } from "@gen-epix/ui-core-components/components/NestedMenu";
|
|
46
|
+
import Ye from "@mui/icons-material/CheckBoxOutlined";
|
|
47
|
+
import Xe from "@mui/icons-material/CheckBoxOutlineBlankOutlined";
|
|
48
|
+
import Ze from "@mui/icons-material/ToggleOffOutlined";
|
|
49
|
+
import Qe from "@mui/icons-material/ToggleOnOutlined";
|
|
50
|
+
import $e from "@mui/icons-material/EditOutlined";
|
|
51
|
+
import et from "@mui/icons-material/Download";
|
|
52
52
|
// ../../node_modules/.pnpm/use-debounce@10.1.1_react@19.3.1/node_modules/use-debounce/dist/index.module.js
|
|
53
|
-
var
|
|
54
|
-
function
|
|
53
|
+
var tt = /* @__PURE__ */ e(d(), 1), nt = /* @__PURE__ */ e(n(), 1), rt = /* @__PURE__ */ e(u(), 1), it = /* @__PURE__ */ e(c(), 1);
|
|
54
|
+
function at(e, t, n, r) {
|
|
55
55
|
var i = this, a = V(null), o = V(0), s = V(0), c = V(null), l = V([]), u = V(), d = V(), f = V(e), p = V(!0), m = V(), h = V();
|
|
56
56
|
f.current = e;
|
|
57
57
|
var g = typeof window < "u", _ = !t && t !== 0 && g;
|
|
@@ -117,13 +117,13 @@ function it(e, t, n, r) {
|
|
|
117
117
|
};
|
|
118
118
|
}, [b]), w;
|
|
119
119
|
}
|
|
120
|
-
// ../../node_modules/.pnpm/zustand@5.1.0_@types+react@19.3.
|
|
121
|
-
var
|
|
120
|
+
// ../../node_modules/.pnpm/zustand@5.1.0_@types+react@19.3.1_immer@11.2.10_react@19.3.1_use-sync-external-store@1.7.0_react@19.3.1_/node_modules/zustand/esm/vanilla/shallow.mjs
|
|
121
|
+
var ot = (e) => Symbol.iterator in e, st = (e) => "entries" in e, ct = (e, t) => {
|
|
122
122
|
let n = e instanceof Map ? e : new Map(e.entries()), r = t instanceof Map ? t : new Map(t.entries());
|
|
123
123
|
if (n.size !== r.size) return !1;
|
|
124
124
|
for (let [e, t] of n) if (!r.has(e) || !Object.is(t, r.get(e))) return !1;
|
|
125
125
|
return !0;
|
|
126
|
-
},
|
|
126
|
+
}, lt = (e, t) => {
|
|
127
127
|
let n = e[Symbol.iterator](), r = t[Symbol.iterator](), i = n.next(), a = r.next();
|
|
128
128
|
for (; !i.done && !a.done;) {
|
|
129
129
|
if (!Object.is(i.value, a.value)) return !1;
|
|
@@ -131,50 +131,54 @@ var at = (e) => Symbol.iterator in e, ot = (e) => "entries" in e, st = (e, t) =>
|
|
|
131
131
|
}
|
|
132
132
|
return !!i.done && !!a.done;
|
|
133
133
|
};
|
|
134
|
-
function
|
|
135
|
-
return Object.is(e, t) ? !0 : typeof e != "object" || !e || typeof t != "object" || !t || Object.getPrototypeOf(e) !== Object.getPrototypeOf(t) ? !1 :
|
|
134
|
+
function ut(e, t) {
|
|
135
|
+
return Object.is(e, t) ? !0 : typeof e != "object" || !e || typeof t != "object" || !t || Object.getPrototypeOf(e) !== Object.getPrototypeOf(t) ? !1 : ot(e) && ot(t) ? st(e) && st(t) ? ct(e, t) : lt(e, t) : ct({ entries: () => Object.entries(e) }, { entries: () => Object.entries(t) });
|
|
136
136
|
}
|
|
137
|
-
// ../../node_modules/.pnpm/zustand@5.1.0_@types+react@19.3.
|
|
138
|
-
function
|
|
137
|
+
// ../../node_modules/.pnpm/zustand@5.1.0_@types+react@19.3.1_immer@11.2.10_react@19.3.1_use-sync-external-store@1.7.0_react@19.3.1_/node_modules/zustand/esm/react/shallow.mjs
|
|
138
|
+
function Z(e) {
|
|
139
139
|
let t = I.useRef(void 0);
|
|
140
140
|
return (n) => {
|
|
141
141
|
let r = e(n);
|
|
142
|
-
return
|
|
142
|
+
return ut(t.current, r) ? t.current : t.current = r;
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
145
|
// src/components/ui/Table/TableCellAsyncContent.tsx
|
|
146
|
-
var
|
|
146
|
+
var dt = ({ content: e }) => {
|
|
147
147
|
let [t, n] = H(null);
|
|
148
148
|
return z(() => {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
let t = !0;
|
|
150
|
+
return (async () => {
|
|
151
|
+
let r = e instanceof Promise ? await e : e;
|
|
152
|
+
t && n(r);
|
|
153
|
+
})(), () => {
|
|
154
|
+
t = !1;
|
|
155
|
+
};
|
|
152
156
|
}, [e]), /* @__PURE__ */ W(U, { children: t });
|
|
153
157
|
};
|
|
154
158
|
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
155
|
-
function
|
|
159
|
+
function ft(e) {
|
|
156
160
|
var t, n, r = "";
|
|
157
161
|
if (typeof e == "string" || typeof e == "number") r += e;
|
|
158
162
|
else if (typeof e == "object") {
|
|
159
163
|
if (Array.isArray(e)) {
|
|
160
164
|
var i = e.length;
|
|
161
|
-
for (t = 0; t < i; t++) e[t] && (n =
|
|
165
|
+
for (t = 0; t < i; t++) e[t] && (n = ft(e[t])) && (r && (r += " "), r += n);
|
|
162
166
|
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
163
167
|
}
|
|
164
168
|
return r;
|
|
165
169
|
}
|
|
166
|
-
function
|
|
167
|
-
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t =
|
|
170
|
+
function pt() {
|
|
171
|
+
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = ft(e)) && (r && (r += " "), r += t);
|
|
168
172
|
return r;
|
|
169
173
|
}
|
|
170
174
|
// src/components/ui/Table/TableFilter.tsx
|
|
171
|
-
var
|
|
175
|
+
var mt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
172
176
|
var n = f(), r = y();
|
|
173
177
|
function i(e) {
|
|
174
178
|
return e && e.length ? n(e, r) : 0;
|
|
175
179
|
}
|
|
176
180
|
t.exports = i;
|
|
177
|
-
})))(), 1),
|
|
181
|
+
})))(), 1), ht = ({ filter: e }) => {
|
|
178
182
|
let { field: t } = Oe({
|
|
179
183
|
defaultValue: e.includeMissingValues,
|
|
180
184
|
name: e.includeMissingValuesFormFieldName
|
|
@@ -201,7 +205,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
201
205
|
})
|
|
202
206
|
})
|
|
203
207
|
] });
|
|
204
|
-
},
|
|
208
|
+
}, gt = ({ filter: e, onFilterChange: t }) => {
|
|
205
209
|
let n = v(), { t: r } = K(), i = m(n, (e) => e.setFilterValue), a = m(n, (e) => e.showMissingValuesFilter), o = e.includeMissingValuesFormFieldName, s = B(() => ({
|
|
206
210
|
[e.id]: e.initialFilterValue,
|
|
207
211
|
...a ? { [o]: !1 } : {}
|
|
@@ -248,7 +252,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
248
252
|
id: "Filters",
|
|
249
253
|
onSubmit: d(f),
|
|
250
254
|
sx: { minWidth: "400px" },
|
|
251
|
-
children: [/* @__PURE__ */ W(
|
|
255
|
+
children: [/* @__PURE__ */ W(ht, { filter: e }), /* @__PURE__ */ G(j, {
|
|
252
256
|
sx: {
|
|
253
257
|
display: "flex",
|
|
254
258
|
gap: 1,
|
|
@@ -268,8 +272,8 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
268
272
|
})]
|
|
269
273
|
})
|
|
270
274
|
});
|
|
271
|
-
},
|
|
272
|
-
let C = me(), w = v(), T = m(w,
|
|
275
|
+
}, _t = {}, vt = ({ ariaSort: e, backgroundColor: t, canDrag: n, children: r, className: i, column: a, columnIndex: o, enabled: s, height: c, onClick: l, onCustomDrag: u, order: d, ref: f, role: p, row: h, rowIndex: g, sx: _, tabIndex: y, title: b, width: x, xOffset: S }) => {
|
|
276
|
+
let C = me(), w = v(), T = m(w, Z((e) => e.dataContext)), E = R((e) => {
|
|
273
277
|
l({
|
|
274
278
|
dataContext: T,
|
|
275
279
|
id: a.id,
|
|
@@ -331,8 +335,10 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
331
335
|
a
|
|
332
336
|
]), k = !a.frozen, te = R(() => {
|
|
333
337
|
let e = a.frozen === D.LEFT, n = a.frozen === D.RIGHT, r = e || n, i;
|
|
334
|
-
return t && (
|
|
335
|
-
"*": t ?? {
|
|
338
|
+
return t && (_t[t] ? i = _t[t] : (i = C.palette.getContrastText(t), _t[t] = i)), {
|
|
339
|
+
"*": t ?? {
|
|
340
|
+
/* v8 ignore next -- color is only set when backgroundColor is set, and then this object is not used, so the truthy arm is unreachable */
|
|
341
|
+
color: i ? `${i} !important` : void 0 },
|
|
336
342
|
background: r ? C.palette.background.paper : t,
|
|
337
343
|
boxSizing: "border-box",
|
|
338
344
|
color: i,
|
|
@@ -379,14 +385,14 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
379
385
|
title: b,
|
|
380
386
|
children: r
|
|
381
387
|
});
|
|
382
|
-
},
|
|
388
|
+
}, Q = {
|
|
383
389
|
columnDivider: "GENEPIX-TableHeaderCell-columnDivider",
|
|
384
390
|
content: "GENEPIX-TableHeaderCell-content",
|
|
385
391
|
customHeaderIcon: "GENEPIX-TableHeaderCell-customHeaderIcon",
|
|
386
392
|
filterLabelIcon: "GENEPIX-TableHeaderCell-filterLabelIcon",
|
|
387
393
|
root: "GENEPIX-TableHeaderCell",
|
|
388
394
|
sortLabelIcon: "GENEPIX-TableHeaderCell-sortLabelIcon"
|
|
389
|
-
},
|
|
395
|
+
}, $ = 18, yt = `${Q.root}--focus`, bt = pe(N, { name: "GENEPIX-TableSortLabelIcon" })(({ ownerState: e, theme: t }) => ({
|
|
390
396
|
"&:hover": {
|
|
391
397
|
color: t.palette.primary.main,
|
|
392
398
|
opacity: "1 !important"
|
|
@@ -397,38 +403,38 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
397
403
|
},
|
|
398
404
|
color: t.palette.text.primary,
|
|
399
405
|
display: "none",
|
|
400
|
-
fontSize:
|
|
401
|
-
height: `${
|
|
406
|
+
fontSize: $,
|
|
407
|
+
height: `${$}px`,
|
|
402
408
|
opacity: 0,
|
|
403
409
|
padding: 0,
|
|
404
410
|
userSelect: "none",
|
|
405
|
-
width: `${
|
|
411
|
+
width: `${$}px`
|
|
406
412
|
})), xt = pe(N, { name: "GENEPIX-TableCustomHeaderIcon" })(({ theme: e }) => ({
|
|
407
413
|
"&:hover": {
|
|
408
414
|
color: e.palette.primary.main,
|
|
409
415
|
opacity: "1 !important"
|
|
410
416
|
},
|
|
411
417
|
display: "none",
|
|
412
|
-
fontSize:
|
|
413
|
-
height: `${
|
|
418
|
+
fontSize: $,
|
|
419
|
+
height: `${$}px`,
|
|
414
420
|
opacity: 0,
|
|
415
421
|
padding: 0,
|
|
416
422
|
userSelect: "none",
|
|
417
|
-
width: `${
|
|
423
|
+
width: `${$}px`
|
|
418
424
|
})), St = pe(N, { name: "GENEPIX-TableFilterLabelIcon" })(({ theme: e }) => ({
|
|
419
425
|
"&:hover": {
|
|
420
426
|
color: e.palette.primary.main,
|
|
421
427
|
opacity: "1 !important"
|
|
422
428
|
},
|
|
423
429
|
display: "none",
|
|
424
|
-
fontSize:
|
|
425
|
-
height: `${
|
|
430
|
+
fontSize: $,
|
|
431
|
+
height: `${$}px`,
|
|
426
432
|
opacity: 0,
|
|
427
433
|
padding: 0,
|
|
428
434
|
userSelect: "none",
|
|
429
|
-
width: `${
|
|
435
|
+
width: `${$}px`
|
|
430
436
|
})), Ct = (e) => {
|
|
431
|
-
let { t } = K(), n = me(), r = v(), i = m(r, (e) => e.sortByField), a = m(r, (e) => e.dataContext), o = m(r, (e) => e.sortDirection), s = m(r, (e) => e.setSorting), c = m(r, (e) => e.filters), l = V(null), u = ye(), [d, f] = H(), p = V(null), h = V(null), { column: g, columnIndex: _, dividerColor: y, height: b, onColumnDividerKeyDown: x, onColumnDividerMouseDown: S, onCustomDrag: C, order: w, width: T, xOffset: E } = e, D = V(!1), O = R((e) => g.frozen || e.button !== 0 ? !1 : e.nativeEvent.target.classList.contains(
|
|
437
|
+
let { t } = K(), n = me(), r = v(), i = m(r, (e) => e.sortByField), a = m(r, (e) => e.dataContext), o = m(r, (e) => e.sortDirection), s = m(r, (e) => e.setSorting), c = m(r, (e) => e.filters), l = V(null), u = ye(), [d, f] = H(), p = V(null), h = V(null), { column: g, columnIndex: _, dividerColor: y, height: b, onColumnDividerKeyDown: x, onColumnDividerMouseDown: S, onCustomDrag: C, order: w, width: T, xOffset: E } = e, D = V(!1), O = R((e) => g.frozen || e.button !== 0 ? !1 : e.nativeEvent.target.classList.contains(Q.content), [g.frozen]), ee = R((e, t) => {
|
|
432
438
|
C && (e.type === "start" && (D.current = !0), C(e, t));
|
|
433
439
|
}, [C]), k = R(async () => {
|
|
434
440
|
i === g.id ? await s(g.id, o === "asc" ? "desc" : "asc") : await s(g.id, "asc");
|
|
@@ -458,17 +464,17 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
458
464
|
f(null), setTimeout(() => {
|
|
459
465
|
p.current.classList.add(yt), p.current?.focus(), h.current?.focus();
|
|
460
466
|
});
|
|
461
|
-
}, []), le = i === g.id, ue = { direction: i === g.id ? o : "asc" }, de =
|
|
467
|
+
}, []), le = i === g.id, ue = { direction: i === g.id ? o : "asc" }, de = pt(Q.sortLabelIcon, { [`${Q.sortLabelIcon}--active`]: le }), fe = pt(Q.filterLabelIcon, { [`${Q.filterLabelIcon}--active`]: N }), pe = !!g.customHeaderIcon, he = !!g.comparatorFactory, I = !!M, ge = he || I || pe ? 0 : -1, L = +n.spacing(2).replace("px", ""), _e = B(() => {
|
|
462
468
|
if (i === g.id) return o === "asc" ? "ascending" : "descending";
|
|
463
469
|
}, [
|
|
464
470
|
g.id,
|
|
465
471
|
i,
|
|
466
472
|
o
|
|
467
473
|
]);
|
|
468
|
-
return /* @__PURE__ */ G(
|
|
474
|
+
return /* @__PURE__ */ G(vt, {
|
|
469
475
|
ariaSort: _e,
|
|
470
476
|
canDrag: O,
|
|
471
|
-
className:
|
|
477
|
+
className: pt(Q.root, { [yt]: !!d }),
|
|
472
478
|
column: g,
|
|
473
479
|
columnIndex: _,
|
|
474
480
|
height: b,
|
|
@@ -477,15 +483,15 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
477
483
|
ref: p,
|
|
478
484
|
role: "columnheader",
|
|
479
485
|
sx: {
|
|
480
|
-
[`.${
|
|
481
|
-
[`.${
|
|
486
|
+
[`.${Q.filterLabelIcon}--active`]: { color: n.palette.secondary.main },
|
|
487
|
+
[`.${Q.sortLabelIcon}--active, .${Q.filterLabelIcon}--active`]: {
|
|
482
488
|
display: "inline-block",
|
|
483
489
|
opacity: "1 !important"
|
|
484
490
|
},
|
|
485
|
-
[`.${
|
|
491
|
+
[`.${Q.sortLabelIcon}--active`]: { color: n.palette.text.secondary },
|
|
486
492
|
[`&:hover, &:focus-visible, &:focus, &:focus-within, &.${yt}`]: {
|
|
487
|
-
[`.${
|
|
488
|
-
[`.${
|
|
493
|
+
[`.${Q.columnDivider}`]: { opacity: 1 },
|
|
494
|
+
[`.${Q.sortLabelIcon}, .${Q.filterLabelIcon}, .${Q.customHeaderIcon}`]: {
|
|
489
495
|
display: "inline-block",
|
|
490
496
|
opacity: .5
|
|
491
497
|
}
|
|
@@ -500,12 +506,12 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
500
506
|
width: T,
|
|
501
507
|
xOffset: E,
|
|
502
508
|
children: [g.type === "actions" && /* @__PURE__ */ W(j, {
|
|
503
|
-
className:
|
|
509
|
+
className: Q.content,
|
|
504
510
|
sx: we,
|
|
505
511
|
children: t`Actions`
|
|
506
512
|
}), g.type !== "actions" && /* @__PURE__ */ G(j, {
|
|
507
513
|
sx: {
|
|
508
|
-
[`&:hover .${
|
|
514
|
+
[`&:hover .${Q.content}`]: { maxWidth: `calc(100% + 16px - ${(0, mt.default)([
|
|
509
515
|
pe ? L : 0,
|
|
510
516
|
I ? L : 0,
|
|
511
517
|
he ? L : 0,
|
|
@@ -524,13 +530,13 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
524
530
|
placement: "top",
|
|
525
531
|
title: g.headerTooltipContent,
|
|
526
532
|
children: /* @__PURE__ */ W(j, {
|
|
527
|
-
className:
|
|
533
|
+
className: Q.content,
|
|
528
534
|
onClick: te,
|
|
529
535
|
ref: l,
|
|
530
536
|
sx: {
|
|
531
537
|
cursor: "pointer",
|
|
532
538
|
flexGrow: 1,
|
|
533
|
-
maxWidth: `calc(100% + 16px - ${(0,
|
|
539
|
+
maxWidth: `calc(100% + 16px - ${(0, mt.default)([
|
|
534
540
|
le ? L : 0,
|
|
535
541
|
N ? L : 0,
|
|
536
542
|
L
|
|
@@ -546,7 +552,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
546
552
|
})
|
|
547
553
|
}),
|
|
548
554
|
pe && /* @__PURE__ */ W(xt, {
|
|
549
|
-
className:
|
|
555
|
+
className: Q.customHeaderIcon,
|
|
550
556
|
onClick: P,
|
|
551
557
|
tabIndex: 0,
|
|
552
558
|
title: g.customHeaderIcon?.label,
|
|
@@ -577,7 +583,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
577
583
|
elevation: 4,
|
|
578
584
|
square: !0,
|
|
579
585
|
sx: { padding: n.spacing(3) },
|
|
580
|
-
children: /* @__PURE__ */ W(
|
|
586
|
+
children: /* @__PURE__ */ W(gt, {
|
|
581
587
|
filter: M,
|
|
582
588
|
onFilterChange: re
|
|
583
589
|
})
|
|
@@ -593,7 +599,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
593
599
|
}) }),
|
|
594
600
|
g.resizable !== !1 && /* @__PURE__ */ W(j, {
|
|
595
601
|
"aria-label": t("Resize column {{name}}, use arrow keys to adjust the size.", { name: g.headerName || t("unknown") }),
|
|
596
|
-
className:
|
|
602
|
+
className: Q.columnDivider,
|
|
597
603
|
onKeyDown: ae,
|
|
598
604
|
onMouseDown: ie,
|
|
599
605
|
role: "separator",
|
|
@@ -621,7 +627,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
621
627
|
})]
|
|
622
628
|
}, g.id);
|
|
623
629
|
}, wt = (e) => {
|
|
624
|
-
let t = v(), n = m(t,
|
|
630
|
+
let t = v(), n = m(t, Z((e) => e.dataContext)), [r, i] = H(null), { t: a } = K(), o = !!r, s = R((e) => {
|
|
625
631
|
i(e.currentTarget);
|
|
626
632
|
}, []), c = R(() => {
|
|
627
633
|
i(null);
|
|
@@ -636,7 +642,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
636
642
|
e.row,
|
|
637
643
|
e.rowIndex
|
|
638
644
|
]), u = R(() => {}, []);
|
|
639
|
-
return /* @__PURE__ */ W(
|
|
645
|
+
return /* @__PURE__ */ W(vt, {
|
|
640
646
|
...e,
|
|
641
647
|
onClick: u,
|
|
642
648
|
children: l.length > 0 && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(N, {
|
|
@@ -660,7 +666,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
660
666
|
})] })
|
|
661
667
|
}, e.column.id);
|
|
662
668
|
}, Tt = ({ children: e }) => {
|
|
663
|
-
let t = B(() => ({ sideEffects:
|
|
669
|
+
let t = B(() => ({ sideEffects: Y({ styles: { active: { opacity: "1" } } }) }), []);
|
|
664
670
|
return /* @__PURE__ */ W(Pe, {
|
|
665
671
|
...q.createAttributes("SortableOverlay"),
|
|
666
672
|
dropAnimation: t,
|
|
@@ -679,7 +685,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
679
685
|
children: t
|
|
680
686
|
});
|
|
681
687
|
}, Ot = ({ children: e, id: t, sx: n }) => {
|
|
682
|
-
let r = me(), { attributes: i, isDragging: a, listeners: o, setActivatorNodeRef: s, setNodeRef: c, transform: l, transition: u } =
|
|
688
|
+
let r = me(), { attributes: i, isDragging: a, listeners: o, setActivatorNodeRef: s, setNodeRef: c, transform: l, transition: u } = He({ id: t }), d = B(() => ({
|
|
683
689
|
attributes: i,
|
|
684
690
|
listeners: o,
|
|
685
691
|
ref: s
|
|
@@ -688,7 +694,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
688
694
|
o,
|
|
689
695
|
s
|
|
690
696
|
]), f = {
|
|
691
|
-
transform:
|
|
697
|
+
transform: Ue.Translate.toString(l),
|
|
692
698
|
transition: u
|
|
693
699
|
};
|
|
694
700
|
return /* @__PURE__ */ W(Dt, {
|
|
@@ -748,21 +754,22 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
748
754
|
touchAction: "none"
|
|
749
755
|
},
|
|
750
756
|
type: "button",
|
|
751
|
-
children: /* @__PURE__ */ W(
|
|
757
|
+
children: /* @__PURE__ */ W(We, {})
|
|
752
758
|
});
|
|
753
759
|
}, At = ({ items: e, onChange: t, renderHeaderContent: n, renderItemContent: r }) => {
|
|
754
|
-
let i = me(), { t: a } = K(), [o, s] = H(null), c = B(() => e.find((e) => e.id === o?.id), [o, e]), l = R((t) => e.find((e) => e.id === t), [e]), u = R((t) => e.findIndex((e) => e.id === t) + 1, [e]), d = Le(
|
|
760
|
+
let i = me(), { t: a } = K(), [o, s] = H(null), c = B(() => e.find((e) => e.id === o?.id), [o, e]), l = R((t) => e.find((e) => e.id === t), [e]), u = R((t) => e.findIndex((e) => e.id === t) + 1, [e]), d = Re(Le(Ie), Le(Fe, { coordinateGetter: Ve })), f = R(() => {
|
|
755
761
|
s(null);
|
|
756
762
|
}, []), p = R(({ active: n, over: r }) => {
|
|
757
763
|
if (r && n.id !== r?.id) {
|
|
758
764
|
let i = e.findIndex(({ id: e }) => e === n.id), a = e.findIndex(({ id: e }) => e === r.id);
|
|
759
|
-
t(
|
|
765
|
+
t(Be(e, i, a));
|
|
760
766
|
}
|
|
761
767
|
s(null);
|
|
762
768
|
}, [e, t]), m = R(({ active: e }) => {
|
|
763
769
|
s(e);
|
|
764
770
|
}, []), h = R((n) => {
|
|
765
771
|
let r = n.target.getAttribute("data-id");
|
|
772
|
+
/* v8 ignore next 3 -- the checkbox input always receives data-id from slotProps */
|
|
766
773
|
if (r === null) return;
|
|
767
774
|
let i = n.target.checked;
|
|
768
775
|
t(e.map((e) => String(e.id) === r ? {
|
|
@@ -806,7 +813,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
806
813
|
a,
|
|
807
814
|
i
|
|
808
815
|
]);
|
|
809
|
-
return /* @__PURE__ */ G(
|
|
816
|
+
return /* @__PURE__ */ G(J, {
|
|
810
817
|
accessibility: {
|
|
811
818
|
announcements: {
|
|
812
819
|
onDragCancel: ({ active: t }) => {
|
|
@@ -839,6 +846,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
839
846
|
},
|
|
840
847
|
onDragStart: ({ active: t }) => {
|
|
841
848
|
let n = l(t.id);
|
|
849
|
+
/* v8 ignore next 3 -- drags only start from handles rendered for the current items */
|
|
842
850
|
if (n) return a("Picked up {{label}}. Position {{position}} of {{count}}.", {
|
|
843
851
|
count: e.length,
|
|
844
852
|
label: n.label,
|
|
@@ -882,7 +890,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
882
890
|
role: "columnheader"
|
|
883
891
|
})
|
|
884
892
|
]
|
|
885
|
-
}), /* @__PURE__ */ W(
|
|
893
|
+
}), /* @__PURE__ */ W(ze, {
|
|
886
894
|
items: e,
|
|
887
895
|
children: /* @__PURE__ */ W(j, {
|
|
888
896
|
...q.createAttributes("SortableList"),
|
|
@@ -899,8 +907,8 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
899
907
|
})]
|
|
900
908
|
}), /* @__PURE__ */ W(Tt, { children: c ? g(c) : null })]
|
|
901
909
|
});
|
|
902
|
-
}, jt =
|
|
903
|
-
let { t: o } = K(), [s, c] = H([]), l = v(), u = m(l,
|
|
910
|
+
}, jt = Ne(({ onActionsChange: e, onClose: t, onTitleChange: n, openProps: { hasCellData: r }, renderHeaderContent: i, renderItemContent: a }) => {
|
|
911
|
+
let { t: o } = K(), [s, c] = H([]), l = v(), u = m(l, Z((e) => e.emitEvent)), d = m(l, Z((e) => e.dataContext)), f = m(l, Z((e) => e.getCurrentColumnVisualSettings())), h = m(l, Z((e) => e.columns)), g = m(l, Z((e) => e.sortedData)), _ = B(() => {
|
|
904
912
|
let e = /* @__PURE__ */ new Map();
|
|
905
913
|
return h.forEach((t) => {
|
|
906
914
|
e.set(t.id, t);
|
|
@@ -1066,7 +1074,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1066
1074
|
noCloseButton: !1,
|
|
1067
1075
|
testId: "TableColumnOrderDialog"
|
|
1068
1076
|
}), Mt = ({ cell: e, onCheckBoxClick: t, tableColumn: n }) => {
|
|
1069
|
-
let { t: r } = K(), i = v(), a = m(i,
|
|
1077
|
+
let { t: r } = K(), i = v(), a = m(i, Z((e) => e.idSelectorCallback)), o = m(i, Z((e) => e.selectedIds)), s = m(i, Z((e) => e.setSelectedIds)), c = a(e.row), l = R((e) => {
|
|
1070
1078
|
e.stopPropagation(), e.shiftKey && e.preventDefault(), t(e, c);
|
|
1071
1079
|
}, [t, c]), u = R((e, t) => {
|
|
1072
1080
|
let n = e.target.getAttribute("name");
|
|
@@ -1085,7 +1093,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1085
1093
|
}
|
|
1086
1094
|
});
|
|
1087
1095
|
}, Nt = /* @__PURE__ */ e(l(), 1), Pt = ({ tableColumnParams: e }) => {
|
|
1088
|
-
let { t } = K(), n = e.column, r = v(), i = m(r,
|
|
1096
|
+
let { t } = K(), n = e.column, r = v(), i = m(r, Z((e) => e.dataContext)), a = m(r, Z((e) => e.idSelectorCallback)), o = m(r, Z((e) => e.selectedIds)), s = m(r, Z((e) => e.sortedData)), c = m(r, Z((e) => e.setSelectedIds)), l = n.isDisabled ? s.filter((e) => n.isDisabled({
|
|
1089
1097
|
dataContext: i,
|
|
1090
1098
|
id: a(e),
|
|
1091
1099
|
row: e,
|
|
@@ -1102,7 +1110,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1102
1110
|
]);
|
|
1103
1111
|
return /* @__PURE__ */ W(ie, {
|
|
1104
1112
|
checked: d,
|
|
1105
|
-
checkedIcon: u ? void 0 : /* @__PURE__ */ W(
|
|
1113
|
+
checkedIcon: u ? void 0 : /* @__PURE__ */ W(X, {}),
|
|
1106
1114
|
name: "select-all",
|
|
1107
1115
|
onChange: f,
|
|
1108
1116
|
slotProps: { input: { "aria-label": t`Select all` } },
|
|
@@ -1113,6 +1121,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1113
1121
|
});
|
|
1114
1122
|
}, Ft = ({ cell: e, getRowName: t, onReadableIndexClick: n, tableColumn: r }) => {
|
|
1115
1123
|
let i = g(), a = R((r) => {
|
|
1124
|
+
/* v8 ignore next -- onClick is only attached to the button rendered when onReadableIndexClick is set */
|
|
1116
1125
|
if (n) {
|
|
1117
1126
|
if (!t) throw Error("getRowName is required when onReadableIndexClick is provided");
|
|
1118
1127
|
i.enablePageEvents && te.resolve(h).emit("click", {
|
|
@@ -1140,12 +1149,12 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1140
1149
|
variant: "text",
|
|
1141
1150
|
children: e.rowIndex + 1
|
|
1142
1151
|
}) : e.rowIndex + 1;
|
|
1143
|
-
}, It = ({ font: e, forceHorizontalOverflow: t, getRowName: n, headerHeight: r = 4, initialVisibleItemIndex: i, onRangeChanged: a =
|
|
1152
|
+
}, It = ({ font: e, forceHorizontalOverflow: t, getRowName: n, headerHeight: r = 4, initialVisibleItemIndex: i, onRangeChanged: a = it.default, onReadableIndexClick: o, onRowClick: s, onRowMouseEnter: c = it.default, onRowMouseLeave: l = it.default, onVerticalScrollPositionChange: u, onVisibleItemIndexChange: d, overscanMain: f, overscanReverse: _, ref: y, renderColumnsEditorHeaderContent: b, renderColumnsEditorItemContent: x, rowHeight: S = 4, rowHighlightingSubject: C, sx: w }) => {
|
|
1144
1153
|
let T = me(), E = T.spacing(S), D = +E.replace("px", ""), { t: O } = K(), ee = g(), k = te.resolve(ne), A = v(), { DEFAULT_OVERSCAN_MAIN: re, DEFAULT_OVERSCAN_REVERSE: ie } = ee.table;
|
|
1145
|
-
m(A,
|
|
1146
|
-
let ae = m(A,
|
|
1147
|
-
m(A, (e) => JSON.stringify(e.filters.map((e) => [e.filterValue, e.includeMissingValues]))), m(A,
|
|
1148
|
-
let
|
|
1154
|
+
m(A, Z((e) => e.getCurrentColumnVisualSettings().filter((e) => e.isVisible).map((e) => e.id)));
|
|
1155
|
+
let ae = m(A, Z((e) => e.setCurrentColumnVisualSettings)), M = m(A, Z((e) => e.sortedData)), N = m(A, Z((e) => e.idSelectorCallback)), P = m(A, Z((e) => e.columns)), oe = m(A, Z((e) => e.isInitialized)), se = m(A, Z((e) => e.isRowEnabledCallback)), ce = m(A, Z((e) => e.addEventListener)), F = m(A, Z((e) => e.dataContext)), le = m(A, Z((e) => e.isCondensed)), pe = m(A, Z((e) => e.setSelectedIds)), he = m(A, Z((e) => e.columnDimensions)), I = V(null), L = V(it.default), [ve, ye] = H(!1), we = V(null), Te = B(() => fe(ue(T.palette.divider, 1), .1), [T.palette.divider]), Ee = B(() => de(ue(T.palette.divider, 1), .15), [T.palette.divider]), De = Ce(), Oe = V(null), ke = V(0), Ae = V(null), je = V(/* @__PURE__ */ new Set()), Me = V(!1), Ne = V(null), [J, Pe] = H(), Fe = V(null), Ie = V(null), Y = V(null);
|
|
1156
|
+
m(A, (e) => JSON.stringify(e.filters.map((e) => [e.filterValue, e.includeMissingValues]))), m(A, Z((e) => e.sortByField)), m(A, Z((e) => e.sortDirection));
|
|
1157
|
+
let Le = R((e, t) => {
|
|
1149
1158
|
if (s) {
|
|
1150
1159
|
if (!n) throw Error("getRowName is required when onRowClick is provided");
|
|
1151
1160
|
ee.enablePageEvents && te.resolve(h).emit("click", {
|
|
@@ -1157,103 +1166,104 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1157
1166
|
ee.enablePageEvents,
|
|
1158
1167
|
n,
|
|
1159
1168
|
s
|
|
1160
|
-
]),
|
|
1169
|
+
]), Re = R(() => I?.current?.filter((e) => e.isVisible) ?? [], []), ze = B(() => {
|
|
1161
1170
|
let e = /* @__PURE__ */ new Map();
|
|
1162
1171
|
return P.forEach((t) => {
|
|
1163
1172
|
e.set(t.id, t);
|
|
1164
1173
|
}), e;
|
|
1165
|
-
}, [P]),
|
|
1174
|
+
}, [P]), Be = R(() => {
|
|
1166
1175
|
if (!I?.current?.length || !J) return;
|
|
1167
|
-
let e = (0,
|
|
1168
|
-
|
|
1169
|
-
}, [
|
|
1176
|
+
let e = (0, tt.default)(Re(), (e) => e.calculatedWidth), t = J.querySelector("[role=table]");
|
|
1177
|
+
ke.current = e, t && (t.style.width = `${e}px`);
|
|
1178
|
+
}, [Re, J]);
|
|
1170
1179
|
xe(() => {
|
|
1171
|
-
|
|
1172
|
-
}, [
|
|
1173
|
-
let
|
|
1180
|
+
Be();
|
|
1181
|
+
}, [Be]);
|
|
1182
|
+
let Ve = R((e, t) => /* @__PURE__ */ W(Ft, {
|
|
1174
1183
|
cell: t,
|
|
1175
1184
|
getRowName: n,
|
|
1176
1185
|
onReadableIndexClick: o,
|
|
1177
1186
|
tableColumn: e
|
|
1178
|
-
}, t.id), [n, o]),
|
|
1187
|
+
}, t.id), [n, o]), He = R((e) => /* @__PURE__ */ W(Pt, { tableColumnParams: e }), []);
|
|
1179
1188
|
z(() => {
|
|
1180
|
-
|
|
1189
|
+
Ie.current = null;
|
|
1181
1190
|
}, [M]);
|
|
1182
|
-
let
|
|
1183
|
-
if (!e.shiftKey || !
|
|
1184
|
-
|
|
1191
|
+
let Ue = R((e, t) => {
|
|
1192
|
+
if (!e.shiftKey || !Ie.current) {
|
|
1193
|
+
Ie.current = t;
|
|
1185
1194
|
return;
|
|
1186
1195
|
}
|
|
1187
|
-
let n = M.findIndex((e) => N(e) ===
|
|
1196
|
+
let n = M.findIndex((e) => N(e) === Ie.current), r = M.findIndex((e) => N(e) === t);
|
|
1197
|
+
/* v8 ignore next 3 -- the reset effect on sortedData guarantees the last clicked row is in sortedData, and the clicked row comes from sortedData */
|
|
1188
1198
|
if (n === -1 || r === -1) return;
|
|
1189
1199
|
let [i, a] = n < r ? [n, r] : [r, n], o = M.slice(i, a + 1).map((e) => N(e)), s = A.getState().selectedIds, c = A.getState().selectedIds.includes(t) ? s.filter((e) => !o.includes(e)) : Array.from(/* @__PURE__ */ new Set([...s, ...o]));
|
|
1190
|
-
pe(c),
|
|
1200
|
+
pe(c), Ie.current = t;
|
|
1191
1201
|
}, [
|
|
1192
1202
|
N,
|
|
1193
1203
|
pe,
|
|
1194
1204
|
M,
|
|
1195
1205
|
A
|
|
1196
|
-
]),
|
|
1206
|
+
]), We = R((e, t) => {
|
|
1197
1207
|
let n = N(t.row);
|
|
1198
1208
|
return /* @__PURE__ */ W(Mt, {
|
|
1199
1209
|
cell: t,
|
|
1200
|
-
onCheckBoxClick:
|
|
1210
|
+
onCheckBoxClick: Ue,
|
|
1201
1211
|
tableColumn: e
|
|
1202
1212
|
}, n);
|
|
1203
|
-
}, [N,
|
|
1213
|
+
}, [N, Ue]), X = R(() => {
|
|
1204
1214
|
if (!P.length || !J) return;
|
|
1205
|
-
let e = p.updateColumnSizesInVisualSettings(J,
|
|
1215
|
+
let e = p.updateColumnSizesInVisualSettings(J, De, M, P, I.current);
|
|
1206
1216
|
ve && (J.querySelectorAll("[data-column-index]").forEach((t) => {
|
|
1207
1217
|
let n = t.getAttribute("data-id");
|
|
1208
1218
|
t.style.width = `${e.get(n).calculatedWidth}px`;
|
|
1209
|
-
}),
|
|
1219
|
+
}), Be());
|
|
1210
1220
|
}, [
|
|
1211
1221
|
ve,
|
|
1212
|
-
|
|
1222
|
+
De,
|
|
1213
1223
|
M,
|
|
1214
1224
|
P,
|
|
1215
1225
|
J,
|
|
1216
|
-
|
|
1226
|
+
Be
|
|
1217
1227
|
]);
|
|
1218
1228
|
z(() => {
|
|
1219
|
-
J && !ve && oe && (I.current = A.getState().getCurrentColumnVisualSettings(),
|
|
1229
|
+
J && !ve && oe && (I.current = A.getState().getCurrentColumnVisualSettings(), X(), Be(), ye(!0));
|
|
1220
1230
|
}, [
|
|
1221
1231
|
ve,
|
|
1222
1232
|
oe,
|
|
1223
1233
|
J,
|
|
1224
1234
|
A,
|
|
1225
|
-
|
|
1226
|
-
|
|
1235
|
+
X,
|
|
1236
|
+
Be
|
|
1227
1237
|
]);
|
|
1228
|
-
let
|
|
1229
|
-
ae(I.current);
|
|
1230
|
-
}, [ae]),
|
|
1231
|
-
|
|
1232
|
-
}, 500, { trailing: !0 }),
|
|
1233
|
-
e.calculatedWidth = t, e.widthPx = t, e.hasResized = !0,
|
|
1234
|
-
}, [
|
|
1238
|
+
let Ge = R(() => J?.querySelector("[data-virtuoso-scroller=true]"), [J]), Ke = R(() => {
|
|
1239
|
+
ae(I.current.map((e) => ({ ...e })));
|
|
1240
|
+
}, [ae]), qe = at(() => {
|
|
1241
|
+
Ke();
|
|
1242
|
+
}, 500, { trailing: !0 }), Je = R((e, t) => {
|
|
1243
|
+
e.calculatedWidth = t, e.widthPx = t, e.hasResized = !0, X(), qe();
|
|
1244
|
+
}, [X, qe]), Ye = R((e, t) => {
|
|
1235
1245
|
if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
|
|
1236
1246
|
e.preventDefault();
|
|
1237
1247
|
let n = I.current.find((e) => e.id === t.id), r = n.calculatedWidth, i = e.key === "ArrowLeft" ? Math.max(50, r - 10) : r + 10;
|
|
1238
|
-
|
|
1239
|
-
}, [
|
|
1248
|
+
Je(n, i);
|
|
1249
|
+
}, [Je]), Xe = R((e, t) => {
|
|
1240
1250
|
e.preventDefault();
|
|
1241
1251
|
let n = I.current.find((e) => e.id === t.id), r = e.clientX, i = n?.calculatedWidth, a = (e) => {
|
|
1242
1252
|
let t = e.clientX;
|
|
1243
1253
|
if (r === t) return;
|
|
1244
1254
|
let a = t - r, o = Math.max(50, i + a);
|
|
1245
|
-
i !== o &&
|
|
1255
|
+
i !== o && Je(n, o);
|
|
1246
1256
|
}, o = (e) => {
|
|
1247
|
-
L.current(), L.current =
|
|
1257
|
+
L.current(), L.current = it.default;
|
|
1248
1258
|
};
|
|
1249
1259
|
document.addEventListener("mousemove", a), document.addEventListener("mouseup", o), L.current = () => {
|
|
1250
1260
|
document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", o);
|
|
1251
1261
|
};
|
|
1252
|
-
}, [
|
|
1262
|
+
}, [Je]);
|
|
1253
1263
|
z(() => () => {
|
|
1254
1264
|
L.current();
|
|
1255
1265
|
}, []);
|
|
1256
|
-
let
|
|
1266
|
+
let Ze = R((e, t) => p.handleMoveColumn(he, I.current, P, e, t), [he, P]), Qe = R(() => {
|
|
1257
1267
|
J.querySelectorAll("[data-column-index]").forEach((e) => {
|
|
1258
1268
|
let t = e.getAttribute("data-id");
|
|
1259
1269
|
e.style.order = I.current.findIndex((e) => e.id === t).toString();
|
|
@@ -1261,29 +1271,32 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1261
1271
|
}, [J]);
|
|
1262
1272
|
z(() => {
|
|
1263
1273
|
let e = () => {
|
|
1264
|
-
|
|
1274
|
+
X(), Qe();
|
|
1265
1275
|
};
|
|
1266
1276
|
return k.window.addEventListener("resize", e), () => {
|
|
1267
1277
|
k.window.removeEventListener("resize", e);
|
|
1268
1278
|
};
|
|
1269
1279
|
}, [
|
|
1270
|
-
|
|
1271
|
-
|
|
1280
|
+
Qe,
|
|
1281
|
+
X,
|
|
1272
1282
|
k.window
|
|
1273
1283
|
]);
|
|
1274
|
-
let
|
|
1275
|
-
let t =
|
|
1284
|
+
let $e = R((e) => {
|
|
1285
|
+
let t = Re();
|
|
1276
1286
|
return {
|
|
1277
1287
|
elementIndex: t.findIndex((t) => t.id === e.id),
|
|
1278
1288
|
visibleTableSettingsColumns: t,
|
|
1279
1289
|
widths: t.map((e) => e.calculatedWidth)
|
|
1280
1290
|
};
|
|
1281
|
-
}, [
|
|
1282
|
-
let n =
|
|
1283
|
-
|
|
1291
|
+
}, [Re]), et = R((e, t) => {
|
|
1292
|
+
let n = k.body, r = k.document;
|
|
1293
|
+
/* v8 ignore next 3 -- a browser window always has a document with a body, so this guard cannot be reached */
|
|
1294
|
+
if (!n || !r) throw Error("Cannot handle table column dragging without a document body.");
|
|
1295
|
+
let i = $e(t);
|
|
1296
|
+
if (e.type === "start" && (n.style.setProperty("overflow", "hidden"), J?.style.setProperty("--selection-background", "none"), e.target.style.setProperty("opacity", "0.3"), Y.current = {
|
|
1284
1297
|
clonedElement: e.target.cloneNode(!0),
|
|
1285
|
-
elementOffsetX:
|
|
1286
|
-
scrollPosition:
|
|
1298
|
+
elementOffsetX: i.widths.slice(0, i.elementIndex).reduce((e, t) => e + t, 0) - 15,
|
|
1299
|
+
scrollPosition: Ge().scrollLeft
|
|
1287
1300
|
}, Y.current.clonedElement.style.cssText = `
|
|
1288
1301
|
font-weight: bold;
|
|
1289
1302
|
position: absolute;
|
|
@@ -1293,45 +1306,46 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1293
1306
|
pointer-events: none;
|
|
1294
1307
|
filter: blur(0.5px);
|
|
1295
1308
|
box-shadow: 1px 2px 3px 0px rgba(0,0,0,0.5);
|
|
1296
|
-
`,
|
|
1309
|
+
`, n.appendChild(Y.current.clonedElement), we.current?.style.setProperty("pointer-events", "none")), e.type === "end" && (we.current?.style.removeProperty("pointer-events"), n.style.removeProperty("overflow"), J?.style.setProperty("--selection-background", "highlight"), r.getSelection().empty(), Y.current.clonedElement.remove(), e.target.style.setProperty("opacity", "1")), e.type === "move") {
|
|
1297
1310
|
Y.current.clonedElement.style.setProperty("left", `${e.clientX - e.elementOffsetX}px`), Y.current.clonedElement.style.setProperty("top", `${e.clientY}px`);
|
|
1298
|
-
let
|
|
1299
|
-
(
|
|
1311
|
+
let n = Y.current.elementOffsetX + e.deltaX + e.elementOffsetX + (Ge().scrollLeft - Y.current.scrollPosition), r = i.widths.slice(0, i.elementIndex - 1).reduce((e, t) => e + t, 0) + Math.min(16, i.widths?.[i.elementIndex - 1] ?? Infinity), a = i.widths.slice(0, i.elementIndex + 1).reduce((e, t) => e + t, 0) + Math.min(16, i.widths?.[i.elementIndex + 1] ?? Infinity);
|
|
1312
|
+
(n < r && Ze(t, -1) || n > a && Ze(t, 1)) && (Qe(), $e(t));
|
|
1300
1313
|
}
|
|
1301
1314
|
}, [
|
|
1315
|
+
$e,
|
|
1316
|
+
Ge,
|
|
1302
1317
|
Ze,
|
|
1303
|
-
Ue,
|
|
1304
|
-
Ye,
|
|
1305
1318
|
J?.style,
|
|
1306
1319
|
T.zIndex.modal,
|
|
1307
|
-
|
|
1320
|
+
Qe,
|
|
1308
1321
|
k.body,
|
|
1309
1322
|
k.document
|
|
1310
|
-
]),
|
|
1323
|
+
]), ot = R(() => /* @__PURE__ */ W(j, {
|
|
1311
1324
|
"aria-rowindex": 1,
|
|
1325
|
+
ref: we,
|
|
1312
1326
|
role: "row",
|
|
1313
1327
|
sx: {
|
|
1314
|
-
[`&:hover .${
|
|
1328
|
+
[`&:hover .${Q.columnDivider}`]: { opacity: 1 },
|
|
1315
1329
|
background: T.palette.background.paper,
|
|
1316
|
-
borderBottom: `1px solid ${
|
|
1330
|
+
borderBottom: `1px solid ${Ee}`,
|
|
1317
1331
|
display: "flex",
|
|
1318
1332
|
fontWeight: "bold",
|
|
1319
1333
|
height: T.spacing(r),
|
|
1320
1334
|
zIndex: 3
|
|
1321
1335
|
},
|
|
1322
|
-
children:
|
|
1323
|
-
let n =
|
|
1336
|
+
children: Re().map((e, t) => {
|
|
1337
|
+
let n = ze.get(e.id);
|
|
1324
1338
|
return n ? /* @__PURE__ */ W(Ct, {
|
|
1325
1339
|
column: n.type === "selectable" ? {
|
|
1326
1340
|
...n,
|
|
1327
|
-
renderHeaderContent:
|
|
1341
|
+
renderHeaderContent: He
|
|
1328
1342
|
} : n,
|
|
1329
1343
|
columnIndex: t,
|
|
1330
|
-
dividerColor:
|
|
1344
|
+
dividerColor: Ee,
|
|
1331
1345
|
height: T.spacing(r),
|
|
1332
|
-
onColumnDividerKeyDown:
|
|
1333
|
-
onColumnDividerMouseDown:
|
|
1334
|
-
onCustomDrag:
|
|
1346
|
+
onColumnDividerKeyDown: Ye,
|
|
1347
|
+
onColumnDividerMouseDown: Xe,
|
|
1348
|
+
onCustomDrag: et,
|
|
1335
1349
|
order: t,
|
|
1336
1350
|
role: "columnheader",
|
|
1337
1351
|
width: e.calculatedWidth,
|
|
@@ -1341,17 +1355,17 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1341
1355
|
}), [
|
|
1342
1356
|
T,
|
|
1343
1357
|
r,
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
Le,
|
|
1358
|
+
Ee,
|
|
1359
|
+
Re,
|
|
1347
1360
|
ze,
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1361
|
+
He,
|
|
1362
|
+
Xe,
|
|
1363
|
+
Ye,
|
|
1364
|
+
et
|
|
1365
|
+
]), st = R((e, t) => {
|
|
1352
1366
|
let n = !se || se(t, F);
|
|
1353
|
-
return /* @__PURE__ */ W(U, { children:
|
|
1354
|
-
let a =
|
|
1367
|
+
return /* @__PURE__ */ W(U, { children: Re().map((r, i) => {
|
|
1368
|
+
let a = ze.get(r.id);
|
|
1355
1369
|
if (!a) return null;
|
|
1356
1370
|
let o;
|
|
1357
1371
|
if (a.cellTitleGetter) o = a.cellTitleGetter({
|
|
@@ -1381,7 +1395,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1381
1395
|
row: t,
|
|
1382
1396
|
rowIndex: e
|
|
1383
1397
|
});
|
|
1384
|
-
o = (0,
|
|
1398
|
+
o = (0, nt.default)(n) ? n.toString() : "";
|
|
1385
1399
|
} else a.type === "date" ? o = p.getTableDateCellValue({
|
|
1386
1400
|
column: a,
|
|
1387
1401
|
dataContext: F,
|
|
@@ -1404,7 +1418,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1404
1418
|
columnIndex: i,
|
|
1405
1419
|
enabled: n,
|
|
1406
1420
|
height: E,
|
|
1407
|
-
onClick:
|
|
1421
|
+
onClick: Le,
|
|
1408
1422
|
order: i,
|
|
1409
1423
|
row: t,
|
|
1410
1424
|
rowIndex: e,
|
|
@@ -1416,7 +1430,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1416
1430
|
return a.type === "actions" ? /* @__PURE__ */ W(wt, {
|
|
1417
1431
|
...s,
|
|
1418
1432
|
column: a
|
|
1419
|
-
}, r.id) : /* @__PURE__ */ G(
|
|
1433
|
+
}, r.id) : /* @__PURE__ */ G(vt, {
|
|
1420
1434
|
...s,
|
|
1421
1435
|
column: a,
|
|
1422
1436
|
children: [
|
|
@@ -1427,7 +1441,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1427
1441
|
row: t,
|
|
1428
1442
|
rowIndex: e
|
|
1429
1443
|
}) }, a.id),
|
|
1430
|
-
!a.renderCell && !!a.displayValueGetter && /* @__PURE__ */ W(ge, { children: /* @__PURE__ */ W(
|
|
1444
|
+
!a.renderCell && !!a.displayValueGetter && /* @__PURE__ */ W(ge, { children: /* @__PURE__ */ W(dt, { content: a.displayValueGetter({
|
|
1431
1445
|
column: a,
|
|
1432
1446
|
dataContext: F,
|
|
1433
1447
|
id: r.id,
|
|
@@ -1465,13 +1479,13 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1465
1479
|
row: t,
|
|
1466
1480
|
rowIndex: e
|
|
1467
1481
|
}),
|
|
1468
|
-
!a.displayValueGetter && !a.renderCell && a.type === "readableIndex" &&
|
|
1482
|
+
!a.displayValueGetter && !a.renderCell && a.type === "readableIndex" && Ve(a, {
|
|
1469
1483
|
dataContext: F,
|
|
1470
1484
|
id: r.id,
|
|
1471
1485
|
row: t,
|
|
1472
1486
|
rowIndex: e
|
|
1473
1487
|
}),
|
|
1474
|
-
!a.displayValueGetter && !a.renderCell && a.type === "selectable" &&
|
|
1488
|
+
!a.displayValueGetter && !a.renderCell && a.type === "selectable" && We(a, {
|
|
1475
1489
|
dataContext: F,
|
|
1476
1490
|
id: r.id,
|
|
1477
1491
|
row: t,
|
|
@@ -1481,28 +1495,29 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1481
1495
|
}, r.id);
|
|
1482
1496
|
}) });
|
|
1483
1497
|
}, [
|
|
1484
|
-
|
|
1498
|
+
Re,
|
|
1485
1499
|
se,
|
|
1486
|
-
|
|
1500
|
+
Le,
|
|
1501
|
+
We,
|
|
1487
1502
|
Ve,
|
|
1488
|
-
Re,
|
|
1489
1503
|
E,
|
|
1490
1504
|
O,
|
|
1491
|
-
|
|
1505
|
+
ze,
|
|
1492
1506
|
F,
|
|
1493
1507
|
le
|
|
1494
|
-
]),
|
|
1508
|
+
]), ct = R((e) => {
|
|
1495
1509
|
c(e);
|
|
1496
|
-
}, [c]),
|
|
1510
|
+
}, [c]), lt = R((e) => {
|
|
1497
1511
|
l(e);
|
|
1498
1512
|
}, [l]);
|
|
1499
1513
|
z(() => {
|
|
1500
|
-
if (!C) return
|
|
1514
|
+
if (!C) return it.default;
|
|
1501
1515
|
let e = C.subscribe((e, t) => {
|
|
1502
1516
|
if (!e.length && !t.length) return;
|
|
1503
1517
|
let n = new Set(e), r = new Set(t);
|
|
1504
1518
|
J.querySelectorAll("[data-testid=virtuoso-item-list] [data-id]").forEach((e) => {
|
|
1505
1519
|
let t = e.getAttribute("data-id");
|
|
1520
|
+
/* v8 ignore next 3 -- the selector only matches elements that have a data-id attribute */
|
|
1506
1521
|
t !== null && (n.has(t) ? e.classList.add("highlighted") : r.has(t) && e.classList.remove("highlighted"));
|
|
1507
1522
|
});
|
|
1508
1523
|
});
|
|
@@ -1516,7 +1531,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1516
1531
|
T.palette.background.paper
|
|
1517
1532
|
]), z(() => {
|
|
1518
1533
|
let e = () => {
|
|
1519
|
-
|
|
1534
|
+
X(), Qe(), Be(), Ke();
|
|
1520
1535
|
}, t = [
|
|
1521
1536
|
ce("condensedChange", (t) => {
|
|
1522
1537
|
A.getState().setIsCondensed(t), I.current = A.getState().getCurrentColumnVisualSettings(), e();
|
|
@@ -1525,15 +1540,16 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1525
1540
|
A.getState().resetColumns(), I.current = A.getState().getCurrentColumnVisualSettings(), e();
|
|
1526
1541
|
}),
|
|
1527
1542
|
ce("columnVisibilityChange", (t) => {
|
|
1543
|
+
let n = new Set(A.getState().columns.filter((e) => e.frozen).map((e) => e.id));
|
|
1528
1544
|
I.current.forEach((e) => {
|
|
1529
|
-
e.isVisible = t.includes(e.id);
|
|
1545
|
+
e.isVisible = n.has(e.id) || t.includes(e.id);
|
|
1530
1546
|
}), e();
|
|
1531
1547
|
}),
|
|
1532
1548
|
ce("columnOrderChange", (t) => {
|
|
1533
1549
|
I.current.sort((e, n) => t.indexOf(e.id) - t.indexOf(n.id)), e();
|
|
1534
1550
|
}),
|
|
1535
1551
|
ce("openColumnsEditorDialog", (e) => {
|
|
1536
|
-
|
|
1552
|
+
Fe.current.open({ hasCellData: e });
|
|
1537
1553
|
})
|
|
1538
1554
|
];
|
|
1539
1555
|
return () => {
|
|
@@ -1541,54 +1557,54 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1541
1557
|
};
|
|
1542
1558
|
}, [
|
|
1543
1559
|
ce,
|
|
1544
|
-
|
|
1560
|
+
Ke,
|
|
1545
1561
|
P,
|
|
1546
1562
|
A,
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1563
|
+
Qe,
|
|
1564
|
+
X,
|
|
1565
|
+
Be
|
|
1550
1566
|
]);
|
|
1551
|
-
let
|
|
1552
|
-
let e =
|
|
1553
|
-
if (e && u && u(e.scrollTop),
|
|
1567
|
+
let ut = R(() => {
|
|
1568
|
+
let e = Ge();
|
|
1569
|
+
if (e && u && u(e.scrollTop), Oe.current && d) {
|
|
1554
1570
|
let t = e.scrollTop;
|
|
1555
1571
|
d(Math.floor(t / D));
|
|
1556
1572
|
}
|
|
1557
1573
|
}, [
|
|
1558
|
-
|
|
1574
|
+
Ge,
|
|
1559
1575
|
u,
|
|
1560
1576
|
d,
|
|
1561
1577
|
D
|
|
1562
|
-
]),
|
|
1563
|
-
let t =
|
|
1578
|
+
]), ft = R(() => D, [D]), pt = R((e) => {
|
|
1579
|
+
let t = Ge();
|
|
1564
1580
|
t && (t.scrollTop = e);
|
|
1565
|
-
}, [
|
|
1566
|
-
let e =
|
|
1567
|
-
e && !
|
|
1568
|
-
}, []),
|
|
1569
|
-
|
|
1570
|
-
hasRendered:
|
|
1581
|
+
}, [Ge]), mt = R(() => {
|
|
1582
|
+
let e = Ne.current;
|
|
1583
|
+
e && !Me.current && e.hasRendered && (Ne.current = null, e.onScrolledToIndex());
|
|
1584
|
+
}, []), ht = R((e, t) => {
|
|
1585
|
+
Ne.current = t ? {
|
|
1586
|
+
hasRendered: je.current.has(e),
|
|
1571
1587
|
index: e,
|
|
1572
1588
|
onScrolledToIndex: t
|
|
1573
|
-
} : null,
|
|
1574
|
-
}, [
|
|
1589
|
+
} : null, Oe.current?.scrollToIndex(e), mt();
|
|
1590
|
+
}, [mt]);
|
|
1575
1591
|
be(y, () => ({
|
|
1576
|
-
scrollToIndex:
|
|
1577
|
-
setVerticalScrollPosition:
|
|
1592
|
+
scrollToIndex: ht,
|
|
1593
|
+
setVerticalScrollPosition: pt
|
|
1578
1594
|
}));
|
|
1579
|
-
let
|
|
1580
|
-
|
|
1581
|
-
}, [a]),
|
|
1582
|
-
|
|
1583
|
-
let t =
|
|
1584
|
-
t &&
|
|
1585
|
-
}, [
|
|
1586
|
-
|
|
1587
|
-
}, [
|
|
1595
|
+
let gt = R((e) => {
|
|
1596
|
+
Ae.current = e, a(e);
|
|
1597
|
+
}, [a]), _t = R((e) => {
|
|
1598
|
+
je.current = new Set(e.map((e) => e.index));
|
|
1599
|
+
let t = Ne.current;
|
|
1600
|
+
t && je.current.has(t.index) && (t.hasRendered = !0), mt();
|
|
1601
|
+
}, [mt]), $ = R((e) => {
|
|
1602
|
+
Me.current = e, mt();
|
|
1603
|
+
}, [mt]);
|
|
1588
1604
|
return z(() => {
|
|
1589
|
-
|
|
1605
|
+
Ae.current && a(Ae.current);
|
|
1590
1606
|
}, [a, M]), /* @__PURE__ */ G(j, {
|
|
1591
|
-
ref:
|
|
1607
|
+
ref: Pe,
|
|
1592
1608
|
style: { "--selection-background": "highlight" },
|
|
1593
1609
|
sx: {
|
|
1594
1610
|
"*::selection": { backgroundColor: "var(--selection-background) !important" },
|
|
@@ -1616,7 +1632,7 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1616
1632
|
sx: {
|
|
1617
1633
|
minWidth: "100%",
|
|
1618
1634
|
position: "relative",
|
|
1619
|
-
width:
|
|
1635
|
+
width: ke.current
|
|
1620
1636
|
}
|
|
1621
1637
|
})),
|
|
1622
1638
|
TableBody: _e((t, n) => /* @__PURE__ */ W(j, {
|
|
@@ -1632,8 +1648,8 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1632
1648
|
let n = !se || se(e.item, F);
|
|
1633
1649
|
return /* @__PURE__ */ W(j, {
|
|
1634
1650
|
"data-id": N(e.item),
|
|
1635
|
-
onMouseEnter: () =>
|
|
1636
|
-
onMouseLeave: () =>
|
|
1651
|
+
onMouseEnter: () => ct(e.item),
|
|
1652
|
+
onMouseLeave: () => lt(e.item),
|
|
1637
1653
|
ref: t,
|
|
1638
1654
|
role: "row",
|
|
1639
1655
|
sx: {
|
|
@@ -1647,44 +1663,44 @@ var pt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1647
1663
|
backgroundColor: T.palette.grey[100],
|
|
1648
1664
|
color: `${T.palette.text.primary} !important`
|
|
1649
1665
|
},
|
|
1650
|
-
borderBottom: `1px solid ${
|
|
1666
|
+
borderBottom: `1px solid ${Te}`,
|
|
1651
1667
|
color: n ? void 0 : "text.disabled",
|
|
1652
1668
|
cursor: n && s ? "pointer" : void 0,
|
|
1653
1669
|
display: "flex",
|
|
1654
1670
|
height: T.spacing(S)
|
|
1655
1671
|
},
|
|
1656
|
-
...(0,
|
|
1672
|
+
...(0, rt.default)(e, "item")
|
|
1657
1673
|
});
|
|
1658
1674
|
})
|
|
1659
1675
|
},
|
|
1660
1676
|
data: M,
|
|
1661
|
-
fixedHeaderContent:
|
|
1677
|
+
fixedHeaderContent: ot,
|
|
1662
1678
|
fixedItemHeight: D,
|
|
1663
1679
|
initialTopMostItemIndex: i ?? 0,
|
|
1664
|
-
isScrolling:
|
|
1665
|
-
itemContent:
|
|
1666
|
-
itemSize:
|
|
1667
|
-
itemsRendered:
|
|
1668
|
-
onScroll:
|
|
1680
|
+
isScrolling: $,
|
|
1681
|
+
itemContent: st,
|
|
1682
|
+
itemSize: ft,
|
|
1683
|
+
itemsRendered: _t,
|
|
1684
|
+
onScroll: ut,
|
|
1669
1685
|
overscan: {
|
|
1670
1686
|
main: f ?? re,
|
|
1671
1687
|
reverse: _ ?? ie
|
|
1672
1688
|
},
|
|
1673
|
-
rangeChanged:
|
|
1674
|
-
ref:
|
|
1689
|
+
rangeChanged: gt,
|
|
1690
|
+
ref: Oe,
|
|
1675
1691
|
style: {
|
|
1676
1692
|
height: "100%",
|
|
1677
1693
|
overflowX: t ? "scroll" : "auto"
|
|
1678
1694
|
},
|
|
1679
1695
|
totalCount: M.length
|
|
1680
1696
|
}), /* @__PURE__ */ W(jt, {
|
|
1681
|
-
ref:
|
|
1697
|
+
ref: Fe,
|
|
1682
1698
|
renderHeaderContent: b,
|
|
1683
1699
|
renderItemContent: x
|
|
1684
1700
|
})]
|
|
1685
1701
|
});
|
|
1686
1702
|
}, Lt = ({ caption: e, component: t = "h2", variant: n = "h2" }) => {
|
|
1687
|
-
let { t: r } = K(), i = v(), a = m(i, (e) => e.baseData.length), o = m(i,
|
|
1703
|
+
let { t: r } = K(), i = v(), a = m(i, (e) => e.baseData.length), o = m(i, Z((e) => e.sortedData.length));
|
|
1688
1704
|
return /* @__PURE__ */ W(le, {
|
|
1689
1705
|
component: t,
|
|
1690
1706
|
variant: n,
|
|
@@ -1909,7 +1925,7 @@ var qt = Ee, Jt = ({ filterDimension: e, onFilterVisibilityChange: t, showMissin
|
|
|
1909
1925
|
a.length,
|
|
1910
1926
|
e.allowMultipleVisibleFilters,
|
|
1911
1927
|
e.allowOnlyPreferredFilter
|
|
1912
|
-
]), l = B(() => !(a.length === 1 || e.allowOnlyPreferredFilter), [a.length, e.allowOnlyPreferredFilter]), u = B(() => c ? {
|
|
1928
|
+
]), l = B(() => !(a.length === 1 || e.allowOnlyPreferredFilter), [a.length, e.allowOnlyPreferredFilter]), u = B(() => c && s.length ? {
|
|
1913
1929
|
items: a.map((r) => ({
|
|
1914
1930
|
active: r === s[0],
|
|
1915
1931
|
callback: () => {
|
|
@@ -1950,7 +1966,7 @@ var qt = Ee, Jt = ({ filterDimension: e, onFilterVisibilityChange: t, showMissin
|
|
|
1950
1966
|
},
|
|
1951
1967
|
variant: "h6",
|
|
1952
1968
|
children: e.label
|
|
1953
|
-
}) }), c && /* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(
|
|
1969
|
+
}) }), c && /* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(Je, {
|
|
1954
1970
|
ButtonProps: {
|
|
1955
1971
|
color: "inherit",
|
|
1956
1972
|
size: "small",
|
|
@@ -1968,7 +1984,7 @@ var qt = Ee, Jt = ({ filterDimension: e, onFilterVisibilityChange: t, showMissin
|
|
|
1968
1984
|
}),
|
|
1969
1985
|
s.map((e) => /* @__PURE__ */ W(j, {
|
|
1970
1986
|
sx: { my: 1 },
|
|
1971
|
-
children: /* @__PURE__ */ W(
|
|
1987
|
+
children: /* @__PURE__ */ W(ht, { filter: e })
|
|
1972
1988
|
}, e.id)),
|
|
1973
1989
|
/* @__PURE__ */ W(ae, {})
|
|
1974
1990
|
]
|
|
@@ -2072,7 +2088,7 @@ var qt = Ee, Jt = ({ filterDimension: e, onFilterVisibilityChange: t, showMissin
|
|
|
2072
2088
|
}),
|
|
2073
2089
|
onClick: () => O(e.id),
|
|
2074
2090
|
size: "small",
|
|
2075
|
-
children: /* @__PURE__ */ W(
|
|
2091
|
+
children: /* @__PURE__ */ W(qe, {})
|
|
2076
2092
|
})]
|
|
2077
2093
|
}, e.id);
|
|
2078
2094
|
}
|
|
@@ -2090,13 +2106,13 @@ var qt = Ee, Jt = ({ filterDimension: e, onFilterVisibilityChange: t, showMissin
|
|
|
2090
2106
|
...q.createAttributes("TableFiltersSidebarItem-reset"),
|
|
2091
2107
|
color: "primary",
|
|
2092
2108
|
onClick: D,
|
|
2093
|
-
startIcon: /* @__PURE__ */ W(
|
|
2109
|
+
startIcon: /* @__PURE__ */ W(Ke, {}),
|
|
2094
2110
|
variant: "outlined",
|
|
2095
2111
|
children: t`Reset`
|
|
2096
2112
|
}), /* @__PURE__ */ W(re, {
|
|
2097
2113
|
...q.createAttributes("TableFiltersSidebarItem-apply"),
|
|
2098
2114
|
color: "secondary",
|
|
2099
|
-
startIcon: /* @__PURE__ */ W(
|
|
2115
|
+
startIcon: /* @__PURE__ */ W(Ge, {}),
|
|
2100
2116
|
type: "submit",
|
|
2101
2117
|
children: t`Apply`
|
|
2102
2118
|
})]
|
|
@@ -2115,7 +2131,7 @@ var qt = Ee, Jt = ({ filterDimension: e, onFilterVisibilityChange: t, showMissin
|
|
|
2115
2131
|
sx: { my: 2 },
|
|
2116
2132
|
children: [/* @__PURE__ */ W(j, {
|
|
2117
2133
|
sx: { my: 1 },
|
|
2118
|
-
children: /* @__PURE__ */ W(
|
|
2134
|
+
children: /* @__PURE__ */ W(ht, { filter: e })
|
|
2119
2135
|
}), /* @__PURE__ */ W(ae, {})]
|
|
2120
2136
|
}, e.id)) })]
|
|
2121
2137
|
})]
|
|
@@ -2134,7 +2150,7 @@ var qt = Ee, Jt = ({ filterDimension: e, onFilterVisibilityChange: t, showMissin
|
|
|
2134
2150
|
children: t && /* @__PURE__ */ W(Yt, { onClose: e })
|
|
2135
2151
|
});
|
|
2136
2152
|
}, Zt = ({ hasCellData: e }) => {
|
|
2137
|
-
let t = v(), n = m(t,
|
|
2153
|
+
let t = v(), n = m(t, Z((e) => e.emitEvent)), r = m(t, Z((e) => e.columns)), i = m(t, Z((e) => e.dataContext)), a = m(t, Z((e) => e.getCurrentColumnVisualSettings().filter((e) => e.isVisible).map((e) => e.id))), o = m(t, Z((e) => e.columnDimensions)), s = m(t, Z((e) => e.isCondensed)), c = m(t, Z((e) => e.sortedData)), { t: l } = K(), u = B(() => r.some((e) => e.cellColorGetter), [r]), d = R(() => {
|
|
2138
2154
|
n("openColumnsEditorDialog", e);
|
|
2139
2155
|
}, [n, e]), f = R((e) => {
|
|
2140
2156
|
let t = _(a, (t) => t.includes(e) ? t.filter((t) => t !== e) : (t.push(e), t));
|
|
@@ -2170,13 +2186,13 @@ var qt = Ee, Jt = ({ filterDimension: e, onFilterVisibilityChange: t, showMissin
|
|
|
2170
2186
|
checked: s ? "true" : "false",
|
|
2171
2187
|
divider: !0,
|
|
2172
2188
|
label: l`Condensed`,
|
|
2173
|
-
rightIcon: W(s ?
|
|
2189
|
+
rightIcon: W(s ? Qe : Ze, {})
|
|
2174
2190
|
} : void 0,
|
|
2175
2191
|
{
|
|
2176
2192
|
callback: () => d(),
|
|
2177
2193
|
divider: !0,
|
|
2178
2194
|
label: l`Column editor`,
|
|
2179
|
-
leftIcon: /* @__PURE__ */ W(
|
|
2195
|
+
leftIcon: /* @__PURE__ */ W($e, { sx: { fontSize: "1.5rem" } })
|
|
2180
2196
|
},
|
|
2181
2197
|
{
|
|
2182
2198
|
autoCloseDisabled: !0,
|
|
@@ -2217,11 +2233,11 @@ var qt = Ee, Jt = ({ filterDimension: e, onFilterVisibilityChange: t, showMissin
|
|
|
2217
2233
|
callback: () => f(e),
|
|
2218
2234
|
checked: t ? "true" : "false",
|
|
2219
2235
|
label: r.find((t) => t.id === e)?.headerName ?? "",
|
|
2220
|
-
rightIcon: W(t ?
|
|
2236
|
+
rightIcon: W(t ? Ye : Xe, {})
|
|
2221
2237
|
};
|
|
2222
2238
|
}),
|
|
2223
2239
|
label: t.label,
|
|
2224
|
-
rightIcon: W(n ?
|
|
2240
|
+
rightIcon: W(n ? Ye : i ? X : Xe, {})
|
|
2225
2241
|
});
|
|
2226
2242
|
}) : r.filter((e) => !e.frozen).forEach((t) => {
|
|
2227
2243
|
let n = a.includes(t.id);
|
|
@@ -2230,7 +2246,7 @@ var qt = Ee, Jt = ({ filterDimension: e, onFilterVisibilityChange: t, showMissin
|
|
|
2230
2246
|
callback: () => f(t.id),
|
|
2231
2247
|
checked: n ? "true" : "false",
|
|
2232
2248
|
label: t.headerName,
|
|
2233
|
-
rightIcon: W(n ?
|
|
2249
|
+
rightIcon: W(n ? Ye : Xe, {})
|
|
2234
2250
|
});
|
|
2235
2251
|
}), {
|
|
2236
2252
|
items: e,
|
|
@@ -2252,7 +2268,7 @@ var qt = Ee, Jt = ({ filterDimension: e, onFilterVisibilityChange: t, showMissin
|
|
|
2252
2268
|
]);
|
|
2253
2269
|
}, Qt = ({ ContainerProps: e }) => {
|
|
2254
2270
|
let t = Zt({});
|
|
2255
|
-
return /* @__PURE__ */ W(
|
|
2271
|
+
return /* @__PURE__ */ W(Je, {
|
|
2256
2272
|
ButtonProps: {
|
|
2257
2273
|
color: "primary",
|
|
2258
2274
|
size: "small",
|
|
@@ -2273,8 +2289,8 @@ var qt = Ee, Jt = ({ filterDimension: e, onFilterVisibilityChange: t, showMissin
|
|
|
2273
2289
|
component: t,
|
|
2274
2290
|
variant: n
|
|
2275
2291
|
}) }), r && /* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(Qt, {}) })]
|
|
2276
|
-
}), en =
|
|
2277
|
-
let { t } = K(), n = v(), r = m(n,
|
|
2292
|
+
}), en = et, tn = ({ downloadAsFileName: e }) => {
|
|
2293
|
+
let { t } = K(), n = v(), r = m(n, Z((e) => e.selectedIds.length > 0)), i = m(n, Z((e) => e.dataContext)), a = R(() => n.getState().getCurrentColumnVisualSettings().filter((e) => e.isVisible).map((e) => e.id), [n]), o = R(() => n.getState().columns, [n]), s = R(() => {
|
|
2278
2294
|
let { idSelectorCallback: e, selectedIds: t, sortedData: r } = n.getState();
|
|
2279
2295
|
return r.filter((n) => t.includes(e(n)));
|
|
2280
2296
|
}, [n]), c = R(async () => {
|
|
@@ -2399,6 +2415,6 @@ var qt = Ee, Jt = ({ filterDimension: e, onFilterVisibilityChange: t, showMissin
|
|
|
2399
2415
|
})
|
|
2400
2416
|
] });
|
|
2401
2417
|
};
|
|
2402
|
-
export {
|
|
2418
|
+
export { at as _, Xt as a, Lt as c, wt as d, Ct as f, dt as g, ht as h, Zt as i, It as l, gt as m, $t as n, Yt as o, vt as p, Qt as r, qt as s, rn as t, jt as u };
|
|
2403
2419
|
|
|
2404
2420
|
//# sourceMappingURL=Table.js.map
|