laif-ds 0.2.74 → 0.2.75
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 +431 -0
- package/dist/agent-docs/adoption-report.json +614 -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 +29 -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 +143 -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/manifest.json +5979 -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/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 +204 -368
- 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 +210 -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 +256 -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 +2 -0
- 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/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 +67 -43
- package/dist/index.js +229 -229
- package/dist/lib/utils.js +6 -6
- package/dist/styles.v3.css +1 -1
- package/package.json +14 -4
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
3
|
-
import { designTokens as r } from "../design-tokens.js";
|
|
4
|
-
import { Calendar as L } from "./calendar.js";
|
|
5
|
-
import { Icon as X } from "./icon.js";
|
|
6
|
-
import { Label as ue } from "./label.js";
|
|
7
|
-
import { Popover as fe, PopoverTrigger as he, PopoverContent as ge } from "./popover.js";
|
|
8
|
-
import { cn as B } from "../../lib/utils.js";
|
|
9
3
|
import * as f from "react";
|
|
10
|
-
import { useCallback as
|
|
4
|
+
import { useCallback as L, useMemo as p, useEffect as ue } from "react";
|
|
5
|
+
import { designTokens as r } from "../design-tokens.js";
|
|
6
|
+
import { Calendar as X } from "./calendar.js";
|
|
7
|
+
import { Icon as B } from "./icon.js";
|
|
8
|
+
import { Label as fe } from "./label.js";
|
|
9
|
+
import { Popover as he, PopoverTrigger as ge, PopoverContent as ve } from "./popover.js";
|
|
10
|
+
import { cn as G } from "../../lib/utils.js";
|
|
11
11
|
import { TimePickerColumn as k } from "./app-time-picker.js";
|
|
12
12
|
import { it as be } from "../../node_modules/date-fns/locale/it.js";
|
|
13
13
|
import { formatDate as H } from "../../node_modules/date-fns/format.js";
|
|
@@ -53,7 +53,7 @@ function Oe(t) {
|
|
|
53
53
|
s.getMinutes(),
|
|
54
54
|
s.getSeconds()
|
|
55
55
|
), b(a), a && C(a), !n && t.onChange && t.onChange(a), !v && a && V(!1);
|
|
56
|
-
}, ae =
|
|
56
|
+
}, ae = L(() => {
|
|
57
57
|
n ? (N(void 0), t.onChange && t.onChange(void 0)) : (b(void 0), t.onChange && t.onChange(void 0)), A?.();
|
|
58
58
|
}, [n, t.onChange, A]), ne = s?.getHours(), oe = s?.getMinutes(), se = s?.getSeconds(), ie = p(
|
|
59
59
|
() => Array.from({ length: 24 }, (e, a) => a),
|
|
@@ -70,7 +70,7 @@ function Oe(t) {
|
|
|
70
70
|
(e, a) => a * y
|
|
71
71
|
),
|
|
72
72
|
[y]
|
|
73
|
-
), S =
|
|
73
|
+
), S = L(
|
|
74
74
|
(e, a) => {
|
|
75
75
|
const m = s ? new Date(s) : /* @__PURE__ */ new Date();
|
|
76
76
|
s || m.setHours(0, 0, 0, 0), e === "hour" ? m.setHours(a) : e === "minute" ? m.setMinutes(a) : e === "second" && m.setSeconds(a), b(m), !n && t.onChange && t.onChange(m);
|
|
@@ -84,7 +84,7 @@ function Oe(t) {
|
|
|
84
84
|
(e) => !O.some(
|
|
85
85
|
(a) => Ce(a, e)
|
|
86
86
|
)
|
|
87
|
-
), d && (c = [!0]),
|
|
87
|
+
), d && (c = [!0]), ue(() => {
|
|
88
88
|
if (n) {
|
|
89
89
|
N(t.value);
|
|
90
90
|
const e = t.value?.from;
|
|
@@ -99,15 +99,15 @@ function Oe(t) {
|
|
|
99
99
|
i.from && i.to && " - ",
|
|
100
100
|
i.to && H(i.to, D, { locale: u })
|
|
101
101
|
] }) : !n && s ? /* @__PURE__ */ o("span", { children: H(s, D, { locale: u }) }) : /* @__PURE__ */ o("span", { className: "text-d-muted-foreground", children: x });
|
|
102
|
-
return /* @__PURE__ */ l("div", { className:
|
|
103
|
-
I && /* @__PURE__ */ o(
|
|
104
|
-
/* @__PURE__ */ l(
|
|
105
|
-
/* @__PURE__ */ o(
|
|
102
|
+
return /* @__PURE__ */ l("div", { className: G("flex flex-col gap-1.5", W), children: [
|
|
103
|
+
I && /* @__PURE__ */ o(fe, { htmlFor: q, className: U, children: I }),
|
|
104
|
+
/* @__PURE__ */ l(he, { open: d ? !1 : _, onOpenChange: V, modal: !0, children: [
|
|
105
|
+
/* @__PURE__ */ o(ge, { asChild: !0, children: /* @__PURE__ */ l(
|
|
106
106
|
"div",
|
|
107
107
|
{
|
|
108
108
|
id: q,
|
|
109
109
|
"data-testid": Z,
|
|
110
|
-
className:
|
|
110
|
+
className: G(
|
|
111
111
|
r.input.base,
|
|
112
112
|
r.radius.default,
|
|
113
113
|
r.text.base,
|
|
@@ -129,7 +129,7 @@ function Oe(t) {
|
|
|
129
129
|
onClick: d ? void 0 : () => {
|
|
130
130
|
},
|
|
131
131
|
children: [
|
|
132
|
-
/* @__PURE__ */ o(
|
|
132
|
+
/* @__PURE__ */ o(B, { name: "Calendar", size: h === "lg" ? "sm" : "xs" }),
|
|
133
133
|
/* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: me() }),
|
|
134
134
|
ee && E && /* @__PURE__ */ o(
|
|
135
135
|
"div",
|
|
@@ -142,7 +142,7 @@ function Oe(t) {
|
|
|
142
142
|
onMouseDown: (e) => e.preventDefault(),
|
|
143
143
|
"aria-label": "Clear selection",
|
|
144
144
|
children: /* @__PURE__ */ o(
|
|
145
|
-
|
|
145
|
+
B,
|
|
146
146
|
{
|
|
147
147
|
name: "X",
|
|
148
148
|
size: "xs",
|
|
@@ -156,13 +156,13 @@ function Oe(t) {
|
|
|
156
156
|
) }),
|
|
157
157
|
" ",
|
|
158
158
|
/* @__PURE__ */ l(
|
|
159
|
-
|
|
159
|
+
ve,
|
|
160
160
|
{
|
|
161
161
|
className: "flex max-h-[500px] min-h-0 w-auto flex-row p-0 shadow",
|
|
162
162
|
align: "start",
|
|
163
163
|
children: [
|
|
164
164
|
n ? /* @__PURE__ */ o(
|
|
165
|
-
|
|
165
|
+
X,
|
|
166
166
|
{
|
|
167
167
|
...F || {},
|
|
168
168
|
mode: "range",
|
|
@@ -177,7 +177,7 @@ function Oe(t) {
|
|
|
177
177
|
maxDate: j
|
|
178
178
|
}
|
|
179
179
|
) : /* @__PURE__ */ o(
|
|
180
|
-
|
|
180
|
+
X,
|
|
181
181
|
{
|
|
182
182
|
...F || {},
|
|
183
183
|
mode: "single",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r, jsxs as m, Fragment as T } from "react/jsx-runtime";
|
|
3
|
-
import { getNameOrUrl as z, getExt as F, getMimeFromFile as $, imageExts as K, isFile as D, getFileMetadata as B, getFormatIcon as W, formatMetadata as q } from "../../../lib/file-preview.js";
|
|
4
3
|
import { cva as v } from "../../../node_modules/class-variance-authority/dist/index.js";
|
|
5
|
-
import { motion as
|
|
6
|
-
import f, { useEffect as
|
|
4
|
+
import { motion as K } from "framer-motion";
|
|
5
|
+
import f, { useEffect as $, Fragment as B } from "react";
|
|
6
|
+
import { getNameOrUrl as z, getExt as F, getMimeFromFile as U, imageExts as W, isFile as D, getFileMetadata as q, getFormatIcon as G, formatMetadata as X } from "../../../lib/file-preview.js";
|
|
7
7
|
import { Button as H } from "../button.js";
|
|
8
8
|
import { DropdownMenu as J, DropdownMenuTrigger as Q, DropdownMenuContent as Y, DropdownMenuSeparator as Z, DropdownMenuItem as ee } from "../dropdown-menu.js";
|
|
9
9
|
import { Icon as P } from "../icon.js";
|
|
@@ -115,7 +115,7 @@ const re = {
|
|
|
115
115
|
sizeLabel: e,
|
|
116
116
|
formatLabel: a
|
|
117
117
|
}) => {
|
|
118
|
-
const { size: o } = N(), t =
|
|
118
|
+
const { size: o } = N(), t = X(e, a);
|
|
119
119
|
return t ? /* @__PURE__ */ r(
|
|
120
120
|
"div",
|
|
121
121
|
{
|
|
@@ -153,7 +153,7 @@ const re = {
|
|
|
153
153
|
ext: a,
|
|
154
154
|
mimeType: o
|
|
155
155
|
}) => {
|
|
156
|
-
const { size: t } = N(), { iconName: n, colorClass: s } =
|
|
156
|
+
const { size: t } = N(), { iconName: n, colorClass: s } = G(a ?? "", o);
|
|
157
157
|
return /* @__PURE__ */ r(
|
|
158
158
|
"div",
|
|
159
159
|
{
|
|
@@ -241,7 +241,7 @@ const re = {
|
|
|
241
241
|
align: "end",
|
|
242
242
|
onClick: (i) => i.stopPropagation(),
|
|
243
243
|
onPointerDown: (i) => i.stopPropagation(),
|
|
244
|
-
children: u.filter((i) => i.cond).map((i, d, y) => /* @__PURE__ */ m(
|
|
244
|
+
children: u.filter((i) => i.cond).map((i, d, y) => /* @__PURE__ */ m(B, { children: [
|
|
245
245
|
i.danger && y.length > 1 && /* @__PURE__ */ r(Z, {}),
|
|
246
246
|
/* @__PURE__ */ m(
|
|
247
247
|
ee,
|
|
@@ -279,8 +279,8 @@ const re = {
|
|
|
279
279
|
);
|
|
280
280
|
}, Pe = f.forwardRef(
|
|
281
281
|
(e, a) => {
|
|
282
|
-
const o = z(e.file), t = F(o), n =
|
|
283
|
-
return n && n.startsWith("image/") || t &&
|
|
282
|
+
const o = z(e.file), t = F(o), n = U(e.file), s = t === "csv" || n === "text/csv";
|
|
283
|
+
return n && n.startsWith("image/") || t && W.has(t) ? /* @__PURE__ */ r(fe, { ...e, ref: a }) : !s && (t === "txt" || t === "md" || n && n.startsWith("text/")) ? /* @__PURE__ */ r(ue, { ...e, ref: a }) : /* @__PURE__ */ r(me, { ...e, ref: a });
|
|
284
284
|
}
|
|
285
285
|
), L = f.forwardRef(
|
|
286
286
|
({
|
|
@@ -300,7 +300,7 @@ const re = {
|
|
|
300
300
|
const [d, y] = f.useState(
|
|
301
301
|
() => D(e) ? "" : e.url
|
|
302
302
|
);
|
|
303
|
-
|
|
303
|
+
$(() => {
|
|
304
304
|
if (D(e)) {
|
|
305
305
|
const l = URL.createObjectURL(e);
|
|
306
306
|
return y(l), () => {
|
|
@@ -309,7 +309,7 @@ const re = {
|
|
|
309
309
|
} else
|
|
310
310
|
y(e.url);
|
|
311
311
|
}, [e]);
|
|
312
|
-
const S =
|
|
312
|
+
const S = q(e), R = z(e), M = !s && !!g, p = a && (!!t || M), E = async (l) => {
|
|
313
313
|
if (M) {
|
|
314
314
|
try {
|
|
315
315
|
await g(l);
|
|
@@ -332,7 +332,7 @@ const re = {
|
|
|
332
332
|
p && (l.stopPropagation(), (l.key === "Enter" || l.key === " ") && (l.preventDefault(), E(l)));
|
|
333
333
|
};
|
|
334
334
|
return /* @__PURE__ */ r(
|
|
335
|
-
|
|
335
|
+
K.div,
|
|
336
336
|
{
|
|
337
337
|
ref: i,
|
|
338
338
|
role: p ? "button" : "group",
|
|
@@ -396,7 +396,7 @@ const re = {
|
|
|
396
396
|
] }) });
|
|
397
397
|
}), ue = f.forwardRef(({ file: e, showThumbnail: a = !0, ...o }, t) => {
|
|
398
398
|
const [n, s] = f.useState(null), c = z(e), h = o.size ?? "default";
|
|
399
|
-
|
|
399
|
+
$(() => {
|
|
400
400
|
if (D(e)) {
|
|
401
401
|
const g = new FileReader();
|
|
402
402
|
return g.onload = (u) => {
|
|
@@ -437,7 +437,7 @@ const re = {
|
|
|
437
437
|
] })
|
|
438
438
|
] }) });
|
|
439
439
|
}), me = f.forwardRef((e, a) => {
|
|
440
|
-
const o = z(e.file), t = F(o), n =
|
|
440
|
+
const o = z(e.file), t = F(o), n = U(e.file);
|
|
441
441
|
return /* @__PURE__ */ r(L, { ...e, ref: a, children: (s, c) => /* @__PURE__ */ m(T, { children: [
|
|
442
442
|
/* @__PURE__ */ r(k, { ext: t, mimeType: n }),
|
|
443
443
|
/* @__PURE__ */ m("div", { className: "mr-1 flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as f, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo as c } from "react";
|
|
3
4
|
import { createAsk as w } from "../../node_modules/use-ask/dist/index.js";
|
|
4
5
|
import { Dialog as x, DialogContent as g, DialogHeader as N, DialogTitle as y } from "./dialog.js";
|
|
5
6
|
import { Icon as P } from "./icon.js";
|
|
6
7
|
import { SecurePdfViewer as b } from "./secure-pdf-viewer.js";
|
|
7
8
|
import { guessKind as A, isHttpUrl as D, getOfficeEmbedUrl as O } from "../../lib/file-preview.js";
|
|
8
9
|
import { cn as F } from "../../lib/utils.js";
|
|
9
|
-
import { useMemo as c } from "react";
|
|
10
10
|
const [p, T] = w({});
|
|
11
11
|
function h(e) {
|
|
12
12
|
return typeof e == "string" ? { url: e } : e || {};
|
|
@@ -18,20 +18,20 @@ function B(e) {
|
|
|
18
18
|
return p.safeAsk(h(e));
|
|
19
19
|
}
|
|
20
20
|
const E = () => {
|
|
21
|
-
const [{ payload: e }, { asking: i, ok: n }] = T(), l = e?.url, a = e?.readOnly,
|
|
21
|
+
const [{ payload: e }, { asking: i, ok: n }] = T(), l = e?.url, a = e?.readOnly, t = e?.page, o = c(() => e?.filename ? e?.filename : (e?.url || "").split(/[?#]/)[0].split("/").pop() || "" || "document", [e?.filename, e?.url]), m = c(() => {
|
|
22
22
|
if (!e?.url) return null;
|
|
23
23
|
const s = new URL(e?.url), u = s.searchParams.get("response-content-type") || s.searchParams.get("content-type"), d = e?.mimeType || u || "";
|
|
24
24
|
return A({
|
|
25
25
|
mimeType: d,
|
|
26
|
-
filename:
|
|
26
|
+
filename: o,
|
|
27
27
|
url: e?.url
|
|
28
28
|
});
|
|
29
|
-
}, [e?.mimeType,
|
|
29
|
+
}, [e?.mimeType, o, e?.url]), v = c(
|
|
30
30
|
() => /* @__PURE__ */ f("span", { className: "flex items-center gap-2", children: [
|
|
31
31
|
/* @__PURE__ */ r(P, { name: "File", className: "h-4 w-4" }),
|
|
32
|
-
e?.title ||
|
|
32
|
+
e?.title || o
|
|
33
33
|
] }),
|
|
34
|
-
[e?.title,
|
|
34
|
+
[e?.title, o]
|
|
35
35
|
);
|
|
36
36
|
return /* @__PURE__ */ r(x, { open: i, onOpenChange: (s) => !s && n(), children: /* @__PURE__ */ f(g, { size: "xl", className: "sm:max-w-4xl", children: [
|
|
37
37
|
/* @__PURE__ */ r(N, { children: /* @__PURE__ */ r(y, { children: v }) }),
|
|
@@ -42,7 +42,7 @@ const E = () => {
|
|
|
42
42
|
src: l,
|
|
43
43
|
officeUrl: l,
|
|
44
44
|
readOnly: a,
|
|
45
|
-
page:
|
|
45
|
+
page: t
|
|
46
46
|
}
|
|
47
47
|
) : null })
|
|
48
48
|
] }) });
|
|
@@ -65,7 +65,7 @@ const E = () => {
|
|
|
65
65
|
className: "max-h-[78vh] w-auto max-w-full object-contain"
|
|
66
66
|
}
|
|
67
67
|
) });
|
|
68
|
-
case "pdf":
|
|
68
|
+
case "pdf": {
|
|
69
69
|
if (l && i)
|
|
70
70
|
return /* @__PURE__ */ r(
|
|
71
71
|
b,
|
|
@@ -75,15 +75,16 @@ const E = () => {
|
|
|
75
75
|
className: "w-full"
|
|
76
76
|
}
|
|
77
77
|
);
|
|
78
|
-
let
|
|
79
|
-
return a > 0 && (
|
|
78
|
+
let t = i;
|
|
79
|
+
return a > 0 && (t += "#page=" + a), /* @__PURE__ */ r(
|
|
80
80
|
"iframe",
|
|
81
81
|
{
|
|
82
|
-
src:
|
|
82
|
+
src: t,
|
|
83
83
|
title: "PDF Preview",
|
|
84
84
|
className: "h-[78vh] w-full rounded"
|
|
85
85
|
}
|
|
86
86
|
);
|
|
87
|
+
}
|
|
87
88
|
case "audio":
|
|
88
89
|
return /* @__PURE__ */ r("div", { className: "grid place-items-center", children: /* @__PURE__ */ r("audio", { controls: !0, className: "w-full max-w-2xl", children: /* @__PURE__ */ r("source", { src: i }) }) });
|
|
89
90
|
case "video":
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
-
import * as s from "react";
|
|
4
3
|
import { Root as f } from "../../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
4
|
+
import * as s from "react";
|
|
5
5
|
import { FormProvider as u, Controller as F, useFormContext as x, useFormState as I } from "../../node_modules/react-hook-form/dist/index.esm.js";
|
|
6
|
-
import { cn as a } from "../../lib/utils.js";
|
|
7
6
|
import { Label as g } from "./label.js";
|
|
7
|
+
import { cn as a } from "../../lib/utils.js";
|
|
8
8
|
const S = u, c = s.createContext(
|
|
9
9
|
{}
|
|
10
10
|
), $ = ({
|
|
@@ -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,
|