@astrato-io/visualizations 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -25
- package/THIRD_PARTY_NOTICES.md +307 -378
- package/chunks/{Button-BrGKp9Nm.js → Button-5CxPEACP.js} +11 -11
- package/chunks/CircularProgress-DFS-LQb7.js +765 -0
- package/chunks/FieldTypeIcon-pSVQFemC.js +22 -0
- package/chunks/LinearProgress-CjIQfkNA.js +327 -0
- package/chunks/{MenuOption-ByRqhRdX.js → MenuOption-Cb7B7x6z.js} +1384 -1002
- package/chunks/Title-CtFw1bVg.js +1804 -0
- package/chunks/ToggleButton-Br9HCPCv.js +150 -0
- package/chunks/{app-filter-bar.compiler-TwVTeoj5.js → app-filter-bar.compiler-B9775gLJ.js} +3 -3
- package/chunks/{bar.compiler-DuQg8EUb.js → bar.compiler-B7wlH_Ro.js} +4 -4
- package/chunks/{builder-DEDvNq1k.js → builder-Dxo7D7c6.js} +118 -55
- package/chunks/{coloring-CncX_JRX.js → coloring-B-Wa8D5P.js} +3 -3
- package/chunks/contains-BK-sRXcB.js +21 -0
- package/chunks/{definitions-BPJQTx16.js → definitions-DNpzD9tY.js} +26 -26
- package/chunks/{escobar-DRhRMYRE.js → escobar-C4Nm3eJ7.js} +4436 -4802
- package/chunks/{extend-preset-CUFNpmPe.js → extend-preset-BVKFtoe-.js} +46 -46
- package/chunks/{filter.compiler-w27dlv0C.js → filter.compiler-BlS3zoy_.js} +7 -7
- package/chunks/{filtering-cc7WqWpg.js → filtering-CGuLpg7u.js} +494 -270
- package/chunks/{handlers-TOT-7INo.js → handlers-CMbyj5y1.js} +1513 -1454
- package/chunks/{icon-picker-styles-CoJmwTRi.js → icon-picker-styles-DYQgVEKG.js} +8 -8
- package/chunks/{isEqual-B8loyPsC.js → isEqual-DBg_b35N.js} +1 -1
- package/chunks/isFocusVisible-B1_z03UT.js +144 -0
- package/chunks/{line.compiler-Ct1WhN2p.js → line.compiler-Bo9i9qag.js} +7 -7
- package/chunks/{logger-DpQtYQnX.js → logger-3lng-wOw.js} +7 -3
- package/chunks/{metadata-WABZrt7Y.js → metadata-Fmx1swpK.js} +1 -1
- package/chunks/{number.compiler-D8TPly-4.js → number.compiler-CdLd5aGW.js} +7 -7
- package/chunks/{operations-Dh4v1Ovt.js → operations-HSqnCRvv.js} +9156 -9112
- package/chunks/{range-Bi-7zT0k.js → range-CzO4isKK.js} +2 -2
- package/chunks/react-dom-BwZT0N3F.js +368 -0
- package/chunks/{render-wrappers-OEmtaM8g.js → render-wrappers-CAuvgMxi.js} +1 -1
- package/chunks/{requirements-PAoRaJyb.js → requirements-CYpVh65U.js} +330 -302
- package/chunks/responsive.styles-FItb913l.js +93 -0
- package/chunks/{shared-Bn4N5QcZ.js → shared-DFoJxjVN.js} +401 -401
- package/chunks/{standalone-D__XCp-h.js → standalone-530a5lvf.js} +306 -306
- package/chunks/{standalone-CXNP6-xD.js → standalone-5DnapeHH.js} +112 -112
- package/chunks/{standalone-XTgSsTAa.js → standalone-B4jrf4KE.js} +70 -70
- package/chunks/{standalone-Bes8srx1.js → standalone-B6s_xG2u.js} +14 -14
- package/chunks/{standalone-DVTJwsTY.js → standalone-BDrQMxLi.js} +623 -614
- package/chunks/standalone-BMoJXGYe.js +2 -0
- package/chunks/{standalone-CLmGb7nn2.js → standalone-BfvGggeM2.js} +76 -76
- package/chunks/{standalone-D5Q5ngsD.js → standalone-BvWdpUL3.js} +26 -26
- package/chunks/{standalone-we5D5MIn.js → standalone-C6XDHYAM.js} +31 -31
- package/chunks/standalone-CMJJIi9v.js +2 -0
- package/chunks/{standalone-C8ZAEutO.js → standalone-CNkHsynO.js} +28 -28
- package/chunks/{standalone-BMTCb10X.js → standalone-CPUiiWNP.js} +5 -5
- package/chunks/{standalone-XuGksArp.js → standalone-CXniic5x.js} +9 -9
- package/chunks/standalone-C_Jd4gkj.js +6 -0
- package/chunks/{standalone-DW6NT205.js → standalone-CiaaibTa.js} +142 -142
- package/chunks/standalone-CoQxJ6ov.js +3638 -0
- package/chunks/{standalone-CM5XcAN5.js → standalone-Cu73fzSr.js} +7660 -7534
- package/chunks/standalone-DBeXQrwH.js +468 -0
- package/chunks/{standalone-DMcI1afI.js → standalone-DMCwtebn.js} +81 -81
- package/chunks/{standalone-BlMIwpEe.js → standalone-DWPfdP0A.js} +800 -668
- package/chunks/{standalone-DLlyRIE6.js → standalone-DpSRmAWx.js} +59 -59
- package/chunks/{standalone-BGkmozIb.js → standalone-DuwTOBXH.js} +256 -256
- package/chunks/{standalone-BDhPQtzQ.js → standalone-LFVgLhia.js} +234 -234
- package/chunks/{standalone-B55oyW6c.js → standalone-kzAhwH19.js} +149 -149
- package/chunks/{standalone-DN4S1MjT.js → standalone-mb7LwEiq.js} +885 -885
- package/chunks/{standalone-CJvIXsQE.js → standalone-r4ObFvys.js} +155 -155
- package/chunks/{table.compiler-DMeeHxb6.js → table.compiler-C1qjqXaT.js} +7 -7
- package/chunks/{typeof-CJDtcySz.js → typeof-DCq3QgvY.js} +6 -1
- package/chunks/useFieldName-mWrD_uk_.js +7 -0
- package/chunks/{utils-vdmi_2PK.js → utils-DYYD4Zzf.js} +7593 -12707
- package/chunks/{view-BuwQugKb.js → view-7fH6mGmY.js} +2034 -2070
- package/chunks/{visualization-filters-Cc4KU-l-.js → visualization-filters-mVnsnvLP.js} +3581 -3555
- package/chunks/with-html-element-B0Clt4jY.js +15901 -0
- package/definitions.js +2 -2
- package/docs/operations/astrato-app-filter-bar.md +1 -1
- package/docs/operations/bar.md +1 -1
- package/docs/operations/combo.md +1 -1
- package/docs/operations/date-picker.md +1 -1
- package/docs/operations/distribution-gauge.md +1 -1
- package/docs/operations/dot.md +1 -1
- package/docs/operations/filter.md +1 -1
- package/docs/operations/gauge.md +1 -1
- package/docs/operations/heatMap.md +1 -1
- package/docs/operations/histogram.md +1 -1
- package/docs/operations/iframe.md +1 -1
- package/docs/operations/image.md +1 -1
- package/docs/operations/index.md +2 -2
- package/docs/operations/line.md +1 -1
- package/docs/operations/number.md +1 -1
- package/docs/operations/pie.md +1 -1
- package/docs/operations/radar.md +1 -1
- package/docs/operations/sankey.md +1 -1
- package/docs/operations/scatter.md +1 -1
- package/docs/operations/shape.md +1 -1
- package/docs/operations/simpleTextObject.md +1 -1
- package/docs/operations/slider.md +1 -1
- package/docs/operations/table.md +66 -1
- package/docs/operations/tree.md +1 -1
- package/docs/operations/treemap.md +1 -1
- package/docs/operations/waterfall.md +1 -1
- package/docs/operations/word-cloud.md +1 -1
- package/getters.js +2 -2
- package/index.js +1191 -3
- package/metadata.js +15 -16
- package/operations.js +5 -5
- package/package.json +67 -102
- package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +348 -348
- package/src/definitions/model/definitions/schema-registry.d.ts +101 -101
- package/src/definitions/model/definitions/schemas/bar.schema.d.ts +8 -8
- package/src/definitions/model/definitions/schemas/common.schema.d.ts +29 -29
- package/src/definitions/model/definitions/schemas/line.schema.d.ts +10 -10
- package/src/definitions/model/definitions/schemas/number.schema.d.ts +4 -4
- package/src/definitions/model/definitions/schemas/object.schema.d.ts +38 -38
- package/src/definitions/model/definitions/schemas/table.schema.d.ts +61 -61
- package/src/getters/index.d.ts +3 -3
- package/src/index.d.ts +1 -1
- package/src/operations/index.d.ts +3 -3
- package/src/runtime/index.d.ts +2 -2
- package/src/types.d.ts +4 -8
- package/src/visualization-catalog.d.ts +26 -26
- package/src/web-components/index.d.ts +3 -3
- package/chunks/DefaultPropsProvider-BsfB7QTn.js +0 -257
- package/chunks/FieldTypeIcon-Drs6hSJF.js +0 -22
- package/chunks/LinearProgress-VtfFx2vJ.js +0 -253
- package/chunks/Title-CO5dP1ma.js +0 -1691
- package/chunks/ToggleButton-KOBAimC1.js +0 -112
- package/chunks/colorManipulator-D8Pjy1pf.js +0 -45
- package/chunks/registry-KervaxqJ.js +0 -31
- package/chunks/responsive.styles-DSiOGD7u.js +0 -82
- package/chunks/standalone-BXKRE_Se.js +0 -468
- package/chunks/standalone-BjZp0QMe.js +0 -2
- package/chunks/standalone-C8qAelL4.js +0 -2
- package/chunks/standalone-DT0wKji7.js +0 -6
- package/chunks/standalone-DYQIQH4c.js +0 -2095
- package/chunks/useFieldName-Cjn9KCVp.js +0 -7
- package/chunks/useSlotProps-DLbQp4lc.js +0 -166
- package/chunks/web-components-DqClFkgO.js +0 -1185
- package/chunks/with-html-element-D0uY2zjI.js +0 -7328
- package/render.js +0 -10
- package/src/charts/bar.d.ts +0 -1
- package/src/charts/combo.d.ts +0 -1
- package/src/charts/dot.d.ts +0 -1
- package/src/charts/gauge-distribution.d.ts +0 -1
- package/src/charts/gauge.d.ts +0 -1
- package/src/charts/heat-map.d.ts +0 -1
- package/src/charts/histogram.d.ts +0 -1
- package/src/charts/line.d.ts +0 -1
- package/src/charts/pie.d.ts +0 -1
- package/src/charts/radar.d.ts +0 -1
- package/src/charts/sankey.d.ts +0 -1
- package/src/charts/scatter.d.ts +0 -1
- package/src/charts/table.d.ts +0 -1
- package/src/charts/tree.d.ts +0 -1
- package/src/charts/treemap.d.ts +0 -1
- package/src/charts/waterfall.d.ts +0 -1
- package/src/charts/word-cloud.d.ts +0 -1
- package/src/objects/app-filter-bar.d.ts +0 -1
- package/src/objects/date-picker.d.ts +0 -1
- package/src/objects/filter.d.ts +0 -1
- package/src/objects/iframe.d.ts +0 -1
- package/src/objects/image.d.ts +0 -1
- package/src/objects/number.d.ts +0 -1
- package/src/objects/shape.d.ts +0 -1
- package/src/objects/slider.d.ts +0 -1
- package/src/objects/text.d.ts +0 -1
- package/src/registry/create-visualization-registry.d.ts +0 -5
- package/src/render/index.d.ts +0 -34
- /package/chunks/{src-BOS6SqkZ.js → src-BOS6SqkZ2.js} +0 -0
|
@@ -0,0 +1,3638 @@
|
|
|
1
|
+
import { o as e } from "./rolldown-runtime-DleVn1XH.js";
|
|
2
|
+
import { Da as t, Ei as n, Hi as r, Oa as i, Pi as a, Vo as o, _c as s, da as c, ka as l, wi as u, zi as d } from "./visualization-filters-mVnsnvLP.js";
|
|
3
|
+
import { $ as f, A as p, Er as m, G as h, Jt as g, K as _, Ot as v, Rn as y, Sn as b, St as x, W as S, X as C, Y as w, Z as T, c as E, ei as D, f as O, h as k, it as A, jr as j, k as M, l as N, m as P, mn as F, n as I, vr as L, wr as R } from "./utils-DYYD4Zzf.js";
|
|
4
|
+
import { s as ee } from "./logger-3lng-wOw.js";
|
|
5
|
+
import { A as z, I as te, P as ne, a as re, d as B, h as ie, m as ae, u as oe } from "./MenuOption-Cb7B7x6z.js";
|
|
6
|
+
import { C as se, a as ce, b as le, c as ue, d as de, g as fe, h as pe, i as me, l as he, n as ge, o as _e, r as ve, s as ye, t as be, u as xe, v as Se, y as Ce } from "./filtering-CGuLpg7u.js";
|
|
7
|
+
import { _ as we, a as Te, c as V, d as H, f as Ee, g as De, i as Oe, l as ke, m as Ae, o as je, u as Me, v as Ne } from "./react-dom-BwZT0N3F.js";
|
|
8
|
+
import { a as Pe, i as U, n as Fe } from "./isFocusVisible-B1_z03UT.js";
|
|
9
|
+
import { f as Ie, g as Le, l as W, n as Re, p as ze, y as Be } from "./Title-CtFw1bVg.js";
|
|
10
|
+
import { n as Ve, r as He, t as Ue } from "./CircularProgress-DFS-LQb7.js";
|
|
11
|
+
import { d as We, f as G, p as Ge } from "./responsive.styles-FItb913l.js";
|
|
12
|
+
import { t as Ke } from "./Button-5CxPEACP.js";
|
|
13
|
+
function qe(e) {
|
|
14
|
+
return Ne("MuiCheckbox", e);
|
|
15
|
+
}
|
|
16
|
+
var Je = we("MuiCheckbox", [
|
|
17
|
+
"root",
|
|
18
|
+
"checked",
|
|
19
|
+
"disabled",
|
|
20
|
+
"indeterminate",
|
|
21
|
+
"colorPrimary",
|
|
22
|
+
"colorSecondary",
|
|
23
|
+
"sizeSmall",
|
|
24
|
+
"sizeMedium"
|
|
25
|
+
]);
|
|
26
|
+
function Ye({ props: e, name: t }) {
|
|
27
|
+
return se({
|
|
28
|
+
props: e,
|
|
29
|
+
name: t,
|
|
30
|
+
defaultTheme: _,
|
|
31
|
+
themeId: x
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function Xe(e) {
|
|
35
|
+
return Ne("MuiSvgIcon", e);
|
|
36
|
+
}
|
|
37
|
+
we("MuiSvgIcon", [
|
|
38
|
+
"root",
|
|
39
|
+
"colorPrimary",
|
|
40
|
+
"colorSecondary",
|
|
41
|
+
"colorAction",
|
|
42
|
+
"colorError",
|
|
43
|
+
"colorDisabled",
|
|
44
|
+
"fontSizeInherit",
|
|
45
|
+
"fontSizeSmall",
|
|
46
|
+
"fontSizeMedium",
|
|
47
|
+
"fontSizeLarge"
|
|
48
|
+
]);
|
|
49
|
+
var K = /* @__PURE__ */ e(D(), 1), q = j(), Ze = (e) => {
|
|
50
|
+
let { color: t, fontSize: n, classes: r } = e;
|
|
51
|
+
return Ae({ root: [
|
|
52
|
+
"root",
|
|
53
|
+
t !== "inherit" && `color${V(t)}`,
|
|
54
|
+
`fontSize${V(n)}`
|
|
55
|
+
] }, Xe, r);
|
|
56
|
+
}, Qe = H("svg", {
|
|
57
|
+
name: "MuiSvgIcon",
|
|
58
|
+
slot: "Root",
|
|
59
|
+
overridesResolver: (e, t) => {
|
|
60
|
+
let { ownerState: n } = e;
|
|
61
|
+
return [
|
|
62
|
+
t.root,
|
|
63
|
+
n.color !== "inherit" && t[`color${V(n.color)}`],
|
|
64
|
+
t[`fontSize${V(n.fontSize)}`]
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
})(Me(({ theme: e }) => ({
|
|
68
|
+
userSelect: "none",
|
|
69
|
+
width: "1em",
|
|
70
|
+
height: "1em",
|
|
71
|
+
display: "inline-block",
|
|
72
|
+
flexShrink: 0,
|
|
73
|
+
...Te(e, "fill", { duration: (e.vars ?? e).transitions?.duration?.shorter }),
|
|
74
|
+
variants: [
|
|
75
|
+
{
|
|
76
|
+
props: (e) => !e.hasSvgAsChild,
|
|
77
|
+
style: { fill: "currentColor" }
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
props: { fontSize: "inherit" },
|
|
81
|
+
style: { fontSize: "inherit" }
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
props: { fontSize: "small" },
|
|
85
|
+
style: { fontSize: e.typography?.pxToRem?.(20) || "1.25rem" }
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
props: { fontSize: "medium" },
|
|
89
|
+
style: { fontSize: e.typography?.pxToRem?.(24) || "1.5rem" }
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
props: { fontSize: "large" },
|
|
93
|
+
style: { fontSize: e.typography?.pxToRem?.(35) || "2.1875rem" }
|
|
94
|
+
},
|
|
95
|
+
...Object.entries((e.vars ?? e).palette).filter(([, e]) => e && e.main).map(([t]) => ({
|
|
96
|
+
props: { color: t },
|
|
97
|
+
style: { color: (e.vars ?? e).palette?.[t]?.main }
|
|
98
|
+
})),
|
|
99
|
+
{
|
|
100
|
+
props: { color: "action" },
|
|
101
|
+
style: { color: (e.vars ?? e).palette?.action?.active }
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
props: { color: "disabled" },
|
|
105
|
+
style: { color: (e.vars ?? e).palette?.action?.disabled }
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
props: { color: "inherit" },
|
|
109
|
+
style: { color: void 0 }
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}))), $e = /*#__PURE__*/ K.forwardRef(function(e, t) {
|
|
113
|
+
let n = ke({
|
|
114
|
+
props: e,
|
|
115
|
+
name: "MuiSvgIcon"
|
|
116
|
+
}), { children: r, className: i, color: a = "inherit", component: o = "svg", fontSize: s = "medium", htmlColor: c, inheritViewBox: l = !1, titleAccess: u, viewBox: d = "0 0 24 24", ...f } = n, p = /*#__PURE__*/ K.isValidElement(r) && r.type === "svg", m = {
|
|
117
|
+
...n,
|
|
118
|
+
color: a,
|
|
119
|
+
component: o,
|
|
120
|
+
fontSize: s,
|
|
121
|
+
instanceFontSize: e.fontSize,
|
|
122
|
+
inheritViewBox: l,
|
|
123
|
+
viewBox: d,
|
|
124
|
+
hasSvgAsChild: p
|
|
125
|
+
}, h = {};
|
|
126
|
+
l || (h.viewBox = d);
|
|
127
|
+
let g = Ze(m);
|
|
128
|
+
return /*#__PURE__*/ (0, q.jsxs)(Qe, {
|
|
129
|
+
as: o,
|
|
130
|
+
className: A(g.root, i),
|
|
131
|
+
focusable: "false",
|
|
132
|
+
color: c,
|
|
133
|
+
"aria-hidden": !u || void 0,
|
|
134
|
+
role: u ? "img" : void 0,
|
|
135
|
+
ref: t,
|
|
136
|
+
...h,
|
|
137
|
+
...f,
|
|
138
|
+
...p && r.props,
|
|
139
|
+
ownerState: m,
|
|
140
|
+
children: [p ? r.props.children : r, u ? /*#__PURE__*/ (0, q.jsx)("title", { children: u }) : null]
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
$e.muiName = "SvgIcon";
|
|
144
|
+
function et(e, t) {
|
|
145
|
+
function n(t, n) {
|
|
146
|
+
return /*#__PURE__*/ (0, q.jsx)($e, {
|
|
147
|
+
"data-testid": void 0,
|
|
148
|
+
ref: n,
|
|
149
|
+
...t,
|
|
150
|
+
children: e
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
return n.muiName = $e.muiName, /*#__PURE__*/ K.memo(/*#__PURE__*/ K.forwardRef(n));
|
|
154
|
+
}
|
|
155
|
+
function tt(e) {
|
|
156
|
+
return Ne("MuiCollapse", e);
|
|
157
|
+
}
|
|
158
|
+
we("MuiCollapse", [
|
|
159
|
+
"root",
|
|
160
|
+
"horizontal",
|
|
161
|
+
"vertical",
|
|
162
|
+
"entered",
|
|
163
|
+
"hidden",
|
|
164
|
+
"wrapper",
|
|
165
|
+
"wrapperInner"
|
|
166
|
+
]);
|
|
167
|
+
var nt = {}, rt = (e) => {
|
|
168
|
+
let { orientation: t, classes: n } = e;
|
|
169
|
+
return Ae({
|
|
170
|
+
root: ["root", t],
|
|
171
|
+
entered: ["entered"],
|
|
172
|
+
hidden: ["hidden"],
|
|
173
|
+
wrapper: ["wrapper", t],
|
|
174
|
+
wrapperInner: ["wrapperInner", t]
|
|
175
|
+
}, tt, n);
|
|
176
|
+
}, it = H("div", {
|
|
177
|
+
name: "MuiCollapse",
|
|
178
|
+
slot: "Root",
|
|
179
|
+
overridesResolver: (e, t) => {
|
|
180
|
+
let { ownerState: n } = e;
|
|
181
|
+
return [
|
|
182
|
+
t.root,
|
|
183
|
+
t[n.orientation],
|
|
184
|
+
n.state === "entered" && t.entered,
|
|
185
|
+
n.state === "exited" && !n.in && n.collapsedSize === "0px" && t.hidden
|
|
186
|
+
];
|
|
187
|
+
}
|
|
188
|
+
})(Me(({ theme: e }) => ({
|
|
189
|
+
height: 0,
|
|
190
|
+
overflow: "hidden",
|
|
191
|
+
transition: e.transitions.create("height"),
|
|
192
|
+
variants: [
|
|
193
|
+
{
|
|
194
|
+
props: { orientation: "horizontal" },
|
|
195
|
+
style: {
|
|
196
|
+
height: "auto",
|
|
197
|
+
width: 0,
|
|
198
|
+
transition: e.transitions.create("width")
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
props: { state: "entered" },
|
|
203
|
+
style: {
|
|
204
|
+
height: "auto",
|
|
205
|
+
overflow: "visible"
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
props: {
|
|
210
|
+
state: "entered",
|
|
211
|
+
orientation: "horizontal"
|
|
212
|
+
},
|
|
213
|
+
style: { width: "auto" }
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
props: ({ ownerState: e }) => e.state === "exited" && !e.in && e.collapsedSize === "0px",
|
|
217
|
+
style: { visibility: "hidden" }
|
|
218
|
+
}
|
|
219
|
+
]
|
|
220
|
+
}))), at = H("div", {
|
|
221
|
+
name: "MuiCollapse",
|
|
222
|
+
slot: "Wrapper"
|
|
223
|
+
})({
|
|
224
|
+
display: "flex",
|
|
225
|
+
width: "100%",
|
|
226
|
+
variants: [{
|
|
227
|
+
props: { orientation: "horizontal" },
|
|
228
|
+
style: {
|
|
229
|
+
width: "auto",
|
|
230
|
+
height: "100%"
|
|
231
|
+
}
|
|
232
|
+
}]
|
|
233
|
+
}), ot = H("div", {
|
|
234
|
+
name: "MuiCollapse",
|
|
235
|
+
slot: "WrapperInner"
|
|
236
|
+
})({
|
|
237
|
+
width: "100%",
|
|
238
|
+
variants: [{
|
|
239
|
+
props: { orientation: "horizontal" },
|
|
240
|
+
style: {
|
|
241
|
+
width: "auto",
|
|
242
|
+
height: "100%"
|
|
243
|
+
}
|
|
244
|
+
}]
|
|
245
|
+
}), st = /*#__PURE__*/ K.forwardRef(function(e, t) {
|
|
246
|
+
let n = ke({
|
|
247
|
+
props: e,
|
|
248
|
+
name: "MuiCollapse"
|
|
249
|
+
}), { addEndListener: r, children: i, className: a, collapsedSize: o = "0px", component: s, disablePrefersReducedMotion: c = !1, easing: l, in: u, onEnter: d, onEntered: f, onEntering: p, onExit: m, onExited: g, onExiting: _, orientation: v = "vertical", slots: y = nt, slotProps: b = nt, style: x, timeout: S = w.standard, TransitionComponent: C = ze, ...T } = n, E = {
|
|
250
|
+
...n,
|
|
251
|
+
orientation: v,
|
|
252
|
+
collapsedSize: o
|
|
253
|
+
}, D = rt(E), O = h(), k = K.useRef(null), j = K.useRef(null), M = typeof o == "number" ? `${o}px` : o, N = v === "horizontal", P = N ? "width" : "height", F = Ie(O.motion.reducedMotion, c), I = K.useRef(null), L = Be(t, I), R = () => k.current ? k.current[N ? "clientWidth" : "clientHeight"] : 0, ee = je(I, (e, t) => {
|
|
254
|
+
k.current && N && (k.current.style.position = "absolute"), e.style[P] = M, d && d(e, t);
|
|
255
|
+
}), z = je(I, (e, t) => {
|
|
256
|
+
let n = R();
|
|
257
|
+
k.current && N && (k.current.style.position = "");
|
|
258
|
+
let { duration: r, easing: i } = Oe({
|
|
259
|
+
style: x,
|
|
260
|
+
timeout: S,
|
|
261
|
+
easing: l
|
|
262
|
+
}, { mode: "enter" });
|
|
263
|
+
if (S === "auto" && !F.shouldReduceMotion) {
|
|
264
|
+
let e = O.transitions.getAutoHeightDuration(n);
|
|
265
|
+
j.current = e;
|
|
266
|
+
} else j.current = null;
|
|
267
|
+
let a = F.getTransitionTiming({
|
|
268
|
+
duration: j.current ?? r,
|
|
269
|
+
delay: void 0
|
|
270
|
+
});
|
|
271
|
+
e.style.transitionDuration = typeof a.duration == "string" ? a.duration : `${a.duration}ms`, e.style[P] = `${n}px`, e.style.transitionTimingFunction = i, p && p(e, t);
|
|
272
|
+
}), te = je(I, (e, t) => {
|
|
273
|
+
e.style[P] = "auto", f && f(e, t);
|
|
274
|
+
}), ne = je(I, (e) => {
|
|
275
|
+
e.style[P] = `${R()}px`, m && m(e);
|
|
276
|
+
}), re = je(I, g), B = je(I, (e) => {
|
|
277
|
+
let t = R(), { duration: n, easing: r } = Oe({
|
|
278
|
+
style: x,
|
|
279
|
+
timeout: S,
|
|
280
|
+
easing: l
|
|
281
|
+
}, { mode: "exit" });
|
|
282
|
+
if (S === "auto" && !F.shouldReduceMotion) {
|
|
283
|
+
let e = O.transitions.getAutoHeightDuration(t);
|
|
284
|
+
j.current = e;
|
|
285
|
+
} else j.current = null;
|
|
286
|
+
let i = F.getTransitionTiming({
|
|
287
|
+
duration: j.current ?? n,
|
|
288
|
+
delay: void 0
|
|
289
|
+
});
|
|
290
|
+
e.style.transitionDuration = typeof i.duration == "string" ? i.duration : `${i.duration}ms`, e.style[P] = M, e.style.transitionTimingFunction = r, _ && _(e);
|
|
291
|
+
}), ie = r ? (e) => {
|
|
292
|
+
r(I.current, e);
|
|
293
|
+
} : void 0, ae = {
|
|
294
|
+
slots: y,
|
|
295
|
+
slotProps: b,
|
|
296
|
+
component: s
|
|
297
|
+
}, [oe, se] = Fe("root", {
|
|
298
|
+
ref: L,
|
|
299
|
+
className: A(D.root, a),
|
|
300
|
+
elementType: it,
|
|
301
|
+
externalForwardedProps: ae,
|
|
302
|
+
ownerState: E,
|
|
303
|
+
additionalProps: { style: {
|
|
304
|
+
[N ? "minWidth" : "minHeight"]: M,
|
|
305
|
+
...x
|
|
306
|
+
} }
|
|
307
|
+
}), [ce, le] = Fe("wrapper", {
|
|
308
|
+
ref: k,
|
|
309
|
+
className: D.wrapper,
|
|
310
|
+
elementType: at,
|
|
311
|
+
externalForwardedProps: ae,
|
|
312
|
+
ownerState: E
|
|
313
|
+
}), [ue, de] = Fe("wrapperInner", {
|
|
314
|
+
className: D.wrapperInner,
|
|
315
|
+
elementType: ot,
|
|
316
|
+
externalForwardedProps: ae,
|
|
317
|
+
ownerState: E
|
|
318
|
+
});
|
|
319
|
+
return /*#__PURE__*/ (0, q.jsx)(C, {
|
|
320
|
+
in: u,
|
|
321
|
+
onEnter: ee,
|
|
322
|
+
onEntered: te,
|
|
323
|
+
onEntering: z,
|
|
324
|
+
onExit: ne,
|
|
325
|
+
onExited: re,
|
|
326
|
+
onExiting: B,
|
|
327
|
+
addEndListener: ie,
|
|
328
|
+
getAutoTimeout: S === "auto" ? () => j.current : void 0,
|
|
329
|
+
reduceMotion: F.shouldReduceMotion,
|
|
330
|
+
nodeRef: I,
|
|
331
|
+
timeout: S === "auto" ? null : S,
|
|
332
|
+
...T,
|
|
333
|
+
children: (e, { ownerState: t, ...n }) => {
|
|
334
|
+
let r = {
|
|
335
|
+
...E,
|
|
336
|
+
state: e
|
|
337
|
+
};
|
|
338
|
+
return /*#__PURE__*/ (0, q.jsx)(oe, {
|
|
339
|
+
...se,
|
|
340
|
+
className: A(se.className, {
|
|
341
|
+
entered: D.entered,
|
|
342
|
+
exited: !u && M === "0px" && D.hidden
|
|
343
|
+
}[e]),
|
|
344
|
+
ownerState: r,
|
|
345
|
+
...n,
|
|
346
|
+
children: /*#__PURE__*/ (0, q.jsx)(ce, {
|
|
347
|
+
...le,
|
|
348
|
+
ownerState: r,
|
|
349
|
+
children: /*#__PURE__*/ (0, q.jsx)(ue, {
|
|
350
|
+
...de,
|
|
351
|
+
ownerState: r,
|
|
352
|
+
children: i
|
|
353
|
+
})
|
|
354
|
+
})
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
st && (st.muiSupportAuto = !0);
|
|
360
|
+
function ct(e) {
|
|
361
|
+
return Ne("PrivateSwitchBase", e);
|
|
362
|
+
}
|
|
363
|
+
we("PrivateSwitchBase", [
|
|
364
|
+
"root",
|
|
365
|
+
"checked",
|
|
366
|
+
"disabled",
|
|
367
|
+
"input",
|
|
368
|
+
"edgeStart",
|
|
369
|
+
"edgeEnd"
|
|
370
|
+
]);
|
|
371
|
+
var lt = (e) => {
|
|
372
|
+
let { classes: t, checked: n, disabled: r, edge: i } = e;
|
|
373
|
+
return Ae({
|
|
374
|
+
root: [
|
|
375
|
+
"root",
|
|
376
|
+
n && "checked",
|
|
377
|
+
r && "disabled",
|
|
378
|
+
i && `edge${V(i)}`
|
|
379
|
+
],
|
|
380
|
+
input: ["input"]
|
|
381
|
+
}, ct, t);
|
|
382
|
+
}, ut = H(Ve, { name: "MuiSwitchBase" })({
|
|
383
|
+
padding: 9,
|
|
384
|
+
borderRadius: "50%",
|
|
385
|
+
variants: [
|
|
386
|
+
{
|
|
387
|
+
props: {
|
|
388
|
+
edge: "start",
|
|
389
|
+
size: "small"
|
|
390
|
+
},
|
|
391
|
+
style: { marginLeft: -3 }
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
props: ({ edge: e, ownerState: t }) => e === "start" && t.size !== "small",
|
|
395
|
+
style: { marginLeft: -12 }
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
props: {
|
|
399
|
+
edge: "end",
|
|
400
|
+
size: "small"
|
|
401
|
+
},
|
|
402
|
+
style: { marginRight: -3 }
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
props: ({ edge: e, ownerState: t }) => e === "end" && t.size !== "small",
|
|
406
|
+
style: { marginRight: -12 }
|
|
407
|
+
}
|
|
408
|
+
]
|
|
409
|
+
}), dt = H("input", {
|
|
410
|
+
name: "MuiSwitchBase",
|
|
411
|
+
shouldForwardProp: Ee
|
|
412
|
+
})({
|
|
413
|
+
cursor: "inherit",
|
|
414
|
+
position: "absolute",
|
|
415
|
+
opacity: 0,
|
|
416
|
+
width: "100%",
|
|
417
|
+
height: "100%",
|
|
418
|
+
top: 0,
|
|
419
|
+
left: 0,
|
|
420
|
+
margin: 0,
|
|
421
|
+
padding: 0,
|
|
422
|
+
zIndex: 1
|
|
423
|
+
}), ft = /*#__PURE__*/ K.forwardRef(function(e, t) {
|
|
424
|
+
let { autoFocus: n, checked: r, checkedIcon: i, defaultChecked: a, disabled: o, disableFocusRipple: s = !1, edge: c = !1, icon: l, id: u, name: d, onBlur: f, onChange: p, onFocus: m, readOnly: h, required: g = !1, tabIndex: _, type: v, value: y, slots: b = {}, slotProps: x = {}, ...S } = e, { nativeButton: C, ...w } = S, [T, E] = Le({
|
|
425
|
+
controlled: r,
|
|
426
|
+
default: !!a,
|
|
427
|
+
name: "SwitchBase",
|
|
428
|
+
state: "checked"
|
|
429
|
+
}), D = le(), O = (e) => {
|
|
430
|
+
m && m(e), D && D.onFocus && D.onFocus(e);
|
|
431
|
+
}, k = (e) => {
|
|
432
|
+
f && f(e), D && D.onBlur && D.onBlur(e);
|
|
433
|
+
}, A = (e) => {
|
|
434
|
+
if (e.nativeEvent.defaultPrevented || h) return;
|
|
435
|
+
let t = e.target.checked;
|
|
436
|
+
E(t), p && p(e, t);
|
|
437
|
+
}, j = o;
|
|
438
|
+
D && j === void 0 && (j = D.disabled);
|
|
439
|
+
let M = v === "checkbox" || v === "radio", N = {
|
|
440
|
+
...e,
|
|
441
|
+
checked: T,
|
|
442
|
+
disabled: j,
|
|
443
|
+
disableFocusRipple: s,
|
|
444
|
+
edge: c
|
|
445
|
+
}, P = lt(N), F = {
|
|
446
|
+
slots: b,
|
|
447
|
+
slotProps: x
|
|
448
|
+
}, [I, L] = Fe("root", {
|
|
449
|
+
ref: t,
|
|
450
|
+
elementType: ut,
|
|
451
|
+
className: P.root,
|
|
452
|
+
shouldForwardComponentProp: !0,
|
|
453
|
+
externalForwardedProps: {
|
|
454
|
+
...F,
|
|
455
|
+
component: "span",
|
|
456
|
+
...w
|
|
457
|
+
},
|
|
458
|
+
getSlotProps: (e) => ({
|
|
459
|
+
...e,
|
|
460
|
+
onFocus: (t) => {
|
|
461
|
+
e.onFocus?.(t), O(t);
|
|
462
|
+
},
|
|
463
|
+
onBlur: (t) => {
|
|
464
|
+
e.onBlur?.(t), k(t);
|
|
465
|
+
}
|
|
466
|
+
}),
|
|
467
|
+
ownerState: N,
|
|
468
|
+
additionalProps: {
|
|
469
|
+
centerRipple: !0,
|
|
470
|
+
focusRipple: !s,
|
|
471
|
+
role: void 0,
|
|
472
|
+
tabIndex: null,
|
|
473
|
+
internalDisabledThemeFocusVisible: !0
|
|
474
|
+
}
|
|
475
|
+
}), [R, ee] = Fe("input", {
|
|
476
|
+
elementType: dt,
|
|
477
|
+
className: P.input,
|
|
478
|
+
externalForwardedProps: F,
|
|
479
|
+
getSlotProps: (e) => ({
|
|
480
|
+
...e,
|
|
481
|
+
onChange: (t) => {
|
|
482
|
+
e.onChange?.(t), A(t);
|
|
483
|
+
}
|
|
484
|
+
}),
|
|
485
|
+
ownerState: N,
|
|
486
|
+
additionalProps: {
|
|
487
|
+
autoFocus: n,
|
|
488
|
+
checked: r,
|
|
489
|
+
defaultChecked: a,
|
|
490
|
+
disabled: j,
|
|
491
|
+
id: M ? u : void 0,
|
|
492
|
+
name: d,
|
|
493
|
+
readOnly: h,
|
|
494
|
+
required: g,
|
|
495
|
+
tabIndex: _,
|
|
496
|
+
type: v,
|
|
497
|
+
...v === "checkbox" && y === void 0 ? {} : { value: y }
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
return /*#__PURE__*/ (0, q.jsxs)(I, {
|
|
501
|
+
...L,
|
|
502
|
+
children: [/*#__PURE__*/ (0, q.jsx)(R, { ...ee }), T ? i : l]
|
|
503
|
+
});
|
|
504
|
+
}), pt = et(/*#__PURE__*/ (0, q.jsx)("path", { d: "M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z" }), "CheckBoxOutlineBlank"), mt = et(/*#__PURE__*/ (0, q.jsx)("path", { d: "M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }), "CheckBox"), ht = et(/*#__PURE__*/ (0, q.jsx)("path", { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z" }), "IndeterminateCheckBox"), gt = (e) => {
|
|
505
|
+
let { classes: t, indeterminate: n, color: r, size: i } = e, a = Ae({ root: [
|
|
506
|
+
"root",
|
|
507
|
+
n && "indeterminate",
|
|
508
|
+
`color${V(r)}`,
|
|
509
|
+
`size${V(i)}`
|
|
510
|
+
] }, qe, t);
|
|
511
|
+
return {
|
|
512
|
+
...t,
|
|
513
|
+
...a
|
|
514
|
+
};
|
|
515
|
+
}, _t = H(ft, {
|
|
516
|
+
shouldForwardProp: (e) => Ee(e) || e === "classes",
|
|
517
|
+
name: "MuiCheckbox",
|
|
518
|
+
slot: "Root",
|
|
519
|
+
overridesResolver: (e, t) => {
|
|
520
|
+
let { ownerState: n } = e;
|
|
521
|
+
return [
|
|
522
|
+
t.root,
|
|
523
|
+
n.indeterminate && t.indeterminate,
|
|
524
|
+
t[`size${V(n.size)}`],
|
|
525
|
+
n.color !== "default" && t[`color${V(n.color)}`]
|
|
526
|
+
];
|
|
527
|
+
}
|
|
528
|
+
})(Me(({ theme: e }) => ({
|
|
529
|
+
color: (e.vars || e).palette.text.secondary,
|
|
530
|
+
...e.focusVisible && { [`&.${He.focusVisible} svg:first-of-type`]: {
|
|
531
|
+
...C,
|
|
532
|
+
borderRadius: (e.vars || e).shape.borderRadius,
|
|
533
|
+
...e.focusVisible
|
|
534
|
+
} },
|
|
535
|
+
variants: [
|
|
536
|
+
{
|
|
537
|
+
props: {
|
|
538
|
+
color: "default",
|
|
539
|
+
disableRipple: !1
|
|
540
|
+
},
|
|
541
|
+
style: { "&:hover": { backgroundColor: e.alpha((e.vars || e).palette.action.active, (e.vars || e).palette.action.hoverOpacity) } }
|
|
542
|
+
},
|
|
543
|
+
...Object.entries(e.palette).filter(Ge()).map(([t]) => ({
|
|
544
|
+
props: {
|
|
545
|
+
color: t,
|
|
546
|
+
disableRipple: !1
|
|
547
|
+
},
|
|
548
|
+
style: { "&:hover": { backgroundColor: e.alpha((e.vars || e).palette[t].main, (e.vars || e).palette.action.hoverOpacity) } }
|
|
549
|
+
})),
|
|
550
|
+
...Object.entries(e.palette).filter(Ge()).map(([t]) => ({
|
|
551
|
+
props: { color: t },
|
|
552
|
+
style: {
|
|
553
|
+
[`&.${Je.checked}, &.${Je.indeterminate}`]: { color: (e.vars || e).palette[t].main },
|
|
554
|
+
[`&.${Je.disabled}`]: { color: (e.vars || e).palette.action.disabled }
|
|
555
|
+
}
|
|
556
|
+
})),
|
|
557
|
+
{
|
|
558
|
+
props: { disableRipple: !1 },
|
|
559
|
+
style: { "&:hover": { "@media (hover: none)": { backgroundColor: "transparent" } } }
|
|
560
|
+
}
|
|
561
|
+
]
|
|
562
|
+
}))), vt = /*#__PURE__*/ (0, q.jsx)(mt, {}), yt = /*#__PURE__*/ (0, q.jsx)(pt, {}), bt = /*#__PURE__*/ (0, q.jsx)(ht, {}), xt = /*#__PURE__*/ K.forwardRef(function(e, t) {
|
|
563
|
+
let n = ke({
|
|
564
|
+
props: e,
|
|
565
|
+
name: "MuiCheckbox"
|
|
566
|
+
}), { checkedIcon: r = vt, color: i = "primary", icon: a = yt, indeterminate: o = !1, indeterminateIcon: s = bt, size: c = "medium", disableRipple: l = !1, className: u, slots: d = {}, slotProps: f = {}, ...p } = n, m = o ? s : a, h = o ? s : r, g = {
|
|
567
|
+
...n,
|
|
568
|
+
disableRipple: l,
|
|
569
|
+
color: i,
|
|
570
|
+
indeterminate: o,
|
|
571
|
+
size: c
|
|
572
|
+
}, _ = gt(g), v = typeof f.input == "function" ? f.input(g) : f.input, y = K.useRef(null), b = Be(y, v?.ref);
|
|
573
|
+
te(() => {
|
|
574
|
+
y.current && (y.current.indeterminate = o);
|
|
575
|
+
});
|
|
576
|
+
let [x, S] = Fe("root", {
|
|
577
|
+
ref: t,
|
|
578
|
+
elementType: _t,
|
|
579
|
+
className: A(_.root, u),
|
|
580
|
+
shouldForwardComponentProp: !0,
|
|
581
|
+
externalForwardedProps: {
|
|
582
|
+
slots: d,
|
|
583
|
+
slotProps: f,
|
|
584
|
+
...p
|
|
585
|
+
},
|
|
586
|
+
ownerState: g,
|
|
587
|
+
additionalProps: {
|
|
588
|
+
type: "checkbox",
|
|
589
|
+
icon: /*#__PURE__*/ K.cloneElement(m, { fontSize: m.props.fontSize ?? c }),
|
|
590
|
+
checkedIcon: /*#__PURE__*/ K.cloneElement(h, { fontSize: h.props.fontSize ?? c }),
|
|
591
|
+
disableRipple: n.disableRipple,
|
|
592
|
+
slots: d,
|
|
593
|
+
slotProps: { input: {
|
|
594
|
+
...ne(v, {
|
|
595
|
+
"data-indeterminate": o,
|
|
596
|
+
onChange: (e) => {
|
|
597
|
+
e.target.indeterminate = o;
|
|
598
|
+
}
|
|
599
|
+
}),
|
|
600
|
+
ref: b
|
|
601
|
+
} }
|
|
602
|
+
}
|
|
603
|
+
});
|
|
604
|
+
return /*#__PURE__*/ (0, q.jsx)(x, {
|
|
605
|
+
...S,
|
|
606
|
+
classes: _
|
|
607
|
+
});
|
|
608
|
+
}), St = (e) => ({
|
|
609
|
+
hasImage: !!e.dimensions[1]?.dataItem,
|
|
610
|
+
hasMeasure: !!e.measures[0]?.dataItem,
|
|
611
|
+
searchEnabled: !!e.filterSettings?.searchable,
|
|
612
|
+
quickSelection: !!e.filterSettings?.quickSelect
|
|
613
|
+
}), J = ee(), Ct = /* @__PURE__ */ e(F()), wt = S({ menuTrigger: ({ responsive: e, isDisplayImportant: t }) => ({
|
|
614
|
+
...e && We,
|
|
615
|
+
display: t ? "inline-flex !important" : "inline-flex",
|
|
616
|
+
alignItems: "center",
|
|
617
|
+
justifyContent: "center",
|
|
618
|
+
minWidth: 22,
|
|
619
|
+
width: 22,
|
|
620
|
+
height: 22,
|
|
621
|
+
padding: 0,
|
|
622
|
+
borderRadius: 6,
|
|
623
|
+
border: "none",
|
|
624
|
+
backgroundColor: "transparent",
|
|
625
|
+
color: "inherit",
|
|
626
|
+
lineHeight: 0,
|
|
627
|
+
"&:hover": { boxShadow: "inset 0 0 0 1px currentColor" },
|
|
628
|
+
"&:focus": { outline: "none" },
|
|
629
|
+
...e && {
|
|
630
|
+
[G.md]: {
|
|
631
|
+
minWidth: 20,
|
|
632
|
+
width: 20,
|
|
633
|
+
height: 20,
|
|
634
|
+
borderRadius: 5
|
|
635
|
+
},
|
|
636
|
+
[G.sm]: {
|
|
637
|
+
minWidth: 16,
|
|
638
|
+
width: 16,
|
|
639
|
+
height: 16,
|
|
640
|
+
borderRadius: 4
|
|
641
|
+
},
|
|
642
|
+
[G.xs]: {
|
|
643
|
+
minWidth: 12,
|
|
644
|
+
width: 12,
|
|
645
|
+
height: 12,
|
|
646
|
+
borderRadius: 3
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}) });
|
|
650
|
+
function Tt(e) {
|
|
651
|
+
let { isPreview: t, areSelectedValues: n, arePendingValues: r, isNotEnabled: i, responsive: a, onClear: o, onDeselectAll: s, onSelectAll: c, onSelectExcluded: l, toggleNotOperator: u, onLockClick: d, isSingleSelectField: f = !1 } = e, [p, m] = (0, K.useState)(!1), h = wt({
|
|
652
|
+
responsive: a,
|
|
653
|
+
isDisplayImportant: !0
|
|
654
|
+
}), _ = g().daedalus.getWorkbookProperties()?.isLockUnlockFieldsEnabled ?? !1, v = [{
|
|
655
|
+
disabled: t || !r,
|
|
656
|
+
key: "clear",
|
|
657
|
+
label: "Clear",
|
|
658
|
+
type: "option",
|
|
659
|
+
onClick: o
|
|
660
|
+
}];
|
|
661
|
+
return f || v.push({
|
|
662
|
+
key: "divider",
|
|
663
|
+
type: "divider"
|
|
664
|
+
}, {
|
|
665
|
+
disabled: t || !n,
|
|
666
|
+
key: "deselect-all",
|
|
667
|
+
label: "Deselect all",
|
|
668
|
+
type: "option",
|
|
669
|
+
onClick: s
|
|
670
|
+
}, {
|
|
671
|
+
disabled: t,
|
|
672
|
+
key: "select-all",
|
|
673
|
+
label: i ? "Exclude all" : "Select all",
|
|
674
|
+
type: "option",
|
|
675
|
+
onClick: c
|
|
676
|
+
}, {
|
|
677
|
+
disabled: t,
|
|
678
|
+
key: "invert",
|
|
679
|
+
label: "Invert",
|
|
680
|
+
type: "option",
|
|
681
|
+
onClick: l
|
|
682
|
+
}, {
|
|
683
|
+
disabled: t,
|
|
684
|
+
key: "not",
|
|
685
|
+
label: "Exclude",
|
|
686
|
+
type: "option",
|
|
687
|
+
onClick: u
|
|
688
|
+
}), _ && v.push({
|
|
689
|
+
key: "divider",
|
|
690
|
+
type: "divider"
|
|
691
|
+
}, {
|
|
692
|
+
key: "lock",
|
|
693
|
+
label: "Lock",
|
|
694
|
+
type: "option",
|
|
695
|
+
icon: { right: /* @__PURE__ */ (0, q.jsx)(y, {}) },
|
|
696
|
+
onClick: d
|
|
697
|
+
}), /* @__PURE__ */ (0, q.jsx)(Re, {
|
|
698
|
+
open: p,
|
|
699
|
+
placement: "bottom-end",
|
|
700
|
+
title: /* @__PURE__ */ (0, q.jsx)(z, {
|
|
701
|
+
onClickAway: () => m(!1),
|
|
702
|
+
children: /* @__PURE__ */ (0, q.jsx)(re, {
|
|
703
|
+
appearance: "legacy",
|
|
704
|
+
onClose: () => m(!1),
|
|
705
|
+
options: v,
|
|
706
|
+
responsive: a,
|
|
707
|
+
style: { margin: "-8px -12px" }
|
|
708
|
+
})
|
|
709
|
+
}),
|
|
710
|
+
children: /* @__PURE__ */ (0, q.jsx)(B, {
|
|
711
|
+
onClick: () => m(!p),
|
|
712
|
+
"data-testid": "filter-button-icon-dots",
|
|
713
|
+
className: h.menuTrigger,
|
|
714
|
+
children: /* @__PURE__ */ (0, q.jsx)(L, {
|
|
715
|
+
fill: "currentColor",
|
|
716
|
+
size: 20
|
|
717
|
+
})
|
|
718
|
+
})
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
function Y() {
|
|
722
|
+
return Y = Object.assign ? Object.assign.bind() : function(e) {
|
|
723
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
724
|
+
var n = arguments[t];
|
|
725
|
+
for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
726
|
+
}
|
|
727
|
+
return e;
|
|
728
|
+
}, Y.apply(null, arguments);
|
|
729
|
+
}
|
|
730
|
+
var Et = {};
|
|
731
|
+
function Dt(e, t) {
|
|
732
|
+
let n = K.useRef(Et);
|
|
733
|
+
return n.current === Et && (n.current = e(t)), n;
|
|
734
|
+
}
|
|
735
|
+
function Ot(e, t, n, r) {
|
|
736
|
+
let i = Dt(kt).current;
|
|
737
|
+
return At(i, e, t, n, r) && jt(i, [
|
|
738
|
+
e,
|
|
739
|
+
t,
|
|
740
|
+
n,
|
|
741
|
+
r
|
|
742
|
+
]), i.callback;
|
|
743
|
+
}
|
|
744
|
+
function kt() {
|
|
745
|
+
return {
|
|
746
|
+
callback: null,
|
|
747
|
+
cleanup: null,
|
|
748
|
+
refs: []
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
function At(e, t, n, r, i) {
|
|
752
|
+
return e.refs[0] !== t || e.refs[1] !== n || e.refs[2] !== r || e.refs[3] !== i;
|
|
753
|
+
}
|
|
754
|
+
function jt(e, t) {
|
|
755
|
+
if (e.refs = t, t.every((e) => e == null)) {
|
|
756
|
+
e.callback = null;
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
e.callback = (n) => {
|
|
760
|
+
if (e.cleanup &&= (e.cleanup(), null), n != null) {
|
|
761
|
+
let r = Array(t.length).fill(null);
|
|
762
|
+
for (let e = 0; e < t.length; e += 1) {
|
|
763
|
+
let i = t[e];
|
|
764
|
+
if (i != null) switch (typeof i) {
|
|
765
|
+
case "function": {
|
|
766
|
+
let t = i(n);
|
|
767
|
+
typeof t == "function" && (r[e] = t);
|
|
768
|
+
break;
|
|
769
|
+
}
|
|
770
|
+
case "object":
|
|
771
|
+
i.current = n;
|
|
772
|
+
break;
|
|
773
|
+
default:
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
e.cleanup = () => {
|
|
777
|
+
for (let e = 0; e < t.length; e += 1) {
|
|
778
|
+
let n = t[e];
|
|
779
|
+
if (n != null) switch (typeof n) {
|
|
780
|
+
case "function": {
|
|
781
|
+
let t = r[e];
|
|
782
|
+
typeof t == "function" ? t() : n(null);
|
|
783
|
+
break;
|
|
784
|
+
}
|
|
785
|
+
case "object":
|
|
786
|
+
n.current = null;
|
|
787
|
+
break;
|
|
788
|
+
default:
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
};
|
|
792
|
+
}
|
|
793
|
+
};
|
|
794
|
+
}
|
|
795
|
+
function Mt(e) {
|
|
796
|
+
return Ye;
|
|
797
|
+
}
|
|
798
|
+
function Nt(e) {
|
|
799
|
+
return Ne("MuiSimpleTreeView", e);
|
|
800
|
+
}
|
|
801
|
+
we("MuiSimpleTreeView", [
|
|
802
|
+
"root",
|
|
803
|
+
"item",
|
|
804
|
+
"itemContent",
|
|
805
|
+
"itemGroupTransition",
|
|
806
|
+
"itemIconContainer",
|
|
807
|
+
"itemLabel",
|
|
808
|
+
"itemCheckbox"
|
|
809
|
+
]);
|
|
810
|
+
var Pt = Object.freeze([]), Ft = Object.freeze({});
|
|
811
|
+
function It(e, t) {
|
|
812
|
+
return function(n, ...r) {
|
|
813
|
+
let i = new URL(e);
|
|
814
|
+
return i.searchParams.set("code", n.toString()), r.forEach((e) => i.searchParams.append("args[]", e)), `${t} error #${n}; visit ${i} for the full message.`;
|
|
815
|
+
};
|
|
816
|
+
}
|
|
817
|
+
var Lt = It("https://base-ui.com/production-error", "Base UI"), Rt = It("https://mui.com/x/production-error", "MUI X"), zt = /*#__PURE__*/ K.createContext(null), Bt = () => {
|
|
818
|
+
let e = K.useContext(zt);
|
|
819
|
+
if (e == null) throw Error(Rt(190));
|
|
820
|
+
return e;
|
|
821
|
+
}, Vt = /*#__PURE__*/ K.createContext({
|
|
822
|
+
classes: {},
|
|
823
|
+
slots: {},
|
|
824
|
+
slotProps: {}
|
|
825
|
+
}), Ht = () => K.useContext(Vt), Ut = (e) => {
|
|
826
|
+
let { store: t, apiRef: n, rootRef: r } = e, i = Dt(() => t.buildPublicAPI()).current;
|
|
827
|
+
Wt(i, n);
|
|
828
|
+
let a = K.useCallback((e) => {
|
|
829
|
+
let n = null, r = null, i = [], a = {};
|
|
830
|
+
t.itemPluginManager.listPlugins().forEach((t) => {
|
|
831
|
+
let o = t({
|
|
832
|
+
props: e,
|
|
833
|
+
rootRef: n,
|
|
834
|
+
contentRef: r
|
|
835
|
+
});
|
|
836
|
+
o?.rootRef && (n = o.rootRef), o?.contentRef && (r = o.contentRef), o?.propsEnhancers && (i.push(o.propsEnhancers), Object.keys(o.propsEnhancers).forEach((e) => {
|
|
837
|
+
a[e] = !0;
|
|
838
|
+
}));
|
|
839
|
+
});
|
|
840
|
+
let o = (e) => (t) => {
|
|
841
|
+
let n = {};
|
|
842
|
+
return i.forEach((r) => {
|
|
843
|
+
let i = r[e];
|
|
844
|
+
i != null && Object.assign(n, i(t));
|
|
845
|
+
}), n;
|
|
846
|
+
}, s = Object.fromEntries(Object.keys(a).map((e) => [e, o(e)]));
|
|
847
|
+
return {
|
|
848
|
+
contentRef: r,
|
|
849
|
+
rootRef: n,
|
|
850
|
+
propsEnhancers: s
|
|
851
|
+
};
|
|
852
|
+
}, [t]), o = K.useCallback(({ itemId: e, children: n, idAttribute: r }) => {
|
|
853
|
+
let i = n, a = t.itemPluginManager.listWrappers();
|
|
854
|
+
for (let n = a.length - 1; n >= 0; --n) {
|
|
855
|
+
let o = a[n];
|
|
856
|
+
i = o({
|
|
857
|
+
store: t,
|
|
858
|
+
itemId: e,
|
|
859
|
+
children: i,
|
|
860
|
+
idAttribute: r
|
|
861
|
+
});
|
|
862
|
+
}
|
|
863
|
+
return i;
|
|
864
|
+
}, [t]);
|
|
865
|
+
return K.useMemo(() => ({
|
|
866
|
+
runItemPlugins: a,
|
|
867
|
+
wrapItem: o,
|
|
868
|
+
publicAPI: i,
|
|
869
|
+
store: t,
|
|
870
|
+
rootRef: r
|
|
871
|
+
}), [
|
|
872
|
+
a,
|
|
873
|
+
o,
|
|
874
|
+
i,
|
|
875
|
+
t,
|
|
876
|
+
r
|
|
877
|
+
]);
|
|
878
|
+
};
|
|
879
|
+
function Wt(e, t) {
|
|
880
|
+
t != null && t.current !== e && (t.current = e);
|
|
881
|
+
}
|
|
882
|
+
function Gt(e) {
|
|
883
|
+
let { store: t, apiRef: n, rootRef: r, classes: i = Ft, slots: a = Ft, slotProps: o = Ft, children: s } = e, c = Ut({
|
|
884
|
+
store: t,
|
|
885
|
+
apiRef: n,
|
|
886
|
+
rootRef: r
|
|
887
|
+
}), l = K.useMemo(() => ({
|
|
888
|
+
classes: i,
|
|
889
|
+
slots: {
|
|
890
|
+
collapseIcon: a.collapseIcon,
|
|
891
|
+
expandIcon: a.expandIcon,
|
|
892
|
+
endIcon: a.endIcon,
|
|
893
|
+
loading: a.loading,
|
|
894
|
+
itemLoader: a.itemLoader
|
|
895
|
+
},
|
|
896
|
+
slotProps: {
|
|
897
|
+
collapseIcon: o.collapseIcon,
|
|
898
|
+
expandIcon: o.expandIcon,
|
|
899
|
+
endIcon: o.endIcon,
|
|
900
|
+
loading: o.loading,
|
|
901
|
+
itemLoader: o.itemLoader
|
|
902
|
+
}
|
|
903
|
+
}), [
|
|
904
|
+
i,
|
|
905
|
+
a.collapseIcon,
|
|
906
|
+
a.expandIcon,
|
|
907
|
+
a.endIcon,
|
|
908
|
+
a.loading,
|
|
909
|
+
a.itemLoader,
|
|
910
|
+
o.collapseIcon,
|
|
911
|
+
o.expandIcon,
|
|
912
|
+
o.endIcon,
|
|
913
|
+
o.loading,
|
|
914
|
+
o.itemLoader
|
|
915
|
+
]);
|
|
916
|
+
return /*#__PURE__*/ (0, q.jsx)(zt.Provider, {
|
|
917
|
+
value: c,
|
|
918
|
+
children: /*#__PURE__*/ (0, q.jsx)(Vt.Provider, {
|
|
919
|
+
value: l,
|
|
920
|
+
children: s
|
|
921
|
+
})
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
function Kt(e, t) {
|
|
925
|
+
if (e == null) return {};
|
|
926
|
+
var n = {};
|
|
927
|
+
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
|
|
928
|
+
if (t.indexOf(r) !== -1) continue;
|
|
929
|
+
n[r] = e[r];
|
|
930
|
+
}
|
|
931
|
+
return n;
|
|
932
|
+
}
|
|
933
|
+
var qt = [
|
|
934
|
+
"apiRef",
|
|
935
|
+
"slots",
|
|
936
|
+
"slotProps",
|
|
937
|
+
"disabledItemsFocusable",
|
|
938
|
+
"onItemClick",
|
|
939
|
+
"itemChildrenIndentation",
|
|
940
|
+
"id",
|
|
941
|
+
"expandedItems",
|
|
942
|
+
"defaultExpandedItems",
|
|
943
|
+
"onExpandedItemsChange",
|
|
944
|
+
"onItemExpansionToggle",
|
|
945
|
+
"expansionTrigger",
|
|
946
|
+
"disableSelection",
|
|
947
|
+
"selectedItems",
|
|
948
|
+
"defaultSelectedItems",
|
|
949
|
+
"multiSelect",
|
|
950
|
+
"checkboxSelection",
|
|
951
|
+
"selectionPropagation",
|
|
952
|
+
"onSelectedItemsChange",
|
|
953
|
+
"onItemSelectionToggle",
|
|
954
|
+
"onItemFocus",
|
|
955
|
+
"itemHeight"
|
|
956
|
+
];
|
|
957
|
+
function Jt(e) {
|
|
958
|
+
let { apiRef: t, slots: n, slotProps: r, disabledItemsFocusable: i, onItemClick: a, itemChildrenIndentation: o, id: s, expandedItems: c, defaultExpandedItems: l, onExpandedItemsChange: u, onItemExpansionToggle: d, expansionTrigger: f, disableSelection: p, selectedItems: m, defaultSelectedItems: h, multiSelect: g, checkboxSelection: _, selectionPropagation: v, onSelectedItemsChange: y, onItemSelectionToggle: b, onItemFocus: x, itemHeight: S } = e, C = Kt(e, qt);
|
|
959
|
+
return {
|
|
960
|
+
apiRef: t,
|
|
961
|
+
slots: n,
|
|
962
|
+
slotProps: r,
|
|
963
|
+
parameters: K.useMemo(() => ({
|
|
964
|
+
disabledItemsFocusable: i,
|
|
965
|
+
onItemClick: a,
|
|
966
|
+
itemChildrenIndentation: o,
|
|
967
|
+
id: s,
|
|
968
|
+
expandedItems: c,
|
|
969
|
+
defaultExpandedItems: l,
|
|
970
|
+
onExpandedItemsChange: u,
|
|
971
|
+
onItemExpansionToggle: d,
|
|
972
|
+
expansionTrigger: f,
|
|
973
|
+
disableSelection: p,
|
|
974
|
+
selectedItems: m,
|
|
975
|
+
defaultSelectedItems: h,
|
|
976
|
+
multiSelect: g,
|
|
977
|
+
checkboxSelection: _,
|
|
978
|
+
selectionPropagation: v,
|
|
979
|
+
onSelectedItemsChange: y,
|
|
980
|
+
onItemSelectionToggle: b,
|
|
981
|
+
onItemFocus: x,
|
|
982
|
+
itemHeight: S
|
|
983
|
+
}), [
|
|
984
|
+
i,
|
|
985
|
+
a,
|
|
986
|
+
o,
|
|
987
|
+
s,
|
|
988
|
+
c,
|
|
989
|
+
l,
|
|
990
|
+
u,
|
|
991
|
+
d,
|
|
992
|
+
f,
|
|
993
|
+
p,
|
|
994
|
+
m,
|
|
995
|
+
h,
|
|
996
|
+
g,
|
|
997
|
+
_,
|
|
998
|
+
v,
|
|
999
|
+
y,
|
|
1000
|
+
b,
|
|
1001
|
+
x,
|
|
1002
|
+
S
|
|
1003
|
+
]),
|
|
1004
|
+
forwardedProps: C
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
1007
|
+
var Yt = {
|
|
1008
|
+
maxSize: 1,
|
|
1009
|
+
equalityCheck: Object.is
|
|
1010
|
+
}, Xt = Se({
|
|
1011
|
+
memoize: Ce,
|
|
1012
|
+
memoizeOptions: Yt
|
|
1013
|
+
}), Zt = ((e) => {
|
|
1014
|
+
let t = e?.memoizeOptions, n = e;
|
|
1015
|
+
return e !== void 0 && (e.memoize === void 0 ? typeof t == "object" && t && !Array.isArray(t) && (n = {
|
|
1016
|
+
...e,
|
|
1017
|
+
memoizeOptions: {
|
|
1018
|
+
...Yt,
|
|
1019
|
+
...t
|
|
1020
|
+
}
|
|
1021
|
+
}) : t === void 0 && (n = {
|
|
1022
|
+
...e,
|
|
1023
|
+
memoizeOptions: void 0
|
|
1024
|
+
})), (...e) => {
|
|
1025
|
+
let t = /* @__PURE__ */ new WeakMap(), r = 1, i = e[e.length - 1], a = e.length === 1 ? [(e) => e, i] : e, o = a.length - 1, s = i.length === 0 ? 0 : i.length - o;
|
|
1026
|
+
if (s < 0 || s > 3) throw Error(Lt(2));
|
|
1027
|
+
return (e, o, c, l) => {
|
|
1028
|
+
let u = e.__cacheKey__;
|
|
1029
|
+
u || (u = { id: r }, e.__cacheKey__ = u, r += 1);
|
|
1030
|
+
let d = t.get(u);
|
|
1031
|
+
if (!d) {
|
|
1032
|
+
let e = a, r = [
|
|
1033
|
+
void 0,
|
|
1034
|
+
void 0,
|
|
1035
|
+
void 0
|
|
1036
|
+
];
|
|
1037
|
+
switch (s) {
|
|
1038
|
+
case 0: break;
|
|
1039
|
+
case 1:
|
|
1040
|
+
e = [
|
|
1041
|
+
...a.slice(0, -1),
|
|
1042
|
+
() => r[0],
|
|
1043
|
+
i
|
|
1044
|
+
];
|
|
1045
|
+
break;
|
|
1046
|
+
case 2:
|
|
1047
|
+
e = [
|
|
1048
|
+
...a.slice(0, -1),
|
|
1049
|
+
() => r[0],
|
|
1050
|
+
() => r[1],
|
|
1051
|
+
i
|
|
1052
|
+
];
|
|
1053
|
+
break;
|
|
1054
|
+
default:
|
|
1055
|
+
e = [
|
|
1056
|
+
...a.slice(0, -1),
|
|
1057
|
+
() => r[0],
|
|
1058
|
+
() => r[1],
|
|
1059
|
+
() => r[2],
|
|
1060
|
+
i
|
|
1061
|
+
];
|
|
1062
|
+
break;
|
|
1063
|
+
}
|
|
1064
|
+
n && (e = [...e, n]), d = Xt(...e), d.selectorArgs = r, t.set(u, d);
|
|
1065
|
+
}
|
|
1066
|
+
switch (s) {
|
|
1067
|
+
case 3: d.selectorArgs[2] = l;
|
|
1068
|
+
case 2: d.selectorArgs[1] = c;
|
|
1069
|
+
case 1: d.selectorArgs[0] = o;
|
|
1070
|
+
default:
|
|
1071
|
+
}
|
|
1072
|
+
switch (s) {
|
|
1073
|
+
case 0: return d(e);
|
|
1074
|
+
case 1: return d(e, o);
|
|
1075
|
+
case 2: return d(e, o, c);
|
|
1076
|
+
default: return d(e, o, c, l);
|
|
1077
|
+
}
|
|
1078
|
+
};
|
|
1079
|
+
};
|
|
1080
|
+
})(), Qt = 19;
|
|
1081
|
+
function $t(e) {
|
|
1082
|
+
return Qt >= e;
|
|
1083
|
+
}
|
|
1084
|
+
var en = [], tn = void 0;
|
|
1085
|
+
function nn() {
|
|
1086
|
+
return tn;
|
|
1087
|
+
}
|
|
1088
|
+
function rn(e) {
|
|
1089
|
+
en.push(e);
|
|
1090
|
+
}
|
|
1091
|
+
var an = p(), on = /* @__PURE__ */ e(M(), 1), sn = $t(19) ? ln : un;
|
|
1092
|
+
function X(e, t, n, r, i) {
|
|
1093
|
+
return sn(e, t, n, r, i);
|
|
1094
|
+
}
|
|
1095
|
+
function cn(e, t, n, r, i) {
|
|
1096
|
+
let a = K.useCallback(() => t(e.getSnapshot(), n, r, i), [
|
|
1097
|
+
e,
|
|
1098
|
+
t,
|
|
1099
|
+
n,
|
|
1100
|
+
r,
|
|
1101
|
+
i
|
|
1102
|
+
]);
|
|
1103
|
+
return (0, an.useSyncExternalStore)(e.subscribe, a, a);
|
|
1104
|
+
}
|
|
1105
|
+
rn({
|
|
1106
|
+
before(e) {
|
|
1107
|
+
e.syncIndex = 0, e.didInitialize || (e.syncTick = 1, e.syncHooks = [], e.didChangeStore = !0, e.getSnapshot = () => {
|
|
1108
|
+
let t = !1;
|
|
1109
|
+
for (let n = 0; n < e.syncHooks.length; n += 1) {
|
|
1110
|
+
let r = e.syncHooks[n], i = r.selector(r.store.state, r.a1, r.a2, r.a3);
|
|
1111
|
+
Object.is(r.value, i) || (t = !0, r.value = i);
|
|
1112
|
+
}
|
|
1113
|
+
return t && (e.syncTick += 1), e.syncTick;
|
|
1114
|
+
});
|
|
1115
|
+
},
|
|
1116
|
+
after(e) {
|
|
1117
|
+
e.syncHooks.length > 0 && (e.didChangeStore && (e.didChangeStore = !1, e.subscribe = (t) => {
|
|
1118
|
+
let n = /* @__PURE__ */ new Set();
|
|
1119
|
+
for (let t of e.syncHooks) n.add(t.store);
|
|
1120
|
+
let r = [];
|
|
1121
|
+
for (let e of n) r.push(e.subscribe(t));
|
|
1122
|
+
return () => {
|
|
1123
|
+
for (let e of r) e();
|
|
1124
|
+
};
|
|
1125
|
+
}), (0, an.useSyncExternalStore)(e.subscribe, e.getSnapshot, e.getSnapshot));
|
|
1126
|
+
}
|
|
1127
|
+
});
|
|
1128
|
+
function ln(e, t, n, r, i) {
|
|
1129
|
+
let a = nn();
|
|
1130
|
+
if (!a) return cn(e, t, n, r, i);
|
|
1131
|
+
let o = a.syncIndex;
|
|
1132
|
+
a.syncIndex += 1;
|
|
1133
|
+
let s;
|
|
1134
|
+
return a.didInitialize ? (s = a.syncHooks[o], (s.store !== e || s.selector !== t || !Object.is(s.a1, n) || !Object.is(s.a2, r) || !Object.is(s.a3, i)) && (s.store !== e && (a.didChangeStore = !0), s.store = e, s.selector = t, s.a1 = n, s.a2 = r, s.a3 = i, s.value = t(e.getSnapshot(), n, r, i))) : (s = {
|
|
1135
|
+
store: e,
|
|
1136
|
+
selector: t,
|
|
1137
|
+
a1: n,
|
|
1138
|
+
a2: r,
|
|
1139
|
+
a3: i,
|
|
1140
|
+
value: t(e.getSnapshot(), n, r, i)
|
|
1141
|
+
}, a.syncHooks.push(s)), s.value;
|
|
1142
|
+
}
|
|
1143
|
+
function un(e, t, n, r, i) {
|
|
1144
|
+
return (0, on.useSyncExternalStoreWithSelector)(e.subscribe, e.getSnapshot, e.getSnapshot, (e) => t(e, n, r, i));
|
|
1145
|
+
}
|
|
1146
|
+
var dn = class {
|
|
1147
|
+
static create(e) {
|
|
1148
|
+
return new this(e);
|
|
1149
|
+
}
|
|
1150
|
+
constructor(e) {
|
|
1151
|
+
this.state = e, this.listeners = /* @__PURE__ */ new Set(), this.updateTick = 0;
|
|
1152
|
+
}
|
|
1153
|
+
subscribe = (e) => (this.listeners.add(e), () => {
|
|
1154
|
+
this.listeners.delete(e);
|
|
1155
|
+
});
|
|
1156
|
+
getSnapshot = () => this.state;
|
|
1157
|
+
setState(e) {
|
|
1158
|
+
if (this.state === e) return;
|
|
1159
|
+
this.state = e, this.updateTick += 1;
|
|
1160
|
+
let t = this.updateTick;
|
|
1161
|
+
for (let n of this.listeners) {
|
|
1162
|
+
if (t !== this.updateTick) return;
|
|
1163
|
+
n(e);
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
update(e) {
|
|
1167
|
+
for (let t in e) if (!Object.is(this.state[t], e[t])) {
|
|
1168
|
+
this.setState({
|
|
1169
|
+
...this.state,
|
|
1170
|
+
...e
|
|
1171
|
+
});
|
|
1172
|
+
return;
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
set(e, t) {
|
|
1176
|
+
Object.is(this.state[e], t) || this.setState({
|
|
1177
|
+
...this.state,
|
|
1178
|
+
[e]: t
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
notifyAll() {
|
|
1182
|
+
let e = { ...this.state };
|
|
1183
|
+
this.setState(e);
|
|
1184
|
+
}
|
|
1185
|
+
use(e, t, n, r) {
|
|
1186
|
+
return X(this, e, t, n, r);
|
|
1187
|
+
}
|
|
1188
|
+
}, fn = { ...K }, pn = typeof document < "u" ? K.useLayoutEffect : () => {};
|
|
1189
|
+
function mn(e) {
|
|
1190
|
+
K.useEffect(e, Pt);
|
|
1191
|
+
}
|
|
1192
|
+
var hn = (e) => e.providedTreeId ?? e.treeId, gn = {
|
|
1193
|
+
treeId: hn,
|
|
1194
|
+
treeItemIdAttribute: (e, t, n) => n ?? `${hn(e) ?? ""}-${t}`
|
|
1195
|
+
}, _n = (e) => {
|
|
1196
|
+
let t = {};
|
|
1197
|
+
return e.forEach((e, n) => {
|
|
1198
|
+
t[e] = n;
|
|
1199
|
+
}), t;
|
|
1200
|
+
}, vn = (e, t) => {
|
|
1201
|
+
if (t == null) return !1;
|
|
1202
|
+
let n = e[t];
|
|
1203
|
+
if (!n) return !1;
|
|
1204
|
+
if (n.disabled) return !0;
|
|
1205
|
+
for (; n.parentId != null;) {
|
|
1206
|
+
if (n = e[n.parentId], !n) return !1;
|
|
1207
|
+
if (n.disabled) return !0;
|
|
1208
|
+
}
|
|
1209
|
+
return !1;
|
|
1210
|
+
};
|
|
1211
|
+
function yn(e) {
|
|
1212
|
+
let { storeParameters: t, items: n, parentId: r, depth: i, isItemExpandable: a, otherItemsMetaLookup: o } = e, s = {}, c = {}, l = [], u = [], d = (e) => {
|
|
1213
|
+
let n = t.getItemId ? t.getItemId(e) : e.id;
|
|
1214
|
+
xn({
|
|
1215
|
+
id: n,
|
|
1216
|
+
parentId: r,
|
|
1217
|
+
item: e,
|
|
1218
|
+
itemMetaLookup: o,
|
|
1219
|
+
siblingsMetaLookup: s
|
|
1220
|
+
});
|
|
1221
|
+
let d = t.getItemLabel ? t.getItemLabel(e) : e.label;
|
|
1222
|
+
if (d == null) throw Error(Rt(192, JSON.stringify(e)));
|
|
1223
|
+
let f = (t.getItemChildren ? t.getItemChildren(e) : e.children) || [];
|
|
1224
|
+
u.push({
|
|
1225
|
+
id: n,
|
|
1226
|
+
children: f
|
|
1227
|
+
}), c[n] = e, s[n] = {
|
|
1228
|
+
id: n,
|
|
1229
|
+
label: d,
|
|
1230
|
+
parentId: r,
|
|
1231
|
+
idAttribute: void 0,
|
|
1232
|
+
expandable: a(e, f),
|
|
1233
|
+
disabled: t.isItemDisabled ? t.isItemDisabled(e) : !1,
|
|
1234
|
+
selectable: !t.isItemSelectionDisabled || !t.isItemSelectionDisabled(e),
|
|
1235
|
+
depth: i
|
|
1236
|
+
}, l.push(n);
|
|
1237
|
+
};
|
|
1238
|
+
for (let e of n) d(e);
|
|
1239
|
+
return {
|
|
1240
|
+
metaLookup: s,
|
|
1241
|
+
modelLookup: c,
|
|
1242
|
+
orderedChildrenIds: l,
|
|
1243
|
+
childrenIndexes: _n(l),
|
|
1244
|
+
itemsChildren: u
|
|
1245
|
+
};
|
|
1246
|
+
}
|
|
1247
|
+
function bn(e) {
|
|
1248
|
+
let { storeParameters: t, items: n, parentId: r, depth: i, isItemExpandable: a, existingItemMetaLookup: o } = e, s = {}, c = {}, l = {}, u = {}, d = Y({}, o), f = (e, n, r) => {
|
|
1249
|
+
let i = yn({
|
|
1250
|
+
storeParameters: t,
|
|
1251
|
+
items: e,
|
|
1252
|
+
parentId: n,
|
|
1253
|
+
depth: r,
|
|
1254
|
+
isItemExpandable: a,
|
|
1255
|
+
otherItemsMetaLookup: d
|
|
1256
|
+
});
|
|
1257
|
+
Object.assign(s, i.metaLookup), Object.assign(d, i.metaLookup), Object.assign(c, i.modelLookup), l[n ?? "__TREE_VIEW_ROOT_PARENT_ID__"] = i.orderedChildrenIds, u[n ?? "__TREE_VIEW_ROOT_PARENT_ID__"] = i.childrenIndexes;
|
|
1258
|
+
for (let e of i.itemsChildren) f(e.children, e.id, r + 1);
|
|
1259
|
+
};
|
|
1260
|
+
return f(n, r, i), {
|
|
1261
|
+
itemMetaLookup: s,
|
|
1262
|
+
itemModelLookup: c,
|
|
1263
|
+
itemOrderedChildrenIdsLookup: l,
|
|
1264
|
+
itemChildrenIndexesLookup: u
|
|
1265
|
+
};
|
|
1266
|
+
}
|
|
1267
|
+
function xn({ id: e, parentId: t, item: n, itemMetaLookup: r, siblingsMetaLookup: i }) {
|
|
1268
|
+
if (e == null) throw Error(Rt(193, JSON.stringify(n)));
|
|
1269
|
+
if (i[e] != null || r[e] != null && r[e].parentId !== t) throw Error(Rt(194, e));
|
|
1270
|
+
}
|
|
1271
|
+
var Sn = [], Z = {
|
|
1272
|
+
domStructure: (e) => e.domStructure,
|
|
1273
|
+
disabledItemFocusable: (e) => e.disabledItemsFocusable,
|
|
1274
|
+
itemMetaLookup: (e) => e.itemMetaLookup,
|
|
1275
|
+
itemOrderedChildrenIdsLookup: (e) => e.itemOrderedChildrenIdsLookup,
|
|
1276
|
+
itemMeta: (e, t) => e.itemMetaLookup[t ?? "__TREE_VIEW_ROOT_PARENT_ID__"] ?? null,
|
|
1277
|
+
itemOrderedChildrenIds: (e, t) => e.itemOrderedChildrenIdsLookup[t ?? "__TREE_VIEW_ROOT_PARENT_ID__"] ?? Sn,
|
|
1278
|
+
itemModel: (e, t) => e.itemModelLookup[t],
|
|
1279
|
+
isItemDisabled: (e, t) => vn(e.itemMetaLookup, t),
|
|
1280
|
+
itemIndex: (e, t) => {
|
|
1281
|
+
let n = e.itemMetaLookup[t];
|
|
1282
|
+
return n == null ? -1 : e.itemChildrenIndexesLookup[n.parentId ?? "__TREE_VIEW_ROOT_PARENT_ID__"][n.id];
|
|
1283
|
+
},
|
|
1284
|
+
itemParentId: (e, t) => e.itemMetaLookup[t]?.parentId ?? null,
|
|
1285
|
+
itemDepth: (e, t) => e.itemMetaLookup[t]?.depth ?? 0,
|
|
1286
|
+
canItemBeFocused: (e, t) => e.disabledItemsFocusable || e.itemModelLookup[t] != null && !vn(e.itemMetaLookup, t),
|
|
1287
|
+
itemChildrenIndentation: (e) => e.itemChildrenIndentation,
|
|
1288
|
+
itemHeight: (e) => e.itemHeight
|
|
1289
|
+
}, Cn = class {
|
|
1290
|
+
constructor(e) {
|
|
1291
|
+
this.store = e;
|
|
1292
|
+
}
|
|
1293
|
+
static shouldRebuildItemsState = (e, t) => [
|
|
1294
|
+
"items",
|
|
1295
|
+
"isItemDisabled",
|
|
1296
|
+
"isItemSelectionDisabled",
|
|
1297
|
+
"getItemId",
|
|
1298
|
+
"getItemLabel",
|
|
1299
|
+
"getItemChildren"
|
|
1300
|
+
].some((n) => {
|
|
1301
|
+
let r = n;
|
|
1302
|
+
return e[r] !== t[r];
|
|
1303
|
+
});
|
|
1304
|
+
static buildItemsStateIfNeeded = (e) => bn({
|
|
1305
|
+
storeParameters: e,
|
|
1306
|
+
items: e.items,
|
|
1307
|
+
parentId: null,
|
|
1308
|
+
depth: 0,
|
|
1309
|
+
isItemExpandable: (e, t) => !!t && t.length > 0
|
|
1310
|
+
});
|
|
1311
|
+
getItem = (e) => Z.itemModel(this.store.state, e);
|
|
1312
|
+
getItemTree = () => {
|
|
1313
|
+
let e = (t) => {
|
|
1314
|
+
let n = Y({}, Z.itemModel(this.store.state, t)), r = Z.itemOrderedChildrenIds(this.store.state, t);
|
|
1315
|
+
return r.length > 0 ? n.children = r.map(e) : delete n.children, n;
|
|
1316
|
+
};
|
|
1317
|
+
return Z.itemOrderedChildrenIds(this.store.state, null).map(e);
|
|
1318
|
+
};
|
|
1319
|
+
getItemOrderedChildrenIds = (e) => Z.itemOrderedChildrenIds(this.store.state, e);
|
|
1320
|
+
getParentId = (e) => Z.itemMeta(this.store.state, e)?.parentId || null;
|
|
1321
|
+
setIsItemDisabled = ({ itemId: e, shouldBeDisabled: t }) => {
|
|
1322
|
+
if (!this.store.state.itemMetaLookup[e]) return;
|
|
1323
|
+
let n = Y({}, this.store.state.itemMetaLookup);
|
|
1324
|
+
n[e] = Y({}, n[e], { disabled: t ?? !n[e].disabled }), this.store.set("itemMetaLookup", n);
|
|
1325
|
+
};
|
|
1326
|
+
addItems = ({ items: e, parentId: t = null, index: n }) => {
|
|
1327
|
+
if (e.length === 0) return;
|
|
1328
|
+
if (t != null && Z.itemMeta(this.store.state, t) == null) throw Error(Rt(295, t));
|
|
1329
|
+
let r = t == null ? -1 : Z.itemDepth(this.store.state, t), i = this.store.parameters.dataSource, { itemMetaLookup: a, itemModelLookup: o, itemOrderedChildrenIdsLookup: s, itemChildrenIndexesLookup: c } = bn({
|
|
1330
|
+
storeParameters: this.store.parameters,
|
|
1331
|
+
items: e,
|
|
1332
|
+
parentId: t,
|
|
1333
|
+
depth: r + 1,
|
|
1334
|
+
isItemExpandable: (e, t) => t != null && t.length > 0 || i != null && i.getChildrenCount(e) !== 0,
|
|
1335
|
+
existingItemMetaLookup: this.store.state.itemMetaLookup
|
|
1336
|
+
});
|
|
1337
|
+
for (let e of Object.keys(a)) if (this.store.state.itemMetaLookup[e] != null) throw Error(Rt(194, e));
|
|
1338
|
+
let l = t ?? "__TREE_VIEW_ROOT_PARENT_ID__", u = Z.itemOrderedChildrenIds(this.store.state, t), d = n ?? u.length;
|
|
1339
|
+
if (d < 0 || d > u.length) throw Error(Rt(296, d, u.length));
|
|
1340
|
+
let f = s[l], p = [...u];
|
|
1341
|
+
p.splice(d, 0, ...f), s[l] = p, c[l] = _n(p);
|
|
1342
|
+
let m = Y({}, this.store.state.itemMetaLookup, a);
|
|
1343
|
+
t != null && !m[t].expandable && (m[t] = Y({}, m[t], { expandable: !0 })), this.store.update({
|
|
1344
|
+
itemMetaLookup: m,
|
|
1345
|
+
itemModelLookup: Y({}, this.store.state.itemModelLookup, o),
|
|
1346
|
+
itemOrderedChildrenIdsLookup: Y({}, this.store.state.itemOrderedChildrenIdsLookup, s),
|
|
1347
|
+
itemChildrenIndexesLookup: Y({}, this.store.state.itemChildrenIndexesLookup, c)
|
|
1348
|
+
}), this.store.selection.propagateSelectionToNewItems(t, f);
|
|
1349
|
+
};
|
|
1350
|
+
buildPublicAPI = () => ({
|
|
1351
|
+
getItem: this.getItem,
|
|
1352
|
+
getItemDOMElement: this.getItemDOMElement,
|
|
1353
|
+
getItemOrderedChildrenIds: this.getItemOrderedChildrenIds,
|
|
1354
|
+
getItemTree: this.getItemTree,
|
|
1355
|
+
getParentId: this.getParentId,
|
|
1356
|
+
setIsItemDisabled: this.setIsItemDisabled
|
|
1357
|
+
});
|
|
1358
|
+
getItemDOMElement = (e) => {
|
|
1359
|
+
let t = Z.itemMeta(this.store.state, e);
|
|
1360
|
+
if (t == null) return null;
|
|
1361
|
+
let n = gn.treeItemIdAttribute(this.store.state, e, t.idAttribute);
|
|
1362
|
+
return document.getElementById(n);
|
|
1363
|
+
};
|
|
1364
|
+
setItemChildren = ({ items: e, parentId: t, getChildrenCount: n, recursive: r = !1 }) => {
|
|
1365
|
+
let i = t == null ? -1 : Z.itemDepth(this.store.state, t), a = Z.itemMetaLookup(this.store.state), o = {
|
|
1366
|
+
storeParameters: this.store.parameters,
|
|
1367
|
+
items: e,
|
|
1368
|
+
parentId: t,
|
|
1369
|
+
depth: i + 1,
|
|
1370
|
+
isItemExpandable: n ? (e) => n(e) !== 0 : () => !1
|
|
1371
|
+
}, s;
|
|
1372
|
+
if (r) s = bn(Y({}, o, { existingItemMetaLookup: a }));
|
|
1373
|
+
else {
|
|
1374
|
+
let e = t ?? "__TREE_VIEW_ROOT_PARENT_ID__", { metaLookup: n, modelLookup: r, orderedChildrenIds: i, childrenIndexes: c } = yn(Y({}, o, { otherItemsMetaLookup: a }));
|
|
1375
|
+
s = {
|
|
1376
|
+
itemMetaLookup: n,
|
|
1377
|
+
itemModelLookup: r,
|
|
1378
|
+
itemOrderedChildrenIdsLookup: { [e]: i },
|
|
1379
|
+
itemChildrenIndexesLookup: { [e]: c }
|
|
1380
|
+
};
|
|
1381
|
+
}
|
|
1382
|
+
let c = Y({}, this.store.state.itemModelLookup), l = Y({}, this.store.state.itemMetaLookup), u = Y({}, this.store.state.itemOrderedChildrenIdsLookup), d = Y({}, this.store.state.itemChildrenIndexesLookup), f = (e) => {
|
|
1383
|
+
if (s.itemMetaLookup[e] == null) {
|
|
1384
|
+
for (let t of u[e] ?? []) f(t);
|
|
1385
|
+
delete c[e], delete l[e], delete u[e], delete d[e];
|
|
1386
|
+
}
|
|
1387
|
+
};
|
|
1388
|
+
for (let e of Object.keys(s.itemOrderedChildrenIdsLookup)) for (let t of u[e] ?? []) f(t);
|
|
1389
|
+
this.store.update({
|
|
1390
|
+
itemModelLookup: Y({}, c, s.itemModelLookup),
|
|
1391
|
+
itemMetaLookup: Y({}, l, s.itemMetaLookup),
|
|
1392
|
+
itemOrderedChildrenIdsLookup: Y({}, u, s.itemOrderedChildrenIdsLookup),
|
|
1393
|
+
itemChildrenIndexesLookup: Y({}, d, s.itemChildrenIndexesLookup)
|
|
1394
|
+
});
|
|
1395
|
+
};
|
|
1396
|
+
removeChildren = (e) => {
|
|
1397
|
+
let t = this.store.state.itemMetaLookup, n = {};
|
|
1398
|
+
for (let r of Object.keys(t)) {
|
|
1399
|
+
let i = t[r];
|
|
1400
|
+
i.parentId !== e && (n[r] = i);
|
|
1401
|
+
}
|
|
1402
|
+
let r = Y({}, this.store.state.itemOrderedChildrenIdsLookup), i = Y({}, this.store.state.itemChildrenIndexesLookup), a = e ?? "__TREE_VIEW_ROOT_PARENT_ID__";
|
|
1403
|
+
delete i[a], delete r[a], this.store.update({
|
|
1404
|
+
itemMetaLookup: n,
|
|
1405
|
+
itemOrderedChildrenIdsLookup: r,
|
|
1406
|
+
itemChildrenIndexesLookup: i
|
|
1407
|
+
});
|
|
1408
|
+
};
|
|
1409
|
+
handleItemClick = (e, t) => {
|
|
1410
|
+
this.store.parameters.onItemClick?.(e, t);
|
|
1411
|
+
};
|
|
1412
|
+
}, wn = Zt((e) => e.selectedItems, (e) => Array.isArray(e) ? e : e == null ? [] : [e]), Tn = Zt(wn, (e) => {
|
|
1413
|
+
let t = /* @__PURE__ */ new Map();
|
|
1414
|
+
return e.forEach((e) => {
|
|
1415
|
+
t.set(e, !0);
|
|
1416
|
+
}), t;
|
|
1417
|
+
}), En = (e, t) => e.itemMetaLookup[t]?.selectable ?? !0, Dn = (e, t) => Tn(e).has(t), On = (e, t) => !e.disableSelection && !Z.isItemDisabled(e, t) && En(e, t), kn = (e) => e.selectionPropagation, An = (e, t) => {
|
|
1418
|
+
if (Dn(e, t)) return "selected";
|
|
1419
|
+
if (Z.itemOrderedChildrenIds(e, t).length === 0) return "unselected";
|
|
1420
|
+
let n = !1, r = !1, i = (a) => {
|
|
1421
|
+
a !== t && On(e, a) && (Dn(e, a) ? n = !0 : r = !0), Z.itemOrderedChildrenIds(e, a).forEach(i);
|
|
1422
|
+
};
|
|
1423
|
+
return i(t), kn(e).parents ? n && r ? "indeterminate" : n && !r ? "selected" : "unselected" : n ? "indeterminate" : "unselected";
|
|
1424
|
+
}, Q = {
|
|
1425
|
+
selectedItemsRaw: (e) => e.selectedItems,
|
|
1426
|
+
selectedItems: wn,
|
|
1427
|
+
selectedItemsMap: Tn,
|
|
1428
|
+
enabled: (e) => !e.disableSelection,
|
|
1429
|
+
isMultiSelectEnabled: (e) => e.multiSelect,
|
|
1430
|
+
isCheckboxSelectionEnabled: (e) => e.checkboxSelection,
|
|
1431
|
+
propagationRules: kn,
|
|
1432
|
+
isItemSelected: Dn,
|
|
1433
|
+
itemSelectionStatus: An,
|
|
1434
|
+
isItemIndeterminate: (e, t) => An(e, t) === "indeterminate",
|
|
1435
|
+
isFeatureEnabledForItem: (e, t) => !e.disableSelection && En(e, t),
|
|
1436
|
+
canItemBeSelected: On,
|
|
1437
|
+
isItemSelectable: En
|
|
1438
|
+
}, jn = ({ props: e }) => {
|
|
1439
|
+
let { itemId: t } = e, { store: n } = Bt(), r = X(n, Q.isCheckboxSelectionEnabled), i = X(n, Q.isFeatureEnabledForItem, t), a = X(n, Q.canItemBeSelected, t), o = X(n, Z.isItemDisabled, t), s = X(n, Q.isItemSelectable, t), c = X(n, Q.itemSelectionStatus, t), l = X(n, Q.isItemSelected, t), u = o || !s;
|
|
1440
|
+
return { propsEnhancers: {
|
|
1441
|
+
root: () => {
|
|
1442
|
+
let e;
|
|
1443
|
+
return e = u ? void 0 : (r ? c === "selected" : l) ? !0 : r && c === "indeterminate" ? "mixed" : !a && void 0, r ? {
|
|
1444
|
+
"aria-checked": e,
|
|
1445
|
+
"aria-selected": void 0
|
|
1446
|
+
} : {
|
|
1447
|
+
"aria-checked": void 0,
|
|
1448
|
+
"aria-selected": e !== "mixed" && e
|
|
1449
|
+
};
|
|
1450
|
+
},
|
|
1451
|
+
checkbox: ({ externalEventHandlers: e, interactions: o }) => ({
|
|
1452
|
+
tabIndex: -1,
|
|
1453
|
+
onChange: (r) => {
|
|
1454
|
+
e.onChange?.(r), !r.defaultMuiPrevented && Q.canItemBeSelected(n.state, t) && o.handleCheckboxSelection(r);
|
|
1455
|
+
},
|
|
1456
|
+
visible: r && i,
|
|
1457
|
+
disabled: !a,
|
|
1458
|
+
checked: c === "selected",
|
|
1459
|
+
indeterminate: c === "indeterminate"
|
|
1460
|
+
})
|
|
1461
|
+
} };
|
|
1462
|
+
}, Mn = Zt((e) => e.expandedItems, (e) => {
|
|
1463
|
+
let t = /* @__PURE__ */ new Map();
|
|
1464
|
+
return e.forEach((e) => {
|
|
1465
|
+
t.set(e, !0);
|
|
1466
|
+
}), t;
|
|
1467
|
+
}), $ = {
|
|
1468
|
+
expandedItemsRaw: (e) => e.expandedItems,
|
|
1469
|
+
expandedItemsMap: Mn,
|
|
1470
|
+
flatList: Zt(Z.itemOrderedChildrenIdsLookup, Mn, (e, t) => {
|
|
1471
|
+
function n(r) {
|
|
1472
|
+
if (!t.has(r)) return [r];
|
|
1473
|
+
let i = [r], a = e[r] || [];
|
|
1474
|
+
for (let e of a) i.push(...n(e));
|
|
1475
|
+
return i;
|
|
1476
|
+
}
|
|
1477
|
+
return (e.__TREE_VIEW_ROOT_PARENT_ID__ ?? []).flatMap(n);
|
|
1478
|
+
}),
|
|
1479
|
+
triggerSlot: (e) => e.expansionTrigger,
|
|
1480
|
+
isItemExpanded: (e, t) => Mn(e).has(t),
|
|
1481
|
+
isItemExpandable: (e, t) => Z.itemMeta(e, t)?.expandable ?? !1
|
|
1482
|
+
}, Nn = (e, t) => {
|
|
1483
|
+
let n = t.length - 1;
|
|
1484
|
+
for (; n >= 0 && !Z.canItemBeFocused(e, t[n]);) --n;
|
|
1485
|
+
if (n !== -1) return t[n];
|
|
1486
|
+
}, Pn = (e, t) => {
|
|
1487
|
+
let n = Z.itemMeta(e, t);
|
|
1488
|
+
if (!n) return null;
|
|
1489
|
+
let r = Z.itemOrderedChildrenIds(e, n.parentId), i = Z.itemIndex(e, t);
|
|
1490
|
+
if (i === 0) return n.parentId;
|
|
1491
|
+
let a = i - 1;
|
|
1492
|
+
for (; !Z.canItemBeFocused(e, r[a]) && a >= 0;) --a;
|
|
1493
|
+
if (a === -1) return n.parentId == null ? null : Pn(e, n.parentId);
|
|
1494
|
+
let o = r[a], s = Nn(e, Z.itemOrderedChildrenIds(e, o));
|
|
1495
|
+
for (; $.isItemExpanded(e, o) && s != null;) o = s, s = Nn(e, Z.itemOrderedChildrenIds(e, o));
|
|
1496
|
+
return o;
|
|
1497
|
+
}, Fn = (e, t) => {
|
|
1498
|
+
if ($.isItemExpanded(e, t)) {
|
|
1499
|
+
let n = Z.itemOrderedChildrenIds(e, t).find((t) => Z.canItemBeFocused(e, t));
|
|
1500
|
+
if (n != null) return n;
|
|
1501
|
+
}
|
|
1502
|
+
let n = Z.itemMeta(e, t);
|
|
1503
|
+
for (; n != null;) {
|
|
1504
|
+
let t = Z.itemOrderedChildrenIds(e, n.parentId), r = Z.itemIndex(e, n.id);
|
|
1505
|
+
if (r < t.length - 1) {
|
|
1506
|
+
let n = r + 1;
|
|
1507
|
+
for (; !Z.canItemBeFocused(e, t[n]) && n < t.length - 1;) n += 1;
|
|
1508
|
+
if (Z.canItemBeFocused(e, t[n])) return t[n];
|
|
1509
|
+
}
|
|
1510
|
+
n = Z.itemMeta(e, n.parentId);
|
|
1511
|
+
}
|
|
1512
|
+
return null;
|
|
1513
|
+
}, In = (e) => {
|
|
1514
|
+
let t = null;
|
|
1515
|
+
for (; t == null || $.isItemExpanded(e, t);) {
|
|
1516
|
+
let n = Nn(e, Z.itemOrderedChildrenIds(e, t));
|
|
1517
|
+
if (n == null) return t;
|
|
1518
|
+
t = n;
|
|
1519
|
+
}
|
|
1520
|
+
return t;
|
|
1521
|
+
}, Ln = (e) => Z.itemOrderedChildrenIds(e, null).find((t) => Z.canItemBeFocused(e, t)), Rn = (e, t, n) => {
|
|
1522
|
+
if (t === n) return [t, n];
|
|
1523
|
+
let r = Z.itemMeta(e, t), i = Z.itemMeta(e, n);
|
|
1524
|
+
if (!r || !i) return [t, n];
|
|
1525
|
+
if (r.parentId === i.id || i.parentId === r.id) return i.parentId === r.id ? [r.id, i.id] : [i.id, r.id];
|
|
1526
|
+
let a = [r.id], o = [i.id], s = r.parentId, c = i.parentId, l = o.indexOf(s) !== -1, u = a.indexOf(c) !== -1, d = !0, f = !0;
|
|
1527
|
+
for (; !u && !l;) d && (a.push(s), l = o.indexOf(s) !== -1, d = s !== null, !l && d && (s = Z.itemParentId(e, s))), f && !l && (o.push(c), u = a.indexOf(c) !== -1, f = c !== null, !u && f && (c = Z.itemParentId(e, c)));
|
|
1528
|
+
let p = l ? s : c, m = Z.itemOrderedChildrenIds(e, p), h = a[a.indexOf(p) - 1], g = o[o.indexOf(p) - 1];
|
|
1529
|
+
return m.indexOf(h) < m.indexOf(g) ? [t, n] : [n, t];
|
|
1530
|
+
}, zn = (e, t, n) => {
|
|
1531
|
+
let r = (t) => {
|
|
1532
|
+
if ($.isItemExpandable(e, t) && $.isItemExpanded(e, t)) return Z.itemOrderedChildrenIds(e, t)[0];
|
|
1533
|
+
let n = Z.itemMeta(e, t);
|
|
1534
|
+
for (; n != null;) {
|
|
1535
|
+
let t = Z.itemOrderedChildrenIds(e, n.parentId), r = Z.itemIndex(e, n.id);
|
|
1536
|
+
if (r < t.length - 1) return t[r + 1];
|
|
1537
|
+
n = n.parentId ? Z.itemMeta(e, n.parentId) : null;
|
|
1538
|
+
}
|
|
1539
|
+
throw Error(Rt(191));
|
|
1540
|
+
}, [i, a] = Rn(e, t, n), o = [i], s = i;
|
|
1541
|
+
for (; s !== a;) s = r(s), Z.isItemDisabled(e, s) || o.push(s);
|
|
1542
|
+
return o;
|
|
1543
|
+
}, Bn = (e) => {
|
|
1544
|
+
let t = Ln(e), n = [];
|
|
1545
|
+
for (; t != null;) n.push(t), t = Fn(e, t);
|
|
1546
|
+
return n;
|
|
1547
|
+
}, Vn = (e, t) => t !== e.closest("*[role=\"treeitem\"]"), Hn = class {
|
|
1548
|
+
lastSelectedItem = null;
|
|
1549
|
+
lastSelectedRange = {};
|
|
1550
|
+
constructor(e) {
|
|
1551
|
+
this.store = e, e.itemPluginManager.register(jn, null);
|
|
1552
|
+
}
|
|
1553
|
+
setSelectedItems = (e, t, n) => {
|
|
1554
|
+
let { selectionPropagation: r = Ft, selectedItems: i, onItemSelectionToggle: a, onSelectedItemsChange: o } = this.store.parameters, s = Q.selectedItemsRaw(this.store.state), c, l = Q.isMultiSelectEnabled(this.store.state);
|
|
1555
|
+
if (c = l && (r.descendants || r.parents) ? Un({
|
|
1556
|
+
store: this.store,
|
|
1557
|
+
selectionPropagation: r,
|
|
1558
|
+
newModel: t,
|
|
1559
|
+
oldModel: s,
|
|
1560
|
+
additionalItemsToPropagate: n
|
|
1561
|
+
}) : t, i === void 0 && this.store.set("selectedItems", c), a) if (l) {
|
|
1562
|
+
let t = Wn({
|
|
1563
|
+
newModel: c,
|
|
1564
|
+
oldModel: s
|
|
1565
|
+
});
|
|
1566
|
+
a && (t.added.forEach((t) => {
|
|
1567
|
+
a(e, t, !0);
|
|
1568
|
+
}), t.removed.forEach((t) => {
|
|
1569
|
+
a(e, t, !1);
|
|
1570
|
+
}));
|
|
1571
|
+
} else c !== s && (s != null && a(e, s, !1), c != null && a(e, c, !0));
|
|
1572
|
+
o?.(e, c);
|
|
1573
|
+
};
|
|
1574
|
+
selectRange = (e, [t, n]) => {
|
|
1575
|
+
if (!Q.isMultiSelectEnabled(this.store.state)) return;
|
|
1576
|
+
let r = Q.selectedItems(this.store.state).slice();
|
|
1577
|
+
Object.keys(this.lastSelectedRange).length > 0 && (r = r.filter((e) => !this.lastSelectedRange[e]));
|
|
1578
|
+
let i = Gn(r), a = zn(this.store.state, t, n).filter((e) => Q.isItemSelectable(this.store.state, e)), o = a.filter((e) => !i[e]);
|
|
1579
|
+
r = r.concat(o), this.setSelectedItems(e, r), this.lastSelectedRange = Gn(a);
|
|
1580
|
+
};
|
|
1581
|
+
getItemSelection = (e) => Q.itemSelectionStatus(this.store.state, e);
|
|
1582
|
+
buildPublicAPI = () => ({
|
|
1583
|
+
getItemSelection: this.getItemSelection,
|
|
1584
|
+
setItemSelection: this.setItemSelection
|
|
1585
|
+
});
|
|
1586
|
+
propagateSelectionToNewItems = (e, t) => {
|
|
1587
|
+
let { selectionPropagation: n = Ft } = this.store.parameters;
|
|
1588
|
+
if (e == null || t.length === 0 || !n.descendants || !Q.isMultiSelectEnabled(this.store.state) || !Q.isItemSelected(this.store.state, e)) return;
|
|
1589
|
+
let r = Q.selectedItems(this.store.state).concat(t);
|
|
1590
|
+
this.setSelectedItems(null, r, t);
|
|
1591
|
+
};
|
|
1592
|
+
setItemSelection = ({ itemId: e, event: t = null, keepExistingSelection: n = !1, shouldBeSelected: r }) => {
|
|
1593
|
+
if (!Q.enabled(this.store.state)) return;
|
|
1594
|
+
let i, a = Q.isMultiSelectEnabled(this.store.state);
|
|
1595
|
+
if (n && a) {
|
|
1596
|
+
let t = Q.selectedItems(this.store.state), n = Q.isItemSelected(this.store.state, e);
|
|
1597
|
+
i = n && (r === !1 || r == null) ? t.filter((t) => t !== e) : !n && (r === !0 || r == null) ? [e].concat(t) : t;
|
|
1598
|
+
} else i = r === !1 || r == null && Q.isItemSelected(this.store.state, e) ? a ? [] : null : a ? [e] : e;
|
|
1599
|
+
this.setSelectedItems(t, i, [e]), this.lastSelectedItem = e, this.lastSelectedRange = {};
|
|
1600
|
+
};
|
|
1601
|
+
selectAllNavigableItems = (e) => {
|
|
1602
|
+
if (!Q.isMultiSelectEnabled(this.store.state)) return;
|
|
1603
|
+
let t = Bn(this.store.state);
|
|
1604
|
+
this.setSelectedItems(e, t), this.lastSelectedRange = Gn(t);
|
|
1605
|
+
};
|
|
1606
|
+
expandSelectionRange = (e, t) => {
|
|
1607
|
+
if (this.lastSelectedItem != null) {
|
|
1608
|
+
let [n, r] = Rn(this.store.state, t, this.lastSelectedItem);
|
|
1609
|
+
this.selectRange(e, [n, r]);
|
|
1610
|
+
}
|
|
1611
|
+
};
|
|
1612
|
+
selectRangeFromStartToItem = (e, t) => {
|
|
1613
|
+
this.selectRange(e, [Ln(this.store.state), t]);
|
|
1614
|
+
};
|
|
1615
|
+
selectRangeFromItemToEnd = (e, t) => {
|
|
1616
|
+
this.selectRange(e, [t, In(this.store.state)]);
|
|
1617
|
+
};
|
|
1618
|
+
selectItemFromArrowNavigation = (e, t, n) => {
|
|
1619
|
+
if (!Q.isMultiSelectEnabled(this.store.state)) return;
|
|
1620
|
+
let r = Q.selectedItems(this.store.state).slice();
|
|
1621
|
+
Object.keys(this.lastSelectedRange).length === 0 ? (Q.isItemSelected(this.store.state, n) || r.push(n), this.lastSelectedRange = {
|
|
1622
|
+
[t]: !0,
|
|
1623
|
+
[n]: !0
|
|
1624
|
+
}) : (this.lastSelectedRange[t] || (this.lastSelectedRange = {}), this.lastSelectedRange[n] ? (r = r.filter((e) => e !== t), delete this.lastSelectedRange[t]) : (Q.isItemSelected(this.store.state, n) || r.push(n), this.lastSelectedRange[n] = !0)), this.setSelectedItems(e, r);
|
|
1625
|
+
};
|
|
1626
|
+
};
|
|
1627
|
+
function Un({ store: e, selectionPropagation: t, newModel: n, oldModel: r, additionalItemsToPropagate: i }) {
|
|
1628
|
+
if (!t.descendants && !t.parents) return n;
|
|
1629
|
+
let a = !1, o = Gn(n), s = Wn({
|
|
1630
|
+
newModel: n,
|
|
1631
|
+
oldModel: r
|
|
1632
|
+
});
|
|
1633
|
+
return i?.forEach((e) => {
|
|
1634
|
+
o[e] ? s.added.includes(e) || s.added.push(e) : s.removed.includes(e) || s.removed.push(e);
|
|
1635
|
+
}), s.added.forEach((n) => {
|
|
1636
|
+
if (t.descendants) {
|
|
1637
|
+
let t = (r) => {
|
|
1638
|
+
r !== n && Q.canItemBeSelected(e.state, r) && (a = !0, o[r] = !0), Z.itemOrderedChildrenIds(e.state, r).forEach(t);
|
|
1639
|
+
};
|
|
1640
|
+
t(n);
|
|
1641
|
+
}
|
|
1642
|
+
if (t.parents) {
|
|
1643
|
+
let t = (n) => Q.canItemBeSelected(e.state, n) ? o[n] ? Z.itemOrderedChildrenIds(e.state, n).every(t) : !1 : Z.itemOrderedChildrenIds(e.state, n).every(t), r = (n) => {
|
|
1644
|
+
let i = Z.itemParentId(e.state, n);
|
|
1645
|
+
i != null && Z.itemOrderedChildrenIds(e.state, i).every(t) && (Q.canItemBeSelected(e.state, i) && (a = !0, o[i] = !0), r(i));
|
|
1646
|
+
};
|
|
1647
|
+
r(n);
|
|
1648
|
+
}
|
|
1649
|
+
}), s.removed.forEach((n) => {
|
|
1650
|
+
if (t.parents) {
|
|
1651
|
+
let t = Z.itemParentId(e.state, n);
|
|
1652
|
+
for (; t != null;) o[t] && (a = !0, delete o[t]), t = Z.itemParentId(e.state, t);
|
|
1653
|
+
}
|
|
1654
|
+
if (t.descendants) {
|
|
1655
|
+
let t = (r) => {
|
|
1656
|
+
r !== n && (a = !0, delete o[r]), Z.itemOrderedChildrenIds(e.state, r).forEach(t);
|
|
1657
|
+
};
|
|
1658
|
+
t(n);
|
|
1659
|
+
}
|
|
1660
|
+
}), a ? Object.keys(o) : n;
|
|
1661
|
+
}
|
|
1662
|
+
function Wn({ oldModel: e, newModel: t }) {
|
|
1663
|
+
let n = /* @__PURE__ */ new Map();
|
|
1664
|
+
t.forEach((e) => {
|
|
1665
|
+
n.set(e, !0);
|
|
1666
|
+
});
|
|
1667
|
+
let r = /* @__PURE__ */ new Map();
|
|
1668
|
+
return e.forEach((e) => {
|
|
1669
|
+
r.set(e, !0);
|
|
1670
|
+
}), {
|
|
1671
|
+
added: t.filter((e) => !r.has(e)),
|
|
1672
|
+
removed: e.filter((e) => !n.has(e))
|
|
1673
|
+
};
|
|
1674
|
+
}
|
|
1675
|
+
function Gn(e) {
|
|
1676
|
+
let t = {};
|
|
1677
|
+
return e.forEach((e) => {
|
|
1678
|
+
t[e] = !0;
|
|
1679
|
+
}), t;
|
|
1680
|
+
}
|
|
1681
|
+
function Kn(e, t, n) {
|
|
1682
|
+
let r = X(e, gn.treeId), i = X(e, Z.itemChildrenIndentation), a = X(e, Q.isMultiSelectEnabled);
|
|
1683
|
+
return (o) => Y({
|
|
1684
|
+
ref: n,
|
|
1685
|
+
role: "tree",
|
|
1686
|
+
id: r,
|
|
1687
|
+
"aria-multiselectable": a
|
|
1688
|
+
}, t, o, {
|
|
1689
|
+
style: Y({}, t.style, { "--TreeView-itemChildrenIndentation": typeof i == "number" ? `${i}px` : i }),
|
|
1690
|
+
onFocus: (t) => {
|
|
1691
|
+
o.onFocus?.(t), e.focus.handleRootFocus(t);
|
|
1692
|
+
},
|
|
1693
|
+
onBlur: (t) => {
|
|
1694
|
+
o.onBlur?.(t), e.focus.handleRootBlur(t);
|
|
1695
|
+
}
|
|
1696
|
+
});
|
|
1697
|
+
}
|
|
1698
|
+
function qn(e) {
|
|
1699
|
+
return e.replace(/["\\]/g, "\\$&");
|
|
1700
|
+
}
|
|
1701
|
+
var Jn = /*#__PURE__*/ K.createContext(null);
|
|
1702
|
+
function Yn(e) {
|
|
1703
|
+
let { children: t, itemId: n = null, idAttribute: r } = e, { store: i, rootRef: a } = Bt(), o = K.useRef(/* @__PURE__ */ new Map()), [, s] = K.useReducer((e) => e + 1, 0);
|
|
1704
|
+
K.useEffect(() => {
|
|
1705
|
+
if (!a.current) return;
|
|
1706
|
+
let e = Z.itemOrderedChildrenIds(i.state, n ?? null) ?? [], t = qn(r ?? a.current.id);
|
|
1707
|
+
if (n != null) {
|
|
1708
|
+
let e = a.current.querySelector(`*[id="${t}"][role="treeitem"]`);
|
|
1709
|
+
if (e && e.getAttribute("aria-expanded") === "false") return;
|
|
1710
|
+
}
|
|
1711
|
+
let s = a.current.querySelectorAll(`${n == null ? "" : `*[id="${t}"] `}[role="treeitem"]:not(*[id="${t}"] [role="treeitem"] [role="treeitem"])`), c = Array.from(s).map((e) => o.current.get(e.id)).filter((e) => e != null);
|
|
1712
|
+
(c.length !== e.length || c.some((t, n) => t !== e[n])) && i.jsxItems.setJSXItemsOrderedChildrenIds(n ?? null, c);
|
|
1713
|
+
});
|
|
1714
|
+
let c = K.useMemo(() => ({
|
|
1715
|
+
registerChild: (e, t) => {
|
|
1716
|
+
o.current.set(e, t), s();
|
|
1717
|
+
},
|
|
1718
|
+
unregisterChild: (e) => {
|
|
1719
|
+
o.current.delete(e), s();
|
|
1720
|
+
},
|
|
1721
|
+
parentId: n
|
|
1722
|
+
}), [n]);
|
|
1723
|
+
return /*#__PURE__*/ (0, q.jsx)(Jn.Provider, {
|
|
1724
|
+
value: c,
|
|
1725
|
+
children: t
|
|
1726
|
+
});
|
|
1727
|
+
}
|
|
1728
|
+
var Xn = /*#__PURE__*/ K.createContext(() => -1), Zn = typeof Symbol.dispose == "symbol" ? Symbol.dispose : Symbol.for("Symbol.dispose"), Qn = typeof SuppressedError == "function" ? SuppressedError : void 0;
|
|
1729
|
+
function $n(e, t) {
|
|
1730
|
+
return Qn ? new Qn(e, t) : Object.assign(/* @__PURE__ */ Error("An error was suppressed during disposal."), {
|
|
1731
|
+
name: "SuppressedError",
|
|
1732
|
+
error: e,
|
|
1733
|
+
suppressed: t
|
|
1734
|
+
});
|
|
1735
|
+
}
|
|
1736
|
+
function er(e) {
|
|
1737
|
+
if (e) throw ReferenceError("MUI X: The disposable stack is disposed.");
|
|
1738
|
+
}
|
|
1739
|
+
var tr = class e {
|
|
1740
|
+
stack = [];
|
|
1741
|
+
isDisposed = !1;
|
|
1742
|
+
get disposed() {
|
|
1743
|
+
return this.isDisposed;
|
|
1744
|
+
}
|
|
1745
|
+
use(e) {
|
|
1746
|
+
if (er(this.isDisposed), e != null) {
|
|
1747
|
+
let t = e[Zn];
|
|
1748
|
+
if (typeof t != "function") throw TypeError("MUI X: The value is not disposable.");
|
|
1749
|
+
this.stack.push(() => t.call(e));
|
|
1750
|
+
}
|
|
1751
|
+
return e;
|
|
1752
|
+
}
|
|
1753
|
+
adopt(e, t) {
|
|
1754
|
+
return er(this.isDisposed), this.stack.push(() => t(e)), e;
|
|
1755
|
+
}
|
|
1756
|
+
defer(e) {
|
|
1757
|
+
er(this.isDisposed), this.stack.push(e);
|
|
1758
|
+
}
|
|
1759
|
+
move() {
|
|
1760
|
+
er(this.isDisposed);
|
|
1761
|
+
let t = new e();
|
|
1762
|
+
return t.stack = this.stack, this.stack = [], this.isDisposed = !0, t;
|
|
1763
|
+
}
|
|
1764
|
+
dispose() {
|
|
1765
|
+
if (this.isDisposed) return;
|
|
1766
|
+
this.isDisposed = !0;
|
|
1767
|
+
let e = !1, t;
|
|
1768
|
+
for (let n = this.stack.length - 1; n >= 0; --n) try {
|
|
1769
|
+
this.stack[n]();
|
|
1770
|
+
} catch (n) {
|
|
1771
|
+
t = e ? $n(n, t) : n, e = !0;
|
|
1772
|
+
}
|
|
1773
|
+
if (this.stack = [], e) throw t;
|
|
1774
|
+
}
|
|
1775
|
+
[Zn]() {
|
|
1776
|
+
this.dispose();
|
|
1777
|
+
}
|
|
1778
|
+
}, nr = globalThis.DisposableStack ?? tr;
|
|
1779
|
+
globalThis.AsyncDisposableStack;
|
|
1780
|
+
var rr = fn;
|
|
1781
|
+
rr.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE ?? rr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
1782
|
+
var ir = Symbol("useDisposable.mount"), ar = Symbol();
|
|
1783
|
+
function or(e) {
|
|
1784
|
+
let t = K.useRef(ar);
|
|
1785
|
+
if (t.current === ar) {
|
|
1786
|
+
let n = e(), r = () => {
|
|
1787
|
+
n[Zn](), t.current = ar;
|
|
1788
|
+
};
|
|
1789
|
+
n[ir] = () => r, t.current = n;
|
|
1790
|
+
}
|
|
1791
|
+
return mn(t.current[ir]), t.current;
|
|
1792
|
+
}
|
|
1793
|
+
var sr = or;
|
|
1794
|
+
function cr(e, t) {
|
|
1795
|
+
let n = f(), r = T(), i = sr(() => new e(Y({}, t, {
|
|
1796
|
+
isRtl: n,
|
|
1797
|
+
defaultId: r
|
|
1798
|
+
})));
|
|
1799
|
+
return pn(() => i.updateStateFromParameters(Y({}, t, {
|
|
1800
|
+
isRtl: n,
|
|
1801
|
+
defaultId: r
|
|
1802
|
+
})), [
|
|
1803
|
+
i,
|
|
1804
|
+
n,
|
|
1805
|
+
r,
|
|
1806
|
+
t
|
|
1807
|
+
]), mn(i.mountEffect), i;
|
|
1808
|
+
}
|
|
1809
|
+
var lr = class {
|
|
1810
|
+
maxListeners = 20;
|
|
1811
|
+
warnOnce = !1;
|
|
1812
|
+
events = {};
|
|
1813
|
+
on(e, t, n = {}) {
|
|
1814
|
+
let r = this.events[e];
|
|
1815
|
+
r || (r = {
|
|
1816
|
+
highPriority: /* @__PURE__ */ new Map(),
|
|
1817
|
+
regular: /* @__PURE__ */ new Map()
|
|
1818
|
+
}, this.events[e] = r), n.isFirst ? r.highPriority.set(t, !0) : r.regular.set(t, !0);
|
|
1819
|
+
}
|
|
1820
|
+
removeListener(e, t) {
|
|
1821
|
+
this.events[e] && (this.events[e].regular.delete(t), this.events[e].highPriority.delete(t));
|
|
1822
|
+
}
|
|
1823
|
+
removeAllListeners() {
|
|
1824
|
+
this.events = {};
|
|
1825
|
+
}
|
|
1826
|
+
emit(e, ...t) {
|
|
1827
|
+
let n = this.events[e];
|
|
1828
|
+
if (!n) return;
|
|
1829
|
+
let r = Array.from(n.highPriority.keys()), i = Array.from(n.regular.keys());
|
|
1830
|
+
for (let e = r.length - 1; e >= 0; --e) {
|
|
1831
|
+
let i = r[e];
|
|
1832
|
+
n.highPriority.has(i) && i.apply(this, t);
|
|
1833
|
+
}
|
|
1834
|
+
for (let e = 0; e < i.length; e += 1) {
|
|
1835
|
+
let r = i[e];
|
|
1836
|
+
n.regular.has(r) && r.apply(this, t);
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
once(e, t) {
|
|
1840
|
+
let n = this;
|
|
1841
|
+
this.on(e, function r(...i) {
|
|
1842
|
+
n.removeListener(e, r), t.apply(n, i);
|
|
1843
|
+
});
|
|
1844
|
+
}
|
|
1845
|
+
}, ur = ({ isItemEditable: e, expansionTrigger: t }) => t || (e ? "iconContainer" : "content");
|
|
1846
|
+
function dr(e) {
|
|
1847
|
+
return {
|
|
1848
|
+
disabledItemsFocusable: e.disabledItemsFocusable ?? !1,
|
|
1849
|
+
itemChildrenIndentation: e.itemChildrenIndentation ?? "12px",
|
|
1850
|
+
providedTreeId: e.id,
|
|
1851
|
+
expansionTrigger: ur({
|
|
1852
|
+
isItemEditable: e.isItemEditable,
|
|
1853
|
+
expansionTrigger: e.expansionTrigger
|
|
1854
|
+
}),
|
|
1855
|
+
disableSelection: e.disableSelection ?? !1,
|
|
1856
|
+
multiSelect: e.multiSelect ?? !1,
|
|
1857
|
+
checkboxSelection: e.checkboxSelection ?? !1,
|
|
1858
|
+
selectionPropagation: e.selectionPropagation ?? Ft,
|
|
1859
|
+
itemHeight: e.itemHeight ?? null
|
|
1860
|
+
};
|
|
1861
|
+
}
|
|
1862
|
+
function fr(e, t, n) {
|
|
1863
|
+
return e === void 0 ? t === void 0 ? n : t : e;
|
|
1864
|
+
}
|
|
1865
|
+
function pr(e) {
|
|
1866
|
+
return Y({
|
|
1867
|
+
treeId: e.defaultId,
|
|
1868
|
+
focusedItemId: null
|
|
1869
|
+
}, dr(e), Cn.buildItemsStateIfNeeded(e), {
|
|
1870
|
+
expandedItems: fr(e.expandedItems, e.defaultExpandedItems, []),
|
|
1871
|
+
selectedItems: fr(e.selectedItems, e.defaultSelectedItems, e.multiSelect ? Pt : null)
|
|
1872
|
+
});
|
|
1873
|
+
}
|
|
1874
|
+
var mr = class {
|
|
1875
|
+
timeoutIds = /* @__PURE__ */ new Map();
|
|
1876
|
+
intervalIds = /* @__PURE__ */ new Map();
|
|
1877
|
+
startTimeout = (e, t, n) => {
|
|
1878
|
+
this.clearTimeout(e);
|
|
1879
|
+
let r = setTimeout(() => {
|
|
1880
|
+
this.timeoutIds.delete(e), n();
|
|
1881
|
+
}, t);
|
|
1882
|
+
this.timeoutIds.set(e, r);
|
|
1883
|
+
};
|
|
1884
|
+
startInterval = (e, t, n) => {
|
|
1885
|
+
this.clearInterval(e);
|
|
1886
|
+
let r = setInterval(n, t);
|
|
1887
|
+
this.intervalIds.set(e, r);
|
|
1888
|
+
};
|
|
1889
|
+
clearTimeout = (e) => {
|
|
1890
|
+
let t = this.timeoutIds.get(e);
|
|
1891
|
+
t != null && (clearTimeout(t), this.timeoutIds.delete(e));
|
|
1892
|
+
};
|
|
1893
|
+
clearInterval = (e) => {
|
|
1894
|
+
let t = this.intervalIds.get(e);
|
|
1895
|
+
t != null && (clearInterval(t), this.intervalIds.delete(e));
|
|
1896
|
+
};
|
|
1897
|
+
clearAll = () => {
|
|
1898
|
+
this.timeoutIds.forEach(clearTimeout), this.timeoutIds.clear(), this.intervalIds.forEach(clearInterval), this.intervalIds.clear();
|
|
1899
|
+
};
|
|
1900
|
+
}, hr = class {
|
|
1901
|
+
constructor(e) {
|
|
1902
|
+
this.store = e;
|
|
1903
|
+
}
|
|
1904
|
+
setExpandedItems = (e, t) => {
|
|
1905
|
+
this.store.parameters.expandedItems === void 0 && this.store.set("expandedItems", t), this.store.parameters.onExpandedItemsChange?.(e, t);
|
|
1906
|
+
};
|
|
1907
|
+
isItemExpanded = (e) => $.isItemExpanded(this.store.state, e);
|
|
1908
|
+
buildPublicAPI = () => ({
|
|
1909
|
+
isItemExpanded: this.isItemExpanded,
|
|
1910
|
+
setItemExpansion: this.setItemExpansion
|
|
1911
|
+
});
|
|
1912
|
+
setItemExpansion = ({ itemId: e, event: t = null, shouldBeExpanded: n }) => {
|
|
1913
|
+
let r = $.isItemExpanded(this.store.state, e), i = n ?? !r;
|
|
1914
|
+
if (r === i) return;
|
|
1915
|
+
let a = {
|
|
1916
|
+
isExpansionPrevented: !1,
|
|
1917
|
+
shouldBeExpanded: i,
|
|
1918
|
+
itemId: e
|
|
1919
|
+
};
|
|
1920
|
+
this.store.publishEvent("beforeItemToggleExpansion", a, t), !a.isExpansionPrevented && this.applyItemExpansion({
|
|
1921
|
+
itemId: e,
|
|
1922
|
+
event: t,
|
|
1923
|
+
shouldBeExpanded: i
|
|
1924
|
+
});
|
|
1925
|
+
};
|
|
1926
|
+
applyItemExpansion = ({ itemId: e, event: t, shouldBeExpanded: n }) => {
|
|
1927
|
+
let r = $.expandedItemsRaw(this.store.state), i;
|
|
1928
|
+
i = n ? [e].concat(r) : r.filter((t) => t !== e), this.store.parameters.onItemExpansionToggle?.(t, e, n), this.setExpandedItems(t, i);
|
|
1929
|
+
};
|
|
1930
|
+
expandAllSiblings = (e, t) => {
|
|
1931
|
+
let n = Z.itemMeta(this.store.state, t);
|
|
1932
|
+
if (n == null) return;
|
|
1933
|
+
let r = Z.itemOrderedChildrenIds(this.store.state, n.parentId).filter((e) => $.isItemExpandable(this.store.state, e) && !$.isItemExpanded(this.store.state, e)), i = $.expandedItemsRaw(this.store.state).concat(r);
|
|
1934
|
+
r.length > 0 && (this.store.parameters.onItemExpansionToggle && r.forEach((t) => {
|
|
1935
|
+
this.store.parameters.onItemExpansionToggle(e, t, !0);
|
|
1936
|
+
}), this.setExpandedItems(e, i));
|
|
1937
|
+
};
|
|
1938
|
+
addExpandableItems = (e) => {
|
|
1939
|
+
let t = Y({}, this.store.state.itemMetaLookup);
|
|
1940
|
+
for (let n of e) t[n] = Y({}, t[n], { expandable: !0 });
|
|
1941
|
+
this.store.set("itemMetaLookup", t);
|
|
1942
|
+
};
|
|
1943
|
+
}, gr = {
|
|
1944
|
+
isItemEditable: (e, t) => {
|
|
1945
|
+
let n = e.isItemEditable, r = Z.itemModel(e, t);
|
|
1946
|
+
return !r || n == null ? !1 : typeof n == "boolean" ? n : n(r);
|
|
1947
|
+
},
|
|
1948
|
+
isItemBeingEdited: (e, t) => t != null && e.editedItemId === t,
|
|
1949
|
+
isAnyItemBeingEdited: (e) => !!e.editedItemId
|
|
1950
|
+
}, _r = 500, vr = class {
|
|
1951
|
+
typeaheadQuery = "";
|
|
1952
|
+
constructor(e) {
|
|
1953
|
+
this.store = e, this.labelMap = br(Z.itemMetaLookup(this.store.state)), this.store.registerStoreEffect(Z.itemMetaLookup, (e, t) => {
|
|
1954
|
+
this.store.shouldIgnoreItemsStateUpdate() || (this.labelMap = br(t));
|
|
1955
|
+
});
|
|
1956
|
+
}
|
|
1957
|
+
canToggleItemSelection = (e) => Q.canItemBeSelected(this.store.state, e);
|
|
1958
|
+
canToggleItemExpansion = (e) => !Z.isItemDisabled(this.store.state, e) && $.isItemExpandable(this.store.state, e);
|
|
1959
|
+
getFirstItemMatchingTypeaheadQuery = (e, t) => {
|
|
1960
|
+
let n = (e) => {
|
|
1961
|
+
let t = Fn(this.store.state, e);
|
|
1962
|
+
return t === null ? Ln(this.store.state) : t;
|
|
1963
|
+
}, r = (t) => {
|
|
1964
|
+
let r = null, i = {}, a = t.length > 1 ? e : n(e);
|
|
1965
|
+
for (; r == null && !i[a];) this.labelMap[a]?.startsWith(t) ? r = a : (i[a] = !0, a = n(a));
|
|
1966
|
+
return r;
|
|
1967
|
+
}, i = t.toLowerCase(), a = `${this.typeaheadQuery}${i}`, o = r(a);
|
|
1968
|
+
if (o != null) return this.typeaheadQuery = a, o;
|
|
1969
|
+
let s = r(i);
|
|
1970
|
+
return s == null ? (this.typeaheadQuery = "", null) : (this.typeaheadQuery = i, s);
|
|
1971
|
+
};
|
|
1972
|
+
updateLabelMap = (e) => {
|
|
1973
|
+
this.labelMap = e(this.labelMap);
|
|
1974
|
+
};
|
|
1975
|
+
handleItemKeyDown = async (e, t) => {
|
|
1976
|
+
if (e.defaultMuiPrevented || e.altKey || Vn(e.target, e.currentTarget)) return;
|
|
1977
|
+
let n = e.ctrlKey || e.metaKey, r = e.key, i = Q.isMultiSelectEnabled(this.store.state);
|
|
1978
|
+
switch (!0) {
|
|
1979
|
+
case r === " " && this.canToggleItemSelection(t):
|
|
1980
|
+
e.preventDefault(), i && e.shiftKey ? this.store.selection.expandSelectionRange(e, t) : this.store.selection.setItemSelection({
|
|
1981
|
+
event: e,
|
|
1982
|
+
itemId: t,
|
|
1983
|
+
keepExistingSelection: i,
|
|
1984
|
+
shouldBeSelected: void 0
|
|
1985
|
+
});
|
|
1986
|
+
break;
|
|
1987
|
+
case r === "Enter":
|
|
1988
|
+
this.store.labelEditing?.setEditedItem && gr.isItemEditable(this.store.state, t) && !gr.isItemBeingEdited(this.store.state, t) ? this.store.labelEditing.setEditedItem(t) : this.canToggleItemExpansion(t) ? (this.store.expansion.setItemExpansion({
|
|
1989
|
+
event: e,
|
|
1990
|
+
itemId: t
|
|
1991
|
+
}), e.preventDefault()) : this.canToggleItemSelection(t) && (i ? (e.preventDefault(), this.store.selection.setItemSelection({
|
|
1992
|
+
event: e,
|
|
1993
|
+
itemId: t,
|
|
1994
|
+
keepExistingSelection: !0
|
|
1995
|
+
})) : Q.isItemSelected(this.store.state, t) || (this.store.selection.setItemSelection({
|
|
1996
|
+
event: e,
|
|
1997
|
+
itemId: t
|
|
1998
|
+
}), e.preventDefault()));
|
|
1999
|
+
break;
|
|
2000
|
+
case r === "ArrowDown": {
|
|
2001
|
+
let n = Fn(this.store.state, t);
|
|
2002
|
+
n && (e.preventDefault(), this.store.focus.focusItem(e, n), i && e.shiftKey && this.canToggleItemSelection(n) && this.store.selection.selectItemFromArrowNavigation(e, t, n));
|
|
2003
|
+
break;
|
|
2004
|
+
}
|
|
2005
|
+
case r === "ArrowUp": {
|
|
2006
|
+
let n = Pn(this.store.state, t);
|
|
2007
|
+
n && (e.preventDefault(), this.store.focus.focusItem(e, n), i && e.shiftKey && this.canToggleItemSelection(n) && this.store.selection.selectItemFromArrowNavigation(e, t, n));
|
|
2008
|
+
break;
|
|
2009
|
+
}
|
|
2010
|
+
case r === "ArrowRight" && !this.store.parameters.isRtl || r === "ArrowLeft" && this.store.parameters.isRtl:
|
|
2011
|
+
if (n) return;
|
|
2012
|
+
if ($.isItemExpanded(this.store.state, t)) {
|
|
2013
|
+
let n = Fn(this.store.state, t);
|
|
2014
|
+
n && (this.store.focus.focusItem(e, n), e.preventDefault());
|
|
2015
|
+
} else this.canToggleItemExpansion(t) && (this.store.expansion.setItemExpansion({
|
|
2016
|
+
event: e,
|
|
2017
|
+
itemId: t
|
|
2018
|
+
}), e.preventDefault());
|
|
2019
|
+
break;
|
|
2020
|
+
case r === "ArrowLeft" && !this.store.parameters.isRtl || r === "ArrowRight" && this.store.parameters.isRtl:
|
|
2021
|
+
if (n) return;
|
|
2022
|
+
if (this.canToggleItemExpansion(t) && $.isItemExpanded(this.store.state, t)) this.store.expansion.setItemExpansion({
|
|
2023
|
+
event: e,
|
|
2024
|
+
itemId: t
|
|
2025
|
+
}), e.preventDefault();
|
|
2026
|
+
else {
|
|
2027
|
+
let n = Z.itemParentId(this.store.state, t);
|
|
2028
|
+
n && (this.store.focus.focusItem(e, n), e.preventDefault());
|
|
2029
|
+
}
|
|
2030
|
+
break;
|
|
2031
|
+
case r === "Home":
|
|
2032
|
+
this.canToggleItemSelection(t) && i && n && e.shiftKey ? this.store.selection.selectRangeFromStartToItem(e, t) : this.store.focus.focusItem(e, Ln(this.store.state)), e.preventDefault();
|
|
2033
|
+
break;
|
|
2034
|
+
case r === "End":
|
|
2035
|
+
this.canToggleItemSelection(t) && i && n && e.shiftKey ? this.store.selection.selectRangeFromItemToEnd(e, t) : this.store.focus.focusItem(e, In(this.store.state)), e.preventDefault();
|
|
2036
|
+
break;
|
|
2037
|
+
case r === "*":
|
|
2038
|
+
this.store.expansion.expandAllSiblings(e, t), e.preventDefault();
|
|
2039
|
+
break;
|
|
2040
|
+
case String.fromCharCode(e.keyCode) === "A" && n && i && Q.enabled(this.store.state):
|
|
2041
|
+
this.store.selection.selectAllNavigableItems(e), e.preventDefault();
|
|
2042
|
+
break;
|
|
2043
|
+
case !n && !e.shiftKey && yr(r): {
|
|
2044
|
+
this.store.timeoutManager.clearTimeout("typeahead");
|
|
2045
|
+
let n = this.getFirstItemMatchingTypeaheadQuery(t, r);
|
|
2046
|
+
n == null ? this.typeaheadQuery = "" : (this.store.focus.focusItem(e, n), e.preventDefault()), this.store.timeoutManager.startTimeout("typeahead", _r, () => {
|
|
2047
|
+
this.typeaheadQuery = "";
|
|
2048
|
+
});
|
|
2049
|
+
break;
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
};
|
|
2053
|
+
};
|
|
2054
|
+
function yr(e) {
|
|
2055
|
+
return !!e && e.length === 1 && !!e.match(/\S/);
|
|
2056
|
+
}
|
|
2057
|
+
function br(e) {
|
|
2058
|
+
let t = {};
|
|
2059
|
+
return Object.values(e).forEach((e) => {
|
|
2060
|
+
t[e.id] = e.label.toLowerCase();
|
|
2061
|
+
}), t;
|
|
2062
|
+
}
|
|
2063
|
+
var xr = Zt(Q.selectedItems, $.expandedItemsMap, Z.itemMetaLookup, Z.disabledItemFocusable, (e) => Z.itemOrderedChildrenIds(e, null), (e, t, n, r, i) => e.find((e) => {
|
|
2064
|
+
if (!r && vn(n, e)) return !1;
|
|
2065
|
+
let i = n[e];
|
|
2066
|
+
return i && (i.parentId == null || t.has(i.parentId));
|
|
2067
|
+
}) ?? i.find((e) => r || !vn(n, e)) ?? null), Sr = {
|
|
2068
|
+
defaultFocusableItemId: xr,
|
|
2069
|
+
isItemTheDefaultFocusableItem: (e, t) => xr(e) === t,
|
|
2070
|
+
focusedItemId: (e) => e.focusedItemId,
|
|
2071
|
+
isItemFocused: (e, t) => e.focusedItemId === t
|
|
2072
|
+
}, Cr = class {
|
|
2073
|
+
constructor(e) {
|
|
2074
|
+
this.store = e;
|
|
2075
|
+
let t = e.state;
|
|
2076
|
+
this.store.disposables.defer(this.store.subscribe((e) => {
|
|
2077
|
+
if (e.itemMetaLookup === t.itemMetaLookup) {
|
|
2078
|
+
t = e;
|
|
2079
|
+
return;
|
|
2080
|
+
}
|
|
2081
|
+
let n = Sr.focusedItemId(e);
|
|
2082
|
+
if (n == null || Z.itemMeta(e, n)) {
|
|
2083
|
+
t = e;
|
|
2084
|
+
return;
|
|
2085
|
+
}
|
|
2086
|
+
let r = (t) => t == null || !Z.itemMeta(e, t) ? null : t, i = r(Fn(t, n)) ?? r(Pn(t, n)) ?? Ln(e);
|
|
2087
|
+
i == null ? this.setFocusedItemId(null) : this.applyItemFocus(null, i), t = e;
|
|
2088
|
+
}));
|
|
2089
|
+
}
|
|
2090
|
+
setFocusedItemId = (e) => {
|
|
2091
|
+
Sr.focusedItemId(this.store.state) !== e && this.store.set("focusedItemId", e);
|
|
2092
|
+
};
|
|
2093
|
+
applyItemFocus = (e, t) => {
|
|
2094
|
+
this.store.items.getItemDOMElement(t)?.focus(), this.setFocusedItemId(t), this.store.parameters.onItemFocus?.(e, t);
|
|
2095
|
+
};
|
|
2096
|
+
buildPublicAPI = () => ({ focusItem: this.focusItem });
|
|
2097
|
+
focusItem = (e, t) => {
|
|
2098
|
+
let n = Z.itemMeta(this.store.state, t);
|
|
2099
|
+
n && (n.parentId == null || $.isItemExpanded(this.store.state, n.parentId)) && this.applyItemFocus(e, t);
|
|
2100
|
+
};
|
|
2101
|
+
removeFocusedItem = () => {
|
|
2102
|
+
let e = Sr.focusedItemId(this.store.state);
|
|
2103
|
+
if (e != null) {
|
|
2104
|
+
if (Z.itemMeta(this.store.state, e)) {
|
|
2105
|
+
let t = this.store.items.getItemDOMElement(e);
|
|
2106
|
+
t && t.blur();
|
|
2107
|
+
}
|
|
2108
|
+
this.setFocusedItemId(null);
|
|
2109
|
+
}
|
|
2110
|
+
};
|
|
2111
|
+
handleRootFocus = (e) => {
|
|
2112
|
+
if (e.defaultMuiPrevented) return;
|
|
2113
|
+
let t = Sr.defaultFocusableItemId(this.store.state);
|
|
2114
|
+
e.target === e.currentTarget && t != null && this.applyItemFocus(e, t);
|
|
2115
|
+
};
|
|
2116
|
+
handleRootBlur = (e) => {
|
|
2117
|
+
e.defaultMuiPrevented || this.setFocusedItemId(null);
|
|
2118
|
+
};
|
|
2119
|
+
}, wr = class {
|
|
2120
|
+
itemPlugins = [];
|
|
2121
|
+
itemWrappers = [];
|
|
2122
|
+
register = (e, t) => {
|
|
2123
|
+
this.itemPlugins.push(e), t && this.itemWrappers.push(t);
|
|
2124
|
+
};
|
|
2125
|
+
listPlugins = () => this.itemPlugins;
|
|
2126
|
+
listWrappers = () => this.itemWrappers;
|
|
2127
|
+
}, Tr = class extends dn {
|
|
2128
|
+
initialParameters = null;
|
|
2129
|
+
disposables = new nr();
|
|
2130
|
+
eventManager = this.disposables.adopt(new lr(), (e) => e.removeAllListeners());
|
|
2131
|
+
timeoutManager = this.disposables.adopt(new mr(), (e) => e.clearAll());
|
|
2132
|
+
itemPluginManager = new wr();
|
|
2133
|
+
constructor(e, t, n) {
|
|
2134
|
+
let r = pr(e), i = n.getInitialState(r, e);
|
|
2135
|
+
super(i), this.parameters = e, this.instanceName = t, this.mapper = n, this.items = new Cn(this), this.focus = new Cr(this), this.expansion = new hr(this), this.selection = new Hn(this), this.keyboardNavigation = new vr(this);
|
|
2136
|
+
}
|
|
2137
|
+
buildPublicAPI() {
|
|
2138
|
+
return Y({}, this.items.buildPublicAPI(), this.focus.buildPublicAPI(), this.expansion.buildPublicAPI(), this.selection.buildPublicAPI());
|
|
2139
|
+
}
|
|
2140
|
+
updateStateFromParameters(e) {
|
|
2141
|
+
let t = (t, n, r) => {
|
|
2142
|
+
e[n] !== void 0 && (t[n] = e[n]);
|
|
2143
|
+
}, n = dr(e);
|
|
2144
|
+
t(n, "expandedItems", "defaultExpandedItems"), t(n, "selectedItems", "defaultSelectedItems"), this.state.treeId !== e.defaultId && (n.treeId = e.defaultId), !this.mapper.shouldIgnoreItemsStateUpdate(e) && Cn.shouldRebuildItemsState(e, this.parameters) && Object.assign(n, Cn.buildItemsStateIfNeeded(e));
|
|
2145
|
+
let r = this.mapper.updateStateFromParameters(n, e, t);
|
|
2146
|
+
this.update(r), this.parameters = e;
|
|
2147
|
+
}
|
|
2148
|
+
mountEffect = () => {};
|
|
2149
|
+
[Zn]() {
|
|
2150
|
+
if (!this.disposables.disposed) try {
|
|
2151
|
+
this.disposables.dispose();
|
|
2152
|
+
} catch {}
|
|
2153
|
+
}
|
|
2154
|
+
shouldIgnoreItemsStateUpdate = () => this.mapper.shouldIgnoreItemsStateUpdate(this.parameters);
|
|
2155
|
+
registerStoreEffect = (e, t) => {
|
|
2156
|
+
let n = e(this.state);
|
|
2157
|
+
this.disposables.defer(this.subscribe((r) => {
|
|
2158
|
+
let i = e(r);
|
|
2159
|
+
i !== n && (t(n, i), n = i);
|
|
2160
|
+
}));
|
|
2161
|
+
};
|
|
2162
|
+
publishEvent = (e, t, n) => {
|
|
2163
|
+
Er(n) && n.isPropagationStopped() || this.eventManager.emit(e, t, n);
|
|
2164
|
+
};
|
|
2165
|
+
subscribeEvent = (e, t) => {
|
|
2166
|
+
this.eventManager.on(e, t);
|
|
2167
|
+
};
|
|
2168
|
+
};
|
|
2169
|
+
function Er(e) {
|
|
2170
|
+
return e?.isPropagationStopped !== void 0;
|
|
2171
|
+
}
|
|
2172
|
+
var Dr = {
|
|
2173
|
+
isEmpty: (e) => e.lazyLoadedItems == null || Object.keys(e.lazyLoadedItems.loading).length === 0 && Object.keys(e.lazyLoadedItems.errors).length === 0,
|
|
2174
|
+
isItemLoading: (e, t) => e.lazyLoadedItems?.loading[t ?? "__TREE_VIEW_ROOT_PARENT_ID__"] != null,
|
|
2175
|
+
itemLoadingChildrenCount: (e, t) => e.lazyLoadedItems?.loading[t ?? "__TREE_VIEW_ROOT_PARENT_ID__"] ?? -1,
|
|
2176
|
+
itemHasError: (e, t) => !!e.lazyLoadedItems?.errors[t ?? "__TREE_VIEW_ROOT_PARENT_ID__"],
|
|
2177
|
+
itemError: (e, t) => e.lazyLoadedItems?.errors[t ?? "__TREE_VIEW_ROOT_PARENT_ID__"]
|
|
2178
|
+
}, Or = (e) => Array.isArray(e) ? e.length > 0 && e.some(Or) : !!e, kr = ({ itemId: e, children: t }) => {
|
|
2179
|
+
let { store: n, publicAPI: r } = Bt(), i = X(n, $.isItemExpandable, e), a = X(n, Dr.isItemLoading, e), o = X(n, Dr.itemHasError, e), s = Or(t) || i, c = X(n, $.isItemExpanded, e), l = X(n, Sr.isItemFocused, e), u = X(n, Q.isItemSelected, e), d = X(n, Q.isItemIndeterminate, e), f = X(n, Z.isItemDisabled, e), p = X(n, gr.isItemBeingEdited, e), m = {
|
|
2180
|
+
expandable: s,
|
|
2181
|
+
expanded: c,
|
|
2182
|
+
focused: l,
|
|
2183
|
+
selected: u,
|
|
2184
|
+
indeterminate: d,
|
|
2185
|
+
disabled: f,
|
|
2186
|
+
editing: p,
|
|
2187
|
+
editable: X(n, gr.isItemEditable, e),
|
|
2188
|
+
loading: a,
|
|
2189
|
+
error: o
|
|
2190
|
+
}, h = (t) => {
|
|
2191
|
+
if (m.disabled) return;
|
|
2192
|
+
m.focused || n.focus.focusItem(t, e);
|
|
2193
|
+
let r = Q.isMultiSelectEnabled(n.state) && (t.shiftKey || t.ctrlKey || t.metaKey);
|
|
2194
|
+
m.expandable && !(r && $.isItemExpanded(n.state, e)) && n.expansion.setItemExpansion({
|
|
2195
|
+
event: t,
|
|
2196
|
+
itemId: e
|
|
2197
|
+
});
|
|
2198
|
+
}, g = (t) => {
|
|
2199
|
+
Q.canItemBeSelected(n.state, e) && (!m.focused && !m.editing && n.focus.focusItem(t, e), Q.isMultiSelectEnabled(n.state) && (t.shiftKey || t.ctrlKey || t.metaKey) ? t.shiftKey ? n.selection.expandSelectionRange(t, e) : n.selection.setItemSelection({
|
|
2200
|
+
event: t,
|
|
2201
|
+
itemId: e,
|
|
2202
|
+
keepExistingSelection: !0
|
|
2203
|
+
}) : n.selection.setItemSelection({
|
|
2204
|
+
event: t,
|
|
2205
|
+
itemId: e,
|
|
2206
|
+
shouldBeSelected: !0
|
|
2207
|
+
}));
|
|
2208
|
+
}, _ = (t) => {
|
|
2209
|
+
let r = t.nativeEvent.shiftKey, i = Q.isMultiSelectEnabled(n.state);
|
|
2210
|
+
i && r ? n.selection.expandSelectionRange(t, e) : n.selection.setItemSelection({
|
|
2211
|
+
event: t,
|
|
2212
|
+
itemId: e,
|
|
2213
|
+
keepExistingSelection: i,
|
|
2214
|
+
shouldBeSelected: t.target.checked
|
|
2215
|
+
});
|
|
2216
|
+
}, v = () => {
|
|
2217
|
+
n.labelEditing && (p ? n.labelEditing.setEditedItem(null) : n.labelEditing.setEditedItem(e));
|
|
2218
|
+
};
|
|
2219
|
+
return {
|
|
2220
|
+
interactions: {
|
|
2221
|
+
handleExpansion: h,
|
|
2222
|
+
handleSelection: g,
|
|
2223
|
+
handleCheckboxSelection: _,
|
|
2224
|
+
toggleItemEditing: v,
|
|
2225
|
+
handleSaveItemLabel: (t, r) => {
|
|
2226
|
+
n.labelEditing && gr.isItemBeingEdited(n.state, e) && (n.labelEditing.updateItemLabel(e, r), v(), n.focus.focusItem(t, e));
|
|
2227
|
+
},
|
|
2228
|
+
handleCancelItemLabelEditing: (t) => {
|
|
2229
|
+
n.labelEditing && gr.isItemBeingEdited(n.state, e) && (v(), n.focus.focusItem(t, e));
|
|
2230
|
+
}
|
|
2231
|
+
},
|
|
2232
|
+
status: m,
|
|
2233
|
+
publicAPI: r
|
|
2234
|
+
};
|
|
2235
|
+
}, Ar = ({ props: e, rootRef: t, contentRef: n }) => {
|
|
2236
|
+
let { store: r } = Bt(), { children: i, disabled: a = !1, disableSelection: o = !1, label: s, itemId: c, id: l } = e, u = K.useContext(Jn);
|
|
2237
|
+
if (u == null) throw Error(Rt(196));
|
|
2238
|
+
let { registerChild: d, unregisterChild: f, parentId: p } = u, m = Or(i), h = K.useRef(null), g = Ot(h, n), _ = X(r, gn.treeItemIdAttribute, c, l), v = K.useRef(!0), y = Dt(Symbol);
|
|
2239
|
+
return pn(() => (d(_, c), () => {
|
|
2240
|
+
f(_), f(_);
|
|
2241
|
+
}), [
|
|
2242
|
+
r,
|
|
2243
|
+
d,
|
|
2244
|
+
f,
|
|
2245
|
+
_,
|
|
2246
|
+
c
|
|
2247
|
+
]), pn(() => (v.current = !0, () => {
|
|
2248
|
+
v.current = !1;
|
|
2249
|
+
}), []), pn(() => {
|
|
2250
|
+
let e = r.jsxItems.upsertJSXItem({
|
|
2251
|
+
id: c,
|
|
2252
|
+
idAttribute: l,
|
|
2253
|
+
parentId: p,
|
|
2254
|
+
expandable: m,
|
|
2255
|
+
disabled: a,
|
|
2256
|
+
selectable: !o
|
|
2257
|
+
}, y.current);
|
|
2258
|
+
return () => {
|
|
2259
|
+
v.current || e();
|
|
2260
|
+
};
|
|
2261
|
+
}, [
|
|
2262
|
+
r,
|
|
2263
|
+
p,
|
|
2264
|
+
c,
|
|
2265
|
+
m,
|
|
2266
|
+
a,
|
|
2267
|
+
o,
|
|
2268
|
+
l,
|
|
2269
|
+
y
|
|
2270
|
+
]), K.useEffect(() => {
|
|
2271
|
+
if (s) return r.jsxItems.mapLabelFromJSX(c, (h.current?.textContent ?? "").toLowerCase());
|
|
2272
|
+
}, [
|
|
2273
|
+
r,
|
|
2274
|
+
c,
|
|
2275
|
+
s
|
|
2276
|
+
]), {
|
|
2277
|
+
contentRef: g,
|
|
2278
|
+
rootRef: t
|
|
2279
|
+
};
|
|
2280
|
+
}, jr = ({ children: e, itemId: t, idAttribute: n }) => {
|
|
2281
|
+
let r = K.useContext(Xn);
|
|
2282
|
+
return /*#__PURE__*/ (0, q.jsx)(Yn, {
|
|
2283
|
+
itemId: t,
|
|
2284
|
+
idAttribute: n,
|
|
2285
|
+
children: /*#__PURE__*/ (0, q.jsx)(Xn.Provider, {
|
|
2286
|
+
value: r + 1,
|
|
2287
|
+
children: e
|
|
2288
|
+
})
|
|
2289
|
+
});
|
|
2290
|
+
}, Mr = class {
|
|
2291
|
+
itemOwners = /* @__PURE__ */ new Map();
|
|
2292
|
+
constructor(e) {
|
|
2293
|
+
this.store = e, e.itemPluginManager.register(Ar, jr);
|
|
2294
|
+
}
|
|
2295
|
+
upsertJSXItem = (e, t) => {
|
|
2296
|
+
let n = this.itemOwners.get(e.id);
|
|
2297
|
+
if (n != null && n !== t) throw Error(Rt(195, e.id));
|
|
2298
|
+
this.itemOwners.set(e.id, t);
|
|
2299
|
+
let r = Z.itemMeta(this.store.state, e.id);
|
|
2300
|
+
if (r != null) {
|
|
2301
|
+
let t = !1;
|
|
2302
|
+
for (let n of Object.keys(e)) if (r[n] !== e[n]) {
|
|
2303
|
+
t = !0;
|
|
2304
|
+
break;
|
|
2305
|
+
}
|
|
2306
|
+
t && this.store.update({ itemMetaLookup: Y({}, this.store.state.itemMetaLookup, { [e.id]: Y({}, r, e) }) });
|
|
2307
|
+
} else this.store.update({
|
|
2308
|
+
itemMetaLookup: Y({}, this.store.state.itemMetaLookup, { [e.id]: e }),
|
|
2309
|
+
itemModelLookup: Y({}, this.store.state.itemModelLookup, { [e.id]: {
|
|
2310
|
+
id: e.id,
|
|
2311
|
+
label: e.label ?? ""
|
|
2312
|
+
} })
|
|
2313
|
+
});
|
|
2314
|
+
return () => {
|
|
2315
|
+
this.itemOwners.delete(e.id);
|
|
2316
|
+
let t = Y({}, this.store.state.itemMetaLookup), n = Y({}, this.store.state.itemModelLookup);
|
|
2317
|
+
delete t[e.id], delete n[e.id], this.store.update({
|
|
2318
|
+
itemMetaLookup: t,
|
|
2319
|
+
itemModelLookup: n
|
|
2320
|
+
});
|
|
2321
|
+
};
|
|
2322
|
+
};
|
|
2323
|
+
mapLabelFromJSX = (e, t) => (this.store.keyboardNavigation.updateLabelMap((n) => (n[e] = t, n)), () => {
|
|
2324
|
+
this.store.keyboardNavigation.updateLabelMap((t) => {
|
|
2325
|
+
let n = Y({}, t);
|
|
2326
|
+
return delete n[e], n;
|
|
2327
|
+
});
|
|
2328
|
+
});
|
|
2329
|
+
setJSXItemsOrderedChildrenIds = (e, t) => {
|
|
2330
|
+
let n = e ?? "__TREE_VIEW_ROOT_PARENT_ID__";
|
|
2331
|
+
this.store.update({
|
|
2332
|
+
itemOrderedChildrenIdsLookup: Y({}, this.store.state.itemOrderedChildrenIdsLookup, { [n]: t }),
|
|
2333
|
+
itemChildrenIndexesLookup: Y({}, this.store.state.itemChildrenIndexesLookup, { [n]: _n(t) })
|
|
2334
|
+
}), e !== null && Q.isMultiSelectEnabled(this.store.state) && Q.propagationRules(this.store.state).descendants && Q.isItemSelected(this.store.state, e) && this.store.selection.setItemSelection({
|
|
2335
|
+
itemId: e,
|
|
2336
|
+
shouldBeSelected: !0,
|
|
2337
|
+
keepExistingSelection: !0
|
|
2338
|
+
});
|
|
2339
|
+
};
|
|
2340
|
+
}, Nr = {
|
|
2341
|
+
getInitialState: (e) => e,
|
|
2342
|
+
updateStateFromParameters: (e) => e,
|
|
2343
|
+
shouldIgnoreItemsStateUpdate: () => !0
|
|
2344
|
+
}, Pr = class extends Tr {
|
|
2345
|
+
jsxItems = new Mr(this);
|
|
2346
|
+
constructor(e) {
|
|
2347
|
+
super(Y({}, e, { items: Pt }), "SimpleTreeView", Nr);
|
|
2348
|
+
}
|
|
2349
|
+
updateStateFromParameters(e) {
|
|
2350
|
+
super.updateStateFromParameters(Y({}, e, { items: Pt }));
|
|
2351
|
+
}
|
|
2352
|
+
}, Fr = Mt("MuiSimpleTreeView"), Ir = (e) => {
|
|
2353
|
+
let { classes: t } = e;
|
|
2354
|
+
return K.useMemo(() => Ae({
|
|
2355
|
+
root: ["root"],
|
|
2356
|
+
item: ["item"],
|
|
2357
|
+
itemContent: ["itemContent"],
|
|
2358
|
+
itemGroupTransition: ["itemGroupTransition"],
|
|
2359
|
+
itemIconContainer: ["itemIconContainer"],
|
|
2360
|
+
itemLabel: ["itemLabel"],
|
|
2361
|
+
itemCheckbox: ["itemCheckbox"]
|
|
2362
|
+
}, Nt, t), [t]);
|
|
2363
|
+
}, Lr = H("ul", {
|
|
2364
|
+
name: "MuiSimpleTreeView",
|
|
2365
|
+
slot: "Root"
|
|
2366
|
+
})({
|
|
2367
|
+
padding: 0,
|
|
2368
|
+
margin: 0,
|
|
2369
|
+
listStyle: "none",
|
|
2370
|
+
outline: 0,
|
|
2371
|
+
position: "relative"
|
|
2372
|
+
}), Rr = /*#__PURE__*/ K.forwardRef(function(e, t) {
|
|
2373
|
+
let n = Fr({
|
|
2374
|
+
props: e,
|
|
2375
|
+
name: "MuiSimpleTreeView"
|
|
2376
|
+
}), { slots: r, slotProps: i, apiRef: a, parameters: o, forwardedProps: s } = Jt(n), c = cr(Pr, o), l = K.useRef(null), u = Kn(c, s, Ot(t, l)), d = Ir(n), f = r?.root ?? Lr, p = W({
|
|
2377
|
+
elementType: f,
|
|
2378
|
+
externalSlotProps: i?.root,
|
|
2379
|
+
className: d.root,
|
|
2380
|
+
getSlotProps: u,
|
|
2381
|
+
ownerState: n
|
|
2382
|
+
});
|
|
2383
|
+
return /*#__PURE__*/ (0, q.jsx)(Gt, {
|
|
2384
|
+
store: c,
|
|
2385
|
+
classes: d,
|
|
2386
|
+
slots: r,
|
|
2387
|
+
slotProps: i,
|
|
2388
|
+
apiRef: a,
|
|
2389
|
+
rootRef: l,
|
|
2390
|
+
children: /*#__PURE__*/ (0, q.jsx)(Yn, {
|
|
2391
|
+
itemId: null,
|
|
2392
|
+
idAttribute: null,
|
|
2393
|
+
children: /*#__PURE__*/ (0, q.jsx)(Xn.Provider, {
|
|
2394
|
+
value: 0,
|
|
2395
|
+
children: /*#__PURE__*/ (0, q.jsx)(f, Y({}, p))
|
|
2396
|
+
})
|
|
2397
|
+
})
|
|
2398
|
+
});
|
|
2399
|
+
}), zr = (e, t, n) => typeof n == "function" ? n(e, t) : n, Br = (e) => {
|
|
2400
|
+
let { runItemPlugins: t, publicAPI: n, store: r } = Bt(), i = K.useContext(Xn), a = X(r, zr, e.itemId, i), { id: o, itemId: s, label: c, children: l, rootRef: u } = e, { rootRef: d, contentRef: f, propsEnhancers: p } = t(e), { interactions: m, status: h } = kr({
|
|
2401
|
+
itemId: s,
|
|
2402
|
+
children: l
|
|
2403
|
+
}), g = K.useRef(null), _ = K.useRef(null), v = Ot(u, d, g), y = Ot(f, _), b = K.useRef(null), x = X(r, Q.isCheckboxSelectionEnabled), S = X(r, gn.treeItemIdAttribute, s, o), C = X(r, Sr.isItemTheDefaultFocusableItem, s), w = X(r, Z.itemHeight), T = {
|
|
2404
|
+
rootRefObject: g,
|
|
2405
|
+
contentRefObject: _,
|
|
2406
|
+
interactions: m
|
|
2407
|
+
}, E = (e) => (t) => {
|
|
2408
|
+
e.onFocus?.(t), !t.defaultMuiPrevented && !h.focused && Z.canItemBeFocused(r.state, s) && t.currentTarget === t.target && r.focus.focusItem(t, s);
|
|
2409
|
+
}, D = (e) => (t) => {
|
|
2410
|
+
if (e.onBlur?.(t), t.defaultMuiPrevented) return;
|
|
2411
|
+
let n = r.items.getItemDOMElement(s);
|
|
2412
|
+
h.editing || t.relatedTarget && Vn(t.relatedTarget, n) && (t.target && t.target?.dataset?.element === "labelInput" && Vn(t.target, n) || t.relatedTarget?.dataset?.element === "labelInput") || r.focus.removeFocusedItem();
|
|
2413
|
+
}, O = (e) => (t) => {
|
|
2414
|
+
e.onKeyDown?.(t), !(t.defaultMuiPrevented || t.target?.dataset?.element === "labelInput") && r.keyboardNavigation.handleItemKeyDown(t, s);
|
|
2415
|
+
}, k = (e) => (t) => {
|
|
2416
|
+
e.onDoubleClick?.(t), !t.defaultMuiPrevented && m.toggleItemEditing();
|
|
2417
|
+
}, A = (e) => (t) => {
|
|
2418
|
+
e.onClick?.(t), r.items.handleItemClick(t, s), !(t.defaultMuiPrevented || b.current?.contains(t.target)) && ($.triggerSlot(r.state) === "content" && m.handleExpansion(t), x || m.handleSelection(t));
|
|
2419
|
+
}, j = (e) => (t) => {
|
|
2420
|
+
e.onMouseDown?.(t), !t.defaultMuiPrevented && (t.shiftKey || t.ctrlKey || t.metaKey || h.disabled) && t.preventDefault();
|
|
2421
|
+
}, M = (e) => (t) => {
|
|
2422
|
+
e.onClick?.(t), !t.defaultMuiPrevented && $.triggerSlot(r.state) === "iconContainer" && m.handleExpansion(t);
|
|
2423
|
+
};
|
|
2424
|
+
return {
|
|
2425
|
+
getContextProviderProps: () => ({
|
|
2426
|
+
itemId: s,
|
|
2427
|
+
id: o
|
|
2428
|
+
}),
|
|
2429
|
+
getRootProps: (t = {}) => {
|
|
2430
|
+
let n = Y({}, U(e), U(t));
|
|
2431
|
+
return Y({}, Y({}, n, {
|
|
2432
|
+
ref: v,
|
|
2433
|
+
role: "treeitem",
|
|
2434
|
+
tabIndex: C ? 0 : -1,
|
|
2435
|
+
id: S,
|
|
2436
|
+
"aria-expanded": h.expandable ? h.expanded : void 0,
|
|
2437
|
+
"aria-disabled": h.disabled || void 0
|
|
2438
|
+
}, t, {
|
|
2439
|
+
style: Y({}, t.style ?? {}, { "--TreeView-itemDepth": a }, w == null ? {} : { "--TreeView-itemHeight": `${w}px` }),
|
|
2440
|
+
onFocus: E(n),
|
|
2441
|
+
onBlur: D(n),
|
|
2442
|
+
onKeyDown: O(n)
|
|
2443
|
+
}), p.root?.(Y({}, T, { externalEventHandlers: n })) ?? {});
|
|
2444
|
+
},
|
|
2445
|
+
getContentProps: (e = {}) => {
|
|
2446
|
+
let t = U(e), n = Y({}, t, e, {
|
|
2447
|
+
ref: y,
|
|
2448
|
+
onClick: A(t),
|
|
2449
|
+
onMouseDown: j(t)
|
|
2450
|
+
});
|
|
2451
|
+
return [
|
|
2452
|
+
"expanded",
|
|
2453
|
+
"selected",
|
|
2454
|
+
"focused",
|
|
2455
|
+
"disabled",
|
|
2456
|
+
"editing",
|
|
2457
|
+
"editable"
|
|
2458
|
+
].forEach((e) => {
|
|
2459
|
+
h[e] && (n[`data-${e}`] = "");
|
|
2460
|
+
}), Y({}, n, p.content?.(Y({}, T, { externalEventHandlers: t })) ?? {});
|
|
2461
|
+
},
|
|
2462
|
+
getGroupTransitionProps: (e = {}) => Y({}, U(e), {
|
|
2463
|
+
unmountOnExit: !0,
|
|
2464
|
+
component: "ul",
|
|
2465
|
+
role: "group",
|
|
2466
|
+
in: h.expanded || h.loading,
|
|
2467
|
+
children: l
|
|
2468
|
+
}, e),
|
|
2469
|
+
getIconContainerProps: (e = {}) => {
|
|
2470
|
+
let t = U(e);
|
|
2471
|
+
return Y({}, t, e, { onClick: M(t) });
|
|
2472
|
+
},
|
|
2473
|
+
getCheckboxProps: (e = {}) => {
|
|
2474
|
+
let t = U(e);
|
|
2475
|
+
return Y({}, Y({}, t, {
|
|
2476
|
+
ref: b,
|
|
2477
|
+
"aria-hidden": !0
|
|
2478
|
+
}, e), p.checkbox?.(Y({}, T, { externalEventHandlers: t })) ?? {});
|
|
2479
|
+
},
|
|
2480
|
+
getLabelProps: (e = {}) => {
|
|
2481
|
+
let t = Y({}, U(e)), n = Y({}, t, { children: c }, e, { onDoubleClick: k(t) });
|
|
2482
|
+
return Y({}, p.label?.(Y({}, T, { externalEventHandlers: t })) ?? {}, n);
|
|
2483
|
+
},
|
|
2484
|
+
getLabelInputProps: (e = {}) => {
|
|
2485
|
+
let t = U(e);
|
|
2486
|
+
return Y({}, e, p.labelInput?.(Y({}, T, { externalEventHandlers: t })) ?? {});
|
|
2487
|
+
},
|
|
2488
|
+
getDragAndDropOverlayProps: (e = {}) => {
|
|
2489
|
+
let t = U(e);
|
|
2490
|
+
return Y({}, e, p.dragAndDropOverlay?.(Y({}, T, { externalEventHandlers: t })) ?? {});
|
|
2491
|
+
},
|
|
2492
|
+
getErrorContainerProps: (e = {}) => Y({}, U(e), e),
|
|
2493
|
+
getLoadingContainerProps: (e = {}) => Y({
|
|
2494
|
+
size: "12px",
|
|
2495
|
+
thickness: 6
|
|
2496
|
+
}, U(e), e),
|
|
2497
|
+
rootRef: v,
|
|
2498
|
+
status: h,
|
|
2499
|
+
publicAPI: n
|
|
2500
|
+
};
|
|
2501
|
+
};
|
|
2502
|
+
function Vr(e) {
|
|
2503
|
+
return Ne("MuiTreeItem", e);
|
|
2504
|
+
}
|
|
2505
|
+
we("MuiTreeItem", [
|
|
2506
|
+
"root",
|
|
2507
|
+
"content",
|
|
2508
|
+
"groupTransition",
|
|
2509
|
+
"iconContainer",
|
|
2510
|
+
"label",
|
|
2511
|
+
"checkbox",
|
|
2512
|
+
"labelInput",
|
|
2513
|
+
"dragAndDropOverlay",
|
|
2514
|
+
"errorIcon",
|
|
2515
|
+
"loadingIcon"
|
|
2516
|
+
]);
|
|
2517
|
+
var Hr = et(/*#__PURE__*/ (0, q.jsx)("path", { d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" }), "TreeViewExpandIcon"), Ur = et(/*#__PURE__*/ (0, q.jsx)("path", { d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z" }), "TreeViewCollapseIcon"), Wr = ["ownerState"];
|
|
2518
|
+
function Gr(e, t, n) {
|
|
2519
|
+
return e === void 0 ? t === void 0 ? n : t : e;
|
|
2520
|
+
}
|
|
2521
|
+
function Kr(e) {
|
|
2522
|
+
let { slots: t, slotProps: n, status: r } = e, { slots: i, slotProps: a } = Ht(), o = {
|
|
2523
|
+
collapseIcon: Gr(t?.collapseIcon, i.collapseIcon, Ur),
|
|
2524
|
+
expandIcon: Gr(t?.expandIcon, i.expandIcon, Hr),
|
|
2525
|
+
endIcon: Gr(t?.endIcon, i.endIcon),
|
|
2526
|
+
icon: t?.icon
|
|
2527
|
+
}, s;
|
|
2528
|
+
s = o?.icon ? "icon" : r.expandable ? r.expanded ? "collapseIcon" : "expandIcon" : "endIcon";
|
|
2529
|
+
let c = o[s], l = Kt(W({
|
|
2530
|
+
elementType: c,
|
|
2531
|
+
externalSlotProps: (e) => Y({}, Pe(a[s], e), Pe(n?.[s], e)),
|
|
2532
|
+
ownerState: {}
|
|
2533
|
+
}), Wr);
|
|
2534
|
+
return c ? /*#__PURE__*/ (0, q.jsx)(c, Y({}, l)) : null;
|
|
2535
|
+
}
|
|
2536
|
+
var qr = H("div", {
|
|
2537
|
+
name: "MuiTreeItemDragAndDropOverlay",
|
|
2538
|
+
slot: "Root",
|
|
2539
|
+
shouldForwardProp: (e) => De(e) && e !== "action"
|
|
2540
|
+
})(({ theme: e }) => ({
|
|
2541
|
+
position: "absolute",
|
|
2542
|
+
left: 0,
|
|
2543
|
+
display: "flex",
|
|
2544
|
+
top: 0,
|
|
2545
|
+
bottom: 0,
|
|
2546
|
+
right: 0,
|
|
2547
|
+
pointerEvents: "none",
|
|
2548
|
+
variants: [
|
|
2549
|
+
{
|
|
2550
|
+
props: { action: "make-child" },
|
|
2551
|
+
style: {
|
|
2552
|
+
marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
|
|
2553
|
+
borderRadius: e.shape.borderRadius,
|
|
2554
|
+
backgroundColor: e.alpha((e.vars || e).palette.primary.dark, (e.vars || e).palette.action.focusOpacity)
|
|
2555
|
+
}
|
|
2556
|
+
},
|
|
2557
|
+
{
|
|
2558
|
+
props: { action: "reorder-above" },
|
|
2559
|
+
style: {
|
|
2560
|
+
marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
|
|
2561
|
+
borderTop: `1px solid ${(e.vars || e).palette.action.active}`
|
|
2562
|
+
}
|
|
2563
|
+
},
|
|
2564
|
+
{
|
|
2565
|
+
props: { action: "reorder-below" },
|
|
2566
|
+
style: {
|
|
2567
|
+
marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
|
|
2568
|
+
borderBottom: `1px solid ${(e.vars || e).palette.action.active}`
|
|
2569
|
+
}
|
|
2570
|
+
},
|
|
2571
|
+
{
|
|
2572
|
+
props: { action: "move-to-parent" },
|
|
2573
|
+
style: {
|
|
2574
|
+
marginLeft: "calc(var(--TreeView-indentMultiplier) * calc(var(--TreeView-itemDepth) - 1))",
|
|
2575
|
+
borderBottom: `1px solid ${(e.vars || e).palette.action.active}`
|
|
2576
|
+
}
|
|
2577
|
+
}
|
|
2578
|
+
]
|
|
2579
|
+
}));
|
|
2580
|
+
function Jr(e) {
|
|
2581
|
+
return e.action == null ? null : /*#__PURE__*/ (0, q.jsx)(qr, Y({}, e));
|
|
2582
|
+
}
|
|
2583
|
+
function Yr(e) {
|
|
2584
|
+
let { children: t, itemId: n, id: r } = e, { wrapItem: i, store: a } = Bt(), o = X(a, gn.treeItemIdAttribute, n, r);
|
|
2585
|
+
return /*#__PURE__*/ (0, q.jsx)(K.Fragment, { children: i({
|
|
2586
|
+
children: t,
|
|
2587
|
+
itemId: n,
|
|
2588
|
+
store: a,
|
|
2589
|
+
idAttribute: o
|
|
2590
|
+
}) });
|
|
2591
|
+
}
|
|
2592
|
+
var Xr = H("input", {
|
|
2593
|
+
name: "MuiTreeItem",
|
|
2594
|
+
slot: "LabelInput"
|
|
2595
|
+
})(({ theme: e }) => Y({}, e.typography.body1, {
|
|
2596
|
+
width: "100%",
|
|
2597
|
+
backgroundColor: (e.vars || e).palette.background.paper,
|
|
2598
|
+
borderRadius: e.shape.borderRadius,
|
|
2599
|
+
border: "none",
|
|
2600
|
+
padding: "0 2px",
|
|
2601
|
+
boxSizing: "border-box",
|
|
2602
|
+
"&:focus": { outline: `1px solid ${(e.vars || e).palette.primary.main}` }
|
|
2603
|
+
})), Zr = ["visible"], Qr = [
|
|
2604
|
+
"id",
|
|
2605
|
+
"itemId",
|
|
2606
|
+
"label",
|
|
2607
|
+
"disabled",
|
|
2608
|
+
"disableSelection",
|
|
2609
|
+
"children",
|
|
2610
|
+
"slots",
|
|
2611
|
+
"slotProps",
|
|
2612
|
+
"classes"
|
|
2613
|
+
], $r = Mt("MuiTreeItem"), ei = H("li", {
|
|
2614
|
+
name: "MuiTreeItem",
|
|
2615
|
+
slot: "Root"
|
|
2616
|
+
})({
|
|
2617
|
+
listStyle: "none",
|
|
2618
|
+
margin: 0,
|
|
2619
|
+
padding: 0,
|
|
2620
|
+
outline: 0
|
|
2621
|
+
}), ti = H("div", {
|
|
2622
|
+
name: "MuiTreeItem",
|
|
2623
|
+
slot: "Content",
|
|
2624
|
+
shouldForwardProp: (e) => De(e) && e !== "status"
|
|
2625
|
+
})(({ theme: e }) => ({
|
|
2626
|
+
padding: e.spacing(.5, 1),
|
|
2627
|
+
paddingLeft: `calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`,
|
|
2628
|
+
borderRadius: e.shape.borderRadius,
|
|
2629
|
+
width: "100%",
|
|
2630
|
+
height: "var(--TreeView-itemHeight, unset)",
|
|
2631
|
+
boxSizing: "border-box",
|
|
2632
|
+
position: "relative",
|
|
2633
|
+
display: "flex",
|
|
2634
|
+
alignItems: "center",
|
|
2635
|
+
gap: e.spacing(1),
|
|
2636
|
+
cursor: "pointer",
|
|
2637
|
+
WebkitTapHighlightColor: "transparent",
|
|
2638
|
+
"&:hover": {
|
|
2639
|
+
backgroundColor: (e.vars || e).palette.action.hover,
|
|
2640
|
+
"@media (hover: none)": { backgroundColor: "transparent" }
|
|
2641
|
+
},
|
|
2642
|
+
"&[data-disabled]": {
|
|
2643
|
+
opacity: (e.vars || e).palette.action.disabledOpacity,
|
|
2644
|
+
backgroundColor: "transparent",
|
|
2645
|
+
cursor: "auto"
|
|
2646
|
+
},
|
|
2647
|
+
"&[data-focused]": { backgroundColor: (e.vars || e).palette.action.focus },
|
|
2648
|
+
"&[data-selected]": {
|
|
2649
|
+
backgroundColor: e.alpha((e.vars || e).palette.primary.main, (e.vars || e).palette.action.selectedOpacity),
|
|
2650
|
+
"&:hover": {
|
|
2651
|
+
backgroundColor: e.alpha((e.vars || e).palette.primary.main, `${(e.vars || e).palette.action.selectedOpacity} + ${(e.vars || e).palette.action.hoverOpacity}`),
|
|
2652
|
+
"@media (hover: none)": { backgroundColor: e.alpha((e.vars || e).palette.primary.main, (e.vars || e).palette.action.selectedOpacity) }
|
|
2653
|
+
}
|
|
2654
|
+
},
|
|
2655
|
+
"&[data-selected][data-focused]": { backgroundColor: e.alpha((e.vars || e).palette.primary.main, `${(e.vars || e).palette.action.selectedOpacity} + ${(e.vars || e).palette.action.focusOpacity}`) }
|
|
2656
|
+
})), ni = H("div", {
|
|
2657
|
+
name: "MuiTreeItem",
|
|
2658
|
+
slot: "Label",
|
|
2659
|
+
shouldForwardProp: (e) => De(e) && e !== "editable"
|
|
2660
|
+
})(({ theme: e }) => Y({
|
|
2661
|
+
width: "100%",
|
|
2662
|
+
boxSizing: "border-box",
|
|
2663
|
+
minWidth: 0,
|
|
2664
|
+
position: "relative",
|
|
2665
|
+
overflow: "hidden"
|
|
2666
|
+
}, e.typography.body1, { variants: [{
|
|
2667
|
+
props: ({ editable: e }) => e,
|
|
2668
|
+
style: { paddingLeft: "2px" }
|
|
2669
|
+
}] })), ri = H("div", {
|
|
2670
|
+
name: "MuiTreeItem",
|
|
2671
|
+
slot: "IconContainer"
|
|
2672
|
+
})({
|
|
2673
|
+
width: 16,
|
|
2674
|
+
display: "flex",
|
|
2675
|
+
flexShrink: 0,
|
|
2676
|
+
justifyContent: "center",
|
|
2677
|
+
position: "relative",
|
|
2678
|
+
cursor: "inherit",
|
|
2679
|
+
"& svg": { fontSize: 18 }
|
|
2680
|
+
}), ii = H(st, {
|
|
2681
|
+
name: "MuiTreeItem",
|
|
2682
|
+
slot: "GroupTransition",
|
|
2683
|
+
overridesResolver: (e, t) => t.groupTransition
|
|
2684
|
+
})({
|
|
2685
|
+
margin: 0,
|
|
2686
|
+
padding: 0
|
|
2687
|
+
}), ai = H("div", {
|
|
2688
|
+
name: "MuiTreeItem",
|
|
2689
|
+
slot: "ErrorIcon"
|
|
2690
|
+
})({
|
|
2691
|
+
position: "absolute",
|
|
2692
|
+
right: -3,
|
|
2693
|
+
width: 7,
|
|
2694
|
+
height: 7,
|
|
2695
|
+
borderRadius: "50%",
|
|
2696
|
+
backgroundColor: "red"
|
|
2697
|
+
}), oi = H(Ue, {
|
|
2698
|
+
name: "MuiTreeItem",
|
|
2699
|
+
slot: "LoadingIcon"
|
|
2700
|
+
})({ color: "text.primary" }), si = H(/*#__PURE__*/ K.forwardRef((e, t) => {
|
|
2701
|
+
let { visible: n } = e, r = Kt(e, Zr);
|
|
2702
|
+
return n ? /*#__PURE__*/ (0, q.jsx)(xt, Y({}, r, { ref: t })) : null;
|
|
2703
|
+
}), {
|
|
2704
|
+
name: "MuiTreeItem",
|
|
2705
|
+
slot: "Checkbox"
|
|
2706
|
+
})({ padding: 0 }), ci = (e) => {
|
|
2707
|
+
let { classes: t } = Ht();
|
|
2708
|
+
return Ae({
|
|
2709
|
+
root: ["root"],
|
|
2710
|
+
content: ["content"],
|
|
2711
|
+
iconContainer: ["iconContainer"],
|
|
2712
|
+
checkbox: ["checkbox"],
|
|
2713
|
+
label: ["label"],
|
|
2714
|
+
groupTransition: ["groupTransition"],
|
|
2715
|
+
labelInput: ["labelInput"],
|
|
2716
|
+
dragAndDropOverlay: ["dragAndDropOverlay"],
|
|
2717
|
+
errorIcon: ["errorIcon"],
|
|
2718
|
+
loadingIcon: ["loadingIcon"]
|
|
2719
|
+
}, Vr, Y({}, e, {
|
|
2720
|
+
root: A(e?.root, t.root),
|
|
2721
|
+
content: A(e?.content, t.itemContent),
|
|
2722
|
+
iconContainer: A(e?.iconContainer, t.itemIconContainer),
|
|
2723
|
+
checkbox: A(e?.checkbox, t.itemCheckbox),
|
|
2724
|
+
label: A(e?.label, t.itemLabel),
|
|
2725
|
+
groupTransition: A(e?.groupTransition, t.itemGroupTransition),
|
|
2726
|
+
labelInput: A(e?.labelInput, t.itemLabelInput),
|
|
2727
|
+
dragAndDropOverlay: A(e?.dragAndDropOverlay, t.itemDragAndDropOverlay),
|
|
2728
|
+
errorIcon: A(e?.errorIcon, t.itemErrorIcon),
|
|
2729
|
+
loadingIcon: A(e?.loadingIcon, t.itemLoadingIcon)
|
|
2730
|
+
}));
|
|
2731
|
+
}, li = /*#__PURE__*/ K.forwardRef(function(e, t) {
|
|
2732
|
+
let n = $r({
|
|
2733
|
+
props: e,
|
|
2734
|
+
name: "MuiTreeItem"
|
|
2735
|
+
}), { id: r, itemId: i, label: a, disabled: o, disableSelection: s, children: c, slots: l = {}, slotProps: u = {}, classes: d } = n, f = Kt(n, Qr), { getContextProviderProps: p, getRootProps: m, getContentProps: h, getIconContainerProps: g, getCheckboxProps: _, getLabelProps: v, getGroupTransitionProps: y, getLabelInputProps: b, getDragAndDropOverlayProps: x, getErrorContainerProps: S, getLoadingContainerProps: C, status: w } = Br({
|
|
2736
|
+
id: r,
|
|
2737
|
+
itemId: i,
|
|
2738
|
+
children: c,
|
|
2739
|
+
label: a,
|
|
2740
|
+
disabled: o,
|
|
2741
|
+
disableSelection: s
|
|
2742
|
+
}), T = ci(d), E = l.root ?? ei, D = W({
|
|
2743
|
+
elementType: E,
|
|
2744
|
+
getSlotProps: m,
|
|
2745
|
+
externalForwardedProps: f,
|
|
2746
|
+
externalSlotProps: u.root,
|
|
2747
|
+
additionalProps: { ref: t },
|
|
2748
|
+
ownerState: {},
|
|
2749
|
+
className: T.root
|
|
2750
|
+
}), O = l.content ?? ti, k = W({
|
|
2751
|
+
elementType: O,
|
|
2752
|
+
getSlotProps: h,
|
|
2753
|
+
externalSlotProps: u.content,
|
|
2754
|
+
ownerState: {},
|
|
2755
|
+
className: T.content
|
|
2756
|
+
}), A = l.iconContainer ?? ri, j = W({
|
|
2757
|
+
elementType: A,
|
|
2758
|
+
getSlotProps: g,
|
|
2759
|
+
externalSlotProps: u.iconContainer,
|
|
2760
|
+
ownerState: {},
|
|
2761
|
+
className: T.iconContainer
|
|
2762
|
+
}), M = l.label ?? ni, N = W({
|
|
2763
|
+
elementType: M,
|
|
2764
|
+
getSlotProps: v,
|
|
2765
|
+
externalSlotProps: u.label,
|
|
2766
|
+
ownerState: {},
|
|
2767
|
+
className: T.label
|
|
2768
|
+
}), P = l.checkbox ?? si, F = W({
|
|
2769
|
+
elementType: P,
|
|
2770
|
+
getSlotProps: _,
|
|
2771
|
+
externalSlotProps: u.checkbox,
|
|
2772
|
+
ownerState: {},
|
|
2773
|
+
className: T.checkbox
|
|
2774
|
+
}), I = l.groupTransition ?? void 0, L = W({
|
|
2775
|
+
elementType: I,
|
|
2776
|
+
getSlotProps: y,
|
|
2777
|
+
externalSlotProps: u.groupTransition,
|
|
2778
|
+
ownerState: {},
|
|
2779
|
+
className: T.groupTransition
|
|
2780
|
+
}), R = l.labelInput ?? Xr, ee = W({
|
|
2781
|
+
elementType: R,
|
|
2782
|
+
getSlotProps: b,
|
|
2783
|
+
externalSlotProps: u.labelInput,
|
|
2784
|
+
ownerState: {},
|
|
2785
|
+
className: T.labelInput
|
|
2786
|
+
}), z = l.dragAndDropOverlay ?? Jr, te = W({
|
|
2787
|
+
elementType: z,
|
|
2788
|
+
getSlotProps: x,
|
|
2789
|
+
externalSlotProps: u.dragAndDropOverlay,
|
|
2790
|
+
ownerState: {},
|
|
2791
|
+
className: T.dragAndDropOverlay
|
|
2792
|
+
}), ne = l.errorIcon ?? ai, re = W({
|
|
2793
|
+
elementType: ne,
|
|
2794
|
+
getSlotProps: S,
|
|
2795
|
+
externalSlotProps: u.errorIcon,
|
|
2796
|
+
ownerState: {},
|
|
2797
|
+
className: T.errorIcon
|
|
2798
|
+
}), B = l.loadingIcon ?? oi, ie = W({
|
|
2799
|
+
elementType: B,
|
|
2800
|
+
getSlotProps: C,
|
|
2801
|
+
externalSlotProps: u.loadingIcon,
|
|
2802
|
+
ownerState: {},
|
|
2803
|
+
className: T.loadingIcon
|
|
2804
|
+
});
|
|
2805
|
+
return /*#__PURE__*/ (0, q.jsx)(Yr, Y({}, p(), { children: /*#__PURE__*/ (0, q.jsxs)(E, Y({}, D, { children: [/*#__PURE__*/ (0, q.jsxs)(O, Y({}, k, { children: [
|
|
2806
|
+
/*#__PURE__*/ (0, q.jsxs)(A, Y({}, j, { children: [w.error && /*#__PURE__*/ (0, q.jsx)(ne, Y({}, re)), w.loading ? /*#__PURE__*/ (0, q.jsx)(B, Y({}, ie)) : /*#__PURE__*/ (0, q.jsx)(Kr, {
|
|
2807
|
+
status: w,
|
|
2808
|
+
slots: l,
|
|
2809
|
+
slotProps: u
|
|
2810
|
+
})] })),
|
|
2811
|
+
/*#__PURE__*/ (0, q.jsx)(P, Y({}, F)),
|
|
2812
|
+
w.editing ? /*#__PURE__*/ (0, q.jsx)(R, Y({}, ee)) : /*#__PURE__*/ (0, q.jsx)(M, Y({}, N)),
|
|
2813
|
+
/*#__PURE__*/ (0, q.jsx)(z, Y({}, te))
|
|
2814
|
+
] })), c && /*#__PURE__*/ (0, q.jsx)(ii, Y({ as: I }, L))] })) }));
|
|
2815
|
+
}), ui = "5px", di = (e) => ({ "& > .MuiTreeItem-content": {
|
|
2816
|
+
backgroundColor: `${e} !important`,
|
|
2817
|
+
borderRadius: ui
|
|
2818
|
+
} }), fi = (e, t) => ({
|
|
2819
|
+
width: "100%",
|
|
2820
|
+
minWidth: 0,
|
|
2821
|
+
"& .MuiTreeItem-groupTransition": {
|
|
2822
|
+
marginLeft: "22px",
|
|
2823
|
+
...t && { [G.xs]: { marginLeft: "20px" } }
|
|
2824
|
+
},
|
|
2825
|
+
"& .MuiTreeItem-content": {
|
|
2826
|
+
minWidth: 0,
|
|
2827
|
+
paddingTop: 0,
|
|
2828
|
+
paddingBottom: 0
|
|
2829
|
+
},
|
|
2830
|
+
"& .MuiTreeItem-content:hover": {
|
|
2831
|
+
backgroundColor: `${e} !important`,
|
|
2832
|
+
borderRadius: ui
|
|
2833
|
+
},
|
|
2834
|
+
"& .MuiTreeItem-content:hover .MuiTreeItem-iconContainer:has(svg)": {
|
|
2835
|
+
backgroundColor: e,
|
|
2836
|
+
borderRadius: ui
|
|
2837
|
+
},
|
|
2838
|
+
...t && {
|
|
2839
|
+
[G.sm]: { "& .MuiTreeItem-iconContainer": {
|
|
2840
|
+
width: "16px",
|
|
2841
|
+
"& svg": {
|
|
2842
|
+
width: "16px",
|
|
2843
|
+
height: "16px"
|
|
2844
|
+
}
|
|
2845
|
+
} },
|
|
2846
|
+
[G.xs]: { "& .MuiTreeItem-iconContainer": {
|
|
2847
|
+
width: "12px",
|
|
2848
|
+
"& svg": {
|
|
2849
|
+
width: "12px",
|
|
2850
|
+
height: "12px"
|
|
2851
|
+
}
|
|
2852
|
+
} }
|
|
2853
|
+
}
|
|
2854
|
+
}), pi = (e, t, n) => {
|
|
2855
|
+
let r = n[t] ?? [];
|
|
2856
|
+
return [...e].sort(([, e], [, t]) => {
|
|
2857
|
+
let n = Number(r.includes(t.value)) - Number(r.includes(e.value)), i = Number(e.disabled) - Number(t.disabled);
|
|
2858
|
+
return n || i;
|
|
2859
|
+
});
|
|
2860
|
+
}, mi = ({ filterValues: e, filterDimensionsCount: t, searchTerm: n, isLoading: r = !1, isPreview: a, isFieldLocked: o, hoverColor: s, filterFontSize: l, filterFontColor: u, vSpec: d, dimensionSelectionMethods: f, selectionMode: p }) => {
|
|
2861
|
+
let [h, g] = (0, K.useState)([]), _ = k(f.map(({ field: e, fieldKey: t }) => e ?? { fieldKey: t })), v = d.dimensions.filter((e) => e.role === c.FILTER_DIMENSION), y = d.dimensions.find((e) => e.role === c.FILTER_IMAGE) ?? (d.dimensions.every((e) => !e.role) ? d.dimensions[1] : void 0), b = e.reduce((e, t) => typeof t.measure1 == "number" ? e === null ? t.measure1 : Math.max(e, t.measure1) : e, null), x = (0, K.useMemo)(() => {
|
|
2862
|
+
let t = /* @__PURE__ */ new Map();
|
|
2863
|
+
return e.forEach(({ dimension: e, childDimension: n, dimensionValues: r, disabled: i, image: a, measure1: o, measure2: s }) => {
|
|
2864
|
+
let c = r ?? [e, ...n === void 0 ? [] : [n]], l = c.length;
|
|
2865
|
+
for (; l > 0 && c[l - 1] == null;) --l;
|
|
2866
|
+
let u = t, d;
|
|
2867
|
+
for (let e of c.slice(0, l)) {
|
|
2868
|
+
let t = JSON.stringify(e), n = u.get(t) ?? {
|
|
2869
|
+
value: e,
|
|
2870
|
+
label: String(e),
|
|
2871
|
+
disabled: !!i,
|
|
2872
|
+
children: /* @__PURE__ */ new Map()
|
|
2873
|
+
};
|
|
2874
|
+
n.disabled = n.disabled && !!i, u.set(t, n), d = n, u = n.children;
|
|
2875
|
+
}
|
|
2876
|
+
d && (o != null || s != null) && (d.measure1 = o, d.measure2 = s), d && a && (d.image = a);
|
|
2877
|
+
}), Array.from(t.entries());
|
|
2878
|
+
}, [e]), S = (0, K.useMemo)(() => {
|
|
2879
|
+
let e = /* @__PURE__ */ new Map(), t = (e) => `tree-${encodeURIComponent(JSON.stringify(e))}`, n = (r, i) => {
|
|
2880
|
+
let a = t(i);
|
|
2881
|
+
e.set(a, r), Array.from(r.children.entries()).forEach(([e, t]) => {
|
|
2882
|
+
n(t, [...i, e]);
|
|
2883
|
+
});
|
|
2884
|
+
};
|
|
2885
|
+
return x.forEach(([e, t]) => n(t, [e])), e;
|
|
2886
|
+
}, [x]);
|
|
2887
|
+
(0, K.useEffect)(() => {
|
|
2888
|
+
!n || r || g(Array.from(S.entries()).filter(([, e]) => e.children.size > 0).map(([e]) => e));
|
|
2889
|
+
}, [
|
|
2890
|
+
r,
|
|
2891
|
+
n,
|
|
2892
|
+
S
|
|
2893
|
+
]), (0, K.useEffect)(() => {
|
|
2894
|
+
n || g([]);
|
|
2895
|
+
}, [n]);
|
|
2896
|
+
let C = (e, t) => {
|
|
2897
|
+
g(t);
|
|
2898
|
+
}, w = f.map((e) => e?.state.pending ?? e?.state.applied ?? []), T = f.map((e) => e?.state.applied ?? []), E = (e, n, r, a = w) => {
|
|
2899
|
+
if (p === i.AllLevels && r.some((e, t) => {
|
|
2900
|
+
let n = a[t] ?? [];
|
|
2901
|
+
return (f[t]?.operators.pending ?? f[t]?.operators.applied) !== J.FilterOperator.NotInList && n.length > 0 && !n.includes(e.value);
|
|
2902
|
+
})) return "none";
|
|
2903
|
+
if (n === t - 1) return a[n]?.includes(e.value) ? "full" : "none";
|
|
2904
|
+
let o = Array.from(e.children.values()).map((t) => E(t, n + 1, [...r, e], a));
|
|
2905
|
+
return o.length > 0 && o.every((e) => e === "full") ? "full" : o.some((e) => e !== "none") ? "partial" : "none";
|
|
2906
|
+
}, D = (e) => e.some((e, t) => {
|
|
2907
|
+
let n = T[t] ?? [];
|
|
2908
|
+
return f[t]?.operators.applied !== J.FilterOperator.NotInList && n.length > 0 && !n.includes(e.value);
|
|
2909
|
+
}), O = (e, r, c, u) => {
|
|
2910
|
+
let m = `tree-${encodeURIComponent(JSON.stringify(c))}`, h = r < t - 1 && !!v[r]?.expandOnly, g = pi(Array.from(e.children.entries()), r + 1, T), S = g.length > 0, C = D(u), k = E(e, r, u), A = k !== "full", j = p === i.AllLevels, M = /* @__PURE__ */ new Map(), N = (e, t) => {
|
|
2911
|
+
let n = M.get(t) ?? /* @__PURE__ */ new Set();
|
|
2912
|
+
n.add(e), M.set(t, n);
|
|
2913
|
+
};
|
|
2914
|
+
j && A && u.forEach((e, t) => {
|
|
2915
|
+
v[t]?.expandOnly || N(e.value, t);
|
|
2916
|
+
});
|
|
2917
|
+
let P = (e, n) => {
|
|
2918
|
+
if (e.disabled) return !1;
|
|
2919
|
+
let r = n === t - 1, i = !r && Array.from(e.children.values()).map((e) => P(e, n + 1)).some(Boolean);
|
|
2920
|
+
return !r && !i ? !1 : ((r || j && !v[n]?.expandOnly) && N(e.value, n), !0);
|
|
2921
|
+
}, F = P(e, r), I = A && Array.from(M).some(([e, t]) => _[e] && t.size > 1), L = !F || e.disabled || C || o || !!a || I, R = (!F || e.disabled || C) && !S || o || !!a;
|
|
2922
|
+
return /* @__PURE__ */ (0, q.jsx)(li, {
|
|
2923
|
+
itemId: m,
|
|
2924
|
+
disabled: R,
|
|
2925
|
+
sx: k === "full" ? di(s) : void 0,
|
|
2926
|
+
"data-testid": `${e.label}-tree-item`,
|
|
2927
|
+
label: /* @__PURE__ */ (0, q.jsx)(xe, {
|
|
2928
|
+
selected: k === "full",
|
|
2929
|
+
applied: !1,
|
|
2930
|
+
disabled: L,
|
|
2931
|
+
hoverColor: s,
|
|
2932
|
+
onSelect: h ? void 0 : (e) => {
|
|
2933
|
+
if (e.stopPropagation(), !L) {
|
|
2934
|
+
if (j && !A) {
|
|
2935
|
+
let e = w.map((e, t) => _[t] ? e : e.filter((e) => !M.get(t)?.has(e))), n = /* @__PURE__ */ new Map(), r = (i, a, o) => {
|
|
2936
|
+
if (a === t - 1) {
|
|
2937
|
+
E(i, a, o, e) === "full" && o.forEach((e, t) => {
|
|
2938
|
+
let r = n.get(t) ?? /* @__PURE__ */ new Set();
|
|
2939
|
+
r.add(e.value), n.set(t, r);
|
|
2940
|
+
});
|
|
2941
|
+
return;
|
|
2942
|
+
}
|
|
2943
|
+
i.children.forEach((e) => r(e, a + 1, [...o, i]));
|
|
2944
|
+
};
|
|
2945
|
+
x.forEach(([, e]) => r(e, 0, [])), u.forEach((e, t) => {
|
|
2946
|
+
!v[t]?.expandOnly && !n.get(t)?.has(e.value) && N(e.value, t);
|
|
2947
|
+
});
|
|
2948
|
+
}
|
|
2949
|
+
M.forEach((e, t) => {
|
|
2950
|
+
if (!A && _[t]) return;
|
|
2951
|
+
let n = w[t] ?? [], r = Array.from(e).filter((e) => n.includes(e) !== A);
|
|
2952
|
+
r.length && f[t]?.onClickValues(r, {
|
|
2953
|
+
on: A,
|
|
2954
|
+
off: !A
|
|
2955
|
+
});
|
|
2956
|
+
});
|
|
2957
|
+
}
|
|
2958
|
+
},
|
|
2959
|
+
showProgressBar: d.filterSettings?.showProgressBar,
|
|
2960
|
+
showCheckbox: !h,
|
|
2961
|
+
showSelectionIcon: !h,
|
|
2962
|
+
checkboxState: k,
|
|
2963
|
+
dimensionValue: e.value,
|
|
2964
|
+
dimensionFormatter: v[r]?.formatter,
|
|
2965
|
+
measure1Value: e.measure1,
|
|
2966
|
+
measure1Label: d.measures[0]?.filterValueLabel,
|
|
2967
|
+
measure1Formatter: d.measures[0]?.formatter,
|
|
2968
|
+
measure2Value: e.measure2,
|
|
2969
|
+
measure2Label: d.measures[1]?.filterValueLabel,
|
|
2970
|
+
measure2Formatter: d.measures[1]?.formatter,
|
|
2971
|
+
maxValue: b,
|
|
2972
|
+
imageValue: e.image,
|
|
2973
|
+
imageFit: y?.imageFit,
|
|
2974
|
+
searchTerm: n,
|
|
2975
|
+
fontStyle: d.filterSettings?.fontStyle,
|
|
2976
|
+
fontSize: l,
|
|
2977
|
+
progressBarColor: d.filterSettings?.filterStyle?.progressBarColor,
|
|
2978
|
+
responsive: d?.filterSettings?.responsive
|
|
2979
|
+
}),
|
|
2980
|
+
children: g.map(([t, n]) => O(n, r + 1, [...c, t], [...u, e]))
|
|
2981
|
+
}, m);
|
|
2982
|
+
};
|
|
2983
|
+
return /* @__PURE__ */ (0, q.jsx)(Rr, {
|
|
2984
|
+
"aria-label": "Filter values",
|
|
2985
|
+
itemChildrenIndentation: 0,
|
|
2986
|
+
slots: {
|
|
2987
|
+
collapseIcon: () => /* @__PURE__ */ (0, q.jsx)(m, {
|
|
2988
|
+
size: l,
|
|
2989
|
+
fill: u,
|
|
2990
|
+
"data-testid": "collapse-icon"
|
|
2991
|
+
}),
|
|
2992
|
+
expandIcon: () => /* @__PURE__ */ (0, q.jsx)(R, {
|
|
2993
|
+
size: l,
|
|
2994
|
+
fill: u,
|
|
2995
|
+
"data-testid": "expand-icon"
|
|
2996
|
+
})
|
|
2997
|
+
},
|
|
2998
|
+
sx: fi(s, d?.filterSettings?.responsive),
|
|
2999
|
+
expandedItems: h,
|
|
3000
|
+
selectedItems: null,
|
|
3001
|
+
onExpandedItemsChange: C,
|
|
3002
|
+
children: pi(x, 0, T).map(([e, t]) => O(t, 0, [e], []))
|
|
3003
|
+
});
|
|
3004
|
+
}, hi = {
|
|
3005
|
+
borderBottom: `1px solid ${r.grey5}`,
|
|
3006
|
+
margin: "0 12px",
|
|
3007
|
+
width: "calc(100% - 24px)"
|
|
3008
|
+
}, gi = {
|
|
3009
|
+
flexGrow: 1,
|
|
3010
|
+
borderRadius: 0,
|
|
3011
|
+
height: 28,
|
|
3012
|
+
boxShadow: "0 3px 6px rgba(0, 0, 0, 0.2)",
|
|
3013
|
+
clipPath: "inset(0 0 -10px 0)",
|
|
3014
|
+
transform: "translateY(-3px)"
|
|
3015
|
+
}, _i = {
|
|
3016
|
+
position: "absolute",
|
|
3017
|
+
inset: 0,
|
|
3018
|
+
display: "flex",
|
|
3019
|
+
justifyContent: "center",
|
|
3020
|
+
alignItems: "flex-end",
|
|
3021
|
+
pointerEvents: "auto",
|
|
3022
|
+
zIndex: 2
|
|
3023
|
+
}, vi = ({ vSpec: e, vTheme: t, filterValues: i, isPreview: o = !1, loadMoreData: s, searchTerm: l, setSearchTerm: f, allValuesLoaded: p, isSearching: m = !1, isApplyingFilters: h = !1 }) => {
|
|
3024
|
+
let _ = t ?? d, v = g(), [y, x] = (0, K.useState)(l), S = !!e.filterSettings?.defaultNotState, C = e.filterSettings?.selectionMode ?? u.selectionMode, [w, T] = (0, K.useState)(S), [D, O] = fe(e), k = (0, K.useMemo)(() => (0, Ct.default)((e) => f(e), 300), [f]), A = i.reduce((e, t) => (t.disabled || e.push(t.dimension), e), []), j = e.dimensions.filter((e) => e.role === c.FILTER_DIMENSION), M = j[0] ?? e.dimensions[0], F = j.length > 1, L = o ? [] : j.length > 0 ? j.map((e, t) => ({
|
|
3025
|
+
dataItem: e.dataItem,
|
|
3026
|
+
dateLevel: e.dateLevel ?? void 0,
|
|
3027
|
+
datePart: e.datePart ?? void 0,
|
|
3028
|
+
values: i.map((e) => e.dimensionValues ? e.dimensionValues[t] : [e.dimension, e.childDimension][t]).filter((e) => e !== void 0)
|
|
3029
|
+
})) : [{
|
|
3030
|
+
dataItem: M?.dataItem,
|
|
3031
|
+
dateLevel: M?.dateLevel ?? void 0,
|
|
3032
|
+
datePart: M?.datePart ?? void 0,
|
|
3033
|
+
values: A
|
|
3034
|
+
}], { hasImage: R, hasMeasure: ee, searchEnabled: z, quickSelection: te } = St(e), ne = e.filterSettings?.filterStyle, { backgroundColor: re, ...B } = ne ?? {}, oe = ne && {
|
|
3035
|
+
...B,
|
|
3036
|
+
..."backgroundColor" in ne ? { backgroundColor: re ?? void 0 } : {}
|
|
3037
|
+
}, se = e.filterSettings?.filterStyle?.backgroundColor ?? n.backgroundColor, le = e.filterSettings?.fontStyle?.fontSize ?? n.fontSize, pe = a(_, e.filterSettings?.fontStyle?.fontColor), me = ae({
|
|
3038
|
+
...ie,
|
|
3039
|
+
"--background-color": se
|
|
3040
|
+
})["--background-color-hover"] ?? r.grey3, _e = E(L, {
|
|
3041
|
+
disabled: o,
|
|
3042
|
+
state: te ? J.SelectionState.APPLIED : void 0,
|
|
3043
|
+
defaultOperator: w ? J.FilterOperator.NotInList : J.FilterOperator.InList,
|
|
3044
|
+
commitHistory: te
|
|
3045
|
+
}), { onClear: xe, onClick: Se, onDeselectAll: Ce, onSelectExcluded: we, onNotOperatorChange: Te, onSelectAll: V, field: H, state: Ee, operators: De } = _e[0] ?? N, { isFieldLocked: Oe = !1, toggleFieldLock: ke } = I(H ?? void 0), Ae = Ee.pending ?? Ee.applied ?? [], je = P(H ? [H] : []);
|
|
3046
|
+
(0, K.useEffect)(() => {
|
|
3047
|
+
let e = De.pending ?? De.applied;
|
|
3048
|
+
if (e) {
|
|
3049
|
+
T(e === J.FilterOperator.NotInList);
|
|
3050
|
+
return;
|
|
3051
|
+
}
|
|
3052
|
+
T(S);
|
|
3053
|
+
}, [S, De]);
|
|
3054
|
+
let Me = (0, K.useCallback)(() => {
|
|
3055
|
+
T((e) => !e), Te();
|
|
3056
|
+
}, [T, Te]);
|
|
3057
|
+
function Ne() {
|
|
3058
|
+
p ? V() : v.daedalus.emitEvent(J.AstratoEvents.SHOW_GLOBAL_NOTIFICATION, {
|
|
3059
|
+
type: "warn",
|
|
3060
|
+
message: "Cannot select values, because not all of them are loaded!"
|
|
3061
|
+
});
|
|
3062
|
+
}
|
|
3063
|
+
let Pe = Oe || h && !F || m, U = (0, K.useRef)(null);
|
|
3064
|
+
(0, K.useEffect)(() => {
|
|
3065
|
+
U.current?.toggleAttribute("inert", Pe);
|
|
3066
|
+
}, [Pe]);
|
|
3067
|
+
let Fe = (0, K.useMemo)(() => Oe ? i.filter((e) => (Ee.pending ?? Ee.applied ?? []).includes(e.dimension)) : i, [
|
|
3068
|
+
i,
|
|
3069
|
+
Oe,
|
|
3070
|
+
Ee.pending,
|
|
3071
|
+
Ee.applied
|
|
3072
|
+
]);
|
|
3073
|
+
return /* @__PURE__ */ (0, q.jsx)("div", {
|
|
3074
|
+
style: {
|
|
3075
|
+
position: "relative",
|
|
3076
|
+
height: "100%"
|
|
3077
|
+
},
|
|
3078
|
+
children: /* @__PURE__ */ (0, q.jsx)(be, {
|
|
3079
|
+
blurBackground: !0,
|
|
3080
|
+
filterStyle: oe,
|
|
3081
|
+
fontSize: e.filterSettings?.fontStyle?.fontSize ?? n.fontSize,
|
|
3082
|
+
children: /* @__PURE__ */ (0, q.jsxs)(de.Provider, {
|
|
3083
|
+
value: {
|
|
3084
|
+
appliedOperator: De.applied,
|
|
3085
|
+
pendingOperator: De.pending
|
|
3086
|
+
},
|
|
3087
|
+
children: [
|
|
3088
|
+
/* @__PURE__ */ (0, q.jsx)(ve, {
|
|
3089
|
+
measureTitle: O ?? "",
|
|
3090
|
+
dimensionTitle: D,
|
|
3091
|
+
searchEnabled: z && !o,
|
|
3092
|
+
searchTerm: y,
|
|
3093
|
+
onSearchChange: (e) => {
|
|
3094
|
+
x(e), k(e);
|
|
3095
|
+
},
|
|
3096
|
+
onApplySearched: Ne,
|
|
3097
|
+
fontStyle: e.filterSettings?.fontStyle ?? {},
|
|
3098
|
+
vTheme: _,
|
|
3099
|
+
isNotEnabled: w,
|
|
3100
|
+
responsive: e?.filterSettings?.responsive,
|
|
3101
|
+
isLocked: Oe,
|
|
3102
|
+
children: te ? null : /* @__PURE__ */ (0, q.jsx)(Tt, {
|
|
3103
|
+
isPreview: o,
|
|
3104
|
+
responsive: e?.filterSettings?.responsive,
|
|
3105
|
+
areSelectedValues: Ae.length > 0,
|
|
3106
|
+
arePendingValues: !!Ee.pending,
|
|
3107
|
+
onClear: xe,
|
|
3108
|
+
onDeselectAll: Ce,
|
|
3109
|
+
onSelectExcluded: we,
|
|
3110
|
+
onSelectAll: V,
|
|
3111
|
+
toggleNotOperator: Me,
|
|
3112
|
+
onLockClick: ke,
|
|
3113
|
+
isNotEnabled: w,
|
|
3114
|
+
isSingleSelectField: je
|
|
3115
|
+
})
|
|
3116
|
+
}),
|
|
3117
|
+
m ? /* @__PURE__ */ (0, q.jsx)(ce, { loading: !0 }) : /* @__PURE__ */ (0, q.jsx)("div", { style: hi }),
|
|
3118
|
+
/* @__PURE__ */ (0, q.jsx)("div", {
|
|
3119
|
+
ref: U,
|
|
3120
|
+
style: {
|
|
3121
|
+
height: "100%",
|
|
3122
|
+
opacity: Pe ? .5 : 1,
|
|
3123
|
+
pointerEvents: Pe ? "none" : void 0,
|
|
3124
|
+
transition: "opacity 0.15s ease"
|
|
3125
|
+
},
|
|
3126
|
+
children: /* @__PURE__ */ (0, q.jsxs)(ge, {
|
|
3127
|
+
loadMoreData: s,
|
|
3128
|
+
responsive: e?.filterSettings?.responsive,
|
|
3129
|
+
children: [p && Fe.length === 0 && !m && !h ? /* @__PURE__ */ (0, q.jsx)(ue, {
|
|
3130
|
+
responsive: e?.filterSettings?.responsive,
|
|
3131
|
+
applied: !1,
|
|
3132
|
+
disabled: !1,
|
|
3133
|
+
selected: !1,
|
|
3134
|
+
hoverColor: me,
|
|
3135
|
+
fontStyle: e.filterSettings?.fontStyle,
|
|
3136
|
+
dimensionValue: "No results to display."
|
|
3137
|
+
}) : null, F ? /* @__PURE__ */ (0, q.jsx)(mi, {
|
|
3138
|
+
filterValues: Fe,
|
|
3139
|
+
filterDimensionsCount: j.length,
|
|
3140
|
+
searchTerm: l,
|
|
3141
|
+
isLoading: m || h,
|
|
3142
|
+
isPreview: o,
|
|
3143
|
+
isFieldLocked: Oe,
|
|
3144
|
+
hoverColor: me,
|
|
3145
|
+
filterFontSize: le,
|
|
3146
|
+
filterFontColor: pe,
|
|
3147
|
+
vSpec: e,
|
|
3148
|
+
dimensionSelectionMethods: _e,
|
|
3149
|
+
selectionMode: C
|
|
3150
|
+
}) : R || ee ? /* @__PURE__ */ (0, q.jsx)(he, {
|
|
3151
|
+
vSpec: e,
|
|
3152
|
+
filterValues: Fe,
|
|
3153
|
+
hoverColor: me,
|
|
3154
|
+
onItemClick: Se,
|
|
3155
|
+
selectedValues: Ae,
|
|
3156
|
+
appliedValues: Ee.applied ?? [],
|
|
3157
|
+
searchTerm: l
|
|
3158
|
+
}) : /* @__PURE__ */ (0, q.jsx)(ye, {
|
|
3159
|
+
vSpec: e,
|
|
3160
|
+
filterValues: Fe,
|
|
3161
|
+
hoverColor: me,
|
|
3162
|
+
onItemClick: Se,
|
|
3163
|
+
selectedValues: Ae,
|
|
3164
|
+
appliedValues: Ee.applied ?? [],
|
|
3165
|
+
searchTerm: l
|
|
3166
|
+
})]
|
|
3167
|
+
})
|
|
3168
|
+
}),
|
|
3169
|
+
Oe && /* @__PURE__ */ (0, q.jsx)("div", {
|
|
3170
|
+
style: _i,
|
|
3171
|
+
children: /* @__PURE__ */ (0, q.jsx)(Ke, {
|
|
3172
|
+
color: "secondary",
|
|
3173
|
+
style: gi,
|
|
3174
|
+
onClick: () => ke(),
|
|
3175
|
+
children: /* @__PURE__ */ (0, q.jsxs)(q.Fragment, { children: [/* @__PURE__ */ (0, q.jsx)(b, { fill: "white" }), "Unlock"] })
|
|
3176
|
+
})
|
|
3177
|
+
})
|
|
3178
|
+
]
|
|
3179
|
+
})
|
|
3180
|
+
})
|
|
3181
|
+
});
|
|
3182
|
+
};
|
|
3183
|
+
function yi(e) {
|
|
3184
|
+
let { quickSelection: t, isPreview: n, areSelectedValues: r, state: i, responsive: a, isSingleSelectField: o = !1, onClear: s, onDeselectAll: c, onSelectAll: l, onSelectExcluded: u, onNotOperatorChange: d, onLockClick: f } = e, [p, m] = (0, K.useState)(!1), h = wt({ responsive: a }), { appliedOperator: _, pendingOperator: v } = (0, K.useContext)(de), b = _ ?? v ?? J.FilterOperator.InList, x = g().daedalus.getWorkbookProperties()?.isLockUnlockFieldsEnabled ?? !1;
|
|
3185
|
+
if (t) return null;
|
|
3186
|
+
let S = [{
|
|
3187
|
+
disabled: n || !i.pending,
|
|
3188
|
+
key: "clear",
|
|
3189
|
+
label: "Clear",
|
|
3190
|
+
type: "option",
|
|
3191
|
+
onClick: s
|
|
3192
|
+
}];
|
|
3193
|
+
return o || S.push({
|
|
3194
|
+
key: "divider",
|
|
3195
|
+
type: "divider"
|
|
3196
|
+
}, {
|
|
3197
|
+
disabled: n || !r,
|
|
3198
|
+
key: "deselect-all",
|
|
3199
|
+
label: "Deselect all",
|
|
3200
|
+
type: "option",
|
|
3201
|
+
onClick: c
|
|
3202
|
+
}, {
|
|
3203
|
+
disabled: n,
|
|
3204
|
+
key: "select-all",
|
|
3205
|
+
label: b === J.FilterOperator.InList ? "Select all" : "Exclude all",
|
|
3206
|
+
type: "option",
|
|
3207
|
+
onClick: l
|
|
3208
|
+
}, {
|
|
3209
|
+
disabled: n,
|
|
3210
|
+
key: "invert",
|
|
3211
|
+
label: "Invert",
|
|
3212
|
+
type: "option",
|
|
3213
|
+
onClick: u
|
|
3214
|
+
}, {
|
|
3215
|
+
disabled: n,
|
|
3216
|
+
key: "not",
|
|
3217
|
+
label: "Exclude",
|
|
3218
|
+
type: "option",
|
|
3219
|
+
onClick: d
|
|
3220
|
+
}), x && S.push({
|
|
3221
|
+
key: "divider",
|
|
3222
|
+
type: "divider"
|
|
3223
|
+
}, {
|
|
3224
|
+
key: "lock",
|
|
3225
|
+
label: "Lock",
|
|
3226
|
+
type: "option",
|
|
3227
|
+
icon: { right: /* @__PURE__ */ (0, q.jsx)(y, {}) },
|
|
3228
|
+
onClick: f
|
|
3229
|
+
}), /* @__PURE__ */ (0, q.jsx)(Re, {
|
|
3230
|
+
open: p,
|
|
3231
|
+
placement: "bottom-end",
|
|
3232
|
+
title: /* @__PURE__ */ (0, q.jsx)(z, {
|
|
3233
|
+
onClickAway: () => m(!1),
|
|
3234
|
+
children: /* @__PURE__ */ (0, q.jsx)(re, {
|
|
3235
|
+
appearance: "legacy",
|
|
3236
|
+
onClose: () => m(!1),
|
|
3237
|
+
options: S,
|
|
3238
|
+
responsive: a,
|
|
3239
|
+
style: { margin: "-8px -12px" }
|
|
3240
|
+
})
|
|
3241
|
+
}),
|
|
3242
|
+
children: /* @__PURE__ */ (0, q.jsx)(B, {
|
|
3243
|
+
onClick: () => m(!p),
|
|
3244
|
+
className: h.menuTrigger,
|
|
3245
|
+
children: /* @__PURE__ */ (0, q.jsx)(L, {
|
|
3246
|
+
fill: "currentColor",
|
|
3247
|
+
size: 20
|
|
3248
|
+
})
|
|
3249
|
+
})
|
|
3250
|
+
});
|
|
3251
|
+
}
|
|
3252
|
+
var bi = S({
|
|
3253
|
+
searchWrapper: (e) => ({
|
|
3254
|
+
alignItems: "center",
|
|
3255
|
+
display: "flex",
|
|
3256
|
+
flexDirection: "row",
|
|
3257
|
+
gap: 4,
|
|
3258
|
+
justifyContent: "space-between",
|
|
3259
|
+
padding: "8px 8px 8px 12px",
|
|
3260
|
+
position: "relative",
|
|
3261
|
+
width: "100%",
|
|
3262
|
+
...e && {
|
|
3263
|
+
[G.md]: { padding: "6px 6px 6px 10px" },
|
|
3264
|
+
[G.sm]: { padding: "4px 4px 4px 8px" },
|
|
3265
|
+
[G.xs]: { padding: "2px 2px 2px 4px" }
|
|
3266
|
+
}
|
|
3267
|
+
}),
|
|
3268
|
+
searchWrapperSearch: { flexGrow: 1 },
|
|
3269
|
+
tooltip: (e) => ({
|
|
3270
|
+
"& .MuiTooltip-tooltip": {
|
|
3271
|
+
padding: 0,
|
|
3272
|
+
margin: 0,
|
|
3273
|
+
backgroundColor: "transparent"
|
|
3274
|
+
},
|
|
3275
|
+
...Si("bottom", e),
|
|
3276
|
+
...Si("top", e)
|
|
3277
|
+
}),
|
|
3278
|
+
unlockButtonStyles: {
|
|
3279
|
+
width: "100%",
|
|
3280
|
+
height: 28,
|
|
3281
|
+
boxShadow: "0 3px 6px rgba(0, 0, 0, 0.2)",
|
|
3282
|
+
clipPath: "inset(0 0 -10px 0)",
|
|
3283
|
+
transform: "translateY(-3px)"
|
|
3284
|
+
}
|
|
3285
|
+
});
|
|
3286
|
+
function xi(e) {
|
|
3287
|
+
let { children: t, isOpen: i, setIsOpen: a, isPreview: o, vSpec: s, vTheme: c, onSearchChange: l, setLocalSearch: u, allValuesLoaded: d, onSelectAll: f, localSearch: p, searchTerm: m, loadMoreData: h, headerElement: _, filterValues: v, hierarchicalMode: y, filterDimensionsCount: x, dimensionSelectionMethods: S, selectionMode: C, onNotOperatorChange: w, onClick: T, onDeselectAll: E, onClear: D, onSelectExcluded: O, state: k, onLockClick: A, isLocked: j, isSingleSelectField: M = !1, isSearching: N = !1, isApplyingFilters: P = !1 } = e, F = g(), I = bi(s?.filterSettings?.responsive), L = P || N, R = (0, K.useRef)(null);
|
|
3288
|
+
(0, K.useEffect)(() => {
|
|
3289
|
+
R.current?.toggleAttribute("inert", L);
|
|
3290
|
+
}, [L]);
|
|
3291
|
+
let { quickSelection: ee, hasMeasure: te, hasImage: ne, searchEnabled: re } = St(s), B = k.pending ?? k.applied ?? [], se = s.filterSettings?.filterStyle, le;
|
|
3292
|
+
if (se) {
|
|
3293
|
+
let { backgroundColor: e, ...t } = se;
|
|
3294
|
+
le = {
|
|
3295
|
+
...t,
|
|
3296
|
+
..."backgroundColor" in se ? { backgroundColor: e ?? void 0 } : {}
|
|
3297
|
+
};
|
|
3298
|
+
}
|
|
3299
|
+
let de = s.filterSettings?.filterStyle?.borderRadius ?? n.borderRadius, fe = s.filterSettings?.fontStyle?.fontColor ?? c?.fonts?.general?.color ?? r.mainDarkNavy, me = s.filterSettings?.filterStyle?.backgroundColor ?? n.backgroundColor, ve = ae({
|
|
3300
|
+
...ie,
|
|
3301
|
+
"--background-color": me
|
|
3302
|
+
})["--background-color-hover"] ?? r.grey3;
|
|
3303
|
+
function be(e) {
|
|
3304
|
+
switch (e.key) {
|
|
3305
|
+
case "Enter":
|
|
3306
|
+
d ? f() : F.daedalus.emitEvent(J.AstratoEvents.SHOW_GLOBAL_NOTIFICATION, {
|
|
3307
|
+
type: "warn",
|
|
3308
|
+
message: "Cannot select values, because not all of them are loaded!"
|
|
3309
|
+
});
|
|
3310
|
+
break;
|
|
3311
|
+
case "Escape":
|
|
3312
|
+
y ? l("") : u("");
|
|
3313
|
+
break;
|
|
3314
|
+
}
|
|
3315
|
+
}
|
|
3316
|
+
return /* @__PURE__ */ (0, q.jsx)(Re, {
|
|
3317
|
+
placement: "bottom-start",
|
|
3318
|
+
arrow: !1,
|
|
3319
|
+
open: i,
|
|
3320
|
+
classes: { popper: I.tooltip },
|
|
3321
|
+
slotProps: { popper: { anchorEl: _?.current?.firstElementChild } },
|
|
3322
|
+
title: /* @__PURE__ */ (0, q.jsx)(z, {
|
|
3323
|
+
onClickAway: () => a(!1),
|
|
3324
|
+
children: /* @__PURE__ */ (0, q.jsx)("div", {
|
|
3325
|
+
style: {
|
|
3326
|
+
minWidth: _.current?.clientWidth,
|
|
3327
|
+
maxWidth: "80vw",
|
|
3328
|
+
fontSize: s.filterSettings?.fontStyle?.fontSize ?? n.fontSize
|
|
3329
|
+
},
|
|
3330
|
+
children: i && /* @__PURE__ */ (0, q.jsxs)("div", {
|
|
3331
|
+
style: { position: "relative" },
|
|
3332
|
+
children: [/* @__PURE__ */ (0, q.jsx)("div", {
|
|
3333
|
+
style: {
|
|
3334
|
+
filter: j ? "brightness(0.93)" : void 0,
|
|
3335
|
+
pointerEvents: j ? "none" : void 0
|
|
3336
|
+
},
|
|
3337
|
+
children: /* @__PURE__ */ (0, q.jsxs)(_e, {
|
|
3338
|
+
filterStyle: le,
|
|
3339
|
+
isLocked: j,
|
|
3340
|
+
children: [
|
|
3341
|
+
re && !o && /* @__PURE__ */ (0, q.jsxs)("div", {
|
|
3342
|
+
className: I.searchWrapper,
|
|
3343
|
+
style: { color: fe },
|
|
3344
|
+
children: [/* @__PURE__ */ (0, q.jsx)(oe, {
|
|
3345
|
+
className: I.searchWrapperSearch,
|
|
3346
|
+
"data-testid": "filter-search-input",
|
|
3347
|
+
onChange: (e) => {
|
|
3348
|
+
l(e.target.value);
|
|
3349
|
+
},
|
|
3350
|
+
autoFocus: !j,
|
|
3351
|
+
onPaste: pe(l),
|
|
3352
|
+
onKeyDown: be,
|
|
3353
|
+
style: {
|
|
3354
|
+
color: fe,
|
|
3355
|
+
borderColor: fe
|
|
3356
|
+
},
|
|
3357
|
+
value: p,
|
|
3358
|
+
responsive: s?.filterSettings?.responsive
|
|
3359
|
+
}), /* @__PURE__ */ (0, q.jsx)(yi, {
|
|
3360
|
+
responsive: s?.filterSettings?.responsive,
|
|
3361
|
+
isPreview: o,
|
|
3362
|
+
quickSelection: ee,
|
|
3363
|
+
areSelectedValues: !!B.length,
|
|
3364
|
+
state: k,
|
|
3365
|
+
onClear: D,
|
|
3366
|
+
onDeselectAll: E,
|
|
3367
|
+
onSelectAll: f,
|
|
3368
|
+
onSelectExcluded: O,
|
|
3369
|
+
onNotOperatorChange: w,
|
|
3370
|
+
onLockClick: A,
|
|
3371
|
+
isSingleSelectField: M
|
|
3372
|
+
})]
|
|
3373
|
+
}),
|
|
3374
|
+
/* @__PURE__ */ (0, q.jsx)(ce, { loading: N }),
|
|
3375
|
+
/* @__PURE__ */ (0, q.jsx)("div", {
|
|
3376
|
+
ref: R,
|
|
3377
|
+
style: {
|
|
3378
|
+
opacity: L ? .5 : 1,
|
|
3379
|
+
pointerEvents: L ? "none" : void 0,
|
|
3380
|
+
transition: "opacity 0.15s ease"
|
|
3381
|
+
},
|
|
3382
|
+
children: /* @__PURE__ */ (0, q.jsxs)(ge, {
|
|
3383
|
+
loadMoreData: h,
|
|
3384
|
+
isDropdown: !0,
|
|
3385
|
+
hasSearch: re,
|
|
3386
|
+
responsive: s?.filterSettings?.responsive,
|
|
3387
|
+
children: [d && v.length === 0 && !N && !P ? /* @__PURE__ */ (0, q.jsx)(ue, {
|
|
3388
|
+
applied: !1,
|
|
3389
|
+
disabled: !1,
|
|
3390
|
+
selected: !1,
|
|
3391
|
+
hoverColor: ve,
|
|
3392
|
+
fontStyle: s.filterSettings?.fontStyle,
|
|
3393
|
+
dimensionValue: "No results to display.",
|
|
3394
|
+
responsive: s?.filterSettings?.responsive
|
|
3395
|
+
}) : null, y ? /* @__PURE__ */ (0, q.jsx)(mi, {
|
|
3396
|
+
filterValues: v,
|
|
3397
|
+
filterDimensionsCount: x,
|
|
3398
|
+
searchTerm: m,
|
|
3399
|
+
isLoading: N || P,
|
|
3400
|
+
isPreview: o,
|
|
3401
|
+
isFieldLocked: j,
|
|
3402
|
+
hoverColor: ve,
|
|
3403
|
+
filterFontSize: s.filterSettings?.fontStyle?.fontSize ?? n.fontSize,
|
|
3404
|
+
filterFontColor: fe,
|
|
3405
|
+
vSpec: s,
|
|
3406
|
+
dimensionSelectionMethods: S,
|
|
3407
|
+
selectionMode: C
|
|
3408
|
+
}) : ne || te ? /* @__PURE__ */ (0, q.jsx)(he, {
|
|
3409
|
+
vSpec: s,
|
|
3410
|
+
filterValues: v,
|
|
3411
|
+
hoverColor: ve,
|
|
3412
|
+
onItemClick: T,
|
|
3413
|
+
selectedValues: B,
|
|
3414
|
+
appliedValues: k.applied ?? [],
|
|
3415
|
+
searchTerm: m
|
|
3416
|
+
}) : /* @__PURE__ */ (0, q.jsx)(ye, {
|
|
3417
|
+
vSpec: s,
|
|
3418
|
+
filterValues: v,
|
|
3419
|
+
hoverColor: ve,
|
|
3420
|
+
onItemClick: T,
|
|
3421
|
+
selectedValues: B,
|
|
3422
|
+
appliedValues: k.applied ?? [],
|
|
3423
|
+
searchTerm: m
|
|
3424
|
+
})]
|
|
3425
|
+
})
|
|
3426
|
+
})
|
|
3427
|
+
]
|
|
3428
|
+
})
|
|
3429
|
+
}), j && /* @__PURE__ */ (0, q.jsx)(Ke, {
|
|
3430
|
+
color: "secondary",
|
|
3431
|
+
style: { borderRadius: `0 0 ${de}px ${de}px` },
|
|
3432
|
+
className: I.unlockButtonStyles,
|
|
3433
|
+
onClick: A,
|
|
3434
|
+
children: /* @__PURE__ */ (0, q.jsxs)(q.Fragment, { children: [/* @__PURE__ */ (0, q.jsx)(b, { fill: "white" }), "Unlock"] })
|
|
3435
|
+
})]
|
|
3436
|
+
})
|
|
3437
|
+
})
|
|
3438
|
+
}),
|
|
3439
|
+
children: t
|
|
3440
|
+
});
|
|
3441
|
+
}
|
|
3442
|
+
function Si(e, t) {
|
|
3443
|
+
let n = e === "top" ? "marginBottom" : "marginTop";
|
|
3444
|
+
return { [`&[data-popper-placement*="${e}"]`]: { "& .MuiTooltip-tooltip": {
|
|
3445
|
+
[n]: 8,
|
|
3446
|
+
...t && {
|
|
3447
|
+
[G.md]: { [n]: 6 },
|
|
3448
|
+
[G.sm]: { [n]: 4 },
|
|
3449
|
+
[G.xs]: { [n]: 2 }
|
|
3450
|
+
}
|
|
3451
|
+
} } };
|
|
3452
|
+
}
|
|
3453
|
+
var Ci = {
|
|
3454
|
+
backgroundColor: "transparent",
|
|
3455
|
+
borderEnabled: !1
|
|
3456
|
+
}, wi = ({ vSpec: e, filterValues: t, isPreview: r = !1, vTheme: i, loadMoreData: a, searchTerm: o, setSearchTerm: s, allValuesLoaded: l, isSearching: d = !1, isApplyingFilters: f = !1 }) => {
|
|
3457
|
+
let p = (0, K.useRef)(null), [m, h] = (0, K.useState)(!1), [g, _] = (0, K.useState)(o), v = e.dimensions[0]?.formatter, y = e.dimensions.filter((e) => e.role === c.FILTER_DIMENSION), b = y.length > 1, x = t.map((e) => e.dimension), [S, C] = fe(e), { quickSelection: w } = St(e), T = e.filterSettings?.filterStyle, D;
|
|
3458
|
+
if (T) {
|
|
3459
|
+
let { backgroundColor: e, ...t } = T;
|
|
3460
|
+
D = {
|
|
3461
|
+
...t,
|
|
3462
|
+
..."backgroundColor" in T ? { backgroundColor: e ?? void 0 } : {}
|
|
3463
|
+
};
|
|
3464
|
+
}
|
|
3465
|
+
let O = e.filterSettings?.defaultNotState ? J.FilterOperator.NotInList : J.FilterOperator.InList, k = E(r ? [] : b ? y.map((e, n) => ({
|
|
3466
|
+
dataItem: e.dataItem,
|
|
3467
|
+
dateLevel: e.dateLevel ?? void 0,
|
|
3468
|
+
datePart: e.datePart ?? void 0,
|
|
3469
|
+
values: t.map((e) => e.dimensionValues ? e.dimensionValues[n] : [e.dimension, e.childDimension][n]).filter((e) => e !== void 0)
|
|
3470
|
+
})) : [{
|
|
3471
|
+
dataItem: e.dimensions[0]?.dataItem,
|
|
3472
|
+
dateLevel: e.dimensions[0]?.dateLevel ?? void 0,
|
|
3473
|
+
datePart: e.dimensions[0]?.datePart ?? void 0,
|
|
3474
|
+
values: x
|
|
3475
|
+
}], {
|
|
3476
|
+
disabled: r,
|
|
3477
|
+
state: w ? J.SelectionState.APPLIED : void 0,
|
|
3478
|
+
defaultOperator: O,
|
|
3479
|
+
commitHistory: w
|
|
3480
|
+
}), A = (0, K.useMemo)(() => (0, Ct.default)((e) => s(e), 300), [s]), { onClear: j, onClick: M, onDeselectAll: F, onSelectExcluded: L, onSelectAll: R, onNotOperatorChange: ee, state: z, operators: te, field: ne } = k[0] ?? N, re = z.pending ?? z.applied ?? [], { isFieldLocked: B = !1, toggleFieldLock: ie } = I(ne ?? void 0), ae = P(ne ? [ne] : []), oe = (e) => {
|
|
3481
|
+
_(e), A(e);
|
|
3482
|
+
}, se = (0, K.useMemo)(() => B ? t.filter((e) => (z.pending ?? z.applied ?? []).includes(e.dimension)) : t, [
|
|
3483
|
+
t,
|
|
3484
|
+
B,
|
|
3485
|
+
z.pending,
|
|
3486
|
+
z.applied
|
|
3487
|
+
]);
|
|
3488
|
+
return /* @__PURE__ */ (0, q.jsx)(be, {
|
|
3489
|
+
noBorder: !0,
|
|
3490
|
+
filterStyle: Ci,
|
|
3491
|
+
fontSize: e.filterSettings?.fontStyle?.fontSize ?? n.fontSize,
|
|
3492
|
+
children: /* @__PURE__ */ (0, q.jsx)(de.Provider, {
|
|
3493
|
+
value: {
|
|
3494
|
+
appliedOperator: te.applied,
|
|
3495
|
+
pendingOperator: te.pending
|
|
3496
|
+
},
|
|
3497
|
+
children: /* @__PURE__ */ (0, q.jsx)(xi, {
|
|
3498
|
+
isOpen: m,
|
|
3499
|
+
isPreview: r,
|
|
3500
|
+
vSpec: e,
|
|
3501
|
+
vTheme: i,
|
|
3502
|
+
allValuesLoaded: l,
|
|
3503
|
+
localSearch: g,
|
|
3504
|
+
searchTerm: o,
|
|
3505
|
+
headerElement: p,
|
|
3506
|
+
setIsOpen: h,
|
|
3507
|
+
onSearchChange: oe,
|
|
3508
|
+
setLocalSearch: _,
|
|
3509
|
+
loadMoreData: a,
|
|
3510
|
+
filterValues: se,
|
|
3511
|
+
hierarchicalMode: b,
|
|
3512
|
+
filterDimensionsCount: y.length,
|
|
3513
|
+
dimensionSelectionMethods: k,
|
|
3514
|
+
selectionMode: e.filterSettings?.selectionMode ?? u.selectionMode,
|
|
3515
|
+
onNotOperatorChange: ee,
|
|
3516
|
+
onClick: M,
|
|
3517
|
+
onDeselectAll: F,
|
|
3518
|
+
onSelectAll: R,
|
|
3519
|
+
onClear: j,
|
|
3520
|
+
onSelectExcluded: L,
|
|
3521
|
+
state: z,
|
|
3522
|
+
onLockClick: ie,
|
|
3523
|
+
isLocked: B,
|
|
3524
|
+
isSingleSelectField: ae,
|
|
3525
|
+
isSearching: d,
|
|
3526
|
+
isApplyingFilters: f,
|
|
3527
|
+
children: /* @__PURE__ */ (0, q.jsx)("div", {
|
|
3528
|
+
ref: p,
|
|
3529
|
+
style: { height: "100%" },
|
|
3530
|
+
children: /* @__PURE__ */ (0, q.jsx)(me, {
|
|
3531
|
+
measureTitle: C ?? "",
|
|
3532
|
+
dimensionTitle: S,
|
|
3533
|
+
isOpen: m,
|
|
3534
|
+
onToggle: () => h(!m),
|
|
3535
|
+
dimensionFormatter: v,
|
|
3536
|
+
selectedValues: re,
|
|
3537
|
+
fontStyle: e.filterSettings?.fontStyle ?? {},
|
|
3538
|
+
filterStyle: D,
|
|
3539
|
+
responsive: e?.filterSettings?.responsive,
|
|
3540
|
+
isLocked: B
|
|
3541
|
+
})
|
|
3542
|
+
})
|
|
3543
|
+
})
|
|
3544
|
+
})
|
|
3545
|
+
});
|
|
3546
|
+
}, Ti = [
|
|
3547
|
+
{ value: "Value 1" },
|
|
3548
|
+
{ value: "Value 2" },
|
|
3549
|
+
{ value: "Value 3" },
|
|
3550
|
+
{ value: "Value 4" },
|
|
3551
|
+
{ value: "Value 5" },
|
|
3552
|
+
{ value: "Value 6" },
|
|
3553
|
+
{ value: "Value 7" },
|
|
3554
|
+
{ value: "Value 8" },
|
|
3555
|
+
{ value: "Value 9" },
|
|
3556
|
+
{ value: "Value 10" },
|
|
3557
|
+
{ value: "Value 11" }
|
|
3558
|
+
], Ei = ({ vSpec: e, vTheme: n }) => {
|
|
3559
|
+
let r = Ti.map((e) => ({ dimension: e.value })), i = {
|
|
3560
|
+
...e,
|
|
3561
|
+
dimensions: [{
|
|
3562
|
+
dataItem: {
|
|
3563
|
+
internalKey: "filter-preview",
|
|
3564
|
+
uniqueSignature: o(),
|
|
3565
|
+
schema: "excel",
|
|
3566
|
+
view: "pokemon",
|
|
3567
|
+
name: "city",
|
|
3568
|
+
dataType: J.FieldType.STRING,
|
|
3569
|
+
type: s.Dimension
|
|
3570
|
+
},
|
|
3571
|
+
label: "Dimension"
|
|
3572
|
+
}],
|
|
3573
|
+
measures: []
|
|
3574
|
+
};
|
|
3575
|
+
return e.filterSettings?.mode === t.Dropdown ? /* @__PURE__ */ (0, q.jsx)(wi, {
|
|
3576
|
+
allValuesLoaded: !0,
|
|
3577
|
+
vSpec: i,
|
|
3578
|
+
vTheme: n,
|
|
3579
|
+
filterValues: r,
|
|
3580
|
+
isPreview: !0,
|
|
3581
|
+
searchTerm: "",
|
|
3582
|
+
setSearchTerm: () => null,
|
|
3583
|
+
loadMoreData: () => void 0
|
|
3584
|
+
}) : /* @__PURE__ */ (0, q.jsx)(vi, {
|
|
3585
|
+
allValuesLoaded: !0,
|
|
3586
|
+
vSpec: i,
|
|
3587
|
+
vTheme: n,
|
|
3588
|
+
filterValues: r,
|
|
3589
|
+
isPreview: !0,
|
|
3590
|
+
searchTerm: "",
|
|
3591
|
+
setSearchTerm: () => null,
|
|
3592
|
+
loadMoreData: () => void 0
|
|
3593
|
+
});
|
|
3594
|
+
}, Di = v(({ vSpec: e, filterValues: n = [], vTheme: r, loadMoreData: i, searchTerm: a, setSearchTerm: o, allValuesLoaded: s, isSearching: c = !1, isApplyingFilters: u = !1 }) => {
|
|
3595
|
+
let d = O();
|
|
3596
|
+
if ((0, K.useEffect)(() => {
|
|
3597
|
+
e?.dimensions?.length < 2 && d();
|
|
3598
|
+
}, [e]), !e?.dimensions?.length && e?.dimensions !== void 0) return /* @__PURE__ */ (0, q.jsx)(Ei, {
|
|
3599
|
+
vSpec: {
|
|
3600
|
+
...e,
|
|
3601
|
+
filterSettings: {
|
|
3602
|
+
...e.filterSettings,
|
|
3603
|
+
mode: e.filterSettings?.mode ?? t.Listbox,
|
|
3604
|
+
source: e.filterSettings?.source ?? l.Engine,
|
|
3605
|
+
fontStyle: e.filterSettings?.fontStyle ?? {}
|
|
3606
|
+
}
|
|
3607
|
+
},
|
|
3608
|
+
vTheme: r
|
|
3609
|
+
});
|
|
3610
|
+
if (e?.dimensions === void 0 || !e?.filterSettings?.mode || !e?.filterSettings?.source) return null;
|
|
3611
|
+
switch (e.filterSettings.mode) {
|
|
3612
|
+
case t.Image: return null;
|
|
3613
|
+
case t.Dropdown: return /* @__PURE__ */ (0, q.jsx)(wi, {
|
|
3614
|
+
allValuesLoaded: s,
|
|
3615
|
+
vSpec: e,
|
|
3616
|
+
vTheme: r,
|
|
3617
|
+
filterValues: n,
|
|
3618
|
+
loadMoreData: i,
|
|
3619
|
+
searchTerm: a,
|
|
3620
|
+
setSearchTerm: o,
|
|
3621
|
+
isSearching: c,
|
|
3622
|
+
isApplyingFilters: u
|
|
3623
|
+
});
|
|
3624
|
+
case t.Listbox:
|
|
3625
|
+
default: return /* @__PURE__ */ (0, q.jsx)(vi, {
|
|
3626
|
+
allValuesLoaded: s,
|
|
3627
|
+
vSpec: e,
|
|
3628
|
+
vTheme: r,
|
|
3629
|
+
filterValues: n,
|
|
3630
|
+
loadMoreData: i,
|
|
3631
|
+
searchTerm: a,
|
|
3632
|
+
setSearchTerm: o,
|
|
3633
|
+
isSearching: c,
|
|
3634
|
+
isApplyingFilters: u
|
|
3635
|
+
});
|
|
3636
|
+
}
|
|
3637
|
+
});
|
|
3638
|
+
export { Di as Filter };
|