@vertz/ui-primitives 0.2.38 → 0.2.42
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/shared/chunk-06m8prfg.js +52 -0
- package/dist/shared/chunk-0n9jj8xr.js +24 -0
- package/dist/shared/chunk-1ben27xq.js +317 -0
- package/dist/shared/chunk-1j2mj0sa.js +45 -0
- package/dist/shared/chunk-250hj18f.js +243 -0
- package/dist/shared/chunk-2h4m9c71.js +38 -0
- package/dist/shared/chunk-2sbx20hv.js +128 -0
- package/dist/shared/chunk-2ye674gr.js +70 -0
- package/dist/shared/chunk-34d8385y.js +15 -0
- package/dist/shared/chunk-4d7bm8h0.js +113 -0
- package/dist/shared/chunk-4zjgxr7x.js +157 -0
- package/dist/shared/chunk-5c150wvr.js +140 -0
- package/dist/shared/chunk-5gycdypd.js +58 -0
- package/dist/shared/chunk-6mm7fhp8.js +105 -0
- package/dist/shared/chunk-6zmnqvh6.js +109 -0
- package/dist/shared/{chunk-yy3ft5mb.js → chunk-7amn5d71.js} +2 -2
- package/dist/shared/chunk-7pbff2hg.js +118 -0
- package/dist/shared/chunk-7zpjshwz.js +194 -0
- package/dist/shared/chunk-993ff51d.js +155 -0
- package/dist/shared/chunk-9pdt5aw7.js +24 -0
- package/dist/shared/chunk-a71m4xkv.js +106 -0
- package/dist/shared/chunk-aj8m39pk.js +127 -0
- package/dist/shared/chunk-ajawpc05.js +305 -0
- package/dist/shared/chunk-b7mzwqhj.js +125 -0
- package/dist/shared/chunk-bb887de4.js +200 -0
- package/dist/shared/chunk-bfsmbrxc.js +111 -0
- package/dist/shared/chunk-c2f63m5n.js +56 -0
- package/dist/shared/chunk-c5r3s5km.js +263 -0
- package/dist/shared/chunk-caba5bhd.js +427 -0
- package/dist/shared/chunk-crym07yc.js +264 -0
- package/dist/shared/{chunk-5964gmv0.js → chunk-csjtyvam.js} +62 -88
- package/dist/shared/chunk-d6rtejz3.js +128 -0
- package/dist/shared/chunk-dvaf0bmq.js +140 -0
- package/dist/shared/chunk-dwkv9ya6.js +22 -0
- package/dist/shared/chunk-e0ckxrjg.js +41 -0
- package/dist/shared/chunk-ennxcymj.js +225 -0
- package/dist/shared/{chunk-1jd1n0dt.js → chunk-ey38de46.js} +19 -47
- package/dist/shared/chunk-f0v1gs5e.js +52 -0
- package/dist/shared/chunk-f86rsf84.js +231 -0
- package/dist/shared/chunk-fdse46x5.js +21 -0
- package/dist/shared/chunk-gj4hrssn.js +135 -0
- package/dist/shared/chunk-gyvq4gk9.js +24 -0
- package/dist/shared/chunk-hbnps9sq.js +229 -0
- package/dist/shared/{chunk-fhss32ya.js → chunk-hdmpyeq9.js} +43 -132
- package/dist/shared/chunk-hgnkd4he.js +256 -0
- package/dist/shared/chunk-hpcyffm7.js +185 -0
- package/dist/shared/chunk-hpmvwx0h.js +99 -0
- package/dist/shared/chunk-hz0e504p.js +69 -0
- package/dist/shared/chunk-hzk4wfq9.js +43 -0
- package/dist/shared/chunk-j7znzkpa.js +48 -0
- package/dist/shared/chunk-j9kxgrnn.js +167 -0
- package/dist/shared/chunk-jetwnv0w.js +130 -0
- package/dist/shared/chunk-jjdg26c1.js +155 -0
- package/dist/shared/chunk-k0m4yh86.js +123 -0
- package/dist/shared/chunk-k43q9cjr.js +82 -0
- package/dist/shared/chunk-k9k8tbr5.js +119 -0
- package/dist/shared/chunk-meaj7br1.js +232 -0
- package/dist/shared/chunk-mgj0n08k.js +34 -0
- package/dist/shared/chunk-mjz4rp6c.js +46 -0
- package/dist/shared/chunk-n4rr5gme.js +239 -0
- package/dist/shared/chunk-nk55etpp.js +65 -0
- package/dist/shared/chunk-nkh1ks3k.js +264 -0
- package/dist/shared/chunk-pgvpvbpe.js +26 -0
- package/dist/shared/chunk-pma8gnv7.js +178 -0
- package/dist/shared/chunk-q7xv6xze.js +131 -0
- package/dist/shared/chunk-qey801nq.js +22 -0
- package/dist/shared/chunk-s6b4c3tj.js +58 -0
- package/dist/shared/chunk-sq27a4h0.js +36 -0
- package/dist/shared/chunk-taa5pj15.js +103 -0
- package/dist/shared/chunk-tc5rpvyx.js +127 -0
- package/dist/shared/chunk-tescm0b3.js +192 -0
- package/dist/shared/chunk-tkftdwnq.js +71 -0
- package/dist/shared/chunk-tqhnjcfp.js +116 -0
- package/dist/shared/chunk-vfknb5ht.js +183 -0
- package/dist/shared/chunk-vsc369w3.js +185 -0
- package/dist/shared/chunk-whq9s8v5.js +301 -0
- package/dist/shared/{chunk-hze1f32t.js → chunk-wrqddgaj.js} +1 -1
- package/dist/shared/chunk-yzbmkx4r.js +155 -0
- package/dist/shared/chunk-zaen0ajc.js +347 -0
- package/dist/src/accordion/accordion-composed.js +1 -1
- package/dist/src/accordion/accordion.js +1 -1
- package/dist/src/alert/alert-composed.js +1 -1
- package/dist/src/alert-dialog/alert-dialog-composed.js +1 -1
- package/dist/src/alert-dialog/alert-dialog.js +1 -1
- package/dist/src/avatar/avatar-composed.js +1 -1
- package/dist/src/badge/badge-composed.js +1 -1
- package/dist/src/badge/badge.js +1 -1
- package/dist/src/breadcrumb/breadcrumb-composed.js +1 -1
- package/dist/src/button/button-composed.js +1 -1
- package/dist/src/button/button.js +1 -1
- package/dist/src/calendar/calendar-composed.js +1 -1
- package/dist/src/calendar/calendar.js +1 -1
- package/dist/src/card/card-composed.js +1 -1
- package/dist/src/carousel/carousel-composed.js +1 -1
- package/dist/src/carousel/carousel.js +1 -1
- package/dist/src/checkbox/checkbox-composed.js +1 -1
- package/dist/src/checkbox/checkbox.js +1 -1
- package/dist/src/collapsible/collapsible-composed.js +1 -1
- package/dist/src/collapsible/collapsible.js +1 -1
- package/dist/src/combobox/combobox-composed.js +1 -1
- package/dist/src/combobox/combobox.js +1 -1
- package/dist/src/command/command-composed.js +1 -1
- package/dist/src/command/command.js +1 -1
- package/dist/src/composed/with-styles.js +1 -1
- package/dist/src/context-menu/context-menu-composed.js +1 -1
- package/dist/src/context-menu/context-menu.js +1 -1
- package/dist/src/date-picker/date-picker-composed.js +1 -1
- package/dist/src/date-picker/date-picker.js +1 -1
- package/dist/src/dialog/dialog-composed.js +1 -1
- package/dist/src/dialog/dialog-stack-parts.js +1 -1
- package/dist/src/dialog/dialog.js +1 -1
- package/dist/src/dropdown-menu/dropdown-menu-composed.js +1 -1
- package/dist/src/dropdown-menu/dropdown-menu.js +1 -1
- package/dist/src/empty-state/empty-state-composed.js +1 -1
- package/dist/src/form-group/form-group-composed.js +1 -1
- package/dist/src/hover-card/hover-card-composed.js +1 -1
- package/dist/src/hover-card/hover-card.js +1 -1
- package/dist/src/input/input-composed.js +1 -1
- package/dist/src/label/label-composed.js +1 -1
- package/dist/src/list/list-composed.js +1 -1
- package/dist/src/menu/menu-composed.js +1 -1
- package/dist/src/menu/menu.js +1 -1
- package/dist/src/menubar/menubar-composed.js +1 -1
- package/dist/src/menubar/menubar.js +1 -1
- package/dist/src/navigation-menu/navigation-menu-composed.js +1 -1
- package/dist/src/navigation-menu/navigation-menu.js +1 -1
- package/dist/src/pagination/pagination-composed.js +1 -1
- package/dist/src/popover/popover-composed.js +1 -1
- package/dist/src/popover/popover.js +1 -1
- package/dist/src/progress/progress-composed.js +1 -1
- package/dist/src/progress/progress.js +1 -1
- package/dist/src/radio/radio-composed.js +1 -1
- package/dist/src/radio/radio.js +1 -1
- package/dist/src/resizable-panel/resizable-panel-composed.js +1 -1
- package/dist/src/resizable-panel/resizable-panel.js +1 -1
- package/dist/src/scroll-area/scroll-area-composed.js +1 -1
- package/dist/src/scroll-area/scroll-area.js +1 -1
- package/dist/src/select/select-composed.js +1 -1
- package/dist/src/select/select.js +1 -1
- package/dist/src/separator/separator-composed.js +1 -1
- package/dist/src/sheet/sheet-composed.js +1 -1
- package/dist/src/sheet/sheet.js +1 -1
- package/dist/src/skeleton/skeleton-composed.js +1 -1
- package/dist/src/slider/slider-composed.js +1 -1
- package/dist/src/slider/slider.js +1 -1
- package/dist/src/switch/switch-composed.js +1 -1
- package/dist/src/switch/switch.js +1 -1
- package/dist/src/table/table-composed.js +1 -1
- package/dist/src/tabs/tabs-composed.js +1 -1
- package/dist/src/tabs/tabs.js +1 -1
- package/dist/src/textarea/textarea-composed.js +1 -1
- package/dist/src/toast/toast.js +1 -1
- package/dist/src/toggle/toggle-composed.js +1 -1
- package/dist/src/toggle/toggle.js +1 -1
- package/dist/src/toggle-group/toggle-group-composed.js +1 -1
- package/dist/src/toggle-group/toggle-group.js +1 -1
- package/dist/src/tooltip/tooltip-composed.js +1 -1
- package/dist/src/tooltip/tooltip.js +1 -1
- package/package.json +3 -3
- package/dist/shared/chunk-144kbnmx.js +0 -95
- package/dist/shared/chunk-1ewxfgsa.js +0 -167
- package/dist/shared/chunk-1hm0mbke.js +0 -258
- package/dist/shared/chunk-22rt6ws9.js +0 -69
- package/dist/shared/chunk-2ssqz188.js +0 -162
- package/dist/shared/chunk-33he7ay9.js +0 -218
- package/dist/shared/chunk-3jack97k.js +0 -509
- package/dist/shared/chunk-75pegjs7.js +0 -26
- package/dist/shared/chunk-862x7dja.js +0 -398
- package/dist/shared/chunk-8pk1pn5h.js +0 -215
- package/dist/shared/chunk-8t0nm721.js +0 -152
- package/dist/shared/chunk-94twh4s4.js +0 -28
- package/dist/shared/chunk-9yb26c0w.js +0 -232
- package/dist/shared/chunk-a82r2pnq.js +0 -67
- package/dist/shared/chunk-axpbdpgx.js +0 -177
- package/dist/shared/chunk-b3j6mym6.js +0 -203
- package/dist/shared/chunk-b4zzg457.js +0 -410
- package/dist/shared/chunk-b9qxfcsy.js +0 -60
- package/dist/shared/chunk-bc2qqkhr.js +0 -194
- package/dist/shared/chunk-bv12nkdm.js +0 -149
- package/dist/shared/chunk-bvxc1ww4.js +0 -164
- package/dist/shared/chunk-czv0kqj4.js +0 -107
- package/dist/shared/chunk-d83ag07h.js +0 -189
- package/dist/shared/chunk-de18ashk.js +0 -134
- package/dist/shared/chunk-dvk4h36t.js +0 -140
- package/dist/shared/chunk-dxvnerw2.js +0 -353
- package/dist/shared/chunk-e399pzdq.js +0 -241
- package/dist/shared/chunk-e4qha9as.js +0 -180
- package/dist/shared/chunk-eb2d9v6k.js +0 -68
- package/dist/shared/chunk-ect26sp5.js +0 -353
- package/dist/shared/chunk-ev367pq3.js +0 -102
- package/dist/shared/chunk-fjykbv0v.js +0 -214
- package/dist/shared/chunk-gdddk6nh.js +0 -96
- package/dist/shared/chunk-ghkw5bjq.js +0 -55
- package/dist/shared/chunk-hfjtkytb.js +0 -310
- package/dist/shared/chunk-hpvjfj0j.js +0 -31
- package/dist/shared/chunk-jpyjk616.js +0 -52
- package/dist/shared/chunk-k6d53tne.js +0 -206
- package/dist/shared/chunk-knzg86am.js +0 -168
- package/dist/shared/chunk-ktbf6xrt.js +0 -179
- package/dist/shared/chunk-m8y2p66x.js +0 -252
- package/dist/shared/chunk-metxdt5x.js +0 -28
- package/dist/shared/chunk-mgae1d93.js +0 -157
- package/dist/shared/chunk-mtx2cfbx.js +0 -175
- package/dist/shared/chunk-n436p5cb.js +0 -260
- package/dist/shared/chunk-nj420k31.js +0 -54
- package/dist/shared/chunk-nsmvdxgp.js +0 -213
- package/dist/shared/chunk-pcms04vq.js +0 -162
- package/dist/shared/chunk-pqskzq8t.js +0 -79
- package/dist/shared/chunk-pwr60kyd.js +0 -321
- package/dist/shared/chunk-pzknpa1y.js +0 -327
- package/dist/shared/chunk-q77y3rg4.js +0 -189
- package/dist/shared/chunk-qhnany7w.js +0 -179
- package/dist/shared/chunk-r3pffzss.js +0 -13
- package/dist/shared/chunk-rdr0rtpr.js +0 -131
- package/dist/shared/chunk-rj52ty6r.js +0 -147
- package/dist/shared/chunk-rnqc7735.js +0 -125
- package/dist/shared/chunk-rtk30950.js +0 -202
- package/dist/shared/chunk-s0xgd8vg.js +0 -266
- package/dist/shared/chunk-s415735j.js +0 -357
- package/dist/shared/chunk-s62e7jf4.js +0 -30
- package/dist/shared/chunk-snd8e6r8.js +0 -418
- package/dist/shared/chunk-spng4yb9.js +0 -73
- package/dist/shared/chunk-t887wwjc.js +0 -168
- package/dist/shared/chunk-tn0m98j8.js +0 -42
- package/dist/shared/chunk-v0b5pkcq.js +0 -30
- package/dist/shared/chunk-v5tj7veh.js +0 -284
- package/dist/shared/chunk-vkscwzpr.js +0 -294
- package/dist/shared/chunk-vv187snj.js +0 -112
- package/dist/shared/chunk-xv4wd0kf.js +0 -293
- package/dist/shared/chunk-y1hpsqzy.js +0 -185
- package/dist/shared/chunk-yfzddvxc.js +0 -71
- package/dist/shared/chunk-yzgzx2dh.js +0 -311
- package/dist/shared/chunk-z5j7ztf2.js +0 -467
|
@@ -1,327 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
cn
|
|
3
|
-
} from "./chunk-q7xbcj9q.js";
|
|
4
|
-
import {
|
|
5
|
-
linkedIds
|
|
6
|
-
} from "./chunk-8y1jf6xr.js";
|
|
7
|
-
|
|
8
|
-
// src/dialog/dialog-composed.tsx
|
|
9
|
-
import { computed, signal } from "@vertz/ui";
|
|
10
|
-
import { __append, __attr, __child, __conditional, __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
|
|
11
|
-
import { createContext, ref, useContext } from "@vertz/ui";
|
|
12
|
-
var DialogContext = createContext(undefined, "@vertz/ui-primitives::DialogContext");
|
|
13
|
-
function useDialogContext(componentName) {
|
|
14
|
-
const ctx = useContext(DialogContext);
|
|
15
|
-
if (!ctx) {
|
|
16
|
-
throw new Error(`<Dialog.${componentName}> must be used inside <Dialog>. ` + "Ensure it is a direct or nested child of the Dialog root component.");
|
|
17
|
-
}
|
|
18
|
-
return ctx;
|
|
19
|
-
}
|
|
20
|
-
function DialogTrigger(__props) {
|
|
21
|
-
const __mfDepth = __pushMountFrame();
|
|
22
|
-
try {
|
|
23
|
-
const ctx = useDialogContext("Trigger");
|
|
24
|
-
const __mfResult0 = (() => {
|
|
25
|
-
const __el0 = __element("span");
|
|
26
|
-
{
|
|
27
|
-
const __v = { display: "contents" };
|
|
28
|
-
if (__v != null && __v !== false)
|
|
29
|
-
__el0.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
30
|
-
}
|
|
31
|
-
__el0.setAttribute("data-dialog-trigger", "");
|
|
32
|
-
__el0.setAttribute("data-state", "closed");
|
|
33
|
-
__on(__el0, "click", () => ctx.toggle());
|
|
34
|
-
__enterChildren(__el0);
|
|
35
|
-
__append(__el0, __child(() => __props.children));
|
|
36
|
-
__exitChildren();
|
|
37
|
-
return __el0;
|
|
38
|
-
})();
|
|
39
|
-
__flushMountFrame();
|
|
40
|
-
return __mfResult0;
|
|
41
|
-
} catch (__mfErr) {
|
|
42
|
-
__discardMountFrame(__mfDepth);
|
|
43
|
-
throw __mfErr;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function DialogContent(__props) {
|
|
47
|
-
const __mfDepth = __pushMountFrame();
|
|
48
|
-
try {
|
|
49
|
-
const ctx = useDialogContext("Content");
|
|
50
|
-
const el = computed(() => (() => {
|
|
51
|
-
const __el0 = __element("dialog");
|
|
52
|
-
ctx.dialogRef.current = __el0;
|
|
53
|
-
{
|
|
54
|
-
const __v = ctx.contentId;
|
|
55
|
-
if (__v != null && __v !== false)
|
|
56
|
-
__el0.setAttribute("id", __v === true ? "" : __v);
|
|
57
|
-
}
|
|
58
|
-
__el0.setAttribute("role", "dialog");
|
|
59
|
-
{
|
|
60
|
-
const __v = ctx.titleId;
|
|
61
|
-
if (__v != null && __v !== false)
|
|
62
|
-
__el0.setAttribute("aria-labelledby", __v === true ? "" : __v);
|
|
63
|
-
}
|
|
64
|
-
{
|
|
65
|
-
const __v = ctx.descriptionId;
|
|
66
|
-
if (__v != null && __v !== false)
|
|
67
|
-
__el0.setAttribute("aria-describedby", __v === true ? "" : __v);
|
|
68
|
-
}
|
|
69
|
-
__el0.setAttribute("data-state", "closed");
|
|
70
|
-
__attr(__el0, "class", () => cn(ctx.classes?.content, __props.className ?? __props.class));
|
|
71
|
-
__on(__el0, "cancel", (e) => {
|
|
72
|
-
e.preventDefault();
|
|
73
|
-
ctx.close();
|
|
74
|
-
});
|
|
75
|
-
__on(__el0, "click", (e) => {
|
|
76
|
-
if (e.target === ctx.dialogRef.current)
|
|
77
|
-
ctx.close();
|
|
78
|
-
});
|
|
79
|
-
__enterChildren(__el0);
|
|
80
|
-
__append(__el0, __conditional(() => __props.showClose ?? true, () => (() => {
|
|
81
|
-
const __el1 = __element("button");
|
|
82
|
-
__el1.setAttribute("type", "button");
|
|
83
|
-
__el1.setAttribute("data-slot", "dialog-close");
|
|
84
|
-
{
|
|
85
|
-
const __v = cn(ctx.classes?.close);
|
|
86
|
-
if (__v != null && __v !== false)
|
|
87
|
-
__el1.setAttribute("class", __v === true ? "" : __v);
|
|
88
|
-
}
|
|
89
|
-
__el1.setAttribute("aria-label", "Close");
|
|
90
|
-
__on(__el1, "click", () => ctx.close());
|
|
91
|
-
__enterChildren(__el1);
|
|
92
|
-
__append(__el1, (() => {
|
|
93
|
-
const __el2 = __element("svg");
|
|
94
|
-
__el2.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
95
|
-
__el2.setAttribute("aria-hidden", "true");
|
|
96
|
-
__el2.setAttribute("focusable", "false");
|
|
97
|
-
__el2.setAttribute("width", "16");
|
|
98
|
-
__el2.setAttribute("height", "16");
|
|
99
|
-
__el2.setAttribute("viewBox", "0 0 24 24");
|
|
100
|
-
__el2.setAttribute("fill", "none");
|
|
101
|
-
__el2.setAttribute("stroke", "currentColor");
|
|
102
|
-
__el2.setAttribute("stroke-width", "2");
|
|
103
|
-
__el2.setAttribute("stroke-linecap", "round");
|
|
104
|
-
__el2.setAttribute("stroke-linejoin", "round");
|
|
105
|
-
__enterChildren(__el2);
|
|
106
|
-
__append(__el2, (() => {
|
|
107
|
-
const __el3 = __element("path");
|
|
108
|
-
__el3.setAttribute("d", "M18 6 6 18");
|
|
109
|
-
return __el3;
|
|
110
|
-
})());
|
|
111
|
-
__append(__el2, (() => {
|
|
112
|
-
const __el4 = __element("path");
|
|
113
|
-
__el4.setAttribute("d", "m6 6 12 12");
|
|
114
|
-
return __el4;
|
|
115
|
-
})());
|
|
116
|
-
__exitChildren();
|
|
117
|
-
return __el2;
|
|
118
|
-
})());
|
|
119
|
-
__exitChildren();
|
|
120
|
-
return __el1;
|
|
121
|
-
})(), () => null));
|
|
122
|
-
__append(__el0, __child(() => __props.children));
|
|
123
|
-
__exitChildren();
|
|
124
|
-
return __el0;
|
|
125
|
-
})());
|
|
126
|
-
const __mfResult0 = el.value;
|
|
127
|
-
__flushMountFrame();
|
|
128
|
-
return __mfResult0;
|
|
129
|
-
} catch (__mfErr) {
|
|
130
|
-
__discardMountFrame(__mfDepth);
|
|
131
|
-
throw __mfErr;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
function DialogTitle(__props) {
|
|
135
|
-
const __mfDepth = __pushMountFrame();
|
|
136
|
-
try {
|
|
137
|
-
const ctx = useDialogContext("Title");
|
|
138
|
-
const __mfResult0 = (() => {
|
|
139
|
-
const __el0 = __element("h2");
|
|
140
|
-
{
|
|
141
|
-
const __v = ctx.titleId;
|
|
142
|
-
if (__v != null && __v !== false)
|
|
143
|
-
__el0.setAttribute("id", __v === true ? "" : __v);
|
|
144
|
-
}
|
|
145
|
-
__attr(__el0, "class", () => cn(ctx.classes?.title, __props.className ?? __props.class));
|
|
146
|
-
__enterChildren(__el0);
|
|
147
|
-
__append(__el0, __child(() => __props.children));
|
|
148
|
-
__exitChildren();
|
|
149
|
-
return __el0;
|
|
150
|
-
})();
|
|
151
|
-
__flushMountFrame();
|
|
152
|
-
return __mfResult0;
|
|
153
|
-
} catch (__mfErr) {
|
|
154
|
-
__discardMountFrame(__mfDepth);
|
|
155
|
-
throw __mfErr;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
function DialogDescription(__props) {
|
|
159
|
-
const __mfDepth = __pushMountFrame();
|
|
160
|
-
try {
|
|
161
|
-
const ctx = useDialogContext("Description");
|
|
162
|
-
const __mfResult0 = (() => {
|
|
163
|
-
const __el0 = __element("p");
|
|
164
|
-
{
|
|
165
|
-
const __v = ctx.descriptionId;
|
|
166
|
-
if (__v != null && __v !== false)
|
|
167
|
-
__el0.setAttribute("id", __v === true ? "" : __v);
|
|
168
|
-
}
|
|
169
|
-
__attr(__el0, "class", () => cn(ctx.classes?.description, __props.className ?? __props.class));
|
|
170
|
-
__enterChildren(__el0);
|
|
171
|
-
__append(__el0, __child(() => __props.children));
|
|
172
|
-
__exitChildren();
|
|
173
|
-
return __el0;
|
|
174
|
-
})();
|
|
175
|
-
__flushMountFrame();
|
|
176
|
-
return __mfResult0;
|
|
177
|
-
} catch (__mfErr) {
|
|
178
|
-
__discardMountFrame(__mfDepth);
|
|
179
|
-
throw __mfErr;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
function DialogHeader(__props) {
|
|
183
|
-
const __mfDepth = __pushMountFrame();
|
|
184
|
-
try {
|
|
185
|
-
const { classes } = useDialogContext("Header");
|
|
186
|
-
const __mfResult0 = (() => {
|
|
187
|
-
const __el0 = __element("div");
|
|
188
|
-
__attr(__el0, "class", () => cn(classes?.header, __props.className ?? __props.class));
|
|
189
|
-
__enterChildren(__el0);
|
|
190
|
-
__append(__el0, __child(() => __props.children));
|
|
191
|
-
__exitChildren();
|
|
192
|
-
return __el0;
|
|
193
|
-
})();
|
|
194
|
-
__flushMountFrame();
|
|
195
|
-
return __mfResult0;
|
|
196
|
-
} catch (__mfErr) {
|
|
197
|
-
__discardMountFrame(__mfDepth);
|
|
198
|
-
throw __mfErr;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
function DialogFooter(__props) {
|
|
202
|
-
const __mfDepth = __pushMountFrame();
|
|
203
|
-
try {
|
|
204
|
-
const { classes } = useDialogContext("Footer");
|
|
205
|
-
const __mfResult0 = (() => {
|
|
206
|
-
const __el0 = __element("div");
|
|
207
|
-
__attr(__el0, "class", () => cn(classes?.footer, __props.className ?? __props.class));
|
|
208
|
-
__enterChildren(__el0);
|
|
209
|
-
__append(__el0, __child(() => __props.children));
|
|
210
|
-
__exitChildren();
|
|
211
|
-
return __el0;
|
|
212
|
-
})();
|
|
213
|
-
__flushMountFrame();
|
|
214
|
-
return __mfResult0;
|
|
215
|
-
} catch (__mfErr) {
|
|
216
|
-
__discardMountFrame(__mfDepth);
|
|
217
|
-
throw __mfErr;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
function DialogClose(__props) {
|
|
221
|
-
const __mfDepth = __pushMountFrame();
|
|
222
|
-
try {
|
|
223
|
-
const ctx = useDialogContext("Close");
|
|
224
|
-
const __mfResult0 = (() => {
|
|
225
|
-
const __el0 = __element("button");
|
|
226
|
-
__el0.setAttribute("type", "button");
|
|
227
|
-
__el0.setAttribute("data-slot", "dialog-close");
|
|
228
|
-
__attr(__el0, "class", () => cn(ctx.classes?.close, __props.className ?? __props.class));
|
|
229
|
-
__attr(__el0, "aria-label", () => __props.children ? undefined : "Close");
|
|
230
|
-
__on(__el0, "click", () => ctx.close());
|
|
231
|
-
__enterChildren(__el0);
|
|
232
|
-
__append(__el0, __child(() => __props.children ?? "×"));
|
|
233
|
-
__exitChildren();
|
|
234
|
-
return __el0;
|
|
235
|
-
})();
|
|
236
|
-
__flushMountFrame();
|
|
237
|
-
return __mfResult0;
|
|
238
|
-
} catch (__mfErr) {
|
|
239
|
-
__discardMountFrame(__mfDepth);
|
|
240
|
-
throw __mfErr;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
function ComposedDialogRoot(__props) {
|
|
244
|
-
const __mfDepth = __pushMountFrame();
|
|
245
|
-
try {
|
|
246
|
-
let showDialog = function() {
|
|
247
|
-
const el = dialogRef.current;
|
|
248
|
-
if (!el || el.open)
|
|
249
|
-
return;
|
|
250
|
-
el.setAttribute("data-state", "open");
|
|
251
|
-
el.showModal();
|
|
252
|
-
}, hideDialog = function() {
|
|
253
|
-
const el = dialogRef.current;
|
|
254
|
-
if (!el || !el.open)
|
|
255
|
-
return;
|
|
256
|
-
el.setAttribute("data-state", "closed");
|
|
257
|
-
el.offsetHeight;
|
|
258
|
-
const onEnd = () => {
|
|
259
|
-
el.removeEventListener("animationend", onEnd);
|
|
260
|
-
if (el.open)
|
|
261
|
-
el.close();
|
|
262
|
-
};
|
|
263
|
-
el.addEventListener("animationend", onEnd);
|
|
264
|
-
setTimeout(onEnd, 200);
|
|
265
|
-
}, open = function() {
|
|
266
|
-
isOpen.value = true;
|
|
267
|
-
showDialog();
|
|
268
|
-
__props.onOpenChange?.(true);
|
|
269
|
-
}, close = function() {
|
|
270
|
-
hideDialog();
|
|
271
|
-
isOpen.value = false;
|
|
272
|
-
__props.onOpenChange?.(false);
|
|
273
|
-
}, toggle = function() {
|
|
274
|
-
if (isOpen.value)
|
|
275
|
-
close();
|
|
276
|
-
else
|
|
277
|
-
open();
|
|
278
|
-
};
|
|
279
|
-
const ids = linkedIds("dialog");
|
|
280
|
-
const titleId = `${ids.contentId}-title`;
|
|
281
|
-
const descriptionId = `${ids.contentId}-description`;
|
|
282
|
-
const dialogRef = ref();
|
|
283
|
-
const isOpen = signal(false, "isOpen");
|
|
284
|
-
const ctx = {
|
|
285
|
-
isOpen,
|
|
286
|
-
titleId,
|
|
287
|
-
descriptionId,
|
|
288
|
-
contentId: ids.contentId,
|
|
289
|
-
dialogRef,
|
|
290
|
-
classes: __props.classes,
|
|
291
|
-
open,
|
|
292
|
-
close,
|
|
293
|
-
toggle
|
|
294
|
-
};
|
|
295
|
-
const __mfResult0 = DialogContext.Provider({ get value() {
|
|
296
|
-
return ctx;
|
|
297
|
-
}, children: () => (() => {
|
|
298
|
-
const __el0 = __element("span");
|
|
299
|
-
{
|
|
300
|
-
const __v = { display: "contents" };
|
|
301
|
-
if (__v != null && __v !== false)
|
|
302
|
-
__el0.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
303
|
-
}
|
|
304
|
-
__el0.setAttribute("data-dialog-root", "");
|
|
305
|
-
__enterChildren(__el0);
|
|
306
|
-
__append(__el0, __child(() => __props.children));
|
|
307
|
-
__exitChildren();
|
|
308
|
-
return __el0;
|
|
309
|
-
})() });
|
|
310
|
-
__flushMountFrame();
|
|
311
|
-
return __mfResult0;
|
|
312
|
-
} catch (__mfErr) {
|
|
313
|
-
__discardMountFrame(__mfDepth);
|
|
314
|
-
throw __mfErr;
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
var ComposedDialog = Object.assign(ComposedDialogRoot, {
|
|
318
|
-
Trigger: DialogTrigger,
|
|
319
|
-
Content: DialogContent,
|
|
320
|
-
Title: DialogTitle,
|
|
321
|
-
Description: DialogDescription,
|
|
322
|
-
Header: DialogHeader,
|
|
323
|
-
Footer: DialogFooter,
|
|
324
|
-
Close: DialogClose
|
|
325
|
-
});
|
|
326
|
-
|
|
327
|
-
export { ComposedDialog };
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
uniqueId
|
|
3
|
-
} from "./chunk-8y1jf6xr.js";
|
|
4
|
-
import {
|
|
5
|
-
Keys,
|
|
6
|
-
handleListNavigation,
|
|
7
|
-
isKey
|
|
8
|
-
} from "./chunk-7867pr13.js";
|
|
9
|
-
import {
|
|
10
|
-
setDataState,
|
|
11
|
-
setExpanded,
|
|
12
|
-
setHidden,
|
|
13
|
-
setHiddenAnimated
|
|
14
|
-
} from "./chunk-vevfhpc9.js";
|
|
15
|
-
import {
|
|
16
|
-
applyAttrs
|
|
17
|
-
} from "./chunk-2db2dnp3.js";
|
|
18
|
-
|
|
19
|
-
// src/accordion/accordion.tsx
|
|
20
|
-
import { __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __insert, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
|
|
21
|
-
import { signal } from "@vertz/ui";
|
|
22
|
-
function AccordionRoot(options = {}) {
|
|
23
|
-
const __mfDepth = __pushMountFrame();
|
|
24
|
-
try {
|
|
25
|
-
let updateItemState = function(val, open) {
|
|
26
|
-
const entry = itemMap.get(val);
|
|
27
|
-
if (!entry)
|
|
28
|
-
return;
|
|
29
|
-
const { trigger: t, content: c } = entry;
|
|
30
|
-
c.removeAttribute("data-initial");
|
|
31
|
-
if (open) {
|
|
32
|
-
setHidden(c, false);
|
|
33
|
-
}
|
|
34
|
-
const height = c.scrollHeight;
|
|
35
|
-
c.style.setProperty("--accordion-content-height", `${height}px`);
|
|
36
|
-
setExpanded(t, open);
|
|
37
|
-
setDataState(t, open ? "open" : "closed");
|
|
38
|
-
setDataState(c, open ? "open" : "closed");
|
|
39
|
-
if (!open) {
|
|
40
|
-
setHiddenAnimated(c, true);
|
|
41
|
-
}
|
|
42
|
-
}, toggleItem = function(value) {
|
|
43
|
-
const prev = [...state.value.peek()];
|
|
44
|
-
const current = [...prev];
|
|
45
|
-
const idx = current.indexOf(value);
|
|
46
|
-
if (idx >= 0) {
|
|
47
|
-
current.splice(idx, 1);
|
|
48
|
-
} else {
|
|
49
|
-
if (multiple) {
|
|
50
|
-
current.push(value);
|
|
51
|
-
} else {
|
|
52
|
-
current.length = 0;
|
|
53
|
-
current.push(value);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
state.value.value = current;
|
|
57
|
-
onValueChange?.(current);
|
|
58
|
-
for (const v of prev) {
|
|
59
|
-
if (!current.includes(v)) {
|
|
60
|
-
updateItemState(v, false);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
for (const v of current) {
|
|
64
|
-
if (!prev.includes(v)) {
|
|
65
|
-
updateItemState(v, true);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}, Item = function(value) {
|
|
69
|
-
const baseId = uniqueId("accordion");
|
|
70
|
-
const triggerId = `${baseId}-trigger`;
|
|
71
|
-
const contentId = `${baseId}-content`;
|
|
72
|
-
const isOpen = state.value.peek().includes(value);
|
|
73
|
-
const trigger = (() => {
|
|
74
|
-
const __el1 = __element("button");
|
|
75
|
-
__el1.setAttribute("type", "button");
|
|
76
|
-
{
|
|
77
|
-
const __v = triggerId;
|
|
78
|
-
if (__v != null && __v !== false)
|
|
79
|
-
__el1.setAttribute("id", __v === true ? "" : __v);
|
|
80
|
-
}
|
|
81
|
-
{
|
|
82
|
-
const __v = contentId;
|
|
83
|
-
if (__v != null && __v !== false)
|
|
84
|
-
__el1.setAttribute("aria-controls", __v === true ? "" : __v);
|
|
85
|
-
}
|
|
86
|
-
{
|
|
87
|
-
const __v = value;
|
|
88
|
-
if (__v != null && __v !== false)
|
|
89
|
-
__el1.setAttribute("data-value", __v === true ? "" : __v);
|
|
90
|
-
}
|
|
91
|
-
{
|
|
92
|
-
const __v = isOpen ? "true" : "false";
|
|
93
|
-
if (__v != null && __v !== false)
|
|
94
|
-
__el1.setAttribute("aria-expanded", __v === true ? "" : __v);
|
|
95
|
-
}
|
|
96
|
-
{
|
|
97
|
-
const __v = isOpen ? "open" : "closed";
|
|
98
|
-
if (__v != null && __v !== false)
|
|
99
|
-
__el1.setAttribute("data-state", __v === true ? "" : __v);
|
|
100
|
-
}
|
|
101
|
-
__on(__el1, "click", () => toggleItem(value));
|
|
102
|
-
return __el1;
|
|
103
|
-
})();
|
|
104
|
-
const content = (() => {
|
|
105
|
-
const __el2 = __element("div");
|
|
106
|
-
__el2.setAttribute("role", "region");
|
|
107
|
-
{
|
|
108
|
-
const __v = contentId;
|
|
109
|
-
if (__v != null && __v !== false)
|
|
110
|
-
__el2.setAttribute("id", __v === true ? "" : __v);
|
|
111
|
-
}
|
|
112
|
-
{
|
|
113
|
-
const __v = triggerId;
|
|
114
|
-
if (__v != null && __v !== false)
|
|
115
|
-
__el2.setAttribute("aria-labelledby", __v === true ? "" : __v);
|
|
116
|
-
}
|
|
117
|
-
{
|
|
118
|
-
const __v = isOpen ? "false" : "true";
|
|
119
|
-
if (__v != null && __v !== false)
|
|
120
|
-
__el2.setAttribute("aria-hidden", __v === true ? "" : __v);
|
|
121
|
-
}
|
|
122
|
-
{
|
|
123
|
-
const __v = isOpen ? "open" : "closed";
|
|
124
|
-
if (__v != null && __v !== false)
|
|
125
|
-
__el2.setAttribute("data-state", __v === true ? "" : __v);
|
|
126
|
-
}
|
|
127
|
-
{
|
|
128
|
-
const __v = isOpen ? "" : undefined;
|
|
129
|
-
if (__v != null && __v !== false)
|
|
130
|
-
__el2.setAttribute("data-initial", __v === true ? "" : __v);
|
|
131
|
-
}
|
|
132
|
-
{
|
|
133
|
-
const __v = { display: isOpen ? "" : "none" };
|
|
134
|
-
if (__v != null && __v !== false)
|
|
135
|
-
__el2.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
136
|
-
}
|
|
137
|
-
return __el2;
|
|
138
|
-
})();
|
|
139
|
-
const item = (() => {
|
|
140
|
-
const __el3 = __element("div");
|
|
141
|
-
{
|
|
142
|
-
const __v = value;
|
|
143
|
-
if (__v != null && __v !== false)
|
|
144
|
-
__el3.setAttribute("data-value", __v === true ? "" : __v);
|
|
145
|
-
}
|
|
146
|
-
__enterChildren(__el3);
|
|
147
|
-
__insert(__el3, trigger);
|
|
148
|
-
__insert(__el3, content);
|
|
149
|
-
__exitChildren();
|
|
150
|
-
return __el3;
|
|
151
|
-
})();
|
|
152
|
-
itemMap.set(value, { trigger, content });
|
|
153
|
-
triggers.push(trigger);
|
|
154
|
-
if (isOpen) {
|
|
155
|
-
requestAnimationFrame(() => {
|
|
156
|
-
const height = content.scrollHeight;
|
|
157
|
-
content.style.setProperty("--accordion-content-height", `${height}px`);
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
return { item, trigger, content };
|
|
161
|
-
};
|
|
162
|
-
const { multiple = false, defaultValue = [], onValueChange, ...attrs } = options;
|
|
163
|
-
const state = { value: signal([...defaultValue]) };
|
|
164
|
-
const triggers = [];
|
|
165
|
-
const itemMap = new Map;
|
|
166
|
-
const root = (() => {
|
|
167
|
-
const __el0 = __element("div");
|
|
168
|
-
__el0.setAttribute("data-orientation", "vertical");
|
|
169
|
-
__on(__el0, "keydown", (event) => {
|
|
170
|
-
if (isKey(event, Keys.ArrowUp, Keys.ArrowDown, Keys.Home, Keys.End)) {
|
|
171
|
-
handleListNavigation(event, triggers, { orientation: "vertical" });
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
return __el0;
|
|
175
|
-
})();
|
|
176
|
-
applyAttrs(root, attrs);
|
|
177
|
-
const __mfResult0 = { root, state, Item };
|
|
178
|
-
__flushMountFrame();
|
|
179
|
-
return __mfResult0;
|
|
180
|
-
} catch (__mfErr) {
|
|
181
|
-
__discardMountFrame(__mfDepth);
|
|
182
|
-
throw __mfErr;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
var Accordion = {
|
|
186
|
-
Root: AccordionRoot
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
export { Accordion };
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Keys,
|
|
3
|
-
isKey
|
|
4
|
-
} from "./chunk-7867pr13.js";
|
|
5
|
-
import {
|
|
6
|
-
setDataState,
|
|
7
|
-
setValueRange
|
|
8
|
-
} from "./chunk-vevfhpc9.js";
|
|
9
|
-
import {
|
|
10
|
-
applyAttrs
|
|
11
|
-
} from "./chunk-2db2dnp3.js";
|
|
12
|
-
|
|
13
|
-
// src/resizable-panel/resizable-panel.tsx
|
|
14
|
-
import { __discardMountFrame, __element, __flushMountFrame, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
|
|
15
|
-
import { signal } from "@vertz/ui";
|
|
16
|
-
function ResizablePanelRoot(options = {}) {
|
|
17
|
-
const __mfDepth = __pushMountFrame();
|
|
18
|
-
try {
|
|
19
|
-
let updateSizes = function(newSizes) {
|
|
20
|
-
state.sizes.value = [...newSizes];
|
|
21
|
-
for (let i = 0;i < panels.length; i++) {
|
|
22
|
-
const panel = panels[i];
|
|
23
|
-
if (!panel)
|
|
24
|
-
continue;
|
|
25
|
-
const size = newSizes[i] ?? 0;
|
|
26
|
-
panel.el.style.flex = `0 0 ${size}%`;
|
|
27
|
-
}
|
|
28
|
-
for (let i = 0;i < handles.length; i++) {
|
|
29
|
-
const handle = handles[i];
|
|
30
|
-
const leftPanel = panels[i];
|
|
31
|
-
if (handle && leftPanel) {
|
|
32
|
-
const size = newSizes[i] ?? 0;
|
|
33
|
-
setValueRange(handle, Math.round(size), Math.round(leftPanel.minSize), Math.round(leftPanel.maxSize));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
onResize?.(newSizes);
|
|
37
|
-
}, Panel = function(panelOptions = {}) {
|
|
38
|
-
const { defaultSize, minSize = 0, maxSize = 100 } = panelOptions;
|
|
39
|
-
const el = (() => {
|
|
40
|
-
const __el1 = __element("div");
|
|
41
|
-
__el1.setAttribute("data-panel", "");
|
|
42
|
-
return __el1;
|
|
43
|
-
})();
|
|
44
|
-
panels.push({ el, minSize, maxSize });
|
|
45
|
-
const sizes = state.sizes.peek();
|
|
46
|
-
if (defaultSize != null) {
|
|
47
|
-
sizes.push(defaultSize);
|
|
48
|
-
} else {
|
|
49
|
-
const equalSize = 100 / panels.length;
|
|
50
|
-
sizes.length = 0;
|
|
51
|
-
for (let i = 0;i < panels.length; i++) {
|
|
52
|
-
sizes.push(equalSize);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
updateSizes(sizes);
|
|
56
|
-
return el;
|
|
57
|
-
}, Handle = function() {
|
|
58
|
-
const handleIndex = handles.length;
|
|
59
|
-
const handle = (() => {
|
|
60
|
-
const __el2 = __element("div");
|
|
61
|
-
__el2.setAttribute("role", "separator");
|
|
62
|
-
__el2.setAttribute("tabindex", "0");
|
|
63
|
-
{
|
|
64
|
-
const __v = orientation;
|
|
65
|
-
if (__v != null && __v !== false)
|
|
66
|
-
__el2.setAttribute("data-orientation", __v === true ? "" : __v);
|
|
67
|
-
}
|
|
68
|
-
__el2.setAttribute("data-state", "idle");
|
|
69
|
-
__on(__el2, "keydown", (event) => {
|
|
70
|
-
const sizes = [...state.sizes.peek()];
|
|
71
|
-
const leftIdx = handleIndex;
|
|
72
|
-
const rightIdx = handleIndex + 1;
|
|
73
|
-
const leftPanel = panels[leftIdx];
|
|
74
|
-
const rightPanel = panels[rightIdx];
|
|
75
|
-
if (!leftPanel || !rightPanel)
|
|
76
|
-
return;
|
|
77
|
-
let leftSize = sizes[leftIdx] ?? 0;
|
|
78
|
-
let rightSize = sizes[rightIdx] ?? 0;
|
|
79
|
-
const STEP = 5;
|
|
80
|
-
const growKey = orientation === "horizontal" ? Keys.ArrowRight : Keys.ArrowDown;
|
|
81
|
-
const shrinkKey = orientation === "horizontal" ? Keys.ArrowLeft : Keys.ArrowUp;
|
|
82
|
-
if (isKey(event, growKey)) {
|
|
83
|
-
event.preventDefault();
|
|
84
|
-
const delta = Math.min(STEP, rightSize - rightPanel.minSize, leftPanel.maxSize - leftSize);
|
|
85
|
-
leftSize += delta;
|
|
86
|
-
rightSize -= delta;
|
|
87
|
-
} else if (isKey(event, shrinkKey)) {
|
|
88
|
-
event.preventDefault();
|
|
89
|
-
const delta = Math.min(STEP, leftSize - leftPanel.minSize, rightPanel.maxSize - rightSize);
|
|
90
|
-
leftSize -= delta;
|
|
91
|
-
rightSize += delta;
|
|
92
|
-
} else if (isKey(event, Keys.Home)) {
|
|
93
|
-
event.preventDefault();
|
|
94
|
-
const delta = leftSize - leftPanel.minSize;
|
|
95
|
-
leftSize -= delta;
|
|
96
|
-
rightSize += delta;
|
|
97
|
-
} else if (isKey(event, Keys.End)) {
|
|
98
|
-
event.preventDefault();
|
|
99
|
-
const delta = rightSize - rightPanel.minSize;
|
|
100
|
-
leftSize += delta;
|
|
101
|
-
rightSize -= delta;
|
|
102
|
-
} else {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
sizes[leftIdx] = leftSize;
|
|
106
|
-
sizes[rightIdx] = rightSize;
|
|
107
|
-
updateSizes(sizes);
|
|
108
|
-
});
|
|
109
|
-
__on(__el2, "pointerdown", (event) => {
|
|
110
|
-
event.preventDefault();
|
|
111
|
-
handle.setPointerCapture(event.pointerId);
|
|
112
|
-
setDataState(handle, "dragging");
|
|
113
|
-
const startPos = orientation === "horizontal" ? event.clientX : event.clientY;
|
|
114
|
-
const rootSize = orientation === "horizontal" ? root.offsetWidth : root.offsetHeight;
|
|
115
|
-
const startSizes = [...state.sizes.peek()];
|
|
116
|
-
function onMove(e) {
|
|
117
|
-
const currentPos = orientation === "horizontal" ? e.clientX : e.clientY;
|
|
118
|
-
const delta = (currentPos - startPos) / rootSize * 100;
|
|
119
|
-
const sizes = [...startSizes];
|
|
120
|
-
const leftIdx = handleIndex;
|
|
121
|
-
const rightIdx = handleIndex + 1;
|
|
122
|
-
const leftPanel = panels[leftIdx];
|
|
123
|
-
const rightPanel = panels[rightIdx];
|
|
124
|
-
if (!leftPanel || !rightPanel)
|
|
125
|
-
return;
|
|
126
|
-
let newLeft = (startSizes[leftIdx] ?? 0) + delta;
|
|
127
|
-
let newRight = (startSizes[rightIdx] ?? 0) - delta;
|
|
128
|
-
newLeft = Math.max(leftPanel.minSize, Math.min(leftPanel.maxSize, newLeft));
|
|
129
|
-
newRight = Math.max(rightPanel.minSize, Math.min(rightPanel.maxSize, newRight));
|
|
130
|
-
sizes[leftIdx] = newLeft;
|
|
131
|
-
sizes[rightIdx] = newRight;
|
|
132
|
-
updateSizes(sizes);
|
|
133
|
-
}
|
|
134
|
-
function onUp(e) {
|
|
135
|
-
handle.releasePointerCapture(e.pointerId);
|
|
136
|
-
setDataState(handle, "idle");
|
|
137
|
-
handle.removeEventListener("pointermove", onMove);
|
|
138
|
-
handle.removeEventListener("pointerup", onUp);
|
|
139
|
-
}
|
|
140
|
-
handle.addEventListener("pointermove", onMove);
|
|
141
|
-
handle.addEventListener("pointerup", onUp);
|
|
142
|
-
});
|
|
143
|
-
return __el2;
|
|
144
|
-
})();
|
|
145
|
-
handles.push(handle);
|
|
146
|
-
return handle;
|
|
147
|
-
};
|
|
148
|
-
const { orientation = "horizontal", onResize, ...attrs } = options;
|
|
149
|
-
const state = { sizes: signal([]) };
|
|
150
|
-
const panels = [];
|
|
151
|
-
const handles = [];
|
|
152
|
-
const root = (() => {
|
|
153
|
-
const __el0 = __element("div");
|
|
154
|
-
{
|
|
155
|
-
const __v = { display: "flex", flexDirection: orientation === "horizontal" ? "row" : "column" };
|
|
156
|
-
if (__v != null && __v !== false)
|
|
157
|
-
__el0.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
158
|
-
}
|
|
159
|
-
{
|
|
160
|
-
const __v = orientation;
|
|
161
|
-
if (__v != null && __v !== false)
|
|
162
|
-
__el0.setAttribute("data-orientation", __v === true ? "" : __v);
|
|
163
|
-
}
|
|
164
|
-
return __el0;
|
|
165
|
-
})();
|
|
166
|
-
applyAttrs(root, attrs);
|
|
167
|
-
const __mfResult0 = { root, state, Panel, Handle };
|
|
168
|
-
__flushMountFrame();
|
|
169
|
-
return __mfResult0;
|
|
170
|
-
} catch (__mfErr) {
|
|
171
|
-
__discardMountFrame(__mfDepth);
|
|
172
|
-
throw __mfErr;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
var ResizablePanel = {
|
|
176
|
-
Root: ResizablePanelRoot
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
export { ResizablePanel };
|