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.
Files changed (261) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +68 -59
  3. package/dist/components/HysAlert/HysAlert.vue.js +5 -54
  4. package/dist/components/HysAlert/HysAlert2.vue.js +159 -2
  5. package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +5 -41
  6. package/dist/components/HysAnimatedNumber/HysAnimatedNumber2.vue.js +146 -2
  7. package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +2 -2
  8. package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +285 -273
  9. package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +1 -1
  10. package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +102 -98
  11. package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +1 -1
  12. package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +273 -59
  13. package/dist/components/HysButton/HysButton.vue.js +2 -2
  14. package/dist/components/HysButton/HysButton2.vue.js +227 -60
  15. package/dist/components/HysButtonGroup/HysButtonGroup.vue.js +7 -0
  16. package/dist/components/HysButtonGroup/HysButtonGroup2.vue.js +51 -0
  17. package/dist/components/HysCalendar/HysCalendar.vue.js +3 -3
  18. package/dist/components/HysCalendar/HysCalendar2.vue.js +237 -225
  19. package/dist/components/HysCascader/HysCascader.vue.js +2 -2
  20. package/dist/components/HysCascader/HysCascader2.vue.js +337 -324
  21. package/dist/components/HysColorPicker/HysColorPanel.vue.js +7 -0
  22. package/dist/components/HysColorPicker/HysColorPanel2.vue.js +238 -0
  23. package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
  24. package/dist/components/HysColorPicker/HysColorPicker2.vue.js +239 -217
  25. package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +90 -76
  26. package/dist/components/HysContextMenu/HysContextMenu.vue.js +5 -89
  27. package/dist/components/HysContextMenu/HysContextMenu2.vue.js +247 -2
  28. package/dist/components/HysContextMenu/HysMenuPanel.vue.js +7 -0
  29. package/dist/components/HysContextMenu/HysMenuPanel2.vue.js +208 -0
  30. package/dist/components/HysContextMenu/HysMenuSlot.js +10 -0
  31. package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
  32. package/dist/components/HysDataGrid/HysDataGrid2.vue.js +1008 -559
  33. package/dist/components/HysDatePicker/HysDatePicker.vue.js +2 -0
  34. package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +2 -2
  35. package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +539 -526
  36. package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +5 -3
  37. package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
  38. package/dist/components/HysDrawer/HysDrawer2.vue.js +434 -84
  39. package/dist/components/HysEmpty/HysEmpty.vue.js +5 -41
  40. package/dist/components/HysEmpty/HysEmpty2.vue.js +181 -2
  41. package/dist/components/HysFormItem/HysFormItem.vue.js +2 -2
  42. package/dist/components/HysFormItem/HysFormItem2.vue.js +171 -164
  43. package/dist/components/HysGantt/HysGantt.vue.js +1 -1
  44. package/dist/components/HysGantt/HysGantt2.vue.js +810 -795
  45. package/dist/components/HysMention/HysMention.vue.js +1 -1
  46. package/dist/components/HysMention/HysMention2.vue.js +1092 -142
  47. package/dist/components/HysModal/HysModal.vue.js +2 -2
  48. package/dist/components/HysModal/HysModal2.vue.js +491 -85
  49. package/dist/components/HysPagination/HysPagination.vue.js +2 -2
  50. package/dist/components/HysPagination/HysPagination2.vue.js +243 -180
  51. package/dist/components/HysPopover/HysPopover.vue.js +5 -91
  52. package/dist/components/HysPopover/HysPopover2.vue.js +120 -2
  53. package/dist/components/HysProgress/HysProgress.vue.js +2 -2
  54. package/dist/components/HysProgress/HysProgress2.vue.js +319 -52
  55. package/dist/components/HysSearch/HysSearch.vue.js +5 -82
  56. package/dist/components/HysSearch/HysSearch2.vue.js +176 -2
  57. package/dist/components/HysSelect/HysSelect.vue.js +2 -2
  58. package/dist/components/HysSelect/HysSelect2.vue.js +755 -590
  59. package/dist/components/HysSlider/HysSlider.vue.js +2 -2
  60. package/dist/components/HysSlider/HysSlider2.vue.js +192 -188
  61. package/dist/components/HysSlider/SliderTooltip.vue.js +2 -2
  62. package/dist/components/HysSlider/SliderTooltip2.vue.js +103 -89
  63. package/dist/components/HysSplitPane/HysSplitPane.vue.js +315 -58
  64. package/dist/components/HysSplitPane/HysSplitPane3.vue.js +5 -0
  65. package/dist/components/HysTable/HysTable.vue.js +2 -2
  66. package/dist/components/HysTable/HysTable2.vue.js +1416 -1127
  67. package/dist/components/HysTagInput/HysTagInput.vue.js +5 -82
  68. package/dist/components/HysTagInput/HysTagInput2.vue.js +396 -2
  69. package/dist/components/HysTimeline/HysTimeline.vue.js +2 -2
  70. package/dist/components/HysTimeline/HysTimeline2.vue.js +243 -24
  71. package/dist/components/HysTooltip/HysTooltip.vue.js +5 -64
  72. package/dist/components/HysTooltip/HysTooltip2.vue.js +110 -2
  73. package/dist/components/HysTour/HysTour.vue.js +291 -63
  74. package/dist/components/HysTour/HysTour3.vue.js +5 -0
  75. package/dist/components/HysTransfer/HysTransfer.vue.js +2 -2
  76. package/dist/components/HysTransfer/HysTransfer2.vue.js +237 -207
  77. package/dist/components/HysTransfer/HysTransferPanel.vue.js +1 -1
  78. package/dist/components/HysTransfer/HysTransferPanel2.vue.js +320 -271
  79. package/dist/components/HysTree/HysTree.vue.js +2 -2
  80. package/dist/components/HysTree/HysTree2.vue.js +195 -184
  81. package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +4 -4
  82. package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +389 -377
  83. package/dist/components/HysUpload/HysUpload.vue.js +2 -2
  84. package/dist/components/HysUpload/HysUpload2.vue.js +459 -125
  85. package/dist/components/HysVirtualTable/HysVirtualTable.vue.js +5 -94
  86. package/dist/components/HysVirtualTable/HysVirtualTable2.vue.js +656 -2
  87. package/dist/composables/buttonGroup.js +12 -0
  88. package/dist/composables/color.js +97 -0
  89. package/dist/composables/dataGrid.js +68 -0
  90. package/dist/composables/drawer.js +17 -0
  91. package/dist/composables/feedback.js +14 -0
  92. package/dist/composables/floatingPosition.js +18 -0
  93. package/dist/composables/mentionDocument.js +79 -0
  94. package/dist/composables/mentionEditor.js +58 -0
  95. package/dist/composables/menu.js +96 -0
  96. package/dist/composables/modal.js +14 -0
  97. package/dist/composables/overlayManager.js +48 -18
  98. package/dist/composables/progress.js +94 -0
  99. package/dist/composables/selectOptions.js +44 -38
  100. package/dist/composables/splitPaneSizes.js +58 -0
  101. package/dist/composables/table.js +128 -105
  102. package/dist/composables/tagInput.js +16 -0
  103. package/dist/composables/timeline.js +19 -0
  104. package/dist/composables/transfer.js +19 -17
  105. package/dist/composables/upload.js +55 -0
  106. package/dist/composables/uploadRequest.js +58 -0
  107. package/dist/composables/useAlert.js +124 -0
  108. package/dist/composables/useColorPicker.js +402 -0
  109. package/dist/composables/useContextMenu.js +514 -0
  110. package/dist/composables/useDataGridRemote.js +67 -0
  111. package/dist/composables/useDialog.js +86 -43
  112. package/dist/composables/useDrawerPush.js +33 -0
  113. package/dist/composables/useDrawerResize.js +221 -0
  114. package/dist/composables/useFloating.js +118 -80
  115. package/dist/composables/useHysModal.js +185 -0
  116. package/dist/composables/useMentionCaret.js +81 -0
  117. package/dist/composables/useMentionList.js +81 -0
  118. package/dist/composables/useMentionModel.js +90 -0
  119. package/dist/composables/useMentionOptions.js +421 -0
  120. package/dist/composables/useModal.js +295 -0
  121. package/dist/composables/useModalInteraction.js +394 -0
  122. package/dist/composables/usePopupSurface.js +458 -0
  123. package/dist/composables/useSplitPaneDrag.js +52 -0
  124. package/dist/composables/useSplitPaneStorage.js +38 -0
  125. package/dist/composables/useTable.js +344 -312
  126. package/dist/composables/useTableSticky.js +79 -0
  127. package/dist/composables/useTagInput.js +313 -0
  128. package/dist/composables/useTourLayout.js +129 -0
  129. package/dist/composables/useTransferMotion.js +185 -0
  130. package/dist/composables/useUpload.js +472 -0
  131. package/dist/composables/useUploadModel.js +65 -0
  132. package/dist/composables/useUploadRequests.js +266 -0
  133. package/dist/composables/useVirtualTableLayout.js +277 -0
  134. package/dist/composables/virtualTable.js +43 -0
  135. package/dist/config.js +11 -11
  136. package/dist/index.js +175 -153
  137. package/dist/internal/MultiSplitPane.vue.js +305 -0
  138. package/dist/internal/MultiSplitPane2.vue.js +4 -0
  139. package/dist/internal/PopupReference.js +39 -0
  140. package/dist/internal/PopupSurfacePanel.vue.js +7 -0
  141. package/dist/internal/PopupSurfacePanel2.vue.js +92 -0
  142. package/dist/motion/PopupMotion.js +105 -0
  143. package/dist/motion/popup.js +10 -0
  144. package/dist/style.css +1 -1
  145. package/dist/types/components/HysAlert/HysAlert.vue.d.ts +32 -22
  146. package/dist/types/components/HysAnimatedNumber/HysAnimatedNumber.vue.d.ts +61 -7
  147. package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +7 -7
  148. package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +6 -1
  149. package/dist/types/components/HysBadge/HysBadge.vue.d.ts +3 -3
  150. package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +54 -31
  151. package/dist/types/components/HysButton/HysButton.vue.d.ts +82 -22
  152. package/dist/types/components/HysButtonGroup/HysButtonGroup.vue.d.ts +30 -0
  153. package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +3 -2
  154. package/dist/types/components/HysCascader/HysCascader.vue.d.ts +7 -7
  155. package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +2 -2
  156. package/dist/types/components/HysColorPicker/HysColorPanel.vue.d.ts +58 -0
  157. package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +63 -10
  158. package/dist/types/components/HysCommandPalette/HysCommandPalette.vue.d.ts +2 -1
  159. package/dist/types/components/HysContextMenu/HysContextMenu.vue.d.ts +50 -34
  160. package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +79 -0
  161. package/dist/types/components/HysContextMenu/HysMenuSlot.d.ts +8 -0
  162. package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +65 -118
  163. package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +3 -3
  164. package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +92 -35
  165. package/dist/types/components/HysEmpty/HysEmpty.vue.d.ts +24 -20
  166. package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +2 -2
  167. package/dist/types/components/HysGantt/HysGantt.vue.d.ts +2 -1
  168. package/dist/types/components/HysMention/HysMention.vue.d.ts +91 -39
  169. package/dist/types/components/HysModal/HysModal.vue.d.ts +111 -34
  170. package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +2 -2
  171. package/dist/types/components/HysPagination/HysPagination.vue.d.ts +55 -4
  172. package/dist/types/components/HysPopover/HysPopover.vue.d.ts +41 -29
  173. package/dist/types/components/HysProgress/HysProgress.vue.d.ts +18 -24
  174. package/dist/types/components/HysRating/HysRating.vue.d.ts +1 -1
  175. package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +2 -2
  176. package/dist/types/components/HysSearch/HysSearch.vue.d.ts +45 -7
  177. package/dist/types/components/HysSelect/HysSelect.vue.d.ts +19 -5
  178. package/dist/types/components/HysSlider/HysSlider.vue.d.ts +5 -4
  179. package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +3 -1
  180. package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +125 -14
  181. package/dist/types/components/HysSteps/HysSteps.vue.d.ts +1 -1
  182. package/dist/types/components/HysTable/HysTable.vue.d.ts +1742 -5
  183. package/dist/types/components/HysTabs/HysTabs.vue.d.ts +2 -2
  184. package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +47 -25
  185. package/dist/types/components/HysTimeline/HysTimeline.vue.d.ts +19 -32
  186. package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +39 -19
  187. package/dist/types/components/HysTour/HysTour.vue.d.ts +46 -8
  188. package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +2 -2
  189. package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +5 -3
  190. package/dist/types/components/HysTree/HysTree.vue.d.ts +2 -2
  191. package/dist/types/components/HysUpload/HysUpload.vue.d.ts +55 -67
  192. package/dist/types/components/HysVirtualTable/HysVirtualTable.vue.d.ts +71 -40
  193. package/dist/types/composables/autocomplete.d.ts +3 -0
  194. package/dist/types/composables/avatar.d.ts +3 -0
  195. package/dist/types/composables/buttonGroup.d.ts +9 -0
  196. package/dist/types/composables/cascader.d.ts +3 -0
  197. package/dist/types/composables/color.d.ts +97 -0
  198. package/dist/types/composables/dataGrid.d.ts +100 -0
  199. package/dist/types/composables/datePicker.d.ts +3 -0
  200. package/dist/types/composables/drawer.d.ts +102 -0
  201. package/dist/types/composables/feedback.d.ts +98 -0
  202. package/dist/types/composables/floatingPosition.d.ts +14 -0
  203. package/dist/types/composables/formContext.d.ts +2 -0
  204. package/dist/types/composables/mention.d.ts +284 -0
  205. package/dist/types/composables/mentionDocument.d.ts +15 -0
  206. package/dist/types/composables/mentionEditor.d.ts +7 -0
  207. package/dist/types/composables/menu.d.ts +183 -0
  208. package/dist/types/composables/modal.d.ts +185 -0
  209. package/dist/types/composables/overlayManager.d.ts +7 -3
  210. package/dist/types/composables/popupSurface.d.ts +83 -0
  211. package/dist/types/composables/progress.d.ts +92 -0
  212. package/dist/types/composables/selectOptions.d.ts +7 -0
  213. package/dist/types/composables/splitPaneSizes.d.ts +11 -0
  214. package/dist/types/composables/table.d.ts +119 -6
  215. package/dist/types/composables/tagInput.d.ts +96 -0
  216. package/dist/types/composables/timeline.d.ts +82 -0
  217. package/dist/types/composables/tour.d.ts +68 -0
  218. package/dist/types/composables/transfer.d.ts +7 -0
  219. package/dist/types/composables/tree.d.ts +3 -0
  220. package/dist/types/composables/treeSelect.d.ts +3 -0
  221. package/dist/types/composables/upload.d.ts +202 -0
  222. package/dist/types/composables/uploadRequest.d.ts +3 -0
  223. package/dist/types/composables/useAlert.d.ts +21 -0
  224. package/dist/types/composables/useCascader.d.ts +1 -1
  225. package/dist/types/composables/useColorPicker.d.ts +101 -0
  226. package/dist/types/composables/useContextMenu.d.ts +81 -0
  227. package/dist/types/composables/useDataGridRemote.d.ts +15 -0
  228. package/dist/types/composables/useDialog.d.ts +16 -3
  229. package/dist/types/composables/useDrawerPush.d.ts +6 -0
  230. package/dist/types/composables/useDrawerResize.d.ts +27 -0
  231. package/dist/types/composables/useFloating.d.ts +22 -3
  232. package/dist/types/composables/useHysModal.d.ts +44 -0
  233. package/dist/types/composables/useMentionCaret.d.ts +6 -0
  234. package/dist/types/composables/useMentionList.d.ts +23 -0
  235. package/dist/types/composables/useMentionModel.d.ts +14 -0
  236. package/dist/types/composables/useMentionOptions.d.ts +26 -0
  237. package/dist/types/composables/useModal.d.ts +62 -0
  238. package/dist/types/composables/useModalInteraction.d.ts +27 -0
  239. package/dist/types/composables/usePopupSurface.d.ts +3341 -0
  240. package/dist/types/composables/useSplitPaneDrag.d.ts +14 -0
  241. package/dist/types/composables/useSplitPaneStorage.d.ts +4 -0
  242. package/dist/types/composables/useTable.d.ts +7 -3
  243. package/dist/types/composables/useTableSticky.d.ts +22 -0
  244. package/dist/types/composables/useTagInput.d.ts +66 -0
  245. package/dist/types/composables/useTourLayout.d.ts +33 -0
  246. package/dist/types/composables/useTransferMotion.d.ts +36 -0
  247. package/dist/types/composables/useUpload.d.ts +94 -0
  248. package/dist/types/composables/useUploadModel.d.ts +14 -0
  249. package/dist/types/composables/useUploadRequests.d.ts +38 -0
  250. package/dist/types/composables/useVirtualTableLayout.d.ts +51 -0
  251. package/dist/types/composables/virtualTable.d.ts +126 -0
  252. package/dist/types/config.d.ts +1 -0
  253. package/dist/types/index.d.ts +53 -3
  254. package/dist/types/internal/MultiSplitPane.vue.d.ts +54 -0
  255. package/dist/types/internal/PopupReference.d.ts +18 -0
  256. package/dist/types/internal/PopupSurfacePanel.vue.d.ts +37 -0
  257. package/dist/types/motion/PopupMotion.d.ts +59 -0
  258. package/dist/types/motion/popup.d.ts +12 -0
  259. package/package.json +3 -2
  260. package/dist/components/HysSplitPane/HysSplitPane2.vue.js +0 -4
  261. package/dist/components/HysTour/HysTour2.vue.js +0 -4
