laif-ds 0.1.6 → 0.1.7

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 (97) hide show
  1. package/dist/_virtual/_cloneBuffer.js +5 -0
  2. package/dist/_virtual/dayjs.min.js +8 -0
  3. package/dist/_virtual/dayjs.min2.js +5 -0
  4. package/dist/_virtual/debounce.js +8 -0
  5. package/dist/_virtual/index5.js +5 -2
  6. package/dist/_virtual/index6.js +5 -0
  7. package/dist/_virtual/index7.js +5 -0
  8. package/dist/_virtual/localizedFormat.js +8 -0
  9. package/dist/_virtual/localizedFormat2.js +5 -0
  10. package/dist/_virtual/omit.js +8 -0
  11. package/dist/components/ui/gantt/assets/icons/MinusSquareOutlined.js +36 -0
  12. package/dist/components/ui/gantt/assets/icons/PlusSquareOutlined.js +45 -0
  13. package/dist/components/ui/gantt/components/Chart/Bars/Bars.js +115 -0
  14. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarItem/BarItem.js +158 -0
  15. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsItems/BarItems.js +36 -0
  16. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRow.js +26 -0
  17. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRowContext.js +14 -0
  18. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/RepeteadBars/RepeteadBars.js +75 -0
  19. package/dist/components/ui/gantt/components/Chart/Chart.js +66 -0
  20. package/dist/components/ui/gantt/components/Chart/Scale/Scale.js +88 -0
  21. package/dist/components/ui/gantt/components/Chart/Tree/Tree.js +72 -0
  22. package/dist/components/ui/gantt/components/Controls/Controls.js +82 -0
  23. package/dist/components/ui/gantt/components/Gantt/Gantt.js +58 -0
  24. package/dist/components/ui/gantt/components/Gantt/GanttContext.js +35 -0
  25. package/dist/components/ui/gantt/constants/DimensionsSettings.js +89 -0
  26. package/dist/components/ui/gantt/constants/DragStepOptions.js +43 -0
  27. package/dist/components/ui/gantt/constants/GanttConsts.js +17 -0
  28. package/dist/components/ui/gantt/constants/colors.json.js +106 -0
  29. package/dist/components/ui/gantt/enums/DataRepeatTimes.js +5 -0
  30. package/dist/components/ui/gantt/enums/DragStepSizes.js +5 -0
  31. package/dist/components/ui/gantt/enums/DragTypes.js +5 -0
  32. package/dist/components/ui/gantt/enums/GanttDimensions.js +5 -0
  33. package/dist/components/ui/gantt/enums/GanttUnitOfTimes.js +5 -0
  34. package/dist/components/ui/gantt/hooks/useForwardRef.js +11 -0
  35. package/dist/components/ui/gantt/hooks/useGanttCalculate.js +30 -0
  36. package/dist/components/ui/gantt/utils/getInitialScrollOffset.js +11 -0
  37. package/dist/components/ui/gantt/utils/getScaleDates.js +14 -0
  38. package/dist/components/ui/gantt/utils/getScaleItems.js +33 -0
  39. package/dist/components/ui/gantt/utils/getWholeWidth.js +7 -0
  40. package/dist/components/ui/gantt/utils/transformData.js +36 -0
  41. package/dist/index.d.ts +168 -0
  42. package/dist/index.js +300 -294
  43. package/dist/laif-ds.css +1 -0
  44. package/dist/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +8 -0
  45. package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +13 -0
  46. package/dist/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +8 -0
  47. package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +9 -0
  48. package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +57 -0
  49. package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +2150 -0
  50. package/dist/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js +27 -0
  51. package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +184 -0
  52. package/dist/node_modules/classnames/index.js +43 -0
  53. package/dist/node_modules/dayjs/dayjs.min.js +283 -0
  54. package/dist/node_modules/dayjs/plugin/localizedFormat.js +30 -0
  55. package/dist/node_modules/lodash/_arrayEach.js +15 -0
  56. package/dist/node_modules/lodash/_assignValue.js +17 -0
  57. package/dist/node_modules/lodash/_baseAssign.js +16 -0
  58. package/dist/node_modules/lodash/_baseAssignIn.js +16 -0
  59. package/dist/node_modules/lodash/_baseAssignValue.js +20 -0
  60. package/dist/node_modules/lodash/_baseClone.js +71 -0
  61. package/dist/node_modules/lodash/_baseCreate.js +24 -0
  62. package/dist/node_modules/lodash/_baseIsMap.js +16 -0
  63. package/dist/node_modules/lodash/_baseIsSet.js +16 -0
  64. package/dist/node_modules/lodash/_baseKeysIn.js +22 -0
  65. package/dist/node_modules/lodash/_baseUnset.js +18 -0
  66. package/dist/node_modules/lodash/_cloneArrayBuffer.js +16 -0
  67. package/dist/node_modules/lodash/_cloneBuffer.js +20 -0
  68. package/dist/node_modules/lodash/_cloneDataView.js +16 -0
  69. package/dist/node_modules/lodash/_cloneRegExp.js +15 -0
  70. package/dist/node_modules/lodash/_cloneSymbol.js +15 -0
  71. package/dist/node_modules/lodash/_cloneTypedArray.js +16 -0
  72. package/dist/node_modules/lodash/_copyArray.js +16 -0
  73. package/dist/node_modules/lodash/_copyObject.js +22 -0
  74. package/dist/node_modules/lodash/_copySymbols.js +16 -0
  75. package/dist/node_modules/lodash/_copySymbolsIn.js +16 -0
  76. package/dist/node_modules/lodash/_customOmitClone.js +15 -0
  77. package/dist/node_modules/lodash/_flatRest.js +17 -0
  78. package/dist/node_modules/lodash/_getAllKeysIn.js +17 -0
  79. package/dist/node_modules/lodash/_getPrototype.js +12 -0
  80. package/dist/node_modules/lodash/_getSymbolsIn.js +19 -0
  81. package/dist/node_modules/lodash/_initCloneArray.js +15 -0
  82. package/dist/node_modules/lodash/_initCloneByTag.js +49 -0
  83. package/dist/node_modules/lodash/_initCloneObject.js +17 -0
  84. package/dist/node_modules/lodash/_nativeKeysIn.js +17 -0
  85. package/dist/node_modules/lodash/_parent.js +16 -0
  86. package/dist/node_modules/lodash/flatten.js +16 -0
  87. package/dist/node_modules/lodash/isMap.js +14 -0
  88. package/dist/node_modules/lodash/isPlainObject.js +23 -0
  89. package/dist/node_modules/lodash/isSet.js +14 -0
  90. package/dist/node_modules/lodash/keysIn.js +17 -0
  91. package/dist/node_modules/lodash/last.js +14 -0
  92. package/dist/node_modules/lodash/omit.js +30 -0
  93. package/dist/node_modules/memoize-one/dist/memoize-one.esm.js +28 -0
  94. package/dist/node_modules/react-window/dist/index.esm.js +375 -0
  95. package/dist/node_modules/style-to-object/cjs/index.js +1 -1
  96. package/dist/styles.css +1 -1
  97. package/package.json +8 -1
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ var e = { exports: {} };
3
+ export {
4
+ e as __module
5
+ };
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
3
+ import { __require as e } from "../node_modules/dayjs/dayjs.min.js";
4
+ var t = e();
5
+ const a = /* @__PURE__ */ r(t);
6
+ export {
7
+ a as default
8
+ };
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ var e = { exports: {} };
3
+ export {
4
+ e as __module
5
+ };
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
3
+ import { __require as r } from "../node_modules/lodash/debounce.js";
4
+ var o = r();
5
+ const s = /* @__PURE__ */ e(o);
6
+ export {
7
+ s as default
8
+ };
@@ -1,5 +1,8 @@
1
1
  "use client";
