@code0-tech/pictor 0.18.0 → 0.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/components/command/Command.style.css +1 -1
- package/dist/assets/components/context-menu/ContextMenu.style.css +1 -1
- package/dist/assets/components/gantt/Gantt.style.css +1 -1
- package/dist/assets/components/menu/Menu.style.css +1 -1
- package/dist/assets/components/tooltip/Tooltip.style.css +1 -1
- package/dist/components/command/Command.js +70 -63
- package/dist/components/context-menu/ContextMenu.js +57 -57
- package/dist/components/form/InputWrapper.js +33 -33
- package/dist/components/form/TextInput.d.ts +1 -1
- package/dist/components/gantt/Gantt.js +1 -1
- package/dist/components/gantt/GanttGroup.js +175 -128
- package/dist/components/gantt/GanttHeader.d.ts +7 -3
- package/dist/components/gantt/GanttHeader.js +63 -45
- package/dist/components/menu/Menu.js +19 -19
- package/dist/components/tooltip/Tooltip.js +17 -17
- package/package.json +15 -15
|
@@ -1,162 +1,209 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import D from "react";
|
|
1
|
+
import { jsxs as L, jsx as v, Fragment as et } from "react/jsx-runtime";
|
|
2
|
+
import p from "react";
|
|
4
3
|
import "../../utils/contextStore.js";
|
|
5
4
|
import "merge-props";
|
|
6
|
-
import { withAlpha as
|
|
7
|
-
import { GanttItem as
|
|
8
|
-
import { GanttHeader as
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
5
|
+
import { withAlpha as I, hashToColor as A } from "../../utils/color.js";
|
|
6
|
+
import { GanttItem as rt } from "./GanttItem.js";
|
|
7
|
+
import { GanttHeader as nt } from "./GanttHeader.js";
|
|
8
|
+
const ot = 3, st = (h) => {
|
|
9
|
+
const l = Math.pow(10, Math.floor(Math.log10(h))), u = h / l;
|
|
10
|
+
return (u < 1.5 ? 1 : u < 3 ? 2 : u < 7 ? 5 : 10) * l;
|
|
11
|
+
}, it = (h) => {
|
|
12
|
+
const {
|
|
13
|
+
items: l,
|
|
14
|
+
stepWidth: u = "50px",
|
|
15
|
+
rowHeight: W = "50px",
|
|
16
|
+
step: i = 1,
|
|
17
|
+
start: f = 1,
|
|
18
|
+
end: $ = 999999999,
|
|
19
|
+
hideScaling: T = !1,
|
|
20
|
+
children: y
|
|
21
|
+
} = h, E = p.useRef(null), [D, N] = p.useState(0), [V, F] = p.useState(void 0), [S, H] = p.useState({
|
|
22
|
+
scrollLeft: 0,
|
|
23
|
+
clientWidth: 0,
|
|
24
|
+
scrollWidth: 0
|
|
25
|
+
}), m = p.useMemo(() => parseInt(u), [u]), O = $ - f, P = Math.ceil(O / i), {
|
|
26
|
+
avgDuration: j,
|
|
27
|
+
itemMinStart: G,
|
|
28
|
+
itemMaxEnd: w
|
|
29
|
+
} = p.useMemo(() => {
|
|
30
|
+
if (!l || l.length === 0)
|
|
31
|
+
return {
|
|
31
32
|
avgDuration: i,
|
|
32
|
-
itemMinStart:
|
|
33
|
-
itemMaxEnd:
|
|
34
|
-
}
|
|
35
|
-
|
|
33
|
+
itemMinStart: f,
|
|
34
|
+
itemMaxEnd: $
|
|
35
|
+
};
|
|
36
|
+
let r = 0, e = 0, t = 1 / 0, n = -1 / 0;
|
|
37
|
+
for (let o = 0; o < l.length; o++) {
|
|
38
|
+
const c = l[o];
|
|
39
|
+
c.start < t && (t = c.start), c.end > n && (n = c.end), c.type !== "group" && (r += c.end - c.start, e++);
|
|
36
40
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
return {
|
|
42
|
+
avgDuration: e === 0 ? i : r / e,
|
|
43
|
+
itemMinStart: t,
|
|
44
|
+
itemMaxEnd: n
|
|
45
|
+
};
|
|
46
|
+
}, [l, f, $, i]), {
|
|
47
|
+
effTime: M,
|
|
48
|
+
invEffTime: b,
|
|
49
|
+
inGap: z
|
|
50
|
+
} = p.useMemo(() => {
|
|
51
|
+
const r = ot * i, e = [], t = (l ?? []).map((s) => [s.start, s.end]).sort((s, a) => s[0] - a[0]);
|
|
52
|
+
for (const [s, a] of t) {
|
|
53
|
+
const d = e[e.length - 1];
|
|
54
|
+
d && s <= d[1] ? d[1] = Math.max(d[1], a) : e.push([s, a]);
|
|
41
55
|
}
|
|
42
|
-
const
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
const n = [];
|
|
57
|
+
let o = 0;
|
|
58
|
+
for (let s = 1; s < e.length; s++) {
|
|
59
|
+
const a = e[s - 1][1], d = e[s][0];
|
|
60
|
+
if (d - a <= r) continue;
|
|
61
|
+
const tt = Math.round((a - o + r - f) / i), R = f + tt * i, k = d - o - R;
|
|
62
|
+
n.push({
|
|
63
|
+
gapStart: a,
|
|
64
|
+
gapEnd: d,
|
|
65
|
+
effGapEnd: R,
|
|
66
|
+
remove: k
|
|
67
|
+
}), o += k;
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
effTime: (s) => {
|
|
71
|
+
let a = s;
|
|
72
|
+
for (const d of n)
|
|
73
|
+
s >= d.gapEnd ? a -= d.remove : s > d.gapStart && (a = Math.min(a, d.effGapEnd));
|
|
74
|
+
return a;
|
|
75
|
+
},
|
|
76
|
+
invEffTime: (s) => {
|
|
77
|
+
let a = s;
|
|
78
|
+
for (const d of n)
|
|
79
|
+
s >= d.effGapEnd && (a += d.remove);
|
|
80
|
+
return a;
|
|
81
|
+
},
|
|
82
|
+
inGap: (s) => n.some((a) => s > a.gapStart && s < a.gapEnd)
|
|
83
|
+
};
|
|
84
|
+
}, [l, i, f]), x = (r, e) => {
|
|
85
|
+
const t = Math.max(f, M(r)), n = M(e), o = (t - f) / i * m, c = (n - t) / i * m;
|
|
86
|
+
return {
|
|
87
|
+
left: o,
|
|
88
|
+
width: c
|
|
89
|
+
};
|
|
90
|
+
}, U = l && l.length > 0 ? Math.ceil((M(w) - f) / i) : P, X = Math.ceil(D / m), g = Math.max(X, U + 2), {
|
|
91
|
+
headerTicks: q,
|
|
92
|
+
headerInterval: B
|
|
93
|
+
} = p.useMemo(() => {
|
|
94
|
+
const r = st(i * 3), e = [];
|
|
95
|
+
if (!(r > 0)) return {
|
|
96
|
+
headerTicks: e,
|
|
97
|
+
headerInterval: 1
|
|
98
|
+
};
|
|
99
|
+
const t = b(f + g * i), n = Math.ceil(f / r) * r;
|
|
100
|
+
for (let o = 0; n + o * r <= t; o++) {
|
|
101
|
+
const c = n + o * r;
|
|
102
|
+
z(c) || e.push({
|
|
103
|
+
time: c,
|
|
104
|
+
left: (M(c) - f) / i * m
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
headerTicks: e,
|
|
109
|
+
headerInterval: r
|
|
110
|
+
};
|
|
111
|
+
}, [M, b, z, f, i, g, m]);
|
|
112
|
+
p.useEffect(() => {
|
|
113
|
+
const r = () => {
|
|
114
|
+
N(E.current?.offsetWidth ?? 0);
|
|
115
|
+
};
|
|
116
|
+
r();
|
|
117
|
+
const e = E.current;
|
|
118
|
+
return e?.addEventListener("resize", r), window.addEventListener("resize", r), () => {
|
|
119
|
+
window.removeEventListener("resize", r), e?.removeEventListener("resize", r);
|
|
59
120
|
};
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
121
|
+
}, []), p.useEffect(() => {
|
|
122
|
+
const r = E.current;
|
|
123
|
+
if (!r) return;
|
|
124
|
+
const e = r.closest("[data-radix-scroll-area-viewport]");
|
|
125
|
+
if (!e) return;
|
|
126
|
+
const t = () => H({
|
|
127
|
+
scrollLeft: e.scrollLeft,
|
|
128
|
+
clientWidth: e.clientWidth,
|
|
129
|
+
scrollWidth: e.scrollWidth
|
|
130
|
+
});
|
|
131
|
+
t(), e.addEventListener("scroll", t, {
|
|
132
|
+
passive: !0
|
|
133
|
+
}), window.addEventListener("resize", t);
|
|
134
|
+
const n = new ResizeObserver(t);
|
|
135
|
+
return n.observe(e), n.observe(r), () => {
|
|
136
|
+
e.removeEventListener("scroll", t), window.removeEventListener("resize", t), n.disconnect();
|
|
64
137
|
};
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}), t[32] = w, t[33] = s) : s = t[33];
|
|
89
|
-
const l = s;
|
|
90
|
-
let T;
|
|
91
|
-
t[34] !== z || t[35] !== w || t[36] !== h || t[37] !== r || t[38] !== i || t[39] !== c ? (T = !h && /* @__PURE__ */ W(ot, { columnCount: w, start: r, step: i, avgDuration: z, stepWidth: c }), t[34] = z, t[35] = w, t[36] = h, t[37] = r, t[38] = i, t[39] = c, t[40] = T) : T = t[40];
|
|
92
|
-
let j;
|
|
93
|
-
t[41] !== k || t[42] !== x || t[43] !== o || t[44] !== l || t[45] !== h || t[46] !== v || t[47] !== y || t[48] !== e.id || t[49] !== $ || t[50] !== S || t[51] !== r || t[52] !== i || t[53] !== c || t[54] !== b || t[55] !== p || t[56] !== f ? (j = (O, Q) => /* @__PURE__ */ F(D.Fragment, { children: [
|
|
94
|
-
/* @__PURE__ */ F("div", { style: S, children: [
|
|
95
|
-
l.map((n, C) => /* @__PURE__ */ W("div", { style: {
|
|
138
|
+
}, []);
|
|
139
|
+
const J = S.scrollLeft > 1, K = S.scrollLeft + S.clientWidth < S.scrollWidth - 1, Q = l?.length ? l.sort((r, e) => r.start - e.start).reduce((r, e) => {
|
|
140
|
+
const t = r.find((n) => !n.some((o) => !(e.end <= o.start || e.start >= o.end)));
|
|
141
|
+
return t ? (t.push(e), r) : [...r, [e]];
|
|
142
|
+
}, []) : [], Y = p.useMemo(() => ({
|
|
143
|
+
display: "grid",
|
|
144
|
+
gridTemplateColumns: `repeat(${g}, ${u})`,
|
|
145
|
+
minWidth: "100%",
|
|
146
|
+
gridColumn: "1 / -1",
|
|
147
|
+
position: "relative"
|
|
148
|
+
}), [g, u]), Z = p.useMemo(() => ({
|
|
149
|
+
gridColumn: "1 / -1",
|
|
150
|
+
minHeight: W,
|
|
151
|
+
position: "relative",
|
|
152
|
+
backgroundColor: "transparent"
|
|
153
|
+
}), [W]), _ = p.useMemo(() => Array.from({
|
|
154
|
+
length: Math.max(0, g - 1)
|
|
155
|
+
}), [g]);
|
|
156
|
+
return /* @__PURE__ */ L("div", { "data-gantt-id": h.id, id: h.id, ref: E, style: Y, children: [
|
|
157
|
+
!T && /* @__PURE__ */ v(nt, { ticks: q, interval: B, avgDuration: j, stepWidth: u, canScrollLeft: J, canScrollRight: K }),
|
|
158
|
+
Q.map((r, e) => /* @__PURE__ */ L(p.Fragment, { children: [
|
|
159
|
+
/* @__PURE__ */ L("div", { style: Z, children: [
|
|
160
|
+
_.map((t, n) => /* @__PURE__ */ v("div", { style: {
|
|
96
161
|
position: "absolute",
|
|
97
|
-
left: (
|
|
162
|
+
left: (n + 1) * m,
|
|
98
163
|
top: 0,
|
|
99
164
|
bottom: 0,
|
|
100
165
|
width: "0px",
|
|
101
|
-
borderLeft: `1px dashed rgba(255, 255, 255, ${
|
|
102
|
-
} }, `grid-${
|
|
103
|
-
|
|
104
|
-
/* @__PURE__ */
|
|
166
|
+
borderLeft: `1px dashed rgba(255, 255, 255, ${T ? 0.05 : 0.1})`
|
|
167
|
+
} }, `grid-${n}`)),
|
|
168
|
+
T && /* @__PURE__ */ L(et, { children: [
|
|
169
|
+
/* @__PURE__ */ v("div", { className: "gantt__group-wrapper", style: {
|
|
105
170
|
backgroundImage: `
|
|
106
171
|
linear-gradient(to right, transparent, #070514),
|
|
107
172
|
repeating-linear-gradient(
|
|
108
173
|
45deg,
|
|
109
174
|
transparent,
|
|
110
175
|
transparent 2px,
|
|
111
|
-
${
|
|
176
|
+
${I(A(h.id.replace("target", "source")), 0.5)} 4px
|
|
112
177
|
)
|
|
113
178
|
`,
|
|
114
|
-
left: `${
|
|
115
|
-
width: `${
|
|
179
|
+
left: `${x(G, G + i).left}px`,
|
|
180
|
+
width: `${x(G, G + i).width}px`
|
|
116
181
|
} }),
|
|
117
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ v("div", { className: "gantt__group-wrapper", style: {
|
|
118
183
|
backgroundImage: `
|
|
119
184
|
linear-gradient(to left, transparent, #070514),
|
|
120
185
|
repeating-linear-gradient(
|
|
121
186
|
45deg,
|
|
122
187
|
transparent,
|
|
123
188
|
transparent 2px,
|
|
124
|
-
${
|
|
189
|
+
${I(A(h.id.replace("target", "source")), 0.5)} 4px
|
|
125
190
|
)
|
|
126
191
|
`,
|
|
127
|
-
left: `${
|
|
128
|
-
width: `${
|
|
192
|
+
left: `${x(w - i, w).left}px`,
|
|
193
|
+
width: `${x(w - i, w).width}px`
|
|
129
194
|
} })
|
|
130
195
|
] }),
|
|
131
|
-
|
|
132
|
-
const
|
|
133
|
-
return
|
|
134
|
-
|
|
135
|
-
}, children:
|
|
196
|
+
r.map((t, n) => {
|
|
197
|
+
const o = x(t.start, t.end);
|
|
198
|
+
return o.width > 0 && /* @__PURE__ */ v(rt, { id: t.id, w: `${o.width}px`, left: `${o.left}px`, onClick: () => {
|
|
199
|
+
t.type == "group" && F((C) => t.id === C ? void 0 : t.id);
|
|
200
|
+
}, children: y?.(t, n) }, t.id);
|
|
136
201
|
})
|
|
137
|
-
] }, `row-${
|
|
138
|
-
|
|
139
|
-
] }, `row-frag-${
|
|
140
|
-
|
|
141
|
-
d.map(j)
|
|
142
|
-
] }), t[10] = k, t[11] = z, t[12] = x, t[13] = w, t[14] = o, t[15] = h, t[16] = v, t[17] = y, t[18] = a, t[19] = e.id, t[20] = $, t[21] = r, t[22] = i, t[23] = c, t[24] = b, t[25] = p, t[26] = f, t[27] = P;
|
|
143
|
-
} else
|
|
144
|
-
P = t[27];
|
|
145
|
-
return P;
|
|
202
|
+
] }, `row-${e}`),
|
|
203
|
+
r.map((t, n) => t.type === "group" && V === t.id && /* @__PURE__ */ v(it, { 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
|
+
] }, `row-frag-${e}`))
|
|
205
|
+
] });
|
|
146
206
|
};
|
|
147
|
-
function dt(e, t) {
|
|
148
|
-
return e.start - t.start;
|
|
149
|
-
}
|
|
150
|
-
function lt(e, t) {
|
|
151
|
-
const a = e.find((G) => !G.some((g) => !(t.end <= g.start || t.start >= g.end)));
|
|
152
|
-
return a ? (a.push(t), e) : [...e, [t]];
|
|
153
|
-
}
|
|
154
|
-
function ct(e) {
|
|
155
|
-
return e.start;
|
|
156
|
-
}
|
|
157
|
-
function pt(e) {
|
|
158
|
-
return e.start;
|
|
159
|
-
}
|
|
160
207
|
export {
|
|
161
|
-
|
|
208
|
+
it as GanttGroup
|
|
162
209
|
};
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { default as React, CSSProperties } from 'react';
|
|
2
2
|
import { Component } from '../../utils';
|
|
3
3
|
export interface GanttHeaderProps extends Component<HTMLDivElement> {
|
|
4
|
-
columnCount: number;
|
|
5
|
-
start: number;
|
|
6
|
-
step: number;
|
|
7
4
|
avgDuration: number;
|
|
8
5
|
stepWidth: CSSProperties["width"];
|
|
6
|
+
canScrollLeft?: boolean;
|
|
7
|
+
canScrollRight?: boolean;
|
|
8
|
+
ticks: {
|
|
9
|
+
time: number;
|
|
10
|
+
left: number;
|
|
11
|
+
}[];
|
|
12
|
+
interval: number;
|
|
9
13
|
}
|
|
10
14
|
export declare const GanttHeader: React.FC<GanttHeaderProps>;
|
|
@@ -1,55 +1,73 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
1
|
+
import { jsx as a, jsxs as L } from "react/jsx-runtime";
|
|
2
|
+
import { c as z } from "../../_virtual/compiler-runtime.js";
|
|
3
3
|
import "../../utils/contextStore.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { mergeComponentProps as
|
|
5
|
+
import { mergeComponentProps as I } from "../../utils/component.js";
|
|
6
6
|
import "js-md5";
|
|
7
7
|
import { Text as $ } from "../text/Text.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import { IconChevronLeft as W, IconChevronRight as w } from "@tabler/icons-react";
|
|
9
|
+
const J = (t) => {
|
|
10
|
+
const e = z.c(33);
|
|
11
|
+
let s, n, l, c, i, o, m;
|
|
11
12
|
if (e[0] !== t) {
|
|
12
13
|
const {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
avgDuration: r,
|
|
15
|
+
stepWidth: N,
|
|
16
|
+
canScrollLeft: v,
|
|
17
|
+
canScrollRight: R,
|
|
18
|
+
ticks: C,
|
|
19
|
+
interval: b,
|
|
20
|
+
...F
|
|
19
21
|
} = t;
|
|
20
|
-
|
|
21
|
-
let
|
|
22
|
-
e[8] !==
|
|
23
|
-
let
|
|
24
|
-
e[10] !==
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
i = N, s = v, n = R, m = C;
|
|
23
|
+
let p;
|
|
24
|
+
e[8] !== r ? (p = k(r), e[8] = r, e[9] = p) : p = e[9], c = p;
|
|
25
|
+
let x;
|
|
26
|
+
e[10] !== b ? (x = (M) => {
|
|
27
|
+
const {
|
|
28
|
+
value: T,
|
|
29
|
+
unit: S
|
|
30
|
+
} = k(M), j = Math.max(0, Math.ceil(-Math.log10(b / y(S))));
|
|
31
|
+
return `${parseFloat(T.toFixed(j))}${S}`;
|
|
32
|
+
}, e[10] = b, e[11] = x) : x = e[11], l = x, o = I("gantt__header", F), e[0] = t, e[1] = s, e[2] = n, e[3] = l, e[4] = c, e[5] = i, e[6] = o, e[7] = m;
|
|
27
33
|
} else
|
|
28
|
-
|
|
34
|
+
s = e[1], n = e[2], l = e[3], c = e[4], i = e[5], o = e[6], m = e[7];
|
|
29
35
|
let h;
|
|
30
|
-
e[12] !==
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
},
|
|
36
|
+
e[12] !== s ? (h = s && /* @__PURE__ */ a("div", { className: "gantt__header-scroll gantt__header-scroll--left", children: /* @__PURE__ */ a(W, { size: 16 }) }), e[12] = s, e[13] = h) : h = e[13];
|
|
37
|
+
let d;
|
|
38
|
+
e[14] !== c.unit ? (d = /* @__PURE__ */ a("div", { className: "gantt__header-label-column", children: /* @__PURE__ */ L($, { className: "gantt__header-label", children: [
|
|
39
|
+
"Range in ",
|
|
40
|
+
c.unit
|
|
41
|
+
] }) }), e[14] = c.unit, e[15] = d) : d = e[15];
|
|
42
|
+
let f;
|
|
43
|
+
e[16] !== h || e[17] !== d ? (f = /* @__PURE__ */ L("div", { className: "gantt__header-start", children: [
|
|
44
|
+
h,
|
|
45
|
+
d
|
|
46
|
+
] }), e[16] = h, e[17] = d, e[18] = f) : f = e[18];
|
|
47
|
+
let _;
|
|
48
|
+
if (e[19] !== l || e[20] !== i || e[21] !== m) {
|
|
49
|
+
let r;
|
|
50
|
+
e[23] !== l || e[24] !== i ? (r = (N) => {
|
|
51
|
+
const {
|
|
52
|
+
time: v,
|
|
53
|
+
left: R
|
|
54
|
+
} = N;
|
|
55
|
+
return /* @__PURE__ */ a("div", { className: "gantt__header-column", style: {
|
|
56
|
+
left: R,
|
|
57
|
+
width: i
|
|
58
|
+
}, children: /* @__PURE__ */ a($, { children: l(v) }) }, `header-${v}`);
|
|
59
|
+
}, e[23] = l, e[24] = i, e[25] = r) : r = e[25], _ = m.map(r), e[19] = l, e[20] = i, e[21] = m, e[22] = _;
|
|
60
|
+
} else
|
|
61
|
+
_ = e[22];
|
|
62
|
+
let g;
|
|
63
|
+
e[26] !== n ? (g = n && /* @__PURE__ */ a("div", { className: "gantt__header-scroll gantt__header-scroll--right", children: /* @__PURE__ */ a(w, { size: 16 }) }), e[26] = n, e[27] = g) : g = e[27];
|
|
64
|
+
let u;
|
|
65
|
+
return e[28] !== o || e[29] !== f || e[30] !== _ || e[31] !== g ? (u = /* @__PURE__ */ L("div", { ...o, children: [
|
|
66
|
+
f,
|
|
67
|
+
_,
|
|
68
|
+
g
|
|
69
|
+
] }), e[28] = o, e[29] = f, e[30] = _, e[31] = g, e[32] = u) : u = e[32], u;
|
|
70
|
+
}, k = (t) => t > 5e5 ? {
|
|
53
71
|
value: t / 1e6,
|
|
54
72
|
unit: "s"
|
|
55
73
|
} : t > 500 ? {
|
|
@@ -58,7 +76,7 @@ const x = (t) => {
|
|
|
58
76
|
} : {
|
|
59
77
|
value: t,
|
|
60
78
|
unit: "μs"
|
|
61
|
-
};
|
|
79
|
+
}, y = (t) => t === "s" ? 1e6 : t === "ms" ? 1e3 : 1;
|
|
62
80
|
export {
|
|
63
|
-
|
|
81
|
+
J as GanttHeader
|
|
64
82
|
};
|
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { c as u } from "../../_virtual/compiler-runtime.js";
|
|
3
|
-
import
|
|
3
|
+
import a from "react";
|
|
4
4
|
import '../../assets/components/menu/Menu.style.css';/* empty css */
|
|
5
5
|
import "../../utils/contextStore.js";
|
|
6
6
|
import { mergeComponentProps as i } from "../../utils/component.js";
|
|
7
7
|
import "js-md5";
|
|
8
8
|
import { DropdownMenuItem as w, DropdownMenuSubTrigger as b, DropdownMenu as g, DropdownMenuArrow as $, DropdownMenuCheckboxItem as D, DropdownMenuGroup as h, DropdownMenuItemIndicator as S, DropdownMenuLabel as I, DropdownMenuPortal as C, DropdownMenuSeparator as x, DropdownMenuSub as T, DropdownMenuTrigger as A, DropdownMenuContent as R, DropdownMenuSubContent as k } from "@radix-ui/react-dropdown-menu";
|
|
9
|
-
import { AutoScrollArea as
|
|
10
|
-
const
|
|
9
|
+
import { AutoScrollArea as d } from "../scroll-area/ScrollArea.js";
|
|
10
|
+
const z = (l) => {
|
|
11
11
|
const e = u.c(4);
|
|
12
12
|
let t;
|
|
13
13
|
e[0] !== l ? (t = i("menu", l), e[0] = l, e[1] = t) : t = e[1];
|
|
14
14
|
const o = t;
|
|
15
15
|
let n;
|
|
16
16
|
return e[2] !== o ? (n = /* @__PURE__ */ r(g, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
|
|
17
|
-
},
|
|
17
|
+
}, B = (l) => {
|
|
18
18
|
const e = u.c(4);
|
|
19
19
|
let t;
|
|
20
20
|
e[0] !== l ? (t = i("menu__trigger", l), e[0] = l, e[1] = t) : t = e[1];
|
|
21
21
|
const o = t;
|
|
22
22
|
let n;
|
|
23
23
|
return e[2] !== o ? (n = /* @__PURE__ */ r(A, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
|
|
24
|
-
},
|
|
24
|
+
}, F = (l) => {
|
|
25
25
|
const e = u.c(4);
|
|
26
26
|
let t;
|
|
27
27
|
e[0] !== l ? (t = i("menu__portal", l), e[0] = l, e[1] = t) : t = e[1];
|
|
28
28
|
const o = t;
|
|
29
29
|
let n;
|
|
30
30
|
return e[2] !== o ? (n = /* @__PURE__ */ r(C, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
|
|
31
|
-
},
|
|
31
|
+
}, H = (l) => {
|
|
32
32
|
const e = u.c(12);
|
|
33
33
|
let t, o, n, c;
|
|
34
34
|
if (e[0] !== l) {
|
|
35
35
|
const {
|
|
36
36
|
children: _,
|
|
37
|
-
...
|
|
37
|
+
...M
|
|
38
38
|
} = l;
|
|
39
|
-
o = _, t = R, c = l.align, n = i(`menu__content menu__content--${l.color ?? "primary"}`,
|
|
39
|
+
o = _, t = R, c = l.align, n = i(`menu__content menu__content--${l.color ?? "primary"}`, M), e[0] = l, e[1] = t, e[2] = o, e[3] = n, e[4] = c;
|
|
40
40
|
} else
|
|
41
41
|
t = e[1], o = e[2], n = e[3], c = e[4];
|
|
42
42
|
const m = n;
|
|
43
43
|
let s;
|
|
44
|
-
e[5] !== o ? (s = /* @__PURE__ */ r(
|
|
44
|
+
e[5] !== o ? (s = /* @__PURE__ */ r(d, { children: /* @__PURE__ */ r("div", { className: "menu__content-inner", children: o }) }), e[5] = o, e[6] = s) : s = e[6];
|
|
45
45
|
let f;
|
|
46
46
|
return e[7] !== t || e[8] !== c || e[9] !== m || e[10] !== s ? (f = /* @__PURE__ */ r(t, { align: c, ...m, children: s }), e[7] = t, e[8] = c, e[9] = m, e[10] = s, e[11] = f) : f = e[11], f;
|
|
47
|
-
},
|
|
47
|
+
}, J = (l) => {
|
|
48
48
|
const e = u.c(4);
|
|
49
49
|
let t;
|
|
50
50
|
e[0] !== l ? (t = i("menu__label", l), e[0] = l, e[1] = t) : t = e[1];
|
|
51
51
|
const o = t;
|
|
52
52
|
let n;
|
|
53
53
|
return e[2] !== o ? (n = /* @__PURE__ */ r(I, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
|
|
54
|
-
},
|
|
54
|
+
}, K = a.forwardRef((l, e) => {
|
|
55
55
|
const t = u.c(5);
|
|
56
56
|
let o;
|
|
57
57
|
t[0] !== l ? (o = i("menu__item", l), t[0] = l, t[1] = o) : o = t[1];
|
|
@@ -72,7 +72,7 @@ const B = (l) => {
|
|
|
72
72
|
const o = t;
|
|
73
73
|
let n;
|
|
74
74
|
return e[2] !== o ? (n = /* @__PURE__ */ r(T, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
|
|
75
|
-
}, U =
|
|
75
|
+
}, U = a.forwardRef((l, e) => {
|
|
76
76
|
const t = u.c(5);
|
|
77
77
|
let o;
|
|
78
78
|
t[0] !== l ? (o = i("menu__sub-trigger", l), t[0] = l, t[1] = o) : o = t[1];
|
|
@@ -92,7 +92,7 @@ const B = (l) => {
|
|
|
92
92
|
t = e[1], o = e[2], n = e[3];
|
|
93
93
|
const c = n;
|
|
94
94
|
let m;
|
|
95
|
-
e[4] !== o ? (m = /* @__PURE__ */ r(
|
|
95
|
+
e[4] !== o ? (m = /* @__PURE__ */ r(d, { children: /* @__PURE__ */ r("div", { className: "menu__content-inner", children: o }) }), e[4] = o, e[5] = m) : m = e[5];
|
|
96
96
|
let s;
|
|
97
97
|
return e[6] !== t || e[7] !== c || e[8] !== m ? (s = /* @__PURE__ */ r(t, { ...c, children: m }), e[6] = t, e[7] = c, e[8] = m, e[9] = s) : s = e[9], s;
|
|
98
98
|
}, W = (l) => {
|
|
@@ -125,18 +125,18 @@ const B = (l) => {
|
|
|
125
125
|
return e[2] !== o ? (n = /* @__PURE__ */ r($, { ...o }), e[2] = o, e[3] = n) : n = e[3], n;
|
|
126
126
|
};
|
|
127
127
|
export {
|
|
128
|
-
|
|
128
|
+
z as Menu,
|
|
129
129
|
Z as MenuArrow,
|
|
130
130
|
X as MenuCheckboxItem,
|
|
131
|
-
|
|
131
|
+
H as MenuContent,
|
|
132
132
|
O as MenuGroup,
|
|
133
|
-
|
|
133
|
+
K as MenuItem,
|
|
134
134
|
Y as MenuItemIndicator,
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
J as MenuLabel,
|
|
136
|
+
F as MenuPortal,
|
|
137
137
|
W as MenuSeparator,
|
|
138
138
|
Q as MenuSub,
|
|
139
139
|
V as MenuSubContent,
|
|
140
140
|
U as MenuSubTrigger,
|
|
141
|
-
|
|
141
|
+
B as MenuTrigger
|
|
142
142
|
};
|