@thebuoyant-tsdev/mui-ts-library 3.2.1 → 3.6.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 (74) hide show
  1. package/README.de.md +31 -0
  2. package/README.md +31 -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.d.ts +1 -1
  50. package/dist/components/sql-editor/SqlEditor.js +113 -0
  51. package/dist/components/sql-editor/SqlEditor.types.d.ts +9 -0
  52. package/dist/components/sql-editor/SqlEditor.types.js +24 -0
  53. package/dist/components/sql-editor/SqlEditorContent.js +248 -0
  54. package/dist/components/sql-editor/SqlEditorFooter.js +45 -0
  55. package/dist/components/sql-editor/SqlEditorHistoryMenu.d.ts +11 -0
  56. package/dist/components/sql-editor/SqlEditorHistoryMenu.js +75 -0
  57. package/dist/components/sql-editor/SqlEditorToolbar.d.ts +5 -1
  58. package/dist/components/sql-editor/SqlEditorToolbar.js +163 -0
  59. package/dist/components/sql-editor/useSqlQueryHistory.d.ts +6 -0
  60. package/dist/components/sql-editor/useSqlQueryHistory.js +20 -0
  61. package/dist/components/sql-editor/util/sqlQueryHistory.util.d.ts +12 -0
  62. package/dist/components/sql-editor/util/sqlQueryHistory.util.js +28 -0
  63. package/dist/components/sunburst-chart/SunburstChart.js +292 -0
  64. package/dist/components/sunburst-chart/SunburstChart.types.js +4 -0
  65. package/dist/components/tag-selection/TagSelection.js +102 -0
  66. package/dist/components/tag-selection/TagSelection.store.js +40 -0
  67. package/dist/components/tag-selection/TagSelection.types.d.ts +2 -0
  68. package/dist/components/tag-selection/TagSelection.types.js +18 -0
  69. package/dist/components/tag-selection/TagSelectionAutocomplete.js +382 -0
  70. package/dist/components/tag-selection/TagSelectionChip.js +30 -0
  71. package/dist/components/tag-selection/TagSelectionSelectedTags.js +73 -0
  72. package/dist/index.cjs +2 -2
  73. package/dist/index.js +23 -8035
  74. package/package.json +1 -1