2
- var e = {};
2
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
3
+ import { __require as e } from "../node_modules/classnames/index.js";
4
+ var s = e();
5
+ const o = /* @__PURE__ */ r(s);
3
6
  export {
4
- e as __exports
7
+ o as default
5
8
  };
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ var e = {};
3
+ export {
4
+ e as __exports
5
+ };
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ var e = { exports: {} };
3
+ export {
4
+ e as __module
5
+ };
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
3
+ import { __require as o } from "../node_modules/dayjs/plugin/localizedFormat.js";
4
+ var e = o();
5
+ const i = /* @__PURE__ */ r(e);
6
+ export {
7
+ i as default
8
+ };
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ var e = { exports: {} };
3
+ export {
4
+ e as __module
5
+ };
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
3
+ import { __require as t } from "../node_modules/lodash/omit.js";
4
+ var o = t();
5
+ const m = /* @__PURE__ */ r(o);
6
+ export {
7
+ m as default
8
+ };
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ import { j as e } from "../../../../../_virtual/jsx-runtime.js";
3
+ const n = ({ className: l }) => /* @__PURE__ */ e.jsxs(
4
+ "svg",
5
+ {
6
+ className: l,
7
+ width: "24px",
8
+ height: "24px",
9
+ viewBox: "0 0 24 24",
10
+ fill: "none",
11
+ xmlns: "http://www.w3.org/2000/svg",
12
+ children: [
13
+ /* @__PURE__ */ e.jsx(
14
+ "path",
15
+ {
16
+ fillRule: "evenodd",
17
+ clipRule: "evenodd",
18
+ d: "M16.436 22.5H7.064C3.437 22.5 1 19.954 1 16.165V7.335C1 3.546 3.437 1 7.064 1H16.436C20.063 1 22.5 3.546 22.5 7.335V16.165C22.5 19.954 20.063 22.5 16.436 22.5Z",
19
+ fill: "var(--gantt-control-element-bg)"
20
+ }
21
+ ),
22
+ /* @__PURE__ */ e.jsx(
23
+ "path",
24
+ {
25
+ fillRule: "evenodd",
26
+ clipRule: "evenodd",
27
+ d: "M15.417 12.4902H8.08398C7.66898 12.4902 7.33398 12.1542 7.33398 11.7402C7.33398 11.3262 7.66898 10.9902 8.08398 10.9902H15.417C15.831 10.9902 16.167 11.3262 16.167 11.7402C16.167 12.1542 15.831 12.4902 15.417 12.4902Z",
28
+ fill: "var(--gantt-text-color)"
29
+ }
30
+ )
31
+ ]
32
+ }
33
+ );
34
+ export {
35
+ n as MinusSquareOutlined
36
+ };
@@ -0,0 +1,45 @@
1
+ "use client";
2
+ import { j as e } from "../../../../../_virtual/jsx-runtime.js";
3
+ const o = ({ className: l }) => /* @__PURE__ */ e.jsxs(
4
+ "svg",
5
+ {
6
+ className: l,
7
+ width: "24px",
8
+ height: "24px",
9
+ viewBox: "0 0 24 24",
10
+ fill: "none",
11
+ xmlns: "http://www.w3.org/2000/svg",
12
+ children: [
13
+ /* @__PURE__ */ e.jsx(
14
+ "path",
15
+ {
16
+ fillRule: "evenodd",
17
+ clipRule: "evenodd",
18
+ d: "M16.436 22.5H7.064C3.437 22.5 1 19.954 1 16.165V7.335C1 3.546 3.437 1 7.064 1H16.436C20.063 1 22.5 3.546 22.5 7.335V16.165C22.5 19.954 20.063 22.5 16.436 22.5Z",
19
+ fill: "var(--gantt-control-element-bg)"
20
+ }
21
+ ),
22
+ /* @__PURE__ */ e.jsx(
23
+ "path",
24
+ {
25
+ fillRule: "evenodd",
26
+ clipRule: "evenodd",
27
+ d: "M11.75 16.1541C11.336 16.1541 11 15.8181 11 15.4041V8.07715C11 7.66315 11.336 7.32715 11.75 7.32715C12.164 7.32715 12.5 7.66315 12.5 8.07715V15.4041C12.5 15.8181 12.164 16.1541 11.75 16.1541Z",
28
+ fill: "var(--gantt-text-color)"
29
+ }
30
+ ),
31
+ /* @__PURE__ */ e.jsx(
32
+ "path",
33
+ {
34
+ fillRule: "evenodd",
35
+ clipRule: "evenodd",
36
+ d: "M15.417 12.4902H8.08398C7.66898 12.4902 7.33398 12.1542 7.33398 11.7402C7.33398 11.3262 7.66898 10.9902 8.08398 10.9902H15.417C15.831 10.9902 16.167 11.3262 16.167 11.7402C16.167 12.1542 15.831 12.4902 15.417 12.4902Z",
37
+ fill: "var(--gantt-text-color)"
38
+ }
39
+ )
40
+ ]
41
+ }
42
+ );
43
+ export {
44
+ o as PlusSquareOutlined
45
+ };
@@ -0,0 +1,115 @@
1
+ "use client";
2
+ import { j as T } from "../../../../../../_virtual/jsx-runtime.js";
3
+ import { forwardRef as A, useContext as F, useMemo as E, useCallback as C } from "react";
4
+ import { DndContext as L } from "../../../../../../node_modules/@dnd-kit/core/dist/core.esm.js";
5
+ import { createSnapModifier as N, restrictToHorizontalAxis as K } from "../../../../../../node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js";
6
+ import p from "../../../../../../_virtual/dayjs.min.js";
7
+ import { VariableSizeList as O } from "../../../../../../node_modules/react-window/dist/index.esm.js";
8
+ import { GanttContext as B } from "../../Gantt/GanttContext.js";
9
+ /* empty css */
10
+ import { getWholeWidth as V } from "../../../utils/getWholeWidth.js";
11
+ import q from "./BarsRow/BarsRow.js";
12
+ import { GanttConsts as J } from "../../../constants/GanttConsts.js";
13
+ import { DragTypes as u } from "../../../enums/DragTypes.js";
14
+ const Q = ({ scaleWidth: h, style: D, children: c, ...x }) => /* @__PURE__ */ T.jsx("div", { style: { ...D, width: h, position: "relative" }, ...x, children: c }), U = A(
15
+ ({ width: h, height: D, data: c, setData: x, onBarDoubleClick: P, onBarChange: y }, W) => {
16
+ const { settings: n, scaleDates: S } = F(B), v = E(() => V(
17
+ S,
18
+ n.dimension,
19
+ n.scaleStepItems,
20
+ n.stepWidth
21
+ ), [S, n.dimension, n.scaleStepItems, n.stepWidth]), H = E(() => N(n.gridSize), [n.gridSize]), I = E(() => {
22
+ const l = [];
23
+ for (const o of c)
24
+ o.hasOwnProperty("expanded") && !o.expanded && l.push(o.key);
25
+ return c.filter((o) => !o.parentsKeys.some((m) => l.includes(m)));
26
+ }, [c]), _ = C(() => J.ROW_HEIGHT, []), Z = C(
27
+ (l) => {
28
+ var R, b, j, G, M, g, z, k;
29
+ const o = l.delta.x * n.secondsInPixel, i = 3600 * 24, m = n.gridSize * n.secondsInPixel, w = [...c], t = w.find((a) => a.key === l.active.id), r = l.activatorEvent.target;
30
+ if ((R = t == null ? void 0 : t.data) != null && R.repeatType && +((b = r == null ? void 0 : r.dataset) == null ? void 0 : b.dragtype) === u.RESIZE_RIGHT) {
31
+ const { fromTime: a, toTime: s } = t.data;
32
+ let e = s + o;
33
+ s > a && e - a >= i || s < a && e > a ? e = a - 1 : s > a && e < a || s < a && a - e >= i ? e = a + m : e < 0 ? e = e + i : e >= i && (e = e - i), t.data.toTime = Math.round(e);
34
+ }
35
+ if ((j = t == null ? void 0 : t.data) != null && j.repeatType && +((G = r == null ? void 0 : r.dataset) == null ? void 0 : G.dragtype) === u.RESIZE_LEFT) {
36
+ const { fromTime: a, toTime: s } = t.data;
37
+ let e = a + o;
38
+ a < s && s - e >= i || a > s && e < s ? e = s + 1 : a < s && e > s || a > s && e - s >= i ? e = s - m : e < 0 ? e = e + i : e >= i && (e = e - i), t.data.fromTime = Math.round(e);
39
+ }
40
+ if ((M = t == null ? void 0 : t.data) != null && M.repeatType && +((g = r == null ? void 0 : r.dataset) == null ? void 0 : g.dragtype) === u.DRAG) {
41
+ const { fromTime: a, toTime: s } = t.data;
42
+ let e = a + o, d = s + o;
43
+ for (; e < 0; )
44
+ e = e + i;
45
+ for (; d < 0; )
46
+ d = d + i;
47
+ for (; e >= i; )
48
+ e = e - i;
49
+ for (; d >= i; )
50
+ d = d - i;
51
+ t.data.fromTime = Math.round(e), t.data.toTime = Math.round(d);
52
+ }
53
+ if (t != null && t.data && !((z = t == null ? void 0 : t.data) != null && z.repeatType)) {
54
+ const { startDate: a, endDate: s } = t.data;
55
+ if (a && s) {
56
+ const e = p(a).unix(), d = p(s).unix();
57
+ switch (+((k = r == null ? void 0 : r.dataset) == null ? void 0 : k.dragtype)) {
58
+ case u.RESIZE_LEFT: {
59
+ let f = e + o;
60
+ d - f < m && (f = d - m), t.data.startDate = p.unix(f).format();
61
+ break;
62
+ }
63
+ case u.RESIZE_RIGHT: {
64
+ let f = d + o;
65
+ f - e < m && (f = e + m), t.data.endDate = p.unix(f).format();
66
+ break;
67
+ }
68
+ case u.DRAG: {
69
+ t.data.startDate = p.unix(Math.round(e + o)).format(), t.data.endDate = p.unix(Math.round(d + o)).format();
70
+ break;
71
+ }
72
+ }
73
+ }
74
+ }
75
+ y && y(t, w), x(w);
76
+ },
77
+ [c, y, x, n.gridSize, n.secondsInPixel]
78
+ );
79
+ return /* @__PURE__ */ T.jsx("div", { className: "gantt-bars-wrap", children: /* @__PURE__ */ T.jsx(
80
+ L,
81
+ {
82
+ modifiers: [K, H],
83
+ onDragEnd: Z,
84
+ autoScroll: !1,
85
+ children: /* @__PURE__ */ T.jsx(
86
+ O,
87
+ {
88
+ ref: W,
89
+ className: "gantt-bars-list",
90
+ layout: "vertical",
91
+ width: h,
92
+ height: D,
93
+ itemCount: I.length,
94
+ itemSize: _,
95
+ itemData: I,
96
+ innerElementType: (l) => /* @__PURE__ */ T.jsx(Q, { scaleWidth: v, ...l }),
97
+ children: ({ style: l, data: o, index: i }) => /* @__PURE__ */ T.jsx(
98
+ q,
99
+ {
100
+ barData: o[i],
101
+ index: i,
102
+ style: l,
103
+ onBarDoubleClick: P
104
+ }
105
+ )
106
+ }
107
+ )
108
+ }
109
+ ) });
110
+ }
111
+ );
112
+ U.displayName = "Bars";
113
+ export {
114
+ U as default
115
+ };
@@ -0,0 +1,158 @@
1
+ "use client";
2
+ import { j as t } from "../../../../../../../../_virtual/jsx-runtime.js";
3
+ import { memo as $, useContext as S, useMemo as l, useCallback as b } from "react";
4
+ import { useDraggable as W } from "../../../../../../../../node_modules/@dnd-kit/core/dist/core.esm.js";
5
+ import v from "../../../../../../../../_virtual/dayjs.min.js";
6
+ import { cn as E } from "../../../../../../../../lib/utils.js";
7
+ import { TooltipProvider as H, Tooltip as X, TooltipTrigger as B, TooltipContent as M } from "../../../../../../tooltip.js";
8
+ import { BarsRowContext as O } from "../BarsRowContext.js";
9
+ import { GanttContext as U } from "../../../../Gantt/GanttContext.js";
10
+ import { DragTypes as n } from "../../../../../enums/DragTypes.js";
11
+ let y;
12
+ const q = $(
13
+ ({ title: D, barKey: G, startDate: d, endDate: m, repetead: P, onBarDoubleClick: I, leftRender: p }) => {
14
+ const { scaleDates: R, settings: o } = S(U), { barData: h } = S(O), e = o.draggable === !0, { attributes: j, listeners: a, transform: g, activatorEvent: c, setNodeRef: L, setActivatorNodeRef: N } = W({
15
+ id: G,
16
+ disabled: !e
17
+ }), x = l(() => (m - d) / o.secondsInPixel, [m, o.secondsInPixel, d]), T = l(() => P ? (24 * 3600 - 1) / o.secondsInPixel : 0, [P, o.secondsInPixel]), A = l(() => (d - R[0]) / o.secondsInPixel, [R, o.secondsInPixel, d]), i = l(() => {
18
+ var f;
19
+ const s = c == null ? void 0 : c.target;
20
+ return +((f = s == null ? void 0 : s.dataset) == null ? void 0 : f.dragtype);
21
+ }, [c == null ? void 0 : c.target]), r = l(() => {
22
+ if (!g)
23
+ return 0;
24
+ const s = T ? T - x : null, f = o.gridSize - x;
25
+ let u = i === n.RESIZE_LEFT ? -g.x : g.x;
26
+ return u !== 0 && i !== n.DRAG && (s !== null && u > s && (u = s), u < f && (u = f)), u;
27
+ }, [i, T, o.gridSize, x, g]), w = l(() => i === n.DRAG ? x : x + r, [i, r, x]), k = l(() => i === n.DRAG ? `translateX(${r}px)` : `translateX(${i === n.RESIZE_LEFT ? -r : 0}px)`, [i, r]), C = l(() => {
28
+ const s = [n.RESIZE_LEFT, n.DRAG].includes(i) ? r * o.secondsInPixel : 0;
29
+ return v.unix(
30
+ d + (i === n.RESIZE_LEFT ? -s : s)
31
+ ).format("L LTS");
32
+ }, [i, r, o.secondsInPixel, d]), Z = l(() => {
33
+ const s = [n.RESIZE_RIGHT, n.DRAG].includes(i) ? r * o.secondsInPixel : 0;
34
+ return v.unix(m + s).format("L LTS");
35
+ }, [i, r, m, o.secondsInPixel]), _ = b(() => {
36
+ I && I(h);
37
+ }, [h, I]), z = b(
38
+ (s) => {
39
+ e && (y = setTimeout(() => {
40
+ a != null && a.onPointerDown && a.onPointerDown(s);
41
+ }, 200));
42
+ },
43
+ [a, e]
44
+ ), F = b(() => {
45
+ y && clearTimeout(y);
46
+ }, []);
47
+ return /* @__PURE__ */ t.jsx(H, { children: /* @__PURE__ */ t.jsxs(X, { children: [
48
+ /* @__PURE__ */ t.jsx(B, { asChild: !0, children: /* @__PURE__ */ t.jsx(
49
+ "div",
50
+ {
51
+ className: "absolute flex items-center z-10",
52
+ style: {
53
+ height: "40px",
54
+ top: 0,
55
+ left: A,
56
+ width: w,
57
+ transform: k
58
+ },
59
+ ref: L,
60
+ children: /* @__PURE__ */ t.jsxs(
61
+ "div",
62
+ {
63
+ className: "flex justify-between items-center w-full h-6 rounded px-0.5 text-white",
64
+ "data-dragtype": n.DRAG,
65
+ ...e ? a : {},
66
+ ...e ? j : {},
67
+ onPointerDown: z,
68
+ onPointerUp: F,
69
+ onDoubleClick: _,
70
+ style: {
71
+ backgroundColor: h.color,
72
+ ...e ? {} : { cursor: "default" }
73
+ },
74
+ children: [
75
+ e && /* @__PURE__ */ t.jsxs(
76
+ "div",
77
+ {
78
+ className: E(
79
+ "flex-shrink-0 flex justify-between w-2.5 h-full rounded bg-black/25 cursor-w-resize",
80
+ w < 25 && "hidden group-hover:flex"
81
+ ),
82
+ ref: e ? N : void 0,
83
+ "data-dragtype": n.RESIZE_LEFT,
84
+ ...e ? a : {},
85
+ ...e ? j : {},
86
+ style: {
87
+ ...e ? {} : { cursor: "default", pointerEvents: "none" }
88
+ },
89
+ children: [
90
+ /* @__PURE__ */ t.jsx("span", { className: "w-0.5 h-full bg-white/60" }),
91
+ /* @__PURE__ */ t.jsx("span", { className: "w-0.5 h-full bg-white/60" })
92
+ ]
93
+ }
94
+ ),
95
+ /* @__PURE__ */ t.jsxs(
96
+ "div",
97
+ {
98
+ className: E(
99
+ "px-2 overflow-hidden whitespace-nowrap text-ellipsis select-none flex items-center gap-2",
100
+ w < 100 && "hidden"
101
+ ),
102
+ "data-dragtype": n.DRAG,
103
+ children: [
104
+ p && /* @__PURE__ */ t.jsx(
105
+ "div",
106
+ {
107
+ className: "flex-shrink-0",
108
+ onClick: (s) => {
109
+ s.stopPropagation();
110
+ },
111
+ children: typeof p == "function" ? p(h) : p
112
+ }
113
+ ),
114
+ /* @__PURE__ */ t.jsx("div", { className: "overflow-hidden text-ellipsis whitespace-nowrap", children: D })
115
+ ]
116
+ }
117
+ ),
118
+ e && /* @__PURE__ */ t.jsxs(
119
+ "div",
120
+ {
121
+ className: E(
122
+ "flex-shrink-0 flex justify-between w-2.5 h-full rounded bg-black/25 cursor-e-resize",
123
+ w < 25 && "hidden group-hover:flex"
124
+ ),
125
+ ref: e ? N : void 0,
126
+ "data-dragtype": n.RESIZE_RIGHT,
127
+ ...e ? a : {},
128
+ ...e ? j : {},
129
+ style: {
130
+ ...e ? {} : { cursor: "default", pointerEvents: "none" }
131
+ },
132
+ children: [
133
+ /* @__PURE__ */ t.jsx("span", { className: "w-0.5 h-full bg-white/60" }),
134
+ /* @__PURE__ */ t.jsx("span", { className: "w-0.5 h-full bg-white/60" })
135
+ ]
136
+ }
137
+ )
138
+ ]
139
+ }
140
+ )
141
+ }
142
+ ) }),
143
+ /* @__PURE__ */ t.jsx(
144
+ M,
145
+ {
146
+ side: "top",
147
+ className: "min-w-max text-xs",
148
+ sideOffset: 5,
149
+ children: `${C} → ${Z}`
150
+ }
151
+ )
152
+ ] }) });
153
+ }
154
+ );
155
+ q.displayName = "BarItem";
156
+ export {
157
+ q as default
158
+ };
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ import { j as f } from "../../../../../../../../_virtual/jsx-runtime.js";
3
+ import { useContext as l, useMemo as n } from "react";
4
+ import i from "../../../../../../../../_virtual/dayjs.min.js";
5
+ import { GanttContext as I } from "../../../../Gantt/GanttContext.js";
6
+ import j from "../RepeteadBars/RepeteadBars.js";
7
+ import R from "../BarItem/BarItem.js";
8
+ const G = ({ data: e, title: s, barKey: o, leftRender: D, onBarDoubleClick: m }) => {
9
+ const { scaleDates: r, scaleRenderState: t } = l(I), u = n(() => r[t.overscanStartIndex], [r, t.overscanStartIndex]), p = n(() => r[t.overscanStopIndex], [r, t.overscanStopIndex]), x = n(() => i(e == null ? void 0 : e.startDate).unix(), [e == null ? void 0 : e.startDate]), c = n(() => i(e == null ? void 0 : e.endDate).unix(), [e == null ? void 0 : e.endDate]);
10
+ return e ? e.repeatType ? /* @__PURE__ */ f.jsx(
11
+ j,
12
+ {
13
+ data: e,
14
+ firstRenderedDate: u,
15
+ lastRenderedDate: p,
16
+ title: s,
17
+ barKey: o,
18
+ onBarDoubleClick: m
19
+ }
20
+ ) : x > p || c < u ? null : /* @__PURE__ */ f.jsx(
21
+ R,
22
+ {
23
+ title: s,
24
+ barKey: o,
25
+ startDate: x,
26
+ endDate: c,
27
+ repetead: !1,
28
+ leftRender: D,
29
+ onBarDoubleClick: m
30
+ },
31
+ e.startDate
32
+ ) : null;
33
+ };
34
+ export {
35
+ G as default
36
+ };
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import { j as e } from "../../../../../../../_virtual/jsx-runtime.js";
3
+ import { useContext as m, useMemo as p } from "react";
4
+ import { BarsRowContext as a } from "./BarsRowContext.js";
5
+ import { GanttContext as d } from "../../../Gantt/GanttContext.js";
6
+ /* empty css */
7
+ import l from "./BarsItems/BarItems.js";
8
+ const h = ({ barData: t, index: r, style: o, onBarDoubleClick: n }) => {
9
+ const { settings: s } = m(d), i = p(() => ({
10
+ ...o,
11
+ backgroundImage: `repeating-linear-gradient(to right, var(--border) 0px 1px, ${r % 2 === 0 ? "var(--background)" : "var(--muted)"} 1px ${s.stepWidth}px`
12
+ }), [r, s.stepWidth, o]);
13
+ return /* @__PURE__ */ e.jsx(a.Provider, { value: { barData: t }, children: /* @__PURE__ */ e.jsx("div", { className: "gantt-bars-row-wrap", style: i, children: /* @__PURE__ */ e.jsx(
14
+ l,
15
+ {
16
+ data: t.data,
17
+ title: t.title,
18
+ barKey: t.key,
19
+ leftRender: t.leftRender,
20
+ onBarDoubleClick: n
21
+ }
22
+ ) }) });
23
+ };
24
+ export {
25
+ h as default
26
+ };
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ import { createContext as e } from "react";
3
+ const o = e({
4
+ barData: {
5
+ key: "",
6
+ title: "",
7
+ level: 0,
8
+ parentsKeys: [""],
9
+ color: ""
10
+ }
11
+ });
12
+ export {
13
+ o as BarsRowContext
14
+ };
@@ -0,0 +1,75 @@
1
+ "use client";
2
+ import { j as c } from "../../../../../../../../_virtual/jsx-runtime.js";
3
+ import { useMemo as f } from "react";
4
+ import u from "../../../../../../../../_virtual/dayjs.min.js";
5
+ import { GanttConsts as p } from "../../../../../constants/GanttConsts.js";
6
+ import { DataRepeatTypes as D } from "../../../../../enums/DataRepeatTimes.js";
7
+ import E from "../BarItem/BarItem.js";
8
+ const I = ({
9
+ data: o,
10
+ firstRenderedDate: t,
11
+ lastRenderedDate: i,
12
+ title: h,
13
+ barKey: l,
14
+ leftRender: N,
15
+ onBarDoubleClick: S
16
+ }) => {
17
+ const s = f(() => {
18
+ if (!t)
19
+ return null;
20
+ const e = o.fromDate ? u(o.fromDate).unix() : t;
21
+ return e > t ? e : t;
22
+ }, [o.fromDate, t]), m = f(() => {
23
+ if (!i)
24
+ return null;
25
+ const e = o.toDate ? u(o.toDate).unix() : i;
26
+ return e < i ? e : i;
27
+ }, [o.toDate, i]), n = f(() => o.toTime < o.fromTime ? o.toTime + p.SECONDS_IN_DAY - o.fromTime : o.toTime - o.fromTime, [o.fromTime, o.toTime]), _ = f(() => {
28
+ var T, x;
29
+ if (!s || !m || !n)
30
+ return [];
31
+ const e = [];
32
+ let r = u.unix(s).startOf("day").add(o.fromTime, "seconds").unix();
33
+ switch (o.repeatType) {
34
+ case D.DAY: {
35
+ for (; r <= m; )
36
+ e.push({
37
+ startDate: r,
38
+ endDate: r + n
39
+ }), r = r + p.SECONDS_IN_DAY;
40
+ break;
41
+ }
42
+ case D.WEEK:
43
+ for (; r <= m; )
44
+ (T = o.weekdays) != null && T.includes(+u.unix(r).format("d")) && e.push({
45
+ startDate: r,
46
+ endDate: r + n
47
+ }), r = r + p.SECONDS_IN_DAY;
48
+ break;
49
+ case D.MONTH:
50
+ for (; r <= m; )
51
+ (x = o.monthdays) != null && x.includes(+u.unix(r).format("D")) && e.push({
52
+ startDate: r,
53
+ endDate: r + n
54
+ }), r = r + p.SECONDS_IN_DAY;
55
+ break;
56
+ }
57
+ return e;
58
+ }, [o, n, s, m]);
59
+ return !s || !m ? null : /* @__PURE__ */ c.jsx(c.Fragment, { children: _.map(({ startDate: e, endDate: r }) => /* @__PURE__ */ c.jsx(
60
+ E,
61
+ {
62
+ title: h,
63
+ barKey: l,
64
+ startDate: e,
65
+ endDate: r,
66
+ repetead: !0,
67
+ leftRender: N,
68
+ onBarDoubleClick: S
69
+ },
70
+ l + e
71
+ )) });
72
+ };
73
+ export {
74
+ I as default
75
+ };
@@ -0,0 +1,66 @@
1
+ "use client";
2
+ import { j as s } from "../../../../../_virtual/jsx-runtime.js";
3
+ import { useContext as R, useRef as a, useState as o, useCallback as _, useMemo as M, useEffect as m } from "react";
4
+ import N from "../../../../../_virtual/index5.js";
5
+ import k from "../../../../../_virtual/debounce.js";
6
+ import { GanttContext as y } from "../Gantt/GanttContext.js";
7
+ /* empty css */
8
+ import { transformData as A } from "../../utils/transformData.js";
9
+ import B from "./Scale/Scale.js";
10
+ import F from "./Tree/Tree.js";
11
+ import O from "./Bars/Bars.js";
12
+ import { GanttConsts as u } from "../../constants/GanttConsts.js";
13
+ import { GanttDimensionsSettings as P } from "../../constants/DimensionsSettings.js";
14
+ const w = ({ data: f, className: H, onBarDoubleClick: S, onBarChange: W }) => {
15
+ const { settings: n, scaleDates: c, wrapRef: t, setCurrentDate: d } = R(y), h = a(null), T = a(null), g = a(null), [p, i] = o([]), [l, I] = o(!0), [D, b] = o(0), [x, G] = o(0), E = _(() => {
16
+ var r;
17
+ const e = Math.round(
18
+ ((((r = t == null ? void 0 : t.current) == null ? void 0 : r.scrollLeft) || 0) + u.TREE_WIDTH) * P[n.dimension].secondsInPixel
19
+ );
20
+ d(c[0] + e);
21
+ }, [c, d, n.dimension, t]), L = M(() => k(E, 100), [E]);
22
+ return m(() => {
23
+ var e, r;
24
+ (e = t == null ? void 0 : t.current) != null && e.clientWidth && ((r = t == null ? void 0 : t.current) != null && r.clientHeight) && (b(t.current.clientWidth - u.TREE_WIDTH), G(t.current.clientHeight - u.HEADER_HEIGHT), I(!1));
25
+ }, []), m(() => {
26
+ !l && t.current && (t.current.scrollLeft = n.initialScrollOffset);
27
+ }, [l]), m(() => {
28
+ i(A(f));
29
+ }, [f]), /* @__PURE__ */ s.jsx(
30
+ "div",
31
+ {
32
+ className: N("gantt-chart-wrap", H),
33
+ ref: t,
34
+ onScroll: (e) => {
35
+ var r, j, C;
36
+ (r = g.current) == null || r.scrollTo(e.currentTarget.scrollTop), (j = T.current) == null || j.scrollTo(e.currentTarget.scrollTop), (C = h.current) == null || C.scrollTo(e.currentTarget.scrollLeft), L();
37
+ },
38
+ children: l ? /* @__PURE__ */ s.jsx(
39
+ "div",
40
+ {
41
+ style: {
42
+ width: n.scaleStepItems * n.stepWidth * c.length
43
+ }
44
+ }
45
+ ) : /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
46
+ /* @__PURE__ */ s.jsx(B, { width: D, wrapRef: t, ref: h }),
47
+ /* @__PURE__ */ s.jsx(F, { height: x, data: p, setData: i, ref: T }),
48
+ /* @__PURE__ */ s.jsx(
49
+ O,
50
+ {
51
+ ref: g,
52
+ data: p,
53
+ setData: i,
54
+ width: D,
55
+ height: x,
56
+ onBarDoubleClick: S,
57
+ onBarChange: W
58
+ }
59
+ )
60
+ ] })
61
+ }
62
+ );
63
+ };
64
+ export {
65
+ w as default
66
+ };