hys-ui 0.2.0 → 0.4.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 +59 -0
- package/README.md +68 -59
- package/dist/components/HysAlert/HysAlert.vue.js +5 -54
- package/dist/components/HysAlert/HysAlert2.vue.js +159 -2
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +5 -41
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber2.vue.js +146 -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/HysButton/HysButton.vue.js +2 -2
- package/dist/components/HysButton/HysButton2.vue.js +227 -60
- package/dist/components/HysButtonGroup/HysButtonGroup.vue.js +7 -0
- package/dist/components/HysButtonGroup/HysButtonGroup2.vue.js +51 -0
- 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 +1092 -142
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +491 -85
- package/dist/components/HysPagination/HysPagination.vue.js +2 -2
- package/dist/components/HysPagination/HysPagination2.vue.js +243 -180
- 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/HysSearch/HysSearch.vue.js +5 -82
- package/dist/components/HysSearch/HysSearch2.vue.js +176 -2
- package/dist/components/HysSelect/HysSelect.vue.js +2 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +755 -590
- 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/HysSplitPane/HysSplitPane.vue.js +315 -58
- package/dist/components/HysSplitPane/HysSplitPane3.vue.js +5 -0
- package/dist/components/HysTable/HysTable.vue.js +2 -2
- package/dist/components/HysTable/HysTable2.vue.js +1416 -1127
- 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 +291 -63
- package/dist/components/HysTour/HysTour3.vue.js +5 -0
- 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/buttonGroup.js +12 -0
- 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/floatingPosition.js +18 -0
- package/dist/composables/mentionDocument.js +79 -0
- package/dist/composables/mentionEditor.js +58 -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/selectOptions.js +44 -38
- package/dist/composables/splitPaneSizes.js +58 -0
- package/dist/composables/table.js +128 -105
- 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 +118 -80
- package/dist/composables/useHysModal.js +185 -0
- package/dist/composables/useMentionCaret.js +81 -0
- package/dist/composables/useMentionList.js +81 -0
- package/dist/composables/useMentionModel.js +90 -0
- package/dist/composables/useMentionOptions.js +421 -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/useSplitPaneDrag.js +52 -0
- package/dist/composables/useSplitPaneStorage.js +38 -0
- package/dist/composables/useTable.js +344 -312
- package/dist/composables/useTableSticky.js +79 -0
- package/dist/composables/useTagInput.js +313 -0
- package/dist/composables/useTourLayout.js +129 -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/config.js +11 -11
- package/dist/index.js +175 -153
- package/dist/internal/MultiSplitPane.vue.js +305 -0
- package/dist/internal/MultiSplitPane2.vue.js +4 -0
- 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/HysAnimatedNumber/HysAnimatedNumber.vue.d.ts +61 -7
- 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/HysButton/HysButton.vue.d.ts +82 -22
- package/dist/types/components/HysButtonGroup/HysButtonGroup.vue.d.ts +30 -0
- 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 +3 -3
- 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 +91 -39
- package/dist/types/components/HysModal/HysModal.vue.d.ts +111 -34
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +2 -2
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +55 -4
- 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/HysRating/HysRating.vue.d.ts +1 -1
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +2 -2
- package/dist/types/components/HysSearch/HysSearch.vue.d.ts +45 -7
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +19 -5
- 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 +125 -14
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +1 -1
- package/dist/types/components/HysTable/HysTable.vue.d.ts +1742 -5
- 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 +46 -8
- 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/buttonGroup.d.ts +9 -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/floatingPosition.d.ts +14 -0
- package/dist/types/composables/formContext.d.ts +2 -0
- package/dist/types/composables/mention.d.ts +284 -0
- package/dist/types/composables/mentionDocument.d.ts +15 -0
- package/dist/types/composables/mentionEditor.d.ts +7 -0
- package/dist/types/composables/menu.d.ts +183 -0
- package/dist/types/composables/modal.d.ts +185 -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 +7 -0
- package/dist/types/composables/splitPaneSizes.d.ts +11 -0
- package/dist/types/composables/table.d.ts +119 -6
- package/dist/types/composables/tagInput.d.ts +96 -0
- package/dist/types/composables/timeline.d.ts +82 -0
- package/dist/types/composables/tour.d.ts +68 -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 +22 -3
- package/dist/types/composables/useHysModal.d.ts +44 -0
- package/dist/types/composables/useMentionCaret.d.ts +6 -0
- package/dist/types/composables/useMentionList.d.ts +23 -0
- package/dist/types/composables/useMentionModel.d.ts +14 -0
- package/dist/types/composables/useMentionOptions.d.ts +26 -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/useSplitPaneDrag.d.ts +14 -0
- package/dist/types/composables/useSplitPaneStorage.d.ts +4 -0
- package/dist/types/composables/useTable.d.ts +7 -3
- package/dist/types/composables/useTableSticky.d.ts +22 -0
- package/dist/types/composables/useTagInput.d.ts +66 -0
- package/dist/types/composables/useTourLayout.d.ts +33 -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/config.d.ts +1 -0
- package/dist/types/index.d.ts +53 -3
- package/dist/types/internal/MultiSplitPane.vue.d.ts +54 -0
- 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 +3 -2
- package/dist/components/HysSplitPane/HysSplitPane2.vue.js +0 -4
- package/dist/components/HysTour/HysTour2.vue.js +0 -4
|
@@ -1,56 +1,99 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const o =
|
|
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 D, nextTick as x, onActivated as B, onDeactivated as H, onBeforeUnmount as M } from "vue";
|
|
2
|
+
import { overlayOwnerKey as A, 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(z, r, T, u = {}) {
|
|
5
|
+
const o = O(!0), h = P(A, void 0), s = b(() => o.value && (h == null ? void 0 : h.value) !== !1), i = b(() => z.value && s.value);
|
|
6
|
+
R(
|
|
7
|
+
A,
|
|
8
|
+
b(() => {
|
|
9
|
+
var e;
|
|
10
|
+
return i.value && ((e = u.childVisible) == null ? void 0 : e.call(u)) !== !1;
|
|
11
|
+
})
|
|
12
|
+
);
|
|
13
|
+
const d = g(), k = b(
|
|
14
|
+
() => {
|
|
15
|
+
var e, t;
|
|
16
|
+
return ((e = d.value) == null ? void 0 : e.zIndex.value) ?? ((t = u.zIndex) == null ? void 0 : t.call(u)) ?? 100;
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
let E = null, a, m = 0;
|
|
20
|
+
function S() {
|
|
21
|
+
var e;
|
|
22
|
+
return Array.from(
|
|
23
|
+
((e = r.value) == null ? void 0 : e.querySelectorAll(U)) ?? []
|
|
24
|
+
).filter(
|
|
25
|
+
(t) => t.tabIndex >= 0 && t.getClientRects().length > 0 && getComputedStyle(t).visibility !== "hidden" && !t.closest('[inert],[aria-hidden="true"]')
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
function w() {
|
|
13
29
|
var e;
|
|
14
|
-
|
|
30
|
+
(e = S()[0] ?? r.value) == null || e.focus({ preventScroll: !0 });
|
|
15
31
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
32
|
+
function C(e) {
|
|
33
|
+
var n, f;
|
|
34
|
+
if (!i.value || !((n = d.value) != null && n.isTop()) || !r.value) return;
|
|
18
35
|
if (e.key === "Escape") {
|
|
19
|
-
e.preventDefault(), e.stopImmediatePropagation(),
|
|
36
|
+
e.preventDefault(), e.stopImmediatePropagation(), T();
|
|
20
37
|
return;
|
|
21
38
|
}
|
|
22
|
-
if (e.key !== "Tab") return;
|
|
23
|
-
const
|
|
24
|
-
if (!
|
|
25
|
-
e.preventDefault(),
|
|
39
|
+
if (e.key !== "Tab" || ((f = u.trapFocus) == null ? void 0 : f.call(u)) === !1) return;
|
|
40
|
+
const t = S();
|
|
41
|
+
if (!t.length) {
|
|
42
|
+
e.preventDefault(), r.value.focus({ preventScroll: !0 });
|
|
26
43
|
return;
|
|
27
44
|
}
|
|
28
|
-
const l =
|
|
29
|
-
e.shiftKey && (document.activeElement === l || document.activeElement ===
|
|
45
|
+
const l = t[0], c = t[t.length - 1];
|
|
46
|
+
e.shiftKey && (document.activeElement === l || document.activeElement === r.value || !r.value.contains(document.activeElement)) ? (e.preventDefault(), c.focus({ preventScroll: !0 })) : !e.shiftKey && (document.activeElement === c || !r.value.contains(document.activeElement)) && (e.preventDefault(), l.focus({ preventScroll: !0 }));
|
|
47
|
+
}
|
|
48
|
+
function F(e) {
|
|
49
|
+
var t, l, c;
|
|
50
|
+
i.value && ((t = d.value) != null && t.isTop()) && ((l = u.trapFocus) == null ? void 0 : l.call(u)) !== !1 && e.target instanceof Node && !((c = r.value) != null && c.contains(e.target)) && w();
|
|
30
51
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
52
|
+
function I() {
|
|
53
|
+
var e;
|
|
54
|
+
i.value && ((e = u.lockScroll) == null ? void 0 : e.call(u)) !== !1 ? a ?? (a = N()) : (a == null || a(), a = void 0);
|
|
33
55
|
}
|
|
34
|
-
function
|
|
35
|
-
|
|
56
|
+
function y() {
|
|
57
|
+
var t, l;
|
|
58
|
+
const e = ((t = d.value) == null ? void 0 : t.isTop()) ?? !1;
|
|
59
|
+
return (l = d.value) == null || l.unregister(), d.value = void 0, a == null || a(), a = void 0, document.removeEventListener("keydown", C, !0), document.removeEventListener("focusin", F, !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, t, l) {
|
|
62
|
+
x(() => {
|
|
63
|
+
var n, f;
|
|
64
|
+
if (t !== m || !s.value || !l || ((n = u.restoreFocus) == null ? void 0 : n.call(u)) === !1)
|
|
65
|
+
return;
|
|
66
|
+
const c = new Event("hys-ui-close-auto-focus", { cancelable: !0 });
|
|
67
|
+
(f = u.onCloseAutoFocus) == null || f.call(u, c), !c.defaultPrevented && (e != null && e.isConnected) && e.focus({ preventScroll: !0 });
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return typeof document > "u" ? { active: s, zIndex: k, focus: w } : (D(
|
|
71
|
+
i,
|
|
72
|
+
async (e) => {
|
|
73
|
+
var l, c, n, f;
|
|
74
|
+
const t = ++m;
|
|
75
|
+
if (e) {
|
|
76
|
+
if (y(), E = document.activeElement instanceof HTMLElement ? document.activeElement : null, d.value = j("dialog", T, u.zIndex), I(), document.addEventListener("keydown", C, !0), document.addEventListener("focusin", F, !0), await x(), t !== m || !i.value) return;
|
|
77
|
+
const L = new Event("hys-ui-open-auto-focus", { cancelable: !0 });
|
|
78
|
+
(l = u.onOpenAutoFocus) == null || l.call(u, L);
|
|
79
|
+
const v = (c = u.initialFocus) == null ? void 0 : c.call(u), 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
|
+
!L.defaultPrevented && v !== !1 && ((f = K ?? ((n = r.value) == null ? void 0 : n.querySelector("[autofocus]")) ?? S()[0] ?? r.value) == null || f.focus({ preventScroll: !0 }));
|
|
81
|
+
} else q(E, t, y());
|
|
82
|
+
},
|
|
83
|
+
{ immediate: !0, flush: "post" }
|
|
84
|
+
), D(() => {
|
|
85
|
+
var e;
|
|
86
|
+
return (e = u.lockScroll) == null ? void 0 : e.call(u);
|
|
87
|
+
}, I), B(() => o.value = !0), H(() => {
|
|
88
|
+
o.value = !1, m++, y();
|
|
89
|
+
}), M(() => {
|
|
90
|
+
var c;
|
|
91
|
+
const e = E, t = y(), l = s.value && ((c = u.restoreFocus) == null ? void 0 : c.call(u)) !== !1;
|
|
92
|
+
o.value = !1, m++, l && t && x(() => {
|
|
93
|
+
e != null && e.isConnected && e.focus({ preventScroll: !0 });
|
|
94
|
+
});
|
|
95
|
+
}), { active: s, zIndex: k, focus: w });
|
|
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,166 @@
|
|
|
1
|
-
import { ref as E, watch as
|
|
2
|
-
import { useHysControlState as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { inject as T, ref as E, shallowRef as Y, watch as D, onDeactivated as U, onBeforeUnmount as V, computed as X, nextTick as G } from "vue";
|
|
2
|
+
import { useHysControlState as J } from "./formContext.js";
|
|
3
|
+
import { popupSize as Q } from "../motion/popup.js";
|
|
4
|
+
import { positionFloating as Z } from "./floatingPosition.js";
|
|
5
|
+
import { overlayOwnerKey as _, registerOverlay as ee } from "./overlayManager.js";
|
|
6
|
+
function re(v, n, e = {}) {
|
|
7
|
+
const { disabled: k } = J({}), m = T(_, void 0), c = E(!1), W = Y(), p = E(!1), L = E({
|
|
6
8
|
position: "fixed",
|
|
7
9
|
top: "0px",
|
|
8
10
|
left: "0px",
|
|
9
11
|
visibility: "hidden"
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
});
|
|
13
|
+
function A() {
|
|
14
|
+
return typeof e.placement == "function" ? e.placement() : e.placement ?? "bottom-start";
|
|
15
|
+
}
|
|
16
|
+
const C = E(A());
|
|
17
|
+
let $ = 0, w, r, y = 0;
|
|
18
|
+
function F() {
|
|
19
|
+
var R, S, H;
|
|
20
|
+
if (!c.value || !v.value || !n.value) return;
|
|
21
|
+
const t = v.value.getBoundingClientRect();
|
|
16
22
|
if (!t.width && !t.height) {
|
|
17
|
-
|
|
23
|
+
u();
|
|
18
24
|
return;
|
|
19
25
|
}
|
|
20
|
-
const e = document.documentElement.clientWidth,
|
|
21
|
-
x !== void 0 ? (
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
const a = Number.isFinite(e.gap) ? e.gap : 8, i = Number.isFinite(e.padding) ? Math.max(0, e.padding) : 10, l = document.documentElement.clientWidth, o = document.documentElement.clientHeight, d = Math.min(t.width, Math.max(0, l - 2 * i)), g = typeof e.matchWidth == "function" ? e.matchWidth() : e.matchWidth, h = (R = e.maxWidth) == null ? void 0 : R.call(e), P = h !== void 0 && (typeof h != "number" || Number.isFinite(h)) ? `min(${typeof h == "number" ? Math.max(0, h) + "px" : h},calc(100vw - ${i * 2}px))` : `calc(100vw - ${i * 2}px)`, b = (S = e.width) == null ? void 0 : S.call(e), x = typeof b == "number" ? Number.isFinite(b) ? Math.max(0, b) + "px" : void 0 : b;
|
|
27
|
+
x !== void 0 ? (n.value.style.width = x, n.value.style.minWidth = "0", n.value.style.maxWidth = P) : g === !0 && (n.value.style.width = `${d}px`, n.value.style.minWidth = "0", n.value.style.maxWidth = `${d}px`), x === void 0 && g === "min" && (n.value.style.width = "max-content", n.value.style.minWidth = `${d}px`, n.value.style.maxWidth = `calc(100vw - ${i * 2}px)`);
|
|
28
|
+
const z = Z(
|
|
29
|
+
t,
|
|
30
|
+
Q(n.value),
|
|
31
|
+
{ width: l, height: o },
|
|
32
|
+
A(),
|
|
33
|
+
a,
|
|
34
|
+
i,
|
|
35
|
+
e.autoAdjustOverflow !== !1
|
|
36
|
+
);
|
|
37
|
+
let { x: O, y: M } = z;
|
|
38
|
+
if (C.value = z.placement, (H = e.onPosition) == null || H.call(e, { anchor: t, ...z }), e.strategy === "absolute") {
|
|
39
|
+
n.value.style.position = "absolute";
|
|
40
|
+
const f = n.value.offsetParent;
|
|
41
|
+
if (f && f !== document.body && f !== document.documentElement) {
|
|
42
|
+
const j = f.getBoundingClientRect();
|
|
43
|
+
O += f.scrollLeft - j.left - f.clientLeft, M += f.scrollTop - j.top - f.clientTop;
|
|
44
|
+
} else
|
|
45
|
+
O += window.scrollX, M += window.scrollY;
|
|
46
|
+
}
|
|
47
|
+
L.value = {
|
|
48
|
+
...x !== void 0 ? { width: x, minWidth: "0" } : g === !0 ? { width: `${d}px`, minWidth: "0" } : g === "min" ? { width: "max-content", minWidth: `${d}px` } : {},
|
|
49
|
+
position: e.strategy ?? "fixed",
|
|
50
|
+
left: `${Math.round(O)}px`,
|
|
51
|
+
top: `${Math.round(M)}px`,
|
|
32
52
|
visibility: "visible",
|
|
33
53
|
zIndex: "1200",
|
|
34
|
-
maxWidth:
|
|
35
|
-
maxHeight: `calc(100vh - ${
|
|
54
|
+
maxWidth: P,
|
|
55
|
+
maxHeight: `calc(100vh - ${i * 2}px)`,
|
|
36
56
|
overflowY: "auto",
|
|
37
57
|
overscrollBehavior: "contain"
|
|
38
58
|
};
|
|
39
59
|
}
|
|
40
|
-
function
|
|
41
|
-
cancelAnimationFrame($), $ = requestAnimationFrame(
|
|
60
|
+
function s() {
|
|
61
|
+
cancelAnimationFrame($), $ = requestAnimationFrame(F);
|
|
42
62
|
}
|
|
43
|
-
function
|
|
44
|
-
var
|
|
45
|
-
|
|
63
|
+
function I(t) {
|
|
64
|
+
var a, i;
|
|
65
|
+
!(r != null && r()) || e.closeOnOutside === !1 || !((a = v.value) != null && a.contains(t.target)) && !((i = n.value) != null && i.contains(t.target)) && u();
|
|
46
66
|
}
|
|
47
|
-
function
|
|
48
|
-
var
|
|
49
|
-
if (!(!
|
|
50
|
-
if (t.key === "Escape")
|
|
51
|
-
t.preventDefault(), t.stopImmediatePropagation(),
|
|
52
|
-
else if (t.key === "Tab" &&
|
|
67
|
+
function q(t) {
|
|
68
|
+
var a, i;
|
|
69
|
+
if (!(!c.value || !(r != null && r()))) {
|
|
70
|
+
if (t.key === "Escape" && e.closeOnEscape !== !1)
|
|
71
|
+
t.preventDefault(), t.stopImmediatePropagation(), u(!0);
|
|
72
|
+
else if (t.key === "Tab" && e.closeOnTab !== !1) {
|
|
53
73
|
const l = document.activeElement;
|
|
54
|
-
if ((
|
|
55
|
-
|
|
74
|
+
if ((a = v.value) != null && a.contains(l)) {
|
|
75
|
+
u();
|
|
56
76
|
return;
|
|
57
77
|
}
|
|
58
|
-
if ((
|
|
59
|
-
const
|
|
60
|
-
|
|
78
|
+
if ((i = n.value) != null && i.contains(l)) {
|
|
79
|
+
const o = Array.from(
|
|
80
|
+
n.value.querySelectorAll(
|
|
61
81
|
'a[href],button:not(:disabled),input:not(:disabled),textarea:not(:disabled),select:not(:disabled),[tabindex]:not([tabindex="-1"])'
|
|
62
82
|
)
|
|
63
83
|
).filter(
|
|
64
|
-
(
|
|
84
|
+
(d) => d.getClientRects().length && !d.closest("[inert]")
|
|
65
85
|
);
|
|
66
|
-
(!
|
|
86
|
+
(!o.length || l === (t.shiftKey ? o[0] : o.at(-1))) && u(!0);
|
|
67
87
|
}
|
|
68
88
|
}
|
|
69
89
|
}
|
|
70
90
|
}
|
|
71
|
-
function
|
|
72
|
-
var t,
|
|
73
|
-
document.removeEventListener("pointerdown",
|
|
91
|
+
function B() {
|
|
92
|
+
var t, a;
|
|
93
|
+
document.removeEventListener("pointerdown", I, !0), document.removeEventListener("keydown", q, !0), window.removeEventListener("resize", s), window.removeEventListener("scroll", s, !0), (t = window.visualViewport) == null || t.removeEventListener("resize", s), (a = window.visualViewport) == null || a.removeEventListener("scroll", s), cancelAnimationFrame($), w == null || w(), w = void 0, W.value = void 0, r = void 0;
|
|
74
94
|
}
|
|
75
|
-
function
|
|
76
|
-
var
|
|
77
|
-
if (!(!
|
|
78
|
-
|
|
95
|
+
function u(t = !1, a = !1) {
|
|
96
|
+
var i, l;
|
|
97
|
+
if (!(!a && c.value && ((i = e.requestOpen) == null ? void 0 : i.call(e, !1, t)) === !1) && (y++, !!c.value && (c.value = !1, B(), t && ((l = v.value) != null && l.isConnected)))) {
|
|
98
|
+
p.value = !0;
|
|
79
99
|
try {
|
|
80
|
-
|
|
100
|
+
v.value.focus();
|
|
81
101
|
} finally {
|
|
82
|
-
|
|
102
|
+
p.value = !1;
|
|
83
103
|
}
|
|
84
104
|
}
|
|
85
105
|
}
|
|
86
|
-
async function
|
|
87
|
-
var l,
|
|
88
|
-
if (
|
|
89
|
-
if (
|
|
90
|
-
|
|
106
|
+
async function N(t = !1) {
|
|
107
|
+
var l, o, d;
|
|
108
|
+
if (k.value || (m == null ? void 0 : m.value) === !1) return;
|
|
109
|
+
if (c.value) {
|
|
110
|
+
s();
|
|
91
111
|
return;
|
|
92
112
|
}
|
|
93
|
-
if (!t && ((l =
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
113
|
+
if (!t && ((l = e.requestOpen) == null ? void 0 : l.call(e, !0)) === !1) return;
|
|
114
|
+
const a = ++y;
|
|
115
|
+
if (c.value = !0, L.value = {
|
|
96
116
|
position: "fixed",
|
|
97
117
|
top: "0px",
|
|
98
118
|
left: "0px",
|
|
99
119
|
visibility: "hidden"
|
|
100
|
-
}, await
|
|
101
|
-
const
|
|
102
|
-
|
|
120
|
+
}, await G(), a !== y || !c.value) return;
|
|
121
|
+
const i = ee(
|
|
122
|
+
"floating",
|
|
123
|
+
() => u(!0),
|
|
124
|
+
e.zIndex
|
|
125
|
+
);
|
|
126
|
+
W.value = i, w = i.unregister, r = i.isTop, F(), document.addEventListener("pointerdown", I, !0), document.addEventListener("keydown", q, !0), window.addEventListener("resize", s), window.addEventListener("scroll", s, !0), (o = window.visualViewport) == null || o.addEventListener("resize", s), (d = window.visualViewport) == null || d.addEventListener("scroll", s);
|
|
103
127
|
}
|
|
104
|
-
function
|
|
105
|
-
return
|
|
128
|
+
function K() {
|
|
129
|
+
return c.value ? u() : N();
|
|
106
130
|
}
|
|
107
|
-
return
|
|
108
|
-
|
|
131
|
+
return D(
|
|
132
|
+
k,
|
|
133
|
+
(t) => {
|
|
134
|
+
t && u(!1, !0);
|
|
135
|
+
},
|
|
136
|
+
{ flush: "sync" }
|
|
137
|
+
), U(() => u(!1, !0)), D(
|
|
138
|
+
() => m == null ? void 0 : m.value,
|
|
109
139
|
(t) => {
|
|
110
|
-
t &&
|
|
140
|
+
t === !1 && u(!1, !0);
|
|
111
141
|
},
|
|
112
142
|
{ flush: "sync" }
|
|
113
|
-
),
|
|
114
|
-
|
|
143
|
+
), V(() => {
|
|
144
|
+
y++, B();
|
|
115
145
|
}), {
|
|
116
|
-
open:
|
|
117
|
-
style:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
146
|
+
open: c,
|
|
147
|
+
style: X(() => {
|
|
148
|
+
var t;
|
|
149
|
+
return {
|
|
150
|
+
...L.value,
|
|
151
|
+
zIndex: String(((t = W.value) == null ? void 0 : t.zIndex.value) ?? 1200)
|
|
152
|
+
};
|
|
153
|
+
}),
|
|
154
|
+
placement: C,
|
|
155
|
+
update: F,
|
|
156
|
+
show: N,
|
|
157
|
+
close: u,
|
|
158
|
+
toggle: K,
|
|
159
|
+
restoringFocus: p,
|
|
160
|
+
schedule: s,
|
|
161
|
+
isTop: () => (r == null ? void 0 : r()) ?? !1
|
|
124
162
|
};
|
|
125
163
|
}
|
|
126
164
|
export {
|
|
127
|
-
|
|
165
|
+
re as useFloating
|
|
128
166
|
};
|