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