@code0-tech/pictor 0.6.1 → 0.6.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.
Files changed (102) hide show
  1. package/LICENSE +1 -1
  2. package/dist/assets/components/command/Command.style.css +1 -1
  3. package/dist/assets/components/gantt/Gantt.style.css +1 -0
  4. package/dist/assets/components/layout/Layout.style.css +1 -1
  5. package/dist/components/alert/Alert.d.ts +2 -2
  6. package/dist/components/alert/Alert.js +8 -7
  7. package/dist/components/avatar/Avatar.d.ts +2 -2
  8. package/dist/components/avatar/Avatar.js +30 -27
  9. package/dist/components/badge/Badge.d.ts +2 -2
  10. package/dist/components/badge/Badge.js +26 -23
  11. package/dist/components/breadcrumb/Breadcrumb.d.ts +2 -2
  12. package/dist/components/breadcrumb/Breadcrumb.js +16 -14
  13. package/dist/components/button/Button.d.ts +3 -3
  14. package/dist/components/button/Button.js +13 -12
  15. package/dist/components/button-group/ButtonGroup.d.ts +2 -2
  16. package/dist/components/button-group/ButtonGroup.js +23 -20
  17. package/dist/components/card/Card.d.ts +3 -3
  18. package/dist/components/card/Card.js +19 -16
  19. package/dist/components/card/CardSection.d.ts +2 -2
  20. package/dist/components/card/CardSection.js +16 -13
  21. package/dist/components/col/Col.d.ts +2 -2
  22. package/dist/components/col/Col.js +22 -19
  23. package/dist/components/command/Command.d.ts +12 -12
  24. package/dist/components/command/Command.js +95 -82
  25. package/dist/components/container/Container.d.ts +2 -2
  26. package/dist/components/container/Container.js +13 -10
  27. package/dist/components/context-menu/ContextMenu.d.ts +13 -13
  28. package/dist/components/context-menu/ContextMenu.js +26 -25
  29. package/dist/components/data-table/DataTable.d.ts +2 -2
  30. package/dist/components/data-table/DataTable.js +18 -17
  31. package/dist/components/data-table/DataTableColumn.d.ts +2 -2
  32. package/dist/components/data-table/DataTableColumn.js +12 -11
  33. package/dist/components/data-table/DataTableFilterInput.js +4 -3
  34. package/dist/components/dialog/Dialog.d.ts +12 -12
  35. package/dist/components/dialog/Dialog.js +24 -23
  36. package/dist/components/editor/Editor.d.ts +2 -2
  37. package/dist/components/editor/Editor.js +4 -3
  38. package/dist/components/file-tabs/FileTabs.d.ts +5 -5
  39. package/dist/components/file-tabs/FileTabs.js +38 -35
  40. package/dist/components/flex/Flex.d.ts +2 -2
  41. package/dist/components/flex/Flex.js +16 -13
  42. package/dist/components/form/CheckboxInput.js +17 -15
  43. package/dist/components/form/Input.d.ts +3 -3
  44. package/dist/components/form/Input.js +4 -3
  45. package/dist/components/form/PinInput.d.ts +3 -3
  46. package/dist/components/form/PinInput.js +33 -30
  47. package/dist/components/form/RadioGroup.js +22 -19
  48. package/dist/components/form/RadioInput.d.ts +2 -2
  49. package/dist/components/form/RadioInput.js +19 -16
  50. package/dist/components/fullscreen/FullScreen.d.ts +2 -2
  51. package/dist/components/fullscreen/FullScreen.js +8 -6
  52. package/dist/components/gantt/Gantt.d.ts +12 -0
  53. package/dist/components/gantt/Gantt.js +92 -0
  54. package/dist/components/gantt/GanttFooter.d.ts +2 -0
  55. package/dist/components/gantt/GanttFooter.js +38 -0
  56. package/dist/components/gantt/GanttGroup.d.ts +8 -0
  57. package/dist/components/gantt/GanttGroup.js +134 -0
  58. package/dist/components/gantt/GanttHeader.d.ts +10 -0
  59. package/dist/components/gantt/GanttHeader.js +55 -0
  60. package/dist/components/gantt/GanttItem.d.ts +16 -0
  61. package/dist/components/gantt/GanttItem.js +23 -0
  62. package/dist/components/layout/Layout.d.ts +3 -3
  63. package/dist/components/layout/Layout.js +37 -33
  64. package/dist/components/menu/Menu.d.ts +15 -15
  65. package/dist/components/menu/Menu.js +35 -32
  66. package/dist/components/resizable/Resizable.d.ts +4 -4
  67. package/dist/components/resizable/Resizable.js +18 -17
  68. package/dist/components/row/Row.d.ts +2 -2
  69. package/dist/components/row/Row.js +15 -12
  70. package/dist/components/scroll-area/ScrollArea.d.ts +6 -6
  71. package/dist/components/scroll-area/ScrollArea.js +35 -32
  72. package/dist/components/segmented-control/SegmentedControl.d.ts +3 -3
  73. package/dist/components/segmented-control/SegmentedControl.js +12 -11
  74. package/dist/components/spacing/Spacing.d.ts +3 -3
  75. package/dist/components/spacing/Spacing.js +12 -11
  76. package/dist/components/tab/Tab.d.ts +5 -5
  77. package/dist/components/tab/Tab.js +22 -21
  78. package/dist/components/text/Text.d.ts +3 -3
  79. package/dist/components/text/Text.js +14 -11
  80. package/dist/components/toast/Toast.d.ts +2 -2
  81. package/dist/components/toast/Toast.js +32 -31
  82. package/dist/components/tooltip/Tooltip.d.ts +6 -6
  83. package/dist/components/tooltip/Tooltip.js +34 -31
  84. package/dist/index.d.ts +1 -0
  85. package/dist/index.js +151 -152
  86. package/dist/utils/color.d.ts +4 -0
  87. package/dist/utils/color.js +43 -0
  88. package/dist/utils/component.d.ts +105 -0
  89. package/dist/utils/component.js +130 -0
  90. package/dist/utils/index.d.ts +3 -4
  91. package/dist/utils/index.js +14 -18
  92. package/dist/utils/size.d.ts +4 -0
  93. package/dist/utils/size.js +21 -0
  94. package/dist/utils/utils.d.ts +0 -55
  95. package/dist/utils/utils.js +1 -159
  96. package/package.json +3 -3
  97. package/dist/utils/nonReactiveArrayService.d.ts +0 -19
  98. package/dist/utils/nonReactiveArrayService.js +0 -54
  99. package/dist/utils/objectStore.d.ts +0 -12
  100. package/dist/utils/objectStore.js +0 -34
  101. package/dist/utils/types.d.ts +0 -57
  102. package/dist/utils/types.js +0 -4
