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
|
@@ -0,0 +1,514 @@
|
|
|
1
|
+
import { ref as ce, computed as k, shallowRef as Te, watch as q, nextTick as B, onMounted as Ze, onActivated as _e, onDeactivated as $e, onBeforeUnmount as et } from "vue";
|
|
2
|
+
import { popupSize as tt } from "../motion/popup.js";
|
|
3
|
+
import { useChoiceModel as se } from "./choiceModel.js";
|
|
4
|
+
import { useHysControlState as at } from "./formContext.js";
|
|
5
|
+
import { useFloating as lt } from "./useFloating.js";
|
|
6
|
+
import { menuRows as it, menuKeys as w, menuToken as m, menuKeysEqual as U } from "./menu.js";
|
|
7
|
+
function ft(l, y, z, Ce, Oe, d) {
|
|
8
|
+
const N = at(l), r = ce(!0), V = ce(!1), p = k(() => it(l.items, l.fieldNames)), v = k(() => N.disabled.value || !!l.loading), M = k(
|
|
9
|
+
() => Array.isArray(l.trigger) ? l.trigger : [l.trigger ?? "contextmenu"]
|
|
10
|
+
), J = se(
|
|
11
|
+
{
|
|
12
|
+
get modelValue() {
|
|
13
|
+
return l.open;
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
() => !!l.defaultOpen
|
|
17
|
+
), te = se(
|
|
18
|
+
{
|
|
19
|
+
get modelValue() {
|
|
20
|
+
return l.openPath;
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
() => w(l.defaultOpenPath),
|
|
24
|
+
U
|
|
25
|
+
), oe = se(
|
|
26
|
+
{
|
|
27
|
+
get modelValue() {
|
|
28
|
+
return l.checkedKeys;
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
() => w(
|
|
32
|
+
l.defaultCheckedKeys ?? p.value.all.filter(
|
|
33
|
+
(e) => e.checked && ["checkbox", "radio"].includes(e.type)
|
|
34
|
+
).map((e) => e.key)
|
|
35
|
+
),
|
|
36
|
+
U
|
|
37
|
+
), re = se(
|
|
38
|
+
{
|
|
39
|
+
get modelValue() {
|
|
40
|
+
return l.selectedKeys;
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
() => w(l.defaultSelectedKeys).slice(
|
|
44
|
+
0,
|
|
45
|
+
l.multiple ? void 0 : 1
|
|
46
|
+
),
|
|
47
|
+
U
|
|
48
|
+
), Y = k(() => w(oe.current.value)), j = k(() => w(re.current.value)), Se = k(() => new Set(Y.value.map(m))), Ke = k(() => new Set(j.value.map(m))), O = k(() => {
|
|
49
|
+
const e = [];
|
|
50
|
+
let t = p.value.roots;
|
|
51
|
+
for (const a of te.current.value) {
|
|
52
|
+
const i = t.find(
|
|
53
|
+
(u) => u.key === a && u.children.length && !u.disabled
|
|
54
|
+
);
|
|
55
|
+
if (!i) break;
|
|
56
|
+
e.push(i), t = i.children;
|
|
57
|
+
}
|
|
58
|
+
return e;
|
|
59
|
+
}), P = k(() => [
|
|
60
|
+
p.value.roots,
|
|
61
|
+
...l.loading ? [] : O.value.map((e) => e.children)
|
|
62
|
+
]), ae = k(() => O.value.map((e) => e.key)), le = ce(/* @__PURE__ */ new Map()), x = Te(), ie = Te(), Me = ce(!1), fe = Te({}), F = /* @__PURE__ */ new Map(), Q = /* @__PURE__ */ new Set();
|
|
63
|
+
let de = !1, ue = !0, E = 0, Z = 0, ye = !1, f, he, _, $, me, L = "";
|
|
64
|
+
const ve = (e, t) => Number.isFinite(e) ? Math.max(0, Math.min(2e3, e)) : t, Pe = k(
|
|
65
|
+
() => y.value ? {
|
|
66
|
+
getBoundingClientRect() {
|
|
67
|
+
return x.value ? {
|
|
68
|
+
x: x.value.x,
|
|
69
|
+
y: x.value.y - 7,
|
|
70
|
+
left: x.value.x,
|
|
71
|
+
top: x.value.y - 7,
|
|
72
|
+
right: x.value.x + 1,
|
|
73
|
+
bottom: x.value.y - 6,
|
|
74
|
+
width: 1,
|
|
75
|
+
height: 1,
|
|
76
|
+
toJSON() {
|
|
77
|
+
return {};
|
|
78
|
+
}
|
|
79
|
+
} : (y.value.firstElementChild ?? y.value).getBoundingClientRect();
|
|
80
|
+
},
|
|
81
|
+
contains: (e) => {
|
|
82
|
+
var t, a;
|
|
83
|
+
return !!((t = y.value) != null && t.contains(e)) || !!((a = z.value) != null && a.contains(e));
|
|
84
|
+
},
|
|
85
|
+
focus: () => Ee(),
|
|
86
|
+
get isConnected() {
|
|
87
|
+
var e;
|
|
88
|
+
return !!((e = y.value) != null && e.isConnected);
|
|
89
|
+
}
|
|
90
|
+
} : void 0
|
|
91
|
+
), T = lt(Pe, Ce, {
|
|
92
|
+
gap: 6,
|
|
93
|
+
padding: 8,
|
|
94
|
+
closeOnTab: !1,
|
|
95
|
+
get placement() {
|
|
96
|
+
return x.value ? "bottom-start" : l.placement ?? "bottom-start";
|
|
97
|
+
},
|
|
98
|
+
width: () => l.width,
|
|
99
|
+
requestOpen(e, t) {
|
|
100
|
+
return b(e, t), !1;
|
|
101
|
+
}
|
|
102
|
+
}), o = T.open;
|
|
103
|
+
function W(e) {
|
|
104
|
+
var a;
|
|
105
|
+
const t = document.getElementById(Oe + "-item-" + e.id);
|
|
106
|
+
return t instanceof HTMLElement && ((a = z.value) != null && a.contains(t)) ? t : void 0;
|
|
107
|
+
}
|
|
108
|
+
function Ee() {
|
|
109
|
+
var t, a;
|
|
110
|
+
const e = (t = ie.value) != null && t.isConnected && ie.value !== document.body ? ie.value : ((a = y.value) == null ? void 0 : a.querySelector(
|
|
111
|
+
'button:not(:disabled),a[href],input:not(:disabled),[tabindex]:not([tabindex="-1"])'
|
|
112
|
+
)) ?? y.value;
|
|
113
|
+
de = !0;
|
|
114
|
+
try {
|
|
115
|
+
e == null || e.focus({ preventScroll: !0 });
|
|
116
|
+
} finally {
|
|
117
|
+
de = !1;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function Re() {
|
|
121
|
+
var t;
|
|
122
|
+
const e = ((t = y.value) == null ? void 0 : t.querySelector(
|
|
123
|
+
'button:not(:disabled),a[href],[tabindex]:not([tabindex="-1"])'
|
|
124
|
+
)) ?? y.value;
|
|
125
|
+
e == null || e.focus({ preventScroll: !0 });
|
|
126
|
+
}
|
|
127
|
+
function qe(e) {
|
|
128
|
+
return {
|
|
129
|
+
item: e.raw,
|
|
130
|
+
value: e.key,
|
|
131
|
+
label: e.label,
|
|
132
|
+
path: e.path,
|
|
133
|
+
keys: e.keys,
|
|
134
|
+
level: e.level,
|
|
135
|
+
disabled: e.disabled || v.value,
|
|
136
|
+
checked: e.key !== void 0 && Se.value.has(m(e.key)),
|
|
137
|
+
selected: e.key !== void 0 && Ke.value.has(m(e.key)),
|
|
138
|
+
expanded: O.value.some((t) => t.id === e.id),
|
|
139
|
+
submenu: !!e.children.length
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
function ge(e) {
|
|
143
|
+
return e.filter(
|
|
144
|
+
(t) => t.type !== "divider" && t.type !== "group" && !t.disabled
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
function I(e, t = !1) {
|
|
148
|
+
var a, i, u;
|
|
149
|
+
e.disabled || e.key === void 0 || v.value || (le.value = new Map(le.value).set(e.level, e.key), t && ((a = W(e)) == null || a.focus({ preventScroll: !0 })), t && ((u = (i = W(e)) == null ? void 0 : i.scrollIntoView) == null || u.call(i, { block: "nearest" })));
|
|
150
|
+
}
|
|
151
|
+
function H(e = P.value.length - 1, t = !1) {
|
|
152
|
+
var u, n, s, c;
|
|
153
|
+
if (v.value) {
|
|
154
|
+
(n = (u = F.get(e)) == null ? void 0 : u.querySelector('[role="menu"]')) == null || n.focus({ preventScroll: !0 });
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const a = ge(P.value[e] ?? []), i = t ? a.at(-1) : a[0];
|
|
158
|
+
i ? I(i, !0) : (c = (s = F.get(e)) == null ? void 0 : s.querySelector('[role="menu"]')) == null || c.focus({ preventScroll: !0 });
|
|
159
|
+
}
|
|
160
|
+
function we(e) {
|
|
161
|
+
const t = le.value.get(e.level), a = ge(P.value[e.level] ?? []);
|
|
162
|
+
return !v.value && !e.disabled && (t === e.key || !a.some((i) => i.key === t) && a[0] === e) ? 0 : -1;
|
|
163
|
+
}
|
|
164
|
+
function G() {
|
|
165
|
+
clearTimeout(he), clearTimeout(_), clearTimeout($), clearTimeout(me), L = "";
|
|
166
|
+
}
|
|
167
|
+
function A(e = !1) {
|
|
168
|
+
!o.value || !r.value || (ye || (ye = e), !Z && (Z = requestAnimationFrame(async () => {
|
|
169
|
+
Z = 0;
|
|
170
|
+
const t = [...Q];
|
|
171
|
+
if (Q.clear(), !o.value || !r.value) {
|
|
172
|
+
t.forEach((n) => n(!1));
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
ye && (ye = !1, T.update(), await B());
|
|
176
|
+
const a = document.documentElement.clientWidth, i = document.documentElement.clientHeight, u = {};
|
|
177
|
+
O.value.forEach((n, s) => {
|
|
178
|
+
const c = W(n), h = F.get(s + 1), D = c == null ? void 0 : c.closest(".hys-ui-menu-body");
|
|
179
|
+
if (!c || !h) return;
|
|
180
|
+
const g = c.getBoundingClientRect(), S = tt(h), X = D == null ? void 0 : D.getBoundingClientRect();
|
|
181
|
+
if (X && (g.bottom <= X.top || g.top >= X.bottom)) {
|
|
182
|
+
R(ae.value.slice(0, s));
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
const K = Math.min(S.width, Math.max(0, a - 16)), Qe = Math.min(S.height, Math.max(0, i - 16));
|
|
186
|
+
let ee = l.direction === "rtl" ? g.left - K - 6 : g.right + 6;
|
|
187
|
+
ee + K > a - 8 && (ee = g.left - K - 6), ee < 8 && g.right + 6 + K <= a - 8 && (ee = g.right + 6), u[s + 1] = {
|
|
188
|
+
position: "fixed",
|
|
189
|
+
left: Math.max(8, Math.min(ee, a - K - 8)) + "px",
|
|
190
|
+
top: Math.max(8, Math.min(g.top - 5, i - Qe - 8)) + "px",
|
|
191
|
+
visibility: "visible",
|
|
192
|
+
zIndex: Number(T.style.value.zIndex) + s + 1
|
|
193
|
+
};
|
|
194
|
+
}), JSON.stringify(fe.value) !== JSON.stringify(u) && (fe.value = u), await B(), t.forEach((n) => n(o.value && r.value));
|
|
195
|
+
})));
|
|
196
|
+
}
|
|
197
|
+
function ne() {
|
|
198
|
+
return !o.value || !r.value ? Promise.resolve(!1) : new Promise((e) => {
|
|
199
|
+
Q.add(e), A();
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
function Ae() {
|
|
203
|
+
V.value && !o.value || (V.value = !0, G(), E++, T.close(!1, !0), J.current.value && d("update:open", !1));
|
|
204
|
+
}
|
|
205
|
+
function Ne(e, t) {
|
|
206
|
+
const a = F.get(e);
|
|
207
|
+
a !== t && (a && a !== t && (f == null || f.unobserve(a)), t ? (F.set(e, t), f == null || f.observe(t)) : F.delete(e), e || (Ce.value = t), A(!0));
|
|
208
|
+
}
|
|
209
|
+
async function be() {
|
|
210
|
+
if (!r.value || V.value || N.disabled.value || !J.current.value) {
|
|
211
|
+
T.close(!1, !0);
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
const e = o.value;
|
|
215
|
+
await T.show(!0), !(!o.value || !r.value) && (e || (typeof ResizeObserver < "u" && (f == null || f.disconnect(), f = new ResizeObserver(() => A(!0)), F.forEach((t) => f.observe(t))), A(!0), ue && l.autofocus !== !1 && (O.value.length ? await ne() : await B(), o.value && r.value && H())));
|
|
216
|
+
}
|
|
217
|
+
async function b(e, t = !1) {
|
|
218
|
+
return !r.value || e && N.disabled.value ? !1 : (e || G(), J.current.value !== e && await J.commit(
|
|
219
|
+
e,
|
|
220
|
+
(a) => d("update:open", a),
|
|
221
|
+
() => {
|
|
222
|
+
}
|
|
223
|
+
), await be(), o.value === e && !e && t && Ee(), o.value === e);
|
|
224
|
+
}
|
|
225
|
+
async function C(e) {
|
|
226
|
+
if (!r.value || N.disabled.value) return !1;
|
|
227
|
+
E++, V.value = !1, G(), ue = !0, ie.value = document.activeElement instanceof HTMLElement ? document.activeElement : y.value, e && "preventDefault" in e ? (e.preventDefault(), x.value = e instanceof MouseEvent && e.type === "contextmenu" ? { x: e.clientX, y: e.clientY } : void 0) : (x.value = e && Number.isFinite(e.x) && Number.isFinite(e.y) ? { x: e.x, y: e.y } : void 0, ue = (e == null ? void 0 : e.focus) !== !1);
|
|
228
|
+
const t = await b(!0);
|
|
229
|
+
return t && (A(!0), ue && l.autofocus !== !1 && await B(() => H())), t;
|
|
230
|
+
}
|
|
231
|
+
async function R(e, t = !1) {
|
|
232
|
+
if (!r.value || v.value) return !1;
|
|
233
|
+
const a = E, i = w(e);
|
|
234
|
+
if (U(i, te.current.value))
|
|
235
|
+
return t && await ne() && H(i.length), !0;
|
|
236
|
+
const u = await te.commit(
|
|
237
|
+
i,
|
|
238
|
+
(n) => d("update:openPath", n),
|
|
239
|
+
(n) => d("openPathChange", n)
|
|
240
|
+
);
|
|
241
|
+
return u && o.value && r.value && a === E && (await B(), A(!0), t && await ne() && a === E && H(O.value.length)), u && U(ae.value, i);
|
|
242
|
+
}
|
|
243
|
+
async function ke(e, t = !0) {
|
|
244
|
+
const a = p.value.byKey.get(m(e));
|
|
245
|
+
return !a || a.disabled || !a.children.length || !o.value ? !1 : (clearTimeout($), R(a.keys, t));
|
|
246
|
+
}
|
|
247
|
+
async function Fe(e) {
|
|
248
|
+
const t = p.value.byKey.get(m(e));
|
|
249
|
+
return !t || t.disabled || v.value || !r.value || !o.value && !await C() || !await R(t.parents.map((a) => a.key)) || !await ne() ? !1 : (I(t, !0), !!W(t));
|
|
250
|
+
}
|
|
251
|
+
async function Le(e) {
|
|
252
|
+
return v.value || !r.value ? !1 : oe.commit(
|
|
253
|
+
w(e),
|
|
254
|
+
(t) => d("update:checkedKeys", t),
|
|
255
|
+
(t) => d("checkedChange", t)
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
async function Ie(e) {
|
|
259
|
+
return v.value || !r.value ? !1 : re.commit(
|
|
260
|
+
w(e).slice(0, l.multiple ? void 0 : 1),
|
|
261
|
+
(t) => d("update:selectedKeys", t),
|
|
262
|
+
(t) => d("selectionChange", t)
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
async function He(e, t) {
|
|
266
|
+
if (!r.value || v.value || e.disabled || e.key === void 0 || !o.value || p.value.byKey.get(m(e.key)) !== e)
|
|
267
|
+
return t == null || t.preventDefault(), !1;
|
|
268
|
+
if (e.children.length)
|
|
269
|
+
return t == null || t.preventDefault(), ke(e.key);
|
|
270
|
+
const a = E, i = ["checkbox", "radio"].includes(e.type);
|
|
271
|
+
let u = Y.value, n = j.value, s;
|
|
272
|
+
if (i) {
|
|
273
|
+
s = e.type === "radio" || !Se.value.has(m(e.key));
|
|
274
|
+
const S = m(e.radioGroup ?? "@hys-menu-radio");
|
|
275
|
+
u = u.filter(
|
|
276
|
+
(X) => X !== e.key && !(e.type === "radio" && (() => {
|
|
277
|
+
const K = p.value.byKey.get(m(X));
|
|
278
|
+
return (K == null ? void 0 : K.type) === "radio" && m(K.radioGroup ?? "@hys-menu-radio") === S;
|
|
279
|
+
})())
|
|
280
|
+
), s && u.push(e.key);
|
|
281
|
+
} else l.selectable && (n = l.multiple ? Ke.value.has(m(e.key)) ? n.filter((S) => S !== e.key) : [...n, e.key] : [e.key]);
|
|
282
|
+
const c = {
|
|
283
|
+
item: e.raw,
|
|
284
|
+
path: e.path,
|
|
285
|
+
keys: e.keys,
|
|
286
|
+
event: t,
|
|
287
|
+
checked: s,
|
|
288
|
+
checkedKeys: u,
|
|
289
|
+
selectedKeys: n
|
|
290
|
+
}, h = i && !U(u, Y.value), D = !i && !!l.selectable && !U(n, j.value);
|
|
291
|
+
let g = !0;
|
|
292
|
+
return h ? g = await oe.commit(
|
|
293
|
+
u,
|
|
294
|
+
(S) => d("update:checkedKeys", S),
|
|
295
|
+
() => d("select", e.key, c),
|
|
296
|
+
!0
|
|
297
|
+
) : D ? g = await re.commit(
|
|
298
|
+
n,
|
|
299
|
+
(S) => d("update:selectedKeys", S),
|
|
300
|
+
() => d("select", e.key, c),
|
|
301
|
+
!0
|
|
302
|
+
) : d("select", e.key, c), !g || !r.value ? !1 : (h ? d("checkedChange", Y.value, c) : D && d("selectionChange", j.value, c), (e.closeOnSelect ?? (!i && l.hideOnClick !== !1)) && a === E && await b(!1, !0), !0);
|
|
303
|
+
}
|
|
304
|
+
function pe(e) {
|
|
305
|
+
var t, a;
|
|
306
|
+
return e instanceof Node && (!!((t = y.value) != null && t.contains(e)) || !!((a = z.value) != null && a.contains(e)));
|
|
307
|
+
}
|
|
308
|
+
function Be(e, t) {
|
|
309
|
+
!M.value.includes("hover") || (t == null ? void 0 : t.pointerType) === "touch" || (clearTimeout(he), clearTimeout(_), e ? o.value || (he = setTimeout(
|
|
310
|
+
() => void C({ focus: !1 }),
|
|
311
|
+
ve(l.showDelay, 120)
|
|
312
|
+
)) : pe((t == null ? void 0 : t.relatedTarget) ?? null) || (_ = setTimeout(
|
|
313
|
+
() => void b(!1),
|
|
314
|
+
ve(l.hideDelay, 180)
|
|
315
|
+
)));
|
|
316
|
+
}
|
|
317
|
+
function Ue() {
|
|
318
|
+
clearTimeout(_), clearTimeout($);
|
|
319
|
+
}
|
|
320
|
+
function ze(e) {
|
|
321
|
+
clearTimeout(_), clearTimeout($), !(l.submenuTrigger === "click" || e.disabled || v.value) && (I(e), $ = setTimeout(
|
|
322
|
+
() => {
|
|
323
|
+
!o.value || p.value.byKey.get(m(e.key)) !== e || R(
|
|
324
|
+
e.children.length ? e.keys : e.parents.map((t) => t.key)
|
|
325
|
+
);
|
|
326
|
+
},
|
|
327
|
+
ve(l.submenuDelay, 160)
|
|
328
|
+
));
|
|
329
|
+
}
|
|
330
|
+
function Ve(e) {
|
|
331
|
+
!e.defaultPrevented && M.value.includes("click") && e.button === 0 && (o.value ? b(!1) : C(e));
|
|
332
|
+
}
|
|
333
|
+
function Je(e) {
|
|
334
|
+
M.value.includes("contextmenu") && C(e);
|
|
335
|
+
}
|
|
336
|
+
function We(e) {
|
|
337
|
+
M.value.includes("focus") && !de && !T.restoringFocus.value && !pe(e.relatedTarget) && C({ focus: !1 });
|
|
338
|
+
}
|
|
339
|
+
function Ge(e) {
|
|
340
|
+
M.value.includes("focus") && !pe(e.relatedTarget) && b(!1);
|
|
341
|
+
}
|
|
342
|
+
function Xe(e) {
|
|
343
|
+
if (!(e.isComposing || !M.value.length)) {
|
|
344
|
+
if (e.key === "ContextMenu" || e.shiftKey && e.key === "F10") {
|
|
345
|
+
M.value.includes("contextmenu") && C(e);
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
["ArrowDown", "ArrowUp"].includes(e.key) ? (e.preventDefault(), C(e).then((t) => {
|
|
349
|
+
t && H(0, e.key === "ArrowUp");
|
|
350
|
+
})) : (e.key === "Enter" || e.key === " ") && e.target === y.value && !M.value.includes("contextmenu") ? (e.preventDefault(), o.value ? b(!1) : C(e)) : e.key === "Tab" && o.value && b(!1);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
async function Ye(e) {
|
|
354
|
+
var u, n;
|
|
355
|
+
const t = Array.from(
|
|
356
|
+
((u = z.value) == null ? void 0 : u.querySelectorAll(
|
|
357
|
+
'a[href],button:not(:disabled),input:not(:disabled),textarea:not(:disabled),select:not(:disabled),[tabindex]:not([tabindex="-1"])'
|
|
358
|
+
)) ?? []
|
|
359
|
+
).filter(
|
|
360
|
+
(s) => s.tabIndex >= 0 && s.getClientRects().length && getComputedStyle(s).visibility !== "hidden" && !s.closest("[inert]")
|
|
361
|
+
);
|
|
362
|
+
if (document.activeElement !== (e.shiftKey ? t[0] : t.at(-1)) && t.length || (e.preventDefault(), !await b(!1, !0) || e.shiftKey)) return;
|
|
363
|
+
const a = Array.from(
|
|
364
|
+
document.querySelectorAll(
|
|
365
|
+
'a[href],button:not(:disabled),input:not(:disabled),textarea:not(:disabled),select:not(:disabled),[tabindex]:not([tabindex="-1"])'
|
|
366
|
+
)
|
|
367
|
+
).filter(
|
|
368
|
+
(s) => s.tabIndex >= 0 && s.getClientRects().length && !s.closest("[inert]")
|
|
369
|
+
), i = a.indexOf(document.activeElement);
|
|
370
|
+
i >= 0 && ((n = a[i + 1]) == null || n.focus());
|
|
371
|
+
}
|
|
372
|
+
function je(e, t) {
|
|
373
|
+
var s;
|
|
374
|
+
if (t.isComposing || t.keyCode === 229) return;
|
|
375
|
+
if (t.key === "Tab") {
|
|
376
|
+
Ye(t);
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
if (t.target.closest(
|
|
380
|
+
'input,textarea,select,[contenteditable="true"]'
|
|
381
|
+
))
|
|
382
|
+
return;
|
|
383
|
+
const a = ge(P.value[e] ?? []), i = t.target.closest(
|
|
384
|
+
"[data-hys-menu-item]"
|
|
385
|
+
), u = a.findIndex((c) => W(c) === i), n = a[u];
|
|
386
|
+
if (["ArrowDown", "ArrowUp", "Home", "End"].includes(t.key)) {
|
|
387
|
+
t.preventDefault(), t.stopPropagation();
|
|
388
|
+
let c = t.key === "Home" ? 0 : t.key === "End" ? a.length - 1 : u + (t.key === "ArrowUp" ? -1 : 1);
|
|
389
|
+
c = l.loopNavigation === !1 ? Math.max(0, Math.min(c, a.length - 1)) : (c + a.length) % a.length, a[c] && I(a[c], !0);
|
|
390
|
+
} else if (t.key === (l.direction === "rtl" ? "ArrowLeft" : "ArrowRight"))
|
|
391
|
+
t.preventDefault(), t.stopPropagation(), n != null && n.children.length && ke(n.key);
|
|
392
|
+
else if (t.key === (l.direction === "rtl" ? "ArrowRight" : "ArrowLeft")) {
|
|
393
|
+
t.preventDefault(), t.stopPropagation();
|
|
394
|
+
const c = O.value[e - 1];
|
|
395
|
+
c && R(ae.value.slice(0, e - 1)).then((h) => {
|
|
396
|
+
h && I(c, !0);
|
|
397
|
+
});
|
|
398
|
+
} else if (t.key === "Enter" || t.key === " ")
|
|
399
|
+
n && (t.preventDefault(), t.stopPropagation(), (s = W(n)) == null || s.click());
|
|
400
|
+
else if (t.key.length === 1 && !t.ctrlKey && !t.metaKey && !t.altKey) {
|
|
401
|
+
L += t.key.toLocaleLowerCase(), clearTimeout(me), me = setTimeout(() => L = "", 500);
|
|
402
|
+
const c = [...L].every((h) => h === L[0]) ? L[0] : L;
|
|
403
|
+
for (let h = 1; h <= a.length; h++) {
|
|
404
|
+
const D = a[(u + h + a.length) % a.length];
|
|
405
|
+
if (D.label.toLocaleLowerCase().startsWith(c)) {
|
|
406
|
+
t.preventDefault(), I(D, !0);
|
|
407
|
+
break;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
function xe() {
|
|
413
|
+
var e;
|
|
414
|
+
Me.value = !!((e = y.value) != null && e.querySelector(
|
|
415
|
+
'button:not(:disabled),a[href],input:not(:disabled),[tabindex]:not([tabindex="-1"])'
|
|
416
|
+
));
|
|
417
|
+
}
|
|
418
|
+
function De() {
|
|
419
|
+
r.value = !1, V.value = !0, E++, G(), f == null || f.disconnect(), f = void 0, cancelAnimationFrame(Z), Z = 0, Q.forEach((e) => e(!1)), Q.clear(), T.close(!1, !0), J.current.value && d("update:open", !1);
|
|
420
|
+
}
|
|
421
|
+
return q([J.current, N.disabled, r], () => void be(), {
|
|
422
|
+
immediate: !0,
|
|
423
|
+
flush: "post"
|
|
424
|
+
}), q(
|
|
425
|
+
N.disabled,
|
|
426
|
+
(e) => {
|
|
427
|
+
e && Ae();
|
|
428
|
+
},
|
|
429
|
+
{ flush: "sync" }
|
|
430
|
+
), q(
|
|
431
|
+
() => l.open,
|
|
432
|
+
(e) => {
|
|
433
|
+
e && (V.value = !1);
|
|
434
|
+
}
|
|
435
|
+
), q(o, (e) => {
|
|
436
|
+
d("visibleChange", e), e || (E++, G(), f == null || f.disconnect(), te.isLive() && R([]));
|
|
437
|
+
}), q(
|
|
438
|
+
[P, v],
|
|
439
|
+
async () => {
|
|
440
|
+
var i, u, n, s;
|
|
441
|
+
if (!o.value) return;
|
|
442
|
+
const e = document.activeElement, t = !!e && !!((i = z.value) != null && i.contains(e)), a = Number(
|
|
443
|
+
((u = e == null ? void 0 : e.closest("[data-level]")) == null ? void 0 : u.dataset.level) ?? 0
|
|
444
|
+
);
|
|
445
|
+
await B(), t && o.value && (!((n = z.value) != null && n.contains(document.activeElement)) || ((s = document.activeElement) == null ? void 0 : s.getAttribute(
|
|
446
|
+
"aria-disabled"
|
|
447
|
+
)) === "true") && H(Math.min(a, P.value.length - 1));
|
|
448
|
+
},
|
|
449
|
+
{ flush: "pre" }
|
|
450
|
+
), q(
|
|
451
|
+
[P, () => l.placement, () => l.direction],
|
|
452
|
+
() => {
|
|
453
|
+
B(() => A(!0));
|
|
454
|
+
},
|
|
455
|
+
{ flush: "post" }
|
|
456
|
+
), q(T.style, () => A(!1)), q(
|
|
457
|
+
() => l.loading,
|
|
458
|
+
() => {
|
|
459
|
+
l.loading && G();
|
|
460
|
+
}
|
|
461
|
+
), Ze(() => {
|
|
462
|
+
xe(), be();
|
|
463
|
+
}), _e(() => {
|
|
464
|
+
r.value = !0, xe();
|
|
465
|
+
}), $e(De), et(De), {
|
|
466
|
+
control: N,
|
|
467
|
+
live: r,
|
|
468
|
+
busy: v,
|
|
469
|
+
graph: p,
|
|
470
|
+
triggers: M,
|
|
471
|
+
open: o,
|
|
472
|
+
branches: O,
|
|
473
|
+
menus: P,
|
|
474
|
+
openPath: ae,
|
|
475
|
+
checkedKeys: Y,
|
|
476
|
+
selectedKeys: j,
|
|
477
|
+
context: qe,
|
|
478
|
+
tabbable: we,
|
|
479
|
+
active: le,
|
|
480
|
+
childStyles: fe,
|
|
481
|
+
floating: T,
|
|
482
|
+
forceHide: Ae,
|
|
483
|
+
focusableChild: Me,
|
|
484
|
+
measureTrigger: xe,
|
|
485
|
+
setPanel: Ne,
|
|
486
|
+
scheduleLayout: A,
|
|
487
|
+
show: C,
|
|
488
|
+
hide: (e = !1) => b(!1, e),
|
|
489
|
+
focus: Re,
|
|
490
|
+
toggle: () => o.value ? b(!1) : C(),
|
|
491
|
+
focusItem: Fe,
|
|
492
|
+
openSubmenu: ke,
|
|
493
|
+
closeSubmenus: () => R([]),
|
|
494
|
+
setCheckedKeys: Le,
|
|
495
|
+
setSelectedKeys: Ie,
|
|
496
|
+
choose: He,
|
|
497
|
+
setActive: I,
|
|
498
|
+
hoverRoot: Be,
|
|
499
|
+
enterPanel: Ue,
|
|
500
|
+
hoverRow: ze,
|
|
501
|
+
triggerClick: Ve,
|
|
502
|
+
contextmenu: Je,
|
|
503
|
+
triggerFocus: We,
|
|
504
|
+
focusOut: Ge,
|
|
505
|
+
triggerKey: Xe,
|
|
506
|
+
keyboard: je,
|
|
507
|
+
first: H,
|
|
508
|
+
setPath: R,
|
|
509
|
+
getItems: () => p.value.all.filter((e) => e.type !== "group" && e.type !== "divider").map((e) => e.raw)
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
export {
|
|
513
|
+
ft as useContextMenu
|
|
514
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ref as m, shallowRef as y, computed as w, watch as b, onMounted as A, onActivated as D, onDeactivated as J, onBeforeUnmount as N } from "vue";
|
|
2
|
+
function S(a, h, q) {
|
|
3
|
+
const u = m(!1), i = m(!1), l = y(), r = y();
|
|
4
|
+
let o, c;
|
|
5
|
+
const t = w(() => JSON.stringify(h.value));
|
|
6
|
+
function d() {
|
|
7
|
+
o == null || o.abort(), o = void 0, i.value = !1;
|
|
8
|
+
}
|
|
9
|
+
async function v() {
|
|
10
|
+
if (!u.value || !a.loadRows) return;
|
|
11
|
+
d();
|
|
12
|
+
const e = new AbortController();
|
|
13
|
+
o = e;
|
|
14
|
+
const n = t.value, f = a.loadRows;
|
|
15
|
+
i.value = !0, l.value = void 0;
|
|
16
|
+
try {
|
|
17
|
+
const s = await f(JSON.parse(n), {
|
|
18
|
+
signal: e.signal
|
|
19
|
+
});
|
|
20
|
+
if (e.signal.aborted || n !== t.value || a.loadRows !== f)
|
|
21
|
+
return;
|
|
22
|
+
c = n, r.value = s;
|
|
23
|
+
} catch (s) {
|
|
24
|
+
if (e.signal.aborted || n !== t.value || a.loadRows !== f)
|
|
25
|
+
return;
|
|
26
|
+
l.value = { error: s, query: n }, q(s);
|
|
27
|
+
} finally {
|
|
28
|
+
o === e && (o = void 0, i.value = !1);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function R() {
|
|
32
|
+
var e;
|
|
33
|
+
u.value || (u.value = !0, c !== t.value && ((e = l.value) == null ? void 0 : e.query) !== t.value && v());
|
|
34
|
+
}
|
|
35
|
+
function g() {
|
|
36
|
+
u.value = !1, d();
|
|
37
|
+
}
|
|
38
|
+
return b(
|
|
39
|
+
() => a.loadRows,
|
|
40
|
+
() => {
|
|
41
|
+
d(), c = void 0, r.value = void 0, l.value = void 0, v();
|
|
42
|
+
}
|
|
43
|
+
), A(() => {
|
|
44
|
+
b(t, () => {
|
|
45
|
+
v();
|
|
46
|
+
}, { flush: "post" }), R();
|
|
47
|
+
}), D(R), J(g), N(g), {
|
|
48
|
+
pending: i,
|
|
49
|
+
failure: l,
|
|
50
|
+
reload: v,
|
|
51
|
+
sourceRows: w(
|
|
52
|
+
() => {
|
|
53
|
+
var e;
|
|
54
|
+
return a.loadRows ? ((e = r.value) == null ? void 0 : e.rows) ?? a.rows : a.rows;
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
remoteTotal: w(
|
|
58
|
+
() => {
|
|
59
|
+
var e;
|
|
60
|
+
return a.loadRows ? ((e = r.value) == null ? void 0 : e.total) ?? a.totalRows : a.totalRows;
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
S as useDataGridRemote
|
|
67
|
+
};
|