@@ -1,36 +1,44 @@
1
- import { defineComponent as Va, useAttrs as za, inject as La, ref as w, useId as $a, shallowRef as pe, computed as r, watch as I, nextTick as z, onMounted as Ea, onUpdated as Fa, onActivated as Ha, onDeactivated as ja, onBeforeUnmount as Wa, openBlock as c, createElementBlock as v, mergeProps as qe, unref as s, createElementVNode as U, withModifiers as Ae, renderSlot as x, Fragment as le, renderList as Pe, toDisplayString as Q, createVNode as Oe, createCommentVNode as L, createTextVNode as J, normalizeClass as va, createBlock as Re, Teleport as Ka, normalizeStyle as he } from "vue";
2
- import { X as fa, LoaderCircle as qa, ChevronDown as Pa, Plus as Ra, Check as Da } from "lucide-vue-next";
3
- import { fieldKey as Na, useHysControlState as Ia, formValue as Ua } from "../../composables/formContext.js";
4
- import { useHysRootAttrs as Qa } from "../../config.js";
5
- import { useFloating as Ya } from "../../composables/useFloating.js";
6
- import { normalizeSelectOptions as Xa, selectKeyFactory as Ga } from "../../composables/selectOptions.js";
7
- const Ja = ["disabled"], Za = ["id", "tabindex", "aria-label", "aria-expanded", "aria-disabled", "aria-readonly", "aria-required", "aria-invalid", "aria-describedby", "aria-controls", "aria-activedescendant"], _a = { class: "hys-ui-select-label" }, et = ["title"], at = ["disabled", "aria-label", "onClick"], tt = ["title"], lt = ["title"], ot = {
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
- }, it = ["name", "value", "disabled"], ut = ["data-size", "data-placement"], st = {
11
+ }, Sl = ["name", "value", "disabled"], Tl = ["data-size", "data-placement"], Cl = {
11
12
  key: 0,
12
13
  class: "hys-ui-select-header"
13
- }, nt = ["value", "aria-controls", "aria-activedescendant"], rt = ["id", "aria-label", "aria-multiselectable", "aria-busy"], ct = {
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
- }, dt = {
23
+ }, $l = {
18
24
  key: 1,
19
25
  class: "hys-ui-floating-empty",
20
26
  role: "status"
21
- }, vt = ["id", "data-active", "aria-label", "aria-description", "aria-selected", "aria-setsize", "aria-posinset", "disabled", "onPointerenter", "onClick"], ft = ["title"], pt = {
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
- }, ht = {
30
+ }, jl = {
25
31
  key: 3,
26
32
  class: "hys-ui-floating-empty"
27
- }, yt = {
28
- key: 2,
33
+ }, Il = {
34
+ key: 3,
29
35
  class: "hys-ui-select-footer"
30
- }, Ct = /* @__PURE__ */ Va({
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(d, { expose: pa, emit: ha }) {
94
- const l = d, f = ha, ya = za(), De = Qa(), $ = La(Na, void 0), {
95
- disabled: m,
96
- size: B,
97
- label: Ne
98
- } = Ia(l), b = w(), H = w(), A = w(), Z = w(), oe = $a(), Ve = w("");
99
- function Ie() {
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 = b.value) == null ? void 0 : o.closest("label");
115
+ const e = (o = m.value) == null ? void 0 : o.closest("label");
102
116
  if (!e) {
103
- Ve.value = "";
117
+ Fe.value = "";
104
118
  return;
105
119
  }
106
- const a = e.cloneNode(!0);
107
- a.querySelectorAll(".hys-ui-select-wrap").forEach((i) => i.remove()), Ve.value = (a.textContent ?? "").replace(/\s+/g, " ").trim();
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 Ue = pe(l.defaultValue ?? null), _ = r(
110
- () => l.modelValue !== void 0 ? l.modelValue : Ue.value
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 i = n(o);
115
- return a.has(i) ? !1 : (a.add(i), !0);
132
+ const u = n(o);
133
+ return t.has(u) ? !1 : (t.add(u), !0);
116
134
  });
117
- }), W = r(() => new Set(g.value.map(n))), K = pe([]), q = pe(/* @__PURE__ */ new Map()), ye = pe(), me = w(!1), ie = pe(), Qe = w(""), be = w(l.searchValue ?? ""), ge = w(!1), k = r(() => l.searchValue ?? Qe.value), ue = r(() => l.filterable || l.allowCreate), Ye = r(
118
- () => Xa(
119
- ye.value ?? l.options,
120
- l.fieldNames,
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
- ), se = r(
124
- () => Ye.value.flatMap((e) => e.option ? [e.option] : [])
147
+ ), le = c(
148
+ () => lt.value.flatMap((e) => e.option ? [e.option] : [])
125
149
  );
126
- I(
127
- [se, g, K],
150
+ X(
151
+ [le, g, q],
128
152
  () => {
129
- const e = q.value, a = /* @__PURE__ */ new Map();
130
- for (const o of [...K.value, ...se.value])
131
- a.set(n(o.value), o);
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 i = n(o);
134
- !a.has(i) && e.has(i) && a.set(i, e.get(i));
157
+ const u = n(o);
158
+ !t.has(u) && e.has(u) && t.set(u, e.get(u));
135
159
  }
136
- q.value = a;
160
+ N.value = t;
137
161
  },
138
162
  { immediate: !0 }
139
163
  );
140
- function Xe(e) {
141
- if (l.fallbackOption !== !1)
142
- return typeof l.fallbackOption == "function" ? l.fallbackOption(e) : {
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[l.valueKey] ?? "未命名选项" : e
169
+ typeof e == "object" ? e.label ?? e.name ?? e[a.valueKey] ?? "未命名选项" : e
146
170
  )
147
171
  };
148
172
  }