@@ -1,48 +1,51 @@
1
- import { jsx as p, jsxs as x, Fragment as R } from "react/jsx-runtime";
1
+ import { jsx as f, jsxs as x, Fragment as R } from "react/jsx-runtime";
2
2
  import { c as C } from "../../_virtual/compiler-runtime.js";
3
3
  import * as M from "@radix-ui/react-radio-group";
4
- import { mergeCode0Props as v } from "../../utils/utils.js";
4
+ import "../../utils/contextStore.js";
5
+ import "react";
6
+ import { mergeComponentProps as v } from "../../utils/component.js";
7
+ import "js-md5";
5
8
  import { InputLabel as G } from "./InputLabel.js";
6
9
  import { InputDescription as I } from "./InputDescription.js";
7
10
  import { InputMessage as j } from "./InputMessage.js";
8
11
  import '../../assets/components/form/Input.style.css';/* empty css */
9
- const k = (u) => {
12
+ const y = (s) => {
10
13
  const e = C.c(22);
11
- let o, t, a, r, l, i;
12
- if (e[0] !== u) {
14
+ let o, t, r, a, i, l;
15
+ if (e[0] !== s) {
13
16
  const {
14
17
  title: d,
15
- description: f,
18
+ description: p,
16
19
  initialValue: h,
17
20
  formValidation: V,
18
21
  ...c
19
- } = u;
22
+ } = s;
20
23
  t = V === void 0 ? {
21
24
  valid: !0,
22
25
  notValidMessage: null,
23
26
  setValue: b
24
- } : V, e[7] !== d ? (l = d ? /* @__PURE__ */ p(G, { children: d }) : null, e[7] = d, e[8] = l) : l = e[8], e[9] !== f ? (i = f ? /* @__PURE__ */ p(I, { children: f }) : null, e[9] = f, e[10] = i) : i = e[10], o = M.RadioGroup, a = h ?? u.defaultValue, r = v("radio-group", {
27
+ } : V, e[7] !== d ? (i = d ? /* @__PURE__ */ f(G, { children: d }) : null, e[7] = d, e[8] = i) : i = e[8], e[9] !== p ? (l = p ? /* @__PURE__ */ f(I, { children: p }) : null, e[9] = p, e[10] = l) : l = e[10], o = M.RadioGroup, r = h ?? s.defaultValue, a = v("radio-group", {
25
28
  ...c,
26
29
  onValueChange: (g) => {
27
30
  c.onValueChange && c.onValueChange(g), t.setValue(g);
28
31
  }
29
- }), e[0] = u, e[1] = o, e[2] = t, e[3] = a, e[4] = r, e[5] = l, e[6] = i;
32
+ }), e[0] = s, e[1] = o, e[2] = t, e[3] = r, e[4] = a, e[5] = i, e[6] = l;
30
33
  } else
31
- o = e[1], t = e[2], a = e[3], r = e[4], l = e[5], i = e[6];
34
+ o = e[1], t = e[2], r = e[3], a = e[4], i = e[5], l = e[6];
32
35
  let n;
33
- e[11] !== o || e[12] !== a || e[13] !== r ? (n = /* @__PURE__ */ p(o, { defaultValue: a, ...r }), e[11] = o, e[12] = a, e[13] = r, e[14] = n) : n = e[14];
34
- let s;
35
- e[15] !== t ? (s = !t?.valid && t?.notValidMessage ? /* @__PURE__ */ p(j, { children: t.notValidMessage }) : null, e[15] = t, e[16] = s) : s = e[16];
36
+ e[11] !== o || e[12] !== r || e[13] !== a ? (n = /* @__PURE__ */ f(o, { defaultValue: r, ...a }), e[11] = o, e[12] = r, e[13] = a, e[14] = n) : n = e[14];
36
37
  let m;
37
- return e[17] !== l || e[18] !== i || e[19] !== n || e[20] !== s ? (m = /* @__PURE__ */ x(R, { children: [
38
- l,
38
+ e[15] !== t ? (m = !t?.valid && t?.notValidMessage ? /* @__PURE__ */ f(j, { children: t.notValidMessage }) : null, e[15] = t, e[16] = m) : m = e[16];
39
+ let u;
40
+ return e[17] !== i || e[18] !== l || e[19] !== n || e[20] !== m ? (u = /* @__PURE__ */ x(R, { children: [
39
41
  i,
42
+ l,
40
43
  n,
41
- s
42
- ] }), e[17] = l, e[18] = i, e[19] = n, e[20] = s, e[21] = m) : m = e[21], m;
44
+ m
45
+ ] }), e[17] = i, e[18] = l, e[19] = n, e[20] = m, e[21] = u) : u = e[21], u;
43
46
  };
