x-next 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/_hooks/use-form-item.d.ts +5 -0
  3. package/dist/_hooks/use-picker-focus.d.ts +17 -0
  4. package/dist/components/_components/feedback-icon/index.vue.d.ts +4 -4
  5. package/dist/components/_components/picker/input-range.vue.d.ts +10 -6
  6. package/dist/components/_components/picker/input.vue.d.ts +9 -5
  7. package/dist/components/alert/Alert.vue.d.ts +5 -5
  8. package/dist/components/alert/index.d.ts +10 -10
  9. package/dist/components/date-picker/DatePanel.vue.d.ts +5 -0
  10. package/dist/components/date-picker/DatePicker.vue.d.ts +36 -16
  11. package/dist/components/date-picker/index.d.ts +77 -33
  12. package/dist/components/dialog/Dialog.d.ts +1 -1
  13. package/dist/components/dialog/index.d.ts +3 -3
  14. package/dist/components/drawer/index.d.ts +3 -3
  15. package/dist/components/drawer/src/Drawer.vue.d.ts +1 -1
  16. package/dist/components/dropdown/Dropdown.vue.d.ts +30 -4
  17. package/dist/components/dropdown/DropdownButton.vue.d.ts +31 -5
  18. package/dist/components/dropdown/DropdownOption.vue.d.ts +2 -0
  19. package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +162 -5
  20. package/dist/components/dropdown/context.d.ts +14 -1
  21. package/dist/components/dropdown/dropdown-panel.vue.d.ts +7 -1
  22. package/dist/components/dropdown/index.d.ts +610 -28
  23. package/dist/components/dropdown/use-keyboard.d.ts +10 -0
  24. package/dist/components/form/FormItem.vue.d.ts +12 -4
  25. package/dist/components/form/context.d.ts +6 -0
  26. package/dist/components/form/form-item-label.vue.d.ts +4 -4
  27. package/dist/components/form/form-item-message.vue.d.ts +2 -0
  28. package/dist/components/form/index.d.ts +30 -8
  29. package/dist/components/form/interface.d.ts +2 -2
  30. package/dist/components/form-input/InputPassword.vue.d.ts +20 -2
  31. package/dist/components/form-input/index.d.ts +22 -4
  32. package/dist/components/form-select/Select.d.ts +3 -3
  33. package/dist/components/form-select/hooks/use-select.d.ts +2 -1
  34. package/dist/components/form-select/index.d.ts +6 -6
  35. package/dist/components/form-slider/Slider.vue.d.ts +10 -3
  36. package/dist/components/form-slider/index.d.ts +26 -6
  37. package/dist/components/form-slider/slider-button.vue.d.ts +4 -3
  38. package/dist/components/form-switch/Switch.vue.d.ts +2 -1
  39. package/dist/components/form-switch/index.d.ts +5 -2
  40. package/dist/components/form-textarea/Textarea.vue.d.ts +2 -2
  41. package/dist/components/form-textarea/index.d.ts +5 -5
  42. package/dist/components/image/Image.vue.d.ts +10 -9
  43. package/dist/components/image/ImagePreview.vue.d.ts +8 -7
  44. package/dist/components/image/ImagePreviewAction.d.ts +3 -3
  45. package/dist/components/image/ImagePreviewGroup.vue.d.ts +8 -7
  46. package/dist/components/image/index.d.ts +59 -52
  47. package/dist/components/image/preview-arrow.vue.d.ts +2 -2
  48. package/dist/components/image/preview-toolbar.vue.d.ts +3 -3
  49. package/dist/components/layout/LayoutSidebar.vue.d.ts +2 -2
  50. package/dist/components/layout/index.d.ts +4 -4
  51. package/dist/components/link/Link.vue.d.ts +2 -2
  52. package/dist/components/link/index.d.ts +4 -4
  53. package/dist/components/menu/Menu.d.ts +2 -2
  54. package/dist/components/menu/base-menu.vue.d.ts +2 -2
  55. package/dist/components/menu/index.d.ts +4 -4
  56. package/dist/components/menu/sub-menu-pop.vue.d.ts +5 -5
  57. package/dist/components/message/index.d.ts +17 -17
  58. package/dist/components/message/message.vue.d.ts +8 -8
  59. package/dist/components/notification/Notification.d.ts +1 -1
  60. package/dist/components/notification/index.d.ts +3 -3
  61. package/dist/components/pagination/page-item-ellipsis.vue.d.ts +1 -1
  62. package/dist/components/pagination/page-item-step.vue.d.ts +2 -2
  63. package/dist/components/pagination/page-options.vue.d.ts +6 -6
  64. package/dist/components/popconfirm/src/popup.vue.d.ts +1 -1
  65. package/dist/components/popover/Popover.d.ts +1 -1
  66. package/dist/components/popover/index.d.ts +3 -3
  67. package/dist/components/popup/Popup.d.ts +1 -1
  68. package/dist/components/popup/index.d.ts +3 -3
  69. package/dist/components/progress/Progress.vue.d.ts +4 -4
  70. package/dist/components/progress/circle.vue.d.ts +2 -2
  71. package/dist/components/progress/index.d.ts +8 -8
  72. package/dist/components/progress/line.vue.d.ts +1 -1
  73. package/dist/components/progress/steps.vue.d.ts +1 -1
  74. package/dist/components/steps/Step.vue.d.ts +2 -2
  75. package/dist/components/steps/index.d.ts +4 -4
  76. package/dist/components/tabs/Tabs.d.ts +1 -1
  77. package/dist/components/tabs/index.d.ts +3 -3
  78. package/dist/components/tabs/tabs-tab.vue.d.ts +1 -1
  79. package/dist/components/tag/Tag.vue.d.ts +2 -2
  80. package/dist/components/tag/index.d.ts +4 -4
  81. package/dist/components/time-picker/TimeColumn.vue.d.ts +3 -0
  82. package/dist/components/time-picker/TimePanel.vue.d.ts +3 -0
  83. package/dist/components/time-picker/TimePicker.vue.d.ts +33 -17
  84. package/dist/components/time-picker/index.d.ts +73 -36
  85. package/dist/components/time-range-selector/TimeRangeSelector.vue.d.ts +8 -0
  86. package/dist/components/time-range-selector/index.d.ts +22 -0
  87. package/dist/components/tooltip/Tooltip.vue.d.ts +1 -1
  88. package/dist/components/tooltip/index.d.ts +3 -3
  89. package/dist/components/trigger/Trigger.d.ts +1 -1
  90. package/dist/components/trigger/index.d.ts +3 -3
  91. package/dist/es/_hooks/use-form-item.js +36 -10
  92. package/dist/es/_hooks/use-overflow.js +45 -40
  93. package/dist/es/_hooks/use-picker-focus.js +57 -0
  94. package/dist/es/_utils/constant.js +17 -5
  95. package/dist/es/components/_components/picker/input-range.vue.js +45 -55
  96. package/dist/es/components/_components/picker/input-range.vue2.js +105 -70
  97. package/dist/es/components/_components/picker/input.vue.js +22 -25
  98. package/dist/es/components/_components/picker/input.vue2.js +58 -43
  99. package/dist/es/components/_components/select-view/select-view.js +61 -66
  100. package/dist/es/components/date-picker/DatePanel.vue.js +102 -94
  101. package/dist/es/components/date-picker/DatePanel.vue2.js +97 -44
  102. package/dist/es/components/date-picker/DatePicker.vue.js +71 -58
  103. package/dist/es/components/date-picker/DatePicker.vue2.js +285 -231
  104. package/dist/es/components/dialog/Dialog.js +159 -128
  105. package/dist/es/components/dropdown/Dropdown.vue.js +18 -15
  106. package/dist/es/components/dropdown/Dropdown.vue2.js +52 -31
  107. package/dist/es/components/dropdown/DropdownOption.vue.js +22 -21
  108. package/dist/es/components/dropdown/DropdownOption.vue2.js +23 -19
  109. package/dist/es/components/dropdown/DropdownSubmenu.vue.js +49 -36
  110. package/dist/es/components/dropdown/DropdownSubmenu.vue2.js +45 -24
  111. package/dist/es/components/dropdown/context.js +3 -2
  112. package/dist/es/components/dropdown/dropdown-panel.vue.js +24 -21
  113. package/dist/es/components/dropdown/dropdown-panel.vue2.js +83 -31
  114. package/dist/es/components/dropdown/use-keyboard.js +45 -0
  115. package/dist/es/components/form/Form.vue2.js +113 -101
  116. package/dist/es/components/form/FormItem.vue.js +26 -22
  117. package/dist/es/components/form/FormItem.vue2.js +162 -125
  118. package/dist/es/components/form/form-item-message.vue.js +31 -24
  119. package/dist/es/components/form/form-item-message.vue2.js +4 -2
  120. package/dist/es/components/form-checkbox/Checkbox.js +80 -76
  121. package/dist/es/components/form-checkbox/CheckboxGroup.js +43 -38
  122. package/dist/es/components/form-input/Input.js +83 -79
  123. package/dist/es/components/form-input/InputPassword.vue.js +19 -16
  124. package/dist/es/components/form-input/InputPassword.vue2.js +39 -29
  125. package/dist/es/components/form-input/InputSearch.js +47 -37
  126. package/dist/es/components/form-input-number/InputNumber.js +134 -133
  127. package/dist/es/components/form-input-tag/InputTag.js +173 -162
  128. package/dist/es/components/form-radio/Radio.js +74 -71
  129. package/dist/es/components/form-radio/RadioGroup.js +55 -49
  130. package/dist/es/components/form-select/Select.js +116 -114
  131. package/dist/es/components/form-select/hooks/use-select.js +128 -128
  132. package/dist/es/components/form-slider/Slider.vue.js +28 -28
  133. package/dist/es/components/form-slider/Slider.vue2.js +139 -132
  134. package/dist/es/components/form-slider/slider-button.vue.js +6 -6
  135. package/dist/es/components/form-slider/slider-button.vue2.js +39 -34
  136. package/dist/es/components/form-switch/Switch.vue.js +9 -9
  137. package/dist/es/components/form-switch/Switch.vue2.js +81 -74
  138. package/dist/es/components/form-textarea/Textarea.vue2.js +123 -108
  139. package/dist/es/components/image/Image.vue2.js +77 -76
  140. package/dist/es/components/image/ImagePreview.vue.js +13 -12
  141. package/dist/es/components/image/ImagePreview.vue2.js +141 -136
  142. package/dist/es/components/image/ImagePreviewGroup.vue.js +1 -1
  143. package/dist/es/components/image/ImagePreviewGroup.vue2.js +82 -83
  144. package/dist/es/components/rate/Rate.js +106 -103
  145. package/dist/es/components/time-picker/TimeColumn.vue.js +34 -23
  146. package/dist/es/components/time-picker/TimeColumn.vue2.js +37 -28
  147. package/dist/es/components/time-picker/TimePicker.vue.js +83 -64
  148. package/dist/es/components/time-picker/TimePicker.vue2.js +192 -156
  149. package/dist/es/components/time-range-selector/TimeRangeSelector.vue.js +327 -193
  150. package/dist/es/locale/en-US.js +6 -0
  151. package/dist/es/locale/zh-CN.js +6 -0
  152. package/dist/es/style.css +1 -1
  153. package/dist/icons/_self/down.d.ts +1 -1
  154. package/dist/icons/_self/dropdown/more.d.ts +1 -1
  155. package/dist/icons/_self/empty-better.d.ts +1 -1
  156. package/dist/icons/_self/empty.d.ts +1 -1
  157. package/dist/icons/_self/eye-invisible.d.ts +1 -1
  158. package/dist/icons/_self/eye.d.ts +1 -1
  159. package/dist/icons/_self/full-screen.d.ts +1 -1
  160. package/dist/icons/_self/left.d.ts +1 -1
  161. package/dist/icons/_self/menu/down.d.ts +1 -1
  162. package/dist/icons/_self/minus.d.ts +1 -1
  163. package/dist/icons/_self/more-dot.d.ts +1 -1
  164. package/dist/icons/_self/next.d.ts +1 -1
  165. package/dist/icons/_self/original-size.d.ts +1 -1
  166. package/dist/icons/_self/plus.d.ts +1 -1
  167. package/dist/icons/_self/prev.d.ts +1 -1
  168. package/dist/icons/_self/question-message.d.ts +1 -1
  169. package/dist/icons/_self/right.d.ts +1 -1
  170. package/dist/icons/_self/rotate-left.d.ts +1 -1
  171. package/dist/icons/_self/rotate-right.d.ts +1 -1
  172. package/dist/icons/_self/search.d.ts +1 -1
  173. package/dist/icons/_self/up.d.ts +1 -1
  174. package/dist/icons/_self/zoom-in.d.ts +1 -1
  175. package/dist/icons/_self/zoom-out.d.ts +1 -1
  176. package/dist/icons/_ui/alone-left.d.ts +1 -1
  177. package/dist/icons/_ui/alone-margin-left.d.ts +1 -1
  178. package/dist/icons/_ui/alone-margin-right.d.ts +1 -1
  179. package/dist/icons/_ui/alone-right.d.ts +1 -1
  180. package/dist/icons/_ui/calendar.d.ts +1 -1
  181. package/dist/icons/_ui/time.d.ts +1 -1
  182. package/dist/icons/animation/animation-loading.d.ts +1 -1
  183. package/dist/icons/default/check-circle-fill.d.ts +1 -1
  184. package/dist/icons/default/check.d.ts +1 -1
  185. package/dist/icons/default/close-circle-fill.d.ts +1 -1
  186. package/dist/icons/default/close.d.ts +1 -1
  187. package/dist/icons/default/exclamation-circle-fill.d.ts +1 -1
  188. package/dist/icons/default/exclamation.d.ts +1 -1
  189. package/dist/icons/default/filter.d.ts +1 -1
  190. package/dist/icons/default/info-circle-fill.d.ts +1 -1
  191. package/dist/icons/default/link.d.ts +1 -1
  192. package/dist/icons/default/logo-simple.d.ts +1 -1
  193. package/dist/icons/default/minus-circle-fill.d.ts +1 -1
  194. package/dist/icons/icon.d.ts +2 -2
  195. package/dist/icons/index.d.ts +3 -3
  196. package/dist/index.cjs +4 -4
  197. package/dist/index.d.ts +1 -1
  198. package/dist/index.umd.js +4 -4
  199. package/dist/locale/interface.d.ts +6 -0
  200. package/dist/style/base.css +1 -1
  201. package/dist/style/date-picker.css +1 -1
  202. package/dist/style/form.css +1 -1
  203. package/dist/style/image.css +1 -1
  204. package/dist/style/time-range-selector.css +1 -1
  205. package/dist/style.css +1 -1
  206. package/package.json +2 -2
