x-next 1.3.1 → 1.5.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/AI_USAGE.md +2 -2
- package/CHANGELOG.md +71 -0
- package/dist/_utils/constant.d.ts +1 -1
- package/dist/_utils/palette.d.ts +6 -14
- package/dist/components/alert/Alert.vue.d.ts +9 -9
- package/dist/components/alert/index.d.ts +6 -6
- package/dist/components/button/ButtonGroup.vue.d.ts +22 -18
- package/dist/components/date-picker/DatePanel.vue.d.ts +342 -1
- package/dist/components/date-picker/DatePicker.vue.d.ts +343 -2
- package/dist/components/date-picker/index.d.ts +1765 -1083
- package/dist/components/dropdown/DropdownButton.vue.d.ts +2 -1
- package/dist/components/dropdown/index.d.ts +3 -0
- package/dist/components/form-input-tag/index.d.ts +26 -25
- package/dist/components/form-input-tag/interface.d.ts +8 -0
- package/dist/components/link/Link.vue.d.ts +4 -4
- package/dist/components/link/index.d.ts +6 -6
- package/dist/components/message/index.d.ts +3 -3
- package/dist/components/message/message.vue.d.ts +1 -1
- package/dist/components/notification/Notification.d.ts +1 -1
- package/dist/components/notification/index.d.ts +3 -3
- package/dist/components/popconfirm/src/types.d.ts +1 -1
- package/dist/components/progress/Progress.vue.d.ts +3 -3
- package/dist/components/progress/index.d.ts +3 -3
- package/dist/components/steps/context.d.ts +9 -0
- package/dist/components/tabs/TabPane.vue.d.ts +2 -0
- package/dist/components/tabs/index.d.ts +6 -0
- package/dist/components/tabs/interface.d.ts +4 -0
- package/dist/components/tag/Tag.vue.d.ts +14 -0
- package/dist/components/tag/index.d.ts +9 -0
- package/dist/components/tag/interface.d.ts +5 -0
- package/dist/components/trend-chart/components/TrendChart.d.ts +127 -17
- package/dist/components/trend-chart/components/trend-chart-curve.d.ts +27 -7
- package/dist/components/trend-chart/components/trend-chart-labels.d.ts +4 -0
- package/dist/components/trend-chart/helpers/getPadding.d.ts +3 -2
- package/dist/components/trend-chart/index.d.ts +223 -28
- package/dist/components/trend-chart/props.d.ts +63 -5
- package/dist/es/_styles/palette-aliases.js +182 -127
- package/dist/es/_utils/palette.js +49 -43
- package/dist/es/components/_components/picker/input-range.vue2.js +10 -10
- package/dist/es/components/_components/picker/input.vue2.js +20 -20
- package/dist/es/components/_components/select-view/select-view.js +2 -2
- package/dist/es/components/alert/Alert.vue.js +2 -2
- package/dist/es/components/alert/Alert.vue2.js +21 -20
- package/dist/es/components/button/Button.js +17 -17
- package/dist/es/components/button/ButtonGroup.vue2.js +11 -9
- package/dist/es/components/date-picker/DatePanel.vue.js +71 -62
- package/dist/es/components/date-picker/DatePanel.vue2.js +50 -40
- package/dist/es/components/date-picker/DatePicker.vue2.js +1 -1
- package/dist/es/components/dropdown/Dropdown.vue2.js +11 -4
- package/dist/es/components/dropdown/DropdownButton.vue.js +8 -7
- package/dist/es/components/dropdown/DropdownButton.vue2.js +19 -17
- package/dist/es/components/dropdown/DropdownSubmenu.vue.js +18 -17
- package/dist/es/components/form/form-item-label.vue.js +25 -22
- package/dist/es/components/form/form-item-label.vue2.js +1 -1
- package/dist/es/components/form-checkbox/icon-check.js +12 -43
- package/dist/es/components/form-input/InputPassword.vue2.js +2 -2
- package/dist/es/components/form-input/InputSearch.js +1 -1
- package/dist/es/components/form-input-number/InputNumber.js +4 -4
- package/dist/es/components/form-input-tag/InputTag.js +168 -147
- package/dist/es/components/form-input-tag/utils.js +21 -19
- package/dist/es/components/form-textarea/Textarea.vue2.js +1 -1
- package/dist/es/components/link/Link.vue2.js +1 -1
- package/dist/es/components/menu/MenuSubMenu.js +50 -36
- package/dist/es/components/menu/sub-menu-pop.vue2.js +30 -30
- package/dist/es/components/pagination/Pagination.js +73 -70
- package/dist/es/components/popconfirm/src/popup.vue.js +1 -1
- package/dist/es/components/progress/Progress.vue2.js +1 -1
- package/dist/es/components/steps/Step.vue2.js +51 -47
- package/dist/es/components/steps/Steps.vue2.js +22 -19
- package/dist/es/components/table/Table.js +1 -1
- package/dist/es/components/table/table-th.js +2 -2
- package/dist/es/components/tabs/TabPane.vue.js +11 -9
- package/dist/es/components/tabs/TabPane.vue2.js +28 -24
- package/dist/es/components/tabs/tabs-button.js +2 -2
- package/dist/es/components/tabs/tabs-nav.js +21 -19
- package/dist/es/components/tabs/tabs-tab.vue.js +10 -8
- package/dist/es/components/tag/Tag.vue.js +20 -20
- package/dist/es/components/tag/Tag.vue2.js +35 -28
- package/dist/es/components/time-picker/TimePanel.vue.js +30 -29
- package/dist/es/components/time-picker/TimePicker.vue2.js +1 -1
- package/dist/es/components/time-picker/TimeRangePanel.js +26 -23
- package/dist/es/components/trend-chart/components/TrendChart.js +208 -142
- package/dist/es/components/trend-chart/components/trend-chart-curve.js +124 -59
- package/dist/es/components/trend-chart/components/trend-chart-labels.js +43 -41
- package/dist/es/components/trend-chart/helpers/getPadding.js +3 -3
- package/dist/es/components/trend-chart/props.js +101 -33
- package/dist/es/components/trend-chart/themes.js +15 -15
- package/dist/es/components/watermark/controller.js +40 -40
- package/dist/es/icons/default/calendar.js +15 -0
- package/dist/es/icons/default/clock-circle.js +15 -0
- package/dist/es/icons/default/double-left.js +15 -0
- package/dist/es/icons/default/double-right.js +15 -0
- package/dist/es/icons/default/down.js +16 -0
- package/dist/es/icons/default/eye-invisible.js +20 -0
- package/dist/es/icons/default/eye.js +18 -0
- package/dist/es/icons/default/left.js +15 -0
- package/dist/es/icons/default/minus.js +16 -0
- package/dist/es/icons/default/plus.js +16 -0
- package/dist/es/icons/default/question-circle.js +18 -0
- package/dist/es/icons/default/right.js +15 -0
- package/dist/es/icons/default/search.js +16 -0
- package/dist/es/icons/default/up.js +16 -0
- package/dist/es/icons/icon.js +26 -25
- package/dist/es/icons/public/boxicons/basic.js +1893 -0
- package/dist/es/icons/public/boxicons/brands.js +304 -0
- package/dist/es/icons/public/boxicons/filled.js +1893 -0
- package/dist/es/icons/public/boxicons/index.js +24 -0
- package/dist/es/icons/public/boxicons/names.js +4082 -0
- package/dist/es/icons/registry.js +15 -15
- package/dist/es/locale/en-US.js +2 -1
- package/dist/es/locale/zh-CN.js +2 -1
- package/dist/es/style.css +1 -1
- package/dist/icons/default/calendar.d.ts +93 -0
- package/dist/icons/default/clock-circle.d.ts +93 -0
- package/dist/icons/{_self/down.d.ts → default/double-left.d.ts} +6 -0
- package/dist/icons/{_self/eye-invisible.d.ts → default/double-right.d.ts} +6 -0
- package/dist/icons/default/down.d.ts +93 -0
- package/dist/icons/default/eye-invisible.d.ts +93 -0
- package/dist/icons/default/eye.d.ts +93 -0
- package/dist/icons/{_self/eye.d.ts → default/left.d.ts} +7 -0
- package/dist/icons/default/minus.d.ts +93 -0
- package/dist/icons/{_self → default}/plus.d.ts +7 -0
- package/dist/icons/default/question-circle.d.ts +93 -0
- package/dist/icons/{_self/minus.d.ts → default/right.d.ts} +7 -0
- package/dist/icons/{_self → default}/search.d.ts +7 -0
- package/dist/icons/{_self → default}/up.d.ts +7 -0
- package/dist/icons/public/boxicons/basic.cjs +1 -0
- package/dist/icons/public/boxicons/basic.d.ts +2 -0
- package/dist/icons/public/boxicons/brands.cjs +1 -0
- package/dist/icons/public/boxicons/brands.d.ts +2 -0
- package/dist/icons/public/boxicons/filled.cjs +1 -0
- package/dist/icons/public/boxicons/filled.d.ts +2 -0
- package/dist/icons/public/boxicons/index.cjs +1 -0
- package/dist/icons/public/boxicons/index.d.ts +10 -0
- package/dist/icons/public/boxicons/names.d.ts +10 -0
- package/dist/icons/registry.d.ts +5 -0
- package/dist/index.cjs +4 -4
- package/dist/index.umd.js +4 -4
- package/dist/locale/interface.d.ts +2 -0
- package/dist/style/alert.css +1 -1
- package/dist/style/base.css +1 -1
- package/dist/style/button.css +1 -1
- package/dist/style/date-picker.css +1 -1
- package/dist/style/dialog.css +1 -1
- package/dist/style/drawer.css +1 -1
- package/dist/style/dropdown.css +1 -1
- package/dist/style/form-input-number.css +1 -1
- package/dist/style/form-input-tag.css +1 -1
- package/dist/style/form-input.css +1 -1
- package/dist/style/form-radio.css +1 -1
- package/dist/style/form-select.css +1 -1
- package/dist/style/form-textarea.css +1 -1
- package/dist/style/form.css +1 -1
- package/dist/style/link.css +1 -1
- package/dist/style/menu.css +1 -1
- package/dist/style/message-box.css +1 -1
- package/dist/style/network.css +1 -1
- package/dist/style/pagination.css +1 -1
- package/dist/style/popconfirm.css +1 -1
- package/dist/style/popover.css +1 -1
- package/dist/style/popup.css +1 -1
- package/dist/style/progress.css +1 -1
- package/dist/style/rate.css +1 -1
- package/dist/style/spin.css +1 -1
- package/dist/style/steps.css +1 -1
- package/dist/style/table.css +1 -1
- package/dist/style/tabs.css +1 -1
- package/dist/style/tag.css +1 -1
- package/dist/style/time-picker.css +1 -1
- package/dist/style/time-range-selector.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +31 -4
- package/dist/es/icons/_self/down.js +0 -16
- package/dist/es/icons/_self/eye-invisible.js +0 -13
- package/dist/es/icons/_self/eye.js +0 -13
- package/dist/es/icons/_self/minus.js +0 -13
- package/dist/es/icons/_self/plus.js +0 -12
- package/dist/es/icons/_self/question-message.js +0 -12
- package/dist/es/icons/_self/search.js +0 -13
- package/dist/es/icons/_self/up.js +0 -16
- package/dist/es/icons/_ui/calendar.js +0 -13
- package/dist/es/icons/_ui/time.js +0 -12
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { INPUT_EVENTS as
|
|
3
|
-
import { Enter as
|
|
1
|
+
import { defineComponent as pe, toRefs as ge, ref as m, computed as d, reactive as be, watch as j, onMounted as he, createVNode as f, mergeProps as F, TransitionGroup as ye, nextTick as T } from "vue";
|
|
2
|
+
import { INPUT_EVENTS as U } from "../../_utils/constant.js";
|
|
3
|
+
import { Enter as Ve, Backspace as Ie } from "../../_utils/keycode.js";
|
|
4
4
|
import { getValueData as Ce } from "./utils.js";
|
|
5
|
-
import { Tag as
|
|
5
|
+
import { Tag as xe } from "../tag/index.js";
|
|
6
6
|
import we from "../_components/icon-hover/index.vue.js";
|
|
7
|
-
import
|
|
8
|
-
import { omit as
|
|
9
|
-
import
|
|
7
|
+
import Be from "../../icons/default/close.js";
|
|
8
|
+
import { omit as W } from "../../_utils/omit.js";
|
|
9
|
+
import Te from "../../_utils/pick.js";
|
|
10
10
|
import _e from "../../_container/resize-observer.js";
|
|
11
|
-
import
|
|
12
|
-
import { useFormItem as
|
|
11
|
+
import ke from "../_components/feedback-icon/index.vue.js";
|
|
12
|
+
import { useFormItem as Ee, useFormItemControl as Ne } from "../../_hooks/use-form-item.js";
|
|
13
13
|
import { useLocale as Ae } from "../../locale/index.js";
|
|
14
|
-
import { useSize as
|
|
15
|
-
import { isObject as
|
|
16
|
-
import { getClassNameMixin as
|
|
14
|
+
import { useSize as Se } from "../../_hooks/use-size.js";
|
|
15
|
+
import { isObject as ze, isUndefined as Fe, isNull as Re } from "../../_utils/is.js";
|
|
16
|
+
import { getClassNameMixin as q, getRemovePrefixComponentName as De } from "../../_utils/config.js";
|
|
17
17
|
const Pe = {
|
|
18
18
|
value: "value",
|
|
19
19
|
label: "label",
|
|
20
20
|
closable: "closable",
|
|
21
21
|
tagProps: "tagProps"
|
|
22
|
-
},
|
|
22
|
+
}, Me = "__x_input_tag_more__", la = /* @__PURE__ */ pe({
|
|
23
23
|
name: "InputTag",
|
|
24
24
|
inheritAttrs: !1,
|
|
25
25
|
props: {
|
|
@@ -164,28 +164,28 @@ const Pe = {
|
|
|
164
164
|
* @param {(string | number | TagData)[]} value
|
|
165
165
|
* @param {Event} ev
|
|
166
166
|
*/
|
|
167
|
-
change: (a,
|
|
167
|
+
change: (a, i) => !0,
|
|
168
168
|
/**
|
|
169
169
|
* @zh 输入值发生改变时触发
|
|
170
170
|
* @en Trigger when the input value changes
|
|
171
171
|
* @param {string} inputValue
|
|
172
172
|
* @param {Event} ev
|
|
173
173
|
*/
|
|
174
|
-
inputValueChange: (a,
|
|
174
|
+
inputValueChange: (a, i) => !0,
|
|
175
175
|
/**
|
|
176
176
|
* @zh 按下回车键时触发
|
|
177
177
|
* @en Triggered when the enter key is pressed
|
|
178
178
|
* @param {string} inputValue
|
|
179
179
|
* @param {KeyboardEvent} ev
|
|
180
180
|
*/
|
|
181
|
-
pressEnter: (a,
|
|
181
|
+
pressEnter: (a, i) => !0,
|
|
182
182
|
/**
|
|
183
183
|
* @zh 点击标签的删除按钮时触发
|
|
184
184
|
* @en Triggered when the delete button of the label is clicked
|
|
185
185
|
* @param {string | number} removed
|
|
186
186
|
* @param {Event} ev
|
|
187
187
|
*/
|
|
188
|
-
remove: (a,
|
|
188
|
+
remove: (a, i) => !0,
|
|
189
189
|
/**
|
|
190
190
|
* @zh 点击清除按钮时触发
|
|
191
191
|
* @en Triggered when the clear button is clicked
|
|
@@ -223,165 +223,184 @@ const Pe = {
|
|
|
223
223
|
* @binding {TagData} data
|
|
224
224
|
*/
|
|
225
225
|
setup(a, {
|
|
226
|
-
emit:
|
|
227
|
-
slots:
|
|
228
|
-
attrs:
|
|
226
|
+
emit: i,
|
|
227
|
+
slots: c,
|
|
228
|
+
attrs: C
|
|
229
229
|
}) {
|
|
230
230
|
const {
|
|
231
|
-
size:
|
|
232
|
-
disabled:
|
|
233
|
-
error:
|
|
234
|
-
uninjectFormItemContext:
|
|
235
|
-
modelValue:
|
|
236
|
-
} =
|
|
237
|
-
formItemCtx:
|
|
238
|
-
mergedSize:
|
|
239
|
-
mergedDisabled:
|
|
240
|
-
mergedError:
|
|
241
|
-
feedback:
|
|
242
|
-
eventHandlers:
|
|
243
|
-
} =
|
|
244
|
-
size:
|
|
245
|
-
disabled:
|
|
246
|
-
error:
|
|
247
|
-
uninject:
|
|
231
|
+
size: G,
|
|
232
|
+
disabled: H,
|
|
233
|
+
error: K,
|
|
234
|
+
uninjectFormItemContext: _,
|
|
235
|
+
modelValue: J
|
|
236
|
+
} = ge(a), u = a.baseCls ? q(De(a.baseCls)) : q("input-tag"), r = m(), g = m(), {
|
|
237
|
+
formItemCtx: Q,
|
|
238
|
+
mergedSize: X,
|
|
239
|
+
mergedDisabled: b,
|
|
240
|
+
mergedError: R,
|
|
241
|
+
feedback: x,
|
|
242
|
+
eventHandlers: h
|
|
243
|
+
} = Ee({
|
|
244
|
+
size: G,
|
|
245
|
+
disabled: H,
|
|
246
|
+
error: K,
|
|
247
|
+
uninject: _ == null ? void 0 : _.value
|
|
248
248
|
}), {
|
|
249
|
-
t:
|
|
249
|
+
t: w
|
|
250
250
|
} = Ae(), {
|
|
251
|
-
mergedSize:
|
|
252
|
-
} =
|
|
251
|
+
mergedSize: Y
|
|
252
|
+
} = Se(X), Z = d(() => ({
|
|
253
253
|
...Pe,
|
|
254
254
|
...a.fieldNames
|
|
255
|
-
})), k =
|
|
255
|
+
})), k = m(!1), E = m(a.defaultValue), D = m(a.defaultInputValue), p = m(!1), B = m(""), P = d(() => ze(a.retainInputValue) ? {
|
|
256
256
|
create: !1,
|
|
257
257
|
blur: !1,
|
|
258
258
|
...a.retainInputValue
|
|
259
259
|
} : {
|
|
260
260
|
create: a.retainInputValue,
|
|
261
261
|
blur: a.retainInputValue
|
|
262
|
-
}),
|
|
262
|
+
}), N = be({
|
|
263
263
|
width: "12px"
|
|
264
|
-
}),
|
|
265
|
-
|
|
266
|
-
},
|
|
264
|
+
}), ee = d(() => a.focused || k.value), y = (e, t) => {
|
|
265
|
+
D.value = e, i("update:inputValue", e), i("inputValueChange", e, t);
|
|
266
|
+
}, A = (e) => {
|
|
267
|
+
var l, n;
|
|
267
268
|
const {
|
|
268
269
|
value: t
|
|
269
270
|
} = e.target;
|
|
270
|
-
e.type === "compositionend" ? (
|
|
271
|
-
r.value &&
|
|
272
|
-
})) : (
|
|
273
|
-
},
|
|
274
|
-
|
|
275
|
-
(
|
|
271
|
+
e.type === "compositionend" ? (p.value = !1, B.value = "", y(t, e), (n = (l = h.value) == null ? void 0 : l.onInput) == null || n.call(l, e), T(() => {
|
|
272
|
+
r.value && o.value !== r.value.value && (r.value.value = o.value);
|
|
273
|
+
})) : (p.value = !0, B.value = o.value + (e.data ?? ""));
|
|
274
|
+
}, V = d(() => a.modelValue ?? E.value), o = d(() => a.inputValue ?? D.value);
|
|
275
|
+
j(J, (e) => {
|
|
276
|
+
(Fe(e) || Re(e)) && (E.value = []);
|
|
276
277
|
});
|
|
277
|
-
const
|
|
278
|
+
const ae = (e) => {
|
|
278
279
|
r.value && e.target !== r.value && (e.preventDefault(), r.value.focus());
|
|
279
|
-
},
|
|
280
|
-
var l,
|
|
280
|
+
}, le = (e) => {
|
|
281
|
+
var l, n;
|
|
281
282
|
const {
|
|
282
283
|
value: t
|
|
283
284
|
} = e.target;
|
|
284
|
-
|
|
285
|
-
r.value &&
|
|
285
|
+
p.value || (y(t, e), (n = (l = h.value) == null ? void 0 : l.onInput) == null || n.call(l, e), T(() => {
|
|
286
|
+
r.value && o.value !== r.value.value && (r.value.value = o.value);
|
|
286
287
|
}));
|
|
287
|
-
},
|
|
288
|
+
}, v = d(() => Ce(V.value, Z.value)), I = d(() => {
|
|
288
289
|
if (a.maxTagCount > 0) {
|
|
289
|
-
const e =
|
|
290
|
+
const e = v.value.length - a.maxTagCount;
|
|
290
291
|
if (e > 0) {
|
|
291
|
-
const t =
|
|
292
|
-
value:
|
|
292
|
+
const t = v.value.slice(0, a.maxTagCount), l = {
|
|
293
|
+
value: Me,
|
|
293
294
|
label: `+${e}...`,
|
|
294
295
|
closable: !1
|
|
295
296
|
};
|
|
296
297
|
return t.push({
|
|
297
298
|
raw: l,
|
|
299
|
+
originalIndex: -1,
|
|
298
300
|
...l
|
|
299
301
|
}), t;
|
|
300
302
|
}
|
|
301
303
|
}
|
|
302
|
-
return
|
|
304
|
+
return v.value;
|
|
303
305
|
}), S = (e, t) => {
|
|
304
|
-
var l,
|
|
305
|
-
|
|
306
|
+
var l, n;
|
|
307
|
+
E.value = e, i("update:modelValue", e), i("change", e, t), (n = (l = h.value) == null ? void 0 : l.onChange) == null || n.call(l, t);
|
|
306
308
|
}, M = (e, t, l) => {
|
|
307
|
-
var
|
|
308
|
-
const
|
|
309
|
-
S(
|
|
309
|
+
var s;
|
|
310
|
+
const n = (s = V.value) == null ? void 0 : s.filter((z, me) => me !== t);
|
|
311
|
+
S(n, l), i("remove", e, l);
|
|
312
|
+
}, te = (e, t, l) => {
|
|
313
|
+
const n = document.activeElement === l.currentTarget;
|
|
314
|
+
M(e, t, l), n && T(() => {
|
|
315
|
+
var s;
|
|
316
|
+
return (s = r.value) == null ? void 0 : s.focus();
|
|
317
|
+
});
|
|
310
318
|
}, ue = (e) => {
|
|
311
|
-
e.stopPropagation()
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
319
|
+
e.stopPropagation();
|
|
320
|
+
const t = document.activeElement === e.currentTarget;
|
|
321
|
+
S([], e), o.value && y("", e), i("clear", e), t && T(() => {
|
|
322
|
+
var n;
|
|
323
|
+
return (n = r.value) == null ? void 0 : n.focus();
|
|
324
|
+
});
|
|
325
|
+
}, $ = d(() => !b.value && !a.readonly && a.allowClear && !!V.value.length), ne = (e) => {
|
|
326
|
+
if (o.value) {
|
|
327
|
+
if (e.preventDefault(), a.uniqueValue && v.value.some((l) => l.value === o.value)) {
|
|
328
|
+
i("pressEnter", o.value, e);
|
|
316
329
|
return;
|
|
317
330
|
}
|
|
318
|
-
const t =
|
|
319
|
-
S(t, e),
|
|
331
|
+
const t = V.value.concat(o.value);
|
|
332
|
+
S(t, e), i("pressEnter", o.value, e), P.value.create || y("", e);
|
|
320
333
|
}
|
|
321
334
|
}, oe = (e) => {
|
|
322
335
|
var t, l;
|
|
323
|
-
k.value = !0,
|
|
336
|
+
k.value = !0, i("focus", e), (l = (t = h.value) == null ? void 0 : t.onFocus) == null || l.call(t, e);
|
|
324
337
|
}, re = (e) => {
|
|
325
338
|
var t, l;
|
|
326
|
-
k.value = !1, !
|
|
339
|
+
k.value = !1, !P.value.blur && o.value && y("", e), i("blur", e), (l = (t = h.value) == null ? void 0 : t.onBlur) == null || l.call(t, e);
|
|
327
340
|
}, ie = () => {
|
|
328
|
-
for (let e =
|
|
329
|
-
if (
|
|
341
|
+
for (let e = v.value.length - 1; e >= 0; e--)
|
|
342
|
+
if (v.value[e].closable)
|
|
330
343
|
return e;
|
|
331
344
|
return -1;
|
|
332
345
|
}, se = (e) => {
|
|
333
|
-
if (
|
|
346
|
+
if (b.value || a.readonly)
|
|
334
347
|
return;
|
|
335
348
|
const t = e.key || e.code;
|
|
336
|
-
if (!
|
|
349
|
+
if (!p.value && o.value && t === Ve.key && ne(e), !p.value && I.value.length > 0 && !o.value && t === Ie.key) {
|
|
337
350
|
const l = ie();
|
|
338
|
-
l >= 0
|
|
351
|
+
if (l >= 0) {
|
|
352
|
+
const {
|
|
353
|
+
value: n,
|
|
354
|
+
originalIndex: s
|
|
355
|
+
} = v.value[l];
|
|
356
|
+
e.preventDefault(), M(n, s, e);
|
|
357
|
+
}
|
|
339
358
|
}
|
|
340
|
-
|
|
341
|
-
},
|
|
342
|
-
e > 12 ?
|
|
359
|
+
i("keydown", e);
|
|
360
|
+
}, L = (e) => {
|
|
361
|
+
e > 12 ? N.width = `${e}px` : N.width = "12px";
|
|
343
362
|
};
|
|
344
|
-
|
|
345
|
-
|
|
363
|
+
he(() => {
|
|
364
|
+
g.value && L(g.value.offsetWidth);
|
|
346
365
|
});
|
|
347
|
-
const
|
|
348
|
-
|
|
366
|
+
const ce = () => {
|
|
367
|
+
g.value && L(g.value.offsetWidth);
|
|
349
368
|
};
|
|
350
|
-
|
|
351
|
-
r.value && !
|
|
369
|
+
j(o, (e) => {
|
|
370
|
+
r.value && !p.value && e !== r.value.value && (r.value.value = e);
|
|
352
371
|
});
|
|
353
|
-
const
|
|
354
|
-
[u.modifier("disabled")]:
|
|
372
|
+
const de = d(() => [u.block, u.modifier(`size-${Y.value}`), {
|
|
373
|
+
[u.modifier("disabled")]: b.value,
|
|
355
374
|
[u.modifier("disabled-input")]: a.disabledInput,
|
|
356
|
-
[u.modifier("error")]:
|
|
357
|
-
[u.modifier("focus")]:
|
|
375
|
+
[u.modifier("error")]: R.value,
|
|
376
|
+
[u.modifier("focus")]: ee.value,
|
|
358
377
|
[u.modifier("readonly")]: a.readonly,
|
|
359
|
-
[u.modifier("has-tag")]:
|
|
360
|
-
[u.modifier("has-prefix")]: !!
|
|
361
|
-
[u.modifier("has-suffix")]: !!
|
|
362
|
-
[u.modifier("has-placeholder")]: !
|
|
363
|
-
}]),
|
|
364
|
-
...
|
|
378
|
+
[u.modifier("has-tag")]: I.value.length > 0,
|
|
379
|
+
[u.modifier("has-prefix")]: !!c.prefix,
|
|
380
|
+
[u.modifier("has-suffix")]: !!c.suffix || $.value || !!x.value,
|
|
381
|
+
[u.modifier("has-placeholder")]: !V.value.length
|
|
382
|
+
}]), fe = d(() => W(W(C, U), ["class", "style"])), O = d(() => Te(C, U)), ve = Ne(Q, () => ({
|
|
383
|
+
...O.value,
|
|
365
384
|
...a.inputAttrs
|
|
366
385
|
}));
|
|
367
386
|
return {
|
|
368
387
|
inputRef: r,
|
|
369
388
|
render: () => {
|
|
370
389
|
var e;
|
|
371
|
-
return
|
|
372
|
-
class: [
|
|
373
|
-
style:
|
|
374
|
-
onMousedown:
|
|
375
|
-
},
|
|
376
|
-
onResize:
|
|
390
|
+
return f("span", F({
|
|
391
|
+
class: [de.value, C.class],
|
|
392
|
+
style: C.style,
|
|
393
|
+
onMousedown: ae
|
|
394
|
+
}, fe.value), [f(_e, {
|
|
395
|
+
onResize: ce
|
|
377
396
|
}, {
|
|
378
|
-
default: () => [
|
|
379
|
-
ref:
|
|
397
|
+
default: () => [f("span", {
|
|
398
|
+
ref: g,
|
|
380
399
|
class: u.element("mirror")
|
|
381
|
-
}, [
|
|
382
|
-
}),
|
|
400
|
+
}, [I.value.length > 0 ? B.value || o.value : B.value || o.value || a.placeholder])]
|
|
401
|
+
}), c.prefix && f("span", {
|
|
383
402
|
class: u.element("prefix")
|
|
384
|
-
}, [
|
|
403
|
+
}, [c.prefix()]), f(ye, {
|
|
385
404
|
tag: "span",
|
|
386
405
|
name: "input-tag-zoom",
|
|
387
406
|
class: [u.element("inner"), {
|
|
@@ -390,57 +409,59 @@ const Pe = {
|
|
|
390
409
|
}, {
|
|
391
410
|
default: () => {
|
|
392
411
|
var t;
|
|
393
|
-
return [
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
}),
|
|
412
|
+
return [I.value.map((l, n) => f(xe, F({
|
|
413
|
+
key: `tag-${l.value}-${n}`,
|
|
414
|
+
class: u.element("tag"),
|
|
415
|
+
visible: !0,
|
|
416
|
+
nowrap: a.tagNowrap
|
|
417
|
+
}, l.tagProps, {
|
|
418
|
+
closable: !b.value && !a.readonly && l.closable,
|
|
419
|
+
closeAriaLabel: `${w("common.closeTarget", {
|
|
420
|
+
target: w("common.tag")
|
|
421
|
+
})} ${l.label}`,
|
|
422
|
+
onClose: (s) => te(l.value, l.originalIndex, s)
|
|
423
|
+
}), {
|
|
424
|
+
default: () => {
|
|
425
|
+
var s, z;
|
|
426
|
+
return [((s = c.tag) == null ? void 0 : s.call(c, {
|
|
427
|
+
data: l.raw
|
|
428
|
+
})) ?? ((z = a.formatTag) == null ? void 0 : z.call(a, l.raw)) ?? l.label];
|
|
429
|
+
}
|
|
430
|
+
})), f("input", F(ve.value, {
|
|
412
431
|
ref: r,
|
|
413
432
|
key: "input-tag-input",
|
|
414
433
|
class: u.element("input"),
|
|
415
|
-
style:
|
|
416
|
-
value:
|
|
417
|
-
placeholder:
|
|
418
|
-
disabled:
|
|
434
|
+
style: N,
|
|
435
|
+
value: o.value,
|
|
436
|
+
placeholder: I.value.length === 0 ? a.placeholder : void 0,
|
|
437
|
+
disabled: b.value,
|
|
419
438
|
readonly: a.readonly || a.disabledInput,
|
|
420
|
-
"aria-invalid":
|
|
421
|
-
onInput:
|
|
439
|
+
"aria-invalid": R.value ? !0 : ((t = a.inputAttrs) == null ? void 0 : t["aria-invalid"]) ?? O.value["aria-invalid"],
|
|
440
|
+
onInput: le,
|
|
422
441
|
onKeydown: se,
|
|
423
442
|
onFocus: oe,
|
|
424
443
|
onBlur: re,
|
|
425
|
-
onCompositionstart:
|
|
426
|
-
onCompositionupdate:
|
|
427
|
-
onCompositionend:
|
|
444
|
+
onCompositionstart: A,
|
|
445
|
+
onCompositionupdate: A,
|
|
446
|
+
onCompositionend: A
|
|
428
447
|
}), null)];
|
|
429
448
|
}
|
|
430
|
-
}),
|
|
449
|
+
}), $.value && f(we, {
|
|
431
450
|
as: "button",
|
|
432
|
-
"aria-label":
|
|
433
|
-
target:
|
|
451
|
+
"aria-label": w("common.clearTarget", {
|
|
452
|
+
target: w("common.tag")
|
|
434
453
|
}),
|
|
435
454
|
class: u.element("clear-btn"),
|
|
436
455
|
onClick: ue,
|
|
437
|
-
onMousedown: (t) =>
|
|
456
|
+
onMousedown: (t) => {
|
|
457
|
+
t.preventDefault(), t.stopPropagation();
|
|
458
|
+
}
|
|
438
459
|
}, {
|
|
439
|
-
default: () => [
|
|
440
|
-
}), (
|
|
460
|
+
default: () => [f(Be, null, null)]
|
|
461
|
+
}), (c.suffix || !!x.value) && f("span", {
|
|
441
462
|
class: u.element("suffix")
|
|
442
|
-
}, [(e =
|
|
443
|
-
type:
|
|
463
|
+
}, [(e = c.suffix) == null ? void 0 : e.call(c), !!x.value && f(ke, {
|
|
464
|
+
type: x.value
|
|
444
465
|
}, null)])]);
|
|
445
466
|
}
|
|
446
467
|
};
|
|
@@ -470,5 +491,5 @@ const Pe = {
|
|
|
470
491
|
}
|
|
471
492
|
});
|
|
472
493
|
export {
|
|
473
|
-
|
|
494
|
+
la as default
|
|
474
495
|
};
|
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import { isObject as
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
for (const
|
|
5
|
-
if (
|
|
6
|
-
const l = t
|
|
7
|
-
if (
|
|
1
|
+
import { isObject as i, isUndefined as a, isNull as r } from "../../_utils/is.js";
|
|
2
|
+
const f = (c, t) => {
|
|
3
|
+
const n = [];
|
|
4
|
+
for (const [s, e] of c.entries())
|
|
5
|
+
if (i(e)) {
|
|
6
|
+
const l = e[t.value];
|
|
7
|
+
if (a(l) || r(l))
|
|
8
8
|
continue;
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
raw:
|
|
9
|
+
const o = e[t.tagProps], u = (e[t.closable] ?? !0) && (o == null ? void 0 : o.closable) !== !1;
|
|
10
|
+
n.push({
|
|
11
|
+
raw: e,
|
|
12
|
+
originalIndex: s,
|
|
12
13
|
value: l,
|
|
13
|
-
label: t
|
|
14
|
-
closable:
|
|
15
|
-
tagProps:
|
|
14
|
+
label: e[t.label] ?? String(l),
|
|
15
|
+
closable: u,
|
|
16
|
+
tagProps: o
|
|
16
17
|
});
|
|
17
|
-
} else if (!
|
|
18
|
+
} else if (!a(e) && !r(e)) {
|
|
18
19
|
const l = {
|
|
19
|
-
value:
|
|
20
|
-
label: String(
|
|
20
|
+
value: e,
|
|
21
|
+
label: String(e),
|
|
21
22
|
closable: !0
|
|
22
23
|
};
|
|
23
|
-
|
|
24
|
+
n.push({
|
|
24
25
|
raw: l,
|
|
26
|
+
originalIndex: s,
|
|
25
27
|
...l
|
|
26
28
|
});
|
|
27
29
|
}
|
|
28
|
-
return
|
|
30
|
+
return n;
|
|
29
31
|
};
|
|
30
32
|
export {
|
|
31
|
-
|
|
33
|
+
f as getValueData
|
|
32
34
|
};
|
|
@@ -2,7 +2,7 @@ import { defineComponent as de, toRefs as he, ref as s, computed as r, watch as
|
|
|
2
2
|
import Se from "../../_container/resize-observer.js";
|
|
3
3
|
import { useLocale as we } from "../../locale/index.js";
|
|
4
4
|
import ye from "../_components/icon-hover/index.vue.js";
|
|
5
|
-
import xe from "../../icons/default/close
|
|
5
|
+
import xe from "../../icons/default/close.js";
|
|
6
6
|
import { getSizeStyles as ze } from "./utils.js";
|
|
7
7
|
import { isUndefined as be, isNull as Ce, isObject as b, isFunction as pe } from "../../_utils/is.js";
|
|
8
8
|
import { omit as W } from "../../_utils/omit.js";
|