@thebuoyant-tsdev/mui-ts-library 1.3.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.de.md +1 -1
- package/README.md +1 -1
- package/dist/components/confirm-dialog/ConfirmDialog.types.d.ts +4 -4
- package/dist/components/gantt-chart/GanttChart.types.d.ts +23 -23
- package/dist/components/json-editor/JsonEditor.types.d.ts +13 -13
- package/dist/components/password-strength-meter/PasswordStrengthMeter.types.d.ts +9 -9
- package/dist/components/rich-text-editor/RichTextEditor.d.ts +1 -1
- package/dist/components/rich-text-editor/RichTextEditor.types.d.ts +23 -13
- package/dist/components/rich-text-editor/RichTextEditorFooter.d.ts +3 -1
- package/dist/components/rich-text-editor/RichTextEditorToolbar.d.ts +3 -1
- package/dist/components/sql-editor/SqlEditor.types.d.ts +15 -15
- package/dist/components/tag-selection/TagSelection.types.d.ts +11 -11
- package/dist/index.cjs +1 -1
- package/dist/index.js +461 -418
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -40,42 +40,44 @@ import { Highlight as Be } from "@tiptap/extension-highlight";
|
|
|
40
40
|
import { Placeholder as Ve } from "@tiptap/extension-placeholder";
|
|
41
41
|
import { CharacterCount as He } from "@tiptap/extension-character-count";
|
|
42
42
|
import { Markdown as Ue } from "tiptap-markdown";
|
|
43
|
-
import We from "@mui/icons-material/
|
|
44
|
-
import Ge from "@mui/icons-material/
|
|
45
|
-
import Ke from "@mui/icons-material/
|
|
46
|
-
import qe from "@mui/icons-material/
|
|
47
|
-
import Je from "@mui/icons-material/
|
|
48
|
-
import Ye from "@mui/icons-material/
|
|
49
|
-
import Xe from "@mui/icons-material/
|
|
50
|
-
import Ze from "@mui/icons-material/
|
|
51
|
-
import Qe from "@mui/icons-material/
|
|
52
|
-
import $e from "@mui/icons-material/
|
|
53
|
-
import et from "@mui/icons-material/
|
|
54
|
-
import tt from "@mui/icons-material/
|
|
55
|
-
import nt from "@mui/icons-material/
|
|
56
|
-
import rt from "@mui/icons-material/
|
|
57
|
-
import
|
|
58
|
-
import
|
|
59
|
-
import
|
|
60
|
-
import {
|
|
61
|
-
import mt from "@mui/icons-material/
|
|
43
|
+
import We from "@mui/icons-material/Fullscreen";
|
|
44
|
+
import Ge from "@mui/icons-material/FullscreenExit";
|
|
45
|
+
import Ke from "@mui/icons-material/FormatBold";
|
|
46
|
+
import qe from "@mui/icons-material/FormatItalic";
|
|
47
|
+
import Je from "@mui/icons-material/FormatUnderlined";
|
|
48
|
+
import Ye from "@mui/icons-material/StrikethroughS";
|
|
49
|
+
import Xe from "@mui/icons-material/FormatListBulleted";
|
|
50
|
+
import Ze from "@mui/icons-material/FormatListNumbered";
|
|
51
|
+
import Qe from "@mui/icons-material/FormatQuote";
|
|
52
|
+
import $e from "@mui/icons-material/Code";
|
|
53
|
+
import et from "@mui/icons-material/InsertLink";
|
|
54
|
+
import tt from "@mui/icons-material/HorizontalRule";
|
|
55
|
+
import nt from "@mui/icons-material/FormatColorText";
|
|
56
|
+
import rt from "@mui/icons-material/BorderColor";
|
|
57
|
+
import it from "@mui/icons-material/FormatClear";
|
|
58
|
+
import at from "@mui/icons-material/FormatColorReset";
|
|
59
|
+
import { MSSQL as ot, MySQL as st, PostgreSQL as ct, SQLite as lt, StandardSQL as ut, sql as dt } from "@codemirror/lang-sql";
|
|
60
|
+
import { autocompletion as ft, completionKeymap as pt } from "@codemirror/autocomplete";
|
|
61
|
+
import mt from "@mui/icons-material/PlayArrow";
|
|
62
|
+
import { format as ht } from "sql-formatter";
|
|
63
|
+
import gt from "@mui/icons-material/WarningAmber";
|
|
62
64
|
//#region src/components/confirm-dialog/ConfirmDialog.types.ts
|
|
63
|
-
var
|
|
65
|
+
var _t = {
|
|
64
66
|
confirmLabel: "Confirm",
|
|
65
67
|
cancelLabel: "Cancel"
|
|
66
|
-
},
|
|
68
|
+
}, vt = {
|
|
67
69
|
info: R,
|
|
68
70
|
warning: z,
|
|
69
71
|
error: B,
|
|
70
72
|
success: V
|
|
71
|
-
},
|
|
73
|
+
}, yt = {
|
|
72
74
|
info: "primary",
|
|
73
75
|
warning: "warning",
|
|
74
76
|
error: "error",
|
|
75
77
|
success: "success"
|
|
76
78
|
};
|
|
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 ?
|
|
79
|
+
function bt({ open: e, options: t, translation: n, onConfirm: r, onCancel: i }) {
|
|
80
|
+
let { title: a, description: o, confirmLabel: s, cancelLabel: c, severity: l = "info", hideCancelButton: d = !1, maxWidth: f = "xs", showIcon: g = !0 } = t, y = g ? vt[l] : null, b = yt[l], x = s ?? n.confirmLabel, S = c ?? n.cancelLabel;
|
|
79
81
|
return /* @__PURE__ */ W(p, {
|
|
80
82
|
open: e,
|
|
81
83
|
onClose: i,
|
|
@@ -132,10 +134,10 @@ function vt({ open: e, options: t, translation: n, onConfirm: r, onCancel: i })
|
|
|
132
134
|
]
|
|
133
135
|
});
|
|
134
136
|
}
|
|
135
|
-
var
|
|
136
|
-
function
|
|
137
|
+
var xt = e(() => Promise.resolve(!1));
|
|
138
|
+
function St({ children: e, translation: n }) {
|
|
137
139
|
let r = {
|
|
138
|
-
...
|
|
140
|
+
..._t,
|
|
139
141
|
...n
|
|
140
142
|
}, i = o(null), [a, c] = s({
|
|
141
143
|
open: !1,
|
|
@@ -146,9 +148,9 @@ function bt({ children: e, translation: n }) {
|
|
|
146
148
|
options: e
|
|
147
149
|
});
|
|
148
150
|
})), []);
|
|
149
|
-
return /* @__PURE__ */ W(
|
|
151
|
+
return /* @__PURE__ */ W(xt.Provider, {
|
|
150
152
|
value: l,
|
|
151
|
-
children: [e, /* @__PURE__ */ U(
|
|
153
|
+
children: [e, /* @__PURE__ */ U(bt, {
|
|
152
154
|
open: a.open,
|
|
153
155
|
options: a.options,
|
|
154
156
|
translation: r,
|
|
@@ -167,18 +169,18 @@ function bt({ children: e, translation: n }) {
|
|
|
167
169
|
})]
|
|
168
170
|
});
|
|
169
171
|
}
|
|
170
|
-
function
|
|
171
|
-
return n(
|
|
172
|
+
function Ct() {
|
|
173
|
+
return n(xt);
|
|
172
174
|
}
|
|
173
175
|
//#endregion
|
|
174
176
|
//#region src/components/json-editor/JsonEditor.types.ts
|
|
175
|
-
var
|
|
177
|
+
var wt = {
|
|
176
178
|
showFormat: !0,
|
|
177
179
|
showCompact: !0,
|
|
178
180
|
showCopy: !0,
|
|
179
181
|
showClear: !0,
|
|
180
182
|
showUndoRedo: !0
|
|
181
|
-
},
|
|
183
|
+
}, Tt = {
|
|
182
184
|
format: "Format JSON",
|
|
183
185
|
compact: "Compact JSON",
|
|
184
186
|
copy: "Copy",
|
|
@@ -192,7 +194,7 @@ var St = {
|
|
|
192
194
|
};
|
|
193
195
|
//#endregion
|
|
194
196
|
//#region src/components/json-editor/JsonEditorContent.tsx
|
|
195
|
-
function
|
|
197
|
+
function Et({ 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
198
|
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
199
|
return r(() => {
|
|
198
200
|
g.current = t;
|
|
@@ -375,7 +377,7 @@ function X({ label: e, icon: t, onClick: n, active: r, disabled: i }) {
|
|
|
375
377
|
}
|
|
376
378
|
//#endregion
|
|
377
379
|
//#region src/components/json-editor/JsonEditorToolbar.tsx
|
|
378
|
-
function
|
|
380
|
+
function Dt({ viewRef: e, toolbarConfig: t, translation: n, indent: r, disabled: i }) {
|
|
379
381
|
let [a, o] = s(!1), c = i || !e.current;
|
|
380
382
|
function u() {
|
|
381
383
|
let t = e.current;
|
|
@@ -510,7 +512,7 @@ function Tt({ viewRef: e, toolbarConfig: t, translation: n, indent: r, disabled:
|
|
|
510
512
|
}
|
|
511
513
|
//#endregion
|
|
512
514
|
//#region src/components/json-editor/JsonEditorFooter.tsx
|
|
513
|
-
function
|
|
515
|
+
function Ot({ helperText: e, error: t, showLineColumn: n, showValidation: r, isValid: i, cursorLine: a, cursorCol: o, translation: s }) {
|
|
514
516
|
let c = s.lineColumn.replace("{line}", String(a)).replace("{col}", String(o));
|
|
515
517
|
return /* @__PURE__ */ W(l, {
|
|
516
518
|
sx: {
|
|
@@ -560,12 +562,12 @@ function Et({ helperText: e, error: t, showLineColumn: n, showValidation: r, isV
|
|
|
560
562
|
}
|
|
561
563
|
//#endregion
|
|
562
564
|
//#region src/components/shared/normalizeSize.ts
|
|
563
|
-
function
|
|
565
|
+
function kt(e) {
|
|
564
566
|
if (!(e === "" || e === void 0)) return typeof e == "string" && e !== "auto" && !isNaN(Number(e)) ? Number(e) : e;
|
|
565
567
|
}
|
|
566
568
|
//#endregion
|
|
567
569
|
//#region src/components/json-editor/JsonEditor.tsx
|
|
568
|
-
function
|
|
570
|
+
function At(e) {
|
|
569
571
|
if (!e.trim()) return !1;
|
|
570
572
|
try {
|
|
571
573
|
return JSON.parse(e), !0;
|
|
@@ -573,17 +575,17 @@ function Ot(e) {
|
|
|
573
575
|
return !1;
|
|
574
576
|
}
|
|
575
577
|
}
|
|
576
|
-
function
|
|
578
|
+
function jt({ 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 }) {
|
|
577
579
|
let T = {
|
|
578
|
-
...
|
|
580
|
+
...Tt,
|
|
579
581
|
...x
|
|
580
582
|
}, E = {
|
|
581
|
-
...
|
|
583
|
+
...wt,
|
|
582
584
|
...b
|
|
583
|
-
}, D =
|
|
585
|
+
}, D = kt(a), k = kt(c), A = D === "auto", j = A ? void 0 : D ?? 300, M = o(null), [N, P] = s({
|
|
584
586
|
line: 1,
|
|
585
587
|
col: 1
|
|
586
|
-
}), [F, I] = s(() =>
|
|
588
|
+
}), [F, I] = s(() => At(e ?? "")), L = t((e) => {
|
|
587
589
|
M.current = e;
|
|
588
590
|
}, []), R = t((e, t) => {
|
|
589
591
|
P({
|
|
@@ -591,7 +593,7 @@ function kt({ value: e, onChange: n, onValidChange: r, placeholder: i, height: a
|
|
|
591
593
|
col: t
|
|
592
594
|
});
|
|
593
595
|
}, []), z = t((e) => {
|
|
594
|
-
let t =
|
|
596
|
+
let t = At(e);
|
|
595
597
|
I(t), r?.(t), n?.(e);
|
|
596
598
|
}, [n, r]), B = _ || y || !!p;
|
|
597
599
|
return /* @__PURE__ */ W(l, {
|
|
@@ -617,13 +619,13 @@ function kt({ value: e, onChange: n, onValidChange: r, placeholder: i, height: a
|
|
|
617
619
|
borderWidth: 2
|
|
618
620
|
}
|
|
619
621
|
},
|
|
620
|
-
children: [!d && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(
|
|
622
|
+
children: [!d && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(Dt, {
|
|
621
623
|
viewRef: M,
|
|
622
624
|
toolbarConfig: E,
|
|
623
625
|
translation: T,
|
|
624
626
|
indent: h,
|
|
625
627
|
disabled: u
|
|
626
|
-
}), /* @__PURE__ */ U(v, {})] }), /* @__PURE__ */ U(
|
|
628
|
+
}), /* @__PURE__ */ U(v, {})] }), /* @__PURE__ */ U(Et, {
|
|
627
629
|
value: e,
|
|
628
630
|
onChange: z,
|
|
629
631
|
placeholder: i,
|
|
@@ -637,7 +639,7 @@ function kt({ value: e, onChange: n, onValidChange: r, placeholder: i, height: a
|
|
|
637
639
|
onFocus: w
|
|
638
640
|
})]
|
|
639
641
|
}),
|
|
640
|
-
B && /* @__PURE__ */ U(
|
|
642
|
+
B && /* @__PURE__ */ U(Ot, {
|
|
641
643
|
helperText: p,
|
|
642
644
|
error: f,
|
|
643
645
|
showLineColumn: _,
|
|
@@ -657,28 +659,28 @@ function kt({ value: e, onChange: n, onValidChange: r, placeholder: i, height: a
|
|
|
657
659
|
}
|
|
658
660
|
//#endregion
|
|
659
661
|
//#region src/components/gantt-chart/util/gantt-chart.util.ts
|
|
660
|
-
function
|
|
661
|
-
let t = /* @__PURE__ */ new Date(), n =
|
|
662
|
+
function Mt(e) {
|
|
663
|
+
let t = /* @__PURE__ */ new Date(), n = qt(t), r = Jt(t);
|
|
662
664
|
if (e.length === 0) return {
|
|
663
665
|
start: n,
|
|
664
666
|
end: r
|
|
665
667
|
};
|
|
666
|
-
let i = e.map((e) => e.startDate.getTime()), a = e.map((e) => e.endDate.getTime()), o =
|
|
668
|
+
let i = e.map((e) => e.startDate.getTime()), a = e.map((e) => e.endDate.getTime()), o = Rt(Bt(new Date(Math.min(...i)), -1)), s = zt(Bt(new Date(Math.max(...a)), 1));
|
|
667
669
|
return {
|
|
668
670
|
start: o < n ? o : n,
|
|
669
671
|
end: s > r ? s : r
|
|
670
672
|
};
|
|
671
673
|
}
|
|
672
|
-
function
|
|
674
|
+
function Nt(e, t) {
|
|
673
675
|
return t === "weeks" ? {
|
|
674
|
-
start:
|
|
676
|
+
start: Ut(e.start),
|
|
675
677
|
end: e.end
|
|
676
678
|
} : t === "quarters" ? {
|
|
677
|
-
start:
|
|
678
|
-
end:
|
|
679
|
+
start: qt(e.start),
|
|
680
|
+
end: Jt(e.end)
|
|
679
681
|
} : e;
|
|
680
682
|
}
|
|
681
|
-
function
|
|
683
|
+
function Pt(e, t) {
|
|
682
684
|
let n = t.end.getTime() - t.start.getTime();
|
|
683
685
|
if (n <= 0) return {
|
|
684
686
|
left: 0,
|
|
@@ -690,7 +692,7 @@ function Mt(e, t) {
|
|
|
690
692
|
width: Math.max(0, i)
|
|
691
693
|
};
|
|
692
694
|
}
|
|
693
|
-
function
|
|
695
|
+
function Ft(e) {
|
|
694
696
|
let t = /* @__PURE__ */ new Map();
|
|
695
697
|
for (let n of e) t.set(n.id, {
|
|
696
698
|
...n,
|
|
@@ -699,31 +701,31 @@ function Nt(e) {
|
|
|
699
701
|
});
|
|
700
702
|
let n = [];
|
|
701
703
|
for (let e of t.values()) e.parentId && t.has(e.parentId) ? t.get(e.parentId).children.push(e) : n.push(e);
|
|
702
|
-
return
|
|
704
|
+
return It(n, 0), n;
|
|
703
705
|
}
|
|
704
|
-
function
|
|
705
|
-
for (let n of e) n.depth = t,
|
|
706
|
+
function It(e, t) {
|
|
707
|
+
for (let n of e) n.depth = t, It(n.children, t + 1);
|
|
706
708
|
}
|
|
707
|
-
function
|
|
709
|
+
function Lt(e, t) {
|
|
708
710
|
let n = [];
|
|
709
711
|
function r(e) {
|
|
710
712
|
for (let i of e) n.push(i), i.children.length > 0 && t.has(i.id) && r(i.children);
|
|
711
713
|
}
|
|
712
714
|
return r(e), n;
|
|
713
715
|
}
|
|
714
|
-
function
|
|
716
|
+
function Rt(e) {
|
|
715
717
|
return new Date(e.getFullYear(), e.getMonth(), 1, 0, 0, 0, 0);
|
|
716
718
|
}
|
|
717
|
-
function
|
|
719
|
+
function zt(e) {
|
|
718
720
|
return new Date(e.getFullYear(), e.getMonth() + 1, 0, 23, 59, 59, 999);
|
|
719
721
|
}
|
|
720
|
-
function
|
|
722
|
+
function Bt(e, t) {
|
|
721
723
|
return new Date(e.getFullYear(), e.getMonth() + t, e.getDate());
|
|
722
724
|
}
|
|
723
725
|
function Z(e, t) {
|
|
724
726
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate() + t, 0, 0, 0, 0);
|
|
725
727
|
}
|
|
726
|
-
function
|
|
728
|
+
function Vt(e, t, n) {
|
|
727
729
|
if (n === 0) return e;
|
|
728
730
|
let r = /* @__PURE__ */ new Map();
|
|
729
731
|
for (let t of e) for (let e of t.dependencies ?? []) r.has(e) || r.set(e, []), r.get(e).push(t.id);
|
|
@@ -741,41 +743,41 @@ function zt(e, t, n) {
|
|
|
741
743
|
}
|
|
742
744
|
return e.map((e) => i.get(e.id));
|
|
743
745
|
}
|
|
744
|
-
function
|
|
745
|
-
let t = [], n =
|
|
746
|
-
for (; n <= e.end;) t.push(n), n =
|
|
746
|
+
function Ht(e) {
|
|
747
|
+
let t = [], n = Rt(e.start);
|
|
748
|
+
for (; n <= e.end;) t.push(n), n = Bt(n, 1);
|
|
747
749
|
return t;
|
|
748
750
|
}
|
|
749
|
-
function
|
|
751
|
+
function Ut(e) {
|
|
750
752
|
let t = new Date(e), n = t.getDay(), r = n === 0 ? -6 : 1 - n;
|
|
751
753
|
return t.setDate(t.getDate() + r), t.setHours(0, 0, 0, 0), t;
|
|
752
754
|
}
|
|
753
|
-
function
|
|
755
|
+
function Wt(e) {
|
|
754
756
|
let t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate())), n = t.getUTCDay() || 7;
|
|
755
757
|
t.setUTCDate(t.getUTCDate() + 4 - n);
|
|
756
758
|
let r = new Date(Date.UTC(t.getUTCFullYear(), 0, 1));
|
|
757
759
|
return Math.ceil(((t.getTime() - r.getTime()) / 864e5 + 1) / 7);
|
|
758
760
|
}
|
|
759
|
-
function
|
|
760
|
-
let t = [], n =
|
|
761
|
+
function Gt(e) {
|
|
762
|
+
let t = [], n = Ut(e.start);
|
|
761
763
|
for (; n <= e.end;) t.push(new Date(n)), n = new Date(n.getFullYear(), n.getMonth(), n.getDate() + 7);
|
|
762
764
|
return t;
|
|
763
765
|
}
|
|
764
|
-
function
|
|
766
|
+
function Kt(e) {
|
|
765
767
|
let t = [], n = new Date(e.start.getFullYear(), e.start.getMonth(), e.start.getDate(), 0, 0, 0, 0), r = new Date(e.end.getFullYear(), e.end.getMonth(), e.end.getDate(), 0, 0, 0, 0).getTime();
|
|
766
768
|
for (; n.getTime() <= r;) t.push(new Date(n)), n = new Date(n.getFullYear(), n.getMonth(), n.getDate() + 1, 0, 0, 0, 0);
|
|
767
769
|
return t;
|
|
768
770
|
}
|
|
769
|
-
function
|
|
771
|
+
function qt(e) {
|
|
770
772
|
let t = Math.floor(e.getMonth() / 3) * 3;
|
|
771
773
|
return new Date(e.getFullYear(), t, 1, 0, 0, 0, 0);
|
|
772
774
|
}
|
|
773
|
-
function
|
|
775
|
+
function Jt(e) {
|
|
774
776
|
let t = Math.floor(e.getMonth() / 3) * 3 + 2;
|
|
775
|
-
return
|
|
777
|
+
return zt(new Date(e.getFullYear(), t, 1));
|
|
776
778
|
}
|
|
777
|
-
function
|
|
778
|
-
let t = [], n =
|
|
779
|
+
function Yt(e) {
|
|
780
|
+
let t = [], n = qt(e.start);
|
|
779
781
|
for (; n <= e.end;) {
|
|
780
782
|
let e = Math.floor(n.getMonth() / 3) + 1;
|
|
781
783
|
t.push({
|
|
@@ -786,7 +788,7 @@ function qt(e) {
|
|
|
786
788
|
}
|
|
787
789
|
return t;
|
|
788
790
|
}
|
|
789
|
-
function
|
|
791
|
+
function Xt(e) {
|
|
790
792
|
if (e.length === 0) return /* @__PURE__ */ new Set();
|
|
791
793
|
let t = /* @__PURE__ */ new Map();
|
|
792
794
|
for (let n of e) for (let e of n.dependencies ?? []) t.has(e) || t.set(e, []), t.get(e).push(n.id);
|
|
@@ -806,18 +808,18 @@ function Jt(e) {
|
|
|
806
808
|
}
|
|
807
809
|
//#endregion
|
|
808
810
|
//#region src/components/gantt-chart/GanttChart.store.ts
|
|
809
|
-
function
|
|
810
|
-
let n = t.startDate < e.start ?
|
|
811
|
+
function Zt(e, t) {
|
|
812
|
+
let n = t.startDate < e.start ? Rt(Bt(t.startDate, -1)) : e.start, r = t.endDate > e.end ? zt(Bt(t.endDate, 1)) : e.end;
|
|
811
813
|
return n === e.start && r === e.end ? e : {
|
|
812
814
|
start: n,
|
|
813
815
|
end: r
|
|
814
816
|
};
|
|
815
817
|
}
|
|
816
|
-
function
|
|
817
|
-
let a =
|
|
818
|
+
function Qt(e, t = "months", n = !1, r, i = !1) {
|
|
819
|
+
let a = Mt(e);
|
|
818
820
|
return Ce((o, s) => ({
|
|
819
821
|
tasks: e,
|
|
820
|
-
taskTree:
|
|
822
|
+
taskTree: Ft(e),
|
|
821
823
|
expandedIds: n ? new Set(e.map((e) => e.id)) : new Set(e.filter((e) => !e.parentId).map((e) => e.id)),
|
|
822
824
|
timeScale: t,
|
|
823
825
|
timelineRange: r ?? a,
|
|
@@ -829,8 +831,8 @@ function Xt(e, t = "months", n = !1, r, i = !1) {
|
|
|
829
831
|
setTasks: (e) => {
|
|
830
832
|
o((t) => ({
|
|
831
833
|
tasks: e,
|
|
832
|
-
taskTree:
|
|
833
|
-
...t.isRangeCustomized ? {} : { timelineRange:
|
|
834
|
+
taskTree: Ft(e),
|
|
835
|
+
...t.isRangeCustomized ? {} : { timelineRange: Mt(e) }
|
|
834
836
|
}));
|
|
835
837
|
},
|
|
836
838
|
addTask: (e) => {
|
|
@@ -838,8 +840,8 @@ function Xt(e, t = "months", n = !1, r, i = !1) {
|
|
|
838
840
|
let n = [...t.tasks, e];
|
|
839
841
|
return {
|
|
840
842
|
tasks: n,
|
|
841
|
-
taskTree:
|
|
842
|
-
timelineRange:
|
|
843
|
+
taskTree: Ft(n),
|
|
844
|
+
timelineRange: Zt(t.timelineRange, e)
|
|
843
845
|
};
|
|
844
846
|
});
|
|
845
847
|
},
|
|
@@ -848,13 +850,13 @@ function Xt(e, t = "months", n = !1, r, i = !1) {
|
|
|
848
850
|
let n = t.tasks.find((t) => t.id === e.id), r = t.tasks.map((t) => t.id === e.id ? e : t);
|
|
849
851
|
if (t.cascadeDependencies && n) {
|
|
850
852
|
let t = e.endDate.getTime() - n.endDate.getTime();
|
|
851
|
-
r =
|
|
853
|
+
r = Vt(r, e.id, t);
|
|
852
854
|
}
|
|
853
|
-
let i =
|
|
854
|
-
for (let e of r) i =
|
|
855
|
+
let i = Zt(t.timelineRange, e);
|
|
856
|
+
for (let e of r) i = Zt(i, e);
|
|
855
857
|
return {
|
|
856
858
|
tasks: r,
|
|
857
|
-
taskTree:
|
|
859
|
+
taskTree: Ft(r),
|
|
858
860
|
timelineRange: i
|
|
859
861
|
};
|
|
860
862
|
});
|
|
@@ -868,7 +870,7 @@ function Xt(e, t = "months", n = !1, r, i = !1) {
|
|
|
868
870
|
let i = t.tasks.filter((e) => !n.has(e.id));
|
|
869
871
|
return {
|
|
870
872
|
tasks: i,
|
|
871
|
-
taskTree:
|
|
873
|
+
taskTree: Ft(i)
|
|
872
874
|
};
|
|
873
875
|
});
|
|
874
876
|
},
|
|
@@ -901,14 +903,14 @@ function Xt(e, t = "months", n = !1, r, i = !1) {
|
|
|
901
903
|
},
|
|
902
904
|
resetTimelineRange: () => {
|
|
903
905
|
o((e) => ({
|
|
904
|
-
timelineRange:
|
|
906
|
+
timelineRange: Mt(e.tasks),
|
|
905
907
|
isRangeCustomized: !1
|
|
906
908
|
}));
|
|
907
909
|
},
|
|
908
910
|
resetView: () => {
|
|
909
911
|
o((e) => ({
|
|
910
912
|
timeScale: e.defaultTimeScale,
|
|
911
|
-
timelineRange:
|
|
913
|
+
timelineRange: Mt(e.tasks),
|
|
912
914
|
isRangeCustomized: !1,
|
|
913
915
|
isExpandedCustomized: !1,
|
|
914
916
|
expandedIds: e.initialExpandAll ? new Set(e.tasks.map((e) => e.id)) : new Set(e.tasks.filter((e) => !e.parentId).map((e) => e.id))
|
|
@@ -916,13 +918,13 @@ function Xt(e, t = "months", n = !1, r, i = !1) {
|
|
|
916
918
|
},
|
|
917
919
|
getVisibleTasks: () => {
|
|
918
920
|
let { taskTree: e, expandedIds: t } = s();
|
|
919
|
-
return
|
|
921
|
+
return Lt(e, t);
|
|
920
922
|
}
|
|
921
923
|
}));
|
|
922
924
|
}
|
|
923
925
|
//#endregion
|
|
924
926
|
//#region src/components/gantt-chart/GanttChart.types.ts
|
|
925
|
-
var
|
|
927
|
+
var $t = {
|
|
926
928
|
scaleDays: "Tage",
|
|
927
929
|
scaleWeeks: "Wochen",
|
|
928
930
|
scaleMonths: "Monate",
|
|
@@ -962,12 +964,12 @@ var Zt = {
|
|
|
962
964
|
addTaskTooltip: "Aufgabe hinzufügen",
|
|
963
965
|
editTaskTooltip: "Aufgabe bearbeiten",
|
|
964
966
|
deleteTaskTooltip: "Aufgabe löschen"
|
|
965
|
-
},
|
|
967
|
+
}, en = {
|
|
966
968
|
planned: "warning.light",
|
|
967
969
|
"in-progress": "info.main",
|
|
968
970
|
done: "success.main",
|
|
969
971
|
blocked: "error.main"
|
|
970
|
-
},
|
|
972
|
+
}, tn = {
|
|
971
973
|
planned: "warning",
|
|
972
974
|
"in-progress": "info",
|
|
973
975
|
done: "success",
|
|
@@ -975,16 +977,16 @@ var Zt = {
|
|
|
975
977
|
};
|
|
976
978
|
//#endregion
|
|
977
979
|
//#region src/components/gantt-chart/GanttTaskDialog.tsx
|
|
978
|
-
function
|
|
980
|
+
function nn(e) {
|
|
979
981
|
return e.toISOString().slice(0, 10);
|
|
980
982
|
}
|
|
981
|
-
function
|
|
983
|
+
function rn(e, t, n) {
|
|
982
984
|
return e < t ? t : e > n ? n : e;
|
|
983
985
|
}
|
|
984
|
-
function
|
|
985
|
-
return e.flatMap((e) => [e, ...
|
|
986
|
+
function an(e) {
|
|
987
|
+
return e.flatMap((e) => [e, ...an(e.children)]);
|
|
986
988
|
}
|
|
987
|
-
function
|
|
989
|
+
function on({ label: e }) {
|
|
988
990
|
let t = o(null), [n, r] = s(!1);
|
|
989
991
|
return /* @__PURE__ */ U(F, {
|
|
990
992
|
title: e,
|
|
@@ -1007,8 +1009,8 @@ function rn({ label: e }) {
|
|
|
1007
1009
|
})
|
|
1008
1010
|
});
|
|
1009
1011
|
}
|
|
1010
|
-
function
|
|
1011
|
-
let f = $(), g = Q((e) => e.taskTree), v = Q((e) => e.timelineRange), x = a(() =>
|
|
1012
|
+
function sn({ open: e, mode: t, initialTask: n, defaultParentId: i, onSave: o, onClose: c }) {
|
|
1013
|
+
let f = $(), g = Q((e) => e.taskTree), v = Q((e) => e.timelineRange), x = a(() => an(g), [g]), S = a(() => {
|
|
1012
1014
|
if (t === "add" || !n) return /* @__PURE__ */ new Set();
|
|
1013
1015
|
let e = (t) => [t.id, ...t.children.flatMap(e)], r = x.find((e) => e.id === n.id);
|
|
1014
1016
|
return new Set(r ? e(r) : [n.id]);
|
|
@@ -1016,7 +1018,7 @@ function an({ open: e, mode: t, initialTask: n, defaultParentId: i, onSave: o, o
|
|
|
1016
1018
|
t,
|
|
1017
1019
|
n,
|
|
1018
1020
|
x
|
|
1019
|
-
]), C = x.filter((e) => !S.has(e.id)), T = C, D =
|
|
1021
|
+
]), C = x.filter((e) => !S.has(e.id)), T = C, D = nn(rn(/* @__PURE__ */ new Date(), v.start, v.end)), [O, k] = s({
|
|
1020
1022
|
name: "",
|
|
1021
1023
|
startDate: D,
|
|
1022
1024
|
endDate: D,
|
|
@@ -1027,11 +1029,11 @@ function an({ open: e, mode: t, initialTask: n, defaultParentId: i, onSave: o, o
|
|
|
1027
1029
|
});
|
|
1028
1030
|
r(() => {
|
|
1029
1031
|
if (!e) return;
|
|
1030
|
-
let r =
|
|
1032
|
+
let r = nn(rn(/* @__PURE__ */ new Date(), v.start, v.end));
|
|
1031
1033
|
k(t === "edit" && n ? {
|
|
1032
1034
|
name: n.name,
|
|
1033
|
-
startDate:
|
|
1034
|
-
endDate:
|
|
1035
|
+
startDate: nn(n.startDate),
|
|
1036
|
+
endDate: nn(n.endDate),
|
|
1035
1037
|
status: n.status,
|
|
1036
1038
|
isMilestone: n.isMilestone ?? !1,
|
|
1037
1039
|
parentId: n.parentId ?? "",
|
|
@@ -1212,7 +1214,7 @@ function an({ open: e, mode: t, initialTask: n, defaultParentId: i, onSave: o, o
|
|
|
1212
1214
|
flexShrink: 0
|
|
1213
1215
|
},
|
|
1214
1216
|
children: "└"
|
|
1215
|
-
}), /* @__PURE__ */ U(
|
|
1217
|
+
}), /* @__PURE__ */ U(on, { label: e.name })]
|
|
1216
1218
|
})
|
|
1217
1219
|
}, e.id))]
|
|
1218
1220
|
})]
|
|
@@ -1256,7 +1258,7 @@ function an({ open: e, mode: t, initialTask: n, defaultParentId: i, onSave: o, o
|
|
|
1256
1258
|
flexShrink: 0
|
|
1257
1259
|
},
|
|
1258
1260
|
children: "└"
|
|
1259
|
-
}), /* @__PURE__ */ U(
|
|
1261
|
+
}), /* @__PURE__ */ U(on, { label: e.name })]
|
|
1260
1262
|
})
|
|
1261
1263
|
}, e.id))
|
|
1262
1264
|
})]
|
|
@@ -1278,7 +1280,7 @@ function an({ open: e, mode: t, initialTask: n, defaultParentId: i, onSave: o, o
|
|
|
1278
1280
|
}
|
|
1279
1281
|
//#endregion
|
|
1280
1282
|
//#region src/components/gantt-chart/GanttDeleteDialog.tsx
|
|
1281
|
-
function
|
|
1283
|
+
function cn({ open: e, task: t, onConfirm: n, onClose: r }) {
|
|
1282
1284
|
let i = $(), a = i.dialogDeleteConfirm.replace("{name}", t?.name ?? "");
|
|
1283
1285
|
return /* @__PURE__ */ W(p, {
|
|
1284
1286
|
open: e,
|
|
@@ -1304,7 +1306,7 @@ function on({ open: e, task: t, onConfirm: n, onClose: r }) {
|
|
|
1304
1306
|
}
|
|
1305
1307
|
//#endregion
|
|
1306
1308
|
//#region src/components/gantt-chart/GanttTaskPanel.tsx
|
|
1307
|
-
function
|
|
1309
|
+
function ln(e, t) {
|
|
1308
1310
|
return {
|
|
1309
1311
|
planned: t.statusPlanned,
|
|
1310
1312
|
"in-progress": t.statusInProgress,
|
|
@@ -1312,8 +1314,8 @@ function sn(e, t) {
|
|
|
1312
1314
|
blocked: t.statusBlocked
|
|
1313
1315
|
}[e];
|
|
1314
1316
|
}
|
|
1315
|
-
function
|
|
1316
|
-
let [m, h] = s(null), [g, _] = s(null), v = $(), { statusColors: y } =
|
|
1317
|
+
function un({ task: e, expandedIds: t, toggleExpand: n, hasActionsColumn: r, onTaskClick: i, onAddTask: a, onEditTask: o, onDeleteTask: c, onStatusChange: u, inlineEdit: d, onInlineRename: p }) {
|
|
1318
|
+
let [m, h] = s(null), [g, _] = s(null), v = $(), { statusColors: y } = Mn(), b = () => {
|
|
1317
1319
|
g !== null && g.trim() && p?.(e, g.trim()), _(null);
|
|
1318
1320
|
};
|
|
1319
1321
|
return /* @__PURE__ */ W(l, {
|
|
@@ -1369,7 +1371,7 @@ function cn({ task: e, expandedIds: t, toggleExpand: n, hasActionsColumn: r, onT
|
|
|
1369
1371
|
borderRadius: e.isMilestone ? 0 : "50%",
|
|
1370
1372
|
transform: e.isMilestone ? "rotate(45deg)" : void 0,
|
|
1371
1373
|
flexShrink: 0,
|
|
1372
|
-
bgcolor: e.color ?? y?.[e.status] ??
|
|
1374
|
+
bgcolor: e.color ?? y?.[e.status] ?? en[e.status] ?? "grey.400"
|
|
1373
1375
|
} }),
|
|
1374
1376
|
g === null ? /* @__PURE__ */ U(I, {
|
|
1375
1377
|
variant: "body2",
|
|
@@ -1457,10 +1459,10 @@ function cn({ task: e, expandedIds: t, toggleExpand: n, hasActionsColumn: r, onT
|
|
|
1457
1459
|
justifyContent: "center"
|
|
1458
1460
|
},
|
|
1459
1461
|
children: [/* @__PURE__ */ U(f, {
|
|
1460
|
-
label:
|
|
1462
|
+
label: ln(e.status, v),
|
|
1461
1463
|
size: "small",
|
|
1462
1464
|
variant: "outlined",
|
|
1463
|
-
color: e.color ?? y?.[e.status] ? "default" :
|
|
1465
|
+
color: e.color ?? y?.[e.status] ? "default" : tn[e.status] ?? "default",
|
|
1464
1466
|
sx: {
|
|
1465
1467
|
height: 20,
|
|
1466
1468
|
fontSize: 10,
|
|
@@ -1487,15 +1489,15 @@ function cn({ task: e, expandedIds: t, toggleExpand: n, hasActionsColumn: r, onT
|
|
|
1487
1489
|
onClick: () => {
|
|
1488
1490
|
u(e, t), h(null);
|
|
1489
1491
|
},
|
|
1490
|
-
children:
|
|
1492
|
+
children: ln(t, v)
|
|
1491
1493
|
}, t))
|
|
1492
1494
|
})]
|
|
1493
1495
|
})
|
|
1494
1496
|
]
|
|
1495
1497
|
});
|
|
1496
1498
|
}
|
|
1497
|
-
function
|
|
1498
|
-
let v = $(), y =
|
|
1499
|
+
function dn({ 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 }) {
|
|
1500
|
+
let v = $(), y = kn(), 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(() => Lt(b, x), [b, x]), O = we({
|
|
1499
1501
|
count: D.length,
|
|
1500
1502
|
getScrollElement: () => e.current,
|
|
1501
1503
|
estimateSize: () => 40,
|
|
@@ -1617,7 +1619,7 @@ function ln({ scrollRef: e, onScroll: t, panelWidth: n, onTaskClick: r, onAddTas
|
|
|
1617
1619
|
height: 40,
|
|
1618
1620
|
transform: `translateY(${e.start}px)`
|
|
1619
1621
|
},
|
|
1620
|
-
children: /* @__PURE__ */ U(
|
|
1622
|
+
children: /* @__PURE__ */ U(un, {
|
|
1621
1623
|
task: D[e.index],
|
|
1622
1624
|
expandedIds: x,
|
|
1623
1625
|
toggleExpand: S,
|
|
@@ -1631,7 +1633,7 @@ function ln({ scrollRef: e, onScroll: t, panelWidth: n, onTaskClick: r, onAddTas
|
|
|
1631
1633
|
onInlineRename: g ? V : void 0
|
|
1632
1634
|
})
|
|
1633
1635
|
}, e.key))
|
|
1634
|
-
}) : D.map((e) => /* @__PURE__ */ U(
|
|
1636
|
+
}) : D.map((e) => /* @__PURE__ */ U(un, {
|
|
1635
1637
|
task: e,
|
|
1636
1638
|
expandedIds: x,
|
|
1637
1639
|
toggleExpand: S,
|
|
@@ -1645,21 +1647,21 @@ function ln({ scrollRef: e, onScroll: t, panelWidth: n, onTaskClick: r, onAddTas
|
|
|
1645
1647
|
onInlineRename: g ? V : void 0
|
|
1646
1648
|
}, e.id)),
|
|
1647
1649
|
f && /* @__PURE__ */ W(H, { children: [
|
|
1648
|
-
/* @__PURE__ */ U(
|
|
1650
|
+
/* @__PURE__ */ U(sn, {
|
|
1649
1651
|
open: k,
|
|
1650
1652
|
mode: "add",
|
|
1651
1653
|
defaultParentId: F?.id,
|
|
1652
1654
|
onSave: R,
|
|
1653
1655
|
onClose: () => A(!1)
|
|
1654
1656
|
}),
|
|
1655
|
-
/* @__PURE__ */ U(
|
|
1657
|
+
/* @__PURE__ */ U(sn, {
|
|
1656
1658
|
open: j,
|
|
1657
1659
|
mode: "edit",
|
|
1658
1660
|
initialTask: F ?? void 0,
|
|
1659
1661
|
onSave: z,
|
|
1660
1662
|
onClose: () => M(!1)
|
|
1661
1663
|
}),
|
|
1662
|
-
/* @__PURE__ */ U(
|
|
1664
|
+
/* @__PURE__ */ U(cn, {
|
|
1663
1665
|
open: N,
|
|
1664
1666
|
task: F,
|
|
1665
1667
|
onConfirm: B,
|
|
@@ -1671,10 +1673,10 @@ function ln({ scrollRef: e, onScroll: t, panelWidth: n, onTaskClick: r, onAddTas
|
|
|
1671
1673
|
}
|
|
1672
1674
|
//#endregion
|
|
1673
1675
|
//#region src/components/gantt-chart/hooks/useGanttDrag.ts
|
|
1674
|
-
var
|
|
1675
|
-
function
|
|
1676
|
-
let a = Q((e) => e.updateTask), c =
|
|
1677
|
-
u.current = e > 0 ? e / ((t.end.getTime() - t.start.getTime()) /
|
|
1676
|
+
var fn = 864e5;
|
|
1677
|
+
function pn({ totalWidth: e, displayRange: t, onTaskMoved: n, onTaskResized: r, onTasksChange: i }) {
|
|
1678
|
+
let a = Q((e) => e.updateTask), c = kn(), l = $(), u = o(1);
|
|
1679
|
+
u.current = e > 0 ? e / ((t.end.getTime() - t.start.getTime()) / fn) : 1;
|
|
1678
1680
|
let d = o(n);
|
|
1679
1681
|
d.current = n;
|
|
1680
1682
|
let f = o(r);
|
|
@@ -1775,7 +1777,7 @@ function dn({ totalWidth: e, displayRange: t, onTaskMoved: n, onTaskResized: r,
|
|
|
1775
1777
|
}
|
|
1776
1778
|
//#endregion
|
|
1777
1779
|
//#region src/components/gantt-chart/GanttTimelineHeader.tsx
|
|
1778
|
-
function
|
|
1780
|
+
function mn({ items: e }) {
|
|
1779
1781
|
return /* @__PURE__ */ U(l, {
|
|
1780
1782
|
sx: { display: "flex" },
|
|
1781
1783
|
children: e.map((e) => /* @__PURE__ */ U(l, {
|
|
@@ -1798,7 +1800,7 @@ function fn({ items: e }) {
|
|
|
1798
1800
|
}, e.key))
|
|
1799
1801
|
});
|
|
1800
1802
|
}
|
|
1801
|
-
function
|
|
1803
|
+
function hn({ columns: e, groups: t }) {
|
|
1802
1804
|
return /* @__PURE__ */ W(l, {
|
|
1803
1805
|
sx: {
|
|
1804
1806
|
position: "sticky",
|
|
@@ -1817,14 +1819,14 @@ function pn({ columns: e, groups: t }) {
|
|
|
1817
1819
|
borderColor: "divider",
|
|
1818
1820
|
overflow: "visible"
|
|
1819
1821
|
},
|
|
1820
|
-
children: /* @__PURE__ */ U(
|
|
1821
|
-
}), /* @__PURE__ */ U(
|
|
1822
|
+
children: /* @__PURE__ */ U(mn, { items: t })
|
|
1823
|
+
}), /* @__PURE__ */ U(mn, { items: e })]
|
|
1822
1824
|
});
|
|
1823
1825
|
}
|
|
1824
1826
|
//#endregion
|
|
1825
1827
|
//#region src/components/gantt-chart/GanttBarRow.tsx
|
|
1826
|
-
function
|
|
1827
|
-
let v = L(), { statusColors: y, criticalPathColor: b, milestoneColor: x, barBorderRadius: S } =
|
|
1828
|
+
function gn({ 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: _ }) {
|
|
1829
|
+
let v = L(), { statusColors: y, criticalPathColor: b, milestoneColor: x, barBorderRadius: S } = Mn(), C = n?.taskId === e.id, w = e;
|
|
1828
1830
|
if (C && n) if (n.type === "move") w = {
|
|
1829
1831
|
...e,
|
|
1830
1832
|
startDate: Z(e.startDate, n.deltaDays),
|
|
@@ -1840,7 +1842,7 @@ function mn({ task: e, virtualTop: t, activeDrag: n, displayRange: r, totalWidth
|
|
|
1840
1842
|
...e,
|
|
1841
1843
|
progress: n.newProgress
|
|
1842
1844
|
});
|
|
1843
|
-
let { left: T, width: E } =
|
|
1845
|
+
let { left: T, width: E } = Pt(w, r);
|
|
1844
1846
|
return /* @__PURE__ */ U(l, {
|
|
1845
1847
|
"data-testid": `gantt-bar-row-${e.id}`,
|
|
1846
1848
|
style: t === void 0 ? void 0 : {
|
|
@@ -1858,7 +1860,7 @@ function mn({ task: e, virtualTop: t, activeDrag: n, displayRange: r, totalWidth
|
|
|
1858
1860
|
backgroundSize: `${a}px 100%`,
|
|
1859
1861
|
backgroundRepeat: "repeat-x"
|
|
1860
1862
|
},
|
|
1861
|
-
children: e.isMilestone ? /* @__PURE__ */ U(
|
|
1863
|
+
children: e.isMilestone ? /* @__PURE__ */ U(_n, {
|
|
1862
1864
|
task: e,
|
|
1863
1865
|
left: T,
|
|
1864
1866
|
milestoneColor: x,
|
|
@@ -1866,7 +1868,7 @@ function mn({ task: e, virtualTop: t, activeDrag: n, displayRange: r, totalWidth
|
|
|
1866
1868
|
isCritical: o.has(e.id),
|
|
1867
1869
|
onMilestoneClick: f,
|
|
1868
1870
|
theme: v
|
|
1869
|
-
}) : /* @__PURE__ */ U(
|
|
1871
|
+
}) : /* @__PURE__ */ U(vn, {
|
|
1870
1872
|
task: e,
|
|
1871
1873
|
effectiveTask: w,
|
|
1872
1874
|
left: T,
|
|
@@ -1891,7 +1893,7 @@ function mn({ task: e, virtualTop: t, activeDrag: n, displayRange: r, totalWidth
|
|
|
1891
1893
|
})
|
|
1892
1894
|
});
|
|
1893
1895
|
}
|
|
1894
|
-
function
|
|
1896
|
+
function _n({ task: e, left: t, milestoneColor: n, criticalPathColor: r, isCritical: i, onMilestoneClick: a, theme: o }) {
|
|
1895
1897
|
return t < 0 || t > 100 ? null : /* @__PURE__ */ U(l, {
|
|
1896
1898
|
"data-testid": `gantt-milestone-${e.id}`,
|
|
1897
1899
|
sx: {
|
|
@@ -1909,14 +1911,14 @@ function hn({ task: e, left: t, milestoneColor: n, criticalPathColor: r, isCriti
|
|
|
1909
1911
|
onClick: () => a?.(e)
|
|
1910
1912
|
});
|
|
1911
1913
|
}
|
|
1912
|
-
function
|
|
1914
|
+
function vn({ 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
1915
|
let S = Math.max(0, n), C = Math.min(100, n + Math.max(r, .5)) - S;
|
|
1914
1916
|
return C <= 0 ? null : /* @__PURE__ */ W(H, { children: [
|
|
1915
|
-
a && o && o.type !== "progress" && o.deltaDays !== 0 && /* @__PURE__ */ U(
|
|
1917
|
+
a && o && o.type !== "progress" && o.deltaDays !== 0 && /* @__PURE__ */ U(yn, {
|
|
1916
1918
|
left: S,
|
|
1917
1919
|
children: o.type === "move" ? `${b(t.startDate)} – ${b(t.endDate)}` : `→ ${b(t.endDate)}`
|
|
1918
1920
|
}),
|
|
1919
|
-
a && o?.type === "progress" && o.newProgress !== void 0 && /* @__PURE__ */ W(
|
|
1921
|
+
a && o?.type === "progress" && o.newProgress !== void 0 && /* @__PURE__ */ W(yn, {
|
|
1920
1922
|
left: S,
|
|
1921
1923
|
children: [o.newProgress, "%"]
|
|
1922
1924
|
}),
|
|
@@ -1929,7 +1931,7 @@ function gn({ task: e, effectiveTask: t, left: n, width: r, totalWidth: i, isDra
|
|
|
1929
1931
|
height: 16,
|
|
1930
1932
|
top: "50%",
|
|
1931
1933
|
transform: "translateY(-50%)",
|
|
1932
|
-
bgcolor: e.color ?? f?.[e.status] ??
|
|
1934
|
+
bgcolor: e.color ?? f?.[e.status] ?? en[e.status] ?? "grey.300",
|
|
1933
1935
|
borderRadius: m === void 0 ? 1 : `${m}px`,
|
|
1934
1936
|
overflow: "hidden",
|
|
1935
1937
|
opacity: a ? .75 : 1,
|
|
@@ -1998,7 +2000,7 @@ function gn({ task: e, effectiveTask: t, left: n, width: r, totalWidth: i, isDra
|
|
|
1998
2000
|
})
|
|
1999
2001
|
] });
|
|
2000
2002
|
}
|
|
2001
|
-
function
|
|
2003
|
+
function yn({ left: e, children: t }) {
|
|
2002
2004
|
return /* @__PURE__ */ U(l, {
|
|
2003
2005
|
sx: {
|
|
2004
2006
|
position: "absolute",
|
|
@@ -2019,8 +2021,8 @@ function _n({ left: e, children: t }) {
|
|
|
2019
2021
|
}
|
|
2020
2022
|
//#endregion
|
|
2021
2023
|
//#region src/components/gantt-chart/GanttWeekendStrips.tsx
|
|
2022
|
-
function
|
|
2023
|
-
let { weekendColor: i } =
|
|
2024
|
+
function bn({ strips: e, totalWidth: t, height: n, top: r }) {
|
|
2025
|
+
let { weekendColor: i } = Mn();
|
|
2024
2026
|
return e.length === 0 ? null : /* @__PURE__ */ U(l, {
|
|
2025
2027
|
"aria-hidden": !0,
|
|
2026
2028
|
"data-testid": "gantt-weekend-strips",
|
|
@@ -2044,7 +2046,7 @@ function vn({ strips: e, totalWidth: t, height: n, top: r }) {
|
|
|
2044
2046
|
}
|
|
2045
2047
|
//#endregion
|
|
2046
2048
|
//#region src/components/gantt-chart/GanttStatusContextMenu.tsx
|
|
2047
|
-
function
|
|
2049
|
+
function xn({ contextMenu: e, onClose: t, onSelect: n }) {
|
|
2048
2050
|
let r = $(), i = {
|
|
2049
2051
|
planned: r.statusPlanned,
|
|
2050
2052
|
"in-progress": r.statusInProgress,
|
|
@@ -2076,8 +2078,8 @@ function yn({ contextMenu: e, onClose: t, onSelect: n }) {
|
|
|
2076
2078
|
}
|
|
2077
2079
|
//#endregion
|
|
2078
2080
|
//#region src/components/gantt-chart/GanttDependencyArrows.tsx
|
|
2079
|
-
function
|
|
2080
|
-
let o = L(), { todayLineColor: s } =
|
|
2081
|
+
function Sn({ dependencyLines: e, todayX: t, totalWidth: n, height: r, top: i, arrowMarkerId: a }) {
|
|
2082
|
+
let o = L(), { todayLineColor: s } = Mn();
|
|
2081
2083
|
return e.length === 0 && t === null ? null : /* @__PURE__ */ W("svg", {
|
|
2082
2084
|
"data-testid": "gantt-dependency-arrows",
|
|
2083
2085
|
style: {
|
|
@@ -2126,16 +2128,16 @@ function bn({ dependencyLines: e, todayX: t, totalWidth: n, height: r, top: i, a
|
|
|
2126
2128
|
}
|
|
2127
2129
|
//#endregion
|
|
2128
2130
|
//#region src/components/gantt-chart/GanttTimeline.tsx
|
|
2129
|
-
function
|
|
2131
|
+
function Cn(e, t, n) {
|
|
2130
2132
|
if (n === 0) return [];
|
|
2131
2133
|
let r = [], i = new Map(e.map((e, t) => [e.id, t]));
|
|
2132
2134
|
for (let a of e) {
|
|
2133
2135
|
if (!a.dependencies?.length) continue;
|
|
2134
|
-
let o = i.get(a.id), s =
|
|
2136
|
+
let o = i.get(a.id), s = Pt(a, t).left / 100 * n, c = o * 40 + 40 / 2;
|
|
2135
2137
|
for (let o of a.dependencies) {
|
|
2136
2138
|
let l = i.get(o);
|
|
2137
2139
|
if (l === void 0) continue;
|
|
2138
|
-
let u = e[l], d =
|
|
2140
|
+
let u = e[l], d = Pt(u, t), f = (d.left + d.width) / 100 * n, p = l * 40 + 40 / 2, m;
|
|
2139
2141
|
m = s >= f + 48 ? (f + s) / 2 : f + 24 <= n - 8 ? f + 24 : Math.max(s - 24, 8), r.push({
|
|
2140
2142
|
key: `${o}-${a.id}`,
|
|
2141
2143
|
d: `M ${f} ${p} H ${m} V ${c} H ${s}`
|
|
@@ -2144,21 +2146,21 @@ function xn(e, t, n) {
|
|
|
2144
2146
|
}
|
|
2145
2147
|
return r;
|
|
2146
2148
|
}
|
|
2147
|
-
function
|
|
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 =
|
|
2149
|
+
function wn({ 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 }) {
|
|
2150
|
+
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 = kn(), E = $(), D = `gantt-arrow-${i().replace(/:/g, "")}`, O = a(() => Lt(y, x), [y, x]), k = a(() => Nt(S, C), [S, C]), A = a(() => C === "days" ? Kt(k).map((e) => ({
|
|
2149
2151
|
key: e.toISOString(),
|
|
2150
2152
|
label: String(e.getDate()),
|
|
2151
2153
|
width: 20,
|
|
2152
2154
|
isWeekend: e.getDay() === 0 || e.getDay() === 6
|
|
2153
|
-
})) : C === "weeks" ?
|
|
2155
|
+
})) : C === "weeks" ? Gt(k).map((e) => ({
|
|
2154
2156
|
key: e.toISOString(),
|
|
2155
|
-
label: `${E.weekColumnPrefix}${
|
|
2157
|
+
label: `${E.weekColumnPrefix}${Wt(e)}`,
|
|
2156
2158
|
width: 40
|
|
2157
|
-
})) : C === "quarters" ?
|
|
2159
|
+
})) : C === "quarters" ? Yt(k).map((e) => ({
|
|
2158
2160
|
key: e.key,
|
|
2159
2161
|
label: e.label,
|
|
2160
2162
|
width: 360
|
|
2161
|
-
})) :
|
|
2163
|
+
})) : Ht(k).map((e) => ({
|
|
2162
2164
|
key: e.toISOString(),
|
|
2163
2165
|
label: e.toLocaleString(E.dateLocale, {
|
|
2164
2166
|
month: "short",
|
|
@@ -2191,11 +2193,11 @@ function Sn({ scrollRef: e, onScroll: t, onTaskClick: n, onMilestoneClick: c, dr
|
|
|
2191
2193
|
C,
|
|
2192
2194
|
A,
|
|
2193
2195
|
E.dateLocale
|
|
2194
|
-
]), N = a(() =>
|
|
2196
|
+
]), N = a(() => Cn(O, k, j), [
|
|
2195
2197
|
O,
|
|
2196
2198
|
k,
|
|
2197
2199
|
j
|
|
2198
|
-
]), P = a(() => p ?
|
|
2200
|
+
]), P = a(() => p ? Xt(b) : /* @__PURE__ */ new Set(), [p, b]), F = we({
|
|
2199
2201
|
count: O.length,
|
|
2200
2202
|
getScrollElement: () => e.current,
|
|
2201
2203
|
estimateSize: () => 40,
|
|
@@ -2219,7 +2221,7 @@ function Sn({ scrollRef: e, onScroll: t, onTaskClick: n, onMilestoneClick: c, dr
|
|
|
2219
2221
|
let t = e.current.clientWidth;
|
|
2220
2222
|
e.current.scrollLeft = Math.max(0, L - t / 2);
|
|
2221
2223
|
}, []);
|
|
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 } =
|
|
2224
|
+
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 } = pn({
|
|
2223
2225
|
totalWidth: j,
|
|
2224
2226
|
displayRange: k,
|
|
2225
2227
|
onTaskMoved: h,
|
|
@@ -2242,11 +2244,11 @@ function Sn({ scrollRef: e, onScroll: t, onTaskClick: n, onMilestoneClick: c, dr
|
|
|
2242
2244
|
position: "relative"
|
|
2243
2245
|
},
|
|
2244
2246
|
children: [
|
|
2245
|
-
/* @__PURE__ */ U(
|
|
2247
|
+
/* @__PURE__ */ U(hn, {
|
|
2246
2248
|
columns: A,
|
|
2247
2249
|
groups: M
|
|
2248
2250
|
}),
|
|
2249
|
-
/* @__PURE__ */ U(
|
|
2251
|
+
/* @__PURE__ */ U(bn, {
|
|
2250
2252
|
strips: I,
|
|
2251
2253
|
totalWidth: j,
|
|
2252
2254
|
height: O.length * 40,
|
|
@@ -2257,7 +2259,7 @@ function Sn({ scrollRef: e, onScroll: t, onTaskClick: n, onMilestoneClick: c, dr
|
|
|
2257
2259
|
position: "relative",
|
|
2258
2260
|
height: F.getTotalSize()
|
|
2259
2261
|
},
|
|
2260
|
-
children: F.getVirtualItems().map((e) => /* @__PURE__ */ U(
|
|
2262
|
+
children: F.getVirtualItems().map((e) => /* @__PURE__ */ U(gn, {
|
|
2261
2263
|
task: O[e.index],
|
|
2262
2264
|
virtualTop: e.start,
|
|
2263
2265
|
activeDrag: B,
|
|
@@ -2280,7 +2282,7 @@ function Sn({ scrollRef: e, onScroll: t, onTaskClick: n, onMilestoneClick: c, dr
|
|
|
2280
2282
|
handleProgressMouseDown: K,
|
|
2281
2283
|
formatDragDate: q
|
|
2282
2284
|
}, e.key))
|
|
2283
|
-
}) : /* @__PURE__ */ U(H, { children: O.map((e) => /* @__PURE__ */ U(
|
|
2285
|
+
}) : /* @__PURE__ */ U(H, { children: O.map((e) => /* @__PURE__ */ U(gn, {
|
|
2284
2286
|
task: e,
|
|
2285
2287
|
activeDrag: B,
|
|
2286
2288
|
displayRange: k,
|
|
@@ -2302,7 +2304,7 @@ function Sn({ scrollRef: e, onScroll: t, onTaskClick: n, onMilestoneClick: c, dr
|
|
|
2302
2304
|
handleProgressMouseDown: K,
|
|
2303
2305
|
formatDragDate: q
|
|
2304
2306
|
}, e.id)) }),
|
|
2305
|
-
/* @__PURE__ */ U(
|
|
2307
|
+
/* @__PURE__ */ U(xn, {
|
|
2306
2308
|
contextMenu: J,
|
|
2307
2309
|
onClose: () => ee(null),
|
|
2308
2310
|
onSelect: (e, t) => {
|
|
@@ -2313,7 +2315,7 @@ function Sn({ scrollRef: e, onScroll: t, onTaskClick: n, onMilestoneClick: c, dr
|
|
|
2313
2315
|
}), te.current?.(n, t), ne.current?.(T.getState().tasks), ee(null);
|
|
2314
2316
|
}
|
|
2315
2317
|
}),
|
|
2316
|
-
/* @__PURE__ */ U(
|
|
2318
|
+
/* @__PURE__ */ U(Sn, {
|
|
2317
2319
|
dependencyLines: N,
|
|
2318
2320
|
todayX: L,
|
|
2319
2321
|
totalWidth: j,
|
|
@@ -2327,14 +2329,14 @@ function Sn({ scrollRef: e, onScroll: t, onTaskClick: n, onMilestoneClick: c, dr
|
|
|
2327
2329
|
}
|
|
2328
2330
|
//#endregion
|
|
2329
2331
|
//#region src/components/gantt-chart/GanttToolbar.tsx
|
|
2330
|
-
function
|
|
2332
|
+
function Tn(e) {
|
|
2331
2333
|
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
2332
2334
|
}
|
|
2333
|
-
function
|
|
2335
|
+
function En(e) {
|
|
2334
2336
|
let [t, n, r] = e.split("-").map(Number);
|
|
2335
2337
|
return !t || !n || !r ? null : new Date(t, n - 1, r, 0, 0, 0, 0);
|
|
2336
2338
|
}
|
|
2337
|
-
function
|
|
2339
|
+
function Dn({ onScrollToToday: e, config: t }) {
|
|
2338
2340
|
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 = {
|
|
2339
2341
|
days: n.scaleDays,
|
|
2340
2342
|
weeks: n.scaleWeeks,
|
|
@@ -2403,9 +2405,9 @@ function Tn({ onScrollToToday: e, config: t }) {
|
|
|
2403
2405
|
type: "date",
|
|
2404
2406
|
size: "small",
|
|
2405
2407
|
label: n.rangeFrom,
|
|
2406
|
-
value:
|
|
2408
|
+
value: Tn(s.start),
|
|
2407
2409
|
onChange: (e) => {
|
|
2408
|
-
let t =
|
|
2410
|
+
let t = En(e.target.value);
|
|
2409
2411
|
t && d({
|
|
2410
2412
|
start: t,
|
|
2411
2413
|
end: s.end
|
|
@@ -2420,9 +2422,9 @@ function Tn({ onScrollToToday: e, config: t }) {
|
|
|
2420
2422
|
type: "date",
|
|
2421
2423
|
size: "small",
|
|
2422
2424
|
label: n.rangeTo,
|
|
2423
|
-
value:
|
|
2425
|
+
value: Tn(s.end),
|
|
2424
2426
|
onChange: (e) => {
|
|
2425
|
-
let t =
|
|
2427
|
+
let t = En(e.target.value);
|
|
2426
2428
|
t && d({
|
|
2427
2429
|
start: s.start,
|
|
2428
2430
|
end: t
|
|
@@ -2459,34 +2461,34 @@ function Tn({ onScrollToToday: e, config: t }) {
|
|
|
2459
2461
|
}
|
|
2460
2462
|
//#endregion
|
|
2461
2463
|
//#region src/components/gantt-chart/GanttChart.tsx
|
|
2462
|
-
var
|
|
2464
|
+
var On = e(null);
|
|
2463
2465
|
function Q(e) {
|
|
2464
|
-
let t = n(
|
|
2466
|
+
let t = n(On);
|
|
2465
2467
|
if (!t) throw Error("GanttChartStoreContext is missing.");
|
|
2466
2468
|
return Se(t, e);
|
|
2467
2469
|
}
|
|
2468
|
-
function
|
|
2469
|
-
let e = n(
|
|
2470
|
+
function kn() {
|
|
2471
|
+
let e = n(On);
|
|
2470
2472
|
if (!e) throw Error("GanttChartStoreContext is missing.");
|
|
2471
2473
|
return e;
|
|
2472
2474
|
}
|
|
2473
|
-
var
|
|
2475
|
+
var An = e($t);
|
|
2474
2476
|
function $() {
|
|
2475
|
-
return n(
|
|
2477
|
+
return n(An);
|
|
2476
2478
|
}
|
|
2477
|
-
var
|
|
2478
|
-
function
|
|
2479
|
-
return n(
|
|
2479
|
+
var jn = e({});
|
|
2480
|
+
function Mn() {
|
|
2481
|
+
return n(jn);
|
|
2480
2482
|
}
|
|
2481
|
-
function
|
|
2483
|
+
function Nn(e, t) {
|
|
2482
2484
|
return e === void 0 ? t : e === "auto" ? "100%" : typeof e == "string" && /^\d+$/.test(e) ? Number(e) : e;
|
|
2483
2485
|
}
|
|
2484
|
-
var
|
|
2486
|
+
var Pn = [
|
|
2485
2487
|
"days",
|
|
2486
2488
|
"weeks",
|
|
2487
2489
|
"months",
|
|
2488
2490
|
"quarters"
|
|
2489
|
-
],
|
|
2491
|
+
], Fn = {
|
|
2490
2492
|
showScaleDays: !0,
|
|
2491
2493
|
showScaleWeeks: !0,
|
|
2492
2494
|
showScaleMonths: !0,
|
|
@@ -2497,11 +2499,11 @@ var Mn = [
|
|
|
2497
2499
|
showRangeReset: !0,
|
|
2498
2500
|
showResetView: !0
|
|
2499
2501
|
};
|
|
2500
|
-
function
|
|
2501
|
-
let N =
|
|
2502
|
-
...
|
|
2502
|
+
function In({ 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 }) {
|
|
2503
|
+
let N = Nn(b, 400), P = a(() => ({
|
|
2504
|
+
...Fn,
|
|
2503
2505
|
...y
|
|
2504
|
-
}), [y]), F =
|
|
2506
|
+
}), [y]), F = Nn(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);
|
|
2505
2507
|
r(() => {
|
|
2506
2508
|
I(e);
|
|
2507
2509
|
}, [e, I]);
|
|
@@ -2511,7 +2513,7 @@ function Pn({ tasks: e, onTaskClick: n, onMilestoneClick: i, onAddTask: c, onEdi
|
|
|
2511
2513
|
H.current ||= (H.current = !0, B.current && V.current && (B.current.scrollTop = V.current.scrollTop), !1);
|
|
2512
2514
|
}, ee = t(() => {
|
|
2513
2515
|
if (!V.current) return;
|
|
2514
|
-
let e =
|
|
2516
|
+
let e = Nt(z, L), t = Date.now(), n = e.start.getTime(), r = e.end.getTime(), i = (t - n) / (r - n) * V.current.scrollWidth;
|
|
2515
2517
|
V.current.scrollLeft = Math.max(0, i - V.current.clientWidth / 2);
|
|
2516
2518
|
}, [z, L]);
|
|
2517
2519
|
r(() => {
|
|
@@ -2519,8 +2521,8 @@ function Pn({ tasks: e, onTaskClick: n, onMilestoneClick: i, onAddTask: c, onEdi
|
|
|
2519
2521
|
let e = V.current, t = (e) => {
|
|
2520
2522
|
if (!e.ctrlKey) return;
|
|
2521
2523
|
e.preventDefault();
|
|
2522
|
-
let t =
|
|
2523
|
-
e.deltaY < 0 && t > 0 ? R(
|
|
2524
|
+
let t = Pn.indexOf(L);
|
|
2525
|
+
e.deltaY < 0 && t > 0 ? R(Pn[t - 1]) : e.deltaY > 0 && t < Pn.length - 1 && R(Pn[t + 1]);
|
|
2524
2526
|
};
|
|
2525
2527
|
return e.addEventListener("wheel", t, { passive: !1 }), () => e.removeEventListener("wheel", t);
|
|
2526
2528
|
}, [
|
|
@@ -2553,7 +2555,7 @@ function Pn({ tasks: e, onTaskClick: n, onMilestoneClick: i, onAddTask: c, onEdi
|
|
|
2553
2555
|
borderRadius: 1,
|
|
2554
2556
|
overflow: "hidden"
|
|
2555
2557
|
},
|
|
2556
|
-
children: [v && /* @__PURE__ */ U(
|
|
2558
|
+
children: [v && /* @__PURE__ */ U(Dn, {
|
|
2557
2559
|
onScrollToToday: ee,
|
|
2558
2560
|
config: P
|
|
2559
2561
|
}), /* @__PURE__ */ W(l, {
|
|
@@ -2563,7 +2565,7 @@ function Pn({ tasks: e, onTaskClick: n, onMilestoneClick: i, onAddTask: c, onEdi
|
|
|
2563
2565
|
overflow: "hidden"
|
|
2564
2566
|
},
|
|
2565
2567
|
children: [
|
|
2566
|
-
/* @__PURE__ */ U(
|
|
2568
|
+
/* @__PURE__ */ U(dn, {
|
|
2567
2569
|
scrollRef: B,
|
|
2568
2570
|
onScroll: q,
|
|
2569
2571
|
panelWidth: G,
|
|
@@ -2591,7 +2593,7 @@ function Pn({ tasks: e, onTaskClick: n, onMilestoneClick: i, onAddTask: c, onEdi
|
|
|
2591
2593
|
},
|
|
2592
2594
|
onMouseDown: te
|
|
2593
2595
|
}),
|
|
2594
|
-
/* @__PURE__ */ U(
|
|
2596
|
+
/* @__PURE__ */ U(wn, {
|
|
2595
2597
|
scrollRef: V,
|
|
2596
2598
|
onScroll: J,
|
|
2597
2599
|
onTaskClick: n,
|
|
@@ -2610,14 +2612,14 @@ function Pn({ tasks: e, onTaskClick: n, onMilestoneClick: i, onAddTask: c, onEdi
|
|
|
2610
2612
|
})]
|
|
2611
2613
|
});
|
|
2612
2614
|
}
|
|
2613
|
-
function
|
|
2615
|
+
function Ln({ 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 }) {
|
|
2614
2616
|
let L = a(() => ({
|
|
2615
|
-
|
|
2617
|
+
...$t,
|
|
2616
2618
|
...c
|
|
2617
2619
|
}), [c]), [R] = s(() => {
|
|
2618
|
-
if (!(i !== void 0 || o !== void 0)) return
|
|
2619
|
-
let r =
|
|
2620
|
-
return
|
|
2620
|
+
if (!(i !== void 0 || o !== void 0)) return Qt(e, t, n, void 0, v);
|
|
2621
|
+
let r = Mt(e);
|
|
2622
|
+
return Qt(e, t, n, {
|
|
2621
2623
|
start: i ?? r.start,
|
|
2622
2624
|
end: o ?? r.end
|
|
2623
2625
|
}, v);
|
|
@@ -2628,13 +2630,13 @@ function Fn({ tasks: e, timeScale: t = "months", initialExpandAll: n = !1, showT
|
|
|
2628
2630
|
...b?.statusColors
|
|
2629
2631
|
}
|
|
2630
2632
|
}), [y, b]);
|
|
2631
|
-
return /* @__PURE__ */ U(
|
|
2633
|
+
return /* @__PURE__ */ U(An.Provider, {
|
|
2632
2634
|
value: L,
|
|
2633
|
-
children: /* @__PURE__ */ U(
|
|
2635
|
+
children: /* @__PURE__ */ U(jn.Provider, {
|
|
2634
2636
|
value: z,
|
|
2635
|
-
children: /* @__PURE__ */ U(
|
|
2637
|
+
children: /* @__PURE__ */ U(On.Provider, {
|
|
2636
2638
|
value: R,
|
|
2637
|
-
children: /* @__PURE__ */ U(
|
|
2639
|
+
children: /* @__PURE__ */ U(In, {
|
|
2638
2640
|
tasks: e,
|
|
2639
2641
|
timeScale: t,
|
|
2640
2642
|
enableBuiltinDialogs: l,
|
|
@@ -2670,8 +2672,8 @@ function Fn({ tasks: e, timeScale: t = "months", initialExpandAll: n = !1, showT
|
|
|
2670
2672
|
}
|
|
2671
2673
|
//#endregion
|
|
2672
2674
|
//#region src/components/password-strength-meter/util/password-strength.util.ts
|
|
2673
|
-
var
|
|
2674
|
-
function
|
|
2675
|
+
var Rn = (e) => Math.max(0, Math.min(4, Math.round(e)));
|
|
2676
|
+
function zn(e, t) {
|
|
2675
2677
|
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 = [
|
|
2676
2678
|
i,
|
|
2677
2679
|
a,
|
|
@@ -2693,7 +2695,7 @@ function Ln(e, t) {
|
|
|
2693
2695
|
}
|
|
2694
2696
|
let l = 0;
|
|
2695
2697
|
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);
|
|
2696
|
-
let u =
|
|
2698
|
+
let u = Rn(l), d = u <= 1 ? "weak" : u === 2 ? "ok" : u === 3 ? "good" : "very good";
|
|
2697
2699
|
return {
|
|
2698
2700
|
score: u,
|
|
2699
2701
|
percent: u * 25,
|
|
@@ -2707,7 +2709,7 @@ function Ln(e, t) {
|
|
|
2707
2709
|
}
|
|
2708
2710
|
//#endregion
|
|
2709
2711
|
//#region src/components/password-strength-meter/PasswordStrengthBar.tsx
|
|
2710
|
-
function
|
|
2712
|
+
function Bn({ percent: e, color: t, ariaLabel: n }) {
|
|
2711
2713
|
return /* @__PURE__ */ U(l, {
|
|
2712
2714
|
role: "progressbar",
|
|
2713
2715
|
"aria-label": n,
|
|
@@ -2737,7 +2739,7 @@ function Rn({ percent: e, color: t, ariaLabel: n }) {
|
|
|
2737
2739
|
}
|
|
2738
2740
|
//#endregion
|
|
2739
2741
|
//#region src/components/password-strength-meter/PasswordStrengthMeter.types.ts
|
|
2740
|
-
var
|
|
2742
|
+
var Vn = {
|
|
2741
2743
|
label: "Password",
|
|
2742
2744
|
summaryHeaderLabel: "Requirements for your password",
|
|
2743
2745
|
summaryMinChars: "At least {n} characters",
|
|
@@ -2748,18 +2750,18 @@ var zn = {
|
|
|
2748
2750
|
showPasswordLabel: "Show password",
|
|
2749
2751
|
hidePasswordLabel: "Hide password",
|
|
2750
2752
|
meterAriaLabel: "Password strength"
|
|
2751
|
-
},
|
|
2753
|
+
}, Hn = {
|
|
2752
2754
|
weak: "#cc0000",
|
|
2753
2755
|
ok: "#fdc010",
|
|
2754
2756
|
good: "#8bc34a",
|
|
2755
2757
|
veryGood: "#43a047"
|
|
2756
|
-
},
|
|
2758
|
+
}, Un = {
|
|
2757
2759
|
failure: "#cc0000",
|
|
2758
2760
|
success: "#43a047"
|
|
2759
2761
|
};
|
|
2760
2762
|
//#endregion
|
|
2761
2763
|
//#region src/components/password-strength-meter/PasswordStrengthMeter.tsx
|
|
2762
|
-
function
|
|
2764
|
+
function Wn({ label: e, fulfilled: t, checkColors: n }) {
|
|
2763
2765
|
return /* @__PURE__ */ W(j, {
|
|
2764
2766
|
direction: "row",
|
|
2765
2767
|
sx: {
|
|
@@ -2785,14 +2787,14 @@ function Hn({ label: e, fulfilled: t, checkColors: n }) {
|
|
|
2785
2787
|
})]
|
|
2786
2788
|
});
|
|
2787
2789
|
}
|
|
2788
|
-
function
|
|
2790
|
+
function Gn({ 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 = Un, onPasswordChange: b }) {
|
|
2789
2791
|
let T = {
|
|
2790
|
-
...
|
|
2792
|
+
...Vn,
|
|
2791
2793
|
...h
|
|
2792
2794
|
}, E = {
|
|
2793
|
-
...
|
|
2795
|
+
...Hn,
|
|
2794
2796
|
...g
|
|
2795
|
-
}, O = `${i()}-password`, [k, A] = s(!1), [M, N] = s(""), P = e === void 0 ? M : e, F = a(() =>
|
|
2797
|
+
}, O = `${i()}-password`, [k, A] = s(!1), [M, N] = s(""), P = e === void 0 ? M : e, F = a(() => zn(P, _), [P, _]);
|
|
2796
2798
|
return /* @__PURE__ */ W(j, { children: [
|
|
2797
2799
|
/* @__PURE__ */ W(y, {
|
|
2798
2800
|
variant: "outlined",
|
|
@@ -2812,7 +2814,7 @@ function Un({ value: e, name: t, inputRef: n, disabled: r = !1, error: o = !1, h
|
|
|
2812
2814
|
value: P,
|
|
2813
2815
|
onChange: (t) => {
|
|
2814
2816
|
let n = t.target.value;
|
|
2815
|
-
e === void 0 && N(n), b && b(n,
|
|
2817
|
+
e === void 0 && N(n), b && b(n, zn(n, _));
|
|
2816
2818
|
},
|
|
2817
2819
|
disabled: r,
|
|
2818
2820
|
inputRef: n,
|
|
@@ -2845,7 +2847,7 @@ function Un({ value: e, name: t, inputRef: n, disabled: r = !1, error: o = !1, h
|
|
|
2845
2847
|
c && /* @__PURE__ */ U(x, { children: c })
|
|
2846
2848
|
]
|
|
2847
2849
|
}),
|
|
2848
|
-
f && /* @__PURE__ */ U(
|
|
2850
|
+
f && /* @__PURE__ */ U(Bn, {
|
|
2849
2851
|
percent: F.percent,
|
|
2850
2852
|
color: ((e) => {
|
|
2851
2853
|
switch (e.meterStatus) {
|
|
@@ -2878,17 +2880,17 @@ function Un({ value: e, name: t, inputRef: n, disabled: r = !1, error: o = !1, h
|
|
|
2878
2880
|
children: [/* @__PURE__ */ W(j, {
|
|
2879
2881
|
direction: "column",
|
|
2880
2882
|
children: [
|
|
2881
|
-
/* @__PURE__ */ U(
|
|
2883
|
+
/* @__PURE__ */ U(Wn, {
|
|
2882
2884
|
label: T.summaryMinChars.replace("{n}", String(_)),
|
|
2883
2885
|
fulfilled: F.length >= _,
|
|
2884
2886
|
checkColors: v
|
|
2885
2887
|
}),
|
|
2886
|
-
/* @__PURE__ */ U(
|
|
2888
|
+
/* @__PURE__ */ U(Wn, {
|
|
2887
2889
|
label: T.summaryCapitalLetter,
|
|
2888
2890
|
fulfilled: F.hasUpper,
|
|
2889
2891
|
checkColors: v
|
|
2890
2892
|
}),
|
|
2891
|
-
/* @__PURE__ */ U(
|
|
2893
|
+
/* @__PURE__ */ U(Wn, {
|
|
2892
2894
|
label: T.summaryLowerCaseLetter,
|
|
2893
2895
|
fulfilled: F.hasLower,
|
|
2894
2896
|
checkColors: v
|
|
@@ -2896,11 +2898,11 @@ function Un({ value: e, name: t, inputRef: n, disabled: r = !1, error: o = !1, h
|
|
|
2896
2898
|
]
|
|
2897
2899
|
}), /* @__PURE__ */ W(j, {
|
|
2898
2900
|
direction: "column",
|
|
2899
|
-
children: [/* @__PURE__ */ U(
|
|
2901
|
+
children: [/* @__PURE__ */ U(Wn, {
|
|
2900
2902
|
label: T.summaryNumber,
|
|
2901
2903
|
fulfilled: F.hasDigit,
|
|
2902
2904
|
checkColors: v
|
|
2903
|
-
}), /* @__PURE__ */ U(
|
|
2905
|
+
}), /* @__PURE__ */ U(Wn, {
|
|
2904
2906
|
label: T.summarySpecialChar,
|
|
2905
2907
|
fulfilled: F.hasSymbol,
|
|
2906
2908
|
checkColors: v
|
|
@@ -2912,7 +2914,7 @@ function Un({ value: e, name: t, inputRef: n, disabled: r = !1, error: o = !1, h
|
|
|
2912
2914
|
}
|
|
2913
2915
|
//#endregion
|
|
2914
2916
|
//#region src/components/tag-selection/TagSelection.store.ts
|
|
2915
|
-
function
|
|
2917
|
+
function Kn(e) {
|
|
2916
2918
|
return Ce((t) => ({
|
|
2917
2919
|
tags: e,
|
|
2918
2920
|
searchValue: "",
|
|
@@ -2950,7 +2952,7 @@ function Wn(e) {
|
|
|
2950
2952
|
}
|
|
2951
2953
|
//#endregion
|
|
2952
2954
|
//#region src/components/tag-selection/TagSelectionAutocomplete.tsx
|
|
2953
|
-
var
|
|
2955
|
+
var qn = [
|
|
2954
2956
|
"default",
|
|
2955
2957
|
"primary",
|
|
2956
2958
|
"secondary",
|
|
@@ -2959,7 +2961,7 @@ var Gn = [
|
|
|
2959
2961
|
"success",
|
|
2960
2962
|
"warning"
|
|
2961
2963
|
];
|
|
2962
|
-
function
|
|
2964
|
+
function Jn({ 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 }) {
|
|
2963
2965
|
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 = () => {
|
|
2964
2966
|
a?.(t.trim(), _), v("default");
|
|
2965
2967
|
}, D = () => {
|
|
@@ -3058,7 +3060,7 @@ function Kn({ availableTags: e, searchValue: t, translation: n, onSearchChange:
|
|
|
3058
3060
|
gap: .5,
|
|
3059
3061
|
alignItems: "center"
|
|
3060
3062
|
},
|
|
3061
|
-
children:
|
|
3063
|
+
children: qn.map((e) => /* @__PURE__ */ U(f, {
|
|
3062
3064
|
size: u,
|
|
3063
3065
|
color: e,
|
|
3064
3066
|
label: e,
|
|
@@ -3071,7 +3073,7 @@ function Kn({ availableTags: e, searchValue: t, translation: n, onSearchChange:
|
|
|
3071
3073
|
}
|
|
3072
3074
|
//#endregion
|
|
3073
3075
|
//#region src/components/tag-selection/TagSelectionChip.tsx
|
|
3074
|
-
function
|
|
3076
|
+
function Yn({ tag: e, onDelete: t, onClick: n, chipSize: r = "medium", disabled: i = !1 }) {
|
|
3075
3077
|
let a = !!(e.foregroundColor || e.backgroundColor);
|
|
3076
3078
|
return /* @__PURE__ */ U(f, {
|
|
3077
3079
|
size: r,
|
|
@@ -3098,7 +3100,7 @@ function qn({ tag: e, onDelete: t, onClick: n, chipSize: r = "medium", disabled:
|
|
|
3098
3100
|
}
|
|
3099
3101
|
//#endregion
|
|
3100
3102
|
//#region src/components/tag-selection/TagSelectionSelectedTags.tsx
|
|
3101
|
-
function
|
|
3103
|
+
function Xn({ selectedTags: e, translation: t, onTagDelete: n, showSelectedTagsLabel: r, chipSize: i = "medium", disabled: a = !1, maxVisibleChips: o, popoverPlacement: c = "bottom" }) {
|
|
3102
3104
|
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" ? {
|
|
3103
3105
|
vertical: "top",
|
|
3104
3106
|
horizontal: "left"
|
|
@@ -3128,7 +3130,7 @@ function Jn({ selectedTags: e, translation: t, onTagDelete: n, showSelectedTagsL
|
|
|
3128
3130
|
flexWrap: "wrap",
|
|
3129
3131
|
gap: 1
|
|
3130
3132
|
},
|
|
3131
|
-
children: [p.map((e) => /* @__PURE__ */ U(
|
|
3133
|
+
children: [p.map((e) => /* @__PURE__ */ U(Yn, {
|
|
3132
3134
|
tag: e,
|
|
3133
3135
|
onDelete: n,
|
|
3134
3136
|
chipSize: i,
|
|
@@ -3153,7 +3155,7 @@ function Jn({ selectedTags: e, translation: t, onTagDelete: n, showSelectedTagsL
|
|
|
3153
3155
|
gap: .5,
|
|
3154
3156
|
maxWidth: 320
|
|
3155
3157
|
},
|
|
3156
|
-
children: m.map((e) => /* @__PURE__ */ U(
|
|
3158
|
+
children: m.map((e) => /* @__PURE__ */ U(Yn, {
|
|
3157
3159
|
tag: e,
|
|
3158
3160
|
onDelete: a ? void 0 : n,
|
|
3159
3161
|
chipSize: i,
|
|
@@ -3166,7 +3168,7 @@ function Jn({ selectedTags: e, translation: t, onTagDelete: n, showSelectedTagsL
|
|
|
3166
3168
|
}
|
|
3167
3169
|
//#endregion
|
|
3168
3170
|
//#region src/components/tag-selection/TagSelection.types.ts
|
|
3169
|
-
var
|
|
3171
|
+
var Zn = {
|
|
3170
3172
|
selectedTagsLabel: "Selected tags",
|
|
3171
3173
|
autoCompleteLabel: "Search and add tags",
|
|
3172
3174
|
noSelectedTagsText: "No tags selected.",
|
|
@@ -3174,14 +3176,14 @@ var Yn = {
|
|
|
3174
3176
|
placeholder: "Type to search...",
|
|
3175
3177
|
loadingText: "Loading...",
|
|
3176
3178
|
maxTagsReachedText: "Maximum number of tags reached."
|
|
3177
|
-
},
|
|
3178
|
-
function
|
|
3179
|
-
let t = n(
|
|
3179
|
+
}, Qn = e(null);
|
|
3180
|
+
function $n(e) {
|
|
3181
|
+
let t = n(Qn);
|
|
3180
3182
|
if (!t) throw Error("TagSelectionStoreContext is missing.");
|
|
3181
3183
|
return Se(t, e);
|
|
3182
3184
|
}
|
|
3183
|
-
function
|
|
3184
|
-
let S =
|
|
3185
|
+
function er({ 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 }) {
|
|
3186
|
+
let S = $n((e) => e.tags), C = $n((e) => e.searchValue), w = $n((e) => e.setTags), T = $n((e) => e.setSearchValue), E = $n((e) => e.selectTag), D = $n((e) => e.deleteTag), O = $n((e) => e.addTag);
|
|
3185
3187
|
r(() => {
|
|
3186
3188
|
w(e);
|
|
3187
3189
|
}, [e, w]);
|
|
@@ -3190,7 +3192,7 @@ function Qn({ tags: e, showSelectedTags: t = !0, showSelectedTagsLabel: n = !0,
|
|
|
3190
3192
|
};
|
|
3191
3193
|
return /* @__PURE__ */ U(l, {
|
|
3192
3194
|
sx: { width: "100%" },
|
|
3193
|
-
children: /* @__PURE__ */ W(j, { children: [t && /* @__PURE__ */ U(
|
|
3195
|
+
children: /* @__PURE__ */ W(j, { children: [t && /* @__PURE__ */ U(Xn, {
|
|
3194
3196
|
selectedTags: k,
|
|
3195
3197
|
translation: g,
|
|
3196
3198
|
onTagDelete: (e) => {
|
|
@@ -3206,7 +3208,7 @@ function Qn({ tags: e, showSelectedTags: t = !0, showSelectedTagsLabel: n = !0,
|
|
|
3206
3208
|
disabled: c,
|
|
3207
3209
|
maxVisibleChips: p,
|
|
3208
3210
|
popoverPlacement: m
|
|
3209
|
-
}), i && /* @__PURE__ */ U(
|
|
3211
|
+
}), i && /* @__PURE__ */ U(Jn, {
|
|
3210
3212
|
availableTags: A,
|
|
3211
3213
|
searchValue: C,
|
|
3212
3214
|
translation: g,
|
|
@@ -3243,14 +3245,14 @@ function Qn({ tags: e, showSelectedTags: t = !0, showSelectedTagsLabel: n = !0,
|
|
|
3243
3245
|
})] })
|
|
3244
3246
|
});
|
|
3245
3247
|
}
|
|
3246
|
-
function
|
|
3248
|
+
function tr({ 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 }) {
|
|
3247
3249
|
let b = {
|
|
3248
|
-
...
|
|
3250
|
+
...Zn,
|
|
3249
3251
|
...i
|
|
3250
|
-
}, [x] = s(() =>
|
|
3251
|
-
return /* @__PURE__ */ U(
|
|
3252
|
+
}, [x] = s(() => Kn(e));
|
|
3253
|
+
return /* @__PURE__ */ U(Qn.Provider, {
|
|
3252
3254
|
value: x,
|
|
3253
|
-
children: /* @__PURE__ */ U(
|
|
3255
|
+
children: /* @__PURE__ */ U(er, {
|
|
3254
3256
|
tags: e,
|
|
3255
3257
|
showSelectedTags: t,
|
|
3256
3258
|
showSelectedTagsLabel: n,
|
|
@@ -3275,7 +3277,7 @@ function $n({ tags: e, showSelectedTags: t = !0, showSelectedTagsLabel: n = !0,
|
|
|
3275
3277
|
}
|
|
3276
3278
|
//#endregion
|
|
3277
3279
|
//#region src/components/rich-text-editor/RichTextEditor.types.ts
|
|
3278
|
-
var
|
|
3280
|
+
var nr = {
|
|
3279
3281
|
showBold: !0,
|
|
3280
3282
|
showItalic: !0,
|
|
3281
3283
|
showUnderline: !0,
|
|
@@ -3292,8 +3294,9 @@ var er = {
|
|
|
3292
3294
|
showTextColor: !0,
|
|
3293
3295
|
showHighlight: !0,
|
|
3294
3296
|
showUndoRedo: !0,
|
|
3295
|
-
showClearFormat: !0
|
|
3296
|
-
|
|
3297
|
+
showClearFormat: !0,
|
|
3298
|
+
showFullscreenButton: !1
|
|
3299
|
+
}, rr = {
|
|
3297
3300
|
bold: "Bold",
|
|
3298
3301
|
italic: "Italic",
|
|
3299
3302
|
underline: "Underline",
|
|
@@ -3320,11 +3323,14 @@ var er = {
|
|
|
3320
3323
|
linkDialogCancel: "Cancel",
|
|
3321
3324
|
linkDialogRemove: "Remove link",
|
|
3322
3325
|
characterCount: "{count} characters",
|
|
3323
|
-
characterCountMax: "{count} / {max} characters"
|
|
3326
|
+
characterCountMax: "{count} / {max} characters",
|
|
3327
|
+
wordCount: "{count} words",
|
|
3328
|
+
fullscreen: "Full screen",
|
|
3329
|
+
exitFullscreen: "Exit full screen"
|
|
3324
3330
|
};
|
|
3325
3331
|
//#endregion
|
|
3326
3332
|
//#region src/components/rich-text-editor/RichTextEditorContent.tsx
|
|
3327
|
-
function
|
|
3333
|
+
function ir({ editor: e, error: t, disabled: n, readonly: r }) {
|
|
3328
3334
|
return /* @__PURE__ */ U(l, {
|
|
3329
3335
|
sx: {
|
|
3330
3336
|
flex: 1,
|
|
@@ -3413,7 +3419,7 @@ function nr({ editor: e, error: t, disabled: n, readonly: r }) {
|
|
|
3413
3419
|
}
|
|
3414
3420
|
//#endregion
|
|
3415
3421
|
//#region src/components/rich-text-editor/RichTextEditorLinkDialog.tsx
|
|
3416
|
-
function
|
|
3422
|
+
function ar({ open: e, onClose: t, editor: n, translation: i }) {
|
|
3417
3423
|
let [a, o] = s("");
|
|
3418
3424
|
r(() => {
|
|
3419
3425
|
if (e) {
|
|
@@ -3479,7 +3485,7 @@ function rr({ open: e, onClose: t, editor: n, translation: i }) {
|
|
|
3479
3485
|
}
|
|
3480
3486
|
//#endregion
|
|
3481
3487
|
//#region src/components/rich-text-editor/RichTextEditorColorPicker.tsx
|
|
3482
|
-
var
|
|
3488
|
+
var or = [
|
|
3483
3489
|
"#000000",
|
|
3484
3490
|
"#434343",
|
|
3485
3491
|
"#666666",
|
|
@@ -3498,7 +3504,7 @@ var ir = [
|
|
|
3498
3504
|
"#8a2be2",
|
|
3499
3505
|
"#ff1493",
|
|
3500
3506
|
"#a52a2a"
|
|
3501
|
-
],
|
|
3507
|
+
], sr = [
|
|
3502
3508
|
"#ffff00",
|
|
3503
3509
|
"#ffd700",
|
|
3504
3510
|
"#ffa500",
|
|
@@ -3518,7 +3524,7 @@ var ir = [
|
|
|
3518
3524
|
"#ffffff",
|
|
3519
3525
|
"#000000"
|
|
3520
3526
|
];
|
|
3521
|
-
function
|
|
3527
|
+
function cr({ color: e, active: t, onClick: n }) {
|
|
3522
3528
|
return /* @__PURE__ */ U(F, {
|
|
3523
3529
|
title: e,
|
|
3524
3530
|
placement: "top",
|
|
@@ -3560,8 +3566,8 @@ function or({ color: e, active: t, onClick: n }) {
|
|
|
3560
3566
|
})
|
|
3561
3567
|
});
|
|
3562
3568
|
}
|
|
3563
|
-
function
|
|
3564
|
-
let u = o(null), d = r === "highlight" ?
|
|
3569
|
+
function lr({ anchorEl: e, open: t, onClose: n, mode: r, activeColor: i, onSelectColor: a, onRemoveColor: s, removeLabel: c }) {
|
|
3570
|
+
let u = o(null), d = r === "highlight" ? sr : or;
|
|
3565
3571
|
function f(e) {
|
|
3566
3572
|
a(e.target.value);
|
|
3567
3573
|
}
|
|
@@ -3585,7 +3591,7 @@ function sr({ anchorEl: e, open: t, onClose: n, mode: r, activeColor: i, onSelec
|
|
|
3585
3591
|
gap: .5,
|
|
3586
3592
|
mb: 1
|
|
3587
3593
|
},
|
|
3588
|
-
children: d.map((e) => /* @__PURE__ */ U(
|
|
3594
|
+
children: d.map((e) => /* @__PURE__ */ U(cr, {
|
|
3589
3595
|
color: e,
|
|
3590
3596
|
active: i?.toLowerCase() === e.toLowerCase(),
|
|
3591
3597
|
onClick: (e) => {
|
|
@@ -3646,7 +3652,7 @@ function sr({ anchorEl: e, open: t, onClose: n, mode: r, activeColor: i, onSelec
|
|
|
3646
3652
|
borderRadius: 1,
|
|
3647
3653
|
ml: "auto"
|
|
3648
3654
|
},
|
|
3649
|
-
children: /* @__PURE__ */ U(
|
|
3655
|
+
children: /* @__PURE__ */ U(at, { fontSize: "small" })
|
|
3650
3656
|
})
|
|
3651
3657
|
})
|
|
3652
3658
|
]
|
|
@@ -3655,7 +3661,7 @@ function sr({ anchorEl: e, open: t, onClose: n, mode: r, activeColor: i, onSelec
|
|
|
3655
3661
|
}
|
|
3656
3662
|
//#endregion
|
|
3657
3663
|
//#region src/components/rich-text-editor/RichTextEditorToolbar.tsx
|
|
3658
|
-
function
|
|
3664
|
+
function ur({ label: e, icon: t, activeColor: n, disabled: r, onClick: i }) {
|
|
3659
3665
|
return /* @__PURE__ */ U(F, {
|
|
3660
3666
|
title: e,
|
|
3661
3667
|
arrow: !0,
|
|
@@ -3687,7 +3693,7 @@ function cr({ label: e, icon: t, activeColor: n, disabled: r, onClick: i }) {
|
|
|
3687
3693
|
}) })
|
|
3688
3694
|
});
|
|
3689
3695
|
}
|
|
3690
|
-
function
|
|
3696
|
+
function dr({ level: e }) {
|
|
3691
3697
|
return /* @__PURE__ */ W(l, {
|
|
3692
3698
|
component: "span",
|
|
3693
3699
|
sx: {
|
|
@@ -3698,17 +3704,17 @@ function lr({ level: e }) {
|
|
|
3698
3704
|
children: ["H", e]
|
|
3699
3705
|
});
|
|
3700
3706
|
}
|
|
3701
|
-
function
|
|
3702
|
-
let [
|
|
3703
|
-
h,
|
|
3704
|
-
g,
|
|
3707
|
+
function fr({ editor: e, toolbarConfig: t, translation: n, disabled: r, isFullscreen: i, onToggleFullscreen: a }) {
|
|
3708
|
+
let [o, c] = s(!1), [u, d] = s(null), [f, p] = s(null), m = r || !e, h = e?.getAttributes("textStyle")?.color, g = e?.getAttributes("highlight")?.color, _ = t.showBold || t.showItalic || t.showUnderline || t.showStrike, y = t.showHeading1 || t.showHeading2 || t.showHeading3, b = t.showBulletList || t.showOrderedList, x = t.showBlockquote || t.showCodeBlock || t.showLink || t.showHorizontalRule, C = t.showTextColor || t.showHighlight, w = t.showUndoRedo || t.showClearFormat, T = [
|
|
3705
3709
|
_,
|
|
3706
3710
|
y,
|
|
3707
3711
|
b,
|
|
3708
|
-
x
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
+
x,
|
|
3713
|
+
C,
|
|
3714
|
+
w
|
|
3715
|
+
], E = T.filter(Boolean).length;
|
|
3716
|
+
function D(e, t) {
|
|
3717
|
+
return !e || T.slice(t + 1).findIndex(Boolean) === -1 ? null : /* @__PURE__ */ U(v, {
|
|
3712
3718
|
orientation: "vertical",
|
|
3713
3719
|
flexItem: !0,
|
|
3714
3720
|
sx: { mx: .5 }
|
|
@@ -3727,7 +3733,7 @@ function ur({ editor: e, toolbarConfig: t, translation: n, disabled: r }) {
|
|
|
3727
3733
|
role: "toolbar",
|
|
3728
3734
|
"aria-label": "Text formatting",
|
|
3729
3735
|
children: [
|
|
3730
|
-
|
|
3736
|
+
_ && /* @__PURE__ */ W(l, {
|
|
3731
3737
|
sx: {
|
|
3732
3738
|
display: "flex",
|
|
3733
3739
|
gap: .25
|
|
@@ -3735,36 +3741,36 @@ function ur({ editor: e, toolbarConfig: t, translation: n, disabled: r }) {
|
|
|
3735
3741
|
children: [
|
|
3736
3742
|
t.showBold && /* @__PURE__ */ U(X, {
|
|
3737
3743
|
label: n.bold,
|
|
3738
|
-
icon: /* @__PURE__ */ U(
|
|
3744
|
+
icon: /* @__PURE__ */ U(Ke, { fontSize: "small" }),
|
|
3739
3745
|
onClick: () => e?.chain().focus().toggleBold().run(),
|
|
3740
3746
|
active: e?.isActive("bold"),
|
|
3741
|
-
disabled:
|
|
3747
|
+
disabled: m
|
|
3742
3748
|
}),
|
|
3743
3749
|
t.showItalic && /* @__PURE__ */ U(X, {
|
|
3744
3750
|
label: n.italic,
|
|
3745
|
-
icon: /* @__PURE__ */ U(
|
|
3751
|
+
icon: /* @__PURE__ */ U(qe, { fontSize: "small" }),
|
|
3746
3752
|
onClick: () => e?.chain().focus().toggleItalic().run(),
|
|
3747
3753
|
active: e?.isActive("italic"),
|
|
3748
|
-
disabled:
|
|
3754
|
+
disabled: m
|
|
3749
3755
|
}),
|
|
3750
3756
|
t.showUnderline && /* @__PURE__ */ U(X, {
|
|
3751
3757
|
label: n.underline,
|
|
3752
|
-
icon: /* @__PURE__ */ U(
|
|
3758
|
+
icon: /* @__PURE__ */ U(Je, { fontSize: "small" }),
|
|
3753
3759
|
onClick: () => e?.chain().focus().toggleUnderline().run(),
|
|
3754
3760
|
active: e?.isActive("underline"),
|
|
3755
|
-
disabled:
|
|
3761
|
+
disabled: m
|
|
3756
3762
|
}),
|
|
3757
3763
|
t.showStrike && /* @__PURE__ */ U(X, {
|
|
3758
3764
|
label: n.strike,
|
|
3759
|
-
icon: /* @__PURE__ */ U(
|
|
3765
|
+
icon: /* @__PURE__ */ U(Ye, { fontSize: "small" }),
|
|
3760
3766
|
onClick: () => e?.chain().focus().toggleStrike().run(),
|
|
3761
3767
|
active: e?.isActive("strike"),
|
|
3762
|
-
disabled:
|
|
3768
|
+
disabled: m
|
|
3763
3769
|
})
|
|
3764
3770
|
]
|
|
3765
3771
|
}),
|
|
3766
|
-
|
|
3767
|
-
|
|
3772
|
+
D(_, 0),
|
|
3773
|
+
y && /* @__PURE__ */ W(l, {
|
|
3768
3774
|
sx: {
|
|
3769
3775
|
display: "flex",
|
|
3770
3776
|
gap: .25
|
|
@@ -3772,49 +3778,49 @@ function ur({ editor: e, toolbarConfig: t, translation: n, disabled: r }) {
|
|
|
3772
3778
|
children: [
|
|
3773
3779
|
t.showHeading1 && /* @__PURE__ */ U(X, {
|
|
3774
3780
|
label: n.heading1,
|
|
3775
|
-
icon: /* @__PURE__ */ U(
|
|
3781
|
+
icon: /* @__PURE__ */ U(dr, { level: 1 }),
|
|
3776
3782
|
onClick: () => e?.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
3777
3783
|
active: e?.isActive("heading", { level: 1 }),
|
|
3778
|
-
disabled:
|
|
3784
|
+
disabled: m
|
|
3779
3785
|
}),
|
|
3780
3786
|
t.showHeading2 && /* @__PURE__ */ U(X, {
|
|
3781
3787
|
label: n.heading2,
|
|
3782
|
-
icon: /* @__PURE__ */ U(
|
|
3788
|
+
icon: /* @__PURE__ */ U(dr, { level: 2 }),
|
|
3783
3789
|
onClick: () => e?.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
3784
3790
|
active: e?.isActive("heading", { level: 2 }),
|
|
3785
|
-
disabled:
|
|
3791
|
+
disabled: m
|
|
3786
3792
|
}),
|
|
3787
3793
|
t.showHeading3 && /* @__PURE__ */ U(X, {
|
|
3788
3794
|
label: n.heading3,
|
|
3789
|
-
icon: /* @__PURE__ */ U(
|
|
3795
|
+
icon: /* @__PURE__ */ U(dr, { level: 3 }),
|
|
3790
3796
|
onClick: () => e?.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
3791
3797
|
active: e?.isActive("heading", { level: 3 }),
|
|
3792
|
-
disabled:
|
|
3798
|
+
disabled: m
|
|
3793
3799
|
})
|
|
3794
3800
|
]
|
|
3795
3801
|
}),
|
|
3796
|
-
|
|
3797
|
-
|
|
3802
|
+
D(y, 1),
|
|
3803
|
+
b && /* @__PURE__ */ W(l, {
|
|
3798
3804
|
sx: {
|
|
3799
3805
|
display: "flex",
|
|
3800
3806
|
gap: .25
|
|
3801
3807
|
},
|
|
3802
3808
|
children: [t.showBulletList && /* @__PURE__ */ U(X, {
|
|
3803
3809
|
label: n.bulletList,
|
|
3804
|
-
icon: /* @__PURE__ */ U(
|
|
3810
|
+
icon: /* @__PURE__ */ U(Xe, { fontSize: "small" }),
|
|
3805
3811
|
onClick: () => e?.chain().focus().toggleBulletList().run(),
|
|
3806
3812
|
active: e?.isActive("bulletList"),
|
|
3807
|
-
disabled:
|
|
3813
|
+
disabled: m
|
|
3808
3814
|
}), t.showOrderedList && /* @__PURE__ */ U(X, {
|
|
3809
3815
|
label: n.orderedList,
|
|
3810
|
-
icon: /* @__PURE__ */ U(
|
|
3816
|
+
icon: /* @__PURE__ */ U(Ze, { fontSize: "small" }),
|
|
3811
3817
|
onClick: () => e?.chain().focus().toggleOrderedList().run(),
|
|
3812
3818
|
active: e?.isActive("orderedList"),
|
|
3813
|
-
disabled:
|
|
3819
|
+
disabled: m
|
|
3814
3820
|
})]
|
|
3815
3821
|
}),
|
|
3816
|
-
|
|
3817
|
-
|
|
3822
|
+
D(b, 2),
|
|
3823
|
+
x && /* @__PURE__ */ W(l, {
|
|
3818
3824
|
sx: {
|
|
3819
3825
|
display: "flex",
|
|
3820
3826
|
gap: .25
|
|
@@ -3822,55 +3828,55 @@ function ur({ editor: e, toolbarConfig: t, translation: n, disabled: r }) {
|
|
|
3822
3828
|
children: [
|
|
3823
3829
|
t.showBlockquote && /* @__PURE__ */ U(X, {
|
|
3824
3830
|
label: n.blockquote,
|
|
3825
|
-
icon: /* @__PURE__ */ U(
|
|
3831
|
+
icon: /* @__PURE__ */ U(Qe, { fontSize: "small" }),
|
|
3826
3832
|
onClick: () => e?.chain().focus().toggleBlockquote().run(),
|
|
3827
3833
|
active: e?.isActive("blockquote"),
|
|
3828
|
-
disabled:
|
|
3834
|
+
disabled: m
|
|
3829
3835
|
}),
|
|
3830
3836
|
t.showCodeBlock && /* @__PURE__ */ U(X, {
|
|
3831
3837
|
label: n.codeBlock,
|
|
3832
|
-
icon: /* @__PURE__ */ U(
|
|
3838
|
+
icon: /* @__PURE__ */ U($e, { fontSize: "small" }),
|
|
3833
3839
|
onClick: () => e?.chain().focus().toggleCodeBlock().run(),
|
|
3834
3840
|
active: e?.isActive("codeBlock"),
|
|
3835
|
-
disabled:
|
|
3841
|
+
disabled: m
|
|
3836
3842
|
}),
|
|
3837
3843
|
t.showLink && /* @__PURE__ */ U(X, {
|
|
3838
3844
|
label: n.link,
|
|
3839
|
-
icon: /* @__PURE__ */ U(
|
|
3840
|
-
onClick: () =>
|
|
3845
|
+
icon: /* @__PURE__ */ U(et, { fontSize: "small" }),
|
|
3846
|
+
onClick: () => c(!0),
|
|
3841
3847
|
active: e?.isActive("link"),
|
|
3842
|
-
disabled:
|
|
3848
|
+
disabled: m
|
|
3843
3849
|
}),
|
|
3844
3850
|
t.showHorizontalRule && /* @__PURE__ */ U(X, {
|
|
3845
3851
|
label: n.horizontalRule,
|
|
3846
|
-
icon: /* @__PURE__ */ U(
|
|
3852
|
+
icon: /* @__PURE__ */ U(tt, { fontSize: "small" }),
|
|
3847
3853
|
onClick: () => e?.chain().focus().setHorizontalRule().run(),
|
|
3848
|
-
disabled:
|
|
3854
|
+
disabled: m
|
|
3849
3855
|
})
|
|
3850
3856
|
]
|
|
3851
3857
|
}),
|
|
3852
|
-
|
|
3853
|
-
|
|
3858
|
+
D(x, 3),
|
|
3859
|
+
C && /* @__PURE__ */ W(l, {
|
|
3854
3860
|
sx: {
|
|
3855
3861
|
display: "flex",
|
|
3856
3862
|
gap: .25
|
|
3857
3863
|
},
|
|
3858
|
-
children: [t.showTextColor && /* @__PURE__ */ U(
|
|
3864
|
+
children: [t.showTextColor && /* @__PURE__ */ U(ur, {
|
|
3859
3865
|
label: n.textColor,
|
|
3860
|
-
icon: /* @__PURE__ */ U(
|
|
3861
|
-
activeColor:
|
|
3862
|
-
disabled:
|
|
3863
|
-
onClick: (e) => c(e.currentTarget)
|
|
3864
|
-
}), t.showHighlight && /* @__PURE__ */ U(cr, {
|
|
3865
|
-
label: n.highlight,
|
|
3866
|
-
icon: /* @__PURE__ */ U(tt, { fontSize: "small" }),
|
|
3867
|
-
activeColor: m,
|
|
3868
|
-
disabled: f,
|
|
3866
|
+
icon: /* @__PURE__ */ U(nt, { fontSize: "small" }),
|
|
3867
|
+
activeColor: h,
|
|
3868
|
+
disabled: m,
|
|
3869
3869
|
onClick: (e) => d(e.currentTarget)
|
|
3870
|
+
}), t.showHighlight && /* @__PURE__ */ U(ur, {
|
|
3871
|
+
label: n.highlight,
|
|
3872
|
+
icon: /* @__PURE__ */ U(rt, { fontSize: "small" }),
|
|
3873
|
+
activeColor: g,
|
|
3874
|
+
disabled: m,
|
|
3875
|
+
onClick: (e) => p(e.currentTarget)
|
|
3870
3876
|
})]
|
|
3871
3877
|
}),
|
|
3872
|
-
|
|
3873
|
-
|
|
3878
|
+
D(C, 4),
|
|
3879
|
+
w && /* @__PURE__ */ W(l, {
|
|
3874
3880
|
sx: {
|
|
3875
3881
|
display: "flex",
|
|
3876
3882
|
gap: .25
|
|
@@ -3879,44 +3885,60 @@ function ur({ editor: e, toolbarConfig: t, translation: n, disabled: r }) {
|
|
|
3879
3885
|
label: n.undo,
|
|
3880
3886
|
icon: /* @__PURE__ */ U(ve, { fontSize: "small" }),
|
|
3881
3887
|
onClick: () => e?.chain().focus().undo().run(),
|
|
3882
|
-
disabled:
|
|
3888
|
+
disabled: m || !e?.can().undo()
|
|
3883
3889
|
}), /* @__PURE__ */ U(X, {
|
|
3884
3890
|
label: n.redo,
|
|
3885
3891
|
icon: /* @__PURE__ */ U(ye, { fontSize: "small" }),
|
|
3886
3892
|
onClick: () => e?.chain().focus().redo().run(),
|
|
3887
|
-
disabled:
|
|
3893
|
+
disabled: m || !e?.can().redo()
|
|
3888
3894
|
})] }), t.showClearFormat && /* @__PURE__ */ U(X, {
|
|
3889
3895
|
label: n.clearFormat,
|
|
3890
|
-
icon: /* @__PURE__ */ U(
|
|
3896
|
+
icon: /* @__PURE__ */ U(it, { fontSize: "small" }),
|
|
3891
3897
|
onClick: () => e?.chain().focus().clearNodes().unsetAllMarks().run(),
|
|
3892
|
-
disabled:
|
|
3898
|
+
disabled: m
|
|
3893
3899
|
})]
|
|
3894
3900
|
}),
|
|
3895
|
-
|
|
3901
|
+
E === 0 && /* @__PURE__ */ U(l, { sx: { height: 32 } }),
|
|
3902
|
+
t.showFullscreenButton && /* @__PURE__ */ U(l, {
|
|
3903
|
+
sx: { ml: "auto" },
|
|
3904
|
+
children: /* @__PURE__ */ U(F, {
|
|
3905
|
+
title: i ? n.exitFullscreen : n.fullscreen,
|
|
3906
|
+
arrow: !0,
|
|
3907
|
+
children: /* @__PURE__ */ U("span", { children: /* @__PURE__ */ U(S, {
|
|
3908
|
+
size: "small",
|
|
3909
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
3910
|
+
onClick: a,
|
|
3911
|
+
disabled: r || !e,
|
|
3912
|
+
sx: { borderRadius: 1 },
|
|
3913
|
+
"aria-label": i ? n.exitFullscreen : n.fullscreen,
|
|
3914
|
+
children: U(i ? Ge : We, { fontSize: "small" })
|
|
3915
|
+
}) })
|
|
3916
|
+
})
|
|
3917
|
+
})
|
|
3896
3918
|
]
|
|
3897
3919
|
}),
|
|
3898
|
-
t.showLink && e && /* @__PURE__ */ U(
|
|
3899
|
-
open:
|
|
3900
|
-
onClose: () =>
|
|
3920
|
+
t.showLink && e && /* @__PURE__ */ U(ar, {
|
|
3921
|
+
open: o,
|
|
3922
|
+
onClose: () => c(!1),
|
|
3901
3923
|
editor: e,
|
|
3902
3924
|
translation: n
|
|
3903
3925
|
}),
|
|
3904
|
-
t.showTextColor && /* @__PURE__ */ U(
|
|
3905
|
-
anchorEl:
|
|
3906
|
-
open: !!
|
|
3907
|
-
onClose: () =>
|
|
3926
|
+
t.showTextColor && /* @__PURE__ */ U(lr, {
|
|
3927
|
+
anchorEl: u,
|
|
3928
|
+
open: !!u,
|
|
3929
|
+
onClose: () => d(null),
|
|
3908
3930
|
mode: "textColor",
|
|
3909
|
-
activeColor:
|
|
3931
|
+
activeColor: h,
|
|
3910
3932
|
onSelectColor: (t) => e?.chain().focus().setColor(t).run(),
|
|
3911
3933
|
onRemoveColor: () => e?.chain().focus().unsetColor().run(),
|
|
3912
3934
|
removeLabel: n.removeTextColor
|
|
3913
3935
|
}),
|
|
3914
|
-
t.showHighlight && /* @__PURE__ */ U(
|
|
3915
|
-
anchorEl:
|
|
3916
|
-
open: !!
|
|
3917
|
-
onClose: () =>
|
|
3936
|
+
t.showHighlight && /* @__PURE__ */ U(lr, {
|
|
3937
|
+
anchorEl: f,
|
|
3938
|
+
open: !!f,
|
|
3939
|
+
onClose: () => p(null),
|
|
3918
3940
|
mode: "highlight",
|
|
3919
|
-
activeColor:
|
|
3941
|
+
activeColor: g,
|
|
3920
3942
|
onSelectColor: (t) => e?.chain().focus().setHighlight({ color: t }).run(),
|
|
3921
3943
|
onRemoveColor: () => e?.chain().focus().unsetHighlight().run(),
|
|
3922
3944
|
removeLabel: n.removeHighlight
|
|
@@ -3925,8 +3947,8 @@ function ur({ editor: e, toolbarConfig: t, translation: n, disabled: r }) {
|
|
|
3925
3947
|
}
|
|
3926
3948
|
//#endregion
|
|
3927
3949
|
//#region src/components/rich-text-editor/RichTextEditorFooter.tsx
|
|
3928
|
-
function
|
|
3929
|
-
let
|
|
3950
|
+
function pr({ helperText: e, error: t, showCharacterCount: n, charCount: r, maxCharacters: i, showWordCount: a, wordCount: o, translation: s }) {
|
|
3951
|
+
let c = i === void 0 ? s.characterCount.replace("{count}", String(r)) : s.characterCountMax.replace("{count}", String(r)).replace("{max}", String(i)), u = i !== void 0 && r >= i ? "error" : "text.secondary", d = s.wordCount.replace("{count}", String(o));
|
|
3930
3952
|
return /* @__PURE__ */ W(l, {
|
|
3931
3953
|
sx: {
|
|
3932
3954
|
display: "flex",
|
|
@@ -3937,22 +3959,32 @@ function dr({ helperText: e, error: t, showCharacterCount: n, charCount: r, maxC
|
|
|
3937
3959
|
children: [/* @__PURE__ */ U(x, {
|
|
3938
3960
|
error: t,
|
|
3939
3961
|
children: e ?? ""
|
|
3940
|
-
}), n && /* @__PURE__ */
|
|
3941
|
-
sx: {
|
|
3942
|
-
|
|
3962
|
+
}), (n || a) && /* @__PURE__ */ W(l, {
|
|
3963
|
+
sx: {
|
|
3964
|
+
display: "flex",
|
|
3965
|
+
gap: 1.5,
|
|
3966
|
+
alignItems: "center"
|
|
3967
|
+
},
|
|
3968
|
+
children: [a && /* @__PURE__ */ U(x, {
|
|
3969
|
+
sx: { color: "text.secondary" },
|
|
3970
|
+
children: d
|
|
3971
|
+
}), n && /* @__PURE__ */ U(x, {
|
|
3972
|
+
sx: { color: u },
|
|
3973
|
+
children: c
|
|
3974
|
+
})]
|
|
3943
3975
|
})]
|
|
3944
3976
|
});
|
|
3945
3977
|
}
|
|
3946
3978
|
//#endregion
|
|
3947
3979
|
//#region src/components/rich-text-editor/RichTextEditor.tsx
|
|
3948
|
-
function
|
|
3949
|
-
let
|
|
3950
|
-
...
|
|
3951
|
-
...
|
|
3952
|
-
},
|
|
3953
|
-
...
|
|
3954
|
-
...
|
|
3955
|
-
},
|
|
3980
|
+
function mr({ disabled: e = !1, error: t = !1, height: n, helperText: i, maxCharacters: a, name: o, placeholder: c, readonly: u = !1, showCharacterCount: d = !1, showToolbar: f = !0, showWordCount: p = !1, toolbarConfig: m, translation: h, value: g, width: _, onBlur: y, onChange: b, onFocus: x }) {
|
|
3981
|
+
let S = {
|
|
3982
|
+
...rr,
|
|
3983
|
+
...h
|
|
3984
|
+
}, C = {
|
|
3985
|
+
...nr,
|
|
3986
|
+
...m
|
|
3987
|
+
}, [w, T] = s(!1), E = kt(n), D = kt(_), k = E === "auto", A = k ? void 0 : E ?? 200, j = a !== void 0 && a > 0 || d || p, M = Ie({
|
|
3956
3988
|
shouldRerenderOnTransaction: !0,
|
|
3957
3989
|
extensions: [
|
|
3958
3990
|
Le.configure({ link: { openOnClick: !1 } }),
|
|
@@ -3963,39 +3995,46 @@ function fr({ value: e, onChange: t, placeholder: n, outputFormat: i = "html", h
|
|
|
3963
3995
|
transformPastedText: !0,
|
|
3964
3996
|
transformCopiedText: !1
|
|
3965
3997
|
}),
|
|
3966
|
-
Ve.configure({ placeholder:
|
|
3967
|
-
...
|
|
3998
|
+
Ve.configure({ placeholder: c ?? "" }),
|
|
3999
|
+
...j ? a !== void 0 && a > 0 ? [He.configure({ limit: a })] : [He] : []
|
|
3968
4000
|
],
|
|
3969
|
-
content:
|
|
3970
|
-
editable: !
|
|
4001
|
+
content: g ?? "",
|
|
4002
|
+
editable: !e && !u,
|
|
3971
4003
|
onUpdate({ editor: e }) {
|
|
3972
|
-
|
|
4004
|
+
b?.(e.getHTML());
|
|
3973
4005
|
},
|
|
3974
4006
|
onBlur() {
|
|
3975
|
-
|
|
4007
|
+
y?.();
|
|
3976
4008
|
},
|
|
3977
4009
|
onFocus() {
|
|
3978
|
-
|
|
4010
|
+
x?.();
|
|
3979
4011
|
}
|
|
3980
4012
|
});
|
|
3981
4013
|
r(() => {
|
|
3982
|
-
!
|
|
4014
|
+
!M || g === void 0 || M.getHTML() !== g && M.commands.setContent(g, { emitUpdate: !1 });
|
|
4015
|
+
}, [M, g]), r(() => {
|
|
4016
|
+
M && M.setEditable(!e && !u);
|
|
3983
4017
|
}, [
|
|
3984
|
-
|
|
4018
|
+
M,
|
|
3985
4019
|
e,
|
|
3986
|
-
|
|
3987
|
-
]), r(() => {
|
|
3988
|
-
E && E.setEditable(!d && !f);
|
|
3989
|
-
}, [
|
|
3990
|
-
E,
|
|
3991
|
-
d,
|
|
3992
|
-
f
|
|
4020
|
+
u
|
|
3993
4021
|
]);
|
|
3994
|
-
let
|
|
4022
|
+
let N = M?.storage.characterCount?.characters?.() ?? 0, P = M?.storage.characterCount?.words?.() ?? 0, F = d || a !== void 0 && a > 0 || p || !!i;
|
|
3995
4023
|
return /* @__PURE__ */ W(l, {
|
|
3996
|
-
sx: {
|
|
3997
|
-
|
|
3998
|
-
|
|
4024
|
+
sx: w ? {
|
|
4025
|
+
position: "fixed",
|
|
4026
|
+
top: 0,
|
|
4027
|
+
left: 0,
|
|
4028
|
+
width: "100vw",
|
|
4029
|
+
height: "100vh",
|
|
4030
|
+
zIndex: 1300,
|
|
4031
|
+
display: "flex",
|
|
4032
|
+
flexDirection: "column",
|
|
4033
|
+
bgcolor: "background.default",
|
|
4034
|
+
p: 1
|
|
4035
|
+
} : {
|
|
4036
|
+
width: D ?? "100%",
|
|
4037
|
+
...k ? {
|
|
3999
4038
|
display: "flex",
|
|
4000
4039
|
flexDirection: "column",
|
|
4001
4040
|
flex: 1
|
|
@@ -4008,50 +4047,54 @@ function fr({ value: e, onChange: t, placeholder: n, outputFormat: i = "html", h
|
|
|
4008
4047
|
display: "flex",
|
|
4009
4048
|
flexDirection: "column",
|
|
4010
4049
|
overflow: "hidden",
|
|
4011
|
-
...w ? { flex: 1 } : { height:
|
|
4012
|
-
borderColor:
|
|
4050
|
+
...w || k ? { flex: 1 } : { height: A },
|
|
4051
|
+
borderColor: t ? "error.main" : void 0,
|
|
4013
4052
|
"&:focus-within": {
|
|
4014
|
-
borderColor:
|
|
4053
|
+
borderColor: t ? "error.main" : "primary.main",
|
|
4015
4054
|
borderWidth: 2
|
|
4016
4055
|
}
|
|
4017
4056
|
},
|
|
4018
|
-
children: [
|
|
4019
|
-
editor:
|
|
4020
|
-
toolbarConfig:
|
|
4021
|
-
translation:
|
|
4022
|
-
disabled:
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4057
|
+
children: [f && !u && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(fr, {
|
|
4058
|
+
editor: M,
|
|
4059
|
+
toolbarConfig: C,
|
|
4060
|
+
translation: S,
|
|
4061
|
+
disabled: e,
|
|
4062
|
+
isFullscreen: w,
|
|
4063
|
+
onToggleFullscreen: () => T((e) => !e)
|
|
4064
|
+
}), /* @__PURE__ */ U(v, {})] }), /* @__PURE__ */ U(ir, {
|
|
4065
|
+
editor: M,
|
|
4066
|
+
error: t,
|
|
4067
|
+
disabled: e,
|
|
4068
|
+
readonly: u
|
|
4028
4069
|
})]
|
|
4029
4070
|
}),
|
|
4030
|
-
|
|
4031
|
-
helperText:
|
|
4032
|
-
error:
|
|
4033
|
-
showCharacterCount:
|
|
4034
|
-
charCount:
|
|
4035
|
-
maxCharacters:
|
|
4036
|
-
|
|
4071
|
+
F && /* @__PURE__ */ U(pr, {
|
|
4072
|
+
helperText: i,
|
|
4073
|
+
error: t,
|
|
4074
|
+
showCharacterCount: d || a !== void 0 && a > 0,
|
|
4075
|
+
charCount: N,
|
|
4076
|
+
maxCharacters: a && a > 0 ? a : void 0,
|
|
4077
|
+
showWordCount: p,
|
|
4078
|
+
wordCount: P,
|
|
4079
|
+
translation: S
|
|
4037
4080
|
}),
|
|
4038
|
-
|
|
4081
|
+
o && /* @__PURE__ */ U("input", {
|
|
4039
4082
|
type: "hidden",
|
|
4040
|
-
name:
|
|
4041
|
-
value:
|
|
4083
|
+
name: o,
|
|
4084
|
+
value: M ? M.getHTML() : ""
|
|
4042
4085
|
})
|
|
4043
4086
|
]
|
|
4044
4087
|
});
|
|
4045
4088
|
}
|
|
4046
4089
|
//#endregion
|
|
4047
4090
|
//#region src/components/sql-editor/SqlEditor.types.ts
|
|
4048
|
-
var
|
|
4091
|
+
var hr = {
|
|
4049
4092
|
showFormat: !0,
|
|
4050
4093
|
showCopy: !0,
|
|
4051
4094
|
showClear: !0,
|
|
4052
4095
|
showExecute: !1,
|
|
4053
4096
|
showUndoRedo: !0
|
|
4054
|
-
},
|
|
4097
|
+
}, gr = {
|
|
4055
4098
|
format: "Format SQL",
|
|
4056
4099
|
copy: "Copy",
|
|
4057
4100
|
copySuccess: "Copied!",
|
|
@@ -4061,14 +4104,14 @@ var pr = {
|
|
|
4061
4104
|
redo: "Redo",
|
|
4062
4105
|
lineColumn: "Ln {line}, Col {col}",
|
|
4063
4106
|
errorCount: "{count} error(s)"
|
|
4064
|
-
},
|
|
4065
|
-
standard:
|
|
4066
|
-
mysql:
|
|
4067
|
-
postgresql:
|
|
4068
|
-
sqlite:
|
|
4069
|
-
mssql:
|
|
4107
|
+
}, _r = {
|
|
4108
|
+
standard: ut,
|
|
4109
|
+
mysql: st,
|
|
4110
|
+
postgresql: ct,
|
|
4111
|
+
sqlite: lt,
|
|
4112
|
+
mssql: ot
|
|
4070
4113
|
};
|
|
4071
|
-
function
|
|
4114
|
+
function vr({ 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
4115
|
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);
|
|
4073
4116
|
return r(() => {
|
|
4074
4117
|
S.current = t;
|
|
@@ -4213,16 +4256,16 @@ function gr({ value: e, onChange: t, placeholder: n, disabled: i = !1, readonly:
|
|
|
4213
4256
|
}, v = [
|
|
4214
4257
|
h,
|
|
4215
4258
|
fe(m),
|
|
4216
|
-
|
|
4217
|
-
dialect:
|
|
4259
|
+
dt({
|
|
4260
|
+
dialect: _r[c],
|
|
4218
4261
|
schema: g
|
|
4219
4262
|
}),
|
|
4220
4263
|
se(),
|
|
4221
|
-
|
|
4264
|
+
ft(),
|
|
4222
4265
|
J.of([
|
|
4223
4266
|
...oe,
|
|
4224
4267
|
...ce,
|
|
4225
|
-
...
|
|
4268
|
+
...pt
|
|
4226
4269
|
]),
|
|
4227
4270
|
k.current.of(G.editable.of(!i && !a)),
|
|
4228
4271
|
A.current.of(re.readOnly.of(a)),
|
|
@@ -4291,14 +4334,14 @@ function gr({ value: e, onChange: t, placeholder: n, disabled: i = !1, readonly:
|
|
|
4291
4334
|
}
|
|
4292
4335
|
//#endregion
|
|
4293
4336
|
//#region src/components/sql-editor/SqlEditorToolbar.tsx
|
|
4294
|
-
var
|
|
4337
|
+
var yr = {
|
|
4295
4338
|
standard: "sql",
|
|
4296
4339
|
mysql: "mysql",
|
|
4297
4340
|
postgresql: "postgresql",
|
|
4298
4341
|
sqlite: "sqlite",
|
|
4299
4342
|
mssql: "tsql"
|
|
4300
4343
|
};
|
|
4301
|
-
function
|
|
4344
|
+
function br({ viewRef: e, toolbarConfig: t, translation: n, dialect: r, disabled: i, onExecute: a }) {
|
|
4302
4345
|
let [o, c] = s(!1), u = i || !e.current;
|
|
4303
4346
|
function d() {
|
|
4304
4347
|
let t = e.current?.state.doc.toString() ?? "";
|
|
@@ -4327,7 +4370,7 @@ function vr({ viewRef: e, toolbarConfig: t, translation: n, dialect: r, disabled
|
|
|
4327
4370
|
if (!t) return;
|
|
4328
4371
|
let n = t.state.doc.toString();
|
|
4329
4372
|
try {
|
|
4330
|
-
let e =
|
|
4373
|
+
let e = ht(n, { language: yr[r] });
|
|
4331
4374
|
t.dispatch({ changes: {
|
|
4332
4375
|
from: 0,
|
|
4333
4376
|
to: t.state.doc.length,
|
|
@@ -4418,7 +4461,7 @@ function vr({ viewRef: e, toolbarConfig: t, translation: n, dialect: r, disabled
|
|
|
4418
4461
|
sx: { mx: .5 }
|
|
4419
4462
|
}), /* @__PURE__ */ U(X, {
|
|
4420
4463
|
label: n.execute,
|
|
4421
|
-
icon: /* @__PURE__ */ U(
|
|
4464
|
+
icon: /* @__PURE__ */ U(mt, { fontSize: "small" }),
|
|
4422
4465
|
onClick: g,
|
|
4423
4466
|
disabled: u
|
|
4424
4467
|
})] }),
|
|
@@ -4428,7 +4471,7 @@ function vr({ viewRef: e, toolbarConfig: t, translation: n, dialect: r, disabled
|
|
|
4428
4471
|
}
|
|
4429
4472
|
//#endregion
|
|
4430
4473
|
//#region src/components/sql-editor/SqlEditorFooter.tsx
|
|
4431
|
-
function
|
|
4474
|
+
function xr({ helperText: e, error: t, showLineColumn: n, showErrorCount: r, diagnosticsCount: i, cursorLine: a, cursorCol: o, translation: s }) {
|
|
4432
4475
|
let c = s.lineColumn.replace("{line}", String(a)).replace("{col}", String(o)), u = s.errorCount.replace("{count}", String(i));
|
|
4433
4476
|
return /* @__PURE__ */ W(l, {
|
|
4434
4477
|
sx: {
|
|
@@ -4444,7 +4487,7 @@ function yr({ helperText: e, error: t, showLineColumn: n, showErrorCount: r, dia
|
|
|
4444
4487
|
alignItems: "center",
|
|
4445
4488
|
gap: .5
|
|
4446
4489
|
},
|
|
4447
|
-
children: [/* @__PURE__ */ U(
|
|
4490
|
+
children: [/* @__PURE__ */ U(gt, { sx: {
|
|
4448
4491
|
fontSize: "0.875rem",
|
|
4449
4492
|
color: "error.main"
|
|
4450
4493
|
} }), /* @__PURE__ */ U(x, {
|
|
@@ -4469,14 +4512,14 @@ function yr({ helperText: e, error: t, showLineColumn: n, showErrorCount: r, dia
|
|
|
4469
4512
|
}
|
|
4470
4513
|
//#endregion
|
|
4471
4514
|
//#region src/components/sql-editor/SqlEditor.tsx
|
|
4472
|
-
function
|
|
4515
|
+
function Sr({ 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 }) {
|
|
4473
4516
|
let D = {
|
|
4474
|
-
...
|
|
4517
|
+
...gr,
|
|
4475
4518
|
...b
|
|
4476
4519
|
}, k = {
|
|
4477
|
-
...
|
|
4520
|
+
...hr,
|
|
4478
4521
|
...y
|
|
4479
|
-
}, A =
|
|
4522
|
+
}, A = kt(i), j = kt(a), M = A === "auto", N = M ? void 0 : A ?? 300, P = o(null), [F, I] = s({
|
|
4480
4523
|
line: 1,
|
|
4481
4524
|
col: 1
|
|
4482
4525
|
}), [L, R] = s(0), z = t((e) => {
|
|
@@ -4512,14 +4555,14 @@ function br({ value: e, onChange: n, placeholder: r, height: i, width: a, disabl
|
|
|
4512
4555
|
borderWidth: 2
|
|
4513
4556
|
}
|
|
4514
4557
|
},
|
|
4515
|
-
children: [!u && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(
|
|
4558
|
+
children: [!u && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(br, {
|
|
4516
4559
|
viewRef: P,
|
|
4517
4560
|
toolbarConfig: k,
|
|
4518
4561
|
translation: D,
|
|
4519
4562
|
dialect: m,
|
|
4520
4563
|
disabled: c,
|
|
4521
4564
|
onExecute: C
|
|
4522
|
-
}), /* @__PURE__ */ U(v, {})] }), /* @__PURE__ */ U(
|
|
4565
|
+
}), /* @__PURE__ */ U(v, {})] }), /* @__PURE__ */ U(vr, {
|
|
4523
4566
|
value: e,
|
|
4524
4567
|
onChange: n,
|
|
4525
4568
|
placeholder: r,
|
|
@@ -4539,7 +4582,7 @@ function br({ value: e, onChange: n, placeholder: r, height: i, width: a, disabl
|
|
|
4539
4582
|
onFocus: E
|
|
4540
4583
|
})]
|
|
4541
4584
|
}),
|
|
4542
|
-
G && /* @__PURE__ */ U(
|
|
4585
|
+
G && /* @__PURE__ */ U(xr, {
|
|
4543
4586
|
helperText: f,
|
|
4544
4587
|
error: d,
|
|
4545
4588
|
showLineColumn: g,
|
|
@@ -4558,4 +4601,4 @@ function br({ value: e, onChange: n, placeholder: r, height: i, width: a, disabl
|
|
|
4558
4601
|
});
|
|
4559
4602
|
}
|
|
4560
4603
|
//#endregion
|
|
4561
|
-
export {
|
|
4604
|
+
export { St as ConfirmDialogProvider, Un as DEFAULT_CHECK_COLORS, _t as DEFAULT_CONFIRM_DIALOG_TRANSLATION, $t as DEFAULT_GANTT_TRANSLATIONS, wt as DEFAULT_JSON_EDITOR_TOOLBAR_CONFIG, Tt as DEFAULT_JSON_EDITOR_TRANSLATION, Hn as DEFAULT_METER_COLORS, Vn as DEFAULT_PASSWORD_TRANSLATIONS, nr as DEFAULT_RICH_TEXT_EDITOR_TOOLBAR_CONFIG, rr as DEFAULT_RICH_TEXT_EDITOR_TRANSLATION, hr as DEFAULT_SQL_EDITOR_TOOLBAR_CONFIG, gr as DEFAULT_SQL_EDITOR_TRANSLATION, Zn as DEFAULT_TAG_SELECTION_TRANSLATION, Ln as GanttChart, jt as JsonEditor, Gn as PasswordStrengthMeter, mr as RichTextEditor, Sr as SqlEditor, tr as TagSelection, Ct as useConfirm, Q as useGanttChartStore, Mn as useGanttTheme, $ as useGanttTranslations, kn as useRawGanttChartStore };
|