@code0-tech/pictor 0.18.3 → 1.0.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/dist/assets/components/button/Button.style.css +1 -1
- package/dist/assets/components/command/Command.style.css +1 -1
- package/dist/assets/components/context-menu/ContextMenu.style.css +1 -1
- package/dist/assets/components/dialog/Dialog.style.css +1 -1
- package/dist/assets/components/form/Input.style.css +1 -1
- package/dist/assets/components/form/SelectInput.style.css +1 -1
- package/dist/assets/components/menu/Menu.style.css +1 -1
- package/dist/assets/components/segmented-control/SegmentedControl.style.css +1 -1
- package/dist/assets/components/tab/Tab.style.css +1 -1
- package/dist/assets/components/tooltip/Tooltip.style.css +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js +9 -8
- package/dist/components/context-menu/ContextMenu.d.ts +1 -1
- package/dist/components/context-menu/ContextMenu.js +89 -102
- package/dist/components/data-table/DataTable.js +11 -10
- package/dist/components/dialog/Dialog.js +75 -80
- package/dist/components/editor/Editor.js +3 -2
- package/dist/components/form/Input.js +18 -17
- package/dist/components/form/NumberInput.js +4 -4
- package/dist/components/form/PasswordInput.js +15 -15
- package/dist/components/form/TextInput.js +7 -7
- package/dist/components/gantt/GanttGroup.js +40 -39
- package/dist/components/json-view/JsonView.js +3 -3
- package/dist/components/menu/Menu.js +104 -117
- package/dist/components/progress/ProgressCircle.js +7 -6
- package/dist/components/progress/ProgressLinear.js +6 -5
- package/dist/components/segmented-control/SegmentedControl.d.ts +2 -2
- package/dist/components/segmented-control/SegmentedControl.js +44 -20
- package/dist/components/tab/Tab.js +58 -32
- package/dist/components/toast/Toast.d.ts +1 -1
- package/dist/components/toast/Toast.js +64 -65
- package/dist/components/tooltip/Tooltip.js +46 -51
- package/dist/index.js +181 -170
- package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js +12 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +25 -14
- package/dist/utils/motion.d.ts +55 -0
- package/dist/utils/motion.js +115 -0
- package/package.json +8 -8
|
@@ -1,103 +1,98 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as l, jsxs as g } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "../../_virtual/compiler-runtime.js";
|
|
3
3
|
import * as s from "@radix-ui/react-dialog";
|
|
4
4
|
import "../../utils/contextStore.js";
|
|
5
|
-
import "react";
|
|
5
|
+
import f from "react";
|
|
6
6
|
import { mergeComponentProps as r } from "../../utils/component.js";
|
|
7
|
+
import { useObservedOpen as C, useSurfaceMotion as D, useScrimMotion as v } from "../../utils/motion.js";
|
|
7
8
|
import "js-md5";
|
|
8
|
-
import { IconX as
|
|
9
|
+
import { IconX as x } from "@tabler/icons-react";
|
|
9
10
|
import '../../assets/components/dialog/Dialog.style.css';/* empty css */
|
|
10
|
-
import { Button as
|
|
11
|
-
import { Flex as
|
|
12
|
-
import { Text as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
t
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
let
|
|
23
|
-
t[
|
|
24
|
-
|
|
25
|
-
let e;
|
|
26
|
-
return t[2] !== o ? (e = /* @__PURE__ */ n(s.Trigger, { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
|
|
27
|
-
}, F = (i) => {
|
|
11
|
+
import { Button as O } from "../button/Button.js";
|
|
12
|
+
import { Flex as y } from "../flex/Flex.js";
|
|
13
|
+
import { Text as P } from "../text/Text.js";
|
|
14
|
+
import { AnimatePresence as _ } from "../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.js";
|
|
15
|
+
import { motion as h } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
|
|
16
|
+
const d = f.createContext(!1), X = (o) => {
|
|
17
|
+
const t = c.c(8), [e, i] = C(o.open, o.defaultOpen, o.onOpenChange);
|
|
18
|
+
let n;
|
|
19
|
+
t[0] !== o ? (n = r("dialog", o), t[0] = o, t[1] = n) : n = t[1];
|
|
20
|
+
const u = n;
|
|
21
|
+
let a;
|
|
22
|
+
t[2] !== i || t[3] !== u ? (a = /* @__PURE__ */ l(s.Root, { ...u, onOpenChange: i }), t[2] = i, t[3] = u, t[4] = a) : a = t[4];
|
|
23
|
+
let m;
|
|
24
|
+
return t[5] !== e || t[6] !== a ? (m = /* @__PURE__ */ l(d.Provider, { value: e, children: a }), t[5] = e, t[6] = a, t[7] = m) : m = t[7], m;
|
|
25
|
+
}, k = (o) => {
|
|
28
26
|
const t = c.c(4);
|
|
29
|
-
let l;
|
|
30
|
-
t[0] !== i ? (l = r("dialog__portal", i), t[0] = i, t[1] = l) : l = t[1];
|
|
31
|
-
const o = l;
|
|
32
27
|
let e;
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
t[0] !== o ? (e = r("dialog__trigger", o), t[0] = o, t[1] = e) : e = t[1];
|
|
29
|
+
const i = e;
|
|
30
|
+
let n;
|
|
31
|
+
return t[2] !== i ? (n = /* @__PURE__ */ l(s.Trigger, { ...i }), t[2] = i, t[3] = n) : n = t[3], n;
|
|
32
|
+
}, q = (o) => {
|
|
35
33
|
const t = c.c(4);
|
|
36
|
-
let l;
|
|
37
|
-
t[0] !== i ? (l = r("dialog__close", i), t[0] = i, t[1] = l) : l = t[1];
|
|
38
|
-
const o = l;
|
|
39
34
|
let e;
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
t[0] !== o ? (e = r("dialog__portal", o), t[0] = o, t[1] = e) : e = t[1];
|
|
36
|
+
const i = e;
|
|
37
|
+
let n;
|
|
38
|
+
return t[2] !== i ? (n = /* @__PURE__ */ l(s.Portal, { forceMount: !0, ...i }), t[2] = i, t[3] = n) : n = t[3], n;
|
|
39
|
+
}, $ = (o) => {
|
|
42
40
|
const t = c.c(4);
|
|
43
|
-
let l;
|
|
44
|
-
t[0] !== i ? (l = r("dialog__overlay", i), t[0] = i, t[1] = l) : l = t[1];
|
|
45
|
-
const o = l;
|
|
46
|
-
let e;
|
|
47
|
-
return t[2] !== o ? (e = /* @__PURE__ */ n(s.Overlay, { ...o }), t[2] = o, t[3] = e) : e = t[3], e;
|
|
48
|
-
}, R = (i) => {
|
|
49
|
-
const t = c.c(9);
|
|
50
|
-
let l;
|
|
51
|
-
t[0] !== i ? (l = r("dialog__content", i), t[0] = i, t[1] = l) : l = t[1];
|
|
52
|
-
const o = l;
|
|
53
41
|
let e;
|
|
54
|
-
t[
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
42
|
+
t[0] !== o ? (e = r("dialog__close", o), t[0] = o, t[1] = e) : e = t[1];
|
|
43
|
+
const i = e;
|
|
44
|
+
let n;
|
|
45
|
+
return t[2] !== i ? (n = /* @__PURE__ */ l(s.Close, { ...i }), t[2] = i, t[3] = n) : n = t[3], n;
|
|
46
|
+
}, G = (o) => {
|
|
47
|
+
const t = f.useContext(d), e = f.useRef(t), i = v();
|
|
48
|
+
return /* @__PURE__ */ l(_, { initial: !e.current, children: t && /* @__PURE__ */ l(s.Overlay, { forceMount: !0, asChild: !0, ...r("dialog__overlay", o), children: /* @__PURE__ */ l(h.div, { ...i }) }, "dialog__overlay") });
|
|
49
|
+
}, J = (o) => {
|
|
50
|
+
const t = f.useContext(d), e = f.useRef(t), i = D();
|
|
51
|
+
return /* @__PURE__ */ l(_, { initial: !e.current, children: t && /* @__PURE__ */ l(s.Content, { forceMount: !0, asChild: !0, ...r("dialog__content", o), children: /* @__PURE__ */ g(h.div, { ...i, children: [
|
|
52
|
+
o.showCloseButton && /* @__PURE__ */ g(y, { align: "center", justify: "space-between", children: [
|
|
53
|
+
/* @__PURE__ */ l(P, { hierarchy: "primary", size: "xl", children: o.title }),
|
|
54
|
+
/* @__PURE__ */ l($, { asChild: !0, children: /* @__PURE__ */ l(O, { variant: "none", color: "tertiary", children: /* @__PURE__ */ l(x, { size: 16 }) }) })
|
|
55
|
+
] }),
|
|
56
|
+
o.children
|
|
57
|
+
] }) }, "dialog__content") });
|
|
58
|
+
}, K = (o) => {
|
|
64
59
|
const t = c.c(4);
|
|
65
|
-
let l;
|
|
66
|
-
t[0] !== i ? (l = r("dialog__title", i), t[0] = i, t[1] = l) : l = t[1];
|
|
67
|
-
const o = l;
|
|
68
60
|
let e;
|
|
69
|
-
|
|
70
|
-
|
|
61
|
+
t[0] !== o ? (e = r("dialog__title", o), t[0] = o, t[1] = e) : e = t[1];
|
|
62
|
+
const i = e;
|
|
63
|
+
let n;
|
|
64
|
+
return t[2] !== i ? (n = /* @__PURE__ */ l(s.Title, { ...i }), t[2] = i, t[3] = n) : n = t[3], n;
|
|
65
|
+
}, L = (o) => {
|
|
71
66
|
const t = c.c(4);
|
|
72
|
-
let l;
|
|
73
|
-
t[0] !== i ? (l = r("dialog__description", i), t[0] = i, t[1] = l) : l = t[1];
|
|
74
|
-
const o = l;
|
|
75
67
|
let e;
|
|
76
|
-
|
|
77
|
-
|
|
68
|
+
t[0] !== o ? (e = r("dialog__description", o), t[0] = o, t[1] = e) : e = t[1];
|
|
69
|
+
const i = e;
|
|
70
|
+
let n;
|
|
71
|
+
return t[2] !== i ? (n = /* @__PURE__ */ l(s.Description, { ...i }), t[2] = i, t[3] = n) : n = t[3], n;
|
|
72
|
+
}, N = (o) => {
|
|
78
73
|
const t = c.c(4);
|
|
79
|
-
let l;
|
|
80
|
-
t[0] !== i ? (l = r("dialog__header", i), t[0] = i, t[1] = l) : l = t[1];
|
|
81
|
-
const o = l;
|
|
82
74
|
let e;
|
|
83
|
-
|
|
84
|
-
|
|
75
|
+
t[0] !== o ? (e = r("dialog__header", o), t[0] = o, t[1] = e) : e = t[1];
|
|
76
|
+
const i = e;
|
|
77
|
+
let n;
|
|
78
|
+
return t[2] !== i ? (n = /* @__PURE__ */ l("div", { ...i }), t[2] = i, t[3] = n) : n = t[3], n;
|
|
79
|
+
}, Q = (o) => {
|
|
85
80
|
const t = c.c(4);
|
|
86
|
-
let l;
|
|
87
|
-
t[0] !== i ? (l = r("dialog__footer", i), t[0] = i, t[1] = l) : l = t[1];
|
|
88
|
-
const o = l;
|
|
89
81
|
let e;
|
|
90
|
-
|
|
82
|
+
t[0] !== o ? (e = r("dialog__footer", o), t[0] = o, t[1] = e) : e = t[1];
|
|
83
|
+
const i = e;
|
|
84
|
+
let n;
|
|
85
|
+
return t[2] !== i ? (n = /* @__PURE__ */ l("div", { ...i }), t[2] = i, t[3] = n) : n = t[3], n;
|
|
91
86
|
};
|
|
92
87
|
export {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
88
|
+
X as Dialog,
|
|
89
|
+
$ as DialogClose,
|
|
90
|
+
J as DialogContent,
|
|
91
|
+
L as DialogDescription,
|
|
92
|
+
Q as DialogFooter,
|
|
93
|
+
N as DialogHeader,
|
|
94
|
+
G as DialogOverlay,
|
|
95
|
+
q as DialogPortal,
|
|
96
|
+
K as DialogTitle,
|
|
97
|
+
k as DialogTrigger
|
|
103
98
|
};
|
|
@@ -3,6 +3,7 @@ import m, { isValidElement as me } from "react";
|
|
|
3
3
|
import { createPortal as H } from "react-dom";
|
|
4
4
|
import "../../utils/contextStore.js";
|
|
5
5
|
import { mergeComponentProps as he } from "../../utils/component.js";
|
|
6
|
+
import "../../_virtual/compiler-runtime.js";
|
|
6
7
|
import { hashToColor as w } from "../../utils/color.js";
|
|
7
8
|
import fe, { Prec as K, keymap as J, ViewPlugin as ge, RangeSetBuilder as pe, Decoration as F, EditorView as ye, WidgetType as be } from "@uiw/react-codemirror";
|
|
8
9
|
import { json as ve, jsonParseLinter as Se } from "@codemirror/lang-json";
|
|
@@ -53,7 +54,7 @@ class X extends be {
|
|
|
53
54
|
return t.type === this.type && t.rawValue === this.rawValue;
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
|
-
const _e = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array.isArray(i),
|
|
57
|
+
const _e = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array.isArray(i), mr = (i) => {
|
|
57
58
|
const {
|
|
58
59
|
language: t,
|
|
59
60
|
tokenizer: f,
|
|
@@ -322,5 +323,5 @@ const _e = (i) => me(i) || typeof i == "string" || typeof i == "number" || Array
|
|
|
322
323
|
] });
|
|
323
324
|
};
|
|
324
325
|
export {
|
|
325
|
-
|
|
326
|
+
mr as Editor
|
|
326
327
|
};
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import r, { useRef as C } from "react";
|
|
3
3
|
import "../../utils/contextStore.js";
|
|
4
4
|
import { mergeComponentProps as _ } from "../../utils/component.js";
|
|
5
|
+
import "../../_virtual/compiler-runtime.js";
|
|
5
6
|
import "js-md5";
|
|
6
7
|
import '../../assets/components/form/Input.style.css';/* empty css */
|
|
7
8
|
import { InputWrapper as v } from "./InputWrapper.js";
|
|
8
9
|
const F = (i) => {
|
|
9
10
|
const o = i ?? "";
|
|
10
11
|
return typeof o == "string" ? o : String(o);
|
|
11
|
-
}, H =
|
|
12
|
+
}, H = r.forwardRef((i, o) => {
|
|
12
13
|
const {
|
|
13
14
|
wrapperComponent: b = {},
|
|
14
|
-
title:
|
|
15
|
+
title: c,
|
|
15
16
|
description: I,
|
|
16
17
|
disabled: u = !1,
|
|
17
18
|
left: k,
|
|
18
19
|
right: x,
|
|
19
20
|
leftType: R = "icon",
|
|
20
21
|
rightType: P = "action",
|
|
21
|
-
formValidation:
|
|
22
|
+
formValidation: a = {
|
|
22
23
|
valid: !0,
|
|
23
24
|
notValidMessage: null
|
|
24
25
|
},
|
|
@@ -28,31 +29,31 @@ const F = (i) => {
|
|
|
28
29
|
onChange: d,
|
|
29
30
|
onInput: f,
|
|
30
31
|
...t
|
|
31
|
-
} = T, w =
|
|
32
|
+
} = T, w = r.useId(), O = t.id ?? w, m = c ? void 0 : t["aria-label"] ?? t.placeholder, h = {
|
|
32
33
|
id: O,
|
|
33
34
|
...m ? {
|
|
34
35
|
"aria-label": m
|
|
35
36
|
} : {}
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
const V =
|
|
39
|
-
if (!
|
|
37
|
+
}, p = C(null), g = C(null);
|
|
38
|
+
r.useImperativeHandle(o, () => p.current);
|
|
39
|
+
const V = r.useCallback((e) => {
|
|
40
|
+
if (!a?.setValue) return;
|
|
40
41
|
const n = t.type !== "checkbox" ? F(e) : e;
|
|
41
|
-
Object.is(g.current, n) || (g.current = n,
|
|
42
|
-
}, [
|
|
42
|
+
Object.is(g.current, n) || (g.current = n, a.setValue(n));
|
|
43
|
+
}, [a?.setValue, t.type]), l = r.useCallback((e) => {
|
|
43
44
|
const n = e.currentTarget, z = t.type === "checkbox" && "checked" in n ? n.checked : n.value;
|
|
44
45
|
V(z);
|
|
45
|
-
}, [t.type, V]), y = _("input-wrapper__control input__control", t), j = t.type === "textarea" ? /* @__PURE__ */
|
|
46
|
+
}, [t.type, V]), y = _("input-wrapper__control input__control", t), j = t.type === "textarea" ? /* @__PURE__ */ s("textarea", { ref: p, ...y, ...h, onInput: (e) => {
|
|
46
47
|
l(e), f?.(e);
|
|
47
48
|
}, onChange: (e) => {
|
|
48
49
|
l(e), d?.(e);
|
|
49
|
-
}, spellCheck: !1, disabled: u }) : /* @__PURE__ */
|
|
50
|
+
}, spellCheck: !1, disabled: u }) : /* @__PURE__ */ s("input", { ref: p, ...y, ...h, onInput: (e) => {
|
|
50
51
|
l(e), f?.(e);
|
|
51
52
|
}, onChange: (e) => {
|
|
52
53
|
l(e), d?.(e);
|
|
53
54
|
}, spellCheck: !1, disabled: u });
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
}),
|
|
55
|
+
return /* @__PURE__ */ s(v, { type: t.type, title: c, description: I, left: k, right: x, leftType: R, rightType: P, formValidation: a, ...b, children: j });
|
|
56
|
+
}), G = H;
|
|
56
57
|
export {
|
|
57
|
-
|
|
58
|
+
G as Input
|
|
58
59
|
};
|
|
@@ -2,17 +2,17 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import o from "react";
|
|
3
3
|
import { Input as l } from "./Input.js";
|
|
4
4
|
import { IconMinus as a, IconPlus as p } from "@tabler/icons-react";
|
|
5
|
-
import { Button as
|
|
6
|
-
import { ButtonGroup as
|
|
5
|
+
import { Button as e } from "../button/Button.js";
|
|
6
|
+
import { ButtonGroup as u } from "../button-group/ButtonGroup.js";
|
|
7
7
|
const g = o.forwardRef((c, r) => {
|
|
8
8
|
r = r || o.useRef(null);
|
|
9
9
|
const {
|
|
10
10
|
step: n = 1,
|
|
11
11
|
...i
|
|
12
12
|
} = c;
|
|
13
|
-
return /* @__PURE__ */ t(l, { className: "number-input", right: /* @__PURE__ */ t(
|
|
13
|
+
return /* @__PURE__ */ t(l, { className: "number-input", right: /* @__PURE__ */ t(u, { color: "primary", children: /* @__PURE__ */ t(e, { tabIndex: -1, color: "secondary", paddingSize: "xxs", onClick: () => {
|
|
14
14
|
r.current && (r.current.value || (r.current.value = "0"), r.current.value = (Number.parseInt(r.current.value) + n).toString());
|
|
15
|
-
}, children: /* @__PURE__ */ t(p, { size: 13 }) }) }), left: /* @__PURE__ */ t(
|
|
15
|
+
}, children: /* @__PURE__ */ t(p, { size: 13 }) }) }), left: /* @__PURE__ */ t(u, { color: "primary", children: /* @__PURE__ */ t(e, { tabIndex: -1, color: "secondary", paddingSize: "xxs", onClick: () => {
|
|
16
16
|
r.current && (r.current.value || (r.current.value = "0"), r.current.value = (Number.parseInt(r.current.value) - n).toString());
|
|
17
17
|
}, children: /* @__PURE__ */ t(a, { size: 13 }) }) }), leftType: "action", type: "number", ref: r, ...i });
|
|
18
18
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as c, Fragment as
|
|
1
|
+
import { jsxs as c, Fragment as I, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import u from "react";
|
|
3
|
-
import { Input as
|
|
3
|
+
import { Input as w } from "./Input.js";
|
|
4
4
|
import { IconEye as R, IconX as z } from "@tabler/icons-react";
|
|
5
5
|
import { Button as p } from "../button/Button.js";
|
|
6
6
|
import { clearInputElement as P } from "./Input.utils.js";
|
|
@@ -14,24 +14,24 @@ const X = u.forwardRef((r, t) => {
|
|
|
14
14
|
clearable: d = !0,
|
|
15
15
|
visible: m = !0,
|
|
16
16
|
right: f,
|
|
17
|
-
formValidation:
|
|
17
|
+
formValidation: o,
|
|
18
18
|
...g
|
|
19
|
-
} = r, h = (e) => (P(t.current), e.stopPropagation(), e.preventDefault(), !1), x = (e) => (t.current instanceof HTMLInputElement && (t.current.type === "password" ? t.current.type = "text" : t.current.type === "text" && (t.current.type = "password")), e.stopPropagation(), e.preventDefault(), !1),
|
|
20
|
-
m &&
|
|
21
|
-
const a =
|
|
22
|
-
return /* @__PURE__ */ c(
|
|
23
|
-
/* @__PURE__ */
|
|
19
|
+
} = r, h = (e) => (P(t.current), e.stopPropagation(), e.preventDefault(), !1), x = (e) => (t.current instanceof HTMLInputElement && (t.current.type === "password" ? t.current.type = "text" : t.current.type === "text" && (t.current.type = "password")), e.stopPropagation(), e.preventDefault(), !1), s = [f];
|
|
20
|
+
m && s.push(/* @__PURE__ */ n(p, { color: "secondary", tabIndex: -1, paddingSize: "xxs", onClick: (e) => x(e), children: /* @__PURE__ */ n(R, { size: 13 }) })), d && s.push(/* @__PURE__ */ n(p, { tabIndex: -1, color: "secondary", paddingSize: "xxs", onClick: (e) => h(e), children: /* @__PURE__ */ n(z, { size: 13 }) }));
|
|
21
|
+
const a = s.filter(Boolean), i = o?.notValidMessage ?? "", l = /^[1-5]+$/.test(i), y = i.length, M = Math.max(0, 5 - y) / 5 * 100;
|
|
22
|
+
return /* @__PURE__ */ c(I, { children: [
|
|
23
|
+
/* @__PURE__ */ n(w, { right: a.length > 0 ? /* @__PURE__ */ n(C, { color: "primary", children: a }) : void 0, rightType: "action", type: "password", ref: t, ...o ? {
|
|
24
24
|
formValidation: l ? {
|
|
25
|
-
setValue:
|
|
26
|
-
valid:
|
|
27
|
-
} :
|
|
25
|
+
setValue: o.setValue,
|
|
26
|
+
valid: o.valid
|
|
27
|
+
} : o
|
|
28
28
|
} : {}, ...g }),
|
|
29
|
-
l && !
|
|
29
|
+
l && !o?.valid && /* @__PURE__ */ c(A, { mt: 0.7, style: {
|
|
30
30
|
flexDirection: "column"
|
|
31
31
|
}, children: [
|
|
32
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ n(B, { value: M, max: 100, color: "linear-gradient(to right, #D90429 0%, #29BF12 100%)" }),
|
|
33
33
|
(() => {
|
|
34
|
-
const e = ["2", "3", "4", "5", "1"].find((
|
|
34
|
+
const e = ["2", "3", "4", "5", "1"].find((b) => i.includes(b));
|
|
35
35
|
if (!e) return null;
|
|
36
36
|
const V = {
|
|
37
37
|
1: "Must be at least 8 characters",
|
|
@@ -40,7 +40,7 @@ const X = u.forwardRef((r, t) => {
|
|
|
40
40
|
4: "Must include a number",
|
|
41
41
|
5: "Must include a special character"
|
|
42
42
|
}[e];
|
|
43
|
-
return /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ n(D, { children: V });
|
|
44
44
|
})()
|
|
45
45
|
] })
|
|
46
46
|
] });
|
|
@@ -5,19 +5,19 @@ import { IconX as u } from "@tabler/icons-react";
|
|
|
5
5
|
import { Button as f } from "../button/Button.js";
|
|
6
6
|
import { clearInputElement as d } from "./Input.utils.js";
|
|
7
7
|
import { ButtonGroup as h } from "../button-group/ButtonGroup.js";
|
|
8
|
-
const
|
|
8
|
+
const R = l.forwardRef((r, t) => {
|
|
9
9
|
t = t || l.useRef(null);
|
|
10
10
|
const {
|
|
11
11
|
clearable: c = !1,
|
|
12
|
-
right:
|
|
13
|
-
...
|
|
12
|
+
right: a,
|
|
13
|
+
...m
|
|
14
14
|
} = r, p = (e) => {
|
|
15
15
|
d(t.current), r.onClear && r.onClear(e);
|
|
16
|
-
}, n = [
|
|
17
|
-
c && n.push(/* @__PURE__ */ o(f, { color: "secondary", paddingSize: "xxs", onClick: (e) => p(e), children: /* @__PURE__ */ o(u, { size: 13 }) }));
|
|
16
|
+
}, n = [a];
|
|
17
|
+
c && n.push(/* @__PURE__ */ o(f, { color: "secondary", tabIndex: -1, paddingSize: "xxs", onClick: (e) => p(e), children: /* @__PURE__ */ o(u, { size: 13 }) }));
|
|
18
18
|
const i = n.filter(Boolean);
|
|
19
|
-
return /* @__PURE__ */ o(s, { right: i.length > 0 ? /* @__PURE__ */ o(h, { color: "primary", children: i }) : void 0, type: "text", ref: t, ...
|
|
19
|
+
return /* @__PURE__ */ o(s, { right: i.length > 0 ? /* @__PURE__ */ o(h, { color: "primary", children: i }) : void 0, type: "text", ref: t, ...m });
|
|
20
20
|
});
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
R as TextInput
|
|
23
23
|
};
|
|
@@ -2,34 +2,35 @@ import { jsxs as L, jsx as v, Fragment as et } from "react/jsx-runtime";
|
|
|
2
2
|
import p from "react";
|
|
3
3
|
import "../../utils/contextStore.js";
|
|
4
4
|
import "merge-props";
|
|
5
|
+
import "../../_virtual/compiler-runtime.js";
|
|
5
6
|
import { withAlpha as I, hashToColor as A } from "../../utils/color.js";
|
|
6
7
|
import { GanttItem as rt } from "./GanttItem.js";
|
|
7
8
|
import { GanttHeader as nt } from "./GanttHeader.js";
|
|
8
|
-
const ot = 3,
|
|
9
|
-
const l = Math.pow(10, Math.floor(Math.log10(
|
|
9
|
+
const ot = 3, it = (m) => {
|
|
10
|
+
const l = Math.pow(10, Math.floor(Math.log10(m))), u = m / l;
|
|
10
11
|
return (u < 1.5 ? 1 : u < 3 ? 2 : u < 7 ? 5 : 10) * l;
|
|
11
|
-
},
|
|
12
|
+
}, st = (m) => {
|
|
12
13
|
const {
|
|
13
14
|
items: l,
|
|
14
15
|
stepWidth: u = "50px",
|
|
15
16
|
rowHeight: W = "50px",
|
|
16
|
-
step:
|
|
17
|
+
step: s = 1,
|
|
17
18
|
start: f = 1,
|
|
18
19
|
end: $ = 999999999,
|
|
19
20
|
hideScaling: T = !1,
|
|
20
21
|
children: y
|
|
21
|
-
} =
|
|
22
|
+
} = m, E = p.useRef(null), [D, N] = p.useState(0), [V, F] = p.useState(void 0), [S, H] = p.useState({
|
|
22
23
|
scrollLeft: 0,
|
|
23
24
|
clientWidth: 0,
|
|
24
25
|
scrollWidth: 0
|
|
25
|
-
}),
|
|
26
|
+
}), h = p.useMemo(() => parseInt(u), [u]), O = $ - f, P = Math.ceil(O / s), {
|
|
26
27
|
avgDuration: j,
|
|
27
28
|
itemMinStart: G,
|
|
28
29
|
itemMaxEnd: w
|
|
29
30
|
} = p.useMemo(() => {
|
|
30
31
|
if (!l || l.length === 0)
|
|
31
32
|
return {
|
|
32
|
-
avgDuration:
|
|
33
|
+
avgDuration: s,
|
|
33
34
|
itemMinStart: f,
|
|
34
35
|
itemMaxEnd: $
|
|
35
36
|
};
|
|
@@ -39,26 +40,26 @@ const ot = 3, st = (h) => {
|
|
|
39
40
|
c.start < t && (t = c.start), c.end > n && (n = c.end), c.type !== "group" && (r += c.end - c.start, e++);
|
|
40
41
|
}
|
|
41
42
|
return {
|
|
42
|
-
avgDuration: e === 0 ?
|
|
43
|
+
avgDuration: e === 0 ? s : r / e,
|
|
43
44
|
itemMinStart: t,
|
|
44
45
|
itemMaxEnd: n
|
|
45
46
|
};
|
|
46
|
-
}, [l, f, $,
|
|
47
|
+
}, [l, f, $, s]), {
|
|
47
48
|
effTime: M,
|
|
48
49
|
invEffTime: b,
|
|
49
50
|
inGap: z
|
|
50
51
|
} = p.useMemo(() => {
|
|
51
|
-
const r = ot *
|
|
52
|
-
for (const [
|
|
52
|
+
const r = ot * s, e = [], t = (l ?? []).map((i) => [i.start, i.end]).sort((i, a) => i[0] - a[0]);
|
|
53
|
+
for (const [i, a] of t) {
|
|
53
54
|
const d = e[e.length - 1];
|
|
54
|
-
d &&
|
|
55
|
+
d && i <= d[1] ? d[1] = Math.max(d[1], a) : e.push([i, a]);
|
|
55
56
|
}
|
|
56
57
|
const n = [];
|
|
57
58
|
let o = 0;
|
|
58
|
-
for (let
|
|
59
|
-
const a = e[
|
|
59
|
+
for (let i = 1; i < e.length; i++) {
|
|
60
|
+
const a = e[i - 1][1], d = e[i][0];
|
|
60
61
|
if (d - a <= r) continue;
|
|
61
|
-
const tt = Math.round((a - o + r - f) /
|
|
62
|
+
const tt = Math.round((a - o + r - f) / s), R = f + tt * s, k = d - o - R;
|
|
62
63
|
n.push({
|
|
63
64
|
gapStart: a,
|
|
64
65
|
gapEnd: d,
|
|
@@ -67,48 +68,48 @@ const ot = 3, st = (h) => {
|
|
|
67
68
|
}), o += k;
|
|
68
69
|
}
|
|
69
70
|
return {
|
|
70
|
-
effTime: (
|
|
71
|
-
let a =
|
|
71
|
+
effTime: (i) => {
|
|
72
|
+
let a = i;
|
|
72
73
|
for (const d of n)
|
|
73
|
-
|
|
74
|
+
i >= d.gapEnd ? a -= d.remove : i > d.gapStart && (a = Math.min(a, d.effGapEnd));
|
|
74
75
|
return a;
|
|
75
76
|
},
|
|
76
|
-
invEffTime: (
|
|
77
|
-
let a =
|
|
77
|
+
invEffTime: (i) => {
|
|
78
|
+
let a = i;
|
|
78
79
|
for (const d of n)
|
|
79
|
-
|
|
80
|
+
i >= d.effGapEnd && (a += d.remove);
|
|
80
81
|
return a;
|
|
81
82
|
},
|
|
82
|
-
inGap: (
|
|
83
|
+
inGap: (i) => n.some((a) => i > a.gapStart && i < a.gapEnd)
|
|
83
84
|
};
|
|
84
|
-
}, [l,
|
|
85
|
-
const t = Math.max(f, M(r)), n = M(e), o = (t - f) /
|
|
85
|
+
}, [l, s, f]), x = (r, e) => {
|
|
86
|
+
const t = Math.max(f, M(r)), n = M(e), o = (t - f) / s * h, c = (n - t) / s * h;
|
|
86
87
|
return {
|
|
87
88
|
left: o,
|
|
88
89
|
width: c
|
|
89
90
|
};
|
|
90
|
-
}, U = l && l.length > 0 ? Math.ceil((M(w) - f) /
|
|
91
|
+
}, U = l && l.length > 0 ? Math.ceil((M(w) - f) / s) : P, X = Math.ceil(D / h), g = Math.max(X, U + 2), {
|
|
91
92
|
headerTicks: q,
|
|
92
93
|
headerInterval: B
|
|
93
94
|
} = p.useMemo(() => {
|
|
94
|
-
const r =
|
|
95
|
+
const r = it(s * 3), e = [];
|
|
95
96
|
if (!(r > 0)) return {
|
|
96
97
|
headerTicks: e,
|
|
97
98
|
headerInterval: 1
|
|
98
99
|
};
|
|
99
|
-
const t = b(f + g *
|
|
100
|
+
const t = b(f + g * s), n = Math.ceil(f / r) * r;
|
|
100
101
|
for (let o = 0; n + o * r <= t; o++) {
|
|
101
102
|
const c = n + o * r;
|
|
102
103
|
z(c) || e.push({
|
|
103
104
|
time: c,
|
|
104
|
-
left: (M(c) - f) /
|
|
105
|
+
left: (M(c) - f) / s * h
|
|
105
106
|
});
|
|
106
107
|
}
|
|
107
108
|
return {
|
|
108
109
|
headerTicks: e,
|
|
109
110
|
headerInterval: r
|
|
110
111
|
};
|
|
111
|
-
}, [M, b, z, f,
|
|
112
|
+
}, [M, b, z, f, s, g, h]);
|
|
112
113
|
p.useEffect(() => {
|
|
113
114
|
const r = () => {
|
|
114
115
|
N(E.current?.offsetWidth ?? 0);
|
|
@@ -153,13 +154,13 @@ const ot = 3, st = (h) => {
|
|
|
153
154
|
}), [W]), _ = p.useMemo(() => Array.from({
|
|
154
155
|
length: Math.max(0, g - 1)
|
|
155
156
|
}), [g]);
|
|
156
|
-
return /* @__PURE__ */ L("div", { "data-gantt-id":
|
|
157
|
+
return /* @__PURE__ */ L("div", { "data-gantt-id": m.id, id: m.id, ref: E, style: Y, children: [
|
|
157
158
|
!T && /* @__PURE__ */ v(nt, { ticks: q, interval: B, avgDuration: j, stepWidth: u, canScrollLeft: J, canScrollRight: K }),
|
|
158
159
|
Q.map((r, e) => /* @__PURE__ */ L(p.Fragment, { children: [
|
|
159
160
|
/* @__PURE__ */ L("div", { style: Z, children: [
|
|
160
161
|
_.map((t, n) => /* @__PURE__ */ v("div", { style: {
|
|
161
162
|
position: "absolute",
|
|
162
|
-
left: (n + 1) *
|
|
163
|
+
left: (n + 1) * h,
|
|
163
164
|
top: 0,
|
|
164
165
|
bottom: 0,
|
|
165
166
|
width: "0px",
|
|
@@ -173,11 +174,11 @@ const ot = 3, st = (h) => {
|
|
|
173
174
|
45deg,
|
|
174
175
|
transparent,
|
|
175
176
|
transparent 2px,
|
|
176
|
-
${I(A(
|
|
177
|
+
${I(A(m.id.replace("target", "source")), 0.5)} 4px
|
|
177
178
|
)
|
|
178
179
|
`,
|
|
179
|
-
left: `${x(G, G +
|
|
180
|
-
width: `${x(G, G +
|
|
180
|
+
left: `${x(G, G + s).left}px`,
|
|
181
|
+
width: `${x(G, G + s).width}px`
|
|
181
182
|
} }),
|
|
182
183
|
/* @__PURE__ */ v("div", { className: "gantt__group-wrapper", style: {
|
|
183
184
|
backgroundImage: `
|
|
@@ -186,11 +187,11 @@ const ot = 3, st = (h) => {
|
|
|
186
187
|
45deg,
|
|
187
188
|
transparent,
|
|
188
189
|
transparent 2px,
|
|
189
|
-
${I(A(
|
|
190
|
+
${I(A(m.id.replace("target", "source")), 0.5)} 4px
|
|
190
191
|
)
|
|
191
192
|
`,
|
|
192
|
-
left: `${x(w -
|
|
193
|
-
width: `${x(w -
|
|
193
|
+
left: `${x(w - s, w).left}px`,
|
|
194
|
+
width: `${x(w - s, w).width}px`
|
|
194
195
|
} })
|
|
195
196
|
] }),
|
|
196
197
|
r.map((t, n) => {
|
|
@@ -200,10 +201,10 @@ const ot = 3, st = (h) => {
|
|
|
200
201
|
}, children: y?.(t, n) }, t.id);
|
|
201
202
|
})
|
|
202
203
|
] }, `row-${e}`),
|
|
203
|
-
r.map((t, n) => t.type === "group" && V === t.id && /* @__PURE__ */ v(
|
|
204
|
+
r.map((t, n) => t.type === "group" && V === t.id && /* @__PURE__ */ v(st, { children: y, id: `group-target-${n}`, start: Math.min(...t.data.items.map((o) => o.start)) - Math.min(...t.data.items.map((o) => o.start)) / (t.data.firstGroupStep * t.data.step) * (t.data.groupStep * t.data.step), step: t.data.groupStep * t.data.step, stepWidth: u, rowHeight: W, items: t.data.items }, `group-target-${n}`))
|
|
204
205
|
] }, `row-frag-${e}`))
|
|
205
206
|
] });
|
|
206
207
|
};
|
|
207
208
|
export {
|
|
208
|
-
|
|
209
|
+
st as GanttGroup
|
|
209
210
|
};
|
|
@@ -8,8 +8,8 @@ import { mergeComponentProps as z } from "../../utils/component.js";
|
|
|
8
8
|
import { hashToColor as r } from "../../utils/color.js";
|
|
9
9
|
import '../../assets/components/json-view/JsonView.style.css';/* empty css */
|
|
10
10
|
import { Text as I } from "../text/Text.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { motion as S } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
|
|
12
|
+
import { AnimatePresence as E } from "../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.js";
|
|
13
13
|
const q = {
|
|
14
14
|
"--w-rjv-font-family": '"Inter", sans-serif',
|
|
15
15
|
"--w-rjv-font-size": "0.8rem",
|
|
@@ -88,7 +88,7 @@ function J(n) {
|
|
|
88
88
|
onClick: o,
|
|
89
89
|
...i
|
|
90
90
|
} = n;
|
|
91
|
-
return /* @__PURE__ */ l("span", { ...i, onClick: o, className: "json-view__copy", "data-copied": e, children: /* @__PURE__ */ l(
|
|
91
|
+
return /* @__PURE__ */ l("span", { ...i, onClick: o, className: "json-view__copy", "data-copied": e, children: /* @__PURE__ */ l(E, { mode: "wait", initial: !1, children: /* @__PURE__ */ l(S.span, { initial: {
|
|
92
92
|
opacity: 0,
|
|
93
93
|
scale: 0.5,
|
|
94
94
|
filter: "blur(0.35rem)"
|