@thebuoyant-tsdev/mui-ts-library 3.11.2 → 3.12.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 +19 -0
- package/README.md +19 -0
- package/dist/components/gantt-chart/GanttTaskDialog.js +131 -126
- package/dist/components/gantt-chart/util/gantt-chart.util.d.ts +7 -0
- package/dist/components/gantt-chart/util/gantt-chart.util.js +31 -20
- package/dist/components/tag-selection/TagSelection.d.ts +1 -1
- package/dist/components/tag-selection/TagSelection.js +83 -70
- package/dist/components/tag-selection/TagSelection.types.d.ts +2 -0
- package/dist/components/tag-selection/TagSelectionAutocomplete.d.ts +2 -1
- package/dist/components/tag-selection/TagSelectionAutocomplete.js +88 -85
- package/dist/index.cjs +2 -2
- package/package.json +1 -1
|
@@ -2,101 +2,114 @@ import { createTagSelectionStore as e } from "./TagSelection.store.js";
|
|
|
2
2
|
import { TagSelectionAutocomplete as t } from "./TagSelectionAutocomplete.js";
|
|
3
3
|
import { TagSelectionSelectedTags as n } from "./TagSelectionSelectedTags.js";
|
|
4
4
|
import { DEFAULT_TAG_SELECTION_TRANSLATION as r } from "./TagSelection.types.js";
|
|
5
|
-
import { createContext as i, useContext as a, useEffect as o, useMemo as s,
|
|
6
|
-
import { Box as
|
|
7
|
-
import { jsx as
|
|
8
|
-
import { useStore as
|
|
5
|
+
import { createContext as i, useContext as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
|
|
6
|
+
import { Box as u, Stack as d } from "@mui/material";
|
|
7
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
8
|
+
import { useStore as m } from "zustand";
|
|
9
9
|
//#region src/components/tag-selection/TagSelection.tsx
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
let t = a(
|
|
10
|
+
var h = i(null);
|
|
11
|
+
function g(e) {
|
|
12
|
+
let t = a(h);
|
|
13
13
|
if (!t) throw Error("TagSelectionStoreContext is missing.");
|
|
14
|
-
return
|
|
14
|
+
return m(t, e);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
let
|
|
16
|
+
function _({ tags: e, showSelectedTags: r = !0, showSelectedTagsLabel: i = !0, showAutoComplete: a = !0, inputSize: l = "medium", chipSize: m = "small", disabled: h = !1, loading: _ = !1, maxTags: v, allowCreate: y = !1, maxVisibleChips: b, popoverPlacement: x = "bottom", listboxMaxHeight: S, searchDebounceMs: C, serverSideFilter: w = !1, translation: T, onTagSelect: E, onTagDelete: D, onTagsChange: O, onSearchChange: k, onTagCreate: A }) {
|
|
17
|
+
let j = g((e) => e.tags), M = g((e) => e.searchValue), N = g((e) => e.setTags), P = g((e) => e.setSearchValue), F = g((e) => e.selectTag), I = g((e) => e.deleteTag), L = g((e) => e.addTag);
|
|
18
18
|
o(() => {
|
|
19
|
-
|
|
20
|
-
}, [e,
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
19
|
+
N(e);
|
|
20
|
+
}, [e, N]);
|
|
21
|
+
let R = s(() => j.filter((e) => e.selected).sort((e, t) => e.label.localeCompare(t.label)), [j]), z = s(() => j.filter((e) => !e.selected && !e.disabled).sort((e, t) => e.label.localeCompare(t.label)), [j]), B = v !== void 0 && R.length >= v, V = (e) => {
|
|
22
|
+
O && O(e.filter((e) => e.selected), e);
|
|
23
|
+
}, H = (e) => {
|
|
24
|
+
if (e.disabled || e.selected) return;
|
|
25
|
+
F(e.id);
|
|
26
|
+
let t = j.map((t) => t.id === e.id ? {
|
|
27
|
+
...t,
|
|
28
|
+
selected: !0
|
|
29
|
+
} : t), n = t.filter((e) => e.selected), r = t.find((t) => t.id === e.id);
|
|
30
|
+
r && E && E(r, n, t), V(t);
|
|
31
|
+
}, U = (e) => {
|
|
32
|
+
I(e.id);
|
|
33
|
+
let t = j.map((t) => t.id === e.id ? {
|
|
34
|
+
...t,
|
|
35
|
+
selected: !1
|
|
36
|
+
} : t), n = t.filter((e) => e.selected), r = t.find((t) => t.id === e.id);
|
|
37
|
+
r && D && D(r, n, t), V(t);
|
|
38
|
+
}, W = c(null);
|
|
39
|
+
return o(() => () => {
|
|
40
|
+
W.current && clearTimeout(W.current);
|
|
41
|
+
}, []), /* @__PURE__ */ f(u, {
|
|
25
42
|
sx: { width: "100%" },
|
|
26
|
-
children: /* @__PURE__ */
|
|
27
|
-
selectedTags:
|
|
28
|
-
translation:
|
|
29
|
-
onTagDelete:
|
|
30
|
-
N(e.id);
|
|
31
|
-
let t = O.map((t) => t.id === e.id ? {
|
|
32
|
-
...t,
|
|
33
|
-
selected: !1
|
|
34
|
-
} : t), n = t.filter((e) => e.selected), r = t.find((t) => t.id === e.id);
|
|
35
|
-
r && w && w(r, n, t), R(t);
|
|
36
|
-
},
|
|
43
|
+
children: /* @__PURE__ */ p(d, { children: [r && /* @__PURE__ */ f(n, {
|
|
44
|
+
selectedTags: R,
|
|
45
|
+
translation: T,
|
|
46
|
+
onTagDelete: U,
|
|
37
47
|
showSelectedTagsLabel: i,
|
|
38
|
-
chipSize:
|
|
39
|
-
disabled:
|
|
40
|
-
maxVisibleChips:
|
|
41
|
-
popoverPlacement:
|
|
42
|
-
}), a && /* @__PURE__ */
|
|
43
|
-
availableTags:
|
|
44
|
-
searchValue:
|
|
45
|
-
translation:
|
|
48
|
+
chipSize: m,
|
|
49
|
+
disabled: h,
|
|
50
|
+
maxVisibleChips: b,
|
|
51
|
+
popoverPlacement: x
|
|
52
|
+
}), a && /* @__PURE__ */ f(t, {
|
|
53
|
+
availableTags: z,
|
|
54
|
+
searchValue: M,
|
|
55
|
+
translation: T,
|
|
46
56
|
onSearchChange: (e) => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
r && C && C(r, n, t), R(t);
|
|
57
|
+
if (P(e), k) {
|
|
58
|
+
if (W.current &&= (clearTimeout(W.current), null), !C) {
|
|
59
|
+
k(e);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
W.current = setTimeout(() => {
|
|
63
|
+
k(e), W.current = null;
|
|
64
|
+
}, C);
|
|
65
|
+
}
|
|
57
66
|
},
|
|
67
|
+
onTagSelect: H,
|
|
58
68
|
onTagCreate: (e) => {
|
|
59
|
-
|
|
69
|
+
L(e), V([...j, e]), A && A(e);
|
|
60
70
|
},
|
|
61
|
-
inputSize:
|
|
62
|
-
chipSize:
|
|
63
|
-
disabled:
|
|
64
|
-
loading:
|
|
65
|
-
isMaxReached:
|
|
66
|
-
allowCreate:
|
|
67
|
-
listboxMaxHeight:
|
|
71
|
+
inputSize: l,
|
|
72
|
+
chipSize: m,
|
|
73
|
+
disabled: h,
|
|
74
|
+
loading: _,
|
|
75
|
+
isMaxReached: B,
|
|
76
|
+
allowCreate: y,
|
|
77
|
+
listboxMaxHeight: S,
|
|
78
|
+
serverSideFilter: w
|
|
68
79
|
})] })
|
|
69
80
|
});
|
|
70
81
|
}
|
|
71
|
-
function
|
|
72
|
-
let
|
|
82
|
+
function v({ tags: t, showSelectedTags: n = !0, showSelectedTagsLabel: i = !0, showAutoComplete: a = !0, translation: o, inputSize: s = "medium", chipSize: c = "small", disabled: u = !1, loading: d = !1, maxTags: p, allowCreate: m = !1, maxVisibleChips: g, popoverPlacement: v = "bottom", listboxMaxHeight: y, searchDebounceMs: b, serverSideFilter: x = !1, onTagSelect: S, onTagDelete: C, onTagsChange: w, onSearchChange: T, onTagCreate: E }) {
|
|
83
|
+
let D = {
|
|
73
84
|
...r,
|
|
74
85
|
...o
|
|
75
|
-
}, [
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
-
value:
|
|
78
|
-
children: /* @__PURE__ */
|
|
86
|
+
}, [O] = l(() => e(t));
|
|
87
|
+
return /* @__PURE__ */ f(h.Provider, {
|
|
88
|
+
value: O,
|
|
89
|
+
children: /* @__PURE__ */ f(_, {
|
|
79
90
|
tags: t,
|
|
80
91
|
showSelectedTags: n,
|
|
81
92
|
showSelectedTagsLabel: i,
|
|
82
93
|
showAutoComplete: a,
|
|
83
|
-
translation:
|
|
94
|
+
translation: D,
|
|
84
95
|
inputSize: s,
|
|
85
|
-
chipSize:
|
|
96
|
+
chipSize: c,
|
|
86
97
|
disabled: u,
|
|
87
|
-
loading:
|
|
98
|
+
loading: d,
|
|
88
99
|
maxTags: p,
|
|
89
|
-
allowCreate:
|
|
90
|
-
maxVisibleChips:
|
|
100
|
+
allowCreate: m,
|
|
101
|
+
maxVisibleChips: g,
|
|
91
102
|
popoverPlacement: v,
|
|
92
103
|
listboxMaxHeight: y,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
104
|
+
searchDebounceMs: b,
|
|
105
|
+
serverSideFilter: x,
|
|
106
|
+
onTagSelect: S,
|
|
107
|
+
onTagDelete: C,
|
|
108
|
+
onTagsChange: w,
|
|
109
|
+
onSearchChange: T,
|
|
110
|
+
onTagCreate: E
|
|
98
111
|
})
|
|
99
112
|
});
|
|
100
113
|
}
|
|
101
114
|
//#endregion
|
|
102
|
-
export {
|
|
115
|
+
export { v as TagSelection };
|
|
@@ -36,6 +36,8 @@ export type TagSelectionProps = {
|
|
|
36
36
|
maxTags?: number;
|
|
37
37
|
maxVisibleChips?: number;
|
|
38
38
|
popoverPlacement?: "top" | "bottom";
|
|
39
|
+
searchDebounceMs?: number;
|
|
40
|
+
serverSideFilter?: boolean;
|
|
39
41
|
showAutoComplete?: boolean;
|
|
40
42
|
showSelectedTags?: boolean;
|
|
41
43
|
showSelectedTagsLabel?: boolean;
|
|
@@ -13,6 +13,7 @@ type TagSelectionAutocompleteProps = {
|
|
|
13
13
|
isMaxReached?: boolean;
|
|
14
14
|
allowCreate?: boolean;
|
|
15
15
|
listboxMaxHeight?: number;
|
|
16
|
+
serverSideFilter?: boolean;
|
|
16
17
|
};
|
|
17
|
-
export declare function TagSelectionAutocomplete({ availableTags, searchValue, translation, onSearchChange, onTagSelect, onTagCreate, inputSize, chipSize, disabled, loading, isMaxReached, allowCreate, listboxMaxHeight, }: TagSelectionAutocompleteProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function TagSelectionAutocomplete({ availableTags, searchValue, translation, onSearchChange, onTagSelect, onTagCreate, inputSize, chipSize, disabled, loading, isMaxReached, allowCreate, listboxMaxHeight, serverSideFilter, }: TagSelectionAutocompleteProps): import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useState as e } from "react";
|
|
2
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
3
|
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import f from "@mui/icons-material/Check";
|
|
5
|
+
import te from "@mui/icons-material/Close";
|
|
6
6
|
//#region src/components/tag-selection/TagSelectionAutocomplete.tsx
|
|
7
|
-
var
|
|
7
|
+
var p = [
|
|
8
8
|
"default",
|
|
9
9
|
"primary",
|
|
10
10
|
"secondary",
|
|
@@ -12,7 +12,7 @@ var ne = [
|
|
|
12
12
|
"info",
|
|
13
13
|
"success",
|
|
14
14
|
"warning"
|
|
15
|
-
],
|
|
15
|
+
], m = [
|
|
16
16
|
"#f44336",
|
|
17
17
|
"#e91e63",
|
|
18
18
|
"#9c27b0",
|
|
@@ -34,14 +34,14 @@ var ne = [
|
|
|
34
34
|
"#607d8b",
|
|
35
35
|
"#000000"
|
|
36
36
|
];
|
|
37
|
-
function
|
|
37
|
+
function h(e) {
|
|
38
38
|
return /^#[0-9A-Fa-f]{6}$/.test(e);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function g(e) {
|
|
41
41
|
let t = parseInt(e.slice(1, 3), 16), n = parseInt(e.slice(3, 5), 16), r = parseInt(e.slice(5, 7), 16);
|
|
42
42
|
return (.299 * t + .587 * n + .114 * r) / 255 > .5 ? "#000000" : "#ffffff";
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function _(e, t) {
|
|
45
45
|
let n = t.trim();
|
|
46
46
|
if (!n) return e;
|
|
47
47
|
let r = e.toLowerCase().indexOf(n.toLowerCase());
|
|
@@ -51,7 +51,7 @@ function g(e, t) {
|
|
|
51
51
|
e.slice(r + n.length)
|
|
52
52
|
] });
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function v({ color: e, selected: t, onClick: r }) {
|
|
55
55
|
return /* @__PURE__ */ u(n, {
|
|
56
56
|
onClick: r,
|
|
57
57
|
sx: {
|
|
@@ -74,7 +74,7 @@ function _({ color: e, selected: t, onClick: r }) {
|
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function y({ value: e, onChange: t, disabled: r = !1 }) {
|
|
78
78
|
return /* @__PURE__ */ u(o, {
|
|
79
79
|
size: "small",
|
|
80
80
|
fullWidth: !0,
|
|
@@ -82,7 +82,7 @@ function v({ value: e, onChange: t, disabled: r = !1 }) {
|
|
|
82
82
|
onChange: (e) => t(e.target.value),
|
|
83
83
|
placeholder: "#rrggbb",
|
|
84
84
|
disabled: r,
|
|
85
|
-
error: !r && e.length > 1 && !
|
|
85
|
+
error: !r && e.length > 1 && !h(e),
|
|
86
86
|
sx: {
|
|
87
87
|
"& .MuiInputBase-root": { height: 28 },
|
|
88
88
|
"& .MuiInputBase-input": {
|
|
@@ -98,64 +98,67 @@ function v({ value: e, onChange: t, disabled: r = !1 }) {
|
|
|
98
98
|
borderRadius: .25,
|
|
99
99
|
flexShrink: 0,
|
|
100
100
|
mr: .5,
|
|
101
|
-
backgroundColor:
|
|
101
|
+
backgroundColor: h(e) ? e : "action.disabledBackground",
|
|
102
102
|
border: "1px solid",
|
|
103
103
|
borderColor: "divider"
|
|
104
104
|
} }) } }
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
let [
|
|
109
|
-
if (
|
|
110
|
-
let e =
|
|
111
|
-
|
|
107
|
+
function b({ availableTags: b, searchValue: x, translation: S, onSearchChange: C, onTagSelect: w, onTagCreate: T, inputSize: ne = "medium", chipSize: E = "medium", disabled: D = !1, loading: re = !1, isMaxReached: O = !1, allowCreate: ie = !1, listboxMaxHeight: k, serverSideFilter: A = !1 }) {
|
|
108
|
+
let [j, M] = e("default"), [N, P] = e(null), [F, I] = e(null), [L, R] = e(!0), [z, B] = e(!1), [V, H] = e(!1), [U, W] = e("#1976d2"), [G, K] = e("#ffffff"), q = D || O, J = N !== null, ae = A ? b : b.filter((e) => e.label.toLowerCase().includes(x.trim().toLowerCase())), Y = ie && x.trim() !== "" && ae.length === 0, oe = V && !Y, X = J ? L ? g(N) : F ?? "#000000" : void 0, Z = () => {
|
|
109
|
+
if (q) return;
|
|
110
|
+
let e = x.trim(), t = e.toLowerCase().replace(/\s+/g, "-");
|
|
111
|
+
T?.(J && N ? {
|
|
112
112
|
id: t,
|
|
113
113
|
label: e,
|
|
114
114
|
selected: !0,
|
|
115
115
|
color: "default",
|
|
116
|
-
backgroundColor:
|
|
116
|
+
backgroundColor: N,
|
|
117
117
|
foregroundColor: X
|
|
118
118
|
} : {
|
|
119
119
|
id: t,
|
|
120
120
|
label: e,
|
|
121
121
|
selected: !0,
|
|
122
|
-
color:
|
|
123
|
-
}),
|
|
122
|
+
color: j
|
|
123
|
+
}), M("default"), P(null), I(null), R(!0), B(!1), C("");
|
|
124
124
|
}, Q = () => {
|
|
125
|
-
|
|
126
|
-
}, oe = (e) => {
|
|
127
|
-
N(e), U(e), j("default");
|
|
125
|
+
C(""), M("default"), P(null), I(null), R(!0), B(!1);
|
|
128
126
|
}, se = (e) => {
|
|
129
|
-
|
|
127
|
+
P(e), W(e), M("default");
|
|
130
128
|
}, ce = (e) => {
|
|
131
|
-
|
|
129
|
+
W(e), h(e) && (P(e), M("default"));
|
|
132
130
|
}, le = (e) => {
|
|
133
|
-
|
|
131
|
+
I(e), K(e);
|
|
134
132
|
}, ue = (e) => {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
133
|
+
K(e), h(e) && I(e);
|
|
134
|
+
}, de = (e) => {
|
|
135
|
+
if (R(e), e) I(null);
|
|
136
|
+
else if (N) {
|
|
137
|
+
let e = g(N);
|
|
138
|
+
I(e), K(e);
|
|
139
139
|
}
|
|
140
140
|
}, $ = (e) => e.preventDefault();
|
|
141
141
|
return /* @__PURE__ */ d(n, {
|
|
142
142
|
sx: { mb: 2 },
|
|
143
143
|
children: [/* @__PURE__ */ u(t, {
|
|
144
|
-
options:
|
|
144
|
+
options: b,
|
|
145
|
+
filterOptions: A ? (e) => e : void 0,
|
|
145
146
|
value: null,
|
|
146
|
-
open:
|
|
147
|
+
open: oe,
|
|
147
148
|
onOpen: () => {
|
|
148
|
-
Y ||
|
|
149
|
+
Y || H(!0);
|
|
149
150
|
},
|
|
150
|
-
onClose: () =>
|
|
151
|
-
size:
|
|
152
|
-
disabled:
|
|
153
|
-
loading:
|
|
151
|
+
onClose: () => H(!1),
|
|
152
|
+
size: ne,
|
|
153
|
+
disabled: q,
|
|
154
|
+
loading: re,
|
|
154
155
|
getOptionLabel: (e) => e.label,
|
|
155
|
-
inputValue:
|
|
156
|
-
onInputChange: (e, t) =>
|
|
156
|
+
inputValue: x,
|
|
157
|
+
onInputChange: (e, t, n) => {
|
|
158
|
+
n === "input" && C(t);
|
|
159
|
+
},
|
|
157
160
|
onChange: (e, t) => {
|
|
158
|
-
t &&
|
|
161
|
+
t && w(t);
|
|
159
162
|
},
|
|
160
163
|
slotProps: { listbox: { sx: {
|
|
161
164
|
display: "flex",
|
|
@@ -169,11 +172,11 @@ function y({ availableTags: y, searchValue: b, translation: x, onSearchChange: S
|
|
|
169
172
|
} } },
|
|
170
173
|
renderInput: (e) => /* @__PURE__ */ u(o, {
|
|
171
174
|
...e,
|
|
172
|
-
label:
|
|
173
|
-
placeholder:
|
|
174
|
-
helperText: O && !
|
|
175
|
+
label: S.autoCompleteLabel,
|
|
176
|
+
placeholder: S.placeholder,
|
|
177
|
+
helperText: O && !D ? S.maxTagsReachedText : void 0,
|
|
175
178
|
onKeyDown: (e) => {
|
|
176
|
-
Y && !
|
|
179
|
+
Y && !q && e.key === "Enter" && (e.preventDefault(), Z());
|
|
177
180
|
},
|
|
178
181
|
slotProps: {
|
|
179
182
|
...e.slotProps,
|
|
@@ -184,15 +187,15 @@ function y({ availableTags: y, searchValue: b, translation: x, onSearchChange: S
|
|
|
184
187
|
sx: { color: "success.main" },
|
|
185
188
|
onMouseDown: $,
|
|
186
189
|
onClick: Z,
|
|
187
|
-
disabled:
|
|
188
|
-
"aria-label":
|
|
189
|
-
children: /* @__PURE__ */ u(
|
|
190
|
+
disabled: q,
|
|
191
|
+
"aria-label": S.confirmCreateLabel,
|
|
192
|
+
children: /* @__PURE__ */ u(f, { fontSize: "small" })
|
|
190
193
|
}), /* @__PURE__ */ u(i, {
|
|
191
194
|
size: "small",
|
|
192
195
|
onMouseDown: $,
|
|
193
196
|
onClick: Q,
|
|
194
|
-
"aria-label":
|
|
195
|
-
children: /* @__PURE__ */ u(
|
|
197
|
+
"aria-label": S.cancelCreateLabel,
|
|
198
|
+
children: /* @__PURE__ */ u(te, { fontSize: "small" })
|
|
196
199
|
})] }), e.slotProps?.input?.endAdornment] })
|
|
197
200
|
}
|
|
198
201
|
}
|
|
@@ -207,8 +210,8 @@ function y({ availableTags: y, searchValue: b, translation: x, onSearchChange: S
|
|
|
207
210
|
margin: 0
|
|
208
211
|
},
|
|
209
212
|
children: /* @__PURE__ */ u(r, {
|
|
210
|
-
size:
|
|
211
|
-
label:
|
|
213
|
+
size: E,
|
|
214
|
+
label: _(n.label, x),
|
|
212
215
|
color: i ? void 0 : n.color ?? "default",
|
|
213
216
|
sx: i ? {
|
|
214
217
|
color: n.foregroundColor ?? "inherit",
|
|
@@ -218,8 +221,8 @@ function y({ availableTags: y, searchValue: b, translation: x, onSearchChange: S
|
|
|
218
221
|
}, e);
|
|
219
222
|
},
|
|
220
223
|
isOptionEqualToValue: (e, t) => e.id === t.id,
|
|
221
|
-
noOptionsText:
|
|
222
|
-
loadingText:
|
|
224
|
+
noOptionsText: S.noAvailableTagsText,
|
|
225
|
+
loadingText: S.loadingText
|
|
223
226
|
}), Y && /* @__PURE__ */ d(n, {
|
|
224
227
|
sx: { position: "relative" },
|
|
225
228
|
onMouseDown: $,
|
|
@@ -231,33 +234,33 @@ function y({ availableTags: y, searchValue: b, translation: x, onSearchChange: S
|
|
|
231
234
|
gap: .5,
|
|
232
235
|
alignItems: "center"
|
|
233
236
|
},
|
|
234
|
-
children: [
|
|
235
|
-
size:
|
|
237
|
+
children: [p.map((e) => /* @__PURE__ */ u(r, {
|
|
238
|
+
size: E,
|
|
236
239
|
color: e,
|
|
237
240
|
label: e,
|
|
238
|
-
variant: !
|
|
241
|
+
variant: !J && j === e ? "filled" : "outlined",
|
|
239
242
|
onClick: () => {
|
|
240
|
-
|
|
243
|
+
M(e), P(null), I(null), B(!1);
|
|
241
244
|
},
|
|
242
245
|
clickable: !0
|
|
243
246
|
}, e)), /* @__PURE__ */ u(s, {
|
|
244
|
-
title:
|
|
247
|
+
title: S.colorPickerLabel,
|
|
245
248
|
children: /* @__PURE__ */ u(r, {
|
|
246
|
-
size:
|
|
247
|
-
label:
|
|
249
|
+
size: E,
|
|
250
|
+
label: J ? N : "···",
|
|
248
251
|
variant: "outlined",
|
|
249
252
|
onClick: () => {
|
|
250
|
-
|
|
253
|
+
B((e) => !e), N && W(N), F && K(F);
|
|
251
254
|
},
|
|
252
255
|
sx: (e) => ({
|
|
253
256
|
cursor: "pointer",
|
|
254
257
|
fontFamily: "monospace",
|
|
255
258
|
fontSize: "0.7rem",
|
|
256
|
-
...
|
|
257
|
-
backgroundColor:
|
|
259
|
+
...J ? {
|
|
260
|
+
backgroundColor: N,
|
|
258
261
|
color: X,
|
|
259
262
|
border: "1.5px solid transparent",
|
|
260
|
-
backgroundImage: `linear-gradient(${
|
|
263
|
+
backgroundImage: `linear-gradient(${N}, ${N}), linear-gradient(90deg, #f44336, #ff9800, #ffeb3b, #4caf50, #2196f3, #9c27b0)`,
|
|
261
264
|
backgroundOrigin: "border-box",
|
|
262
265
|
backgroundClip: "padding-box, border-box"
|
|
263
266
|
} : {
|
|
@@ -270,7 +273,7 @@ function y({ availableTags: y, searchValue: b, translation: x, onSearchChange: S
|
|
|
270
273
|
clickable: !0
|
|
271
274
|
})
|
|
272
275
|
})]
|
|
273
|
-
}),
|
|
276
|
+
}), z && /* @__PURE__ */ u(n, {
|
|
274
277
|
sx: {
|
|
275
278
|
position: "absolute",
|
|
276
279
|
top: "calc(100% + 4px)",
|
|
@@ -298,25 +301,25 @@ function y({ availableTags: y, searchValue: b, translation: x, onSearchChange: S
|
|
|
298
301
|
display: "block",
|
|
299
302
|
mb: .5
|
|
300
303
|
},
|
|
301
|
-
children:
|
|
304
|
+
children: S.backgroundColorLabel
|
|
302
305
|
}), /* @__PURE__ */ d(n, {
|
|
303
306
|
sx: {
|
|
304
307
|
display: "grid",
|
|
305
308
|
gridTemplateColumns: "repeat(5, 24px)",
|
|
306
309
|
gap: .5
|
|
307
310
|
},
|
|
308
|
-
children: [
|
|
311
|
+
children: [m.map((e) => /* @__PURE__ */ u(v, {
|
|
309
312
|
color: e,
|
|
310
|
-
selected:
|
|
311
|
-
onClick: () =>
|
|
313
|
+
selected: N === e,
|
|
314
|
+
onClick: () => se(e)
|
|
312
315
|
}, e)), /* @__PURE__ */ u(n, {
|
|
313
316
|
sx: {
|
|
314
317
|
gridColumn: "span 5",
|
|
315
318
|
mt: .25
|
|
316
319
|
},
|
|
317
|
-
children: /* @__PURE__ */ u(
|
|
318
|
-
value:
|
|
319
|
-
onChange:
|
|
320
|
+
children: /* @__PURE__ */ u(y, {
|
|
321
|
+
value: U,
|
|
322
|
+
onChange: ce
|
|
320
323
|
})
|
|
321
324
|
})]
|
|
322
325
|
})] }), /* @__PURE__ */ d(n, { children: [
|
|
@@ -328,30 +331,30 @@ function y({ availableTags: y, searchValue: b, translation: x, onSearchChange: S
|
|
|
328
331
|
display: "block",
|
|
329
332
|
mb: .5
|
|
330
333
|
},
|
|
331
|
-
children:
|
|
334
|
+
children: S.textColorLabel
|
|
332
335
|
}),
|
|
333
336
|
/* @__PURE__ */ d(n, {
|
|
334
337
|
sx: {
|
|
335
338
|
display: "grid",
|
|
336
339
|
gridTemplateColumns: "repeat(5, 24px)",
|
|
337
340
|
gap: .5,
|
|
338
|
-
opacity:
|
|
339
|
-
pointerEvents:
|
|
341
|
+
opacity: L ? .3 : 1,
|
|
342
|
+
pointerEvents: L ? "none" : "auto",
|
|
340
343
|
transition: "opacity 0.15s"
|
|
341
344
|
},
|
|
342
|
-
children: [
|
|
345
|
+
children: [m.map((e) => /* @__PURE__ */ u(v, {
|
|
343
346
|
color: e,
|
|
344
|
-
selected:
|
|
345
|
-
onClick: () =>
|
|
347
|
+
selected: F === e,
|
|
348
|
+
onClick: () => le(e)
|
|
346
349
|
}, e)), /* @__PURE__ */ u(n, {
|
|
347
350
|
sx: {
|
|
348
351
|
gridColumn: "span 5",
|
|
349
352
|
mt: .25
|
|
350
353
|
},
|
|
351
|
-
children: /* @__PURE__ */ u(
|
|
352
|
-
value:
|
|
353
|
-
onChange:
|
|
354
|
-
disabled:
|
|
354
|
+
children: /* @__PURE__ */ u(y, {
|
|
355
|
+
value: L ? X ?? "#000000" : G,
|
|
356
|
+
onChange: ue,
|
|
357
|
+
disabled: L
|
|
355
358
|
})
|
|
356
359
|
})]
|
|
357
360
|
}),
|
|
@@ -367,11 +370,11 @@ function y({ availableTags: y, searchValue: b, translation: x, onSearchChange: S
|
|
|
367
370
|
children: [/* @__PURE__ */ u(c, {
|
|
368
371
|
variant: "caption",
|
|
369
372
|
color: "text.secondary",
|
|
370
|
-
children:
|
|
373
|
+
children: S.autoTextColorLabel
|
|
371
374
|
}), /* @__PURE__ */ u(ee, {
|
|
372
375
|
size: "small",
|
|
373
|
-
checked:
|
|
374
|
-
onChange: (e) =>
|
|
376
|
+
checked: L,
|
|
377
|
+
onChange: (e) => de(e.target.checked)
|
|
375
378
|
})]
|
|
376
379
|
})
|
|
377
380
|
] })]
|
|
@@ -381,4 +384,4 @@ function y({ availableTags: y, searchValue: b, translation: x, onSearchChange: S
|
|
|
381
384
|
});
|
|
382
385
|
}
|
|
383
386
|
//#endregion
|
|
384
|
-
export {
|
|
387
|
+
export { b as TagSelectionAutocomplete };
|