@thebuoyant-tsdev/mui-ts-library 3.29.2 → 3.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.de.md +49 -1
- package/README.md +49 -1
- package/dist/components/chord-chart/ChordChart.js +112 -112
- package/dist/components/circle-packing-chart/CirclePackingChart.js +135 -135
- package/dist/components/color-picker/ColorPicker.js +217 -217
- package/dist/components/color-picker/PopoverColorPicker.js +7 -7
- package/dist/components/date-range-picker/DateRangePicker.js +9 -9
- package/dist/components/gantt-chart/GanttChart.js +18 -18
- package/dist/components/gantt-chart/GanttTaskDialog.js +43 -43
- package/dist/components/gantt-chart/GanttTaskPanel.js +128 -128
- package/dist/components/gantt-chart/GanttTimeline.js +16 -16
- package/dist/components/gantt-chart/GanttToolbar.js +24 -24
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.js +244 -244
- package/dist/components/json-editor/JsonEditor.js +9 -9
- package/dist/components/json-editor/JsonEditorContent.js +54 -54
- package/dist/components/json-editor/JsonEditorToolbar.js +12 -12
- package/dist/components/kanban-board/KanbanBoard.d.ts +2 -0
- package/dist/components/kanban-board/KanbanBoard.js +132 -0
- package/dist/components/kanban-board/KanbanBoard.types.d.ts +93 -0
- package/dist/components/kanban-board/KanbanBoard.types.js +19 -0
- package/dist/components/kanban-board/KanbanBoardCard.d.ts +14 -0
- package/dist/components/kanban-board/KanbanBoardCard.js +118 -0
- package/dist/components/kanban-board/KanbanBoardCardDialog.d.ts +23 -0
- package/dist/components/kanban-board/KanbanBoardCardDialog.js +120 -0
- package/dist/components/kanban-board/KanbanBoardColumn.d.ts +15 -0
- package/dist/components/kanban-board/KanbanBoardColumn.js +132 -0
- package/dist/components/kanban-board/kanbanBoardClasses.d.ts +47 -0
- package/dist/components/kanban-board/kanbanBoardClasses.js +18 -0
- package/dist/components/password-strength-meter/PasswordStrengthMeter.js +27 -27
- package/dist/components/radial-stacked-bar-chart/RadialStackedBarChart.js +48 -48
- package/dist/components/radial-tree-chart/RadialTreeChart.js +173 -173
- package/dist/components/rich-text-editor/RichTextEditor.js +32 -32
- package/dist/components/rich-text-editor/RichTextEditorColorPicker.js +20 -20
- package/dist/components/rich-text-editor/RichTextEditorEmojiPicker.js +12 -12
- package/dist/components/rich-text-editor/RichTextEditorImageDialog.js +11 -11
- package/dist/components/rich-text-editor/RichTextEditorLinkDialog.js +11 -11
- package/dist/components/rich-text-editor/RichTextEditorMarkdownDialog.js +14 -14
- package/dist/components/rich-text-editor/RichTextEditorMentionList.js +14 -14
- package/dist/components/rich-text-editor/RichTextEditorTableMenu.js +28 -28
- package/dist/components/rich-text-editor/RichTextEditorToolbar.js +35 -35
- package/dist/components/sql-editor/SqlEditor.js +24 -24
- package/dist/components/sql-editor/SqlEditorContent.js +16 -16
- package/dist/components/sql-editor/SqlEditorHistoryMenu.js +15 -15
- package/dist/components/sql-editor/SqlEditorToolbar.js +21 -21
- package/dist/components/sunburst-chart/SunburstChart.js +126 -126
- package/dist/components/tag-selection/TagSelection.js +18 -18
- package/dist/components/tag-selection/TagSelectionAutocomplete.js +120 -120
- package/dist/components/tag-selection/TagSelectionSelectedTags.js +10 -10
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +38 -35
- package/package.json +9 -2
|
@@ -4,23 +4,23 @@ import { createTagSelectionStore as n } from "./TagSelection.store.js";
|
|
|
4
4
|
import { TagSelectionAutocomplete as r } from "./TagSelectionAutocomplete.js";
|
|
5
5
|
import { TagSelectionSelectedTags as i } from "./TagSelectionSelectedTags.js";
|
|
6
6
|
import { DEFAULT_TAG_SELECTION_TRANSLATION as a } from "./TagSelection.types.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Box as o, Stack as s } from "@mui/material";
|
|
8
|
+
import { createContext as c, useContext as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
9
9
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
10
10
|
import { useStore as g } from "zustand";
|
|
11
11
|
//#region src/components/tag-selection/TagSelection.tsx
|
|
12
|
-
var _ =
|
|
12
|
+
var _ = c(null);
|
|
13
13
|
function v(e) {
|
|
14
|
-
let t =
|
|
14
|
+
let t = l(_);
|
|
15
15
|
if (!t) throw Error("TagSelectionStoreContext is missing.");
|
|
16
16
|
return g(t, e);
|
|
17
17
|
}
|
|
18
|
-
function y({ tags: n, showSelectedTags: a = !0, showSelectedTagsLabel:
|
|
18
|
+
function y({ tags: n, showSelectedTags: a = !0, showSelectedTagsLabel: c = !0, showAutoComplete: l = !0, inputSize: p = "medium", chipSize: g = "small", chipVariant: _ = "filled", disabled: y = !1, loading: b = !1, maxTags: x, allowCreate: S = !1, maxVisibleChips: C, popoverPlacement: w = "bottom", listboxMaxHeight: T, searchDebounceMs: E, serverSideFilter: D = !1, translation: O, onTagSelect: k, onTagDelete: A, onTagsChange: j, onSearchChange: M, onTagCreate: N }) {
|
|
19
19
|
let P = v((e) => e.tags), F = v((e) => e.searchValue), I = v((e) => e.setTags), L = v((e) => e.setSearchValue), R = v((e) => e.selectTag), z = v((e) => e.deleteTag), B = v((e) => e.addTag);
|
|
20
|
-
|
|
20
|
+
u(() => {
|
|
21
21
|
I(n);
|
|
22
22
|
}, [n, I]);
|
|
23
|
-
let V =
|
|
23
|
+
let V = d(() => P.filter((e) => e.selected).sort((e, t) => e.label.localeCompare(t.label)), [P]), H = d(() => P.filter((e) => !e.selected && !e.disabled).sort((e, t) => e.label.localeCompare(t.label)), [P]), U = x !== void 0 && V.length >= x, W = (e) => {
|
|
24
24
|
j && j(e.filter((e) => e.selected), e);
|
|
25
25
|
}, G = (e) => {
|
|
26
26
|
if (e.disabled || e.selected) return;
|
|
@@ -37,23 +37,23 @@ function y({ tags: n, showSelectedTags: a = !0, showSelectedTagsLabel: o = !0, s
|
|
|
37
37
|
selected: !1
|
|
38
38
|
} : t), n = t.filter((e) => e.selected), r = t.find((t) => t.id === e.id);
|
|
39
39
|
r && A && A(r, n, t), W(t);
|
|
40
|
-
}, q =
|
|
41
|
-
return
|
|
40
|
+
}, q = f(null);
|
|
41
|
+
return u(() => () => {
|
|
42
42
|
q.current && clearTimeout(q.current);
|
|
43
|
-
}, []), /* @__PURE__ */ m(
|
|
43
|
+
}, []), /* @__PURE__ */ m(o, {
|
|
44
44
|
sx: { width: "100%" },
|
|
45
45
|
className: [t.root, y && e.disabled].filter(Boolean).join(" "),
|
|
46
|
-
children: /* @__PURE__ */ h(
|
|
46
|
+
children: /* @__PURE__ */ h(s, { children: [a && /* @__PURE__ */ m(i, {
|
|
47
47
|
selectedTags: V,
|
|
48
48
|
translation: O,
|
|
49
49
|
onTagDelete: K,
|
|
50
|
-
showSelectedTagsLabel:
|
|
50
|
+
showSelectedTagsLabel: c,
|
|
51
51
|
chipSize: g,
|
|
52
52
|
chipVariant: _,
|
|
53
53
|
disabled: y,
|
|
54
54
|
maxVisibleChips: C,
|
|
55
55
|
popoverPlacement: w
|
|
56
|
-
}),
|
|
56
|
+
}), l && /* @__PURE__ */ m(r, {
|
|
57
57
|
availableTags: H,
|
|
58
58
|
searchValue: F,
|
|
59
59
|
translation: O,
|
|
@@ -72,7 +72,7 @@ function y({ tags: n, showSelectedTags: a = !0, showSelectedTagsLabel: o = !0, s
|
|
|
72
72
|
onTagCreate: (e) => {
|
|
73
73
|
B(e), W([...P, e]), N && N(e);
|
|
74
74
|
},
|
|
75
|
-
inputSize:
|
|
75
|
+
inputSize: p,
|
|
76
76
|
chipSize: g,
|
|
77
77
|
chipVariant: _,
|
|
78
78
|
disabled: y,
|
|
@@ -84,11 +84,11 @@ function y({ tags: n, showSelectedTags: a = !0, showSelectedTagsLabel: o = !0, s
|
|
|
84
84
|
})] })
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
|
-
function b({ tags: e, showSelectedTags: t = !0, showSelectedTagsLabel: r = !0, showAutoComplete: i = !0, translation: o, inputSize: s = "medium", chipSize: c = "small", chipVariant: l = "filled", disabled: u = !1, loading:
|
|
87
|
+
function b({ tags: e, showSelectedTags: t = !0, showSelectedTagsLabel: r = !0, showAutoComplete: i = !0, translation: o, inputSize: s = "medium", chipSize: c = "small", chipVariant: l = "filled", disabled: u = !1, loading: d = !1, maxTags: f, allowCreate: h = !1, maxVisibleChips: g, popoverPlacement: v = "bottom", listboxMaxHeight: b, searchDebounceMs: x, serverSideFilter: S = !1, onTagSelect: C, onTagDelete: w, onTagsChange: T, onSearchChange: E, onTagCreate: D }) {
|
|
88
88
|
let O = {
|
|
89
89
|
...a,
|
|
90
90
|
...o
|
|
91
|
-
}, [k] =
|
|
91
|
+
}, [k] = p(() => n(e));
|
|
92
92
|
return /* @__PURE__ */ m(_.Provider, {
|
|
93
93
|
value: k,
|
|
94
94
|
children: /* @__PURE__ */ m(y, {
|
|
@@ -101,8 +101,8 @@ function b({ tags: e, showSelectedTags: t = !0, showSelectedTagsLabel: r = !0, s
|
|
|
101
101
|
chipSize: c,
|
|
102
102
|
chipVariant: l,
|
|
103
103
|
disabled: u,
|
|
104
|
-
loading:
|
|
105
|
-
maxTags:
|
|
104
|
+
loading: d,
|
|
105
|
+
maxTags: f,
|
|
106
106
|
allowCreate: h,
|
|
107
107
|
maxVisibleChips: g,
|
|
108
108
|
popoverPlacement: v,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { tagSelectionClasses as e } from "./tagSelectionClasses.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
2
|
+
import { Autocomplete as t, Box as n, Chip as r, IconButton as i, Stack as a, Switch as ee, TextField as o, Tooltip as s, Typography as c } from "@mui/material";
|
|
3
|
+
import { useState as l } from "react";
|
|
4
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
5
|
+
import p from "@mui/icons-material/Check";
|
|
6
|
+
import m from "@mui/icons-material/Close";
|
|
7
7
|
//#region src/components/tag-selection/TagSelectionAutocomplete.tsx
|
|
8
|
-
var
|
|
8
|
+
var te = [
|
|
9
9
|
"default",
|
|
10
10
|
"primary",
|
|
11
11
|
"secondary",
|
|
@@ -13,7 +13,7 @@ var h = [
|
|
|
13
13
|
"info",
|
|
14
14
|
"success",
|
|
15
15
|
"warning"
|
|
16
|
-
],
|
|
16
|
+
], h = [
|
|
17
17
|
"#f44336",
|
|
18
18
|
"#e91e63",
|
|
19
19
|
"#9c27b0",
|
|
@@ -35,26 +35,26 @@ var h = [
|
|
|
35
35
|
"#607d8b",
|
|
36
36
|
"#000000"
|
|
37
37
|
];
|
|
38
|
-
function
|
|
38
|
+
function g(e) {
|
|
39
39
|
return /^#[0-9A-Fa-f]{6}$/.test(e);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function _(e) {
|
|
42
42
|
let t = parseInt(e.slice(1, 3), 16), n = parseInt(e.slice(3, 5), 16), r = parseInt(e.slice(5, 7), 16);
|
|
43
43
|
return (.299 * t + .587 * n + .114 * r) / 255 > .5 ? "#000000" : "#ffffff";
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function v(e, t) {
|
|
46
46
|
let n = t.trim();
|
|
47
47
|
if (!n) return e;
|
|
48
48
|
let r = e.toLowerCase().indexOf(n.toLowerCase());
|
|
49
|
-
return r === -1 ? e : /* @__PURE__ */
|
|
49
|
+
return r === -1 ? e : /* @__PURE__ */ f(u, { children: [
|
|
50
50
|
e.slice(0, r),
|
|
51
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ d("strong", { children: e.slice(r, r + n.length) }),
|
|
52
52
|
e.slice(r + n.length)
|
|
53
53
|
] });
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
onClick:
|
|
55
|
+
function y({ color: e, selected: t, onClick: r }) {
|
|
56
|
+
return /* @__PURE__ */ d(n, {
|
|
57
|
+
onClick: r,
|
|
58
58
|
sx: {
|
|
59
59
|
width: 24,
|
|
60
60
|
height: 24,
|
|
@@ -75,15 +75,15 @@ function b({ color: e, selected: t, onClick: n }) {
|
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
return /* @__PURE__ */
|
|
78
|
+
function b({ value: e, onChange: t, disabled: r = !1 }) {
|
|
79
|
+
return /* @__PURE__ */ d(o, {
|
|
80
80
|
size: "small",
|
|
81
81
|
fullWidth: !0,
|
|
82
82
|
value: e,
|
|
83
83
|
onChange: (e) => t(e.target.value),
|
|
84
84
|
placeholder: "#rrggbb",
|
|
85
|
-
disabled:
|
|
86
|
-
error: !
|
|
85
|
+
disabled: r,
|
|
86
|
+
error: !r && e.length > 1 && !g(e),
|
|
87
87
|
sx: {
|
|
88
88
|
"& .MuiInputBase-root": { height: 28 },
|
|
89
89
|
"& .MuiInputBase-input": {
|
|
@@ -93,145 +93,145 @@ function x({ value: e, onChange: t, disabled: n = !1 }) {
|
|
|
93
93
|
fontFamily: "monospace"
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
|
-
slotProps: { input: { startAdornment: /* @__PURE__ */
|
|
96
|
+
slotProps: { input: { startAdornment: /* @__PURE__ */ d(n, { sx: {
|
|
97
97
|
width: 12,
|
|
98
98
|
height: 12,
|
|
99
99
|
borderRadius: .25,
|
|
100
100
|
flexShrink: 0,
|
|
101
101
|
mr: .5,
|
|
102
|
-
backgroundColor:
|
|
102
|
+
backgroundColor: g(e) ? e : "action.disabledBackground",
|
|
103
103
|
border: "1px solid",
|
|
104
104
|
borderColor: "divider"
|
|
105
105
|
} }) } }
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
let [
|
|
110
|
-
if (
|
|
111
|
-
let e =
|
|
112
|
-
ne?.(
|
|
108
|
+
function x({ availableTags: x, searchValue: S, translation: C, onSearchChange: w, onTagSelect: T, onTagCreate: ne, inputSize: re = "medium", chipSize: E = "medium", chipVariant: ie = "filled", disabled: D = !1, loading: ae = !1, isMaxReached: O = !1, allowCreate: oe = !1, listboxMaxHeight: k, serverSideFilter: A = !1 }) {
|
|
109
|
+
let [j, M] = l("default"), [N, P] = l(null), [F, I] = l(null), [L, R] = l(!0), [z, B] = l(!1), [V, H] = l(!1), [U, W] = l("#1976d2"), [G, K] = l("#ffffff"), q = D || O, J = N !== null, se = A ? x : x.filter((e) => e.label.toLowerCase().includes(S.trim().toLowerCase())), Y = oe && S.trim() !== "" && se.length === 0, ce = V && !Y, X = J ? L ? _(N) : F ?? "#000000" : void 0, Z = () => {
|
|
110
|
+
if (q) return;
|
|
111
|
+
let e = S.trim(), t = e.toLowerCase().replace(/\s+/g, "-");
|
|
112
|
+
ne?.(J && N ? {
|
|
113
113
|
id: t,
|
|
114
114
|
label: e,
|
|
115
115
|
selected: !0,
|
|
116
116
|
color: "default",
|
|
117
|
-
backgroundColor:
|
|
118
|
-
foregroundColor:
|
|
117
|
+
backgroundColor: N,
|
|
118
|
+
foregroundColor: X
|
|
119
119
|
} : {
|
|
120
120
|
id: t,
|
|
121
121
|
label: e,
|
|
122
122
|
selected: !0,
|
|
123
|
-
color:
|
|
124
|
-
}),
|
|
125
|
-
},
|
|
126
|
-
|
|
123
|
+
color: j
|
|
124
|
+
}), M("default"), P(null), I(null), R(!0), B(!1), w("");
|
|
125
|
+
}, Q = () => {
|
|
126
|
+
w(""), M("default"), P(null), I(null), R(!0), B(!1);
|
|
127
127
|
}, le = (e) => {
|
|
128
|
-
|
|
128
|
+
P(e), W(e), M("default");
|
|
129
129
|
}, ue = (e) => {
|
|
130
|
-
|
|
130
|
+
W(e), g(e) && (P(e), M("default"));
|
|
131
131
|
}, de = (e) => {
|
|
132
|
-
|
|
132
|
+
I(e), K(e);
|
|
133
133
|
}, fe = (e) => {
|
|
134
|
-
|
|
134
|
+
K(e), g(e) && I(e);
|
|
135
135
|
}, pe = (e) => {
|
|
136
|
-
if (
|
|
137
|
-
else if (
|
|
138
|
-
let e =
|
|
139
|
-
|
|
136
|
+
if (R(e), e) I(null);
|
|
137
|
+
else if (N) {
|
|
138
|
+
let e = _(N);
|
|
139
|
+
I(e), K(e);
|
|
140
140
|
}
|
|
141
141
|
}, $ = (e) => e.preventDefault();
|
|
142
|
-
return /* @__PURE__ */
|
|
142
|
+
return /* @__PURE__ */ f(n, {
|
|
143
143
|
sx: { mb: 2 },
|
|
144
144
|
className: e.autocomplete,
|
|
145
|
-
children: [/* @__PURE__ */
|
|
146
|
-
options:
|
|
147
|
-
filterOptions:
|
|
145
|
+
children: [/* @__PURE__ */ d(t, {
|
|
146
|
+
options: x,
|
|
147
|
+
filterOptions: A ? (e) => e : void 0,
|
|
148
148
|
value: null,
|
|
149
|
-
open:
|
|
149
|
+
open: ce,
|
|
150
150
|
onOpen: () => {
|
|
151
|
-
|
|
151
|
+
Y || H(!0);
|
|
152
152
|
},
|
|
153
|
-
onClose: () =>
|
|
153
|
+
onClose: () => H(!1),
|
|
154
154
|
size: re,
|
|
155
|
-
disabled:
|
|
156
|
-
loading:
|
|
155
|
+
disabled: q,
|
|
156
|
+
loading: ae,
|
|
157
157
|
getOptionLabel: (e) => e.label,
|
|
158
|
-
inputValue:
|
|
158
|
+
inputValue: S,
|
|
159
159
|
onInputChange: (e, t, n) => {
|
|
160
|
-
n === "input" &&
|
|
160
|
+
n === "input" && w(t);
|
|
161
161
|
},
|
|
162
162
|
onChange: (e, t) => {
|
|
163
|
-
t &&
|
|
163
|
+
t && T(t);
|
|
164
164
|
},
|
|
165
165
|
slotProps: { listbox: { sx: {
|
|
166
166
|
display: "flex",
|
|
167
167
|
flexWrap: "wrap",
|
|
168
168
|
gap: 1,
|
|
169
169
|
padding: 1,
|
|
170
|
-
...
|
|
171
|
-
maxHeight:
|
|
170
|
+
...k !== void 0 && {
|
|
171
|
+
maxHeight: k,
|
|
172
172
|
overflowY: "auto"
|
|
173
173
|
}
|
|
174
174
|
} } },
|
|
175
|
-
renderInput: (e) => /* @__PURE__ */
|
|
175
|
+
renderInput: (e) => /* @__PURE__ */ d(o, {
|
|
176
176
|
...e,
|
|
177
|
-
label:
|
|
178
|
-
placeholder:
|
|
179
|
-
helperText:
|
|
177
|
+
label: C.autoCompleteLabel,
|
|
178
|
+
placeholder: C.placeholder,
|
|
179
|
+
helperText: O && !D ? C.maxTagsReachedText : void 0,
|
|
180
180
|
onKeyDown: (e) => {
|
|
181
|
-
|
|
181
|
+
Y && !q && e.key === "Enter" && (e.preventDefault(), Z());
|
|
182
182
|
},
|
|
183
183
|
slotProps: {
|
|
184
184
|
...e.slotProps,
|
|
185
185
|
input: {
|
|
186
186
|
...e.slotProps?.input,
|
|
187
|
-
endAdornment: /* @__PURE__ */
|
|
187
|
+
endAdornment: /* @__PURE__ */ f(u, { children: [Y && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(i, {
|
|
188
188
|
size: "small",
|
|
189
189
|
sx: { color: "success.main" },
|
|
190
190
|
onMouseDown: $,
|
|
191
|
-
onClick:
|
|
192
|
-
disabled:
|
|
193
|
-
"aria-label":
|
|
194
|
-
children: /* @__PURE__ */
|
|
195
|
-
}), /* @__PURE__ */
|
|
191
|
+
onClick: Z,
|
|
192
|
+
disabled: q,
|
|
193
|
+
"aria-label": C.confirmCreateLabel,
|
|
194
|
+
children: /* @__PURE__ */ d(p, { fontSize: "small" })
|
|
195
|
+
}), /* @__PURE__ */ d(i, {
|
|
196
196
|
size: "small",
|
|
197
197
|
onMouseDown: $,
|
|
198
|
-
onClick:
|
|
199
|
-
"aria-label":
|
|
200
|
-
children: /* @__PURE__ */
|
|
198
|
+
onClick: Q,
|
|
199
|
+
"aria-label": C.cancelCreateLabel,
|
|
200
|
+
children: /* @__PURE__ */ d(m, { fontSize: "small" })
|
|
201
201
|
})] }), e.slotProps?.input?.endAdornment] })
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
}),
|
|
205
|
-
renderOption: ({ key: t, ...n },
|
|
206
|
-
let a = !!(
|
|
207
|
-
return /* @__PURE__ */
|
|
205
|
+
renderOption: ({ key: t, ...n }, i) => {
|
|
206
|
+
let a = !!(i.foregroundColor || i.backgroundColor);
|
|
207
|
+
return /* @__PURE__ */ d("li", {
|
|
208
208
|
...n,
|
|
209
209
|
style: {
|
|
210
210
|
width: "auto",
|
|
211
211
|
padding: 0,
|
|
212
212
|
margin: 0
|
|
213
213
|
},
|
|
214
|
-
children: /* @__PURE__ */
|
|
214
|
+
children: /* @__PURE__ */ d(r, {
|
|
215
215
|
size: E,
|
|
216
216
|
variant: ie,
|
|
217
|
-
label:
|
|
218
|
-
color: a ? void 0 :
|
|
217
|
+
label: v(i.label, S),
|
|
218
|
+
color: a ? void 0 : i.color ?? "default",
|
|
219
219
|
className: e.option,
|
|
220
220
|
sx: a ? {
|
|
221
|
-
color:
|
|
222
|
-
backgroundColor:
|
|
221
|
+
color: i.foregroundColor ?? "inherit",
|
|
222
|
+
backgroundColor: i.backgroundColor ?? "transparent"
|
|
223
223
|
} : void 0
|
|
224
224
|
})
|
|
225
225
|
}, t);
|
|
226
226
|
},
|
|
227
227
|
isOptionEqualToValue: (e, t) => e.id === t.id,
|
|
228
|
-
noOptionsText:
|
|
229
|
-
loadingText:
|
|
230
|
-
}),
|
|
228
|
+
noOptionsText: C.noAvailableTagsText,
|
|
229
|
+
loadingText: C.loadingText
|
|
230
|
+
}), Y && /* @__PURE__ */ f(n, {
|
|
231
231
|
sx: { position: "relative" },
|
|
232
232
|
onMouseDown: $,
|
|
233
233
|
className: e.createPanel,
|
|
234
|
-
children: [/* @__PURE__ */
|
|
234
|
+
children: [/* @__PURE__ */ f(a, {
|
|
235
235
|
direction: "row",
|
|
236
236
|
sx: {
|
|
237
237
|
mt: .5,
|
|
@@ -239,33 +239,33 @@ function S({ availableTags: S, searchValue: C, translation: w, onSearchChange: T
|
|
|
239
239
|
gap: .5,
|
|
240
240
|
alignItems: "center"
|
|
241
241
|
},
|
|
242
|
-
children: [
|
|
242
|
+
children: [te.map((e) => /* @__PURE__ */ d(r, {
|
|
243
243
|
size: E,
|
|
244
244
|
color: e,
|
|
245
245
|
label: e,
|
|
246
|
-
variant: !
|
|
246
|
+
variant: !J && j === e ? "filled" : "outlined",
|
|
247
247
|
onClick: () => {
|
|
248
|
-
|
|
248
|
+
M(e), P(null), I(null), B(!1);
|
|
249
249
|
},
|
|
250
250
|
clickable: !0
|
|
251
|
-
}, e)), /* @__PURE__ */
|
|
252
|
-
title:
|
|
253
|
-
children: /* @__PURE__ */
|
|
251
|
+
}, e)), /* @__PURE__ */ d(s, {
|
|
252
|
+
title: C.colorPickerLabel,
|
|
253
|
+
children: /* @__PURE__ */ d(r, {
|
|
254
254
|
size: E,
|
|
255
|
-
label:
|
|
255
|
+
label: J ? N : "···",
|
|
256
256
|
variant: "outlined",
|
|
257
257
|
onClick: () => {
|
|
258
|
-
|
|
258
|
+
B((e) => !e), N && W(N), F && K(F);
|
|
259
259
|
},
|
|
260
260
|
sx: (e) => ({
|
|
261
261
|
cursor: "pointer",
|
|
262
262
|
fontFamily: "monospace",
|
|
263
263
|
fontSize: "0.7rem",
|
|
264
|
-
...
|
|
265
|
-
backgroundColor:
|
|
266
|
-
color:
|
|
264
|
+
...J ? {
|
|
265
|
+
backgroundColor: N,
|
|
266
|
+
color: X,
|
|
267
267
|
border: "1.5px solid transparent",
|
|
268
|
-
backgroundImage: `linear-gradient(${
|
|
268
|
+
backgroundImage: `linear-gradient(${N}, ${N}), linear-gradient(90deg, #f44336, #ff9800, #ffeb3b, #4caf50, #2196f3, #9c27b0)`,
|
|
269
269
|
backgroundOrigin: "border-box",
|
|
270
270
|
backgroundClip: "padding-box, border-box"
|
|
271
271
|
} : {
|
|
@@ -278,7 +278,7 @@ function S({ availableTags: S, searchValue: C, translation: w, onSearchChange: T
|
|
|
278
278
|
clickable: !0
|
|
279
279
|
})
|
|
280
280
|
})]
|
|
281
|
-
}),
|
|
281
|
+
}), z && /* @__PURE__ */ d(n, {
|
|
282
282
|
sx: {
|
|
283
283
|
position: "absolute",
|
|
284
284
|
top: "calc(100% + 4px)",
|
|
@@ -292,13 +292,13 @@ function S({ availableTags: S, searchValue: C, translation: w, onSearchChange: T
|
|
|
292
292
|
p: 1.25,
|
|
293
293
|
width: "max-content"
|
|
294
294
|
},
|
|
295
|
-
children: /* @__PURE__ */
|
|
295
|
+
children: /* @__PURE__ */ f(n, {
|
|
296
296
|
sx: {
|
|
297
297
|
display: "grid",
|
|
298
298
|
gridTemplateColumns: "auto auto",
|
|
299
299
|
gap: 2
|
|
300
300
|
},
|
|
301
|
-
children: [/* @__PURE__ */
|
|
301
|
+
children: [/* @__PURE__ */ f(n, { children: [/* @__PURE__ */ d(c, {
|
|
302
302
|
variant: "caption",
|
|
303
303
|
sx: {
|
|
304
304
|
fontWeight: 700,
|
|
@@ -306,29 +306,29 @@ function S({ availableTags: S, searchValue: C, translation: w, onSearchChange: T
|
|
|
306
306
|
display: "block",
|
|
307
307
|
mb: .5
|
|
308
308
|
},
|
|
309
|
-
children:
|
|
310
|
-
}), /* @__PURE__ */
|
|
309
|
+
children: C.backgroundColorLabel
|
|
310
|
+
}), /* @__PURE__ */ f(n, {
|
|
311
311
|
sx: {
|
|
312
312
|
display: "grid",
|
|
313
313
|
gridTemplateColumns: "repeat(5, 24px)",
|
|
314
314
|
gap: .5
|
|
315
315
|
},
|
|
316
|
-
children: [
|
|
316
|
+
children: [h.map((e) => /* @__PURE__ */ d(y, {
|
|
317
317
|
color: e,
|
|
318
|
-
selected:
|
|
318
|
+
selected: N === e,
|
|
319
319
|
onClick: () => le(e)
|
|
320
|
-
}, e)), /* @__PURE__ */
|
|
320
|
+
}, e)), /* @__PURE__ */ d(n, {
|
|
321
321
|
sx: {
|
|
322
322
|
gridColumn: "span 5",
|
|
323
323
|
mt: .25
|
|
324
324
|
},
|
|
325
|
-
children: /* @__PURE__ */
|
|
326
|
-
value:
|
|
325
|
+
children: /* @__PURE__ */ d(b, {
|
|
326
|
+
value: U,
|
|
327
327
|
onChange: ue
|
|
328
328
|
})
|
|
329
329
|
})]
|
|
330
|
-
})] }), /* @__PURE__ */
|
|
331
|
-
/* @__PURE__ */
|
|
330
|
+
})] }), /* @__PURE__ */ f(n, { children: [
|
|
331
|
+
/* @__PURE__ */ d(c, {
|
|
332
332
|
variant: "caption",
|
|
333
333
|
sx: {
|
|
334
334
|
fontWeight: 700,
|
|
@@ -336,34 +336,34 @@ function S({ availableTags: S, searchValue: C, translation: w, onSearchChange: T
|
|
|
336
336
|
display: "block",
|
|
337
337
|
mb: .5
|
|
338
338
|
},
|
|
339
|
-
children:
|
|
339
|
+
children: C.textColorLabel
|
|
340
340
|
}),
|
|
341
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ f(n, {
|
|
342
342
|
sx: {
|
|
343
343
|
display: "grid",
|
|
344
344
|
gridTemplateColumns: "repeat(5, 24px)",
|
|
345
345
|
gap: .5,
|
|
346
|
-
opacity:
|
|
347
|
-
pointerEvents:
|
|
346
|
+
opacity: L ? .3 : 1,
|
|
347
|
+
pointerEvents: L ? "none" : "auto",
|
|
348
348
|
transition: "opacity 0.15s"
|
|
349
349
|
},
|
|
350
|
-
children: [
|
|
350
|
+
children: [h.map((e) => /* @__PURE__ */ d(y, {
|
|
351
351
|
color: e,
|
|
352
|
-
selected:
|
|
352
|
+
selected: F === e,
|
|
353
353
|
onClick: () => de(e)
|
|
354
|
-
}, e)), /* @__PURE__ */
|
|
354
|
+
}, e)), /* @__PURE__ */ d(n, {
|
|
355
355
|
sx: {
|
|
356
356
|
gridColumn: "span 5",
|
|
357
357
|
mt: .25
|
|
358
358
|
},
|
|
359
|
-
children: /* @__PURE__ */
|
|
360
|
-
value:
|
|
359
|
+
children: /* @__PURE__ */ d(b, {
|
|
360
|
+
value: L ? X ?? "#000000" : G,
|
|
361
361
|
onChange: fe,
|
|
362
|
-
disabled:
|
|
362
|
+
disabled: L
|
|
363
363
|
})
|
|
364
364
|
})]
|
|
365
365
|
}),
|
|
366
|
-
/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */ f(a, {
|
|
367
367
|
direction: "row",
|
|
368
368
|
sx: {
|
|
369
369
|
width: "100%",
|
|
@@ -372,13 +372,13 @@ function S({ availableTags: S, searchValue: C, translation: w, onSearchChange: T
|
|
|
372
372
|
gap: .5,
|
|
373
373
|
mt: .25
|
|
374
374
|
},
|
|
375
|
-
children: [/* @__PURE__ */
|
|
375
|
+
children: [/* @__PURE__ */ d(c, {
|
|
376
376
|
variant: "caption",
|
|
377
377
|
color: "text.secondary",
|
|
378
|
-
children:
|
|
379
|
-
}), /* @__PURE__ */
|
|
378
|
+
children: C.autoTextColorLabel
|
|
379
|
+
}), /* @__PURE__ */ d(ee, {
|
|
380
380
|
size: "small",
|
|
381
|
-
checked:
|
|
381
|
+
checked: L,
|
|
382
382
|
onChange: (e) => pe(e.target.checked)
|
|
383
383
|
})]
|
|
384
384
|
})
|
|
@@ -389,4 +389,4 @@ function S({ availableTags: S, searchValue: C, translation: w, onSearchChange: T
|
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
391
|
//#endregion
|
|
392
|
-
export {
|
|
392
|
+
export { x as TagSelectionAutocomplete };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { tagSelectionClasses as e } from "./tagSelectionClasses.js";
|
|
2
2
|
import { TagSelectionChip as t } from "./TagSelectionChip.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Box as n, Chip as r, Popover as i, Stack as a, Typography as o } from "@mui/material";
|
|
4
|
+
import { useState as s } from "react";
|
|
5
5
|
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/tag-selection/TagSelectionSelectedTags.tsx
|
|
7
7
|
function d({ selectedTags: d, translation: f, onTagDelete: p, showSelectedTagsLabel: m, chipSize: h = "medium", chipVariant: g = "filled", disabled: _ = !1, maxVisibleChips: v, popoverPlacement: y = "bottom" }) {
|
|
8
|
-
let [b, x] =
|
|
8
|
+
let [b, x] = s(null), S = v === void 0 ? d : d.slice(0, v), C = v === void 0 ? [] : d.slice(v), w = !!b && C.length > 0, T = y === "top" ? {
|
|
9
9
|
vertical: "top",
|
|
10
10
|
horizontal: "left"
|
|
11
11
|
} : {
|
|
@@ -18,19 +18,19 @@ function d({ selectedTags: d, translation: f, onTagDelete: p, showSelectedTagsLa
|
|
|
18
18
|
vertical: "top",
|
|
19
19
|
horizontal: "left"
|
|
20
20
|
};
|
|
21
|
-
return /* @__PURE__ */ u(
|
|
21
|
+
return /* @__PURE__ */ u(n, {
|
|
22
22
|
sx: { mb: 2 },
|
|
23
23
|
className: e.selectedTags,
|
|
24
|
-
children: [m && /* @__PURE__ */ l(
|
|
24
|
+
children: [m && /* @__PURE__ */ l(o, {
|
|
25
25
|
variant: "subtitle2",
|
|
26
26
|
gutterBottom: !0,
|
|
27
27
|
className: e.selectedTagsLabel,
|
|
28
28
|
children: f.selectedTagsLabel
|
|
29
|
-
}), d.length === 0 ? /* @__PURE__ */ l(
|
|
29
|
+
}), d.length === 0 ? /* @__PURE__ */ l(o, {
|
|
30
30
|
variant: "body2",
|
|
31
31
|
color: "text.secondary",
|
|
32
32
|
children: f.noSelectedTagsText
|
|
33
|
-
}) : /* @__PURE__ */ u(
|
|
33
|
+
}) : /* @__PURE__ */ u(a, {
|
|
34
34
|
direction: "row",
|
|
35
35
|
sx: {
|
|
36
36
|
flexWrap: "wrap",
|
|
@@ -43,20 +43,20 @@ function d({ selectedTags: d, translation: f, onTagDelete: p, showSelectedTagsLa
|
|
|
43
43
|
chipSize: h,
|
|
44
44
|
chipVariant: g,
|
|
45
45
|
disabled: _
|
|
46
|
-
}, e.id)), C.length > 0 && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(
|
|
46
|
+
}, e.id)), C.length > 0 && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(r, {
|
|
47
47
|
size: h,
|
|
48
48
|
label: `+${C.length}`,
|
|
49
49
|
variant: "outlined",
|
|
50
50
|
clickable: !0,
|
|
51
51
|
onClick: (e) => x(e.currentTarget),
|
|
52
52
|
className: e.overflowChip
|
|
53
|
-
}), /* @__PURE__ */ l(
|
|
53
|
+
}), /* @__PURE__ */ l(i, {
|
|
54
54
|
open: w,
|
|
55
55
|
anchorEl: b,
|
|
56
56
|
onClose: () => x(null),
|
|
57
57
|
anchorOrigin: T,
|
|
58
58
|
transformOrigin: E,
|
|
59
|
-
children: /* @__PURE__ */ l(
|
|
59
|
+
children: /* @__PURE__ */ l(n, {
|
|
60
60
|
sx: {
|
|
61
61
|
p: 1,
|
|
62
62
|
display: "flex",
|