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