laif-ds 0.1.31 → 0.1.33
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/components/ui/accordion.js +2 -7
- package/dist/components/ui/alert-dialog.js +10 -37
- package/dist/components/ui/alert.js +1 -5
- package/dist/components/ui/app-multiple-select-dropdown.js +120 -116
- package/dist/components/ui/app-select.js +9 -1
- package/dist/components/ui/app-sidebar.js +9 -23
- package/dist/components/ui/aspect-ratio.js +1 -3
- package/dist/components/ui/async-select.js +80 -64
- package/dist/components/ui/audio-visualizer.js +3 -2
- package/dist/components/ui/button.js +45 -5
- package/dist/components/ui/card.js +7 -2
- package/dist/components/ui/charts/circular.js +1 -1
- package/dist/components/ui/chat-message.js +34 -16
- package/dist/components/ui/chat.js +4 -4
- package/dist/components/ui/command.js +1 -1
- package/dist/components/ui/data-cross-table.js +32 -8
- package/dist/components/ui/data-table.js +45 -44
- package/dist/components/ui/date-picker.js +2 -2
- package/dist/components/ui/dropdown-menu.js +7 -7
- package/dist/components/ui/file-preview.js +9 -9
- package/dist/components/ui/gantt/components/Chart/Bars/Bars.js +25 -3
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarItem/BarItem.js +32 -13
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsItems/BarItems.js +7 -1
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRow.js +6 -1
- package/dist/components/ui/gantt/components/Chart/Chart.js +19 -3
- package/dist/components/ui/gantt/components/Chart/Scale/Scale.js +80 -71
- package/dist/components/ui/gantt/components/Chart/Tree/Tree.js +72 -54
- package/dist/components/ui/gantt/components/Controls/Controls.js +4 -2
- package/dist/components/ui/gantt/hooks/useGanttCalculate.js +11 -1
- package/dist/components/ui/gantt/utils/getWholeWidth.js +4 -1
- package/dist/components/ui/gantt/utils/transformData.js +7 -4
- package/dist/components/ui/input-selector.js +5 -2
- package/dist/components/ui/input.js +41 -46
- package/dist/components/ui/interrupt-prompt.js +2 -2
- package/dist/components/ui/markdown-renderer.js +2 -2
- package/dist/components/ui/message-input.js +12 -10
- package/dist/components/ui/multiple-selector.js +44 -31
- package/dist/components/ui/prompt-suggestions.js +2 -2
- package/dist/components/ui/resizable.js +1 -1
- package/dist/components/ui/select.js +6 -10
- package/dist/components/ui/sidebar.js +27 -19
- package/dist/components/ui/slider.js +103 -89
- package/dist/components/ui/table-skeleton.js +29 -11
- package/dist/components/ui/table.js +4 -1
- package/dist/components/ui/tabs.js +1 -1
- package/dist/components/ui/theme-switcher.js +2 -7
- package/dist/components/ui/typing-indicator.js +4 -4
- package/dist/components/ui/typo.js +1 -8
- package/dist/hooks/use-mobile.js +3 -1
- package/dist/index.d.ts +7 -7
- package/dist/styles.css +1 -1
- package/package.json +3 -1
|
@@ -2,32 +2,33 @@
|
|
|
2
2
|
import { jsx as l, jsxs as d } from "react/jsx-runtime";
|
|
3
3
|
import { useReactTable as _, flexRender as b } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
4
4
|
import j, { useState as i, useEffect as B } from "react";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
import { cn as L } from "../../lib/utils.js";
|
|
6
|
+
import { Checkbox as p } from "./checkbox.js";
|
|
7
|
+
import { Input as E } from "./input.js";
|
|
8
|
+
import { ScrollArea as G, ScrollBar as w } from "./scroll-area.js";
|
|
9
|
+
import { Table as W, TableHeader as q, TableRow as r, TableHead as J, TableBody as K, TableCell as m } from "./table.js";
|
|
10
|
+
import { Skeleton as O } from "./skeleton.js";
|
|
11
|
+
import { getFilteredRowModel as Q, getSortedRowModel as U, getPaginationRowModel as X, getCoreRowModel as Y } from "../../node_modules/@tanstack/table-core/build/lib/index.js";
|
|
12
|
+
function se({
|
|
13
|
+
columns: n,
|
|
13
14
|
data: g,
|
|
14
15
|
loading: C = !1,
|
|
15
16
|
emptyComponent: R,
|
|
16
17
|
className: k,
|
|
17
|
-
rowSelection:
|
|
18
|
+
rowSelection: x = {},
|
|
18
19
|
onRowSelectionChange: u,
|
|
19
|
-
checkable:
|
|
20
|
+
checkable: a = !1,
|
|
20
21
|
onCheckedRowsChange: c,
|
|
21
|
-
notFoundMessage:
|
|
22
|
+
notFoundMessage: y = "Nessun risultato trovato.",
|
|
22
23
|
clientFilter: s = null,
|
|
23
|
-
clientFilterPlaceholder:
|
|
24
|
+
clientFilterPlaceholder: M = "Cerca..."
|
|
24
25
|
}) {
|
|
25
26
|
var h, S;
|
|
26
|
-
const [
|
|
27
|
+
const [N, v] = i([]), [T, z] = i([]), [D, F] = i({}), [V, $] = i({}), f = u ? x : V, A = u || $, H = j.useMemo(() => a ? [
|
|
27
28
|
{
|
|
28
29
|
id: "select",
|
|
29
30
|
header: ({ table: t }) => /* @__PURE__ */ l("div", { className: "text-center", children: /* @__PURE__ */ l(
|
|
30
|
-
|
|
31
|
+
p,
|
|
31
32
|
{
|
|
32
33
|
checked: t.getIsAllPageRowsSelected(),
|
|
33
34
|
onCheckedChange: (e) => t.toggleAllPageRowsSelected(!!e),
|
|
@@ -35,7 +36,7 @@ function re({
|
|
|
35
36
|
}
|
|
36
37
|
) }),
|
|
37
38
|
cell: ({ row: t }) => /* @__PURE__ */ l("div", { className: "text-center", children: /* @__PURE__ */ l(
|
|
38
|
-
|
|
39
|
+
p,
|
|
39
40
|
{
|
|
40
41
|
checked: t.getIsSelected(),
|
|
41
42
|
onCheckedChange: (e) => t.toggleSelected(!!e),
|
|
@@ -45,36 +46,36 @@ function re({
|
|
|
45
46
|
enableSorting: !1,
|
|
46
47
|
enableHiding: !1
|
|
47
48
|
},
|
|
48
|
-
...
|
|
49
|
-
] :
|
|
49
|
+
...n
|
|
50
|
+
] : n, [n, a]), o = _({
|
|
50
51
|
data: g,
|
|
51
52
|
columns: H,
|
|
52
|
-
getCoreRowModel:
|
|
53
|
-
getPaginationRowModel:
|
|
53
|
+
getCoreRowModel: Y(),
|
|
54
|
+
getPaginationRowModel: X(),
|
|
54
55
|
onSortingChange: v,
|
|
55
|
-
getSortedRowModel:
|
|
56
|
-
onColumnFiltersChange:
|
|
57
|
-
getFilteredRowModel:
|
|
58
|
-
onColumnVisibilityChange:
|
|
56
|
+
getSortedRowModel: U(),
|
|
57
|
+
onColumnFiltersChange: z,
|
|
58
|
+
getFilteredRowModel: Q(),
|
|
59
|
+
onColumnVisibilityChange: F,
|
|
59
60
|
onRowSelectionChange: A,
|
|
60
61
|
state: {
|
|
61
|
-
sorting:
|
|
62
|
+
sorting: N,
|
|
62
63
|
columnFilters: T,
|
|
63
|
-
columnVisibility:
|
|
64
|
+
columnVisibility: D,
|
|
64
65
|
rowSelection: f
|
|
65
66
|
}
|
|
66
67
|
});
|
|
67
68
|
return B(() => {
|
|
68
|
-
if (c &&
|
|
69
|
+
if (c && a) {
|
|
69
70
|
const t = o.getFilteredSelectedRowModel().rows.map((e) => e.original);
|
|
70
71
|
c(t);
|
|
71
72
|
}
|
|
72
|
-
}, [o, c,
|
|
73
|
+
}, [o, c, a, f]), /* @__PURE__ */ d("div", { className: L("h-full w-full", k), children: [
|
|
73
74
|
s && /* @__PURE__ */ l("div", { className: "flex items-center py-4", children: /* @__PURE__ */ l(
|
|
74
|
-
|
|
75
|
+
E,
|
|
75
76
|
{
|
|
76
77
|
iconLeft: "Search",
|
|
77
|
-
placeholder:
|
|
78
|
+
placeholder: M ?? "Cerca...",
|
|
78
79
|
value: (h = o.getColumn(s)) == null ? void 0 : h.getFilterValue(),
|
|
79
80
|
onChange: (t) => {
|
|
80
81
|
var e;
|
|
@@ -83,14 +84,14 @@ function re({
|
|
|
83
84
|
className: "max-w-sm"
|
|
84
85
|
}
|
|
85
86
|
) }),
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
/* @__PURE__ */ l(
|
|
88
|
-
/* @__PURE__ */ l(
|
|
89
|
-
/* @__PURE__ */ d(
|
|
90
|
-
/* @__PURE__ */ l(
|
|
91
|
-
|
|
87
|
+
/* @__PURE__ */ d(G, { className: "h-full w-full rounded-md border", children: [
|
|
88
|
+
/* @__PURE__ */ l(w, { orientation: "horizontal" }),
|
|
89
|
+
/* @__PURE__ */ l(w, { orientation: "vertical" }),
|
|
90
|
+
/* @__PURE__ */ d(W, { children: [
|
|
91
|
+
/* @__PURE__ */ l(q, { children: o.getHeaderGroups().map((t) => /* @__PURE__ */ l(r, { children: t.headers.map((e) => /* @__PURE__ */ l(
|
|
92
|
+
J,
|
|
92
93
|
{
|
|
93
|
-
className: `${e.column.columnDef.sticky ? "sticky left-0 z-10
|
|
94
|
+
className: `${e.column.columnDef.sticky ? "bg-d-background sticky left-0 z-10" : ""}`,
|
|
94
95
|
children: e.isPlaceholder ? null : b(
|
|
95
96
|
e.column.columnDef.header,
|
|
96
97
|
e.getContext()
|
|
@@ -98,11 +99,11 @@ function re({
|
|
|
98
99
|
},
|
|
99
100
|
e.id
|
|
100
101
|
)) }, t.id)) }),
|
|
101
|
-
/* @__PURE__ */ l(
|
|
102
|
+
/* @__PURE__ */ l(K, { children: C ? Array.from({ length: g.length || 8 }).map((t, e) => /* @__PURE__ */ l(r, { children: o.getHeaderGroups()[0].headers.map((P, I) => /* @__PURE__ */ l(
|
|
102
103
|
m,
|
|
103
104
|
{
|
|
104
|
-
className: `w-full ${P.column.columnDef.sticky ? "sticky left-0 z-10
|
|
105
|
-
children: /* @__PURE__ */ l(
|
|
105
|
+
className: `w-full ${P.column.columnDef.sticky ? "bg-d-background sticky left-0 z-10" : ""}`,
|
|
106
|
+
children: /* @__PURE__ */ l(O, { className: "h-6 w-full" })
|
|
106
107
|
},
|
|
107
108
|
`skeleton-cell-${e}-${I}`
|
|
108
109
|
)) }, `skeleton-row-${e}`)) : (S = o.getRowModel().rows) != null && S.length ? o.getRowModel().rows.map((t) => /* @__PURE__ */ l(
|
|
@@ -112,7 +113,7 @@ function re({
|
|
|
112
113
|
children: t.getVisibleCells().map((e) => /* @__PURE__ */ l(
|
|
113
114
|
m,
|
|
114
115
|
{
|
|
115
|
-
className: `${e.column.columnDef.sticky ? "sticky left-0 z-10
|
|
116
|
+
className: `${e.column.columnDef.sticky ? "bg-d-background sticky left-0 z-10" : ""}`,
|
|
116
117
|
children: b(
|
|
117
118
|
e.column.columnDef.cell,
|
|
118
119
|
e.getContext()
|
|
@@ -125,15 +126,15 @@ function re({
|
|
|
125
126
|
)) : /* @__PURE__ */ l(r, { children: /* @__PURE__ */ l(
|
|
126
127
|
m,
|
|
127
128
|
{
|
|
128
|
-
colSpan:
|
|
129
|
+
colSpan: n.length,
|
|
129
130
|
className: "h-24 text-center",
|
|
130
|
-
children: R ||
|
|
131
|
+
children: R || y
|
|
131
132
|
}
|
|
132
133
|
) }) })
|
|
133
134
|
] })
|
|
134
|
-
] })
|
|
135
|
+
] })
|
|
135
136
|
] });
|
|
136
137
|
}
|
|
137
138
|
export {
|
|
138
|
-
|
|
139
|
+
se as DataTable
|
|
139
140
|
};
|
|
@@ -30,9 +30,9 @@ function k({
|
|
|
30
30
|
variant: m,
|
|
31
31
|
size: n,
|
|
32
32
|
className: g(
|
|
33
|
-
"
|
|
33
|
+
"border-d-input text-d-foreground hover:bg-d-accent bg-d-transparent ring-offset-background data-[placeholder]:text-d-muted-foreground focus:ring-ring flex items-center justify-between border px-3 py-2 font-normal whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
34
34
|
!o && "text-d-muted-foreground",
|
|
35
|
-
t && "
|
|
35
|
+
t && "cursor-not-allowed opacity-50",
|
|
36
36
|
f,
|
|
37
37
|
n === "sm" && "text-xs",
|
|
38
38
|
n === "lg" && "text-lg"
|
|
@@ -11,7 +11,7 @@ const B = w, E = x, I = s.forwardRef(({ className: e, inset: t, children: o, ...
|
|
|
11
11
|
{
|
|
12
12
|
ref: d,
|
|
13
13
|
className: r(
|
|
14
|
-
"flex cursor-default
|
|
14
|
+
"focus:bg-accent data-[state=open]:bg-accent flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
15
15
|
t && "pl-8",
|
|
16
16
|
e
|
|
17
17
|
),
|
|
@@ -28,7 +28,7 @@ const C = s.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a(
|
|
|
28
28
|
{
|
|
29
29
|
ref: o,
|
|
30
30
|
className: r(
|
|
31
|
-
"
|
|
31
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-[--radix-dropdown-menu-content-transform-origin] overflow-hidden rounded-md border p-1 shadow-lg",
|
|
32
32
|
e
|
|
33
33
|
),
|
|
34
34
|
...t
|
|
@@ -41,7 +41,7 @@ const D = s.forwardRef(({ className: e, sideOffset: t = 4, ...o }, n) => /* @__P
|
|
|
41
41
|
ref: n,
|
|
42
42
|
sideOffset: t,
|
|
43
43
|
className: r(
|
|
44
|
-
"z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-
|
|
44
|
+
"bg-popover text-popover-foreground z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
45
45
|
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
|
|
46
46
|
e
|
|
47
47
|
),
|
|
@@ -54,7 +54,7 @@ const M = s.forwardRef(({ className: e, inset: t, ...o }, n) => /* @__PURE__ */
|
|
|
54
54
|
{
|
|
55
55
|
ref: n,
|
|
56
56
|
className: r(
|
|
57
|
-
"relative flex cursor-default
|
|
57
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
58
58
|
t && "pl-8",
|
|
59
59
|
e
|
|
60
60
|
),
|
|
@@ -67,7 +67,7 @@ const S = s.forwardRef(({ className: e, children: t, checked: o, ...n }, d) => /
|
|
|
67
67
|
{
|
|
68
68
|
ref: d,
|
|
69
69
|
className: r(
|
|
70
|
-
"relative flex cursor-default
|
|
70
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
71
71
|
e
|
|
72
72
|
),
|
|
73
73
|
checked: o,
|
|
@@ -84,7 +84,7 @@ const z = s.forwardRef(({ className: e, children: t, ...o }, n) => /* @__PURE__
|
|
|
84
84
|
{
|
|
85
85
|
ref: n,
|
|
86
86
|
className: r(
|
|
87
|
-
"relative flex cursor-default
|
|
87
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
88
88
|
e
|
|
89
89
|
),
|
|
90
90
|
...o,
|
|
@@ -112,7 +112,7 @@ const T = s.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a(
|
|
|
112
112
|
p,
|
|
113
113
|
{
|
|
114
114
|
ref: o,
|
|
115
|
-
className: r("-mx-1 my-1 h-px
|
|
115
|
+
className: r("bg-muted -mx-1 my-1 h-px", e),
|
|
116
116
|
...t
|
|
117
117
|
}
|
|
118
118
|
));
|
|
@@ -24,16 +24,16 @@ const m = l.forwardRef(
|
|
|
24
24
|
"img",
|
|
25
25
|
{
|
|
26
26
|
alt: `Attachment ${e.name}`,
|
|
27
|
-
className: "grid h-10 w-10 shrink-0 place-items-center rounded-sm border
|
|
27
|
+
className: "bg-d-secondary grid h-10 w-10 shrink-0 place-items-center rounded-sm border object-cover",
|
|
28
28
|
src: URL.createObjectURL(e)
|
|
29
29
|
}
|
|
30
30
|
),
|
|
31
|
-
/* @__PURE__ */ t("span", { className: "
|
|
31
|
+
/* @__PURE__ */ t("span", { className: "text-d-secondary-foreground w-full truncate", children: e.name })
|
|
32
32
|
] }),
|
|
33
33
|
r ? /* @__PURE__ */ t(
|
|
34
34
|
"button",
|
|
35
35
|
{
|
|
36
|
-
className: "absolute -
|
|
36
|
+
className: "bg-d-background absolute -top-2 -right-2 flex h-4 w-4 items-center justify-center rounded-full border",
|
|
37
37
|
type: "button",
|
|
38
38
|
onClick: r,
|
|
39
39
|
"aria-label": "Remove attachment",
|
|
@@ -67,13 +67,13 @@ const u = l.forwardRef(
|
|
|
67
67
|
exit: { opacity: 0, y: "100%" },
|
|
68
68
|
children: [
|
|
69
69
|
/* @__PURE__ */ a("div", { className: "flex w-full items-center space-x-2", children: [
|
|
70
|
-
/* @__PURE__ */ t("div", { className: "grid h-10 w-10 shrink-0 place-items-center rounded-sm border
|
|
71
|
-
/* @__PURE__ */ t("span", { className: "
|
|
70
|
+
/* @__PURE__ */ t("div", { className: "bg-d-secondary grid h-10 w-10 shrink-0 place-items-center rounded-sm border p-0.5", children: /* @__PURE__ */ t("div", { className: "text-d-secondary-foreground h-full w-full overflow-hidden text-[6px] leading-none", children: x || "Loading..." }) }),
|
|
71
|
+
/* @__PURE__ */ t("span", { className: "text-d-secondary-foreground w-full truncate", children: e.name })
|
|
72
72
|
] }),
|
|
73
73
|
r ? /* @__PURE__ */ t(
|
|
74
74
|
"button",
|
|
75
75
|
{
|
|
76
|
-
className: "absolute -
|
|
76
|
+
className: "bg-d-background absolute -top-2 -right-2 flex h-4 w-4 items-center justify-center rounded-full border",
|
|
77
77
|
type: "button",
|
|
78
78
|
onClick: r,
|
|
79
79
|
"aria-label": "Remove attachment",
|
|
@@ -98,13 +98,13 @@ const f = l.forwardRef(
|
|
|
98
98
|
exit: { opacity: 0, y: "100%" },
|
|
99
99
|
children: [
|
|
100
100
|
/* @__PURE__ */ a("div", { className: "flex w-full items-center space-x-2", children: [
|
|
101
|
-
/* @__PURE__ */ t("div", { className: "grid h-10 w-10 shrink-0 place-items-center rounded-sm border
|
|
102
|
-
/* @__PURE__ */ t("span", { className: "
|
|
101
|
+
/* @__PURE__ */ t("div", { className: "bg-d-secondary grid h-10 w-10 shrink-0 place-items-center rounded-sm border", children: /* @__PURE__ */ t(p, { className: "text-d-foreground h-6 w-6" }) }),
|
|
102
|
+
/* @__PURE__ */ t("span", { className: "text-d-secondary-foreground w-full truncate", children: e.name })
|
|
103
103
|
] }),
|
|
104
104
|
r ? /* @__PURE__ */ t(
|
|
105
105
|
"button",
|
|
106
106
|
{
|
|
107
|
-
className: "absolute -
|
|
107
|
+
className: "bg-d-background absolute -top-2 -right-2 flex h-4 w-4 items-center justify-center rounded-full border",
|
|
108
108
|
type: "button",
|
|
109
109
|
onClick: r,
|
|
110
110
|
"aria-label": "Remove attachment",
|
|
@@ -10,18 +10,40 @@ import { getWholeWidth as V } from "../../../utils/getWholeWidth.js";
|
|
|
10
10
|
import q from "./BarsRow/BarsRow.js";
|
|
11
11
|
import { GanttConsts as J } from "../../../constants/GanttConsts.js";
|
|
12
12
|
import { DragTypes as u } from "../../../enums/DragTypes.js";
|
|
13
|
-
const Q = ({
|
|
13
|
+
const Q = ({
|
|
14
|
+
scaleWidth: D,
|
|
15
|
+
style: y,
|
|
16
|
+
children: c,
|
|
17
|
+
...h
|
|
18
|
+
}) => /* @__PURE__ */ T(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
style: { ...y, width: D, position: "relative" },
|
|
22
|
+
...h,
|
|
23
|
+
children: c
|
|
24
|
+
}
|
|
25
|
+
), U = F(
|
|
14
26
|
({ width: D, height: y, data: c, setData: h, onBarDoubleClick: W, onBarChange: x }, v) => {
|
|
15
27
|
const { settings: n, scaleDates: S } = L(B), H = E(() => V(
|
|
16
28
|
S,
|
|
17
29
|
n.dimension,
|
|
18
30
|
n.scaleStepItems,
|
|
19
31
|
n.stepWidth
|
|
20
|
-
), [
|
|
32
|
+
), [
|
|
33
|
+
S,
|
|
34
|
+
n.dimension,
|
|
35
|
+
n.scaleStepItems,
|
|
36
|
+
n.stepWidth
|
|
37
|
+
]), _ = E(
|
|
38
|
+
() => j(n.gridSize),
|
|
39
|
+
[n.gridSize]
|
|
40
|
+
), I = E(() => {
|
|
21
41
|
const l = [];
|
|
22
42
|
for (const o of c)
|
|
23
43
|
o.hasOwnProperty("expanded") && !o.expanded && l.push(o.key);
|
|
24
|
-
return c.filter((o) => !o.parentsKeys.some(
|
|
44
|
+
return c.filter((o) => !o.parentsKeys.some(
|
|
45
|
+
(m) => l.includes(m)
|
|
46
|
+
));
|
|
25
47
|
}, [c]), Z = P(() => J.ROW_HEIGHT, []), A = P(
|
|
26
48
|
(l) => {
|
|
27
49
|
var R, b, G, M, g, z, k, C;
|
|
@@ -10,8 +10,23 @@ import { GanttContext as q } from "../../../../Gantt/GanttContext.js";
|
|
|
10
10
|
import { DragTypes as s } from "../../../../../enums/DragTypes.js";
|
|
11
11
|
let R;
|
|
12
12
|
const J = W(
|
|
13
|
-
({
|
|
14
|
-
|
|
13
|
+
({
|
|
14
|
+
title: L,
|
|
15
|
+
barKey: A,
|
|
16
|
+
startDate: d,
|
|
17
|
+
endDate: x,
|
|
18
|
+
repetead: N,
|
|
19
|
+
onBarDoubleClick: T,
|
|
20
|
+
leftRender: h
|
|
21
|
+
}) => {
|
|
22
|
+
const { scaleDates: S, settings: n } = D(q), { barData: g } = D(U), e = n.draggable === !0, {
|
|
23
|
+
attributes: b,
|
|
24
|
+
listeners: a,
|
|
25
|
+
transform: w,
|
|
26
|
+
activatorEvent: c,
|
|
27
|
+
setNodeRef: k,
|
|
28
|
+
setActivatorNodeRef: v
|
|
29
|
+
} = H({
|
|
15
30
|
id: A,
|
|
16
31
|
disabled: !e
|
|
17
32
|
}), f = l(() => (x - d) / n.secondsInPixel, [x, n.secondsInPixel, d]), y = l(() => N ? (24 * 3600 - 1) / n.secondsInPixel : 0, [N, n.secondsInPixel]), C = l(() => (d - S[0]) / n.secondsInPixel, [S, n.secondsInPixel, d]), o = l(() => {
|
|
@@ -25,12 +40,16 @@ const J = W(
|
|
|
25
40
|
let u = o === s.RESIZE_LEFT ? -w.x : w.x;
|
|
26
41
|
return u !== 0 && o !== s.DRAG && (t !== null && u > t && (u = t), u < m && (u = m)), u;
|
|
27
42
|
}, [o, y, n.gridSize, f, w]), I = l(() => o === s.DRAG ? f : f + r, [o, r, f]), Z = l(() => o === s.DRAG ? `translateX(${r}px)` : `translateX(${o === s.RESIZE_LEFT ? -r : 0}px)`, [o, r]), _ = l(() => {
|
|
28
|
-
const t = [s.RESIZE_LEFT, s.DRAG].includes(
|
|
43
|
+
const t = [s.RESIZE_LEFT, s.DRAG].includes(
|
|
44
|
+
o
|
|
45
|
+
) ? r * n.secondsInPixel : 0;
|
|
29
46
|
return G.unix(
|
|
30
47
|
d + (o === s.RESIZE_LEFT ? -t : t)
|
|
31
48
|
).format("L LTS");
|
|
32
49
|
}, [o, r, n.secondsInPixel, d]), j = l(() => {
|
|
33
|
-
const t = [s.RESIZE_RIGHT, s.DRAG].includes(
|
|
50
|
+
const t = [s.RESIZE_RIGHT, s.DRAG].includes(
|
|
51
|
+
o
|
|
52
|
+
) ? r * n.secondsInPixel : 0;
|
|
34
53
|
return G.unix(x + t).format("L LTS");
|
|
35
54
|
}, [o, r, x, n.secondsInPixel]), z = E(() => {
|
|
36
55
|
T && T(g);
|
|
@@ -48,7 +67,7 @@ const J = W(
|
|
|
48
67
|
/* @__PURE__ */ i(M, { asChild: !0, children: /* @__PURE__ */ i(
|
|
49
68
|
"div",
|
|
50
69
|
{
|
|
51
|
-
className: "absolute flex items-center
|
|
70
|
+
className: "absolute z-10 flex items-center",
|
|
52
71
|
style: {
|
|
53
72
|
height: "40px",
|
|
54
73
|
top: 0,
|
|
@@ -60,7 +79,7 @@ const J = W(
|
|
|
60
79
|
children: /* @__PURE__ */ p(
|
|
61
80
|
"div",
|
|
62
81
|
{
|
|
63
|
-
className: "flex
|
|
82
|
+
className: "flex h-6 w-full items-center justify-between rounded px-0.5 text-white",
|
|
64
83
|
"data-dragtype": s.DRAG,
|
|
65
84
|
...e ? a : {},
|
|
66
85
|
...e ? b : {},
|
|
@@ -76,7 +95,7 @@ const J = W(
|
|
|
76
95
|
"div",
|
|
77
96
|
{
|
|
78
97
|
className: P(
|
|
79
|
-
"flex
|
|
98
|
+
"flex h-full w-2.5 flex-shrink-0 cursor-w-resize justify-between rounded bg-black/25",
|
|
80
99
|
I < 25 && "hidden group-hover:flex"
|
|
81
100
|
),
|
|
82
101
|
ref: e ? v : void 0,
|
|
@@ -87,8 +106,8 @@ const J = W(
|
|
|
87
106
|
...e ? {} : { cursor: "default", pointerEvents: "none" }
|
|
88
107
|
},
|
|
89
108
|
children: [
|
|
90
|
-
/* @__PURE__ */ i("span", { className: "w-0.5
|
|
91
|
-
/* @__PURE__ */ i("span", { className: "w-0.5
|
|
109
|
+
/* @__PURE__ */ i("span", { className: "h-full w-0.5 bg-white/60" }),
|
|
110
|
+
/* @__PURE__ */ i("span", { className: "h-full w-0.5 bg-white/60" })
|
|
92
111
|
]
|
|
93
112
|
}
|
|
94
113
|
),
|
|
@@ -96,7 +115,7 @@ const J = W(
|
|
|
96
115
|
"div",
|
|
97
116
|
{
|
|
98
117
|
className: P(
|
|
99
|
-
"
|
|
118
|
+
"flex items-center gap-2 overflow-hidden px-2 text-ellipsis whitespace-nowrap select-none",
|
|
100
119
|
I < 100 && "hidden"
|
|
101
120
|
),
|
|
102
121
|
"data-dragtype": s.DRAG,
|
|
@@ -119,7 +138,7 @@ const J = W(
|
|
|
119
138
|
"div",
|
|
120
139
|
{
|
|
121
140
|
className: P(
|
|
122
|
-
"flex
|
|
141
|
+
"flex h-full w-2.5 flex-shrink-0 cursor-e-resize justify-between rounded bg-black/25",
|
|
123
142
|
I < 25 && "hidden group-hover:flex"
|
|
124
143
|
),
|
|
125
144
|
ref: e ? v : void 0,
|
|
@@ -130,8 +149,8 @@ const J = W(
|
|
|
130
149
|
...e ? {} : { cursor: "default", pointerEvents: "none" }
|
|
131
150
|
},
|
|
132
151
|
children: [
|
|
133
|
-
/* @__PURE__ */ i("span", { className: "w-0.5
|
|
134
|
-
/* @__PURE__ */ i("span", { className: "w-0.5
|
|
152
|
+
/* @__PURE__ */ i("span", { className: "h-full w-0.5 bg-white/60" }),
|
|
153
|
+
/* @__PURE__ */ i("span", { className: "h-full w-0.5 bg-white/60" })
|
|
135
154
|
]
|
|
136
155
|
}
|
|
137
156
|
)
|
|
@@ -5,7 +5,13 @@ import x from "../../../../../../../../_virtual/dayjs.min.js";
|
|
|
5
5
|
import { GanttContext as I } from "../../../../Gantt/GanttContext.js";
|
|
6
6
|
import S from "../RepeteadBars/RepeteadBars.js";
|
|
7
7
|
import v from "../BarItem/BarItem.js";
|
|
8
|
-
const M = ({
|
|
8
|
+
const M = ({
|
|
9
|
+
data: e,
|
|
10
|
+
title: s,
|
|
11
|
+
barKey: o,
|
|
12
|
+
leftRender: D,
|
|
13
|
+
onBarDoubleClick: m
|
|
14
|
+
}) => {
|
|
9
15
|
const { scaleDates: r, scaleRenderState: t } = l(I), u = n(() => r[t.overscanStartIndex], [r, t.overscanStartIndex]), p = n(() => r[t.overscanStopIndex], [r, t.overscanStopIndex]), c = n(() => x(e == null ? void 0 : e.startDate).unix(), [e == null ? void 0 : e.startDate]), f = n(() => x(e == null ? void 0 : e.endDate).unix(), [e == null ? void 0 : e.endDate]);
|
|
10
16
|
return e ? e.repeatType ? /* @__PURE__ */ i(
|
|
11
17
|
S,
|
|
@@ -4,7 +4,12 @@ import { useContext as i, useMemo as a } from "react";
|
|
|
4
4
|
import { BarsRowContext as p } from "./BarsRowContext.js";
|
|
5
5
|
import { GanttContext as m } from "../../../Gantt/GanttContext.js";
|
|
6
6
|
import l from "./BarsItems/BarItems.js";
|
|
7
|
-
const v = ({
|
|
7
|
+
const v = ({
|
|
8
|
+
barData: t,
|
|
9
|
+
index: r,
|
|
10
|
+
style: o,
|
|
11
|
+
onBarDoubleClick: s
|
|
12
|
+
}) => {
|
|
8
13
|
const { settings: n } = i(m), d = a(() => ({
|
|
9
14
|
...o,
|
|
10
15
|
backgroundImage: `repeating-linear-gradient(to right, var(--d-border) 0px 1px, ${r % 2 === 0 ? "var(--d-background)" : "var(--d-secondary)"} 1px ${n.stepWidth}px`
|
|
@@ -10,8 +10,15 @@ import q from "./Tree/Tree.js";
|
|
|
10
10
|
import v from "./Bars/Bars.js";
|
|
11
11
|
import { GanttConsts as m } from "../../constants/GanttConsts.js";
|
|
12
12
|
import { GanttDimensionsSettings as z } from "../../constants/DimensionsSettings.js";
|
|
13
|
-
const et = ({
|
|
14
|
-
|
|
13
|
+
const et = ({
|
|
14
|
+
data: f,
|
|
15
|
+
className: x,
|
|
16
|
+
onBarDoubleClick: W,
|
|
17
|
+
onBarChange: I
|
|
18
|
+
}) => {
|
|
19
|
+
const { settings: n, scaleDates: c, wrapRef: t, setCurrentDate: d, treeTitle: b } = R(F), h = a(null), T = a(null), g = a(null), [D, i] = s(
|
|
20
|
+
[]
|
|
21
|
+
), [l, G] = s(!0), [p, L] = s(0), [C, _] = s(0), E = k(() => {
|
|
15
22
|
var r;
|
|
16
23
|
const e = Math.round(
|
|
17
24
|
((((r = t == null ? void 0 : t.current) == null ? void 0 : r.scrollLeft) || 0) + m.TREE_WIDTH) * z[n.dimension].secondsInPixel
|
|
@@ -43,7 +50,16 @@ const et = ({ data: f, className: x, onBarDoubleClick: W, onBarChange: I }) => {
|
|
|
43
50
|
}
|
|
44
51
|
) : /* @__PURE__ */ M(N, { children: [
|
|
45
52
|
/* @__PURE__ */ o(P, { width: p, wrapRef: t, ref: h }),
|
|
46
|
-
/* @__PURE__ */ o(
|
|
53
|
+
/* @__PURE__ */ o(
|
|
54
|
+
q,
|
|
55
|
+
{
|
|
56
|
+
height: C,
|
|
57
|
+
data: D,
|
|
58
|
+
setData: i,
|
|
59
|
+
ref: T,
|
|
60
|
+
treeTitle: b
|
|
61
|
+
}
|
|
62
|
+
),
|
|
47
63
|
/* @__PURE__ */ o(
|
|
48
64
|
v,
|
|
49
65
|
{
|