@smart-factor/gem-ui-components 0.0.90 → 0.0.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Drawer-Q3D0v6B2.js +2028 -0
- package/dist/SignEditor.js +14323 -14351
- package/dist/Stack-CdVfRhco.js +7503 -0
- package/dist/Tree-xeWEfulP.js +3135 -0
- package/dist/components/AccordionSummary/AccordionSummary.d.ts +0 -1
- package/dist/components/AccordionSummary/AccordionSummary.stories.d.ts +0 -1
- package/dist/components/AccordionSummary/AccordionSummary.styles.d.ts +4 -5
- package/dist/components/Button/Button.d.ts +0 -2
- package/dist/components/Button/Button.stories.d.ts +0 -1
- package/dist/components/Button/Button.styles.d.ts +3 -4
- package/dist/components/Button/ButtonAdd.d.ts +0 -1
- package/dist/components/ButtonPreviewAttachment/ButtonPreviewAttachment.d.ts +0 -1
- package/dist/components/ButtonPreviewAttachment/ButtonPreviewAttachment.stories.d.ts +0 -1
- package/dist/components/ButtonWithIcon/ButtonWithIcon.d.ts +0 -1
- package/dist/components/ButtonWithIcon/ButtonWithIcon.stories.d.ts +0 -1
- package/dist/components/Dialog/Dialog.d.ts +0 -1
- package/dist/components/Dialog/Dialog.stories.d.ts +34 -4
- package/dist/components/Dialog/Dialog.styles.d.ts +5 -6
- package/dist/components/Dialog/types.d.ts +0 -1
- package/dist/components/Dialogs/ConfirmDialog/ConfirmDialog.d.ts +0 -1
- package/dist/components/Dialogs/ConfirmDialog/ConfirmDialog.styles.d.ts +0 -1
- package/dist/components/Dialogs/EditDialog/EditDialog.d.ts +0 -1
- package/dist/components/Dialogs/EditDialog/EditDialog.styles.d.ts +0 -1
- package/dist/components/Drawer/Drawer.d.ts +0 -1
- package/dist/components/Drawer/Drawer.stories.d.ts +0 -1
- package/dist/components/Drawer/DrawerContent.d.ts +0 -1
- package/dist/components/Drawer/DrawerFooter.d.ts +0 -1
- package/dist/components/Drawer/DrawerHeader.d.ts +0 -1
- package/dist/components/Drawer/index.js +1 -1
- package/dist/components/Dropzone/Dropzone.stories.d.ts +0 -1
- package/dist/components/Dropzone/Dropzone.styles.d.ts +4 -5
- package/dist/components/Dropzone/DropzoneField.d.ts +0 -1
- package/dist/components/ElementsPicker/ElementsPicker.d.ts +0 -1
- package/dist/components/ElementsPicker/ElementsPicker.stories.d.ts +21 -4
- package/dist/components/ElementsPicker/ElementsPickerElement.d.ts +0 -1
- package/dist/components/FixedActionsBottomPanel/FixedActionsBottomPanel.d.ts +0 -1
- package/dist/components/FixedActionsBottomPanel/FixedActionsBottomPanel.stories.d.ts +0 -1
- package/dist/components/FixedActionsBottomPanel/FixedActionsBottomPanel.styles.d.ts +1 -2
- package/dist/components/FormComponents/Autocomplete/Autocomplete.d.ts +0 -1
- package/dist/components/FormComponents/Autocomplete/Autocomplete.stories.d.ts +0 -1
- package/dist/components/FormComponents/Autocomplete/Autocomplete.styles.d.ts +0 -1
- package/dist/components/FormComponents/Autocomplete/types.d.ts +0 -1
- package/dist/components/FormComponents/ContextualSearch/ContextualSearch.d.ts +0 -1
- package/dist/components/FormComponents/ContextualSearch/ContextualSearch.stories.d.ts +0 -1
- package/dist/components/FormComponents/ContextualSearch/ContextualSearch.styles.d.ts +1 -2
- package/dist/components/FormComponents/ContextualSearch/ContextualSearchControlled.d.ts +0 -1
- package/dist/components/FormComponents/ContextualSearch/ContextualSearchListListbox.d.ts +0 -1
- package/dist/components/FormComponents/ContextualSearch/mock.d.ts +0 -1
- package/dist/components/FormComponents/DatePicker/DatePicker.d.ts +0 -1
- package/dist/components/FormComponents/DatePicker/DatePicker.stories.d.ts +22 -4
- package/dist/components/FormComponents/DatePicker/DatePicker.styles.d.ts +2 -3
- package/dist/components/FormComponents/DateTimePicker/DateTimePicker.d.ts +0 -1
- package/dist/components/FormComponents/DateTimePicker/DateTimePicker.stories.d.ts +22 -4
- package/dist/components/FormComponents/DateTimePicker/DateTimePicker.styles.d.ts +2 -3
- package/dist/components/FormComponents/Input/Input.d.ts +0 -1
- package/dist/components/FormComponents/Input/Input.stories.d.ts +0 -1
- package/dist/components/FormComponents/RadioChips/RadioChips.d.ts +1 -3
- package/dist/components/FormComponents/RadioChips/RadioChips.stories.d.ts +22 -4
- package/dist/components/FormComponents/RadioChips/RadioChips.styles.d.ts +3 -4
- package/dist/components/FormComponents/SearchInput/SearchInput.d.ts +0 -1
- package/dist/components/FormComponents/SearchInput/SearchInput.stories.d.ts +20 -3
- package/dist/components/FormComponents/Select/Select.d.ts +1 -2
- package/dist/components/FormComponents/Select/Select.stories.d.ts +26 -4
- package/dist/components/FormComponents/Select/Select.styles.d.ts +1 -2
- package/dist/components/FormComponents/TimePicker/TimePicker.d.ts +0 -1
- package/dist/components/FormComponents/TimePicker/TimePicker.stories.d.ts +22 -4
- package/dist/components/FormComponents/TimePicker/TimePicker.styles.d.ts +3 -4
- package/dist/components/Grid/Grid.d.ts +0 -1
- package/dist/components/Grid/types.d.ts +0 -1
- package/dist/components/Grid/useGridInitialState.d.ts +3 -5
- package/dist/components/GridCell/GridCell.d.ts +0 -1
- package/dist/components/LoadingBackdrop/LoadingBackdrop.d.ts +0 -1
- package/dist/components/LoadingBackdrop/LoadingBackdrop.stories.d.ts +0 -1
- package/dist/components/MuiLikeWrapper/MuiLikeWrapper.d.ts +0 -1
- package/dist/components/MuiLikeWrapper/MuiLikeWrapper.stories.d.ts +0 -1
- package/dist/components/MuiLikeWrapper/MuiLikeWrapper.styles.d.ts +3 -4
- package/dist/components/PaginatedPopover/PaginatedPopover.d.ts +0 -1
- package/dist/components/PaginatedPopover/PaginatedPopover.stories.d.ts +0 -1
- package/dist/components/PaginatedPopover/PaginatedPopover.styles.d.ts +8 -9
- package/dist/components/PaginatedPopover/PaginatedPopoverContent.d.ts +2 -3
- package/dist/components/PaginatedPopover/PaginatedPopoverHeader.d.ts +0 -1
- package/dist/components/PaginatedPopover/types.d.ts +0 -1
- package/dist/components/ResizableWrapper/ResizableWrapper.d.ts +0 -1
- package/dist/components/ResizableWrapper/ResizableWrapper.stories.d.ts +0 -1
- package/dist/components/ResizableWrapper/ResizableWrapper.styles.d.ts +2 -3
- package/dist/components/SignEditor/SignEditor.d.ts +0 -1
- package/dist/components/SignEditor/SignEditor.stories.d.ts +0 -1
- package/dist/components/SignEditor/SignEditor.styles.d.ts +12 -11
- package/dist/components/SignEditor/SignEditorCanvas.d.ts +0 -1
- package/dist/components/SignEditor/SignEditorCanvasHeader.d.ts +0 -1
- package/dist/components/SignEditor/SignEditorContext.d.ts +0 -1
- package/dist/components/SignEditor/SignEditorContextProvider.d.ts +0 -1
- package/dist/components/SignEditor/SignEditorEditDialog.d.ts +0 -1
- package/dist/components/SignEditor/SignEditorImage.d.ts +0 -1
- package/dist/components/SignEditor/SignEditorImagesList.d.ts +0 -1
- package/dist/components/SignEditor/SignEditorSaveDialog.d.ts +0 -1
- package/dist/components/SignEditor/useOnSvgSelected.d.ts +0 -1
- package/dist/components/SignEditor/useSaveStencil.d.ts +0 -1
- package/dist/components/SignEditor/useSvgMount.d.ts +0 -1
- package/dist/components/SimpleAutocomplete/SimpleAutocomplete.d.ts +0 -1
- package/dist/components/SimpleAutocomplete/SimpleAutocomplete.stories.d.ts +0 -1
- package/dist/components/SimpleInput/SimpleInput.d.ts +0 -1
- package/dist/components/SimpleInput/SimpleInput.stories.d.ts +0 -1
- package/dist/components/SimpleSelect/SimpleSelect.d.ts +3 -4
- package/dist/components/SimpleSelect/SimpleSelect.stories.d.ts +0 -1
- package/dist/components/Stepper/Stepper.d.ts +0 -1
- package/dist/components/Stepper/Stepper.stories.d.ts +25 -5
- package/dist/components/Stepper/Stepper.styles.d.ts +3 -4
- package/dist/components/StickyContainer/StickyContainer.d.ts +0 -1
- package/dist/components/StickyContainer/StickyContainer.stories.d.ts +0 -1
- package/dist/components/StickyContainer/StickyContainer.styles.d.ts +2 -3
- package/dist/components/SvgImage/SvgImage.d.ts +0 -1
- package/dist/components/SvgImage/SvgImage.styles.d.ts +1 -2
- package/dist/components/TableComponents/ContextMenu/ContextMenu.d.ts +0 -1
- package/dist/components/TableComponents/ContextMenu/ContextMenu.stories.d.ts +0 -1
- package/dist/components/TableComponents/ContextMenu/ContextMenuContext.d.ts +0 -1
- package/dist/components/TableComponents/ContextMenu/ContextMenuItem.d.ts +0 -1
- package/dist/components/TableComponents/ContextMenu/ContextMenuPropsContext/ContextMenuPropsContext.d.ts +0 -1
- package/dist/components/TableComponents/TableActions/TableActions.d.ts +0 -1
- package/dist/components/TableComponents/TableActions/TableActions.stories.d.ts +0 -1
- package/dist/components/TableComponents/TableCustomToolbar/TableCustomToolbar.d.ts +0 -1
- package/dist/components/TableComponents/TableExportButton/TableExportButton.d.ts +0 -1
- package/dist/components/TableComponents/TableRecord/TableRecord.d.ts +0 -1
- package/dist/components/TableComponents/TableWithPagination/TableWithPagination.d.ts +0 -1
- package/dist/components/TableComponents/TableWithPagination/TableWithPagination.stories.d.ts +0 -1
- package/dist/components/TableComponents/TableWithPagination/TableWrapper.d.ts +0 -1
- package/dist/components/TableComponents/TableWithPagination/types.d.ts +0 -1
- package/dist/components/TabsPanel/TabsPanel.d.ts +0 -1
- package/dist/components/TabsPanel/TabsPanel.stories.d.ts +27 -4
- package/dist/components/TabsPanel/TabsPanel.styles.d.ts +7 -8
- package/dist/components/Toast/Toast.stories.d.ts +0 -1
- package/dist/components/Toast/Toast.styles.d.ts +4 -5
- package/dist/components/Toast/ToastContent.d.ts +0 -1
- package/dist/components/Toast/errorToast.d.ts +0 -1
- package/dist/components/Toast/infoToast.d.ts +0 -1
- package/dist/components/Toast/successToast.d.ts +0 -1
- package/dist/components/Tree/Tree.d.ts +0 -1
- package/dist/components/Tree/Tree.stories.d.ts +0 -1
- package/dist/components/Tree/index.js +1 -1
- package/dist/consts/data-grid.d.ts +32 -27
- package/dist/helpers/columns/getBooleanColumn.d.ts +0 -1
- package/dist/helpers/columns/getDateColumn.d.ts +0 -1
- package/dist/helpers/columns/getDateTimeColumn.d.ts +0 -1
- package/dist/helpers/columns/getNumericColumn.d.ts +0 -1
- package/dist/helpers/columns/getStaticColumn.d.ts +0 -1
- package/dist/helpers/columns/getStringColumn.d.ts +0 -1
- package/dist/helpers/date/formatDate.d.ts +0 -1
- package/dist/helpers/date/formatDateTime.d.ts +0 -1
- package/dist/helpers/sortColumns.d.ts +0 -1
- package/dist/helpers/zodTransforms.d.ts +0 -1
- package/dist/hooks/useContextMenu.d.ts +0 -1
- package/dist/hooks/useDataGridInitialState.d.ts +3 -5
- package/dist/hooks/useDataGridState.d.ts +2 -4
- package/dist/hooks/useDebounce.d.ts +1 -1
- package/dist/hooks/useGetFileUrl.d.ts +0 -1
- package/dist/hooks/useTableQuery/getLogicOperator.d.ts +0 -1
- package/dist/hooks/useTableQuery/normalizeFilterModel.d.ts +0 -1
- package/dist/hooks/useTableQuery/useDataGridQueryState.d.ts +0 -1
- package/dist/hooks/useTableQuery/useExportGridAsExcel.d.ts +0 -1
- package/dist/hooks/useTableQuery/useExportToExcel.d.ts +0 -1
- package/dist/hooks/useTableQuery/usePaginationAndSort.d.ts +0 -1
- package/dist/hooks/useTableQuery/useTableFilter.d.ts +0 -1
- package/dist/hooks/useTableQuery/useTableQuery.d.ts +2 -3
- package/dist/licenses.txt +376 -295
- package/dist/main.js +2574 -1949
- package/dist/providers/QueryClientProvider.d.ts +0 -1
- package/dist/services/api.d.ts +0 -1
- package/dist/services/generated/api.d.ts +4 -4
- package/dist/services/mutations/roadSigns/useCreateRoadSignFile.d.ts +0 -1
- package/dist/services/mutations/roadSigns/useCreateRoadSignTemplate.d.ts +0 -1
- package/dist/services/mutations/stencils/useCreateStencil.d.ts +0 -1
- package/dist/services/mutations/stencils/useCreateStencilFile.d.ts +0 -1
- package/dist/services/mutations/stencils/useDeleteStencil.d.ts +0 -1
- package/dist/services/mutations/stencils/useUpdateStencil.d.ts +0 -1
- package/dist/services/mutations/stencils/useUpdateStencilFile.d.ts +0 -1
- package/dist/services/queries/roadSigns/useGetRoadSignNameUnique.d.ts +1 -2
- package/dist/services/queries/roadSigns/useGetRoadSignsByGroupName.d.ts +1 -2
- package/dist/services/queries/roadSigns/useGetRoadSignsGroups.d.ts +1 -2
- package/dist/services/queries/stencils/useGetStencilGroups.d.ts +1 -2
- package/dist/services/queries/stencils/useGetStencils.d.ts +1 -2
- package/dist/theme-Da36hI_g.js +259278 -0
- package/dist/warning-VmSVedfJ.js +88 -0
- package/package.json +62 -52
- package/dist/Drawer-CldXrceX.js +0 -2112
- package/dist/Stack-CU3sSZaK.js +0 -6619
- package/dist/Tree-zB7xEw6c.js +0 -2895
- package/dist/services/generated/api-candidate.d.ts +0 -22942
- package/dist/theme-BwMNxR51.js +0 -262511
- package/dist/useFormControl-v82Vw7n0.js +0 -68
package/dist/Tree-zB7xEw6c.js
DELETED
|
@@ -1,2895 +0,0 @@
|
|
|
1
|
-
import { jsx as w, jsxs as ve } from "react/jsx-runtime";
|
|
2
|
-
import * as x from "react";
|
|
3
|
-
import { createElement as Wt } from "react";
|
|
4
|
-
import { p as fe, q as me, r as U, _ as D, v as nt, O as Jt, A as Gt, w as Le, x as Ht, Q as Yt, l as de, y as Ie, P as r, R as ot, z as ge, D as Qe, U as Qt, I as rt, j as Zt, V as it, b as ue, e as te, t as en, h as tn, k as G, o as nn, J as on, g as rn, H as ce, W as sn, X as st, Y as ie, G as Ze, i as ln, K as an, S as cn, M as dn, N as un } from "./Stack-CU3sSZaK.js";
|
|
5
|
-
import { u as pn, a as fn, b as X } from "./useFormControl-v82Vw7n0.js";
|
|
6
|
-
function mn(e) {
|
|
7
|
-
return fe("MuiCollapse", e);
|
|
8
|
-
}
|
|
9
|
-
me("MuiCollapse", ["root", "horizontal", "vertical", "entered", "hidden", "wrapper", "wrapperInner"]);
|
|
10
|
-
const In = ["addEndListener", "children", "className", "collapsedSize", "component", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "orientation", "style", "timeout", "TransitionComponent"], gn = (e) => {
|
|
11
|
-
const {
|
|
12
|
-
orientation: t,
|
|
13
|
-
classes: n
|
|
14
|
-
} = e, o = {
|
|
15
|
-
root: ["root", `${t}`],
|
|
16
|
-
entered: ["entered"],
|
|
17
|
-
hidden: ["hidden"],
|
|
18
|
-
wrapper: ["wrapper", `${t}`],
|
|
19
|
-
wrapperInner: ["wrapperInner", `${t}`]
|
|
20
|
-
};
|
|
21
|
-
return ge(o, mn, n);
|
|
22
|
-
}, hn = U("div", {
|
|
23
|
-
name: "MuiCollapse",
|
|
24
|
-
slot: "Root",
|
|
25
|
-
overridesResolver: (e, t) => {
|
|
26
|
-
const {
|
|
27
|
-
ownerState: n
|
|
28
|
-
} = e;
|
|
29
|
-
return [t.root, t[n.orientation], n.state === "entered" && t.entered, n.state === "exited" && !n.in && n.collapsedSize === "0px" && t.hidden];
|
|
30
|
-
}
|
|
31
|
-
})(({
|
|
32
|
-
theme: e,
|
|
33
|
-
ownerState: t
|
|
34
|
-
}) => D({
|
|
35
|
-
height: 0,
|
|
36
|
-
overflow: "hidden",
|
|
37
|
-
transition: e.transitions.create("height")
|
|
38
|
-
}, t.orientation === "horizontal" && {
|
|
39
|
-
height: "auto",
|
|
40
|
-
width: 0,
|
|
41
|
-
transition: e.transitions.create("width")
|
|
42
|
-
}, t.state === "entered" && D({
|
|
43
|
-
height: "auto",
|
|
44
|
-
overflow: "visible"
|
|
45
|
-
}, t.orientation === "horizontal" && {
|
|
46
|
-
width: "auto"
|
|
47
|
-
}), t.state === "exited" && !t.in && t.collapsedSize === "0px" && {
|
|
48
|
-
visibility: "hidden"
|
|
49
|
-
})), bn = U("div", {
|
|
50
|
-
name: "MuiCollapse",
|
|
51
|
-
slot: "Wrapper",
|
|
52
|
-
overridesResolver: (e, t) => t.wrapper
|
|
53
|
-
})(({
|
|
54
|
-
ownerState: e
|
|
55
|
-
}) => D({
|
|
56
|
-
// Hack to get children with a negative margin to not falsify the height computation.
|
|
57
|
-
display: "flex",
|
|
58
|
-
width: "100%"
|
|
59
|
-
}, e.orientation === "horizontal" && {
|
|
60
|
-
width: "auto",
|
|
61
|
-
height: "100%"
|
|
62
|
-
})), yn = U("div", {
|
|
63
|
-
name: "MuiCollapse",
|
|
64
|
-
slot: "WrapperInner",
|
|
65
|
-
overridesResolver: (e, t) => t.wrapperInner
|
|
66
|
-
})(({
|
|
67
|
-
ownerState: e
|
|
68
|
-
}) => D({
|
|
69
|
-
width: "100%"
|
|
70
|
-
}, e.orientation === "horizontal" && {
|
|
71
|
-
width: "auto",
|
|
72
|
-
height: "100%"
|
|
73
|
-
})), Ne = /* @__PURE__ */ x.forwardRef(function(t, n) {
|
|
74
|
-
const o = nt({
|
|
75
|
-
props: t,
|
|
76
|
-
name: "MuiCollapse"
|
|
77
|
-
}), {
|
|
78
|
-
addEndListener: l,
|
|
79
|
-
children: p,
|
|
80
|
-
className: c,
|
|
81
|
-
collapsedSize: i = "0px",
|
|
82
|
-
component: u,
|
|
83
|
-
easing: d,
|
|
84
|
-
in: s,
|
|
85
|
-
onEnter: a,
|
|
86
|
-
onEntered: m,
|
|
87
|
-
onEntering: I,
|
|
88
|
-
onExit: h,
|
|
89
|
-
onExited: f,
|
|
90
|
-
onExiting: g,
|
|
91
|
-
orientation: b = "vertical",
|
|
92
|
-
style: y,
|
|
93
|
-
timeout: C = Jt.standard,
|
|
94
|
-
// eslint-disable-next-line react/prop-types
|
|
95
|
-
TransitionComponent: k = Gt
|
|
96
|
-
} = o, T = Le(o, In), v = D({}, o, {
|
|
97
|
-
orientation: b,
|
|
98
|
-
collapsedSize: i
|
|
99
|
-
}), M = gn(v), B = Ht(), K = Yt(), V = x.useRef(null), F = x.useRef(), _ = typeof i == "number" ? `${i}px` : i, j = b === "horizontal", q = j ? "width" : "height", L = x.useRef(null), H = de(n, L), N = (S) => ($) => {
|
|
100
|
-
if (S) {
|
|
101
|
-
const z = L.current;
|
|
102
|
-
$ === void 0 ? S(z) : S(z, $);
|
|
103
|
-
}
|
|
104
|
-
}, W = () => V.current ? V.current[j ? "clientWidth" : "clientHeight"] : 0, P = N((S, $) => {
|
|
105
|
-
V.current && j && (V.current.style.position = "absolute"), S.style[q] = _, a && a(S, $);
|
|
106
|
-
}), O = N((S, $) => {
|
|
107
|
-
const z = W();
|
|
108
|
-
V.current && j && (V.current.style.position = "");
|
|
109
|
-
const {
|
|
110
|
-
duration: A,
|
|
111
|
-
easing: Y
|
|
112
|
-
} = Qe({
|
|
113
|
-
style: y,
|
|
114
|
-
timeout: C,
|
|
115
|
-
easing: d
|
|
116
|
-
}, {
|
|
117
|
-
mode: "enter"
|
|
118
|
-
});
|
|
119
|
-
if (C === "auto") {
|
|
120
|
-
const xe = B.transitions.getAutoHeightDuration(z);
|
|
121
|
-
S.style.transitionDuration = `${xe}ms`, F.current = xe;
|
|
122
|
-
} else
|
|
123
|
-
S.style.transitionDuration = typeof A == "string" ? A : `${A}ms`;
|
|
124
|
-
S.style[q] = `${z}px`, S.style.transitionTimingFunction = Y, I && I(S, $);
|
|
125
|
-
}), ne = N((S, $) => {
|
|
126
|
-
S.style[q] = "auto", m && m(S, $);
|
|
127
|
-
}), ye = N((S) => {
|
|
128
|
-
S.style[q] = `${W()}px`, h && h(S);
|
|
129
|
-
}), Me = N(f), ke = N((S) => {
|
|
130
|
-
const $ = W(), {
|
|
131
|
-
duration: z,
|
|
132
|
-
easing: A
|
|
133
|
-
} = Qe({
|
|
134
|
-
style: y,
|
|
135
|
-
timeout: C,
|
|
136
|
-
easing: d
|
|
137
|
-
}, {
|
|
138
|
-
mode: "exit"
|
|
139
|
-
});
|
|
140
|
-
if (C === "auto") {
|
|
141
|
-
const Y = B.transitions.getAutoHeightDuration($);
|
|
142
|
-
S.style.transitionDuration = `${Y}ms`, F.current = Y;
|
|
143
|
-
} else
|
|
144
|
-
S.style.transitionDuration = typeof z == "string" ? z : `${z}ms`;
|
|
145
|
-
S.style[q] = _, S.style.transitionTimingFunction = A, g && g(S);
|
|
146
|
-
});
|
|
147
|
-
return /* @__PURE__ */ w(k, D({
|
|
148
|
-
in: s,
|
|
149
|
-
onEnter: P,
|
|
150
|
-
onEntered: ne,
|
|
151
|
-
onEntering: O,
|
|
152
|
-
onExit: ye,
|
|
153
|
-
onExited: Me,
|
|
154
|
-
onExiting: ke,
|
|
155
|
-
addEndListener: (S) => {
|
|
156
|
-
C === "auto" && K.start(F.current || 0, S), l && l(L.current, S);
|
|
157
|
-
},
|
|
158
|
-
nodeRef: L,
|
|
159
|
-
timeout: C === "auto" ? null : C
|
|
160
|
-
}, T, {
|
|
161
|
-
children: (S, $) => /* @__PURE__ */ w(hn, D({
|
|
162
|
-
as: u,
|
|
163
|
-
className: Ie(M.root, c, {
|
|
164
|
-
entered: M.entered,
|
|
165
|
-
exited: !s && _ === "0px" && M.hidden
|
|
166
|
-
}[S]),
|
|
167
|
-
style: D({
|
|
168
|
-
[j ? "minWidth" : "minHeight"]: _
|
|
169
|
-
}, y),
|
|
170
|
-
ref: H
|
|
171
|
-
}, $, {
|
|
172
|
-
// `ownerState` is set after `childProps` to override any existing `ownerState` property in `childProps`
|
|
173
|
-
// that might have been forwarded from the Transition component.
|
|
174
|
-
ownerState: D({}, v, {
|
|
175
|
-
state: S
|
|
176
|
-
}),
|
|
177
|
-
children: /* @__PURE__ */ w(bn, {
|
|
178
|
-
ownerState: D({}, v, {
|
|
179
|
-
state: S
|
|
180
|
-
}),
|
|
181
|
-
className: M.wrapper,
|
|
182
|
-
ref: V,
|
|
183
|
-
children: /* @__PURE__ */ w(yn, {
|
|
184
|
-
ownerState: D({}, v, {
|
|
185
|
-
state: S
|
|
186
|
-
}),
|
|
187
|
-
className: M.wrapperInner,
|
|
188
|
-
children: p
|
|
189
|
-
})
|
|
190
|
-
})
|
|
191
|
-
}))
|
|
192
|
-
}));
|
|
193
|
-
});
|
|
194
|
-
process.env.NODE_ENV !== "production" && (Ne.propTypes = {
|
|
195
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
196
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
197
|
-
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
198
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
199
|
-
/**
|
|
200
|
-
* Add a custom transition end trigger. Called with the transitioning DOM
|
|
201
|
-
* node and a done callback. Allows for more fine grained transition end
|
|
202
|
-
* logic. Note: Timeouts are still used as a fallback if provided.
|
|
203
|
-
*/
|
|
204
|
-
addEndListener: r.func,
|
|
205
|
-
/**
|
|
206
|
-
* The content node to be collapsed.
|
|
207
|
-
*/
|
|
208
|
-
children: r.node,
|
|
209
|
-
/**
|
|
210
|
-
* Override or extend the styles applied to the component.
|
|
211
|
-
*/
|
|
212
|
-
classes: r.object,
|
|
213
|
-
/**
|
|
214
|
-
* @ignore
|
|
215
|
-
*/
|
|
216
|
-
className: r.string,
|
|
217
|
-
/**
|
|
218
|
-
* The width (horizontal) or height (vertical) of the container when collapsed.
|
|
219
|
-
* @default '0px'
|
|
220
|
-
*/
|
|
221
|
-
collapsedSize: r.oneOfType([r.number, r.string]),
|
|
222
|
-
/**
|
|
223
|
-
* The component used for the root node.
|
|
224
|
-
* Either a string to use a HTML element or a component.
|
|
225
|
-
*/
|
|
226
|
-
component: ot,
|
|
227
|
-
/**
|
|
228
|
-
* The transition timing function.
|
|
229
|
-
* You may specify a single easing or a object containing enter and exit values.
|
|
230
|
-
*/
|
|
231
|
-
easing: r.oneOfType([r.shape({
|
|
232
|
-
enter: r.string,
|
|
233
|
-
exit: r.string
|
|
234
|
-
}), r.string]),
|
|
235
|
-
/**
|
|
236
|
-
* If `true`, the component will transition in.
|
|
237
|
-
*/
|
|
238
|
-
in: r.bool,
|
|
239
|
-
/**
|
|
240
|
-
* @ignore
|
|
241
|
-
*/
|
|
242
|
-
onEnter: r.func,
|
|
243
|
-
/**
|
|
244
|
-
* @ignore
|
|
245
|
-
*/
|
|
246
|
-
onEntered: r.func,
|
|
247
|
-
/**
|
|
248
|
-
* @ignore
|
|
249
|
-
*/
|
|
250
|
-
onEntering: r.func,
|
|
251
|
-
/**
|
|
252
|
-
* @ignore
|
|
253
|
-
*/
|
|
254
|
-
onExit: r.func,
|
|
255
|
-
/**
|
|
256
|
-
* @ignore
|
|
257
|
-
*/
|
|
258
|
-
onExited: r.func,
|
|
259
|
-
/**
|
|
260
|
-
* @ignore
|
|
261
|
-
*/
|
|
262
|
-
onExiting: r.func,
|
|
263
|
-
/**
|
|
264
|
-
* The transition orientation.
|
|
265
|
-
* @default 'vertical'
|
|
266
|
-
*/
|
|
267
|
-
orientation: r.oneOf(["horizontal", "vertical"]),
|
|
268
|
-
/**
|
|
269
|
-
* @ignore
|
|
270
|
-
*/
|
|
271
|
-
style: r.object,
|
|
272
|
-
/**
|
|
273
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
274
|
-
*/
|
|
275
|
-
sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object]),
|
|
276
|
-
/**
|
|
277
|
-
* The duration for the transition, in milliseconds.
|
|
278
|
-
* You may specify a single timeout for all transitions, or individually with an object.
|
|
279
|
-
*
|
|
280
|
-
* Set to 'auto' to automatically calculate transition time based on height.
|
|
281
|
-
* @default duration.standard
|
|
282
|
-
*/
|
|
283
|
-
timeout: r.oneOfType([r.oneOf(["auto"]), r.number, r.shape({
|
|
284
|
-
appear: r.number,
|
|
285
|
-
enter: r.number,
|
|
286
|
-
exit: r.number
|
|
287
|
-
})])
|
|
288
|
-
});
|
|
289
|
-
Ne.muiSupportAuto = !0;
|
|
290
|
-
function xn(e) {
|
|
291
|
-
return fe("PrivateSwitchBase", e);
|
|
292
|
-
}
|
|
293
|
-
me("PrivateSwitchBase", ["root", "checked", "disabled", "input", "edgeStart", "edgeEnd"]);
|
|
294
|
-
const En = ["autoFocus", "checked", "checkedIcon", "className", "defaultChecked", "disabled", "disableFocusRipple", "edge", "icon", "id", "inputProps", "inputRef", "name", "onBlur", "onChange", "onFocus", "readOnly", "required", "tabIndex", "type", "value"], Cn = (e) => {
|
|
295
|
-
const {
|
|
296
|
-
classes: t,
|
|
297
|
-
checked: n,
|
|
298
|
-
disabled: o,
|
|
299
|
-
edge: l
|
|
300
|
-
} = e, p = {
|
|
301
|
-
root: ["root", n && "checked", o && "disabled", l && `edge${ue(l)}`],
|
|
302
|
-
input: ["input"]
|
|
303
|
-
};
|
|
304
|
-
return ge(p, xn, t);
|
|
305
|
-
}, Tn = U(Qt)(({
|
|
306
|
-
ownerState: e
|
|
307
|
-
}) => D({
|
|
308
|
-
padding: 9,
|
|
309
|
-
borderRadius: "50%"
|
|
310
|
-
}, e.edge === "start" && {
|
|
311
|
-
marginLeft: e.size === "small" ? -3 : -12
|
|
312
|
-
}, e.edge === "end" && {
|
|
313
|
-
marginRight: e.size === "small" ? -3 : -12
|
|
314
|
-
})), wn = U("input", {
|
|
315
|
-
shouldForwardProp: rt
|
|
316
|
-
})({
|
|
317
|
-
cursor: "inherit",
|
|
318
|
-
position: "absolute",
|
|
319
|
-
opacity: 0,
|
|
320
|
-
width: "100%",
|
|
321
|
-
height: "100%",
|
|
322
|
-
top: 0,
|
|
323
|
-
left: 0,
|
|
324
|
-
margin: 0,
|
|
325
|
-
padding: 0,
|
|
326
|
-
zIndex: 1
|
|
327
|
-
}), lt = /* @__PURE__ */ x.forwardRef(function(t, n) {
|
|
328
|
-
const {
|
|
329
|
-
autoFocus: o,
|
|
330
|
-
checked: l,
|
|
331
|
-
checkedIcon: p,
|
|
332
|
-
className: c,
|
|
333
|
-
defaultChecked: i,
|
|
334
|
-
disabled: u,
|
|
335
|
-
disableFocusRipple: d = !1,
|
|
336
|
-
edge: s = !1,
|
|
337
|
-
icon: a,
|
|
338
|
-
id: m,
|
|
339
|
-
inputProps: I,
|
|
340
|
-
inputRef: h,
|
|
341
|
-
name: f,
|
|
342
|
-
onBlur: g,
|
|
343
|
-
onChange: b,
|
|
344
|
-
onFocus: y,
|
|
345
|
-
readOnly: C,
|
|
346
|
-
required: k = !1,
|
|
347
|
-
tabIndex: T,
|
|
348
|
-
type: v,
|
|
349
|
-
value: M
|
|
350
|
-
} = t, B = Le(t, En), [K, V] = Zt({
|
|
351
|
-
controlled: l,
|
|
352
|
-
default: !!i,
|
|
353
|
-
name: "SwitchBase",
|
|
354
|
-
state: "checked"
|
|
355
|
-
}), F = pn(), _ = (P) => {
|
|
356
|
-
y && y(P), F && F.onFocus && F.onFocus(P);
|
|
357
|
-
}, j = (P) => {
|
|
358
|
-
g && g(P), F && F.onBlur && F.onBlur(P);
|
|
359
|
-
}, q = (P) => {
|
|
360
|
-
if (P.nativeEvent.defaultPrevented)
|
|
361
|
-
return;
|
|
362
|
-
const O = P.target.checked;
|
|
363
|
-
V(O), b && b(P, O);
|
|
364
|
-
};
|
|
365
|
-
let L = u;
|
|
366
|
-
F && typeof L > "u" && (L = F.disabled);
|
|
367
|
-
const H = v === "checkbox" || v === "radio", N = D({}, t, {
|
|
368
|
-
checked: K,
|
|
369
|
-
disabled: L,
|
|
370
|
-
disableFocusRipple: d,
|
|
371
|
-
edge: s
|
|
372
|
-
}), W = Cn(N);
|
|
373
|
-
return /* @__PURE__ */ ve(Tn, D({
|
|
374
|
-
component: "span",
|
|
375
|
-
className: Ie(W.root, c),
|
|
376
|
-
centerRipple: !0,
|
|
377
|
-
focusRipple: !d,
|
|
378
|
-
disabled: L,
|
|
379
|
-
tabIndex: null,
|
|
380
|
-
role: void 0,
|
|
381
|
-
onFocus: _,
|
|
382
|
-
onBlur: j,
|
|
383
|
-
ownerState: N,
|
|
384
|
-
ref: n
|
|
385
|
-
}, B, {
|
|
386
|
-
children: [/* @__PURE__ */ w(wn, D({
|
|
387
|
-
autoFocus: o,
|
|
388
|
-
checked: l,
|
|
389
|
-
defaultChecked: i,
|
|
390
|
-
className: W.input,
|
|
391
|
-
disabled: L,
|
|
392
|
-
id: H ? m : void 0,
|
|
393
|
-
name: f,
|
|
394
|
-
onChange: q,
|
|
395
|
-
readOnly: C,
|
|
396
|
-
ref: h,
|
|
397
|
-
required: k,
|
|
398
|
-
ownerState: N,
|
|
399
|
-
tabIndex: T,
|
|
400
|
-
type: v
|
|
401
|
-
}, v === "checkbox" && M === void 0 ? {} : {
|
|
402
|
-
value: M
|
|
403
|
-
}, I)), K ? p : a]
|
|
404
|
-
}));
|
|
405
|
-
});
|
|
406
|
-
process.env.NODE_ENV !== "production" && (lt.propTypes = {
|
|
407
|
-
/**
|
|
408
|
-
* If `true`, the `input` element is focused during the first mount.
|
|
409
|
-
*/
|
|
410
|
-
autoFocus: r.bool,
|
|
411
|
-
/**
|
|
412
|
-
* If `true`, the component is checked.
|
|
413
|
-
*/
|
|
414
|
-
checked: r.bool,
|
|
415
|
-
/**
|
|
416
|
-
* The icon to display when the component is checked.
|
|
417
|
-
*/
|
|
418
|
-
checkedIcon: r.node.isRequired,
|
|
419
|
-
/**
|
|
420
|
-
* Override or extend the styles applied to the component.
|
|
421
|
-
*/
|
|
422
|
-
classes: r.object,
|
|
423
|
-
/**
|
|
424
|
-
* @ignore
|
|
425
|
-
*/
|
|
426
|
-
className: r.string,
|
|
427
|
-
/**
|
|
428
|
-
* @ignore
|
|
429
|
-
*/
|
|
430
|
-
defaultChecked: r.bool,
|
|
431
|
-
/**
|
|
432
|
-
* If `true`, the component is disabled.
|
|
433
|
-
*/
|
|
434
|
-
disabled: r.bool,
|
|
435
|
-
/**
|
|
436
|
-
* If `true`, the keyboard focus ripple is disabled.
|
|
437
|
-
* @default false
|
|
438
|
-
*/
|
|
439
|
-
disableFocusRipple: r.bool,
|
|
440
|
-
/**
|
|
441
|
-
* If given, uses a negative margin to counteract the padding on one
|
|
442
|
-
* side (this is often helpful for aligning the left or right
|
|
443
|
-
* side of the icon with content above or below, without ruining the border
|
|
444
|
-
* size and shape).
|
|
445
|
-
* @default false
|
|
446
|
-
*/
|
|
447
|
-
edge: r.oneOf(["end", "start", !1]),
|
|
448
|
-
/**
|
|
449
|
-
* The icon to display when the component is unchecked.
|
|
450
|
-
*/
|
|
451
|
-
icon: r.node.isRequired,
|
|
452
|
-
/**
|
|
453
|
-
* The id of the `input` element.
|
|
454
|
-
*/
|
|
455
|
-
id: r.string,
|
|
456
|
-
/**
|
|
457
|
-
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
|
|
458
|
-
*/
|
|
459
|
-
inputProps: r.object,
|
|
460
|
-
/**
|
|
461
|
-
* Pass a ref to the `input` element.
|
|
462
|
-
*/
|
|
463
|
-
inputRef: it,
|
|
464
|
-
/*
|
|
465
|
-
* @ignore
|
|
466
|
-
*/
|
|
467
|
-
name: r.string,
|
|
468
|
-
/**
|
|
469
|
-
* @ignore
|
|
470
|
-
*/
|
|
471
|
-
onBlur: r.func,
|
|
472
|
-
/**
|
|
473
|
-
* Callback fired when the state is changed.
|
|
474
|
-
*
|
|
475
|
-
* @param {object} event The event source of the callback.
|
|
476
|
-
* You can pull out the new checked state by accessing `event.target.checked` (boolean).
|
|
477
|
-
*/
|
|
478
|
-
onChange: r.func,
|
|
479
|
-
/**
|
|
480
|
-
* @ignore
|
|
481
|
-
*/
|
|
482
|
-
onFocus: r.func,
|
|
483
|
-
/**
|
|
484
|
-
* It prevents the user from changing the value of the field
|
|
485
|
-
* (not from interacting with the field).
|
|
486
|
-
*/
|
|
487
|
-
readOnly: r.bool,
|
|
488
|
-
/**
|
|
489
|
-
* If `true`, the `input` element is required.
|
|
490
|
-
*/
|
|
491
|
-
required: r.bool,
|
|
492
|
-
/**
|
|
493
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
494
|
-
*/
|
|
495
|
-
sx: r.object,
|
|
496
|
-
/**
|
|
497
|
-
* @ignore
|
|
498
|
-
*/
|
|
499
|
-
tabIndex: r.oneOfType([r.number, r.string]),
|
|
500
|
-
/**
|
|
501
|
-
* The input component prop `type`.
|
|
502
|
-
*/
|
|
503
|
-
type: r.string.isRequired,
|
|
504
|
-
/**
|
|
505
|
-
* The value of the component.
|
|
506
|
-
*/
|
|
507
|
-
value: r.any
|
|
508
|
-
});
|
|
509
|
-
const vn = te(/* @__PURE__ */ w("path", {
|
|
510
|
-
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"
|
|
511
|
-
}), "CheckBoxOutlineBlank"), Sn = te(/* @__PURE__ */ w("path", {
|
|
512
|
-
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"
|
|
513
|
-
}), "CheckBox"), Rn = te(/* @__PURE__ */ w("path", {
|
|
514
|
-
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"
|
|
515
|
-
}), "IndeterminateCheckBox");
|
|
516
|
-
function Mn(e) {
|
|
517
|
-
return fe("MuiCheckbox", e);
|
|
518
|
-
}
|
|
519
|
-
const Ae = me("MuiCheckbox", ["root", "checked", "disabled", "indeterminate", "colorPrimary", "colorSecondary", "sizeSmall", "sizeMedium"]), kn = ["checkedIcon", "color", "icon", "indeterminate", "indeterminateIcon", "inputProps", "size", "className"], Pn = (e) => {
|
|
520
|
-
const {
|
|
521
|
-
classes: t,
|
|
522
|
-
indeterminate: n,
|
|
523
|
-
color: o,
|
|
524
|
-
size: l
|
|
525
|
-
} = e, p = {
|
|
526
|
-
root: ["root", n && "indeterminate", `color${ue(o)}`, `size${ue(l)}`]
|
|
527
|
-
}, c = ge(p, Mn, t);
|
|
528
|
-
return D({}, t, c);
|
|
529
|
-
}, On = U(lt, {
|
|
530
|
-
shouldForwardProp: (e) => rt(e) || e === "classes",
|
|
531
|
-
name: "MuiCheckbox",
|
|
532
|
-
slot: "Root",
|
|
533
|
-
overridesResolver: (e, t) => {
|
|
534
|
-
const {
|
|
535
|
-
ownerState: n
|
|
536
|
-
} = e;
|
|
537
|
-
return [t.root, n.indeterminate && t.indeterminate, t[`size${ue(n.size)}`], n.color !== "default" && t[`color${ue(n.color)}`]];
|
|
538
|
-
}
|
|
539
|
-
})(({
|
|
540
|
-
theme: e,
|
|
541
|
-
ownerState: t
|
|
542
|
-
}) => D({
|
|
543
|
-
color: (e.vars || e).palette.text.secondary
|
|
544
|
-
}, !t.disableRipple && {
|
|
545
|
-
"&:hover": {
|
|
546
|
-
backgroundColor: e.vars ? `rgba(${t.color === "default" ? e.vars.palette.action.activeChannel : e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})` : en(t.color === "default" ? e.palette.action.active : e.palette[t.color].main, e.palette.action.hoverOpacity),
|
|
547
|
-
// Reset on touch devices, it doesn't add specificity
|
|
548
|
-
"@media (hover: none)": {
|
|
549
|
-
backgroundColor: "transparent"
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
}, t.color !== "default" && {
|
|
553
|
-
[`&.${Ae.checked}, &.${Ae.indeterminate}`]: {
|
|
554
|
-
color: (e.vars || e).palette[t.color].main
|
|
555
|
-
},
|
|
556
|
-
[`&.${Ae.disabled}`]: {
|
|
557
|
-
color: (e.vars || e).palette.action.disabled
|
|
558
|
-
}
|
|
559
|
-
})), Dn = /* @__PURE__ */ w(Sn, {}), Vn = /* @__PURE__ */ w(vn, {}), An = /* @__PURE__ */ w(Rn, {}), at = /* @__PURE__ */ x.forwardRef(function(t, n) {
|
|
560
|
-
var o, l;
|
|
561
|
-
const p = nt({
|
|
562
|
-
props: t,
|
|
563
|
-
name: "MuiCheckbox"
|
|
564
|
-
}), {
|
|
565
|
-
checkedIcon: c = Dn,
|
|
566
|
-
color: i = "primary",
|
|
567
|
-
icon: u = Vn,
|
|
568
|
-
indeterminate: d = !1,
|
|
569
|
-
indeterminateIcon: s = An,
|
|
570
|
-
inputProps: a,
|
|
571
|
-
size: m = "medium",
|
|
572
|
-
className: I
|
|
573
|
-
} = p, h = Le(p, kn), f = d ? s : u, g = d ? s : c, b = D({}, p, {
|
|
574
|
-
color: i,
|
|
575
|
-
indeterminate: d,
|
|
576
|
-
size: m
|
|
577
|
-
}), y = Pn(b);
|
|
578
|
-
return /* @__PURE__ */ w(On, D({
|
|
579
|
-
type: "checkbox",
|
|
580
|
-
inputProps: D({
|
|
581
|
-
"data-indeterminate": d
|
|
582
|
-
}, a),
|
|
583
|
-
icon: /* @__PURE__ */ x.cloneElement(f, {
|
|
584
|
-
fontSize: (o = f.props.fontSize) != null ? o : m
|
|
585
|
-
}),
|
|
586
|
-
checkedIcon: /* @__PURE__ */ x.cloneElement(g, {
|
|
587
|
-
fontSize: (l = g.props.fontSize) != null ? l : m
|
|
588
|
-
}),
|
|
589
|
-
ownerState: b,
|
|
590
|
-
ref: n,
|
|
591
|
-
className: Ie(y.root, I)
|
|
592
|
-
}, h, {
|
|
593
|
-
classes: y
|
|
594
|
-
}));
|
|
595
|
-
});
|
|
596
|
-
process.env.NODE_ENV !== "production" && (at.propTypes = {
|
|
597
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
598
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
599
|
-
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
600
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
601
|
-
/**
|
|
602
|
-
* If `true`, the component is checked.
|
|
603
|
-
*/
|
|
604
|
-
checked: r.bool,
|
|
605
|
-
/**
|
|
606
|
-
* The icon to display when the component is checked.
|
|
607
|
-
* @default <CheckBoxIcon />
|
|
608
|
-
*/
|
|
609
|
-
checkedIcon: r.node,
|
|
610
|
-
/**
|
|
611
|
-
* Override or extend the styles applied to the component.
|
|
612
|
-
*/
|
|
613
|
-
classes: r.object,
|
|
614
|
-
/**
|
|
615
|
-
* @ignore
|
|
616
|
-
*/
|
|
617
|
-
className: r.string,
|
|
618
|
-
/**
|
|
619
|
-
* The color of the component.
|
|
620
|
-
* It supports both default and custom theme colors, which can be added as shown in the
|
|
621
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
622
|
-
* @default 'primary'
|
|
623
|
-
*/
|
|
624
|
-
color: r.oneOfType([r.oneOf(["default", "primary", "secondary", "error", "info", "success", "warning"]), r.string]),
|
|
625
|
-
/**
|
|
626
|
-
* The default checked state. Use when the component is not controlled.
|
|
627
|
-
*/
|
|
628
|
-
defaultChecked: r.bool,
|
|
629
|
-
/**
|
|
630
|
-
* If `true`, the component is disabled.
|
|
631
|
-
* @default false
|
|
632
|
-
*/
|
|
633
|
-
disabled: r.bool,
|
|
634
|
-
/**
|
|
635
|
-
* If `true`, the ripple effect is disabled.
|
|
636
|
-
* @default false
|
|
637
|
-
*/
|
|
638
|
-
disableRipple: r.bool,
|
|
639
|
-
/**
|
|
640
|
-
* The icon to display when the component is unchecked.
|
|
641
|
-
* @default <CheckBoxOutlineBlankIcon />
|
|
642
|
-
*/
|
|
643
|
-
icon: r.node,
|
|
644
|
-
/**
|
|
645
|
-
* The id of the `input` element.
|
|
646
|
-
*/
|
|
647
|
-
id: r.string,
|
|
648
|
-
/**
|
|
649
|
-
* If `true`, the component appears indeterminate.
|
|
650
|
-
* This does not set the native input element to indeterminate due
|
|
651
|
-
* to inconsistent behavior across browsers.
|
|
652
|
-
* However, we set a `data-indeterminate` attribute on the `input`.
|
|
653
|
-
* @default false
|
|
654
|
-
*/
|
|
655
|
-
indeterminate: r.bool,
|
|
656
|
-
/**
|
|
657
|
-
* The icon to display when the component is indeterminate.
|
|
658
|
-
* @default <IndeterminateCheckBoxIcon />
|
|
659
|
-
*/
|
|
660
|
-
indeterminateIcon: r.node,
|
|
661
|
-
/**
|
|
662
|
-
* [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
|
|
663
|
-
*/
|
|
664
|
-
inputProps: r.object,
|
|
665
|
-
/**
|
|
666
|
-
* Pass a ref to the `input` element.
|
|
667
|
-
*/
|
|
668
|
-
inputRef: it,
|
|
669
|
-
/**
|
|
670
|
-
* Callback fired when the state is changed.
|
|
671
|
-
*
|
|
672
|
-
* @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
|
|
673
|
-
* You can pull out the new checked state by accessing `event.target.checked` (boolean).
|
|
674
|
-
*/
|
|
675
|
-
onChange: r.func,
|
|
676
|
-
/**
|
|
677
|
-
* If `true`, the `input` element is required.
|
|
678
|
-
* @default false
|
|
679
|
-
*/
|
|
680
|
-
required: r.bool,
|
|
681
|
-
/**
|
|
682
|
-
* The size of the component.
|
|
683
|
-
* `small` is equivalent to the dense checkbox styling.
|
|
684
|
-
* @default 'medium'
|
|
685
|
-
*/
|
|
686
|
-
size: r.oneOfType([r.oneOf(["medium", "small"]), r.string]),
|
|
687
|
-
/**
|
|
688
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
689
|
-
*/
|
|
690
|
-
sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object]),
|
|
691
|
-
/**
|
|
692
|
-
* The value of the component. The DOM API casts this to a string.
|
|
693
|
-
* The browser uses "on" as the default value.
|
|
694
|
-
*/
|
|
695
|
-
value: r.any
|
|
696
|
-
});
|
|
697
|
-
const Fn = te(/* @__PURE__ */ w("path", {
|
|
698
|
-
d: "M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"
|
|
699
|
-
}), "Visibility"), $n = te(/* @__PURE__ */ w("path", {
|
|
700
|
-
d: "M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"
|
|
701
|
-
}), "VisibilityOff");
|
|
702
|
-
function E() {
|
|
703
|
-
return E = Object.assign ? Object.assign.bind() : function(e) {
|
|
704
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
705
|
-
var n = arguments[t];
|
|
706
|
-
for (var o in n) ({}).hasOwnProperty.call(n, o) && (e[o] = n[o]);
|
|
707
|
-
}
|
|
708
|
-
return e;
|
|
709
|
-
}, E.apply(null, arguments);
|
|
710
|
-
}
|
|
711
|
-
function ct(e) {
|
|
712
|
-
return fn;
|
|
713
|
-
}
|
|
714
|
-
const et = /* @__PURE__ */ new Set();
|
|
715
|
-
function dt(e, t = "warning") {
|
|
716
|
-
if (process.env.NODE_ENV === "production")
|
|
717
|
-
return;
|
|
718
|
-
const n = Array.isArray(e) ? e.join(`
|
|
719
|
-
`) : e;
|
|
720
|
-
et.has(n) || (et.add(n), t === "error" ? console.error(n) : console.warn(n));
|
|
721
|
-
}
|
|
722
|
-
function Ln(e) {
|
|
723
|
-
return fe("MuiSimpleTreeView", e);
|
|
724
|
-
}
|
|
725
|
-
me("MuiSimpleTreeView", ["root"]);
|
|
726
|
-
const Nn = (e, t) => {
|
|
727
|
-
const n = x.useRef({}), [o, l] = x.useState(() => {
|
|
728
|
-
const c = {};
|
|
729
|
-
return e.forEach((i) => {
|
|
730
|
-
i.models && Object.entries(i.models).forEach(([u, d]) => {
|
|
731
|
-
n.current[u] = {
|
|
732
|
-
isControlled: t[u] !== void 0,
|
|
733
|
-
getDefaultValue: d.getDefaultValue
|
|
734
|
-
}, c[u] = d.getDefaultValue(t);
|
|
735
|
-
});
|
|
736
|
-
}), c;
|
|
737
|
-
}), p = Object.fromEntries(Object.entries(n.current).map(([c, i]) => {
|
|
738
|
-
const u = t[c] ?? o[c];
|
|
739
|
-
return [c, {
|
|
740
|
-
value: u,
|
|
741
|
-
setControlledValue: (d) => {
|
|
742
|
-
i.isControlled || l((s) => E({}, s, {
|
|
743
|
-
[c]: d
|
|
744
|
-
}));
|
|
745
|
-
}
|
|
746
|
-
}];
|
|
747
|
-
}));
|
|
748
|
-
return process.env.NODE_ENV !== "production" && Object.entries(n.current).forEach(([c, i]) => {
|
|
749
|
-
const u = t[c], d = i.getDefaultValue(t);
|
|
750
|
-
x.useEffect(() => {
|
|
751
|
-
i.isControlled !== (u !== void 0) && console.error([`MUI X: A component is changing the ${i.isControlled ? "" : "un"}controlled ${c} state of TreeView to be ${i.isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${c} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join(`
|
|
752
|
-
`));
|
|
753
|
-
}, [u]);
|
|
754
|
-
const {
|
|
755
|
-
current: s
|
|
756
|
-
} = x.useRef(d);
|
|
757
|
-
x.useEffect(() => {
|
|
758
|
-
!i.isControlled && s !== d && console.error([`MUI X: A component is changing the default ${c} state of an uncontrolled TreeView after being initialized. To suppress this warning opt to use a controlled TreeView.`].join(`
|
|
759
|
-
`));
|
|
760
|
-
}, [JSON.stringify(d)]);
|
|
761
|
-
}), p;
|
|
762
|
-
};
|
|
763
|
-
class jn {
|
|
764
|
-
constructor() {
|
|
765
|
-
this.maxListeners = 20, this.warnOnce = !1, this.events = {};
|
|
766
|
-
}
|
|
767
|
-
on(t, n, o = {}) {
|
|
768
|
-
let l = this.events[t];
|
|
769
|
-
if (l || (l = {
|
|
770
|
-
highPriority: /* @__PURE__ */ new Map(),
|
|
771
|
-
regular: /* @__PURE__ */ new Map()
|
|
772
|
-
}, this.events[t] = l), o.isFirst ? l.highPriority.set(n, !0) : l.regular.set(n, !0), process.env.NODE_ENV !== "production") {
|
|
773
|
-
const p = l.highPriority.size + l.regular.size;
|
|
774
|
-
p > this.maxListeners && !this.warnOnce && (this.warnOnce = !0, console.warn([`Possible EventEmitter memory leak detected. ${p} ${t} listeners added.`].join(`
|
|
775
|
-
`)));
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
removeListener(t, n) {
|
|
779
|
-
this.events[t] && (this.events[t].regular.delete(n), this.events[t].highPriority.delete(n));
|
|
780
|
-
}
|
|
781
|
-
removeAllListeners() {
|
|
782
|
-
this.events = {};
|
|
783
|
-
}
|
|
784
|
-
emit(t, ...n) {
|
|
785
|
-
const o = this.events[t];
|
|
786
|
-
if (!o)
|
|
787
|
-
return;
|
|
788
|
-
const l = Array.from(o.highPriority.keys()), p = Array.from(o.regular.keys());
|
|
789
|
-
for (let c = l.length - 1; c >= 0; c -= 1) {
|
|
790
|
-
const i = l[c];
|
|
791
|
-
o.highPriority.has(i) && i.apply(this, n);
|
|
792
|
-
}
|
|
793
|
-
for (let c = 0; c < p.length; c += 1) {
|
|
794
|
-
const i = p[c];
|
|
795
|
-
o.regular.has(i) && i.apply(this, n);
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
once(t, n) {
|
|
799
|
-
const o = this;
|
|
800
|
-
this.on(t, function l(...p) {
|
|
801
|
-
o.removeListener(t, l), n.apply(o, p);
|
|
802
|
-
});
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
const zn = (e) => e.isPropagationStopped !== void 0, ut = () => {
|
|
806
|
-
const [e] = x.useState(() => new jn()), t = x.useCallback((...o) => {
|
|
807
|
-
const [l, p, c = {}] = o;
|
|
808
|
-
c.defaultMuiPrevented = !1, !(zn(c) && c.isPropagationStopped()) && e.emit(l, p, c);
|
|
809
|
-
}, [e]), n = x.useCallback((o, l) => (e.on(o, l), () => {
|
|
810
|
-
e.removeListener(o, l);
|
|
811
|
-
}), [e]);
|
|
812
|
-
return {
|
|
813
|
-
instance: {
|
|
814
|
-
$$publishEvent: t,
|
|
815
|
-
$$subscribeEvent: n
|
|
816
|
-
}
|
|
817
|
-
};
|
|
818
|
-
};
|
|
819
|
-
ut.params = {};
|
|
820
|
-
const pt = ({
|
|
821
|
-
plugins: e
|
|
822
|
-
}) => {
|
|
823
|
-
const t = new Set(e);
|
|
824
|
-
return {
|
|
825
|
-
instance: {
|
|
826
|
-
getAvailablePlugins: () => t
|
|
827
|
-
}
|
|
828
|
-
};
|
|
829
|
-
};
|
|
830
|
-
pt.params = {};
|
|
831
|
-
const ft = ({
|
|
832
|
-
params: e
|
|
833
|
-
}) => {
|
|
834
|
-
const t = tn(e.id), n = x.useCallback((o, l) => l ?? `${t}-${o}`, [t]);
|
|
835
|
-
return {
|
|
836
|
-
getRootProps: () => ({
|
|
837
|
-
id: t
|
|
838
|
-
}),
|
|
839
|
-
instance: {
|
|
840
|
-
getTreeItemIdAttribute: n
|
|
841
|
-
}
|
|
842
|
-
};
|
|
843
|
-
};
|
|
844
|
-
ft.params = {
|
|
845
|
-
id: !0
|
|
846
|
-
};
|
|
847
|
-
const Bn = [ut, pt, ft];
|
|
848
|
-
function Q(e, t) {
|
|
849
|
-
if (e == null) return {};
|
|
850
|
-
var n = {};
|
|
851
|
-
for (var o in e) if ({}.hasOwnProperty.call(e, o)) {
|
|
852
|
-
if (t.includes(o)) continue;
|
|
853
|
-
n[o] = e[o];
|
|
854
|
-
}
|
|
855
|
-
return n;
|
|
856
|
-
}
|
|
857
|
-
const _n = ["slots", "slotProps", "apiRef", "experimentalFeatures"], Un = (e) => {
|
|
858
|
-
let {
|
|
859
|
-
props: {
|
|
860
|
-
slots: t,
|
|
861
|
-
slotProps: n,
|
|
862
|
-
apiRef: o,
|
|
863
|
-
experimentalFeatures: l
|
|
864
|
-
},
|
|
865
|
-
plugins: p
|
|
866
|
-
} = e, c = Q(e.props, _n);
|
|
867
|
-
const i = {};
|
|
868
|
-
p.forEach((a) => {
|
|
869
|
-
Object.assign(i, a.params);
|
|
870
|
-
});
|
|
871
|
-
const u = {}, d = {};
|
|
872
|
-
Object.keys(c).forEach((a) => {
|
|
873
|
-
const m = c[a];
|
|
874
|
-
i[a] ? u[a] = m : d[a] = m;
|
|
875
|
-
});
|
|
876
|
-
const s = p.reduce((a, m) => m.getDefaultizedParams ? m.getDefaultizedParams(a) : a, u);
|
|
877
|
-
return {
|
|
878
|
-
apiRef: o,
|
|
879
|
-
forwardedProps: d,
|
|
880
|
-
pluginParams: s,
|
|
881
|
-
slots: t ?? {},
|
|
882
|
-
slotProps: n ?? {},
|
|
883
|
-
experimentalFeatures: l ?? {}
|
|
884
|
-
};
|
|
885
|
-
}, Kn = ({
|
|
886
|
-
plugins: e,
|
|
887
|
-
instance: t,
|
|
888
|
-
publicAPI: n,
|
|
889
|
-
rootRef: o
|
|
890
|
-
}) => ({
|
|
891
|
-
runItemPlugins: (i) => {
|
|
892
|
-
let u = null, d = null;
|
|
893
|
-
const s = [], a = {};
|
|
894
|
-
e.forEach((h) => {
|
|
895
|
-
if (!h.itemPlugin)
|
|
896
|
-
return;
|
|
897
|
-
const f = h.itemPlugin({
|
|
898
|
-
props: i,
|
|
899
|
-
rootRef: u,
|
|
900
|
-
contentRef: d
|
|
901
|
-
});
|
|
902
|
-
f != null && f.rootRef && (u = f.rootRef), f != null && f.contentRef && (d = f.contentRef), f != null && f.propsEnhancers && (s.push(f.propsEnhancers), Object.keys(f.propsEnhancers).forEach((g) => {
|
|
903
|
-
a[g] = !0;
|
|
904
|
-
}));
|
|
905
|
-
});
|
|
906
|
-
const m = (h) => (f) => {
|
|
907
|
-
const g = {};
|
|
908
|
-
return s.forEach((b) => {
|
|
909
|
-
const y = b[h];
|
|
910
|
-
y != null && Object.assign(g, y(f));
|
|
911
|
-
}), g;
|
|
912
|
-
}, I = Object.fromEntries(Object.keys(a).map((h) => [h, m(h)]));
|
|
913
|
-
return {
|
|
914
|
-
contentRef: d,
|
|
915
|
-
rootRef: u,
|
|
916
|
-
propsEnhancers: I
|
|
917
|
-
};
|
|
918
|
-
},
|
|
919
|
-
wrapItem: ({
|
|
920
|
-
itemId: i,
|
|
921
|
-
children: u
|
|
922
|
-
}) => {
|
|
923
|
-
let d = u;
|
|
924
|
-
for (let s = e.length - 1; s >= 0; s -= 1) {
|
|
925
|
-
const a = e[s];
|
|
926
|
-
a.wrapItem && (d = a.wrapItem({
|
|
927
|
-
itemId: i,
|
|
928
|
-
children: d,
|
|
929
|
-
instance: t
|
|
930
|
-
}));
|
|
931
|
-
}
|
|
932
|
-
return d;
|
|
933
|
-
},
|
|
934
|
-
wrapRoot: ({
|
|
935
|
-
children: i
|
|
936
|
-
}) => {
|
|
937
|
-
let u = i;
|
|
938
|
-
for (let d = e.length - 1; d >= 0; d -= 1) {
|
|
939
|
-
const s = e[d];
|
|
940
|
-
s.wrapRoot && (u = s.wrapRoot({
|
|
941
|
-
children: u,
|
|
942
|
-
instance: t
|
|
943
|
-
}));
|
|
944
|
-
}
|
|
945
|
-
return u;
|
|
946
|
-
},
|
|
947
|
-
instance: t,
|
|
948
|
-
rootRef: o,
|
|
949
|
-
publicAPI: n
|
|
950
|
-
});
|
|
951
|
-
function qn(e) {
|
|
952
|
-
const t = x.useRef({});
|
|
953
|
-
return e ? (e.current == null && (e.current = {}), e.current) : t.current;
|
|
954
|
-
}
|
|
955
|
-
const Xn = ({
|
|
956
|
-
plugins: e,
|
|
957
|
-
rootRef: t,
|
|
958
|
-
props: n
|
|
959
|
-
}) => {
|
|
960
|
-
const o = [...Bn, ...e], {
|
|
961
|
-
pluginParams: l,
|
|
962
|
-
forwardedProps: p,
|
|
963
|
-
apiRef: c,
|
|
964
|
-
experimentalFeatures: i,
|
|
965
|
-
slots: u,
|
|
966
|
-
slotProps: d
|
|
967
|
-
} = Un({
|
|
968
|
-
plugins: o,
|
|
969
|
-
props: n
|
|
970
|
-
}), s = Nn(o, l), m = x.useRef({}).current, I = qn(c), h = x.useRef(null), f = de(h, t), g = Kn({
|
|
971
|
-
plugins: o,
|
|
972
|
-
instance: m,
|
|
973
|
-
publicAPI: I,
|
|
974
|
-
rootRef: h
|
|
975
|
-
}), [b, y] = x.useState(() => {
|
|
976
|
-
const v = {};
|
|
977
|
-
return o.forEach((M) => {
|
|
978
|
-
M.getInitialState && Object.assign(v, M.getInitialState(l));
|
|
979
|
-
}), v;
|
|
980
|
-
}), C = [], k = (v) => {
|
|
981
|
-
const M = v({
|
|
982
|
-
instance: m,
|
|
983
|
-
params: l,
|
|
984
|
-
slots: u,
|
|
985
|
-
slotProps: d,
|
|
986
|
-
experimentalFeatures: i,
|
|
987
|
-
state: b,
|
|
988
|
-
setState: y,
|
|
989
|
-
rootRef: h,
|
|
990
|
-
models: s,
|
|
991
|
-
plugins: o
|
|
992
|
-
});
|
|
993
|
-
M.getRootProps && C.push(M.getRootProps), M.publicAPI && Object.assign(I, M.publicAPI), M.instance && Object.assign(m, M.instance), M.contextValue && Object.assign(g, M.contextValue);
|
|
994
|
-
};
|
|
995
|
-
return o.forEach(k), {
|
|
996
|
-
getRootProps: (v = {}) => {
|
|
997
|
-
const M = E({
|
|
998
|
-
role: "tree"
|
|
999
|
-
}, p, v, {
|
|
1000
|
-
ref: f
|
|
1001
|
-
});
|
|
1002
|
-
return C.forEach((B) => {
|
|
1003
|
-
Object.assign(M, B(v));
|
|
1004
|
-
}), M;
|
|
1005
|
-
},
|
|
1006
|
-
rootRef: f,
|
|
1007
|
-
contextValue: g,
|
|
1008
|
-
instance: m
|
|
1009
|
-
};
|
|
1010
|
-
}, je = /* @__PURE__ */ x.createContext(null);
|
|
1011
|
-
process.env.NODE_ENV !== "production" && (je.displayName = "TreeViewContext");
|
|
1012
|
-
function Wn(e) {
|
|
1013
|
-
const {
|
|
1014
|
-
value: t,
|
|
1015
|
-
children: n
|
|
1016
|
-
} = e;
|
|
1017
|
-
return /* @__PURE__ */ w(je.Provider, {
|
|
1018
|
-
value: t,
|
|
1019
|
-
children: t.wrapRoot({
|
|
1020
|
-
children: n
|
|
1021
|
-
})
|
|
1022
|
-
});
|
|
1023
|
-
}
|
|
1024
|
-
const le = () => {
|
|
1025
|
-
const e = x.useContext(je);
|
|
1026
|
-
if (e == null)
|
|
1027
|
-
throw new Error(["MUI X: Could not find the Tree View context.", "It looks like you rendered your component outside of a SimpleTreeView or RichTreeView parent component.", "This can also happen if you are bundling multiple versions of the Tree View."].join(`
|
|
1028
|
-
`));
|
|
1029
|
-
return e;
|
|
1030
|
-
}, mt = (e, t, n) => {
|
|
1031
|
-
e.$$publishEvent(t, n);
|
|
1032
|
-
}, Z = "__TREE_VIEW_ROOT_PARENT_ID__", It = (e) => {
|
|
1033
|
-
const t = {};
|
|
1034
|
-
return e.forEach((n, o) => {
|
|
1035
|
-
t[n] = o;
|
|
1036
|
-
}), t;
|
|
1037
|
-
}, se = /* @__PURE__ */ x.createContext(() => -1);
|
|
1038
|
-
process.env.NODE_ENV !== "production" && (se.displayName = "TreeViewItemDepthContext");
|
|
1039
|
-
const Jn = ["children"], gt = ({
|
|
1040
|
-
items: e,
|
|
1041
|
-
isItemDisabled: t,
|
|
1042
|
-
getItemLabel: n,
|
|
1043
|
-
getItemId: o
|
|
1044
|
-
}) => {
|
|
1045
|
-
const l = {}, p = {}, c = {
|
|
1046
|
-
[Z]: []
|
|
1047
|
-
}, i = (d, s, a) => {
|
|
1048
|
-
var f, g;
|
|
1049
|
-
const m = o ? o(d) : d.id;
|
|
1050
|
-
if (m == null)
|
|
1051
|
-
throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", "An item was provided without id in the `items` prop:", JSON.stringify(d)].join(`
|
|
1052
|
-
`));
|
|
1053
|
-
if (l[m] != null)
|
|
1054
|
-
throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", `Two items were provided with the same id in the \`items\` prop: "${m}"`].join(`
|
|
1055
|
-
`));
|
|
1056
|
-
const I = n ? n(d) : d.label;
|
|
1057
|
-
if (I == null)
|
|
1058
|
-
throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.", "Alternatively, you can use the `getItemLabel` prop to specify a custom label for each item.", "An item was provided without label in the `items` prop:", JSON.stringify(d)].join(`
|
|
1059
|
-
`));
|
|
1060
|
-
l[m] = {
|
|
1061
|
-
id: m,
|
|
1062
|
-
label: I,
|
|
1063
|
-
parentId: a,
|
|
1064
|
-
idAttribute: void 0,
|
|
1065
|
-
expandable: !!((f = d.children) != null && f.length),
|
|
1066
|
-
disabled: t ? t(d) : !1,
|
|
1067
|
-
depth: s
|
|
1068
|
-
}, p[m] = d;
|
|
1069
|
-
const h = a ?? Z;
|
|
1070
|
-
c[h] || (c[h] = []), c[h].push(m), (g = d.children) == null || g.forEach((b) => i(b, s + 1, m));
|
|
1071
|
-
};
|
|
1072
|
-
e.forEach((d) => i(d, 0, null));
|
|
1073
|
-
const u = {};
|
|
1074
|
-
return Object.keys(c).forEach((d) => {
|
|
1075
|
-
u[d] = It(c[d]);
|
|
1076
|
-
}), {
|
|
1077
|
-
itemMetaMap: l,
|
|
1078
|
-
itemMap: p,
|
|
1079
|
-
itemOrderedChildrenIds: c,
|
|
1080
|
-
itemChildrenIndexes: u
|
|
1081
|
-
};
|
|
1082
|
-
}, he = ({
|
|
1083
|
-
instance: e,
|
|
1084
|
-
params: t,
|
|
1085
|
-
state: n,
|
|
1086
|
-
setState: o,
|
|
1087
|
-
experimentalFeatures: l
|
|
1088
|
-
}) => {
|
|
1089
|
-
const p = x.useCallback((b) => n.items.itemMetaMap[b], [n.items.itemMetaMap]), c = x.useCallback((b) => n.items.itemMap[b], [n.items.itemMap]), i = x.useCallback(() => {
|
|
1090
|
-
const b = (y) => {
|
|
1091
|
-
const C = n.items.itemMap[y], k = Q(C, Jn), T = n.items.itemOrderedChildrenIds[y];
|
|
1092
|
-
return T && (k.children = T.map(b)), k;
|
|
1093
|
-
};
|
|
1094
|
-
return n.items.itemOrderedChildrenIds[Z].map(b);
|
|
1095
|
-
}, [n.items.itemMap, n.items.itemOrderedChildrenIds]), u = x.useCallback((b) => {
|
|
1096
|
-
if (b == null)
|
|
1097
|
-
return !1;
|
|
1098
|
-
let y = e.getItemMeta(b);
|
|
1099
|
-
if (!y)
|
|
1100
|
-
return !1;
|
|
1101
|
-
if (y.disabled)
|
|
1102
|
-
return !0;
|
|
1103
|
-
for (; y.parentId != null; )
|
|
1104
|
-
if (y = e.getItemMeta(y.parentId), y.disabled)
|
|
1105
|
-
return !0;
|
|
1106
|
-
return !1;
|
|
1107
|
-
}, [e]), d = x.useCallback((b) => {
|
|
1108
|
-
const y = e.getItemMeta(b).parentId ?? Z;
|
|
1109
|
-
return n.items.itemChildrenIndexes[y][b];
|
|
1110
|
-
}, [e, n.items.itemChildrenIndexes]), s = x.useCallback((b) => n.items.itemOrderedChildrenIds[b ?? Z] ?? [], [n.items.itemOrderedChildrenIds]), a = (b) => {
|
|
1111
|
-
const y = e.getItemMeta(b);
|
|
1112
|
-
return y == null ? null : document.getElementById(e.getTreeItemIdAttribute(b, y.idAttribute));
|
|
1113
|
-
}, m = (b) => t.disabledItemsFocusable ? !0 : !e.isItemDisabled(b), I = x.useRef(!1), h = x.useCallback(() => {
|
|
1114
|
-
I.current = !0;
|
|
1115
|
-
}, []), f = x.useCallback(() => I.current, []);
|
|
1116
|
-
return x.useEffect(() => {
|
|
1117
|
-
e.areItemUpdatesPrevented() || o((b) => {
|
|
1118
|
-
const y = gt({
|
|
1119
|
-
items: t.items,
|
|
1120
|
-
isItemDisabled: t.isItemDisabled,
|
|
1121
|
-
getItemId: t.getItemId,
|
|
1122
|
-
getItemLabel: t.getItemLabel
|
|
1123
|
-
});
|
|
1124
|
-
return Object.values(b.items.itemMetaMap).forEach((C) => {
|
|
1125
|
-
y.itemMetaMap[C.id] || mt(e, "removeItem", {
|
|
1126
|
-
id: C.id
|
|
1127
|
-
});
|
|
1128
|
-
}), E({}, b, {
|
|
1129
|
-
items: y
|
|
1130
|
-
});
|
|
1131
|
-
});
|
|
1132
|
-
}, [e, o, t.items, t.isItemDisabled, t.getItemId, t.getItemLabel]), {
|
|
1133
|
-
getRootProps: () => ({
|
|
1134
|
-
style: {
|
|
1135
|
-
"--TreeView-itemChildrenIndentation": typeof t.itemChildrenIndentation == "number" ? `${t.itemChildrenIndentation}px` : t.itemChildrenIndentation
|
|
1136
|
-
}
|
|
1137
|
-
}),
|
|
1138
|
-
publicAPI: {
|
|
1139
|
-
getItem: c,
|
|
1140
|
-
getItemDOMElement: a,
|
|
1141
|
-
getItemTree: i,
|
|
1142
|
-
getItemOrderedChildrenIds: s
|
|
1143
|
-
},
|
|
1144
|
-
instance: {
|
|
1145
|
-
getItemMeta: p,
|
|
1146
|
-
getItem: c,
|
|
1147
|
-
getItemTree: i,
|
|
1148
|
-
getItemsToRender: () => {
|
|
1149
|
-
const b = (y) => {
|
|
1150
|
-
var k;
|
|
1151
|
-
const C = n.items.itemMetaMap[y];
|
|
1152
|
-
return {
|
|
1153
|
-
label: C.label,
|
|
1154
|
-
itemId: C.id,
|
|
1155
|
-
id: C.idAttribute,
|
|
1156
|
-
children: (k = n.items.itemOrderedChildrenIds[y]) == null ? void 0 : k.map(b)
|
|
1157
|
-
};
|
|
1158
|
-
};
|
|
1159
|
-
return n.items.itemOrderedChildrenIds[Z].map(b);
|
|
1160
|
-
},
|
|
1161
|
-
getItemIndex: d,
|
|
1162
|
-
getItemDOMElement: a,
|
|
1163
|
-
getItemOrderedChildrenIds: s,
|
|
1164
|
-
isItemDisabled: u,
|
|
1165
|
-
isItemNavigable: m,
|
|
1166
|
-
preventItemUpdates: h,
|
|
1167
|
-
areItemUpdatesPrevented: f
|
|
1168
|
-
},
|
|
1169
|
-
contextValue: {
|
|
1170
|
-
items: {
|
|
1171
|
-
onItemClick: t.onItemClick,
|
|
1172
|
-
disabledItemsFocusable: t.disabledItemsFocusable,
|
|
1173
|
-
indentationAtItemLevel: l.indentationAtItemLevel ?? !1
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
|
-
};
|
|
1177
|
-
};
|
|
1178
|
-
he.getInitialState = (e) => ({
|
|
1179
|
-
items: gt({
|
|
1180
|
-
items: e.items,
|
|
1181
|
-
isItemDisabled: e.isItemDisabled,
|
|
1182
|
-
getItemId: e.getItemId,
|
|
1183
|
-
getItemLabel: e.getItemLabel
|
|
1184
|
-
})
|
|
1185
|
-
});
|
|
1186
|
-
he.getDefaultizedParams = (e) => E({}, e, {
|
|
1187
|
-
disabledItemsFocusable: e.disabledItemsFocusable ?? !1,
|
|
1188
|
-
itemChildrenIndentation: e.itemChildrenIndentation ?? "12px"
|
|
1189
|
-
});
|
|
1190
|
-
he.wrapRoot = ({
|
|
1191
|
-
children: e,
|
|
1192
|
-
instance: t
|
|
1193
|
-
}) => /* @__PURE__ */ w(se.Provider, {
|
|
1194
|
-
value: (n) => {
|
|
1195
|
-
var o;
|
|
1196
|
-
return ((o = t.getItemMeta(n)) == null ? void 0 : o.depth) ?? 0;
|
|
1197
|
-
},
|
|
1198
|
-
children: e
|
|
1199
|
-
});
|
|
1200
|
-
he.params = {
|
|
1201
|
-
disabledItemsFocusable: !0,
|
|
1202
|
-
items: !0,
|
|
1203
|
-
isItemDisabled: !0,
|
|
1204
|
-
getItemLabel: !0,
|
|
1205
|
-
getItemId: !0,
|
|
1206
|
-
onItemClick: !0,
|
|
1207
|
-
itemChildrenIndentation: !0
|
|
1208
|
-
};
|
|
1209
|
-
const Se = ({
|
|
1210
|
-
instance: e,
|
|
1211
|
-
params: t,
|
|
1212
|
-
models: n
|
|
1213
|
-
}) => {
|
|
1214
|
-
const o = x.useMemo(() => {
|
|
1215
|
-
const a = /* @__PURE__ */ new Map();
|
|
1216
|
-
return n.expandedItems.value.forEach((m) => {
|
|
1217
|
-
a.set(m, !0);
|
|
1218
|
-
}), a;
|
|
1219
|
-
}, [n.expandedItems.value]), l = (a, m) => {
|
|
1220
|
-
var I;
|
|
1221
|
-
(I = t.onExpandedItemsChange) == null || I.call(t, a, m), n.expandedItems.setControlledValue(m);
|
|
1222
|
-
}, p = x.useCallback((a) => o.has(a), [o]), c = x.useCallback((a) => {
|
|
1223
|
-
var m;
|
|
1224
|
-
return !!((m = e.getItemMeta(a)) != null && m.expandable);
|
|
1225
|
-
}, [e]), i = G((a, m) => {
|
|
1226
|
-
const I = e.isItemExpanded(m);
|
|
1227
|
-
e.setItemExpansion(a, m, !I);
|
|
1228
|
-
}), u = G((a, m, I) => {
|
|
1229
|
-
if (e.isItemExpanded(m) === I)
|
|
1230
|
-
return;
|
|
1231
|
-
let f;
|
|
1232
|
-
I ? f = [m].concat(n.expandedItems.value) : f = n.expandedItems.value.filter((g) => g !== m), t.onItemExpansionToggle && t.onItemExpansionToggle(a, m, I), l(a, f);
|
|
1233
|
-
}), d = (a, m) => {
|
|
1234
|
-
const I = e.getItemMeta(m), f = e.getItemOrderedChildrenIds(I.parentId).filter((b) => e.isItemExpandable(b) && !e.isItemExpanded(b)), g = n.expandedItems.value.concat(f);
|
|
1235
|
-
f.length > 0 && (t.onItemExpansionToggle && f.forEach((b) => {
|
|
1236
|
-
t.onItemExpansionToggle(a, b, !0);
|
|
1237
|
-
}), l(a, g));
|
|
1238
|
-
}, s = x.useMemo(() => t.expansionTrigger ? t.expansionTrigger : e.isTreeViewEditable ? "iconContainer" : "content", [t.expansionTrigger, e.isTreeViewEditable]);
|
|
1239
|
-
return {
|
|
1240
|
-
publicAPI: {
|
|
1241
|
-
setItemExpansion: u
|
|
1242
|
-
},
|
|
1243
|
-
instance: {
|
|
1244
|
-
isItemExpanded: p,
|
|
1245
|
-
isItemExpandable: c,
|
|
1246
|
-
setItemExpansion: u,
|
|
1247
|
-
toggleItemExpansion: i,
|
|
1248
|
-
expandAllSiblings: d
|
|
1249
|
-
},
|
|
1250
|
-
contextValue: {
|
|
1251
|
-
expansion: {
|
|
1252
|
-
expansionTrigger: s
|
|
1253
|
-
}
|
|
1254
|
-
}
|
|
1255
|
-
};
|
|
1256
|
-
};
|
|
1257
|
-
Se.models = {
|
|
1258
|
-
expandedItems: {
|
|
1259
|
-
getDefaultValue: (e) => e.defaultExpandedItems
|
|
1260
|
-
}
|
|
1261
|
-
};
|
|
1262
|
-
const Gn = [];
|
|
1263
|
-
Se.getDefaultizedParams = (e) => E({}, e, {
|
|
1264
|
-
defaultExpandedItems: e.defaultExpandedItems ?? Gn
|
|
1265
|
-
});
|
|
1266
|
-
Se.params = {
|
|
1267
|
-
expandedItems: !0,
|
|
1268
|
-
defaultExpandedItems: !0,
|
|
1269
|
-
onExpandedItemsChange: !0,
|
|
1270
|
-
onItemExpansionToggle: !0,
|
|
1271
|
-
expansionTrigger: !0
|
|
1272
|
-
};
|
|
1273
|
-
const ht = (e, t) => {
|
|
1274
|
-
let n = t.length - 1;
|
|
1275
|
-
for (; n >= 0 && !e.isItemNavigable(t[n]); )
|
|
1276
|
-
n -= 1;
|
|
1277
|
-
if (n !== -1)
|
|
1278
|
-
return t[n];
|
|
1279
|
-
}, bt = (e, t) => {
|
|
1280
|
-
const n = e.getItemMeta(t), o = e.getItemOrderedChildrenIds(n.parentId), l = e.getItemIndex(t);
|
|
1281
|
-
if (l === 0)
|
|
1282
|
-
return n.parentId;
|
|
1283
|
-
let p = l - 1;
|
|
1284
|
-
for (; !e.isItemNavigable(o[p]) && p >= 0; )
|
|
1285
|
-
p -= 1;
|
|
1286
|
-
if (p === -1)
|
|
1287
|
-
return n.parentId == null ? null : bt(e, n.parentId);
|
|
1288
|
-
let c = o[p], i = ht(e, e.getItemOrderedChildrenIds(c));
|
|
1289
|
-
for (; e.isItemExpanded(c) && i != null; )
|
|
1290
|
-
c = i, i = e.getItemOrderedChildrenIds(c).find(e.isItemNavigable);
|
|
1291
|
-
return c;
|
|
1292
|
-
}, Ce = (e, t) => {
|
|
1293
|
-
if (e.isItemExpanded(t)) {
|
|
1294
|
-
const o = e.getItemOrderedChildrenIds(t).find(e.isItemNavigable);
|
|
1295
|
-
if (o != null)
|
|
1296
|
-
return o;
|
|
1297
|
-
}
|
|
1298
|
-
let n = e.getItemMeta(t);
|
|
1299
|
-
for (; n != null; ) {
|
|
1300
|
-
const o = e.getItemOrderedChildrenIds(n.parentId), l = e.getItemIndex(n.id);
|
|
1301
|
-
if (l < o.length - 1) {
|
|
1302
|
-
let p = l + 1;
|
|
1303
|
-
for (; !e.isItemNavigable(o[p]) && p < o.length - 1; )
|
|
1304
|
-
p += 1;
|
|
1305
|
-
if (e.isItemNavigable(o[p]))
|
|
1306
|
-
return o[p];
|
|
1307
|
-
}
|
|
1308
|
-
n = e.getItemMeta(n.parentId);
|
|
1309
|
-
}
|
|
1310
|
-
return null;
|
|
1311
|
-
}, yt = (e) => {
|
|
1312
|
-
let t = null;
|
|
1313
|
-
for (; t == null || e.isItemExpanded(t); ) {
|
|
1314
|
-
const n = e.getItemOrderedChildrenIds(t), o = ht(e, n);
|
|
1315
|
-
if (o == null)
|
|
1316
|
-
return t;
|
|
1317
|
-
t = o;
|
|
1318
|
-
}
|
|
1319
|
-
return t;
|
|
1320
|
-
}, pe = (e) => e.getItemOrderedChildrenIds(null).find(e.isItemNavigable), xt = (e, t, n) => {
|
|
1321
|
-
if (t === n)
|
|
1322
|
-
return [t, n];
|
|
1323
|
-
const o = e.getItemMeta(t), l = e.getItemMeta(n);
|
|
1324
|
-
if (o.parentId === l.id || l.parentId === o.id)
|
|
1325
|
-
return l.parentId === o.id ? [o.id, l.id] : [l.id, o.id];
|
|
1326
|
-
const p = [o.id], c = [l.id];
|
|
1327
|
-
let i = o.parentId, u = l.parentId, d = c.indexOf(i) !== -1, s = p.indexOf(u) !== -1, a = !0, m = !0;
|
|
1328
|
-
for (; !s && !d; )
|
|
1329
|
-
a && (p.push(i), d = c.indexOf(i) !== -1, a = i !== null, !d && a && (i = e.getItemMeta(i).parentId)), m && !d && (c.push(u), s = p.indexOf(u) !== -1, m = u !== null, !s && m && (u = e.getItemMeta(u).parentId));
|
|
1330
|
-
const I = d ? i : u, h = e.getItemOrderedChildrenIds(I), f = p[p.indexOf(I) - 1], g = c[c.indexOf(I) - 1];
|
|
1331
|
-
return h.indexOf(f) < h.indexOf(g) ? [t, n] : [n, t];
|
|
1332
|
-
}, Hn = (e, t, n) => {
|
|
1333
|
-
const o = (u) => {
|
|
1334
|
-
if (e.isItemExpandable(u) && e.isItemExpanded(u))
|
|
1335
|
-
return e.getItemOrderedChildrenIds(u)[0];
|
|
1336
|
-
let d = e.getItemMeta(u);
|
|
1337
|
-
for (; d != null; ) {
|
|
1338
|
-
const s = e.getItemOrderedChildrenIds(d.parentId), a = e.getItemIndex(d.id);
|
|
1339
|
-
if (a < s.length - 1)
|
|
1340
|
-
return s[a + 1];
|
|
1341
|
-
d = e.getItemMeta(d.parentId);
|
|
1342
|
-
}
|
|
1343
|
-
throw new Error("Invalid range");
|
|
1344
|
-
}, [l, p] = xt(e, t, n), c = [l];
|
|
1345
|
-
let i = l;
|
|
1346
|
-
for (; i !== p; )
|
|
1347
|
-
i = o(i), e.isItemDisabled(i) || c.push(i);
|
|
1348
|
-
return c;
|
|
1349
|
-
}, Yn = (e) => {
|
|
1350
|
-
let t = pe(e);
|
|
1351
|
-
const n = [];
|
|
1352
|
-
for (; t != null; )
|
|
1353
|
-
n.push(t), t = Ce(e, t);
|
|
1354
|
-
return n;
|
|
1355
|
-
}, $e = (e, t) => t !== e.closest('*[role="treeitem"]'), Te = (e) => Array.isArray(e) ? e : e != null ? [e] : [], Fe = (e) => {
|
|
1356
|
-
const t = {};
|
|
1357
|
-
return e.forEach((n) => {
|
|
1358
|
-
t[n] = !0;
|
|
1359
|
-
}), t;
|
|
1360
|
-
}, Re = ({
|
|
1361
|
-
instance: e,
|
|
1362
|
-
params: t,
|
|
1363
|
-
models: n
|
|
1364
|
-
}) => {
|
|
1365
|
-
const o = x.useRef(null), l = x.useRef({}), p = x.useMemo(() => {
|
|
1366
|
-
const f = /* @__PURE__ */ new Map();
|
|
1367
|
-
return Array.isArray(n.selectedItems.value) ? n.selectedItems.value.forEach((g) => {
|
|
1368
|
-
f.set(g, !0);
|
|
1369
|
-
}) : n.selectedItems.value != null && f.set(n.selectedItems.value, !0), f;
|
|
1370
|
-
}, [n.selectedItems.value]), c = (f, g) => {
|
|
1371
|
-
if (t.onItemSelectionToggle)
|
|
1372
|
-
if (t.multiSelect) {
|
|
1373
|
-
const b = g.filter((C) => !e.isItemSelected(C)), y = n.selectedItems.value.filter((C) => !g.includes(C));
|
|
1374
|
-
b.forEach((C) => {
|
|
1375
|
-
t.onItemSelectionToggle(f, C, !0);
|
|
1376
|
-
}), y.forEach((C) => {
|
|
1377
|
-
t.onItemSelectionToggle(f, C, !1);
|
|
1378
|
-
});
|
|
1379
|
-
} else g !== n.selectedItems.value && (n.selectedItems.value != null && t.onItemSelectionToggle(f, n.selectedItems.value, !1), g != null && t.onItemSelectionToggle(f, g, !0));
|
|
1380
|
-
t.onSelectedItemsChange && t.onSelectedItemsChange(f, g), n.selectedItems.setControlledValue(g);
|
|
1381
|
-
}, i = (f) => p.has(f), u = ({
|
|
1382
|
-
event: f,
|
|
1383
|
-
itemId: g,
|
|
1384
|
-
keepExistingSelection: b = !1,
|
|
1385
|
-
shouldBeSelected: y
|
|
1386
|
-
}) => {
|
|
1387
|
-
if (t.disableSelection)
|
|
1388
|
-
return;
|
|
1389
|
-
let C;
|
|
1390
|
-
if (b) {
|
|
1391
|
-
const k = Te(n.selectedItems.value), T = e.isItemSelected(g);
|
|
1392
|
-
T && (y === !1 || y == null) ? C = k.filter((v) => v !== g) : !T && (y === !0 || y == null) ? C = [g].concat(k) : C = k;
|
|
1393
|
-
} else
|
|
1394
|
-
y === !1 || y == null && e.isItemSelected(g) ? C = t.multiSelect ? [] : null : C = t.multiSelect ? [g] : g;
|
|
1395
|
-
c(f, C), o.current = g, l.current = {};
|
|
1396
|
-
}, d = (f, [g, b]) => {
|
|
1397
|
-
if (t.disableSelection || !t.multiSelect)
|
|
1398
|
-
return;
|
|
1399
|
-
let y = Te(n.selectedItems.value).slice();
|
|
1400
|
-
Object.keys(l.current).length > 0 && (y = y.filter((v) => !l.current[v]));
|
|
1401
|
-
const C = Fe(y), k = Hn(e, g, b), T = k.filter((v) => !C[v]);
|
|
1402
|
-
y = y.concat(T), c(f, y), l.current = Fe(k);
|
|
1403
|
-
};
|
|
1404
|
-
return {
|
|
1405
|
-
getRootProps: () => ({
|
|
1406
|
-
"aria-multiselectable": t.multiSelect
|
|
1407
|
-
}),
|
|
1408
|
-
publicAPI: {
|
|
1409
|
-
selectItem: u
|
|
1410
|
-
},
|
|
1411
|
-
instance: {
|
|
1412
|
-
isItemSelected: i,
|
|
1413
|
-
selectItem: u,
|
|
1414
|
-
selectAllNavigableItems: (f) => {
|
|
1415
|
-
if (t.disableSelection || !t.multiSelect)
|
|
1416
|
-
return;
|
|
1417
|
-
const g = Yn(e);
|
|
1418
|
-
c(f, g), l.current = Fe(g);
|
|
1419
|
-
},
|
|
1420
|
-
expandSelectionRange: (f, g) => {
|
|
1421
|
-
if (o.current != null) {
|
|
1422
|
-
const [b, y] = xt(e, g, o.current);
|
|
1423
|
-
d(f, [b, y]);
|
|
1424
|
-
}
|
|
1425
|
-
},
|
|
1426
|
-
selectRangeFromStartToItem: (f, g) => {
|
|
1427
|
-
d(f, [pe(e), g]);
|
|
1428
|
-
},
|
|
1429
|
-
selectRangeFromItemToEnd: (f, g) => {
|
|
1430
|
-
d(f, [g, yt(e)]);
|
|
1431
|
-
},
|
|
1432
|
-
selectItemFromArrowNavigation: (f, g, b) => {
|
|
1433
|
-
if (t.disableSelection || !t.multiSelect)
|
|
1434
|
-
return;
|
|
1435
|
-
let y = Te(n.selectedItems.value).slice();
|
|
1436
|
-
Object.keys(l.current).length === 0 ? (y.push(b), l.current = {
|
|
1437
|
-
[g]: !0,
|
|
1438
|
-
[b]: !0
|
|
1439
|
-
}) : (l.current[g] || (l.current = {}), l.current[b] ? (y = y.filter((C) => C !== g), delete l.current[g]) : (y.push(b), l.current[b] = !0)), c(f, y);
|
|
1440
|
-
}
|
|
1441
|
-
},
|
|
1442
|
-
contextValue: {
|
|
1443
|
-
selection: {
|
|
1444
|
-
multiSelect: t.multiSelect,
|
|
1445
|
-
checkboxSelection: t.checkboxSelection,
|
|
1446
|
-
disableSelection: t.disableSelection
|
|
1447
|
-
}
|
|
1448
|
-
}
|
|
1449
|
-
};
|
|
1450
|
-
};
|
|
1451
|
-
Re.models = {
|
|
1452
|
-
selectedItems: {
|
|
1453
|
-
getDefaultValue: (e) => e.defaultSelectedItems
|
|
1454
|
-
}
|
|
1455
|
-
};
|
|
1456
|
-
const Qn = [];
|
|
1457
|
-
Re.getDefaultizedParams = (e) => E({}, e, {
|
|
1458
|
-
disableSelection: e.disableSelection ?? !1,
|
|
1459
|
-
multiSelect: e.multiSelect ?? !1,
|
|
1460
|
-
checkboxSelection: e.checkboxSelection ?? !1,
|
|
1461
|
-
defaultSelectedItems: e.defaultSelectedItems ?? (e.multiSelect ? Qn : null)
|
|
1462
|
-
});
|
|
1463
|
-
Re.params = {
|
|
1464
|
-
disableSelection: !0,
|
|
1465
|
-
multiSelect: !0,
|
|
1466
|
-
checkboxSelection: !0,
|
|
1467
|
-
defaultSelectedItems: !0,
|
|
1468
|
-
selectedItems: !0,
|
|
1469
|
-
onSelectedItemsChange: !0,
|
|
1470
|
-
onItemSelectionToggle: !0
|
|
1471
|
-
};
|
|
1472
|
-
const tt = 1e3;
|
|
1473
|
-
class Zn {
|
|
1474
|
-
constructor(t = tt) {
|
|
1475
|
-
this.timeouts = /* @__PURE__ */ new Map(), this.cleanupTimeout = tt, this.cleanupTimeout = t;
|
|
1476
|
-
}
|
|
1477
|
-
register(t, n, o) {
|
|
1478
|
-
this.timeouts || (this.timeouts = /* @__PURE__ */ new Map());
|
|
1479
|
-
const l = setTimeout(() => {
|
|
1480
|
-
typeof n == "function" && n(), this.timeouts.delete(o.cleanupToken);
|
|
1481
|
-
}, this.cleanupTimeout);
|
|
1482
|
-
this.timeouts.set(o.cleanupToken, l);
|
|
1483
|
-
}
|
|
1484
|
-
unregister(t) {
|
|
1485
|
-
const n = this.timeouts.get(t.cleanupToken);
|
|
1486
|
-
n && (this.timeouts.delete(t.cleanupToken), clearTimeout(n));
|
|
1487
|
-
}
|
|
1488
|
-
reset() {
|
|
1489
|
-
this.timeouts && (this.timeouts.forEach((t, n) => {
|
|
1490
|
-
this.unregister({
|
|
1491
|
-
cleanupToken: n
|
|
1492
|
-
});
|
|
1493
|
-
}), this.timeouts = void 0);
|
|
1494
|
-
}
|
|
1495
|
-
}
|
|
1496
|
-
class eo {
|
|
1497
|
-
constructor() {
|
|
1498
|
-
this.registry = new FinalizationRegistry((t) => {
|
|
1499
|
-
typeof t == "function" && t();
|
|
1500
|
-
});
|
|
1501
|
-
}
|
|
1502
|
-
register(t, n, o) {
|
|
1503
|
-
this.registry.register(t, n, o);
|
|
1504
|
-
}
|
|
1505
|
-
unregister(t) {
|
|
1506
|
-
this.registry.unregister(t);
|
|
1507
|
-
}
|
|
1508
|
-
// eslint-disable-next-line class-methods-use-this
|
|
1509
|
-
reset() {
|
|
1510
|
-
}
|
|
1511
|
-
}
|
|
1512
|
-
class to {
|
|
1513
|
-
}
|
|
1514
|
-
function no(e) {
|
|
1515
|
-
let t = 0;
|
|
1516
|
-
return function(o, l, p) {
|
|
1517
|
-
e.registry === null && (e.registry = typeof FinalizationRegistry < "u" ? new eo() : new Zn());
|
|
1518
|
-
const [c] = x.useState(new to()), i = x.useRef(null), u = x.useRef();
|
|
1519
|
-
u.current = p;
|
|
1520
|
-
const d = x.useRef(null);
|
|
1521
|
-
if (!i.current && u.current) {
|
|
1522
|
-
const s = (a, m) => {
|
|
1523
|
-
var I;
|
|
1524
|
-
m.defaultMuiPrevented || (I = u.current) == null || I.call(u, a, m);
|
|
1525
|
-
};
|
|
1526
|
-
i.current = o.$$subscribeEvent(l, s), t += 1, d.current = {
|
|
1527
|
-
cleanupToken: t
|
|
1528
|
-
}, e.registry.register(
|
|
1529
|
-
c,
|
|
1530
|
-
// The callback below will be called once this reference stops being retained
|
|
1531
|
-
() => {
|
|
1532
|
-
var a;
|
|
1533
|
-
(a = i.current) == null || a.call(i), i.current = null, d.current = null;
|
|
1534
|
-
},
|
|
1535
|
-
d.current
|
|
1536
|
-
);
|
|
1537
|
-
} else !u.current && i.current && (i.current(), i.current = null, d.current && (e.registry.unregister(d.current), d.current = null));
|
|
1538
|
-
x.useEffect(() => {
|
|
1539
|
-
if (!i.current && u.current) {
|
|
1540
|
-
const s = (a, m) => {
|
|
1541
|
-
var I;
|
|
1542
|
-
m.defaultMuiPrevented || (I = u.current) == null || I.call(u, a, m);
|
|
1543
|
-
};
|
|
1544
|
-
i.current = o.$$subscribeEvent(l, s);
|
|
1545
|
-
}
|
|
1546
|
-
return d.current && e.registry && (e.registry.unregister(d.current), d.current = null), () => {
|
|
1547
|
-
var s;
|
|
1548
|
-
(s = i.current) == null || s.call(i), i.current = null;
|
|
1549
|
-
};
|
|
1550
|
-
}, [o, l]);
|
|
1551
|
-
};
|
|
1552
|
-
}
|
|
1553
|
-
const oo = {
|
|
1554
|
-
registry: null
|
|
1555
|
-
}, ro = no(oo), Et = (e = document) => {
|
|
1556
|
-
const t = e.activeElement;
|
|
1557
|
-
return t ? t.shadowRoot ? Et(t.shadowRoot) : t : null;
|
|
1558
|
-
};
|
|
1559
|
-
function io(e) {
|
|
1560
|
-
return e.replace(/["\\]/g, "\\$&");
|
|
1561
|
-
}
|
|
1562
|
-
const so = (e, t) => {
|
|
1563
|
-
let n = Te(t).find((o) => {
|
|
1564
|
-
if (!e.isItemNavigable(o))
|
|
1565
|
-
return !1;
|
|
1566
|
-
const l = e.getItemMeta(o);
|
|
1567
|
-
return l && (l.parentId == null || e.isItemExpanded(l.parentId));
|
|
1568
|
-
});
|
|
1569
|
-
return n == null && (n = pe(e)), n;
|
|
1570
|
-
}, ze = ({
|
|
1571
|
-
instance: e,
|
|
1572
|
-
params: t,
|
|
1573
|
-
state: n,
|
|
1574
|
-
setState: o,
|
|
1575
|
-
models: l,
|
|
1576
|
-
rootRef: p
|
|
1577
|
-
}) => {
|
|
1578
|
-
const c = so(e, l.selectedItems.value), i = G((g) => {
|
|
1579
|
-
const b = typeof g == "function" ? g(n.focusedItemId) : g;
|
|
1580
|
-
n.focusedItemId !== b && o((y) => E({}, y, {
|
|
1581
|
-
focusedItemId: b
|
|
1582
|
-
}));
|
|
1583
|
-
}), u = x.useCallback(() => !!p.current && p.current.contains(Et(nn(p.current))), [p]), d = x.useCallback((g) => n.focusedItemId === g && u(), [n.focusedItemId, u]), s = (g) => {
|
|
1584
|
-
const b = e.getItemMeta(g);
|
|
1585
|
-
return b && (b.parentId == null || e.isItemExpanded(b.parentId));
|
|
1586
|
-
}, a = (g, b) => {
|
|
1587
|
-
const y = e.getItemDOMElement(b);
|
|
1588
|
-
y && y.focus(), i(b), t.onItemFocus && t.onItemFocus(g, b);
|
|
1589
|
-
}, m = G((g, b) => {
|
|
1590
|
-
s(b) && a(g, b);
|
|
1591
|
-
}), I = G(() => {
|
|
1592
|
-
if (n.focusedItemId == null)
|
|
1593
|
-
return;
|
|
1594
|
-
const g = e.getItemMeta(n.focusedItemId);
|
|
1595
|
-
if (g) {
|
|
1596
|
-
const b = document.getElementById(e.getTreeItemIdAttribute(n.focusedItemId, g.idAttribute));
|
|
1597
|
-
b && b.blur();
|
|
1598
|
-
}
|
|
1599
|
-
i(null);
|
|
1600
|
-
}), h = (g) => g === c;
|
|
1601
|
-
ro(e, "removeItem", ({
|
|
1602
|
-
id: g
|
|
1603
|
-
}) => {
|
|
1604
|
-
n.focusedItemId === g && a(null, c);
|
|
1605
|
-
});
|
|
1606
|
-
const f = (g) => (b) => {
|
|
1607
|
-
var y;
|
|
1608
|
-
(y = g.onFocus) == null || y.call(g, b), !b.defaultMuiPrevented && b.target === b.currentTarget && a(b, c);
|
|
1609
|
-
};
|
|
1610
|
-
return {
|
|
1611
|
-
getRootProps: (g) => ({
|
|
1612
|
-
onFocus: f(g)
|
|
1613
|
-
}),
|
|
1614
|
-
publicAPI: {
|
|
1615
|
-
focusItem: m
|
|
1616
|
-
},
|
|
1617
|
-
instance: {
|
|
1618
|
-
isItemFocused: d,
|
|
1619
|
-
canItemBeTabbed: h,
|
|
1620
|
-
focusItem: m,
|
|
1621
|
-
removeFocusedItem: I
|
|
1622
|
-
}
|
|
1623
|
-
};
|
|
1624
|
-
};
|
|
1625
|
-
ze.getInitialState = () => ({
|
|
1626
|
-
focusedItemId: null
|
|
1627
|
-
});
|
|
1628
|
-
ze.params = {
|
|
1629
|
-
onItemFocus: !0
|
|
1630
|
-
};
|
|
1631
|
-
const we = (e, t) => e.getAvailablePlugins().has(t), lo = ({
|
|
1632
|
-
props: e
|
|
1633
|
-
}) => {
|
|
1634
|
-
const {
|
|
1635
|
-
instance: t
|
|
1636
|
-
} = le(), {
|
|
1637
|
-
label: n,
|
|
1638
|
-
itemId: o
|
|
1639
|
-
} = e, [l, p] = x.useState(n), c = t.isItemBeingEdited(o);
|
|
1640
|
-
return x.useEffect(() => {
|
|
1641
|
-
c || p(n);
|
|
1642
|
-
}, [c, n]), {
|
|
1643
|
-
propsEnhancers: {
|
|
1644
|
-
labelInput: ({
|
|
1645
|
-
externalEventHandlers: i,
|
|
1646
|
-
interactions: u
|
|
1647
|
-
}) => t.isItemEditable(o) ? {
|
|
1648
|
-
value: l ?? "",
|
|
1649
|
-
"data-element": "labelInput",
|
|
1650
|
-
onChange: (I) => {
|
|
1651
|
-
var h;
|
|
1652
|
-
(h = i.onChange) == null || h.call(i, I), p(I.target.value);
|
|
1653
|
-
},
|
|
1654
|
-
onKeyDown: (I) => {
|
|
1655
|
-
var f;
|
|
1656
|
-
if ((f = i.onKeyDown) == null || f.call(i, I), I.defaultMuiPrevented)
|
|
1657
|
-
return;
|
|
1658
|
-
const h = I.target;
|
|
1659
|
-
I.key === "Enter" && h.value ? u.handleSaveItemLabel(I, h.value) : I.key === "Escape" && u.handleCancelItemLabelEditing(I);
|
|
1660
|
-
},
|
|
1661
|
-
onBlur: (I) => {
|
|
1662
|
-
var h;
|
|
1663
|
-
(h = i.onBlur) == null || h.call(i, I), !I.defaultMuiPrevented && I.target.value && u.handleSaveItemLabel(I, I.target.value);
|
|
1664
|
-
},
|
|
1665
|
-
autoFocus: !0,
|
|
1666
|
-
type: "text"
|
|
1667
|
-
} : {}
|
|
1668
|
-
}
|
|
1669
|
-
};
|
|
1670
|
-
}, ee = ({
|
|
1671
|
-
instance: e,
|
|
1672
|
-
state: t,
|
|
1673
|
-
setState: n,
|
|
1674
|
-
params: o,
|
|
1675
|
-
experimentalFeatures: l
|
|
1676
|
-
}) => {
|
|
1677
|
-
process.env.NODE_ENV !== "production" && o.isItemEditable && !(l != null && l.labelEditing) && dt(["MUI X: The label editing feature requires the `labelEditing` experimental feature to be enabled.", "You can do it by passing `experimentalFeatures={{ labelEditing: true}}` to the `RichTreeViewPro` component.", "Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/editing/"]);
|
|
1678
|
-
const p = x.useRef(t.editedItemId), c = (m) => p.current === m, i = (m) => {
|
|
1679
|
-
n((I) => E({}, I, {
|
|
1680
|
-
editedItemId: m
|
|
1681
|
-
})), p.current = m;
|
|
1682
|
-
}, u = (m) => m === t.editedItemId, d = !!o.isItemEditable && !!l.labelEditing, s = (m) => {
|
|
1683
|
-
if (m == null || !d)
|
|
1684
|
-
return !1;
|
|
1685
|
-
const I = e.getItem(m);
|
|
1686
|
-
return I ? typeof o.isItemEditable == "function" ? o.isItemEditable(I) : !!o.isItemEditable : !1;
|
|
1687
|
-
}, a = (m, I) => {
|
|
1688
|
-
if (!I)
|
|
1689
|
-
throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.", "The label of an item cannot be empty.", m].join(`
|
|
1690
|
-
`));
|
|
1691
|
-
n((h) => {
|
|
1692
|
-
const f = h.items.itemMetaMap[m];
|
|
1693
|
-
return f.label !== I ? E({}, h, {
|
|
1694
|
-
items: E({}, h.items, {
|
|
1695
|
-
itemMetaMap: E({}, h.items.itemMetaMap, {
|
|
1696
|
-
[m]: E({}, f, {
|
|
1697
|
-
label: I
|
|
1698
|
-
})
|
|
1699
|
-
})
|
|
1700
|
-
})
|
|
1701
|
-
}) : h;
|
|
1702
|
-
}), o.onItemLabelChange && o.onItemLabelChange(m, I);
|
|
1703
|
-
};
|
|
1704
|
-
return {
|
|
1705
|
-
instance: {
|
|
1706
|
-
setEditedItemId: i,
|
|
1707
|
-
isItemBeingEdited: u,
|
|
1708
|
-
updateItemLabel: a,
|
|
1709
|
-
isItemEditable: s,
|
|
1710
|
-
isTreeViewEditable: d,
|
|
1711
|
-
isItemBeingEditedRef: c
|
|
1712
|
-
},
|
|
1713
|
-
publicAPI: {
|
|
1714
|
-
updateItemLabel: a
|
|
1715
|
-
}
|
|
1716
|
-
};
|
|
1717
|
-
};
|
|
1718
|
-
ee.itemPlugin = lo;
|
|
1719
|
-
ee.getInitialState = () => ({
|
|
1720
|
-
editedItemId: null
|
|
1721
|
-
});
|
|
1722
|
-
ee.params = {
|
|
1723
|
-
onItemLabelChange: !0,
|
|
1724
|
-
isItemEditable: !0
|
|
1725
|
-
};
|
|
1726
|
-
function ao(e) {
|
|
1727
|
-
return !!e && e.length === 1 && !!e.match(/\S/);
|
|
1728
|
-
}
|
|
1729
|
-
const Ct = ({
|
|
1730
|
-
instance: e,
|
|
1731
|
-
params: t,
|
|
1732
|
-
state: n
|
|
1733
|
-
}) => {
|
|
1734
|
-
const o = on(), l = x.useRef({}), p = G((s) => {
|
|
1735
|
-
l.current = s(l.current);
|
|
1736
|
-
});
|
|
1737
|
-
x.useEffect(() => {
|
|
1738
|
-
if (e.areItemUpdatesPrevented())
|
|
1739
|
-
return;
|
|
1740
|
-
const s = {}, a = (m) => {
|
|
1741
|
-
s[m.id] = m.label.substring(0, 1).toLowerCase();
|
|
1742
|
-
};
|
|
1743
|
-
Object.values(n.items.itemMetaMap).forEach(a), l.current = s;
|
|
1744
|
-
}, [n.items.itemMetaMap, t.getItemId, e]);
|
|
1745
|
-
const c = (s, a) => {
|
|
1746
|
-
const m = a.toLowerCase(), I = (b) => {
|
|
1747
|
-
const y = Ce(e, b);
|
|
1748
|
-
return y === null ? pe(e) : y;
|
|
1749
|
-
};
|
|
1750
|
-
let h = null, f = I(s);
|
|
1751
|
-
const g = {};
|
|
1752
|
-
for (; h == null && !g[f]; )
|
|
1753
|
-
l.current[f] === m ? h = f : (g[f] = !0, f = I(f));
|
|
1754
|
-
return h;
|
|
1755
|
-
}, i = (s) => !t.disableSelection && !e.isItemDisabled(s), u = (s) => !e.isItemDisabled(s) && e.isItemExpandable(s);
|
|
1756
|
-
return {
|
|
1757
|
-
instance: {
|
|
1758
|
-
updateFirstCharMap: p,
|
|
1759
|
-
handleItemKeyDown: (s, a) => {
|
|
1760
|
-
if (s.defaultMuiPrevented || s.altKey || $e(s.target, s.currentTarget))
|
|
1761
|
-
return;
|
|
1762
|
-
const m = s.ctrlKey || s.metaKey, I = s.key;
|
|
1763
|
-
switch (!0) {
|
|
1764
|
-
case (I === " " && i(a)): {
|
|
1765
|
-
s.preventDefault(), t.multiSelect && s.shiftKey ? e.expandSelectionRange(s, a) : e.selectItem({
|
|
1766
|
-
event: s,
|
|
1767
|
-
itemId: a,
|
|
1768
|
-
keepExistingSelection: t.multiSelect,
|
|
1769
|
-
shouldBeSelected: t.multiSelect ? void 0 : !0
|
|
1770
|
-
});
|
|
1771
|
-
break;
|
|
1772
|
-
}
|
|
1773
|
-
case I === "Enter": {
|
|
1774
|
-
we(e, ee) && e.isItemEditable(a) && !e.isItemBeingEdited(a) ? e.setEditedItemId(a) : u(a) ? (e.toggleItemExpansion(s, a), s.preventDefault()) : i(a) && (t.multiSelect ? (s.preventDefault(), e.selectItem({
|
|
1775
|
-
event: s,
|
|
1776
|
-
itemId: a,
|
|
1777
|
-
keepExistingSelection: !0
|
|
1778
|
-
})) : e.isItemSelected(a) || (e.selectItem({
|
|
1779
|
-
event: s,
|
|
1780
|
-
itemId: a
|
|
1781
|
-
}), s.preventDefault()));
|
|
1782
|
-
break;
|
|
1783
|
-
}
|
|
1784
|
-
case I === "ArrowDown": {
|
|
1785
|
-
const h = Ce(e, a);
|
|
1786
|
-
h && (s.preventDefault(), e.focusItem(s, h), t.multiSelect && s.shiftKey && i(h) && e.selectItemFromArrowNavigation(s, a, h));
|
|
1787
|
-
break;
|
|
1788
|
-
}
|
|
1789
|
-
case I === "ArrowUp": {
|
|
1790
|
-
const h = bt(e, a);
|
|
1791
|
-
h && (s.preventDefault(), e.focusItem(s, h), t.multiSelect && s.shiftKey && i(h) && e.selectItemFromArrowNavigation(s, a, h));
|
|
1792
|
-
break;
|
|
1793
|
-
}
|
|
1794
|
-
case (I === "ArrowRight" && !o || I === "ArrowLeft" && o): {
|
|
1795
|
-
if (e.isItemExpanded(a)) {
|
|
1796
|
-
const h = Ce(e, a);
|
|
1797
|
-
h && (e.focusItem(s, h), s.preventDefault());
|
|
1798
|
-
} else u(a) && (e.toggleItemExpansion(s, a), s.preventDefault());
|
|
1799
|
-
break;
|
|
1800
|
-
}
|
|
1801
|
-
case (I === "ArrowLeft" && !o || I === "ArrowRight" && o): {
|
|
1802
|
-
if (u(a) && e.isItemExpanded(a))
|
|
1803
|
-
e.toggleItemExpansion(s, a), s.preventDefault();
|
|
1804
|
-
else {
|
|
1805
|
-
const h = e.getItemMeta(a).parentId;
|
|
1806
|
-
h && (e.focusItem(s, h), s.preventDefault());
|
|
1807
|
-
}
|
|
1808
|
-
break;
|
|
1809
|
-
}
|
|
1810
|
-
case I === "Home": {
|
|
1811
|
-
i(a) && t.multiSelect && m && s.shiftKey ? e.selectRangeFromStartToItem(s, a) : e.focusItem(s, pe(e)), s.preventDefault();
|
|
1812
|
-
break;
|
|
1813
|
-
}
|
|
1814
|
-
case I === "End": {
|
|
1815
|
-
i(a) && t.multiSelect && m && s.shiftKey ? e.selectRangeFromItemToEnd(s, a) : e.focusItem(s, yt(e)), s.preventDefault();
|
|
1816
|
-
break;
|
|
1817
|
-
}
|
|
1818
|
-
case I === "*": {
|
|
1819
|
-
e.expandAllSiblings(s, a), s.preventDefault();
|
|
1820
|
-
break;
|
|
1821
|
-
}
|
|
1822
|
-
case (I === "a" && m && t.multiSelect && !t.disableSelection): {
|
|
1823
|
-
e.selectAllNavigableItems(s), s.preventDefault();
|
|
1824
|
-
break;
|
|
1825
|
-
}
|
|
1826
|
-
case (!m && !s.shiftKey && ao(I)): {
|
|
1827
|
-
const h = c(a, I);
|
|
1828
|
-
h != null && (e.focusItem(s, h), s.preventDefault());
|
|
1829
|
-
break;
|
|
1830
|
-
}
|
|
1831
|
-
}
|
|
1832
|
-
}
|
|
1833
|
-
}
|
|
1834
|
-
};
|
|
1835
|
-
};
|
|
1836
|
-
Ct.params = {};
|
|
1837
|
-
const Tt = ({
|
|
1838
|
-
slots: e,
|
|
1839
|
-
slotProps: t
|
|
1840
|
-
}) => ({
|
|
1841
|
-
contextValue: {
|
|
1842
|
-
icons: {
|
|
1843
|
-
slots: {
|
|
1844
|
-
collapseIcon: e.collapseIcon,
|
|
1845
|
-
expandIcon: e.expandIcon,
|
|
1846
|
-
endIcon: e.endIcon
|
|
1847
|
-
},
|
|
1848
|
-
slotProps: {
|
|
1849
|
-
collapseIcon: t.collapseIcon,
|
|
1850
|
-
expandIcon: t.expandIcon,
|
|
1851
|
-
endIcon: t.endIcon
|
|
1852
|
-
}
|
|
1853
|
-
}
|
|
1854
|
-
}
|
|
1855
|
-
});
|
|
1856
|
-
Tt.params = {};
|
|
1857
|
-
const Be = /* @__PURE__ */ x.createContext(null);
|
|
1858
|
-
process.env.NODE_ENV !== "production" && (Be.displayName = "TreeViewChildrenItemContext");
|
|
1859
|
-
function _e(e) {
|
|
1860
|
-
const {
|
|
1861
|
-
children: t,
|
|
1862
|
-
itemId: n = null
|
|
1863
|
-
} = e, {
|
|
1864
|
-
instance: o,
|
|
1865
|
-
rootRef: l
|
|
1866
|
-
} = le(), p = x.useRef(/* @__PURE__ */ new Map());
|
|
1867
|
-
x.useEffect(() => {
|
|
1868
|
-
if (!l.current)
|
|
1869
|
-
return;
|
|
1870
|
-
let i = null;
|
|
1871
|
-
if (n == null)
|
|
1872
|
-
i = l.current.id;
|
|
1873
|
-
else {
|
|
1874
|
-
const I = o.getItemMeta(n);
|
|
1875
|
-
I !== void 0 && (i = o.getTreeItemIdAttribute(n, I.idAttribute));
|
|
1876
|
-
}
|
|
1877
|
-
if (i == null)
|
|
1878
|
-
return;
|
|
1879
|
-
const u = o.getItemOrderedChildrenIds(n ?? null) ?? [], d = io(i), s = l.current.querySelectorAll(`${n == null ? "" : `*[id="${d}"] `}[role="treeitem"]:not(*[id="${d}"] [role="treeitem"] [role="treeitem"])`), a = Array.from(s).map((I) => p.current.get(I.id));
|
|
1880
|
-
(a.length !== u.length || a.some((I, h) => I !== u[h])) && o.setJSXItemsOrderedChildrenIds(n ?? null, a);
|
|
1881
|
-
});
|
|
1882
|
-
const c = x.useMemo(() => ({
|
|
1883
|
-
registerChild: (i, u) => p.current.set(i, u),
|
|
1884
|
-
unregisterChild: (i) => p.current.delete(i),
|
|
1885
|
-
parentId: n
|
|
1886
|
-
}), [n]);
|
|
1887
|
-
return /* @__PURE__ */ w(Be.Provider, {
|
|
1888
|
-
value: c,
|
|
1889
|
-
children: t
|
|
1890
|
-
});
|
|
1891
|
-
}
|
|
1892
|
-
process.env.NODE_ENV !== "production" && (_e.propTypes = {
|
|
1893
|
-
children: r.node,
|
|
1894
|
-
id: r.string
|
|
1895
|
-
});
|
|
1896
|
-
const be = ({
|
|
1897
|
-
instance: e,
|
|
1898
|
-
setState: t
|
|
1899
|
-
}) => {
|
|
1900
|
-
e.preventItemUpdates();
|
|
1901
|
-
const n = G((p) => (t((c) => {
|
|
1902
|
-
if (c.items.itemMetaMap[p.id] != null)
|
|
1903
|
-
throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", `Two items were provided with the same id in the \`items\` prop: "${p.id}"`].join(`
|
|
1904
|
-
`));
|
|
1905
|
-
return E({}, c, {
|
|
1906
|
-
items: E({}, c.items, {
|
|
1907
|
-
itemMetaMap: E({}, c.items.itemMetaMap, {
|
|
1908
|
-
[p.id]: p
|
|
1909
|
-
}),
|
|
1910
|
-
// For `SimpleTreeView`, we don't have a proper `item` object, so we create a very basic one.
|
|
1911
|
-
itemMap: E({}, c.items.itemMap, {
|
|
1912
|
-
[p.id]: {
|
|
1913
|
-
id: p.id,
|
|
1914
|
-
label: p.label
|
|
1915
|
-
}
|
|
1916
|
-
})
|
|
1917
|
-
})
|
|
1918
|
-
});
|
|
1919
|
-
}), () => {
|
|
1920
|
-
t((c) => {
|
|
1921
|
-
const i = E({}, c.items.itemMetaMap), u = E({}, c.items.itemMap);
|
|
1922
|
-
return delete i[p.id], delete u[p.id], E({}, c, {
|
|
1923
|
-
items: E({}, c.items, {
|
|
1924
|
-
itemMetaMap: i,
|
|
1925
|
-
itemMap: u
|
|
1926
|
-
})
|
|
1927
|
-
});
|
|
1928
|
-
}), mt(e, "removeItem", {
|
|
1929
|
-
id: p.id
|
|
1930
|
-
});
|
|
1931
|
-
})), o = (p, c) => {
|
|
1932
|
-
const i = p ?? Z;
|
|
1933
|
-
t((u) => E({}, u, {
|
|
1934
|
-
items: E({}, u.items, {
|
|
1935
|
-
itemOrderedChildrenIds: E({}, u.items.itemOrderedChildrenIds, {
|
|
1936
|
-
[i]: c
|
|
1937
|
-
}),
|
|
1938
|
-
itemChildrenIndexes: E({}, u.items.itemChildrenIndexes, {
|
|
1939
|
-
[i]: It(c)
|
|
1940
|
-
})
|
|
1941
|
-
})
|
|
1942
|
-
}));
|
|
1943
|
-
}, l = G((p, c) => (e.updateFirstCharMap((i) => (i[p] = c, i)), () => {
|
|
1944
|
-
e.updateFirstCharMap((i) => {
|
|
1945
|
-
const u = E({}, i);
|
|
1946
|
-
return delete u[p], u;
|
|
1947
|
-
});
|
|
1948
|
-
}));
|
|
1949
|
-
return {
|
|
1950
|
-
instance: {
|
|
1951
|
-
insertJSXItem: n,
|
|
1952
|
-
setJSXItemsOrderedChildrenIds: o,
|
|
1953
|
-
mapFirstCharFromJSX: l
|
|
1954
|
-
}
|
|
1955
|
-
};
|
|
1956
|
-
}, wt = (e) => Array.isArray(e) ? e.length > 0 && e.some(wt) : !!e, co = ({
|
|
1957
|
-
props: e,
|
|
1958
|
-
rootRef: t,
|
|
1959
|
-
contentRef: n
|
|
1960
|
-
}) => {
|
|
1961
|
-
const {
|
|
1962
|
-
instance: o
|
|
1963
|
-
} = le(), {
|
|
1964
|
-
children: l,
|
|
1965
|
-
disabled: p = !1,
|
|
1966
|
-
label: c,
|
|
1967
|
-
itemId: i,
|
|
1968
|
-
id: u
|
|
1969
|
-
} = e, d = x.useContext(Be);
|
|
1970
|
-
if (d == null)
|
|
1971
|
-
throw new Error(["MUI X: Could not find the Tree View Children Item context.", "It looks like you rendered your component outside of a SimpleTreeView parent component.", "This can also happen if you are bundling multiple versions of the Tree View."].join(`
|
|
1972
|
-
`));
|
|
1973
|
-
const {
|
|
1974
|
-
registerChild: s,
|
|
1975
|
-
unregisterChild: a,
|
|
1976
|
-
parentId: m
|
|
1977
|
-
} = d, I = wt(l), h = x.useRef(null), f = de(h, n);
|
|
1978
|
-
return rn(() => {
|
|
1979
|
-
const g = o.getTreeItemIdAttribute(i, u);
|
|
1980
|
-
return s(g, i), () => {
|
|
1981
|
-
a(g);
|
|
1982
|
-
};
|
|
1983
|
-
}, [o, s, a, i, u]), x.useEffect(() => o.insertJSXItem({
|
|
1984
|
-
id: i,
|
|
1985
|
-
idAttribute: u,
|
|
1986
|
-
parentId: m,
|
|
1987
|
-
expandable: I,
|
|
1988
|
-
disabled: p
|
|
1989
|
-
}), [o, m, i, I, p, u]), x.useEffect(() => {
|
|
1990
|
-
var g;
|
|
1991
|
-
if (c)
|
|
1992
|
-
return o.mapFirstCharFromJSX(i, (((g = h.current) == null ? void 0 : g.textContent) ?? "").substring(0, 1).toLowerCase());
|
|
1993
|
-
}, [o, i, c]), {
|
|
1994
|
-
contentRef: f,
|
|
1995
|
-
rootRef: t
|
|
1996
|
-
};
|
|
1997
|
-
};
|
|
1998
|
-
be.itemPlugin = co;
|
|
1999
|
-
be.wrapItem = ({
|
|
2000
|
-
children: e,
|
|
2001
|
-
itemId: t
|
|
2002
|
-
}) => {
|
|
2003
|
-
const n = x.useContext(se);
|
|
2004
|
-
return /* @__PURE__ */ w(_e, {
|
|
2005
|
-
itemId: t,
|
|
2006
|
-
children: /* @__PURE__ */ w(se.Provider, {
|
|
2007
|
-
value: n + 1,
|
|
2008
|
-
children: e
|
|
2009
|
-
})
|
|
2010
|
-
});
|
|
2011
|
-
};
|
|
2012
|
-
be.wrapRoot = ({
|
|
2013
|
-
children: e
|
|
2014
|
-
}) => /* @__PURE__ */ w(_e, {
|
|
2015
|
-
children: /* @__PURE__ */ w(se.Provider, {
|
|
2016
|
-
value: 0,
|
|
2017
|
-
children: e
|
|
2018
|
-
})
|
|
2019
|
-
});
|
|
2020
|
-
be.params = {};
|
|
2021
|
-
const uo = [he, Se, Re, ze, Ct, Tt, be], po = ct(), fo = (e) => {
|
|
2022
|
-
const {
|
|
2023
|
-
classes: t
|
|
2024
|
-
} = e;
|
|
2025
|
-
return ge({
|
|
2026
|
-
root: ["root"]
|
|
2027
|
-
}, Ln, t);
|
|
2028
|
-
}, mo = U("ul", {
|
|
2029
|
-
name: "MuiSimpleTreeView",
|
|
2030
|
-
slot: "Root",
|
|
2031
|
-
overridesResolver: (e, t) => t.root
|
|
2032
|
-
})({
|
|
2033
|
-
padding: 0,
|
|
2034
|
-
margin: 0,
|
|
2035
|
-
listStyle: "none",
|
|
2036
|
-
outline: 0,
|
|
2037
|
-
position: "relative"
|
|
2038
|
-
}), Io = [], vt = /* @__PURE__ */ x.forwardRef(function(t, n) {
|
|
2039
|
-
const o = po({
|
|
2040
|
-
props: t,
|
|
2041
|
-
name: "MuiSimpleTreeView"
|
|
2042
|
-
}), l = o;
|
|
2043
|
-
process.env.NODE_ENV !== "production" && o.items != null && dt(["MUI X: The `SimpleTreeView` component does not support the `items` prop.", "If you want to add items, you need to pass them as JSX children.", "Check the documentation for more details: https://mui.com/x/react-tree-view/simple-tree-view/items/."]);
|
|
2044
|
-
const {
|
|
2045
|
-
getRootProps: p,
|
|
2046
|
-
contextValue: c
|
|
2047
|
-
} = Xn({
|
|
2048
|
-
plugins: uo,
|
|
2049
|
-
rootRef: n,
|
|
2050
|
-
props: E({}, o, {
|
|
2051
|
-
items: Io
|
|
2052
|
-
})
|
|
2053
|
-
}), {
|
|
2054
|
-
slots: i,
|
|
2055
|
-
slotProps: u
|
|
2056
|
-
} = o, d = fo(o), s = (i == null ? void 0 : i.root) ?? mo, a = ce({
|
|
2057
|
-
elementType: s,
|
|
2058
|
-
externalSlotProps: u == null ? void 0 : u.root,
|
|
2059
|
-
className: d.root,
|
|
2060
|
-
getSlotProps: p,
|
|
2061
|
-
ownerState: l
|
|
2062
|
-
});
|
|
2063
|
-
return /* @__PURE__ */ w(Wn, {
|
|
2064
|
-
value: c,
|
|
2065
|
-
children: /* @__PURE__ */ w(s, E({}, a))
|
|
2066
|
-
});
|
|
2067
|
-
});
|
|
2068
|
-
process.env.NODE_ENV !== "production" && (vt.propTypes = {
|
|
2069
|
-
// ----------------------------- Warning --------------------------------
|
|
2070
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
2071
|
-
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
2072
|
-
// ----------------------------------------------------------------------
|
|
2073
|
-
/**
|
|
2074
|
-
* The ref object that allows Tree View manipulation. Can be instantiated with `useTreeViewApiRef()`.
|
|
2075
|
-
*/
|
|
2076
|
-
apiRef: r.shape({
|
|
2077
|
-
current: r.shape({
|
|
2078
|
-
focusItem: r.func.isRequired,
|
|
2079
|
-
getItem: r.func.isRequired,
|
|
2080
|
-
getItemDOMElement: r.func.isRequired,
|
|
2081
|
-
getItemOrderedChildrenIds: r.func.isRequired,
|
|
2082
|
-
getItemTree: r.func.isRequired,
|
|
2083
|
-
selectItem: r.func.isRequired,
|
|
2084
|
-
setItemExpansion: r.func.isRequired
|
|
2085
|
-
})
|
|
2086
|
-
}),
|
|
2087
|
-
/**
|
|
2088
|
-
* If `true`, the tree view renders a checkbox at the left of its label that allows selecting it.
|
|
2089
|
-
* @default false
|
|
2090
|
-
*/
|
|
2091
|
-
checkboxSelection: r.bool,
|
|
2092
|
-
/**
|
|
2093
|
-
* The content of the component.
|
|
2094
|
-
*/
|
|
2095
|
-
children: r.node,
|
|
2096
|
-
/**
|
|
2097
|
-
* Override or extend the styles applied to the component.
|
|
2098
|
-
*/
|
|
2099
|
-
classes: r.object,
|
|
2100
|
-
className: r.string,
|
|
2101
|
-
/**
|
|
2102
|
-
* Expanded item ids.
|
|
2103
|
-
* Used when the item's expansion is not controlled.
|
|
2104
|
-
* @default []
|
|
2105
|
-
*/
|
|
2106
|
-
defaultExpandedItems: r.arrayOf(r.string),
|
|
2107
|
-
/**
|
|
2108
|
-
* Selected item ids. (Uncontrolled)
|
|
2109
|
-
* When `multiSelect` is true this takes an array of strings; when false (default) a string.
|
|
2110
|
-
* @default []
|
|
2111
|
-
*/
|
|
2112
|
-
defaultSelectedItems: r.any,
|
|
2113
|
-
/**
|
|
2114
|
-
* If `true`, will allow focus on disabled items.
|
|
2115
|
-
* @default false
|
|
2116
|
-
*/
|
|
2117
|
-
disabledItemsFocusable: r.bool,
|
|
2118
|
-
/**
|
|
2119
|
-
* If `true` selection is disabled.
|
|
2120
|
-
* @default false
|
|
2121
|
-
*/
|
|
2122
|
-
disableSelection: r.bool,
|
|
2123
|
-
/**
|
|
2124
|
-
* Expanded item ids.
|
|
2125
|
-
* Used when the item's expansion is controlled.
|
|
2126
|
-
*/
|
|
2127
|
-
expandedItems: r.arrayOf(r.string),
|
|
2128
|
-
/**
|
|
2129
|
-
* The slot that triggers the item's expansion when clicked.
|
|
2130
|
-
* @default 'content'
|
|
2131
|
-
*/
|
|
2132
|
-
expansionTrigger: r.oneOf(["content", "iconContainer"]),
|
|
2133
|
-
/**
|
|
2134
|
-
* Unstable features, breaking changes might be introduced.
|
|
2135
|
-
* For each feature, if the flag is not explicitly set to `true`,
|
|
2136
|
-
* the feature will be fully disabled and any property / method call will not have any effect.
|
|
2137
|
-
*/
|
|
2138
|
-
experimentalFeatures: r.shape({
|
|
2139
|
-
indentationAtItemLevel: r.bool
|
|
2140
|
-
}),
|
|
2141
|
-
/**
|
|
2142
|
-
* This prop is used to help implement the accessibility logic.
|
|
2143
|
-
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
2144
|
-
*/
|
|
2145
|
-
id: r.string,
|
|
2146
|
-
/**
|
|
2147
|
-
* Horizontal indentation between an item and its children.
|
|
2148
|
-
* Examples: 24, "24px", "2rem", "2em".
|
|
2149
|
-
* @default 12px
|
|
2150
|
-
*/
|
|
2151
|
-
itemChildrenIndentation: r.oneOfType([r.number, r.string]),
|
|
2152
|
-
/**
|
|
2153
|
-
* If `true`, `ctrl` and `shift` will trigger multiselect.
|
|
2154
|
-
* @default false
|
|
2155
|
-
*/
|
|
2156
|
-
multiSelect: r.bool,
|
|
2157
|
-
/**
|
|
2158
|
-
* Callback fired when tree items are expanded/collapsed.
|
|
2159
|
-
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
2160
|
-
* @param {array} itemIds The ids of the expanded items.
|
|
2161
|
-
*/
|
|
2162
|
-
onExpandedItemsChange: r.func,
|
|
2163
|
-
/**
|
|
2164
|
-
* Callback fired when the `content` slot of a given tree item is clicked.
|
|
2165
|
-
* @param {React.MouseEvent} event The DOM event that triggered the change.
|
|
2166
|
-
* @param {string} itemId The id of the focused item.
|
|
2167
|
-
*/
|
|
2168
|
-
onItemClick: r.func,
|
|
2169
|
-
/**
|
|
2170
|
-
* Callback fired when a tree item is expanded or collapsed.
|
|
2171
|
-
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
2172
|
-
* @param {array} itemId The itemId of the modified item.
|
|
2173
|
-
* @param {array} isExpanded `true` if the item has just been expanded, `false` if it has just been collapsed.
|
|
2174
|
-
*/
|
|
2175
|
-
onItemExpansionToggle: r.func,
|
|
2176
|
-
/**
|
|
2177
|
-
* Callback fired when a given tree item is focused.
|
|
2178
|
-
* @param {React.SyntheticEvent | null} event The DOM event that triggered the change. **Warning**: This is a generic event not a focus event.
|
|
2179
|
-
* @param {string} itemId The id of the focused item.
|
|
2180
|
-
*/
|
|
2181
|
-
onItemFocus: r.func,
|
|
2182
|
-
/**
|
|
2183
|
-
* Callback fired when a tree item is selected or deselected.
|
|
2184
|
-
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
2185
|
-
* @param {array} itemId The itemId of the modified item.
|
|
2186
|
-
* @param {array} isSelected `true` if the item has just been selected, `false` if it has just been deselected.
|
|
2187
|
-
*/
|
|
2188
|
-
onItemSelectionToggle: r.func,
|
|
2189
|
-
/**
|
|
2190
|
-
* Callback fired when tree items are selected/deselected.
|
|
2191
|
-
* @param {React.SyntheticEvent} event The DOM event that triggered the change.
|
|
2192
|
-
* @param {string[] | string} itemIds The ids of the selected items.
|
|
2193
|
-
* When `multiSelect` is `true`, this is an array of strings; when false (default) a string.
|
|
2194
|
-
*/
|
|
2195
|
-
onSelectedItemsChange: r.func,
|
|
2196
|
-
/**
|
|
2197
|
-
* Selected item ids. (Controlled)
|
|
2198
|
-
* When `multiSelect` is true this takes an array of strings; when false (default) a string.
|
|
2199
|
-
*/
|
|
2200
|
-
selectedItems: r.any,
|
|
2201
|
-
/**
|
|
2202
|
-
* The props used for each component slot.
|
|
2203
|
-
*/
|
|
2204
|
-
slotProps: r.object,
|
|
2205
|
-
/**
|
|
2206
|
-
* Overridable component slots.
|
|
2207
|
-
*/
|
|
2208
|
-
slots: r.object,
|
|
2209
|
-
/**
|
|
2210
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
2211
|
-
*/
|
|
2212
|
-
sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object])
|
|
2213
|
-
});
|
|
2214
|
-
function St(e) {
|
|
2215
|
-
const {
|
|
2216
|
-
instance: t,
|
|
2217
|
-
items: {
|
|
2218
|
-
onItemClick: n
|
|
2219
|
-
},
|
|
2220
|
-
selection: {
|
|
2221
|
-
multiSelect: o,
|
|
2222
|
-
checkboxSelection: l,
|
|
2223
|
-
disableSelection: p
|
|
2224
|
-
},
|
|
2225
|
-
expansion: {
|
|
2226
|
-
expansionTrigger: c
|
|
2227
|
-
}
|
|
2228
|
-
} = le(), i = t.isItemExpandable(e), u = t.isItemExpanded(e), d = t.isItemFocused(e), s = t.isItemSelected(e), a = t.isItemDisabled(e), m = t != null && t.isItemBeingEdited ? t == null ? void 0 : t.isItemBeingEdited(e) : !1, I = t.isItemEditable ? t.isItemEditable(e) : !1, h = (T) => {
|
|
2229
|
-
if (!a) {
|
|
2230
|
-
d || t.focusItem(T, e);
|
|
2231
|
-
const v = o && (T.shiftKey || T.ctrlKey || T.metaKey);
|
|
2232
|
-
i && !(v && t.isItemExpanded(e)) && t.toggleItemExpansion(T, e);
|
|
2233
|
-
}
|
|
2234
|
-
}, f = (T) => {
|
|
2235
|
-
a || (d || t.focusItem(T, e), o && (T.shiftKey || T.ctrlKey || T.metaKey) ? T.shiftKey ? t.expandSelectionRange(T, e) : t.selectItem({
|
|
2236
|
-
event: T,
|
|
2237
|
-
itemId: e,
|
|
2238
|
-
keepExistingSelection: !0
|
|
2239
|
-
}) : t.selectItem({
|
|
2240
|
-
event: T,
|
|
2241
|
-
itemId: e,
|
|
2242
|
-
shouldBeSelected: !0
|
|
2243
|
-
}));
|
|
2244
|
-
}, g = (T) => {
|
|
2245
|
-
if (p || a)
|
|
2246
|
-
return;
|
|
2247
|
-
const v = T.nativeEvent.shiftKey;
|
|
2248
|
-
o && v ? t.expandSelectionRange(T, e) : t.selectItem({
|
|
2249
|
-
event: T,
|
|
2250
|
-
itemId: e,
|
|
2251
|
-
keepExistingSelection: o,
|
|
2252
|
-
shouldBeSelected: T.target.checked
|
|
2253
|
-
});
|
|
2254
|
-
}, b = (T) => {
|
|
2255
|
-
(T.shiftKey || T.ctrlKey || T.metaKey || a) && T.preventDefault();
|
|
2256
|
-
}, y = () => {
|
|
2257
|
-
we(t, ee) && t.isItemEditable(e) && (t.isItemBeingEdited(e) ? t.setEditedItemId(null) : t.setEditedItemId(e));
|
|
2258
|
-
};
|
|
2259
|
-
return {
|
|
2260
|
-
disabled: a,
|
|
2261
|
-
expanded: u,
|
|
2262
|
-
selected: s,
|
|
2263
|
-
focused: d,
|
|
2264
|
-
editable: I,
|
|
2265
|
-
editing: m,
|
|
2266
|
-
disableSelection: p,
|
|
2267
|
-
checkboxSelection: l,
|
|
2268
|
-
handleExpansion: h,
|
|
2269
|
-
handleSelection: f,
|
|
2270
|
-
handleCheckboxSelection: g,
|
|
2271
|
-
handleContentClick: n,
|
|
2272
|
-
preventSelection: b,
|
|
2273
|
-
expansionTrigger: c,
|
|
2274
|
-
toggleItemEditing: y,
|
|
2275
|
-
handleSaveItemLabel: (T, v) => {
|
|
2276
|
-
we(t, ee) && t.isItemBeingEditedRef(e) && (t.updateItemLabel(e, v), y(), t.focusItem(T, e));
|
|
2277
|
-
},
|
|
2278
|
-
handleCancelItemLabelEditing: (T) => {
|
|
2279
|
-
we(t, ee) && t.isItemBeingEditedRef(e) && (y(), t.focusItem(T, e));
|
|
2280
|
-
}
|
|
2281
|
-
};
|
|
2282
|
-
}
|
|
2283
|
-
const go = U("div", {
|
|
2284
|
-
name: "MuiTreeItem2DragAndDropOverlay",
|
|
2285
|
-
slot: "Root",
|
|
2286
|
-
overridesResolver: (e, t) => t.root,
|
|
2287
|
-
shouldForwardProp: (e) => sn(e) && e !== "action"
|
|
2288
|
-
})(({
|
|
2289
|
-
theme: e
|
|
2290
|
-
}) => ({
|
|
2291
|
-
position: "absolute",
|
|
2292
|
-
left: 0,
|
|
2293
|
-
display: "flex",
|
|
2294
|
-
top: 0,
|
|
2295
|
-
bottom: 0,
|
|
2296
|
-
right: 0,
|
|
2297
|
-
pointerEvents: "none",
|
|
2298
|
-
variants: [{
|
|
2299
|
-
props: {
|
|
2300
|
-
action: "make-child"
|
|
2301
|
-
},
|
|
2302
|
-
style: {
|
|
2303
|
-
marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
|
|
2304
|
-
borderRadius: e.shape.borderRadius,
|
|
2305
|
-
backgroundColor: X((e.vars || e).palette.primary.dark, 0.15)
|
|
2306
|
-
}
|
|
2307
|
-
}, {
|
|
2308
|
-
props: {
|
|
2309
|
-
action: "reorder-above"
|
|
2310
|
-
},
|
|
2311
|
-
style: E({
|
|
2312
|
-
marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
|
|
2313
|
-
borderTop: `1px solid ${X((e.vars || e).palette.grey[900], 0.6)}`
|
|
2314
|
-
}, e.applyStyles("dark", {
|
|
2315
|
-
borderTopColor: X((e.vars || e).palette.grey[100], 0.6)
|
|
2316
|
-
}))
|
|
2317
|
-
}, {
|
|
2318
|
-
props: {
|
|
2319
|
-
action: "reorder-below"
|
|
2320
|
-
},
|
|
2321
|
-
style: E({
|
|
2322
|
-
marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
|
|
2323
|
-
borderBottom: `1px solid ${X((e.vars || e).palette.grey[900], 0.6)}`
|
|
2324
|
-
}, e.applyStyles("dark", {
|
|
2325
|
-
borderBottomColor: X((e.vars || e).palette.grey[100], 0.6)
|
|
2326
|
-
}))
|
|
2327
|
-
}, {
|
|
2328
|
-
props: {
|
|
2329
|
-
action: "move-to-parent"
|
|
2330
|
-
},
|
|
2331
|
-
style: E({
|
|
2332
|
-
marginLeft: "calc(var(--TreeView-indentMultiplier) * calc(var(--TreeView-itemDepth) - 1))",
|
|
2333
|
-
borderBottom: `1px solid ${X((e.vars || e).palette.grey[900], 0.6)}`
|
|
2334
|
-
}, e.applyStyles("dark", {
|
|
2335
|
-
borderBottomColor: X((e.vars || e).palette.grey[900], 0.6)
|
|
2336
|
-
}))
|
|
2337
|
-
}]
|
|
2338
|
-
}));
|
|
2339
|
-
function ho(e) {
|
|
2340
|
-
return e.action == null ? null : /* @__PURE__ */ w(go, E({}, e));
|
|
2341
|
-
}
|
|
2342
|
-
const bo = U("input", {
|
|
2343
|
-
name: "MuiTreeItem2",
|
|
2344
|
-
slot: "LabelInput",
|
|
2345
|
-
overridesResolver: (e, t) => t.labelInput
|
|
2346
|
-
})(({
|
|
2347
|
-
theme: e
|
|
2348
|
-
}) => E({}, e.typography.body1, {
|
|
2349
|
-
width: "100%",
|
|
2350
|
-
backgroundColor: e.palette.background.paper,
|
|
2351
|
-
borderRadius: e.shape.borderRadius,
|
|
2352
|
-
border: "none",
|
|
2353
|
-
padding: "0 2px",
|
|
2354
|
-
boxSizing: "border-box",
|
|
2355
|
-
"&:focus": {
|
|
2356
|
-
outline: `1px solid ${e.palette.primary.main}`
|
|
2357
|
-
}
|
|
2358
|
-
})), yo = ["classes", "className", "displayIcon", "expansionIcon", "icon", "label", "itemId", "onClick", "onMouseDown", "dragAndDropOverlayProps", "labelInputProps"], Ue = /* @__PURE__ */ x.forwardRef(function(t, n) {
|
|
2359
|
-
const {
|
|
2360
|
-
classes: o,
|
|
2361
|
-
className: l,
|
|
2362
|
-
displayIcon: p,
|
|
2363
|
-
expansionIcon: c,
|
|
2364
|
-
icon: i,
|
|
2365
|
-
label: u,
|
|
2366
|
-
itemId: d,
|
|
2367
|
-
onClick: s,
|
|
2368
|
-
onMouseDown: a,
|
|
2369
|
-
dragAndDropOverlayProps: m,
|
|
2370
|
-
labelInputProps: I
|
|
2371
|
-
} = t, h = Q(t, yo), {
|
|
2372
|
-
disabled: f,
|
|
2373
|
-
expanded: g,
|
|
2374
|
-
selected: b,
|
|
2375
|
-
focused: y,
|
|
2376
|
-
editing: C,
|
|
2377
|
-
editable: k,
|
|
2378
|
-
disableSelection: T,
|
|
2379
|
-
checkboxSelection: v,
|
|
2380
|
-
handleExpansion: M,
|
|
2381
|
-
handleSelection: B,
|
|
2382
|
-
handleCheckboxSelection: K,
|
|
2383
|
-
handleContentClick: V,
|
|
2384
|
-
preventSelection: F,
|
|
2385
|
-
expansionTrigger: _,
|
|
2386
|
-
toggleItemEditing: j
|
|
2387
|
-
} = St(d), q = i || c || p, L = x.useRef(null), H = (P) => {
|
|
2388
|
-
F(P), a && a(P);
|
|
2389
|
-
}, N = (P) => {
|
|
2390
|
-
var O;
|
|
2391
|
-
V == null || V(P, d), !((O = L.current) != null && O.contains(P.target)) && (_ === "content" && M(P), v || B(P), s && s(P));
|
|
2392
|
-
}, W = (P) => {
|
|
2393
|
-
P.defaultMuiPrevented || j();
|
|
2394
|
-
};
|
|
2395
|
-
return (
|
|
2396
|
-
/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions -- Key event is handled by the TreeView */
|
|
2397
|
-
/* @__PURE__ */ ve("div", E({}, h, {
|
|
2398
|
-
className: Ie(l, o.root, g && o.expanded, b && o.selected, y && o.focused, f && o.disabled, C && o.editing, k && o.editable),
|
|
2399
|
-
onClick: N,
|
|
2400
|
-
onMouseDown: H,
|
|
2401
|
-
ref: n,
|
|
2402
|
-
children: [/* @__PURE__ */ w("div", {
|
|
2403
|
-
className: o.iconContainer,
|
|
2404
|
-
children: q
|
|
2405
|
-
}), v && /* @__PURE__ */ w(at, {
|
|
2406
|
-
className: o.checkbox,
|
|
2407
|
-
checked: b,
|
|
2408
|
-
onChange: K,
|
|
2409
|
-
disabled: f || T,
|
|
2410
|
-
ref: L,
|
|
2411
|
-
tabIndex: -1
|
|
2412
|
-
}), C ? /* @__PURE__ */ w(bo, E({}, I, {
|
|
2413
|
-
className: o.labelInput
|
|
2414
|
-
})) : /* @__PURE__ */ w("div", E({
|
|
2415
|
-
className: o.label
|
|
2416
|
-
}, k && {
|
|
2417
|
-
onDoubleClick: W
|
|
2418
|
-
}, {
|
|
2419
|
-
children: u
|
|
2420
|
-
})), m && /* @__PURE__ */ w(ho, E({}, m))]
|
|
2421
|
-
}))
|
|
2422
|
-
);
|
|
2423
|
-
});
|
|
2424
|
-
process.env.NODE_ENV !== "production" && (Ue.propTypes = {
|
|
2425
|
-
// ----------------------------- Warning --------------------------------
|
|
2426
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
2427
|
-
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
2428
|
-
// ----------------------------------------------------------------------
|
|
2429
|
-
/**
|
|
2430
|
-
* Override or extend the styles applied to the component.
|
|
2431
|
-
*/
|
|
2432
|
-
classes: r.object.isRequired,
|
|
2433
|
-
className: r.string,
|
|
2434
|
-
/**
|
|
2435
|
-
* The icon to display next to the tree item's label. Either a parent or end icon.
|
|
2436
|
-
*/
|
|
2437
|
-
displayIcon: r.node,
|
|
2438
|
-
dragAndDropOverlayProps: r.shape({
|
|
2439
|
-
action: r.oneOf(["make-child", "move-to-parent", "reorder-above", "reorder-below"]),
|
|
2440
|
-
style: r.object
|
|
2441
|
-
}),
|
|
2442
|
-
/**
|
|
2443
|
-
* The icon to display next to the tree item's label. Either an expansion or collapse icon.
|
|
2444
|
-
*/
|
|
2445
|
-
expansionIcon: r.node,
|
|
2446
|
-
/**
|
|
2447
|
-
* The icon to display next to the tree item's label.
|
|
2448
|
-
*/
|
|
2449
|
-
icon: r.node,
|
|
2450
|
-
/**
|
|
2451
|
-
* The id of the item.
|
|
2452
|
-
*/
|
|
2453
|
-
itemId: r.string.isRequired,
|
|
2454
|
-
/**
|
|
2455
|
-
* The tree item label.
|
|
2456
|
-
*/
|
|
2457
|
-
label: r.node,
|
|
2458
|
-
labelInputProps: r.shape({
|
|
2459
|
-
autoFocus: r.oneOf([!0]),
|
|
2460
|
-
"data-element": r.oneOf(["labelInput"]),
|
|
2461
|
-
onBlur: r.func,
|
|
2462
|
-
onChange: r.func,
|
|
2463
|
-
onKeyDown: r.func,
|
|
2464
|
-
type: r.oneOf(["text"]),
|
|
2465
|
-
value: r.string
|
|
2466
|
-
})
|
|
2467
|
-
});
|
|
2468
|
-
function xo(e) {
|
|
2469
|
-
return fe("MuiTreeItem", e);
|
|
2470
|
-
}
|
|
2471
|
-
const J = me("MuiTreeItem", ["root", "groupTransition", "content", "expanded", "selected", "focused", "disabled", "iconContainer", "label", "checkbox", "labelInput", "editable", "editing", "dragAndDropOverlay"]), Eo = te(/* @__PURE__ */ w("path", {
|
|
2472
|
-
d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
|
|
2473
|
-
}), "TreeViewExpandIcon"), Co = te(/* @__PURE__ */ w("path", {
|
|
2474
|
-
d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
|
|
2475
|
-
}), "TreeViewCollapseIcon");
|
|
2476
|
-
function Rt(e) {
|
|
2477
|
-
const {
|
|
2478
|
-
children: t,
|
|
2479
|
-
itemId: n
|
|
2480
|
-
} = e, {
|
|
2481
|
-
wrapItem: o,
|
|
2482
|
-
instance: l
|
|
2483
|
-
} = le();
|
|
2484
|
-
return o({
|
|
2485
|
-
children: t,
|
|
2486
|
-
itemId: n,
|
|
2487
|
-
instance: l
|
|
2488
|
-
});
|
|
2489
|
-
}
|
|
2490
|
-
Rt.propTypes = {
|
|
2491
|
-
// ----------------------------- Warning --------------------------------
|
|
2492
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
2493
|
-
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
2494
|
-
// ----------------------------------------------------------------------
|
|
2495
|
-
children: r.node,
|
|
2496
|
-
itemId: r.string.isRequired
|
|
2497
|
-
};
|
|
2498
|
-
const To = ["children", "className", "slots", "slotProps", "ContentComponent", "ContentProps", "itemId", "id", "label", "onClick", "onMouseDown", "onFocus", "onBlur", "onKeyDown"], wo = ["ownerState"], vo = ["ownerState"], So = ["ownerState"], Ro = ct(), Mo = (e) => {
|
|
2499
|
-
const {
|
|
2500
|
-
classes: t
|
|
2501
|
-
} = e;
|
|
2502
|
-
return ge({
|
|
2503
|
-
root: ["root"],
|
|
2504
|
-
content: ["content"],
|
|
2505
|
-
expanded: ["expanded"],
|
|
2506
|
-
selected: ["selected"],
|
|
2507
|
-
focused: ["focused"],
|
|
2508
|
-
disabled: ["disabled"],
|
|
2509
|
-
iconContainer: ["iconContainer"],
|
|
2510
|
-
checkbox: ["checkbox"],
|
|
2511
|
-
label: ["label"],
|
|
2512
|
-
labelInput: ["labelInput"],
|
|
2513
|
-
editing: ["editing"],
|
|
2514
|
-
editable: ["editable"],
|
|
2515
|
-
groupTransition: ["groupTransition"]
|
|
2516
|
-
}, xo, t);
|
|
2517
|
-
}, ko = U("li", {
|
|
2518
|
-
name: "MuiTreeItem",
|
|
2519
|
-
slot: "Root",
|
|
2520
|
-
overridesResolver: (e, t) => t.root
|
|
2521
|
-
})({
|
|
2522
|
-
listStyle: "none",
|
|
2523
|
-
margin: 0,
|
|
2524
|
-
padding: 0,
|
|
2525
|
-
outline: 0
|
|
2526
|
-
}), Po = U(Ue, {
|
|
2527
|
-
name: "MuiTreeItem",
|
|
2528
|
-
slot: "Content",
|
|
2529
|
-
overridesResolver: (e, t) => [t.content, t.iconContainer && {
|
|
2530
|
-
[`& .${J.iconContainer}`]: t.iconContainer
|
|
2531
|
-
}, t.label && {
|
|
2532
|
-
[`& .${J.label}`]: t.label
|
|
2533
|
-
}],
|
|
2534
|
-
shouldForwardProp: (e) => st(e) && e !== "indentationAtItemLevel"
|
|
2535
|
-
})(({
|
|
2536
|
-
theme: e
|
|
2537
|
-
}) => ({
|
|
2538
|
-
padding: e.spacing(0.5, 1),
|
|
2539
|
-
borderRadius: e.shape.borderRadius,
|
|
2540
|
-
width: "100%",
|
|
2541
|
-
boxSizing: "border-box",
|
|
2542
|
-
// prevent width + padding to overflow
|
|
2543
|
-
position: "relative",
|
|
2544
|
-
display: "flex",
|
|
2545
|
-
alignItems: "center",
|
|
2546
|
-
gap: e.spacing(1),
|
|
2547
|
-
cursor: "pointer",
|
|
2548
|
-
WebkitTapHighlightColor: "transparent",
|
|
2549
|
-
"&:hover": {
|
|
2550
|
-
backgroundColor: (e.vars || e).palette.action.hover,
|
|
2551
|
-
// Reset on touch devices, it doesn't add specificity
|
|
2552
|
-
"@media (hover: none)": {
|
|
2553
|
-
backgroundColor: "transparent"
|
|
2554
|
-
}
|
|
2555
|
-
},
|
|
2556
|
-
[`&.${J.disabled}`]: {
|
|
2557
|
-
opacity: (e.vars || e).palette.action.disabledOpacity,
|
|
2558
|
-
backgroundColor: "transparent"
|
|
2559
|
-
},
|
|
2560
|
-
[`&.${J.focused}`]: {
|
|
2561
|
-
backgroundColor: (e.vars || e).palette.action.focus
|
|
2562
|
-
},
|
|
2563
|
-
[`&.${J.selected}`]: {
|
|
2564
|
-
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : X(e.palette.primary.main, e.palette.action.selectedOpacity),
|
|
2565
|
-
"&:hover": {
|
|
2566
|
-
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` : X(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
|
|
2567
|
-
// Reset on touch devices, it doesn't add specificity
|
|
2568
|
-
"@media (hover: none)": {
|
|
2569
|
-
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : X(e.palette.primary.main, e.palette.action.selectedOpacity)
|
|
2570
|
-
}
|
|
2571
|
-
},
|
|
2572
|
-
[`&.${J.focused}`]: {
|
|
2573
|
-
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))` : X(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.focusOpacity)
|
|
2574
|
-
}
|
|
2575
|
-
},
|
|
2576
|
-
[`& .${J.iconContainer}`]: {
|
|
2577
|
-
width: 16,
|
|
2578
|
-
display: "flex",
|
|
2579
|
-
flexShrink: 0,
|
|
2580
|
-
justifyContent: "center",
|
|
2581
|
-
"& svg": {
|
|
2582
|
-
fontSize: 18
|
|
2583
|
-
}
|
|
2584
|
-
},
|
|
2585
|
-
[`& .${J.label}`]: E({
|
|
2586
|
-
width: "100%",
|
|
2587
|
-
boxSizing: "border-box",
|
|
2588
|
-
// prevent width + padding to overflow
|
|
2589
|
-
// fixes overflow - see https://github.com/mui/material-ui/issues/27372
|
|
2590
|
-
minWidth: 0,
|
|
2591
|
-
position: "relative"
|
|
2592
|
-
}, e.typography.body1),
|
|
2593
|
-
[`& .${J.checkbox}`]: {
|
|
2594
|
-
padding: 0
|
|
2595
|
-
},
|
|
2596
|
-
variants: [{
|
|
2597
|
-
props: {
|
|
2598
|
-
indentationAtItemLevel: !0
|
|
2599
|
-
},
|
|
2600
|
-
style: {
|
|
2601
|
-
paddingLeft: `calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`
|
|
2602
|
-
}
|
|
2603
|
-
}]
|
|
2604
|
-
})), Oo = U(Ne, {
|
|
2605
|
-
name: "MuiTreeItem",
|
|
2606
|
-
slot: "GroupTransition",
|
|
2607
|
-
overridesResolver: (e, t) => t.groupTransition,
|
|
2608
|
-
shouldForwardProp: (e) => st(e) && e !== "indentationAtItemLevel"
|
|
2609
|
-
})({
|
|
2610
|
-
margin: 0,
|
|
2611
|
-
padding: 0,
|
|
2612
|
-
paddingLeft: "var(--TreeView-itemChildrenIndentation)",
|
|
2613
|
-
variants: [{
|
|
2614
|
-
props: {
|
|
2615
|
-
indentationAtItemLevel: !0
|
|
2616
|
-
},
|
|
2617
|
-
style: {
|
|
2618
|
-
paddingLeft: 0
|
|
2619
|
-
}
|
|
2620
|
-
}]
|
|
2621
|
-
}), Mt = /* @__PURE__ */ x.forwardRef(function(t, n) {
|
|
2622
|
-
var Xe, We, Je, Ge;
|
|
2623
|
-
const {
|
|
2624
|
-
icons: o,
|
|
2625
|
-
runItemPlugins: l,
|
|
2626
|
-
items: {
|
|
2627
|
-
disabledItemsFocusable: p,
|
|
2628
|
-
indentationAtItemLevel: c
|
|
2629
|
-
},
|
|
2630
|
-
selection: {
|
|
2631
|
-
multiSelect: i
|
|
2632
|
-
},
|
|
2633
|
-
expansion: {
|
|
2634
|
-
expansionTrigger: u
|
|
2635
|
-
},
|
|
2636
|
-
instance: d
|
|
2637
|
-
} = le(), s = x.useContext(se), a = Ro({
|
|
2638
|
-
props: t,
|
|
2639
|
-
name: "MuiTreeItem"
|
|
2640
|
-
}), {
|
|
2641
|
-
children: m,
|
|
2642
|
-
className: I,
|
|
2643
|
-
slots: h,
|
|
2644
|
-
slotProps: f,
|
|
2645
|
-
ContentComponent: g = Ue,
|
|
2646
|
-
ContentProps: b,
|
|
2647
|
-
itemId: y,
|
|
2648
|
-
id: C,
|
|
2649
|
-
label: k,
|
|
2650
|
-
onClick: T,
|
|
2651
|
-
onMouseDown: v,
|
|
2652
|
-
onBlur: M,
|
|
2653
|
-
onKeyDown: B
|
|
2654
|
-
} = a, K = Q(a, To), {
|
|
2655
|
-
expanded: V,
|
|
2656
|
-
focused: F,
|
|
2657
|
-
selected: _,
|
|
2658
|
-
disabled: j,
|
|
2659
|
-
editing: q,
|
|
2660
|
-
handleExpansion: L,
|
|
2661
|
-
handleCancelItemLabelEditing: H,
|
|
2662
|
-
handleSaveItemLabel: N
|
|
2663
|
-
} = St(y), {
|
|
2664
|
-
contentRef: W,
|
|
2665
|
-
rootRef: P,
|
|
2666
|
-
propsEnhancers: O
|
|
2667
|
-
} = l(a), ne = x.useRef(null), ye = x.useRef(null), Me = de(n, P, ne), ke = de(b == null ? void 0 : b.ref, W, ye), oe = {
|
|
2668
|
-
expandIcon: (h == null ? void 0 : h.expandIcon) ?? o.slots.expandIcon ?? Eo,
|
|
2669
|
-
collapseIcon: (h == null ? void 0 : h.collapseIcon) ?? o.slots.collapseIcon ?? Co,
|
|
2670
|
-
endIcon: (h == null ? void 0 : h.endIcon) ?? o.slots.endIcon,
|
|
2671
|
-
icon: h == null ? void 0 : h.icon,
|
|
2672
|
-
groupTransition: h == null ? void 0 : h.groupTransition
|
|
2673
|
-
}, S = (R) => Array.isArray(R) ? R.length > 0 && R.some(S) : !!R, $ = S(m), z = E({}, a, {
|
|
2674
|
-
expanded: V,
|
|
2675
|
-
focused: F,
|
|
2676
|
-
selected: _,
|
|
2677
|
-
disabled: j,
|
|
2678
|
-
indentationAtItemLevel: c
|
|
2679
|
-
}), A = Mo(z), Y = oe.groupTransition ?? void 0, xe = ce({
|
|
2680
|
-
elementType: Y,
|
|
2681
|
-
ownerState: {},
|
|
2682
|
-
externalSlotProps: f == null ? void 0 : f.groupTransition,
|
|
2683
|
-
additionalProps: E({
|
|
2684
|
-
unmountOnExit: !0,
|
|
2685
|
-
in: V,
|
|
2686
|
-
component: "ul",
|
|
2687
|
-
role: "group"
|
|
2688
|
-
}, c ? {
|
|
2689
|
-
indentationAtItemLevel: !0
|
|
2690
|
-
} : {}),
|
|
2691
|
-
className: A.groupTransition
|
|
2692
|
-
}), Pt = (R) => {
|
|
2693
|
-
u === "iconContainer" && L(R);
|
|
2694
|
-
}, Pe = V ? oe.collapseIcon : oe.expandIcon, Ot = ce({
|
|
2695
|
-
elementType: Pe,
|
|
2696
|
-
ownerState: {},
|
|
2697
|
-
externalSlotProps: (R) => V ? E({}, ie(o.slotProps.collapseIcon, R), ie(f == null ? void 0 : f.collapseIcon, R)) : E({}, ie(o.slotProps.expandIcon, R), ie(f == null ? void 0 : f.expandIcon, R)),
|
|
2698
|
-
additionalProps: {
|
|
2699
|
-
onClick: Pt
|
|
2700
|
-
}
|
|
2701
|
-
}), Dt = Q(Ot, wo), Vt = $ && Pe ? /* @__PURE__ */ w(Pe, E({}, Dt)) : null, Oe = $ ? void 0 : oe.endIcon, At = ce({
|
|
2702
|
-
elementType: Oe,
|
|
2703
|
-
ownerState: {},
|
|
2704
|
-
externalSlotProps: (R) => $ ? {} : E({}, ie(o.slotProps.endIcon, R), ie(f == null ? void 0 : f.endIcon, R))
|
|
2705
|
-
}), Ft = Q(At, vo), $t = Oe ? /* @__PURE__ */ w(Oe, E({}, Ft)) : null, De = oe.icon, Lt = ce({
|
|
2706
|
-
elementType: De,
|
|
2707
|
-
ownerState: {},
|
|
2708
|
-
externalSlotProps: f == null ? void 0 : f.icon
|
|
2709
|
-
}), Nt = Q(Lt, So), jt = De ? /* @__PURE__ */ w(De, E({}, Nt)) : null;
|
|
2710
|
-
let Ve;
|
|
2711
|
-
i ? Ve = _ : _ && (Ve = !0);
|
|
2712
|
-
function zt(R) {
|
|
2713
|
-
!F && (!j || p) && R.currentTarget === R.target && d.focusItem(R, y);
|
|
2714
|
-
}
|
|
2715
|
-
function Bt(R) {
|
|
2716
|
-
var re, ae, He, Ye;
|
|
2717
|
-
M == null || M(R), !(q || // we can exit the editing state by clicking outside the input (within the tree item) or by pressing Enter or Escape -> we don't want to remove the focused item from the state in these cases
|
|
2718
|
-
// we can also exit the editing state by clicking on the root itself -> want to remove the focused item from the state in this case
|
|
2719
|
-
R.relatedTarget && $e(R.relatedTarget, ne.current) && (R.target && ((ae = (re = R.target) == null ? void 0 : re.dataset) == null ? void 0 : ae.element) === "labelInput" && $e(R.target, ne.current) || ((Ye = (He = R.relatedTarget) == null ? void 0 : He.dataset) == null ? void 0 : Ye.element) === "labelInput")) && d.removeFocusedItem();
|
|
2720
|
-
}
|
|
2721
|
-
const _t = (R) => {
|
|
2722
|
-
var re, ae;
|
|
2723
|
-
B == null || B(R), ((ae = (re = R.target) == null ? void 0 : re.dataset) == null ? void 0 : ae.element) !== "labelInput" && d.handleItemKeyDown(R, y);
|
|
2724
|
-
}, Ut = d.getTreeItemIdAttribute(y, C), Kt = d.canItemBeTabbed(y) ? 0 : -1, Ee = {
|
|
2725
|
-
rootRefObject: ne,
|
|
2726
|
-
contentRefObject: ye,
|
|
2727
|
-
interactions: {
|
|
2728
|
-
handleSaveItemLabel: N,
|
|
2729
|
-
handleCancelItemLabelEditing: H
|
|
2730
|
-
}
|
|
2731
|
-
}, qt = ((Xe = O.root) == null ? void 0 : Xe.call(O, E({}, Ee, {
|
|
2732
|
-
externalEventHandlers: Ze(K)
|
|
2733
|
-
}))) ?? {}, Xt = ((We = O.content) == null ? void 0 : We.call(O, E({}, Ee, {
|
|
2734
|
-
externalEventHandlers: Ze(b)
|
|
2735
|
-
}))) ?? {}, Ke = ((Je = O.dragAndDropOverlay) == null ? void 0 : Je.call(O, E({}, Ee, {
|
|
2736
|
-
externalEventHandlers: {}
|
|
2737
|
-
}))) ?? {}, qe = ((Ge = O.labelInput) == null ? void 0 : Ge.call(O, E({}, Ee, {
|
|
2738
|
-
externalEventHandlers: {}
|
|
2739
|
-
}))) ?? {};
|
|
2740
|
-
return /* @__PURE__ */ w(Rt, {
|
|
2741
|
-
itemId: y,
|
|
2742
|
-
children: /* @__PURE__ */ ve(ko, E({
|
|
2743
|
-
className: Ie(A.root, I),
|
|
2744
|
-
role: "treeitem",
|
|
2745
|
-
"aria-expanded": $ ? V : void 0,
|
|
2746
|
-
"aria-selected": Ve,
|
|
2747
|
-
"aria-disabled": j || void 0,
|
|
2748
|
-
id: Ut,
|
|
2749
|
-
tabIndex: Kt
|
|
2750
|
-
}, K, {
|
|
2751
|
-
ownerState: z,
|
|
2752
|
-
onFocus: zt,
|
|
2753
|
-
onBlur: Bt,
|
|
2754
|
-
onKeyDown: _t,
|
|
2755
|
-
ref: Me,
|
|
2756
|
-
style: c ? E({}, K.style, {
|
|
2757
|
-
"--TreeView-itemDepth": typeof s == "function" ? s(y) : s
|
|
2758
|
-
}) : K.style
|
|
2759
|
-
}, qt, {
|
|
2760
|
-
children: [/* @__PURE__ */ w(Po, E({
|
|
2761
|
-
as: g,
|
|
2762
|
-
classes: {
|
|
2763
|
-
root: A.content,
|
|
2764
|
-
expanded: A.expanded,
|
|
2765
|
-
selected: A.selected,
|
|
2766
|
-
focused: A.focused,
|
|
2767
|
-
disabled: A.disabled,
|
|
2768
|
-
editable: A.editable,
|
|
2769
|
-
editing: A.editing,
|
|
2770
|
-
iconContainer: A.iconContainer,
|
|
2771
|
-
label: A.label,
|
|
2772
|
-
labelInput: A.labelInput,
|
|
2773
|
-
checkbox: A.checkbox
|
|
2774
|
-
},
|
|
2775
|
-
label: k,
|
|
2776
|
-
itemId: y,
|
|
2777
|
-
onClick: T,
|
|
2778
|
-
onMouseDown: v,
|
|
2779
|
-
icon: jt,
|
|
2780
|
-
expansionIcon: Vt,
|
|
2781
|
-
displayIcon: $t,
|
|
2782
|
-
ownerState: z
|
|
2783
|
-
}, b, Xt, Ke.action == null ? {} : {
|
|
2784
|
-
dragAndDropOverlayProps: Ke
|
|
2785
|
-
}, qe.value == null ? {} : {
|
|
2786
|
-
labelInputProps: qe
|
|
2787
|
-
}, {
|
|
2788
|
-
ref: ke
|
|
2789
|
-
})), m && /* @__PURE__ */ w(Oo, E({
|
|
2790
|
-
as: Y
|
|
2791
|
-
}, xe, {
|
|
2792
|
-
children: m
|
|
2793
|
-
}))]
|
|
2794
|
-
}))
|
|
2795
|
-
});
|
|
2796
|
-
});
|
|
2797
|
-
process.env.NODE_ENV !== "production" && (Mt.propTypes = {
|
|
2798
|
-
// ----------------------------- Warning --------------------------------
|
|
2799
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
2800
|
-
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
2801
|
-
// ----------------------------------------------------------------------
|
|
2802
|
-
/**
|
|
2803
|
-
* The content of the component.
|
|
2804
|
-
*/
|
|
2805
|
-
children: r.node,
|
|
2806
|
-
/**
|
|
2807
|
-
* Override or extend the styles applied to the component.
|
|
2808
|
-
*/
|
|
2809
|
-
classes: r.object,
|
|
2810
|
-
className: r.string,
|
|
2811
|
-
/**
|
|
2812
|
-
* The component used to render the content of the item.
|
|
2813
|
-
* @default TreeItemContent
|
|
2814
|
-
*/
|
|
2815
|
-
ContentComponent: ot,
|
|
2816
|
-
/**
|
|
2817
|
-
* Props applied to ContentComponent.
|
|
2818
|
-
*/
|
|
2819
|
-
ContentProps: r.object,
|
|
2820
|
-
/**
|
|
2821
|
-
* If `true`, the item is disabled.
|
|
2822
|
-
* @default false
|
|
2823
|
-
*/
|
|
2824
|
-
disabled: r.bool,
|
|
2825
|
-
/**
|
|
2826
|
-
* The id of the item.
|
|
2827
|
-
*/
|
|
2828
|
-
itemId: r.string.isRequired,
|
|
2829
|
-
/**
|
|
2830
|
-
* The tree item label.
|
|
2831
|
-
*/
|
|
2832
|
-
label: r.node,
|
|
2833
|
-
/**
|
|
2834
|
-
* This prop isn't supported.
|
|
2835
|
-
* Use the `onItemFocus` callback on the tree if you need to monitor a item's focus.
|
|
2836
|
-
*/
|
|
2837
|
-
onFocus: ln,
|
|
2838
|
-
/**
|
|
2839
|
-
* Callback fired when a key of the keyboard is pressed on the item.
|
|
2840
|
-
*/
|
|
2841
|
-
onKeyDown: r.func,
|
|
2842
|
-
/**
|
|
2843
|
-
* The props used for each component slot.
|
|
2844
|
-
* @default {}
|
|
2845
|
-
*/
|
|
2846
|
-
slotProps: r.object,
|
|
2847
|
-
/**
|
|
2848
|
-
* Overridable component slots.
|
|
2849
|
-
* @default {}
|
|
2850
|
-
*/
|
|
2851
|
-
slots: r.object,
|
|
2852
|
-
/**
|
|
2853
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
2854
|
-
*/
|
|
2855
|
-
sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object])
|
|
2856
|
-
});
|
|
2857
|
-
const Lo = ({
|
|
2858
|
-
items: e,
|
|
2859
|
-
handleCheck: t,
|
|
2860
|
-
width: n = "250px",
|
|
2861
|
-
height: o = "350px",
|
|
2862
|
-
expanded: l
|
|
2863
|
-
}) => /* @__PURE__ */ w(an, { width: n, height: o, children: /* @__PURE__ */ w(vt, { expandedItems: l, children: kt(e, t) }) }), kt = (e, t) => e.map((n) => /* @__PURE__ */ Wt(Do, { ...n, key: n.id, handleCheck: t })), Do = ({
|
|
2864
|
-
id: e,
|
|
2865
|
-
checked: t,
|
|
2866
|
-
children: n,
|
|
2867
|
-
label: o,
|
|
2868
|
-
handleCheck: l
|
|
2869
|
-
}) => /* @__PURE__ */ w(
|
|
2870
|
-
Mt,
|
|
2871
|
-
{
|
|
2872
|
-
itemId: e,
|
|
2873
|
-
label: /* @__PURE__ */ ve(cn, { flexDirection: "row", alignItems: "center", children: [
|
|
2874
|
-
/* @__PURE__ */ w(dn, { children: o }),
|
|
2875
|
-
l && /* @__PURE__ */ w(
|
|
2876
|
-
un,
|
|
2877
|
-
{
|
|
2878
|
-
disableRipple: !0,
|
|
2879
|
-
sx: { marginLeft: "auto" },
|
|
2880
|
-
onClick: (p) => {
|
|
2881
|
-
p.stopPropagation(), l(e, !t);
|
|
2882
|
-
},
|
|
2883
|
-
"data-testid": `toggle-visibility-${e}`,
|
|
2884
|
-
children: t ? /* @__PURE__ */ w(Fn, { "data-testid": `visibility-icon-${e}` }) : /* @__PURE__ */ w($n, { "data-testid": `visibility-off-icon-${e}` })
|
|
2885
|
-
}
|
|
2886
|
-
)
|
|
2887
|
-
] }),
|
|
2888
|
-
children: n.length > 0 && kt(n, l)
|
|
2889
|
-
}
|
|
2890
|
-
);
|
|
2891
|
-
export {
|
|
2892
|
-
Ne as C,
|
|
2893
|
-
Lo as T,
|
|
2894
|
-
at as a
|
|
2895
|
-
};
|