149
- const M = r(
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 a = q.value.get(n(e)) ?? Xe(e);
152
- return a ? [a] : [];
179
+ const t = Ae(e);
180
+ return t ? [t] : [];
153
181
  })
154
- ), Ge = r(
155
- () => M.value.slice(
182
+ ), at = c(
183
+ () => B.value.slice(
156
184
  0,
157
- l.maxTagCount === void 0 ? void 0 : Math.max(0, l.maxTagCount)
185
+ a.maxTagCount === void 0 ? void 0 : Math.max(0, a.maxTagCount)
158
186
  )
159
- ), ke = r(
160
- () => M.value.slice(Ge.value.length)
161
- ), P = r(() => l.loading || me.value), ze = r(
162
- () => j.value && l.multipleLimit > 0 && g.value.length >= l.multipleLimit
163
- ), xe = r(
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, a;
166
- return l.status ?? ((e = $ == null ? void 0 : $.invalid) != null && e.value ? "error" : (a = $ == null ? void 0 : $.status) == null ? void 0 : a.value);
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
- ), ee = r(
169
- () => B.value === "sm" ? 14 : B.value === "lg" ? 18 : 16
170
- ), E = r(
196
+ ), ae = c(
197
+ () => F.value === "sm" ? 14 : F.value === "lg" ? 18 : 16
198
+ ), R = c(
171
199
  () => Math.max(
172
200
  24,
173
- l.itemHeight ?? (B.value === "sm" ? 34 : B.value === "lg" ? 50 : 42)
201
+ a.itemHeight ?? (F.value === "sm" ? 34 : F.value === "lg" ? 50 : 42)
174
202
  )
175
- ), Le = r(() => {
203
+ ), Ie = c(() => {
176
204
  const e = k.value.trim();
177
- if (!(!l.allowCreate || !e || [...se.value, ...K.value].some(
178
- (a) => a.label === e || n(a.value) === n(e)
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
- }), T = r(() => {
182
- let e = Ye.value.filter((u) => u.option).concat(
183
- K.value.filter(
184
- (u) => !se.value.some(
185
- (t) => n(t.value) === n(u.value)
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((u) => ({ key: n(u.value), option: u, index: -1 }))
215
+ ).map((i) => ({ key: n(i.value), option: i, index: -1 }))
188
216
  );
189
- !l.remote && !l.remoteMethod && (e = e.filter(
190
- (u) => !k.value || (l.filterMethod ? l.filterMethod(k.value, u.option) : u.option.label.toLocaleLowerCase().includes(k.value.toLocaleLowerCase()))
191
- )), l.filterSort && (e = [...e].sort(
192
- (u, t) => l.filterSort(u.option, t.option)
193
- )), Le.value && (e = [
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(Le.value.value),
196
- option: Le.value,
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 a = [];
203
- let o, i = 0;
204
- for (const u of e)
205
- u.group !== o && (o = u.group, o && a.push({ key: "group:" + o + ":" + i, index: -1, group: o })), a.push({ ...u, index: i++ });
206
- return a;
207
- }), ma = r(
208
- () => T.value.filter((e) => e.option).length
209
- ), S = w(), Te = w(0), $e = w(0), O = r(
210
- () => l.virtual && T.value.length > 100
211
- ), ne = r(
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(l.listHeight) ? l.listHeight : 240)
264
+ Math.max(80, Number.isFinite(a.listHeight) ? a.listHeight : 240)
215
265
  )
216
- ), Je = r(() => Math.max(1, Math.min(30, l.overscan))), Ee = r(
217
- () => O.value ? Math.max(
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, T.value.length - 1),
221
- Math.floor(Te.value / E.value) - Je.value
270
+ Math.max(0, S.value.length - 1),
271
+ Math.floor(Be.value / R.value) - it.value
222
272
  )
223
273
  ) : 0
224
- ), Ze = r(
225
- () => O.value ? T.value.slice(
226
- Ee.value,
227
- Ee.value + Math.ceil(ne.value / E.value) + Je.value * 2
228
- ) : T.value
229
- ), re = r(
230
- () => T.value.find((e) => e.key === S.value)
231
- ), _e = r(
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 !P.value && ((e = re.value) != null && e.option) && (!O.value || Ze.value.some((a) => a.key === S.value)) ? oe + "-" + re.value.index : void 0;
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
- ), ba = r(() => {
286
+ ), Et = c(() => {
237
287
  var o;
238
- if (!O.value || l.popupMatchWidth || l.popupWidth !== void 0)
239
- return l.popupWidth;
240
- const e = B.value === "sm" ? 12 : B.value === "lg" ? 15 : 14;
241
- let a = 0;
242
- for (const i of T.value) {
243
- const u = ((o = i.option) == null ? void 0 : o.label) ?? i.group ?? "";
244
- let t = 0;
245
- for (const y of u) t += y.charCodeAt(0) > 255 ? 1 : 0.58;
246
- a = Math.max(a, t * e);
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($e.value, a + 52);
298
+ return Math.max(We.value, t + 52);
249
299
  });
250
- let R = !0, ce = !1, de = 0, ae, Fe, Y, He = 0, Ce, Me = "";
300
+ let U = !0, ce = !1, de = 0, oe, De, G, Re = 0, Ve, Le = "";
251
301
  const {
252
- open: h,
253
- style: ga,
254
- placement: ka,
255
- show: xa,
256
- close: V,
257
- update: Se,
258
- restoringFocus: Ta
259
- } = Ya(b, H, {
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 l.placement;
311
+ return a.placement;
262
312
  },
263
- matchWidth: () => l.popupMatchWidth ? !0 : "min",
264
- width: () => ba.value,
265
- requestOpen: (e) => (f("update:open", e), l.open === void 0 ? void 0 : !1)
266
- }), Ca = r(() => ({
267
- ...l.popupStyle,
268
- ...ga.value,
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": E.value + "px",
272
- "--hys-ui-select-list-height": ne.value + "px"
273
- })), Ma = () => Object.fromEntries(
274
- Object.entries(ya).filter(([e]) => !["class", "style"].includes(e))
275
- ), X = (e) => !!e.disabled || l.readonly || P.value || m.value || ze.value && !W.value.has(n(e.value));
276
- function ea() {
277
- return T.value.filter((e) => e.option && !X(e.option));
278
- }
279
- function we(e = !1) {
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 a = ea(), o = a.find(
282
- (u) => W.value.has(n(u.option.value))
283
- );
284
- S.value = (i = o ?? (l.defaultActiveFirst ? e ? a.at(-1) : a[0] : void 0)) == null ? void 0 : i.key;
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 G() {
287
- var a, o;
288
- const e = T.value.findIndex(
289
- (i) => i.key === S.value
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 (O.value && A.value) {
293
- const i = e * E.value, u = i + E.value, t = A.value.clientHeight || ne.value;
294
- i < A.value.scrollTop ? A.value.scrollTop = i : u > A.value.scrollTop + t && (A.value.scrollTop = u - t), Te.value = A.value.scrollTop;
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(), O.value || (o = (a = H.value) == null ? void 0 : a.querySelector('[data-active="true"]')) == null || o.scrollIntoView({ block: "nearest" });
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 te(e) {
300
- const a = Array.isArray(e) ? e : e == null || l.emptyValues.some((i) => Object.is(i, e)) ? [] : [e];
301
- if (a.length === g.value.length && a.every((i, u) => n(i) === n(g.value[u])))
302
- return;
303
- l.modelValue === void 0 && (Ue.value = e);
304
- const o = a.flatMap((i) => {
305
- const u = q.value.get(n(i)) ?? Xe(i);
306
- return u ? [u] : [];
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
- f("update:modelValue", e), f("change", e, j.value ? o : o[0]);
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
- be.value = e, l.searchValue === void 0 && (Qe.value = e), f("update:searchValue", e);
436
+ ke.value = e, a.searchValue === void 0 && (tt.value = e), p("update:searchValue", e);
312
437
  }
313
- function aa(e) {
314
- q.value.has(n(e.value)) || (K.value = [...K.value, e], q.value = new Map(q.value).set(
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
- ), f("create", e));
442
+ ), p("create", e));
318
443
  }
319
- function ta(e) {
444
+ function ht(e) {
320
445
  try {
321
- const a = l.createOption ? l.createOption(e) : { label: e, value: e };
322
- return a ? { ...a, label: String(a.label) } : void 0;
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
- f("reject", e, "create");
449
+ p("reject", e, "create");
325
450
  return;
326
451
  }
327
452
  }
328
- async function la(e) {
329
- var u;
330
- if (!(e != null && e.option) || X(e.option)) return;
331
- let a = e.option;
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 t = ta(a.label);
334
- if (!t) return;
335
- if (a = q.value.get(n(t.value)) ?? t, ze.value && !W.value.has(n(a.value))) {
336
- f("reject", a.value, "limit");
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
- aa(a);
464
+ pt(t);
340
465
  }
341
- const o = n(a.value), i = W.value.has(o);
342
- if (j.value) {
343
- if (i)
344
- te(g.value.filter((t) => n(t) !== o)), f("deselect", a.value, a);
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 (ze.value) {
347
- f("reject", a.value, "limit");
471
+ if (Te.value) {
472
+ p("reject", t.value, "limit");
348
473
  return;
349
474
  }
350
- te([...g.value, a.value]), f("select", a.value, a);
475
+ Q([...g.value, t.value]), p("select", t.value, t);
351
476
  }
352
- l.clearSearchAfterSelect && ve(""), await z(), h.value && ue.value && ((u = Z.value) == null || u.focus());
477
+ a.clearSearchAfterSelect && ve(""), await z(), y.value && ne.value && ((i = ee.value) == null || i.focus());
353
478
  } else
354
- te(a.value), f("select", a.value, a), V(!0);
479
+ Q(t.value), p("select", t.value, t), w(!0);
355
480
  }
356
- function je(e) {
357
- var a;
358
- m.value || l.readonly || e.disabled || !l.removable || (te(g.value.filter((o) => n(o) !== n(e.value))), f("removeTag", e.value, e), f("deselect", e.value, e), (a = b.value) == null || a.focus());
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 Sa() {
361
- var e, a;
362
- m.value || l.readonly || (fe(), te(j.value ? [] : l.clearValue), l.clearCreatedOnClear && (K.value = []), ve(""), f("clear"), h.value && ue.value ? (e = Z.value) == null || e.focus() : (a = b.value) == null || a.focus());
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 F(e = !1, a = !1) {
489
+ async function P(e = !1, t = !1) {
365
490
  var o;
366
- !R || m.value || (!l.retainSearch && !l.searchValue && ve(""), we(e), await xa(a), await z(), h.value && (ue.value && ((o = Z.value) == null || o.focus()), await G()));
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 oa() {
369
- h.value ? V() : F();
493
+ function mt() {
494
+ y.value ? w() : P();
370
495
  }
371
496
  function fe() {
372
- de++, clearTimeout(Fe), Fe = void 0, ae == null || ae.abort(), ae = void 0, me.value = !1;
497
+ de++, clearTimeout(De), De = void 0, oe == null || oe.abort(), oe = void 0, ge.value = !1;
373
498
  }
374
- function Be(e, a = !1) {
375
- if (fe(), !l.remoteMethod || !h.value || !R || m.value)
499
+ function $e(e, t = !1) {
500
+ if (fe(), !a.remoteMethod || !y.value || !U || b.value)
376
501
  return;
377
- const o = de, i = new AbortController();
378
- ae = i, me.value = !0, ie.value = void 0;
379
- const u = async () => {
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 t = await l.remoteMethod(e, {
382
- signal: i.signal
506
+ const l = await a.remoteMethod(e, {
507
+ signal: u.signal
383
508
  });
384
- if (!R || i.signal.aborted || o !== de || !h.value)
509
+ if (!U || u.signal.aborted || o !== de || !y.value)
385
510
  return;
386
- Array.isArray(t) && (ye.value = t);
387
- } catch (t) {
388
- if (i.signal.aborted || o !== de || !R) return;
389
- ie.value = t, ye.value = [], f("searchError", t, e);
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 && (me.value = !1, ae = void 0, await z(), h.value && (we(), Se(), G()));
516
+ o === de && (ge.value = !1, oe = void 0, await z(), y.value && (ze(), Oe(), Z()));
392
517
  }
393
518
  };
394
- a || l.debounce <= 0 ? u() : Fe = setTimeout(u, l.debounce);
519
+ t || a.debounce <= 0 ? i() : De = setTimeout(i, a.debounce);
395
520
  }
396
- function We() {
397
- Be(k.value, !0);
521
+ function Ne() {
522
+ $e(k.value, !0);
398
523
  }
399
- function wa(e) {
400
- var p;
401
- if (m.value || l.readonly || P.value || !j.value || !l.allowCreate || !((p = l.tokenSeparators) != null && p.length))
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 a = [e], o = !1;
404
- for (const C of l.tokenSeparators)
405
- C && (a.some((D) => D.includes(C)) && (o = !0), a = a.flatMap((D) => D.split(C)));
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 i = a.pop() ?? "", u = [...g.value], t = new Set(u.map(n));
408
- let y = !1;
409
- for (const C of a.map((D) => D.trim()).filter(Boolean)) {
410
- const D = [...se.value, ...K.value].find(
411
- (da) => da.label === C || n(da.value) === n(C)
412
- ), N = D ?? ta(C);
413
- if (!N) continue;
414
- const ca = n(N.value);
415
- if (!(t.has(ca) || N.disabled)) {
416
- if (l.multipleLimit > 0 && u.length >= l.multipleLimit) {
417
- f("reject", N.value, "limit");
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
- D || aa(N), t.add(ca), u.push(N.value), y = !0, f("select", N.value, N);
545
+ K || pt(A), l.add(Y), i.push(A.value), d = !0, p("select", A.value, A);
421
546
  }
422
547
  }
423
- return y && te(u), ve(i), !0;
548
+ return d && Q(i), ve(u), !0;
424
549
  }
425
- function ia(e) {
426
- if (m.value) return;
427
- const a = e.target.value;
428
- be.value = a, !ge.value && (wa(a) || ve(a));
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 Ba(e) {
431
- ge.value = !1, ia(e);
555
+ function Rt(e) {
556
+ xe.value = !1, bt(e);
432
557
  }
433
- async function ua(e) {
434
- var i, u;
435
- if (m.value || !l.keyboard || e.isComposing || ge.value || e.keyCode === 229 || e.target.closest(
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 a = e.target === Z.value, o = e.target;
440
- if (!(o !== b.value && !a && !o.matches('[role="option"]') && o.closest(
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(), !h.value)
447
- await F(e.key === "ArrowUp" || e.key === "End");
577
+ if (e.preventDefault(), !y.value)
578
+ await P(e.key === "ArrowUp" || e.key === "End");
448
579
  else {
449
- const t = T.value, y = ["ArrowUp", "End", "PageUp"].includes(e.key) ? -1 : 1;
450
- let p = e.key === "Home" ? -1 : e.key === "End" ? t.length : t.findIndex((C) => C.key === S.value);
451
- e.key.startsWith("Page") && (p = Math.max(
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
- t.length,
455
- p + y * (Math.max(1, Math.floor(ne.value / E.value)) - 1)
585
+ l.length,
586
+ f + d * (Math.max(1, Math.floor(se.value / R.value)) - 1)
456
587
  )
457
588
  ));
458
- for (let C = 0; C < t.length; C++)
459
- if (p = (p + y + t.length) % t.length, t[p].option && !X(t[p].option)) {
460
- S.value = t[p].key;
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 G();
465
- } else if (e.key === "Enter" || e.key === " " && !a)
466
- e.preventDefault(), h.value ? await la(re.value) : await F();
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
- V(!!((i = H.value) != null && i.contains(document.activeElement)));
469
- else if (e.key === "Backspace" && j.value && !k.value) {
470
- const t = [...M.value].reverse().find((y) => !y.disabled);
471
- t && l.removable && (e.preventDefault(), je(t), a && (await z(), (u = Z.value) == null || u.focus()));
472
- } else if (!ue.value && e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey) {
473
- Me += e.key.toLocaleLowerCase(), clearTimeout(Ce), Ce = setTimeout(() => {
474
- Me = "";
475
- }, 600), h.value || await F();
476
- const t = ea().find(
477
- (y) => y.option.label.toLocaleLowerCase().startsWith(Me)
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
- t && (S.value = t.key, await G());
610
+ l && (V.value = l.key, await Z());
480
611
  }
481
612
  }
482
613
  }
483
- function sa(e) {
484
- ce || (ce = !0, f("focus", e)), l.showOnFocus && !h.value && !Ta.value && e.target === b.value && F();
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 na(e) {
487
- z(() => {
488
- var o, i;
489
- const a = document.activeElement;
490
- ce && !((o = b.value) != null && o.contains(a)) && !((i = H.value) != null && i.contains(a)) && (ce = !1, f("blur", e));
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 Aa(e) {
494
- const a = e.target;
495
- Te.value = a.scrollTop, f("popupScroll", e), a.scrollTop + a.clientHeight >= a.scrollHeight - 2 && f("reachEnd");
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 Ke() {
498
- Y == null || Y.disconnect(), Y = void 0, cancelAnimationFrame(He);
630
+ function Ue() {
631
+ G == null || G.disconnect(), G = void 0, cancelAnimationFrame(Re);
499
632
  }
500
- function Oa() {
501
- if (Ke(), !h.value || !R) return;
633
+ function Nt() {
634
+ if (Ue(), !y.value || !U) return;
502
635
  const e = () => {
503
- cancelAnimationFrame(He), He = requestAnimationFrame(() => {
504
- var a;
505
- $e.value = ((a = b.value) == null ? void 0 : a.clientWidth) ?? 0, Se();
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" && (Y = new ResizeObserver(e), b.value && Y.observe(b.value), H.value && Y.observe(H.value));
509
- }
510
- I(k, (e) => {
511
- be.value = e, S.value = void 0, Te.value = 0, A.value && (A.value.scrollTop = 0), we(), f("search", e), Be(e), h.value && z(G);
512
- }), I(T, () => {
513
- var a;
514
- const e = !((a = re.value) != null && a.option) || X(re.value.option);
515
- e && we(), h.value && z(() => {
516
- Se(), e && G();
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
- }), I(
651
+ }), X(
519
652
  [
520
653
  g,
521
- B,
522
- () => l.popupMatchWidth,
523
- () => l.popupWidth,
524
- () => l.placement
654
+ F,
655
+ () => a.popupMatchWidth,
656
+ () => a.popupWidth,
657
+ () => a.placement
525
658
  ],
526
659
  () => {
527
- h.value && z(Se);
660
+ y.value && z(Oe);
528
661
  }
529
- ), I(h, (e) => {
530
- var a;
531
- f("visibleChange", e), e ? ($e.value = ((a = b.value) == null ? void 0 : a.clientWidth) ?? 0, z(Oa), Be(k.value)) : (Ke(), fe(), clearTimeout(Ce), Me = "");
532
- }), I(
533
- () => l.open,
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
- R && (e ? F(!1, !0) : e === !1 && V(!1, !0));
668
+ U && (e ? P(!1, !0) : e === !1 && w(!1, !0));
536
669
  }
537
- ), I(
538
- m,
670
+ ), X(
671
+ b,
539
672
  (e) => {
540
- e && (V(!1, !0), fe(), f("update:open", !1));
673
+ e && (w(!1, !0), fe(), p("update:open", !1));
541
674
  },
542
675
  { flush: "sync" }
543
- ), I(
544
- () => l.remoteMethod,
676
+ ), X(
677
+ () => a.remoteMethod,
545
678
  () => {
546
- ye.value = void 0, ie.value = void 0, h.value && Be(k.value);
679
+ be.value = void 0, te.value = void 0, y.value && $e(k.value);
547
680
  }
548
681
  );
549
- function ra() {
550
- R = !1, V(!1, !0), Ke(), fe(), clearTimeout(Ce), ce = !1;
682
+ function At() {
683
+ U = !1, w(!1, !0), Ue(), fe(), clearTimeout(Ve), ce = !1;
551
684
  }
552
- return Ea(() => {
685
+ return Gt(() => {
553
686
  var e;
554
- Ie(), l.autofocus && !m.value && ((e = b.value) == null || e.focus()), (l.open ?? l.defaultOpen) && F(!1, !0);
555
- }), Fa(Ie), Ha(() => {
556
- R = !0, l.open && F(!1, !0);
557
- }), ja(ra), Wa(ra), pa({
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
- m.value || (e = b.value) == null || e.focus();
693
+ b.value || (e = m.value) == null || e.focus();
561
694
  },
562
695
  blur: () => {
563
- var a, o;
696
+ var t, o;
564
697
  const e = document.activeElement;
565
- e && ((a = b.value) != null && a.contains(e) || (o = H.value) != null && o.contains(e)) && e.blur(), V();
698
+ e && ((t = m.value) != null && t.contains(e) || (o = C.value) != null && o.contains(e)) && e.blur(), w();
566
699
  },
567
- open: () => F(),
568
- close: () => V(),
700
+ open: () => P(),
701
+ close: () => w(),
569
702
  scrollTo: (e) => {
570
- S.value = n(e), G();
703
+ V.value = n(e), Z();
571
704
  },
572
- retry: We,
573
- selected: M,
705
+ retry: Ne,
706
+ selectAll: dt,
707
+ deselectAll: vt,
708
+ selected: B,
574
709
  query: k,
575
- isOpen: h
576
- }), (e, a) => {
577
- var o, i, u;
578
- return c(), v("div", qe(s(De), {
579
- class: ["hys-ui-select-wrap", [e.$attrs.class, "hys-ui-select-" + s(B)]],
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
- U("button", {
717
+ $("button", {
583
718
  hidden: "",
584
719
  type: "button",
585
720
  tabindex: "-1",
586
721
  "aria-hidden": "true",
587
- disabled: s(m),
588
- onClick: a[0] || (a[0] = Ae((t) => {
589
- var y;
590
- (y = b.value) == null || y.focus(), oa();
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, Ja),
593
- U("div", qe({
727
+ }, null, 8, hl),
728
+ $("div", Qe({
594
729
  ref_key: "trigger",
595
- ref: b
596
- }, Ma(), {
730
+ ref: m
731
+ }, Kt(), {
597
732
  class: ["hys-ui-select", {
598
- "hys-ui-select-disabled": s(m),
599
- "hys-ui-select-borderless": !d.bordered,
600
- "hys-ui-select-error": xe.value === "error",
601
- "hys-ui-select-warning": xe.value === "warning",
602
- "hys-ui-select-success": xe.value === "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($)) == null ? void 0 : o.id.value) || void 0,
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(m) ? -1 : 0,
608
- "aria-label": d.ariaLabel || s(Ne) || Ve.value || M.value.map((t) => t.label).join("、") || d.placeholder,
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(h),
611
- "aria-disabled": s(m) || void 0,
612
- "aria-readonly": d.readonly || void 0,
613
- "aria-required": ((i = s($)) == null ? void 0 : i.required.value) || void 0,
614
- "aria-invalid": xe.value === "error" || !1,
615
- "aria-describedby": [e.$attrs["aria-describedby"], (u = s($)) == null ? void 0 : u.describedBy.value].filter(Boolean).join(" ") || void 0,
616
- "aria-controls": s(h) ? s(oe) : void 0,
617
- "aria-activedescendant": s(h) ? _e.value : void 0,
618
- onClick: a[1] || (a[1] = Ae((t) => !t.target.closest("button") && oa(), ["prevent"])),
619
- onKeydown: ua,
620
- onFocusin: sa,
621
- onFocusout: na
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
- U("span", _a, [
624
- x(e.$slots, "label", { selected: M.value }, () => {
625
- var t, y;
758
+ $("span", ml, [
759
+ T(e.$slots, "label", { selected: B.value }, () => {
760
+ var l, d;
626
761
  return [
627
- j.value && M.value.length ? (c(), v(le, { key: 0 }, [
628
- (c(!0), v(le, null, Pe(Ge.value, (p) => (c(), v("span", {
629
- key: s(n)(p.value),
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
- x(e.$slots, "tag", {
633
- option: p,
634
- remove: () => je(p),
635
- disabled: s(m) || d.readonly || p.disabled
767
+ T(e.$slots, "tag", {
768
+ option: f,
769
+ remove: () => Pe(f),
770
+ disabled: s(b) || r.readonly || f.disabled
636
771
  }, () => [
637
- U("span", {
772
+ $("span", {
638
773
  class: "hys-ui-select-tag-text",
639
- title: p.label
640
- }, Q(d.maxTagTextLength && p.label.length > d.maxTagTextLength ? p.label.slice(0, d.maxTagTextLength) + "…" : p.label), 9, et),
641
- d.removable && !d.readonly && !p.disabled ? (c(), v("button", {
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(m),
645
- "aria-label": "移除 " + p.label,
646
- onClick: Ae((C) => je(p), ["stop"])
779
+ disabled: s(b),
780
+ "aria-label": "移除 " + f.label,
781
+ onClick: Ee((x) => Pe(f), ["stop"])
647
782
  }, [
648
- x(e.$slots, "remove-icon", {}, () => [
649
- Oe(s(fa), {
650
- size: ee.value - 3
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, at)) : L("", !0)
788
+ ], 8, gl)) : E("", !0)
654
789
  ], !0)
655
790
  ]))), 128)),
656
- ke.value.length ? (c(), v("span", {
791
+ Se.value.length ? (v(), h("span", {
657
792
  key: 0,
658
793
  class: "hys-ui-select-tag hys-ui-select-more",
659
- title: ke.value.map((p) => p.label).join("、")
794
+ title: Se.value.map((f) => f.label).join("、")
660
795
  }, [
661
- x(e.$slots, "max-tag", { omitted: ke.value }, () => [
662
- J("+" + Q(ke.value.length), 1)
796
+ T(e.$slots, "max-tag", { omitted: Se.value }, () => [
797
+ _("+" + M(Se.value.length), 1)
663
798
  ], !0)
664
- ], 8, tt)) : L("", !0)
665
- ], 64)) : (c(), v("span", {
799
+ ], 8, kl)) : E("", !0)
800
+ ], 64)) : (v(), h("span", {
666
801
  key: 1,
667
- class: va(["hys-ui-select-single-label", { "hys-ui-select-placeholder": !M.value.length }]),
668
- title: (t = M.value[0]) == null ? void 0 : t.label
669
- }, Q(((y = M.value[0]) == null ? void 0 : y.label) ?? d.placeholder), 11, lt))
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
- d.showArrow || P.value ? (c(), v("span", ot, [
674
- x(e.$slots, "suffix", {
675
- open: s(h),
676
- loading: P.value
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
- P.value ? (c(), Re(s(qa), {
813
+ D.value ? (v(), Xe(s(ol), {
679
814
  key: 0,
680
815
  class: "hys-ui-icon-spin",
681
- size: ee.value
682
- }, null, 8, ["size"])) : (c(), Re(s(Pa), {
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: ee.value,
820
+ size: ae.value,
686
821
  "aria-hidden": "true"
687
822
  }, null, 8, ["size"]))
688
823
  ], !0)
689
- ])) : L("", !0)
690
- ], 16, Za),
691
- d.clearable && g.value.length && !s(m) && !d.readonly ? (c(), v("button", {
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: Ae(Sa, ["stop"])
831
+ onClick: Ee(qt, ["stop"])
697
832
  }, [
698
- x(e.$slots, "clear-icon", {}, () => [
699
- Oe(s(fa), {
700
- size: ee.value - 2
833
+ T(e.$slots, "clear-icon", {}, () => [
834
+ ye(s(Tt), {
835
+ size: ae.value - 2
701
836
  }, null, 8, ["size"])
702
837
  ], !0)
703
- ])) : L("", !0),
704
- d.name ? (c(!0), v(le, { key: 1 }, Pe(g.value, (t, y) => (c(), v("input", {
705
- key: y,
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: d.name,
708
- value: String(typeof t == "object" ? s(Ua)(t, d.valueKey) ?? "" : t),
709
- disabled: s(m)
710
- }, null, 8, it))), 128)) : L("", !0),
711
- (c(), Re(Ka, {
712
- to: d.appendTo === !1 ? "body" : d.appendTo,
713
- disabled: d.appendTo === !1
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(h) ? (c(), v("div", qe({
716
- key: 0,
717
- ref_key: "panel",
718
- ref: H
719
- }, s(De), {
720
- class: ["hys-ui-select-options hys-ui-floating-surface", ["hys-ui-select-popup-" + s(B), d.popupClass]],
721
- "data-size": s(B),
722
- "data-placement": s(ka),
723
- style: Ca.value,
724
- onKeydown: ua,
725
- onFocusin: sa,
726
- onFocusout: na
727
- }), [
728
- e.$slots.header ? (c(), v("div", st, [
729
- x(e.$slots, "header", {
730
- query: k.value,
731
- selected: M.value,
732
- close: () => s(V)()
733
- }, void 0, !0)
734
- ])) : L("", !0),
735
- ue.value ? (c(), v("input", {
736
- key: 1,
737
- ref_key: "searchInput",
738
- ref: Z,
739
- value: be.value,
740
- class: "hys-ui-select-search",
741
- placeholder: "搜索选项…",
742
- "aria-label": "搜索选项",
743
- "aria-controls": s(oe),
744
- "aria-activedescendant": _e.value,
745
- "aria-autocomplete": "list",
746
- onInput: ia,
747
- onCompositionstart: a[2] || (a[2] = (t) => ge.value = !0),
748
- onCompositionend: Ba
749
- }, null, 40, nt)) : L("", !0),
750
- U("div", {
751
- id: s(oe),
752
- ref_key: "viewport",
753
- ref: A,
754
- role: "listbox",
755
- "aria-label": d.ariaLabel || s(Ne) || "可选项",
756
- "aria-multiselectable": j.value || void 0,
757
- "aria-busy": P.value || void 0,
758
- class: "hys-ui-select-list",
759
- style: he({
760
- maxHeight: "min(" + ne.value + "px, 45dvh)"
761
- }),
762
- onScroll: Aa
763
- }, [
764
- P.value ? (c(), v("p", ct, [
765
- x(e.$slots, "loading", {}, () => [
766
- J(Q(d.loadingText), 1)
767
- ], !0)
768
- ])) : ie.value ? (c(), v("div", dt, [
769
- x(e.$slots, "error", {
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-retry",
777
- onClick: We
778
- }, " 重试 ")
779
- ], !0)
780
- ])) : T.value.length ? (c(), v("div", {
781
- key: 2,
782
- style: he(
783
- O.value ? {
784
- height: T.value.length * E.value + "px",
785
- position: "relative"
786
- } : void 0
787
- ),
788
- role: "presentation"
789
- }, [
790
- U("div", {
791
- style: he(
792
- O.value ? {
793
- position: "absolute",
794
- top: 0,
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
- (c(!0), v(le, null, Pe(Ze.value, (t) => (c(), v(le, {
803
- key: t.key
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
- t.option ? (c(), v("button", {
806
- key: 1,
807
- id: s(oe) + "-" + t.index,
808
- type: "button",
809
- role: "option",
810
- tabindex: "-1",
811
- class: va(["hys-ui-select-option", {
812
- "hys-ui-selected": W.value.has(
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
- x(e.$slots, "group", {
868
- label: t.group
869
- }, () => [
870
- J(Q(t.group), 1)
871
- ], !0)
872
- ], 4))
873
- ], 64))), 128))
874
- ], 4)
875
- ], 4)) : (c(), v("p", ht, [
876
- x(e.$slots, "empty", { query: k.value }, () => [
877
- J(Q(k.value ? d.noMatchText : d.emptyText), 1)
878
- ], !0)
879
- ]))
880
- ], 44, rt),
881
- e.$slots.footer ? (c(), v("div", yt, [
882
- x(e.$slots, "footer", {
883
- query: k.value,
884
- selected: M.value,
885
- close: () => s(V)()
886
- }, void 0, !0)
887
- ])) : L("", !0)
888
- ], 16, ut)) : L("", !0)
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
- Ct as default
1060
+ Ul as default
896
1061
  };