@wfrog/vc-ui 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/README.md +3 -3
- package/dist/es/chunk/{OEa4tYPF.mjs → -ga82G_B.mjs} +1 -1
- package/dist/es/chunk/B1BnPYNG.mjs +163 -0
- package/dist/es/chunk/{DFOLES4O.mjs → BA2yoAwy.mjs} +403 -502
- package/dist/es/chunk/{BpqBBo4z.mjs → BDyXj_90.mjs} +2 -2
- package/dist/es/chunk/{BI0vrXwX.mjs → BI-fNJhk.mjs} +6 -3
- package/dist/es/chunk/{BsGCX4td.mjs → BK4T_2ha.mjs} +1 -1
- package/dist/es/chunk/{73YgKz3H.mjs → BLLKi_0v.mjs} +1 -1
- package/dist/es/chunk/{DTLPXrjb.mjs → BTsEMnf_.mjs} +1 -1
- package/dist/es/chunk/{B5UQmWXg.mjs → BUf50Y7Y.mjs} +41 -21
- package/dist/es/chunk/{BzedaLtg.mjs → BYVaz5Or.mjs} +2 -2
- package/dist/es/chunk/BaJ7k5Lg.mjs +209 -0
- package/dist/es/chunk/{Bp9jXKX0.mjs → BambM7zX.mjs} +2 -2
- package/dist/es/chunk/{CizMbf5K.mjs → Bl0WQiki.mjs} +1 -1
- package/dist/es/chunk/{CLbj8G-F.mjs → Bnot0Gwc.mjs} +12 -4
- package/dist/es/chunk/{4eyJqDa9.mjs → BoGGHTrJ.mjs} +4 -2
- package/dist/es/chunk/C7Dgjpd1.mjs +242 -0
- package/dist/es/chunk/{D0LB3gF-.mjs → CKbkzlkO.mjs} +104 -72
- package/dist/es/chunk/{DrgvuOYH.mjs → CL5WTCB3.mjs} +4 -2
- package/dist/es/chunk/{XwSiBVsA.mjs → CM_I1FoA.mjs} +2 -2
- package/dist/es/chunk/{DouIsSPi.mjs → CNILa-hz.mjs} +1 -1
- package/dist/es/chunk/{DRoyW749.mjs → CcKUdl3e.mjs} +12 -6
- package/dist/es/chunk/CidLkmft.mjs +188 -0
- package/dist/es/chunk/{HAog8AWU.mjs → CitH0taR.mjs} +816 -539
- package/dist/es/chunk/{Cu6erWl4.mjs → CzqeSQn4.mjs} +73 -38
- package/dist/es/chunk/{CLCfXfvv.mjs → D7JQbDFE.mjs} +154 -118
- package/dist/es/chunk/{DaCDeO95.mjs → D9iEroQw.mjs} +1 -207
- package/dist/es/chunk/{cPBw23yt.mjs → DEPZhJ0Z.mjs} +21 -16
- package/dist/es/chunk/{CPERtDRX.mjs → DHpbQMGk.mjs} +32 -22
- package/dist/es/chunk/{BHsNc7jl.mjs → DKpRXDRE.mjs} +82 -55
- package/dist/es/chunk/{CLMc8GzD.mjs → DMYHOxhk.mjs} +462 -311
- package/dist/es/chunk/{CBSopeeE.mjs → DQHGjqG5.mjs} +9 -4
- package/dist/es/chunk/DTEM_vYZ.mjs +23 -0
- package/dist/es/chunk/{NQBKROII.mjs → DWcIzeMM.mjs} +1 -1
- package/dist/es/chunk/{FHvLvzEB.mjs → DX38FfmL.mjs} +1088 -697
- package/dist/es/chunk/{DZD-YnCt.mjs → Dcm-lOj8.mjs} +4 -4
- package/dist/es/chunk/{09Ec85_u.mjs → DdmNdV7I.mjs} +398 -278
- package/dist/es/chunk/{f0-vIQGp.mjs → DfHTA5LW.mjs} +3 -3
- package/dist/es/chunk/DgFT6snA.mjs +835 -0
- package/dist/es/chunk/{DwKWIlzw.mjs → DgSzI6Fw.mjs} +106 -71
- package/dist/es/chunk/{BcTuAX8r.mjs → Dsye5ZEp.mjs} +5 -3
- package/dist/es/chunk/{BsLJxiSC.mjs → Dw-yyl2m.mjs} +1 -1
- package/dist/es/chunk/{DXPWe_a5.mjs → U13Qpiki.mjs} +19 -13
- package/dist/es/chunk/{axpwSky6.mjs → _8u_XVHh.mjs} +168 -120
- package/dist/es/chunk/egk9EEzo.mjs +66 -0
- package/dist/es/chunk/{BUEEWLrd.mjs → ezK_XQQd.mjs} +15 -6
- package/dist/es/chunk/{Bl2KlMdP.mjs → oW98L-44.mjs} +8 -3
- package/dist/es/chunk/{Dk6Bx0KT.mjs → plK2vnjp.mjs} +8 -5
- package/dist/es/components/awesome-icon/awesome-icon.mjs +2 -1
- package/dist/es/components/backbottom/backbottom.mjs +2 -2
- package/dist/es/components/button/button.mjs +105 -76
- package/dist/es/components/choice/choice.mjs +2 -2
- package/dist/es/components/config-provider/config-provider.d.ts +1 -0
- package/dist/es/components/config-provider/config-provider.mjs +13 -5
- package/dist/es/components/cropper/cropper.mjs +44 -33
- package/dist/es/components/currency/currency.mjs +5 -5
- package/dist/es/components/daterange-picker/daterange-picker.mjs +2267 -1522
- package/dist/es/components/dialog/dialog.mjs +213 -172
- package/dist/es/components/dialog/index.css +1 -1
- package/dist/es/components/dialog-camera-upload/dialog-camera-upload.mjs +11 -11
- package/dist/es/components/dialog-map-point/dialog-map-point.mjs +5 -4
- package/dist/es/components/dialog-upload-images/dialog-upload-images.mjs +495 -314
- package/dist/es/components/dialog-upload-images/index.css +1 -1
- package/dist/es/components/drag-verify/drag-verify.mjs +3 -3
- package/dist/es/components/drawer/drawer.mjs +136 -94
- package/dist/es/components/drawer/index.css +1 -1
- package/dist/es/components/easy-pagination/easy-pagination.mjs +2 -2
- package/dist/es/components/el-icon/el-icon.mjs +1 -1
- package/dist/es/components/el-icon/index.css +3 -2
- package/dist/es/components/flag/flag.mjs +2 -1
- package/dist/es/components/icon/icon.mjs +10 -31
- package/dist/es/components/icon/icon.vue.d.ts +1 -1
- package/dist/es/components/icon/icon2.mjs +1 -1
- package/dist/es/components/icon/index.mjs +2 -2
- package/dist/es/components/icon-picker/components/collections.vue.d.ts +625 -0
- package/dist/es/components/icon-picker/components/panel.vue.d.ts +9 -0
- package/dist/es/components/icon-picker/icon-picker.d.ts +40 -0
- package/dist/es/components/icon-picker/icon-picker.mjs +1375 -0
- package/dist/es/components/icon-picker/icon-picker.vue.d.ts +9 -0
- package/dist/es/components/icon-picker/index.css +121 -0
- package/dist/es/components/icon-picker/index.d.ts +4 -0
- package/dist/es/components/icon-picker/index.mjs +6 -0
- package/dist/es/components/iconify-icon/iconify-icon.d.ts +5 -0
- package/dist/es/components/iconify-icon/iconify-icon.mjs +1860 -0
- package/dist/es/components/iconify-icon/iconify-icon.vue.d.ts +6 -0
- package/dist/es/components/iconify-icon/index.css +11 -0
- package/dist/es/components/iconify-icon/index.d.ts +4 -0
- package/dist/es/components/iconify-icon/index.mjs +6 -0
- package/dist/es/components/image/image.mjs +5 -5
- package/dist/es/components/input/input.mjs +4 -4
- package/dist/es/components/input/input.vue.d.ts +63 -54
- package/dist/es/components/input-number/input-number.mjs +5 -5
- package/dist/es/components/pca-picker/components/c.vue.d.ts +4 -4
- package/dist/es/components/pca-picker/index.css +1 -1
- package/dist/es/components/pca-picker/pca-picker.mjs +154 -160
- package/dist/es/components/pca-picker/pca-picker.vue.d.ts +12 -11
- package/dist/es/components/qr-code/qr-code.mjs +2 -1
- package/dist/es/components/screenfull/screenfull.mjs +6 -5
- package/dist/es/components/scrollbar/index.css +18 -0
- package/dist/es/components/scrollbar/index.d.ts +4 -0
- package/dist/es/components/scrollbar/index.mjs +6 -0
- package/dist/es/components/scrollbar/scrollbar.d.ts +4 -0
- package/dist/es/components/scrollbar/scrollbar.mjs +65 -0
- package/dist/es/components/scrollbar/scrollbar.vue.d.ts +588 -0
- package/dist/es/components/select/select.mjs +7 -7
- package/dist/es/components/single-player/index.css +1 -1
- package/dist/es/components/single-player/single-player.mjs +265 -166
- package/dist/es/components/svg-icon/index.css +3 -2
- package/dist/es/components/svg-icon/svg-icon.mjs +3 -3
- package/dist/es/components/switch/switch.mjs +2 -2
- package/dist/es/components/sync-scroll-container/sync-scroll-container.mjs +2 -2
- package/dist/es/components/tags/tags.mjs +9 -9
- package/dist/es/components/text-ellipsis/text-ellipsis.mjs +4 -4
- package/dist/es/components/thousand-input/thousand-input.mjs +5 -4
- package/dist/es/components/thousand-input/thousand-input.vue.d.ts +126 -108
- package/dist/es/components/tinymce/index.css +1 -1
- package/dist/es/components/tinymce/tinymce.mjs +9 -8
- package/dist/es/components/tree-picker/components/popover-cascader.vue.d.ts +179 -141
- package/dist/es/components/tree-picker/popover-cascader.css +1 -1
- package/dist/es/components/tree-picker/tree-picker.mjs +10 -10
- package/dist/es/components/tree-picker/tree-picker.vue.d.ts +12 -11
- package/dist/es/components/upload-file/upload-file.mjs +3 -3
- package/dist/es/index.d.ts +3 -0
- package/dist/es/index.mjs +41 -31
- package/dist/global.d.ts +3 -0
- package/dist/index.css +166 -22
- package/package.json +8 -2
- package/dist/es/chunk/BtTIs3tG.mjs +0 -138
- package/dist/es/chunk/C7wQNvSS.mjs +0 -728
- package/dist/es/chunk/Cbhe4I9Z.mjs +0 -16
- package/dist/es/chunk/DihosKp1.mjs +0 -140
- package/dist/es/components/icon/index.css +0 -9
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { u as useTooltipContentProps, E as Ee, a as ElTooltip } from './
|
|
3
|
-
import { s as scrollbarEmits, E as ElScrollbar } from './
|
|
4
|
-
import { t as tagProps, E as ElTag } from './
|
|
5
|
-
import { E as ElIcon } from './
|
|
6
|
-
import { i as isEqual } from './
|
|
7
|
-
import { g as get, u as useLocale } from './
|
|
8
|
-
import { c as buildProps, t as throwError, p as isObject, u as useNamespace, e as debugWarn, i as isArray$1, a as isEmpty, g as isUndefined, f as isNumber, j as isFunction, l as isPlainObject, k as isNil, h as isString, d as definePropType } from './
|
|
9
|
-
import { b as isArray } from './
|
|
10
|
-
import { _ as _export_sfc, w as withInstall, a as withNoopInstall } from './
|
|
11
|
-
import { u as useId } from './
|
|
1
|
+
import { ref, watch, inject, computed, getCurrentInstance, toRaw, defineComponent, withDirectives, createElementBlock, openBlock, withModifiers, normalizeClass, renderSlot, createElementVNode, toDisplayString, vShow, unref, toRefs, reactive, onBeforeUnmount, nextTick, normalizeStyle, createCommentVNode, onMounted, useSlots, watchEffect, provide, isVNode, shallowRef, resolveComponent, resolveDirective, mergeProps, toHandlerKey, createVNode, withCtx, createBlock, Fragment, renderList, createTextVNode, vModelText, resolveDynamicComponent } from 'vue';
|
|
2
|
+
import { u as useTooltipContentProps, E as Ee, a as ElTooltip } from './DMYHOxhk.mjs';
|
|
3
|
+
import { s as scrollbarEmits, E as ElScrollbar } from './_8u_XVHh.mjs';
|
|
4
|
+
import { t as tagProps, E as ElTag } from './B1BnPYNG.mjs';
|
|
5
|
+
import { E as ElIcon } from './DEPZhJ0Z.mjs';
|
|
6
|
+
import { i as isEqual } from './Dw-yyl2m.mjs';
|
|
7
|
+
import { g as get, u as useLocale } from './plK2vnjp.mjs';
|
|
8
|
+
import { c as buildProps, t as throwError, p as isObject, u as useNamespace, e as debugWarn, i as isArray$1, a as isEmpty, g as isUndefined, f as isNumber, j as isFunction, l as isPlainObject, k as isNil, h as isString, d as definePropType } from './CcKUdl3e.mjs';
|
|
9
|
+
import { b as isArray } from './DWcIzeMM.mjs';
|
|
10
|
+
import { _ as _export_sfc, w as withInstall, a as withNoopInstall } from './BTsEMnf_.mjs';
|
|
11
|
+
import { u as useId } from './DQHGjqG5.mjs';
|
|
12
12
|
import { useResizeObserver, isIOS, isClient, useDebounceFn, useMutationObserver } from '@vueuse/core';
|
|
13
|
-
import {
|
|
14
|
-
import { a as
|
|
15
|
-
import { a as
|
|
13
|
+
import { s as scrollIntoView } from './oW98L-44.mjs';
|
|
14
|
+
import { u as useFormItem, a as useFormItemInputId, b as useFormDisabled, c as useFormSize } from './U13Qpiki.mjs';
|
|
15
|
+
import { a as useEmptyValues, u as useEmptyValuesProps } from './Dsye5ZEp.mjs';
|
|
16
|
+
import { a as useComposition, u as useFocusController } from './CM_I1FoA.mjs';
|
|
16
17
|
import { V as ValidateComponentsMap, i as iconPropType } from '../components/icon/icon2.mjs';
|
|
17
18
|
import { g as getEventCode, E as EVENT_CODE } from './BTpNRPQW.mjs';
|
|
18
19
|
import { U as UPDATE_MODEL_EVENT, C as CHANGE_EVENT } from './Ct6q2FXg.mjs';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { c as clamp } from './73YgKz3H.mjs';
|
|
20
|
+
import { b as baseIteratee } from './Dcm-lOj8.mjs';
|
|
21
|
+
import { c as clamp } from './BLLKi_0v.mjs';
|
|
22
22
|
import { ArrowDown, CircleClose } from '@element-plus/icons-vue';
|
|
23
|
-
import { u as useSizeProp } from './
|
|
24
|
-
import { u as useAriaProps } from './
|
|
25
|
-
import { C as ClickOutside } from './
|
|
26
|
-
import { f as flattedChildren } from './
|
|
23
|
+
import { u as useSizeProp } from './BK4T_2ha.mjs';
|
|
24
|
+
import { u as useAriaProps } from './BDyXj_90.mjs';
|
|
25
|
+
import { C as ClickOutside } from './CL5WTCB3.mjs';
|
|
26
|
+
import { f as flattedChildren } from './BYVaz5Or.mjs';
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* The base implementation of `_.findIndex` and `_.findLastIndex` without
|
|
@@ -133,27 +133,6 @@ function findLastIndex(array, predicate, fromIndex) {
|
|
|
133
133
|
return baseFindIndex(array, baseIteratee(predicate), index);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
const MINIMUM_INPUT_WIDTH = 11;
|
|
137
|
-
const BORDER_HORIZONTAL_WIDTH = 2;
|
|
138
|
-
|
|
139
|
-
function useCalcInputWidth() {
|
|
140
|
-
const calculatorRef = shallowRef();
|
|
141
|
-
const calculatorWidth = ref(0);
|
|
142
|
-
const inputStyle = computed(() => ({
|
|
143
|
-
minWidth: `${Math.max(calculatorWidth.value, MINIMUM_INPUT_WIDTH)}px`
|
|
144
|
-
}));
|
|
145
|
-
const resetCalculatorWidth = () => {
|
|
146
|
-
var _a, _b;
|
|
147
|
-
calculatorWidth.value = (_b = (_a = calculatorRef.value) == null ? void 0 : _a.getBoundingClientRect().width) != null ? _b : 0;
|
|
148
|
-
};
|
|
149
|
-
useResizeObserver(calculatorRef, resetCalculatorWidth);
|
|
150
|
-
return {
|
|
151
|
-
calculatorRef,
|
|
152
|
-
calculatorWidth,
|
|
153
|
-
inputStyle
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
|
|
157
136
|
const defaultProps = {
|
|
158
137
|
label: "label",
|
|
159
138
|
value: "value",
|
|
@@ -163,12 +142,16 @@ const defaultProps = {
|
|
|
163
142
|
function useProps(props) {
|
|
164
143
|
const aliasProps = ref({ ...defaultProps, ...props.props });
|
|
165
144
|
let cache = { ...props.props };
|
|
166
|
-
watch(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
cache
|
|
170
|
-
|
|
171
|
-
|
|
145
|
+
watch(
|
|
146
|
+
() => props.props,
|
|
147
|
+
(val) => {
|
|
148
|
+
if (!isEqual(val, cache)) {
|
|
149
|
+
aliasProps.value = { ...defaultProps, ...val };
|
|
150
|
+
cache = { ...val };
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
{ deep: true }
|
|
154
|
+
);
|
|
172
155
|
const getLabel = (option) => get(option, aliasProps.value.label);
|
|
173
156
|
const getValue = (option) => get(option, aliasProps.value.value);
|
|
174
157
|
const getDisabled = (option) => get(option, aliasProps.value.disabled);
|
|
@@ -248,27 +231,37 @@ function useOption(props, states) {
|
|
|
248
231
|
const regexp = new RegExp(escapeStringRegexp(query), "i");
|
|
249
232
|
states.visible = regexp.test(String(currentLabel.value)) || props.created;
|
|
250
233
|
};
|
|
251
|
-
watch(
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
const { remote, valueKey } = select.props;
|
|
257
|
-
const shouldUpdate = remote ? val !== oldVal : !isEqual(val, oldVal);
|
|
258
|
-
if (shouldUpdate) {
|
|
259
|
-
select.onOptionDestroy(oldVal, instance.proxy);
|
|
260
|
-
select.onOptionCreate(instance.proxy);
|
|
234
|
+
watch(
|
|
235
|
+
() => currentLabel.value,
|
|
236
|
+
() => {
|
|
237
|
+
if (!props.created && !select.props.remote)
|
|
238
|
+
select.setSelected();
|
|
261
239
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
240
|
+
);
|
|
241
|
+
watch(
|
|
242
|
+
() => props.value,
|
|
243
|
+
(val, oldVal) => {
|
|
244
|
+
const { remote, valueKey } = select.props;
|
|
245
|
+
const shouldUpdate = remote ? val !== oldVal : !isEqual(val, oldVal);
|
|
246
|
+
if (shouldUpdate) {
|
|
247
|
+
select.onOptionDestroy(oldVal, instance.proxy);
|
|
248
|
+
select.onOptionCreate(instance.proxy);
|
|
249
|
+
}
|
|
250
|
+
if (!props.created && !remote) {
|
|
251
|
+
if (valueKey && isObject(val) && isObject(oldVal) && val[valueKey] === oldVal[valueKey]) {
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
select.setSelected();
|
|
265
255
|
}
|
|
266
|
-
select.setSelected();
|
|
267
256
|
}
|
|
268
|
-
|
|
269
|
-
watch(
|
|
270
|
-
|
|
271
|
-
|
|
257
|
+
);
|
|
258
|
+
watch(
|
|
259
|
+
() => selectGroup.disabled,
|
|
260
|
+
() => {
|
|
261
|
+
states.groupDisabled = selectGroup.disabled;
|
|
262
|
+
},
|
|
263
|
+
{ immediate: true }
|
|
264
|
+
);
|
|
272
265
|
return {
|
|
273
266
|
select,
|
|
274
267
|
currentLabel,
|
|
@@ -345,24 +338,33 @@ const _sfc_main$3 = defineComponent({
|
|
|
345
338
|
};
|
|
346
339
|
}
|
|
347
340
|
});
|
|
348
|
-
|
|
341
|
+
const _hoisted_1$1 = ["id", "aria-disabled", "aria-selected"];
|
|
342
|
+
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
349
343
|
return withDirectives((openBlock(), createElementBlock("li", {
|
|
350
344
|
id: _ctx.id,
|
|
351
345
|
class: normalizeClass(_ctx.containerKls),
|
|
352
346
|
role: "option",
|
|
353
347
|
"aria-disabled": _ctx.isDisabled || void 0,
|
|
354
348
|
"aria-selected": _ctx.itemSelected,
|
|
355
|
-
onMousemove: _ctx.hoverItem,
|
|
356
|
-
onClick: withModifiers(_ctx.selectOptionClick, ["stop"])
|
|
349
|
+
onMousemove: _cache[0] || (_cache[0] = (...args) => _ctx.hoverItem && _ctx.hoverItem(...args)),
|
|
350
|
+
onClick: _cache[1] || (_cache[1] = withModifiers((...args) => _ctx.selectOptionClick && _ctx.selectOptionClick(...args), ["stop"]))
|
|
357
351
|
}, [
|
|
358
352
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
359
|
-
createElementVNode(
|
|
353
|
+
createElementVNode(
|
|
354
|
+
"span",
|
|
355
|
+
null,
|
|
356
|
+
toDisplayString(_ctx.currentLabel),
|
|
357
|
+
1
|
|
358
|
+
)
|
|
360
359
|
])
|
|
361
|
-
], 42,
|
|
360
|
+
], 42, _hoisted_1$1)), [
|
|
362
361
|
[vShow, _ctx.visible]
|
|
363
362
|
]);
|
|
364
363
|
}
|
|
365
|
-
var Option = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__file", "option.vue"]]);
|
|
364
|
+
var Option = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/select/src/option.vue"]]);
|
|
365
|
+
|
|
366
|
+
const MINIMUM_INPUT_WIDTH = 11;
|
|
367
|
+
const BORDER_HORIZONTAL_WIDTH = 2;
|
|
366
368
|
|
|
367
369
|
const _sfc_main$2 = defineComponent({
|
|
368
370
|
name: "ElSelectDropdown",
|
|
@@ -397,29 +399,45 @@ const _sfc_main$2 = defineComponent({
|
|
|
397
399
|
}
|
|
398
400
|
});
|
|
399
401
|
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
400
|
-
return openBlock(), createElementBlock(
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
402
|
+
return openBlock(), createElementBlock(
|
|
403
|
+
"div",
|
|
404
|
+
{
|
|
405
|
+
class: normalizeClass([_ctx.ns.b("dropdown"), _ctx.ns.is("multiple", _ctx.isMultiple), _ctx.popperClass]),
|
|
406
|
+
style: normalizeStyle({ [_ctx.isFitInputWidth ? "width" : "minWidth"]: _ctx.minWidth })
|
|
407
|
+
},
|
|
408
|
+
[
|
|
409
|
+
_ctx.$slots.header ? (openBlock(), createElementBlock(
|
|
410
|
+
"div",
|
|
411
|
+
{
|
|
412
|
+
key: 0,
|
|
413
|
+
class: normalizeClass(_ctx.ns.be("dropdown", "header"))
|
|
414
|
+
},
|
|
415
|
+
[
|
|
416
|
+
renderSlot(_ctx.$slots, "header")
|
|
417
|
+
],
|
|
418
|
+
2
|
|
419
|
+
)) : createCommentVNode("v-if", true),
|
|
420
|
+
renderSlot(_ctx.$slots, "default"),
|
|
421
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock(
|
|
422
|
+
"div",
|
|
423
|
+
{
|
|
424
|
+
key: 1,
|
|
425
|
+
class: normalizeClass(_ctx.ns.be("dropdown", "footer"))
|
|
426
|
+
},
|
|
427
|
+
[
|
|
428
|
+
renderSlot(_ctx.$slots, "footer")
|
|
429
|
+
],
|
|
430
|
+
2
|
|
431
|
+
)) : createCommentVNode("v-if", true)
|
|
432
|
+
],
|
|
433
|
+
6
|
|
434
|
+
);
|
|
418
435
|
}
|
|
419
|
-
var ElSelectMenu = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__file", "select-dropdown.vue"]]);
|
|
436
|
+
var ElSelectMenu = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/select/src/select-dropdown.vue"]]);
|
|
420
437
|
|
|
421
438
|
const useSelect = (props, emit) => {
|
|
422
439
|
const { t } = useLocale();
|
|
440
|
+
const slots = useSlots();
|
|
423
441
|
const contentId = useId();
|
|
424
442
|
const nsSelect = useNamespace("select");
|
|
425
443
|
const nsInput = useNamespace("input");
|
|
@@ -497,12 +515,20 @@ const useSelect = (props, emit) => {
|
|
|
497
515
|
const showClearBtn = computed(() => {
|
|
498
516
|
return props.clearable && !selectDisabled.value && hasModelValue.value && (isFocused.value || states.inputHovering);
|
|
499
517
|
});
|
|
500
|
-
const iconComponent = computed(
|
|
501
|
-
|
|
518
|
+
const iconComponent = computed(
|
|
519
|
+
() => props.remote && props.filterable && !props.remoteShowSuffix ? "" : props.suffixIcon
|
|
520
|
+
);
|
|
521
|
+
const iconReverse = computed(
|
|
522
|
+
() => nsSelect.is("reverse", !!(iconComponent.value && expanded.value))
|
|
523
|
+
);
|
|
502
524
|
const validateState = computed(() => (formItem == null ? void 0 : formItem.validateState) || "");
|
|
503
|
-
const validateIcon = computed(
|
|
525
|
+
const validateIcon = computed(
|
|
526
|
+
() => validateState.value && ValidateComponentsMap[validateState.value]
|
|
527
|
+
);
|
|
504
528
|
const debounce = computed(() => props.remote ? props.debounce : 0);
|
|
505
|
-
const isRemoteSearchEmpty = computed(
|
|
529
|
+
const isRemoteSearchEmpty = computed(
|
|
530
|
+
() => props.remote && !states.inputValue && states.options.size === 0
|
|
531
|
+
);
|
|
506
532
|
const emptyText = computed(() => {
|
|
507
533
|
if (props.loading) {
|
|
508
534
|
return props.loadingText || t("el.select.loading");
|
|
@@ -516,7 +542,9 @@ const useSelect = (props, emit) => {
|
|
|
516
542
|
}
|
|
517
543
|
return null;
|
|
518
544
|
});
|
|
519
|
-
const filteredOptionsCount = computed(
|
|
545
|
+
const filteredOptionsCount = computed(
|
|
546
|
+
() => optionsArray.value.filter((option) => option.visible).length
|
|
547
|
+
);
|
|
520
548
|
const optionsArray = computed(() => {
|
|
521
549
|
const list = Array.from(states.options.values());
|
|
522
550
|
const newList = [];
|
|
@@ -528,7 +556,9 @@ const useSelect = (props, emit) => {
|
|
|
528
556
|
});
|
|
529
557
|
return newList.length >= list.length ? newList : list;
|
|
530
558
|
});
|
|
531
|
-
const cachedOptionsArray = computed(
|
|
559
|
+
const cachedOptionsArray = computed(
|
|
560
|
+
() => Array.from(states.cachedOptions.values())
|
|
561
|
+
);
|
|
532
562
|
const showNewOption = computed(() => {
|
|
533
563
|
const hasExistingOption = optionsArray.value.filter((option) => {
|
|
534
564
|
return !option.created;
|
|
@@ -548,10 +578,12 @@ const useSelect = (props, emit) => {
|
|
|
548
578
|
});
|
|
549
579
|
};
|
|
550
580
|
const selectSize = useFormSize();
|
|
551
|
-
const collapseTagSize = computed(
|
|
581
|
+
const collapseTagSize = computed(
|
|
582
|
+
() => ["small"].includes(selectSize.value) ? "small" : "default"
|
|
583
|
+
);
|
|
552
584
|
const dropdownMenuVisible = computed({
|
|
553
585
|
get() {
|
|
554
|
-
return expanded.value && (props.loading || !isRemoteSearchEmpty.value) && (!debouncing.value || !isEmpty(states.previousQuery));
|
|
586
|
+
return expanded.value && (props.loading || !isRemoteSearchEmpty.value || props.remote && !!slots.empty) && (!debouncing.value || !isEmpty(states.previousQuery));
|
|
555
587
|
},
|
|
556
588
|
set(val) {
|
|
557
589
|
expanded.value = val;
|
|
@@ -570,40 +602,51 @@ const useSelect = (props, emit) => {
|
|
|
570
602
|
return props.multiple || !hasModelValue.value ? _placeholder : states.selectedLabel;
|
|
571
603
|
});
|
|
572
604
|
const mouseEnterEventName = computed(() => isIOS ? null : "mouseenter");
|
|
573
|
-
watch(
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
605
|
+
watch(
|
|
606
|
+
() => props.modelValue,
|
|
607
|
+
(val, oldVal) => {
|
|
608
|
+
if (props.multiple) {
|
|
609
|
+
if (props.filterable && !props.reserveKeyword) {
|
|
610
|
+
states.inputValue = "";
|
|
611
|
+
handleQueryChange("");
|
|
612
|
+
}
|
|
578
613
|
}
|
|
614
|
+
setSelected();
|
|
615
|
+
if (!isEqual(val, oldVal) && props.validateEvent) {
|
|
616
|
+
formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err));
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
flush: "post",
|
|
621
|
+
deep: true
|
|
579
622
|
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
} else {
|
|
592
|
-
states.inputValue = "";
|
|
593
|
-
states.previousQuery = null;
|
|
594
|
-
states.isBeforeHide = true;
|
|
623
|
+
);
|
|
624
|
+
watch(
|
|
625
|
+
() => expanded.value,
|
|
626
|
+
(val) => {
|
|
627
|
+
if (val) {
|
|
628
|
+
handleQueryChange(states.inputValue);
|
|
629
|
+
} else {
|
|
630
|
+
states.inputValue = "";
|
|
631
|
+
states.previousQuery = null;
|
|
632
|
+
states.isBeforeHide = true;
|
|
633
|
+
}
|
|
595
634
|
}
|
|
596
|
-
|
|
597
|
-
watch(
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
635
|
+
);
|
|
636
|
+
watch(
|
|
637
|
+
() => states.options.entries(),
|
|
638
|
+
() => {
|
|
639
|
+
if (!isClient)
|
|
640
|
+
return;
|
|
641
|
+
setSelected();
|
|
642
|
+
if (props.defaultFirstOption && (props.filterable || props.remote) && filteredOptionsCount.value) {
|
|
643
|
+
checkDefaultFirstOption();
|
|
644
|
+
}
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
flush: "post"
|
|
603
648
|
}
|
|
604
|
-
|
|
605
|
-
flush: "post"
|
|
606
|
-
});
|
|
649
|
+
);
|
|
607
650
|
watch([() => states.hoveringIndex, optionsArray], ([val]) => {
|
|
608
651
|
if (isNumber(val) && val > -1) {
|
|
609
652
|
hoverOption.value = optionsArray.value[val] || {};
|
|
@@ -636,11 +679,16 @@ const useSelect = (props, emit) => {
|
|
|
636
679
|
}
|
|
637
680
|
};
|
|
638
681
|
const checkDefaultFirstOption = () => {
|
|
639
|
-
const optionsInDropdown = optionsArray.value.filter(
|
|
682
|
+
const optionsInDropdown = optionsArray.value.filter(
|
|
683
|
+
(n) => n.visible && !n.disabled && !n.states.groupDisabled
|
|
684
|
+
);
|
|
640
685
|
const userCreatedOption = optionsInDropdown.find((n) => n.created);
|
|
641
686
|
const firstOriginOption = optionsInDropdown[0];
|
|
642
687
|
const valueList = optionsArray.value.map((item) => item.value);
|
|
643
|
-
states.hoveringIndex = getValueIndex(
|
|
688
|
+
states.hoveringIndex = getValueIndex(
|
|
689
|
+
valueList,
|
|
690
|
+
userCreatedOption || firstOriginOption
|
|
691
|
+
);
|
|
644
692
|
};
|
|
645
693
|
const setSelected = () => {
|
|
646
694
|
if (!props.multiple) {
|
|
@@ -692,13 +740,17 @@ const useSelect = (props, emit) => {
|
|
|
692
740
|
const length = states.selected.length;
|
|
693
741
|
if (length > 0) {
|
|
694
742
|
const lastOption = states.selected[length - 1];
|
|
695
|
-
states.hoveringIndex = optionsArray.value.findIndex(
|
|
743
|
+
states.hoveringIndex = optionsArray.value.findIndex(
|
|
744
|
+
(item) => getValueKey(lastOption) === getValueKey(item)
|
|
745
|
+
);
|
|
696
746
|
} else {
|
|
697
747
|
states.hoveringIndex = -1;
|
|
698
748
|
}
|
|
699
749
|
};
|
|
700
750
|
const resetSelectionWidth = () => {
|
|
701
|
-
states.selectionWidth = Number.parseFloat(
|
|
751
|
+
states.selectionWidth = Number.parseFloat(
|
|
752
|
+
window.getComputedStyle(selectionRef.value).width
|
|
753
|
+
);
|
|
702
754
|
};
|
|
703
755
|
const resetCollapseItemWidth = () => {
|
|
704
756
|
states.collapseItemWidth = collapseItemRef.value.getBoundingClientRect().width;
|
|
@@ -829,13 +881,18 @@ const useSelect = (props, emit) => {
|
|
|
829
881
|
const targetOption = isArray$1(option) ? option[option.length - 1] : option;
|
|
830
882
|
let target = null;
|
|
831
883
|
if (!isNil(targetOption == null ? void 0 : targetOption.value)) {
|
|
832
|
-
const options = optionsArray.value.filter(
|
|
884
|
+
const options = optionsArray.value.filter(
|
|
885
|
+
(item) => item.value === targetOption.value
|
|
886
|
+
);
|
|
833
887
|
if (options.length > 0) {
|
|
834
888
|
target = options[0].$el;
|
|
835
889
|
}
|
|
836
890
|
}
|
|
837
891
|
if (tooltipRef.value && target) {
|
|
838
|
-
const menu = (_d = (_c = (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef) == null ? void 0 : _c.querySelector) == null ? void 0 : _d.call(
|
|
892
|
+
const menu = (_d = (_c = (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef) == null ? void 0 : _c.querySelector) == null ? void 0 : _d.call(
|
|
893
|
+
_c,
|
|
894
|
+
`.${nsSelect.be("dropdown", "wrap")}`
|
|
895
|
+
);
|
|
839
896
|
if (menu) {
|
|
840
897
|
scrollIntoView(menu, target);
|
|
841
898
|
}
|
|
@@ -921,7 +978,9 @@ const useSelect = (props, emit) => {
|
|
|
921
978
|
const getValueKey = (item) => {
|
|
922
979
|
return isObject(item.value) ? get(item.value, props.valueKey) : item.value;
|
|
923
980
|
};
|
|
924
|
-
const optionsAllDisabled = computed(
|
|
981
|
+
const optionsAllDisabled = computed(
|
|
982
|
+
() => optionsArray.value.filter((option) => option.visible).every((option) => option.isDisabled)
|
|
983
|
+
);
|
|
925
984
|
const showTagList = computed(() => {
|
|
926
985
|
if (!props.multiple) {
|
|
927
986
|
return [];
|
|
@@ -1058,15 +1117,18 @@ const useSelect = (props, emit) => {
|
|
|
1058
1117
|
useResizeObserver(tagMenuRef, updateTagTooltip);
|
|
1059
1118
|
useResizeObserver(collapseItemRef, resetCollapseItemWidth);
|
|
1060
1119
|
let stop;
|
|
1061
|
-
watch(
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1120
|
+
watch(
|
|
1121
|
+
() => dropdownMenuVisible.value,
|
|
1122
|
+
(newVal) => {
|
|
1123
|
+
if (newVal) {
|
|
1124
|
+
stop = useResizeObserver(menuRef, updateTooltip).stop;
|
|
1125
|
+
} else {
|
|
1126
|
+
stop == null ? void 0 : stop();
|
|
1127
|
+
stop = void 0;
|
|
1128
|
+
}
|
|
1129
|
+
emit("visible-change", newVal);
|
|
1067
1130
|
}
|
|
1068
|
-
|
|
1069
|
-
});
|
|
1131
|
+
);
|
|
1070
1132
|
onMounted(() => {
|
|
1071
1133
|
setSelected();
|
|
1072
1134
|
});
|
|
@@ -1162,7 +1224,9 @@ var ElOptions = defineComponent({
|
|
|
1162
1224
|
var _a2, _b2, _c, _d;
|
|
1163
1225
|
const name = (_a2 = (item == null ? void 0 : item.type) || {}) == null ? void 0 : _a2.name;
|
|
1164
1226
|
if (name === "ElOptionGroup") {
|
|
1165
|
-
filterOptions(
|
|
1227
|
+
filterOptions(
|
|
1228
|
+
!isString(item.children) && !isArray$1(item.children) && isFunction((_b2 = item.children) == null ? void 0 : _b2.default) ? (_c = item.children) == null ? void 0 : _c.default() : item.children
|
|
1229
|
+
);
|
|
1166
1230
|
} else if (name === "ElOption") {
|
|
1167
1231
|
valueList.push((_d = item.props) == null ? void 0 : _d.value);
|
|
1168
1232
|
} else if (isArray$1(item.children)) {
|
|
@@ -1331,10 +1395,15 @@ const _sfc_main$1 = defineComponent({
|
|
|
1331
1395
|
const groupRef = ref();
|
|
1332
1396
|
const instance = getCurrentInstance();
|
|
1333
1397
|
const children = ref([]);
|
|
1334
|
-
provide(
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1398
|
+
provide(
|
|
1399
|
+
selectGroupKey,
|
|
1400
|
+
reactive({
|
|
1401
|
+
...toRefs(props)
|
|
1402
|
+
})
|
|
1403
|
+
);
|
|
1404
|
+
const visible = computed(
|
|
1405
|
+
() => children.value.some((option) => option.visible === true)
|
|
1406
|
+
);
|
|
1338
1407
|
const isOption = (node) => {
|
|
1339
1408
|
var _a;
|
|
1340
1409
|
return node.type.name === "ElOption" && !!((_a = node.component) == null ? void 0 : _a.proxy);
|
|
@@ -1375,25 +1444,58 @@ const _sfc_main$1 = defineComponent({
|
|
|
1375
1444
|
}
|
|
1376
1445
|
});
|
|
1377
1446
|
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1378
|
-
return withDirectives((openBlock(), createElementBlock(
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1447
|
+
return withDirectives((openBlock(), createElementBlock(
|
|
1448
|
+
"ul",
|
|
1449
|
+
{
|
|
1450
|
+
ref: "groupRef",
|
|
1451
|
+
class: normalizeClass(_ctx.ns.be("group", "wrap"))
|
|
1452
|
+
},
|
|
1453
|
+
[
|
|
1454
|
+
createElementVNode(
|
|
1455
|
+
"li",
|
|
1456
|
+
{
|
|
1457
|
+
class: normalizeClass(_ctx.ns.be("group", "title"))
|
|
1458
|
+
},
|
|
1459
|
+
toDisplayString(_ctx.label),
|
|
1460
|
+
3
|
|
1461
|
+
),
|
|
1462
|
+
createElementVNode("li", null, [
|
|
1463
|
+
createElementVNode(
|
|
1464
|
+
"ul",
|
|
1465
|
+
{
|
|
1466
|
+
class: normalizeClass(_ctx.ns.b("group"))
|
|
1467
|
+
},
|
|
1468
|
+
[
|
|
1469
|
+
renderSlot(_ctx.$slots, "default")
|
|
1470
|
+
],
|
|
1471
|
+
2
|
|
1472
|
+
)
|
|
1473
|
+
])
|
|
1474
|
+
],
|
|
1475
|
+
2
|
|
1476
|
+
)), [
|
|
1393
1477
|
[vShow, _ctx.visible]
|
|
1394
1478
|
]);
|
|
1395
1479
|
}
|
|
1396
|
-
var OptionGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "option-group.vue"]]);
|
|
1480
|
+
var OptionGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/select/src/option-group.vue"]]);
|
|
1481
|
+
|
|
1482
|
+
function useCalcInputWidth() {
|
|
1483
|
+
const calculatorRef = shallowRef();
|
|
1484
|
+
const calculatorWidth = ref(0);
|
|
1485
|
+
const inputStyle = computed(() => ({
|
|
1486
|
+
minWidth: `${Math.max(calculatorWidth.value, MINIMUM_INPUT_WIDTH)}px`
|
|
1487
|
+
}));
|
|
1488
|
+
const resetCalculatorWidth = () => {
|
|
1489
|
+
var _a, _b;
|
|
1490
|
+
calculatorWidth.value = (_b = (_a = calculatorRef.value) == null ? void 0 : _a.getBoundingClientRect().width) != null ? _b : 0;
|
|
1491
|
+
};
|
|
1492
|
+
useResizeObserver(calculatorRef, resetCalculatorWidth);
|
|
1493
|
+
return {
|
|
1494
|
+
calculatorRef,
|
|
1495
|
+
calculatorWidth,
|
|
1496
|
+
inputStyle
|
|
1497
|
+
};
|
|
1498
|
+
}
|
|
1397
1499
|
|
|
1398
1500
|
const COMPONENT_NAME = "ElSelect";
|
|
1399
1501
|
const warnHandlerMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -1401,7 +1503,9 @@ const createSelectWarnHandler = (appContext) => {
|
|
|
1401
1503
|
return (...args) => {
|
|
1402
1504
|
var _a, _b;
|
|
1403
1505
|
const message = args[0];
|
|
1404
|
-
if (!message || message.includes(
|
|
1506
|
+
if (!message || message.includes(
|
|
1507
|
+
'Slot "default" invoked outside of the render function'
|
|
1508
|
+
) && ((_a = args[2]) == null ? void 0 : _a.includes("ElTreeSelect")))
|
|
1405
1509
|
return;
|
|
1406
1510
|
const original = (_b = warnHandlerMap.get(appContext)) == null ? void 0 : _b.originalWarnHandler;
|
|
1407
1511
|
if (original) {
|
|
@@ -1503,29 +1607,36 @@ const _sfc_main = defineComponent({
|
|
|
1503
1607
|
}
|
|
1504
1608
|
});
|
|
1505
1609
|
};
|
|
1506
|
-
watch(
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1610
|
+
watch(
|
|
1611
|
+
() => {
|
|
1612
|
+
var _a;
|
|
1613
|
+
return [(_a = slots.default) == null ? void 0 : _a.call(slots), modelValue.value];
|
|
1614
|
+
},
|
|
1615
|
+
() => {
|
|
1616
|
+
var _a;
|
|
1617
|
+
if (props.persistent || API.expanded.value) {
|
|
1618
|
+
return;
|
|
1619
|
+
}
|
|
1620
|
+
API.states.options.clear();
|
|
1621
|
+
manuallyRenderSlots((_a = slots.default) == null ? void 0 : _a.call(slots));
|
|
1622
|
+
},
|
|
1623
|
+
{
|
|
1624
|
+
immediate: true
|
|
1513
1625
|
}
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
}));
|
|
1626
|
+
);
|
|
1627
|
+
provide(
|
|
1628
|
+
selectKey,
|
|
1629
|
+
reactive({
|
|
1630
|
+
props: _props,
|
|
1631
|
+
states: API.states,
|
|
1632
|
+
selectRef: API.selectRef,
|
|
1633
|
+
optionsArray: API.optionsArray,
|
|
1634
|
+
setSelected: API.setSelected,
|
|
1635
|
+
handleOptionSelect: API.handleOptionSelect,
|
|
1636
|
+
onOptionCreate: API.onOptionCreate,
|
|
1637
|
+
onOptionDestroy: API.onOptionDestroy
|
|
1638
|
+
})
|
|
1639
|
+
);
|
|
1529
1640
|
const selectedLabel = computed(() => {
|
|
1530
1641
|
if (!props.multiple) {
|
|
1531
1642
|
return API.states.selectedLabel;
|
|
@@ -1556,7 +1667,10 @@ const _sfc_main = defineComponent({
|
|
|
1556
1667
|
};
|
|
1557
1668
|
}
|
|
1558
1669
|
});
|
|
1559
|
-
|
|
1670
|
+
const _hoisted_1 = ["id", "name", "disabled", "autocomplete", "tabindex", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label"];
|
|
1671
|
+
const _hoisted_2 = ["textContent"];
|
|
1672
|
+
const _hoisted_3 = { key: 1 };
|
|
1673
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1560
1674
|
const _component_el_tag = resolveComponent("el-tag");
|
|
1561
1675
|
const _component_el_tooltip = resolveComponent("el-tooltip");
|
|
1562
1676
|
const _component_el_icon = resolveComponent("el-icon");
|
|
@@ -1566,371 +1680,534 @@ function _sfc_render(_ctx, _cache) {
|
|
|
1566
1680
|
const _component_el_scrollbar = resolveComponent("el-scrollbar");
|
|
1567
1681
|
const _component_el_select_menu = resolveComponent("el-select-menu");
|
|
1568
1682
|
const _directive_click_outside = resolveDirective("click-outside");
|
|
1569
|
-
return withDirectives((openBlock(), createElementBlock(
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
}, [
|
|
1575
|
-
createVNode(_component_el_tooltip, {
|
|
1576
|
-
ref: "tooltipRef",
|
|
1577
|
-
visible: _ctx.dropdownMenuVisible,
|
|
1578
|
-
placement: _ctx.placement,
|
|
1579
|
-
teleported: _ctx.teleported,
|
|
1580
|
-
"popper-class": [_ctx.nsSelect.e("popper"), _ctx.popperClass],
|
|
1581
|
-
"popper-style": _ctx.popperStyle,
|
|
1582
|
-
"popper-options": _ctx.popperOptions,
|
|
1583
|
-
"fallback-placements": _ctx.fallbackPlacements,
|
|
1584
|
-
effect: _ctx.effect,
|
|
1585
|
-
pure: "",
|
|
1586
|
-
trigger: "click",
|
|
1587
|
-
transition: `${_ctx.nsSelect.namespace.value}-zoom-in-top`,
|
|
1588
|
-
"stop-popper-mouse-event": false,
|
|
1589
|
-
"gpu-acceleration": false,
|
|
1590
|
-
persistent: _ctx.persistent,
|
|
1591
|
-
"append-to": _ctx.appendTo,
|
|
1592
|
-
"show-arrow": _ctx.showArrow,
|
|
1593
|
-
offset: _ctx.offset,
|
|
1594
|
-
onBeforeShow: _ctx.handleMenuEnter,
|
|
1595
|
-
onHide: ($event) => _ctx.states.isBeforeHide = false
|
|
1683
|
+
return withDirectives((openBlock(), createElementBlock(
|
|
1684
|
+
"div",
|
|
1685
|
+
mergeProps({
|
|
1686
|
+
ref: "selectRef",
|
|
1687
|
+
class: [_ctx.nsSelect.b(), _ctx.nsSelect.m(_ctx.selectSize)]
|
|
1596
1688
|
}, {
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1689
|
+
[toHandlerKey(_ctx.mouseEnterEventName)]: _cache[11] || (_cache[11] = ($event) => _ctx.states.inputHovering = true)
|
|
1690
|
+
}, {
|
|
1691
|
+
onMouseleave: _cache[12] || (_cache[12] = ($event) => _ctx.states.inputHovering = false)
|
|
1692
|
+
}),
|
|
1693
|
+
[
|
|
1694
|
+
createVNode(_component_el_tooltip, {
|
|
1695
|
+
ref: "tooltipRef",
|
|
1696
|
+
visible: _ctx.dropdownMenuVisible,
|
|
1697
|
+
placement: _ctx.placement,
|
|
1698
|
+
teleported: _ctx.teleported,
|
|
1699
|
+
"popper-class": [_ctx.nsSelect.e("popper"), _ctx.popperClass],
|
|
1700
|
+
"popper-style": _ctx.popperStyle,
|
|
1701
|
+
"popper-options": _ctx.popperOptions,
|
|
1702
|
+
"fallback-placements": _ctx.fallbackPlacements,
|
|
1703
|
+
effect: _ctx.effect,
|
|
1704
|
+
pure: "",
|
|
1705
|
+
trigger: "click",
|
|
1706
|
+
transition: `${_ctx.nsSelect.namespace.value}-zoom-in-top`,
|
|
1707
|
+
"stop-popper-mouse-event": false,
|
|
1708
|
+
"gpu-acceleration": false,
|
|
1709
|
+
persistent: _ctx.persistent,
|
|
1710
|
+
"append-to": _ctx.appendTo,
|
|
1711
|
+
"show-arrow": _ctx.showArrow,
|
|
1712
|
+
offset: _ctx.offset,
|
|
1713
|
+
onBeforeShow: _ctx.handleMenuEnter,
|
|
1714
|
+
onHide: _cache[10] || (_cache[10] = ($event) => _ctx.states.isBeforeHide = false)
|
|
1715
|
+
}, {
|
|
1716
|
+
default: withCtx(() => {
|
|
1717
|
+
var _a;
|
|
1718
|
+
return [
|
|
1719
|
+
createElementVNode(
|
|
1720
|
+
"div",
|
|
1721
|
+
{
|
|
1722
|
+
ref: "wrapperRef",
|
|
1723
|
+
class: normalizeClass([
|
|
1724
|
+
_ctx.nsSelect.e("wrapper"),
|
|
1725
|
+
_ctx.nsSelect.is("focused", _ctx.isFocused),
|
|
1726
|
+
_ctx.nsSelect.is("hovering", _ctx.states.inputHovering),
|
|
1727
|
+
_ctx.nsSelect.is("filterable", _ctx.filterable),
|
|
1728
|
+
_ctx.nsSelect.is("disabled", _ctx.selectDisabled)
|
|
1729
|
+
]),
|
|
1730
|
+
onClick: _cache[7] || (_cache[7] = withModifiers((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["prevent"]))
|
|
1731
|
+
},
|
|
1732
|
+
[
|
|
1733
|
+
_ctx.$slots.prefix ? (openBlock(), createElementBlock(
|
|
1734
|
+
"div",
|
|
1735
|
+
{
|
|
1736
|
+
key: 0,
|
|
1737
|
+
ref: "prefixRef",
|
|
1738
|
+
class: normalizeClass(_ctx.nsSelect.e("prefix"))
|
|
1739
|
+
},
|
|
1740
|
+
[
|
|
1741
|
+
renderSlot(_ctx.$slots, "prefix")
|
|
1742
|
+
],
|
|
1743
|
+
2
|
|
1744
|
+
)) : createCommentVNode("v-if", true),
|
|
1745
|
+
createElementVNode(
|
|
1746
|
+
"div",
|
|
1747
|
+
{
|
|
1748
|
+
ref: "selectionRef",
|
|
1749
|
+
class: normalizeClass([
|
|
1750
|
+
_ctx.nsSelect.e("selection"),
|
|
1751
|
+
_ctx.nsSelect.is(
|
|
1752
|
+
"near",
|
|
1753
|
+
_ctx.multiple && !_ctx.$slots.prefix && !!_ctx.states.selected.length
|
|
1754
|
+
)
|
|
1755
|
+
])
|
|
1756
|
+
},
|
|
1757
|
+
[
|
|
1758
|
+
_ctx.multiple ? renderSlot(_ctx.$slots, "tag", {
|
|
1759
|
+
key: 0,
|
|
1760
|
+
data: _ctx.states.selected,
|
|
1761
|
+
deleteTag: _ctx.deleteTag,
|
|
1762
|
+
selectDisabled: _ctx.selectDisabled
|
|
1763
|
+
}, () => [
|
|
1764
|
+
(openBlock(true), createElementBlock(
|
|
1765
|
+
Fragment,
|
|
1766
|
+
null,
|
|
1767
|
+
renderList(_ctx.showTagList, (item) => {
|
|
1768
|
+
return openBlock(), createElementBlock(
|
|
1769
|
+
"div",
|
|
1770
|
+
{
|
|
1771
|
+
key: _ctx.getValueKey(item),
|
|
1772
|
+
class: normalizeClass(_ctx.nsSelect.e("selected-item"))
|
|
1773
|
+
},
|
|
1774
|
+
[
|
|
1775
|
+
createVNode(_component_el_tag, {
|
|
1776
|
+
closable: !_ctx.selectDisabled && !item.isDisabled,
|
|
1777
|
+
size: _ctx.collapseTagSize,
|
|
1778
|
+
type: _ctx.tagType,
|
|
1779
|
+
effect: _ctx.tagEffect,
|
|
1780
|
+
"disable-transitions": "",
|
|
1781
|
+
style: normalizeStyle(_ctx.tagStyle),
|
|
1782
|
+
onClose: ($event) => _ctx.deleteTag($event, item)
|
|
1783
|
+
}, {
|
|
1784
|
+
default: withCtx(() => [
|
|
1785
|
+
createElementVNode(
|
|
1786
|
+
"span",
|
|
1787
|
+
{
|
|
1788
|
+
class: normalizeClass(_ctx.nsSelect.e("tags-text"))
|
|
1789
|
+
},
|
|
1790
|
+
[
|
|
1791
|
+
renderSlot(_ctx.$slots, "label", {
|
|
1792
|
+
index: item.index,
|
|
1793
|
+
label: item.currentLabel,
|
|
1794
|
+
value: item.value
|
|
1795
|
+
}, () => [
|
|
1796
|
+
createTextVNode(
|
|
1797
|
+
toDisplayString(item.currentLabel),
|
|
1798
|
+
1
|
|
1799
|
+
)
|
|
1800
|
+
])
|
|
1801
|
+
],
|
|
1802
|
+
2
|
|
1803
|
+
)
|
|
1804
|
+
]),
|
|
1805
|
+
_: 2
|
|
1806
|
+
}, 1032, ["closable", "size", "type", "effect", "style", "onClose"])
|
|
1807
|
+
],
|
|
1808
|
+
2
|
|
1809
|
+
);
|
|
1810
|
+
}),
|
|
1811
|
+
128
|
|
1812
|
+
)),
|
|
1813
|
+
_ctx.collapseTags && _ctx.states.selected.length > _ctx.maxCollapseTags ? (openBlock(), createBlock(_component_el_tooltip, {
|
|
1814
|
+
key: 0,
|
|
1815
|
+
ref: "tagTooltipRef",
|
|
1816
|
+
disabled: _ctx.dropdownMenuVisible || !_ctx.collapseTagsTooltip,
|
|
1817
|
+
"fallback-placements": ["bottom", "top", "right", "left"],
|
|
1818
|
+
effect: _ctx.effect,
|
|
1819
|
+
placement: "bottom",
|
|
1820
|
+
"popper-class": _ctx.popperClass,
|
|
1821
|
+
"popper-style": _ctx.popperStyle,
|
|
1822
|
+
teleported: _ctx.teleported,
|
|
1823
|
+
"popper-options": _ctx.popperOptions
|
|
1824
|
+
}, {
|
|
1825
|
+
default: withCtx(() => [
|
|
1826
|
+
createElementVNode(
|
|
1827
|
+
"div",
|
|
1828
|
+
{
|
|
1829
|
+
ref: "collapseItemRef",
|
|
1830
|
+
class: normalizeClass(_ctx.nsSelect.e("selected-item"))
|
|
1831
|
+
},
|
|
1832
|
+
[
|
|
1833
|
+
createVNode(_component_el_tag, {
|
|
1834
|
+
closable: false,
|
|
1835
|
+
size: _ctx.collapseTagSize,
|
|
1836
|
+
type: _ctx.tagType,
|
|
1837
|
+
effect: _ctx.tagEffect,
|
|
1838
|
+
"disable-transitions": "",
|
|
1839
|
+
style: normalizeStyle(_ctx.collapseTagStyle)
|
|
1840
|
+
}, {
|
|
1841
|
+
default: withCtx(() => [
|
|
1842
|
+
createElementVNode(
|
|
1843
|
+
"span",
|
|
1844
|
+
{
|
|
1845
|
+
class: normalizeClass(_ctx.nsSelect.e("tags-text"))
|
|
1846
|
+
},
|
|
1847
|
+
" + " + toDisplayString(_ctx.states.selected.length - _ctx.maxCollapseTags),
|
|
1848
|
+
3
|
|
1849
|
+
)
|
|
1850
|
+
]),
|
|
1851
|
+
_: 1
|
|
1852
|
+
}, 8, ["size", "type", "effect", "style"])
|
|
1853
|
+
],
|
|
1854
|
+
2
|
|
1855
|
+
)
|
|
1856
|
+
]),
|
|
1857
|
+
content: withCtx(() => [
|
|
1858
|
+
createElementVNode(
|
|
1859
|
+
"div",
|
|
1860
|
+
{
|
|
1861
|
+
ref: "tagMenuRef",
|
|
1862
|
+
class: normalizeClass(_ctx.nsSelect.e("selection"))
|
|
1863
|
+
},
|
|
1864
|
+
[
|
|
1865
|
+
(openBlock(true), createElementBlock(
|
|
1866
|
+
Fragment,
|
|
1867
|
+
null,
|
|
1868
|
+
renderList(_ctx.collapseTagList, (item) => {
|
|
1869
|
+
return openBlock(), createElementBlock(
|
|
1870
|
+
"div",
|
|
1871
|
+
{
|
|
1872
|
+
key: _ctx.getValueKey(item),
|
|
1873
|
+
class: normalizeClass(_ctx.nsSelect.e("selected-item"))
|
|
1874
|
+
},
|
|
1875
|
+
[
|
|
1876
|
+
createVNode(_component_el_tag, {
|
|
1877
|
+
class: "in-tooltip",
|
|
1878
|
+
closable: !_ctx.selectDisabled && !item.isDisabled,
|
|
1879
|
+
size: _ctx.collapseTagSize,
|
|
1880
|
+
type: _ctx.tagType,
|
|
1881
|
+
effect: _ctx.tagEffect,
|
|
1882
|
+
"disable-transitions": "",
|
|
1883
|
+
onClose: ($event) => _ctx.deleteTag($event, item)
|
|
1884
|
+
}, {
|
|
1885
|
+
default: withCtx(() => [
|
|
1886
|
+
createElementVNode(
|
|
1887
|
+
"span",
|
|
1888
|
+
{
|
|
1889
|
+
class: normalizeClass(_ctx.nsSelect.e("tags-text"))
|
|
1890
|
+
},
|
|
1891
|
+
[
|
|
1892
|
+
renderSlot(_ctx.$slots, "label", {
|
|
1893
|
+
index: item.index,
|
|
1894
|
+
label: item.currentLabel,
|
|
1895
|
+
value: item.value
|
|
1896
|
+
}, () => [
|
|
1897
|
+
createTextVNode(
|
|
1898
|
+
toDisplayString(item.currentLabel),
|
|
1899
|
+
1
|
|
1900
|
+
)
|
|
1901
|
+
])
|
|
1902
|
+
],
|
|
1903
|
+
2
|
|
1904
|
+
)
|
|
1905
|
+
]),
|
|
1906
|
+
_: 2
|
|
1907
|
+
}, 1032, ["closable", "size", "type", "effect", "onClose"])
|
|
1908
|
+
],
|
|
1909
|
+
2
|
|
1910
|
+
);
|
|
1911
|
+
}),
|
|
1912
|
+
128
|
|
1913
|
+
))
|
|
1914
|
+
],
|
|
1915
|
+
2
|
|
1916
|
+
)
|
|
1917
|
+
]),
|
|
1918
|
+
_: 3
|
|
1919
|
+
}, 8, ["disabled", "effect", "popper-class", "popper-style", "teleported", "popper-options"])) : createCommentVNode("v-if", true)
|
|
1920
|
+
]) : createCommentVNode("v-if", true),
|
|
1921
|
+
createElementVNode(
|
|
1922
|
+
"div",
|
|
1923
|
+
{
|
|
1924
|
+
class: normalizeClass([
|
|
1925
|
+
_ctx.nsSelect.e("selected-item"),
|
|
1926
|
+
_ctx.nsSelect.e("input-wrapper"),
|
|
1927
|
+
_ctx.nsSelect.is("hidden", !_ctx.filterable || _ctx.selectDisabled)
|
|
1928
|
+
])
|
|
1929
|
+
},
|
|
1930
|
+
[
|
|
1931
|
+
withDirectives(createElementVNode("input", {
|
|
1932
|
+
id: _ctx.inputId,
|
|
1933
|
+
ref: "inputRef",
|
|
1934
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.states.inputValue = $event),
|
|
1935
|
+
type: "text",
|
|
1936
|
+
name: _ctx.name,
|
|
1937
|
+
class: normalizeClass([_ctx.nsSelect.e("input"), _ctx.nsSelect.is(_ctx.selectSize)]),
|
|
1938
|
+
disabled: _ctx.selectDisabled,
|
|
1939
|
+
autocomplete: _ctx.autocomplete,
|
|
1940
|
+
style: normalizeStyle(_ctx.inputStyle),
|
|
1941
|
+
tabindex: _ctx.tabindex,
|
|
1942
|
+
role: "combobox",
|
|
1943
|
+
readonly: !_ctx.filterable,
|
|
1944
|
+
spellcheck: "false",
|
|
1945
|
+
"aria-activedescendant": ((_a = _ctx.hoverOption) == null ? void 0 : _a.id) || "",
|
|
1946
|
+
"aria-controls": _ctx.contentId,
|
|
1947
|
+
"aria-expanded": _ctx.dropdownMenuVisible,
|
|
1948
|
+
"aria-label": _ctx.ariaLabel,
|
|
1949
|
+
"aria-autocomplete": "none",
|
|
1950
|
+
"aria-haspopup": "listbox",
|
|
1951
|
+
onKeydown: _cache[1] || (_cache[1] = (...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args)),
|
|
1952
|
+
onCompositionstart: _cache[2] || (_cache[2] = (...args) => _ctx.handleCompositionStart && _ctx.handleCompositionStart(...args)),
|
|
1953
|
+
onCompositionupdate: _cache[3] || (_cache[3] = (...args) => _ctx.handleCompositionUpdate && _ctx.handleCompositionUpdate(...args)),
|
|
1954
|
+
onCompositionend: _cache[4] || (_cache[4] = (...args) => _ctx.handleCompositionEnd && _ctx.handleCompositionEnd(...args)),
|
|
1955
|
+
onInput: _cache[5] || (_cache[5] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
|
|
1956
|
+
onClick: _cache[6] || (_cache[6] = withModifiers((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["stop"]))
|
|
1957
|
+
}, null, 46, _hoisted_1), [
|
|
1958
|
+
[vModelText, _ctx.states.inputValue]
|
|
1959
|
+
]),
|
|
1960
|
+
_ctx.filterable ? (openBlock(), createElementBlock("span", {
|
|
1961
|
+
key: 0,
|
|
1962
|
+
ref: "calculatorRef",
|
|
1963
|
+
"aria-hidden": "true",
|
|
1964
|
+
class: normalizeClass(_ctx.nsSelect.e("input-calculator")),
|
|
1965
|
+
textContent: toDisplayString(_ctx.states.inputValue)
|
|
1966
|
+
}, null, 10, _hoisted_2)) : createCommentVNode("v-if", true)
|
|
1967
|
+
],
|
|
1968
|
+
2
|
|
1969
|
+
),
|
|
1970
|
+
_ctx.shouldShowPlaceholder ? (openBlock(), createElementBlock(
|
|
1971
|
+
"div",
|
|
1972
|
+
{
|
|
1973
|
+
key: 1,
|
|
1974
|
+
class: normalizeClass([
|
|
1975
|
+
_ctx.nsSelect.e("selected-item"),
|
|
1976
|
+
_ctx.nsSelect.e("placeholder"),
|
|
1977
|
+
_ctx.nsSelect.is(
|
|
1978
|
+
"transparent",
|
|
1979
|
+
!_ctx.hasModelValue || _ctx.expanded && !_ctx.states.inputValue
|
|
1980
|
+
)
|
|
1981
|
+
])
|
|
1982
|
+
},
|
|
1983
|
+
[
|
|
1984
|
+
_ctx.hasModelValue ? renderSlot(_ctx.$slots, "label", {
|
|
1985
|
+
key: 0,
|
|
1986
|
+
index: _ctx.getOption(_ctx.modelValue).index,
|
|
1987
|
+
label: _ctx.currentPlaceholder,
|
|
1988
|
+
value: _ctx.modelValue
|
|
1989
|
+
}, () => [
|
|
1990
|
+
createElementVNode(
|
|
1991
|
+
"span",
|
|
1992
|
+
null,
|
|
1993
|
+
toDisplayString(_ctx.currentPlaceholder),
|
|
1994
|
+
1
|
|
1995
|
+
)
|
|
1996
|
+
]) : (openBlock(), createElementBlock(
|
|
1997
|
+
"span",
|
|
1998
|
+
_hoisted_3,
|
|
1999
|
+
toDisplayString(_ctx.currentPlaceholder),
|
|
2000
|
+
1
|
|
2001
|
+
))
|
|
2002
|
+
],
|
|
2003
|
+
2
|
|
2004
|
+
)) : createCommentVNode("v-if", true)
|
|
2005
|
+
],
|
|
2006
|
+
2
|
|
2007
|
+
),
|
|
2008
|
+
createElementVNode(
|
|
2009
|
+
"div",
|
|
2010
|
+
{
|
|
2011
|
+
ref: "suffixRef",
|
|
2012
|
+
class: normalizeClass(_ctx.nsSelect.e("suffix"))
|
|
2013
|
+
},
|
|
2014
|
+
[
|
|
2015
|
+
_ctx.iconComponent && !_ctx.showClearBtn ? (openBlock(), createBlock(_component_el_icon, {
|
|
2016
|
+
key: 0,
|
|
2017
|
+
class: normalizeClass([_ctx.nsSelect.e("caret"), _ctx.nsSelect.e("icon"), _ctx.iconReverse])
|
|
2018
|
+
}, {
|
|
2019
|
+
default: withCtx(() => [
|
|
2020
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))
|
|
2021
|
+
]),
|
|
2022
|
+
_: 1
|
|
2023
|
+
}, 8, ["class"])) : createCommentVNode("v-if", true),
|
|
2024
|
+
_ctx.showClearBtn && _ctx.clearIcon ? (openBlock(), createBlock(_component_el_icon, {
|
|
2025
|
+
key: 1,
|
|
2026
|
+
class: normalizeClass([
|
|
2027
|
+
_ctx.nsSelect.e("caret"),
|
|
2028
|
+
_ctx.nsSelect.e("icon"),
|
|
2029
|
+
_ctx.nsSelect.e("clear")
|
|
2030
|
+
]),
|
|
2031
|
+
onClick: _ctx.handleClearClick
|
|
1644
2032
|
}, {
|
|
1645
2033
|
default: withCtx(() => [
|
|
1646
|
-
|
|
1647
|
-
class: normalizeClass(_ctx.nsSelect.e("tags-text"))
|
|
1648
|
-
}, [
|
|
1649
|
-
renderSlot(_ctx.$slots, "label", {
|
|
1650
|
-
index: item.index,
|
|
1651
|
-
label: item.currentLabel,
|
|
1652
|
-
value: item.value
|
|
1653
|
-
}, () => [
|
|
1654
|
-
createTextVNode(toDisplayString(item.currentLabel), 1)
|
|
1655
|
-
])
|
|
1656
|
-
], 2)
|
|
2034
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))
|
|
1657
2035
|
]),
|
|
1658
|
-
_:
|
|
1659
|
-
},
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
2036
|
+
_: 1
|
|
2037
|
+
}, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
|
|
2038
|
+
_ctx.validateState && _ctx.validateIcon && _ctx.needStatusIcon ? (openBlock(), createBlock(_component_el_icon, {
|
|
2039
|
+
key: 2,
|
|
2040
|
+
class: normalizeClass([
|
|
2041
|
+
_ctx.nsInput.e("icon"),
|
|
2042
|
+
_ctx.nsInput.e("validateIcon"),
|
|
2043
|
+
_ctx.nsInput.is("loading", _ctx.validateState === "validating")
|
|
2044
|
+
])
|
|
2045
|
+
}, {
|
|
2046
|
+
default: withCtx(() => [
|
|
2047
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.validateIcon)))
|
|
2048
|
+
]),
|
|
2049
|
+
_: 1
|
|
2050
|
+
}, 8, ["class"])) : createCommentVNode("v-if", true)
|
|
2051
|
+
],
|
|
2052
|
+
2
|
|
2053
|
+
)
|
|
2054
|
+
],
|
|
2055
|
+
2
|
|
2056
|
+
)
|
|
2057
|
+
];
|
|
2058
|
+
}),
|
|
2059
|
+
content: withCtx(() => [
|
|
2060
|
+
createVNode(
|
|
2061
|
+
_component_el_select_menu,
|
|
2062
|
+
{ ref: "menuRef" },
|
|
2063
|
+
{
|
|
2064
|
+
default: withCtx(() => [
|
|
2065
|
+
_ctx.$slots.header ? (openBlock(), createElementBlock(
|
|
2066
|
+
"div",
|
|
2067
|
+
{
|
|
2068
|
+
key: 0,
|
|
2069
|
+
class: normalizeClass(_ctx.nsSelect.be("dropdown", "header")),
|
|
2070
|
+
onClick: _cache[8] || (_cache[8] = withModifiers(() => {
|
|
2071
|
+
}, ["stop"]))
|
|
2072
|
+
},
|
|
2073
|
+
[
|
|
2074
|
+
renderSlot(_ctx.$slots, "header")
|
|
2075
|
+
],
|
|
2076
|
+
2
|
|
2077
|
+
)) : createCommentVNode("v-if", true),
|
|
2078
|
+
withDirectives(createVNode(_component_el_scrollbar, {
|
|
2079
|
+
id: _ctx.contentId,
|
|
2080
|
+
ref: "scrollbarRef",
|
|
2081
|
+
tag: "ul",
|
|
2082
|
+
"wrap-class": _ctx.nsSelect.be("dropdown", "wrap"),
|
|
2083
|
+
"view-class": _ctx.nsSelect.be("dropdown", "list"),
|
|
2084
|
+
class: normalizeClass([_ctx.nsSelect.is("empty", _ctx.filteredOptionsCount === 0)]),
|
|
2085
|
+
role: "listbox",
|
|
2086
|
+
"aria-label": _ctx.ariaLabel,
|
|
2087
|
+
"aria-orientation": "vertical",
|
|
2088
|
+
onScroll: _ctx.popupScroll
|
|
1672
2089
|
}, {
|
|
1673
2090
|
default: withCtx(() => [
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
]
|
|
1730
|
-
|
|
1731
|
-
|
|
2091
|
+
_ctx.showNewOption ? (openBlock(), createBlock(_component_el_option, {
|
|
2092
|
+
key: 0,
|
|
2093
|
+
value: _ctx.states.inputValue,
|
|
2094
|
+
created: true
|
|
2095
|
+
}, null, 8, ["value"])) : createCommentVNode("v-if", true),
|
|
2096
|
+
createVNode(_component_el_options, null, {
|
|
2097
|
+
default: withCtx(() => [
|
|
2098
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
2099
|
+
(openBlock(true), createElementBlock(
|
|
2100
|
+
Fragment,
|
|
2101
|
+
null,
|
|
2102
|
+
renderList(_ctx.options, (option, index) => {
|
|
2103
|
+
var _a;
|
|
2104
|
+
return openBlock(), createElementBlock(
|
|
2105
|
+
Fragment,
|
|
2106
|
+
{ key: index },
|
|
2107
|
+
[
|
|
2108
|
+
((_a = _ctx.getOptions(option)) == null ? void 0 : _a.length) ? (openBlock(), createBlock(_component_el_option_group, {
|
|
2109
|
+
key: 0,
|
|
2110
|
+
label: _ctx.getLabel(option),
|
|
2111
|
+
disabled: _ctx.getDisabled(option)
|
|
2112
|
+
}, {
|
|
2113
|
+
default: withCtx(() => [
|
|
2114
|
+
(openBlock(true), createElementBlock(
|
|
2115
|
+
Fragment,
|
|
2116
|
+
null,
|
|
2117
|
+
renderList(_ctx.getOptions(option), (item) => {
|
|
2118
|
+
return openBlock(), createBlock(
|
|
2119
|
+
_component_el_option,
|
|
2120
|
+
mergeProps({
|
|
2121
|
+
key: _ctx.getValue(item)
|
|
2122
|
+
}, { ref_for: true }, _ctx.getOptionProps(item)),
|
|
2123
|
+
null,
|
|
2124
|
+
16
|
|
2125
|
+
);
|
|
2126
|
+
}),
|
|
2127
|
+
128
|
|
2128
|
+
))
|
|
2129
|
+
]),
|
|
2130
|
+
_: 2
|
|
2131
|
+
}, 1032, ["label", "disabled"])) : (openBlock(), createBlock(
|
|
2132
|
+
_component_el_option,
|
|
2133
|
+
mergeProps({
|
|
2134
|
+
key: 1,
|
|
2135
|
+
ref_for: true
|
|
2136
|
+
}, _ctx.getOptionProps(option)),
|
|
2137
|
+
null,
|
|
2138
|
+
16
|
|
2139
|
+
))
|
|
2140
|
+
],
|
|
2141
|
+
64
|
|
2142
|
+
);
|
|
2143
|
+
}),
|
|
2144
|
+
128
|
|
2145
|
+
))
|
|
2146
|
+
])
|
|
2147
|
+
]),
|
|
2148
|
+
_: 3
|
|
2149
|
+
})
|
|
1732
2150
|
]),
|
|
1733
2151
|
_: 3
|
|
1734
|
-
}, 8, ["
|
|
1735
|
-
|
|
1736
|
-
createElementVNode("div", {
|
|
1737
|
-
class: normalizeClass([
|
|
1738
|
-
_ctx.nsSelect.e("selected-item"),
|
|
1739
|
-
_ctx.nsSelect.e("input-wrapper"),
|
|
1740
|
-
_ctx.nsSelect.is("hidden", !_ctx.filterable || _ctx.selectDisabled)
|
|
1741
|
-
])
|
|
1742
|
-
}, [
|
|
1743
|
-
withDirectives(createElementVNode("input", {
|
|
1744
|
-
id: _ctx.inputId,
|
|
1745
|
-
ref: "inputRef",
|
|
1746
|
-
"onUpdate:modelValue": ($event) => _ctx.states.inputValue = $event,
|
|
1747
|
-
type: "text",
|
|
1748
|
-
name: _ctx.name,
|
|
1749
|
-
class: normalizeClass([_ctx.nsSelect.e("input"), _ctx.nsSelect.is(_ctx.selectSize)]),
|
|
1750
|
-
disabled: _ctx.selectDisabled,
|
|
1751
|
-
autocomplete: _ctx.autocomplete,
|
|
1752
|
-
style: normalizeStyle(_ctx.inputStyle),
|
|
1753
|
-
tabindex: _ctx.tabindex,
|
|
1754
|
-
role: "combobox",
|
|
1755
|
-
readonly: !_ctx.filterable,
|
|
1756
|
-
spellcheck: "false",
|
|
1757
|
-
"aria-activedescendant": ((_a = _ctx.hoverOption) == null ? void 0 : _a.id) || "",
|
|
1758
|
-
"aria-controls": _ctx.contentId,
|
|
1759
|
-
"aria-expanded": _ctx.dropdownMenuVisible,
|
|
1760
|
-
"aria-label": _ctx.ariaLabel,
|
|
1761
|
-
"aria-autocomplete": "none",
|
|
1762
|
-
"aria-haspopup": "listbox",
|
|
1763
|
-
onKeydown: _ctx.handleKeydown,
|
|
1764
|
-
onCompositionstart: _ctx.handleCompositionStart,
|
|
1765
|
-
onCompositionupdate: _ctx.handleCompositionUpdate,
|
|
1766
|
-
onCompositionend: _ctx.handleCompositionEnd,
|
|
1767
|
-
onInput: _ctx.onInput,
|
|
1768
|
-
onClick: withModifiers(_ctx.toggleMenu, ["stop"])
|
|
1769
|
-
}, null, 46, ["id", "onUpdate:modelValue", "name", "disabled", "autocomplete", "tabindex", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "onKeydown", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onInput", "onClick"]), [
|
|
1770
|
-
[vModelText, _ctx.states.inputValue]
|
|
1771
|
-
]),
|
|
1772
|
-
_ctx.filterable ? (openBlock(), createElementBlock("span", {
|
|
1773
|
-
key: 0,
|
|
1774
|
-
ref: "calculatorRef",
|
|
1775
|
-
"aria-hidden": "true",
|
|
1776
|
-
class: normalizeClass(_ctx.nsSelect.e("input-calculator")),
|
|
1777
|
-
textContent: toDisplayString(_ctx.states.inputValue)
|
|
1778
|
-
}, null, 10, ["textContent"])) : createCommentVNode("v-if", true)
|
|
1779
|
-
], 2),
|
|
1780
|
-
_ctx.shouldShowPlaceholder ? (openBlock(), createElementBlock("div", {
|
|
1781
|
-
key: 1,
|
|
1782
|
-
class: normalizeClass([
|
|
1783
|
-
_ctx.nsSelect.e("selected-item"),
|
|
1784
|
-
_ctx.nsSelect.e("placeholder"),
|
|
1785
|
-
_ctx.nsSelect.is("transparent", !_ctx.hasModelValue || _ctx.expanded && !_ctx.states.inputValue)
|
|
1786
|
-
])
|
|
1787
|
-
}, [
|
|
1788
|
-
_ctx.hasModelValue ? renderSlot(_ctx.$slots, "label", {
|
|
1789
|
-
key: 0,
|
|
1790
|
-
index: _ctx.getOption(_ctx.modelValue).index,
|
|
1791
|
-
label: _ctx.currentPlaceholder,
|
|
1792
|
-
value: _ctx.modelValue
|
|
1793
|
-
}, () => [
|
|
1794
|
-
createElementVNode("span", null, toDisplayString(_ctx.currentPlaceholder), 1)
|
|
1795
|
-
]) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(_ctx.currentPlaceholder), 1))
|
|
1796
|
-
], 2)) : createCommentVNode("v-if", true)
|
|
1797
|
-
], 2),
|
|
1798
|
-
createElementVNode("div", {
|
|
1799
|
-
ref: "suffixRef",
|
|
1800
|
-
class: normalizeClass(_ctx.nsSelect.e("suffix"))
|
|
1801
|
-
}, [
|
|
1802
|
-
_ctx.iconComponent && !_ctx.showClearBtn ? (openBlock(), createBlock(_component_el_icon, {
|
|
1803
|
-
key: 0,
|
|
1804
|
-
class: normalizeClass([_ctx.nsSelect.e("caret"), _ctx.nsSelect.e("icon"), _ctx.iconReverse])
|
|
1805
|
-
}, {
|
|
1806
|
-
default: withCtx(() => [
|
|
1807
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))
|
|
1808
|
-
]),
|
|
1809
|
-
_: 1
|
|
1810
|
-
}, 8, ["class"])) : createCommentVNode("v-if", true),
|
|
1811
|
-
_ctx.showClearBtn && _ctx.clearIcon ? (openBlock(), createBlock(_component_el_icon, {
|
|
1812
|
-
key: 1,
|
|
1813
|
-
class: normalizeClass([
|
|
1814
|
-
_ctx.nsSelect.e("caret"),
|
|
1815
|
-
_ctx.nsSelect.e("icon"),
|
|
1816
|
-
_ctx.nsSelect.e("clear")
|
|
1817
|
-
]),
|
|
1818
|
-
onClick: _ctx.handleClearClick
|
|
1819
|
-
}, {
|
|
1820
|
-
default: withCtx(() => [
|
|
1821
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))
|
|
1822
|
-
]),
|
|
1823
|
-
_: 1
|
|
1824
|
-
}, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
|
|
1825
|
-
_ctx.validateState && _ctx.validateIcon && _ctx.needStatusIcon ? (openBlock(), createBlock(_component_el_icon, {
|
|
1826
|
-
key: 2,
|
|
1827
|
-
class: normalizeClass([
|
|
1828
|
-
_ctx.nsInput.e("icon"),
|
|
1829
|
-
_ctx.nsInput.e("validateIcon"),
|
|
1830
|
-
_ctx.nsInput.is("loading", _ctx.validateState === "validating")
|
|
1831
|
-
])
|
|
1832
|
-
}, {
|
|
1833
|
-
default: withCtx(() => [
|
|
1834
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.validateIcon)))
|
|
2152
|
+
}, 8, ["id", "wrap-class", "view-class", "class", "aria-label", "onScroll"]), [
|
|
2153
|
+
[vShow, _ctx.states.options.size > 0 && !_ctx.loading]
|
|
1835
2154
|
]),
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
role: "listbox",
|
|
1861
|
-
"aria-label": _ctx.ariaLabel,
|
|
1862
|
-
"aria-orientation": "vertical",
|
|
1863
|
-
onScroll: _ctx.popupScroll
|
|
1864
|
-
}, {
|
|
1865
|
-
default: withCtx(() => [
|
|
1866
|
-
_ctx.showNewOption ? (openBlock(), createBlock(_component_el_option, {
|
|
1867
|
-
key: 0,
|
|
1868
|
-
value: _ctx.states.inputValue,
|
|
1869
|
-
created: true
|
|
1870
|
-
}, null, 8, ["value"])) : createCommentVNode("v-if", true),
|
|
1871
|
-
createVNode(_component_el_options, null, {
|
|
1872
|
-
default: withCtx(() => [
|
|
1873
|
-
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1874
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (option, index) => {
|
|
1875
|
-
var _a;
|
|
1876
|
-
return openBlock(), createElementBlock(Fragment, { key: index }, [
|
|
1877
|
-
((_a = _ctx.getOptions(option)) == null ? void 0 : _a.length) ? (openBlock(), createBlock(_component_el_option_group, {
|
|
1878
|
-
key: 0,
|
|
1879
|
-
label: _ctx.getLabel(option),
|
|
1880
|
-
disabled: _ctx.getDisabled(option)
|
|
1881
|
-
}, {
|
|
1882
|
-
default: withCtx(() => [
|
|
1883
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.getOptions(option), (item) => {
|
|
1884
|
-
return openBlock(), createBlock(_component_el_option, mergeProps({
|
|
1885
|
-
key: _ctx.getValue(item)
|
|
1886
|
-
}, _ctx.getOptionProps(item)), null, 16);
|
|
1887
|
-
}), 128))
|
|
1888
|
-
]),
|
|
1889
|
-
_: 2
|
|
1890
|
-
}, 1032, ["label", "disabled"])) : (openBlock(), createBlock(_component_el_option, normalizeProps(mergeProps({ key: 1 }, _ctx.getOptionProps(option))), null, 16))
|
|
1891
|
-
], 64);
|
|
1892
|
-
}), 128))
|
|
2155
|
+
_ctx.$slots.loading && _ctx.loading ? (openBlock(), createElementBlock(
|
|
2156
|
+
"div",
|
|
2157
|
+
{
|
|
2158
|
+
key: 1,
|
|
2159
|
+
class: normalizeClass(_ctx.nsSelect.be("dropdown", "loading"))
|
|
2160
|
+
},
|
|
2161
|
+
[
|
|
2162
|
+
renderSlot(_ctx.$slots, "loading")
|
|
2163
|
+
],
|
|
2164
|
+
2
|
|
2165
|
+
)) : _ctx.loading || _ctx.filteredOptionsCount === 0 ? (openBlock(), createElementBlock(
|
|
2166
|
+
"div",
|
|
2167
|
+
{
|
|
2168
|
+
key: 2,
|
|
2169
|
+
class: normalizeClass(_ctx.nsSelect.be("dropdown", "empty"))
|
|
2170
|
+
},
|
|
2171
|
+
[
|
|
2172
|
+
renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
2173
|
+
createElementVNode(
|
|
2174
|
+
"span",
|
|
2175
|
+
null,
|
|
2176
|
+
toDisplayString(_ctx.emptyText),
|
|
2177
|
+
1
|
|
2178
|
+
)
|
|
1893
2179
|
])
|
|
1894
|
-
]
|
|
1895
|
-
|
|
1896
|
-
|
|
2180
|
+
],
|
|
2181
|
+
2
|
|
2182
|
+
)) : createCommentVNode("v-if", true),
|
|
2183
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock(
|
|
2184
|
+
"div",
|
|
2185
|
+
{
|
|
2186
|
+
key: 3,
|
|
2187
|
+
class: normalizeClass(_ctx.nsSelect.be("dropdown", "footer")),
|
|
2188
|
+
onClick: _cache[9] || (_cache[9] = withModifiers(() => {
|
|
2189
|
+
}, ["stop"]))
|
|
2190
|
+
},
|
|
2191
|
+
[
|
|
2192
|
+
renderSlot(_ctx.$slots, "footer")
|
|
2193
|
+
],
|
|
2194
|
+
2
|
|
2195
|
+
)) : createCommentVNode("v-if", true)
|
|
1897
2196
|
]),
|
|
1898
2197
|
_: 3
|
|
1899
|
-
},
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
key: 2,
|
|
1909
|
-
class: normalizeClass(_ctx.nsSelect.be("dropdown", "empty"))
|
|
1910
|
-
}, [
|
|
1911
|
-
renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
1912
|
-
createElementVNode("span", null, toDisplayString(_ctx.emptyText), 1)
|
|
1913
|
-
])
|
|
1914
|
-
], 2)) : createCommentVNode("v-if", true),
|
|
1915
|
-
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
|
|
1916
|
-
key: 3,
|
|
1917
|
-
class: normalizeClass(_ctx.nsSelect.be("dropdown", "footer")),
|
|
1918
|
-
onClick: withModifiers(() => {
|
|
1919
|
-
}, ["stop"])
|
|
1920
|
-
}, [
|
|
1921
|
-
renderSlot(_ctx.$slots, "footer")
|
|
1922
|
-
], 10, ["onClick"])) : createCommentVNode("v-if", true)
|
|
1923
|
-
]),
|
|
1924
|
-
_: 3
|
|
1925
|
-
}, 512)
|
|
1926
|
-
]),
|
|
1927
|
-
_: 3
|
|
1928
|
-
}, 8, ["visible", "placement", "teleported", "popper-class", "popper-style", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "show-arrow", "offset", "onBeforeShow", "onHide"])
|
|
1929
|
-
], 16, ["onMouseleave"])), [
|
|
2198
|
+
},
|
|
2199
|
+
512
|
|
2200
|
+
)
|
|
2201
|
+
]),
|
|
2202
|
+
_: 3
|
|
2203
|
+
}, 8, ["visible", "placement", "teleported", "popper-class", "popper-style", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "show-arrow", "offset", "onBeforeShow"])
|
|
2204
|
+
],
|
|
2205
|
+
16
|
|
2206
|
+
)), [
|
|
1930
2207
|
[_directive_click_outside, _ctx.handleClickOutside, _ctx.popperRef]
|
|
1931
2208
|
]);
|
|
1932
2209
|
}
|
|
1933
|
-
var Select = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "select.vue"]]);
|
|
2210
|
+
var Select = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/select/src/select.vue"]]);
|
|
1934
2211
|
|
|
1935
2212
|
const ElSelect = withInstall(Select, {
|
|
1936
2213
|
Option,
|