hys-ui 0.2.0 → 0.3.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/CHANGELOG.md +38 -0
- package/README.md +15 -1
- package/dist/components/HysAlert/HysAlert.vue.js +5 -54
- package/dist/components/HysAlert/HysAlert2.vue.js +159 -2
- package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +2 -2
- package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +285 -273
- package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +1 -1
- package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +102 -98
- package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +1 -1
- package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +273 -59
- package/dist/components/HysCalendar/HysCalendar.vue.js +3 -3
- package/dist/components/HysCalendar/HysCalendar2.vue.js +237 -225
- package/dist/components/HysCascader/HysCascader.vue.js +2 -2
- package/dist/components/HysCascader/HysCascader2.vue.js +337 -324
- package/dist/components/HysColorPicker/HysColorPanel.vue.js +7 -0
- package/dist/components/HysColorPicker/HysColorPanel2.vue.js +238 -0
- package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
- package/dist/components/HysColorPicker/HysColorPicker2.vue.js +239 -217
- package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +90 -76
- package/dist/components/HysContextMenu/HysContextMenu.vue.js +5 -89
- package/dist/components/HysContextMenu/HysContextMenu2.vue.js +247 -2
- package/dist/components/HysContextMenu/HysMenuPanel.vue.js +7 -0
- package/dist/components/HysContextMenu/HysMenuPanel2.vue.js +208 -0
- package/dist/components/HysContextMenu/HysMenuSlot.js +10 -0
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +1008 -559
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +2 -0
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +2 -2
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +539 -526
- package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +5 -3
- package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +434 -84
- package/dist/components/HysEmpty/HysEmpty.vue.js +5 -41
- package/dist/components/HysEmpty/HysEmpty2.vue.js +181 -2
- package/dist/components/HysFormItem/HysFormItem.vue.js +2 -2
- package/dist/components/HysFormItem/HysFormItem2.vue.js +171 -164
- package/dist/components/HysGantt/HysGantt.vue.js +1 -1
- package/dist/components/HysGantt/HysGantt2.vue.js +810 -795
- package/dist/components/HysMention/HysMention.vue.js +1 -1
- package/dist/components/HysMention/HysMention2.vue.js +112 -100
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +490 -85
- package/dist/components/HysPopover/HysPopover.vue.js +5 -91
- package/dist/components/HysPopover/HysPopover2.vue.js +120 -2
- package/dist/components/HysProgress/HysProgress.vue.js +2 -2
- package/dist/components/HysProgress/HysProgress2.vue.js +319 -52
- package/dist/components/HysSelect/HysSelect.vue.js +2 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +730 -594
- package/dist/components/HysSlider/HysSlider.vue.js +2 -2
- package/dist/components/HysSlider/HysSlider2.vue.js +192 -188
- package/dist/components/HysSlider/SliderTooltip.vue.js +2 -2
- package/dist/components/HysSlider/SliderTooltip2.vue.js +103 -89
- package/dist/components/HysTable/HysTable.vue.js +2 -2
- package/dist/components/HysTable/HysTable2.vue.js +389 -368
- package/dist/components/HysTagInput/HysTagInput.vue.js +5 -82
- package/dist/components/HysTagInput/HysTagInput2.vue.js +396 -2
- package/dist/components/HysTimeline/HysTimeline.vue.js +2 -2
- package/dist/components/HysTimeline/HysTimeline2.vue.js +243 -24
- package/dist/components/HysTooltip/HysTooltip.vue.js +5 -64
- package/dist/components/HysTooltip/HysTooltip2.vue.js +110 -2
- package/dist/components/HysTour/HysTour.vue.js +46 -42
- package/dist/components/HysTransfer/HysTransfer.vue.js +2 -2
- package/dist/components/HysTransfer/HysTransfer2.vue.js +237 -207
- package/dist/components/HysTransfer/HysTransferPanel.vue.js +1 -1
- package/dist/components/HysTransfer/HysTransferPanel2.vue.js +320 -271
- package/dist/components/HysTree/HysTree.vue.js +2 -2
- package/dist/components/HysTree/HysTree2.vue.js +195 -184
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +4 -4
- package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +389 -377
- package/dist/components/HysUpload/HysUpload.vue.js +2 -2
- package/dist/components/HysUpload/HysUpload2.vue.js +459 -125
- package/dist/components/HysVirtualTable/HysVirtualTable.vue.js +5 -94
- package/dist/components/HysVirtualTable/HysVirtualTable2.vue.js +656 -2
- package/dist/composables/color.js +97 -0
- package/dist/composables/dataGrid.js +68 -0
- package/dist/composables/drawer.js +17 -0
- package/dist/composables/feedback.js +14 -0
- package/dist/composables/menu.js +96 -0
- package/dist/composables/modal.js +14 -0
- package/dist/composables/overlayManager.js +48 -18
- package/dist/composables/progress.js +94 -0
- package/dist/composables/tagInput.js +16 -0
- package/dist/composables/timeline.js +19 -0
- package/dist/composables/transfer.js +19 -17
- package/dist/composables/upload.js +55 -0
- package/dist/composables/uploadRequest.js +58 -0
- package/dist/composables/useAlert.js +124 -0
- package/dist/composables/useColorPicker.js +402 -0
- package/dist/composables/useContextMenu.js +514 -0
- package/dist/composables/useDataGridRemote.js +67 -0
- package/dist/composables/useDialog.js +86 -43
- package/dist/composables/useDrawerPush.js +33 -0
- package/dist/composables/useDrawerResize.js +221 -0
- package/dist/composables/useFloating.js +110 -76
- package/dist/composables/useHysModal.js +185 -0
- package/dist/composables/useModal.js +295 -0
- package/dist/composables/useModalInteraction.js +394 -0
- package/dist/composables/usePopupSurface.js +458 -0
- package/dist/composables/useTagInput.js +313 -0
- package/dist/composables/useTransferMotion.js +185 -0
- package/dist/composables/useUpload.js +472 -0
- package/dist/composables/useUploadModel.js +65 -0
- package/dist/composables/useUploadRequests.js +266 -0
- package/dist/composables/useVirtualTableLayout.js +277 -0
- package/dist/composables/virtualTable.js +43 -0
- package/dist/index.js +27 -24
- package/dist/internal/PopupReference.js +39 -0
- package/dist/internal/PopupSurfacePanel.vue.js +7 -0
- package/dist/internal/PopupSurfacePanel2.vue.js +92 -0
- package/dist/motion/PopupMotion.js +105 -0
- package/dist/motion/popup.js +10 -0
- package/dist/style.css +1 -1
- package/dist/types/components/HysAlert/HysAlert.vue.d.ts +32 -22
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +7 -7
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +6 -1
- package/dist/types/components/HysBadge/HysBadge.vue.d.ts +3 -3
- package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +54 -31
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +3 -2
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +7 -7
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +2 -2
- package/dist/types/components/HysColorPicker/HysColorPanel.vue.d.ts +58 -0
- package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +63 -10
- package/dist/types/components/HysCommandPalette/HysCommandPalette.vue.d.ts +2 -1
- package/dist/types/components/HysContextMenu/HysContextMenu.vue.d.ts +50 -34
- package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +79 -0
- package/dist/types/components/HysContextMenu/HysMenuSlot.d.ts +8 -0
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +65 -118
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +1 -1
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +92 -35
- package/dist/types/components/HysEmpty/HysEmpty.vue.d.ts +24 -20
- package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +2 -2
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +2 -1
- package/dist/types/components/HysMention/HysMention.vue.d.ts +2 -1
- package/dist/types/components/HysModal/HysModal.vue.d.ts +111 -34
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +41 -29
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +18 -24
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +2 -2
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +13 -4
- package/dist/types/components/HysSlider/HysSlider.vue.d.ts +5 -4
- package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +3 -1
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +2 -2
- package/dist/types/components/HysTable/HysTable.vue.d.ts +4 -4
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +2 -2
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +47 -25
- package/dist/types/components/HysTimeline/HysTimeline.vue.d.ts +19 -32
- package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +39 -19
- package/dist/types/components/HysTour/HysTour.vue.d.ts +2 -1
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +2 -2
- package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +5 -3
- package/dist/types/components/HysTree/HysTree.vue.d.ts +2 -2
- package/dist/types/components/HysUpload/HysUpload.vue.d.ts +55 -67
- package/dist/types/components/HysVirtualTable/HysVirtualTable.vue.d.ts +71 -40
- package/dist/types/composables/autocomplete.d.ts +3 -0
- package/dist/types/composables/avatar.d.ts +3 -0
- package/dist/types/composables/cascader.d.ts +3 -0
- package/dist/types/composables/color.d.ts +97 -0
- package/dist/types/composables/dataGrid.d.ts +100 -0
- package/dist/types/composables/datePicker.d.ts +3 -0
- package/dist/types/composables/drawer.d.ts +102 -0
- package/dist/types/composables/feedback.d.ts +98 -0
- package/dist/types/composables/formContext.d.ts +2 -0
- package/dist/types/composables/menu.d.ts +183 -0
- package/dist/types/composables/modal.d.ts +183 -0
- package/dist/types/composables/overlayManager.d.ts +7 -3
- package/dist/types/composables/popupSurface.d.ts +83 -0
- package/dist/types/composables/progress.d.ts +92 -0
- package/dist/types/composables/selectOptions.d.ts +2 -0
- package/dist/types/composables/table.d.ts +3 -0
- package/dist/types/composables/tagInput.d.ts +96 -0
- package/dist/types/composables/timeline.d.ts +82 -0
- package/dist/types/composables/transfer.d.ts +7 -0
- package/dist/types/composables/tree.d.ts +3 -0
- package/dist/types/composables/treeSelect.d.ts +3 -0
- package/dist/types/composables/upload.d.ts +202 -0
- package/dist/types/composables/uploadRequest.d.ts +3 -0
- package/dist/types/composables/useAlert.d.ts +21 -0
- package/dist/types/composables/useCascader.d.ts +1 -1
- package/dist/types/composables/useColorPicker.d.ts +101 -0
- package/dist/types/composables/useContextMenu.d.ts +81 -0
- package/dist/types/composables/useDataGridRemote.d.ts +15 -0
- package/dist/types/composables/useDialog.d.ts +16 -3
- package/dist/types/composables/useDrawerPush.d.ts +6 -0
- package/dist/types/composables/useDrawerResize.d.ts +27 -0
- package/dist/types/composables/useFloating.d.ts +21 -2
- package/dist/types/composables/useHysModal.d.ts +44 -0
- package/dist/types/composables/useModal.d.ts +62 -0
- package/dist/types/composables/useModalInteraction.d.ts +27 -0
- package/dist/types/composables/usePopupSurface.d.ts +3341 -0
- package/dist/types/composables/useTagInput.d.ts +66 -0
- package/dist/types/composables/useTransferMotion.d.ts +36 -0
- package/dist/types/composables/useUpload.d.ts +94 -0
- package/dist/types/composables/useUploadModel.d.ts +14 -0
- package/dist/types/composables/useUploadRequests.d.ts +38 -0
- package/dist/types/composables/useVirtualTableLayout.d.ts +51 -0
- package/dist/types/composables/virtualTable.d.ts +126 -0
- package/dist/types/index.d.ts +17 -2
- package/dist/types/internal/PopupReference.d.ts +18 -0
- package/dist/types/internal/PopupSurfacePanel.vue.d.ts +37 -0
- package/dist/types/motion/PopupMotion.d.ts +59 -0
- package/dist/types/motion/popup.d.ts +12 -0
- package/package.json +1 -1
|
@@ -1,56 +1,99 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { ref as O, inject as P, computed as b, provide as R, shallowRef as g, watch as L, nextTick as w, onActivated as B, onDeactivated as H, onBeforeUnmount as M } from "vue";
|
|
2
|
+
import { overlayOwnerKey as D, registerOverlay as j, lockBodyScroll as N } from "./overlayManager.js";
|
|
3
|
+
const U = 'a[href],button:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';
|
|
4
|
+
function J(A, a, x, t = {}) {
|
|
5
|
+
const m = O(!0), h = P(D, void 0), o = b(() => m.value && (h == null ? void 0 : h.value) !== !1), i = b(() => A.value && o.value);
|
|
6
|
+
R(
|
|
7
|
+
D,
|
|
8
|
+
b(() => {
|
|
9
|
+
var e;
|
|
10
|
+
return i.value && ((e = t.childVisible) == null ? void 0 : e.call(t)) !== !1;
|
|
11
|
+
})
|
|
12
|
+
);
|
|
13
|
+
const d = g(), z = b(
|
|
14
|
+
() => {
|
|
15
|
+
var e, u;
|
|
16
|
+
return ((e = d.value) == null ? void 0 : e.zIndex.value) ?? ((u = t.zIndex) == null ? void 0 : u.call(t)) ?? 100;
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
let E = null, r, s = 0;
|
|
20
|
+
function S() {
|
|
21
|
+
var e;
|
|
22
|
+
return Array.from(
|
|
23
|
+
((e = a.value) == null ? void 0 : e.querySelectorAll(U)) ?? []
|
|
24
|
+
).filter(
|
|
25
|
+
(u) => u.tabIndex >= 0 && u.getClientRects().length > 0 && getComputedStyle(u).visibility !== "hidden" && !u.closest('[inert],[aria-hidden="true"]')
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
function T() {
|
|
13
29
|
var e;
|
|
14
|
-
|
|
30
|
+
(e = S()[0] ?? a.value) == null || e.focus({ preventScroll: !0 });
|
|
15
31
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
32
|
+
function k(e) {
|
|
33
|
+
var n, f;
|
|
34
|
+
if (!i.value || !((n = d.value) != null && n.isTop()) || !a.value) return;
|
|
18
35
|
if (e.key === "Escape") {
|
|
19
|
-
e.preventDefault(), e.stopImmediatePropagation(),
|
|
36
|
+
e.preventDefault(), e.stopImmediatePropagation(), x();
|
|
20
37
|
return;
|
|
21
38
|
}
|
|
22
|
-
if (e.key !== "Tab") return;
|
|
23
|
-
const
|
|
24
|
-
if (!
|
|
25
|
-
e.preventDefault(),
|
|
39
|
+
if (e.key !== "Tab" || ((f = t.trapFocus) == null ? void 0 : f.call(t)) === !1) return;
|
|
40
|
+
const u = S();
|
|
41
|
+
if (!u.length) {
|
|
42
|
+
e.preventDefault(), a.value.focus({ preventScroll: !0 });
|
|
26
43
|
return;
|
|
27
44
|
}
|
|
28
|
-
const l =
|
|
29
|
-
e.shiftKey && (document.activeElement === l || document.activeElement ===
|
|
45
|
+
const l = u[0], c = u[u.length - 1];
|
|
46
|
+
e.shiftKey && (document.activeElement === l || document.activeElement === a.value || !a.value.contains(document.activeElement)) ? (e.preventDefault(), c.focus({ preventScroll: !0 })) : !e.shiftKey && (document.activeElement === c || !a.value.contains(document.activeElement)) && (e.preventDefault(), l.focus({ preventScroll: !0 }));
|
|
47
|
+
}
|
|
48
|
+
function C(e) {
|
|
49
|
+
var u, l, c;
|
|
50
|
+
i.value && ((u = d.value) != null && u.isTop()) && ((l = t.trapFocus) == null ? void 0 : l.call(t)) !== !1 && e.target instanceof Node && !((c = a.value) != null && c.contains(e.target)) && T();
|
|
30
51
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
52
|
+
function F() {
|
|
53
|
+
var e;
|
|
54
|
+
i.value && ((e = t.lockScroll) == null ? void 0 : e.call(t)) !== !1 ? r ?? (r = N()) : (r == null || r(), r = void 0);
|
|
33
55
|
}
|
|
34
|
-
function
|
|
35
|
-
|
|
56
|
+
function y() {
|
|
57
|
+
var u, l;
|
|
58
|
+
const e = ((u = d.value) == null ? void 0 : u.isTop()) ?? !1;
|
|
59
|
+
return (l = d.value) == null || l.unregister(), d.value = void 0, r == null || r(), r = void 0, document.removeEventListener("keydown", k, !0), document.removeEventListener("focusin", C, !0), e;
|
|
36
60
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
61
|
+
function q(e, u, l) {
|
|
62
|
+
w(() => {
|
|
63
|
+
var n, f;
|
|
64
|
+
if (u !== s || !o.value || !l || ((n = t.restoreFocus) == null ? void 0 : n.call(t)) === !1)
|
|
65
|
+
return;
|
|
66
|
+
const c = new Event("hys-ui-close-auto-focus", { cancelable: !0 });
|
|
67
|
+
(f = t.onCloseAutoFocus) == null || f.call(t, c), !c.defaultPrevented && (e != null && e.isConnected) && e.focus({ preventScroll: !0 });
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return L(
|
|
71
|
+
i,
|
|
72
|
+
async (e) => {
|
|
73
|
+
var l, c, n, f;
|
|
74
|
+
const u = ++s;
|
|
75
|
+
if (e) {
|
|
76
|
+
if (y(), E = document.activeElement instanceof HTMLElement ? document.activeElement : null, d.value = j("dialog", x, t.zIndex), F(), document.addEventListener("keydown", k, !0), document.addEventListener("focusin", C, !0), await w(), u !== s || !i.value) return;
|
|
77
|
+
const I = new Event("hys-ui-open-auto-focus", { cancelable: !0 });
|
|
78
|
+
(l = t.onOpenAutoFocus) == null || l.call(t, I);
|
|
79
|
+
const v = (c = t.initialFocus) == null ? void 0 : c.call(t), K = v instanceof HTMLElement && v.isConnected && v.getClientRects().length > 0 && getComputedStyle(v).visibility !== "hidden" && !v.closest('[inert],[aria-hidden="true"]') && !v.disabled ? v : void 0;
|
|
80
|
+
!I.defaultPrevented && v !== !1 && ((f = K ?? ((n = a.value) == null ? void 0 : n.querySelector("[autofocus]")) ?? S()[0] ?? a.value) == null || f.focus({ preventScroll: !0 }));
|
|
81
|
+
} else q(E, u, y());
|
|
82
|
+
},
|
|
83
|
+
{ immediate: !0, flush: "post" }
|
|
84
|
+
), L(() => {
|
|
85
|
+
var e;
|
|
86
|
+
return (e = t.lockScroll) == null ? void 0 : e.call(t);
|
|
87
|
+
}, F), B(() => m.value = !0), H(() => {
|
|
88
|
+
m.value = !1, s++, y();
|
|
89
|
+
}), M(() => {
|
|
90
|
+
var c;
|
|
91
|
+
const e = E, u = y(), l = o.value && ((c = t.restoreFocus) == null ? void 0 : c.call(t)) !== !1;
|
|
92
|
+
m.value = !1, s++, l && u && w(() => {
|
|
93
|
+
e != null && e.isConnected && e.focus({ preventScroll: !0 });
|
|
94
|
+
});
|
|
95
|
+
}), { active: o, zIndex: z, focus: T };
|
|
53
96
|
}
|
|
54
97
|
export {
|
|
55
|
-
|
|
98
|
+
J as useDialog
|
|
56
99
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { inject as y, shallowRef as f, provide as w, onMounted as b, onActivated as g, onDeactivated as M, onBeforeUnmount as j, computed as v } from "vue";
|
|
2
|
+
const p = Symbol("hys-ui-drawer-parent");
|
|
3
|
+
function S(t, r, m) {
|
|
4
|
+
const c = y(p, void 0), a = f(/* @__PURE__ */ new Map()), h = Symbol("drawer-child");
|
|
5
|
+
w(p, {
|
|
6
|
+
register(e, l) {
|
|
7
|
+
return a.value = new Map(a.value).set(e, l), () => {
|
|
8
|
+
const u = new Map(a.value);
|
|
9
|
+
u.delete(e), a.value = u;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
let n;
|
|
14
|
+
const i = () => {
|
|
15
|
+
n ?? (n = c == null ? void 0 : c.register(h, r));
|
|
16
|
+
}, s = () => {
|
|
17
|
+
n == null || n(), n = void 0;
|
|
18
|
+
};
|
|
19
|
+
b(i), g(i), M(s), j(s);
|
|
20
|
+
const o = v(
|
|
21
|
+
() => !!t.push && r.value && !m.value && [...a.value.values()].some((e) => e.value)
|
|
22
|
+
), x = v(() => {
|
|
23
|
+
const e = typeof t.push == "object" ? t.push.distance : 160, l = typeof e == "number" ? Number.isFinite(e) ? Math.max(0, e) + "px" : "160px" : e || "160px", u = o.value ? l : "0px", d = o.value ? `calc(-1 * ${l})` : "0px";
|
|
24
|
+
return {
|
|
25
|
+
"--hys-ui-drawer-push-x": t.placement === "left" ? u : t.placement === "right" ? d : "0px",
|
|
26
|
+
"--hys-ui-drawer-push-y": t.placement === "top" ? u : t.placement === "bottom" ? d : "0px"
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
return { pushed: o, style: x };
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
S as useDrawerPush
|
|
33
|
+
};
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { ref as C, computed as S, watch as x, nextTick as K, onMounted as te, onActivated as ie, onDeactivated as ne, onBeforeUnmount as ae } from "vue";
|
|
2
|
+
import { useChoiceModel as re } from "./choiceModel.js";
|
|
3
|
+
import { drawerVertical as ue } from "./drawer.js";
|
|
4
|
+
function ce(i, V, c, M, $, G, d) {
|
|
5
|
+
const w = re(
|
|
6
|
+
{
|
|
7
|
+
get modelValue() {
|
|
8
|
+
return i.resizeValue;
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
() => Number.isFinite(i.defaultResizeValue) ? Math.max(0, i.defaultResizeValue) : null
|
|
12
|
+
), D = C(!1), P = C(0), F = C(0), N = C(), f = S(() => ue(i.placement)), T = S(() => {
|
|
13
|
+
const e = w.current.value;
|
|
14
|
+
if (typeof e != "number" || !Number.isFinite(e)) return;
|
|
15
|
+
const t = A();
|
|
16
|
+
return Math.max(t.min, Math.min(t.max, e));
|
|
17
|
+
}), h = S(() => T.value ?? P.value), z = S(
|
|
18
|
+
() => typeof i.resizable == "object" ? i.resizable : {}
|
|
19
|
+
), v = S(
|
|
20
|
+
() => M.value && !$.value && !G.value
|
|
21
|
+
);
|
|
22
|
+
let r = !0, y = 0, g = 0, l, s;
|
|
23
|
+
function I(e, t) {
|
|
24
|
+
if (typeof e == "number")
|
|
25
|
+
return Number.isFinite(e) ? e : void 0;
|
|
26
|
+
if (typeof e != "string" || !/^\s*\d+(?:\.\d+)?(?:px|%)?\s*$/.test(e))
|
|
27
|
+
return;
|
|
28
|
+
const n = parseFloat(e);
|
|
29
|
+
return e.trim().endsWith("%") ? t * n / 100 : n;
|
|
30
|
+
}
|
|
31
|
+
function R() {
|
|
32
|
+
var n;
|
|
33
|
+
const e = (n = V.value) == null ? void 0 : n.getBoundingClientRect(), t = f.value ? e == null ? void 0 : e.height : e == null ? void 0 : e.width;
|
|
34
|
+
return Math.max(
|
|
35
|
+
1,
|
|
36
|
+
(t && t > 0 ? t : void 0) ?? (f.value ? document.documentElement.clientHeight || window.innerHeight : document.documentElement.clientWidth || window.innerWidth)
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
function A(e = F.value || R()) {
|
|
40
|
+
const t = Math.max(
|
|
41
|
+
1,
|
|
42
|
+
Math.min(
|
|
43
|
+
e,
|
|
44
|
+
I(z.value.maxSize, e) ?? e
|
|
45
|
+
)
|
|
46
|
+
);
|
|
47
|
+
return { min: Math.min(
|
|
48
|
+
t,
|
|
49
|
+
Math.max(1, I(z.value.minSize, e) ?? 160)
|
|
50
|
+
), max: t };
|
|
51
|
+
}
|
|
52
|
+
function L() {
|
|
53
|
+
if (!r || !M.value || s || !c.value) return;
|
|
54
|
+
F.value = R();
|
|
55
|
+
const e = c.value.getBoundingClientRect();
|
|
56
|
+
P.value = f.value ? e.height : e.width;
|
|
57
|
+
}
|
|
58
|
+
function p() {
|
|
59
|
+
g && cancelAnimationFrame(g), g = requestAnimationFrame(() => {
|
|
60
|
+
g = 0, L();
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function J() {
|
|
64
|
+
var t;
|
|
65
|
+
y = 0;
|
|
66
|
+
const e = s;
|
|
67
|
+
!e || !e.activated || !c.value || e.last !== e.value && (e.last = e.value, c.value.style[e.axis] = e.value + "px", (t = N.value) == null || t.setAttribute("aria-valuenow", String(Math.round(e.value))), d("resize", e.value));
|
|
68
|
+
}
|
|
69
|
+
function Q() {
|
|
70
|
+
window.removeEventListener("pointermove", U), window.removeEventListener("pointerup", W), window.removeEventListener("pointercancel", a), window.removeEventListener("blur", a), window.removeEventListener("keydown", O, !0);
|
|
71
|
+
}
|
|
72
|
+
async function B(e) {
|
|
73
|
+
return !r || !v.value ? !1 : e === w.current.value ? !0 : await w.commit(
|
|
74
|
+
e,
|
|
75
|
+
(n) => d("update:resizeValue", n),
|
|
76
|
+
() => {
|
|
77
|
+
}
|
|
78
|
+
) && r && v.value;
|
|
79
|
+
}
|
|
80
|
+
async function b(e = !1) {
|
|
81
|
+
var o, m;
|
|
82
|
+
const t = s;
|
|
83
|
+
if (!t) return !1;
|
|
84
|
+
y && cancelAnimationFrame(y), y = 0;
|
|
85
|
+
const n = !e && t.activated && t.last !== t.value;
|
|
86
|
+
s = void 0, D.value = !1, Q(), document.documentElement.style.cursor = t.cursor, document.documentElement.style.userSelect = t.selection;
|
|
87
|
+
try {
|
|
88
|
+
(m = (o = t.target).hasPointerCapture) != null && m.call(o, t.id) && t.target.releasePointerCapture(t.id);
|
|
89
|
+
} catch {
|
|
90
|
+
}
|
|
91
|
+
c.value && (c.value.style[t.axis] = t.style), n && d("resize", t.value);
|
|
92
|
+
const u = !e && t.activated ? await B(t.value) : !1;
|
|
93
|
+
return t.activated && (await K(), r && (L(), d("resizeEnd", e || !u ? h.value : t.value, {
|
|
94
|
+
placement: i.placement ?? "right",
|
|
95
|
+
cancelled: e,
|
|
96
|
+
accepted: u
|
|
97
|
+
}))), u;
|
|
98
|
+
}
|
|
99
|
+
function a() {
|
|
100
|
+
b(!0);
|
|
101
|
+
}
|
|
102
|
+
function O(e) {
|
|
103
|
+
e.key === "Escape" ? (e.preventDefault(), e.stopImmediatePropagation(), a()) : e.key === "Tab" && a();
|
|
104
|
+
}
|
|
105
|
+
function U(e) {
|
|
106
|
+
const t = s;
|
|
107
|
+
if (!t || e.pointerId !== t.id) return;
|
|
108
|
+
const n = ((t.axis === "width" ? e.clientX : e.clientY) - t.start) * t.sign;
|
|
109
|
+
!t.activated && (Math.abs(n) < 4 || (t.activated = !0, D.value = !0, d("resizeStart", t.size), s !== t)) || (t.value = Math.max(t.min, Math.min(t.max, t.size + n)), y || (y = requestAnimationFrame(J)));
|
|
110
|
+
}
|
|
111
|
+
function W(e) {
|
|
112
|
+
s && e.pointerId === s.id && b(!1);
|
|
113
|
+
}
|
|
114
|
+
function Z(e) {
|
|
115
|
+
if (!i.resizable || !v.value || !r || e.button !== 0 || e.isPrimary === !1 || !c.value)
|
|
116
|
+
return;
|
|
117
|
+
e.preventDefault(), e.stopPropagation(), b(!0);
|
|
118
|
+
const t = R(), n = A(t), u = c.value.getBoundingClientRect(), o = f.value ? "height" : "width", m = e.currentTarget, E = o === "width" ? u.width : u.height;
|
|
119
|
+
F.value = t, P.value = E, s = {
|
|
120
|
+
id: e.pointerId,
|
|
121
|
+
start: o === "width" ? e.clientX : e.clientY,
|
|
122
|
+
size: E,
|
|
123
|
+
value: E,
|
|
124
|
+
last: E,
|
|
125
|
+
...n,
|
|
126
|
+
axis: o,
|
|
127
|
+
sign: i.placement === "right" || i.placement === "bottom" ? -1 : 1,
|
|
128
|
+
target: m,
|
|
129
|
+
style: c.value.style[o],
|
|
130
|
+
cursor: document.documentElement.style.cursor,
|
|
131
|
+
selection: document.documentElement.style.userSelect,
|
|
132
|
+
activated: !1
|
|
133
|
+
}, m.focus({ preventScroll: !0 });
|
|
134
|
+
try {
|
|
135
|
+
m.setPointerCapture(e.pointerId);
|
|
136
|
+
} catch {
|
|
137
|
+
}
|
|
138
|
+
document.documentElement.style.cursor = f.value ? "ns-resize" : "ew-resize", document.documentElement.style.userSelect = "none", window.addEventListener("pointermove", U), window.addEventListener("pointerup", W), window.addEventListener("pointercancel", a), window.addEventListener("blur", a), window.addEventListener("keydown", O, !0);
|
|
139
|
+
}
|
|
140
|
+
async function q(e) {
|
|
141
|
+
if (!r || !v.value) return !1;
|
|
142
|
+
const t = R(), n = I(e, t);
|
|
143
|
+
if (n === void 0) return !1;
|
|
144
|
+
const u = A(t), o = Math.max(u.min, Math.min(u.max, n));
|
|
145
|
+
return F.value = t, B(o);
|
|
146
|
+
}
|
|
147
|
+
async function _() {
|
|
148
|
+
return s && await b(!0), B(null);
|
|
149
|
+
}
|
|
150
|
+
async function ee(e) {
|
|
151
|
+
if (!i.resizable || !v.value || e.isComposing || e.ctrlKey || e.metaKey || e.altKey || ![...f.value ? ["ArrowUp", "ArrowDown"] : ["ArrowLeft", "ArrowRight"], "Home", "End"].includes(e.key)) return;
|
|
152
|
+
e.preventDefault(), e.stopPropagation(), L();
|
|
153
|
+
const n = A(), u = Number.isFinite(z.value.step) ? Math.max(1, z.value.step) : 10, o = i.placement === "left" ? "ArrowRight" : i.placement === "right" ? "ArrowLeft" : i.placement === "top" ? "ArrowDown" : "ArrowUp", m = e.key === "Home" ? n.min : e.key === "End" ? n.max : h.value + (e.key === o ? 1 : -1) * u * (e.shiftKey ? 10 : 1);
|
|
154
|
+
d("resizeStart", h.value);
|
|
155
|
+
const E = await q(m);
|
|
156
|
+
r && (L(), d("resize", h.value), d("resizeEnd", h.value, {
|
|
157
|
+
placement: i.placement ?? "right",
|
|
158
|
+
cancelled: !1,
|
|
159
|
+
accepted: E
|
|
160
|
+
}));
|
|
161
|
+
}
|
|
162
|
+
function k() {
|
|
163
|
+
a(), p();
|
|
164
|
+
}
|
|
165
|
+
function X() {
|
|
166
|
+
l == null || l.disconnect(), l = void 0, r && M.value && typeof ResizeObserver < "u" && V.value && i.contained && (l = new ResizeObserver(k), l.observe(V.value));
|
|
167
|
+
}
|
|
168
|
+
function H() {
|
|
169
|
+
var e;
|
|
170
|
+
!r || !M.value || (window.addEventListener("resize", k), (e = window.visualViewport) == null || e.addEventListener("resize", k), X(), p());
|
|
171
|
+
}
|
|
172
|
+
function Y() {
|
|
173
|
+
var e;
|
|
174
|
+
l == null || l.disconnect(), l = void 0, window.removeEventListener("resize", k), (e = window.visualViewport) == null || e.removeEventListener("resize", k), cancelAnimationFrame(g), g = 0;
|
|
175
|
+
}
|
|
176
|
+
function j() {
|
|
177
|
+
r = !1, b(!0), Y();
|
|
178
|
+
}
|
|
179
|
+
return x(
|
|
180
|
+
() => [i.placement, i.width, i.height, i.size],
|
|
181
|
+
() => {
|
|
182
|
+
a(), i.resizeValue === void 0 && w.reset(), K(p);
|
|
183
|
+
}
|
|
184
|
+
), x(
|
|
185
|
+
() => i.resizeValue,
|
|
186
|
+
() => {
|
|
187
|
+
a(), p();
|
|
188
|
+
}
|
|
189
|
+
), x([v, () => i.resizable], () => {
|
|
190
|
+
(!v.value || !i.resizable) && a();
|
|
191
|
+
}), x(
|
|
192
|
+
() => [z.value.minSize, z.value.maxSize],
|
|
193
|
+
() => {
|
|
194
|
+
a(), p();
|
|
195
|
+
}
|
|
196
|
+
), x(M, (e) => {
|
|
197
|
+
e ? K(H) : (a(), Y());
|
|
198
|
+
}), x([V, () => i.contained], X, { flush: "post" }), te(H), ie(() => {
|
|
199
|
+
r = !0, H();
|
|
200
|
+
}), ne(j), ae(j), {
|
|
201
|
+
handle: N,
|
|
202
|
+
resizing: D,
|
|
203
|
+
size: h,
|
|
204
|
+
vertical: f,
|
|
205
|
+
limits: A,
|
|
206
|
+
model: w,
|
|
207
|
+
resolvedSize: T,
|
|
208
|
+
start: Z,
|
|
209
|
+
stop: b,
|
|
210
|
+
keyboard: ee,
|
|
211
|
+
resizeTo: q,
|
|
212
|
+
reset: _,
|
|
213
|
+
measure: L,
|
|
214
|
+
resetAfterClose: () => {
|
|
215
|
+
i.resetSizeOnClose !== !1 && i.resizeValue === void 0 && w.reset();
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
export {
|
|
220
|
+
ce as useDrawerResize
|
|
221
|
+
};
|
|
@@ -1,128 +1,162 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { useHysControlState as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { inject as G, ref as z, shallowRef as J, watch as V, onDeactivated as Q, onBeforeUnmount as Z, computed as _, nextTick as ee } from "vue";
|
|
2
|
+
import { useHysControlState as te } from "./formContext.js";
|
|
3
|
+
import { popupSize as ie } from "../motion/popup.js";
|
|
4
|
+
import { overlayOwnerKey as ae, registerOverlay as ne } from "./overlayManager.js";
|
|
5
|
+
function de(g, r, t = {}) {
|
|
6
|
+
const { disabled: B } = te({}), y = G(ae, void 0), o = z(!1), F = J(), O = z(!1), k = z({
|
|
6
7
|
position: "fixed",
|
|
7
8
|
top: "0px",
|
|
8
9
|
left: "0px",
|
|
9
10
|
visibility: "hidden"
|
|
10
|
-
}),
|
|
11
|
-
let
|
|
12
|
-
function
|
|
13
|
-
var
|
|
14
|
-
if (!
|
|
15
|
-
const
|
|
16
|
-
if (!
|
|
11
|
+
}), N = z(t.placement ?? "bottom-start");
|
|
12
|
+
let A = 0, W, u, E = 0;
|
|
13
|
+
function C() {
|
|
14
|
+
var K, T, Y;
|
|
15
|
+
if (!o.value || !g.value || !r.value) return;
|
|
16
|
+
const e = g.value.getBoundingClientRect();
|
|
17
|
+
if (!e.width && !e.height) {
|
|
17
18
|
s();
|
|
18
19
|
return;
|
|
19
20
|
}
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
let
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
let
|
|
27
|
-
(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
const n = Number.isFinite(t.gap) ? t.gap : 8, i = Number.isFinite(t.padding) ? Math.max(0, t.padding) : 10, l = document.documentElement.clientWidth, f = document.documentElement.clientHeight, d = Math.min(e.width, Math.max(0, l - 2 * i)), M = typeof t.matchWidth == "function" ? t.matchWidth() : t.matchWidth, b = (K = t.maxWidth) == null ? void 0 : K.call(t), P = b !== void 0 && (typeof b != "number" || Number.isFinite(b)) ? `min(${typeof b == "number" ? Math.max(0, b) + "px" : b},calc(100vw - ${i * 2}px))` : `calc(100vw - ${i * 2}px)`, L = (T = t.width) == null ? void 0 : T.call(t), p = typeof L == "number" ? Number.isFinite(L) ? Math.max(0, L) + "px" : void 0 : L;
|
|
22
|
+
p !== void 0 ? (r.value.style.width = p, r.value.style.minWidth = "0", r.value.style.maxWidth = P) : M === !0 && (r.value.style.width = `${d}px`, r.value.style.minWidth = "0", r.value.style.maxWidth = `${d}px`), p === void 0 && M === "min" && (r.value.style.width = "max-content", r.value.style.minWidth = `${d}px`, r.value.style.maxWidth = `calc(100vw - ${i * 2}px)`);
|
|
23
|
+
const D = ie(r.value), h = Math.min(D.width, Math.max(0, l - 2 * i)), v = Math.min(D.height, Math.max(0, f - 2 * i));
|
|
24
|
+
let a = t.placement ?? "bottom-start";
|
|
25
|
+
const I = f - e.bottom - n, q = e.top - n, $ = t.autoAdjustOverflow !== !1;
|
|
26
|
+
$ && a.startsWith("bottom") && I < v && q > I ? a = a.replace("bottom", "top") : $ && a.startsWith("top") && q < v && I > q ? a = a.replace("top", "bottom") : $ && a.startsWith("right") && l - e.right - n < h && e.left > l - e.right ? a = a.replace("right", "left") : $ && a.startsWith("left") && e.left - n < h && l - e.right > e.left && (a = a.replace("left", "right"));
|
|
27
|
+
let w = a.endsWith("end") ? e.right - h : a.endsWith("start") ? e.left : e.left + (e.width - h) / 2, x = a.startsWith("top") ? e.top - v - n : e.bottom + n;
|
|
28
|
+
if ((a.startsWith("right") || a.startsWith("left")) && (w = a.startsWith("right") ? e.right + n : e.left - h - n, x = a.endsWith("start") ? e.top : a.endsWith("end") ? e.bottom - v : e.top + (e.height - v) / 2), w = Math.max(i, Math.min(w, l - h - i)), x = Math.max(i, Math.min(x, f - v - i)), N.value = a, (Y = t.onPosition) == null || Y.call(t, {
|
|
29
|
+
anchor: e,
|
|
30
|
+
width: h,
|
|
31
|
+
height: v,
|
|
32
|
+
x: w,
|
|
33
|
+
y: x,
|
|
34
|
+
placement: a
|
|
35
|
+
}), t.strategy === "absolute") {
|
|
36
|
+
const m = r.value.offsetParent;
|
|
37
|
+
if (m && m !== document.body && m !== document.documentElement) {
|
|
38
|
+
const U = m.getBoundingClientRect();
|
|
39
|
+
w += m.scrollLeft - U.left - m.clientLeft, x += m.scrollTop - U.top - m.clientTop;
|
|
40
|
+
} else
|
|
41
|
+
w += window.scrollX, x += window.scrollY;
|
|
42
|
+
}
|
|
43
|
+
k.value = {
|
|
44
|
+
...p !== void 0 ? { width: p, minWidth: "0" } : M === !0 ? { width: `${d}px`, minWidth: "0" } : M === "min" ? { width: "max-content", minWidth: `${d}px` } : {},
|
|
45
|
+
position: t.strategy ?? "fixed",
|
|
46
|
+
left: `${Math.round(w)}px`,
|
|
47
|
+
top: `${Math.round(x)}px`,
|
|
32
48
|
visibility: "visible",
|
|
33
49
|
zIndex: "1200",
|
|
34
|
-
maxWidth:
|
|
35
|
-
maxHeight: `calc(100vh - ${
|
|
50
|
+
maxWidth: P,
|
|
51
|
+
maxHeight: `calc(100vh - ${i * 2}px)`,
|
|
36
52
|
overflowY: "auto",
|
|
37
53
|
overscrollBehavior: "contain"
|
|
38
54
|
};
|
|
39
55
|
}
|
|
40
56
|
function c() {
|
|
41
|
-
cancelAnimationFrame(
|
|
57
|
+
cancelAnimationFrame(A), A = requestAnimationFrame(C);
|
|
42
58
|
}
|
|
43
|
-
function
|
|
44
|
-
var
|
|
45
|
-
|
|
59
|
+
function R(e) {
|
|
60
|
+
var n, i;
|
|
61
|
+
!(u != null && u()) || t.closeOnOutside === !1 || !((n = g.value) != null && n.contains(e.target)) && !((i = r.value) != null && i.contains(e.target)) && s();
|
|
46
62
|
}
|
|
47
|
-
function
|
|
48
|
-
var
|
|
49
|
-
if (!(!
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
else if (
|
|
63
|
+
function S(e) {
|
|
64
|
+
var n, i;
|
|
65
|
+
if (!(!o.value || !(u != null && u()))) {
|
|
66
|
+
if (e.key === "Escape" && t.closeOnEscape !== !1)
|
|
67
|
+
e.preventDefault(), e.stopImmediatePropagation(), s(!0);
|
|
68
|
+
else if (e.key === "Tab" && t.closeOnTab !== !1) {
|
|
53
69
|
const l = document.activeElement;
|
|
54
|
-
if ((
|
|
70
|
+
if ((n = g.value) != null && n.contains(l)) {
|
|
55
71
|
s();
|
|
56
72
|
return;
|
|
57
73
|
}
|
|
58
|
-
if ((
|
|
59
|
-
const
|
|
74
|
+
if ((i = r.value) != null && i.contains(l)) {
|
|
75
|
+
const f = Array.from(
|
|
60
76
|
r.value.querySelectorAll(
|
|
61
77
|
'a[href],button:not(:disabled),input:not(:disabled),textarea:not(:disabled),select:not(:disabled),[tabindex]:not([tabindex="-1"])'
|
|
62
78
|
)
|
|
63
79
|
).filter(
|
|
64
|
-
(
|
|
80
|
+
(d) => d.getClientRects().length && !d.closest("[inert]")
|
|
65
81
|
);
|
|
66
|
-
(!
|
|
82
|
+
(!f.length || l === (e.shiftKey ? f[0] : f.at(-1))) && s(!0);
|
|
67
83
|
}
|
|
68
84
|
}
|
|
69
85
|
}
|
|
70
86
|
}
|
|
71
|
-
function
|
|
72
|
-
var
|
|
73
|
-
document.removeEventListener("pointerdown",
|
|
87
|
+
function j() {
|
|
88
|
+
var e, n;
|
|
89
|
+
document.removeEventListener("pointerdown", R, !0), document.removeEventListener("keydown", S, !0), window.removeEventListener("resize", c), window.removeEventListener("scroll", c, !0), (e = window.visualViewport) == null || e.removeEventListener("resize", c), (n = window.visualViewport) == null || n.removeEventListener("scroll", c), cancelAnimationFrame(A), W == null || W(), W = void 0, F.value = void 0, u = void 0;
|
|
74
90
|
}
|
|
75
|
-
function s(
|
|
76
|
-
var
|
|
77
|
-
if (!(!
|
|
78
|
-
|
|
91
|
+
function s(e = !1, n = !1) {
|
|
92
|
+
var i, l;
|
|
93
|
+
if (!(!n && o.value && ((i = t.requestOpen) == null ? void 0 : i.call(t, !1, e)) === !1) && (E++, !!o.value && (o.value = !1, j(), e && ((l = g.value) != null && l.isConnected)))) {
|
|
94
|
+
O.value = !0;
|
|
79
95
|
try {
|
|
80
|
-
|
|
96
|
+
g.value.focus();
|
|
81
97
|
} finally {
|
|
82
|
-
|
|
98
|
+
O.value = !1;
|
|
83
99
|
}
|
|
84
100
|
}
|
|
85
101
|
}
|
|
86
|
-
async function
|
|
87
|
-
var l,
|
|
88
|
-
if (
|
|
89
|
-
if (
|
|
102
|
+
async function H(e = !1) {
|
|
103
|
+
var l, f, d;
|
|
104
|
+
if (B.value || (y == null ? void 0 : y.value) === !1) return;
|
|
105
|
+
if (o.value) {
|
|
90
106
|
c();
|
|
91
107
|
return;
|
|
92
108
|
}
|
|
93
|
-
if (!
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
109
|
+
if (!e && ((l = t.requestOpen) == null ? void 0 : l.call(t, !0)) === !1) return;
|
|
110
|
+
const n = ++E;
|
|
111
|
+
if (o.value = !0, k.value = {
|
|
96
112
|
position: "fixed",
|
|
97
113
|
top: "0px",
|
|
98
114
|
left: "0px",
|
|
99
115
|
visibility: "hidden"
|
|
100
|
-
}, await
|
|
101
|
-
const
|
|
102
|
-
|
|
116
|
+
}, await ee(), n !== E || !o.value) return;
|
|
117
|
+
const i = ne(
|
|
118
|
+
"floating",
|
|
119
|
+
() => s(!0),
|
|
120
|
+
t.zIndex
|
|
121
|
+
);
|
|
122
|
+
F.value = i, W = i.unregister, u = i.isTop, C(), document.addEventListener("pointerdown", R, !0), document.addEventListener("keydown", S, !0), window.addEventListener("resize", c), window.addEventListener("scroll", c, !0), (f = window.visualViewport) == null || f.addEventListener("resize", c), (d = window.visualViewport) == null || d.addEventListener("scroll", c);
|
|
103
123
|
}
|
|
104
|
-
function
|
|
105
|
-
return
|
|
124
|
+
function X() {
|
|
125
|
+
return o.value ? s() : H();
|
|
106
126
|
}
|
|
107
|
-
return
|
|
108
|
-
|
|
109
|
-
(
|
|
110
|
-
|
|
127
|
+
return V(
|
|
128
|
+
B,
|
|
129
|
+
(e) => {
|
|
130
|
+
e && s(!1, !0);
|
|
131
|
+
},
|
|
132
|
+
{ flush: "sync" }
|
|
133
|
+
), Q(() => s(!1, !0)), V(
|
|
134
|
+
() => y == null ? void 0 : y.value,
|
|
135
|
+
(e) => {
|
|
136
|
+
e === !1 && s(!1, !0);
|
|
111
137
|
},
|
|
112
138
|
{ flush: "sync" }
|
|
113
|
-
),
|
|
114
|
-
|
|
139
|
+
), Z(() => {
|
|
140
|
+
E++, j();
|
|
115
141
|
}), {
|
|
116
|
-
open:
|
|
117
|
-
style:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
142
|
+
open: o,
|
|
143
|
+
style: _(() => {
|
|
144
|
+
var e;
|
|
145
|
+
return {
|
|
146
|
+
...k.value,
|
|
147
|
+
zIndex: String(((e = F.value) == null ? void 0 : e.zIndex.value) ?? 1200)
|
|
148
|
+
};
|
|
149
|
+
}),
|
|
150
|
+
placement: N,
|
|
151
|
+
update: C,
|
|
152
|
+
show: H,
|
|
121
153
|
close: s,
|
|
122
|
-
toggle:
|
|
123
|
-
restoringFocus:
|
|
154
|
+
toggle: X,
|
|
155
|
+
restoringFocus: O,
|
|
156
|
+
schedule: c,
|
|
157
|
+
isTop: () => (u == null ? void 0 : u()) ?? !1
|
|
124
158
|
};
|
|
125
159
|
}
|
|
126
160
|
export {
|
|
127
|
-
|
|
161
|
+
de as useFloating
|
|
128
162
|
};
|