@code0-tech/pictor 0.9.0 → 0.9.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 +1 @@
1
- .progress{background:#201e2c;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;box-sizing:border-box;border-radius:1rem;width:100%;height:10px;position:relative;transform:translateZ(0)}.progress__dot{background:#201e2c;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box;background:#393743;position:absolute;max-width:100%;aspect-ratio:1/1;height:200%;z-index:2;top:50%;transform:translate(50%) translateY(-50%);border-radius:50rem;right:calc(100% - 1% * (var(--progress, 0)));overflow:hidden}.progress__dot:after{content:"";position:absolute;top:50%;left:50%;border-radius:inherit;width:60%;height:60%;transform:translate(-50%,-50%);background:var(--color);background-repeat:no-repeat}.progress__indicator{position:absolute;background:var(--color);background-position:left center;background-repeat:no-repeat;background-size:calc(100% * 100 / var(--progress, 100)) 100%;width:100%;height:100%;z-index:1}.progress__indicator--prediction{background:repeating-linear-gradient(-45deg,rgba(0,0,0,.5),rgba(0,0,0,.5) 2.5px,transparent 2.5px,transparent 5px),var(--color);z-index:0;opacity:.5;background-position:left center;background-repeat:no-repeat;background-size:calc(100% * 100 / var(--progressPrediction, 100)) 100%}
1
+ .progress{background:#070514;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;box-sizing:border-box;background:transparent;border-radius:1rem;width:100%;height:10px;position:relative;transform:translateZ(0)}.progress:before{background:#201e2c;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box;background:var(--color);opacity:.1;content:"";position:absolute;top:0;left:0;width:100%;height:100%;border-radius:inherit}.progress__dot{position:absolute;z-index:2;display:flex;align-items:center;justify-content:center;top:50%;transform:translate(50%) translateY(-50%);right:calc(100% - 1% * (var(--progress, 0)))}.progress__indicator{position:absolute;background:var(--color);border-radius:inherit;background-position:left center;background-repeat:no-repeat;background-size:calc(100% * 100 / var(--progress, 100)) 100%;width:100%;height:100%;z-index:1}.progress__indicator--prediction{background:repeating-linear-gradient(-45deg,rgba(0,0,0,.25),rgba(0,0,0,.25) 2.5px,transparent 2.5px,transparent 5px),var(--color);z-index:0;opacity:.25;background-position:left center;background-repeat:no-repeat;background-size:calc(100% * 100 / var(--progressPrediction, 100)) 100%}
@@ -56,7 +56,7 @@ const _ = (i) => {
56
56
  truthyValidationBeforeSubmit: n = !0,
57
57
  useInitialValidation: l = !0,
58
58
  onSubmit: u
59
- } = i, a = j.useMemo(() => e, []), [s, p] = g(a), d = y(/* @__PURE__ */ new Map()), c = w((r, h) => {
59
+ } = i, a = j.useMemo(() => e, [e]), [s, p] = g(a), d = y(/* @__PURE__ */ new Map()), c = w((r, h) => {
60
60
  p((V) => ({
61
61
  ...V,
62
62
  [r]: h
@@ -1,92 +1,87 @@
1
- import { jsx as d, jsxs as B } from "react/jsx-runtime";
2
- import { c as H } from "../../_virtual/compiler-runtime.js";
1
+ import { jsx as c, jsxs as j } from "react/jsx-runtime";
2
+ import { c as B } from "../../_virtual/compiler-runtime.js";
3
3
  import "../../utils/contextStore.js";
4
4
  import "react";
5
5
  import "merge-props";
6
- import { hashToColor as R } from "../../utils/color.js";
6
+ import { hashToColor as H } from "../../utils/color.js";
7
7
  import '../../assets/components/gantt/Gantt.style.css';/* empty css */
8
- import { ScrollArea as W, ScrollAreaViewport as z, ScrollAreaScrollbar as T, ScrollAreaThumb as _ } from "../scroll-area/ScrollArea.js";
9
- import { GanttGroup as C } from "./GanttGroup.js";
10
- const X = (e) => {
11
- const t = H.c(22), {
12
- items: S,
13
- stepWidth: b,
14
- rowHeight: M,
15
- step: V,
16
- children: y
17
- } = e, A = b === void 0 ? "50px" : b, E = M === void 0 ? "50px" : M, p = V === void 0 ? 1 : V;
18
- let c, a, l, m, h, u;
19
- if (t[0] !== y || t[1] !== S || t[2] !== E || t[3] !== p || t[4] !== A) {
20
- const s = [];
21
- S?.forEach((o) => {
22
- const r = o.end - o.start;
23
- let n = !1;
24
- if (s.length <= 0) {
25
- s.push({
26
- step: r,
27
- items: [o]
28
- });
29
- return;
30
- }
31
- s.forEach((i) => {
32
- const x = (i.step + r) / 1.75, G = i.step / 3 - 10, j = i.step * 3 + 10;
33
- G < r && r < j && !n && (i.step = x, i.items.push(o), n = !0);
34
- }), n || s.push({
35
- step: r,
36
- items: [o]
8
+ import { ScrollAreaViewport as R, ScrollAreaScrollbar as A, ScrollAreaThumb as E, ScrollArea as T } from "../scroll-area/ScrollArea.js";
9
+ import { GanttGroup as W } from "./GanttGroup.js";
10
+ const P = (s) => {
11
+ const t = B.c(15), {
12
+ items: m,
13
+ stepWidth: f,
14
+ rowHeight: b,
15
+ step: x,
16
+ children: S
17
+ } = s, g = f === void 0 ? "50px" : f, w = b === void 0 ? "50px" : b, i = x === void 0 ? 1 : x;
18
+ let e, l;
19
+ t[0] !== m || t[1] !== i ? (e = [], m?.forEach((r) => {
20
+ const o = r.end - r.start;
21
+ let a = !1;
22
+ if (e.length <= 0) {
23
+ e.push({
24
+ step: o,
25
+ items: [r]
37
26
  });
38
- }), s.sort(D).forEach((o, r) => {
39
- if (r > 0) {
40
- const n = Math.min(...o.items.map(k)), i = Math.max(...o.items.map(q));
41
- s[0].items.push({
42
- start: n,
43
- end: i + s[0].step * p / 6,
44
- id: `group-source-${r}`,
45
- type: "group",
46
- data: {
47
- displayMessage: `${r}`,
48
- color: R(`group-source-${r}`)
49
- }
50
- });
51
- }
52
- }), a = W, m = "100%", h = "100%", u = "hover", c = z, l = s.sort(v).map((o, r) => {
53
- const n = Math.min(...o.items.map(F));
54
- return /* @__PURE__ */ d(C, { children: y, id: `group-target-${r}`, hideScaling: r != 0, start: n - n / (s[0].step * p) * (o.step * p), step: o.step * p, stepWidth: A, rowHeight: E, items: o.items }, `group-target-${r}`);
55
- }), t[0] = y, t[1] = S, t[2] = E, t[3] = p, t[4] = A, t[5] = c, t[6] = a, t[7] = l, t[8] = m, t[9] = h, t[10] = u;
56
- } else
57
- c = t[5], a = t[6], l = t[7], m = t[8], h = t[9], u = t[10];
58
- let f;
59
- t[11] !== c || t[12] !== l ? (f = /* @__PURE__ */ d(c, { children: l }), t[11] = c, t[12] = l, t[13] = f) : f = t[13];
60
- let $;
61
- t[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? ($ = /* @__PURE__ */ d(T, { orientation: "horizontal", children: /* @__PURE__ */ d(_, {}) }), t[14] = $) : $ = t[14];
62
- let g;
63
- t[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ d(T, { orientation: "vertical", children: /* @__PURE__ */ d(_, {}) }), t[15] = g) : g = t[15];
64
- let w;
65
- return t[16] !== a || t[17] !== m || t[18] !== h || t[19] !== u || t[20] !== f ? (w = /* @__PURE__ */ B(a, { w: m, h, type: u, children: [
66
- f,
67
- $,
68
- g
69
- ] }), t[16] = a, t[17] = m, t[18] = h, t[19] = u, t[20] = f, t[21] = w) : w = t[21], w;
70
- }, Y = (e) => {
71
- const t = e > 5e5 ? e / 1e6 : e > 500 ? e / 1e3 : e, S = e > 5e5 ? "s" : e > 500 ? "ms" : "μs";
72
- return `${Math.round(t * 10) / 10}${S}`;
27
+ return;
28
+ }
29
+ e.forEach((n) => {
30
+ const M = (n.step + o) / 1.75, V = n.step / 3 - 10, G = n.step * 3 + 10;
31
+ V < o && o < G && !a && (n.step = M, n.items.push(r), a = !0);
32
+ }), a || e.push({
33
+ step: o,
34
+ items: [r]
35
+ });
36
+ }), e.sort(z).forEach((r, o) => {
37
+ if (o > 0) {
38
+ const a = Math.min(...r.items.map(C)), n = Math.max(...r.items.map(D));
39
+ e[0].items.push({
40
+ start: a,
41
+ end: n + e[0].step * i / 6,
42
+ id: `group-source-${o}`,
43
+ type: "group",
44
+ data: {
45
+ items: r.items,
46
+ step: i,
47
+ firstGroupStep: e[0].step,
48
+ groupStep: r.step,
49
+ displayMessage: `${o}`,
50
+ color: H(`group-source-${o}`)
51
+ }
52
+ });
53
+ }
54
+ }), l = Math.min(...e[0].items.map(k)), t[0] = m, t[1] = i, t[2] = e, t[3] = l) : (e = t[2], l = t[3]);
55
+ const y = l, _ = y - y / (e[0].step * i) * (e[0].step * i), $ = e[0].step * i;
56
+ let p;
57
+ t[4] !== S || t[5] !== e[0].items || t[6] !== w || t[7] !== g || t[8] !== _ || t[9] !== $ ? (p = /* @__PURE__ */ c(R, { children: /* @__PURE__ */ c(W, { children: S, id: "group-target", hideScaling: !1, start: _, step: $, stepWidth: g, rowHeight: w, items: e[0].items }, "group-target") }), t[4] = S, t[5] = e[0].items, t[6] = w, t[7] = g, t[8] = _, t[9] = $, t[10] = p) : p = t[10];
58
+ let h;
59
+ t[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ c(A, { orientation: "horizontal", children: /* @__PURE__ */ c(E, {}) }), t[11] = h) : h = t[11];
60
+ let u;
61
+ t[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ c(A, { orientation: "vertical", children: /* @__PURE__ */ c(E, {}) }), t[12] = u) : u = t[12];
62
+ let d;
63
+ return t[13] !== p ? (d = /* @__PURE__ */ j(T, { w: "100%", h: "100%", type: "hover", children: [
64
+ p,
65
+ h,
66
+ u
67
+ ] }), t[13] = p, t[14] = d) : d = t[14], d;
68
+ }, Q = (s) => {
69
+ const t = s > 5e5 ? s / 1e6 : s > 500 ? s / 1e3 : s, m = s > 5e5 ? "s" : s > 500 ? "ms" : "μs";
70
+ return `${Math.round(t * 10) / 10}${m}`;
73
71
  };
74
- function D(e, t) {
75
- return t.step - e.step;
76
- }
77
- function k(e) {
78
- return e.start;
72
+ function z(s, t) {
73
+ return t.step - s.step;
79
74
  }
80
- function q(e) {
81
- return e.end;
75
+ function C(s) {
76
+ return s.start;
82
77
  }
83
- function v(e, t) {
84
- return t.step - e.step;
78
+ function D(s) {
79
+ return s.end;
85
80
  }
86
- function F(e) {
87
- return e.start;
81
+ function k(s) {
82
+ return s.start;
88
83
  }
89
84
  export {
90
- X as Gantt,
91
- Y as getRelativeValue
85
+ P as Gantt,
86
+ Q as getRelativeValue
92
87
  };
@@ -1,134 +1,143 @@
1
- import { jsx as W, jsxs as B, Fragment as rt } from "react/jsx-runtime";
2
- import { c as ot } from "../../_virtual/compiler-runtime.js";
3
- import J from "react";
1
+ import { jsxs as N, jsx as x, Fragment as F } from "react/jsx-runtime";
2
+ import { c as et } from "../../_virtual/compiler-runtime.js";
3
+ import P from "react";
4
4
  import "../../utils/contextStore.js";
5
5
  import "merge-props";
6
- import { withAlpha as Q, hashToColor as U } from "../../utils/color.js";
7
- import { GanttFooter as st } from "./GanttFooter.js";
8
- import { GanttItem as at } from "./GanttItem.js";
9
- import { GanttHeader as lt } from "./GanttHeader.js";
10
- const I = (e, t, n, R, l, S) => {
11
- const _ = Math.max(0, e - n), H = Math.min(l, t - n), V = _ / l * S, f = (H - _) / l * S;
6
+ import { withAlpha as J, hashToColor as K } from "../../utils/color.js";
7
+ import { GanttItem as nt } from "./GanttItem.js";
8
+ import { GanttHeader as rt } from "./GanttHeader.js";
9
+ const C = (e, t, n, y, l, M) => {
10
+ const S = Math.max(0, e - n), E = Math.min(l, t - n), G = S / l * M, m = (E - S) / l * M;
12
11
  return {
13
- left: V,
14
- width: f
12
+ left: G,
13
+ width: m
15
14
  };
16
- }, Rt = (e) => {
17
- const t = ot.c(63), {
15
+ }, it = (e) => {
16
+ const t = et.c(50), {
18
17
  items: n,
19
- stepWidth: R,
18
+ stepWidth: y,
20
19
  rowHeight: l,
21
- step: S,
22
- start: _,
23
- end: H,
24
- hideScaling: V,
25
- children: f
26
- } = e, u = R === void 0 ? "50px" : R, C = l === void 0 ? "50px" : l, r = S === void 0 ? 1 : S, i = _ === void 0 ? 1 : _, o = H === void 0 ? 999999999 : H, s = V === void 0 ? !1 : V, K = J.useRef(null), [X, Y] = J.useState(0), g = parseInt(u), a = o - i, O = Math.ceil(a / r), d = O * g, F = n?.filter(dt) ?? [], E = F.length === 0 ? r : F.reduce(ct, 0) / F.length;
27
- let k;
28
- t[0] !== n || t[1] !== i ? (k = n && n.length > 0 ? Math.min(...n.map(pt)) : i, t[0] = n, t[1] = i, t[2] = k) : k = t[2];
29
- const h = k;
20
+ step: M,
21
+ start: S,
22
+ end: E,
23
+ hideScaling: G,
24
+ children: m
25
+ } = e, s = y === void 0 ? "50px" : y, $ = l === void 0 ? "50px" : l, a = M === void 0 ? 1 : M, i = S === void 0 ? 1 : S, o = E === void 0 ? 999999999 : E, c = G === void 0 ? !1 : G, R = P.useRef(null), [O, Q] = P.useState(0), [b, U] = P.useState(void 0), f = parseInt(s), d = o - i, q = Math.ceil(d / a), p = q * f, T = n?.filter(at) ?? [], W = T.length === 0 ? a : T.reduce(ot, 0) / T.length;
30
26
  let z;
31
- t[3] !== o || t[4] !== n ? (z = n && n.length > 0 ? Math.max(...n.map(ht)) : o, t[3] = o, t[4] = n, t[5] = z) : z = t[5];
32
- const c = z, Z = n && n.length > 0 ? Math.ceil((c - i) / r) : O, tt = Math.ceil(X / g), p = Math.max(tt, Z + 2);
33
- let L, N;
34
- t[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = () => {
35
- const G = () => {
36
- Y(K.current?.offsetWidth ?? 0);
27
+ t[0] !== n || t[1] !== i ? (z = n && n.length > 0 ? Math.min(...n.map(st)) : i, t[0] = n, t[1] = i, t[2] = z) : z = t[2];
28
+ const g = z;
29
+ let L;
30
+ t[3] !== o || t[4] !== n ? (L = n && n.length > 0 ? Math.max(...n.map(dt)) : o, t[3] = o, t[4] = n, t[5] = L) : L = t[5];
31
+ const u = L, X = n && n.length > 0 ? Math.ceil((u - i) / a) : q, Y = Math.ceil(O / f), h = Math.max(Y, X + 2);
32
+ let k;
33
+ t[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = () => {
34
+ const v = () => {
35
+ Q(R.current?.offsetWidth ?? 0);
37
36
  };
38
- return G(), window.addEventListener("resize", G), () => window.removeEventListener("resize", G);
39
- }, N = [], t[6] = L, t[7] = N) : (L = t[6], N = t[7]), J.useEffect(L, N);
40
- let w, x, v, $, m, b;
41
- if (t[8] !== E || t[9] !== f || t[10] !== p || t[11] !== o || t[12] !== s || t[13] !== c || t[14] !== h || t[15] !== n || t[16] !== e.id || t[17] !== C || t[18] !== i || t[19] !== r || t[20] !== u || t[21] !== g || t[22] !== a || t[23] !== d) {
42
- const G = n?.length ? n.sort(mt).reduce(ft, []) : [], D = `repeat(${p}, ${u})`;
43
- let T;
44
- t[30] !== D ? (T = {
37
+ return v(), R?.current?.addEventListener("resize", v), window.addEventListener("resize", v), () => {
38
+ window.removeEventListener("resize", v), R.current?.removeEventListener("resize", v);
39
+ };
40
+ }, t[6] = k) : k = t[6], P.useEffect(k);
41
+ let H;
42
+ if (t[7] !== b || t[8] !== W || t[9] !== m || t[10] !== h || t[11] !== o || t[12] !== c || t[13] !== u || t[14] !== g || t[15] !== n || t[16] !== e.id || t[17] !== $ || t[18] !== i || t[19] !== a || t[20] !== s || t[21] !== f || t[22] !== d || t[23] !== p) {
43
+ const v = n?.length ? n.sort(lt).reduce(ct, []) : [], j = `repeat(${h}, ${s})`;
44
+ let I;
45
+ t[25] !== j ? (I = {
45
46
  display: "grid",
46
- gridTemplateColumns: D,
47
- width: "100%",
48
- minHeight: "100%"
49
- }, t[30] = D, t[31] = T) : T = t[31];
50
- const et = T;
51
- w = e.id, x = e.id, v = K, $ = et, t[32] !== E || t[33] !== p || t[34] !== s || t[35] !== i || t[36] !== r || t[37] !== u ? (m = !s && /* @__PURE__ */ W(lt, { columnCount: p, start: i, step: r, avgDuration: E, stepWidth: u }), t[32] = E, t[33] = p, t[34] = s, t[35] = i, t[36] = r, t[37] = u, t[38] = m) : m = t[38];
52
- let j;
53
- t[39] !== f || t[40] !== p || t[41] !== o || t[42] !== s || t[43] !== c || t[44] !== h || t[45] !== e.id || t[46] !== C || t[47] !== i || t[48] !== r || t[49] !== g || t[50] !== a || t[51] !== d ? (j = (nt, it) => /* @__PURE__ */ B("div", { style: {
54
- gridColumn: "1 / -1",
55
- height: C,
56
- position: "relative",
57
- backgroundColor: "transparent"
58
- }, children: [
59
- Array.from({
60
- length: p - 1
61
- }).map((M, A) => /* @__PURE__ */ W("div", { style: {
62
- position: "absolute",
63
- left: (A + 1) * g,
64
- top: 0,
65
- bottom: 0,
66
- width: "0px",
67
- borderLeft: `1px dashed rgba(255, 255, 255, ${s ? 0.05 : 0.1})`
68
- } }, `grid-${A}`)),
69
- s && /* @__PURE__ */ B(rt, { children: [
70
- /* @__PURE__ */ W("div", { className: "gantt__group-wrapper", style: {
71
- backgroundImage: `
47
+ gridTemplateColumns: j,
48
+ minWidth: "100%",
49
+ gridColumn: "1 / -1"
50
+ }, t[25] = j, t[26] = I) : I = t[26];
51
+ const Z = I;
52
+ let V;
53
+ t[27] !== W || t[28] !== h || t[29] !== c || t[30] !== i || t[31] !== a || t[32] !== s ? (V = !c && /* @__PURE__ */ x(rt, { columnCount: h, start: i, step: a, avgDuration: W, stepWidth: s }), t[27] = W, t[28] = h, t[29] = c, t[30] = i, t[31] = a, t[32] = s, t[33] = V) : V = t[33];
54
+ let A;
55
+ t[34] !== b || t[35] !== m || t[36] !== h || t[37] !== o || t[38] !== c || t[39] !== u || t[40] !== g || t[41] !== e.id || t[42] !== $ || t[43] !== i || t[44] !== a || t[45] !== s || t[46] !== f || t[47] !== d || t[48] !== p ? (A = (B, _) => /* @__PURE__ */ N(F, { children: [
56
+ /* @__PURE__ */ N("div", { style: {
57
+ gridColumn: "1 / -1",
58
+ minHeight: $,
59
+ position: "relative",
60
+ backgroundColor: "transparent"
61
+ }, children: [
62
+ Array.from({
63
+ length: h - 1
64
+ }).map((r, w) => /* @__PURE__ */ x("div", { style: {
65
+ position: "absolute",
66
+ left: (w + 1) * f,
67
+ top: 0,
68
+ bottom: 0,
69
+ width: "0px",
70
+ borderLeft: `1px dashed rgba(255, 255, 255, ${c ? 0.05 : 0.1})`
71
+ } }, `grid-${w}`)),
72
+ c && /* @__PURE__ */ N(F, { children: [
73
+ /* @__PURE__ */ x("div", { className: "gantt__group-wrapper", style: {
74
+ backgroundImage: `
72
75
  linear-gradient(to right, transparent, #070514),
73
76
  repeating-linear-gradient(
74
77
  45deg,
75
78
  transparent,
76
79
  transparent 2px,
77
- ${Q(U(e.id.replace("target", "source")), 0.5)} 4px
80
+ ${J(K(e.id.replace("target", "source")), 0.5)} 4px
78
81
  )
79
82
  `,
80
- left: `${I(h, h + r, i, o, a, d).left}px`,
81
- width: `${I(h, h + r, i, o, a, d).width}px`
82
- } }),
83
- /* @__PURE__ */ W("div", { className: "gantt__group-wrapper", style: {
84
- backgroundImage: `
83
+ left: `${C(g, g + a, i, o, d, p).left}px`,
84
+ width: `${C(g, g + a, i, o, d, p).width}px`
85
+ } }),
86
+ /* @__PURE__ */ x("div", { className: "gantt__group-wrapper", style: {
87
+ backgroundImage: `
85
88
  linear-gradient(to left, transparent, #070514),
86
89
  repeating-linear-gradient(
87
90
  45deg,
88
91
  transparent,
89
92
  transparent 2px,
90
- ${Q(U(e.id.replace("target", "source")), 0.5)} 4px
93
+ ${J(K(e.id.replace("target", "source")), 0.5)} 4px
91
94
  )
92
95
  `,
93
- left: `${I(c - r, c, i, o, a, d).left}px`,
94
- width: `${I(c - r, c, i, o, a, d).width}px`
95
- } })
96
- ] }),
97
- nt.map((M, A) => {
98
- const q = I(M.start, M.end, i, o, a, d);
99
- return q.width > 0 && /* @__PURE__ */ W(at, { id: M.id, w: `${q.width}px`, left: `${q.left}px`, children: f?.(M, A) }, M.id);
100
- })
101
- ] }, `row-${it}`), t[39] = f, t[40] = p, t[41] = o, t[42] = s, t[43] = c, t[44] = h, t[45] = e.id, t[46] = C, t[47] = i, t[48] = r, t[49] = g, t[50] = a, t[51] = d, t[52] = j) : j = t[52], b = G.map(j), t[8] = E, t[9] = f, t[10] = p, t[11] = o, t[12] = s, t[13] = c, t[14] = h, t[15] = n, t[16] = e.id, t[17] = C, t[18] = i, t[19] = r, t[20] = u, t[21] = g, t[22] = a, t[23] = d, t[24] = w, t[25] = x, t[26] = v, t[27] = $, t[28] = m, t[29] = b;
96
+ left: `${C(u - a, u, i, o, d, p).left}px`,
97
+ width: `${C(u - a, u, i, o, d, p).width}px`
98
+ } })
99
+ ] }),
100
+ B.map((r, w) => {
101
+ const D = C(r.start, r.end, i, o, d, p);
102
+ return D.width > 0 && /* @__PURE__ */ x(F, { children: /* @__PURE__ */ x(nt, { id: r.id, w: `${D.width}px`, left: `${D.left}px`, onClick: () => {
103
+ r.type == "group" && U((tt) => r.id === tt ? void 0 : r.id);
104
+ }, children: m?.(r, w) }, r.id) });
105
+ })
106
+ ] }, `row-${_}`),
107
+ B.map((r, w) => r.type === "group" && b === r.id && /* @__PURE__ */ x(it, { children: m, id: `group-target-${w}`, start: Math.min(...r.data.items.map(pt)) - Math.min(...r.data.items.map(ut)) / (r.data.firstGroupStep * r.data.step) * (r.data.groupStep * r.data.step), step: r.data.groupStep * r.data.step, stepWidth: s, rowHeight: $, items: r.data.items }, `group-target-${w}`))
108
+ ] }), t[34] = b, t[35] = m, t[36] = h, t[37] = o, t[38] = c, t[39] = u, t[40] = g, t[41] = e.id, t[42] = $, t[43] = i, t[44] = a, t[45] = s, t[46] = f, t[47] = d, t[48] = p, t[49] = A) : A = t[49], H = /* @__PURE__ */ N("div", { "data-gantt-id": e.id, id: e.id, ref: R, style: Z, children: [
109
+ V,
110
+ v.map(A)
111
+ ] }), t[7] = b, t[8] = W, t[9] = m, t[10] = h, t[11] = o, t[12] = c, t[13] = u, t[14] = g, t[15] = n, t[16] = e.id, t[17] = $, t[18] = i, t[19] = a, t[20] = s, t[21] = f, t[22] = d, t[23] = p, t[24] = H;
102
112
  } else
103
- w = t[24], x = t[25], v = t[26], $ = t[27], m = t[28], b = t[29];
104
- let y;
105
- t[53] !== s ? (y = !s && /* @__PURE__ */ W(st, {}), t[53] = s, t[54] = y) : y = t[54];
106
- let P;
107
- return t[55] !== w || t[56] !== x || t[57] !== v || t[58] !== $ || t[59] !== m || t[60] !== b || t[61] !== y ? (P = /* @__PURE__ */ B("div", { "data-gantt-id": w, id: x, ref: v, style: $, children: [
108
- m,
109
- b,
110
- y
111
- ] }), t[55] = w, t[56] = x, t[57] = v, t[58] = $, t[59] = m, t[60] = b, t[61] = y, t[62] = P) : P = t[62], P;
113
+ H = t[24];
114
+ return H;
112
115
  };
113
- function dt(e) {
116
+ function at(e) {
114
117
  return e.type !== "group";
115
118
  }
116
- function ct(e, t) {
119
+ function ot(e, t) {
117
120
  return e + (t.end - t.start);
118
121
  }
119
- function pt(e) {
122
+ function st(e) {
120
123
  return e.start;
121
124
  }
122
- function ht(e) {
125
+ function dt(e) {
123
126
  return e.end;
124
127
  }
125
- function mt(e, t) {
128
+ function lt(e, t) {
126
129
  return e.start - t.start;
127
130
  }
128
- function ft(e, t) {
129
- const n = e.find((R) => !R.some((l) => !(t.end <= l.start || t.start >= l.end)));
131
+ function ct(e, t) {
132
+ const n = e.find((y) => !y.some((l) => !(t.end <= l.start || t.start >= l.end)));
130
133
  return n ? (n.push(t), e) : [...e, [t]];
131
134
  }
135
+ function pt(e) {
136
+ return e.start;
137
+ }
138
+ function ut(e) {
139
+ return e.start;
140
+ }
132
141
  export {
133
- Rt as GanttGroup
142
+ it as GanttGroup
134
143
  };
@@ -3,6 +3,7 @@ import { default as React, CSSProperties } from 'react';
3
3
  import * as Radix from "@radix-ui/react-progress";
4
4
  export type ProgressProps = ComponentProps & Radix.ProgressProps & {
5
5
  color?: CSSProperties['background'];
6
+ dot?: React.ReactNode;
6
7
  predictionValue?: number | null;
7
8
  };
8
9
  export declare const Progress: React.FC<ProgressProps>;
@@ -3,15 +3,16 @@ import "../../utils/contextStore.js";
3
3
  import "react";
4
4
  import { mergeComponentProps as l } from "../../utils/component.js";
5
5
  import "js-md5";
6
- import { Progress as d, ProgressIndicator as n } from "../../node_modules/@radix-ui/react-progress/dist/index.js";
6
+ import { Progress as g, ProgressIndicator as n } from "../../node_modules/@radix-ui/react-progress/dist/index.js";
7
7
  import '../../assets/components/progress/Progress.style.css';/* empty css */
8
- const y = (r) => {
8
+ const v = (r) => {
9
9
  const {
10
10
  color: a = "white",
11
- predictionValue: g,
11
+ predictionValue: h,
12
+ dot: m,
12
13
  ...o
13
- } = r, t = Math.min(r.value ?? 0, r.max ?? 100) / (r.max ?? 100) * 100, m = `translateX(-${100 - t}%)`, s = Math.min(r.predictionValue ?? 0, r.max ?? 100) / (r.max ?? 100) * 100, c = `translateX(-${100 - s}%)`;
14
- return /* @__PURE__ */ i(d, { ...l("progress", {
14
+ } = r, t = Math.min(r.value ?? 0, r.max ?? 100) / (r.max ?? 100) * 100, c = `translateX(-${100 - t}%)`, s = Math.min(r.predictionValue ?? 0, r.max ?? 100) / (r.max ?? 100) * 100, d = `translateX(-${100 - s}%)`;
15
+ return /* @__PURE__ */ i(g, { ...l("progress", {
15
16
  ...o,
16
17
  style: {
17
18
  ...o.style,
@@ -20,7 +21,7 @@ const y = (r) => {
20
21
  "--color": a
21
22
  }
22
23
  }), children: [
23
- /* @__PURE__ */ e("div", { className: "progress__dot" }),
24
+ /* @__PURE__ */ e("div", { className: "progress__dot", children: m }),
24
25
  /* @__PURE__ */ i("div", { style: {
25
26
  width: "100%",
26
27
  height: "100%",
@@ -29,14 +30,14 @@ const y = (r) => {
29
30
  position: "relative"
30
31
  }, children: [
31
32
  /* @__PURE__ */ e(n, { className: "progress__indicator", style: {
32
- transform: m
33
+ transform: c
33
34
  } }),
34
35
  typeof r.predictionValue == "number" && /* @__PURE__ */ e(n, { className: "progress__indicator progress__indicator--prediction", style: {
35
- transform: c
36
+ transform: d
36
37
  } })
37
38
  ] })
38
39
  ] });
39
40
  };
40
41
  export {
41
- y as Progress
42
+ v as Progress
42
43
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code0-tech/pictor",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "type": "module",
5
5
  "description": "A simple template for a custom React component library",
6
6
  "scripts": {