@vertz/ui-primitives 0.2.23 → 0.2.24
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-pzx0vpq1.js → chunk-00fqgnq1.js} +6 -11
- package/dist/shared/chunk-1hm0mbke.js +258 -0
- package/dist/shared/{chunk-ww7k2azn.js → chunk-20kwns82.js} +5 -9
- package/dist/shared/chunk-3jack97k.js +509 -0
- package/dist/shared/{chunk-xs6gp369.js → chunk-455p0jbk.js} +3 -7
- package/dist/shared/chunk-4gyg71bn.js +178 -0
- package/dist/shared/chunk-4z006v1j.js +467 -0
- package/dist/shared/{chunk-b25npqer.js → chunk-585ysr70.js} +1 -1
- package/dist/shared/chunk-75pegjs7.js +26 -0
- package/dist/shared/{chunk-mr1tb0dp.js → chunk-7a2nqmeh.js} +1 -1
- package/dist/shared/chunk-7wem1bhb.js +252 -0
- package/dist/shared/{chunk-7cb3z0s8.js → chunk-8evj43jn.js} +5 -8
- package/dist/shared/chunk-8t0nm721.js +152 -0
- package/dist/shared/chunk-94twh4s4.js +28 -0
- package/dist/shared/chunk-98y1sw9y.js +398 -0
- package/dist/shared/chunk-9eedsnnk.js +164 -0
- package/dist/shared/{chunk-8c01c8mb.js → chunk-9hv3vc72.js} +0 -2
- package/dist/shared/chunk-aa3w85hn.js +321 -0
- package/dist/shared/chunk-axpbdpgx.js +177 -0
- package/dist/shared/chunk-b4zzg457.js +410 -0
- package/dist/shared/chunk-brk0drrk.js +202 -0
- package/dist/shared/chunk-czv0kqj4.js +107 -0
- package/dist/shared/chunk-d83ag07h.js +189 -0
- package/dist/shared/{chunk-3kwh27dv.js → chunk-de18ashk.js} +0 -1
- package/dist/shared/{chunk-cgb2j94g.js → chunk-dvk4h36t.js} +0 -1
- package/dist/shared/chunk-e6660g7e.js +179 -0
- package/dist/shared/{chunk-3h1mxp95.js → chunk-eq4d9b0w.js} +0 -1
- package/dist/shared/chunk-ev367pq3.js +102 -0
- package/dist/shared/{chunk-4894pmy6.js → chunk-f0wy7k56.js} +0 -1
- package/dist/shared/chunk-fjykbv0v.js +214 -0
- package/dist/shared/chunk-ghkw5bjq.js +55 -0
- package/dist/shared/chunk-gqb1n1hj.js +60 -0
- package/dist/shared/chunk-hfjtkytb.js +310 -0
- package/dist/shared/chunk-hpvjfj0j.js +31 -0
- package/dist/shared/chunk-hxmxvp56.js +67 -0
- package/dist/shared/chunk-j9m2f0rd.js +162 -0
- package/dist/shared/chunk-jpyjk616.js +52 -0
- package/dist/shared/{chunk-ttb2tt03.js → chunk-jsa3byag.js} +1 -1
- package/dist/shared/{chunk-9gfp3ffv.js → chunk-jzy1bkdk.js} +0 -1
- package/dist/shared/{chunk-f2vx4tpw.js → chunk-knzg86am.js} +5 -5
- package/dist/shared/chunk-kskxxc2q.js +228 -0
- package/dist/shared/chunk-metxdt5x.js +28 -0
- package/dist/shared/chunk-mhn2aazf.js +353 -0
- package/dist/shared/chunk-mtx2cfbx.js +175 -0
- package/dist/shared/chunk-nsmvdxgp.js +213 -0
- package/dist/shared/{chunk-pn6shbcs.js → chunk-pdzmg245.js} +1 -5
- package/dist/shared/chunk-pzknpa1y.js +327 -0
- package/dist/shared/chunk-q1ff3xp3.js +95 -0
- package/dist/shared/chunk-q7xbcj9q.js +7 -0
- package/dist/shared/{chunk-p0x7hgv6.js → chunk-qhnany7w.js} +0 -2
- package/dist/shared/chunk-qrm43tr3.js +357 -0
- package/dist/shared/{chunk-xa1b96mb.js → chunk-qsp7sfhp.js} +2 -2
- package/dist/shared/{chunk-j902w020.js → chunk-qwqnjjg8.js} +1 -1
- package/dist/shared/{chunk-h3v10x04.js → chunk-r0rz7z03.js} +6 -11
- package/dist/shared/chunk-r3ngaa64.js +418 -0
- package/dist/shared/chunk-r3pffzss.js +13 -0
- package/dist/shared/chunk-rrt62bp0.js +353 -0
- package/dist/shared/chunk-s24gkmna.js +131 -0
- package/dist/shared/chunk-s62e7jf4.js +30 -0
- package/dist/shared/chunk-spng4yb9.js +73 -0
- package/dist/shared/chunk-v0b5pkcq.js +30 -0
- package/dist/shared/chunk-v11kd39k.js +162 -0
- package/dist/shared/{chunk-0mcr52hc.js → chunk-vef3sepw.js} +17 -1
- package/dist/shared/chunk-vkscwzpr.js +294 -0
- package/dist/shared/chunk-vv187snj.js +112 -0
- package/dist/shared/chunk-wqsek87j.js +311 -0
- package/dist/shared/chunk-wtkxz2te.js +157 -0
- package/dist/shared/chunk-y1hpsqzy.js +185 -0
- package/dist/shared/chunk-yfzddvxc.js +71 -0
- package/dist/src/accordion/accordion-composed.d.ts +30 -0
- package/dist/src/accordion/accordion-composed.js +6 -0
- package/dist/src/accordion/accordion.js +1 -1
- package/dist/src/alert/alert-composed.d.ts +26 -0
- package/dist/src/alert/alert-composed.js +6 -0
- package/dist/src/alert-dialog/alert-dialog-composed.d.ts +40 -0
- package/dist/src/alert-dialog/alert-dialog-composed.js +6 -0
- package/dist/src/avatar/avatar-composed.d.ts +33 -0
- package/dist/src/avatar/avatar-composed.js +6 -0
- package/dist/src/badge/badge-composed.d.ts +33 -0
- package/dist/src/badge/badge-composed.js +6 -0
- package/dist/src/breadcrumb/breadcrumb-composed.d.ts +34 -0
- package/dist/src/breadcrumb/breadcrumb-composed.js +6 -0
- package/dist/src/button/button-composed.d.ts +34 -0
- package/dist/src/button/button-composed.js +6 -0
- package/dist/src/calendar/calendar-composed.d.ts +42 -0
- package/dist/src/calendar/calendar-composed.js +6 -0
- package/dist/src/calendar/calendar.js +1 -1
- package/dist/src/card/card-composed.d.ts +34 -0
- package/dist/src/card/card-composed.js +6 -0
- package/dist/src/carousel/carousel-composed.d.ts +32 -0
- package/dist/src/carousel/carousel-composed.js +6 -0
- package/dist/src/carousel/carousel.js +1 -1
- package/dist/src/checkbox/checkbox-composed.d.ts +18 -0
- package/dist/src/checkbox/checkbox-composed.js +6 -0
- package/dist/src/collapsible/collapsible-composed.d.ts +26 -0
- package/dist/src/collapsible/collapsible-composed.js +6 -0
- package/dist/src/combobox/combobox-composed.d.ts +30 -0
- package/dist/src/combobox/combobox-composed.js +6 -0
- package/dist/src/combobox/combobox.js +1 -1
- package/dist/src/command/command-composed.d.ts +67 -0
- package/dist/src/command/command-composed.js +6 -0
- package/dist/src/command/command.js +1 -1
- package/dist/src/composed/with-styles.d.ts +38 -0
- package/dist/src/composed/with-styles.js +6 -0
- package/dist/src/context-menu/context-menu-composed.d.ts +51 -0
- package/dist/src/context-menu/context-menu-composed.js +6 -0
- package/dist/src/context-menu/context-menu.js +1 -1
- package/dist/src/date-picker/date-picker-composed.d.ts +77 -0
- package/dist/src/date-picker/date-picker-composed.js +6 -0
- package/dist/src/date-picker/date-picker.js +1 -1
- package/dist/src/dialog/dialog-composed.d.ts +36 -0
- package/dist/src/dialog/dialog-composed.js +6 -0
- package/dist/src/dialog/dialog-stack-parts.d.ts +16 -0
- package/dist/src/dialog/dialog-stack-parts.js +18 -0
- package/dist/src/dropdown-menu/dropdown-menu-composed.d.ts +51 -0
- package/dist/src/dropdown-menu/dropdown-menu-composed.js +6 -0
- package/dist/src/dropdown-menu/dropdown-menu.js +1 -1
- package/dist/src/empty-state/empty-state-composed.d.ts +30 -0
- package/dist/src/empty-state/empty-state-composed.js +6 -0
- package/dist/src/form-group/form-group-composed.d.ts +24 -0
- package/dist/src/form-group/form-group-composed.js +6 -0
- package/dist/src/hover-card/hover-card-composed.d.ts +38 -0
- package/dist/src/hover-card/hover-card-composed.js +6 -0
- package/dist/src/hover-card/hover-card.js +1 -1
- package/dist/src/index.d.ts +1284 -817
- package/dist/src/index.js +78 -6566
- package/dist/src/input/input-composed.d.ts +35 -0
- package/dist/src/input/input-composed.js +6 -0
- package/dist/src/label/label-composed.d.ts +32 -0
- package/dist/src/label/label-composed.js +6 -0
- package/dist/src/menu/menu-composed.d.ts +51 -0
- package/dist/src/menu/menu-composed.js +6 -0
- package/dist/src/menu/menu.js +1 -1
- package/dist/src/menubar/menubar-composed.d.ts +56 -0
- package/dist/src/menubar/menubar-composed.js +6 -0
- package/dist/src/menubar/menubar.js +1 -1
- package/dist/src/navigation-menu/navigation-menu-composed.d.ts +56 -0
- package/dist/src/navigation-menu/navigation-menu-composed.js +6 -0
- package/dist/src/navigation-menu/navigation-menu.js +1 -1
- package/dist/src/pagination/pagination-composed.d.ts +30 -0
- package/dist/src/pagination/pagination-composed.js +6 -0
- package/dist/src/popover/popover-composed.d.ts +36 -0
- package/dist/src/popover/popover-composed.js +6 -0
- package/dist/src/popover/popover.js +1 -1
- package/dist/src/progress/progress-composed.d.ts +17 -0
- package/dist/src/progress/progress-composed.js +6 -0
- package/dist/src/radio/radio-composed.d.ts +24 -0
- package/dist/src/radio/radio-composed.js +6 -0
- package/dist/src/radio/radio.js +1 -1
- package/dist/src/resizable-panel/resizable-panel-composed.d.ts +33 -0
- package/dist/src/resizable-panel/resizable-panel-composed.js +6 -0
- package/dist/src/resizable-panel/resizable-panel.js +1 -1
- package/dist/src/scroll-area/scroll-area-composed.d.ts +17 -0
- package/dist/src/scroll-area/scroll-area-composed.js +6 -0
- package/dist/src/scroll-area/scroll-area.js +1 -1
- package/dist/src/select/select-composed.d.ts +53 -0
- package/dist/src/select/select-composed.js +6 -0
- package/dist/src/select/select.js +1 -1
- package/dist/src/separator/separator-composed.d.ts +32 -0
- package/dist/src/separator/separator-composed.js +6 -0
- package/dist/src/sheet/sheet-composed.d.ts +34 -0
- package/dist/src/sheet/sheet-composed.js +6 -0
- package/dist/src/skeleton/skeleton-composed.d.ts +65 -0
- package/dist/src/skeleton/skeleton-composed.js +6 -0
- package/dist/src/slider/slider-composed.d.ts +22 -0
- package/dist/src/slider/slider-composed.js +6 -0
- package/dist/src/switch/switch-composed.d.ts +17 -0
- package/dist/src/switch/switch-composed.js +6 -0
- package/dist/src/table/table-composed.d.ts +34 -0
- package/dist/src/table/table-composed.js +6 -0
- package/dist/src/tabs/tabs-composed.d.ts +33 -0
- package/dist/src/tabs/tabs-composed.js +6 -0
- package/dist/src/tabs/tabs.js +1 -1
- package/dist/src/textarea/textarea-composed.d.ts +35 -0
- package/dist/src/textarea/textarea-composed.js +6 -0
- package/dist/src/toast/toast.js +1 -1
- package/dist/src/toggle/toggle-composed.d.ts +16 -0
- package/dist/src/toggle/toggle-composed.js +6 -0
- package/dist/src/toggle-group/toggle-group-composed.d.ts +24 -0
- package/dist/src/toggle-group/toggle-group-composed.js +6 -0
- package/dist/src/toggle-group/toggle-group.js +1 -1
- package/dist/src/tooltip/tooltip-composed.d.ts +36 -0
- package/dist/src/tooltip/tooltip-composed.js +6 -0
- package/dist/src/tooltip/tooltip.js +1 -1
- package/dist/src/utils.js +1 -1
- package/package.json +3 -3
- package/dist/shared/chunk-56reyd5r.js +0 -64
- package/dist/shared/chunk-mgr904ap.js +0 -370
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
createFloatingPosition,
|
|
6
6
|
virtualElement
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-vef3sepw.js";
|
|
8
8
|
import {
|
|
9
9
|
Keys,
|
|
10
10
|
handleListNavigation,
|
|
@@ -72,7 +72,7 @@ function ContextMenuRoot(options = {}) {
|
|
|
72
72
|
} else {
|
|
73
73
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
74
74
|
}
|
|
75
|
-
}, createItem = function(value, label
|
|
75
|
+
}, createItem = function(value, label) {
|
|
76
76
|
const item = (() => {
|
|
77
77
|
const __el2 = __element("div");
|
|
78
78
|
__el2.setAttribute("role", "menuitem");
|
|
@@ -92,7 +92,6 @@ function ContextMenuRoot(options = {}) {
|
|
|
92
92
|
return __el2;
|
|
93
93
|
})();
|
|
94
94
|
items.push(item);
|
|
95
|
-
(parent ?? content).appendChild(item);
|
|
96
95
|
return item;
|
|
97
96
|
}, Item = function(value, label) {
|
|
98
97
|
return createItem(value, label);
|
|
@@ -107,21 +106,19 @@ function ContextMenuRoot(options = {}) {
|
|
|
107
106
|
}
|
|
108
107
|
return __el3;
|
|
109
108
|
})();
|
|
110
|
-
content.appendChild(el);
|
|
111
109
|
return {
|
|
112
110
|
el,
|
|
113
|
-
Item: (value, itemLabel) => createItem(value, itemLabel
|
|
111
|
+
Item: (value, itemLabel) => createItem(value, itemLabel)
|
|
114
112
|
};
|
|
115
113
|
}, Separator = function() {
|
|
116
|
-
|
|
114
|
+
return (() => {
|
|
117
115
|
const __el4 = __element("hr");
|
|
116
|
+
__el4.setAttribute("data-v-id", "ContextMenuRoot");
|
|
118
117
|
__el4.setAttribute("role", "separator");
|
|
119
118
|
return __el4;
|
|
120
119
|
})();
|
|
121
|
-
content.appendChild(hr);
|
|
122
|
-
return hr;
|
|
123
120
|
}, Label = function(text) {
|
|
124
|
-
|
|
121
|
+
return (() => {
|
|
125
122
|
const __el5 = __element("div");
|
|
126
123
|
__el5.setAttribute("role", "none");
|
|
127
124
|
__enterChildren(__el5);
|
|
@@ -129,8 +126,6 @@ function ContextMenuRoot(options = {}) {
|
|
|
129
126
|
__exitChildren();
|
|
130
127
|
return __el5;
|
|
131
128
|
})();
|
|
132
|
-
content.appendChild(el);
|
|
133
|
-
return el;
|
|
134
129
|
};
|
|
135
130
|
const { onSelect, positioning, ...attrs } = options;
|
|
136
131
|
const state = {
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-q7xbcj9q.js";
|
|
4
|
+
|
|
5
|
+
// src/resizable-panel/resizable-panel-composed.tsx
|
|
6
|
+
import { computed, signal } from "@vertz/ui";
|
|
7
|
+
import { __append, __attr, __child, __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
|
|
8
|
+
import { createContext, useContext } from "@vertz/ui";
|
|
9
|
+
var _groupCounter = { value: 0 };
|
|
10
|
+
var ResizablePanelContext = createContext(undefined, "@vertz/ui-primitives::ResizablePanelContext");
|
|
11
|
+
function ResizablePanelPanel(__props) {
|
|
12
|
+
const __mfDepth = __pushMountFrame();
|
|
13
|
+
try {
|
|
14
|
+
const ctx = useContext(ResizablePanelContext);
|
|
15
|
+
if (!ctx) {
|
|
16
|
+
throw new Error("<ResizablePanel.Panel> must be used inside <ResizablePanel>. " + "Ensure it is a direct or nested child of the ResizablePanel root component.");
|
|
17
|
+
}
|
|
18
|
+
const index = computed(() => ctx.registerPanel({ defaultSize: __props.defaultSize, minSize: __props.minSize, maxSize: __props.maxSize }));
|
|
19
|
+
const __mfResult0 = (() => {
|
|
20
|
+
const __el0 = __element("div");
|
|
21
|
+
__el0.setAttribute("data-part", "panel");
|
|
22
|
+
__attr(__el0, "data-group", () => ctx.groupId);
|
|
23
|
+
__attr(__el0, "style", () => ({ flex: `${ctx.getSizeForPanel(index.value)} 1 0`, minWidth: 0, minHeight: 0 }));
|
|
24
|
+
__attr(__el0, "class", () => cn(ctx.classes?.panel, __props.className ?? __props.class));
|
|
25
|
+
__enterChildren(__el0);
|
|
26
|
+
__append(__el0, __child(() => __props.children));
|
|
27
|
+
__exitChildren();
|
|
28
|
+
return __el0;
|
|
29
|
+
})();
|
|
30
|
+
__flushMountFrame();
|
|
31
|
+
return __mfResult0;
|
|
32
|
+
} catch (__mfErr) {
|
|
33
|
+
__discardMountFrame(__mfDepth);
|
|
34
|
+
throw __mfErr;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function ResizablePanelHandle(__props) {
|
|
38
|
+
const __mfDepth = __pushMountFrame();
|
|
39
|
+
try {
|
|
40
|
+
const ctx = useContext(ResizablePanelContext);
|
|
41
|
+
if (!ctx) {
|
|
42
|
+
throw new Error("<ResizablePanel.Handle> must be used inside <ResizablePanel>. " + "Ensure it is a direct or nested child of the ResizablePanel root component.");
|
|
43
|
+
}
|
|
44
|
+
const handleIndex = computed(() => ctx.registerHandle());
|
|
45
|
+
const __mfResult0 = (() => {
|
|
46
|
+
const __el0 = __element("div");
|
|
47
|
+
__el0.setAttribute("role", "separator");
|
|
48
|
+
__el0.setAttribute("tabindex", "0");
|
|
49
|
+
{
|
|
50
|
+
const __v = { flexShrink: 0 };
|
|
51
|
+
if (__v != null && __v !== false)
|
|
52
|
+
__el0.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
53
|
+
}
|
|
54
|
+
__attr(__el0, "data-group", () => ctx.groupId);
|
|
55
|
+
__attr(__el0, "data-handle-index", () => String(handleIndex.value));
|
|
56
|
+
__attr(__el0, "data-orientation", () => ctx.orientation);
|
|
57
|
+
__el0.setAttribute("data-state", "idle");
|
|
58
|
+
__attr(__el0, "aria-valuenow", () => String(ctx.getAriaForHandle(handleIndex.value).valuenow));
|
|
59
|
+
__attr(__el0, "aria-valuemin", () => String(ctx.getAriaForHandle(handleIndex.value).valuemin));
|
|
60
|
+
__attr(__el0, "aria-valuemax", () => String(ctx.getAriaForHandle(handleIndex.value).valuemax));
|
|
61
|
+
__attr(__el0, "class", () => cn(ctx.classes?.handle, __props.className ?? __props.class));
|
|
62
|
+
return __el0;
|
|
63
|
+
})();
|
|
64
|
+
__flushMountFrame();
|
|
65
|
+
return __mfResult0;
|
|
66
|
+
} catch (__mfErr) {
|
|
67
|
+
__discardMountFrame(__mfDepth);
|
|
68
|
+
throw __mfErr;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function ComposedResizablePanelRoot(__props) {
|
|
72
|
+
const __mfDepth = __pushMountFrame();
|
|
73
|
+
try {
|
|
74
|
+
let recomputeSizes = function() {
|
|
75
|
+
const configs = _reg.panelConfigs;
|
|
76
|
+
const panelCount = configs.length;
|
|
77
|
+
if (panelCount === 0)
|
|
78
|
+
return;
|
|
79
|
+
const newSizes = new Array(panelCount).fill(0);
|
|
80
|
+
const explicitIndices = new Set;
|
|
81
|
+
for (let i = 0;i < panelCount; i++) {
|
|
82
|
+
const config = configs[i];
|
|
83
|
+
if (config && config.defaultSize != null) {
|
|
84
|
+
newSizes[i] = config.defaultSize;
|
|
85
|
+
explicitIndices.add(i);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (explicitIndices.size === 0) {
|
|
89
|
+
const equal = 100 / panelCount;
|
|
90
|
+
for (let i = 0;i < panelCount; i++)
|
|
91
|
+
newSizes[i] = equal;
|
|
92
|
+
} else {
|
|
93
|
+
const used = [...explicitIndices].reduce((sum, i) => sum + (newSizes[i] ?? 0), 0);
|
|
94
|
+
const unsetCount = panelCount - explicitIndices.size;
|
|
95
|
+
const each = unsetCount > 0 ? (100 - used) / unsetCount : 0;
|
|
96
|
+
for (let i = 0;i < newSizes.length; i++) {
|
|
97
|
+
if (!explicitIndices.has(i))
|
|
98
|
+
newSizes[i] = each;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
sizes.value = newSizes;
|
|
102
|
+
}, registerPanel = function(opts) {
|
|
103
|
+
const idx = _reg.nextPanelIdx++;
|
|
104
|
+
_reg.panelConfigs.push({
|
|
105
|
+
defaultSize: opts.defaultSize,
|
|
106
|
+
minSize: opts.minSize ?? 0,
|
|
107
|
+
maxSize: opts.maxSize ?? 100
|
|
108
|
+
});
|
|
109
|
+
recomputeSizes();
|
|
110
|
+
return idx;
|
|
111
|
+
}, registerHandle = function() {
|
|
112
|
+
return _reg.nextHandleIdx++;
|
|
113
|
+
}, getSizeForPanel = function(index) {
|
|
114
|
+
return sizes.value[index] ?? 0;
|
|
115
|
+
}, getAriaForHandle = function(handleIndex) {
|
|
116
|
+
const config = _reg.panelConfigs[handleIndex];
|
|
117
|
+
return {
|
|
118
|
+
valuenow: Math.round(sizes.value[handleIndex] ?? 0),
|
|
119
|
+
valuemin: Math.round(config?.minSize ?? 0),
|
|
120
|
+
valuemax: Math.round(config?.maxSize ?? 100)
|
|
121
|
+
};
|
|
122
|
+
}, updateSizes = function(newSizes) {
|
|
123
|
+
sizes.value = [...newSizes];
|
|
124
|
+
__props.onResize?.(newSizes);
|
|
125
|
+
}, handleKeydown = function(e) {
|
|
126
|
+
const ke = e;
|
|
127
|
+
const target = ke.target;
|
|
128
|
+
if (target.getAttribute("role") !== "separator")
|
|
129
|
+
return;
|
|
130
|
+
if (target.dataset.group !== groupId)
|
|
131
|
+
return;
|
|
132
|
+
const handleIndex = Number(target.dataset.handleIndex ?? -1);
|
|
133
|
+
if (handleIndex < 0)
|
|
134
|
+
return;
|
|
135
|
+
const leftIdx = handleIndex;
|
|
136
|
+
const rightIdx = handleIndex + 1;
|
|
137
|
+
const leftConfig = _reg.panelConfigs[leftIdx];
|
|
138
|
+
const rightConfig = _reg.panelConfigs[rightIdx];
|
|
139
|
+
if (!leftConfig || !rightConfig)
|
|
140
|
+
return;
|
|
141
|
+
const leftStart = sizes.value[leftIdx] ?? 0;
|
|
142
|
+
const rightStart = sizes.value[rightIdx] ?? 0;
|
|
143
|
+
const STEP = 5;
|
|
144
|
+
const growKey = (__props.orientation ?? "horizontal") === "horizontal" ? "ArrowRight" : "ArrowDown";
|
|
145
|
+
const shrinkKey = (__props.orientation ?? "horizontal") === "horizontal" ? "ArrowLeft" : "ArrowUp";
|
|
146
|
+
let newLeft = leftStart;
|
|
147
|
+
let newRight = rightStart;
|
|
148
|
+
if (ke.key === growKey) {
|
|
149
|
+
ke.preventDefault();
|
|
150
|
+
const delta = Math.min(STEP, rightStart - rightConfig.minSize, leftConfig.maxSize - leftStart);
|
|
151
|
+
newLeft += delta;
|
|
152
|
+
newRight -= delta;
|
|
153
|
+
} else if (ke.key === shrinkKey) {
|
|
154
|
+
ke.preventDefault();
|
|
155
|
+
const delta = Math.min(STEP, leftStart - leftConfig.minSize, rightConfig.maxSize - rightStart);
|
|
156
|
+
newLeft -= delta;
|
|
157
|
+
newRight += delta;
|
|
158
|
+
} else if (ke.key === "Home") {
|
|
159
|
+
ke.preventDefault();
|
|
160
|
+
const delta = leftStart - leftConfig.minSize;
|
|
161
|
+
newLeft -= delta;
|
|
162
|
+
newRight += delta;
|
|
163
|
+
} else if (ke.key === "End") {
|
|
164
|
+
ke.preventDefault();
|
|
165
|
+
const delta = rightStart - rightConfig.minSize;
|
|
166
|
+
newLeft += delta;
|
|
167
|
+
newRight -= delta;
|
|
168
|
+
} else {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
const newSizes = sizes.value.slice();
|
|
172
|
+
newSizes[leftIdx] = newLeft;
|
|
173
|
+
newSizes[rightIdx] = newRight;
|
|
174
|
+
updateSizes(newSizes);
|
|
175
|
+
}, handlePointerdown = function(e) {
|
|
176
|
+
const pe = e;
|
|
177
|
+
const target = pe.target;
|
|
178
|
+
if (target.getAttribute("role") !== "separator")
|
|
179
|
+
return;
|
|
180
|
+
if (target.dataset.group !== groupId)
|
|
181
|
+
return;
|
|
182
|
+
pe.preventDefault();
|
|
183
|
+
target.setPointerCapture(pe.pointerId);
|
|
184
|
+
target.setAttribute("data-state", "dragging");
|
|
185
|
+
const handleIndex = Number(target.dataset.handleIndex ?? -1);
|
|
186
|
+
const rootEl = pe.currentTarget;
|
|
187
|
+
const startPos = (__props.orientation ?? "horizontal") === "horizontal" ? pe.clientX : pe.clientY;
|
|
188
|
+
const rootSize = (__props.orientation ?? "horizontal") === "horizontal" ? rootEl.offsetWidth : rootEl.offsetHeight;
|
|
189
|
+
const startSizes = sizes.value.slice();
|
|
190
|
+
function onMove(ev) {
|
|
191
|
+
const currentPos = (__props.orientation ?? "horizontal") === "horizontal" ? ev.clientX : ev.clientY;
|
|
192
|
+
const delta = (currentPos - startPos) / rootSize * 100;
|
|
193
|
+
const moveSizes = startSizes.slice();
|
|
194
|
+
const leftIdx = handleIndex;
|
|
195
|
+
const rightIdx = handleIndex + 1;
|
|
196
|
+
const leftConfig = _reg.panelConfigs[leftIdx];
|
|
197
|
+
const rightConfig = _reg.panelConfigs[rightIdx];
|
|
198
|
+
if (!leftConfig || !rightConfig)
|
|
199
|
+
return;
|
|
200
|
+
const rawLeft = Math.max(leftConfig.minSize, Math.min(leftConfig.maxSize, (startSizes[leftIdx] ?? 0) + delta));
|
|
201
|
+
const rawRight = Math.max(rightConfig.minSize, Math.min(rightConfig.maxSize, (startSizes[rightIdx] ?? 0) - delta));
|
|
202
|
+
moveSizes[leftIdx] = rawLeft;
|
|
203
|
+
moveSizes[rightIdx] = rawRight;
|
|
204
|
+
updateSizes(moveSizes);
|
|
205
|
+
}
|
|
206
|
+
function onUp(ev) {
|
|
207
|
+
target.releasePointerCapture(ev.pointerId);
|
|
208
|
+
target.setAttribute("data-state", "idle");
|
|
209
|
+
target.removeEventListener("pointermove", onMove);
|
|
210
|
+
target.removeEventListener("pointerup", onUp);
|
|
211
|
+
}
|
|
212
|
+
target.addEventListener("pointermove", onMove);
|
|
213
|
+
target.addEventListener("pointerup", onUp);
|
|
214
|
+
};
|
|
215
|
+
const groupId = String(_groupCounter.value++);
|
|
216
|
+
const _reg = {
|
|
217
|
+
nextPanelIdx: 0,
|
|
218
|
+
nextHandleIdx: 0,
|
|
219
|
+
panelConfigs: []
|
|
220
|
+
};
|
|
221
|
+
const sizes = signal([], "sizes");
|
|
222
|
+
const ctx = {
|
|
223
|
+
groupId,
|
|
224
|
+
orientation: __props.orientation ?? "horizontal",
|
|
225
|
+
classes: __props.classes,
|
|
226
|
+
registerPanel,
|
|
227
|
+
registerHandle,
|
|
228
|
+
getSizeForPanel,
|
|
229
|
+
getAriaForHandle
|
|
230
|
+
};
|
|
231
|
+
const __mfResult0 = ResizablePanelContext.Provider({ get value() {
|
|
232
|
+
return ctx;
|
|
233
|
+
}, children: () => (() => {
|
|
234
|
+
const __el0 = __element("div");
|
|
235
|
+
__attr(__el0, "style", () => ({ display: "flex", flexDirection: (__props.orientation ?? "horizontal") === "horizontal" ? "row" : "column" }));
|
|
236
|
+
__attr(__el0, "data-orientation", () => __props.orientation ?? "horizontal");
|
|
237
|
+
__attr(__el0, "data-panel-count", () => sizes.value.length);
|
|
238
|
+
__attr(__el0, "class", () => __props.classes?.root);
|
|
239
|
+
__on(__el0, "keydown", handleKeydown);
|
|
240
|
+
__on(__el0, "pointerdown", handlePointerdown);
|
|
241
|
+
__enterChildren(__el0);
|
|
242
|
+
__append(__el0, __child(() => __props.children));
|
|
243
|
+
__exitChildren();
|
|
244
|
+
return __el0;
|
|
245
|
+
})() });
|
|
246
|
+
__flushMountFrame();
|
|
247
|
+
return __mfResult0;
|
|
248
|
+
} catch (__mfErr) {
|
|
249
|
+
__discardMountFrame(__mfDepth);
|
|
250
|
+
throw __mfErr;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
var ComposedResizablePanel = Object.assign(ComposedResizablePanelRoot, {
|
|
254
|
+
Panel: ResizablePanelPanel,
|
|
255
|
+
Handle: ResizablePanelHandle
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
export { ComposedResizablePanel };
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-e2v1c9ex.js";
|
|
7
7
|
import {
|
|
8
8
|
createFloatingPosition
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-vef3sepw.js";
|
|
10
10
|
import {
|
|
11
11
|
Keys,
|
|
12
12
|
handleListNavigation,
|
|
@@ -196,7 +196,7 @@ function MenubarRoot(options = {}) {
|
|
|
196
196
|
});
|
|
197
197
|
return __el2;
|
|
198
198
|
})();
|
|
199
|
-
function createItem(val, itemLabel
|
|
199
|
+
function createItem(val, itemLabel) {
|
|
200
200
|
const item = (() => {
|
|
201
201
|
const __el3 = __element("div");
|
|
202
202
|
__el3.setAttribute("role", "menuitem");
|
|
@@ -217,7 +217,6 @@ function MenubarRoot(options = {}) {
|
|
|
217
217
|
return __el3;
|
|
218
218
|
})();
|
|
219
219
|
menuItems.push(item);
|
|
220
|
-
(parent ?? content).appendChild(item);
|
|
221
220
|
return item;
|
|
222
221
|
}
|
|
223
222
|
function Item(val, itemLabel) {
|
|
@@ -234,25 +233,22 @@ function MenubarRoot(options = {}) {
|
|
|
234
233
|
}
|
|
235
234
|
return __el4;
|
|
236
235
|
})();
|
|
237
|
-
content.appendChild(el);
|
|
238
236
|
return {
|
|
239
237
|
el,
|
|
240
|
-
Item: (val, l) => createItem(val, l
|
|
238
|
+
Item: (val, l) => createItem(val, l)
|
|
241
239
|
};
|
|
242
240
|
}
|
|
243
241
|
function Separator() {
|
|
244
|
-
|
|
242
|
+
return (() => {
|
|
245
243
|
const __el5 = __element("hr");
|
|
244
|
+
__el5.setAttribute("data-v-id", "MenubarRoot");
|
|
246
245
|
__el5.setAttribute("role", "separator");
|
|
247
246
|
return __el5;
|
|
248
247
|
})();
|
|
249
|
-
content.appendChild(hr);
|
|
250
|
-
return hr;
|
|
251
248
|
}
|
|
252
249
|
triggers.push(trigger);
|
|
253
250
|
setRovingTabindex(triggers, 0);
|
|
254
251
|
menus.set(value, { trigger, content, items: menuItems });
|
|
255
|
-
root.appendChild(trigger);
|
|
256
252
|
return { trigger, content, Item, Group, Separator };
|
|
257
253
|
};
|
|
258
254
|
const { onSelect, positioning, ...attrs } = options;
|