@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.
@@ -1,162 +1,209 @@
1
- import { jsxs as F, jsx as W, Fragment as it } from "react/jsx-runtime";
2
- import { c as rt } from "../../_virtual/compiler-runtime.js";
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 U, hashToColor as X } from "../../utils/color.js";
7
- import { GanttItem as at } from "./GanttItem.js";
8
- import { GanttHeader as ot } from "./GanttHeader.js";
9
- const H = (e, t, a, G, g, R) => {
10
- const L = Math.max(0, e - a), I = Math.min(g, t - a), V = L / g * R, x = (I - L) / g * R;
11
- return {
12
- left: V,
13
- width: x
14
- };
15
- }, st = (e) => {
16
- const t = rt.c(58), {
17
- items: a,
18
- stepWidth: G,
19
- rowHeight: g,
20
- step: R,
21
- start: L,
22
- end: I,
23
- hideScaling: V,
24
- children: x
25
- } = e, c = G === void 0 ? "50px" : G, $ = g === void 0 ? "50px" : g, i = R === void 0 ? 1 : R, r = L === void 0 ? 1 : L, o = I === void 0 ? 999999999 : I, h = V === void 0 ? !1 : V, q = D.useRef(null), [Y, Z] = D.useState(0), [k, _] = D.useState(void 0), b = parseInt(c), p = o - r, K = Math.ceil(p / i), f = K * b;
26
- let B;
27
- t: {
28
- if (!a || a.length === 0) {
29
- let s;
30
- t[0] !== o || t[1] !== r || t[2] !== i ? (s = {
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: r,
33
- itemMaxEnd: o
34
- }, t[0] = o, t[1] = r, t[2] = i, t[3] = s) : s = t[3], B = s;
35
- break t;
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
- let d = 0, u = 0, m = 1 / 0, E = -1 / 0;
38
- for (let s = 0; s < a.length; s++) {
39
- const l = a[s];
40
- l.start < m && (m = l.start), l.end > E && (E = l.end), l.type !== "group" && (d = d + (l.end - l.start), u++);
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 M = u === 0 ? i : d / u;
43
- let S;
44
- t[4] !== E || t[5] !== m || t[6] !== M ? (S = {
45
- avgDuration: M,
46
- itemMinStart: m,
47
- itemMaxEnd: E
48
- }, t[4] = E, t[5] = m, t[6] = M, t[7] = S) : S = t[7], B = S;
49
- }
50
- const {
51
- avgDuration: z,
52
- itemMinStart: y,
53
- itemMaxEnd: v
54
- } = B, tt = a && a.length > 0 ? Math.ceil((v - r) / i) : K, et = Math.ceil(Y / b), w = Math.max(et, tt + 2);
55
- let A, N;
56
- t[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (A = () => {
57
- const d = () => {
58
- Z(q.current?.offsetWidth ?? 0);
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
- d();
61
- const u = q.current;
62
- return u?.addEventListener("resize", d), window.addEventListener("resize", d), () => {
63
- window.removeEventListener("resize", d), u?.removeEventListener("resize", d);
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
- }, N = [], t[8] = A, t[9] = N) : (A = t[8], N = t[9]), D.useEffect(A, N);
66
- let P;
67
- if (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) {
68
- const d = a?.length ? a.sort(dt).reduce(lt, []) : [], u = `repeat(${w}, ${c})`;
69
- let m;
70
- t[28] !== u ? (m = {
71
- display: "grid",
72
- gridTemplateColumns: u,
73
- minWidth: "100%",
74
- gridColumn: "1 / -1"
75
- }, t[28] = u, t[29] = m) : m = t[29];
76
- const E = m;
77
- let M;
78
- t[30] !== $ ? (M = {
79
- gridColumn: "1 / -1",
80
- minHeight: $,
81
- position: "relative",
82
- backgroundColor: "transparent"
83
- }, t[30] = $, t[31] = M) : M = t[31];
84
- const S = M;
85
- let s;
86
- t[32] !== w ? (s = Array.from({
87
- length: Math.max(0, w - 1)
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: (C + 1) * b,
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, ${h ? 0.05 : 0.1})`
102
- } }, `grid-${C}`)),
103
- h && /* @__PURE__ */ F(it, { children: [
104
- /* @__PURE__ */ W("div", { className: "gantt__group-wrapper", style: {
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
- ${U(X(e.id.replace("target", "source")), 0.5)} 4px
176
+ ${I(A(h.id.replace("target", "source")), 0.5)} 4px
112
177
  )
113
178
  `,
114
- left: `${H(y, y + i, r, o, p, f).left}px`,
115
- width: `${H(y, y + i, r, o, p, f).width}px`
179
+ left: `${x(G, G + i).left}px`,
180
+ width: `${x(G, G + i).width}px`
116
181
  } }),
117
- /* @__PURE__ */ W("div", { className: "gantt__group-wrapper", style: {
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
- ${U(X(e.id.replace("target", "source")), 0.5)} 4px
189
+ ${I(A(h.id.replace("target", "source")), 0.5)} 4px
125
190
  )
126
191
  `,
127
- left: `${H(v - i, v, r, o, p, f).left}px`,
128
- width: `${H(v - i, v, r, o, p, f).width}px`
192
+ left: `${x(w - i, w).left}px`,
193
+ width: `${x(w - i, w).width}px`
129
194
  } })
130
195
  ] }),
131
- O.map((n, C) => {
132
- const J = H(n.start, n.end, r, o, p, f);
133
- return J.width > 0 && /* @__PURE__ */ W(at, { id: n.id, w: `${J.width}px`, left: `${J.left}px`, onClick: () => {
134
- n.type == "group" && _((nt) => n.id === nt ? void 0 : n.id);
135
- }, children: x?.(n, C) }, n.id);
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-${Q}`),
138
- O.map((n, C) => n.type === "group" && k === n.id && /* @__PURE__ */ W(st, { children: x, id: `group-target-${C}`, start: Math.min(...n.data.items.map(ct)) - Math.min(...n.data.items.map(pt)) / (n.data.firstGroupStep * n.data.step) * (n.data.groupStep * n.data.step), step: n.data.groupStep * n.data.step, stepWidth: c, rowHeight: $, items: n.data.items }, `group-target-${C}`))
139
- ] }, `row-frag-${Q}`), 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, t[57] = j) : j = t[57], P = /* @__PURE__ */ F("div", { "data-gantt-id": e.id, id: e.id, ref: q, style: E, children: [
140
- T,
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
- st as GanttGroup
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 g, jsxs as N } from "react/jsx-runtime";
2
- import { c as W } from "../../_virtual/compiler-runtime.js";
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 j } from "../../utils/component.js";
5
+ import { mergeComponentProps as I } from "../../utils/component.js";
6
6
  import "js-md5";
7
7
  import { Text as $ } from "../text/Text.js";
8
- const x = (t) => {
9
- const e = W.c(22);
10
- let i, s, a, n, r, o, m;
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
- columnCount: f,
14
- start: l,
15
- step: _,
16
- avgDuration: c,
17
- stepWidth: v,
18
- ...b
14
+ avgDuration: r,
15
+ stepWidth: N,
16
+ canScrollLeft: v,
17
+ canScrollRight: R,
18
+ ticks: C,
19
+ interval: b,
20
+ ...F
19
21
  } = t;
20
- a = l, n = _, r = v, o = parseInt(r);
21
- let u;
22
- e[8] !== c ? (u = y(c), e[8] = c, e[9] = u) : u = e[9], s = u;
23
- let d;
24
- e[10] !== f ? (d = Array.from({
25
- length: f
26
- }), e[10] = f, e[11] = d) : d = e[11], i = d, m = j("gantt__header", b), e[0] = t, e[1] = i, e[2] = s, e[3] = a, e[4] = n, e[5] = r, e[6] = o, e[7] = m;
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
- i = e[1], s = e[2], a = e[3], n = e[4], r = e[5], o = e[6], m = e[7];
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] !== i || e[13] !== s || e[14] !== a || e[15] !== n || e[16] !== r || e[17] !== o ? (h = i.map((f, l) => {
31
- if (l === 0)
32
- return /* @__PURE__ */ g("div", { className: "gantt__header-label-column", children: /* @__PURE__ */ N($, { className: "gantt__header-label", children: [
33
- "Range in ",
34
- s.unit
35
- ] }) }, `header-${l}`);
36
- const _ = l % 4 === 0;
37
- let c = "";
38
- if (_) {
39
- const v = a + l * n, {
40
- value: b,
41
- unit: u
42
- } = y(v);
43
- c = `${Math.round(b * 10) / 10}${u}`;
44
- }
45
- return /* @__PURE__ */ g("div", { className: "gantt__header-column", style: {
46
- left: l * o,
47
- width: r
48
- }, children: /* @__PURE__ */ g($, { children: c }) }, `header-${l}`);
49
- }), e[12] = i, e[13] = s, e[14] = a, e[15] = n, e[16] = r, e[17] = o, e[18] = h) : h = e[18];
50
- let p;
51
- return e[19] !== m || e[20] !== h ? (p = /* @__PURE__ */ g("div", { ...m, children: h }), e[19] = m, e[20] = h, e[21] = p) : p = e[21], p;
52
- }, y = (t) => t > 5e5 ? {
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
- x as GanttHeader
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 M from "react";
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 a } from "../scroll-area/ScrollArea.js";
10
- const B = (l) => {
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
- }, F = (l) => {
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
- }, H = (l) => {
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
- }, J = (l) => {
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
- ...d
37
+ ...M
38
38
  } = l;
39
- o = _, t = R, c = l.align, n = i(`menu__content menu__content--${l.color ?? "primary"}`, d), e[0] = l, e[1] = t, e[2] = o, e[3] = n, e[4] = c;
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(a, { children: o }), e[5] = o, e[6] = s) : s = e[6];
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
- }, K = (l) => {
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
- }, N = M.forwardRef((l, e) => {
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 = M.forwardRef((l, e) => {
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(a, { children: o }), e[4] = o, e[5] = m) : m = e[5];
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
- B as Menu,
128
+ z as Menu,
129
129
  Z as MenuArrow,
130
130
  X as MenuCheckboxItem,
131
- J as MenuContent,
131
+ H as MenuContent,
132
132
  O as MenuGroup,
133
- N as MenuItem,
133
+ K as MenuItem,
134
134
  Y as MenuItemIndicator,
135
- K as MenuLabel,
136
- H as MenuPortal,
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
- F as MenuTrigger
141
+ B as MenuTrigger
142
142
  };