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,36 +1,39 @@
|
|
|
1
|
-
import { defineComponent as vt, useAttrs as ft, inject as je, ref as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as vt, useAttrs as ft, inject as je, ref as T, useId as pt, shallowRef as Ge, computed as c, watch as O, nextTick as P, onUpdated as yt, onMounted as ht, onActivated as mt, onDeactivated as gt, onBeforeUnmount as bt, openBlock as p, createElementBlock as k, Fragment as be, createElementVNode as le, mergeProps as De, unref as v, renderSlot as y, createVNode as ke, createSlots as kt, withCtx as Q, createBlock as Ye, createCommentVNode as ie, Teleport as St, normalizeStyle as At, createTextVNode as Se, toDisplayString as ue, renderList as Tt, withModifiers as xt, normalizeClass as Bt } from "vue";
|
|
2
|
+
import Ct from "../../motion/PopupMotion.js";
|
|
3
|
+
import { LoaderCircle as Je, RotateCw as Pt } from "lucide-vue-next";
|
|
3
4
|
import $t from "../HysInput/HysInput.vue.js";
|
|
4
|
-
import { useHysRootAttrs as
|
|
5
|
-
import { fieldKey as
|
|
5
|
+
import { useHysRootAttrs as Kt } from "../../config.js";
|
|
6
|
+
import { fieldKey as Mt, formKey as Ot, useHysControlState as Dt } from "../../composables/formContext.js";
|
|
6
7
|
import { useFloating as Ft } from "../../composables/useFloating.js";
|
|
7
8
|
import { normalizeAutocomplete as Lt, autocompleteValue as Xe } from "../../composables/autocomplete.js";
|
|
8
9
|
const Vt = ["id"], Et = {
|
|
9
10
|
key: 0,
|
|
10
11
|
class: "hys-ui-autocomplete-header"
|
|
11
|
-
},
|
|
12
|
+
}, qt = ["id", "aria-label", "aria-busy"], It = {
|
|
12
13
|
key: 0,
|
|
13
14
|
class: "hys-ui-autocomplete-state",
|
|
14
15
|
role: "status"
|
|
15
|
-
},
|
|
16
|
+
}, wt = {
|
|
16
17
|
key: 1,
|
|
17
18
|
class: "hys-ui-autocomplete-state hys-ui-autocomplete-error",
|
|
18
19
|
role: "status"
|
|
19
|
-
},
|
|
20
|
+
}, Ht = {
|
|
20
21
|
key: 0,
|
|
21
22
|
role: "presentation",
|
|
22
23
|
class: "hys-ui-autocomplete-group"
|
|
23
|
-
},
|
|
24
|
+
}, Nt = ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"], Rt = ["title"], zt = {
|
|
24
25
|
key: 0,
|
|
25
26
|
class: "hys-ui-autocomplete-state",
|
|
26
27
|
role: "status"
|
|
27
|
-
},
|
|
28
|
+
}, Wt = {
|
|
28
29
|
key: 1,
|
|
29
30
|
class: "hys-ui-autocomplete-footer"
|
|
30
|
-
}, Ze = 'a[href],button:not(:disabled),input:not(:disabled),textarea:not(:disabled),select:not(:disabled),[tabindex]:not([tabindex="-1"])',
|
|
31
|
+
}, Ze = 'a[href],button:not(:disabled),input:not(:disabled),textarea:not(:disabled),select:not(:disabled),[tabindex]:not([tabindex="-1"])', _t = /* @__PURE__ */ vt({
|
|
31
32
|
inheritAttrs: !1,
|
|
32
33
|
__name: "HysAutocomplete",
|
|
33
34
|
props: {
|
|
35
|
+
popupTransition: {},
|
|
36
|
+
popupTransitionDuration: {},
|
|
34
37
|
modelValue: {},
|
|
35
38
|
defaultValue: { default: "" },
|
|
36
39
|
options: { default: () => [] },
|
|
@@ -82,11 +85,11 @@ const Vt = ["id"], Et = {
|
|
|
82
85
|
},
|
|
83
86
|
emits: ["update:modelValue", "update:open", "input", "change", "search", "select", "clear", "focus", "blur", "pressEnter", "visibleChange", "searchError"],
|
|
84
87
|
setup(S, { expose: _e, emit: et }) {
|
|
85
|
-
const t = S, m = et, R = ft(),
|
|
88
|
+
const t = S, m = et, R = ft(), Fe = Kt(), Ae = je(Mt, void 0), Te = je(Ot, void 0), { disabled: ne, size: se, label: Le } = Dt(t), z = T(), D = T(), F = T(), E = T(), W = pt(), Ve = T(t.defaultValue ?? ""), g = T(), x = T(), j = T(!1), f = T(), G = T(!1), xe = Ge(), re = T(!1), de = Ge([]), i = c(
|
|
86
89
|
() => String(
|
|
87
|
-
t.modelValue === void 0 ?
|
|
90
|
+
t.modelValue === void 0 ? Ve.value : t.modelValue ?? ""
|
|
88
91
|
)
|
|
89
|
-
),
|
|
92
|
+
), Ee = c(() => x.value ?? g.value ?? i.value), q = c(() => !ne.value && !t.readonly), ce = c(() => typeof t.fetchSuggestions == "function"), r = c(() => !!t.loading || G.value), tt = c(
|
|
90
93
|
() => ce.value ? de.value : Array.isArray(t.options) && t.options.length ? t.options : Array.isArray(t.fetchSuggestions) ? t.fetchSuggestions : []
|
|
91
94
|
), ve = c(
|
|
92
95
|
() => Lt(tt.value, i.value, {
|
|
@@ -95,15 +98,15 @@ const Vt = ["id"], Et = {
|
|
|
95
98
|
filter: t.filterOption ?? !ce.value,
|
|
96
99
|
caseSensitive: t.caseSensitive
|
|
97
100
|
})
|
|
98
|
-
),
|
|
101
|
+
), Y = c(() => ve.value.filter((e) => e.kind === "option")), Be = c(() => Y.value.map((e) => e.item)), J = c(() => Y.value.filter((e) => !e.disabled)), I = c(
|
|
99
102
|
() => ve.value.find(
|
|
100
|
-
(e) => e.key ===
|
|
103
|
+
(e) => e.key === f.value && e.kind === "option" && !e.disabled
|
|
101
104
|
)
|
|
102
105
|
), at = c(
|
|
103
|
-
() =>
|
|
106
|
+
() => Y.value.findIndex((e) => e.key === f.value)
|
|
104
107
|
);
|
|
105
|
-
let
|
|
106
|
-
const
|
|
108
|
+
let B = !0, Ce = 0, L = 0, qe = -1, Pe = !1, fe = 0, $, X = !1, w = !1, K, Z, pe, A;
|
|
109
|
+
const V = Ft(z, D, {
|
|
107
110
|
closeOnTab: !1,
|
|
108
111
|
get placement() {
|
|
109
112
|
return t.placement;
|
|
@@ -111,130 +114,130 @@ const Vt = ["id"], Et = {
|
|
|
111
114
|
matchWidth: () => t.popupMatchWidth ? !0 : "min",
|
|
112
115
|
width: () => t.popupWidth,
|
|
113
116
|
requestOpen: (e) => (m("update:open", e), t.open === void 0 ? void 0 : !1)
|
|
114
|
-
}), n =
|
|
117
|
+
}), n = V.open, ot = c(() => ({
|
|
115
118
|
...t.popupStyle,
|
|
116
|
-
...
|
|
119
|
+
...V.style.value,
|
|
117
120
|
overflowY: "hidden"
|
|
118
|
-
})),
|
|
121
|
+
})), lt = c(
|
|
119
122
|
() => Math.max(0, Math.floor(Number(t.minQueryLength) || 0))
|
|
120
123
|
), $e = c(
|
|
121
124
|
() => Math.max(64, Math.min(1200, Number(t.listHeight) || 256))
|
|
122
125
|
);
|
|
123
126
|
function H(e = i.value) {
|
|
124
127
|
var a;
|
|
125
|
-
if (!
|
|
128
|
+
if (!B || !q.value || e.length < lt.value) return !1;
|
|
126
129
|
try {
|
|
127
130
|
return ((a = t.getShow) == null ? void 0 : a.call(t, e)) !== !1;
|
|
128
131
|
} catch {
|
|
129
132
|
return !1;
|
|
130
133
|
}
|
|
131
134
|
}
|
|
132
|
-
function
|
|
135
|
+
function _() {
|
|
133
136
|
var a;
|
|
134
137
|
const e = (a = z.value) == null ? void 0 : a.querySelector('input:not([type="hidden"]),textarea');
|
|
135
138
|
E.value !== e && (E.value = e ?? void 0);
|
|
136
139
|
}
|
|
137
|
-
function
|
|
138
|
-
Ce++,
|
|
140
|
+
function M() {
|
|
141
|
+
Ce++, Z == null || Z.abort(), Z = void 0, clearTimeout(pe), pe = void 0, G.value = !1;
|
|
139
142
|
}
|
|
140
143
|
function s(e = !1) {
|
|
141
|
-
g.value = void 0, K = void 0,
|
|
144
|
+
g.value = void 0, K = void 0, V.close(!1, e);
|
|
142
145
|
}
|
|
143
|
-
function
|
|
146
|
+
function Ke(e) {
|
|
144
147
|
var a;
|
|
145
|
-
ne.value || (
|
|
148
|
+
ne.value || (_(), (a = E.value) == null || a.focus(e));
|
|
146
149
|
}
|
|
147
150
|
function Ie() {
|
|
148
151
|
var e;
|
|
149
|
-
|
|
152
|
+
_(), (e = E.value) == null || e.blur(), s();
|
|
150
153
|
}
|
|
151
154
|
function U() {
|
|
152
|
-
n.value &&
|
|
155
|
+
n.value && V.update();
|
|
153
156
|
}
|
|
154
157
|
async function it() {
|
|
155
158
|
var u;
|
|
156
|
-
await
|
|
157
|
-
const e = (u =
|
|
158
|
-
'[id="' + W + "-option-" +
|
|
159
|
+
await P();
|
|
160
|
+
const e = (u = F.value) == null ? void 0 : u.querySelector(
|
|
161
|
+
'[id="' + W + "-option-" + f.value + '"]'
|
|
159
162
|
);
|
|
160
|
-
if (!e || !
|
|
161
|
-
const a = e.offsetTop,
|
|
162
|
-
a <
|
|
163
|
+
if (!e || !F.value) return;
|
|
164
|
+
const a = e.offsetTop, o = a + e.offsetHeight, l = F.value.clientHeight || $e.value;
|
|
165
|
+
a < F.value.scrollTop ? F.value.scrollTop = a : o > F.value.scrollTop + l && (F.value.scrollTop = o - l);
|
|
163
166
|
}
|
|
164
|
-
function
|
|
165
|
-
|
|
167
|
+
function ee(e, a = !1) {
|
|
168
|
+
f.value = e == null ? void 0 : e.key, a && t.backfill && e ? g.value = (t.append ? i.value : "") + e.value : g.value = void 0, a && it();
|
|
166
169
|
}
|
|
167
|
-
function
|
|
168
|
-
const e = K === "last" ?
|
|
169
|
-
|
|
170
|
+
function Me() {
|
|
171
|
+
const e = K === "last" ? J.value.at(-1) : K === "first" || t.highlightFirst ? J.value[0] : void 0;
|
|
172
|
+
ee(e, !!K), K = void 0;
|
|
170
173
|
}
|
|
171
|
-
function
|
|
172
|
-
if (
|
|
174
|
+
function te(e = i.value, a = !1) {
|
|
175
|
+
if (M(), xe.value = void 0, re.value = !1, !n.value || !H(e)) return;
|
|
173
176
|
if (!ce.value) {
|
|
174
|
-
|
|
177
|
+
Me(), P(U);
|
|
175
178
|
return;
|
|
176
179
|
}
|
|
177
|
-
const
|
|
178
|
-
|
|
180
|
+
const o = Ce, l = new AbortController();
|
|
181
|
+
Z = l, de.value = [], G.value = !0, f.value = void 0, g.value = void 0;
|
|
179
182
|
let u = !1;
|
|
180
|
-
const b = () =>
|
|
181
|
-
u || !b() || (u = !0, de.value = Array.isArray(
|
|
182
|
-
},
|
|
183
|
-
u || !b() || (u = !0,
|
|
184
|
-
},
|
|
183
|
+
const b = () => B && Ce === o && !l.signal.aborted && n.value && q.value, d = (h) => {
|
|
184
|
+
u || !b() || (u = !0, de.value = Array.isArray(h) ? h : [], G.value = !1, Me(), P(U));
|
|
185
|
+
}, C = (h) => {
|
|
186
|
+
u || !b() || (u = !0, G.value = !1, xe.value = h, re.value = !0, m("searchError", h, e), P(U));
|
|
187
|
+
}, ae = () => {
|
|
185
188
|
if (pe = void 0, !!b())
|
|
186
189
|
try {
|
|
187
|
-
const
|
|
188
|
-
|
|
190
|
+
const h = t.fetchSuggestions(e, d, { signal: l.signal });
|
|
191
|
+
h && typeof h.then == "function" ? Promise.resolve(h).then((Qe) => {
|
|
189
192
|
Array.isArray(Qe) && d(Qe);
|
|
190
|
-
}).catch(
|
|
191
|
-
} catch (
|
|
192
|
-
|
|
193
|
+
}).catch(C) : Array.isArray(h) && d(h);
|
|
194
|
+
} catch (h) {
|
|
195
|
+
C(h);
|
|
193
196
|
}
|
|
194
|
-
},
|
|
195
|
-
a || !
|
|
197
|
+
}, oe = Math.max(0, Math.min(6e4, Number(t.debounce) || 0));
|
|
198
|
+
a || !oe ? ae() : pe = setTimeout(ae, oe);
|
|
196
199
|
}
|
|
197
200
|
async function N() {
|
|
198
|
-
H() && await
|
|
201
|
+
H() && await V.show(t.open === !0);
|
|
199
202
|
}
|
|
200
203
|
async function ye() {
|
|
201
204
|
if (!H()) return;
|
|
202
205
|
const e = n.value;
|
|
203
|
-
|
|
206
|
+
Pe = !e, await N(), Pe = !1, e && n.value && te(i.value, !0);
|
|
204
207
|
}
|
|
205
208
|
function he(e, a = !0) {
|
|
206
|
-
if (!
|
|
209
|
+
if (!B || !q.value || (x.value = void 0, g.value = void 0, e === $ || e === i.value && $ === void 0))
|
|
207
210
|
return;
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
if (!(!
|
|
211
|
+
const o = i.value, l = ++L;
|
|
212
|
+
$ = e, t.modelValue === void 0 && (Ve.value = e), m("update:modelValue", e), m("input", e), P(async () => {
|
|
213
|
+
if (!(!B || l !== L) && ($ = void 0, i.value === e && (o !== e && m("change", e), a && l !== qe))) {
|
|
211
214
|
if (m("search", e), K = void 0, !H(e)) {
|
|
212
|
-
|
|
215
|
+
M(), s();
|
|
213
216
|
return;
|
|
214
217
|
}
|
|
215
|
-
n.value ?
|
|
218
|
+
n.value ? te(e) : await N();
|
|
216
219
|
}
|
|
217
220
|
});
|
|
218
221
|
}
|
|
219
222
|
function we(e) {
|
|
220
223
|
const a = String(e ?? "");
|
|
221
|
-
if (
|
|
222
|
-
|
|
224
|
+
if (j.value) {
|
|
225
|
+
x.value = a;
|
|
223
226
|
return;
|
|
224
227
|
}
|
|
225
228
|
he(a);
|
|
226
229
|
}
|
|
227
230
|
function me() {
|
|
228
|
-
|
|
229
|
-
|
|
231
|
+
q.value && (w = !0, M(), x.value = void 0, g.value = void 0, he("", !1), qe = L, s(), m("clear"), P(() => {
|
|
232
|
+
w = !1;
|
|
230
233
|
}));
|
|
231
234
|
}
|
|
232
235
|
async function ge(e, a = !0) {
|
|
233
|
-
if (!e || e.disabled || !
|
|
234
|
-
const
|
|
235
|
-
he(
|
|
236
|
-
const u =
|
|
237
|
-
await
|
|
236
|
+
if (!e || e.disabled || !q.value || r.value || !B) return;
|
|
237
|
+
const o = (t.append ? i.value : "") + e.value, l = t.clearAfterSelect ? "" : o;
|
|
238
|
+
he(l, !1);
|
|
239
|
+
const u = L;
|
|
240
|
+
await P(), !(!B || u !== L || i.value !== l || !q.value) && (m("select", e.item, o), s(), t.blurAfterSelect ? Ie() : a && (w = !0, Ke({ preventScroll: !0 }), w = !1));
|
|
238
241
|
}
|
|
239
242
|
async function He(e) {
|
|
240
243
|
await ge({
|
|
@@ -247,59 +250,59 @@ const Vt = ["id"], Et = {
|
|
|
247
250
|
});
|
|
248
251
|
}
|
|
249
252
|
function ut(e) {
|
|
250
|
-
const a =
|
|
251
|
-
|
|
253
|
+
const a = Y.value[Math.floor(e)];
|
|
254
|
+
ee(a && !a.disabled ? a : void 0, !0);
|
|
252
255
|
}
|
|
253
256
|
async function nt(e) {
|
|
254
|
-
if (!
|
|
257
|
+
if (!q.value || e.isComposing || j.value || e.keyCode === 229)
|
|
255
258
|
return;
|
|
256
259
|
const a = e.target;
|
|
257
260
|
if (a.matches("input,textarea")) {
|
|
258
261
|
if (["ArrowDown", "ArrowUp", "PageDown", "PageUp"].includes(e.key)) {
|
|
259
262
|
e.preventDefault(), e.stopPropagation();
|
|
260
|
-
const
|
|
263
|
+
const o = e.key === "ArrowDown" || e.key === "PageDown";
|
|
261
264
|
if (!n.value) {
|
|
262
|
-
K =
|
|
265
|
+
K = o ? "first" : "last", await N();
|
|
263
266
|
return;
|
|
264
267
|
}
|
|
265
|
-
const
|
|
266
|
-
if (!
|
|
267
|
-
K =
|
|
268
|
+
const l = J.value;
|
|
269
|
+
if (!l.length) {
|
|
270
|
+
K = o ? "first" : "last";
|
|
268
271
|
return;
|
|
269
272
|
}
|
|
270
|
-
let u =
|
|
271
|
-
u < 0 && (u =
|
|
273
|
+
let u = l.findIndex((C) => C.key === f.value);
|
|
274
|
+
u < 0 && (u = o ? -1 : l.length);
|
|
272
275
|
const b = e.key.startsWith("Page") ? Math.max(
|
|
273
276
|
1,
|
|
274
277
|
Math.floor(
|
|
275
278
|
$e.value / (se.value === "sm" ? 30 : se.value === "lg" ? 44 : 36)
|
|
276
279
|
)
|
|
277
280
|
) : 1;
|
|
278
|
-
let d = u + (
|
|
279
|
-
d = t.loopNavigation ? (d %
|
|
281
|
+
let d = u + (o ? b : -b);
|
|
282
|
+
d = t.loopNavigation ? (d % l.length + l.length) % l.length : Math.max(0, Math.min(l.length - 1, d)), ee(l[d], !0);
|
|
280
283
|
} else if ((e.key === "Home" || e.key === "End") && n.value)
|
|
281
|
-
e.preventDefault(),
|
|
282
|
-
e.key === "Home" ?
|
|
284
|
+
e.preventDefault(), ee(
|
|
285
|
+
e.key === "Home" ? J.value[0] : J.value.at(-1),
|
|
283
286
|
!0
|
|
284
287
|
);
|
|
285
288
|
else if (e.key === "Enter") {
|
|
286
289
|
if (e.shiftKey && a.matches("textarea")) return;
|
|
287
|
-
m("pressEnter", e), n.value &&
|
|
290
|
+
m("pressEnter", e), n.value && I.value && !r.value ? (e.preventDefault(), e.stopPropagation(), await ge(I.value)) : t.selectWhenUnmatched ? (e.preventDefault(), e.stopPropagation(), await He({ [t.valueKey]: i.value })) : s();
|
|
288
291
|
} else if (e.key === "Escape")
|
|
289
292
|
g.value = void 0, s();
|
|
290
293
|
else if (e.key === "Tab")
|
|
291
|
-
if (!e.shiftKey && t.selectOnTab &&
|
|
292
|
-
await ge(
|
|
294
|
+
if (!e.shiftKey && t.selectOnTab && I.value && !r.value)
|
|
295
|
+
await ge(I.value, !1);
|
|
293
296
|
else {
|
|
294
|
-
const
|
|
295
|
-
|
|
297
|
+
const o = !e.shiftKey && n.value ? Ne()[0] : void 0;
|
|
298
|
+
o ? (e.preventDefault(), o.focus()) : s();
|
|
296
299
|
}
|
|
297
300
|
}
|
|
298
301
|
}
|
|
299
302
|
function Ne() {
|
|
300
303
|
var e;
|
|
301
304
|
return Array.from(
|
|
302
|
-
((e =
|
|
305
|
+
((e = D.value) == null ? void 0 : e.querySelectorAll(Ze)) ?? []
|
|
303
306
|
).filter(
|
|
304
307
|
(a) => a.tabIndex >= 0 && a.getClientRects().length && !a.closest("[inert]")
|
|
305
308
|
);
|
|
@@ -310,18 +313,18 @@ const Vt = ["id"], Et = {
|
|
|
310
313
|
const a = Ne();
|
|
311
314
|
if (document.activeElement !== (e.shiftKey ? a[0] : a.at(-1))) return;
|
|
312
315
|
e.preventDefault();
|
|
313
|
-
const
|
|
316
|
+
const l = Array.from(
|
|
314
317
|
document.querySelectorAll(Ze)
|
|
315
318
|
).filter(
|
|
316
319
|
(d) => {
|
|
317
|
-
var
|
|
318
|
-
return !((
|
|
320
|
+
var C;
|
|
321
|
+
return !((C = D.value) != null && C.contains(d)) && d.tabIndex >= 0 && d.getClientRects().length && !d.closest("[inert]");
|
|
319
322
|
}
|
|
320
|
-
), u =
|
|
321
|
-
s(),
|
|
323
|
+
), u = l.indexOf(E.value);
|
|
324
|
+
s(), w = !0, (b = e.shiftKey ? E.value : l[u + 1]) == null || b.focus(), w = !1;
|
|
322
325
|
}
|
|
323
326
|
function Re(e) {
|
|
324
|
-
fe++,
|
|
327
|
+
fe++, X || (X = !0, m("focus", e)), e.target.matches("input,textarea") && t.triggerOnFocus && !w && !V.restoringFocus.value && N();
|
|
325
328
|
}
|
|
326
329
|
function rt(e) {
|
|
327
330
|
t.triggerOnFocus && e.target.matches("input,textarea") && !n.value && N();
|
|
@@ -329,88 +332,88 @@ const Vt = ["id"], Et = {
|
|
|
329
332
|
function ze(e) {
|
|
330
333
|
const a = fe;
|
|
331
334
|
queueMicrotask(() => {
|
|
332
|
-
var
|
|
333
|
-
if (!
|
|
334
|
-
const
|
|
335
|
-
(
|
|
335
|
+
var l, u;
|
|
336
|
+
if (!B || a !== fe) return;
|
|
337
|
+
const o = document.activeElement;
|
|
338
|
+
(l = z.value) != null && l.contains(o) || (u = D.value) != null && u.contains(o) || (X && (X = !1, m("blur", e)), s());
|
|
336
339
|
});
|
|
337
340
|
}
|
|
338
341
|
function dt() {
|
|
339
|
-
|
|
342
|
+
j.value = !0, x.value = void 0, M(), s();
|
|
340
343
|
}
|
|
341
344
|
function ct() {
|
|
342
|
-
|
|
343
|
-
const e =
|
|
344
|
-
|
|
345
|
+
j.value = !1;
|
|
346
|
+
const e = x.value;
|
|
347
|
+
x.value = void 0, e !== void 0 && he(e);
|
|
345
348
|
}
|
|
346
349
|
const We = c(() => {
|
|
347
|
-
var e, a,
|
|
350
|
+
var e, a, o, l, u, b, d, C, ae;
|
|
348
351
|
return {
|
|
349
352
|
...t.inputProps,
|
|
350
353
|
...Object.fromEntries(
|
|
351
|
-
Object.entries(R).filter(([
|
|
354
|
+
Object.entries(R).filter(([oe]) => oe !== "class" && oe !== "style")
|
|
352
355
|
),
|
|
353
356
|
disabled: ne.value,
|
|
354
357
|
readonly: t.readonly,
|
|
355
358
|
size: se.value,
|
|
356
359
|
clearable: t.clearable || ((e = t.inputProps) == null ? void 0 : e.clearable),
|
|
357
360
|
clearIcon: t.clearIcon ?? ((a = t.inputProps) == null ? void 0 : a.clearIcon),
|
|
358
|
-
placeholder: t.placeholder ?? ((
|
|
359
|
-
label: t.label ?? ((
|
|
361
|
+
placeholder: t.placeholder ?? ((o = t.inputProps) == null ? void 0 : o.placeholder),
|
|
362
|
+
label: t.label ?? ((l = t.inputProps) == null ? void 0 : l.label),
|
|
360
363
|
name: t.name ?? ((u = t.inputProps) == null ? void 0 : u.name),
|
|
361
364
|
status: t.status ?? ((b = t.inputProps) == null ? void 0 : b.status),
|
|
362
365
|
error: t.error ?? ((d = t.inputProps) == null ? void 0 : d.error),
|
|
363
366
|
bordered: t.bordered,
|
|
364
|
-
id: R.id || (
|
|
367
|
+
id: R.id || (Ae == null ? void 0 : Ae.id.value) || void 0,
|
|
365
368
|
role: "combobox",
|
|
366
|
-
autocomplete: ((
|
|
367
|
-
ariaLabel: t.ariaLabel || R["aria-label"] || ((
|
|
369
|
+
autocomplete: ((C = t.inputProps) == null ? void 0 : C.autocomplete) ?? R.autocomplete ?? "off",
|
|
370
|
+
ariaLabel: t.ariaLabel || R["aria-label"] || ((ae = t.inputProps) == null ? void 0 : ae.ariaLabel) || t.label || Le.value || "自动补全",
|
|
368
371
|
"aria-autocomplete": t.backfill ? "both" : "list",
|
|
369
372
|
"aria-expanded": n.value,
|
|
370
373
|
"aria-controls": n.value ? W : void 0,
|
|
371
|
-
"aria-activedescendant": n.value &&
|
|
374
|
+
"aria-activedescendant": n.value && I.value ? W + "-option-" + I.value.key : void 0,
|
|
372
375
|
"aria-busy": r.value || void 0
|
|
373
376
|
};
|
|
374
377
|
});
|
|
375
378
|
function Ue() {
|
|
376
|
-
|
|
379
|
+
B = !1, L++, fe++, $ = void 0, x.value = void 0, g.value = void 0, X = !1, j.value = !1, M(), s(!0), A == null || A.disconnect(), A = void 0;
|
|
377
380
|
}
|
|
378
|
-
|
|
379
|
-
e ?
|
|
380
|
-
}),
|
|
381
|
+
O(n, (e) => {
|
|
382
|
+
e ? te(i.value, Pe) : (M(), g.value = void 0, f.value = void 0), m("visibleChange", e);
|
|
383
|
+
}), O(
|
|
381
384
|
() => t.open,
|
|
382
385
|
(e) => {
|
|
383
|
-
e !== void 0 && (e && H() ?
|
|
386
|
+
e !== void 0 && (e && H() ? V.show(!0) : s(!0));
|
|
384
387
|
}
|
|
385
|
-
),
|
|
388
|
+
), O(
|
|
386
389
|
() => t.modelValue,
|
|
387
390
|
() => {
|
|
388
|
-
|
|
391
|
+
$ !== void 0 && i.value === $ || (L++, $ = void 0, x.value = void 0, g.value = void 0, M(), n.value && H() ? te() : s());
|
|
389
392
|
}
|
|
390
|
-
),
|
|
393
|
+
), O(
|
|
391
394
|
() => [ne.value, t.readonly, t.getShow, t.minQueryLength],
|
|
392
395
|
() => {
|
|
393
|
-
H() || (
|
|
396
|
+
H() || (M(), s(!0));
|
|
394
397
|
}
|
|
395
|
-
),
|
|
396
|
-
de.value = [], n.value &&
|
|
397
|
-
}),
|
|
398
|
-
|
|
399
|
-
}),
|
|
400
|
-
() =>
|
|
398
|
+
), O(ce, () => {
|
|
399
|
+
de.value = [], n.value && te();
|
|
400
|
+
}), O(ve, () => {
|
|
401
|
+
f.value && !I.value && (f.value = void 0), n.value && !r.value && !f.value && (t.highlightFirst || K) && Me(), P(U);
|
|
402
|
+
}), O(
|
|
403
|
+
() => Te == null ? void 0 : Te.resetting.value,
|
|
401
404
|
(e) => {
|
|
402
|
-
e && (
|
|
405
|
+
e && (L++, $ = void 0, x.value = void 0, g.value = void 0, M(), s(!0));
|
|
403
406
|
},
|
|
404
407
|
{ flush: "sync" }
|
|
405
|
-
), yt(
|
|
408
|
+
), yt(_);
|
|
406
409
|
function Oe() {
|
|
407
|
-
A == null || A.disconnect(), A = void 0,
|
|
410
|
+
A == null || A.disconnect(), A = void 0, B && typeof ResizeObserver < "u" && z.value && (A = new ResizeObserver(U), A.observe(z.value), D.value && A.observe(D.value));
|
|
408
411
|
}
|
|
409
|
-
return
|
|
410
|
-
|
|
412
|
+
return O(D, Oe, { flush: "post" }), O([r, re], () => void P(U)), ht(() => {
|
|
413
|
+
_(), Oe(), t.autofocus && Ke(), (t.open ?? t.defaultOpen) && N();
|
|
411
414
|
}), mt(() => {
|
|
412
|
-
|
|
413
|
-
|
|
415
|
+
B = !0, P(() => {
|
|
416
|
+
_(), Oe();
|
|
414
417
|
});
|
|
415
418
|
}), gt(Ue), bt(Ue), _e({
|
|
416
419
|
input: E,
|
|
@@ -418,7 +421,7 @@ const Vt = ["id"], Et = {
|
|
|
418
421
|
loading: r,
|
|
419
422
|
highlightedIndex: at,
|
|
420
423
|
suggestions: Be,
|
|
421
|
-
focus:
|
|
424
|
+
focus: Ke,
|
|
422
425
|
blur: Ie,
|
|
423
426
|
open: N,
|
|
424
427
|
close: () => s(),
|
|
@@ -427,13 +430,13 @@ const Vt = ["id"], Et = {
|
|
|
427
430
|
retry: ye,
|
|
428
431
|
highlight: ut,
|
|
429
432
|
select: He
|
|
430
|
-
}), (e, a) => (
|
|
431
|
-
le("div",
|
|
433
|
+
}), (e, a) => (p(), k(be, null, [
|
|
434
|
+
le("div", De({
|
|
432
435
|
ref_key: "root",
|
|
433
436
|
ref: z
|
|
434
|
-
},
|
|
435
|
-
class: ["hys-ui-autocomplete",
|
|
436
|
-
style:
|
|
437
|
+
}, v(Fe), {
|
|
438
|
+
class: ["hys-ui-autocomplete", v(R).class],
|
|
439
|
+
style: v(R).style,
|
|
437
440
|
onKeydownCapture: nt,
|
|
438
441
|
onFocusin: Re,
|
|
439
442
|
onFocusout: ze,
|
|
@@ -441,30 +444,30 @@ const Vt = ["id"], Et = {
|
|
|
441
444
|
onCompositionstart: dt,
|
|
442
445
|
onCompositionend: ct
|
|
443
446
|
}), [
|
|
444
|
-
|
|
445
|
-
value:
|
|
447
|
+
y(e.$slots, "input", {
|
|
448
|
+
value: Ee.value,
|
|
446
449
|
setValue: we,
|
|
447
450
|
inputProps: We.value,
|
|
448
451
|
loading: r.value,
|
|
449
452
|
clear: me
|
|
450
453
|
}, () => [
|
|
451
|
-
|
|
452
|
-
"model-value":
|
|
454
|
+
ke($t, De(We.value, {
|
|
455
|
+
"model-value": Ee.value,
|
|
453
456
|
"onUpdate:modelValue": we,
|
|
454
457
|
onClear: me
|
|
455
458
|
}), kt({ _: 2 }, [
|
|
456
459
|
e.$slots.prefix ? {
|
|
457
460
|
name: "prefix",
|
|
458
|
-
fn:
|
|
459
|
-
|
|
461
|
+
fn: Q(() => [
|
|
462
|
+
y(e.$slots, "prefix", {}, void 0, !0)
|
|
460
463
|
]),
|
|
461
464
|
key: "0"
|
|
462
465
|
} : void 0,
|
|
463
466
|
e.$slots.suffix || r.value && !S.hideLoading ? {
|
|
464
467
|
name: "suffix",
|
|
465
|
-
fn:
|
|
466
|
-
|
|
467
|
-
r.value && !S.hideLoading ? (
|
|
468
|
+
fn: Q(() => [
|
|
469
|
+
y(e.$slots, "suffix", { loading: r.value }, () => [
|
|
470
|
+
r.value && !S.hideLoading ? (p(), Ye(v(Je), {
|
|
468
471
|
key: 0,
|
|
469
472
|
size: 15,
|
|
470
473
|
class: "hys-ui-icon-spin"
|
|
@@ -475,153 +478,162 @@ const Vt = ["id"], Et = {
|
|
|
475
478
|
} : void 0,
|
|
476
479
|
e.$slots.prepend ? {
|
|
477
480
|
name: "prepend",
|
|
478
|
-
fn:
|
|
479
|
-
|
|
481
|
+
fn: Q(() => [
|
|
482
|
+
y(e.$slots, "prepend", {}, void 0, !0)
|
|
480
483
|
]),
|
|
481
484
|
key: "2"
|
|
482
485
|
} : void 0,
|
|
483
486
|
e.$slots.append ? {
|
|
484
487
|
name: "append",
|
|
485
|
-
fn:
|
|
486
|
-
|
|
488
|
+
fn: Q(() => [
|
|
489
|
+
y(e.$slots, "append", {}, void 0, !0)
|
|
487
490
|
]),
|
|
488
491
|
key: "3"
|
|
489
492
|
} : void 0,
|
|
490
493
|
e.$slots["clear-icon"] ? {
|
|
491
494
|
name: "clear-icon",
|
|
492
|
-
fn:
|
|
493
|
-
|
|
495
|
+
fn: Q(() => [
|
|
496
|
+
y(e.$slots, "clear-icon", {}, void 0, !0)
|
|
494
497
|
]),
|
|
495
498
|
key: "4"
|
|
496
499
|
} : void 0
|
|
497
500
|
]), 1040, ["model-value"])
|
|
498
501
|
], !0)
|
|
499
502
|
], 16),
|
|
500
|
-
(
|
|
503
|
+
(p(), Ye(St, {
|
|
501
504
|
to: S.appendTo || "body",
|
|
502
505
|
disabled: S.appendTo === !1
|
|
503
506
|
}, [
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
}),
|
|
540
|
-
ke(ue(S.loadingText), 1)
|
|
541
|
-
], !0)
|
|
542
|
-
])) : re.value ? (f(), k("div", It, [
|
|
543
|
-
p(e.$slots, "error", {
|
|
544
|
-
error: xe.value,
|
|
545
|
-
query: i.value,
|
|
546
|
-
retry: ye
|
|
547
|
-
}, () => [
|
|
548
|
-
le("span", null, ue(S.errorText), 1),
|
|
549
|
-
le("button", {
|
|
550
|
-
type: "button",
|
|
551
|
-
"aria-label": "重试加载建议",
|
|
552
|
-
onClick: ye
|
|
553
|
-
}, [
|
|
554
|
-
Fe(h(Tt), { size: 14 }),
|
|
555
|
-
a[1] || (a[1] = ke("重试 ", -1))
|
|
556
|
-
])
|
|
557
|
-
], !0)
|
|
558
|
-
])) : (f(), k(be, { key: 2 }, [
|
|
559
|
-
(f(!0), k(be, null, xt(ve.value, (l) => (f(), k(be, {
|
|
560
|
-
key: l.key
|
|
507
|
+
ke(v(Ct), {
|
|
508
|
+
"popup-transition": t.popupTransition,
|
|
509
|
+
"popup-transition-duration": t.popupTransitionDuration,
|
|
510
|
+
placement: v(V).placement.value
|
|
511
|
+
}, {
|
|
512
|
+
default: Q(() => [
|
|
513
|
+
v(n) ? (p(), k("div", De({
|
|
514
|
+
key: 0,
|
|
515
|
+
id: v(W) + "-panel",
|
|
516
|
+
ref_key: "panel",
|
|
517
|
+
ref: D
|
|
518
|
+
}, v(Fe), {
|
|
519
|
+
class: ["hys-ui-autocomplete-popup", ["hys-ui-autocomplete-" + v(se), S.popupClass]],
|
|
520
|
+
style: ot.value,
|
|
521
|
+
onFocusin: Re,
|
|
522
|
+
onFocusout: ze,
|
|
523
|
+
onKeydown: st
|
|
524
|
+
}), [
|
|
525
|
+
e.$slots.header ? (p(), k("div", Et, [
|
|
526
|
+
y(e.$slots, "header", {
|
|
527
|
+
query: i.value,
|
|
528
|
+
loading: r.value,
|
|
529
|
+
options: Be.value,
|
|
530
|
+
close: () => s()
|
|
531
|
+
}, void 0, !0)
|
|
532
|
+
])) : ie("", !0),
|
|
533
|
+
le("div", {
|
|
534
|
+
id: v(W),
|
|
535
|
+
ref_key: "list",
|
|
536
|
+
ref: F,
|
|
537
|
+
role: "listbox",
|
|
538
|
+
class: "hys-ui-autocomplete-list",
|
|
539
|
+
style: At({ maxHeight: $e.value + "px" }),
|
|
540
|
+
"aria-label": S.ariaLabel || v(Le) || "输入建议",
|
|
541
|
+
"aria-busy": r.value || void 0
|
|
561
542
|
}, [
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
543
|
+
r.value && !S.hideLoading ? (p(), k("div", It, [
|
|
544
|
+
y(e.$slots, "loading", { query: i.value }, () => [
|
|
545
|
+
ke(v(Je), {
|
|
546
|
+
size: 17,
|
|
547
|
+
class: "hys-ui-icon-spin"
|
|
548
|
+
}),
|
|
549
|
+
Se(ue(S.loadingText), 1)
|
|
568
550
|
], !0)
|
|
569
|
-
])) : (
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
role: "option",
|
|
573
|
-
"aria-disabled": l.disabled || void 0,
|
|
574
|
-
"aria-selected": v.value === l.key,
|
|
575
|
-
class: Ct(["hys-ui-autocomplete-option", {
|
|
576
|
-
"hys-ui-autocomplete-active": v.value === l.key,
|
|
577
|
-
"hys-ui-autocomplete-disabled": l.disabled
|
|
578
|
-
}]),
|
|
579
|
-
onMousedown: a[0] || (a[0] = Bt(() => {
|
|
580
|
-
}, ["prevent"])),
|
|
581
|
-
onMouseenter: (o) => !l.disabled && _(l),
|
|
582
|
-
onClick: (o) => ge(l)
|
|
583
|
-
}, [
|
|
584
|
-
p(e.$slots, "option", {
|
|
585
|
-
item: l.item,
|
|
586
|
-
option: l,
|
|
551
|
+
])) : re.value ? (p(), k("div", wt, [
|
|
552
|
+
y(e.$slots, "error", {
|
|
553
|
+
error: xe.value,
|
|
587
554
|
query: i.value,
|
|
588
|
-
|
|
555
|
+
retry: ye
|
|
589
556
|
}, () => [
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
},
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
}, ue(l.label), 9, Nt)
|
|
600
|
-
], !0)
|
|
557
|
+
le("span", null, ue(S.errorText), 1),
|
|
558
|
+
le("button", {
|
|
559
|
+
type: "button",
|
|
560
|
+
"aria-label": "重试加载建议",
|
|
561
|
+
onClick: ye
|
|
562
|
+
}, [
|
|
563
|
+
ke(v(Pt), { size: 14 }),
|
|
564
|
+
a[1] || (a[1] = Se("重试 ", -1))
|
|
565
|
+
])
|
|
601
566
|
], !0)
|
|
602
|
-
],
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
567
|
+
])) : (p(), k(be, { key: 2 }, [
|
|
568
|
+
(p(!0), k(be, null, Tt(ve.value, (o) => (p(), k(be, {
|
|
569
|
+
key: o.key
|
|
570
|
+
}, [
|
|
571
|
+
o.kind === "group" ? (p(), k("div", Ht, [
|
|
572
|
+
y(e.$slots, "group", {
|
|
573
|
+
label: o.label,
|
|
574
|
+
group: o.group
|
|
575
|
+
}, () => [
|
|
576
|
+
Se(ue(o.label), 1)
|
|
577
|
+
], !0)
|
|
578
|
+
])) : (p(), k("div", {
|
|
579
|
+
key: 1,
|
|
580
|
+
id: v(W) + "-option-" + o.key,
|
|
581
|
+
role: "option",
|
|
582
|
+
"aria-disabled": o.disabled || void 0,
|
|
583
|
+
"aria-selected": f.value === o.key,
|
|
584
|
+
class: Bt(["hys-ui-autocomplete-option", {
|
|
585
|
+
"hys-ui-autocomplete-active": f.value === o.key,
|
|
586
|
+
"hys-ui-autocomplete-disabled": o.disabled
|
|
587
|
+
}]),
|
|
588
|
+
onMousedown: a[0] || (a[0] = xt(() => {
|
|
589
|
+
}, ["prevent"])),
|
|
590
|
+
onMouseenter: (l) => !o.disabled && ee(o),
|
|
591
|
+
onClick: (l) => ge(o)
|
|
592
|
+
}, [
|
|
593
|
+
y(e.$slots, "option", {
|
|
594
|
+
item: o.item,
|
|
595
|
+
option: o,
|
|
596
|
+
query: i.value,
|
|
597
|
+
active: f.value === o.key
|
|
598
|
+
}, () => [
|
|
599
|
+
y(e.$slots, "default", {
|
|
600
|
+
item: o.item,
|
|
601
|
+
option: o,
|
|
602
|
+
query: i.value,
|
|
603
|
+
active: f.value === o.key
|
|
604
|
+
}, () => [
|
|
605
|
+
le("span", {
|
|
606
|
+
class: "hys-ui-autocomplete-label",
|
|
607
|
+
title: o.label
|
|
608
|
+
}, ue(o.label), 9, Rt)
|
|
609
|
+
], !0)
|
|
610
|
+
], !0)
|
|
611
|
+
], 42, Nt))
|
|
612
|
+
], 64))), 128)),
|
|
613
|
+
!Y.value.length && !r.value ? (p(), k("div", zt, [
|
|
614
|
+
y(e.$slots, "empty", { query: i.value }, () => [
|
|
615
|
+
Se(ue(S.emptyText), 1)
|
|
616
|
+
], !0)
|
|
617
|
+
])) : ie("", !0)
|
|
618
|
+
], 64))
|
|
619
|
+
], 12, qt),
|
|
620
|
+
e.$slots.footer ? (p(), k("div", Wt, [
|
|
621
|
+
y(e.$slots, "footer", {
|
|
622
|
+
query: i.value,
|
|
623
|
+
loading: r.value,
|
|
624
|
+
options: Be.value,
|
|
625
|
+
close: () => s(),
|
|
626
|
+
clear: me
|
|
627
|
+
}, void 0, !0)
|
|
608
628
|
])) : ie("", !0)
|
|
609
|
-
],
|
|
610
|
-
]
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
query: i.value,
|
|
614
|
-
loading: r.value,
|
|
615
|
-
options: Be.value,
|
|
616
|
-
close: () => s(),
|
|
617
|
-
clear: me
|
|
618
|
-
}, void 0, !0)
|
|
619
|
-
])) : ie("", !0)
|
|
620
|
-
], 16, Vt)) : ie("", !0)
|
|
629
|
+
], 16, Vt)) : ie("", !0)
|
|
630
|
+
]),
|
|
631
|
+
_: 3
|
|
632
|
+
}, 8, ["popup-transition", "popup-transition-duration", "placement"])
|
|
621
633
|
], 8, ["to", "disabled"]))
|
|
622
634
|
], 64));
|
|
623
635
|
}
|
|
624
636
|
});
|
|
625
637
|
export {
|
|
626
|
-
|
|
638
|
+
_t as default
|
|
627
639
|
};
|