@thebuoyant-tsdev/mui-ts-library 1.3.1 → 1.3.2
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 +4 -33
- package/README.md +5 -34
- package/dist/components/gantt-chart/GanttBarRow.d.ts +24 -0
- package/dist/components/gantt-chart/GanttChart.constants.d.ts +4 -0
- package/dist/components/gantt-chart/GanttDependencyArrows.d.ts +22 -0
- package/dist/components/gantt-chart/GanttStatusContextMenu.d.ts +19 -0
- package/dist/components/gantt-chart/GanttWeekendStrips.d.ts +17 -0
- package/dist/components/gantt-chart/hooks/useGanttDrag.d.ts +44 -0
- package/dist/components/password-strength-meter/PasswordStrengthBar.d.ts +12 -0
- package/dist/components/shared/ToolbarButton.d.ts +13 -0
- package/dist/components/shared/normalizeSize.d.ts +11 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +997 -932
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,77 +5,77 @@ import z from "@mui/icons-material/WarningAmberOutlined";
|
|
|
5
5
|
import B from "@mui/icons-material/ErrorOutlined";
|
|
6
6
|
import V from "@mui/icons-material/CheckCircleOutlined";
|
|
7
7
|
import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
|
|
8
|
-
import { EditorView as G, highlightActiveLine as K, highlightActiveLineGutter as
|
|
9
|
-
import { Compartment as
|
|
10
|
-
import { json as
|
|
11
|
-
import { defaultKeymap as
|
|
12
|
-
import { HighlightStyle as
|
|
13
|
-
import { lintGutter as
|
|
14
|
-
import { tags as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import { useStore as
|
|
23
|
-
import { createStore as
|
|
24
|
-
import { useVirtualizer as
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import { EditorContent as
|
|
36
|
-
import { StarterKit as
|
|
37
|
-
import { TextStyle as
|
|
38
|
-
import { Color as
|
|
39
|
-
import { Highlight as
|
|
40
|
-
import { Placeholder as
|
|
41
|
-
import { CharacterCount as
|
|
42
|
-
import { Markdown as
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import
|
|
57
|
-
import { MSSQL as
|
|
58
|
-
import { autocompletion as
|
|
59
|
-
import
|
|
60
|
-
import { format as
|
|
61
|
-
import
|
|
8
|
+
import { EditorView as G, highlightActiveLine as K, highlightActiveLineGutter as q, keymap as J, lineNumbers as ee, placeholder as te } from "@codemirror/view";
|
|
9
|
+
import { Compartment as ne, EditorState as re } from "@codemirror/state";
|
|
10
|
+
import { json as ie, jsonParseLinter as ae } from "@codemirror/lang-json";
|
|
11
|
+
import { defaultKeymap as oe, history as se, historyKeymap as ce, redo as le, undo as ue } from "@codemirror/commands";
|
|
12
|
+
import { HighlightStyle as de, syntaxHighlighting as fe } from "@codemirror/language";
|
|
13
|
+
import { lintGutter as pe, linter as me } from "@codemirror/lint";
|
|
14
|
+
import { tags as Y } from "@lezer/highlight";
|
|
15
|
+
import he from "@mui/icons-material/ContentCopy";
|
|
16
|
+
import ge from "@mui/icons-material/Check";
|
|
17
|
+
import _e from "@mui/icons-material/Delete";
|
|
18
|
+
import ve from "@mui/icons-material/Undo";
|
|
19
|
+
import ye from "@mui/icons-material/Redo";
|
|
20
|
+
import be from "@mui/icons-material/AutoFixHigh";
|
|
21
|
+
import xe from "@mui/icons-material/Compress";
|
|
22
|
+
import { useStore as Se } from "zustand";
|
|
23
|
+
import { createStore as Ce } from "zustand/vanilla";
|
|
24
|
+
import { useVirtualizer as we } from "@tanstack/react-virtual";
|
|
25
|
+
import Te from "@mui/icons-material/Add";
|
|
26
|
+
import Ee from "@mui/icons-material/Edit";
|
|
27
|
+
import De from "@mui/icons-material/RestartAlt";
|
|
28
|
+
import Oe from "@mui/icons-material/Restore";
|
|
29
|
+
import ke from "@mui/icons-material/Today";
|
|
30
|
+
import Ae from "@mui/icons-material/UnfoldLess";
|
|
31
|
+
import je from "@mui/icons-material/UnfoldMore";
|
|
32
|
+
import Me from "@mui/icons-material/Visibility";
|
|
33
|
+
import Ne from "@mui/icons-material/VisibilityOff";
|
|
34
|
+
import Pe from "@mui/icons-material/Close";
|
|
35
|
+
import { EditorContent as Fe, useEditor as Ie } from "@tiptap/react";
|
|
36
|
+
import { StarterKit as Le } from "@tiptap/starter-kit";
|
|
37
|
+
import { TextStyle as Re } from "@tiptap/extension-text-style";
|
|
38
|
+
import { Color as ze } from "@tiptap/extension-color";
|
|
39
|
+
import { Highlight as Be } from "@tiptap/extension-highlight";
|
|
40
|
+
import { Placeholder as Ve } from "@tiptap/extension-placeholder";
|
|
41
|
+
import { CharacterCount as He } from "@tiptap/extension-character-count";
|
|
42
|
+
import { Markdown as Ue } from "tiptap-markdown";
|
|
43
|
+
import We from "@mui/icons-material/FormatBold";
|
|
44
|
+
import Ge from "@mui/icons-material/FormatItalic";
|
|
45
|
+
import Ke from "@mui/icons-material/FormatUnderlined";
|
|
46
|
+
import qe from "@mui/icons-material/StrikethroughS";
|
|
47
|
+
import Je from "@mui/icons-material/FormatListBulleted";
|
|
48
|
+
import Ye from "@mui/icons-material/FormatListNumbered";
|
|
49
|
+
import Xe from "@mui/icons-material/FormatQuote";
|
|
50
|
+
import Ze from "@mui/icons-material/Code";
|
|
51
|
+
import Qe from "@mui/icons-material/InsertLink";
|
|
52
|
+
import $e from "@mui/icons-material/HorizontalRule";
|
|
53
|
+
import et from "@mui/icons-material/FormatColorText";
|
|
54
|
+
import tt from "@mui/icons-material/BorderColor";
|
|
55
|
+
import nt from "@mui/icons-material/FormatClear";
|
|
56
|
+
import rt from "@mui/icons-material/FormatColorReset";
|
|
57
|
+
import { MSSQL as it, MySQL as at, PostgreSQL as ot, SQLite as st, StandardSQL as ct, sql as lt } from "@codemirror/lang-sql";
|
|
58
|
+
import { autocompletion as ut, completionKeymap as dt } from "@codemirror/autocomplete";
|
|
59
|
+
import ft from "@mui/icons-material/PlayArrow";
|
|
60
|
+
import { format as pt } from "sql-formatter";
|
|
61
|
+
import mt from "@mui/icons-material/WarningAmber";
|
|
62
62
|
//#region src/components/confirm-dialog/ConfirmDialog.types.ts
|
|
63
|
-
var
|
|
63
|
+
var ht = {
|
|
64
64
|
confirmLabel: "Confirm",
|
|
65
65
|
cancelLabel: "Cancel"
|
|
66
|
-
},
|
|
66
|
+
}, gt = {
|
|
67
67
|
info: R,
|
|
68
68
|
warning: z,
|
|
69
69
|
error: B,
|
|
70
70
|
success: V
|
|
71
|
-
},
|
|
71
|
+
}, _t = {
|
|
72
72
|
info: "primary",
|
|
73
73
|
warning: "warning",
|
|
74
74
|
error: "error",
|
|
75
75
|
success: "success"
|
|
76
76
|
};
|
|
77
|
-
function
|
|
78
|
-
let { title: a, description: o, confirmLabel: s, cancelLabel: c, severity: l = "info", hideCancelButton: d = !1, maxWidth: f = "xs", showIcon: g = !0 } = t, y = g ?
|
|
77
|
+
function vt({ open: e, options: t, translation: n, onConfirm: r, onCancel: i }) {
|
|
78
|
+
let { title: a, description: o, confirmLabel: s, cancelLabel: c, severity: l = "info", hideCancelButton: d = !1, maxWidth: f = "xs", showIcon: g = !0 } = t, y = g ? gt[l] : null, b = _t[l], x = s ?? n.confirmLabel, S = c ?? n.cancelLabel;
|
|
79
79
|
return /* @__PURE__ */ W(p, {
|
|
80
80
|
open: e,
|
|
81
81
|
onClose: i,
|
|
@@ -132,10 +132,10 @@ function gt({ open: e, options: t, translation: n, onConfirm: r, onCancel: i })
|
|
|
132
132
|
]
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
-
var
|
|
136
|
-
function
|
|
135
|
+
var yt = e(() => Promise.resolve(!1));
|
|
136
|
+
function bt({ children: e, translation: n }) {
|
|
137
137
|
let r = {
|
|
138
|
-
...
|
|
138
|
+
...ht,
|
|
139
139
|
...n
|
|
140
140
|
}, i = o(null), [a, c] = s({
|
|
141
141
|
open: !1,
|
|
@@ -146,9 +146,9 @@ function vt({ children: e, translation: n }) {
|
|
|
146
146
|
options: e
|
|
147
147
|
});
|
|
148
148
|
})), []);
|
|
149
|
-
return /* @__PURE__ */ W(
|
|
149
|
+
return /* @__PURE__ */ W(yt.Provider, {
|
|
150
150
|
value: l,
|
|
151
|
-
children: [e, /* @__PURE__ */ U(
|
|
151
|
+
children: [e, /* @__PURE__ */ U(vt, {
|
|
152
152
|
open: a.open,
|
|
153
153
|
options: a.options,
|
|
154
154
|
translation: r,
|
|
@@ -167,18 +167,18 @@ function vt({ children: e, translation: n }) {
|
|
|
167
167
|
})]
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
return n(
|
|
170
|
+
function xt() {
|
|
171
|
+
return n(yt);
|
|
172
172
|
}
|
|
173
173
|
//#endregion
|
|
174
174
|
//#region src/components/json-editor/JsonEditor.types.ts
|
|
175
|
-
var
|
|
175
|
+
var St = {
|
|
176
176
|
showFormat: !0,
|
|
177
177
|
showCompact: !0,
|
|
178
178
|
showCopy: !0,
|
|
179
179
|
showClear: !0,
|
|
180
180
|
showUndoRedo: !0
|
|
181
|
-
},
|
|
181
|
+
}, Ct = {
|
|
182
182
|
format: "Format JSON",
|
|
183
183
|
compact: "Compact JSON",
|
|
184
184
|
copy: "Copy",
|
|
@@ -192,8 +192,8 @@ var bt = {
|
|
|
192
192
|
};
|
|
193
193
|
//#endregion
|
|
194
194
|
//#region src/components/json-editor/JsonEditorContent.tsx
|
|
195
|
-
function
|
|
196
|
-
let m = o(null), h = o(null), g = o(t), _ = o(d), v = o(f), y = o(p), b = o(u), x = o(new
|
|
195
|
+
function wt({ value: e, onChange: t, placeholder: n, disabled: i = !1, readonly: a = !1, showLineNumbers: s = !0, highlightColors: c, onViewReady: u, onCursorChange: d, onBlur: f, onFocus: p }) {
|
|
196
|
+
let m = o(null), h = o(null), g = o(t), _ = o(d), v = o(f), y = o(p), b = o(u), x = o(new ne()), S = o(new ne()), C = L(), w = C.palette.mode === "dark", T = c?.propertyName ?? C.palette.primary.main, E = c?.string ?? C.palette.success.main, D = c?.number ?? C.palette.warning.main, O = c?.boolean ?? C.palette.info.main, k = c?.null ?? C.palette.text.secondary;
|
|
197
197
|
return r(() => {
|
|
198
198
|
g.current = t;
|
|
199
199
|
}, [t]), r(() => {
|
|
@@ -206,40 +206,40 @@ function St({ value: e, onChange: t, placeholder: n, disabled: i = !1, readonly:
|
|
|
206
206
|
b.current = u;
|
|
207
207
|
}, [u]), r(() => {
|
|
208
208
|
if (!m.current) return;
|
|
209
|
-
let t = h.current?.state.doc.toString() ?? e ?? "", r =
|
|
209
|
+
let t = h.current?.state.doc.toString() ?? e ?? "", r = de.define([
|
|
210
210
|
{
|
|
211
|
-
tag:
|
|
211
|
+
tag: Y.propertyName,
|
|
212
212
|
color: T,
|
|
213
213
|
fontWeight: "bold"
|
|
214
214
|
},
|
|
215
215
|
{
|
|
216
|
-
tag:
|
|
216
|
+
tag: Y.string,
|
|
217
217
|
color: E
|
|
218
218
|
},
|
|
219
219
|
{
|
|
220
|
-
tag:
|
|
220
|
+
tag: Y.number,
|
|
221
221
|
color: D
|
|
222
222
|
},
|
|
223
223
|
{
|
|
224
|
-
tag:
|
|
224
|
+
tag: Y.bool,
|
|
225
225
|
color: O,
|
|
226
226
|
fontWeight: "bold"
|
|
227
227
|
},
|
|
228
228
|
{
|
|
229
|
-
tag:
|
|
229
|
+
tag: Y.null,
|
|
230
230
|
color: k,
|
|
231
231
|
fontStyle: "italic"
|
|
232
232
|
},
|
|
233
233
|
{
|
|
234
|
-
tag:
|
|
234
|
+
tag: Y.bracket,
|
|
235
235
|
color: C.palette.text.secondary
|
|
236
236
|
},
|
|
237
237
|
{
|
|
238
|
-
tag:
|
|
238
|
+
tag: Y.punctuation,
|
|
239
239
|
color: C.palette.text.disabled
|
|
240
240
|
},
|
|
241
241
|
{
|
|
242
|
-
tag:
|
|
242
|
+
tag: Y.invalid,
|
|
243
243
|
color: C.palette.error.main,
|
|
244
244
|
textDecoration: "underline wavy"
|
|
245
245
|
}
|
|
@@ -285,17 +285,17 @@ function St({ value: e, onChange: t, placeholder: n, disabled: i = !1, readonly:
|
|
|
285
285
|
".cm-diagnostic-error": { borderLeft: `3px solid ${C.palette.error.main}` },
|
|
286
286
|
".cm-diagnostic-warning": { borderLeft: `3px solid ${C.palette.warning.main}` }
|
|
287
287
|
}, { dark: w }),
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
288
|
+
fe(r),
|
|
289
|
+
ie(),
|
|
290
|
+
pe(),
|
|
291
|
+
me(ae()),
|
|
292
|
+
se(),
|
|
293
|
+
J.of([...oe, ...ce]),
|
|
294
294
|
x.current.of(G.editable.of(!i && !a)),
|
|
295
|
-
S.current.of(
|
|
295
|
+
S.current.of(re.readOnly.of(a)),
|
|
296
296
|
K(),
|
|
297
|
-
...s ? [
|
|
298
|
-
...n ? [
|
|
297
|
+
...s ? [ee(), q()] : [],
|
|
298
|
+
...n ? [te(n)] : [],
|
|
299
299
|
G.updateListener.of((e) => {
|
|
300
300
|
e.docChanged && g.current?.(e.state.doc.toString());
|
|
301
301
|
let t = e.state.selection.main.head, n = e.state.doc.lineAt(t);
|
|
@@ -310,7 +310,7 @@ function St({ value: e, onChange: t, placeholder: n, disabled: i = !1, readonly:
|
|
|
310
310
|
}
|
|
311
311
|
})
|
|
312
312
|
], c = new G({
|
|
313
|
-
state:
|
|
313
|
+
state: re.create({
|
|
314
314
|
doc: t,
|
|
315
315
|
extensions: o
|
|
316
316
|
}),
|
|
@@ -336,7 +336,7 @@ function St({ value: e, onChange: t, placeholder: n, disabled: i = !1, readonly:
|
|
|
336
336
|
insert: e ?? ""
|
|
337
337
|
} });
|
|
338
338
|
}, [e]), r(() => {
|
|
339
|
-
h.current?.dispatch({ effects: [x.current.reconfigure(G.editable.of(!i && !a)), S.current.reconfigure(
|
|
339
|
+
h.current?.dispatch({ effects: [x.current.reconfigure(G.editable.of(!i && !a)), S.current.reconfigure(re.readOnly.of(a))] });
|
|
340
340
|
}, [i, a]), /* @__PURE__ */ U(l, {
|
|
341
341
|
ref: m,
|
|
342
342
|
sx: {
|
|
@@ -355,23 +355,27 @@ function St({ value: e, onChange: t, placeholder: n, disabled: i = !1, readonly:
|
|
|
355
355
|
});
|
|
356
356
|
}
|
|
357
357
|
//#endregion
|
|
358
|
-
//#region src/components/
|
|
359
|
-
function
|
|
358
|
+
//#region src/components/shared/ToolbarButton.tsx
|
|
359
|
+
function X({ label: e, icon: t, onClick: n, active: r, disabled: i }) {
|
|
360
360
|
return /* @__PURE__ */ U(F, {
|
|
361
361
|
title: e,
|
|
362
362
|
arrow: !0,
|
|
363
363
|
children: /* @__PURE__ */ U("span", { children: /* @__PURE__ */ U(S, {
|
|
364
364
|
size: "small",
|
|
365
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
365
366
|
onClick: n,
|
|
366
|
-
disabled:
|
|
367
|
-
color: "default",
|
|
367
|
+
disabled: i,
|
|
368
|
+
color: r ? "primary" : "default",
|
|
368
369
|
sx: { borderRadius: 1 },
|
|
369
370
|
"aria-label": e,
|
|
371
|
+
"aria-pressed": r,
|
|
370
372
|
children: t
|
|
371
373
|
}) })
|
|
372
374
|
});
|
|
373
375
|
}
|
|
374
|
-
|
|
376
|
+
//#endregion
|
|
377
|
+
//#region src/components/json-editor/JsonEditorToolbar.tsx
|
|
378
|
+
function Tt({ viewRef: e, toolbarConfig: t, translation: n, indent: r, disabled: i }) {
|
|
375
379
|
let [a, o] = s(!1), c = i || !e.current;
|
|
376
380
|
function u() {
|
|
377
381
|
let t = e.current;
|
|
@@ -417,11 +421,11 @@ function wt({ viewRef: e, toolbarConfig: t, translation: n, indent: r, disabled:
|
|
|
417
421
|
}
|
|
418
422
|
function m() {
|
|
419
423
|
let t = e.current;
|
|
420
|
-
t && (
|
|
424
|
+
t && (ue(t), t.focus());
|
|
421
425
|
}
|
|
422
426
|
function h() {
|
|
423
427
|
let t = e.current;
|
|
424
|
-
t && (
|
|
428
|
+
t && (le(t), t.focus());
|
|
425
429
|
}
|
|
426
430
|
let g = t.showFormat || t.showCompact, _ = t.showCopy || t.showClear, y = t.showUndoRedo;
|
|
427
431
|
return /* @__PURE__ */ W(l, {
|
|
@@ -441,14 +445,14 @@ function wt({ viewRef: e, toolbarConfig: t, translation: n, indent: r, disabled:
|
|
|
441
445
|
display: "flex",
|
|
442
446
|
gap: .25
|
|
443
447
|
},
|
|
444
|
-
children: [t.showFormat && /* @__PURE__ */ U(
|
|
448
|
+
children: [t.showFormat && /* @__PURE__ */ U(X, {
|
|
445
449
|
label: n.format,
|
|
446
|
-
icon: /* @__PURE__ */ U(
|
|
450
|
+
icon: /* @__PURE__ */ U(be, { fontSize: "small" }),
|
|
447
451
|
onClick: u,
|
|
448
452
|
disabled: c
|
|
449
|
-
}), t.showCompact && /* @__PURE__ */ U(
|
|
453
|
+
}), t.showCompact && /* @__PURE__ */ U(X, {
|
|
450
454
|
label: n.compact,
|
|
451
|
-
icon: /* @__PURE__ */ U(
|
|
455
|
+
icon: /* @__PURE__ */ U(xe, { fontSize: "small" }),
|
|
452
456
|
onClick: d,
|
|
453
457
|
disabled: c
|
|
454
458
|
})]
|
|
@@ -463,17 +467,17 @@ function wt({ viewRef: e, toolbarConfig: t, translation: n, indent: r, disabled:
|
|
|
463
467
|
display: "flex",
|
|
464
468
|
gap: .25
|
|
465
469
|
},
|
|
466
|
-
children: [t.showCopy && /* @__PURE__ */ U(
|
|
470
|
+
children: [t.showCopy && /* @__PURE__ */ U(X, {
|
|
467
471
|
label: a ? n.copySuccess : n.copy,
|
|
468
|
-
icon: a ? /* @__PURE__ */ U(
|
|
472
|
+
icon: a ? /* @__PURE__ */ U(ge, {
|
|
469
473
|
fontSize: "small",
|
|
470
474
|
color: "success"
|
|
471
|
-
}) : /* @__PURE__ */ U(
|
|
475
|
+
}) : /* @__PURE__ */ U(he, { fontSize: "small" }),
|
|
472
476
|
onClick: f,
|
|
473
477
|
disabled: c
|
|
474
|
-
}), t.showClear && /* @__PURE__ */ U(
|
|
478
|
+
}), t.showClear && /* @__PURE__ */ U(X, {
|
|
475
479
|
label: n.clear,
|
|
476
|
-
icon: /* @__PURE__ */ U(
|
|
480
|
+
icon: /* @__PURE__ */ U(_e, { fontSize: "small" }),
|
|
477
481
|
onClick: p,
|
|
478
482
|
disabled: c
|
|
479
483
|
})]
|
|
@@ -488,14 +492,14 @@ function wt({ viewRef: e, toolbarConfig: t, translation: n, indent: r, disabled:
|
|
|
488
492
|
display: "flex",
|
|
489
493
|
gap: .25
|
|
490
494
|
},
|
|
491
|
-
children: [/* @__PURE__ */ U(
|
|
495
|
+
children: [/* @__PURE__ */ U(X, {
|
|
492
496
|
label: n.undo,
|
|
493
|
-
icon: /* @__PURE__ */ U(
|
|
497
|
+
icon: /* @__PURE__ */ U(ve, { fontSize: "small" }),
|
|
494
498
|
onClick: m,
|
|
495
499
|
disabled: c
|
|
496
|
-
}), /* @__PURE__ */ U(
|
|
500
|
+
}), /* @__PURE__ */ U(X, {
|
|
497
501
|
label: n.redo,
|
|
498
|
-
icon: /* @__PURE__ */ U(
|
|
502
|
+
icon: /* @__PURE__ */ U(ye, { fontSize: "small" }),
|
|
499
503
|
onClick: h,
|
|
500
504
|
disabled: c
|
|
501
505
|
})]
|
|
@@ -506,7 +510,7 @@ function wt({ viewRef: e, toolbarConfig: t, translation: n, indent: r, disabled:
|
|
|
506
510
|
}
|
|
507
511
|
//#endregion
|
|
508
512
|
//#region src/components/json-editor/JsonEditorFooter.tsx
|
|
509
|
-
function
|
|
513
|
+
function Et({ helperText: e, error: t, showLineColumn: n, showValidation: r, isValid: i, cursorLine: a, cursorCol: o, translation: s }) {
|
|
510
514
|
let c = s.lineColumn.replace("{line}", String(a)).replace("{col}", String(o));
|
|
511
515
|
return /* @__PURE__ */ W(l, {
|
|
512
516
|
sx: {
|
|
@@ -555,11 +559,13 @@ function Tt({ helperText: e, error: t, showLineColumn: n, showValidation: r, isV
|
|
|
555
559
|
});
|
|
556
560
|
}
|
|
557
561
|
//#endregion
|
|
558
|
-
//#region src/components/
|
|
559
|
-
function
|
|
562
|
+
//#region src/components/shared/normalizeSize.ts
|
|
563
|
+
function Dt(e) {
|
|
560
564
|
if (!(e === "" || e === void 0)) return typeof e == "string" && e !== "auto" && !isNaN(Number(e)) ? Number(e) : e;
|
|
561
565
|
}
|
|
562
|
-
|
|
566
|
+
//#endregion
|
|
567
|
+
//#region src/components/json-editor/JsonEditor.tsx
|
|
568
|
+
function Ot(e) {
|
|
563
569
|
if (!e.trim()) return !1;
|
|
564
570
|
try {
|
|
565
571
|
return JSON.parse(e), !0;
|
|
@@ -567,17 +573,17 @@ function Dt(e) {
|
|
|
567
573
|
return !1;
|
|
568
574
|
}
|
|
569
575
|
}
|
|
570
|
-
function
|
|
576
|
+
function kt({ value: e, onChange: n, onValidChange: r, placeholder: i, height: a, width: c, disabled: u = !1, readonly: d = !1, error: f = !1, helperText: p, name: m, indent: h = 2, showLineNumbers: g = !0, showLineColumn: _ = !0, showValidation: y = !1, toolbarConfig: b, translation: x, highlightColors: S, onBlur: C, onFocus: w }) {
|
|
571
577
|
let T = {
|
|
572
|
-
...
|
|
578
|
+
...Ct,
|
|
573
579
|
...x
|
|
574
580
|
}, E = {
|
|
575
|
-
...
|
|
581
|
+
...St,
|
|
576
582
|
...b
|
|
577
|
-
}, D =
|
|
583
|
+
}, D = Dt(a), k = Dt(c), A = D === "auto", j = A ? void 0 : D ?? 300, M = o(null), [N, P] = s({
|
|
578
584
|
line: 1,
|
|
579
585
|
col: 1
|
|
580
|
-
}), [F, I] = s(() =>
|
|
586
|
+
}), [F, I] = s(() => Ot(e ?? "")), L = t((e) => {
|
|
581
587
|
M.current = e;
|
|
582
588
|
}, []), R = t((e, t) => {
|
|
583
589
|
P({
|
|
@@ -585,7 +591,7 @@ function Ot({ value: e, onChange: n, onValidChange: r, placeholder: i, height: a
|
|
|
585
591
|
col: t
|
|
586
592
|
});
|
|
587
593
|
}, []), z = t((e) => {
|
|
588
|
-
let t =
|
|
594
|
+
let t = Ot(e);
|
|
589
595
|
I(t), r?.(t), n?.(e);
|
|
590
596
|
}, [n, r]), B = _ || y || !!p;
|
|
591
597
|
return /* @__PURE__ */ W(l, {
|
|
@@ -611,13 +617,13 @@ function Ot({ value: e, onChange: n, onValidChange: r, placeholder: i, height: a
|
|
|
611
617
|
borderWidth: 2
|
|
612
618
|
}
|
|
613
619
|
},
|
|
614
|
-
children: [!d && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(
|
|
620
|
+
children: [!d && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(Tt, {
|
|
615
621
|
viewRef: M,
|
|
616
622
|
toolbarConfig: E,
|
|
617
623
|
translation: T,
|
|
618
624
|
indent: h,
|
|
619
625
|
disabled: u
|
|
620
|
-
}), /* @__PURE__ */ U(v, {})] }), /* @__PURE__ */ U(
|
|
626
|
+
}), /* @__PURE__ */ U(v, {})] }), /* @__PURE__ */ U(wt, {
|
|
621
627
|
value: e,
|
|
622
628
|
onChange: z,
|
|
623
629
|
placeholder: i,
|
|
@@ -631,7 +637,7 @@ function Ot({ value: e, onChange: n, onValidChange: r, placeholder: i, height: a
|
|
|
631
637
|
onFocus: w
|
|
632
638
|
})]
|
|
633
639
|
}),
|
|
634
|
-
B && /* @__PURE__ */ U(
|
|
640
|
+
B && /* @__PURE__ */ U(Et, {
|
|
635
641
|
helperText: p,
|
|
636
642
|
error: f,
|
|
637
643
|
showLineColumn: _,
|
|
@@ -651,19 +657,19 @@ function Ot({ value: e, onChange: n, onValidChange: r, placeholder: i, height: a
|
|
|
651
657
|
}
|
|
652
658
|
//#endregion
|
|
653
659
|
//#region src/components/gantt-chart/util/gantt-chart.util.ts
|
|
654
|
-
function
|
|
660
|
+
function At(e) {
|
|
655
661
|
let t = /* @__PURE__ */ new Date(), n = Gt(t), r = Kt(t);
|
|
656
662
|
if (e.length === 0) return {
|
|
657
663
|
start: n,
|
|
658
664
|
end: r
|
|
659
665
|
};
|
|
660
|
-
let i = e.map((e) => e.startDate.getTime()), a = e.map((e) => e.endDate.getTime()), o =
|
|
666
|
+
let i = e.map((e) => e.startDate.getTime()), a = e.map((e) => e.endDate.getTime()), o = It(Rt(new Date(Math.min(...i)), -1)), s = Lt(Rt(new Date(Math.max(...a)), 1));
|
|
661
667
|
return {
|
|
662
668
|
start: o < n ? o : n,
|
|
663
669
|
end: s > r ? s : r
|
|
664
670
|
};
|
|
665
671
|
}
|
|
666
|
-
function
|
|
672
|
+
function jt(e, t) {
|
|
667
673
|
return t === "weeks" ? {
|
|
668
674
|
start: Vt(e.start),
|
|
669
675
|
end: e.end
|
|
@@ -672,7 +678,7 @@ function At(e, t) {
|
|
|
672
678
|
end: Kt(e.end)
|
|
673
679
|
} : e;
|
|
674
680
|
}
|
|
675
|
-
function
|
|
681
|
+
function Mt(e, t) {
|
|
676
682
|
let n = t.end.getTime() - t.start.getTime();
|
|
677
683
|
if (n <= 0) return {
|
|
678
684
|
left: 0,
|
|
@@ -684,7 +690,7 @@ function jt(e, t) {
|
|
|
684
690
|
width: Math.max(0, i)
|
|
685
691
|
};
|
|
686
692
|
}
|
|
687
|
-
function
|
|
693
|
+
function Nt(e) {
|
|
688
694
|
let t = /* @__PURE__ */ new Map();
|
|
689
695
|
for (let n of e) t.set(n.id, {
|
|
690
696
|
...n,
|
|
@@ -693,28 +699,28 @@ function Mt(e) {
|
|
|
693
699
|
});
|
|
694
700
|
let n = [];
|
|
695
701
|
for (let e of t.values()) e.parentId && t.has(e.parentId) ? t.get(e.parentId).children.push(e) : n.push(e);
|
|
696
|
-
return
|
|
697
|
-
}
|
|
698
|
-
function Nt(e, t) {
|
|
699
|
-
for (let n of e) n.depth = t, Nt(n.children, t + 1);
|
|
702
|
+
return Pt(n, 0), n;
|
|
700
703
|
}
|
|
701
704
|
function Pt(e, t) {
|
|
705
|
+
for (let n of e) n.depth = t, Pt(n.children, t + 1);
|
|
706
|
+
}
|
|
707
|
+
function Ft(e, t) {
|
|
702
708
|
let n = [];
|
|
703
709
|
function r(e) {
|
|
704
710
|
for (let i of e) n.push(i), i.children.length > 0 && t.has(i.id) && r(i.children);
|
|
705
711
|
}
|
|
706
712
|
return r(e), n;
|
|
707
713
|
}
|
|
708
|
-
function
|
|
714
|
+
function It(e) {
|
|
709
715
|
return new Date(e.getFullYear(), e.getMonth(), 1, 0, 0, 0, 0);
|
|
710
716
|
}
|
|
711
|
-
function
|
|
717
|
+
function Lt(e) {
|
|
712
718
|
return new Date(e.getFullYear(), e.getMonth() + 1, 0, 23, 59, 59, 999);
|
|
713
719
|
}
|
|
714
|
-
function
|
|
720
|
+
function Rt(e, t) {
|
|
715
721
|
return new Date(e.getFullYear(), e.getMonth() + t, e.getDate());
|
|
716
722
|
}
|
|
717
|
-
function
|
|
723
|
+
function Z(e, t) {
|
|
718
724
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate() + t, 0, 0, 0, 0);
|
|
719
725
|
}
|
|
720
726
|
function zt(e, t, n) {
|
|
@@ -736,8 +742,8 @@ function zt(e, t, n) {
|
|
|
736
742
|
return e.map((e) => i.get(e.id));
|
|
737
743
|
}
|
|
738
744
|
function Bt(e) {
|
|
739
|
-
let t = [], n =
|
|
740
|
-
for (; n <= e.end;) t.push(n), n =
|
|
745
|
+
let t = [], n = It(e.start);
|
|
746
|
+
for (; n <= e.end;) t.push(n), n = Rt(n, 1);
|
|
741
747
|
return t;
|
|
742
748
|
}
|
|
743
749
|
function Vt(e) {
|
|
@@ -766,7 +772,7 @@ function Gt(e) {
|
|
|
766
772
|
}
|
|
767
773
|
function Kt(e) {
|
|
768
774
|
let t = Math.floor(e.getMonth() / 3) * 3 + 2;
|
|
769
|
-
return
|
|
775
|
+
return Lt(new Date(e.getFullYear(), t, 1));
|
|
770
776
|
}
|
|
771
777
|
function qt(e) {
|
|
772
778
|
let t = [], n = Gt(e.start);
|
|
@@ -801,17 +807,17 @@ function Jt(e) {
|
|
|
801
807
|
//#endregion
|
|
802
808
|
//#region src/components/gantt-chart/GanttChart.store.ts
|
|
803
809
|
function Yt(e, t) {
|
|
804
|
-
let n = t.startDate < e.start ?
|
|
810
|
+
let n = t.startDate < e.start ? It(Rt(t.startDate, -1)) : e.start, r = t.endDate > e.end ? Lt(Rt(t.endDate, 1)) : e.end;
|
|
805
811
|
return n === e.start && r === e.end ? e : {
|
|
806
812
|
start: n,
|
|
807
813
|
end: r
|
|
808
814
|
};
|
|
809
815
|
}
|
|
810
816
|
function Xt(e, t = "months", n = !1, r, i = !1) {
|
|
811
|
-
let a =
|
|
812
|
-
return
|
|
817
|
+
let a = At(e);
|
|
818
|
+
return Ce((o, s) => ({
|
|
813
819
|
tasks: e,
|
|
814
|
-
taskTree:
|
|
820
|
+
taskTree: Nt(e),
|
|
815
821
|
expandedIds: n ? new Set(e.map((e) => e.id)) : new Set(e.filter((e) => !e.parentId).map((e) => e.id)),
|
|
816
822
|
timeScale: t,
|
|
817
823
|
timelineRange: r ?? a,
|
|
@@ -823,8 +829,8 @@ function Xt(e, t = "months", n = !1, r, i = !1) {
|
|
|
823
829
|
setTasks: (e) => {
|
|
824
830
|
o((t) => ({
|
|
825
831
|
tasks: e,
|
|
826
|
-
taskTree:
|
|
827
|
-
...t.isRangeCustomized ? {} : { timelineRange:
|
|
832
|
+
taskTree: Nt(e),
|
|
833
|
+
...t.isRangeCustomized ? {} : { timelineRange: At(e) }
|
|
828
834
|
}));
|
|
829
835
|
},
|
|
830
836
|
addTask: (e) => {
|
|
@@ -832,7 +838,7 @@ function Xt(e, t = "months", n = !1, r, i = !1) {
|
|
|
832
838
|
let n = [...t.tasks, e];
|
|
833
839
|
return {
|
|
834
840
|
tasks: n,
|
|
835
|
-
taskTree:
|
|
841
|
+
taskTree: Nt(n),
|
|
836
842
|
timelineRange: Yt(t.timelineRange, e)
|
|
837
843
|
};
|
|
838
844
|
});
|
|
@@ -848,7 +854,7 @@ function Xt(e, t = "months", n = !1, r, i = !1) {
|
|
|
848
854
|
for (let e of r) i = Yt(i, e);
|
|
849
855
|
return {
|
|
850
856
|
tasks: r,
|
|
851
|
-
taskTree:
|
|
857
|
+
taskTree: Nt(r),
|
|
852
858
|
timelineRange: i
|
|
853
859
|
};
|
|
854
860
|
});
|
|
@@ -862,7 +868,7 @@ function Xt(e, t = "months", n = !1, r, i = !1) {
|
|
|
862
868
|
let i = t.tasks.filter((e) => !n.has(e.id));
|
|
863
869
|
return {
|
|
864
870
|
tasks: i,
|
|
865
|
-
taskTree:
|
|
871
|
+
taskTree: Nt(i)
|
|
866
872
|
};
|
|
867
873
|
});
|
|
868
874
|
},
|
|
@@ -895,14 +901,14 @@ function Xt(e, t = "months", n = !1, r, i = !1) {
|
|
|
895
901
|
},
|
|
896
902
|
resetTimelineRange: () => {
|
|
897
903
|
o((e) => ({
|
|
898
|
-
timelineRange:
|
|
904
|
+
timelineRange: At(e.tasks),
|
|
899
905
|
isRangeCustomized: !1
|
|
900
906
|
}));
|
|
901
907
|
},
|
|
902
908
|
resetView: () => {
|
|
903
909
|
o((e) => ({
|
|
904
910
|
timeScale: e.defaultTimeScale,
|
|
905
|
-
timelineRange:
|
|
911
|
+
timelineRange: At(e.tasks),
|
|
906
912
|
isRangeCustomized: !1,
|
|
907
913
|
isExpandedCustomized: !1,
|
|
908
914
|
expandedIds: e.initialExpandAll ? new Set(e.tasks.map((e) => e.id)) : new Set(e.tasks.filter((e) => !e.parentId).map((e) => e.id))
|
|
@@ -910,7 +916,7 @@ function Xt(e, t = "months", n = !1, r, i = !1) {
|
|
|
910
916
|
},
|
|
911
917
|
getVisibleTasks: () => {
|
|
912
918
|
let { taskTree: e, expandedIds: t } = s();
|
|
913
|
-
return
|
|
919
|
+
return Ft(e, t);
|
|
914
920
|
}
|
|
915
921
|
}));
|
|
916
922
|
}
|
|
@@ -956,19 +962,29 @@ var Zt = {
|
|
|
956
962
|
addTaskTooltip: "Aufgabe hinzufügen",
|
|
957
963
|
editTaskTooltip: "Aufgabe bearbeiten",
|
|
958
964
|
deleteTaskTooltip: "Aufgabe löschen"
|
|
965
|
+
}, Qt = {
|
|
966
|
+
planned: "warning.light",
|
|
967
|
+
"in-progress": "info.main",
|
|
968
|
+
done: "success.main",
|
|
969
|
+
blocked: "error.main"
|
|
970
|
+
}, $t = {
|
|
971
|
+
planned: "warning",
|
|
972
|
+
"in-progress": "info",
|
|
973
|
+
done: "success",
|
|
974
|
+
blocked: "error"
|
|
959
975
|
};
|
|
960
976
|
//#endregion
|
|
961
977
|
//#region src/components/gantt-chart/GanttTaskDialog.tsx
|
|
962
|
-
function
|
|
978
|
+
function en(e) {
|
|
963
979
|
return e.toISOString().slice(0, 10);
|
|
964
980
|
}
|
|
965
|
-
function
|
|
981
|
+
function tn(e, t, n) {
|
|
966
982
|
return e < t ? t : e > n ? n : e;
|
|
967
983
|
}
|
|
968
|
-
function
|
|
969
|
-
return e.flatMap((e) => [e, ...
|
|
984
|
+
function nn(e) {
|
|
985
|
+
return e.flatMap((e) => [e, ...nn(e.children)]);
|
|
970
986
|
}
|
|
971
|
-
function
|
|
987
|
+
function rn({ label: e }) {
|
|
972
988
|
let t = o(null), [n, r] = s(!1);
|
|
973
989
|
return /* @__PURE__ */ U(F, {
|
|
974
990
|
title: e,
|
|
@@ -991,8 +1007,8 @@ function tn({ label: e }) {
|
|
|
991
1007
|
})
|
|
992
1008
|
});
|
|
993
1009
|
}
|
|
994
|
-
function
|
|
995
|
-
let f =
|
|
1010
|
+
function an({ open: e, mode: t, initialTask: n, defaultParentId: i, onSave: o, onClose: c }) {
|
|
1011
|
+
let f = $(), g = Q((e) => e.taskTree), v = Q((e) => e.timelineRange), x = a(() => nn(g), [g]), S = a(() => {
|
|
996
1012
|
if (t === "add" || !n) return /* @__PURE__ */ new Set();
|
|
997
1013
|
let e = (t) => [t.id, ...t.children.flatMap(e)], r = x.find((e) => e.id === n.id);
|
|
998
1014
|
return new Set(r ? e(r) : [n.id]);
|
|
@@ -1000,7 +1016,7 @@ function nn({ open: e, mode: t, initialTask: n, defaultParentId: i, onSave: o, o
|
|
|
1000
1016
|
t,
|
|
1001
1017
|
n,
|
|
1002
1018
|
x
|
|
1003
|
-
]), C = x.filter((e) => !S.has(e.id)), T = C, D =
|
|
1019
|
+
]), C = x.filter((e) => !S.has(e.id)), T = C, D = en(tn(/* @__PURE__ */ new Date(), v.start, v.end)), [O, k] = s({
|
|
1004
1020
|
name: "",
|
|
1005
1021
|
startDate: D,
|
|
1006
1022
|
endDate: D,
|
|
@@ -1011,11 +1027,11 @@ function nn({ open: e, mode: t, initialTask: n, defaultParentId: i, onSave: o, o
|
|
|
1011
1027
|
});
|
|
1012
1028
|
r(() => {
|
|
1013
1029
|
if (!e) return;
|
|
1014
|
-
let r =
|
|
1030
|
+
let r = en(tn(/* @__PURE__ */ new Date(), v.start, v.end));
|
|
1015
1031
|
k(t === "edit" && n ? {
|
|
1016
1032
|
name: n.name,
|
|
1017
|
-
startDate:
|
|
1018
|
-
endDate:
|
|
1033
|
+
startDate: en(n.startDate),
|
|
1034
|
+
endDate: en(n.endDate),
|
|
1019
1035
|
status: n.status,
|
|
1020
1036
|
isMilestone: n.isMilestone ?? !1,
|
|
1021
1037
|
parentId: n.parentId ?? "",
|
|
@@ -1196,7 +1212,7 @@ function nn({ open: e, mode: t, initialTask: n, defaultParentId: i, onSave: o, o
|
|
|
1196
1212
|
flexShrink: 0
|
|
1197
1213
|
},
|
|
1198
1214
|
children: "└"
|
|
1199
|
-
}), /* @__PURE__ */ U(
|
|
1215
|
+
}), /* @__PURE__ */ U(rn, { label: e.name })]
|
|
1200
1216
|
})
|
|
1201
1217
|
}, e.id))]
|
|
1202
1218
|
})]
|
|
@@ -1240,7 +1256,7 @@ function nn({ open: e, mode: t, initialTask: n, defaultParentId: i, onSave: o, o
|
|
|
1240
1256
|
flexShrink: 0
|
|
1241
1257
|
},
|
|
1242
1258
|
children: "└"
|
|
1243
|
-
}), /* @__PURE__ */ U(
|
|
1259
|
+
}), /* @__PURE__ */ U(rn, { label: e.name })]
|
|
1244
1260
|
})
|
|
1245
1261
|
}, e.id))
|
|
1246
1262
|
})]
|
|
@@ -1262,8 +1278,8 @@ function nn({ open: e, mode: t, initialTask: n, defaultParentId: i, onSave: o, o
|
|
|
1262
1278
|
}
|
|
1263
1279
|
//#endregion
|
|
1264
1280
|
//#region src/components/gantt-chart/GanttDeleteDialog.tsx
|
|
1265
|
-
function
|
|
1266
|
-
let i =
|
|
1281
|
+
function on({ open: e, task: t, onConfirm: n, onClose: r }) {
|
|
1282
|
+
let i = $(), a = i.dialogDeleteConfirm.replace("{name}", t?.name ?? "");
|
|
1267
1283
|
return /* @__PURE__ */ W(p, {
|
|
1268
1284
|
open: e,
|
|
1269
1285
|
onClose: r,
|
|
@@ -1288,17 +1304,6 @@ function rn({ open: e, task: t, onConfirm: n, onClose: r }) {
|
|
|
1288
1304
|
}
|
|
1289
1305
|
//#endregion
|
|
1290
1306
|
//#region src/components/gantt-chart/GanttTaskPanel.tsx
|
|
1291
|
-
var an = {
|
|
1292
|
-
planned: "warning.main",
|
|
1293
|
-
"in-progress": "info.main",
|
|
1294
|
-
done: "success.main",
|
|
1295
|
-
blocked: "error.main"
|
|
1296
|
-
}, on = {
|
|
1297
|
-
planned: "warning",
|
|
1298
|
-
"in-progress": "info",
|
|
1299
|
-
done: "success",
|
|
1300
|
-
blocked: "error"
|
|
1301
|
-
};
|
|
1302
1307
|
function sn(e, t) {
|
|
1303
1308
|
return {
|
|
1304
1309
|
planned: t.statusPlanned,
|
|
@@ -1308,7 +1313,7 @@ function sn(e, t) {
|
|
|
1308
1313
|
}[e];
|
|
1309
1314
|
}
|
|
1310
1315
|
function cn({ task: e, expandedIds: t, toggleExpand: n, hasActionsColumn: r, onTaskClick: i, onAddTask: a, onEditTask: o, onDeleteTask: c, onStatusChange: u, inlineEdit: d, onInlineRename: p }) {
|
|
1311
|
-
let [m, h] = s(null), [g, _] = s(null), v =
|
|
1316
|
+
let [m, h] = s(null), [g, _] = s(null), v = $(), { statusColors: y } = An(), b = () => {
|
|
1312
1317
|
g !== null && g.trim() && p?.(e, g.trim()), _(null);
|
|
1313
1318
|
};
|
|
1314
1319
|
return /* @__PURE__ */ W(l, {
|
|
@@ -1364,7 +1369,7 @@ function cn({ task: e, expandedIds: t, toggleExpand: n, hasActionsColumn: r, onT
|
|
|
1364
1369
|
borderRadius: e.isMilestone ? 0 : "50%",
|
|
1365
1370
|
transform: e.isMilestone ? "rotate(45deg)" : void 0,
|
|
1366
1371
|
flexShrink: 0,
|
|
1367
|
-
bgcolor: e.color ?? y?.[e.status] ??
|
|
1372
|
+
bgcolor: e.color ?? y?.[e.status] ?? Qt[e.status] ?? "grey.400"
|
|
1368
1373
|
} }),
|
|
1369
1374
|
g === null ? /* @__PURE__ */ U(I, {
|
|
1370
1375
|
variant: "body2",
|
|
@@ -1416,7 +1421,7 @@ function cn({ task: e, expandedIds: t, toggleExpand: n, hasActionsColumn: r, onT
|
|
|
1416
1421
|
onClick: (t) => {
|
|
1417
1422
|
t.stopPropagation(), o(e);
|
|
1418
1423
|
},
|
|
1419
|
-
children: /* @__PURE__ */ U(
|
|
1424
|
+
children: /* @__PURE__ */ U(Ee, { fontSize: "inherit" })
|
|
1420
1425
|
})
|
|
1421
1426
|
}),
|
|
1422
1427
|
a && /* @__PURE__ */ U(F, {
|
|
@@ -1427,7 +1432,7 @@ function cn({ task: e, expandedIds: t, toggleExpand: n, hasActionsColumn: r, onT
|
|
|
1427
1432
|
onClick: (t) => {
|
|
1428
1433
|
t.stopPropagation(), a(e);
|
|
1429
1434
|
},
|
|
1430
|
-
children: /* @__PURE__ */ U(
|
|
1435
|
+
children: /* @__PURE__ */ U(Te, { fontSize: "inherit" })
|
|
1431
1436
|
})
|
|
1432
1437
|
}),
|
|
1433
1438
|
c && /* @__PURE__ */ U(F, {
|
|
@@ -1438,7 +1443,7 @@ function cn({ task: e, expandedIds: t, toggleExpand: n, hasActionsColumn: r, onT
|
|
|
1438
1443
|
onClick: (t) => {
|
|
1439
1444
|
t.stopPropagation(), c(e);
|
|
1440
1445
|
},
|
|
1441
|
-
children: /* @__PURE__ */ U(
|
|
1446
|
+
children: /* @__PURE__ */ U(_e, { fontSize: "inherit" })
|
|
1442
1447
|
})
|
|
1443
1448
|
})
|
|
1444
1449
|
]
|
|
@@ -1455,7 +1460,7 @@ function cn({ task: e, expandedIds: t, toggleExpand: n, hasActionsColumn: r, onT
|
|
|
1455
1460
|
label: sn(e.status, v),
|
|
1456
1461
|
size: "small",
|
|
1457
1462
|
variant: "outlined",
|
|
1458
|
-
color: e.color ?? y?.[e.status] ? "default" :
|
|
1463
|
+
color: e.color ?? y?.[e.status] ? "default" : $t[e.status] ?? "default",
|
|
1459
1464
|
sx: {
|
|
1460
1465
|
height: 20,
|
|
1461
1466
|
fontSize: 10,
|
|
@@ -1490,7 +1495,7 @@ function cn({ task: e, expandedIds: t, toggleExpand: n, hasActionsColumn: r, onT
|
|
|
1490
1495
|
});
|
|
1491
1496
|
}
|
|
1492
1497
|
function ln({ scrollRef: e, onScroll: t, panelWidth: n, onTaskClick: r, onAddTask: i, onEditTask: o, onDeleteTask: c, onStatusChange: u, onTasksChange: d, enableBuiltinDialogs: f, onTaskCreated: p, onTaskUpdated: m, onTaskDeleted: h, inlineEdit: g, virtualizeRows: _ = !1 }) {
|
|
1493
|
-
let v =
|
|
1498
|
+
let v = $(), y = Dn(), b = Q((e) => e.taskTree), x = Q((e) => e.expandedIds), S = Q((e) => e.toggleExpand), C = Q((e) => e.timeScale), w = Q((e) => e.addTask), T = Q((e) => e.updateTask), E = Q((e) => e.deleteTask), D = a(() => Ft(b, x), [b, x]), O = we({
|
|
1494
1499
|
count: D.length,
|
|
1495
1500
|
getScrollElement: () => e.current,
|
|
1496
1501
|
estimateSize: () => 40,
|
|
@@ -1520,9 +1525,9 @@ function ln({ scrollRef: e, onScroll: t, panelWidth: n, onTaskClick: r, onAddTas
|
|
|
1520
1525
|
L(e), A(!0);
|
|
1521
1526
|
} : i, K = f ? (e) => {
|
|
1522
1527
|
L(e), M(!0);
|
|
1523
|
-
} : o,
|
|
1528
|
+
} : o, q = f ? (e) => {
|
|
1524
1529
|
L(e), P(!0);
|
|
1525
|
-
} : c,
|
|
1530
|
+
} : c, J = !!(G || K || q);
|
|
1526
1531
|
return /* @__PURE__ */ W(l, {
|
|
1527
1532
|
ref: e,
|
|
1528
1533
|
onScroll: t,
|
|
@@ -1567,7 +1572,7 @@ function ln({ scrollRef: e, onScroll: t, panelWidth: n, onTaskClick: r, onAddTas
|
|
|
1567
1572
|
children: v.columnName
|
|
1568
1573
|
})
|
|
1569
1574
|
}),
|
|
1570
|
-
|
|
1575
|
+
J && /* @__PURE__ */ U(l, {
|
|
1571
1576
|
sx: {
|
|
1572
1577
|
width: 96,
|
|
1573
1578
|
flexShrink: 0,
|
|
@@ -1616,11 +1621,11 @@ function ln({ scrollRef: e, onScroll: t, panelWidth: n, onTaskClick: r, onAddTas
|
|
|
1616
1621
|
task: D[e.index],
|
|
1617
1622
|
expandedIds: x,
|
|
1618
1623
|
toggleExpand: S,
|
|
1619
|
-
hasActionsColumn:
|
|
1624
|
+
hasActionsColumn: J,
|
|
1620
1625
|
onTaskClick: r,
|
|
1621
1626
|
onAddTask: G,
|
|
1622
1627
|
onEditTask: K,
|
|
1623
|
-
onDeleteTask:
|
|
1628
|
+
onDeleteTask: q,
|
|
1624
1629
|
onStatusChange: u,
|
|
1625
1630
|
inlineEdit: g,
|
|
1626
1631
|
onInlineRename: g ? V : void 0
|
|
@@ -1630,31 +1635,31 @@ function ln({ scrollRef: e, onScroll: t, panelWidth: n, onTaskClick: r, onAddTas
|
|
|
1630
1635
|
task: e,
|
|
1631
1636
|
expandedIds: x,
|
|
1632
1637
|
toggleExpand: S,
|
|
1633
|
-
hasActionsColumn:
|
|
1638
|
+
hasActionsColumn: J,
|
|
1634
1639
|
onTaskClick: r,
|
|
1635
1640
|
onAddTask: G,
|
|
1636
1641
|
onEditTask: K,
|
|
1637
|
-
onDeleteTask:
|
|
1642
|
+
onDeleteTask: q,
|
|
1638
1643
|
onStatusChange: u,
|
|
1639
1644
|
inlineEdit: g,
|
|
1640
1645
|
onInlineRename: g ? V : void 0
|
|
1641
1646
|
}, e.id)),
|
|
1642
1647
|
f && /* @__PURE__ */ W(H, { children: [
|
|
1643
|
-
/* @__PURE__ */ U(
|
|
1648
|
+
/* @__PURE__ */ U(an, {
|
|
1644
1649
|
open: k,
|
|
1645
1650
|
mode: "add",
|
|
1646
1651
|
defaultParentId: F?.id,
|
|
1647
1652
|
onSave: R,
|
|
1648
1653
|
onClose: () => A(!1)
|
|
1649
1654
|
}),
|
|
1650
|
-
/* @__PURE__ */ U(
|
|
1655
|
+
/* @__PURE__ */ U(an, {
|
|
1651
1656
|
open: j,
|
|
1652
1657
|
mode: "edit",
|
|
1653
1658
|
initialTask: F ?? void 0,
|
|
1654
1659
|
onSave: z,
|
|
1655
1660
|
onClose: () => M(!1)
|
|
1656
1661
|
}),
|
|
1657
|
-
/* @__PURE__ */ U(
|
|
1662
|
+
/* @__PURE__ */ U(on, {
|
|
1658
1663
|
open: N,
|
|
1659
1664
|
task: F,
|
|
1660
1665
|
onConfirm: B,
|
|
@@ -1665,8 +1670,112 @@ function ln({ scrollRef: e, onScroll: t, panelWidth: n, onTaskClick: r, onAddTas
|
|
|
1665
1670
|
});
|
|
1666
1671
|
}
|
|
1667
1672
|
//#endregion
|
|
1673
|
+
//#region src/components/gantt-chart/hooks/useGanttDrag.ts
|
|
1674
|
+
var un = 864e5;
|
|
1675
|
+
function dn({ totalWidth: e, displayRange: t, onTaskMoved: n, onTaskResized: r, onTasksChange: i }) {
|
|
1676
|
+
let a = Q((e) => e.updateTask), c = Dn(), l = $(), u = o(1);
|
|
1677
|
+
u.current = e > 0 ? e / ((t.end.getTime() - t.start.getTime()) / un) : 1;
|
|
1678
|
+
let d = o(n);
|
|
1679
|
+
d.current = n;
|
|
1680
|
+
let f = o(r);
|
|
1681
|
+
f.current = r;
|
|
1682
|
+
let p = o(i);
|
|
1683
|
+
p.current = i;
|
|
1684
|
+
let m = o(null), h = o(null), [g, _] = s(null), v = o(!1);
|
|
1685
|
+
return {
|
|
1686
|
+
activeDrag: g,
|
|
1687
|
+
suppressClickRef: v,
|
|
1688
|
+
handleBarMouseDown: (e, t, n) => {
|
|
1689
|
+
e.stopPropagation(), v.current = !1, m.current = {
|
|
1690
|
+
type: n,
|
|
1691
|
+
taskId: t.id,
|
|
1692
|
+
startX: e.clientX,
|
|
1693
|
+
originalStart: t.startDate,
|
|
1694
|
+
originalEnd: t.endDate
|
|
1695
|
+
}, document.body.style.cursor = n === "resize" ? "ew-resize" : "grabbing";
|
|
1696
|
+
let r = (e) => {
|
|
1697
|
+
let t = m.current;
|
|
1698
|
+
if (!t || t.type === "progress") return;
|
|
1699
|
+
let n = e.clientX - t.startX, r = Math.round(n / u.current);
|
|
1700
|
+
Math.abs(n) >= 5 && (v.current = !0);
|
|
1701
|
+
let i = {
|
|
1702
|
+
taskId: t.taskId,
|
|
1703
|
+
type: t.type,
|
|
1704
|
+
deltaDays: r
|
|
1705
|
+
};
|
|
1706
|
+
h.current = i, _(i);
|
|
1707
|
+
}, i = () => {
|
|
1708
|
+
document.body.style.cursor = "";
|
|
1709
|
+
let e = m.current, t = h.current;
|
|
1710
|
+
if (e && t && v.current && t.deltaDays !== 0) {
|
|
1711
|
+
let n = c.getState().tasks.find((t) => t.id === e.taskId);
|
|
1712
|
+
if (n) {
|
|
1713
|
+
if (t.type === "move") {
|
|
1714
|
+
let r = Z(e.originalStart, t.deltaDays), i = Z(e.originalEnd, t.deltaDays);
|
|
1715
|
+
a({
|
|
1716
|
+
...n,
|
|
1717
|
+
startDate: r,
|
|
1718
|
+
endDate: i
|
|
1719
|
+
}), d.current?.(n, r, i);
|
|
1720
|
+
} else {
|
|
1721
|
+
let r = Z(e.originalEnd, t.deltaDays), i = r > e.originalStart ? r : Z(e.originalStart, 1);
|
|
1722
|
+
a({
|
|
1723
|
+
...n,
|
|
1724
|
+
endDate: i
|
|
1725
|
+
}), f.current?.(n, i);
|
|
1726
|
+
}
|
|
1727
|
+
p.current?.(c.getState().tasks);
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
m.current = null, h.current = null, _(null), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
|
|
1731
|
+
};
|
|
1732
|
+
document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
|
|
1733
|
+
},
|
|
1734
|
+
handleProgressMouseDown: (e, t, n, r) => {
|
|
1735
|
+
e.stopPropagation(), v.current = !1, m.current = {
|
|
1736
|
+
type: "progress",
|
|
1737
|
+
taskId: t.id,
|
|
1738
|
+
startX: e.clientX,
|
|
1739
|
+
originalStart: t.startDate,
|
|
1740
|
+
originalEnd: t.endDate,
|
|
1741
|
+
initialProgress: n,
|
|
1742
|
+
barWidthPx: r
|
|
1743
|
+
}, document.body.style.cursor = "ew-resize";
|
|
1744
|
+
let i = (e) => {
|
|
1745
|
+
let t = m.current;
|
|
1746
|
+
if (!t || t.type !== "progress") return;
|
|
1747
|
+
let n = e.clientX - t.startX;
|
|
1748
|
+
Math.abs(n) >= 5 && (v.current = !0);
|
|
1749
|
+
let r = n / (t.barWidthPx ?? 1) * 100, i = Math.round(Math.max(0, Math.min(100, (t.initialProgress ?? 0) + r))), a = {
|
|
1750
|
+
taskId: t.taskId,
|
|
1751
|
+
type: "progress",
|
|
1752
|
+
deltaDays: 0,
|
|
1753
|
+
newProgress: i
|
|
1754
|
+
};
|
|
1755
|
+
h.current = a, _(a);
|
|
1756
|
+
}, o = () => {
|
|
1757
|
+
document.body.style.cursor = "";
|
|
1758
|
+
let e = m.current, t = h.current;
|
|
1759
|
+
if (e && t && t.type === "progress" && t.newProgress !== void 0 && v.current) {
|
|
1760
|
+
let n = c.getState().tasks.find((t) => t.id === e.taskId);
|
|
1761
|
+
n && (a({
|
|
1762
|
+
...n,
|
|
1763
|
+
progress: t.newProgress
|
|
1764
|
+
}), p.current?.(c.getState().tasks));
|
|
1765
|
+
}
|
|
1766
|
+
m.current = null, h.current = null, _(null), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o);
|
|
1767
|
+
};
|
|
1768
|
+
document.addEventListener("mousemove", i), document.addEventListener("mouseup", o);
|
|
1769
|
+
},
|
|
1770
|
+
formatDragDate: (e) => e.toLocaleDateString(l.dateLocale, {
|
|
1771
|
+
day: "2-digit",
|
|
1772
|
+
month: "short"
|
|
1773
|
+
})
|
|
1774
|
+
};
|
|
1775
|
+
}
|
|
1776
|
+
//#endregion
|
|
1668
1777
|
//#region src/components/gantt-chart/GanttTimelineHeader.tsx
|
|
1669
|
-
function
|
|
1778
|
+
function fn({ items: e }) {
|
|
1670
1779
|
return /* @__PURE__ */ U(l, {
|
|
1671
1780
|
sx: { display: "flex" },
|
|
1672
1781
|
children: e.map((e) => /* @__PURE__ */ U(l, {
|
|
@@ -1689,7 +1798,7 @@ function un({ items: e }) {
|
|
|
1689
1798
|
}, e.key))
|
|
1690
1799
|
});
|
|
1691
1800
|
}
|
|
1692
|
-
function
|
|
1801
|
+
function pn({ columns: e, groups: t }) {
|
|
1693
1802
|
return /* @__PURE__ */ W(l, {
|
|
1694
1803
|
sx: {
|
|
1695
1804
|
position: "sticky",
|
|
@@ -1708,28 +1817,325 @@ function dn({ columns: e, groups: t }) {
|
|
|
1708
1817
|
borderColor: "divider",
|
|
1709
1818
|
overflow: "visible"
|
|
1710
1819
|
},
|
|
1711
|
-
children: /* @__PURE__ */ U(
|
|
1712
|
-
}), /* @__PURE__ */ U(
|
|
1820
|
+
children: /* @__PURE__ */ U(fn, { items: t })
|
|
1821
|
+
}), /* @__PURE__ */ U(fn, { items: e })]
|
|
1822
|
+
});
|
|
1823
|
+
}
|
|
1824
|
+
//#endregion
|
|
1825
|
+
//#region src/components/gantt-chart/GanttBarRow.tsx
|
|
1826
|
+
function mn({ task: e, virtualTop: t, activeDrag: n, displayRange: r, totalWidth: i, gridColumnWidth: a, criticalTaskIds: o, draggable: s = !1, resizable: c = !1, progressDraggable: u = !1, onTaskClick: d, onMilestoneClick: f, onContextMenu: p, suppressClickRef: m, handleBarMouseDown: h, handleProgressMouseDown: g, formatDragDate: _ }) {
|
|
1827
|
+
let v = L(), { statusColors: y, criticalPathColor: b, milestoneColor: x, barBorderRadius: S } = An(), C = n?.taskId === e.id, w = e;
|
|
1828
|
+
if (C && n) if (n.type === "move") w = {
|
|
1829
|
+
...e,
|
|
1830
|
+
startDate: Z(e.startDate, n.deltaDays),
|
|
1831
|
+
endDate: Z(e.endDate, n.deltaDays)
|
|
1832
|
+
};
|
|
1833
|
+
else if (n.type === "resize") {
|
|
1834
|
+
let t = Z(e.endDate, n.deltaDays);
|
|
1835
|
+
w = {
|
|
1836
|
+
...e,
|
|
1837
|
+
endDate: t > e.startDate ? t : Z(e.startDate, 1)
|
|
1838
|
+
};
|
|
1839
|
+
} else n.type === "progress" && n.newProgress !== void 0 && (w = {
|
|
1840
|
+
...e,
|
|
1841
|
+
progress: n.newProgress
|
|
1842
|
+
});
|
|
1843
|
+
let { left: T, width: E } = Mt(w, r);
|
|
1844
|
+
return /* @__PURE__ */ U(l, {
|
|
1845
|
+
"data-testid": `gantt-bar-row-${e.id}`,
|
|
1846
|
+
style: t === void 0 ? void 0 : {
|
|
1847
|
+
position: "absolute",
|
|
1848
|
+
top: t,
|
|
1849
|
+
left: 0,
|
|
1850
|
+
width: "100%"
|
|
1851
|
+
},
|
|
1852
|
+
sx: {
|
|
1853
|
+
height: 40,
|
|
1854
|
+
position: "relative",
|
|
1855
|
+
borderBottom: "1px solid",
|
|
1856
|
+
borderColor: "divider",
|
|
1857
|
+
backgroundImage: (e) => `linear-gradient(to right, transparent calc(${a}px - 1px), ${e.palette.divider} calc(${a}px - 1px), ${e.palette.divider} ${a}px)`,
|
|
1858
|
+
backgroundSize: `${a}px 100%`,
|
|
1859
|
+
backgroundRepeat: "repeat-x"
|
|
1860
|
+
},
|
|
1861
|
+
children: e.isMilestone ? /* @__PURE__ */ U(hn, {
|
|
1862
|
+
task: e,
|
|
1863
|
+
left: T,
|
|
1864
|
+
milestoneColor: x,
|
|
1865
|
+
criticalPathColor: b,
|
|
1866
|
+
isCritical: o.has(e.id),
|
|
1867
|
+
onMilestoneClick: f,
|
|
1868
|
+
theme: v
|
|
1869
|
+
}) : /* @__PURE__ */ U(gn, {
|
|
1870
|
+
task: e,
|
|
1871
|
+
effectiveTask: w,
|
|
1872
|
+
left: T,
|
|
1873
|
+
width: E,
|
|
1874
|
+
totalWidth: i,
|
|
1875
|
+
isDragging: C,
|
|
1876
|
+
activeDrag: n,
|
|
1877
|
+
draggable: s,
|
|
1878
|
+
resizable: c,
|
|
1879
|
+
progressDraggable: u,
|
|
1880
|
+
isCritical: o.has(e.id),
|
|
1881
|
+
statusColors: y,
|
|
1882
|
+
criticalPathColor: b,
|
|
1883
|
+
barBorderRadius: S,
|
|
1884
|
+
onTaskClick: d,
|
|
1885
|
+
onContextMenu: p,
|
|
1886
|
+
suppressClickRef: m,
|
|
1887
|
+
handleBarMouseDown: h,
|
|
1888
|
+
handleProgressMouseDown: g,
|
|
1889
|
+
formatDragDate: _,
|
|
1890
|
+
theme: v
|
|
1891
|
+
})
|
|
1892
|
+
});
|
|
1893
|
+
}
|
|
1894
|
+
function hn({ task: e, left: t, milestoneColor: n, criticalPathColor: r, isCritical: i, onMilestoneClick: a, theme: o }) {
|
|
1895
|
+
return t < 0 || t > 100 ? null : /* @__PURE__ */ U(l, {
|
|
1896
|
+
"data-testid": `gantt-milestone-${e.id}`,
|
|
1897
|
+
sx: {
|
|
1898
|
+
position: "absolute",
|
|
1899
|
+
left: `${t}%`,
|
|
1900
|
+
top: "50%",
|
|
1901
|
+
width: 12,
|
|
1902
|
+
height: 12,
|
|
1903
|
+
bgcolor: n ?? "warning.main",
|
|
1904
|
+
transform: "translate(-50%, -50%) rotate(45deg)",
|
|
1905
|
+
cursor: a ? "pointer" : "default",
|
|
1906
|
+
boxShadow: i ? `0 0 0 2.5px ${r ?? o.palette.error.main}` : void 0,
|
|
1907
|
+
"&:hover": a ? { opacity: .8 } : void 0
|
|
1908
|
+
},
|
|
1909
|
+
onClick: () => a?.(e)
|
|
1910
|
+
});
|
|
1911
|
+
}
|
|
1912
|
+
function gn({ task: e, effectiveTask: t, left: n, width: r, totalWidth: i, isDragging: a, activeDrag: o, draggable: s, resizable: c, progressDraggable: u, isCritical: d, statusColors: f, criticalPathColor: p, barBorderRadius: m, onTaskClick: h, onContextMenu: g, suppressClickRef: _, handleBarMouseDown: v, handleProgressMouseDown: y, formatDragDate: b, theme: x }) {
|
|
1913
|
+
let S = Math.max(0, n), C = Math.min(100, n + Math.max(r, .5)) - S;
|
|
1914
|
+
return C <= 0 ? null : /* @__PURE__ */ W(H, { children: [
|
|
1915
|
+
a && o && o.type !== "progress" && o.deltaDays !== 0 && /* @__PURE__ */ U(_n, {
|
|
1916
|
+
left: S,
|
|
1917
|
+
children: o.type === "move" ? `${b(t.startDate)} – ${b(t.endDate)}` : `→ ${b(t.endDate)}`
|
|
1918
|
+
}),
|
|
1919
|
+
a && o?.type === "progress" && o.newProgress !== void 0 && /* @__PURE__ */ W(_n, {
|
|
1920
|
+
left: S,
|
|
1921
|
+
children: [o.newProgress, "%"]
|
|
1922
|
+
}),
|
|
1923
|
+
/* @__PURE__ */ W(l, {
|
|
1924
|
+
"data-testid": `gantt-bar-${e.id}`,
|
|
1925
|
+
sx: {
|
|
1926
|
+
position: "absolute",
|
|
1927
|
+
left: `${S}%`,
|
|
1928
|
+
width: `${C}%`,
|
|
1929
|
+
height: 16,
|
|
1930
|
+
top: "50%",
|
|
1931
|
+
transform: "translateY(-50%)",
|
|
1932
|
+
bgcolor: e.color ?? f?.[e.status] ?? Qt[e.status] ?? "grey.300",
|
|
1933
|
+
borderRadius: m === void 0 ? 1 : `${m}px`,
|
|
1934
|
+
overflow: "hidden",
|
|
1935
|
+
opacity: a ? .75 : 1,
|
|
1936
|
+
boxShadow: d ? `inset 0 0 0 2.5px ${p ?? x.palette.error.main}` : void 0,
|
|
1937
|
+
cursor: a ? "grabbing" : s ? "grab" : h ? "pointer" : "default",
|
|
1938
|
+
userSelect: "none",
|
|
1939
|
+
"&:hover": s || h ? { opacity: a ? .75 : .8 } : void 0
|
|
1940
|
+
},
|
|
1941
|
+
onMouseDown: s ? (t) => v(t, e, "move") : void 0,
|
|
1942
|
+
onContextMenu: (t) => {
|
|
1943
|
+
t.preventDefault(), t.stopPropagation(), g(e, t.clientX, t.clientY);
|
|
1944
|
+
},
|
|
1945
|
+
onClick: () => {
|
|
1946
|
+
if (_.current) {
|
|
1947
|
+
_.current = !1;
|
|
1948
|
+
return;
|
|
1949
|
+
}
|
|
1950
|
+
h?.(e);
|
|
1951
|
+
},
|
|
1952
|
+
children: [
|
|
1953
|
+
t.progress !== void 0 && t.progress > 0 && /* @__PURE__ */ U(l, {
|
|
1954
|
+
"data-testid": `gantt-progress-${e.id}`,
|
|
1955
|
+
sx: {
|
|
1956
|
+
position: "absolute",
|
|
1957
|
+
left: 0,
|
|
1958
|
+
top: 0,
|
|
1959
|
+
width: `${Math.min(t.progress, 100)}%`,
|
|
1960
|
+
height: "100%",
|
|
1961
|
+
bgcolor: "currentColor",
|
|
1962
|
+
opacity: .4
|
|
1963
|
+
}
|
|
1964
|
+
}),
|
|
1965
|
+
u && /* @__PURE__ */ U(l, {
|
|
1966
|
+
"data-testid": `gantt-progress-handle-${e.id}`,
|
|
1967
|
+
sx: {
|
|
1968
|
+
position: "absolute",
|
|
1969
|
+
left: `${Math.min(t.progress ?? 0, 100)}%`,
|
|
1970
|
+
top: 0,
|
|
1971
|
+
width: 6,
|
|
1972
|
+
height: "100%",
|
|
1973
|
+
transform: "translateX(-50%)",
|
|
1974
|
+
cursor: "ew-resize",
|
|
1975
|
+
bgcolor: "rgba(255,255,255,0.35)"
|
|
1976
|
+
},
|
|
1977
|
+
onMouseDown: (n) => {
|
|
1978
|
+
n.stopPropagation();
|
|
1979
|
+
let r = C / 100 * i;
|
|
1980
|
+
y(n, e, t.progress ?? 0, r);
|
|
1981
|
+
}
|
|
1982
|
+
}),
|
|
1983
|
+
c && /* @__PURE__ */ U(l, {
|
|
1984
|
+
"data-testid": `gantt-resize-handle-${e.id}`,
|
|
1985
|
+
sx: {
|
|
1986
|
+
position: "absolute",
|
|
1987
|
+
right: 0,
|
|
1988
|
+
top: 0,
|
|
1989
|
+
width: 6,
|
|
1990
|
+
height: "100%",
|
|
1991
|
+
cursor: "ew-resize"
|
|
1992
|
+
},
|
|
1993
|
+
onMouseDown: (t) => {
|
|
1994
|
+
t.stopPropagation(), v(t, e, "resize");
|
|
1995
|
+
}
|
|
1996
|
+
})
|
|
1997
|
+
]
|
|
1998
|
+
})
|
|
1999
|
+
] });
|
|
2000
|
+
}
|
|
2001
|
+
function _n({ left: e, children: t }) {
|
|
2002
|
+
return /* @__PURE__ */ U(l, {
|
|
2003
|
+
sx: {
|
|
2004
|
+
position: "absolute",
|
|
2005
|
+
left: `${e}%`,
|
|
2006
|
+
top: 2,
|
|
2007
|
+
bgcolor: "grey.800",
|
|
2008
|
+
color: "common.white",
|
|
2009
|
+
borderRadius: .5,
|
|
2010
|
+
px: .75,
|
|
2011
|
+
lineHeight: "18px",
|
|
2012
|
+
fontSize: "0.65rem",
|
|
2013
|
+
whiteSpace: "nowrap",
|
|
2014
|
+
pointerEvents: "none",
|
|
2015
|
+
zIndex: 100
|
|
2016
|
+
},
|
|
2017
|
+
children: t
|
|
2018
|
+
});
|
|
2019
|
+
}
|
|
2020
|
+
//#endregion
|
|
2021
|
+
//#region src/components/gantt-chart/GanttWeekendStrips.tsx
|
|
2022
|
+
function vn({ strips: e, totalWidth: t, height: n, top: r }) {
|
|
2023
|
+
let { weekendColor: i } = An();
|
|
2024
|
+
return e.length === 0 ? null : /* @__PURE__ */ U(l, {
|
|
2025
|
+
"aria-hidden": !0,
|
|
2026
|
+
"data-testid": "gantt-weekend-strips",
|
|
2027
|
+
sx: {
|
|
2028
|
+
position: "absolute",
|
|
2029
|
+
top: r,
|
|
2030
|
+
left: 0,
|
|
2031
|
+
width: t,
|
|
2032
|
+
height: n,
|
|
2033
|
+
pointerEvents: "none"
|
|
2034
|
+
},
|
|
2035
|
+
children: e.map((e) => /* @__PURE__ */ U(l, { sx: {
|
|
2036
|
+
position: "absolute",
|
|
2037
|
+
left: e.left,
|
|
2038
|
+
width: 20,
|
|
2039
|
+
top: 0,
|
|
2040
|
+
height: "100%",
|
|
2041
|
+
bgcolor: i ?? "action.hover"
|
|
2042
|
+
} }, e.key))
|
|
2043
|
+
});
|
|
2044
|
+
}
|
|
2045
|
+
//#endregion
|
|
2046
|
+
//#region src/components/gantt-chart/GanttStatusContextMenu.tsx
|
|
2047
|
+
function yn({ contextMenu: e, onClose: t, onSelect: n }) {
|
|
2048
|
+
let r = $(), i = {
|
|
2049
|
+
planned: r.statusPlanned,
|
|
2050
|
+
"in-progress": r.statusInProgress,
|
|
2051
|
+
done: r.statusDone,
|
|
2052
|
+
blocked: r.statusBlocked
|
|
2053
|
+
};
|
|
2054
|
+
return /* @__PURE__ */ U(T, {
|
|
2055
|
+
open: e !== null,
|
|
2056
|
+
onClose: t,
|
|
2057
|
+
anchorReference: "anchorPosition",
|
|
2058
|
+
anchorPosition: e === null ? void 0 : {
|
|
2059
|
+
top: e.mouseY,
|
|
2060
|
+
left: e.mouseX
|
|
2061
|
+
},
|
|
2062
|
+
children: [
|
|
2063
|
+
"planned",
|
|
2064
|
+
"in-progress",
|
|
2065
|
+
"done",
|
|
2066
|
+
"blocked"
|
|
2067
|
+
].map((t) => /* @__PURE__ */ U(E, {
|
|
2068
|
+
selected: e?.task.status === t,
|
|
2069
|
+
"data-testid": `gantt-status-menu-${t}`,
|
|
2070
|
+
onClick: () => {
|
|
2071
|
+
e && n(e.task, t);
|
|
2072
|
+
},
|
|
2073
|
+
children: i[t]
|
|
2074
|
+
}, t))
|
|
2075
|
+
});
|
|
2076
|
+
}
|
|
2077
|
+
//#endregion
|
|
2078
|
+
//#region src/components/gantt-chart/GanttDependencyArrows.tsx
|
|
2079
|
+
function bn({ dependencyLines: e, todayX: t, totalWidth: n, height: r, top: i, arrowMarkerId: a }) {
|
|
2080
|
+
let o = L(), { todayLineColor: s } = An();
|
|
2081
|
+
return e.length === 0 && t === null ? null : /* @__PURE__ */ W("svg", {
|
|
2082
|
+
"data-testid": "gantt-dependency-arrows",
|
|
2083
|
+
style: {
|
|
2084
|
+
position: "absolute",
|
|
2085
|
+
top: i,
|
|
2086
|
+
left: 0,
|
|
2087
|
+
width: n,
|
|
2088
|
+
height: r,
|
|
2089
|
+
pointerEvents: "none",
|
|
2090
|
+
overflow: "visible"
|
|
2091
|
+
},
|
|
2092
|
+
children: [
|
|
2093
|
+
e.length > 0 && /* @__PURE__ */ U("defs", { children: /* @__PURE__ */ U("marker", {
|
|
2094
|
+
id: a,
|
|
2095
|
+
markerWidth: "6",
|
|
2096
|
+
markerHeight: "4",
|
|
2097
|
+
refX: "5",
|
|
2098
|
+
refY: "2",
|
|
2099
|
+
orient: "auto",
|
|
2100
|
+
children: /* @__PURE__ */ U("polygon", {
|
|
2101
|
+
points: "0 0, 6 2, 0 4",
|
|
2102
|
+
fill: "currentColor"
|
|
2103
|
+
})
|
|
2104
|
+
}) }),
|
|
2105
|
+
e.map((e) => /* @__PURE__ */ U("path", {
|
|
2106
|
+
"data-testid": `gantt-dep-${e.key}`,
|
|
2107
|
+
d: e.d,
|
|
2108
|
+
fill: "none",
|
|
2109
|
+
stroke: "currentColor",
|
|
2110
|
+
strokeWidth: 1.5,
|
|
2111
|
+
strokeOpacity: .4,
|
|
2112
|
+
markerEnd: `url(#${a})`
|
|
2113
|
+
}, e.key)),
|
|
2114
|
+
t !== null && /* @__PURE__ */ U("line", {
|
|
2115
|
+
"data-testid": "gantt-today-line",
|
|
2116
|
+
x1: t,
|
|
2117
|
+
y1: 0,
|
|
2118
|
+
x2: t,
|
|
2119
|
+
y2: r,
|
|
2120
|
+
stroke: s ?? o.palette.primary.main,
|
|
2121
|
+
strokeWidth: 1.5,
|
|
2122
|
+
strokeDasharray: "4 2"
|
|
2123
|
+
})
|
|
2124
|
+
]
|
|
1713
2125
|
});
|
|
1714
2126
|
}
|
|
1715
2127
|
//#endregion
|
|
1716
2128
|
//#region src/components/gantt-chart/GanttTimeline.tsx
|
|
1717
|
-
|
|
1718
|
-
planned: "warning.light",
|
|
1719
|
-
"in-progress": "info.main",
|
|
1720
|
-
done: "success.main",
|
|
1721
|
-
blocked: "error.main"
|
|
1722
|
-
}, pn = 864e5;
|
|
1723
|
-
function mn(e, t, n) {
|
|
2129
|
+
function xn(e, t, n) {
|
|
1724
2130
|
if (n === 0) return [];
|
|
1725
2131
|
let r = [], i = new Map(e.map((e, t) => [e.id, t]));
|
|
1726
2132
|
for (let a of e) {
|
|
1727
2133
|
if (!a.dependencies?.length) continue;
|
|
1728
|
-
let o = i.get(a.id), s =
|
|
2134
|
+
let o = i.get(a.id), s = Mt(a, t).left / 100 * n, c = o * 40 + 40 / 2;
|
|
1729
2135
|
for (let o of a.dependencies) {
|
|
1730
2136
|
let l = i.get(o);
|
|
1731
2137
|
if (l === void 0) continue;
|
|
1732
|
-
let u = e[l], d =
|
|
2138
|
+
let u = e[l], d = Mt(u, t), f = (d.left + d.width) / 100 * n, p = l * 40 + 40 / 2, m;
|
|
1733
2139
|
m = s >= f + 48 ? (f + s) / 2 : f + 24 <= n - 8 ? f + 24 : Math.max(s - 24, 8), r.push({
|
|
1734
2140
|
key: `${o}-${a.id}`,
|
|
1735
2141
|
d: `M ${f} ${p} H ${m} V ${c} H ${s}`
|
|
@@ -1738,39 +2144,39 @@ function mn(e, t, n) {
|
|
|
1738
2144
|
}
|
|
1739
2145
|
return r;
|
|
1740
2146
|
}
|
|
1741
|
-
function
|
|
1742
|
-
let y =
|
|
2147
|
+
function Sn({ scrollRef: e, onScroll: t, onTaskClick: n, onMilestoneClick: c, draggable: u = !1, resizable: d = !1, progressDraggable: f = !1, showCriticalPath: p = !1, virtualizeRows: m = !1, onTaskMoved: h, onTaskResized: g, onTasksChange: _, onStatusChange: v }) {
|
|
2148
|
+
let y = Q((e) => e.taskTree), b = Q((e) => e.tasks), x = Q((e) => e.expandedIds), S = Q((e) => e.timelineRange), C = Q((e) => e.timeScale), w = Q((e) => e.updateTask), T = Dn(), E = $(), D = `gantt-arrow-${i().replace(/:/g, "")}`, O = a(() => Ft(y, x), [y, x]), k = a(() => jt(S, C), [S, C]), A = a(() => C === "days" ? Wt(k).map((e) => ({
|
|
1743
2149
|
key: e.toISOString(),
|
|
1744
2150
|
label: String(e.getDate()),
|
|
1745
2151
|
width: 20,
|
|
1746
2152
|
isWeekend: e.getDay() === 0 || e.getDay() === 6
|
|
1747
|
-
})) :
|
|
2153
|
+
})) : C === "weeks" ? Ut(k).map((e) => ({
|
|
1748
2154
|
key: e.toISOString(),
|
|
1749
|
-
label: `${
|
|
2155
|
+
label: `${E.weekColumnPrefix}${Ht(e)}`,
|
|
1750
2156
|
width: 40
|
|
1751
|
-
})) :
|
|
2157
|
+
})) : C === "quarters" ? qt(k).map((e) => ({
|
|
1752
2158
|
key: e.key,
|
|
1753
2159
|
label: e.label,
|
|
1754
2160
|
width: 360
|
|
1755
|
-
})) : Bt(
|
|
2161
|
+
})) : Bt(k).map((e) => ({
|
|
1756
2162
|
key: e.toISOString(),
|
|
1757
|
-
label: e.toLocaleString(
|
|
2163
|
+
label: e.toLocaleString(E.dateLocale, {
|
|
1758
2164
|
month: "short",
|
|
1759
2165
|
year: "2-digit"
|
|
1760
2166
|
}),
|
|
1761
2167
|
width: 120
|
|
1762
2168
|
})), [
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
]),
|
|
1768
|
-
if (
|
|
2169
|
+
C,
|
|
2170
|
+
k,
|
|
2171
|
+
E.weekColumnPrefix,
|
|
2172
|
+
E.dateLocale
|
|
2173
|
+
]), j = a(() => A.reduce((e, t) => e + t.width, 0), [A]), M = a(() => {
|
|
2174
|
+
if (C !== "days") return;
|
|
1769
2175
|
let e = /* @__PURE__ */ new Map();
|
|
1770
|
-
for (let t of
|
|
2176
|
+
for (let t of A) {
|
|
1771
2177
|
let n = new Date(t.key), r = `${n.getFullYear()}-${n.getMonth()}`;
|
|
1772
2178
|
e.has(r) || e.set(r, {
|
|
1773
|
-
label: n.toLocaleString(
|
|
2179
|
+
label: n.toLocaleString(E.dateLocale, {
|
|
1774
2180
|
month: "short",
|
|
1775
2181
|
year: "2-digit"
|
|
1776
2182
|
}),
|
|
@@ -1782,132 +2188,47 @@ function hn({ scrollRef: e, onScroll: t, onTaskClick: n, onMilestoneClick: c, dr
|
|
|
1782
2188
|
...t
|
|
1783
2189
|
}));
|
|
1784
2190
|
}, [
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
]),
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
]),
|
|
1793
|
-
count:
|
|
2191
|
+
C,
|
|
2192
|
+
A,
|
|
2193
|
+
E.dateLocale
|
|
2194
|
+
]), N = a(() => xn(O, k, j), [
|
|
2195
|
+
O,
|
|
2196
|
+
k,
|
|
2197
|
+
j
|
|
2198
|
+
]), P = a(() => p ? Jt(b) : /* @__PURE__ */ new Set(), [p, b]), F = we({
|
|
2199
|
+
count: O.length,
|
|
1794
2200
|
getScrollElement: () => e.current,
|
|
1795
2201
|
estimateSize: () => 40,
|
|
1796
2202
|
overscan: 5
|
|
1797
|
-
}),
|
|
1798
|
-
if (
|
|
2203
|
+
}), I = a(() => {
|
|
2204
|
+
if (C !== "days") return [];
|
|
1799
2205
|
let e = 0;
|
|
1800
|
-
return
|
|
2206
|
+
return A.flatMap((t) => {
|
|
1801
2207
|
let n = t.isWeekend ? [{
|
|
1802
2208
|
key: t.key,
|
|
1803
2209
|
left: e
|
|
1804
2210
|
}] : [];
|
|
1805
2211
|
return e += t.width, n;
|
|
1806
2212
|
});
|
|
1807
|
-
}, [
|
|
1808
|
-
let e = Date.now(), t =
|
|
1809
|
-
return e < t || e > n ? null : (e - t) / (n - t) *
|
|
1810
|
-
}, [
|
|
2213
|
+
}, [C, A]), L = a(() => {
|
|
2214
|
+
let e = Date.now(), t = k.start.getTime(), n = k.end.getTime();
|
|
2215
|
+
return e < t || e > n ? null : (e - t) / (n - t) * j;
|
|
2216
|
+
}, [k, j]);
|
|
1811
2217
|
r(() => {
|
|
1812
|
-
if (
|
|
2218
|
+
if (L === null || !e.current) return;
|
|
1813
2219
|
let t = e.current.clientWidth;
|
|
1814
|
-
e.current.scrollLeft = Math.max(0,
|
|
2220
|
+
e.current.scrollLeft = Math.max(0, L - t / 2);
|
|
1815
2221
|
}, []);
|
|
1816
|
-
let
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
let
|
|
1825
|
-
|
|
1826
|
-
let pe = (e, t, n) => {
|
|
1827
|
-
e.stopPropagation(), Y.current = !1, oe.current = {
|
|
1828
|
-
type: n,
|
|
1829
|
-
taskId: t.id,
|
|
1830
|
-
startX: e.clientX,
|
|
1831
|
-
originalStart: t.startDate,
|
|
1832
|
-
originalEnd: t.endDate
|
|
1833
|
-
}, document.body.style.cursor = n === "resize" ? "ew-resize" : "grabbing";
|
|
1834
|
-
let r = (e) => {
|
|
1835
|
-
let t = oe.current;
|
|
1836
|
-
if (!t || t.type === "progress") return;
|
|
1837
|
-
let n = e.clientX - t.startX, r = Math.round(n / ae.current);
|
|
1838
|
-
Math.abs(n) >= 5 && (Y.current = !0);
|
|
1839
|
-
let i = {
|
|
1840
|
-
taskId: t.taskId,
|
|
1841
|
-
type: t.type,
|
|
1842
|
-
deltaDays: r
|
|
1843
|
-
};
|
|
1844
|
-
se.current = i, ce(i);
|
|
1845
|
-
}, i = () => {
|
|
1846
|
-
document.body.style.cursor = "";
|
|
1847
|
-
let e = oe.current, t = se.current;
|
|
1848
|
-
if (e && t && Y.current && t.deltaDays !== 0) {
|
|
1849
|
-
let n = O.getState().tasks.find((t) => t.id === e.taskId);
|
|
1850
|
-
if (n) {
|
|
1851
|
-
if (t.type === "move") {
|
|
1852
|
-
let r = Rt(e.originalStart, t.deltaDays), i = Rt(e.originalEnd, t.deltaDays);
|
|
1853
|
-
D({
|
|
1854
|
-
...n,
|
|
1855
|
-
startDate: r,
|
|
1856
|
-
endDate: i
|
|
1857
|
-
}), ue.current?.(n, r, i);
|
|
1858
|
-
} else {
|
|
1859
|
-
let r = Rt(e.originalEnd, t.deltaDays), i = r > e.originalStart ? r : Rt(e.originalStart, 1);
|
|
1860
|
-
D({
|
|
1861
|
-
...n,
|
|
1862
|
-
endDate: i
|
|
1863
|
-
}), de.current?.(n, i);
|
|
1864
|
-
}
|
|
1865
|
-
fe.current?.(O.getState().tasks);
|
|
1866
|
-
}
|
|
1867
|
-
}
|
|
1868
|
-
oe.current = null, se.current = null, ce(null), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
|
|
1869
|
-
};
|
|
1870
|
-
document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
|
|
1871
|
-
}, me = (e, t, n, r) => {
|
|
1872
|
-
e.stopPropagation(), Y.current = !1, oe.current = {
|
|
1873
|
-
type: "progress",
|
|
1874
|
-
taskId: t.id,
|
|
1875
|
-
startX: e.clientX,
|
|
1876
|
-
originalStart: t.startDate,
|
|
1877
|
-
originalEnd: t.endDate,
|
|
1878
|
-
initialProgress: n,
|
|
1879
|
-
barWidthPx: r
|
|
1880
|
-
}, document.body.style.cursor = "ew-resize";
|
|
1881
|
-
let i = (e) => {
|
|
1882
|
-
let t = oe.current;
|
|
1883
|
-
if (!t || t.type !== "progress") return;
|
|
1884
|
-
let n = e.clientX - t.startX;
|
|
1885
|
-
Math.abs(n) >= 5 && (Y.current = !0);
|
|
1886
|
-
let r = n / (t.barWidthPx ?? 1) * 100, i = Math.round(Math.max(0, Math.min(100, (t.initialProgress ?? 0) + r))), a = {
|
|
1887
|
-
taskId: t.taskId,
|
|
1888
|
-
type: "progress",
|
|
1889
|
-
deltaDays: 0,
|
|
1890
|
-
newProgress: i
|
|
1891
|
-
};
|
|
1892
|
-
se.current = a, ce(a);
|
|
1893
|
-
}, a = () => {
|
|
1894
|
-
document.body.style.cursor = "";
|
|
1895
|
-
let e = oe.current, t = se.current;
|
|
1896
|
-
if (e && t && t.type === "progress" && t.newProgress !== void 0 && Y.current) {
|
|
1897
|
-
let n = O.getState().tasks.find((t) => t.id === e.taskId);
|
|
1898
|
-
n && (D({
|
|
1899
|
-
...n,
|
|
1900
|
-
progress: t.newProgress
|
|
1901
|
-
}), fe.current?.(O.getState().tasks));
|
|
1902
|
-
}
|
|
1903
|
-
oe.current = null, se.current = null, ce(null), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", a);
|
|
1904
|
-
};
|
|
1905
|
-
document.addEventListener("mousemove", i), document.addEventListener("mouseup", a);
|
|
1906
|
-
}, he = (e) => e.toLocaleDateString(k.dateLocale, {
|
|
1907
|
-
day: "2-digit",
|
|
1908
|
-
month: "short"
|
|
1909
|
-
});
|
|
1910
|
-
return /* @__PURE__ */ U(l, {
|
|
2222
|
+
let R = C === "days" ? 20 : C === "weeks" ? 40 : C === "quarters" ? 360 : 120, z = M ? 80 : 40, { activeDrag: B, suppressClickRef: V, handleBarMouseDown: G, handleProgressMouseDown: K, formatDragDate: q } = dn({
|
|
2223
|
+
totalWidth: j,
|
|
2224
|
+
displayRange: k,
|
|
2225
|
+
onTaskMoved: h,
|
|
2226
|
+
onTaskResized: g,
|
|
2227
|
+
onTasksChange: _
|
|
2228
|
+
}), [J, ee] = s(null), te = o(v);
|
|
2229
|
+
te.current = v;
|
|
2230
|
+
let ne = o(_);
|
|
2231
|
+
return ne.current = _, /* @__PURE__ */ U(l, {
|
|
1911
2232
|
ref: e,
|
|
1912
2233
|
onScroll: t,
|
|
1913
2234
|
"data-testid": "gantt-timeline-scroll",
|
|
@@ -1917,293 +2238,88 @@ function hn({ scrollRef: e, onScroll: t, onTaskClick: n, onMilestoneClick: c, dr
|
|
|
1917
2238
|
},
|
|
1918
2239
|
children: /* @__PURE__ */ W(l, {
|
|
1919
2240
|
sx: {
|
|
1920
|
-
minWidth:
|
|
2241
|
+
minWidth: j,
|
|
1921
2242
|
position: "relative"
|
|
1922
2243
|
},
|
|
1923
2244
|
children: [
|
|
1924
|
-
/* @__PURE__ */ U(
|
|
1925
|
-
columns:
|
|
1926
|
-
groups:
|
|
2245
|
+
/* @__PURE__ */ U(pn, {
|
|
2246
|
+
columns: A,
|
|
2247
|
+
groups: M
|
|
1927
2248
|
}),
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
top: ie,
|
|
1934
|
-
left: 0,
|
|
1935
|
-
width: V,
|
|
1936
|
-
height: R.length * 40,
|
|
1937
|
-
pointerEvents: "none"
|
|
1938
|
-
},
|
|
1939
|
-
children: ne.map((e) => /* @__PURE__ */ U(l, { sx: {
|
|
1940
|
-
position: "absolute",
|
|
1941
|
-
left: e.left,
|
|
1942
|
-
width: 20,
|
|
1943
|
-
top: 0,
|
|
1944
|
-
height: "100%",
|
|
1945
|
-
bgcolor: P ?? "action.hover"
|
|
1946
|
-
} }, e.key))
|
|
2249
|
+
/* @__PURE__ */ U(vn, {
|
|
2250
|
+
strips: I,
|
|
2251
|
+
totalWidth: j,
|
|
2252
|
+
height: O.length * 40,
|
|
2253
|
+
top: z
|
|
1947
2254
|
}),
|
|
1948
|
-
(
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
...e,
|
|
1953
|
-
startDate: Rt(e.startDate, J.deltaDays),
|
|
1954
|
-
endDate: Rt(e.endDate, J.deltaDays)
|
|
1955
|
-
};
|
|
1956
|
-
else if (J.type === "resize") {
|
|
1957
|
-
let t = Rt(e.endDate, J.deltaDays);
|
|
1958
|
-
a = {
|
|
1959
|
-
...e,
|
|
1960
|
-
endDate: t > e.startDate ? t : Rt(e.startDate, 1)
|
|
1961
|
-
};
|
|
1962
|
-
} else J.type === "progress" && J.newProgress !== void 0 && (a = {
|
|
1963
|
-
...e,
|
|
1964
|
-
progress: J.newProgress
|
|
1965
|
-
});
|
|
1966
|
-
let { left: o, width: s } = jt(a, z);
|
|
1967
|
-
return /* @__PURE__ */ U(l, {
|
|
1968
|
-
"data-testid": `gantt-bar-row-${e.id}`,
|
|
1969
|
-
style: r === void 0 ? void 0 : {
|
|
1970
|
-
position: "absolute",
|
|
1971
|
-
top: r,
|
|
1972
|
-
left: 0,
|
|
1973
|
-
width: "100%"
|
|
1974
|
-
},
|
|
1975
|
-
sx: {
|
|
1976
|
-
height: 40,
|
|
1977
|
-
position: "relative",
|
|
1978
|
-
borderBottom: "1px solid",
|
|
1979
|
-
borderColor: "divider",
|
|
1980
|
-
backgroundImage: (e) => `linear-gradient(to right, transparent calc(${re}px - 1px), ${e.palette.divider} calc(${re}px - 1px), ${e.palette.divider} ${re}px)`,
|
|
1981
|
-
backgroundSize: `${re}px 100%`,
|
|
1982
|
-
backgroundRepeat: "repeat-x"
|
|
1983
|
-
},
|
|
1984
|
-
children: e.isMilestone ? o >= 0 && o <= 100 ? /* @__PURE__ */ U(l, {
|
|
1985
|
-
"data-testid": `gantt-milestone-${e.id}`,
|
|
1986
|
-
sx: {
|
|
1987
|
-
position: "absolute",
|
|
1988
|
-
left: `${o}%`,
|
|
1989
|
-
top: "50%",
|
|
1990
|
-
width: 12,
|
|
1991
|
-
height: 12,
|
|
1992
|
-
bgcolor: M ?? "warning.main",
|
|
1993
|
-
transform: "translate(-50%, -50%) rotate(45deg)",
|
|
1994
|
-
cursor: c ? "pointer" : "default",
|
|
1995
|
-
boxShadow: ee.has(e.id) ? `0 0 0 2.5px ${j ?? y.palette.error.main}` : void 0,
|
|
1996
|
-
"&:hover": c ? { opacity: .8 } : void 0
|
|
1997
|
-
},
|
|
1998
|
-
onClick: () => c?.(e)
|
|
1999
|
-
}) : null : (() => {
|
|
2000
|
-
let t = Math.max(0, o), r = Math.min(100, o + Math.max(s, .5)) - t;
|
|
2001
|
-
return r <= 0 ? null : /* @__PURE__ */ W(H, { children: [
|
|
2002
|
-
i && J && J.type !== "progress" && J.deltaDays !== 0 && /* @__PURE__ */ U(l, {
|
|
2003
|
-
sx: {
|
|
2004
|
-
position: "absolute",
|
|
2005
|
-
left: `${t}%`,
|
|
2006
|
-
top: 2,
|
|
2007
|
-
bgcolor: "grey.800",
|
|
2008
|
-
color: "common.white",
|
|
2009
|
-
borderRadius: .5,
|
|
2010
|
-
px: .75,
|
|
2011
|
-
lineHeight: "18px",
|
|
2012
|
-
fontSize: "0.65rem",
|
|
2013
|
-
whiteSpace: "nowrap",
|
|
2014
|
-
pointerEvents: "none",
|
|
2015
|
-
zIndex: 100
|
|
2016
|
-
},
|
|
2017
|
-
children: J.type === "move" ? `${he(a.startDate)} – ${he(a.endDate)}` : `→ ${he(a.endDate)}`
|
|
2018
|
-
}),
|
|
2019
|
-
i && J?.type === "progress" && J.newProgress !== void 0 && /* @__PURE__ */ W(l, {
|
|
2020
|
-
sx: {
|
|
2021
|
-
position: "absolute",
|
|
2022
|
-
left: `${t}%`,
|
|
2023
|
-
top: 2,
|
|
2024
|
-
bgcolor: "grey.800",
|
|
2025
|
-
color: "common.white",
|
|
2026
|
-
borderRadius: .5,
|
|
2027
|
-
px: .75,
|
|
2028
|
-
lineHeight: "18px",
|
|
2029
|
-
fontSize: "0.65rem",
|
|
2030
|
-
whiteSpace: "nowrap",
|
|
2031
|
-
pointerEvents: "none",
|
|
2032
|
-
zIndex: 100
|
|
2033
|
-
},
|
|
2034
|
-
children: [J.newProgress, "%"]
|
|
2035
|
-
}),
|
|
2036
|
-
/* @__PURE__ */ W(l, {
|
|
2037
|
-
"data-testid": `gantt-bar-${e.id}`,
|
|
2038
|
-
sx: {
|
|
2039
|
-
position: "absolute",
|
|
2040
|
-
left: `${t}%`,
|
|
2041
|
-
width: `${r}%`,
|
|
2042
|
-
height: 16,
|
|
2043
|
-
top: "50%",
|
|
2044
|
-
transform: "translateY(-50%)",
|
|
2045
|
-
bgcolor: e.color ?? A?.[e.status] ?? fn[e.status] ?? "grey.300",
|
|
2046
|
-
borderRadius: F === void 0 ? 1 : `${F}px`,
|
|
2047
|
-
overflow: "hidden",
|
|
2048
|
-
opacity: i ? .75 : 1,
|
|
2049
|
-
boxShadow: ee.has(e.id) ? `inset 0 0 0 2.5px ${j ?? y.palette.error.main}` : void 0,
|
|
2050
|
-
cursor: i ? "grabbing" : u ? "grab" : n ? "pointer" : "default",
|
|
2051
|
-
userSelect: "none",
|
|
2052
|
-
"&:hover": u || n ? { opacity: i ? .75 : .8 } : void 0
|
|
2053
|
-
},
|
|
2054
|
-
onMouseDown: u ? (t) => pe(t, e, "move") : void 0,
|
|
2055
|
-
onContextMenu: (t) => {
|
|
2056
|
-
t.preventDefault(), t.stopPropagation(), le({
|
|
2057
|
-
task: e,
|
|
2058
|
-
mouseX: t.clientX,
|
|
2059
|
-
mouseY: t.clientY
|
|
2060
|
-
});
|
|
2061
|
-
},
|
|
2062
|
-
onClick: () => {
|
|
2063
|
-
if (Y.current) {
|
|
2064
|
-
Y.current = !1;
|
|
2065
|
-
return;
|
|
2066
|
-
}
|
|
2067
|
-
n?.(e);
|
|
2068
|
-
},
|
|
2069
|
-
children: [
|
|
2070
|
-
a.progress !== void 0 && a.progress > 0 && /* @__PURE__ */ U(l, {
|
|
2071
|
-
"data-testid": `gantt-progress-${e.id}`,
|
|
2072
|
-
sx: {
|
|
2073
|
-
position: "absolute",
|
|
2074
|
-
left: 0,
|
|
2075
|
-
top: 0,
|
|
2076
|
-
width: `${Math.min(a.progress, 100)}%`,
|
|
2077
|
-
height: "100%",
|
|
2078
|
-
bgcolor: "currentColor",
|
|
2079
|
-
opacity: .4
|
|
2080
|
-
}
|
|
2081
|
-
}),
|
|
2082
|
-
f && /* @__PURE__ */ U(l, {
|
|
2083
|
-
"data-testid": `gantt-progress-handle-${e.id}`,
|
|
2084
|
-
sx: {
|
|
2085
|
-
position: "absolute",
|
|
2086
|
-
left: `${Math.min(a.progress ?? 0, 100)}%`,
|
|
2087
|
-
top: 0,
|
|
2088
|
-
width: 6,
|
|
2089
|
-
height: "100%",
|
|
2090
|
-
transform: "translateX(-50%)",
|
|
2091
|
-
cursor: "ew-resize",
|
|
2092
|
-
bgcolor: "rgba(255,255,255,0.35)"
|
|
2093
|
-
},
|
|
2094
|
-
onMouseDown: (t) => {
|
|
2095
|
-
t.stopPropagation();
|
|
2096
|
-
let n = r / 100 * V;
|
|
2097
|
-
me(t, e, a.progress ?? 0, n);
|
|
2098
|
-
}
|
|
2099
|
-
}),
|
|
2100
|
-
d && /* @__PURE__ */ U(l, {
|
|
2101
|
-
"data-testid": `gantt-resize-handle-${e.id}`,
|
|
2102
|
-
sx: {
|
|
2103
|
-
position: "absolute",
|
|
2104
|
-
right: 0,
|
|
2105
|
-
top: 0,
|
|
2106
|
-
width: 6,
|
|
2107
|
-
height: "100%",
|
|
2108
|
-
cursor: "ew-resize"
|
|
2109
|
-
},
|
|
2110
|
-
onMouseDown: (t) => {
|
|
2111
|
-
t.stopPropagation(), pe(t, e, "resize");
|
|
2112
|
-
}
|
|
2113
|
-
})
|
|
2114
|
-
]
|
|
2115
|
-
})
|
|
2116
|
-
] });
|
|
2117
|
-
})()
|
|
2118
|
-
}, t);
|
|
2119
|
-
};
|
|
2120
|
-
return m ? /* @__PURE__ */ U(l, {
|
|
2121
|
-
sx: {
|
|
2122
|
-
position: "relative",
|
|
2123
|
-
height: te.getTotalSize()
|
|
2124
|
-
},
|
|
2125
|
-
children: te.getVirtualItems().map((t) => e(R[t.index], t.key, t.start))
|
|
2126
|
-
}) : /* @__PURE__ */ U(H, { children: R.map((t) => e(t, t.id)) });
|
|
2127
|
-
})(),
|
|
2128
|
-
/* @__PURE__ */ U(T, {
|
|
2129
|
-
open: X !== null,
|
|
2130
|
-
onClose: () => le(null),
|
|
2131
|
-
anchorReference: "anchorPosition",
|
|
2132
|
-
anchorPosition: X === null ? void 0 : {
|
|
2133
|
-
top: X.mouseY,
|
|
2134
|
-
left: X.mouseX
|
|
2255
|
+
m ? /* @__PURE__ */ U(l, {
|
|
2256
|
+
sx: {
|
|
2257
|
+
position: "relative",
|
|
2258
|
+
height: F.getTotalSize()
|
|
2135
2259
|
},
|
|
2136
|
-
children:
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2260
|
+
children: F.getVirtualItems().map((e) => /* @__PURE__ */ U(mn, {
|
|
2261
|
+
task: O[e.index],
|
|
2262
|
+
virtualTop: e.start,
|
|
2263
|
+
activeDrag: B,
|
|
2264
|
+
displayRange: k,
|
|
2265
|
+
totalWidth: j,
|
|
2266
|
+
gridColumnWidth: R,
|
|
2267
|
+
criticalTaskIds: P,
|
|
2268
|
+
draggable: u,
|
|
2269
|
+
resizable: d,
|
|
2270
|
+
progressDraggable: f,
|
|
2271
|
+
onTaskClick: n,
|
|
2272
|
+
onMilestoneClick: c,
|
|
2273
|
+
onContextMenu: (e, t, n) => ee({
|
|
2274
|
+
task: e,
|
|
2275
|
+
mouseX: t,
|
|
2276
|
+
mouseY: n
|
|
2277
|
+
}),
|
|
2278
|
+
suppressClickRef: V,
|
|
2279
|
+
handleBarMouseDown: G,
|
|
2280
|
+
handleProgressMouseDown: K,
|
|
2281
|
+
formatDragDate: q
|
|
2282
|
+
}, e.key))
|
|
2283
|
+
}) : /* @__PURE__ */ U(H, { children: O.map((e) => /* @__PURE__ */ U(mn, {
|
|
2284
|
+
task: e,
|
|
2285
|
+
activeDrag: B,
|
|
2286
|
+
displayRange: k,
|
|
2287
|
+
totalWidth: j,
|
|
2288
|
+
gridColumnWidth: R,
|
|
2289
|
+
criticalTaskIds: P,
|
|
2290
|
+
draggable: u,
|
|
2291
|
+
resizable: d,
|
|
2292
|
+
progressDraggable: f,
|
|
2293
|
+
onTaskClick: n,
|
|
2294
|
+
onMilestoneClick: c,
|
|
2295
|
+
onContextMenu: (e, t, n) => ee({
|
|
2296
|
+
task: e,
|
|
2297
|
+
mouseX: t,
|
|
2298
|
+
mouseY: n
|
|
2299
|
+
}),
|
|
2300
|
+
suppressClickRef: V,
|
|
2301
|
+
handleBarMouseDown: G,
|
|
2302
|
+
handleProgressMouseDown: K,
|
|
2303
|
+
formatDragDate: q
|
|
2304
|
+
}, e.id)) }),
|
|
2305
|
+
/* @__PURE__ */ U(yn, {
|
|
2306
|
+
contextMenu: J,
|
|
2307
|
+
onClose: () => ee(null),
|
|
2308
|
+
onSelect: (e, t) => {
|
|
2309
|
+
let n = T.getState().tasks.find((t) => t.id === e.id) ?? e;
|
|
2310
|
+
w({
|
|
2311
|
+
...n,
|
|
2312
|
+
status: t
|
|
2313
|
+
}), te.current?.(n, t), ne.current?.(T.getState().tasks), ee(null);
|
|
2314
|
+
}
|
|
2162
2315
|
}),
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
height: R.length * 40,
|
|
2171
|
-
pointerEvents: "none",
|
|
2172
|
-
overflow: "visible"
|
|
2173
|
-
},
|
|
2174
|
-
children: [
|
|
2175
|
-
K.length > 0 && /* @__PURE__ */ U("defs", { children: /* @__PURE__ */ U("marker", {
|
|
2176
|
-
id: I,
|
|
2177
|
-
markerWidth: "6",
|
|
2178
|
-
markerHeight: "4",
|
|
2179
|
-
refX: "5",
|
|
2180
|
-
refY: "2",
|
|
2181
|
-
orient: "auto",
|
|
2182
|
-
children: /* @__PURE__ */ U("polygon", {
|
|
2183
|
-
points: "0 0, 6 2, 0 4",
|
|
2184
|
-
fill: "currentColor"
|
|
2185
|
-
})
|
|
2186
|
-
}) }),
|
|
2187
|
-
K.map((e) => /* @__PURE__ */ U("path", {
|
|
2188
|
-
"data-testid": `gantt-dep-${e.key}`,
|
|
2189
|
-
d: e.d,
|
|
2190
|
-
fill: "none",
|
|
2191
|
-
stroke: "currentColor",
|
|
2192
|
-
strokeWidth: 1.5,
|
|
2193
|
-
strokeOpacity: .4,
|
|
2194
|
-
markerEnd: `url(#${I})`
|
|
2195
|
-
}, e.key)),
|
|
2196
|
-
q !== null && /* @__PURE__ */ U("line", {
|
|
2197
|
-
"data-testid": "gantt-today-line",
|
|
2198
|
-
x1: q,
|
|
2199
|
-
y1: 0,
|
|
2200
|
-
x2: q,
|
|
2201
|
-
y2: R.length * 40,
|
|
2202
|
-
stroke: N ?? y.palette.primary.main,
|
|
2203
|
-
strokeWidth: 1.5,
|
|
2204
|
-
strokeDasharray: "4 2"
|
|
2205
|
-
})
|
|
2206
|
-
]
|
|
2316
|
+
/* @__PURE__ */ U(bn, {
|
|
2317
|
+
dependencyLines: N,
|
|
2318
|
+
todayX: L,
|
|
2319
|
+
totalWidth: j,
|
|
2320
|
+
height: O.length * 40,
|
|
2321
|
+
top: z,
|
|
2322
|
+
arrowMarkerId: D
|
|
2207
2323
|
})
|
|
2208
2324
|
]
|
|
2209
2325
|
})
|
|
@@ -2211,15 +2327,15 @@ function hn({ scrollRef: e, onScroll: t, onTaskClick: n, onMilestoneClick: c, dr
|
|
|
2211
2327
|
}
|
|
2212
2328
|
//#endregion
|
|
2213
2329
|
//#region src/components/gantt-chart/GanttToolbar.tsx
|
|
2214
|
-
function
|
|
2330
|
+
function Cn(e) {
|
|
2215
2331
|
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
2216
2332
|
}
|
|
2217
|
-
function
|
|
2333
|
+
function wn(e) {
|
|
2218
2334
|
let [t, n, r] = e.split("-").map(Number);
|
|
2219
2335
|
return !t || !n || !r ? null : new Date(t, n - 1, r, 0, 0, 0, 0);
|
|
2220
2336
|
}
|
|
2221
|
-
function
|
|
2222
|
-
let n =
|
|
2337
|
+
function Tn({ onScrollToToday: e, config: t }) {
|
|
2338
|
+
let n = $(), r = Q((e) => e.timeScale), i = Q((e) => e.defaultTimeScale), o = Q((e) => e.setTimeScale), s = Q((e) => e.timelineRange), c = Q((e) => e.isRangeCustomized), u = Q((e) => e.isExpandedCustomized), d = Q((e) => e.setTimelineRange), f = Q((e) => e.resetTimelineRange), p = Q((e) => e.resetView), m = Q((e) => e.tasks), h = Q((e) => e.expandedIds), g = Q((e) => e.expandAll), _ = Q((e) => e.collapseAll), v = m.length > 0 && m.every((e) => h.has(e.id)), y = r !== i || c || u, b = a(() => Date.now(), []), x = b >= s.start.getTime() && b <= s.end.getTime(), C = {
|
|
2223
2339
|
days: n.scaleDays,
|
|
2224
2340
|
weeks: n.scaleWeeks,
|
|
2225
2341
|
months: n.scaleMonths,
|
|
@@ -2270,7 +2386,7 @@ function vn({ onScrollToToday: e, config: t }) {
|
|
|
2270
2386
|
size: "small",
|
|
2271
2387
|
onClick: v ? _ : g,
|
|
2272
2388
|
"data-testid": "gantt-expand-collapse-all",
|
|
2273
|
-
children: U(v ?
|
|
2389
|
+
children: U(v ? Ae : je, { fontSize: "small" })
|
|
2274
2390
|
})
|
|
2275
2391
|
}),
|
|
2276
2392
|
t.showScrollToToday && e && /* @__PURE__ */ U(F, {
|
|
@@ -2280,16 +2396,16 @@ function vn({ onScrollToToday: e, config: t }) {
|
|
|
2280
2396
|
onClick: e,
|
|
2281
2397
|
disabled: !x,
|
|
2282
2398
|
"data-testid": "gantt-scroll-to-today",
|
|
2283
|
-
children: /* @__PURE__ */ U(
|
|
2399
|
+
children: /* @__PURE__ */ U(ke, { fontSize: "small" })
|
|
2284
2400
|
}) })
|
|
2285
2401
|
}),
|
|
2286
2402
|
t.showDateRange && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(M, {
|
|
2287
2403
|
type: "date",
|
|
2288
2404
|
size: "small",
|
|
2289
2405
|
label: n.rangeFrom,
|
|
2290
|
-
value:
|
|
2406
|
+
value: Cn(s.start),
|
|
2291
2407
|
onChange: (e) => {
|
|
2292
|
-
let t =
|
|
2408
|
+
let t = wn(e.target.value);
|
|
2293
2409
|
t && d({
|
|
2294
2410
|
start: t,
|
|
2295
2411
|
end: s.end
|
|
@@ -2304,9 +2420,9 @@ function vn({ onScrollToToday: e, config: t }) {
|
|
|
2304
2420
|
type: "date",
|
|
2305
2421
|
size: "small",
|
|
2306
2422
|
label: n.rangeTo,
|
|
2307
|
-
value:
|
|
2423
|
+
value: Cn(s.end),
|
|
2308
2424
|
onChange: (e) => {
|
|
2309
|
-
let t =
|
|
2425
|
+
let t = wn(e.target.value);
|
|
2310
2426
|
t && d({
|
|
2311
2427
|
start: s.start,
|
|
2312
2428
|
end: t
|
|
@@ -2324,7 +2440,7 @@ function vn({ onScrollToToday: e, config: t }) {
|
|
|
2324
2440
|
size: "small",
|
|
2325
2441
|
onClick: f,
|
|
2326
2442
|
"data-testid": "gantt-range-reset",
|
|
2327
|
-
children: /* @__PURE__ */ U(
|
|
2443
|
+
children: /* @__PURE__ */ U(Oe, { fontSize: "small" })
|
|
2328
2444
|
})
|
|
2329
2445
|
}),
|
|
2330
2446
|
t.showResetView && /* @__PURE__ */ U(F, {
|
|
@@ -2334,7 +2450,7 @@ function vn({ onScrollToToday: e, config: t }) {
|
|
|
2334
2450
|
onClick: p,
|
|
2335
2451
|
disabled: !y,
|
|
2336
2452
|
"data-testid": "gantt-reset-view",
|
|
2337
|
-
children: /* @__PURE__ */ U(
|
|
2453
|
+
children: /* @__PURE__ */ U(De, { fontSize: "small" })
|
|
2338
2454
|
}) })
|
|
2339
2455
|
})
|
|
2340
2456
|
]
|
|
@@ -2343,34 +2459,34 @@ function vn({ onScrollToToday: e, config: t }) {
|
|
|
2343
2459
|
}
|
|
2344
2460
|
//#endregion
|
|
2345
2461
|
//#region src/components/gantt-chart/GanttChart.tsx
|
|
2346
|
-
var
|
|
2462
|
+
var En = e(null);
|
|
2347
2463
|
function Q(e) {
|
|
2348
|
-
let t = n(
|
|
2464
|
+
let t = n(En);
|
|
2349
2465
|
if (!t) throw Error("GanttChartStoreContext is missing.");
|
|
2350
|
-
return
|
|
2466
|
+
return Se(t, e);
|
|
2351
2467
|
}
|
|
2352
|
-
function
|
|
2353
|
-
let e = n(
|
|
2468
|
+
function Dn() {
|
|
2469
|
+
let e = n(En);
|
|
2354
2470
|
if (!e) throw Error("GanttChartStoreContext is missing.");
|
|
2355
2471
|
return e;
|
|
2356
2472
|
}
|
|
2357
|
-
var
|
|
2358
|
-
function
|
|
2359
|
-
return n(
|
|
2473
|
+
var On = e(Zt);
|
|
2474
|
+
function $() {
|
|
2475
|
+
return n(On);
|
|
2360
2476
|
}
|
|
2361
|
-
var
|
|
2362
|
-
function
|
|
2363
|
-
return n(
|
|
2477
|
+
var kn = e({});
|
|
2478
|
+
function An() {
|
|
2479
|
+
return n(kn);
|
|
2364
2480
|
}
|
|
2365
|
-
function
|
|
2481
|
+
function jn(e, t) {
|
|
2366
2482
|
return e === void 0 ? t : e === "auto" ? "100%" : typeof e == "string" && /^\d+$/.test(e) ? Number(e) : e;
|
|
2367
2483
|
}
|
|
2368
|
-
var
|
|
2484
|
+
var Mn = [
|
|
2369
2485
|
"days",
|
|
2370
2486
|
"weeks",
|
|
2371
2487
|
"months",
|
|
2372
2488
|
"quarters"
|
|
2373
|
-
],
|
|
2489
|
+
], Nn = {
|
|
2374
2490
|
showScaleDays: !0,
|
|
2375
2491
|
showScaleWeeks: !0,
|
|
2376
2492
|
showScaleMonths: !0,
|
|
@@ -2381,21 +2497,21 @@ var En = [
|
|
|
2381
2497
|
showRangeReset: !0,
|
|
2382
2498
|
showResetView: !0
|
|
2383
2499
|
};
|
|
2384
|
-
function
|
|
2385
|
-
let N =
|
|
2386
|
-
...
|
|
2500
|
+
function Pn({ tasks: e, onTaskClick: n, onMilestoneClick: i, onAddTask: c, onEditTask: u, onDeleteTask: d, onStatusChange: f, onTasksChange: p, enableBuiltinDialogs: m = !0, onTaskCreated: h, onTaskUpdated: g, onTaskDeleted: _, showToolbar: v = !0, toolbarConfig: y, height: b, width: x, minPanelWidth: S = 200, maxPanelWidth: C = 600, zoomable: w = !1, draggable: T = !1, resizable: E = !1, inlineEdit: D = !1, progressDraggable: O = !1, showCriticalPath: k = !1, virtualizeRows: A = !1, onTaskMoved: j, onTaskResized: M }) {
|
|
2501
|
+
let N = jn(b, 400), P = a(() => ({
|
|
2502
|
+
...Nn,
|
|
2387
2503
|
...y
|
|
2388
|
-
}), [y]), F =
|
|
2504
|
+
}), [y]), F = jn(x, "100%"), I = Q((e) => e.setTasks), L = Q((e) => e.timeScale), R = Q((e) => e.setTimeScale), z = Q((e) => e.timelineRange), B = o(null), V = o(null), H = o(!1), [G, K] = s(320);
|
|
2389
2505
|
r(() => {
|
|
2390
2506
|
I(e);
|
|
2391
2507
|
}, [e, I]);
|
|
2392
|
-
let
|
|
2508
|
+
let q = () => {
|
|
2393
2509
|
H.current ||= (H.current = !0, V.current && B.current && (V.current.scrollTop = B.current.scrollTop), !1);
|
|
2394
|
-
},
|
|
2510
|
+
}, J = () => {
|
|
2395
2511
|
H.current ||= (H.current = !0, B.current && V.current && (B.current.scrollTop = V.current.scrollTop), !1);
|
|
2396
|
-
},
|
|
2512
|
+
}, ee = t(() => {
|
|
2397
2513
|
if (!V.current) return;
|
|
2398
|
-
let e =
|
|
2514
|
+
let e = jt(z, L), t = Date.now(), n = e.start.getTime(), r = e.end.getTime(), i = (t - n) / (r - n) * V.current.scrollWidth;
|
|
2399
2515
|
V.current.scrollLeft = Math.max(0, i - V.current.clientWidth / 2);
|
|
2400
2516
|
}, [z, L]);
|
|
2401
2517
|
r(() => {
|
|
@@ -2403,8 +2519,8 @@ function On({ tasks: e, onTaskClick: n, onMilestoneClick: i, onAddTask: c, onEdi
|
|
|
2403
2519
|
let e = V.current, t = (e) => {
|
|
2404
2520
|
if (!e.ctrlKey) return;
|
|
2405
2521
|
e.preventDefault();
|
|
2406
|
-
let t =
|
|
2407
|
-
e.deltaY < 0 && t > 0 ? R(
|
|
2522
|
+
let t = Mn.indexOf(L);
|
|
2523
|
+
e.deltaY < 0 && t > 0 ? R(Mn[t - 1]) : e.deltaY > 0 && t < Mn.length - 1 && R(Mn[t + 1]);
|
|
2408
2524
|
};
|
|
2409
2525
|
return e.addEventListener("wheel", t, { passive: !1 }), () => e.removeEventListener("wheel", t);
|
|
2410
2526
|
}, [
|
|
@@ -2412,7 +2528,7 @@ function On({ tasks: e, onTaskClick: n, onMilestoneClick: i, onAddTask: c, onEdi
|
|
|
2412
2528
|
L,
|
|
2413
2529
|
R
|
|
2414
2530
|
]);
|
|
2415
|
-
let
|
|
2531
|
+
let te = t((e) => {
|
|
2416
2532
|
e.preventDefault();
|
|
2417
2533
|
let t = e.clientX, n = G, r = (e) => {
|
|
2418
2534
|
let r = e.clientX - t;
|
|
@@ -2437,8 +2553,8 @@ function On({ tasks: e, onTaskClick: n, onMilestoneClick: i, onAddTask: c, onEdi
|
|
|
2437
2553
|
borderRadius: 1,
|
|
2438
2554
|
overflow: "hidden"
|
|
2439
2555
|
},
|
|
2440
|
-
children: [v && /* @__PURE__ */ U(
|
|
2441
|
-
onScrollToToday:
|
|
2556
|
+
children: [v && /* @__PURE__ */ U(Tn, {
|
|
2557
|
+
onScrollToToday: ee,
|
|
2442
2558
|
config: P
|
|
2443
2559
|
}), /* @__PURE__ */ W(l, {
|
|
2444
2560
|
sx: {
|
|
@@ -2449,7 +2565,7 @@ function On({ tasks: e, onTaskClick: n, onMilestoneClick: i, onAddTask: c, onEdi
|
|
|
2449
2565
|
children: [
|
|
2450
2566
|
/* @__PURE__ */ U(ln, {
|
|
2451
2567
|
scrollRef: B,
|
|
2452
|
-
onScroll:
|
|
2568
|
+
onScroll: q,
|
|
2453
2569
|
panelWidth: G,
|
|
2454
2570
|
onTaskClick: n,
|
|
2455
2571
|
onAddTask: c,
|
|
@@ -2473,11 +2589,11 @@ function On({ tasks: e, onTaskClick: n, onMilestoneClick: i, onAddTask: c, onEdi
|
|
|
2473
2589
|
cursor: "col-resize",
|
|
2474
2590
|
"&:hover": { bgcolor: "action.hover" }
|
|
2475
2591
|
},
|
|
2476
|
-
onMouseDown:
|
|
2592
|
+
onMouseDown: te
|
|
2477
2593
|
}),
|
|
2478
|
-
/* @__PURE__ */ U(
|
|
2594
|
+
/* @__PURE__ */ U(Sn, {
|
|
2479
2595
|
scrollRef: V,
|
|
2480
|
-
onScroll:
|
|
2596
|
+
onScroll: J,
|
|
2481
2597
|
onTaskClick: n,
|
|
2482
2598
|
onMilestoneClick: i,
|
|
2483
2599
|
draggable: T,
|
|
@@ -2494,13 +2610,13 @@ function On({ tasks: e, onTaskClick: n, onMilestoneClick: i, onAddTask: c, onEdi
|
|
|
2494
2610
|
})]
|
|
2495
2611
|
});
|
|
2496
2612
|
}
|
|
2497
|
-
function
|
|
2613
|
+
function Fn({ tasks: e, timeScale: t = "months", initialExpandAll: n = !1, showToolbar: r = !0, defaultRangeStart: i, defaultRangeEnd: o, translations: c, enableBuiltinDialogs: l = !0, toolbarConfig: u, zoomable: d = !1, draggable: f = !1, resizable: p = !1, inlineEdit: m = !1, progressDraggable: h = !1, showCriticalPath: g = !1, virtualizeRows: _ = !1, cascadeDependencies: v = !1, statusColors: y, ganttTheme: b, onTaskClick: x, onMilestoneClick: S, onAddTask: C, onEditTask: w, onDeleteTask: T, onStatusChange: E, onTasksChange: D, onTaskMoved: O, onTaskResized: k, onTaskCreated: A, onTaskUpdated: j, onTaskDeleted: M, height: N, width: P, minPanelWidth: F, maxPanelWidth: I }) {
|
|
2498
2614
|
let L = a(() => ({
|
|
2499
2615
|
...Zt,
|
|
2500
2616
|
...c
|
|
2501
2617
|
}), [c]), [R] = s(() => {
|
|
2502
2618
|
if (!(i !== void 0 || o !== void 0)) return Xt(e, t, n, void 0, v);
|
|
2503
|
-
let r =
|
|
2619
|
+
let r = At(e);
|
|
2504
2620
|
return Xt(e, t, n, {
|
|
2505
2621
|
start: i ?? r.start,
|
|
2506
2622
|
end: o ?? r.end
|
|
@@ -2512,13 +2628,13 @@ function kn({ tasks: e, timeScale: t = "months", initialExpandAll: n = !1, showT
|
|
|
2512
2628
|
...b?.statusColors
|
|
2513
2629
|
}
|
|
2514
2630
|
}), [y, b]);
|
|
2515
|
-
return /* @__PURE__ */ U(
|
|
2631
|
+
return /* @__PURE__ */ U(On.Provider, {
|
|
2516
2632
|
value: L,
|
|
2517
|
-
children: /* @__PURE__ */ U(
|
|
2633
|
+
children: /* @__PURE__ */ U(kn.Provider, {
|
|
2518
2634
|
value: z,
|
|
2519
|
-
children: /* @__PURE__ */ U(
|
|
2635
|
+
children: /* @__PURE__ */ U(En.Provider, {
|
|
2520
2636
|
value: R,
|
|
2521
|
-
children: /* @__PURE__ */ U(
|
|
2637
|
+
children: /* @__PURE__ */ U(Pn, {
|
|
2522
2638
|
tasks: e,
|
|
2523
2639
|
timeScale: t,
|
|
2524
2640
|
enableBuiltinDialogs: l,
|
|
@@ -2554,8 +2670,8 @@ function kn({ tasks: e, timeScale: t = "months", initialExpandAll: n = !1, showT
|
|
|
2554
2670
|
}
|
|
2555
2671
|
//#endregion
|
|
2556
2672
|
//#region src/components/password-strength-meter/util/password-strength.util.ts
|
|
2557
|
-
var
|
|
2558
|
-
function
|
|
2673
|
+
var In = (e) => Math.max(0, Math.min(4, Math.round(e)));
|
|
2674
|
+
function Ln(e, t) {
|
|
2559
2675
|
let n = e ?? "", r = n.length, i = /[a-z]/.test(n), a = /[A-Z]/.test(n), o = /\d/.test(n), s = /[^A-Za-z0-9]/.test(n), c = [
|
|
2560
2676
|
i,
|
|
2561
2677
|
a,
|
|
@@ -2577,7 +2693,7 @@ function jn(e, t) {
|
|
|
2577
2693
|
}
|
|
2578
2694
|
let l = 0;
|
|
2579
2695
|
l += 1, r >= t + 4 && (l += 1), c >= 2 && (l += 1), c >= 3 && (l += 1), /^(.)\1+$/.test(n) && (l -= 2), /1234|abcd|qwer|password|passwort|admin/i.test(n) && (l -= 2);
|
|
2580
|
-
let u =
|
|
2696
|
+
let u = In(l), d = u <= 1 ? "weak" : u === 2 ? "ok" : u === 3 ? "good" : "very good";
|
|
2581
2697
|
return {
|
|
2582
2698
|
score: u,
|
|
2583
2699
|
percent: u * 25,
|
|
@@ -2590,8 +2706,38 @@ function jn(e, t) {
|
|
|
2590
2706
|
};
|
|
2591
2707
|
}
|
|
2592
2708
|
//#endregion
|
|
2709
|
+
//#region src/components/password-strength-meter/PasswordStrengthBar.tsx
|
|
2710
|
+
function Rn({ percent: e, color: t, ariaLabel: n }) {
|
|
2711
|
+
return /* @__PURE__ */ U(l, {
|
|
2712
|
+
role: "progressbar",
|
|
2713
|
+
"aria-label": n,
|
|
2714
|
+
"aria-valuenow": e,
|
|
2715
|
+
"aria-valuemin": 0,
|
|
2716
|
+
"aria-valuemax": 100,
|
|
2717
|
+
sx: {
|
|
2718
|
+
width: "100%",
|
|
2719
|
+
height: "8px",
|
|
2720
|
+
border: "1px solid",
|
|
2721
|
+
borderColor: "divider",
|
|
2722
|
+
borderRadius: "6px",
|
|
2723
|
+
mt: .5,
|
|
2724
|
+
display: "flex"
|
|
2725
|
+
},
|
|
2726
|
+
children: /* @__PURE__ */ U(l, {
|
|
2727
|
+
"data-testid": "psm-meter",
|
|
2728
|
+
sx: {
|
|
2729
|
+
height: "100%",
|
|
2730
|
+
width: `${e}%`,
|
|
2731
|
+
backgroundColor: t,
|
|
2732
|
+
borderRadius: "6px",
|
|
2733
|
+
transition: "width 0.2s ease-in-out"
|
|
2734
|
+
}
|
|
2735
|
+
})
|
|
2736
|
+
});
|
|
2737
|
+
}
|
|
2738
|
+
//#endregion
|
|
2593
2739
|
//#region src/components/password-strength-meter/PasswordStrengthMeter.types.ts
|
|
2594
|
-
var
|
|
2740
|
+
var zn = {
|
|
2595
2741
|
label: "Password",
|
|
2596
2742
|
summaryHeaderLabel: "Requirements for your password",
|
|
2597
2743
|
summaryMinChars: "At least {n} characters",
|
|
@@ -2602,18 +2748,18 @@ var Mn = {
|
|
|
2602
2748
|
showPasswordLabel: "Show password",
|
|
2603
2749
|
hidePasswordLabel: "Hide password",
|
|
2604
2750
|
meterAriaLabel: "Password strength"
|
|
2605
|
-
},
|
|
2751
|
+
}, Bn = {
|
|
2606
2752
|
weak: "#cc0000",
|
|
2607
2753
|
ok: "#fdc010",
|
|
2608
2754
|
good: "#8bc34a",
|
|
2609
2755
|
veryGood: "#43a047"
|
|
2610
|
-
},
|
|
2756
|
+
}, Vn = {
|
|
2611
2757
|
failure: "#cc0000",
|
|
2612
2758
|
success: "#43a047"
|
|
2613
2759
|
};
|
|
2614
2760
|
//#endregion
|
|
2615
2761
|
//#region src/components/password-strength-meter/PasswordStrengthMeter.tsx
|
|
2616
|
-
function
|
|
2762
|
+
function Hn({ label: e, fulfilled: t, checkColors: n }) {
|
|
2617
2763
|
return /* @__PURE__ */ W(j, {
|
|
2618
2764
|
direction: "row",
|
|
2619
2765
|
sx: {
|
|
@@ -2639,14 +2785,14 @@ function Fn({ label: e, fulfilled: t, checkColors: n }) {
|
|
|
2639
2785
|
})]
|
|
2640
2786
|
});
|
|
2641
2787
|
}
|
|
2642
|
-
function
|
|
2788
|
+
function Un({ value: e, name: t, inputRef: n, disabled: r = !1, error: o = !1, helperText: c, autoComplete: u, showPasswordAdornment: d = !0, showMeter: f = !0, showSummary: p = !0, inputSize: m = "medium", translation: h, meterColors: g, passwordMinLength: _ = 8, checkColors: v = Vn, onPasswordChange: b }) {
|
|
2643
2789
|
let T = {
|
|
2644
|
-
...
|
|
2790
|
+
...zn,
|
|
2645
2791
|
...h
|
|
2646
2792
|
}, E = {
|
|
2647
|
-
...
|
|
2793
|
+
...Bn,
|
|
2648
2794
|
...g
|
|
2649
|
-
}, O = `${i()}-password`, [k, A] = s(!1), [M, N] = s(""), P = e === void 0 ? M : e, F = a(() =>
|
|
2795
|
+
}, O = `${i()}-password`, [k, A] = s(!1), [M, N] = s(""), P = e === void 0 ? M : e, F = a(() => Ln(P, _), [P, _]);
|
|
2650
2796
|
return /* @__PURE__ */ W(j, { children: [
|
|
2651
2797
|
/* @__PURE__ */ W(y, {
|
|
2652
2798
|
variant: "outlined",
|
|
@@ -2666,7 +2812,7 @@ function In({ value: e, name: t, inputRef: n, disabled: r = !1, error: o = !1, h
|
|
|
2666
2812
|
value: P,
|
|
2667
2813
|
onChange: (t) => {
|
|
2668
2814
|
let n = t.target.value;
|
|
2669
|
-
e === void 0 && N(n), b && b(n,
|
|
2815
|
+
e === void 0 && N(n), b && b(n, Ln(n, _));
|
|
2670
2816
|
},
|
|
2671
2817
|
disabled: r,
|
|
2672
2818
|
inputRef: n,
|
|
@@ -2691,7 +2837,7 @@ function In({ value: e, name: t, inputRef: n, disabled: r = !1, error: o = !1, h
|
|
|
2691
2837
|
e.preventDefault();
|
|
2692
2838
|
},
|
|
2693
2839
|
edge: "end",
|
|
2694
|
-
children: U(k ?
|
|
2840
|
+
children: U(k ? Ne : Me, {})
|
|
2695
2841
|
})
|
|
2696
2842
|
}) : null,
|
|
2697
2843
|
label: T.label
|
|
@@ -2699,39 +2845,18 @@ function In({ value: e, name: t, inputRef: n, disabled: r = !1, error: o = !1, h
|
|
|
2699
2845
|
c && /* @__PURE__ */ U(x, { children: c })
|
|
2700
2846
|
]
|
|
2701
2847
|
}),
|
|
2702
|
-
f && /* @__PURE__ */ U(
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
border: "1px solid",
|
|
2712
|
-
borderColor: "divider",
|
|
2713
|
-
borderRadius: "6px",
|
|
2714
|
-
mt: .5,
|
|
2715
|
-
display: "flex"
|
|
2716
|
-
},
|
|
2717
|
-
children: /* @__PURE__ */ U(l, {
|
|
2718
|
-
"data-testid": "psm-meter",
|
|
2719
|
-
sx: {
|
|
2720
|
-
height: "100%",
|
|
2721
|
-
width: `${F.percent}%`,
|
|
2722
|
-
backgroundColor: ((e) => {
|
|
2723
|
-
switch (e.meterStatus) {
|
|
2724
|
-
case "weak": return E.weak;
|
|
2725
|
-
case "ok": return E.ok;
|
|
2726
|
-
case "good": return E.good;
|
|
2727
|
-
case "very good": return E.veryGood;
|
|
2728
|
-
default: return "transparent";
|
|
2729
|
-
}
|
|
2730
|
-
})(F),
|
|
2731
|
-
borderRadius: "6px",
|
|
2732
|
-
transition: "width 0.2s ease-in-out"
|
|
2848
|
+
f && /* @__PURE__ */ U(Rn, {
|
|
2849
|
+
percent: F.percent,
|
|
2850
|
+
color: ((e) => {
|
|
2851
|
+
switch (e.meterStatus) {
|
|
2852
|
+
case "weak": return E.weak;
|
|
2853
|
+
case "ok": return E.ok;
|
|
2854
|
+
case "good": return E.good;
|
|
2855
|
+
case "very good": return E.veryGood;
|
|
2856
|
+
default: return "transparent";
|
|
2733
2857
|
}
|
|
2734
|
-
})
|
|
2858
|
+
})(F),
|
|
2859
|
+
ariaLabel: T.meterAriaLabel
|
|
2735
2860
|
}),
|
|
2736
2861
|
p && /* @__PURE__ */ W(l, {
|
|
2737
2862
|
"data-testid": "psm-summary",
|
|
@@ -2753,17 +2878,17 @@ function In({ value: e, name: t, inputRef: n, disabled: r = !1, error: o = !1, h
|
|
|
2753
2878
|
children: [/* @__PURE__ */ W(j, {
|
|
2754
2879
|
direction: "column",
|
|
2755
2880
|
children: [
|
|
2756
|
-
/* @__PURE__ */ U(
|
|
2881
|
+
/* @__PURE__ */ U(Hn, {
|
|
2757
2882
|
label: T.summaryMinChars.replace("{n}", String(_)),
|
|
2758
2883
|
fulfilled: F.length >= _,
|
|
2759
2884
|
checkColors: v
|
|
2760
2885
|
}),
|
|
2761
|
-
/* @__PURE__ */ U(
|
|
2886
|
+
/* @__PURE__ */ U(Hn, {
|
|
2762
2887
|
label: T.summaryCapitalLetter,
|
|
2763
2888
|
fulfilled: F.hasUpper,
|
|
2764
2889
|
checkColors: v
|
|
2765
2890
|
}),
|
|
2766
|
-
/* @__PURE__ */ U(
|
|
2891
|
+
/* @__PURE__ */ U(Hn, {
|
|
2767
2892
|
label: T.summaryLowerCaseLetter,
|
|
2768
2893
|
fulfilled: F.hasLower,
|
|
2769
2894
|
checkColors: v
|
|
@@ -2771,11 +2896,11 @@ function In({ value: e, name: t, inputRef: n, disabled: r = !1, error: o = !1, h
|
|
|
2771
2896
|
]
|
|
2772
2897
|
}), /* @__PURE__ */ W(j, {
|
|
2773
2898
|
direction: "column",
|
|
2774
|
-
children: [/* @__PURE__ */ U(
|
|
2899
|
+
children: [/* @__PURE__ */ U(Hn, {
|
|
2775
2900
|
label: T.summaryNumber,
|
|
2776
2901
|
fulfilled: F.hasDigit,
|
|
2777
2902
|
checkColors: v
|
|
2778
|
-
}), /* @__PURE__ */ U(
|
|
2903
|
+
}), /* @__PURE__ */ U(Hn, {
|
|
2779
2904
|
label: T.summarySpecialChar,
|
|
2780
2905
|
fulfilled: F.hasSymbol,
|
|
2781
2906
|
checkColors: v
|
|
@@ -2787,8 +2912,8 @@ function In({ value: e, name: t, inputRef: n, disabled: r = !1, error: o = !1, h
|
|
|
2787
2912
|
}
|
|
2788
2913
|
//#endregion
|
|
2789
2914
|
//#region src/components/tag-selection/TagSelection.store.ts
|
|
2790
|
-
function
|
|
2791
|
-
return
|
|
2915
|
+
function Wn(e) {
|
|
2916
|
+
return Ce((t) => ({
|
|
2792
2917
|
tags: e,
|
|
2793
2918
|
searchValue: "",
|
|
2794
2919
|
setTags: (e) => {
|
|
@@ -2825,7 +2950,7 @@ function Ln(e) {
|
|
|
2825
2950
|
}
|
|
2826
2951
|
//#endregion
|
|
2827
2952
|
//#region src/components/tag-selection/TagSelectionAutocomplete.tsx
|
|
2828
|
-
var
|
|
2953
|
+
var Gn = [
|
|
2829
2954
|
"default",
|
|
2830
2955
|
"primary",
|
|
2831
2956
|
"secondary",
|
|
@@ -2834,7 +2959,7 @@ var Rn = [
|
|
|
2834
2959
|
"success",
|
|
2835
2960
|
"warning"
|
|
2836
2961
|
];
|
|
2837
|
-
function
|
|
2962
|
+
function Kn({ availableTags: e, searchValue: t, translation: n, onSearchChange: r, onTagSelect: i, onTagCreate: a, inputSize: o = "medium", chipSize: u = "medium", disabled: d = !1, loading: p = !1, isMaxReached: m = !1, allowCreate: h = !1, listboxMaxHeight: g }) {
|
|
2838
2963
|
let [_, v] = s("default"), [y, b] = s(!1), x = d || m, C = e.filter((e) => e.label.toLowerCase().includes(t.trim().toLowerCase())), w = h && t.trim() !== "" && C.length === 0, T = y && !w, E = () => {
|
|
2839
2964
|
a?.(t.trim(), _), v("default");
|
|
2840
2965
|
}, D = () => {
|
|
@@ -2890,14 +3015,14 @@ function zn({ availableTags: e, searchValue: t, translation: n, onSearchChange:
|
|
|
2890
3015
|
e.preventDefault();
|
|
2891
3016
|
},
|
|
2892
3017
|
onClick: E,
|
|
2893
|
-
children: /* @__PURE__ */ U(
|
|
3018
|
+
children: /* @__PURE__ */ U(ge, { fontSize: "small" })
|
|
2894
3019
|
}), /* @__PURE__ */ U(S, {
|
|
2895
3020
|
size: "small",
|
|
2896
3021
|
onMouseDown: (e) => {
|
|
2897
3022
|
e.preventDefault();
|
|
2898
3023
|
},
|
|
2899
3024
|
onClick: D,
|
|
2900
|
-
children: /* @__PURE__ */ U(
|
|
3025
|
+
children: /* @__PURE__ */ U(Pe, { fontSize: "small" })
|
|
2901
3026
|
})] }), e.slotProps?.input?.endAdornment] })
|
|
2902
3027
|
}
|
|
2903
3028
|
}
|
|
@@ -2933,7 +3058,7 @@ function zn({ availableTags: e, searchValue: t, translation: n, onSearchChange:
|
|
|
2933
3058
|
gap: .5,
|
|
2934
3059
|
alignItems: "center"
|
|
2935
3060
|
},
|
|
2936
|
-
children:
|
|
3061
|
+
children: Gn.map((e) => /* @__PURE__ */ U(f, {
|
|
2937
3062
|
size: u,
|
|
2938
3063
|
color: e,
|
|
2939
3064
|
label: e,
|
|
@@ -2946,7 +3071,7 @@ function zn({ availableTags: e, searchValue: t, translation: n, onSearchChange:
|
|
|
2946
3071
|
}
|
|
2947
3072
|
//#endregion
|
|
2948
3073
|
//#region src/components/tag-selection/TagSelectionChip.tsx
|
|
2949
|
-
function
|
|
3074
|
+
function qn({ tag: e, onDelete: t, onClick: n, chipSize: r = "medium", disabled: i = !1 }) {
|
|
2950
3075
|
let a = !!(e.foregroundColor || e.backgroundColor);
|
|
2951
3076
|
return /* @__PURE__ */ U(f, {
|
|
2952
3077
|
size: r,
|
|
@@ -2973,7 +3098,7 @@ function Bn({ tag: e, onDelete: t, onClick: n, chipSize: r = "medium", disabled:
|
|
|
2973
3098
|
}
|
|
2974
3099
|
//#endregion
|
|
2975
3100
|
//#region src/components/tag-selection/TagSelectionSelectedTags.tsx
|
|
2976
|
-
function
|
|
3101
|
+
function Jn({ selectedTags: e, translation: t, onTagDelete: n, showSelectedTagsLabel: r, chipSize: i = "medium", disabled: a = !1, maxVisibleChips: o, popoverPlacement: c = "bottom" }) {
|
|
2977
3102
|
let [u, d] = s(null), p = o === void 0 ? e : e.slice(0, o), m = o === void 0 ? [] : e.slice(o), h = !!u && m.length > 0, g = c === "top" ? {
|
|
2978
3103
|
vertical: "top",
|
|
2979
3104
|
horizontal: "left"
|
|
@@ -3003,7 +3128,7 @@ function Vn({ selectedTags: e, translation: t, onTagDelete: n, showSelectedTagsL
|
|
|
3003
3128
|
flexWrap: "wrap",
|
|
3004
3129
|
gap: 1
|
|
3005
3130
|
},
|
|
3006
|
-
children: [p.map((e) => /* @__PURE__ */ U(
|
|
3131
|
+
children: [p.map((e) => /* @__PURE__ */ U(qn, {
|
|
3007
3132
|
tag: e,
|
|
3008
3133
|
onDelete: n,
|
|
3009
3134
|
chipSize: i,
|
|
@@ -3028,7 +3153,7 @@ function Vn({ selectedTags: e, translation: t, onTagDelete: n, showSelectedTagsL
|
|
|
3028
3153
|
gap: .5,
|
|
3029
3154
|
maxWidth: 320
|
|
3030
3155
|
},
|
|
3031
|
-
children: m.map((e) => /* @__PURE__ */ U(
|
|
3156
|
+
children: m.map((e) => /* @__PURE__ */ U(qn, {
|
|
3032
3157
|
tag: e,
|
|
3033
3158
|
onDelete: a ? void 0 : n,
|
|
3034
3159
|
chipSize: i,
|
|
@@ -3041,7 +3166,7 @@ function Vn({ selectedTags: e, translation: t, onTagDelete: n, showSelectedTagsL
|
|
|
3041
3166
|
}
|
|
3042
3167
|
//#endregion
|
|
3043
3168
|
//#region src/components/tag-selection/TagSelection.types.ts
|
|
3044
|
-
var
|
|
3169
|
+
var Yn = {
|
|
3045
3170
|
selectedTagsLabel: "Selected tags",
|
|
3046
3171
|
autoCompleteLabel: "Search and add tags",
|
|
3047
3172
|
noSelectedTagsText: "No tags selected.",
|
|
@@ -3049,14 +3174,14 @@ var Hn = {
|
|
|
3049
3174
|
placeholder: "Type to search...",
|
|
3050
3175
|
loadingText: "Loading...",
|
|
3051
3176
|
maxTagsReachedText: "Maximum number of tags reached."
|
|
3052
|
-
},
|
|
3053
|
-
function
|
|
3054
|
-
let t = n(
|
|
3177
|
+
}, Xn = e(null);
|
|
3178
|
+
function Zn(e) {
|
|
3179
|
+
let t = n(Xn);
|
|
3055
3180
|
if (!t) throw Error("TagSelectionStoreContext is missing.");
|
|
3056
|
-
return
|
|
3181
|
+
return Se(t, e);
|
|
3057
3182
|
}
|
|
3058
|
-
function
|
|
3059
|
-
let S =
|
|
3183
|
+
function Qn({ tags: e, showSelectedTags: t = !0, showSelectedTagsLabel: n = !0, showAutoComplete: i = !0, inputSize: o = "medium", chipSize: s = "small", disabled: c = !1, loading: u = !1, maxTags: d, allowCreate: f = !1, maxVisibleChips: p, popoverPlacement: m = "bottom", listboxMaxHeight: h, translation: g, onTagSelect: _, onTagDelete: v, onTagsChange: y, onSearchChange: b, onTagCreate: x }) {
|
|
3184
|
+
let S = Zn((e) => e.tags), C = Zn((e) => e.searchValue), w = Zn((e) => e.setTags), T = Zn((e) => e.setSearchValue), E = Zn((e) => e.selectTag), D = Zn((e) => e.deleteTag), O = Zn((e) => e.addTag);
|
|
3060
3185
|
r(() => {
|
|
3061
3186
|
w(e);
|
|
3062
3187
|
}, [e, w]);
|
|
@@ -3065,7 +3190,7 @@ function Gn({ tags: e, showSelectedTags: t = !0, showSelectedTagsLabel: n = !0,
|
|
|
3065
3190
|
};
|
|
3066
3191
|
return /* @__PURE__ */ U(l, {
|
|
3067
3192
|
sx: { width: "100%" },
|
|
3068
|
-
children: /* @__PURE__ */ W(j, { children: [t && /* @__PURE__ */ U(
|
|
3193
|
+
children: /* @__PURE__ */ W(j, { children: [t && /* @__PURE__ */ U(Jn, {
|
|
3069
3194
|
selectedTags: k,
|
|
3070
3195
|
translation: g,
|
|
3071
3196
|
onTagDelete: (e) => {
|
|
@@ -3081,7 +3206,7 @@ function Gn({ tags: e, showSelectedTags: t = !0, showSelectedTagsLabel: n = !0,
|
|
|
3081
3206
|
disabled: c,
|
|
3082
3207
|
maxVisibleChips: p,
|
|
3083
3208
|
popoverPlacement: m
|
|
3084
|
-
}), i && /* @__PURE__ */ U(
|
|
3209
|
+
}), i && /* @__PURE__ */ U(Kn, {
|
|
3085
3210
|
availableTags: A,
|
|
3086
3211
|
searchValue: C,
|
|
3087
3212
|
translation: g,
|
|
@@ -3118,14 +3243,14 @@ function Gn({ tags: e, showSelectedTags: t = !0, showSelectedTagsLabel: n = !0,
|
|
|
3118
3243
|
})] })
|
|
3119
3244
|
});
|
|
3120
3245
|
}
|
|
3121
|
-
function
|
|
3246
|
+
function $n({ tags: e, showSelectedTags: t = !0, showSelectedTagsLabel: n = !0, showAutoComplete: r = !0, translation: i, inputSize: a = "medium", chipSize: o = "small", disabled: c = !1, loading: l = !1, maxTags: u, allowCreate: d = !1, maxVisibleChips: f, popoverPlacement: p = "bottom", listboxMaxHeight: m, onTagSelect: h, onTagDelete: g, onTagsChange: _, onSearchChange: v, onTagCreate: y }) {
|
|
3122
3247
|
let b = {
|
|
3123
|
-
...
|
|
3248
|
+
...Yn,
|
|
3124
3249
|
...i
|
|
3125
|
-
}, [x] = s(() =>
|
|
3126
|
-
return /* @__PURE__ */ U(
|
|
3250
|
+
}, [x] = s(() => Wn(e));
|
|
3251
|
+
return /* @__PURE__ */ U(Xn.Provider, {
|
|
3127
3252
|
value: x,
|
|
3128
|
-
children: /* @__PURE__ */ U(
|
|
3253
|
+
children: /* @__PURE__ */ U(Qn, {
|
|
3129
3254
|
tags: e,
|
|
3130
3255
|
showSelectedTags: t,
|
|
3131
3256
|
showSelectedTagsLabel: n,
|
|
@@ -3150,7 +3275,7 @@ function Kn({ tags: e, showSelectedTags: t = !0, showSelectedTagsLabel: n = !0,
|
|
|
3150
3275
|
}
|
|
3151
3276
|
//#endregion
|
|
3152
3277
|
//#region src/components/rich-text-editor/RichTextEditor.types.ts
|
|
3153
|
-
var
|
|
3278
|
+
var er = {
|
|
3154
3279
|
showBold: !0,
|
|
3155
3280
|
showItalic: !0,
|
|
3156
3281
|
showUnderline: !0,
|
|
@@ -3168,7 +3293,7 @@ var qn = {
|
|
|
3168
3293
|
showHighlight: !0,
|
|
3169
3294
|
showUndoRedo: !0,
|
|
3170
3295
|
showClearFormat: !0
|
|
3171
|
-
},
|
|
3296
|
+
}, tr = {
|
|
3172
3297
|
bold: "Bold",
|
|
3173
3298
|
italic: "Italic",
|
|
3174
3299
|
underline: "Underline",
|
|
@@ -3199,7 +3324,7 @@ var qn = {
|
|
|
3199
3324
|
};
|
|
3200
3325
|
//#endregion
|
|
3201
3326
|
//#region src/components/rich-text-editor/RichTextEditorContent.tsx
|
|
3202
|
-
function
|
|
3327
|
+
function nr({ editor: e, error: t, disabled: n, readonly: r }) {
|
|
3203
3328
|
return /* @__PURE__ */ U(l, {
|
|
3204
3329
|
sx: {
|
|
3205
3330
|
flex: 1,
|
|
@@ -3283,12 +3408,12 @@ function Yn({ editor: e, error: t, disabled: n, readonly: r }) {
|
|
|
3283
3408
|
}
|
|
3284
3409
|
}
|
|
3285
3410
|
},
|
|
3286
|
-
children: /* @__PURE__ */ U(
|
|
3411
|
+
children: /* @__PURE__ */ U(Fe, { editor: e })
|
|
3287
3412
|
});
|
|
3288
3413
|
}
|
|
3289
3414
|
//#endregion
|
|
3290
3415
|
//#region src/components/rich-text-editor/RichTextEditorLinkDialog.tsx
|
|
3291
|
-
function
|
|
3416
|
+
function rr({ open: e, onClose: t, editor: n, translation: i }) {
|
|
3292
3417
|
let [a, o] = s("");
|
|
3293
3418
|
r(() => {
|
|
3294
3419
|
if (e) {
|
|
@@ -3354,7 +3479,7 @@ function Xn({ open: e, onClose: t, editor: n, translation: i }) {
|
|
|
3354
3479
|
}
|
|
3355
3480
|
//#endregion
|
|
3356
3481
|
//#region src/components/rich-text-editor/RichTextEditorColorPicker.tsx
|
|
3357
|
-
var
|
|
3482
|
+
var ir = [
|
|
3358
3483
|
"#000000",
|
|
3359
3484
|
"#434343",
|
|
3360
3485
|
"#666666",
|
|
@@ -3373,7 +3498,7 @@ var Zn = [
|
|
|
3373
3498
|
"#8a2be2",
|
|
3374
3499
|
"#ff1493",
|
|
3375
3500
|
"#a52a2a"
|
|
3376
|
-
],
|
|
3501
|
+
], ar = [
|
|
3377
3502
|
"#ffff00",
|
|
3378
3503
|
"#ffd700",
|
|
3379
3504
|
"#ffa500",
|
|
@@ -3393,7 +3518,7 @@ var Zn = [
|
|
|
3393
3518
|
"#ffffff",
|
|
3394
3519
|
"#000000"
|
|
3395
3520
|
];
|
|
3396
|
-
function
|
|
3521
|
+
function or({ color: e, active: t, onClick: n }) {
|
|
3397
3522
|
return /* @__PURE__ */ U(F, {
|
|
3398
3523
|
title: e,
|
|
3399
3524
|
placement: "top",
|
|
@@ -3435,8 +3560,8 @@ function $n({ color: e, active: t, onClick: n }) {
|
|
|
3435
3560
|
})
|
|
3436
3561
|
});
|
|
3437
3562
|
}
|
|
3438
|
-
function
|
|
3439
|
-
let u = o(null), d = r === "highlight" ?
|
|
3563
|
+
function sr({ anchorEl: e, open: t, onClose: n, mode: r, activeColor: i, onSelectColor: a, onRemoveColor: s, removeLabel: c }) {
|
|
3564
|
+
let u = o(null), d = r === "highlight" ? ar : ir;
|
|
3440
3565
|
function f(e) {
|
|
3441
3566
|
a(e.target.value);
|
|
3442
3567
|
}
|
|
@@ -3460,7 +3585,7 @@ function er({ anchorEl: e, open: t, onClose: n, mode: r, activeColor: i, onSelec
|
|
|
3460
3585
|
gap: .5,
|
|
3461
3586
|
mb: 1
|
|
3462
3587
|
},
|
|
3463
|
-
children: d.map((e) => /* @__PURE__ */ U(
|
|
3588
|
+
children: d.map((e) => /* @__PURE__ */ U(or, {
|
|
3464
3589
|
color: e,
|
|
3465
3590
|
active: i?.toLowerCase() === e.toLowerCase(),
|
|
3466
3591
|
onClick: (e) => {
|
|
@@ -3521,7 +3646,7 @@ function er({ anchorEl: e, open: t, onClose: n, mode: r, activeColor: i, onSelec
|
|
|
3521
3646
|
borderRadius: 1,
|
|
3522
3647
|
ml: "auto"
|
|
3523
3648
|
},
|
|
3524
|
-
children: /* @__PURE__ */ U(
|
|
3649
|
+
children: /* @__PURE__ */ U(rt, { fontSize: "small" })
|
|
3525
3650
|
})
|
|
3526
3651
|
})
|
|
3527
3652
|
]
|
|
@@ -3530,24 +3655,7 @@ function er({ anchorEl: e, open: t, onClose: n, mode: r, activeColor: i, onSelec
|
|
|
3530
3655
|
}
|
|
3531
3656
|
//#endregion
|
|
3532
3657
|
//#region src/components/rich-text-editor/RichTextEditorToolbar.tsx
|
|
3533
|
-
function
|
|
3534
|
-
return /* @__PURE__ */ U(F, {
|
|
3535
|
-
title: e,
|
|
3536
|
-
arrow: !0,
|
|
3537
|
-
children: /* @__PURE__ */ U("span", { children: /* @__PURE__ */ U(S, {
|
|
3538
|
-
size: "small",
|
|
3539
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
3540
|
-
onClick: n,
|
|
3541
|
-
disabled: i,
|
|
3542
|
-
color: r ? "primary" : "default",
|
|
3543
|
-
sx: { borderRadius: 1 },
|
|
3544
|
-
"aria-label": e,
|
|
3545
|
-
"aria-pressed": r,
|
|
3546
|
-
children: t
|
|
3547
|
-
}) })
|
|
3548
|
-
});
|
|
3549
|
-
}
|
|
3550
|
-
function tr({ label: e, icon: t, activeColor: n, disabled: r, onClick: i }) {
|
|
3658
|
+
function cr({ label: e, icon: t, activeColor: n, disabled: r, onClick: i }) {
|
|
3551
3659
|
return /* @__PURE__ */ U(F, {
|
|
3552
3660
|
title: e,
|
|
3553
3661
|
arrow: !0,
|
|
@@ -3579,40 +3687,18 @@ function tr({ label: e, icon: t, activeColor: n, disabled: r, onClick: i }) {
|
|
|
3579
3687
|
}) })
|
|
3580
3688
|
});
|
|
3581
3689
|
}
|
|
3582
|
-
function
|
|
3583
|
-
return /* @__PURE__ */
|
|
3584
|
-
component: "span",
|
|
3585
|
-
sx: {
|
|
3586
|
-
fontWeight: "bold",
|
|
3587
|
-
fontSize: "0.875rem",
|
|
3588
|
-
lineHeight: 1
|
|
3589
|
-
},
|
|
3590
|
-
children: "H1"
|
|
3591
|
-
});
|
|
3592
|
-
}
|
|
3593
|
-
function rr() {
|
|
3594
|
-
return /* @__PURE__ */ U(l, {
|
|
3595
|
-
component: "span",
|
|
3596
|
-
sx: {
|
|
3597
|
-
fontWeight: "bold",
|
|
3598
|
-
fontSize: "0.875rem",
|
|
3599
|
-
lineHeight: 1
|
|
3600
|
-
},
|
|
3601
|
-
children: "H2"
|
|
3602
|
-
});
|
|
3603
|
-
}
|
|
3604
|
-
function ir() {
|
|
3605
|
-
return /* @__PURE__ */ U(l, {
|
|
3690
|
+
function lr({ level: e }) {
|
|
3691
|
+
return /* @__PURE__ */ W(l, {
|
|
3606
3692
|
component: "span",
|
|
3607
3693
|
sx: {
|
|
3608
3694
|
fontWeight: "bold",
|
|
3609
3695
|
fontSize: "0.875rem",
|
|
3610
3696
|
lineHeight: 1
|
|
3611
3697
|
},
|
|
3612
|
-
children: "
|
|
3698
|
+
children: ["H", e]
|
|
3613
3699
|
});
|
|
3614
3700
|
}
|
|
3615
|
-
function
|
|
3701
|
+
function ur({ editor: e, toolbarConfig: t, translation: n, disabled: r }) {
|
|
3616
3702
|
let [i, a] = s(!1), [o, c] = s(null), [u, d] = s(null), f = r || !e, p = e?.getAttributes("textStyle")?.color, m = e?.getAttributes("highlight")?.color, h = t.showBold || t.showItalic || t.showUnderline || t.showStrike, g = t.showHeading1 || t.showHeading2 || t.showHeading3, _ = t.showBulletList || t.showOrderedList, y = t.showBlockquote || t.showCodeBlock || t.showLink || t.showHorizontalRule, b = t.showTextColor || t.showHighlight, x = t.showUndoRedo || t.showClearFormat, S = [
|
|
3617
3703
|
h,
|
|
3618
3704
|
g,
|
|
@@ -3647,30 +3733,30 @@ function ar({ editor: e, toolbarConfig: t, translation: n, disabled: r }) {
|
|
|
3647
3733
|
gap: .25
|
|
3648
3734
|
},
|
|
3649
3735
|
children: [
|
|
3650
|
-
t.showBold && /* @__PURE__ */ U(
|
|
3736
|
+
t.showBold && /* @__PURE__ */ U(X, {
|
|
3651
3737
|
label: n.bold,
|
|
3652
|
-
icon: /* @__PURE__ */ U(
|
|
3738
|
+
icon: /* @__PURE__ */ U(We, { fontSize: "small" }),
|
|
3653
3739
|
onClick: () => e?.chain().focus().toggleBold().run(),
|
|
3654
3740
|
active: e?.isActive("bold"),
|
|
3655
3741
|
disabled: f
|
|
3656
3742
|
}),
|
|
3657
|
-
t.showItalic && /* @__PURE__ */ U(
|
|
3743
|
+
t.showItalic && /* @__PURE__ */ U(X, {
|
|
3658
3744
|
label: n.italic,
|
|
3659
|
-
icon: /* @__PURE__ */ U(
|
|
3745
|
+
icon: /* @__PURE__ */ U(Ge, { fontSize: "small" }),
|
|
3660
3746
|
onClick: () => e?.chain().focus().toggleItalic().run(),
|
|
3661
3747
|
active: e?.isActive("italic"),
|
|
3662
3748
|
disabled: f
|
|
3663
3749
|
}),
|
|
3664
|
-
t.showUnderline && /* @__PURE__ */ U(
|
|
3750
|
+
t.showUnderline && /* @__PURE__ */ U(X, {
|
|
3665
3751
|
label: n.underline,
|
|
3666
|
-
icon: /* @__PURE__ */ U(
|
|
3752
|
+
icon: /* @__PURE__ */ U(Ke, { fontSize: "small" }),
|
|
3667
3753
|
onClick: () => e?.chain().focus().toggleUnderline().run(),
|
|
3668
3754
|
active: e?.isActive("underline"),
|
|
3669
3755
|
disabled: f
|
|
3670
3756
|
}),
|
|
3671
|
-
t.showStrike && /* @__PURE__ */ U(
|
|
3757
|
+
t.showStrike && /* @__PURE__ */ U(X, {
|
|
3672
3758
|
label: n.strike,
|
|
3673
|
-
icon: /* @__PURE__ */ U(
|
|
3759
|
+
icon: /* @__PURE__ */ U(qe, { fontSize: "small" }),
|
|
3674
3760
|
onClick: () => e?.chain().focus().toggleStrike().run(),
|
|
3675
3761
|
active: e?.isActive("strike"),
|
|
3676
3762
|
disabled: f
|
|
@@ -3684,23 +3770,23 @@ function ar({ editor: e, toolbarConfig: t, translation: n, disabled: r }) {
|
|
|
3684
3770
|
gap: .25
|
|
3685
3771
|
},
|
|
3686
3772
|
children: [
|
|
3687
|
-
t.showHeading1 && /* @__PURE__ */ U(
|
|
3773
|
+
t.showHeading1 && /* @__PURE__ */ U(X, {
|
|
3688
3774
|
label: n.heading1,
|
|
3689
|
-
icon: /* @__PURE__ */ U(
|
|
3775
|
+
icon: /* @__PURE__ */ U(lr, { level: 1 }),
|
|
3690
3776
|
onClick: () => e?.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
3691
3777
|
active: e?.isActive("heading", { level: 1 }),
|
|
3692
3778
|
disabled: f
|
|
3693
3779
|
}),
|
|
3694
|
-
t.showHeading2 && /* @__PURE__ */ U(
|
|
3780
|
+
t.showHeading2 && /* @__PURE__ */ U(X, {
|
|
3695
3781
|
label: n.heading2,
|
|
3696
|
-
icon: /* @__PURE__ */ U(
|
|
3782
|
+
icon: /* @__PURE__ */ U(lr, { level: 2 }),
|
|
3697
3783
|
onClick: () => e?.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
3698
3784
|
active: e?.isActive("heading", { level: 2 }),
|
|
3699
3785
|
disabled: f
|
|
3700
3786
|
}),
|
|
3701
|
-
t.showHeading3 && /* @__PURE__ */ U(
|
|
3787
|
+
t.showHeading3 && /* @__PURE__ */ U(X, {
|
|
3702
3788
|
label: n.heading3,
|
|
3703
|
-
icon: /* @__PURE__ */ U(
|
|
3789
|
+
icon: /* @__PURE__ */ U(lr, { level: 3 }),
|
|
3704
3790
|
onClick: () => e?.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
3705
3791
|
active: e?.isActive("heading", { level: 3 }),
|
|
3706
3792
|
disabled: f
|
|
@@ -3713,15 +3799,15 @@ function ar({ editor: e, toolbarConfig: t, translation: n, disabled: r }) {
|
|
|
3713
3799
|
display: "flex",
|
|
3714
3800
|
gap: .25
|
|
3715
3801
|
},
|
|
3716
|
-
children: [t.showBulletList && /* @__PURE__ */ U(
|
|
3802
|
+
children: [t.showBulletList && /* @__PURE__ */ U(X, {
|
|
3717
3803
|
label: n.bulletList,
|
|
3718
|
-
icon: /* @__PURE__ */ U(
|
|
3804
|
+
icon: /* @__PURE__ */ U(Je, { fontSize: "small" }),
|
|
3719
3805
|
onClick: () => e?.chain().focus().toggleBulletList().run(),
|
|
3720
3806
|
active: e?.isActive("bulletList"),
|
|
3721
3807
|
disabled: f
|
|
3722
|
-
}), t.showOrderedList && /* @__PURE__ */ U(
|
|
3808
|
+
}), t.showOrderedList && /* @__PURE__ */ U(X, {
|
|
3723
3809
|
label: n.orderedList,
|
|
3724
|
-
icon: /* @__PURE__ */ U(
|
|
3810
|
+
icon: /* @__PURE__ */ U(Ye, { fontSize: "small" }),
|
|
3725
3811
|
onClick: () => e?.chain().focus().toggleOrderedList().run(),
|
|
3726
3812
|
active: e?.isActive("orderedList"),
|
|
3727
3813
|
disabled: f
|
|
@@ -3734,30 +3820,30 @@ function ar({ editor: e, toolbarConfig: t, translation: n, disabled: r }) {
|
|
|
3734
3820
|
gap: .25
|
|
3735
3821
|
},
|
|
3736
3822
|
children: [
|
|
3737
|
-
t.showBlockquote && /* @__PURE__ */ U(
|
|
3823
|
+
t.showBlockquote && /* @__PURE__ */ U(X, {
|
|
3738
3824
|
label: n.blockquote,
|
|
3739
|
-
icon: /* @__PURE__ */ U(
|
|
3825
|
+
icon: /* @__PURE__ */ U(Xe, { fontSize: "small" }),
|
|
3740
3826
|
onClick: () => e?.chain().focus().toggleBlockquote().run(),
|
|
3741
3827
|
active: e?.isActive("blockquote"),
|
|
3742
3828
|
disabled: f
|
|
3743
3829
|
}),
|
|
3744
|
-
t.showCodeBlock && /* @__PURE__ */ U(
|
|
3830
|
+
t.showCodeBlock && /* @__PURE__ */ U(X, {
|
|
3745
3831
|
label: n.codeBlock,
|
|
3746
|
-
icon: /* @__PURE__ */ U(
|
|
3832
|
+
icon: /* @__PURE__ */ U(Ze, { fontSize: "small" }),
|
|
3747
3833
|
onClick: () => e?.chain().focus().toggleCodeBlock().run(),
|
|
3748
3834
|
active: e?.isActive("codeBlock"),
|
|
3749
3835
|
disabled: f
|
|
3750
3836
|
}),
|
|
3751
|
-
t.showLink && /* @__PURE__ */ U(
|
|
3837
|
+
t.showLink && /* @__PURE__ */ U(X, {
|
|
3752
3838
|
label: n.link,
|
|
3753
|
-
icon: /* @__PURE__ */ U(
|
|
3839
|
+
icon: /* @__PURE__ */ U(Qe, { fontSize: "small" }),
|
|
3754
3840
|
onClick: () => a(!0),
|
|
3755
3841
|
active: e?.isActive("link"),
|
|
3756
3842
|
disabled: f
|
|
3757
3843
|
}),
|
|
3758
|
-
t.showHorizontalRule && /* @__PURE__ */ U(
|
|
3844
|
+
t.showHorizontalRule && /* @__PURE__ */ U(X, {
|
|
3759
3845
|
label: n.horizontalRule,
|
|
3760
|
-
icon: /* @__PURE__ */ U(
|
|
3846
|
+
icon: /* @__PURE__ */ U($e, { fontSize: "small" }),
|
|
3761
3847
|
onClick: () => e?.chain().focus().setHorizontalRule().run(),
|
|
3762
3848
|
disabled: f
|
|
3763
3849
|
})
|
|
@@ -3769,15 +3855,15 @@ function ar({ editor: e, toolbarConfig: t, translation: n, disabled: r }) {
|
|
|
3769
3855
|
display: "flex",
|
|
3770
3856
|
gap: .25
|
|
3771
3857
|
},
|
|
3772
|
-
children: [t.showTextColor && /* @__PURE__ */ U(
|
|
3858
|
+
children: [t.showTextColor && /* @__PURE__ */ U(cr, {
|
|
3773
3859
|
label: n.textColor,
|
|
3774
|
-
icon: /* @__PURE__ */ U(
|
|
3860
|
+
icon: /* @__PURE__ */ U(et, { fontSize: "small" }),
|
|
3775
3861
|
activeColor: p,
|
|
3776
3862
|
disabled: f,
|
|
3777
3863
|
onClick: (e) => c(e.currentTarget)
|
|
3778
|
-
}), t.showHighlight && /* @__PURE__ */ U(
|
|
3864
|
+
}), t.showHighlight && /* @__PURE__ */ U(cr, {
|
|
3779
3865
|
label: n.highlight,
|
|
3780
|
-
icon: /* @__PURE__ */ U(
|
|
3866
|
+
icon: /* @__PURE__ */ U(tt, { fontSize: "small" }),
|
|
3781
3867
|
activeColor: m,
|
|
3782
3868
|
disabled: f,
|
|
3783
3869
|
onClick: (e) => d(e.currentTarget)
|
|
@@ -3789,19 +3875,19 @@ function ar({ editor: e, toolbarConfig: t, translation: n, disabled: r }) {
|
|
|
3789
3875
|
display: "flex",
|
|
3790
3876
|
gap: .25
|
|
3791
3877
|
},
|
|
3792
|
-
children: [t.showUndoRedo && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(
|
|
3878
|
+
children: [t.showUndoRedo && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(X, {
|
|
3793
3879
|
label: n.undo,
|
|
3794
|
-
icon: /* @__PURE__ */ U(
|
|
3880
|
+
icon: /* @__PURE__ */ U(ve, { fontSize: "small" }),
|
|
3795
3881
|
onClick: () => e?.chain().focus().undo().run(),
|
|
3796
3882
|
disabled: f || !e?.can().undo()
|
|
3797
|
-
}), /* @__PURE__ */ U(
|
|
3883
|
+
}), /* @__PURE__ */ U(X, {
|
|
3798
3884
|
label: n.redo,
|
|
3799
|
-
icon: /* @__PURE__ */ U(
|
|
3885
|
+
icon: /* @__PURE__ */ U(ye, { fontSize: "small" }),
|
|
3800
3886
|
onClick: () => e?.chain().focus().redo().run(),
|
|
3801
3887
|
disabled: f || !e?.can().redo()
|
|
3802
|
-
})] }), t.showClearFormat && /* @__PURE__ */ U(
|
|
3888
|
+
})] }), t.showClearFormat && /* @__PURE__ */ U(X, {
|
|
3803
3889
|
label: n.clearFormat,
|
|
3804
|
-
icon: /* @__PURE__ */ U(
|
|
3890
|
+
icon: /* @__PURE__ */ U(nt, { fontSize: "small" }),
|
|
3805
3891
|
onClick: () => e?.chain().focus().clearNodes().unsetAllMarks().run(),
|
|
3806
3892
|
disabled: f
|
|
3807
3893
|
})]
|
|
@@ -3809,13 +3895,13 @@ function ar({ editor: e, toolbarConfig: t, translation: n, disabled: r }) {
|
|
|
3809
3895
|
C === 0 && /* @__PURE__ */ U(l, { sx: { height: 32 } })
|
|
3810
3896
|
]
|
|
3811
3897
|
}),
|
|
3812
|
-
t.showLink && e && /* @__PURE__ */ U(
|
|
3898
|
+
t.showLink && e && /* @__PURE__ */ U(rr, {
|
|
3813
3899
|
open: i,
|
|
3814
3900
|
onClose: () => a(!1),
|
|
3815
3901
|
editor: e,
|
|
3816
3902
|
translation: n
|
|
3817
3903
|
}),
|
|
3818
|
-
t.showTextColor && /* @__PURE__ */ U(
|
|
3904
|
+
t.showTextColor && /* @__PURE__ */ U(sr, {
|
|
3819
3905
|
anchorEl: o,
|
|
3820
3906
|
open: !!o,
|
|
3821
3907
|
onClose: () => c(null),
|
|
@@ -3825,7 +3911,7 @@ function ar({ editor: e, toolbarConfig: t, translation: n, disabled: r }) {
|
|
|
3825
3911
|
onRemoveColor: () => e?.chain().focus().unsetColor().run(),
|
|
3826
3912
|
removeLabel: n.removeTextColor
|
|
3827
3913
|
}),
|
|
3828
|
-
t.showHighlight && /* @__PURE__ */ U(
|
|
3914
|
+
t.showHighlight && /* @__PURE__ */ U(sr, {
|
|
3829
3915
|
anchorEl: u,
|
|
3830
3916
|
open: !!u,
|
|
3831
3917
|
onClose: () => d(null),
|
|
@@ -3839,7 +3925,7 @@ function ar({ editor: e, toolbarConfig: t, translation: n, disabled: r }) {
|
|
|
3839
3925
|
}
|
|
3840
3926
|
//#endregion
|
|
3841
3927
|
//#region src/components/rich-text-editor/RichTextEditorFooter.tsx
|
|
3842
|
-
function
|
|
3928
|
+
function dr({ helperText: e, error: t, showCharacterCount: n, charCount: r, maxCharacters: i, translation: a }) {
|
|
3843
3929
|
let o = i === void 0 ? a.characterCount.replace("{count}", String(r)) : a.characterCountMax.replace("{count}", String(r)).replace("{max}", String(i));
|
|
3844
3930
|
return /* @__PURE__ */ W(l, {
|
|
3845
3931
|
sx: {
|
|
@@ -3859,29 +3945,26 @@ function or({ helperText: e, error: t, showCharacterCount: n, charCount: r, maxC
|
|
|
3859
3945
|
}
|
|
3860
3946
|
//#endregion
|
|
3861
3947
|
//#region src/components/rich-text-editor/RichTextEditor.tsx
|
|
3862
|
-
function
|
|
3863
|
-
if (!(e === "" || e === void 0)) return typeof e == "string" && e !== "auto" && !isNaN(Number(e)) ? Number(e) : e;
|
|
3864
|
-
}
|
|
3865
|
-
function cr({ value: e, onChange: t, placeholder: n, outputFormat: i = "html", height: a, width: o, showCharacterCount: s = !1, maxCharacters: c, toolbarConfig: u, disabled: d = !1, readonly: f = !1, name: p, error: m = !1, helperText: h, translation: g, onBlur: _, onFocus: y }) {
|
|
3948
|
+
function fr({ value: e, onChange: t, placeholder: n, outputFormat: i = "html", height: a, width: o, showCharacterCount: s = !1, maxCharacters: c, toolbarConfig: u, disabled: d = !1, readonly: f = !1, name: p, error: m = !1, helperText: h, translation: g, onBlur: _, onFocus: y }) {
|
|
3866
3949
|
let b = {
|
|
3867
|
-
...
|
|
3950
|
+
...tr,
|
|
3868
3951
|
...g
|
|
3869
3952
|
}, x = {
|
|
3870
|
-
...
|
|
3953
|
+
...er,
|
|
3871
3954
|
...u
|
|
3872
|
-
}, S =
|
|
3955
|
+
}, S = Dt(a), C = Dt(o), w = S === "auto", T = w ? void 0 : S ?? 200, E = Ie({
|
|
3873
3956
|
shouldRerenderOnTransaction: !0,
|
|
3874
3957
|
extensions: [
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3958
|
+
Le.configure({ link: { openOnClick: !1 } }),
|
|
3959
|
+
Re,
|
|
3960
|
+
ze,
|
|
3961
|
+
Be.configure({ multicolor: !0 }),
|
|
3962
|
+
Ue.configure({
|
|
3880
3963
|
transformPastedText: !0,
|
|
3881
3964
|
transformCopiedText: !1
|
|
3882
3965
|
}),
|
|
3883
|
-
|
|
3884
|
-
...c !== void 0 && c > 0 ? [
|
|
3966
|
+
Ve.configure({ placeholder: n ?? "" }),
|
|
3967
|
+
...c !== void 0 && c > 0 ? [He.configure({ limit: c })] : s ? [He] : []
|
|
3885
3968
|
],
|
|
3886
3969
|
content: e ?? "",
|
|
3887
3970
|
editable: !d && !f,
|
|
@@ -3932,19 +4015,19 @@ function cr({ value: e, onChange: t, placeholder: n, outputFormat: i = "html", h
|
|
|
3932
4015
|
borderWidth: 2
|
|
3933
4016
|
}
|
|
3934
4017
|
},
|
|
3935
|
-
children: [!f && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(
|
|
4018
|
+
children: [!f && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(ur, {
|
|
3936
4019
|
editor: E,
|
|
3937
4020
|
toolbarConfig: x,
|
|
3938
4021
|
translation: b,
|
|
3939
4022
|
disabled: d
|
|
3940
|
-
}), /* @__PURE__ */ U(v, {})] }), /* @__PURE__ */ U(
|
|
4023
|
+
}), /* @__PURE__ */ U(v, {})] }), /* @__PURE__ */ U(nr, {
|
|
3941
4024
|
editor: E,
|
|
3942
4025
|
error: m,
|
|
3943
4026
|
disabled: d,
|
|
3944
4027
|
readonly: f
|
|
3945
4028
|
})]
|
|
3946
4029
|
}),
|
|
3947
|
-
k && /* @__PURE__ */ U(
|
|
4030
|
+
k && /* @__PURE__ */ U(dr, {
|
|
3948
4031
|
helperText: h,
|
|
3949
4032
|
error: m,
|
|
3950
4033
|
showCharacterCount: s || c !== void 0 && c > 0,
|
|
@@ -3962,13 +4045,13 @@ function cr({ value: e, onChange: t, placeholder: n, outputFormat: i = "html", h
|
|
|
3962
4045
|
}
|
|
3963
4046
|
//#endregion
|
|
3964
4047
|
//#region src/components/sql-editor/SqlEditor.types.ts
|
|
3965
|
-
var
|
|
4048
|
+
var pr = {
|
|
3966
4049
|
showFormat: !0,
|
|
3967
4050
|
showCopy: !0,
|
|
3968
4051
|
showClear: !0,
|
|
3969
4052
|
showExecute: !1,
|
|
3970
4053
|
showUndoRedo: !0
|
|
3971
|
-
},
|
|
4054
|
+
}, mr = {
|
|
3972
4055
|
format: "Format SQL",
|
|
3973
4056
|
copy: "Copy",
|
|
3974
4057
|
copySuccess: "Copied!",
|
|
@@ -3978,15 +4061,15 @@ var lr = {
|
|
|
3978
4061
|
redo: "Redo",
|
|
3979
4062
|
lineColumn: "Ln {line}, Col {col}",
|
|
3980
4063
|
errorCount: "{count} error(s)"
|
|
3981
|
-
},
|
|
3982
|
-
standard:
|
|
3983
|
-
mysql:
|
|
3984
|
-
postgresql:
|
|
3985
|
-
sqlite:
|
|
3986
|
-
mssql:
|
|
4064
|
+
}, hr = {
|
|
4065
|
+
standard: ct,
|
|
4066
|
+
mysql: at,
|
|
4067
|
+
postgresql: ot,
|
|
4068
|
+
sqlite: st,
|
|
4069
|
+
mssql: it
|
|
3987
4070
|
};
|
|
3988
|
-
function
|
|
3989
|
-
let b = o(null), x = o(null), S = o(t), C = o(_), w = o(v), T = o(y), E = o(g), D = o(m), O = o(h), k = o(new
|
|
4071
|
+
function gr({ value: e, onChange: t, placeholder: n, disabled: i = !1, readonly: a = !1, showLineNumbers: s = !0, dialect: c = "standard", keywordColor: u, stringColor: d, identifierColor: f, schema: p, onLint: m, onDiagnosticsChange: h, onViewReady: g, onCursorChange: _, onBlur: v, onFocus: y }) {
|
|
4072
|
+
let b = o(null), x = o(null), S = o(t), C = o(_), w = o(v), T = o(y), E = o(g), D = o(m), O = o(h), k = o(new ne()), A = o(new ne()), j = L(), M = j.palette.mode === "dark", N = !!m, P = JSON.stringify(p);
|
|
3990
4073
|
return r(() => {
|
|
3991
4074
|
S.current = t;
|
|
3992
4075
|
}, [t]), r(() => {
|
|
@@ -4003,44 +4086,44 @@ function fr({ value: e, onChange: t, placeholder: n, disabled: i = !1, readonly:
|
|
|
4003
4086
|
O.current = h;
|
|
4004
4087
|
}, [h]), r(() => {
|
|
4005
4088
|
if (!b.current) return;
|
|
4006
|
-
let t = x.current?.state.doc.toString() ?? e ?? "", r = u ?? j.palette.primary.main, o = d ?? j.palette.success.main, l = f ?? j.palette.info.main, m =
|
|
4089
|
+
let t = x.current?.state.doc.toString() ?? e ?? "", r = u ?? j.palette.primary.main, o = d ?? j.palette.success.main, l = f ?? j.palette.info.main, m = de.define([
|
|
4007
4090
|
{
|
|
4008
|
-
tag:
|
|
4091
|
+
tag: Y.keyword,
|
|
4009
4092
|
color: r,
|
|
4010
4093
|
fontWeight: "bold"
|
|
4011
4094
|
},
|
|
4012
4095
|
{
|
|
4013
|
-
tag:
|
|
4096
|
+
tag: Y.name,
|
|
4014
4097
|
color: l
|
|
4015
4098
|
},
|
|
4016
4099
|
{
|
|
4017
|
-
tag: [
|
|
4100
|
+
tag: [Y.string, Y.special(Y.string)],
|
|
4018
4101
|
color: o,
|
|
4019
4102
|
fontWeight: "bold"
|
|
4020
4103
|
},
|
|
4021
4104
|
{
|
|
4022
|
-
tag:
|
|
4105
|
+
tag: Y.number,
|
|
4023
4106
|
color: j.palette.warning.main
|
|
4024
4107
|
},
|
|
4025
4108
|
{
|
|
4026
|
-
tag: [
|
|
4109
|
+
tag: [Y.lineComment, Y.blockComment],
|
|
4027
4110
|
color: j.palette.text.disabled,
|
|
4028
4111
|
fontStyle: "italic"
|
|
4029
4112
|
},
|
|
4030
4113
|
{
|
|
4031
|
-
tag:
|
|
4114
|
+
tag: Y.operator,
|
|
4032
4115
|
color: j.palette.text.secondary
|
|
4033
4116
|
},
|
|
4034
4117
|
{
|
|
4035
|
-
tag: [
|
|
4118
|
+
tag: [Y.function(Y.variableName), Y.function(Y.name)],
|
|
4036
4119
|
color: j.palette.secondary.main
|
|
4037
4120
|
},
|
|
4038
4121
|
{
|
|
4039
|
-
tag:
|
|
4122
|
+
tag: Y.typeName,
|
|
4040
4123
|
color: j.palette.info.main
|
|
4041
4124
|
},
|
|
4042
4125
|
{
|
|
4043
|
-
tag:
|
|
4126
|
+
tag: Y.invalid,
|
|
4044
4127
|
color: j.palette.error.main,
|
|
4045
4128
|
textDecoration: "underline wavy"
|
|
4046
4129
|
}
|
|
@@ -4129,24 +4212,24 @@ function fr({ value: e, onChange: t, placeholder: n, disabled: i = !1, readonly:
|
|
|
4129
4212
|
}
|
|
4130
4213
|
}, v = [
|
|
4131
4214
|
h,
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
dialect:
|
|
4215
|
+
fe(m),
|
|
4216
|
+
lt({
|
|
4217
|
+
dialect: hr[c],
|
|
4135
4218
|
schema: g
|
|
4136
4219
|
}),
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
...
|
|
4220
|
+
se(),
|
|
4221
|
+
ut(),
|
|
4222
|
+
J.of([
|
|
4223
|
+
...oe,
|
|
4141
4224
|
...ce,
|
|
4142
|
-
...
|
|
4225
|
+
...dt
|
|
4143
4226
|
]),
|
|
4144
4227
|
k.current.of(G.editable.of(!i && !a)),
|
|
4145
|
-
A.current.of(
|
|
4228
|
+
A.current.of(re.readOnly.of(a)),
|
|
4146
4229
|
K(),
|
|
4147
|
-
...s ? [
|
|
4148
|
-
...n ? [
|
|
4149
|
-
...N ? [
|
|
4230
|
+
...s ? [ee(), q()] : [],
|
|
4231
|
+
...n ? [te(n)] : [],
|
|
4232
|
+
...N ? [pe(), me(_, { delay: 600 })] : [],
|
|
4150
4233
|
G.updateListener.of((e) => {
|
|
4151
4234
|
e.docChanged && S.current?.(e.state.doc.toString());
|
|
4152
4235
|
let t = e.state.selection.main.head, n = e.state.doc.lineAt(t);
|
|
@@ -4161,7 +4244,7 @@ function fr({ value: e, onChange: t, placeholder: n, disabled: i = !1, readonly:
|
|
|
4161
4244
|
}
|
|
4162
4245
|
})
|
|
4163
4246
|
], y = new G({
|
|
4164
|
-
state:
|
|
4247
|
+
state: re.create({
|
|
4165
4248
|
doc: t,
|
|
4166
4249
|
extensions: v
|
|
4167
4250
|
}),
|
|
@@ -4188,7 +4271,7 @@ function fr({ value: e, onChange: t, placeholder: n, disabled: i = !1, readonly:
|
|
|
4188
4271
|
insert: e ?? ""
|
|
4189
4272
|
} });
|
|
4190
4273
|
}, [e]), r(() => {
|
|
4191
|
-
x.current?.dispatch({ effects: [k.current.reconfigure(G.editable.of(!i && !a)), A.current.reconfigure(
|
|
4274
|
+
x.current?.dispatch({ effects: [k.current.reconfigure(G.editable.of(!i && !a)), A.current.reconfigure(re.readOnly.of(a))] });
|
|
4192
4275
|
}, [i, a]), /* @__PURE__ */ U(l, {
|
|
4193
4276
|
ref: b,
|
|
4194
4277
|
sx: {
|
|
@@ -4208,29 +4291,14 @@ function fr({ value: e, onChange: t, placeholder: n, disabled: i = !1, readonly:
|
|
|
4208
4291
|
}
|
|
4209
4292
|
//#endregion
|
|
4210
4293
|
//#region src/components/sql-editor/SqlEditorToolbar.tsx
|
|
4211
|
-
var
|
|
4294
|
+
var _r = {
|
|
4212
4295
|
standard: "sql",
|
|
4213
4296
|
mysql: "mysql",
|
|
4214
4297
|
postgresql: "postgresql",
|
|
4215
4298
|
sqlite: "sqlite",
|
|
4216
4299
|
mssql: "tsql"
|
|
4217
4300
|
};
|
|
4218
|
-
function
|
|
4219
|
-
return /* @__PURE__ */ U(F, {
|
|
4220
|
-
title: e,
|
|
4221
|
-
arrow: !0,
|
|
4222
|
-
children: /* @__PURE__ */ U("span", { children: /* @__PURE__ */ U(S, {
|
|
4223
|
-
size: "small",
|
|
4224
|
-
onClick: n,
|
|
4225
|
-
disabled: i,
|
|
4226
|
-
color: r ? "primary" : "default",
|
|
4227
|
-
sx: { borderRadius: 1 },
|
|
4228
|
-
"aria-label": e,
|
|
4229
|
-
children: t
|
|
4230
|
-
}) })
|
|
4231
|
-
});
|
|
4232
|
-
}
|
|
4233
|
-
function hr({ viewRef: e, toolbarConfig: t, translation: n, dialect: r, disabled: i, onExecute: a }) {
|
|
4301
|
+
function vr({ viewRef: e, toolbarConfig: t, translation: n, dialect: r, disabled: i, onExecute: a }) {
|
|
4234
4302
|
let [o, c] = s(!1), u = i || !e.current;
|
|
4235
4303
|
function d() {
|
|
4236
4304
|
let t = e.current?.state.doc.toString() ?? "";
|
|
@@ -4248,18 +4316,18 @@ function hr({ viewRef: e, toolbarConfig: t, translation: n, dialect: r, disabled
|
|
|
4248
4316
|
}
|
|
4249
4317
|
function p() {
|
|
4250
4318
|
let t = e.current;
|
|
4251
|
-
t && (
|
|
4319
|
+
t && (ue(t), t.focus());
|
|
4252
4320
|
}
|
|
4253
4321
|
function m() {
|
|
4254
4322
|
let t = e.current;
|
|
4255
|
-
t && (
|
|
4323
|
+
t && (le(t), t.focus());
|
|
4256
4324
|
}
|
|
4257
4325
|
function h() {
|
|
4258
4326
|
let t = e.current;
|
|
4259
4327
|
if (!t) return;
|
|
4260
4328
|
let n = t.state.doc.toString();
|
|
4261
4329
|
try {
|
|
4262
|
-
let e =
|
|
4330
|
+
let e = pt(n, { language: _r[r] });
|
|
4263
4331
|
t.dispatch({ changes: {
|
|
4264
4332
|
from: 0,
|
|
4265
4333
|
to: t.state.doc.length,
|
|
@@ -4290,9 +4358,9 @@ function hr({ viewRef: e, toolbarConfig: t, translation: n, dialect: r, disabled
|
|
|
4290
4358
|
display: "flex",
|
|
4291
4359
|
gap: .25
|
|
4292
4360
|
},
|
|
4293
|
-
children: /* @__PURE__ */ U(
|
|
4361
|
+
children: /* @__PURE__ */ U(X, {
|
|
4294
4362
|
label: n.format,
|
|
4295
|
-
icon: /* @__PURE__ */ U(
|
|
4363
|
+
icon: /* @__PURE__ */ U(be, { fontSize: "small" }),
|
|
4296
4364
|
onClick: h,
|
|
4297
4365
|
disabled: u
|
|
4298
4366
|
})
|
|
@@ -4307,17 +4375,17 @@ function hr({ viewRef: e, toolbarConfig: t, translation: n, dialect: r, disabled
|
|
|
4307
4375
|
display: "flex",
|
|
4308
4376
|
gap: .25
|
|
4309
4377
|
},
|
|
4310
|
-
children: [t.showCopy && /* @__PURE__ */ U(
|
|
4378
|
+
children: [t.showCopy && /* @__PURE__ */ U(X, {
|
|
4311
4379
|
label: o ? n.copySuccess : n.copy,
|
|
4312
|
-
icon: o ? /* @__PURE__ */ U(
|
|
4380
|
+
icon: o ? /* @__PURE__ */ U(ge, {
|
|
4313
4381
|
fontSize: "small",
|
|
4314
4382
|
color: "success"
|
|
4315
|
-
}) : /* @__PURE__ */ U(
|
|
4383
|
+
}) : /* @__PURE__ */ U(he, { fontSize: "small" }),
|
|
4316
4384
|
onClick: d,
|
|
4317
4385
|
disabled: u
|
|
4318
|
-
}), t.showClear && /* @__PURE__ */ U(
|
|
4386
|
+
}), t.showClear && /* @__PURE__ */ U(X, {
|
|
4319
4387
|
label: n.clear,
|
|
4320
|
-
icon: /* @__PURE__ */ U(
|
|
4388
|
+
icon: /* @__PURE__ */ U(_e, { fontSize: "small" }),
|
|
4321
4389
|
onClick: f,
|
|
4322
4390
|
disabled: u
|
|
4323
4391
|
})]
|
|
@@ -4332,14 +4400,14 @@ function hr({ viewRef: e, toolbarConfig: t, translation: n, dialect: r, disabled
|
|
|
4332
4400
|
display: "flex",
|
|
4333
4401
|
gap: .25
|
|
4334
4402
|
},
|
|
4335
|
-
children: [/* @__PURE__ */ U(
|
|
4403
|
+
children: [/* @__PURE__ */ U(X, {
|
|
4336
4404
|
label: n.undo,
|
|
4337
|
-
icon: /* @__PURE__ */ U(
|
|
4405
|
+
icon: /* @__PURE__ */ U(ve, { fontSize: "small" }),
|
|
4338
4406
|
onClick: p,
|
|
4339
4407
|
disabled: u
|
|
4340
|
-
}), /* @__PURE__ */ U(
|
|
4408
|
+
}), /* @__PURE__ */ U(X, {
|
|
4341
4409
|
label: n.redo,
|
|
4342
|
-
icon: /* @__PURE__ */ U(
|
|
4410
|
+
icon: /* @__PURE__ */ U(ye, { fontSize: "small" }),
|
|
4343
4411
|
onClick: m,
|
|
4344
4412
|
disabled: u
|
|
4345
4413
|
})]
|
|
@@ -4348,9 +4416,9 @@ function hr({ viewRef: e, toolbarConfig: t, translation: n, dialect: r, disabled
|
|
|
4348
4416
|
orientation: "vertical",
|
|
4349
4417
|
flexItem: !0,
|
|
4350
4418
|
sx: { mx: .5 }
|
|
4351
|
-
}), /* @__PURE__ */ U(
|
|
4419
|
+
}), /* @__PURE__ */ U(X, {
|
|
4352
4420
|
label: n.execute,
|
|
4353
|
-
icon: /* @__PURE__ */ U(
|
|
4421
|
+
icon: /* @__PURE__ */ U(ft, { fontSize: "small" }),
|
|
4354
4422
|
onClick: g,
|
|
4355
4423
|
disabled: u
|
|
4356
4424
|
})] }),
|
|
@@ -4360,7 +4428,7 @@ function hr({ viewRef: e, toolbarConfig: t, translation: n, dialect: r, disabled
|
|
|
4360
4428
|
}
|
|
4361
4429
|
//#endregion
|
|
4362
4430
|
//#region src/components/sql-editor/SqlEditorFooter.tsx
|
|
4363
|
-
function
|
|
4431
|
+
function yr({ helperText: e, error: t, showLineColumn: n, showErrorCount: r, diagnosticsCount: i, cursorLine: a, cursorCol: o, translation: s }) {
|
|
4364
4432
|
let c = s.lineColumn.replace("{line}", String(a)).replace("{col}", String(o)), u = s.errorCount.replace("{count}", String(i));
|
|
4365
4433
|
return /* @__PURE__ */ W(l, {
|
|
4366
4434
|
sx: {
|
|
@@ -4376,7 +4444,7 @@ function gr({ helperText: e, error: t, showLineColumn: n, showErrorCount: r, dia
|
|
|
4376
4444
|
alignItems: "center",
|
|
4377
4445
|
gap: .5
|
|
4378
4446
|
},
|
|
4379
|
-
children: [/* @__PURE__ */ U(
|
|
4447
|
+
children: [/* @__PURE__ */ U(mt, { sx: {
|
|
4380
4448
|
fontSize: "0.875rem",
|
|
4381
4449
|
color: "error.main"
|
|
4382
4450
|
} }), /* @__PURE__ */ U(x, {
|
|
@@ -4401,17 +4469,14 @@ function gr({ helperText: e, error: t, showLineColumn: n, showErrorCount: r, dia
|
|
|
4401
4469
|
}
|
|
4402
4470
|
//#endregion
|
|
4403
4471
|
//#region src/components/sql-editor/SqlEditor.tsx
|
|
4404
|
-
function
|
|
4405
|
-
if (!(e === "" || e === void 0)) return typeof e == "string" && e !== "auto" && !isNaN(Number(e)) ? Number(e) : e;
|
|
4406
|
-
}
|
|
4407
|
-
function vr({ value: e, onChange: n, placeholder: r, height: i, width: a, disabled: c = !1, readonly: u = !1, error: d = !1, helperText: f, name: p, dialect: m = "standard", showLineNumbers: h = !0, showLineColumn: g = !0, showErrorCount: _ = !1, toolbarConfig: y, translation: b, highlightColors: x, schema: S, onExecute: C, onLint: w, onBlur: T, onFocus: E }) {
|
|
4472
|
+
function br({ value: e, onChange: n, placeholder: r, height: i, width: a, disabled: c = !1, readonly: u = !1, error: d = !1, helperText: f, name: p, dialect: m = "standard", showLineNumbers: h = !0, showLineColumn: g = !0, showErrorCount: _ = !1, toolbarConfig: y, translation: b, highlightColors: x, schema: S, onExecute: C, onLint: w, onBlur: T, onFocus: E }) {
|
|
4408
4473
|
let D = {
|
|
4409
|
-
...
|
|
4474
|
+
...mr,
|
|
4410
4475
|
...b
|
|
4411
4476
|
}, k = {
|
|
4412
|
-
...
|
|
4477
|
+
...pr,
|
|
4413
4478
|
...y
|
|
4414
|
-
}, A =
|
|
4479
|
+
}, A = Dt(i), j = Dt(a), M = A === "auto", N = M ? void 0 : A ?? 300, P = o(null), [F, I] = s({
|
|
4415
4480
|
line: 1,
|
|
4416
4481
|
col: 1
|
|
4417
4482
|
}), [L, R] = s(0), z = t((e) => {
|
|
@@ -4447,14 +4512,14 @@ function vr({ value: e, onChange: n, placeholder: r, height: i, width: a, disabl
|
|
|
4447
4512
|
borderWidth: 2
|
|
4448
4513
|
}
|
|
4449
4514
|
},
|
|
4450
|
-
children: [!u && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(
|
|
4515
|
+
children: [!u && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(vr, {
|
|
4451
4516
|
viewRef: P,
|
|
4452
4517
|
toolbarConfig: k,
|
|
4453
4518
|
translation: D,
|
|
4454
4519
|
dialect: m,
|
|
4455
4520
|
disabled: c,
|
|
4456
4521
|
onExecute: C
|
|
4457
|
-
}), /* @__PURE__ */ U(v, {})] }), /* @__PURE__ */ U(
|
|
4522
|
+
}), /* @__PURE__ */ U(v, {})] }), /* @__PURE__ */ U(gr, {
|
|
4458
4523
|
value: e,
|
|
4459
4524
|
onChange: n,
|
|
4460
4525
|
placeholder: r,
|
|
@@ -4474,7 +4539,7 @@ function vr({ value: e, onChange: n, placeholder: r, height: i, width: a, disabl
|
|
|
4474
4539
|
onFocus: E
|
|
4475
4540
|
})]
|
|
4476
4541
|
}),
|
|
4477
|
-
G && /* @__PURE__ */ U(
|
|
4542
|
+
G && /* @__PURE__ */ U(yr, {
|
|
4478
4543
|
helperText: f,
|
|
4479
4544
|
error: d,
|
|
4480
4545
|
showLineColumn: g,
|
|
@@ -4493,4 +4558,4 @@ function vr({ value: e, onChange: n, placeholder: r, height: i, width: a, disabl
|
|
|
4493
4558
|
});
|
|
4494
4559
|
}
|
|
4495
4560
|
//#endregion
|
|
4496
|
-
export {
|
|
4561
|
+
export { bt as ConfirmDialogProvider, Vn as DEFAULT_CHECK_COLORS, ht as DEFAULT_CONFIRM_DIALOG_TRANSLATION, Zt as DEFAULT_GANTT_TRANSLATIONS, St as DEFAULT_JSON_EDITOR_TOOLBAR_CONFIG, Ct as DEFAULT_JSON_EDITOR_TRANSLATION, Bn as DEFAULT_METER_COLORS, zn as DEFAULT_PASSWORD_TRANSLATIONS, er as DEFAULT_RICH_TEXT_EDITOR_TOOLBAR_CONFIG, tr as DEFAULT_RICH_TEXT_EDITOR_TRANSLATION, pr as DEFAULT_SQL_EDITOR_TOOLBAR_CONFIG, mr as DEFAULT_SQL_EDITOR_TRANSLATION, Yn as DEFAULT_TAG_SELECTION_TRANSLATION, Fn as GanttChart, kt as JsonEditor, Un as PasswordStrengthMeter, fr as RichTextEditor, br as SqlEditor, $n as TagSelection, xt as useConfirm, Q as useGanttChartStore, An as useGanttTheme, $ as useGanttTranslations, Dn as useRawGanttChartStore };
|