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.
- package/CHANGELOG.md +38 -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 +30 -4
- package/dist/components/dropdown/DropdownButton.vue.d.ts +31 -5
- package/dist/components/dropdown/DropdownOption.vue.d.ts +2 -0
- package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +162 -5
- package/dist/components/dropdown/context.d.ts +14 -1
- package/dist/components/dropdown/dropdown-panel.vue.d.ts +7 -1
- package/dist/components/dropdown/index.d.ts +610 -28
- package/dist/components/dropdown/use-keyboard.d.ts +10 -0
- 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/hooks/use-select.d.ts +2 -1
- 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-overflow.js +45 -40
- 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 +61 -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 +159 -128
- package/dist/es/components/dropdown/Dropdown.vue.js +18 -15
- package/dist/es/components/dropdown/Dropdown.vue2.js +52 -31
- package/dist/es/components/dropdown/DropdownOption.vue.js +22 -21
- package/dist/es/components/dropdown/DropdownOption.vue2.js +23 -19
- package/dist/es/components/dropdown/DropdownSubmenu.vue.js +49 -36
- package/dist/es/components/dropdown/DropdownSubmenu.vue2.js +45 -24
- package/dist/es/components/dropdown/context.js +3 -2
- package/dist/es/components/dropdown/dropdown-panel.vue.js +24 -21
- package/dist/es/components/dropdown/dropdown-panel.vue2.js +83 -31
- package/dist/es/components/dropdown/use-keyboard.js +45 -0
- 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 +80 -76
- 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 +116 -114
- package/dist/es/components/form-select/hooks/use-select.js +128 -128
- 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.d.ts +1 -1
- 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,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { radioGroupKey as
|
|
3
|
-
import { isString as
|
|
4
|
-
import { useFormItem as
|
|
5
|
-
import
|
|
6
|
-
import { useSize as
|
|
7
|
-
import { getClassNameMixin as
|
|
8
|
-
import { omit as
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as I, toRefs as _, useId as F, computed as u, ref as L, provide as k, reactive as w, watch as g, createVNode as v, mergeProps as D } from "vue";
|
|
2
|
+
import { radioGroupKey as H } from "./context.js";
|
|
3
|
+
import { isString as K, isNumber as M, isBoolean as O, isUndefined as P, isNull as U, isFunction as X } from "../../_utils/is.js";
|
|
4
|
+
import { useFormItem as j, useFormItemControl as q } from "../../_hooks/use-form-item.js";
|
|
5
|
+
import E from "./Radio.js";
|
|
6
|
+
import { useSize as J } from "../../_hooks/use-size.js";
|
|
7
|
+
import { getClassNameMixin as Q } from "../../_utils/config.js";
|
|
8
|
+
import { omit as y } from "../../_utils/omit.js";
|
|
9
|
+
const ie = /* @__PURE__ */ I({
|
|
10
10
|
name: "RadioGroup",
|
|
11
11
|
inheritAttrs: !1,
|
|
12
12
|
props: {
|
|
@@ -91,7 +91,7 @@ const Z = /* @__PURE__ */ C({
|
|
|
91
91
|
* @en Trigger when the value changes
|
|
92
92
|
* @property { RadioValue } value
|
|
93
93
|
*/
|
|
94
|
-
change: (a,
|
|
94
|
+
change: (a, l) => !0
|
|
95
95
|
},
|
|
96
96
|
/**
|
|
97
97
|
* @zh radio 文案内容
|
|
@@ -109,68 +109,74 @@ const Z = /* @__PURE__ */ C({
|
|
|
109
109
|
* @version 2.27.0
|
|
110
110
|
*/
|
|
111
111
|
setup(a, {
|
|
112
|
-
attrs:
|
|
113
|
-
emit:
|
|
114
|
-
slots:
|
|
112
|
+
attrs: l,
|
|
113
|
+
emit: n,
|
|
114
|
+
slots: t
|
|
115
115
|
}) {
|
|
116
|
-
const
|
|
116
|
+
const r = Q("radio--group"), {
|
|
117
117
|
size: p,
|
|
118
|
-
type:
|
|
119
|
-
disabled:
|
|
120
|
-
modelValue:
|
|
121
|
-
} =
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
118
|
+
type: S,
|
|
119
|
+
disabled: h,
|
|
120
|
+
modelValue: z
|
|
121
|
+
} = _(a), N = `x-radio-group-${F()}`, V = u(() => a.name ?? N), {
|
|
122
|
+
formItemCtx: C,
|
|
123
|
+
mergedDisabled: o,
|
|
124
|
+
mergedSize: $,
|
|
125
|
+
eventHandlers: R
|
|
126
|
+
} = j({
|
|
126
127
|
size: p,
|
|
127
|
-
disabled:
|
|
128
|
+
disabled: h
|
|
129
|
+
}), x = q(C, () => ({
|
|
130
|
+
...y(l, ["class", "style"]),
|
|
131
|
+
"aria-label": a.ariaLabel ?? l["aria-label"]
|
|
132
|
+
}), {
|
|
133
|
+
labelable: !1
|
|
128
134
|
}), {
|
|
129
135
|
mergedSize: m
|
|
130
|
-
} =
|
|
136
|
+
} = J($), i = L(a.defaultValue), s = u(() => a.modelValue ?? i.value), f = u(() => (a.options ?? []).map((e) => K(e) || M(e) || O(e) ? {
|
|
131
137
|
label: e,
|
|
132
138
|
value: e
|
|
133
|
-
} : e))
|
|
134
|
-
|
|
135
|
-
r.value = e, o("update:modelValue", e), o("change", e, c), (b = (u = V.value) == null ? void 0 : u.onChange) == null || b.call(u, c);
|
|
136
|
-
};
|
|
137
|
-
A(F, k({
|
|
139
|
+
} : e));
|
|
140
|
+
k(H, w({
|
|
138
141
|
name: "XRadioGroup",
|
|
139
142
|
value: s,
|
|
140
143
|
size: m,
|
|
141
|
-
type:
|
|
142
|
-
disabled:
|
|
143
|
-
inputName:
|
|
144
|
-
slots:
|
|
145
|
-
handleChange:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
144
|
+
type: S,
|
|
145
|
+
disabled: o,
|
|
146
|
+
inputName: V,
|
|
147
|
+
slots: t,
|
|
148
|
+
handleChange: (e, c) => {
|
|
149
|
+
var d, b;
|
|
150
|
+
i.value = e, n("update:modelValue", e), n("change", e, c), (b = (d = R.value) == null ? void 0 : d.onChange) == null || b.call(d, c);
|
|
151
|
+
}
|
|
152
|
+
})), g(s, (e) => {
|
|
153
|
+
i.value !== e && (i.value = e);
|
|
154
|
+
}), g(z, (e) => {
|
|
155
|
+
(P(e) || U(e)) && (i.value = "");
|
|
150
156
|
});
|
|
151
|
-
const
|
|
152
|
-
[
|
|
153
|
-
}]),
|
|
157
|
+
const A = u(() => [`${a.type === "button" ? r.element("button") : r.block}`, r.modifier(`size-${m.value}`), r.modifier(`direction-${a.direction}`), l.class, {
|
|
158
|
+
[r.modifier("disabled")]: o.value
|
|
159
|
+
}]), B = u(() => y(l, ["class", "style"])), G = () => f.value.map((e) => v(E, {
|
|
154
160
|
key: `${typeof e.value}-${String(e.value)}`,
|
|
155
161
|
value: e.value,
|
|
156
162
|
disabled: e.disabled
|
|
157
163
|
}, {
|
|
158
|
-
default: () => [
|
|
164
|
+
default: () => [t.label ? t.label({
|
|
159
165
|
data: e
|
|
160
|
-
}) :
|
|
166
|
+
}) : X(e.label) ? e.label() : e.label]
|
|
161
167
|
}));
|
|
162
168
|
return () => {
|
|
163
169
|
var e;
|
|
164
|
-
return
|
|
170
|
+
return v("span", D({
|
|
165
171
|
role: "radiogroup",
|
|
166
172
|
"aria-label": a.ariaLabel,
|
|
167
|
-
"aria-disabled":
|
|
168
|
-
class:
|
|
169
|
-
style:
|
|
170
|
-
},
|
|
173
|
+
"aria-disabled": o.value,
|
|
174
|
+
class: A.value,
|
|
175
|
+
style: l.style
|
|
176
|
+
}, B.value, x.value), [f.value.length > 0 ? G() : (e = t.default) == null ? void 0 : e.call(t)]);
|
|
171
177
|
};
|
|
172
178
|
}
|
|
173
179
|
});
|
|
174
180
|
export {
|
|
175
|
-
|
|
181
|
+
ie as default
|
|
176
182
|
};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isObject as N, isFunction as y, isArray as
|
|
3
|
-
import { getKeyFromValue as M, isGroupOptionInfo as
|
|
1
|
+
import { defineComponent as Ne, toRefs as je, useId as De, computed as i, ref as p, watch as H, nextTick as Re, watchEffect as Te, createVNode as m, mergeProps as A, isVNode as _e } from "vue";
|
|
2
|
+
import { isObject as N, isFunction as y, isArray as Ie, isNumber as Ke, isString as $e, isBoolean as ze, isUndefined as C, isNull as He, isEmptyObject as Me } from "../../_utils/is.js";
|
|
3
|
+
import { getKeyFromValue as M, isGroupOptionInfo as Ue, isValidOption as Ge, hasEmptyStringKey as We } from "./utils.js";
|
|
4
4
|
import { Trigger as U } from "../trigger/index.js";
|
|
5
5
|
import G from "../_components/select-view/select-view.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { useSelect as
|
|
11
|
-
import { useTrigger as
|
|
12
|
-
import { useFormItem as
|
|
13
|
-
import { useLocale as
|
|
14
|
-
import { debounce as
|
|
15
|
-
import { getClassNameMixin as
|
|
16
|
-
import { omit as
|
|
17
|
-
import
|
|
18
|
-
function
|
|
19
|
-
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !
|
|
6
|
+
import Ye from "./SelectDropdown.vue.js";
|
|
7
|
+
import qe from "./SelectOption.vue.js";
|
|
8
|
+
import Je from "./SelectOptionGroup.vue.js";
|
|
9
|
+
import Qe from "../virtual-list-v2/virtual-list.vue.js";
|
|
10
|
+
import { useSelect as Xe } from "./hooks/use-select.js";
|
|
11
|
+
import { useTrigger as Ze } from "../../_hooks/use-trigger.js";
|
|
12
|
+
import { useFormItem as et } from "../../_hooks/use-form-item.js";
|
|
13
|
+
import { useLocale as tt } from "../../locale/index.js";
|
|
14
|
+
import { debounce as at } from "../../_utils/debounce.js";
|
|
15
|
+
import { getClassNameMixin as lt } from "../../_utils/config.js";
|
|
16
|
+
import { omit as nt } from "../../_utils/omit.js";
|
|
17
|
+
import ot from "../../_utils/pick.js";
|
|
18
|
+
function ut(t) {
|
|
19
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !_e(t);
|
|
20
20
|
}
|
|
21
|
-
const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"],
|
|
21
|
+
const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], rt = {
|
|
22
22
|
value: "value",
|
|
23
23
|
label: "label",
|
|
24
24
|
disabled: "disabled",
|
|
25
25
|
tagProps: "tagProps",
|
|
26
26
|
render: "render"
|
|
27
|
-
},
|
|
27
|
+
}, Bt = /* @__PURE__ */ Ne({
|
|
28
28
|
name: "Select",
|
|
29
29
|
components: {
|
|
30
30
|
Trigger: U,
|
|
@@ -439,7 +439,7 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
|
|
|
439
439
|
setup(t, {
|
|
440
440
|
slots: o,
|
|
441
441
|
emit: r,
|
|
442
|
-
attrs:
|
|
442
|
+
attrs: B
|
|
443
443
|
}) {
|
|
444
444
|
const {
|
|
445
445
|
size: Y,
|
|
@@ -447,7 +447,7 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
|
|
|
447
447
|
error: J,
|
|
448
448
|
options: Q,
|
|
449
449
|
filterOption: h,
|
|
450
|
-
valueKey:
|
|
450
|
+
valueKey: f,
|
|
451
451
|
multiple: j,
|
|
452
452
|
popupVisible: X,
|
|
453
453
|
defaultPopupVisible: Z,
|
|
@@ -456,18 +456,19 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
|
|
|
456
456
|
fieldNames: V,
|
|
457
457
|
loading: ae,
|
|
458
458
|
defaultActiveFirstOption: le
|
|
459
|
-
} =
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
459
|
+
} = je(t), ne = lt("select"), D = De(), x = `${D}-listbox`, F = (e) => `${D}-option-${encodeURIComponent(e)}`, {
|
|
460
|
+
formItemCtx: oe,
|
|
461
|
+
mergedSize: ue,
|
|
462
|
+
mergedDisabled: w,
|
|
463
|
+
mergedError: re,
|
|
464
|
+
eventHandlers: ie
|
|
465
|
+
} = et({
|
|
465
466
|
size: Y,
|
|
466
467
|
disabled: q,
|
|
467
468
|
error: J
|
|
468
469
|
}), {
|
|
469
|
-
t:
|
|
470
|
-
} =
|
|
470
|
+
t: ce
|
|
471
|
+
} = tt(), de = i(() => t.virtualListProps ? "div" : "li"), P = i(() => N(t.allowSearch) && !!t.allowSearch.retainInputValue);
|
|
471
472
|
i(() => {
|
|
472
473
|
if (y(t.formatLabel))
|
|
473
474
|
return (e) => {
|
|
@@ -475,37 +476,37 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
|
|
|
475
476
|
return t.formatLabel(l);
|
|
476
477
|
};
|
|
477
478
|
});
|
|
478
|
-
const R =
|
|
479
|
+
const R = p(), T = p({}), _ = p(), {
|
|
479
480
|
computedPopupVisible: c,
|
|
480
|
-
handlePopupVisibleChange:
|
|
481
|
-
} =
|
|
481
|
+
handlePopupVisibleChange: O
|
|
482
|
+
} = Ze({
|
|
482
483
|
popupVisible: X,
|
|
483
484
|
defaultPopupVisible: Z,
|
|
484
485
|
emit: r
|
|
485
|
-
}), k =
|
|
486
|
+
}), k = p(t.defaultValue), E = i(() => {
|
|
486
487
|
const e = t.modelValue ?? k.value;
|
|
487
|
-
return (
|
|
488
|
+
return (Ie(e) ? e : e || Ke(e) || $e(e) || ze(e) ? [e] : []).map((a) => ({
|
|
488
489
|
value: a,
|
|
489
490
|
key: M(a, t.valueKey)
|
|
490
491
|
}));
|
|
491
492
|
});
|
|
492
493
|
H(te, (e) => {
|
|
493
|
-
(
|
|
494
|
+
(C(e) || He(e)) && (k.value = j.value ? [] : e);
|
|
494
495
|
});
|
|
495
|
-
const d = i(() => E.value.map((e) => e.key)),
|
|
496
|
-
...
|
|
496
|
+
const d = i(() => E.value.map((e) => e.key)), I = i(() => ({
|
|
497
|
+
...rt,
|
|
497
498
|
...V == null ? void 0 : V.value
|
|
498
|
-
})),
|
|
499
|
+
})), K = p(), se = (e) => {
|
|
499
500
|
const l = {};
|
|
500
501
|
return e.forEach((a) => {
|
|
501
502
|
l[a] = u.get(a);
|
|
502
503
|
}), l;
|
|
503
|
-
},
|
|
504
|
-
|
|
504
|
+
}, fe = (e) => {
|
|
505
|
+
K.value = se(e);
|
|
505
506
|
}, pe = (e) => y(t.fallbackOption) ? t.fallbackOption(e) : {
|
|
506
|
-
[
|
|
507
|
-
[
|
|
508
|
-
},
|
|
507
|
+
[I.value.value]: e,
|
|
508
|
+
[I.value.label]: String(N(e) ? e[f == null ? void 0 : f.value] : e)
|
|
509
|
+
}, me = () => {
|
|
509
510
|
const e = [], l = [];
|
|
510
511
|
if (t.allowCreate || t.fallbackOption) {
|
|
511
512
|
for (const a of E.value)
|
|
@@ -525,19 +526,19 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
|
|
|
525
526
|
}
|
|
526
527
|
}
|
|
527
528
|
return e;
|
|
528
|
-
}, v =
|
|
529
|
+
}, v = p([]), ve = i(() => v.value.map((e) => {
|
|
529
530
|
var n;
|
|
530
531
|
let l = pe(e.value);
|
|
531
|
-
const a = (n =
|
|
532
|
-
return !
|
|
532
|
+
const a = (n = K.value) == null ? void 0 : n[e.key];
|
|
533
|
+
return !C(a) && !Me(a) && (l = {
|
|
533
534
|
...l,
|
|
534
535
|
...a
|
|
535
536
|
}), l;
|
|
536
537
|
}));
|
|
537
|
-
|
|
538
|
-
|
|
538
|
+
Re(() => {
|
|
539
|
+
Te(() => {
|
|
539
540
|
var l;
|
|
540
|
-
const e =
|
|
541
|
+
const e = me();
|
|
541
542
|
if (e.length !== v.value.length)
|
|
542
543
|
v.value = e;
|
|
543
544
|
else if (e.length > 0) {
|
|
@@ -549,28 +550,28 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
|
|
|
549
550
|
}
|
|
550
551
|
});
|
|
551
552
|
});
|
|
552
|
-
const $ =
|
|
553
|
+
const $ = p(t.defaultInputValue), s = i(() => t.inputValue ?? $.value);
|
|
553
554
|
H(c, (e) => {
|
|
554
555
|
!e && !P.value && s.value && g("");
|
|
555
556
|
});
|
|
556
|
-
const
|
|
557
|
+
const be = (e) => {
|
|
557
558
|
var l;
|
|
558
559
|
return t.multiple ? e.map((a) => {
|
|
559
560
|
var n;
|
|
560
561
|
return ((n = u.get(a)) == null ? void 0 : n.value) ?? "";
|
|
561
|
-
}) : ((l = u.get(e[0])) == null ? void 0 : l.value) ?? (
|
|
562
|
+
}) : ((l = u.get(e[0])) == null ? void 0 : l.value) ?? (We(u) ? void 0 : "");
|
|
562
563
|
}, b = (e) => {
|
|
563
564
|
var a, n;
|
|
564
|
-
const l =
|
|
565
|
-
k.value = l, r("update:modelValue", l), r("change", l), (n = (a =
|
|
565
|
+
const l = be(e);
|
|
566
|
+
k.value = l, r("update:modelValue", l), r("change", l), (n = (a = ie.value) == null ? void 0 : a.onChange) == null || n.call(a), fe(e);
|
|
566
567
|
}, g = (e) => {
|
|
567
568
|
$.value = e, r("update:inputValue", e), r("inputValueChange", e);
|
|
568
|
-
},
|
|
569
|
+
}, ge = (e, l) => {
|
|
569
570
|
if (t.multiple) {
|
|
570
571
|
if (d.value.includes(e)) {
|
|
571
572
|
const a = d.value.filter((n) => n !== e);
|
|
572
573
|
b(a);
|
|
573
|
-
} else if (
|
|
574
|
+
} else if (Be.value.includes(e))
|
|
574
575
|
if (t.limit > 0 && d.value.length >= t.limit) {
|
|
575
576
|
const a = u.get(e);
|
|
576
577
|
r("exceedLimit", a == null ? void 0 : a.value, l);
|
|
@@ -584,76 +585,77 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
|
|
|
584
585
|
const a = u.get(e);
|
|
585
586
|
a && g(a.label);
|
|
586
587
|
}
|
|
587
|
-
|
|
588
|
+
O(!1);
|
|
588
589
|
}
|
|
589
|
-
},
|
|
590
|
+
}, ye = at((e) => {
|
|
590
591
|
r("search", e);
|
|
591
|
-
}, t.searchDelay),
|
|
592
|
-
e !== s.value && (c.value ||
|
|
593
|
-
},
|
|
592
|
+
}, t.searchDelay), he = (e) => {
|
|
593
|
+
e !== s.value && (c.value || O(!0), g(e), t.allowSearch && ye(e));
|
|
594
|
+
}, Ve = (e) => {
|
|
594
595
|
const l = u.get(e), a = d.value.filter((n) => n !== e);
|
|
595
596
|
b(a), r("remove", l == null ? void 0 : l.value);
|
|
596
|
-
},
|
|
597
|
+
}, we = (e) => {
|
|
597
598
|
e == null || e.stopPropagation();
|
|
598
599
|
const l = d.value.filter((a) => {
|
|
599
600
|
var n;
|
|
600
601
|
return (n = u.get(a)) == null ? void 0 : n.disabled;
|
|
601
602
|
});
|
|
602
603
|
b(l), g(""), r("clear", e);
|
|
603
|
-
}, we = (e) => {
|
|
604
|
-
r("dropdownScroll", e);
|
|
605
604
|
}, Oe = (e) => {
|
|
605
|
+
r("dropdownScroll", e);
|
|
606
|
+
}, Se = (e) => {
|
|
606
607
|
r("dropdownReachBottom", e);
|
|
607
608
|
}, {
|
|
608
609
|
validOptions: z,
|
|
609
610
|
optionInfoMap: u,
|
|
610
|
-
validOptionInfos:
|
|
611
|
-
enabledOptionKeys:
|
|
612
|
-
activeKey:
|
|
613
|
-
handleKeyDown:
|
|
614
|
-
} =
|
|
611
|
+
validOptionInfos: Ce,
|
|
612
|
+
enabledOptionKeys: Be,
|
|
613
|
+
activeKey: S,
|
|
614
|
+
handleKeyDown: xe
|
|
615
|
+
} = Xe({
|
|
615
616
|
multiple: j,
|
|
616
617
|
options: Q,
|
|
617
|
-
extraOptions:
|
|
618
|
+
extraOptions: ve,
|
|
618
619
|
inputValue: s,
|
|
619
620
|
filterOption: h,
|
|
620
621
|
showExtraOptions: ee,
|
|
621
|
-
component:
|
|
622
|
-
valueKey:
|
|
622
|
+
component: de,
|
|
623
|
+
valueKey: f,
|
|
623
624
|
fieldNames: V,
|
|
624
625
|
loading: ae,
|
|
626
|
+
disabled: w,
|
|
625
627
|
popupVisible: c,
|
|
626
628
|
valueKeys: d,
|
|
627
629
|
dropdownRef: R,
|
|
628
630
|
optionRefs: T,
|
|
629
631
|
virtualListRef: _,
|
|
630
632
|
defaultActiveFirstOption: le,
|
|
631
|
-
onSelect:
|
|
632
|
-
onPopupVisibleChange:
|
|
633
|
-
getOptionId:
|
|
634
|
-
}),
|
|
635
|
-
...
|
|
633
|
+
onSelect: ge,
|
|
634
|
+
onPopupVisibleChange: O,
|
|
635
|
+
getOptionId: F
|
|
636
|
+
}), Fe = i(() => nt(B, [...W])), Pe = i(() => ({
|
|
637
|
+
...ot(B, [...W]),
|
|
636
638
|
role: "combobox",
|
|
637
639
|
"aria-haspopup": "listbox",
|
|
638
640
|
"aria-expanded": String(c.value),
|
|
639
|
-
"aria-controls":
|
|
640
|
-
"aria-activedescendant": c.value && !S
|
|
641
|
+
"aria-controls": x,
|
|
642
|
+
"aria-activedescendant": c.value && !C(S.value) ? F(S.value) : void 0,
|
|
641
643
|
"aria-autocomplete": t.allowSearch || t.allowCreate ? "list" : "none",
|
|
642
|
-
"aria-label":
|
|
643
|
-
})),
|
|
644
|
+
"aria-label": B["aria-label"] ?? (oe.labelId ? void 0 : t.placeholder ?? ce("common.select"))
|
|
645
|
+
})), ke = i(() => {
|
|
644
646
|
const e = [];
|
|
645
647
|
for (const l of E.value) {
|
|
646
648
|
const a = u.get(l.key);
|
|
647
649
|
a && e.push({
|
|
648
650
|
...a,
|
|
649
651
|
value: l.key,
|
|
650
|
-
label: (a == null ? void 0 : a.label) ?? String(N(l.value) ? l.value[
|
|
652
|
+
label: (a == null ? void 0 : a.label) ?? String(N(l.value) ? l.value[f == null ? void 0 : f.value] : l.value),
|
|
651
653
|
closable: !(a != null && a.disabled),
|
|
652
654
|
tagProps: a == null ? void 0 : a.tagProps
|
|
653
655
|
});
|
|
654
656
|
}
|
|
655
657
|
return e;
|
|
656
|
-
}),
|
|
658
|
+
}), Ee = (e) => {
|
|
657
659
|
if (y(o.option)) {
|
|
658
660
|
const l = o.option;
|
|
659
661
|
return () => l({
|
|
@@ -662,19 +664,19 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
|
|
|
662
664
|
}
|
|
663
665
|
return y(e.render) ? e.render : () => e.label;
|
|
664
666
|
}, L = (e) => {
|
|
665
|
-
if (
|
|
667
|
+
if (Ue(e)) {
|
|
666
668
|
let l;
|
|
667
|
-
return m(
|
|
669
|
+
return m(Je, {
|
|
668
670
|
key: e.key,
|
|
669
671
|
label: e.label
|
|
670
|
-
},
|
|
672
|
+
}, ut(l = e.options.map((a) => L(a))) ? l : {
|
|
671
673
|
default: () => [l]
|
|
672
674
|
});
|
|
673
675
|
}
|
|
674
|
-
return
|
|
676
|
+
return Ge(e, {
|
|
675
677
|
inputValue: s.value,
|
|
676
678
|
filterOption: h == null ? void 0 : h.value
|
|
677
|
-
}) ? m(
|
|
679
|
+
}) ? m(qe, {
|
|
678
680
|
ref: (l) => {
|
|
679
681
|
l != null && l.$el && (T.value[e.key] = l.$el);
|
|
680
682
|
},
|
|
@@ -684,20 +686,20 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
|
|
|
684
686
|
disabled: e.disabled,
|
|
685
687
|
internal: !0
|
|
686
688
|
}, {
|
|
687
|
-
default:
|
|
689
|
+
default: Ee(e)
|
|
688
690
|
}) : null;
|
|
689
|
-
},
|
|
691
|
+
}, Le = () => m(Ye, {
|
|
690
692
|
ref: R,
|
|
691
|
-
id:
|
|
693
|
+
id: x,
|
|
692
694
|
multiple: t.multiple,
|
|
693
695
|
loading: t.loading,
|
|
694
|
-
empty:
|
|
696
|
+
empty: Ce.value.length === 0,
|
|
695
697
|
virtualList: !!t.virtualListProps,
|
|
696
698
|
scrollbar: t.scrollbar,
|
|
697
699
|
showHeaderOnEmpty: t.showHeaderOnEmpty,
|
|
698
700
|
showFooterOnEmpty: t.showFooterOnEmpty,
|
|
699
|
-
onScroll:
|
|
700
|
-
onReachBottom:
|
|
701
|
+
onScroll: Oe,
|
|
702
|
+
onReachBottom: Se
|
|
701
703
|
}, {
|
|
702
704
|
default: () => {
|
|
703
705
|
var e;
|
|
@@ -705,7 +707,7 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
|
|
|
705
707
|
},
|
|
706
708
|
"virtual-list": () => (
|
|
707
709
|
// @ts-ignore
|
|
708
|
-
m(
|
|
710
|
+
m(Qe, A(t.virtualListProps, {
|
|
709
711
|
ref: _,
|
|
710
712
|
data: z.value
|
|
711
713
|
}), {
|
|
@@ -725,7 +727,7 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
|
|
|
725
727
|
...o.footer ? {
|
|
726
728
|
footer: o.footer
|
|
727
729
|
} : {}
|
|
728
|
-
}),
|
|
730
|
+
}), Ae = ({
|
|
729
731
|
data: e
|
|
730
732
|
}) => {
|
|
731
733
|
var l, a;
|
|
@@ -747,27 +749,27 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
|
|
|
747
749
|
preventFocus: !0,
|
|
748
750
|
autoFitPopupWidth: !0,
|
|
749
751
|
autoFitTransformOrigin: !0,
|
|
750
|
-
disabled:
|
|
752
|
+
disabled: w.value,
|
|
751
753
|
popupVisible: c.value,
|
|
752
754
|
unmountOnClose: t.unmountOnClose,
|
|
753
755
|
clickToClose: !(t.allowSearch || t.allowCreate),
|
|
754
756
|
popupContainer: t.popupContainer,
|
|
755
|
-
onPopupVisibleChange:
|
|
757
|
+
onPopupVisibleChange: O
|
|
756
758
|
}, t.triggerProps), {
|
|
757
759
|
default: () => {
|
|
758
760
|
var e;
|
|
759
761
|
return [((e = o.trigger) == null ? void 0 : e.call(o, {
|
|
760
762
|
popupVisible: c.value,
|
|
761
|
-
disabled:
|
|
762
|
-
listboxId:
|
|
763
|
-
activeDescendant: c.value && !S
|
|
763
|
+
disabled: w.value,
|
|
764
|
+
listboxId: x,
|
|
765
|
+
activeDescendant: c.value && !C(S.value) ? F(S.value) : void 0
|
|
764
766
|
})) ?? m(G, A({
|
|
765
767
|
class: ne.block,
|
|
766
|
-
modelValue:
|
|
768
|
+
modelValue: ke.value,
|
|
767
769
|
inputValue: s.value,
|
|
768
770
|
multiple: t.multiple,
|
|
769
|
-
disabled:
|
|
770
|
-
error:
|
|
771
|
+
disabled: w.value,
|
|
772
|
+
error: re.value,
|
|
771
773
|
loading: t.loading,
|
|
772
774
|
allowClear: t.allowClear,
|
|
773
775
|
allowCreate: t.allowCreate,
|
|
@@ -776,26 +778,26 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], ut = {
|
|
|
776
778
|
maxTagCount: t.maxTagCount,
|
|
777
779
|
placeholder: t.placeholder,
|
|
778
780
|
bordered: t.bordered,
|
|
779
|
-
size:
|
|
781
|
+
size: ue.value,
|
|
780
782
|
tagNowrap: t.tagNowrap,
|
|
781
|
-
inputAttrs:
|
|
782
|
-
},
|
|
783
|
-
onInputValueChange:
|
|
784
|
-
onRemove:
|
|
785
|
-
onClear:
|
|
786
|
-
onKeydown:
|
|
783
|
+
inputAttrs: Pe.value
|
|
784
|
+
}, Fe.value, {
|
|
785
|
+
onInputValueChange: he,
|
|
786
|
+
onRemove: Ve,
|
|
787
|
+
onClear: we,
|
|
788
|
+
onKeydown: xe
|
|
787
789
|
}), {
|
|
788
|
-
label:
|
|
790
|
+
label: Ae,
|
|
789
791
|
prefix: o.prefix,
|
|
790
792
|
"arrow-icon": o["arrow-icon"],
|
|
791
793
|
"loading-icon": o["loading-icon"],
|
|
792
794
|
"search-icon": o["search-icon"]
|
|
793
795
|
})];
|
|
794
796
|
},
|
|
795
|
-
content:
|
|
797
|
+
content: Le
|
|
796
798
|
});
|
|
797
799
|
}
|
|
798
800
|
});
|
|
799
801
|
export {
|
|
800
|
-
|
|
802
|
+
Bt as default
|
|
801
803
|
};
|