laif-ds 0.1.8 → 0.1.9

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.
@@ -0,0 +1,105 @@
1
+ "use client";
2
+ import { j as a } from "../../_virtual/jsx-runtime.js";
3
+ import { Root as o } from "../../node_modules/@radix-ui/react-slot/dist/index.js";
4
+ import { cn as t } from "../../lib/utils.js";
5
+ import i from "../../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
6
+ import l from "../../node_modules/lucide-react/dist/esm/icons/ellipsis.js";
7
+ function p({ ...r }) {
8
+ return /* @__PURE__ */ a.jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...r });
9
+ }
10
+ function f({ className: r, ...e }) {
11
+ return /* @__PURE__ */ a.jsx(
12
+ "ol",
13
+ {
14
+ "data-slot": "breadcrumb-list",
15
+ className: t(
16
+ "text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
17
+ r
18
+ ),
19
+ ...e
20
+ }
21
+ );
22
+ }
23
+ function x({ className: r, ...e }) {
24
+ return /* @__PURE__ */ a.jsx(
25
+ "li",
26
+ {
27
+ "data-slot": "breadcrumb-item",
28
+ className: t("inline-flex items-center gap-1.5", r),
29
+ ...e
30
+ }
31
+ );
32
+ }
33
+ function j({
34
+ asChild: r,
35
+ className: e,
36
+ ...s
37
+ }) {
38
+ const n = r ? o : "a";
39
+ return /* @__PURE__ */ a.jsx(
40
+ n,
41
+ {
42
+ "data-slot": "breadcrumb-link",
43
+ className: t("hover:text-foreground transition-colors", e),
44
+ ...s
45
+ }
46
+ );
47
+ }
48
+ function g({ className: r, ...e }) {
49
+ return /* @__PURE__ */ a.jsx(
50
+ "span",
51
+ {
52
+ "data-slot": "breadcrumb-page",
53
+ role: "link",
54
+ "aria-disabled": "true",
55
+ "aria-current": "page",
56
+ className: t("text-foreground font-normal", r),
57
+ ...e
58
+ }
59
+ );
60
+ }
61
+ function h({
62
+ children: r,
63
+ className: e,
64
+ ...s
65
+ }) {
66
+ return /* @__PURE__ */ a.jsx(
67
+ "li",
68
+ {
69
+ "data-slot": "breadcrumb-separator",
70
+ role: "presentation",
71
+ "aria-hidden": "true",
72
+ className: t("[&>svg]:size-3.5", e),
73
+ ...s,
74
+ children: r ?? /* @__PURE__ */ a.jsx(i, {})
75
+ }
76
+ );
77
+ }
78
+ function N({
79
+ className: r,
80
+ ...e
81
+ }) {
82
+ return /* @__PURE__ */ a.jsxs(
83
+ "span",
84
+ {
85
+ "data-slot": "breadcrumb-ellipsis",
86
+ role: "presentation",
87
+ "aria-hidden": "true",
88
+ className: t("flex size-9 items-center justify-center", r),
89
+ ...e,
90
+ children: [
91
+ /* @__PURE__ */ a.jsx(l, { className: "size-4" }),
92
+ /* @__PURE__ */ a.jsx("span", { className: "sr-only", children: "More" })
93
+ ]
94
+ }
95
+ );
96
+ }
97
+ export {
98
+ p as Breadcrumb,
99
+ N as BreadcrumbEllipsis,
100
+ x as BreadcrumbItem,
101
+ j as BreadcrumbLink,
102
+ f as BreadcrumbList,
103
+ g as BreadcrumbPage,
104
+ h as BreadcrumbSeparator
105
+ };
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { j as r } from "../../_virtual/jsx-runtime.js";
3
- import { Root as g } from "../../node_modules/@radix-ui/react-slot/dist/index.js";
4
- import { cva as l } from "../../node_modules/class-variance-authority/dist/index.js";
5
- import { cn as u } from "../../lib/utils.js";
3
+ import { Root as l } from "../../node_modules/@radix-ui/react-slot/dist/index.js";
4
+ import { cva as g } from "../../node_modules/class-variance-authority/dist/index.js";
5
+ import { cn as i } from "../../lib/utils.js";
6
6
  import { Icon as c } from "./icon.js";
