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