@gen-epix/ui-client-common 4.7.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 +236 -235
- package/dist/_chunks/CrudPage.js.map +1 -1
- package/dist/_chunks/GeoFilter.js +2 -1
- package/dist/_chunks/GeoFilter.js.map +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 +1048 -714
- package/dist/_chunks/Table.js.map +1 -1
- package/dist/_chunks/TableUtil.js +5187 -230
- package/dist/_chunks/TableUtil.js.map +1 -1
- package/dist/_chunks/TextFilter.js +51 -38
- 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 +271 -269
- 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 +291 -246
- 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/abstracts/FilterAbstract/FilterAbstract.d.ts +11 -0
- package/dist/classes/abstracts/FilterAbstract/index.js +48 -3
- package/dist/classes/abstracts/FilterAbstract/index.js.map +1 -1
- package/dist/classes/filters/BooleanFilter.d.ts +1 -0
- package/dist/classes/filters/DateFilter.d.ts +1 -1
- package/dist/classes/filters/GeoFilter.d.ts +1 -0
- package/dist/classes/filters/MultiSelectFilter.d.ts +9 -6
- package/dist/classes/filters/NumberRangeFilter.d.ts +1 -0
- package/dist/classes/filters/TextFilter.d.ts +1 -0
- 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 +4 -3
- 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/components/ui/Table/TableDownloadSidebarItem.d.ts +10 -0
- package/dist/components/ui/Table/TableSidebarMenu.d.ts +2 -1
- package/dist/components/ui/Table/index.d.ts +1 -0
- package/dist/components/ui/Table/index.js +1 -1
- package/dist/components/ui/Table/useTableColumnsMenu.d.ts +6 -0
- 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 +16 -0
- package/dist/locale/nl.json +16 -0
- package/dist/models/table.models.d.ts +2 -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/stores/tableStore/tableStore.d.ts +3 -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 +13 -1
- package/package.json +38 -34
- 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/_chunks/useColumnsMenu.js +0 -159
- package/dist/_chunks/useColumnsMenu.js.map +0 -1
- package/dist/hooks/useColumnsMenu/index.d.ts +0 -1
- package/dist/hooks/useColumnsMenu/index.js +0 -1
- package/dist/hooks/useColumnsMenu/useColumnsMenu.d.ts +0 -6
- package/dist/test/lib/index.d.ts +0 -1
- package/dist/test/lib/render.d.ts +0 -2
package/dist/_chunks/Table.js
CHANGED
|
@@ -4,55 +4,60 @@ import { r as c, t as l } from "./uniq.js";
|
|
|
4
4
|
import { t as u } from "./omit.js";
|
|
5
5
|
import { n as d, r as f, t as p } from "./TableUtil.js";
|
|
6
6
|
import { t as m } from "./react.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { SidebarItem as k, SidebarMenu as ee, SidebarMenuItem as A } from "../components/ui/Sidebar/index.js";
|
|
7
|
+
import { PageEventBusService as h } from "../classes/services/PageEventBusService/index.js";
|
|
8
|
+
import { useConfig as g } from "../hooks/useConfig/index.js";
|
|
9
|
+
import { l as _, t as v } from "./tableStore.js";
|
|
10
|
+
import { f as y } from "./_arrayMap.js";
|
|
11
|
+
import { t as b } from "./GeoFilter.js";
|
|
12
|
+
import { BooleanFilterField as x } from "../components/filters/BooleanFilterField/index.js";
|
|
13
|
+
import { DateFilterField as S } from "../components/filters/DateFilterField/index.js";
|
|
14
|
+
import { GeoFilterField as C } from "../components/filters/GeoFilterField/index.js";
|
|
15
|
+
import { MultiSelectFilterField as w } from "../components/filters/MultiSelectFilterField/index.js";
|
|
16
|
+
import { NumberRangeFilterField as T } from "../components/filters/NumberRangeFilterField/index.js";
|
|
17
|
+
import { TextFilterField as E } from "../components/filters/TextFilterField/index.js";
|
|
18
|
+
import { TABLE_COLUMN_FROZEN as D } from "../models/table.models.js";
|
|
19
|
+
import { SidebarItem as O, SidebarMenu as ee, SidebarMenuItem as k } from "../components/ui/Sidebar/index.js";
|
|
21
20
|
import { container as te } from "tsyringe";
|
|
22
21
|
import { WindowService as ne } from "@gen-epix/ui-core/classes/services/WindowService";
|
|
23
|
-
import { t as
|
|
24
|
-
import { Box as
|
|
25
|
-
import * as
|
|
26
|
-
import
|
|
27
|
-
import { Fragment as
|
|
28
|
-
import { useTranslation as
|
|
29
|
-
import { TestIdUtil as
|
|
30
|
-
import { TableVirtuoso as
|
|
31
|
-
import { useScrollbarSize as
|
|
32
|
-
import { visuallyHidden as
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import { FormProvider as
|
|
36
|
-
import
|
|
37
|
-
import { withDialog as
|
|
38
|
-
import { DndContext as
|
|
39
|
-
import { SortableContext as
|
|
40
|
-
import { CSS as
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import { NestedDropdown as
|
|
22
|
+
import { t as A } from "i18next";
|
|
23
|
+
import { Box as j, Button as re, Checkbox as ie, Divider as ae, FormControlLabel as M, IconButton as N, Link as P, Menu as oe, Paper as se, Popover as ce, Tooltip as F, Typography as le, alpha as ue, darken as de, lighten as fe, styled as pe, useTheme as me } from "@mui/material";
|
|
24
|
+
import * as he from "react";
|
|
25
|
+
import I, { Fragment as ge, createContext as L, forwardRef as _e, use as ve, useCallback as R, useEffect as z, useId as ye, useImperativeHandle as be, useLayoutEffect as xe, useMemo as B, useRef as V, useState as H } from "react";
|
|
26
|
+
import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
|
|
27
|
+
import { useTranslation as K } from "react-i18next";
|
|
28
|
+
import { TestIdUtil as q } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
29
|
+
import { TableVirtuoso as Se } from "react-virtuoso";
|
|
30
|
+
import { useScrollbarSize as Ce } from "@gen-epix/ui-core/hooks/useScrollbarSize";
|
|
31
|
+
import { visuallyHidden as we } from "@mui/utils";
|
|
32
|
+
import Te from "@mui/icons-material/ArrowDownward";
|
|
33
|
+
import Ee from "@mui/icons-material/FilterAlt";
|
|
34
|
+
import { FormProvider as De, useController as Oe, useForm as ke, useFormContext as Ae, useWatch as je } from "react-hook-form";
|
|
35
|
+
import Me from "@mui/icons-material/MoreVert";
|
|
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";
|
|
47
52
|
// ../../node_modules/.pnpm/use-debounce@10.1.1_react@19.3.1/node_modules/use-debounce/dist/index.module.js
|
|
48
|
-
var
|
|
49
|
-
function
|
|
50
|
-
var i = this, a =
|
|
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
|
+
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();
|
|
51
56
|
f.current = e;
|
|
52
57
|
var g = typeof window < "u", _ = !t && t !== 0 && g;
|
|
53
58
|
if (typeof e != "function") throw TypeError("Expected a function");
|
|
54
59
|
t = +t || 0;
|
|
55
|
-
var v = !!(n ||= {}).leading, y = !("trailing" in n) || !!n.trailing, b = !!n.flushOnExit && y, x = "maxWait" in n, S = "debounceOnServer" in n && !!n.debounceOnServer, C = x ? Math.max(+n.maxWait || 0, t) : null, w =
|
|
60
|
+
var v = !!(n ||= {}).leading, y = !("trailing" in n) || !!n.trailing, b = !!n.flushOnExit && y, x = "maxWait" in n, S = "debounceOnServer" in n && !!n.debounceOnServer, C = x ? Math.max(+n.maxWait || 0, t) : null, w = B(function() {
|
|
56
61
|
var e = function(e) {
|
|
57
62
|
var t = l.current, n = u.current;
|
|
58
63
|
return l.current = u.current = null, o.current = e, s.current = s.current || e, d.current = f.current.apply(n, t);
|
|
@@ -105,95 +110,161 @@ function Ze(e, t, n, r) {
|
|
|
105
110
|
S,
|
|
106
111
|
r
|
|
107
112
|
]);
|
|
108
|
-
return h.current = w,
|
|
113
|
+
return h.current = w, z(function() {
|
|
109
114
|
return p.current = !0, function() {
|
|
110
115
|
var e;
|
|
111
116
|
b && h.current.flush(), m.current &&= ((e = globalThis.document) == null || e.removeEventListener == null || e.removeEventListener("visibilitychange", m.current), null), p.current = !1;
|
|
112
117
|
};
|
|
113
118
|
}, [b]), w;
|
|
114
119
|
}
|
|
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
|
+
let n = e instanceof Map ? e : new Map(e.entries()), r = t instanceof Map ? t : new Map(t.entries());
|
|
123
|
+
if (n.size !== r.size) return !1;
|
|
124
|
+
for (let [e, t] of n) if (!r.has(e) || !Object.is(t, r.get(e))) return !1;
|
|
125
|
+
return !0;
|
|
126
|
+
}, lt = (e, t) => {
|
|
127
|
+
let n = e[Symbol.iterator](), r = t[Symbol.iterator](), i = n.next(), a = r.next();
|
|
128
|
+
for (; !i.done && !a.done;) {
|
|
129
|
+
if (!Object.is(i.value, a.value)) return !1;
|
|
130
|
+
i = n.next(), a = r.next();
|
|
131
|
+
}
|
|
132
|
+
return !!i.done && !!a.done;
|
|
133
|
+
};
|
|
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
|
+
}
|
|
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
|
+
let t = I.useRef(void 0);
|
|
140
|
+
return (n) => {
|
|
141
|
+
let r = e(n);
|
|
142
|
+
return ut(t.current, r) ? t.current : t.current = r;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
115
145
|
// src/components/ui/Table/TableCellAsyncContent.tsx
|
|
116
|
-
var
|
|
117
|
-
let [t, n] =
|
|
118
|
-
return
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
146
|
+
var dt = ({ content: e }) => {
|
|
147
|
+
let [t, n] = H(null);
|
|
148
|
+
return z(() => {
|
|
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
|
+
};
|
|
156
|
+
}, [e]), /* @__PURE__ */ W(U, { children: t });
|
|
123
157
|
};
|
|
124
158
|
// ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
125
|
-
function
|
|
159
|
+
function ft(e) {
|
|
126
160
|
var t, n, r = "";
|
|
127
161
|
if (typeof e == "string" || typeof e == "number") r += e;
|
|
128
162
|
else if (typeof e == "object") {
|
|
129
163
|
if (Array.isArray(e)) {
|
|
130
164
|
var i = e.length;
|
|
131
|
-
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);
|
|
132
166
|
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
133
167
|
}
|
|
134
168
|
return r;
|
|
135
169
|
}
|
|
136
|
-
function
|
|
137
|
-
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);
|
|
138
172
|
return r;
|
|
139
173
|
}
|
|
140
174
|
// src/components/ui/Table/TableFilter.tsx
|
|
141
|
-
var
|
|
142
|
-
var n = f(), r =
|
|
175
|
+
var mt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
176
|
+
var n = f(), r = y();
|
|
143
177
|
function i(e) {
|
|
144
178
|
return e && e.length ? n(e, r) : 0;
|
|
145
179
|
}
|
|
146
180
|
t.exports = i;
|
|
147
|
-
})))(), 1),
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
181
|
+
})))(), 1), ht = ({ filter: e }) => {
|
|
182
|
+
let { field: t } = Oe({
|
|
183
|
+
defaultValue: e.includeMissingValues,
|
|
184
|
+
name: e.includeMissingValuesFormFieldName
|
|
185
|
+
}), { t: n } = K(), c = v(), l = m(c, (e) => e.showMissingValuesFilter), u = je({ name: e.id }), d = e.isInitialFilterValue(u), f = d ? n`Select missing values` : n`Include missing values`, p = d ? n`When enabled, select only items with missing values.` : n`When enabled, include items with missing values alongside items matching the selected values.`;
|
|
186
|
+
return /* @__PURE__ */ G(U, { children: [
|
|
187
|
+
e instanceof s && /* @__PURE__ */ W(E, { filter: e }),
|
|
188
|
+
e instanceof o && /* @__PURE__ */ W(x, { filter: e }),
|
|
189
|
+
e instanceof r && /* @__PURE__ */ W(T, { filter: e }),
|
|
190
|
+
e instanceof a && /* @__PURE__ */ W(w, { filter: e }),
|
|
191
|
+
e instanceof b && /* @__PURE__ */ W(C, { filter: e }),
|
|
192
|
+
e instanceof i && /* @__PURE__ */ W(S, { filter: e }),
|
|
193
|
+
l && e.supportsMissingValuesFilter && /* @__PURE__ */ W(F, {
|
|
194
|
+
arrow: !0,
|
|
195
|
+
placement: "top",
|
|
196
|
+
title: p,
|
|
197
|
+
children: /* @__PURE__ */ W(M, {
|
|
198
|
+
control: /* @__PURE__ */ W(ie, {
|
|
199
|
+
checked: t.value === !0,
|
|
200
|
+
name: t.name,
|
|
201
|
+
onBlur: t.onBlur,
|
|
202
|
+
onChange: t.onChange
|
|
203
|
+
}),
|
|
204
|
+
label: f
|
|
205
|
+
})
|
|
206
|
+
})
|
|
207
|
+
] });
|
|
208
|
+
}, gt = ({ filter: e, onFilterChange: t }) => {
|
|
209
|
+
let n = v(), { t: r } = K(), i = m(n, (e) => e.setFilterValue), a = m(n, (e) => e.showMissingValuesFilter), o = e.includeMissingValuesFormFieldName, s = B(() => ({
|
|
210
|
+
[e.id]: e.initialFilterValue,
|
|
211
|
+
...a ? { [o]: !1 } : {}
|
|
212
|
+
}), [
|
|
213
|
+
e.id,
|
|
214
|
+
e.initialFilterValue,
|
|
215
|
+
o,
|
|
216
|
+
a
|
|
217
|
+
]), c = B(() => ({
|
|
218
|
+
[e.id]: e.filterValue ?? e.initialFilterValue,
|
|
219
|
+
...a ? { [o]: e.includeMissingValues } : {}
|
|
220
|
+
}), [
|
|
156
221
|
e.id,
|
|
157
222
|
e.filterValue,
|
|
158
|
-
e.
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
223
|
+
e.includeMissingValues,
|
|
224
|
+
e.initialFilterValue,
|
|
225
|
+
o,
|
|
226
|
+
a
|
|
227
|
+
]), l = ke({
|
|
228
|
+
defaultValues: s,
|
|
229
|
+
values: c
|
|
230
|
+
}), { formState: { isDirty: u }, handleSubmit: d } = l, f = R(async (n) => {
|
|
231
|
+
await i(e.id, n[e.id], a ? n[o] === !0 : void 0), t();
|
|
164
232
|
}, [
|
|
165
233
|
e.id,
|
|
234
|
+
o,
|
|
166
235
|
t,
|
|
167
|
-
i
|
|
168
|
-
|
|
169
|
-
|
|
236
|
+
i,
|
|
237
|
+
a
|
|
238
|
+
]), p = R(async () => {
|
|
239
|
+
await i(e.id, e.initialFilterValue, !a && void 0), t();
|
|
170
240
|
}, [
|
|
171
241
|
e.id,
|
|
172
242
|
e.initialFilterValue,
|
|
173
243
|
t,
|
|
174
|
-
i
|
|
244
|
+
i,
|
|
245
|
+
a
|
|
175
246
|
]);
|
|
176
|
-
return /* @__PURE__ */
|
|
177
|
-
...
|
|
178
|
-
children: /* @__PURE__ */
|
|
247
|
+
return /* @__PURE__ */ W(De, {
|
|
248
|
+
...l,
|
|
249
|
+
children: /* @__PURE__ */ G(j, {
|
|
179
250
|
autoComplete: "off",
|
|
180
251
|
component: "form",
|
|
181
252
|
id: "Filters",
|
|
182
|
-
onSubmit:
|
|
253
|
+
onSubmit: d(f),
|
|
183
254
|
sx: { minWidth: "400px" },
|
|
184
|
-
children: [/* @__PURE__ */
|
|
255
|
+
children: [/* @__PURE__ */ W(ht, { filter: e }), /* @__PURE__ */ G(j, {
|
|
185
256
|
sx: {
|
|
186
257
|
display: "flex",
|
|
187
258
|
gap: 1,
|
|
188
259
|
justifyContent: "flex-end"
|
|
189
260
|
},
|
|
190
|
-
children: [/* @__PURE__ */
|
|
191
|
-
disabled: e.
|
|
192
|
-
onClick:
|
|
261
|
+
children: [/* @__PURE__ */ W(re, {
|
|
262
|
+
disabled: !e.isFilterActive(),
|
|
263
|
+
onClick: p,
|
|
193
264
|
variant: "outlined",
|
|
194
265
|
children: r`Remove filter`
|
|
195
|
-
}), /* @__PURE__ */
|
|
196
|
-
disabled: !
|
|
266
|
+
}), /* @__PURE__ */ W(re, {
|
|
267
|
+
disabled: !u,
|
|
197
268
|
type: "submit",
|
|
198
269
|
variant: "contained",
|
|
199
270
|
children: r`Apply`
|
|
@@ -201,28 +272,28 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
201
272
|
})]
|
|
202
273
|
})
|
|
203
274
|
});
|
|
204
|
-
},
|
|
205
|
-
let
|
|
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) => {
|
|
206
277
|
l({
|
|
207
|
-
dataContext:
|
|
278
|
+
dataContext: T,
|
|
208
279
|
id: a.id,
|
|
209
|
-
row:
|
|
210
|
-
rowIndex:
|
|
280
|
+
row: h,
|
|
281
|
+
rowIndex: g
|
|
211
282
|
}, e.nativeEvent);
|
|
212
283
|
}, [
|
|
213
284
|
a.id,
|
|
214
|
-
|
|
285
|
+
T,
|
|
215
286
|
l,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
]),
|
|
287
|
+
h,
|
|
288
|
+
g
|
|
289
|
+
]), O = V(null), ee = R((e) => {
|
|
219
290
|
if (!u || n && !n(e)) return;
|
|
220
291
|
let t = e.currentTarget, r = t.getBoundingClientRect().width, i = {
|
|
221
292
|
elementOffsetX: e.clientX - t.getBoundingClientRect().left,
|
|
222
293
|
elementWidth: r,
|
|
223
294
|
target: t
|
|
224
295
|
}, o = (n) => {
|
|
225
|
-
|
|
296
|
+
O.current || (O.current = {
|
|
226
297
|
target: t,
|
|
227
298
|
x: e.clientX,
|
|
228
299
|
y: e.clientY
|
|
@@ -234,7 +305,7 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
234
305
|
type: "start",
|
|
235
306
|
...i
|
|
236
307
|
}, a));
|
|
237
|
-
let r = n.clientX -
|
|
308
|
+
let r = n.clientX - O.current.x, o = n.clientY - O.current.y;
|
|
238
309
|
u({
|
|
239
310
|
clientX: n.clientX,
|
|
240
311
|
clientY: n.clientY,
|
|
@@ -244,8 +315,8 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
244
315
|
...i
|
|
245
316
|
}, a);
|
|
246
317
|
}, s = (e) => {
|
|
247
|
-
if (e.preventDefault(),
|
|
248
|
-
let t = e.clientX -
|
|
318
|
+
if (e.preventDefault(), O.current) {
|
|
319
|
+
let t = e.clientX - O.current.x, n = e.clientY - O.current.y;
|
|
249
320
|
u({
|
|
250
321
|
clientX: e.clientX,
|
|
251
322
|
clientY: e.clientY,
|
|
@@ -255,34 +326,36 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
255
326
|
...i
|
|
256
327
|
}, a);
|
|
257
328
|
}
|
|
258
|
-
|
|
329
|
+
O.current = null, document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", s);
|
|
259
330
|
};
|
|
260
331
|
document.addEventListener("mouseup", s, { once: !0 }), document.addEventListener("mousemove", o);
|
|
261
332
|
}, [
|
|
262
333
|
u,
|
|
263
334
|
n,
|
|
264
335
|
a
|
|
265
|
-
]),
|
|
266
|
-
let e = a.frozen ===
|
|
267
|
-
return t && (
|
|
268
|
-
"*": t ?? {
|
|
269
|
-
|
|
336
|
+
]), k = !a.frozen, te = R(() => {
|
|
337
|
+
let e = a.frozen === D.LEFT, n = a.frozen === D.RIGHT, r = e || n, i;
|
|
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 },
|
|
342
|
+
background: r ? C.palette.background.paper : t,
|
|
270
343
|
boxSizing: "border-box",
|
|
271
344
|
color: i,
|
|
272
|
-
left: e ? `${
|
|
345
|
+
left: e ? `${S ?? 0}px` : void 0,
|
|
273
346
|
lineHeight: c,
|
|
274
347
|
order: d,
|
|
275
348
|
overflow: "hidden",
|
|
276
349
|
paddingLeft: "8px",
|
|
277
350
|
paddingRight: "8px",
|
|
278
351
|
position: r ? "sticky" : "relative",
|
|
279
|
-
right: n ? `${
|
|
352
|
+
right: n ? `${S ?? 0}px` : void 0,
|
|
280
353
|
textAlign: a.textAlign ?? "left",
|
|
281
354
|
textOverflow: a.disableEllipsis ? void 0 : "ellipsis",
|
|
282
355
|
whiteSpace: a.disableEllipsis ? void 0 : "nowrap",
|
|
283
|
-
width: `${
|
|
356
|
+
width: `${x}px`,
|
|
284
357
|
zIndex: +!!r,
|
|
285
|
-
...
|
|
358
|
+
..._
|
|
286
359
|
};
|
|
287
360
|
}, [
|
|
288
361
|
t,
|
|
@@ -291,25 +364,25 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
291
364
|
a.textAlign,
|
|
292
365
|
c,
|
|
293
366
|
d,
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
367
|
+
_,
|
|
368
|
+
C.palette,
|
|
369
|
+
x,
|
|
370
|
+
S
|
|
298
371
|
]);
|
|
299
|
-
return /* @__PURE__ */
|
|
372
|
+
return /* @__PURE__ */ W(j, {
|
|
300
373
|
"aria-sort": e,
|
|
301
374
|
className: i,
|
|
302
375
|
"data-column-index": o,
|
|
303
376
|
"data-frozen": +!!a.frozen,
|
|
304
377
|
"data-id": a.id,
|
|
305
|
-
"data-row-index":
|
|
306
|
-
onClick: l && s ?
|
|
307
|
-
onMouseDown:
|
|
378
|
+
"data-row-index": g ?? "",
|
|
379
|
+
onClick: l && s ? E : void 0,
|
|
380
|
+
onMouseDown: k && u ? ee : void 0,
|
|
308
381
|
ref: f,
|
|
309
382
|
role: p ?? "cell",
|
|
310
383
|
sx: te(),
|
|
311
|
-
tabIndex:
|
|
312
|
-
title:
|
|
384
|
+
tabIndex: y,
|
|
385
|
+
title: b,
|
|
313
386
|
children: r
|
|
314
387
|
});
|
|
315
388
|
}, Q = {
|
|
@@ -319,7 +392,7 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
319
392
|
filterLabelIcon: "GENEPIX-TableHeaderCell-filterLabelIcon",
|
|
320
393
|
root: "GENEPIX-TableHeaderCell",
|
|
321
394
|
sortLabelIcon: "GENEPIX-TableHeaderCell-sortLabelIcon"
|
|
322
|
-
}, $ = 18,
|
|
395
|
+
}, $ = 18, yt = `${Q.root}--focus`, bt = pe(N, { name: "GENEPIX-TableSortLabelIcon" })(({ ownerState: e, theme: t }) => ({
|
|
323
396
|
"&:hover": {
|
|
324
397
|
color: t.palette.primary.main,
|
|
325
398
|
opacity: "1 !important"
|
|
@@ -336,7 +409,7 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
336
409
|
padding: 0,
|
|
337
410
|
userSelect: "none",
|
|
338
411
|
width: `${$}px`
|
|
339
|
-
})),
|
|
412
|
+
})), xt = pe(N, { name: "GENEPIX-TableCustomHeaderIcon" })(({ theme: e }) => ({
|
|
340
413
|
"&:hover": {
|
|
341
414
|
color: e.palette.primary.main,
|
|
342
415
|
opacity: "1 !important"
|
|
@@ -348,7 +421,7 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
348
421
|
padding: 0,
|
|
349
422
|
userSelect: "none",
|
|
350
423
|
width: `${$}px`
|
|
351
|
-
})),
|
|
424
|
+
})), St = pe(N, { name: "GENEPIX-TableFilterLabelIcon" })(({ theme: e }) => ({
|
|
352
425
|
"&:hover": {
|
|
353
426
|
color: e.palette.primary.main,
|
|
354
427
|
opacity: "1 !important"
|
|
@@ -360,52 +433,52 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
360
433
|
padding: 0,
|
|
361
434
|
userSelect: "none",
|
|
362
435
|
width: `${$}px`
|
|
363
|
-
})),
|
|
364
|
-
let { t } =
|
|
436
|
+
})), Ct = (e) => {
|
|
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) => {
|
|
365
438
|
C && (e.type === "start" && (D.current = !0), C(e, t));
|
|
366
|
-
}, [C]),
|
|
439
|
+
}, [C]), k = R(async () => {
|
|
367
440
|
i === g.id ? await s(g.id, o === "asc" ? "desc" : "asc") : await s(g.id, "asc");
|
|
368
441
|
}, [
|
|
369
442
|
g.id,
|
|
370
443
|
s,
|
|
371
444
|
i,
|
|
372
445
|
o
|
|
373
|
-
]),
|
|
374
|
-
D.current ? (e.preventDefault(), e.stopPropagation(), D.current = !1) : g.comparatorFactory && await
|
|
375
|
-
}, [g.comparatorFactory,
|
|
376
|
-
await
|
|
377
|
-
}, [
|
|
446
|
+
]), te = R(async (e) => {
|
|
447
|
+
D.current ? (e.preventDefault(), e.stopPropagation(), D.current = !1) : g.comparatorFactory && await k();
|
|
448
|
+
}, [g.comparatorFactory, k]), ne = R(async (e) => {
|
|
449
|
+
await k();
|
|
450
|
+
}, [k]), A = R(() => {
|
|
378
451
|
f((e) => e ? null : p.current);
|
|
379
|
-
}, []),
|
|
452
|
+
}, []), re = R(() => {
|
|
380
453
|
f(null);
|
|
381
|
-
}, []),
|
|
454
|
+
}, []), ie = R((e) => {
|
|
382
455
|
e.button === 0 && (e.preventDefault(), e.stopPropagation(), S(e, g));
|
|
383
|
-
}, [g, S]),
|
|
456
|
+
}, [g, S]), ae = R((e) => {
|
|
384
457
|
x(e, g);
|
|
385
|
-
}, [g, x]),
|
|
458
|
+
}, [g, x]), M = B(() => c.find((e) => e.id === g.id), [g.id, c]), N = m(r, (e) => e.filters.find((e) => e.id === g.id)?.isFilterActive() ?? !1), P = R(() => {
|
|
386
459
|
g.customHeaderIcon?.onClick({
|
|
387
460
|
column: g,
|
|
388
461
|
dataContext: a
|
|
389
462
|
});
|
|
390
|
-
}, [g, a]),
|
|
463
|
+
}, [g, a]), oe = R(() => {
|
|
391
464
|
f(null), setTimeout(() => {
|
|
392
|
-
p.current.classList.add(
|
|
465
|
+
p.current.classList.add(yt), p.current?.focus(), h.current?.focus();
|
|
393
466
|
});
|
|
394
|
-
}, []),
|
|
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(() => {
|
|
395
468
|
if (i === g.id) return o === "asc" ? "ascending" : "descending";
|
|
396
469
|
}, [
|
|
397
470
|
g.id,
|
|
398
471
|
i,
|
|
399
472
|
o
|
|
400
473
|
]);
|
|
401
|
-
return /* @__PURE__ */
|
|
402
|
-
ariaSort:
|
|
474
|
+
return /* @__PURE__ */ G(vt, {
|
|
475
|
+
ariaSort: _e,
|
|
403
476
|
canDrag: O,
|
|
404
|
-
className:
|
|
477
|
+
className: pt(Q.root, { [yt]: !!d }),
|
|
405
478
|
column: g,
|
|
406
479
|
columnIndex: _,
|
|
407
480
|
height: b,
|
|
408
|
-
onCustomDrag:
|
|
481
|
+
onCustomDrag: ee,
|
|
409
482
|
order: w,
|
|
410
483
|
ref: p,
|
|
411
484
|
role: "columnheader",
|
|
@@ -416,7 +489,7 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
416
489
|
opacity: "1 !important"
|
|
417
490
|
},
|
|
418
491
|
[`.${Q.sortLabelIcon}--active`]: { color: n.palette.text.secondary },
|
|
419
|
-
[`&:hover, &:focus-visible, &:focus, &:focus-within, &.${
|
|
492
|
+
[`&:hover, &:focus-visible, &:focus, &:focus-within, &.${yt}`]: {
|
|
420
493
|
[`.${Q.columnDivider}`]: { opacity: 1 },
|
|
421
494
|
[`.${Q.sortLabelIcon}, .${Q.filterLabelIcon}, .${Q.customHeaderIcon}`]: {
|
|
422
495
|
display: "inline-block",
|
|
@@ -429,44 +502,44 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
429
502
|
justifyContent: "flex-start",
|
|
430
503
|
textAlign: "left"
|
|
431
504
|
},
|
|
432
|
-
tabIndex:
|
|
505
|
+
tabIndex: ge,
|
|
433
506
|
width: T,
|
|
434
507
|
xOffset: E,
|
|
435
|
-
children: [g.type === "actions" && /* @__PURE__ */
|
|
508
|
+
children: [g.type === "actions" && /* @__PURE__ */ W(j, {
|
|
436
509
|
className: Q.content,
|
|
437
|
-
sx:
|
|
510
|
+
sx: we,
|
|
438
511
|
children: t`Actions`
|
|
439
|
-
}), g.type !== "actions" && /* @__PURE__ */
|
|
512
|
+
}), g.type !== "actions" && /* @__PURE__ */ G(j, {
|
|
440
513
|
sx: {
|
|
441
|
-
[`&:hover .${Q.content}`]: { maxWidth: `calc(100% + 16px - ${(0,
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
514
|
+
[`&:hover .${Q.content}`]: { maxWidth: `calc(100% + 16px - ${(0, mt.default)([
|
|
515
|
+
pe ? L : 0,
|
|
516
|
+
I ? L : 0,
|
|
517
|
+
he ? L : 0,
|
|
518
|
+
L
|
|
446
519
|
])}px)` },
|
|
447
520
|
alignItems: "center",
|
|
448
521
|
display: "inline-flex",
|
|
449
522
|
width: "100%"
|
|
450
523
|
},
|
|
451
524
|
children: [
|
|
452
|
-
g.renderHeader ? /* @__PURE__ */
|
|
525
|
+
g.renderHeader ? /* @__PURE__ */ W(U, { children: g.renderHeader({
|
|
453
526
|
column: g,
|
|
454
527
|
dataContext: a
|
|
455
|
-
}) }) : /* @__PURE__ */
|
|
528
|
+
}) }) : /* @__PURE__ */ W(F, {
|
|
456
529
|
arrow: !0,
|
|
457
530
|
placement: "top",
|
|
458
531
|
title: g.headerTooltipContent,
|
|
459
|
-
children: /* @__PURE__ */
|
|
532
|
+
children: /* @__PURE__ */ W(j, {
|
|
460
533
|
className: Q.content,
|
|
461
|
-
onClick:
|
|
534
|
+
onClick: te,
|
|
462
535
|
ref: l,
|
|
463
536
|
sx: {
|
|
464
537
|
cursor: "pointer",
|
|
465
538
|
flexGrow: 1,
|
|
466
|
-
maxWidth: `calc(100% + 16px - ${(0,
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
539
|
+
maxWidth: `calc(100% + 16px - ${(0, mt.default)([
|
|
540
|
+
le ? L : 0,
|
|
541
|
+
N ? L : 0,
|
|
542
|
+
L
|
|
470
543
|
])}px)`,
|
|
471
544
|
overflow: "hidden",
|
|
472
545
|
textOverflow: "ellipsis",
|
|
@@ -478,57 +551,57 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
478
551
|
}) : g.headerName ?? ""
|
|
479
552
|
})
|
|
480
553
|
}),
|
|
481
|
-
|
|
554
|
+
pe && /* @__PURE__ */ W(xt, {
|
|
482
555
|
className: Q.customHeaderIcon,
|
|
483
|
-
onClick:
|
|
556
|
+
onClick: P,
|
|
484
557
|
tabIndex: 0,
|
|
485
558
|
title: g.customHeaderIcon?.label,
|
|
486
559
|
children: g.customHeaderIcon?.iconElement
|
|
487
560
|
}),
|
|
488
|
-
|
|
489
|
-
className:
|
|
490
|
-
onClick:
|
|
561
|
+
I && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(St, {
|
|
562
|
+
className: fe,
|
|
563
|
+
onClick: A,
|
|
491
564
|
ref: h,
|
|
492
565
|
tabIndex: 0,
|
|
493
566
|
title: t("Show filter for {{name}}", { name: g.headerName || t("unknown") }),
|
|
494
|
-
children: /* @__PURE__ */
|
|
495
|
-
}), /* @__PURE__ */
|
|
567
|
+
children: /* @__PURE__ */ W(Ee, { fontSize: "inherit" })
|
|
568
|
+
}), /* @__PURE__ */ W(ce, {
|
|
496
569
|
anchorEl: d,
|
|
497
570
|
anchorOrigin: {
|
|
498
571
|
horizontal: "center",
|
|
499
572
|
vertical: "bottom"
|
|
500
573
|
},
|
|
501
574
|
id: u,
|
|
502
|
-
onClose:
|
|
575
|
+
onClose: oe,
|
|
503
576
|
open: !!d,
|
|
504
577
|
sx: { zIndex: n.zIndex.appBar + 1 },
|
|
505
578
|
transformOrigin: {
|
|
506
579
|
horizontal: "center",
|
|
507
580
|
vertical: "top"
|
|
508
581
|
},
|
|
509
|
-
children: /* @__PURE__ */
|
|
582
|
+
children: /* @__PURE__ */ W(se, {
|
|
510
583
|
elevation: 4,
|
|
511
584
|
square: !0,
|
|
512
585
|
sx: { padding: n.spacing(3) },
|
|
513
|
-
children: /* @__PURE__ */
|
|
514
|
-
filter:
|
|
515
|
-
onFilterChange:
|
|
586
|
+
children: /* @__PURE__ */ W(gt, {
|
|
587
|
+
filter: M,
|
|
588
|
+
onFilterChange: re
|
|
516
589
|
})
|
|
517
590
|
})
|
|
518
591
|
})] }),
|
|
519
|
-
|
|
520
|
-
className:
|
|
521
|
-
onClick:
|
|
522
|
-
ownerState:
|
|
592
|
+
he && /* @__PURE__ */ W(U, { children: /* @__PURE__ */ W(bt, {
|
|
593
|
+
className: de,
|
|
594
|
+
onClick: ne,
|
|
595
|
+
ownerState: ue,
|
|
523
596
|
tabIndex: 0,
|
|
524
597
|
title: t("Toggle sorting for {{name}}", { name: g.headerName || t("unknown") }),
|
|
525
|
-
children: /* @__PURE__ */
|
|
598
|
+
children: /* @__PURE__ */ W(Te, { fontSize: "inherit" })
|
|
526
599
|
}) }),
|
|
527
|
-
g.resizable !== !1 && /* @__PURE__ */
|
|
600
|
+
g.resizable !== !1 && /* @__PURE__ */ W(j, {
|
|
528
601
|
"aria-label": t("Resize column {{name}}, use arrow keys to adjust the size.", { name: g.headerName || t("unknown") }),
|
|
529
602
|
className: Q.columnDivider,
|
|
530
|
-
onKeyDown:
|
|
531
|
-
onMouseDown:
|
|
603
|
+
onKeyDown: ae,
|
|
604
|
+
onMouseDown: ie,
|
|
532
605
|
role: "separator",
|
|
533
606
|
sx: {
|
|
534
607
|
"&:focus-visible, &:focus, &:focus-within": {
|
|
@@ -539,7 +612,7 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
539
612
|
borderColor: n.palette.primary.main,
|
|
540
613
|
opacity: 1
|
|
541
614
|
},
|
|
542
|
-
borderRight: `1px solid ${
|
|
615
|
+
borderRight: `1px solid ${y}`,
|
|
543
616
|
boxSizing: "border-box",
|
|
544
617
|
cursor: "col-resize",
|
|
545
618
|
height: "18px",
|
|
@@ -553,12 +626,12 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
553
626
|
]
|
|
554
627
|
})]
|
|
555
628
|
}, g.id);
|
|
556
|
-
},
|
|
557
|
-
let t =
|
|
629
|
+
}, wt = (e) => {
|
|
630
|
+
let t = v(), n = m(t, Z((e) => e.dataContext)), [r, i] = H(null), { t: a } = K(), o = !!r, s = R((e) => {
|
|
558
631
|
i(e.currentTarget);
|
|
559
|
-
}, []), c =
|
|
632
|
+
}, []), c = R(() => {
|
|
560
633
|
i(null);
|
|
561
|
-
}, []), l =
|
|
634
|
+
}, []), l = B(() => e.column.getActions({
|
|
562
635
|
dataContext: n,
|
|
563
636
|
id: e.column.id,
|
|
564
637
|
row: e.row,
|
|
@@ -568,11 +641,11 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
568
641
|
e.column,
|
|
569
642
|
e.row,
|
|
570
643
|
e.rowIndex
|
|
571
|
-
]), u =
|
|
572
|
-
return /* @__PURE__ */
|
|
644
|
+
]), u = R(() => {}, []);
|
|
645
|
+
return /* @__PURE__ */ W(vt, {
|
|
573
646
|
...e,
|
|
574
647
|
onClick: u,
|
|
575
|
-
children: l.length > 0 && /* @__PURE__ */
|
|
648
|
+
children: l.length > 0 && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(N, {
|
|
576
649
|
"aria-label": a`Row actions`,
|
|
577
650
|
onClick: s,
|
|
578
651
|
sx: {
|
|
@@ -581,8 +654,8 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
581
654
|
top: "50%",
|
|
582
655
|
transform: "translateY(-50%)"
|
|
583
656
|
},
|
|
584
|
-
children: /* @__PURE__ */
|
|
585
|
-
}), /* @__PURE__ */
|
|
657
|
+
children: /* @__PURE__ */ W(Me, {})
|
|
658
|
+
}), /* @__PURE__ */ W(oe, {
|
|
586
659
|
anchorEl: r,
|
|
587
660
|
id: "basic-menu",
|
|
588
661
|
onClick: c,
|
|
@@ -592,27 +665,27 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
592
665
|
children: l
|
|
593
666
|
})] })
|
|
594
667
|
}, e.column.id);
|
|
595
|
-
},
|
|
596
|
-
let t =
|
|
597
|
-
return /* @__PURE__ */
|
|
598
|
-
...
|
|
668
|
+
}, Tt = ({ children: e }) => {
|
|
669
|
+
let t = B(() => ({ sideEffects: Y({ styles: { active: { opacity: "1" } } }) }), []);
|
|
670
|
+
return /* @__PURE__ */ W(Pe, {
|
|
671
|
+
...q.createAttributes("SortableOverlay"),
|
|
599
672
|
dropAnimation: t,
|
|
600
673
|
style: { opacity: 1 },
|
|
601
674
|
zIndex: 1e3,
|
|
602
675
|
children: e
|
|
603
676
|
});
|
|
604
|
-
},
|
|
677
|
+
}, Et = L({
|
|
605
678
|
attributes: void 0,
|
|
606
679
|
listeners: void 0,
|
|
607
680
|
ref: void 0
|
|
608
|
-
}),
|
|
681
|
+
}), Dt = (e) => {
|
|
609
682
|
let { children: t, value: n } = e;
|
|
610
|
-
return /* @__PURE__ */
|
|
683
|
+
return /* @__PURE__ */ W(Et, {
|
|
611
684
|
value: n,
|
|
612
685
|
children: t
|
|
613
686
|
});
|
|
614
|
-
},
|
|
615
|
-
let r =
|
|
687
|
+
}, Ot = ({ children: e, id: t, sx: n }) => {
|
|
688
|
+
let r = me(), { attributes: i, isDragging: a, listeners: o, setActivatorNodeRef: s, setNodeRef: c, transform: l, transition: u } = He({ id: t }), d = B(() => ({
|
|
616
689
|
attributes: i,
|
|
617
690
|
listeners: o,
|
|
618
691
|
ref: s
|
|
@@ -621,13 +694,13 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
621
694
|
o,
|
|
622
695
|
s
|
|
623
696
|
]), f = {
|
|
624
|
-
transform:
|
|
697
|
+
transform: Ue.Translate.toString(l),
|
|
625
698
|
transition: u
|
|
626
699
|
};
|
|
627
|
-
return /* @__PURE__ */
|
|
700
|
+
return /* @__PURE__ */ W(Dt, {
|
|
628
701
|
value: d,
|
|
629
|
-
children: /* @__PURE__ */
|
|
630
|
-
...
|
|
702
|
+
children: /* @__PURE__ */ W(j, {
|
|
703
|
+
...q.createAttributes("SortableListItem", { id: t }),
|
|
631
704
|
component: "li",
|
|
632
705
|
ref: c,
|
|
633
706
|
role: "row",
|
|
@@ -652,10 +725,10 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
652
725
|
children: e
|
|
653
726
|
})
|
|
654
727
|
});
|
|
655
|
-
},
|
|
656
|
-
let t =
|
|
657
|
-
return /* @__PURE__ */
|
|
658
|
-
...
|
|
728
|
+
}, kt = ({ name: e }) => {
|
|
729
|
+
let t = me(), { attributes: n, listeners: r, ref: i } = ve(Et);
|
|
730
|
+
return /* @__PURE__ */ W(j, {
|
|
731
|
+
...q.createAttributes("SortableListItemDragHandle"),
|
|
659
732
|
component: "button",
|
|
660
733
|
...n,
|
|
661
734
|
...r,
|
|
@@ -681,34 +754,35 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
681
754
|
touchAction: "none"
|
|
682
755
|
},
|
|
683
756
|
type: "button",
|
|
684
|
-
children: /* @__PURE__ */
|
|
757
|
+
children: /* @__PURE__ */ W(We, {})
|
|
685
758
|
});
|
|
686
|
-
},
|
|
687
|
-
let i =
|
|
759
|
+
}, At = ({ items: e, onChange: t, renderHeaderContent: n, renderItemContent: r }) => {
|
|
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(() => {
|
|
688
761
|
s(null);
|
|
689
|
-
}, []), p =
|
|
762
|
+
}, []), p = R(({ active: n, over: r }) => {
|
|
690
763
|
if (r && n.id !== r?.id) {
|
|
691
764
|
let i = e.findIndex(({ id: e }) => e === n.id), a = e.findIndex(({ id: e }) => e === r.id);
|
|
692
|
-
t(
|
|
765
|
+
t(Be(e, i, a));
|
|
693
766
|
}
|
|
694
767
|
s(null);
|
|
695
|
-
}, [e, t]), m =
|
|
768
|
+
}, [e, t]), m = R(({ active: e }) => {
|
|
696
769
|
s(e);
|
|
697
|
-
}, []), h =
|
|
770
|
+
}, []), h = R((n) => {
|
|
698
771
|
let r = n.target.getAttribute("data-id");
|
|
772
|
+
/* v8 ignore next 3 -- the checkbox input always receives data-id from slotProps */
|
|
699
773
|
if (r === null) return;
|
|
700
774
|
let i = n.target.checked;
|
|
701
775
|
t(e.map((e) => String(e.id) === r ? {
|
|
702
776
|
...e,
|
|
703
777
|
isSelected: i
|
|
704
778
|
} : e));
|
|
705
|
-
}, [t, e]), g =
|
|
779
|
+
}, [t, e]), g = R((e) => /* @__PURE__ */ G(Ot, {
|
|
706
780
|
id: e.id,
|
|
707
781
|
children: [
|
|
708
|
-
/* @__PURE__ */
|
|
782
|
+
/* @__PURE__ */ W(j, {
|
|
709
783
|
role: "cell",
|
|
710
|
-
children: /* @__PURE__ */
|
|
711
|
-
control: /* @__PURE__ */
|
|
784
|
+
children: /* @__PURE__ */ W(M, {
|
|
785
|
+
control: /* @__PURE__ */ W(ie, {
|
|
712
786
|
"aria-label": a("Visibility for {{label}}", { label: e.label }),
|
|
713
787
|
checked: e.isSelected,
|
|
714
788
|
name: e.label,
|
|
@@ -721,7 +795,7 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
721
795
|
})
|
|
722
796
|
}),
|
|
723
797
|
r(e),
|
|
724
|
-
/* @__PURE__ */
|
|
798
|
+
/* @__PURE__ */ W(j, {
|
|
725
799
|
role: "cell",
|
|
726
800
|
sx: {
|
|
727
801
|
alignItems: "center",
|
|
@@ -730,7 +804,7 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
730
804
|
paddingRight: i.spacing(1),
|
|
731
805
|
width: "100%"
|
|
732
806
|
},
|
|
733
|
-
children: /* @__PURE__ */
|
|
807
|
+
children: /* @__PURE__ */ W(kt, { name: a("Drag handle for {{label}}", { label: e.label }) })
|
|
734
808
|
})
|
|
735
809
|
]
|
|
736
810
|
}, e.id), [
|
|
@@ -739,7 +813,7 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
739
813
|
a,
|
|
740
814
|
i
|
|
741
815
|
]);
|
|
742
|
-
return /* @__PURE__ */
|
|
816
|
+
return /* @__PURE__ */ G(J, {
|
|
743
817
|
accessibility: {
|
|
744
818
|
announcements: {
|
|
745
819
|
onDragCancel: ({ active: t }) => {
|
|
@@ -772,6 +846,7 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
772
846
|
},
|
|
773
847
|
onDragStart: ({ active: t }) => {
|
|
774
848
|
let n = l(t.id);
|
|
849
|
+
/* v8 ignore next 3 -- drags only start from handles rendered for the current items */
|
|
775
850
|
if (n) return a("Picked up {{label}}. Position {{position}} of {{count}}.", {
|
|
776
851
|
count: e.length,
|
|
777
852
|
label: n.label,
|
|
@@ -785,10 +860,10 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
785
860
|
onDragEnd: p,
|
|
786
861
|
onDragStart: m,
|
|
787
862
|
sensors: d,
|
|
788
|
-
children: [/* @__PURE__ */
|
|
863
|
+
children: [/* @__PURE__ */ G(j, {
|
|
789
864
|
"aria-label": a("Change column order and visibility"),
|
|
790
865
|
role: "table",
|
|
791
|
-
children: [/* @__PURE__ */
|
|
866
|
+
children: [/* @__PURE__ */ G(j, {
|
|
792
867
|
role: "row",
|
|
793
868
|
sx: {
|
|
794
869
|
alignItems: "center",
|
|
@@ -798,27 +873,27 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
798
873
|
height: i.spacing(5)
|
|
799
874
|
},
|
|
800
875
|
children: [
|
|
801
|
-
/* @__PURE__ */
|
|
876
|
+
/* @__PURE__ */ W(j, {
|
|
802
877
|
component: "div",
|
|
803
878
|
role: "columnheader",
|
|
804
879
|
sx: { fontWeight: "bold" },
|
|
805
880
|
children: a`Visible`
|
|
806
881
|
}),
|
|
807
|
-
n ? n() : /* @__PURE__ */
|
|
882
|
+
n ? n() : /* @__PURE__ */ W(j, {
|
|
808
883
|
component: "div",
|
|
809
884
|
role: "columnheader",
|
|
810
885
|
sx: { fontWeight: "bold" },
|
|
811
886
|
children: a`Column`
|
|
812
887
|
}),
|
|
813
|
-
/* @__PURE__ */
|
|
888
|
+
/* @__PURE__ */ W(j, {
|
|
814
889
|
"aria-label": a`Reorder`,
|
|
815
890
|
role: "columnheader"
|
|
816
891
|
})
|
|
817
892
|
]
|
|
818
|
-
}), /* @__PURE__ */
|
|
893
|
+
}), /* @__PURE__ */ W(ze, {
|
|
819
894
|
items: e,
|
|
820
|
-
children: /* @__PURE__ */
|
|
821
|
-
...
|
|
895
|
+
children: /* @__PURE__ */ W(j, {
|
|
896
|
+
...q.createAttributes("SortableList"),
|
|
822
897
|
component: "ul",
|
|
823
898
|
role: "rowgroup",
|
|
824
899
|
sx: {
|
|
@@ -830,18 +905,18 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
830
905
|
children: e.map((e) => g(e))
|
|
831
906
|
})
|
|
832
907
|
})]
|
|
833
|
-
}), /* @__PURE__ */
|
|
908
|
+
}), /* @__PURE__ */ W(Tt, { children: c ? g(c) : null })]
|
|
834
909
|
});
|
|
835
|
-
},
|
|
836
|
-
let { t: o } =
|
|
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(() => {
|
|
837
912
|
let e = /* @__PURE__ */ new Map();
|
|
838
|
-
return
|
|
913
|
+
return h.forEach((t) => {
|
|
839
914
|
e.set(t.id, t);
|
|
840
915
|
}), e;
|
|
841
|
-
}, [
|
|
916
|
+
}, [h]), y = R((e) => {
|
|
842
917
|
let t = [];
|
|
843
918
|
e.forEach((e) => {
|
|
844
|
-
let n =
|
|
919
|
+
let n = _.get(e.id);
|
|
845
920
|
n && !n.frozen && t.push({
|
|
846
921
|
column: n,
|
|
847
922
|
id: n.id,
|
|
@@ -850,35 +925,35 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
850
925
|
label: n.headerName
|
|
851
926
|
});
|
|
852
927
|
}), c(t);
|
|
853
|
-
}, [
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
}, [f,
|
|
857
|
-
let
|
|
858
|
-
|
|
859
|
-
}, [
|
|
860
|
-
|
|
928
|
+
}, [_]);
|
|
929
|
+
z(() => {
|
|
930
|
+
y(f);
|
|
931
|
+
}, [f, y]);
|
|
932
|
+
let b = R(() => {
|
|
933
|
+
y(p.createInitialVisualColumnSettings(h));
|
|
934
|
+
}, [h, y]);
|
|
935
|
+
z(() => {
|
|
861
936
|
n(o`Change column order and visibility`);
|
|
862
937
|
}, [n, o]);
|
|
863
|
-
let
|
|
864
|
-
u("columnVisibilityChange", [...
|
|
865
|
-
let e =
|
|
938
|
+
let x = R(() => {
|
|
939
|
+
u("columnVisibilityChange", [...h.filter((e) => e.frozen).map((e) => e.id), ...s.filter((e) => e.isSelected).map((e) => e.id.toString())]);
|
|
940
|
+
let e = h.findIndex((e) => !e.frozen), n = h.slice(0, e), r = h.slice(e + s.length);
|
|
866
941
|
u("columnOrderChange", [
|
|
867
942
|
...n.map((e) => e.id),
|
|
868
943
|
...s.map((e) => e.id.toString()),
|
|
869
944
|
...r.map((e) => e.id)
|
|
870
945
|
]), t();
|
|
871
946
|
}, [
|
|
872
|
-
|
|
947
|
+
h,
|
|
873
948
|
u,
|
|
874
949
|
s,
|
|
875
950
|
t
|
|
876
|
-
]),
|
|
951
|
+
]), S = R((e) => {
|
|
877
952
|
let t = p.getColumnIdsWithData({
|
|
878
953
|
dataContext: d,
|
|
879
954
|
hasCellData: r,
|
|
880
|
-
sortedData:
|
|
881
|
-
tableColumns:
|
|
955
|
+
sortedData: g,
|
|
956
|
+
tableColumns: h,
|
|
882
957
|
visibleColumnIds: s.filter(e).map((e) => e.id.toString())
|
|
883
958
|
});
|
|
884
959
|
c((e) => e.map((e) => ({
|
|
@@ -889,67 +964,67 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
889
964
|
d,
|
|
890
965
|
r,
|
|
891
966
|
s,
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
]),
|
|
895
|
-
|
|
896
|
-
}, [
|
|
897
|
-
|
|
898
|
-
}, [
|
|
967
|
+
g,
|
|
968
|
+
h
|
|
969
|
+
]), C = R(() => {
|
|
970
|
+
S(() => !0);
|
|
971
|
+
}, [S]), w = R(() => {
|
|
972
|
+
S((e) => e.isSelected);
|
|
973
|
+
}, [S]), T = R(() => {
|
|
899
974
|
c((e) => e.map((e) => ({
|
|
900
975
|
...e,
|
|
901
976
|
isSelected: !0
|
|
902
977
|
})));
|
|
903
|
-
}, []),
|
|
978
|
+
}, []), E = R(() => {
|
|
904
979
|
c((e) => e.map((e) => ({
|
|
905
980
|
...e,
|
|
906
981
|
isSelected: !1
|
|
907
982
|
})));
|
|
908
983
|
}, []);
|
|
909
|
-
|
|
984
|
+
z(() => {
|
|
910
985
|
e([
|
|
911
986
|
{
|
|
912
|
-
...
|
|
987
|
+
...q.createAttributes("TableColumnOrderDialog-enable-all"),
|
|
913
988
|
autoFocus: !0,
|
|
914
989
|
color: "secondary",
|
|
915
990
|
label: o`Show all`,
|
|
916
|
-
onClick:
|
|
991
|
+
onClick: T,
|
|
917
992
|
variant: "outlined"
|
|
918
993
|
},
|
|
919
994
|
{
|
|
920
|
-
...
|
|
995
|
+
...q.createAttributes("TableColumnOrderDialog-enable-all-with-data"),
|
|
921
996
|
autoFocus: !0,
|
|
922
997
|
color: "secondary",
|
|
923
998
|
label: o`Show all with data`,
|
|
924
|
-
onClick:
|
|
999
|
+
onClick: C,
|
|
925
1000
|
variant: "outlined"
|
|
926
1001
|
},
|
|
927
1002
|
{
|
|
928
|
-
...
|
|
1003
|
+
...q.createAttributes("TableColumnOrderDialog-disable-all"),
|
|
929
1004
|
autoFocus: !0,
|
|
930
1005
|
color: "secondary",
|
|
931
1006
|
label: o`Hide all`,
|
|
932
|
-
onClick:
|
|
1007
|
+
onClick: E,
|
|
933
1008
|
variant: "outlined"
|
|
934
1009
|
},
|
|
935
1010
|
{
|
|
936
|
-
...
|
|
1011
|
+
...q.createAttributes("TableColumnOrderDialog-disable-all-without-data"),
|
|
937
1012
|
autoFocus: !0,
|
|
938
1013
|
color: "secondary",
|
|
939
1014
|
label: o`Hide all without data`,
|
|
940
|
-
onClick:
|
|
1015
|
+
onClick: w,
|
|
941
1016
|
variant: "outlined"
|
|
942
1017
|
},
|
|
943
1018
|
{
|
|
944
|
-
...
|
|
1019
|
+
...q.createAttributes("TableColumnOrderDialog-reset"),
|
|
945
1020
|
autoFocus: !0,
|
|
946
1021
|
color: "secondary",
|
|
947
1022
|
label: o`Reset to default`,
|
|
948
|
-
onClick:
|
|
1023
|
+
onClick: b,
|
|
949
1024
|
variant: "outlined"
|
|
950
1025
|
},
|
|
951
1026
|
{
|
|
952
|
-
...
|
|
1027
|
+
...q.createAttributes("TableColumnOrderDialog-close"),
|
|
953
1028
|
autoFocus: !0,
|
|
954
1029
|
color: "primary",
|
|
955
1030
|
label: o`Close`,
|
|
@@ -957,38 +1032,38 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
957
1032
|
variant: "outlined"
|
|
958
1033
|
},
|
|
959
1034
|
{
|
|
960
|
-
...
|
|
1035
|
+
...q.createAttributes("TableColumnOrderDialog-save"),
|
|
961
1036
|
autoFocus: !0,
|
|
962
1037
|
color: "secondary",
|
|
963
1038
|
label: o`Apply`,
|
|
964
|
-
onClick:
|
|
1039
|
+
onClick: x,
|
|
965
1040
|
variant: "contained"
|
|
966
1041
|
}
|
|
967
1042
|
]);
|
|
968
1043
|
}, [
|
|
969
1044
|
e,
|
|
970
1045
|
t,
|
|
971
|
-
D,
|
|
972
|
-
w,
|
|
973
|
-
x,
|
|
974
|
-
S,
|
|
975
1046
|
E,
|
|
1047
|
+
C,
|
|
1048
|
+
b,
|
|
1049
|
+
x,
|
|
1050
|
+
T,
|
|
976
1051
|
o,
|
|
977
|
-
|
|
1052
|
+
w
|
|
978
1053
|
]);
|
|
979
|
-
let
|
|
1054
|
+
let D = R((e) => {
|
|
980
1055
|
c(e);
|
|
981
|
-
}, []),
|
|
1056
|
+
}, []), O = R((e) => /* @__PURE__ */ W(j, {
|
|
982
1057
|
role: "cell",
|
|
983
1058
|
children: e.label
|
|
984
1059
|
}), []);
|
|
985
|
-
return /* @__PURE__ */
|
|
1060
|
+
return /* @__PURE__ */ W(j, {
|
|
986
1061
|
sx: {},
|
|
987
|
-
children: /* @__PURE__ */
|
|
1062
|
+
children: /* @__PURE__ */ W(At, {
|
|
988
1063
|
items: s,
|
|
989
|
-
onChange:
|
|
1064
|
+
onChange: D,
|
|
990
1065
|
renderHeaderContent: i,
|
|
991
|
-
renderItemContent: a ??
|
|
1066
|
+
renderItemContent: a ?? O
|
|
992
1067
|
})
|
|
993
1068
|
});
|
|
994
1069
|
}, {
|
|
@@ -998,14 +1073,14 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
998
1073
|
maxWidth: "lg",
|
|
999
1074
|
noCloseButton: !1,
|
|
1000
1075
|
testId: "TableColumnOrderDialog"
|
|
1001
|
-
}),
|
|
1002
|
-
let { t: r } =
|
|
1076
|
+
}), Mt = ({ cell: e, onCheckBoxClick: t, tableColumn: n }) => {
|
|
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) => {
|
|
1003
1078
|
e.stopPropagation(), e.shiftKey && e.preventDefault(), t(e, c);
|
|
1004
|
-
}, [t, c]), u =
|
|
1079
|
+
}, [t, c]), u = R((e, t) => {
|
|
1005
1080
|
let n = e.target.getAttribute("name");
|
|
1006
1081
|
t && !o.includes(n) ? s([...o, n]) : t || s(o.filter((e) => e !== n));
|
|
1007
1082
|
}, [o, s]);
|
|
1008
|
-
return /* @__PURE__ */
|
|
1083
|
+
return /* @__PURE__ */ W(ie, {
|
|
1009
1084
|
checked: o.includes(c),
|
|
1010
1085
|
disabled: n.isDisabled ? n.isDisabled(e) : !1,
|
|
1011
1086
|
name: a(e.row),
|
|
@@ -1017,15 +1092,15 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1017
1092
|
padding: 0
|
|
1018
1093
|
}
|
|
1019
1094
|
});
|
|
1020
|
-
},
|
|
1021
|
-
let { t } =
|
|
1095
|
+
}, Nt = /* @__PURE__ */ e(l(), 1), Pt = ({ tableColumnParams: e }) => {
|
|
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({
|
|
1022
1097
|
dataContext: i,
|
|
1023
1098
|
id: a(e),
|
|
1024
1099
|
row: e,
|
|
1025
1100
|
rowIndex: s.indexOf(e)
|
|
1026
|
-
}) === !1) : s, u = l.every((e) => o.includes(a(e))), d = l.some((e) => o.includes(a(e))), f =
|
|
1101
|
+
}) === !1) : s, u = l.every((e) => o.includes(a(e))), d = l.some((e) => o.includes(a(e))), f = R((e) => {
|
|
1027
1102
|
let t = l.map((e) => a(e));
|
|
1028
|
-
c(u ? o.filter((e) => !t.includes(e)) : (0,
|
|
1103
|
+
c(u ? o.filter((e) => !t.includes(e)) : (0, Nt.default)([...o, ...t]));
|
|
1029
1104
|
}, [
|
|
1030
1105
|
l,
|
|
1031
1106
|
a,
|
|
@@ -1033,9 +1108,9 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1033
1108
|
o,
|
|
1034
1109
|
c
|
|
1035
1110
|
]);
|
|
1036
|
-
return /* @__PURE__ */
|
|
1111
|
+
return /* @__PURE__ */ W(ie, {
|
|
1037
1112
|
checked: d,
|
|
1038
|
-
checkedIcon: u ? void 0 : /* @__PURE__ */
|
|
1113
|
+
checkedIcon: u ? void 0 : /* @__PURE__ */ W(X, {}),
|
|
1039
1114
|
name: "select-all",
|
|
1040
1115
|
onChange: f,
|
|
1041
1116
|
slotProps: { input: { "aria-label": t`Select all` } },
|
|
@@ -1044,11 +1119,12 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1044
1119
|
padding: 0
|
|
1045
1120
|
}
|
|
1046
1121
|
});
|
|
1047
|
-
},
|
|
1048
|
-
let i =
|
|
1122
|
+
}, Ft = ({ cell: e, getRowName: t, onReadableIndexClick: n, tableColumn: r }) => {
|
|
1123
|
+
let i = g(), a = R((r) => {
|
|
1124
|
+
/* v8 ignore next -- onClick is only attached to the button rendered when onReadableIndexClick is set */
|
|
1049
1125
|
if (n) {
|
|
1050
1126
|
if (!t) throw Error("getRowName is required when onReadableIndexClick is provided");
|
|
1051
|
-
i.enablePageEvents && te.resolve(
|
|
1127
|
+
i.enablePageEvents && te.resolve(h).emit("click", {
|
|
1052
1128
|
label: t(e.row),
|
|
1053
1129
|
type: "table-row-index"
|
|
1054
1130
|
}), r.preventDefault(), r.stopPropagation(), n(e.row);
|
|
@@ -1059,7 +1135,7 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1059
1135
|
n,
|
|
1060
1136
|
e.row
|
|
1061
1137
|
]);
|
|
1062
|
-
return n ? /* @__PURE__ */
|
|
1138
|
+
return n ? /* @__PURE__ */ W(re, {
|
|
1063
1139
|
"aria-label": r.getAriaLabel(e),
|
|
1064
1140
|
color: "primary",
|
|
1065
1141
|
onClick: a,
|
|
@@ -1073,15 +1149,15 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1073
1149
|
variant: "text",
|
|
1074
1150
|
children: e.rowIndex + 1
|
|
1075
1151
|
}) : e.rowIndex + 1;
|
|
1076
|
-
},
|
|
1077
|
-
let
|
|
1078
|
-
m(
|
|
1079
|
-
let
|
|
1080
|
-
m(
|
|
1081
|
-
let
|
|
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 }) => {
|
|
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;
|
|
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) => {
|
|
1082
1158
|
if (s) {
|
|
1083
1159
|
if (!n) throw Error("getRowName is required when onRowClick is provided");
|
|
1084
|
-
ee.enablePageEvents && te.resolve(
|
|
1160
|
+
ee.enablePageEvents && te.resolve(h).emit("click", {
|
|
1085
1161
|
label: n(e.row),
|
|
1086
1162
|
type: "table-row"
|
|
1087
1163
|
}), t.preventDefault(), t.stopPropagation(), s(e);
|
|
@@ -1090,181 +1166,186 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1090
1166
|
ee.enablePageEvents,
|
|
1091
1167
|
n,
|
|
1092
1168
|
s
|
|
1093
|
-
]),
|
|
1169
|
+
]), Re = R(() => I?.current?.filter((e) => e.isVisible) ?? [], []), ze = B(() => {
|
|
1094
1170
|
let e = /* @__PURE__ */ new Map();
|
|
1095
|
-
return
|
|
1171
|
+
return P.forEach((t) => {
|
|
1096
1172
|
e.set(t.id, t);
|
|
1097
1173
|
}), e;
|
|
1098
|
-
}, [
|
|
1099
|
-
if (!
|
|
1100
|
-
let e = (0,
|
|
1101
|
-
|
|
1102
|
-
}, [
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
}, [
|
|
1106
|
-
let
|
|
1174
|
+
}, [P]), Be = R(() => {
|
|
1175
|
+
if (!I?.current?.length || !J) return;
|
|
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]);
|
|
1179
|
+
xe(() => {
|
|
1180
|
+
Be();
|
|
1181
|
+
}, [Be]);
|
|
1182
|
+
let Ve = R((e, t) => /* @__PURE__ */ W(Ft, {
|
|
1107
1183
|
cell: t,
|
|
1108
1184
|
getRowName: n,
|
|
1109
1185
|
onReadableIndexClick: o,
|
|
1110
1186
|
tableColumn: e
|
|
1111
|
-
}, t.id), [n, o]),
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
}, [
|
|
1115
|
-
let
|
|
1116
|
-
if (!e.shiftKey || !
|
|
1117
|
-
|
|
1187
|
+
}, t.id), [n, o]), He = R((e) => /* @__PURE__ */ W(Pt, { tableColumnParams: e }), []);
|
|
1188
|
+
z(() => {
|
|
1189
|
+
Ie.current = null;
|
|
1190
|
+
}, [M]);
|
|
1191
|
+
let Ue = R((e, t) => {
|
|
1192
|
+
if (!e.shiftKey || !Ie.current) {
|
|
1193
|
+
Ie.current = t;
|
|
1118
1194
|
return;
|
|
1119
1195
|
}
|
|
1120
|
-
let n =
|
|
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 */
|
|
1121
1198
|
if (n === -1 || r === -1) return;
|
|
1122
|
-
let [i, a] = n < r ? [n, r] : [r, n], o =
|
|
1123
|
-
pe(c),
|
|
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]));
|
|
1200
|
+
pe(c), Ie.current = t;
|
|
1124
1201
|
}, [
|
|
1125
|
-
|
|
1202
|
+
N,
|
|
1126
1203
|
pe,
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
]),
|
|
1130
|
-
let n =
|
|
1131
|
-
return /* @__PURE__ */
|
|
1204
|
+
M,
|
|
1205
|
+
A
|
|
1206
|
+
]), We = R((e, t) => {
|
|
1207
|
+
let n = N(t.row);
|
|
1208
|
+
return /* @__PURE__ */ W(Mt, {
|
|
1132
1209
|
cell: t,
|
|
1133
|
-
onCheckBoxClick:
|
|
1210
|
+
onCheckBoxClick: Ue,
|
|
1134
1211
|
tableColumn: e
|
|
1135
1212
|
}, n);
|
|
1136
|
-
}, [
|
|
1137
|
-
if (!
|
|
1138
|
-
let e = p.updateColumnSizesInVisualSettings(
|
|
1139
|
-
ve && (
|
|
1213
|
+
}, [N, Ue]), X = R(() => {
|
|
1214
|
+
if (!P.length || !J) return;
|
|
1215
|
+
let e = p.updateColumnSizesInVisualSettings(J, De, M, P, I.current);
|
|
1216
|
+
ve && (J.querySelectorAll("[data-column-index]").forEach((t) => {
|
|
1140
1217
|
let n = t.getAttribute("data-id");
|
|
1141
1218
|
t.style.width = `${e.get(n).calculatedWidth}px`;
|
|
1142
|
-
}),
|
|
1219
|
+
}), Be());
|
|
1143
1220
|
}, [
|
|
1144
1221
|
ve,
|
|
1145
|
-
|
|
1222
|
+
De,
|
|
1223
|
+
M,
|
|
1146
1224
|
P,
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
Re
|
|
1225
|
+
J,
|
|
1226
|
+
Be
|
|
1150
1227
|
]);
|
|
1151
|
-
|
|
1152
|
-
|
|
1228
|
+
z(() => {
|
|
1229
|
+
J && !ve && oe && (I.current = A.getState().getCurrentColumnVisualSettings(), X(), Be(), ye(!0));
|
|
1153
1230
|
}, [
|
|
1154
1231
|
ve,
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1232
|
+
oe,
|
|
1233
|
+
J,
|
|
1234
|
+
A,
|
|
1235
|
+
X,
|
|
1236
|
+
Be
|
|
1160
1237
|
]);
|
|
1161
|
-
let
|
|
1162
|
-
|
|
1163
|
-
}, [
|
|
1164
|
-
|
|
1165
|
-
}, 500, { trailing: !0 }),
|
|
1166
|
-
e.calculatedWidth = t, e.widthPx = t, e.hasResized = !0,
|
|
1167
|
-
}, [
|
|
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) => {
|
|
1168
1245
|
if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
|
|
1169
1246
|
e.preventDefault();
|
|
1170
|
-
let n =
|
|
1171
|
-
|
|
1172
|
-
}, [
|
|
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;
|
|
1248
|
+
Je(n, i);
|
|
1249
|
+
}, [Je]), Xe = R((e, t) => {
|
|
1173
1250
|
e.preventDefault();
|
|
1174
|
-
let n =
|
|
1251
|
+
let n = I.current.find((e) => e.id === t.id), r = e.clientX, i = n?.calculatedWidth, a = (e) => {
|
|
1175
1252
|
let t = e.clientX;
|
|
1176
1253
|
if (r === t) return;
|
|
1177
1254
|
let a = t - r, o = Math.max(50, i + a);
|
|
1178
|
-
i !== o &&
|
|
1255
|
+
i !== o && Je(n, o);
|
|
1179
1256
|
}, o = (e) => {
|
|
1180
|
-
|
|
1257
|
+
L.current(), L.current = it.default;
|
|
1181
1258
|
};
|
|
1182
|
-
document.addEventListener("mousemove", a), document.addEventListener("mouseup", o),
|
|
1259
|
+
document.addEventListener("mousemove", a), document.addEventListener("mouseup", o), L.current = () => {
|
|
1183
1260
|
document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", o);
|
|
1184
1261
|
};
|
|
1185
|
-
}, [
|
|
1186
|
-
|
|
1187
|
-
|
|
1262
|
+
}, [Je]);
|
|
1263
|
+
z(() => () => {
|
|
1264
|
+
L.current();
|
|
1188
1265
|
}, []);
|
|
1189
|
-
let
|
|
1190
|
-
|
|
1266
|
+
let Ze = R((e, t) => p.handleMoveColumn(he, I.current, P, e, t), [he, P]), Qe = R(() => {
|
|
1267
|
+
J.querySelectorAll("[data-column-index]").forEach((e) => {
|
|
1191
1268
|
let t = e.getAttribute("data-id");
|
|
1192
|
-
e.style.order =
|
|
1269
|
+
e.style.order = I.current.findIndex((e) => e.id === t).toString();
|
|
1193
1270
|
});
|
|
1194
|
-
}, [
|
|
1195
|
-
|
|
1271
|
+
}, [J]);
|
|
1272
|
+
z(() => {
|
|
1196
1273
|
let e = () => {
|
|
1197
|
-
|
|
1274
|
+
X(), Qe();
|
|
1198
1275
|
};
|
|
1199
|
-
return
|
|
1200
|
-
|
|
1276
|
+
return k.window.addEventListener("resize", e), () => {
|
|
1277
|
+
k.window.removeEventListener("resize", e);
|
|
1201
1278
|
};
|
|
1202
1279
|
}, [
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1280
|
+
Qe,
|
|
1281
|
+
X,
|
|
1282
|
+
k.window
|
|
1206
1283
|
]);
|
|
1207
|
-
let
|
|
1208
|
-
let t =
|
|
1284
|
+
let $e = R((e) => {
|
|
1285
|
+
let t = Re();
|
|
1209
1286
|
return {
|
|
1210
1287
|
elementIndex: t.findIndex((t) => t.id === e.id),
|
|
1211
1288
|
visibleTableSettingsColumns: t,
|
|
1212
1289
|
widths: t.map((e) => e.calculatedWidth)
|
|
1213
1290
|
};
|
|
1214
|
-
}, [
|
|
1215
|
-
let n =
|
|
1216
|
-
|
|
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 = {
|
|
1217
1297
|
clonedElement: e.target.cloneNode(!0),
|
|
1218
|
-
elementOffsetX:
|
|
1219
|
-
scrollPosition:
|
|
1220
|
-
},
|
|
1298
|
+
elementOffsetX: i.widths.slice(0, i.elementIndex).reduce((e, t) => e + t, 0) - 15,
|
|
1299
|
+
scrollPosition: Ge().scrollLeft
|
|
1300
|
+
}, Y.current.clonedElement.style.cssText = `
|
|
1221
1301
|
font-weight: bold;
|
|
1222
1302
|
position: absolute;
|
|
1223
1303
|
top: ${e.target.getBoundingClientRect().top}px;
|
|
1224
1304
|
left: ${e.clientX - e.elementOffsetX}px;
|
|
1225
|
-
z-index: ${
|
|
1305
|
+
z-index: ${T.zIndex.modal.toString()};
|
|
1226
1306
|
pointer-events: none;
|
|
1227
1307
|
filter: blur(0.5px);
|
|
1228
1308
|
box-shadow: 1px 2px 3px 0px rgba(0,0,0,0.5);
|
|
1229
|
-
`,
|
|
1230
|
-
|
|
1231
|
-
let
|
|
1232
|
-
(
|
|
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") {
|
|
1310
|
+
Y.current.clonedElement.style.setProperty("left", `${e.clientX - e.elementOffsetX}px`), Y.current.clonedElement.style.setProperty("top", `${e.clientY}px`);
|
|
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));
|
|
1233
1313
|
}
|
|
1234
1314
|
}, [
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
]), ot =
|
|
1315
|
+
$e,
|
|
1316
|
+
Ge,
|
|
1317
|
+
Ze,
|
|
1318
|
+
J?.style,
|
|
1319
|
+
T.zIndex.modal,
|
|
1320
|
+
Qe,
|
|
1321
|
+
k.body,
|
|
1322
|
+
k.document
|
|
1323
|
+
]), ot = R(() => /* @__PURE__ */ W(j, {
|
|
1244
1324
|
"aria-rowindex": 1,
|
|
1325
|
+
ref: we,
|
|
1245
1326
|
role: "row",
|
|
1246
1327
|
sx: {
|
|
1247
1328
|
[`&:hover .${Q.columnDivider}`]: { opacity: 1 },
|
|
1248
|
-
background:
|
|
1249
|
-
borderBottom: `1px solid ${
|
|
1329
|
+
background: T.palette.background.paper,
|
|
1330
|
+
borderBottom: `1px solid ${Ee}`,
|
|
1250
1331
|
display: "flex",
|
|
1251
1332
|
fontWeight: "bold",
|
|
1252
|
-
height:
|
|
1333
|
+
height: T.spacing(r),
|
|
1253
1334
|
zIndex: 3
|
|
1254
1335
|
},
|
|
1255
|
-
children:
|
|
1256
|
-
let n =
|
|
1257
|
-
return n ? /* @__PURE__ */
|
|
1336
|
+
children: Re().map((e, t) => {
|
|
1337
|
+
let n = ze.get(e.id);
|
|
1338
|
+
return n ? /* @__PURE__ */ W(Ct, {
|
|
1258
1339
|
column: n.type === "selectable" ? {
|
|
1259
1340
|
...n,
|
|
1260
|
-
renderHeaderContent:
|
|
1341
|
+
renderHeaderContent: He
|
|
1261
1342
|
} : n,
|
|
1262
1343
|
columnIndex: t,
|
|
1263
|
-
dividerColor:
|
|
1264
|
-
height:
|
|
1265
|
-
onColumnDividerKeyDown:
|
|
1266
|
-
onColumnDividerMouseDown:
|
|
1267
|
-
onCustomDrag:
|
|
1344
|
+
dividerColor: Ee,
|
|
1345
|
+
height: T.spacing(r),
|
|
1346
|
+
onColumnDividerKeyDown: Ye,
|
|
1347
|
+
onColumnDividerMouseDown: Xe,
|
|
1348
|
+
onCustomDrag: et,
|
|
1268
1349
|
order: t,
|
|
1269
1350
|
role: "columnheader",
|
|
1270
1351
|
width: e.calculatedWidth,
|
|
@@ -1272,72 +1353,72 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1272
1353
|
}, e.id) : null;
|
|
1273
1354
|
})
|
|
1274
1355
|
}), [
|
|
1275
|
-
|
|
1356
|
+
T,
|
|
1276
1357
|
r,
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
]), st =
|
|
1285
|
-
let n = !
|
|
1286
|
-
return /* @__PURE__ */
|
|
1287
|
-
let a =
|
|
1358
|
+
Ee,
|
|
1359
|
+
Re,
|
|
1360
|
+
ze,
|
|
1361
|
+
He,
|
|
1362
|
+
Xe,
|
|
1363
|
+
Ye,
|
|
1364
|
+
et
|
|
1365
|
+
]), st = R((e, t) => {
|
|
1366
|
+
let n = !se || se(t, F);
|
|
1367
|
+
return /* @__PURE__ */ W(U, { children: Re().map((r, i) => {
|
|
1368
|
+
let a = ze.get(r.id);
|
|
1288
1369
|
if (!a) return null;
|
|
1289
1370
|
let o;
|
|
1290
1371
|
if (a.cellTitleGetter) o = a.cellTitleGetter({
|
|
1291
1372
|
column: a,
|
|
1292
|
-
dataContext:
|
|
1373
|
+
dataContext: F,
|
|
1293
1374
|
id: r.id,
|
|
1294
1375
|
row: t,
|
|
1295
1376
|
rowIndex: e
|
|
1296
1377
|
});
|
|
1297
1378
|
else if (a.type === "text") o = p.getTableTextCellValue({
|
|
1298
1379
|
column: a,
|
|
1299
|
-
dataContext:
|
|
1380
|
+
dataContext: F,
|
|
1300
1381
|
row: t,
|
|
1301
1382
|
rowIndex: e
|
|
1302
1383
|
});
|
|
1303
1384
|
else if (a.type === "boolean") o = p.getTableBooleanCellDisplayValue({
|
|
1304
1385
|
column: a,
|
|
1305
|
-
dataContext:
|
|
1386
|
+
dataContext: F,
|
|
1306
1387
|
row: t,
|
|
1307
1388
|
rowIndex: e,
|
|
1308
|
-
t:
|
|
1389
|
+
t: O
|
|
1309
1390
|
});
|
|
1310
1391
|
else if (a.type === "number") {
|
|
1311
1392
|
let n = p.getTableNumberCellValue({
|
|
1312
1393
|
column: a,
|
|
1313
|
-
dataContext:
|
|
1394
|
+
dataContext: F,
|
|
1314
1395
|
row: t,
|
|
1315
1396
|
rowIndex: e
|
|
1316
1397
|
});
|
|
1317
|
-
o = (0,
|
|
1398
|
+
o = (0, nt.default)(n) ? n.toString() : "";
|
|
1318
1399
|
} else a.type === "date" ? o = p.getTableDateCellValue({
|
|
1319
1400
|
column: a,
|
|
1320
|
-
dataContext:
|
|
1401
|
+
dataContext: F,
|
|
1321
1402
|
row: t,
|
|
1322
1403
|
rowIndex: e
|
|
1323
1404
|
}) : a.type === "options" && (o = p.getTableOptionsCellDisplayValue({
|
|
1324
1405
|
column: a,
|
|
1325
|
-
dataContext:
|
|
1406
|
+
dataContext: F,
|
|
1326
1407
|
row: t,
|
|
1327
1408
|
rowIndex: e
|
|
1328
1409
|
}));
|
|
1329
1410
|
let s = {
|
|
1330
|
-
backgroundColor:
|
|
1411
|
+
backgroundColor: le && a.cellColorGetter ? a.cellColorGetter({
|
|
1331
1412
|
column: a,
|
|
1332
|
-
dataContext:
|
|
1413
|
+
dataContext: F,
|
|
1333
1414
|
id: r.id,
|
|
1334
1415
|
row: t,
|
|
1335
1416
|
rowIndex: e
|
|
1336
1417
|
}) : void 0,
|
|
1337
1418
|
columnIndex: i,
|
|
1338
1419
|
enabled: n,
|
|
1339
|
-
height:
|
|
1340
|
-
onClick:
|
|
1420
|
+
height: E,
|
|
1421
|
+
onClick: Le,
|
|
1341
1422
|
order: i,
|
|
1342
1423
|
row: t,
|
|
1343
1424
|
rowIndex: e,
|
|
@@ -1346,66 +1427,66 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1346
1427
|
width: r.calculatedWidth,
|
|
1347
1428
|
xOffset: r.offsetX
|
|
1348
1429
|
};
|
|
1349
|
-
return a.type === "actions" ? /* @__PURE__ */
|
|
1430
|
+
return a.type === "actions" ? /* @__PURE__ */ W(wt, {
|
|
1350
1431
|
...s,
|
|
1351
1432
|
column: a
|
|
1352
|
-
}, r.id) : /* @__PURE__ */
|
|
1433
|
+
}, r.id) : /* @__PURE__ */ G(vt, {
|
|
1353
1434
|
...s,
|
|
1354
1435
|
column: a,
|
|
1355
1436
|
children: [
|
|
1356
|
-
!!a.renderCell && /* @__PURE__ */
|
|
1437
|
+
!!a.renderCell && /* @__PURE__ */ W(ge, { children: a.renderCell({
|
|
1357
1438
|
column: a,
|
|
1358
|
-
dataContext:
|
|
1439
|
+
dataContext: F,
|
|
1359
1440
|
id: r.id,
|
|
1360
1441
|
row: t,
|
|
1361
1442
|
rowIndex: e
|
|
1362
1443
|
}) }, a.id),
|
|
1363
|
-
!a.renderCell && !!a.displayValueGetter && /* @__PURE__ */
|
|
1444
|
+
!a.renderCell && !!a.displayValueGetter && /* @__PURE__ */ W(ge, { children: /* @__PURE__ */ W(dt, { content: a.displayValueGetter({
|
|
1364
1445
|
column: a,
|
|
1365
|
-
dataContext:
|
|
1446
|
+
dataContext: F,
|
|
1366
1447
|
id: r.id,
|
|
1367
1448
|
row: t,
|
|
1368
1449
|
rowIndex: e
|
|
1369
1450
|
}) }) }, a.id),
|
|
1370
1451
|
!a.displayValueGetter && !a.renderCell && a.type === "text" && p.getTableTextCellValue({
|
|
1371
1452
|
column: a,
|
|
1372
|
-
dataContext:
|
|
1453
|
+
dataContext: F,
|
|
1373
1454
|
row: t,
|
|
1374
1455
|
rowIndex: e
|
|
1375
1456
|
}),
|
|
1376
1457
|
!a.displayValueGetter && !a.renderCell && a.type === "boolean" && p.getTableBooleanCellDisplayValue({
|
|
1377
1458
|
column: a,
|
|
1378
|
-
dataContext:
|
|
1459
|
+
dataContext: F,
|
|
1379
1460
|
row: t,
|
|
1380
1461
|
rowIndex: e,
|
|
1381
|
-
t:
|
|
1462
|
+
t: O
|
|
1382
1463
|
}),
|
|
1383
1464
|
!a.displayValueGetter && !a.renderCell && a.type === "number" && p.getTableNumberCellValue({
|
|
1384
1465
|
column: a,
|
|
1385
|
-
dataContext:
|
|
1466
|
+
dataContext: F,
|
|
1386
1467
|
row: t,
|
|
1387
1468
|
rowIndex: e
|
|
1388
1469
|
}),
|
|
1389
1470
|
!a.displayValueGetter && !a.renderCell && a.type === "date" && p.getTableDateCellValue({
|
|
1390
1471
|
column: a,
|
|
1391
|
-
dataContext:
|
|
1472
|
+
dataContext: F,
|
|
1392
1473
|
row: t,
|
|
1393
1474
|
rowIndex: e
|
|
1394
1475
|
}),
|
|
1395
1476
|
!a.displayValueGetter && !a.renderCell && a.type === "options" && p.getTableOptionsCellDisplayValue({
|
|
1396
1477
|
column: a,
|
|
1397
|
-
dataContext:
|
|
1478
|
+
dataContext: F,
|
|
1398
1479
|
row: t,
|
|
1399
1480
|
rowIndex: e
|
|
1400
1481
|
}),
|
|
1401
|
-
!a.displayValueGetter && !a.renderCell && a.type === "readableIndex" &&
|
|
1402
|
-
dataContext:
|
|
1482
|
+
!a.displayValueGetter && !a.renderCell && a.type === "readableIndex" && Ve(a, {
|
|
1483
|
+
dataContext: F,
|
|
1403
1484
|
id: r.id,
|
|
1404
1485
|
row: t,
|
|
1405
1486
|
rowIndex: e
|
|
1406
1487
|
}),
|
|
1407
|
-
!a.displayValueGetter && !a.renderCell && a.type === "selectable" &&
|
|
1408
|
-
dataContext:
|
|
1488
|
+
!a.displayValueGetter && !a.renderCell && a.type === "selectable" && We(a, {
|
|
1489
|
+
dataContext: F,
|
|
1409
1490
|
id: r.id,
|
|
1410
1491
|
row: t,
|
|
1411
1492
|
rowIndex: e
|
|
@@ -1414,28 +1495,29 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1414
1495
|
}, r.id);
|
|
1415
1496
|
}) });
|
|
1416
1497
|
}, [
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
Ie,
|
|
1420
|
-
He,
|
|
1421
|
-
ze,
|
|
1422
|
-
D,
|
|
1423
|
-
k,
|
|
1498
|
+
Re,
|
|
1499
|
+
se,
|
|
1424
1500
|
Le,
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1501
|
+
We,
|
|
1502
|
+
Ve,
|
|
1503
|
+
E,
|
|
1504
|
+
O,
|
|
1505
|
+
ze,
|
|
1506
|
+
F,
|
|
1507
|
+
le
|
|
1508
|
+
]), ct = R((e) => {
|
|
1428
1509
|
c(e);
|
|
1429
|
-
}, [c]), lt =
|
|
1510
|
+
}, [c]), lt = R((e) => {
|
|
1430
1511
|
l(e);
|
|
1431
1512
|
}, [l]);
|
|
1432
|
-
|
|
1433
|
-
if (!
|
|
1434
|
-
let e =
|
|
1513
|
+
z(() => {
|
|
1514
|
+
if (!C) return it.default;
|
|
1515
|
+
let e = C.subscribe((e, t) => {
|
|
1435
1516
|
if (!e.length && !t.length) return;
|
|
1436
1517
|
let n = new Set(e), r = new Set(t);
|
|
1437
|
-
|
|
1518
|
+
J.querySelectorAll("[data-testid=virtuoso-item-list] [data-id]").forEach((e) => {
|
|
1438
1519
|
let t = e.getAttribute("data-id");
|
|
1520
|
+
/* v8 ignore next 3 -- the selector only matches elements that have a data-id attribute */
|
|
1439
1521
|
t !== null && (n.has(t) ? e.classList.add("highlighted") : r.has(t) && e.classList.remove("highlighted"));
|
|
1440
1522
|
});
|
|
1441
1523
|
});
|
|
@@ -1443,185 +1525,186 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1443
1525
|
e();
|
|
1444
1526
|
};
|
|
1445
1527
|
}, [
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
]),
|
|
1528
|
+
C,
|
|
1529
|
+
J,
|
|
1530
|
+
T.palette.action.hover,
|
|
1531
|
+
T.palette.background.paper
|
|
1532
|
+
]), z(() => {
|
|
1451
1533
|
let e = () => {
|
|
1452
|
-
|
|
1534
|
+
X(), Qe(), Be(), Ke();
|
|
1453
1535
|
}, t = [
|
|
1454
|
-
|
|
1455
|
-
|
|
1536
|
+
ce("condensedChange", (t) => {
|
|
1537
|
+
A.getState().setIsCondensed(t), I.current = A.getState().getCurrentColumnVisualSettings(), e();
|
|
1456
1538
|
}),
|
|
1457
|
-
|
|
1458
|
-
|
|
1539
|
+
ce("reset", () => {
|
|
1540
|
+
A.getState().resetColumns(), I.current = A.getState().getCurrentColumnVisualSettings(), e();
|
|
1459
1541
|
}),
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1542
|
+
ce("columnVisibilityChange", (t) => {
|
|
1543
|
+
let n = new Set(A.getState().columns.filter((e) => e.frozen).map((e) => e.id));
|
|
1544
|
+
I.current.forEach((e) => {
|
|
1545
|
+
e.isVisible = n.has(e.id) || t.includes(e.id);
|
|
1463
1546
|
}), e();
|
|
1464
1547
|
}),
|
|
1465
|
-
|
|
1466
|
-
|
|
1548
|
+
ce("columnOrderChange", (t) => {
|
|
1549
|
+
I.current.sort((e, n) => t.indexOf(e.id) - t.indexOf(n.id)), e();
|
|
1467
1550
|
}),
|
|
1468
|
-
|
|
1469
|
-
|
|
1551
|
+
ce("openColumnsEditorDialog", (e) => {
|
|
1552
|
+
Fe.current.open({ hasCellData: e });
|
|
1470
1553
|
})
|
|
1471
1554
|
];
|
|
1472
1555
|
return () => {
|
|
1473
1556
|
t.forEach((e) => e());
|
|
1474
1557
|
};
|
|
1475
1558
|
}, [
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1559
|
+
ce,
|
|
1560
|
+
Ke,
|
|
1561
|
+
P,
|
|
1562
|
+
A,
|
|
1563
|
+
Qe,
|
|
1564
|
+
X,
|
|
1565
|
+
Be
|
|
1483
1566
|
]);
|
|
1484
|
-
let
|
|
1485
|
-
let e =
|
|
1486
|
-
if (e && u && u(e.scrollTop),
|
|
1567
|
+
let ut = R(() => {
|
|
1568
|
+
let e = Ge();
|
|
1569
|
+
if (e && u && u(e.scrollTop), Oe.current && d) {
|
|
1487
1570
|
let t = e.scrollTop;
|
|
1488
|
-
d(Math.floor(t /
|
|
1571
|
+
d(Math.floor(t / D));
|
|
1489
1572
|
}
|
|
1490
1573
|
}, [
|
|
1491
|
-
|
|
1574
|
+
Ge,
|
|
1492
1575
|
u,
|
|
1493
1576
|
d,
|
|
1494
|
-
|
|
1495
|
-
]),
|
|
1496
|
-
let t =
|
|
1577
|
+
D
|
|
1578
|
+
]), ft = R(() => D, [D]), pt = R((e) => {
|
|
1579
|
+
let t = Ge();
|
|
1497
1580
|
t && (t.scrollTop = e);
|
|
1498
|
-
}, [
|
|
1499
|
-
let e =
|
|
1500
|
-
e && !
|
|
1501
|
-
}, []),
|
|
1502
|
-
|
|
1503
|
-
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),
|
|
1504
1587
|
index: e,
|
|
1505
1588
|
onScrolledToIndex: t
|
|
1506
|
-
} : null,
|
|
1507
|
-
}, [
|
|
1508
|
-
|
|
1509
|
-
scrollToIndex:
|
|
1510
|
-
setVerticalScrollPosition:
|
|
1589
|
+
} : null, Oe.current?.scrollToIndex(e), mt();
|
|
1590
|
+
}, [mt]);
|
|
1591
|
+
be(y, () => ({
|
|
1592
|
+
scrollToIndex: ht,
|
|
1593
|
+
setVerticalScrollPosition: pt
|
|
1511
1594
|
}));
|
|
1512
|
-
let
|
|
1513
|
-
|
|
1514
|
-
}, [a]),
|
|
1515
|
-
|
|
1516
|
-
let t =
|
|
1517
|
-
t &&
|
|
1518
|
-
}, [
|
|
1519
|
-
|
|
1520
|
-
}, [
|
|
1521
|
-
return
|
|
1522
|
-
|
|
1523
|
-
}, [a,
|
|
1524
|
-
ref:
|
|
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]);
|
|
1604
|
+
return z(() => {
|
|
1605
|
+
Ae.current && a(Ae.current);
|
|
1606
|
+
}, [a, M]), /* @__PURE__ */ G(j, {
|
|
1607
|
+
ref: Pe,
|
|
1525
1608
|
style: { "--selection-background": "highlight" },
|
|
1526
1609
|
sx: {
|
|
1527
1610
|
"*::selection": { backgroundColor: "var(--selection-background) !important" },
|
|
1528
1611
|
height: "100%",
|
|
1529
1612
|
position: "relative",
|
|
1530
1613
|
width: "100%",
|
|
1531
|
-
...
|
|
1614
|
+
...w
|
|
1532
1615
|
},
|
|
1533
|
-
children: [ve && /* @__PURE__ */
|
|
1534
|
-
...
|
|
1616
|
+
children: [ve && /* @__PURE__ */ W(Se, {
|
|
1617
|
+
...q.createAttributes("Table"),
|
|
1535
1618
|
components: {
|
|
1536
|
-
EmptyPlaceholder:
|
|
1619
|
+
EmptyPlaceholder: _e((e, t) => /* @__PURE__ */ W(j, {
|
|
1537
1620
|
...e,
|
|
1538
1621
|
ref: t
|
|
1539
1622
|
})),
|
|
1540
|
-
FillerRow:
|
|
1623
|
+
FillerRow: _e((e, t) => /* @__PURE__ */ W(j, {
|
|
1541
1624
|
ref: t,
|
|
1542
1625
|
style: { height: e.height }
|
|
1543
1626
|
})),
|
|
1544
|
-
Table:
|
|
1627
|
+
Table: _e((e, t) => /* @__PURE__ */ W(j, {
|
|
1545
1628
|
...e,
|
|
1546
|
-
"data-row-count":
|
|
1629
|
+
"data-row-count": M.length,
|
|
1547
1630
|
ref: t,
|
|
1548
1631
|
role: "table",
|
|
1549
1632
|
sx: {
|
|
1550
1633
|
minWidth: "100%",
|
|
1551
1634
|
position: "relative",
|
|
1552
|
-
width:
|
|
1635
|
+
width: ke.current
|
|
1553
1636
|
}
|
|
1554
1637
|
})),
|
|
1555
|
-
TableBody:
|
|
1638
|
+
TableBody: _e((t, n) => /* @__PURE__ */ W(j, {
|
|
1556
1639
|
...t,
|
|
1557
1640
|
ref: n,
|
|
1558
1641
|
sx: { font: e }
|
|
1559
1642
|
})),
|
|
1560
|
-
TableHead:
|
|
1643
|
+
TableHead: _e((e, t) => /* @__PURE__ */ W(j, {
|
|
1561
1644
|
...e,
|
|
1562
1645
|
ref: t
|
|
1563
1646
|
})),
|
|
1564
|
-
TableRow:
|
|
1565
|
-
let n = !
|
|
1566
|
-
return /* @__PURE__ */
|
|
1567
|
-
"data-id":
|
|
1647
|
+
TableRow: _e((e, t) => {
|
|
1648
|
+
let n = !se || se(e.item, F);
|
|
1649
|
+
return /* @__PURE__ */ W(j, {
|
|
1650
|
+
"data-id": N(e.item),
|
|
1568
1651
|
onMouseEnter: () => ct(e.item),
|
|
1569
1652
|
onMouseLeave: () => lt(e.item),
|
|
1570
1653
|
ref: t,
|
|
1571
1654
|
role: "row",
|
|
1572
1655
|
sx: {
|
|
1573
1656
|
"&:hover, &.highlighted": {
|
|
1574
|
-
"*": { color: `${
|
|
1657
|
+
"*": { color: `${T.palette.text.primary} !important` },
|
|
1575
1658
|
"& [role=cell]": {
|
|
1576
|
-
"*": { color: `${
|
|
1577
|
-
backgroundColor:
|
|
1578
|
-
color: `${
|
|
1659
|
+
"*": { color: `${T.palette.text.primary} !important` },
|
|
1660
|
+
backgroundColor: T.palette.grey[100],
|
|
1661
|
+
color: `${T.palette.text.primary} !important`
|
|
1579
1662
|
},
|
|
1580
|
-
backgroundColor:
|
|
1581
|
-
color: `${
|
|
1663
|
+
backgroundColor: T.palette.grey[100],
|
|
1664
|
+
color: `${T.palette.text.primary} !important`
|
|
1582
1665
|
},
|
|
1583
|
-
borderBottom: `1px solid ${
|
|
1666
|
+
borderBottom: `1px solid ${Te}`,
|
|
1584
1667
|
color: n ? void 0 : "text.disabled",
|
|
1585
1668
|
cursor: n && s ? "pointer" : void 0,
|
|
1586
1669
|
display: "flex",
|
|
1587
|
-
height:
|
|
1670
|
+
height: T.spacing(S)
|
|
1588
1671
|
},
|
|
1589
|
-
...(0,
|
|
1672
|
+
...(0, rt.default)(e, "item")
|
|
1590
1673
|
});
|
|
1591
1674
|
})
|
|
1592
1675
|
},
|
|
1593
|
-
data:
|
|
1676
|
+
data: M,
|
|
1594
1677
|
fixedHeaderContent: ot,
|
|
1595
|
-
fixedItemHeight:
|
|
1678
|
+
fixedItemHeight: D,
|
|
1596
1679
|
initialTopMostItemIndex: i ?? 0,
|
|
1597
|
-
isScrolling:
|
|
1680
|
+
isScrolling: $,
|
|
1598
1681
|
itemContent: st,
|
|
1599
|
-
itemSize:
|
|
1600
|
-
itemsRendered:
|
|
1601
|
-
onScroll:
|
|
1682
|
+
itemSize: ft,
|
|
1683
|
+
itemsRendered: _t,
|
|
1684
|
+
onScroll: ut,
|
|
1602
1685
|
overscan: {
|
|
1603
1686
|
main: f ?? re,
|
|
1604
|
-
reverse:
|
|
1687
|
+
reverse: _ ?? ie
|
|
1605
1688
|
},
|
|
1606
|
-
rangeChanged:
|
|
1607
|
-
ref:
|
|
1689
|
+
rangeChanged: gt,
|
|
1690
|
+
ref: Oe,
|
|
1608
1691
|
style: {
|
|
1609
1692
|
height: "100%",
|
|
1610
1693
|
overflowX: t ? "scroll" : "auto"
|
|
1611
1694
|
},
|
|
1612
|
-
totalCount:
|
|
1613
|
-
}), /* @__PURE__ */
|
|
1614
|
-
ref:
|
|
1615
|
-
renderHeaderContent:
|
|
1616
|
-
renderItemContent:
|
|
1695
|
+
totalCount: M.length
|
|
1696
|
+
}), /* @__PURE__ */ W(jt, {
|
|
1697
|
+
ref: Fe,
|
|
1698
|
+
renderHeaderContent: b,
|
|
1699
|
+
renderItemContent: x
|
|
1617
1700
|
})]
|
|
1618
1701
|
});
|
|
1619
|
-
},
|
|
1620
|
-
let { t: r } =
|
|
1621
|
-
return /* @__PURE__ */
|
|
1702
|
+
}, Lt = ({ caption: e, component: t = "h2", variant: n = "h2" }) => {
|
|
1703
|
+
let { t: r } = K(), i = v(), a = m(i, (e) => e.baseData.length), o = m(i, Z((e) => e.sortedData.length));
|
|
1704
|
+
return /* @__PURE__ */ W(le, {
|
|
1622
1705
|
component: t,
|
|
1623
1706
|
variant: n,
|
|
1624
|
-
children: /* @__PURE__ */
|
|
1707
|
+
children: /* @__PURE__ */ G(U, { children: [
|
|
1625
1708
|
o === 0 && (e ?? r("Items")),
|
|
1626
1709
|
o > 0 && o === a && r("{{items}} ({{count}})", {
|
|
1627
1710
|
count: o,
|
|
@@ -1635,10 +1718,10 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1635
1718
|
})
|
|
1636
1719
|
] })
|
|
1637
1720
|
});
|
|
1638
|
-
},
|
|
1639
|
-
t.exports = Object.prototype.hasOwnProperty.call(
|
|
1640
|
-
})),
|
|
1641
|
-
var t =
|
|
1721
|
+
}, Rt = /* @__PURE__ */ t(((e, t) => {
|
|
1722
|
+
t.exports = Object.prototype.hasOwnProperty.call(he, "module.exports") ? he["module.exports"] : { ...he };
|
|
1723
|
+
})), zt = /* @__PURE__ */ t(((e) => {
|
|
1724
|
+
var t = Rt();
|
|
1642
1725
|
function n(e, t) {
|
|
1643
1726
|
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
1644
1727
|
}
|
|
@@ -1675,7 +1758,7 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1675
1758
|
}
|
|
1676
1759
|
var d = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? u : c;
|
|
1677
1760
|
e.useSyncExternalStore = t.useSyncExternalStore === void 0 ? d : t.useSyncExternalStore;
|
|
1678
|
-
})),
|
|
1761
|
+
})), Bt = /* @__PURE__ */ t(((e) => {
|
|
1679
1762
|
process.env.NODE_ENV !== "production" && (function() {
|
|
1680
1763
|
function t(e, t) {
|
|
1681
1764
|
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
@@ -1718,13 +1801,13 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1718
1801
|
return t();
|
|
1719
1802
|
}
|
|
1720
1803
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
1721
|
-
var a =
|
|
1804
|
+
var a = Rt(), o = typeof Object.is == "function" ? Object.is : t, s = a.useState, c = a.useEffect, l = a.useLayoutEffect, u = a.useDebugValue, d = !1, f = !1, p = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? i : n;
|
|
1722
1805
|
e.useSyncExternalStore = a.useSyncExternalStore === void 0 ? p : a.useSyncExternalStore, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
1723
1806
|
})();
|
|
1724
|
-
})),
|
|
1725
|
-
t.exports = process.env.NODE_ENV === "production" ?
|
|
1726
|
-
})),
|
|
1727
|
-
var t =
|
|
1807
|
+
})), Vt = /* @__PURE__ */ t(((e, t) => {
|
|
1808
|
+
t.exports = process.env.NODE_ENV === "production" ? zt() : Bt();
|
|
1809
|
+
})), Ht = /* @__PURE__ */ t(((e) => {
|
|
1810
|
+
var t = Rt(), n = Vt();
|
|
1728
1811
|
function r(e, t) {
|
|
1729
1812
|
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
1730
1813
|
}
|
|
@@ -1768,13 +1851,13 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1768
1851
|
f.hasValue = !0, f.value = p;
|
|
1769
1852
|
}, [p]), l(p), p;
|
|
1770
1853
|
};
|
|
1771
|
-
})),
|
|
1854
|
+
})), Ut = /* @__PURE__ */ t(((e) => {
|
|
1772
1855
|
process.env.NODE_ENV !== "production" && (function() {
|
|
1773
1856
|
function t(e, t) {
|
|
1774
1857
|
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
1775
1858
|
}
|
|
1776
1859
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
1777
|
-
var n =
|
|
1860
|
+
var n = Rt(), r = Vt(), i = typeof Object.is == "function" ? Object.is : t, a = r.useSyncExternalStore, o = n.useRef, s = n.useEffect, c = n.useMemo, l = n.useDebugValue;
|
|
1778
1861
|
e.useSyncExternalStoreWithSelector = function(e, t, n, r, u) {
|
|
1779
1862
|
var d = o(null);
|
|
1780
1863
|
if (d.current === null) {
|
|
@@ -1815,71 +1898,75 @@ var tt = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
|
1815
1898
|
}, [p]), l(p), p;
|
|
1816
1899
|
}, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
1817
1900
|
})();
|
|
1818
|
-
})), { useSyncExternalStoreWithSelector:
|
|
1819
|
-
t.exports = process.env.NODE_ENV === "production" ?
|
|
1820
|
-
})))(), 1)).default,
|
|
1821
|
-
function
|
|
1822
|
-
let r =
|
|
1823
|
-
return
|
|
1901
|
+
})), { useSyncExternalStoreWithSelector: Wt } = (/* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
|
|
1902
|
+
t.exports = process.env.NODE_ENV === "production" ? Ht() : Ut();
|
|
1903
|
+
})))(), 1)).default, Gt = (e) => e;
|
|
1904
|
+
function Kt(e, t = Gt, n) {
|
|
1905
|
+
let r = Wt(e.subscribe, e.getState, e.getInitialState, t, n);
|
|
1906
|
+
return I.useDebugValue(r), r;
|
|
1824
1907
|
}
|
|
1825
1908
|
// src/components/ui/Table/TableFiltersSidebarItem.tsx
|
|
1826
|
-
var
|
|
1827
|
-
let
|
|
1828
|
-
if (e.allowOnlyPreferredFilter || e.filterIds.length === 1) return [
|
|
1909
|
+
var qt = Ee, Jt = ({ filterDimension: e, onFilterVisibilityChange: t, showMissingValuesFilter: n, visibleFilterWithinDimension: r }) => {
|
|
1910
|
+
let i = Kt(v(), (e) => e.filters, (e, t) => JSON.stringify(e.map((e) => [e.filterValue, e.includeMissingValues])) === JSON.stringify(t.map((e) => [e.filterValue, e.includeMissingValues]))), a = e.filterIds.map((e) => i.find((t) => t.id === e)), { setValue: o } = Ae(), s = B(() => {
|
|
1911
|
+
if (e.allowOnlyPreferredFilter || e.filterIds.length === 1) return [a.find((t) => t?.id && t.id === e.preferredFilterId)].filter((e) => !!e);
|
|
1829
1912
|
if (!e.allowMultipleVisibleFilters) {
|
|
1830
|
-
let t =
|
|
1831
|
-
return [
|
|
1913
|
+
let t = r ?? e.preferredFilterId;
|
|
1914
|
+
return [a.find((e) => e?.id && e.id === t)].filter((e) => !!e);
|
|
1832
1915
|
}
|
|
1833
|
-
return
|
|
1916
|
+
return a;
|
|
1834
1917
|
}, [
|
|
1835
|
-
|
|
1918
|
+
a,
|
|
1836
1919
|
e.allowMultipleVisibleFilters,
|
|
1837
1920
|
e.allowOnlyPreferredFilter,
|
|
1838
1921
|
e.filterIds.length,
|
|
1839
1922
|
e.preferredFilterId,
|
|
1840
|
-
|
|
1841
|
-
]),
|
|
1842
|
-
|
|
1923
|
+
r
|
|
1924
|
+
]), c = B(() => a.length > 1 && !e.allowOnlyPreferredFilter && !e.allowMultipleVisibleFilters, [
|
|
1925
|
+
a.length,
|
|
1843
1926
|
e.allowMultipleVisibleFilters,
|
|
1844
1927
|
e.allowOnlyPreferredFilter
|
|
1845
|
-
]),
|
|
1846
|
-
items:
|
|
1847
|
-
active:
|
|
1928
|
+
]), l = B(() => !(a.length === 1 || e.allowOnlyPreferredFilter), [a.length, e.allowOnlyPreferredFilter]), u = B(() => c && s.length ? {
|
|
1929
|
+
items: a.map((r) => ({
|
|
1930
|
+
active: r === s[0],
|
|
1848
1931
|
callback: () => {
|
|
1849
|
-
t(e.id,
|
|
1850
|
-
e !==
|
|
1932
|
+
t(e.id, r.id), e.filterIds.forEach((e) => {
|
|
1933
|
+
if (e !== r.id) {
|
|
1934
|
+
let t = i.find((t) => t.id === e);
|
|
1935
|
+
o(e, t.initialFilterValue, { shouldDirty: !0 }), n && o(t.includeMissingValuesFormFieldName, !1, { shouldDirty: !0 });
|
|
1936
|
+
}
|
|
1851
1937
|
});
|
|
1852
1938
|
},
|
|
1853
|
-
label:
|
|
1939
|
+
label: r.label
|
|
1854
1940
|
})),
|
|
1855
|
-
label:
|
|
1941
|
+
label: s[0].label
|
|
1856
1942
|
} : null, [
|
|
1857
|
-
|
|
1943
|
+
a,
|
|
1858
1944
|
e.filterIds,
|
|
1859
1945
|
e.id,
|
|
1946
|
+
s,
|
|
1947
|
+
i,
|
|
1860
1948
|
o,
|
|
1861
|
-
r,
|
|
1862
|
-
a,
|
|
1863
1949
|
t,
|
|
1864
|
-
|
|
1950
|
+
c,
|
|
1951
|
+
n
|
|
1865
1952
|
]);
|
|
1866
|
-
return
|
|
1953
|
+
return s.length ? /* @__PURE__ */ G(j, {
|
|
1867
1954
|
sx: { mb: 2 },
|
|
1868
1955
|
children: [
|
|
1869
|
-
|
|
1956
|
+
l && /* @__PURE__ */ G(j, {
|
|
1870
1957
|
sx: {
|
|
1871
1958
|
alignItems: "center",
|
|
1872
1959
|
display: "flex",
|
|
1873
1960
|
justifyContent: "space-between"
|
|
1874
1961
|
},
|
|
1875
|
-
children: [/* @__PURE__ */
|
|
1962
|
+
children: [/* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(le, {
|
|
1876
1963
|
sx: {
|
|
1877
1964
|
margin: 0,
|
|
1878
1965
|
padding: 0
|
|
1879
1966
|
},
|
|
1880
1967
|
variant: "h6",
|
|
1881
1968
|
children: e.label
|
|
1882
|
-
}) }),
|
|
1969
|
+
}) }), c && /* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(Je, {
|
|
1883
1970
|
ButtonProps: {
|
|
1884
1971
|
color: "inherit",
|
|
1885
1972
|
size: "small",
|
|
@@ -1892,100 +1979,122 @@ var Pt = Te, Ft = ({ filterDimension: e, onFilterVisibilityChange: t, visibleFil
|
|
|
1892
1979
|
},
|
|
1893
1980
|
variant: "text"
|
|
1894
1981
|
},
|
|
1895
|
-
menuItemsData:
|
|
1982
|
+
menuItemsData: u
|
|
1896
1983
|
}) })]
|
|
1897
1984
|
}),
|
|
1898
|
-
|
|
1985
|
+
s.map((e) => /* @__PURE__ */ W(j, {
|
|
1899
1986
|
sx: { my: 1 },
|
|
1900
|
-
children: /* @__PURE__ */
|
|
1987
|
+
children: /* @__PURE__ */ W(ht, { filter: e })
|
|
1901
1988
|
}, e.id)),
|
|
1902
|
-
/* @__PURE__ */
|
|
1989
|
+
/* @__PURE__ */ W(ae, {})
|
|
1903
1990
|
]
|
|
1904
1991
|
}, e.id) : null;
|
|
1905
|
-
},
|
|
1906
|
-
let { t } =
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1992
|
+
}, Yt = ({ onClose: e }) => {
|
|
1993
|
+
let { t } = K(), n = v(), r = m(n, (e) => e.setFilterValues), i = m(n, (e) => e.filterDimensions), a = Kt(n, (e) => e.filters, (e, t) => JSON.stringify(e.map((e) => [e.filterValue, e.includeMissingValues])) === JSON.stringify(t.map((e) => [e.filterValue, e.includeMissingValues]))), o = m(n, (e) => e.filters.some((e) => e.isFilterActive())), s = m(n, (e) => e.showMissingValuesFilter), c = m(n, (e) => e.resetFilters), l = m(n, (e) => e.visibleFilterWithinDimensions), u = m(n, (e) => e.setVisibleFilterWithinDimensions), [d, f] = H(l), p = B(() => {
|
|
1994
|
+
let e = Object.fromEntries(a.map((e) => [e.id, e.initialFilterValue]));
|
|
1995
|
+
return s && a.forEach((t) => {
|
|
1996
|
+
e[t.includeMissingValuesFormFieldName] = !1;
|
|
1997
|
+
}), e;
|
|
1998
|
+
}, [a, s]), h = B(() => {
|
|
1999
|
+
let e = Object.fromEntries(a.map((e) => [e.id, e.filterValue ?? e.initialFilterValue]));
|
|
2000
|
+
return s && a.forEach((t) => {
|
|
2001
|
+
e[t.includeMissingValuesFormFieldName] = t.includeMissingValues;
|
|
2002
|
+
}), e;
|
|
2003
|
+
}, [a, s]), g = ke({
|
|
2004
|
+
defaultValues: p,
|
|
2005
|
+
values: h
|
|
2006
|
+
}), _ = R((e, t) => {
|
|
2007
|
+
f((n) => ({
|
|
1911
2008
|
...n,
|
|
1912
2009
|
[e]: t
|
|
1913
2010
|
}));
|
|
1914
|
-
}, []), { control:
|
|
1915
|
-
control:
|
|
1916
|
-
defaultValue:
|
|
1917
|
-
}),
|
|
1918
|
-
|
|
2011
|
+
}, []), { control: y, formState: { isDirty: b }, handleSubmit: x, reset: S, setValue: C } = g, w = je({
|
|
2012
|
+
control: y,
|
|
2013
|
+
defaultValue: h
|
|
2014
|
+
}), T = B(() => a.some((e) => e.isFilterActive(w[e.id], s && w[e.includeMissingValuesFormFieldName] === !0)), [
|
|
2015
|
+
a,
|
|
2016
|
+
w,
|
|
2017
|
+
s
|
|
2018
|
+
]), E = R(async (t) => {
|
|
2019
|
+
await r(t), S(t), u(d), e();
|
|
1919
2020
|
}, [
|
|
1920
|
-
|
|
2021
|
+
d,
|
|
1921
2022
|
e,
|
|
1922
|
-
|
|
2023
|
+
S,
|
|
1923
2024
|
r,
|
|
1924
|
-
|
|
1925
|
-
]),
|
|
1926
|
-
|
|
2025
|
+
u
|
|
2026
|
+
]), D = R(async () => {
|
|
2027
|
+
S(p), await c(), u(d), e();
|
|
1927
2028
|
}, [
|
|
1928
|
-
|
|
1929
|
-
|
|
2029
|
+
p,
|
|
2030
|
+
d,
|
|
1930
2031
|
e,
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
]),
|
|
2032
|
+
S,
|
|
2033
|
+
c,
|
|
2034
|
+
u
|
|
2035
|
+
]), O = R((e) => {
|
|
1935
2036
|
let t = a.find((t) => t.id === e);
|
|
1936
|
-
|
|
1937
|
-
}, [
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
2037
|
+
C(e, t.initialFilterValue, { shouldDirty: !0 }), s && C(t.includeMissingValuesFormFieldName, !1, { shouldDirty: !0 });
|
|
2038
|
+
}, [
|
|
2039
|
+
a,
|
|
2040
|
+
C,
|
|
2041
|
+
s
|
|
2042
|
+
]), ee = B(() => a.filter((e) => e.showInSidebar), [a]);
|
|
2043
|
+
return /* @__PURE__ */ W(U, { children: !!a && !!h && !!p && /* @__PURE__ */ W(De, {
|
|
2044
|
+
...g,
|
|
2045
|
+
children: /* @__PURE__ */ G(j, {
|
|
1941
2046
|
autoComplete: "off",
|
|
1942
2047
|
component: "form",
|
|
1943
2048
|
id: "Filters",
|
|
1944
|
-
onSubmit:
|
|
2049
|
+
onSubmit: x(E),
|
|
1945
2050
|
sx: {
|
|
1946
2051
|
display: "grid",
|
|
1947
2052
|
gridTemplateRows: "max-content auto",
|
|
1948
2053
|
height: "100%"
|
|
1949
2054
|
},
|
|
1950
|
-
children: [/* @__PURE__ */
|
|
1951
|
-
|
|
2055
|
+
children: [/* @__PURE__ */ G(j, { children: [
|
|
2056
|
+
b && o && !T && /* @__PURE__ */ W(j, {
|
|
1952
2057
|
sx: { my: 1 },
|
|
1953
2058
|
children: t`All filters have been removed, but have not yet been applied.`
|
|
1954
2059
|
}),
|
|
1955
|
-
/* @__PURE__ */
|
|
1956
|
-
let
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
2060
|
+
/* @__PURE__ */ W(j, { children: a.map((e) => {
|
|
2061
|
+
let n = w[e.id], r = s && w[e.includeMissingValuesFormFieldName] === !0;
|
|
2062
|
+
if (e.isFilterActive(n, r)) {
|
|
2063
|
+
let i = [e.isInitialFilterValue(n) ? "" : e.getPresentationValue(n, t), r ? t`Missing` : ""].filter(Boolean).join(", ");
|
|
2064
|
+
return /* @__PURE__ */ G(j, {
|
|
2065
|
+
sx: {
|
|
2066
|
+
alignItems: "center",
|
|
2067
|
+
display: "grid",
|
|
2068
|
+
gap: 1,
|
|
2069
|
+
gridTemplateColumns: "auto max-content"
|
|
2070
|
+
},
|
|
2071
|
+
children: [/* @__PURE__ */ G(j, { children: [
|
|
2072
|
+
/* @__PURE__ */ W(j, {
|
|
2073
|
+
component: "span",
|
|
2074
|
+
children: e.label
|
|
2075
|
+
}),
|
|
2076
|
+
/* @__PURE__ */ W(j, {
|
|
2077
|
+
component: "span",
|
|
2078
|
+
children: ": "
|
|
2079
|
+
}),
|
|
2080
|
+
/* @__PURE__ */ W(j, {
|
|
2081
|
+
component: "strong",
|
|
2082
|
+
children: i
|
|
2083
|
+
})
|
|
2084
|
+
] }), /* @__PURE__ */ W(N, {
|
|
2085
|
+
"aria-label": t("Remove filter with label {{filterLabel}} and value {{filterValue}}", {
|
|
2086
|
+
filterLabel: e.label,
|
|
2087
|
+
filterValue: i
|
|
2088
|
+
}),
|
|
2089
|
+
onClick: () => O(e.id),
|
|
2090
|
+
size: "small",
|
|
2091
|
+
children: /* @__PURE__ */ W(qe, {})
|
|
2092
|
+
})]
|
|
2093
|
+
}, e.id);
|
|
2094
|
+
}
|
|
2095
|
+
return null;
|
|
1987
2096
|
}) }),
|
|
1988
|
-
(o ||
|
|
2097
|
+
(o || b) && /* @__PURE__ */ G(j, {
|
|
1989
2098
|
sx: {
|
|
1990
2099
|
display: "flex",
|
|
1991
2100
|
gap: 1,
|
|
@@ -1993,55 +2102,173 @@ var Pt = Te, Ft = ({ filterDimension: e, onFilterVisibilityChange: t, visibleFil
|
|
|
1993
2102
|
marginRight: 1,
|
|
1994
2103
|
my: 1
|
|
1995
2104
|
},
|
|
1996
|
-
children: [/* @__PURE__ */
|
|
1997
|
-
...
|
|
2105
|
+
children: [/* @__PURE__ */ W(re, {
|
|
2106
|
+
...q.createAttributes("TableFiltersSidebarItem-reset"),
|
|
1998
2107
|
color: "primary",
|
|
1999
|
-
onClick:
|
|
2000
|
-
startIcon: /* @__PURE__ */
|
|
2108
|
+
onClick: D,
|
|
2109
|
+
startIcon: /* @__PURE__ */ W(Ke, {}),
|
|
2001
2110
|
variant: "outlined",
|
|
2002
2111
|
children: t`Reset`
|
|
2003
|
-
}), /* @__PURE__ */
|
|
2004
|
-
...
|
|
2112
|
+
}), /* @__PURE__ */ W(re, {
|
|
2113
|
+
...q.createAttributes("TableFiltersSidebarItem-apply"),
|
|
2005
2114
|
color: "secondary",
|
|
2006
|
-
startIcon: /* @__PURE__ */
|
|
2115
|
+
startIcon: /* @__PURE__ */ W(Ge, {}),
|
|
2007
2116
|
type: "submit",
|
|
2008
2117
|
children: t`Apply`
|
|
2009
2118
|
})]
|
|
2010
2119
|
})
|
|
2011
|
-
] }), /* @__PURE__ */
|
|
2120
|
+
] }), /* @__PURE__ */ G(j, {
|
|
2012
2121
|
sx: {
|
|
2013
2122
|
overflowY: "auto",
|
|
2014
2123
|
paddingRight: 1
|
|
2015
2124
|
},
|
|
2016
|
-
children: [i.length > 0 && /* @__PURE__ */
|
|
2125
|
+
children: [i.length > 0 && /* @__PURE__ */ W(U, { children: i.filter((e) => e.filterIds.length).map((e) => /* @__PURE__ */ W(Jt, {
|
|
2017
2126
|
filterDimension: e,
|
|
2018
|
-
onFilterVisibilityChange:
|
|
2019
|
-
|
|
2020
|
-
|
|
2127
|
+
onFilterVisibilityChange: _,
|
|
2128
|
+
showMissingValuesFilter: s,
|
|
2129
|
+
visibleFilterWithinDimension: d[e.id]
|
|
2130
|
+
}, e.id)) }), i.length === 0 && /* @__PURE__ */ W(U, { children: ee.map((e) => /* @__PURE__ */ G(j, {
|
|
2021
2131
|
sx: { my: 2 },
|
|
2022
|
-
children: [/* @__PURE__ */
|
|
2132
|
+
children: [/* @__PURE__ */ W(j, {
|
|
2023
2133
|
sx: { my: 1 },
|
|
2024
|
-
children: /* @__PURE__ */
|
|
2025
|
-
}), /* @__PURE__ */
|
|
2134
|
+
children: /* @__PURE__ */ W(ht, { filter: e })
|
|
2135
|
+
}), /* @__PURE__ */ W(ae, {})]
|
|
2026
2136
|
}, e.id)) })]
|
|
2027
2137
|
})]
|
|
2028
2138
|
})
|
|
2029
2139
|
}) });
|
|
2030
|
-
},
|
|
2031
|
-
let { t: n } =
|
|
2032
|
-
return /* @__PURE__ */
|
|
2033
|
-
closeIcon: /* @__PURE__ */
|
|
2140
|
+
}, Xt = ({ onClose: e, open: t }) => {
|
|
2141
|
+
let { t: n } = K();
|
|
2142
|
+
return /* @__PURE__ */ W(O, {
|
|
2143
|
+
closeIcon: /* @__PURE__ */ W(qt, {}),
|
|
2034
2144
|
closeIconTooltipText: n`Close filters`,
|
|
2035
2145
|
onClose: e,
|
|
2036
2146
|
open: t,
|
|
2037
2147
|
testIdAttributes: { name: "tableFiltersSidebarItem" },
|
|
2038
2148
|
title: n`Filters`,
|
|
2039
2149
|
width: 60,
|
|
2040
|
-
children: t && /* @__PURE__ */
|
|
2150
|
+
children: t && /* @__PURE__ */ W(Yt, { onClose: e })
|
|
2041
2151
|
});
|
|
2042
|
-
},
|
|
2043
|
-
let t =
|
|
2044
|
-
|
|
2152
|
+
}, Zt = ({ hasCellData: e }) => {
|
|
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(() => {
|
|
2154
|
+
n("openColumnsEditorDialog", e);
|
|
2155
|
+
}, [n, e]), f = R((e) => {
|
|
2156
|
+
let t = _(a, (t) => t.includes(e) ? t.filter((t) => t !== e) : (t.push(e), t));
|
|
2157
|
+
n("columnVisibilityChange", t);
|
|
2158
|
+
}, [n, a]), h = R((e) => {
|
|
2159
|
+
let t = e.every((e) => a.includes(e)), r = _(a, (n) => t ? n.filter((t) => !e.includes(t)) : (e.forEach((e) => {
|
|
2160
|
+
n.includes(e) || n.push(e);
|
|
2161
|
+
}), n));
|
|
2162
|
+
n("columnVisibilityChange", r);
|
|
2163
|
+
}, [n, a]), g = R(() => {
|
|
2164
|
+
n("columnVisibilityChange", p.getColumnIdsWithData({
|
|
2165
|
+
dataContext: i,
|
|
2166
|
+
hasCellData: e,
|
|
2167
|
+
sortedData: c,
|
|
2168
|
+
tableColumns: r,
|
|
2169
|
+
visibleColumnIds: a
|
|
2170
|
+
}));
|
|
2171
|
+
}, [
|
|
2172
|
+
n,
|
|
2173
|
+
e,
|
|
2174
|
+
c,
|
|
2175
|
+
r,
|
|
2176
|
+
a,
|
|
2177
|
+
i
|
|
2178
|
+
]), y = R(() => {
|
|
2179
|
+
n("condensedChange", !s);
|
|
2180
|
+
}, [n, s]);
|
|
2181
|
+
return B(() => {
|
|
2182
|
+
let e = [
|
|
2183
|
+
u ? {
|
|
2184
|
+
autoCloseDisabled: !0,
|
|
2185
|
+
callback: () => y(),
|
|
2186
|
+
checked: s ? "true" : "false",
|
|
2187
|
+
divider: !0,
|
|
2188
|
+
label: l`Condensed`,
|
|
2189
|
+
rightIcon: W(s ? Qe : Ze, {})
|
|
2190
|
+
} : void 0,
|
|
2191
|
+
{
|
|
2192
|
+
callback: () => d(),
|
|
2193
|
+
divider: !0,
|
|
2194
|
+
label: l`Column editor`,
|
|
2195
|
+
leftIcon: /* @__PURE__ */ W($e, { sx: { fontSize: "1.5rem" } })
|
|
2196
|
+
},
|
|
2197
|
+
{
|
|
2198
|
+
autoCloseDisabled: !0,
|
|
2199
|
+
callback: () => n("reset"),
|
|
2200
|
+
label: l`Reset`
|
|
2201
|
+
},
|
|
2202
|
+
{
|
|
2203
|
+
autoCloseDisabled: !0,
|
|
2204
|
+
callback: () => {
|
|
2205
|
+
n("columnVisibilityChange", [...r.map((e) => e.id)]);
|
|
2206
|
+
},
|
|
2207
|
+
label: l`Show all`
|
|
2208
|
+
},
|
|
2209
|
+
{
|
|
2210
|
+
autoCloseDisabled: !0,
|
|
2211
|
+
callback: () => {
|
|
2212
|
+
n("columnVisibilityChange", [...r.filter((e) => e.frozen).map((e) => e.id)]);
|
|
2213
|
+
},
|
|
2214
|
+
label: l`Hide all`
|
|
2215
|
+
},
|
|
2216
|
+
{
|
|
2217
|
+
autoCloseDisabled: !0,
|
|
2218
|
+
callback: () => g(),
|
|
2219
|
+
divider: !0,
|
|
2220
|
+
label: l`Hide columns without data`
|
|
2221
|
+
}
|
|
2222
|
+
].filter((e) => e);
|
|
2223
|
+
return o ? o.forEach((t) => {
|
|
2224
|
+
let n = t.columnIds.every((e) => a.includes(e)), i = t.columnIds.some((e) => a.includes(e));
|
|
2225
|
+
e.push({
|
|
2226
|
+
autoCloseDisabled: !0,
|
|
2227
|
+
callback: () => h(t.columnIds),
|
|
2228
|
+
checked: n ? "true" : i ? "mixed" : "false",
|
|
2229
|
+
items: t.columnIds.map((e) => {
|
|
2230
|
+
let t = a.includes(e);
|
|
2231
|
+
return {
|
|
2232
|
+
autoCloseDisabled: !0,
|
|
2233
|
+
callback: () => f(e),
|
|
2234
|
+
checked: t ? "true" : "false",
|
|
2235
|
+
label: r.find((t) => t.id === e)?.headerName ?? "",
|
|
2236
|
+
rightIcon: W(t ? Ye : Xe, {})
|
|
2237
|
+
};
|
|
2238
|
+
}),
|
|
2239
|
+
label: t.label,
|
|
2240
|
+
rightIcon: W(n ? Ye : i ? X : Xe, {})
|
|
2241
|
+
});
|
|
2242
|
+
}) : r.filter((e) => !e.frozen).forEach((t) => {
|
|
2243
|
+
let n = a.includes(t.id);
|
|
2244
|
+
e.push({
|
|
2245
|
+
autoCloseDisabled: !0,
|
|
2246
|
+
callback: () => f(t.id),
|
|
2247
|
+
checked: n ? "true" : "false",
|
|
2248
|
+
label: t.headerName,
|
|
2249
|
+
rightIcon: W(n ? Ye : Xe, {})
|
|
2250
|
+
});
|
|
2251
|
+
}), {
|
|
2252
|
+
items: e,
|
|
2253
|
+
label: l`Columns`
|
|
2254
|
+
};
|
|
2255
|
+
}, [
|
|
2256
|
+
s,
|
|
2257
|
+
u,
|
|
2258
|
+
l,
|
|
2259
|
+
o,
|
|
2260
|
+
y,
|
|
2261
|
+
d,
|
|
2262
|
+
n,
|
|
2263
|
+
r,
|
|
2264
|
+
g,
|
|
2265
|
+
a,
|
|
2266
|
+
h,
|
|
2267
|
+
f
|
|
2268
|
+
]);
|
|
2269
|
+
}, Qt = ({ ContainerProps: e }) => {
|
|
2270
|
+
let t = Zt({});
|
|
2271
|
+
return /* @__PURE__ */ W(Je, {
|
|
2045
2272
|
ButtonProps: {
|
|
2046
2273
|
color: "primary",
|
|
2047
2274
|
size: "small",
|
|
@@ -2051,36 +2278,143 @@ var Pt = Te, Ft = ({ filterDimension: e, onFilterVisibilityChange: t, visibleFil
|
|
|
2051
2278
|
menuItemsData: t,
|
|
2052
2279
|
MenuProps: { elevation: 3 }
|
|
2053
2280
|
});
|
|
2054
|
-
},
|
|
2281
|
+
}, $t = ({ header: e, headerComponent: t = "h3", headerVariant: n = "h5", showTableMenu: r = !0 }) => /* @__PURE__ */ G(j, {
|
|
2055
2282
|
sx: {
|
|
2056
2283
|
alignItems: "center",
|
|
2057
2284
|
display: "flex",
|
|
2058
2285
|
justifyContent: e ? "space-between" : "flex-end"
|
|
2059
2286
|
},
|
|
2060
|
-
children: [e && /* @__PURE__ */
|
|
2287
|
+
children: [e && /* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(Lt, {
|
|
2061
2288
|
caption: e,
|
|
2062
2289
|
component: t,
|
|
2063
2290
|
variant: n
|
|
2064
|
-
}) }), r && /* @__PURE__ */
|
|
2065
|
-
}),
|
|
2066
|
-
let t =
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
}
|
|
2080
|
-
|
|
2081
|
-
|
|
2291
|
+
}) }), r && /* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(Qt, {}) })]
|
|
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(() => {
|
|
2294
|
+
let { idSelectorCallback: e, selectedIds: t, sortedData: r } = n.getState();
|
|
2295
|
+
return r.filter((n) => t.includes(e(n)));
|
|
2296
|
+
}, [n]), c = R(async () => {
|
|
2297
|
+
await p.downloadAsExcel(n.getState().sortedData, a(), o(), e ? `${e}.xlsx` : "all_rows.xlsx", i);
|
|
2298
|
+
}, [
|
|
2299
|
+
i,
|
|
2300
|
+
e,
|
|
2301
|
+
o,
|
|
2302
|
+
a,
|
|
2303
|
+
n
|
|
2304
|
+
]), l = R(() => {
|
|
2305
|
+
p.downloadAsCSV(n.getState().sortedData, a(), o(), e ? `${e}.csv` : "all_rows.csv", i);
|
|
2306
|
+
}, [
|
|
2307
|
+
i,
|
|
2308
|
+
e,
|
|
2309
|
+
o,
|
|
2310
|
+
a,
|
|
2311
|
+
n
|
|
2312
|
+
]), u = R(async () => {
|
|
2313
|
+
await p.downloadAsExcel(s(), a(), o(), e ? `${e}__selected_rows.xlsx` : "selected_rows.xlsx", i);
|
|
2314
|
+
}, [
|
|
2315
|
+
i,
|
|
2316
|
+
e,
|
|
2317
|
+
o,
|
|
2318
|
+
s,
|
|
2319
|
+
a
|
|
2320
|
+
]), d = R(() => {
|
|
2321
|
+
p.downloadAsCSV(s(), a(), o(), e ? `${e}__selected_rows.csv` : "selected_rows.csv", i);
|
|
2322
|
+
}, [
|
|
2323
|
+
i,
|
|
2324
|
+
e,
|
|
2325
|
+
o,
|
|
2326
|
+
s,
|
|
2327
|
+
a
|
|
2328
|
+
]);
|
|
2329
|
+
return /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ G(j, { children: [/* @__PURE__ */ W(le, {
|
|
2330
|
+
variant: "h6",
|
|
2331
|
+
children: t`All rows`
|
|
2332
|
+
}), /* @__PURE__ */ G(j, {
|
|
2333
|
+
sx: { marginLeft: 1 },
|
|
2334
|
+
children: [/* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(P, {
|
|
2335
|
+
component: "button",
|
|
2336
|
+
onClick: c,
|
|
2337
|
+
tabIndex: 0,
|
|
2338
|
+
children: t`Download all rows as Excel`
|
|
2339
|
+
}) }), /* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(P, {
|
|
2340
|
+
component: "button",
|
|
2341
|
+
onClick: l,
|
|
2342
|
+
tabIndex: 0,
|
|
2343
|
+
children: t`Download all rows as CSV`
|
|
2344
|
+
}) })]
|
|
2345
|
+
})] }), r && /* @__PURE__ */ G(j, {
|
|
2346
|
+
sx: { my: 1 },
|
|
2347
|
+
children: [/* @__PURE__ */ W(le, {
|
|
2348
|
+
variant: "h6",
|
|
2349
|
+
children: t`Selected rows`
|
|
2350
|
+
}), /* @__PURE__ */ G(j, {
|
|
2351
|
+
sx: { marginLeft: 1 },
|
|
2352
|
+
children: [/* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(P, {
|
|
2353
|
+
component: "button",
|
|
2354
|
+
onClick: u,
|
|
2355
|
+
tabIndex: 0,
|
|
2356
|
+
children: t`Download selected rows as Excel`
|
|
2357
|
+
}) }), /* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(P, {
|
|
2358
|
+
component: "button",
|
|
2359
|
+
onClick: d,
|
|
2360
|
+
tabIndex: 0,
|
|
2361
|
+
children: t`Download selected rows as CSV`
|
|
2362
|
+
}) })]
|
|
2363
|
+
})]
|
|
2082
2364
|
})] });
|
|
2365
|
+
}, nn = ({ downloadAsFileName: e, onClose: t, open: n }) => {
|
|
2366
|
+
let { t: r } = K();
|
|
2367
|
+
return /* @__PURE__ */ W(O, {
|
|
2368
|
+
closeIcon: /* @__PURE__ */ W(en, {}),
|
|
2369
|
+
closeIconTooltipText: r`Close download`,
|
|
2370
|
+
onClose: t,
|
|
2371
|
+
open: n,
|
|
2372
|
+
testIdAttributes: { name: "tableDownloadSidebarItem" },
|
|
2373
|
+
title: r`Download`,
|
|
2374
|
+
width: 60,
|
|
2375
|
+
children: n && /* @__PURE__ */ W(tn, { downloadAsFileName: e })
|
|
2376
|
+
});
|
|
2377
|
+
}, rn = ({ downloadAsFileName: e, extraSidebarMenuItems: t }) => {
|
|
2378
|
+
let n = v(), r = m(n, (e) => e.filters.filter((e) => e.isFilterActive()).length), [i, a] = H(!1), [o, s] = H(!1), c = R(() => {
|
|
2379
|
+
a(!1);
|
|
2380
|
+
}, []), l = R(() => {
|
|
2381
|
+
s(!1);
|
|
2382
|
+
}, []), u = R(() => {
|
|
2383
|
+
a(!0);
|
|
2384
|
+
}, []), d = R(() => {
|
|
2385
|
+
s(!0);
|
|
2386
|
+
}, []);
|
|
2387
|
+
return /* @__PURE__ */ G(U, { children: [
|
|
2388
|
+
/* @__PURE__ */ G(ee, { children: [
|
|
2389
|
+
/* @__PURE__ */ W(k, {
|
|
2390
|
+
badgeColor: "secondary",
|
|
2391
|
+
badgeContent: r,
|
|
2392
|
+
first: !0,
|
|
2393
|
+
icon: /* @__PURE__ */ W(qt, {}),
|
|
2394
|
+
onClick: u,
|
|
2395
|
+
testIdAttributes: { name: "filters" },
|
|
2396
|
+
title: A`Open filters`
|
|
2397
|
+
}),
|
|
2398
|
+
/* @__PURE__ */ W(k, {
|
|
2399
|
+
badgeColor: "secondary",
|
|
2400
|
+
icon: /* @__PURE__ */ W(en, {}),
|
|
2401
|
+
onClick: d,
|
|
2402
|
+
testIdAttributes: { name: "download" },
|
|
2403
|
+
title: A`Open download`
|
|
2404
|
+
}),
|
|
2405
|
+
t
|
|
2406
|
+
] }),
|
|
2407
|
+
/* @__PURE__ */ W(Xt, {
|
|
2408
|
+
onClose: c,
|
|
2409
|
+
open: i
|
|
2410
|
+
}),
|
|
2411
|
+
/* @__PURE__ */ W(nn, {
|
|
2412
|
+
downloadAsFileName: e,
|
|
2413
|
+
onClose: l,
|
|
2414
|
+
open: o
|
|
2415
|
+
})
|
|
2416
|
+
] });
|
|
2083
2417
|
};
|
|
2084
|
-
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 };
|
|
2085
2419
|
|
|
2086
2420
|
//# sourceMappingURL=Table.js.map
|