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,16 +1,17 @@
1
- import { defineComponent as K, toRefs as P, ref as V, inject as T, computed as r, watch as N, watchEffect as U, createVNode as c, nextTick as X } from "vue";
2
- import w from "../_components/icon-hover/index.vue.js";
3
- import C from "./icon-check.js";
4
- import { isArray as v, isUndefined as _, isNull as $ } from "../../_utils/is.js";
5
- import { checkboxGroupKey as q } from "./context.js";
6
- import { useFormItem as J } from "../../_hooks/use-form-item.js";
7
- import { getClassNameMixin as L } from "../../_utils/config.js";
8
- import { useSize as O } from "../../_hooks/use-size.js";
9
- const le = /* @__PURE__ */ K({
1
+ import { defineComponent as W, toRefs as X, ref as A, inject as _, computed as s, watch as C, watchEffect as $, createVNode as c, mergeProps as I, nextTick as J } from "vue";
2
+ import j from "../_components/icon-hover/index.vue.js";
3
+ import p from "./icon-check.js";
4
+ import { isArray as h, isUndefined as L, isNull as Q } from "../../_utils/is.js";
5
+ import { checkboxGroupKey as Y } from "./context.js";
6
+ import { useFormItem as Z, useFormItemControl as x } from "../../_hooks/use-form-item.js";
7
+ import { getClassNameMixin as G } from "../../_utils/config.js";
8
+ import { useSize as ee } from "../../_hooks/use-size.js";
9
+ const ae = /* @__PURE__ */ new Set(["id", "name", "required", "form", "tabindex", "tabIndex", "autofocus", "autoFocus", "autocomplete", "autoComplete"]), F = (t) => ae.has(t) || t.startsWith("aria-"), ce = /* @__PURE__ */ W({
10
10
  name: "Checkbox",
11
+ inheritAttrs: !1,
11
12
  components: {
12
- IconCheck: C,
13
- IconHover: w
13
+ IconCheck: p,
14
+ IconHover: j
14
15
  },
15
16
  props: {
16
17
  /**
@@ -68,14 +69,14 @@ const le = /* @__PURE__ */ K({
68
69
  }
69
70
  },
70
71
  emits: {
71
- "update:modelValue": (n) => !0,
72
+ "update:modelValue": (t) => !0,
72
73
  /**
73
74
  * @zh 值改变时触发
74
75
  * @en Trigger when the value changes
75
76
  * @param { boolean | CheckboxValueList } value
76
77
  * @param {Event} ev
77
78
  */
78
- change: (n, h) => !0
79
+ change: (t, g) => !0
79
80
  },
80
81
  /**
81
82
  * @zh 自定义复选框
@@ -85,92 +86,95 @@ const le = /* @__PURE__ */ K({
85
86
  * @binding {boolean} disabled
86
87
  * @version 2.18.0
87
88
  */
88
- setup(n, {
89
- emit: h,
90
- slots: g
89
+ setup(t, {
90
+ emit: g,
91
+ slots: b,
92
+ attrs: f
91
93
  }) {
92
94
  const {
93
- disabled: F,
94
- modelValue: j,
95
- size: A
96
- } = P(n), i = L("checkbox"), t = V(), a = n.uninjectGroupContext ? void 0 : T(q, void 0), b = (a == null ? void 0 : a.name) === "XCheckboxGroup", {
97
- mergedDisabled: k,
98
- mergedSize: I,
99
- eventHandlers: y
100
- } = J({
101
- disabled: F,
102
- size: A
103
- }), {
104
- mergedSize: M
105
- } = O(I), s = V(n.defaultChecked), o = r(() => b ? a == null ? void 0 : a.computedValue : n.modelValue ?? s.value), u = r(() => v(o.value) ? o.value.includes(n.value ?? !0) : o.value), m = r(() => (a == null ? void 0 : a.disabled) || (k == null ? void 0 : k.value) || !u.value && (a == null ? void 0 : a.isMaxed)), B = r(() => (a == null ? void 0 : a.size) ?? M.value), p = (l) => {
106
- l.stopPropagation();
107
- }, H = (l) => {
108
- var f, S;
95
+ disabled: N,
96
+ modelValue: w,
97
+ size: O
98
+ } = X(t), i = G("checkbox"), u = A(), l = t.uninjectGroupContext ? void 0 : _(Y, void 0), k = (l == null ? void 0 : l.name) === "XCheckboxGroup", {
99
+ formItemCtx: E,
100
+ mergedDisabled: y,
101
+ mergedSize: M,
102
+ eventHandlers: z
103
+ } = Z({
104
+ disabled: N,
105
+ size: O
106
+ }), H = x(k ? {} : E, () => Object.fromEntries(Object.entries(f).filter(([e]) => F(e)))), P = s(() => Object.fromEntries(Object.entries(f).filter(([e]) => e !== "class" && e !== "style" && !F(e)))), {
107
+ mergedSize: R
108
+ } = ee(M), r = A(t.defaultChecked), o = s(() => k ? l == null ? void 0 : l.computedValue : t.modelValue ?? r.value), d = s(() => h(o.value) ? o.value.includes(t.value ?? !0) : o.value), m = s(() => (l == null ? void 0 : l.disabled) || (y == null ? void 0 : y.value) || !d.value && (l == null ? void 0 : l.isMaxed)), B = s(() => (l == null ? void 0 : l.size) ?? R.value), q = (e) => {
109
+ e.stopPropagation();
110
+ }, D = (e) => {
111
+ var v, V;
109
112
  const {
110
- checked: e
111
- } = l.target;
112
- let d = e;
113
- if (v(o.value)) {
114
- const z = new Set(o.value);
115
- e ? z.add(n.value ?? !0) : z.delete(n.value ?? !0), d = Array.from(z);
113
+ checked: a
114
+ } = e.target;
115
+ let n = a;
116
+ if (h(o.value)) {
117
+ const S = new Set(o.value);
118
+ a ? S.add(t.value ?? !0) : S.delete(t.value ?? !0), n = Array.from(S);
116
119
  }
117
- s.value = e, b && v(d) ? a == null || a.handleChange(d, l) : (h("update:modelValue", d), h("change", d, l), (S = (f = y.value) == null ? void 0 : f.onChange) == null || S.call(f, l)), X(() => {
118
- t.value && t.value.checked !== u.value && (t.value.checked = u.value);
120
+ r.value = a, k && h(n) ? l == null || l.handleChange(n, e) : (g("update:modelValue", n), g("change", n, e), (V = (v = z.value) == null ? void 0 : v.onChange) == null || V.call(v, e)), J(() => {
121
+ u.value && u.value.checked !== d.value && (u.value.checked = d.value);
119
122
  });
120
- }, R = r(() => [i.block, i.modifier(`size-${B.value}`), {
121
- [i.modifier("checked")]: u.value,
122
- [i.modifier("indeterminate")]: n.indeterminate,
123
+ }, K = s(() => [i.block, i.modifier(`size-${B.value}`), {
124
+ [i.modifier("checked")]: d.value,
125
+ [i.modifier("indeterminate")]: t.indeterminate,
123
126
  [i.modifier("disabled")]: m.value
124
- }]), D = (l) => {
125
- var e, d;
126
- (d = (e = y.value) == null ? void 0 : e.onFocus) == null || d.call(e, l);
127
- }, E = (l) => {
128
- var e, d;
129
- (d = (e = y.value) == null ? void 0 : e.onBlur) == null || d.call(e, l);
127
+ }]), T = (e) => {
128
+ var a, n;
129
+ (n = (a = z.value) == null ? void 0 : a.onFocus) == null || n.call(a, e);
130
+ }, U = (e) => {
131
+ var a, n;
132
+ (n = (a = z.value) == null ? void 0 : a.onBlur) == null || n.call(a, e);
130
133
  };
131
- return N(j, (l) => {
132
- (_(l) || $(l)) && (s.value = !1);
133
- }), N(o, (l) => {
134
- let e;
135
- v(l) ? e = l.includes(n.value ?? !0) : e = l, s.value !== e && (s.value = e), t.value && t.value.checked !== e && (t.value.checked = e);
136
- }), U(() => {
137
- t.value && (t.value.indeterminate = n.indeterminate);
134
+ return C(w, (e) => {
135
+ (L(e) || Q(e)) && (r.value = !1);
136
+ }), C(o, (e) => {
137
+ let a;
138
+ h(e) ? a = e.includes(t.value ?? !0) : a = e, r.value !== a && (r.value = a), u.value && u.value.checked !== a && (u.value.checked = a);
139
+ }), $(() => {
140
+ u.value && (u.value.indeterminate = t.indeterminate);
138
141
  }), () => {
139
- var l, e;
140
- return c("label", {
142
+ var e, a;
143
+ return c("label", I(P.value, {
141
144
  "aria-disabled": m.value,
142
- class: R.value
143
- }, [c("input", {
144
- ref: t,
145
+ class: [K.value, f.class],
146
+ style: f.style
147
+ }), [c("input", I(H.value, {
148
+ ref: u,
145
149
  type: "checkbox",
146
- checked: u.value,
147
- "aria-checked": n.indeterminate ? "mixed" : u.value,
148
- value: n.value,
150
+ checked: d.value,
151
+ "aria-checked": t.indeterminate ? "mixed" : d.value,
152
+ value: t.value,
149
153
  class: i.modifier("target"),
150
154
  disabled: m.value,
151
- onClick: p,
152
- onChange: H,
153
- onFocus: D,
154
- onBlur: E
155
- }, null), ((e = g.checkbox ?? ((l = a == null ? void 0 : a.slots) == null ? void 0 : l.checkbox)) == null ? void 0 : e({
156
- checked: u.value,
155
+ onClick: q,
156
+ onChange: D,
157
+ onFocus: T,
158
+ onBlur: U
159
+ }), null), ((a = b.checkbox ?? ((e = l == null ? void 0 : l.slots) == null ? void 0 : e.checkbox)) == null ? void 0 : a({
160
+ checked: d.value,
157
161
  disabled: m.value
158
- })) ?? c(w, {
162
+ })) ?? c(j, {
159
163
  class: i.modifier("icon-hover"),
160
164
  size: B.value,
161
- disabled: m.value || u.value
165
+ disabled: m.value || d.value
162
166
  }, {
163
167
  default: () => [c("div", {
164
168
  class: i.modifier("icon")
165
- }, [u.value && c(C, {
169
+ }, [d.value && c(p, {
166
170
  class: i.modifier("icon-check")
167
171
  }, null)])]
168
- }), g.default && c("span", {
172
+ }), b.default && c("span", {
169
173
  class: i.element("label")
170
- }, [g.default()])]);
174
+ }, [b.default()])]);
171
175
  };
172
176
  }
173
177
  });
174
178
  export {
175
- le as default
179
+ ce as default
176
180
  };
@@ -1,11 +1,11 @@
1
- import { defineComponent as V, toRefs as S, ref as p, computed as d, provide as N, reactive as A, watch as G, createVNode as v } from "vue";
2
- import { checkboxGroupKey as $ } from "./context.js";
3
- import { useFormItem as _ } from "../../_hooks/use-form-item.js";
4
- import B from "./Checkbox.js";
5
- import { isArray as b, isString as F, isNumber as M, isBoolean as w, isFunction as D } from "../../_utils/is.js";
6
- import { getClassNameMixin as H } from "../../_utils/config.js";
7
- import { useSize as I } from "../../_hooks/use-size.js";
8
- const L = /* @__PURE__ */ V({
1
+ import { defineComponent as A, toRefs as N, ref as G, computed as d, provide as $, reactive as F, watch as I, createVNode as v, mergeProps as _ } from "vue";
2
+ import { checkboxGroupKey as B } from "./context.js";
3
+ import { useFormItem as M, useFormItemControl as w } from "../../_hooks/use-form-item.js";
4
+ import D from "./Checkbox.js";
5
+ import { isArray as b, isString as H, isNumber as K, isBoolean as O, isFunction as P } from "../../_utils/is.js";
6
+ import { getClassNameMixin as R } from "../../_utils/config.js";
7
+ import { useSize as X } from "../../_hooks/use-size.js";
8
+ const W = /* @__PURE__ */ A({
9
9
  name: "CheckboxGroup",
10
10
  props: {
11
11
  /**
@@ -93,61 +93,66 @@ const L = /* @__PURE__ */ V({
93
93
  */
94
94
  setup(a, {
95
95
  emit: n,
96
- slots: l
96
+ slots: l,
97
+ attrs: g
97
98
  }) {
98
99
  const {
99
100
  disabled: h,
100
- size: g
101
- } = S(a), i = H("checkbox--group"), {
102
- mergedDisabled: y,
103
- mergedSize: x,
104
- eventHandlers: k
105
- } = _({
101
+ size: y
102
+ } = N(a), m = R("checkbox--group"), {
103
+ formItemCtx: x,
104
+ mergedDisabled: C,
105
+ mergedSize: k,
106
+ eventHandlers: p
107
+ } = M({
106
108
  disabled: h,
107
- size: g
109
+ size: y
110
+ }), z = w(x, () => g, {
111
+ labelable: !1
108
112
  }), {
109
- mergedSize: c
110
- } = I(x), u = p(a.defaultValue), m = d(() => b(a.modelValue) ? a.modelValue : u.value), o = d(() => a.max === void 0 ? !1 : m.value.length >= a.max), s = d(() => (a.options ?? []).map((e) => F(e) || M(e) || w(e) ? {
113
+ mergedSize: o
114
+ } = X(k), r = G(a.defaultValue), i = d(() => b(a.modelValue) ? a.modelValue : r.value), c = d(() => a.max === void 0 ? !1 : i.value.length >= a.max), s = d(() => (a.options ?? []).map((e) => H(e) || K(e) || O(e) ? {
111
115
  label: e,
112
116
  value: e
113
117
  } : e));
114
- N($, A({
118
+ $(B, F({
115
119
  name: "XCheckboxGroup",
116
- computedValue: m,
117
- size: c,
118
- disabled: y,
119
- isMaxed: o,
120
+ computedValue: i,
121
+ size: o,
122
+ disabled: C,
123
+ isMaxed: c,
120
124
  slots: l,
121
- handleChange: (e, r) => {
122
- var t, f;
123
- u.value = e, n("update:modelValue", e), n("change", e, r), (f = (t = k.value) == null ? void 0 : t.onChange) == null || f.call(t, r);
125
+ handleChange: (e, t) => {
126
+ var u, f;
127
+ r.value = e, n("update:modelValue", e), n("change", e, t), (f = (u = p.value) == null ? void 0 : u.onChange) == null || f.call(u, t);
124
128
  }
125
129
  }));
126
- const z = d(() => [i.block, i.modifier(`size-${c.value}`), i.modifier(`direction-${a.direction}`)]);
127
- G(() => a.modelValue, (e) => {
128
- b(e) ? u.value = [...e] : u.value = [];
130
+ const V = d(() => [m.block, m.modifier(`size-${o.value}`), m.modifier(`direction-${a.direction}`)]);
131
+ I(() => a.modelValue, (e) => {
132
+ b(e) ? r.value = [...e] : r.value = [];
129
133
  });
130
- const C = () => s.value.map((e) => {
131
- const r = m.value.includes(e.value);
132
- return v(B, {
134
+ const S = () => s.value.map((e) => {
135
+ const t = i.value.includes(e.value);
136
+ return v(D, {
133
137
  key: `${typeof e.value}-${String(e.value)}`,
134
138
  value: e.value,
135
- disabled: e.disabled || !r && o.value,
139
+ disabled: e.disabled || !t && c.value,
136
140
  indeterminate: e.indeterminate
137
141
  }, {
138
142
  default: () => [l.label ? l.label({
139
143
  data: e
140
- }) : D(e.label) ? e.label() : e.label]
144
+ }) : P(e.label) ? e.label() : e.label]
141
145
  });
142
146
  });
143
147
  return () => {
144
148
  var e;
145
- return v("span", {
146
- class: z.value
147
- }, [s.value.length > 0 ? C() : (e = l.default) == null ? void 0 : e.call(l)]);
149
+ return v("span", _(z.value, {
150
+ role: "group",
151
+ class: V.value
152
+ }), [s.value.length > 0 ? S() : (e = l.default) == null ? void 0 : e.call(l)]);
148
153
  };
149
154
  }
150
155
  });
151
156
  export {
152
- L as default
157
+ W as default
153
158
  };
@@ -1,18 +1,18 @@
1
- import { defineComponent as ie, toRefs as se, ref as h, computed as r, watch as ce, createVNode as i, mergeProps as z, createTextVNode as de, nextTick as fe } from "vue";
1
+ import { defineComponent as ce, toRefs as de, ref as h, computed as r, watch as fe, createVNode as i, mergeProps as F, createTextVNode as me, nextTick as ve } from "vue";
2
2
  import { INPUT_EVENTS as R } from "../../_utils/constant.js";
3
- import me from "../_components/feedback-icon/index.vue.js";
4
- import { Enter as ve } from "../../_utils/keycode.js";
5
- import pe from "../_components/icon-hover/index.vue.js";
6
- import he from "../../icons/default/close.js";
3
+ import pe from "../_components/feedback-icon/index.vue.js";
4
+ import { Enter as he } from "../../_utils/keycode.js";
5
+ import ge from "../_components/icon-hover/index.vue.js";
6
+ import ye from "../../icons/default/close.js";
7
7
  import { omit as j } from "../../_utils/omit.js";
8
- import ge from "../../_utils/pick.js";
9
- import { isUndefined as ye, isNull as xe, isObject as F, isFunction as Ce } from "../../_utils/is.js";
10
- import { useFormItem as be } from "../../_hooks/use-form-item.js";
11
- import { useLocale as Le } from "../../locale/index.js";
12
- import { useSize as we } from "../../_hooks/use-size.js";
13
- import { useCursor as Be } from "../../_hooks/use-cursor.js";
14
- import { getClassNameMixin as Ve } from "../../_utils/config.js";
15
- const Pe = /* @__PURE__ */ ie({
8
+ import xe from "../../_utils/pick.js";
9
+ import { isUndefined as Ce, isNull as be, isObject as z, isFunction as Le } from "../../_utils/is.js";
10
+ import { useFormItem as we, useFormItemControl as Be } from "../../_hooks/use-form-item.js";
11
+ import { useLocale as Ie } from "../../locale/index.js";
12
+ import { useSize as Ve } from "../../_hooks/use-size.js";
13
+ import { useCursor as Se } from "../../_hooks/use-cursor.js";
14
+ import { getClassNameMixin as ke } from "../../_utils/config.js";
15
+ const Ke = /* @__PURE__ */ ce({
16
16
  name: "Input",
17
17
  inheritAttrs: !1,
18
18
  props: {
@@ -191,143 +191,147 @@ const Pe = /* @__PURE__ */ ie({
191
191
  disabled: P,
192
192
  error: W,
193
193
  modelValue: H
194
- } = se(t), a = Ve("input"), d = h(), {
195
- mergedSize: K,
194
+ } = de(t), l = ke("input"), d = h(), {
195
+ formItemCtx: K,
196
+ mergedSize: U,
196
197
  mergedDisabled: g,
197
- mergedError: U,
198
+ mergedError: $,
198
199
  feedback: y,
199
200
  eventHandlers: v
200
- } = be({
201
+ } = we({
201
202
  size: D,
202
203
  disabled: P,
203
204
  error: W
204
205
  }), {
205
- t: $
206
- } = Le(), {
206
+ t: q
207
+ } = Ie(), {
207
208
  mergedSize: N
208
- } = we(K), [q, G] = Be(d), w = h(t.defaultValue), c = r(() => t.modelValue ?? w.value);
209
- ce(H, (e) => {
210
- (ye(e) || xe(e)) && (w.value = "");
209
+ } = Ve(U), [G, J] = Se(d), w = h(t.defaultValue), c = r(() => t.modelValue ?? w.value);
210
+ fe(H, (e) => {
211
+ (Ce(e) || be(e)) && (w.value = "");
211
212
  });
212
213
  let B = c.value;
213
- const V = h(!1), J = r(() => t.allowClear && !t.readonly && !g.value && !!c.value), x = h(!1), T = h(""), p = (e) => Ce(t.wordLength) ? t.wordLength(e) : e.length ?? 0, C = r(() => p(c.value)), A = r(() => U.value || !!(F(t.maxLength) && t.maxLength.errorOnly && C.value > o.value)), I = r(() => F(t.maxLength) && !!t.maxLength.errorOnly), o = r(() => F(t.maxLength) ? t.maxLength.length : t.maxLength), Q = r(() => {
214
+ const I = h(!1), Q = r(() => t.allowClear && !t.readonly && !g.value && !!c.value), x = h(!1), A = h(""), p = (e) => Le(t.wordLength) ? t.wordLength(e) : e.length ?? 0, C = r(() => p(c.value)), T = r(() => $.value || !!(z(t.maxLength) && t.maxLength.errorOnly && C.value > o.value)), V = r(() => z(t.maxLength) && !!t.maxLength.errorOnly), o = r(() => z(t.maxLength) ? t.maxLength.length : t.maxLength), X = r(() => {
214
215
  const e = p("a");
215
216
  return Math.floor(o.value / e);
216
217
  }), S = (e) => {
217
218
  var n;
218
- o.value && !I.value && p(e) > o.value && (e = ((n = t.wordSlice) == null ? void 0 : n.call(t, e, o.value)) ?? e.slice(0, Q.value)), w.value = e, s("update:modelValue", e);
219
- }, X = (e) => {
219
+ o.value && !V.value && p(e) > o.value && (e = ((n = t.wordSlice) == null ? void 0 : n.call(t, e, o.value)) ?? e.slice(0, X.value)), w.value = e, s("update:modelValue", e);
220
+ }, Y = (e) => {
220
221
  d.value && e.target !== d.value && (e.preventDefault(), d.value.focus());
221
222
  }, k = (e, n) => {
222
- var l, f;
223
- e !== B && (B = e, s("change", e, n), (f = (l = v.value) == null ? void 0 : l.onChange) == null || f.call(l, n));
224
- }, Y = (e) => {
225
- var n, l;
226
- V.value = !0, B = c.value, s("focus", e), (l = (n = v.value) == null ? void 0 : n.onFocus) == null || l.call(n, e);
223
+ var a, f;
224
+ e !== B && (B = e, s("change", e, n), (f = (a = v.value) == null ? void 0 : a.onChange) == null || f.call(a, n));
227
225
  }, Z = (e) => {
228
- var n, l;
229
- V.value = !1, k(c.value, e), s("blur", e), (l = (n = v.value) == null ? void 0 : n.onBlur) == null || l.call(n, e);
226
+ var n, a;
227
+ I.value = !0, B = c.value, s("focus", e), (a = (n = v.value) == null ? void 0 : n.onFocus) == null || a.call(n, e);
228
+ }, ee = (e) => {
229
+ var n, a;
230
+ I.value = !1, k(c.value, e), s("blur", e), (a = (n = v.value) == null ? void 0 : n.onBlur) == null || a.call(n, e);
230
231
  }, E = (e) => {
231
232
  var L, O;
232
233
  const {
233
234
  value: n,
234
- selectionStart: l,
235
+ selectionStart: a,
235
236
  selectionEnd: f
236
237
  } = e.target;
237
238
  if (e.type === "compositionend") {
238
- if (x.value = !1, T.value = "", o.value && !I.value && C.value >= o.value && p(n) > o.value && l === f) {
239
+ if (x.value = !1, A.value = "", o.value && !V.value && C.value >= o.value && p(n) > o.value && a === f) {
239
240
  b();
240
241
  return;
241
242
  }
242
243
  S(n), s("input", n, e), (O = (L = v.value) == null ? void 0 : L.onInput) == null || O.call(L, e), b();
243
244
  } else
244
- x.value = !0, T.value = c.value + (e.data ?? "");
245
+ x.value = !0, A.value = c.value + (e.data ?? "");
245
246
  }, b = () => {
246
- q(), fe(() => {
247
- d.value && c.value !== d.value.value && (d.value.value = c.value, G());
247
+ G(), ve(() => {
248
+ d.value && c.value !== d.value.value && (d.value.value = c.value, J());
248
249
  });
249
- }, ee = (e) => {
250
- var l, f;
250
+ }, te = (e) => {
251
+ var a, f;
251
252
  const {
252
253
  value: n
253
254
  } = e.target;
254
255
  if (!x.value) {
255
- if (o.value && !I.value && C.value >= o.value && p(n) > o.value && e.inputType === "insertText") {
256
+ if (o.value && !V.value && C.value >= o.value && p(n) > o.value && e.inputType === "insertText") {
256
257
  b();
257
258
  return;
258
259
  }
259
- S(n), s("input", n, e), (f = (l = v.value) == null ? void 0 : l.onInput) == null || f.call(l, e), b();
260
+ S(n), s("input", n, e), (f = (a = v.value) == null ? void 0 : a.onInput) == null || f.call(a, e), b();
260
261
  }
261
- }, te = (e) => {
262
- S(""), k("", e), s("clear", e);
263
262
  }, ne = (e) => {
263
+ var n, a;
264
+ S(""), k("", e), (a = (n = v.value) == null ? void 0 : n.onInput) == null || a.call(n, e), s("clear", e);
265
+ }, ae = (e) => {
264
266
  const n = e.key || e.code;
265
- !x.value && n === ve.key && (k(c.value, e), s("pressEnter", e));
266
- }, M = r(() => j(j(m, R), ["class", "style"])), ae = r(() => ge(m, R)), le = r(() => [a.element("outer"), m.class, a.element(`outer-size-${N.value}`), {
267
- [a.element("outer-has-suffix")]: !!u.suffix,
268
- [a.element("outer-disabled")]: g.value
269
- }]), ue = (e) => [a.element("wrapper"), !e && m.class, {
270
- [a.modifier("error")]: A.value,
271
- [a.modifier("disabled")]: g.value,
272
- [a.modifier("focus")]: V.value
273
- }], oe = r(() => [a.block, a.modifier(`size-${N.value}`)]), re = r(() => {
267
+ !x.value && n === he.key && (k(c.value, e), s("pressEnter", e));
268
+ }, M = r(() => j(j(m, R), ["class", "style"])), le = r(() => xe(m, R)), ue = r(() => [l.element("outer"), m.class, l.element(`outer-size-${N.value}`), {
269
+ [l.element("outer-has-suffix")]: !!u.suffix,
270
+ [l.element("outer-disabled")]: g.value
271
+ }]), oe = (e) => [l.element("wrapper"), !e && m.class, {
272
+ [l.modifier("error")]: T.value,
273
+ [l.modifier("disabled")]: g.value,
274
+ [l.modifier("focus")]: I.value
275
+ }], re = r(() => [l.block, l.modifier(`size-${N.value}`)]), ie = Be(K, () => ({
276
+ ...le.value,
277
+ ...t.inputAttrs
278
+ })), se = r(() => {
274
279
  const e = {
275
- ...ae.value,
276
- ...t.inputAttrs
280
+ ...ie.value
277
281
  };
278
- return A.value && (e["aria-invalid"] = !0), e;
282
+ return T.value && (e["aria-invalid"] = !0), e;
279
283
  }), _ = (e) => {
280
284
  var n;
281
- return i("span", z({
282
- class: ue(e),
285
+ return i("span", F({
286
+ class: oe(e),
283
287
  style: e ? void 0 : m.style,
284
- onMousedown: X
288
+ onMousedown: Y
285
289
  }, e ? void 0 : M.value), [u.prefix && i("span", {
286
- class: a.element("prefix")
287
- }, [u.prefix()]), i("input", z({
290
+ class: l.element("prefix")
291
+ }, [u.prefix()]), i("input", F({
288
292
  ref: d,
289
- class: oe.value,
293
+ class: re.value,
290
294
  value: c.value,
291
295
  type: t.type,
292
296
  placeholder: t.placeholder,
293
297
  readonly: t.readonly,
294
298
  disabled: g.value,
295
- onInput: ee,
296
- onKeydown: ne,
297
- onFocus: Y,
298
- onBlur: Z,
299
+ onInput: te,
300
+ onKeydown: ae,
301
+ onFocus: Z,
302
+ onBlur: ee,
299
303
  onCompositionstart: E,
300
304
  onCompositionupdate: E,
301
305
  onCompositionend: E
302
- }, re.value), null), J.value && i(pe, {
306
+ }, se.value), null), Q.value && i(ge, {
303
307
  as: "button",
304
- "aria-label": $("common.clearTarget", {
308
+ "aria-label": q("common.clearTarget", {
305
309
  target: "输入"
306
310
  }),
307
311
  prefix: "x-input",
308
- class: a.element("clear-btn"),
309
- onClick: te
312
+ class: l.element("clear-btn"),
313
+ onClick: ne
310
314
  }, {
311
- default: () => [i(he, null, null)]
315
+ default: () => [i(ye, null, null)]
312
316
  }), (u.suffix || !!t.maxLength && t.showWordLimit || !!y.value) && i("span", {
313
- class: [a.element("suffix"), {
314
- [a.element("suffix-has-feedback")]: y.value
317
+ class: [l.element("suffix"), {
318
+ [l.element("suffix-has-feedback")]: y.value
315
319
  }]
316
320
  }, [!!t.maxLength && t.showWordLimit && i("span", {
317
- class: a.element("word-limit")
318
- }, [C.value, de("/"), o.value]), (n = u.suffix) == null ? void 0 : n.call(u), !!y.value && i(me, {
321
+ class: l.element("word-limit")
322
+ }, [C.value, me("/"), o.value]), (n = u.suffix) == null ? void 0 : n.call(u), !!y.value && i(pe, {
319
323
  type: y.value
320
324
  }, null)])]);
321
325
  };
322
326
  return {
323
327
  inputRef: d,
324
- render: () => u.prepend || u.append ? i("span", z({
325
- class: le.value,
328
+ render: () => u.prepend || u.append ? i("span", F({
329
+ class: ue.value,
326
330
  style: m.style
327
331
  }, M.value), [u.prepend && i("span", {
328
- class: a.element("prepend")
332
+ class: l.element("prepend")
329
333
  }, [u.prepend()]), _(!0), u.append && i("span", {
330
- class: a.element("append")
334
+ class: l.element("append")
331
335
  }, [u.append()])]) : _()
332
336
  };
333
337
  },
@@ -356,5 +360,5 @@ const Pe = /* @__PURE__ */ ie({
356
360
  }
357
361
  });
358
362
  export {
359
- Pe as default
363
+ Ke as default
360
364
  };
@@ -1,13 +1,14 @@
1
- import u from "./InputPassword.vue2.js";
2
- import { resolveComponent as s, openBlock as i, createBlock as t, createSlots as m, withCtx as o, renderSlot as p, withModifiers as r, createCommentVNode as v } from "vue";
3
- import y from "../../_virtual/_plugin-vue_export-helper.js";
4
- function $(e, n, b, k, w, c) {
5
- const l = s("icon-eye"), d = s("icon-eye-invisible"), a = s("icon-hover"), f = s("x-input");
6
- return i(), t(f, {
1
+ import m from "./InputPassword.vue2.js";
2
+ import { resolveComponent as n, openBlock as i, createBlock as r, createSlots as u, withCtx as o, renderSlot as p, withModifiers as d, createCommentVNode as b } from "vue";
3
+ import v from "../../_virtual/_plugin-vue_export-helper.js";
4
+ function y(e, s, $, k, w, g) {
5
+ const t = n("icon-eye"), l = n("icon-eye-invisible"), a = n("icon-hover"), f = n("x-input");
6
+ return i(), r(f, {
7
7
  ref: "inputRef",
8
8
  class: "x-input-password",
9
- type: e.mergedVisible ? "text" : "password"
10
- }, m({ _: 2 }, [
9
+ type: e.mergedVisible ? "text" : "password",
10
+ disabled: e.mergedDisabled
11
+ }, u({ _: 2 }, [
11
12
  e.$slots.prepend ? {
12
13
  name: "prepend",
13
14
  fn: o(() => [
@@ -25,21 +26,23 @@ function $(e, n, b, k, w, c) {
25
26
  e.invisibleButton || e.$slots.suffix ? {
26
27
  name: "suffix",
27
28
  fn: o(() => [
28
- e.invisibleButton ? (i(), t(a, {
29
+ e.invisibleButton ? (i(), r(a, {
29
30
  key: 0,
30
31
  as: "button",
31
32
  "aria-label": e.mergedVisible ? e.t("input.hidePassword") : e.t("input.showPassword"),
33
+ disabled: e.mergedDisabled,
34
+ "aria-pressed": e.mergedVisible,
32
35
  onClick: e.handleInvisible,
33
- onMousedown: n[0] || (n[0] = r(() => {
36
+ onMousedown: s[0] || (s[0] = d(() => {
34
37
  }, ["prevent"])),
35
- onMouseup: n[1] || (n[1] = r(() => {
38
+ onMouseup: s[1] || (s[1] = d(() => {
36
39
  }, ["prevent"]))
37
40
  }, {
38
41
  default: o(() => [
39
- e.mergedVisible ? (i(), t(d, { key: 1 })) : (i(), t(l, { key: 0 }))
42
+ e.mergedVisible ? (i(), r(l, { key: 1 })) : (i(), r(t, { key: 0 }))
40
43
  ]),
41
44
  _: 1
42
- }, 8, ["aria-label", "onClick"])) : v("", !0),
45
+ }, 8, ["aria-label", "disabled", "aria-pressed", "onClick"])) : b("", !0),
43
46
  p(e.$slots, "suffix")
44
47
  ]),
45
48
  key: "2"
@@ -51,9 +54,9 @@ function $(e, n, b, k, w, c) {
51
54
  ]),
52
55
  key: "3"
53
56
  } : void 0
54
- ]), 1032, ["type"]);
57
+ ]), 1032, ["type", "disabled"]);
55
58
  }
56
- const V = /* @__PURE__ */ y(u, [["render", $]]);
59
+ const B = /* @__PURE__ */ v(m, [["render", y]]);
57
60
  export {
58
- V as default
61
+ B as default
59
62
  };