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