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,36 +1,44 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { defineComponent as Ut, useAttrs as Qt, inject as Yt, ref as L, useId as Xt, shallowRef as he, computed as c, watch as X, nextTick as z, onMounted as Gt, onUpdated as Jt, onActivated as Zt, onDeactivated as _t, onBeforeUnmount as el, openBlock as v, createElementBlock as h, mergeProps as Qe, unref as s, createElementVNode as $, withModifiers as Ee, renderSlot as T, Fragment as ie, renderList as Ye, toDisplayString as M, createVNode as ye, createCommentVNode as E, createTextVNode as _, normalizeClass as St, createBlock as Xe, Teleport as tl, withCtx as ll, normalizeStyle as me } from "vue";
|
|
2
|
+
import al from "../../motion/PopupMotion.js";
|
|
3
|
+
import { X as Tt, LoaderCircle as ol, ChevronDown as il, Plus as ul, Check as nl } from "lucide-vue-next";
|
|
4
|
+
import { fieldKey as sl, useHysControlState as rl, formValue as cl } from "../../composables/formContext.js";
|
|
5
|
+
import { useHysRootAttrs as dl } from "../../config.js";
|
|
6
|
+
import { useFloating as vl } from "../../composables/useFloating.js";
|
|
7
|
+
import { isSelectLabeledValue as Ct, normalizeSelectOptions as fl, selectKeyFactory as pl } from "../../composables/selectOptions.js";
|
|
8
|
+
const hl = ["disabled"], yl = ["id", "tabindex", "aria-label", "aria-expanded", "aria-disabled", "aria-readonly", "aria-required", "aria-invalid", "aria-describedby", "aria-controls", "aria-activedescendant"], ml = { class: "hys-ui-select-label" }, bl = ["title"], gl = ["disabled", "aria-label", "onClick"], kl = ["title"], xl = ["title"], Al = {
|
|
8
9
|
key: 0,
|
|
9
10
|
class: "hys-ui-select-suffix"
|
|
10
|
-
},
|
|
11
|
+
}, Sl = ["name", "value", "disabled"], Tl = ["data-size", "data-placement"], Cl = {
|
|
11
12
|
key: 0,
|
|
12
13
|
class: "hys-ui-select-header"
|
|
13
|
-
},
|
|
14
|
+
}, wl = ["value", "aria-controls", "aria-activedescendant"], Ml = {
|
|
15
|
+
key: 2,
|
|
16
|
+
class: "hys-ui-select-bulk",
|
|
17
|
+
role: "group",
|
|
18
|
+
"aria-label": "批量选择"
|
|
19
|
+
}, Bl = ["title"], Vl = ["disabled", "aria-label"], Ll = ["disabled", "aria-label"], Ol = ["id", "aria-label", "aria-multiselectable", "aria-busy"], zl = {
|
|
14
20
|
key: 0,
|
|
15
21
|
class: "hys-ui-floating-empty",
|
|
16
22
|
role: "status"
|
|
17
|
-
},
|
|
23
|
+
}, $l = {
|
|
18
24
|
key: 1,
|
|
19
25
|
class: "hys-ui-floating-empty",
|
|
20
26
|
role: "status"
|
|
21
|
-
},
|
|
27
|
+
}, El = ["id", "data-active", "aria-label", "aria-description", "aria-selected", "aria-setsize", "aria-posinset", "disabled", "onPointerenter", "onClick"], Fl = ["title"], Hl = {
|
|
22
28
|
key: 0,
|
|
23
29
|
class: "hys-ui-select-create-label"
|
|
24
|
-
},
|
|
30
|
+
}, jl = {
|
|
25
31
|
key: 3,
|
|
26
32
|
class: "hys-ui-floating-empty"
|
|
27
|
-
},
|
|
28
|
-
key:
|
|
33
|
+
}, Il = {
|
|
34
|
+
key: 3,
|
|
29
35
|
class: "hys-ui-select-footer"
|
|
30
|
-
},
|
|
36
|
+
}, wt = 'a[href],button:not(:disabled),input:not(:disabled),textarea:not(:disabled),select:not(:disabled),[tabindex]:not([tabindex="-1"])', Ul = /* @__PURE__ */ Ut({
|
|
31
37
|
inheritAttrs: !1,
|
|
32
38
|
__name: "HysSelect",
|
|
33
39
|
props: {
|
|
40
|
+
popupTransition: {},
|
|
41
|
+
popupTransitionDuration: {},
|
|
34
42
|
modelValue: {},
|
|
35
43
|
defaultValue: {},
|
|
36
44
|
options: { default: () => [] },
|
|
@@ -41,13 +49,18 @@ const Ja = ["disabled"], Za = ["id", "tabindex", "aria-label", "aria-expanded",
|
|
|
41
49
|
ariaLabel: {},
|
|
42
50
|
placeholder: { default: "请选择" },
|
|
43
51
|
multiple: { type: Boolean },
|
|
52
|
+
showSelectAll: { type: Boolean, default: !0 },
|
|
53
|
+
selectAllScope: { default: "filtered" },
|
|
54
|
+
selectAllText: { default: "全选" },
|
|
55
|
+
deselectAllText: { default: "全不选" },
|
|
44
56
|
filterable: { type: Boolean },
|
|
45
57
|
clearable: { type: Boolean },
|
|
46
58
|
emptyValues: { default: () => ["", null, void 0] },
|
|
47
|
-
clearValue: { type: [String, Number, Boolean, Object, null], default: "" },
|
|
59
|
+
clearValue: { type: [String, Number, Boolean, Object, null, Function], default: "" },
|
|
60
|
+
labelInValue: { type: Boolean },
|
|
48
61
|
fallbackOption: { type: [Boolean, Function] },
|
|
49
62
|
multipleLimit: { default: 0 },
|
|
50
|
-
maxTagCount: {},
|
|
63
|
+
maxTagCount: { default: 3 },
|
|
51
64
|
maxTagTextLength: {},
|
|
52
65
|
removable: { type: Boolean, default: !0 },
|
|
53
66
|
clearSearchAfterSelect: { type: Boolean, default: !1 },
|
|
@@ -67,6 +80,7 @@ const Ja = ["disabled"], Za = ["id", "tabindex", "aria-label", "aria-expanded",
|
|
|
67
80
|
showOnFocus: { type: Boolean },
|
|
68
81
|
retainSearch: { type: Boolean },
|
|
69
82
|
defaultActiveFirst: { type: Boolean, default: !0 },
|
|
83
|
+
firstActiveValue: { type: [String, Number, Boolean, Object] },
|
|
70
84
|
keyboard: { type: Boolean, default: !0 },
|
|
71
85
|
popupMatchWidth: { type: Boolean },
|
|
72
86
|
popupWidth: {},
|
|
@@ -89,808 +103,959 @@ const Ja = ["disabled"], Za = ["id", "tabindex", "aria-label", "aria-expanded",
|
|
|
89
103
|
autofocus: { type: Boolean },
|
|
90
104
|
name: {}
|
|
91
105
|
},
|
|
92
|
-
emits: ["update:modelValue", "change", "clear", "update:open", "visibleChange", "update:searchValue", "search", "select", "deselect", "removeTag", "create", "reject", "searchError", "focus", "blur", "popupScroll", "reachEnd"],
|
|
93
|
-
setup(
|
|
94
|
-
const
|
|
95
|
-
disabled:
|
|
96
|
-
size:
|
|
97
|
-
label:
|
|
98
|
-
} =
|
|
99
|
-
function
|
|
106
|
+
emits: ["update:modelValue", "change", "clear", "selectAll", "deselectAll", "update:open", "visibleChange", "update:searchValue", "search", "select", "deselect", "removeTag", "create", "reject", "searchError", "focus", "blur", "popupScroll", "reachEnd"],
|
|
107
|
+
setup(r, { expose: Mt, emit: Bt }) {
|
|
108
|
+
const a = r, p = Bt, Vt = Qt(), Ge = dl(), W = Yt(sl, void 0), {
|
|
109
|
+
disabled: b,
|
|
110
|
+
size: F,
|
|
111
|
+
label: Je
|
|
112
|
+
} = rl(a), m = L(), C = L(), H = L(), ee = L(), ue = Xt(), Fe = L("");
|
|
113
|
+
function Ze() {
|
|
100
114
|
var o;
|
|
101
|
-
const e = (o =
|
|
115
|
+
const e = (o = m.value) == null ? void 0 : o.closest("label");
|
|
102
116
|
if (!e) {
|
|
103
|
-
|
|
117
|
+
Fe.value = "";
|
|
104
118
|
return;
|
|
105
119
|
}
|
|
106
|
-
const
|
|
107
|
-
|
|
120
|
+
const t = e.cloneNode(!0);
|
|
121
|
+
t.querySelectorAll(".hys-ui-select-wrap").forEach((u) => u.remove()), Fe.value = (t.textContent ?? "").replace(/\s+/g, " ").trim();
|
|
122
|
+
}
|
|
123
|
+
const _e = he(a.defaultValue ?? null), He = c(
|
|
124
|
+
() => a.modelValue !== void 0 ? a.modelValue : _e.value
|
|
125
|
+
), O = c(() => a.multiple || Array.isArray(He.value)), n = pl(() => a.valueKey);
|
|
126
|
+
function et(e) {
|
|
127
|
+
return Array.isArray(e) ? e.filter((t) => t != null) : e == null || a.emptyValues.some((t) => Object.is(t, e)) ? [] : [e];
|
|
108
128
|
}
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
), j = r(() => l.multiple || Array.isArray(_.value)), n = Ga(() => l.valueKey), g = r(() => {
|
|
112
|
-
const e = Array.isArray(_.value) ? _.value.filter((o) => o != null) : _.value == null || l.emptyValues.some((o) => Object.is(o, _.value)) ? [] : [_.value], a = /* @__PURE__ */ new Set();
|
|
129
|
+
const je = c(() => et(He.value)), g = c(() => {
|
|
130
|
+
const e = a.labelInValue ? je.value.map((o) => Ct(o) ? o.value : o) : je.value, t = /* @__PURE__ */ new Set();
|
|
113
131
|
return e.filter((o) => {
|
|
114
|
-
const
|
|
115
|
-
return
|
|
132
|
+
const u = n(o);
|
|
133
|
+
return t.has(u) ? !1 : (t.add(u), !0);
|
|
116
134
|
});
|
|
117
|
-
}),
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
135
|
+
}), Lt = c(() => {
|
|
136
|
+
const e = /* @__PURE__ */ new Map();
|
|
137
|
+
if (a.labelInValue)
|
|
138
|
+
for (const t of je.value)
|
|
139
|
+
Ct(t) && e.set(n(t.value), t.label);
|
|
140
|
+
return e;
|
|
141
|
+
}), j = c(() => new Set(g.value.map(n))), q = he([]), N = he(/* @__PURE__ */ new Map()), be = he(), ge = L(!1), te = he(), tt = L(""), ke = L(a.searchValue ?? ""), xe = L(!1), k = c(() => a.searchValue ?? tt.value), ne = c(() => a.filterable || a.allowCreate), lt = c(
|
|
142
|
+
() => fl(
|
|
143
|
+
be.value ?? a.options,
|
|
144
|
+
a.fieldNames,
|
|
121
145
|
n
|
|
122
146
|
)
|
|
123
|
-
),
|
|
124
|
-
() =>
|
|
147
|
+
), le = c(
|
|
148
|
+
() => lt.value.flatMap((e) => e.option ? [e.option] : [])
|
|
125
149
|
);
|
|
126
|
-
|
|
127
|
-
[
|
|
150
|
+
X(
|
|
151
|
+
[le, g, q],
|
|
128
152
|
() => {
|
|
129
|
-
const e =
|
|
130
|
-
for (const o of [...
|
|
131
|
-
|
|
153
|
+
const e = N.value, t = /* @__PURE__ */ new Map();
|
|
154
|
+
for (const o of [...q.value, ...le.value])
|
|
155
|
+
t.set(n(o.value), o);
|
|
132
156
|
for (const o of g.value) {
|
|
133
|
-
const
|
|
134
|
-
!
|
|
157
|
+
const u = n(o);
|
|
158
|
+
!t.has(u) && e.has(u) && t.set(u, e.get(u));
|
|
135
159
|
}
|
|
136
|
-
|
|
160
|
+
N.value = t;
|
|
137
161
|
},
|
|
138
162
|
{ immediate: !0 }
|
|
139
163
|
);
|
|
140
|
-
function
|
|
141
|
-
if (
|
|
142
|
-
return typeof
|
|
164
|
+
function Ot(e) {
|
|
165
|
+
if (a.fallbackOption !== !1)
|
|
166
|
+
return typeof a.fallbackOption == "function" ? a.fallbackOption(e) : {
|
|
143
167
|
value: e,
|
|
144
168
|
label: String(
|
|
145
|
-
typeof e == "object" ? e.label ?? e.name ?? e[
|
|
169
|
+
typeof e == "object" ? e.label ?? e.name ?? e[a.valueKey] ?? "未命名选项" : e
|
|
146
170
|
)
|
|
147
171
|
};
|
|
148
172
|
}
|
|
149
|
-
|
|
173
|
+
function Ae(e) {
|
|
174
|
+
const t = n(e), o = Lt.value.get(t);
|
|
175
|
+
return N.value.get(t) ?? (o === void 0 ? Ot(e) : { value: e, label: o });
|
|
176
|
+
}
|
|
177
|
+
const B = c(
|
|
150
178
|
() => g.value.flatMap((e) => {
|
|
151
|
-
const
|
|
152
|
-
return
|
|
179
|
+
const t = Ae(e);
|
|
180
|
+
return t ? [t] : [];
|
|
153
181
|
})
|
|
154
|
-
),
|
|
155
|
-
() =>
|
|
182
|
+
), at = c(
|
|
183
|
+
() => B.value.slice(
|
|
156
184
|
0,
|
|
157
|
-
|
|
185
|
+
a.maxTagCount === void 0 ? void 0 : Math.max(0, a.maxTagCount)
|
|
158
186
|
)
|
|
159
|
-
),
|
|
160
|
-
() =>
|
|
161
|
-
),
|
|
162
|
-
() =>
|
|
163
|
-
),
|
|
187
|
+
), Se = c(
|
|
188
|
+
() => B.value.slice(at.value.length)
|
|
189
|
+
), D = c(() => a.loading || ge.value), Te = c(
|
|
190
|
+
() => O.value && a.multipleLimit > 0 && g.value.length >= a.multipleLimit
|
|
191
|
+
), Ce = c(
|
|
164
192
|
() => {
|
|
165
|
-
var e,
|
|
166
|
-
return
|
|
193
|
+
var e, t;
|
|
194
|
+
return a.status ?? ((e = W == null ? void 0 : W.invalid) != null && e.value ? "error" : (t = W == null ? void 0 : W.status) == null ? void 0 : t.value);
|
|
167
195
|
}
|
|
168
|
-
),
|
|
169
|
-
() =>
|
|
170
|
-
),
|
|
196
|
+
), ae = c(
|
|
197
|
+
() => F.value === "sm" ? 14 : F.value === "lg" ? 18 : 16
|
|
198
|
+
), R = c(
|
|
171
199
|
() => Math.max(
|
|
172
200
|
24,
|
|
173
|
-
|
|
201
|
+
a.itemHeight ?? (F.value === "sm" ? 34 : F.value === "lg" ? 50 : 42)
|
|
174
202
|
)
|
|
175
|
-
),
|
|
203
|
+
), Ie = c(() => {
|
|
176
204
|
const e = k.value.trim();
|
|
177
|
-
if (!(!
|
|
178
|
-
(
|
|
205
|
+
if (!(!a.allowCreate || !e || [...le.value, ...q.value].some(
|
|
206
|
+
(t) => t.label === e || n(t.value) === n(e)
|
|
179
207
|
)))
|
|
180
208
|
return { value: e, label: e };
|
|
181
|
-
}),
|
|
182
|
-
let e =
|
|
183
|
-
|
|
184
|
-
(
|
|
185
|
-
(
|
|
209
|
+
}), S = c(() => {
|
|
210
|
+
let e = lt.value.filter((i) => i.option).concat(
|
|
211
|
+
q.value.filter(
|
|
212
|
+
(i) => !le.value.some(
|
|
213
|
+
(l) => n(l.value) === n(i.value)
|
|
186
214
|
)
|
|
187
|
-
).map((
|
|
215
|
+
).map((i) => ({ key: n(i.value), option: i, index: -1 }))
|
|
188
216
|
);
|
|
189
|
-
!
|
|
190
|
-
(
|
|
191
|
-
)),
|
|
192
|
-
(
|
|
193
|
-
)),
|
|
217
|
+
!a.remote && !a.remoteMethod && (e = e.filter(
|
|
218
|
+
(i) => !k.value || (a.filterMethod ? a.filterMethod(k.value, i.option) : i.option.label.toLocaleLowerCase().includes(k.value.toLocaleLowerCase()))
|
|
219
|
+
)), a.filterSort && (e = [...e].sort(
|
|
220
|
+
(i, l) => a.filterSort(i.option, l.option)
|
|
221
|
+
)), Ie.value && (e = [
|
|
194
222
|
{
|
|
195
|
-
key: "create:" + n(
|
|
196
|
-
option:
|
|
223
|
+
key: "create:" + n(Ie.value.value),
|
|
224
|
+
option: Ie.value,
|
|
197
225
|
created: !0,
|
|
198
226
|
index: -1
|
|
199
227
|
},
|
|
200
228
|
...e
|
|
201
229
|
]);
|
|
202
|
-
const
|
|
203
|
-
let o,
|
|
204
|
-
for (const
|
|
205
|
-
|
|
206
|
-
return
|
|
207
|
-
}),
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
230
|
+
const t = [];
|
|
231
|
+
let o, u = 0;
|
|
232
|
+
for (const i of e)
|
|
233
|
+
i.group !== o && (o = i.group, o && t.push({ key: "group:" + o + ":" + u, index: -1, group: o })), t.push({ ...i, index: u++ });
|
|
234
|
+
return t;
|
|
235
|
+
}), we = c(() => O.value && a.showSelectAll), Ke = c(() => {
|
|
236
|
+
const e = a.selectAllScope === "all" ? [...le.value, ...q.value] : S.value.flatMap(
|
|
237
|
+
(o) => o.option && !o.created ? [o.option] : []
|
|
238
|
+
), t = /* @__PURE__ */ new Set();
|
|
239
|
+
return e.filter((o) => {
|
|
240
|
+
const u = n(o.value);
|
|
241
|
+
return t.has(u) ? !1 : (t.add(u), !o.disabled);
|
|
242
|
+
});
|
|
243
|
+
}), Me = c(
|
|
244
|
+
() => b.value || a.readonly || D.value || !!te.value
|
|
245
|
+
), zt = c(
|
|
246
|
+
() => Ke.value.some(
|
|
247
|
+
(e) => !j.value.has(n(e.value))
|
|
248
|
+
)
|
|
249
|
+
), ot = c(() => {
|
|
250
|
+
const e = new Set(
|
|
251
|
+
Ke.value.map((t) => n(t.value))
|
|
252
|
+
);
|
|
253
|
+
return g.value.filter((t) => {
|
|
254
|
+
const o = N.value.get(n(t));
|
|
255
|
+
return !(o != null && o.disabled) && (a.selectAllScope === "all" || e.has(n(t)));
|
|
256
|
+
});
|
|
257
|
+
}), $t = c(
|
|
258
|
+
() => S.value.filter((e) => e.option).length
|
|
259
|
+
), V = L(), Be = L(0), We = L(0), I = c(
|
|
260
|
+
() => a.virtual && S.value.length > 100
|
|
261
|
+
), se = c(
|
|
212
262
|
() => Math.min(
|
|
213
263
|
800,
|
|
214
|
-
Math.max(80, Number.isFinite(
|
|
264
|
+
Math.max(80, Number.isFinite(a.listHeight) ? a.listHeight : 240)
|
|
215
265
|
)
|
|
216
|
-
),
|
|
217
|
-
() =>
|
|
266
|
+
), it = c(() => Math.max(1, Math.min(30, a.overscan))), qe = c(
|
|
267
|
+
() => I.value ? Math.max(
|
|
218
268
|
0,
|
|
219
269
|
Math.min(
|
|
220
|
-
Math.max(0,
|
|
221
|
-
Math.floor(
|
|
270
|
+
Math.max(0, S.value.length - 1),
|
|
271
|
+
Math.floor(Be.value / R.value) - it.value
|
|
222
272
|
)
|
|
223
273
|
) : 0
|
|
224
|
-
),
|
|
225
|
-
() =>
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
) :
|
|
229
|
-
), re =
|
|
230
|
-
() =>
|
|
231
|
-
),
|
|
274
|
+
), ut = c(
|
|
275
|
+
() => I.value ? S.value.slice(
|
|
276
|
+
qe.value,
|
|
277
|
+
qe.value + Math.ceil(se.value / R.value) + it.value * 2
|
|
278
|
+
) : S.value
|
|
279
|
+
), re = c(
|
|
280
|
+
() => S.value.find((e) => e.key === V.value)
|
|
281
|
+
), nt = c(
|
|
232
282
|
() => {
|
|
233
283
|
var e;
|
|
234
|
-
return !
|
|
284
|
+
return !D.value && ((e = re.value) != null && e.option) && (!I.value || ut.value.some((t) => t.key === V.value)) ? ue + "-" + re.value.index : void 0;
|
|
235
285
|
}
|
|
236
|
-
),
|
|
286
|
+
), Et = c(() => {
|
|
237
287
|
var o;
|
|
238
|
-
if (!
|
|
239
|
-
return
|
|
240
|
-
const e =
|
|
241
|
-
let
|
|
242
|
-
for (const
|
|
243
|
-
const
|
|
244
|
-
let
|
|
245
|
-
for (const
|
|
246
|
-
|
|
288
|
+
if (!I.value || a.popupMatchWidth || a.popupWidth !== void 0)
|
|
289
|
+
return a.popupWidth;
|
|
290
|
+
const e = F.value === "sm" ? 12 : F.value === "lg" ? 15 : 14;
|
|
291
|
+
let t = 0;
|
|
292
|
+
for (const u of S.value) {
|
|
293
|
+
const i = ((o = u.option) == null ? void 0 : o.label) ?? u.group ?? "";
|
|
294
|
+
let l = 0;
|
|
295
|
+
for (const d of i) l += d.charCodeAt(0) > 255 ? 1 : 0.58;
|
|
296
|
+
t = Math.max(t, l * e);
|
|
247
297
|
}
|
|
248
|
-
return Math.max(
|
|
298
|
+
return Math.max(We.value, t + 52);
|
|
249
299
|
});
|
|
250
|
-
let
|
|
300
|
+
let U = !0, ce = !1, de = 0, oe, De, G, Re = 0, Ve, Le = "";
|
|
251
301
|
const {
|
|
252
|
-
open:
|
|
253
|
-
style:
|
|
254
|
-
placement:
|
|
255
|
-
show:
|
|
256
|
-
close:
|
|
257
|
-
update:
|
|
258
|
-
restoringFocus:
|
|
259
|
-
} =
|
|
302
|
+
open: y,
|
|
303
|
+
style: Ft,
|
|
304
|
+
placement: st,
|
|
305
|
+
show: Ht,
|
|
306
|
+
close: w,
|
|
307
|
+
update: Oe,
|
|
308
|
+
restoringFocus: jt
|
|
309
|
+
} = vl(m, C, {
|
|
260
310
|
get placement() {
|
|
261
|
-
return
|
|
311
|
+
return a.placement;
|
|
262
312
|
},
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
313
|
+
get closeOnTab() {
|
|
314
|
+
return !we.value;
|
|
315
|
+
},
|
|
316
|
+
matchWidth: () => a.popupMatchWidth ? !0 : "min",
|
|
317
|
+
width: () => Et.value,
|
|
318
|
+
requestOpen: (e) => (p("update:open", e), a.open === void 0 ? void 0 : !1)
|
|
319
|
+
}), It = c(() => ({
|
|
320
|
+
...a.popupStyle,
|
|
321
|
+
...Ft.value,
|
|
269
322
|
maxHeight: "min(60dvh, calc(100dvh - 20px))",
|
|
270
323
|
overflowY: "hidden",
|
|
271
|
-
"--hys-ui-select-stride":
|
|
272
|
-
"--hys-ui-select-list-height":
|
|
273
|
-
})),
|
|
274
|
-
Object.entries(
|
|
275
|
-
),
|
|
276
|
-
function
|
|
277
|
-
return
|
|
278
|
-
}
|
|
279
|
-
function
|
|
324
|
+
"--hys-ui-select-stride": R.value + "px",
|
|
325
|
+
"--hys-ui-select-list-height": se.value + "px"
|
|
326
|
+
})), Kt = () => Object.fromEntries(
|
|
327
|
+
Object.entries(Vt).filter(([e]) => !["class", "style"].includes(e))
|
|
328
|
+
), J = (e) => !!e.disabled || a.readonly || D.value || b.value || Te.value && !j.value.has(n(e.value));
|
|
329
|
+
function rt() {
|
|
330
|
+
return S.value.filter((e) => e.option && !J(e.option));
|
|
331
|
+
}
|
|
332
|
+
function ze(e = !1) {
|
|
280
333
|
var i;
|
|
281
|
-
const
|
|
282
|
-
(
|
|
283
|
-
);
|
|
284
|
-
|
|
334
|
+
const t = rt(), o = t.find(
|
|
335
|
+
(l) => j.value.has(n(l.option.value))
|
|
336
|
+
), u = !e && a.firstActiveValue !== void 0 ? t.find((l) => n(l.option.value) === n(a.firstActiveValue)) : void 0;
|
|
337
|
+
V.value = (i = o ?? u ?? (a.defaultActiveFirst ? e ? t.at(-1) : t[0] : void 0)) == null ? void 0 : i.key;
|
|
285
338
|
}
|
|
286
|
-
async function
|
|
287
|
-
var
|
|
288
|
-
const e =
|
|
289
|
-
(
|
|
339
|
+
async function Z() {
|
|
340
|
+
var t, o;
|
|
341
|
+
const e = S.value.findIndex(
|
|
342
|
+
(u) => u.key === V.value
|
|
290
343
|
);
|
|
291
344
|
if (!(e < 0)) {
|
|
292
|
-
if (
|
|
293
|
-
const
|
|
294
|
-
|
|
345
|
+
if (I.value && H.value) {
|
|
346
|
+
const u = e * R.value, i = u + R.value, l = H.value.clientHeight || se.value;
|
|
347
|
+
u < H.value.scrollTop ? H.value.scrollTop = u : i > H.value.scrollTop + l && (H.value.scrollTop = i - l), Be.value = H.value.scrollTop;
|
|
295
348
|
}
|
|
296
|
-
await z(),
|
|
349
|
+
await z(), I.value || (o = (t = C.value) == null ? void 0 : t.querySelector('[data-active="true"]')) == null || o.scrollIntoView({ block: "nearest" });
|
|
297
350
|
}
|
|
298
351
|
}
|
|
299
|
-
function
|
|
300
|
-
const
|
|
301
|
-
if (
|
|
302
|
-
return;
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
const
|
|
306
|
-
|
|
352
|
+
function Q(e) {
|
|
353
|
+
const t = et(e);
|
|
354
|
+
if (t.length === g.value.length && t.every((i, l) => n(i) === n(g.value[l])))
|
|
355
|
+
return He.value;
|
|
356
|
+
let o = e;
|
|
357
|
+
if (a.labelInValue && (Array.isArray(e) || t.length)) {
|
|
358
|
+
const i = t.map((l) => {
|
|
359
|
+
var d;
|
|
360
|
+
return {
|
|
361
|
+
value: l,
|
|
362
|
+
label: ((d = Ae(l)) == null ? void 0 : d.label) ?? String(l)
|
|
363
|
+
};
|
|
364
|
+
});
|
|
365
|
+
o = Array.isArray(e) ? i : i[0];
|
|
366
|
+
}
|
|
367
|
+
a.modelValue === void 0 && (_e.value = o);
|
|
368
|
+
const u = t.flatMap((i) => {
|
|
369
|
+
const l = Ae(i);
|
|
370
|
+
return l ? [l] : [];
|
|
371
|
+
});
|
|
372
|
+
return p("update:modelValue", o), p("change", o, O.value ? u : u[0]), o;
|
|
373
|
+
}
|
|
374
|
+
function ct() {
|
|
375
|
+
const e = document.activeElement;
|
|
376
|
+
z(() => {
|
|
377
|
+
var t, o;
|
|
378
|
+
e && ((t = C.value) != null && t.contains(e)) && e.disabled && ((o = ft()[0] ?? m.value) == null || o.focus());
|
|
307
379
|
});
|
|
308
|
-
|
|
380
|
+
}
|
|
381
|
+
function dt() {
|
|
382
|
+
if (!O.value || Me.value) return 0;
|
|
383
|
+
const e = [...g.value], t = [], o = new Set(j.value), u = a.multipleLimit > 0 ? a.multipleLimit : 1 / 0;
|
|
384
|
+
for (const l of Ke.value) {
|
|
385
|
+
const d = n(l.value);
|
|
386
|
+
if (!o.has(d)) {
|
|
387
|
+
if (e.length >= u) break;
|
|
388
|
+
o.add(d), e.push(l.value), t.push(l);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
if (!t.length) return 0;
|
|
392
|
+
const i = Q(e);
|
|
393
|
+
return ct(), p("selectAll", i, t), t.length;
|
|
394
|
+
}
|
|
395
|
+
function vt() {
|
|
396
|
+
if (!O.value || Me.value) return 0;
|
|
397
|
+
const e = new Set(ot.value.map(n));
|
|
398
|
+
if (!e.size) return 0;
|
|
399
|
+
const t = g.value.filter((i) => !e.has(n(i))), o = g.value.filter((i) => e.has(n(i))).map(
|
|
400
|
+
(i) => Ae(i) ?? { value: i, label: String(i) }
|
|
401
|
+
), u = Q(t);
|
|
402
|
+
return ct(), p("deselectAll", u, o), e.size;
|
|
403
|
+
}
|
|
404
|
+
function ft() {
|
|
405
|
+
var e;
|
|
406
|
+
return Array.from(
|
|
407
|
+
((e = C.value) == null ? void 0 : e.querySelectorAll(wt)) ?? []
|
|
408
|
+
).filter(
|
|
409
|
+
(t) => t.tabIndex >= 0 && t.getClientRects().length && !t.closest("[inert]")
|
|
410
|
+
);
|
|
411
|
+
}
|
|
412
|
+
function Wt(e) {
|
|
413
|
+
var l, d;
|
|
414
|
+
const t = ft(), o = document.activeElement, u = t.indexOf(o), i = o === m.value ? e.shiftKey ? void 0 : t[0] : t[u + (e.shiftKey ? -1 : 1)];
|
|
415
|
+
if (i) {
|
|
416
|
+
e.preventDefault(), i.focus();
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
if ((l = C.value) != null && l.contains(o)) {
|
|
420
|
+
e.preventDefault();
|
|
421
|
+
const f = Array.from(
|
|
422
|
+
document.querySelectorAll(wt)
|
|
423
|
+
).filter(
|
|
424
|
+
(A) => {
|
|
425
|
+
var Y;
|
|
426
|
+
return !((Y = C.value) != null && Y.contains(A)) && A.tabIndex >= 0 && A.getClientRects().length && !A.closest("[inert]");
|
|
427
|
+
}
|
|
428
|
+
), x = f.indexOf(m.value), K = f.slice(x + 1).find((A) => {
|
|
429
|
+
var Y, pe;
|
|
430
|
+
return !((pe = (Y = m.value) == null ? void 0 : Y.parentElement) != null && pe.contains(A));
|
|
431
|
+
});
|
|
432
|
+
w(), (d = e.shiftKey ? m.value : K ?? m.value) == null || d.focus();
|
|
433
|
+
} else w();
|
|
309
434
|
}
|
|
310
435
|
function ve(e) {
|
|
311
|
-
|
|
436
|
+
ke.value = e, a.searchValue === void 0 && (tt.value = e), p("update:searchValue", e);
|
|
312
437
|
}
|
|
313
|
-
function
|
|
314
|
-
|
|
438
|
+
function pt(e) {
|
|
439
|
+
N.value.has(n(e.value)) || (q.value = [...q.value, e], N.value = new Map(N.value).set(
|
|
315
440
|
n(e.value),
|
|
316
441
|
e
|
|
317
|
-
),
|
|
442
|
+
), p("create", e));
|
|
318
443
|
}
|
|
319
|
-
function
|
|
444
|
+
function ht(e) {
|
|
320
445
|
try {
|
|
321
|
-
const
|
|
322
|
-
return
|
|
446
|
+
const t = a.createOption ? a.createOption(e) : { label: e, value: e };
|
|
447
|
+
return t ? { ...t, label: String(t.label) } : void 0;
|
|
323
448
|
} catch {
|
|
324
|
-
|
|
449
|
+
p("reject", e, "create");
|
|
325
450
|
return;
|
|
326
451
|
}
|
|
327
452
|
}
|
|
328
|
-
async function
|
|
329
|
-
var
|
|
330
|
-
if (!(e != null && e.option) ||
|
|
331
|
-
let
|
|
453
|
+
async function yt(e) {
|
|
454
|
+
var i;
|
|
455
|
+
if (!(e != null && e.option) || J(e.option)) return;
|
|
456
|
+
let t = e.option;
|
|
332
457
|
if (e.created) {
|
|
333
|
-
const
|
|
334
|
-
if (!
|
|
335
|
-
if (
|
|
336
|
-
|
|
458
|
+
const l = ht(t.label);
|
|
459
|
+
if (!l) return;
|
|
460
|
+
if (t = N.value.get(n(l.value)) ?? l, Te.value && !j.value.has(n(t.value))) {
|
|
461
|
+
p("reject", t.value, "limit");
|
|
337
462
|
return;
|
|
338
463
|
}
|
|
339
|
-
|
|
464
|
+
pt(t);
|
|
340
465
|
}
|
|
341
|
-
const o = n(
|
|
342
|
-
if (
|
|
343
|
-
if (
|
|
344
|
-
|
|
466
|
+
const o = n(t.value), u = j.value.has(o);
|
|
467
|
+
if (O.value) {
|
|
468
|
+
if (u)
|
|
469
|
+
Q(g.value.filter((l) => n(l) !== o)), p("deselect", t.value, t);
|
|
345
470
|
else {
|
|
346
|
-
if (
|
|
347
|
-
|
|
471
|
+
if (Te.value) {
|
|
472
|
+
p("reject", t.value, "limit");
|
|
348
473
|
return;
|
|
349
474
|
}
|
|
350
|
-
|
|
475
|
+
Q([...g.value, t.value]), p("select", t.value, t);
|
|
351
476
|
}
|
|
352
|
-
|
|
477
|
+
a.clearSearchAfterSelect && ve(""), await z(), y.value && ne.value && ((i = ee.value) == null || i.focus());
|
|
353
478
|
} else
|
|
354
|
-
|
|
479
|
+
Q(t.value), p("select", t.value, t), w(!0);
|
|
355
480
|
}
|
|
356
|
-
function
|
|
357
|
-
var
|
|
358
|
-
|
|
481
|
+
function Pe(e) {
|
|
482
|
+
var t;
|
|
483
|
+
b.value || a.readonly || e.disabled || !a.removable || (Q(g.value.filter((o) => n(o) !== n(e.value))), p("removeTag", e.value, e), p("deselect", e.value, e), (t = m.value) == null || t.focus());
|
|
359
484
|
}
|
|
360
|
-
function
|
|
361
|
-
var e,
|
|
362
|
-
|
|
485
|
+
function qt() {
|
|
486
|
+
var e, t;
|
|
487
|
+
b.value || a.readonly || (fe(), Q(O.value ? [] : typeof a.clearValue == "function" ? a.clearValue() : a.clearValue), a.clearCreatedOnClear && (q.value = []), ve(""), p("clear"), y.value && ne.value ? (e = ee.value) == null || e.focus() : (t = m.value) == null || t.focus());
|
|
363
488
|
}
|
|
364
|
-
async function
|
|
489
|
+
async function P(e = !1, t = !1) {
|
|
365
490
|
var o;
|
|
366
|
-
!
|
|
491
|
+
!U || b.value || (!a.retainSearch && !a.searchValue && ve(""), ze(e), await Ht(t), await z(), y.value && (ne.value && ((o = ee.value) == null || o.focus()), await Z()));
|
|
367
492
|
}
|
|
368
|
-
function
|
|
369
|
-
|
|
493
|
+
function mt() {
|
|
494
|
+
y.value ? w() : P();
|
|
370
495
|
}
|
|
371
496
|
function fe() {
|
|
372
|
-
de++, clearTimeout(
|
|
497
|
+
de++, clearTimeout(De), De = void 0, oe == null || oe.abort(), oe = void 0, ge.value = !1;
|
|
373
498
|
}
|
|
374
|
-
function
|
|
375
|
-
if (fe(), !
|
|
499
|
+
function $e(e, t = !1) {
|
|
500
|
+
if (fe(), !a.remoteMethod || !y.value || !U || b.value)
|
|
376
501
|
return;
|
|
377
|
-
const o = de,
|
|
378
|
-
|
|
379
|
-
const
|
|
502
|
+
const o = de, u = new AbortController();
|
|
503
|
+
oe = u, ge.value = !0, te.value = void 0;
|
|
504
|
+
const i = async () => {
|
|
380
505
|
try {
|
|
381
|
-
const
|
|
382
|
-
signal:
|
|
506
|
+
const l = await a.remoteMethod(e, {
|
|
507
|
+
signal: u.signal
|
|
383
508
|
});
|
|
384
|
-
if (!
|
|
509
|
+
if (!U || u.signal.aborted || o !== de || !y.value)
|
|
385
510
|
return;
|
|
386
|
-
Array.isArray(
|
|
387
|
-
} catch (
|
|
388
|
-
if (
|
|
389
|
-
|
|
511
|
+
Array.isArray(l) && (be.value = l);
|
|
512
|
+
} catch (l) {
|
|
513
|
+
if (u.signal.aborted || o !== de || !U) return;
|
|
514
|
+
te.value = l, be.value = [], p("searchError", l, e);
|
|
390
515
|
} finally {
|
|
391
|
-
o === de && (
|
|
516
|
+
o === de && (ge.value = !1, oe = void 0, await z(), y.value && (ze(), Oe(), Z()));
|
|
392
517
|
}
|
|
393
518
|
};
|
|
394
|
-
|
|
519
|
+
t || a.debounce <= 0 ? i() : De = setTimeout(i, a.debounce);
|
|
395
520
|
}
|
|
396
|
-
function
|
|
397
|
-
|
|
521
|
+
function Ne() {
|
|
522
|
+
$e(k.value, !0);
|
|
398
523
|
}
|
|
399
|
-
function
|
|
400
|
-
var
|
|
401
|
-
if (
|
|
524
|
+
function Dt(e) {
|
|
525
|
+
var f;
|
|
526
|
+
if (b.value || a.readonly || D.value || !O.value || !a.allowCreate || !((f = a.tokenSeparators) != null && f.length))
|
|
402
527
|
return !1;
|
|
403
|
-
let
|
|
404
|
-
for (const
|
|
405
|
-
|
|
528
|
+
let t = [e], o = !1;
|
|
529
|
+
for (const x of a.tokenSeparators)
|
|
530
|
+
x && (t.some((K) => K.includes(x)) && (o = !0), t = t.flatMap((K) => K.split(x)));
|
|
406
531
|
if (!o) return !1;
|
|
407
|
-
const
|
|
408
|
-
let
|
|
409
|
-
for (const
|
|
410
|
-
const
|
|
411
|
-
(
|
|
412
|
-
),
|
|
413
|
-
if (!
|
|
414
|
-
const
|
|
415
|
-
if (!(
|
|
416
|
-
if (
|
|
417
|
-
|
|
532
|
+
const u = t.pop() ?? "", i = [...g.value], l = new Set(i.map(n));
|
|
533
|
+
let d = !1;
|
|
534
|
+
for (const x of t.map((K) => K.trim()).filter(Boolean)) {
|
|
535
|
+
const K = [...le.value, ...q.value].find(
|
|
536
|
+
(pe) => pe.label === x || n(pe.value) === n(x)
|
|
537
|
+
), A = K ?? ht(x);
|
|
538
|
+
if (!A) continue;
|
|
539
|
+
const Y = n(A.value);
|
|
540
|
+
if (!(l.has(Y) || A.disabled)) {
|
|
541
|
+
if (a.multipleLimit > 0 && i.length >= a.multipleLimit) {
|
|
542
|
+
p("reject", A.value, "limit");
|
|
418
543
|
continue;
|
|
419
544
|
}
|
|
420
|
-
|
|
545
|
+
K || pt(A), l.add(Y), i.push(A.value), d = !0, p("select", A.value, A);
|
|
421
546
|
}
|
|
422
547
|
}
|
|
423
|
-
return
|
|
548
|
+
return d && Q(i), ve(u), !0;
|
|
424
549
|
}
|
|
425
|
-
function
|
|
426
|
-
if (
|
|
427
|
-
const
|
|
428
|
-
|
|
550
|
+
function bt(e) {
|
|
551
|
+
if (b.value) return;
|
|
552
|
+
const t = e.target.value;
|
|
553
|
+
ke.value = t, !xe.value && (Dt(t) || ve(t));
|
|
429
554
|
}
|
|
430
|
-
function
|
|
431
|
-
|
|
555
|
+
function Rt(e) {
|
|
556
|
+
xe.value = !1, bt(e);
|
|
432
557
|
}
|
|
433
|
-
async function
|
|
434
|
-
var
|
|
435
|
-
if (
|
|
558
|
+
async function gt(e) {
|
|
559
|
+
var u, i;
|
|
560
|
+
if (b.value || !a.keyboard || e.isComposing || xe.value || e.keyCode === 229)
|
|
561
|
+
return;
|
|
562
|
+
if (e.key === "Tab" && y.value && we.value) {
|
|
563
|
+
Wt(e);
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
if (e.target.closest(
|
|
436
567
|
".hys-ui-select-tag button,.hys-ui-select-clear"
|
|
437
568
|
))
|
|
438
569
|
return;
|
|
439
|
-
const
|
|
440
|
-
if (!(o !==
|
|
570
|
+
const t = e.target === ee.value, o = e.target;
|
|
571
|
+
if (!(o !== m.value && !t && !o.matches('[role="option"]') && o.closest(
|
|
441
572
|
'button,input,textarea,select,a,[role="button"],[contenteditable="true"]'
|
|
442
573
|
))) {
|
|
443
574
|
if (["ArrowDown", "ArrowUp", "Home", "End", "PageDown", "PageUp"].includes(
|
|
444
575
|
e.key
|
|
445
576
|
)) {
|
|
446
|
-
if (e.preventDefault(), !
|
|
447
|
-
await
|
|
577
|
+
if (e.preventDefault(), !y.value)
|
|
578
|
+
await P(e.key === "ArrowUp" || e.key === "End");
|
|
448
579
|
else {
|
|
449
|
-
const
|
|
450
|
-
let
|
|
451
|
-
e.key.startsWith("Page") && (
|
|
580
|
+
const l = S.value, d = ["ArrowUp", "End", "PageUp"].includes(e.key) ? -1 : 1;
|
|
581
|
+
let f = e.key === "Home" ? -1 : e.key === "End" ? l.length : l.findIndex((x) => x.key === V.value);
|
|
582
|
+
e.key.startsWith("Page") && (f = Math.max(
|
|
452
583
|
-1,
|
|
453
584
|
Math.min(
|
|
454
|
-
|
|
455
|
-
|
|
585
|
+
l.length,
|
|
586
|
+
f + d * (Math.max(1, Math.floor(se.value / R.value)) - 1)
|
|
456
587
|
)
|
|
457
588
|
));
|
|
458
|
-
for (let
|
|
459
|
-
if (
|
|
460
|
-
|
|
589
|
+
for (let x = 0; x < l.length; x++)
|
|
590
|
+
if (f = (f + d + l.length) % l.length, l[f].option && !J(l[f].option)) {
|
|
591
|
+
V.value = l[f].key;
|
|
461
592
|
break;
|
|
462
593
|
}
|
|
463
594
|
}
|
|
464
|
-
await
|
|
465
|
-
} else if (e.key === "Enter" || e.key === " " && !
|
|
466
|
-
e.preventDefault(),
|
|
595
|
+
await Z();
|
|
596
|
+
} else if (e.key === "Enter" || e.key === " " && !t)
|
|
597
|
+
e.preventDefault(), y.value ? await yt(re.value) : await P();
|
|
467
598
|
else if (e.key === "Tab")
|
|
468
|
-
|
|
469
|
-
else if (e.key === "Backspace" &&
|
|
470
|
-
const
|
|
471
|
-
|
|
472
|
-
} else if (!
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
}, 600),
|
|
476
|
-
const
|
|
477
|
-
(
|
|
599
|
+
w(!!((u = C.value) != null && u.contains(document.activeElement)));
|
|
600
|
+
else if (e.key === "Backspace" && O.value && !k.value) {
|
|
601
|
+
const l = [...B.value].reverse().find((d) => !d.disabled);
|
|
602
|
+
l && a.removable && (e.preventDefault(), Pe(l), t && (await z(), (i = ee.value) == null || i.focus()));
|
|
603
|
+
} else if (!ne.value && e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey) {
|
|
604
|
+
Le += e.key.toLocaleLowerCase(), clearTimeout(Ve), Ve = setTimeout(() => {
|
|
605
|
+
Le = "";
|
|
606
|
+
}, 600), y.value || await P();
|
|
607
|
+
const l = rt().find(
|
|
608
|
+
(d) => d.option.label.toLocaleLowerCase().startsWith(Le)
|
|
478
609
|
);
|
|
479
|
-
|
|
610
|
+
l && (V.value = l.key, await Z());
|
|
480
611
|
}
|
|
481
612
|
}
|
|
482
613
|
}
|
|
483
|
-
function
|
|
484
|
-
ce || (ce = !0,
|
|
614
|
+
function kt(e) {
|
|
615
|
+
ce || (ce = !0, p("focus", e)), a.showOnFocus && !y.value && !jt.value && e.target === m.value && P();
|
|
485
616
|
}
|
|
486
|
-
function
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
617
|
+
function xt(e) {
|
|
618
|
+
var o, u;
|
|
619
|
+
const t = e.relatedTarget;
|
|
620
|
+
t && ((o = m.value) != null && o.contains(t) || (u = C.value) != null && u.contains(t)) || z(() => {
|
|
621
|
+
var l, d;
|
|
622
|
+
const i = document.activeElement;
|
|
623
|
+
ce && !((l = m.value) != null && l.contains(i)) && !((d = C.value) != null && d.contains(i)) && (ce = !1, we.value && w(), p("blur", e));
|
|
491
624
|
});
|
|
492
625
|
}
|
|
493
|
-
function
|
|
494
|
-
const
|
|
495
|
-
|
|
626
|
+
function Pt(e) {
|
|
627
|
+
const t = e.target;
|
|
628
|
+
Be.value = t.scrollTop, p("popupScroll", e), t.scrollTop + t.clientHeight >= t.scrollHeight - 2 && p("reachEnd");
|
|
496
629
|
}
|
|
497
|
-
function
|
|
498
|
-
|
|
630
|
+
function Ue() {
|
|
631
|
+
G == null || G.disconnect(), G = void 0, cancelAnimationFrame(Re);
|
|
499
632
|
}
|
|
500
|
-
function
|
|
501
|
-
if (
|
|
633
|
+
function Nt() {
|
|
634
|
+
if (Ue(), !y.value || !U) return;
|
|
502
635
|
const e = () => {
|
|
503
|
-
cancelAnimationFrame(
|
|
504
|
-
var
|
|
505
|
-
|
|
636
|
+
cancelAnimationFrame(Re), Re = requestAnimationFrame(() => {
|
|
637
|
+
var t;
|
|
638
|
+
We.value = ((t = m.value) == null ? void 0 : t.clientWidth) ?? 0, Oe();
|
|
506
639
|
});
|
|
507
640
|
};
|
|
508
|
-
typeof ResizeObserver < "u" && (
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
}),
|
|
513
|
-
var
|
|
514
|
-
const e = !((
|
|
515
|
-
e &&
|
|
516
|
-
|
|
641
|
+
typeof ResizeObserver < "u" && (G = new ResizeObserver(e), m.value && G.observe(m.value), C.value && G.observe(C.value));
|
|
642
|
+
}
|
|
643
|
+
X(k, (e) => {
|
|
644
|
+
ke.value = e, V.value = void 0, Be.value = 0, H.value && (H.value.scrollTop = 0), ze(), p("search", e), $e(e), y.value && z(Z);
|
|
645
|
+
}), X(S, () => {
|
|
646
|
+
var t;
|
|
647
|
+
const e = !((t = re.value) != null && t.option) || J(re.value.option);
|
|
648
|
+
e && ze(), y.value && z(() => {
|
|
649
|
+
Oe(), e && Z();
|
|
517
650
|
});
|
|
518
|
-
}),
|
|
651
|
+
}), X(
|
|
519
652
|
[
|
|
520
653
|
g,
|
|
521
|
-
|
|
522
|
-
() =>
|
|
523
|
-
() =>
|
|
524
|
-
() =>
|
|
654
|
+
F,
|
|
655
|
+
() => a.popupMatchWidth,
|
|
656
|
+
() => a.popupWidth,
|
|
657
|
+
() => a.placement
|
|
525
658
|
],
|
|
526
659
|
() => {
|
|
527
|
-
|
|
660
|
+
y.value && z(Oe);
|
|
528
661
|
}
|
|
529
|
-
),
|
|
530
|
-
var
|
|
531
|
-
|
|
532
|
-
}),
|
|
533
|
-
() =>
|
|
662
|
+
), X(y, (e) => {
|
|
663
|
+
var t;
|
|
664
|
+
p("visibleChange", e), e ? (We.value = ((t = m.value) == null ? void 0 : t.clientWidth) ?? 0, z(Nt), $e(k.value)) : (Ue(), fe(), clearTimeout(Ve), Le = "");
|
|
665
|
+
}), X(
|
|
666
|
+
() => a.open,
|
|
534
667
|
(e) => {
|
|
535
|
-
|
|
668
|
+
U && (e ? P(!1, !0) : e === !1 && w(!1, !0));
|
|
536
669
|
}
|
|
537
|
-
),
|
|
538
|
-
|
|
670
|
+
), X(
|
|
671
|
+
b,
|
|
539
672
|
(e) => {
|
|
540
|
-
e && (
|
|
673
|
+
e && (w(!1, !0), fe(), p("update:open", !1));
|
|
541
674
|
},
|
|
542
675
|
{ flush: "sync" }
|
|
543
|
-
),
|
|
544
|
-
() =>
|
|
676
|
+
), X(
|
|
677
|
+
() => a.remoteMethod,
|
|
545
678
|
() => {
|
|
546
|
-
|
|
679
|
+
be.value = void 0, te.value = void 0, y.value && $e(k.value);
|
|
547
680
|
}
|
|
548
681
|
);
|
|
549
|
-
function
|
|
550
|
-
|
|
682
|
+
function At() {
|
|
683
|
+
U = !1, w(!1, !0), Ue(), fe(), clearTimeout(Ve), ce = !1;
|
|
551
684
|
}
|
|
552
|
-
return
|
|
685
|
+
return Gt(() => {
|
|
553
686
|
var e;
|
|
554
|
-
|
|
555
|
-
}),
|
|
556
|
-
|
|
557
|
-
}),
|
|
687
|
+
Ze(), a.autofocus && !b.value && ((e = m.value) == null || e.focus()), (a.open ?? a.defaultOpen) && P(!1, !0);
|
|
688
|
+
}), Jt(Ze), Zt(() => {
|
|
689
|
+
U = !0, a.open && P(!1, !0);
|
|
690
|
+
}), _t(At), el(At), Mt({
|
|
558
691
|
focus: () => {
|
|
559
692
|
var e;
|
|
560
|
-
|
|
693
|
+
b.value || (e = m.value) == null || e.focus();
|
|
561
694
|
},
|
|
562
695
|
blur: () => {
|
|
563
|
-
var
|
|
696
|
+
var t, o;
|
|
564
697
|
const e = document.activeElement;
|
|
565
|
-
e && ((
|
|
698
|
+
e && ((t = m.value) != null && t.contains(e) || (o = C.value) != null && o.contains(e)) && e.blur(), w();
|
|
566
699
|
},
|
|
567
|
-
open: () =>
|
|
568
|
-
close: () =>
|
|
700
|
+
open: () => P(),
|
|
701
|
+
close: () => w(),
|
|
569
702
|
scrollTo: (e) => {
|
|
570
|
-
|
|
703
|
+
V.value = n(e), Z();
|
|
571
704
|
},
|
|
572
|
-
retry:
|
|
573
|
-
|
|
705
|
+
retry: Ne,
|
|
706
|
+
selectAll: dt,
|
|
707
|
+
deselectAll: vt,
|
|
708
|
+
selected: B,
|
|
574
709
|
query: k,
|
|
575
|
-
isOpen:
|
|
576
|
-
}), (e,
|
|
577
|
-
var o,
|
|
578
|
-
return
|
|
579
|
-
class: ["hys-ui-select-wrap", [e.$attrs.class, "hys-ui-select-" + s(
|
|
710
|
+
isOpen: y
|
|
711
|
+
}), (e, t) => {
|
|
712
|
+
var o, u, i;
|
|
713
|
+
return v(), h("div", Qe(s(Ge), {
|
|
714
|
+
class: ["hys-ui-select-wrap", [e.$attrs.class, "hys-ui-select-" + s(F)]],
|
|
580
715
|
style: e.$attrs.style
|
|
581
716
|
}), [
|
|
582
|
-
|
|
717
|
+
$("button", {
|
|
583
718
|
hidden: "",
|
|
584
719
|
type: "button",
|
|
585
720
|
tabindex: "-1",
|
|
586
721
|
"aria-hidden": "true",
|
|
587
|
-
disabled: s(
|
|
588
|
-
onClick:
|
|
589
|
-
var
|
|
590
|
-
(
|
|
722
|
+
disabled: s(b),
|
|
723
|
+
onClick: t[0] || (t[0] = Ee((l) => {
|
|
724
|
+
var d;
|
|
725
|
+
(d = m.value) == null || d.focus(), mt();
|
|
591
726
|
}, ["prevent"]))
|
|
592
|
-
}, null, 8,
|
|
593
|
-
|
|
727
|
+
}, null, 8, hl),
|
|
728
|
+
$("div", Qe({
|
|
594
729
|
ref_key: "trigger",
|
|
595
|
-
ref:
|
|
596
|
-
},
|
|
730
|
+
ref: m
|
|
731
|
+
}, Kt(), {
|
|
597
732
|
class: ["hys-ui-select", {
|
|
598
|
-
"hys-ui-select-disabled": s(
|
|
599
|
-
"hys-ui-select-borderless": !
|
|
600
|
-
"hys-ui-select-error":
|
|
601
|
-
"hys-ui-select-warning":
|
|
602
|
-
"hys-ui-select-success":
|
|
733
|
+
"hys-ui-select-disabled": s(b),
|
|
734
|
+
"hys-ui-select-borderless": !r.bordered,
|
|
735
|
+
"hys-ui-select-error": Ce.value === "error",
|
|
736
|
+
"hys-ui-select-warning": Ce.value === "warning",
|
|
737
|
+
"hys-ui-select-success": Ce.value === "success"
|
|
603
738
|
}],
|
|
604
|
-
id: e.$attrs.id || ((o = s(
|
|
739
|
+
id: e.$attrs.id || ((o = s(W)) == null ? void 0 : o.id.value) || void 0,
|
|
605
740
|
"data-hys-ui-field-managed": "",
|
|
606
741
|
role: "combobox",
|
|
607
|
-
tabindex: s(
|
|
608
|
-
"aria-label":
|
|
742
|
+
tabindex: s(b) ? -1 : 0,
|
|
743
|
+
"aria-label": r.ariaLabel || s(Je) || Fe.value || B.value.map((l) => l.label).join("、") || r.placeholder,
|
|
609
744
|
"aria-haspopup": "listbox",
|
|
610
|
-
"aria-expanded": s(
|
|
611
|
-
"aria-disabled": s(
|
|
612
|
-
"aria-readonly":
|
|
613
|
-
"aria-required": ((
|
|
614
|
-
"aria-invalid":
|
|
615
|
-
"aria-describedby": [e.$attrs["aria-describedby"], (
|
|
616
|
-
"aria-controls": s(
|
|
617
|
-
"aria-activedescendant": s(
|
|
618
|
-
onClick:
|
|
619
|
-
onKeydown:
|
|
620
|
-
onFocusin:
|
|
621
|
-
onFocusout:
|
|
745
|
+
"aria-expanded": s(y),
|
|
746
|
+
"aria-disabled": s(b) || void 0,
|
|
747
|
+
"aria-readonly": r.readonly || void 0,
|
|
748
|
+
"aria-required": ((u = s(W)) == null ? void 0 : u.required.value) || void 0,
|
|
749
|
+
"aria-invalid": Ce.value === "error" || !1,
|
|
750
|
+
"aria-describedby": [e.$attrs["aria-describedby"], (i = s(W)) == null ? void 0 : i.describedBy.value].filter(Boolean).join(" ") || void 0,
|
|
751
|
+
"aria-controls": s(y) ? s(ue) : void 0,
|
|
752
|
+
"aria-activedescendant": s(y) ? nt.value : void 0,
|
|
753
|
+
onClick: t[1] || (t[1] = Ee((l) => !l.target.closest("button") && mt(), ["prevent"])),
|
|
754
|
+
onKeydown: gt,
|
|
755
|
+
onFocusin: kt,
|
|
756
|
+
onFocusout: xt
|
|
622
757
|
}), [
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
var
|
|
758
|
+
$("span", ml, [
|
|
759
|
+
T(e.$slots, "label", { selected: B.value }, () => {
|
|
760
|
+
var l, d;
|
|
626
761
|
return [
|
|
627
|
-
|
|
628
|
-
(
|
|
629
|
-
key: s(n)(
|
|
762
|
+
O.value && B.value.length ? (v(), h(ie, { key: 0 }, [
|
|
763
|
+
(v(!0), h(ie, null, Ye(at.value, (f) => (v(), h("span", {
|
|
764
|
+
key: s(n)(f.value),
|
|
630
765
|
class: "hys-ui-select-tag"
|
|
631
766
|
}, [
|
|
632
|
-
|
|
633
|
-
option:
|
|
634
|
-
remove: () =>
|
|
635
|
-
disabled: s(
|
|
767
|
+
T(e.$slots, "tag", {
|
|
768
|
+
option: f,
|
|
769
|
+
remove: () => Pe(f),
|
|
770
|
+
disabled: s(b) || r.readonly || f.disabled
|
|
636
771
|
}, () => [
|
|
637
|
-
|
|
772
|
+
$("span", {
|
|
638
773
|
class: "hys-ui-select-tag-text",
|
|
639
|
-
title:
|
|
640
|
-
},
|
|
641
|
-
|
|
774
|
+
title: f.label
|
|
775
|
+
}, M(r.maxTagTextLength && f.label.length > r.maxTagTextLength ? f.label.slice(0, r.maxTagTextLength) + "…" : f.label), 9, bl),
|
|
776
|
+
r.removable && !r.readonly && !f.disabled ? (v(), h("button", {
|
|
642
777
|
key: 0,
|
|
643
778
|
type: "button",
|
|
644
|
-
disabled: s(
|
|
645
|
-
"aria-label": "移除 " +
|
|
646
|
-
onClick:
|
|
779
|
+
disabled: s(b),
|
|
780
|
+
"aria-label": "移除 " + f.label,
|
|
781
|
+
onClick: Ee((x) => Pe(f), ["stop"])
|
|
647
782
|
}, [
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
size:
|
|
783
|
+
T(e.$slots, "remove-icon", {}, () => [
|
|
784
|
+
ye(s(Tt), {
|
|
785
|
+
size: ae.value - 3
|
|
651
786
|
}, null, 8, ["size"])
|
|
652
787
|
], !0)
|
|
653
|
-
], 8,
|
|
788
|
+
], 8, gl)) : E("", !0)
|
|
654
789
|
], !0)
|
|
655
790
|
]))), 128)),
|
|
656
|
-
|
|
791
|
+
Se.value.length ? (v(), h("span", {
|
|
657
792
|
key: 0,
|
|
658
793
|
class: "hys-ui-select-tag hys-ui-select-more",
|
|
659
|
-
title:
|
|
794
|
+
title: Se.value.map((f) => f.label).join("、")
|
|
660
795
|
}, [
|
|
661
|
-
|
|
662
|
-
|
|
796
|
+
T(e.$slots, "max-tag", { omitted: Se.value }, () => [
|
|
797
|
+
_("+" + M(Se.value.length), 1)
|
|
663
798
|
], !0)
|
|
664
|
-
], 8,
|
|
665
|
-
], 64)) : (
|
|
799
|
+
], 8, kl)) : E("", !0)
|
|
800
|
+
], 64)) : (v(), h("span", {
|
|
666
801
|
key: 1,
|
|
667
|
-
class:
|
|
668
|
-
title: (
|
|
669
|
-
},
|
|
802
|
+
class: St(["hys-ui-select-single-label", { "hys-ui-select-placeholder": !B.value.length }]),
|
|
803
|
+
title: (l = B.value[0]) == null ? void 0 : l.label
|
|
804
|
+
}, M(((d = B.value[0]) == null ? void 0 : d.label) ?? r.placeholder), 11, xl))
|
|
670
805
|
];
|
|
671
806
|
}, !0)
|
|
672
807
|
]),
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
open: s(
|
|
676
|
-
loading:
|
|
808
|
+
r.showArrow || D.value ? (v(), h("span", Al, [
|
|
809
|
+
T(e.$slots, "suffix", {
|
|
810
|
+
open: s(y),
|
|
811
|
+
loading: D.value
|
|
677
812
|
}, () => [
|
|
678
|
-
|
|
813
|
+
D.value ? (v(), Xe(s(ol), {
|
|
679
814
|
key: 0,
|
|
680
815
|
class: "hys-ui-icon-spin",
|
|
681
|
-
size:
|
|
682
|
-
}, null, 8, ["size"])) : (
|
|
816
|
+
size: ae.value
|
|
817
|
+
}, null, 8, ["size"])) : (v(), Xe(s(il), {
|
|
683
818
|
key: 1,
|
|
684
819
|
class: "hys-ui-select-chevron",
|
|
685
|
-
size:
|
|
820
|
+
size: ae.value,
|
|
686
821
|
"aria-hidden": "true"
|
|
687
822
|
}, null, 8, ["size"]))
|
|
688
823
|
], !0)
|
|
689
|
-
])) :
|
|
690
|
-
], 16,
|
|
691
|
-
|
|
824
|
+
])) : E("", !0)
|
|
825
|
+
], 16, yl),
|
|
826
|
+
r.clearable && g.value.length && !s(b) && !r.readonly ? (v(), h("button", {
|
|
692
827
|
key: 0,
|
|
693
828
|
type: "button",
|
|
694
829
|
class: "hys-ui-select-clear",
|
|
695
830
|
"aria-label": "清空选择",
|
|
696
|
-
onClick:
|
|
831
|
+
onClick: Ee(qt, ["stop"])
|
|
697
832
|
}, [
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
size:
|
|
833
|
+
T(e.$slots, "clear-icon", {}, () => [
|
|
834
|
+
ye(s(Tt), {
|
|
835
|
+
size: ae.value - 2
|
|
701
836
|
}, null, 8, ["size"])
|
|
702
837
|
], !0)
|
|
703
|
-
])) :
|
|
704
|
-
|
|
705
|
-
key:
|
|
838
|
+
])) : E("", !0),
|
|
839
|
+
r.name ? (v(!0), h(ie, { key: 1 }, Ye(g.value, (l, d) => (v(), h("input", {
|
|
840
|
+
key: d,
|
|
706
841
|
type: "hidden",
|
|
707
|
-
name:
|
|
708
|
-
value: String(typeof
|
|
709
|
-
disabled: s(
|
|
710
|
-
}, null, 8,
|
|
711
|
-
(
|
|
712
|
-
to:
|
|
713
|
-
disabled:
|
|
842
|
+
name: r.name,
|
|
843
|
+
value: String(typeof l == "object" ? s(cl)(l, r.valueKey) ?? "" : l),
|
|
844
|
+
disabled: s(b)
|
|
845
|
+
}, null, 8, Sl))), 128)) : E("", !0),
|
|
846
|
+
(v(), Xe(tl, {
|
|
847
|
+
to: r.appendTo === !1 ? "body" : r.appendTo,
|
|
848
|
+
disabled: r.appendTo === !1
|
|
714
849
|
}, [
|
|
715
|
-
s(
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
},
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
},
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
error: ie.value,
|
|
771
|
-
retry: We
|
|
772
|
-
}, () => [
|
|
773
|
-
a[3] || (a[3] = J("加载失败,", -1)),
|
|
774
|
-
U("button", {
|
|
850
|
+
ye(s(al), {
|
|
851
|
+
"popup-transition": a.popupTransition,
|
|
852
|
+
"popup-transition-duration": a.popupTransitionDuration,
|
|
853
|
+
placement: s(st)
|
|
854
|
+
}, {
|
|
855
|
+
default: ll(() => [
|
|
856
|
+
s(y) ? (v(), h("div", Qe({
|
|
857
|
+
key: 0,
|
|
858
|
+
ref_key: "panel",
|
|
859
|
+
ref: C
|
|
860
|
+
}, s(Ge), {
|
|
861
|
+
class: ["hys-ui-select-options hys-ui-floating-surface", ["hys-ui-select-popup-" + s(F), r.popupClass]],
|
|
862
|
+
"data-size": s(F),
|
|
863
|
+
"data-placement": s(st),
|
|
864
|
+
style: It.value,
|
|
865
|
+
onKeydown: gt,
|
|
866
|
+
onFocusin: kt,
|
|
867
|
+
onFocusout: xt
|
|
868
|
+
}), [
|
|
869
|
+
e.$slots.header ? (v(), h("div", Cl, [
|
|
870
|
+
T(e.$slots, "header", {
|
|
871
|
+
query: k.value,
|
|
872
|
+
selected: B.value,
|
|
873
|
+
close: () => s(w)()
|
|
874
|
+
}, void 0, !0)
|
|
875
|
+
])) : E("", !0),
|
|
876
|
+
ne.value ? (v(), h("input", {
|
|
877
|
+
key: 1,
|
|
878
|
+
ref_key: "searchInput",
|
|
879
|
+
ref: ee,
|
|
880
|
+
value: ke.value,
|
|
881
|
+
class: "hys-ui-select-search",
|
|
882
|
+
placeholder: "搜索选项…",
|
|
883
|
+
"aria-label": "搜索选项",
|
|
884
|
+
"aria-controls": s(ue),
|
|
885
|
+
"aria-activedescendant": nt.value,
|
|
886
|
+
"aria-autocomplete": "list",
|
|
887
|
+
onInput: bt,
|
|
888
|
+
onCompositionstart: t[2] || (t[2] = (l) => xe.value = !0),
|
|
889
|
+
onCompositionend: Rt
|
|
890
|
+
}, null, 40, wl)) : E("", !0),
|
|
891
|
+
we.value ? (v(), h("div", Ml, [
|
|
892
|
+
$("span", {
|
|
893
|
+
class: "hys-ui-select-bulk-count",
|
|
894
|
+
"aria-live": "polite",
|
|
895
|
+
title: r.selectAllScope === "filtered" ? "批量操作仅作用于当前结果;禁用项保持不变" : "批量操作所有已加载选项;禁用项保持不变"
|
|
896
|
+
}, M(r.selectAllScope === "filtered" && k.value ? "当前结果 · " : "") + "已选 " + M(g.value.length) + M(r.multipleLimit > 0 ? " / " + r.multipleLimit : ""), 9, Bl),
|
|
897
|
+
$("button", {
|
|
898
|
+
type: "button",
|
|
899
|
+
class: "hys-ui-select-bulk-action",
|
|
900
|
+
disabled: Me.value || !zt.value || Te.value,
|
|
901
|
+
"aria-label": r.selectAllText + (r.selectAllScope === "filtered" ? "当前结果" : "全部选项"),
|
|
902
|
+
onClick: dt
|
|
903
|
+
}, M(r.selectAllText), 9, Vl),
|
|
904
|
+
$("button", {
|
|
775
905
|
type: "button",
|
|
776
|
-
class: "hys-ui-select-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
style:
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
left: 0,
|
|
796
|
-
right: 0,
|
|
797
|
-
transform: "translateY(" + Ee.value * E.value + "px)"
|
|
798
|
-
} : void 0
|
|
799
|
-
),
|
|
800
|
-
role: "presentation"
|
|
906
|
+
class: "hys-ui-select-bulk-action",
|
|
907
|
+
disabled: Me.value || !ot.value.length,
|
|
908
|
+
"aria-label": r.deselectAllText + (r.selectAllScope === "filtered" ? "当前结果" : "全部选项"),
|
|
909
|
+
onClick: vt
|
|
910
|
+
}, M(r.deselectAllText), 9, Ll)
|
|
911
|
+
])) : E("", !0),
|
|
912
|
+
$("div", {
|
|
913
|
+
id: s(ue),
|
|
914
|
+
ref_key: "viewport",
|
|
915
|
+
ref: H,
|
|
916
|
+
role: "listbox",
|
|
917
|
+
"aria-label": r.ariaLabel || s(Je) || "可选项",
|
|
918
|
+
"aria-multiselectable": O.value || void 0,
|
|
919
|
+
"aria-busy": D.value || void 0,
|
|
920
|
+
class: "hys-ui-select-list",
|
|
921
|
+
style: me({
|
|
922
|
+
maxHeight: "min(" + se.value + "px, 45dvh)"
|
|
923
|
+
}),
|
|
924
|
+
onScroll: Pt
|
|
801
925
|
}, [
|
|
802
|
-
|
|
803
|
-
|
|
926
|
+
D.value ? (v(), h("p", zl, [
|
|
927
|
+
T(e.$slots, "loading", {}, () => [
|
|
928
|
+
_(M(r.loadingText), 1)
|
|
929
|
+
], !0)
|
|
930
|
+
])) : te.value ? (v(), h("div", $l, [
|
|
931
|
+
T(e.$slots, "error", {
|
|
932
|
+
error: te.value,
|
|
933
|
+
retry: Ne
|
|
934
|
+
}, () => [
|
|
935
|
+
t[3] || (t[3] = _("加载失败,", -1)),
|
|
936
|
+
$("button", {
|
|
937
|
+
type: "button",
|
|
938
|
+
class: "hys-ui-select-retry",
|
|
939
|
+
onClick: Ne
|
|
940
|
+
}, " 重试 ")
|
|
941
|
+
], !0)
|
|
942
|
+
])) : S.value.length ? (v(), h("div", {
|
|
943
|
+
key: 2,
|
|
944
|
+
style: me(
|
|
945
|
+
I.value ? {
|
|
946
|
+
height: S.value.length * R.value + "px",
|
|
947
|
+
position: "relative"
|
|
948
|
+
} : void 0
|
|
949
|
+
),
|
|
950
|
+
role: "presentation"
|
|
804
951
|
}, [
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
s(n)(t.option.value)
|
|
814
|
-
),
|
|
815
|
-
"hys-ui-active": S.value === t.key && !X(t.option),
|
|
816
|
-
"hys-ui-select-created": t.created
|
|
817
|
-
}]),
|
|
818
|
-
style: he(
|
|
819
|
-
O.value ? {
|
|
820
|
-
height: "calc(var(--hys-ui-select-stride) - var(--hys-ui-select-option-gap))",
|
|
821
|
-
minHeight: 0
|
|
952
|
+
$("div", {
|
|
953
|
+
style: me(
|
|
954
|
+
I.value ? {
|
|
955
|
+
position: "absolute",
|
|
956
|
+
top: 0,
|
|
957
|
+
left: 0,
|
|
958
|
+
right: 0,
|
|
959
|
+
transform: "translateY(" + qe.value * R.value + "px)"
|
|
822
960
|
} : void 0
|
|
823
961
|
),
|
|
824
|
-
"data-active": S.value === t.key,
|
|
825
|
-
"aria-label": t.created ? "创建 " + t.option.label : t.option.label,
|
|
826
|
-
"aria-description": t.group,
|
|
827
|
-
"aria-selected": W.value.has(s(n)(t.option.value)),
|
|
828
|
-
"aria-setsize": ma.value,
|
|
829
|
-
"aria-posinset": t.index + 1,
|
|
830
|
-
disabled: X(t.option),
|
|
831
|
-
onPointerenter: (y) => !X(t.option) && (S.value = t.key),
|
|
832
|
-
onClick: (y) => la(t)
|
|
833
|
-
}, [
|
|
834
|
-
U("span", {
|
|
835
|
-
class: "hys-ui-select-option-label",
|
|
836
|
-
title: t.option.label
|
|
837
|
-
}, [
|
|
838
|
-
x(e.$slots, "option", {
|
|
839
|
-
option: t.option,
|
|
840
|
-
selected: W.value.has(s(n)(t.option.value)),
|
|
841
|
-
created: !!t.created
|
|
842
|
-
}, () => [
|
|
843
|
-
t.created ? (c(), v("span", pt, [
|
|
844
|
-
Oe(s(Ra), { size: ee.value }, null, 8, ["size"]),
|
|
845
|
-
J("创建 " + Q(t.option.label), 1)
|
|
846
|
-
])) : (c(), v(le, { key: 1 }, [
|
|
847
|
-
J(Q(t.option.label), 1)
|
|
848
|
-
], 64))
|
|
849
|
-
], !0)
|
|
850
|
-
], 8, ft),
|
|
851
|
-
d.showCheckmark && W.value.has(s(n)(t.option.value)) ? x(e.$slots, "selected-icon", {
|
|
852
|
-
option: t.option
|
|
853
|
-
}, () => [
|
|
854
|
-
Oe(s(Da), {
|
|
855
|
-
size: ee.value - 1,
|
|
856
|
-
"aria-hidden": "true"
|
|
857
|
-
}, null, 8, ["size"])
|
|
858
|
-
], !0, 0) : L("", !0)
|
|
859
|
-
], 46, vt)) : (c(), v("div", {
|
|
860
|
-
key: 0,
|
|
861
|
-
class: "hys-ui-select-group",
|
|
862
|
-
style: he(
|
|
863
|
-
O.value ? { height: E.value + "px" } : void 0
|
|
864
|
-
),
|
|
865
962
|
role: "presentation"
|
|
866
963
|
}, [
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
},
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
964
|
+
(v(!0), h(ie, null, Ye(ut.value, (l) => (v(), h(ie, {
|
|
965
|
+
key: l.key
|
|
966
|
+
}, [
|
|
967
|
+
l.option ? (v(), h("button", {
|
|
968
|
+
key: 1,
|
|
969
|
+
id: s(ue) + "-" + l.index,
|
|
970
|
+
type: "button",
|
|
971
|
+
role: "option",
|
|
972
|
+
tabindex: "-1",
|
|
973
|
+
class: St(["hys-ui-select-option", {
|
|
974
|
+
"hys-ui-selected": j.value.has(
|
|
975
|
+
s(n)(l.option.value)
|
|
976
|
+
),
|
|
977
|
+
"hys-ui-active": V.value === l.key && !J(l.option),
|
|
978
|
+
"hys-ui-select-created": l.created
|
|
979
|
+
}]),
|
|
980
|
+
style: me(
|
|
981
|
+
I.value ? {
|
|
982
|
+
height: "calc(var(--hys-ui-select-stride) - var(--hys-ui-select-option-gap))",
|
|
983
|
+
minHeight: 0
|
|
984
|
+
} : void 0
|
|
985
|
+
),
|
|
986
|
+
"data-active": V.value === l.key,
|
|
987
|
+
"aria-label": l.created ? "创建 " + l.option.label : l.option.label,
|
|
988
|
+
"aria-description": l.group,
|
|
989
|
+
"aria-selected": j.value.has(s(n)(l.option.value)),
|
|
990
|
+
"aria-setsize": $t.value,
|
|
991
|
+
"aria-posinset": l.index + 1,
|
|
992
|
+
disabled: J(l.option),
|
|
993
|
+
onPointerenter: (d) => !J(l.option) && (V.value = l.key),
|
|
994
|
+
onClick: (d) => yt(l)
|
|
995
|
+
}, [
|
|
996
|
+
$("span", {
|
|
997
|
+
class: "hys-ui-select-option-label",
|
|
998
|
+
title: l.option.label
|
|
999
|
+
}, [
|
|
1000
|
+
T(e.$slots, "option", {
|
|
1001
|
+
option: l.option,
|
|
1002
|
+
selected: j.value.has(s(n)(l.option.value)),
|
|
1003
|
+
created: !!l.created
|
|
1004
|
+
}, () => [
|
|
1005
|
+
l.created ? (v(), h("span", Hl, [
|
|
1006
|
+
ye(s(ul), { size: ae.value }, null, 8, ["size"]),
|
|
1007
|
+
_("创建 " + M(l.option.label), 1)
|
|
1008
|
+
])) : (v(), h(ie, { key: 1 }, [
|
|
1009
|
+
_(M(l.option.label), 1)
|
|
1010
|
+
], 64))
|
|
1011
|
+
], !0)
|
|
1012
|
+
], 8, Fl),
|
|
1013
|
+
r.showCheckmark && j.value.has(s(n)(l.option.value)) ? T(e.$slots, "selected-icon", {
|
|
1014
|
+
option: l.option
|
|
1015
|
+
}, () => [
|
|
1016
|
+
ye(s(nl), {
|
|
1017
|
+
size: ae.value - 1,
|
|
1018
|
+
"aria-hidden": "true"
|
|
1019
|
+
}, null, 8, ["size"])
|
|
1020
|
+
], !0, 0) : E("", !0)
|
|
1021
|
+
], 46, El)) : (v(), h("div", {
|
|
1022
|
+
key: 0,
|
|
1023
|
+
class: "hys-ui-select-group",
|
|
1024
|
+
style: me(
|
|
1025
|
+
I.value ? { height: R.value + "px" } : void 0
|
|
1026
|
+
),
|
|
1027
|
+
role: "presentation"
|
|
1028
|
+
}, [
|
|
1029
|
+
T(e.$slots, "group", {
|
|
1030
|
+
label: l.group
|
|
1031
|
+
}, () => [
|
|
1032
|
+
_(M(l.group), 1)
|
|
1033
|
+
], !0)
|
|
1034
|
+
], 4))
|
|
1035
|
+
], 64))), 128))
|
|
1036
|
+
], 4)
|
|
1037
|
+
], 4)) : (v(), h("p", jl, [
|
|
1038
|
+
T(e.$slots, "empty", { query: k.value }, () => [
|
|
1039
|
+
_(M(k.value ? r.noMatchText : r.emptyText), 1)
|
|
1040
|
+
], !0)
|
|
1041
|
+
]))
|
|
1042
|
+
], 44, Ol),
|
|
1043
|
+
e.$slots.footer ? (v(), h("div", Il, [
|
|
1044
|
+
T(e.$slots, "footer", {
|
|
1045
|
+
query: k.value,
|
|
1046
|
+
selected: B.value,
|
|
1047
|
+
close: () => s(w)()
|
|
1048
|
+
}, void 0, !0)
|
|
1049
|
+
])) : E("", !0)
|
|
1050
|
+
], 16, Tl)) : E("", !0)
|
|
1051
|
+
]),
|
|
1052
|
+
_: 3
|
|
1053
|
+
}, 8, ["popup-transition", "popup-transition-duration", "placement"])
|
|
889
1054
|
], 8, ["to", "disabled"]))
|
|
890
1055
|
], 16);
|
|
891
1056
|
};
|
|
892
1057
|
}
|
|
893
1058
|
});
|
|
894
1059
|
export {
|
|
895
|
-
|
|
1060
|
+
Ul as default
|
|
896
1061
|
};
|