laif-ds 0.2.74 → 0.2.76
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/CHANGELOG.md +446 -0
- package/dist/agent-docs/adoption-report.json +615 -0
- package/dist/agent-docs/components/Accordion.md +46 -16
- package/dist/agent-docs/components/Alert.md +90 -95
- package/dist/agent-docs/components/AlertDialog.md +132 -126
- package/dist/agent-docs/components/AppEditor.md +90 -90
- package/dist/agent-docs/components/AppRadioGroup.md +18 -18
- package/dist/agent-docs/components/AppSidebar.md +129 -122
- package/dist/agent-docs/components/AppStepper.md +81 -77
- package/dist/agent-docs/components/AspectRatio.md +70 -62
- package/dist/agent-docs/components/AudioVisualizer.md +5 -5
- package/dist/agent-docs/components/Avatar.md +112 -113
- package/dist/agent-docs/components/Badge.md +123 -118
- package/dist/agent-docs/components/Breadcrumb.md +8 -1
- package/dist/agent-docs/components/Button.md +131 -129
- package/dist/agent-docs/components/Card.md +172 -147
- package/dist/agent-docs/components/Carousel.md +148 -129
- package/dist/agent-docs/components/Chat.md +121 -109
- package/dist/agent-docs/components/ChatMessage.md +72 -61
- package/dist/agent-docs/components/Checkbox.md +150 -135
- package/dist/agent-docs/components/CircularProgress.md +53 -49
- package/dist/agent-docs/components/CodeHighlighter.md +4 -4
- package/dist/agent-docs/components/Collapsible.md +114 -95
- package/dist/agent-docs/components/Command.md +141 -142
- package/dist/agent-docs/components/Confirmer.md +182 -175
- package/dist/agent-docs/components/ContextMenu.md +196 -191
- package/dist/agent-docs/components/DataCrossTable.md +114 -94
- package/dist/agent-docs/components/DataTable.md +32 -24
- package/dist/agent-docs/components/Dialog.md +130 -125
- package/dist/agent-docs/components/Drawer.md +141 -127
- package/dist/agent-docs/components/FilePreviewer.md +138 -139
- package/dist/agent-docs/components/FileUploader.md +149 -129
- package/dist/agent-docs/components/Form.md +3 -1
- package/dist/agent-docs/components/FormComposer.md +163 -137
- package/dist/agent-docs/components/GanttChart.md +125 -122
- package/dist/agent-docs/components/HoverCard.md +1 -1
- package/dist/agent-docs/components/Icon.md +98 -99
- package/dist/agent-docs/components/Input.md +173 -138
- package/dist/agent-docs/components/InputOtp.md +6 -1
- package/dist/agent-docs/components/InputSelector.md +94 -97
- package/dist/agent-docs/components/InterruptPrompt.md +4 -4
- package/dist/agent-docs/components/MarkdownRenderer.md +5 -2
- package/dist/agent-docs/components/Menubar.md +60 -57
- package/dist/agent-docs/components/MessageInput.md +134 -131
- package/dist/agent-docs/components/MessageList.md +110 -96
- package/dist/agent-docs/components/MultipleSelector.md +147 -146
- package/dist/agent-docs/components/NavigationMenu.md +6 -2
- package/dist/agent-docs/components/Popover.md +112 -103
- package/dist/agent-docs/components/PromptSuggestions.md +5 -5
- package/dist/agent-docs/components/RadioGroup.md +97 -90
- package/dist/agent-docs/components/Resizable.md +4 -1
- package/dist/agent-docs/components/ResizePrompt.md +12 -13
- package/dist/agent-docs/components/ScrollArea.md +6 -2
- package/dist/agent-docs/components/SecurePdfViewer.md +10 -6
- package/dist/agent-docs/components/Select.md +131 -132
- package/dist/agent-docs/components/Sheet.md +8 -1
- package/dist/agent-docs/components/ShikiHighlighter.md +5 -5
- package/dist/agent-docs/components/Sidebar.md +94 -85
- package/dist/agent-docs/components/Slider.md +62 -58
- package/dist/agent-docs/components/Sonner.md +1 -0
- package/dist/agent-docs/components/Spinner.md +14 -14
- package/dist/agent-docs/components/Stepper.md +93 -67
- package/dist/agent-docs/components/Switch.md +41 -42
- package/dist/agent-docs/components/TableSkeleton.md +8 -8
- package/dist/agent-docs/components/Tabs.md +106 -86
- package/dist/agent-docs/components/TextArea.md +51 -52
- package/dist/agent-docs/components/ThemeSwitcher.md +72 -69
- package/dist/agent-docs/components/Toaster.md +1 -0
- package/dist/agent-docs/components/Tooltip.md +102 -91
- package/dist/agent-docs/components/Typo.md +68 -65
- package/dist/agent-docs/components/WeeklyCalendar.md +63 -64
- package/dist/agent-docs/components-list.md +1 -0
- package/dist/agent-docs/manifest.json +5981 -0
- package/dist/agent-docs/truncated-cell.md +342 -0
- package/dist/components/editor/editor-hooks/use-update-toolbar.js +6 -6
- package/dist/components/editor/plugins/actions/counter-character-plugin.js +6 -6
- package/dist/components/editor/plugins/toolbar/font-format-toolbar-plugin.js +18 -18
- package/dist/components/editor/plugins/toolbar/history-toolbar-plugin.js +10 -10
- package/dist/components/editor/plugins/toolbar/toolbar-plugin.js +9 -9
- package/dist/components/ui/app-checkbox.js +1 -1
- package/dist/components/ui/app-dialog.js +70 -64
- package/dist/components/ui/app-editor.js +51 -51
- package/dist/components/ui/app-form.js +81 -81
- package/dist/components/ui/app-multiple-select-dropdown.js +36 -36
- package/dist/components/ui/app-select.js +109 -104
- package/dist/components/ui/app-sidebar.js +41 -41
- package/dist/components/ui/app-stepper.js +1 -1
- package/dist/components/ui/app-time-picker.js +18 -18
- package/dist/components/ui/app-tooltip.js +1 -1
- package/dist/components/ui/async-select.js +5 -5
- package/dist/components/ui/audio-visualizer.js +61 -58
- package/dist/components/ui/card.js +1 -1
- package/dist/components/ui/carousel.js +2 -2
- package/dist/components/ui/chart.js +1 -1
- package/dist/components/ui/chat-message.js +8 -8
- package/dist/components/ui/chat.js +86 -88
- package/dist/components/ui/command.js +2 -2
- package/dist/components/ui/copy-button.js +4 -4
- package/dist/components/ui/date-picker.js +20 -20
- package/dist/components/ui/file-preview/index.js +13 -13
- package/dist/components/ui/file-previewer.js +12 -11
- package/dist/components/ui/file-uploader.js +86 -78
- package/dist/components/ui/form.js +2 -2
- package/dist/components/ui/gantt/components/Chart/Bars/Bars.js +56 -56
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarItem/BarItem.js +12 -12
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsItems/BarItems.js +1 -1
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRow.js +4 -4
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/RepeteadBars/RepeteadBars.js +2 -2
- package/dist/components/ui/gantt/components/Chart/Chart.js +23 -23
- package/dist/components/ui/gantt/components/Chart/Scale/Scale.js +1 -1
- package/dist/components/ui/gantt/components/Chart/Tree/Tree.js +34 -34
- package/dist/components/ui/gantt/components/Controls/Controls.js +5 -5
- package/dist/components/ui/gantt/components/Gantt/Gantt.js +4 -4
- package/dist/components/ui/gantt/hooks/useGanttCalculate.js +25 -18
- package/dist/components/ui/input-selector.js +1 -1
- package/dist/components/ui/input.js +23 -23
- package/dist/components/ui/kanban.js +8 -9
- package/dist/components/ui/markdown-renderer.js +41 -35
- package/dist/components/ui/message-input.js +45 -44
- package/dist/components/ui/multiple-selector.js +91 -82
- package/dist/components/ui/secure-pdf-viewer.js +19 -7
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/slider.js +1 -1
- package/dist/components/ui/spinner.js +4 -4
- package/dist/components/ui/stepper.js +157 -138
- package/dist/components/ui/tables/data-cross-table/data-cross-table-buttons.js +29 -29
- package/dist/components/ui/tables/data-cross-table/data-cross-table.js +258 -246
- package/dist/components/ui/tables/data-table/components/data-table-advanced-filter.js +4 -1
- package/dist/components/ui/tables/data-table/components/data-table-body.js +211 -367
- package/dist/components/ui/tables/data-table/components/data-table-filter-inputs.js +114 -112
- package/dist/components/ui/tables/data-table/components/data-table-filters.js +116 -96
- package/dist/components/ui/tables/data-table/components/data-table-header.js +211 -0
- package/dist/components/ui/tables/data-table/components/data-table-searchbar.js +8 -8
- package/dist/components/ui/tables/data-table/components/data-table-skeleton-rows.js +33 -0
- package/dist/components/ui/tables/data-table/data-table.js +258 -250
- package/dist/components/ui/tables/data-table/data-table.service.js +112 -97
- package/dist/components/ui/tables/data-table/data-table.utils.js +25 -15
- package/dist/components/ui/textarea.js +2 -2
- package/dist/components/ui/theme-switcher.js +1 -1
- package/dist/components/ui/toggle-group.js +2 -2
- package/dist/components/ui/truncated-cell.js +100 -0
- package/dist/components/ui/weekly-calendar/appointment-card.js +16 -16
- package/dist/components/ui/weekly-calendar/calendar-context.js +6 -6
- package/dist/components/ui/weekly-calendar/calendar-header.js +12 -12
- package/dist/components/ui/weekly-calendar/day-column.js +16 -16
- package/dist/components/ui/weekly-calendar/time-column.js +4 -4
- package/dist/components/ui/weekly-calendar/weekly-calendar.js +4 -4
- package/dist/hooks/use-audio-recording.js +1 -1
- package/dist/hooks/use-auto-scroll.js +18 -18
- package/dist/hooks/use-autosize-textarea.js +12 -13
- package/dist/index.d.ts +100 -45
- package/dist/index.js +362 -360
- package/dist/lib/utils.js +6 -6
- package/dist/styles.v3.css +1 -1
- package/package.json +14 -4
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as u } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { createSnapModifier as v, restrictToHorizontalAxis as H } from "../../../../../../node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js";
|
|
3
|
+
import { DndContext as P } from "../../../../../../node_modules/@dnd-kit/core/dist/core.esm.js";
|
|
4
|
+
import { createSnapModifier as W, restrictToHorizontalAxis as v } from "../../../../../../node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js";
|
|
6
5
|
import f from "../../../../../../_virtual/dayjs.min.js";
|
|
7
|
-
import {
|
|
6
|
+
import { forwardRef as H, useContext as _, useMemo as E, useCallback as g } from "react";
|
|
7
|
+
import { VariableSizeList as N } from "../../../../../../node_modules/react-window/dist/index.esm.js";
|
|
8
8
|
import { GanttContext as Z } from "../../Gantt/GanttContext.js";
|
|
9
|
-
import { getWholeWidth as
|
|
10
|
-
import
|
|
11
|
-
import { GanttConsts as
|
|
9
|
+
import { getWholeWidth as j } from "../../../utils/getWholeWidth.js";
|
|
10
|
+
import A from "./BarsRow/BarsRow.js";
|
|
11
|
+
import { GanttConsts as F } from "../../../constants/GanttConsts.js";
|
|
12
12
|
import { DragTypes as p } from "../../../enums/DragTypes.js";
|
|
13
|
-
const
|
|
13
|
+
const L = ({
|
|
14
14
|
scaleWidth: D,
|
|
15
|
-
style:
|
|
15
|
+
style: x,
|
|
16
16
|
children: l,
|
|
17
17
|
...T
|
|
18
18
|
}) => /* @__PURE__ */ u(
|
|
19
19
|
"div",
|
|
20
20
|
{
|
|
21
|
-
style: { ...
|
|
21
|
+
style: { ...x, width: D, position: "relative" },
|
|
22
22
|
...T,
|
|
23
23
|
children: l
|
|
24
24
|
}
|
|
25
|
-
),
|
|
26
|
-
({ width: D, height:
|
|
27
|
-
const { settings: o, scaleDates: S } =
|
|
25
|
+
), O = H(
|
|
26
|
+
({ width: D, height: x, data: l, setData: T, onBarDoubleClick: b, onBarChange: y }, R) => {
|
|
27
|
+
const { settings: o, scaleDates: S } = _(Z), G = E(() => j(
|
|
28
28
|
S,
|
|
29
29
|
o.dimension,
|
|
30
30
|
o.scaleStepItems,
|
|
@@ -35,31 +35,31 @@ const N = ({
|
|
|
35
35
|
o.scaleStepItems,
|
|
36
36
|
o.stepWidth
|
|
37
37
|
]), M = E(
|
|
38
|
-
() =>
|
|
38
|
+
() => W(o.gridSize),
|
|
39
39
|
[o.gridSize]
|
|
40
|
-
),
|
|
40
|
+
), I = E(() => {
|
|
41
41
|
const d = [];
|
|
42
|
-
for (const
|
|
43
|
-
|
|
44
|
-
return l.filter((
|
|
42
|
+
for (const s of l)
|
|
43
|
+
Object.prototype.hasOwnProperty.call(s, "expanded") && !s.expanded && d.push(s.key);
|
|
44
|
+
return l.filter((s) => !s.parentsKeys.some(
|
|
45
45
|
(m) => d.includes(m)
|
|
46
46
|
));
|
|
47
|
-
}, [l]), z =
|
|
47
|
+
}, [l]), z = g(() => F.ROW_HEIGHT, []), k = g(
|
|
48
48
|
(d) => {
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
51
|
-
const { fromTime: t, toTime: a } =
|
|
52
|
-
let e = a +
|
|
53
|
-
a > t && e - t >= i || a < t && e > t ? e = t - 1 : a > t && e < t || a < t && t - e >= i ? e = t + m : e < 0 ? e = e + i : e >= i && (e = e - i),
|
|
49
|
+
const s = d.delta.x * o.secondsInPixel, i = 3600 * 24, m = o.gridSize * o.secondsInPixel, w = [...l], r = w.find((t) => t.key === d.active.id), C = d.activatorEvent.target, h = Number(C?.dataset?.dragtype ?? -1);
|
|
50
|
+
if (r?.data?.repeatType && h === p.RESIZE_RIGHT) {
|
|
51
|
+
const { fromTime: t, toTime: a } = r.data;
|
|
52
|
+
let e = a + s;
|
|
53
|
+
a > t && e - t >= i || a < t && e > t ? e = t - 1 : a > t && e < t || a < t && t - e >= i ? e = t + m : e < 0 ? e = e + i : e >= i && (e = e - i), r.data.toTime = Math.round(e);
|
|
54
54
|
}
|
|
55
|
-
if (
|
|
56
|
-
const { fromTime: t, toTime: a } =
|
|
57
|
-
let e = t +
|
|
58
|
-
t < a && a - e >= i || t > a && e < a ? e = a + 1 : t < a && e > a || t > a && e - a >= i ? e = a - m : e < 0 ? e = e + i : e >= i && (e = e - i),
|
|
55
|
+
if (r?.data?.repeatType && h === p.RESIZE_LEFT) {
|
|
56
|
+
const { fromTime: t, toTime: a } = r.data;
|
|
57
|
+
let e = t + s;
|
|
58
|
+
t < a && a - e >= i || t > a && e < a ? e = a + 1 : t < a && e > a || t > a && e - a >= i ? e = a - m : e < 0 ? e = e + i : e >= i && (e = e - i), r.data.fromTime = Math.round(e);
|
|
59
59
|
}
|
|
60
|
-
if (
|
|
61
|
-
const { fromTime: t, toTime: a } =
|
|
62
|
-
let e = t +
|
|
60
|
+
if (r?.data?.repeatType && h === p.DRAG) {
|
|
61
|
+
const { fromTime: t, toTime: a } = r.data;
|
|
62
|
+
let e = t + s, n = a + s;
|
|
63
63
|
for (; e < 0; )
|
|
64
64
|
e = e + i;
|
|
65
65
|
for (; n < 0; )
|
|
@@ -68,59 +68,59 @@ const N = ({
|
|
|
68
68
|
e = e - i;
|
|
69
69
|
for (; n >= i; )
|
|
70
70
|
n = n - i;
|
|
71
|
-
|
|
71
|
+
r.data.fromTime = Math.round(e), r.data.toTime = Math.round(n);
|
|
72
72
|
}
|
|
73
|
-
if (
|
|
74
|
-
const { startDate: t, endDate: a } =
|
|
73
|
+
if (r?.data && !r?.data?.repeatType) {
|
|
74
|
+
const { startDate: t, endDate: a } = r.data;
|
|
75
75
|
if (t && a) {
|
|
76
76
|
const e = f(t).unix(), n = f(a).unix();
|
|
77
|
-
switch (
|
|
77
|
+
switch (h) {
|
|
78
78
|
case p.RESIZE_LEFT: {
|
|
79
|
-
let c = e +
|
|
80
|
-
n - c < m && (c = n - m),
|
|
79
|
+
let c = e + s;
|
|
80
|
+
n - c < m && (c = n - m), r.data.startDate = f.unix(c).format();
|
|
81
81
|
break;
|
|
82
82
|
}
|
|
83
83
|
case p.RESIZE_RIGHT: {
|
|
84
|
-
let c = n +
|
|
85
|
-
c - e < m && (c = e + m),
|
|
84
|
+
let c = n + s;
|
|
85
|
+
c - e < m && (c = e + m), r.data.endDate = f.unix(c).format();
|
|
86
86
|
break;
|
|
87
87
|
}
|
|
88
88
|
case p.DRAG: {
|
|
89
|
-
|
|
89
|
+
r.data.startDate = f.unix(Math.round(e + s)).format(), r.data.endDate = f.unix(Math.round(n + s)).format();
|
|
90
90
|
break;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
|
|
95
|
+
y && r && y(r, w), T(w);
|
|
96
96
|
},
|
|
97
|
-
[l,
|
|
97
|
+
[l, y, T, o.gridSize, o.secondsInPixel]
|
|
98
98
|
);
|
|
99
99
|
return /* @__PURE__ */ u("div", { className: "gantt-bars-wrap", children: /* @__PURE__ */ u(
|
|
100
|
-
|
|
100
|
+
P,
|
|
101
101
|
{
|
|
102
|
-
modifiers: [
|
|
102
|
+
modifiers: [v, M],
|
|
103
103
|
onDragEnd: k,
|
|
104
104
|
autoScroll: !1,
|
|
105
105
|
children: /* @__PURE__ */ u(
|
|
106
|
-
|
|
106
|
+
N,
|
|
107
107
|
{
|
|
108
|
-
ref:
|
|
108
|
+
ref: R,
|
|
109
109
|
className: "gantt-bars-list",
|
|
110
110
|
layout: "vertical",
|
|
111
111
|
width: D,
|
|
112
|
-
height:
|
|
113
|
-
itemCount:
|
|
112
|
+
height: x,
|
|
113
|
+
itemCount: I.length,
|
|
114
114
|
itemSize: z,
|
|
115
|
-
itemData:
|
|
116
|
-
innerElementType: (d) => /* @__PURE__ */ u(
|
|
117
|
-
children: ({ style: d, data:
|
|
118
|
-
|
|
115
|
+
itemData: I,
|
|
116
|
+
innerElementType: (d) => /* @__PURE__ */ u(L, { scaleWidth: G, ...d }),
|
|
117
|
+
children: ({ style: d, data: s, index: i }) => /* @__PURE__ */ u(
|
|
118
|
+
A,
|
|
119
119
|
{
|
|
120
|
-
barData:
|
|
120
|
+
barData: s[i],
|
|
121
121
|
index: i,
|
|
122
122
|
style: d,
|
|
123
|
-
onBarDoubleClick:
|
|
123
|
+
onBarDoubleClick: b
|
|
124
124
|
}
|
|
125
125
|
)
|
|
126
126
|
}
|
|
@@ -129,7 +129,7 @@ const N = ({
|
|
|
129
129
|
) });
|
|
130
130
|
}
|
|
131
131
|
);
|
|
132
|
-
|
|
132
|
+
O.displayName = "Bars";
|
|
133
133
|
export {
|
|
134
|
-
|
|
134
|
+
O as default
|
|
135
135
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r, jsxs as u } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import G from "
|
|
6
|
-
import { cn as v } from "../../../../../../../../lib/utils.js";
|
|
3
|
+
import { useDraggable as W } from "../../../../../../../../node_modules/@dnd-kit/core/dist/core.esm.js";
|
|
4
|
+
import D from "../../../../../../../../_virtual/dayjs.min.js";
|
|
5
|
+
import { memo as H, useContext as G, useMemo as l, useCallback as T } from "react";
|
|
7
6
|
import { TooltipProvider as X, Tooltip as B, TooltipTrigger as M, TooltipContent as O } from "../../../../../../tooltip.js";
|
|
8
|
-
import {
|
|
9
|
-
import { GanttContext as
|
|
7
|
+
import { cn as v } from "../../../../../../../../lib/utils.js";
|
|
8
|
+
import { GanttContext as U } from "../../../../Gantt/GanttContext.js";
|
|
9
|
+
import { BarsRowContext as q } from "../BarsRowContext.js";
|
|
10
10
|
import { DragTypes as t } from "../../../../../enums/DragTypes.js";
|
|
11
11
|
let b;
|
|
12
|
-
const J =
|
|
12
|
+
const J = H(
|
|
13
13
|
({
|
|
14
14
|
title: L,
|
|
15
15
|
barKey: A,
|
|
@@ -19,17 +19,17 @@ const J = W(
|
|
|
19
19
|
onBarDoubleClick: w,
|
|
20
20
|
leftRender: p
|
|
21
21
|
}) => {
|
|
22
|
-
const { scaleDates: P, settings: n } =
|
|
22
|
+
const { scaleDates: P, settings: n } = G(U), { barData: x } = G(q), e = n.draggable === !0, {
|
|
23
23
|
attributes: I,
|
|
24
24
|
listeners: c,
|
|
25
25
|
transform: h,
|
|
26
26
|
activatorEvent: R,
|
|
27
27
|
setNodeRef: k,
|
|
28
28
|
setActivatorNodeRef: N
|
|
29
|
-
} =
|
|
29
|
+
} = W({
|
|
30
30
|
id: A,
|
|
31
31
|
disabled: !e
|
|
32
|
-
}), d = l(() => (m - a) / n.secondsInPixel, [m, n.secondsInPixel, a]), E = l(() => y ? (24 * 3600 - 1) / n.secondsInPixel : 0, [y, n.secondsInPixel]), C = l(() => (a - P[0]) / n.secondsInPixel, [P, n.secondsInPixel, a]), s = l(() => +R?.target?.dataset?.dragtype, [R?.target]), i = l(() => {
|
|
32
|
+
}), d = l(() => (m - a) / n.secondsInPixel, [m, n.secondsInPixel, a]), E = l(() => y ? (24 * 3600 - 1) / n.secondsInPixel : 0, [y, n.secondsInPixel]), C = l(() => (a - P[0]) / n.secondsInPixel, [P, n.secondsInPixel, a]), s = l(() => +(R?.target?.dataset?.dragtype ?? 0), [R?.target]), i = l(() => {
|
|
33
33
|
if (!h)
|
|
34
34
|
return 0;
|
|
35
35
|
const o = E ? E - d : null, S = n.gridSize - d;
|
|
@@ -39,14 +39,14 @@ const J = W(
|
|
|
39
39
|
const o = [t.RESIZE_LEFT, t.DRAG].includes(
|
|
40
40
|
s
|
|
41
41
|
) ? i * n.secondsInPixel : 0;
|
|
42
|
-
return
|
|
42
|
+
return D.unix(
|
|
43
43
|
a + (s === t.RESIZE_LEFT ? -o : o)
|
|
44
44
|
).format("L LTS");
|
|
45
45
|
}, [s, i, n.secondsInPixel, a]), j = l(() => {
|
|
46
46
|
const o = [t.RESIZE_RIGHT, t.DRAG].includes(
|
|
47
47
|
s
|
|
48
48
|
) ? i * n.secondsInPixel : 0;
|
|
49
|
-
return
|
|
49
|
+
return D.unix(m + o).format("L LTS");
|
|
50
50
|
}, [s, i, m, n.secondsInPixel]), z = T(() => {
|
|
51
51
|
w && w(x);
|
|
52
52
|
}, [x, w]), F = T(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as f } from "react/jsx-runtime";
|
|
3
|
-
import { useContext as d, useMemo as n } from "react";
|
|
4
3
|
import i from "../../../../../../../../_virtual/dayjs.min.js";
|
|
4
|
+
import { useContext as d, useMemo as n } from "react";
|
|
5
5
|
import { GanttContext as D } from "../../../../Gantt/GanttContext.js";
|
|
6
6
|
import l from "../RepeteadBars/RepeteadBars.js";
|
|
7
7
|
import I from "../BarItem/BarItem.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import { useContext as i, useMemo as a } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { GanttContext as p } from "../../../Gantt/GanttContext.js";
|
|
5
|
+
import { BarsRowContext as m } from "./BarsRowContext.js";
|
|
6
6
|
import l from "./BarsItems/BarItems.js";
|
|
7
7
|
const v = ({
|
|
8
8
|
barData: t,
|
|
@@ -10,11 +10,11 @@ const v = ({
|
|
|
10
10
|
style: o,
|
|
11
11
|
onBarDoubleClick: s
|
|
12
12
|
}) => {
|
|
13
|
-
const { settings: n } = i(
|
|
13
|
+
const { settings: n } = i(p), d = a(() => ({
|
|
14
14
|
...o,
|
|
15
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`
|
|
16
16
|
}), [r, n.stepWidth, o]);
|
|
17
|
-
return /* @__PURE__ */ e(
|
|
17
|
+
return /* @__PURE__ */ e(m.Provider, { value: { barData: t }, children: /* @__PURE__ */ e("div", { className: "gantt-bars-row-wrap", style: d, children: /* @__PURE__ */ e(
|
|
18
18
|
l,
|
|
19
19
|
{
|
|
20
20
|
data: t.data,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as l, Fragment as S } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo as f } from "react";
|
|
4
3
|
import u from "../../../../../../../../_virtual/dayjs.min.js";
|
|
5
|
-
import {
|
|
4
|
+
import { useMemo as f } from "react";
|
|
6
5
|
import { DataRepeatTypes as p } from "../../../../../enums/DataRepeatTimes.js";
|
|
7
6
|
import _ from "../BarItem/BarItem.js";
|
|
7
|
+
import { GanttConsts as c } from "../../../../../constants/GanttConsts.js";
|
|
8
8
|
const I = ({
|
|
9
9
|
data: o,
|
|
10
10
|
firstRenderedDate: t,
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as n, jsxs as b, Fragment as G } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import N from "
|
|
6
|
-
import { GanttContext as
|
|
7
|
-
import { transformData as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
3
|
+
import L from "../../../../../_virtual/index8.js";
|
|
4
|
+
import _ from "../../../../../_virtual/debounce3.js";
|
|
5
|
+
import { useContext as j, useRef as l, useState as o, useCallback as M, useMemo as N, useEffect as a } from "react";
|
|
6
|
+
import { GanttContext as O } from "../Gantt/GanttContext.js";
|
|
7
|
+
import { transformData as k } from "../../utils/transformData.js";
|
|
8
|
+
import y from "./Scale/Scale.js";
|
|
9
|
+
import A from "./Tree/Tree.js";
|
|
10
|
+
import B from "./Bars/Bars.js";
|
|
11
11
|
import { GanttConsts as f } from "../../constants/GanttConsts.js";
|
|
12
|
-
import { GanttDimensionsSettings as
|
|
12
|
+
import { GanttDimensionsSettings as F } from "../../constants/DimensionsSettings.js";
|
|
13
13
|
const Z = ({
|
|
14
14
|
data: u,
|
|
15
15
|
className: E,
|
|
16
16
|
onBarDoubleClick: H,
|
|
17
17
|
onBarChange: R
|
|
18
18
|
}) => {
|
|
19
|
-
const { settings: e, scaleDates: s, wrapRef: t, setCurrentDate: m, treeTitle: S } =
|
|
19
|
+
const { settings: e, scaleDates: s, wrapRef: t, setCurrentDate: m, treeTitle: S } = j(O), d = l(null), p = l(null), h = l(null), [T, c] = o(
|
|
20
20
|
[]
|
|
21
|
-
), [
|
|
21
|
+
), [i, x] = o(!0), [g, W] = o(0), [D, w] = o(0), C = M(() => {
|
|
22
22
|
const r = Math.round(
|
|
23
|
-
((t?.current?.scrollLeft || 0) + f.TREE_WIDTH) *
|
|
23
|
+
((t?.current?.scrollLeft || 0) + f.TREE_WIDTH) * F[e.dimension].secondsInPixel
|
|
24
24
|
);
|
|
25
25
|
m(s[0] + r);
|
|
26
|
-
}, [s, m, e.dimension, t]), I =
|
|
27
|
-
return
|
|
26
|
+
}, [s, m, e.dimension, t]), I = N(() => _(C, 100), [C]);
|
|
27
|
+
return a(() => {
|
|
28
28
|
t?.current?.clientWidth && t?.current?.clientHeight && (W(t.current.clientWidth - f.TREE_WIDTH), w(t.current.clientHeight - f.HEADER_HEIGHT), x(!1));
|
|
29
|
-
}, []),
|
|
30
|
-
!
|
|
31
|
-
}, [
|
|
32
|
-
c(
|
|
29
|
+
}, [t]), a(() => {
|
|
30
|
+
!i && t.current && (t.current.scrollLeft = e.initialScrollOffset);
|
|
31
|
+
}, [i, t, e.initialScrollOffset]), a(() => {
|
|
32
|
+
c(k(u));
|
|
33
33
|
}, [u]), /* @__PURE__ */ n(
|
|
34
34
|
"div",
|
|
35
35
|
{
|
|
36
|
-
className:
|
|
36
|
+
className: L("gantt-chart-wrap", E),
|
|
37
37
|
ref: t,
|
|
38
38
|
onScroll: (r) => {
|
|
39
39
|
h.current?.scrollTo(r.currentTarget.scrollTop), p.current?.scrollTo(r.currentTarget.scrollTop), d.current?.scrollTo(r.currentTarget.scrollLeft), I();
|
|
40
40
|
},
|
|
41
|
-
children:
|
|
41
|
+
children: i ? /* @__PURE__ */ n(
|
|
42
42
|
"div",
|
|
43
43
|
{
|
|
44
44
|
style: {
|
|
@@ -46,9 +46,9 @@ const Z = ({
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
) : /* @__PURE__ */ b(G, { children: [
|
|
49
|
-
/* @__PURE__ */ n(
|
|
49
|
+
/* @__PURE__ */ n(y, { width: g, wrapRef: t, ref: d }),
|
|
50
50
|
/* @__PURE__ */ n(
|
|
51
|
-
|
|
51
|
+
A,
|
|
52
52
|
{
|
|
53
53
|
height: D,
|
|
54
54
|
data: T,
|
|
@@ -58,7 +58,7 @@ const Z = ({
|
|
|
58
58
|
}
|
|
59
59
|
),
|
|
60
60
|
/* @__PURE__ */ n(
|
|
61
|
-
|
|
61
|
+
B,
|
|
62
62
|
{
|
|
63
63
|
ref: h,
|
|
64
64
|
data: T,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as o, jsxs as W } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef as y, useContext as N, useRef as S, useCallback as f, useEffect as Y } from "react";
|
|
4
3
|
import l from "../../../../../../_virtual/dayjs.min.js";
|
|
4
|
+
import { forwardRef as y, useContext as N, useRef as S, useCallback as f, useEffect as Y } from "react";
|
|
5
5
|
import { VariableSizeList as E } from "../../../../../../node_modules/react-window/dist/index.esm.js";
|
|
6
6
|
import { GanttContext as T } from "../../Gantt/GanttContext.js";
|
|
7
7
|
import { useForwardRef as A } from "../../../hooks/useForwardRef.js";
|
|
@@ -1,65 +1,65 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as a, jsxs as d } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef as g, useMemo as
|
|
4
|
-
import { VariableSizeList as
|
|
5
|
-
import { MinusSquareOutlined as
|
|
6
|
-
import { PlusSquareOutlined as
|
|
7
|
-
import { GanttConsts as
|
|
8
|
-
const
|
|
9
|
-
({ height: c, data:
|
|
10
|
-
const
|
|
3
|
+
import { forwardRef as g, useMemo as y, useCallback as f } from "react";
|
|
4
|
+
import { VariableSizeList as h } from "../../../../../../node_modules/react-window/dist/index.esm.js";
|
|
5
|
+
import { MinusSquareOutlined as E } from "../../../assets/icons/MinusSquareOutlined.js";
|
|
6
|
+
import { PlusSquareOutlined as b } from "../../../assets/icons/PlusSquareOutlined.js";
|
|
7
|
+
import { GanttConsts as o } from "../../../constants/GanttConsts.js";
|
|
8
|
+
const T = g(
|
|
9
|
+
({ height: c, data: l, setData: s, treeTitle: p = "Attività" }, m) => {
|
|
10
|
+
const i = y(() => {
|
|
11
11
|
const t = [];
|
|
12
|
-
for (const e of
|
|
13
|
-
|
|
14
|
-
return
|
|
15
|
-
(
|
|
12
|
+
for (const e of l)
|
|
13
|
+
Object.prototype.hasOwnProperty.call(e, "expanded") && !e.expanded && t.push(e.key);
|
|
14
|
+
return l.filter((e) => !e.parentsKeys.some(
|
|
15
|
+
(n) => t.includes(n)
|
|
16
16
|
));
|
|
17
|
-
}, [
|
|
17
|
+
}, [l]), u = f(
|
|
18
18
|
(t) => {
|
|
19
|
-
const e = [...
|
|
20
|
-
|
|
19
|
+
const e = [...l], r = e.find((n) => n.key === t);
|
|
20
|
+
r && Object.prototype.hasOwnProperty.call(r, "expanded") && (r.expanded = !r.expanded), s(e);
|
|
21
21
|
},
|
|
22
|
-
[
|
|
22
|
+
[l, s]
|
|
23
23
|
);
|
|
24
24
|
return /* @__PURE__ */ a(
|
|
25
25
|
"div",
|
|
26
26
|
{
|
|
27
27
|
className: "gantt-tree-wrap bg-d-background",
|
|
28
28
|
style: {
|
|
29
|
-
width:
|
|
30
|
-
marginTop: -
|
|
29
|
+
width: o.TREE_WIDTH,
|
|
30
|
+
marginTop: -o.HEADER_HEIGHT
|
|
31
31
|
},
|
|
32
32
|
children: /* @__PURE__ */ a(
|
|
33
|
-
|
|
33
|
+
h,
|
|
34
34
|
{
|
|
35
|
-
ref:
|
|
35
|
+
ref: m,
|
|
36
36
|
className: "gantt-tree-list bg-d-background",
|
|
37
37
|
layout: "vertical",
|
|
38
38
|
width: "100%",
|
|
39
39
|
height: c,
|
|
40
|
-
itemCount:
|
|
41
|
-
itemSize: () =>
|
|
42
|
-
itemData:
|
|
40
|
+
itemCount: i.length,
|
|
41
|
+
itemSize: () => o.ROW_HEIGHT,
|
|
42
|
+
itemData: i,
|
|
43
43
|
innerElementType: ({ children: t, props: e }) => /* @__PURE__ */ d(
|
|
44
44
|
"div",
|
|
45
45
|
{
|
|
46
|
-
style: { height:
|
|
46
|
+
style: { height: i.length * o.ROW_HEIGHT },
|
|
47
47
|
...e,
|
|
48
48
|
children: [
|
|
49
49
|
/* @__PURE__ */ a(
|
|
50
50
|
"div",
|
|
51
51
|
{
|
|
52
52
|
className: "gantt-tree-title bg-d-background",
|
|
53
|
-
style: { height:
|
|
54
|
-
children:
|
|
53
|
+
style: { height: o.HEADER_HEIGHT },
|
|
54
|
+
children: p
|
|
55
55
|
}
|
|
56
56
|
),
|
|
57
57
|
/* @__PURE__ */ a("div", { className: "gantt-tree-inner-wrap", children: t })
|
|
58
58
|
]
|
|
59
59
|
}
|
|
60
60
|
),
|
|
61
|
-
children: ({ style: t, index: e, data:
|
|
62
|
-
const
|
|
61
|
+
children: ({ style: t, index: e, data: r }) => {
|
|
62
|
+
const n = r[e];
|
|
63
63
|
return /* @__PURE__ */ d(
|
|
64
64
|
"button",
|
|
65
65
|
{
|
|
@@ -67,12 +67,12 @@ const b = g(
|
|
|
67
67
|
style: {
|
|
68
68
|
...t,
|
|
69
69
|
backgroundColor: e % 2 === 0 ? "var(--d-background)" : "var(--d-secondary)",
|
|
70
|
-
paddingLeft:
|
|
70
|
+
paddingLeft: o.LEAF_TITLE_PADDING_LEFT + n.level * o.LEAF_CHILDREN_PADDING_LEFT
|
|
71
71
|
},
|
|
72
|
-
onClick: () => u(
|
|
72
|
+
onClick: () => u(n.key),
|
|
73
73
|
children: [
|
|
74
|
-
|
|
75
|
-
/* @__PURE__ */ a("div", { children:
|
|
74
|
+
Object.prototype.hasOwnProperty.call(n, "expanded") ? n.expanded ? /* @__PURE__ */ a(E, { className: "gantt-tree-icon" }) : /* @__PURE__ */ a(b, { className: "gantt-tree-icon" }) : null,
|
|
75
|
+
/* @__PURE__ */ a("div", { children: r[e].title })
|
|
76
76
|
]
|
|
77
77
|
}
|
|
78
78
|
);
|
|
@@ -83,7 +83,7 @@ const b = g(
|
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
85
|
);
|
|
86
|
-
|
|
86
|
+
T.displayName = "Tree";
|
|
87
87
|
export {
|
|
88
|
-
|
|
88
|
+
T as default
|
|
89
89
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import G from "
|
|
5
|
-
import { cn as P } from "../../../../../lib/utils.js";
|
|
3
|
+
import y from "../../../../../_virtual/dayjs.min.js";
|
|
4
|
+
import { useContext as G, useState as h, useMemo as f, useCallback as a } from "react";
|
|
6
5
|
import { Button as g } from "../../../button.js";
|
|
7
6
|
import { Select as S, SelectTrigger as b, SelectValue as x, SelectContent as v, SelectItem as C } from "../../../select.js";
|
|
7
|
+
import { cn as P } from "../../../../../lib/utils.js";
|
|
8
8
|
import { GanttContext as B } from "../Gantt/GanttContext.js";
|
|
9
9
|
import { useGanttCalculate as L } from "../../hooks/useGanttCalculate.js";
|
|
10
10
|
import M from "../../../../../node_modules/lucide-react/dist/esm/icons/chevron-left.js";
|
|
@@ -12,7 +12,7 @@ import R from "../../../../../node_modules/lucide-react/dist/esm/icons/chevron-r
|
|
|
12
12
|
import { GanttDimensionsSettings as l } from "../../constants/DimensionsSettings.js";
|
|
13
13
|
import { DragStepOptions as u } from "../../constants/DragStepOptions.js";
|
|
14
14
|
const Y = ({ className: D }) => {
|
|
15
|
-
const { calculate: s } = L(), { settings: r, setSettings: p, currentDate: j } =
|
|
15
|
+
const { calculate: s } = L(), { settings: r, setSettings: p, currentDate: j } = G(B), [z, c] = h(r.dimension), [t, m] = h(
|
|
16
16
|
Object.keys(l).findIndex(
|
|
17
17
|
(e) => e === r.dimension
|
|
18
18
|
)
|
|
@@ -80,7 +80,7 @@ const Y = ({ className: D }) => {
|
|
|
80
80
|
children: /* @__PURE__ */ n(R, { className: "h-4 w-4" })
|
|
81
81
|
}
|
|
82
82
|
),
|
|
83
|
-
/* @__PURE__ */ n("div", { className: "px-4 text-sm font-medium", children:
|
|
83
|
+
/* @__PURE__ */ n("div", { className: "px-4 text-sm font-medium", children: y.unix(j).format("ddd, ll") }),
|
|
84
84
|
/* @__PURE__ */ d(S, { value: r.dragStepSize, onValueChange: w, children: [
|
|
85
85
|
/* @__PURE__ */ n(b, { className: "w-[180px]", children: /* @__PURE__ */ n(x, { placeholder: "Seleziona step" }) }),
|
|
86
86
|
/* @__PURE__ */ n(v, { children: I.map((e) => /* @__PURE__ */ n(C, { value: e.value, children: e.label }, e.value)) })
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import { useMemo as a, useRef as z, useState as e } from "react";
|
|
4
3
|
import p from "../../../../../_virtual/dayjs.min.js";
|
|
5
|
-
import
|
|
4
|
+
import z from "../../../../../_virtual/localizedFormat.js";
|
|
5
|
+
import { useMemo as a, useRef as H, useState as e } from "react";
|
|
6
6
|
import { GanttContext as M } from "./GanttContext.js";
|
|
7
7
|
import N from "../Chart/Chart.js";
|
|
8
8
|
import P from "../Controls/Controls.js";
|
|
@@ -14,7 +14,7 @@ import { DragStepSizes as U } from "../../enums/DragStepSizes.js";
|
|
|
14
14
|
import { GanttConsts as _ } from "../../constants/GanttConsts.js";
|
|
15
15
|
import { GanttDimensionsSettings as s } from "../../constants/DimensionsSettings.js";
|
|
16
16
|
import { DragStepOptions as b } from "../../constants/DragStepOptions.js";
|
|
17
|
-
p.extend(
|
|
17
|
+
p.extend(z);
|
|
18
18
|
const l = ({
|
|
19
19
|
children: S,
|
|
20
20
|
draggable: d = !1,
|
|
@@ -25,7 +25,7 @@ const l = ({
|
|
|
25
25
|
const r = a(() => {
|
|
26
26
|
const o = t === c.DAY ? m.MONTH : m.DAY;
|
|
27
27
|
return Y(void 0, void 0, o);
|
|
28
|
-
}, [t]), x = a(() => A(t, r), [t, r]), I =
|
|
28
|
+
}, [t]), x = a(() => A(t, r), [t, r]), I = H(null), [g, v] = e(p().unix()), [u, O] = e(r), [C, G] = e({
|
|
29
29
|
stepWidth: s[t].stepWidth,
|
|
30
30
|
secondsInPixel: s[t].secondsInPixel,
|
|
31
31
|
scaleStepItems: _.HOURS_IN_DAY,
|
|
@@ -4,34 +4,41 @@ import { GanttContext as d } from "../components/Gantt/GanttContext.js";
|
|
|
4
4
|
import { getScaleDates as D } from "../utils/getScaleDates.js";
|
|
5
5
|
import { getInitialScrollOffset as z } from "../utils/getInitialScrollOffset.js";
|
|
6
6
|
import { DragStepOptions as C } from "../constants/DragStepOptions.js";
|
|
7
|
-
import { GanttDimensionsSettings as
|
|
7
|
+
import { GanttDimensionsSettings as b } from "../constants/DimensionsSettings.js";
|
|
8
8
|
const k = () => {
|
|
9
|
-
const { setScaleDates:
|
|
9
|
+
const { setScaleDates: r, wrapRef: s, settings: t, setSettings: o, currentDate: e } = f(d);
|
|
10
10
|
return { calculate: u(
|
|
11
|
-
(
|
|
11
|
+
(a) => {
|
|
12
12
|
const {
|
|
13
|
-
stepWidth:
|
|
13
|
+
stepWidth: i,
|
|
14
14
|
itemsCount: S,
|
|
15
|
-
scaleStepItems:
|
|
16
|
-
secondsInPixel:
|
|
17
|
-
unitOfTime:
|
|
18
|
-
} =
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
scaleStepItems: g,
|
|
16
|
+
secondsInPixel: l,
|
|
17
|
+
unitOfTime: p
|
|
18
|
+
} = b[a], n = D(e, S, p), c = z(
|
|
19
|
+
a,
|
|
20
|
+
n,
|
|
21
21
|
e
|
|
22
|
-
), m = C[t.dragStepSize].seconds /
|
|
22
|
+
), m = C[t.dragStepSize].seconds / l;
|
|
23
23
|
o({
|
|
24
|
-
stepWidth:
|
|
25
|
-
initialScrollOffset:
|
|
26
|
-
scaleStepItems:
|
|
27
|
-
secondsInPixel:
|
|
28
|
-
dimension:
|
|
24
|
+
stepWidth: i,
|
|
25
|
+
initialScrollOffset: c,
|
|
26
|
+
scaleStepItems: g,
|
|
27
|
+
secondsInPixel: l,
|
|
28
|
+
dimension: a,
|
|
29
29
|
dragStepSize: t.dragStepSize,
|
|
30
30
|
gridSize: m,
|
|
31
31
|
draggable: t.draggable
|
|
32
|
-
}),
|
|
32
|
+
}), r(n), s.current?.scrollTo({ left: c });
|
|
33
33
|
},
|
|
34
|
-
[
|
|
34
|
+
[
|
|
35
|
+
e,
|
|
36
|
+
r,
|
|
37
|
+
o,
|
|
38
|
+
t.dragStepSize,
|
|
39
|
+
t.draggable,
|
|
40
|
+
s
|
|
41
|
+
]
|
|
35
42
|
) };
|
|
36
43
|
};
|
|
37
44
|
export {
|