@@ -0,0 +1,324 @@
1
+ import { useGanttChartStore as e, useGanttTranslations as t } from "./GanttChart.js";
2
+ import { useEffect as n, useMemo as r, useRef as i, useState as a } from "react";
3
+ import { Box as o, Button as s, Checkbox as c, Dialog as l, DialogActions as u, DialogContent as d, DialogTitle as f, FormControl as p, FormControlLabel as m, InputLabel as h, MenuItem as g, Select as _, TextField as v, Tooltip as y, Typography as b } from "@mui/material";
4
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
5
+ //#region src/components/gantt-chart/GanttTaskDialog.tsx
6
+ function C(e) {
7
+ return e.toISOString().slice(0, 10);
8
+ }
9
+ function w(e, t, n) {
10
+ return e < t ? t : e > n ? n : e;
11
+ }
12
+ function T(e) {
13
+ return e.flatMap((e) => [e, ...T(e.children)]);
14
+ }
15
+ function E({ label: e }) {
16
+ let t = i(null), [n, r] = a(!1);
17
+ return /* @__PURE__ */ x(y, {
18
+ title: e,
19
+ disableHoverListener: !n,
20
+ children: /* @__PURE__ */ x(b, {
21
+ ref: t,
22
+ component: "span",
23
+ variant: "body2",
24
+ noWrap: !0,
25
+ sx: {
26
+ display: "block",
27
+ overflow: "hidden",
28
+ textOverflow: "ellipsis",
29
+ minWidth: 0
30
+ },
31
+ onMouseEnter: () => {
32
+ t.current && r(t.current.scrollWidth > t.current.clientWidth);
33
+ },
34
+ children: e
35
+ })
36
+ });
37
+ }
38
+ function D({ open: i, mode: y, initialTask: D, defaultParentId: O, onSave: k, onClose: A }) {
39
+ let j = t(), M = e((e) => e.taskTree), N = e((e) => e.timelineRange), P = r(() => T(M), [M]), F = r(() => {
40
+ if (y === "add" || !D) return /* @__PURE__ */ new Set();
41
+ let e = (t) => [t.id, ...t.children.flatMap(e)], t = P.find((e) => e.id === D.id);
42
+ return new Set(t ? e(t) : [D.id]);
43
+ }, [
44
+ y,
45
+ D,
46
+ P
47
+ ]), I = P.filter((e) => !F.has(e.id)), L = I, R = C(w(/* @__PURE__ */ new Date(), N.start, N.end)), [z, B] = a({
48
+ name: "",
49
+ startDate: R,
50
+ endDate: R,
51
+ status: "planned",
52
+ isMilestone: !1,
53
+ parentId: "",
54
+ dependencies: [],
55
+ assignee: ""
56
+ });
57
+ n(() => {
58
+ if (!i) return;
59
+ let e = C(w(/* @__PURE__ */ new Date(), N.start, N.end));
60
+ B(y === "edit" && D ? {
61
+ name: D.name,
62
+ startDate: C(D.startDate),
63
+ endDate: C(D.endDate),
64
+ status: D.status,
65
+ isMilestone: D.isMilestone ?? !1,
66
+ parentId: D.parentId ?? "",
67
+ dependencies: D.dependencies ?? [],
68
+ assignee: D.assignee ?? ""
69
+ } : {
70
+ name: "",
71
+ startDate: e,
72
+ endDate: e,
73
+ status: "planned",
74
+ isMilestone: !1,
75
+ parentId: O ?? "",
76
+ dependencies: [],
77
+ assignee: ""
78
+ });
79
+ }, [
80
+ i,
81
+ y,
82
+ D,
83
+ O,
84
+ N
85
+ ]);
86
+ let V = (e) => {
87
+ B((t) => ({
88
+ ...t,
89
+ startDate: e,
90
+ endDate: t.isMilestone || t.endDate < e ? e : t.endDate
91
+ }));
92
+ }, H = (e) => {
93
+ B((t) => ({
94
+ ...t,
95
+ endDate: e < t.startDate ? t.startDate : e
96
+ }));
97
+ }, U = (e) => {
98
+ B((t) => ({
99
+ ...t,
100
+ isMilestone: e,
101
+ endDate: e ? t.startDate : t.endDate
102
+ }));
103
+ }, W = z.name.trim() !== "" && z.startDate !== "" && z.endDate !== "" && z.endDate >= z.startDate, G = () => {
104
+ W && k({
105
+ name: z.name.trim(),
106
+ startDate: new Date(z.startDate),
107
+ endDate: new Date(z.endDate),
108
+ status: z.status,
109
+ isMilestone: z.isMilestone || void 0,
110
+ parentId: z.parentId || void 0,
111
+ dependencies: z.dependencies.length > 0 ? z.dependencies : void 0,
112
+ assignee: z.assignee.trim() || void 0
113
+ });
114
+ }, K = [
115
+ "planned",
116
+ "in-progress",
117
+ "done",
118
+ "blocked"
119
+ ], q = {
120
+ planned: j.statusPlanned,
121
+ "in-progress": j.statusInProgress,
122
+ done: j.statusDone,
123
+ blocked: j.statusBlocked
124
+ };
125
+ return /* @__PURE__ */ S(l, {
126
+ open: i,
127
+ onClose: A,
128
+ maxWidth: "xs",
129
+ fullWidth: !0,
130
+ "data-testid": "gantt-task-dialog",
131
+ children: [
132
+ /* @__PURE__ */ x(f, { children: y === "add" ? j.dialogAddTitle : j.dialogEditTitle }),
133
+ /* @__PURE__ */ S(d, {
134
+ sx: {
135
+ display: "flex",
136
+ flexDirection: "column",
137
+ gap: 2,
138
+ pt: "16px !important"
139
+ },
140
+ children: [
141
+ /* @__PURE__ */ x(v, {
142
+ label: j.dialogFieldName,
143
+ value: z.name,
144
+ onChange: (e) => B((t) => ({
145
+ ...t,
146
+ name: e.target.value
147
+ })),
148
+ required: !0,
149
+ fullWidth: !0,
150
+ size: "small",
151
+ autoFocus: !0,
152
+ slotProps: { htmlInput: { "data-testid": "gantt-dialog-field-name" } }
153
+ }),
154
+ /* @__PURE__ */ x(v, {
155
+ label: j.columnAssignee,
156
+ value: z.assignee,
157
+ onChange: (e) => B((t) => ({
158
+ ...t,
159
+ assignee: e.target.value
160
+ })),
161
+ fullWidth: !0,
162
+ size: "small",
163
+ placeholder: "e.g. Jane Smith",
164
+ slotProps: { htmlInput: { "data-testid": "gantt-dialog-field-assignee" } }
165
+ }),
166
+ /* @__PURE__ */ x(v, {
167
+ label: j.dialogFieldStartDate,
168
+ type: "date",
169
+ value: z.startDate,
170
+ onChange: (e) => V(e.target.value),
171
+ required: !0,
172
+ fullWidth: !0,
173
+ size: "small",
174
+ slotProps: {
175
+ inputLabel: { shrink: !0 },
176
+ htmlInput: { "data-testid": "gantt-dialog-field-start" }
177
+ }
178
+ }),
179
+ /* @__PURE__ */ x(v, {
180
+ label: j.dialogFieldEndDate,
181
+ type: "date",
182
+ value: z.endDate,
183
+ onChange: (e) => H(e.target.value),
184
+ required: !0,
185
+ fullWidth: !0,
186
+ size: "small",
187
+ disabled: z.isMilestone,
188
+ slotProps: {
189
+ inputLabel: { shrink: !0 },
190
+ htmlInput: {
191
+ "data-testid": "gantt-dialog-field-end",
192
+ min: z.startDate
193
+ }
194
+ }
195
+ }),
196
+ /* @__PURE__ */ S(p, {
197
+ size: "small",
198
+ fullWidth: !0,
199
+ children: [/* @__PURE__ */ x(h, { children: j.dialogFieldStatus }), /* @__PURE__ */ x(_, {
200
+ value: z.status,
201
+ label: j.dialogFieldStatus,
202
+ onChange: (e) => B((t) => ({
203
+ ...t,
204
+ status: e.target.value
205
+ })),
206
+ inputProps: { "data-testid": "gantt-dialog-field-status" },
207
+ children: K.map((e) => /* @__PURE__ */ x(g, {
208
+ value: e,
209
+ children: q[e]
210
+ }, e))
211
+ })]
212
+ }),
213
+ /* @__PURE__ */ x(m, {
214
+ control: /* @__PURE__ */ x(c, {
215
+ checked: z.isMilestone,
216
+ onChange: (e) => U(e.target.checked),
217
+ size: "small",
218
+ "data-testid": "gantt-dialog-field-milestone"
219
+ }),
220
+ label: j.dialogFieldMilestone
221
+ }),
222
+ /* @__PURE__ */ S(p, {
223
+ size: "small",
224
+ fullWidth: !0,
225
+ children: [/* @__PURE__ */ x(h, { children: j.dialogFieldParent }), /* @__PURE__ */ S(_, {
226
+ value: z.parentId,
227
+ label: j.dialogFieldParent,
228
+ onChange: (e) => B((t) => ({
229
+ ...t,
230
+ parentId: e.target.value
231
+ })),
232
+ inputProps: { "data-testid": "gantt-dialog-field-parent" },
233
+ MenuProps: { slotProps: { paper: { sx: { maxHeight: 280 } } } },
234
+ children: [/* @__PURE__ */ x(g, {
235
+ value: "",
236
+ children: j.dialogFieldParentNone
237
+ }), I.map((e) => /* @__PURE__ */ x(g, {
238
+ value: e.id,
239
+ sx: { minWidth: 0 },
240
+ children: /* @__PURE__ */ S(o, {
241
+ sx: {
242
+ display: "flex",
243
+ alignItems: "center",
244
+ pl: e.depth * 2,
245
+ gap: .75,
246
+ minWidth: 0,
247
+ width: "100%",
248
+ overflow: "hidden"
249
+ },
250
+ children: [e.depth > 0 && /* @__PURE__ */ x(b, {
251
+ component: "span",
252
+ variant: "caption",
253
+ sx: {
254
+ color: "text.disabled",
255
+ lineHeight: 1,
256
+ flexShrink: 0
257
+ },
258
+ children: "└"
259
+ }), /* @__PURE__ */ x(E, { label: e.name })]
260
+ })
261
+ }, e.id))]
262
+ })]
263
+ }),
264
+ /* @__PURE__ */ S(p, {
265
+ size: "small",
266
+ fullWidth: !0,
267
+ children: [/* @__PURE__ */ x(h, { children: j.dialogFieldDependencies }), /* @__PURE__ */ x(_, {
268
+ multiple: !0,
269
+ value: z.dependencies,
270
+ label: j.dialogFieldDependencies,
271
+ onChange: (e) => {
272
+ let t = e.target.value;
273
+ B((e) => ({
274
+ ...e,
275
+ dependencies: typeof t == "string" ? t.split(",") : t
276
+ }));
277
+ },
278
+ inputProps: { "data-testid": "gantt-dialog-field-dependencies" },
279
+ renderValue: (e) => e.length === 0 ? j.dialogFieldDependenciesNone : e.map((e) => P.find((t) => t.id === e)?.name ?? e).join(", "),
280
+ MenuProps: { slotProps: { paper: { sx: { maxHeight: 280 } } } },
281
+ children: L.map((e) => /* @__PURE__ */ x(g, {
282
+ value: e.id,
283
+ sx: { minWidth: 0 },
284
+ children: /* @__PURE__ */ S(o, {
285
+ sx: {
286
+ display: "flex",
287
+ alignItems: "center",
288
+ pl: e.depth * 2,
289
+ gap: .75,
290
+ minWidth: 0,
291
+ width: "100%",
292
+ overflow: "hidden"
293
+ },
294
+ children: [e.depth > 0 && /* @__PURE__ */ x(b, {
295
+ component: "span",
296
+ variant: "caption",
297
+ sx: {
298
+ color: "text.disabled",
299
+ lineHeight: 1,
300
+ flexShrink: 0
301
+ },
302
+ children: "└"
303
+ }), /* @__PURE__ */ x(E, { label: e.name })]
304
+ })
305
+ }, e.id))
306
+ })]
307
+ })
308
+ ]
309
+ }),
310
+ /* @__PURE__ */ S(u, { children: [/* @__PURE__ */ x(s, {
311
+ onClick: A,
312
+ children: j.dialogCancel
313
+ }), /* @__PURE__ */ x(s, {
314
+ onClick: G,
315
+ variant: "contained",
316
+ disabled: !W,
317
+ "data-testid": "gantt-dialog-save",
318
+ children: j.dialogSave
319
+ })] })
320
+ ]
321
+ });
322
+ }
323
+ //#endregion
324
+ export { D as GanttTaskDialog };