@pactor-app/ui 1.17.1 → 1.18.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-IH67RZJ4.js → chunk-COMLXFWS.js} +1 -1
- package/dist/{chunk-LU36YCYA.js → chunk-IMRMBMHI.js} +2 -2
- package/dist/{chunk-GVBFVV7I.js → chunk-MHM7LTV2.js} +333 -166
- package/dist/{chunk-OGNXKVGQ.js → chunk-RB7RCKAX.js} +3 -1
- package/dist/{chunk-64JZPHD3.js → chunk-XA6OJ54X.js} +10 -4
- package/dist/components/index.cjs +446 -268
- package/dist/components/index.d.cts +42 -1
- package/dist/components/index.d.ts +42 -1
- package/dist/components/index.js +6 -4
- package/dist/index.cjs +597 -419
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -5
- package/dist/layout/index.cjs +3 -1
- package/dist/layout/index.js +3 -3
- package/dist/ui/index.cjs +12 -4
- package/dist/ui/index.js +2 -2
- package/package.json +5 -5
- package/styles.css +40 -3
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
Icon,
|
|
3
3
|
Menu,
|
|
4
4
|
Sidebar
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-COMLXFWS.js";
|
|
6
6
|
import {
|
|
7
7
|
Alert,
|
|
8
8
|
AlertDescription,
|
|
@@ -141,7 +141,7 @@ import {
|
|
|
141
141
|
chartColor,
|
|
142
142
|
navigationMenuTriggerStyle,
|
|
143
143
|
toast
|
|
144
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-XA6OJ54X.js";
|
|
145
145
|
import {
|
|
146
146
|
Dialog,
|
|
147
147
|
DialogContent,
|
|
@@ -176,7 +176,7 @@ import {
|
|
|
176
176
|
Tooltip,
|
|
177
177
|
TooltipContent,
|
|
178
178
|
TooltipTrigger
|
|
179
|
-
} from "./chunk-
|
|
179
|
+
} from "./chunk-RB7RCKAX.js";
|
|
180
180
|
import {
|
|
181
181
|
Button,
|
|
182
182
|
cn
|
|
@@ -2477,18 +2477,205 @@ function NavigationMenu2({ items = [], className, style }) {
|
|
|
2477
2477
|
) }, `${item.label}-${index}`)) }) });
|
|
2478
2478
|
}
|
|
2479
2479
|
|
|
2480
|
-
// src/components/components/
|
|
2480
|
+
// src/components/components/NumberInput/index.tsx
|
|
2481
|
+
import { useI18n as useI18n7 } from "@pactor-app/runtime";
|
|
2482
|
+
import { ChevronDownIcon as ChevronDownIcon2, ChevronUpIcon } from "lucide-react";
|
|
2483
|
+
import { useEffect as useEffect9, useId as useId5, useState as useState12 } from "react";
|
|
2484
|
+
|
|
2485
|
+
// src/components/components/Form/form-item.tsx
|
|
2481
2486
|
import { jsx as jsx45, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2487
|
+
function FieldShell({
|
|
2488
|
+
layout,
|
|
2489
|
+
label,
|
|
2490
|
+
htmlFor,
|
|
2491
|
+
error,
|
|
2492
|
+
className,
|
|
2493
|
+
style,
|
|
2494
|
+
children
|
|
2495
|
+
}) {
|
|
2496
|
+
return /* @__PURE__ */ jsxs31(
|
|
2497
|
+
"div",
|
|
2498
|
+
{
|
|
2499
|
+
"data-slot": "form-item",
|
|
2500
|
+
className: cn(formItemClass(layout), className),
|
|
2501
|
+
style,
|
|
2502
|
+
children: [
|
|
2503
|
+
label ? /* @__PURE__ */ jsx45(
|
|
2504
|
+
"label",
|
|
2505
|
+
{
|
|
2506
|
+
htmlFor,
|
|
2507
|
+
className: "shrink-0 text-sm leading-none font-medium whitespace-nowrap",
|
|
2508
|
+
children: label
|
|
2509
|
+
}
|
|
2510
|
+
) : null,
|
|
2511
|
+
children,
|
|
2512
|
+
error ? /* @__PURE__ */ jsx45("div", { "data-slot": "form-error", className: "text-sm text-destructive", children: error }) : null
|
|
2513
|
+
]
|
|
2514
|
+
}
|
|
2515
|
+
);
|
|
2516
|
+
}
|
|
2517
|
+
|
|
2518
|
+
// src/components/components/NumberInput/index.tsx
|
|
2519
|
+
import { jsx as jsx46, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2520
|
+
function clamp(value, min, max) {
|
|
2521
|
+
let next = value;
|
|
2522
|
+
if (typeof min === "number" && next < min) next = min;
|
|
2523
|
+
if (typeof max === "number" && next > max) next = max;
|
|
2524
|
+
return next;
|
|
2525
|
+
}
|
|
2526
|
+
function applyPrecision(value, precision) {
|
|
2527
|
+
if (typeof precision !== "number") return value;
|
|
2528
|
+
const factor = 10 ** precision;
|
|
2529
|
+
return Math.round(value * factor) / factor;
|
|
2530
|
+
}
|
|
2531
|
+
function toDisplayText(value) {
|
|
2532
|
+
return typeof value === "number" && Number.isFinite(value) ? String(value) : "";
|
|
2533
|
+
}
|
|
2534
|
+
function NumberInput({
|
|
2535
|
+
name,
|
|
2536
|
+
label,
|
|
2537
|
+
rules,
|
|
2538
|
+
value,
|
|
2539
|
+
min,
|
|
2540
|
+
max,
|
|
2541
|
+
step = 1,
|
|
2542
|
+
precision,
|
|
2543
|
+
placeholder,
|
|
2544
|
+
disabled,
|
|
2545
|
+
onChange,
|
|
2546
|
+
className,
|
|
2547
|
+
controlClassName,
|
|
2548
|
+
style
|
|
2549
|
+
}) {
|
|
2550
|
+
const form = useFormContext();
|
|
2551
|
+
const { t } = useI18n7();
|
|
2552
|
+
const controlId = useId5();
|
|
2553
|
+
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
2554
|
+
useEffect9(() => {
|
|
2555
|
+
if (inForm && form && name) {
|
|
2556
|
+
form.registerField(name, rules, value);
|
|
2557
|
+
return () => form.unregisterField(name);
|
|
2558
|
+
}
|
|
2559
|
+
return void 0;
|
|
2560
|
+
});
|
|
2561
|
+
const fieldValue = inForm && form && name ? form.values[name] : void 0;
|
|
2562
|
+
const externalValue = typeof fieldValue === "number" ? fieldValue : inForm ? void 0 : typeof value === "number" ? value : void 0;
|
|
2563
|
+
const [text, setText] = useState12(() => toDisplayText(externalValue));
|
|
2564
|
+
useEffect9(() => {
|
|
2565
|
+
setText((current) => {
|
|
2566
|
+
const parsed = current === "" ? void 0 : Number(current);
|
|
2567
|
+
const currentNumber = parsed !== void 0 && Number.isFinite(parsed) ? applyPrecision(clamp(parsed, min, max), precision) : void 0;
|
|
2568
|
+
return currentNumber === externalValue ? current : toDisplayText(externalValue);
|
|
2569
|
+
});
|
|
2570
|
+
}, [externalValue, min, max, precision]);
|
|
2571
|
+
const commit = (next) => {
|
|
2572
|
+
if (inForm && form && name) {
|
|
2573
|
+
form.setValue(name, next);
|
|
2574
|
+
}
|
|
2575
|
+
onChange?.(next);
|
|
2576
|
+
};
|
|
2577
|
+
const stepBy = (direction) => {
|
|
2578
|
+
const base = externalValue ?? 0;
|
|
2579
|
+
const next = applyPrecision(clamp(base + direction * step, min, max), precision);
|
|
2580
|
+
setText(toDisplayText(next));
|
|
2581
|
+
commit(next);
|
|
2582
|
+
};
|
|
2583
|
+
const atMax = typeof max === "number" && externalValue !== void 0 && externalValue >= max;
|
|
2584
|
+
const atMin = typeof min === "number" && externalValue !== void 0 && externalValue <= min;
|
|
2585
|
+
const stepperClass = "flex flex-1 cursor-pointer items-center justify-center text-muted-foreground transition-colors hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50";
|
|
2586
|
+
const control = /* @__PURE__ */ jsxs32(
|
|
2587
|
+
"span",
|
|
2588
|
+
{
|
|
2589
|
+
"data-slot": "number-input",
|
|
2590
|
+
className: cn("relative block", !inForm && className),
|
|
2591
|
+
style: !inForm ? style : void 0,
|
|
2592
|
+
children: [
|
|
2593
|
+
/* @__PURE__ */ jsx46(
|
|
2594
|
+
Input,
|
|
2595
|
+
{
|
|
2596
|
+
id: controlId,
|
|
2597
|
+
type: "number",
|
|
2598
|
+
value: text,
|
|
2599
|
+
min,
|
|
2600
|
+
max,
|
|
2601
|
+
step,
|
|
2602
|
+
placeholder,
|
|
2603
|
+
disabled,
|
|
2604
|
+
className: cn(
|
|
2605
|
+
"pr-7 [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
|
|
2606
|
+
controlClassName
|
|
2607
|
+
),
|
|
2608
|
+
onChange: (event) => {
|
|
2609
|
+
const raw = event.target.value;
|
|
2610
|
+
setText(raw);
|
|
2611
|
+
if (raw === "") {
|
|
2612
|
+
commit(void 0);
|
|
2613
|
+
return;
|
|
2614
|
+
}
|
|
2615
|
+
const parsed = Number(raw);
|
|
2616
|
+
if (!Number.isFinite(parsed)) return;
|
|
2617
|
+
commit(applyPrecision(clamp(parsed, min, max), precision));
|
|
2618
|
+
}
|
|
2619
|
+
}
|
|
2620
|
+
),
|
|
2621
|
+
/* @__PURE__ */ jsxs32("span", { className: "absolute inset-y-0 right-0 flex w-7 flex-col divide-y divide-input border-l border-input", children: [
|
|
2622
|
+
/* @__PURE__ */ jsx46(
|
|
2623
|
+
"button",
|
|
2624
|
+
{
|
|
2625
|
+
type: "button",
|
|
2626
|
+
tabIndex: -1,
|
|
2627
|
+
"aria-label": t("pactor.numberInput.increase"),
|
|
2628
|
+
disabled: disabled === true || atMax,
|
|
2629
|
+
className: stepperClass,
|
|
2630
|
+
onClick: () => stepBy(1),
|
|
2631
|
+
children: /* @__PURE__ */ jsx46(ChevronUpIcon, { className: "size-3" })
|
|
2632
|
+
}
|
|
2633
|
+
),
|
|
2634
|
+
/* @__PURE__ */ jsx46(
|
|
2635
|
+
"button",
|
|
2636
|
+
{
|
|
2637
|
+
type: "button",
|
|
2638
|
+
tabIndex: -1,
|
|
2639
|
+
"aria-label": t("pactor.numberInput.decrease"),
|
|
2640
|
+
disabled: disabled === true || atMin,
|
|
2641
|
+
className: stepperClass,
|
|
2642
|
+
onClick: () => stepBy(-1),
|
|
2643
|
+
children: /* @__PURE__ */ jsx46(ChevronDownIcon2, { className: "size-3" })
|
|
2644
|
+
}
|
|
2645
|
+
)
|
|
2646
|
+
] })
|
|
2647
|
+
]
|
|
2648
|
+
}
|
|
2649
|
+
);
|
|
2650
|
+
if (inForm && form && name) {
|
|
2651
|
+
return /* @__PURE__ */ jsx46(
|
|
2652
|
+
FieldShell,
|
|
2653
|
+
{
|
|
2654
|
+
layout: form.layout,
|
|
2655
|
+
label,
|
|
2656
|
+
htmlFor: controlId,
|
|
2657
|
+
error: form.errors[name],
|
|
2658
|
+
className,
|
|
2659
|
+
style,
|
|
2660
|
+
children: control
|
|
2661
|
+
}
|
|
2662
|
+
);
|
|
2663
|
+
}
|
|
2664
|
+
return control;
|
|
2665
|
+
}
|
|
2666
|
+
|
|
2667
|
+
// src/components/components/Page/index.tsx
|
|
2668
|
+
import { jsx as jsx47, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2482
2669
|
function Page({ title, className, style, children }) {
|
|
2483
|
-
return /* @__PURE__ */
|
|
2484
|
-
title ? /* @__PURE__ */
|
|
2485
|
-
/* @__PURE__ */
|
|
2670
|
+
return /* @__PURE__ */ jsxs33("div", { "data-slot": "page", className: cn("p-6", className), style, children: [
|
|
2671
|
+
title ? /* @__PURE__ */ jsx47("h2", { "data-slot": "page-title", className: "mb-5 text-xl font-semibold", children: title }) : null,
|
|
2672
|
+
/* @__PURE__ */ jsx47("div", { "data-slot": "page-content", className: "space-y-5", children })
|
|
2486
2673
|
] });
|
|
2487
2674
|
}
|
|
2488
2675
|
|
|
2489
2676
|
// src/components/components/Pagination/index.tsx
|
|
2490
|
-
import { useState as
|
|
2491
|
-
import { jsx as
|
|
2677
|
+
import { useState as useState13 } from "react";
|
|
2678
|
+
import { jsx as jsx48, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
2492
2679
|
function pageItems(current, count) {
|
|
2493
2680
|
if (count <= 7) {
|
|
2494
2681
|
return Array.from({ length: count }, (_, i) => i + 1);
|
|
@@ -2509,7 +2696,7 @@ function Pagination2({
|
|
|
2509
2696
|
className,
|
|
2510
2697
|
style
|
|
2511
2698
|
}) {
|
|
2512
|
-
const [innerPage, setInnerPage] =
|
|
2699
|
+
const [innerPage, setInnerPage] = useState13(1);
|
|
2513
2700
|
const pageCount = Math.max(1, Math.ceil(total / Math.max(1, pageSize)));
|
|
2514
2701
|
const current = Math.min(Math.max(1, page ?? innerPage), pageCount);
|
|
2515
2702
|
const goTo = (next) => {
|
|
@@ -2522,8 +2709,8 @@ function Pagination2({
|
|
|
2522
2709
|
}
|
|
2523
2710
|
onChange?.(target);
|
|
2524
2711
|
};
|
|
2525
|
-
return /* @__PURE__ */
|
|
2526
|
-
/* @__PURE__ */
|
|
2712
|
+
return /* @__PURE__ */ jsx48(Pagination, { className, style, children: /* @__PURE__ */ jsxs34(PaginationContent, { children: [
|
|
2713
|
+
/* @__PURE__ */ jsx48(PaginationItem, { children: /* @__PURE__ */ jsx48(
|
|
2527
2714
|
PaginationPrevious,
|
|
2528
2715
|
{
|
|
2529
2716
|
href: "#",
|
|
@@ -2534,7 +2721,7 @@ function Pagination2({
|
|
|
2534
2721
|
}
|
|
2535
2722
|
}
|
|
2536
2723
|
) }),
|
|
2537
|
-
pageItems(current, pageCount).map((item, index) => /* @__PURE__ */
|
|
2724
|
+
pageItems(current, pageCount).map((item, index) => /* @__PURE__ */ jsx48(PaginationItem, { children: item === "ellipsis" ? /* @__PURE__ */ jsx48(PaginationEllipsis, {}) : /* @__PURE__ */ jsx48(
|
|
2538
2725
|
PaginationLink,
|
|
2539
2726
|
{
|
|
2540
2727
|
href: "#",
|
|
@@ -2546,7 +2733,7 @@ function Pagination2({
|
|
|
2546
2733
|
children: item
|
|
2547
2734
|
}
|
|
2548
2735
|
) }, item === "ellipsis" ? `ellipsis-${index}` : item)),
|
|
2549
|
-
/* @__PURE__ */
|
|
2736
|
+
/* @__PURE__ */ jsx48(PaginationItem, { children: /* @__PURE__ */ jsx48(
|
|
2550
2737
|
PaginationNext,
|
|
2551
2738
|
{
|
|
2552
2739
|
href: "#",
|
|
@@ -2562,14 +2749,14 @@ function Pagination2({
|
|
|
2562
2749
|
|
|
2563
2750
|
// src/components/components/Popover/index.tsx
|
|
2564
2751
|
import { useRenderer as useRenderer12 } from "@pactor-app/runtime";
|
|
2565
|
-
import { jsx as
|
|
2752
|
+
import { jsx as jsx49, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
2566
2753
|
function isDslNode3(value) {
|
|
2567
2754
|
return typeof value === "object" && value !== null && typeof value.type === "string";
|
|
2568
2755
|
}
|
|
2569
2756
|
function Popover2({ content, children, className, style }) {
|
|
2570
2757
|
const { renderChildren } = useRenderer12();
|
|
2571
|
-
return /* @__PURE__ */
|
|
2572
|
-
/* @__PURE__ */
|
|
2758
|
+
return /* @__PURE__ */ jsxs35(Popover, { children: [
|
|
2759
|
+
/* @__PURE__ */ jsx49(
|
|
2573
2760
|
PopoverTrigger,
|
|
2574
2761
|
{
|
|
2575
2762
|
nativeButton: false,
|
|
@@ -2577,55 +2764,20 @@ function Popover2({ content, children, className, style }) {
|
|
|
2577
2764
|
children
|
|
2578
2765
|
}
|
|
2579
2766
|
),
|
|
2580
|
-
/* @__PURE__ */
|
|
2767
|
+
/* @__PURE__ */ jsx49(PopoverContent, { className, style, children: isDslNode3(content) ? renderChildren([content]) : content })
|
|
2581
2768
|
] });
|
|
2582
2769
|
}
|
|
2583
2770
|
|
|
2584
2771
|
// src/components/components/Progress/index.tsx
|
|
2585
|
-
import { jsx as
|
|
2772
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
2586
2773
|
function Progress2({ value, className, style }) {
|
|
2587
2774
|
const resolved = typeof value === "number" && Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : null;
|
|
2588
|
-
return /* @__PURE__ */
|
|
2775
|
+
return /* @__PURE__ */ jsx50(Progress, { value: resolved, className, style, children: /* @__PURE__ */ jsx50(ProgressTrack, { children: /* @__PURE__ */ jsx50(ProgressIndicator, {}) }) });
|
|
2589
2776
|
}
|
|
2590
2777
|
|
|
2591
2778
|
// src/components/components/RadioGroup/index.tsx
|
|
2592
|
-
import { useEffect as
|
|
2593
|
-
|
|
2594
|
-
// src/components/components/Form/form-item.tsx
|
|
2595
|
-
import { jsx as jsx49, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
2596
|
-
function FieldShell({
|
|
2597
|
-
layout,
|
|
2598
|
-
label,
|
|
2599
|
-
htmlFor,
|
|
2600
|
-
error,
|
|
2601
|
-
className,
|
|
2602
|
-
style,
|
|
2603
|
-
children
|
|
2604
|
-
}) {
|
|
2605
|
-
return /* @__PURE__ */ jsxs34(
|
|
2606
|
-
"div",
|
|
2607
|
-
{
|
|
2608
|
-
"data-slot": "form-item",
|
|
2609
|
-
className: cn(formItemClass(layout), className),
|
|
2610
|
-
style,
|
|
2611
|
-
children: [
|
|
2612
|
-
label ? /* @__PURE__ */ jsx49(
|
|
2613
|
-
"label",
|
|
2614
|
-
{
|
|
2615
|
-
htmlFor,
|
|
2616
|
-
className: "shrink-0 text-sm leading-none font-medium whitespace-nowrap",
|
|
2617
|
-
children: label
|
|
2618
|
-
}
|
|
2619
|
-
) : null,
|
|
2620
|
-
children,
|
|
2621
|
-
error ? /* @__PURE__ */ jsx49("div", { "data-slot": "form-error", className: "text-sm text-destructive", children: error }) : null
|
|
2622
|
-
]
|
|
2623
|
-
}
|
|
2624
|
-
);
|
|
2625
|
-
}
|
|
2626
|
-
|
|
2627
|
-
// src/components/components/RadioGroup/index.tsx
|
|
2628
|
-
import { jsx as jsx50, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
2779
|
+
import { useEffect as useEffect10, useId as useId6 } from "react";
|
|
2780
|
+
import { jsx as jsx51, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
2629
2781
|
function RadioGroup2({
|
|
2630
2782
|
name,
|
|
2631
2783
|
label,
|
|
@@ -2639,9 +2791,9 @@ function RadioGroup2({
|
|
|
2639
2791
|
style
|
|
2640
2792
|
}) {
|
|
2641
2793
|
const form = useFormContext();
|
|
2642
|
-
const controlId =
|
|
2794
|
+
const controlId = useId6();
|
|
2643
2795
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
2644
|
-
|
|
2796
|
+
useEffect10(() => {
|
|
2645
2797
|
if (inForm && form && name) {
|
|
2646
2798
|
form.registerField(name, rules, value);
|
|
2647
2799
|
return () => form.unregisterField(name);
|
|
@@ -2656,7 +2808,7 @@ function RadioGroup2({
|
|
|
2656
2808
|
onChange?.(next);
|
|
2657
2809
|
};
|
|
2658
2810
|
const groupValue = current ?? "";
|
|
2659
|
-
const group = /* @__PURE__ */
|
|
2811
|
+
const group = /* @__PURE__ */ jsx51(
|
|
2660
2812
|
RadioGroup,
|
|
2661
2813
|
{
|
|
2662
2814
|
value: groupValue,
|
|
@@ -2671,8 +2823,8 @@ function RadioGroup2({
|
|
|
2671
2823
|
children: options.map((option, index) => {
|
|
2672
2824
|
const optionId = `${controlId}-${index}`;
|
|
2673
2825
|
const optionDisabled = disabled || option.disabled;
|
|
2674
|
-
return /* @__PURE__ */
|
|
2675
|
-
/* @__PURE__ */
|
|
2826
|
+
return /* @__PURE__ */ jsxs36("span", { className: "inline-flex items-center gap-2", children: [
|
|
2827
|
+
/* @__PURE__ */ jsx51(
|
|
2676
2828
|
RadioGroupItem,
|
|
2677
2829
|
{
|
|
2678
2830
|
id: optionId,
|
|
@@ -2680,7 +2832,7 @@ function RadioGroup2({
|
|
|
2680
2832
|
disabled: option.disabled
|
|
2681
2833
|
}
|
|
2682
2834
|
),
|
|
2683
|
-
/* @__PURE__ */
|
|
2835
|
+
/* @__PURE__ */ jsx51(
|
|
2684
2836
|
"label",
|
|
2685
2837
|
{
|
|
2686
2838
|
htmlFor: optionId,
|
|
@@ -2696,7 +2848,7 @@ function RadioGroup2({
|
|
|
2696
2848
|
}
|
|
2697
2849
|
);
|
|
2698
2850
|
if (inForm && form && name) {
|
|
2699
|
-
return /* @__PURE__ */
|
|
2851
|
+
return /* @__PURE__ */ jsx51(
|
|
2700
2852
|
FieldShell,
|
|
2701
2853
|
{
|
|
2702
2854
|
layout: form.layout,
|
|
@@ -2714,7 +2866,7 @@ function RadioGroup2({
|
|
|
2714
2866
|
// src/components/components/Resizable/index.tsx
|
|
2715
2867
|
import { useRenderer as useRenderer13 } from "@pactor-app/runtime";
|
|
2716
2868
|
import { Fragment as Fragment4 } from "react";
|
|
2717
|
-
import { jsx as
|
|
2869
|
+
import { jsx as jsx52, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
2718
2870
|
function Resizable({
|
|
2719
2871
|
panels = [],
|
|
2720
2872
|
direction = "horizontal",
|
|
@@ -2722,9 +2874,9 @@ function Resizable({
|
|
|
2722
2874
|
style
|
|
2723
2875
|
}) {
|
|
2724
2876
|
const { renderChildren } = useRenderer13();
|
|
2725
|
-
return /* @__PURE__ */
|
|
2726
|
-
index > 0 ? /* @__PURE__ */
|
|
2727
|
-
/* @__PURE__ */
|
|
2877
|
+
return /* @__PURE__ */ jsx52(PanelGroup, { orientation: direction, className, style, children: panels.map((panel, index) => /* @__PURE__ */ jsxs37(Fragment4, { children: [
|
|
2878
|
+
index > 0 ? /* @__PURE__ */ jsx52(ResizableHandle, { withHandle: true }) : null,
|
|
2879
|
+
/* @__PURE__ */ jsx52(
|
|
2728
2880
|
Panel,
|
|
2729
2881
|
{
|
|
2730
2882
|
defaultSize: typeof panel.defaultSizePx === "number" ? `${panel.defaultSizePx}px` : typeof panel.defaultSize === "number" ? `${panel.defaultSize}%` : void 0,
|
|
@@ -2737,7 +2889,7 @@ function Resizable({
|
|
|
2737
2889
|
}
|
|
2738
2890
|
|
|
2739
2891
|
// src/components/components/ScrollArea/index.tsx
|
|
2740
|
-
import { jsx as
|
|
2892
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
2741
2893
|
function ScrollArea2({
|
|
2742
2894
|
maxHeight,
|
|
2743
2895
|
maxWidth,
|
|
@@ -2745,7 +2897,7 @@ function ScrollArea2({
|
|
|
2745
2897
|
style,
|
|
2746
2898
|
children
|
|
2747
2899
|
}) {
|
|
2748
|
-
return /* @__PURE__ */
|
|
2900
|
+
return /* @__PURE__ */ jsx53(
|
|
2749
2901
|
ScrollArea,
|
|
2750
2902
|
{
|
|
2751
2903
|
className,
|
|
@@ -2756,9 +2908,9 @@ function ScrollArea2({
|
|
|
2756
2908
|
}
|
|
2757
2909
|
|
|
2758
2910
|
// src/components/components/Select/index.tsx
|
|
2759
|
-
import { useI18n as
|
|
2760
|
-
import { useEffect as
|
|
2761
|
-
import { jsx as
|
|
2911
|
+
import { useI18n as useI18n8 } from "@pactor-app/runtime";
|
|
2912
|
+
import { useEffect as useEffect11, useId as useId7 } from "react";
|
|
2913
|
+
import { jsx as jsx54, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
2762
2914
|
function Select2({
|
|
2763
2915
|
name,
|
|
2764
2916
|
label,
|
|
@@ -2774,10 +2926,10 @@ function Select2({
|
|
|
2774
2926
|
style
|
|
2775
2927
|
}) {
|
|
2776
2928
|
const form = useFormContext();
|
|
2777
|
-
const { t } =
|
|
2778
|
-
const controlId =
|
|
2929
|
+
const { t } = useI18n8();
|
|
2930
|
+
const controlId = useId7();
|
|
2779
2931
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
2780
|
-
|
|
2932
|
+
useEffect11(() => {
|
|
2781
2933
|
if (inForm && form && name) {
|
|
2782
2934
|
form.registerField(name, rules, value);
|
|
2783
2935
|
return () => form.unregisterField(name);
|
|
@@ -2793,7 +2945,7 @@ function Select2({
|
|
|
2793
2945
|
onChange?.(next ?? void 0);
|
|
2794
2946
|
};
|
|
2795
2947
|
const inFormRoot = inForm === true;
|
|
2796
|
-
const select = /* @__PURE__ */
|
|
2948
|
+
const select = /* @__PURE__ */ jsxs38(
|
|
2797
2949
|
"span",
|
|
2798
2950
|
{
|
|
2799
2951
|
className: cn(
|
|
@@ -2804,7 +2956,7 @@ function Select2({
|
|
|
2804
2956
|
),
|
|
2805
2957
|
style: inFormRoot ? void 0 : style,
|
|
2806
2958
|
children: [
|
|
2807
|
-
/* @__PURE__ */
|
|
2959
|
+
/* @__PURE__ */ jsxs38(
|
|
2808
2960
|
Select,
|
|
2809
2961
|
{
|
|
2810
2962
|
items: options,
|
|
@@ -2813,8 +2965,8 @@ function Select2({
|
|
|
2813
2965
|
disabled,
|
|
2814
2966
|
name: inForm ? name : void 0,
|
|
2815
2967
|
children: [
|
|
2816
|
-
/* @__PURE__ */
|
|
2817
|
-
/* @__PURE__ */
|
|
2968
|
+
/* @__PURE__ */ jsx54(SelectTrigger, { id: controlId, className: inFormRoot ? "w-full" : void 0, children: /* @__PURE__ */ jsx54(SelectValue, { placeholder }) }),
|
|
2969
|
+
/* @__PURE__ */ jsx54(SelectContent, { children: options.map((option) => /* @__PURE__ */ jsx54(
|
|
2818
2970
|
SelectItem,
|
|
2819
2971
|
{
|
|
2820
2972
|
value: option.value,
|
|
@@ -2826,7 +2978,7 @@ function Select2({
|
|
|
2826
2978
|
]
|
|
2827
2979
|
}
|
|
2828
2980
|
),
|
|
2829
|
-
allowClear && selectedValue !== null && !disabled ? /* @__PURE__ */
|
|
2981
|
+
allowClear && selectedValue !== null && !disabled ? /* @__PURE__ */ jsx54(
|
|
2830
2982
|
"button",
|
|
2831
2983
|
{
|
|
2832
2984
|
type: "button",
|
|
@@ -2846,14 +2998,14 @@ function Select2({
|
|
|
2846
2998
|
);
|
|
2847
2999
|
if (inForm && form && name) {
|
|
2848
3000
|
const error = form.errors[name];
|
|
2849
|
-
return /* @__PURE__ */
|
|
3001
|
+
return /* @__PURE__ */ jsxs38(
|
|
2850
3002
|
"div",
|
|
2851
3003
|
{
|
|
2852
3004
|
"data-slot": "form-item",
|
|
2853
3005
|
className: cn(formItemClass(form.layout), className),
|
|
2854
3006
|
style,
|
|
2855
3007
|
children: [
|
|
2856
|
-
label ? /* @__PURE__ */
|
|
3008
|
+
label ? /* @__PURE__ */ jsx54(
|
|
2857
3009
|
"label",
|
|
2858
3010
|
{
|
|
2859
3011
|
htmlFor: controlId,
|
|
@@ -2862,7 +3014,7 @@ function Select2({
|
|
|
2862
3014
|
}
|
|
2863
3015
|
) : null,
|
|
2864
3016
|
select,
|
|
2865
|
-
error ? /* @__PURE__ */
|
|
3017
|
+
error ? /* @__PURE__ */ jsx54("div", { "data-slot": "form-error", className: "text-sm text-destructive", children: error }) : null
|
|
2866
3018
|
]
|
|
2867
3019
|
}
|
|
2868
3020
|
);
|
|
@@ -2871,13 +3023,13 @@ function Select2({
|
|
|
2871
3023
|
}
|
|
2872
3024
|
|
|
2873
3025
|
// src/components/components/Separator/index.tsx
|
|
2874
|
-
import { jsx as
|
|
3026
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
2875
3027
|
function Separator2({ orientation = "horizontal", className, style }) {
|
|
2876
|
-
return /* @__PURE__ */
|
|
3028
|
+
return /* @__PURE__ */ jsx55(Separator, { orientation, className, style });
|
|
2877
3029
|
}
|
|
2878
3030
|
|
|
2879
3031
|
// src/components/components/Sheet/index.tsx
|
|
2880
|
-
import { jsx as
|
|
3032
|
+
import { jsx as jsx56, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
2881
3033
|
function Sheet2({
|
|
2882
3034
|
title,
|
|
2883
3035
|
open,
|
|
@@ -2887,7 +3039,7 @@ function Sheet2({
|
|
|
2887
3039
|
className,
|
|
2888
3040
|
style
|
|
2889
3041
|
}) {
|
|
2890
|
-
return /* @__PURE__ */
|
|
3042
|
+
return /* @__PURE__ */ jsx56(
|
|
2891
3043
|
Sheet,
|
|
2892
3044
|
{
|
|
2893
3045
|
open: open ?? false,
|
|
@@ -2896,9 +3048,9 @@ function Sheet2({
|
|
|
2896
3048
|
onClose?.();
|
|
2897
3049
|
}
|
|
2898
3050
|
},
|
|
2899
|
-
children: /* @__PURE__ */
|
|
2900
|
-
title ? /* @__PURE__ */
|
|
2901
|
-
/* @__PURE__ */
|
|
3051
|
+
children: /* @__PURE__ */ jsxs39(SheetContent, { side, className, style, children: [
|
|
3052
|
+
title ? /* @__PURE__ */ jsx56(SheetHeader, { children: /* @__PURE__ */ jsx56(SheetTitle, { children: title }) }) : null,
|
|
3053
|
+
/* @__PURE__ */ jsx56("div", { className: "flex-1 overflow-auto px-4", children })
|
|
2902
3054
|
] })
|
|
2903
3055
|
}
|
|
2904
3056
|
);
|
|
@@ -2906,7 +3058,7 @@ function Sheet2({
|
|
|
2906
3058
|
|
|
2907
3059
|
// src/components/components/Sider/index.tsx
|
|
2908
3060
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
2909
|
-
import { jsx as
|
|
3061
|
+
import { jsx as jsx57, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
2910
3062
|
function Sider({
|
|
2911
3063
|
width = 200,
|
|
2912
3064
|
collapsible,
|
|
@@ -2918,7 +3070,7 @@ function Sider({
|
|
|
2918
3070
|
children
|
|
2919
3071
|
}) {
|
|
2920
3072
|
const current = collapsed ? collapsedWidth : width;
|
|
2921
|
-
return /* @__PURE__ */
|
|
3073
|
+
return /* @__PURE__ */ jsxs40(
|
|
2922
3074
|
"aside",
|
|
2923
3075
|
{
|
|
2924
3076
|
"data-slot": "layout-sider",
|
|
@@ -2929,15 +3081,15 @@ function Sider({
|
|
|
2929
3081
|
),
|
|
2930
3082
|
style: { width: current, ...style },
|
|
2931
3083
|
children: [
|
|
2932
|
-
/* @__PURE__ */
|
|
2933
|
-
collapsible ? /* @__PURE__ */
|
|
3084
|
+
/* @__PURE__ */ jsx57("div", { className: "min-h-0 flex-1 overflow-auto", children }),
|
|
3085
|
+
collapsible ? /* @__PURE__ */ jsx57(
|
|
2934
3086
|
"button",
|
|
2935
3087
|
{
|
|
2936
3088
|
type: "button",
|
|
2937
3089
|
"aria-label": collapsed ? "expand sider" : "collapse sider",
|
|
2938
3090
|
className: "flex h-10 shrink-0 items-center justify-center border-t text-muted-foreground hover:text-foreground",
|
|
2939
3091
|
onClick: () => onCollapse?.(!collapsed),
|
|
2940
|
-
children: collapsed ? /* @__PURE__ */
|
|
3092
|
+
children: collapsed ? /* @__PURE__ */ jsx57(ChevronRight, { "aria-hidden": true, className: "size-4" }) : /* @__PURE__ */ jsx57(ChevronLeft, { "aria-hidden": true, className: "size-4" })
|
|
2941
3093
|
}
|
|
2942
3094
|
) : null
|
|
2943
3095
|
]
|
|
@@ -2946,7 +3098,7 @@ function Sider({
|
|
|
2946
3098
|
}
|
|
2947
3099
|
|
|
2948
3100
|
// src/components/components/Skeleton/index.tsx
|
|
2949
|
-
import { jsx as
|
|
3101
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
2950
3102
|
var shapeDefaults = {
|
|
2951
3103
|
line: { className: "h-4 w-full", style: {} },
|
|
2952
3104
|
circle: { className: "rounded-full", style: { width: 40, height: 40 } },
|
|
@@ -2957,7 +3109,7 @@ function toSize(value) {
|
|
|
2957
3109
|
}
|
|
2958
3110
|
function Skeleton2({ shape = "line", width, height, className, style }) {
|
|
2959
3111
|
const defaults = shapeDefaults[shape];
|
|
2960
|
-
return /* @__PURE__ */
|
|
3112
|
+
return /* @__PURE__ */ jsx58(
|
|
2961
3113
|
Skeleton,
|
|
2962
3114
|
{
|
|
2963
3115
|
className: cn(defaults.className, className),
|
|
@@ -2972,8 +3124,8 @@ function Skeleton2({ shape = "line", width, height, className, style }) {
|
|
|
2972
3124
|
}
|
|
2973
3125
|
|
|
2974
3126
|
// src/components/components/Slider/index.tsx
|
|
2975
|
-
import { useEffect as
|
|
2976
|
-
import { jsx as
|
|
3127
|
+
import { useEffect as useEffect12 } from "react";
|
|
3128
|
+
import { jsx as jsx59, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
2977
3129
|
function Slider2({
|
|
2978
3130
|
name,
|
|
2979
3131
|
label,
|
|
@@ -2989,7 +3141,7 @@ function Slider2({
|
|
|
2989
3141
|
}) {
|
|
2990
3142
|
const form = useFormContext();
|
|
2991
3143
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
2992
|
-
|
|
3144
|
+
useEffect12(() => {
|
|
2993
3145
|
if (inForm && form && name) {
|
|
2994
3146
|
form.registerField(name, rules, value);
|
|
2995
3147
|
return () => form.unregisterField(name);
|
|
@@ -3004,7 +3156,7 @@ function Slider2({
|
|
|
3004
3156
|
}
|
|
3005
3157
|
onChange?.(next);
|
|
3006
3158
|
};
|
|
3007
|
-
const slider = /* @__PURE__ */
|
|
3159
|
+
const slider = /* @__PURE__ */ jsx59(
|
|
3008
3160
|
Slider,
|
|
3009
3161
|
{
|
|
3010
3162
|
value: numberValue,
|
|
@@ -3016,14 +3168,14 @@ function Slider2({
|
|
|
3016
3168
|
onValueChange: handleChange,
|
|
3017
3169
|
className: inForm ? void 0 : className,
|
|
3018
3170
|
style: inForm ? void 0 : style,
|
|
3019
|
-
children: /* @__PURE__ */
|
|
3020
|
-
/* @__PURE__ */
|
|
3021
|
-
/* @__PURE__ */
|
|
3171
|
+
children: /* @__PURE__ */ jsxs41(SliderControl, { children: [
|
|
3172
|
+
/* @__PURE__ */ jsx59(SliderTrack, { children: /* @__PURE__ */ jsx59(SliderIndicator, {}) }),
|
|
3173
|
+
/* @__PURE__ */ jsx59(SliderThumb, {})
|
|
3022
3174
|
] })
|
|
3023
3175
|
}
|
|
3024
3176
|
);
|
|
3025
3177
|
if (inForm && form && name) {
|
|
3026
|
-
return /* @__PURE__ */
|
|
3178
|
+
return /* @__PURE__ */ jsx59(
|
|
3027
3179
|
FieldShell,
|
|
3028
3180
|
{
|
|
3029
3181
|
layout: form.layout,
|
|
@@ -3040,11 +3192,11 @@ function Slider2({
|
|
|
3040
3192
|
|
|
3041
3193
|
// src/components/components/Sonner/index.tsx
|
|
3042
3194
|
import { useRenderer as useRenderer14 } from "@pactor-app/runtime";
|
|
3043
|
-
import { useEffect as
|
|
3044
|
-
import { jsx as
|
|
3195
|
+
import { useEffect as useEffect13 } from "react";
|
|
3196
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
3045
3197
|
function Sonner({ className, style }) {
|
|
3046
3198
|
const { context } = useRenderer14();
|
|
3047
|
-
|
|
3199
|
+
useEffect13(() => {
|
|
3048
3200
|
const { actions } = context;
|
|
3049
3201
|
if (actions.has("toast")) {
|
|
3050
3202
|
return;
|
|
@@ -3058,36 +3210,36 @@ function Sonner({ className, style }) {
|
|
|
3058
3210
|
return { ok: true };
|
|
3059
3211
|
});
|
|
3060
3212
|
}, [context]);
|
|
3061
|
-
return /* @__PURE__ */
|
|
3213
|
+
return /* @__PURE__ */ jsx60("div", { "data-slot": "sonner", className, style, children: /* @__PURE__ */ jsx60(Toaster, {}) });
|
|
3062
3214
|
}
|
|
3063
3215
|
|
|
3064
3216
|
// src/components/components/Spinner/index.tsx
|
|
3065
|
-
import { jsx as
|
|
3217
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
3066
3218
|
var sizeClass = {
|
|
3067
3219
|
sm: "size-3",
|
|
3068
3220
|
default: "size-4",
|
|
3069
3221
|
lg: "size-6"
|
|
3070
3222
|
};
|
|
3071
3223
|
function Spinner2({ size = "default", className, style }) {
|
|
3072
|
-
return /* @__PURE__ */
|
|
3224
|
+
return /* @__PURE__ */ jsx61(Spinner, { className: cn(sizeClass[size], className), style });
|
|
3073
3225
|
}
|
|
3074
3226
|
|
|
3075
3227
|
// src/components/components/Statistic/index.tsx
|
|
3076
|
-
import { jsx as
|
|
3228
|
+
import { jsx as jsx62, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
3077
3229
|
function Statistic({ title, value, precision, suffix, className, style }) {
|
|
3078
3230
|
const display = typeof value === "number" && precision !== void 0 ? value.toFixed(precision) : value;
|
|
3079
|
-
return /* @__PURE__ */
|
|
3080
|
-
title ? /* @__PURE__ */
|
|
3081
|
-
/* @__PURE__ */
|
|
3231
|
+
return /* @__PURE__ */ jsxs42("div", { "data-slot": "statistic", className: cn(className), style, children: [
|
|
3232
|
+
title ? /* @__PURE__ */ jsx62("div", { "data-slot": "statistic-title", className: "text-sm text-muted-foreground", children: title }) : null,
|
|
3233
|
+
/* @__PURE__ */ jsxs42("div", { "data-slot": "statistic-value", className: "text-2xl font-bold tabular-nums", children: [
|
|
3082
3234
|
display,
|
|
3083
|
-
suffix ? /* @__PURE__ */
|
|
3235
|
+
suffix ? /* @__PURE__ */ jsx62("span", { className: "ml-1 text-sm font-normal text-muted-foreground", children: suffix }) : null
|
|
3084
3236
|
] })
|
|
3085
3237
|
] });
|
|
3086
3238
|
}
|
|
3087
3239
|
|
|
3088
3240
|
// src/components/components/Switch/index.tsx
|
|
3089
|
-
import { useEffect as
|
|
3090
|
-
import { jsx as
|
|
3241
|
+
import { useEffect as useEffect14, useId as useId8 } from "react";
|
|
3242
|
+
import { jsx as jsx63, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
3091
3243
|
function Switch2({
|
|
3092
3244
|
name,
|
|
3093
3245
|
label,
|
|
@@ -3099,9 +3251,9 @@ function Switch2({
|
|
|
3099
3251
|
style
|
|
3100
3252
|
}) {
|
|
3101
3253
|
const form = useFormContext();
|
|
3102
|
-
const controlId =
|
|
3254
|
+
const controlId = useId8();
|
|
3103
3255
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
3104
|
-
|
|
3256
|
+
useEffect14(() => {
|
|
3105
3257
|
if (inForm && form && name) {
|
|
3106
3258
|
form.registerField(name, rules, value);
|
|
3107
3259
|
return () => form.unregisterField(name);
|
|
@@ -3116,13 +3268,13 @@ function Switch2({
|
|
|
3116
3268
|
}
|
|
3117
3269
|
onChange?.(next);
|
|
3118
3270
|
};
|
|
3119
|
-
const control = /* @__PURE__ */
|
|
3271
|
+
const control = /* @__PURE__ */ jsxs43(
|
|
3120
3272
|
"span",
|
|
3121
3273
|
{
|
|
3122
3274
|
className: cn("inline-flex items-center gap-2", !inForm && className),
|
|
3123
3275
|
style: inForm ? void 0 : style,
|
|
3124
3276
|
children: [
|
|
3125
|
-
/* @__PURE__ */
|
|
3277
|
+
/* @__PURE__ */ jsx63(
|
|
3126
3278
|
Switch,
|
|
3127
3279
|
{
|
|
3128
3280
|
id: controlId,
|
|
@@ -3132,12 +3284,12 @@ function Switch2({
|
|
|
3132
3284
|
onCheckedChange: handleChange
|
|
3133
3285
|
}
|
|
3134
3286
|
),
|
|
3135
|
-
label ? /* @__PURE__ */
|
|
3287
|
+
label ? /* @__PURE__ */ jsx63("label", { htmlFor: controlId, className: "text-sm leading-none font-medium", children: label }) : null
|
|
3136
3288
|
]
|
|
3137
3289
|
}
|
|
3138
3290
|
);
|
|
3139
3291
|
if (inForm && form && name) {
|
|
3140
|
-
return /* @__PURE__ */
|
|
3292
|
+
return /* @__PURE__ */ jsxs43(
|
|
3141
3293
|
"div",
|
|
3142
3294
|
{
|
|
3143
3295
|
"data-slot": "form-item",
|
|
@@ -3145,7 +3297,7 @@ function Switch2({
|
|
|
3145
3297
|
style,
|
|
3146
3298
|
children: [
|
|
3147
3299
|
control,
|
|
3148
|
-
form.errors[name] ? /* @__PURE__ */
|
|
3300
|
+
form.errors[name] ? /* @__PURE__ */ jsx63("div", { "data-slot": "form-error", className: "mt-1.5 text-sm text-destructive", children: form.errors[name] }) : null
|
|
3149
3301
|
]
|
|
3150
3302
|
}
|
|
3151
3303
|
);
|
|
@@ -3154,9 +3306,9 @@ function Switch2({
|
|
|
3154
3306
|
}
|
|
3155
3307
|
|
|
3156
3308
|
// src/components/components/Table/index.tsx
|
|
3157
|
-
import { useI18n as
|
|
3158
|
-
import { useState as
|
|
3159
|
-
import { jsx as
|
|
3309
|
+
import { useI18n as useI18n9, useRenderer as useRenderer15 } from "@pactor-app/runtime";
|
|
3310
|
+
import { useState as useState14 } from "react";
|
|
3311
|
+
import { jsx as jsx64, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
3160
3312
|
function renderCellValue2(value) {
|
|
3161
3313
|
if (value === void 0 || value === null) {
|
|
3162
3314
|
return "";
|
|
@@ -3166,6 +3318,11 @@ function renderCellValue2(value) {
|
|
|
3166
3318
|
}
|
|
3167
3319
|
return String(value);
|
|
3168
3320
|
}
|
|
3321
|
+
var columnAlignClass = {
|
|
3322
|
+
left: void 0,
|
|
3323
|
+
center: "text-center",
|
|
3324
|
+
right: "text-right"
|
|
3325
|
+
};
|
|
3169
3326
|
function Table2({
|
|
3170
3327
|
columns = [],
|
|
3171
3328
|
dataSource = [],
|
|
@@ -3177,8 +3334,8 @@ function Table2({
|
|
|
3177
3334
|
style
|
|
3178
3335
|
}) {
|
|
3179
3336
|
const { renderChildren } = useRenderer15();
|
|
3180
|
-
const { t } =
|
|
3181
|
-
const [current, setCurrent] =
|
|
3337
|
+
const { t } = useI18n9();
|
|
3338
|
+
const [current, setCurrent] = useState14(1);
|
|
3182
3339
|
const pageSize = pagination === false ? void 0 : pagination?.pageSize;
|
|
3183
3340
|
const total = dataSource.length;
|
|
3184
3341
|
const pageCount = pageSize !== void 0 && pageSize > 0 ? Math.max(1, Math.ceil(total / pageSize)) : 1;
|
|
@@ -3187,8 +3344,8 @@ function Table2({
|
|
|
3187
3344
|
setCurrent(page);
|
|
3188
3345
|
onChange?.({ current: page, pageSize, total });
|
|
3189
3346
|
};
|
|
3190
|
-
return /* @__PURE__ */
|
|
3191
|
-
loading ? /* @__PURE__ */
|
|
3347
|
+
return /* @__PURE__ */ jsxs44("div", { "data-slot": "dsl-table", className: cn("relative", className), style, children: [
|
|
3348
|
+
loading ? /* @__PURE__ */ jsx64(
|
|
3192
3349
|
"div",
|
|
3193
3350
|
{
|
|
3194
3351
|
"data-slot": "table-loading",
|
|
@@ -3196,16 +3353,17 @@ function Table2({
|
|
|
3196
3353
|
children: t("pactor.table.loading")
|
|
3197
3354
|
}
|
|
3198
3355
|
) : null,
|
|
3199
|
-
/* @__PURE__ */
|
|
3200
|
-
/* @__PURE__ */
|
|
3356
|
+
/* @__PURE__ */ jsxs44(Table, { children: [
|
|
3357
|
+
/* @__PURE__ */ jsx64(TableHeader, { children: /* @__PURE__ */ jsx64(TableRow, { className: "hover:bg-transparent", children: columns.map((column, index) => /* @__PURE__ */ jsx64(
|
|
3201
3358
|
TableHead,
|
|
3202
3359
|
{
|
|
3360
|
+
className: column.align ? columnAlignClass[column.align] : void 0,
|
|
3203
3361
|
style: column.width !== void 0 ? { width: column.width } : void 0,
|
|
3204
3362
|
children: column.title
|
|
3205
3363
|
},
|
|
3206
3364
|
column.dataIndex ?? String(index)
|
|
3207
3365
|
)) }) }),
|
|
3208
|
-
/* @__PURE__ */
|
|
3366
|
+
/* @__PURE__ */ jsx64(TableBody, { children: pageRows.length === 0 ? /* @__PURE__ */ jsx64(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsx64(TableCell, { colSpan: Math.max(1, columns.length), children: /* @__PURE__ */ jsx64(
|
|
3209
3367
|
"div",
|
|
3210
3368
|
{
|
|
3211
3369
|
"data-slot": "table-empty",
|
|
@@ -3214,19 +3372,26 @@ function Table2({
|
|
|
3214
3372
|
}
|
|
3215
3373
|
) }) }) : pageRows.map((row, rowIndex) => {
|
|
3216
3374
|
const key = row[rowKey];
|
|
3217
|
-
return /* @__PURE__ */
|
|
3375
|
+
return /* @__PURE__ */ jsx64(
|
|
3218
3376
|
TableRow,
|
|
3219
3377
|
{
|
|
3220
|
-
children: columns.map((column, columnIndex) => /* @__PURE__ */
|
|
3221
|
-
|
|
3222
|
-
|
|
3378
|
+
children: columns.map((column, columnIndex) => /* @__PURE__ */ jsx64(
|
|
3379
|
+
TableCell,
|
|
3380
|
+
{
|
|
3381
|
+
className: column.align ? columnAlignClass[column.align] : void 0,
|
|
3382
|
+
children: column.cell ? renderChildren([column.cell], { row, rowIndex }) : renderCellValue2(
|
|
3383
|
+
column.dataIndex === void 0 ? void 0 : row[column.dataIndex]
|
|
3384
|
+
)
|
|
3385
|
+
},
|
|
3386
|
+
column.dataIndex ?? String(columnIndex)
|
|
3387
|
+
))
|
|
3223
3388
|
},
|
|
3224
3389
|
key === void 0 || key === null ? rowIndex : String(key)
|
|
3225
3390
|
);
|
|
3226
3391
|
}) })
|
|
3227
3392
|
] }),
|
|
3228
|
-
pageSize !== void 0 && pageSize > 0 ? /* @__PURE__ */
|
|
3229
|
-
(page) => /* @__PURE__ */
|
|
3393
|
+
pageSize !== void 0 && pageSize > 0 ? /* @__PURE__ */ jsx64("div", { "data-slot": "table-pagination", className: "mt-3 flex justify-end gap-1", children: Array.from({ length: pageCount }, (_, index) => index + 1).map(
|
|
3394
|
+
(page) => /* @__PURE__ */ jsx64(
|
|
3230
3395
|
Button,
|
|
3231
3396
|
{
|
|
3232
3397
|
type: "button",
|
|
@@ -3244,7 +3409,7 @@ function Table2({
|
|
|
3244
3409
|
|
|
3245
3410
|
// src/components/components/Tabs/index.tsx
|
|
3246
3411
|
import { useRenderer as useRenderer16 } from "@pactor-app/runtime";
|
|
3247
|
-
import { jsx as
|
|
3412
|
+
import { jsx as jsx65, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
3248
3413
|
function Tabs2({
|
|
3249
3414
|
items = [],
|
|
3250
3415
|
activeKey,
|
|
@@ -3256,7 +3421,7 @@ function Tabs2({
|
|
|
3256
3421
|
style
|
|
3257
3422
|
}) {
|
|
3258
3423
|
const { renderChildren } = useRenderer16();
|
|
3259
|
-
return /* @__PURE__ */
|
|
3424
|
+
return /* @__PURE__ */ jsxs45(
|
|
3260
3425
|
Tabs,
|
|
3261
3426
|
{
|
|
3262
3427
|
value: activeKey,
|
|
@@ -3265,8 +3430,8 @@ function Tabs2({
|
|
|
3265
3430
|
className,
|
|
3266
3431
|
style,
|
|
3267
3432
|
children: [
|
|
3268
|
-
/* @__PURE__ */
|
|
3269
|
-
items.map((item) => /* @__PURE__ */
|
|
3433
|
+
/* @__PURE__ */ jsx65(TabsList, { variant, children: items.map((item) => /* @__PURE__ */ jsx65(TabsTrigger, { value: item.key, children: item.label }, item.key)) }),
|
|
3434
|
+
items.map((item) => /* @__PURE__ */ jsx65(
|
|
3270
3435
|
TabsContent,
|
|
3271
3436
|
{
|
|
3272
3437
|
value: item.key,
|
|
@@ -3282,7 +3447,7 @@ function Tabs2({
|
|
|
3282
3447
|
}
|
|
3283
3448
|
|
|
3284
3449
|
// src/components/components/Text/index.tsx
|
|
3285
|
-
import { jsx as
|
|
3450
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
3286
3451
|
var typeClassMap = {
|
|
3287
3452
|
default: "",
|
|
3288
3453
|
secondary: "text-muted-foreground",
|
|
@@ -3307,7 +3472,7 @@ function Text({
|
|
|
3307
3472
|
style,
|
|
3308
3473
|
children
|
|
3309
3474
|
}) {
|
|
3310
|
-
return /* @__PURE__ */
|
|
3475
|
+
return /* @__PURE__ */ jsx66(
|
|
3311
3476
|
"span",
|
|
3312
3477
|
{
|
|
3313
3478
|
"data-slot": "text",
|
|
@@ -3328,8 +3493,8 @@ function Text({
|
|
|
3328
3493
|
}
|
|
3329
3494
|
|
|
3330
3495
|
// src/components/components/Textarea/index.tsx
|
|
3331
|
-
import { useEffect as
|
|
3332
|
-
import { jsx as
|
|
3496
|
+
import { useEffect as useEffect15, useId as useId9 } from "react";
|
|
3497
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
3333
3498
|
function Textarea2({
|
|
3334
3499
|
name,
|
|
3335
3500
|
label,
|
|
@@ -3343,9 +3508,9 @@ function Textarea2({
|
|
|
3343
3508
|
style
|
|
3344
3509
|
}) {
|
|
3345
3510
|
const form = useFormContext();
|
|
3346
|
-
const controlId =
|
|
3511
|
+
const controlId = useId9();
|
|
3347
3512
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
3348
|
-
|
|
3513
|
+
useEffect15(() => {
|
|
3349
3514
|
if (inForm && form && name) {
|
|
3350
3515
|
form.registerField(name, rules, value);
|
|
3351
3516
|
return () => form.unregisterField(name);
|
|
@@ -3354,7 +3519,7 @@ function Textarea2({
|
|
|
3354
3519
|
});
|
|
3355
3520
|
if (inForm && form && name) {
|
|
3356
3521
|
const fieldValue = form.values[name];
|
|
3357
|
-
return /* @__PURE__ */
|
|
3522
|
+
return /* @__PURE__ */ jsx67(
|
|
3358
3523
|
FieldShell,
|
|
3359
3524
|
{
|
|
3360
3525
|
layout: form.layout,
|
|
@@ -3363,7 +3528,7 @@ function Textarea2({
|
|
|
3363
3528
|
error: form.errors[name],
|
|
3364
3529
|
className,
|
|
3365
3530
|
style,
|
|
3366
|
-
children: /* @__PURE__ */
|
|
3531
|
+
children: /* @__PURE__ */ jsx67(
|
|
3367
3532
|
Textarea,
|
|
3368
3533
|
{
|
|
3369
3534
|
id: controlId,
|
|
@@ -3380,7 +3545,7 @@ function Textarea2({
|
|
|
3380
3545
|
}
|
|
3381
3546
|
);
|
|
3382
3547
|
}
|
|
3383
|
-
return /* @__PURE__ */
|
|
3548
|
+
return /* @__PURE__ */ jsx67(
|
|
3384
3549
|
Textarea,
|
|
3385
3550
|
{
|
|
3386
3551
|
value: value ?? "",
|
|
@@ -3395,7 +3560,7 @@ function Textarea2({
|
|
|
3395
3560
|
}
|
|
3396
3561
|
|
|
3397
3562
|
// src/components/components/Toggle/index.tsx
|
|
3398
|
-
import { jsx as
|
|
3563
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
3399
3564
|
function Toggle2({
|
|
3400
3565
|
text,
|
|
3401
3566
|
pressed,
|
|
@@ -3406,7 +3571,7 @@ function Toggle2({
|
|
|
3406
3571
|
className,
|
|
3407
3572
|
style
|
|
3408
3573
|
}) {
|
|
3409
|
-
return /* @__PURE__ */
|
|
3574
|
+
return /* @__PURE__ */ jsx68(
|
|
3410
3575
|
Toggle,
|
|
3411
3576
|
{
|
|
3412
3577
|
pressed,
|
|
@@ -3422,7 +3587,7 @@ function Toggle2({
|
|
|
3422
3587
|
}
|
|
3423
3588
|
|
|
3424
3589
|
// src/components/components/ToggleGroup/index.tsx
|
|
3425
|
-
import { jsx as
|
|
3590
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
3426
3591
|
function ToggleGroup2({
|
|
3427
3592
|
options = [],
|
|
3428
3593
|
value,
|
|
@@ -3442,7 +3607,7 @@ function ToggleGroup2({
|
|
|
3442
3607
|
onChange?.(added ?? void 0);
|
|
3443
3608
|
}
|
|
3444
3609
|
};
|
|
3445
|
-
return /* @__PURE__ */
|
|
3610
|
+
return /* @__PURE__ */ jsx69(
|
|
3446
3611
|
ToggleGroup,
|
|
3447
3612
|
{
|
|
3448
3613
|
value: groupValue,
|
|
@@ -3451,7 +3616,7 @@ function ToggleGroup2({
|
|
|
3451
3616
|
onValueChange: (next) => handleChange(next),
|
|
3452
3617
|
className,
|
|
3453
3618
|
style,
|
|
3454
|
-
children: options.map((option) => /* @__PURE__ */
|
|
3619
|
+
children: options.map((option) => /* @__PURE__ */ jsx69(
|
|
3455
3620
|
ToggleGroupItem,
|
|
3456
3621
|
{
|
|
3457
3622
|
value: option.value,
|
|
@@ -3465,23 +3630,23 @@ function ToggleGroup2({
|
|
|
3465
3630
|
}
|
|
3466
3631
|
|
|
3467
3632
|
// src/components/components/Tooltip/index.tsx
|
|
3468
|
-
import { jsx as
|
|
3633
|
+
import { jsx as jsx70, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
3469
3634
|
function Tooltip3({ content, children, className, style }) {
|
|
3470
|
-
return /* @__PURE__ */
|
|
3471
|
-
/* @__PURE__ */
|
|
3472
|
-
/* @__PURE__ */
|
|
3635
|
+
return /* @__PURE__ */ jsxs46(Tooltip, { children: [
|
|
3636
|
+
/* @__PURE__ */ jsx70(TooltipTrigger, { render: triggerWrapper("tooltip-trigger-wrap"), children }),
|
|
3637
|
+
/* @__PURE__ */ jsx70(TooltipContent, { className, style, children: content })
|
|
3473
3638
|
] });
|
|
3474
3639
|
}
|
|
3475
3640
|
|
|
3476
3641
|
// src/components/components/Typography/index.tsx
|
|
3477
|
-
import { jsx as
|
|
3642
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
3478
3643
|
function Typography2({
|
|
3479
3644
|
variant = "p",
|
|
3480
3645
|
text,
|
|
3481
3646
|
className,
|
|
3482
3647
|
style
|
|
3483
3648
|
}) {
|
|
3484
|
-
return /* @__PURE__ */
|
|
3649
|
+
return /* @__PURE__ */ jsx71(Typography, { variant, className, style, children: text });
|
|
3485
3650
|
}
|
|
3486
3651
|
|
|
3487
3652
|
// src/components/register.ts
|
|
@@ -3497,6 +3662,7 @@ var builtinComponents = {
|
|
|
3497
3662
|
Table: Table2,
|
|
3498
3663
|
Form,
|
|
3499
3664
|
Input: Input2,
|
|
3665
|
+
NumberInput,
|
|
3500
3666
|
Select: Select2,
|
|
3501
3667
|
// Layout 需要原始 DSL 子树做方向推导(含 Sider 判定),以 withScope 注册
|
|
3502
3668
|
Layout: { component: Layout, withScope: true },
|
|
@@ -3622,6 +3788,7 @@ export {
|
|
|
3622
3788
|
Link,
|
|
3623
3789
|
Menubar2 as Menubar,
|
|
3624
3790
|
NavigationMenu2 as NavigationMenu,
|
|
3791
|
+
NumberInput,
|
|
3625
3792
|
Page,
|
|
3626
3793
|
Pagination2 as Pagination,
|
|
3627
3794
|
Popover2 as Popover,
|