44
- function b(u) {
47
+ function b(s) {
45
48
  }
46
49
  export {
47
- k as RadioGroup
50
+ y as RadioGroup
48
51
  };
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { Code0ComponentProps } from '../../utils/types';
2
+ import { ComponentProps } from '../../utils';
3
3
  import * as RadixRadioGroup from "@radix-ui/react-radio-group";
4
- export type RadioInputProps = Code0ComponentProps & RadixRadioGroup.RadioGroupItemProps & {
4
+ export type RadioInputProps = ComponentProps & RadixRadioGroup.RadioGroupItemProps & {
5
5
  label: React.ReactNode;
6
6
  };
7
7
  export declare const RadioInput: React.FC<RadioInputProps>;
@@ -1,27 +1,30 @@
1
- import { jsx as c, jsxs as u } from "react/jsx-runtime";
2
- import { c as f } from "../../_virtual/compiler-runtime.js";
1
+ import { jsx as c, jsxs as p } from "react/jsx-runtime";
2
+ import { c as u } from "../../_virtual/compiler-runtime.js";
3
3
  import * as s from "@radix-ui/react-radio-group";
4
- import { mergeCode0Props as d } from "../../utils/utils.js";
4
+ import "../../utils/contextStore.js";
5
+ import "react";
6
+ import { mergeComponentProps as d } from "../../utils/component.js";
7
+ import "js-md5";
5
8
  import '../../assets/components/form/Input.style.css';/* empty css */
6
- const R = (t) => {
7
- const e = f.c(11);
8
- let l;
9
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = d("input radio-input", {}), e[0] = l) : l = e[0];
9
+ const G = (e) => {
10
+ const t = u.c(11);
10
11
  let r;
11
- e[1] !== t ? (r = d("radio-input__button", t), e[1] = t, e[2] = r) : r = e[2];
12
- const m = r;
13
- let a;
14
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ c(s.RadioGroupIndicator, { className: "radio-input__indicator" }), e[3] = a) : a = e[3];
12
+ t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (r = d("input radio-input", {}), t[0] = r) : r = t[0];
13
+ let l;
14
+ t[1] !== e ? (l = d("radio-input__button", e), t[1] = e, t[2] = l) : l = t[2];
15
+ const a = l;
16
+ let m;
17
+ t[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ c(s.RadioGroupIndicator, { className: "radio-input__indicator" }), t[3] = m) : m = t[3];
15
18
  let i;
16
- e[4] !== m ? (i = /* @__PURE__ */ c(s.RadioGroupItem, { ...m, children: a }), e[4] = m, e[5] = i) : i = e[5];
19
+ t[4] !== a ? (i = /* @__PURE__ */ c(s.RadioGroupItem, { ...a, children: m }), t[4] = a, t[5] = i) : i = t[5];
17
20
  let o;
18
- e[6] !== t.label ? (o = /* @__PURE__ */ c("div", { className: "input__right input__right--action}", children: t.label }), e[6] = t.label, e[7] = o) : o = e[7];
21
+ t[6] !== e.label ? (o = /* @__PURE__ */ c("div", { className: "input__right input__right--action}", children: e.label }), t[6] = e.label, t[7] = o) : o = t[7];
19
22
  let n;
20
- return e[8] !== i || e[9] !== o ? (n = /* @__PURE__ */ u("div", { ...l, children: [
23
+ return t[8] !== i || t[9] !== o ? (n = /* @__PURE__ */ p("div", { ...r, children: [
21
24
  i,
22
25
  o
23
- ] }), e[8] = i, e[9] = o, e[10] = n) : n = e[10], n;
26
+ ] }), t[8] = i, t[9] = o, t[10] = n) : n = t[10], n;
24
27
  };
25
28
  export {
26
- R as RadioInput
29
+ G as RadioInput
27
30
  };
@@ -1,6 +1,6 @@
1
- import { Code0Component } from '../../utils/types';
1
+ import { Component } from '../../utils';
2
2
  import { default as React } from 'react';
3
- export interface FullScreenProps extends Code0Component<HTMLDivElement> {
3
+ export interface FullScreenProps extends Component<HTMLDivElement> {
4
4
  children: React.ReactNode | React.ReactNode[];
5
5
  }
6
6
  export declare const FullScreen: React.FC<FullScreenProps>;
@@ -1,10 +1,12 @@
1
1
  import { jsx as u } from "react/jsx-runtime";
2
- import { c as f } from "../../_virtual/compiler-runtime.js";
2
+ import { c as m } from "../../_virtual/compiler-runtime.js";
3
+ import "../../utils/contextStore.js";
3
4
  import l from "react";
4
- import { mergeCode0Props as m } from "../../utils/utils.js";
5
+ import { mergeComponentProps as f } from "../../utils/component.js";
6
+ import "js-md5";
5
7
  import '../../assets/components/fullscreen/FullScreen.style.css';/* empty css */
6
- const y = (i) => {
7
- const e = f.c(7), t = l.useRef(null);
8
+ const R = (i) => {
9
+ const e = m.c(7), t = l.useRef(null);
8
10
  let r, o;
9
11
  e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (r = () => {
10
12
  if (!t.current)
@@ -17,10 +19,10 @@ const y = (i) => {
17
19
  t.current.style.height = h + "px", t.current.style.width = w + "px";
18
20
  }, o = [t], e[0] = r, e[1] = o) : (r = e[0], o = e[1]), l.useEffect(r, o);
19
21
  let n;
20
- e[2] !== i ? (n = m("d-full-screen", i), e[2] = i, e[3] = n) : n = e[3];
22
+ e[2] !== i ? (n = f("d-full-screen", i), e[2] = i, e[3] = n) : n = e[3];
21
23
  let d;
22
24
  return e[4] !== i.children || e[5] !== n ? (d = /* @__PURE__ */ u("div", { ...n, ref: t, children: i.children }), e[4] = i.children, e[5] = n, e[6] = d) : d = e[6], d;
23
25
  };
24
26
  export {
25
- y as FullScreen
27
+ R as FullScreen
26
28
  };
@@ -0,0 +1,12 @@
1
+ import { default as React, CSSProperties } from 'react';
2
+ import { Component } from '../../utils';
3
+ import { GanttItem } from './GanttItem';
4
+ export interface GanttProps extends Omit<Component<HTMLDivElement>, 'children'> {
5
+ items: GanttItem[];
6
+ stepWidth?: CSSProperties["width"];
7
+ rowHeight?: CSSProperties["height"];
8
+ step?: number;
9
+ children?: (item: GanttItem, index: number) => React.ReactNode;
10
+ }
11
+ export declare const Gantt: React.FC<GanttProps>;
12
+ export declare const getRelativeValue: (value: number) => string;
@@ -0,0 +1,92 @@
1
+ import { jsx as d, jsxs as B } from "react/jsx-runtime";
2
+ import { c as H } from "../../_virtual/compiler-runtime.js";
3
+ import "../../utils/contextStore.js";
4
+ import "react";
5
+ import "merge-props";
6
+ import { hashToColor as R } from "../../utils/color.js";
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]
37
+ });
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}`;
73
+ };
74
+ function D(e, t) {
75
+ return t.step - e.step;
76
+ }
77
+ function k(e) {
78
+ return e.start;
79
+ }
80
+ function q(e) {
81
+ return e.end;
82
+ }
83
+ function v(e, t) {
84
+ return t.step - e.step;
85
+ }
86
+ function F(e) {
87
+ return e.start;
88
+ }
89
+ export {
90
+ X as Gantt,
91
+ Y as getRelativeValue
92
+ };
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare const GanttFooter: React.FC;
@@ -0,0 +1,38 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { c as n } from "../../_virtual/compiler-runtime.js";
3
+ import { Text as l } from "../text/Text.js";
4
+ const d = (s) => {
5
+ const t = n.c(3);
6
+ let e, o;
7
+ t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = {
8
+ gridColumn: "1 / -1",
9
+ height: "fit-content",
10
+ position: "sticky",
11
+ display: "flex",
12
+ top: 0,
13
+ backgroundColor: "#070514",
14
+ borderBottom: "1px solid rgba(255, 255, 255, 0.25)",
15
+ zIndex: 10
16
+ }, o = {
17
+ position: "sticky",
18
+ left: 0,
19
+ width: "fit-content",
20
+ height: "100%",
21
+ padding: "8px",
22
+ display: "flex",
23
+ alignItems: "center",
24
+ justifyContent: "start",
25
+ boxSizing: "border-box",
26
+ background: "#070514",
27
+ zIndex: 2
28
+ }, t[0] = e, t[1] = o) : (e = t[0], o = t[1]);
29
+ let i;
30
+ return t[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ r("div", { style: e, children: /* @__PURE__ */ r("div", { style: o, children: /* @__PURE__ */ r(l, { style: {
31
+ textWrap: "nowrap",
32
+ display: "flex",
33
+ alignItems: "center"
34
+ }, children: "Available Groups" }) }) }), t[2] = i) : i = t[2], i;
35
+ };
36
+ export {
37
+ d as GanttFooter
38
+ };
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ import { GanttProps } from './Gantt';
3
+ export interface GanttGroupProps extends GanttProps {
4
+ start?: number;
5
+ end?: number;
6
+ hideScaling?: boolean;
7
+ }
8
+ export declare const GanttGroup: React.FC<GanttGroupProps>;
@@ -0,0 +1,134 @@
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";
4
+ import "../../utils/contextStore.js";
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 _ = (e, t, n, R, l, S) => {
11
+ const C = Math.max(0, e - n), H = Math.min(l, t - n), V = C / l * S, f = (H - C) / l * S;
12
+ return {
13
+ left: V,
14
+ width: f
15
+ };
16
+ }, Rt = (e) => {
17
+ const t = ot.c(63), {
18
+ items: n,
19
+ stepWidth: R,
20
+ rowHeight: l,
21
+ step: S,
22
+ start: C,
23
+ end: H,
24
+ hideScaling: V,
25
+ children: f
26
+ } = e, u = R === void 0 ? "50px" : R, E = l === void 0 ? "50px" : l, r = S === void 0 ? 1 : S, i = C === void 0 ? 1 : C, 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) ?? [], G = 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;
30
+ 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 I = () => {
36
+ Y(K.current?.offsetWidth ?? 0);
37
+ };
38
+ return I(), window.addEventListener("resize", I), () => window.removeEventListener("resize", I);
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] !== G || 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] !== E || t[18] !== i || t[19] !== r || t[20] !== u || t[21] !== g || t[22] !== a || t[23] !== d) {
42
+ const I = n?.length ? n.sort(mt).reduce(ft, []) : [], D = `repeat(${p}, ${u})`;
43
+ let T;
44
+ t[30] !== D ? (T = {
45
+ 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] !== G || 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: G, stepWidth: u }), t[32] = G, 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] !== E || 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: E,
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: `
72
+ linear-gradient(to right, transparent, #070514),
73
+ repeating-linear-gradient(
74
+ 45deg,
75
+ transparent,
76
+ transparent 2px,
77
+ ${Q(U(e.id.replace("target", "source")), 0.5)} 4px
78
+ )
79
+ `,
80
+ left: `${_(h, h + r, i, o, a, d).left}px`,
81
+ width: `${_(h, h + r, i, o, a, d).width}px`
82
+ } }),
83
+ /* @__PURE__ */ W("div", { className: "gantt__group-wrapper", style: {
84
+ backgroundImage: `
85
+ linear-gradient(to left, transparent, #070514),
86
+ repeating-linear-gradient(
87
+ 45deg,
88
+ transparent,
89
+ transparent 2px,
90
+ ${Q(U(e.id.replace("target", "source")), 0.5)} 4px
91
+ )
92
+ `,
93
+ left: `${_(c - r, c, i, o, a, d).left}px`,
94
+ width: `${_(c - r, c, i, o, a, d).width}px`
95
+ } })
96
+ ] }),
97
+ nt.map((M, A) => {
98
+ const q = _(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] = E, t[47] = i, t[48] = r, t[49] = g, t[50] = a, t[51] = d, t[52] = j) : j = t[52], b = I.map(j), t[8] = G, 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] = E, 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;
102
+ } 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;
112
+ };
113
+ function dt(e) {
114
+ return e.type !== "group";
115
+ }
116
+ function ct(e, t) {
117
+ return e + (t.end - t.start);
118
+ }
119
+ function pt(e) {
120
+ return e.start;
121
+ }
122
+ function ht(e) {
123
+ return e.end;
124
+ }
125
+ function mt(e, t) {
126
+ return e.start - t.start;
127
+ }
128
+ function ft(e, t) {
129
+ const n = e.find((R) => !R.some((l) => !(t.end <= l.start || t.start >= l.end)));
130
+ return n ? (n.push(t), e) : [...e, [t]];
131
+ }
132
+ export {
133
+ Rt as GanttGroup
134
+ };
@@ -0,0 +1,10 @@
1
+ import { default as React, CSSProperties } from 'react';
2
+ import { Component } from '../../utils';
3
+ export interface GanttHeaderProps extends Component<HTMLDivElement> {
4
+ columnCount: number;
5
+ start: number;
6
+ step: number;
7
+ avgDuration: number;
8
+ stepWidth: CSSProperties["width"];
9
+ }
10
+ export declare const GanttHeader: React.FC<GanttHeaderProps>;
@@ -0,0 +1,55 @@
1
+ import { jsx as p, jsxs as N } from "react/jsx-runtime";
2
+ import { c as W } from "../../_virtual/compiler-runtime.js";
3
+ import "../../utils/contextStore.js";
4
+ import "react";
5
+ import { mergeComponentProps as j } from "../../utils/component.js";
6
+ import "js-md5";
7
+ import { Text as b } from "../text/Text.js";
8
+ const x = (e) => {
9
+ const t = W.c(20);
10
+ let a, s, i, n, r, o, m;
11
+ if (t[0] !== e) {
12
+ const {
13
+ columnCount: _,
14
+ start: l,
15
+ step: d,
16
+ avgDuration: f,
17
+ stepWidth: g,
18
+ ...v
19
+ } = e;
20
+ s = _, i = l, n = d, a = f, r = g, o = parseInt(r), m = j("gantt__header", v), t[0] = e, t[1] = a, t[2] = s, t[3] = i, t[4] = n, t[5] = r, t[6] = o, t[7] = m;
21
+ } else
22
+ a = t[1], s = t[2], i = t[3], n = t[4], r = t[5], o = t[6], m = t[7];
23
+ let c;
24
+ t[8] !== s ? (c = Array.from({
25
+ length: s
26
+ }), t[8] = s, t[9] = c) : c = t[9];
27
+ let h;
28
+ t[10] !== a || t[11] !== i || t[12] !== n || t[13] !== r || t[14] !== o || t[15] !== c ? (h = c.map((_, l) => {
29
+ const d = i + l * n, f = l % 4 === 0, g = $(a), {
30
+ value: v,
31
+ unit: y
32
+ } = $(d), C = `${Math.round(v * 10) / 10}${y}`;
33
+ return l !== 0 ? /* @__PURE__ */ p("div", { className: "gantt__header-column", style: {
34
+ left: l * o,
35
+ width: r
36
+ }, children: /* @__PURE__ */ p(b, { children: f ? C : "" }) }, `header-${l}`) : /* @__PURE__ */ p("div", { className: "gantt__header-label-column", children: /* @__PURE__ */ N(b, { className: "gantt__header-label", children: [
37
+ "Range in ",
38
+ g.unit
39
+ ] }) }, `header-${l}`);
40
+ }), t[10] = a, t[11] = i, t[12] = n, t[13] = r, t[14] = o, t[15] = c, t[16] = h) : h = t[16];
41
+ let u;
42
+ return t[17] !== m || t[18] !== h ? (u = /* @__PURE__ */ p("div", { ...m, children: h }), t[17] = m, t[18] = h, t[19] = u) : u = t[19], u;
43
+ }, $ = (e) => e > 5e5 ? {
44
+ value: e / 1e6,
45
+ unit: "s"
46
+ } : e > 500 ? {
47
+ value: e / 1e3,
48
+ unit: "ms"
49
+ } : {
50
+ value: e,
51
+ unit: "μs"
52
+ };
53
+ export {
54
+ x as GanttHeader
55
+ };
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ import { Component } from '../../utils';
3
+ export interface GanttItem {
4
+ start: number;
5
+ end: number;
6
+ data?: any | {
7
+ displayMessage: string;
8
+ color: string;
9
+ };
10
+ type?: string | "group";
11
+ id: string;
12
+ }
13
+ export interface GanttItemProps extends Omit<Component<HTMLDivElement>, 'children'> {
14
+ children: React.ReactNode;
15
+ }
16
+ export declare const GanttItem: React.FC<GanttItemProps>;
@@ -0,0 +1,23 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { c as d } from "../../_virtual/compiler-runtime.js";
3
+ import "../../utils/contextStore.js";
4
+ import "react";
5
+ import { mergeComponentProps as p } from "../../utils/component.js";
6
+ import "js-md5";
7
+ const _ = (n) => {
8
+ const t = d.c(10);
9
+ let e, i, r, o;
10
+ if (t[0] !== n) {
11
+ const {
12
+ children: c,
13
+ ...l
14
+ } = n;
15
+ e = c, i = l.id, r = l.id, o = p("gantt__item", l), t[0] = n, t[1] = e, t[2] = i, t[3] = r, t[4] = o;
16
+ } else
17
+ e = t[1], i = t[2], r = t[3], o = t[4];
18
+ let m;
19
+ return t[5] !== e || t[6] !== i || t[7] !== r || t[8] !== o ? (m = /* @__PURE__ */ s("div", { "data-gantt-id": r, ...o, children: e }, i), t[5] = e, t[6] = i, t[7] = r, t[8] = o, t[9] = m) : m = t[9], m;
20
+ };
21
+ export {
22
+ _ as GanttItem
23
+ };
@@ -1,12 +1,12 @@
1
1
  import { default as React, CSSProperties } from 'react';
2
- import { Code0Component, Code0Sizes } from '../../utils/types';
3
- export interface LayoutProps extends Code0Component<HTMLDivElement> {
2
+ import { Component, Sizes } from '../../utils';
3
+ export interface LayoutProps extends Component<HTMLDivElement> {
4
4
  children: React.ReactElement;
5
5
  topContent?: React.ReactElement;
6
6
  bottomContent?: React.ReactElement;
7
7
  leftContent?: React.ReactElement;
8
8
  rightContent?: React.ReactElement;
9
- layoutGap?: Code0Sizes | CSSProperties['gap'];
9
+ layoutGap?: Sizes | CSSProperties['gap'];
10
10
  showLayoutSplitter?: boolean;
11
11
  }
12
12
  export declare const Layout: React.FC<LayoutProps>;