hzzt-plus 1.0.1 → 1.0.2
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 +3080 -279
- 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 +3078 -281
- 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 +3 -1
- package/es/component.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 +1 -0
- package/es/components/index.mjs +2 -0
- package/es/components/index.mjs.map +1 -1
- 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-textarea/index.d.ts +13076 -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 +35 -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 +3 -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 +1 -0
- package/lib/component.js +3 -1
- package/lib/component.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 +1 -0
- package/lib/components/index.js +5 -0
- package/lib/components/index.js.map +1 -1
- 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-textarea/index.d.ts +13076 -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 +40 -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 +35 -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-select-textarea.css +0 -0
- package/theme/src/index.scss +1 -0
- package/theme/src/select-textarea.scss +0 -0
- package/web-types.json +692 -0
package/dist/index.full.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Hzzt Plus
|
|
1
|
+
/*! Hzzt Plus v1.0.2 */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
|
|
@@ -4335,7 +4335,7 @@
|
|
|
4335
4335
|
return true;
|
|
4336
4336
|
}
|
|
4337
4337
|
|
|
4338
|
-
function isEqual(value, other) {
|
|
4338
|
+
function isEqual$1(value, other) {
|
|
4339
4339
|
return baseIsEqual(value, other);
|
|
4340
4340
|
}
|
|
4341
4341
|
|
|
@@ -6346,7 +6346,7 @@
|
|
|
6346
6346
|
isDate,
|
|
6347
6347
|
isElement: isElement$1,
|
|
6348
6348
|
isEmpty: isEmpty$1,
|
|
6349
|
-
isEqual,
|
|
6349
|
+
isEqual: isEqual$1,
|
|
6350
6350
|
isEqualWith,
|
|
6351
6351
|
isError,
|
|
6352
6352
|
isFinite,
|
|
@@ -12846,6 +12846,18 @@
|
|
|
12846
12846
|
}
|
|
12847
12847
|
}
|
|
12848
12848
|
|
|
12849
|
+
function insertCursorPosition(inputEl, content) {
|
|
12850
|
+
const startPos = inputEl.selectionStart || 0;
|
|
12851
|
+
const endPos = inputEl.selectionEnd || 0;
|
|
12852
|
+
const restoreTop = inputEl.scrollTop;
|
|
12853
|
+
inputEl.value = inputEl.value.substring(0, startPos) + content + inputEl.value.substring(endPos, inputEl.value.length);
|
|
12854
|
+
inputEl.focus();
|
|
12855
|
+
inputEl.scrollTop = restoreTop;
|
|
12856
|
+
inputEl.selectionStart = startPos + content.length;
|
|
12857
|
+
inputEl.selectionEnd = startPos + content.length;
|
|
12858
|
+
return inputEl.value;
|
|
12859
|
+
}
|
|
12860
|
+
|
|
12849
12861
|
const configProviderContextKey$1 = Symbol();
|
|
12850
12862
|
|
|
12851
12863
|
const globalConfig$1 = vue.ref();
|
|
@@ -12920,7 +12932,7 @@
|
|
|
12920
12932
|
|
|
12921
12933
|
const HzztConfigProvider = withInstall$1(ConfigProvider$1);
|
|
12922
12934
|
|
|
12923
|
-
const version$1 = "
|
|
12935
|
+
const version$1 = "1.0.2";
|
|
12924
12936
|
|
|
12925
12937
|
const makeInstaller = (components = []) => {
|
|
12926
12938
|
const install = (app, options) => {
|
|
@@ -12937,6 +12949,61 @@
|
|
|
12937
12949
|
};
|
|
12938
12950
|
};
|
|
12939
12951
|
|
|
12952
|
+
const titleProps = buildProps$1({
|
|
12953
|
+
label: String,
|
|
12954
|
+
sideline: {
|
|
12955
|
+
type: Boolean,
|
|
12956
|
+
default: true
|
|
12957
|
+
}
|
|
12958
|
+
});
|
|
12959
|
+
|
|
12960
|
+
var _export_sfc$1 = (sfc, props) => {
|
|
12961
|
+
const target = sfc.__vccOpts || sfc;
|
|
12962
|
+
for (const [key, val] of props) {
|
|
12963
|
+
target[key] = val;
|
|
12964
|
+
}
|
|
12965
|
+
return target;
|
|
12966
|
+
};
|
|
12967
|
+
|
|
12968
|
+
const _hoisted_1$b = {
|
|
12969
|
+
key: 0,
|
|
12970
|
+
class: "hzzt-title flex align-items-center"
|
|
12971
|
+
};
|
|
12972
|
+
const _hoisted_2$a = {
|
|
12973
|
+
key: 0,
|
|
12974
|
+
class: "decorative-line"
|
|
12975
|
+
};
|
|
12976
|
+
const _hoisted_3$7 = { class: "label-name" };
|
|
12977
|
+
const __default__$s = vue.defineComponent({
|
|
12978
|
+
name: "HzztTitle"
|
|
12979
|
+
});
|
|
12980
|
+
const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
|
|
12981
|
+
...__default__$s,
|
|
12982
|
+
props: titleProps,
|
|
12983
|
+
setup(__props) {
|
|
12984
|
+
const props = __props;
|
|
12985
|
+
const slots = vue.useSlots();
|
|
12986
|
+
const showLabel = vue.computed(() => {
|
|
12987
|
+
var _a, _b, _c;
|
|
12988
|
+
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);
|
|
12989
|
+
});
|
|
12990
|
+
return (_ctx, _cache) => {
|
|
12991
|
+
return vue.unref(showLabel) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
|
|
12992
|
+
_ctx.sideline ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$a)) : vue.createCommentVNode("v-if", true),
|
|
12993
|
+
vue.renderSlot(_ctx.$slots, "before"),
|
|
12994
|
+
vue.createElementVNode("label", _hoisted_3$7, [
|
|
12995
|
+
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
12996
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.label), 1)
|
|
12997
|
+
])
|
|
12998
|
+
])
|
|
12999
|
+
])) : vue.createCommentVNode("v-if", true);
|
|
13000
|
+
};
|
|
13001
|
+
}
|
|
13002
|
+
});
|
|
13003
|
+
var HzztTitle$1 = /* @__PURE__ */ _export_sfc$1(_sfc_main$G, [["__file", "title.vue"]]);
|
|
13004
|
+
|
|
13005
|
+
const HzztTitle = withInstall$1(HzztTitle$1);
|
|
13006
|
+
|
|
12940
13007
|
const configProviderContextKey = Symbol();
|
|
12941
13008
|
|
|
12942
13009
|
const defaultNamespace = "el";
|
|
@@ -13376,7 +13443,7 @@
|
|
|
13376
13443
|
const CHANGE_EVENT = "change";
|
|
13377
13444
|
const INPUT_EVENT = "input";
|
|
13378
13445
|
|
|
13379
|
-
var _export_sfc
|
|
13446
|
+
var _export_sfc = (sfc, props) => {
|
|
13380
13447
|
const target = sfc.__vccOpts || sfc;
|
|
13381
13448
|
for (const [key, val] of props) {
|
|
13382
13449
|
target[key] = val;
|
|
@@ -13384,6 +13451,9 @@
|
|
|
13384
13451
|
return target;
|
|
13385
13452
|
};
|
|
13386
13453
|
|
|
13454
|
+
const rAF = (fn) => isClient ? window.requestAnimationFrame(fn) : setTimeout(fn, 16);
|
|
13455
|
+
const cAF = (handle) => isClient ? window.cancelAnimationFrame(handle) : clearTimeout(handle);
|
|
13456
|
+
|
|
13387
13457
|
function addUnit(value, defaultUnit = "px") {
|
|
13388
13458
|
if (!value)
|
|
13389
13459
|
return "";
|
|
@@ -13455,7 +13525,7 @@
|
|
|
13455
13525
|
name: "ElIcon",
|
|
13456
13526
|
inheritAttrs: false
|
|
13457
13527
|
});
|
|
13458
|
-
const _sfc_main$
|
|
13528
|
+
const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
|
|
13459
13529
|
...__default__$r,
|
|
13460
13530
|
props: iconProps,
|
|
13461
13531
|
setup(__props) {
|
|
@@ -13480,7 +13550,7 @@
|
|
|
13480
13550
|
};
|
|
13481
13551
|
}
|
|
13482
13552
|
});
|
|
13483
|
-
var Icon = /* @__PURE__ */ _export_sfc
|
|
13553
|
+
var Icon = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__file", "icon.vue"]]);
|
|
13484
13554
|
|
|
13485
13555
|
const ElIcon = withInstall(Icon);
|
|
13486
13556
|
|
|
@@ -13922,7 +13992,7 @@
|
|
|
13922
13992
|
name: "ElInput",
|
|
13923
13993
|
inheritAttrs: false
|
|
13924
13994
|
});
|
|
13925
|
-
const _sfc_main$
|
|
13995
|
+
const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
|
|
13926
13996
|
...__default__$q,
|
|
13927
13997
|
props: inputProps,
|
|
13928
13998
|
emits: inputEmits,
|
|
@@ -14328,7 +14398,7 @@
|
|
|
14328
14398
|
};
|
|
14329
14399
|
}
|
|
14330
14400
|
});
|
|
14331
|
-
var Input = /* @__PURE__ */ _export_sfc
|
|
14401
|
+
var Input = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__file", "input.vue"]]);
|
|
14332
14402
|
|
|
14333
14403
|
const ElInput = withInstall(Input);
|
|
14334
14404
|
|
|
@@ -14355,7 +14425,7 @@
|
|
|
14355
14425
|
direction: "left"
|
|
14356
14426
|
}
|
|
14357
14427
|
};
|
|
14358
|
-
const renderThumbStyle = ({
|
|
14428
|
+
const renderThumbStyle$1 = ({
|
|
14359
14429
|
move,
|
|
14360
14430
|
size,
|
|
14361
14431
|
bar
|
|
@@ -14378,7 +14448,7 @@
|
|
|
14378
14448
|
});
|
|
14379
14449
|
|
|
14380
14450
|
const COMPONENT_NAME$2 = "Thumb";
|
|
14381
|
-
const _sfc_main$
|
|
14451
|
+
const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
14382
14452
|
__name: "thumb",
|
|
14383
14453
|
props: thumbProps,
|
|
14384
14454
|
setup(__props) {
|
|
@@ -14395,7 +14465,7 @@
|
|
|
14395
14465
|
let cursorLeave = false;
|
|
14396
14466
|
let originalOnSelectStart = isClient ? document.onselectstart : null;
|
|
14397
14467
|
const bar = vue.computed(() => BAR_MAP[props.vertical ? "vertical" : "horizontal"]);
|
|
14398
|
-
const thumbStyle = vue.computed(() => renderThumbStyle({
|
|
14468
|
+
const thumbStyle = vue.computed(() => renderThumbStyle$1({
|
|
14399
14469
|
size: props.size,
|
|
14400
14470
|
move: props.move,
|
|
14401
14471
|
bar: bar.value
|
|
@@ -14497,7 +14567,7 @@
|
|
|
14497
14567
|
};
|
|
14498
14568
|
}
|
|
14499
14569
|
});
|
|
14500
|
-
var Thumb = /* @__PURE__ */ _export_sfc
|
|
14570
|
+
var Thumb = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__file", "thumb.vue"]]);
|
|
14501
14571
|
|
|
14502
14572
|
const barProps = buildProps({
|
|
14503
14573
|
always: {
|
|
@@ -14510,7 +14580,7 @@
|
|
|
14510
14580
|
}
|
|
14511
14581
|
});
|
|
14512
14582
|
|
|
14513
|
-
const _sfc_main$
|
|
14583
|
+
const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
14514
14584
|
__name: "bar",
|
|
14515
14585
|
props: barProps,
|
|
14516
14586
|
setup(__props, { expose }) {
|
|
@@ -14568,7 +14638,7 @@
|
|
|
14568
14638
|
};
|
|
14569
14639
|
}
|
|
14570
14640
|
});
|
|
14571
|
-
var Bar = /* @__PURE__ */ _export_sfc
|
|
14641
|
+
var Bar = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__file", "bar.vue"]]);
|
|
14572
14642
|
|
|
14573
14643
|
const scrollbarProps = buildProps({
|
|
14574
14644
|
height: {
|
|
@@ -14628,7 +14698,7 @@
|
|
|
14628
14698
|
const __default__$p = vue.defineComponent({
|
|
14629
14699
|
name: COMPONENT_NAME$1
|
|
14630
14700
|
});
|
|
14631
|
-
const _sfc_main$
|
|
14701
|
+
const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
|
|
14632
14702
|
...__default__$p,
|
|
14633
14703
|
props: scrollbarProps,
|
|
14634
14704
|
emits: scrollbarEmits,
|
|
@@ -14781,7 +14851,7 @@
|
|
|
14781
14851
|
};
|
|
14782
14852
|
}
|
|
14783
14853
|
});
|
|
14784
|
-
var Scrollbar = /* @__PURE__ */ _export_sfc
|
|
14854
|
+
var Scrollbar = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__file", "scrollbar.vue"]]);
|
|
14785
14855
|
|
|
14786
14856
|
const ElScrollbar = withInstall(Scrollbar);
|
|
14787
14857
|
|
|
@@ -14810,7 +14880,7 @@
|
|
|
14810
14880
|
name: "ElPopper",
|
|
14811
14881
|
inheritAttrs: false
|
|
14812
14882
|
});
|
|
14813
|
-
const _sfc_main$
|
|
14883
|
+
const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
|
|
14814
14884
|
...__default__$o,
|
|
14815
14885
|
props: popperProps,
|
|
14816
14886
|
setup(__props, { expose }) {
|
|
@@ -14834,7 +14904,7 @@
|
|
|
14834
14904
|
};
|
|
14835
14905
|
}
|
|
14836
14906
|
});
|
|
14837
|
-
var Popper = /* @__PURE__ */ _export_sfc
|
|
14907
|
+
var Popper = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__file", "popper.vue"]]);
|
|
14838
14908
|
|
|
14839
14909
|
const popperArrowProps = buildProps({
|
|
14840
14910
|
arrowOffset: {
|
|
@@ -14847,7 +14917,7 @@
|
|
|
14847
14917
|
name: "ElPopperArrow",
|
|
14848
14918
|
inheritAttrs: false
|
|
14849
14919
|
});
|
|
14850
|
-
const _sfc_main$
|
|
14920
|
+
const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
|
|
14851
14921
|
...__default__$n,
|
|
14852
14922
|
props: popperArrowProps,
|
|
14853
14923
|
setup(__props, { expose }) {
|
|
@@ -14874,7 +14944,7 @@
|
|
|
14874
14944
|
};
|
|
14875
14945
|
}
|
|
14876
14946
|
});
|
|
14877
|
-
var ElPopperArrow = /* @__PURE__ */ _export_sfc
|
|
14947
|
+
var ElPopperArrow = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__file", "arrow.vue"]]);
|
|
14878
14948
|
|
|
14879
14949
|
const popperTriggerProps = buildProps({
|
|
14880
14950
|
virtualRef: {
|
|
@@ -15013,7 +15083,7 @@
|
|
|
15013
15083
|
name: "ElPopperTrigger",
|
|
15014
15084
|
inheritAttrs: false
|
|
15015
15085
|
});
|
|
15016
|
-
const _sfc_main$
|
|
15086
|
+
const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
|
|
15017
15087
|
...__default__$m,
|
|
15018
15088
|
props: popperTriggerProps,
|
|
15019
15089
|
setup(__props, { expose }) {
|
|
@@ -15125,7 +15195,7 @@
|
|
|
15125
15195
|
};
|
|
15126
15196
|
}
|
|
15127
15197
|
});
|
|
15128
|
-
var ElPopperTrigger = /* @__PURE__ */ _export_sfc
|
|
15198
|
+
var ElPopperTrigger = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__file", "trigger.vue"]]);
|
|
15129
15199
|
|
|
15130
15200
|
const FOCUS_AFTER_TRAPPED = "focus-trap.focus-after-trapped";
|
|
15131
15201
|
const FOCUS_AFTER_RELEASED = "focus-trap.focus-after-released";
|
|
@@ -15324,7 +15394,7 @@
|
|
|
15324
15394
|
});
|
|
15325
15395
|
};
|
|
15326
15396
|
|
|
15327
|
-
const _sfc_main$
|
|
15397
|
+
const _sfc_main$x = vue.defineComponent({
|
|
15328
15398
|
name: "ElFocusTrap",
|
|
15329
15399
|
inheritAttrs: false,
|
|
15330
15400
|
props: {
|
|
@@ -15566,10 +15636,10 @@
|
|
|
15566
15636
|
};
|
|
15567
15637
|
}
|
|
15568
15638
|
});
|
|
15569
|
-
function _sfc_render$
|
|
15639
|
+
function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
15570
15640
|
return vue.renderSlot(_ctx.$slots, "default", { handleKeydown: _ctx.onKeydown });
|
|
15571
15641
|
}
|
|
15572
|
-
var ElFocusTrap = /* @__PURE__ */ _export_sfc
|
|
15642
|
+
var ElFocusTrap = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$9], ["__file", "focus-trap.vue"]]);
|
|
15573
15643
|
|
|
15574
15644
|
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});
|
|
15575
15645
|
|
|
@@ -15951,7 +16021,7 @@
|
|
|
15951
16021
|
const __default__$l = vue.defineComponent({
|
|
15952
16022
|
name: "ElPopperContent"
|
|
15953
16023
|
});
|
|
15954
|
-
const _sfc_main$
|
|
16024
|
+
const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
15955
16025
|
...__default__$l,
|
|
15956
16026
|
props: popperContentProps,
|
|
15957
16027
|
emits: popperContentEmits,
|
|
@@ -16068,7 +16138,7 @@
|
|
|
16068
16138
|
};
|
|
16069
16139
|
}
|
|
16070
16140
|
});
|
|
16071
|
-
var ElPopperContent = /* @__PURE__ */ _export_sfc
|
|
16141
|
+
var ElPopperContent = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__file", "content.vue"]]);
|
|
16072
16142
|
|
|
16073
16143
|
const ElPopper = withInstall(Popper);
|
|
16074
16144
|
|
|
@@ -16349,7 +16419,7 @@
|
|
|
16349
16419
|
const __default__$k = vue.defineComponent({
|
|
16350
16420
|
name: "ElTooltipTrigger"
|
|
16351
16421
|
});
|
|
16352
|
-
const _sfc_main$
|
|
16422
|
+
const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
|
|
16353
16423
|
...__default__$k,
|
|
16354
16424
|
props: useTooltipTriggerProps,
|
|
16355
16425
|
setup(__props, { expose }) {
|
|
@@ -16409,7 +16479,7 @@
|
|
|
16409
16479
|
};
|
|
16410
16480
|
}
|
|
16411
16481
|
});
|
|
16412
|
-
var ElTooltipTrigger = /* @__PURE__ */ _export_sfc
|
|
16482
|
+
var ElTooltipTrigger = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__file", "trigger.vue"]]);
|
|
16413
16483
|
|
|
16414
16484
|
const teleportProps = buildProps({
|
|
16415
16485
|
to: {
|
|
@@ -16419,7 +16489,7 @@
|
|
|
16419
16489
|
disabled: Boolean
|
|
16420
16490
|
});
|
|
16421
16491
|
|
|
16422
|
-
const _sfc_main$
|
|
16492
|
+
const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
16423
16493
|
__name: "teleport",
|
|
16424
16494
|
props: teleportProps,
|
|
16425
16495
|
setup(__props) {
|
|
@@ -16433,7 +16503,7 @@
|
|
|
16433
16503
|
};
|
|
16434
16504
|
}
|
|
16435
16505
|
});
|
|
16436
|
-
var Teleport = /* @__PURE__ */ _export_sfc
|
|
16506
|
+
var Teleport = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__file", "teleport.vue"]]);
|
|
16437
16507
|
|
|
16438
16508
|
const ElTeleport = withInstall(Teleport);
|
|
16439
16509
|
|
|
@@ -16474,7 +16544,7 @@
|
|
|
16474
16544
|
name: "ElTooltipContent",
|
|
16475
16545
|
inheritAttrs: false
|
|
16476
16546
|
});
|
|
16477
|
-
const _sfc_main$
|
|
16547
|
+
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
16478
16548
|
...__default__$j,
|
|
16479
16549
|
props: useTooltipContentProps,
|
|
16480
16550
|
setup(__props, { expose }) {
|
|
@@ -16646,12 +16716,12 @@
|
|
|
16646
16716
|
};
|
|
16647
16717
|
}
|
|
16648
16718
|
});
|
|
16649
|
-
var ElTooltipContent = /* @__PURE__ */ _export_sfc
|
|
16719
|
+
var ElTooltipContent = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__file", "content.vue"]]);
|
|
16650
16720
|
|
|
16651
16721
|
const __default__$i = vue.defineComponent({
|
|
16652
16722
|
name: "ElTooltip"
|
|
16653
16723
|
});
|
|
16654
|
-
const _sfc_main$
|
|
16724
|
+
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
16655
16725
|
...__default__$i,
|
|
16656
16726
|
props: useTooltipProps,
|
|
16657
16727
|
emits: tooltipEmits,
|
|
@@ -16802,7 +16872,7 @@
|
|
|
16802
16872
|
};
|
|
16803
16873
|
}
|
|
16804
16874
|
});
|
|
16805
|
-
var Tooltip$1 = /* @__PURE__ */ _export_sfc
|
|
16875
|
+
var Tooltip$1 = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__file", "tooltip.vue"]]);
|
|
16806
16876
|
|
|
16807
16877
|
const ElTooltip = withInstall(Tooltip$1);
|
|
16808
16878
|
|
|
@@ -17879,7 +17949,7 @@
|
|
|
17879
17949
|
const __default__$h = vue.defineComponent({
|
|
17880
17950
|
name: "ElButton"
|
|
17881
17951
|
});
|
|
17882
|
-
const _sfc_main$
|
|
17952
|
+
const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
17883
17953
|
...__default__$h,
|
|
17884
17954
|
props: buttonProps,
|
|
17885
17955
|
emits: buttonEmits,
|
|
@@ -17946,7 +18016,7 @@
|
|
|
17946
18016
|
};
|
|
17947
18017
|
}
|
|
17948
18018
|
});
|
|
17949
|
-
var Button = /* @__PURE__ */ _export_sfc
|
|
18019
|
+
var Button = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__file", "button.vue"]]);
|
|
17950
18020
|
|
|
17951
18021
|
const buttonGroupProps = {
|
|
17952
18022
|
size: buttonProps.size,
|
|
@@ -17956,7 +18026,7 @@
|
|
|
17956
18026
|
const __default__$g = vue.defineComponent({
|
|
17957
18027
|
name: "ElButtonGroup"
|
|
17958
18028
|
});
|
|
17959
|
-
const _sfc_main$
|
|
18029
|
+
const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
17960
18030
|
...__default__$g,
|
|
17961
18031
|
props: buttonGroupProps,
|
|
17962
18032
|
setup(__props) {
|
|
@@ -17975,7 +18045,7 @@
|
|
|
17975
18045
|
};
|
|
17976
18046
|
}
|
|
17977
18047
|
});
|
|
17978
|
-
var ButtonGroup = /* @__PURE__ */ _export_sfc
|
|
18048
|
+
var ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__file", "button-group.vue"]]);
|
|
17979
18049
|
|
|
17980
18050
|
const ElButton = withInstall(Button, {
|
|
17981
18051
|
ButtonGroup
|
|
@@ -18015,7 +18085,7 @@
|
|
|
18015
18085
|
const __default__$f = vue.defineComponent({
|
|
18016
18086
|
name: "ElTag"
|
|
18017
18087
|
});
|
|
18018
|
-
const _sfc_main$
|
|
18088
|
+
const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
18019
18089
|
...__default__$f,
|
|
18020
18090
|
props: tagProps,
|
|
18021
18091
|
emits: tagEmits,
|
|
@@ -18103,7 +18173,7 @@
|
|
|
18103
18173
|
};
|
|
18104
18174
|
}
|
|
18105
18175
|
});
|
|
18106
|
-
var Tag = /* @__PURE__ */ _export_sfc
|
|
18176
|
+
var Tag = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__file", "tag.vue"]]);
|
|
18107
18177
|
|
|
18108
18178
|
const ElTag = withInstall(Tag);
|
|
18109
18179
|
|
|
@@ -18212,22 +18282,22 @@
|
|
|
18212
18282
|
}
|
|
18213
18283
|
};
|
|
18214
18284
|
|
|
18215
|
-
const _sfc_main$
|
|
18285
|
+
const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
18216
18286
|
inheritAttrs: false
|
|
18217
18287
|
});
|
|
18218
|
-
function _sfc_render$
|
|
18288
|
+
function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18219
18289
|
return vue.renderSlot(_ctx.$slots, "default");
|
|
18220
18290
|
}
|
|
18221
|
-
var Collection = /* @__PURE__ */ _export_sfc
|
|
18291
|
+
var Collection = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$8], ["__file", "collection.vue"]]);
|
|
18222
18292
|
|
|
18223
|
-
const _sfc_main$
|
|
18293
|
+
const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
18224
18294
|
name: "ElCollectionItem",
|
|
18225
18295
|
inheritAttrs: false
|
|
18226
18296
|
});
|
|
18227
|
-
function _sfc_render$
|
|
18297
|
+
function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18228
18298
|
return vue.renderSlot(_ctx.$slots, "default");
|
|
18229
18299
|
}
|
|
18230
|
-
var CollectionItem = /* @__PURE__ */ _export_sfc
|
|
18300
|
+
var CollectionItem = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$7], ["__file", "collection-item.vue"]]);
|
|
18231
18301
|
|
|
18232
18302
|
const COLLECTION_ITEM_SIGN = `data-el-collection-item`;
|
|
18233
18303
|
const createCollectionWithScope = (name) => {
|
|
@@ -18440,7 +18510,7 @@
|
|
|
18440
18510
|
const __default__$e = vue.defineComponent({
|
|
18441
18511
|
name: "ElInputNumber"
|
|
18442
18512
|
});
|
|
18443
|
-
const _sfc_main$
|
|
18513
|
+
const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
18444
18514
|
...__default__$e,
|
|
18445
18515
|
props: inputNumberProps,
|
|
18446
18516
|
emits: inputNumberEmits,
|
|
@@ -18767,7 +18837,7 @@
|
|
|
18767
18837
|
};
|
|
18768
18838
|
}
|
|
18769
18839
|
});
|
|
18770
|
-
var InputNumber = /* @__PURE__ */ _export_sfc
|
|
18840
|
+
var InputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__file", "input-number.vue"]]);
|
|
18771
18841
|
|
|
18772
18842
|
const ElInputNumber = withInstall(InputNumber);
|
|
18773
18843
|
|
|
@@ -18817,7 +18887,7 @@
|
|
|
18817
18887
|
const __default__$d = vue.defineComponent({
|
|
18818
18888
|
name: "ElLink"
|
|
18819
18889
|
});
|
|
18820
|
-
const _sfc_main$
|
|
18890
|
+
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
18821
18891
|
...__default__$d,
|
|
18822
18892
|
props: linkProps,
|
|
18823
18893
|
emits: linkEmits,
|
|
@@ -18858,14 +18928,14 @@
|
|
|
18858
18928
|
};
|
|
18859
18929
|
}
|
|
18860
18930
|
});
|
|
18861
|
-
var Link = /* @__PURE__ */ _export_sfc
|
|
18931
|
+
var Link = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__file", "link.vue"]]);
|
|
18862
18932
|
|
|
18863
18933
|
const ElLink = withInstall(Link);
|
|
18864
18934
|
|
|
18865
18935
|
const selectGroupKey = Symbol("ElSelectGroup");
|
|
18866
18936
|
const selectKey = Symbol("ElSelect");
|
|
18867
18937
|
|
|
18868
|
-
function useOption(props, states) {
|
|
18938
|
+
function useOption$1(props, states) {
|
|
18869
18939
|
const select = vue.inject(selectKey);
|
|
18870
18940
|
const selectGroup = vue.inject(selectGroupKey, { disabled: false });
|
|
18871
18941
|
const itemSelected = vue.computed(() => {
|
|
@@ -18940,7 +19010,7 @@
|
|
|
18940
19010
|
};
|
|
18941
19011
|
}
|
|
18942
19012
|
|
|
18943
|
-
const _sfc_main$
|
|
19013
|
+
const _sfc_main$k = vue.defineComponent({
|
|
18944
19014
|
name: "ElOption",
|
|
18945
19015
|
componentName: "ElOption",
|
|
18946
19016
|
props: {
|
|
@@ -18974,7 +19044,7 @@
|
|
|
18974
19044
|
select,
|
|
18975
19045
|
hoverItem,
|
|
18976
19046
|
updateOption
|
|
18977
|
-
} = useOption(props, states);
|
|
19047
|
+
} = useOption$1(props, states);
|
|
18978
19048
|
const { visible, hover } = vue.toRefs(states);
|
|
18979
19049
|
const vm = vue.getCurrentInstance().proxy;
|
|
18980
19050
|
select.onOptionCreate(vm);
|
|
@@ -19013,7 +19083,7 @@
|
|
|
19013
19083
|
};
|
|
19014
19084
|
}
|
|
19015
19085
|
});
|
|
19016
|
-
function _sfc_render$
|
|
19086
|
+
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
19017
19087
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
|
|
19018
19088
|
id: _ctx.id,
|
|
19019
19089
|
class: vue.normalizeClass(_ctx.containerKls),
|
|
@@ -19030,9 +19100,9 @@
|
|
|
19030
19100
|
[vue.vShow, _ctx.visible]
|
|
19031
19101
|
]);
|
|
19032
19102
|
}
|
|
19033
|
-
var Option = /* @__PURE__ */ _export_sfc
|
|
19103
|
+
var Option = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$6], ["__file", "option.vue"]]);
|
|
19034
19104
|
|
|
19035
|
-
const _sfc_main$
|
|
19105
|
+
const _sfc_main$j = vue.defineComponent({
|
|
19036
19106
|
name: "ElSelectDropdown",
|
|
19037
19107
|
componentName: "ElSelectDropdown",
|
|
19038
19108
|
setup() {
|
|
@@ -19059,7 +19129,7 @@
|
|
|
19059
19129
|
};
|
|
19060
19130
|
}
|
|
19061
19131
|
});
|
|
19062
|
-
function _sfc_render$
|
|
19132
|
+
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
19063
19133
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
19064
19134
|
class: vue.normalizeClass([_ctx.ns.b("dropdown"), _ctx.ns.is("multiple", _ctx.isMultiple), _ctx.popperClass]),
|
|
19065
19135
|
style: vue.normalizeStyle({ [_ctx.isFitInputWidth ? "width" : "minWidth"]: _ctx.minWidth })
|
|
@@ -19079,9 +19149,9 @@
|
|
|
19079
19149
|
], 2)) : vue.createCommentVNode("v-if", true)
|
|
19080
19150
|
], 6);
|
|
19081
19151
|
}
|
|
19082
|
-
var ElSelectMenu = /* @__PURE__ */ _export_sfc
|
|
19152
|
+
var ElSelectMenu$1 = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$5], ["__file", "select-dropdown.vue"]]);
|
|
19083
19153
|
|
|
19084
|
-
const useSelect = (props, emit) => {
|
|
19154
|
+
const useSelect$1 = (props, emit) => {
|
|
19085
19155
|
const { t } = useLocale();
|
|
19086
19156
|
const contentId = useId();
|
|
19087
19157
|
const nsSelect = useNamespace("select");
|
|
@@ -19238,7 +19308,7 @@
|
|
|
19238
19308
|
}
|
|
19239
19309
|
}
|
|
19240
19310
|
setSelected();
|
|
19241
|
-
if (!isEqual(val, oldVal) && props.validateEvent) {
|
|
19311
|
+
if (!isEqual$1(val, oldVal) && props.validateEvent) {
|
|
19242
19312
|
formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
|
|
19243
19313
|
}
|
|
19244
19314
|
}, {
|
|
@@ -19382,7 +19452,7 @@
|
|
|
19382
19452
|
onInputChange();
|
|
19383
19453
|
}, debounce$1.value);
|
|
19384
19454
|
const emitChange = (val) => {
|
|
19385
|
-
if (!isEqual(props.modelValue, val)) {
|
|
19455
|
+
if (!isEqual$1(props.modelValue, val)) {
|
|
19386
19456
|
emit(CHANGE_EVENT, val);
|
|
19387
19457
|
}
|
|
19388
19458
|
};
|
|
@@ -19471,7 +19541,7 @@
|
|
|
19471
19541
|
if (!isObject$1(option.value))
|
|
19472
19542
|
return arr.indexOf(option.value);
|
|
19473
19543
|
return arr.findIndex((item) => {
|
|
19474
|
-
return isEqual(get(item, props.valueKey), getValueKey(option));
|
|
19544
|
+
return isEqual$1(get(item, props.valueKey), getValueKey(option));
|
|
19475
19545
|
});
|
|
19476
19546
|
};
|
|
19477
19547
|
const scrollToOption = (option) => {
|
|
@@ -19727,7 +19797,7 @@
|
|
|
19727
19797
|
if (children.length) {
|
|
19728
19798
|
filterOptions((_b = children[0]) == null ? void 0 : _b.children);
|
|
19729
19799
|
}
|
|
19730
|
-
if (!isEqual(valueList, cachedValueList)) {
|
|
19800
|
+
if (!isEqual$1(valueList, cachedValueList)) {
|
|
19731
19801
|
cachedValueList = valueList;
|
|
19732
19802
|
if (select) {
|
|
19733
19803
|
select.states.optionValues = valueList;
|
|
@@ -19738,7 +19808,7 @@
|
|
|
19738
19808
|
}
|
|
19739
19809
|
});
|
|
19740
19810
|
|
|
19741
|
-
const SelectProps = buildProps({
|
|
19811
|
+
const SelectProps$1 = buildProps({
|
|
19742
19812
|
name: String,
|
|
19743
19813
|
id: String,
|
|
19744
19814
|
modelValue: {
|
|
@@ -19845,11 +19915,11 @@
|
|
|
19845
19915
|
});
|
|
19846
19916
|
|
|
19847
19917
|
const COMPONENT_NAME = "ElSelect";
|
|
19848
|
-
const _sfc_main$
|
|
19918
|
+
const _sfc_main$i = vue.defineComponent({
|
|
19849
19919
|
name: COMPONENT_NAME,
|
|
19850
19920
|
componentName: COMPONENT_NAME,
|
|
19851
19921
|
components: {
|
|
19852
|
-
ElSelectMenu,
|
|
19922
|
+
ElSelectMenu: ElSelectMenu$1,
|
|
19853
19923
|
ElOption: Option,
|
|
19854
19924
|
ElOptions,
|
|
19855
19925
|
ElTag,
|
|
@@ -19858,7 +19928,7 @@
|
|
|
19858
19928
|
ElIcon
|
|
19859
19929
|
},
|
|
19860
19930
|
directives: { ClickOutside },
|
|
19861
|
-
props: SelectProps,
|
|
19931
|
+
props: SelectProps$1,
|
|
19862
19932
|
emits: [
|
|
19863
19933
|
UPDATE_MODEL_EVENT,
|
|
19864
19934
|
CHANGE_EVENT,
|
|
@@ -19881,7 +19951,7 @@
|
|
|
19881
19951
|
...vue.toRefs(props),
|
|
19882
19952
|
modelValue
|
|
19883
19953
|
});
|
|
19884
|
-
const API = useSelect(_props, emit);
|
|
19954
|
+
const API = useSelect$1(_props, emit);
|
|
19885
19955
|
const { calculatorRef, inputStyle } = useCalcInputWidth();
|
|
19886
19956
|
vue.provide(selectKey, vue.reactive({
|
|
19887
19957
|
props: _props,
|
|
@@ -19908,7 +19978,7 @@
|
|
|
19908
19978
|
};
|
|
19909
19979
|
}
|
|
19910
19980
|
});
|
|
19911
|
-
function _sfc_render$
|
|
19981
|
+
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
19912
19982
|
const _component_el_tag = vue.resolveComponent("el-tag");
|
|
19913
19983
|
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
19914
19984
|
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
@@ -20255,9 +20325,9 @@
|
|
|
20255
20325
|
[_directive_click_outside, _ctx.handleClickOutside, _ctx.popperRef]
|
|
20256
20326
|
]);
|
|
20257
20327
|
}
|
|
20258
|
-
var Select = /* @__PURE__ */ _export_sfc
|
|
20328
|
+
var Select$1 = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$4], ["__file", "select.vue"]]);
|
|
20259
20329
|
|
|
20260
|
-
const _sfc_main$
|
|
20330
|
+
const _sfc_main$h = vue.defineComponent({
|
|
20261
20331
|
name: "ElOptionGroup",
|
|
20262
20332
|
componentName: "ElOptionGroup",
|
|
20263
20333
|
props: {
|
|
@@ -20310,7 +20380,7 @@
|
|
|
20310
20380
|
};
|
|
20311
20381
|
}
|
|
20312
20382
|
});
|
|
20313
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
20383
|
+
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
20314
20384
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("ul", {
|
|
20315
20385
|
ref: "groupRef",
|
|
20316
20386
|
class: vue.normalizeClass(_ctx.ns.be("group", "wrap"))
|
|
@@ -20329,9 +20399,9 @@
|
|
|
20329
20399
|
[vue.vShow, _ctx.visible]
|
|
20330
20400
|
]);
|
|
20331
20401
|
}
|
|
20332
|
-
var OptionGroup = /* @__PURE__ */ _export_sfc
|
|
20402
|
+
var OptionGroup = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$3], ["__file", "option-group.vue"]]);
|
|
20333
20403
|
|
|
20334
|
-
const ElSelect = withInstall(Select, {
|
|
20404
|
+
const ElSelect = withInstall(Select$1, {
|
|
20335
20405
|
Option,
|
|
20336
20406
|
OptionGroup
|
|
20337
20407
|
});
|
|
@@ -20403,7 +20473,7 @@
|
|
|
20403
20473
|
const __default__$c = vue.defineComponent({
|
|
20404
20474
|
name: "ElPopover"
|
|
20405
20475
|
});
|
|
20406
|
-
const _sfc_main$
|
|
20476
|
+
const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
20407
20477
|
...__default__$c,
|
|
20408
20478
|
props: popoverProps,
|
|
20409
20479
|
emits: popoverEmits,
|
|
@@ -20503,7 +20573,7 @@
|
|
|
20503
20573
|
};
|
|
20504
20574
|
}
|
|
20505
20575
|
});
|
|
20506
|
-
var Popover = /* @__PURE__ */ _export_sfc
|
|
20576
|
+
var Popover = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__file", "popover.vue"]]);
|
|
20507
20577
|
|
|
20508
20578
|
const attachEvents = (el, binding) => {
|
|
20509
20579
|
const popperComponent = binding.arg || binding.value;
|
|
@@ -20527,160 +20597,2813 @@
|
|
|
20527
20597
|
directive: ElPopoverDirective
|
|
20528
20598
|
});
|
|
20529
20599
|
|
|
20530
|
-
|
|
20531
|
-
const target = sfc.__vccOpts || sfc;
|
|
20532
|
-
for (const [key, val] of props) {
|
|
20533
|
-
target[key] = val;
|
|
20534
|
-
}
|
|
20535
|
-
return target;
|
|
20536
|
-
};
|
|
20537
|
-
|
|
20538
|
-
const _hoisted_1$a = ["onClick"];
|
|
20539
|
-
const _hoisted_2$9 = { class: "hzzt-dropdown-name" };
|
|
20540
|
-
const _hoisted_3$7 = /* @__PURE__ */ vue.createElementVNode("span", { class: "caret" }, null, -1);
|
|
20541
|
-
const _hoisted_4$5 = { class: "hzzt-dropdown-menu" };
|
|
20542
|
-
const _hoisted_5$3 = ["onClick"];
|
|
20543
|
-
const _hoisted_6$3 = { class: "submenu" };
|
|
20544
|
-
const _hoisted_7$3 = ["onClick"];
|
|
20545
|
-
const __default__$b = vue.defineComponent({
|
|
20546
|
-
name: "HzztDropDown"
|
|
20547
|
-
});
|
|
20548
|
-
const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
20549
|
-
...__default__$b,
|
|
20600
|
+
const _sfc_main$f = vue.defineComponent({
|
|
20550
20601
|
props: {
|
|
20551
|
-
|
|
20552
|
-
type: Array,
|
|
20553
|
-
default: () => []
|
|
20554
|
-
},
|
|
20555
|
-
label: String,
|
|
20556
|
-
value: String,
|
|
20557
|
-
defaultValue: {
|
|
20558
|
-
type: Array,
|
|
20559
|
-
default: () => []
|
|
20560
|
-
},
|
|
20561
|
-
position: {
|
|
20562
|
-
type: String,
|
|
20563
|
-
default: "right"
|
|
20564
|
-
},
|
|
20565
|
-
props: {
|
|
20602
|
+
item: {
|
|
20566
20603
|
type: Object,
|
|
20567
|
-
|
|
20568
|
-
children: "children",
|
|
20569
|
-
label: "label",
|
|
20570
|
-
value: "value"
|
|
20571
|
-
})
|
|
20604
|
+
required: true
|
|
20572
20605
|
},
|
|
20573
|
-
|
|
20574
|
-
type:
|
|
20575
|
-
|
|
20576
|
-
|
|
20606
|
+
style: {
|
|
20607
|
+
type: Object
|
|
20608
|
+
},
|
|
20609
|
+
height: Number
|
|
20577
20610
|
},
|
|
20578
|
-
|
|
20579
|
-
|
|
20580
|
-
|
|
20581
|
-
|
|
20582
|
-
function dropToggle() {
|
|
20583
|
-
toggle.value = !toggle.value;
|
|
20584
|
-
}
|
|
20585
|
-
function close() {
|
|
20586
|
-
toggle.value = false;
|
|
20587
|
-
}
|
|
20588
|
-
function selectValue(val) {
|
|
20589
|
-
if (dProps.returnType === "Array") {
|
|
20590
|
-
emits("change", val);
|
|
20591
|
-
}
|
|
20592
|
-
if (dProps.returnType === "String") {
|
|
20593
|
-
emits("change", val.last);
|
|
20594
|
-
}
|
|
20595
|
-
}
|
|
20596
|
-
return (_ctx, _cache) => {
|
|
20597
|
-
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("ul", {
|
|
20598
|
-
class: "hzzt-dropdown",
|
|
20599
|
-
onClick: vue.withModifiers(dropToggle, ["stop"])
|
|
20600
|
-
}, [
|
|
20601
|
-
vue.createElementVNode("li", {
|
|
20602
|
-
class: vue.normalizeClass({ "hzzt-dropdown-li": true, "hzzt-dropdown-li-show": toggle.value })
|
|
20603
|
-
}, [
|
|
20604
|
-
vue.createElementVNode("span", _hoisted_2$9, vue.toDisplayString(__props.label), 1),
|
|
20605
|
-
_hoisted_3$7,
|
|
20606
|
-
vue.createElementVNode("ul", _hoisted_4$5, [
|
|
20607
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.options, (option, index) => {
|
|
20608
|
-
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
20609
|
-
vue.unref(isEmpty)(option[__props.props.children]) ? (vue.openBlock(), vue.createElementBlock("li", {
|
|
20610
|
-
key: index,
|
|
20611
|
-
class: vue.normalizeClass({
|
|
20612
|
-
"hzzt-dropdown-menu-item": true,
|
|
20613
|
-
selected: __props.defaultValue.includes(option[__props.props.value])
|
|
20614
|
-
})
|
|
20615
|
-
}, [
|
|
20616
|
-
vue.createElementVNode("a", {
|
|
20617
|
-
class: "hzzt-dropdown-menu-item-label",
|
|
20618
|
-
onClick: ($event) => selectValue([option[__props.props.value]])
|
|
20619
|
-
}, vue.toDisplayString(option[__props.props.label]), 9, _hoisted_5$3)
|
|
20620
|
-
], 2)) : (vue.openBlock(), vue.createElementBlock("li", {
|
|
20621
|
-
key: index + "submenu",
|
|
20622
|
-
class: "hzzt-dropdown-menu-item hzzt-dropdown-submenu"
|
|
20623
|
-
}, [
|
|
20624
|
-
vue.createElementVNode("a", _hoisted_6$3, vue.toDisplayString(option[__props.props.label]), 1),
|
|
20625
|
-
vue.createElementVNode("ul", {
|
|
20626
|
-
class: vue.normalizeClass([["pull-" + __props.position], "hzzt-dropdown-menu"])
|
|
20627
|
-
}, [
|
|
20628
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(option.children, (child, cIndex) => {
|
|
20629
|
-
return vue.openBlock(), vue.createElementBlock("li", {
|
|
20630
|
-
key: cIndex,
|
|
20631
|
-
class: vue.normalizeClass({
|
|
20632
|
-
"hzzt-dropdown-menu-item": true,
|
|
20633
|
-
selected: __props.defaultValue.includes(child[__props.props.value])
|
|
20634
|
-
})
|
|
20635
|
-
}, [
|
|
20636
|
-
vue.createElementVNode("a", {
|
|
20637
|
-
class: "hzzt-dropdown-menu-item-label",
|
|
20638
|
-
onClick: ($event) => selectValue([option[__props.props.value], child[__props.props.value]])
|
|
20639
|
-
}, vue.toDisplayString(child[__props.props.label]), 9, _hoisted_7$3)
|
|
20640
|
-
], 2);
|
|
20641
|
-
}), 128))
|
|
20642
|
-
], 2)
|
|
20643
|
-
])),
|
|
20644
|
-
option.divider ? (vue.openBlock(), vue.createElementBlock("li", {
|
|
20645
|
-
key: index + "divider",
|
|
20646
|
-
class: "divider"
|
|
20647
|
-
})) : vue.createCommentVNode("v-if", true)
|
|
20648
|
-
], 64);
|
|
20649
|
-
}), 256))
|
|
20650
|
-
])
|
|
20651
|
-
], 2)
|
|
20652
|
-
], 8, _hoisted_1$a)), [
|
|
20653
|
-
[vue.unref(ClickOutside), close]
|
|
20654
|
-
]);
|
|
20611
|
+
setup() {
|
|
20612
|
+
const ns = useNamespace("select");
|
|
20613
|
+
return {
|
|
20614
|
+
ns
|
|
20655
20615
|
};
|
|
20656
20616
|
}
|
|
20657
20617
|
});
|
|
20658
|
-
|
|
20618
|
+
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
20619
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
20620
|
+
class: vue.normalizeClass(_ctx.ns.be("group", "title")),
|
|
20621
|
+
style: vue.normalizeStyle({ ..._ctx.style, lineHeight: `${_ctx.height}px` })
|
|
20622
|
+
}, vue.toDisplayString(_ctx.item.label), 7);
|
|
20623
|
+
}
|
|
20624
|
+
var GroupItem = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$2], ["__file", "group-item.vue"]]);
|
|
20659
20625
|
|
|
20660
|
-
|
|
20626
|
+
function useOption(props, { emit }) {
|
|
20627
|
+
return {
|
|
20628
|
+
hoverItem: () => {
|
|
20629
|
+
if (!props.disabled) {
|
|
20630
|
+
emit("hover", props.index);
|
|
20631
|
+
}
|
|
20632
|
+
},
|
|
20633
|
+
selectOptionClick: () => {
|
|
20634
|
+
if (!props.disabled) {
|
|
20635
|
+
emit("select", props.item, props.index);
|
|
20636
|
+
}
|
|
20637
|
+
}
|
|
20638
|
+
};
|
|
20639
|
+
}
|
|
20661
20640
|
|
|
20662
|
-
const
|
|
20663
|
-
|
|
20664
|
-
|
|
20665
|
-
|
|
20666
|
-
|
|
20667
|
-
const _hoisted_6$2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "hzzt-collapse-line" }, null, -1);
|
|
20668
|
-
const _hoisted_7$2 = {
|
|
20669
|
-
key: 0,
|
|
20670
|
-
class: "hzzt-collapse-text"
|
|
20641
|
+
const defaultProps = {
|
|
20642
|
+
label: "label",
|
|
20643
|
+
value: "value",
|
|
20644
|
+
disabled: "disabled",
|
|
20645
|
+
options: "options"
|
|
20671
20646
|
};
|
|
20672
|
-
|
|
20673
|
-
|
|
20674
|
-
|
|
20675
|
-
|
|
20676
|
-
|
|
20677
|
-
|
|
20678
|
-
|
|
20679
|
-
|
|
20680
|
-
|
|
20681
|
-
|
|
20682
|
-
|
|
20683
|
-
|
|
20647
|
+
function useProps(props) {
|
|
20648
|
+
const aliasProps = vue.computed(() => ({ ...defaultProps, ...props.props }));
|
|
20649
|
+
const getLabel = (option) => get(option, aliasProps.value.label);
|
|
20650
|
+
const getValue = (option) => get(option, aliasProps.value.value);
|
|
20651
|
+
const getDisabled = (option) => get(option, aliasProps.value.disabled);
|
|
20652
|
+
const getOptions = (option) => get(option, aliasProps.value.options);
|
|
20653
|
+
return {
|
|
20654
|
+
aliasProps,
|
|
20655
|
+
getLabel,
|
|
20656
|
+
getValue,
|
|
20657
|
+
getDisabled,
|
|
20658
|
+
getOptions
|
|
20659
|
+
};
|
|
20660
|
+
}
|
|
20661
|
+
|
|
20662
|
+
const SelectProps = buildProps({
|
|
20663
|
+
allowCreate: Boolean,
|
|
20664
|
+
autocomplete: {
|
|
20665
|
+
type: definePropType(String),
|
|
20666
|
+
default: "none"
|
|
20667
|
+
},
|
|
20668
|
+
automaticDropdown: Boolean,
|
|
20669
|
+
clearable: Boolean,
|
|
20670
|
+
clearIcon: {
|
|
20671
|
+
type: iconPropType,
|
|
20672
|
+
default: circle_close_default
|
|
20673
|
+
},
|
|
20674
|
+
effect: {
|
|
20675
|
+
type: definePropType(String),
|
|
20676
|
+
default: "light"
|
|
20677
|
+
},
|
|
20678
|
+
collapseTags: Boolean,
|
|
20679
|
+
collapseTagsTooltip: Boolean,
|
|
20680
|
+
maxCollapseTags: {
|
|
20681
|
+
type: Number,
|
|
20682
|
+
default: 1
|
|
20683
|
+
},
|
|
20684
|
+
defaultFirstOption: Boolean,
|
|
20685
|
+
disabled: Boolean,
|
|
20686
|
+
estimatedOptionHeight: {
|
|
20687
|
+
type: Number,
|
|
20688
|
+
default: void 0
|
|
20689
|
+
},
|
|
20690
|
+
filterable: Boolean,
|
|
20691
|
+
filterMethod: Function,
|
|
20692
|
+
height: {
|
|
20693
|
+
type: Number,
|
|
20694
|
+
default: 274
|
|
20695
|
+
},
|
|
20696
|
+
itemHeight: {
|
|
20697
|
+
type: Number,
|
|
20698
|
+
default: 34
|
|
20699
|
+
},
|
|
20700
|
+
id: String,
|
|
20701
|
+
loading: Boolean,
|
|
20702
|
+
loadingText: String,
|
|
20703
|
+
modelValue: {
|
|
20704
|
+
type: definePropType([Array, String, Number, Boolean, Object])
|
|
20705
|
+
},
|
|
20706
|
+
multiple: Boolean,
|
|
20707
|
+
multipleLimit: {
|
|
20708
|
+
type: Number,
|
|
20709
|
+
default: 0
|
|
20710
|
+
},
|
|
20711
|
+
name: String,
|
|
20712
|
+
noDataText: String,
|
|
20713
|
+
noMatchText: String,
|
|
20714
|
+
remoteMethod: Function,
|
|
20715
|
+
reserveKeyword: {
|
|
20716
|
+
type: Boolean,
|
|
20717
|
+
default: true
|
|
20718
|
+
},
|
|
20719
|
+
options: {
|
|
20720
|
+
type: definePropType(Array),
|
|
20721
|
+
required: true
|
|
20722
|
+
},
|
|
20723
|
+
placeholder: {
|
|
20724
|
+
type: String
|
|
20725
|
+
},
|
|
20726
|
+
teleported: useTooltipContentProps.teleported,
|
|
20727
|
+
persistent: {
|
|
20728
|
+
type: Boolean,
|
|
20729
|
+
default: true
|
|
20730
|
+
},
|
|
20731
|
+
popperClass: {
|
|
20732
|
+
type: String,
|
|
20733
|
+
default: ""
|
|
20734
|
+
},
|
|
20735
|
+
popperOptions: {
|
|
20736
|
+
type: definePropType(Object),
|
|
20737
|
+
default: () => ({})
|
|
20738
|
+
},
|
|
20739
|
+
remote: Boolean,
|
|
20740
|
+
size: useSizeProp,
|
|
20741
|
+
props: {
|
|
20742
|
+
type: definePropType(Object),
|
|
20743
|
+
default: () => defaultProps
|
|
20744
|
+
},
|
|
20745
|
+
valueKey: {
|
|
20746
|
+
type: String,
|
|
20747
|
+
default: "value"
|
|
20748
|
+
},
|
|
20749
|
+
scrollbarAlwaysOn: Boolean,
|
|
20750
|
+
validateEvent: {
|
|
20751
|
+
type: Boolean,
|
|
20752
|
+
default: true
|
|
20753
|
+
},
|
|
20754
|
+
offset: {
|
|
20755
|
+
type: Number,
|
|
20756
|
+
default: 12
|
|
20757
|
+
},
|
|
20758
|
+
showArrow: {
|
|
20759
|
+
type: Boolean,
|
|
20760
|
+
default: true
|
|
20761
|
+
},
|
|
20762
|
+
placement: {
|
|
20763
|
+
type: definePropType(String),
|
|
20764
|
+
values: Ee,
|
|
20765
|
+
default: "bottom-start"
|
|
20766
|
+
},
|
|
20767
|
+
fallbackPlacements: {
|
|
20768
|
+
type: definePropType(Array),
|
|
20769
|
+
default: ["bottom-start", "top-start", "right", "left"]
|
|
20770
|
+
},
|
|
20771
|
+
tagType: { ...tagProps.type, default: "info" },
|
|
20772
|
+
tagEffect: { ...tagProps.effect, default: "light" },
|
|
20773
|
+
tabindex: {
|
|
20774
|
+
type: [String, Number],
|
|
20775
|
+
default: 0
|
|
20776
|
+
},
|
|
20777
|
+
appendTo: String,
|
|
20778
|
+
fitInputWidth: {
|
|
20779
|
+
type: [Boolean, Number],
|
|
20780
|
+
default: true,
|
|
20781
|
+
validator(val) {
|
|
20782
|
+
return isBoolean(val) || isNumber(val);
|
|
20783
|
+
}
|
|
20784
|
+
},
|
|
20785
|
+
...useEmptyValuesProps,
|
|
20786
|
+
...useAriaProps(["ariaLabel"])
|
|
20787
|
+
});
|
|
20788
|
+
const OptionProps = buildProps({
|
|
20789
|
+
data: Array,
|
|
20790
|
+
disabled: Boolean,
|
|
20791
|
+
hovering: Boolean,
|
|
20792
|
+
item: {
|
|
20793
|
+
type: definePropType(Object),
|
|
20794
|
+
required: true
|
|
20795
|
+
},
|
|
20796
|
+
index: Number,
|
|
20797
|
+
style: Object,
|
|
20798
|
+
selected: Boolean,
|
|
20799
|
+
created: Boolean
|
|
20800
|
+
});
|
|
20801
|
+
const selectEmits = {
|
|
20802
|
+
[UPDATE_MODEL_EVENT]: (val) => true,
|
|
20803
|
+
[CHANGE_EVENT]: (val) => true,
|
|
20804
|
+
"remove-tag": (val) => true,
|
|
20805
|
+
"visible-change": (visible) => true,
|
|
20806
|
+
focus: (evt) => evt instanceof FocusEvent,
|
|
20807
|
+
blur: (evt) => evt instanceof FocusEvent,
|
|
20808
|
+
clear: () => true
|
|
20809
|
+
};
|
|
20810
|
+
const optionEmits = {
|
|
20811
|
+
hover: (index) => isNumber(index),
|
|
20812
|
+
select: (val, index) => true
|
|
20813
|
+
};
|
|
20814
|
+
|
|
20815
|
+
const selectV2InjectionKey = Symbol("ElSelectV2Injection");
|
|
20816
|
+
|
|
20817
|
+
const _sfc_main$e = vue.defineComponent({
|
|
20818
|
+
props: OptionProps,
|
|
20819
|
+
emits: optionEmits,
|
|
20820
|
+
setup(props, { emit }) {
|
|
20821
|
+
const select = vue.inject(selectV2InjectionKey);
|
|
20822
|
+
const ns = useNamespace("select");
|
|
20823
|
+
const { hoverItem, selectOptionClick } = useOption(props, { emit });
|
|
20824
|
+
const { getLabel } = useProps(select.props);
|
|
20825
|
+
return {
|
|
20826
|
+
ns,
|
|
20827
|
+
hoverItem,
|
|
20828
|
+
selectOptionClick,
|
|
20829
|
+
getLabel
|
|
20830
|
+
};
|
|
20831
|
+
}
|
|
20832
|
+
});
|
|
20833
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
20834
|
+
return vue.openBlock(), vue.createElementBlock("li", {
|
|
20835
|
+
"aria-selected": _ctx.selected,
|
|
20836
|
+
style: vue.normalizeStyle(_ctx.style),
|
|
20837
|
+
class: vue.normalizeClass([
|
|
20838
|
+
_ctx.ns.be("dropdown", "item"),
|
|
20839
|
+
_ctx.ns.is("selected", _ctx.selected),
|
|
20840
|
+
_ctx.ns.is("disabled", _ctx.disabled),
|
|
20841
|
+
_ctx.ns.is("created", _ctx.created),
|
|
20842
|
+
_ctx.ns.is("hovering", _ctx.hovering)
|
|
20843
|
+
]),
|
|
20844
|
+
onMousemove: _ctx.hoverItem,
|
|
20845
|
+
onClick: vue.withModifiers(_ctx.selectOptionClick, ["stop"])
|
|
20846
|
+
}, [
|
|
20847
|
+
vue.renderSlot(_ctx.$slots, "default", {
|
|
20848
|
+
item: _ctx.item,
|
|
20849
|
+
index: _ctx.index,
|
|
20850
|
+
disabled: _ctx.disabled
|
|
20851
|
+
}, () => [
|
|
20852
|
+
vue.createElementVNode("span", null, vue.toDisplayString(_ctx.getLabel(_ctx.item)), 1)
|
|
20853
|
+
])
|
|
20854
|
+
], 46, ["aria-selected", "onMousemove", "onClick"]);
|
|
20855
|
+
}
|
|
20856
|
+
var OptionItem = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$1], ["__file", "option-item.vue"]]);
|
|
20857
|
+
|
|
20858
|
+
var safeIsNaN = Number.isNaN || function ponyfill(value) {
|
|
20859
|
+
return typeof value === "number" && value !== value;
|
|
20860
|
+
};
|
|
20861
|
+
function isEqual(first, second) {
|
|
20862
|
+
if (first === second) {
|
|
20863
|
+
return true;
|
|
20864
|
+
}
|
|
20865
|
+
if (safeIsNaN(first) && safeIsNaN(second)) {
|
|
20866
|
+
return true;
|
|
20867
|
+
}
|
|
20868
|
+
return false;
|
|
20869
|
+
}
|
|
20870
|
+
function areInputsEqual(newInputs, lastInputs) {
|
|
20871
|
+
if (newInputs.length !== lastInputs.length) {
|
|
20872
|
+
return false;
|
|
20873
|
+
}
|
|
20874
|
+
for (var i = 0; i < newInputs.length; i++) {
|
|
20875
|
+
if (!isEqual(newInputs[i], lastInputs[i])) {
|
|
20876
|
+
return false;
|
|
20877
|
+
}
|
|
20878
|
+
}
|
|
20879
|
+
return true;
|
|
20880
|
+
}
|
|
20881
|
+
function memoizeOne(resultFn, isEqual2) {
|
|
20882
|
+
if (isEqual2 === void 0) {
|
|
20883
|
+
isEqual2 = areInputsEqual;
|
|
20884
|
+
}
|
|
20885
|
+
var cache = null;
|
|
20886
|
+
function memoized() {
|
|
20887
|
+
var newArgs = [];
|
|
20888
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
20889
|
+
newArgs[_i] = arguments[_i];
|
|
20890
|
+
}
|
|
20891
|
+
if (cache && cache.lastThis === this && isEqual2(newArgs, cache.lastArgs)) {
|
|
20892
|
+
return cache.lastResult;
|
|
20893
|
+
}
|
|
20894
|
+
var lastResult = resultFn.apply(this, newArgs);
|
|
20895
|
+
cache = {
|
|
20896
|
+
lastResult,
|
|
20897
|
+
lastArgs: newArgs,
|
|
20898
|
+
lastThis: this
|
|
20899
|
+
};
|
|
20900
|
+
return lastResult;
|
|
20901
|
+
}
|
|
20902
|
+
memoized.clear = function clear() {
|
|
20903
|
+
cache = null;
|
|
20904
|
+
};
|
|
20905
|
+
return memoized;
|
|
20906
|
+
}
|
|
20907
|
+
|
|
20908
|
+
const useCache = () => {
|
|
20909
|
+
const vm = vue.getCurrentInstance();
|
|
20910
|
+
const props = vm.proxy.$props;
|
|
20911
|
+
return vue.computed(() => {
|
|
20912
|
+
const _getItemStyleCache = (_, __, ___) => ({});
|
|
20913
|
+
return props.perfMode ? memoize(_getItemStyleCache) : memoizeOne(_getItemStyleCache);
|
|
20914
|
+
});
|
|
20915
|
+
};
|
|
20916
|
+
|
|
20917
|
+
const DEFAULT_DYNAMIC_LIST_ITEM_SIZE = 50;
|
|
20918
|
+
const ITEM_RENDER_EVT = "itemRendered";
|
|
20919
|
+
const SCROLL_EVT = "scroll";
|
|
20920
|
+
const FORWARD = "forward";
|
|
20921
|
+
const BACKWARD = "backward";
|
|
20922
|
+
const AUTO_ALIGNMENT = "auto";
|
|
20923
|
+
const SMART_ALIGNMENT = "smart";
|
|
20924
|
+
const START_ALIGNMENT = "start";
|
|
20925
|
+
const CENTERED_ALIGNMENT = "center";
|
|
20926
|
+
const END_ALIGNMENT = "end";
|
|
20927
|
+
const HORIZONTAL = "horizontal";
|
|
20928
|
+
const VERTICAL = "vertical";
|
|
20929
|
+
const LTR = "ltr";
|
|
20930
|
+
const RTL = "rtl";
|
|
20931
|
+
const RTL_OFFSET_NAG = "negative";
|
|
20932
|
+
const RTL_OFFSET_POS_ASC = "positive-ascending";
|
|
20933
|
+
const RTL_OFFSET_POS_DESC = "positive-descending";
|
|
20934
|
+
const ScrollbarDirKey = {
|
|
20935
|
+
[HORIZONTAL]: "left",
|
|
20936
|
+
[VERTICAL]: "top"
|
|
20937
|
+
};
|
|
20938
|
+
const SCROLLBAR_MIN_SIZE = 20;
|
|
20939
|
+
|
|
20940
|
+
const LayoutKeys = {
|
|
20941
|
+
[HORIZONTAL]: "deltaX",
|
|
20942
|
+
[VERTICAL]: "deltaY"
|
|
20943
|
+
};
|
|
20944
|
+
const useWheel = ({ atEndEdge, atStartEdge, layout }, onWheelDelta) => {
|
|
20945
|
+
let frameHandle;
|
|
20946
|
+
let offset = 0;
|
|
20947
|
+
const hasReachedEdge = (offset2) => {
|
|
20948
|
+
const edgeReached = offset2 < 0 && atStartEdge.value || offset2 > 0 && atEndEdge.value;
|
|
20949
|
+
return edgeReached;
|
|
20950
|
+
};
|
|
20951
|
+
const onWheel = (e) => {
|
|
20952
|
+
cAF(frameHandle);
|
|
20953
|
+
const newOffset = e[LayoutKeys[layout.value]];
|
|
20954
|
+
if (hasReachedEdge(offset) && hasReachedEdge(offset + newOffset))
|
|
20955
|
+
return;
|
|
20956
|
+
offset += newOffset;
|
|
20957
|
+
if (!isFirefox()) {
|
|
20958
|
+
e.preventDefault();
|
|
20959
|
+
}
|
|
20960
|
+
frameHandle = rAF(() => {
|
|
20961
|
+
onWheelDelta(offset);
|
|
20962
|
+
offset = 0;
|
|
20963
|
+
});
|
|
20964
|
+
};
|
|
20965
|
+
return {
|
|
20966
|
+
hasReachedEdge,
|
|
20967
|
+
onWheel
|
|
20968
|
+
};
|
|
20969
|
+
};
|
|
20970
|
+
|
|
20971
|
+
const itemSize = buildProp({
|
|
20972
|
+
type: definePropType([Number, Function]),
|
|
20973
|
+
required: true
|
|
20974
|
+
});
|
|
20975
|
+
const estimatedItemSize = buildProp({
|
|
20976
|
+
type: Number
|
|
20977
|
+
});
|
|
20978
|
+
const cache = buildProp({
|
|
20979
|
+
type: Number,
|
|
20980
|
+
default: 2
|
|
20981
|
+
});
|
|
20982
|
+
const direction = buildProp({
|
|
20983
|
+
type: String,
|
|
20984
|
+
values: ["ltr", "rtl"],
|
|
20985
|
+
default: "ltr"
|
|
20986
|
+
});
|
|
20987
|
+
const initScrollOffset = buildProp({
|
|
20988
|
+
type: Number,
|
|
20989
|
+
default: 0
|
|
20990
|
+
});
|
|
20991
|
+
const total = buildProp({
|
|
20992
|
+
type: Number,
|
|
20993
|
+
required: true
|
|
20994
|
+
});
|
|
20995
|
+
const layout = buildProp({
|
|
20996
|
+
type: String,
|
|
20997
|
+
values: ["horizontal", "vertical"],
|
|
20998
|
+
default: VERTICAL
|
|
20999
|
+
});
|
|
21000
|
+
const virtualizedProps = buildProps({
|
|
21001
|
+
className: {
|
|
21002
|
+
type: String,
|
|
21003
|
+
default: ""
|
|
21004
|
+
},
|
|
21005
|
+
containerElement: {
|
|
21006
|
+
type: definePropType([String, Object]),
|
|
21007
|
+
default: "div"
|
|
21008
|
+
},
|
|
21009
|
+
data: {
|
|
21010
|
+
type: definePropType(Array),
|
|
21011
|
+
default: () => mutable([])
|
|
21012
|
+
},
|
|
21013
|
+
direction,
|
|
21014
|
+
height: {
|
|
21015
|
+
type: [String, Number],
|
|
21016
|
+
required: true
|
|
21017
|
+
},
|
|
21018
|
+
innerElement: {
|
|
21019
|
+
type: [String, Object],
|
|
21020
|
+
default: "div"
|
|
21021
|
+
},
|
|
21022
|
+
style: {
|
|
21023
|
+
type: definePropType([Object, String, Array])
|
|
21024
|
+
},
|
|
21025
|
+
useIsScrolling: {
|
|
21026
|
+
type: Boolean,
|
|
21027
|
+
default: false
|
|
21028
|
+
},
|
|
21029
|
+
width: {
|
|
21030
|
+
type: [Number, String],
|
|
21031
|
+
required: false
|
|
21032
|
+
},
|
|
21033
|
+
perfMode: {
|
|
21034
|
+
type: Boolean,
|
|
21035
|
+
default: true
|
|
21036
|
+
},
|
|
21037
|
+
scrollbarAlwaysOn: {
|
|
21038
|
+
type: Boolean,
|
|
21039
|
+
default: false
|
|
21040
|
+
}
|
|
21041
|
+
});
|
|
21042
|
+
const virtualizedListProps = buildProps({
|
|
21043
|
+
cache,
|
|
21044
|
+
estimatedItemSize,
|
|
21045
|
+
layout,
|
|
21046
|
+
initScrollOffset,
|
|
21047
|
+
total,
|
|
21048
|
+
itemSize,
|
|
21049
|
+
...virtualizedProps
|
|
21050
|
+
});
|
|
21051
|
+
const scrollbarSize = {
|
|
21052
|
+
type: Number,
|
|
21053
|
+
default: 6
|
|
21054
|
+
};
|
|
21055
|
+
const startGap = { type: Number, default: 0 };
|
|
21056
|
+
const endGap = { type: Number, default: 2 };
|
|
21057
|
+
buildProps({
|
|
21058
|
+
columnCache: cache,
|
|
21059
|
+
columnWidth: itemSize,
|
|
21060
|
+
estimatedColumnWidth: estimatedItemSize,
|
|
21061
|
+
estimatedRowHeight: estimatedItemSize,
|
|
21062
|
+
initScrollLeft: initScrollOffset,
|
|
21063
|
+
initScrollTop: initScrollOffset,
|
|
21064
|
+
itemKey: {
|
|
21065
|
+
type: definePropType(Function),
|
|
21066
|
+
default: ({
|
|
21067
|
+
columnIndex,
|
|
21068
|
+
rowIndex
|
|
21069
|
+
}) => `${rowIndex}:${columnIndex}`
|
|
21070
|
+
},
|
|
21071
|
+
rowCache: cache,
|
|
21072
|
+
rowHeight: itemSize,
|
|
21073
|
+
totalColumn: total,
|
|
21074
|
+
totalRow: total,
|
|
21075
|
+
hScrollbarSize: scrollbarSize,
|
|
21076
|
+
vScrollbarSize: scrollbarSize,
|
|
21077
|
+
scrollbarStartGap: startGap,
|
|
21078
|
+
scrollbarEndGap: endGap,
|
|
21079
|
+
role: String,
|
|
21080
|
+
...virtualizedProps
|
|
21081
|
+
});
|
|
21082
|
+
const virtualizedScrollbarProps = buildProps({
|
|
21083
|
+
alwaysOn: Boolean,
|
|
21084
|
+
class: String,
|
|
21085
|
+
layout,
|
|
21086
|
+
total,
|
|
21087
|
+
ratio: {
|
|
21088
|
+
type: Number,
|
|
21089
|
+
required: true
|
|
21090
|
+
},
|
|
21091
|
+
clientSize: {
|
|
21092
|
+
type: Number,
|
|
21093
|
+
required: true
|
|
21094
|
+
},
|
|
21095
|
+
scrollFrom: {
|
|
21096
|
+
type: Number,
|
|
21097
|
+
required: true
|
|
21098
|
+
},
|
|
21099
|
+
scrollbarSize,
|
|
21100
|
+
startGap,
|
|
21101
|
+
endGap,
|
|
21102
|
+
visible: Boolean
|
|
21103
|
+
});
|
|
21104
|
+
|
|
21105
|
+
const getScrollDir = (prev, cur) => prev < cur ? FORWARD : BACKWARD;
|
|
21106
|
+
const isHorizontal = (dir) => dir === LTR || dir === RTL || dir === HORIZONTAL;
|
|
21107
|
+
let cachedRTLResult = null;
|
|
21108
|
+
function getRTLOffsetType(recalculate = false) {
|
|
21109
|
+
if (cachedRTLResult === null || recalculate) {
|
|
21110
|
+
const outerDiv = document.createElement("div");
|
|
21111
|
+
const outerStyle = outerDiv.style;
|
|
21112
|
+
outerStyle.width = "50px";
|
|
21113
|
+
outerStyle.height = "50px";
|
|
21114
|
+
outerStyle.overflow = "scroll";
|
|
21115
|
+
outerStyle.direction = "rtl";
|
|
21116
|
+
const innerDiv = document.createElement("div");
|
|
21117
|
+
const innerStyle = innerDiv.style;
|
|
21118
|
+
innerStyle.width = "100px";
|
|
21119
|
+
innerStyle.height = "100px";
|
|
21120
|
+
outerDiv.appendChild(innerDiv);
|
|
21121
|
+
document.body.appendChild(outerDiv);
|
|
21122
|
+
if (outerDiv.scrollLeft > 0) {
|
|
21123
|
+
cachedRTLResult = RTL_OFFSET_POS_DESC;
|
|
21124
|
+
} else {
|
|
21125
|
+
outerDiv.scrollLeft = 1;
|
|
21126
|
+
if (outerDiv.scrollLeft === 0) {
|
|
21127
|
+
cachedRTLResult = RTL_OFFSET_NAG;
|
|
21128
|
+
} else {
|
|
21129
|
+
cachedRTLResult = RTL_OFFSET_POS_ASC;
|
|
21130
|
+
}
|
|
21131
|
+
}
|
|
21132
|
+
document.body.removeChild(outerDiv);
|
|
21133
|
+
return cachedRTLResult;
|
|
21134
|
+
}
|
|
21135
|
+
return cachedRTLResult;
|
|
21136
|
+
}
|
|
21137
|
+
function renderThumbStyle({ move, size, bar }, layout) {
|
|
21138
|
+
const style = {};
|
|
21139
|
+
const translate = `translate${bar.axis}(${move}px)`;
|
|
21140
|
+
style[bar.size] = size;
|
|
21141
|
+
style.transform = translate;
|
|
21142
|
+
style.msTransform = translate;
|
|
21143
|
+
style.webkitTransform = translate;
|
|
21144
|
+
if (layout === "horizontal") {
|
|
21145
|
+
style.height = "100%";
|
|
21146
|
+
} else {
|
|
21147
|
+
style.width = "100%";
|
|
21148
|
+
}
|
|
21149
|
+
return style;
|
|
21150
|
+
}
|
|
21151
|
+
|
|
21152
|
+
const ScrollBar = vue.defineComponent({
|
|
21153
|
+
name: "ElVirtualScrollBar",
|
|
21154
|
+
props: virtualizedScrollbarProps,
|
|
21155
|
+
emits: ["scroll", "start-move", "stop-move"],
|
|
21156
|
+
setup(props, { emit }) {
|
|
21157
|
+
const GAP = vue.computed(() => props.startGap + props.endGap);
|
|
21158
|
+
const nsVirtualScrollbar = useNamespace("virtual-scrollbar");
|
|
21159
|
+
const nsScrollbar = useNamespace("scrollbar");
|
|
21160
|
+
const trackRef = vue.ref();
|
|
21161
|
+
const thumbRef = vue.ref();
|
|
21162
|
+
let frameHandle = null;
|
|
21163
|
+
let onselectstartStore = null;
|
|
21164
|
+
const state = vue.reactive({
|
|
21165
|
+
isDragging: false,
|
|
21166
|
+
traveled: 0
|
|
21167
|
+
});
|
|
21168
|
+
const bar = vue.computed(() => BAR_MAP[props.layout]);
|
|
21169
|
+
const trackSize = vue.computed(() => props.clientSize - vue.unref(GAP));
|
|
21170
|
+
const trackStyle = vue.computed(() => ({
|
|
21171
|
+
position: "absolute",
|
|
21172
|
+
width: `${HORIZONTAL === props.layout ? trackSize.value : props.scrollbarSize}px`,
|
|
21173
|
+
height: `${HORIZONTAL === props.layout ? props.scrollbarSize : trackSize.value}px`,
|
|
21174
|
+
[ScrollbarDirKey[props.layout]]: "2px",
|
|
21175
|
+
right: "2px",
|
|
21176
|
+
bottom: "2px",
|
|
21177
|
+
borderRadius: "4px"
|
|
21178
|
+
}));
|
|
21179
|
+
const thumbSize = vue.computed(() => {
|
|
21180
|
+
const ratio = props.ratio;
|
|
21181
|
+
const clientSize = props.clientSize;
|
|
21182
|
+
if (ratio >= 100) {
|
|
21183
|
+
return Number.POSITIVE_INFINITY;
|
|
21184
|
+
}
|
|
21185
|
+
if (ratio >= 50) {
|
|
21186
|
+
return ratio * clientSize / 100;
|
|
21187
|
+
}
|
|
21188
|
+
const SCROLLBAR_MAX_SIZE = clientSize / 3;
|
|
21189
|
+
return Math.floor(Math.min(Math.max(ratio * clientSize, SCROLLBAR_MIN_SIZE), SCROLLBAR_MAX_SIZE));
|
|
21190
|
+
});
|
|
21191
|
+
const thumbStyle = vue.computed(() => {
|
|
21192
|
+
if (!Number.isFinite(thumbSize.value)) {
|
|
21193
|
+
return {
|
|
21194
|
+
display: "none"
|
|
21195
|
+
};
|
|
21196
|
+
}
|
|
21197
|
+
const thumb = `${thumbSize.value}px`;
|
|
21198
|
+
const style = renderThumbStyle({
|
|
21199
|
+
bar: bar.value,
|
|
21200
|
+
size: thumb,
|
|
21201
|
+
move: state.traveled
|
|
21202
|
+
}, props.layout);
|
|
21203
|
+
return style;
|
|
21204
|
+
});
|
|
21205
|
+
const totalSteps = vue.computed(() => Math.floor(props.clientSize - thumbSize.value - vue.unref(GAP)));
|
|
21206
|
+
const attachEvents = () => {
|
|
21207
|
+
window.addEventListener("mousemove", onMouseMove);
|
|
21208
|
+
window.addEventListener("mouseup", onMouseUp);
|
|
21209
|
+
const thumbEl = vue.unref(thumbRef);
|
|
21210
|
+
if (!thumbEl)
|
|
21211
|
+
return;
|
|
21212
|
+
onselectstartStore = document.onselectstart;
|
|
21213
|
+
document.onselectstart = () => false;
|
|
21214
|
+
thumbEl.addEventListener("touchmove", onMouseMove, { passive: true });
|
|
21215
|
+
thumbEl.addEventListener("touchend", onMouseUp);
|
|
21216
|
+
};
|
|
21217
|
+
const detachEvents = () => {
|
|
21218
|
+
window.removeEventListener("mousemove", onMouseMove);
|
|
21219
|
+
window.removeEventListener("mouseup", onMouseUp);
|
|
21220
|
+
document.onselectstart = onselectstartStore;
|
|
21221
|
+
onselectstartStore = null;
|
|
21222
|
+
const thumbEl = vue.unref(thumbRef);
|
|
21223
|
+
if (!thumbEl)
|
|
21224
|
+
return;
|
|
21225
|
+
thumbEl.removeEventListener("touchmove", onMouseMove);
|
|
21226
|
+
thumbEl.removeEventListener("touchend", onMouseUp);
|
|
21227
|
+
};
|
|
21228
|
+
const onThumbMouseDown = (e) => {
|
|
21229
|
+
e.stopImmediatePropagation();
|
|
21230
|
+
if (e.ctrlKey || [1, 2].includes(e.button)) {
|
|
21231
|
+
return;
|
|
21232
|
+
}
|
|
21233
|
+
state.isDragging = true;
|
|
21234
|
+
state[bar.value.axis] = e.currentTarget[bar.value.offset] - (e[bar.value.client] - e.currentTarget.getBoundingClientRect()[bar.value.direction]);
|
|
21235
|
+
emit("start-move");
|
|
21236
|
+
attachEvents();
|
|
21237
|
+
};
|
|
21238
|
+
const onMouseUp = () => {
|
|
21239
|
+
state.isDragging = false;
|
|
21240
|
+
state[bar.value.axis] = 0;
|
|
21241
|
+
emit("stop-move");
|
|
21242
|
+
detachEvents();
|
|
21243
|
+
};
|
|
21244
|
+
const onMouseMove = (e) => {
|
|
21245
|
+
const { isDragging } = state;
|
|
21246
|
+
if (!isDragging)
|
|
21247
|
+
return;
|
|
21248
|
+
if (!thumbRef.value || !trackRef.value)
|
|
21249
|
+
return;
|
|
21250
|
+
const prevPage = state[bar.value.axis];
|
|
21251
|
+
if (!prevPage)
|
|
21252
|
+
return;
|
|
21253
|
+
cAF(frameHandle);
|
|
21254
|
+
const offset = (trackRef.value.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1;
|
|
21255
|
+
const thumbClickPosition = thumbRef.value[bar.value.offset] - prevPage;
|
|
21256
|
+
const distance = offset - thumbClickPosition;
|
|
21257
|
+
frameHandle = rAF(() => {
|
|
21258
|
+
state.traveled = Math.max(props.startGap, Math.min(distance, totalSteps.value));
|
|
21259
|
+
emit("scroll", distance, totalSteps.value);
|
|
21260
|
+
});
|
|
21261
|
+
};
|
|
21262
|
+
const clickTrackHandler = (e) => {
|
|
21263
|
+
const offset = Math.abs(e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]);
|
|
21264
|
+
const thumbHalf = thumbRef.value[bar.value.offset] / 2;
|
|
21265
|
+
const distance = offset - thumbHalf;
|
|
21266
|
+
state.traveled = Math.max(0, Math.min(distance, totalSteps.value));
|
|
21267
|
+
emit("scroll", distance, totalSteps.value);
|
|
21268
|
+
};
|
|
21269
|
+
vue.watch(() => props.scrollFrom, (v) => {
|
|
21270
|
+
if (state.isDragging)
|
|
21271
|
+
return;
|
|
21272
|
+
state.traveled = Math.ceil(v * totalSteps.value);
|
|
21273
|
+
});
|
|
21274
|
+
vue.onBeforeUnmount(() => {
|
|
21275
|
+
detachEvents();
|
|
21276
|
+
});
|
|
21277
|
+
return () => {
|
|
21278
|
+
return vue.h("div", {
|
|
21279
|
+
role: "presentation",
|
|
21280
|
+
ref: trackRef,
|
|
21281
|
+
class: [
|
|
21282
|
+
nsVirtualScrollbar.b(),
|
|
21283
|
+
props.class,
|
|
21284
|
+
(props.alwaysOn || state.isDragging) && "always-on"
|
|
21285
|
+
],
|
|
21286
|
+
style: trackStyle.value,
|
|
21287
|
+
onMousedown: vue.withModifiers(clickTrackHandler, ["stop", "prevent"]),
|
|
21288
|
+
onTouchstartPrevent: onThumbMouseDown
|
|
21289
|
+
}, vue.h("div", {
|
|
21290
|
+
ref: thumbRef,
|
|
21291
|
+
class: nsScrollbar.e("thumb"),
|
|
21292
|
+
style: thumbStyle.value,
|
|
21293
|
+
onMousedown: onThumbMouseDown
|
|
21294
|
+
}, []));
|
|
21295
|
+
};
|
|
21296
|
+
}
|
|
21297
|
+
});
|
|
21298
|
+
|
|
21299
|
+
const createList = ({
|
|
21300
|
+
name,
|
|
21301
|
+
getOffset,
|
|
21302
|
+
getItemSize,
|
|
21303
|
+
getItemOffset,
|
|
21304
|
+
getEstimatedTotalSize,
|
|
21305
|
+
getStartIndexForOffset,
|
|
21306
|
+
getStopIndexForStartIndex,
|
|
21307
|
+
initCache,
|
|
21308
|
+
clearCache,
|
|
21309
|
+
validateProps
|
|
21310
|
+
}) => {
|
|
21311
|
+
return vue.defineComponent({
|
|
21312
|
+
name: name != null ? name : "ElVirtualList",
|
|
21313
|
+
props: virtualizedListProps,
|
|
21314
|
+
emits: [ITEM_RENDER_EVT, SCROLL_EVT],
|
|
21315
|
+
setup(props, { emit, expose }) {
|
|
21316
|
+
validateProps(props);
|
|
21317
|
+
const instance = vue.getCurrentInstance();
|
|
21318
|
+
const ns = useNamespace("vl");
|
|
21319
|
+
const dynamicSizeCache = vue.ref(initCache(props, instance));
|
|
21320
|
+
const getItemStyleCache = useCache();
|
|
21321
|
+
const windowRef = vue.ref();
|
|
21322
|
+
const innerRef = vue.ref();
|
|
21323
|
+
const scrollbarRef = vue.ref();
|
|
21324
|
+
const states = vue.ref({
|
|
21325
|
+
isScrolling: false,
|
|
21326
|
+
scrollDir: "forward",
|
|
21327
|
+
scrollOffset: isNumber(props.initScrollOffset) ? props.initScrollOffset : 0,
|
|
21328
|
+
updateRequested: false,
|
|
21329
|
+
isScrollbarDragging: false,
|
|
21330
|
+
scrollbarAlwaysOn: props.scrollbarAlwaysOn
|
|
21331
|
+
});
|
|
21332
|
+
const itemsToRender = vue.computed(() => {
|
|
21333
|
+
const { total, cache } = props;
|
|
21334
|
+
const { isScrolling, scrollDir, scrollOffset } = vue.unref(states);
|
|
21335
|
+
if (total === 0) {
|
|
21336
|
+
return [0, 0, 0, 0];
|
|
21337
|
+
}
|
|
21338
|
+
const startIndex = getStartIndexForOffset(props, scrollOffset, vue.unref(dynamicSizeCache));
|
|
21339
|
+
const stopIndex = getStopIndexForStartIndex(props, startIndex, scrollOffset, vue.unref(dynamicSizeCache));
|
|
21340
|
+
const cacheBackward = !isScrolling || scrollDir === BACKWARD ? Math.max(1, cache) : 1;
|
|
21341
|
+
const cacheForward = !isScrolling || scrollDir === FORWARD ? Math.max(1, cache) : 1;
|
|
21342
|
+
return [
|
|
21343
|
+
Math.max(0, startIndex - cacheBackward),
|
|
21344
|
+
Math.max(0, Math.min(total - 1, stopIndex + cacheForward)),
|
|
21345
|
+
startIndex,
|
|
21346
|
+
stopIndex
|
|
21347
|
+
];
|
|
21348
|
+
});
|
|
21349
|
+
const estimatedTotalSize = vue.computed(() => getEstimatedTotalSize(props, vue.unref(dynamicSizeCache)));
|
|
21350
|
+
const _isHorizontal = vue.computed(() => isHorizontal(props.layout));
|
|
21351
|
+
const windowStyle = vue.computed(() => [
|
|
21352
|
+
{
|
|
21353
|
+
position: "relative",
|
|
21354
|
+
[`overflow-${_isHorizontal.value ? "x" : "y"}`]: "scroll",
|
|
21355
|
+
WebkitOverflowScrolling: "touch",
|
|
21356
|
+
willChange: "transform"
|
|
21357
|
+
},
|
|
21358
|
+
{
|
|
21359
|
+
direction: props.direction,
|
|
21360
|
+
height: isNumber(props.height) ? `${props.height}px` : props.height,
|
|
21361
|
+
width: isNumber(props.width) ? `${props.width}px` : props.width
|
|
21362
|
+
},
|
|
21363
|
+
props.style
|
|
21364
|
+
]);
|
|
21365
|
+
const innerStyle = vue.computed(() => {
|
|
21366
|
+
const size = vue.unref(estimatedTotalSize);
|
|
21367
|
+
const horizontal = vue.unref(_isHorizontal);
|
|
21368
|
+
return {
|
|
21369
|
+
height: horizontal ? "100%" : `${size}px`,
|
|
21370
|
+
pointerEvents: vue.unref(states).isScrolling ? "none" : void 0,
|
|
21371
|
+
width: horizontal ? `${size}px` : "100%"
|
|
21372
|
+
};
|
|
21373
|
+
});
|
|
21374
|
+
const clientSize = vue.computed(() => _isHorizontal.value ? props.width : props.height);
|
|
21375
|
+
const { onWheel } = useWheel({
|
|
21376
|
+
atStartEdge: vue.computed(() => states.value.scrollOffset <= 0),
|
|
21377
|
+
atEndEdge: vue.computed(() => states.value.scrollOffset >= estimatedTotalSize.value),
|
|
21378
|
+
layout: vue.computed(() => props.layout)
|
|
21379
|
+
}, (offset) => {
|
|
21380
|
+
var _a, _b;
|
|
21381
|
+
(_b = (_a = scrollbarRef.value).onMouseUp) == null ? void 0 : _b.call(_a);
|
|
21382
|
+
scrollTo(Math.min(states.value.scrollOffset + offset, estimatedTotalSize.value - clientSize.value));
|
|
21383
|
+
});
|
|
21384
|
+
useEventListener(windowRef, "wheel", onWheel, {
|
|
21385
|
+
passive: false
|
|
21386
|
+
});
|
|
21387
|
+
const emitEvents = () => {
|
|
21388
|
+
const { total } = props;
|
|
21389
|
+
if (total > 0) {
|
|
21390
|
+
const [cacheStart, cacheEnd, visibleStart, visibleEnd] = vue.unref(itemsToRender);
|
|
21391
|
+
emit(ITEM_RENDER_EVT, cacheStart, cacheEnd, visibleStart, visibleEnd);
|
|
21392
|
+
}
|
|
21393
|
+
const { scrollDir, scrollOffset, updateRequested } = vue.unref(states);
|
|
21394
|
+
emit(SCROLL_EVT, scrollDir, scrollOffset, updateRequested);
|
|
21395
|
+
};
|
|
21396
|
+
const scrollVertically = (e) => {
|
|
21397
|
+
const { clientHeight, scrollHeight, scrollTop } = e.currentTarget;
|
|
21398
|
+
const _states = vue.unref(states);
|
|
21399
|
+
if (_states.scrollOffset === scrollTop) {
|
|
21400
|
+
return;
|
|
21401
|
+
}
|
|
21402
|
+
const scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight));
|
|
21403
|
+
states.value = {
|
|
21404
|
+
..._states,
|
|
21405
|
+
isScrolling: true,
|
|
21406
|
+
scrollDir: getScrollDir(_states.scrollOffset, scrollOffset),
|
|
21407
|
+
scrollOffset,
|
|
21408
|
+
updateRequested: false
|
|
21409
|
+
};
|
|
21410
|
+
vue.nextTick(resetIsScrolling);
|
|
21411
|
+
};
|
|
21412
|
+
const scrollHorizontally = (e) => {
|
|
21413
|
+
const { clientWidth, scrollLeft, scrollWidth } = e.currentTarget;
|
|
21414
|
+
const _states = vue.unref(states);
|
|
21415
|
+
if (_states.scrollOffset === scrollLeft) {
|
|
21416
|
+
return;
|
|
21417
|
+
}
|
|
21418
|
+
const { direction } = props;
|
|
21419
|
+
let scrollOffset = scrollLeft;
|
|
21420
|
+
if (direction === RTL) {
|
|
21421
|
+
switch (getRTLOffsetType()) {
|
|
21422
|
+
case RTL_OFFSET_NAG: {
|
|
21423
|
+
scrollOffset = -scrollLeft;
|
|
21424
|
+
break;
|
|
21425
|
+
}
|
|
21426
|
+
case RTL_OFFSET_POS_DESC: {
|
|
21427
|
+
scrollOffset = scrollWidth - clientWidth - scrollLeft;
|
|
21428
|
+
break;
|
|
21429
|
+
}
|
|
21430
|
+
}
|
|
21431
|
+
}
|
|
21432
|
+
scrollOffset = Math.max(0, Math.min(scrollOffset, scrollWidth - clientWidth));
|
|
21433
|
+
states.value = {
|
|
21434
|
+
..._states,
|
|
21435
|
+
isScrolling: true,
|
|
21436
|
+
scrollDir: getScrollDir(_states.scrollOffset, scrollOffset),
|
|
21437
|
+
scrollOffset,
|
|
21438
|
+
updateRequested: false
|
|
21439
|
+
};
|
|
21440
|
+
vue.nextTick(resetIsScrolling);
|
|
21441
|
+
};
|
|
21442
|
+
const onScroll = (e) => {
|
|
21443
|
+
vue.unref(_isHorizontal) ? scrollHorizontally(e) : scrollVertically(e);
|
|
21444
|
+
emitEvents();
|
|
21445
|
+
};
|
|
21446
|
+
const onScrollbarScroll = (distanceToGo, totalSteps) => {
|
|
21447
|
+
const offset = (estimatedTotalSize.value - clientSize.value) / totalSteps * distanceToGo;
|
|
21448
|
+
scrollTo(Math.min(estimatedTotalSize.value - clientSize.value, offset));
|
|
21449
|
+
};
|
|
21450
|
+
const scrollTo = (offset) => {
|
|
21451
|
+
offset = Math.max(offset, 0);
|
|
21452
|
+
if (offset === vue.unref(states).scrollOffset) {
|
|
21453
|
+
return;
|
|
21454
|
+
}
|
|
21455
|
+
states.value = {
|
|
21456
|
+
...vue.unref(states),
|
|
21457
|
+
scrollOffset: offset,
|
|
21458
|
+
scrollDir: getScrollDir(vue.unref(states).scrollOffset, offset),
|
|
21459
|
+
updateRequested: true
|
|
21460
|
+
};
|
|
21461
|
+
vue.nextTick(resetIsScrolling);
|
|
21462
|
+
};
|
|
21463
|
+
const scrollToItem = (idx, alignment = AUTO_ALIGNMENT) => {
|
|
21464
|
+
const { scrollOffset } = vue.unref(states);
|
|
21465
|
+
idx = Math.max(0, Math.min(idx, props.total - 1));
|
|
21466
|
+
scrollTo(getOffset(props, idx, alignment, scrollOffset, vue.unref(dynamicSizeCache)));
|
|
21467
|
+
};
|
|
21468
|
+
const getItemStyle = (idx) => {
|
|
21469
|
+
const { direction, itemSize, layout } = props;
|
|
21470
|
+
const itemStyleCache = getItemStyleCache.value(clearCache && itemSize, clearCache && layout, clearCache && direction);
|
|
21471
|
+
let style;
|
|
21472
|
+
if (hasOwn(itemStyleCache, String(idx))) {
|
|
21473
|
+
style = itemStyleCache[idx];
|
|
21474
|
+
} else {
|
|
21475
|
+
const offset = getItemOffset(props, idx, vue.unref(dynamicSizeCache));
|
|
21476
|
+
const size = getItemSize(props, idx, vue.unref(dynamicSizeCache));
|
|
21477
|
+
const horizontal = vue.unref(_isHorizontal);
|
|
21478
|
+
const isRtl = direction === RTL;
|
|
21479
|
+
const offsetHorizontal = horizontal ? offset : 0;
|
|
21480
|
+
itemStyleCache[idx] = style = {
|
|
21481
|
+
position: "absolute",
|
|
21482
|
+
left: isRtl ? void 0 : `${offsetHorizontal}px`,
|
|
21483
|
+
right: isRtl ? `${offsetHorizontal}px` : void 0,
|
|
21484
|
+
top: !horizontal ? `${offset}px` : 0,
|
|
21485
|
+
height: !horizontal ? `${size}px` : "100%",
|
|
21486
|
+
width: horizontal ? `${size}px` : "100%"
|
|
21487
|
+
};
|
|
21488
|
+
}
|
|
21489
|
+
return style;
|
|
21490
|
+
};
|
|
21491
|
+
const resetIsScrolling = () => {
|
|
21492
|
+
states.value.isScrolling = false;
|
|
21493
|
+
vue.nextTick(() => {
|
|
21494
|
+
getItemStyleCache.value(-1, null, null);
|
|
21495
|
+
});
|
|
21496
|
+
};
|
|
21497
|
+
const resetScrollTop = () => {
|
|
21498
|
+
const window = windowRef.value;
|
|
21499
|
+
if (window) {
|
|
21500
|
+
window.scrollTop = 0;
|
|
21501
|
+
}
|
|
21502
|
+
};
|
|
21503
|
+
vue.onMounted(() => {
|
|
21504
|
+
if (!isClient)
|
|
21505
|
+
return;
|
|
21506
|
+
const { initScrollOffset } = props;
|
|
21507
|
+
const windowElement = vue.unref(windowRef);
|
|
21508
|
+
if (isNumber(initScrollOffset) && windowElement) {
|
|
21509
|
+
if (vue.unref(_isHorizontal)) {
|
|
21510
|
+
windowElement.scrollLeft = initScrollOffset;
|
|
21511
|
+
} else {
|
|
21512
|
+
windowElement.scrollTop = initScrollOffset;
|
|
21513
|
+
}
|
|
21514
|
+
}
|
|
21515
|
+
emitEvents();
|
|
21516
|
+
});
|
|
21517
|
+
vue.onUpdated(() => {
|
|
21518
|
+
const { direction, layout } = props;
|
|
21519
|
+
const { scrollOffset, updateRequested } = vue.unref(states);
|
|
21520
|
+
const windowElement = vue.unref(windowRef);
|
|
21521
|
+
if (updateRequested && windowElement) {
|
|
21522
|
+
if (layout === HORIZONTAL) {
|
|
21523
|
+
if (direction === RTL) {
|
|
21524
|
+
switch (getRTLOffsetType()) {
|
|
21525
|
+
case RTL_OFFSET_NAG: {
|
|
21526
|
+
windowElement.scrollLeft = -scrollOffset;
|
|
21527
|
+
break;
|
|
21528
|
+
}
|
|
21529
|
+
case RTL_OFFSET_POS_ASC: {
|
|
21530
|
+
windowElement.scrollLeft = scrollOffset;
|
|
21531
|
+
break;
|
|
21532
|
+
}
|
|
21533
|
+
default: {
|
|
21534
|
+
const { clientWidth, scrollWidth } = windowElement;
|
|
21535
|
+
windowElement.scrollLeft = scrollWidth - clientWidth - scrollOffset;
|
|
21536
|
+
break;
|
|
21537
|
+
}
|
|
21538
|
+
}
|
|
21539
|
+
} else {
|
|
21540
|
+
windowElement.scrollLeft = scrollOffset;
|
|
21541
|
+
}
|
|
21542
|
+
} else {
|
|
21543
|
+
windowElement.scrollTop = scrollOffset;
|
|
21544
|
+
}
|
|
21545
|
+
}
|
|
21546
|
+
});
|
|
21547
|
+
vue.onActivated(() => {
|
|
21548
|
+
vue.unref(windowRef).scrollTop = vue.unref(states).scrollOffset;
|
|
21549
|
+
});
|
|
21550
|
+
const api = {
|
|
21551
|
+
ns,
|
|
21552
|
+
clientSize,
|
|
21553
|
+
estimatedTotalSize,
|
|
21554
|
+
windowStyle,
|
|
21555
|
+
windowRef,
|
|
21556
|
+
innerRef,
|
|
21557
|
+
innerStyle,
|
|
21558
|
+
itemsToRender,
|
|
21559
|
+
scrollbarRef,
|
|
21560
|
+
states,
|
|
21561
|
+
getItemStyle,
|
|
21562
|
+
onScroll,
|
|
21563
|
+
onScrollbarScroll,
|
|
21564
|
+
onWheel,
|
|
21565
|
+
scrollTo,
|
|
21566
|
+
scrollToItem,
|
|
21567
|
+
resetScrollTop
|
|
21568
|
+
};
|
|
21569
|
+
expose({
|
|
21570
|
+
windowRef,
|
|
21571
|
+
innerRef,
|
|
21572
|
+
getItemStyleCache,
|
|
21573
|
+
scrollTo,
|
|
21574
|
+
scrollToItem,
|
|
21575
|
+
resetScrollTop,
|
|
21576
|
+
states
|
|
21577
|
+
});
|
|
21578
|
+
return api;
|
|
21579
|
+
},
|
|
21580
|
+
render(ctx) {
|
|
21581
|
+
var _a;
|
|
21582
|
+
const {
|
|
21583
|
+
$slots,
|
|
21584
|
+
className,
|
|
21585
|
+
clientSize,
|
|
21586
|
+
containerElement,
|
|
21587
|
+
data,
|
|
21588
|
+
getItemStyle,
|
|
21589
|
+
innerElement,
|
|
21590
|
+
itemsToRender,
|
|
21591
|
+
innerStyle,
|
|
21592
|
+
layout,
|
|
21593
|
+
total,
|
|
21594
|
+
onScroll,
|
|
21595
|
+
onScrollbarScroll,
|
|
21596
|
+
states,
|
|
21597
|
+
useIsScrolling,
|
|
21598
|
+
windowStyle,
|
|
21599
|
+
ns
|
|
21600
|
+
} = ctx;
|
|
21601
|
+
const [start, end] = itemsToRender;
|
|
21602
|
+
const Container = vue.resolveDynamicComponent(containerElement);
|
|
21603
|
+
const Inner = vue.resolveDynamicComponent(innerElement);
|
|
21604
|
+
const children = [];
|
|
21605
|
+
if (total > 0) {
|
|
21606
|
+
for (let i = start; i <= end; i++) {
|
|
21607
|
+
children.push(vue.h(vue.Fragment, { key: i }, (_a = $slots.default) == null ? void 0 : _a.call($slots, {
|
|
21608
|
+
data,
|
|
21609
|
+
index: i,
|
|
21610
|
+
isScrolling: useIsScrolling ? states.isScrolling : void 0,
|
|
21611
|
+
style: getItemStyle(i)
|
|
21612
|
+
})));
|
|
21613
|
+
}
|
|
21614
|
+
}
|
|
21615
|
+
const InnerNode = [
|
|
21616
|
+
vue.h(Inner, {
|
|
21617
|
+
style: innerStyle,
|
|
21618
|
+
ref: "innerRef"
|
|
21619
|
+
}, !isString$1(Inner) ? {
|
|
21620
|
+
default: () => children
|
|
21621
|
+
} : children)
|
|
21622
|
+
];
|
|
21623
|
+
const scrollbar = vue.h(ScrollBar, {
|
|
21624
|
+
ref: "scrollbarRef",
|
|
21625
|
+
clientSize,
|
|
21626
|
+
layout,
|
|
21627
|
+
onScroll: onScrollbarScroll,
|
|
21628
|
+
ratio: clientSize * 100 / this.estimatedTotalSize,
|
|
21629
|
+
scrollFrom: states.scrollOffset / (this.estimatedTotalSize - clientSize),
|
|
21630
|
+
total
|
|
21631
|
+
});
|
|
21632
|
+
const listContainer = vue.h(Container, {
|
|
21633
|
+
class: [ns.e("window"), className],
|
|
21634
|
+
style: windowStyle,
|
|
21635
|
+
onScroll,
|
|
21636
|
+
ref: "windowRef",
|
|
21637
|
+
key: 0
|
|
21638
|
+
}, !isString$1(Container) ? { default: () => [InnerNode] } : [InnerNode]);
|
|
21639
|
+
return vue.h("div", {
|
|
21640
|
+
key: 0,
|
|
21641
|
+
class: [ns.e("wrapper"), states.scrollbarAlwaysOn ? "always-on" : ""]
|
|
21642
|
+
}, [listContainer, scrollbar]);
|
|
21643
|
+
}
|
|
21644
|
+
});
|
|
21645
|
+
};
|
|
21646
|
+
|
|
21647
|
+
const FixedSizeList = createList({
|
|
21648
|
+
name: "ElFixedSizeList",
|
|
21649
|
+
getItemOffset: ({ itemSize }, index) => index * itemSize,
|
|
21650
|
+
getItemSize: ({ itemSize }) => itemSize,
|
|
21651
|
+
getEstimatedTotalSize: ({ total, itemSize }) => itemSize * total,
|
|
21652
|
+
getOffset: ({ height, total, itemSize, layout, width }, index, alignment, scrollOffset) => {
|
|
21653
|
+
const size = isHorizontal(layout) ? width : height;
|
|
21654
|
+
const lastItemOffset = Math.max(0, total * itemSize - size);
|
|
21655
|
+
const maxOffset = Math.min(lastItemOffset, index * itemSize);
|
|
21656
|
+
const minOffset = Math.max(0, (index + 1) * itemSize - size);
|
|
21657
|
+
if (alignment === SMART_ALIGNMENT) {
|
|
21658
|
+
if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) {
|
|
21659
|
+
alignment = AUTO_ALIGNMENT;
|
|
21660
|
+
} else {
|
|
21661
|
+
alignment = CENTERED_ALIGNMENT;
|
|
21662
|
+
}
|
|
21663
|
+
}
|
|
21664
|
+
switch (alignment) {
|
|
21665
|
+
case START_ALIGNMENT: {
|
|
21666
|
+
return maxOffset;
|
|
21667
|
+
}
|
|
21668
|
+
case END_ALIGNMENT: {
|
|
21669
|
+
return minOffset;
|
|
21670
|
+
}
|
|
21671
|
+
case CENTERED_ALIGNMENT: {
|
|
21672
|
+
const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);
|
|
21673
|
+
if (middleOffset < Math.ceil(size / 2)) {
|
|
21674
|
+
return 0;
|
|
21675
|
+
} else if (middleOffset > lastItemOffset + Math.floor(size / 2)) {
|
|
21676
|
+
return lastItemOffset;
|
|
21677
|
+
} else {
|
|
21678
|
+
return middleOffset;
|
|
21679
|
+
}
|
|
21680
|
+
}
|
|
21681
|
+
case AUTO_ALIGNMENT:
|
|
21682
|
+
default: {
|
|
21683
|
+
if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
|
|
21684
|
+
return scrollOffset;
|
|
21685
|
+
} else if (scrollOffset < minOffset) {
|
|
21686
|
+
return minOffset;
|
|
21687
|
+
} else {
|
|
21688
|
+
return maxOffset;
|
|
21689
|
+
}
|
|
21690
|
+
}
|
|
21691
|
+
}
|
|
21692
|
+
},
|
|
21693
|
+
getStartIndexForOffset: ({ total, itemSize }, offset) => Math.max(0, Math.min(total - 1, Math.floor(offset / itemSize))),
|
|
21694
|
+
getStopIndexForStartIndex: ({ height, total, itemSize, layout, width }, startIndex, scrollOffset) => {
|
|
21695
|
+
const offset = startIndex * itemSize;
|
|
21696
|
+
const size = isHorizontal(layout) ? width : height;
|
|
21697
|
+
const numVisibleItems = Math.ceil((size + scrollOffset - offset) / itemSize);
|
|
21698
|
+
return Math.max(0, Math.min(total - 1, startIndex + numVisibleItems - 1));
|
|
21699
|
+
},
|
|
21700
|
+
initCache() {
|
|
21701
|
+
return void 0;
|
|
21702
|
+
},
|
|
21703
|
+
clearCache: true,
|
|
21704
|
+
validateProps() {
|
|
21705
|
+
}
|
|
21706
|
+
});
|
|
21707
|
+
|
|
21708
|
+
const getItemFromCache = (props, index, listCache) => {
|
|
21709
|
+
const { itemSize } = props;
|
|
21710
|
+
const { items, lastVisitedIndex } = listCache;
|
|
21711
|
+
if (index > lastVisitedIndex) {
|
|
21712
|
+
let offset = 0;
|
|
21713
|
+
if (lastVisitedIndex >= 0) {
|
|
21714
|
+
const item = items[lastVisitedIndex];
|
|
21715
|
+
offset = item.offset + item.size;
|
|
21716
|
+
}
|
|
21717
|
+
for (let i = lastVisitedIndex + 1; i <= index; i++) {
|
|
21718
|
+
const size = itemSize(i);
|
|
21719
|
+
items[i] = {
|
|
21720
|
+
offset,
|
|
21721
|
+
size
|
|
21722
|
+
};
|
|
21723
|
+
offset += size;
|
|
21724
|
+
}
|
|
21725
|
+
listCache.lastVisitedIndex = index;
|
|
21726
|
+
}
|
|
21727
|
+
return items[index];
|
|
21728
|
+
};
|
|
21729
|
+
const findItem = (props, listCache, offset) => {
|
|
21730
|
+
const { items, lastVisitedIndex } = listCache;
|
|
21731
|
+
const lastVisitedOffset = lastVisitedIndex > 0 ? items[lastVisitedIndex].offset : 0;
|
|
21732
|
+
if (lastVisitedOffset >= offset) {
|
|
21733
|
+
return bs(props, listCache, 0, lastVisitedIndex, offset);
|
|
21734
|
+
}
|
|
21735
|
+
return es(props, listCache, Math.max(0, lastVisitedIndex), offset);
|
|
21736
|
+
};
|
|
21737
|
+
const bs = (props, listCache, low, high, offset) => {
|
|
21738
|
+
while (low <= high) {
|
|
21739
|
+
const mid = low + Math.floor((high - low) / 2);
|
|
21740
|
+
const currentOffset = getItemFromCache(props, mid, listCache).offset;
|
|
21741
|
+
if (currentOffset === offset) {
|
|
21742
|
+
return mid;
|
|
21743
|
+
} else if (currentOffset < offset) {
|
|
21744
|
+
low = mid + 1;
|
|
21745
|
+
} else if (currentOffset > offset) {
|
|
21746
|
+
high = mid - 1;
|
|
21747
|
+
}
|
|
21748
|
+
}
|
|
21749
|
+
return Math.max(0, low - 1);
|
|
21750
|
+
};
|
|
21751
|
+
const es = (props, listCache, index, offset) => {
|
|
21752
|
+
const { total } = props;
|
|
21753
|
+
let exponent = 1;
|
|
21754
|
+
while (index < total && getItemFromCache(props, index, listCache).offset < offset) {
|
|
21755
|
+
index += exponent;
|
|
21756
|
+
exponent *= 2;
|
|
21757
|
+
}
|
|
21758
|
+
return bs(props, listCache, Math.floor(index / 2), Math.min(index, total - 1), offset);
|
|
21759
|
+
};
|
|
21760
|
+
const getEstimatedTotalSize = ({ total }, { items, estimatedItemSize, lastVisitedIndex }) => {
|
|
21761
|
+
let totalSizeOfMeasuredItems = 0;
|
|
21762
|
+
if (lastVisitedIndex >= total) {
|
|
21763
|
+
lastVisitedIndex = total - 1;
|
|
21764
|
+
}
|
|
21765
|
+
if (lastVisitedIndex >= 0) {
|
|
21766
|
+
const item = items[lastVisitedIndex];
|
|
21767
|
+
totalSizeOfMeasuredItems = item.offset + item.size;
|
|
21768
|
+
}
|
|
21769
|
+
const numUnmeasuredItems = total - lastVisitedIndex - 1;
|
|
21770
|
+
const totalSizeOfUnmeasuredItems = numUnmeasuredItems * estimatedItemSize;
|
|
21771
|
+
return totalSizeOfMeasuredItems + totalSizeOfUnmeasuredItems;
|
|
21772
|
+
};
|
|
21773
|
+
const DynamicSizeList = createList({
|
|
21774
|
+
name: "ElDynamicSizeList",
|
|
21775
|
+
getItemOffset: (props, index, listCache) => getItemFromCache(props, index, listCache).offset,
|
|
21776
|
+
getItemSize: (_, index, { items }) => items[index].size,
|
|
21777
|
+
getEstimatedTotalSize,
|
|
21778
|
+
getOffset: (props, index, alignment, scrollOffset, listCache) => {
|
|
21779
|
+
const { height, layout, width } = props;
|
|
21780
|
+
const size = isHorizontal(layout) ? width : height;
|
|
21781
|
+
const item = getItemFromCache(props, index, listCache);
|
|
21782
|
+
const estimatedTotalSize = getEstimatedTotalSize(props, listCache);
|
|
21783
|
+
const maxOffset = Math.max(0, Math.min(estimatedTotalSize - size, item.offset));
|
|
21784
|
+
const minOffset = Math.max(0, item.offset - size + item.size);
|
|
21785
|
+
if (alignment === SMART_ALIGNMENT) {
|
|
21786
|
+
if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) {
|
|
21787
|
+
alignment = AUTO_ALIGNMENT;
|
|
21788
|
+
} else {
|
|
21789
|
+
alignment = CENTERED_ALIGNMENT;
|
|
21790
|
+
}
|
|
21791
|
+
}
|
|
21792
|
+
switch (alignment) {
|
|
21793
|
+
case START_ALIGNMENT: {
|
|
21794
|
+
return maxOffset;
|
|
21795
|
+
}
|
|
21796
|
+
case END_ALIGNMENT: {
|
|
21797
|
+
return minOffset;
|
|
21798
|
+
}
|
|
21799
|
+
case CENTERED_ALIGNMENT: {
|
|
21800
|
+
return Math.round(minOffset + (maxOffset - minOffset) / 2);
|
|
21801
|
+
}
|
|
21802
|
+
case AUTO_ALIGNMENT:
|
|
21803
|
+
default: {
|
|
21804
|
+
if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
|
|
21805
|
+
return scrollOffset;
|
|
21806
|
+
} else if (scrollOffset < minOffset) {
|
|
21807
|
+
return minOffset;
|
|
21808
|
+
} else {
|
|
21809
|
+
return maxOffset;
|
|
21810
|
+
}
|
|
21811
|
+
}
|
|
21812
|
+
}
|
|
21813
|
+
},
|
|
21814
|
+
getStartIndexForOffset: (props, offset, listCache) => findItem(props, listCache, offset),
|
|
21815
|
+
getStopIndexForStartIndex: (props, startIndex, scrollOffset, listCache) => {
|
|
21816
|
+
const { height, total, layout, width } = props;
|
|
21817
|
+
const size = isHorizontal(layout) ? width : height;
|
|
21818
|
+
const item = getItemFromCache(props, startIndex, listCache);
|
|
21819
|
+
const maxOffset = scrollOffset + size;
|
|
21820
|
+
let offset = item.offset + item.size;
|
|
21821
|
+
let stopIndex = startIndex;
|
|
21822
|
+
while (stopIndex < total - 1 && offset < maxOffset) {
|
|
21823
|
+
stopIndex++;
|
|
21824
|
+
offset += getItemFromCache(props, stopIndex, listCache).size;
|
|
21825
|
+
}
|
|
21826
|
+
return stopIndex;
|
|
21827
|
+
},
|
|
21828
|
+
initCache({ estimatedItemSize = DEFAULT_DYNAMIC_LIST_ITEM_SIZE }, instance) {
|
|
21829
|
+
const cache = {
|
|
21830
|
+
items: {},
|
|
21831
|
+
estimatedItemSize,
|
|
21832
|
+
lastVisitedIndex: -1
|
|
21833
|
+
};
|
|
21834
|
+
cache.clearCacheAfterIndex = (index, forceUpdate = true) => {
|
|
21835
|
+
var _a, _b;
|
|
21836
|
+
cache.lastVisitedIndex = Math.min(cache.lastVisitedIndex, index - 1);
|
|
21837
|
+
(_a = instance.exposed) == null ? void 0 : _a.getItemStyleCache(-1);
|
|
21838
|
+
if (forceUpdate) {
|
|
21839
|
+
(_b = instance.proxy) == null ? void 0 : _b.$forceUpdate();
|
|
21840
|
+
}
|
|
21841
|
+
};
|
|
21842
|
+
return cache;
|
|
21843
|
+
},
|
|
21844
|
+
clearCache: false,
|
|
21845
|
+
validateProps: ({ itemSize }) => {
|
|
21846
|
+
}
|
|
21847
|
+
});
|
|
21848
|
+
|
|
21849
|
+
const props = {
|
|
21850
|
+
loading: Boolean,
|
|
21851
|
+
data: {
|
|
21852
|
+
type: Array,
|
|
21853
|
+
required: true
|
|
21854
|
+
},
|
|
21855
|
+
hoveringIndex: Number,
|
|
21856
|
+
width: Number
|
|
21857
|
+
};
|
|
21858
|
+
var ElSelectMenu = vue.defineComponent({
|
|
21859
|
+
name: "ElSelectDropdown",
|
|
21860
|
+
props,
|
|
21861
|
+
setup(props2, {
|
|
21862
|
+
slots,
|
|
21863
|
+
expose
|
|
21864
|
+
}) {
|
|
21865
|
+
const select = vue.inject(selectV2InjectionKey);
|
|
21866
|
+
const ns = useNamespace("select");
|
|
21867
|
+
const {
|
|
21868
|
+
getLabel,
|
|
21869
|
+
getValue,
|
|
21870
|
+
getDisabled
|
|
21871
|
+
} = useProps(select.props);
|
|
21872
|
+
const cachedHeights = vue.ref([]);
|
|
21873
|
+
const listRef = vue.ref();
|
|
21874
|
+
const size = vue.computed(() => props2.data.length);
|
|
21875
|
+
vue.watch(() => size.value, () => {
|
|
21876
|
+
var _a, _b;
|
|
21877
|
+
(_b = (_a = select.tooltipRef.value).updatePopper) == null ? void 0 : _b.call(_a);
|
|
21878
|
+
});
|
|
21879
|
+
const isSized = vue.computed(() => isUndefined(select.props.estimatedOptionHeight));
|
|
21880
|
+
const listProps = vue.computed(() => {
|
|
21881
|
+
if (isSized.value) {
|
|
21882
|
+
return {
|
|
21883
|
+
itemSize: select.props.itemHeight
|
|
21884
|
+
};
|
|
21885
|
+
}
|
|
21886
|
+
return {
|
|
21887
|
+
estimatedSize: select.props.estimatedOptionHeight,
|
|
21888
|
+
itemSize: (idx) => cachedHeights.value[idx]
|
|
21889
|
+
};
|
|
21890
|
+
});
|
|
21891
|
+
const contains = (arr = [], target) => {
|
|
21892
|
+
const {
|
|
21893
|
+
props: {
|
|
21894
|
+
valueKey
|
|
21895
|
+
}
|
|
21896
|
+
} = select;
|
|
21897
|
+
if (!isObject$1(target)) {
|
|
21898
|
+
return arr.includes(target);
|
|
21899
|
+
}
|
|
21900
|
+
return arr && arr.some((item) => {
|
|
21901
|
+
return vue.toRaw(get(item, valueKey)) === get(target, valueKey);
|
|
21902
|
+
});
|
|
21903
|
+
};
|
|
21904
|
+
const isEqual = (selected, target) => {
|
|
21905
|
+
if (!isObject$1(target)) {
|
|
21906
|
+
return selected === target;
|
|
21907
|
+
} else {
|
|
21908
|
+
const {
|
|
21909
|
+
valueKey
|
|
21910
|
+
} = select.props;
|
|
21911
|
+
return get(selected, valueKey) === get(target, valueKey);
|
|
21912
|
+
}
|
|
21913
|
+
};
|
|
21914
|
+
const isItemSelected = (modelValue, target) => {
|
|
21915
|
+
if (select.props.multiple) {
|
|
21916
|
+
return contains(modelValue, getValue(target));
|
|
21917
|
+
}
|
|
21918
|
+
return isEqual(modelValue, getValue(target));
|
|
21919
|
+
};
|
|
21920
|
+
const isItemDisabled = (modelValue, selected) => {
|
|
21921
|
+
const {
|
|
21922
|
+
disabled,
|
|
21923
|
+
multiple,
|
|
21924
|
+
multipleLimit
|
|
21925
|
+
} = select.props;
|
|
21926
|
+
return disabled || !selected && (multiple ? multipleLimit > 0 && modelValue.length >= multipleLimit : false);
|
|
21927
|
+
};
|
|
21928
|
+
const isItemHovering = (target) => props2.hoveringIndex === target;
|
|
21929
|
+
const scrollToItem = (index) => {
|
|
21930
|
+
const list = listRef.value;
|
|
21931
|
+
if (list) {
|
|
21932
|
+
list.scrollToItem(index);
|
|
21933
|
+
}
|
|
21934
|
+
};
|
|
21935
|
+
const resetScrollTop = () => {
|
|
21936
|
+
const list = listRef.value;
|
|
21937
|
+
if (list) {
|
|
21938
|
+
list.resetScrollTop();
|
|
21939
|
+
}
|
|
21940
|
+
};
|
|
21941
|
+
const exposed = {
|
|
21942
|
+
listRef,
|
|
21943
|
+
isSized,
|
|
21944
|
+
isItemDisabled,
|
|
21945
|
+
isItemHovering,
|
|
21946
|
+
isItemSelected,
|
|
21947
|
+
scrollToItem,
|
|
21948
|
+
resetScrollTop
|
|
21949
|
+
};
|
|
21950
|
+
expose(exposed);
|
|
21951
|
+
const Item = (itemProps) => {
|
|
21952
|
+
const {
|
|
21953
|
+
index,
|
|
21954
|
+
data,
|
|
21955
|
+
style
|
|
21956
|
+
} = itemProps;
|
|
21957
|
+
const sized = vue.unref(isSized);
|
|
21958
|
+
const {
|
|
21959
|
+
itemSize,
|
|
21960
|
+
estimatedSize
|
|
21961
|
+
} = vue.unref(listProps);
|
|
21962
|
+
const {
|
|
21963
|
+
modelValue
|
|
21964
|
+
} = select.props;
|
|
21965
|
+
const {
|
|
21966
|
+
onSelect,
|
|
21967
|
+
onHover
|
|
21968
|
+
} = select;
|
|
21969
|
+
const item = data[index];
|
|
21970
|
+
if (item.type === "Group") {
|
|
21971
|
+
return vue.createVNode(GroupItem, {
|
|
21972
|
+
"item": item,
|
|
21973
|
+
"style": style,
|
|
21974
|
+
"height": sized ? itemSize : estimatedSize
|
|
21975
|
+
}, null);
|
|
21976
|
+
}
|
|
21977
|
+
const isSelected = isItemSelected(modelValue, item);
|
|
21978
|
+
const isDisabled = isItemDisabled(modelValue, isSelected);
|
|
21979
|
+
const isHovering = isItemHovering(index);
|
|
21980
|
+
return vue.createVNode(OptionItem, vue.mergeProps(itemProps, {
|
|
21981
|
+
"selected": isSelected,
|
|
21982
|
+
"disabled": getDisabled(item) || isDisabled,
|
|
21983
|
+
"created": !!item.created,
|
|
21984
|
+
"hovering": isHovering,
|
|
21985
|
+
"item": item,
|
|
21986
|
+
"onSelect": onSelect,
|
|
21987
|
+
"onHover": onHover
|
|
21988
|
+
}), {
|
|
21989
|
+
default: (props3) => {
|
|
21990
|
+
var _a;
|
|
21991
|
+
return ((_a = slots.default) == null ? void 0 : _a.call(slots, props3)) || vue.createVNode("span", null, [getLabel(item)]);
|
|
21992
|
+
}
|
|
21993
|
+
});
|
|
21994
|
+
};
|
|
21995
|
+
const {
|
|
21996
|
+
onKeyboardNavigate,
|
|
21997
|
+
onKeyboardSelect
|
|
21998
|
+
} = select;
|
|
21999
|
+
const onForward = () => {
|
|
22000
|
+
onKeyboardNavigate("forward");
|
|
22001
|
+
};
|
|
22002
|
+
const onBackward = () => {
|
|
22003
|
+
onKeyboardNavigate("backward");
|
|
22004
|
+
};
|
|
22005
|
+
const onKeydown = (e) => {
|
|
22006
|
+
const {
|
|
22007
|
+
code
|
|
22008
|
+
} = e;
|
|
22009
|
+
const {
|
|
22010
|
+
tab,
|
|
22011
|
+
esc,
|
|
22012
|
+
down,
|
|
22013
|
+
up,
|
|
22014
|
+
enter,
|
|
22015
|
+
numpadEnter
|
|
22016
|
+
} = EVENT_CODE;
|
|
22017
|
+
if (code !== tab) {
|
|
22018
|
+
e.preventDefault();
|
|
22019
|
+
e.stopPropagation();
|
|
22020
|
+
}
|
|
22021
|
+
switch (code) {
|
|
22022
|
+
case tab:
|
|
22023
|
+
case esc:
|
|
22024
|
+
break;
|
|
22025
|
+
case down:
|
|
22026
|
+
onForward();
|
|
22027
|
+
break;
|
|
22028
|
+
case up:
|
|
22029
|
+
onBackward();
|
|
22030
|
+
break;
|
|
22031
|
+
case enter:
|
|
22032
|
+
case numpadEnter:
|
|
22033
|
+
onKeyboardSelect();
|
|
22034
|
+
break;
|
|
22035
|
+
}
|
|
22036
|
+
};
|
|
22037
|
+
return () => {
|
|
22038
|
+
var _a, _b, _c, _d;
|
|
22039
|
+
const {
|
|
22040
|
+
data,
|
|
22041
|
+
width
|
|
22042
|
+
} = props2;
|
|
22043
|
+
const {
|
|
22044
|
+
height,
|
|
22045
|
+
multiple,
|
|
22046
|
+
scrollbarAlwaysOn
|
|
22047
|
+
} = select.props;
|
|
22048
|
+
const List = vue.unref(isSized) ? FixedSizeList : DynamicSizeList;
|
|
22049
|
+
return vue.createVNode("div", {
|
|
22050
|
+
"class": [ns.b("dropdown"), ns.is("multiple", multiple)],
|
|
22051
|
+
"style": {
|
|
22052
|
+
width: `${width}px`
|
|
22053
|
+
}
|
|
22054
|
+
}, [(_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)) || vue.createVNode(List, vue.mergeProps({
|
|
22055
|
+
"ref": listRef
|
|
22056
|
+
}, vue.unref(listProps), {
|
|
22057
|
+
"className": ns.be("dropdown", "list"),
|
|
22058
|
+
"scrollbarAlwaysOn": scrollbarAlwaysOn,
|
|
22059
|
+
"data": data,
|
|
22060
|
+
"height": height,
|
|
22061
|
+
"width": width,
|
|
22062
|
+
"total": data.length,
|
|
22063
|
+
"onKeydown": onKeydown
|
|
22064
|
+
}), {
|
|
22065
|
+
default: (props3) => vue.createVNode(Item, props3, null)
|
|
22066
|
+
}), (_d = slots.footer) == null ? void 0 : _d.call(slots)]);
|
|
22067
|
+
};
|
|
22068
|
+
}
|
|
22069
|
+
});
|
|
22070
|
+
|
|
22071
|
+
function useAllowCreate(props, states) {
|
|
22072
|
+
const { aliasProps, getLabel, getValue } = useProps(props);
|
|
22073
|
+
const createOptionCount = vue.ref(0);
|
|
22074
|
+
const cachedSelectedOption = vue.ref();
|
|
22075
|
+
const enableAllowCreateMode = vue.computed(() => {
|
|
22076
|
+
return props.allowCreate && props.filterable;
|
|
22077
|
+
});
|
|
22078
|
+
function hasExistingOption(query) {
|
|
22079
|
+
const hasOption = (option) => getLabel(option) === query;
|
|
22080
|
+
return props.options && props.options.some(hasOption) || states.createdOptions.some(hasOption);
|
|
22081
|
+
}
|
|
22082
|
+
function selectNewOption(option) {
|
|
22083
|
+
if (!enableAllowCreateMode.value) {
|
|
22084
|
+
return;
|
|
22085
|
+
}
|
|
22086
|
+
if (props.multiple && option.created) {
|
|
22087
|
+
createOptionCount.value++;
|
|
22088
|
+
} else {
|
|
22089
|
+
cachedSelectedOption.value = option;
|
|
22090
|
+
}
|
|
22091
|
+
}
|
|
22092
|
+
function createNewOption(query) {
|
|
22093
|
+
if (enableAllowCreateMode.value) {
|
|
22094
|
+
if (query && query.length > 0) {
|
|
22095
|
+
if (hasExistingOption(query)) {
|
|
22096
|
+
return;
|
|
22097
|
+
}
|
|
22098
|
+
const newOption = {
|
|
22099
|
+
[aliasProps.value.value]: query,
|
|
22100
|
+
[aliasProps.value.label]: query,
|
|
22101
|
+
created: true,
|
|
22102
|
+
[aliasProps.value.disabled]: false
|
|
22103
|
+
};
|
|
22104
|
+
if (states.createdOptions.length >= createOptionCount.value) {
|
|
22105
|
+
states.createdOptions[createOptionCount.value] = newOption;
|
|
22106
|
+
} else {
|
|
22107
|
+
states.createdOptions.push(newOption);
|
|
22108
|
+
}
|
|
22109
|
+
} else {
|
|
22110
|
+
if (props.multiple) {
|
|
22111
|
+
states.createdOptions.length = createOptionCount.value;
|
|
22112
|
+
} else {
|
|
22113
|
+
const selectedOption = cachedSelectedOption.value;
|
|
22114
|
+
states.createdOptions.length = 0;
|
|
22115
|
+
if (selectedOption && selectedOption.created) {
|
|
22116
|
+
states.createdOptions.push(selectedOption);
|
|
22117
|
+
}
|
|
22118
|
+
}
|
|
22119
|
+
}
|
|
22120
|
+
}
|
|
22121
|
+
}
|
|
22122
|
+
function removeNewOption(option) {
|
|
22123
|
+
if (!enableAllowCreateMode.value || !option || !option.created || option.created && props.reserveKeyword && states.inputValue === getLabel(option)) {
|
|
22124
|
+
return;
|
|
22125
|
+
}
|
|
22126
|
+
const idx = states.createdOptions.findIndex((it) => getValue(it) === getValue(option));
|
|
22127
|
+
if (~idx) {
|
|
22128
|
+
states.createdOptions.splice(idx, 1);
|
|
22129
|
+
createOptionCount.value--;
|
|
22130
|
+
}
|
|
22131
|
+
}
|
|
22132
|
+
function clearAllNewOption() {
|
|
22133
|
+
if (enableAllowCreateMode.value) {
|
|
22134
|
+
states.createdOptions.length = 0;
|
|
22135
|
+
createOptionCount.value = 0;
|
|
22136
|
+
}
|
|
22137
|
+
}
|
|
22138
|
+
return {
|
|
22139
|
+
createNewOption,
|
|
22140
|
+
removeNewOption,
|
|
22141
|
+
selectNewOption,
|
|
22142
|
+
clearAllNewOption
|
|
22143
|
+
};
|
|
22144
|
+
}
|
|
22145
|
+
|
|
22146
|
+
const useSelect = (props, emit) => {
|
|
22147
|
+
const { t } = useLocale();
|
|
22148
|
+
const nsSelect = useNamespace("select");
|
|
22149
|
+
const nsInput = useNamespace("input");
|
|
22150
|
+
const { form: elForm, formItem: elFormItem } = useFormItem();
|
|
22151
|
+
const { inputId } = useFormItemInputId(props, {
|
|
22152
|
+
formItemContext: elFormItem
|
|
22153
|
+
});
|
|
22154
|
+
const { aliasProps, getLabel, getValue, getDisabled, getOptions } = useProps(props);
|
|
22155
|
+
const { valueOnClear, isEmptyValue } = useEmptyValues(props);
|
|
22156
|
+
const states = vue.reactive({
|
|
22157
|
+
inputValue: "",
|
|
22158
|
+
cachedOptions: [],
|
|
22159
|
+
createdOptions: [],
|
|
22160
|
+
hoveringIndex: -1,
|
|
22161
|
+
inputHovering: false,
|
|
22162
|
+
selectionWidth: 0,
|
|
22163
|
+
collapseItemWidth: 0,
|
|
22164
|
+
previousQuery: null,
|
|
22165
|
+
previousValue: void 0,
|
|
22166
|
+
selectedLabel: "",
|
|
22167
|
+
menuVisibleOnFocus: false,
|
|
22168
|
+
isBeforeHide: false
|
|
22169
|
+
});
|
|
22170
|
+
const popperSize = vue.ref(-1);
|
|
22171
|
+
const selectRef = vue.ref();
|
|
22172
|
+
const selectionRef = vue.ref();
|
|
22173
|
+
const tooltipRef = vue.ref();
|
|
22174
|
+
const tagTooltipRef = vue.ref();
|
|
22175
|
+
const inputRef = vue.ref();
|
|
22176
|
+
const prefixRef = vue.ref();
|
|
22177
|
+
const suffixRef = vue.ref();
|
|
22178
|
+
const menuRef = vue.ref();
|
|
22179
|
+
const tagMenuRef = vue.ref();
|
|
22180
|
+
const collapseItemRef = vue.ref();
|
|
22181
|
+
const {
|
|
22182
|
+
isComposing,
|
|
22183
|
+
handleCompositionStart,
|
|
22184
|
+
handleCompositionEnd,
|
|
22185
|
+
handleCompositionUpdate
|
|
22186
|
+
} = useComposition({
|
|
22187
|
+
afterComposition: (e) => onInput(e)
|
|
22188
|
+
});
|
|
22189
|
+
const { wrapperRef, isFocused, handleBlur } = useFocusController(inputRef, {
|
|
22190
|
+
beforeFocus() {
|
|
22191
|
+
return selectDisabled.value;
|
|
22192
|
+
},
|
|
22193
|
+
afterFocus() {
|
|
22194
|
+
if (props.automaticDropdown && !expanded.value) {
|
|
22195
|
+
expanded.value = true;
|
|
22196
|
+
states.menuVisibleOnFocus = true;
|
|
22197
|
+
}
|
|
22198
|
+
},
|
|
22199
|
+
beforeBlur(event) {
|
|
22200
|
+
var _a, _b;
|
|
22201
|
+
return ((_a = tooltipRef.value) == null ? void 0 : _a.isFocusInsideContent(event)) || ((_b = tagTooltipRef.value) == null ? void 0 : _b.isFocusInsideContent(event));
|
|
22202
|
+
},
|
|
22203
|
+
afterBlur() {
|
|
22204
|
+
expanded.value = false;
|
|
22205
|
+
states.menuVisibleOnFocus = false;
|
|
22206
|
+
}
|
|
22207
|
+
});
|
|
22208
|
+
const allOptions = vue.ref([]);
|
|
22209
|
+
const filteredOptions = vue.ref([]);
|
|
22210
|
+
const expanded = vue.ref(false);
|
|
22211
|
+
const selectDisabled = vue.computed(() => props.disabled || (elForm == null ? void 0 : elForm.disabled));
|
|
22212
|
+
const needStatusIcon = vue.computed(() => {
|
|
22213
|
+
var _a;
|
|
22214
|
+
return (_a = elForm == null ? void 0 : elForm.statusIcon) != null ? _a : false;
|
|
22215
|
+
});
|
|
22216
|
+
const popupHeight = vue.computed(() => {
|
|
22217
|
+
const totalHeight = filteredOptions.value.length * props.itemHeight;
|
|
22218
|
+
return totalHeight > props.height ? props.height : totalHeight;
|
|
22219
|
+
});
|
|
22220
|
+
const hasModelValue = vue.computed(() => {
|
|
22221
|
+
return props.multiple ? isArray$1(props.modelValue) && props.modelValue.length > 0 : !isEmptyValue(props.modelValue);
|
|
22222
|
+
});
|
|
22223
|
+
const showClearBtn = vue.computed(() => {
|
|
22224
|
+
return props.clearable && !selectDisabled.value && states.inputHovering && hasModelValue.value;
|
|
22225
|
+
});
|
|
22226
|
+
const iconComponent = vue.computed(() => props.remote && props.filterable ? "" : arrow_down_default);
|
|
22227
|
+
const iconReverse = vue.computed(() => iconComponent.value && nsSelect.is("reverse", expanded.value));
|
|
22228
|
+
const validateState = vue.computed(() => (elFormItem == null ? void 0 : elFormItem.validateState) || "");
|
|
22229
|
+
const validateIcon = vue.computed(() => {
|
|
22230
|
+
if (!validateState.value)
|
|
22231
|
+
return;
|
|
22232
|
+
return ValidateComponentsMap[validateState.value];
|
|
22233
|
+
});
|
|
22234
|
+
const debounce$1 = vue.computed(() => props.remote ? 300 : 0);
|
|
22235
|
+
const emptyText = vue.computed(() => {
|
|
22236
|
+
if (props.loading) {
|
|
22237
|
+
return props.loadingText || t("el.select.loading");
|
|
22238
|
+
} else {
|
|
22239
|
+
if (props.remote && !states.inputValue && allOptions.value.length === 0)
|
|
22240
|
+
return false;
|
|
22241
|
+
if (props.filterable && states.inputValue && allOptions.value.length > 0 && filteredOptions.value.length === 0) {
|
|
22242
|
+
return props.noMatchText || t("el.select.noMatch");
|
|
22243
|
+
}
|
|
22244
|
+
if (allOptions.value.length === 0) {
|
|
22245
|
+
return props.noDataText || t("el.select.noData");
|
|
22246
|
+
}
|
|
22247
|
+
}
|
|
22248
|
+
return null;
|
|
22249
|
+
});
|
|
22250
|
+
const filterOptions = (query) => {
|
|
22251
|
+
const isValidOption = (o) => {
|
|
22252
|
+
if (props.filterable && isFunction$1(props.filterMethod))
|
|
22253
|
+
return true;
|
|
22254
|
+
if (props.filterable && props.remote && isFunction$1(props.remoteMethod))
|
|
22255
|
+
return true;
|
|
22256
|
+
const regexp = new RegExp(escapeStringRegexp(query), "i");
|
|
22257
|
+
return query ? regexp.test(getLabel(o) || "") : true;
|
|
22258
|
+
};
|
|
22259
|
+
if (props.loading) {
|
|
22260
|
+
return [];
|
|
22261
|
+
}
|
|
22262
|
+
return [...states.createdOptions, ...props.options].reduce((all, item) => {
|
|
22263
|
+
const options = getOptions(item);
|
|
22264
|
+
if (isArray$1(options)) {
|
|
22265
|
+
const filtered = options.filter(isValidOption);
|
|
22266
|
+
if (filtered.length > 0) {
|
|
22267
|
+
all.push({
|
|
22268
|
+
label: getLabel(item),
|
|
22269
|
+
type: "Group"
|
|
22270
|
+
}, ...filtered);
|
|
22271
|
+
}
|
|
22272
|
+
} else if (props.remote || isValidOption(item)) {
|
|
22273
|
+
all.push(item);
|
|
22274
|
+
}
|
|
22275
|
+
return all;
|
|
22276
|
+
}, []);
|
|
22277
|
+
};
|
|
22278
|
+
const updateOptions = () => {
|
|
22279
|
+
allOptions.value = filterOptions("");
|
|
22280
|
+
filteredOptions.value = filterOptions(states.inputValue);
|
|
22281
|
+
};
|
|
22282
|
+
const allOptionsValueMap = vue.computed(() => {
|
|
22283
|
+
const valueMap = /* @__PURE__ */ new Map();
|
|
22284
|
+
allOptions.value.forEach((option, index) => {
|
|
22285
|
+
valueMap.set(getValueKey(getValue(option)), { option, index });
|
|
22286
|
+
});
|
|
22287
|
+
return valueMap;
|
|
22288
|
+
});
|
|
22289
|
+
const filteredOptionsValueMap = vue.computed(() => {
|
|
22290
|
+
const valueMap = /* @__PURE__ */ new Map();
|
|
22291
|
+
filteredOptions.value.forEach((option, index) => {
|
|
22292
|
+
valueMap.set(getValueKey(getValue(option)), { option, index });
|
|
22293
|
+
});
|
|
22294
|
+
return valueMap;
|
|
22295
|
+
});
|
|
22296
|
+
const optionsAllDisabled = vue.computed(() => filteredOptions.value.every((option) => getDisabled(option)));
|
|
22297
|
+
const selectSize = useFormSize();
|
|
22298
|
+
const collapseTagSize = vue.computed(() => selectSize.value === "small" ? "small" : "default");
|
|
22299
|
+
const calculatePopperSize = () => {
|
|
22300
|
+
var _a;
|
|
22301
|
+
if (isNumber(props.fitInputWidth)) {
|
|
22302
|
+
popperSize.value = props.fitInputWidth;
|
|
22303
|
+
return;
|
|
22304
|
+
}
|
|
22305
|
+
const width = ((_a = selectRef.value) == null ? void 0 : _a.offsetWidth) || 200;
|
|
22306
|
+
if (!props.fitInputWidth && allOptions.value.length > 0) {
|
|
22307
|
+
vue.nextTick(() => {
|
|
22308
|
+
popperSize.value = Math.max(width, calculateLabelMaxWidth());
|
|
22309
|
+
});
|
|
22310
|
+
} else {
|
|
22311
|
+
popperSize.value = width;
|
|
22312
|
+
}
|
|
22313
|
+
};
|
|
22314
|
+
const calculateLabelMaxWidth = () => {
|
|
22315
|
+
var _a, _b;
|
|
22316
|
+
const canvas = document.createElement("canvas");
|
|
22317
|
+
const ctx = canvas.getContext("2d");
|
|
22318
|
+
const selector = nsSelect.be("dropdown", "item");
|
|
22319
|
+
const dom = ((_b = (_a = menuRef.value) == null ? void 0 : _a.listRef) == null ? void 0 : _b.innerRef) || document;
|
|
22320
|
+
const dropdownItemEl = dom.querySelector(`.${selector}`);
|
|
22321
|
+
if (dropdownItemEl === null || ctx === null)
|
|
22322
|
+
return 0;
|
|
22323
|
+
const style = getComputedStyle(dropdownItemEl);
|
|
22324
|
+
const padding = Number.parseFloat(style.paddingLeft) + Number.parseFloat(style.paddingRight);
|
|
22325
|
+
ctx.font = style.font;
|
|
22326
|
+
const maxWidth = filteredOptions.value.reduce((max, option) => {
|
|
22327
|
+
const metrics = ctx.measureText(getLabel(option));
|
|
22328
|
+
return Math.max(metrics.width, max);
|
|
22329
|
+
}, 0);
|
|
22330
|
+
return maxWidth + padding;
|
|
22331
|
+
};
|
|
22332
|
+
const getGapWidth = () => {
|
|
22333
|
+
if (!selectionRef.value)
|
|
22334
|
+
return 0;
|
|
22335
|
+
const style = window.getComputedStyle(selectionRef.value);
|
|
22336
|
+
return Number.parseFloat(style.gap || "6px");
|
|
22337
|
+
};
|
|
22338
|
+
const tagStyle = vue.computed(() => {
|
|
22339
|
+
const gapWidth = getGapWidth();
|
|
22340
|
+
const maxWidth = collapseItemRef.value && props.maxCollapseTags === 1 ? states.selectionWidth - states.collapseItemWidth - gapWidth : states.selectionWidth;
|
|
22341
|
+
return { maxWidth: `${maxWidth}px` };
|
|
22342
|
+
});
|
|
22343
|
+
const collapseTagStyle = vue.computed(() => {
|
|
22344
|
+
return { maxWidth: `${states.selectionWidth}px` };
|
|
22345
|
+
});
|
|
22346
|
+
const shouldShowPlaceholder = vue.computed(() => {
|
|
22347
|
+
if (isArray$1(props.modelValue)) {
|
|
22348
|
+
return props.modelValue.length === 0 && !states.inputValue;
|
|
22349
|
+
}
|
|
22350
|
+
return props.filterable ? !states.inputValue : true;
|
|
22351
|
+
});
|
|
22352
|
+
const currentPlaceholder = vue.computed(() => {
|
|
22353
|
+
var _a;
|
|
22354
|
+
const _placeholder = (_a = props.placeholder) != null ? _a : t("el.select.placeholder");
|
|
22355
|
+
return props.multiple || !hasModelValue.value ? _placeholder : states.selectedLabel;
|
|
22356
|
+
});
|
|
22357
|
+
const popperRef = vue.computed(() => {
|
|
22358
|
+
var _a, _b;
|
|
22359
|
+
return (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef;
|
|
22360
|
+
});
|
|
22361
|
+
const indexRef = vue.computed(() => {
|
|
22362
|
+
if (props.multiple) {
|
|
22363
|
+
const len = props.modelValue.length;
|
|
22364
|
+
if (props.modelValue.length > 0 && filteredOptionsValueMap.value.has(props.modelValue[len - 1])) {
|
|
22365
|
+
const { index } = filteredOptionsValueMap.value.get(props.modelValue[len - 1]);
|
|
22366
|
+
return index;
|
|
22367
|
+
}
|
|
22368
|
+
} else {
|
|
22369
|
+
if (!isEmptyValue(props.modelValue) && filteredOptionsValueMap.value.has(props.modelValue)) {
|
|
22370
|
+
const { index } = filteredOptionsValueMap.value.get(props.modelValue);
|
|
22371
|
+
return index;
|
|
22372
|
+
}
|
|
22373
|
+
}
|
|
22374
|
+
return -1;
|
|
22375
|
+
});
|
|
22376
|
+
const dropdownMenuVisible = vue.computed({
|
|
22377
|
+
get() {
|
|
22378
|
+
return expanded.value && emptyText.value !== false;
|
|
22379
|
+
},
|
|
22380
|
+
set(val) {
|
|
22381
|
+
expanded.value = val;
|
|
22382
|
+
}
|
|
22383
|
+
});
|
|
22384
|
+
const showTagList = vue.computed(() => {
|
|
22385
|
+
if (!props.multiple) {
|
|
22386
|
+
return [];
|
|
22387
|
+
}
|
|
22388
|
+
return props.collapseTags ? states.cachedOptions.slice(0, props.maxCollapseTags) : states.cachedOptions;
|
|
22389
|
+
});
|
|
22390
|
+
const collapseTagList = vue.computed(() => {
|
|
22391
|
+
if (!props.multiple) {
|
|
22392
|
+
return [];
|
|
22393
|
+
}
|
|
22394
|
+
return props.collapseTags ? states.cachedOptions.slice(props.maxCollapseTags) : [];
|
|
22395
|
+
});
|
|
22396
|
+
const {
|
|
22397
|
+
createNewOption,
|
|
22398
|
+
removeNewOption,
|
|
22399
|
+
selectNewOption,
|
|
22400
|
+
clearAllNewOption
|
|
22401
|
+
} = useAllowCreate(props, states);
|
|
22402
|
+
const toggleMenu = () => {
|
|
22403
|
+
if (selectDisabled.value)
|
|
22404
|
+
return;
|
|
22405
|
+
if (states.menuVisibleOnFocus) {
|
|
22406
|
+
states.menuVisibleOnFocus = false;
|
|
22407
|
+
} else {
|
|
22408
|
+
expanded.value = !expanded.value;
|
|
22409
|
+
}
|
|
22410
|
+
};
|
|
22411
|
+
const onInputChange = () => {
|
|
22412
|
+
if (states.inputValue.length > 0 && !expanded.value) {
|
|
22413
|
+
expanded.value = true;
|
|
22414
|
+
}
|
|
22415
|
+
createNewOption(states.inputValue);
|
|
22416
|
+
handleQueryChange(states.inputValue);
|
|
22417
|
+
};
|
|
22418
|
+
const debouncedOnInputChange = debounce(onInputChange, debounce$1.value);
|
|
22419
|
+
const handleQueryChange = (val) => {
|
|
22420
|
+
if (states.previousQuery === val || isComposing.value) {
|
|
22421
|
+
return;
|
|
22422
|
+
}
|
|
22423
|
+
states.previousQuery = val;
|
|
22424
|
+
if (props.filterable && isFunction$1(props.filterMethod)) {
|
|
22425
|
+
props.filterMethod(val);
|
|
22426
|
+
} else if (props.filterable && props.remote && isFunction$1(props.remoteMethod)) {
|
|
22427
|
+
props.remoteMethod(val);
|
|
22428
|
+
}
|
|
22429
|
+
if (props.defaultFirstOption && (props.filterable || props.remote) && filteredOptions.value.length) {
|
|
22430
|
+
vue.nextTick(checkDefaultFirstOption);
|
|
22431
|
+
} else {
|
|
22432
|
+
vue.nextTick(updateHoveringIndex);
|
|
22433
|
+
}
|
|
22434
|
+
};
|
|
22435
|
+
const checkDefaultFirstOption = () => {
|
|
22436
|
+
const optionsInDropdown = filteredOptions.value.filter((n) => !n.disabled && n.type !== "Group");
|
|
22437
|
+
const userCreatedOption = optionsInDropdown.find((n) => n.created);
|
|
22438
|
+
const firstOriginOption = optionsInDropdown[0];
|
|
22439
|
+
states.hoveringIndex = getValueIndex(filteredOptions.value, userCreatedOption || firstOriginOption);
|
|
22440
|
+
};
|
|
22441
|
+
const emitChange = (val) => {
|
|
22442
|
+
if (!isEqual$1(props.modelValue, val)) {
|
|
22443
|
+
emit(CHANGE_EVENT, val);
|
|
22444
|
+
}
|
|
22445
|
+
};
|
|
22446
|
+
const update = (val) => {
|
|
22447
|
+
emit(UPDATE_MODEL_EVENT, val);
|
|
22448
|
+
emitChange(val);
|
|
22449
|
+
states.previousValue = props.multiple ? String(val) : val;
|
|
22450
|
+
};
|
|
22451
|
+
const getValueIndex = (arr = [], value) => {
|
|
22452
|
+
if (!isObject$1(value)) {
|
|
22453
|
+
return arr.indexOf(value);
|
|
22454
|
+
}
|
|
22455
|
+
const valueKey = props.valueKey;
|
|
22456
|
+
let index = -1;
|
|
22457
|
+
arr.some((item, i) => {
|
|
22458
|
+
if (get(item, valueKey) === get(value, valueKey)) {
|
|
22459
|
+
index = i;
|
|
22460
|
+
return true;
|
|
22461
|
+
}
|
|
22462
|
+
return false;
|
|
22463
|
+
});
|
|
22464
|
+
return index;
|
|
22465
|
+
};
|
|
22466
|
+
const getValueKey = (item) => {
|
|
22467
|
+
return isObject$1(item) ? get(item, props.valueKey) : item;
|
|
22468
|
+
};
|
|
22469
|
+
const handleResize = () => {
|
|
22470
|
+
calculatePopperSize();
|
|
22471
|
+
};
|
|
22472
|
+
const resetSelectionWidth = () => {
|
|
22473
|
+
states.selectionWidth = selectionRef.value.getBoundingClientRect().width;
|
|
22474
|
+
};
|
|
22475
|
+
const resetCollapseItemWidth = () => {
|
|
22476
|
+
states.collapseItemWidth = collapseItemRef.value.getBoundingClientRect().width;
|
|
22477
|
+
};
|
|
22478
|
+
const updateTooltip = () => {
|
|
22479
|
+
var _a, _b;
|
|
22480
|
+
(_b = (_a = tooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
|
|
22481
|
+
};
|
|
22482
|
+
const updateTagTooltip = () => {
|
|
22483
|
+
var _a, _b;
|
|
22484
|
+
(_b = (_a = tagTooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
|
|
22485
|
+
};
|
|
22486
|
+
const onSelect = (option) => {
|
|
22487
|
+
if (props.multiple) {
|
|
22488
|
+
let selectedOptions = props.modelValue.slice();
|
|
22489
|
+
const index = getValueIndex(selectedOptions, getValue(option));
|
|
22490
|
+
if (index > -1) {
|
|
22491
|
+
selectedOptions = [
|
|
22492
|
+
...selectedOptions.slice(0, index),
|
|
22493
|
+
...selectedOptions.slice(index + 1)
|
|
22494
|
+
];
|
|
22495
|
+
states.cachedOptions.splice(index, 1);
|
|
22496
|
+
removeNewOption(option);
|
|
22497
|
+
} else if (props.multipleLimit <= 0 || selectedOptions.length < props.multipleLimit) {
|
|
22498
|
+
selectedOptions = [...selectedOptions, getValue(option)];
|
|
22499
|
+
states.cachedOptions.push(option);
|
|
22500
|
+
selectNewOption(option);
|
|
22501
|
+
}
|
|
22502
|
+
update(selectedOptions);
|
|
22503
|
+
if (option.created) {
|
|
22504
|
+
handleQueryChange("");
|
|
22505
|
+
}
|
|
22506
|
+
if (props.filterable && !props.reserveKeyword) {
|
|
22507
|
+
states.inputValue = "";
|
|
22508
|
+
}
|
|
22509
|
+
} else {
|
|
22510
|
+
states.selectedLabel = getLabel(option);
|
|
22511
|
+
update(getValue(option));
|
|
22512
|
+
expanded.value = false;
|
|
22513
|
+
selectNewOption(option);
|
|
22514
|
+
if (!option.created) {
|
|
22515
|
+
clearAllNewOption();
|
|
22516
|
+
}
|
|
22517
|
+
}
|
|
22518
|
+
focus();
|
|
22519
|
+
};
|
|
22520
|
+
const deleteTag = (event, option) => {
|
|
22521
|
+
let selectedOptions = props.modelValue.slice();
|
|
22522
|
+
const index = getValueIndex(selectedOptions, getValue(option));
|
|
22523
|
+
if (index > -1 && !selectDisabled.value) {
|
|
22524
|
+
selectedOptions = [
|
|
22525
|
+
...props.modelValue.slice(0, index),
|
|
22526
|
+
...props.modelValue.slice(index + 1)
|
|
22527
|
+
];
|
|
22528
|
+
states.cachedOptions.splice(index, 1);
|
|
22529
|
+
update(selectedOptions);
|
|
22530
|
+
emit("remove-tag", getValue(option));
|
|
22531
|
+
removeNewOption(option);
|
|
22532
|
+
}
|
|
22533
|
+
event.stopPropagation();
|
|
22534
|
+
focus();
|
|
22535
|
+
};
|
|
22536
|
+
const focus = () => {
|
|
22537
|
+
var _a;
|
|
22538
|
+
(_a = inputRef.value) == null ? void 0 : _a.focus();
|
|
22539
|
+
};
|
|
22540
|
+
const blur = () => {
|
|
22541
|
+
var _a;
|
|
22542
|
+
if (expanded.value) {
|
|
22543
|
+
expanded.value = false;
|
|
22544
|
+
vue.nextTick(() => {
|
|
22545
|
+
var _a2;
|
|
22546
|
+
return (_a2 = inputRef.value) == null ? void 0 : _a2.blur();
|
|
22547
|
+
});
|
|
22548
|
+
return;
|
|
22549
|
+
}
|
|
22550
|
+
(_a = inputRef.value) == null ? void 0 : _a.blur();
|
|
22551
|
+
};
|
|
22552
|
+
const handleEsc = () => {
|
|
22553
|
+
if (states.inputValue.length > 0) {
|
|
22554
|
+
states.inputValue = "";
|
|
22555
|
+
} else {
|
|
22556
|
+
expanded.value = false;
|
|
22557
|
+
}
|
|
22558
|
+
};
|
|
22559
|
+
const getLastNotDisabledIndex = (value) => findLastIndex(value, (it) => !states.cachedOptions.some((option) => getValue(option) === it && getDisabled(option)));
|
|
22560
|
+
const handleDel = (e) => {
|
|
22561
|
+
if (!props.multiple)
|
|
22562
|
+
return;
|
|
22563
|
+
if (e.code === EVENT_CODE.delete)
|
|
22564
|
+
return;
|
|
22565
|
+
if (states.inputValue.length === 0) {
|
|
22566
|
+
e.preventDefault();
|
|
22567
|
+
const selected = props.modelValue.slice();
|
|
22568
|
+
const lastNotDisabledIndex = getLastNotDisabledIndex(selected);
|
|
22569
|
+
if (lastNotDisabledIndex < 0)
|
|
22570
|
+
return;
|
|
22571
|
+
const removeTagValue = selected[lastNotDisabledIndex];
|
|
22572
|
+
selected.splice(lastNotDisabledIndex, 1);
|
|
22573
|
+
const option = states.cachedOptions[lastNotDisabledIndex];
|
|
22574
|
+
states.cachedOptions.splice(lastNotDisabledIndex, 1);
|
|
22575
|
+
removeNewOption(option);
|
|
22576
|
+
update(selected);
|
|
22577
|
+
emit("remove-tag", removeTagValue);
|
|
22578
|
+
}
|
|
22579
|
+
};
|
|
22580
|
+
const handleClear = () => {
|
|
22581
|
+
let emptyValue;
|
|
22582
|
+
if (isArray$1(props.modelValue)) {
|
|
22583
|
+
emptyValue = [];
|
|
22584
|
+
} else {
|
|
22585
|
+
emptyValue = valueOnClear.value;
|
|
22586
|
+
}
|
|
22587
|
+
if (props.multiple) {
|
|
22588
|
+
states.cachedOptions = [];
|
|
22589
|
+
} else {
|
|
22590
|
+
states.selectedLabel = "";
|
|
22591
|
+
}
|
|
22592
|
+
expanded.value = false;
|
|
22593
|
+
update(emptyValue);
|
|
22594
|
+
emit("clear");
|
|
22595
|
+
clearAllNewOption();
|
|
22596
|
+
focus();
|
|
22597
|
+
};
|
|
22598
|
+
const onKeyboardNavigate = (direction, hoveringIndex = void 0) => {
|
|
22599
|
+
const options = filteredOptions.value;
|
|
22600
|
+
if (!["forward", "backward"].includes(direction) || selectDisabled.value || options.length <= 0 || optionsAllDisabled.value || isComposing.value) {
|
|
22601
|
+
return;
|
|
22602
|
+
}
|
|
22603
|
+
if (!expanded.value) {
|
|
22604
|
+
return toggleMenu();
|
|
22605
|
+
}
|
|
22606
|
+
if (hoveringIndex === void 0) {
|
|
22607
|
+
hoveringIndex = states.hoveringIndex;
|
|
22608
|
+
}
|
|
22609
|
+
let newIndex = -1;
|
|
22610
|
+
if (direction === "forward") {
|
|
22611
|
+
newIndex = hoveringIndex + 1;
|
|
22612
|
+
if (newIndex >= options.length) {
|
|
22613
|
+
newIndex = 0;
|
|
22614
|
+
}
|
|
22615
|
+
} else if (direction === "backward") {
|
|
22616
|
+
newIndex = hoveringIndex - 1;
|
|
22617
|
+
if (newIndex < 0 || newIndex >= options.length) {
|
|
22618
|
+
newIndex = options.length - 1;
|
|
22619
|
+
}
|
|
22620
|
+
}
|
|
22621
|
+
const option = options[newIndex];
|
|
22622
|
+
if (getDisabled(option) || option.type === "Group") {
|
|
22623
|
+
return onKeyboardNavigate(direction, newIndex);
|
|
22624
|
+
} else {
|
|
22625
|
+
states.hoveringIndex = newIndex;
|
|
22626
|
+
scrollToItem(newIndex);
|
|
22627
|
+
}
|
|
22628
|
+
};
|
|
22629
|
+
const onKeyboardSelect = () => {
|
|
22630
|
+
if (!expanded.value) {
|
|
22631
|
+
return toggleMenu();
|
|
22632
|
+
} else if (~states.hoveringIndex && filteredOptions.value[states.hoveringIndex]) {
|
|
22633
|
+
onSelect(filteredOptions.value[states.hoveringIndex]);
|
|
22634
|
+
}
|
|
22635
|
+
};
|
|
22636
|
+
const onHoverOption = (idx) => {
|
|
22637
|
+
states.hoveringIndex = idx != null ? idx : -1;
|
|
22638
|
+
};
|
|
22639
|
+
const updateHoveringIndex = () => {
|
|
22640
|
+
if (!props.multiple) {
|
|
22641
|
+
states.hoveringIndex = filteredOptions.value.findIndex((item) => {
|
|
22642
|
+
return getValueKey(item) === getValueKey(props.modelValue);
|
|
22643
|
+
});
|
|
22644
|
+
} else {
|
|
22645
|
+
states.hoveringIndex = filteredOptions.value.findIndex((item) => props.modelValue.some((modelValue) => getValueKey(modelValue) === getValueKey(item)));
|
|
22646
|
+
}
|
|
22647
|
+
};
|
|
22648
|
+
const onInput = (event) => {
|
|
22649
|
+
states.inputValue = event.target.value;
|
|
22650
|
+
if (props.remote) {
|
|
22651
|
+
debouncedOnInputChange();
|
|
22652
|
+
} else {
|
|
22653
|
+
return onInputChange();
|
|
22654
|
+
}
|
|
22655
|
+
};
|
|
22656
|
+
const handleClickOutside = (event) => {
|
|
22657
|
+
expanded.value = false;
|
|
22658
|
+
if (isFocused.value) {
|
|
22659
|
+
const _event = new FocusEvent("focus", event);
|
|
22660
|
+
handleBlur(_event);
|
|
22661
|
+
}
|
|
22662
|
+
};
|
|
22663
|
+
const handleMenuEnter = () => {
|
|
22664
|
+
states.isBeforeHide = false;
|
|
22665
|
+
return vue.nextTick(() => {
|
|
22666
|
+
if (~indexRef.value) {
|
|
22667
|
+
scrollToItem(states.hoveringIndex);
|
|
22668
|
+
}
|
|
22669
|
+
});
|
|
22670
|
+
};
|
|
22671
|
+
const scrollToItem = (index) => {
|
|
22672
|
+
menuRef.value.scrollToItem(index);
|
|
22673
|
+
};
|
|
22674
|
+
const getOption = (value, cachedOptions) => {
|
|
22675
|
+
const selectValue = getValueKey(value);
|
|
22676
|
+
if (allOptionsValueMap.value.has(selectValue)) {
|
|
22677
|
+
const { option } = allOptionsValueMap.value.get(selectValue);
|
|
22678
|
+
return option;
|
|
22679
|
+
}
|
|
22680
|
+
if (cachedOptions && cachedOptions.length) {
|
|
22681
|
+
const option = cachedOptions.find((option2) => getValueKey(getValue(option2)) === selectValue);
|
|
22682
|
+
if (option) {
|
|
22683
|
+
return option;
|
|
22684
|
+
}
|
|
22685
|
+
}
|
|
22686
|
+
return {
|
|
22687
|
+
[aliasProps.value.value]: value,
|
|
22688
|
+
[aliasProps.value.label]: value
|
|
22689
|
+
};
|
|
22690
|
+
};
|
|
22691
|
+
const initStates = (needUpdateSelectedLabel = false) => {
|
|
22692
|
+
if (props.multiple) {
|
|
22693
|
+
if (props.modelValue.length > 0) {
|
|
22694
|
+
const cachedOptions = states.cachedOptions.slice();
|
|
22695
|
+
states.cachedOptions.length = 0;
|
|
22696
|
+
states.previousValue = props.modelValue.toString();
|
|
22697
|
+
for (const value of props.modelValue) {
|
|
22698
|
+
const option = getOption(value, cachedOptions);
|
|
22699
|
+
states.cachedOptions.push(option);
|
|
22700
|
+
}
|
|
22701
|
+
} else {
|
|
22702
|
+
states.cachedOptions = [];
|
|
22703
|
+
states.previousValue = void 0;
|
|
22704
|
+
}
|
|
22705
|
+
} else {
|
|
22706
|
+
if (hasModelValue.value) {
|
|
22707
|
+
states.previousValue = props.modelValue;
|
|
22708
|
+
const options = filteredOptions.value;
|
|
22709
|
+
const selectedItemIndex = options.findIndex((option) => getValueKey(getValue(option)) === getValueKey(props.modelValue));
|
|
22710
|
+
if (~selectedItemIndex) {
|
|
22711
|
+
states.selectedLabel = getLabel(options[selectedItemIndex]);
|
|
22712
|
+
} else {
|
|
22713
|
+
if (!states.selectedLabel || needUpdateSelectedLabel) {
|
|
22714
|
+
states.selectedLabel = getValueKey(props.modelValue);
|
|
22715
|
+
}
|
|
22716
|
+
}
|
|
22717
|
+
} else {
|
|
22718
|
+
states.selectedLabel = "";
|
|
22719
|
+
states.previousValue = void 0;
|
|
22720
|
+
}
|
|
22721
|
+
}
|
|
22722
|
+
clearAllNewOption();
|
|
22723
|
+
calculatePopperSize();
|
|
22724
|
+
};
|
|
22725
|
+
vue.watch(() => props.fitInputWidth, () => {
|
|
22726
|
+
calculatePopperSize();
|
|
22727
|
+
});
|
|
22728
|
+
vue.watch(expanded, (val) => {
|
|
22729
|
+
if (val) {
|
|
22730
|
+
if (!props.persistent) {
|
|
22731
|
+
calculatePopperSize();
|
|
22732
|
+
}
|
|
22733
|
+
handleQueryChange("");
|
|
22734
|
+
} else {
|
|
22735
|
+
states.inputValue = "";
|
|
22736
|
+
states.previousQuery = null;
|
|
22737
|
+
states.isBeforeHide = true;
|
|
22738
|
+
createNewOption("");
|
|
22739
|
+
}
|
|
22740
|
+
emit("visible-change", val);
|
|
22741
|
+
});
|
|
22742
|
+
vue.watch(() => props.modelValue, (val, oldVal) => {
|
|
22743
|
+
var _a;
|
|
22744
|
+
const isValEmpty = !val || isArray$1(val) && val.length === 0;
|
|
22745
|
+
if (isValEmpty || props.multiple && !isEqual$1(val.toString(), states.previousValue) || !props.multiple && getValueKey(val) !== getValueKey(states.previousValue)) {
|
|
22746
|
+
initStates(true);
|
|
22747
|
+
}
|
|
22748
|
+
if (!isEqual$1(val, oldVal) && props.validateEvent) {
|
|
22749
|
+
(_a = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a.call(elFormItem, "change").catch((err) => debugWarn());
|
|
22750
|
+
}
|
|
22751
|
+
}, {
|
|
22752
|
+
deep: true
|
|
22753
|
+
});
|
|
22754
|
+
vue.watch(() => props.options, () => {
|
|
22755
|
+
const input = inputRef.value;
|
|
22756
|
+
if (!input || input && document.activeElement !== input) {
|
|
22757
|
+
initStates();
|
|
22758
|
+
}
|
|
22759
|
+
}, {
|
|
22760
|
+
deep: true,
|
|
22761
|
+
flush: "post"
|
|
22762
|
+
});
|
|
22763
|
+
vue.watch(() => filteredOptions.value, () => {
|
|
22764
|
+
calculatePopperSize();
|
|
22765
|
+
return menuRef.value && vue.nextTick(menuRef.value.resetScrollTop);
|
|
22766
|
+
});
|
|
22767
|
+
vue.watchEffect(() => {
|
|
22768
|
+
if (states.isBeforeHide)
|
|
22769
|
+
return;
|
|
22770
|
+
updateOptions();
|
|
22771
|
+
});
|
|
22772
|
+
vue.watchEffect(() => {
|
|
22773
|
+
const { valueKey, options } = props;
|
|
22774
|
+
const duplicateValue = /* @__PURE__ */ new Map();
|
|
22775
|
+
for (const item of options) {
|
|
22776
|
+
const optionValue = getValue(item);
|
|
22777
|
+
let v = optionValue;
|
|
22778
|
+
if (isObject$1(v)) {
|
|
22779
|
+
v = get(optionValue, valueKey);
|
|
22780
|
+
}
|
|
22781
|
+
if (duplicateValue.get(v)) {
|
|
22782
|
+
break;
|
|
22783
|
+
} else {
|
|
22784
|
+
duplicateValue.set(v, true);
|
|
22785
|
+
}
|
|
22786
|
+
}
|
|
22787
|
+
});
|
|
22788
|
+
vue.onMounted(() => {
|
|
22789
|
+
initStates();
|
|
22790
|
+
});
|
|
22791
|
+
useResizeObserver(selectRef, handleResize);
|
|
22792
|
+
useResizeObserver(selectionRef, resetSelectionWidth);
|
|
22793
|
+
useResizeObserver(menuRef, updateTooltip);
|
|
22794
|
+
useResizeObserver(wrapperRef, updateTooltip);
|
|
22795
|
+
useResizeObserver(tagMenuRef, updateTagTooltip);
|
|
22796
|
+
useResizeObserver(collapseItemRef, resetCollapseItemWidth);
|
|
22797
|
+
return {
|
|
22798
|
+
inputId,
|
|
22799
|
+
collapseTagSize,
|
|
22800
|
+
currentPlaceholder,
|
|
22801
|
+
expanded,
|
|
22802
|
+
emptyText,
|
|
22803
|
+
popupHeight,
|
|
22804
|
+
debounce: debounce$1,
|
|
22805
|
+
allOptions,
|
|
22806
|
+
filteredOptions,
|
|
22807
|
+
iconComponent,
|
|
22808
|
+
iconReverse,
|
|
22809
|
+
tagStyle,
|
|
22810
|
+
collapseTagStyle,
|
|
22811
|
+
popperSize,
|
|
22812
|
+
dropdownMenuVisible,
|
|
22813
|
+
hasModelValue,
|
|
22814
|
+
shouldShowPlaceholder,
|
|
22815
|
+
selectDisabled,
|
|
22816
|
+
selectSize,
|
|
22817
|
+
needStatusIcon,
|
|
22818
|
+
showClearBtn,
|
|
22819
|
+
states,
|
|
22820
|
+
isFocused,
|
|
22821
|
+
nsSelect,
|
|
22822
|
+
nsInput,
|
|
22823
|
+
inputRef,
|
|
22824
|
+
menuRef,
|
|
22825
|
+
tagMenuRef,
|
|
22826
|
+
tooltipRef,
|
|
22827
|
+
tagTooltipRef,
|
|
22828
|
+
selectRef,
|
|
22829
|
+
wrapperRef,
|
|
22830
|
+
selectionRef,
|
|
22831
|
+
prefixRef,
|
|
22832
|
+
suffixRef,
|
|
22833
|
+
collapseItemRef,
|
|
22834
|
+
popperRef,
|
|
22835
|
+
validateState,
|
|
22836
|
+
validateIcon,
|
|
22837
|
+
showTagList,
|
|
22838
|
+
collapseTagList,
|
|
22839
|
+
debouncedOnInputChange,
|
|
22840
|
+
deleteTag,
|
|
22841
|
+
getLabel,
|
|
22842
|
+
getValue,
|
|
22843
|
+
getDisabled,
|
|
22844
|
+
getValueKey,
|
|
22845
|
+
handleClear,
|
|
22846
|
+
handleClickOutside,
|
|
22847
|
+
handleDel,
|
|
22848
|
+
handleEsc,
|
|
22849
|
+
focus,
|
|
22850
|
+
blur,
|
|
22851
|
+
handleMenuEnter,
|
|
22852
|
+
handleResize,
|
|
22853
|
+
resetSelectionWidth,
|
|
22854
|
+
updateTooltip,
|
|
22855
|
+
updateTagTooltip,
|
|
22856
|
+
updateOptions,
|
|
22857
|
+
toggleMenu,
|
|
22858
|
+
scrollTo: scrollToItem,
|
|
22859
|
+
onInput,
|
|
22860
|
+
onKeyboardNavigate,
|
|
22861
|
+
onKeyboardSelect,
|
|
22862
|
+
onSelect,
|
|
22863
|
+
onHover: onHoverOption,
|
|
22864
|
+
handleCompositionStart,
|
|
22865
|
+
handleCompositionEnd,
|
|
22866
|
+
handleCompositionUpdate
|
|
22867
|
+
};
|
|
22868
|
+
};
|
|
22869
|
+
|
|
22870
|
+
const _sfc_main$d = vue.defineComponent({
|
|
22871
|
+
name: "ElSelectV2",
|
|
22872
|
+
components: {
|
|
22873
|
+
ElSelectMenu,
|
|
22874
|
+
ElTag,
|
|
22875
|
+
ElTooltip,
|
|
22876
|
+
ElIcon
|
|
22877
|
+
},
|
|
22878
|
+
directives: { ClickOutside },
|
|
22879
|
+
props: SelectProps,
|
|
22880
|
+
emits: selectEmits,
|
|
22881
|
+
setup(props, { emit }) {
|
|
22882
|
+
const modelValue = vue.computed(() => {
|
|
22883
|
+
const { modelValue: rawModelValue, multiple } = props;
|
|
22884
|
+
const fallback = multiple ? [] : void 0;
|
|
22885
|
+
if (isArray$1(rawModelValue)) {
|
|
22886
|
+
return multiple ? rawModelValue : fallback;
|
|
22887
|
+
}
|
|
22888
|
+
return multiple ? fallback : rawModelValue;
|
|
22889
|
+
});
|
|
22890
|
+
const API = useSelect(vue.reactive({
|
|
22891
|
+
...vue.toRefs(props),
|
|
22892
|
+
modelValue
|
|
22893
|
+
}), emit);
|
|
22894
|
+
const { calculatorRef, inputStyle } = useCalcInputWidth();
|
|
22895
|
+
vue.provide(selectV2InjectionKey, {
|
|
22896
|
+
props: vue.reactive({
|
|
22897
|
+
...vue.toRefs(props),
|
|
22898
|
+
height: API.popupHeight,
|
|
22899
|
+
modelValue
|
|
22900
|
+
}),
|
|
22901
|
+
expanded: API.expanded,
|
|
22902
|
+
tooltipRef: API.tooltipRef,
|
|
22903
|
+
onSelect: API.onSelect,
|
|
22904
|
+
onHover: API.onHover,
|
|
22905
|
+
onKeyboardNavigate: API.onKeyboardNavigate,
|
|
22906
|
+
onKeyboardSelect: API.onKeyboardSelect
|
|
22907
|
+
});
|
|
22908
|
+
const selectedLabel = vue.computed(() => {
|
|
22909
|
+
if (!props.multiple) {
|
|
22910
|
+
return API.states.selectedLabel;
|
|
22911
|
+
}
|
|
22912
|
+
return API.states.cachedOptions.map((i) => i.label);
|
|
22913
|
+
});
|
|
22914
|
+
return {
|
|
22915
|
+
...API,
|
|
22916
|
+
modelValue,
|
|
22917
|
+
selectedLabel,
|
|
22918
|
+
calculatorRef,
|
|
22919
|
+
inputStyle
|
|
22920
|
+
};
|
|
22921
|
+
}
|
|
22922
|
+
});
|
|
22923
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
22924
|
+
const _component_el_tag = vue.resolveComponent("el-tag");
|
|
22925
|
+
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
22926
|
+
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
22927
|
+
const _component_el_select_menu = vue.resolveComponent("el-select-menu");
|
|
22928
|
+
const _directive_click_outside = vue.resolveDirective("click-outside");
|
|
22929
|
+
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
22930
|
+
ref: "selectRef",
|
|
22931
|
+
class: vue.normalizeClass([_ctx.nsSelect.b(), _ctx.nsSelect.m(_ctx.selectSize)]),
|
|
22932
|
+
onMouseenter: ($event) => _ctx.states.inputHovering = true,
|
|
22933
|
+
onMouseleave: ($event) => _ctx.states.inputHovering = false
|
|
22934
|
+
}, [
|
|
22935
|
+
vue.createVNode(_component_el_tooltip, {
|
|
22936
|
+
ref: "tooltipRef",
|
|
22937
|
+
visible: _ctx.dropdownMenuVisible,
|
|
22938
|
+
teleported: _ctx.teleported,
|
|
22939
|
+
"popper-class": [_ctx.nsSelect.e("popper"), _ctx.popperClass],
|
|
22940
|
+
"gpu-acceleration": false,
|
|
22941
|
+
"stop-popper-mouse-event": false,
|
|
22942
|
+
"popper-options": _ctx.popperOptions,
|
|
22943
|
+
"fallback-placements": _ctx.fallbackPlacements,
|
|
22944
|
+
effect: _ctx.effect,
|
|
22945
|
+
placement: _ctx.placement,
|
|
22946
|
+
pure: "",
|
|
22947
|
+
transition: `${_ctx.nsSelect.namespace.value}-zoom-in-top`,
|
|
22948
|
+
trigger: "click",
|
|
22949
|
+
persistent: _ctx.persistent,
|
|
22950
|
+
"append-to": _ctx.appendTo,
|
|
22951
|
+
"show-arrow": _ctx.showArrow,
|
|
22952
|
+
offset: _ctx.offset,
|
|
22953
|
+
onBeforeShow: _ctx.handleMenuEnter,
|
|
22954
|
+
onHide: ($event) => _ctx.states.isBeforeHide = false
|
|
22955
|
+
}, {
|
|
22956
|
+
default: vue.withCtx(() => [
|
|
22957
|
+
vue.createElementVNode("div", {
|
|
22958
|
+
ref: "wrapperRef",
|
|
22959
|
+
class: vue.normalizeClass([
|
|
22960
|
+
_ctx.nsSelect.e("wrapper"),
|
|
22961
|
+
_ctx.nsSelect.is("focused", _ctx.isFocused),
|
|
22962
|
+
_ctx.nsSelect.is("hovering", _ctx.states.inputHovering),
|
|
22963
|
+
_ctx.nsSelect.is("filterable", _ctx.filterable),
|
|
22964
|
+
_ctx.nsSelect.is("disabled", _ctx.selectDisabled)
|
|
22965
|
+
]),
|
|
22966
|
+
onClick: vue.withModifiers(_ctx.toggleMenu, ["prevent"])
|
|
22967
|
+
}, [
|
|
22968
|
+
_ctx.$slots.prefix ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
22969
|
+
key: 0,
|
|
22970
|
+
ref: "prefixRef",
|
|
22971
|
+
class: vue.normalizeClass(_ctx.nsSelect.e("prefix"))
|
|
22972
|
+
}, [
|
|
22973
|
+
vue.renderSlot(_ctx.$slots, "prefix")
|
|
22974
|
+
], 2)) : vue.createCommentVNode("v-if", true),
|
|
22975
|
+
vue.createElementVNode("div", {
|
|
22976
|
+
ref: "selectionRef",
|
|
22977
|
+
class: vue.normalizeClass([
|
|
22978
|
+
_ctx.nsSelect.e("selection"),
|
|
22979
|
+
_ctx.nsSelect.is("near", _ctx.multiple && !_ctx.$slots.prefix && !!_ctx.modelValue.length)
|
|
22980
|
+
])
|
|
22981
|
+
}, [
|
|
22982
|
+
_ctx.multiple ? vue.renderSlot(_ctx.$slots, "tag", { key: 0 }, () => [
|
|
22983
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.showTagList, (item) => {
|
|
22984
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
22985
|
+
key: _ctx.getValueKey(_ctx.getValue(item)),
|
|
22986
|
+
class: vue.normalizeClass(_ctx.nsSelect.e("selected-item"))
|
|
22987
|
+
}, [
|
|
22988
|
+
vue.createVNode(_component_el_tag, {
|
|
22989
|
+
closable: !_ctx.selectDisabled && !_ctx.getDisabled(item),
|
|
22990
|
+
size: _ctx.collapseTagSize,
|
|
22991
|
+
type: _ctx.tagType,
|
|
22992
|
+
effect: _ctx.tagEffect,
|
|
22993
|
+
"disable-transitions": "",
|
|
22994
|
+
style: vue.normalizeStyle(_ctx.tagStyle),
|
|
22995
|
+
onClose: ($event) => _ctx.deleteTag($event, item)
|
|
22996
|
+
}, {
|
|
22997
|
+
default: vue.withCtx(() => [
|
|
22998
|
+
vue.createElementVNode("span", {
|
|
22999
|
+
class: vue.normalizeClass(_ctx.nsSelect.e("tags-text"))
|
|
23000
|
+
}, [
|
|
23001
|
+
vue.renderSlot(_ctx.$slots, "label", {
|
|
23002
|
+
label: _ctx.getLabel(item),
|
|
23003
|
+
value: _ctx.getValue(item)
|
|
23004
|
+
}, () => [
|
|
23005
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.getLabel(item)), 1)
|
|
23006
|
+
])
|
|
23007
|
+
], 2)
|
|
23008
|
+
]),
|
|
23009
|
+
_: 2
|
|
23010
|
+
}, 1032, ["closable", "size", "type", "effect", "style", "onClose"])
|
|
23011
|
+
], 2);
|
|
23012
|
+
}), 128)),
|
|
23013
|
+
_ctx.collapseTags && _ctx.modelValue.length > _ctx.maxCollapseTags ? (vue.openBlock(), vue.createBlock(_component_el_tooltip, {
|
|
23014
|
+
key: 0,
|
|
23015
|
+
ref: "tagTooltipRef",
|
|
23016
|
+
disabled: _ctx.dropdownMenuVisible || !_ctx.collapseTagsTooltip,
|
|
23017
|
+
"fallback-placements": ["bottom", "top", "right", "left"],
|
|
23018
|
+
effect: _ctx.effect,
|
|
23019
|
+
placement: "bottom",
|
|
23020
|
+
teleported: _ctx.teleported
|
|
23021
|
+
}, {
|
|
23022
|
+
default: vue.withCtx(() => [
|
|
23023
|
+
vue.createElementVNode("div", {
|
|
23024
|
+
ref: "collapseItemRef",
|
|
23025
|
+
class: vue.normalizeClass(_ctx.nsSelect.e("selected-item"))
|
|
23026
|
+
}, [
|
|
23027
|
+
vue.createVNode(_component_el_tag, {
|
|
23028
|
+
closable: false,
|
|
23029
|
+
size: _ctx.collapseTagSize,
|
|
23030
|
+
type: _ctx.tagType,
|
|
23031
|
+
effect: _ctx.tagEffect,
|
|
23032
|
+
style: vue.normalizeStyle(_ctx.collapseTagStyle),
|
|
23033
|
+
"disable-transitions": ""
|
|
23034
|
+
}, {
|
|
23035
|
+
default: vue.withCtx(() => [
|
|
23036
|
+
vue.createElementVNode("span", {
|
|
23037
|
+
class: vue.normalizeClass(_ctx.nsSelect.e("tags-text"))
|
|
23038
|
+
}, " + " + vue.toDisplayString(_ctx.modelValue.length - _ctx.maxCollapseTags), 3)
|
|
23039
|
+
]),
|
|
23040
|
+
_: 1
|
|
23041
|
+
}, 8, ["size", "type", "effect", "style"])
|
|
23042
|
+
], 2)
|
|
23043
|
+
]),
|
|
23044
|
+
content: vue.withCtx(() => [
|
|
23045
|
+
vue.createElementVNode("div", {
|
|
23046
|
+
ref: "tagMenuRef",
|
|
23047
|
+
class: vue.normalizeClass(_ctx.nsSelect.e("selection"))
|
|
23048
|
+
}, [
|
|
23049
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.collapseTagList, (selected) => {
|
|
23050
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
23051
|
+
key: _ctx.getValueKey(_ctx.getValue(selected)),
|
|
23052
|
+
class: vue.normalizeClass(_ctx.nsSelect.e("selected-item"))
|
|
23053
|
+
}, [
|
|
23054
|
+
vue.createVNode(_component_el_tag, {
|
|
23055
|
+
class: "in-tooltip",
|
|
23056
|
+
closable: !_ctx.selectDisabled && !_ctx.getDisabled(selected),
|
|
23057
|
+
size: _ctx.collapseTagSize,
|
|
23058
|
+
type: _ctx.tagType,
|
|
23059
|
+
effect: _ctx.tagEffect,
|
|
23060
|
+
"disable-transitions": "",
|
|
23061
|
+
onClose: ($event) => _ctx.deleteTag($event, selected)
|
|
23062
|
+
}, {
|
|
23063
|
+
default: vue.withCtx(() => [
|
|
23064
|
+
vue.createElementVNode("span", {
|
|
23065
|
+
class: vue.normalizeClass(_ctx.nsSelect.e("tags-text"))
|
|
23066
|
+
}, [
|
|
23067
|
+
vue.renderSlot(_ctx.$slots, "label", {
|
|
23068
|
+
label: _ctx.getLabel(selected),
|
|
23069
|
+
value: _ctx.getValue(selected)
|
|
23070
|
+
}, () => [
|
|
23071
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.getLabel(selected)), 1)
|
|
23072
|
+
])
|
|
23073
|
+
], 2)
|
|
23074
|
+
]),
|
|
23075
|
+
_: 2
|
|
23076
|
+
}, 1032, ["closable", "size", "type", "effect", "onClose"])
|
|
23077
|
+
], 2);
|
|
23078
|
+
}), 128))
|
|
23079
|
+
], 2)
|
|
23080
|
+
]),
|
|
23081
|
+
_: 3
|
|
23082
|
+
}, 8, ["disabled", "effect", "teleported"])) : vue.createCommentVNode("v-if", true)
|
|
23083
|
+
]) : vue.createCommentVNode("v-if", true),
|
|
23084
|
+
vue.createElementVNode("div", {
|
|
23085
|
+
class: vue.normalizeClass([
|
|
23086
|
+
_ctx.nsSelect.e("selected-item"),
|
|
23087
|
+
_ctx.nsSelect.e("input-wrapper"),
|
|
23088
|
+
_ctx.nsSelect.is("hidden", !_ctx.filterable)
|
|
23089
|
+
])
|
|
23090
|
+
}, [
|
|
23091
|
+
vue.withDirectives(vue.createElementVNode("input", {
|
|
23092
|
+
id: _ctx.inputId,
|
|
23093
|
+
ref: "inputRef",
|
|
23094
|
+
"onUpdate:modelValue": ($event) => _ctx.states.inputValue = $event,
|
|
23095
|
+
style: vue.normalizeStyle(_ctx.inputStyle),
|
|
23096
|
+
autocomplete: _ctx.autocomplete,
|
|
23097
|
+
tabindex: _ctx.tabindex,
|
|
23098
|
+
"aria-autocomplete": "list",
|
|
23099
|
+
"aria-haspopup": "listbox",
|
|
23100
|
+
autocapitalize: "off",
|
|
23101
|
+
"aria-expanded": _ctx.expanded,
|
|
23102
|
+
"aria-label": _ctx.ariaLabel,
|
|
23103
|
+
class: vue.normalizeClass([_ctx.nsSelect.e("input"), _ctx.nsSelect.is(_ctx.selectSize)]),
|
|
23104
|
+
disabled: _ctx.selectDisabled,
|
|
23105
|
+
role: "combobox",
|
|
23106
|
+
readonly: !_ctx.filterable,
|
|
23107
|
+
spellcheck: "false",
|
|
23108
|
+
type: "text",
|
|
23109
|
+
name: _ctx.name,
|
|
23110
|
+
onInput: _ctx.onInput,
|
|
23111
|
+
onCompositionstart: _ctx.handleCompositionStart,
|
|
23112
|
+
onCompositionupdate: _ctx.handleCompositionUpdate,
|
|
23113
|
+
onCompositionend: _ctx.handleCompositionEnd,
|
|
23114
|
+
onKeydown: [
|
|
23115
|
+
vue.withKeys(vue.withModifiers(($event) => _ctx.onKeyboardNavigate("backward"), ["stop", "prevent"]), ["up"]),
|
|
23116
|
+
vue.withKeys(vue.withModifiers(($event) => _ctx.onKeyboardNavigate("forward"), ["stop", "prevent"]), ["down"]),
|
|
23117
|
+
vue.withKeys(vue.withModifiers(_ctx.onKeyboardSelect, ["stop", "prevent"]), ["enter"]),
|
|
23118
|
+
vue.withKeys(vue.withModifiers(_ctx.handleEsc, ["stop", "prevent"]), ["esc"]),
|
|
23119
|
+
vue.withKeys(vue.withModifiers(_ctx.handleDel, ["stop"]), ["delete"])
|
|
23120
|
+
],
|
|
23121
|
+
onClick: vue.withModifiers(_ctx.toggleMenu, ["stop"])
|
|
23122
|
+
}, null, 46, ["id", "onUpdate:modelValue", "autocomplete", "tabindex", "aria-expanded", "aria-label", "disabled", "readonly", "name", "onInput", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onKeydown", "onClick"]), [
|
|
23123
|
+
[vue.vModelText, _ctx.states.inputValue]
|
|
23124
|
+
]),
|
|
23125
|
+
_ctx.filterable ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
23126
|
+
key: 0,
|
|
23127
|
+
ref: "calculatorRef",
|
|
23128
|
+
"aria-hidden": "true",
|
|
23129
|
+
class: vue.normalizeClass(_ctx.nsSelect.e("input-calculator")),
|
|
23130
|
+
textContent: vue.toDisplayString(_ctx.states.inputValue)
|
|
23131
|
+
}, null, 10, ["textContent"])) : vue.createCommentVNode("v-if", true)
|
|
23132
|
+
], 2),
|
|
23133
|
+
_ctx.shouldShowPlaceholder ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
23134
|
+
key: 1,
|
|
23135
|
+
class: vue.normalizeClass([
|
|
23136
|
+
_ctx.nsSelect.e("selected-item"),
|
|
23137
|
+
_ctx.nsSelect.e("placeholder"),
|
|
23138
|
+
_ctx.nsSelect.is("transparent", !_ctx.hasModelValue || _ctx.expanded && !_ctx.states.inputValue)
|
|
23139
|
+
])
|
|
23140
|
+
}, [
|
|
23141
|
+
_ctx.hasModelValue ? vue.renderSlot(_ctx.$slots, "label", {
|
|
23142
|
+
key: 0,
|
|
23143
|
+
label: _ctx.currentPlaceholder,
|
|
23144
|
+
value: _ctx.modelValue
|
|
23145
|
+
}, () => [
|
|
23146
|
+
vue.createElementVNode("span", null, vue.toDisplayString(_ctx.currentPlaceholder), 1)
|
|
23147
|
+
]) : (vue.openBlock(), vue.createElementBlock("span", { key: 1 }, vue.toDisplayString(_ctx.currentPlaceholder), 1))
|
|
23148
|
+
], 2)) : vue.createCommentVNode("v-if", true)
|
|
23149
|
+
], 2),
|
|
23150
|
+
vue.createElementVNode("div", {
|
|
23151
|
+
ref: "suffixRef",
|
|
23152
|
+
class: vue.normalizeClass(_ctx.nsSelect.e("suffix"))
|
|
23153
|
+
}, [
|
|
23154
|
+
_ctx.iconComponent ? vue.withDirectives((vue.openBlock(), vue.createBlock(_component_el_icon, {
|
|
23155
|
+
key: 0,
|
|
23156
|
+
class: vue.normalizeClass([_ctx.nsSelect.e("caret"), _ctx.nsInput.e("icon"), _ctx.iconReverse])
|
|
23157
|
+
}, {
|
|
23158
|
+
default: vue.withCtx(() => [
|
|
23159
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.iconComponent)))
|
|
23160
|
+
]),
|
|
23161
|
+
_: 1
|
|
23162
|
+
}, 8, ["class"])), [
|
|
23163
|
+
[vue.vShow, !_ctx.showClearBtn]
|
|
23164
|
+
]) : vue.createCommentVNode("v-if", true),
|
|
23165
|
+
_ctx.showClearBtn && _ctx.clearIcon ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
|
|
23166
|
+
key: 1,
|
|
23167
|
+
class: vue.normalizeClass([
|
|
23168
|
+
_ctx.nsSelect.e("caret"),
|
|
23169
|
+
_ctx.nsInput.e("icon"),
|
|
23170
|
+
_ctx.nsSelect.e("clear")
|
|
23171
|
+
]),
|
|
23172
|
+
onClick: vue.withModifiers(_ctx.handleClear, ["prevent", "stop"])
|
|
23173
|
+
}, {
|
|
23174
|
+
default: vue.withCtx(() => [
|
|
23175
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.clearIcon)))
|
|
23176
|
+
]),
|
|
23177
|
+
_: 1
|
|
23178
|
+
}, 8, ["class", "onClick"])) : vue.createCommentVNode("v-if", true),
|
|
23179
|
+
_ctx.validateState && _ctx.validateIcon && _ctx.needStatusIcon ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
|
|
23180
|
+
key: 2,
|
|
23181
|
+
class: vue.normalizeClass([
|
|
23182
|
+
_ctx.nsInput.e("icon"),
|
|
23183
|
+
_ctx.nsInput.e("validateIcon"),
|
|
23184
|
+
_ctx.nsInput.is("loading", _ctx.validateState === "validating")
|
|
23185
|
+
])
|
|
23186
|
+
}, {
|
|
23187
|
+
default: vue.withCtx(() => [
|
|
23188
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.validateIcon)))
|
|
23189
|
+
]),
|
|
23190
|
+
_: 1
|
|
23191
|
+
}, 8, ["class"])) : vue.createCommentVNode("v-if", true)
|
|
23192
|
+
], 2)
|
|
23193
|
+
], 10, ["onClick"])
|
|
23194
|
+
]),
|
|
23195
|
+
content: vue.withCtx(() => [
|
|
23196
|
+
vue.createVNode(_component_el_select_menu, {
|
|
23197
|
+
ref: "menuRef",
|
|
23198
|
+
data: _ctx.filteredOptions,
|
|
23199
|
+
width: _ctx.popperSize,
|
|
23200
|
+
"hovering-index": _ctx.states.hoveringIndex,
|
|
23201
|
+
"scrollbar-always-on": _ctx.scrollbarAlwaysOn
|
|
23202
|
+
}, vue.createSlots({
|
|
23203
|
+
default: vue.withCtx((scope) => [
|
|
23204
|
+
vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps(scope)))
|
|
23205
|
+
]),
|
|
23206
|
+
_: 2
|
|
23207
|
+
}, [
|
|
23208
|
+
_ctx.$slots.header ? {
|
|
23209
|
+
name: "header",
|
|
23210
|
+
fn: vue.withCtx(() => [
|
|
23211
|
+
vue.createElementVNode("div", {
|
|
23212
|
+
class: vue.normalizeClass(_ctx.nsSelect.be("dropdown", "header"))
|
|
23213
|
+
}, [
|
|
23214
|
+
vue.renderSlot(_ctx.$slots, "header")
|
|
23215
|
+
], 2)
|
|
23216
|
+
])
|
|
23217
|
+
} : void 0,
|
|
23218
|
+
_ctx.$slots.loading && _ctx.loading ? {
|
|
23219
|
+
name: "loading",
|
|
23220
|
+
fn: vue.withCtx(() => [
|
|
23221
|
+
vue.createElementVNode("div", {
|
|
23222
|
+
class: vue.normalizeClass(_ctx.nsSelect.be("dropdown", "loading"))
|
|
23223
|
+
}, [
|
|
23224
|
+
vue.renderSlot(_ctx.$slots, "loading")
|
|
23225
|
+
], 2)
|
|
23226
|
+
])
|
|
23227
|
+
} : _ctx.loading || _ctx.filteredOptions.length === 0 ? {
|
|
23228
|
+
name: "empty",
|
|
23229
|
+
fn: vue.withCtx(() => [
|
|
23230
|
+
vue.createElementVNode("div", {
|
|
23231
|
+
class: vue.normalizeClass(_ctx.nsSelect.be("dropdown", "empty"))
|
|
23232
|
+
}, [
|
|
23233
|
+
vue.renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
23234
|
+
vue.createElementVNode("span", null, vue.toDisplayString(_ctx.emptyText), 1)
|
|
23235
|
+
])
|
|
23236
|
+
], 2)
|
|
23237
|
+
])
|
|
23238
|
+
} : void 0,
|
|
23239
|
+
_ctx.$slots.footer ? {
|
|
23240
|
+
name: "footer",
|
|
23241
|
+
fn: vue.withCtx(() => [
|
|
23242
|
+
vue.createElementVNode("div", {
|
|
23243
|
+
class: vue.normalizeClass(_ctx.nsSelect.be("dropdown", "footer"))
|
|
23244
|
+
}, [
|
|
23245
|
+
vue.renderSlot(_ctx.$slots, "footer")
|
|
23246
|
+
], 2)
|
|
23247
|
+
])
|
|
23248
|
+
} : void 0
|
|
23249
|
+
]), 1032, ["data", "width", "hovering-index", "scrollbar-always-on"])
|
|
23250
|
+
]),
|
|
23251
|
+
_: 3
|
|
23252
|
+
}, 8, ["visible", "teleported", "popper-class", "popper-options", "fallback-placements", "effect", "placement", "transition", "persistent", "append-to", "show-arrow", "offset", "onBeforeShow", "onHide"])
|
|
23253
|
+
], 42, ["onMouseenter", "onMouseleave"])), [
|
|
23254
|
+
[_directive_click_outside, _ctx.handleClickOutside, _ctx.popperRef]
|
|
23255
|
+
]);
|
|
23256
|
+
}
|
|
23257
|
+
var Select = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render], ["__file", "select.vue"]]);
|
|
23258
|
+
|
|
23259
|
+
const ElSelectV2 = withInstall(Select);
|
|
23260
|
+
|
|
23261
|
+
const _hoisted_1$a = ["onClick"];
|
|
23262
|
+
const _hoisted_2$9 = { class: "hzzt-dropdown-name" };
|
|
23263
|
+
const _hoisted_3$6 = /* @__PURE__ */ vue.createElementVNode("span", { class: "caret" }, null, -1);
|
|
23264
|
+
const _hoisted_4$5 = { class: "hzzt-dropdown-menu" };
|
|
23265
|
+
const _hoisted_5$3 = ["onClick"];
|
|
23266
|
+
const _hoisted_6$3 = { class: "submenu" };
|
|
23267
|
+
const _hoisted_7$3 = ["onClick"];
|
|
23268
|
+
const __default__$b = vue.defineComponent({
|
|
23269
|
+
name: "HzztDropDown"
|
|
23270
|
+
});
|
|
23271
|
+
const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
23272
|
+
...__default__$b,
|
|
23273
|
+
props: {
|
|
23274
|
+
options: {
|
|
23275
|
+
type: definePropType$1(Array),
|
|
23276
|
+
default: () => []
|
|
23277
|
+
},
|
|
23278
|
+
label: String,
|
|
23279
|
+
value: String,
|
|
23280
|
+
defaultValue: {
|
|
23281
|
+
type: Array,
|
|
23282
|
+
default: () => []
|
|
23283
|
+
},
|
|
23284
|
+
position: {
|
|
23285
|
+
type: String,
|
|
23286
|
+
default: "right"
|
|
23287
|
+
},
|
|
23288
|
+
props: {
|
|
23289
|
+
type: Object,
|
|
23290
|
+
default: () => ({
|
|
23291
|
+
children: "children",
|
|
23292
|
+
label: "label",
|
|
23293
|
+
value: "value"
|
|
23294
|
+
})
|
|
23295
|
+
},
|
|
23296
|
+
returnType: {
|
|
23297
|
+
type: String,
|
|
23298
|
+
default: "Array"
|
|
23299
|
+
}
|
|
23300
|
+
},
|
|
23301
|
+
emits: ["change"],
|
|
23302
|
+
setup(__props, { emit: emits }) {
|
|
23303
|
+
const dProps = __props;
|
|
23304
|
+
const toggle = vue.ref(false);
|
|
23305
|
+
function dropToggle() {
|
|
23306
|
+
toggle.value = !toggle.value;
|
|
23307
|
+
}
|
|
23308
|
+
function close() {
|
|
23309
|
+
toggle.value = false;
|
|
23310
|
+
}
|
|
23311
|
+
function selectValue(val) {
|
|
23312
|
+
if (dProps.returnType === "Array") {
|
|
23313
|
+
emits("change", val);
|
|
23314
|
+
}
|
|
23315
|
+
if (dProps.returnType === "String") {
|
|
23316
|
+
emits("change", val[val.length - 1]);
|
|
23317
|
+
}
|
|
23318
|
+
}
|
|
23319
|
+
return (_ctx, _cache) => {
|
|
23320
|
+
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("ul", {
|
|
23321
|
+
class: "hzzt-dropdown",
|
|
23322
|
+
onClick: vue.withModifiers(dropToggle, ["stop"])
|
|
23323
|
+
}, [
|
|
23324
|
+
vue.createElementVNode("li", {
|
|
23325
|
+
class: vue.normalizeClass({ "hzzt-dropdown-li": true, "hzzt-dropdown-li-show": toggle.value })
|
|
23326
|
+
}, [
|
|
23327
|
+
vue.createElementVNode("span", _hoisted_2$9, vue.toDisplayString(__props.label), 1),
|
|
23328
|
+
_hoisted_3$6,
|
|
23329
|
+
vue.createElementVNode("ul", _hoisted_4$5, [
|
|
23330
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.options, (option, index) => {
|
|
23331
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
23332
|
+
vue.unref(isEmpty)(option[__props.props.children]) ? (vue.openBlock(), vue.createElementBlock("li", {
|
|
23333
|
+
key: index,
|
|
23334
|
+
class: vue.normalizeClass({
|
|
23335
|
+
"hzzt-dropdown-menu-item": true,
|
|
23336
|
+
selected: __props.defaultValue.includes(option[__props.props.value])
|
|
23337
|
+
})
|
|
23338
|
+
}, [
|
|
23339
|
+
vue.createElementVNode("a", {
|
|
23340
|
+
class: "hzzt-dropdown-menu-item-label",
|
|
23341
|
+
onClick: ($event) => selectValue([option[__props.props.value]])
|
|
23342
|
+
}, vue.toDisplayString(option[__props.props.label]), 9, _hoisted_5$3)
|
|
23343
|
+
], 2)) : (vue.openBlock(), vue.createElementBlock("li", {
|
|
23344
|
+
key: index + "submenu",
|
|
23345
|
+
class: "hzzt-dropdown-menu-item hzzt-dropdown-submenu"
|
|
23346
|
+
}, [
|
|
23347
|
+
vue.createElementVNode("a", _hoisted_6$3, vue.toDisplayString(option[__props.props.label]), 1),
|
|
23348
|
+
vue.createElementVNode("ul", {
|
|
23349
|
+
class: vue.normalizeClass([["pull-" + __props.position], "hzzt-dropdown-menu"])
|
|
23350
|
+
}, [
|
|
23351
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(option.children, (child, cIndex) => {
|
|
23352
|
+
return vue.openBlock(), vue.createElementBlock("li", {
|
|
23353
|
+
key: cIndex,
|
|
23354
|
+
class: vue.normalizeClass({
|
|
23355
|
+
"hzzt-dropdown-menu-item": true,
|
|
23356
|
+
selected: __props.defaultValue.includes(child[__props.props.value])
|
|
23357
|
+
})
|
|
23358
|
+
}, [
|
|
23359
|
+
vue.createElementVNode("a", {
|
|
23360
|
+
class: "hzzt-dropdown-menu-item-label",
|
|
23361
|
+
onClick: ($event) => selectValue([option[__props.props.value], child[__props.props.value]])
|
|
23362
|
+
}, vue.toDisplayString(child[__props.props.label]), 9, _hoisted_7$3)
|
|
23363
|
+
], 2);
|
|
23364
|
+
}), 128))
|
|
23365
|
+
], 2)
|
|
23366
|
+
])),
|
|
23367
|
+
option.divider ? (vue.openBlock(), vue.createElementBlock("li", {
|
|
23368
|
+
key: index + "divider",
|
|
23369
|
+
class: "divider"
|
|
23370
|
+
})) : vue.createCommentVNode("v-if", true)
|
|
23371
|
+
], 64);
|
|
23372
|
+
}), 256))
|
|
23373
|
+
])
|
|
23374
|
+
], 2)
|
|
23375
|
+
], 8, _hoisted_1$a)), [
|
|
23376
|
+
[vue.unref(ClickOutside), close]
|
|
23377
|
+
]);
|
|
23378
|
+
};
|
|
23379
|
+
}
|
|
23380
|
+
});
|
|
23381
|
+
var Dropdown = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["__file", "index.vue"]]);
|
|
23382
|
+
|
|
23383
|
+
const HzztDropdown = withInstall$1(Dropdown);
|
|
23384
|
+
|
|
23385
|
+
const _hoisted_1$9 = { class: "hzzt-collapse" };
|
|
23386
|
+
const _hoisted_2$8 = { class: "flex align-items-center" };
|
|
23387
|
+
const _hoisted_3$5 = { class: "hzzt-collapse-title-wrapper" };
|
|
23388
|
+
const _hoisted_4$4 = /* @__PURE__ */ vue.createElementVNode("div", { class: "hzzt-collapse-title-block" }, null, -1);
|
|
23389
|
+
const _hoisted_5$2 = { class: "hzzt-collapse-title" };
|
|
23390
|
+
const _hoisted_6$2 = /* @__PURE__ */ vue.createElementVNode("div", { class: "hzzt-collapse-line" }, null, -1);
|
|
23391
|
+
const _hoisted_7$2 = {
|
|
23392
|
+
key: 0,
|
|
23393
|
+
class: "hzzt-collapse-text"
|
|
23394
|
+
};
|
|
23395
|
+
const __default__$a = vue.defineComponent({
|
|
23396
|
+
name: "HzztCollapse"
|
|
23397
|
+
});
|
|
23398
|
+
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
23399
|
+
...__default__$a,
|
|
23400
|
+
props: {
|
|
23401
|
+
defaultActive: {
|
|
23402
|
+
type: Boolean,
|
|
23403
|
+
default: false
|
|
23404
|
+
},
|
|
23405
|
+
title: {
|
|
23406
|
+
type: String,
|
|
20684
23407
|
default: ""
|
|
20685
23408
|
},
|
|
20686
23409
|
expand: {
|
|
@@ -20705,7 +23428,7 @@
|
|
|
20705
23428
|
onClick: toggle
|
|
20706
23429
|
}, [
|
|
20707
23430
|
vue.createElementVNode("div", _hoisted_2$8, [
|
|
20708
|
-
vue.createElementVNode("div", _hoisted_3$
|
|
23431
|
+
vue.createElementVNode("div", _hoisted_3$5, [
|
|
20709
23432
|
_hoisted_4$4,
|
|
20710
23433
|
vue.createElementVNode("div", _hoisted_5$2, vue.toDisplayString(__props.title), 1)
|
|
20711
23434
|
]),
|
|
@@ -20719,7 +23442,7 @@
|
|
|
20719
23442
|
};
|
|
20720
23443
|
}
|
|
20721
23444
|
});
|
|
20722
|
-
var Collapse = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__file", "collapse.vue"]]);
|
|
23445
|
+
var Collapse = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["__file", "collapse.vue"]]);
|
|
20723
23446
|
|
|
20724
23447
|
const HzztCollapse = withInstall$1(Collapse);
|
|
20725
23448
|
|
|
@@ -20749,11 +23472,11 @@
|
|
|
20749
23472
|
};
|
|
20750
23473
|
}
|
|
20751
23474
|
});
|
|
20752
|
-
var HzztIcon$1 = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__file", "index.vue"]]);
|
|
23475
|
+
var HzztIcon$1 = /* @__PURE__ */ _export_sfc$1(_sfc_main$a, [["__file", "index.vue"]]);
|
|
20753
23476
|
|
|
20754
23477
|
const _hoisted_1$8 = { class: "hzzt-tab flex align-items-center justify-content-between wrap" };
|
|
20755
23478
|
const _hoisted_2$7 = { class: "flex align-items-center" };
|
|
20756
|
-
const _hoisted_3$
|
|
23479
|
+
const _hoisted_3$4 = { class: "flex" };
|
|
20757
23480
|
const _hoisted_4$3 = ["onClick"];
|
|
20758
23481
|
const _hoisted_5$1 = { class: "hzzt-tab-badge" };
|
|
20759
23482
|
const _hoisted_6$1 = {
|
|
@@ -20804,7 +23527,7 @@
|
|
|
20804
23527
|
return (_ctx, _cache) => {
|
|
20805
23528
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
|
|
20806
23529
|
vue.createElementVNode("div", _hoisted_2$7, [
|
|
20807
|
-
vue.createElementVNode("div", _hoisted_3$
|
|
23530
|
+
vue.createElementVNode("div", _hoisted_3$4, [
|
|
20808
23531
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(customTabList), (tab, index) => {
|
|
20809
23532
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
20810
23533
|
key: tab.key,
|
|
@@ -20836,7 +23559,7 @@
|
|
|
20836
23559
|
};
|
|
20837
23560
|
}
|
|
20838
23561
|
});
|
|
20839
|
-
var Tab = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__file", "index.vue"]]);
|
|
23562
|
+
var Tab = /* @__PURE__ */ _export_sfc$1(_sfc_main$9, [["__file", "index.vue"]]);
|
|
20840
23563
|
|
|
20841
23564
|
const HzztTab = withInstall$1(Tab);
|
|
20842
23565
|
|
|
@@ -20854,7 +23577,7 @@
|
|
|
20854
23577
|
|
|
20855
23578
|
const _hoisted_1$7 = { class: "flex justify-content-between hzzt-pagination" };
|
|
20856
23579
|
const _hoisted_2$6 = { class: "flex align-items-center font-12 hzzt-pagination-total" };
|
|
20857
|
-
const _hoisted_3$
|
|
23580
|
+
const _hoisted_3$3 = { class: "flex align-items-center hzzt-pagination-page font-14" };
|
|
20858
23581
|
const _hoisted_4$2 = { class: "flex" };
|
|
20859
23582
|
const __default__$8 = vue.defineComponent({
|
|
20860
23583
|
name: "HzztPagination"
|
|
@@ -20892,7 +23615,7 @@
|
|
|
20892
23615
|
return (_ctx, _cache) => {
|
|
20893
23616
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [
|
|
20894
23617
|
vue.createElementVNode("p", _hoisted_2$6, vue.toDisplayString(vue.unref(t)("hzzt.pagination.total")) + vue.toDisplayString(__props.pagination.total) + vue.toDisplayString(vue.unref(t)("hzzt.pagination.strip")), 1),
|
|
20895
|
-
vue.createElementVNode("div", _hoisted_3$
|
|
23618
|
+
vue.createElementVNode("div", _hoisted_3$3, [
|
|
20896
23619
|
vue.renderSlot(_ctx.$slots, "right"),
|
|
20897
23620
|
vue.createVNode(HzztIcon$1, {
|
|
20898
23621
|
class: vue.normalizeClass(["hzzt-pagination-arrow", { active: __props.pagination.current_page > 1 }]),
|
|
@@ -20910,13 +23633,13 @@
|
|
|
20910
23633
|
};
|
|
20911
23634
|
}
|
|
20912
23635
|
});
|
|
20913
|
-
var Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__file", "index.vue"]]);
|
|
23636
|
+
var Pagination = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["__file", "index.vue"]]);
|
|
20914
23637
|
|
|
20915
23638
|
const HzztPagination = withInstall$1(Pagination);
|
|
20916
23639
|
|
|
20917
23640
|
const _hoisted_1$6 = { class: "flex align-content-center" };
|
|
20918
23641
|
const _hoisted_2$5 = { style: { "max-width": "300px" } };
|
|
20919
|
-
const _hoisted_3$
|
|
23642
|
+
const _hoisted_3$2 = { style: { "padding": "0", "margin": "0", "word-break": "break-all", "white-space": "pre-wrap" } };
|
|
20920
23643
|
const __default__$7 = vue.defineComponent({
|
|
20921
23644
|
name: "HzztTooltip"
|
|
20922
23645
|
});
|
|
@@ -20937,7 +23660,7 @@
|
|
|
20937
23660
|
content: vue.withCtx(() => [
|
|
20938
23661
|
vue.renderSlot(_ctx.$slots, "content", {}, () => [
|
|
20939
23662
|
vue.createElementVNode("div", _hoisted_2$5, [
|
|
20940
|
-
vue.createElementVNode("pre", _hoisted_3$
|
|
23663
|
+
vue.createElementVNode("pre", _hoisted_3$2, vue.toDisplayString(__props.content), 1)
|
|
20941
23664
|
])
|
|
20942
23665
|
])
|
|
20943
23666
|
]),
|
|
@@ -20955,7 +23678,7 @@
|
|
|
20955
23678
|
};
|
|
20956
23679
|
}
|
|
20957
23680
|
});
|
|
20958
|
-
var Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__file", "tooltip.vue"]]);
|
|
23681
|
+
var Tooltip = /* @__PURE__ */ _export_sfc$1(_sfc_main$7, [["__file", "tooltip.vue"]]);
|
|
20959
23682
|
|
|
20960
23683
|
const HzztTooltip = withInstall$1(Tooltip);
|
|
20961
23684
|
|
|
@@ -20967,7 +23690,7 @@
|
|
|
20967
23690
|
key: 1,
|
|
20968
23691
|
style: { "white-space": "nowrap" }
|
|
20969
23692
|
};
|
|
20970
|
-
const _hoisted_3$
|
|
23693
|
+
const _hoisted_3$1 = { class: "line-height-1" };
|
|
20971
23694
|
const _hoisted_4$1 = {
|
|
20972
23695
|
key: 0,
|
|
20973
23696
|
class: "margin-l-1 margin-r-2"
|
|
@@ -21039,7 +23762,7 @@
|
|
|
21039
23762
|
key: 2,
|
|
21040
23763
|
class: vue.normalizeClass([vue.unref(ns).e("option"), "flex align-items-center"])
|
|
21041
23764
|
}, [
|
|
21042
|
-
vue.createElementVNode("span", _hoisted_3$
|
|
23765
|
+
vue.createElementVNode("span", _hoisted_3$1, vue.toDisplayString(vue.unref(t)("hzzt.pageSize.per_page")), 1),
|
|
21043
23766
|
vue.createVNode(vue.unref(ElSelect), {
|
|
21044
23767
|
modelValue: sizeValue.value,
|
|
21045
23768
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => sizeValue.value = $event),
|
|
@@ -21103,7 +23826,7 @@
|
|
|
21103
23826
|
};
|
|
21104
23827
|
}
|
|
21105
23828
|
});
|
|
21106
|
-
var PageSize = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__file", "index.vue"]]);
|
|
23829
|
+
var PageSize = /* @__PURE__ */ _export_sfc$1(_sfc_main$6, [["__file", "index.vue"]]);
|
|
21107
23830
|
|
|
21108
23831
|
const HzztPageSize = withInstall$1(PageSize);
|
|
21109
23832
|
|
|
@@ -21171,7 +23894,7 @@
|
|
|
21171
23894
|
};
|
|
21172
23895
|
}
|
|
21173
23896
|
});
|
|
21174
|
-
var ConfirmPassword = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__file", "confirm-password.vue"]]);
|
|
23897
|
+
var ConfirmPassword = /* @__PURE__ */ _export_sfc$1(_sfc_main$5, [["__file", "confirm-password.vue"]]);
|
|
21175
23898
|
|
|
21176
23899
|
const HzztConfirmPassword = withInstall$1(ConfirmPassword);
|
|
21177
23900
|
|
|
@@ -21250,7 +23973,7 @@
|
|
|
21250
23973
|
};
|
|
21251
23974
|
}
|
|
21252
23975
|
});
|
|
21253
|
-
var CheckButton = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "index.vue"]]);
|
|
23976
|
+
var CheckButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$4, [["__file", "index.vue"]]);
|
|
21254
23977
|
|
|
21255
23978
|
const HzztCheckButton = withInstall$1(CheckButton);
|
|
21256
23979
|
|
|
@@ -21493,7 +24216,7 @@
|
|
|
21493
24216
|
|
|
21494
24217
|
const _hoisted_1$3 = { class: "el-date-picker" };
|
|
21495
24218
|
const _hoisted_2$3 = { class: "el-picker-panel__body" };
|
|
21496
|
-
const _hoisted_3
|
|
24219
|
+
const _hoisted_3 = {
|
|
21497
24220
|
class: "el-date-picker__header el-date-picker__header--bordered",
|
|
21498
24221
|
style: { "margin": "0px", "line-height": "30px" }
|
|
21499
24222
|
};
|
|
@@ -21692,7 +24415,7 @@
|
|
|
21692
24415
|
default: vue.withCtx(() => [
|
|
21693
24416
|
vue.createElementVNode("div", _hoisted_1$3, [
|
|
21694
24417
|
vue.createElementVNode("div", _hoisted_2$3, [
|
|
21695
|
-
vue.createElementVNode("div", _hoisted_3
|
|
24418
|
+
vue.createElementVNode("div", _hoisted_3, [
|
|
21696
24419
|
vue.createElementVNode("button", {
|
|
21697
24420
|
type: "button",
|
|
21698
24421
|
"aria-label": vue.unref(t)(`hzzt.quarterpicker.prevYear`),
|
|
@@ -21752,7 +24475,7 @@
|
|
|
21752
24475
|
};
|
|
21753
24476
|
}
|
|
21754
24477
|
});
|
|
21755
|
-
var QuarterPicker = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "index.vue"]]);
|
|
24478
|
+
var QuarterPicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$3, [["__file", "index.vue"]]);
|
|
21756
24479
|
|
|
21757
24480
|
const HzztQuarterPicker = withInstall$1(QuarterPicker);
|
|
21758
24481
|
|
|
@@ -21916,7 +24639,7 @@
|
|
|
21916
24639
|
};
|
|
21917
24640
|
}
|
|
21918
24641
|
});
|
|
21919
|
-
var Scan = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "scan.vue"]]);
|
|
24642
|
+
var Scan = /* @__PURE__ */ _export_sfc$1(_sfc_main$2, [["__file", "scan.vue"]]);
|
|
21920
24643
|
|
|
21921
24644
|
const HzztScan = withInstall$1(Scan);
|
|
21922
24645
|
|
|
@@ -22037,7 +24760,7 @@
|
|
|
22037
24760
|
class: vue.normalizeClass(vue.unref(inputContainerCls))
|
|
22038
24761
|
}, [
|
|
22039
24762
|
vue.renderSlot(_ctx.$slots, "title", {}, () => [
|
|
22040
|
-
vue.createVNode(
|
|
24763
|
+
vue.createVNode(HzztTitle$1, { label: _ctx.label }, null, 8, ["label"])
|
|
22041
24764
|
]),
|
|
22042
24765
|
vue.createVNode(vue.unref(ElInput), vue.mergeProps({
|
|
22043
24766
|
ref: "inputRef",
|
|
@@ -22075,56 +24798,129 @@
|
|
|
22075
24798
|
};
|
|
22076
24799
|
}
|
|
22077
24800
|
});
|
|
22078
|
-
var SelectInput = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "select-input.vue"]]);
|
|
24801
|
+
var SelectInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$1, [["__file", "select-input.vue"]]);
|
|
22079
24802
|
|
|
22080
24803
|
const HzztSelectInput = withInstall$1(SelectInput);
|
|
22081
24804
|
|
|
22082
|
-
const
|
|
22083
|
-
|
|
22084
|
-
|
|
22085
|
-
|
|
22086
|
-
|
|
22087
|
-
|
|
22088
|
-
|
|
24805
|
+
const selectTextareaProps = buildProps$1({
|
|
24806
|
+
size: useSizeProp$1,
|
|
24807
|
+
disabled: Boolean,
|
|
24808
|
+
label: String,
|
|
24809
|
+
data: {
|
|
24810
|
+
type: definePropType$1(Array),
|
|
24811
|
+
default: () => []
|
|
24812
|
+
},
|
|
24813
|
+
inputProps: Object,
|
|
24814
|
+
replace: Boolean,
|
|
24815
|
+
modelValue: {
|
|
24816
|
+
type: definePropType$1([
|
|
24817
|
+
String,
|
|
24818
|
+
Number
|
|
24819
|
+
]),
|
|
24820
|
+
default: ""
|
|
24821
|
+
}
|
|
24822
|
+
});
|
|
24823
|
+
const selectTextareaEmits = {
|
|
24824
|
+
[UPDATE_MODEL_EVENT$1]: (value) => isString$1(value),
|
|
24825
|
+
input: (value) => isString$1(value),
|
|
24826
|
+
change: (value) => isString$1(value),
|
|
24827
|
+
select: (value) => isString$1(value)
|
|
22089
24828
|
};
|
|
22090
|
-
|
|
24829
|
+
|
|
24830
|
+
const _hoisted_1 = { class: "flex column" };
|
|
24831
|
+
const _hoisted_2 = { class: "flex align-items-center" };
|
|
22091
24832
|
const __default__ = vue.defineComponent({
|
|
22092
|
-
name: "
|
|
24833
|
+
name: "HzztSelectTextarea"
|
|
22093
24834
|
});
|
|
22094
24835
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
22095
24836
|
...__default__,
|
|
22096
|
-
props:
|
|
22097
|
-
|
|
24837
|
+
props: selectTextareaProps,
|
|
24838
|
+
emits: selectTextareaEmits,
|
|
24839
|
+
setup(__props, { emit }) {
|
|
22098
24840
|
const props = __props;
|
|
22099
|
-
const
|
|
22100
|
-
const
|
|
22101
|
-
|
|
22102
|
-
|
|
24841
|
+
const inputVal = vue.ref(props.modelValue);
|
|
24842
|
+
const selectValue = vue.ref("");
|
|
24843
|
+
const inputRef = vue.ref();
|
|
24844
|
+
const nsInput = useNamespace$1("select-textarea");
|
|
24845
|
+
const formSize = useFormSize();
|
|
24846
|
+
const formDisabled = useFormDisabled();
|
|
24847
|
+
const trueSize = vue.computed(() => props.size || formSize.value || useGlobalSize$1().value);
|
|
24848
|
+
const trueDisabled = vue.computed(() => props.disabled || formDisabled.value);
|
|
24849
|
+
const containerCls = vue.computed(() => [
|
|
24850
|
+
nsInput.b(),
|
|
24851
|
+
nsInput.m(trueSize.value)
|
|
24852
|
+
]);
|
|
24853
|
+
const _inputProps = vue.computed(() => ({
|
|
24854
|
+
disabled: trueDisabled.value,
|
|
24855
|
+
clearable: true,
|
|
24856
|
+
...props.inputProps,
|
|
24857
|
+
type: "textarea"
|
|
24858
|
+
}));
|
|
24859
|
+
vue.watch(() => props.modelValue, (v) => {
|
|
24860
|
+
inputVal.value = v;
|
|
22103
24861
|
});
|
|
24862
|
+
function input(val) {
|
|
24863
|
+
emit("update:modelValue", val);
|
|
24864
|
+
emit("input", val);
|
|
24865
|
+
}
|
|
24866
|
+
function change(val) {
|
|
24867
|
+
emit("change", val);
|
|
24868
|
+
}
|
|
24869
|
+
function selectChange(val) {
|
|
24870
|
+
if (!inputVal.value && inputVal.value !== 0)
|
|
24871
|
+
inputVal.value = "";
|
|
24872
|
+
let content = val;
|
|
24873
|
+
if (!props.replace) {
|
|
24874
|
+
const inputEl = inputRef.value.getElementsByTagName("textarea")[0];
|
|
24875
|
+
content = insertCursorPosition(inputEl, val);
|
|
24876
|
+
}
|
|
24877
|
+
input(content);
|
|
24878
|
+
change(content);
|
|
24879
|
+
emit("select", val);
|
|
24880
|
+
}
|
|
22104
24881
|
return (_ctx, _cache) => {
|
|
22105
|
-
return vue.
|
|
22106
|
-
|
|
22107
|
-
|
|
22108
|
-
vue.createElementVNode("
|
|
22109
|
-
vue.
|
|
22110
|
-
vue.
|
|
22111
|
-
|
|
24882
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
24883
|
+
class: vue.normalizeClass(vue.unref(containerCls))
|
|
24884
|
+
}, [
|
|
24885
|
+
vue.createElementVNode("div", _hoisted_1, [
|
|
24886
|
+
vue.createElementVNode("div", _hoisted_2, [
|
|
24887
|
+
vue.renderSlot(_ctx.$slots, "title", {}, () => [
|
|
24888
|
+
vue.createVNode(HzztTitle$1, {
|
|
24889
|
+
class: "margin-l-1",
|
|
24890
|
+
label: _ctx.label
|
|
24891
|
+
}, null, 8, ["label"])
|
|
24892
|
+
]),
|
|
24893
|
+
!vue.unref(trueDisabled) ? (vue.openBlock(), vue.createBlock(vue.unref(ElSelectV2), {
|
|
24894
|
+
key: 0,
|
|
24895
|
+
class: "flex-1",
|
|
24896
|
+
modelValue: selectValue.value,
|
|
24897
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectValue.value = $event),
|
|
24898
|
+
"allow-create": "",
|
|
24899
|
+
filterable: "",
|
|
24900
|
+
clearable: "",
|
|
24901
|
+
onChange: selectChange,
|
|
24902
|
+
options: _ctx.data
|
|
24903
|
+
}, null, 8, ["modelValue", "options"])) : vue.createCommentVNode("v-if", true),
|
|
24904
|
+
vue.renderSlot(_ctx.$slots, "right")
|
|
24905
|
+
]),
|
|
24906
|
+
vue.createVNode(vue.unref(ElInput), vue.mergeProps({
|
|
24907
|
+
ref_key: "inputRef",
|
|
24908
|
+
ref: inputRef,
|
|
24909
|
+
class: "flex-1 margin-t-1",
|
|
24910
|
+
modelValue: inputVal.value,
|
|
24911
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => inputVal.value = $event)
|
|
24912
|
+
}, vue.unref(_inputProps), {
|
|
24913
|
+
onInput: input,
|
|
24914
|
+
onChange: change
|
|
24915
|
+
}), null, 16, ["modelValue"])
|
|
22112
24916
|
])
|
|
22113
|
-
]
|
|
24917
|
+
], 2);
|
|
22114
24918
|
};
|
|
22115
24919
|
}
|
|
22116
24920
|
});
|
|
22117
|
-
var
|
|
22118
|
-
|
|
22119
|
-
const titleProps = buildProps$1({
|
|
22120
|
-
label: String,
|
|
22121
|
-
sideline: {
|
|
22122
|
-
type: Boolean,
|
|
22123
|
-
default: true
|
|
22124
|
-
}
|
|
22125
|
-
});
|
|
24921
|
+
var SelectTextarea = /* @__PURE__ */ _export_sfc$1(_sfc_main, [["__file", "select-textarea.vue"]]);
|
|
22126
24922
|
|
|
22127
|
-
const
|
|
24923
|
+
const HzztSelectTextarea = withInstall$1(SelectTextarea);
|
|
22128
24924
|
|
|
22129
24925
|
var Components = [
|
|
22130
24926
|
HzztConfigProvider,
|
|
@@ -22140,7 +24936,8 @@
|
|
|
22140
24936
|
HzztCheckButton,
|
|
22141
24937
|
HzztQuarterPicker,
|
|
22142
24938
|
HzztScan,
|
|
22143
|
-
HzztSelectInput
|
|
24939
|
+
HzztSelectInput,
|
|
24940
|
+
HzztSelectTextarea
|
|
22144
24941
|
];
|
|
22145
24942
|
|
|
22146
24943
|
var Plugins = [];
|
|
@@ -22369,6 +25166,7 @@
|
|
|
22369
25166
|
exports.HzztQuarterPicker = HzztQuarterPicker;
|
|
22370
25167
|
exports.HzztScan = HzztScan;
|
|
22371
25168
|
exports.HzztSelectInput = HzztSelectInput;
|
|
25169
|
+
exports.HzztSelectTextarea = HzztSelectTextarea;
|
|
22372
25170
|
exports.HzztTab = HzztTab;
|
|
22373
25171
|
exports.HzztTitle = HzztTitle;
|
|
22374
25172
|
exports.HzztTooltip = HzztTooltip;
|
|
@@ -22386,6 +25184,7 @@
|
|
|
22386
25184
|
exports.datePickTypes = datePickTypes;
|
|
22387
25185
|
exports["default"] = installer;
|
|
22388
25186
|
exports.defaultNamespace = defaultNamespace$1;
|
|
25187
|
+
exports.insertCursorPosition = insertCursorPosition;
|
|
22389
25188
|
exports.install = install;
|
|
22390
25189
|
exports.localeContextKey = localeContextKey$1;
|
|
22391
25190
|
exports.makeInstaller = makeInstaller;
|
|
@@ -22396,6 +25195,8 @@
|
|
|
22396
25195
|
exports.scanProps = scanProps;
|
|
22397
25196
|
exports.selectInputEmits = selectInputEmits;
|
|
22398
25197
|
exports.selectInputProps = selectInputProps;
|
|
25198
|
+
exports.selectTextareaEmits = selectTextareaEmits;
|
|
25199
|
+
exports.selectTextareaProps = selectTextareaProps;
|
|
22399
25200
|
exports.titleProps = titleProps;
|
|
22400
25201
|
exports.translate = translate$1;
|
|
22401
25202
|
exports.useGetDerivedNamespace = useGetDerivedNamespace$1;
|