@thebuoyant-tsdev/mui-ts-library 3.2.1 → 3.4.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.
Files changed (65) hide show
  1. package/README.de.md +15 -0
  2. package/README.md +15 -0
  3. package/dist/components/chord-chart/ChordChart.js +284 -0
  4. package/dist/components/chord-chart/ChordChart.types.js +4 -0
  5. package/dist/components/circle-packing-chart/CirclePackingChart.js +382 -0
  6. package/dist/components/circle-packing-chart/CirclePackingChart.types.js +4 -0
  7. package/dist/components/gantt-chart/GanttBarRow.js +202 -0
  8. package/dist/components/gantt-chart/GanttChart.constants.js +14 -0
  9. package/dist/components/gantt-chart/GanttChart.js +258 -0
  10. package/dist/components/gantt-chart/GanttChart.store.js +119 -0
  11. package/dist/components/gantt-chart/GanttChart.types.js +47 -0
  12. package/dist/components/gantt-chart/GanttDeleteDialog.js +30 -0
  13. package/dist/components/gantt-chart/GanttDependencyArrows.js +54 -0
  14. package/dist/components/gantt-chart/GanttStatusContextMenu.js +36 -0
  15. package/dist/components/gantt-chart/GanttTaskDialog.js +324 -0
  16. package/dist/components/gantt-chart/GanttTaskPanel.js +415 -0
  17. package/dist/components/gantt-chart/GanttTimeline.js +223 -0
  18. package/dist/components/gantt-chart/GanttTimelineHeader.js +90 -0
  19. package/dist/components/gantt-chart/GanttToolbar.js +157 -0
  20. package/dist/components/gantt-chart/GanttWeekendStrips.js +29 -0
  21. package/dist/components/gantt-chart/hooks/useGanttDrag.js +104 -0
  22. package/dist/components/gantt-chart/util/gantt-chart.util.js +150 -0
  23. package/dist/components/horizontal-tree-chart/HorizontalTreeChart.js +488 -0
  24. package/dist/components/horizontal-tree-chart/HorizontalTreeChart.types.js +8 -0
  25. package/dist/components/json-editor/JsonEditor.js +102 -0
  26. package/dist/components/json-editor/JsonEditor.types.js +21 -0
  27. package/dist/components/json-editor/JsonEditorContent.js +185 -0
  28. package/dist/components/json-editor/JsonEditorFooter.js +55 -0
  29. package/dist/components/json-editor/JsonEditorToolbar.js +148 -0
  30. package/dist/components/password-strength-meter/PasswordStrengthBar.js +66 -0
  31. package/dist/components/password-strength-meter/PasswordStrengthMeter.js +272 -0
  32. package/dist/components/password-strength-meter/PasswordStrengthMeter.types.js +27 -0
  33. package/dist/components/password-strength-meter/util/password-strength.util.js +38 -0
  34. package/dist/components/radial-tree-chart/RadialTreeChart.js +447 -0
  35. package/dist/components/radial-tree-chart/RadialTreeChart.types.js +8 -0
  36. package/dist/components/rich-text-editor/RichTextEditor.js +135 -0
  37. package/dist/components/rich-text-editor/RichTextEditor.types.js +74 -0
  38. package/dist/components/rich-text-editor/RichTextEditorColorPicker.js +185 -0
  39. package/dist/components/rich-text-editor/RichTextEditorContent.js +129 -0
  40. package/dist/components/rich-text-editor/RichTextEditorEmojiPicker.js +110 -0
  41. package/dist/components/rich-text-editor/RichTextEditorFooter.js +33 -0
  42. package/dist/components/rich-text-editor/RichTextEditorImageDialog.js +74 -0
  43. package/dist/components/rich-text-editor/RichTextEditorLinkDialog.js +70 -0
  44. package/dist/components/rich-text-editor/RichTextEditorTableMenu.js +97 -0
  45. package/dist/components/rich-text-editor/RichTextEditorToolbar.js +362 -0
  46. package/dist/components/rich-text-editor/util/emojis.js +739 -0
  47. package/dist/components/shared/ToolbarButton.js +22 -0
  48. package/dist/components/shared/normalizeSize.js +6 -0
  49. package/dist/components/sql-editor/SqlEditor.js +100 -0
  50. package/dist/components/sql-editor/SqlEditor.types.js +20 -0
  51. package/dist/components/sql-editor/SqlEditorContent.js +248 -0
  52. package/dist/components/sql-editor/SqlEditorFooter.js +45 -0
  53. package/dist/components/sql-editor/SqlEditorToolbar.js +151 -0
  54. package/dist/components/sunburst-chart/SunburstChart.js +292 -0
  55. package/dist/components/sunburst-chart/SunburstChart.types.js +4 -0
  56. package/dist/components/tag-selection/TagSelection.js +102 -0
  57. package/dist/components/tag-selection/TagSelection.store.js +40 -0
  58. package/dist/components/tag-selection/TagSelection.types.d.ts +2 -0
  59. package/dist/components/tag-selection/TagSelection.types.js +18 -0
  60. package/dist/components/tag-selection/TagSelectionAutocomplete.js +382 -0
  61. package/dist/components/tag-selection/TagSelectionChip.js +30 -0
  62. package/dist/components/tag-selection/TagSelectionSelectedTags.js +73 -0
  63. package/dist/index.cjs +2 -2
  64. package/dist/index.js +23 -8035
  65. package/package.json +1 -1
