x-next 1.1.0 → 1.2.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.
- package/CHANGELOG.md +26 -0
- package/dist/_hooks/use-form-item.d.ts +5 -0
- package/dist/_hooks/use-picker-focus.d.ts +17 -0
- package/dist/components/_components/feedback-icon/index.vue.d.ts +4 -4
- package/dist/components/_components/picker/input-range.vue.d.ts +10 -6
- package/dist/components/_components/picker/input.vue.d.ts +9 -5
- package/dist/components/alert/Alert.vue.d.ts +5 -5
- package/dist/components/alert/index.d.ts +10 -10
- package/dist/components/date-picker/DatePanel.vue.d.ts +5 -0
- package/dist/components/date-picker/DatePicker.vue.d.ts +36 -16
- package/dist/components/date-picker/index.d.ts +77 -33
- package/dist/components/dialog/Dialog.d.ts +1 -1
- package/dist/components/dialog/index.d.ts +3 -3
- package/dist/components/drawer/index.d.ts +3 -3
- package/dist/components/drawer/src/Drawer.vue.d.ts +1 -1
- package/dist/components/dropdown/Dropdown.vue.d.ts +3 -3
- package/dist/components/dropdown/DropdownButton.vue.d.ts +4 -4
- package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +4 -4
- package/dist/components/dropdown/index.d.ts +22 -22
- package/dist/components/form/FormItem.vue.d.ts +12 -4
- package/dist/components/form/context.d.ts +6 -0
- package/dist/components/form/form-item-label.vue.d.ts +4 -4
- package/dist/components/form/form-item-message.vue.d.ts +2 -0
- package/dist/components/form/index.d.ts +30 -8
- package/dist/components/form/interface.d.ts +2 -2
- package/dist/components/form-input/InputPassword.vue.d.ts +20 -2
- package/dist/components/form-input/index.d.ts +22 -4
- package/dist/components/form-select/Select.d.ts +3 -3
- package/dist/components/form-select/index.d.ts +6 -6
- package/dist/components/form-slider/Slider.vue.d.ts +10 -3
- package/dist/components/form-slider/index.d.ts +26 -6
- package/dist/components/form-slider/slider-button.vue.d.ts +4 -3
- package/dist/components/form-switch/Switch.vue.d.ts +2 -1
- package/dist/components/form-switch/index.d.ts +5 -2
- package/dist/components/form-textarea/Textarea.vue.d.ts +2 -2
- package/dist/components/form-textarea/index.d.ts +5 -5
- package/dist/components/image/Image.vue.d.ts +10 -9
- package/dist/components/image/ImagePreview.vue.d.ts +8 -7
- package/dist/components/image/ImagePreviewAction.d.ts +3 -3
- package/dist/components/image/ImagePreviewGroup.vue.d.ts +8 -7
- package/dist/components/image/index.d.ts +59 -52
- package/dist/components/image/preview-arrow.vue.d.ts +2 -2
- package/dist/components/image/preview-toolbar.vue.d.ts +3 -3
- package/dist/components/layout/LayoutSidebar.vue.d.ts +2 -2
- package/dist/components/layout/index.d.ts +4 -4
- package/dist/components/link/Link.vue.d.ts +2 -2
- package/dist/components/link/index.d.ts +4 -4
- package/dist/components/menu/Menu.d.ts +2 -2
- package/dist/components/menu/base-menu.vue.d.ts +2 -2
- package/dist/components/menu/index.d.ts +4 -4
- package/dist/components/menu/sub-menu-pop.vue.d.ts +5 -5
- package/dist/components/message/index.d.ts +17 -17
- package/dist/components/message/message.vue.d.ts +8 -8
- package/dist/components/notification/Notification.d.ts +1 -1
- package/dist/components/notification/index.d.ts +3 -3
- package/dist/components/pagination/page-item-ellipsis.vue.d.ts +1 -1
- package/dist/components/pagination/page-item-step.vue.d.ts +2 -2
- package/dist/components/pagination/page-options.vue.d.ts +6 -6
- package/dist/components/popconfirm/src/popup.vue.d.ts +1 -1
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/index.d.ts +3 -3
- package/dist/components/popup/Popup.d.ts +1 -1
- package/dist/components/popup/index.d.ts +3 -3
- package/dist/components/progress/Progress.vue.d.ts +4 -4
- package/dist/components/progress/circle.vue.d.ts +2 -2
- package/dist/components/progress/index.d.ts +8 -8
- package/dist/components/progress/line.vue.d.ts +1 -1
- package/dist/components/progress/steps.vue.d.ts +1 -1
- package/dist/components/steps/Step.vue.d.ts +2 -2
- package/dist/components/steps/index.d.ts +4 -4
- package/dist/components/tabs/Tabs.d.ts +1 -1
- package/dist/components/tabs/index.d.ts +3 -3
- package/dist/components/tabs/tabs-tab.vue.d.ts +1 -1
- package/dist/components/tag/Tag.vue.d.ts +2 -2
- package/dist/components/tag/index.d.ts +4 -4
- package/dist/components/time-picker/TimeColumn.vue.d.ts +3 -0
- package/dist/components/time-picker/TimePanel.vue.d.ts +3 -0
- package/dist/components/time-picker/TimePicker.vue.d.ts +33 -17
- package/dist/components/time-picker/index.d.ts +73 -36
- package/dist/components/time-range-selector/TimeRangeSelector.vue.d.ts +8 -0
- package/dist/components/time-range-selector/index.d.ts +22 -0
- package/dist/components/tooltip/Tooltip.vue.d.ts +1 -1
- package/dist/components/tooltip/index.d.ts +3 -3
- package/dist/components/trigger/Trigger.d.ts +1 -1
- package/dist/components/trigger/index.d.ts +3 -3
- package/dist/es/_hooks/use-form-item.js +36 -10
- package/dist/es/_hooks/use-picker-focus.js +57 -0
- package/dist/es/_utils/constant.js +17 -5
- package/dist/es/components/_components/picker/input-range.vue.js +45 -55
- package/dist/es/components/_components/picker/input-range.vue2.js +105 -70
- package/dist/es/components/_components/picker/input.vue.js +22 -25
- package/dist/es/components/_components/picker/input.vue2.js +58 -43
- package/dist/es/components/_components/select-view/select-view.js +67 -66
- package/dist/es/components/date-picker/DatePanel.vue.js +102 -94
- package/dist/es/components/date-picker/DatePanel.vue2.js +97 -44
- package/dist/es/components/date-picker/DatePicker.vue.js +71 -58
- package/dist/es/components/date-picker/DatePicker.vue2.js +285 -231
- package/dist/es/components/dialog/Dialog.js +154 -132
- package/dist/es/components/form/Form.vue2.js +113 -101
- package/dist/es/components/form/FormItem.vue.js +26 -22
- package/dist/es/components/form/FormItem.vue2.js +162 -125
- package/dist/es/components/form/form-item-message.vue.js +31 -24
- package/dist/es/components/form/form-item-message.vue2.js +4 -2
- package/dist/es/components/form-checkbox/Checkbox.js +75 -71
- package/dist/es/components/form-checkbox/CheckboxGroup.js +43 -38
- package/dist/es/components/form-input/Input.js +83 -79
- package/dist/es/components/form-input/InputPassword.vue.js +19 -16
- package/dist/es/components/form-input/InputPassword.vue2.js +39 -29
- package/dist/es/components/form-input/InputSearch.js +47 -37
- package/dist/es/components/form-input-number/InputNumber.js +134 -133
- package/dist/es/components/form-input-tag/InputTag.js +173 -162
- package/dist/es/components/form-radio/Radio.js +74 -71
- package/dist/es/components/form-radio/RadioGroup.js +55 -49
- package/dist/es/components/form-select/Select.js +99 -98
- package/dist/es/components/form-slider/Slider.vue.js +28 -28
- package/dist/es/components/form-slider/Slider.vue2.js +139 -132
- package/dist/es/components/form-slider/slider-button.vue.js +6 -6
- package/dist/es/components/form-slider/slider-button.vue2.js +39 -34
- package/dist/es/components/form-switch/Switch.vue.js +9 -9
- package/dist/es/components/form-switch/Switch.vue2.js +81 -74
- package/dist/es/components/form-textarea/Textarea.vue2.js +123 -108
- package/dist/es/components/image/Image.vue2.js +77 -76
- package/dist/es/components/image/ImagePreview.vue.js +13 -12
- package/dist/es/components/image/ImagePreview.vue2.js +141 -136
- package/dist/es/components/image/ImagePreviewGroup.vue.js +1 -1
- package/dist/es/components/image/ImagePreviewGroup.vue2.js +82 -83
- package/dist/es/components/rate/Rate.js +106 -103
- package/dist/es/components/time-picker/TimeColumn.vue.js +34 -23
- package/dist/es/components/time-picker/TimeColumn.vue2.js +37 -28
- package/dist/es/components/time-picker/TimePicker.vue.js +83 -64
- package/dist/es/components/time-picker/TimePicker.vue2.js +192 -156
- package/dist/es/components/time-range-selector/TimeRangeSelector.vue.js +327 -193
- package/dist/es/locale/en-US.js +6 -0
- package/dist/es/locale/zh-CN.js +6 -0
- package/dist/es/style.css +1 -1
- package/dist/icons/_self/down.d.ts +1 -1
- package/dist/icons/_self/dropdown/more.d.ts +1 -1
- package/dist/icons/_self/empty-better.d.ts +1 -1
- package/dist/icons/_self/empty.d.ts +1 -1
- package/dist/icons/_self/eye-invisible.d.ts +1 -1
- package/dist/icons/_self/eye.d.ts +1 -1
- package/dist/icons/_self/full-screen.d.ts +1 -1
- package/dist/icons/_self/left.d.ts +1 -1
- package/dist/icons/_self/menu/down.d.ts +1 -1
- package/dist/icons/_self/minus.d.ts +1 -1
- package/dist/icons/_self/more-dot.d.ts +1 -1
- package/dist/icons/_self/next.d.ts +1 -1
- package/dist/icons/_self/original-size.d.ts +1 -1
- package/dist/icons/_self/plus.d.ts +1 -1
- package/dist/icons/_self/prev.d.ts +1 -1
- package/dist/icons/_self/question-message.d.ts +1 -1
- package/dist/icons/_self/right.d.ts +1 -1
- package/dist/icons/_self/rotate-left.d.ts +1 -1
- package/dist/icons/_self/rotate-right.d.ts +1 -1
- package/dist/icons/_self/search.d.ts +1 -1
- package/dist/icons/_self/up.d.ts +1 -1
- package/dist/icons/_self/zoom-in.d.ts +1 -1
- package/dist/icons/_self/zoom-out.d.ts +1 -1
- package/dist/icons/_ui/alone-left.d.ts +1 -1
- package/dist/icons/_ui/alone-margin-left.d.ts +1 -1
- package/dist/icons/_ui/alone-margin-right.d.ts +1 -1
- package/dist/icons/_ui/alone-right.d.ts +1 -1
- package/dist/icons/_ui/calendar.d.ts +1 -1
- package/dist/icons/_ui/time.d.ts +1 -1
- package/dist/icons/animation/animation-loading.d.ts +1 -1
- package/dist/icons/default/check-circle-fill.d.ts +1 -1
- package/dist/icons/default/check.d.ts +1 -1
- package/dist/icons/default/close-circle-fill.d.ts +1 -1
- package/dist/icons/default/close.d.ts +1 -1
- package/dist/icons/default/exclamation-circle-fill.d.ts +1 -1
- package/dist/icons/default/exclamation.d.ts +1 -1
- package/dist/icons/default/filter.d.ts +1 -1
- package/dist/icons/default/info-circle-fill.d.ts +1 -1
- package/dist/icons/default/link.d.ts +1 -1
- package/dist/icons/default/logo-simple.d.ts +1 -1
- package/dist/icons/default/minus-circle-fill.d.ts +1 -1
- package/dist/icons/icon.d.ts +2 -2
- package/dist/icons/index.d.ts +3 -3
- package/dist/index.cjs +4 -4
- package/dist/index.umd.js +4 -4
- package/dist/locale/interface.d.ts +6 -0
- package/dist/style/base.css +1 -1
- package/dist/style/date-picker.css +1 -1
- package/dist/style/form.css +1 -1
- package/dist/style/image.css +1 -1
- package/dist/style/time-range-selector.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { isArray as
|
|
5
|
-
import { checkboxGroupKey as
|
|
6
|
-
import { useFormItem as
|
|
7
|
-
import { getClassNameMixin as
|
|
8
|
-
import { useSize as
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as U, toRefs as X, ref as j, inject as _, computed as s, watch as C, watchEffect as $, createVNode as c, mergeProps as A, nextTick as q } from "vue";
|
|
2
|
+
import F from "../_components/icon-hover/index.vue.js";
|
|
3
|
+
import I from "./icon-check.js";
|
|
4
|
+
import { isArray as h, isUndefined as J, isNull as L } from "../../_utils/is.js";
|
|
5
|
+
import { checkboxGroupKey as Q } from "./context.js";
|
|
6
|
+
import { useFormItem as Y, useFormItemControl as Z } from "../../_hooks/use-form-item.js";
|
|
7
|
+
import { getClassNameMixin as G } from "../../_utils/config.js";
|
|
8
|
+
import { useSize as x } from "../../_hooks/use-size.js";
|
|
9
|
+
const oe = /* @__PURE__ */ U({
|
|
10
10
|
name: "Checkbox",
|
|
11
|
+
inheritAttrs: !1,
|
|
11
12
|
components: {
|
|
12
|
-
IconCheck:
|
|
13
|
-
IconHover:
|
|
13
|
+
IconCheck: I,
|
|
14
|
+
IconHover: F
|
|
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": (
|
|
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: (
|
|
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(
|
|
89
|
-
emit:
|
|
90
|
-
slots:
|
|
89
|
+
setup(t, {
|
|
90
|
+
emit: g,
|
|
91
|
+
slots: b,
|
|
92
|
+
attrs: f
|
|
91
93
|
}) {
|
|
92
94
|
const {
|
|
93
|
-
disabled:
|
|
94
|
-
modelValue:
|
|
95
|
-
size:
|
|
96
|
-
} =
|
|
95
|
+
disabled: N,
|
|
96
|
+
modelValue: w,
|
|
97
|
+
size: O
|
|
98
|
+
} = X(t), i = G("checkbox"), d = j(), l = t.uninjectGroupContext ? void 0 : _(Q, void 0), z = (l == null ? void 0 : l.name) === "XCheckboxGroup", {
|
|
99
|
+
formItemCtx: p,
|
|
97
100
|
mergedDisabled: k,
|
|
98
|
-
mergedSize:
|
|
101
|
+
mergedSize: E,
|
|
99
102
|
eventHandlers: y
|
|
100
|
-
} =
|
|
101
|
-
disabled:
|
|
102
|
-
size:
|
|
103
|
-
}), {
|
|
104
|
-
mergedSize:
|
|
105
|
-
} =
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
var
|
|
103
|
+
} = Y({
|
|
104
|
+
disabled: N,
|
|
105
|
+
size: O
|
|
106
|
+
}), M = Z(z ? {} : p, () => Object.fromEntries(Object.entries(f).filter(([e]) => e === "id" || e === "name" || e.startsWith("aria-")))), H = s(() => Object.fromEntries(Object.entries(f).filter(([e]) => e !== "id" && e !== "name" && e !== "class" && e !== "style" && !e.startsWith("aria-")))), {
|
|
107
|
+
mergedSize: P
|
|
108
|
+
} = x(E), r = j(t.defaultChecked), o = s(() => z ? l == null ? void 0 : l.computedValue : t.modelValue ?? r.value), u = s(() => h(o.value) ? o.value.includes(t.value ?? !0) : o.value), m = s(() => (l == null ? void 0 : l.disabled) || (k == null ? void 0 : k.value) || !u.value && (l == null ? void 0 : l.isMaxed)), S = s(() => (l == null ? void 0 : l.size) ?? P.value), R = (e) => {
|
|
109
|
+
e.stopPropagation();
|
|
110
|
+
}, W = (e) => {
|
|
111
|
+
var v, V;
|
|
109
112
|
const {
|
|
110
|
-
checked:
|
|
111
|
-
} =
|
|
112
|
-
let
|
|
113
|
-
if (
|
|
114
|
-
const
|
|
115
|
-
|
|
113
|
+
checked: a
|
|
114
|
+
} = e.target;
|
|
115
|
+
let n = a;
|
|
116
|
+
if (h(o.value)) {
|
|
117
|
+
const B = new Set(o.value);
|
|
118
|
+
a ? B.add(t.value ?? !0) : B.delete(t.value ?? !0), n = Array.from(B);
|
|
116
119
|
}
|
|
117
|
-
|
|
118
|
-
|
|
120
|
+
r.value = a, z && h(n) ? l == null || l.handleChange(n, e) : (g("update:modelValue", n), g("change", n, e), (V = (v = y.value) == null ? void 0 : v.onChange) == null || V.call(v, e)), q(() => {
|
|
121
|
+
d.value && d.value.checked !== u.value && (d.value.checked = u.value);
|
|
119
122
|
});
|
|
120
|
-
},
|
|
123
|
+
}, D = s(() => [i.block, i.modifier(`size-${S.value}`), {
|
|
121
124
|
[i.modifier("checked")]: u.value,
|
|
122
|
-
[i.modifier("indeterminate")]:
|
|
125
|
+
[i.modifier("indeterminate")]: t.indeterminate,
|
|
123
126
|
[i.modifier("disabled")]: m.value
|
|
124
|
-
}]),
|
|
125
|
-
var
|
|
126
|
-
(
|
|
127
|
-
},
|
|
128
|
-
var
|
|
129
|
-
(
|
|
127
|
+
}]), K = (e) => {
|
|
128
|
+
var a, n;
|
|
129
|
+
(n = (a = y.value) == null ? void 0 : a.onFocus) == null || n.call(a, e);
|
|
130
|
+
}, T = (e) => {
|
|
131
|
+
var a, n;
|
|
132
|
+
(n = (a = y.value) == null ? void 0 : a.onBlur) == null || n.call(a, e);
|
|
130
133
|
};
|
|
131
|
-
return
|
|
132
|
-
(
|
|
133
|
-
}),
|
|
134
|
-
let
|
|
135
|
-
|
|
136
|
-
}),
|
|
137
|
-
|
|
134
|
+
return C(w, (e) => {
|
|
135
|
+
(J(e) || L(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), d.value && d.value.checked !== a && (d.value.checked = a);
|
|
139
|
+
}), $(() => {
|
|
140
|
+
d.value && (d.value.indeterminate = t.indeterminate);
|
|
138
141
|
}), () => {
|
|
139
|
-
var
|
|
140
|
-
return c("label", {
|
|
142
|
+
var e, a;
|
|
143
|
+
return c("label", A(H.value, {
|
|
141
144
|
"aria-disabled": m.value,
|
|
142
|
-
class:
|
|
143
|
-
|
|
144
|
-
|
|
145
|
+
class: [D.value, f.class],
|
|
146
|
+
style: f.style
|
|
147
|
+
}), [c("input", A(M.value, {
|
|
148
|
+
ref: d,
|
|
145
149
|
type: "checkbox",
|
|
146
150
|
checked: u.value,
|
|
147
|
-
"aria-checked":
|
|
148
|
-
value:
|
|
151
|
+
"aria-checked": t.indeterminate ? "mixed" : u.value,
|
|
152
|
+
value: t.value,
|
|
149
153
|
class: i.modifier("target"),
|
|
150
154
|
disabled: m.value,
|
|
151
|
-
onClick:
|
|
152
|
-
onChange:
|
|
153
|
-
onFocus:
|
|
154
|
-
onBlur:
|
|
155
|
-
}, null), ((
|
|
155
|
+
onClick: R,
|
|
156
|
+
onChange: W,
|
|
157
|
+
onFocus: K,
|
|
158
|
+
onBlur: T
|
|
159
|
+
}), null), ((a = b.checkbox ?? ((e = l == null ? void 0 : l.slots) == null ? void 0 : e.checkbox)) == null ? void 0 : a({
|
|
156
160
|
checked: u.value,
|
|
157
161
|
disabled: m.value
|
|
158
|
-
})) ?? c(
|
|
162
|
+
})) ?? c(F, {
|
|
159
163
|
class: i.modifier("icon-hover"),
|
|
160
|
-
size:
|
|
164
|
+
size: S.value,
|
|
161
165
|
disabled: m.value || u.value
|
|
162
166
|
}, {
|
|
163
167
|
default: () => [c("div", {
|
|
164
168
|
class: i.modifier("icon")
|
|
165
|
-
}, [u.value && c(
|
|
169
|
+
}, [u.value && c(I, {
|
|
166
170
|
class: i.modifier("icon-check")
|
|
167
171
|
}, null)])]
|
|
168
|
-
}),
|
|
172
|
+
}), b.default && c("span", {
|
|
169
173
|
class: i.element("label")
|
|
170
|
-
}, [
|
|
174
|
+
}, [b.default()])]);
|
|
171
175
|
};
|
|
172
176
|
}
|
|
173
177
|
});
|
|
174
178
|
export {
|
|
175
|
-
|
|
179
|
+
oe as default
|
|
176
180
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { checkboxGroupKey as
|
|
3
|
-
import { useFormItem as
|
|
4
|
-
import
|
|
5
|
-
import { isArray as b, isString as
|
|
6
|
-
import { getClassNameMixin as
|
|
7
|
-
import { useSize as
|
|
8
|
-
const
|
|
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:
|
|
101
|
-
} =
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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:
|
|
109
|
+
size: y
|
|
110
|
+
}), z = w(x, () => g, {
|
|
111
|
+
labelable: !1
|
|
108
112
|
}), {
|
|
109
|
-
mergedSize:
|
|
110
|
-
} =
|
|
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
|
-
|
|
118
|
+
$(B, F({
|
|
115
119
|
name: "XCheckboxGroup",
|
|
116
|
-
computedValue:
|
|
117
|
-
size:
|
|
118
|
-
disabled:
|
|
119
|
-
isMaxed:
|
|
120
|
+
computedValue: i,
|
|
121
|
+
size: o,
|
|
122
|
+
disabled: C,
|
|
123
|
+
isMaxed: c,
|
|
120
124
|
slots: l,
|
|
121
|
-
handleChange: (e,
|
|
122
|
-
var
|
|
123
|
-
|
|
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
|
|
127
|
-
|
|
128
|
-
b(e) ?
|
|
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
|
|
131
|
-
const
|
|
132
|
-
return v(
|
|
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 || !
|
|
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
|
-
}) :
|
|
144
|
+
}) : P(e.label) ? e.label() : e.label]
|
|
141
145
|
});
|
|
142
146
|
});
|
|
143
147
|
return () => {
|
|
144
148
|
var e;
|
|
145
|
-
return v("span", {
|
|
146
|
-
|
|
147
|
-
|
|
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
|
-
|
|
157
|
+
W as default
|
|
153
158
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
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
|
|
4
|
-
import { Enter as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
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
|
|
9
|
-
import { isUndefined as
|
|
10
|
-
import { useFormItem as
|
|
11
|
-
import { useLocale as
|
|
12
|
-
import { useSize as
|
|
13
|
-
import { useCursor as
|
|
14
|
-
import { getClassNameMixin as
|
|
15
|
-
const
|
|
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
|
-
} =
|
|
195
|
-
|
|
194
|
+
} = de(t), l = ke("input"), d = h(), {
|
|
195
|
+
formItemCtx: K,
|
|
196
|
+
mergedSize: U,
|
|
196
197
|
mergedDisabled: g,
|
|
197
|
-
mergedError:
|
|
198
|
+
mergedError: $,
|
|
198
199
|
feedback: y,
|
|
199
200
|
eventHandlers: v
|
|
200
|
-
} =
|
|
201
|
+
} = we({
|
|
201
202
|
size: D,
|
|
202
203
|
disabled: P,
|
|
203
204
|
error: W
|
|
204
205
|
}), {
|
|
205
|
-
t:
|
|
206
|
-
} =
|
|
206
|
+
t: q
|
|
207
|
+
} = Ie(), {
|
|
207
208
|
mergedSize: N
|
|
208
|
-
} =
|
|
209
|
-
|
|
210
|
-
(
|
|
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
|
|
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 && !
|
|
219
|
-
},
|
|
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
|
|
223
|
-
e !== B && (B = e, s("change", e, n), (f = (
|
|
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,
|
|
229
|
-
|
|
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:
|
|
235
|
+
selectionStart: a,
|
|
235
236
|
selectionEnd: f
|
|
236
237
|
} = e.target;
|
|
237
238
|
if (e.type === "compositionend") {
|
|
238
|
-
if (x.value = !1,
|
|
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,
|
|
245
|
+
x.value = !0, A.value = c.value + (e.data ?? "");
|
|
245
246
|
}, b = () => {
|
|
246
|
-
|
|
247
|
-
d.value && c.value !== d.value.value && (d.value.value = c.value,
|
|
247
|
+
G(), ve(() => {
|
|
248
|
+
d.value && c.value !== d.value.value && (d.value.value = c.value, J());
|
|
248
249
|
});
|
|
249
|
-
},
|
|
250
|
-
var
|
|
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 && !
|
|
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 = (
|
|
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 ===
|
|
266
|
-
}, M = r(() => j(j(m, R), ["class", "style"])),
|
|
267
|
-
[
|
|
268
|
-
[
|
|
269
|
-
}]),
|
|
270
|
-
[
|
|
271
|
-
[
|
|
272
|
-
[
|
|
273
|
-
}],
|
|
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
|
-
...
|
|
276
|
-
...t.inputAttrs
|
|
280
|
+
...ie.value
|
|
277
281
|
};
|
|
278
|
-
return
|
|
282
|
+
return T.value && (e["aria-invalid"] = !0), e;
|
|
279
283
|
}), _ = (e) => {
|
|
280
284
|
var n;
|
|
281
|
-
return i("span",
|
|
282
|
-
class:
|
|
285
|
+
return i("span", F({
|
|
286
|
+
class: oe(e),
|
|
283
287
|
style: e ? void 0 : m.style,
|
|
284
|
-
onMousedown:
|
|
288
|
+
onMousedown: Y
|
|
285
289
|
}, e ? void 0 : M.value), [u.prefix && i("span", {
|
|
286
|
-
class:
|
|
287
|
-
}, [u.prefix()]), i("input",
|
|
290
|
+
class: l.element("prefix")
|
|
291
|
+
}, [u.prefix()]), i("input", F({
|
|
288
292
|
ref: d,
|
|
289
|
-
class:
|
|
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:
|
|
296
|
-
onKeydown:
|
|
297
|
-
onFocus:
|
|
298
|
-
onBlur:
|
|
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
|
-
},
|
|
306
|
+
}, se.value), null), Q.value && i(ge, {
|
|
303
307
|
as: "button",
|
|
304
|
-
"aria-label":
|
|
308
|
+
"aria-label": q("common.clearTarget", {
|
|
305
309
|
target: "输入"
|
|
306
310
|
}),
|
|
307
311
|
prefix: "x-input",
|
|
308
|
-
class:
|
|
309
|
-
onClick:
|
|
312
|
+
class: l.element("clear-btn"),
|
|
313
|
+
onClick: ne
|
|
310
314
|
}, {
|
|
311
|
-
default: () => [i(
|
|
315
|
+
default: () => [i(ye, null, null)]
|
|
312
316
|
}), (u.suffix || !!t.maxLength && t.showWordLimit || !!y.value) && i("span", {
|
|
313
|
-
class: [
|
|
314
|
-
[
|
|
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:
|
|
318
|
-
}, [C.value,
|
|
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",
|
|
325
|
-
class:
|
|
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:
|
|
332
|
+
class: l.element("prepend")
|
|
329
333
|
}, [u.prepend()]), _(!0), u.append && i("span", {
|
|
330
|
-
class:
|
|
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
|
-
|
|
363
|
+
Ke as default
|
|
360
364
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as
|
|
3
|
-
import
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
return i(),
|
|
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
|
-
|
|
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(),
|
|
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:
|
|
36
|
+
onMousedown: s[0] || (s[0] = d(() => {
|
|
34
37
|
}, ["prevent"])),
|
|
35
|
-
onMouseup:
|
|
38
|
+
onMouseup: s[1] || (s[1] = d(() => {
|
|
36
39
|
}, ["prevent"]))
|
|
37
40
|
}, {
|
|
38
41
|
default: o(() => [
|
|
39
|
-
e.mergedVisible ? (i(),
|
|
42
|
+
e.mergedVisible ? (i(), r(l, { key: 1 })) : (i(), r(t, { key: 0 }))
|
|
40
43
|
]),
|
|
41
44
|
_: 1
|
|
42
|
-
}, 8, ["aria-label", "onClick"])) :
|
|
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
|
|
59
|
+
const B = /* @__PURE__ */ v(m, [["render", y]]);
|
|
57
60
|
export {
|
|
58
|
-
|
|
61
|
+
B as default
|
|
59
62
|
};
|