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,29 +1,26 @@
1
- import c from "./input.vue2.js";
2
- import { resolveComponent as r, openBlock as n, createElementBlock as t, normalizeClass as l, renderSlot as m, createCommentVNode as i, createElementVNode as a, mergeProps as k, withKeys as b, createBlock as d, withCtx as y, createVNode as C } from "vue";
1
+ import k from "./input.vue2.js";
2
+ import { resolveComponent as r, openBlock as n, createElementBlock as i, mergeProps as m, normalizeClass as l, renderSlot as d, createCommentVNode as t, createElementVNode as a, withKeys as y, createBlock as p, withCtx as C, createVNode as b } from "vue";
3
3
  import N from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const v = ["disabled", "placeholder", "value"];
5
- function I(e, o, g, $, B, F) {
6
- const p = r("IconClose"), u = r("IconHover"), f = r("FeedbackIcon");
7
- return n(), t("div", {
8
- class: l(e.classNames)
9
- }, [
10
- e.$slots.prefix ? (n(), t("div", {
4
+ const v = ["disabled", "placeholder", "value", "readonly"];
5
+ function I(e, o, g, $, B, w) {
6
+ const u = r("IconClose"), f = r("IconHover"), c = r("FeedbackIcon");
7
+ return n(), i("div", m(e.wrapperAttrs, { class: e.classNames }), [
8
+ e.$slots.prefix ? (n(), i("div", {
11
9
  key: 0,
12
10
  class: l(e.className.element("prefix"))
13
11
  }, [
14
- m(e.$slots, "prefix")
15
- ], 2)) : i("", !0),
12
+ d(e.$slots, "prefix")
13
+ ], 2)) : t("", !0),
16
14
  a("div", {
17
15
  class: l(e.className.element("input"))
18
16
  }, [
19
- a("input", k({
20
- ref: "refInput",
17
+ a("input", m({ ref: "refInput" }, e.formControlAttrs, {
21
18
  disabled: e.mergedDisabled,
22
19
  placeholder: e.placeholder,
23
20
  class: e.className.element("start-time"),
24
- value: e.displayValue
25
- }, e.readonly ? { readonly: !0 } : {}, {
26
- onKeydown: o[0] || (o[0] = b((...s) => e.onPressEnter && e.onPressEnter(...s), ["enter"])),
21
+ value: e.displayValue,
22
+ readonly: e.readonly || void 0,
23
+ onKeydown: o[0] || (o[0] = y((...s) => e.onPressEnter && e.onPressEnter(...s), ["enter"])),
27
24
  onInput: o[1] || (o[1] = (...s) => e.onChange && e.onChange(...s)),
28
25
  onFocus: o[2] || (o[2] = (...s) => e.onFocus && e.onFocus(...s)),
29
26
  onBlur: o[3] || (o[3] = (...s) => e.onBlur && e.onBlur(...s))
@@ -32,7 +29,7 @@ function I(e, o, g, $, B, F) {
32
29
  a("div", {
33
30
  class: l(e.className.element("suffix"))
34
31
  }, [
35
- e.allowClear && !e.mergedDisabled && e.displayValue ? (n(), d(u, {
32
+ e.allowClear && !e.mergedDisabled && e.displayValue ? (n(), p(f, {
36
33
  key: 0,
37
34
  as: "button",
38
35
  "aria-label": e.t("common.clearTarget", { target: e.t(e.clearTargetKey) }),
@@ -40,24 +37,24 @@ function I(e, o, g, $, B, F) {
40
37
  class: l(e.className.element("clear-icon")),
41
38
  onClick: e.onClear
42
39
  }, {
43
- default: y(() => [
44
- C(p)
40
+ default: C(() => [
41
+ b(u)
45
42
  ]),
46
43
  _: 1
47
- }, 8, ["aria-label", "prefix", "class", "onClick"])) : i("", !0),
44
+ }, 8, ["aria-label", "prefix", "class", "onClick"])) : t("", !0),
48
45
  a("span", {
49
46
  class: l(e.className.element("suffix-icon"))
50
47
  }, [
51
- m(e.$slots, "suffix-icon")
48
+ d(e.$slots, "suffix-icon")
52
49
  ], 2),
53
- e.feedback ? (n(), d(f, {
50
+ e.feedback ? (n(), p(c, {
54
51
  key: 1,
55
52
  type: e.feedback
56
- }, null, 8, ["type"])) : i("", !0)
53
+ }, null, 8, ["type"])) : t("", !0)
57
54
  ], 2)
58
- ], 2);
55
+ ], 16);
59
56
  }
60
- const D = /* @__PURE__ */ N(c, [["render", I]]);
57
+ const D = /* @__PURE__ */ N(k, [["render", I]]);
61
58
  export {
62
59
  D as default
63
60
  };
@@ -1,18 +1,22 @@
1
- import { defineComponent as C, toRefs as z, computed as i, ref as B } from "vue";
2
- import { isDayjs as F, isFunction as k } from "../../../_utils/is.js";
3
- import x from "../../../icons/default/close-circle-fill.js";
4
- import D from "../icon-hover/index.vue.js";
5
- import { useFormItem as N } from "../../../_hooks/use-form-item.js";
6
- import { useLocale as _ } from "../../../locale/index.js";
7
- import { useSize as j } from "../../../_hooks/use-size.js";
8
- import E from "../feedback-icon/index.vue.js";
9
- import { getClassNameMixin as q } from "../../../_utils/config.js";
10
- const $ = C({
1
+ import { defineComponent as j, toRefs as x, computed as a, ref as A } from "vue";
2
+ import { isDayjs as E, isFunction as k } from "../../../_utils/is.js";
3
+ import O from "../../../icons/default/close-circle-fill.js";
4
+ import _ from "../icon-hover/index.vue.js";
5
+ import { useFormItem as D, useFormItemControl as T } from "../../../_hooks/use-form-item.js";
6
+ import { useLocale as w } from "../../../locale/index.js";
7
+ import { useSize as P } from "../../../_hooks/use-size.js";
8
+ import { INPUT_EVENTS as m } from "../../../_utils/constant.js";
9
+ import W from "../../../_utils/pick.js";
10
+ import { omit as q } from "../../../_utils/omit.js";
11
+ import H from "../feedback-icon/index.vue.js";
12
+ import { getClassNameMixin as K } from "../../../_utils/config.js";
13
+ const re = j({
11
14
  name: "DateInput",
15
+ inheritAttrs: !1,
12
16
  components: {
13
- IconHover: D,
14
- IconClose: x,
15
- FeedbackIcon: E
17
+ IconHover: _,
18
+ IconClose: O,
19
+ FeedbackIcon: H
16
20
  },
17
21
  props: {
18
22
  size: {
@@ -55,48 +59,59 @@ const $ = C({
55
59
  }
56
60
  },
57
61
  emits: ["clear", "press-enter", "change", "focus", "blur"],
58
- setup(l, { emit: s, slots: u }) {
59
- const { t: f } = _(), { error: c, focused: m, disabled: p, size: d, value: o, format: n, inputValue: t } = z(l), {
60
- mergedSize: g,
61
- mergedDisabled: a,
62
- mergedError: v,
62
+ setup(f, { emit: s, slots: c, attrs: i }) {
63
+ const { t: u } = w(), { error: p, focused: d, disabled: g, size: v, value: o, format: n, inputValue: t } = x(f), {
64
+ formItemCtx: b,
65
+ mergedSize: h,
66
+ mergedDisabled: l,
67
+ mergedError: I,
63
68
  feedback: y
64
- } = N({ size: d, disabled: p, error: c }), { mergedSize: b } = j(g), e = q("picker"), h = i(() => [
65
- e.block,
66
- e.modifier(`size-${b.value}`),
69
+ } = D({ size: v, disabled: g, error: p }), { mergedSize: C } = P(h), S = a(() => q(i, [
70
+ ...m,
71
+ ...Object.keys(i).filter((e) => e.startsWith("aria-") || e === "role")
72
+ ])), z = T(b, () => ({
73
+ ...W(i, m),
74
+ ...Object.fromEntries(
75
+ Object.entries(i).filter(([e]) => e.startsWith("aria-") || e === "role")
76
+ )
77
+ })), r = K("picker"), F = a(() => [
78
+ r.block,
79
+ r.modifier(`size-${C.value}`),
67
80
  {
68
- [e.modifier("focused")]: m.value,
69
- [e.modifier("disabled")]: a.value,
70
- [e.modifier("error")]: v.value,
71
- [e.modifier("has-prefix")]: u.prefix
81
+ [r.modifier("focused")]: d.value,
82
+ [r.modifier("disabled")]: l.value,
83
+ [r.modifier("error")]: I.value,
84
+ [r.modifier("has-prefix")]: c.prefix
72
85
  }
73
- ]), I = i(() => {
86
+ ]), N = a(() => {
74
87
  if (t != null && t.value) return t == null ? void 0 : t.value;
75
- if (o != null && o.value && F(o.value))
88
+ if (o != null && o.value && E(o.value))
76
89
  return k(n.value) ? n.value(o.value) : o.value.format(n.value);
77
- }), S = B();
90
+ }), B = A();
78
91
  return {
79
- t: f,
92
+ wrapperAttrs: S,
93
+ formControlAttrs: z,
94
+ t: u,
80
95
  feedback: y,
81
- className: e,
82
- classNames: h,
83
- displayValue: I,
84
- mergedDisabled: a,
85
- refInput: S,
96
+ className: r,
97
+ classNames: F,
98
+ displayValue: N,
99
+ mergedDisabled: l,
100
+ refInput: B,
86
101
  onPressEnter() {
87
102
  s("press-enter");
88
103
  },
89
- onChange(r) {
90
- s("change", r);
104
+ onChange(e) {
105
+ s("change", e);
91
106
  },
92
- onFocus(r) {
93
- s("focus", r);
107
+ onFocus(e) {
108
+ s("focus", e);
94
109
  },
95
- onClear(r) {
96
- s("clear", r);
110
+ onClear(e) {
111
+ s("clear", e);
97
112
  },
98
- onBlur(r) {
99
- s("blur", r);
113
+ onBlur(e) {
114
+ s("blur", e);
100
115
  }
101
116
  };
102
117
  },
@@ -110,5 +125,5 @@ const $ = C({
110
125
  }
111
126
  });
112
127
  export {
113
- $ as default
128
+ re as default
114
129
  };
@@ -1,18 +1,18 @@
1
- import { defineComponent as E, toRefs as I, ref as K, computed as i, watch as L, createVNode as o, Fragment as H } from "vue";
2
- import { isArray as M } from "../../../_utils/is.js";
3
- import P from "../feedback-icon/index.vue.js";
4
- import q from "../input-label/input-label.js";
5
- import { InputTag as O } from "../../form-input-tag/index.js";
6
- import _ from "../icon-hover/index.vue.js";
7
- import $ from "../../../icons/_self/down.js";
8
- import G from "../../../icons/animation/animation-loading.js";
9
- import J from "../../../icons/default/close.js";
10
- import Q from "../../../icons/_self/search.js";
11
- import { useFormItem as U } from "../../../_hooks/use-form-item.js";
12
- import { useLocale as W } from "../../../locale/index.js";
13
- import { useSize as X } from "../../../_hooks/use-size.js";
14
- import { getClassNameMixin as Y } from "../../../_utils/config.js";
15
- const pe = /* @__PURE__ */ E({
1
+ import { defineComponent as E, toRefs as H, ref as B, computed as i, createVNode as o, Fragment as M } from "vue";
2
+ import { isArray as P } from "../../../_utils/is.js";
3
+ import q from "../feedback-icon/index.vue.js";
4
+ import O from "../input-label/input-label.js";
5
+ import { InputTag as _ } from "../../form-input-tag/index.js";
6
+ import $ from "../icon-hover/index.vue.js";
7
+ import G from "../../../icons/_self/down.js";
8
+ import J from "../../../icons/animation/animation-loading.js";
9
+ import Q from "../../../icons/default/close.js";
10
+ import U from "../../../icons/_self/search.js";
11
+ import { useFormItem as W, useFormItemControl as X } from "../../../_hooks/use-form-item.js";
12
+ import { useLocale as Y } from "../../../locale/index.js";
13
+ import { useSize as Z } from "../../../_hooks/use-size.js";
14
+ import { getClassNameMixin as ee } from "../../../_utils/config.js";
15
+ const be = /* @__PURE__ */ E({
16
16
  name: "SelectView",
17
17
  props: {
18
18
  modelValue: {
@@ -58,7 +58,7 @@ const pe = /* @__PURE__ */ E({
58
58
  },
59
59
  allowSearch: {
60
60
  type: Boolean,
61
- default: (e) => M(e.modelValue)
61
+ default: (e) => P(e.modelValue)
62
62
  },
63
63
  maxTagCount: {
64
64
  type: Number,
@@ -87,84 +87,79 @@ const pe = /* @__PURE__ */ E({
87
87
  slots: n
88
88
  }) {
89
89
  const {
90
- size: B,
91
- disabled: S,
92
- error: x
93
- } = I(e), u = Y("select--view"), {
90
+ size: S,
91
+ disabled: x,
92
+ error: F
93
+ } = H(e), u = ee("select--view"), {
94
+ formItemCtx: R,
94
95
  feedback: p,
95
96
  eventHandlers: c,
96
97
  mergedDisabled: g,
97
- mergedSize: R,
98
+ mergedSize: z,
98
99
  mergedError: b
99
- } = U({
100
- size: B,
101
- disabled: S,
102
- error: x
103
- }), {
104
- t: F
105
- } = W(), {
100
+ } = W({
101
+ size: S,
102
+ disabled: x,
103
+ error: F
104
+ }), v = X(R, () => e.inputAttrs ?? {}), {
105
+ t: A
106
+ } = Y(), {
106
107
  mergedSize: h
107
- } = X(R), {
108
- opened: z
109
- } = I(e), f = K(), d = i(
108
+ } = Z(z), d = B(!1), f = B(), k = i(
110
109
  // @ts-ignore
111
110
  () => {
112
111
  var l;
113
112
  return (l = f.value) == null ? void 0 : l.inputRef;
114
113
  }
115
- ), A = i(() => e.modelValue.length === 0), N = i(() => e.allowSearch || e.allowCreate), k = i(() => e.allowClear && !e.disabled && !A.value && e.modelValue.some((l) => l.closable !== !1)), m = (l) => {
114
+ ), N = i(() => e.modelValue.length === 0), T = i(() => e.allowSearch || e.allowCreate), j = i(() => e.allowClear && !e.disabled && !N.value && e.modelValue.some((l) => l.closable !== !1)), m = (l) => {
116
115
  var a, t;
117
- r("focus", l), (t = (a = c.value) == null ? void 0 : a.onFocus) == null || t.call(a, l);
116
+ d.value = !0, r("focus", l), (t = (a = c.value) == null ? void 0 : a.onFocus) == null || t.call(a, l);
118
117
  }, s = (l) => {
119
118
  var a, t;
120
- r("blur", l), (t = (a = c.value) == null ? void 0 : a.onBlur) == null || t.call(a, l);
121
- }, T = (l) => {
119
+ d.value = !1, r("blur", l), (t = (a = c.value) == null ? void 0 : a.onBlur) == null || t.call(a, l);
120
+ }, D = (l) => {
122
121
  r("remove", String(l));
123
- }, j = (l) => {
122
+ }, K = (l) => {
124
123
  l.stopPropagation(), r("clear", l);
125
- }, v = (l, a) => {
126
- var t, C;
127
- r("inputValueChange", l, a), (C = (t = c.value) == null ? void 0 : t.onInput) == null || C.call(t, a);
128
- }, w = (l) => {
124
+ }, w = (l, a) => {
125
+ var t, I;
126
+ r("inputValueChange", l, a), (I = (t = c.value) == null ? void 0 : t.onInput) == null || I.call(t, a);
127
+ }, C = (l) => {
129
128
  r("keydown", l);
130
- }, D = () => {
129
+ }, L = () => {
131
130
  var l, a;
132
- return e.loading ? ((l = n["loading-icon"]) == null ? void 0 : l.call(n)) ?? o(G, null, null) : e.allowSearch && e.opened ? ((a = n["search-icon"]) == null ? void 0 : a.call(n)) ?? o(Q, null, null) : n["arrow-icon"] ? n["arrow-icon"]() : o($, {
131
+ return e.loading ? ((l = n["loading-icon"]) == null ? void 0 : l.call(n)) ?? o(J, null, null) : e.allowSearch && e.opened ? ((a = n["search-icon"]) == null ? void 0 : a.call(n)) ?? o(U, null, null) : n["arrow-icon"] ? n["arrow-icon"]() : o(G, {
133
132
  class: u.element("arrow-icon")
134
133
  }, null);
135
- }, V = () => o(H, null, [k.value && o(_, {
134
+ }, V = () => o(M, null, [j.value && o($, {
136
135
  as: "button",
137
- "aria-label": F("common.clearTarget", {
136
+ "aria-label": A("common.clearTarget", {
138
137
  target: "选择"
139
138
  }),
140
139
  class: u.element("clear-btn"),
141
- onClick: j,
140
+ onClick: K,
142
141
  onMousedown: (l) => l.stopPropagation()
143
142
  }, {
144
- default: () => [o(J, null, null)]
143
+ default: () => [o(Q, null, null)]
145
144
  }), o("span", {
146
145
  class: u.element("icon")
147
- }, [D()]), !!p.value && o(P, {
146
+ }, [L()]), !!p.value && o(q, {
148
147
  type: p.value
149
- }, null)]);
150
- L(z, (l) => {
151
- !l && d.value && d.value.isSameNode(document.activeElement) && d.value.blur();
152
- });
153
- const y = i(() => [u.modifier(`${e.multiple ? "multiple" : "single"}`), {
148
+ }, null)]), y = i(() => [u.modifier(`${e.multiple ? "multiple" : "single"}`), {
154
149
  [u.modifier("opened")]: e.opened,
155
150
  [u.modifier("borderless")]: !e.bordered
156
151
  }]);
157
152
  return {
158
- inputRef: d,
153
+ inputRef: k,
159
154
  handleFocus: m,
160
155
  handleBlur: s,
161
- render: () => e.multiple ? o(O, {
156
+ render: () => e.multiple ? o(_, {
162
157
  ref: f,
163
158
  baseCls: u.block,
164
159
  class: y.value,
165
160
  modelValue: e.modelValue,
166
161
  inputValue: e.inputValue,
167
- focused: e.opened,
162
+ focused: e.opened || d.value,
168
163
  placeholder: e.placeholder,
169
164
  disabled: g.value,
170
165
  size: h.value,
@@ -173,33 +168,33 @@ const pe = /* @__PURE__ */ E({
173
168
  disabledInput: !e.allowSearch && !e.allowCreate,
174
169
  tagNowrap: e.tagNowrap,
175
170
  retainInputValue: !0,
176
- inputAttrs: e.inputAttrs,
171
+ inputAttrs: v.value,
177
172
  uninjectFormItemContext: !0,
178
- onRemove: T,
179
- onInputValueChange: v,
180
- onKeydown: w,
173
+ onRemove: D,
174
+ onInputValueChange: w,
175
+ onKeydown: C,
181
176
  onFocus: m,
182
177
  onBlur: s
183
178
  }, {
184
179
  prefix: n.prefix,
185
180
  suffix: V,
186
181
  tag: n.label
187
- }) : o(q, {
182
+ }) : o(O, {
188
183
  ref: f,
189
184
  baseCls: u.block,
190
185
  class: y.value,
191
186
  modelValue: e.modelValue[0],
192
187
  inputValue: e.inputValue,
193
- focused: e.opened,
188
+ focused: e.opened || d.value,
194
189
  placeholder: e.placeholder,
195
190
  disabled: g.value,
196
191
  size: h.value,
197
192
  error: b.value,
198
- enabledInput: N.value,
199
- inputAttrs: e.inputAttrs,
193
+ enabledInput: T.value,
194
+ inputAttrs: v.value,
200
195
  uninjectFormItemContext: !0,
201
- onInputValueChange: v,
202
- onKeydown: w,
196
+ onInputValueChange: w,
197
+ onKeydown: C,
203
198
  onFocus: m,
204
199
  onBlur: s
205
200
  }, {
@@ -222,5 +217,5 @@ const pe = /* @__PURE__ */ E({
222
217
  }
223
218
  });
224
219
  export {
225
- pe as default
220
+ be as default
226
221
  };