@@ -0,0 +1,292 @@
1
+ import { useCallback as e, useLayoutEffect as t, useMemo as n, useRef as r, useState as i } from "react";
2
+ import { Box as a, Tooltip as o, Typography as s, useTheme as c } from "@mui/material";
3
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
4
+ import * as d from "d3";
5
+ //#region src/components/sunburst-chart/SunburstChart.tsx
6
+ var f = 2 * Math.PI, p = 11, m = p * .5, h = 5;
7
+ function g(e, t = 0, n = ".", r = ",") {
8
+ if (e == null || !isFinite(e)) return "0";
9
+ let [i, a] = e.toFixed(Math.max(0, t)).split("."), o = i.replace(/\B(?=(\d{3})+(?!\d))/g, r);
10
+ return a ? `${o}${n}${a}` : o;
11
+ }
12
+ function ee(e, t) {
13
+ let n = Math.floor(t / m);
14
+ return n <= 0 ? "" : e.length <= n ? e : n < h ? "" : e.slice(0, n - 1) + "…";
15
+ }
16
+ function te({ node: e, valueDecimalCount: t, valueDecimalSep: n, valueThousandsSep: r }) {
17
+ let i = (e.value ?? 0) > 0, o = e.ancestors().map((e) => e.data.name).reverse().join(" › ");
18
+ return /* @__PURE__ */ u(a, {
19
+ sx: { py: .25 },
20
+ children: [
21
+ /* @__PURE__ */ l(s, {
22
+ variant: "caption",
23
+ sx: {
24
+ fontWeight: "bold",
25
+ display: "block"
26
+ },
27
+ children: e.data.name
28
+ }),
29
+ i && /* @__PURE__ */ l(s, {
30
+ variant: "caption",
31
+ sx: {
32
+ display: "block",
33
+ opacity: .85
34
+ },
35
+ children: g(e.value ?? 0, t, n, r)
36
+ }),
37
+ e.depth > 0 && /* @__PURE__ */ l(s, {
38
+ variant: "caption",
39
+ sx: {
40
+ display: "block",
41
+ opacity: .65,
42
+ mt: .25
43
+ },
44
+ children: o
45
+ })
46
+ ]
47
+ });
48
+ }
49
+ function _({ data: s, size: m = 500, showSegmentLabels: h = !0, innerRadius: g = 0, sortBy: _ = "value", chartColors: v, showRootLabel: y = !0, onSegmentClick: b, onZoomChange: x, valueDecimalCount: ne = 0, valueDecimalSeparator: re = ".", valueThousandsSeparator: S = ",", zoomable: C = !1, disabled: w = !1 }) {
50
+ let T = c(), E = r(null), [D, O] = i(`-${m / 2} -${m / 2} ${m} ${m}`), [k, A] = i(1), ie = n(() => {
51
+ if (k === 1) return D;
52
+ let [e, t, n, r] = D.split(" ").map(Number), i = n / k, a = r / k;
53
+ return `${e + (n - i) / 2} ${t + (r - a) / 2} ${i} ${a}`;
54
+ }, [D, k]), j = m / 2, M = Math.max(0, Math.min(g, Math.max(0, j - 1))), N = Math.max(1, j - M), ae = [
55
+ T.palette.primary.main,
56
+ T.palette.secondary.main,
57
+ T.palette.error.main,
58
+ T.palette.warning.main,
59
+ T.palette.success.main,
60
+ T.palette.info.main
61
+ ], P = v && v.length > 0 ? v : ae, { root: F, ringThickness: I } = n(() => {
62
+ let e = d.hierarchy(s).sum((e) => e.value ?? 0);
63
+ _ === "value" ? e.sort((e, t) => (t.value ?? 0) - (e.value ?? 0)) : e.sort((e, t) => String(e.data.name).localeCompare(String(t.data.name), void 0, {
64
+ numeric: !0,
65
+ sensitivity: "base"
66
+ }));
67
+ let t = d.partition().size([f, N])(e), n = d.max(t.descendants(), (e) => e.depth) ?? 0, r = n > 0 ? N / n : N;
68
+ return n > 0 && t.descendants().forEach((e) => {
69
+ e.depth === 0 ? (e.y0 = 0, e.y1 = 0) : (e.y0 = (e.depth - 1) * r, e.y1 = e.depth * r);
70
+ }), {
71
+ root: t,
72
+ ringThickness: r
73
+ };
74
+ }, [
75
+ s,
76
+ N,
77
+ _
78
+ ]), [L, R] = i(F), [z, oe] = i(F);
79
+ z !== F && (oe(F), R(F));
80
+ let B = n(() => F.children?.map((e) => e.data.name) ?? [F.data.name], [F]), se = n(() => d.scaleOrdinal().domain(B).range(P), [P, B]), V = (e) => {
81
+ if (e.data.colorConfig?.fill) return e.data.colorConfig.fill;
82
+ let t = e;
83
+ for (; t.depth > 1;) t = t.parent;
84
+ return se(t.data.name);
85
+ }, H = n(() => d.arc().startAngle((e) => e.x0).endAngle((e) => e.x1).padAngle((e) => Math.min((e.x1 - e.x0) / 2, .005)).padRadius(j / 2).innerRadius((e) => M + e.y0).outerRadius((e) => M + e.y1 - 1), [j, M]), U = e((e) => {
86
+ let t = f / (L.x1 - L.x0), n = Math.max(0, Math.min(f, (e.x0 - L.x0) * t)), r = Math.max(0, Math.min(f, (e.x1 - L.x0) * t)), i = L.depth === 0 ? 0 : (L.depth - 1) * I;
87
+ return {
88
+ x0: n,
89
+ x1: r,
90
+ y0: Math.max(0, e.y0 - i),
91
+ y1: Math.max(0, e.y1 - i)
92
+ };
93
+ }, [L, I]), W = (e) => e.x1 > e.x0 && e.y1 > e.y0, G = (e) => (M + (e.y0 + e.y1) / 2) * (e.x1 - e.x0) > 12, ce = (e) => {
94
+ let t = (e.x0 + e.x1) / 2 * 180 / Math.PI, n = M + (e.y0 + e.y1) / 2, r = t < 180 ? 0 : 180;
95
+ return `rotate(${t - 90}) translate(${n},0) rotate(${r})`;
96
+ }, le = e((e) => e.ancestors().includes(L), [L]), K = e((e) => {
97
+ let t = e.ancestors().reverse(), n = e.value ?? 0, r = F.value ?? 0;
98
+ return {
99
+ id: e.data.id,
100
+ name: e.data.name,
101
+ value: n || null,
102
+ percentage: r > 0 ? Math.round(n / r * 1e4) / 100 : 0,
103
+ depth: e.depth,
104
+ path: t.map((e) => e.data.name),
105
+ pathIds: t.map((e) => e.data.id),
106
+ childrenCount: e.children?.length ?? 0,
107
+ data: e.data
108
+ };
109
+ }, [F]), q = e((e) => {
110
+ R(e), x && x({
111
+ focusNode: K(e),
112
+ isRoot: e === F
113
+ });
114
+ }, [
115
+ F,
116
+ K,
117
+ x
118
+ ]);
119
+ t(() => {
120
+ let e = E.current;
121
+ if (!e) return;
122
+ let t = requestAnimationFrame(() => {
123
+ try {
124
+ let t = e.getBBox();
125
+ O(`${t.x - 8} ${t.y - 8} ${t.width + 16} ${t.height + 16}`);
126
+ } catch {
127
+ O(`-${m / 2} -${m / 2} ${m} ${m}`);
128
+ }
129
+ });
130
+ return () => cancelAnimationFrame(t);
131
+ }, [
132
+ m,
133
+ F,
134
+ L,
135
+ M,
136
+ I,
137
+ y
138
+ ]);
139
+ let J = r(null), ue = (e) => {
140
+ J.current &&= (clearTimeout(J.current), null), J.current = setTimeout(() => {
141
+ e(), J.current = null;
142
+ }, 250);
143
+ }, Y = () => {
144
+ J.current &&= (clearTimeout(J.current), null);
145
+ };
146
+ t(() => {
147
+ if (w) return;
148
+ let e = (e) => {
149
+ e.key === "Escape" && (Y(), q(F), A(1));
150
+ };
151
+ return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
152
+ }, [
153
+ w,
154
+ F,
155
+ q
156
+ ]);
157
+ let de = e((e) => {
158
+ if (!C || w || !e.ctrlKey) return;
159
+ e.preventDefault();
160
+ let t = e.deltaY < 0 ? 1.15 : 1 / 1.15;
161
+ A((e) => Math.max(.25, Math.min(8, e * t)));
162
+ }, [C, w]), X = F.descendants().filter((e) => e.depth > 0), fe = (e) => {
163
+ if (w) return;
164
+ let t = X[Number(e.currentTarget.getAttribute("data-idx"))];
165
+ if (t) {
166
+ if (e.ctrlKey || e.metaKey) {
167
+ t.children && ue(() => q(t));
168
+ return;
169
+ }
170
+ b?.(K(t), e);
171
+ }
172
+ }, pe = (e) => {
173
+ w || (e.ctrlKey || e.metaKey) && (Y(), q(L.parent ?? F));
174
+ }, Z = (e) => {
175
+ if (!w) {
176
+ if (e.ctrlKey || e.metaKey) {
177
+ Y(), q(L.parent ?? F);
178
+ return;
179
+ }
180
+ b?.(K(L.parent ?? F), e);
181
+ }
182
+ }, Q = {
183
+ followCursor: !0,
184
+ enterDelay: 50,
185
+ enterNextDelay: 0,
186
+ disableHoverListener: w,
187
+ slotProps: { tooltip: { sx: { maxWidth: 260 } } }
188
+ }, $ = T.palette.text.primary, me = T.typography.fontFamily;
189
+ return /* @__PURE__ */ l(a, {
190
+ sx: {
191
+ display: "inline-flex",
192
+ opacity: w ? .5 : 1,
193
+ cursor: w ? "not-allowed" : "default",
194
+ userSelect: "none"
195
+ },
196
+ children: /* @__PURE__ */ l("svg", {
197
+ width: m,
198
+ height: m,
199
+ viewBox: ie,
200
+ onWheel: de,
201
+ style: {
202
+ fontFamily: me ?? "sans-serif",
203
+ overflow: C && k > 1 ? "hidden" : "visible"
204
+ },
205
+ role: "img",
206
+ "aria-label": s.name,
207
+ children: /* @__PURE__ */ u("g", {
208
+ ref: E,
209
+ children: [
210
+ M > 0 && /* @__PURE__ */ l(o, {
211
+ ...Q,
212
+ title: L.data.name,
213
+ placement: "top",
214
+ children: /* @__PURE__ */ l("circle", {
215
+ cx: 0,
216
+ cy: 0,
217
+ r: M,
218
+ fill: "transparent",
219
+ pointerEvents: w ? "none" : "auto",
220
+ onClick: Z,
221
+ style: { cursor: w ? "not-allowed" : "pointer" }
222
+ })
223
+ }),
224
+ /* @__PURE__ */ l("g", { children: X.map((e, t) => {
225
+ let n = U(e), r = W(n), i = !!e.children;
226
+ return /* @__PURE__ */ l(o, {
227
+ ...Q,
228
+ placement: "top",
229
+ title: r ? /* @__PURE__ */ l(te, {
230
+ node: e,
231
+ valueDecimalCount: ne,
232
+ valueDecimalSep: re,
233
+ valueThousandsSep: S
234
+ }) : "",
235
+ children: /* @__PURE__ */ l("path", {
236
+ "data-idx": t,
237
+ d: H(n) || "",
238
+ fill: V(e),
239
+ fillOpacity: r ? i ? .75 : .5 : 0,
240
+ style: {
241
+ pointerEvents: r && !w ? "auto" : "none",
242
+ cursor: i && !w ? "pointer" : "default",
243
+ transition: "fill-opacity 0.15s"
244
+ },
245
+ onClick: fe,
246
+ onDoubleClick: pe
247
+ })
248
+ }, `tt-${e.data.id}-${t}`);
249
+ }) }),
250
+ h && /* @__PURE__ */ l("g", {
251
+ pointerEvents: "none",
252
+ textAnchor: "middle",
253
+ fill: $,
254
+ children: X.map((e, t) => {
255
+ if (!le(e)) return null;
256
+ let n = U(e);
257
+ if (!G(n)) return null;
258
+ let r = (M + (n.y0 + n.y1) / 2) * (n.x1 - n.x0) * .88, i = ee(e.data.name, r);
259
+ return i ? /* @__PURE__ */ l("text", {
260
+ transform: ce(n),
261
+ dy: "0.35em",
262
+ fontSize: p,
263
+ children: i
264
+ }, `lbl-${e.data.id}-${t}`) : null;
265
+ })
266
+ }),
267
+ y && /* @__PURE__ */ l(o, {
268
+ ...Q,
269
+ placement: "top",
270
+ title: "",
271
+ children: /* @__PURE__ */ l("g", {
272
+ textAnchor: "middle",
273
+ fill: $,
274
+ pointerEvents: w ? "none" : "auto",
275
+ onClick: Z,
276
+ style: { cursor: L !== F && !w ? "pointer" : "default" },
277
+ children: /* @__PURE__ */ l("text", {
278
+ fontSize: 13,
279
+ dy: "0.35em",
280
+ fontWeight: "bold",
281
+ children: L.data.name
282
+ })
283
+ })
284
+ })
285
+ ]
286
+ })
287
+ })
288
+ });
289
+ }
290
+ _.displayName = "SunburstChart";
291
+ //#endregion
292
+ export { _ as SunburstChart };
@@ -0,0 +1,4 @@
1
+ //#region src/components/sunburst-chart/SunburstChart.types.ts
2
+ var e = { noData: "No data" };
3
+ //#endregion
4
+ export { e as DEFAULT_SUNBURST_CHART_TRANSLATION };
@@ -0,0 +1,102 @@
1
+ import { createTagSelectionStore as e } from "./TagSelection.store.js";
2
+ import { TagSelectionAutocomplete as t } from "./TagSelectionAutocomplete.js";
3
+ import { TagSelectionSelectedTags as n } from "./TagSelectionSelectedTags.js";
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, useState as c } from "react";
6
+ import { Box as l, Stack as u } from "@mui/material";
7
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
8
+ import { useStore as p } from "zustand";
9
+ //#region src/components/tag-selection/TagSelection.tsx
10
+ var m = i(null);
11
+ function h(e) {
12
+ let t = a(m);
13
+ if (!t) throw Error("TagSelectionStoreContext is missing.");
14
+ return p(t, e);
15
+ }
16
+ function g({ tags: e, showSelectedTags: r = !0, showSelectedTagsLabel: i = !0, showAutoComplete: a = !0, inputSize: c = "medium", chipSize: p = "small", disabled: m = !1, loading: g = !1, maxTags: _, allowCreate: v = !1, maxVisibleChips: y, popoverPlacement: b = "bottom", listboxMaxHeight: x, translation: S, onTagSelect: C, onTagDelete: w, onTagsChange: T, onSearchChange: E, onTagCreate: D }) {
17
+ let O = h((e) => e.tags), k = h((e) => e.searchValue), A = h((e) => e.setTags), j = h((e) => e.setSearchValue), M = h((e) => e.selectTag), N = h((e) => e.deleteTag), P = h((e) => e.addTag);
18
+ o(() => {
19
+ A(e);
20
+ }, [e, A]);
21
+ let F = s(() => O.filter((e) => e.selected).sort((e, t) => e.label.localeCompare(t.label)), [O]), I = s(() => O.filter((e) => !e.selected && !e.disabled).sort((e, t) => e.label.localeCompare(t.label)), [O]), L = _ !== void 0 && F.length >= _, R = (e) => {
22
+ T && T(e.filter((e) => e.selected), e);
23
+ };
24
+ return /* @__PURE__ */ d(l, {
25
+ sx: { width: "100%" },
26
+ children: /* @__PURE__ */ f(u, { children: [r && /* @__PURE__ */ d(n, {
27
+ selectedTags: F,
28
+ translation: S,
29
+ onTagDelete: (e) => {
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
+ },
37
+ showSelectedTagsLabel: i,
38
+ chipSize: p,
39
+ disabled: m,
40
+ maxVisibleChips: y,
41
+ popoverPlacement: b
42
+ }), a && /* @__PURE__ */ d(t, {
43
+ availableTags: I,
44
+ searchValue: k,
45
+ translation: S,
46
+ onSearchChange: (e) => {
47
+ j(e), E && E(e);
48
+ },
49
+ onTagSelect: (e) => {
50
+ if (e.disabled || e.selected) return;
51
+ M(e.id);
52
+ let t = O.map((t) => t.id === e.id ? {
53
+ ...t,
54
+ selected: !0
55
+ } : t), n = t.filter((e) => e.selected), r = t.find((t) => t.id === e.id);
56
+ r && C && C(r, n, t), R(t);
57
+ },
58
+ onTagCreate: (e) => {
59
+ P(e), R([...O, e]), D && D(e);
60
+ },
61
+ inputSize: c,
62
+ chipSize: p,
63
+ disabled: m,
64
+ loading: g,
65
+ isMaxReached: L,
66
+ allowCreate: v,
67
+ listboxMaxHeight: x
68
+ })] })
69
+ });
70
+ }
71
+ function _({ tags: t, showSelectedTags: n = !0, showSelectedTagsLabel: i = !0, showAutoComplete: a = !0, translation: o, inputSize: s = "medium", chipSize: l = "small", disabled: u = !1, loading: f = !1, maxTags: p, allowCreate: h = !1, maxVisibleChips: _, popoverPlacement: v = "bottom", listboxMaxHeight: y, onTagSelect: b, onTagDelete: x, onTagsChange: S, onSearchChange: C, onTagCreate: w }) {
72
+ let T = {
73
+ ...r,
74
+ ...o
75
+ }, [E] = c(() => e(t));
76
+ return /* @__PURE__ */ d(m.Provider, {
77
+ value: E,
78
+ children: /* @__PURE__ */ d(g, {
79
+ tags: t,
80
+ showSelectedTags: n,
81
+ showSelectedTagsLabel: i,
82
+ showAutoComplete: a,
83
+ translation: T,
84
+ inputSize: s,
85
+ chipSize: l,
86
+ disabled: u,
87
+ loading: f,
88
+ maxTags: p,
89
+ allowCreate: h,
90
+ maxVisibleChips: _,
91
+ popoverPlacement: v,
92
+ listboxMaxHeight: y,
93
+ onTagSelect: b,
94
+ onTagDelete: x,
95
+ onTagsChange: S,
96
+ onSearchChange: C,
97
+ onTagCreate: w
98
+ })
99
+ });
100
+ }
101
+ //#endregion
102
+ export { _ as TagSelection };
@@ -0,0 +1,40 @@
1
+ import { createStore as e } from "zustand/vanilla";
2
+ //#region src/components/tag-selection/TagSelection.store.ts
3
+ function t(t) {
4
+ return e((e) => ({
5
+ tags: t,
6
+ searchValue: "",
7
+ setTags: (t) => {
8
+ e({ tags: t });
9
+ },
10
+ setSearchValue: (t) => {
11
+ e({ searchValue: t });
12
+ },
13
+ selectTag: (t) => {
14
+ e((e) => ({
15
+ tags: e.tags.map((e) => e.id === t && !e.disabled ? {
16
+ ...e,
17
+ selected: !0
18
+ } : e),
19
+ searchValue: ""
20
+ }));
21
+ },
22
+ deleteTag: (t) => {
23
+ e((e) => ({ tags: e.tags.map((e) => e.id === t ? {
24
+ ...e,
25
+ selected: !1
26
+ } : e) }));
27
+ },
28
+ addTag: (t) => {
29
+ e((e) => ({
30
+ tags: [...e.tags, {
31
+ ...t,
32
+ selected: !0
33
+ }],
34
+ searchValue: ""
35
+ }));
36
+ }
37
+ }));
38
+ }
39
+ //#endregion
40
+ export { t as createTagSelectionStore };
@@ -20,6 +20,8 @@ export type TagSelectionTranslation = {
20
20
  backgroundColorLabel: string;
21
21
  textColorLabel: string;
22
22
  autoTextColorLabel: string;
23
+ confirmCreateLabel: string;
24
+ cancelCreateLabel: string;
23
25
  };
24
26
  export declare const DEFAULT_TAG_SELECTION_TRANSLATION: TagSelectionTranslation;
25
27
  export type TagSelectionProps = {
@@ -0,0 +1,18 @@
1
+ //#region src/components/tag-selection/TagSelection.types.ts
2
+ var e = {
3
+ selectedTagsLabel: "Selected tags",
4
+ autoCompleteLabel: "Search and add tags",
5
+ noSelectedTagsText: "No tags selected.",
6
+ noAvailableTagsText: "No tags available.",
7
+ placeholder: "Type to search...",
8
+ loadingText: "Loading...",
9
+ maxTagsReachedText: "Maximum number of tags reached.",
10
+ colorPickerLabel: "Custom color",
11
+ backgroundColorLabel: "Background color",
12
+ textColorLabel: "Text color",
13
+ autoTextColorLabel: "Auto",
14
+ confirmCreateLabel: "Confirm new tag",
15
+ cancelCreateLabel: "Cancel new tag"
16
+ };
17
+ //#endregion
18
+ export { e as DEFAULT_TAG_SELECTION_TRANSLATION };