7
- const v = l(
7
+ const v = g(
8
8
  "cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
9
9
  {
10
10
  variants: {
@@ -30,32 +30,43 @@ const v = l(
30
30
  }
31
31
  );
32
32
  function h({
33
- className: n,
34
- variant: s,
33
+ className: s,
34
+ variant: o,
35
35
  size: e,
36
- asChild: i = !1,
37
- iconLeft: o,
38
- iconRight: a,
36
+ asChild: n = !1,
37
+ iconLeft: a,
38
+ iconRight: d,
39
39
  ...t
40
40
  }) {
41
- const d = i ? g : "button";
42
- return i ? /* @__PURE__ */ r.jsx(
43
- d,
41
+ const u = n ? l : "button";
42
+ return n ? /* @__PURE__ */ r.jsx(
43
+ u,
44
44
  {
45
45
  "data-slot": "button",
46
- className: u(v({ variant: s, size: e, className: n })),
46
+ className: i(v({ variant: o, size: e, className: s })),
47
47
  ...t
48
48
  }
49
49
  ) : /* @__PURE__ */ r.jsxs(
50
- d,
50
+ u,
51
51
  {
52
52
  "data-slot": "button",
53
- className: u(v({ variant: s, size: e, className: n })),
53
+ className: i(v({ variant: o, size: e, className: s }), "relative"),
54
54
  ...t,
55
55
  children: [
56
- o && /* @__PURE__ */ r.jsx(c, { name: o, size: e === "default" ? "md" : e === "sm" ? "xs" : "sm" }),
56
+ /* @__PURE__ */ r.jsx(
57
+ "div",
58
+ {
59
+ className: i(
60
+ "absolute inset-0",
61
+ // "bg-linear-to-r from-primary/50 via-primary/50 to-primary",
62
+ "opacity-40 group-hover:opacity-80",
63
+ "blur-[2.5px] transition-opacity duration-500"
64
+ )
65
+ }
66
+ ),
67
+ a && /* @__PURE__ */ r.jsx(c, { name: a, size: e === "default" ? "md" : e === "sm" ? "xs" : "sm" }),
57
68
  t.children,
58
- a && /* @__PURE__ */ r.jsx(c, { name: a, size: e === "default" ? "md" : e === "sm" ? "xs" : "sm" })
69
+ d && /* @__PURE__ */ r.jsx(c, { name: d, size: e === "default" ? "md" : e === "sm" ? "xs" : "sm" })
59
70
  ]
60
71
  }
61
72
  );
@@ -6,7 +6,6 @@ import { createSnapModifier as N, restrictToHorizontalAxis as K } from "../../..
6
6
  import p from "../../../../../../_virtual/dayjs.min.js";
7
7
  import { VariableSizeList as O } from "../../../../../../node_modules/react-window/dist/index.esm.js";
8
8
  import { GanttContext as B } from "../../Gantt/GanttContext.js";
9
- /* empty css */
10
9
  import { getWholeWidth as V } from "../../../utils/getWholeWidth.js";
11
10
  import q from "./BarsRow/BarsRow.js";
12
11
  import { GanttConsts as J } from "../../../constants/GanttConsts.js";
@@ -1,16 +1,15 @@
1
1
  "use client";
2
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";
3
+ import { useContext as a, useMemo as m } from "react";
4
+ import { BarsRowContext as p } from "./BarsRowContext.js";
5
5
  import { GanttContext as d } from "../../../Gantt/GanttContext.js";
6
- /* empty css */
7
6
  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(() => ({
7
+ const v = ({ barData: t, index: r, style: o, onBarDoubleClick: n }) => {
8
+ const { settings: s } = a(d), i = m(() => ({
10
9
  ...o,
11
10
  backgroundImage: `repeating-linear-gradient(to right, var(--border) 0px 1px, ${r % 2 === 0 ? "var(--background)" : "var(--muted)"} 1px ${s.stepWidth}px`
12
11
  }), [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(
12
+ return /* @__PURE__ */ e.jsx(p.Provider, { value: { barData: t }, children: /* @__PURE__ */ e.jsx("div", { className: "gantt-bars-row-wrap", style: i, children: /* @__PURE__ */ e.jsx(
14
13
  l,
15
14
  {
16
15
  data: t.data,
@@ -22,5 +21,5 @@ const h = ({ barData: t, index: r, style: o, onBarDoubleClick: n }) => {
22
21
  ) }) });
23
22
  };
24
23
  export {
25
- h as default
24
+ v as default
26
25
  };
@@ -1,39 +1,38 @@
1
1
  "use client";
2
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";
3
+ import { useContext as _, useRef as a, useState as o, useCallback as M, useMemo as N, useEffect as u } from "react";
4
+ import k from "../../../../../_virtual/index5.js";
5
+ import y from "../../../../../_virtual/debounce.js";
6
+ import { GanttContext as A } from "../Gantt/GanttContext.js";
7
+ import { transformData as B } from "../../utils/transformData.js";
8
+ import F from "./Scale/Scale.js";
9
+ import O from "./Tree/Tree.js";
10
+ import P from "./Bars/Bars.js";
11
+ import { GanttConsts as m } from "../../constants/GanttConsts.js";
12
+ import { GanttDimensionsSettings as q } from "../../constants/DimensionsSettings.js";
14
13
  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 = _(() => {
14
+ const { settings: n, scaleDates: c, wrapRef: t, setCurrentDate: d, treeTitle: I } = _(A), h = a(null), T = a(null), g = a(null), [D, i] = o([]), [l, b] = o(!0), [p, G] = o(0), [x, L] = o(0), E = M(() => {
16
15
  var r;
17
16
  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
17
+ ((((r = t == null ? void 0 : t.current) == null ? void 0 : r.scrollLeft) || 0) + m.TREE_WIDTH) * q[n.dimension].secondsInPixel
19
18
  );
20
19
  d(c[0] + e);
21
- }, [c, d, n.dimension, t]), L = M(() => k(E, 100), [E]);
22
- return m(() => {
20
+ }, [c, d, n.dimension, t]), R = N(() => y(E, 100), [E]);
21
+ return u(() => {
23
22
  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(() => {
23
+ (e = t == null ? void 0 : t.current) != null && e.clientWidth && ((r = t == null ? void 0 : t.current) != null && r.clientHeight) && (G(t.current.clientWidth - m.TREE_WIDTH), L(t.current.clientHeight - m.HEADER_HEIGHT), b(!1));
24
+ }, []), u(() => {
26
25
  !l && t.current && (t.current.scrollLeft = n.initialScrollOffset);
27
- }, [l]), m(() => {
28
- i(A(f));
26
+ }, [l]), u(() => {
27
+ i(B(f));
29
28
  }, [f]), /* @__PURE__ */ s.jsx(
30
29
  "div",
31
30
  {
32
- className: N("gantt-chart-wrap", H),
31
+ className: k("gantt-chart-wrap", H),
33
32
  ref: t,
34
33
  onScroll: (e) => {
35
34
  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();
35
+ (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), R();
37
36
  },
38
37
  children: l ? /* @__PURE__ */ s.jsx(
39
38
  "div",
@@ -43,15 +42,15 @@ const w = ({ data: f, className: H, onBarDoubleClick: S, onBarChange: W }) => {
43
42
  }
44
43
  }
45
44
  ) : /* @__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 }),
45
+ /* @__PURE__ */ s.jsx(F, { width: p, wrapRef: t, ref: h }),
46
+ /* @__PURE__ */ s.jsx(O, { height: x, data: D, setData: i, ref: T, treeTitle: I }),
48
47
  /* @__PURE__ */ s.jsx(
49
- O,
48
+ P,
50
49
  {
51
50
  ref: g,
52
- data: p,
51
+ data: D,
53
52
  setData: i,
54
- width: D,
53
+ width: p,
55
54
  height: x,
56
55
  onBarDoubleClick: S,
57
56
  onBarChange: W
@@ -4,7 +4,6 @@ import { forwardRef as T, useContext as A, useRef as M, useCallback as u, useEff
4
4
  import c from "../../../../../../_virtual/dayjs.min.js";
5
5
  import { VariableSizeList as O } from "../../../../../../node_modules/react-window/dist/index.esm.js";
6
6
  import { GanttContext as R } from "../../Gantt/GanttContext.js";
7
- /* empty css */
8
7
  import { useForwardRef as _ } from "../../../hooks/useForwardRef.js";
9
8
  import { getScaleItems as v } from "../../../utils/getScaleItems.js";
10
9
  import { GanttDimensions as p } from "../../../enums/GanttDimensions.js";
@@ -1,18 +1,17 @@
1
1
  "use client";
2
2
  import { j as r } from "../../../../../../_virtual/jsx-runtime.js";
3
- import { forwardRef as p, useMemo as u, useCallback as g } from "react";
3
+ import { forwardRef as p, useMemo as g, useCallback as f } from "react";
4
4
  import { VariableSizeList as h } from "../../../../../../node_modules/react-window/dist/index.esm.js";
5
- /* empty css */
6
- import { MinusSquareOutlined as f } from "../../../assets/icons/MinusSquareOutlined.js";
7
- import { PlusSquareOutlined as x } from "../../../assets/icons/PlusSquareOutlined.js";
5
+ import { MinusSquareOutlined as x } from "../../../assets/icons/MinusSquareOutlined.js";
6
+ import { PlusSquareOutlined as E } from "../../../assets/icons/PlusSquareOutlined.js";
8
7
  import { GanttConsts as a } from "../../../constants/GanttConsts.js";
9
- const E = p(({ height: d, data: i, setData: l }, c) => {
10
- const o = u(() => {
8
+ const y = p(({ height: d, data: i, setData: l, treeTitle: c = "Attività" }, m) => {
9
+ const o = g(() => {
11
10
  const n = [];
12
11
  for (const e of i)
13
12
  e.hasOwnProperty("expanded") && !e.expanded && n.push(e.key);
14
13
  return i.filter((e) => !e.parentsKeys.some((s) => n.includes(s)));
15
- }, [i]), m = g(
14
+ }, [i]), u = f(
16
15
  (n) => {
17
16
  const e = [...i], t = e.find((s) => s.key === n);
18
17
  t != null && t.hasOwnProperty("expanded") && (t.expanded = !t.expanded), l(e);
@@ -22,7 +21,7 @@ const E = p(({ height: d, data: i, setData: l }, c) => {
22
21
  return /* @__PURE__ */ r.jsx(
23
22
  "div",
24
23
  {
25
- className: "gantt-tree-wrap bg-background shadow-lg",
24
+ className: "gantt-tree-wrap bg-background",
26
25
  style: {
27
26
  width: a.TREE_WIDTH,
28
27
  marginTop: -a.HEADER_HEIGHT
@@ -30,7 +29,7 @@ const E = p(({ height: d, data: i, setData: l }, c) => {
30
29
  children: /* @__PURE__ */ r.jsx(
31
30
  h,
32
31
  {
33
- ref: c,
32
+ ref: m,
34
33
  className: "gantt-tree-list bg-background",
35
34
  layout: "vertical",
36
35
  width: "100%",
@@ -39,7 +38,7 @@ const E = p(({ height: d, data: i, setData: l }, c) => {
39
38
  itemSize: () => a.ROW_HEIGHT,
40
39
  itemData: o,
41
40
  innerElementType: ({ children: n, props: e }) => /* @__PURE__ */ r.jsxs("div", { style: { height: o.length * a.ROW_HEIGHT }, ...e, children: [
42
- /* @__PURE__ */ r.jsx("div", { className: "gantt-tree-title bg-background", style: { height: a.HEADER_HEIGHT }, children: "Title" }),
41
+ /* @__PURE__ */ r.jsx("div", { className: "gantt-tree-title bg-background", style: { height: a.HEADER_HEIGHT }, children: c }),
43
42
  /* @__PURE__ */ r.jsx("div", { className: "gantt-tree-inner-wrap", children: n })
44
43
  ] }),
45
44
  children: ({ style: n, index: e, data: t }) => {
@@ -53,9 +52,9 @@ const E = p(({ height: d, data: i, setData: l }, c) => {
53
52
  backgroundColor: e % 2 === 0 ? "var(--background)" : "var(--muted)",
54
53
  paddingLeft: a.LEAF_TITLE_PADDING_LEFT + s.level * a.LEAF_CHILDREN_PADDING_LEFT
55
54
  },
56
- onClick: () => m(s.key),
55
+ onClick: () => u(s.key),
57
56
  children: [
58
- s.hasOwnProperty("expanded") ? s.expanded ? /* @__PURE__ */ r.jsx(f, { className: "gantt-tree-icon" }) : /* @__PURE__ */ r.jsx(x, { className: "gantt-tree-icon" }) : null,
57
+ s.hasOwnProperty("expanded") ? s.expanded ? /* @__PURE__ */ r.jsx(x, { className: "gantt-tree-icon" }) : /* @__PURE__ */ r.jsx(E, { className: "gantt-tree-icon" }) : null,
59
58
  /* @__PURE__ */ r.jsx("div", { children: t[e].title })
60
59
  ]
61
60
  }
@@ -66,7 +65,7 @@ const E = p(({ height: d, data: i, setData: l }, c) => {
66
65
  }
67
66
  );
68
67
  });
69
- E.displayName = "Tree";
68
+ y.displayName = "Tree";
70
69
  export {
71
- E as default
70
+ y as default
72
71
  };
@@ -1,64 +1,65 @@
1
1
  "use client";
2
2
  import { j as n } from "../../../../../_virtual/jsx-runtime.js";
3
- import { useContext as V, useState as x, useMemo as p, useCallback as a } from "react";
4
- import G from "../../../../../_virtual/dayjs.min.js";
5
- import { cn as y } from "../../../../../lib/utils.js";
3
+ import { useContext as V, useState as x, useMemo as p, useCallback as r } from "react";
4
+ import y from "../../../../../_virtual/dayjs.min.js";
5
+ import { cn as G } from "../../../../../lib/utils.js";
6
6
  import { Button as h } from "../../../button.js";
7
7
  import { Select as j, SelectTrigger as f, SelectValue as g, SelectContent as S, SelectItem as v } from "../../../select.js";
8
- import { GanttContext as R } from "../Gantt/GanttContext.js";
9
- import { useGanttCalculate as P } from "../../hooks/useGanttCalculate.js";
8
+ import { GanttContext as P } from "../Gantt/GanttContext.js";
9
+ import { useGanttCalculate as R } from "../../hooks/useGanttCalculate.js";
10
10
  import B from "../../../../../node_modules/lucide-react/dist/esm/icons/chevron-left.js";
11
11
  import E from "../../../../../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
12
- import { GanttDimensions as H } from "../../enums/GanttDimensions.js";
13
- import { GanttDimensionsSettings as l } from "../../constants/DimensionsSettings.js";
12
+ import { GanttDimensionsSettings as o } from "../../constants/DimensionsSettings.js";
14
13
  import { DragStepOptions as d } from "../../constants/DragStepOptions.js";
15
- const Z = ({ className: b }) => {
16
- const { calculate: i } = P(), { settings: r, setSettings: u, currentDate: C } = V(R), [D, c] = x(H.HOUR), [t, m] = x(0), o = p(() => Object.keys(l).map((e, s) => ({
17
- label: l[e].label,
14
+ const X = ({ className: b }) => {
15
+ const { calculate: i } = R(), { settings: a, setSettings: u, currentDate: C } = V(P), [D, c] = x(a.dimension), [s, m] = x(
16
+ Object.keys(o).findIndex((e) => e === a.dimension)
17
+ ), l = p(() => Object.keys(o).map((e, t) => ({
18
+ label: o[e].label,
18
19
  value: e,
19
- index: s
20
- })), []), z = a(
20
+ index: t
21
+ })), []), z = r(
21
22
  (e) => {
22
- const s = o.findIndex((I) => I.value === e);
23
- c(e), m(s), i(e);
23
+ const t = l.findIndex((w) => w.value === e);
24
+ c(e), m(t), i(e);
24
25
  },
25
- [i, o]
26
- ), N = a(() => {
27
- if (t < o.length - 1) {
28
- const e = Object.keys(l)[t + 1];
29
- c(e), m(t + 1), i(e);
26
+ [i, l]
27
+ ), N = r(() => {
28
+ if (s < l.length - 1) {
29
+ const e = Object.keys(o)[s + 1];
30
+ c(e), m(s + 1), i(e);
30
31
  }
31
- }, [i, o.length, t]), O = a(() => {
32
- if (t > 0) {
33
- const e = Object.keys(l)[t - 1];
34
- c(e), m(t - 1), i(e);
32
+ }, [i, l.length, s]), O = r(() => {
33
+ if (s > 0) {
34
+ const e = Object.keys(o)[s - 1];
35
+ c(e), m(s - 1), i(e);
35
36
  }
36
- }, [i, t]), k = p(() => Object.keys(d).map((e) => ({
37
+ }, [i, s]), k = p(() => Object.keys(d).map((e) => ({
37
38
  label: d[e].label,
38
39
  value: e
39
- })), []), w = a(
40
+ })), []), I = r(
40
41
  (e) => {
41
42
  u(() => {
42
- const s = { ...r };
43
- return s.dragStepSize = e, s.gridSize = d[e].seconds / l[s.dimension].secondsInPixel, s;
43
+ const t = { ...a };
44
+ return t.dragStepSize = e, t.gridSize = d[e].seconds / o[t.dimension].secondsInPixel, t;
44
45
  });
45
46
  },
46
- [u, r]
47
+ [u, a]
47
48
  );
48
- return /* @__PURE__ */ n.jsxs("div", { className: y("flex items-center gap-2 p-4 border-b", b), children: [
49
+ return /* @__PURE__ */ n.jsxs("div", { className: G("flex items-center gap-2 p-4 border-b", b), children: [
49
50
  /* @__PURE__ */ n.jsx(
50
51
  h,
51
52
  {
52
53
  variant: "outline",
53
54
  size: "icon",
54
55
  onClick: O,
55
- disabled: t <= 0,
56
+ disabled: s <= 0,
56
57
  children: /* @__PURE__ */ n.jsx(B, { className: "h-4 w-4" })
57
58
  }
58
59
  ),
59
60
  /* @__PURE__ */ n.jsxs(j, { value: D, onValueChange: z, children: [
60
61
  /* @__PURE__ */ n.jsx(f, { className: "w-[180px]", children: /* @__PURE__ */ n.jsx(g, { placeholder: "Seleziona dimensione" }) }),
61
- /* @__PURE__ */ n.jsx(S, { className: "z-100", children: o.map((e) => /* @__PURE__ */ n.jsx(v, { value: e.value, children: e.label }, e.value)) })
62
+ /* @__PURE__ */ n.jsx(S, { className: "z-100", children: l.map((e) => /* @__PURE__ */ n.jsx(v, { value: e.value, children: e.label }, e.value)) })
62
63
  ] }),
63
64
  /* @__PURE__ */ n.jsx(
64
65
  h,
@@ -66,17 +67,17 @@ const Z = ({ className: b }) => {
66
67
  variant: "outline",
67
68
  size: "icon",
68
69
  onClick: N,
69
- disabled: t >= o.length - 1,
70
+ disabled: s >= l.length - 1,
70
71
  children: /* @__PURE__ */ n.jsx(E, { className: "h-4 w-4" })
71
72
  }
72
73
  ),
73
- /* @__PURE__ */ n.jsx("div", { className: "px-4 text-sm font-medium", children: G.unix(C).format("ddd, ll") }),
74
- /* @__PURE__ */ n.jsxs(j, { value: r.dragStepSize, onValueChange: w, children: [
74
+ /* @__PURE__ */ n.jsx("div", { className: "px-4 text-sm font-medium", children: y.unix(C).format("ddd, ll") }),
75
+ /* @__PURE__ */ n.jsxs(j, { value: a.dragStepSize, onValueChange: I, children: [
75
76
  /* @__PURE__ */ n.jsx(f, { className: "w-[180px]", children: /* @__PURE__ */ n.jsx(g, { placeholder: "Seleziona step" }) }),
76
77
  /* @__PURE__ */ n.jsx(S, { children: k.map((e) => /* @__PURE__ */ n.jsx(v, { value: e.value, children: e.label }, e.value)) })
77
78
  ] })
78
79
  ] });
79
80
  };
80
81
  export {
81
- Z as default
82
+ X as default
82
83
  };
@@ -1,58 +1,69 @@
1
1
  "use client";
2
- import { j as s } from "../../../../../_virtual/jsx-runtime.js";
3
- import { useMemo as n, useRef as O, useState as e } from "react";
4
- import a from "../../../../../_virtual/dayjs.min.js";
5
- import H from "../../../../../_virtual/localizedFormat.js";
6
- import { GanttContext as v } from "./GanttContext.js";
7
- /* empty css */
8
- /* empty css */
9
- /* empty css */
10
- import C from "../Chart/Chart.js";
11
- import U from "../Controls/Controls.js";
12
- import { getScaleDates as h } from "../../utils/getScaleDates.js";
13
- import { getInitialScrollOffset as j } from "../../utils/getInitialScrollOffset.js";
14
- import { GanttDimensions as t } from "../../enums/GanttDimensions.js";
15
- import { DragStepSizes as i } from "../../enums/DragStepSizes.js";
16
- import { GanttConsts as G } from "../../constants/GanttConsts.js";
17
- import { GanttDimensionsSettings as r } from "../../constants/DimensionsSettings.js";
18
- import { DragStepOptions as z } from "../../constants/DragStepOptions.js";
19
- a.extend(H);
20
- const m = ({ children: l, draggable: p = !1 }) => {
21
- const o = n(() => h(), []), c = n(() => j(t.HOUR, o), [o]), S = O(null), [d, f] = e(a().unix()), [x, u] = e(o), [I, R] = e({
22
- stepWidth: r[t.HOUR].stepWidth,
23
- secondsInPixel: r[t.HOUR].secondsInPixel,
24
- scaleStepItems: G.HOURS_IN_DAY,
25
- initialScrollOffset: c,
26
- dimension: t.HOUR,
27
- draggable: p,
28
- dragStepSize: i.THIRTY_MIN,
29
- gridSize: z[i.THIRTY_MIN].seconds / r[t.HOUR].secondsInPixel
30
- }), [D, g] = e({
2
+ import { j as i } from "../../../../../_virtual/jsx-runtime.js";
3
+ import { useMemo as a, useRef as T, useState as e } from "react";
4
+ import p from "../../../../../_virtual/dayjs.min.js";
5
+ import z from "../../../../../_virtual/localizedFormat.js";
6
+ import { GanttContext as H } from "./GanttContext.js";
7
+ import M from "../Chart/Chart.js";
8
+ import N from "../Controls/Controls.js";
9
+ import { GanttDimensions as c } from "../../enums/GanttDimensions.js";
10
+ import { GanttUnitOfTimes as m } from "../../enums/GanttUnitOfTimes.js";
11
+ import { getScaleDates as P } from "../../utils/getScaleDates.js";
12
+ import { getInitialScrollOffset as Y } from "../../utils/getInitialScrollOffset.js";
13
+ import { DragStepSizes as A } from "../../enums/DragStepSizes.js";
14
+ import { GanttConsts as U } from "../../constants/GanttConsts.js";
15
+ import { GanttDimensionsSettings as s } from "../../constants/DimensionsSettings.js";
16
+ import { DragStepOptions as _ } from "../../constants/DragStepOptions.js";
17
+ p.extend(z);
18
+ const l = ({
19
+ children: S,
20
+ draggable: d = !1,
21
+ defaultDimension: t = c.HOUR,
22
+ defaultDragStepSize: n = A.THIRTY_MIN,
23
+ treeTitle: f
24
+ }) => {
25
+ const r = a(() => {
26
+ const o = t === c.DAY ? m.MONTH : m.DAY;
27
+ return P(void 0, void 0, o);
28
+ }, [t]), x = a(() => Y(t, r), [t, r]), I = T(null), [g, u] = e(p().unix()), [v, O] = e(r), [R, C] = e({
29
+ stepWidth: s[t].stepWidth,
30
+ secondsInPixel: s[t].secondsInPixel,
31
+ scaleStepItems: U.HOURS_IN_DAY,
32
+ initialScrollOffset: x,
33
+ dimension: t,
34
+ draggable: d,
35
+ dragStepSize: n,
36
+ gridSize: (() => {
37
+ const o = _[n].seconds, j = s[t].secondsInPixel, D = o / j;
38
+ return Math.max(D, 1);
39
+ })()
40
+ }), [G, h] = e({
31
41
  overscanStartIndex: 0,
32
42
  overscanStopIndex: 0,
33
43
  visibleStartIndex: 0,
34
44
  visibleStopIndex: 0
35
45
  });
36
- return /* @__PURE__ */ s.jsx(
37
- v.Provider,
46
+ return /* @__PURE__ */ i.jsx(
47
+ H.Provider,
38
48
  {
39
49
  value: {
40
- wrapRef: S,
41
- scaleDates: x,
42
- setScaleDates: u,
43
- settings: I,
44
- setSettings: R,
45
- scaleRenderState: D,
46
- setScaleRenderState: g,
47
- currentDate: d,
48
- setCurrentDate: f
50
+ wrapRef: I,
51
+ scaleDates: v,
52
+ setScaleDates: O,
53
+ settings: R,
54
+ setSettings: C,
55
+ scaleRenderState: G,
56
+ setScaleRenderState: h,
57
+ currentDate: g,
58
+ setCurrentDate: u,
59
+ treeTitle: f
49
60
  },
50
- children: /* @__PURE__ */ s.jsx("div", { className: "gantt-wrap", children: l })
61
+ children: /* @__PURE__ */ i.jsx("div", { className: "gantt-wrap", children: S })
51
62
  }
52
63
  );
53
64
  };
54
- m.Chart = C;
55
- m.Controls = U;
65
+ l.Chart = M;
66
+ l.Controls = N;
56
67
  export {
57
- m as default
68
+ l as default
58
69
  };
@@ -2,7 +2,7 @@
2
2
  import { createContext as e } from "react";
3
3
  import { DragStepSizes as t } from "../../enums/DragStepSizes.js";
4
4
  import { GanttDimensions as s } from "../../enums/GanttDimensions.js";
5
- const i = e({
5
+ const a = e({
6
6
  wrapRef: { current: null },
7
7
  scaleDates: [],
8
8
  setScaleDates: () => {
@@ -28,8 +28,9 @@ const i = e({
28
28
  setScaleRenderState: () => {
29
29
  },
30
30
  currentDate: 0,
31
- setCurrentDate: () => 0
31
+ setCurrentDate: () => 0,
32
+ treeTitle: "Attività"
32
33
  });
33
34
  export {
34
- i as GanttContext
35
+ a as GanttContext
35
36
  };