laif-ds 0.1.5 → 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.
- package/dist/_virtual/_cloneBuffer.js +5 -0
- package/dist/_virtual/dayjs.min.js +8 -0
- package/dist/_virtual/dayjs.min2.js +5 -0
- package/dist/_virtual/debounce.js +8 -0
- package/dist/_virtual/index5.js +5 -2
- package/dist/_virtual/index6.js +5 -0
- package/dist/_virtual/index7.js +5 -0
- package/dist/_virtual/localizedFormat.js +8 -0
- package/dist/_virtual/localizedFormat2.js +5 -0
- package/dist/_virtual/omit.js +8 -0
- package/dist/components/ui/data-table.js +122 -0
- package/dist/components/ui/gantt/assets/icons/MinusSquareOutlined.js +36 -0
- package/dist/components/ui/gantt/assets/icons/PlusSquareOutlined.js +45 -0
- package/dist/components/ui/gantt/components/Chart/Bars/Bars.js +115 -0
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarItem/BarItem.js +158 -0
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsItems/BarItems.js +36 -0
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRow.js +26 -0
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRowContext.js +14 -0
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/RepeteadBars/RepeteadBars.js +75 -0
- package/dist/components/ui/gantt/components/Chart/Chart.js +66 -0
- package/dist/components/ui/gantt/components/Chart/Scale/Scale.js +88 -0
- package/dist/components/ui/gantt/components/Chart/Tree/Tree.js +72 -0
- package/dist/components/ui/gantt/components/Controls/Controls.js +82 -0
- package/dist/components/ui/gantt/components/Gantt/Gantt.js +58 -0
- package/dist/components/ui/gantt/components/Gantt/GanttContext.js +35 -0
- package/dist/components/ui/gantt/constants/DimensionsSettings.js +89 -0
- package/dist/components/ui/gantt/constants/DragStepOptions.js +43 -0
- package/dist/components/ui/gantt/constants/GanttConsts.js +17 -0
- package/dist/components/ui/gantt/constants/colors.json.js +106 -0
- package/dist/components/ui/gantt/enums/DataRepeatTimes.js +5 -0
- package/dist/components/ui/gantt/enums/DragStepSizes.js +5 -0
- package/dist/components/ui/gantt/enums/DragTypes.js +5 -0
- package/dist/components/ui/gantt/enums/GanttDimensions.js +5 -0
- package/dist/components/ui/gantt/enums/GanttUnitOfTimes.js +5 -0
- package/dist/components/ui/gantt/hooks/useForwardRef.js +11 -0
- package/dist/components/ui/gantt/hooks/useGanttCalculate.js +30 -0
- package/dist/components/ui/gantt/utils/getInitialScrollOffset.js +11 -0
- package/dist/components/ui/gantt/utils/getScaleDates.js +14 -0
- package/dist/components/ui/gantt/utils/getScaleItems.js +33 -0
- package/dist/components/ui/gantt/utils/getWholeWidth.js +7 -0
- package/dist/components/ui/gantt/utils/transformData.js +36 -0
- package/dist/components/ui/toaster.js +26 -0
- package/dist/dist/_virtual/jsx-runtime.js +6 -0
- package/dist/dist/_virtual/jsx-runtime2.js +5 -0
- package/dist/dist/_virtual/react-jsx-runtime.development.js +5 -0
- package/dist/dist/_virtual/react-jsx-runtime.production.js +5 -0
- package/dist/dist/components/ui/checkbox.js +32 -0
- package/dist/dist/components/ui/scroll-area.js +61 -0
- package/dist/dist/components/ui/table.js +87 -0
- package/dist/dist/lib/utils.js +9 -0
- package/dist/dist/node_modules/@radix-ui/number/dist/index.js +7 -0
- package/dist/dist/node_modules/@radix-ui/primitive/dist/index.js +10 -0
- package/dist/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +136 -0
- package/dist/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +30 -0
- package/dist/dist/node_modules/@radix-ui/react-context/dist/index.js +56 -0
- package/dist/dist/node_modules/@radix-ui/react-direction/dist/index.js +10 -0
- package/dist/dist/node_modules/@radix-ui/react-presence/dist/index.js +72 -0
- package/dist/dist/node_modules/@radix-ui/react-primitive/dist/index.js +32 -0
- package/dist/dist/node_modules/@radix-ui/react-scroll-area/dist/index.js +534 -0
- package/dist/dist/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
- package/dist/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +14 -0
- package/dist/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +33 -0
- package/dist/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +7 -0
- package/dist/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +9 -0
- package/dist/dist/node_modules/@radix-ui/react-use-size/dist/index.js +28 -0
- package/dist/dist/node_modules/clsx/dist/clsx.js +18 -0
- package/dist/dist/node_modules/lucide-react/dist/esm/Icon.js +41 -0
- package/dist/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +28 -0
- package/dist/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +21 -0
- package/dist/dist/node_modules/lucide-react/dist/esm/icons/check.js +13 -0
- package/dist/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +20 -0
- package/dist/dist/node_modules/react/cjs/react-jsx-runtime.development.js +248 -0
- package/dist/dist/node_modules/react/cjs/react-jsx-runtime.production.js +36 -0
- package/dist/dist/node_modules/react/jsx-runtime.js +11 -0
- package/dist/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +2732 -0
- package/dist/index.d.ts +191 -1
- package/dist/index.js +303 -295
- package/dist/laif-ds.css +1 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +8 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +13 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +8 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +9 -0
- package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +57 -0
- package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +2150 -0
- package/dist/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js +27 -0
- package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +184 -0
- package/dist/node_modules/@tanstack/react-table/build/lib/index.js +103 -0
- package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1896 -0
- package/dist/node_modules/classnames/index.js +43 -0
- package/dist/node_modules/dayjs/dayjs.min.js +283 -0
- package/dist/node_modules/dayjs/plugin/localizedFormat.js +30 -0
- package/dist/node_modules/lodash/_arrayEach.js +15 -0
- package/dist/node_modules/lodash/_assignValue.js +17 -0
- package/dist/node_modules/lodash/_baseAssign.js +16 -0
- package/dist/node_modules/lodash/_baseAssignIn.js +16 -0
- package/dist/node_modules/lodash/_baseAssignValue.js +20 -0
- package/dist/node_modules/lodash/_baseClone.js +71 -0
- package/dist/node_modules/lodash/_baseCreate.js +24 -0
- package/dist/node_modules/lodash/_baseIsMap.js +16 -0
- package/dist/node_modules/lodash/_baseIsSet.js +16 -0
- package/dist/node_modules/lodash/_baseKeysIn.js +22 -0
- package/dist/node_modules/lodash/_baseUnset.js +18 -0
- package/dist/node_modules/lodash/_cloneArrayBuffer.js +16 -0
- package/dist/node_modules/lodash/_cloneBuffer.js +20 -0
- package/dist/node_modules/lodash/_cloneDataView.js +16 -0
- package/dist/node_modules/lodash/_cloneRegExp.js +15 -0
- package/dist/node_modules/lodash/_cloneSymbol.js +15 -0
- package/dist/node_modules/lodash/_cloneTypedArray.js +16 -0
- package/dist/node_modules/lodash/_copyArray.js +16 -0
- package/dist/node_modules/lodash/_copyObject.js +22 -0
- package/dist/node_modules/lodash/_copySymbols.js +16 -0
- package/dist/node_modules/lodash/_copySymbolsIn.js +16 -0
- package/dist/node_modules/lodash/_customOmitClone.js +15 -0
- package/dist/node_modules/lodash/_flatRest.js +17 -0
- package/dist/node_modules/lodash/_getAllKeysIn.js +17 -0
- package/dist/node_modules/lodash/_getPrototype.js +12 -0
- package/dist/node_modules/lodash/_getSymbolsIn.js +19 -0
- package/dist/node_modules/lodash/_initCloneArray.js +15 -0
- package/dist/node_modules/lodash/_initCloneByTag.js +49 -0
- package/dist/node_modules/lodash/_initCloneObject.js +17 -0
- package/dist/node_modules/lodash/_nativeKeysIn.js +17 -0
- package/dist/node_modules/lodash/_parent.js +16 -0
- package/dist/node_modules/lodash/flatten.js +16 -0
- package/dist/node_modules/lodash/isMap.js +14 -0
- package/dist/node_modules/lodash/isPlainObject.js +23 -0
- package/dist/node_modules/lodash/isSet.js +14 -0
- package/dist/node_modules/lodash/keysIn.js +17 -0
- package/dist/node_modules/lodash/last.js +14 -0
- package/dist/node_modules/lodash/omit.js +30 -0
- package/dist/node_modules/memoize-one/dist/memoize-one.esm.js +28 -0
- package/dist/node_modules/react-window/dist/index.esm.js +375 -0
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +16 -7
- package/dist/components/ui/sonner.js +0 -23
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
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
|
-
|
|
7
|
+
o as default
|
|
5
8
|
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as e } from "../../_virtual/jsx-runtime.js";
|
|
3
|
+
import { useReactTable as $, flexRender as x } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
4
|
+
import { Checkbox as h } from "../../dist/components/ui/checkbox.js";
|
|
5
|
+
import { ScrollArea as A, ScrollBar as f } from "../../dist/components/ui/scroll-area.js";
|
|
6
|
+
import { Table as H, TableHeader as V, TableRow as a, TableHead as I, TableBody as B, TableCell as n } from "../../dist/components/ui/table.js";
|
|
7
|
+
import E, { useState as c, useEffect as _ } from "react";
|
|
8
|
+
import { getFilteredRowModel as L, getSortedRowModel as W, getPaginationRowModel as q, getCoreRowModel as G } from "../../node_modules/@tanstack/table-core/build/lib/index.js";
|
|
9
|
+
function Z({
|
|
10
|
+
columns: o,
|
|
11
|
+
data: j,
|
|
12
|
+
loading: S = !1,
|
|
13
|
+
loadingComponent: d,
|
|
14
|
+
emptyComponent: b,
|
|
15
|
+
className: R,
|
|
16
|
+
rowSelection: w = {},
|
|
17
|
+
onRowSelectionChange: m,
|
|
18
|
+
checkable: i = !1,
|
|
19
|
+
onCheckedRowsChange: r,
|
|
20
|
+
notFoundMessage: p = "Nessun risultato trovato.",
|
|
21
|
+
loadingMessage: C = "Caricamento in corso..."
|
|
22
|
+
}) {
|
|
23
|
+
var u;
|
|
24
|
+
const [M, N] = c([]), [y, T] = c([]), [k, v] = c({}), [F, z] = c({}), g = m ? w : F, D = m || z, P = E.useMemo(() => i ? [
|
|
25
|
+
{
|
|
26
|
+
id: "select",
|
|
27
|
+
header: ({ table: l }) => /* @__PURE__ */ e.jsx("div", { className: "text-center", children: /* @__PURE__ */ e.jsx(
|
|
28
|
+
h,
|
|
29
|
+
{
|
|
30
|
+
checked: l.getIsAllPageRowsSelected(),
|
|
31
|
+
onCheckedChange: (t) => l.toggleAllPageRowsSelected(!!t),
|
|
32
|
+
"aria-label": "Seleziona tutti"
|
|
33
|
+
}
|
|
34
|
+
) }),
|
|
35
|
+
cell: ({ row: l }) => /* @__PURE__ */ e.jsx("div", { className: "text-center", children: /* @__PURE__ */ e.jsx(
|
|
36
|
+
h,
|
|
37
|
+
{
|
|
38
|
+
checked: l.getIsSelected(),
|
|
39
|
+
onCheckedChange: (t) => l.toggleSelected(!!t),
|
|
40
|
+
"aria-label": "Seleziona riga"
|
|
41
|
+
}
|
|
42
|
+
) }),
|
|
43
|
+
enableSorting: !1,
|
|
44
|
+
enableHiding: !1
|
|
45
|
+
},
|
|
46
|
+
...o
|
|
47
|
+
] : o, [o, i]), s = $({
|
|
48
|
+
data: j,
|
|
49
|
+
columns: P,
|
|
50
|
+
getCoreRowModel: G(),
|
|
51
|
+
getPaginationRowModel: q(),
|
|
52
|
+
onSortingChange: N,
|
|
53
|
+
getSortedRowModel: W(),
|
|
54
|
+
onColumnFiltersChange: T,
|
|
55
|
+
getFilteredRowModel: L(),
|
|
56
|
+
onColumnVisibilityChange: v,
|
|
57
|
+
onRowSelectionChange: D,
|
|
58
|
+
state: {
|
|
59
|
+
sorting: M,
|
|
60
|
+
columnFilters: y,
|
|
61
|
+
columnVisibility: k,
|
|
62
|
+
rowSelection: g
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return _(() => {
|
|
66
|
+
if (r && i) {
|
|
67
|
+
const l = s.getFilteredSelectedRowModel().rows.map((t) => t.original);
|
|
68
|
+
r(l);
|
|
69
|
+
}
|
|
70
|
+
}, [s, r, i, g]), /* @__PURE__ */ e.jsx("div", { className: `w-full ${R}`, children: /* @__PURE__ */ e.jsx("div", { className: "rounded-md border", children: /* @__PURE__ */ e.jsxs(A, { className: "h-full w-full", children: [
|
|
71
|
+
/* @__PURE__ */ e.jsx(f, { orientation: "horizontal" }),
|
|
72
|
+
/* @__PURE__ */ e.jsx(f, { orientation: "vertical" }),
|
|
73
|
+
/* @__PURE__ */ e.jsxs(H, { children: [
|
|
74
|
+
/* @__PURE__ */ e.jsx(V, { children: s.getHeaderGroups().map((l) => /* @__PURE__ */ e.jsx(a, { children: l.headers.map((t) => /* @__PURE__ */ e.jsx(
|
|
75
|
+
I,
|
|
76
|
+
{
|
|
77
|
+
className: `${t.column.columnDef.sticky ? "sticky left-0 z-10 bg-background" : ""}`,
|
|
78
|
+
children: t.isPlaceholder ? null : x(
|
|
79
|
+
t.column.columnDef.header,
|
|
80
|
+
t.getContext()
|
|
81
|
+
)
|
|
82
|
+
},
|
|
83
|
+
t.id
|
|
84
|
+
)) }, l.id)) }),
|
|
85
|
+
/* @__PURE__ */ e.jsx(B, { children: S ? d ? /* @__PURE__ */ e.jsx(a, { children: /* @__PURE__ */ e.jsx(n, { colSpan: 1e3, className: "h-24", children: d }) }) : /* @__PURE__ */ e.jsx(a, { children: /* @__PURE__ */ e.jsx(
|
|
86
|
+
n,
|
|
87
|
+
{
|
|
88
|
+
colSpan: o.length,
|
|
89
|
+
className: "h-24 text-center",
|
|
90
|
+
children: C
|
|
91
|
+
}
|
|
92
|
+
) }) : (u = s.getRowModel().rows) != null && u.length ? s.getRowModel().rows.map((l) => /* @__PURE__ */ e.jsx(
|
|
93
|
+
a,
|
|
94
|
+
{
|
|
95
|
+
"data-state": l.getIsSelected() && "selected",
|
|
96
|
+
children: l.getVisibleCells().map((t) => /* @__PURE__ */ e.jsx(
|
|
97
|
+
n,
|
|
98
|
+
{
|
|
99
|
+
className: `${t.column.columnDef.sticky ? "sticky left-0 z-10 bg-background" : ""}`,
|
|
100
|
+
children: x(
|
|
101
|
+
t.column.columnDef.cell,
|
|
102
|
+
t.getContext()
|
|
103
|
+
)
|
|
104
|
+
},
|
|
105
|
+
t.id
|
|
106
|
+
))
|
|
107
|
+
},
|
|
108
|
+
l.id
|
|
109
|
+
)) : /* @__PURE__ */ e.jsx(a, { children: /* @__PURE__ */ e.jsx(
|
|
110
|
+
n,
|
|
111
|
+
{
|
|
112
|
+
colSpan: o.length,
|
|
113
|
+
className: "h-24 text-center",
|
|
114
|
+
children: b || p
|
|
115
|
+
}
|
|
116
|
+
) }) })
|
|
117
|
+
] })
|
|
118
|
+
] }) }) });
|
|
119
|
+
}
|
|
120
|
+
export {
|
|
121
|
+
Z as DataTable
|
|
122
|
+
};
|
|
@@ -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
|
+
};
|