hzzt-plus 1.0.1 → 1.0.3
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/attributes.json +1 -0
- package/dist/index.full.js +3204 -304
- package/dist/index.full.min.js +16 -16
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +18 -18
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +3199 -306
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/es/component.mjs +5 -1
- package/es/component.mjs.map +1 -1
- package/es/components/collapse/index.mjs +2 -2
- package/es/components/collapse/src/collapse.mjs +67 -0
- package/es/components/collapse/src/collapse.mjs.map +1 -1
- package/es/components/collapse/src/collapse2.mjs +0 -67
- package/es/components/collapse/src/collapse2.mjs.map +1 -1
- package/es/components/dropdown/index.d.ts +5 -5
- package/es/components/dropdown/src/index.mjs +3 -2
- package/es/components/dropdown/src/index.mjs.map +1 -1
- package/es/components/dropdown/src/index.vue.d.ts +6 -5
- package/es/components/index.d.ts +2 -0
- package/es/components/index.mjs +4 -0
- package/es/components/index.mjs.map +1 -1
- package/es/components/input-range/index.d.ts +5 -0
- package/es/components/input-range/index.mjs +9 -0
- package/es/components/input-range/index.mjs.map +1 -0
- package/es/components/input-range/src/input-range.d.ts +24 -0
- package/es/components/input-range/src/input-range.mjs +31 -0
- package/es/components/input-range/src/input-range.mjs.map +1 -0
- package/es/components/input-range/src/input-range.vue.d.ts +86 -0
- package/es/components/input-range/src/input-range2.mjs +81 -0
- package/es/components/input-range/src/input-range2.mjs.map +1 -0
- package/es/components/input-range/style/css.d.ts +2 -0
- package/es/components/input-range/style/css.mjs +3 -0
- package/es/components/input-range/style/css.mjs.map +1 -0
- package/es/components/input-range/style/index.d.ts +2 -0
- package/es/components/input-range/style/index.mjs +3 -0
- package/es/components/input-range/style/index.mjs.map +1 -0
- package/es/components/page-size/index.d.ts +1 -1
- package/es/components/page-size/src/index.mjs.map +1 -1
- package/es/components/page-size/src/index.vue.d.ts +1 -1
- package/es/components/scan/src/scan2.mjs.map +1 -1
- package/es/components/select-input/index.d.ts +10 -10
- package/es/components/select-input/src/select-input.d.ts +3 -3
- package/es/components/select-input/src/select-input.mjs.map +1 -1
- package/es/components/select-input/src/select-input.vue.d.ts +10 -10
- package/es/components/select-textarea/index.d.ts +5 -0
- package/es/components/select-textarea/index.mjs +9 -0
- package/es/components/select-textarea/index.mjs.map +1 -0
- package/es/components/select-textarea/src/select-textarea.d.ts +26 -0
- package/es/components/select-textarea/src/select-textarea.mjs +36 -0
- package/es/components/select-textarea/src/select-textarea.mjs.map +1 -0
- package/es/components/select-textarea/src/select-textarea.vue.d.ts +13075 -0
- package/es/components/select-textarea/src/select-textarea2.mjs +105 -0
- package/es/components/select-textarea/src/select-textarea2.mjs.map +1 -0
- package/es/components/select-textarea/style/css.d.ts +2 -0
- package/es/components/select-textarea/style/css.mjs +3 -0
- package/es/components/select-textarea/style/css.mjs.map +1 -0
- package/es/components/select-textarea/style/index.d.ts +2 -0
- package/es/components/select-textarea/style/index.mjs +3 -0
- package/es/components/select-textarea/style/index.mjs.map +1 -0
- package/es/components/title/src/title2.mjs +1 -2
- package/es/components/title/src/title2.mjs.map +1 -1
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/index.mjs +1 -0
- package/es/hooks/index.mjs.map +1 -1
- package/es/hooks/use-cursor/index.d.ts +1 -0
- package/es/hooks/use-cursor/index.mjs +14 -0
- package/es/hooks/use-cursor/index.mjs.map +1 -0
- package/es/index.mjs +5 -0
- package/es/index.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/global.d.ts +2 -0
- package/lib/component.js +5 -1
- package/lib/component.js.map +1 -1
- package/lib/components/collapse/index.js +2 -2
- package/lib/components/collapse/src/collapse.js +70 -0
- package/lib/components/collapse/src/collapse.js.map +1 -1
- package/lib/components/collapse/src/collapse2.js +0 -70
- package/lib/components/collapse/src/collapse2.js.map +1 -1
- package/lib/components/dropdown/index.d.ts +5 -5
- package/lib/components/dropdown/src/index.js +3 -2
- package/lib/components/dropdown/src/index.js.map +1 -1
- package/lib/components/dropdown/src/index.vue.d.ts +6 -5
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +10 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/input-range/index.d.ts +5 -0
- package/lib/components/input-range/index.js +16 -0
- package/lib/components/input-range/index.js.map +1 -0
- package/lib/components/input-range/src/input-range.d.ts +24 -0
- package/lib/components/input-range/src/input-range.js +36 -0
- package/lib/components/input-range/src/input-range.js.map +1 -0
- package/lib/components/input-range/src/input-range.vue.d.ts +86 -0
- package/lib/components/input-range/src/input-range2.js +85 -0
- package/lib/components/input-range/src/input-range2.js.map +1 -0
- package/lib/components/input-range/style/css.d.ts +2 -0
- package/lib/components/input-range/style/css.js +6 -0
- package/lib/components/input-range/style/css.js.map +1 -0
- package/lib/components/input-range/style/index.d.ts +2 -0
- package/lib/components/input-range/style/index.js +6 -0
- package/lib/components/input-range/style/index.js.map +1 -0
- package/lib/components/page-size/index.d.ts +1 -1
- package/lib/components/page-size/src/index.js.map +1 -1
- package/lib/components/page-size/src/index.vue.d.ts +1 -1
- package/lib/components/scan/src/scan2.js.map +1 -1
- package/lib/components/select-input/index.d.ts +10 -10
- package/lib/components/select-input/src/select-input.d.ts +3 -3
- package/lib/components/select-input/src/select-input.js.map +1 -1
- package/lib/components/select-input/src/select-input.vue.d.ts +10 -10
- package/lib/components/select-textarea/index.d.ts +5 -0
- package/lib/components/select-textarea/index.js +16 -0
- package/lib/components/select-textarea/index.js.map +1 -0
- package/lib/components/select-textarea/src/select-textarea.d.ts +26 -0
- package/lib/components/select-textarea/src/select-textarea.js +41 -0
- package/lib/components/select-textarea/src/select-textarea.js.map +1 -0
- package/lib/components/select-textarea/src/select-textarea.vue.d.ts +13075 -0
- package/lib/components/select-textarea/src/select-textarea2.js +109 -0
- package/lib/components/select-textarea/src/select-textarea2.js.map +1 -0
- package/lib/components/select-textarea/style/css.d.ts +2 -0
- package/lib/components/select-textarea/style/css.js +6 -0
- package/lib/components/select-textarea/style/css.js.map +1 -0
- package/lib/components/select-textarea/style/index.d.ts +2 -0
- package/lib/components/select-textarea/style/index.js +6 -0
- package/lib/components/select-textarea/style/index.js.map +1 -0
- package/lib/components/title/src/title2.js +1 -2
- package/lib/components/title/src/title2.js.map +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.js +2 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/use-cursor/index.d.ts +1 -0
- package/lib/hooks/use-cursor/index.js +18 -0
- package/lib/hooks/use-cursor/index.js.map +1 -0
- package/lib/index.js +40 -28
- package/lib/index.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
- package/tags.json +1 -0
- package/theme/hzzt-input-range.css +0 -0
- package/theme/hzzt-select-textarea.css +0 -0
- package/theme/src/index.scss +2 -0
- package/theme/src/input-range.scss +0 -0
- package/theme/src/select-textarea.scss +0 -0
- package/web-types.json +1 -0
package/dist/index.full.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! Hzzt Plus
|
|
1
|
+
/*! Hzzt Plus v1.0.2 */
|
|
2
2
|
|
|
3
|
-
import { readonly, shallowRef, watchEffect, getCurrentScope, onScopeDispose, unref, getCurrentInstance, onMounted, nextTick, watch, ref, defineComponent, openBlock, createElementBlock, createElementVNode, warn, computed, isRef, inject, provide, renderSlot, mergeProps, toRef, onUnmounted, useAttrs as useAttrs$1,
|
|
3
|
+
import { readonly, shallowRef, watchEffect, getCurrentScope, onScopeDispose, unref, getCurrentInstance, onMounted, nextTick, watch, ref, defineComponent, openBlock, createElementBlock, createElementVNode, warn, computed, isRef, inject, provide, renderSlot, useSlots, createCommentVNode, createTextVNode, toDisplayString, mergeProps, toRef, onUnmounted, useAttrs as useAttrs$1, normalizeClass, normalizeStyle, Fragment, createBlock, withCtx, resolveDynamicComponent, withModifiers, createVNode, onBeforeUnmount, Transition, withDirectives, vShow, reactive, onActivated, onUpdated, cloneVNode, Text, Comment, Teleport as Teleport$1, onBeforeMount, onDeactivated, withKeys, createSlots, toRaw, toRefs, resolveComponent, resolveDirective, toHandlerKey, renderList, vModelText, h, normalizeProps, guardReactiveProps } from 'vue';
|
|
4
4
|
|
|
5
5
|
var __defProp$9 = Object.defineProperty;
|
|
6
6
|
var __defProps$6 = Object.defineProperties;
|
|
@@ -4289,7 +4289,7 @@ var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer;
|
|
|
4289
4289
|
var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
|
|
4290
4290
|
|
|
4291
4291
|
var boolTag = "[object Boolean]";
|
|
4292
|
-
function isBoolean$
|
|
4292
|
+
function isBoolean$2(value) {
|
|
4293
4293
|
return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag;
|
|
4294
4294
|
}
|
|
4295
4295
|
|
|
@@ -4331,7 +4331,7 @@ function isEmpty$1(value) {
|
|
|
4331
4331
|
return true;
|
|
4332
4332
|
}
|
|
4333
4333
|
|
|
4334
|
-
function isEqual(value, other) {
|
|
4334
|
+
function isEqual$1(value, other) {
|
|
4335
4335
|
return baseIsEqual(value, other);
|
|
4336
4336
|
}
|
|
4337
4337
|
|
|
@@ -6337,12 +6337,12 @@ var lang = {
|
|
|
6337
6337
|
isArrayBuffer,
|
|
6338
6338
|
isArrayLike,
|
|
6339
6339
|
isArrayLikeObject,
|
|
6340
|
-
isBoolean: isBoolean$
|
|
6340
|
+
isBoolean: isBoolean$2,
|
|
6341
6341
|
isBuffer,
|
|
6342
6342
|
isDate,
|
|
6343
6343
|
isElement: isElement$1,
|
|
6344
6344
|
isEmpty: isEmpty$1,
|
|
6345
|
-
isEqual,
|
|
6345
|
+
isEqual: isEqual$1,
|
|
6346
6346
|
isEqualWith,
|
|
6347
6347
|
isError,
|
|
6348
6348
|
isFinite,
|
|
@@ -7124,6 +7124,7 @@ if (symIterator) {
|
|
|
7124
7124
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
7125
7125
|
*/
|
|
7126
7126
|
|
|
7127
|
+
const isBoolean$1 = (val) => typeof val === "boolean";
|
|
7127
7128
|
const isNumber$1 = (val) => typeof val === "number";
|
|
7128
7129
|
const isEmpty = (val) => !val && val !== 0 || isArray$1(val) && val.length === 0 || isObject$1(val) && !Object.keys(val).length;
|
|
7129
7130
|
|
|
@@ -12842,6 +12843,18 @@ function numberToLetter(index) {
|
|
|
12842
12843
|
}
|
|
12843
12844
|
}
|
|
12844
12845
|
|
|
12846
|
+
function insertCursorPosition(inputEl, content) {
|
|
12847
|
+
const startPos = inputEl.selectionStart || 0;
|
|
12848
|
+
const endPos = inputEl.selectionEnd || 0;
|
|
12849
|
+
const restoreTop = inputEl.scrollTop;
|
|
12850
|
+
inputEl.value = inputEl.value.substring(0, startPos) + content + inputEl.value.substring(endPos, inputEl.value.length);
|
|
12851
|
+
inputEl.focus();
|
|
12852
|
+
inputEl.scrollTop = restoreTop;
|
|
12853
|
+
inputEl.selectionStart = startPos + content.length;
|
|
12854
|
+
inputEl.selectionEnd = startPos + content.length;
|
|
12855
|
+
return inputEl.value;
|
|
12856
|
+
}
|
|
12857
|
+
|
|
12845
12858
|
const configProviderContextKey$1 = Symbol();
|
|
12846
12859
|
|
|
12847
12860
|
const globalConfig$1 = ref();
|
|
@@ -12916,7 +12929,7 @@ var ConfigProvider$1 = ConfigProvider;
|
|
|
12916
12929
|
|
|
12917
12930
|
const HzztConfigProvider = withInstall$1(ConfigProvider$1);
|
|
12918
12931
|
|
|
12919
|
-
const version$1 = "
|
|
12932
|
+
const version$1 = "1.0.2";
|
|
12920
12933
|
|
|
12921
12934
|
const makeInstaller = (components = []) => {
|
|
12922
12935
|
const install = (app, options) => {
|
|
@@ -12933,6 +12946,61 @@ const makeInstaller = (components = []) => {
|
|
|
12933
12946
|
};
|
|
12934
12947
|
};
|
|
12935
12948
|
|
|
12949
|
+
const titleProps = buildProps$1({
|
|
12950
|
+
label: String,
|
|
12951
|
+
sideline: {
|
|
12952
|
+
type: Boolean,
|
|
12953
|
+
default: true
|
|
12954
|
+
}
|
|
12955
|
+
});
|
|
12956
|
+
|
|
12957
|
+
var _export_sfc$1 = (sfc, props) => {
|
|
12958
|
+
const target = sfc.__vccOpts || sfc;
|
|
12959
|
+
for (const [key, val] of props) {
|
|
12960
|
+
target[key] = val;
|
|
12961
|
+
}
|
|
12962
|
+
return target;
|
|
12963
|
+
};
|
|
12964
|
+
|
|
12965
|
+
const _hoisted_1$c = {
|
|
12966
|
+
key: 0,
|
|
12967
|
+
class: "hzzt-title flex align-items-center"
|
|
12968
|
+
};
|
|
12969
|
+
const _hoisted_2$a = {
|
|
12970
|
+
key: 0,
|
|
12971
|
+
class: "decorative-line"
|
|
12972
|
+
};
|
|
12973
|
+
const _hoisted_3$7 = { class: "label-name" };
|
|
12974
|
+
const __default__$t = defineComponent({
|
|
12975
|
+
name: "HzztTitle"
|
|
12976
|
+
});
|
|
12977
|
+
const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
12978
|
+
...__default__$t,
|
|
12979
|
+
props: titleProps,
|
|
12980
|
+
setup(__props) {
|
|
12981
|
+
const props = __props;
|
|
12982
|
+
const slots = useSlots();
|
|
12983
|
+
const showLabel = computed(() => {
|
|
12984
|
+
var _a, _b, _c;
|
|
12985
|
+
return props.label || ((_c = (_b = (_a = slots == null ? void 0 : slots.default) == null ? void 0 : _a.call(slots)) == null ? void 0 : _b[0]) == null ? void 0 : _c.children);
|
|
12986
|
+
});
|
|
12987
|
+
return (_ctx, _cache) => {
|
|
12988
|
+
return unref(showLabel) ? (openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
12989
|
+
_ctx.sideline ? (openBlock(), createElementBlock("span", _hoisted_2$a)) : createCommentVNode("v-if", true),
|
|
12990
|
+
renderSlot(_ctx.$slots, "before"),
|
|
12991
|
+
createElementVNode("label", _hoisted_3$7, [
|
|
12992
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
12993
|
+
createTextVNode(toDisplayString(_ctx.label), 1)
|
|
12994
|
+
])
|
|
12995
|
+
])
|
|
12996
|
+
])) : createCommentVNode("v-if", true);
|
|
12997
|
+
};
|
|
12998
|
+
}
|
|
12999
|
+
});
|
|
13000
|
+
var HzztTitle$1 = /* @__PURE__ */ _export_sfc$1(_sfc_main$H, [["__file", "title.vue"]]);
|
|
13001
|
+
|
|
13002
|
+
const HzztTitle = withInstall$1(HzztTitle$1);
|
|
13003
|
+
|
|
12936
13004
|
const configProviderContextKey = Symbol();
|
|
12937
13005
|
|
|
12938
13006
|
const defaultNamespace = "el";
|
|
@@ -13372,7 +13440,7 @@ const UPDATE_MODEL_EVENT = "update:modelValue";
|
|
|
13372
13440
|
const CHANGE_EVENT = "change";
|
|
13373
13441
|
const INPUT_EVENT = "input";
|
|
13374
13442
|
|
|
13375
|
-
var _export_sfc
|
|
13443
|
+
var _export_sfc = (sfc, props) => {
|
|
13376
13444
|
const target = sfc.__vccOpts || sfc;
|
|
13377
13445
|
for (const [key, val] of props) {
|
|
13378
13446
|
target[key] = val;
|
|
@@ -13380,6 +13448,9 @@ var _export_sfc$1 = (sfc, props) => {
|
|
|
13380
13448
|
return target;
|
|
13381
13449
|
};
|
|
13382
13450
|
|
|
13451
|
+
const rAF = (fn) => isClient ? window.requestAnimationFrame(fn) : setTimeout(fn, 16);
|
|
13452
|
+
const cAF = (handle) => isClient ? window.cancelAnimationFrame(handle) : clearTimeout(handle);
|
|
13453
|
+
|
|
13383
13454
|
function addUnit(value, defaultUnit = "px") {
|
|
13384
13455
|
if (!value)
|
|
13385
13456
|
return "";
|
|
@@ -13447,12 +13518,12 @@ const iconProps = buildProps({
|
|
|
13447
13518
|
}
|
|
13448
13519
|
});
|
|
13449
13520
|
|
|
13450
|
-
const __default__$
|
|
13521
|
+
const __default__$s = defineComponent({
|
|
13451
13522
|
name: "ElIcon",
|
|
13452
13523
|
inheritAttrs: false
|
|
13453
13524
|
});
|
|
13454
|
-
const _sfc_main$
|
|
13455
|
-
...__default__$
|
|
13525
|
+
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
13526
|
+
...__default__$s,
|
|
13456
13527
|
props: iconProps,
|
|
13457
13528
|
setup(__props) {
|
|
13458
13529
|
const props = __props;
|
|
@@ -13476,7 +13547,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
13476
13547
|
};
|
|
13477
13548
|
}
|
|
13478
13549
|
});
|
|
13479
|
-
var Icon = /* @__PURE__ */ _export_sfc
|
|
13550
|
+
var Icon = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__file", "icon.vue"]]);
|
|
13480
13551
|
|
|
13481
13552
|
const ElIcon = withInstall(Icon);
|
|
13482
13553
|
|
|
@@ -13914,12 +13985,12 @@ function useCursor(input) {
|
|
|
13914
13985
|
return [recordCursor, setCursor];
|
|
13915
13986
|
}
|
|
13916
13987
|
|
|
13917
|
-
const __default__$
|
|
13988
|
+
const __default__$r = defineComponent({
|
|
13918
13989
|
name: "ElInput",
|
|
13919
13990
|
inheritAttrs: false
|
|
13920
13991
|
});
|
|
13921
|
-
const _sfc_main$
|
|
13922
|
-
...__default__$
|
|
13992
|
+
const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
13993
|
+
...__default__$r,
|
|
13923
13994
|
props: inputProps,
|
|
13924
13995
|
emits: inputEmits,
|
|
13925
13996
|
setup(__props, { expose, emit }) {
|
|
@@ -14324,7 +14395,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
14324
14395
|
};
|
|
14325
14396
|
}
|
|
14326
14397
|
});
|
|
14327
|
-
var Input = /* @__PURE__ */ _export_sfc
|
|
14398
|
+
var Input = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__file", "input.vue"]]);
|
|
14328
14399
|
|
|
14329
14400
|
const ElInput = withInstall(Input);
|
|
14330
14401
|
|
|
@@ -14351,7 +14422,7 @@ const BAR_MAP = {
|
|
|
14351
14422
|
direction: "left"
|
|
14352
14423
|
}
|
|
14353
14424
|
};
|
|
14354
|
-
const renderThumbStyle = ({
|
|
14425
|
+
const renderThumbStyle$1 = ({
|
|
14355
14426
|
move,
|
|
14356
14427
|
size,
|
|
14357
14428
|
bar
|
|
@@ -14374,7 +14445,7 @@ const thumbProps = buildProps({
|
|
|
14374
14445
|
});
|
|
14375
14446
|
|
|
14376
14447
|
const COMPONENT_NAME$2 = "Thumb";
|
|
14377
|
-
const _sfc_main$
|
|
14448
|
+
const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
14378
14449
|
__name: "thumb",
|
|
14379
14450
|
props: thumbProps,
|
|
14380
14451
|
setup(__props) {
|
|
@@ -14391,7 +14462,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
14391
14462
|
let cursorLeave = false;
|
|
14392
14463
|
let originalOnSelectStart = isClient ? document.onselectstart : null;
|
|
14393
14464
|
const bar = computed(() => BAR_MAP[props.vertical ? "vertical" : "horizontal"]);
|
|
14394
|
-
const thumbStyle = computed(() => renderThumbStyle({
|
|
14465
|
+
const thumbStyle = computed(() => renderThumbStyle$1({
|
|
14395
14466
|
size: props.size,
|
|
14396
14467
|
move: props.move,
|
|
14397
14468
|
bar: bar.value
|
|
@@ -14493,7 +14564,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
14493
14564
|
};
|
|
14494
14565
|
}
|
|
14495
14566
|
});
|
|
14496
|
-
var Thumb = /* @__PURE__ */ _export_sfc
|
|
14567
|
+
var Thumb = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__file", "thumb.vue"]]);
|
|
14497
14568
|
|
|
14498
14569
|
const barProps = buildProps({
|
|
14499
14570
|
always: {
|
|
@@ -14506,7 +14577,7 @@ const barProps = buildProps({
|
|
|
14506
14577
|
}
|
|
14507
14578
|
});
|
|
14508
14579
|
|
|
14509
|
-
const _sfc_main$
|
|
14580
|
+
const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
14510
14581
|
__name: "bar",
|
|
14511
14582
|
props: barProps,
|
|
14512
14583
|
setup(__props, { expose }) {
|
|
@@ -14564,7 +14635,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
14564
14635
|
};
|
|
14565
14636
|
}
|
|
14566
14637
|
});
|
|
14567
|
-
var Bar = /* @__PURE__ */ _export_sfc
|
|
14638
|
+
var Bar = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__file", "bar.vue"]]);
|
|
14568
14639
|
|
|
14569
14640
|
const scrollbarProps = buildProps({
|
|
14570
14641
|
height: {
|
|
@@ -14621,11 +14692,11 @@ const scrollbarEmits = {
|
|
|
14621
14692
|
};
|
|
14622
14693
|
|
|
14623
14694
|
const COMPONENT_NAME$1 = "ElScrollbar";
|
|
14624
|
-
const __default__$
|
|
14695
|
+
const __default__$q = defineComponent({
|
|
14625
14696
|
name: COMPONENT_NAME$1
|
|
14626
14697
|
});
|
|
14627
|
-
const _sfc_main$
|
|
14628
|
-
...__default__$
|
|
14698
|
+
const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
14699
|
+
...__default__$q,
|
|
14629
14700
|
props: scrollbarProps,
|
|
14630
14701
|
emits: scrollbarEmits,
|
|
14631
14702
|
setup(__props, { expose, emit }) {
|
|
@@ -14777,7 +14848,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
14777
14848
|
};
|
|
14778
14849
|
}
|
|
14779
14850
|
});
|
|
14780
|
-
var Scrollbar = /* @__PURE__ */ _export_sfc
|
|
14851
|
+
var Scrollbar = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__file", "scrollbar.vue"]]);
|
|
14781
14852
|
|
|
14782
14853
|
const ElScrollbar = withInstall(Scrollbar);
|
|
14783
14854
|
|
|
@@ -14802,12 +14873,12 @@ const popperProps = buildProps({
|
|
|
14802
14873
|
}
|
|
14803
14874
|
});
|
|
14804
14875
|
|
|
14805
|
-
const __default__$
|
|
14876
|
+
const __default__$p = defineComponent({
|
|
14806
14877
|
name: "ElPopper",
|
|
14807
14878
|
inheritAttrs: false
|
|
14808
14879
|
});
|
|
14809
|
-
const _sfc_main$
|
|
14810
|
-
...__default__$
|
|
14880
|
+
const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
14881
|
+
...__default__$p,
|
|
14811
14882
|
props: popperProps,
|
|
14812
14883
|
setup(__props, { expose }) {
|
|
14813
14884
|
const props = __props;
|
|
@@ -14830,7 +14901,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
14830
14901
|
};
|
|
14831
14902
|
}
|
|
14832
14903
|
});
|
|
14833
|
-
var Popper = /* @__PURE__ */ _export_sfc
|
|
14904
|
+
var Popper = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__file", "popper.vue"]]);
|
|
14834
14905
|
|
|
14835
14906
|
const popperArrowProps = buildProps({
|
|
14836
14907
|
arrowOffset: {
|
|
@@ -14839,12 +14910,12 @@ const popperArrowProps = buildProps({
|
|
|
14839
14910
|
}
|
|
14840
14911
|
});
|
|
14841
14912
|
|
|
14842
|
-
const __default__$
|
|
14913
|
+
const __default__$o = defineComponent({
|
|
14843
14914
|
name: "ElPopperArrow",
|
|
14844
14915
|
inheritAttrs: false
|
|
14845
14916
|
});
|
|
14846
|
-
const _sfc_main$
|
|
14847
|
-
...__default__$
|
|
14917
|
+
const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
14918
|
+
...__default__$o,
|
|
14848
14919
|
props: popperArrowProps,
|
|
14849
14920
|
setup(__props, { expose }) {
|
|
14850
14921
|
const props = __props;
|
|
@@ -14870,7 +14941,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
14870
14941
|
};
|
|
14871
14942
|
}
|
|
14872
14943
|
});
|
|
14873
|
-
var ElPopperArrow = /* @__PURE__ */ _export_sfc
|
|
14944
|
+
var ElPopperArrow = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__file", "arrow.vue"]]);
|
|
14874
14945
|
|
|
14875
14946
|
const popperTriggerProps = buildProps({
|
|
14876
14947
|
virtualRef: {
|
|
@@ -15005,12 +15076,12 @@ function wrapTextContent(s) {
|
|
|
15005
15076
|
}, [s]);
|
|
15006
15077
|
}
|
|
15007
15078
|
|
|
15008
|
-
const __default__$
|
|
15079
|
+
const __default__$n = defineComponent({
|
|
15009
15080
|
name: "ElPopperTrigger",
|
|
15010
15081
|
inheritAttrs: false
|
|
15011
15082
|
});
|
|
15012
|
-
const _sfc_main$
|
|
15013
|
-
...__default__$
|
|
15083
|
+
const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
15084
|
+
...__default__$n,
|
|
15014
15085
|
props: popperTriggerProps,
|
|
15015
15086
|
setup(__props, { expose }) {
|
|
15016
15087
|
const props = __props;
|
|
@@ -15121,7 +15192,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
15121
15192
|
};
|
|
15122
15193
|
}
|
|
15123
15194
|
});
|
|
15124
|
-
var ElPopperTrigger = /* @__PURE__ */ _export_sfc
|
|
15195
|
+
var ElPopperTrigger = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__file", "trigger.vue"]]);
|
|
15125
15196
|
|
|
15126
15197
|
const FOCUS_AFTER_TRAPPED = "focus-trap.focus-after-trapped";
|
|
15127
15198
|
const FOCUS_AFTER_RELEASED = "focus-trap.focus-after-released";
|
|
@@ -15320,7 +15391,7 @@ const useEscapeKeydown = (handler) => {
|
|
|
15320
15391
|
});
|
|
15321
15392
|
};
|
|
15322
15393
|
|
|
15323
|
-
const _sfc_main$
|
|
15394
|
+
const _sfc_main$y = defineComponent({
|
|
15324
15395
|
name: "ElFocusTrap",
|
|
15325
15396
|
inheritAttrs: false,
|
|
15326
15397
|
props: {
|
|
@@ -15562,10 +15633,10 @@ const _sfc_main$u = defineComponent({
|
|
|
15562
15633
|
};
|
|
15563
15634
|
}
|
|
15564
15635
|
});
|
|
15565
|
-
function _sfc_render$
|
|
15636
|
+
function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
15566
15637
|
return renderSlot(_ctx.$slots, "default", { handleKeydown: _ctx.onKeydown });
|
|
15567
15638
|
}
|
|
15568
|
-
var ElFocusTrap = /* @__PURE__ */ _export_sfc
|
|
15639
|
+
var ElFocusTrap = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$9], ["__file", "focus-trap.vue"]]);
|
|
15569
15640
|
|
|
15570
15641
|
var E="top",R="bottom",W="right",P="left",me="auto",G=[E,R,W,P],U="start",J="end",Xe="clippingParents",je="viewport",K="popper",Ye="reference",De=G.reduce(function(t,e){return t.concat([e+"-"+U,e+"-"+J])},[]),Ee=[].concat(G,[me]).reduce(function(t,e){return t.concat([e,e+"-"+U,e+"-"+J])},[]),Ge="beforeRead",Je="read",Ke="afterRead",Qe="beforeMain",Ze="main",et="afterMain",tt="beforeWrite",nt="write",rt="afterWrite",ot=[Ge,Je,Ke,Qe,Ze,et,tt,nt,rt];function C(t){return t?(t.nodeName||"").toLowerCase():null}function H(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Q(t){var e=H(t).Element;return t instanceof e||t instanceof Element}function B(t){var e=H(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Pe(t){if(typeof ShadowRoot=="undefined")return !1;var e=H(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Mt(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},o=e.attributes[n]||{},i=e.elements[n];!B(i)||!C(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(a){var s=o[a];s===!1?i.removeAttribute(a):i.setAttribute(a,s===!0?"":s);}));});}function Rt(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var o=e.elements[r],i=e.attributes[r]||{},a=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),s=a.reduce(function(f,c){return f[c]="",f},{});!B(o)||!C(o)||(Object.assign(o.style,s),Object.keys(i).forEach(function(f){o.removeAttribute(f);}));});}}var Ae={name:"applyStyles",enabled:!0,phase:"write",fn:Mt,effect:Rt,requires:["computeStyles"]};function q(t){return t.split("-")[0]}var X=Math.max,ve=Math.min,Z=Math.round;function ee(t,e){e===void 0&&(e=!1);var n=t.getBoundingClientRect(),r=1,o=1;if(B(t)&&e){var i=t.offsetHeight,a=t.offsetWidth;a>0&&(r=Z(n.width)/a||1),i>0&&(o=Z(n.height)/i||1);}return {width:n.width/r,height:n.height/o,top:n.top/o,right:n.right/r,bottom:n.bottom/o,left:n.left/r,x:n.left/r,y:n.top/o}}function ke(t){var e=ee(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function it(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return !0;if(n&&Pe(n)){var r=e;do{if(r&&t.isSameNode(r))return !0;r=r.parentNode||r.host;}while(r)}return !1}function N(t){return H(t).getComputedStyle(t)}function Wt(t){return ["table","td","th"].indexOf(C(t))>=0}function I(t){return ((Q(t)?t.ownerDocument:t.document)||window.document).documentElement}function ge(t){return C(t)==="html"?t:t.assignedSlot||t.parentNode||(Pe(t)?t.host:null)||I(t)}function at(t){return !B(t)||N(t).position==="fixed"?null:t.offsetParent}function Bt(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&B(t)){var r=N(t);if(r.position==="fixed")return null}var o=ge(t);for(Pe(o)&&(o=o.host);B(o)&&["html","body"].indexOf(C(o))<0;){var i=N(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return o;o=o.parentNode;}return null}function se(t){for(var e=H(t),n=at(t);n&&Wt(n)&&N(n).position==="static";)n=at(n);return n&&(C(n)==="html"||C(n)==="body"&&N(n).position==="static")?e:n||Bt(t)||e}function Le(t){return ["top","bottom"].indexOf(t)>=0?"x":"y"}function fe(t,e,n){return X(t,ve(e,n))}function St(t,e,n){var r=fe(t,e,n);return r>n?n:r}function st(){return {top:0,right:0,bottom:0,left:0}}function ft(t){return Object.assign({},st(),t)}function ct(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var Tt=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,ft(typeof t!="number"?t:ct(t,G))};function Ht(t){var e,n=t.state,r=t.name,o=t.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=q(n.placement),f=Le(s),c=[P,W].indexOf(s)>=0,u=c?"height":"width";if(!(!i||!a)){var m=Tt(o.padding,n),v=ke(i),l=f==="y"?E:P,h=f==="y"?R:W,p=n.rects.reference[u]+n.rects.reference[f]-a[f]-n.rects.popper[u],g=a[f]-n.rects.reference[f],x=se(i),y=x?f==="y"?x.clientHeight||0:x.clientWidth||0:0,$=p/2-g/2,d=m[l],b=y-v[u]-m[h],w=y/2-v[u]/2+$,O=fe(d,w,b),j=f;n.modifiersData[r]=(e={},e[j]=O,e.centerOffset=O-w,e);}}function Ct(t){var e=t.state,n=t.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||!it(e.elements.popper,o)||(e.elements.arrow=o));}var pt={name:"arrow",enabled:!0,phase:"main",fn:Ht,effect:Ct,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function te(t){return t.split("-")[1]}var qt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Vt(t){var e=t.x,n=t.y,r=window,o=r.devicePixelRatio||1;return {x:Z(e*o)/o||0,y:Z(n*o)/o||0}}function ut(t){var e,n=t.popper,r=t.popperRect,o=t.placement,i=t.variation,a=t.offsets,s=t.position,f=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,m=t.isFixed,v=a.x,l=v===void 0?0:v,h=a.y,p=h===void 0?0:h,g=typeof u=="function"?u({x:l,y:p}):{x:l,y:p};l=g.x,p=g.y;var x=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),$=P,d=E,b=window;if(c){var w=se(n),O="clientHeight",j="clientWidth";if(w===H(n)&&(w=I(n),N(w).position!=="static"&&s==="absolute"&&(O="scrollHeight",j="scrollWidth")),w=w,o===E||(o===P||o===W)&&i===J){d=R;var A=m&&w===b&&b.visualViewport?b.visualViewport.height:w[O];p-=A-r.height,p*=f?1:-1;}if(o===P||(o===E||o===R)&&i===J){$=W;var k=m&&w===b&&b.visualViewport?b.visualViewport.width:w[j];l-=k-r.width,l*=f?1:-1;}}var D=Object.assign({position:s},c&&qt),S=u===!0?Vt({x:l,y:p}):{x:l,y:p};if(l=S.x,p=S.y,f){var L;return Object.assign({},D,(L={},L[d]=y?"0":"",L[$]=x?"0":"",L.transform=(b.devicePixelRatio||1)<=1?"translate("+l+"px, "+p+"px)":"translate3d("+l+"px, "+p+"px, 0)",L))}return Object.assign({},D,(e={},e[d]=y?p+"px":"",e[$]=x?l+"px":"",e.transform="",e))}function Nt(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,a=i===void 0?!0:i,s=n.roundOffsets,f=s===void 0?!0:s,c={placement:q(e.placement),variation:te(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,ut(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:f})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,ut(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement});}var Me={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Nt,data:{}},ye={passive:!0};function It(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,i=o===void 0?!0:o,a=r.resize,s=a===void 0?!0:a,f=H(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",n.update,ye);}),s&&f.addEventListener("resize",n.update,ye),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",n.update,ye);}),s&&f.removeEventListener("resize",n.update,ye);}}var Re={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:It,data:{}},_t={left:"right",right:"left",bottom:"top",top:"bottom"};function be(t){return t.replace(/left|right|bottom|top/g,function(e){return _t[e]})}var zt={start:"end",end:"start"};function lt(t){return t.replace(/start|end/g,function(e){return zt[e]})}function We(t){var e=H(t),n=e.pageXOffset,r=e.pageYOffset;return {scrollLeft:n,scrollTop:r}}function Be(t){return ee(I(t)).left+We(t).scrollLeft}function Ft(t){var e=H(t),n=I(t),r=e.visualViewport,o=n.clientWidth,i=n.clientHeight,a=0,s=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:o,height:i,x:a+Be(t),y:s}}function Ut(t){var e,n=I(t),r=We(t),o=(e=t.ownerDocument)==null?void 0:e.body,i=X(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=X(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+Be(t),f=-r.scrollTop;return N(o||n).direction==="rtl"&&(s+=X(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:f}}function Se(t){var e=N(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return /auto|scroll|overlay|hidden/.test(n+o+r)}function dt(t){return ["html","body","#document"].indexOf(C(t))>=0?t.ownerDocument.body:B(t)&&Se(t)?t:dt(ge(t))}function ce(t,e){var n;e===void 0&&(e=[]);var r=dt(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),i=H(r),a=o?[i].concat(i.visualViewport||[],Se(r)?r:[]):r,s=e.concat(a);return o?s:s.concat(ce(ge(a)))}function Te(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Xt(t){var e=ee(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function ht(t,e){return e===je?Te(Ft(t)):Q(e)?Xt(e):Te(Ut(I(t)))}function Yt(t){var e=ce(ge(t)),n=["absolute","fixed"].indexOf(N(t).position)>=0,r=n&&B(t)?se(t):t;return Q(r)?e.filter(function(o){return Q(o)&&it(o,r)&&C(o)!=="body"}):[]}function Gt(t,e,n){var r=e==="clippingParents"?Yt(t):[].concat(e),o=[].concat(r,[n]),i=o[0],a=o.reduce(function(s,f){var c=ht(t,f);return s.top=X(c.top,s.top),s.right=ve(c.right,s.right),s.bottom=ve(c.bottom,s.bottom),s.left=X(c.left,s.left),s},ht(t,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function mt(t){var e=t.reference,n=t.element,r=t.placement,o=r?q(r):null,i=r?te(r):null,a=e.x+e.width/2-n.width/2,s=e.y+e.height/2-n.height/2,f;switch(o){case E:f={x:a,y:e.y-n.height};break;case R:f={x:a,y:e.y+e.height};break;case W:f={x:e.x+e.width,y:s};break;case P:f={x:e.x-n.width,y:s};break;default:f={x:e.x,y:e.y};}var c=o?Le(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case U:f[c]=f[c]-(e[u]/2-n[u]/2);break;case J:f[c]=f[c]+(e[u]/2-n[u]/2);break}}return f}function ne(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=r===void 0?t.placement:r,i=n.boundary,a=i===void 0?Xe:i,s=n.rootBoundary,f=s===void 0?je:s,c=n.elementContext,u=c===void 0?K:c,m=n.altBoundary,v=m===void 0?!1:m,l=n.padding,h=l===void 0?0:l,p=ft(typeof h!="number"?h:ct(h,G)),g=u===K?Ye:K,x=t.rects.popper,y=t.elements[v?g:u],$=Gt(Q(y)?y:y.contextElement||I(t.elements.popper),a,f),d=ee(t.elements.reference),b=mt({reference:d,element:x,strategy:"absolute",placement:o}),w=Te(Object.assign({},x,b)),O=u===K?w:d,j={top:$.top-O.top+p.top,bottom:O.bottom-$.bottom+p.bottom,left:$.left-O.left+p.left,right:O.right-$.right+p.right},A=t.modifiersData.offset;if(u===K&&A){var k=A[o];Object.keys(j).forEach(function(D){var S=[W,R].indexOf(D)>=0?1:-1,L=[E,R].indexOf(D)>=0?"y":"x";j[D]+=k[L]*S;});}return j}function Jt(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,f=n.allowedAutoPlacements,c=f===void 0?Ee:f,u=te(r),m=u?s?De:De.filter(function(h){return te(h)===u}):G,v=m.filter(function(h){return c.indexOf(h)>=0});v.length===0&&(v=m);var l=v.reduce(function(h,p){return h[p]=ne(t,{placement:p,boundary:o,rootBoundary:i,padding:a})[q(p)],h},{});return Object.keys(l).sort(function(h,p){return l[h]-l[p]})}function Kt(t){if(q(t)===me)return [];var e=be(t);return [lt(t),e,lt(e)]}function Qt(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,s=a===void 0?!0:a,f=n.fallbackPlacements,c=n.padding,u=n.boundary,m=n.rootBoundary,v=n.altBoundary,l=n.flipVariations,h=l===void 0?!0:l,p=n.allowedAutoPlacements,g=e.options.placement,x=q(g),y=x===g,$=f||(y||!h?[be(g)]:Kt(g)),d=[g].concat($).reduce(function(z,V){return z.concat(q(V)===me?Jt(e,{placement:V,boundary:u,rootBoundary:m,padding:c,flipVariations:h,allowedAutoPlacements:p}):V)},[]),b=e.rects.reference,w=e.rects.popper,O=new Map,j=!0,A=d[0],k=0;k<d.length;k++){var D=d[k],S=q(D),L=te(D)===U,re=[E,R].indexOf(S)>=0,oe=re?"width":"height",M=ne(e,{placement:D,boundary:u,rootBoundary:m,altBoundary:v,padding:c}),T=re?L?W:P:L?R:E;b[oe]>w[oe]&&(T=be(T));var pe=be(T),_=[];if(i&&_.push(M[S]<=0),s&&_.push(M[T]<=0,M[pe]<=0),_.every(function(z){return z})){A=D,j=!1;break}O.set(D,_);}if(j)for(var ue=h?3:1,xe=function(z){var V=d.find(function(de){var ae=O.get(de);if(ae)return ae.slice(0,z).every(function(Y){return Y})});if(V)return A=V,"break"},ie=ue;ie>0;ie--){var le=xe(ie);if(le==="break")break}e.placement!==A&&(e.modifiersData[r]._skip=!0,e.placement=A,e.reset=!0);}}var vt={name:"flip",enabled:!0,phase:"main",fn:Qt,requiresIfExists:["offset"],data:{_skip:!1}};function gt(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function yt(t){return [E,W,R,P].some(function(e){return t[e]>=0})}function Zt(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,a=ne(e,{elementContext:"reference"}),s=ne(e,{altBoundary:!0}),f=gt(a,r),c=gt(s,o,i),u=yt(f),m=yt(c);e.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:m},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":m});}var bt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Zt};function en(t,e,n){var r=q(t),o=[P,E].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[P,W].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function tn(t){var e=t.state,n=t.options,r=t.name,o=n.offset,i=o===void 0?[0,0]:o,a=Ee.reduce(function(u,m){return u[m]=en(m,e.rects,i),u},{}),s=a[e.placement],f=s.x,c=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=f,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=a;}var wt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:tn};function nn(t){var e=t.state,n=t.name;e.modifiersData[n]=mt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement});}var He={name:"popperOffsets",enabled:!0,phase:"read",fn:nn,data:{}};function rn(t){return t==="x"?"y":"x"}function on(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,s=a===void 0?!1:a,f=n.boundary,c=n.rootBoundary,u=n.altBoundary,m=n.padding,v=n.tether,l=v===void 0?!0:v,h=n.tetherOffset,p=h===void 0?0:h,g=ne(e,{boundary:f,rootBoundary:c,padding:m,altBoundary:u}),x=q(e.placement),y=te(e.placement),$=!y,d=Le(x),b=rn(d),w=e.modifiersData.popperOffsets,O=e.rects.reference,j=e.rects.popper,A=typeof p=="function"?p(Object.assign({},e.rects,{placement:e.placement})):p,k=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),D=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,S={x:0,y:0};if(w){if(i){var L,re=d==="y"?E:P,oe=d==="y"?R:W,M=d==="y"?"height":"width",T=w[d],pe=T+g[re],_=T-g[oe],ue=l?-j[M]/2:0,xe=y===U?O[M]:j[M],ie=y===U?-j[M]:-O[M],le=e.elements.arrow,z=l&&le?ke(le):{width:0,height:0},V=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:st(),de=V[re],ae=V[oe],Y=fe(0,O[M],z[M]),jt=$?O[M]/2-ue-Y-de-k.mainAxis:xe-Y-de-k.mainAxis,Dt=$?-O[M]/2+ue+Y+ae+k.mainAxis:ie+Y+ae+k.mainAxis,Oe=e.elements.arrow&&se(e.elements.arrow),Et=Oe?d==="y"?Oe.clientTop||0:Oe.clientLeft||0:0,Ce=(L=D==null?void 0:D[d])!=null?L:0,Pt=T+jt-Ce-Et,At=T+Dt-Ce,qe=fe(l?ve(pe,Pt):pe,T,l?X(_,At):_);w[d]=qe,S[d]=qe-T;}if(s){var Ve,kt=d==="x"?E:P,Lt=d==="x"?R:W,F=w[b],he=b==="y"?"height":"width",Ne=F+g[kt],Ie=F-g[Lt],$e=[E,P].indexOf(x)!==-1,_e=(Ve=D==null?void 0:D[b])!=null?Ve:0,ze=$e?Ne:F-O[he]-j[he]-_e+k.altAxis,Fe=$e?F+O[he]+j[he]-_e-k.altAxis:Ie,Ue=l&&$e?St(ze,F,Fe):fe(l?ze:Ne,F,l?Fe:Ie);w[b]=Ue,S[b]=Ue-F;}e.modifiersData[r]=S;}}var xt={name:"preventOverflow",enabled:!0,phase:"main",fn:on,requiresIfExists:["offset"]};function an(t){return {scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function sn(t){return t===H(t)||!B(t)?We(t):an(t)}function fn(t){var e=t.getBoundingClientRect(),n=Z(e.width)/t.offsetWidth||1,r=Z(e.height)/t.offsetHeight||1;return n!==1||r!==1}function cn(t,e,n){n===void 0&&(n=!1);var r=B(e),o=B(e)&&fn(e),i=I(e),a=ee(t,o),s={scrollLeft:0,scrollTop:0},f={x:0,y:0};return (r||!r&&!n)&&((C(e)!=="body"||Se(i))&&(s=sn(e)),B(e)?(f=ee(e,!0),f.x+=e.clientLeft,f.y+=e.clientTop):i&&(f.x=Be(i))),{x:a.left+s.scrollLeft-f.x,y:a.top+s.scrollTop-f.y,width:a.width,height:a.height}}function pn(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i);});function o(i){n.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var f=e.get(s);f&&o(f);}}),r.push(i);}return t.forEach(function(i){n.has(i.name)||o(i);}),r}function un(t){var e=pn(t);return ot.reduce(function(n,r){return n.concat(e.filter(function(o){return o.phase===r}))},[])}function ln(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t());});})),e}}function dn(t){var e=t.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Ot={placement:"bottom",modifiers:[],strategy:"absolute"};function $t(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return !e.some(function(r){return !(r&&typeof r.getBoundingClientRect=="function")})}function we(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,o=e.defaultOptions,i=o===void 0?Ot:o;return function(a,s,f){f===void 0&&(f=i);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ot,i),modifiersData:{},elements:{reference:a,popper:s},attributes:{},styles:{}},u=[],m=!1,v={state:c,setOptions:function(p){var g=typeof p=="function"?p(c.options):p;h(),c.options=Object.assign({},i,c.options,g),c.scrollParents={reference:Q(a)?ce(a):a.contextElement?ce(a.contextElement):[],popper:ce(s)};var x=un(dn([].concat(r,c.options.modifiers)));return c.orderedModifiers=x.filter(function(y){return y.enabled}),l(),v.update()},forceUpdate:function(){if(!m){var p=c.elements,g=p.reference,x=p.popper;if($t(g,x)){c.rects={reference:cn(g,se(x),c.options.strategy==="fixed"),popper:ke(x)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(j){return c.modifiersData[j.name]=Object.assign({},j.data)});for(var y=0;y<c.orderedModifiers.length;y++){if(c.reset===!0){c.reset=!1,y=-1;continue}var $=c.orderedModifiers[y],d=$.fn,b=$.options,w=b===void 0?{}:b,O=$.name;typeof d=="function"&&(c=d({state:c,options:w,name:O,instance:v})||c);}}}},update:ln(function(){return new Promise(function(p){v.forceUpdate(),p(c);})}),destroy:function(){h(),m=!0;}};if(!$t(a,s))return v;v.setOptions(f).then(function(p){!m&&f.onFirstUpdate&&f.onFirstUpdate(p);});function l(){c.orderedModifiers.forEach(function(p){var g=p.name,x=p.options,y=x===void 0?{}:x,$=p.effect;if(typeof $=="function"){var d=$({state:c,name:g,instance:v,options:y}),b=function(){};u.push(d||b);}});}function h(){u.forEach(function(p){return p()}),u=[];}return v}}we();var mn=[Re,He,Me,Ae];we({defaultModifiers:mn});var gn=[Re,He,Me,Ae,wt,vt,xt,pt,bt],yn=we({defaultModifiers:gn});
|
|
15571
15642
|
|
|
@@ -15944,11 +16015,11 @@ const usePopperContentDOM = (props, {
|
|
|
15944
16015
|
};
|
|
15945
16016
|
};
|
|
15946
16017
|
|
|
15947
|
-
const __default__$
|
|
16018
|
+
const __default__$m = defineComponent({
|
|
15948
16019
|
name: "ElPopperContent"
|
|
15949
16020
|
});
|
|
15950
|
-
const _sfc_main$
|
|
15951
|
-
...__default__$
|
|
16021
|
+
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
16022
|
+
...__default__$m,
|
|
15952
16023
|
props: popperContentProps,
|
|
15953
16024
|
emits: popperContentEmits,
|
|
15954
16025
|
setup(__props, { expose, emit }) {
|
|
@@ -16064,7 +16135,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
16064
16135
|
};
|
|
16065
16136
|
}
|
|
16066
16137
|
});
|
|
16067
|
-
var ElPopperContent = /* @__PURE__ */ _export_sfc
|
|
16138
|
+
var ElPopperContent = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__file", "content.vue"]]);
|
|
16068
16139
|
|
|
16069
16140
|
const ElPopper = withInstall(Popper);
|
|
16070
16141
|
|
|
@@ -16342,11 +16413,11 @@ const composeEventHandlers = (theirsHandler, oursHandler, { checkForDefaultPreve
|
|
|
16342
16413
|
return handleEvent;
|
|
16343
16414
|
};
|
|
16344
16415
|
|
|
16345
|
-
const __default__$
|
|
16416
|
+
const __default__$l = defineComponent({
|
|
16346
16417
|
name: "ElTooltipTrigger"
|
|
16347
16418
|
});
|
|
16348
|
-
const _sfc_main$
|
|
16349
|
-
...__default__$
|
|
16419
|
+
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
16420
|
+
...__default__$l,
|
|
16350
16421
|
props: useTooltipTriggerProps,
|
|
16351
16422
|
setup(__props, { expose }) {
|
|
16352
16423
|
const props = __props;
|
|
@@ -16405,7 +16476,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
16405
16476
|
};
|
|
16406
16477
|
}
|
|
16407
16478
|
});
|
|
16408
|
-
var ElTooltipTrigger = /* @__PURE__ */ _export_sfc
|
|
16479
|
+
var ElTooltipTrigger = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__file", "trigger.vue"]]);
|
|
16409
16480
|
|
|
16410
16481
|
const teleportProps = buildProps({
|
|
16411
16482
|
to: {
|
|
@@ -16415,7 +16486,7 @@ const teleportProps = buildProps({
|
|
|
16415
16486
|
disabled: Boolean
|
|
16416
16487
|
});
|
|
16417
16488
|
|
|
16418
|
-
const _sfc_main$
|
|
16489
|
+
const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
16419
16490
|
__name: "teleport",
|
|
16420
16491
|
props: teleportProps,
|
|
16421
16492
|
setup(__props) {
|
|
@@ -16429,7 +16500,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
16429
16500
|
};
|
|
16430
16501
|
}
|
|
16431
16502
|
});
|
|
16432
|
-
var Teleport = /* @__PURE__ */ _export_sfc
|
|
16503
|
+
var Teleport = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__file", "teleport.vue"]]);
|
|
16433
16504
|
|
|
16434
16505
|
const ElTeleport = withInstall(Teleport);
|
|
16435
16506
|
|
|
@@ -16466,12 +16537,12 @@ const usePopperContainer = () => {
|
|
|
16466
16537
|
};
|
|
16467
16538
|
};
|
|
16468
16539
|
|
|
16469
|
-
const __default__$
|
|
16540
|
+
const __default__$k = defineComponent({
|
|
16470
16541
|
name: "ElTooltipContent",
|
|
16471
16542
|
inheritAttrs: false
|
|
16472
16543
|
});
|
|
16473
|
-
const _sfc_main$
|
|
16474
|
-
...__default__$
|
|
16544
|
+
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
16545
|
+
...__default__$k,
|
|
16475
16546
|
props: useTooltipContentProps,
|
|
16476
16547
|
setup(__props, { expose }) {
|
|
16477
16548
|
const props = __props;
|
|
@@ -16642,13 +16713,13 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
16642
16713
|
};
|
|
16643
16714
|
}
|
|
16644
16715
|
});
|
|
16645
|
-
var ElTooltipContent = /* @__PURE__ */ _export_sfc
|
|
16716
|
+
var ElTooltipContent = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__file", "content.vue"]]);
|
|
16646
16717
|
|
|
16647
|
-
const __default__$
|
|
16718
|
+
const __default__$j = defineComponent({
|
|
16648
16719
|
name: "ElTooltip"
|
|
16649
16720
|
});
|
|
16650
|
-
const _sfc_main$
|
|
16651
|
-
...__default__$
|
|
16721
|
+
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
16722
|
+
...__default__$j,
|
|
16652
16723
|
props: useTooltipProps,
|
|
16653
16724
|
emits: tooltipEmits,
|
|
16654
16725
|
setup(__props, { expose, emit }) {
|
|
@@ -16798,7 +16869,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
16798
16869
|
};
|
|
16799
16870
|
}
|
|
16800
16871
|
});
|
|
16801
|
-
var Tooltip$1 = /* @__PURE__ */ _export_sfc
|
|
16872
|
+
var Tooltip$1 = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__file", "tooltip.vue"]]);
|
|
16802
16873
|
|
|
16803
16874
|
const ElTooltip = withInstall(Tooltip$1);
|
|
16804
16875
|
|
|
@@ -17872,11 +17943,11 @@ function useButtonCustomStyle(props) {
|
|
|
17872
17943
|
});
|
|
17873
17944
|
}
|
|
17874
17945
|
|
|
17875
|
-
const __default__$
|
|
17946
|
+
const __default__$i = defineComponent({
|
|
17876
17947
|
name: "ElButton"
|
|
17877
17948
|
});
|
|
17878
|
-
const _sfc_main$
|
|
17879
|
-
...__default__$
|
|
17949
|
+
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
17950
|
+
...__default__$i,
|
|
17880
17951
|
props: buttonProps,
|
|
17881
17952
|
emits: buttonEmits,
|
|
17882
17953
|
setup(__props, { expose, emit }) {
|
|
@@ -17942,18 +18013,18 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
17942
18013
|
};
|
|
17943
18014
|
}
|
|
17944
18015
|
});
|
|
17945
|
-
var Button = /* @__PURE__ */ _export_sfc
|
|
18016
|
+
var Button = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__file", "button.vue"]]);
|
|
17946
18017
|
|
|
17947
18018
|
const buttonGroupProps = {
|
|
17948
18019
|
size: buttonProps.size,
|
|
17949
18020
|
type: buttonProps.type
|
|
17950
18021
|
};
|
|
17951
18022
|
|
|
17952
|
-
const __default__$
|
|
18023
|
+
const __default__$h = defineComponent({
|
|
17953
18024
|
name: "ElButtonGroup"
|
|
17954
18025
|
});
|
|
17955
|
-
const _sfc_main$
|
|
17956
|
-
...__default__$
|
|
18026
|
+
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
18027
|
+
...__default__$h,
|
|
17957
18028
|
props: buttonGroupProps,
|
|
17958
18029
|
setup(__props) {
|
|
17959
18030
|
const props = __props;
|
|
@@ -17971,7 +18042,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
17971
18042
|
};
|
|
17972
18043
|
}
|
|
17973
18044
|
});
|
|
17974
|
-
var ButtonGroup = /* @__PURE__ */ _export_sfc
|
|
18045
|
+
var ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__file", "button-group.vue"]]);
|
|
17975
18046
|
|
|
17976
18047
|
const ElButton = withInstall(Button, {
|
|
17977
18048
|
ButtonGroup
|
|
@@ -18008,11 +18079,11 @@ const tagEmits = {
|
|
|
18008
18079
|
click: (evt) => evt instanceof MouseEvent
|
|
18009
18080
|
};
|
|
18010
18081
|
|
|
18011
|
-
const __default__$
|
|
18082
|
+
const __default__$g = defineComponent({
|
|
18012
18083
|
name: "ElTag"
|
|
18013
18084
|
});
|
|
18014
|
-
const _sfc_main$
|
|
18015
|
-
...__default__$
|
|
18085
|
+
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
18086
|
+
...__default__$g,
|
|
18016
18087
|
props: tagProps,
|
|
18017
18088
|
emits: tagEmits,
|
|
18018
18089
|
setup(__props, { emit }) {
|
|
@@ -18099,7 +18170,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
18099
18170
|
};
|
|
18100
18171
|
}
|
|
18101
18172
|
});
|
|
18102
|
-
var Tag = /* @__PURE__ */ _export_sfc
|
|
18173
|
+
var Tag = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__file", "tag.vue"]]);
|
|
18103
18174
|
|
|
18104
18175
|
const ElTag = withInstall(Tag);
|
|
18105
18176
|
|
|
@@ -18208,22 +18279,22 @@ const vRepeatClick = {
|
|
|
18208
18279
|
}
|
|
18209
18280
|
};
|
|
18210
18281
|
|
|
18211
|
-
const _sfc_main$
|
|
18282
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
18212
18283
|
inheritAttrs: false
|
|
18213
18284
|
});
|
|
18214
|
-
function _sfc_render$
|
|
18285
|
+
function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18215
18286
|
return renderSlot(_ctx.$slots, "default");
|
|
18216
18287
|
}
|
|
18217
|
-
var Collection = /* @__PURE__ */ _export_sfc
|
|
18288
|
+
var Collection = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$8], ["__file", "collection.vue"]]);
|
|
18218
18289
|
|
|
18219
|
-
const _sfc_main$
|
|
18290
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
18220
18291
|
name: "ElCollectionItem",
|
|
18221
18292
|
inheritAttrs: false
|
|
18222
18293
|
});
|
|
18223
|
-
function _sfc_render$
|
|
18294
|
+
function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18224
18295
|
return renderSlot(_ctx.$slots, "default");
|
|
18225
18296
|
}
|
|
18226
|
-
var CollectionItem = /* @__PURE__ */ _export_sfc
|
|
18297
|
+
var CollectionItem = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$7], ["__file", "collection-item.vue"]]);
|
|
18227
18298
|
|
|
18228
18299
|
const COLLECTION_ITEM_SIGN = `data-el-collection-item`;
|
|
18229
18300
|
const createCollectionWithScope = (name) => {
|
|
@@ -18433,11 +18504,11 @@ const inputNumberEmits = {
|
|
|
18433
18504
|
[UPDATE_MODEL_EVENT]: (val) => isNumber(val) || isNil(val)
|
|
18434
18505
|
};
|
|
18435
18506
|
|
|
18436
|
-
const __default__$
|
|
18507
|
+
const __default__$f = defineComponent({
|
|
18437
18508
|
name: "ElInputNumber"
|
|
18438
18509
|
});
|
|
18439
|
-
const _sfc_main$
|
|
18440
|
-
...__default__$
|
|
18510
|
+
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
18511
|
+
...__default__$f,
|
|
18441
18512
|
props: inputNumberProps,
|
|
18442
18513
|
emits: inputNumberEmits,
|
|
18443
18514
|
setup(__props, { expose, emit }) {
|
|
@@ -18763,7 +18834,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
18763
18834
|
};
|
|
18764
18835
|
}
|
|
18765
18836
|
});
|
|
18766
|
-
var InputNumber = /* @__PURE__ */ _export_sfc
|
|
18837
|
+
var InputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__file", "input-number.vue"]]);
|
|
18767
18838
|
|
|
18768
18839
|
const ElInputNumber = withInstall(InputNumber);
|
|
18769
18840
|
|
|
@@ -18810,11 +18881,11 @@ const linkEmits = {
|
|
|
18810
18881
|
click: (evt) => evt instanceof MouseEvent
|
|
18811
18882
|
};
|
|
18812
18883
|
|
|
18813
|
-
const __default__$
|
|
18884
|
+
const __default__$e = defineComponent({
|
|
18814
18885
|
name: "ElLink"
|
|
18815
18886
|
});
|
|
18816
|
-
const _sfc_main$
|
|
18817
|
-
...__default__$
|
|
18887
|
+
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
18888
|
+
...__default__$e,
|
|
18818
18889
|
props: linkProps,
|
|
18819
18890
|
emits: linkEmits,
|
|
18820
18891
|
setup(__props, { emit }) {
|
|
@@ -18854,14 +18925,14 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
18854
18925
|
};
|
|
18855
18926
|
}
|
|
18856
18927
|
});
|
|
18857
|
-
var Link = /* @__PURE__ */ _export_sfc
|
|
18928
|
+
var Link = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__file", "link.vue"]]);
|
|
18858
18929
|
|
|
18859
18930
|
const ElLink = withInstall(Link);
|
|
18860
18931
|
|
|
18861
18932
|
const selectGroupKey = Symbol("ElSelectGroup");
|
|
18862
18933
|
const selectKey = Symbol("ElSelect");
|
|
18863
18934
|
|
|
18864
|
-
function useOption(props, states) {
|
|
18935
|
+
function useOption$1(props, states) {
|
|
18865
18936
|
const select = inject(selectKey);
|
|
18866
18937
|
const selectGroup = inject(selectGroupKey, { disabled: false });
|
|
18867
18938
|
const itemSelected = computed(() => {
|
|
@@ -18936,7 +19007,7 @@ function useOption(props, states) {
|
|
|
18936
19007
|
};
|
|
18937
19008
|
}
|
|
18938
19009
|
|
|
18939
|
-
const _sfc_main$
|
|
19010
|
+
const _sfc_main$l = defineComponent({
|
|
18940
19011
|
name: "ElOption",
|
|
18941
19012
|
componentName: "ElOption",
|
|
18942
19013
|
props: {
|
|
@@ -18970,7 +19041,7 @@ const _sfc_main$h = defineComponent({
|
|
|
18970
19041
|
select,
|
|
18971
19042
|
hoverItem,
|
|
18972
19043
|
updateOption
|
|
18973
|
-
} = useOption(props, states);
|
|
19044
|
+
} = useOption$1(props, states);
|
|
18974
19045
|
const { visible, hover } = toRefs(states);
|
|
18975
19046
|
const vm = getCurrentInstance().proxy;
|
|
18976
19047
|
select.onOptionCreate(vm);
|
|
@@ -19009,7 +19080,7 @@ const _sfc_main$h = defineComponent({
|
|
|
19009
19080
|
};
|
|
19010
19081
|
}
|
|
19011
19082
|
});
|
|
19012
|
-
function _sfc_render$
|
|
19083
|
+
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
19013
19084
|
return withDirectives((openBlock(), createElementBlock("li", {
|
|
19014
19085
|
id: _ctx.id,
|
|
19015
19086
|
class: normalizeClass(_ctx.containerKls),
|
|
@@ -19026,9 +19097,9 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
19026
19097
|
[vShow, _ctx.visible]
|
|
19027
19098
|
]);
|
|
19028
19099
|
}
|
|
19029
|
-
var Option = /* @__PURE__ */ _export_sfc
|
|
19100
|
+
var Option = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$6], ["__file", "option.vue"]]);
|
|
19030
19101
|
|
|
19031
|
-
const _sfc_main$
|
|
19102
|
+
const _sfc_main$k = defineComponent({
|
|
19032
19103
|
name: "ElSelectDropdown",
|
|
19033
19104
|
componentName: "ElSelectDropdown",
|
|
19034
19105
|
setup() {
|
|
@@ -19055,7 +19126,7 @@ const _sfc_main$g = defineComponent({
|
|
|
19055
19126
|
};
|
|
19056
19127
|
}
|
|
19057
19128
|
});
|
|
19058
|
-
function _sfc_render$
|
|
19129
|
+
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
19059
19130
|
return openBlock(), createElementBlock("div", {
|
|
19060
19131
|
class: normalizeClass([_ctx.ns.b("dropdown"), _ctx.ns.is("multiple", _ctx.isMultiple), _ctx.popperClass]),
|
|
19061
19132
|
style: normalizeStyle({ [_ctx.isFitInputWidth ? "width" : "minWidth"]: _ctx.minWidth })
|
|
@@ -19075,9 +19146,9 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
19075
19146
|
], 2)) : createCommentVNode("v-if", true)
|
|
19076
19147
|
], 6);
|
|
19077
19148
|
}
|
|
19078
|
-
var ElSelectMenu = /* @__PURE__ */ _export_sfc
|
|
19149
|
+
var ElSelectMenu$1 = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$5], ["__file", "select-dropdown.vue"]]);
|
|
19079
19150
|
|
|
19080
|
-
const useSelect = (props, emit) => {
|
|
19151
|
+
const useSelect$1 = (props, emit) => {
|
|
19081
19152
|
const { t } = useLocale();
|
|
19082
19153
|
const contentId = useId();
|
|
19083
19154
|
const nsSelect = useNamespace("select");
|
|
@@ -19234,7 +19305,7 @@ const useSelect = (props, emit) => {
|
|
|
19234
19305
|
}
|
|
19235
19306
|
}
|
|
19236
19307
|
setSelected();
|
|
19237
|
-
if (!isEqual(val, oldVal) && props.validateEvent) {
|
|
19308
|
+
if (!isEqual$1(val, oldVal) && props.validateEvent) {
|
|
19238
19309
|
formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
|
|
19239
19310
|
}
|
|
19240
19311
|
}, {
|
|
@@ -19378,7 +19449,7 @@ const useSelect = (props, emit) => {
|
|
|
19378
19449
|
onInputChange();
|
|
19379
19450
|
}, debounce$1.value);
|
|
19380
19451
|
const emitChange = (val) => {
|
|
19381
|
-
if (!isEqual(props.modelValue, val)) {
|
|
19452
|
+
if (!isEqual$1(props.modelValue, val)) {
|
|
19382
19453
|
emit(CHANGE_EVENT, val);
|
|
19383
19454
|
}
|
|
19384
19455
|
};
|
|
@@ -19467,7 +19538,7 @@ const useSelect = (props, emit) => {
|
|
|
19467
19538
|
if (!isObject$1(option.value))
|
|
19468
19539
|
return arr.indexOf(option.value);
|
|
19469
19540
|
return arr.findIndex((item) => {
|
|
19470
|
-
return isEqual(get(item, props.valueKey), getValueKey(option));
|
|
19541
|
+
return isEqual$1(get(item, props.valueKey), getValueKey(option));
|
|
19471
19542
|
});
|
|
19472
19543
|
};
|
|
19473
19544
|
const scrollToOption = (option) => {
|
|
@@ -19723,7 +19794,7 @@ var ElOptions = defineComponent({
|
|
|
19723
19794
|
if (children.length) {
|
|
19724
19795
|
filterOptions((_b = children[0]) == null ? void 0 : _b.children);
|
|
19725
19796
|
}
|
|
19726
|
-
if (!isEqual(valueList, cachedValueList)) {
|
|
19797
|
+
if (!isEqual$1(valueList, cachedValueList)) {
|
|
19727
19798
|
cachedValueList = valueList;
|
|
19728
19799
|
if (select) {
|
|
19729
19800
|
select.states.optionValues = valueList;
|
|
@@ -19734,7 +19805,7 @@ var ElOptions = defineComponent({
|
|
|
19734
19805
|
}
|
|
19735
19806
|
});
|
|
19736
19807
|
|
|
19737
|
-
const SelectProps = buildProps({
|
|
19808
|
+
const SelectProps$1 = buildProps({
|
|
19738
19809
|
name: String,
|
|
19739
19810
|
id: String,
|
|
19740
19811
|
modelValue: {
|
|
@@ -19841,11 +19912,11 @@ const SelectProps = buildProps({
|
|
|
19841
19912
|
});
|
|
19842
19913
|
|
|
19843
19914
|
const COMPONENT_NAME = "ElSelect";
|
|
19844
|
-
const _sfc_main$
|
|
19915
|
+
const _sfc_main$j = defineComponent({
|
|
19845
19916
|
name: COMPONENT_NAME,
|
|
19846
19917
|
componentName: COMPONENT_NAME,
|
|
19847
19918
|
components: {
|
|
19848
|
-
ElSelectMenu,
|
|
19919
|
+
ElSelectMenu: ElSelectMenu$1,
|
|
19849
19920
|
ElOption: Option,
|
|
19850
19921
|
ElOptions,
|
|
19851
19922
|
ElTag,
|
|
@@ -19854,7 +19925,7 @@ const _sfc_main$f = defineComponent({
|
|
|
19854
19925
|
ElIcon
|
|
19855
19926
|
},
|
|
19856
19927
|
directives: { ClickOutside },
|
|
19857
|
-
props: SelectProps,
|
|
19928
|
+
props: SelectProps$1,
|
|
19858
19929
|
emits: [
|
|
19859
19930
|
UPDATE_MODEL_EVENT,
|
|
19860
19931
|
CHANGE_EVENT,
|
|
@@ -19877,7 +19948,7 @@ const _sfc_main$f = defineComponent({
|
|
|
19877
19948
|
...toRefs(props),
|
|
19878
19949
|
modelValue
|
|
19879
19950
|
});
|
|
19880
|
-
const API = useSelect(_props, emit);
|
|
19951
|
+
const API = useSelect$1(_props, emit);
|
|
19881
19952
|
const { calculatorRef, inputStyle } = useCalcInputWidth();
|
|
19882
19953
|
provide(selectKey, reactive({
|
|
19883
19954
|
props: _props,
|
|
@@ -19904,7 +19975,7 @@ const _sfc_main$f = defineComponent({
|
|
|
19904
19975
|
};
|
|
19905
19976
|
}
|
|
19906
19977
|
});
|
|
19907
|
-
function _sfc_render$
|
|
19978
|
+
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
19908
19979
|
const _component_el_tag = resolveComponent("el-tag");
|
|
19909
19980
|
const _component_el_tooltip = resolveComponent("el-tooltip");
|
|
19910
19981
|
const _component_el_icon = resolveComponent("el-icon");
|
|
@@ -20251,9 +20322,9 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
20251
20322
|
[_directive_click_outside, _ctx.handleClickOutside, _ctx.popperRef]
|
|
20252
20323
|
]);
|
|
20253
20324
|
}
|
|
20254
|
-
var Select = /* @__PURE__ */ _export_sfc
|
|
20325
|
+
var Select$1 = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$4], ["__file", "select.vue"]]);
|
|
20255
20326
|
|
|
20256
|
-
const _sfc_main$
|
|
20327
|
+
const _sfc_main$i = defineComponent({
|
|
20257
20328
|
name: "ElOptionGroup",
|
|
20258
20329
|
componentName: "ElOptionGroup",
|
|
20259
20330
|
props: {
|
|
@@ -20306,7 +20377,7 @@ const _sfc_main$e = defineComponent({
|
|
|
20306
20377
|
};
|
|
20307
20378
|
}
|
|
20308
20379
|
});
|
|
20309
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
20380
|
+
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
20310
20381
|
return withDirectives((openBlock(), createElementBlock("ul", {
|
|
20311
20382
|
ref: "groupRef",
|
|
20312
20383
|
class: normalizeClass(_ctx.ns.be("group", "wrap"))
|
|
@@ -20325,9 +20396,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
20325
20396
|
[vShow, _ctx.visible]
|
|
20326
20397
|
]);
|
|
20327
20398
|
}
|
|
20328
|
-
var OptionGroup = /* @__PURE__ */ _export_sfc
|
|
20399
|
+
var OptionGroup = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$3], ["__file", "option-group.vue"]]);
|
|
20329
20400
|
|
|
20330
|
-
const ElSelect = withInstall(Select, {
|
|
20401
|
+
const ElSelect = withInstall(Select$1, {
|
|
20331
20402
|
Option,
|
|
20332
20403
|
OptionGroup
|
|
20333
20404
|
});
|
|
@@ -20396,11 +20467,11 @@ const popoverEmits = {
|
|
|
20396
20467
|
};
|
|
20397
20468
|
|
|
20398
20469
|
const updateEventKeyRaw = `onUpdate:visible`;
|
|
20399
|
-
const __default__$
|
|
20470
|
+
const __default__$d = defineComponent({
|
|
20400
20471
|
name: "ElPopover"
|
|
20401
20472
|
});
|
|
20402
|
-
const _sfc_main$
|
|
20403
|
-
...__default__$
|
|
20473
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
20474
|
+
...__default__$d,
|
|
20404
20475
|
props: popoverProps,
|
|
20405
20476
|
emits: popoverEmits,
|
|
20406
20477
|
setup(__props, { expose, emit }) {
|
|
@@ -20499,7 +20570,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
20499
20570
|
};
|
|
20500
20571
|
}
|
|
20501
20572
|
});
|
|
20502
|
-
var Popover = /* @__PURE__ */ _export_sfc
|
|
20573
|
+
var Popover = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__file", "popover.vue"]]);
|
|
20503
20574
|
|
|
20504
20575
|
const attachEvents = (el, binding) => {
|
|
20505
20576
|
const popperComponent = binding.arg || binding.value;
|
|
@@ -20523,97 +20594,2750 @@ const ElPopover = withInstall(Popover, {
|
|
|
20523
20594
|
directive: ElPopoverDirective
|
|
20524
20595
|
});
|
|
20525
20596
|
|
|
20526
|
-
|
|
20527
|
-
const target = sfc.__vccOpts || sfc;
|
|
20528
|
-
for (const [key, val] of props) {
|
|
20529
|
-
target[key] = val;
|
|
20530
|
-
}
|
|
20531
|
-
return target;
|
|
20532
|
-
};
|
|
20533
|
-
|
|
20534
|
-
const _hoisted_1$a = ["onClick"];
|
|
20535
|
-
const _hoisted_2$9 = { class: "hzzt-dropdown-name" };
|
|
20536
|
-
const _hoisted_3$7 = /* @__PURE__ */ createElementVNode("span", { class: "caret" }, null, -1);
|
|
20537
|
-
const _hoisted_4$5 = { class: "hzzt-dropdown-menu" };
|
|
20538
|
-
const _hoisted_5$3 = ["onClick"];
|
|
20539
|
-
const _hoisted_6$3 = { class: "submenu" };
|
|
20540
|
-
const _hoisted_7$3 = ["onClick"];
|
|
20541
|
-
const __default__$b = defineComponent({
|
|
20542
|
-
name: "HzztDropDown"
|
|
20543
|
-
});
|
|
20544
|
-
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
20545
|
-
...__default__$b,
|
|
20597
|
+
const _sfc_main$g = defineComponent({
|
|
20546
20598
|
props: {
|
|
20547
|
-
|
|
20548
|
-
type: Array,
|
|
20549
|
-
default: () => []
|
|
20550
|
-
},
|
|
20551
|
-
label: String,
|
|
20552
|
-
value: String,
|
|
20553
|
-
defaultValue: {
|
|
20554
|
-
type: Array,
|
|
20555
|
-
default: () => []
|
|
20556
|
-
},
|
|
20557
|
-
position: {
|
|
20558
|
-
type: String,
|
|
20559
|
-
default: "right"
|
|
20560
|
-
},
|
|
20561
|
-
props: {
|
|
20599
|
+
item: {
|
|
20562
20600
|
type: Object,
|
|
20563
|
-
|
|
20564
|
-
children: "children",
|
|
20565
|
-
label: "label",
|
|
20566
|
-
value: "value"
|
|
20567
|
-
})
|
|
20601
|
+
required: true
|
|
20568
20602
|
},
|
|
20569
|
-
|
|
20570
|
-
type:
|
|
20571
|
-
|
|
20572
|
-
|
|
20603
|
+
style: {
|
|
20604
|
+
type: Object
|
|
20605
|
+
},
|
|
20606
|
+
height: Number
|
|
20573
20607
|
},
|
|
20574
|
-
|
|
20575
|
-
|
|
20576
|
-
|
|
20577
|
-
|
|
20578
|
-
|
|
20579
|
-
|
|
20580
|
-
|
|
20581
|
-
|
|
20582
|
-
|
|
20583
|
-
|
|
20584
|
-
|
|
20585
|
-
|
|
20586
|
-
|
|
20608
|
+
setup() {
|
|
20609
|
+
const ns = useNamespace("select");
|
|
20610
|
+
return {
|
|
20611
|
+
ns
|
|
20612
|
+
};
|
|
20613
|
+
}
|
|
20614
|
+
});
|
|
20615
|
+
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
20616
|
+
return openBlock(), createElementBlock("div", {
|
|
20617
|
+
class: normalizeClass(_ctx.ns.be("group", "title")),
|
|
20618
|
+
style: normalizeStyle({ ..._ctx.style, lineHeight: `${_ctx.height}px` })
|
|
20619
|
+
}, toDisplayString(_ctx.item.label), 7);
|
|
20620
|
+
}
|
|
20621
|
+
var GroupItem = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$2], ["__file", "group-item.vue"]]);
|
|
20622
|
+
|
|
20623
|
+
function useOption(props, { emit }) {
|
|
20624
|
+
return {
|
|
20625
|
+
hoverItem: () => {
|
|
20626
|
+
if (!props.disabled) {
|
|
20627
|
+
emit("hover", props.index);
|
|
20587
20628
|
}
|
|
20588
|
-
|
|
20589
|
-
|
|
20629
|
+
},
|
|
20630
|
+
selectOptionClick: () => {
|
|
20631
|
+
if (!props.disabled) {
|
|
20632
|
+
emit("select", props.item, props.index);
|
|
20590
20633
|
}
|
|
20591
20634
|
}
|
|
20592
|
-
|
|
20593
|
-
|
|
20594
|
-
|
|
20595
|
-
|
|
20596
|
-
|
|
20597
|
-
|
|
20598
|
-
|
|
20599
|
-
|
|
20600
|
-
|
|
20601
|
-
|
|
20602
|
-
|
|
20603
|
-
|
|
20604
|
-
|
|
20605
|
-
|
|
20606
|
-
|
|
20607
|
-
|
|
20608
|
-
|
|
20609
|
-
|
|
20610
|
-
|
|
20611
|
-
|
|
20612
|
-
|
|
20613
|
-
|
|
20614
|
-
|
|
20615
|
-
|
|
20616
|
-
|
|
20635
|
+
};
|
|
20636
|
+
}
|
|
20637
|
+
|
|
20638
|
+
const defaultProps = {
|
|
20639
|
+
label: "label",
|
|
20640
|
+
value: "value",
|
|
20641
|
+
disabled: "disabled",
|
|
20642
|
+
options: "options"
|
|
20643
|
+
};
|
|
20644
|
+
function useProps(props) {
|
|
20645
|
+
const aliasProps = computed(() => ({ ...defaultProps, ...props.props }));
|
|
20646
|
+
const getLabel = (option) => get(option, aliasProps.value.label);
|
|
20647
|
+
const getValue = (option) => get(option, aliasProps.value.value);
|
|
20648
|
+
const getDisabled = (option) => get(option, aliasProps.value.disabled);
|
|
20649
|
+
const getOptions = (option) => get(option, aliasProps.value.options);
|
|
20650
|
+
return {
|
|
20651
|
+
aliasProps,
|
|
20652
|
+
getLabel,
|
|
20653
|
+
getValue,
|
|
20654
|
+
getDisabled,
|
|
20655
|
+
getOptions
|
|
20656
|
+
};
|
|
20657
|
+
}
|
|
20658
|
+
|
|
20659
|
+
const SelectProps = buildProps({
|
|
20660
|
+
allowCreate: Boolean,
|
|
20661
|
+
autocomplete: {
|
|
20662
|
+
type: definePropType(String),
|
|
20663
|
+
default: "none"
|
|
20664
|
+
},
|
|
20665
|
+
automaticDropdown: Boolean,
|
|
20666
|
+
clearable: Boolean,
|
|
20667
|
+
clearIcon: {
|
|
20668
|
+
type: iconPropType,
|
|
20669
|
+
default: circle_close_default
|
|
20670
|
+
},
|
|
20671
|
+
effect: {
|
|
20672
|
+
type: definePropType(String),
|
|
20673
|
+
default: "light"
|
|
20674
|
+
},
|
|
20675
|
+
collapseTags: Boolean,
|
|
20676
|
+
collapseTagsTooltip: Boolean,
|
|
20677
|
+
maxCollapseTags: {
|
|
20678
|
+
type: Number,
|
|
20679
|
+
default: 1
|
|
20680
|
+
},
|
|
20681
|
+
defaultFirstOption: Boolean,
|
|
20682
|
+
disabled: Boolean,
|
|
20683
|
+
estimatedOptionHeight: {
|
|
20684
|
+
type: Number,
|
|
20685
|
+
default: void 0
|
|
20686
|
+
},
|
|
20687
|
+
filterable: Boolean,
|
|
20688
|
+
filterMethod: Function,
|
|
20689
|
+
height: {
|
|
20690
|
+
type: Number,
|
|
20691
|
+
default: 274
|
|
20692
|
+
},
|
|
20693
|
+
itemHeight: {
|
|
20694
|
+
type: Number,
|
|
20695
|
+
default: 34
|
|
20696
|
+
},
|
|
20697
|
+
id: String,
|
|
20698
|
+
loading: Boolean,
|
|
20699
|
+
loadingText: String,
|
|
20700
|
+
modelValue: {
|
|
20701
|
+
type: definePropType([Array, String, Number, Boolean, Object])
|
|
20702
|
+
},
|
|
20703
|
+
multiple: Boolean,
|
|
20704
|
+
multipleLimit: {
|
|
20705
|
+
type: Number,
|
|
20706
|
+
default: 0
|
|
20707
|
+
},
|
|
20708
|
+
name: String,
|
|
20709
|
+
noDataText: String,
|
|
20710
|
+
noMatchText: String,
|
|
20711
|
+
remoteMethod: Function,
|
|
20712
|
+
reserveKeyword: {
|
|
20713
|
+
type: Boolean,
|
|
20714
|
+
default: true
|
|
20715
|
+
},
|
|
20716
|
+
options: {
|
|
20717
|
+
type: definePropType(Array),
|
|
20718
|
+
required: true
|
|
20719
|
+
},
|
|
20720
|
+
placeholder: {
|
|
20721
|
+
type: String
|
|
20722
|
+
},
|
|
20723
|
+
teleported: useTooltipContentProps.teleported,
|
|
20724
|
+
persistent: {
|
|
20725
|
+
type: Boolean,
|
|
20726
|
+
default: true
|
|
20727
|
+
},
|
|
20728
|
+
popperClass: {
|
|
20729
|
+
type: String,
|
|
20730
|
+
default: ""
|
|
20731
|
+
},
|
|
20732
|
+
popperOptions: {
|
|
20733
|
+
type: definePropType(Object),
|
|
20734
|
+
default: () => ({})
|
|
20735
|
+
},
|
|
20736
|
+
remote: Boolean,
|
|
20737
|
+
size: useSizeProp,
|
|
20738
|
+
props: {
|
|
20739
|
+
type: definePropType(Object),
|
|
20740
|
+
default: () => defaultProps
|
|
20741
|
+
},
|
|
20742
|
+
valueKey: {
|
|
20743
|
+
type: String,
|
|
20744
|
+
default: "value"
|
|
20745
|
+
},
|
|
20746
|
+
scrollbarAlwaysOn: Boolean,
|
|
20747
|
+
validateEvent: {
|
|
20748
|
+
type: Boolean,
|
|
20749
|
+
default: true
|
|
20750
|
+
},
|
|
20751
|
+
offset: {
|
|
20752
|
+
type: Number,
|
|
20753
|
+
default: 12
|
|
20754
|
+
},
|
|
20755
|
+
showArrow: {
|
|
20756
|
+
type: Boolean,
|
|
20757
|
+
default: true
|
|
20758
|
+
},
|
|
20759
|
+
placement: {
|
|
20760
|
+
type: definePropType(String),
|
|
20761
|
+
values: Ee,
|
|
20762
|
+
default: "bottom-start"
|
|
20763
|
+
},
|
|
20764
|
+
fallbackPlacements: {
|
|
20765
|
+
type: definePropType(Array),
|
|
20766
|
+
default: ["bottom-start", "top-start", "right", "left"]
|
|
20767
|
+
},
|
|
20768
|
+
tagType: { ...tagProps.type, default: "info" },
|
|
20769
|
+
tagEffect: { ...tagProps.effect, default: "light" },
|
|
20770
|
+
tabindex: {
|
|
20771
|
+
type: [String, Number],
|
|
20772
|
+
default: 0
|
|
20773
|
+
},
|
|
20774
|
+
appendTo: String,
|
|
20775
|
+
fitInputWidth: {
|
|
20776
|
+
type: [Boolean, Number],
|
|
20777
|
+
default: true,
|
|
20778
|
+
validator(val) {
|
|
20779
|
+
return isBoolean(val) || isNumber(val);
|
|
20780
|
+
}
|
|
20781
|
+
},
|
|
20782
|
+
...useEmptyValuesProps,
|
|
20783
|
+
...useAriaProps(["ariaLabel"])
|
|
20784
|
+
});
|
|
20785
|
+
const OptionProps = buildProps({
|
|
20786
|
+
data: Array,
|
|
20787
|
+
disabled: Boolean,
|
|
20788
|
+
hovering: Boolean,
|
|
20789
|
+
item: {
|
|
20790
|
+
type: definePropType(Object),
|
|
20791
|
+
required: true
|
|
20792
|
+
},
|
|
20793
|
+
index: Number,
|
|
20794
|
+
style: Object,
|
|
20795
|
+
selected: Boolean,
|
|
20796
|
+
created: Boolean
|
|
20797
|
+
});
|
|
20798
|
+
const selectEmits = {
|
|
20799
|
+
[UPDATE_MODEL_EVENT]: (val) => true,
|
|
20800
|
+
[CHANGE_EVENT]: (val) => true,
|
|
20801
|
+
"remove-tag": (val) => true,
|
|
20802
|
+
"visible-change": (visible) => true,
|
|
20803
|
+
focus: (evt) => evt instanceof FocusEvent,
|
|
20804
|
+
blur: (evt) => evt instanceof FocusEvent,
|
|
20805
|
+
clear: () => true
|
|
20806
|
+
};
|
|
20807
|
+
const optionEmits = {
|
|
20808
|
+
hover: (index) => isNumber(index),
|
|
20809
|
+
select: (val, index) => true
|
|
20810
|
+
};
|
|
20811
|
+
|
|
20812
|
+
const selectV2InjectionKey = Symbol("ElSelectV2Injection");
|
|
20813
|
+
|
|
20814
|
+
const _sfc_main$f = defineComponent({
|
|
20815
|
+
props: OptionProps,
|
|
20816
|
+
emits: optionEmits,
|
|
20817
|
+
setup(props, { emit }) {
|
|
20818
|
+
const select = inject(selectV2InjectionKey);
|
|
20819
|
+
const ns = useNamespace("select");
|
|
20820
|
+
const { hoverItem, selectOptionClick } = useOption(props, { emit });
|
|
20821
|
+
const { getLabel } = useProps(select.props);
|
|
20822
|
+
return {
|
|
20823
|
+
ns,
|
|
20824
|
+
hoverItem,
|
|
20825
|
+
selectOptionClick,
|
|
20826
|
+
getLabel
|
|
20827
|
+
};
|
|
20828
|
+
}
|
|
20829
|
+
});
|
|
20830
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
20831
|
+
return openBlock(), createElementBlock("li", {
|
|
20832
|
+
"aria-selected": _ctx.selected,
|
|
20833
|
+
style: normalizeStyle(_ctx.style),
|
|
20834
|
+
class: normalizeClass([
|
|
20835
|
+
_ctx.ns.be("dropdown", "item"),
|
|
20836
|
+
_ctx.ns.is("selected", _ctx.selected),
|
|
20837
|
+
_ctx.ns.is("disabled", _ctx.disabled),
|
|
20838
|
+
_ctx.ns.is("created", _ctx.created),
|
|
20839
|
+
_ctx.ns.is("hovering", _ctx.hovering)
|
|
20840
|
+
]),
|
|
20841
|
+
onMousemove: _ctx.hoverItem,
|
|
20842
|
+
onClick: withModifiers(_ctx.selectOptionClick, ["stop"])
|
|
20843
|
+
}, [
|
|
20844
|
+
renderSlot(_ctx.$slots, "default", {
|
|
20845
|
+
item: _ctx.item,
|
|
20846
|
+
index: _ctx.index,
|
|
20847
|
+
disabled: _ctx.disabled
|
|
20848
|
+
}, () => [
|
|
20849
|
+
createElementVNode("span", null, toDisplayString(_ctx.getLabel(_ctx.item)), 1)
|
|
20850
|
+
])
|
|
20851
|
+
], 46, ["aria-selected", "onMousemove", "onClick"]);
|
|
20852
|
+
}
|
|
20853
|
+
var OptionItem = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$1], ["__file", "option-item.vue"]]);
|
|
20854
|
+
|
|
20855
|
+
var safeIsNaN = Number.isNaN || function ponyfill(value) {
|
|
20856
|
+
return typeof value === "number" && value !== value;
|
|
20857
|
+
};
|
|
20858
|
+
function isEqual(first, second) {
|
|
20859
|
+
if (first === second) {
|
|
20860
|
+
return true;
|
|
20861
|
+
}
|
|
20862
|
+
if (safeIsNaN(first) && safeIsNaN(second)) {
|
|
20863
|
+
return true;
|
|
20864
|
+
}
|
|
20865
|
+
return false;
|
|
20866
|
+
}
|
|
20867
|
+
function areInputsEqual(newInputs, lastInputs) {
|
|
20868
|
+
if (newInputs.length !== lastInputs.length) {
|
|
20869
|
+
return false;
|
|
20870
|
+
}
|
|
20871
|
+
for (var i = 0; i < newInputs.length; i++) {
|
|
20872
|
+
if (!isEqual(newInputs[i], lastInputs[i])) {
|
|
20873
|
+
return false;
|
|
20874
|
+
}
|
|
20875
|
+
}
|
|
20876
|
+
return true;
|
|
20877
|
+
}
|
|
20878
|
+
function memoizeOne(resultFn, isEqual2) {
|
|
20879
|
+
if (isEqual2 === void 0) {
|
|
20880
|
+
isEqual2 = areInputsEqual;
|
|
20881
|
+
}
|
|
20882
|
+
var cache = null;
|
|
20883
|
+
function memoized() {
|
|
20884
|
+
var newArgs = [];
|
|
20885
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
20886
|
+
newArgs[_i] = arguments[_i];
|
|
20887
|
+
}
|
|
20888
|
+
if (cache && cache.lastThis === this && isEqual2(newArgs, cache.lastArgs)) {
|
|
20889
|
+
return cache.lastResult;
|
|
20890
|
+
}
|
|
20891
|
+
var lastResult = resultFn.apply(this, newArgs);
|
|
20892
|
+
cache = {
|
|
20893
|
+
lastResult,
|
|
20894
|
+
lastArgs: newArgs,
|
|
20895
|
+
lastThis: this
|
|
20896
|
+
};
|
|
20897
|
+
return lastResult;
|
|
20898
|
+
}
|
|
20899
|
+
memoized.clear = function clear() {
|
|
20900
|
+
cache = null;
|
|
20901
|
+
};
|
|
20902
|
+
return memoized;
|
|
20903
|
+
}
|
|
20904
|
+
|
|
20905
|
+
const useCache = () => {
|
|
20906
|
+
const vm = getCurrentInstance();
|
|
20907
|
+
const props = vm.proxy.$props;
|
|
20908
|
+
return computed(() => {
|
|
20909
|
+
const _getItemStyleCache = (_, __, ___) => ({});
|
|
20910
|
+
return props.perfMode ? memoize(_getItemStyleCache) : memoizeOne(_getItemStyleCache);
|
|
20911
|
+
});
|
|
20912
|
+
};
|
|
20913
|
+
|
|
20914
|
+
const DEFAULT_DYNAMIC_LIST_ITEM_SIZE = 50;
|
|
20915
|
+
const ITEM_RENDER_EVT = "itemRendered";
|
|
20916
|
+
const SCROLL_EVT = "scroll";
|
|
20917
|
+
const FORWARD = "forward";
|
|
20918
|
+
const BACKWARD = "backward";
|
|
20919
|
+
const AUTO_ALIGNMENT = "auto";
|
|
20920
|
+
const SMART_ALIGNMENT = "smart";
|
|
20921
|
+
const START_ALIGNMENT = "start";
|
|
20922
|
+
const CENTERED_ALIGNMENT = "center";
|
|
20923
|
+
const END_ALIGNMENT = "end";
|
|
20924
|
+
const HORIZONTAL = "horizontal";
|
|
20925
|
+
const VERTICAL = "vertical";
|
|
20926
|
+
const LTR = "ltr";
|
|
20927
|
+
const RTL = "rtl";
|
|
20928
|
+
const RTL_OFFSET_NAG = "negative";
|
|
20929
|
+
const RTL_OFFSET_POS_ASC = "positive-ascending";
|
|
20930
|
+
const RTL_OFFSET_POS_DESC = "positive-descending";
|
|
20931
|
+
const ScrollbarDirKey = {
|
|
20932
|
+
[HORIZONTAL]: "left",
|
|
20933
|
+
[VERTICAL]: "top"
|
|
20934
|
+
};
|
|
20935
|
+
const SCROLLBAR_MIN_SIZE = 20;
|
|
20936
|
+
|
|
20937
|
+
const LayoutKeys = {
|
|
20938
|
+
[HORIZONTAL]: "deltaX",
|
|
20939
|
+
[VERTICAL]: "deltaY"
|
|
20940
|
+
};
|
|
20941
|
+
const useWheel = ({ atEndEdge, atStartEdge, layout }, onWheelDelta) => {
|
|
20942
|
+
let frameHandle;
|
|
20943
|
+
let offset = 0;
|
|
20944
|
+
const hasReachedEdge = (offset2) => {
|
|
20945
|
+
const edgeReached = offset2 < 0 && atStartEdge.value || offset2 > 0 && atEndEdge.value;
|
|
20946
|
+
return edgeReached;
|
|
20947
|
+
};
|
|
20948
|
+
const onWheel = (e) => {
|
|
20949
|
+
cAF(frameHandle);
|
|
20950
|
+
const newOffset = e[LayoutKeys[layout.value]];
|
|
20951
|
+
if (hasReachedEdge(offset) && hasReachedEdge(offset + newOffset))
|
|
20952
|
+
return;
|
|
20953
|
+
offset += newOffset;
|
|
20954
|
+
if (!isFirefox()) {
|
|
20955
|
+
e.preventDefault();
|
|
20956
|
+
}
|
|
20957
|
+
frameHandle = rAF(() => {
|
|
20958
|
+
onWheelDelta(offset);
|
|
20959
|
+
offset = 0;
|
|
20960
|
+
});
|
|
20961
|
+
};
|
|
20962
|
+
return {
|
|
20963
|
+
hasReachedEdge,
|
|
20964
|
+
onWheel
|
|
20965
|
+
};
|
|
20966
|
+
};
|
|
20967
|
+
|
|
20968
|
+
const itemSize = buildProp({
|
|
20969
|
+
type: definePropType([Number, Function]),
|
|
20970
|
+
required: true
|
|
20971
|
+
});
|
|
20972
|
+
const estimatedItemSize = buildProp({
|
|
20973
|
+
type: Number
|
|
20974
|
+
});
|
|
20975
|
+
const cache = buildProp({
|
|
20976
|
+
type: Number,
|
|
20977
|
+
default: 2
|
|
20978
|
+
});
|
|
20979
|
+
const direction = buildProp({
|
|
20980
|
+
type: String,
|
|
20981
|
+
values: ["ltr", "rtl"],
|
|
20982
|
+
default: "ltr"
|
|
20983
|
+
});
|
|
20984
|
+
const initScrollOffset = buildProp({
|
|
20985
|
+
type: Number,
|
|
20986
|
+
default: 0
|
|
20987
|
+
});
|
|
20988
|
+
const total = buildProp({
|
|
20989
|
+
type: Number,
|
|
20990
|
+
required: true
|
|
20991
|
+
});
|
|
20992
|
+
const layout = buildProp({
|
|
20993
|
+
type: String,
|
|
20994
|
+
values: ["horizontal", "vertical"],
|
|
20995
|
+
default: VERTICAL
|
|
20996
|
+
});
|
|
20997
|
+
const virtualizedProps = buildProps({
|
|
20998
|
+
className: {
|
|
20999
|
+
type: String,
|
|
21000
|
+
default: ""
|
|
21001
|
+
},
|
|
21002
|
+
containerElement: {
|
|
21003
|
+
type: definePropType([String, Object]),
|
|
21004
|
+
default: "div"
|
|
21005
|
+
},
|
|
21006
|
+
data: {
|
|
21007
|
+
type: definePropType(Array),
|
|
21008
|
+
default: () => mutable([])
|
|
21009
|
+
},
|
|
21010
|
+
direction,
|
|
21011
|
+
height: {
|
|
21012
|
+
type: [String, Number],
|
|
21013
|
+
required: true
|
|
21014
|
+
},
|
|
21015
|
+
innerElement: {
|
|
21016
|
+
type: [String, Object],
|
|
21017
|
+
default: "div"
|
|
21018
|
+
},
|
|
21019
|
+
style: {
|
|
21020
|
+
type: definePropType([Object, String, Array])
|
|
21021
|
+
},
|
|
21022
|
+
useIsScrolling: {
|
|
21023
|
+
type: Boolean,
|
|
21024
|
+
default: false
|
|
21025
|
+
},
|
|
21026
|
+
width: {
|
|
21027
|
+
type: [Number, String],
|
|
21028
|
+
required: false
|
|
21029
|
+
},
|
|
21030
|
+
perfMode: {
|
|
21031
|
+
type: Boolean,
|
|
21032
|
+
default: true
|
|
21033
|
+
},
|
|
21034
|
+
scrollbarAlwaysOn: {
|
|
21035
|
+
type: Boolean,
|
|
21036
|
+
default: false
|
|
21037
|
+
}
|
|
21038
|
+
});
|
|
21039
|
+
const virtualizedListProps = buildProps({
|
|
21040
|
+
cache,
|
|
21041
|
+
estimatedItemSize,
|
|
21042
|
+
layout,
|
|
21043
|
+
initScrollOffset,
|
|
21044
|
+
total,
|
|
21045
|
+
itemSize,
|
|
21046
|
+
...virtualizedProps
|
|
21047
|
+
});
|
|
21048
|
+
const scrollbarSize = {
|
|
21049
|
+
type: Number,
|
|
21050
|
+
default: 6
|
|
21051
|
+
};
|
|
21052
|
+
const startGap = { type: Number, default: 0 };
|
|
21053
|
+
const endGap = { type: Number, default: 2 };
|
|
21054
|
+
buildProps({
|
|
21055
|
+
columnCache: cache,
|
|
21056
|
+
columnWidth: itemSize,
|
|
21057
|
+
estimatedColumnWidth: estimatedItemSize,
|
|
21058
|
+
estimatedRowHeight: estimatedItemSize,
|
|
21059
|
+
initScrollLeft: initScrollOffset,
|
|
21060
|
+
initScrollTop: initScrollOffset,
|
|
21061
|
+
itemKey: {
|
|
21062
|
+
type: definePropType(Function),
|
|
21063
|
+
default: ({
|
|
21064
|
+
columnIndex,
|
|
21065
|
+
rowIndex
|
|
21066
|
+
}) => `${rowIndex}:${columnIndex}`
|
|
21067
|
+
},
|
|
21068
|
+
rowCache: cache,
|
|
21069
|
+
rowHeight: itemSize,
|
|
21070
|
+
totalColumn: total,
|
|
21071
|
+
totalRow: total,
|
|
21072
|
+
hScrollbarSize: scrollbarSize,
|
|
21073
|
+
vScrollbarSize: scrollbarSize,
|
|
21074
|
+
scrollbarStartGap: startGap,
|
|
21075
|
+
scrollbarEndGap: endGap,
|
|
21076
|
+
role: String,
|
|
21077
|
+
...virtualizedProps
|
|
21078
|
+
});
|
|
21079
|
+
const virtualizedScrollbarProps = buildProps({
|
|
21080
|
+
alwaysOn: Boolean,
|
|
21081
|
+
class: String,
|
|
21082
|
+
layout,
|
|
21083
|
+
total,
|
|
21084
|
+
ratio: {
|
|
21085
|
+
type: Number,
|
|
21086
|
+
required: true
|
|
21087
|
+
},
|
|
21088
|
+
clientSize: {
|
|
21089
|
+
type: Number,
|
|
21090
|
+
required: true
|
|
21091
|
+
},
|
|
21092
|
+
scrollFrom: {
|
|
21093
|
+
type: Number,
|
|
21094
|
+
required: true
|
|
21095
|
+
},
|
|
21096
|
+
scrollbarSize,
|
|
21097
|
+
startGap,
|
|
21098
|
+
endGap,
|
|
21099
|
+
visible: Boolean
|
|
21100
|
+
});
|
|
21101
|
+
|
|
21102
|
+
const getScrollDir = (prev, cur) => prev < cur ? FORWARD : BACKWARD;
|
|
21103
|
+
const isHorizontal = (dir) => dir === LTR || dir === RTL || dir === HORIZONTAL;
|
|
21104
|
+
let cachedRTLResult = null;
|
|
21105
|
+
function getRTLOffsetType(recalculate = false) {
|
|
21106
|
+
if (cachedRTLResult === null || recalculate) {
|
|
21107
|
+
const outerDiv = document.createElement("div");
|
|
21108
|
+
const outerStyle = outerDiv.style;
|
|
21109
|
+
outerStyle.width = "50px";
|
|
21110
|
+
outerStyle.height = "50px";
|
|
21111
|
+
outerStyle.overflow = "scroll";
|
|
21112
|
+
outerStyle.direction = "rtl";
|
|
21113
|
+
const innerDiv = document.createElement("div");
|
|
21114
|
+
const innerStyle = innerDiv.style;
|
|
21115
|
+
innerStyle.width = "100px";
|
|
21116
|
+
innerStyle.height = "100px";
|
|
21117
|
+
outerDiv.appendChild(innerDiv);
|
|
21118
|
+
document.body.appendChild(outerDiv);
|
|
21119
|
+
if (outerDiv.scrollLeft > 0) {
|
|
21120
|
+
cachedRTLResult = RTL_OFFSET_POS_DESC;
|
|
21121
|
+
} else {
|
|
21122
|
+
outerDiv.scrollLeft = 1;
|
|
21123
|
+
if (outerDiv.scrollLeft === 0) {
|
|
21124
|
+
cachedRTLResult = RTL_OFFSET_NAG;
|
|
21125
|
+
} else {
|
|
21126
|
+
cachedRTLResult = RTL_OFFSET_POS_ASC;
|
|
21127
|
+
}
|
|
21128
|
+
}
|
|
21129
|
+
document.body.removeChild(outerDiv);
|
|
21130
|
+
return cachedRTLResult;
|
|
21131
|
+
}
|
|
21132
|
+
return cachedRTLResult;
|
|
21133
|
+
}
|
|
21134
|
+
function renderThumbStyle({ move, size, bar }, layout) {
|
|
21135
|
+
const style = {};
|
|
21136
|
+
const translate = `translate${bar.axis}(${move}px)`;
|
|
21137
|
+
style[bar.size] = size;
|
|
21138
|
+
style.transform = translate;
|
|
21139
|
+
style.msTransform = translate;
|
|
21140
|
+
style.webkitTransform = translate;
|
|
21141
|
+
if (layout === "horizontal") {
|
|
21142
|
+
style.height = "100%";
|
|
21143
|
+
} else {
|
|
21144
|
+
style.width = "100%";
|
|
21145
|
+
}
|
|
21146
|
+
return style;
|
|
21147
|
+
}
|
|
21148
|
+
|
|
21149
|
+
const ScrollBar = defineComponent({
|
|
21150
|
+
name: "ElVirtualScrollBar",
|
|
21151
|
+
props: virtualizedScrollbarProps,
|
|
21152
|
+
emits: ["scroll", "start-move", "stop-move"],
|
|
21153
|
+
setup(props, { emit }) {
|
|
21154
|
+
const GAP = computed(() => props.startGap + props.endGap);
|
|
21155
|
+
const nsVirtualScrollbar = useNamespace("virtual-scrollbar");
|
|
21156
|
+
const nsScrollbar = useNamespace("scrollbar");
|
|
21157
|
+
const trackRef = ref();
|
|
21158
|
+
const thumbRef = ref();
|
|
21159
|
+
let frameHandle = null;
|
|
21160
|
+
let onselectstartStore = null;
|
|
21161
|
+
const state = reactive({
|
|
21162
|
+
isDragging: false,
|
|
21163
|
+
traveled: 0
|
|
21164
|
+
});
|
|
21165
|
+
const bar = computed(() => BAR_MAP[props.layout]);
|
|
21166
|
+
const trackSize = computed(() => props.clientSize - unref(GAP));
|
|
21167
|
+
const trackStyle = computed(() => ({
|
|
21168
|
+
position: "absolute",
|
|
21169
|
+
width: `${HORIZONTAL === props.layout ? trackSize.value : props.scrollbarSize}px`,
|
|
21170
|
+
height: `${HORIZONTAL === props.layout ? props.scrollbarSize : trackSize.value}px`,
|
|
21171
|
+
[ScrollbarDirKey[props.layout]]: "2px",
|
|
21172
|
+
right: "2px",
|
|
21173
|
+
bottom: "2px",
|
|
21174
|
+
borderRadius: "4px"
|
|
21175
|
+
}));
|
|
21176
|
+
const thumbSize = computed(() => {
|
|
21177
|
+
const ratio = props.ratio;
|
|
21178
|
+
const clientSize = props.clientSize;
|
|
21179
|
+
if (ratio >= 100) {
|
|
21180
|
+
return Number.POSITIVE_INFINITY;
|
|
21181
|
+
}
|
|
21182
|
+
if (ratio >= 50) {
|
|
21183
|
+
return ratio * clientSize / 100;
|
|
21184
|
+
}
|
|
21185
|
+
const SCROLLBAR_MAX_SIZE = clientSize / 3;
|
|
21186
|
+
return Math.floor(Math.min(Math.max(ratio * clientSize, SCROLLBAR_MIN_SIZE), SCROLLBAR_MAX_SIZE));
|
|
21187
|
+
});
|
|
21188
|
+
const thumbStyle = computed(() => {
|
|
21189
|
+
if (!Number.isFinite(thumbSize.value)) {
|
|
21190
|
+
return {
|
|
21191
|
+
display: "none"
|
|
21192
|
+
};
|
|
21193
|
+
}
|
|
21194
|
+
const thumb = `${thumbSize.value}px`;
|
|
21195
|
+
const style = renderThumbStyle({
|
|
21196
|
+
bar: bar.value,
|
|
21197
|
+
size: thumb,
|
|
21198
|
+
move: state.traveled
|
|
21199
|
+
}, props.layout);
|
|
21200
|
+
return style;
|
|
21201
|
+
});
|
|
21202
|
+
const totalSteps = computed(() => Math.floor(props.clientSize - thumbSize.value - unref(GAP)));
|
|
21203
|
+
const attachEvents = () => {
|
|
21204
|
+
window.addEventListener("mousemove", onMouseMove);
|
|
21205
|
+
window.addEventListener("mouseup", onMouseUp);
|
|
21206
|
+
const thumbEl = unref(thumbRef);
|
|
21207
|
+
if (!thumbEl)
|
|
21208
|
+
return;
|
|
21209
|
+
onselectstartStore = document.onselectstart;
|
|
21210
|
+
document.onselectstart = () => false;
|
|
21211
|
+
thumbEl.addEventListener("touchmove", onMouseMove, { passive: true });
|
|
21212
|
+
thumbEl.addEventListener("touchend", onMouseUp);
|
|
21213
|
+
};
|
|
21214
|
+
const detachEvents = () => {
|
|
21215
|
+
window.removeEventListener("mousemove", onMouseMove);
|
|
21216
|
+
window.removeEventListener("mouseup", onMouseUp);
|
|
21217
|
+
document.onselectstart = onselectstartStore;
|
|
21218
|
+
onselectstartStore = null;
|
|
21219
|
+
const thumbEl = unref(thumbRef);
|
|
21220
|
+
if (!thumbEl)
|
|
21221
|
+
return;
|
|
21222
|
+
thumbEl.removeEventListener("touchmove", onMouseMove);
|
|
21223
|
+
thumbEl.removeEventListener("touchend", onMouseUp);
|
|
21224
|
+
};
|
|
21225
|
+
const onThumbMouseDown = (e) => {
|
|
21226
|
+
e.stopImmediatePropagation();
|
|
21227
|
+
if (e.ctrlKey || [1, 2].includes(e.button)) {
|
|
21228
|
+
return;
|
|
21229
|
+
}
|
|
21230
|
+
state.isDragging = true;
|
|
21231
|
+
state[bar.value.axis] = e.currentTarget[bar.value.offset] - (e[bar.value.client] - e.currentTarget.getBoundingClientRect()[bar.value.direction]);
|
|
21232
|
+
emit("start-move");
|
|
21233
|
+
attachEvents();
|
|
21234
|
+
};
|
|
21235
|
+
const onMouseUp = () => {
|
|
21236
|
+
state.isDragging = false;
|
|
21237
|
+
state[bar.value.axis] = 0;
|
|
21238
|
+
emit("stop-move");
|
|
21239
|
+
detachEvents();
|
|
21240
|
+
};
|
|
21241
|
+
const onMouseMove = (e) => {
|
|
21242
|
+
const { isDragging } = state;
|
|
21243
|
+
if (!isDragging)
|
|
21244
|
+
return;
|
|
21245
|
+
if (!thumbRef.value || !trackRef.value)
|
|
21246
|
+
return;
|
|
21247
|
+
const prevPage = state[bar.value.axis];
|
|
21248
|
+
if (!prevPage)
|
|
21249
|
+
return;
|
|
21250
|
+
cAF(frameHandle);
|
|
21251
|
+
const offset = (trackRef.value.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1;
|
|
21252
|
+
const thumbClickPosition = thumbRef.value[bar.value.offset] - prevPage;
|
|
21253
|
+
const distance = offset - thumbClickPosition;
|
|
21254
|
+
frameHandle = rAF(() => {
|
|
21255
|
+
state.traveled = Math.max(props.startGap, Math.min(distance, totalSteps.value));
|
|
21256
|
+
emit("scroll", distance, totalSteps.value);
|
|
21257
|
+
});
|
|
21258
|
+
};
|
|
21259
|
+
const clickTrackHandler = (e) => {
|
|
21260
|
+
const offset = Math.abs(e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]);
|
|
21261
|
+
const thumbHalf = thumbRef.value[bar.value.offset] / 2;
|
|
21262
|
+
const distance = offset - thumbHalf;
|
|
21263
|
+
state.traveled = Math.max(0, Math.min(distance, totalSteps.value));
|
|
21264
|
+
emit("scroll", distance, totalSteps.value);
|
|
21265
|
+
};
|
|
21266
|
+
watch(() => props.scrollFrom, (v) => {
|
|
21267
|
+
if (state.isDragging)
|
|
21268
|
+
return;
|
|
21269
|
+
state.traveled = Math.ceil(v * totalSteps.value);
|
|
21270
|
+
});
|
|
21271
|
+
onBeforeUnmount(() => {
|
|
21272
|
+
detachEvents();
|
|
21273
|
+
});
|
|
21274
|
+
return () => {
|
|
21275
|
+
return h("div", {
|
|
21276
|
+
role: "presentation",
|
|
21277
|
+
ref: trackRef,
|
|
21278
|
+
class: [
|
|
21279
|
+
nsVirtualScrollbar.b(),
|
|
21280
|
+
props.class,
|
|
21281
|
+
(props.alwaysOn || state.isDragging) && "always-on"
|
|
21282
|
+
],
|
|
21283
|
+
style: trackStyle.value,
|
|
21284
|
+
onMousedown: withModifiers(clickTrackHandler, ["stop", "prevent"]),
|
|
21285
|
+
onTouchstartPrevent: onThumbMouseDown
|
|
21286
|
+
}, h("div", {
|
|
21287
|
+
ref: thumbRef,
|
|
21288
|
+
class: nsScrollbar.e("thumb"),
|
|
21289
|
+
style: thumbStyle.value,
|
|
21290
|
+
onMousedown: onThumbMouseDown
|
|
21291
|
+
}, []));
|
|
21292
|
+
};
|
|
21293
|
+
}
|
|
21294
|
+
});
|
|
21295
|
+
|
|
21296
|
+
const createList = ({
|
|
21297
|
+
name,
|
|
21298
|
+
getOffset,
|
|
21299
|
+
getItemSize,
|
|
21300
|
+
getItemOffset,
|
|
21301
|
+
getEstimatedTotalSize,
|
|
21302
|
+
getStartIndexForOffset,
|
|
21303
|
+
getStopIndexForStartIndex,
|
|
21304
|
+
initCache,
|
|
21305
|
+
clearCache,
|
|
21306
|
+
validateProps
|
|
21307
|
+
}) => {
|
|
21308
|
+
return defineComponent({
|
|
21309
|
+
name: name != null ? name : "ElVirtualList",
|
|
21310
|
+
props: virtualizedListProps,
|
|
21311
|
+
emits: [ITEM_RENDER_EVT, SCROLL_EVT],
|
|
21312
|
+
setup(props, { emit, expose }) {
|
|
21313
|
+
validateProps(props);
|
|
21314
|
+
const instance = getCurrentInstance();
|
|
21315
|
+
const ns = useNamespace("vl");
|
|
21316
|
+
const dynamicSizeCache = ref(initCache(props, instance));
|
|
21317
|
+
const getItemStyleCache = useCache();
|
|
21318
|
+
const windowRef = ref();
|
|
21319
|
+
const innerRef = ref();
|
|
21320
|
+
const scrollbarRef = ref();
|
|
21321
|
+
const states = ref({
|
|
21322
|
+
isScrolling: false,
|
|
21323
|
+
scrollDir: "forward",
|
|
21324
|
+
scrollOffset: isNumber(props.initScrollOffset) ? props.initScrollOffset : 0,
|
|
21325
|
+
updateRequested: false,
|
|
21326
|
+
isScrollbarDragging: false,
|
|
21327
|
+
scrollbarAlwaysOn: props.scrollbarAlwaysOn
|
|
21328
|
+
});
|
|
21329
|
+
const itemsToRender = computed(() => {
|
|
21330
|
+
const { total, cache } = props;
|
|
21331
|
+
const { isScrolling, scrollDir, scrollOffset } = unref(states);
|
|
21332
|
+
if (total === 0) {
|
|
21333
|
+
return [0, 0, 0, 0];
|
|
21334
|
+
}
|
|
21335
|
+
const startIndex = getStartIndexForOffset(props, scrollOffset, unref(dynamicSizeCache));
|
|
21336
|
+
const stopIndex = getStopIndexForStartIndex(props, startIndex, scrollOffset, unref(dynamicSizeCache));
|
|
21337
|
+
const cacheBackward = !isScrolling || scrollDir === BACKWARD ? Math.max(1, cache) : 1;
|
|
21338
|
+
const cacheForward = !isScrolling || scrollDir === FORWARD ? Math.max(1, cache) : 1;
|
|
21339
|
+
return [
|
|
21340
|
+
Math.max(0, startIndex - cacheBackward),
|
|
21341
|
+
Math.max(0, Math.min(total - 1, stopIndex + cacheForward)),
|
|
21342
|
+
startIndex,
|
|
21343
|
+
stopIndex
|
|
21344
|
+
];
|
|
21345
|
+
});
|
|
21346
|
+
const estimatedTotalSize = computed(() => getEstimatedTotalSize(props, unref(dynamicSizeCache)));
|
|
21347
|
+
const _isHorizontal = computed(() => isHorizontal(props.layout));
|
|
21348
|
+
const windowStyle = computed(() => [
|
|
21349
|
+
{
|
|
21350
|
+
position: "relative",
|
|
21351
|
+
[`overflow-${_isHorizontal.value ? "x" : "y"}`]: "scroll",
|
|
21352
|
+
WebkitOverflowScrolling: "touch",
|
|
21353
|
+
willChange: "transform"
|
|
21354
|
+
},
|
|
21355
|
+
{
|
|
21356
|
+
direction: props.direction,
|
|
21357
|
+
height: isNumber(props.height) ? `${props.height}px` : props.height,
|
|
21358
|
+
width: isNumber(props.width) ? `${props.width}px` : props.width
|
|
21359
|
+
},
|
|
21360
|
+
props.style
|
|
21361
|
+
]);
|
|
21362
|
+
const innerStyle = computed(() => {
|
|
21363
|
+
const size = unref(estimatedTotalSize);
|
|
21364
|
+
const horizontal = unref(_isHorizontal);
|
|
21365
|
+
return {
|
|
21366
|
+
height: horizontal ? "100%" : `${size}px`,
|
|
21367
|
+
pointerEvents: unref(states).isScrolling ? "none" : void 0,
|
|
21368
|
+
width: horizontal ? `${size}px` : "100%"
|
|
21369
|
+
};
|
|
21370
|
+
});
|
|
21371
|
+
const clientSize = computed(() => _isHorizontal.value ? props.width : props.height);
|
|
21372
|
+
const { onWheel } = useWheel({
|
|
21373
|
+
atStartEdge: computed(() => states.value.scrollOffset <= 0),
|
|
21374
|
+
atEndEdge: computed(() => states.value.scrollOffset >= estimatedTotalSize.value),
|
|
21375
|
+
layout: computed(() => props.layout)
|
|
21376
|
+
}, (offset) => {
|
|
21377
|
+
var _a, _b;
|
|
21378
|
+
(_b = (_a = scrollbarRef.value).onMouseUp) == null ? void 0 : _b.call(_a);
|
|
21379
|
+
scrollTo(Math.min(states.value.scrollOffset + offset, estimatedTotalSize.value - clientSize.value));
|
|
21380
|
+
});
|
|
21381
|
+
useEventListener(windowRef, "wheel", onWheel, {
|
|
21382
|
+
passive: false
|
|
21383
|
+
});
|
|
21384
|
+
const emitEvents = () => {
|
|
21385
|
+
const { total } = props;
|
|
21386
|
+
if (total > 0) {
|
|
21387
|
+
const [cacheStart, cacheEnd, visibleStart, visibleEnd] = unref(itemsToRender);
|
|
21388
|
+
emit(ITEM_RENDER_EVT, cacheStart, cacheEnd, visibleStart, visibleEnd);
|
|
21389
|
+
}
|
|
21390
|
+
const { scrollDir, scrollOffset, updateRequested } = unref(states);
|
|
21391
|
+
emit(SCROLL_EVT, scrollDir, scrollOffset, updateRequested);
|
|
21392
|
+
};
|
|
21393
|
+
const scrollVertically = (e) => {
|
|
21394
|
+
const { clientHeight, scrollHeight, scrollTop } = e.currentTarget;
|
|
21395
|
+
const _states = unref(states);
|
|
21396
|
+
if (_states.scrollOffset === scrollTop) {
|
|
21397
|
+
return;
|
|
21398
|
+
}
|
|
21399
|
+
const scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight));
|
|
21400
|
+
states.value = {
|
|
21401
|
+
..._states,
|
|
21402
|
+
isScrolling: true,
|
|
21403
|
+
scrollDir: getScrollDir(_states.scrollOffset, scrollOffset),
|
|
21404
|
+
scrollOffset,
|
|
21405
|
+
updateRequested: false
|
|
21406
|
+
};
|
|
21407
|
+
nextTick(resetIsScrolling);
|
|
21408
|
+
};
|
|
21409
|
+
const scrollHorizontally = (e) => {
|
|
21410
|
+
const { clientWidth, scrollLeft, scrollWidth } = e.currentTarget;
|
|
21411
|
+
const _states = unref(states);
|
|
21412
|
+
if (_states.scrollOffset === scrollLeft) {
|
|
21413
|
+
return;
|
|
21414
|
+
}
|
|
21415
|
+
const { direction } = props;
|
|
21416
|
+
let scrollOffset = scrollLeft;
|
|
21417
|
+
if (direction === RTL) {
|
|
21418
|
+
switch (getRTLOffsetType()) {
|
|
21419
|
+
case RTL_OFFSET_NAG: {
|
|
21420
|
+
scrollOffset = -scrollLeft;
|
|
21421
|
+
break;
|
|
21422
|
+
}
|
|
21423
|
+
case RTL_OFFSET_POS_DESC: {
|
|
21424
|
+
scrollOffset = scrollWidth - clientWidth - scrollLeft;
|
|
21425
|
+
break;
|
|
21426
|
+
}
|
|
21427
|
+
}
|
|
21428
|
+
}
|
|
21429
|
+
scrollOffset = Math.max(0, Math.min(scrollOffset, scrollWidth - clientWidth));
|
|
21430
|
+
states.value = {
|
|
21431
|
+
..._states,
|
|
21432
|
+
isScrolling: true,
|
|
21433
|
+
scrollDir: getScrollDir(_states.scrollOffset, scrollOffset),
|
|
21434
|
+
scrollOffset,
|
|
21435
|
+
updateRequested: false
|
|
21436
|
+
};
|
|
21437
|
+
nextTick(resetIsScrolling);
|
|
21438
|
+
};
|
|
21439
|
+
const onScroll = (e) => {
|
|
21440
|
+
unref(_isHorizontal) ? scrollHorizontally(e) : scrollVertically(e);
|
|
21441
|
+
emitEvents();
|
|
21442
|
+
};
|
|
21443
|
+
const onScrollbarScroll = (distanceToGo, totalSteps) => {
|
|
21444
|
+
const offset = (estimatedTotalSize.value - clientSize.value) / totalSteps * distanceToGo;
|
|
21445
|
+
scrollTo(Math.min(estimatedTotalSize.value - clientSize.value, offset));
|
|
21446
|
+
};
|
|
21447
|
+
const scrollTo = (offset) => {
|
|
21448
|
+
offset = Math.max(offset, 0);
|
|
21449
|
+
if (offset === unref(states).scrollOffset) {
|
|
21450
|
+
return;
|
|
21451
|
+
}
|
|
21452
|
+
states.value = {
|
|
21453
|
+
...unref(states),
|
|
21454
|
+
scrollOffset: offset,
|
|
21455
|
+
scrollDir: getScrollDir(unref(states).scrollOffset, offset),
|
|
21456
|
+
updateRequested: true
|
|
21457
|
+
};
|
|
21458
|
+
nextTick(resetIsScrolling);
|
|
21459
|
+
};
|
|
21460
|
+
const scrollToItem = (idx, alignment = AUTO_ALIGNMENT) => {
|
|
21461
|
+
const { scrollOffset } = unref(states);
|
|
21462
|
+
idx = Math.max(0, Math.min(idx, props.total - 1));
|
|
21463
|
+
scrollTo(getOffset(props, idx, alignment, scrollOffset, unref(dynamicSizeCache)));
|
|
21464
|
+
};
|
|
21465
|
+
const getItemStyle = (idx) => {
|
|
21466
|
+
const { direction, itemSize, layout } = props;
|
|
21467
|
+
const itemStyleCache = getItemStyleCache.value(clearCache && itemSize, clearCache && layout, clearCache && direction);
|
|
21468
|
+
let style;
|
|
21469
|
+
if (hasOwn(itemStyleCache, String(idx))) {
|
|
21470
|
+
style = itemStyleCache[idx];
|
|
21471
|
+
} else {
|
|
21472
|
+
const offset = getItemOffset(props, idx, unref(dynamicSizeCache));
|
|
21473
|
+
const size = getItemSize(props, idx, unref(dynamicSizeCache));
|
|
21474
|
+
const horizontal = unref(_isHorizontal);
|
|
21475
|
+
const isRtl = direction === RTL;
|
|
21476
|
+
const offsetHorizontal = horizontal ? offset : 0;
|
|
21477
|
+
itemStyleCache[idx] = style = {
|
|
21478
|
+
position: "absolute",
|
|
21479
|
+
left: isRtl ? void 0 : `${offsetHorizontal}px`,
|
|
21480
|
+
right: isRtl ? `${offsetHorizontal}px` : void 0,
|
|
21481
|
+
top: !horizontal ? `${offset}px` : 0,
|
|
21482
|
+
height: !horizontal ? `${size}px` : "100%",
|
|
21483
|
+
width: horizontal ? `${size}px` : "100%"
|
|
21484
|
+
};
|
|
21485
|
+
}
|
|
21486
|
+
return style;
|
|
21487
|
+
};
|
|
21488
|
+
const resetIsScrolling = () => {
|
|
21489
|
+
states.value.isScrolling = false;
|
|
21490
|
+
nextTick(() => {
|
|
21491
|
+
getItemStyleCache.value(-1, null, null);
|
|
21492
|
+
});
|
|
21493
|
+
};
|
|
21494
|
+
const resetScrollTop = () => {
|
|
21495
|
+
const window = windowRef.value;
|
|
21496
|
+
if (window) {
|
|
21497
|
+
window.scrollTop = 0;
|
|
21498
|
+
}
|
|
21499
|
+
};
|
|
21500
|
+
onMounted(() => {
|
|
21501
|
+
if (!isClient)
|
|
21502
|
+
return;
|
|
21503
|
+
const { initScrollOffset } = props;
|
|
21504
|
+
const windowElement = unref(windowRef);
|
|
21505
|
+
if (isNumber(initScrollOffset) && windowElement) {
|
|
21506
|
+
if (unref(_isHorizontal)) {
|
|
21507
|
+
windowElement.scrollLeft = initScrollOffset;
|
|
21508
|
+
} else {
|
|
21509
|
+
windowElement.scrollTop = initScrollOffset;
|
|
21510
|
+
}
|
|
21511
|
+
}
|
|
21512
|
+
emitEvents();
|
|
21513
|
+
});
|
|
21514
|
+
onUpdated(() => {
|
|
21515
|
+
const { direction, layout } = props;
|
|
21516
|
+
const { scrollOffset, updateRequested } = unref(states);
|
|
21517
|
+
const windowElement = unref(windowRef);
|
|
21518
|
+
if (updateRequested && windowElement) {
|
|
21519
|
+
if (layout === HORIZONTAL) {
|
|
21520
|
+
if (direction === RTL) {
|
|
21521
|
+
switch (getRTLOffsetType()) {
|
|
21522
|
+
case RTL_OFFSET_NAG: {
|
|
21523
|
+
windowElement.scrollLeft = -scrollOffset;
|
|
21524
|
+
break;
|
|
21525
|
+
}
|
|
21526
|
+
case RTL_OFFSET_POS_ASC: {
|
|
21527
|
+
windowElement.scrollLeft = scrollOffset;
|
|
21528
|
+
break;
|
|
21529
|
+
}
|
|
21530
|
+
default: {
|
|
21531
|
+
const { clientWidth, scrollWidth } = windowElement;
|
|
21532
|
+
windowElement.scrollLeft = scrollWidth - clientWidth - scrollOffset;
|
|
21533
|
+
break;
|
|
21534
|
+
}
|
|
21535
|
+
}
|
|
21536
|
+
} else {
|
|
21537
|
+
windowElement.scrollLeft = scrollOffset;
|
|
21538
|
+
}
|
|
21539
|
+
} else {
|
|
21540
|
+
windowElement.scrollTop = scrollOffset;
|
|
21541
|
+
}
|
|
21542
|
+
}
|
|
21543
|
+
});
|
|
21544
|
+
onActivated(() => {
|
|
21545
|
+
unref(windowRef).scrollTop = unref(states).scrollOffset;
|
|
21546
|
+
});
|
|
21547
|
+
const api = {
|
|
21548
|
+
ns,
|
|
21549
|
+
clientSize,
|
|
21550
|
+
estimatedTotalSize,
|
|
21551
|
+
windowStyle,
|
|
21552
|
+
windowRef,
|
|
21553
|
+
innerRef,
|
|
21554
|
+
innerStyle,
|
|
21555
|
+
itemsToRender,
|
|
21556
|
+
scrollbarRef,
|
|
21557
|
+
states,
|
|
21558
|
+
getItemStyle,
|
|
21559
|
+
onScroll,
|
|
21560
|
+
onScrollbarScroll,
|
|
21561
|
+
onWheel,
|
|
21562
|
+
scrollTo,
|
|
21563
|
+
scrollToItem,
|
|
21564
|
+
resetScrollTop
|
|
21565
|
+
};
|
|
21566
|
+
expose({
|
|
21567
|
+
windowRef,
|
|
21568
|
+
innerRef,
|
|
21569
|
+
getItemStyleCache,
|
|
21570
|
+
scrollTo,
|
|
21571
|
+
scrollToItem,
|
|
21572
|
+
resetScrollTop,
|
|
21573
|
+
states
|
|
21574
|
+
});
|
|
21575
|
+
return api;
|
|
21576
|
+
},
|
|
21577
|
+
render(ctx) {
|
|
21578
|
+
var _a;
|
|
21579
|
+
const {
|
|
21580
|
+
$slots,
|
|
21581
|
+
className,
|
|
21582
|
+
clientSize,
|
|
21583
|
+
containerElement,
|
|
21584
|
+
data,
|
|
21585
|
+
getItemStyle,
|
|
21586
|
+
innerElement,
|
|
21587
|
+
itemsToRender,
|
|
21588
|
+
innerStyle,
|
|
21589
|
+
layout,
|
|
21590
|
+
total,
|
|
21591
|
+
onScroll,
|
|
21592
|
+
onScrollbarScroll,
|
|
21593
|
+
states,
|
|
21594
|
+
useIsScrolling,
|
|
21595
|
+
windowStyle,
|
|
21596
|
+
ns
|
|
21597
|
+
} = ctx;
|
|
21598
|
+
const [start, end] = itemsToRender;
|
|
21599
|
+
const Container = resolveDynamicComponent(containerElement);
|
|
21600
|
+
const Inner = resolveDynamicComponent(innerElement);
|
|
21601
|
+
const children = [];
|
|
21602
|
+
if (total > 0) {
|
|
21603
|
+
for (let i = start; i <= end; i++) {
|
|
21604
|
+
children.push(h(Fragment, { key: i }, (_a = $slots.default) == null ? void 0 : _a.call($slots, {
|
|
21605
|
+
data,
|
|
21606
|
+
index: i,
|
|
21607
|
+
isScrolling: useIsScrolling ? states.isScrolling : void 0,
|
|
21608
|
+
style: getItemStyle(i)
|
|
21609
|
+
})));
|
|
21610
|
+
}
|
|
21611
|
+
}
|
|
21612
|
+
const InnerNode = [
|
|
21613
|
+
h(Inner, {
|
|
21614
|
+
style: innerStyle,
|
|
21615
|
+
ref: "innerRef"
|
|
21616
|
+
}, !isString$1(Inner) ? {
|
|
21617
|
+
default: () => children
|
|
21618
|
+
} : children)
|
|
21619
|
+
];
|
|
21620
|
+
const scrollbar = h(ScrollBar, {
|
|
21621
|
+
ref: "scrollbarRef",
|
|
21622
|
+
clientSize,
|
|
21623
|
+
layout,
|
|
21624
|
+
onScroll: onScrollbarScroll,
|
|
21625
|
+
ratio: clientSize * 100 / this.estimatedTotalSize,
|
|
21626
|
+
scrollFrom: states.scrollOffset / (this.estimatedTotalSize - clientSize),
|
|
21627
|
+
total
|
|
21628
|
+
});
|
|
21629
|
+
const listContainer = h(Container, {
|
|
21630
|
+
class: [ns.e("window"), className],
|
|
21631
|
+
style: windowStyle,
|
|
21632
|
+
onScroll,
|
|
21633
|
+
ref: "windowRef",
|
|
21634
|
+
key: 0
|
|
21635
|
+
}, !isString$1(Container) ? { default: () => [InnerNode] } : [InnerNode]);
|
|
21636
|
+
return h("div", {
|
|
21637
|
+
key: 0,
|
|
21638
|
+
class: [ns.e("wrapper"), states.scrollbarAlwaysOn ? "always-on" : ""]
|
|
21639
|
+
}, [listContainer, scrollbar]);
|
|
21640
|
+
}
|
|
21641
|
+
});
|
|
21642
|
+
};
|
|
21643
|
+
|
|
21644
|
+
const FixedSizeList = createList({
|
|
21645
|
+
name: "ElFixedSizeList",
|
|
21646
|
+
getItemOffset: ({ itemSize }, index) => index * itemSize,
|
|
21647
|
+
getItemSize: ({ itemSize }) => itemSize,
|
|
21648
|
+
getEstimatedTotalSize: ({ total, itemSize }) => itemSize * total,
|
|
21649
|
+
getOffset: ({ height, total, itemSize, layout, width }, index, alignment, scrollOffset) => {
|
|
21650
|
+
const size = isHorizontal(layout) ? width : height;
|
|
21651
|
+
const lastItemOffset = Math.max(0, total * itemSize - size);
|
|
21652
|
+
const maxOffset = Math.min(lastItemOffset, index * itemSize);
|
|
21653
|
+
const minOffset = Math.max(0, (index + 1) * itemSize - size);
|
|
21654
|
+
if (alignment === SMART_ALIGNMENT) {
|
|
21655
|
+
if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) {
|
|
21656
|
+
alignment = AUTO_ALIGNMENT;
|
|
21657
|
+
} else {
|
|
21658
|
+
alignment = CENTERED_ALIGNMENT;
|
|
21659
|
+
}
|
|
21660
|
+
}
|
|
21661
|
+
switch (alignment) {
|
|
21662
|
+
case START_ALIGNMENT: {
|
|
21663
|
+
return maxOffset;
|
|
21664
|
+
}
|
|
21665
|
+
case END_ALIGNMENT: {
|
|
21666
|
+
return minOffset;
|
|
21667
|
+
}
|
|
21668
|
+
case CENTERED_ALIGNMENT: {
|
|
21669
|
+
const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);
|
|
21670
|
+
if (middleOffset < Math.ceil(size / 2)) {
|
|
21671
|
+
return 0;
|
|
21672
|
+
} else if (middleOffset > lastItemOffset + Math.floor(size / 2)) {
|
|
21673
|
+
return lastItemOffset;
|
|
21674
|
+
} else {
|
|
21675
|
+
return middleOffset;
|
|
21676
|
+
}
|
|
21677
|
+
}
|
|
21678
|
+
case AUTO_ALIGNMENT:
|
|
21679
|
+
default: {
|
|
21680
|
+
if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
|
|
21681
|
+
return scrollOffset;
|
|
21682
|
+
} else if (scrollOffset < minOffset) {
|
|
21683
|
+
return minOffset;
|
|
21684
|
+
} else {
|
|
21685
|
+
return maxOffset;
|
|
21686
|
+
}
|
|
21687
|
+
}
|
|
21688
|
+
}
|
|
21689
|
+
},
|
|
21690
|
+
getStartIndexForOffset: ({ total, itemSize }, offset) => Math.max(0, Math.min(total - 1, Math.floor(offset / itemSize))),
|
|
21691
|
+
getStopIndexForStartIndex: ({ height, total, itemSize, layout, width }, startIndex, scrollOffset) => {
|
|
21692
|
+
const offset = startIndex * itemSize;
|
|
21693
|
+
const size = isHorizontal(layout) ? width : height;
|
|
21694
|
+
const numVisibleItems = Math.ceil((size + scrollOffset - offset) / itemSize);
|
|
21695
|
+
return Math.max(0, Math.min(total - 1, startIndex + numVisibleItems - 1));
|
|
21696
|
+
},
|
|
21697
|
+
initCache() {
|
|
21698
|
+
return void 0;
|
|
21699
|
+
},
|
|
21700
|
+
clearCache: true,
|
|
21701
|
+
validateProps() {
|
|
21702
|
+
}
|
|
21703
|
+
});
|
|
21704
|
+
|
|
21705
|
+
const getItemFromCache = (props, index, listCache) => {
|
|
21706
|
+
const { itemSize } = props;
|
|
21707
|
+
const { items, lastVisitedIndex } = listCache;
|
|
21708
|
+
if (index > lastVisitedIndex) {
|
|
21709
|
+
let offset = 0;
|
|
21710
|
+
if (lastVisitedIndex >= 0) {
|
|
21711
|
+
const item = items[lastVisitedIndex];
|
|
21712
|
+
offset = item.offset + item.size;
|
|
21713
|
+
}
|
|
21714
|
+
for (let i = lastVisitedIndex + 1; i <= index; i++) {
|
|
21715
|
+
const size = itemSize(i);
|
|
21716
|
+
items[i] = {
|
|
21717
|
+
offset,
|
|
21718
|
+
size
|
|
21719
|
+
};
|
|
21720
|
+
offset += size;
|
|
21721
|
+
}
|
|
21722
|
+
listCache.lastVisitedIndex = index;
|
|
21723
|
+
}
|
|
21724
|
+
return items[index];
|
|
21725
|
+
};
|
|
21726
|
+
const findItem = (props, listCache, offset) => {
|
|
21727
|
+
const { items, lastVisitedIndex } = listCache;
|
|
21728
|
+
const lastVisitedOffset = lastVisitedIndex > 0 ? items[lastVisitedIndex].offset : 0;
|
|
21729
|
+
if (lastVisitedOffset >= offset) {
|
|
21730
|
+
return bs(props, listCache, 0, lastVisitedIndex, offset);
|
|
21731
|
+
}
|
|
21732
|
+
return es(props, listCache, Math.max(0, lastVisitedIndex), offset);
|
|
21733
|
+
};
|
|
21734
|
+
const bs = (props, listCache, low, high, offset) => {
|
|
21735
|
+
while (low <= high) {
|
|
21736
|
+
const mid = low + Math.floor((high - low) / 2);
|
|
21737
|
+
const currentOffset = getItemFromCache(props, mid, listCache).offset;
|
|
21738
|
+
if (currentOffset === offset) {
|
|
21739
|
+
return mid;
|
|
21740
|
+
} else if (currentOffset < offset) {
|
|
21741
|
+
low = mid + 1;
|
|
21742
|
+
} else if (currentOffset > offset) {
|
|
21743
|
+
high = mid - 1;
|
|
21744
|
+
}
|
|
21745
|
+
}
|
|
21746
|
+
return Math.max(0, low - 1);
|
|
21747
|
+
};
|
|
21748
|
+
const es = (props, listCache, index, offset) => {
|
|
21749
|
+
const { total } = props;
|
|
21750
|
+
let exponent = 1;
|
|
21751
|
+
while (index < total && getItemFromCache(props, index, listCache).offset < offset) {
|
|
21752
|
+
index += exponent;
|
|
21753
|
+
exponent *= 2;
|
|
21754
|
+
}
|
|
21755
|
+
return bs(props, listCache, Math.floor(index / 2), Math.min(index, total - 1), offset);
|
|
21756
|
+
};
|
|
21757
|
+
const getEstimatedTotalSize = ({ total }, { items, estimatedItemSize, lastVisitedIndex }) => {
|
|
21758
|
+
let totalSizeOfMeasuredItems = 0;
|
|
21759
|
+
if (lastVisitedIndex >= total) {
|
|
21760
|
+
lastVisitedIndex = total - 1;
|
|
21761
|
+
}
|
|
21762
|
+
if (lastVisitedIndex >= 0) {
|
|
21763
|
+
const item = items[lastVisitedIndex];
|
|
21764
|
+
totalSizeOfMeasuredItems = item.offset + item.size;
|
|
21765
|
+
}
|
|
21766
|
+
const numUnmeasuredItems = total - lastVisitedIndex - 1;
|
|
21767
|
+
const totalSizeOfUnmeasuredItems = numUnmeasuredItems * estimatedItemSize;
|
|
21768
|
+
return totalSizeOfMeasuredItems + totalSizeOfUnmeasuredItems;
|
|
21769
|
+
};
|
|
21770
|
+
const DynamicSizeList = createList({
|
|
21771
|
+
name: "ElDynamicSizeList",
|
|
21772
|
+
getItemOffset: (props, index, listCache) => getItemFromCache(props, index, listCache).offset,
|
|
21773
|
+
getItemSize: (_, index, { items }) => items[index].size,
|
|
21774
|
+
getEstimatedTotalSize,
|
|
21775
|
+
getOffset: (props, index, alignment, scrollOffset, listCache) => {
|
|
21776
|
+
const { height, layout, width } = props;
|
|
21777
|
+
const size = isHorizontal(layout) ? width : height;
|
|
21778
|
+
const item = getItemFromCache(props, index, listCache);
|
|
21779
|
+
const estimatedTotalSize = getEstimatedTotalSize(props, listCache);
|
|
21780
|
+
const maxOffset = Math.max(0, Math.min(estimatedTotalSize - size, item.offset));
|
|
21781
|
+
const minOffset = Math.max(0, item.offset - size + item.size);
|
|
21782
|
+
if (alignment === SMART_ALIGNMENT) {
|
|
21783
|
+
if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) {
|
|
21784
|
+
alignment = AUTO_ALIGNMENT;
|
|
21785
|
+
} else {
|
|
21786
|
+
alignment = CENTERED_ALIGNMENT;
|
|
21787
|
+
}
|
|
21788
|
+
}
|
|
21789
|
+
switch (alignment) {
|
|
21790
|
+
case START_ALIGNMENT: {
|
|
21791
|
+
return maxOffset;
|
|
21792
|
+
}
|
|
21793
|
+
case END_ALIGNMENT: {
|
|
21794
|
+
return minOffset;
|
|
21795
|
+
}
|
|
21796
|
+
case CENTERED_ALIGNMENT: {
|
|
21797
|
+
return Math.round(minOffset + (maxOffset - minOffset) / 2);
|
|
21798
|
+
}
|
|
21799
|
+
case AUTO_ALIGNMENT:
|
|
21800
|
+
default: {
|
|
21801
|
+
if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
|
|
21802
|
+
return scrollOffset;
|
|
21803
|
+
} else if (scrollOffset < minOffset) {
|
|
21804
|
+
return minOffset;
|
|
21805
|
+
} else {
|
|
21806
|
+
return maxOffset;
|
|
21807
|
+
}
|
|
21808
|
+
}
|
|
21809
|
+
}
|
|
21810
|
+
},
|
|
21811
|
+
getStartIndexForOffset: (props, offset, listCache) => findItem(props, listCache, offset),
|
|
21812
|
+
getStopIndexForStartIndex: (props, startIndex, scrollOffset, listCache) => {
|
|
21813
|
+
const { height, total, layout, width } = props;
|
|
21814
|
+
const size = isHorizontal(layout) ? width : height;
|
|
21815
|
+
const item = getItemFromCache(props, startIndex, listCache);
|
|
21816
|
+
const maxOffset = scrollOffset + size;
|
|
21817
|
+
let offset = item.offset + item.size;
|
|
21818
|
+
let stopIndex = startIndex;
|
|
21819
|
+
while (stopIndex < total - 1 && offset < maxOffset) {
|
|
21820
|
+
stopIndex++;
|
|
21821
|
+
offset += getItemFromCache(props, stopIndex, listCache).size;
|
|
21822
|
+
}
|
|
21823
|
+
return stopIndex;
|
|
21824
|
+
},
|
|
21825
|
+
initCache({ estimatedItemSize = DEFAULT_DYNAMIC_LIST_ITEM_SIZE }, instance) {
|
|
21826
|
+
const cache = {
|
|
21827
|
+
items: {},
|
|
21828
|
+
estimatedItemSize,
|
|
21829
|
+
lastVisitedIndex: -1
|
|
21830
|
+
};
|
|
21831
|
+
cache.clearCacheAfterIndex = (index, forceUpdate = true) => {
|
|
21832
|
+
var _a, _b;
|
|
21833
|
+
cache.lastVisitedIndex = Math.min(cache.lastVisitedIndex, index - 1);
|
|
21834
|
+
(_a = instance.exposed) == null ? void 0 : _a.getItemStyleCache(-1);
|
|
21835
|
+
if (forceUpdate) {
|
|
21836
|
+
(_b = instance.proxy) == null ? void 0 : _b.$forceUpdate();
|
|
21837
|
+
}
|
|
21838
|
+
};
|
|
21839
|
+
return cache;
|
|
21840
|
+
},
|
|
21841
|
+
clearCache: false,
|
|
21842
|
+
validateProps: ({ itemSize }) => {
|
|
21843
|
+
}
|
|
21844
|
+
});
|
|
21845
|
+
|
|
21846
|
+
const props = {
|
|
21847
|
+
loading: Boolean,
|
|
21848
|
+
data: {
|
|
21849
|
+
type: Array,
|
|
21850
|
+
required: true
|
|
21851
|
+
},
|
|
21852
|
+
hoveringIndex: Number,
|
|
21853
|
+
width: Number
|
|
21854
|
+
};
|
|
21855
|
+
var ElSelectMenu = defineComponent({
|
|
21856
|
+
name: "ElSelectDropdown",
|
|
21857
|
+
props,
|
|
21858
|
+
setup(props2, {
|
|
21859
|
+
slots,
|
|
21860
|
+
expose
|
|
21861
|
+
}) {
|
|
21862
|
+
const select = inject(selectV2InjectionKey);
|
|
21863
|
+
const ns = useNamespace("select");
|
|
21864
|
+
const {
|
|
21865
|
+
getLabel,
|
|
21866
|
+
getValue,
|
|
21867
|
+
getDisabled
|
|
21868
|
+
} = useProps(select.props);
|
|
21869
|
+
const cachedHeights = ref([]);
|
|
21870
|
+
const listRef = ref();
|
|
21871
|
+
const size = computed(() => props2.data.length);
|
|
21872
|
+
watch(() => size.value, () => {
|
|
21873
|
+
var _a, _b;
|
|
21874
|
+
(_b = (_a = select.tooltipRef.value).updatePopper) == null ? void 0 : _b.call(_a);
|
|
21875
|
+
});
|
|
21876
|
+
const isSized = computed(() => isUndefined(select.props.estimatedOptionHeight));
|
|
21877
|
+
const listProps = computed(() => {
|
|
21878
|
+
if (isSized.value) {
|
|
21879
|
+
return {
|
|
21880
|
+
itemSize: select.props.itemHeight
|
|
21881
|
+
};
|
|
21882
|
+
}
|
|
21883
|
+
return {
|
|
21884
|
+
estimatedSize: select.props.estimatedOptionHeight,
|
|
21885
|
+
itemSize: (idx) => cachedHeights.value[idx]
|
|
21886
|
+
};
|
|
21887
|
+
});
|
|
21888
|
+
const contains = (arr = [], target) => {
|
|
21889
|
+
const {
|
|
21890
|
+
props: {
|
|
21891
|
+
valueKey
|
|
21892
|
+
}
|
|
21893
|
+
} = select;
|
|
21894
|
+
if (!isObject$1(target)) {
|
|
21895
|
+
return arr.includes(target);
|
|
21896
|
+
}
|
|
21897
|
+
return arr && arr.some((item) => {
|
|
21898
|
+
return toRaw(get(item, valueKey)) === get(target, valueKey);
|
|
21899
|
+
});
|
|
21900
|
+
};
|
|
21901
|
+
const isEqual = (selected, target) => {
|
|
21902
|
+
if (!isObject$1(target)) {
|
|
21903
|
+
return selected === target;
|
|
21904
|
+
} else {
|
|
21905
|
+
const {
|
|
21906
|
+
valueKey
|
|
21907
|
+
} = select.props;
|
|
21908
|
+
return get(selected, valueKey) === get(target, valueKey);
|
|
21909
|
+
}
|
|
21910
|
+
};
|
|
21911
|
+
const isItemSelected = (modelValue, target) => {
|
|
21912
|
+
if (select.props.multiple) {
|
|
21913
|
+
return contains(modelValue, getValue(target));
|
|
21914
|
+
}
|
|
21915
|
+
return isEqual(modelValue, getValue(target));
|
|
21916
|
+
};
|
|
21917
|
+
const isItemDisabled = (modelValue, selected) => {
|
|
21918
|
+
const {
|
|
21919
|
+
disabled,
|
|
21920
|
+
multiple,
|
|
21921
|
+
multipleLimit
|
|
21922
|
+
} = select.props;
|
|
21923
|
+
return disabled || !selected && (multiple ? multipleLimit > 0 && modelValue.length >= multipleLimit : false);
|
|
21924
|
+
};
|
|
21925
|
+
const isItemHovering = (target) => props2.hoveringIndex === target;
|
|
21926
|
+
const scrollToItem = (index) => {
|
|
21927
|
+
const list = listRef.value;
|
|
21928
|
+
if (list) {
|
|
21929
|
+
list.scrollToItem(index);
|
|
21930
|
+
}
|
|
21931
|
+
};
|
|
21932
|
+
const resetScrollTop = () => {
|
|
21933
|
+
const list = listRef.value;
|
|
21934
|
+
if (list) {
|
|
21935
|
+
list.resetScrollTop();
|
|
21936
|
+
}
|
|
21937
|
+
};
|
|
21938
|
+
const exposed = {
|
|
21939
|
+
listRef,
|
|
21940
|
+
isSized,
|
|
21941
|
+
isItemDisabled,
|
|
21942
|
+
isItemHovering,
|
|
21943
|
+
isItemSelected,
|
|
21944
|
+
scrollToItem,
|
|
21945
|
+
resetScrollTop
|
|
21946
|
+
};
|
|
21947
|
+
expose(exposed);
|
|
21948
|
+
const Item = (itemProps) => {
|
|
21949
|
+
const {
|
|
21950
|
+
index,
|
|
21951
|
+
data,
|
|
21952
|
+
style
|
|
21953
|
+
} = itemProps;
|
|
21954
|
+
const sized = unref(isSized);
|
|
21955
|
+
const {
|
|
21956
|
+
itemSize,
|
|
21957
|
+
estimatedSize
|
|
21958
|
+
} = unref(listProps);
|
|
21959
|
+
const {
|
|
21960
|
+
modelValue
|
|
21961
|
+
} = select.props;
|
|
21962
|
+
const {
|
|
21963
|
+
onSelect,
|
|
21964
|
+
onHover
|
|
21965
|
+
} = select;
|
|
21966
|
+
const item = data[index];
|
|
21967
|
+
if (item.type === "Group") {
|
|
21968
|
+
return createVNode(GroupItem, {
|
|
21969
|
+
"item": item,
|
|
21970
|
+
"style": style,
|
|
21971
|
+
"height": sized ? itemSize : estimatedSize
|
|
21972
|
+
}, null);
|
|
21973
|
+
}
|
|
21974
|
+
const isSelected = isItemSelected(modelValue, item);
|
|
21975
|
+
const isDisabled = isItemDisabled(modelValue, isSelected);
|
|
21976
|
+
const isHovering = isItemHovering(index);
|
|
21977
|
+
return createVNode(OptionItem, mergeProps(itemProps, {
|
|
21978
|
+
"selected": isSelected,
|
|
21979
|
+
"disabled": getDisabled(item) || isDisabled,
|
|
21980
|
+
"created": !!item.created,
|
|
21981
|
+
"hovering": isHovering,
|
|
21982
|
+
"item": item,
|
|
21983
|
+
"onSelect": onSelect,
|
|
21984
|
+
"onHover": onHover
|
|
21985
|
+
}), {
|
|
21986
|
+
default: (props3) => {
|
|
21987
|
+
var _a;
|
|
21988
|
+
return ((_a = slots.default) == null ? void 0 : _a.call(slots, props3)) || createVNode("span", null, [getLabel(item)]);
|
|
21989
|
+
}
|
|
21990
|
+
});
|
|
21991
|
+
};
|
|
21992
|
+
const {
|
|
21993
|
+
onKeyboardNavigate,
|
|
21994
|
+
onKeyboardSelect
|
|
21995
|
+
} = select;
|
|
21996
|
+
const onForward = () => {
|
|
21997
|
+
onKeyboardNavigate("forward");
|
|
21998
|
+
};
|
|
21999
|
+
const onBackward = () => {
|
|
22000
|
+
onKeyboardNavigate("backward");
|
|
22001
|
+
};
|
|
22002
|
+
const onKeydown = (e) => {
|
|
22003
|
+
const {
|
|
22004
|
+
code
|
|
22005
|
+
} = e;
|
|
22006
|
+
const {
|
|
22007
|
+
tab,
|
|
22008
|
+
esc,
|
|
22009
|
+
down,
|
|
22010
|
+
up,
|
|
22011
|
+
enter,
|
|
22012
|
+
numpadEnter
|
|
22013
|
+
} = EVENT_CODE;
|
|
22014
|
+
if (code !== tab) {
|
|
22015
|
+
e.preventDefault();
|
|
22016
|
+
e.stopPropagation();
|
|
22017
|
+
}
|
|
22018
|
+
switch (code) {
|
|
22019
|
+
case tab:
|
|
22020
|
+
case esc:
|
|
22021
|
+
break;
|
|
22022
|
+
case down:
|
|
22023
|
+
onForward();
|
|
22024
|
+
break;
|
|
22025
|
+
case up:
|
|
22026
|
+
onBackward();
|
|
22027
|
+
break;
|
|
22028
|
+
case enter:
|
|
22029
|
+
case numpadEnter:
|
|
22030
|
+
onKeyboardSelect();
|
|
22031
|
+
break;
|
|
22032
|
+
}
|
|
22033
|
+
};
|
|
22034
|
+
return () => {
|
|
22035
|
+
var _a, _b, _c, _d;
|
|
22036
|
+
const {
|
|
22037
|
+
data,
|
|
22038
|
+
width
|
|
22039
|
+
} = props2;
|
|
22040
|
+
const {
|
|
22041
|
+
height,
|
|
22042
|
+
multiple,
|
|
22043
|
+
scrollbarAlwaysOn
|
|
22044
|
+
} = select.props;
|
|
22045
|
+
const List = unref(isSized) ? FixedSizeList : DynamicSizeList;
|
|
22046
|
+
return createVNode("div", {
|
|
22047
|
+
"class": [ns.b("dropdown"), ns.is("multiple", multiple)],
|
|
22048
|
+
"style": {
|
|
22049
|
+
width: `${width}px`
|
|
22050
|
+
}
|
|
22051
|
+
}, [(_a = slots.header) == null ? void 0 : _a.call(slots), ((_b = slots.loading) == null ? void 0 : _b.call(slots)) || ((_c = slots.empty) == null ? void 0 : _c.call(slots)) || createVNode(List, mergeProps({
|
|
22052
|
+
"ref": listRef
|
|
22053
|
+
}, unref(listProps), {
|
|
22054
|
+
"className": ns.be("dropdown", "list"),
|
|
22055
|
+
"scrollbarAlwaysOn": scrollbarAlwaysOn,
|
|
22056
|
+
"data": data,
|
|
22057
|
+
"height": height,
|
|
22058
|
+
"width": width,
|
|
22059
|
+
"total": data.length,
|
|
22060
|
+
"onKeydown": onKeydown
|
|
22061
|
+
}), {
|
|
22062
|
+
default: (props3) => createVNode(Item, props3, null)
|
|
22063
|
+
}), (_d = slots.footer) == null ? void 0 : _d.call(slots)]);
|
|
22064
|
+
};
|
|
22065
|
+
}
|
|
22066
|
+
});
|
|
22067
|
+
|
|
22068
|
+
function useAllowCreate(props, states) {
|
|
22069
|
+
const { aliasProps, getLabel, getValue } = useProps(props);
|
|
22070
|
+
const createOptionCount = ref(0);
|
|
22071
|
+
const cachedSelectedOption = ref();
|
|
22072
|
+
const enableAllowCreateMode = computed(() => {
|
|
22073
|
+
return props.allowCreate && props.filterable;
|
|
22074
|
+
});
|
|
22075
|
+
function hasExistingOption(query) {
|
|
22076
|
+
const hasOption = (option) => getLabel(option) === query;
|
|
22077
|
+
return props.options && props.options.some(hasOption) || states.createdOptions.some(hasOption);
|
|
22078
|
+
}
|
|
22079
|
+
function selectNewOption(option) {
|
|
22080
|
+
if (!enableAllowCreateMode.value) {
|
|
22081
|
+
return;
|
|
22082
|
+
}
|
|
22083
|
+
if (props.multiple && option.created) {
|
|
22084
|
+
createOptionCount.value++;
|
|
22085
|
+
} else {
|
|
22086
|
+
cachedSelectedOption.value = option;
|
|
22087
|
+
}
|
|
22088
|
+
}
|
|
22089
|
+
function createNewOption(query) {
|
|
22090
|
+
if (enableAllowCreateMode.value) {
|
|
22091
|
+
if (query && query.length > 0) {
|
|
22092
|
+
if (hasExistingOption(query)) {
|
|
22093
|
+
return;
|
|
22094
|
+
}
|
|
22095
|
+
const newOption = {
|
|
22096
|
+
[aliasProps.value.value]: query,
|
|
22097
|
+
[aliasProps.value.label]: query,
|
|
22098
|
+
created: true,
|
|
22099
|
+
[aliasProps.value.disabled]: false
|
|
22100
|
+
};
|
|
22101
|
+
if (states.createdOptions.length >= createOptionCount.value) {
|
|
22102
|
+
states.createdOptions[createOptionCount.value] = newOption;
|
|
22103
|
+
} else {
|
|
22104
|
+
states.createdOptions.push(newOption);
|
|
22105
|
+
}
|
|
22106
|
+
} else {
|
|
22107
|
+
if (props.multiple) {
|
|
22108
|
+
states.createdOptions.length = createOptionCount.value;
|
|
22109
|
+
} else {
|
|
22110
|
+
const selectedOption = cachedSelectedOption.value;
|
|
22111
|
+
states.createdOptions.length = 0;
|
|
22112
|
+
if (selectedOption && selectedOption.created) {
|
|
22113
|
+
states.createdOptions.push(selectedOption);
|
|
22114
|
+
}
|
|
22115
|
+
}
|
|
22116
|
+
}
|
|
22117
|
+
}
|
|
22118
|
+
}
|
|
22119
|
+
function removeNewOption(option) {
|
|
22120
|
+
if (!enableAllowCreateMode.value || !option || !option.created || option.created && props.reserveKeyword && states.inputValue === getLabel(option)) {
|
|
22121
|
+
return;
|
|
22122
|
+
}
|
|
22123
|
+
const idx = states.createdOptions.findIndex((it) => getValue(it) === getValue(option));
|
|
22124
|
+
if (~idx) {
|
|
22125
|
+
states.createdOptions.splice(idx, 1);
|
|
22126
|
+
createOptionCount.value--;
|
|
22127
|
+
}
|
|
22128
|
+
}
|
|
22129
|
+
function clearAllNewOption() {
|
|
22130
|
+
if (enableAllowCreateMode.value) {
|
|
22131
|
+
states.createdOptions.length = 0;
|
|
22132
|
+
createOptionCount.value = 0;
|
|
22133
|
+
}
|
|
22134
|
+
}
|
|
22135
|
+
return {
|
|
22136
|
+
createNewOption,
|
|
22137
|
+
removeNewOption,
|
|
22138
|
+
selectNewOption,
|
|
22139
|
+
clearAllNewOption
|
|
22140
|
+
};
|
|
22141
|
+
}
|
|
22142
|
+
|
|
22143
|
+
const useSelect = (props, emit) => {
|
|
22144
|
+
const { t } = useLocale();
|
|
22145
|
+
const nsSelect = useNamespace("select");
|
|
22146
|
+
const nsInput = useNamespace("input");
|
|
22147
|
+
const { form: elForm, formItem: elFormItem } = useFormItem();
|
|
22148
|
+
const { inputId } = useFormItemInputId(props, {
|
|
22149
|
+
formItemContext: elFormItem
|
|
22150
|
+
});
|
|
22151
|
+
const { aliasProps, getLabel, getValue, getDisabled, getOptions } = useProps(props);
|
|
22152
|
+
const { valueOnClear, isEmptyValue } = useEmptyValues(props);
|
|
22153
|
+
const states = reactive({
|
|
22154
|
+
inputValue: "",
|
|
22155
|
+
cachedOptions: [],
|
|
22156
|
+
createdOptions: [],
|
|
22157
|
+
hoveringIndex: -1,
|
|
22158
|
+
inputHovering: false,
|
|
22159
|
+
selectionWidth: 0,
|
|
22160
|
+
collapseItemWidth: 0,
|
|
22161
|
+
previousQuery: null,
|
|
22162
|
+
previousValue: void 0,
|
|
22163
|
+
selectedLabel: "",
|
|
22164
|
+
menuVisibleOnFocus: false,
|
|
22165
|
+
isBeforeHide: false
|
|
22166
|
+
});
|
|
22167
|
+
const popperSize = ref(-1);
|
|
22168
|
+
const selectRef = ref();
|
|
22169
|
+
const selectionRef = ref();
|
|
22170
|
+
const tooltipRef = ref();
|
|
22171
|
+
const tagTooltipRef = ref();
|
|
22172
|
+
const inputRef = ref();
|
|
22173
|
+
const prefixRef = ref();
|
|
22174
|
+
const suffixRef = ref();
|
|
22175
|
+
const menuRef = ref();
|
|
22176
|
+
const tagMenuRef = ref();
|
|
22177
|
+
const collapseItemRef = ref();
|
|
22178
|
+
const {
|
|
22179
|
+
isComposing,
|
|
22180
|
+
handleCompositionStart,
|
|
22181
|
+
handleCompositionEnd,
|
|
22182
|
+
handleCompositionUpdate
|
|
22183
|
+
} = useComposition({
|
|
22184
|
+
afterComposition: (e) => onInput(e)
|
|
22185
|
+
});
|
|
22186
|
+
const { wrapperRef, isFocused, handleBlur } = useFocusController(inputRef, {
|
|
22187
|
+
beforeFocus() {
|
|
22188
|
+
return selectDisabled.value;
|
|
22189
|
+
},
|
|
22190
|
+
afterFocus() {
|
|
22191
|
+
if (props.automaticDropdown && !expanded.value) {
|
|
22192
|
+
expanded.value = true;
|
|
22193
|
+
states.menuVisibleOnFocus = true;
|
|
22194
|
+
}
|
|
22195
|
+
},
|
|
22196
|
+
beforeBlur(event) {
|
|
22197
|
+
var _a, _b;
|
|
22198
|
+
return ((_a = tooltipRef.value) == null ? void 0 : _a.isFocusInsideContent(event)) || ((_b = tagTooltipRef.value) == null ? void 0 : _b.isFocusInsideContent(event));
|
|
22199
|
+
},
|
|
22200
|
+
afterBlur() {
|
|
22201
|
+
expanded.value = false;
|
|
22202
|
+
states.menuVisibleOnFocus = false;
|
|
22203
|
+
}
|
|
22204
|
+
});
|
|
22205
|
+
const allOptions = ref([]);
|
|
22206
|
+
const filteredOptions = ref([]);
|
|
22207
|
+
const expanded = ref(false);
|
|
22208
|
+
const selectDisabled = computed(() => props.disabled || (elForm == null ? void 0 : elForm.disabled));
|
|
22209
|
+
const needStatusIcon = computed(() => {
|
|
22210
|
+
var _a;
|
|
22211
|
+
return (_a = elForm == null ? void 0 : elForm.statusIcon) != null ? _a : false;
|
|
22212
|
+
});
|
|
22213
|
+
const popupHeight = computed(() => {
|
|
22214
|
+
const totalHeight = filteredOptions.value.length * props.itemHeight;
|
|
22215
|
+
return totalHeight > props.height ? props.height : totalHeight;
|
|
22216
|
+
});
|
|
22217
|
+
const hasModelValue = computed(() => {
|
|
22218
|
+
return props.multiple ? isArray$1(props.modelValue) && props.modelValue.length > 0 : !isEmptyValue(props.modelValue);
|
|
22219
|
+
});
|
|
22220
|
+
const showClearBtn = computed(() => {
|
|
22221
|
+
return props.clearable && !selectDisabled.value && states.inputHovering && hasModelValue.value;
|
|
22222
|
+
});
|
|
22223
|
+
const iconComponent = computed(() => props.remote && props.filterable ? "" : arrow_down_default);
|
|
22224
|
+
const iconReverse = computed(() => iconComponent.value && nsSelect.is("reverse", expanded.value));
|
|
22225
|
+
const validateState = computed(() => (elFormItem == null ? void 0 : elFormItem.validateState) || "");
|
|
22226
|
+
const validateIcon = computed(() => {
|
|
22227
|
+
if (!validateState.value)
|
|
22228
|
+
return;
|
|
22229
|
+
return ValidateComponentsMap[validateState.value];
|
|
22230
|
+
});
|
|
22231
|
+
const debounce$1 = computed(() => props.remote ? 300 : 0);
|
|
22232
|
+
const emptyText = computed(() => {
|
|
22233
|
+
if (props.loading) {
|
|
22234
|
+
return props.loadingText || t("el.select.loading");
|
|
22235
|
+
} else {
|
|
22236
|
+
if (props.remote && !states.inputValue && allOptions.value.length === 0)
|
|
22237
|
+
return false;
|
|
22238
|
+
if (props.filterable && states.inputValue && allOptions.value.length > 0 && filteredOptions.value.length === 0) {
|
|
22239
|
+
return props.noMatchText || t("el.select.noMatch");
|
|
22240
|
+
}
|
|
22241
|
+
if (allOptions.value.length === 0) {
|
|
22242
|
+
return props.noDataText || t("el.select.noData");
|
|
22243
|
+
}
|
|
22244
|
+
}
|
|
22245
|
+
return null;
|
|
22246
|
+
});
|
|
22247
|
+
const filterOptions = (query) => {
|
|
22248
|
+
const isValidOption = (o) => {
|
|
22249
|
+
if (props.filterable && isFunction$1(props.filterMethod))
|
|
22250
|
+
return true;
|
|
22251
|
+
if (props.filterable && props.remote && isFunction$1(props.remoteMethod))
|
|
22252
|
+
return true;
|
|
22253
|
+
const regexp = new RegExp(escapeStringRegexp(query), "i");
|
|
22254
|
+
return query ? regexp.test(getLabel(o) || "") : true;
|
|
22255
|
+
};
|
|
22256
|
+
if (props.loading) {
|
|
22257
|
+
return [];
|
|
22258
|
+
}
|
|
22259
|
+
return [...states.createdOptions, ...props.options].reduce((all, item) => {
|
|
22260
|
+
const options = getOptions(item);
|
|
22261
|
+
if (isArray$1(options)) {
|
|
22262
|
+
const filtered = options.filter(isValidOption);
|
|
22263
|
+
if (filtered.length > 0) {
|
|
22264
|
+
all.push({
|
|
22265
|
+
label: getLabel(item),
|
|
22266
|
+
type: "Group"
|
|
22267
|
+
}, ...filtered);
|
|
22268
|
+
}
|
|
22269
|
+
} else if (props.remote || isValidOption(item)) {
|
|
22270
|
+
all.push(item);
|
|
22271
|
+
}
|
|
22272
|
+
return all;
|
|
22273
|
+
}, []);
|
|
22274
|
+
};
|
|
22275
|
+
const updateOptions = () => {
|
|
22276
|
+
allOptions.value = filterOptions("");
|
|
22277
|
+
filteredOptions.value = filterOptions(states.inputValue);
|
|
22278
|
+
};
|
|
22279
|
+
const allOptionsValueMap = computed(() => {
|
|
22280
|
+
const valueMap = /* @__PURE__ */ new Map();
|
|
22281
|
+
allOptions.value.forEach((option, index) => {
|
|
22282
|
+
valueMap.set(getValueKey(getValue(option)), { option, index });
|
|
22283
|
+
});
|
|
22284
|
+
return valueMap;
|
|
22285
|
+
});
|
|
22286
|
+
const filteredOptionsValueMap = computed(() => {
|
|
22287
|
+
const valueMap = /* @__PURE__ */ new Map();
|
|
22288
|
+
filteredOptions.value.forEach((option, index) => {
|
|
22289
|
+
valueMap.set(getValueKey(getValue(option)), { option, index });
|
|
22290
|
+
});
|
|
22291
|
+
return valueMap;
|
|
22292
|
+
});
|
|
22293
|
+
const optionsAllDisabled = computed(() => filteredOptions.value.every((option) => getDisabled(option)));
|
|
22294
|
+
const selectSize = useFormSize();
|
|
22295
|
+
const collapseTagSize = computed(() => selectSize.value === "small" ? "small" : "default");
|
|
22296
|
+
const calculatePopperSize = () => {
|
|
22297
|
+
var _a;
|
|
22298
|
+
if (isNumber(props.fitInputWidth)) {
|
|
22299
|
+
popperSize.value = props.fitInputWidth;
|
|
22300
|
+
return;
|
|
22301
|
+
}
|
|
22302
|
+
const width = ((_a = selectRef.value) == null ? void 0 : _a.offsetWidth) || 200;
|
|
22303
|
+
if (!props.fitInputWidth && allOptions.value.length > 0) {
|
|
22304
|
+
nextTick(() => {
|
|
22305
|
+
popperSize.value = Math.max(width, calculateLabelMaxWidth());
|
|
22306
|
+
});
|
|
22307
|
+
} else {
|
|
22308
|
+
popperSize.value = width;
|
|
22309
|
+
}
|
|
22310
|
+
};
|
|
22311
|
+
const calculateLabelMaxWidth = () => {
|
|
22312
|
+
var _a, _b;
|
|
22313
|
+
const canvas = document.createElement("canvas");
|
|
22314
|
+
const ctx = canvas.getContext("2d");
|
|
22315
|
+
const selector = nsSelect.be("dropdown", "item");
|
|
22316
|
+
const dom = ((_b = (_a = menuRef.value) == null ? void 0 : _a.listRef) == null ? void 0 : _b.innerRef) || document;
|
|
22317
|
+
const dropdownItemEl = dom.querySelector(`.${selector}`);
|
|
22318
|
+
if (dropdownItemEl === null || ctx === null)
|
|
22319
|
+
return 0;
|
|
22320
|
+
const style = getComputedStyle(dropdownItemEl);
|
|
22321
|
+
const padding = Number.parseFloat(style.paddingLeft) + Number.parseFloat(style.paddingRight);
|
|
22322
|
+
ctx.font = style.font;
|
|
22323
|
+
const maxWidth = filteredOptions.value.reduce((max, option) => {
|
|
22324
|
+
const metrics = ctx.measureText(getLabel(option));
|
|
22325
|
+
return Math.max(metrics.width, max);
|
|
22326
|
+
}, 0);
|
|
22327
|
+
return maxWidth + padding;
|
|
22328
|
+
};
|
|
22329
|
+
const getGapWidth = () => {
|
|
22330
|
+
if (!selectionRef.value)
|
|
22331
|
+
return 0;
|
|
22332
|
+
const style = window.getComputedStyle(selectionRef.value);
|
|
22333
|
+
return Number.parseFloat(style.gap || "6px");
|
|
22334
|
+
};
|
|
22335
|
+
const tagStyle = computed(() => {
|
|
22336
|
+
const gapWidth = getGapWidth();
|
|
22337
|
+
const maxWidth = collapseItemRef.value && props.maxCollapseTags === 1 ? states.selectionWidth - states.collapseItemWidth - gapWidth : states.selectionWidth;
|
|
22338
|
+
return { maxWidth: `${maxWidth}px` };
|
|
22339
|
+
});
|
|
22340
|
+
const collapseTagStyle = computed(() => {
|
|
22341
|
+
return { maxWidth: `${states.selectionWidth}px` };
|
|
22342
|
+
});
|
|
22343
|
+
const shouldShowPlaceholder = computed(() => {
|
|
22344
|
+
if (isArray$1(props.modelValue)) {
|
|
22345
|
+
return props.modelValue.length === 0 && !states.inputValue;
|
|
22346
|
+
}
|
|
22347
|
+
return props.filterable ? !states.inputValue : true;
|
|
22348
|
+
});
|
|
22349
|
+
const currentPlaceholder = computed(() => {
|
|
22350
|
+
var _a;
|
|
22351
|
+
const _placeholder = (_a = props.placeholder) != null ? _a : t("el.select.placeholder");
|
|
22352
|
+
return props.multiple || !hasModelValue.value ? _placeholder : states.selectedLabel;
|
|
22353
|
+
});
|
|
22354
|
+
const popperRef = computed(() => {
|
|
22355
|
+
var _a, _b;
|
|
22356
|
+
return (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef;
|
|
22357
|
+
});
|
|
22358
|
+
const indexRef = computed(() => {
|
|
22359
|
+
if (props.multiple) {
|
|
22360
|
+
const len = props.modelValue.length;
|
|
22361
|
+
if (props.modelValue.length > 0 && filteredOptionsValueMap.value.has(props.modelValue[len - 1])) {
|
|
22362
|
+
const { index } = filteredOptionsValueMap.value.get(props.modelValue[len - 1]);
|
|
22363
|
+
return index;
|
|
22364
|
+
}
|
|
22365
|
+
} else {
|
|
22366
|
+
if (!isEmptyValue(props.modelValue) && filteredOptionsValueMap.value.has(props.modelValue)) {
|
|
22367
|
+
const { index } = filteredOptionsValueMap.value.get(props.modelValue);
|
|
22368
|
+
return index;
|
|
22369
|
+
}
|
|
22370
|
+
}
|
|
22371
|
+
return -1;
|
|
22372
|
+
});
|
|
22373
|
+
const dropdownMenuVisible = computed({
|
|
22374
|
+
get() {
|
|
22375
|
+
return expanded.value && emptyText.value !== false;
|
|
22376
|
+
},
|
|
22377
|
+
set(val) {
|
|
22378
|
+
expanded.value = val;
|
|
22379
|
+
}
|
|
22380
|
+
});
|
|
22381
|
+
const showTagList = computed(() => {
|
|
22382
|
+
if (!props.multiple) {
|
|
22383
|
+
return [];
|
|
22384
|
+
}
|
|
22385
|
+
return props.collapseTags ? states.cachedOptions.slice(0, props.maxCollapseTags) : states.cachedOptions;
|
|
22386
|
+
});
|
|
22387
|
+
const collapseTagList = computed(() => {
|
|
22388
|
+
if (!props.multiple) {
|
|
22389
|
+
return [];
|
|
22390
|
+
}
|
|
22391
|
+
return props.collapseTags ? states.cachedOptions.slice(props.maxCollapseTags) : [];
|
|
22392
|
+
});
|
|
22393
|
+
const {
|
|
22394
|
+
createNewOption,
|
|
22395
|
+
removeNewOption,
|
|
22396
|
+
selectNewOption,
|
|
22397
|
+
clearAllNewOption
|
|
22398
|
+
} = useAllowCreate(props, states);
|
|
22399
|
+
const toggleMenu = () => {
|
|
22400
|
+
if (selectDisabled.value)
|
|
22401
|
+
return;
|
|
22402
|
+
if (states.menuVisibleOnFocus) {
|
|
22403
|
+
states.menuVisibleOnFocus = false;
|
|
22404
|
+
} else {
|
|
22405
|
+
expanded.value = !expanded.value;
|
|
22406
|
+
}
|
|
22407
|
+
};
|
|
22408
|
+
const onInputChange = () => {
|
|
22409
|
+
if (states.inputValue.length > 0 && !expanded.value) {
|
|
22410
|
+
expanded.value = true;
|
|
22411
|
+
}
|
|
22412
|
+
createNewOption(states.inputValue);
|
|
22413
|
+
handleQueryChange(states.inputValue);
|
|
22414
|
+
};
|
|
22415
|
+
const debouncedOnInputChange = debounce(onInputChange, debounce$1.value);
|
|
22416
|
+
const handleQueryChange = (val) => {
|
|
22417
|
+
if (states.previousQuery === val || isComposing.value) {
|
|
22418
|
+
return;
|
|
22419
|
+
}
|
|
22420
|
+
states.previousQuery = val;
|
|
22421
|
+
if (props.filterable && isFunction$1(props.filterMethod)) {
|
|
22422
|
+
props.filterMethod(val);
|
|
22423
|
+
} else if (props.filterable && props.remote && isFunction$1(props.remoteMethod)) {
|
|
22424
|
+
props.remoteMethod(val);
|
|
22425
|
+
}
|
|
22426
|
+
if (props.defaultFirstOption && (props.filterable || props.remote) && filteredOptions.value.length) {
|
|
22427
|
+
nextTick(checkDefaultFirstOption);
|
|
22428
|
+
} else {
|
|
22429
|
+
nextTick(updateHoveringIndex);
|
|
22430
|
+
}
|
|
22431
|
+
};
|
|
22432
|
+
const checkDefaultFirstOption = () => {
|
|
22433
|
+
const optionsInDropdown = filteredOptions.value.filter((n) => !n.disabled && n.type !== "Group");
|
|
22434
|
+
const userCreatedOption = optionsInDropdown.find((n) => n.created);
|
|
22435
|
+
const firstOriginOption = optionsInDropdown[0];
|
|
22436
|
+
states.hoveringIndex = getValueIndex(filteredOptions.value, userCreatedOption || firstOriginOption);
|
|
22437
|
+
};
|
|
22438
|
+
const emitChange = (val) => {
|
|
22439
|
+
if (!isEqual$1(props.modelValue, val)) {
|
|
22440
|
+
emit(CHANGE_EVENT, val);
|
|
22441
|
+
}
|
|
22442
|
+
};
|
|
22443
|
+
const update = (val) => {
|
|
22444
|
+
emit(UPDATE_MODEL_EVENT, val);
|
|
22445
|
+
emitChange(val);
|
|
22446
|
+
states.previousValue = props.multiple ? String(val) : val;
|
|
22447
|
+
};
|
|
22448
|
+
const getValueIndex = (arr = [], value) => {
|
|
22449
|
+
if (!isObject$1(value)) {
|
|
22450
|
+
return arr.indexOf(value);
|
|
22451
|
+
}
|
|
22452
|
+
const valueKey = props.valueKey;
|
|
22453
|
+
let index = -1;
|
|
22454
|
+
arr.some((item, i) => {
|
|
22455
|
+
if (get(item, valueKey) === get(value, valueKey)) {
|
|
22456
|
+
index = i;
|
|
22457
|
+
return true;
|
|
22458
|
+
}
|
|
22459
|
+
return false;
|
|
22460
|
+
});
|
|
22461
|
+
return index;
|
|
22462
|
+
};
|
|
22463
|
+
const getValueKey = (item) => {
|
|
22464
|
+
return isObject$1(item) ? get(item, props.valueKey) : item;
|
|
22465
|
+
};
|
|
22466
|
+
const handleResize = () => {
|
|
22467
|
+
calculatePopperSize();
|
|
22468
|
+
};
|
|
22469
|
+
const resetSelectionWidth = () => {
|
|
22470
|
+
states.selectionWidth = selectionRef.value.getBoundingClientRect().width;
|
|
22471
|
+
};
|
|
22472
|
+
const resetCollapseItemWidth = () => {
|
|
22473
|
+
states.collapseItemWidth = collapseItemRef.value.getBoundingClientRect().width;
|
|
22474
|
+
};
|
|
22475
|
+
const updateTooltip = () => {
|
|
22476
|
+
var _a, _b;
|
|
22477
|
+
(_b = (_a = tooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
|
|
22478
|
+
};
|
|
22479
|
+
const updateTagTooltip = () => {
|
|
22480
|
+
var _a, _b;
|
|
22481
|
+
(_b = (_a = tagTooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
|
|
22482
|
+
};
|
|
22483
|
+
const onSelect = (option) => {
|
|
22484
|
+
if (props.multiple) {
|
|
22485
|
+
let selectedOptions = props.modelValue.slice();
|
|
22486
|
+
const index = getValueIndex(selectedOptions, getValue(option));
|
|
22487
|
+
if (index > -1) {
|
|
22488
|
+
selectedOptions = [
|
|
22489
|
+
...selectedOptions.slice(0, index),
|
|
22490
|
+
...selectedOptions.slice(index + 1)
|
|
22491
|
+
];
|
|
22492
|
+
states.cachedOptions.splice(index, 1);
|
|
22493
|
+
removeNewOption(option);
|
|
22494
|
+
} else if (props.multipleLimit <= 0 || selectedOptions.length < props.multipleLimit) {
|
|
22495
|
+
selectedOptions = [...selectedOptions, getValue(option)];
|
|
22496
|
+
states.cachedOptions.push(option);
|
|
22497
|
+
selectNewOption(option);
|
|
22498
|
+
}
|
|
22499
|
+
update(selectedOptions);
|
|
22500
|
+
if (option.created) {
|
|
22501
|
+
handleQueryChange("");
|
|
22502
|
+
}
|
|
22503
|
+
if (props.filterable && !props.reserveKeyword) {
|
|
22504
|
+
states.inputValue = "";
|
|
22505
|
+
}
|
|
22506
|
+
} else {
|
|
22507
|
+
states.selectedLabel = getLabel(option);
|
|
22508
|
+
update(getValue(option));
|
|
22509
|
+
expanded.value = false;
|
|
22510
|
+
selectNewOption(option);
|
|
22511
|
+
if (!option.created) {
|
|
22512
|
+
clearAllNewOption();
|
|
22513
|
+
}
|
|
22514
|
+
}
|
|
22515
|
+
focus();
|
|
22516
|
+
};
|
|
22517
|
+
const deleteTag = (event, option) => {
|
|
22518
|
+
let selectedOptions = props.modelValue.slice();
|
|
22519
|
+
const index = getValueIndex(selectedOptions, getValue(option));
|
|
22520
|
+
if (index > -1 && !selectDisabled.value) {
|
|
22521
|
+
selectedOptions = [
|
|
22522
|
+
...props.modelValue.slice(0, index),
|
|
22523
|
+
...props.modelValue.slice(index + 1)
|
|
22524
|
+
];
|
|
22525
|
+
states.cachedOptions.splice(index, 1);
|
|
22526
|
+
update(selectedOptions);
|
|
22527
|
+
emit("remove-tag", getValue(option));
|
|
22528
|
+
removeNewOption(option);
|
|
22529
|
+
}
|
|
22530
|
+
event.stopPropagation();
|
|
22531
|
+
focus();
|
|
22532
|
+
};
|
|
22533
|
+
const focus = () => {
|
|
22534
|
+
var _a;
|
|
22535
|
+
(_a = inputRef.value) == null ? void 0 : _a.focus();
|
|
22536
|
+
};
|
|
22537
|
+
const blur = () => {
|
|
22538
|
+
var _a;
|
|
22539
|
+
if (expanded.value) {
|
|
22540
|
+
expanded.value = false;
|
|
22541
|
+
nextTick(() => {
|
|
22542
|
+
var _a2;
|
|
22543
|
+
return (_a2 = inputRef.value) == null ? void 0 : _a2.blur();
|
|
22544
|
+
});
|
|
22545
|
+
return;
|
|
22546
|
+
}
|
|
22547
|
+
(_a = inputRef.value) == null ? void 0 : _a.blur();
|
|
22548
|
+
};
|
|
22549
|
+
const handleEsc = () => {
|
|
22550
|
+
if (states.inputValue.length > 0) {
|
|
22551
|
+
states.inputValue = "";
|
|
22552
|
+
} else {
|
|
22553
|
+
expanded.value = false;
|
|
22554
|
+
}
|
|
22555
|
+
};
|
|
22556
|
+
const getLastNotDisabledIndex = (value) => findLastIndex(value, (it) => !states.cachedOptions.some((option) => getValue(option) === it && getDisabled(option)));
|
|
22557
|
+
const handleDel = (e) => {
|
|
22558
|
+
if (!props.multiple)
|
|
22559
|
+
return;
|
|
22560
|
+
if (e.code === EVENT_CODE.delete)
|
|
22561
|
+
return;
|
|
22562
|
+
if (states.inputValue.length === 0) {
|
|
22563
|
+
e.preventDefault();
|
|
22564
|
+
const selected = props.modelValue.slice();
|
|
22565
|
+
const lastNotDisabledIndex = getLastNotDisabledIndex(selected);
|
|
22566
|
+
if (lastNotDisabledIndex < 0)
|
|
22567
|
+
return;
|
|
22568
|
+
const removeTagValue = selected[lastNotDisabledIndex];
|
|
22569
|
+
selected.splice(lastNotDisabledIndex, 1);
|
|
22570
|
+
const option = states.cachedOptions[lastNotDisabledIndex];
|
|
22571
|
+
states.cachedOptions.splice(lastNotDisabledIndex, 1);
|
|
22572
|
+
removeNewOption(option);
|
|
22573
|
+
update(selected);
|
|
22574
|
+
emit("remove-tag", removeTagValue);
|
|
22575
|
+
}
|
|
22576
|
+
};
|
|
22577
|
+
const handleClear = () => {
|
|
22578
|
+
let emptyValue;
|
|
22579
|
+
if (isArray$1(props.modelValue)) {
|
|
22580
|
+
emptyValue = [];
|
|
22581
|
+
} else {
|
|
22582
|
+
emptyValue = valueOnClear.value;
|
|
22583
|
+
}
|
|
22584
|
+
if (props.multiple) {
|
|
22585
|
+
states.cachedOptions = [];
|
|
22586
|
+
} else {
|
|
22587
|
+
states.selectedLabel = "";
|
|
22588
|
+
}
|
|
22589
|
+
expanded.value = false;
|
|
22590
|
+
update(emptyValue);
|
|
22591
|
+
emit("clear");
|
|
22592
|
+
clearAllNewOption();
|
|
22593
|
+
focus();
|
|
22594
|
+
};
|
|
22595
|
+
const onKeyboardNavigate = (direction, hoveringIndex = void 0) => {
|
|
22596
|
+
const options = filteredOptions.value;
|
|
22597
|
+
if (!["forward", "backward"].includes(direction) || selectDisabled.value || options.length <= 0 || optionsAllDisabled.value || isComposing.value) {
|
|
22598
|
+
return;
|
|
22599
|
+
}
|
|
22600
|
+
if (!expanded.value) {
|
|
22601
|
+
return toggleMenu();
|
|
22602
|
+
}
|
|
22603
|
+
if (hoveringIndex === void 0) {
|
|
22604
|
+
hoveringIndex = states.hoveringIndex;
|
|
22605
|
+
}
|
|
22606
|
+
let newIndex = -1;
|
|
22607
|
+
if (direction === "forward") {
|
|
22608
|
+
newIndex = hoveringIndex + 1;
|
|
22609
|
+
if (newIndex >= options.length) {
|
|
22610
|
+
newIndex = 0;
|
|
22611
|
+
}
|
|
22612
|
+
} else if (direction === "backward") {
|
|
22613
|
+
newIndex = hoveringIndex - 1;
|
|
22614
|
+
if (newIndex < 0 || newIndex >= options.length) {
|
|
22615
|
+
newIndex = options.length - 1;
|
|
22616
|
+
}
|
|
22617
|
+
}
|
|
22618
|
+
const option = options[newIndex];
|
|
22619
|
+
if (getDisabled(option) || option.type === "Group") {
|
|
22620
|
+
return onKeyboardNavigate(direction, newIndex);
|
|
22621
|
+
} else {
|
|
22622
|
+
states.hoveringIndex = newIndex;
|
|
22623
|
+
scrollToItem(newIndex);
|
|
22624
|
+
}
|
|
22625
|
+
};
|
|
22626
|
+
const onKeyboardSelect = () => {
|
|
22627
|
+
if (!expanded.value) {
|
|
22628
|
+
return toggleMenu();
|
|
22629
|
+
} else if (~states.hoveringIndex && filteredOptions.value[states.hoveringIndex]) {
|
|
22630
|
+
onSelect(filteredOptions.value[states.hoveringIndex]);
|
|
22631
|
+
}
|
|
22632
|
+
};
|
|
22633
|
+
const onHoverOption = (idx) => {
|
|
22634
|
+
states.hoveringIndex = idx != null ? idx : -1;
|
|
22635
|
+
};
|
|
22636
|
+
const updateHoveringIndex = () => {
|
|
22637
|
+
if (!props.multiple) {
|
|
22638
|
+
states.hoveringIndex = filteredOptions.value.findIndex((item) => {
|
|
22639
|
+
return getValueKey(item) === getValueKey(props.modelValue);
|
|
22640
|
+
});
|
|
22641
|
+
} else {
|
|
22642
|
+
states.hoveringIndex = filteredOptions.value.findIndex((item) => props.modelValue.some((modelValue) => getValueKey(modelValue) === getValueKey(item)));
|
|
22643
|
+
}
|
|
22644
|
+
};
|
|
22645
|
+
const onInput = (event) => {
|
|
22646
|
+
states.inputValue = event.target.value;
|
|
22647
|
+
if (props.remote) {
|
|
22648
|
+
debouncedOnInputChange();
|
|
22649
|
+
} else {
|
|
22650
|
+
return onInputChange();
|
|
22651
|
+
}
|
|
22652
|
+
};
|
|
22653
|
+
const handleClickOutside = (event) => {
|
|
22654
|
+
expanded.value = false;
|
|
22655
|
+
if (isFocused.value) {
|
|
22656
|
+
const _event = new FocusEvent("focus", event);
|
|
22657
|
+
handleBlur(_event);
|
|
22658
|
+
}
|
|
22659
|
+
};
|
|
22660
|
+
const handleMenuEnter = () => {
|
|
22661
|
+
states.isBeforeHide = false;
|
|
22662
|
+
return nextTick(() => {
|
|
22663
|
+
if (~indexRef.value) {
|
|
22664
|
+
scrollToItem(states.hoveringIndex);
|
|
22665
|
+
}
|
|
22666
|
+
});
|
|
22667
|
+
};
|
|
22668
|
+
const scrollToItem = (index) => {
|
|
22669
|
+
menuRef.value.scrollToItem(index);
|
|
22670
|
+
};
|
|
22671
|
+
const getOption = (value, cachedOptions) => {
|
|
22672
|
+
const selectValue = getValueKey(value);
|
|
22673
|
+
if (allOptionsValueMap.value.has(selectValue)) {
|
|
22674
|
+
const { option } = allOptionsValueMap.value.get(selectValue);
|
|
22675
|
+
return option;
|
|
22676
|
+
}
|
|
22677
|
+
if (cachedOptions && cachedOptions.length) {
|
|
22678
|
+
const option = cachedOptions.find((option2) => getValueKey(getValue(option2)) === selectValue);
|
|
22679
|
+
if (option) {
|
|
22680
|
+
return option;
|
|
22681
|
+
}
|
|
22682
|
+
}
|
|
22683
|
+
return {
|
|
22684
|
+
[aliasProps.value.value]: value,
|
|
22685
|
+
[aliasProps.value.label]: value
|
|
22686
|
+
};
|
|
22687
|
+
};
|
|
22688
|
+
const initStates = (needUpdateSelectedLabel = false) => {
|
|
22689
|
+
if (props.multiple) {
|
|
22690
|
+
if (props.modelValue.length > 0) {
|
|
22691
|
+
const cachedOptions = states.cachedOptions.slice();
|
|
22692
|
+
states.cachedOptions.length = 0;
|
|
22693
|
+
states.previousValue = props.modelValue.toString();
|
|
22694
|
+
for (const value of props.modelValue) {
|
|
22695
|
+
const option = getOption(value, cachedOptions);
|
|
22696
|
+
states.cachedOptions.push(option);
|
|
22697
|
+
}
|
|
22698
|
+
} else {
|
|
22699
|
+
states.cachedOptions = [];
|
|
22700
|
+
states.previousValue = void 0;
|
|
22701
|
+
}
|
|
22702
|
+
} else {
|
|
22703
|
+
if (hasModelValue.value) {
|
|
22704
|
+
states.previousValue = props.modelValue;
|
|
22705
|
+
const options = filteredOptions.value;
|
|
22706
|
+
const selectedItemIndex = options.findIndex((option) => getValueKey(getValue(option)) === getValueKey(props.modelValue));
|
|
22707
|
+
if (~selectedItemIndex) {
|
|
22708
|
+
states.selectedLabel = getLabel(options[selectedItemIndex]);
|
|
22709
|
+
} else {
|
|
22710
|
+
if (!states.selectedLabel || needUpdateSelectedLabel) {
|
|
22711
|
+
states.selectedLabel = getValueKey(props.modelValue);
|
|
22712
|
+
}
|
|
22713
|
+
}
|
|
22714
|
+
} else {
|
|
22715
|
+
states.selectedLabel = "";
|
|
22716
|
+
states.previousValue = void 0;
|
|
22717
|
+
}
|
|
22718
|
+
}
|
|
22719
|
+
clearAllNewOption();
|
|
22720
|
+
calculatePopperSize();
|
|
22721
|
+
};
|
|
22722
|
+
watch(() => props.fitInputWidth, () => {
|
|
22723
|
+
calculatePopperSize();
|
|
22724
|
+
});
|
|
22725
|
+
watch(expanded, (val) => {
|
|
22726
|
+
if (val) {
|
|
22727
|
+
if (!props.persistent) {
|
|
22728
|
+
calculatePopperSize();
|
|
22729
|
+
}
|
|
22730
|
+
handleQueryChange("");
|
|
22731
|
+
} else {
|
|
22732
|
+
states.inputValue = "";
|
|
22733
|
+
states.previousQuery = null;
|
|
22734
|
+
states.isBeforeHide = true;
|
|
22735
|
+
createNewOption("");
|
|
22736
|
+
}
|
|
22737
|
+
emit("visible-change", val);
|
|
22738
|
+
});
|
|
22739
|
+
watch(() => props.modelValue, (val, oldVal) => {
|
|
22740
|
+
var _a;
|
|
22741
|
+
const isValEmpty = !val || isArray$1(val) && val.length === 0;
|
|
22742
|
+
if (isValEmpty || props.multiple && !isEqual$1(val.toString(), states.previousValue) || !props.multiple && getValueKey(val) !== getValueKey(states.previousValue)) {
|
|
22743
|
+
initStates(true);
|
|
22744
|
+
}
|
|
22745
|
+
if (!isEqual$1(val, oldVal) && props.validateEvent) {
|
|
22746
|
+
(_a = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a.call(elFormItem, "change").catch((err) => debugWarn());
|
|
22747
|
+
}
|
|
22748
|
+
}, {
|
|
22749
|
+
deep: true
|
|
22750
|
+
});
|
|
22751
|
+
watch(() => props.options, () => {
|
|
22752
|
+
const input = inputRef.value;
|
|
22753
|
+
if (!input || input && document.activeElement !== input) {
|
|
22754
|
+
initStates();
|
|
22755
|
+
}
|
|
22756
|
+
}, {
|
|
22757
|
+
deep: true,
|
|
22758
|
+
flush: "post"
|
|
22759
|
+
});
|
|
22760
|
+
watch(() => filteredOptions.value, () => {
|
|
22761
|
+
calculatePopperSize();
|
|
22762
|
+
return menuRef.value && nextTick(menuRef.value.resetScrollTop);
|
|
22763
|
+
});
|
|
22764
|
+
watchEffect(() => {
|
|
22765
|
+
if (states.isBeforeHide)
|
|
22766
|
+
return;
|
|
22767
|
+
updateOptions();
|
|
22768
|
+
});
|
|
22769
|
+
watchEffect(() => {
|
|
22770
|
+
const { valueKey, options } = props;
|
|
22771
|
+
const duplicateValue = /* @__PURE__ */ new Map();
|
|
22772
|
+
for (const item of options) {
|
|
22773
|
+
const optionValue = getValue(item);
|
|
22774
|
+
let v = optionValue;
|
|
22775
|
+
if (isObject$1(v)) {
|
|
22776
|
+
v = get(optionValue, valueKey);
|
|
22777
|
+
}
|
|
22778
|
+
if (duplicateValue.get(v)) {
|
|
22779
|
+
break;
|
|
22780
|
+
} else {
|
|
22781
|
+
duplicateValue.set(v, true);
|
|
22782
|
+
}
|
|
22783
|
+
}
|
|
22784
|
+
});
|
|
22785
|
+
onMounted(() => {
|
|
22786
|
+
initStates();
|
|
22787
|
+
});
|
|
22788
|
+
useResizeObserver(selectRef, handleResize);
|
|
22789
|
+
useResizeObserver(selectionRef, resetSelectionWidth);
|
|
22790
|
+
useResizeObserver(menuRef, updateTooltip);
|
|
22791
|
+
useResizeObserver(wrapperRef, updateTooltip);
|
|
22792
|
+
useResizeObserver(tagMenuRef, updateTagTooltip);
|
|
22793
|
+
useResizeObserver(collapseItemRef, resetCollapseItemWidth);
|
|
22794
|
+
return {
|
|
22795
|
+
inputId,
|
|
22796
|
+
collapseTagSize,
|
|
22797
|
+
currentPlaceholder,
|
|
22798
|
+
expanded,
|
|
22799
|
+
emptyText,
|
|
22800
|
+
popupHeight,
|
|
22801
|
+
debounce: debounce$1,
|
|
22802
|
+
allOptions,
|
|
22803
|
+
filteredOptions,
|
|
22804
|
+
iconComponent,
|
|
22805
|
+
iconReverse,
|
|
22806
|
+
tagStyle,
|
|
22807
|
+
collapseTagStyle,
|
|
22808
|
+
popperSize,
|
|
22809
|
+
dropdownMenuVisible,
|
|
22810
|
+
hasModelValue,
|
|
22811
|
+
shouldShowPlaceholder,
|
|
22812
|
+
selectDisabled,
|
|
22813
|
+
selectSize,
|
|
22814
|
+
needStatusIcon,
|
|
22815
|
+
showClearBtn,
|
|
22816
|
+
states,
|
|
22817
|
+
isFocused,
|
|
22818
|
+
nsSelect,
|
|
22819
|
+
nsInput,
|
|
22820
|
+
inputRef,
|
|
22821
|
+
menuRef,
|
|
22822
|
+
tagMenuRef,
|
|
22823
|
+
tooltipRef,
|
|
22824
|
+
tagTooltipRef,
|
|
22825
|
+
selectRef,
|
|
22826
|
+
wrapperRef,
|
|
22827
|
+
selectionRef,
|
|
22828
|
+
prefixRef,
|
|
22829
|
+
suffixRef,
|
|
22830
|
+
collapseItemRef,
|
|
22831
|
+
popperRef,
|
|
22832
|
+
validateState,
|
|
22833
|
+
validateIcon,
|
|
22834
|
+
showTagList,
|
|
22835
|
+
collapseTagList,
|
|
22836
|
+
debouncedOnInputChange,
|
|
22837
|
+
deleteTag,
|
|
22838
|
+
getLabel,
|
|
22839
|
+
getValue,
|
|
22840
|
+
getDisabled,
|
|
22841
|
+
getValueKey,
|
|
22842
|
+
handleClear,
|
|
22843
|
+
handleClickOutside,
|
|
22844
|
+
handleDel,
|
|
22845
|
+
handleEsc,
|
|
22846
|
+
focus,
|
|
22847
|
+
blur,
|
|
22848
|
+
handleMenuEnter,
|
|
22849
|
+
handleResize,
|
|
22850
|
+
resetSelectionWidth,
|
|
22851
|
+
updateTooltip,
|
|
22852
|
+
updateTagTooltip,
|
|
22853
|
+
updateOptions,
|
|
22854
|
+
toggleMenu,
|
|
22855
|
+
scrollTo: scrollToItem,
|
|
22856
|
+
onInput,
|
|
22857
|
+
onKeyboardNavigate,
|
|
22858
|
+
onKeyboardSelect,
|
|
22859
|
+
onSelect,
|
|
22860
|
+
onHover: onHoverOption,
|
|
22861
|
+
handleCompositionStart,
|
|
22862
|
+
handleCompositionEnd,
|
|
22863
|
+
handleCompositionUpdate
|
|
22864
|
+
};
|
|
22865
|
+
};
|
|
22866
|
+
|
|
22867
|
+
const _sfc_main$e = defineComponent({
|
|
22868
|
+
name: "ElSelectV2",
|
|
22869
|
+
components: {
|
|
22870
|
+
ElSelectMenu,
|
|
22871
|
+
ElTag,
|
|
22872
|
+
ElTooltip,
|
|
22873
|
+
ElIcon
|
|
22874
|
+
},
|
|
22875
|
+
directives: { ClickOutside },
|
|
22876
|
+
props: SelectProps,
|
|
22877
|
+
emits: selectEmits,
|
|
22878
|
+
setup(props, { emit }) {
|
|
22879
|
+
const modelValue = computed(() => {
|
|
22880
|
+
const { modelValue: rawModelValue, multiple } = props;
|
|
22881
|
+
const fallback = multiple ? [] : void 0;
|
|
22882
|
+
if (isArray$1(rawModelValue)) {
|
|
22883
|
+
return multiple ? rawModelValue : fallback;
|
|
22884
|
+
}
|
|
22885
|
+
return multiple ? fallback : rawModelValue;
|
|
22886
|
+
});
|
|
22887
|
+
const API = useSelect(reactive({
|
|
22888
|
+
...toRefs(props),
|
|
22889
|
+
modelValue
|
|
22890
|
+
}), emit);
|
|
22891
|
+
const { calculatorRef, inputStyle } = useCalcInputWidth();
|
|
22892
|
+
provide(selectV2InjectionKey, {
|
|
22893
|
+
props: reactive({
|
|
22894
|
+
...toRefs(props),
|
|
22895
|
+
height: API.popupHeight,
|
|
22896
|
+
modelValue
|
|
22897
|
+
}),
|
|
22898
|
+
expanded: API.expanded,
|
|
22899
|
+
tooltipRef: API.tooltipRef,
|
|
22900
|
+
onSelect: API.onSelect,
|
|
22901
|
+
onHover: API.onHover,
|
|
22902
|
+
onKeyboardNavigate: API.onKeyboardNavigate,
|
|
22903
|
+
onKeyboardSelect: API.onKeyboardSelect
|
|
22904
|
+
});
|
|
22905
|
+
const selectedLabel = computed(() => {
|
|
22906
|
+
if (!props.multiple) {
|
|
22907
|
+
return API.states.selectedLabel;
|
|
22908
|
+
}
|
|
22909
|
+
return API.states.cachedOptions.map((i) => i.label);
|
|
22910
|
+
});
|
|
22911
|
+
return {
|
|
22912
|
+
...API,
|
|
22913
|
+
modelValue,
|
|
22914
|
+
selectedLabel,
|
|
22915
|
+
calculatorRef,
|
|
22916
|
+
inputStyle
|
|
22917
|
+
};
|
|
22918
|
+
}
|
|
22919
|
+
});
|
|
22920
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
22921
|
+
const _component_el_tag = resolveComponent("el-tag");
|
|
22922
|
+
const _component_el_tooltip = resolveComponent("el-tooltip");
|
|
22923
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
22924
|
+
const _component_el_select_menu = resolveComponent("el-select-menu");
|
|
22925
|
+
const _directive_click_outside = resolveDirective("click-outside");
|
|
22926
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
22927
|
+
ref: "selectRef",
|
|
22928
|
+
class: normalizeClass([_ctx.nsSelect.b(), _ctx.nsSelect.m(_ctx.selectSize)]),
|
|
22929
|
+
onMouseenter: ($event) => _ctx.states.inputHovering = true,
|
|
22930
|
+
onMouseleave: ($event) => _ctx.states.inputHovering = false
|
|
22931
|
+
}, [
|
|
22932
|
+
createVNode(_component_el_tooltip, {
|
|
22933
|
+
ref: "tooltipRef",
|
|
22934
|
+
visible: _ctx.dropdownMenuVisible,
|
|
22935
|
+
teleported: _ctx.teleported,
|
|
22936
|
+
"popper-class": [_ctx.nsSelect.e("popper"), _ctx.popperClass],
|
|
22937
|
+
"gpu-acceleration": false,
|
|
22938
|
+
"stop-popper-mouse-event": false,
|
|
22939
|
+
"popper-options": _ctx.popperOptions,
|
|
22940
|
+
"fallback-placements": _ctx.fallbackPlacements,
|
|
22941
|
+
effect: _ctx.effect,
|
|
22942
|
+
placement: _ctx.placement,
|
|
22943
|
+
pure: "",
|
|
22944
|
+
transition: `${_ctx.nsSelect.namespace.value}-zoom-in-top`,
|
|
22945
|
+
trigger: "click",
|
|
22946
|
+
persistent: _ctx.persistent,
|
|
22947
|
+
"append-to": _ctx.appendTo,
|
|
22948
|
+
"show-arrow": _ctx.showArrow,
|
|
22949
|
+
offset: _ctx.offset,
|
|
22950
|
+
onBeforeShow: _ctx.handleMenuEnter,
|
|
22951
|
+
onHide: ($event) => _ctx.states.isBeforeHide = false
|
|
22952
|
+
}, {
|
|
22953
|
+
default: withCtx(() => [
|
|
22954
|
+
createElementVNode("div", {
|
|
22955
|
+
ref: "wrapperRef",
|
|
22956
|
+
class: normalizeClass([
|
|
22957
|
+
_ctx.nsSelect.e("wrapper"),
|
|
22958
|
+
_ctx.nsSelect.is("focused", _ctx.isFocused),
|
|
22959
|
+
_ctx.nsSelect.is("hovering", _ctx.states.inputHovering),
|
|
22960
|
+
_ctx.nsSelect.is("filterable", _ctx.filterable),
|
|
22961
|
+
_ctx.nsSelect.is("disabled", _ctx.selectDisabled)
|
|
22962
|
+
]),
|
|
22963
|
+
onClick: withModifiers(_ctx.toggleMenu, ["prevent"])
|
|
22964
|
+
}, [
|
|
22965
|
+
_ctx.$slots.prefix ? (openBlock(), createElementBlock("div", {
|
|
22966
|
+
key: 0,
|
|
22967
|
+
ref: "prefixRef",
|
|
22968
|
+
class: normalizeClass(_ctx.nsSelect.e("prefix"))
|
|
22969
|
+
}, [
|
|
22970
|
+
renderSlot(_ctx.$slots, "prefix")
|
|
22971
|
+
], 2)) : createCommentVNode("v-if", true),
|
|
22972
|
+
createElementVNode("div", {
|
|
22973
|
+
ref: "selectionRef",
|
|
22974
|
+
class: normalizeClass([
|
|
22975
|
+
_ctx.nsSelect.e("selection"),
|
|
22976
|
+
_ctx.nsSelect.is("near", _ctx.multiple && !_ctx.$slots.prefix && !!_ctx.modelValue.length)
|
|
22977
|
+
])
|
|
22978
|
+
}, [
|
|
22979
|
+
_ctx.multiple ? renderSlot(_ctx.$slots, "tag", { key: 0 }, () => [
|
|
22980
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.showTagList, (item) => {
|
|
22981
|
+
return openBlock(), createElementBlock("div", {
|
|
22982
|
+
key: _ctx.getValueKey(_ctx.getValue(item)),
|
|
22983
|
+
class: normalizeClass(_ctx.nsSelect.e("selected-item"))
|
|
22984
|
+
}, [
|
|
22985
|
+
createVNode(_component_el_tag, {
|
|
22986
|
+
closable: !_ctx.selectDisabled && !_ctx.getDisabled(item),
|
|
22987
|
+
size: _ctx.collapseTagSize,
|
|
22988
|
+
type: _ctx.tagType,
|
|
22989
|
+
effect: _ctx.tagEffect,
|
|
22990
|
+
"disable-transitions": "",
|
|
22991
|
+
style: normalizeStyle(_ctx.tagStyle),
|
|
22992
|
+
onClose: ($event) => _ctx.deleteTag($event, item)
|
|
22993
|
+
}, {
|
|
22994
|
+
default: withCtx(() => [
|
|
22995
|
+
createElementVNode("span", {
|
|
22996
|
+
class: normalizeClass(_ctx.nsSelect.e("tags-text"))
|
|
22997
|
+
}, [
|
|
22998
|
+
renderSlot(_ctx.$slots, "label", {
|
|
22999
|
+
label: _ctx.getLabel(item),
|
|
23000
|
+
value: _ctx.getValue(item)
|
|
23001
|
+
}, () => [
|
|
23002
|
+
createTextVNode(toDisplayString(_ctx.getLabel(item)), 1)
|
|
23003
|
+
])
|
|
23004
|
+
], 2)
|
|
23005
|
+
]),
|
|
23006
|
+
_: 2
|
|
23007
|
+
}, 1032, ["closable", "size", "type", "effect", "style", "onClose"])
|
|
23008
|
+
], 2);
|
|
23009
|
+
}), 128)),
|
|
23010
|
+
_ctx.collapseTags && _ctx.modelValue.length > _ctx.maxCollapseTags ? (openBlock(), createBlock(_component_el_tooltip, {
|
|
23011
|
+
key: 0,
|
|
23012
|
+
ref: "tagTooltipRef",
|
|
23013
|
+
disabled: _ctx.dropdownMenuVisible || !_ctx.collapseTagsTooltip,
|
|
23014
|
+
"fallback-placements": ["bottom", "top", "right", "left"],
|
|
23015
|
+
effect: _ctx.effect,
|
|
23016
|
+
placement: "bottom",
|
|
23017
|
+
teleported: _ctx.teleported
|
|
23018
|
+
}, {
|
|
23019
|
+
default: withCtx(() => [
|
|
23020
|
+
createElementVNode("div", {
|
|
23021
|
+
ref: "collapseItemRef",
|
|
23022
|
+
class: normalizeClass(_ctx.nsSelect.e("selected-item"))
|
|
23023
|
+
}, [
|
|
23024
|
+
createVNode(_component_el_tag, {
|
|
23025
|
+
closable: false,
|
|
23026
|
+
size: _ctx.collapseTagSize,
|
|
23027
|
+
type: _ctx.tagType,
|
|
23028
|
+
effect: _ctx.tagEffect,
|
|
23029
|
+
style: normalizeStyle(_ctx.collapseTagStyle),
|
|
23030
|
+
"disable-transitions": ""
|
|
23031
|
+
}, {
|
|
23032
|
+
default: withCtx(() => [
|
|
23033
|
+
createElementVNode("span", {
|
|
23034
|
+
class: normalizeClass(_ctx.nsSelect.e("tags-text"))
|
|
23035
|
+
}, " + " + toDisplayString(_ctx.modelValue.length - _ctx.maxCollapseTags), 3)
|
|
23036
|
+
]),
|
|
23037
|
+
_: 1
|
|
23038
|
+
}, 8, ["size", "type", "effect", "style"])
|
|
23039
|
+
], 2)
|
|
23040
|
+
]),
|
|
23041
|
+
content: withCtx(() => [
|
|
23042
|
+
createElementVNode("div", {
|
|
23043
|
+
ref: "tagMenuRef",
|
|
23044
|
+
class: normalizeClass(_ctx.nsSelect.e("selection"))
|
|
23045
|
+
}, [
|
|
23046
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.collapseTagList, (selected) => {
|
|
23047
|
+
return openBlock(), createElementBlock("div", {
|
|
23048
|
+
key: _ctx.getValueKey(_ctx.getValue(selected)),
|
|
23049
|
+
class: normalizeClass(_ctx.nsSelect.e("selected-item"))
|
|
23050
|
+
}, [
|
|
23051
|
+
createVNode(_component_el_tag, {
|
|
23052
|
+
class: "in-tooltip",
|
|
23053
|
+
closable: !_ctx.selectDisabled && !_ctx.getDisabled(selected),
|
|
23054
|
+
size: _ctx.collapseTagSize,
|
|
23055
|
+
type: _ctx.tagType,
|
|
23056
|
+
effect: _ctx.tagEffect,
|
|
23057
|
+
"disable-transitions": "",
|
|
23058
|
+
onClose: ($event) => _ctx.deleteTag($event, selected)
|
|
23059
|
+
}, {
|
|
23060
|
+
default: withCtx(() => [
|
|
23061
|
+
createElementVNode("span", {
|
|
23062
|
+
class: normalizeClass(_ctx.nsSelect.e("tags-text"))
|
|
23063
|
+
}, [
|
|
23064
|
+
renderSlot(_ctx.$slots, "label", {
|
|
23065
|
+
label: _ctx.getLabel(selected),
|
|
23066
|
+
value: _ctx.getValue(selected)
|
|
23067
|
+
}, () => [
|
|
23068
|
+
createTextVNode(toDisplayString(_ctx.getLabel(selected)), 1)
|
|
23069
|
+
])
|
|
23070
|
+
], 2)
|
|
23071
|
+
]),
|
|
23072
|
+
_: 2
|
|
23073
|
+
}, 1032, ["closable", "size", "type", "effect", "onClose"])
|
|
23074
|
+
], 2);
|
|
23075
|
+
}), 128))
|
|
23076
|
+
], 2)
|
|
23077
|
+
]),
|
|
23078
|
+
_: 3
|
|
23079
|
+
}, 8, ["disabled", "effect", "teleported"])) : createCommentVNode("v-if", true)
|
|
23080
|
+
]) : createCommentVNode("v-if", true),
|
|
23081
|
+
createElementVNode("div", {
|
|
23082
|
+
class: normalizeClass([
|
|
23083
|
+
_ctx.nsSelect.e("selected-item"),
|
|
23084
|
+
_ctx.nsSelect.e("input-wrapper"),
|
|
23085
|
+
_ctx.nsSelect.is("hidden", !_ctx.filterable)
|
|
23086
|
+
])
|
|
23087
|
+
}, [
|
|
23088
|
+
withDirectives(createElementVNode("input", {
|
|
23089
|
+
id: _ctx.inputId,
|
|
23090
|
+
ref: "inputRef",
|
|
23091
|
+
"onUpdate:modelValue": ($event) => _ctx.states.inputValue = $event,
|
|
23092
|
+
style: normalizeStyle(_ctx.inputStyle),
|
|
23093
|
+
autocomplete: _ctx.autocomplete,
|
|
23094
|
+
tabindex: _ctx.tabindex,
|
|
23095
|
+
"aria-autocomplete": "list",
|
|
23096
|
+
"aria-haspopup": "listbox",
|
|
23097
|
+
autocapitalize: "off",
|
|
23098
|
+
"aria-expanded": _ctx.expanded,
|
|
23099
|
+
"aria-label": _ctx.ariaLabel,
|
|
23100
|
+
class: normalizeClass([_ctx.nsSelect.e("input"), _ctx.nsSelect.is(_ctx.selectSize)]),
|
|
23101
|
+
disabled: _ctx.selectDisabled,
|
|
23102
|
+
role: "combobox",
|
|
23103
|
+
readonly: !_ctx.filterable,
|
|
23104
|
+
spellcheck: "false",
|
|
23105
|
+
type: "text",
|
|
23106
|
+
name: _ctx.name,
|
|
23107
|
+
onInput: _ctx.onInput,
|
|
23108
|
+
onCompositionstart: _ctx.handleCompositionStart,
|
|
23109
|
+
onCompositionupdate: _ctx.handleCompositionUpdate,
|
|
23110
|
+
onCompositionend: _ctx.handleCompositionEnd,
|
|
23111
|
+
onKeydown: [
|
|
23112
|
+
withKeys(withModifiers(($event) => _ctx.onKeyboardNavigate("backward"), ["stop", "prevent"]), ["up"]),
|
|
23113
|
+
withKeys(withModifiers(($event) => _ctx.onKeyboardNavigate("forward"), ["stop", "prevent"]), ["down"]),
|
|
23114
|
+
withKeys(withModifiers(_ctx.onKeyboardSelect, ["stop", "prevent"]), ["enter"]),
|
|
23115
|
+
withKeys(withModifiers(_ctx.handleEsc, ["stop", "prevent"]), ["esc"]),
|
|
23116
|
+
withKeys(withModifiers(_ctx.handleDel, ["stop"]), ["delete"])
|
|
23117
|
+
],
|
|
23118
|
+
onClick: withModifiers(_ctx.toggleMenu, ["stop"])
|
|
23119
|
+
}, null, 46, ["id", "onUpdate:modelValue", "autocomplete", "tabindex", "aria-expanded", "aria-label", "disabled", "readonly", "name", "onInput", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onKeydown", "onClick"]), [
|
|
23120
|
+
[vModelText, _ctx.states.inputValue]
|
|
23121
|
+
]),
|
|
23122
|
+
_ctx.filterable ? (openBlock(), createElementBlock("span", {
|
|
23123
|
+
key: 0,
|
|
23124
|
+
ref: "calculatorRef",
|
|
23125
|
+
"aria-hidden": "true",
|
|
23126
|
+
class: normalizeClass(_ctx.nsSelect.e("input-calculator")),
|
|
23127
|
+
textContent: toDisplayString(_ctx.states.inputValue)
|
|
23128
|
+
}, null, 10, ["textContent"])) : createCommentVNode("v-if", true)
|
|
23129
|
+
], 2),
|
|
23130
|
+
_ctx.shouldShowPlaceholder ? (openBlock(), createElementBlock("div", {
|
|
23131
|
+
key: 1,
|
|
23132
|
+
class: normalizeClass([
|
|
23133
|
+
_ctx.nsSelect.e("selected-item"),
|
|
23134
|
+
_ctx.nsSelect.e("placeholder"),
|
|
23135
|
+
_ctx.nsSelect.is("transparent", !_ctx.hasModelValue || _ctx.expanded && !_ctx.states.inputValue)
|
|
23136
|
+
])
|
|
23137
|
+
}, [
|
|
23138
|
+
_ctx.hasModelValue ? renderSlot(_ctx.$slots, "label", {
|
|
23139
|
+
key: 0,
|
|
23140
|
+
label: _ctx.currentPlaceholder,
|
|
23141
|
+
value: _ctx.modelValue
|
|
23142
|
+
}, () => [
|
|
23143
|
+
createElementVNode("span", null, toDisplayString(_ctx.currentPlaceholder), 1)
|
|
23144
|
+
]) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(_ctx.currentPlaceholder), 1))
|
|
23145
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
23146
|
+
], 2),
|
|
23147
|
+
createElementVNode("div", {
|
|
23148
|
+
ref: "suffixRef",
|
|
23149
|
+
class: normalizeClass(_ctx.nsSelect.e("suffix"))
|
|
23150
|
+
}, [
|
|
23151
|
+
_ctx.iconComponent ? withDirectives((openBlock(), createBlock(_component_el_icon, {
|
|
23152
|
+
key: 0,
|
|
23153
|
+
class: normalizeClass([_ctx.nsSelect.e("caret"), _ctx.nsInput.e("icon"), _ctx.iconReverse])
|
|
23154
|
+
}, {
|
|
23155
|
+
default: withCtx(() => [
|
|
23156
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))
|
|
23157
|
+
]),
|
|
23158
|
+
_: 1
|
|
23159
|
+
}, 8, ["class"])), [
|
|
23160
|
+
[vShow, !_ctx.showClearBtn]
|
|
23161
|
+
]) : createCommentVNode("v-if", true),
|
|
23162
|
+
_ctx.showClearBtn && _ctx.clearIcon ? (openBlock(), createBlock(_component_el_icon, {
|
|
23163
|
+
key: 1,
|
|
23164
|
+
class: normalizeClass([
|
|
23165
|
+
_ctx.nsSelect.e("caret"),
|
|
23166
|
+
_ctx.nsInput.e("icon"),
|
|
23167
|
+
_ctx.nsSelect.e("clear")
|
|
23168
|
+
]),
|
|
23169
|
+
onClick: withModifiers(_ctx.handleClear, ["prevent", "stop"])
|
|
23170
|
+
}, {
|
|
23171
|
+
default: withCtx(() => [
|
|
23172
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))
|
|
23173
|
+
]),
|
|
23174
|
+
_: 1
|
|
23175
|
+
}, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
|
|
23176
|
+
_ctx.validateState && _ctx.validateIcon && _ctx.needStatusIcon ? (openBlock(), createBlock(_component_el_icon, {
|
|
23177
|
+
key: 2,
|
|
23178
|
+
class: normalizeClass([
|
|
23179
|
+
_ctx.nsInput.e("icon"),
|
|
23180
|
+
_ctx.nsInput.e("validateIcon"),
|
|
23181
|
+
_ctx.nsInput.is("loading", _ctx.validateState === "validating")
|
|
23182
|
+
])
|
|
23183
|
+
}, {
|
|
23184
|
+
default: withCtx(() => [
|
|
23185
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.validateIcon)))
|
|
23186
|
+
]),
|
|
23187
|
+
_: 1
|
|
23188
|
+
}, 8, ["class"])) : createCommentVNode("v-if", true)
|
|
23189
|
+
], 2)
|
|
23190
|
+
], 10, ["onClick"])
|
|
23191
|
+
]),
|
|
23192
|
+
content: withCtx(() => [
|
|
23193
|
+
createVNode(_component_el_select_menu, {
|
|
23194
|
+
ref: "menuRef",
|
|
23195
|
+
data: _ctx.filteredOptions,
|
|
23196
|
+
width: _ctx.popperSize,
|
|
23197
|
+
"hovering-index": _ctx.states.hoveringIndex,
|
|
23198
|
+
"scrollbar-always-on": _ctx.scrollbarAlwaysOn
|
|
23199
|
+
}, createSlots({
|
|
23200
|
+
default: withCtx((scope) => [
|
|
23201
|
+
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(scope)))
|
|
23202
|
+
]),
|
|
23203
|
+
_: 2
|
|
23204
|
+
}, [
|
|
23205
|
+
_ctx.$slots.header ? {
|
|
23206
|
+
name: "header",
|
|
23207
|
+
fn: withCtx(() => [
|
|
23208
|
+
createElementVNode("div", {
|
|
23209
|
+
class: normalizeClass(_ctx.nsSelect.be("dropdown", "header"))
|
|
23210
|
+
}, [
|
|
23211
|
+
renderSlot(_ctx.$slots, "header")
|
|
23212
|
+
], 2)
|
|
23213
|
+
])
|
|
23214
|
+
} : void 0,
|
|
23215
|
+
_ctx.$slots.loading && _ctx.loading ? {
|
|
23216
|
+
name: "loading",
|
|
23217
|
+
fn: withCtx(() => [
|
|
23218
|
+
createElementVNode("div", {
|
|
23219
|
+
class: normalizeClass(_ctx.nsSelect.be("dropdown", "loading"))
|
|
23220
|
+
}, [
|
|
23221
|
+
renderSlot(_ctx.$slots, "loading")
|
|
23222
|
+
], 2)
|
|
23223
|
+
])
|
|
23224
|
+
} : _ctx.loading || _ctx.filteredOptions.length === 0 ? {
|
|
23225
|
+
name: "empty",
|
|
23226
|
+
fn: withCtx(() => [
|
|
23227
|
+
createElementVNode("div", {
|
|
23228
|
+
class: normalizeClass(_ctx.nsSelect.be("dropdown", "empty"))
|
|
23229
|
+
}, [
|
|
23230
|
+
renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
23231
|
+
createElementVNode("span", null, toDisplayString(_ctx.emptyText), 1)
|
|
23232
|
+
])
|
|
23233
|
+
], 2)
|
|
23234
|
+
])
|
|
23235
|
+
} : void 0,
|
|
23236
|
+
_ctx.$slots.footer ? {
|
|
23237
|
+
name: "footer",
|
|
23238
|
+
fn: withCtx(() => [
|
|
23239
|
+
createElementVNode("div", {
|
|
23240
|
+
class: normalizeClass(_ctx.nsSelect.be("dropdown", "footer"))
|
|
23241
|
+
}, [
|
|
23242
|
+
renderSlot(_ctx.$slots, "footer")
|
|
23243
|
+
], 2)
|
|
23244
|
+
])
|
|
23245
|
+
} : void 0
|
|
23246
|
+
]), 1032, ["data", "width", "hovering-index", "scrollbar-always-on"])
|
|
23247
|
+
]),
|
|
23248
|
+
_: 3
|
|
23249
|
+
}, 8, ["visible", "teleported", "popper-class", "popper-options", "fallback-placements", "effect", "placement", "transition", "persistent", "append-to", "show-arrow", "offset", "onBeforeShow", "onHide"])
|
|
23250
|
+
], 42, ["onMouseenter", "onMouseleave"])), [
|
|
23251
|
+
[_directive_click_outside, _ctx.handleClickOutside, _ctx.popperRef]
|
|
23252
|
+
]);
|
|
23253
|
+
}
|
|
23254
|
+
var Select = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render], ["__file", "select.vue"]]);
|
|
23255
|
+
|
|
23256
|
+
const ElSelectV2 = withInstall(Select);
|
|
23257
|
+
|
|
23258
|
+
const _hoisted_1$b = ["onClick"];
|
|
23259
|
+
const _hoisted_2$9 = { class: "hzzt-dropdown-name" };
|
|
23260
|
+
const _hoisted_3$6 = /* @__PURE__ */ createElementVNode("span", { class: "caret" }, null, -1);
|
|
23261
|
+
const _hoisted_4$5 = { class: "hzzt-dropdown-menu" };
|
|
23262
|
+
const _hoisted_5$3 = ["onClick"];
|
|
23263
|
+
const _hoisted_6$3 = { class: "submenu" };
|
|
23264
|
+
const _hoisted_7$3 = ["onClick"];
|
|
23265
|
+
const __default__$c = defineComponent({
|
|
23266
|
+
name: "HzztDropDown"
|
|
23267
|
+
});
|
|
23268
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
23269
|
+
...__default__$c,
|
|
23270
|
+
props: {
|
|
23271
|
+
options: {
|
|
23272
|
+
type: definePropType$1(Array),
|
|
23273
|
+
default: () => []
|
|
23274
|
+
},
|
|
23275
|
+
label: String,
|
|
23276
|
+
value: String,
|
|
23277
|
+
defaultValue: {
|
|
23278
|
+
type: Array,
|
|
23279
|
+
default: () => []
|
|
23280
|
+
},
|
|
23281
|
+
position: {
|
|
23282
|
+
type: String,
|
|
23283
|
+
default: "right"
|
|
23284
|
+
},
|
|
23285
|
+
props: {
|
|
23286
|
+
type: Object,
|
|
23287
|
+
default: () => ({
|
|
23288
|
+
children: "children",
|
|
23289
|
+
label: "label",
|
|
23290
|
+
value: "value"
|
|
23291
|
+
})
|
|
23292
|
+
},
|
|
23293
|
+
returnType: {
|
|
23294
|
+
type: String,
|
|
23295
|
+
default: "Array"
|
|
23296
|
+
}
|
|
23297
|
+
},
|
|
23298
|
+
emits: ["change"],
|
|
23299
|
+
setup(__props, { emit: emits }) {
|
|
23300
|
+
const dProps = __props;
|
|
23301
|
+
const toggle = ref(false);
|
|
23302
|
+
function dropToggle() {
|
|
23303
|
+
toggle.value = !toggle.value;
|
|
23304
|
+
}
|
|
23305
|
+
function close() {
|
|
23306
|
+
toggle.value = false;
|
|
23307
|
+
}
|
|
23308
|
+
function selectValue(val) {
|
|
23309
|
+
if (dProps.returnType === "Array") {
|
|
23310
|
+
emits("change", val);
|
|
23311
|
+
}
|
|
23312
|
+
if (dProps.returnType === "String") {
|
|
23313
|
+
emits("change", val[val.length - 1]);
|
|
23314
|
+
}
|
|
23315
|
+
}
|
|
23316
|
+
return (_ctx, _cache) => {
|
|
23317
|
+
return withDirectives((openBlock(), createElementBlock("ul", {
|
|
23318
|
+
class: "hzzt-dropdown",
|
|
23319
|
+
onClick: withModifiers(dropToggle, ["stop"])
|
|
23320
|
+
}, [
|
|
23321
|
+
createElementVNode("li", {
|
|
23322
|
+
class: normalizeClass({ "hzzt-dropdown-li": true, "hzzt-dropdown-li-show": toggle.value })
|
|
23323
|
+
}, [
|
|
23324
|
+
createElementVNode("span", _hoisted_2$9, toDisplayString(__props.label), 1),
|
|
23325
|
+
_hoisted_3$6,
|
|
23326
|
+
createElementVNode("ul", _hoisted_4$5, [
|
|
23327
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option, index) => {
|
|
23328
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
23329
|
+
unref(isEmpty)(option[__props.props.children]) ? (openBlock(), createElementBlock("li", {
|
|
23330
|
+
key: index,
|
|
23331
|
+
class: normalizeClass({
|
|
23332
|
+
"hzzt-dropdown-menu-item": true,
|
|
23333
|
+
selected: __props.defaultValue.includes(option[__props.props.value])
|
|
23334
|
+
})
|
|
23335
|
+
}, [
|
|
23336
|
+
createElementVNode("a", {
|
|
23337
|
+
class: "hzzt-dropdown-menu-item-label",
|
|
23338
|
+
onClick: ($event) => selectValue([option[__props.props.value]])
|
|
23339
|
+
}, toDisplayString(option[__props.props.label]), 9, _hoisted_5$3)
|
|
23340
|
+
], 2)) : (openBlock(), createElementBlock("li", {
|
|
20617
23341
|
key: index + "submenu",
|
|
20618
23342
|
class: "hzzt-dropdown-menu-item hzzt-dropdown-submenu"
|
|
20619
23343
|
}, [
|
|
@@ -20645,19 +23369,19 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
20645
23369
|
}), 256))
|
|
20646
23370
|
])
|
|
20647
23371
|
], 2)
|
|
20648
|
-
], 8, _hoisted_1$
|
|
23372
|
+
], 8, _hoisted_1$b)), [
|
|
20649
23373
|
[unref(ClickOutside), close]
|
|
20650
23374
|
]);
|
|
20651
23375
|
};
|
|
20652
23376
|
}
|
|
20653
23377
|
});
|
|
20654
|
-
var Dropdown = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
23378
|
+
var Dropdown = /* @__PURE__ */ _export_sfc$1(_sfc_main$d, [["__file", "index.vue"]]);
|
|
20655
23379
|
|
|
20656
23380
|
const HzztDropdown = withInstall$1(Dropdown);
|
|
20657
23381
|
|
|
20658
|
-
const _hoisted_1$
|
|
23382
|
+
const _hoisted_1$a = { class: "hzzt-collapse" };
|
|
20659
23383
|
const _hoisted_2$8 = { class: "flex align-items-center" };
|
|
20660
|
-
const _hoisted_3$
|
|
23384
|
+
const _hoisted_3$5 = { class: "hzzt-collapse-title-wrapper" };
|
|
20661
23385
|
const _hoisted_4$4 = /* @__PURE__ */ createElementVNode("div", { class: "hzzt-collapse-title-block" }, null, -1);
|
|
20662
23386
|
const _hoisted_5$2 = { class: "hzzt-collapse-title" };
|
|
20663
23387
|
const _hoisted_6$2 = /* @__PURE__ */ createElementVNode("div", { class: "hzzt-collapse-line" }, null, -1);
|
|
@@ -20665,11 +23389,11 @@ const _hoisted_7$2 = {
|
|
|
20665
23389
|
key: 0,
|
|
20666
23390
|
class: "hzzt-collapse-text"
|
|
20667
23391
|
};
|
|
20668
|
-
const __default__$
|
|
23392
|
+
const __default__$b = defineComponent({
|
|
20669
23393
|
name: "HzztCollapse"
|
|
20670
23394
|
});
|
|
20671
|
-
const _sfc_main$
|
|
20672
|
-
...__default__$
|
|
23395
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
23396
|
+
...__default__$b,
|
|
20673
23397
|
props: {
|
|
20674
23398
|
defaultActive: {
|
|
20675
23399
|
type: Boolean,
|
|
@@ -20695,13 +23419,13 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
20695
23419
|
active.value = !active.value;
|
|
20696
23420
|
}
|
|
20697
23421
|
return (_ctx, _cache) => {
|
|
20698
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
23422
|
+
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
20699
23423
|
createElementVNode("div", {
|
|
20700
23424
|
class: "hzzt-collapse-header",
|
|
20701
23425
|
onClick: toggle
|
|
20702
23426
|
}, [
|
|
20703
23427
|
createElementVNode("div", _hoisted_2$8, [
|
|
20704
|
-
createElementVNode("div", _hoisted_3$
|
|
23428
|
+
createElementVNode("div", _hoisted_3$5, [
|
|
20705
23429
|
_hoisted_4$4,
|
|
20706
23430
|
createElementVNode("div", _hoisted_5$2, toDisplayString(__props.title), 1)
|
|
20707
23431
|
]),
|
|
@@ -20715,11 +23439,11 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
20715
23439
|
};
|
|
20716
23440
|
}
|
|
20717
23441
|
});
|
|
20718
|
-
var Collapse = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
23442
|
+
var Collapse = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["__file", "collapse.vue"]]);
|
|
20719
23443
|
|
|
20720
23444
|
const HzztCollapse = withInstall$1(Collapse);
|
|
20721
23445
|
|
|
20722
|
-
const _sfc_main$
|
|
23446
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
20723
23447
|
__name: "index",
|
|
20724
23448
|
props: {
|
|
20725
23449
|
name: {
|
|
@@ -20745,11 +23469,11 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
20745
23469
|
};
|
|
20746
23470
|
}
|
|
20747
23471
|
});
|
|
20748
|
-
var HzztIcon$1 = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
23472
|
+
var HzztIcon$1 = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["__file", "index.vue"]]);
|
|
20749
23473
|
|
|
20750
|
-
const _hoisted_1$
|
|
23474
|
+
const _hoisted_1$9 = { class: "hzzt-tab flex align-items-center justify-content-between wrap" };
|
|
20751
23475
|
const _hoisted_2$7 = { class: "flex align-items-center" };
|
|
20752
|
-
const _hoisted_3$
|
|
23476
|
+
const _hoisted_3$4 = { class: "flex" };
|
|
20753
23477
|
const _hoisted_4$3 = ["onClick"];
|
|
20754
23478
|
const _hoisted_5$1 = { class: "hzzt-tab-badge" };
|
|
20755
23479
|
const _hoisted_6$1 = {
|
|
@@ -20757,11 +23481,11 @@ const _hoisted_6$1 = {
|
|
|
20757
23481
|
class: "hzzt-tab-badge-count"
|
|
20758
23482
|
};
|
|
20759
23483
|
const _hoisted_7$1 = { class: "flex wrap" };
|
|
20760
|
-
const __default__$
|
|
23484
|
+
const __default__$a = defineComponent({
|
|
20761
23485
|
name: "HzztTab"
|
|
20762
23486
|
});
|
|
20763
|
-
const _sfc_main$
|
|
20764
|
-
...__default__$
|
|
23487
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
23488
|
+
...__default__$a,
|
|
20765
23489
|
props: {
|
|
20766
23490
|
tabList: {
|
|
20767
23491
|
type: Array,
|
|
@@ -20798,9 +23522,9 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
20798
23522
|
emit("tab-close", index);
|
|
20799
23523
|
}
|
|
20800
23524
|
return (_ctx, _cache) => {
|
|
20801
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
23525
|
+
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
20802
23526
|
createElementVNode("div", _hoisted_2$7, [
|
|
20803
|
-
createElementVNode("div", _hoisted_3$
|
|
23527
|
+
createElementVNode("div", _hoisted_3$4, [
|
|
20804
23528
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(customTabList), (tab, index) => {
|
|
20805
23529
|
return openBlock(), createElementBlock("div", {
|
|
20806
23530
|
key: tab.key,
|
|
@@ -20832,7 +23556,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
20832
23556
|
};
|
|
20833
23557
|
}
|
|
20834
23558
|
});
|
|
20835
|
-
var Tab = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
23559
|
+
var Tab = /* @__PURE__ */ _export_sfc$1(_sfc_main$a, [["__file", "index.vue"]]);
|
|
20836
23560
|
|
|
20837
23561
|
const HzztTab = withInstall$1(Tab);
|
|
20838
23562
|
|
|
@@ -20848,15 +23572,15 @@ function tarnsElIconName(name) {
|
|
|
20848
23572
|
return `hzzt-el${name.replace(/[A-Z]/g, (match) => `-${match.toLocaleLowerCase()}`)}`;
|
|
20849
23573
|
}
|
|
20850
23574
|
|
|
20851
|
-
const _hoisted_1$
|
|
23575
|
+
const _hoisted_1$8 = { class: "flex justify-content-between hzzt-pagination" };
|
|
20852
23576
|
const _hoisted_2$6 = { class: "flex align-items-center font-12 hzzt-pagination-total" };
|
|
20853
|
-
const _hoisted_3$
|
|
23577
|
+
const _hoisted_3$3 = { class: "flex align-items-center hzzt-pagination-page font-14" };
|
|
20854
23578
|
const _hoisted_4$2 = { class: "flex" };
|
|
20855
|
-
const __default__$
|
|
23579
|
+
const __default__$9 = defineComponent({
|
|
20856
23580
|
name: "HzztPagination"
|
|
20857
23581
|
});
|
|
20858
|
-
const _sfc_main$
|
|
20859
|
-
...__default__$
|
|
23582
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
23583
|
+
...__default__$9,
|
|
20860
23584
|
props: {
|
|
20861
23585
|
pagination: {
|
|
20862
23586
|
type: Object,
|
|
@@ -20886,9 +23610,9 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
20886
23610
|
}
|
|
20887
23611
|
}
|
|
20888
23612
|
return (_ctx, _cache) => {
|
|
20889
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
23613
|
+
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
20890
23614
|
createElementVNode("p", _hoisted_2$6, toDisplayString(unref(t)("hzzt.pagination.total")) + toDisplayString(__props.pagination.total) + toDisplayString(unref(t)("hzzt.pagination.strip")), 1),
|
|
20891
|
-
createElementVNode("div", _hoisted_3$
|
|
23615
|
+
createElementVNode("div", _hoisted_3$3, [
|
|
20892
23616
|
renderSlot(_ctx.$slots, "right"),
|
|
20893
23617
|
createVNode(HzztIcon$1, {
|
|
20894
23618
|
class: normalizeClass(["hzzt-pagination-arrow", { active: __props.pagination.current_page > 1 }]),
|
|
@@ -20906,18 +23630,18 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
20906
23630
|
};
|
|
20907
23631
|
}
|
|
20908
23632
|
});
|
|
20909
|
-
var Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
23633
|
+
var Pagination = /* @__PURE__ */ _export_sfc$1(_sfc_main$9, [["__file", "index.vue"]]);
|
|
20910
23634
|
|
|
20911
23635
|
const HzztPagination = withInstall$1(Pagination);
|
|
20912
23636
|
|
|
20913
|
-
const _hoisted_1$
|
|
23637
|
+
const _hoisted_1$7 = { class: "flex align-content-center" };
|
|
20914
23638
|
const _hoisted_2$5 = { style: { "max-width": "300px" } };
|
|
20915
|
-
const _hoisted_3$
|
|
20916
|
-
const __default__$
|
|
23639
|
+
const _hoisted_3$2 = { style: { "padding": "0", "margin": "0", "word-break": "break-all", "white-space": "pre-wrap" } };
|
|
23640
|
+
const __default__$8 = defineComponent({
|
|
20917
23641
|
name: "HzztTooltip"
|
|
20918
23642
|
});
|
|
20919
|
-
const _sfc_main$
|
|
20920
|
-
...__default__$
|
|
23643
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
23644
|
+
...__default__$8,
|
|
20921
23645
|
props: {
|
|
20922
23646
|
content: {
|
|
20923
23647
|
type: String,
|
|
@@ -20928,12 +23652,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
20928
23652
|
setup(__props, { emit }) {
|
|
20929
23653
|
const attrs = useAttrs$1();
|
|
20930
23654
|
return (_ctx, _cache) => {
|
|
20931
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
23655
|
+
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
20932
23656
|
createVNode(unref(ElTooltip), mergeProps({ effect: "dark" }, unref(attrs)), {
|
|
20933
23657
|
content: withCtx(() => [
|
|
20934
23658
|
renderSlot(_ctx.$slots, "content", {}, () => [
|
|
20935
23659
|
createElementVNode("div", _hoisted_2$5, [
|
|
20936
|
-
createElementVNode("pre", _hoisted_3$
|
|
23660
|
+
createElementVNode("pre", _hoisted_3$2, toDisplayString(__props.content), 1)
|
|
20937
23661
|
])
|
|
20938
23662
|
])
|
|
20939
23663
|
]),
|
|
@@ -20951,11 +23675,11 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
20951
23675
|
};
|
|
20952
23676
|
}
|
|
20953
23677
|
});
|
|
20954
|
-
var Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
23678
|
+
var Tooltip = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["__file", "tooltip.vue"]]);
|
|
20955
23679
|
|
|
20956
23680
|
const HzztTooltip = withInstall$1(Tooltip);
|
|
20957
23681
|
|
|
20958
|
-
const _hoisted_1$
|
|
23682
|
+
const _hoisted_1$6 = {
|
|
20959
23683
|
key: 0,
|
|
20960
23684
|
style: { "white-space": "nowrap" }
|
|
20961
23685
|
};
|
|
@@ -20963,16 +23687,16 @@ const _hoisted_2$4 = {
|
|
|
20963
23687
|
key: 1,
|
|
20964
23688
|
style: { "white-space": "nowrap" }
|
|
20965
23689
|
};
|
|
20966
|
-
const _hoisted_3$
|
|
23690
|
+
const _hoisted_3$1 = { class: "line-height-1" };
|
|
20967
23691
|
const _hoisted_4$1 = {
|
|
20968
23692
|
key: 0,
|
|
20969
23693
|
class: "margin-l-1 margin-r-2"
|
|
20970
23694
|
};
|
|
20971
|
-
const __default__$
|
|
23695
|
+
const __default__$7 = defineComponent({
|
|
20972
23696
|
name: "HzztPageSize"
|
|
20973
23697
|
});
|
|
20974
|
-
const _sfc_main$
|
|
20975
|
-
...__default__$
|
|
23698
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
23699
|
+
...__default__$7,
|
|
20976
23700
|
props: {
|
|
20977
23701
|
modelValue: {
|
|
20978
23702
|
type: Number,
|
|
@@ -21029,13 +23753,13 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
21029
23753
|
return openBlock(), createElementBlock("main", {
|
|
21030
23754
|
class: normalizeClass([unref(compKls), "flex wrap align-items-center justify-content-end"])
|
|
21031
23755
|
}, [
|
|
21032
|
-
__props.total > 0 && !__props.isManual ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
23756
|
+
__props.total > 0 && !__props.isManual ? (openBlock(), createElementBlock("span", _hoisted_1$6, toDisplayString(unref(t)("hzzt.pageSize.total")) + toDisplayString(__props.total) + toDisplayString(unref(t)("hzzt.pageSize.strip")), 1)) : createCommentVNode("v-if", true),
|
|
21033
23757
|
__props.isManual ? (openBlock(), createElementBlock("span", _hoisted_2$4, toDisplayString(unref(t)("hzzt.pageSize.d")) + toDisplayString(__props.modelValue) + toDisplayString(unref(t)("hzzt.pageSize.page")), 1)) : createCommentVNode("v-if", true),
|
|
21034
23758
|
__props.pageSizeOptions.length ? (openBlock(), createElementBlock("div", {
|
|
21035
23759
|
key: 2,
|
|
21036
23760
|
class: normalizeClass([unref(ns).e("option"), "flex align-items-center"])
|
|
21037
23761
|
}, [
|
|
21038
|
-
createElementVNode("span", _hoisted_3$
|
|
23762
|
+
createElementVNode("span", _hoisted_3$1, toDisplayString(unref(t)("hzzt.pageSize.per_page")), 1),
|
|
21039
23763
|
createVNode(unref(ElSelect), {
|
|
21040
23764
|
modelValue: sizeValue.value,
|
|
21041
23765
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => sizeValue.value = $event),
|
|
@@ -21099,15 +23823,15 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
21099
23823
|
};
|
|
21100
23824
|
}
|
|
21101
23825
|
});
|
|
21102
|
-
var PageSize = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
23826
|
+
var PageSize = /* @__PURE__ */ _export_sfc$1(_sfc_main$7, [["__file", "index.vue"]]);
|
|
21103
23827
|
|
|
21104
23828
|
const HzztPageSize = withInstall$1(PageSize);
|
|
21105
23829
|
|
|
21106
|
-
const __default__$
|
|
23830
|
+
const __default__$6 = defineComponent({
|
|
21107
23831
|
name: "HzztConfirmPassword"
|
|
21108
23832
|
});
|
|
21109
|
-
const _sfc_main$
|
|
21110
|
-
...__default__$
|
|
23833
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
23834
|
+
...__default__$6,
|
|
21111
23835
|
props: {
|
|
21112
23836
|
placeholder: {
|
|
21113
23837
|
type: String,
|
|
@@ -21167,16 +23891,16 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
21167
23891
|
};
|
|
21168
23892
|
}
|
|
21169
23893
|
});
|
|
21170
|
-
var ConfirmPassword = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
23894
|
+
var ConfirmPassword = /* @__PURE__ */ _export_sfc$1(_sfc_main$6, [["__file", "confirm-password.vue"]]);
|
|
21171
23895
|
|
|
21172
23896
|
const HzztConfirmPassword = withInstall$1(ConfirmPassword);
|
|
21173
23897
|
|
|
21174
|
-
const _hoisted_1$
|
|
21175
|
-
const __default__$
|
|
23898
|
+
const _hoisted_1$5 = ["onClick"];
|
|
23899
|
+
const __default__$5 = defineComponent({
|
|
21176
23900
|
name: "HzztCheckButton"
|
|
21177
23901
|
});
|
|
21178
|
-
const _sfc_main$
|
|
21179
|
-
...__default__$
|
|
23902
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
23903
|
+
...__default__$5,
|
|
21180
23904
|
props: {
|
|
21181
23905
|
options: {
|
|
21182
23906
|
type: Array,
|
|
@@ -21237,7 +23961,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
21237
23961
|
...unref(spanKls)
|
|
21238
23962
|
], "flex-1"]),
|
|
21239
23963
|
onClick: ($event) => selectValue(item.value)
|
|
21240
|
-
}, toDisplayString(item.label), 11, _hoisted_1$
|
|
23964
|
+
}, toDisplayString(item.label), 11, _hoisted_1$5)
|
|
21241
23965
|
]),
|
|
21242
23966
|
_: 2
|
|
21243
23967
|
}, 1032, ["hidden", "value"]);
|
|
@@ -21246,7 +23970,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
21246
23970
|
};
|
|
21247
23971
|
}
|
|
21248
23972
|
});
|
|
21249
|
-
var CheckButton = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
23973
|
+
var CheckButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$5, [["__file", "index.vue"]]);
|
|
21250
23974
|
|
|
21251
23975
|
const HzztCheckButton = withInstall$1(CheckButton);
|
|
21252
23976
|
|
|
@@ -21487,9 +24211,9 @@ function range(n) {
|
|
|
21487
24211
|
return Array.from({ length: n }).map((_, n2) => n2);
|
|
21488
24212
|
}
|
|
21489
24213
|
|
|
21490
|
-
const _hoisted_1$
|
|
24214
|
+
const _hoisted_1$4 = { class: "el-date-picker" };
|
|
21491
24215
|
const _hoisted_2$3 = { class: "el-picker-panel__body" };
|
|
21492
|
-
const _hoisted_3
|
|
24216
|
+
const _hoisted_3 = {
|
|
21493
24217
|
class: "el-date-picker__header el-date-picker__header--bordered",
|
|
21494
24218
|
style: { "margin": "0px", "line-height": "30px" }
|
|
21495
24219
|
};
|
|
@@ -21504,11 +24228,11 @@ const _hoisted_8 = { class: "cell" };
|
|
|
21504
24228
|
const _hoisted_9 = { class: "cell" };
|
|
21505
24229
|
const _hoisted_10 = { class: "cell" };
|
|
21506
24230
|
const _hoisted_11 = { class: "cell" };
|
|
21507
|
-
const __default__$
|
|
24231
|
+
const __default__$4 = defineComponent({
|
|
21508
24232
|
name: "HzztQuarterPicker"
|
|
21509
24233
|
});
|
|
21510
|
-
const _sfc_main$
|
|
21511
|
-
...__default__$
|
|
24234
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
24235
|
+
...__default__$4,
|
|
21512
24236
|
props: {
|
|
21513
24237
|
size: useSizeProp$1,
|
|
21514
24238
|
format: {
|
|
@@ -21686,9 +24410,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
21686
24410
|
}, 16, ["disabled", "size", "placeholder", "value"])
|
|
21687
24411
|
]),
|
|
21688
24412
|
default: withCtx(() => [
|
|
21689
|
-
createElementVNode("div", _hoisted_1$
|
|
24413
|
+
createElementVNode("div", _hoisted_1$4, [
|
|
21690
24414
|
createElementVNode("div", _hoisted_2$3, [
|
|
21691
|
-
createElementVNode("div", _hoisted_3
|
|
24415
|
+
createElementVNode("div", _hoisted_3, [
|
|
21692
24416
|
createElementVNode("button", {
|
|
21693
24417
|
type: "button",
|
|
21694
24418
|
"aria-label": unref(t)(`hzzt.quarterpicker.prevYear`),
|
|
@@ -21748,7 +24472,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
21748
24472
|
};
|
|
21749
24473
|
}
|
|
21750
24474
|
});
|
|
21751
|
-
var QuarterPicker = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
24475
|
+
var QuarterPicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$4, [["__file", "index.vue"]]);
|
|
21752
24476
|
|
|
21753
24477
|
const HzztQuarterPicker = withInstall$1(QuarterPicker);
|
|
21754
24478
|
|
|
@@ -21772,7 +24496,7 @@ const scanEmits = {
|
|
|
21772
24496
|
[INPUT_EVENT$1]: (value) => isString$1(value)
|
|
21773
24497
|
};
|
|
21774
24498
|
|
|
21775
|
-
const _hoisted_1$
|
|
24499
|
+
const _hoisted_1$3 = /* @__PURE__ */ createElementVNode("div", { style: { "width": "0", "height": "0", "overflow": "hidden" } }, [
|
|
21776
24500
|
/* @__PURE__ */ createElementVNode("input", {
|
|
21777
24501
|
readonly: "",
|
|
21778
24502
|
style: { "width": "0", "height": "0", "overflow": "hidden" }
|
|
@@ -21788,12 +24512,12 @@ const _hoisted_2$2 = {
|
|
|
21788
24512
|
class: "width-100%",
|
|
21789
24513
|
style: { "overflow": "hidden" }
|
|
21790
24514
|
};
|
|
21791
|
-
const __default__$
|
|
24515
|
+
const __default__$3 = defineComponent({
|
|
21792
24516
|
inheritAttrs: false,
|
|
21793
24517
|
name: "HzztScan"
|
|
21794
24518
|
});
|
|
21795
|
-
const _sfc_main$
|
|
21796
|
-
...__default__$
|
|
24519
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
24520
|
+
...__default__$3,
|
|
21797
24521
|
props: scanProps,
|
|
21798
24522
|
emits: scanEmits,
|
|
21799
24523
|
setup(__props, { expose, emit }) {
|
|
@@ -21872,7 +24596,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
21872
24596
|
class: normalizeClass(["hzzt-scan", _ctx.$attrs.class]),
|
|
21873
24597
|
style: normalizeStyle([{ "position": "relative" }, _ctx.$attrs.style])
|
|
21874
24598
|
}, [
|
|
21875
|
-
_hoisted_1$
|
|
24599
|
+
_hoisted_1$3,
|
|
21876
24600
|
createVNode(unref(ElInput), mergeProps({
|
|
21877
24601
|
ref_key: "inputRef",
|
|
21878
24602
|
ref: inputRef,
|
|
@@ -21912,7 +24636,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
21912
24636
|
};
|
|
21913
24637
|
}
|
|
21914
24638
|
});
|
|
21915
|
-
var Scan = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
24639
|
+
var Scan = /* @__PURE__ */ _export_sfc$1(_sfc_main$3, [["__file", "scan.vue"]]);
|
|
21916
24640
|
|
|
21917
24641
|
const HzztScan = withInstall$1(Scan);
|
|
21918
24642
|
|
|
@@ -21956,13 +24680,13 @@ const selectInputEmits = {
|
|
|
21956
24680
|
change: (value) => isString$1(value)
|
|
21957
24681
|
};
|
|
21958
24682
|
|
|
21959
|
-
const _hoisted_1$
|
|
24683
|
+
const _hoisted_1$2 = { slot: "append" };
|
|
21960
24684
|
const _hoisted_2$1 = { key: 0 };
|
|
21961
|
-
const __default__$
|
|
24685
|
+
const __default__$2 = defineComponent({
|
|
21962
24686
|
name: "HzztSelectInput"
|
|
21963
24687
|
});
|
|
21964
|
-
const _sfc_main$
|
|
21965
|
-
...__default__$
|
|
24688
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
24689
|
+
...__default__$2,
|
|
21966
24690
|
props: selectInputProps,
|
|
21967
24691
|
emits: selectInputEmits,
|
|
21968
24692
|
setup(__props, { emit }) {
|
|
@@ -22033,7 +24757,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
22033
24757
|
class: normalizeClass(unref(inputContainerCls))
|
|
22034
24758
|
}, [
|
|
22035
24759
|
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
22036
|
-
createVNode(
|
|
24760
|
+
createVNode(HzztTitle$1, { label: _ctx.label }, null, 8, ["label"])
|
|
22037
24761
|
]),
|
|
22038
24762
|
createVNode(unref(ElInput), mergeProps({
|
|
22039
24763
|
ref: "inputRef",
|
|
@@ -22045,7 +24769,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
22045
24769
|
onChange: change
|
|
22046
24770
|
}), {
|
|
22047
24771
|
default: withCtx(() => [
|
|
22048
|
-
createElementVNode("template", _hoisted_1$
|
|
24772
|
+
createElementVNode("template", _hoisted_1$2, [
|
|
22049
24773
|
renderSlot(_ctx.$slots, "append")
|
|
22050
24774
|
])
|
|
22051
24775
|
]),
|
|
@@ -22071,56 +24795,223 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
22071
24795
|
};
|
|
22072
24796
|
}
|
|
22073
24797
|
});
|
|
22074
|
-
var SelectInput = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
24798
|
+
var SelectInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$2, [["__file", "select-input.vue"]]);
|
|
22075
24799
|
|
|
22076
24800
|
const HzztSelectInput = withInstall$1(SelectInput);
|
|
22077
24801
|
|
|
22078
|
-
const
|
|
22079
|
-
|
|
22080
|
-
|
|
22081
|
-
|
|
22082
|
-
|
|
22083
|
-
|
|
22084
|
-
|
|
24802
|
+
const selectTextareaProps = buildProps$1({
|
|
24803
|
+
size: useSizeProp$1,
|
|
24804
|
+
disabled: Boolean,
|
|
24805
|
+
label: String,
|
|
24806
|
+
data: {
|
|
24807
|
+
type: definePropType$1(Array),
|
|
24808
|
+
default: () => []
|
|
24809
|
+
},
|
|
24810
|
+
inputProps: Object,
|
|
24811
|
+
replace: Boolean,
|
|
24812
|
+
modelValue: {
|
|
24813
|
+
type: definePropType$1([
|
|
24814
|
+
String,
|
|
24815
|
+
Number
|
|
24816
|
+
]),
|
|
24817
|
+
default: ""
|
|
24818
|
+
}
|
|
24819
|
+
});
|
|
24820
|
+
const selectTextareaEmits = {
|
|
24821
|
+
[UPDATE_MODEL_EVENT$1]: (val) => isString$1(val) || isNumber$1(val) || isBoolean$1(val),
|
|
24822
|
+
[CHANGE_EVENT$1]: (val) => isString$1(val) || isNumber$1(val) || isBoolean$1(val),
|
|
24823
|
+
[INPUT_EVENT$1]: (val) => isString$1(val) || isNumber$1(val) || isBoolean$1(val),
|
|
24824
|
+
select: (val) => isString$1(val) || isNumber$1(val) || isBoolean$1(val)
|
|
22085
24825
|
};
|
|
22086
|
-
|
|
22087
|
-
const
|
|
22088
|
-
|
|
24826
|
+
|
|
24827
|
+
const _hoisted_1$1 = { class: "flex column" };
|
|
24828
|
+
const _hoisted_2 = { class: "flex align-items-center" };
|
|
24829
|
+
const __default__$1 = defineComponent({
|
|
24830
|
+
name: "HzztSelectTextarea"
|
|
22089
24831
|
});
|
|
22090
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
22091
|
-
...__default__,
|
|
22092
|
-
props:
|
|
22093
|
-
|
|
24832
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
24833
|
+
...__default__$1,
|
|
24834
|
+
props: selectTextareaProps,
|
|
24835
|
+
emits: selectTextareaEmits,
|
|
24836
|
+
setup(__props, { emit }) {
|
|
22094
24837
|
const props = __props;
|
|
22095
|
-
const
|
|
22096
|
-
const
|
|
22097
|
-
|
|
22098
|
-
|
|
24838
|
+
const inputVal = ref(props.modelValue);
|
|
24839
|
+
const selectValue = ref("");
|
|
24840
|
+
const inputRef = ref();
|
|
24841
|
+
const nsInput = useNamespace$1("select-textarea");
|
|
24842
|
+
const formSize = useFormSize();
|
|
24843
|
+
const formDisabled = useFormDisabled();
|
|
24844
|
+
const trueSize = computed(() => props.size || formSize.value || useGlobalSize$1().value);
|
|
24845
|
+
const trueDisabled = computed(() => props.disabled || formDisabled.value);
|
|
24846
|
+
const containerCls = computed(() => [
|
|
24847
|
+
nsInput.b(),
|
|
24848
|
+
nsInput.m(trueSize.value)
|
|
24849
|
+
]);
|
|
24850
|
+
const _inputProps = computed(() => ({
|
|
24851
|
+
disabled: trueDisabled.value,
|
|
24852
|
+
clearable: true,
|
|
24853
|
+
...props.inputProps,
|
|
24854
|
+
type: "textarea"
|
|
24855
|
+
}));
|
|
24856
|
+
watch(() => props.modelValue, (v) => {
|
|
24857
|
+
inputVal.value = v;
|
|
22099
24858
|
});
|
|
24859
|
+
function input(val) {
|
|
24860
|
+
emit("update:modelValue", val);
|
|
24861
|
+
emit("input", val);
|
|
24862
|
+
}
|
|
24863
|
+
function change(val) {
|
|
24864
|
+
emit("change", val);
|
|
24865
|
+
}
|
|
24866
|
+
function selectChange(val) {
|
|
24867
|
+
if (!inputVal.value && inputVal.value !== 0)
|
|
24868
|
+
inputVal.value = "";
|
|
24869
|
+
let content = val;
|
|
24870
|
+
if (!props.replace) {
|
|
24871
|
+
const inputEl = inputRef.value.$el.getElementsByTagName("textarea")[0];
|
|
24872
|
+
content = insertCursorPosition(inputEl, val);
|
|
24873
|
+
}
|
|
24874
|
+
input(content);
|
|
24875
|
+
change(content);
|
|
24876
|
+
emit("select", val);
|
|
24877
|
+
}
|
|
22100
24878
|
return (_ctx, _cache) => {
|
|
22101
|
-
return
|
|
22102
|
-
|
|
22103
|
-
|
|
22104
|
-
createElementVNode("
|
|
22105
|
-
|
|
22106
|
-
|
|
22107
|
-
|
|
24879
|
+
return openBlock(), createElementBlock("div", {
|
|
24880
|
+
class: normalizeClass(unref(containerCls))
|
|
24881
|
+
}, [
|
|
24882
|
+
createElementVNode("div", _hoisted_1$1, [
|
|
24883
|
+
createElementVNode("div", _hoisted_2, [
|
|
24884
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
24885
|
+
createVNode(HzztTitle$1, {
|
|
24886
|
+
class: "margin-l-1",
|
|
24887
|
+
label: _ctx.label
|
|
24888
|
+
}, null, 8, ["label"])
|
|
24889
|
+
]),
|
|
24890
|
+
!unref(trueDisabled) ? (openBlock(), createBlock(unref(ElSelectV2), {
|
|
24891
|
+
key: 0,
|
|
24892
|
+
class: "flex-1",
|
|
24893
|
+
modelValue: selectValue.value,
|
|
24894
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectValue.value = $event),
|
|
24895
|
+
"allow-create": "",
|
|
24896
|
+
filterable: "",
|
|
24897
|
+
clearable: "",
|
|
24898
|
+
onChange: selectChange,
|
|
24899
|
+
options: _ctx.data
|
|
24900
|
+
}, null, 8, ["modelValue", "options"])) : createCommentVNode("v-if", true),
|
|
24901
|
+
renderSlot(_ctx.$slots, "right")
|
|
24902
|
+
]),
|
|
24903
|
+
createVNode(unref(ElInput), mergeProps({
|
|
24904
|
+
ref_key: "inputRef",
|
|
24905
|
+
ref: inputRef,
|
|
24906
|
+
class: "flex-1 margin-t-1",
|
|
24907
|
+
modelValue: inputVal.value,
|
|
24908
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => inputVal.value = $event)
|
|
24909
|
+
}, unref(_inputProps), {
|
|
24910
|
+
onInput: input,
|
|
24911
|
+
onChange: change
|
|
24912
|
+
}), null, 16, ["modelValue"])
|
|
22108
24913
|
])
|
|
22109
|
-
]
|
|
24914
|
+
], 2);
|
|
22110
24915
|
};
|
|
22111
24916
|
}
|
|
22112
24917
|
});
|
|
22113
|
-
var
|
|
24918
|
+
var SelectTextarea = /* @__PURE__ */ _export_sfc$1(_sfc_main$1, [["__file", "select-textarea.vue"]]);
|
|
22114
24919
|
|
|
22115
|
-
const
|
|
22116
|
-
|
|
22117
|
-
|
|
24920
|
+
const HzztSelectTextarea = withInstall$1(SelectTextarea);
|
|
24921
|
+
|
|
24922
|
+
const inputRangeProps = buildProps$1({
|
|
24923
|
+
modelValue: {
|
|
24924
|
+
type: Array,
|
|
24925
|
+
default: () => []
|
|
24926
|
+
},
|
|
24927
|
+
size: useSizeProp$1,
|
|
24928
|
+
disabled: Boolean,
|
|
24929
|
+
clearable: {
|
|
22118
24930
|
type: Boolean,
|
|
22119
|
-
default:
|
|
24931
|
+
default: false
|
|
24932
|
+
},
|
|
24933
|
+
startPlaceholder: String,
|
|
24934
|
+
endPlaceholder: String,
|
|
24935
|
+
startProps: Object,
|
|
24936
|
+
endProps: Object
|
|
24937
|
+
});
|
|
24938
|
+
const inputRangeEmits = {
|
|
24939
|
+
[UPDATE_MODEL_EVENT$1]: (val) => isArray$1(val),
|
|
24940
|
+
[CHANGE_EVENT$1]: (val) => isArray$1(val)
|
|
24941
|
+
};
|
|
24942
|
+
|
|
24943
|
+
const _hoisted_1 = /* @__PURE__ */ createElementVNode("span", { class: "margin-h-1" }, "\u2014\u2014", -1);
|
|
24944
|
+
const __default__ = defineComponent({
|
|
24945
|
+
name: "HzztInputRange"
|
|
24946
|
+
});
|
|
24947
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
24948
|
+
...__default__,
|
|
24949
|
+
props: inputRangeProps,
|
|
24950
|
+
emits: inputRangeEmits,
|
|
24951
|
+
setup(__props, { emit }) {
|
|
24952
|
+
const props = __props;
|
|
24953
|
+
const startValue = ref(props.modelValue[0]);
|
|
24954
|
+
const endValue = ref(props.modelValue[1]);
|
|
24955
|
+
const nsInput = useNamespace$1("input-range");
|
|
24956
|
+
const formSize = useFormSize();
|
|
24957
|
+
const formDisabled = useFormDisabled();
|
|
24958
|
+
const trueSize = computed(() => props.size || formSize.value || useGlobalSize$1().value);
|
|
24959
|
+
const trueDisabled = computed(() => props.disabled || formDisabled.value);
|
|
24960
|
+
const containerCls = computed(() => [
|
|
24961
|
+
nsInput.b(),
|
|
24962
|
+
nsInput.m(trueSize.value)
|
|
24963
|
+
]);
|
|
24964
|
+
watch(() => props.modelValue, (v) => {
|
|
24965
|
+
startValue.value = v[0];
|
|
24966
|
+
endValue.value = v[1];
|
|
24967
|
+
}, {
|
|
24968
|
+
deep: true
|
|
24969
|
+
});
|
|
24970
|
+
function change() {
|
|
24971
|
+
if (startValue.value && endValue.value) {
|
|
24972
|
+
const modelValue = [startValue.value, endValue.value];
|
|
24973
|
+
emit("update:modelValue", modelValue);
|
|
24974
|
+
emit("change", modelValue);
|
|
24975
|
+
} else if (!startValue.value && !endValue.value) {
|
|
24976
|
+
emit("update:modelValue", []);
|
|
24977
|
+
emit("change", []);
|
|
24978
|
+
}
|
|
24979
|
+
}
|
|
24980
|
+
return (_ctx, _cache) => {
|
|
24981
|
+
const _component_el_input = resolveComponent("el-input");
|
|
24982
|
+
return openBlock(), createElementBlock("div", {
|
|
24983
|
+
class: normalizeClass(["flex align-items-center", unref(containerCls)])
|
|
24984
|
+
}, [
|
|
24985
|
+
createVNode(_component_el_input, mergeProps({
|
|
24986
|
+
modelValue: startValue.value,
|
|
24987
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => startValue.value = $event)
|
|
24988
|
+
}, _ctx.startProps, {
|
|
24989
|
+
clearable: _ctx.clearable,
|
|
24990
|
+
placeholder: _ctx.startPlaceholder,
|
|
24991
|
+
size: unref(trueSize),
|
|
24992
|
+
disabled: unref(trueDisabled),
|
|
24993
|
+
class: "flex-1",
|
|
24994
|
+
onChange: change
|
|
24995
|
+
}), null, 16, ["modelValue", "clearable", "placeholder", "size", "disabled"]),
|
|
24996
|
+
_hoisted_1,
|
|
24997
|
+
createVNode(_component_el_input, mergeProps({
|
|
24998
|
+
modelValue: endValue.value,
|
|
24999
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => endValue.value = $event)
|
|
25000
|
+
}, _ctx.endProps, {
|
|
25001
|
+
clearable: _ctx.clearable,
|
|
25002
|
+
placeholder: _ctx.endPlaceholder,
|
|
25003
|
+
size: unref(trueSize),
|
|
25004
|
+
disabled: unref(trueDisabled),
|
|
25005
|
+
class: "flex-1",
|
|
25006
|
+
onChange: change
|
|
25007
|
+
}), null, 16, ["modelValue", "clearable", "placeholder", "size", "disabled"])
|
|
25008
|
+
], 2);
|
|
25009
|
+
};
|
|
22120
25010
|
}
|
|
22121
25011
|
});
|
|
25012
|
+
var InputRange = /* @__PURE__ */ _export_sfc$1(_sfc_main, [["__file", "input-range.vue"]]);
|
|
22122
25013
|
|
|
22123
|
-
const
|
|
25014
|
+
const HzztInputRange = withInstall$1(InputRange);
|
|
22124
25015
|
|
|
22125
25016
|
var Components = [
|
|
22126
25017
|
HzztConfigProvider,
|
|
@@ -22136,7 +25027,9 @@ var Components = [
|
|
|
22136
25027
|
HzztCheckButton,
|
|
22137
25028
|
HzztQuarterPicker,
|
|
22138
25029
|
HzztScan,
|
|
22139
|
-
HzztSelectInput
|
|
25030
|
+
HzztSelectInput,
|
|
25031
|
+
HzztSelectTextarea,
|
|
25032
|
+
HzztInputRange
|
|
22140
25033
|
];
|
|
22141
25034
|
|
|
22142
25035
|
var Plugins = [];
|
|
@@ -22348,4 +25241,4 @@ function initMouseEvent(el, callback) {
|
|
|
22348
25241
|
const install = installer.install;
|
|
22349
25242
|
const version = installer.version;
|
|
22350
25243
|
|
|
22351
|
-
export { Blur, CHANGE_EVENT$1 as CHANGE_EVENT, Download, Drag, Height, Highlight, HzztCheckButton, HzztCollapse, HzztConfigProvider, HzztConfirmPassword, HzztDropdown, HzztIcon, HzztPageSize, HzztPagination, HzztQuarterPicker, HzztScan, HzztSelectInput, HzztTab, HzztTitle, HzztTooltip, INPUT_EVENT$1 as INPUT_EVENT, INSTALLED_KEY, SIZE_INJECTION_KEY$1 as SIZE_INJECTION_KEY, UPDATE_MODEL_EVENT$1 as UPDATE_MODEL_EVENT, WEEK_DAYS, buildLocaleContext$1 as buildLocaleContext, buildTranslator$1 as buildTranslator, componentSizeMap, componentSizes$1 as componentSizes, configProviderContextKey$1 as configProviderContextKey, configProviderProps, datePickTypes, installer as default, defaultNamespace$1 as defaultNamespace, install, localeContextKey$1 as localeContextKey, makeInstaller, namespaceContextKey$1 as namespaceContextKey, numberToLetter, provideGlobalConfig, scanEmits, scanProps, selectInputEmits, selectInputProps, titleProps, translate$1 as translate, useGetDerivedNamespace$1 as useGetDerivedNamespace, useGlobalConfig$1 as useGlobalConfig, useGlobalSize$1 as useGlobalSize, useLocale$1 as useLocale, useNamespace$1 as useNamespace, useSizeProp$1 as useSizeProp, useSizeProps, version };
|
|
25244
|
+
export { Blur, CHANGE_EVENT$1 as CHANGE_EVENT, Download, Drag, Height, Highlight, HzztCheckButton, HzztCollapse, HzztConfigProvider, HzztConfirmPassword, HzztDropdown, HzztIcon, HzztInputRange, HzztPageSize, HzztPagination, HzztQuarterPicker, HzztScan, HzztSelectInput, HzztSelectTextarea, HzztTab, HzztTitle, HzztTooltip, INPUT_EVENT$1 as INPUT_EVENT, INSTALLED_KEY, SIZE_INJECTION_KEY$1 as SIZE_INJECTION_KEY, UPDATE_MODEL_EVENT$1 as UPDATE_MODEL_EVENT, WEEK_DAYS, buildLocaleContext$1 as buildLocaleContext, buildTranslator$1 as buildTranslator, componentSizeMap, componentSizes$1 as componentSizes, configProviderContextKey$1 as configProviderContextKey, configProviderProps, datePickTypes, installer as default, defaultNamespace$1 as defaultNamespace, inputRangeEmits, inputRangeProps, insertCursorPosition, install, localeContextKey$1 as localeContextKey, makeInstaller, namespaceContextKey$1 as namespaceContextKey, numberToLetter, provideGlobalConfig, scanEmits, scanProps, selectInputEmits, selectInputProps, selectTextareaEmits, selectTextareaProps, titleProps, translate$1 as translate, useGetDerivedNamespace$1 as useGetDerivedNamespace, useGlobalConfig$1 as useGlobalConfig, useGlobalSize$1 as useGlobalSize, useLocale$1 as useLocale, useNamespace$1 as useNamespace, useSizeProp$1 as useSizeProp, useSizeProps, version };
|