@@ -1,12 +1,12 @@
1
- import { defineComponent as C, toRefs as G, ref as _, computed as d, provide as A, reactive as k, watch as v, createVNode as g, mergeProps as x } from "vue";
2
- import { radioGroupKey as F } from "./context.js";
3
- import { isString as L, isNumber as w, isBoolean as D, isUndefined as H, isNull as I, isFunction as K } from "../../_utils/is.js";
4
- import { useFormItem as M } from "../../_hooks/use-form-item.js";
5
- import O from "./Radio.js";
6
- import { useSize as P } from "../../_hooks/use-size.js";
7
- import { getClassNameMixin as U } from "../../_utils/config.js";
8
- import { omit as X } from "../../_utils/omit.js";
9
- const Z = /* @__PURE__ */ C({
1
+ import { defineComponent as I, toRefs as _, useId as F, computed as u, ref as L, provide as k, reactive as w, watch as g, createVNode as v, mergeProps as D } from "vue";
2
+ import { radioGroupKey as H } from "./context.js";
3
+ import { isString as K, isNumber as M, isBoolean as O, isUndefined as P, isNull as U, isFunction as X } from "../../_utils/is.js";
4
+ import { useFormItem as j, useFormItemControl as q } from "../../_hooks/use-form-item.js";
5
+ import E from "./Radio.js";
6
+ import { useSize as J } from "../../_hooks/use-size.js";
7
+ import { getClassNameMixin as Q } from "../../_utils/config.js";
8
+ import { omit as y } from "../../_utils/omit.js";
9
+ const ie = /* @__PURE__ */ I({
10
10
  name: "RadioGroup",
11
11
  inheritAttrs: !1,
12
12
  props: {
@@ -91,7 +91,7 @@ const Z = /* @__PURE__ */ C({
91
91
  * @en Trigger when the value changes
92
92
  * @property { RadioValue } value
93
93
  */
94
- change: (a, i) => !0
94
+ change: (a, l) => !0
95
95
  },
96
96
  /**
97
97
  * @zh radio 文案内容
@@ -109,68 +109,74 @@ const Z = /* @__PURE__ */ C({
109
109
  * @version 2.27.0
110
110
  */
111
111
  setup(a, {
112
- attrs: i,
113
- emit: o,
114
- slots: l
112
+ attrs: l,
113
+ emit: n,
114
+ slots: t
115
115
  }) {
116
- const t = U("radio--group"), {
116
+ const r = Q("radio--group"), {
117
117
  size: p,
118
- type: y,
119
- disabled: S,
120
- modelValue: h
121
- } = G(a), {
122
- mergedDisabled: n,
123
- mergedSize: z,
124
- eventHandlers: V
125
- } = M({
118
+ type: S,
119
+ disabled: h,
120
+ modelValue: z
121
+ } = _(a), N = `x-radio-group-${F()}`, V = u(() => a.name ?? N), {
122
+ formItemCtx: C,
123
+ mergedDisabled: o,
124
+ mergedSize: $,
125
+ eventHandlers: R
126
+ } = j({
126
127
  size: p,
127
- disabled: S
128
+ disabled: h
129
+ }), x = q(C, () => ({
130
+ ...y(l, ["class", "style"]),
131
+ "aria-label": a.ariaLabel ?? l["aria-label"]
132
+ }), {
133
+ labelable: !1
128
134
  }), {
129
135
  mergedSize: m
130
- } = P(z), r = _(a.defaultValue), s = d(() => a.modelValue ?? r.value), f = d(() => (a.options ?? []).map((e) => L(e) || w(e) || D(e) ? {
136
+ } = J($), i = L(a.defaultValue), s = u(() => a.modelValue ?? i.value), f = u(() => (a.options ?? []).map((e) => K(e) || M(e) || O(e) ? {
131
137
  label: e,
132
138
  value: e
133
- } : e)), N = (e, c) => {
134
- var u, b;
135
- r.value = e, o("update:modelValue", e), o("change", e, c), (b = (u = V.value) == null ? void 0 : u.onChange) == null || b.call(u, c);
136
- };
137
- A(F, k({
139
+ } : e));
140
+ k(H, w({
138
141
  name: "XRadioGroup",
139
142
  value: s,
140
143
  size: m,
141
- type: y,
142
- disabled: n,
143
- inputName: a.name,
144
- slots: l,
145
- handleChange: N
146
- })), v(s, (e) => {
147
- r.value !== e && (r.value = e);
148
- }), v(h, (e) => {
149
- (H(e) || I(e)) && (r.value = "");
144
+ type: S,
145
+ disabled: o,
146
+ inputName: V,
147
+ slots: t,
148
+ handleChange: (e, c) => {
149
+ var d, b;
150
+ i.value = e, n("update:modelValue", e), n("change", e, c), (b = (d = R.value) == null ? void 0 : d.onChange) == null || b.call(d, c);
151
+ }
152
+ })), g(s, (e) => {
153
+ i.value !== e && (i.value = e);
154
+ }), g(z, (e) => {
155
+ (P(e) || U(e)) && (i.value = "");
150
156
  });
151
- const R = d(() => [`${a.type === "button" ? t.element("button") : t.block}`, t.modifier(`size-${m.value}`), t.modifier(`direction-${a.direction}`), i.class, {
152
- [t.modifier("disabled")]: n.value
153
- }]), $ = d(() => X(i, ["class", "style"])), B = () => f.value.map((e) => g(O, {
157
+ const A = u(() => [`${a.type === "button" ? r.element("button") : r.block}`, r.modifier(`size-${m.value}`), r.modifier(`direction-${a.direction}`), l.class, {
158
+ [r.modifier("disabled")]: o.value
159
+ }]), B = u(() => y(l, ["class", "style"])), G = () => f.value.map((e) => v(E, {
154
160
  key: `${typeof e.value}-${String(e.value)}`,
155
161
  value: e.value,
156
162
  disabled: e.disabled
157
163
  }, {
158
- default: () => [l.label ? l.label({
164
+ default: () => [t.label ? t.label({
159
165
  data: e
160
- }) : K(e.label) ? e.label() : e.label]
166
+ }) : X(e.label) ? e.label() : e.label]
161
167
  }));
162
168
  return () => {
163
169
  var e;
164
- return g("span", x({
170
+ return v("span", D({
165
171
  role: "radiogroup",
166
172
  "aria-label": a.ariaLabel,
167
- "aria-disabled": n.value,
168
- class: R.value,
169
- style: i.style
170
- }, $.value), [f.value.length > 0 ? B() : (e = l.default) == null ? void 0 : e.call(l)]);
173
+ "aria-disabled": o.value,
174
+ class: A.value,
175
+ style: l.style
176
+ }, B.value, x.value), [f.value.length > 0 ? G() : (e = t.default) == null ? void 0 : e.call(t)]);
171
177
  };
172
178
  }
173
179
  });
174
180
  export {
175
- Z as default
181
+ ie as default
176
182
  };
@@ -1,30 +1,30 @@
1
- import { defineComponent as Ae, toRefs as Ne, useId as je, computed as i, ref as f, watch as H, nextTick as De, watchEffect as Re, createVNode as m, mergeProps as A, isVNode as Te } from "vue";
2
- import { isObject as N, isFunction as y, isArray as _e, isNumber as Ke, isString as Ie, isBoolean as $e, isUndefined as S, isNull as ze, isEmptyObject as He } from "../../_utils/is.js";
3
- import { getKeyFromValue as M, isGroupOptionInfo as Me, isValidOption as Ue, hasEmptyStringKey as Ge } from "./utils.js";
1
+ import { defineComponent as Ne, toRefs as je, useId as De, computed as i, ref as p, watch as H, nextTick as Re, watchEffect as Te, createVNode as m, mergeProps as A, isVNode as _e } from "vue";
2
+ import { isObject as N, isFunction as y, isArray as Ie, isNumber as Ke, isString as $e, isBoolean as ze, isUndefined as C, isNull as He, isEmptyObject as Me } from "../../_utils/is.js";
3
+ import { getKeyFromValue as M, isGroupOptionInfo as Ue, isValidOption as Ge, hasEmptyStringKey as We } from "./utils.js";
4
4
  import { Trigger as U } from "../trigger/index.js";
5
5
  import G from "../_components/select-view/select-view.js";
6
- import We from "./SelectDropdown.vue.js";
7
- import Ye from "./SelectOption.vue.js";
8
- import qe from "./SelectOptionGroup.vue.js";
9
- import Je from "../virtual-list-v2/virtual-list.vue.js";
10
- import { useSelect as Qe } from "./hooks/use-select.js";
11
- import { useTrigger as Xe } from "../../_hooks/use-trigger.js";
12
- import { useFormItem as Ze } from "../../_hooks/use-form-item.js";
13
- import { useLocale as et } from "../../locale/index.js";
14
- import { debounce as tt } from "../../_utils/debounce.js";
15
- import { getClassNameMixin as at } from "../../_utils/config.js";
16
- import { omit as lt } from "../../_utils/omit.js";
17
- import nt from "../../_utils/pick.js";
18
- function ot(t) {
19
- return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !Te(t);
6
+ import Ye from "./SelectDropdown.vue.js";
7
+ import qe from "./SelectOption.vue.js";
8
+ import Je from "./SelectOptionGroup.vue.js";
9
+ import Qe from "../virtual-list-v2/virtual-list.vue.js";
10
+ import { useSelect as Xe } from "./hooks/use-select.js";
11
+ import { useTrigger as Ze } from "../../_hooks/use-trigger.js";
12
+ import { useFormItem as et } from "../../_hooks/use-form-item.js";
13
+ import { useLocale as tt } from "../../locale/index.js";
14
+ import { debounce as at } from "../../_utils/debounce.js";
15
+ import { getClassNameMixin as lt } from "../../_utils/config.js";
16
+ import { omit as nt } from "../../_utils/omit.js";
17
+ import ot from "../../_utils/pick.js";
18
+ function ut(t) {
19
+ return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !_e(t);
20
20
  }
21
- const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
21
+ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], rt = {
22
22
  value: "value",
23
23
  label: "label",
24
24
  disabled: "disabled",
25
25
  tagProps: "tagProps",
26
26
  render: "render"
27
- }, Ct = /* @__PURE__ */ Ae({
27
+ }, Bt = /* @__PURE__ */ Ne({
28
28
  name: "Select",
29
29
  components: {
30
30
  Trigger: U,
@@ -439,7 +439,7 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
439
439
  setup(t, {
440
440
  slots: o,
441
441
  emit: r,
442
- attrs: C
442
+ attrs: B
443
443
  }) {
444
444
  const {
445
445
  size: Y,
@@ -447,7 +447,7 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
447
447
  error: J,
448
448
  options: Q,
449
449
  filterOption: h,
450
- valueKey: p,
450
+ valueKey: f,
451
451
  multiple: j,
452
452
  popupVisible: X,
453
453
  defaultPopupVisible: Z,
@@ -456,18 +456,19 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
456
456
  fieldNames: V,
457
457
  loading: ae,
458
458
  defaultActiveFirstOption: le
459
- } = Ne(t), ne = at("select"), D = je(), B = `${D}-listbox`, x = (e) => `${D}-option-${encodeURIComponent(e)}`, {
460
- mergedSize: oe,
461
- mergedDisabled: F,
462
- mergedError: ue,
463
- eventHandlers: re
464
- } = Ze({
459
+ } = je(t), ne = lt("select"), D = De(), x = `${D}-listbox`, F = (e) => `${D}-option-${encodeURIComponent(e)}`, {
460
+ formItemCtx: oe,
461
+ mergedSize: ue,
462
+ mergedDisabled: w,
463
+ mergedError: re,
464
+ eventHandlers: ie
465
+ } = et({
465
466
  size: Y,
466
467
  disabled: q,
467
468
  error: J
468
469
  }), {
469
- t: ie
470
- } = et(), ce = i(() => t.virtualListProps ? "div" : "li"), P = i(() => N(t.allowSearch) && !!t.allowSearch.retainInputValue);
470
+ t: ce
471
+ } = tt(), de = i(() => t.virtualListProps ? "div" : "li"), P = i(() => N(t.allowSearch) && !!t.allowSearch.retainInputValue);
471
472
  i(() => {
472
473
  if (y(t.formatLabel))
473
474
  return (e) => {
@@ -475,37 +476,37 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
475
476
  return t.formatLabel(l);
476
477
  };
477
478
  });
478
- const R = f(), T = f({}), _ = f(), {
479
+ const R = p(), T = p({}), _ = p(), {
479
480
  computedPopupVisible: c,
480
- handlePopupVisibleChange: w
481
- } = Xe({
481
+ handlePopupVisibleChange: O
482
+ } = Ze({
482
483
  popupVisible: X,
483
484
  defaultPopupVisible: Z,
484
485
  emit: r
485
- }), k = f(t.defaultValue), E = i(() => {
486
+ }), k = p(t.defaultValue), E = i(() => {
486
487
  const e = t.modelValue ?? k.value;
487
- return (_e(e) ? e : e || Ke(e) || Ie(e) || $e(e) ? [e] : []).map((a) => ({
488
+ return (Ie(e) ? e : e || Ke(e) || $e(e) || ze(e) ? [e] : []).map((a) => ({
488
489
  value: a,
489
490
  key: M(a, t.valueKey)
490
491
  }));
491
492
  });
492
493
  H(te, (e) => {
493
- (S(e) || ze(e)) && (k.value = j.value ? [] : e);
494
+ (C(e) || He(e)) && (k.value = j.value ? [] : e);
494
495
  });
495
- const d = i(() => E.value.map((e) => e.key)), K = i(() => ({
496
- ...ut,
496
+ const d = i(() => E.value.map((e) => e.key)), I = i(() => ({
497
+ ...rt,
497
498
  ...V == null ? void 0 : V.value
498
- })), I = f(), de = (e) => {
499
+ })), K = p(), se = (e) => {
499
500
  const l = {};
500
501
  return e.forEach((a) => {
501
502
  l[a] = u.get(a);
502
503
  }), l;
503
- }, se = (e) => {
504
- I.value = de(e);
504
+ }, fe = (e) => {
505
+ K.value = se(e);
505
506
  }, pe = (e) => y(t.fallbackOption) ? t.fallbackOption(e) : {
506
- [K.value.value]: e,
507
- [K.value.label]: String(N(e) ? e[p == null ? void 0 : p.value] : e)
508
- }, fe = () => {
507
+ [I.value.value]: e,
508
+ [I.value.label]: String(N(e) ? e[f == null ? void 0 : f.value] : e)
509
+ }, me = () => {
509
510
  const e = [], l = [];
510
511
  if (t.allowCreate || t.fallbackOption) {
511
512
  for (const a of E.value)
@@ -525,19 +526,19 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
525
526
  }
526
527
  }
527
528
  return e;
528
- }, v = f([]), me = i(() => v.value.map((e) => {
529
+ }, v = p([]), ve = i(() => v.value.map((e) => {
529
530
  var n;
530
531
  let l = pe(e.value);
531
- const a = (n = I.value) == null ? void 0 : n[e.key];
532
- return !S(a) && !He(a) && (l = {
532
+ const a = (n = K.value) == null ? void 0 : n[e.key];
533
+ return !C(a) && !Me(a) && (l = {
533
534
  ...l,
534
535
  ...a
535
536
  }), l;
536
537
  }));
537
- De(() => {
538
- Re(() => {
538
+ Re(() => {
539
+ Te(() => {
539
540
  var l;
540
- const e = fe();
541
+ const e = me();
541
542
  if (e.length !== v.value.length)
542
543
  v.value = e;
543
544
  else if (e.length > 0) {
@@ -549,28 +550,28 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
549
550
  }
550
551
  });
551
552
  });
552
- const $ = f(t.defaultInputValue), s = i(() => t.inputValue ?? $.value);
553
+ const $ = p(t.defaultInputValue), s = i(() => t.inputValue ?? $.value);
553
554
  H(c, (e) => {
554
555
  !e && !P.value && s.value && g("");
555
556
  });
556
- const ve = (e) => {
557
+ const be = (e) => {
557
558
  var l;
558
559
  return t.multiple ? e.map((a) => {
559
560
  var n;
560
561
  return ((n = u.get(a)) == null ? void 0 : n.value) ?? "";
561
- }) : ((l = u.get(e[0])) == null ? void 0 : l.value) ?? (Ge(u) ? void 0 : "");
562
+ }) : ((l = u.get(e[0])) == null ? void 0 : l.value) ?? (We(u) ? void 0 : "");
562
563
  }, b = (e) => {
563
564
  var a, n;
564
- const l = ve(e);
565
- k.value = l, r("update:modelValue", l), r("change", l), (n = (a = re.value) == null ? void 0 : a.onChange) == null || n.call(a), se(e);
565
+ const l = be(e);
566
+ k.value = l, r("update:modelValue", l), r("change", l), (n = (a = ie.value) == null ? void 0 : a.onChange) == null || n.call(a), fe(e);
566
567
  }, g = (e) => {
567
568
  $.value = e, r("update:inputValue", e), r("inputValueChange", e);
568
- }, be = (e, l) => {
569
+ }, ge = (e, l) => {
569
570
  if (t.multiple) {
570
571
  if (d.value.includes(e)) {
571
572
  const a = d.value.filter((n) => n !== e);
572
573
  b(a);
573
- } else if (Ce.value.includes(e))
574
+ } else if (Be.value.includes(e))
574
575
  if (t.limit > 0 && d.value.length >= t.limit) {
575
576
  const a = u.get(e);
576
577
  r("exceedLimit", a == null ? void 0 : a.value, l);
@@ -584,76 +585,77 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
584
585
  const a = u.get(e);
585
586
  a && g(a.label);
586
587
  }
587
- w(!1);
588
+ O(!1);
588
589
  }
589
- }, ge = tt((e) => {
590
+ }, ye = at((e) => {
590
591
  r("search", e);
591
- }, t.searchDelay), ye = (e) => {
592
- e !== s.value && (c.value || w(!0), g(e), t.allowSearch && ge(e));
593
- }, he = (e) => {
592
+ }, t.searchDelay), he = (e) => {
593
+ e !== s.value && (c.value || O(!0), g(e), t.allowSearch && ye(e));
594
+ }, Ve = (e) => {
594
595
  const l = u.get(e), a = d.value.filter((n) => n !== e);
595
596
  b(a), r("remove", l == null ? void 0 : l.value);
596
- }, Ve = (e) => {
597
+ }, we = (e) => {
597
598
  e == null || e.stopPropagation();
598
599
  const l = d.value.filter((a) => {
599
600
  var n;
600
601
  return (n = u.get(a)) == null ? void 0 : n.disabled;
601
602
  });
602
603
  b(l), g(""), r("clear", e);
603
- }, we = (e) => {
604
- r("dropdownScroll", e);
605
604
  }, Oe = (e) => {
605
+ r("dropdownScroll", e);
606
+ }, Se = (e) => {
606
607
  r("dropdownReachBottom", e);
607
608
  }, {
608
609
  validOptions: z,
609
610
  optionInfoMap: u,
610
- validOptionInfos: Se,
611
- enabledOptionKeys: Ce,
612
- activeKey: O,
613
- handleKeyDown: Be
614
- } = Qe({
611
+ validOptionInfos: Ce,
612
+ enabledOptionKeys: Be,
613
+ activeKey: S,
614
+ handleKeyDown: xe
615
+ } = Xe({
615
616
  multiple: j,
616
617
  options: Q,
617
- extraOptions: me,
618
+ extraOptions: ve,
618
619
  inputValue: s,
619
620
  filterOption: h,
620
621
  showExtraOptions: ee,
621
- component: ce,
622
- valueKey: p,
622
+ component: de,
623
+ valueKey: f,
623
624
  fieldNames: V,
624
625
  loading: ae,
626
+ disabled: w,
625
627
  popupVisible: c,
626
628
  valueKeys: d,
627
629
  dropdownRef: R,
628
630
  optionRefs: T,
629
631
  virtualListRef: _,
630
632
  defaultActiveFirstOption: le,
631
- onSelect: be,
632
- onPopupVisibleChange: w,
633
- getOptionId: x
634
- }), xe = i(() => lt(C, [...W])), Fe = i(() => ({
635
- ...nt(C, [...W]),
633
+ onSelect: ge,
634
+ onPopupVisibleChange: O,
635
+ getOptionId: F
636
+ }), Fe = i(() => nt(B, [...W])), Pe = i(() => ({
637
+ ...ot(B, [...W]),
636
638
  role: "combobox",
637
639
  "aria-haspopup": "listbox",
638
640
  "aria-expanded": String(c.value),
639
- "aria-controls": B,
640
- "aria-activedescendant": c.value && !S(O.value) ? x(O.value) : void 0,
641
+ "aria-controls": x,
642
+ "aria-activedescendant": c.value && !C(S.value) ? F(S.value) : void 0,
641
643
  "aria-autocomplete": t.allowSearch || t.allowCreate ? "list" : "none",
642
- "aria-label": C["aria-label"] ?? t.placeholder ?? ie("common.select")
643
- })), Pe = i(() => {
644
+ "aria-label": B["aria-label"] ?? (oe.labelId ? void 0 : t.placeholder ?? ce("common.select"))
645
+ })), ke = i(() => {
644
646
  const e = [];
645
647
  for (const l of E.value) {
646
648
  const a = u.get(l.key);
647
649
  a && e.push({
648
650
  ...a,
649
651
  value: l.key,
650
- label: (a == null ? void 0 : a.label) ?? String(N(l.value) ? l.value[p == null ? void 0 : p.value] : l.value),
652
+ label: (a == null ? void 0 : a.label) ?? String(N(l.value) ? l.value[f == null ? void 0 : f.value] : l.value),
651
653
  closable: !(a != null && a.disabled),
652
654
  tagProps: a == null ? void 0 : a.tagProps
653
655
  });
654
656
  }
655
657
  return e;
656
- }), ke = (e) => {
658
+ }), Ee = (e) => {
657
659
  if (y(o.option)) {
658
660
  const l = o.option;
659
661
  return () => l({
@@ -662,19 +664,19 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
662
664
  }
663
665
  return y(e.render) ? e.render : () => e.label;
664
666
  }, L = (e) => {
665
- if (Me(e)) {
667
+ if (Ue(e)) {
666
668
  let l;
667
- return m(qe, {
669
+ return m(Je, {
668
670
  key: e.key,
669
671
  label: e.label
670
- }, ot(l = e.options.map((a) => L(a))) ? l : {
672
+ }, ut(l = e.options.map((a) => L(a))) ? l : {
671
673
  default: () => [l]
672
674
  });
673
675
  }
674
- return Ue(e, {
676
+ return Ge(e, {
675
677
  inputValue: s.value,
676
678
  filterOption: h == null ? void 0 : h.value
677
- }) ? m(Ye, {
679
+ }) ? m(qe, {
678
680
  ref: (l) => {
679
681
  l != null && l.$el && (T.value[e.key] = l.$el);
680
682
  },
@@ -684,20 +686,20 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
684
686
  disabled: e.disabled,
685
687
  internal: !0
686
688
  }, {
687
- default: ke(e)
689
+ default: Ee(e)
688
690
  }) : null;
689
- }, Ee = () => m(We, {
691
+ }, Le = () => m(Ye, {
690
692
  ref: R,
691
- id: B,
693
+ id: x,
692
694
  multiple: t.multiple,
693
695
  loading: t.loading,
694
- empty: Se.value.length === 0,
696
+ empty: Ce.value.length === 0,
695
697
  virtualList: !!t.virtualListProps,
696
698
  scrollbar: t.scrollbar,
697
699
  showHeaderOnEmpty: t.showHeaderOnEmpty,
698
700
  showFooterOnEmpty: t.showFooterOnEmpty,
699
- onScroll: we,
700
- onReachBottom: Oe
701
+ onScroll: Oe,
702
+ onReachBottom: Se
701
703
  }, {
702
704
  default: () => {
703
705
  var e;
@@ -705,7 +707,7 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
705
707
  },
706
708
  "virtual-list": () => (
707
709
  // @ts-ignore
708
- m(Je, A(t.virtualListProps, {
710
+ m(Qe, A(t.virtualListProps, {
709
711
  ref: _,
710
712
  data: z.value
711
713
  }), {
@@ -725,7 +727,7 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
725
727
  ...o.footer ? {
726
728
  footer: o.footer
727
729
  } : {}
728
- }), Le = ({
730
+ }), Ae = ({
729
731
  data: e
730
732
  }) => {
731
733
  var l, a;
@@ -747,27 +749,27 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
747
749
  preventFocus: !0,
748
750
  autoFitPopupWidth: !0,
749
751
  autoFitTransformOrigin: !0,
750
- disabled: F.value,
752
+ disabled: w.value,
751
753
  popupVisible: c.value,
752
754
  unmountOnClose: t.unmountOnClose,
753
755
  clickToClose: !(t.allowSearch || t.allowCreate),
754
756
  popupContainer: t.popupContainer,
755
- onPopupVisibleChange: w
757
+ onPopupVisibleChange: O
756
758
  }, t.triggerProps), {
757
759
  default: () => {
758
760
  var e;
759
761
  return [((e = o.trigger) == null ? void 0 : e.call(o, {
760
762
  popupVisible: c.value,
761
- disabled: F.value,
762
- listboxId: B,
763
- activeDescendant: c.value && !S(O.value) ? x(O.value) : void 0
763
+ disabled: w.value,
764
+ listboxId: x,
765
+ activeDescendant: c.value && !C(S.value) ? F(S.value) : void 0
764
766
  })) ?? m(G, A({
765
767
  class: ne.block,
766
- modelValue: Pe.value,
768
+ modelValue: ke.value,
767
769
  inputValue: s.value,
768
770
  multiple: t.multiple,
769
- disabled: F.value,
770
- error: ue.value,
771
+ disabled: w.value,
772
+ error: re.value,
771
773
  loading: t.loading,
772
774
  allowClear: t.allowClear,
773
775
  allowCreate: t.allowCreate,
@@ -776,26 +778,26 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
776
778
  maxTagCount: t.maxTagCount,
777
779
  placeholder: t.placeholder,
778
780
  bordered: t.bordered,
779
- size: oe.value,
781
+ size: ue.value,
780
782
  tagNowrap: t.tagNowrap,
781
- inputAttrs: Fe.value
782
- }, xe.value, {
783
- onInputValueChange: ye,
784
- onRemove: he,
785
- onClear: Ve,
786
- onKeydown: Be
783
+ inputAttrs: Pe.value
784
+ }, Fe.value, {
785
+ onInputValueChange: he,
786
+ onRemove: Ve,
787
+ onClear: we,
788
+ onKeydown: xe
787
789
  }), {
788
- label: Le,
790
+ label: Ae,
789
791
  prefix: o.prefix,
790
792
  "arrow-icon": o["arrow-icon"],
791
793
  "loading-icon": o["loading-icon"],
792
794
  "search-icon": o["search-icon"]
793
795
  })];
794
796
  },
795
- content: Ee
797
+ content: Le
796
798
  });
797
799
  }
798
800
  });
799
801
  export {
800
- Ct as default
802
+ Bt as default
801
803
  };