@pactor-app/ui 1.46.0 → 1.47.0
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/{chunk-QB2RZXDD.js → chunk-7VDIDB3K.js} +818 -874
- package/dist/{chunk-FU4P7CAM.js → chunk-B2Y6JC36.js} +281 -84
- package/dist/{chunk-XA7J5SGA.js → chunk-F7GQYNTG.js} +230 -355
- package/dist/{chunk-HU2RFIWH.js → chunk-OBSD66BK.js} +82 -7
- package/dist/{chunk-JV2V4HCI.js → chunk-RLAOCITX.js} +2 -2
- package/dist/{chunk-7OBUSV5S.js → chunk-YHTRCBKF.js} +184 -59
- package/dist/components/index.cjs +1242 -1113
- package/dist/components/index.d.cts +36 -4
- package/dist/components/index.d.ts +36 -4
- package/dist/components/index.js +6 -6
- package/dist/index.cjs +1349 -1145
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -8
- package/dist/interaction/index.cjs +80 -5
- package/dist/interaction/index.d.cts +26 -0
- package/dist/interaction/index.d.ts +26 -0
- package/dist/interaction/index.js +1 -1
- package/dist/layout/index.cjs +435 -154
- package/dist/layout/index.js +3 -3
- package/dist/ui/index.js +10 -10
- package/package.json +6 -6
- package/styles.css +9 -0
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
+
DropdownMenu as DropdownMenu2,
|
|
2
3
|
Icon,
|
|
3
4
|
Menu,
|
|
4
|
-
Sidebar
|
|
5
|
-
|
|
5
|
+
Sidebar,
|
|
6
|
+
Tooltip as Tooltip2,
|
|
7
|
+
renderDropdownItems,
|
|
8
|
+
triggerWrapper
|
|
9
|
+
} from "./chunk-B2Y6JC36.js";
|
|
6
10
|
import {
|
|
7
11
|
Alert,
|
|
8
12
|
AlertDescription,
|
|
@@ -51,14 +55,6 @@ import {
|
|
|
51
55
|
ContextMenuContent,
|
|
52
56
|
ContextMenuItem,
|
|
53
57
|
ContextMenuTrigger,
|
|
54
|
-
DropdownMenu,
|
|
55
|
-
DropdownMenuContent,
|
|
56
|
-
DropdownMenuItem,
|
|
57
|
-
DropdownMenuSeparator,
|
|
58
|
-
DropdownMenuSub,
|
|
59
|
-
DropdownMenuSubContent,
|
|
60
|
-
DropdownMenuSubTrigger,
|
|
61
|
-
DropdownMenuTrigger,
|
|
62
58
|
Empty,
|
|
63
59
|
EmptyContent,
|
|
64
60
|
EmptyDescription,
|
|
@@ -138,7 +134,7 @@ import {
|
|
|
138
134
|
Typography,
|
|
139
135
|
navigationMenuTriggerStyle,
|
|
140
136
|
toast
|
|
141
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-F7GQYNTG.js";
|
|
142
138
|
import {
|
|
143
139
|
Dialog,
|
|
144
140
|
DialogContent,
|
|
@@ -161,6 +157,14 @@ import {
|
|
|
161
157
|
CardContent,
|
|
162
158
|
CardHeader,
|
|
163
159
|
CardTitle,
|
|
160
|
+
DropdownMenu,
|
|
161
|
+
DropdownMenuContent,
|
|
162
|
+
DropdownMenuItem,
|
|
163
|
+
DropdownMenuSeparator,
|
|
164
|
+
DropdownMenuSub,
|
|
165
|
+
DropdownMenuSubContent,
|
|
166
|
+
DropdownMenuSubTrigger,
|
|
167
|
+
DropdownMenuTrigger,
|
|
164
168
|
Input,
|
|
165
169
|
Popover,
|
|
166
170
|
PopoverContent,
|
|
@@ -174,7 +178,7 @@ import {
|
|
|
174
178
|
Tooltip,
|
|
175
179
|
TooltipContent,
|
|
176
180
|
TooltipTrigger
|
|
177
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-YHTRCBKF.js";
|
|
178
182
|
import {
|
|
179
183
|
Button,
|
|
180
184
|
buttonVariants,
|
|
@@ -256,15 +260,7 @@ function Alert2({
|
|
|
256
260
|
// src/components/components/AlertDialog/index.tsx
|
|
257
261
|
import { useI18n, useRenderer as useRenderer2 } from "@pactor-app/runtime";
|
|
258
262
|
import { useState } from "react";
|
|
259
|
-
|
|
260
|
-
// src/components/components/trigger-render.tsx
|
|
261
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
262
|
-
function triggerWrapper(slot) {
|
|
263
|
-
return /* @__PURE__ */ jsx4("span", { "data-slot": slot });
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
// src/components/components/AlertDialog/index.tsx
|
|
267
|
-
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
263
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
268
264
|
function AlertDialog2({
|
|
269
265
|
title,
|
|
270
266
|
description,
|
|
@@ -292,7 +288,7 @@ function AlertDialog2({
|
|
|
292
288
|
}
|
|
293
289
|
},
|
|
294
290
|
children: [
|
|
295
|
-
trigger ? /* @__PURE__ */
|
|
291
|
+
trigger ? /* @__PURE__ */ jsx4(
|
|
296
292
|
AlertDialogTrigger,
|
|
297
293
|
{
|
|
298
294
|
nativeButton: false,
|
|
@@ -302,12 +298,12 @@ function AlertDialog2({
|
|
|
302
298
|
) : null,
|
|
303
299
|
/* @__PURE__ */ jsxs3(AlertDialogContent, { className, style, children: [
|
|
304
300
|
/* @__PURE__ */ jsxs3(AlertDialogHeader, { children: [
|
|
305
|
-
/* @__PURE__ */
|
|
306
|
-
description ? /* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ jsx4(AlertDialogTitle, { children: title ?? "" }),
|
|
302
|
+
description ? /* @__PURE__ */ jsx4(AlertDialogDescription, { children: description }) : null
|
|
307
303
|
] }),
|
|
308
304
|
/* @__PURE__ */ jsxs3(AlertDialogFooter, { children: [
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ jsx4(AlertDialogCancel, { onClick: () => onCancel?.(), children: cancelText ?? t("pactor.alertDialog.cancel") }),
|
|
306
|
+
/* @__PURE__ */ jsx4(AlertDialogAction, { onClick: () => onConfirm?.(), children: confirmText ?? t("pactor.alertDialog.confirm") })
|
|
311
307
|
] })
|
|
312
308
|
] })
|
|
313
309
|
]
|
|
@@ -317,7 +313,7 @@ function AlertDialog2({
|
|
|
317
313
|
|
|
318
314
|
// src/components/components/Anchor/index.tsx
|
|
319
315
|
import { useEffect, useRef, useState as useState2 } from "react";
|
|
320
|
-
import { jsx as
|
|
316
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
321
317
|
function flatten(items) {
|
|
322
318
|
return items.flatMap((item) => [item, ...flatten(item.children ?? [])]);
|
|
323
319
|
}
|
|
@@ -371,8 +367,8 @@ function Anchor({ items = [], activeKey, onChange, offsetTop = 0, className, sty
|
|
|
371
367
|
onChangeRef.current?.(href);
|
|
372
368
|
}
|
|
373
369
|
};
|
|
374
|
-
const renderItems = (list, depth) => /* @__PURE__ */
|
|
375
|
-
/* @__PURE__ */
|
|
370
|
+
const renderItems = (list, depth) => /* @__PURE__ */ jsx5("ul", { "data-slot": "anchor-list", className: cn(depth > 0 && "mt-1 flex flex-col gap-1"), children: list.map((item) => /* @__PURE__ */ jsxs4("li", { className: cn(depth > 0 && "pl-4"), children: [
|
|
371
|
+
/* @__PURE__ */ jsx5(
|
|
376
372
|
"a",
|
|
377
373
|
{
|
|
378
374
|
"data-slot": "anchor-link",
|
|
@@ -388,7 +384,7 @@ function Anchor({ items = [], activeKey, onChange, offsetTop = 0, className, sty
|
|
|
388
384
|
),
|
|
389
385
|
item.children?.length ? renderItems(item.children, depth + 1) : null
|
|
390
386
|
] }, item.href)) });
|
|
391
|
-
return /* @__PURE__ */
|
|
387
|
+
return /* @__PURE__ */ jsx5(
|
|
392
388
|
"nav",
|
|
393
389
|
{
|
|
394
390
|
"data-slot": "anchor",
|
|
@@ -400,13 +396,13 @@ function Anchor({ items = [], activeKey, onChange, offsetTop = 0, className, sty
|
|
|
400
396
|
}
|
|
401
397
|
|
|
402
398
|
// src/components/components/AspectRatio/index.tsx
|
|
403
|
-
import { jsx as
|
|
399
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
404
400
|
function AspectRatio2({ ratio = 1, children, className, style }) {
|
|
405
|
-
return /* @__PURE__ */
|
|
401
|
+
return /* @__PURE__ */ jsx6(AspectRatio, { ratio, className, style, children });
|
|
406
402
|
}
|
|
407
403
|
|
|
408
404
|
// src/components/components/Audio/index.tsx
|
|
409
|
-
import { jsx as
|
|
405
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
410
406
|
function Audio({
|
|
411
407
|
src,
|
|
412
408
|
controls = true,
|
|
@@ -416,7 +412,7 @@ function Audio({
|
|
|
416
412
|
className,
|
|
417
413
|
style
|
|
418
414
|
}) {
|
|
419
|
-
return /* @__PURE__ */
|
|
415
|
+
return /* @__PURE__ */ jsx7(
|
|
420
416
|
"audio",
|
|
421
417
|
{
|
|
422
418
|
"data-slot": "audio",
|
|
@@ -432,18 +428,18 @@ function Audio({
|
|
|
432
428
|
}
|
|
433
429
|
|
|
434
430
|
// src/components/components/Avatar/index.tsx
|
|
435
|
-
import { jsx as
|
|
431
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
436
432
|
function Avatar2({ src, alt, fallback, className, style }) {
|
|
437
433
|
return /* @__PURE__ */ jsxs5(Avatar, { className, style, children: [
|
|
438
|
-
src ? /* @__PURE__ */
|
|
439
|
-
fallback ? /* @__PURE__ */
|
|
434
|
+
src ? /* @__PURE__ */ jsx8(AvatarImage, { src, alt: alt ?? "" }) : null,
|
|
435
|
+
fallback ? /* @__PURE__ */ jsx8(AvatarFallback, { children: fallback }) : null
|
|
440
436
|
] });
|
|
441
437
|
}
|
|
442
438
|
|
|
443
439
|
// src/components/components/BackTop/index.tsx
|
|
444
440
|
import { useI18n as useI18n2 } from "@pactor-app/runtime";
|
|
445
441
|
import { useEffect as useEffect2, useState as useState3 } from "react";
|
|
446
|
-
import { jsx as
|
|
442
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
447
443
|
function BackTop({ visibilityHeight = 400, children, className, style }) {
|
|
448
444
|
const [visible, setVisible] = useState3(false);
|
|
449
445
|
const { t } = useI18n2();
|
|
@@ -454,7 +450,7 @@ function BackTop({ visibilityHeight = 400, children, className, style }) {
|
|
|
454
450
|
return () => window.removeEventListener("scroll", update);
|
|
455
451
|
}, [visibilityHeight]);
|
|
456
452
|
if (!visible) return null;
|
|
457
|
-
return /* @__PURE__ */
|
|
453
|
+
return /* @__PURE__ */ jsx9(
|
|
458
454
|
"button",
|
|
459
455
|
{
|
|
460
456
|
type: "button",
|
|
@@ -466,15 +462,15 @@ function BackTop({ visibilityHeight = 400, children, className, style }) {
|
|
|
466
462
|
),
|
|
467
463
|
style,
|
|
468
464
|
onClick: () => window.scrollTo({ top: 0, behavior: "smooth" }),
|
|
469
|
-
children: children ?? /* @__PURE__ */
|
|
465
|
+
children: children ?? /* @__PURE__ */ jsx9(Icon, { name: "arrow-up", size: "sm" })
|
|
470
466
|
}
|
|
471
467
|
);
|
|
472
468
|
}
|
|
473
469
|
|
|
474
470
|
// src/components/components/Badge/index.tsx
|
|
475
|
-
import { jsx as
|
|
471
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
476
472
|
function Badge2({ text, variant = "default", className, style }) {
|
|
477
|
-
return /* @__PURE__ */
|
|
473
|
+
return /* @__PURE__ */ jsx10(Badge, { variant, className, style, children: text });
|
|
478
474
|
}
|
|
479
475
|
|
|
480
476
|
// src/components/components/Breadcrumb/index.tsx
|
|
@@ -496,14 +492,14 @@ function useSpaLinkClick() {
|
|
|
496
492
|
}
|
|
497
493
|
|
|
498
494
|
// src/components/components/Breadcrumb/index.tsx
|
|
499
|
-
import { jsx as
|
|
495
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
500
496
|
function Breadcrumb2({ items = [], className, style }) {
|
|
501
497
|
const handleSpaClick = useSpaLinkClick();
|
|
502
|
-
return /* @__PURE__ */
|
|
498
|
+
return /* @__PURE__ */ jsx11(Breadcrumb, { className, style, children: /* @__PURE__ */ jsx11(BreadcrumbList, { children: items.map((item, index) => {
|
|
503
499
|
const isLast = index === items.length - 1;
|
|
504
500
|
return /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
505
|
-
index > 0 ? /* @__PURE__ */
|
|
506
|
-
/* @__PURE__ */
|
|
501
|
+
index > 0 ? /* @__PURE__ */ jsx11(BreadcrumbSeparator, {}) : null,
|
|
502
|
+
/* @__PURE__ */ jsx11(BreadcrumbItem, { children: isLast || !item.href ? /* @__PURE__ */ jsx11(BreadcrumbPage, { children: item.label }) : /* @__PURE__ */ jsx11(
|
|
507
503
|
BreadcrumbLink,
|
|
508
504
|
{
|
|
509
505
|
href: item.href,
|
|
@@ -517,7 +513,7 @@ function Breadcrumb2({ items = [], className, style }) {
|
|
|
517
513
|
|
|
518
514
|
// src/components/components/Button/index.tsx
|
|
519
515
|
import { Loader2 } from "lucide-react";
|
|
520
|
-
import { jsx as
|
|
516
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
521
517
|
var variantMap2 = {
|
|
522
518
|
default: "outline",
|
|
523
519
|
primary: "default",
|
|
@@ -562,24 +558,24 @@ function Button2({
|
|
|
562
558
|
className
|
|
563
559
|
),
|
|
564
560
|
children: [
|
|
565
|
-
loading ? /* @__PURE__ */
|
|
561
|
+
loading ? /* @__PURE__ */ jsx12(Loader2, { "aria-hidden": true, className: "animate-spin" }) : icon ? /* @__PURE__ */ jsx12(Icon, { name: icon, size: "sm" }) : null,
|
|
566
562
|
text ?? children
|
|
567
563
|
]
|
|
568
564
|
}
|
|
569
565
|
);
|
|
570
566
|
if (tooltip) {
|
|
571
567
|
return /* @__PURE__ */ jsxs7(Tooltip, { children: [
|
|
572
|
-
/* @__PURE__ */
|
|
573
|
-
/* @__PURE__ */
|
|
568
|
+
/* @__PURE__ */ jsx12(TooltipTrigger, { render: button }),
|
|
569
|
+
/* @__PURE__ */ jsx12(TooltipContent, { children: tooltip })
|
|
574
570
|
] });
|
|
575
571
|
}
|
|
576
572
|
return button;
|
|
577
573
|
}
|
|
578
574
|
|
|
579
575
|
// src/components/components/ButtonGroup/index.tsx
|
|
580
|
-
import { jsx as
|
|
576
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
581
577
|
function ButtonGroup2({ className, style, children }) {
|
|
582
|
-
return /* @__PURE__ */
|
|
578
|
+
return /* @__PURE__ */ jsx13(ButtonGroup, { className, style, children });
|
|
583
579
|
}
|
|
584
580
|
|
|
585
581
|
// src/components/components/Calendar/index.tsx
|
|
@@ -605,7 +601,7 @@ function formItemClass(layout) {
|
|
|
605
601
|
}
|
|
606
602
|
|
|
607
603
|
// src/components/components/Calendar/index.tsx
|
|
608
|
-
import { jsx as
|
|
604
|
+
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
609
605
|
function parseValue(value) {
|
|
610
606
|
if (typeof value !== "string" || value === "") return void 0;
|
|
611
607
|
const date = parseISO(value);
|
|
@@ -639,7 +635,7 @@ function Calendar2({
|
|
|
639
635
|
}
|
|
640
636
|
onChange?.(next);
|
|
641
637
|
};
|
|
642
|
-
const calendar = /* @__PURE__ */
|
|
638
|
+
const calendar = /* @__PURE__ */ jsx14(
|
|
643
639
|
Calendar,
|
|
644
640
|
{
|
|
645
641
|
mode,
|
|
@@ -659,9 +655,9 @@ function Calendar2({
|
|
|
659
655
|
className: cn(formItemClass(form.layout), className),
|
|
660
656
|
style,
|
|
661
657
|
children: [
|
|
662
|
-
label ? /* @__PURE__ */
|
|
658
|
+
label ? /* @__PURE__ */ jsx14("label", { className: "shrink-0 text-sm leading-none font-medium whitespace-nowrap", children: label }) : null,
|
|
663
659
|
calendar,
|
|
664
|
-
error ? /* @__PURE__ */
|
|
660
|
+
error ? /* @__PURE__ */ jsx14("div", { "data-slot": "form-error", className: "text-sm text-destructive", children: error }) : null
|
|
665
661
|
]
|
|
666
662
|
}
|
|
667
663
|
);
|
|
@@ -671,10 +667,10 @@ function Calendar2({
|
|
|
671
667
|
|
|
672
668
|
// src/components/components/Card/index.tsx
|
|
673
669
|
import { useRenderer as useRenderer4 } from "@pactor-app/runtime";
|
|
674
|
-
import { jsx as
|
|
670
|
+
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
675
671
|
function ExtraSlot({ extra }) {
|
|
676
672
|
const { renderChildren } = useRenderer4();
|
|
677
|
-
return /* @__PURE__ */
|
|
673
|
+
return /* @__PURE__ */ jsx15("div", { "data-slot": "card-action", className: "flex items-center justify-end gap-2", children: renderChildren(extra) });
|
|
678
674
|
}
|
|
679
675
|
function Card2({
|
|
680
676
|
title,
|
|
@@ -705,14 +701,14 @@ function Card2({
|
|
|
705
701
|
onClick,
|
|
706
702
|
children: [
|
|
707
703
|
title || extra ? /* @__PURE__ */ jsxs9(CardHeader, { className: "px-4", children: [
|
|
708
|
-
title ? /* @__PURE__ */
|
|
709
|
-
extra ? /* @__PURE__ */
|
|
704
|
+
title ? /* @__PURE__ */ jsx15(CardTitle, { children: title }) : null,
|
|
705
|
+
extra ? /* @__PURE__ */ jsx15(ExtraSlot, { extra }) : null
|
|
710
706
|
] }) : null,
|
|
711
|
-
loading ? /* @__PURE__ */
|
|
712
|
-
/* @__PURE__ */
|
|
713
|
-
/* @__PURE__ */
|
|
714
|
-
/* @__PURE__ */
|
|
715
|
-
] }) }) : /* @__PURE__ */
|
|
707
|
+
loading ? /* @__PURE__ */ jsx15(CardContent, { className: cn("px-4", contentClassName), children: /* @__PURE__ */ jsxs9("div", { "data-slot": "card-loading", className: "flex flex-col gap-3", children: [
|
|
708
|
+
/* @__PURE__ */ jsx15(Skeleton, { className: "h-4 w-full" }),
|
|
709
|
+
/* @__PURE__ */ jsx15(Skeleton, { className: "h-4 w-3/4" }),
|
|
710
|
+
/* @__PURE__ */ jsx15(Skeleton, { className: "h-24 w-full" })
|
|
711
|
+
] }) }) : /* @__PURE__ */ jsx15(CardContent, { className: cn("px-4", contentClassName), children })
|
|
716
712
|
]
|
|
717
713
|
}
|
|
718
714
|
);
|
|
@@ -721,7 +717,7 @@ function Card2({
|
|
|
721
717
|
// src/components/components/Carousel/index.tsx
|
|
722
718
|
import { useRenderer as useRenderer5 } from "@pactor-app/runtime";
|
|
723
719
|
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
724
|
-
import { jsx as
|
|
720
|
+
import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
725
721
|
function isDslNode(item) {
|
|
726
722
|
return typeof item.type === "string";
|
|
727
723
|
}
|
|
@@ -754,7 +750,7 @@ function Carousel2({
|
|
|
754
750
|
className,
|
|
755
751
|
style,
|
|
756
752
|
children: [
|
|
757
|
-
/* @__PURE__ */
|
|
753
|
+
/* @__PURE__ */ jsx16(CarouselContent, { children: items.map((item, index) => /* @__PURE__ */ jsx16(CarouselItem, { children: isDslNode(item) ? renderChildren([item]) : /* @__PURE__ */ jsx16(
|
|
758
754
|
"img",
|
|
759
755
|
{
|
|
760
756
|
src: item.src,
|
|
@@ -762,8 +758,8 @@ function Carousel2({
|
|
|
762
758
|
className: "w-full rounded-md object-cover"
|
|
763
759
|
}
|
|
764
760
|
) }, index)) }),
|
|
765
|
-
/* @__PURE__ */
|
|
766
|
-
/* @__PURE__ */
|
|
761
|
+
/* @__PURE__ */ jsx16(CarouselPrevious, {}),
|
|
762
|
+
/* @__PURE__ */ jsx16(CarouselNext, {})
|
|
767
763
|
]
|
|
768
764
|
}
|
|
769
765
|
);
|
|
@@ -776,11 +772,11 @@ import { useEffect as useEffect5, useId, useState as useState5 } from "react";
|
|
|
776
772
|
|
|
777
773
|
// src/components/clearable.tsx
|
|
778
774
|
import { X } from "lucide-react";
|
|
779
|
-
import { jsx as
|
|
775
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
780
776
|
var CLEARABLE_GROUP = "group";
|
|
781
777
|
var CLEARABLE_ICON_HIDE = "group-hover:hidden";
|
|
782
778
|
function ClearHoverButton({ label, onClear, className }) {
|
|
783
|
-
return /* @__PURE__ */
|
|
779
|
+
return /* @__PURE__ */ jsx17(
|
|
784
780
|
"span",
|
|
785
781
|
{
|
|
786
782
|
role: "button",
|
|
@@ -798,7 +794,7 @@ function ClearHoverButton({ label, onClear, className }) {
|
|
|
798
794
|
event.preventDefault();
|
|
799
795
|
event.stopPropagation();
|
|
800
796
|
},
|
|
801
|
-
children: /* @__PURE__ */
|
|
797
|
+
children: /* @__PURE__ */ jsx17(X, { className: "size-4" })
|
|
802
798
|
}
|
|
803
799
|
);
|
|
804
800
|
}
|
|
@@ -831,30 +827,138 @@ var CONTROL_SIZE_TRIGGER_TEXT = {
|
|
|
831
827
|
};
|
|
832
828
|
|
|
833
829
|
// src/components/components/Form/form-item.tsx
|
|
834
|
-
import {
|
|
830
|
+
import { useContext as useContext2 } from "react";
|
|
831
|
+
|
|
832
|
+
// src/components/components/Field/index.tsx
|
|
833
|
+
import { createContext as createContext2 } from "react";
|
|
834
|
+
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
835
|
+
var FieldNestContext = createContext2(false);
|
|
836
|
+
function Field2({
|
|
837
|
+
label,
|
|
838
|
+
required,
|
|
839
|
+
labelHint,
|
|
840
|
+
description,
|
|
841
|
+
error,
|
|
842
|
+
children,
|
|
843
|
+
className,
|
|
844
|
+
style,
|
|
845
|
+
labelClassName,
|
|
846
|
+
labelStyle,
|
|
847
|
+
labelHintClassName,
|
|
848
|
+
labelHintStyle,
|
|
849
|
+
controlClassName,
|
|
850
|
+
controlStyle,
|
|
851
|
+
descriptionClassName,
|
|
852
|
+
descriptionStyle,
|
|
853
|
+
errorClassName,
|
|
854
|
+
errorStyle
|
|
855
|
+
}) {
|
|
856
|
+
const form = useFormContext();
|
|
857
|
+
const inline = form?.layout === "inline";
|
|
858
|
+
return /* @__PURE__ */ jsx18(
|
|
859
|
+
Field,
|
|
860
|
+
{
|
|
861
|
+
className: cn(
|
|
862
|
+
form?.layout === "vertical" && "mb-2",
|
|
863
|
+
// inline Form:label 与控件同一行(覆盖默认 flex-col)
|
|
864
|
+
inline && "flex-row items-center",
|
|
865
|
+
className
|
|
866
|
+
),
|
|
867
|
+
style,
|
|
868
|
+
children: /* @__PURE__ */ jsxs11(FieldNestContext.Provider, { value: true, children: [
|
|
869
|
+
label || labelHint ? /* @__PURE__ */ jsxs11(
|
|
870
|
+
"div",
|
|
871
|
+
{
|
|
872
|
+
className: cn(
|
|
873
|
+
"flex min-h-3.5 items-center gap-2",
|
|
874
|
+
inline ? "shrink-0" : "w-full justify-between"
|
|
875
|
+
),
|
|
876
|
+
children: [
|
|
877
|
+
label ? /* @__PURE__ */ jsxs11(FieldLabel, { className: labelClassName, style: labelStyle, children: [
|
|
878
|
+
required ? /* @__PURE__ */ jsxs11("span", { "aria-hidden": true, className: "text-destructive", children: [
|
|
879
|
+
"*",
|
|
880
|
+
" "
|
|
881
|
+
] }) : null,
|
|
882
|
+
label
|
|
883
|
+
] }) : /* @__PURE__ */ jsx18("span", {}),
|
|
884
|
+
labelHint ? /* @__PURE__ */ jsx18(
|
|
885
|
+
"span",
|
|
886
|
+
{
|
|
887
|
+
"data-slot": "field-label-hint",
|
|
888
|
+
className: cn(
|
|
889
|
+
"shrink-0 text-xs leading-none text-muted-foreground",
|
|
890
|
+
labelHintClassName
|
|
891
|
+
),
|
|
892
|
+
style: labelHintStyle,
|
|
893
|
+
children: labelHint
|
|
894
|
+
}
|
|
895
|
+
) : null
|
|
896
|
+
]
|
|
897
|
+
}
|
|
898
|
+
) : null,
|
|
899
|
+
/* @__PURE__ */ jsx18(
|
|
900
|
+
"div",
|
|
901
|
+
{
|
|
902
|
+
"data-slot": "field-control",
|
|
903
|
+
className: cn("[&>button+button]:ml-2", controlClassName),
|
|
904
|
+
style: controlStyle,
|
|
905
|
+
children
|
|
906
|
+
}
|
|
907
|
+
),
|
|
908
|
+
description ? /* @__PURE__ */ jsx18(
|
|
909
|
+
FieldDescription,
|
|
910
|
+
{
|
|
911
|
+
className: descriptionClassName,
|
|
912
|
+
style: descriptionStyle,
|
|
913
|
+
children: description
|
|
914
|
+
}
|
|
915
|
+
) : null,
|
|
916
|
+
error ? /* @__PURE__ */ jsx18(FieldError, { match: true, className: errorClassName, style: errorStyle, children: error }) : null
|
|
917
|
+
] })
|
|
918
|
+
}
|
|
919
|
+
);
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
// src/components/components/Form/form-item.tsx
|
|
923
|
+
import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
835
924
|
function FieldShell({
|
|
836
925
|
layout,
|
|
837
926
|
label,
|
|
838
927
|
htmlFor,
|
|
928
|
+
rules,
|
|
839
929
|
error,
|
|
840
930
|
className,
|
|
841
931
|
style,
|
|
842
932
|
children
|
|
843
933
|
}) {
|
|
844
|
-
|
|
845
|
-
|
|
934
|
+
const required = rules?.some((rule) => rule.required) === true;
|
|
935
|
+
const inField = useContext2(FieldNestContext);
|
|
936
|
+
return /* @__PURE__ */ jsxs12(
|
|
937
|
+
Field,
|
|
846
938
|
{
|
|
847
939
|
"data-slot": "form-item",
|
|
848
|
-
className: cn(
|
|
940
|
+
className: cn(
|
|
941
|
+
// ShadcnField 基础为 flex-col:horizontal / inline 需显式回正为行向
|
|
942
|
+
layout !== "vertical" && "flex-row",
|
|
943
|
+
inField ? layout === "vertical" ? "flex flex-col gap-2" : "flex items-center gap-2" : formItemClass(layout),
|
|
944
|
+
className
|
|
945
|
+
),
|
|
849
946
|
style,
|
|
850
947
|
children: [
|
|
851
|
-
label ?
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
className: "
|
|
856
|
-
|
|
857
|
-
|
|
948
|
+
label ? (
|
|
949
|
+
// 星号为 label 的同级 aria-hidden 兄弟(而非伪元素 / label 子节点):
|
|
950
|
+
// 不占 label 文本内容与可访问名,视觉仍在 label 前
|
|
951
|
+
/* @__PURE__ */ jsxs12("span", { className: "flex items-center", children: [
|
|
952
|
+
required ? /* @__PURE__ */ jsx19("span", { "aria-hidden": true, className: "mr-0.5 text-destructive", children: "*" }) : null,
|
|
953
|
+
/* @__PURE__ */ jsx19(
|
|
954
|
+
"label",
|
|
955
|
+
{
|
|
956
|
+
htmlFor,
|
|
957
|
+
className: "shrink-0 text-sm leading-none font-medium whitespace-nowrap",
|
|
958
|
+
children: label
|
|
959
|
+
}
|
|
960
|
+
)
|
|
961
|
+
] })
|
|
858
962
|
) : null,
|
|
859
963
|
children,
|
|
860
964
|
error ? /* @__PURE__ */ jsx19("div", { "data-slot": "form-error", className: "text-sm text-destructive", children: error }) : null
|
|
@@ -864,7 +968,7 @@ function FieldShell({
|
|
|
864
968
|
}
|
|
865
969
|
|
|
866
970
|
// src/components/components/Cascader/index.tsx
|
|
867
|
-
import { jsx as jsx20, jsxs as
|
|
971
|
+
import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
868
972
|
function resolvePath(options, path) {
|
|
869
973
|
const nodes = [];
|
|
870
974
|
let level = options;
|
|
@@ -947,8 +1051,8 @@ function Cascader({
|
|
|
947
1051
|
if ((node.children?.length ?? 0) > 0) columns.push(node.children ?? []);
|
|
948
1052
|
else break;
|
|
949
1053
|
}
|
|
950
|
-
const control = /* @__PURE__ */
|
|
951
|
-
/* @__PURE__ */
|
|
1054
|
+
const control = /* @__PURE__ */ jsxs13(Popover, { open, onOpenChange: openPanel, children: [
|
|
1055
|
+
/* @__PURE__ */ jsxs13(
|
|
952
1056
|
PopoverTrigger,
|
|
953
1057
|
{
|
|
954
1058
|
id: controlId,
|
|
@@ -986,7 +1090,7 @@ function Cascader({
|
|
|
986
1090
|
children: column.map((option) => {
|
|
987
1091
|
const hasChildren = (option.children?.length ?? 0) > 0;
|
|
988
1092
|
const active = activePath[depth] === option.value;
|
|
989
|
-
return /* @__PURE__ */
|
|
1093
|
+
return /* @__PURE__ */ jsxs13(
|
|
990
1094
|
"button",
|
|
991
1095
|
{
|
|
992
1096
|
type: "button",
|
|
@@ -1013,6 +1117,7 @@ function Cascader({
|
|
|
1013
1117
|
{
|
|
1014
1118
|
layout: form.layout,
|
|
1015
1119
|
label,
|
|
1120
|
+
rules,
|
|
1016
1121
|
htmlFor: controlId,
|
|
1017
1122
|
error: form.errors[name],
|
|
1018
1123
|
className,
|
|
@@ -1026,7 +1131,7 @@ function Cascader({
|
|
|
1026
1131
|
|
|
1027
1132
|
// src/components/components/Checkbox/index.tsx
|
|
1028
1133
|
import { useEffect as useEffect6, useId as useId2 } from "react";
|
|
1029
|
-
import { jsx as jsx21, jsxs as
|
|
1134
|
+
import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1030
1135
|
function Checkbox2({
|
|
1031
1136
|
name,
|
|
1032
1137
|
label,
|
|
@@ -1055,7 +1160,7 @@ function Checkbox2({
|
|
|
1055
1160
|
}
|
|
1056
1161
|
onChange?.(next);
|
|
1057
1162
|
};
|
|
1058
|
-
const control = /* @__PURE__ */
|
|
1163
|
+
const control = /* @__PURE__ */ jsxs14(
|
|
1059
1164
|
"span",
|
|
1060
1165
|
{
|
|
1061
1166
|
className: cn("inline-flex items-center gap-2", !inForm && className),
|
|
@@ -1076,7 +1181,7 @@ function Checkbox2({
|
|
|
1076
1181
|
}
|
|
1077
1182
|
);
|
|
1078
1183
|
if (inForm && form && name) {
|
|
1079
|
-
return /* @__PURE__ */
|
|
1184
|
+
return /* @__PURE__ */ jsxs14(
|
|
1080
1185
|
"div",
|
|
1081
1186
|
{
|
|
1082
1187
|
"data-slot": "form-item",
|
|
@@ -1093,9 +1198,9 @@ function Checkbox2({
|
|
|
1093
1198
|
}
|
|
1094
1199
|
|
|
1095
1200
|
// src/components/components/ChipNode/index.tsx
|
|
1096
|
-
import { jsx as jsx22, jsxs as
|
|
1201
|
+
import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1097
1202
|
function ChipNode({ text, selected, dot, onClick, className, style }) {
|
|
1098
|
-
return /* @__PURE__ */
|
|
1203
|
+
return /* @__PURE__ */ jsxs15(
|
|
1099
1204
|
"button",
|
|
1100
1205
|
{
|
|
1101
1206
|
type: "button",
|
|
@@ -1168,7 +1273,7 @@ function ChipFilter({
|
|
|
1168
1273
|
import { useI18n as useI18n4 } from "@pactor-app/runtime";
|
|
1169
1274
|
import { useState as useState6 } from "react";
|
|
1170
1275
|
import { CodeBlock as HighlightedCodeBlock, registerCodeLanguages } from "@pactor-app/markdown";
|
|
1171
|
-
import { jsx as jsx24, jsxs as
|
|
1276
|
+
import { jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1172
1277
|
registerCodeLanguages();
|
|
1173
1278
|
function CodeBlock({ code = "", language = "text", copyable = true, className, style }) {
|
|
1174
1279
|
const [copied, setCopied] = useState6(false);
|
|
@@ -1181,7 +1286,7 @@ function CodeBlock({ code = "", language = "text", copyable = true, className, s
|
|
|
1181
1286
|
} catch {
|
|
1182
1287
|
}
|
|
1183
1288
|
};
|
|
1184
|
-
return /* @__PURE__ */
|
|
1289
|
+
return /* @__PURE__ */ jsxs16(
|
|
1185
1290
|
"div",
|
|
1186
1291
|
{
|
|
1187
1292
|
"data-slot": "code-block",
|
|
@@ -1207,7 +1312,7 @@ function CodeBlock({ code = "", language = "text", copyable = true, className, s
|
|
|
1207
1312
|
|
|
1208
1313
|
// src/components/components/Collapsible/index.tsx
|
|
1209
1314
|
import { useState as useState7 } from "react";
|
|
1210
|
-
import { jsx as jsx25, jsxs as
|
|
1315
|
+
import { jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1211
1316
|
function Collapsible2({
|
|
1212
1317
|
title,
|
|
1213
1318
|
open,
|
|
@@ -1217,7 +1322,7 @@ function Collapsible2({
|
|
|
1217
1322
|
}) {
|
|
1218
1323
|
const [innerOpen, setInnerOpen] = useState7(false);
|
|
1219
1324
|
const controlled = open !== void 0;
|
|
1220
|
-
return /* @__PURE__ */
|
|
1325
|
+
return /* @__PURE__ */ jsxs17(
|
|
1221
1326
|
Collapsible,
|
|
1222
1327
|
{
|
|
1223
1328
|
open: controlled ? open : innerOpen,
|
|
@@ -1244,7 +1349,7 @@ import {
|
|
|
1244
1349
|
useRef as useRef2,
|
|
1245
1350
|
useState as useState8
|
|
1246
1351
|
} from "react";
|
|
1247
|
-
import { jsx as jsx26, jsxs as
|
|
1352
|
+
import { jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1248
1353
|
var HEX_RE = /^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;
|
|
1249
1354
|
function normalizeHex(value) {
|
|
1250
1355
|
const trimmed = value.trim();
|
|
@@ -1473,8 +1578,8 @@ function ColorPicker({
|
|
|
1473
1578
|
{ key: "b", label: "B", text: String(channelB) },
|
|
1474
1579
|
{ key: "a", label: "A", text: String(hsva.a) }
|
|
1475
1580
|
];
|
|
1476
|
-
const control = /* @__PURE__ */
|
|
1477
|
-
/* @__PURE__ */
|
|
1581
|
+
const control = /* @__PURE__ */ jsxs18(Popover, { open, onOpenChange: openPanel, children: [
|
|
1582
|
+
/* @__PURE__ */ jsxs18(
|
|
1478
1583
|
PopoverTrigger,
|
|
1479
1584
|
{
|
|
1480
1585
|
id: controlId,
|
|
@@ -1503,7 +1608,7 @@ function ColorPicker({
|
|
|
1503
1608
|
]
|
|
1504
1609
|
}
|
|
1505
1610
|
),
|
|
1506
|
-
/* @__PURE__ */ jsx26(PopoverContent, { className: "w-64", children: /* @__PURE__ */
|
|
1611
|
+
/* @__PURE__ */ jsx26(PopoverContent, { className: "w-64", children: /* @__PURE__ */ jsxs18("div", { "data-slot": "colorpicker-panel", className: "flex flex-col gap-3", children: [
|
|
1507
1612
|
/* @__PURE__ */ jsx26(
|
|
1508
1613
|
"div",
|
|
1509
1614
|
{
|
|
@@ -1528,8 +1633,8 @@ function ColorPicker({
|
|
|
1528
1633
|
)
|
|
1529
1634
|
}
|
|
1530
1635
|
),
|
|
1531
|
-
/* @__PURE__ */
|
|
1532
|
-
/* @__PURE__ */
|
|
1636
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
|
|
1637
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
1533
1638
|
/* @__PURE__ */ jsx26(
|
|
1534
1639
|
"div",
|
|
1535
1640
|
{
|
|
@@ -1591,7 +1696,7 @@ function ColorPicker({
|
|
|
1591
1696
|
}
|
|
1592
1697
|
)
|
|
1593
1698
|
] }),
|
|
1594
|
-
/* @__PURE__ */
|
|
1699
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-1.5", children: [
|
|
1595
1700
|
/* @__PURE__ */ jsx26(
|
|
1596
1701
|
Input,
|
|
1597
1702
|
{
|
|
@@ -1608,7 +1713,7 @@ function ColorPicker({
|
|
|
1608
1713
|
}
|
|
1609
1714
|
}
|
|
1610
1715
|
),
|
|
1611
|
-
/* @__PURE__ */ jsx26("div", { className: "flex items-start gap-1", children: channels.map((channel) => /* @__PURE__ */
|
|
1716
|
+
/* @__PURE__ */ jsx26("div", { className: "flex items-start gap-1", children: channels.map((channel) => /* @__PURE__ */ jsxs18("div", { className: "flex min-w-0 flex-1 flex-col items-center gap-0.5", children: [
|
|
1612
1717
|
/* @__PURE__ */ jsx26(
|
|
1613
1718
|
Input,
|
|
1614
1719
|
{
|
|
@@ -1651,6 +1756,7 @@ function ColorPicker({
|
|
|
1651
1756
|
{
|
|
1652
1757
|
layout: form.layout,
|
|
1653
1758
|
label,
|
|
1759
|
+
rules,
|
|
1654
1760
|
htmlFor: controlId,
|
|
1655
1761
|
error: form.errors[name],
|
|
1656
1762
|
className,
|
|
@@ -1665,7 +1771,7 @@ function ColorPicker({
|
|
|
1665
1771
|
// src/components/components/Combobox/index.tsx
|
|
1666
1772
|
import { useI18n as useI18n6 } from "@pactor-app/runtime";
|
|
1667
1773
|
import { useEffect as useEffect8, useId as useId4, useState as useState9 } from "react";
|
|
1668
|
-
import { jsx as jsx27, jsxs as
|
|
1774
|
+
import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1669
1775
|
function Combobox2({
|
|
1670
1776
|
name,
|
|
1671
1777
|
label,
|
|
@@ -1718,7 +1824,7 @@ function Combobox2({
|
|
|
1718
1824
|
onChange?.(option.value);
|
|
1719
1825
|
setOpen(false);
|
|
1720
1826
|
};
|
|
1721
|
-
const control = /* @__PURE__ */
|
|
1827
|
+
const control = /* @__PURE__ */ jsxs19(Combobox, { open, onOpenChange: setOpen, children: [
|
|
1722
1828
|
/* @__PURE__ */ jsx27(
|
|
1723
1829
|
ComboboxTrigger,
|
|
1724
1830
|
{
|
|
@@ -1737,9 +1843,9 @@ function Combobox2({
|
|
|
1737
1843
|
children: selected ? selected.label : placeholder ?? ""
|
|
1738
1844
|
}
|
|
1739
1845
|
),
|
|
1740
|
-
/* @__PURE__ */ jsx27(ComboboxContent, { children: /* @__PURE__ */
|
|
1846
|
+
/* @__PURE__ */ jsx27(ComboboxContent, { children: /* @__PURE__ */ jsxs19(Command, { children: [
|
|
1741
1847
|
searchable ? /* @__PURE__ */ jsx27(CommandInput, { placeholder }) : null,
|
|
1742
|
-
/* @__PURE__ */
|
|
1848
|
+
/* @__PURE__ */ jsxs19(CommandList, { children: [
|
|
1743
1849
|
/* @__PURE__ */ jsx27(CommandEmpty, { children: t("pactor.command.empty") }),
|
|
1744
1850
|
/* @__PURE__ */ jsx27(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsx27(
|
|
1745
1851
|
CommandItem,
|
|
@@ -1758,7 +1864,7 @@ function Combobox2({
|
|
|
1758
1864
|
] });
|
|
1759
1865
|
if (inForm && form && name) {
|
|
1760
1866
|
const error = form.errors[name];
|
|
1761
|
-
return /* @__PURE__ */
|
|
1867
|
+
return /* @__PURE__ */ jsxs19(
|
|
1762
1868
|
"div",
|
|
1763
1869
|
{
|
|
1764
1870
|
"data-slot": "form-item",
|
|
@@ -1784,7 +1890,7 @@ function Combobox2({
|
|
|
1784
1890
|
|
|
1785
1891
|
// src/components/components/Command/index.tsx
|
|
1786
1892
|
import { useI18n as useI18n7 } from "@pactor-app/runtime";
|
|
1787
|
-
import { jsx as jsx28, jsxs as
|
|
1893
|
+
import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1788
1894
|
function Command2({
|
|
1789
1895
|
groups = [],
|
|
1790
1896
|
placeholder,
|
|
@@ -1794,11 +1900,11 @@ function Command2({
|
|
|
1794
1900
|
style
|
|
1795
1901
|
}) {
|
|
1796
1902
|
const { t } = useI18n7();
|
|
1797
|
-
return /* @__PURE__ */
|
|
1903
|
+
return /* @__PURE__ */ jsxs20(Command, { className, style, children: [
|
|
1798
1904
|
/* @__PURE__ */ jsx28(CommandInput, { placeholder }),
|
|
1799
|
-
/* @__PURE__ */
|
|
1905
|
+
/* @__PURE__ */ jsxs20(CommandList, { children: [
|
|
1800
1906
|
/* @__PURE__ */ jsx28(CommandEmpty, { children: emptyText ?? t("pactor.command.empty") }),
|
|
1801
|
-
groups.map((group, index) => /* @__PURE__ */ jsx28(CommandGroup, { heading: group.heading, children: group.items.map((item) => /* @__PURE__ */
|
|
1907
|
+
groups.map((group, index) => /* @__PURE__ */ jsx28(CommandGroup, { heading: group.heading, children: group.items.map((item) => /* @__PURE__ */ jsxs20(
|
|
1802
1908
|
CommandItem,
|
|
1803
1909
|
{
|
|
1804
1910
|
value: item.value,
|
|
@@ -1825,7 +1931,7 @@ import {
|
|
|
1825
1931
|
useRef as useRef3,
|
|
1826
1932
|
useState as useState10
|
|
1827
1933
|
} from "react";
|
|
1828
|
-
import { jsx as jsx29, jsxs as
|
|
1934
|
+
import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1829
1935
|
function useOptionalRenderer() {
|
|
1830
1936
|
try {
|
|
1831
1937
|
return useRenderer6();
|
|
@@ -1884,7 +1990,7 @@ function ChatInput({
|
|
|
1884
1990
|
const handleComposition = (event) => {
|
|
1885
1991
|
composingRef.current = event.type === "compositionstart";
|
|
1886
1992
|
};
|
|
1887
|
-
return /* @__PURE__ */
|
|
1993
|
+
return /* @__PURE__ */ jsxs21(
|
|
1888
1994
|
"div",
|
|
1889
1995
|
{
|
|
1890
1996
|
"data-slot": "chat-input",
|
|
@@ -1909,7 +2015,7 @@ function ChatInput({
|
|
|
1909
2015
|
className: "min-h-[60px] resize-none border-0 px-4 pt-3 pb-1 shadow-none focus-visible:border-transparent focus-visible:ring-0"
|
|
1910
2016
|
}
|
|
1911
2017
|
),
|
|
1912
|
-
toolbarStart || toolbarEnd || !hideSend ? /* @__PURE__ */
|
|
2018
|
+
toolbarStart || toolbarEnd || !hideSend ? /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-1 px-2 pb-2", children: [
|
|
1913
2019
|
toolbarStart ? renderSlot(toolbarStart) : null,
|
|
1914
2020
|
/* @__PURE__ */ jsx29("span", { className: "flex-1" }),
|
|
1915
2021
|
toolbarEnd ? renderSlot(toolbarEnd) : null,
|
|
@@ -1982,7 +2088,7 @@ function Content({ className, style, children }) {
|
|
|
1982
2088
|
}
|
|
1983
2089
|
|
|
1984
2090
|
// src/components/components/ContextMenu/index.tsx
|
|
1985
|
-
import { jsx as jsx32, jsxs as
|
|
2091
|
+
import { jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1986
2092
|
function ContextMenu2({
|
|
1987
2093
|
items = [],
|
|
1988
2094
|
onSelect,
|
|
@@ -1990,9 +2096,9 @@ function ContextMenu2({
|
|
|
1990
2096
|
className,
|
|
1991
2097
|
style
|
|
1992
2098
|
}) {
|
|
1993
|
-
return /* @__PURE__ */
|
|
2099
|
+
return /* @__PURE__ */ jsxs22(ContextMenu, { children: [
|
|
1994
2100
|
/* @__PURE__ */ jsx32(ContextMenuTrigger, { children }),
|
|
1995
|
-
/* @__PURE__ */ jsx32(ContextMenuContent, { className, style, children: items.map((item) => /* @__PURE__ */
|
|
2101
|
+
/* @__PURE__ */ jsx32(ContextMenuContent, { className, style, children: items.map((item) => /* @__PURE__ */ jsxs22(
|
|
1996
2102
|
ContextMenuItem,
|
|
1997
2103
|
{
|
|
1998
2104
|
variant: item.danger ? "destructive" : "default",
|
|
@@ -2012,7 +2118,7 @@ function ContextMenu2({
|
|
|
2012
2118
|
import { useI18n as useI18n9, useRenderer as useRenderer7 } from "@pactor-app/runtime";
|
|
2013
2119
|
import { ArrowDown, ArrowUp as ArrowUp2, ArrowUpDown } from "lucide-react";
|
|
2014
2120
|
import { useMemo, useState as useState11 } from "react";
|
|
2015
|
-
import { jsx as jsx33, jsxs as
|
|
2121
|
+
import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2016
2122
|
function renderCellValue(value) {
|
|
2017
2123
|
if (value === void 0 || value === null) {
|
|
2018
2124
|
return "";
|
|
@@ -2081,12 +2187,12 @@ function DataTable({
|
|
|
2081
2187
|
setCurrent(page);
|
|
2082
2188
|
onPageChange?.(page);
|
|
2083
2189
|
};
|
|
2084
|
-
return /* @__PURE__ */
|
|
2085
|
-
/* @__PURE__ */
|
|
2190
|
+
return /* @__PURE__ */ jsxs23("div", { "data-slot": "data-table", className: cn("relative", className), style, children: [
|
|
2191
|
+
/* @__PURE__ */ jsxs23(Table, { children: [
|
|
2086
2192
|
/* @__PURE__ */ jsx33(TableHeader, { children: /* @__PURE__ */ jsx33(TableRow, { className: "hover:bg-transparent", children: columns.map((column, index) => {
|
|
2087
2193
|
const sorted = sortState?.key === column.key;
|
|
2088
|
-
return /* @__PURE__ */ jsx33(TableHead, { children: /* @__PURE__ */
|
|
2089
|
-
column.sortable ? /* @__PURE__ */
|
|
2194
|
+
return /* @__PURE__ */ jsx33(TableHead, { children: /* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-1", children: [
|
|
2195
|
+
column.sortable ? /* @__PURE__ */ jsxs23(
|
|
2090
2196
|
"button",
|
|
2091
2197
|
{
|
|
2092
2198
|
type: "button",
|
|
@@ -2177,7 +2283,7 @@ import {
|
|
|
2177
2283
|
import { enUS, zhCN } from "date-fns/locale";
|
|
2178
2284
|
import { Calendar as CalendarIcon } from "lucide-react";
|
|
2179
2285
|
import { useEffect as useEffect9, useId as useId5, useState as useState12 } from "react";
|
|
2180
|
-
import { jsx as jsx34, jsxs as
|
|
2286
|
+
import { jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2181
2287
|
function toDateFnsLocale(locale) {
|
|
2182
2288
|
switch (locale) {
|
|
2183
2289
|
case "zh-CN":
|
|
@@ -2352,7 +2458,7 @@ function DatePicker(props) {
|
|
|
2352
2458
|
const displayText = isRange ? typeof current === "object" && current !== null ? `${current.start} ~ ${current.end}` : "" : typeof current === "string" ? current : "";
|
|
2353
2459
|
const showClear = allowClear !== false && disabled !== true && displayText !== "";
|
|
2354
2460
|
const placeholderText = placeholder ?? t(isRange ? "pactor.datePicker.placeholderRange" : "pactor.datePicker.placeholder");
|
|
2355
|
-
const calendar = isRange ? /* @__PURE__ */
|
|
2461
|
+
const calendar = isRange ? /* @__PURE__ */ jsxs24("div", { className: "flex", children: [
|
|
2356
2462
|
/* @__PURE__ */ jsx34(
|
|
2357
2463
|
"div",
|
|
2358
2464
|
{
|
|
@@ -2395,8 +2501,8 @@ function DatePicker(props) {
|
|
|
2395
2501
|
locale: dfLocale
|
|
2396
2502
|
}
|
|
2397
2503
|
);
|
|
2398
|
-
const control = /* @__PURE__ */
|
|
2399
|
-
/* @__PURE__ */
|
|
2504
|
+
const control = /* @__PURE__ */ jsxs24(Popover, { open, onOpenChange: setOpen, children: [
|
|
2505
|
+
/* @__PURE__ */ jsxs24(
|
|
2400
2506
|
PopoverTrigger,
|
|
2401
2507
|
{
|
|
2402
2508
|
id: controlId,
|
|
@@ -2429,7 +2535,7 @@ function DatePicker(props) {
|
|
|
2429
2535
|
]
|
|
2430
2536
|
}
|
|
2431
2537
|
),
|
|
2432
|
-
/* @__PURE__ */ jsx34(PopoverContent, { className: "w-auto p-0", children: presetList.length > 0 ? /* @__PURE__ */
|
|
2538
|
+
/* @__PURE__ */ jsx34(PopoverContent, { className: "w-auto p-0", children: presetList.length > 0 ? /* @__PURE__ */ jsxs24("div", { className: "flex", children: [
|
|
2433
2539
|
/* @__PURE__ */ jsx34(
|
|
2434
2540
|
"div",
|
|
2435
2541
|
{
|
|
@@ -2455,7 +2561,7 @@ function DatePicker(props) {
|
|
|
2455
2561
|
] });
|
|
2456
2562
|
if (inForm && form && name) {
|
|
2457
2563
|
const error = form.errors[name];
|
|
2458
|
-
return /* @__PURE__ */
|
|
2564
|
+
return /* @__PURE__ */ jsxs24(
|
|
2459
2565
|
"div",
|
|
2460
2566
|
{
|
|
2461
2567
|
"data-slot": "form-item",
|
|
@@ -2480,7 +2586,7 @@ function DatePicker(props) {
|
|
|
2480
2586
|
}
|
|
2481
2587
|
|
|
2482
2588
|
// src/components/components/Descriptions/index.tsx
|
|
2483
|
-
import { jsx as jsx35, jsxs as
|
|
2589
|
+
import { jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2484
2590
|
function Descriptions({
|
|
2485
2591
|
title,
|
|
2486
2592
|
items = [],
|
|
@@ -2489,7 +2595,7 @@ function Descriptions({
|
|
|
2489
2595
|
className,
|
|
2490
2596
|
style
|
|
2491
2597
|
}) {
|
|
2492
|
-
return /* @__PURE__ */
|
|
2598
|
+
return /* @__PURE__ */ jsxs25("div", { "data-slot": "descriptions", className: cn("w-full", className), style, children: [
|
|
2493
2599
|
title ? /* @__PURE__ */ jsx35("div", { "data-slot": "descriptions-title", className: "mb-3 text-base font-medium", children: title }) : null,
|
|
2494
2600
|
/* @__PURE__ */ jsx35(
|
|
2495
2601
|
"div",
|
|
@@ -2501,7 +2607,7 @@ function Descriptions({
|
|
|
2501
2607
|
),
|
|
2502
2608
|
style: { gridTemplateColumns: `repeat(${column}, minmax(0, 1fr))` },
|
|
2503
2609
|
children: items.map(
|
|
2504
|
-
(item, index) => bordered ? /* @__PURE__ */
|
|
2610
|
+
(item, index) => bordered ? /* @__PURE__ */ jsxs25(
|
|
2505
2611
|
"div",
|
|
2506
2612
|
{
|
|
2507
2613
|
"data-slot": "descriptions-item",
|
|
@@ -2519,7 +2625,7 @@ function Descriptions({
|
|
|
2519
2625
|
]
|
|
2520
2626
|
},
|
|
2521
2627
|
index
|
|
2522
|
-
) : /* @__PURE__ */
|
|
2628
|
+
) : /* @__PURE__ */ jsxs25("div", { "data-slot": "descriptions-item", className: "flex gap-2 text-sm", children: [
|
|
2523
2629
|
/* @__PURE__ */ jsx35(
|
|
2524
2630
|
"span",
|
|
2525
2631
|
{
|
|
@@ -2539,7 +2645,7 @@ function Descriptions({
|
|
|
2539
2645
|
// src/components/components/Dialog/index.tsx
|
|
2540
2646
|
import { useRenderer as useRenderer8 } from "@pactor-app/runtime";
|
|
2541
2647
|
import { useState as useState13 } from "react";
|
|
2542
|
-
import { jsx as jsx36, jsxs as
|
|
2648
|
+
import { jsx as jsx36, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2543
2649
|
function Dialog2({
|
|
2544
2650
|
title,
|
|
2545
2651
|
description,
|
|
@@ -2554,7 +2660,7 @@ function Dialog2({
|
|
|
2554
2660
|
const [innerOpen, setInnerOpen] = useState13(false);
|
|
2555
2661
|
const controlled = open !== void 0;
|
|
2556
2662
|
const visible = controlled ? open : innerOpen;
|
|
2557
|
-
return /* @__PURE__ */
|
|
2663
|
+
return /* @__PURE__ */ jsxs26(
|
|
2558
2664
|
Dialog,
|
|
2559
2665
|
{
|
|
2560
2666
|
open: visible,
|
|
@@ -2575,8 +2681,8 @@ function Dialog2({
|
|
|
2575
2681
|
children: renderChildren([trigger])
|
|
2576
2682
|
}
|
|
2577
2683
|
) : null,
|
|
2578
|
-
/* @__PURE__ */
|
|
2579
|
-
title || description ? /* @__PURE__ */
|
|
2684
|
+
/* @__PURE__ */ jsxs26(DialogContent, { className, style, children: [
|
|
2685
|
+
title || description ? /* @__PURE__ */ jsxs26(DialogHeader, { children: [
|
|
2580
2686
|
title ? /* @__PURE__ */ jsx36(DialogTitle, { children: title }) : null,
|
|
2581
2687
|
description ? /* @__PURE__ */ jsx36(DialogDescription, { children: description }) : null
|
|
2582
2688
|
] }) : null,
|
|
@@ -2589,7 +2695,7 @@ function Dialog2({
|
|
|
2589
2695
|
|
|
2590
2696
|
// src/components/components/DiffViewer/index.tsx
|
|
2591
2697
|
import { useMemo as useMemo2 } from "react";
|
|
2592
|
-
import { jsx as jsx37, jsxs as
|
|
2698
|
+
import { jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2593
2699
|
function diffLines(oldText, newText) {
|
|
2594
2700
|
const a = oldText === "" ? [] : oldText.split("\n");
|
|
2595
2701
|
const b = newText === "" ? [] : newText.split("\n");
|
|
@@ -2639,13 +2745,13 @@ var signClass = {
|
|
|
2639
2745
|
del: "text-destructive"
|
|
2640
2746
|
};
|
|
2641
2747
|
function UnifiedView({ ops }) {
|
|
2642
|
-
return /* @__PURE__ */ jsx37("div", { "data-slot": "diff-viewer-unified", children: ops.map((op, index) => /* @__PURE__ */
|
|
2748
|
+
return /* @__PURE__ */ jsx37("div", { "data-slot": "diff-viewer-unified", children: ops.map((op, index) => /* @__PURE__ */ jsxs27("div", { "data-slot": "diff-row", "data-type": op.type, className: cn("flex", rowClass[op.type]), children: [
|
|
2643
2749
|
/* @__PURE__ */ jsx37("span", { className: cn("w-6 shrink-0 text-center select-none", signClass[op.type]), children: signMap[op.type] }),
|
|
2644
2750
|
/* @__PURE__ */ jsx37("span", { className: "flex-1 whitespace-pre-wrap break-all", children: op.text || " " })
|
|
2645
2751
|
] }, index)) });
|
|
2646
2752
|
}
|
|
2647
2753
|
function SplitView({ ops }) {
|
|
2648
|
-
const rows = ops.map((op, index) => /* @__PURE__ */
|
|
2754
|
+
const rows = ops.map((op, index) => /* @__PURE__ */ jsxs27("div", { className: "flex", children: [
|
|
2649
2755
|
/* @__PURE__ */ jsx37(
|
|
2650
2756
|
"div",
|
|
2651
2757
|
{
|
|
@@ -2677,14 +2783,14 @@ function SplitView({ ops }) {
|
|
|
2677
2783
|
}
|
|
2678
2784
|
function DiffViewer({ oldText = "", newText = "", split, oldTitle, newTitle, className, style }) {
|
|
2679
2785
|
const ops = useMemo2(() => diffLines(oldText, newText), [oldText, newText]);
|
|
2680
|
-
return /* @__PURE__ */
|
|
2786
|
+
return /* @__PURE__ */ jsxs27(
|
|
2681
2787
|
"div",
|
|
2682
2788
|
{
|
|
2683
2789
|
"data-slot": "diff-viewer",
|
|
2684
2790
|
className: cn("w-full overflow-hidden rounded-md border border-border font-mono text-xs", className),
|
|
2685
2791
|
style,
|
|
2686
2792
|
children: [
|
|
2687
|
-
split && (oldTitle || newTitle) ? /* @__PURE__ */
|
|
2793
|
+
split && (oldTitle || newTitle) ? /* @__PURE__ */ jsxs27("div", { "data-slot": "diff-viewer-header", className: "flex border-b border-border bg-muted font-sans", children: [
|
|
2688
2794
|
/* @__PURE__ */ jsx37("div", { className: "w-1/2 border-r border-border px-2 py-1.5 font-medium", children: oldTitle ?? "" }),
|
|
2689
2795
|
/* @__PURE__ */ jsx37("div", { className: "w-1/2 px-2 py-1.5 font-medium", children: newTitle ?? "" })
|
|
2690
2796
|
] }) : null,
|
|
@@ -2697,7 +2803,7 @@ function DiffViewer({ oldText = "", newText = "", split, oldTitle, newTitle, cla
|
|
|
2697
2803
|
// src/components/components/DocumentPreview/index.tsx
|
|
2698
2804
|
import { useI18n as useI18n11 } from "@pactor-app/runtime";
|
|
2699
2805
|
import { useState as useState14 } from "react";
|
|
2700
|
-
import { jsx as jsx38, jsxs as
|
|
2806
|
+
import { jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2701
2807
|
var MIN_SCALE = 0.5;
|
|
2702
2808
|
var MAX_SCALE = 2;
|
|
2703
2809
|
var toolButtonClass = "flex size-8 items-center justify-center rounded-md hover:bg-accent disabled:pointer-events-none disabled:opacity-50";
|
|
@@ -2717,14 +2823,14 @@ function DocumentPreview({ pages = [], currentPage, onChange, className, style }
|
|
|
2717
2823
|
onChange?.(next);
|
|
2718
2824
|
}
|
|
2719
2825
|
};
|
|
2720
|
-
return /* @__PURE__ */
|
|
2826
|
+
return /* @__PURE__ */ jsxs28(
|
|
2721
2827
|
"div",
|
|
2722
2828
|
{
|
|
2723
2829
|
"data-slot": "document-preview",
|
|
2724
2830
|
className: cn("flex w-full flex-col overflow-hidden rounded-md border border-border", className),
|
|
2725
2831
|
style,
|
|
2726
2832
|
children: [
|
|
2727
|
-
/* @__PURE__ */
|
|
2833
|
+
/* @__PURE__ */ jsxs28(
|
|
2728
2834
|
"div",
|
|
2729
2835
|
{
|
|
2730
2836
|
"data-slot": "document-preview-toolbar",
|
|
@@ -2810,7 +2916,7 @@ function DocumentPreview({ pages = [], currentPage, onChange, className, style }
|
|
|
2810
2916
|
import { useI18n as useI18n12, useRenderer as useRenderer9 } from "@pactor-app/runtime";
|
|
2811
2917
|
import { XIcon } from "lucide-react";
|
|
2812
2918
|
import { useEffect as useEffect10, useState as useState15 } from "react";
|
|
2813
|
-
import { Fragment as Fragment2, jsx as jsx39, jsxs as
|
|
2919
|
+
import { Fragment as Fragment2, jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2814
2920
|
function Drawer2({
|
|
2815
2921
|
title,
|
|
2816
2922
|
open,
|
|
@@ -2850,7 +2956,7 @@ function Drawer2({
|
|
|
2850
2956
|
handleClose();
|
|
2851
2957
|
}
|
|
2852
2958
|
},
|
|
2853
|
-
children: /* @__PURE__ */
|
|
2959
|
+
children: /* @__PURE__ */ jsxs29(
|
|
2854
2960
|
DrawerContent,
|
|
2855
2961
|
{
|
|
2856
2962
|
className,
|
|
@@ -2870,7 +2976,7 @@ function Drawer2({
|
|
|
2870
2976
|
) : null,
|
|
2871
2977
|
title ? /* @__PURE__ */ jsx39(DrawerHeader, { children: /* @__PURE__ */ jsx39(DrawerTitle, { children: title }) }) : null,
|
|
2872
2978
|
/* @__PURE__ */ jsx39("div", { className: "flex-1 overflow-auto p-4", children }),
|
|
2873
|
-
footer !== false ? /* @__PURE__ */ jsx39(DrawerFooter, { className: "shrink-0 flex-row justify-end gap-2 border-t border-border px-4 py-3", children: footer !== void 0 ? renderChildren([footer]) : /* @__PURE__ */
|
|
2979
|
+
footer !== false ? /* @__PURE__ */ jsx39(DrawerFooter, { className: "shrink-0 flex-row justify-end gap-2 border-t border-border px-4 py-3", children: footer !== void 0 ? renderChildren([footer]) : /* @__PURE__ */ jsxs29(Fragment2, { children: [
|
|
2874
2980
|
/* @__PURE__ */ jsx39(Button, { type: "button", variant: "outline", onClick: handleClose, children: cancelText ?? t("pactor.alertDialog.cancel") }),
|
|
2875
2981
|
/* @__PURE__ */ jsx39(Button, { type: "button", onClick: () => onOk?.(), children: okText ?? t("pactor.alertDialog.confirm") })
|
|
2876
2982
|
] }) }) : null
|
|
@@ -2881,167 +2987,21 @@ function Drawer2({
|
|
|
2881
2987
|
);
|
|
2882
2988
|
}
|
|
2883
2989
|
|
|
2884
|
-
// src/components/components/DropdownMenu/index.tsx
|
|
2885
|
-
import { jsx as jsx40, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2886
|
-
function renderDropdownItems(items, onSelect) {
|
|
2887
|
-
const checkable = items.some((i) => i.selected);
|
|
2888
|
-
return items.map((item, index) => {
|
|
2889
|
-
const key = item.value ?? `item-${index}`;
|
|
2890
|
-
if (item.separator) {
|
|
2891
|
-
return /* @__PURE__ */ jsx40(DropdownMenuSeparator, {}, `separator-${index}`);
|
|
2892
|
-
}
|
|
2893
|
-
const leading = item.selected ? /* @__PURE__ */ jsx40(Icon, { name: "check", size: "sm" }) : item.icon ? /* @__PURE__ */ jsx40(Icon, { name: item.icon, size: "sm" }) : checkable ? /* @__PURE__ */ jsx40("span", { className: "size-4 shrink-0" }) : null;
|
|
2894
|
-
if (item.children && item.children.length > 0) {
|
|
2895
|
-
return /* @__PURE__ */ jsxs29(DropdownMenuSub, { children: [
|
|
2896
|
-
/* @__PURE__ */ jsxs29(DropdownMenuSubTrigger, { disabled: item.disabled, children: [
|
|
2897
|
-
leading,
|
|
2898
|
-
item.label,
|
|
2899
|
-
item.trailing ? /* @__PURE__ */ jsx40("span", { className: "ml-auto pl-4 text-xs text-muted-foreground", children: item.trailing }) : null
|
|
2900
|
-
] }),
|
|
2901
|
-
/* @__PURE__ */ jsx40(DropdownMenuSubContent, { children: renderDropdownItems(item.children, onSelect) })
|
|
2902
|
-
] }, key);
|
|
2903
|
-
}
|
|
2904
|
-
return /* @__PURE__ */ jsxs29(
|
|
2905
|
-
DropdownMenuItem,
|
|
2906
|
-
{
|
|
2907
|
-
variant: item.danger ? "destructive" : "default",
|
|
2908
|
-
disabled: item.disabled,
|
|
2909
|
-
onClick: () => item.value !== void 0 && onSelect?.(item.value),
|
|
2910
|
-
children: [
|
|
2911
|
-
leading,
|
|
2912
|
-
item.label,
|
|
2913
|
-
item.trailing ? /* @__PURE__ */ jsx40("span", { className: "ml-auto pl-4 text-xs text-muted-foreground", children: item.trailing }) : null
|
|
2914
|
-
]
|
|
2915
|
-
},
|
|
2916
|
-
key
|
|
2917
|
-
);
|
|
2918
|
-
});
|
|
2919
|
-
}
|
|
2920
|
-
function DropdownMenu2({
|
|
2921
|
-
items = [],
|
|
2922
|
-
onSelect,
|
|
2923
|
-
children,
|
|
2924
|
-
side,
|
|
2925
|
-
align,
|
|
2926
|
-
className,
|
|
2927
|
-
style
|
|
2928
|
-
}) {
|
|
2929
|
-
return /* @__PURE__ */ jsxs29(DropdownMenu, { children: [
|
|
2930
|
-
/* @__PURE__ */ jsx40(
|
|
2931
|
-
DropdownMenuTrigger,
|
|
2932
|
-
{
|
|
2933
|
-
nativeButton: false,
|
|
2934
|
-
render: triggerWrapper("dropdown-menu-trigger-wrap"),
|
|
2935
|
-
children
|
|
2936
|
-
}
|
|
2937
|
-
),
|
|
2938
|
-
/* @__PURE__ */ jsx40(DropdownMenuContent, { className, style, side, align, children: renderDropdownItems(items, onSelect) })
|
|
2939
|
-
] });
|
|
2940
|
-
}
|
|
2941
|
-
|
|
2942
2990
|
// src/components/components/Empty/index.tsx
|
|
2943
|
-
import { jsx as
|
|
2991
|
+
import { jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2944
2992
|
function Empty2({ title, description, children, className, style }) {
|
|
2945
2993
|
return /* @__PURE__ */ jsxs30(Empty, { className, style, children: [
|
|
2946
2994
|
/* @__PURE__ */ jsxs30(EmptyHeader, { children: [
|
|
2947
|
-
title ? /* @__PURE__ */
|
|
2948
|
-
description ? /* @__PURE__ */
|
|
2995
|
+
title ? /* @__PURE__ */ jsx40(EmptyTitle, { children: title }) : null,
|
|
2996
|
+
description ? /* @__PURE__ */ jsx40(EmptyDescription, { children: description }) : null
|
|
2949
2997
|
] }),
|
|
2950
|
-
children ? /* @__PURE__ */
|
|
2998
|
+
children ? /* @__PURE__ */ jsx40(EmptyContent, { children }) : null
|
|
2951
2999
|
] });
|
|
2952
3000
|
}
|
|
2953
3001
|
|
|
2954
|
-
// src/components/components/Field/index.tsx
|
|
2955
|
-
import { jsx as jsx42, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2956
|
-
function Field2({
|
|
2957
|
-
label,
|
|
2958
|
-
required,
|
|
2959
|
-
labelHint,
|
|
2960
|
-
description,
|
|
2961
|
-
error,
|
|
2962
|
-
children,
|
|
2963
|
-
className,
|
|
2964
|
-
style,
|
|
2965
|
-
labelClassName,
|
|
2966
|
-
labelStyle,
|
|
2967
|
-
labelHintClassName,
|
|
2968
|
-
labelHintStyle,
|
|
2969
|
-
controlClassName,
|
|
2970
|
-
controlStyle,
|
|
2971
|
-
descriptionClassName,
|
|
2972
|
-
descriptionStyle,
|
|
2973
|
-
errorClassName,
|
|
2974
|
-
errorStyle
|
|
2975
|
-
}) {
|
|
2976
|
-
const form = useFormContext();
|
|
2977
|
-
const inline = form?.layout === "inline";
|
|
2978
|
-
return /* @__PURE__ */ jsxs31(
|
|
2979
|
-
Field,
|
|
2980
|
-
{
|
|
2981
|
-
className: cn(
|
|
2982
|
-
form?.layout === "vertical" && "mb-2",
|
|
2983
|
-
// inline Form:label 与控件同一行(覆盖默认 flex-col)
|
|
2984
|
-
inline && "flex-row items-center",
|
|
2985
|
-
className
|
|
2986
|
-
),
|
|
2987
|
-
style,
|
|
2988
|
-
children: [
|
|
2989
|
-
label || labelHint ? /* @__PURE__ */ jsxs31(
|
|
2990
|
-
"div",
|
|
2991
|
-
{
|
|
2992
|
-
className: cn(
|
|
2993
|
-
"flex min-h-3.5 items-center gap-2",
|
|
2994
|
-
inline ? "shrink-0" : "w-full justify-between"
|
|
2995
|
-
),
|
|
2996
|
-
children: [
|
|
2997
|
-
label ? /* @__PURE__ */ jsxs31(FieldLabel, { className: labelClassName, style: labelStyle, children: [
|
|
2998
|
-
required ? /* @__PURE__ */ jsxs31("span", { "aria-hidden": true, className: "text-destructive", children: [
|
|
2999
|
-
"*",
|
|
3000
|
-
" "
|
|
3001
|
-
] }) : null,
|
|
3002
|
-
label
|
|
3003
|
-
] }) : /* @__PURE__ */ jsx42("span", {}),
|
|
3004
|
-
labelHint ? /* @__PURE__ */ jsx42(
|
|
3005
|
-
"span",
|
|
3006
|
-
{
|
|
3007
|
-
"data-slot": "field-label-hint",
|
|
3008
|
-
className: cn(
|
|
3009
|
-
"shrink-0 text-xs leading-none text-muted-foreground",
|
|
3010
|
-
labelHintClassName
|
|
3011
|
-
),
|
|
3012
|
-
style: labelHintStyle,
|
|
3013
|
-
children: labelHint
|
|
3014
|
-
}
|
|
3015
|
-
) : null
|
|
3016
|
-
]
|
|
3017
|
-
}
|
|
3018
|
-
) : null,
|
|
3019
|
-
/* @__PURE__ */ jsx42(
|
|
3020
|
-
"div",
|
|
3021
|
-
{
|
|
3022
|
-
"data-slot": "field-control",
|
|
3023
|
-
className: cn("[&>button+button]:ml-2", controlClassName),
|
|
3024
|
-
style: controlStyle,
|
|
3025
|
-
children
|
|
3026
|
-
}
|
|
3027
|
-
),
|
|
3028
|
-
description ? /* @__PURE__ */ jsx42(
|
|
3029
|
-
FieldDescription,
|
|
3030
|
-
{
|
|
3031
|
-
className: descriptionClassName,
|
|
3032
|
-
style: descriptionStyle,
|
|
3033
|
-
children: description
|
|
3034
|
-
}
|
|
3035
|
-
) : null,
|
|
3036
|
-
error ? /* @__PURE__ */ jsx42(FieldError, { match: true, className: errorClassName, style: errorStyle, children: error }) : null
|
|
3037
|
-
]
|
|
3038
|
-
}
|
|
3039
|
-
);
|
|
3040
|
-
}
|
|
3041
|
-
|
|
3042
3002
|
// src/components/components/FilePreview/index.tsx
|
|
3043
3003
|
import { useI18n as useI18n13 } from "@pactor-app/runtime";
|
|
3044
|
-
import { jsx as
|
|
3004
|
+
import { jsx as jsx41, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3045
3005
|
var kindIcon = {
|
|
3046
3006
|
image: "image",
|
|
3047
3007
|
text: "file-text",
|
|
@@ -3074,7 +3034,7 @@ function FilePreview({
|
|
|
3074
3034
|
}) {
|
|
3075
3035
|
const resolvedKind = kind ?? inferKind(name, fileType);
|
|
3076
3036
|
const { t } = useI18n13();
|
|
3077
|
-
return /* @__PURE__ */
|
|
3037
|
+
return /* @__PURE__ */ jsxs31(
|
|
3078
3038
|
"div",
|
|
3079
3039
|
{
|
|
3080
3040
|
"data-slot": "file-preview",
|
|
@@ -3082,19 +3042,19 @@ function FilePreview({
|
|
|
3082
3042
|
className: cn("w-full overflow-hidden rounded-md border border-border", className),
|
|
3083
3043
|
style,
|
|
3084
3044
|
children: [
|
|
3085
|
-
/* @__PURE__ */
|
|
3086
|
-
resolvedKind === "image" && src ? /* @__PURE__ */
|
|
3087
|
-
resolvedKind === "video" && src ? /* @__PURE__ */
|
|
3088
|
-
resolvedKind === "audio" && src ? /* @__PURE__ */
|
|
3089
|
-
resolvedKind === "text" ? /* @__PURE__ */
|
|
3090
|
-
resolvedKind === "other" || resolvedKind !== "text" && !src ? /* @__PURE__ */
|
|
3045
|
+
/* @__PURE__ */ jsxs31("div", { "data-slot": "file-preview-body", className: "bg-muted", children: [
|
|
3046
|
+
resolvedKind === "image" && src ? /* @__PURE__ */ jsx41("img", { src, alt: name ?? "", className: "max-h-72 w-full object-contain" }) : null,
|
|
3047
|
+
resolvedKind === "video" && src ? /* @__PURE__ */ jsx41("video", { src, controls: true, playsInline: true, className: "max-h-72 w-full" }) : null,
|
|
3048
|
+
resolvedKind === "audio" && src ? /* @__PURE__ */ jsx41("div", { className: "p-3", children: /* @__PURE__ */ jsx41("audio", { src, controls: true, className: "w-full" }) }) : null,
|
|
3049
|
+
resolvedKind === "text" ? /* @__PURE__ */ jsx41("pre", { className: "max-h-72 overflow-auto p-3 text-xs whitespace-pre-wrap", children: content ?? "" }) : null,
|
|
3050
|
+
resolvedKind === "other" || resolvedKind !== "text" && !src ? /* @__PURE__ */ jsx41("div", { className: "flex items-center justify-center p-6 text-muted-foreground", children: /* @__PURE__ */ jsx41(Icon, { name: kindIcon[resolvedKind], size: "lg" }) }) : null
|
|
3091
3051
|
] }),
|
|
3092
|
-
/* @__PURE__ */
|
|
3093
|
-
/* @__PURE__ */
|
|
3094
|
-
/* @__PURE__ */
|
|
3095
|
-
fileSize !== void 0 ? /* @__PURE__ */
|
|
3096
|
-
fileType ? /* @__PURE__ */
|
|
3097
|
-
src ? /* @__PURE__ */
|
|
3052
|
+
/* @__PURE__ */ jsxs31("div", { "data-slot": "file-preview-meta", className: "flex items-center gap-2 px-3 py-2 text-sm", children: [
|
|
3053
|
+
/* @__PURE__ */ jsx41(Icon, { name: kindIcon[resolvedKind], size: "sm" }),
|
|
3054
|
+
/* @__PURE__ */ jsx41("span", { className: "min-w-0 flex-1 truncate font-medium", children: name ?? t("pactor.filePreview.unnamed") }),
|
|
3055
|
+
fileSize !== void 0 ? /* @__PURE__ */ jsx41("span", { className: "shrink-0 text-xs text-muted-foreground", children: formatSize(fileSize) }) : null,
|
|
3056
|
+
fileType ? /* @__PURE__ */ jsx41("span", { className: "shrink-0 text-xs text-muted-foreground", children: fileType }) : null,
|
|
3057
|
+
src ? /* @__PURE__ */ jsx41(
|
|
3098
3058
|
"a",
|
|
3099
3059
|
{
|
|
3100
3060
|
"data-slot": "file-preview-download",
|
|
@@ -3102,7 +3062,7 @@ function FilePreview({
|
|
|
3102
3062
|
download: name ?? true,
|
|
3103
3063
|
className: "shrink-0 text-primary hover:underline",
|
|
3104
3064
|
"aria-label": t("pactor.filePreview.download"),
|
|
3105
|
-
children: /* @__PURE__ */
|
|
3065
|
+
children: /* @__PURE__ */ jsx41(Icon, { name: "download", size: "sm" })
|
|
3106
3066
|
}
|
|
3107
3067
|
) : null
|
|
3108
3068
|
] })
|
|
@@ -3112,7 +3072,7 @@ function FilePreview({
|
|
|
3112
3072
|
}
|
|
3113
3073
|
|
|
3114
3074
|
// src/components/components/Flex/index.tsx
|
|
3115
|
-
import { jsx as
|
|
3075
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
3116
3076
|
var gapClass = {
|
|
3117
3077
|
small: "gap-(--flex-gap-sm)",
|
|
3118
3078
|
middle: "gap-(--flex-gap-md)",
|
|
@@ -3142,7 +3102,7 @@ function Flex({
|
|
|
3142
3102
|
style,
|
|
3143
3103
|
children
|
|
3144
3104
|
}) {
|
|
3145
|
-
return /* @__PURE__ */
|
|
3105
|
+
return /* @__PURE__ */ jsx42(
|
|
3146
3106
|
"div",
|
|
3147
3107
|
{
|
|
3148
3108
|
"data-slot": "flex",
|
|
@@ -3162,9 +3122,9 @@ function Flex({
|
|
|
3162
3122
|
}
|
|
3163
3123
|
|
|
3164
3124
|
// src/components/components/Footer/index.tsx
|
|
3165
|
-
import { jsx as
|
|
3125
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
3166
3126
|
function Footer({ className, style, children }) {
|
|
3167
|
-
return /* @__PURE__ */
|
|
3127
|
+
return /* @__PURE__ */ jsx43(
|
|
3168
3128
|
"footer",
|
|
3169
3129
|
{
|
|
3170
3130
|
"data-slot": "layout-footer",
|
|
@@ -3184,7 +3144,7 @@ import { useCallback as useCallback2, useState as useState17 } from "react";
|
|
|
3184
3144
|
// src/components/components/ImageViewer/index.tsx
|
|
3185
3145
|
import { useI18n as useI18n14 } from "@pactor-app/runtime";
|
|
3186
3146
|
import { useCallback, useEffect as useEffect11, useState as useState16 } from "react";
|
|
3187
|
-
import { jsx as
|
|
3147
|
+
import { jsx as jsx44, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3188
3148
|
var MIN_SCALE2 = 0.5;
|
|
3189
3149
|
var MAX_SCALE2 = 4;
|
|
3190
3150
|
var toolButtonClass2 = "flex size-9 items-center justify-center rounded-md text-foreground hover:bg-accent disabled:pointer-events-none disabled:opacity-50";
|
|
@@ -3206,7 +3166,7 @@ function ImageLightbox({ src, alt, index, count, onPrev, onNext, onClose }) {
|
|
|
3206
3166
|
useEffect11(() => {
|
|
3207
3167
|
reset();
|
|
3208
3168
|
}, [src, reset]);
|
|
3209
|
-
return /* @__PURE__ */
|
|
3169
|
+
return /* @__PURE__ */ jsxs32(
|
|
3210
3170
|
"div",
|
|
3211
3171
|
{
|
|
3212
3172
|
"data-slot": "image-lightbox",
|
|
@@ -3215,7 +3175,7 @@ function ImageLightbox({ src, alt, index, count, onPrev, onNext, onClose }) {
|
|
|
3215
3175
|
"aria-modal": "true",
|
|
3216
3176
|
"aria-label": t("pactor.imageViewer.open"),
|
|
3217
3177
|
children: [
|
|
3218
|
-
/* @__PURE__ */
|
|
3178
|
+
/* @__PURE__ */ jsx44(
|
|
3219
3179
|
"button",
|
|
3220
3180
|
{
|
|
3221
3181
|
type: "button",
|
|
@@ -3224,7 +3184,7 @@ function ImageLightbox({ src, alt, index, count, onPrev, onNext, onClose }) {
|
|
|
3224
3184
|
onClick: onClose
|
|
3225
3185
|
}
|
|
3226
3186
|
),
|
|
3227
|
-
count !== void 0 && count > 1 && index !== void 0 ? /* @__PURE__ */
|
|
3187
|
+
count !== void 0 && count > 1 && index !== void 0 ? /* @__PURE__ */ jsxs32(
|
|
3228
3188
|
"div",
|
|
3229
3189
|
{
|
|
3230
3190
|
"data-slot": "image-lightbox-indicator",
|
|
@@ -3236,7 +3196,7 @@ function ImageLightbox({ src, alt, index, count, onPrev, onNext, onClose }) {
|
|
|
3236
3196
|
]
|
|
3237
3197
|
}
|
|
3238
3198
|
) : null,
|
|
3239
|
-
/* @__PURE__ */
|
|
3199
|
+
/* @__PURE__ */ jsx44("div", { className: "pointer-events-none relative flex min-h-0 flex-1 items-center justify-center overflow-hidden", children: src ? /* @__PURE__ */ jsx44(
|
|
3240
3200
|
"img",
|
|
3241
3201
|
{
|
|
3242
3202
|
"data-slot": "image-lightbox-img",
|
|
@@ -3246,7 +3206,7 @@ function ImageLightbox({ src, alt, index, count, onPrev, onNext, onClose }) {
|
|
|
3246
3206
|
style: { transform: `scale(${scale}) rotate(${rotate}deg)` }
|
|
3247
3207
|
}
|
|
3248
3208
|
) : null }),
|
|
3249
|
-
onPrev ? /* @__PURE__ */
|
|
3209
|
+
onPrev ? /* @__PURE__ */ jsx44(
|
|
3250
3210
|
"button",
|
|
3251
3211
|
{
|
|
3252
3212
|
type: "button",
|
|
@@ -3254,10 +3214,10 @@ function ImageLightbox({ src, alt, index, count, onPrev, onNext, onClose }) {
|
|
|
3254
3214
|
"aria-label": t("pactor.imageViewer.prev"),
|
|
3255
3215
|
className: cn(toolButtonClass2, "absolute top-1/2 left-4 z-10 -translate-y-1/2 bg-background/80"),
|
|
3256
3216
|
onClick: onPrev,
|
|
3257
|
-
children: /* @__PURE__ */
|
|
3217
|
+
children: /* @__PURE__ */ jsx44(Icon, { name: "chevron-left" })
|
|
3258
3218
|
}
|
|
3259
3219
|
) : null,
|
|
3260
|
-
onNext ? /* @__PURE__ */
|
|
3220
|
+
onNext ? /* @__PURE__ */ jsx44(
|
|
3261
3221
|
"button",
|
|
3262
3222
|
{
|
|
3263
3223
|
type: "button",
|
|
@@ -3265,16 +3225,16 @@ function ImageLightbox({ src, alt, index, count, onPrev, onNext, onClose }) {
|
|
|
3265
3225
|
"aria-label": t("pactor.imageViewer.next"),
|
|
3266
3226
|
className: cn(toolButtonClass2, "absolute top-1/2 right-4 z-10 -translate-y-1/2 bg-background/80"),
|
|
3267
3227
|
onClick: onNext,
|
|
3268
|
-
children: /* @__PURE__ */
|
|
3228
|
+
children: /* @__PURE__ */ jsx44(Icon, { name: "chevron-right" })
|
|
3269
3229
|
}
|
|
3270
3230
|
) : null,
|
|
3271
|
-
/* @__PURE__ */
|
|
3231
|
+
/* @__PURE__ */ jsxs32(
|
|
3272
3232
|
"div",
|
|
3273
3233
|
{
|
|
3274
3234
|
"data-slot": "image-lightbox-toolbar",
|
|
3275
3235
|
className: "absolute bottom-4 left-1/2 z-10 flex -translate-x-1/2 items-center gap-1 rounded-md bg-background/80 p-1 shadow-md",
|
|
3276
3236
|
children: [
|
|
3277
|
-
/* @__PURE__ */
|
|
3237
|
+
/* @__PURE__ */ jsx44(
|
|
3278
3238
|
"button",
|
|
3279
3239
|
{
|
|
3280
3240
|
type: "button",
|
|
@@ -3283,10 +3243,10 @@ function ImageLightbox({ src, alt, index, count, onPrev, onNext, onClose }) {
|
|
|
3283
3243
|
className: toolButtonClass2,
|
|
3284
3244
|
disabled: scale <= MIN_SCALE2,
|
|
3285
3245
|
onClick: () => setScale((value) => Math.max(MIN_SCALE2, value - 0.5)),
|
|
3286
|
-
children: /* @__PURE__ */
|
|
3246
|
+
children: /* @__PURE__ */ jsx44(Icon, { name: "zoom-out", size: "sm" })
|
|
3287
3247
|
}
|
|
3288
3248
|
),
|
|
3289
|
-
/* @__PURE__ */
|
|
3249
|
+
/* @__PURE__ */ jsx44(
|
|
3290
3250
|
"button",
|
|
3291
3251
|
{
|
|
3292
3252
|
type: "button",
|
|
@@ -3295,10 +3255,10 @@ function ImageLightbox({ src, alt, index, count, onPrev, onNext, onClose }) {
|
|
|
3295
3255
|
className: toolButtonClass2,
|
|
3296
3256
|
disabled: scale >= MAX_SCALE2,
|
|
3297
3257
|
onClick: () => setScale((value) => Math.min(MAX_SCALE2, value + 0.5)),
|
|
3298
|
-
children: /* @__PURE__ */
|
|
3258
|
+
children: /* @__PURE__ */ jsx44(Icon, { name: "zoom-in", size: "sm" })
|
|
3299
3259
|
}
|
|
3300
3260
|
),
|
|
3301
|
-
/* @__PURE__ */
|
|
3261
|
+
/* @__PURE__ */ jsx44(
|
|
3302
3262
|
"button",
|
|
3303
3263
|
{
|
|
3304
3264
|
type: "button",
|
|
@@ -3306,10 +3266,10 @@ function ImageLightbox({ src, alt, index, count, onPrev, onNext, onClose }) {
|
|
|
3306
3266
|
"aria-label": t("pactor.imageViewer.rotate"),
|
|
3307
3267
|
className: toolButtonClass2,
|
|
3308
3268
|
onClick: () => setRotate((value) => value - 90),
|
|
3309
|
-
children: /* @__PURE__ */
|
|
3269
|
+
children: /* @__PURE__ */ jsx44(Icon, { name: "rotate-ccw", size: "sm" })
|
|
3310
3270
|
}
|
|
3311
3271
|
),
|
|
3312
|
-
/* @__PURE__ */
|
|
3272
|
+
/* @__PURE__ */ jsx44(
|
|
3313
3273
|
"button",
|
|
3314
3274
|
{
|
|
3315
3275
|
type: "button",
|
|
@@ -3317,10 +3277,10 @@ function ImageLightbox({ src, alt, index, count, onPrev, onNext, onClose }) {
|
|
|
3317
3277
|
"aria-label": t("pactor.imageViewer.reset"),
|
|
3318
3278
|
className: toolButtonClass2,
|
|
3319
3279
|
onClick: reset,
|
|
3320
|
-
children: /* @__PURE__ */
|
|
3280
|
+
children: /* @__PURE__ */ jsx44(Icon, { name: "refresh-ccw", size: "sm" })
|
|
3321
3281
|
}
|
|
3322
3282
|
),
|
|
3323
|
-
/* @__PURE__ */
|
|
3283
|
+
/* @__PURE__ */ jsx44(
|
|
3324
3284
|
"button",
|
|
3325
3285
|
{
|
|
3326
3286
|
type: "button",
|
|
@@ -3328,7 +3288,7 @@ function ImageLightbox({ src, alt, index, count, onPrev, onNext, onClose }) {
|
|
|
3328
3288
|
"aria-label": t("pactor.imageViewer.close"),
|
|
3329
3289
|
className: toolButtonClass2,
|
|
3330
3290
|
onClick: onClose,
|
|
3331
|
-
children: /* @__PURE__ */
|
|
3291
|
+
children: /* @__PURE__ */ jsx44(Icon, { name: "x", size: "sm" })
|
|
3332
3292
|
}
|
|
3333
3293
|
)
|
|
3334
3294
|
]
|
|
@@ -3344,8 +3304,8 @@ function ImageViewer({ src, alt, preview = true, onClose, className, style }) {
|
|
|
3344
3304
|
setOpen(false);
|
|
3345
3305
|
onClose?.();
|
|
3346
3306
|
}, [onClose]);
|
|
3347
|
-
return /* @__PURE__ */
|
|
3348
|
-
src ? /* @__PURE__ */
|
|
3307
|
+
return /* @__PURE__ */ jsxs32("span", { "data-slot": "image-viewer", className: cn("inline-block", className), style, children: [
|
|
3308
|
+
src ? /* @__PURE__ */ jsx44(
|
|
3349
3309
|
"img",
|
|
3350
3310
|
{
|
|
3351
3311
|
"data-slot": "image-viewer-img",
|
|
@@ -3355,12 +3315,12 @@ function ImageViewer({ src, alt, preview = true, onClose, className, style }) {
|
|
|
3355
3315
|
onClick: preview ? () => setOpen(true) : void 0
|
|
3356
3316
|
}
|
|
3357
3317
|
) : null,
|
|
3358
|
-
open && src ? /* @__PURE__ */
|
|
3318
|
+
open && src ? /* @__PURE__ */ jsx44(ImageLightbox, { src, alt, onClose: close }) : null
|
|
3359
3319
|
] });
|
|
3360
3320
|
}
|
|
3361
3321
|
|
|
3362
3322
|
// src/components/components/Gallery/index.tsx
|
|
3363
|
-
import { jsx as
|
|
3323
|
+
import { jsx as jsx45, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3364
3324
|
var columnsClass = {
|
|
3365
3325
|
2: "grid-cols-2",
|
|
3366
3326
|
3: "grid-cols-3",
|
|
@@ -3373,9 +3333,9 @@ function Gallery({ items = [], columns = 3, onClose, className, style }) {
|
|
|
3373
3333
|
onClose?.();
|
|
3374
3334
|
}, [onClose]);
|
|
3375
3335
|
const active = current !== null ? items[current] : void 0;
|
|
3376
|
-
return /* @__PURE__ */
|
|
3377
|
-
/* @__PURE__ */
|
|
3378
|
-
/* @__PURE__ */
|
|
3336
|
+
return /* @__PURE__ */ jsxs33("div", { "data-slot": "gallery", className: cn("w-full", className), style, children: [
|
|
3337
|
+
/* @__PURE__ */ jsx45("div", { className: cn("grid gap-3", columnsClass[columns] ?? columnsClass[3]), children: items.map((item, index) => /* @__PURE__ */ jsxs33("figure", { "data-slot": "gallery-item", className: "m-0", children: [
|
|
3338
|
+
/* @__PURE__ */ jsx45(
|
|
3379
3339
|
"img",
|
|
3380
3340
|
{
|
|
3381
3341
|
src: item.src,
|
|
@@ -3384,9 +3344,9 @@ function Gallery({ items = [], columns = 3, onClose, className, style }) {
|
|
|
3384
3344
|
onClick: () => setCurrent(index)
|
|
3385
3345
|
}
|
|
3386
3346
|
),
|
|
3387
|
-
item.caption ? /* @__PURE__ */
|
|
3347
|
+
item.caption ? /* @__PURE__ */ jsx45("figcaption", { className: "mt-1 truncate text-xs text-muted-foreground", children: item.caption }) : null
|
|
3388
3348
|
] }, index)) }),
|
|
3389
|
-
active ? /* @__PURE__ */
|
|
3349
|
+
active ? /* @__PURE__ */ jsx45(
|
|
3390
3350
|
ImageLightbox,
|
|
3391
3351
|
{
|
|
3392
3352
|
src: active.src,
|
|
@@ -3410,7 +3370,7 @@ import {
|
|
|
3410
3370
|
useRef as useRef4,
|
|
3411
3371
|
useState as useState18
|
|
3412
3372
|
} from "react";
|
|
3413
|
-
import { jsx as
|
|
3373
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
3414
3374
|
function isEmpty(value) {
|
|
3415
3375
|
return value === void 0 || value === null || value === "";
|
|
3416
3376
|
}
|
|
@@ -3495,7 +3455,7 @@ function Form({
|
|
|
3495
3455
|
context.state.set("form", values);
|
|
3496
3456
|
onSubmit?.(values);
|
|
3497
3457
|
};
|
|
3498
|
-
return /* @__PURE__ */
|
|
3458
|
+
return /* @__PURE__ */ jsx46(FormContextProvider, { value: formContext, children: /* @__PURE__ */ jsx46(
|
|
3499
3459
|
"form",
|
|
3500
3460
|
{
|
|
3501
3461
|
ref: formElRef,
|
|
@@ -3511,7 +3471,7 @@ function Form({
|
|
|
3511
3471
|
// src/components/components/For/index.tsx
|
|
3512
3472
|
import { Fragment as Fragment3 } from "react";
|
|
3513
3473
|
import { useRenderer as useRenderer11 } from "@pactor-app/runtime";
|
|
3514
|
-
import { Fragment as Fragment4, jsx as
|
|
3474
|
+
import { Fragment as Fragment4, jsx as jsx47, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3515
3475
|
function For({
|
|
3516
3476
|
items,
|
|
3517
3477
|
keyField,
|
|
@@ -3531,7 +3491,7 @@ function For({
|
|
|
3531
3491
|
const renderRow = (item, index) => renderChildren(dslChildren, { row: item, rowIndex: index });
|
|
3532
3492
|
if (columns !== void 0) {
|
|
3533
3493
|
const cols = Math.max(1, columns);
|
|
3534
|
-
return /* @__PURE__ */
|
|
3494
|
+
return /* @__PURE__ */ jsxs34(
|
|
3535
3495
|
"div",
|
|
3536
3496
|
{
|
|
3537
3497
|
"data-slot": "grid",
|
|
@@ -3543,21 +3503,21 @@ function For({
|
|
|
3543
3503
|
...style
|
|
3544
3504
|
},
|
|
3545
3505
|
children: [
|
|
3546
|
-
before ? /* @__PURE__ */
|
|
3547
|
-
rows.map((item, index) => /* @__PURE__ */
|
|
3506
|
+
before ? /* @__PURE__ */ jsx47("div", { "data-slot": "grid-item", children: renderChildren(before) }) : null,
|
|
3507
|
+
rows.map((item, index) => /* @__PURE__ */ jsx47("div", { "data-slot": "grid-item", children: renderRow(item, index) }, keyOf(item, index)))
|
|
3548
3508
|
]
|
|
3549
3509
|
}
|
|
3550
3510
|
);
|
|
3551
3511
|
}
|
|
3552
|
-
return /* @__PURE__ */
|
|
3512
|
+
return /* @__PURE__ */ jsx47(Fragment4, { children: rows.map((item, index) => /* @__PURE__ */ jsx47(Fragment3, { children: renderRow(item, index) }, keyOf(item, index))) });
|
|
3553
3513
|
}
|
|
3554
3514
|
|
|
3555
3515
|
// src/components/components/Grid/index.tsx
|
|
3556
3516
|
import { Children, isValidElement as isValidElement2 } from "react";
|
|
3557
|
-
import { jsx as
|
|
3517
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
3558
3518
|
function Grid({ columns = 1, gap, className, style, children }) {
|
|
3559
3519
|
const cols = Math.max(1, columns);
|
|
3560
|
-
return /* @__PURE__ */
|
|
3520
|
+
return /* @__PURE__ */ jsx48(
|
|
3561
3521
|
"div",
|
|
3562
3522
|
{
|
|
3563
3523
|
"data-slot": "grid",
|
|
@@ -3571,18 +3531,18 @@ function Grid({ columns = 1, gap, className, style, children }) {
|
|
|
3571
3531
|
children: Children.map(children, (child, index) => {
|
|
3572
3532
|
const childStyle = isValidElement2(child) ? child.props.style : void 0;
|
|
3573
3533
|
const spanStyle = childStyle && (childStyle.gridColumn !== void 0 || childStyle.gridRow !== void 0) ? { gridColumn: childStyle.gridColumn, gridRow: childStyle.gridRow } : void 0;
|
|
3574
|
-
return /* @__PURE__ */
|
|
3534
|
+
return /* @__PURE__ */ jsx48("div", { "data-slot": "grid-item", style: spanStyle, children: child }, index);
|
|
3575
3535
|
})
|
|
3576
3536
|
}
|
|
3577
3537
|
);
|
|
3578
3538
|
}
|
|
3579
3539
|
|
|
3580
3540
|
// src/components/components/Row/index.tsx
|
|
3581
|
-
import { createContext as
|
|
3582
|
-
import { jsx as
|
|
3583
|
-
var RowContext =
|
|
3541
|
+
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
3542
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
3543
|
+
var RowContext = createContext3([0, 0]);
|
|
3584
3544
|
function useRowGutter() {
|
|
3585
|
-
return
|
|
3545
|
+
return useContext3(RowContext);
|
|
3586
3546
|
}
|
|
3587
3547
|
var justifyMap = {
|
|
3588
3548
|
start: "flex-start",
|
|
@@ -3608,7 +3568,7 @@ function Row({
|
|
|
3608
3568
|
children
|
|
3609
3569
|
}) {
|
|
3610
3570
|
const [h, v] = Array.isArray(gutter) ? gutter : [gutter ?? 0, gutter ?? 0];
|
|
3611
|
-
return /* @__PURE__ */
|
|
3571
|
+
return /* @__PURE__ */ jsx49(RowContext.Provider, { value: [h, v], children: /* @__PURE__ */ jsx49(
|
|
3612
3572
|
"div",
|
|
3613
3573
|
{
|
|
3614
3574
|
"data-slot": "row",
|
|
@@ -3626,7 +3586,7 @@ function Row({
|
|
|
3626
3586
|
}
|
|
3627
3587
|
|
|
3628
3588
|
// src/components/components/Col/index.tsx
|
|
3629
|
-
import { jsx as
|
|
3589
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
3630
3590
|
var BREAKPOINTS = {
|
|
3631
3591
|
xs: "(max-width: 575.98px)",
|
|
3632
3592
|
sm: "(min-width: 576px)",
|
|
@@ -3726,14 +3686,14 @@ function Col({
|
|
|
3726
3686
|
...responsiveClasses("xl", xl),
|
|
3727
3687
|
...responsiveClasses("xxl", xxl)
|
|
3728
3688
|
];
|
|
3729
|
-
return /* @__PURE__ */
|
|
3689
|
+
return /* @__PURE__ */ jsx50("div", { "data-slot": "col", className: cn("min-w-0", className, responsive), style: base, children });
|
|
3730
3690
|
}
|
|
3731
3691
|
|
|
3732
3692
|
// src/components/components/Header/index.tsx
|
|
3733
3693
|
import { useI18n as useI18n15 } from "@pactor-app/runtime";
|
|
3734
3694
|
import { ChevronDownIcon } from "lucide-react";
|
|
3735
3695
|
import { useState as useState19 } from "react";
|
|
3736
|
-
import { Fragment as Fragment5, jsx as
|
|
3696
|
+
import { Fragment as Fragment5, jsx as jsx51, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
3737
3697
|
var menuItemClass = "flex items-center gap-1 rounded-md px-3 py-2 text-sm transition-colors text-muted-foreground hover:bg-accent/50 hover:text-foreground";
|
|
3738
3698
|
function Header({
|
|
3739
3699
|
logo,
|
|
@@ -3766,10 +3726,10 @@ function Header({
|
|
|
3766
3726
|
className
|
|
3767
3727
|
);
|
|
3768
3728
|
if (!hasBrand && !dropdown && !hasMenu && !hasUser && !hasLocales && !themeToggle) {
|
|
3769
|
-
return /* @__PURE__ */
|
|
3729
|
+
return /* @__PURE__ */ jsx51("header", { "data-slot": "layout-header", className: rootClass, style, children });
|
|
3770
3730
|
}
|
|
3771
|
-
const brandNode = hasBrand && /* @__PURE__ */
|
|
3772
|
-
logo !== void 0 && /* @__PURE__ */
|
|
3731
|
+
const brandNode = hasBrand && /* @__PURE__ */ jsxs35("div", { "data-slot": "header-brand", className: "flex items-center gap-2", children: [
|
|
3732
|
+
logo !== void 0 && /* @__PURE__ */ jsx51(
|
|
3773
3733
|
"img",
|
|
3774
3734
|
{
|
|
3775
3735
|
"data-slot": "header-brand-logo",
|
|
@@ -3778,24 +3738,24 @@ function Header({
|
|
|
3778
3738
|
className: "size-6 shrink-0 object-contain"
|
|
3779
3739
|
}
|
|
3780
3740
|
),
|
|
3781
|
-
title !== void 0 && /* @__PURE__ */
|
|
3741
|
+
title !== void 0 && /* @__PURE__ */ jsx51("span", { "data-slot": "header-brand-title", className: "text-base font-semibold", children: title })
|
|
3782
3742
|
] });
|
|
3783
|
-
const dropdownNode = dropdown !== void 0 && /* @__PURE__ */
|
|
3743
|
+
const dropdownNode = dropdown !== void 0 && /* @__PURE__ */ jsx51(HeaderDropdownArea, { dropdown, onSelect: onDropdownSelect });
|
|
3784
3744
|
const showLeft = brandLeft || dropdownLeft || hasMenu;
|
|
3785
3745
|
const showRight = dropdownRight || brandRight || hasLocales || hasUser || themeToggle;
|
|
3786
|
-
return /* @__PURE__ */
|
|
3787
|
-
showLeft && /* @__PURE__ */
|
|
3746
|
+
return /* @__PURE__ */ jsxs35("header", { "data-slot": "layout-header", className: rootClass, style, children: [
|
|
3747
|
+
showLeft && /* @__PURE__ */ jsxs35("div", { "data-slot": "header-left", className: "flex items-center gap-4", children: [
|
|
3788
3748
|
brandLeft && brandNode,
|
|
3789
3749
|
dropdownLeft && dropdownNode,
|
|
3790
|
-
hasMenu && /* @__PURE__ */
|
|
3750
|
+
hasMenu && /* @__PURE__ */ jsx51(HeaderMenuArea, { items: menu, onSelect: onMenuSelect })
|
|
3791
3751
|
] }),
|
|
3792
|
-
/* @__PURE__ */
|
|
3793
|
-
showRight && /* @__PURE__ */
|
|
3752
|
+
/* @__PURE__ */ jsx51("div", { "data-slot": "header-center", className: "flex flex-1 items-center gap-4", children }),
|
|
3753
|
+
showRight && /* @__PURE__ */ jsxs35("div", { "data-slot": "header-right", className: "flex items-center gap-4", children: [
|
|
3794
3754
|
dropdownRight && dropdownNode,
|
|
3795
3755
|
brandRight && brandNode,
|
|
3796
|
-
themeToggle && /* @__PURE__ */
|
|
3797
|
-
hasLocales && /* @__PURE__ */
|
|
3798
|
-
hasUser && /* @__PURE__ */
|
|
3756
|
+
themeToggle && /* @__PURE__ */ jsx51(HeaderThemeToggle, { onSelect: onThemeChange }),
|
|
3757
|
+
hasLocales && /* @__PURE__ */ jsx51(HeaderLocalesArea, { locales, onSelect: onLocaleChange }),
|
|
3758
|
+
hasUser && /* @__PURE__ */ jsx51(HeaderUserArea, { user, onSelect: onUserSelect })
|
|
3799
3759
|
] })
|
|
3800
3760
|
] });
|
|
3801
3761
|
}
|
|
@@ -3803,42 +3763,42 @@ function HeaderDropdownArea({
|
|
|
3803
3763
|
dropdown,
|
|
3804
3764
|
onSelect
|
|
3805
3765
|
}) {
|
|
3806
|
-
return /* @__PURE__ */
|
|
3807
|
-
/* @__PURE__ */
|
|
3766
|
+
return /* @__PURE__ */ jsxs35(DropdownMenu, { children: [
|
|
3767
|
+
/* @__PURE__ */ jsxs35(
|
|
3808
3768
|
DropdownMenuTrigger,
|
|
3809
3769
|
{
|
|
3810
3770
|
"data-slot": "header-dropdown",
|
|
3811
3771
|
className: cn(menuItemClass, "outline-hidden cursor-pointer"),
|
|
3812
3772
|
children: [
|
|
3813
3773
|
dropdown.label,
|
|
3814
|
-
/* @__PURE__ */
|
|
3774
|
+
/* @__PURE__ */ jsx51(ChevronDownIcon, { className: "size-3.5", "aria-hidden": "true" })
|
|
3815
3775
|
]
|
|
3816
3776
|
}
|
|
3817
3777
|
),
|
|
3818
|
-
/* @__PURE__ */
|
|
3778
|
+
/* @__PURE__ */ jsx51(DropdownMenuContent, { children: renderDropdownItems(dropdown.items, onSelect) })
|
|
3819
3779
|
] });
|
|
3820
3780
|
}
|
|
3821
3781
|
function HeaderMenuArea({
|
|
3822
3782
|
items,
|
|
3823
3783
|
onSelect
|
|
3824
3784
|
}) {
|
|
3825
|
-
return /* @__PURE__ */
|
|
3826
|
-
(item) => item.children !== void 0 && item.children.length > 0 ? /* @__PURE__ */
|
|
3827
|
-
/* @__PURE__ */
|
|
3785
|
+
return /* @__PURE__ */ jsx51("nav", { "data-slot": "header-menu", className: "flex items-center gap-1", children: items.map(
|
|
3786
|
+
(item) => item.children !== void 0 && item.children.length > 0 ? /* @__PURE__ */ jsxs35(DropdownMenu, { children: [
|
|
3787
|
+
/* @__PURE__ */ jsxs35(
|
|
3828
3788
|
DropdownMenuTrigger,
|
|
3829
3789
|
{
|
|
3830
3790
|
"data-slot": "header-menu-item",
|
|
3831
3791
|
"data-key": item.key,
|
|
3832
3792
|
className: cn(menuItemClass, "outline-hidden cursor-pointer"),
|
|
3833
3793
|
children: [
|
|
3834
|
-
item.icon ? /* @__PURE__ */
|
|
3794
|
+
item.icon ? /* @__PURE__ */ jsx51(Icon, { name: item.icon, size: "sm" }) : null,
|
|
3835
3795
|
item.label,
|
|
3836
|
-
/* @__PURE__ */
|
|
3796
|
+
/* @__PURE__ */ jsx51(ChevronDownIcon, { className: "size-3.5", "aria-hidden": "true" })
|
|
3837
3797
|
]
|
|
3838
3798
|
}
|
|
3839
3799
|
),
|
|
3840
|
-
/* @__PURE__ */
|
|
3841
|
-
] }, item.key) : /* @__PURE__ */
|
|
3800
|
+
/* @__PURE__ */ jsx51(DropdownMenuContent, { children: item.children.map((child) => /* @__PURE__ */ jsx51(HeaderMenuEntry, { item: child, onSelect }, child.key)) })
|
|
3801
|
+
] }, item.key) : /* @__PURE__ */ jsxs35(
|
|
3842
3802
|
"button",
|
|
3843
3803
|
{
|
|
3844
3804
|
type: "button",
|
|
@@ -3847,7 +3807,7 @@ function HeaderMenuArea({
|
|
|
3847
3807
|
className: menuItemClass,
|
|
3848
3808
|
onClick: () => onSelect?.(item.key),
|
|
3849
3809
|
children: [
|
|
3850
|
-
item.icon ? /* @__PURE__ */
|
|
3810
|
+
item.icon ? /* @__PURE__ */ jsx51(Icon, { name: item.icon, size: "sm" }) : null,
|
|
3851
3811
|
item.label
|
|
3852
3812
|
]
|
|
3853
3813
|
},
|
|
@@ -3860,16 +3820,16 @@ function HeaderMenuEntry({
|
|
|
3860
3820
|
onSelect
|
|
3861
3821
|
}) {
|
|
3862
3822
|
if (item.children !== void 0 && item.children.length > 0) {
|
|
3863
|
-
return /* @__PURE__ */
|
|
3864
|
-
/* @__PURE__ */
|
|
3865
|
-
item.icon ? /* @__PURE__ */
|
|
3823
|
+
return /* @__PURE__ */ jsxs35(DropdownMenuSub, { children: [
|
|
3824
|
+
/* @__PURE__ */ jsxs35(DropdownMenuSubTrigger, { "data-key": item.key, className: "cursor-pointer", children: [
|
|
3825
|
+
item.icon ? /* @__PURE__ */ jsx51(Icon, { name: item.icon, size: "sm" }) : null,
|
|
3866
3826
|
item.label
|
|
3867
3827
|
] }),
|
|
3868
|
-
/* @__PURE__ */
|
|
3828
|
+
/* @__PURE__ */ jsx51(DropdownMenuSubContent, { children: item.children.map((child) => /* @__PURE__ */ jsx51(HeaderMenuEntry, { item: child, onSelect }, child.key)) })
|
|
3869
3829
|
] });
|
|
3870
3830
|
}
|
|
3871
|
-
return /* @__PURE__ */
|
|
3872
|
-
item.icon ? /* @__PURE__ */
|
|
3831
|
+
return /* @__PURE__ */ jsxs35(DropdownMenuItem, { "data-key": item.key, onClick: () => onSelect?.(item.key), children: [
|
|
3832
|
+
item.icon ? /* @__PURE__ */ jsx51(Icon, { name: item.icon, size: "sm" }) : null,
|
|
3873
3833
|
item.label
|
|
3874
3834
|
] });
|
|
3875
3835
|
}
|
|
@@ -3877,18 +3837,18 @@ function HeaderUserArea({
|
|
|
3877
3837
|
user,
|
|
3878
3838
|
onSelect
|
|
3879
3839
|
}) {
|
|
3880
|
-
const identity = /* @__PURE__ */
|
|
3881
|
-
/* @__PURE__ */
|
|
3882
|
-
user.avatar !== void 0 && /* @__PURE__ */
|
|
3883
|
-
/* @__PURE__ */
|
|
3840
|
+
const identity = /* @__PURE__ */ jsxs35(Fragment5, { children: [
|
|
3841
|
+
/* @__PURE__ */ jsxs35(Avatar, { className: "size-7", children: [
|
|
3842
|
+
user.avatar !== void 0 && /* @__PURE__ */ jsx51(AvatarImage, { src: user.avatar, alt: user.name }),
|
|
3843
|
+
/* @__PURE__ */ jsx51(AvatarFallback, { children: user.name.charAt(0) })
|
|
3884
3844
|
] }),
|
|
3885
|
-
/* @__PURE__ */
|
|
3845
|
+
/* @__PURE__ */ jsx51("span", { className: "text-sm", children: user.name })
|
|
3886
3846
|
] });
|
|
3887
3847
|
if (user.items === void 0 || user.items.length === 0) {
|
|
3888
|
-
return /* @__PURE__ */
|
|
3848
|
+
return /* @__PURE__ */ jsx51("div", { "data-slot": "header-user", className: "flex items-center gap-2", children: identity });
|
|
3889
3849
|
}
|
|
3890
|
-
return /* @__PURE__ */
|
|
3891
|
-
/* @__PURE__ */
|
|
3850
|
+
return /* @__PURE__ */ jsxs35(DropdownMenu, { children: [
|
|
3851
|
+
/* @__PURE__ */ jsx51(
|
|
3892
3852
|
DropdownMenuTrigger,
|
|
3893
3853
|
{
|
|
3894
3854
|
"data-slot": "header-user",
|
|
@@ -3896,7 +3856,7 @@ function HeaderUserArea({
|
|
|
3896
3856
|
children: identity
|
|
3897
3857
|
}
|
|
3898
3858
|
),
|
|
3899
|
-
/* @__PURE__ */
|
|
3859
|
+
/* @__PURE__ */ jsx51(DropdownMenuContent, { align: "end", children: renderDropdownItems(user.items, onSelect) })
|
|
3900
3860
|
] });
|
|
3901
3861
|
}
|
|
3902
3862
|
function HeaderLocalesArea({
|
|
@@ -3905,19 +3865,19 @@ function HeaderLocalesArea({
|
|
|
3905
3865
|
}) {
|
|
3906
3866
|
const { locale } = useI18n15();
|
|
3907
3867
|
const current = locales.find((option) => option.value === locale);
|
|
3908
|
-
return /* @__PURE__ */
|
|
3909
|
-
/* @__PURE__ */
|
|
3868
|
+
return /* @__PURE__ */ jsxs35(DropdownMenu, { children: [
|
|
3869
|
+
/* @__PURE__ */ jsxs35(
|
|
3910
3870
|
DropdownMenuTrigger,
|
|
3911
3871
|
{
|
|
3912
3872
|
"data-slot": "header-locales",
|
|
3913
3873
|
className: cn(menuItemClass, "outline-hidden cursor-pointer"),
|
|
3914
3874
|
children: [
|
|
3915
3875
|
current?.label ?? locale,
|
|
3916
|
-
/* @__PURE__ */
|
|
3876
|
+
/* @__PURE__ */ jsx51(ChevronDownIcon, { className: "size-3.5", "aria-hidden": "true" })
|
|
3917
3877
|
]
|
|
3918
3878
|
}
|
|
3919
3879
|
),
|
|
3920
|
-
/* @__PURE__ */
|
|
3880
|
+
/* @__PURE__ */ jsx51(DropdownMenuContent, { align: "end", children: locales.map((option) => /* @__PURE__ */ jsx51(
|
|
3921
3881
|
DropdownMenuItem,
|
|
3922
3882
|
{
|
|
3923
3883
|
onClick: () => onSelect?.(option.value),
|
|
@@ -3948,7 +3908,7 @@ function HeaderThemeToggle({
|
|
|
3948
3908
|
setTheme(next);
|
|
3949
3909
|
onSelect?.(next);
|
|
3950
3910
|
};
|
|
3951
|
-
return /* @__PURE__ */
|
|
3911
|
+
return /* @__PURE__ */ jsx51(
|
|
3952
3912
|
"button",
|
|
3953
3913
|
{
|
|
3954
3914
|
type: "button",
|
|
@@ -3957,29 +3917,29 @@ function HeaderThemeToggle({
|
|
|
3957
3917
|
title: theme === "dark" ? t("pactor.header.themeToLight") : t("pactor.header.themeToDark"),
|
|
3958
3918
|
"aria-label": t("pactor.header.themeToggle"),
|
|
3959
3919
|
onClick: handleToggle,
|
|
3960
|
-
children: theme === "dark" ? /* @__PURE__ */
|
|
3920
|
+
children: theme === "dark" ? /* @__PURE__ */ jsx51(Icon, { name: "sun", size: "sm" }) : /* @__PURE__ */ jsx51(Icon, { name: "moon", size: "sm" })
|
|
3961
3921
|
}
|
|
3962
3922
|
);
|
|
3963
3923
|
}
|
|
3964
3924
|
|
|
3965
3925
|
// src/components/components/HoverCard/index.tsx
|
|
3966
3926
|
import { useRenderer as useRenderer12 } from "@pactor-app/runtime";
|
|
3967
|
-
import { jsx as
|
|
3927
|
+
import { jsx as jsx52, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
3968
3928
|
function isDslNode2(value) {
|
|
3969
3929
|
return typeof value === "object" && value !== null && typeof value.type === "string";
|
|
3970
3930
|
}
|
|
3971
3931
|
function HoverCard2({ content, children, className, style }) {
|
|
3972
3932
|
const { renderChildren } = useRenderer12();
|
|
3973
|
-
return /* @__PURE__ */
|
|
3974
|
-
/* @__PURE__ */
|
|
3975
|
-
/* @__PURE__ */
|
|
3933
|
+
return /* @__PURE__ */ jsxs36(HoverCard, { children: [
|
|
3934
|
+
/* @__PURE__ */ jsx52(HoverCardTrigger, { render: triggerWrapper("hover-card-trigger-wrap"), children }),
|
|
3935
|
+
/* @__PURE__ */ jsx52(HoverCardContent, { className, style, children: isDslNode2(content) ? renderChildren([content]) : content })
|
|
3976
3936
|
] });
|
|
3977
3937
|
}
|
|
3978
3938
|
|
|
3979
3939
|
// src/components/components/Image/index.tsx
|
|
3980
3940
|
import { useI18n as useI18n16 } from "@pactor-app/runtime";
|
|
3981
3941
|
import { useState as useState20 } from "react";
|
|
3982
|
-
import { Fragment as Fragment6, jsx as
|
|
3942
|
+
import { Fragment as Fragment6, jsx as jsx53, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
3983
3943
|
function Image({
|
|
3984
3944
|
src,
|
|
3985
3945
|
alt = "",
|
|
@@ -3999,7 +3959,7 @@ function Image({
|
|
|
3999
3959
|
...style
|
|
4000
3960
|
};
|
|
4001
3961
|
if (failed || !src) {
|
|
4002
|
-
return /* @__PURE__ */
|
|
3962
|
+
return /* @__PURE__ */ jsx53(
|
|
4003
3963
|
"div",
|
|
4004
3964
|
{
|
|
4005
3965
|
"data-slot": "image-fallback",
|
|
@@ -4008,12 +3968,12 @@ function Image({
|
|
|
4008
3968
|
className
|
|
4009
3969
|
),
|
|
4010
3970
|
style: sizeStyle,
|
|
4011
|
-
children: fallback ?? /* @__PURE__ */
|
|
3971
|
+
children: fallback ?? /* @__PURE__ */ jsx53(Icon, { name: "image", size: "lg" })
|
|
4012
3972
|
}
|
|
4013
3973
|
);
|
|
4014
3974
|
}
|
|
4015
|
-
return /* @__PURE__ */
|
|
4016
|
-
/* @__PURE__ */
|
|
3975
|
+
return /* @__PURE__ */ jsxs37(Fragment6, { children: [
|
|
3976
|
+
/* @__PURE__ */ jsx53(
|
|
4017
3977
|
"img",
|
|
4018
3978
|
{
|
|
4019
3979
|
"data-slot": "image",
|
|
@@ -4027,9 +3987,9 @@ function Image({
|
|
|
4027
3987
|
style: sizeStyle
|
|
4028
3988
|
}
|
|
4029
3989
|
),
|
|
4030
|
-
preview ? /* @__PURE__ */
|
|
4031
|
-
/* @__PURE__ */
|
|
4032
|
-
/* @__PURE__ */
|
|
3990
|
+
preview ? /* @__PURE__ */ jsx53(Dialog, { open: previewOpen, onOpenChange: setPreviewOpen, children: /* @__PURE__ */ jsxs37(DialogContent, { className: "sm:max-w-3xl", "aria-label": alt || t("pactor.image.preview"), children: [
|
|
3991
|
+
/* @__PURE__ */ jsx53(DialogTitle, { className: "sr-only", children: alt || t("pactor.image.preview") }),
|
|
3992
|
+
/* @__PURE__ */ jsx53(
|
|
4033
3993
|
"img",
|
|
4034
3994
|
{
|
|
4035
3995
|
"data-slot": "image-preview",
|
|
@@ -4045,7 +4005,7 @@ function Image({
|
|
|
4045
4005
|
// src/components/components/Input/index.tsx
|
|
4046
4006
|
import { useI18n as useI18n17 } from "@pactor-app/runtime";
|
|
4047
4007
|
import { useEffect as useEffect13, useId as useId6 } from "react";
|
|
4048
|
-
import { jsx as
|
|
4008
|
+
import { jsx as jsx54, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
4049
4009
|
function Input2({
|
|
4050
4010
|
name,
|
|
4051
4011
|
label,
|
|
@@ -4082,7 +4042,7 @@ function Input2({
|
|
|
4082
4042
|
onChange?.("");
|
|
4083
4043
|
};
|
|
4084
4044
|
const inFormRoot = inForm === true;
|
|
4085
|
-
const input = /* @__PURE__ */
|
|
4045
|
+
const input = /* @__PURE__ */ jsx54(
|
|
4086
4046
|
Input,
|
|
4087
4047
|
{
|
|
4088
4048
|
id: controlId,
|
|
@@ -4104,7 +4064,7 @@ function Input2({
|
|
|
4104
4064
|
}
|
|
4105
4065
|
}
|
|
4106
4066
|
);
|
|
4107
|
-
const clearButton = showClear ? /* @__PURE__ */
|
|
4067
|
+
const clearButton = showClear ? /* @__PURE__ */ jsx54(
|
|
4108
4068
|
ClearHoverButton,
|
|
4109
4069
|
{
|
|
4110
4070
|
label: t("pactor.input.clear"),
|
|
@@ -4112,7 +4072,7 @@ function Input2({
|
|
|
4112
4072
|
onClear: handleClear
|
|
4113
4073
|
}
|
|
4114
4074
|
) : null;
|
|
4115
|
-
const control = allowClear !== false ? /* @__PURE__ */
|
|
4075
|
+
const control = allowClear !== false ? /* @__PURE__ */ jsxs38(
|
|
4116
4076
|
"span",
|
|
4117
4077
|
{
|
|
4118
4078
|
className: cn("group relative flex items-center", !inFormRoot && className),
|
|
@@ -4124,25 +4084,17 @@ function Input2({
|
|
|
4124
4084
|
}
|
|
4125
4085
|
) : input;
|
|
4126
4086
|
if (inForm && form && name) {
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
"div",
|
|
4087
|
+
return /* @__PURE__ */ jsx54(
|
|
4088
|
+
FieldShell,
|
|
4130
4089
|
{
|
|
4131
|
-
|
|
4132
|
-
|
|
4090
|
+
layout: form.layout,
|
|
4091
|
+
label,
|
|
4092
|
+
htmlFor: controlId,
|
|
4093
|
+
rules,
|
|
4094
|
+
error: form.errors[name],
|
|
4095
|
+
className,
|
|
4133
4096
|
style,
|
|
4134
|
-
children:
|
|
4135
|
-
label ? /* @__PURE__ */ jsx56(
|
|
4136
|
-
"label",
|
|
4137
|
-
{
|
|
4138
|
-
htmlFor: controlId,
|
|
4139
|
-
className: "shrink-0 text-sm leading-none font-medium whitespace-nowrap",
|
|
4140
|
-
children: label
|
|
4141
|
-
}
|
|
4142
|
-
) : null,
|
|
4143
|
-
control,
|
|
4144
|
-
error ? /* @__PURE__ */ jsx56("div", { "data-slot": "form-error", className: "text-sm text-destructive", children: error }) : null
|
|
4145
|
-
]
|
|
4097
|
+
children: control
|
|
4146
4098
|
}
|
|
4147
4099
|
);
|
|
4148
4100
|
}
|
|
@@ -4150,14 +4102,14 @@ function Input2({
|
|
|
4150
4102
|
}
|
|
4151
4103
|
|
|
4152
4104
|
// src/components/components/InputGroup/index.tsx
|
|
4153
|
-
import { jsx as
|
|
4105
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
4154
4106
|
function InputGroup2({ className, style, children }) {
|
|
4155
|
-
return /* @__PURE__ */
|
|
4107
|
+
return /* @__PURE__ */ jsx55(InputGroup, { className, style, children });
|
|
4156
4108
|
}
|
|
4157
4109
|
|
|
4158
4110
|
// src/components/components/InputOTP/index.tsx
|
|
4159
4111
|
import { useEffect as useEffect14, useState as useState21 } from "react";
|
|
4160
|
-
import { jsx as
|
|
4112
|
+
import { jsx as jsx56, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
4161
4113
|
function InputOTP2({
|
|
4162
4114
|
name,
|
|
4163
4115
|
label,
|
|
@@ -4195,38 +4147,38 @@ function InputOTP2({
|
|
|
4195
4147
|
onComplete?.(next);
|
|
4196
4148
|
}
|
|
4197
4149
|
};
|
|
4198
|
-
const control = /* @__PURE__ */
|
|
4150
|
+
const control = /* @__PURE__ */ jsx56(
|
|
4199
4151
|
InputOTP,
|
|
4200
4152
|
{
|
|
4201
4153
|
maxLength: length,
|
|
4202
4154
|
value: current,
|
|
4203
4155
|
onChange: handleChange,
|
|
4204
4156
|
disabled,
|
|
4205
|
-
children: /* @__PURE__ */
|
|
4157
|
+
children: /* @__PURE__ */ jsx56(InputOTPGroup, { children: Array.from({ length }, (_, index) => /* @__PURE__ */ jsx56(InputOTPSlot, { index }, index)) })
|
|
4206
4158
|
}
|
|
4207
4159
|
);
|
|
4208
4160
|
if (inForm && form && name) {
|
|
4209
4161
|
const error = form.errors[name];
|
|
4210
|
-
return /* @__PURE__ */
|
|
4162
|
+
return /* @__PURE__ */ jsxs39(
|
|
4211
4163
|
"div",
|
|
4212
4164
|
{
|
|
4213
4165
|
"data-slot": "form-item",
|
|
4214
4166
|
className: cn(formItemClass(form.layout), className),
|
|
4215
4167
|
style,
|
|
4216
4168
|
children: [
|
|
4217
|
-
label ? /* @__PURE__ */
|
|
4169
|
+
label ? /* @__PURE__ */ jsx56("label", { className: "shrink-0 text-sm leading-none font-medium whitespace-nowrap", children: label }) : null,
|
|
4218
4170
|
control,
|
|
4219
|
-
error ? /* @__PURE__ */
|
|
4171
|
+
error ? /* @__PURE__ */ jsx56("div", { "data-slot": "form-error", className: "text-sm text-destructive", children: error }) : null
|
|
4220
4172
|
]
|
|
4221
4173
|
}
|
|
4222
4174
|
);
|
|
4223
4175
|
}
|
|
4224
|
-
return /* @__PURE__ */
|
|
4176
|
+
return /* @__PURE__ */ jsx56("div", { "data-slot": "input-otp-field", className: cn("inline-block", className), style, children: control });
|
|
4225
4177
|
}
|
|
4226
4178
|
|
|
4227
4179
|
// src/components/components/Item/index.tsx
|
|
4228
4180
|
import { useRenderer as useRenderer13 } from "@pactor-app/runtime";
|
|
4229
|
-
import { jsx as
|
|
4181
|
+
import { jsx as jsx57, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
4230
4182
|
function Item2({
|
|
4231
4183
|
title,
|
|
4232
4184
|
description,
|
|
@@ -4237,20 +4189,20 @@ function Item2({
|
|
|
4237
4189
|
}) {
|
|
4238
4190
|
const { renderChildren } = useRenderer13();
|
|
4239
4191
|
const mediaNodes = media === void 0 ? [] : Array.isArray(media) ? media : [media];
|
|
4240
|
-
return /* @__PURE__ */
|
|
4241
|
-
mediaNodes.length > 0 ? /* @__PURE__ */
|
|
4242
|
-
/* @__PURE__ */
|
|
4243
|
-
title ? /* @__PURE__ */
|
|
4244
|
-
description ? /* @__PURE__ */
|
|
4192
|
+
return /* @__PURE__ */ jsxs40(Item, { className, style, children: [
|
|
4193
|
+
mediaNodes.length > 0 ? /* @__PURE__ */ jsx57(ItemMedia, { children: renderChildren(mediaNodes) }) : null,
|
|
4194
|
+
/* @__PURE__ */ jsxs40(ItemContent, { children: [
|
|
4195
|
+
title ? /* @__PURE__ */ jsx57(ItemTitle, { children: title }) : null,
|
|
4196
|
+
description ? /* @__PURE__ */ jsx57(ItemDescription, { children: description }) : null
|
|
4245
4197
|
] }),
|
|
4246
|
-
actions && actions.length > 0 ? /* @__PURE__ */
|
|
4198
|
+
actions && actions.length > 0 ? /* @__PURE__ */ jsx57(ItemActions, { children: renderChildren(actions) }) : null
|
|
4247
4199
|
] });
|
|
4248
4200
|
}
|
|
4249
4201
|
|
|
4250
4202
|
// src/components/components/JSONViewer/index.tsx
|
|
4251
4203
|
import { useI18n as useI18n18 } from "@pactor-app/runtime";
|
|
4252
4204
|
import { useState as useState22 } from "react";
|
|
4253
|
-
import { jsx as
|
|
4205
|
+
import { jsx as jsx58, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
4254
4206
|
function isObject(value) {
|
|
4255
4207
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4256
4208
|
}
|
|
@@ -4264,39 +4216,39 @@ function summarize(value, t) {
|
|
|
4264
4216
|
}
|
|
4265
4217
|
function PrimitiveValue({ value }) {
|
|
4266
4218
|
if (value === null || value === void 0) {
|
|
4267
|
-
return /* @__PURE__ */
|
|
4219
|
+
return /* @__PURE__ */ jsx58("span", { "data-slot": "json-value", "data-type": "null", className: "text-muted-foreground", children: "null" });
|
|
4268
4220
|
}
|
|
4269
4221
|
if (typeof value === "string") {
|
|
4270
|
-
return /* @__PURE__ */
|
|
4222
|
+
return /* @__PURE__ */ jsxs41("span", { "data-slot": "json-value", "data-type": "string", className: "text-success", children: [
|
|
4271
4223
|
'"',
|
|
4272
4224
|
value,
|
|
4273
4225
|
'"'
|
|
4274
4226
|
] });
|
|
4275
4227
|
}
|
|
4276
4228
|
if (typeof value === "number") {
|
|
4277
|
-
return /* @__PURE__ */
|
|
4229
|
+
return /* @__PURE__ */ jsx58("span", { "data-slot": "json-value", "data-type": "number", className: "text-info", children: String(value) });
|
|
4278
4230
|
}
|
|
4279
4231
|
if (typeof value === "boolean") {
|
|
4280
|
-
return /* @__PURE__ */
|
|
4232
|
+
return /* @__PURE__ */ jsx58("span", { "data-slot": "json-value", "data-type": "boolean", className: "text-warning", children: String(value) });
|
|
4281
4233
|
}
|
|
4282
|
-
return /* @__PURE__ */
|
|
4234
|
+
return /* @__PURE__ */ jsx58("span", { "data-slot": "json-value", children: String(value) });
|
|
4283
4235
|
}
|
|
4284
4236
|
function JsonNode({ keyName, value, depth, expandedDepth }) {
|
|
4285
4237
|
const [expanded, setExpanded] = useState22(depth < expandedDepth);
|
|
4286
4238
|
const { t } = useI18n18();
|
|
4287
4239
|
const composite = isObject(value) || Array.isArray(value);
|
|
4288
4240
|
if (!composite) {
|
|
4289
|
-
return /* @__PURE__ */
|
|
4290
|
-
keyName !== void 0 ? /* @__PURE__ */
|
|
4241
|
+
return /* @__PURE__ */ jsxs41("div", { "data-slot": "json-leaf", className: "flex gap-1.5", children: [
|
|
4242
|
+
keyName !== void 0 ? /* @__PURE__ */ jsxs41("span", { className: "shrink-0 text-foreground", children: [
|
|
4291
4243
|
keyName,
|
|
4292
4244
|
":"
|
|
4293
4245
|
] }) : null,
|
|
4294
|
-
/* @__PURE__ */
|
|
4246
|
+
/* @__PURE__ */ jsx58(PrimitiveValue, { value })
|
|
4295
4247
|
] });
|
|
4296
4248
|
}
|
|
4297
4249
|
const entries = Array.isArray(value) ? value.map((item, index) => [String(index), item]) : Object.entries(value);
|
|
4298
|
-
return /* @__PURE__ */
|
|
4299
|
-
/* @__PURE__ */
|
|
4250
|
+
return /* @__PURE__ */ jsxs41("div", { "data-slot": "json-node", children: [
|
|
4251
|
+
/* @__PURE__ */ jsxs41(
|
|
4300
4252
|
"button",
|
|
4301
4253
|
{
|
|
4302
4254
|
type: "button",
|
|
@@ -4305,17 +4257,17 @@ function JsonNode({ keyName, value, depth, expandedDepth }) {
|
|
|
4305
4257
|
className: "flex items-center gap-1 text-left hover:bg-accent/50 rounded-sm",
|
|
4306
4258
|
onClick: () => setExpanded((value_) => !value_),
|
|
4307
4259
|
children: [
|
|
4308
|
-
/* @__PURE__ */
|
|
4309
|
-
keyName !== void 0 ? /* @__PURE__ */
|
|
4260
|
+
/* @__PURE__ */ jsx58(Icon, { name: expanded ? "chevron-down" : "chevron-right", size: "sm" }),
|
|
4261
|
+
keyName !== void 0 ? /* @__PURE__ */ jsxs41("span", { className: "text-foreground", children: [
|
|
4310
4262
|
keyName,
|
|
4311
4263
|
":"
|
|
4312
4264
|
] }) : null,
|
|
4313
|
-
!expanded ? /* @__PURE__ */
|
|
4265
|
+
!expanded ? /* @__PURE__ */ jsx58("span", { className: "text-muted-foreground", children: summarize(value, t) }) : /* @__PURE__ */ jsx58("span", { className: "text-muted-foreground", children: Array.isArray(value) ? "[" : "{" })
|
|
4314
4266
|
]
|
|
4315
4267
|
}
|
|
4316
4268
|
),
|
|
4317
|
-
expanded ? /* @__PURE__ */
|
|
4318
|
-
expanded ? /* @__PURE__ */
|
|
4269
|
+
expanded ? /* @__PURE__ */ jsx58("div", { className: "ml-4 border-l border-border pl-2", children: entries.map(([key, item]) => /* @__PURE__ */ jsx58(JsonNode, { keyName: key, value: item, depth: depth + 1, expandedDepth }, key)) }) : null,
|
|
4270
|
+
expanded ? /* @__PURE__ */ jsx58("span", { className: "ml-1 text-muted-foreground", children: Array.isArray(value) ? "]" : "}" }) : null
|
|
4319
4271
|
] });
|
|
4320
4272
|
}
|
|
4321
4273
|
function JSONViewer({ data, expandedDepth = 1, copyable = true, className, style }) {
|
|
@@ -4329,14 +4281,14 @@ function JSONViewer({ data, expandedDepth = 1, copyable = true, className, style
|
|
|
4329
4281
|
} catch {
|
|
4330
4282
|
}
|
|
4331
4283
|
};
|
|
4332
|
-
return /* @__PURE__ */
|
|
4284
|
+
return /* @__PURE__ */ jsxs41(
|
|
4333
4285
|
"div",
|
|
4334
4286
|
{
|
|
4335
4287
|
"data-slot": "json-viewer",
|
|
4336
4288
|
className: cn("relative w-full rounded-md border border-border bg-muted p-3 font-mono text-xs leading-5", className),
|
|
4337
4289
|
style,
|
|
4338
4290
|
children: [
|
|
4339
|
-
copyable ? /* @__PURE__ */
|
|
4291
|
+
copyable ? /* @__PURE__ */ jsx58(
|
|
4340
4292
|
"button",
|
|
4341
4293
|
{
|
|
4342
4294
|
type: "button",
|
|
@@ -4344,38 +4296,38 @@ function JSONViewer({ data, expandedDepth = 1, copyable = true, className, style
|
|
|
4344
4296
|
"aria-label": t("pactor.jsonViewer.copy"),
|
|
4345
4297
|
className: "absolute top-2 right-2 flex size-7 items-center justify-center rounded-md bg-background/80 text-muted-foreground hover:text-foreground",
|
|
4346
4298
|
onClick: handleCopy,
|
|
4347
|
-
children: /* @__PURE__ */
|
|
4299
|
+
children: /* @__PURE__ */ jsx58(Icon, { name: copied ? "check" : "copy", size: "sm" })
|
|
4348
4300
|
}
|
|
4349
4301
|
) : null,
|
|
4350
|
-
/* @__PURE__ */
|
|
4302
|
+
/* @__PURE__ */ jsx58(JsonNode, { value: data, depth: 0, expandedDepth })
|
|
4351
4303
|
]
|
|
4352
4304
|
}
|
|
4353
4305
|
);
|
|
4354
4306
|
}
|
|
4355
4307
|
|
|
4356
4308
|
// src/components/components/Kbd/index.tsx
|
|
4357
|
-
import { jsx as
|
|
4309
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
4358
4310
|
function Kbd2({ text, className, style }) {
|
|
4359
|
-
return /* @__PURE__ */
|
|
4311
|
+
return /* @__PURE__ */ jsx59(Kbd, { className, style, children: text });
|
|
4360
4312
|
}
|
|
4361
4313
|
|
|
4362
4314
|
// src/components/components/Label/index.tsx
|
|
4363
|
-
import { jsx as
|
|
4315
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
4364
4316
|
function Label2({ text, htmlFor, className, style }) {
|
|
4365
|
-
return /* @__PURE__ */
|
|
4317
|
+
return /* @__PURE__ */ jsx60(Label, { htmlFor, className, style, children: text });
|
|
4366
4318
|
}
|
|
4367
4319
|
|
|
4368
4320
|
// src/components/components/Layout/index.tsx
|
|
4369
4321
|
import { isDslSourceRef } from "@pactor-app/core";
|
|
4370
4322
|
import { useRenderer as useRenderer14 } from "@pactor-app/runtime";
|
|
4371
|
-
import { jsx as
|
|
4323
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
4372
4324
|
function Layout({ direction, className, style, dslChildren }) {
|
|
4373
4325
|
const { renderChildren, context } = useRenderer14();
|
|
4374
4326
|
const hasSider = Array.isArray(dslChildren) ? dslChildren.some(
|
|
4375
4327
|
(child) => !isDslSourceRef(child) && resolveRootType(child, context) === "Sider"
|
|
4376
4328
|
) : false;
|
|
4377
4329
|
const dir = direction ?? (hasSider ? "horizontal" : "vertical");
|
|
4378
|
-
return /* @__PURE__ */
|
|
4330
|
+
return /* @__PURE__ */ jsx61(
|
|
4379
4331
|
"div",
|
|
4380
4332
|
{
|
|
4381
4333
|
"data-slot": "layout",
|
|
@@ -4399,10 +4351,10 @@ function resolveRootType(node, context) {
|
|
|
4399
4351
|
}
|
|
4400
4352
|
|
|
4401
4353
|
// src/components/components/Link/index.tsx
|
|
4402
|
-
import { jsx as
|
|
4354
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
4403
4355
|
function Link({ href, text, target, className, style, children }) {
|
|
4404
4356
|
const handleSpaClick = useSpaLinkClick();
|
|
4405
|
-
return /* @__PURE__ */
|
|
4357
|
+
return /* @__PURE__ */ jsx62(
|
|
4406
4358
|
"a",
|
|
4407
4359
|
{
|
|
4408
4360
|
"data-slot": "link",
|
|
@@ -4419,7 +4371,7 @@ function Link({ href, text, target, className, style, children }) {
|
|
|
4419
4371
|
|
|
4420
4372
|
// src/components/components/List/index.tsx
|
|
4421
4373
|
import { useI18n as useI18n19 } from "@pactor-app/runtime";
|
|
4422
|
-
import { jsx as
|
|
4374
|
+
import { jsx as jsx63, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
4423
4375
|
function isImageSrc(avatar) {
|
|
4424
4376
|
return /^(https?:|data:|\/|\.)/.test(avatar);
|
|
4425
4377
|
}
|
|
@@ -4432,17 +4384,17 @@ function List({
|
|
|
4432
4384
|
}) {
|
|
4433
4385
|
const { t } = useI18n19();
|
|
4434
4386
|
if (items.length === 0) {
|
|
4435
|
-
return /* @__PURE__ */
|
|
4387
|
+
return /* @__PURE__ */ jsx63(
|
|
4436
4388
|
Empty,
|
|
4437
4389
|
{
|
|
4438
4390
|
"data-slot": "list",
|
|
4439
4391
|
className: cn(bordered && "border border-border", className),
|
|
4440
4392
|
style,
|
|
4441
|
-
children: /* @__PURE__ */
|
|
4393
|
+
children: /* @__PURE__ */ jsx63(EmptyHeader, { children: /* @__PURE__ */ jsx63(EmptyTitle, { children: t("pactor.table.empty") }) })
|
|
4442
4394
|
}
|
|
4443
4395
|
);
|
|
4444
4396
|
}
|
|
4445
|
-
return /* @__PURE__ */
|
|
4397
|
+
return /* @__PURE__ */ jsx63(
|
|
4446
4398
|
"ul",
|
|
4447
4399
|
{
|
|
4448
4400
|
"data-slot": "list",
|
|
@@ -4453,13 +4405,13 @@ function List({
|
|
|
4453
4405
|
className
|
|
4454
4406
|
),
|
|
4455
4407
|
style,
|
|
4456
|
-
children: items.map((item, index) => /* @__PURE__ */
|
|
4408
|
+
children: items.map((item, index) => /* @__PURE__ */ jsxs42(
|
|
4457
4409
|
"li",
|
|
4458
4410
|
{
|
|
4459
4411
|
"data-slot": "list-item",
|
|
4460
4412
|
className: "flex items-center gap-3 px-4 py-3",
|
|
4461
4413
|
children: [
|
|
4462
|
-
item.avatar ? isImageSrc(item.avatar) ? /* @__PURE__ */
|
|
4414
|
+
item.avatar ? isImageSrc(item.avatar) ? /* @__PURE__ */ jsx63(
|
|
4463
4415
|
"img",
|
|
4464
4416
|
{
|
|
4465
4417
|
"data-slot": "list-item-avatar",
|
|
@@ -4467,7 +4419,7 @@ function List({
|
|
|
4467
4419
|
alt: "",
|
|
4468
4420
|
className: "size-9 shrink-0 rounded-full object-cover"
|
|
4469
4421
|
}
|
|
4470
|
-
) : /* @__PURE__ */
|
|
4422
|
+
) : /* @__PURE__ */ jsx63(
|
|
4471
4423
|
"span",
|
|
4472
4424
|
{
|
|
4473
4425
|
"data-slot": "list-item-avatar",
|
|
@@ -4475,9 +4427,9 @@ function List({
|
|
|
4475
4427
|
children: item.avatar
|
|
4476
4428
|
}
|
|
4477
4429
|
) : null,
|
|
4478
|
-
/* @__PURE__ */
|
|
4479
|
-
/* @__PURE__ */
|
|
4480
|
-
item.description ? /* @__PURE__ */
|
|
4430
|
+
/* @__PURE__ */ jsxs42("div", { className: "min-w-0 flex-1", children: [
|
|
4431
|
+
/* @__PURE__ */ jsx63("div", { "data-slot": "list-item-title", className: "truncate text-sm font-medium", children: item.title }),
|
|
4432
|
+
item.description ? /* @__PURE__ */ jsx63(
|
|
4481
4433
|
"div",
|
|
4482
4434
|
{
|
|
4483
4435
|
"data-slot": "list-item-description",
|
|
@@ -4486,7 +4438,7 @@ function List({
|
|
|
4486
4438
|
}
|
|
4487
4439
|
) : null
|
|
4488
4440
|
] }),
|
|
4489
|
-
item.extra ? /* @__PURE__ */
|
|
4441
|
+
item.extra ? /* @__PURE__ */ jsx63(
|
|
4490
4442
|
"div",
|
|
4491
4443
|
{
|
|
4492
4444
|
"data-slot": "list-item-extra",
|
|
@@ -4503,7 +4455,7 @@ function List({
|
|
|
4503
4455
|
}
|
|
4504
4456
|
|
|
4505
4457
|
// src/components/components/LoadingOverlay/index.tsx
|
|
4506
|
-
import { jsx as
|
|
4458
|
+
import { jsx as jsx64, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
4507
4459
|
function LoadingOverlay({
|
|
4508
4460
|
loading = false,
|
|
4509
4461
|
text,
|
|
@@ -4515,20 +4467,20 @@ function LoadingOverlay({
|
|
|
4515
4467
|
if (!loading) {
|
|
4516
4468
|
return null;
|
|
4517
4469
|
}
|
|
4518
|
-
return /* @__PURE__ */
|
|
4470
|
+
return /* @__PURE__ */ jsxs43(
|
|
4519
4471
|
"div",
|
|
4520
4472
|
{
|
|
4521
4473
|
"data-slot": "loading-overlay",
|
|
4522
4474
|
className: cn("inline-flex items-center gap-2", className),
|
|
4523
4475
|
style,
|
|
4524
4476
|
children: [
|
|
4525
|
-
/* @__PURE__ */
|
|
4526
|
-
text ? /* @__PURE__ */
|
|
4477
|
+
/* @__PURE__ */ jsx64(Spinner, { className: "size-4" }),
|
|
4478
|
+
text ? /* @__PURE__ */ jsx64("span", { className: "text-sm text-muted-foreground", children: text }) : null
|
|
4527
4479
|
]
|
|
4528
4480
|
}
|
|
4529
4481
|
);
|
|
4530
4482
|
}
|
|
4531
|
-
return /* @__PURE__ */
|
|
4483
|
+
return /* @__PURE__ */ jsxs43(
|
|
4532
4484
|
"div",
|
|
4533
4485
|
{
|
|
4534
4486
|
"data-slot": "loading-overlay",
|
|
@@ -4536,14 +4488,14 @@ function LoadingOverlay({
|
|
|
4536
4488
|
style,
|
|
4537
4489
|
children: [
|
|
4538
4490
|
children,
|
|
4539
|
-
loading ? /* @__PURE__ */
|
|
4491
|
+
loading ? /* @__PURE__ */ jsxs43(
|
|
4540
4492
|
"div",
|
|
4541
4493
|
{
|
|
4542
4494
|
"data-slot": "loading-overlay-mask",
|
|
4543
4495
|
className: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 bg-background/70",
|
|
4544
4496
|
children: [
|
|
4545
|
-
/* @__PURE__ */
|
|
4546
|
-
text ? /* @__PURE__ */
|
|
4497
|
+
/* @__PURE__ */ jsx64(Spinner, { className: "size-6" }),
|
|
4498
|
+
text ? /* @__PURE__ */ jsx64("div", { className: "text-sm text-muted-foreground", children: text }) : null
|
|
4547
4499
|
]
|
|
4548
4500
|
}
|
|
4549
4501
|
) : null
|
|
@@ -4562,7 +4514,7 @@ import {
|
|
|
4562
4514
|
useRef as useRef5,
|
|
4563
4515
|
useState as useState23
|
|
4564
4516
|
} from "react";
|
|
4565
|
-
import { jsx as
|
|
4517
|
+
import { jsx as jsx65, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
4566
4518
|
function detectMention(text, caret, trigger) {
|
|
4567
4519
|
const before = text.slice(0, caret);
|
|
4568
4520
|
const start = before.lastIndexOf(trigger);
|
|
@@ -4652,13 +4604,13 @@ function Mentions({
|
|
|
4652
4604
|
setMention(void 0);
|
|
4653
4605
|
}
|
|
4654
4606
|
};
|
|
4655
|
-
const control = /* @__PURE__ */
|
|
4607
|
+
const control = /* @__PURE__ */ jsxs44(
|
|
4656
4608
|
"div",
|
|
4657
4609
|
{
|
|
4658
4610
|
className: cn("relative", !inForm && className),
|
|
4659
4611
|
style: inForm ? void 0 : style,
|
|
4660
4612
|
children: [
|
|
4661
|
-
/* @__PURE__ */
|
|
4613
|
+
/* @__PURE__ */ jsx65(
|
|
4662
4614
|
Textarea,
|
|
4663
4615
|
{
|
|
4664
4616
|
ref: textareaRef,
|
|
@@ -4674,12 +4626,12 @@ function Mentions({
|
|
|
4674
4626
|
onBlur: () => setMention(void 0)
|
|
4675
4627
|
}
|
|
4676
4628
|
),
|
|
4677
|
-
open ? /* @__PURE__ */
|
|
4629
|
+
open ? /* @__PURE__ */ jsx65(
|
|
4678
4630
|
"div",
|
|
4679
4631
|
{
|
|
4680
4632
|
"data-slot": "mentions-popup",
|
|
4681
4633
|
className: "absolute z-50 mt-1 flex max-h-48 w-56 flex-col gap-0.5 overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md",
|
|
4682
|
-
children: filtered.map((option, index) => /* @__PURE__ */
|
|
4634
|
+
children: filtered.map((option, index) => /* @__PURE__ */ jsx65(
|
|
4683
4635
|
"button",
|
|
4684
4636
|
{
|
|
4685
4637
|
type: "button",
|
|
@@ -4701,11 +4653,12 @@ function Mentions({
|
|
|
4701
4653
|
}
|
|
4702
4654
|
);
|
|
4703
4655
|
if (inForm && form && name) {
|
|
4704
|
-
return /* @__PURE__ */
|
|
4656
|
+
return /* @__PURE__ */ jsx65(
|
|
4705
4657
|
FieldShell,
|
|
4706
4658
|
{
|
|
4707
4659
|
layout: form.layout,
|
|
4708
4660
|
label,
|
|
4661
|
+
rules,
|
|
4709
4662
|
htmlFor: controlId,
|
|
4710
4663
|
error: form.errors[name],
|
|
4711
4664
|
className,
|
|
@@ -4718,17 +4671,17 @@ function Mentions({
|
|
|
4718
4671
|
}
|
|
4719
4672
|
|
|
4720
4673
|
// src/components/components/Menubar/index.tsx
|
|
4721
|
-
import { jsx as
|
|
4674
|
+
import { jsx as jsx66, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
4722
4675
|
function Menubar2({ menus = [], onSelect, className, style }) {
|
|
4723
|
-
return /* @__PURE__ */
|
|
4724
|
-
/* @__PURE__ */
|
|
4725
|
-
/* @__PURE__ */
|
|
4676
|
+
return /* @__PURE__ */ jsx66(Menubar, { className, style, children: menus.map((menu) => /* @__PURE__ */ jsxs45(MenubarMenu, { children: [
|
|
4677
|
+
/* @__PURE__ */ jsx66(MenubarTrigger, { children: menu.label }),
|
|
4678
|
+
/* @__PURE__ */ jsx66(MenubarContent, { children: menu.items.map((item) => /* @__PURE__ */ jsxs45(
|
|
4726
4679
|
MenubarItem,
|
|
4727
4680
|
{
|
|
4728
4681
|
disabled: item.disabled,
|
|
4729
4682
|
onClick: () => onSelect?.(item.value),
|
|
4730
4683
|
children: [
|
|
4731
|
-
item.icon ? /* @__PURE__ */
|
|
4684
|
+
item.icon ? /* @__PURE__ */ jsx66(Icon, { name: item.icon, size: "sm" }) : null,
|
|
4732
4685
|
item.label
|
|
4733
4686
|
]
|
|
4734
4687
|
},
|
|
@@ -4739,44 +4692,44 @@ function Menubar2({ menus = [], onSelect, className, style }) {
|
|
|
4739
4692
|
|
|
4740
4693
|
// src/components/components/Message/index.tsx
|
|
4741
4694
|
import { useEffect as useEffect16 } from "react";
|
|
4742
|
-
import { jsx as
|
|
4695
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
4743
4696
|
function Message({ content, variant, duration, className, style }) {
|
|
4744
4697
|
useEffect16(() => {
|
|
4745
4698
|
if (typeof content === "string" && content !== "") {
|
|
4746
4699
|
toast(content, { variant, duration });
|
|
4747
4700
|
}
|
|
4748
4701
|
}, [content]);
|
|
4749
|
-
return /* @__PURE__ */
|
|
4702
|
+
return /* @__PURE__ */ jsx67("div", { "data-slot": "message", hidden: true, className, style });
|
|
4750
4703
|
}
|
|
4751
4704
|
|
|
4752
4705
|
// src/components/components/NavigationMenu/index.tsx
|
|
4753
|
-
import { Fragment as Fragment7, jsx as
|
|
4706
|
+
import { Fragment as Fragment7, jsx as jsx68, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
4754
4707
|
function NavigationMenu2({ items = [], className, style }) {
|
|
4755
|
-
return /* @__PURE__ */
|
|
4756
|
-
/* @__PURE__ */
|
|
4708
|
+
return /* @__PURE__ */ jsx68(NavigationMenu, { className, style, children: /* @__PURE__ */ jsx68(NavigationMenuList, { children: items.map((item, index) => /* @__PURE__ */ jsx68(NavigationMenuItem, { value: `item-${index}`, children: item.children && item.children.length > 0 ? /* @__PURE__ */ jsxs46(Fragment7, { children: [
|
|
4709
|
+
/* @__PURE__ */ jsxs46(
|
|
4757
4710
|
NavigationMenuTrigger,
|
|
4758
4711
|
{
|
|
4759
4712
|
className: item.icon !== void 0 ? "gap-2" : void 0,
|
|
4760
4713
|
children: [
|
|
4761
|
-
item.icon ? /* @__PURE__ */
|
|
4714
|
+
item.icon ? /* @__PURE__ */ jsx68(Icon, { name: item.icon, size: "sm" }) : null,
|
|
4762
4715
|
item.label
|
|
4763
4716
|
]
|
|
4764
4717
|
}
|
|
4765
4718
|
),
|
|
4766
|
-
/* @__PURE__ */
|
|
4767
|
-
/* @__PURE__ */
|
|
4719
|
+
/* @__PURE__ */ jsx68(NavigationMenuContent, { children: /* @__PURE__ */ jsx68("ul", { className: "grid w-64 gap-1", children: item.children.map((child) => /* @__PURE__ */ jsx68("li", { children: /* @__PURE__ */ jsxs46(NavigationMenuLink, { href: child.href, children: [
|
|
4720
|
+
/* @__PURE__ */ jsxs46(
|
|
4768
4721
|
"span",
|
|
4769
4722
|
{
|
|
4770
4723
|
className: child.icon !== void 0 ? "flex items-center gap-2 font-medium" : "font-medium",
|
|
4771
4724
|
children: [
|
|
4772
|
-
child.icon ? /* @__PURE__ */
|
|
4725
|
+
child.icon ? /* @__PURE__ */ jsx68(Icon, { name: child.icon, size: "sm" }) : null,
|
|
4773
4726
|
child.label
|
|
4774
4727
|
]
|
|
4775
4728
|
}
|
|
4776
4729
|
),
|
|
4777
|
-
child.description ? /* @__PURE__ */
|
|
4730
|
+
child.description ? /* @__PURE__ */ jsx68("span", { className: "text-muted-foreground", children: child.description }) : null
|
|
4778
4731
|
] }) }, child.href)) }) })
|
|
4779
|
-
] }) : /* @__PURE__ */
|
|
4732
|
+
] }) : /* @__PURE__ */ jsxs46(
|
|
4780
4733
|
NavigationMenuLink,
|
|
4781
4734
|
{
|
|
4782
4735
|
href: item.href,
|
|
@@ -4787,7 +4740,7 @@ function NavigationMenu2({ items = [], className, style }) {
|
|
|
4787
4740
|
item.icon !== void 0 && "gap-2"
|
|
4788
4741
|
),
|
|
4789
4742
|
children: [
|
|
4790
|
-
item.icon ? /* @__PURE__ */
|
|
4743
|
+
item.icon ? /* @__PURE__ */ jsx68(Icon, { name: item.icon, size: "sm" }) : null,
|
|
4791
4744
|
item.label
|
|
4792
4745
|
]
|
|
4793
4746
|
}
|
|
@@ -4796,7 +4749,7 @@ function NavigationMenu2({ items = [], className, style }) {
|
|
|
4796
4749
|
|
|
4797
4750
|
// src/components/components/Notification/index.tsx
|
|
4798
4751
|
import { useEffect as useEffect17 } from "react";
|
|
4799
|
-
import { jsx as
|
|
4752
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
4800
4753
|
function Notification({
|
|
4801
4754
|
title,
|
|
4802
4755
|
description,
|
|
@@ -4810,14 +4763,14 @@ function Notification({
|
|
|
4810
4763
|
toast(title, { description, variant, duration });
|
|
4811
4764
|
}
|
|
4812
4765
|
}, [title]);
|
|
4813
|
-
return /* @__PURE__ */
|
|
4766
|
+
return /* @__PURE__ */ jsx69("div", { "data-slot": "notification", hidden: true, className, style });
|
|
4814
4767
|
}
|
|
4815
4768
|
|
|
4816
4769
|
// src/components/components/NumberInput/index.tsx
|
|
4817
4770
|
import { useI18n as useI18n20 } from "@pactor-app/runtime";
|
|
4818
4771
|
import { ChevronDownIcon as ChevronDownIcon2, ChevronUpIcon } from "lucide-react";
|
|
4819
4772
|
import { useEffect as useEffect18, useId as useId8, useState as useState24 } from "react";
|
|
4820
|
-
import { jsx as
|
|
4773
|
+
import { jsx as jsx70, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
4821
4774
|
function clamp2(value, min, max) {
|
|
4822
4775
|
let next = value;
|
|
4823
4776
|
if (typeof min === "number" && next < min) next = min;
|
|
@@ -4900,14 +4853,14 @@ function NumberInput({
|
|
|
4900
4853
|
setText("");
|
|
4901
4854
|
commit(void 0);
|
|
4902
4855
|
};
|
|
4903
|
-
const control = /* @__PURE__ */
|
|
4856
|
+
const control = /* @__PURE__ */ jsxs47(
|
|
4904
4857
|
"span",
|
|
4905
4858
|
{
|
|
4906
4859
|
"data-slot": "number-input",
|
|
4907
4860
|
className: cn("group relative block", !inForm && className),
|
|
4908
4861
|
style: !inForm ? style : void 0,
|
|
4909
4862
|
children: [
|
|
4910
|
-
/* @__PURE__ */
|
|
4863
|
+
/* @__PURE__ */ jsx70(
|
|
4911
4864
|
Input,
|
|
4912
4865
|
{
|
|
4913
4866
|
id: controlId,
|
|
@@ -4936,7 +4889,7 @@ function NumberInput({
|
|
|
4936
4889
|
}
|
|
4937
4890
|
}
|
|
4938
4891
|
),
|
|
4939
|
-
/* @__PURE__ */
|
|
4892
|
+
/* @__PURE__ */ jsxs47(
|
|
4940
4893
|
"span",
|
|
4941
4894
|
{
|
|
4942
4895
|
className: cn(
|
|
@@ -4944,7 +4897,7 @@ function NumberInput({
|
|
|
4944
4897
|
showClear && CLEARABLE_ICON_HIDE
|
|
4945
4898
|
),
|
|
4946
4899
|
children: [
|
|
4947
|
-
/* @__PURE__ */
|
|
4900
|
+
/* @__PURE__ */ jsx70(
|
|
4948
4901
|
"button",
|
|
4949
4902
|
{
|
|
4950
4903
|
type: "button",
|
|
@@ -4953,10 +4906,10 @@ function NumberInput({
|
|
|
4953
4906
|
disabled: disabled === true || atMax,
|
|
4954
4907
|
className: stepperClass,
|
|
4955
4908
|
onClick: () => stepBy(1),
|
|
4956
|
-
children: /* @__PURE__ */
|
|
4909
|
+
children: /* @__PURE__ */ jsx70(ChevronUpIcon, { className: "size-3" })
|
|
4957
4910
|
}
|
|
4958
4911
|
),
|
|
4959
|
-
/* @__PURE__ */
|
|
4912
|
+
/* @__PURE__ */ jsx70(
|
|
4960
4913
|
"button",
|
|
4961
4914
|
{
|
|
4962
4915
|
type: "button",
|
|
@@ -4965,13 +4918,13 @@ function NumberInput({
|
|
|
4965
4918
|
disabled: disabled === true || atMin,
|
|
4966
4919
|
className: stepperClass,
|
|
4967
4920
|
onClick: () => stepBy(-1),
|
|
4968
|
-
children: /* @__PURE__ */
|
|
4921
|
+
children: /* @__PURE__ */ jsx70(ChevronDownIcon2, { className: "size-3" })
|
|
4969
4922
|
}
|
|
4970
4923
|
)
|
|
4971
4924
|
]
|
|
4972
4925
|
}
|
|
4973
4926
|
),
|
|
4974
|
-
showClear ? /* @__PURE__ */
|
|
4927
|
+
showClear ? /* @__PURE__ */ jsx70(
|
|
4975
4928
|
ClearHoverButton,
|
|
4976
4929
|
{
|
|
4977
4930
|
label: t("pactor.control.clear"),
|
|
@@ -4983,11 +4936,12 @@ function NumberInput({
|
|
|
4983
4936
|
}
|
|
4984
4937
|
);
|
|
4985
4938
|
if (inForm && form && name) {
|
|
4986
|
-
return /* @__PURE__ */
|
|
4939
|
+
return /* @__PURE__ */ jsx70(
|
|
4987
4940
|
FieldShell,
|
|
4988
4941
|
{
|
|
4989
4942
|
layout: form.layout,
|
|
4990
4943
|
label,
|
|
4944
|
+
rules,
|
|
4991
4945
|
htmlFor: controlId,
|
|
4992
4946
|
error: form.errors[name],
|
|
4993
4947
|
className,
|
|
@@ -5000,11 +4954,11 @@ function NumberInput({
|
|
|
5000
4954
|
}
|
|
5001
4955
|
|
|
5002
4956
|
// src/components/components/Page/index.tsx
|
|
5003
|
-
import { jsx as
|
|
4957
|
+
import { jsx as jsx71, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
5004
4958
|
function Page({ title, className, style, children }) {
|
|
5005
|
-
return /* @__PURE__ */
|
|
5006
|
-
title ? /* @__PURE__ */
|
|
5007
|
-
/* @__PURE__ */
|
|
4959
|
+
return /* @__PURE__ */ jsxs48("div", { "data-slot": "page", className: cn("p-6", className), style, children: [
|
|
4960
|
+
title ? /* @__PURE__ */ jsx71("h2", { "data-slot": "page-title", className: "mb-5 text-xl font-semibold", children: title }) : null,
|
|
4961
|
+
/* @__PURE__ */ jsx71("div", { "data-slot": "page-content", className: "space-y-5", children })
|
|
5008
4962
|
] });
|
|
5009
4963
|
}
|
|
5010
4964
|
|
|
@@ -5012,7 +4966,7 @@ function Page({ title, className, style, children }) {
|
|
|
5012
4966
|
import { useI18n as useI18n21 } from "@pactor-app/runtime";
|
|
5013
4967
|
import { ChevronDownIcon as ChevronDownIcon3, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
5014
4968
|
import { useState as useState25 } from "react";
|
|
5015
|
-
import { jsx as
|
|
4969
|
+
import { jsx as jsx72, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
5016
4970
|
function pageItems(current, count) {
|
|
5017
4971
|
if (count <= 7) {
|
|
5018
4972
|
return Array.from({ length: count }, (_, i) => i + 1);
|
|
@@ -5065,7 +5019,7 @@ function Pagination2({
|
|
|
5065
5019
|
onChange?.(1);
|
|
5066
5020
|
};
|
|
5067
5021
|
const sizes = (pageSizeOptions ?? []).map(Number).filter((n) => Number.isFinite(n) && n > 0);
|
|
5068
|
-
return /* @__PURE__ */
|
|
5022
|
+
return /* @__PURE__ */ jsx72(
|
|
5069
5023
|
Pagination,
|
|
5070
5024
|
{
|
|
5071
5025
|
className: cn(
|
|
@@ -5074,8 +5028,8 @@ function Pagination2({
|
|
|
5074
5028
|
className
|
|
5075
5029
|
),
|
|
5076
5030
|
style,
|
|
5077
|
-
children: /* @__PURE__ */
|
|
5078
|
-
showTotal && /* @__PURE__ */
|
|
5031
|
+
children: /* @__PURE__ */ jsxs49(PaginationContent, { children: [
|
|
5032
|
+
showTotal && /* @__PURE__ */ jsx72(PaginationItem, { children: /* @__PURE__ */ jsx72(
|
|
5079
5033
|
"span",
|
|
5080
5034
|
{
|
|
5081
5035
|
"data-slot": "pagination-total",
|
|
@@ -5083,8 +5037,8 @@ function Pagination2({
|
|
|
5083
5037
|
children: t("pactor.pagination.total", { count: total })
|
|
5084
5038
|
}
|
|
5085
5039
|
) }),
|
|
5086
|
-
sizes.length > 0 && /* @__PURE__ */
|
|
5087
|
-
/* @__PURE__ */
|
|
5040
|
+
sizes.length > 0 && /* @__PURE__ */ jsx72(PaginationItem, { children: /* @__PURE__ */ jsxs49(DropdownMenu, { children: [
|
|
5041
|
+
/* @__PURE__ */ jsxs49(
|
|
5088
5042
|
DropdownMenuTrigger,
|
|
5089
5043
|
{
|
|
5090
5044
|
"data-slot": "pagination-page-size",
|
|
@@ -5094,11 +5048,11 @@ function Pagination2({
|
|
|
5094
5048
|
),
|
|
5095
5049
|
children: [
|
|
5096
5050
|
t("pactor.pagination.pageSize", { size: effectivePageSize }),
|
|
5097
|
-
/* @__PURE__ */
|
|
5051
|
+
/* @__PURE__ */ jsx72(ChevronDownIcon3, { className: "size-3.5", "aria-hidden": "true" })
|
|
5098
5052
|
]
|
|
5099
5053
|
}
|
|
5100
5054
|
),
|
|
5101
|
-
/* @__PURE__ */
|
|
5055
|
+
/* @__PURE__ */ jsx72(DropdownMenuContent, { align: "start", children: renderDropdownItems(
|
|
5102
5056
|
sizes.map((s) => ({
|
|
5103
5057
|
label: t("pactor.pagination.itemsPerPage", { size: s }),
|
|
5104
5058
|
value: String(s),
|
|
@@ -5107,7 +5061,7 @@ function Pagination2({
|
|
|
5107
5061
|
(v) => changePageSize(Number(v))
|
|
5108
5062
|
) })
|
|
5109
5063
|
] }) }),
|
|
5110
|
-
/* @__PURE__ */
|
|
5064
|
+
/* @__PURE__ */ jsx72(PaginationItem, { children: /* @__PURE__ */ jsxs49(
|
|
5111
5065
|
PaginationLink,
|
|
5112
5066
|
{
|
|
5113
5067
|
href: "#",
|
|
@@ -5119,12 +5073,12 @@ function Pagination2({
|
|
|
5119
5073
|
goTo(current - 1);
|
|
5120
5074
|
},
|
|
5121
5075
|
children: [
|
|
5122
|
-
/* @__PURE__ */
|
|
5123
|
-
/* @__PURE__ */
|
|
5076
|
+
/* @__PURE__ */ jsx72(ChevronLeftIcon, {}),
|
|
5077
|
+
/* @__PURE__ */ jsx72("span", { className: "hidden sm:block", children: t("pactor.pagination.prev") })
|
|
5124
5078
|
]
|
|
5125
5079
|
}
|
|
5126
5080
|
) }),
|
|
5127
|
-
pageItems(current, pageCount).map((item, index) => /* @__PURE__ */
|
|
5081
|
+
pageItems(current, pageCount).map((item, index) => /* @__PURE__ */ jsx72(PaginationItem, { children: item === "ellipsis" ? /* @__PURE__ */ jsx72(PaginationEllipsis, {}) : /* @__PURE__ */ jsx72(
|
|
5128
5082
|
PaginationLink,
|
|
5129
5083
|
{
|
|
5130
5084
|
href: "#",
|
|
@@ -5136,7 +5090,7 @@ function Pagination2({
|
|
|
5136
5090
|
children: item
|
|
5137
5091
|
}
|
|
5138
5092
|
) }, item === "ellipsis" ? `ellipsis-${index}` : item)),
|
|
5139
|
-
/* @__PURE__ */
|
|
5093
|
+
/* @__PURE__ */ jsx72(PaginationItem, { children: /* @__PURE__ */ jsxs49(
|
|
5140
5094
|
PaginationLink,
|
|
5141
5095
|
{
|
|
5142
5096
|
href: "#",
|
|
@@ -5148,8 +5102,8 @@ function Pagination2({
|
|
|
5148
5102
|
goTo(current + 1);
|
|
5149
5103
|
},
|
|
5150
5104
|
children: [
|
|
5151
|
-
/* @__PURE__ */
|
|
5152
|
-
/* @__PURE__ */
|
|
5105
|
+
/* @__PURE__ */ jsx72("span", { className: "hidden sm:block", children: t("pactor.pagination.next") }),
|
|
5106
|
+
/* @__PURE__ */ jsx72(ChevronRightIcon, {})
|
|
5153
5107
|
]
|
|
5154
5108
|
}
|
|
5155
5109
|
) })
|
|
@@ -5161,7 +5115,7 @@ function Pagination2({
|
|
|
5161
5115
|
// src/components/components/Popconfirm/index.tsx
|
|
5162
5116
|
import { useI18n as useI18n22 } from "@pactor-app/runtime";
|
|
5163
5117
|
import { useState as useState26 } from "react";
|
|
5164
|
-
import { jsx as
|
|
5118
|
+
import { jsx as jsx73, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
5165
5119
|
function Popconfirm({
|
|
5166
5120
|
title,
|
|
5167
5121
|
description,
|
|
@@ -5176,8 +5130,8 @@ function Popconfirm({
|
|
|
5176
5130
|
}) {
|
|
5177
5131
|
const { t } = useI18n22();
|
|
5178
5132
|
const [open, setOpen] = useState26(false);
|
|
5179
|
-
return /* @__PURE__ */
|
|
5180
|
-
/* @__PURE__ */
|
|
5133
|
+
return /* @__PURE__ */ jsxs50(Popover, { open, onOpenChange: setOpen, children: [
|
|
5134
|
+
/* @__PURE__ */ jsx73(
|
|
5181
5135
|
PopoverTrigger,
|
|
5182
5136
|
{
|
|
5183
5137
|
nativeButton: false,
|
|
@@ -5185,10 +5139,10 @@ function Popconfirm({
|
|
|
5185
5139
|
children
|
|
5186
5140
|
}
|
|
5187
5141
|
),
|
|
5188
|
-
/* @__PURE__ */
|
|
5189
|
-
/* @__PURE__ */
|
|
5190
|
-
title ? /* @__PURE__ */
|
|
5191
|
-
description ? /* @__PURE__ */
|
|
5142
|
+
/* @__PURE__ */ jsx73(PopoverContent, { className, style, children: /* @__PURE__ */ jsxs50("div", { className: "grid gap-3", children: [
|
|
5143
|
+
/* @__PURE__ */ jsxs50("div", { className: "grid gap-1", children: [
|
|
5144
|
+
title ? /* @__PURE__ */ jsx73("div", { "data-slot": "popconfirm-title", className: "font-medium", children: title }) : null,
|
|
5145
|
+
description ? /* @__PURE__ */ jsx73(
|
|
5192
5146
|
"div",
|
|
5193
5147
|
{
|
|
5194
5148
|
"data-slot": "popconfirm-description",
|
|
@@ -5197,8 +5151,8 @@ function Popconfirm({
|
|
|
5197
5151
|
}
|
|
5198
5152
|
) : null
|
|
5199
5153
|
] }),
|
|
5200
|
-
/* @__PURE__ */
|
|
5201
|
-
/* @__PURE__ */
|
|
5154
|
+
/* @__PURE__ */ jsxs50("div", { className: "flex justify-end gap-2", children: [
|
|
5155
|
+
/* @__PURE__ */ jsx73(
|
|
5202
5156
|
Button,
|
|
5203
5157
|
{
|
|
5204
5158
|
variant: "outline",
|
|
@@ -5210,7 +5164,7 @@ function Popconfirm({
|
|
|
5210
5164
|
children: cancelText ?? t("pactor.alertDialog.cancel")
|
|
5211
5165
|
}
|
|
5212
5166
|
),
|
|
5213
|
-
/* @__PURE__ */
|
|
5167
|
+
/* @__PURE__ */ jsx73(
|
|
5214
5168
|
Button,
|
|
5215
5169
|
{
|
|
5216
5170
|
variant: danger ? "destructive" : "default",
|
|
@@ -5229,14 +5183,14 @@ function Popconfirm({
|
|
|
5229
5183
|
|
|
5230
5184
|
// src/components/components/Popover/index.tsx
|
|
5231
5185
|
import { useRenderer as useRenderer15 } from "@pactor-app/runtime";
|
|
5232
|
-
import { jsx as
|
|
5186
|
+
import { jsx as jsx74, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
5233
5187
|
function isDslNode3(value) {
|
|
5234
5188
|
return typeof value === "object" && value !== null && typeof value.type === "string";
|
|
5235
5189
|
}
|
|
5236
5190
|
function Popover2({ content, children, side, align, className, style }) {
|
|
5237
5191
|
const { renderChildren } = useRenderer15();
|
|
5238
|
-
return /* @__PURE__ */
|
|
5239
|
-
/* @__PURE__ */
|
|
5192
|
+
return /* @__PURE__ */ jsxs51(Popover, { children: [
|
|
5193
|
+
/* @__PURE__ */ jsx74(
|
|
5240
5194
|
PopoverTrigger,
|
|
5241
5195
|
{
|
|
5242
5196
|
nativeButton: false,
|
|
@@ -5244,21 +5198,21 @@ function Popover2({ content, children, side, align, className, style }) {
|
|
|
5244
5198
|
children
|
|
5245
5199
|
}
|
|
5246
5200
|
),
|
|
5247
|
-
/* @__PURE__ */
|
|
5201
|
+
/* @__PURE__ */ jsx74(PopoverContent, { className, style, side, align, children: isDslNode3(content) ? renderChildren([content]) : content })
|
|
5248
5202
|
] });
|
|
5249
5203
|
}
|
|
5250
5204
|
|
|
5251
5205
|
// src/components/components/Progress/index.tsx
|
|
5252
|
-
import { jsx as
|
|
5206
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
5253
5207
|
function Progress2({ value, className, style }) {
|
|
5254
5208
|
const resolved = typeof value === "number" && Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : null;
|
|
5255
|
-
return /* @__PURE__ */
|
|
5209
|
+
return /* @__PURE__ */ jsx75(Progress, { value: resolved, className, style, children: /* @__PURE__ */ jsx75(ProgressTrack, { children: /* @__PURE__ */ jsx75(ProgressIndicator, {}) }) });
|
|
5256
5210
|
}
|
|
5257
5211
|
|
|
5258
5212
|
// src/components/components/QRCode/index.tsx
|
|
5259
5213
|
import { toString } from "qrcode";
|
|
5260
5214
|
import { useEffect as useEffect19, useState as useState27 } from "react";
|
|
5261
|
-
import { jsx as
|
|
5215
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
5262
5216
|
var HEX_RE2 = /^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}(?:[0-9a-fA-F]{2})?)$/;
|
|
5263
5217
|
function validHex(value) {
|
|
5264
5218
|
return value && HEX_RE2.test(value.trim()) ? value.trim() : void 0;
|
|
@@ -5292,7 +5246,7 @@ function QRCode({
|
|
|
5292
5246
|
cancelled = true;
|
|
5293
5247
|
};
|
|
5294
5248
|
}, [value, color, bgColor]);
|
|
5295
|
-
return /* @__PURE__ */
|
|
5249
|
+
return /* @__PURE__ */ jsx76(
|
|
5296
5250
|
"div",
|
|
5297
5251
|
{
|
|
5298
5252
|
"data-slot": "qrcode",
|
|
@@ -5302,7 +5256,7 @@ function QRCode({
|
|
|
5302
5256
|
className
|
|
5303
5257
|
),
|
|
5304
5258
|
style,
|
|
5305
|
-
children: svg ? /* @__PURE__ */
|
|
5259
|
+
children: svg ? /* @__PURE__ */ jsx76(
|
|
5306
5260
|
"div",
|
|
5307
5261
|
{
|
|
5308
5262
|
"data-slot": "qrcode-svg",
|
|
@@ -5310,13 +5264,13 @@ function QRCode({
|
|
|
5310
5264
|
style: { width: size, height: size },
|
|
5311
5265
|
dangerouslySetInnerHTML: { __html: svg }
|
|
5312
5266
|
}
|
|
5313
|
-
) : /* @__PURE__ */
|
|
5267
|
+
) : /* @__PURE__ */ jsx76(
|
|
5314
5268
|
"div",
|
|
5315
5269
|
{
|
|
5316
5270
|
"data-slot": "qrcode-placeholder",
|
|
5317
5271
|
className: "flex items-center justify-center rounded-md bg-muted text-muted-foreground",
|
|
5318
5272
|
style: { width: size, height: size },
|
|
5319
|
-
children: /* @__PURE__ */
|
|
5273
|
+
children: /* @__PURE__ */ jsx76(Icon, { name: "image", size: "lg" })
|
|
5320
5274
|
}
|
|
5321
5275
|
)
|
|
5322
5276
|
}
|
|
@@ -5325,7 +5279,7 @@ function QRCode({
|
|
|
5325
5279
|
|
|
5326
5280
|
// src/components/components/RadioGroup/index.tsx
|
|
5327
5281
|
import { useEffect as useEffect20, useId as useId9 } from "react";
|
|
5328
|
-
import { jsx as
|
|
5282
|
+
import { jsx as jsx77, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
5329
5283
|
function RadioGroup2({
|
|
5330
5284
|
name,
|
|
5331
5285
|
label,
|
|
@@ -5356,7 +5310,7 @@ function RadioGroup2({
|
|
|
5356
5310
|
onChange?.(next);
|
|
5357
5311
|
};
|
|
5358
5312
|
const groupValue = current ?? "";
|
|
5359
|
-
const group = /* @__PURE__ */
|
|
5313
|
+
const group = /* @__PURE__ */ jsx77(
|
|
5360
5314
|
RadioGroup,
|
|
5361
5315
|
{
|
|
5362
5316
|
value: groupValue,
|
|
@@ -5371,8 +5325,8 @@ function RadioGroup2({
|
|
|
5371
5325
|
children: options.map((option, index) => {
|
|
5372
5326
|
const textId = `${controlId}-${index}`;
|
|
5373
5327
|
const optionDisabled = disabled === true || option.disabled === true;
|
|
5374
|
-
return /* @__PURE__ */
|
|
5375
|
-
/* @__PURE__ */
|
|
5328
|
+
return /* @__PURE__ */ jsxs52("span", { className: "inline-flex items-center gap-2", children: [
|
|
5329
|
+
/* @__PURE__ */ jsx77(
|
|
5376
5330
|
RadioGroupItem,
|
|
5377
5331
|
{
|
|
5378
5332
|
value: option.value,
|
|
@@ -5380,7 +5334,7 @@ function RadioGroup2({
|
|
|
5380
5334
|
"aria-labelledby": textId
|
|
5381
5335
|
}
|
|
5382
5336
|
),
|
|
5383
|
-
/* @__PURE__ */
|
|
5337
|
+
/* @__PURE__ */ jsx77(
|
|
5384
5338
|
"span",
|
|
5385
5339
|
{
|
|
5386
5340
|
id: textId,
|
|
@@ -5401,11 +5355,12 @@ function RadioGroup2({
|
|
|
5401
5355
|
}
|
|
5402
5356
|
);
|
|
5403
5357
|
if (inForm && form && name) {
|
|
5404
|
-
return /* @__PURE__ */
|
|
5358
|
+
return /* @__PURE__ */ jsx77(
|
|
5405
5359
|
FieldShell,
|
|
5406
5360
|
{
|
|
5407
5361
|
layout: form.layout,
|
|
5408
5362
|
label,
|
|
5363
|
+
rules,
|
|
5409
5364
|
error: form.errors[name],
|
|
5410
5365
|
className,
|
|
5411
5366
|
style,
|
|
@@ -5420,7 +5375,7 @@ function RadioGroup2({
|
|
|
5420
5375
|
import { useI18n as useI18n23 } from "@pactor-app/runtime";
|
|
5421
5376
|
import { Star } from "lucide-react";
|
|
5422
5377
|
import { useEffect as useEffect21, useState as useState28 } from "react";
|
|
5423
|
-
import { Fragment as Fragment8, jsx as
|
|
5378
|
+
import { Fragment as Fragment8, jsx as jsx78, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
5424
5379
|
function Rate({
|
|
5425
5380
|
name,
|
|
5426
5381
|
label,
|
|
@@ -5463,8 +5418,8 @@ function Rate({
|
|
|
5463
5418
|
const full = rating >= i;
|
|
5464
5419
|
const half = !full && rating >= i - 0.5;
|
|
5465
5420
|
stars.push(
|
|
5466
|
-
/* @__PURE__ */
|
|
5467
|
-
/* @__PURE__ */
|
|
5421
|
+
/* @__PURE__ */ jsxs53("span", { className: "relative inline-flex", "data-slot": "rate-star", children: [
|
|
5422
|
+
/* @__PURE__ */ jsx78(
|
|
5468
5423
|
Star,
|
|
5469
5424
|
{
|
|
5470
5425
|
className: cn(
|
|
@@ -5473,9 +5428,9 @@ function Rate({
|
|
|
5473
5428
|
)
|
|
5474
5429
|
}
|
|
5475
5430
|
),
|
|
5476
|
-
half ? /* @__PURE__ */
|
|
5477
|
-
allowHalf ? /* @__PURE__ */
|
|
5478
|
-
/* @__PURE__ */
|
|
5431
|
+
half ? /* @__PURE__ */ jsx78("span", { className: "absolute inset-0 w-1/2 overflow-hidden", "aria-hidden": true, children: /* @__PURE__ */ jsx78(Star, { className: "size-5 fill-warning text-warning" }) }) : null,
|
|
5432
|
+
allowHalf ? /* @__PURE__ */ jsxs53(Fragment8, { children: [
|
|
5433
|
+
/* @__PURE__ */ jsx78(
|
|
5479
5434
|
"button",
|
|
5480
5435
|
{
|
|
5481
5436
|
type: "button",
|
|
@@ -5485,7 +5440,7 @@ function Rate({
|
|
|
5485
5440
|
onClick: () => handleSelect(i - 0.5)
|
|
5486
5441
|
}
|
|
5487
5442
|
),
|
|
5488
|
-
/* @__PURE__ */
|
|
5443
|
+
/* @__PURE__ */ jsx78(
|
|
5489
5444
|
"button",
|
|
5490
5445
|
{
|
|
5491
5446
|
type: "button",
|
|
@@ -5495,7 +5450,7 @@ function Rate({
|
|
|
5495
5450
|
onClick: () => handleSelect(i)
|
|
5496
5451
|
}
|
|
5497
5452
|
)
|
|
5498
|
-
] }) : /* @__PURE__ */
|
|
5453
|
+
] }) : /* @__PURE__ */ jsx78(
|
|
5499
5454
|
"button",
|
|
5500
5455
|
{
|
|
5501
5456
|
type: "button",
|
|
@@ -5508,7 +5463,7 @@ function Rate({
|
|
|
5508
5463
|
] }, i)
|
|
5509
5464
|
);
|
|
5510
5465
|
}
|
|
5511
|
-
const control = /* @__PURE__ */
|
|
5466
|
+
const control = /* @__PURE__ */ jsx78(
|
|
5512
5467
|
"div",
|
|
5513
5468
|
{
|
|
5514
5469
|
"data-slot": "rate",
|
|
@@ -5523,11 +5478,12 @@ function Rate({
|
|
|
5523
5478
|
}
|
|
5524
5479
|
);
|
|
5525
5480
|
if (inForm && form && name) {
|
|
5526
|
-
return /* @__PURE__ */
|
|
5481
|
+
return /* @__PURE__ */ jsx78(
|
|
5527
5482
|
FieldShell,
|
|
5528
5483
|
{
|
|
5529
5484
|
layout: form.layout,
|
|
5530
5485
|
label,
|
|
5486
|
+
rules,
|
|
5531
5487
|
error: form.errors[name],
|
|
5532
5488
|
className,
|
|
5533
5489
|
style,
|
|
@@ -5541,7 +5497,7 @@ function Rate({
|
|
|
5541
5497
|
// src/components/components/Resizable/index.tsx
|
|
5542
5498
|
import { useRenderer as useRenderer16 } from "@pactor-app/runtime";
|
|
5543
5499
|
import { Fragment as Fragment9 } from "react";
|
|
5544
|
-
import { jsx as
|
|
5500
|
+
import { jsx as jsx79, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
5545
5501
|
function Resizable({
|
|
5546
5502
|
panels = [],
|
|
5547
5503
|
direction = "horizontal",
|
|
@@ -5549,9 +5505,9 @@ function Resizable({
|
|
|
5549
5505
|
style
|
|
5550
5506
|
}) {
|
|
5551
5507
|
const { renderChildren } = useRenderer16();
|
|
5552
|
-
return /* @__PURE__ */
|
|
5553
|
-
index > 0 ? /* @__PURE__ */
|
|
5554
|
-
/* @__PURE__ */
|
|
5508
|
+
return /* @__PURE__ */ jsx79(PanelGroup, { orientation: direction, className, style, children: panels.map((panel, index) => /* @__PURE__ */ jsxs54(Fragment9, { children: [
|
|
5509
|
+
index > 0 ? /* @__PURE__ */ jsx79(ResizableHandle, { withHandle: true }) : null,
|
|
5510
|
+
/* @__PURE__ */ jsx79(
|
|
5555
5511
|
Panel,
|
|
5556
5512
|
{
|
|
5557
5513
|
defaultSize: typeof panel.defaultSizePx === "number" ? `${panel.defaultSizePx}px` : typeof panel.defaultSize === "number" ? `${panel.defaultSize}%` : void 0,
|
|
@@ -5565,7 +5521,7 @@ function Resizable({
|
|
|
5565
5521
|
|
|
5566
5522
|
// src/components/components/Result/index.tsx
|
|
5567
5523
|
import { CircleCheck, CircleX, Info, TriangleAlert } from "lucide-react";
|
|
5568
|
-
import { jsx as
|
|
5524
|
+
import { jsx as jsx80, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
5569
5525
|
var statusIcon = {
|
|
5570
5526
|
success: { icon: CircleCheck, className: "text-success" },
|
|
5571
5527
|
error: { icon: CircleX, className: "text-destructive" },
|
|
@@ -5582,7 +5538,7 @@ function Result({
|
|
|
5582
5538
|
}) {
|
|
5583
5539
|
const entry = statusIcon[status];
|
|
5584
5540
|
const StatusIcon = entry?.icon;
|
|
5585
|
-
return /* @__PURE__ */
|
|
5541
|
+
return /* @__PURE__ */ jsxs55(
|
|
5586
5542
|
"div",
|
|
5587
5543
|
{
|
|
5588
5544
|
"data-slot": "result",
|
|
@@ -5593,9 +5549,9 @@ function Result({
|
|
|
5593
5549
|
),
|
|
5594
5550
|
style,
|
|
5595
5551
|
children: [
|
|
5596
|
-
/* @__PURE__ */
|
|
5597
|
-
title ? /* @__PURE__ */
|
|
5598
|
-
subTitle ? /* @__PURE__ */
|
|
5552
|
+
/* @__PURE__ */ jsx80("div", { "data-slot": "result-icon", children: StatusIcon ? /* @__PURE__ */ jsx80(StatusIcon, { className: cn("size-12", entry.className) }) : /* @__PURE__ */ jsx80("span", { className: "text-5xl font-semibold text-muted-foreground", children: status }) }),
|
|
5553
|
+
title ? /* @__PURE__ */ jsx80("div", { "data-slot": "result-title", className: "text-lg font-medium", children: title }) : null,
|
|
5554
|
+
subTitle ? /* @__PURE__ */ jsx80(
|
|
5599
5555
|
"div",
|
|
5600
5556
|
{
|
|
5601
5557
|
"data-slot": "result-subtitle",
|
|
@@ -5603,7 +5559,7 @@ function Result({
|
|
|
5603
5559
|
children: subTitle
|
|
5604
5560
|
}
|
|
5605
5561
|
) : null,
|
|
5606
|
-
children ? /* @__PURE__ */
|
|
5562
|
+
children ? /* @__PURE__ */ jsx80("div", { "data-slot": "result-extra", className: "mt-2", children }) : null
|
|
5607
5563
|
]
|
|
5608
5564
|
}
|
|
5609
5565
|
);
|
|
@@ -5612,10 +5568,10 @@ function Result({
|
|
|
5612
5568
|
// src/components/components/RichText/index.tsx
|
|
5613
5569
|
import DOMPurify from "dompurify";
|
|
5614
5570
|
import { useMemo as useMemo4 } from "react";
|
|
5615
|
-
import { jsx as
|
|
5571
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
5616
5572
|
function RichText({ html, className, style }) {
|
|
5617
5573
|
const sanitized = useMemo4(() => DOMPurify.sanitize(html ?? ""), [html]);
|
|
5618
|
-
return /* @__PURE__ */
|
|
5574
|
+
return /* @__PURE__ */ jsx81(
|
|
5619
5575
|
"div",
|
|
5620
5576
|
{
|
|
5621
5577
|
"data-slot": "rich-text",
|
|
@@ -5627,7 +5583,7 @@ function RichText({ html, className, style }) {
|
|
|
5627
5583
|
}
|
|
5628
5584
|
|
|
5629
5585
|
// src/components/components/ScrollArea/index.tsx
|
|
5630
|
-
import { jsx as
|
|
5586
|
+
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
5631
5587
|
function ScrollArea2({
|
|
5632
5588
|
maxHeight,
|
|
5633
5589
|
maxWidth,
|
|
@@ -5635,7 +5591,7 @@ function ScrollArea2({
|
|
|
5635
5591
|
style,
|
|
5636
5592
|
children
|
|
5637
5593
|
}) {
|
|
5638
|
-
return /* @__PURE__ */
|
|
5594
|
+
return /* @__PURE__ */ jsx82(
|
|
5639
5595
|
ScrollArea,
|
|
5640
5596
|
{
|
|
5641
5597
|
className,
|
|
@@ -5647,7 +5603,7 @@ function ScrollArea2({
|
|
|
5647
5603
|
|
|
5648
5604
|
// src/components/components/Segmented/index.tsx
|
|
5649
5605
|
import { useEffect as useEffect22, useLayoutEffect, useRef as useRef6, useState as useState29 } from "react";
|
|
5650
|
-
import { jsx as
|
|
5606
|
+
import { jsx as jsx83, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
5651
5607
|
function Segmented({
|
|
5652
5608
|
name,
|
|
5653
5609
|
label,
|
|
@@ -5691,7 +5647,7 @@ function Segmented({
|
|
|
5691
5647
|
window.addEventListener("resize", measure);
|
|
5692
5648
|
return () => window.removeEventListener("resize", measure);
|
|
5693
5649
|
}, [activeIndex, options]);
|
|
5694
|
-
const control = /* @__PURE__ */
|
|
5650
|
+
const control = /* @__PURE__ */ jsxs56(
|
|
5695
5651
|
"div",
|
|
5696
5652
|
{
|
|
5697
5653
|
"data-slot": "segmented",
|
|
@@ -5703,7 +5659,7 @@ function Segmented({
|
|
|
5703
5659
|
),
|
|
5704
5660
|
style: inForm ? void 0 : style,
|
|
5705
5661
|
children: [
|
|
5706
|
-
indicator ? /* @__PURE__ */
|
|
5662
|
+
indicator ? /* @__PURE__ */ jsx83(
|
|
5707
5663
|
"span",
|
|
5708
5664
|
{
|
|
5709
5665
|
"data-slot": "segmented-indicator",
|
|
@@ -5714,7 +5670,7 @@ function Segmented({
|
|
|
5714
5670
|
) : null,
|
|
5715
5671
|
options.map((option, index) => {
|
|
5716
5672
|
const active = current === option.value;
|
|
5717
|
-
return /* @__PURE__ */
|
|
5673
|
+
return /* @__PURE__ */ jsxs56(
|
|
5718
5674
|
"button",
|
|
5719
5675
|
{
|
|
5720
5676
|
ref: (el) => {
|
|
@@ -5733,7 +5689,7 @@ function Segmented({
|
|
|
5733
5689
|
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
5734
5690
|
),
|
|
5735
5691
|
children: [
|
|
5736
|
-
option.icon ? /* @__PURE__ */
|
|
5692
|
+
option.icon ? /* @__PURE__ */ jsx83(Icon, { name: option.icon, size: "sm" }) : null,
|
|
5737
5693
|
option.label
|
|
5738
5694
|
]
|
|
5739
5695
|
},
|
|
@@ -5744,11 +5700,12 @@ function Segmented({
|
|
|
5744
5700
|
}
|
|
5745
5701
|
);
|
|
5746
5702
|
if (inForm && form && name) {
|
|
5747
|
-
return /* @__PURE__ */
|
|
5703
|
+
return /* @__PURE__ */ jsx83(
|
|
5748
5704
|
FieldShell,
|
|
5749
5705
|
{
|
|
5750
5706
|
layout: form.layout,
|
|
5751
5707
|
label,
|
|
5708
|
+
rules,
|
|
5752
5709
|
error: form.errors[name],
|
|
5753
5710
|
className,
|
|
5754
5711
|
style,
|
|
@@ -5762,7 +5719,7 @@ function Segmented({
|
|
|
5762
5719
|
// src/components/components/Select/index.tsx
|
|
5763
5720
|
import { useI18n as useI18n24 } from "@pactor-app/runtime";
|
|
5764
5721
|
import { useEffect as useEffect23, useId as useId10, useRef as useRef7, useState as useState30 } from "react";
|
|
5765
|
-
import { jsx as
|
|
5722
|
+
import { jsx as jsx84, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
5766
5723
|
function Select2({
|
|
5767
5724
|
name,
|
|
5768
5725
|
label,
|
|
@@ -5805,7 +5762,7 @@ function Select2({
|
|
|
5805
5762
|
onChange?.(next ?? void 0);
|
|
5806
5763
|
};
|
|
5807
5764
|
const inFormRoot = inForm === true;
|
|
5808
|
-
const select = /* @__PURE__ */
|
|
5765
|
+
const select = /* @__PURE__ */ jsx84(
|
|
5809
5766
|
"span",
|
|
5810
5767
|
{
|
|
5811
5768
|
className: cn(
|
|
@@ -5815,7 +5772,7 @@ function Select2({
|
|
|
5815
5772
|
controlClassName
|
|
5816
5773
|
),
|
|
5817
5774
|
style: inFormRoot ? void 0 : style,
|
|
5818
|
-
children: /* @__PURE__ */
|
|
5775
|
+
children: /* @__PURE__ */ jsxs57(
|
|
5819
5776
|
Select,
|
|
5820
5777
|
{
|
|
5821
5778
|
items: options,
|
|
@@ -5831,7 +5788,7 @@ function Select2({
|
|
|
5831
5788
|
}
|
|
5832
5789
|
},
|
|
5833
5790
|
children: [
|
|
5834
|
-
/* @__PURE__ */
|
|
5791
|
+
/* @__PURE__ */ jsxs57(
|
|
5835
5792
|
SelectTrigger,
|
|
5836
5793
|
{
|
|
5837
5794
|
id: controlId,
|
|
@@ -5843,8 +5800,8 @@ function Select2({
|
|
|
5843
5800
|
CLEARABLE_GROUP
|
|
5844
5801
|
),
|
|
5845
5802
|
children: [
|
|
5846
|
-
/* @__PURE__ */
|
|
5847
|
-
showClear ? /* @__PURE__ */
|
|
5803
|
+
/* @__PURE__ */ jsx84(SelectValue, { placeholder }),
|
|
5804
|
+
showClear ? /* @__PURE__ */ jsx84(
|
|
5848
5805
|
ClearHoverButton,
|
|
5849
5806
|
{
|
|
5850
5807
|
label: t("pactor.select.clear"),
|
|
@@ -5854,13 +5811,13 @@ function Select2({
|
|
|
5854
5811
|
]
|
|
5855
5812
|
}
|
|
5856
5813
|
),
|
|
5857
|
-
/* @__PURE__ */
|
|
5858
|
-
searchEnabled ? /* @__PURE__ */
|
|
5814
|
+
/* @__PURE__ */ jsxs57(SelectContent, { children: [
|
|
5815
|
+
searchEnabled ? /* @__PURE__ */ jsx84(
|
|
5859
5816
|
"div",
|
|
5860
5817
|
{
|
|
5861
5818
|
"data-slot": "select-search",
|
|
5862
5819
|
className: "sticky top-0 z-10 -mx-1 -mt-1 bg-popover px-1 pt-1 pb-1",
|
|
5863
|
-
children: /* @__PURE__ */
|
|
5820
|
+
children: /* @__PURE__ */ jsx84(
|
|
5864
5821
|
"input",
|
|
5865
5822
|
{
|
|
5866
5823
|
ref: searchInputRef,
|
|
@@ -5878,7 +5835,7 @@ function Select2({
|
|
|
5878
5835
|
)
|
|
5879
5836
|
}
|
|
5880
5837
|
) : null,
|
|
5881
|
-
visibleOptions.map((option) => /* @__PURE__ */
|
|
5838
|
+
visibleOptions.map((option) => /* @__PURE__ */ jsx84(
|
|
5882
5839
|
SelectItem,
|
|
5883
5840
|
{
|
|
5884
5841
|
value: option.value,
|
|
@@ -5887,7 +5844,7 @@ function Select2({
|
|
|
5887
5844
|
},
|
|
5888
5845
|
String(option.value)
|
|
5889
5846
|
)),
|
|
5890
|
-
visibleOptions.length === 0 ? /* @__PURE__ */
|
|
5847
|
+
visibleOptions.length === 0 ? /* @__PURE__ */ jsx84("div", { className: "px-2 py-3 text-center text-sm text-muted-foreground", children: t("pactor.command.empty") }) : null
|
|
5891
5848
|
] })
|
|
5892
5849
|
]
|
|
5893
5850
|
}
|
|
@@ -5895,25 +5852,17 @@ function Select2({
|
|
|
5895
5852
|
}
|
|
5896
5853
|
);
|
|
5897
5854
|
if (inForm && form && name) {
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
"div",
|
|
5855
|
+
return /* @__PURE__ */ jsx84(
|
|
5856
|
+
FieldShell,
|
|
5901
5857
|
{
|
|
5902
|
-
|
|
5903
|
-
|
|
5858
|
+
layout: form.layout,
|
|
5859
|
+
label,
|
|
5860
|
+
htmlFor: controlId,
|
|
5861
|
+
rules,
|
|
5862
|
+
error: form.errors[name],
|
|
5863
|
+
className,
|
|
5904
5864
|
style,
|
|
5905
|
-
children:
|
|
5906
|
-
label ? /* @__PURE__ */ jsx86(
|
|
5907
|
-
"label",
|
|
5908
|
-
{
|
|
5909
|
-
htmlFor: controlId,
|
|
5910
|
-
className: "shrink-0 text-sm leading-none font-medium whitespace-nowrap",
|
|
5911
|
-
children: label
|
|
5912
|
-
}
|
|
5913
|
-
) : null,
|
|
5914
|
-
select,
|
|
5915
|
-
error ? /* @__PURE__ */ jsx86("div", { "data-slot": "form-error", className: "text-sm text-destructive", children: error }) : null
|
|
5916
|
-
]
|
|
5865
|
+
children: select
|
|
5917
5866
|
}
|
|
5918
5867
|
);
|
|
5919
5868
|
}
|
|
@@ -5921,9 +5870,9 @@ function Select2({
|
|
|
5921
5870
|
}
|
|
5922
5871
|
|
|
5923
5872
|
// src/components/components/Separator/index.tsx
|
|
5924
|
-
import { jsx as
|
|
5873
|
+
import { jsx as jsx85 } from "react/jsx-runtime";
|
|
5925
5874
|
function Separator2({ orientation = "horizontal", className, style }) {
|
|
5926
|
-
return /* @__PURE__ */
|
|
5875
|
+
return /* @__PURE__ */ jsx85(
|
|
5927
5876
|
Separator,
|
|
5928
5877
|
{
|
|
5929
5878
|
orientation,
|
|
@@ -5937,7 +5886,7 @@ function Separator2({ orientation = "horizontal", className, style }) {
|
|
|
5937
5886
|
}
|
|
5938
5887
|
|
|
5939
5888
|
// src/components/components/Sheet/index.tsx
|
|
5940
|
-
import { jsx as
|
|
5889
|
+
import { jsx as jsx86, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
5941
5890
|
function Sheet2({
|
|
5942
5891
|
title,
|
|
5943
5892
|
open,
|
|
@@ -5947,7 +5896,7 @@ function Sheet2({
|
|
|
5947
5896
|
className,
|
|
5948
5897
|
style
|
|
5949
5898
|
}) {
|
|
5950
|
-
return /* @__PURE__ */
|
|
5899
|
+
return /* @__PURE__ */ jsx86(
|
|
5951
5900
|
Sheet,
|
|
5952
5901
|
{
|
|
5953
5902
|
open: open ?? false,
|
|
@@ -5956,9 +5905,9 @@ function Sheet2({
|
|
|
5956
5905
|
onClose?.();
|
|
5957
5906
|
}
|
|
5958
5907
|
},
|
|
5959
|
-
children: /* @__PURE__ */
|
|
5960
|
-
title ? /* @__PURE__ */
|
|
5961
|
-
/* @__PURE__ */
|
|
5908
|
+
children: /* @__PURE__ */ jsxs58(SheetContent, { side, className, style, children: [
|
|
5909
|
+
title ? /* @__PURE__ */ jsx86(SheetHeader, { children: /* @__PURE__ */ jsx86(SheetTitle, { children: title }) }) : null,
|
|
5910
|
+
/* @__PURE__ */ jsx86("div", { className: "flex-1 overflow-auto px-4", children })
|
|
5962
5911
|
] })
|
|
5963
5912
|
}
|
|
5964
5913
|
);
|
|
@@ -5966,7 +5915,7 @@ function Sheet2({
|
|
|
5966
5915
|
|
|
5967
5916
|
// src/components/components/Sider/index.tsx
|
|
5968
5917
|
import { ChevronLeft, ChevronRight as ChevronRight2 } from "lucide-react";
|
|
5969
|
-
import { jsx as
|
|
5918
|
+
import { jsx as jsx87, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
5970
5919
|
function Sider({
|
|
5971
5920
|
width = 200,
|
|
5972
5921
|
collapsible,
|
|
@@ -5978,7 +5927,7 @@ function Sider({
|
|
|
5978
5927
|
children
|
|
5979
5928
|
}) {
|
|
5980
5929
|
const current = collapsed ? collapsedWidth : width;
|
|
5981
|
-
return /* @__PURE__ */
|
|
5930
|
+
return /* @__PURE__ */ jsxs59(
|
|
5982
5931
|
"aside",
|
|
5983
5932
|
{
|
|
5984
5933
|
"data-slot": "layout-sider",
|
|
@@ -5989,15 +5938,15 @@ function Sider({
|
|
|
5989
5938
|
),
|
|
5990
5939
|
style: { width: current, ...style },
|
|
5991
5940
|
children: [
|
|
5992
|
-
/* @__PURE__ */
|
|
5993
|
-
collapsible ? /* @__PURE__ */
|
|
5941
|
+
/* @__PURE__ */ jsx87("div", { className: "min-h-0 flex-1 overflow-auto", children }),
|
|
5942
|
+
collapsible ? /* @__PURE__ */ jsx87(
|
|
5994
5943
|
"button",
|
|
5995
5944
|
{
|
|
5996
5945
|
type: "button",
|
|
5997
5946
|
"aria-label": collapsed ? "expand sider" : "collapse sider",
|
|
5998
5947
|
className: "flex h-10 shrink-0 items-center justify-center border-t text-muted-foreground hover:text-foreground",
|
|
5999
5948
|
onClick: () => onCollapse?.(!collapsed),
|
|
6000
|
-
children: collapsed ? /* @__PURE__ */
|
|
5949
|
+
children: collapsed ? /* @__PURE__ */ jsx87(ChevronRight2, { "aria-hidden": true, className: "size-4" }) : /* @__PURE__ */ jsx87(ChevronLeft, { "aria-hidden": true, className: "size-4" })
|
|
6001
5950
|
}
|
|
6002
5951
|
) : null
|
|
6003
5952
|
]
|
|
@@ -6006,7 +5955,7 @@ function Sider({
|
|
|
6006
5955
|
}
|
|
6007
5956
|
|
|
6008
5957
|
// src/components/components/Skeleton/index.tsx
|
|
6009
|
-
import { jsx as
|
|
5958
|
+
import { jsx as jsx88 } from "react/jsx-runtime";
|
|
6010
5959
|
var shapeDefaults = {
|
|
6011
5960
|
line: { className: "h-4 w-full", style: {} },
|
|
6012
5961
|
circle: { className: "rounded-full", style: { width: 40, height: 40 } },
|
|
@@ -6017,7 +5966,7 @@ function toSize(value) {
|
|
|
6017
5966
|
}
|
|
6018
5967
|
function Skeleton2({ shape = "line", width, height, className, style }) {
|
|
6019
5968
|
const defaults = shapeDefaults[shape];
|
|
6020
|
-
return /* @__PURE__ */
|
|
5969
|
+
return /* @__PURE__ */ jsx88(
|
|
6021
5970
|
Skeleton,
|
|
6022
5971
|
{
|
|
6023
5972
|
className: cn(defaults.className, className),
|
|
@@ -6033,7 +5982,7 @@ function Skeleton2({ shape = "line", width, height, className, style }) {
|
|
|
6033
5982
|
|
|
6034
5983
|
// src/components/components/Slider/index.tsx
|
|
6035
5984
|
import { useEffect as useEffect24 } from "react";
|
|
6036
|
-
import { jsx as
|
|
5985
|
+
import { jsx as jsx89, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
6037
5986
|
function Slider2({
|
|
6038
5987
|
name,
|
|
6039
5988
|
label,
|
|
@@ -6064,7 +6013,7 @@ function Slider2({
|
|
|
6064
6013
|
}
|
|
6065
6014
|
onChange?.(next);
|
|
6066
6015
|
};
|
|
6067
|
-
const slider = /* @__PURE__ */
|
|
6016
|
+
const slider = /* @__PURE__ */ jsx89(
|
|
6068
6017
|
Slider,
|
|
6069
6018
|
{
|
|
6070
6019
|
value: numberValue,
|
|
@@ -6076,18 +6025,19 @@ function Slider2({
|
|
|
6076
6025
|
onValueChange: handleChange,
|
|
6077
6026
|
className: inForm ? void 0 : className,
|
|
6078
6027
|
style: inForm ? void 0 : style,
|
|
6079
|
-
children: /* @__PURE__ */
|
|
6080
|
-
/* @__PURE__ */
|
|
6081
|
-
/* @__PURE__ */
|
|
6028
|
+
children: /* @__PURE__ */ jsxs60(SliderControl, { children: [
|
|
6029
|
+
/* @__PURE__ */ jsx89(SliderTrack, { children: /* @__PURE__ */ jsx89(SliderIndicator, {}) }),
|
|
6030
|
+
/* @__PURE__ */ jsx89(SliderThumb, {})
|
|
6082
6031
|
] })
|
|
6083
6032
|
}
|
|
6084
6033
|
);
|
|
6085
6034
|
if (inForm && form && name) {
|
|
6086
|
-
return /* @__PURE__ */
|
|
6035
|
+
return /* @__PURE__ */ jsx89(
|
|
6087
6036
|
FieldShell,
|
|
6088
6037
|
{
|
|
6089
6038
|
layout: form.layout,
|
|
6090
6039
|
label,
|
|
6040
|
+
rules,
|
|
6091
6041
|
error: form.errors[name],
|
|
6092
6042
|
className,
|
|
6093
6043
|
style,
|
|
@@ -6101,7 +6051,7 @@ function Slider2({
|
|
|
6101
6051
|
// src/components/components/Sonner/index.tsx
|
|
6102
6052
|
import { useRenderer as useRenderer17 } from "@pactor-app/runtime";
|
|
6103
6053
|
import { useEffect as useEffect25 } from "react";
|
|
6104
|
-
import { jsx as
|
|
6054
|
+
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
6105
6055
|
function Sonner({ className, style }) {
|
|
6106
6056
|
const { context } = useRenderer17();
|
|
6107
6057
|
useEffect25(() => {
|
|
@@ -6118,11 +6068,11 @@ function Sonner({ className, style }) {
|
|
|
6118
6068
|
return { ok: true };
|
|
6119
6069
|
});
|
|
6120
6070
|
}, [context]);
|
|
6121
|
-
return /* @__PURE__ */
|
|
6071
|
+
return /* @__PURE__ */ jsx90("div", { "data-slot": "sonner", className, style, children: /* @__PURE__ */ jsx90(Toaster, {}) });
|
|
6122
6072
|
}
|
|
6123
6073
|
|
|
6124
6074
|
// src/components/components/Space/index.tsx
|
|
6125
|
-
import { jsx as
|
|
6075
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
6126
6076
|
var sizeClass2 = {
|
|
6127
6077
|
small: "gap-2",
|
|
6128
6078
|
middle: "gap-4",
|
|
@@ -6143,7 +6093,7 @@ function Space({
|
|
|
6143
6093
|
style,
|
|
6144
6094
|
children
|
|
6145
6095
|
}) {
|
|
6146
|
-
return /* @__PURE__ */
|
|
6096
|
+
return /* @__PURE__ */ jsx91(
|
|
6147
6097
|
"div",
|
|
6148
6098
|
{
|
|
6149
6099
|
"data-slot": "space",
|
|
@@ -6162,31 +6112,31 @@ function Space({
|
|
|
6162
6112
|
}
|
|
6163
6113
|
|
|
6164
6114
|
// src/components/components/Spinner/index.tsx
|
|
6165
|
-
import { jsx as
|
|
6115
|
+
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
6166
6116
|
var sizeClass3 = {
|
|
6167
6117
|
sm: "size-3",
|
|
6168
6118
|
default: "size-4",
|
|
6169
6119
|
lg: "size-6"
|
|
6170
6120
|
};
|
|
6171
6121
|
function Spinner2({ size = "default", className, style }) {
|
|
6172
|
-
return /* @__PURE__ */
|
|
6122
|
+
return /* @__PURE__ */ jsx92(Spinner, { className: cn(sizeClass3[size], className), style });
|
|
6173
6123
|
}
|
|
6174
6124
|
|
|
6175
6125
|
// src/components/components/Statistic/index.tsx
|
|
6176
|
-
import { jsx as
|
|
6126
|
+
import { jsx as jsx93, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
6177
6127
|
function Statistic({ title, value, precision, suffix, className, style }) {
|
|
6178
6128
|
const display = typeof value === "number" && precision !== void 0 ? value.toFixed(precision) : value;
|
|
6179
|
-
return /* @__PURE__ */
|
|
6180
|
-
title ? /* @__PURE__ */
|
|
6181
|
-
/* @__PURE__ */
|
|
6129
|
+
return /* @__PURE__ */ jsxs61("div", { "data-slot": "statistic", className: cn(className), style, children: [
|
|
6130
|
+
title ? /* @__PURE__ */ jsx93("div", { "data-slot": "statistic-title", className: "text-sm text-muted-foreground", children: title }) : null,
|
|
6131
|
+
/* @__PURE__ */ jsxs61("div", { "data-slot": "statistic-value", className: "text-2xl font-bold tabular-nums", children: [
|
|
6182
6132
|
display,
|
|
6183
|
-
suffix ? /* @__PURE__ */
|
|
6133
|
+
suffix ? /* @__PURE__ */ jsx93("span", { className: "ml-1 text-sm font-normal text-muted-foreground", children: suffix }) : null
|
|
6184
6134
|
] })
|
|
6185
6135
|
] });
|
|
6186
6136
|
}
|
|
6187
6137
|
|
|
6188
6138
|
// src/components/components/Status/index.tsx
|
|
6189
|
-
import { jsx as
|
|
6139
|
+
import { jsx as jsx94, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
6190
6140
|
var dotClass = {
|
|
6191
6141
|
success: "bg-success",
|
|
6192
6142
|
processing: "bg-info",
|
|
@@ -6195,7 +6145,7 @@ var dotClass = {
|
|
|
6195
6145
|
default: "bg-muted-foreground"
|
|
6196
6146
|
};
|
|
6197
6147
|
function Status({ status = "default", text, className, style }) {
|
|
6198
|
-
return /* @__PURE__ */
|
|
6148
|
+
return /* @__PURE__ */ jsxs62(
|
|
6199
6149
|
"span",
|
|
6200
6150
|
{
|
|
6201
6151
|
"data-slot": "status",
|
|
@@ -6203,8 +6153,8 @@ function Status({ status = "default", text, className, style }) {
|
|
|
6203
6153
|
className: cn("inline-flex items-center gap-1.5 text-sm", className),
|
|
6204
6154
|
style,
|
|
6205
6155
|
children: [
|
|
6206
|
-
/* @__PURE__ */
|
|
6207
|
-
status === "processing" ? /* @__PURE__ */
|
|
6156
|
+
/* @__PURE__ */ jsxs62("span", { "data-slot": "status-dot", className: "relative flex size-2", children: [
|
|
6157
|
+
status === "processing" ? /* @__PURE__ */ jsx94(
|
|
6208
6158
|
"span",
|
|
6209
6159
|
{
|
|
6210
6160
|
"aria-hidden": "true",
|
|
@@ -6214,9 +6164,9 @@ function Status({ status = "default", text, className, style }) {
|
|
|
6214
6164
|
)
|
|
6215
6165
|
}
|
|
6216
6166
|
) : null,
|
|
6217
|
-
/* @__PURE__ */
|
|
6167
|
+
/* @__PURE__ */ jsx94("span", { className: cn("relative inline-flex size-2 rounded-full", dotClass[status]) })
|
|
6218
6168
|
] }),
|
|
6219
|
-
text ? /* @__PURE__ */
|
|
6169
|
+
text ? /* @__PURE__ */ jsx94("span", { "data-slot": "status-text", children: text }) : null
|
|
6220
6170
|
]
|
|
6221
6171
|
}
|
|
6222
6172
|
);
|
|
@@ -6224,7 +6174,7 @@ function Status({ status = "default", text, className, style }) {
|
|
|
6224
6174
|
|
|
6225
6175
|
// src/components/components/Steps/index.tsx
|
|
6226
6176
|
import { Fragment as Fragment10 } from "react";
|
|
6227
|
-
import { jsx as
|
|
6177
|
+
import { jsx as jsx95, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
6228
6178
|
var iconBoxClass = {
|
|
6229
6179
|
finish: "border-primary text-primary",
|
|
6230
6180
|
process: "border-primary bg-primary text-primary-foreground",
|
|
@@ -6244,7 +6194,7 @@ function statusIcon2(status) {
|
|
|
6244
6194
|
}
|
|
6245
6195
|
function Steps({ items = [], current = 0, direction = "horizontal", className, style }) {
|
|
6246
6196
|
const vertical = direction === "vertical";
|
|
6247
|
-
return /* @__PURE__ */
|
|
6197
|
+
return /* @__PURE__ */ jsx95(
|
|
6248
6198
|
"ol",
|
|
6249
6199
|
{
|
|
6250
6200
|
"data-slot": "steps",
|
|
@@ -6254,15 +6204,15 @@ function Steps({ items = [], current = 0, direction = "horizontal", className, s
|
|
|
6254
6204
|
const status = item.status ?? (index < current ? "finish" : index === current ? "process" : "wait");
|
|
6255
6205
|
const stateIcon = statusIcon2(status);
|
|
6256
6206
|
const last = index === items.length - 1;
|
|
6257
|
-
return /* @__PURE__ */
|
|
6258
|
-
/* @__PURE__ */
|
|
6207
|
+
return /* @__PURE__ */ jsxs63(Fragment10, { children: [
|
|
6208
|
+
/* @__PURE__ */ jsxs63(
|
|
6259
6209
|
"li",
|
|
6260
6210
|
{
|
|
6261
6211
|
"data-slot": "steps-item",
|
|
6262
6212
|
"data-status": status,
|
|
6263
6213
|
className: cn("flex gap-2", vertical ? "items-start" : "shrink-0 items-start"),
|
|
6264
6214
|
children: [
|
|
6265
|
-
/* @__PURE__ */
|
|
6215
|
+
/* @__PURE__ */ jsx95(
|
|
6266
6216
|
"span",
|
|
6267
6217
|
{
|
|
6268
6218
|
"data-slot": "steps-icon",
|
|
@@ -6270,17 +6220,17 @@ function Steps({ items = [], current = 0, direction = "horizontal", className, s
|
|
|
6270
6220
|
"flex size-7 shrink-0 items-center justify-center rounded-full border text-sm",
|
|
6271
6221
|
iconBoxClass[status]
|
|
6272
6222
|
),
|
|
6273
|
-
children: item.icon ? /* @__PURE__ */
|
|
6223
|
+
children: item.icon ? /* @__PURE__ */ jsx95(Icon, { name: item.icon, size: "sm" }) : stateIcon ? /* @__PURE__ */ jsx95(Icon, { name: stateIcon, size: "sm" }) : index + 1
|
|
6274
6224
|
}
|
|
6275
6225
|
),
|
|
6276
|
-
/* @__PURE__ */
|
|
6277
|
-
/* @__PURE__ */
|
|
6278
|
-
item.description ? /* @__PURE__ */
|
|
6226
|
+
/* @__PURE__ */ jsxs63("div", { className: cn("min-w-0", !vertical && "pt-0.5"), children: [
|
|
6227
|
+
/* @__PURE__ */ jsx95("div", { "data-slot": "steps-title", className: cn("text-sm", titleClass[status]), children: item.title }),
|
|
6228
|
+
item.description ? /* @__PURE__ */ jsx95("div", { "data-slot": "steps-description", className: "mt-0.5 text-xs text-muted-foreground", children: item.description }) : null
|
|
6279
6229
|
] })
|
|
6280
6230
|
]
|
|
6281
6231
|
}
|
|
6282
6232
|
),
|
|
6283
|
-
!last ? /* @__PURE__ */
|
|
6233
|
+
!last ? /* @__PURE__ */ jsx95(
|
|
6284
6234
|
"li",
|
|
6285
6235
|
{
|
|
6286
6236
|
"aria-hidden": "true",
|
|
@@ -6299,7 +6249,7 @@ function Steps({ items = [], current = 0, direction = "horizontal", className, s
|
|
|
6299
6249
|
|
|
6300
6250
|
// src/components/components/Switch/index.tsx
|
|
6301
6251
|
import { useEffect as useEffect26, useId as useId11 } from "react";
|
|
6302
|
-
import { jsx as
|
|
6252
|
+
import { jsx as jsx96, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
6303
6253
|
function Switch2({
|
|
6304
6254
|
name,
|
|
6305
6255
|
label,
|
|
@@ -6328,13 +6278,13 @@ function Switch2({
|
|
|
6328
6278
|
}
|
|
6329
6279
|
onChange?.(next);
|
|
6330
6280
|
};
|
|
6331
|
-
const control = /* @__PURE__ */
|
|
6281
|
+
const control = /* @__PURE__ */ jsxs64(
|
|
6332
6282
|
"span",
|
|
6333
6283
|
{
|
|
6334
6284
|
className: cn("inline-flex items-center gap-2", !inForm && className),
|
|
6335
6285
|
style: inForm ? void 0 : style,
|
|
6336
6286
|
children: [
|
|
6337
|
-
/* @__PURE__ */
|
|
6287
|
+
/* @__PURE__ */ jsx96(
|
|
6338
6288
|
Switch,
|
|
6339
6289
|
{
|
|
6340
6290
|
id: controlId,
|
|
@@ -6344,12 +6294,12 @@ function Switch2({
|
|
|
6344
6294
|
onCheckedChange: handleChange
|
|
6345
6295
|
}
|
|
6346
6296
|
),
|
|
6347
|
-
label ? /* @__PURE__ */
|
|
6297
|
+
label ? /* @__PURE__ */ jsx96("label", { htmlFor: controlId, className: "text-sm leading-none font-medium", children: label }) : null
|
|
6348
6298
|
]
|
|
6349
6299
|
}
|
|
6350
6300
|
);
|
|
6351
6301
|
if (inForm && form && name) {
|
|
6352
|
-
return /* @__PURE__ */
|
|
6302
|
+
return /* @__PURE__ */ jsxs64(
|
|
6353
6303
|
"div",
|
|
6354
6304
|
{
|
|
6355
6305
|
"data-slot": "form-item",
|
|
@@ -6357,7 +6307,7 @@ function Switch2({
|
|
|
6357
6307
|
style,
|
|
6358
6308
|
children: [
|
|
6359
6309
|
control,
|
|
6360
|
-
form.errors[name] ? /* @__PURE__ */
|
|
6310
|
+
form.errors[name] ? /* @__PURE__ */ jsx96("div", { "data-slot": "form-error", className: "mt-1.5 text-sm text-destructive", children: form.errors[name] }) : null
|
|
6361
6311
|
]
|
|
6362
6312
|
}
|
|
6363
6313
|
);
|
|
@@ -6498,7 +6448,7 @@ function moveRow(rows, dragKey, dropKey, position, options) {
|
|
|
6498
6448
|
}
|
|
6499
6449
|
|
|
6500
6450
|
// src/components/components/Table/index.tsx
|
|
6501
|
-
import { jsx as
|
|
6451
|
+
import { jsx as jsx97, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
6502
6452
|
function renderCellValue2(value) {
|
|
6503
6453
|
if (value === void 0 || value === null) {
|
|
6504
6454
|
return "";
|
|
@@ -6745,7 +6695,7 @@ function Table2({
|
|
|
6745
6695
|
1,
|
|
6746
6696
|
columns.length + (rowSelection ? 1 : 0) + (rowDraggable ? 1 : 0)
|
|
6747
6697
|
);
|
|
6748
|
-
return /* @__PURE__ */
|
|
6698
|
+
return /* @__PURE__ */ jsxs65(
|
|
6749
6699
|
"div",
|
|
6750
6700
|
{
|
|
6751
6701
|
ref: rootRef,
|
|
@@ -6753,22 +6703,22 @@ function Table2({
|
|
|
6753
6703
|
className: cn("relative", className),
|
|
6754
6704
|
style,
|
|
6755
6705
|
children: [
|
|
6756
|
-
loading ? /* @__PURE__ */
|
|
6706
|
+
loading ? /* @__PURE__ */ jsx97(
|
|
6757
6707
|
"div",
|
|
6758
6708
|
{
|
|
6759
6709
|
"data-slot": "table-loading",
|
|
6760
6710
|
className: "absolute inset-0 z-40 flex items-center justify-center bg-card/60",
|
|
6761
|
-
children: /* @__PURE__ */
|
|
6711
|
+
children: /* @__PURE__ */ jsx97(Spinner, { className: "size-6 text-muted-foreground" })
|
|
6762
6712
|
}
|
|
6763
6713
|
) : null,
|
|
6764
|
-
/* @__PURE__ */
|
|
6714
|
+
/* @__PURE__ */ jsxs65(
|
|
6765
6715
|
Table,
|
|
6766
6716
|
{
|
|
6767
6717
|
containerClassName: stickyHeader ? "overflow-y-auto" : void 0,
|
|
6768
6718
|
containerStyle: stickyHeader ? { maxHeight: scrollY } : void 0,
|
|
6769
6719
|
children: [
|
|
6770
|
-
/* @__PURE__ */
|
|
6771
|
-
rowDraggable ? /* @__PURE__ */
|
|
6720
|
+
/* @__PURE__ */ jsx97(TableHeader, { children: /* @__PURE__ */ jsxs65(TableRow, { className: "hover:bg-transparent", children: [
|
|
6721
|
+
rowDraggable ? /* @__PURE__ */ jsx97(
|
|
6772
6722
|
TableHead,
|
|
6773
6723
|
{
|
|
6774
6724
|
"data-slot": "table-drag-head",
|
|
@@ -6776,13 +6726,13 @@ function Table2({
|
|
|
6776
6726
|
style: { width: 36, minWidth: 36 }
|
|
6777
6727
|
}
|
|
6778
6728
|
) : null,
|
|
6779
|
-
rowSelection ? /* @__PURE__ */
|
|
6729
|
+
rowSelection ? /* @__PURE__ */ jsx97(
|
|
6780
6730
|
TableHead,
|
|
6781
6731
|
{
|
|
6782
6732
|
"data-slot": "table-selection-head",
|
|
6783
6733
|
className: stickyHeadClass(null, false),
|
|
6784
6734
|
style: { width: 36, minWidth: 36 },
|
|
6785
|
-
children: /* @__PURE__ */
|
|
6735
|
+
children: /* @__PURE__ */ jsx97(
|
|
6786
6736
|
Checkbox,
|
|
6787
6737
|
{
|
|
6788
6738
|
"aria-label": t("pactor.table.selectAll"),
|
|
@@ -6798,7 +6748,7 @@ function Table2({
|
|
|
6798
6748
|
const sortable = column.sorter === true && column.dataIndex !== void 0;
|
|
6799
6749
|
const isSortedColumn = sort !== null && column.dataIndex !== void 0 && sort.dataIndex === column.dataIndex;
|
|
6800
6750
|
const activeOrder = sortable && isSortedColumn ? sort.order : null;
|
|
6801
|
-
return /* @__PURE__ */
|
|
6751
|
+
return /* @__PURE__ */ jsx97(
|
|
6802
6752
|
TableHead,
|
|
6803
6753
|
{
|
|
6804
6754
|
className: cn(
|
|
@@ -6807,7 +6757,7 @@ function Table2({
|
|
|
6807
6757
|
),
|
|
6808
6758
|
style: columnWidthStyle(column),
|
|
6809
6759
|
"aria-sort": activeOrder === "ascend" ? "ascending" : activeOrder === "descend" ? "descending" : void 0,
|
|
6810
|
-
children: sortable ? /* @__PURE__ */
|
|
6760
|
+
children: sortable ? /* @__PURE__ */ jsxs65(
|
|
6811
6761
|
"button",
|
|
6812
6762
|
{
|
|
6813
6763
|
type: "button",
|
|
@@ -6816,7 +6766,7 @@ function Table2({
|
|
|
6816
6766
|
className: "inline-flex cursor-pointer items-center gap-1 font-medium",
|
|
6817
6767
|
children: [
|
|
6818
6768
|
column.title,
|
|
6819
|
-
/* @__PURE__ */
|
|
6769
|
+
/* @__PURE__ */ jsx97(
|
|
6820
6770
|
Icon,
|
|
6821
6771
|
{
|
|
6822
6772
|
name: activeOrder === "ascend" ? "arrow-up" : activeOrder === "descend" ? "arrow-down" : "chevrons-up-down",
|
|
@@ -6832,29 +6782,29 @@ function Table2({
|
|
|
6832
6782
|
);
|
|
6833
6783
|
})
|
|
6834
6784
|
] }) }),
|
|
6835
|
-
/* @__PURE__ */
|
|
6785
|
+
/* @__PURE__ */ jsx97(TableBody, { children: flatRows.length === 0 ? /* @__PURE__ */ jsx97(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsx97(TableCell, { colSpan, children: /* @__PURE__ */ jsxs65(
|
|
6836
6786
|
"div",
|
|
6837
6787
|
{
|
|
6838
6788
|
"data-slot": "table-empty",
|
|
6839
6789
|
className: "flex flex-col items-center gap-2 py-8 text-muted-foreground",
|
|
6840
6790
|
children: [
|
|
6841
|
-
/* @__PURE__ */
|
|
6842
|
-
/* @__PURE__ */
|
|
6791
|
+
/* @__PURE__ */ jsx97(Icon, { name: "inbox", size: "lg" }),
|
|
6792
|
+
/* @__PURE__ */ jsx97("div", { className: "text-sm", children: emptyText ?? t("pactor.table.empty") })
|
|
6843
6793
|
]
|
|
6844
6794
|
}
|
|
6845
|
-
) }) }) : flatRows.map((flat, rowIndex) => /* @__PURE__ */
|
|
6795
|
+
) }) }) : flatRows.map((flat, rowIndex) => /* @__PURE__ */ jsxs65(
|
|
6846
6796
|
TableRow,
|
|
6847
6797
|
{
|
|
6848
6798
|
className: cn(dragKey === flat.key ? "opacity-50" : void 0),
|
|
6849
6799
|
onDragOver: rowDraggable ? (event) => handleRowDragOver(flat, event) : void 0,
|
|
6850
6800
|
onDrop: rowDraggable ? (event) => handleRowDrop(flat, event) : void 0,
|
|
6851
6801
|
children: [
|
|
6852
|
-
rowDraggable ? /* @__PURE__ */
|
|
6802
|
+
rowDraggable ? /* @__PURE__ */ jsx97(
|
|
6853
6803
|
TableCell,
|
|
6854
6804
|
{
|
|
6855
6805
|
"data-slot": "table-drag-cell",
|
|
6856
6806
|
className: dropIndicatorClass(flat.key),
|
|
6857
|
-
children: /* @__PURE__ */
|
|
6807
|
+
children: /* @__PURE__ */ jsx97(
|
|
6858
6808
|
"button",
|
|
6859
6809
|
{
|
|
6860
6810
|
type: "button",
|
|
@@ -6864,17 +6814,17 @@ function Table2({
|
|
|
6864
6814
|
onDragStart: (event) => handleDragStart(flat, event),
|
|
6865
6815
|
onDragEnd: resetDrag,
|
|
6866
6816
|
className: "inline-flex size-4 cursor-move items-center justify-center text-muted-foreground hover:text-foreground",
|
|
6867
|
-
children: /* @__PURE__ */
|
|
6817
|
+
children: /* @__PURE__ */ jsx97(Icon, { name: "grip-vertical", size: "sm" })
|
|
6868
6818
|
}
|
|
6869
6819
|
)
|
|
6870
6820
|
}
|
|
6871
6821
|
) : null,
|
|
6872
|
-
rowSelection ? /* @__PURE__ */
|
|
6822
|
+
rowSelection ? /* @__PURE__ */ jsx97(
|
|
6873
6823
|
TableCell,
|
|
6874
6824
|
{
|
|
6875
6825
|
"data-slot": "table-selection-cell",
|
|
6876
6826
|
className: dropIndicatorClass(flat.key),
|
|
6877
|
-
children: /* @__PURE__ */
|
|
6827
|
+
children: /* @__PURE__ */ jsx97(
|
|
6878
6828
|
Checkbox,
|
|
6879
6829
|
{
|
|
6880
6830
|
"aria-label": t("pactor.table.selectRow"),
|
|
@@ -6891,7 +6841,7 @@ function Table2({
|
|
|
6891
6841
|
column.dataIndex === void 0 ? void 0 : flat.row[column.dataIndex]
|
|
6892
6842
|
);
|
|
6893
6843
|
const withTree = hasTreeData && columnIndex === 0;
|
|
6894
|
-
return /* @__PURE__ */
|
|
6844
|
+
return /* @__PURE__ */ jsx97(
|
|
6895
6845
|
TableCell,
|
|
6896
6846
|
{
|
|
6897
6847
|
className: cn(
|
|
@@ -6903,13 +6853,13 @@ function Table2({
|
|
|
6903
6853
|
dropIndicatorClass(flat.key)
|
|
6904
6854
|
),
|
|
6905
6855
|
style: columnWidthStyle(column),
|
|
6906
|
-
children: withTree ? /* @__PURE__ */
|
|
6856
|
+
children: withTree ? /* @__PURE__ */ jsxs65(
|
|
6907
6857
|
"div",
|
|
6908
6858
|
{
|
|
6909
6859
|
className: "flex items-center gap-1",
|
|
6910
6860
|
style: { paddingLeft: flat.level * indentSize },
|
|
6911
6861
|
children: [
|
|
6912
|
-
flat.hasChildren ? /* @__PURE__ */
|
|
6862
|
+
flat.hasChildren ? /* @__PURE__ */ jsx97(
|
|
6913
6863
|
"button",
|
|
6914
6864
|
{
|
|
6915
6865
|
type: "button",
|
|
@@ -6918,7 +6868,7 @@ function Table2({
|
|
|
6918
6868
|
"aria-expanded": expandedKeys.has(flat.key),
|
|
6919
6869
|
onClick: () => toggleExpand(flat.key),
|
|
6920
6870
|
className: "inline-flex size-4 shrink-0 cursor-pointer items-center justify-center text-muted-foreground hover:text-foreground",
|
|
6921
|
-
children: /* @__PURE__ */
|
|
6871
|
+
children: /* @__PURE__ */ jsx97(
|
|
6922
6872
|
Icon,
|
|
6923
6873
|
{
|
|
6924
6874
|
name: "chevron-right",
|
|
@@ -6930,8 +6880,8 @@ function Table2({
|
|
|
6930
6880
|
}
|
|
6931
6881
|
)
|
|
6932
6882
|
}
|
|
6933
|
-
) : /* @__PURE__ */
|
|
6934
|
-
/* @__PURE__ */
|
|
6883
|
+
) : /* @__PURE__ */ jsx97("span", { className: "inline-block size-4 shrink-0" }),
|
|
6884
|
+
/* @__PURE__ */ jsx97("div", { className: "min-w-0", children: cellContent })
|
|
6935
6885
|
]
|
|
6936
6886
|
}
|
|
6937
6887
|
) : cellContent
|
|
@@ -6946,8 +6896,8 @@ function Table2({
|
|
|
6946
6896
|
]
|
|
6947
6897
|
}
|
|
6948
6898
|
),
|
|
6949
|
-
pageSize !== void 0 && pageSize > 0 ? /* @__PURE__ */
|
|
6950
|
-
(page) => /* @__PURE__ */
|
|
6899
|
+
pageSize !== void 0 && pageSize > 0 ? /* @__PURE__ */ jsx97("div", { "data-slot": "table-pagination", className: "mt-3 flex justify-end gap-1", children: Array.from({ length: pageCount }, (_, index) => index + 1).map(
|
|
6900
|
+
(page) => /* @__PURE__ */ jsx97(
|
|
6951
6901
|
Button,
|
|
6952
6902
|
{
|
|
6953
6903
|
type: "button",
|
|
@@ -6967,7 +6917,7 @@ function Table2({
|
|
|
6967
6917
|
|
|
6968
6918
|
// src/components/components/Tabs/index.tsx
|
|
6969
6919
|
import { useRenderer as useRenderer19 } from "@pactor-app/runtime";
|
|
6970
|
-
import { jsx as
|
|
6920
|
+
import { jsx as jsx98, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
6971
6921
|
function Tabs2({
|
|
6972
6922
|
items = [],
|
|
6973
6923
|
activeKey,
|
|
@@ -6981,7 +6931,7 @@ function Tabs2({
|
|
|
6981
6931
|
}) {
|
|
6982
6932
|
const { renderChildren } = useRenderer19();
|
|
6983
6933
|
const vertical = tabPosition === "left";
|
|
6984
|
-
return /* @__PURE__ */
|
|
6934
|
+
return /* @__PURE__ */ jsxs66(
|
|
6985
6935
|
Tabs,
|
|
6986
6936
|
{
|
|
6987
6937
|
value: activeKey,
|
|
@@ -6991,7 +6941,7 @@ function Tabs2({
|
|
|
6991
6941
|
className: cn(vertical && "flex-row items-start gap-4", className),
|
|
6992
6942
|
style,
|
|
6993
6943
|
children: [
|
|
6994
|
-
/* @__PURE__ */
|
|
6944
|
+
/* @__PURE__ */ jsx98(
|
|
6995
6945
|
TabsList,
|
|
6996
6946
|
{
|
|
6997
6947
|
variant,
|
|
@@ -6999,10 +6949,10 @@ function Tabs2({
|
|
|
6999
6949
|
"h-auto w-auto shrink-0 flex-col items-stretch justify-start",
|
|
7000
6950
|
variant === "line" && "gap-0 border-b-0 border-r pr-2"
|
|
7001
6951
|
) : void 0,
|
|
7002
|
-
children: items.map((item) => /* @__PURE__ */
|
|
6952
|
+
children: items.map((item) => /* @__PURE__ */ jsx98(TabsTrigger, { value: item.key, children: item.label }, item.key))
|
|
7003
6953
|
}
|
|
7004
6954
|
),
|
|
7005
|
-
items.map((item) => /* @__PURE__ */
|
|
6955
|
+
items.map((item) => /* @__PURE__ */ jsx98(
|
|
7006
6956
|
TabsContent,
|
|
7007
6957
|
{
|
|
7008
6958
|
value: item.key,
|
|
@@ -7021,7 +6971,7 @@ function Tabs2({
|
|
|
7021
6971
|
import { X as X2 } from "lucide-react";
|
|
7022
6972
|
import { useI18n as useI18n26 } from "@pactor-app/runtime";
|
|
7023
6973
|
import { useState as useState32 } from "react";
|
|
7024
|
-
import { jsx as
|
|
6974
|
+
import { jsx as jsx99, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
7025
6975
|
var colorClass = {
|
|
7026
6976
|
default: "border-border bg-muted text-foreground",
|
|
7027
6977
|
success: "border-success/50 bg-success/10 text-success",
|
|
@@ -7042,7 +6992,7 @@ function Tag({
|
|
|
7042
6992
|
const [hidden, setHidden] = useState32(false);
|
|
7043
6993
|
const { t } = useI18n26();
|
|
7044
6994
|
if (hidden) return null;
|
|
7045
|
-
return /* @__PURE__ */
|
|
6995
|
+
return /* @__PURE__ */ jsxs67(
|
|
7046
6996
|
"span",
|
|
7047
6997
|
{
|
|
7048
6998
|
"data-slot": "tag",
|
|
@@ -7055,9 +7005,9 @@ function Tag({
|
|
|
7055
7005
|
),
|
|
7056
7006
|
style,
|
|
7057
7007
|
children: [
|
|
7058
|
-
icon ? /* @__PURE__ */
|
|
7008
|
+
icon ? /* @__PURE__ */ jsx99(Icon, { name: icon, size: "sm" }) : null,
|
|
7059
7009
|
text,
|
|
7060
|
-
closable ? /* @__PURE__ */
|
|
7010
|
+
closable ? /* @__PURE__ */ jsx99(
|
|
7061
7011
|
"button",
|
|
7062
7012
|
{
|
|
7063
7013
|
type: "button",
|
|
@@ -7068,7 +7018,7 @@ function Tag({
|
|
|
7068
7018
|
onClose?.();
|
|
7069
7019
|
setHidden(true);
|
|
7070
7020
|
},
|
|
7071
|
-
children: /* @__PURE__ */
|
|
7021
|
+
children: /* @__PURE__ */ jsx99(X2, { className: "size-3" })
|
|
7072
7022
|
}
|
|
7073
7023
|
) : null
|
|
7074
7024
|
]
|
|
@@ -7077,7 +7027,7 @@ function Tag({
|
|
|
7077
7027
|
}
|
|
7078
7028
|
|
|
7079
7029
|
// src/components/components/Text/index.tsx
|
|
7080
|
-
import { jsx as
|
|
7030
|
+
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
7081
7031
|
var typeClassMap = {
|
|
7082
7032
|
default: "",
|
|
7083
7033
|
secondary: "text-muted-foreground",
|
|
@@ -7102,7 +7052,7 @@ function Text({
|
|
|
7102
7052
|
style,
|
|
7103
7053
|
children
|
|
7104
7054
|
}) {
|
|
7105
|
-
return /* @__PURE__ */
|
|
7055
|
+
return /* @__PURE__ */ jsx100(
|
|
7106
7056
|
"span",
|
|
7107
7057
|
{
|
|
7108
7058
|
"data-slot": "text",
|
|
@@ -7124,7 +7074,7 @@ function Text({
|
|
|
7124
7074
|
|
|
7125
7075
|
// src/components/components/Textarea/index.tsx
|
|
7126
7076
|
import { useEffect as useEffect28, useId as useId12 } from "react";
|
|
7127
|
-
import { jsx as
|
|
7077
|
+
import { jsx as jsx101 } from "react/jsx-runtime";
|
|
7128
7078
|
function Textarea2({
|
|
7129
7079
|
name,
|
|
7130
7080
|
label,
|
|
@@ -7150,16 +7100,17 @@ function Textarea2({
|
|
|
7150
7100
|
});
|
|
7151
7101
|
if (inForm && form && name) {
|
|
7152
7102
|
const fieldValue = form.values[name];
|
|
7153
|
-
return /* @__PURE__ */
|
|
7103
|
+
return /* @__PURE__ */ jsx101(
|
|
7154
7104
|
FieldShell,
|
|
7155
7105
|
{
|
|
7156
7106
|
layout: form.layout,
|
|
7157
7107
|
label,
|
|
7108
|
+
rules,
|
|
7158
7109
|
htmlFor: controlId,
|
|
7159
7110
|
error: form.errors[name],
|
|
7160
7111
|
className,
|
|
7161
7112
|
style,
|
|
7162
|
-
children: /* @__PURE__ */
|
|
7113
|
+
children: /* @__PURE__ */ jsx101(
|
|
7163
7114
|
Textarea,
|
|
7164
7115
|
{
|
|
7165
7116
|
id: controlId,
|
|
@@ -7177,7 +7128,7 @@ function Textarea2({
|
|
|
7177
7128
|
}
|
|
7178
7129
|
);
|
|
7179
7130
|
}
|
|
7180
|
-
return /* @__PURE__ */
|
|
7131
|
+
return /* @__PURE__ */ jsx101(
|
|
7181
7132
|
Textarea,
|
|
7182
7133
|
{
|
|
7183
7134
|
value: value ?? "",
|
|
@@ -7195,7 +7146,7 @@ function Textarea2({
|
|
|
7195
7146
|
import { useI18n as useI18n27 } from "@pactor-app/runtime";
|
|
7196
7147
|
import { Clock } from "lucide-react";
|
|
7197
7148
|
import { useEffect as useEffect29, useId as useId13, useState as useState33 } from "react";
|
|
7198
|
-
import { jsx as
|
|
7149
|
+
import { jsx as jsx102, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
7199
7150
|
function pad(n) {
|
|
7200
7151
|
return String(n).padStart(2, "0");
|
|
7201
7152
|
}
|
|
@@ -7271,12 +7222,12 @@ function TimePicker({
|
|
|
7271
7222
|
}
|
|
7272
7223
|
onChange?.(next);
|
|
7273
7224
|
};
|
|
7274
|
-
const renderColumn = (slot, max, active, onPick) => /* @__PURE__ */
|
|
7225
|
+
const renderColumn = (slot, max, active, onPick) => /* @__PURE__ */ jsx102(
|
|
7275
7226
|
"div",
|
|
7276
7227
|
{
|
|
7277
7228
|
"data-slot": slot,
|
|
7278
7229
|
className: "max-h-40 w-14 overflow-y-auto rounded-md border border-border",
|
|
7279
|
-
children: Array.from({ length: max + 1 }, (_, n) => /* @__PURE__ */
|
|
7230
|
+
children: Array.from({ length: max + 1 }, (_, n) => /* @__PURE__ */ jsx102(
|
|
7280
7231
|
"button",
|
|
7281
7232
|
{
|
|
7282
7233
|
type: "button",
|
|
@@ -7291,8 +7242,8 @@ function TimePicker({
|
|
|
7291
7242
|
))
|
|
7292
7243
|
}
|
|
7293
7244
|
);
|
|
7294
|
-
const control = /* @__PURE__ */
|
|
7295
|
-
/* @__PURE__ */
|
|
7245
|
+
const control = /* @__PURE__ */ jsxs68(Popover, { open, onOpenChange: openPanel, children: [
|
|
7246
|
+
/* @__PURE__ */ jsxs68(
|
|
7296
7247
|
PopoverTrigger,
|
|
7297
7248
|
{
|
|
7298
7249
|
id: controlId,
|
|
@@ -7308,9 +7259,9 @@ function TimePicker({
|
|
|
7308
7259
|
),
|
|
7309
7260
|
style: inForm ? void 0 : style,
|
|
7310
7261
|
children: [
|
|
7311
|
-
/* @__PURE__ */
|
|
7312
|
-
showClear ? /* @__PURE__ */
|
|
7313
|
-
/* @__PURE__ */
|
|
7262
|
+
/* @__PURE__ */ jsx102("span", { className: "min-w-0 flex-1 truncate text-left", children: displayText === "" ? placeholder ?? t("pactor.timePicker.placeholder") : displayText }),
|
|
7263
|
+
showClear ? /* @__PURE__ */ jsx102(ClearHoverButton, { label: t("pactor.control.clear"), onClear: handleClear }) : null,
|
|
7264
|
+
/* @__PURE__ */ jsx102(
|
|
7314
7265
|
Clock,
|
|
7315
7266
|
{
|
|
7316
7267
|
className: cn("size-4 shrink-0 opacity-50", showClear && CLEARABLE_ICON_HIDE)
|
|
@@ -7319,8 +7270,8 @@ function TimePicker({
|
|
|
7319
7270
|
]
|
|
7320
7271
|
}
|
|
7321
7272
|
),
|
|
7322
|
-
/* @__PURE__ */
|
|
7323
|
-
/* @__PURE__ */
|
|
7273
|
+
/* @__PURE__ */ jsx102(PopoverContent, { className: "w-auto p-3", children: /* @__PURE__ */ jsxs68("div", { "data-slot": "timepicker-panel", className: "flex flex-col gap-2", children: [
|
|
7274
|
+
/* @__PURE__ */ jsxs68("div", { className: "flex items-start gap-2", children: [
|
|
7324
7275
|
renderColumn(
|
|
7325
7276
|
"timepicker-hour-column",
|
|
7326
7277
|
23,
|
|
@@ -7340,8 +7291,8 @@ function TimePicker({
|
|
|
7340
7291
|
(n) => setPending((prev) => ({ ...prev, second: n }))
|
|
7341
7292
|
) : null
|
|
7342
7293
|
] }),
|
|
7343
|
-
/* @__PURE__ */
|
|
7344
|
-
/* @__PURE__ */
|
|
7294
|
+
/* @__PURE__ */ jsxs68("div", { className: "flex items-center justify-between gap-2 border-t border-border pt-2", children: [
|
|
7295
|
+
/* @__PURE__ */ jsx102(
|
|
7345
7296
|
"button",
|
|
7346
7297
|
{
|
|
7347
7298
|
type: "button",
|
|
@@ -7350,7 +7301,7 @@ function TimePicker({
|
|
|
7350
7301
|
children: t("pactor.timePicker.now")
|
|
7351
7302
|
}
|
|
7352
7303
|
),
|
|
7353
|
-
/* @__PURE__ */
|
|
7304
|
+
/* @__PURE__ */ jsx102(
|
|
7354
7305
|
"button",
|
|
7355
7306
|
{
|
|
7356
7307
|
type: "button",
|
|
@@ -7366,11 +7317,12 @@ function TimePicker({
|
|
|
7366
7317
|
] }) })
|
|
7367
7318
|
] });
|
|
7368
7319
|
if (inForm && form && name) {
|
|
7369
|
-
return /* @__PURE__ */
|
|
7320
|
+
return /* @__PURE__ */ jsx102(
|
|
7370
7321
|
FieldShell,
|
|
7371
7322
|
{
|
|
7372
7323
|
layout: form.layout,
|
|
7373
7324
|
label,
|
|
7325
|
+
rules,
|
|
7374
7326
|
htmlFor: controlId,
|
|
7375
7327
|
error: form.errors[name],
|
|
7376
7328
|
className,
|
|
@@ -7384,27 +7336,27 @@ function TimePicker({
|
|
|
7384
7336
|
|
|
7385
7337
|
// src/components/components/Timeline/index.tsx
|
|
7386
7338
|
import { useI18n as useI18n28 } from "@pactor-app/runtime";
|
|
7387
|
-
import { jsx as
|
|
7339
|
+
import { jsx as jsx103, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
7388
7340
|
function Timeline({ items = [], pending, className, style }) {
|
|
7389
7341
|
const nodes = [...items];
|
|
7390
7342
|
const { t } = useI18n28();
|
|
7391
7343
|
if (pending) {
|
|
7392
7344
|
nodes.push({ content: typeof pending === "string" ? pending : t("pactor.timeline.inProgress") });
|
|
7393
7345
|
}
|
|
7394
|
-
return /* @__PURE__ */
|
|
7395
|
-
index < nodes.length - 1 ? /* @__PURE__ */
|
|
7346
|
+
return /* @__PURE__ */ jsx103("ul", { "data-slot": "timeline", className: cn("w-full", className), style, children: nodes.map((item, index) => /* @__PURE__ */ jsxs69("li", { "data-slot": "timeline-item", className: "relative flex gap-3 pb-6 last:pb-0", children: [
|
|
7347
|
+
index < nodes.length - 1 ? /* @__PURE__ */ jsx103(
|
|
7396
7348
|
"span",
|
|
7397
7349
|
{
|
|
7398
7350
|
"aria-hidden": "true",
|
|
7399
7351
|
className: "absolute top-5 left-[7px] h-[calc(100%-20px)] w-px bg-border"
|
|
7400
7352
|
}
|
|
7401
7353
|
) : null,
|
|
7402
|
-
/* @__PURE__ */
|
|
7354
|
+
/* @__PURE__ */ jsx103(
|
|
7403
7355
|
"span",
|
|
7404
7356
|
{
|
|
7405
7357
|
"data-slot": "timeline-dot",
|
|
7406
7358
|
className: "relative mt-1 flex size-4 shrink-0 items-center justify-center",
|
|
7407
|
-
children: item.icon ? /* @__PURE__ */
|
|
7359
|
+
children: item.icon ? /* @__PURE__ */ jsx103(Icon, { name: item.icon, size: "sm" }) : /* @__PURE__ */ jsx103(
|
|
7408
7360
|
"span",
|
|
7409
7361
|
{
|
|
7410
7362
|
className: "size-2 rounded-full bg-primary",
|
|
@@ -7413,15 +7365,15 @@ function Timeline({ items = [], pending, className, style }) {
|
|
|
7413
7365
|
)
|
|
7414
7366
|
}
|
|
7415
7367
|
),
|
|
7416
|
-
/* @__PURE__ */
|
|
7417
|
-
/* @__PURE__ */
|
|
7418
|
-
item.time ? /* @__PURE__ */
|
|
7368
|
+
/* @__PURE__ */ jsxs69("div", { className: "min-w-0 flex-1", children: [
|
|
7369
|
+
/* @__PURE__ */ jsx103("div", { "data-slot": "timeline-content", className: "text-sm", children: item.content }),
|
|
7370
|
+
item.time ? /* @__PURE__ */ jsx103("div", { "data-slot": "timeline-time", className: "mt-0.5 text-xs text-muted-foreground", children: item.time }) : null
|
|
7419
7371
|
] })
|
|
7420
7372
|
] }, index)) });
|
|
7421
7373
|
}
|
|
7422
7374
|
|
|
7423
7375
|
// src/components/components/Toggle/index.tsx
|
|
7424
|
-
import { jsx as
|
|
7376
|
+
import { jsx as jsx104 } from "react/jsx-runtime";
|
|
7425
7377
|
function Toggle2({
|
|
7426
7378
|
text,
|
|
7427
7379
|
pressed,
|
|
@@ -7432,7 +7384,7 @@ function Toggle2({
|
|
|
7432
7384
|
className,
|
|
7433
7385
|
style
|
|
7434
7386
|
}) {
|
|
7435
|
-
return /* @__PURE__ */
|
|
7387
|
+
return /* @__PURE__ */ jsx104(
|
|
7436
7388
|
Toggle,
|
|
7437
7389
|
{
|
|
7438
7390
|
pressed,
|
|
@@ -7448,7 +7400,7 @@ function Toggle2({
|
|
|
7448
7400
|
}
|
|
7449
7401
|
|
|
7450
7402
|
// src/components/components/ToggleGroup/index.tsx
|
|
7451
|
-
import { jsx as
|
|
7403
|
+
import { jsx as jsx105 } from "react/jsx-runtime";
|
|
7452
7404
|
function ToggleGroup2({
|
|
7453
7405
|
options = [],
|
|
7454
7406
|
value,
|
|
@@ -7468,7 +7420,7 @@ function ToggleGroup2({
|
|
|
7468
7420
|
onChange?.(added ?? void 0);
|
|
7469
7421
|
}
|
|
7470
7422
|
};
|
|
7471
|
-
return /* @__PURE__ */
|
|
7423
|
+
return /* @__PURE__ */ jsx105(
|
|
7472
7424
|
ToggleGroup,
|
|
7473
7425
|
{
|
|
7474
7426
|
value: groupValue,
|
|
@@ -7477,7 +7429,7 @@ function ToggleGroup2({
|
|
|
7477
7429
|
onValueChange: (next) => handleChange(next),
|
|
7478
7430
|
className,
|
|
7479
7431
|
style,
|
|
7480
|
-
children: options.map((option) => /* @__PURE__ */
|
|
7432
|
+
children: options.map((option) => /* @__PURE__ */ jsx105(
|
|
7481
7433
|
ToggleGroupItem,
|
|
7482
7434
|
{
|
|
7483
7435
|
value: option.value,
|
|
@@ -7490,15 +7442,6 @@ function ToggleGroup2({
|
|
|
7490
7442
|
);
|
|
7491
7443
|
}
|
|
7492
7444
|
|
|
7493
|
-
// src/components/components/Tooltip/index.tsx
|
|
7494
|
-
import { jsx as jsx108, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
7495
|
-
function Tooltip2({ content, side, children, className, style }) {
|
|
7496
|
-
return /* @__PURE__ */ jsxs71(Tooltip, { children: [
|
|
7497
|
-
/* @__PURE__ */ jsx108(TooltipTrigger, { render: triggerWrapper("tooltip-trigger-wrap"), children }),
|
|
7498
|
-
/* @__PURE__ */ jsx108(TooltipContent, { side, className, style, children: content })
|
|
7499
|
-
] });
|
|
7500
|
-
}
|
|
7501
|
-
|
|
7502
7445
|
// src/components/components/Tour/index.tsx
|
|
7503
7446
|
import { useI18n as useI18n29 } from "@pactor-app/runtime";
|
|
7504
7447
|
import { XIcon as XIcon2 } from "lucide-react";
|
|
@@ -7508,7 +7451,7 @@ import {
|
|
|
7508
7451
|
useState as useState34
|
|
7509
7452
|
} from "react";
|
|
7510
7453
|
import { createPortal } from "react-dom";
|
|
7511
|
-
import { Fragment as Fragment11, jsx as
|
|
7454
|
+
import { Fragment as Fragment11, jsx as jsx106, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
7512
7455
|
function Tour({
|
|
7513
7456
|
open = false,
|
|
7514
7457
|
steps = [],
|
|
@@ -7557,9 +7500,9 @@ function Tour({
|
|
|
7557
7500
|
};
|
|
7558
7501
|
const positionStyle = anchor ? { top: anchor.top, left: anchor.left } : { top: "50%", left: "50%", transform: "translate(-50%, -50%)" };
|
|
7559
7502
|
return createPortal(
|
|
7560
|
-
/* @__PURE__ */
|
|
7561
|
-
/* @__PURE__ */
|
|
7562
|
-
/* @__PURE__ */
|
|
7503
|
+
/* @__PURE__ */ jsxs70(Fragment11, { children: [
|
|
7504
|
+
/* @__PURE__ */ jsx106("div", { "data-slot": "tour-mask", className: "fixed inset-0 z-[90] bg-(--overlay-background)" }),
|
|
7505
|
+
/* @__PURE__ */ jsxs70(
|
|
7563
7506
|
"div",
|
|
7564
7507
|
{
|
|
7565
7508
|
"data-slot": "tour-card",
|
|
@@ -7569,9 +7512,9 @@ function Tour({
|
|
|
7569
7512
|
),
|
|
7570
7513
|
style: { ...positionStyle, ...style },
|
|
7571
7514
|
children: [
|
|
7572
|
-
/* @__PURE__ */
|
|
7573
|
-
step.title ? /* @__PURE__ */
|
|
7574
|
-
/* @__PURE__ */
|
|
7515
|
+
/* @__PURE__ */ jsxs70("div", { className: "flex items-start justify-between gap-2", children: [
|
|
7516
|
+
step.title ? /* @__PURE__ */ jsx106("div", { "data-slot": "tour-title", className: "font-medium", children: step.title }) : /* @__PURE__ */ jsx106("span", {}),
|
|
7517
|
+
/* @__PURE__ */ jsx106(
|
|
7575
7518
|
"button",
|
|
7576
7519
|
{
|
|
7577
7520
|
type: "button",
|
|
@@ -7579,19 +7522,19 @@ function Tour({
|
|
|
7579
7522
|
"aria-label": "Close",
|
|
7580
7523
|
className: "cursor-pointer rounded-xs opacity-70 transition-opacity hover:opacity-100 [&_svg]:size-3.5",
|
|
7581
7524
|
onClick: () => onClose?.(),
|
|
7582
|
-
children: /* @__PURE__ */
|
|
7525
|
+
children: /* @__PURE__ */ jsx106(XIcon2, {})
|
|
7583
7526
|
}
|
|
7584
7527
|
)
|
|
7585
7528
|
] }),
|
|
7586
|
-
step.content ? /* @__PURE__ */
|
|
7587
|
-
/* @__PURE__ */
|
|
7588
|
-
/* @__PURE__ */
|
|
7529
|
+
step.content ? /* @__PURE__ */ jsx106("div", { "data-slot": "tour-content", className: "text-muted-foreground", children: step.content }) : null,
|
|
7530
|
+
/* @__PURE__ */ jsxs70("div", { className: "mt-1 flex items-center justify-between gap-2", children: [
|
|
7531
|
+
/* @__PURE__ */ jsxs70("span", { className: "text-xs text-muted-foreground", children: [
|
|
7589
7532
|
safeIndex + 1,
|
|
7590
7533
|
" / ",
|
|
7591
7534
|
steps.length
|
|
7592
7535
|
] }),
|
|
7593
|
-
/* @__PURE__ */
|
|
7594
|
-
safeIndex > 0 ? /* @__PURE__ */
|
|
7536
|
+
/* @__PURE__ */ jsxs70("div", { className: "flex gap-2", children: [
|
|
7537
|
+
safeIndex > 0 ? /* @__PURE__ */ jsx106(
|
|
7595
7538
|
Button,
|
|
7596
7539
|
{
|
|
7597
7540
|
variant: "outline",
|
|
@@ -7600,7 +7543,7 @@ function Tour({
|
|
|
7600
7543
|
children: t("pactor.tour.prev")
|
|
7601
7544
|
}
|
|
7602
7545
|
) : null,
|
|
7603
|
-
/* @__PURE__ */
|
|
7546
|
+
/* @__PURE__ */ jsx106(
|
|
7604
7547
|
Button,
|
|
7605
7548
|
{
|
|
7606
7549
|
size: "sm",
|
|
@@ -7628,7 +7571,7 @@ function Tour({
|
|
|
7628
7571
|
import { useI18n as useI18n30 } from "@pactor-app/runtime";
|
|
7629
7572
|
import { ChevronLeft as ChevronLeft2, ChevronRight as ChevronRight3 } from "lucide-react";
|
|
7630
7573
|
import { useEffect as useEffect31, useState as useState35 } from "react";
|
|
7631
|
-
import { jsx as
|
|
7574
|
+
import { jsx as jsx107, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
7632
7575
|
function Transfer({
|
|
7633
7576
|
name,
|
|
7634
7577
|
label,
|
|
@@ -7696,14 +7639,14 @@ function Transfer({
|
|
|
7696
7639
|
const renderPanel = (side, title, items, checked) => {
|
|
7697
7640
|
const enabledItems = items.filter((option) => !option.disabled);
|
|
7698
7641
|
const allChecked = enabledItems.length > 0 && enabledItems.every((option) => checked.has(option.value));
|
|
7699
|
-
return /* @__PURE__ */
|
|
7642
|
+
return /* @__PURE__ */ jsxs71(
|
|
7700
7643
|
"div",
|
|
7701
7644
|
{
|
|
7702
7645
|
"data-slot": `transfer-${side}-panel`,
|
|
7703
7646
|
className: "flex w-48 flex-col rounded-md border border-border",
|
|
7704
7647
|
children: [
|
|
7705
|
-
/* @__PURE__ */
|
|
7706
|
-
/* @__PURE__ */
|
|
7648
|
+
/* @__PURE__ */ jsxs71("div", { className: "flex items-center gap-2 border-b border-border px-3 py-2", children: [
|
|
7649
|
+
/* @__PURE__ */ jsx107(
|
|
7707
7650
|
"input",
|
|
7708
7651
|
{
|
|
7709
7652
|
type: "checkbox",
|
|
@@ -7721,10 +7664,10 @@ function Transfer({
|
|
|
7721
7664
|
}
|
|
7722
7665
|
}
|
|
7723
7666
|
),
|
|
7724
|
-
/* @__PURE__ */
|
|
7725
|
-
/* @__PURE__ */
|
|
7667
|
+
/* @__PURE__ */ jsx107("span", { className: "text-sm font-medium", children: title }),
|
|
7668
|
+
/* @__PURE__ */ jsx107("span", { className: "ml-auto text-xs text-muted-foreground", children: t("pactor.transfer.itemCount", { count: items.length }) })
|
|
7726
7669
|
] }),
|
|
7727
|
-
/* @__PURE__ */
|
|
7670
|
+
/* @__PURE__ */ jsx107("div", { className: "flex max-h-48 flex-col overflow-y-auto p-1", children: items.map((option) => /* @__PURE__ */ jsxs71(
|
|
7728
7671
|
"label",
|
|
7729
7672
|
{
|
|
7730
7673
|
className: cn(
|
|
@@ -7732,7 +7675,7 @@ function Transfer({
|
|
|
7732
7675
|
(disabled || option.disabled) && "cursor-not-allowed opacity-50"
|
|
7733
7676
|
),
|
|
7734
7677
|
children: [
|
|
7735
|
-
/* @__PURE__ */
|
|
7678
|
+
/* @__PURE__ */ jsx107(
|
|
7736
7679
|
"input",
|
|
7737
7680
|
{
|
|
7738
7681
|
type: "checkbox",
|
|
@@ -7741,7 +7684,7 @@ function Transfer({
|
|
|
7741
7684
|
onChange: (event) => toggleChecked(side, option.value, event.target.checked)
|
|
7742
7685
|
}
|
|
7743
7686
|
),
|
|
7744
|
-
/* @__PURE__ */
|
|
7687
|
+
/* @__PURE__ */ jsx107("span", { className: "min-w-0 flex-1 truncate", children: option.label })
|
|
7745
7688
|
]
|
|
7746
7689
|
},
|
|
7747
7690
|
String(option.value)
|
|
@@ -7750,7 +7693,7 @@ function Transfer({
|
|
|
7750
7693
|
}
|
|
7751
7694
|
);
|
|
7752
7695
|
};
|
|
7753
|
-
const control = /* @__PURE__ */
|
|
7696
|
+
const control = /* @__PURE__ */ jsxs71(
|
|
7754
7697
|
"div",
|
|
7755
7698
|
{
|
|
7756
7699
|
"data-slot": "transfer",
|
|
@@ -7758,8 +7701,8 @@ function Transfer({
|
|
|
7758
7701
|
style: inForm ? void 0 : style,
|
|
7759
7702
|
children: [
|
|
7760
7703
|
renderPanel("left", resolvedTitles[0], leftOptions, leftChecked),
|
|
7761
|
-
/* @__PURE__ */
|
|
7762
|
-
/* @__PURE__ */
|
|
7704
|
+
/* @__PURE__ */ jsxs71("div", { className: "flex flex-col gap-2", children: [
|
|
7705
|
+
/* @__PURE__ */ jsx107(
|
|
7763
7706
|
"button",
|
|
7764
7707
|
{
|
|
7765
7708
|
type: "button",
|
|
@@ -7767,10 +7710,10 @@ function Transfer({
|
|
|
7767
7710
|
disabled: disabled || leftChecked.size === 0,
|
|
7768
7711
|
className: "flex size-8 cursor-pointer items-center justify-center rounded-md bg-primary text-primary-foreground hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50",
|
|
7769
7712
|
onClick: moveRight,
|
|
7770
|
-
children: /* @__PURE__ */
|
|
7713
|
+
children: /* @__PURE__ */ jsx107(ChevronRight3, { className: "size-4" })
|
|
7771
7714
|
}
|
|
7772
7715
|
),
|
|
7773
|
-
/* @__PURE__ */
|
|
7716
|
+
/* @__PURE__ */ jsx107(
|
|
7774
7717
|
"button",
|
|
7775
7718
|
{
|
|
7776
7719
|
type: "button",
|
|
@@ -7778,7 +7721,7 @@ function Transfer({
|
|
|
7778
7721
|
disabled: disabled || rightChecked.size === 0,
|
|
7779
7722
|
className: "flex size-8 cursor-pointer items-center justify-center rounded-md bg-primary text-primary-foreground hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50",
|
|
7780
7723
|
onClick: moveLeft,
|
|
7781
|
-
children: /* @__PURE__ */
|
|
7724
|
+
children: /* @__PURE__ */ jsx107(ChevronLeft2, { className: "size-4" })
|
|
7782
7725
|
}
|
|
7783
7726
|
)
|
|
7784
7727
|
] }),
|
|
@@ -7787,11 +7730,12 @@ function Transfer({
|
|
|
7787
7730
|
}
|
|
7788
7731
|
);
|
|
7789
7732
|
if (inForm && form && name) {
|
|
7790
|
-
return /* @__PURE__ */
|
|
7733
|
+
return /* @__PURE__ */ jsx107(
|
|
7791
7734
|
FieldShell,
|
|
7792
7735
|
{
|
|
7793
7736
|
layout: form.layout,
|
|
7794
7737
|
label,
|
|
7738
|
+
rules,
|
|
7795
7739
|
error: form.errors[name],
|
|
7796
7740
|
className,
|
|
7797
7741
|
style,
|
|
@@ -7901,7 +7845,7 @@ function moveTreeNode(nodes, dragKey, dropKey, position) {
|
|
|
7901
7845
|
}
|
|
7902
7846
|
|
|
7903
7847
|
// src/components/components/Tree/index.tsx
|
|
7904
|
-
import { jsx as
|
|
7848
|
+
import { jsx as jsx108, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
7905
7849
|
function someDescendantChecked(node, checked) {
|
|
7906
7850
|
return (node.children ?? []).some(
|
|
7907
7851
|
(child) => checked.has(child.key) || someDescendantChecked(child, checked)
|
|
@@ -8060,30 +8004,30 @@ function Tree({
|
|
|
8060
8004
|
const actions = node.actions ?? nodeActions;
|
|
8061
8005
|
if (!actions || actions.length === 0) return null;
|
|
8062
8006
|
if (nodeActionDisplay === "dropdown") {
|
|
8063
|
-
return /* @__PURE__ */
|
|
8007
|
+
return /* @__PURE__ */ jsx108(
|
|
8064
8008
|
"span",
|
|
8065
8009
|
{
|
|
8066
8010
|
"data-slot": "tree-node-actions",
|
|
8067
8011
|
className: "flex shrink-0 items-center opacity-0 transition-opacity group-hover:opacity-100",
|
|
8068
|
-
children: /* @__PURE__ */
|
|
8069
|
-
/* @__PURE__ */
|
|
8012
|
+
children: /* @__PURE__ */ jsxs72(DropdownMenu, { children: [
|
|
8013
|
+
/* @__PURE__ */ jsx108(
|
|
8070
8014
|
DropdownMenuTrigger,
|
|
8071
8015
|
{
|
|
8072
8016
|
"aria-label": t("pactor.tree.nodeActions"),
|
|
8073
8017
|
className: "flex size-5 items-center justify-center rounded text-muted-foreground hover:bg-background hover:text-foreground",
|
|
8074
|
-
children: /* @__PURE__ */
|
|
8018
|
+
children: /* @__PURE__ */ jsx108(Icon, { name: "ellipsis", size: "sm" })
|
|
8075
8019
|
}
|
|
8076
8020
|
),
|
|
8077
|
-
/* @__PURE__ */
|
|
8078
|
-
action.separatorBefore ? /* @__PURE__ */
|
|
8079
|
-
/* @__PURE__ */
|
|
8021
|
+
/* @__PURE__ */ jsx108(DropdownMenuContent, { align: "end", children: actions.map((action) => /* @__PURE__ */ jsxs72(Fragment12, { children: [
|
|
8022
|
+
action.separatorBefore ? /* @__PURE__ */ jsx108(DropdownMenuSeparator, {}) : null,
|
|
8023
|
+
/* @__PURE__ */ jsxs72(
|
|
8080
8024
|
DropdownMenuItem,
|
|
8081
8025
|
{
|
|
8082
8026
|
disabled: isActionDisabled(action),
|
|
8083
8027
|
variant: action.danger ? "destructive" : "default",
|
|
8084
8028
|
onClick: () => handleNodeAction(node, action),
|
|
8085
8029
|
children: [
|
|
8086
|
-
action.icon ? /* @__PURE__ */
|
|
8030
|
+
action.icon ? /* @__PURE__ */ jsx108(Icon, { name: action.icon, size: "sm" }) : null,
|
|
8087
8031
|
action.label ?? action.value
|
|
8088
8032
|
]
|
|
8089
8033
|
}
|
|
@@ -8093,12 +8037,12 @@ function Tree({
|
|
|
8093
8037
|
}
|
|
8094
8038
|
);
|
|
8095
8039
|
}
|
|
8096
|
-
return /* @__PURE__ */
|
|
8040
|
+
return /* @__PURE__ */ jsx108(
|
|
8097
8041
|
"span",
|
|
8098
8042
|
{
|
|
8099
8043
|
"data-slot": "tree-node-actions",
|
|
8100
8044
|
className: "flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover:opacity-100",
|
|
8101
|
-
children: actions.map((action) => /* @__PURE__ */
|
|
8045
|
+
children: actions.map((action) => /* @__PURE__ */ jsx108(
|
|
8102
8046
|
"button",
|
|
8103
8047
|
{
|
|
8104
8048
|
type: "button",
|
|
@@ -8112,7 +8056,7 @@ function Tree({
|
|
|
8112
8056
|
event.stopPropagation();
|
|
8113
8057
|
handleNodeAction(node, action);
|
|
8114
8058
|
},
|
|
8115
|
-
children: action.icon ? /* @__PURE__ */
|
|
8059
|
+
children: action.icon ? /* @__PURE__ */ jsx108(Icon, { name: action.icon, size: "sm" }) : action.label
|
|
8116
8060
|
},
|
|
8117
8061
|
action.value
|
|
8118
8062
|
))
|
|
@@ -8127,7 +8071,7 @@ function Tree({
|
|
|
8127
8071
|
const canDrag = draggable === true && !isDisabled;
|
|
8128
8072
|
const dropPosition = dropTarget?.key === node.key ? dropTarget.position : null;
|
|
8129
8073
|
const indeterminate = checkable === true && hasChildren && !checkedSet.has(node.key) && someDescendantChecked(node, checkedSet);
|
|
8130
|
-
return /* @__PURE__ */
|
|
8074
|
+
return /* @__PURE__ */ jsxs72(
|
|
8131
8075
|
"div",
|
|
8132
8076
|
{
|
|
8133
8077
|
"data-slot": "tree-node",
|
|
@@ -8136,7 +8080,7 @@ function Tree({
|
|
|
8136
8080
|
"aria-expanded": hasChildren ? isExpanded : void 0,
|
|
8137
8081
|
"aria-selected": selected.includes(node.key),
|
|
8138
8082
|
children: [
|
|
8139
|
-
/* @__PURE__ */
|
|
8083
|
+
/* @__PURE__ */ jsxs72(
|
|
8140
8084
|
"div",
|
|
8141
8085
|
{
|
|
8142
8086
|
className: cn(
|
|
@@ -8157,7 +8101,7 @@ function Tree({
|
|
|
8157
8101
|
onDragOver: draggable ? (event) => handleDragOver(event, node) : void 0,
|
|
8158
8102
|
onDrop: draggable ? (event) => handleDrop(event, node) : void 0,
|
|
8159
8103
|
children: [
|
|
8160
|
-
canDrag ? /* @__PURE__ */
|
|
8104
|
+
canDrag ? /* @__PURE__ */ jsx108(
|
|
8161
8105
|
"span",
|
|
8162
8106
|
{
|
|
8163
8107
|
"data-slot": "tree-drag-handle",
|
|
@@ -8172,10 +8116,10 @@ function Tree({
|
|
|
8172
8116
|
},
|
|
8173
8117
|
onDragEnd: clearDrag,
|
|
8174
8118
|
className: "flex size-4 shrink-0 cursor-move items-center justify-center text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100",
|
|
8175
|
-
children: /* @__PURE__ */
|
|
8119
|
+
children: /* @__PURE__ */ jsx108(Icon, { name: "grip-vertical", size: "sm" })
|
|
8176
8120
|
}
|
|
8177
8121
|
) : null,
|
|
8178
|
-
hasChildren ? /* @__PURE__ */
|
|
8122
|
+
hasChildren ? /* @__PURE__ */ jsx108(
|
|
8179
8123
|
"button",
|
|
8180
8124
|
{
|
|
8181
8125
|
type: "button",
|
|
@@ -8184,7 +8128,7 @@ function Tree({
|
|
|
8184
8128
|
disabled: isDisabled,
|
|
8185
8129
|
onClick: () => toggleExpand(node.key),
|
|
8186
8130
|
className: "flex size-5 shrink-0 items-center justify-center",
|
|
8187
|
-
children: /* @__PURE__ */
|
|
8131
|
+
children: /* @__PURE__ */ jsx108(
|
|
8188
8132
|
Icon,
|
|
8189
8133
|
{
|
|
8190
8134
|
name: "chevron-right",
|
|
@@ -8196,8 +8140,8 @@ function Tree({
|
|
|
8196
8140
|
}
|
|
8197
8141
|
)
|
|
8198
8142
|
}
|
|
8199
|
-
) : /* @__PURE__ */
|
|
8200
|
-
checkable ? /* @__PURE__ */
|
|
8143
|
+
) : /* @__PURE__ */ jsx108("span", { className: "size-5 shrink-0" }),
|
|
8144
|
+
checkable ? /* @__PURE__ */ jsx108(
|
|
8201
8145
|
Checkbox,
|
|
8202
8146
|
{
|
|
8203
8147
|
checked: checkedSet.has(node.key),
|
|
@@ -8206,7 +8150,7 @@ function Tree({
|
|
|
8206
8150
|
onCheckedChange: (next) => handleCheck(node, next === true)
|
|
8207
8151
|
}
|
|
8208
8152
|
) : null,
|
|
8209
|
-
/* @__PURE__ */
|
|
8153
|
+
/* @__PURE__ */ jsx108(
|
|
8210
8154
|
"span",
|
|
8211
8155
|
{
|
|
8212
8156
|
"data-slot": "tree-node-title",
|
|
@@ -8225,7 +8169,7 @@ function Tree({
|
|
|
8225
8169
|
node.key
|
|
8226
8170
|
);
|
|
8227
8171
|
});
|
|
8228
|
-
return /* @__PURE__ */
|
|
8172
|
+
return /* @__PURE__ */ jsx108(
|
|
8229
8173
|
"div",
|
|
8230
8174
|
{
|
|
8231
8175
|
"data-slot": "tree",
|
|
@@ -8241,7 +8185,7 @@ function Tree({
|
|
|
8241
8185
|
import { useI18n as useI18n32 } from "@pactor-app/runtime";
|
|
8242
8186
|
import { ChevronRight as ChevronRight4 } from "lucide-react";
|
|
8243
8187
|
import { useEffect as useEffect33, useId as useId14, useState as useState37 } from "react";
|
|
8244
|
-
import { jsx as
|
|
8188
|
+
import { jsx as jsx109, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
8245
8189
|
function findPath(options, target, trail = []) {
|
|
8246
8190
|
for (const option of options) {
|
|
8247
8191
|
const path = [...trail, option.value];
|
|
@@ -8330,21 +8274,21 @@ function TreeSelect({
|
|
|
8330
8274
|
if (searching && !matchQuery(option, query.trim())) return null;
|
|
8331
8275
|
const hasChildren = (option.children?.length ?? 0) > 0;
|
|
8332
8276
|
const isExpanded = searching || expanded.has(option.value);
|
|
8333
|
-
return /* @__PURE__ */
|
|
8334
|
-
/* @__PURE__ */
|
|
8277
|
+
return /* @__PURE__ */ jsxs73("div", { "data-slot": "treeselect-node", children: [
|
|
8278
|
+
/* @__PURE__ */ jsxs73(
|
|
8335
8279
|
"div",
|
|
8336
8280
|
{
|
|
8337
8281
|
className: "flex items-center gap-1",
|
|
8338
8282
|
style: { paddingLeft: depth * 16 },
|
|
8339
8283
|
children: [
|
|
8340
|
-
hasChildren ? /* @__PURE__ */
|
|
8284
|
+
hasChildren ? /* @__PURE__ */ jsx109(
|
|
8341
8285
|
"button",
|
|
8342
8286
|
{
|
|
8343
8287
|
type: "button",
|
|
8344
8288
|
"aria-label": `${isExpanded ? t("pactor.tree.collapse") : t("pactor.tree.expand")} ${option.label}`,
|
|
8345
8289
|
className: "flex size-5 shrink-0 cursor-pointer items-center justify-center text-muted-foreground hover:text-foreground",
|
|
8346
8290
|
onClick: () => toggleExpanded(option.value),
|
|
8347
|
-
children: /* @__PURE__ */
|
|
8291
|
+
children: /* @__PURE__ */ jsx109(
|
|
8348
8292
|
ChevronRight4,
|
|
8349
8293
|
{
|
|
8350
8294
|
className: cn(
|
|
@@ -8354,8 +8298,8 @@ function TreeSelect({
|
|
|
8354
8298
|
}
|
|
8355
8299
|
)
|
|
8356
8300
|
}
|
|
8357
|
-
) : /* @__PURE__ */
|
|
8358
|
-
/* @__PURE__ */
|
|
8301
|
+
) : /* @__PURE__ */ jsx109("span", { className: "size-5 shrink-0" }),
|
|
8302
|
+
/* @__PURE__ */ jsx109(
|
|
8359
8303
|
"button",
|
|
8360
8304
|
{
|
|
8361
8305
|
type: "button",
|
|
@@ -8373,8 +8317,8 @@ function TreeSelect({
|
|
|
8373
8317
|
hasChildren && isExpanded ? renderNodes(option.children ?? [], depth + 1) : null
|
|
8374
8318
|
] }, String(option.value));
|
|
8375
8319
|
});
|
|
8376
|
-
const control = /* @__PURE__ */
|
|
8377
|
-
/* @__PURE__ */
|
|
8320
|
+
const control = /* @__PURE__ */ jsxs73(Popover, { open, onOpenChange: openPanel, children: [
|
|
8321
|
+
/* @__PURE__ */ jsxs73(
|
|
8378
8322
|
PopoverTrigger,
|
|
8379
8323
|
{
|
|
8380
8324
|
id: controlId,
|
|
@@ -8390,9 +8334,9 @@ function TreeSelect({
|
|
|
8390
8334
|
),
|
|
8391
8335
|
style: inForm ? void 0 : style,
|
|
8392
8336
|
children: [
|
|
8393
|
-
/* @__PURE__ */
|
|
8394
|
-
showClear ? /* @__PURE__ */
|
|
8395
|
-
/* @__PURE__ */
|
|
8337
|
+
/* @__PURE__ */ jsx109("span", { className: "min-w-0 flex-1 truncate text-left", children: selected ? selected.node.label : placeholder ?? t("pactor.select.placeholder") }),
|
|
8338
|
+
showClear ? /* @__PURE__ */ jsx109(ClearHoverButton, { label: t("pactor.control.clear"), onClear: handleClear }) : null,
|
|
8339
|
+
/* @__PURE__ */ jsx109(
|
|
8396
8340
|
ChevronRight4,
|
|
8397
8341
|
{
|
|
8398
8342
|
className: cn(
|
|
@@ -8404,8 +8348,8 @@ function TreeSelect({
|
|
|
8404
8348
|
]
|
|
8405
8349
|
}
|
|
8406
8350
|
),
|
|
8407
|
-
/* @__PURE__ */
|
|
8408
|
-
searchable ? /* @__PURE__ */
|
|
8351
|
+
/* @__PURE__ */ jsxs73(PopoverContent, { className: "w-64 p-2", children: [
|
|
8352
|
+
searchable ? /* @__PURE__ */ jsx109("div", { className: "pb-2", children: /* @__PURE__ */ jsx109(
|
|
8409
8353
|
Input,
|
|
8410
8354
|
{
|
|
8411
8355
|
"aria-label": t("pactor.select.search"),
|
|
@@ -8415,7 +8359,7 @@ function TreeSelect({
|
|
|
8415
8359
|
onChange: (event) => setQuery(event.target.value)
|
|
8416
8360
|
}
|
|
8417
8361
|
) }) : null,
|
|
8418
|
-
/* @__PURE__ */
|
|
8362
|
+
/* @__PURE__ */ jsx109(
|
|
8419
8363
|
"div",
|
|
8420
8364
|
{
|
|
8421
8365
|
"data-slot": "treeselect-tree",
|
|
@@ -8426,11 +8370,12 @@ function TreeSelect({
|
|
|
8426
8370
|
] })
|
|
8427
8371
|
] });
|
|
8428
8372
|
if (inForm && form && name) {
|
|
8429
|
-
return /* @__PURE__ */
|
|
8373
|
+
return /* @__PURE__ */ jsx109(
|
|
8430
8374
|
FieldShell,
|
|
8431
8375
|
{
|
|
8432
8376
|
layout: form.layout,
|
|
8433
8377
|
label,
|
|
8378
|
+
rules,
|
|
8434
8379
|
htmlFor: controlId,
|
|
8435
8380
|
error: form.errors[name],
|
|
8436
8381
|
className,
|
|
@@ -8443,21 +8388,21 @@ function TreeSelect({
|
|
|
8443
8388
|
}
|
|
8444
8389
|
|
|
8445
8390
|
// src/components/components/Typography/index.tsx
|
|
8446
|
-
import { jsx as
|
|
8391
|
+
import { jsx as jsx110 } from "react/jsx-runtime";
|
|
8447
8392
|
function Typography2({
|
|
8448
8393
|
variant = "p",
|
|
8449
8394
|
text,
|
|
8450
8395
|
className,
|
|
8451
8396
|
style
|
|
8452
8397
|
}) {
|
|
8453
|
-
return /* @__PURE__ */
|
|
8398
|
+
return /* @__PURE__ */ jsx110(Typography, { variant, className, style, children: text });
|
|
8454
8399
|
}
|
|
8455
8400
|
|
|
8456
8401
|
// src/components/components/Upload/index.tsx
|
|
8457
8402
|
import { useI18n as useI18n33 } from "@pactor-app/runtime";
|
|
8458
8403
|
import { Upload as UploadIcon, X as X3 } from "lucide-react";
|
|
8459
8404
|
import { useEffect as useEffect34, useId as useId15, useRef as useRef10, useState as useState38 } from "react";
|
|
8460
|
-
import { jsx as
|
|
8405
|
+
import { jsx as jsx111, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
8461
8406
|
function matchAccept(file, accept) {
|
|
8462
8407
|
const tokens = accept.split(",").map((token) => token.trim().toLowerCase()).filter((token) => token !== "");
|
|
8463
8408
|
if (tokens.length === 0) return true;
|
|
@@ -8545,7 +8490,7 @@ function Upload({
|
|
|
8545
8490
|
const handleRemove = (index) => {
|
|
8546
8491
|
commit(files.filter((_, i) => i !== index));
|
|
8547
8492
|
};
|
|
8548
|
-
const fileInput = /* @__PURE__ */
|
|
8493
|
+
const fileInput = /* @__PURE__ */ jsx111(
|
|
8549
8494
|
"input",
|
|
8550
8495
|
{
|
|
8551
8496
|
ref: inputRef,
|
|
@@ -8562,7 +8507,7 @@ function Upload({
|
|
|
8562
8507
|
}
|
|
8563
8508
|
}
|
|
8564
8509
|
);
|
|
8565
|
-
const picker = drag ? /* @__PURE__ */
|
|
8510
|
+
const picker = drag ? /* @__PURE__ */ jsxs74(
|
|
8566
8511
|
"div",
|
|
8567
8512
|
{
|
|
8568
8513
|
"data-slot": "upload-dragger",
|
|
@@ -8588,11 +8533,11 @@ function Upload({
|
|
|
8588
8533
|
handleFiles(Array.from(event.dataTransfer.files));
|
|
8589
8534
|
},
|
|
8590
8535
|
children: [
|
|
8591
|
-
/* @__PURE__ */
|
|
8592
|
-
/* @__PURE__ */
|
|
8536
|
+
/* @__PURE__ */ jsx111(UploadIcon, { className: "size-6" }),
|
|
8537
|
+
/* @__PURE__ */ jsx111("span", { children: t("pactor.upload.dragText") })
|
|
8593
8538
|
]
|
|
8594
8539
|
}
|
|
8595
|
-
) : /* @__PURE__ */
|
|
8540
|
+
) : /* @__PURE__ */ jsxs74(
|
|
8596
8541
|
"button",
|
|
8597
8542
|
{
|
|
8598
8543
|
type: "button",
|
|
@@ -8601,12 +8546,12 @@ function Upload({
|
|
|
8601
8546
|
className: "inline-flex h-9 cursor-pointer items-center gap-2 rounded-md border border-input bg-transparent px-3 text-sm shadow-xs hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50",
|
|
8602
8547
|
onClick: () => inputRef.current?.click(),
|
|
8603
8548
|
children: [
|
|
8604
|
-
/* @__PURE__ */
|
|
8549
|
+
/* @__PURE__ */ jsx111(UploadIcon, { className: "size-4" }),
|
|
8605
8550
|
t("pactor.upload.selectFile")
|
|
8606
8551
|
]
|
|
8607
8552
|
}
|
|
8608
8553
|
);
|
|
8609
|
-
const control = /* @__PURE__ */
|
|
8554
|
+
const control = /* @__PURE__ */ jsxs74(
|
|
8610
8555
|
"div",
|
|
8611
8556
|
{
|
|
8612
8557
|
"data-slot": "upload",
|
|
@@ -8615,16 +8560,16 @@ function Upload({
|
|
|
8615
8560
|
children: [
|
|
8616
8561
|
picker,
|
|
8617
8562
|
fileInput,
|
|
8618
|
-
tip ? /* @__PURE__ */
|
|
8619
|
-
rejected > 0 ? /* @__PURE__ */
|
|
8620
|
-
files.length > 0 ? /* @__PURE__ */
|
|
8563
|
+
tip ? /* @__PURE__ */ jsx111("div", { "data-slot": "upload-tip", className: "text-xs text-muted-foreground", children: tip }) : null,
|
|
8564
|
+
rejected > 0 ? /* @__PURE__ */ jsx111("div", { "data-slot": "upload-rejected", className: "text-xs text-destructive", children: t("pactor.upload.rejected", { count: rejected }) }) : null,
|
|
8565
|
+
files.length > 0 ? /* @__PURE__ */ jsx111("ul", { "data-slot": "upload-list", className: "flex flex-col gap-1", children: files.map((file, index) => /* @__PURE__ */ jsxs74(
|
|
8621
8566
|
"li",
|
|
8622
8567
|
{
|
|
8623
8568
|
className: "flex items-center gap-2 rounded-md border border-border px-3 py-1.5 text-sm",
|
|
8624
8569
|
children: [
|
|
8625
|
-
/* @__PURE__ */
|
|
8626
|
-
/* @__PURE__ */
|
|
8627
|
-
/* @__PURE__ */
|
|
8570
|
+
/* @__PURE__ */ jsx111("span", { className: "min-w-0 flex-1 truncate", children: file.name }),
|
|
8571
|
+
/* @__PURE__ */ jsx111("span", { className: "shrink-0 text-xs text-muted-foreground", children: formatSize2(file.size) }),
|
|
8572
|
+
/* @__PURE__ */ jsx111(
|
|
8628
8573
|
"button",
|
|
8629
8574
|
{
|
|
8630
8575
|
type: "button",
|
|
@@ -8632,7 +8577,7 @@ function Upload({
|
|
|
8632
8577
|
disabled,
|
|
8633
8578
|
className: "shrink-0 cursor-pointer text-muted-foreground hover:text-foreground disabled:cursor-not-allowed",
|
|
8634
8579
|
onClick: () => handleRemove(index),
|
|
8635
|
-
children: /* @__PURE__ */
|
|
8580
|
+
children: /* @__PURE__ */ jsx111(X3, { className: "size-4" })
|
|
8636
8581
|
}
|
|
8637
8582
|
)
|
|
8638
8583
|
]
|
|
@@ -8643,11 +8588,12 @@ function Upload({
|
|
|
8643
8588
|
}
|
|
8644
8589
|
);
|
|
8645
8590
|
if (inForm && form && name) {
|
|
8646
|
-
return /* @__PURE__ */
|
|
8591
|
+
return /* @__PURE__ */ jsx111(
|
|
8647
8592
|
FieldShell,
|
|
8648
8593
|
{
|
|
8649
8594
|
layout: form.layout,
|
|
8650
8595
|
label,
|
|
8596
|
+
rules,
|
|
8651
8597
|
error: form.errors[name],
|
|
8652
8598
|
className,
|
|
8653
8599
|
style,
|
|
@@ -8659,7 +8605,7 @@ function Upload({
|
|
|
8659
8605
|
}
|
|
8660
8606
|
|
|
8661
8607
|
// src/components/components/Video/index.tsx
|
|
8662
|
-
import { jsx as
|
|
8608
|
+
import { jsx as jsx112 } from "react/jsx-runtime";
|
|
8663
8609
|
function Video({
|
|
8664
8610
|
src,
|
|
8665
8611
|
poster,
|
|
@@ -8670,7 +8616,7 @@ function Video({
|
|
|
8670
8616
|
className,
|
|
8671
8617
|
style
|
|
8672
8618
|
}) {
|
|
8673
|
-
return /* @__PURE__ */
|
|
8619
|
+
return /* @__PURE__ */ jsx112(
|
|
8674
8620
|
"video",
|
|
8675
8621
|
{
|
|
8676
8622
|
"data-slot": "video",
|
|
@@ -8688,7 +8634,7 @@ function Video({
|
|
|
8688
8634
|
}
|
|
8689
8635
|
|
|
8690
8636
|
// src/components/components/Watermark/index.tsx
|
|
8691
|
-
import { jsx as
|
|
8637
|
+
import { jsx as jsx113, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
8692
8638
|
function escapeXml(value) {
|
|
8693
8639
|
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
8694
8640
|
}
|
|
@@ -8713,7 +8659,7 @@ function Watermark({
|
|
|
8713
8659
|
style
|
|
8714
8660
|
}) {
|
|
8715
8661
|
const lines = (Array.isArray(content) ? content : content !== void 0 ? [content] : []).filter((line) => typeof line === "string" && line !== "");
|
|
8716
|
-
return /* @__PURE__ */
|
|
8662
|
+
return /* @__PURE__ */ jsxs75(
|
|
8717
8663
|
"div",
|
|
8718
8664
|
{
|
|
8719
8665
|
"data-slot": "watermark",
|
|
@@ -8721,7 +8667,7 @@ function Watermark({
|
|
|
8721
8667
|
style,
|
|
8722
8668
|
children: [
|
|
8723
8669
|
children,
|
|
8724
|
-
lines.length > 0 ? /* @__PURE__ */
|
|
8670
|
+
lines.length > 0 ? /* @__PURE__ */ jsx113(
|
|
8725
8671
|
"div",
|
|
8726
8672
|
{
|
|
8727
8673
|
"data-slot": "watermark-layer",
|
|
@@ -8904,6 +8850,7 @@ export {
|
|
|
8904
8850
|
CONTROL_SIZE_AREA,
|
|
8905
8851
|
CONTROL_SIZE_SELECT_ATTR,
|
|
8906
8852
|
CONTROL_SIZE_TRIGGER_TEXT,
|
|
8853
|
+
Field2 as Field,
|
|
8907
8854
|
Cascader,
|
|
8908
8855
|
Checkbox2 as Checkbox,
|
|
8909
8856
|
ChipNode,
|
|
@@ -8926,9 +8873,7 @@ export {
|
|
|
8926
8873
|
DiffViewer,
|
|
8927
8874
|
DocumentPreview,
|
|
8928
8875
|
Drawer2 as Drawer,
|
|
8929
|
-
DropdownMenu2 as DropdownMenu,
|
|
8930
8876
|
Empty2 as Empty,
|
|
8931
|
-
Field2 as Field,
|
|
8932
8877
|
inferKind,
|
|
8933
8878
|
FilePreview,
|
|
8934
8879
|
Flex,
|
|
@@ -8997,7 +8942,6 @@ export {
|
|
|
8997
8942
|
Timeline,
|
|
8998
8943
|
Toggle2 as Toggle,
|
|
8999
8944
|
ToggleGroup2 as ToggleGroup,
|
|
9000
|
-
Tooltip2 as Tooltip,
|
|
9001
8945
|
Tour,
|
|
9002
8946
|
Transfer,
|
|
9003
8947
|
Tree,
|