hzzt-plus 1.0.3 → 1.0.5
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 -1
- package/dist/index.css +1 -1
- package/dist/index.full.js +3101 -247
- package/dist/index.full.min.js +20 -14
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +24 -18
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +3097 -249
- package/es/component.mjs +5 -1
- package/es/component.mjs.map +1 -1
- package/es/components/cascader/index.d.ts +5 -0
- package/es/components/cascader/index.mjs +9 -0
- package/es/components/cascader/index.mjs.map +1 -0
- package/es/components/cascader/src/cascader.d.ts +35 -0
- package/es/components/cascader/src/cascader.mjs +42 -0
- package/es/components/cascader/src/cascader.mjs.map +1 -0
- package/es/components/cascader/src/cascader.vue.d.ts +2293 -0
- package/es/components/cascader/src/cascader2.mjs +128 -0
- package/es/components/cascader/src/cascader2.mjs.map +1 -0
- package/es/components/cascader/src/hooks/utils.d.ts +2 -0
- package/es/components/cascader/src/hooks/utils.mjs +26 -0
- package/es/components/cascader/src/hooks/utils.mjs.map +1 -0
- package/es/components/cascader/style/css.d.ts +2 -0
- package/es/components/cascader/style/css.mjs +3 -0
- package/es/components/cascader/style/css.mjs.map +1 -0
- package/es/components/cascader/style/index.d.ts +2 -0
- package/es/components/cascader/style/index.mjs +3 -0
- package/es/components/cascader/style/index.mjs.map +1 -0
- package/es/components/collapse/index.mjs +2 -2
- package/es/components/collapse/src/collapse.mjs +0 -67
- package/es/components/collapse/src/collapse.mjs.map +1 -1
- package/es/components/collapse/src/collapse2.mjs +67 -0
- package/es/components/collapse/src/collapse2.mjs.map +1 -1
- package/es/components/confirm-password/index.d.ts +1 -1
- package/es/components/confirm-password/src/confirm-password.vue.d.ts +1 -1
- package/es/components/dropdown/index.d.ts +1 -1
- package/es/components/dropdown/src/index.vue.d.ts +1 -1
- package/es/components/index.d.ts +2 -0
- package/es/components/index.mjs +5 -1
- package/es/components/index.mjs.map +1 -1
- package/es/components/input-range/src/input-range.vue.d.ts +1 -1
- package/es/components/input-range/src/input-range2.mjs +1 -1
- package/es/components/input-range/src/input-range2.mjs.map +1 -1
- package/es/components/page-size/index.d.ts +54 -54
- package/es/components/page-size/src/index.vue.d.ts +54 -54
- package/es/components/quarter-picker/index.d.ts +16 -16
- package/es/components/quarter-picker/src/index.vue.d.ts +16 -16
- package/es/components/scan/index.mjs +2 -2
- package/es/components/scan/src/scan.mjs +144 -23
- package/es/components/scan/src/scan.mjs.map +1 -1
- package/es/components/scan/src/scan.vue.d.ts +2 -2
- package/es/components/scan/src/scan2.mjs +23 -144
- package/es/components/scan/src/scan2.mjs.map +1 -1
- package/es/components/select/index.d.ts +5 -0
- package/es/components/select/index.mjs +9 -0
- package/es/components/select/index.mjs.map +1 -0
- package/es/components/select/src/select.d.ts +37 -0
- package/es/components/select/src/select.mjs +39 -0
- package/es/components/select/src/select.mjs.map +1 -0
- package/es/components/select/src/select.vue.d.ts +13237 -0
- package/es/components/select/src/select2.mjs +176 -0
- package/es/components/select/src/select2.mjs.map +1 -0
- package/es/components/select/style/css.d.ts +2 -0
- package/es/components/select/style/css.mjs +3 -0
- package/es/components/select/style/css.mjs.map +1 -0
- package/es/components/select/style/index.d.ts +2 -0
- package/es/components/select/style/index.mjs +3 -0
- package/es/components/select/style/index.mjs.map +1 -0
- package/es/components/select-input/index.d.ts +16 -16
- package/es/components/select-input/src/select-input.d.ts +1 -7
- package/es/components/select-input/src/select-input.mjs.map +1 -1
- package/es/components/select-input/src/select-input.vue.d.ts +12 -12
- package/es/components/select-input/src/select-input2.mjs.map +1 -1
- package/es/components/select-textarea/src/select-textarea.vue.d.ts +32 -32
- package/es/components/select-textarea/src/select-textarea2.mjs +1 -0
- package/es/components/select-textarea/src/select-textarea2.mjs.map +1 -1
- package/es/components/tooltip/index.d.ts +14 -14
- package/es/components/tooltip/src/tooltip.vue.d.ts +14 -14
- package/es/index.mjs +5 -1
- package/es/index.mjs.map +1 -1
- package/global.d.ts +2 -0
- package/lib/component.js +5 -1
- package/lib/component.js.map +1 -1
- package/lib/components/cascader/index.d.ts +5 -0
- package/lib/components/cascader/index.js +16 -0
- package/lib/components/cascader/index.js.map +1 -0
- package/lib/components/cascader/src/cascader.d.ts +35 -0
- package/lib/components/cascader/src/cascader.js +47 -0
- package/lib/components/cascader/src/cascader.js.map +1 -0
- package/lib/components/cascader/src/cascader.vue.d.ts +2293 -0
- package/lib/components/cascader/src/cascader2.js +132 -0
- package/lib/components/cascader/src/cascader2.js.map +1 -0
- package/lib/components/cascader/src/hooks/utils.d.ts +2 -0
- package/lib/components/cascader/src/hooks/utils.js +30 -0
- package/lib/components/cascader/src/hooks/utils.js.map +1 -0
- package/lib/components/cascader/style/css.d.ts +2 -0
- package/lib/components/cascader/style/css.js +6 -0
- package/lib/components/cascader/style/css.js.map +1 -0
- package/lib/components/cascader/style/index.d.ts +2 -0
- package/lib/components/cascader/style/index.js +6 -0
- package/lib/components/cascader/style/index.js.map +1 -0
- package/lib/components/collapse/index.js +2 -2
- package/lib/components/collapse/src/collapse.js +0 -70
- package/lib/components/collapse/src/collapse.js.map +1 -1
- package/lib/components/collapse/src/collapse2.js +70 -0
- package/lib/components/collapse/src/collapse2.js.map +1 -1
- package/lib/components/confirm-password/index.d.ts +1 -1
- package/lib/components/confirm-password/src/confirm-password.vue.d.ts +1 -1
- package/lib/components/dropdown/index.d.ts +1 -1
- package/lib/components/dropdown/src/index.vue.d.ts +1 -1
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +11 -1
- package/lib/components/index.js.map +1 -1
- package/lib/components/input-range/src/input-range.vue.d.ts +1 -1
- package/lib/components/input-range/src/input-range2.js +1 -1
- package/lib/components/input-range/src/input-range2.js.map +1 -1
- package/lib/components/page-size/index.d.ts +54 -54
- package/lib/components/page-size/src/index.vue.d.ts +54 -54
- package/lib/components/quarter-picker/index.d.ts +16 -16
- package/lib/components/quarter-picker/src/index.vue.d.ts +16 -16
- package/lib/components/scan/index.js +2 -2
- package/lib/components/scan/src/scan.js +144 -24
- package/lib/components/scan/src/scan.js.map +1 -1
- package/lib/components/scan/src/scan.vue.d.ts +2 -2
- package/lib/components/scan/src/scan2.js +24 -144
- package/lib/components/scan/src/scan2.js.map +1 -1
- package/lib/components/select/index.d.ts +5 -0
- package/lib/components/select/index.js +16 -0
- package/lib/components/select/index.js.map +1 -0
- package/lib/components/select/src/select.d.ts +37 -0
- package/lib/components/select/src/select.js +44 -0
- package/lib/components/select/src/select.js.map +1 -0
- package/lib/components/select/src/select.vue.d.ts +13237 -0
- package/lib/components/select/src/select2.js +180 -0
- package/lib/components/select/src/select2.js.map +1 -0
- package/lib/components/select/style/css.d.ts +2 -0
- package/lib/components/select/style/css.js +6 -0
- package/lib/components/select/style/css.js.map +1 -0
- package/lib/components/select/style/index.d.ts +2 -0
- package/lib/components/select/style/index.js +6 -0
- package/lib/components/select/style/index.js.map +1 -0
- package/lib/components/select-input/index.d.ts +16 -16
- package/lib/components/select-input/src/select-input.d.ts +1 -7
- package/lib/components/select-input/src/select-input.js.map +1 -1
- package/lib/components/select-input/src/select-input.vue.d.ts +12 -12
- package/lib/components/select-input/src/select-input2.js.map +1 -1
- package/lib/components/select-textarea/src/select-textarea.vue.d.ts +32 -32
- package/lib/components/select-textarea/src/select-textarea2.js +1 -0
- package/lib/components/select-textarea/src/select-textarea2.js.map +1 -1
- package/lib/components/tooltip/index.d.ts +14 -14
- package/lib/components/tooltip/src/tooltip.vue.d.ts +14 -14
- package/lib/index.js +41 -31
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/tags.json +1 -1
- package/theme/hzzt-cascader.css +1 -0
- package/theme/hzzt-select.css +1 -0
- package/theme/index.css +1 -1
- package/theme/src/cascader.scss +28 -0
- package/theme/src/index.scss +2 -0
- package/theme/src/mixins/mixins.scss +3 -0
- package/theme/src/select.scss +10 -0
- package/web-types.json +1 -1
package/dist/index.full.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! Hzzt Plus v1.0.2 */
|
|
2
2
|
|
|
3
|
-
import { readonly, shallowRef, watchEffect, getCurrentScope, onScopeDispose,
|
|
3
|
+
import { unref, readonly, shallowRef, watchEffect, getCurrentScope, onScopeDispose, getCurrentInstance, onMounted, nextTick, ref, computed, watch, defineComponent, openBlock, createElementBlock, createElementVNode, warn, isRef, inject, provide, renderSlot, useSlots, createCommentVNode, createTextVNode, toDisplayString, mergeProps, toRef, onUnmounted, useAttrs as useAttrs$1, normalizeClass, normalizeStyle, Fragment, createBlock, withCtx, resolveDynamicComponent, withModifiers, createVNode, onBeforeUnmount, Transition, withDirectives, vShow, reactive, onActivated, onUpdated, cloneVNode, Text, Comment, Teleport as Teleport$1, onBeforeMount, onDeactivated, toRaw, vModelCheckbox, toRefs, vModelRadio, h, resolveComponent, renderList, onBeforeUpdate, withKeys, vModelText, createSlots, resolveDirective, toHandlerKey, normalizeProps, guardReactiveProps } from 'vue';
|
|
4
4
|
|
|
5
5
|
var __defProp$9 = Object.defineProperty;
|
|
6
6
|
var __defProps$6 = Object.defineProperties;
|
|
@@ -161,6 +161,27 @@ const globalKey = "__vueuse_ssr_handlers__";
|
|
|
161
161
|
_global[globalKey] = _global[globalKey] || {};
|
|
162
162
|
_global[globalKey];
|
|
163
163
|
|
|
164
|
+
function useCssVar(prop, target, { window = defaultWindow, initialValue = "" } = {}) {
|
|
165
|
+
const variable = ref(initialValue);
|
|
166
|
+
const elRef = computed(() => {
|
|
167
|
+
var _a;
|
|
168
|
+
return unrefElement(target) || ((_a = window == null ? void 0 : window.document) == null ? void 0 : _a.documentElement);
|
|
169
|
+
});
|
|
170
|
+
watch([elRef, () => resolveUnref(prop)], ([el, prop2]) => {
|
|
171
|
+
var _a;
|
|
172
|
+
if (el && window) {
|
|
173
|
+
const value = (_a = window.getComputedStyle(el).getPropertyValue(prop2)) == null ? void 0 : _a.trim();
|
|
174
|
+
variable.value = value || initialValue;
|
|
175
|
+
}
|
|
176
|
+
}, { immediate: true });
|
|
177
|
+
watch(variable, (val) => {
|
|
178
|
+
var _a;
|
|
179
|
+
if ((_a = elRef.value) == null ? void 0 : _a.style)
|
|
180
|
+
elRef.value.style.setProperty(resolveUnref(prop), val);
|
|
181
|
+
});
|
|
182
|
+
return variable;
|
|
183
|
+
}
|
|
184
|
+
|
|
164
185
|
var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
|
|
165
186
|
var __hasOwnProp$f = Object.prototype.hasOwnProperty;
|
|
166
187
|
var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
|
|
@@ -310,9 +331,20 @@ const isArray$1 = Array.isArray;
|
|
|
310
331
|
const isFunction$1 = (val) => typeof val === "function";
|
|
311
332
|
const isString$1 = (val) => typeof val === "string";
|
|
312
333
|
const isObject$1 = (val) => val !== null && typeof val === "object";
|
|
334
|
+
const isPromise = (val) => {
|
|
335
|
+
return isObject$1(val) && isFunction$1(val.then) && isFunction$1(val.catch);
|
|
336
|
+
};
|
|
313
337
|
const objectToString$1 = Object.prototype.toString;
|
|
314
338
|
const toTypeString = (value) => objectToString$1.call(value);
|
|
315
339
|
const isPlainObject$1 = (val) => toTypeString(val) === "[object Object]";
|
|
340
|
+
const cacheStringFunction = (fn) => {
|
|
341
|
+
const cache = /* @__PURE__ */ Object.create(null);
|
|
342
|
+
return (str) => {
|
|
343
|
+
const hit = cache[str];
|
|
344
|
+
return hit || (cache[str] = fn(str));
|
|
345
|
+
};
|
|
346
|
+
};
|
|
347
|
+
const capitalize$2 = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));
|
|
316
348
|
|
|
317
349
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
318
350
|
|
|
@@ -1982,7 +2014,7 @@ function createCaseFirst(methodName) {
|
|
|
1982
2014
|
|
|
1983
2015
|
var upperFirst = createCaseFirst("toUpperCase");
|
|
1984
2016
|
|
|
1985
|
-
function capitalize(string) {
|
|
2017
|
+
function capitalize$1(string) {
|
|
1986
2018
|
return upperFirst(toString(string).toLowerCase());
|
|
1987
2019
|
}
|
|
1988
2020
|
|
|
@@ -2291,10 +2323,10 @@ function createCompounder(callback) {
|
|
|
2291
2323
|
|
|
2292
2324
|
var camelCase = createCompounder(function(result, word, index) {
|
|
2293
2325
|
word = word.toLowerCase();
|
|
2294
|
-
return result + (index ? capitalize(word) : word);
|
|
2326
|
+
return result + (index ? capitalize$1(word) : word);
|
|
2295
2327
|
});
|
|
2296
2328
|
|
|
2297
|
-
function castArray() {
|
|
2329
|
+
function castArray$1() {
|
|
2298
2330
|
if (!arguments.length) {
|
|
2299
2331
|
return [];
|
|
2300
2332
|
}
|
|
@@ -4309,7 +4341,7 @@ var mapTag$2 = "[object Map]";
|
|
|
4309
4341
|
var setTag$2 = "[object Set]";
|
|
4310
4342
|
var objectProto$3 = Object.prototype;
|
|
4311
4343
|
var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
|
|
4312
|
-
function isEmpty$
|
|
4344
|
+
function isEmpty$2(value) {
|
|
4313
4345
|
if (value == null) {
|
|
4314
4346
|
return true;
|
|
4315
4347
|
}
|
|
@@ -6323,7 +6355,7 @@ var func = {
|
|
|
6323
6355
|
};
|
|
6324
6356
|
|
|
6325
6357
|
var lang = {
|
|
6326
|
-
castArray,
|
|
6358
|
+
castArray: castArray$1,
|
|
6327
6359
|
clone,
|
|
6328
6360
|
cloneDeep,
|
|
6329
6361
|
cloneDeepWith,
|
|
@@ -6341,7 +6373,7 @@ var lang = {
|
|
|
6341
6373
|
isBuffer,
|
|
6342
6374
|
isDate,
|
|
6343
6375
|
isElement: isElement$1,
|
|
6344
|
-
isEmpty: isEmpty$
|
|
6376
|
+
isEmpty: isEmpty$2,
|
|
6345
6377
|
isEqual: isEqual$1,
|
|
6346
6378
|
isEqualWith,
|
|
6347
6379
|
isError,
|
|
@@ -6474,7 +6506,7 @@ var seq = {
|
|
|
6474
6506
|
|
|
6475
6507
|
var string = {
|
|
6476
6508
|
camelCase,
|
|
6477
|
-
capitalize,
|
|
6509
|
+
capitalize: capitalize$1,
|
|
6478
6510
|
deburr,
|
|
6479
6511
|
endsWith,
|
|
6480
6512
|
escape,
|
|
@@ -7126,7 +7158,7 @@ if (symIterator) {
|
|
|
7126
7158
|
|
|
7127
7159
|
const isBoolean$1 = (val) => typeof val === "boolean";
|
|
7128
7160
|
const isNumber$1 = (val) => typeof val === "number";
|
|
7129
|
-
const isEmpty = (val) => !val && val !== 0 || isArray$1(val) && val.length === 0 || isObject$1(val) && !Object.keys(val).length;
|
|
7161
|
+
const isEmpty$1 = (val) => !val && val !== 0 || isArray$1(val) && val.length === 0 || isObject$1(val) && !Object.keys(val).length;
|
|
7130
7162
|
|
|
7131
7163
|
const keysOf = (arr) => Object.keys(arr);
|
|
7132
7164
|
|
|
@@ -12971,11 +13003,11 @@ const _hoisted_2$a = {
|
|
|
12971
13003
|
class: "decorative-line"
|
|
12972
13004
|
};
|
|
12973
13005
|
const _hoisted_3$7 = { class: "label-name" };
|
|
12974
|
-
const __default__$
|
|
13006
|
+
const __default__$C = defineComponent({
|
|
12975
13007
|
name: "HzztTitle"
|
|
12976
13008
|
});
|
|
12977
|
-
const _sfc_main$
|
|
12978
|
-
...__default__$
|
|
13009
|
+
const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
13010
|
+
...__default__$C,
|
|
12979
13011
|
props: titleProps,
|
|
12980
13012
|
setup(__props) {
|
|
12981
13013
|
const props = __props;
|
|
@@ -12997,7 +13029,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
12997
13029
|
};
|
|
12998
13030
|
}
|
|
12999
13031
|
});
|
|
13000
|
-
var HzztTitle$1 = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
13032
|
+
var HzztTitle$1 = /* @__PURE__ */ _export_sfc$1(_sfc_main$T, [["__file", "title.vue"]]);
|
|
13001
13033
|
|
|
13002
13034
|
const HzztTitle = withInstall$1(HzztTitle$1);
|
|
13003
13035
|
|
|
@@ -13079,11 +13111,13 @@ const useNamespace = (block, namespaceOverrides) => {
|
|
|
13079
13111
|
const isUndefined = (val) => val === void 0;
|
|
13080
13112
|
const isBoolean = (val) => typeof val === "boolean";
|
|
13081
13113
|
const isNumber = (val) => typeof val === "number";
|
|
13114
|
+
const isEmpty = (val) => !val && val !== 0 || isArray$1(val) && val.length === 0 || isObject$1(val) && !Object.keys(val).length;
|
|
13082
13115
|
const isElement = (e) => {
|
|
13083
13116
|
if (typeof Element === "undefined")
|
|
13084
13117
|
return false;
|
|
13085
13118
|
return e instanceof Element;
|
|
13086
13119
|
};
|
|
13120
|
+
const isPropAbsent = (prop) => isNil(prop);
|
|
13087
13121
|
const isStringNumber = (val) => {
|
|
13088
13122
|
if (!isString$1(val)) {
|
|
13089
13123
|
return false;
|
|
@@ -13518,12 +13552,12 @@ const iconProps = buildProps({
|
|
|
13518
13552
|
}
|
|
13519
13553
|
});
|
|
13520
13554
|
|
|
13521
|
-
const __default__$
|
|
13555
|
+
const __default__$B = defineComponent({
|
|
13522
13556
|
name: "ElIcon",
|
|
13523
13557
|
inheritAttrs: false
|
|
13524
13558
|
});
|
|
13525
|
-
const _sfc_main$
|
|
13526
|
-
...__default__$
|
|
13559
|
+
const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
13560
|
+
...__default__$B,
|
|
13527
13561
|
props: iconProps,
|
|
13528
13562
|
setup(__props) {
|
|
13529
13563
|
const props = __props;
|
|
@@ -13547,7 +13581,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
13547
13581
|
};
|
|
13548
13582
|
}
|
|
13549
13583
|
});
|
|
13550
|
-
var Icon = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
13584
|
+
var Icon = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__file", "icon.vue"]]);
|
|
13551
13585
|
|
|
13552
13586
|
const ElIcon = withInstall(Icon);
|
|
13553
13587
|
|
|
@@ -13985,12 +14019,12 @@ function useCursor(input) {
|
|
|
13985
14019
|
return [recordCursor, setCursor];
|
|
13986
14020
|
}
|
|
13987
14021
|
|
|
13988
|
-
const __default__$
|
|
14022
|
+
const __default__$A = defineComponent({
|
|
13989
14023
|
name: "ElInput",
|
|
13990
14024
|
inheritAttrs: false
|
|
13991
14025
|
});
|
|
13992
|
-
const _sfc_main$
|
|
13993
|
-
...__default__$
|
|
14026
|
+
const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
14027
|
+
...__default__$A,
|
|
13994
14028
|
props: inputProps,
|
|
13995
14029
|
emits: inputEmits,
|
|
13996
14030
|
setup(__props, { expose, emit }) {
|
|
@@ -14395,7 +14429,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
14395
14429
|
};
|
|
14396
14430
|
}
|
|
14397
14431
|
});
|
|
14398
|
-
var Input = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
14432
|
+
var Input = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__file", "input.vue"]]);
|
|
14399
14433
|
|
|
14400
14434
|
const ElInput = withInstall(Input);
|
|
14401
14435
|
|
|
@@ -14444,8 +14478,8 @@ const thumbProps = buildProps({
|
|
|
14444
14478
|
always: Boolean
|
|
14445
14479
|
});
|
|
14446
14480
|
|
|
14447
|
-
const COMPONENT_NAME$
|
|
14448
|
-
const _sfc_main$
|
|
14481
|
+
const COMPONENT_NAME$3 = "Thumb";
|
|
14482
|
+
const _sfc_main$Q = /* @__PURE__ */ defineComponent({
|
|
14449
14483
|
__name: "thumb",
|
|
14450
14484
|
props: thumbProps,
|
|
14451
14485
|
setup(__props) {
|
|
@@ -14453,7 +14487,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
14453
14487
|
const scrollbar = inject(scrollbarContextKey);
|
|
14454
14488
|
const ns = useNamespace("scrollbar");
|
|
14455
14489
|
if (!scrollbar)
|
|
14456
|
-
throwError(COMPONENT_NAME$
|
|
14490
|
+
throwError(COMPONENT_NAME$3, "can not inject scrollbar context");
|
|
14457
14491
|
const instance = ref();
|
|
14458
14492
|
const thumb = ref();
|
|
14459
14493
|
const thumbState = ref({});
|
|
@@ -14564,7 +14598,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
14564
14598
|
};
|
|
14565
14599
|
}
|
|
14566
14600
|
});
|
|
14567
|
-
var Thumb = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
14601
|
+
var Thumb = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__file", "thumb.vue"]]);
|
|
14568
14602
|
|
|
14569
14603
|
const barProps = buildProps({
|
|
14570
14604
|
always: {
|
|
@@ -14577,7 +14611,7 @@ const barProps = buildProps({
|
|
|
14577
14611
|
}
|
|
14578
14612
|
});
|
|
14579
14613
|
|
|
14580
|
-
const _sfc_main$
|
|
14614
|
+
const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
14581
14615
|
__name: "bar",
|
|
14582
14616
|
props: barProps,
|
|
14583
14617
|
setup(__props, { expose }) {
|
|
@@ -14635,7 +14669,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
14635
14669
|
};
|
|
14636
14670
|
}
|
|
14637
14671
|
});
|
|
14638
|
-
var Bar = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
14672
|
+
var Bar = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["__file", "bar.vue"]]);
|
|
14639
14673
|
|
|
14640
14674
|
const scrollbarProps = buildProps({
|
|
14641
14675
|
height: {
|
|
@@ -14691,12 +14725,12 @@ const scrollbarEmits = {
|
|
|
14691
14725
|
}) => [scrollTop, scrollLeft].every(isNumber)
|
|
14692
14726
|
};
|
|
14693
14727
|
|
|
14694
|
-
const COMPONENT_NAME$
|
|
14695
|
-
const __default__$
|
|
14696
|
-
name: COMPONENT_NAME$
|
|
14728
|
+
const COMPONENT_NAME$2 = "ElScrollbar";
|
|
14729
|
+
const __default__$z = defineComponent({
|
|
14730
|
+
name: COMPONENT_NAME$2
|
|
14697
14731
|
});
|
|
14698
|
-
const _sfc_main$
|
|
14699
|
-
...__default__$
|
|
14732
|
+
const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
14733
|
+
...__default__$z,
|
|
14700
14734
|
props: scrollbarProps,
|
|
14701
14735
|
emits: scrollbarEmits,
|
|
14702
14736
|
setup(__props, { expose, emit }) {
|
|
@@ -14848,7 +14882,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
14848
14882
|
};
|
|
14849
14883
|
}
|
|
14850
14884
|
});
|
|
14851
|
-
var Scrollbar = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
14885
|
+
var Scrollbar = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__file", "scrollbar.vue"]]);
|
|
14852
14886
|
|
|
14853
14887
|
const ElScrollbar = withInstall(Scrollbar);
|
|
14854
14888
|
|
|
@@ -14873,12 +14907,12 @@ const popperProps = buildProps({
|
|
|
14873
14907
|
}
|
|
14874
14908
|
});
|
|
14875
14909
|
|
|
14876
|
-
const __default__$
|
|
14910
|
+
const __default__$y = defineComponent({
|
|
14877
14911
|
name: "ElPopper",
|
|
14878
14912
|
inheritAttrs: false
|
|
14879
14913
|
});
|
|
14880
|
-
const _sfc_main$
|
|
14881
|
-
...__default__$
|
|
14914
|
+
const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
14915
|
+
...__default__$y,
|
|
14882
14916
|
props: popperProps,
|
|
14883
14917
|
setup(__props, { expose }) {
|
|
14884
14918
|
const props = __props;
|
|
@@ -14901,7 +14935,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
14901
14935
|
};
|
|
14902
14936
|
}
|
|
14903
14937
|
});
|
|
14904
|
-
var Popper = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
14938
|
+
var Popper = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["__file", "popper.vue"]]);
|
|
14905
14939
|
|
|
14906
14940
|
const popperArrowProps = buildProps({
|
|
14907
14941
|
arrowOffset: {
|
|
@@ -14910,12 +14944,12 @@ const popperArrowProps = buildProps({
|
|
|
14910
14944
|
}
|
|
14911
14945
|
});
|
|
14912
14946
|
|
|
14913
|
-
const __default__$
|
|
14947
|
+
const __default__$x = defineComponent({
|
|
14914
14948
|
name: "ElPopperArrow",
|
|
14915
14949
|
inheritAttrs: false
|
|
14916
14950
|
});
|
|
14917
|
-
const _sfc_main$
|
|
14918
|
-
...__default__$
|
|
14951
|
+
const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
14952
|
+
...__default__$x,
|
|
14919
14953
|
props: popperArrowProps,
|
|
14920
14954
|
setup(__props, { expose }) {
|
|
14921
14955
|
const props = __props;
|
|
@@ -14941,7 +14975,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
14941
14975
|
};
|
|
14942
14976
|
}
|
|
14943
14977
|
});
|
|
14944
|
-
var ElPopperArrow = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
14978
|
+
var ElPopperArrow = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__file", "arrow.vue"]]);
|
|
14945
14979
|
|
|
14946
14980
|
const popperTriggerProps = buildProps({
|
|
14947
14981
|
virtualRef: {
|
|
@@ -15020,6 +15054,21 @@ const isFocusable = (element) => {
|
|
|
15020
15054
|
}
|
|
15021
15055
|
}
|
|
15022
15056
|
};
|
|
15057
|
+
const isLeaf = (el) => !el.getAttribute("aria-owns");
|
|
15058
|
+
const getSibling = (el, distance, elClass) => {
|
|
15059
|
+
const { parentNode } = el;
|
|
15060
|
+
if (!parentNode)
|
|
15061
|
+
return null;
|
|
15062
|
+
const siblings = parentNode.querySelectorAll(elClass);
|
|
15063
|
+
const index = Array.prototype.indexOf.call(siblings, el);
|
|
15064
|
+
return siblings[index + distance] || null;
|
|
15065
|
+
};
|
|
15066
|
+
const focusNode = (el) => {
|
|
15067
|
+
if (!el)
|
|
15068
|
+
return;
|
|
15069
|
+
el.focus();
|
|
15070
|
+
!isLeaf(el) && el.click();
|
|
15071
|
+
};
|
|
15023
15072
|
|
|
15024
15073
|
const NAME = "ElOnlyChild";
|
|
15025
15074
|
const OnlyChild = defineComponent({
|
|
@@ -15076,12 +15125,12 @@ function wrapTextContent(s) {
|
|
|
15076
15125
|
}, [s]);
|
|
15077
15126
|
}
|
|
15078
15127
|
|
|
15079
|
-
const __default__$
|
|
15128
|
+
const __default__$w = defineComponent({
|
|
15080
15129
|
name: "ElPopperTrigger",
|
|
15081
15130
|
inheritAttrs: false
|
|
15082
15131
|
});
|
|
15083
|
-
const _sfc_main$
|
|
15084
|
-
...__default__$
|
|
15132
|
+
const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
15133
|
+
...__default__$w,
|
|
15085
15134
|
props: popperTriggerProps,
|
|
15086
15135
|
setup(__props, { expose }) {
|
|
15087
15136
|
const props = __props;
|
|
@@ -15192,7 +15241,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
15192
15241
|
};
|
|
15193
15242
|
}
|
|
15194
15243
|
});
|
|
15195
|
-
var ElPopperTrigger = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
15244
|
+
var ElPopperTrigger = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__file", "trigger.vue"]]);
|
|
15196
15245
|
|
|
15197
15246
|
const FOCUS_AFTER_TRAPPED = "focus-trap.focus-after-trapped";
|
|
15198
15247
|
const FOCUS_AFTER_RELEASED = "focus-trap.focus-after-released";
|
|
@@ -15391,7 +15440,7 @@ const useEscapeKeydown = (handler) => {
|
|
|
15391
15440
|
});
|
|
15392
15441
|
};
|
|
15393
15442
|
|
|
15394
|
-
const _sfc_main$
|
|
15443
|
+
const _sfc_main$K = defineComponent({
|
|
15395
15444
|
name: "ElFocusTrap",
|
|
15396
15445
|
inheritAttrs: false,
|
|
15397
15446
|
props: {
|
|
@@ -15633,10 +15682,10 @@ const _sfc_main$y = defineComponent({
|
|
|
15633
15682
|
};
|
|
15634
15683
|
}
|
|
15635
15684
|
});
|
|
15636
|
-
function _sfc_render$
|
|
15685
|
+
function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
15637
15686
|
return renderSlot(_ctx.$slots, "default", { handleKeydown: _ctx.onKeydown });
|
|
15638
15687
|
}
|
|
15639
|
-
var ElFocusTrap = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
15688
|
+
var ElFocusTrap = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["render", _sfc_render$c], ["__file", "focus-trap.vue"]]);
|
|
15640
15689
|
|
|
15641
15690
|
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});
|
|
15642
15691
|
|
|
@@ -16015,11 +16064,11 @@ const usePopperContentDOM = (props, {
|
|
|
16015
16064
|
};
|
|
16016
16065
|
};
|
|
16017
16066
|
|
|
16018
|
-
const __default__$
|
|
16067
|
+
const __default__$v = defineComponent({
|
|
16019
16068
|
name: "ElPopperContent"
|
|
16020
16069
|
});
|
|
16021
|
-
const _sfc_main$
|
|
16022
|
-
...__default__$
|
|
16070
|
+
const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
16071
|
+
...__default__$v,
|
|
16023
16072
|
props: popperContentProps,
|
|
16024
16073
|
emits: popperContentEmits,
|
|
16025
16074
|
setup(__props, { expose, emit }) {
|
|
@@ -16135,7 +16184,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
16135
16184
|
};
|
|
16136
16185
|
}
|
|
16137
16186
|
});
|
|
16138
|
-
var ElPopperContent = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
16187
|
+
var ElPopperContent = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__file", "content.vue"]]);
|
|
16139
16188
|
|
|
16140
16189
|
const ElPopper = withInstall(Popper);
|
|
16141
16190
|
|
|
@@ -16413,11 +16462,11 @@ const composeEventHandlers = (theirsHandler, oursHandler, { checkForDefaultPreve
|
|
|
16413
16462
|
return handleEvent;
|
|
16414
16463
|
};
|
|
16415
16464
|
|
|
16416
|
-
const __default__$
|
|
16465
|
+
const __default__$u = defineComponent({
|
|
16417
16466
|
name: "ElTooltipTrigger"
|
|
16418
16467
|
});
|
|
16419
|
-
const _sfc_main$
|
|
16420
|
-
...__default__$
|
|
16468
|
+
const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
16469
|
+
...__default__$u,
|
|
16421
16470
|
props: useTooltipTriggerProps,
|
|
16422
16471
|
setup(__props, { expose }) {
|
|
16423
16472
|
const props = __props;
|
|
@@ -16476,7 +16525,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
16476
16525
|
};
|
|
16477
16526
|
}
|
|
16478
16527
|
});
|
|
16479
|
-
var ElTooltipTrigger = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
16528
|
+
var ElTooltipTrigger = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__file", "trigger.vue"]]);
|
|
16480
16529
|
|
|
16481
16530
|
const teleportProps = buildProps({
|
|
16482
16531
|
to: {
|
|
@@ -16486,7 +16535,7 @@ const teleportProps = buildProps({
|
|
|
16486
16535
|
disabled: Boolean
|
|
16487
16536
|
});
|
|
16488
16537
|
|
|
16489
|
-
const _sfc_main$
|
|
16538
|
+
const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
16490
16539
|
__name: "teleport",
|
|
16491
16540
|
props: teleportProps,
|
|
16492
16541
|
setup(__props) {
|
|
@@ -16500,7 +16549,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
16500
16549
|
};
|
|
16501
16550
|
}
|
|
16502
16551
|
});
|
|
16503
|
-
var Teleport = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
16552
|
+
var Teleport = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__file", "teleport.vue"]]);
|
|
16504
16553
|
|
|
16505
16554
|
const ElTeleport = withInstall(Teleport);
|
|
16506
16555
|
|
|
@@ -16537,12 +16586,12 @@ const usePopperContainer = () => {
|
|
|
16537
16586
|
};
|
|
16538
16587
|
};
|
|
16539
16588
|
|
|
16540
|
-
const __default__$
|
|
16589
|
+
const __default__$t = defineComponent({
|
|
16541
16590
|
name: "ElTooltipContent",
|
|
16542
16591
|
inheritAttrs: false
|
|
16543
16592
|
});
|
|
16544
|
-
const _sfc_main$
|
|
16545
|
-
...__default__$
|
|
16593
|
+
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
16594
|
+
...__default__$t,
|
|
16546
16595
|
props: useTooltipContentProps,
|
|
16547
16596
|
setup(__props, { expose }) {
|
|
16548
16597
|
const props = __props;
|
|
@@ -16713,13 +16762,13 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
16713
16762
|
};
|
|
16714
16763
|
}
|
|
16715
16764
|
});
|
|
16716
|
-
var ElTooltipContent = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
16765
|
+
var ElTooltipContent = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__file", "content.vue"]]);
|
|
16717
16766
|
|
|
16718
|
-
const __default__$
|
|
16767
|
+
const __default__$s = defineComponent({
|
|
16719
16768
|
name: "ElTooltip"
|
|
16720
16769
|
});
|
|
16721
|
-
const _sfc_main$
|
|
16722
|
-
...__default__$
|
|
16770
|
+
const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
16771
|
+
...__default__$s,
|
|
16723
16772
|
props: useTooltipProps,
|
|
16724
16773
|
emits: tooltipEmits,
|
|
16725
16774
|
setup(__props, { expose, emit }) {
|
|
@@ -16869,7 +16918,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
16869
16918
|
};
|
|
16870
16919
|
}
|
|
16871
16920
|
});
|
|
16872
|
-
var Tooltip$1 = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
16921
|
+
var Tooltip$1 = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__file", "tooltip.vue"]]);
|
|
16873
16922
|
|
|
16874
16923
|
const ElTooltip = withInstall(Tooltip$1);
|
|
16875
16924
|
|
|
@@ -17943,11 +17992,11 @@ function useButtonCustomStyle(props) {
|
|
|
17943
17992
|
});
|
|
17944
17993
|
}
|
|
17945
17994
|
|
|
17946
|
-
const __default__$
|
|
17995
|
+
const __default__$r = defineComponent({
|
|
17947
17996
|
name: "ElButton"
|
|
17948
17997
|
});
|
|
17949
|
-
const _sfc_main$
|
|
17950
|
-
...__default__$
|
|
17998
|
+
const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
17999
|
+
...__default__$r,
|
|
17951
18000
|
props: buttonProps,
|
|
17952
18001
|
emits: buttonEmits,
|
|
17953
18002
|
setup(__props, { expose, emit }) {
|
|
@@ -18013,18 +18062,18 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
18013
18062
|
};
|
|
18014
18063
|
}
|
|
18015
18064
|
});
|
|
18016
|
-
var Button = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
18065
|
+
var Button = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__file", "button.vue"]]);
|
|
18017
18066
|
|
|
18018
18067
|
const buttonGroupProps = {
|
|
18019
18068
|
size: buttonProps.size,
|
|
18020
18069
|
type: buttonProps.type
|
|
18021
18070
|
};
|
|
18022
18071
|
|
|
18023
|
-
const __default__$
|
|
18072
|
+
const __default__$q = defineComponent({
|
|
18024
18073
|
name: "ElButtonGroup"
|
|
18025
18074
|
});
|
|
18026
|
-
const _sfc_main$
|
|
18027
|
-
...__default__$
|
|
18075
|
+
const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
18076
|
+
...__default__$q,
|
|
18028
18077
|
props: buttonGroupProps,
|
|
18029
18078
|
setup(__props) {
|
|
18030
18079
|
const props = __props;
|
|
@@ -18042,7 +18091,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
18042
18091
|
};
|
|
18043
18092
|
}
|
|
18044
18093
|
});
|
|
18045
|
-
var ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
18094
|
+
var ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__file", "button-group.vue"]]);
|
|
18046
18095
|
|
|
18047
18096
|
const ElButton = withInstall(Button, {
|
|
18048
18097
|
ButtonGroup
|
|
@@ -18051,84 +18100,1837 @@ withNoopInstall(ButtonGroup);
|
|
|
18051
18100
|
|
|
18052
18101
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
18053
18102
|
|
|
18054
|
-
const
|
|
18055
|
-
|
|
18056
|
-
|
|
18057
|
-
|
|
18058
|
-
type: String,
|
|
18059
|
-
values: ["primary", "success", "info", "warning", "danger"],
|
|
18060
|
-
default: "primary"
|
|
18103
|
+
const checkboxProps = {
|
|
18104
|
+
modelValue: {
|
|
18105
|
+
type: [Number, String, Boolean],
|
|
18106
|
+
default: void 0
|
|
18061
18107
|
},
|
|
18062
|
-
|
|
18063
|
-
|
|
18064
|
-
|
|
18065
|
-
|
|
18066
|
-
|
|
18108
|
+
label: {
|
|
18109
|
+
type: [String, Boolean, Number, Object],
|
|
18110
|
+
default: void 0
|
|
18111
|
+
},
|
|
18112
|
+
value: {
|
|
18113
|
+
type: [String, Boolean, Number, Object],
|
|
18114
|
+
default: void 0
|
|
18115
|
+
},
|
|
18116
|
+
indeterminate: Boolean,
|
|
18117
|
+
disabled: Boolean,
|
|
18118
|
+
checked: Boolean,
|
|
18119
|
+
name: {
|
|
18067
18120
|
type: String,
|
|
18068
|
-
|
|
18121
|
+
default: void 0
|
|
18069
18122
|
},
|
|
18070
|
-
|
|
18123
|
+
trueValue: {
|
|
18124
|
+
type: [String, Number],
|
|
18125
|
+
default: void 0
|
|
18126
|
+
},
|
|
18127
|
+
falseValue: {
|
|
18128
|
+
type: [String, Number],
|
|
18129
|
+
default: void 0
|
|
18130
|
+
},
|
|
18131
|
+
trueLabel: {
|
|
18132
|
+
type: [String, Number],
|
|
18133
|
+
default: void 0
|
|
18134
|
+
},
|
|
18135
|
+
falseLabel: {
|
|
18136
|
+
type: [String, Number],
|
|
18137
|
+
default: void 0
|
|
18138
|
+
},
|
|
18139
|
+
id: {
|
|
18071
18140
|
type: String,
|
|
18072
|
-
|
|
18073
|
-
default: "light"
|
|
18141
|
+
default: void 0
|
|
18074
18142
|
},
|
|
18075
|
-
|
|
18076
|
-
|
|
18077
|
-
|
|
18078
|
-
|
|
18079
|
-
|
|
18143
|
+
border: Boolean,
|
|
18144
|
+
size: useSizeProp,
|
|
18145
|
+
tabindex: [String, Number],
|
|
18146
|
+
validateEvent: {
|
|
18147
|
+
type: Boolean,
|
|
18148
|
+
default: true
|
|
18149
|
+
},
|
|
18150
|
+
...useAriaProps(["ariaControls"])
|
|
18151
|
+
};
|
|
18152
|
+
const checkboxEmits = {
|
|
18153
|
+
[UPDATE_MODEL_EVENT]: (val) => isString$1(val) || isNumber(val) || isBoolean(val),
|
|
18154
|
+
change: (val) => isString$1(val) || isNumber(val) || isBoolean(val)
|
|
18080
18155
|
};
|
|
18081
18156
|
|
|
18082
|
-
const
|
|
18083
|
-
|
|
18157
|
+
const checkboxGroupContextKey = Symbol("checkboxGroupContextKey");
|
|
18158
|
+
|
|
18159
|
+
const useCheckboxDisabled = ({
|
|
18160
|
+
model,
|
|
18161
|
+
isChecked
|
|
18162
|
+
}) => {
|
|
18163
|
+
const checkboxGroup = inject(checkboxGroupContextKey, void 0);
|
|
18164
|
+
const isLimitDisabled = computed(() => {
|
|
18165
|
+
var _a, _b;
|
|
18166
|
+
const max = (_a = checkboxGroup == null ? void 0 : checkboxGroup.max) == null ? void 0 : _a.value;
|
|
18167
|
+
const min = (_b = checkboxGroup == null ? void 0 : checkboxGroup.min) == null ? void 0 : _b.value;
|
|
18168
|
+
return !isUndefined(max) && model.value.length >= max && !isChecked.value || !isUndefined(min) && model.value.length <= min && isChecked.value;
|
|
18169
|
+
});
|
|
18170
|
+
const isDisabled = useFormDisabled(computed(() => (checkboxGroup == null ? void 0 : checkboxGroup.disabled.value) || isLimitDisabled.value));
|
|
18171
|
+
return {
|
|
18172
|
+
isDisabled,
|
|
18173
|
+
isLimitDisabled
|
|
18174
|
+
};
|
|
18175
|
+
};
|
|
18176
|
+
|
|
18177
|
+
const useCheckboxEvent = (props, {
|
|
18178
|
+
model,
|
|
18179
|
+
isLimitExceeded,
|
|
18180
|
+
hasOwnLabel,
|
|
18181
|
+
isDisabled,
|
|
18182
|
+
isLabeledByFormItem
|
|
18183
|
+
}) => {
|
|
18184
|
+
const checkboxGroup = inject(checkboxGroupContextKey, void 0);
|
|
18185
|
+
const { formItem } = useFormItem();
|
|
18186
|
+
const { emit } = getCurrentInstance();
|
|
18187
|
+
function getLabeledValue(value) {
|
|
18188
|
+
var _a, _b, _c, _d;
|
|
18189
|
+
return [true, props.trueValue, props.trueLabel].includes(value) ? (_b = (_a = props.trueValue) != null ? _a : props.trueLabel) != null ? _b : true : (_d = (_c = props.falseValue) != null ? _c : props.falseLabel) != null ? _d : false;
|
|
18190
|
+
}
|
|
18191
|
+
function emitChangeEvent(checked, e) {
|
|
18192
|
+
emit("change", getLabeledValue(checked), e);
|
|
18193
|
+
}
|
|
18194
|
+
function handleChange(e) {
|
|
18195
|
+
if (isLimitExceeded.value)
|
|
18196
|
+
return;
|
|
18197
|
+
const target = e.target;
|
|
18198
|
+
emit("change", getLabeledValue(target.checked), e);
|
|
18199
|
+
}
|
|
18200
|
+
async function onClickRoot(e) {
|
|
18201
|
+
if (isLimitExceeded.value)
|
|
18202
|
+
return;
|
|
18203
|
+
if (!hasOwnLabel.value && !isDisabled.value && isLabeledByFormItem.value) {
|
|
18204
|
+
const eventTargets = e.composedPath();
|
|
18205
|
+
const hasLabel = eventTargets.some((item) => item.tagName === "LABEL");
|
|
18206
|
+
if (!hasLabel) {
|
|
18207
|
+
model.value = getLabeledValue([false, props.falseValue, props.falseLabel].includes(model.value));
|
|
18208
|
+
await nextTick();
|
|
18209
|
+
emitChangeEvent(model.value, e);
|
|
18210
|
+
}
|
|
18211
|
+
}
|
|
18212
|
+
}
|
|
18213
|
+
const validateEvent = computed(() => (checkboxGroup == null ? void 0 : checkboxGroup.validateEvent) || props.validateEvent);
|
|
18214
|
+
watch(() => props.modelValue, () => {
|
|
18215
|
+
if (validateEvent.value) {
|
|
18216
|
+
formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
|
|
18217
|
+
}
|
|
18218
|
+
});
|
|
18219
|
+
return {
|
|
18220
|
+
handleChange,
|
|
18221
|
+
onClickRoot
|
|
18222
|
+
};
|
|
18223
|
+
};
|
|
18224
|
+
|
|
18225
|
+
const useCheckboxModel = (props) => {
|
|
18226
|
+
const selfModel = ref(false);
|
|
18227
|
+
const { emit } = getCurrentInstance();
|
|
18228
|
+
const checkboxGroup = inject(checkboxGroupContextKey, void 0);
|
|
18229
|
+
const isGroup = computed(() => isUndefined(checkboxGroup) === false);
|
|
18230
|
+
const isLimitExceeded = ref(false);
|
|
18231
|
+
const model = computed({
|
|
18232
|
+
get() {
|
|
18233
|
+
var _a, _b;
|
|
18234
|
+
return isGroup.value ? (_a = checkboxGroup == null ? void 0 : checkboxGroup.modelValue) == null ? void 0 : _a.value : (_b = props.modelValue) != null ? _b : selfModel.value;
|
|
18235
|
+
},
|
|
18236
|
+
set(val) {
|
|
18237
|
+
var _a, _b;
|
|
18238
|
+
if (isGroup.value && isArray$1(val)) {
|
|
18239
|
+
isLimitExceeded.value = ((_a = checkboxGroup == null ? void 0 : checkboxGroup.max) == null ? void 0 : _a.value) !== void 0 && val.length > (checkboxGroup == null ? void 0 : checkboxGroup.max.value) && val.length > model.value.length;
|
|
18240
|
+
isLimitExceeded.value === false && ((_b = checkboxGroup == null ? void 0 : checkboxGroup.changeEvent) == null ? void 0 : _b.call(checkboxGroup, val));
|
|
18241
|
+
} else {
|
|
18242
|
+
emit(UPDATE_MODEL_EVENT, val);
|
|
18243
|
+
selfModel.value = val;
|
|
18244
|
+
}
|
|
18245
|
+
}
|
|
18246
|
+
});
|
|
18247
|
+
return {
|
|
18248
|
+
model,
|
|
18249
|
+
isGroup,
|
|
18250
|
+
isLimitExceeded
|
|
18251
|
+
};
|
|
18252
|
+
};
|
|
18253
|
+
|
|
18254
|
+
const useCheckboxStatus = (props, slots, { model }) => {
|
|
18255
|
+
const checkboxGroup = inject(checkboxGroupContextKey, void 0);
|
|
18256
|
+
const isFocused = ref(false);
|
|
18257
|
+
const actualValue = computed(() => {
|
|
18258
|
+
if (!isPropAbsent(props.value)) {
|
|
18259
|
+
return props.value;
|
|
18260
|
+
}
|
|
18261
|
+
return props.label;
|
|
18262
|
+
});
|
|
18263
|
+
const isChecked = computed(() => {
|
|
18264
|
+
const value = model.value;
|
|
18265
|
+
if (isBoolean(value)) {
|
|
18266
|
+
return value;
|
|
18267
|
+
} else if (isArray$1(value)) {
|
|
18268
|
+
if (isObject$1(actualValue.value)) {
|
|
18269
|
+
return value.map(toRaw).some((o) => isEqual$1(o, actualValue.value));
|
|
18270
|
+
} else {
|
|
18271
|
+
return value.map(toRaw).includes(actualValue.value);
|
|
18272
|
+
}
|
|
18273
|
+
} else if (value !== null && value !== void 0) {
|
|
18274
|
+
return value === props.trueValue || value === props.trueLabel;
|
|
18275
|
+
} else {
|
|
18276
|
+
return !!value;
|
|
18277
|
+
}
|
|
18278
|
+
});
|
|
18279
|
+
const checkboxButtonSize = useFormSize(computed(() => {
|
|
18280
|
+
var _a;
|
|
18281
|
+
return (_a = checkboxGroup == null ? void 0 : checkboxGroup.size) == null ? void 0 : _a.value;
|
|
18282
|
+
}), {
|
|
18283
|
+
prop: true
|
|
18284
|
+
});
|
|
18285
|
+
const checkboxSize = useFormSize(computed(() => {
|
|
18286
|
+
var _a;
|
|
18287
|
+
return (_a = checkboxGroup == null ? void 0 : checkboxGroup.size) == null ? void 0 : _a.value;
|
|
18288
|
+
}));
|
|
18289
|
+
const hasOwnLabel = computed(() => {
|
|
18290
|
+
return !!slots.default || !isPropAbsent(actualValue.value);
|
|
18291
|
+
});
|
|
18292
|
+
return {
|
|
18293
|
+
checkboxButtonSize,
|
|
18294
|
+
isChecked,
|
|
18295
|
+
isFocused,
|
|
18296
|
+
checkboxSize,
|
|
18297
|
+
hasOwnLabel,
|
|
18298
|
+
actualValue
|
|
18299
|
+
};
|
|
18300
|
+
};
|
|
18301
|
+
|
|
18302
|
+
const useCheckbox = (props, slots) => {
|
|
18303
|
+
const { formItem: elFormItem } = useFormItem();
|
|
18304
|
+
const { model, isGroup, isLimitExceeded } = useCheckboxModel(props);
|
|
18305
|
+
const {
|
|
18306
|
+
isFocused,
|
|
18307
|
+
isChecked,
|
|
18308
|
+
checkboxButtonSize,
|
|
18309
|
+
checkboxSize,
|
|
18310
|
+
hasOwnLabel,
|
|
18311
|
+
actualValue
|
|
18312
|
+
} = useCheckboxStatus(props, slots, { model });
|
|
18313
|
+
const { isDisabled } = useCheckboxDisabled({ model, isChecked });
|
|
18314
|
+
const { inputId, isLabeledByFormItem } = useFormItemInputId(props, {
|
|
18315
|
+
formItemContext: elFormItem,
|
|
18316
|
+
disableIdGeneration: hasOwnLabel,
|
|
18317
|
+
disableIdManagement: isGroup
|
|
18318
|
+
});
|
|
18319
|
+
const { handleChange, onClickRoot } = useCheckboxEvent(props, {
|
|
18320
|
+
model,
|
|
18321
|
+
isLimitExceeded,
|
|
18322
|
+
hasOwnLabel,
|
|
18323
|
+
isDisabled,
|
|
18324
|
+
isLabeledByFormItem
|
|
18325
|
+
});
|
|
18326
|
+
const setStoreValue = () => {
|
|
18327
|
+
function addToStore() {
|
|
18328
|
+
var _a, _b;
|
|
18329
|
+
if (isArray$1(model.value) && !model.value.includes(actualValue.value)) {
|
|
18330
|
+
model.value.push(actualValue.value);
|
|
18331
|
+
} else {
|
|
18332
|
+
model.value = (_b = (_a = props.trueValue) != null ? _a : props.trueLabel) != null ? _b : true;
|
|
18333
|
+
}
|
|
18334
|
+
}
|
|
18335
|
+
props.checked && addToStore();
|
|
18336
|
+
};
|
|
18337
|
+
setStoreValue();
|
|
18338
|
+
useDeprecated({
|
|
18339
|
+
from: "label act as value",
|
|
18340
|
+
replacement: "value",
|
|
18341
|
+
version: "3.0.0",
|
|
18342
|
+
scope: "el-checkbox",
|
|
18343
|
+
ref: "https://element-plus.org/en-US/component/checkbox.html"
|
|
18344
|
+
}, computed(() => isGroup.value && isPropAbsent(props.value)));
|
|
18345
|
+
useDeprecated({
|
|
18346
|
+
from: "true-label",
|
|
18347
|
+
replacement: "true-value",
|
|
18348
|
+
version: "3.0.0",
|
|
18349
|
+
scope: "el-checkbox",
|
|
18350
|
+
ref: "https://element-plus.org/en-US/component/checkbox.html"
|
|
18351
|
+
}, computed(() => !!props.trueLabel));
|
|
18352
|
+
useDeprecated({
|
|
18353
|
+
from: "false-label",
|
|
18354
|
+
replacement: "false-value",
|
|
18355
|
+
version: "3.0.0",
|
|
18356
|
+
scope: "el-checkbox",
|
|
18357
|
+
ref: "https://element-plus.org/en-US/component/checkbox.html"
|
|
18358
|
+
}, computed(() => !!props.falseLabel));
|
|
18359
|
+
return {
|
|
18360
|
+
inputId,
|
|
18361
|
+
isLabeledByFormItem,
|
|
18362
|
+
isChecked,
|
|
18363
|
+
isDisabled,
|
|
18364
|
+
isFocused,
|
|
18365
|
+
checkboxButtonSize,
|
|
18366
|
+
checkboxSize,
|
|
18367
|
+
hasOwnLabel,
|
|
18368
|
+
model,
|
|
18369
|
+
actualValue,
|
|
18370
|
+
handleChange,
|
|
18371
|
+
onClickRoot
|
|
18372
|
+
};
|
|
18373
|
+
};
|
|
18374
|
+
|
|
18375
|
+
const __default__$p = defineComponent({
|
|
18376
|
+
name: "ElCheckbox"
|
|
18084
18377
|
});
|
|
18085
|
-
const _sfc_main$
|
|
18086
|
-
...__default__$
|
|
18087
|
-
props:
|
|
18088
|
-
emits:
|
|
18089
|
-
setup(__props
|
|
18378
|
+
const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
18379
|
+
...__default__$p,
|
|
18380
|
+
props: checkboxProps,
|
|
18381
|
+
emits: checkboxEmits,
|
|
18382
|
+
setup(__props) {
|
|
18090
18383
|
const props = __props;
|
|
18091
|
-
const
|
|
18092
|
-
const
|
|
18093
|
-
|
|
18094
|
-
|
|
18384
|
+
const slots = useSlots();
|
|
18385
|
+
const {
|
|
18386
|
+
inputId,
|
|
18387
|
+
isLabeledByFormItem,
|
|
18388
|
+
isChecked,
|
|
18389
|
+
isDisabled,
|
|
18390
|
+
isFocused,
|
|
18391
|
+
checkboxSize,
|
|
18392
|
+
hasOwnLabel,
|
|
18393
|
+
model,
|
|
18394
|
+
actualValue,
|
|
18395
|
+
handleChange,
|
|
18396
|
+
onClickRoot
|
|
18397
|
+
} = useCheckbox(props, slots);
|
|
18398
|
+
const ns = useNamespace("checkbox");
|
|
18399
|
+
const compKls = computed(() => {
|
|
18095
18400
|
return [
|
|
18096
18401
|
ns.b(),
|
|
18097
|
-
ns.
|
|
18098
|
-
ns.
|
|
18099
|
-
ns.
|
|
18100
|
-
ns.
|
|
18101
|
-
|
|
18102
|
-
|
|
18402
|
+
ns.m(checkboxSize.value),
|
|
18403
|
+
ns.is("disabled", isDisabled.value),
|
|
18404
|
+
ns.is("bordered", props.border),
|
|
18405
|
+
ns.is("checked", isChecked.value)
|
|
18406
|
+
];
|
|
18407
|
+
});
|
|
18408
|
+
const spanKls = computed(() => {
|
|
18409
|
+
return [
|
|
18410
|
+
ns.e("input"),
|
|
18411
|
+
ns.is("disabled", isDisabled.value),
|
|
18412
|
+
ns.is("checked", isChecked.value),
|
|
18413
|
+
ns.is("indeterminate", props.indeterminate),
|
|
18414
|
+
ns.is("focus", isFocused.value)
|
|
18103
18415
|
];
|
|
18104
18416
|
});
|
|
18105
|
-
const handleClose = (event) => {
|
|
18106
|
-
emit("close", event);
|
|
18107
|
-
};
|
|
18108
|
-
const handleClick = (event) => {
|
|
18109
|
-
emit("click", event);
|
|
18110
|
-
};
|
|
18111
|
-
const handleVNodeMounted = (vnode) => {
|
|
18112
|
-
var _a, _b, _c;
|
|
18113
|
-
if ((_c = (_b = (_a = vnode == null ? void 0 : vnode.component) == null ? void 0 : _a.subTree) == null ? void 0 : _b.component) == null ? void 0 : _c.bum) {
|
|
18114
|
-
vnode.component.subTree.component.bum = null;
|
|
18115
|
-
}
|
|
18116
|
-
};
|
|
18117
18417
|
return (_ctx, _cache) => {
|
|
18118
|
-
return
|
|
18119
|
-
|
|
18120
|
-
|
|
18121
|
-
|
|
18122
|
-
|
|
18123
|
-
|
|
18124
|
-
|
|
18125
|
-
|
|
18126
|
-
|
|
18127
|
-
|
|
18128
|
-
|
|
18129
|
-
|
|
18130
|
-
|
|
18131
|
-
|
|
18418
|
+
return openBlock(), createBlock(resolveDynamicComponent(!unref(hasOwnLabel) && unref(isLabeledByFormItem) ? "span" : "label"), {
|
|
18419
|
+
class: normalizeClass(unref(compKls)),
|
|
18420
|
+
"aria-controls": _ctx.indeterminate ? _ctx.ariaControls : null,
|
|
18421
|
+
onClick: unref(onClickRoot)
|
|
18422
|
+
}, {
|
|
18423
|
+
default: withCtx(() => {
|
|
18424
|
+
var _a, _b, _c, _d;
|
|
18425
|
+
return [
|
|
18426
|
+
createElementVNode("span", {
|
|
18427
|
+
class: normalizeClass(unref(spanKls))
|
|
18428
|
+
}, [
|
|
18429
|
+
_ctx.trueValue || _ctx.falseValue || _ctx.trueLabel || _ctx.falseLabel ? withDirectives((openBlock(), createElementBlock("input", {
|
|
18430
|
+
key: 0,
|
|
18431
|
+
id: unref(inputId),
|
|
18432
|
+
"onUpdate:modelValue": ($event) => isRef(model) ? model.value = $event : null,
|
|
18433
|
+
class: normalizeClass(unref(ns).e("original")),
|
|
18434
|
+
type: "checkbox",
|
|
18435
|
+
indeterminate: _ctx.indeterminate,
|
|
18436
|
+
name: _ctx.name,
|
|
18437
|
+
tabindex: _ctx.tabindex,
|
|
18438
|
+
disabled: unref(isDisabled),
|
|
18439
|
+
"true-value": (_b = (_a = _ctx.trueValue) != null ? _a : _ctx.trueLabel) != null ? _b : true,
|
|
18440
|
+
"false-value": (_d = (_c = _ctx.falseValue) != null ? _c : _ctx.falseLabel) != null ? _d : false,
|
|
18441
|
+
onChange: unref(handleChange),
|
|
18442
|
+
onFocus: ($event) => isFocused.value = true,
|
|
18443
|
+
onBlur: ($event) => isFocused.value = false,
|
|
18444
|
+
onClick: withModifiers(() => {
|
|
18445
|
+
}, ["stop"])
|
|
18446
|
+
}, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [
|
|
18447
|
+
[vModelCheckbox, unref(model)]
|
|
18448
|
+
]) : withDirectives((openBlock(), createElementBlock("input", {
|
|
18449
|
+
key: 1,
|
|
18450
|
+
id: unref(inputId),
|
|
18451
|
+
"onUpdate:modelValue": ($event) => isRef(model) ? model.value = $event : null,
|
|
18452
|
+
class: normalizeClass(unref(ns).e("original")),
|
|
18453
|
+
type: "checkbox",
|
|
18454
|
+
indeterminate: _ctx.indeterminate,
|
|
18455
|
+
disabled: unref(isDisabled),
|
|
18456
|
+
value: unref(actualValue),
|
|
18457
|
+
name: _ctx.name,
|
|
18458
|
+
tabindex: _ctx.tabindex,
|
|
18459
|
+
onChange: unref(handleChange),
|
|
18460
|
+
onFocus: ($event) => isFocused.value = true,
|
|
18461
|
+
onBlur: ($event) => isFocused.value = false,
|
|
18462
|
+
onClick: withModifiers(() => {
|
|
18463
|
+
}, ["stop"])
|
|
18464
|
+
}, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "disabled", "value", "name", "tabindex", "onChange", "onFocus", "onBlur", "onClick"])), [
|
|
18465
|
+
[vModelCheckbox, unref(model)]
|
|
18466
|
+
]),
|
|
18467
|
+
createElementVNode("span", {
|
|
18468
|
+
class: normalizeClass(unref(ns).e("inner"))
|
|
18469
|
+
}, null, 2)
|
|
18470
|
+
], 2),
|
|
18471
|
+
unref(hasOwnLabel) ? (openBlock(), createElementBlock("span", {
|
|
18472
|
+
key: 0,
|
|
18473
|
+
class: normalizeClass(unref(ns).e("label"))
|
|
18474
|
+
}, [
|
|
18475
|
+
renderSlot(_ctx.$slots, "default"),
|
|
18476
|
+
!_ctx.$slots.default ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
18477
|
+
createTextVNode(toDisplayString(_ctx.label), 1)
|
|
18478
|
+
], 64)) : createCommentVNode("v-if", true)
|
|
18479
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
18480
|
+
];
|
|
18481
|
+
}),
|
|
18482
|
+
_: 3
|
|
18483
|
+
}, 8, ["class", "aria-controls", "onClick"]);
|
|
18484
|
+
};
|
|
18485
|
+
}
|
|
18486
|
+
});
|
|
18487
|
+
var Checkbox = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__file", "checkbox.vue"]]);
|
|
18488
|
+
|
|
18489
|
+
const __default__$o = defineComponent({
|
|
18490
|
+
name: "ElCheckboxButton"
|
|
18491
|
+
});
|
|
18492
|
+
const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
18493
|
+
...__default__$o,
|
|
18494
|
+
props: checkboxProps,
|
|
18495
|
+
emits: checkboxEmits,
|
|
18496
|
+
setup(__props) {
|
|
18497
|
+
const props = __props;
|
|
18498
|
+
const slots = useSlots();
|
|
18499
|
+
const {
|
|
18500
|
+
isFocused,
|
|
18501
|
+
isChecked,
|
|
18502
|
+
isDisabled,
|
|
18503
|
+
checkboxButtonSize,
|
|
18504
|
+
model,
|
|
18505
|
+
actualValue,
|
|
18506
|
+
handleChange
|
|
18507
|
+
} = useCheckbox(props, slots);
|
|
18508
|
+
const checkboxGroup = inject(checkboxGroupContextKey, void 0);
|
|
18509
|
+
const ns = useNamespace("checkbox");
|
|
18510
|
+
const activeStyle = computed(() => {
|
|
18511
|
+
var _a, _b, _c, _d;
|
|
18512
|
+
const fillValue = (_b = (_a = checkboxGroup == null ? void 0 : checkboxGroup.fill) == null ? void 0 : _a.value) != null ? _b : "";
|
|
18513
|
+
return {
|
|
18514
|
+
backgroundColor: fillValue,
|
|
18515
|
+
borderColor: fillValue,
|
|
18516
|
+
color: (_d = (_c = checkboxGroup == null ? void 0 : checkboxGroup.textColor) == null ? void 0 : _c.value) != null ? _d : "",
|
|
18517
|
+
boxShadow: fillValue ? `-1px 0 0 0 ${fillValue}` : void 0
|
|
18518
|
+
};
|
|
18519
|
+
});
|
|
18520
|
+
const labelKls = computed(() => {
|
|
18521
|
+
return [
|
|
18522
|
+
ns.b("button"),
|
|
18523
|
+
ns.bm("button", checkboxButtonSize.value),
|
|
18524
|
+
ns.is("disabled", isDisabled.value),
|
|
18525
|
+
ns.is("checked", isChecked.value),
|
|
18526
|
+
ns.is("focus", isFocused.value)
|
|
18527
|
+
];
|
|
18528
|
+
});
|
|
18529
|
+
return (_ctx, _cache) => {
|
|
18530
|
+
var _a, _b, _c, _d;
|
|
18531
|
+
return openBlock(), createElementBlock("label", {
|
|
18532
|
+
class: normalizeClass(unref(labelKls))
|
|
18533
|
+
}, [
|
|
18534
|
+
_ctx.trueValue || _ctx.falseValue || _ctx.trueLabel || _ctx.falseLabel ? withDirectives((openBlock(), createElementBlock("input", {
|
|
18535
|
+
key: 0,
|
|
18536
|
+
"onUpdate:modelValue": ($event) => isRef(model) ? model.value = $event : null,
|
|
18537
|
+
class: normalizeClass(unref(ns).be("button", "original")),
|
|
18538
|
+
type: "checkbox",
|
|
18539
|
+
name: _ctx.name,
|
|
18540
|
+
tabindex: _ctx.tabindex,
|
|
18541
|
+
disabled: unref(isDisabled),
|
|
18542
|
+
"true-value": (_b = (_a = _ctx.trueValue) != null ? _a : _ctx.trueLabel) != null ? _b : true,
|
|
18543
|
+
"false-value": (_d = (_c = _ctx.falseValue) != null ? _c : _ctx.falseLabel) != null ? _d : false,
|
|
18544
|
+
onChange: unref(handleChange),
|
|
18545
|
+
onFocus: ($event) => isFocused.value = true,
|
|
18546
|
+
onBlur: ($event) => isFocused.value = false,
|
|
18547
|
+
onClick: withModifiers(() => {
|
|
18548
|
+
}, ["stop"])
|
|
18549
|
+
}, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [
|
|
18550
|
+
[vModelCheckbox, unref(model)]
|
|
18551
|
+
]) : withDirectives((openBlock(), createElementBlock("input", {
|
|
18552
|
+
key: 1,
|
|
18553
|
+
"onUpdate:modelValue": ($event) => isRef(model) ? model.value = $event : null,
|
|
18554
|
+
class: normalizeClass(unref(ns).be("button", "original")),
|
|
18555
|
+
type: "checkbox",
|
|
18556
|
+
name: _ctx.name,
|
|
18557
|
+
tabindex: _ctx.tabindex,
|
|
18558
|
+
disabled: unref(isDisabled),
|
|
18559
|
+
value: unref(actualValue),
|
|
18560
|
+
onChange: unref(handleChange),
|
|
18561
|
+
onFocus: ($event) => isFocused.value = true,
|
|
18562
|
+
onBlur: ($event) => isFocused.value = false,
|
|
18563
|
+
onClick: withModifiers(() => {
|
|
18564
|
+
}, ["stop"])
|
|
18565
|
+
}, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "value", "onChange", "onFocus", "onBlur", "onClick"])), [
|
|
18566
|
+
[vModelCheckbox, unref(model)]
|
|
18567
|
+
]),
|
|
18568
|
+
_ctx.$slots.default || _ctx.label ? (openBlock(), createElementBlock("span", {
|
|
18569
|
+
key: 2,
|
|
18570
|
+
class: normalizeClass(unref(ns).be("button", "inner")),
|
|
18571
|
+
style: normalizeStyle(unref(isChecked) ? unref(activeStyle) : void 0)
|
|
18572
|
+
}, [
|
|
18573
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
18574
|
+
createTextVNode(toDisplayString(_ctx.label), 1)
|
|
18575
|
+
])
|
|
18576
|
+
], 6)) : createCommentVNode("v-if", true)
|
|
18577
|
+
], 2);
|
|
18578
|
+
};
|
|
18579
|
+
}
|
|
18580
|
+
});
|
|
18581
|
+
var CheckboxButton = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__file", "checkbox-button.vue"]]);
|
|
18582
|
+
|
|
18583
|
+
const checkboxGroupProps = buildProps({
|
|
18584
|
+
modelValue: {
|
|
18585
|
+
type: definePropType(Array),
|
|
18586
|
+
default: () => []
|
|
18587
|
+
},
|
|
18588
|
+
disabled: Boolean,
|
|
18589
|
+
min: Number,
|
|
18590
|
+
max: Number,
|
|
18591
|
+
size: useSizeProp,
|
|
18592
|
+
fill: String,
|
|
18593
|
+
textColor: String,
|
|
18594
|
+
tag: {
|
|
18595
|
+
type: String,
|
|
18596
|
+
default: "div"
|
|
18597
|
+
},
|
|
18598
|
+
validateEvent: {
|
|
18599
|
+
type: Boolean,
|
|
18600
|
+
default: true
|
|
18601
|
+
},
|
|
18602
|
+
...useAriaProps(["ariaLabel"])
|
|
18603
|
+
});
|
|
18604
|
+
const checkboxGroupEmits = {
|
|
18605
|
+
[UPDATE_MODEL_EVENT]: (val) => isArray$1(val),
|
|
18606
|
+
change: (val) => isArray$1(val)
|
|
18607
|
+
};
|
|
18608
|
+
|
|
18609
|
+
const __default__$n = defineComponent({
|
|
18610
|
+
name: "ElCheckboxGroup"
|
|
18611
|
+
});
|
|
18612
|
+
const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
18613
|
+
...__default__$n,
|
|
18614
|
+
props: checkboxGroupProps,
|
|
18615
|
+
emits: checkboxGroupEmits,
|
|
18616
|
+
setup(__props, { emit }) {
|
|
18617
|
+
const props = __props;
|
|
18618
|
+
const ns = useNamespace("checkbox");
|
|
18619
|
+
const { formItem } = useFormItem();
|
|
18620
|
+
const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props, {
|
|
18621
|
+
formItemContext: formItem
|
|
18622
|
+
});
|
|
18623
|
+
const changeEvent = async (value) => {
|
|
18624
|
+
emit(UPDATE_MODEL_EVENT, value);
|
|
18625
|
+
await nextTick();
|
|
18626
|
+
emit("change", value);
|
|
18627
|
+
};
|
|
18628
|
+
const modelValue = computed({
|
|
18629
|
+
get() {
|
|
18630
|
+
return props.modelValue;
|
|
18631
|
+
},
|
|
18632
|
+
set(val) {
|
|
18633
|
+
changeEvent(val);
|
|
18634
|
+
}
|
|
18635
|
+
});
|
|
18636
|
+
provide(checkboxGroupContextKey, {
|
|
18637
|
+
...pick(toRefs(props), [
|
|
18638
|
+
"size",
|
|
18639
|
+
"min",
|
|
18640
|
+
"max",
|
|
18641
|
+
"disabled",
|
|
18642
|
+
"validateEvent",
|
|
18643
|
+
"fill",
|
|
18644
|
+
"textColor"
|
|
18645
|
+
]),
|
|
18646
|
+
modelValue,
|
|
18647
|
+
changeEvent
|
|
18648
|
+
});
|
|
18649
|
+
watch(() => props.modelValue, () => {
|
|
18650
|
+
if (props.validateEvent) {
|
|
18651
|
+
formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
|
|
18652
|
+
}
|
|
18653
|
+
});
|
|
18654
|
+
return (_ctx, _cache) => {
|
|
18655
|
+
var _a;
|
|
18656
|
+
return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
|
|
18657
|
+
id: unref(groupId),
|
|
18658
|
+
class: normalizeClass(unref(ns).b("group")),
|
|
18659
|
+
role: "group",
|
|
18660
|
+
"aria-label": !unref(isLabeledByFormItem) ? _ctx.ariaLabel || "checkbox-group" : void 0,
|
|
18661
|
+
"aria-labelledby": unref(isLabeledByFormItem) ? (_a = unref(formItem)) == null ? void 0 : _a.labelId : void 0
|
|
18662
|
+
}, {
|
|
18663
|
+
default: withCtx(() => [
|
|
18664
|
+
renderSlot(_ctx.$slots, "default")
|
|
18665
|
+
]),
|
|
18666
|
+
_: 3
|
|
18667
|
+
}, 8, ["id", "class", "aria-label", "aria-labelledby"]);
|
|
18668
|
+
};
|
|
18669
|
+
}
|
|
18670
|
+
});
|
|
18671
|
+
var CheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__file", "checkbox-group.vue"]]);
|
|
18672
|
+
|
|
18673
|
+
const ElCheckbox = withInstall(Checkbox, {
|
|
18674
|
+
CheckboxButton,
|
|
18675
|
+
CheckboxGroup
|
|
18676
|
+
});
|
|
18677
|
+
withNoopInstall(CheckboxButton);
|
|
18678
|
+
withNoopInstall(CheckboxGroup);
|
|
18679
|
+
|
|
18680
|
+
const radioPropsBase = buildProps({
|
|
18681
|
+
modelValue: {
|
|
18682
|
+
type: [String, Number, Boolean],
|
|
18683
|
+
default: void 0
|
|
18684
|
+
},
|
|
18685
|
+
size: useSizeProp,
|
|
18686
|
+
disabled: Boolean,
|
|
18687
|
+
label: {
|
|
18688
|
+
type: [String, Number, Boolean],
|
|
18689
|
+
default: void 0
|
|
18690
|
+
},
|
|
18691
|
+
value: {
|
|
18692
|
+
type: [String, Number, Boolean],
|
|
18693
|
+
default: void 0
|
|
18694
|
+
},
|
|
18695
|
+
name: {
|
|
18696
|
+
type: String,
|
|
18697
|
+
default: void 0
|
|
18698
|
+
}
|
|
18699
|
+
});
|
|
18700
|
+
const radioProps = buildProps({
|
|
18701
|
+
...radioPropsBase,
|
|
18702
|
+
border: Boolean
|
|
18703
|
+
});
|
|
18704
|
+
const radioEmits = {
|
|
18705
|
+
[UPDATE_MODEL_EVENT]: (val) => isString$1(val) || isNumber(val) || isBoolean(val),
|
|
18706
|
+
[CHANGE_EVENT]: (val) => isString$1(val) || isNumber(val) || isBoolean(val)
|
|
18707
|
+
};
|
|
18708
|
+
|
|
18709
|
+
const radioGroupKey = Symbol("radioGroupKey");
|
|
18710
|
+
|
|
18711
|
+
const useRadio = (props, emit) => {
|
|
18712
|
+
const radioRef = ref();
|
|
18713
|
+
const radioGroup = inject(radioGroupKey, void 0);
|
|
18714
|
+
const isGroup = computed(() => !!radioGroup);
|
|
18715
|
+
const actualValue = computed(() => {
|
|
18716
|
+
if (!isPropAbsent(props.value)) {
|
|
18717
|
+
return props.value;
|
|
18718
|
+
}
|
|
18719
|
+
return props.label;
|
|
18720
|
+
});
|
|
18721
|
+
const modelValue = computed({
|
|
18722
|
+
get() {
|
|
18723
|
+
return isGroup.value ? radioGroup.modelValue : props.modelValue;
|
|
18724
|
+
},
|
|
18725
|
+
set(val) {
|
|
18726
|
+
if (isGroup.value) {
|
|
18727
|
+
radioGroup.changeEvent(val);
|
|
18728
|
+
} else {
|
|
18729
|
+
emit && emit(UPDATE_MODEL_EVENT, val);
|
|
18730
|
+
}
|
|
18731
|
+
radioRef.value.checked = props.modelValue === actualValue.value;
|
|
18732
|
+
}
|
|
18733
|
+
});
|
|
18734
|
+
const size = useFormSize(computed(() => radioGroup == null ? void 0 : radioGroup.size));
|
|
18735
|
+
const disabled = useFormDisabled(computed(() => radioGroup == null ? void 0 : radioGroup.disabled));
|
|
18736
|
+
const focus = ref(false);
|
|
18737
|
+
const tabIndex = computed(() => {
|
|
18738
|
+
return disabled.value || isGroup.value && modelValue.value !== actualValue.value ? -1 : 0;
|
|
18739
|
+
});
|
|
18740
|
+
useDeprecated({
|
|
18741
|
+
from: "label act as value",
|
|
18742
|
+
replacement: "value",
|
|
18743
|
+
version: "3.0.0",
|
|
18744
|
+
scope: "el-radio",
|
|
18745
|
+
ref: "https://element-plus.org/en-US/component/radio.html"
|
|
18746
|
+
}, computed(() => isGroup.value && isPropAbsent(props.value)));
|
|
18747
|
+
return {
|
|
18748
|
+
radioRef,
|
|
18749
|
+
isGroup,
|
|
18750
|
+
radioGroup,
|
|
18751
|
+
focus,
|
|
18752
|
+
size,
|
|
18753
|
+
disabled,
|
|
18754
|
+
tabIndex,
|
|
18755
|
+
modelValue,
|
|
18756
|
+
actualValue
|
|
18757
|
+
};
|
|
18758
|
+
};
|
|
18759
|
+
|
|
18760
|
+
const __default__$m = defineComponent({
|
|
18761
|
+
name: "ElRadio"
|
|
18762
|
+
});
|
|
18763
|
+
const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
18764
|
+
...__default__$m,
|
|
18765
|
+
props: radioProps,
|
|
18766
|
+
emits: radioEmits,
|
|
18767
|
+
setup(__props, { emit }) {
|
|
18768
|
+
const props = __props;
|
|
18769
|
+
const ns = useNamespace("radio");
|
|
18770
|
+
const { radioRef, radioGroup, focus, size, disabled, modelValue, actualValue } = useRadio(props, emit);
|
|
18771
|
+
function handleChange() {
|
|
18772
|
+
nextTick(() => emit("change", modelValue.value));
|
|
18773
|
+
}
|
|
18774
|
+
return (_ctx, _cache) => {
|
|
18775
|
+
var _a;
|
|
18776
|
+
return openBlock(), createElementBlock("label", {
|
|
18777
|
+
class: normalizeClass([
|
|
18778
|
+
unref(ns).b(),
|
|
18779
|
+
unref(ns).is("disabled", unref(disabled)),
|
|
18780
|
+
unref(ns).is("focus", unref(focus)),
|
|
18781
|
+
unref(ns).is("bordered", _ctx.border),
|
|
18782
|
+
unref(ns).is("checked", unref(modelValue) === unref(actualValue)),
|
|
18783
|
+
unref(ns).m(unref(size))
|
|
18784
|
+
])
|
|
18785
|
+
}, [
|
|
18786
|
+
createElementVNode("span", {
|
|
18787
|
+
class: normalizeClass([
|
|
18788
|
+
unref(ns).e("input"),
|
|
18789
|
+
unref(ns).is("disabled", unref(disabled)),
|
|
18790
|
+
unref(ns).is("checked", unref(modelValue) === unref(actualValue))
|
|
18791
|
+
])
|
|
18792
|
+
}, [
|
|
18793
|
+
withDirectives(createElementVNode("input", {
|
|
18794
|
+
ref_key: "radioRef",
|
|
18795
|
+
ref: radioRef,
|
|
18796
|
+
"onUpdate:modelValue": ($event) => isRef(modelValue) ? modelValue.value = $event : null,
|
|
18797
|
+
class: normalizeClass(unref(ns).e("original")),
|
|
18798
|
+
value: unref(actualValue),
|
|
18799
|
+
name: _ctx.name || ((_a = unref(radioGroup)) == null ? void 0 : _a.name),
|
|
18800
|
+
disabled: unref(disabled),
|
|
18801
|
+
checked: unref(modelValue) === unref(actualValue),
|
|
18802
|
+
type: "radio",
|
|
18803
|
+
onFocus: ($event) => focus.value = true,
|
|
18804
|
+
onBlur: ($event) => focus.value = false,
|
|
18805
|
+
onChange: handleChange,
|
|
18806
|
+
onClick: withModifiers(() => {
|
|
18807
|
+
}, ["stop"])
|
|
18808
|
+
}, null, 42, ["onUpdate:modelValue", "value", "name", "disabled", "checked", "onFocus", "onBlur", "onClick"]), [
|
|
18809
|
+
[vModelRadio, unref(modelValue)]
|
|
18810
|
+
]),
|
|
18811
|
+
createElementVNode("span", {
|
|
18812
|
+
class: normalizeClass(unref(ns).e("inner"))
|
|
18813
|
+
}, null, 2)
|
|
18814
|
+
], 2),
|
|
18815
|
+
createElementVNode("span", {
|
|
18816
|
+
class: normalizeClass(unref(ns).e("label")),
|
|
18817
|
+
onKeydown: withModifiers(() => {
|
|
18818
|
+
}, ["stop"])
|
|
18819
|
+
}, [
|
|
18820
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
18821
|
+
createTextVNode(toDisplayString(_ctx.label), 1)
|
|
18822
|
+
])
|
|
18823
|
+
], 42, ["onKeydown"])
|
|
18824
|
+
], 2);
|
|
18825
|
+
};
|
|
18826
|
+
}
|
|
18827
|
+
});
|
|
18828
|
+
var Radio = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__file", "radio.vue"]]);
|
|
18829
|
+
|
|
18830
|
+
const radioButtonProps = buildProps({
|
|
18831
|
+
...radioPropsBase
|
|
18832
|
+
});
|
|
18833
|
+
|
|
18834
|
+
const __default__$l = defineComponent({
|
|
18835
|
+
name: "ElRadioButton"
|
|
18836
|
+
});
|
|
18837
|
+
const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
18838
|
+
...__default__$l,
|
|
18839
|
+
props: radioButtonProps,
|
|
18840
|
+
setup(__props) {
|
|
18841
|
+
const props = __props;
|
|
18842
|
+
const ns = useNamespace("radio");
|
|
18843
|
+
const { radioRef, focus, size, disabled, modelValue, radioGroup, actualValue } = useRadio(props);
|
|
18844
|
+
const activeStyle = computed(() => {
|
|
18845
|
+
return {
|
|
18846
|
+
backgroundColor: (radioGroup == null ? void 0 : radioGroup.fill) || "",
|
|
18847
|
+
borderColor: (radioGroup == null ? void 0 : radioGroup.fill) || "",
|
|
18848
|
+
boxShadow: (radioGroup == null ? void 0 : radioGroup.fill) ? `-1px 0 0 0 ${radioGroup.fill}` : "",
|
|
18849
|
+
color: (radioGroup == null ? void 0 : radioGroup.textColor) || ""
|
|
18850
|
+
};
|
|
18851
|
+
});
|
|
18852
|
+
return (_ctx, _cache) => {
|
|
18853
|
+
var _a;
|
|
18854
|
+
return openBlock(), createElementBlock("label", {
|
|
18855
|
+
class: normalizeClass([
|
|
18856
|
+
unref(ns).b("button"),
|
|
18857
|
+
unref(ns).is("active", unref(modelValue) === unref(actualValue)),
|
|
18858
|
+
unref(ns).is("disabled", unref(disabled)),
|
|
18859
|
+
unref(ns).is("focus", unref(focus)),
|
|
18860
|
+
unref(ns).bm("button", unref(size))
|
|
18861
|
+
])
|
|
18862
|
+
}, [
|
|
18863
|
+
withDirectives(createElementVNode("input", {
|
|
18864
|
+
ref_key: "radioRef",
|
|
18865
|
+
ref: radioRef,
|
|
18866
|
+
"onUpdate:modelValue": ($event) => isRef(modelValue) ? modelValue.value = $event : null,
|
|
18867
|
+
class: normalizeClass(unref(ns).be("button", "original-radio")),
|
|
18868
|
+
value: unref(actualValue),
|
|
18869
|
+
type: "radio",
|
|
18870
|
+
name: _ctx.name || ((_a = unref(radioGroup)) == null ? void 0 : _a.name),
|
|
18871
|
+
disabled: unref(disabled),
|
|
18872
|
+
onFocus: ($event) => focus.value = true,
|
|
18873
|
+
onBlur: ($event) => focus.value = false,
|
|
18874
|
+
onClick: withModifiers(() => {
|
|
18875
|
+
}, ["stop"])
|
|
18876
|
+
}, null, 42, ["onUpdate:modelValue", "value", "name", "disabled", "onFocus", "onBlur", "onClick"]), [
|
|
18877
|
+
[vModelRadio, unref(modelValue)]
|
|
18878
|
+
]),
|
|
18879
|
+
createElementVNode("span", {
|
|
18880
|
+
class: normalizeClass(unref(ns).be("button", "inner")),
|
|
18881
|
+
style: normalizeStyle(unref(modelValue) === unref(actualValue) ? unref(activeStyle) : {}),
|
|
18882
|
+
onKeydown: withModifiers(() => {
|
|
18883
|
+
}, ["stop"])
|
|
18884
|
+
}, [
|
|
18885
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
18886
|
+
createTextVNode(toDisplayString(_ctx.label), 1)
|
|
18887
|
+
])
|
|
18888
|
+
], 46, ["onKeydown"])
|
|
18889
|
+
], 2);
|
|
18890
|
+
};
|
|
18891
|
+
}
|
|
18892
|
+
});
|
|
18893
|
+
var RadioButton = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__file", "radio-button.vue"]]);
|
|
18894
|
+
|
|
18895
|
+
const radioGroupProps = buildProps({
|
|
18896
|
+
id: {
|
|
18897
|
+
type: String,
|
|
18898
|
+
default: void 0
|
|
18899
|
+
},
|
|
18900
|
+
size: useSizeProp,
|
|
18901
|
+
disabled: Boolean,
|
|
18902
|
+
modelValue: {
|
|
18903
|
+
type: [String, Number, Boolean],
|
|
18904
|
+
default: void 0
|
|
18905
|
+
},
|
|
18906
|
+
fill: {
|
|
18907
|
+
type: String,
|
|
18908
|
+
default: ""
|
|
18909
|
+
},
|
|
18910
|
+
textColor: {
|
|
18911
|
+
type: String,
|
|
18912
|
+
default: ""
|
|
18913
|
+
},
|
|
18914
|
+
name: {
|
|
18915
|
+
type: String,
|
|
18916
|
+
default: void 0
|
|
18917
|
+
},
|
|
18918
|
+
validateEvent: {
|
|
18919
|
+
type: Boolean,
|
|
18920
|
+
default: true
|
|
18921
|
+
},
|
|
18922
|
+
...useAriaProps(["ariaLabel"])
|
|
18923
|
+
});
|
|
18924
|
+
const radioGroupEmits = radioEmits;
|
|
18925
|
+
|
|
18926
|
+
const __default__$k = defineComponent({
|
|
18927
|
+
name: "ElRadioGroup"
|
|
18928
|
+
});
|
|
18929
|
+
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
18930
|
+
...__default__$k,
|
|
18931
|
+
props: radioGroupProps,
|
|
18932
|
+
emits: radioGroupEmits,
|
|
18933
|
+
setup(__props, { emit }) {
|
|
18934
|
+
const props = __props;
|
|
18935
|
+
const ns = useNamespace("radio");
|
|
18936
|
+
const radioId = useId();
|
|
18937
|
+
const radioGroupRef = ref();
|
|
18938
|
+
const { formItem } = useFormItem();
|
|
18939
|
+
const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props, {
|
|
18940
|
+
formItemContext: formItem
|
|
18941
|
+
});
|
|
18942
|
+
const changeEvent = (value) => {
|
|
18943
|
+
emit(UPDATE_MODEL_EVENT, value);
|
|
18944
|
+
nextTick(() => emit("change", value));
|
|
18945
|
+
};
|
|
18946
|
+
onMounted(() => {
|
|
18947
|
+
const radios = radioGroupRef.value.querySelectorAll("[type=radio]");
|
|
18948
|
+
const firstLabel = radios[0];
|
|
18949
|
+
if (!Array.from(radios).some((radio) => radio.checked) && firstLabel) {
|
|
18950
|
+
firstLabel.tabIndex = 0;
|
|
18951
|
+
}
|
|
18952
|
+
});
|
|
18953
|
+
const name = computed(() => {
|
|
18954
|
+
return props.name || radioId.value;
|
|
18955
|
+
});
|
|
18956
|
+
provide(radioGroupKey, reactive({
|
|
18957
|
+
...toRefs(props),
|
|
18958
|
+
changeEvent,
|
|
18959
|
+
name
|
|
18960
|
+
}));
|
|
18961
|
+
watch(() => props.modelValue, () => {
|
|
18962
|
+
if (props.validateEvent) {
|
|
18963
|
+
formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
|
|
18964
|
+
}
|
|
18965
|
+
});
|
|
18966
|
+
return (_ctx, _cache) => {
|
|
18967
|
+
return openBlock(), createElementBlock("div", {
|
|
18968
|
+
id: unref(groupId),
|
|
18969
|
+
ref_key: "radioGroupRef",
|
|
18970
|
+
ref: radioGroupRef,
|
|
18971
|
+
class: normalizeClass(unref(ns).b("group")),
|
|
18972
|
+
role: "radiogroup",
|
|
18973
|
+
"aria-label": !unref(isLabeledByFormItem) ? _ctx.ariaLabel || "radio-group" : void 0,
|
|
18974
|
+
"aria-labelledby": unref(isLabeledByFormItem) ? unref(formItem).labelId : void 0
|
|
18975
|
+
}, [
|
|
18976
|
+
renderSlot(_ctx.$slots, "default")
|
|
18977
|
+
], 10, ["id", "aria-label", "aria-labelledby"]);
|
|
18978
|
+
};
|
|
18979
|
+
}
|
|
18980
|
+
});
|
|
18981
|
+
var RadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__file", "radio-group.vue"]]);
|
|
18982
|
+
|
|
18983
|
+
const ElRadio = withInstall(Radio, {
|
|
18984
|
+
RadioButton,
|
|
18985
|
+
RadioGroup
|
|
18986
|
+
});
|
|
18987
|
+
withNoopInstall(RadioGroup);
|
|
18988
|
+
withNoopInstall(RadioButton);
|
|
18989
|
+
|
|
18990
|
+
var NodeContent = defineComponent({
|
|
18991
|
+
name: "NodeContent",
|
|
18992
|
+
setup() {
|
|
18993
|
+
const ns = useNamespace("cascader-node");
|
|
18994
|
+
return {
|
|
18995
|
+
ns
|
|
18996
|
+
};
|
|
18997
|
+
},
|
|
18998
|
+
render() {
|
|
18999
|
+
const { ns } = this;
|
|
19000
|
+
const { node, panel } = this.$parent;
|
|
19001
|
+
const { data, label } = node;
|
|
19002
|
+
const { renderLabelFn } = panel;
|
|
19003
|
+
return h("span", { class: ns.e("label") }, renderLabelFn ? renderLabelFn({ node, data }) : label);
|
|
19004
|
+
}
|
|
19005
|
+
});
|
|
19006
|
+
|
|
19007
|
+
const CASCADER_PANEL_INJECTION_KEY = Symbol();
|
|
19008
|
+
|
|
19009
|
+
const _sfc_main$w = defineComponent({
|
|
19010
|
+
name: "ElCascaderNode",
|
|
19011
|
+
components: {
|
|
19012
|
+
ElCheckbox,
|
|
19013
|
+
ElRadio,
|
|
19014
|
+
NodeContent,
|
|
19015
|
+
ElIcon,
|
|
19016
|
+
Check: check_default,
|
|
19017
|
+
Loading: loading_default,
|
|
19018
|
+
ArrowRight: arrow_right_default
|
|
19019
|
+
},
|
|
19020
|
+
props: {
|
|
19021
|
+
node: {
|
|
19022
|
+
type: Object,
|
|
19023
|
+
required: true
|
|
19024
|
+
},
|
|
19025
|
+
menuId: String
|
|
19026
|
+
},
|
|
19027
|
+
emits: ["expand"],
|
|
19028
|
+
setup(props, { emit }) {
|
|
19029
|
+
const panel = inject(CASCADER_PANEL_INJECTION_KEY);
|
|
19030
|
+
const ns = useNamespace("cascader-node");
|
|
19031
|
+
const isHoverMenu = computed(() => panel.isHoverMenu);
|
|
19032
|
+
const multiple = computed(() => panel.config.multiple);
|
|
19033
|
+
const checkStrictly = computed(() => panel.config.checkStrictly);
|
|
19034
|
+
const checkedNodeId = computed(() => {
|
|
19035
|
+
var _a;
|
|
19036
|
+
return (_a = panel.checkedNodes[0]) == null ? void 0 : _a.uid;
|
|
19037
|
+
});
|
|
19038
|
+
const isDisabled = computed(() => props.node.isDisabled);
|
|
19039
|
+
const isLeaf = computed(() => props.node.isLeaf);
|
|
19040
|
+
const expandable = computed(() => checkStrictly.value && !isLeaf.value || !isDisabled.value);
|
|
19041
|
+
const inExpandingPath = computed(() => isInPath(panel.expandingNode));
|
|
19042
|
+
const inCheckedPath = computed(() => checkStrictly.value && panel.checkedNodes.some(isInPath));
|
|
19043
|
+
const isInPath = (node) => {
|
|
19044
|
+
var _a;
|
|
19045
|
+
const { level, uid } = props.node;
|
|
19046
|
+
return ((_a = node == null ? void 0 : node.pathNodes[level - 1]) == null ? void 0 : _a.uid) === uid;
|
|
19047
|
+
};
|
|
19048
|
+
const doExpand = () => {
|
|
19049
|
+
if (inExpandingPath.value)
|
|
19050
|
+
return;
|
|
19051
|
+
panel.expandNode(props.node);
|
|
19052
|
+
};
|
|
19053
|
+
const doCheck = (checked) => {
|
|
19054
|
+
const { node } = props;
|
|
19055
|
+
if (checked === node.checked)
|
|
19056
|
+
return;
|
|
19057
|
+
panel.handleCheckChange(node, checked);
|
|
19058
|
+
};
|
|
19059
|
+
const doLoad = () => {
|
|
19060
|
+
panel.lazyLoad(props.node, () => {
|
|
19061
|
+
if (!isLeaf.value)
|
|
19062
|
+
doExpand();
|
|
19063
|
+
});
|
|
19064
|
+
};
|
|
19065
|
+
const handleHoverExpand = (e) => {
|
|
19066
|
+
if (!isHoverMenu.value)
|
|
19067
|
+
return;
|
|
19068
|
+
handleExpand();
|
|
19069
|
+
!isLeaf.value && emit("expand", e);
|
|
19070
|
+
};
|
|
19071
|
+
const handleExpand = () => {
|
|
19072
|
+
const { node } = props;
|
|
19073
|
+
if (!expandable.value || node.loading)
|
|
19074
|
+
return;
|
|
19075
|
+
node.loaded ? doExpand() : doLoad();
|
|
19076
|
+
};
|
|
19077
|
+
const handleClick = () => {
|
|
19078
|
+
if (isHoverMenu.value && !isLeaf.value)
|
|
19079
|
+
return;
|
|
19080
|
+
if (isLeaf.value && !isDisabled.value && !checkStrictly.value && !multiple.value) {
|
|
19081
|
+
handleCheck(true);
|
|
19082
|
+
} else {
|
|
19083
|
+
handleExpand();
|
|
19084
|
+
}
|
|
19085
|
+
};
|
|
19086
|
+
const handleSelectCheck = (checked) => {
|
|
19087
|
+
if (checkStrictly.value) {
|
|
19088
|
+
doCheck(checked);
|
|
19089
|
+
if (props.node.loaded) {
|
|
19090
|
+
doExpand();
|
|
19091
|
+
}
|
|
19092
|
+
} else {
|
|
19093
|
+
handleCheck(checked);
|
|
19094
|
+
}
|
|
19095
|
+
};
|
|
19096
|
+
const handleCheck = (checked) => {
|
|
19097
|
+
if (!props.node.loaded) {
|
|
19098
|
+
doLoad();
|
|
19099
|
+
} else {
|
|
19100
|
+
doCheck(checked);
|
|
19101
|
+
!checkStrictly.value && doExpand();
|
|
19102
|
+
}
|
|
19103
|
+
};
|
|
19104
|
+
return {
|
|
19105
|
+
panel,
|
|
19106
|
+
isHoverMenu,
|
|
19107
|
+
multiple,
|
|
19108
|
+
checkStrictly,
|
|
19109
|
+
checkedNodeId,
|
|
19110
|
+
isDisabled,
|
|
19111
|
+
isLeaf,
|
|
19112
|
+
expandable,
|
|
19113
|
+
inExpandingPath,
|
|
19114
|
+
inCheckedPath,
|
|
19115
|
+
ns,
|
|
19116
|
+
handleHoverExpand,
|
|
19117
|
+
handleExpand,
|
|
19118
|
+
handleClick,
|
|
19119
|
+
handleCheck,
|
|
19120
|
+
handleSelectCheck
|
|
19121
|
+
};
|
|
19122
|
+
}
|
|
19123
|
+
});
|
|
19124
|
+
function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
19125
|
+
const _component_el_checkbox = resolveComponent("el-checkbox");
|
|
19126
|
+
const _component_el_radio = resolveComponent("el-radio");
|
|
19127
|
+
const _component_check = resolveComponent("check");
|
|
19128
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
19129
|
+
const _component_node_content = resolveComponent("node-content");
|
|
19130
|
+
const _component_loading = resolveComponent("loading");
|
|
19131
|
+
const _component_arrow_right = resolveComponent("arrow-right");
|
|
19132
|
+
return openBlock(), createElementBlock("li", {
|
|
19133
|
+
id: `${_ctx.menuId}-${_ctx.node.uid}`,
|
|
19134
|
+
role: "menuitem",
|
|
19135
|
+
"aria-haspopup": !_ctx.isLeaf,
|
|
19136
|
+
"aria-owns": _ctx.isLeaf ? null : _ctx.menuId,
|
|
19137
|
+
"aria-expanded": _ctx.inExpandingPath,
|
|
19138
|
+
tabindex: _ctx.expandable ? -1 : void 0,
|
|
19139
|
+
class: normalizeClass([
|
|
19140
|
+
_ctx.ns.b(),
|
|
19141
|
+
_ctx.ns.is("selectable", _ctx.checkStrictly),
|
|
19142
|
+
_ctx.ns.is("active", _ctx.node.checked),
|
|
19143
|
+
_ctx.ns.is("disabled", !_ctx.expandable),
|
|
19144
|
+
_ctx.inExpandingPath && "in-active-path",
|
|
19145
|
+
_ctx.inCheckedPath && "in-checked-path"
|
|
19146
|
+
]),
|
|
19147
|
+
onMouseenter: _ctx.handleHoverExpand,
|
|
19148
|
+
onFocus: _ctx.handleHoverExpand,
|
|
19149
|
+
onClick: _ctx.handleClick
|
|
19150
|
+
}, [
|
|
19151
|
+
createCommentVNode(" prefix "),
|
|
19152
|
+
_ctx.multiple ? (openBlock(), createBlock(_component_el_checkbox, {
|
|
19153
|
+
key: 0,
|
|
19154
|
+
"model-value": _ctx.node.checked,
|
|
19155
|
+
indeterminate: _ctx.node.indeterminate,
|
|
19156
|
+
disabled: _ctx.isDisabled,
|
|
19157
|
+
onClick: withModifiers(() => {
|
|
19158
|
+
}, ["stop"]),
|
|
19159
|
+
"onUpdate:modelValue": _ctx.handleSelectCheck
|
|
19160
|
+
}, null, 8, ["model-value", "indeterminate", "disabled", "onClick", "onUpdate:modelValue"])) : _ctx.checkStrictly ? (openBlock(), createBlock(_component_el_radio, {
|
|
19161
|
+
key: 1,
|
|
19162
|
+
"model-value": _ctx.checkedNodeId,
|
|
19163
|
+
label: _ctx.node.uid,
|
|
19164
|
+
disabled: _ctx.isDisabled,
|
|
19165
|
+
"onUpdate:modelValue": _ctx.handleSelectCheck,
|
|
19166
|
+
onClick: withModifiers(() => {
|
|
19167
|
+
}, ["stop"])
|
|
19168
|
+
}, {
|
|
19169
|
+
default: withCtx(() => [
|
|
19170
|
+
createCommentVNode("\n Add an empty element to avoid render label,\n do not use empty fragment here for https://github.com/vuejs/vue-next/pull/2485\n "),
|
|
19171
|
+
createElementVNode("span")
|
|
19172
|
+
]),
|
|
19173
|
+
_: 1
|
|
19174
|
+
}, 8, ["model-value", "label", "disabled", "onUpdate:modelValue", "onClick"])) : _ctx.isLeaf && _ctx.node.checked ? (openBlock(), createBlock(_component_el_icon, {
|
|
19175
|
+
key: 2,
|
|
19176
|
+
class: normalizeClass(_ctx.ns.e("prefix"))
|
|
19177
|
+
}, {
|
|
19178
|
+
default: withCtx(() => [
|
|
19179
|
+
createVNode(_component_check)
|
|
19180
|
+
]),
|
|
19181
|
+
_: 1
|
|
19182
|
+
}, 8, ["class"])) : createCommentVNode("v-if", true),
|
|
19183
|
+
createCommentVNode(" content "),
|
|
19184
|
+
createVNode(_component_node_content),
|
|
19185
|
+
createCommentVNode(" postfix "),
|
|
19186
|
+
!_ctx.isLeaf ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
19187
|
+
_ctx.node.loading ? (openBlock(), createBlock(_component_el_icon, {
|
|
19188
|
+
key: 0,
|
|
19189
|
+
class: normalizeClass([_ctx.ns.is("loading"), _ctx.ns.e("postfix")])
|
|
19190
|
+
}, {
|
|
19191
|
+
default: withCtx(() => [
|
|
19192
|
+
createVNode(_component_loading)
|
|
19193
|
+
]),
|
|
19194
|
+
_: 1
|
|
19195
|
+
}, 8, ["class"])) : (openBlock(), createBlock(_component_el_icon, {
|
|
19196
|
+
key: 1,
|
|
19197
|
+
class: normalizeClass(["arrow-right", _ctx.ns.e("postfix")])
|
|
19198
|
+
}, {
|
|
19199
|
+
default: withCtx(() => [
|
|
19200
|
+
createVNode(_component_arrow_right)
|
|
19201
|
+
]),
|
|
19202
|
+
_: 1
|
|
19203
|
+
}, 8, ["class"]))
|
|
19204
|
+
], 64)) : createCommentVNode("v-if", true)
|
|
19205
|
+
], 42, ["id", "aria-haspopup", "aria-owns", "aria-expanded", "tabindex", "onMouseenter", "onFocus", "onClick"]);
|
|
19206
|
+
}
|
|
19207
|
+
var ElCascaderNode = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$b], ["__file", "node.vue"]]);
|
|
19208
|
+
|
|
19209
|
+
const _sfc_main$v = defineComponent({
|
|
19210
|
+
name: "ElCascaderMenu",
|
|
19211
|
+
components: {
|
|
19212
|
+
Loading: loading_default,
|
|
19213
|
+
ElIcon,
|
|
19214
|
+
ElScrollbar,
|
|
19215
|
+
ElCascaderNode
|
|
19216
|
+
},
|
|
19217
|
+
props: {
|
|
19218
|
+
nodes: {
|
|
19219
|
+
type: Array,
|
|
19220
|
+
required: true
|
|
19221
|
+
},
|
|
19222
|
+
index: {
|
|
19223
|
+
type: Number,
|
|
19224
|
+
required: true
|
|
19225
|
+
}
|
|
19226
|
+
},
|
|
19227
|
+
setup(props) {
|
|
19228
|
+
const instance = getCurrentInstance();
|
|
19229
|
+
const ns = useNamespace("cascader-menu");
|
|
19230
|
+
const { t } = useLocale();
|
|
19231
|
+
const id = useId();
|
|
19232
|
+
let activeNode = null;
|
|
19233
|
+
let hoverTimer = null;
|
|
19234
|
+
const panel = inject(CASCADER_PANEL_INJECTION_KEY);
|
|
19235
|
+
const hoverZone = ref(null);
|
|
19236
|
+
const isEmpty = computed(() => !props.nodes.length);
|
|
19237
|
+
const isLoading = computed(() => !panel.initialLoaded);
|
|
19238
|
+
const menuId = computed(() => `${id.value}-${props.index}`);
|
|
19239
|
+
const handleExpand = (e) => {
|
|
19240
|
+
activeNode = e.target;
|
|
19241
|
+
};
|
|
19242
|
+
const handleMouseMove = (e) => {
|
|
19243
|
+
if (!panel.isHoverMenu || !activeNode || !hoverZone.value)
|
|
19244
|
+
return;
|
|
19245
|
+
if (activeNode.contains(e.target)) {
|
|
19246
|
+
clearHoverTimer();
|
|
19247
|
+
const el = instance.vnode.el;
|
|
19248
|
+
const { left } = el.getBoundingClientRect();
|
|
19249
|
+
const { offsetWidth, offsetHeight } = el;
|
|
19250
|
+
const startX = e.clientX - left;
|
|
19251
|
+
const top = activeNode.offsetTop;
|
|
19252
|
+
const bottom = top + activeNode.offsetHeight;
|
|
19253
|
+
hoverZone.value.innerHTML = `
|
|
19254
|
+
<path style="pointer-events: auto;" fill="transparent" d="M${startX} ${top} L${offsetWidth} 0 V${top} Z" />
|
|
19255
|
+
<path style="pointer-events: auto;" fill="transparent" d="M${startX} ${bottom} L${offsetWidth} ${offsetHeight} V${bottom} Z" />
|
|
19256
|
+
`;
|
|
19257
|
+
} else if (!hoverTimer) {
|
|
19258
|
+
hoverTimer = window.setTimeout(clearHoverZone, panel.config.hoverThreshold);
|
|
19259
|
+
}
|
|
19260
|
+
};
|
|
19261
|
+
const clearHoverTimer = () => {
|
|
19262
|
+
if (!hoverTimer)
|
|
19263
|
+
return;
|
|
19264
|
+
clearTimeout(hoverTimer);
|
|
19265
|
+
hoverTimer = null;
|
|
19266
|
+
};
|
|
19267
|
+
const clearHoverZone = () => {
|
|
19268
|
+
if (!hoverZone.value)
|
|
19269
|
+
return;
|
|
19270
|
+
hoverZone.value.innerHTML = "";
|
|
19271
|
+
clearHoverTimer();
|
|
19272
|
+
};
|
|
19273
|
+
return {
|
|
19274
|
+
ns,
|
|
19275
|
+
panel,
|
|
19276
|
+
hoverZone,
|
|
19277
|
+
isEmpty,
|
|
19278
|
+
isLoading,
|
|
19279
|
+
menuId,
|
|
19280
|
+
t,
|
|
19281
|
+
handleExpand,
|
|
19282
|
+
handleMouseMove,
|
|
19283
|
+
clearHoverZone
|
|
19284
|
+
};
|
|
19285
|
+
}
|
|
19286
|
+
});
|
|
19287
|
+
function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
19288
|
+
const _component_el_cascader_node = resolveComponent("el-cascader-node");
|
|
19289
|
+
const _component_loading = resolveComponent("loading");
|
|
19290
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
19291
|
+
const _component_el_scrollbar = resolveComponent("el-scrollbar");
|
|
19292
|
+
return openBlock(), createBlock(_component_el_scrollbar, {
|
|
19293
|
+
key: _ctx.menuId,
|
|
19294
|
+
tag: "ul",
|
|
19295
|
+
role: "menu",
|
|
19296
|
+
class: normalizeClass(_ctx.ns.b()),
|
|
19297
|
+
"wrap-class": _ctx.ns.e("wrap"),
|
|
19298
|
+
"view-class": [_ctx.ns.e("list"), _ctx.ns.is("empty", _ctx.isEmpty)],
|
|
19299
|
+
onMousemove: _ctx.handleMouseMove,
|
|
19300
|
+
onMouseleave: _ctx.clearHoverZone
|
|
19301
|
+
}, {
|
|
19302
|
+
default: withCtx(() => {
|
|
19303
|
+
var _a;
|
|
19304
|
+
return [
|
|
19305
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.nodes, (node) => {
|
|
19306
|
+
return openBlock(), createBlock(_component_el_cascader_node, {
|
|
19307
|
+
key: node.uid,
|
|
19308
|
+
node,
|
|
19309
|
+
"menu-id": _ctx.menuId,
|
|
19310
|
+
onExpand: _ctx.handleExpand
|
|
19311
|
+
}, null, 8, ["node", "menu-id", "onExpand"]);
|
|
19312
|
+
}), 128)),
|
|
19313
|
+
_ctx.isLoading ? (openBlock(), createElementBlock("div", {
|
|
19314
|
+
key: 0,
|
|
19315
|
+
class: normalizeClass(_ctx.ns.e("empty-text"))
|
|
19316
|
+
}, [
|
|
19317
|
+
createVNode(_component_el_icon, {
|
|
19318
|
+
size: "14",
|
|
19319
|
+
class: normalizeClass(_ctx.ns.is("loading"))
|
|
19320
|
+
}, {
|
|
19321
|
+
default: withCtx(() => [
|
|
19322
|
+
createVNode(_component_loading)
|
|
19323
|
+
]),
|
|
19324
|
+
_: 1
|
|
19325
|
+
}, 8, ["class"]),
|
|
19326
|
+
createTextVNode(" " + toDisplayString(_ctx.t("el.cascader.loading")), 1)
|
|
19327
|
+
], 2)) : _ctx.isEmpty ? (openBlock(), createElementBlock("div", {
|
|
19328
|
+
key: 1,
|
|
19329
|
+
class: normalizeClass(_ctx.ns.e("empty-text"))
|
|
19330
|
+
}, [
|
|
19331
|
+
renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
19332
|
+
createTextVNode(toDisplayString(_ctx.t("el.cascader.noData")), 1)
|
|
19333
|
+
])
|
|
19334
|
+
], 2)) : ((_a = _ctx.panel) == null ? void 0 : _a.isHoverMenu) ? (openBlock(), createElementBlock("svg", {
|
|
19335
|
+
key: 2,
|
|
19336
|
+
ref: "hoverZone",
|
|
19337
|
+
class: normalizeClass(_ctx.ns.e("hover-zone"))
|
|
19338
|
+
}, null, 2)) : createCommentVNode("v-if", true)
|
|
19339
|
+
];
|
|
19340
|
+
}),
|
|
19341
|
+
_: 3
|
|
19342
|
+
}, 8, ["class", "wrap-class", "view-class", "onMousemove", "onMouseleave"]);
|
|
19343
|
+
}
|
|
19344
|
+
var ElCascaderMenu = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$a], ["__file", "menu.vue"]]);
|
|
19345
|
+
|
|
19346
|
+
const escapeStringRegexp = (string = "") => string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
19347
|
+
const capitalize = (str) => capitalize$2(str);
|
|
19348
|
+
|
|
19349
|
+
let uid = 0;
|
|
19350
|
+
const calculatePathNodes = (node) => {
|
|
19351
|
+
const nodes = [node];
|
|
19352
|
+
let { parent } = node;
|
|
19353
|
+
while (parent) {
|
|
19354
|
+
nodes.unshift(parent);
|
|
19355
|
+
parent = parent.parent;
|
|
19356
|
+
}
|
|
19357
|
+
return nodes;
|
|
19358
|
+
};
|
|
19359
|
+
class Node {
|
|
19360
|
+
constructor(data, config, parent, root = false) {
|
|
19361
|
+
this.data = data;
|
|
19362
|
+
this.config = config;
|
|
19363
|
+
this.parent = parent;
|
|
19364
|
+
this.root = root;
|
|
19365
|
+
this.uid = uid++;
|
|
19366
|
+
this.checked = false;
|
|
19367
|
+
this.indeterminate = false;
|
|
19368
|
+
this.loading = false;
|
|
19369
|
+
const { value: valueKey, label: labelKey, children: childrenKey } = config;
|
|
19370
|
+
const childrenData = data[childrenKey];
|
|
19371
|
+
const pathNodes = calculatePathNodes(this);
|
|
19372
|
+
this.level = root ? 0 : parent ? parent.level + 1 : 1;
|
|
19373
|
+
this.value = data[valueKey];
|
|
19374
|
+
this.label = data[labelKey];
|
|
19375
|
+
this.pathNodes = pathNodes;
|
|
19376
|
+
this.pathValues = pathNodes.map((node) => node.value);
|
|
19377
|
+
this.pathLabels = pathNodes.map((node) => node.label);
|
|
19378
|
+
this.childrenData = childrenData;
|
|
19379
|
+
this.children = (childrenData || []).map((child) => new Node(child, config, this));
|
|
19380
|
+
this.loaded = !config.lazy || this.isLeaf || !isEmpty(childrenData);
|
|
19381
|
+
}
|
|
19382
|
+
get isDisabled() {
|
|
19383
|
+
const { data, parent, config } = this;
|
|
19384
|
+
const { disabled, checkStrictly } = config;
|
|
19385
|
+
const isDisabled = isFunction$1(disabled) ? disabled(data, this) : !!data[disabled];
|
|
19386
|
+
return isDisabled || !checkStrictly && (parent == null ? void 0 : parent.isDisabled);
|
|
19387
|
+
}
|
|
19388
|
+
get isLeaf() {
|
|
19389
|
+
const { data, config, childrenData, loaded } = this;
|
|
19390
|
+
const { lazy, leaf } = config;
|
|
19391
|
+
const isLeaf = isFunction$1(leaf) ? leaf(data, this) : data[leaf];
|
|
19392
|
+
return isUndefined(isLeaf) ? lazy && !loaded ? false : !(isArray$1(childrenData) && childrenData.length) : !!isLeaf;
|
|
19393
|
+
}
|
|
19394
|
+
get valueByOption() {
|
|
19395
|
+
return this.config.emitPath ? this.pathValues : this.value;
|
|
19396
|
+
}
|
|
19397
|
+
appendChild(childData) {
|
|
19398
|
+
const { childrenData, children } = this;
|
|
19399
|
+
const node = new Node(childData, this.config, this);
|
|
19400
|
+
if (isArray$1(childrenData)) {
|
|
19401
|
+
childrenData.push(childData);
|
|
19402
|
+
} else {
|
|
19403
|
+
this.childrenData = [childData];
|
|
19404
|
+
}
|
|
19405
|
+
children.push(node);
|
|
19406
|
+
return node;
|
|
19407
|
+
}
|
|
19408
|
+
calcText(allLevels, separator) {
|
|
19409
|
+
const text = allLevels ? this.pathLabels.join(separator) : this.label;
|
|
19410
|
+
this.text = text;
|
|
19411
|
+
return text;
|
|
19412
|
+
}
|
|
19413
|
+
broadcast(event, ...args) {
|
|
19414
|
+
const handlerName = `onParent${capitalize(event)}`;
|
|
19415
|
+
this.children.forEach((child) => {
|
|
19416
|
+
if (child) {
|
|
19417
|
+
child.broadcast(event, ...args);
|
|
19418
|
+
child[handlerName] && child[handlerName](...args);
|
|
19419
|
+
}
|
|
19420
|
+
});
|
|
19421
|
+
}
|
|
19422
|
+
emit(event, ...args) {
|
|
19423
|
+
const { parent } = this;
|
|
19424
|
+
const handlerName = `onChild${capitalize(event)}`;
|
|
19425
|
+
if (parent) {
|
|
19426
|
+
parent[handlerName] && parent[handlerName](...args);
|
|
19427
|
+
parent.emit(event, ...args);
|
|
19428
|
+
}
|
|
19429
|
+
}
|
|
19430
|
+
onParentCheck(checked) {
|
|
19431
|
+
if (!this.isDisabled) {
|
|
19432
|
+
this.setCheckState(checked);
|
|
19433
|
+
}
|
|
19434
|
+
}
|
|
19435
|
+
onChildCheck() {
|
|
19436
|
+
const { children } = this;
|
|
19437
|
+
const validChildren = children.filter((child) => !child.isDisabled);
|
|
19438
|
+
const checked = validChildren.length ? validChildren.every((child) => child.checked) : false;
|
|
19439
|
+
this.setCheckState(checked);
|
|
19440
|
+
}
|
|
19441
|
+
setCheckState(checked) {
|
|
19442
|
+
const totalNum = this.children.length;
|
|
19443
|
+
const checkedNum = this.children.reduce((c, p) => {
|
|
19444
|
+
const num = p.checked ? 1 : p.indeterminate ? 0.5 : 0;
|
|
19445
|
+
return c + num;
|
|
19446
|
+
}, 0);
|
|
19447
|
+
this.checked = this.loaded && this.children.filter((child) => !child.isDisabled).every((child) => child.loaded && child.checked) && checked;
|
|
19448
|
+
this.indeterminate = this.loaded && checkedNum !== totalNum && checkedNum > 0;
|
|
19449
|
+
}
|
|
19450
|
+
doCheck(checked) {
|
|
19451
|
+
if (this.checked === checked)
|
|
19452
|
+
return;
|
|
19453
|
+
const { checkStrictly, multiple } = this.config;
|
|
19454
|
+
if (checkStrictly || !multiple) {
|
|
19455
|
+
this.checked = checked;
|
|
19456
|
+
} else {
|
|
19457
|
+
this.broadcast("check", checked);
|
|
19458
|
+
this.setCheckState(checked);
|
|
19459
|
+
this.emit("check");
|
|
19460
|
+
}
|
|
19461
|
+
}
|
|
19462
|
+
}
|
|
19463
|
+
|
|
19464
|
+
const flatNodes = (nodes, leafOnly) => {
|
|
19465
|
+
return nodes.reduce((res, node) => {
|
|
19466
|
+
if (node.isLeaf) {
|
|
19467
|
+
res.push(node);
|
|
19468
|
+
} else {
|
|
19469
|
+
!leafOnly && res.push(node);
|
|
19470
|
+
res = res.concat(flatNodes(node.children, leafOnly));
|
|
19471
|
+
}
|
|
19472
|
+
return res;
|
|
19473
|
+
}, []);
|
|
19474
|
+
};
|
|
19475
|
+
class Store {
|
|
19476
|
+
constructor(data, config) {
|
|
19477
|
+
this.config = config;
|
|
19478
|
+
const nodes = (data || []).map((nodeData) => new Node(nodeData, this.config));
|
|
19479
|
+
this.nodes = nodes;
|
|
19480
|
+
this.allNodes = flatNodes(nodes, false);
|
|
19481
|
+
this.leafNodes = flatNodes(nodes, true);
|
|
19482
|
+
}
|
|
19483
|
+
getNodes() {
|
|
19484
|
+
return this.nodes;
|
|
19485
|
+
}
|
|
19486
|
+
getFlattedNodes(leafOnly) {
|
|
19487
|
+
return leafOnly ? this.leafNodes : this.allNodes;
|
|
19488
|
+
}
|
|
19489
|
+
appendNode(nodeData, parentNode) {
|
|
19490
|
+
const node = parentNode ? parentNode.appendChild(nodeData) : new Node(nodeData, this.config);
|
|
19491
|
+
if (!parentNode)
|
|
19492
|
+
this.nodes.push(node);
|
|
19493
|
+
this.allNodes.push(node);
|
|
19494
|
+
node.isLeaf && this.leafNodes.push(node);
|
|
19495
|
+
}
|
|
19496
|
+
appendNodes(nodeDataList, parentNode) {
|
|
19497
|
+
nodeDataList.forEach((nodeData) => this.appendNode(nodeData, parentNode));
|
|
19498
|
+
}
|
|
19499
|
+
getNodeByValue(value, leafOnly = false) {
|
|
19500
|
+
if (!value && value !== 0)
|
|
19501
|
+
return null;
|
|
19502
|
+
const node = this.getFlattedNodes(leafOnly).find((node2) => isEqual$1(node2.value, value) || isEqual$1(node2.pathValues, value));
|
|
19503
|
+
return node || null;
|
|
19504
|
+
}
|
|
19505
|
+
getSameNode(node) {
|
|
19506
|
+
if (!node)
|
|
19507
|
+
return null;
|
|
19508
|
+
const node_ = this.getFlattedNodes(false).find(({ value, level }) => isEqual$1(node.value, value) && node.level === level);
|
|
19509
|
+
return node_ || null;
|
|
19510
|
+
}
|
|
19511
|
+
}
|
|
19512
|
+
|
|
19513
|
+
const CommonProps = buildProps({
|
|
19514
|
+
modelValue: {
|
|
19515
|
+
type: definePropType([Number, String, Array])
|
|
19516
|
+
},
|
|
19517
|
+
options: {
|
|
19518
|
+
type: definePropType(Array),
|
|
19519
|
+
default: () => []
|
|
19520
|
+
},
|
|
19521
|
+
props: {
|
|
19522
|
+
type: definePropType(Object),
|
|
19523
|
+
default: () => ({})
|
|
19524
|
+
}
|
|
19525
|
+
});
|
|
19526
|
+
const DefaultProps = {
|
|
19527
|
+
expandTrigger: "click",
|
|
19528
|
+
multiple: false,
|
|
19529
|
+
checkStrictly: false,
|
|
19530
|
+
emitPath: true,
|
|
19531
|
+
lazy: false,
|
|
19532
|
+
lazyLoad: NOOP,
|
|
19533
|
+
value: "value",
|
|
19534
|
+
label: "label",
|
|
19535
|
+
children: "children",
|
|
19536
|
+
leaf: "leaf",
|
|
19537
|
+
disabled: "disabled",
|
|
19538
|
+
hoverThreshold: 500
|
|
19539
|
+
};
|
|
19540
|
+
const useCascaderConfig = (props) => {
|
|
19541
|
+
return computed(() => ({
|
|
19542
|
+
...DefaultProps,
|
|
19543
|
+
...props.props
|
|
19544
|
+
}));
|
|
19545
|
+
};
|
|
19546
|
+
|
|
19547
|
+
const getMenuIndex = (el) => {
|
|
19548
|
+
if (!el)
|
|
19549
|
+
return 0;
|
|
19550
|
+
const pieces = el.id.split("-");
|
|
19551
|
+
return Number(pieces[pieces.length - 2]);
|
|
19552
|
+
};
|
|
19553
|
+
const checkNode = (el) => {
|
|
19554
|
+
if (!el)
|
|
19555
|
+
return;
|
|
19556
|
+
const input = el.querySelector("input");
|
|
19557
|
+
if (input) {
|
|
19558
|
+
input.click();
|
|
19559
|
+
} else if (isLeaf(el)) {
|
|
19560
|
+
el.click();
|
|
19561
|
+
}
|
|
19562
|
+
};
|
|
19563
|
+
const sortByOriginalOrder = (oldNodes, newNodes) => {
|
|
19564
|
+
const newNodesCopy = newNodes.slice(0);
|
|
19565
|
+
const newIds = newNodesCopy.map((node) => node.uid);
|
|
19566
|
+
const res = oldNodes.reduce((acc, item) => {
|
|
19567
|
+
const index = newIds.indexOf(item.uid);
|
|
19568
|
+
if (index > -1) {
|
|
19569
|
+
acc.push(item);
|
|
19570
|
+
newNodesCopy.splice(index, 1);
|
|
19571
|
+
newIds.splice(index, 1);
|
|
19572
|
+
}
|
|
19573
|
+
return acc;
|
|
19574
|
+
}, []);
|
|
19575
|
+
res.push(...newNodesCopy);
|
|
19576
|
+
return res;
|
|
19577
|
+
};
|
|
19578
|
+
|
|
19579
|
+
const unique = (arr) => [...new Set(arr)];
|
|
19580
|
+
const castArray = (arr) => {
|
|
19581
|
+
if (!arr && arr !== 0)
|
|
19582
|
+
return [];
|
|
19583
|
+
return isArray$1(arr) ? arr : [arr];
|
|
19584
|
+
};
|
|
19585
|
+
|
|
19586
|
+
const _sfc_main$u = defineComponent({
|
|
19587
|
+
name: "ElCascaderPanel",
|
|
19588
|
+
components: {
|
|
19589
|
+
ElCascaderMenu
|
|
19590
|
+
},
|
|
19591
|
+
props: {
|
|
19592
|
+
...CommonProps,
|
|
19593
|
+
border: {
|
|
19594
|
+
type: Boolean,
|
|
19595
|
+
default: true
|
|
19596
|
+
},
|
|
19597
|
+
renderLabel: Function
|
|
19598
|
+
},
|
|
19599
|
+
emits: [UPDATE_MODEL_EVENT, CHANGE_EVENT, "close", "expand-change"],
|
|
19600
|
+
setup(props, { emit, slots }) {
|
|
19601
|
+
let manualChecked = false;
|
|
19602
|
+
const ns = useNamespace("cascader");
|
|
19603
|
+
const config = useCascaderConfig(props);
|
|
19604
|
+
let store = null;
|
|
19605
|
+
const initialLoaded = ref(true);
|
|
19606
|
+
const menuList = ref([]);
|
|
19607
|
+
const checkedValue = ref(null);
|
|
19608
|
+
const menus = ref([]);
|
|
19609
|
+
const expandingNode = ref(null);
|
|
19610
|
+
const checkedNodes = ref([]);
|
|
19611
|
+
const isHoverMenu = computed(() => config.value.expandTrigger === "hover");
|
|
19612
|
+
const renderLabelFn = computed(() => props.renderLabel || slots.default);
|
|
19613
|
+
const initStore = () => {
|
|
19614
|
+
const { options } = props;
|
|
19615
|
+
const cfg = config.value;
|
|
19616
|
+
manualChecked = false;
|
|
19617
|
+
store = new Store(options, cfg);
|
|
19618
|
+
menus.value = [store.getNodes()];
|
|
19619
|
+
if (cfg.lazy && isEmpty(props.options)) {
|
|
19620
|
+
initialLoaded.value = false;
|
|
19621
|
+
lazyLoad(void 0, (list) => {
|
|
19622
|
+
if (list) {
|
|
19623
|
+
store = new Store(list, cfg);
|
|
19624
|
+
menus.value = [store.getNodes()];
|
|
19625
|
+
}
|
|
19626
|
+
initialLoaded.value = true;
|
|
19627
|
+
syncCheckedValue(false, true);
|
|
19628
|
+
});
|
|
19629
|
+
} else {
|
|
19630
|
+
syncCheckedValue(false, true);
|
|
19631
|
+
}
|
|
19632
|
+
};
|
|
19633
|
+
const lazyLoad = (node, cb) => {
|
|
19634
|
+
const cfg = config.value;
|
|
19635
|
+
node = node || new Node({}, cfg, void 0, true);
|
|
19636
|
+
node.loading = true;
|
|
19637
|
+
const resolve = (dataList) => {
|
|
19638
|
+
const _node = node;
|
|
19639
|
+
const parent = _node.root ? null : _node;
|
|
19640
|
+
dataList && (store == null ? void 0 : store.appendNodes(dataList, parent));
|
|
19641
|
+
_node.loading = false;
|
|
19642
|
+
_node.loaded = true;
|
|
19643
|
+
_node.childrenData = _node.childrenData || [];
|
|
19644
|
+
cb && cb(dataList);
|
|
19645
|
+
};
|
|
19646
|
+
cfg.lazyLoad(node, resolve);
|
|
19647
|
+
};
|
|
19648
|
+
const expandNode = (node, silent) => {
|
|
19649
|
+
var _a;
|
|
19650
|
+
const { level } = node;
|
|
19651
|
+
const newMenus = menus.value.slice(0, level);
|
|
19652
|
+
let newExpandingNode;
|
|
19653
|
+
if (node.isLeaf) {
|
|
19654
|
+
newExpandingNode = node.pathNodes[level - 2];
|
|
19655
|
+
} else {
|
|
19656
|
+
newExpandingNode = node;
|
|
19657
|
+
newMenus.push(node.children);
|
|
19658
|
+
}
|
|
19659
|
+
if (((_a = expandingNode.value) == null ? void 0 : _a.uid) !== (newExpandingNode == null ? void 0 : newExpandingNode.uid)) {
|
|
19660
|
+
expandingNode.value = node;
|
|
19661
|
+
menus.value = newMenus;
|
|
19662
|
+
!silent && emit("expand-change", (node == null ? void 0 : node.pathValues) || []);
|
|
19663
|
+
}
|
|
19664
|
+
};
|
|
19665
|
+
const handleCheckChange = (node, checked, emitClose = true) => {
|
|
19666
|
+
const { checkStrictly, multiple } = config.value;
|
|
19667
|
+
const oldNode = checkedNodes.value[0];
|
|
19668
|
+
manualChecked = true;
|
|
19669
|
+
!multiple && (oldNode == null ? void 0 : oldNode.doCheck(false));
|
|
19670
|
+
node.doCheck(checked);
|
|
19671
|
+
calculateCheckedValue();
|
|
19672
|
+
emitClose && !multiple && !checkStrictly && emit("close");
|
|
19673
|
+
!emitClose && !multiple && !checkStrictly && expandParentNode(node);
|
|
19674
|
+
};
|
|
19675
|
+
const expandParentNode = (node) => {
|
|
19676
|
+
if (!node)
|
|
19677
|
+
return;
|
|
19678
|
+
node = node.parent;
|
|
19679
|
+
expandParentNode(node);
|
|
19680
|
+
node && expandNode(node);
|
|
19681
|
+
};
|
|
19682
|
+
const getFlattedNodes = (leafOnly) => {
|
|
19683
|
+
return store == null ? void 0 : store.getFlattedNodes(leafOnly);
|
|
19684
|
+
};
|
|
19685
|
+
const getCheckedNodes = (leafOnly) => {
|
|
19686
|
+
var _a;
|
|
19687
|
+
return (_a = getFlattedNodes(leafOnly)) == null ? void 0 : _a.filter((node) => node.checked !== false);
|
|
19688
|
+
};
|
|
19689
|
+
const clearCheckedNodes = () => {
|
|
19690
|
+
checkedNodes.value.forEach((node) => node.doCheck(false));
|
|
19691
|
+
calculateCheckedValue();
|
|
19692
|
+
menus.value = menus.value.slice(0, 1);
|
|
19693
|
+
expandingNode.value = null;
|
|
19694
|
+
emit("expand-change", []);
|
|
19695
|
+
};
|
|
19696
|
+
const calculateCheckedValue = () => {
|
|
19697
|
+
var _a;
|
|
19698
|
+
const { checkStrictly, multiple } = config.value;
|
|
19699
|
+
const oldNodes = checkedNodes.value;
|
|
19700
|
+
const newNodes = getCheckedNodes(!checkStrictly);
|
|
19701
|
+
const nodes = sortByOriginalOrder(oldNodes, newNodes);
|
|
19702
|
+
const values = nodes.map((node) => node.valueByOption);
|
|
19703
|
+
checkedNodes.value = nodes;
|
|
19704
|
+
checkedValue.value = multiple ? values : (_a = values[0]) != null ? _a : null;
|
|
19705
|
+
};
|
|
19706
|
+
const syncCheckedValue = (loaded = false, forced = false) => {
|
|
19707
|
+
const { modelValue } = props;
|
|
19708
|
+
const { lazy, multiple, checkStrictly } = config.value;
|
|
19709
|
+
const leafOnly = !checkStrictly;
|
|
19710
|
+
if (!initialLoaded.value || manualChecked || !forced && isEqual$1(modelValue, checkedValue.value))
|
|
19711
|
+
return;
|
|
19712
|
+
if (lazy && !loaded) {
|
|
19713
|
+
const values = unique(flattenDeep(castArray(modelValue)));
|
|
19714
|
+
const nodes = values.map((val) => store == null ? void 0 : store.getNodeByValue(val)).filter((node) => !!node && !node.loaded && !node.loading);
|
|
19715
|
+
if (nodes.length) {
|
|
19716
|
+
nodes.forEach((node) => {
|
|
19717
|
+
lazyLoad(node, () => syncCheckedValue(false, forced));
|
|
19718
|
+
});
|
|
19719
|
+
} else {
|
|
19720
|
+
syncCheckedValue(true, forced);
|
|
19721
|
+
}
|
|
19722
|
+
} else {
|
|
19723
|
+
const values = multiple ? castArray(modelValue) : [modelValue];
|
|
19724
|
+
const nodes = unique(values.map((val) => store == null ? void 0 : store.getNodeByValue(val, leafOnly)));
|
|
19725
|
+
syncMenuState(nodes, forced);
|
|
19726
|
+
checkedValue.value = cloneDeep(modelValue);
|
|
19727
|
+
}
|
|
19728
|
+
};
|
|
19729
|
+
const syncMenuState = (newCheckedNodes, reserveExpandingState = true) => {
|
|
19730
|
+
const { checkStrictly } = config.value;
|
|
19731
|
+
const oldNodes = checkedNodes.value;
|
|
19732
|
+
const newNodes = newCheckedNodes.filter((node) => !!node && (checkStrictly || node.isLeaf));
|
|
19733
|
+
const oldExpandingNode = store == null ? void 0 : store.getSameNode(expandingNode.value);
|
|
19734
|
+
const newExpandingNode = reserveExpandingState && oldExpandingNode || newNodes[0];
|
|
19735
|
+
if (newExpandingNode) {
|
|
19736
|
+
newExpandingNode.pathNodes.forEach((node) => expandNode(node, true));
|
|
19737
|
+
} else {
|
|
19738
|
+
expandingNode.value = null;
|
|
19739
|
+
}
|
|
19740
|
+
oldNodes.forEach((node) => node.doCheck(false));
|
|
19741
|
+
reactive(newNodes).forEach((node) => node.doCheck(true));
|
|
19742
|
+
checkedNodes.value = newNodes;
|
|
19743
|
+
nextTick(scrollToExpandingNode);
|
|
19744
|
+
};
|
|
19745
|
+
const scrollToExpandingNode = () => {
|
|
19746
|
+
if (!isClient)
|
|
19747
|
+
return;
|
|
19748
|
+
menuList.value.forEach((menu) => {
|
|
19749
|
+
const menuElement = menu == null ? void 0 : menu.$el;
|
|
19750
|
+
if (menuElement) {
|
|
19751
|
+
const container = menuElement.querySelector(`.${ns.namespace.value}-scrollbar__wrap`);
|
|
19752
|
+
const activeNode = menuElement.querySelector(`.${ns.b("node")}.${ns.is("active")}`) || menuElement.querySelector(`.${ns.b("node")}.in-active-path`);
|
|
19753
|
+
scrollIntoView(container, activeNode);
|
|
19754
|
+
}
|
|
19755
|
+
});
|
|
19756
|
+
};
|
|
19757
|
+
const handleKeyDown = (e) => {
|
|
19758
|
+
const target = e.target;
|
|
19759
|
+
const { code } = e;
|
|
19760
|
+
switch (code) {
|
|
19761
|
+
case EVENT_CODE.up:
|
|
19762
|
+
case EVENT_CODE.down: {
|
|
19763
|
+
e.preventDefault();
|
|
19764
|
+
const distance = code === EVENT_CODE.up ? -1 : 1;
|
|
19765
|
+
focusNode(getSibling(target, distance, `.${ns.b("node")}[tabindex="-1"]`));
|
|
19766
|
+
break;
|
|
19767
|
+
}
|
|
19768
|
+
case EVENT_CODE.left: {
|
|
19769
|
+
e.preventDefault();
|
|
19770
|
+
const preMenu = menuList.value[getMenuIndex(target) - 1];
|
|
19771
|
+
const expandedNode = preMenu == null ? void 0 : preMenu.$el.querySelector(`.${ns.b("node")}[aria-expanded="true"]`);
|
|
19772
|
+
focusNode(expandedNode);
|
|
19773
|
+
break;
|
|
19774
|
+
}
|
|
19775
|
+
case EVENT_CODE.right: {
|
|
19776
|
+
e.preventDefault();
|
|
19777
|
+
const nextMenu = menuList.value[getMenuIndex(target) + 1];
|
|
19778
|
+
const firstNode = nextMenu == null ? void 0 : nextMenu.$el.querySelector(`.${ns.b("node")}[tabindex="-1"]`);
|
|
19779
|
+
focusNode(firstNode);
|
|
19780
|
+
break;
|
|
19781
|
+
}
|
|
19782
|
+
case EVENT_CODE.enter:
|
|
19783
|
+
case EVENT_CODE.numpadEnter:
|
|
19784
|
+
checkNode(target);
|
|
19785
|
+
break;
|
|
19786
|
+
}
|
|
19787
|
+
};
|
|
19788
|
+
provide(CASCADER_PANEL_INJECTION_KEY, reactive({
|
|
19789
|
+
config,
|
|
19790
|
+
expandingNode,
|
|
19791
|
+
checkedNodes,
|
|
19792
|
+
isHoverMenu,
|
|
19793
|
+
initialLoaded,
|
|
19794
|
+
renderLabelFn,
|
|
19795
|
+
lazyLoad,
|
|
19796
|
+
expandNode,
|
|
19797
|
+
handleCheckChange
|
|
19798
|
+
}));
|
|
19799
|
+
watch([config, () => props.options], initStore, {
|
|
19800
|
+
deep: true,
|
|
19801
|
+
immediate: true
|
|
19802
|
+
});
|
|
19803
|
+
watch(() => props.modelValue, () => {
|
|
19804
|
+
manualChecked = false;
|
|
19805
|
+
syncCheckedValue();
|
|
19806
|
+
}, {
|
|
19807
|
+
deep: true
|
|
19808
|
+
});
|
|
19809
|
+
watch(() => checkedValue.value, (val) => {
|
|
19810
|
+
if (!isEqual$1(val, props.modelValue)) {
|
|
19811
|
+
emit(UPDATE_MODEL_EVENT, val);
|
|
19812
|
+
emit(CHANGE_EVENT, val);
|
|
19813
|
+
}
|
|
19814
|
+
});
|
|
19815
|
+
onBeforeUpdate(() => menuList.value = []);
|
|
19816
|
+
onMounted(() => !isEmpty(props.modelValue) && syncCheckedValue());
|
|
19817
|
+
return {
|
|
19818
|
+
ns,
|
|
19819
|
+
menuList,
|
|
19820
|
+
menus,
|
|
19821
|
+
checkedNodes,
|
|
19822
|
+
handleKeyDown,
|
|
19823
|
+
handleCheckChange,
|
|
19824
|
+
getFlattedNodes,
|
|
19825
|
+
getCheckedNodes,
|
|
19826
|
+
clearCheckedNodes,
|
|
19827
|
+
calculateCheckedValue,
|
|
19828
|
+
scrollToExpandingNode
|
|
19829
|
+
};
|
|
19830
|
+
}
|
|
19831
|
+
});
|
|
19832
|
+
function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
19833
|
+
const _component_el_cascader_menu = resolveComponent("el-cascader-menu");
|
|
19834
|
+
return openBlock(), createElementBlock("div", {
|
|
19835
|
+
class: normalizeClass([_ctx.ns.b("panel"), _ctx.ns.is("bordered", _ctx.border)]),
|
|
19836
|
+
onKeydown: _ctx.handleKeyDown
|
|
19837
|
+
}, [
|
|
19838
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menus, (menu, index) => {
|
|
19839
|
+
return openBlock(), createBlock(_component_el_cascader_menu, {
|
|
19840
|
+
key: index,
|
|
19841
|
+
ref_for: true,
|
|
19842
|
+
ref: (item) => _ctx.menuList[index] = item,
|
|
19843
|
+
index,
|
|
19844
|
+
nodes: [...menu]
|
|
19845
|
+
}, {
|
|
19846
|
+
empty: withCtx(() => [
|
|
19847
|
+
renderSlot(_ctx.$slots, "empty")
|
|
19848
|
+
]),
|
|
19849
|
+
_: 2
|
|
19850
|
+
}, 1032, ["index", "nodes"]);
|
|
19851
|
+
}), 128))
|
|
19852
|
+
], 42, ["onKeydown"]);
|
|
19853
|
+
}
|
|
19854
|
+
var CascaderPanel = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$9], ["__file", "index.vue"]]);
|
|
19855
|
+
|
|
19856
|
+
const ElCascaderPanel = withInstall(CascaderPanel);
|
|
19857
|
+
|
|
19858
|
+
const tagProps = buildProps({
|
|
19859
|
+
type: {
|
|
19860
|
+
type: String,
|
|
19861
|
+
values: ["primary", "success", "info", "warning", "danger"],
|
|
19862
|
+
default: "primary"
|
|
19863
|
+
},
|
|
19864
|
+
closable: Boolean,
|
|
19865
|
+
disableTransitions: Boolean,
|
|
19866
|
+
hit: Boolean,
|
|
19867
|
+
color: String,
|
|
19868
|
+
size: {
|
|
19869
|
+
type: String,
|
|
19870
|
+
values: componentSizes
|
|
19871
|
+
},
|
|
19872
|
+
effect: {
|
|
19873
|
+
type: String,
|
|
19874
|
+
values: ["dark", "light", "plain"],
|
|
19875
|
+
default: "light"
|
|
19876
|
+
},
|
|
19877
|
+
round: Boolean
|
|
19878
|
+
});
|
|
19879
|
+
const tagEmits = {
|
|
19880
|
+
close: (evt) => evt instanceof MouseEvent,
|
|
19881
|
+
click: (evt) => evt instanceof MouseEvent
|
|
19882
|
+
};
|
|
19883
|
+
|
|
19884
|
+
const __default__$j = defineComponent({
|
|
19885
|
+
name: "ElTag"
|
|
19886
|
+
});
|
|
19887
|
+
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
19888
|
+
...__default__$j,
|
|
19889
|
+
props: tagProps,
|
|
19890
|
+
emits: tagEmits,
|
|
19891
|
+
setup(__props, { emit }) {
|
|
19892
|
+
const props = __props;
|
|
19893
|
+
const tagSize = useFormSize();
|
|
19894
|
+
const ns = useNamespace("tag");
|
|
19895
|
+
const containerKls = computed(() => {
|
|
19896
|
+
const { type, hit, effect, closable, round } = props;
|
|
19897
|
+
return [
|
|
19898
|
+
ns.b(),
|
|
19899
|
+
ns.is("closable", closable),
|
|
19900
|
+
ns.m(type || "primary"),
|
|
19901
|
+
ns.m(tagSize.value),
|
|
19902
|
+
ns.m(effect),
|
|
19903
|
+
ns.is("hit", hit),
|
|
19904
|
+
ns.is("round", round)
|
|
19905
|
+
];
|
|
19906
|
+
});
|
|
19907
|
+
const handleClose = (event) => {
|
|
19908
|
+
emit("close", event);
|
|
19909
|
+
};
|
|
19910
|
+
const handleClick = (event) => {
|
|
19911
|
+
emit("click", event);
|
|
19912
|
+
};
|
|
19913
|
+
const handleVNodeMounted = (vnode) => {
|
|
19914
|
+
var _a, _b, _c;
|
|
19915
|
+
if ((_c = (_b = (_a = vnode == null ? void 0 : vnode.component) == null ? void 0 : _a.subTree) == null ? void 0 : _b.component) == null ? void 0 : _c.bum) {
|
|
19916
|
+
vnode.component.subTree.component.bum = null;
|
|
19917
|
+
}
|
|
19918
|
+
};
|
|
19919
|
+
return (_ctx, _cache) => {
|
|
19920
|
+
return _ctx.disableTransitions ? (openBlock(), createElementBlock("span", {
|
|
19921
|
+
key: 0,
|
|
19922
|
+
class: normalizeClass(unref(containerKls)),
|
|
19923
|
+
style: normalizeStyle({ backgroundColor: _ctx.color }),
|
|
19924
|
+
onClick: handleClick
|
|
19925
|
+
}, [
|
|
19926
|
+
createElementVNode("span", {
|
|
19927
|
+
class: normalizeClass(unref(ns).e("content"))
|
|
19928
|
+
}, [
|
|
19929
|
+
renderSlot(_ctx.$slots, "default")
|
|
19930
|
+
], 2),
|
|
19931
|
+
_ctx.closable ? (openBlock(), createBlock(unref(ElIcon), {
|
|
19932
|
+
key: 0,
|
|
19933
|
+
class: normalizeClass(unref(ns).e("close")),
|
|
18132
19934
|
onClick: withModifiers(handleClose, ["stop"])
|
|
18133
19935
|
}, {
|
|
18134
19936
|
default: withCtx(() => [
|
|
@@ -18170,9 +19972,82 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
18170
19972
|
};
|
|
18171
19973
|
}
|
|
18172
19974
|
});
|
|
18173
|
-
var Tag = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
18174
|
-
|
|
18175
|
-
const ElTag = withInstall(Tag);
|
|
19975
|
+
var Tag = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__file", "tag.vue"]]);
|
|
19976
|
+
|
|
19977
|
+
const ElTag = withInstall(Tag);
|
|
19978
|
+
|
|
19979
|
+
const cascaderProps$1 = buildProps({
|
|
19980
|
+
...CommonProps,
|
|
19981
|
+
size: useSizeProp,
|
|
19982
|
+
placeholder: String,
|
|
19983
|
+
disabled: Boolean,
|
|
19984
|
+
clearable: Boolean,
|
|
19985
|
+
filterable: Boolean,
|
|
19986
|
+
filterMethod: {
|
|
19987
|
+
type: definePropType(Function),
|
|
19988
|
+
default: (node, keyword) => node.text.includes(keyword)
|
|
19989
|
+
},
|
|
19990
|
+
separator: {
|
|
19991
|
+
type: String,
|
|
19992
|
+
default: " / "
|
|
19993
|
+
},
|
|
19994
|
+
showAllLevels: {
|
|
19995
|
+
type: Boolean,
|
|
19996
|
+
default: true
|
|
19997
|
+
},
|
|
19998
|
+
collapseTags: Boolean,
|
|
19999
|
+
maxCollapseTags: {
|
|
20000
|
+
type: Number,
|
|
20001
|
+
default: 1
|
|
20002
|
+
},
|
|
20003
|
+
collapseTagsTooltip: {
|
|
20004
|
+
type: Boolean,
|
|
20005
|
+
default: false
|
|
20006
|
+
},
|
|
20007
|
+
debounce: {
|
|
20008
|
+
type: Number,
|
|
20009
|
+
default: 300
|
|
20010
|
+
},
|
|
20011
|
+
beforeFilter: {
|
|
20012
|
+
type: definePropType(Function),
|
|
20013
|
+
default: () => true
|
|
20014
|
+
},
|
|
20015
|
+
placement: {
|
|
20016
|
+
type: definePropType(String),
|
|
20017
|
+
values: Ee,
|
|
20018
|
+
default: "bottom-start"
|
|
20019
|
+
},
|
|
20020
|
+
fallbackPlacements: {
|
|
20021
|
+
type: definePropType(Array),
|
|
20022
|
+
default: ["bottom-start", "bottom", "top-start", "top", "right", "left"]
|
|
20023
|
+
},
|
|
20024
|
+
popperClass: {
|
|
20025
|
+
type: String,
|
|
20026
|
+
default: ""
|
|
20027
|
+
},
|
|
20028
|
+
teleported: useTooltipContentProps.teleported,
|
|
20029
|
+
tagType: { ...tagProps.type, default: "info" },
|
|
20030
|
+
tagEffect: { ...tagProps.effect, default: "light" },
|
|
20031
|
+
validateEvent: {
|
|
20032
|
+
type: Boolean,
|
|
20033
|
+
default: true
|
|
20034
|
+
},
|
|
20035
|
+
persistent: {
|
|
20036
|
+
type: Boolean,
|
|
20037
|
+
default: true
|
|
20038
|
+
},
|
|
20039
|
+
...useEmptyValuesProps
|
|
20040
|
+
});
|
|
20041
|
+
const cascaderEmits$1 = {
|
|
20042
|
+
[UPDATE_MODEL_EVENT]: (_) => true,
|
|
20043
|
+
[CHANGE_EVENT]: (_) => true,
|
|
20044
|
+
focus: (evt) => evt instanceof FocusEvent,
|
|
20045
|
+
blur: (evt) => evt instanceof FocusEvent,
|
|
20046
|
+
clear: () => true,
|
|
20047
|
+
visibleChange: (val) => isBoolean(val),
|
|
20048
|
+
expandChange: (val) => !!val,
|
|
20049
|
+
removeTag: (val) => !!val
|
|
20050
|
+
};
|
|
18176
20051
|
|
|
18177
20052
|
const nodeList$1 = /* @__PURE__ */ new Map();
|
|
18178
20053
|
if (isClient) {
|
|
@@ -18243,6 +20118,613 @@ const ClickOutside = {
|
|
|
18243
20118
|
}
|
|
18244
20119
|
};
|
|
18245
20120
|
|
|
20121
|
+
const COMPONENT_NAME$1 = "ElCascader";
|
|
20122
|
+
const __default__$i = defineComponent({
|
|
20123
|
+
name: COMPONENT_NAME$1
|
|
20124
|
+
});
|
|
20125
|
+
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
20126
|
+
...__default__$i,
|
|
20127
|
+
props: cascaderProps$1,
|
|
20128
|
+
emits: cascaderEmits$1,
|
|
20129
|
+
setup(__props, { expose, emit }) {
|
|
20130
|
+
const props = __props;
|
|
20131
|
+
const popperOptions = {
|
|
20132
|
+
modifiers: [
|
|
20133
|
+
{
|
|
20134
|
+
name: "arrowPosition",
|
|
20135
|
+
enabled: true,
|
|
20136
|
+
phase: "main",
|
|
20137
|
+
fn: ({ state }) => {
|
|
20138
|
+
const { modifiersData, placement } = state;
|
|
20139
|
+
if (["right", "left", "bottom", "top"].includes(placement))
|
|
20140
|
+
return;
|
|
20141
|
+
modifiersData.arrow.x = 35;
|
|
20142
|
+
},
|
|
20143
|
+
requires: ["arrow"]
|
|
20144
|
+
}
|
|
20145
|
+
]
|
|
20146
|
+
};
|
|
20147
|
+
const attrs = useAttrs$1();
|
|
20148
|
+
let inputInitialHeight = 0;
|
|
20149
|
+
let pressDeleteCount = 0;
|
|
20150
|
+
const nsCascader = useNamespace("cascader");
|
|
20151
|
+
const nsInput = useNamespace("input");
|
|
20152
|
+
const { t } = useLocale();
|
|
20153
|
+
const { form, formItem } = useFormItem();
|
|
20154
|
+
const { valueOnClear } = useEmptyValues(props);
|
|
20155
|
+
const { isComposing, handleComposition } = useComposition({
|
|
20156
|
+
afterComposition(event) {
|
|
20157
|
+
var _a;
|
|
20158
|
+
const text = (_a = event.target) == null ? void 0 : _a.value;
|
|
20159
|
+
handleInput(text);
|
|
20160
|
+
}
|
|
20161
|
+
});
|
|
20162
|
+
const tooltipRef = ref(null);
|
|
20163
|
+
const input = ref(null);
|
|
20164
|
+
const tagWrapper = ref(null);
|
|
20165
|
+
const cascaderPanelRef = ref(null);
|
|
20166
|
+
const suggestionPanel = ref(null);
|
|
20167
|
+
const popperVisible = ref(false);
|
|
20168
|
+
const inputHover = ref(false);
|
|
20169
|
+
const filtering = ref(false);
|
|
20170
|
+
const filterFocus = ref(false);
|
|
20171
|
+
const inputValue = ref("");
|
|
20172
|
+
const searchInputValue = ref("");
|
|
20173
|
+
const presentTags = ref([]);
|
|
20174
|
+
const allPresentTags = ref([]);
|
|
20175
|
+
const suggestions = ref([]);
|
|
20176
|
+
const cascaderStyle = computed(() => {
|
|
20177
|
+
return attrs.style;
|
|
20178
|
+
});
|
|
20179
|
+
const isDisabled = computed(() => props.disabled || (form == null ? void 0 : form.disabled));
|
|
20180
|
+
const inputPlaceholder = computed(() => props.placeholder || t("el.cascader.placeholder"));
|
|
20181
|
+
const currentPlaceholder = computed(() => searchInputValue.value || presentTags.value.length > 0 || isComposing.value ? "" : inputPlaceholder.value);
|
|
20182
|
+
const realSize = useFormSize();
|
|
20183
|
+
const tagSize = computed(() => realSize.value === "small" ? "small" : "default");
|
|
20184
|
+
const multiple = computed(() => !!props.props.multiple);
|
|
20185
|
+
const readonly = computed(() => !props.filterable || multiple.value);
|
|
20186
|
+
const searchKeyword = computed(() => multiple.value ? searchInputValue.value : inputValue.value);
|
|
20187
|
+
const checkedNodes = computed(() => {
|
|
20188
|
+
var _a;
|
|
20189
|
+
return ((_a = cascaderPanelRef.value) == null ? void 0 : _a.checkedNodes) || [];
|
|
20190
|
+
});
|
|
20191
|
+
const clearBtnVisible = computed(() => {
|
|
20192
|
+
if (!props.clearable || isDisabled.value || filtering.value || !inputHover.value)
|
|
20193
|
+
return false;
|
|
20194
|
+
return !!checkedNodes.value.length;
|
|
20195
|
+
});
|
|
20196
|
+
const presentText = computed(() => {
|
|
20197
|
+
const { showAllLevels, separator } = props;
|
|
20198
|
+
const nodes = checkedNodes.value;
|
|
20199
|
+
return nodes.length ? multiple.value ? "" : nodes[0].calcText(showAllLevels, separator) : "";
|
|
20200
|
+
});
|
|
20201
|
+
const validateState = computed(() => (formItem == null ? void 0 : formItem.validateState) || "");
|
|
20202
|
+
const checkedValue = computed({
|
|
20203
|
+
get() {
|
|
20204
|
+
return cloneDeep(props.modelValue);
|
|
20205
|
+
},
|
|
20206
|
+
set(val) {
|
|
20207
|
+
const value = val != null ? val : valueOnClear.value;
|
|
20208
|
+
emit(UPDATE_MODEL_EVENT, value);
|
|
20209
|
+
emit(CHANGE_EVENT, value);
|
|
20210
|
+
if (props.validateEvent) {
|
|
20211
|
+
formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
|
|
20212
|
+
}
|
|
20213
|
+
}
|
|
20214
|
+
});
|
|
20215
|
+
const cascaderKls = computed(() => {
|
|
20216
|
+
return [
|
|
20217
|
+
nsCascader.b(),
|
|
20218
|
+
nsCascader.m(realSize.value),
|
|
20219
|
+
nsCascader.is("disabled", isDisabled.value),
|
|
20220
|
+
attrs.class
|
|
20221
|
+
];
|
|
20222
|
+
});
|
|
20223
|
+
const cascaderIconKls = computed(() => {
|
|
20224
|
+
return [
|
|
20225
|
+
nsInput.e("icon"),
|
|
20226
|
+
"icon-arrow-down",
|
|
20227
|
+
nsCascader.is("reverse", popperVisible.value)
|
|
20228
|
+
];
|
|
20229
|
+
});
|
|
20230
|
+
const inputClass = computed(() => {
|
|
20231
|
+
return nsCascader.is("focus", popperVisible.value || filterFocus.value);
|
|
20232
|
+
});
|
|
20233
|
+
const contentRef = computed(() => {
|
|
20234
|
+
var _a, _b;
|
|
20235
|
+
return (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef;
|
|
20236
|
+
});
|
|
20237
|
+
const togglePopperVisible = (visible) => {
|
|
20238
|
+
var _a, _b, _c;
|
|
20239
|
+
if (isDisabled.value)
|
|
20240
|
+
return;
|
|
20241
|
+
visible = visible != null ? visible : !popperVisible.value;
|
|
20242
|
+
if (visible !== popperVisible.value) {
|
|
20243
|
+
popperVisible.value = visible;
|
|
20244
|
+
(_b = (_a = input.value) == null ? void 0 : _a.input) == null ? void 0 : _b.setAttribute("aria-expanded", `${visible}`);
|
|
20245
|
+
if (visible) {
|
|
20246
|
+
updatePopperPosition();
|
|
20247
|
+
nextTick((_c = cascaderPanelRef.value) == null ? void 0 : _c.scrollToExpandingNode);
|
|
20248
|
+
} else if (props.filterable) {
|
|
20249
|
+
syncPresentTextValue();
|
|
20250
|
+
}
|
|
20251
|
+
emit("visibleChange", visible);
|
|
20252
|
+
}
|
|
20253
|
+
};
|
|
20254
|
+
const updatePopperPosition = () => {
|
|
20255
|
+
nextTick(() => {
|
|
20256
|
+
var _a;
|
|
20257
|
+
(_a = tooltipRef.value) == null ? void 0 : _a.updatePopper();
|
|
20258
|
+
});
|
|
20259
|
+
};
|
|
20260
|
+
const hideSuggestionPanel = () => {
|
|
20261
|
+
filtering.value = false;
|
|
20262
|
+
};
|
|
20263
|
+
const genTag = (node) => {
|
|
20264
|
+
const { showAllLevels, separator } = props;
|
|
20265
|
+
return {
|
|
20266
|
+
node,
|
|
20267
|
+
key: node.uid,
|
|
20268
|
+
text: node.calcText(showAllLevels, separator),
|
|
20269
|
+
hitState: false,
|
|
20270
|
+
closable: !isDisabled.value && !node.isDisabled,
|
|
20271
|
+
isCollapseTag: false
|
|
20272
|
+
};
|
|
20273
|
+
};
|
|
20274
|
+
const deleteTag = (tag) => {
|
|
20275
|
+
var _a;
|
|
20276
|
+
const node = tag.node;
|
|
20277
|
+
node.doCheck(false);
|
|
20278
|
+
(_a = cascaderPanelRef.value) == null ? void 0 : _a.calculateCheckedValue();
|
|
20279
|
+
emit("removeTag", node.valueByOption);
|
|
20280
|
+
};
|
|
20281
|
+
const calculatePresentTags = () => {
|
|
20282
|
+
if (!multiple.value)
|
|
20283
|
+
return;
|
|
20284
|
+
const nodes = checkedNodes.value;
|
|
20285
|
+
const tags = [];
|
|
20286
|
+
const allTags = [];
|
|
20287
|
+
nodes.forEach((node) => allTags.push(genTag(node)));
|
|
20288
|
+
allPresentTags.value = allTags;
|
|
20289
|
+
if (nodes.length) {
|
|
20290
|
+
nodes.slice(0, props.maxCollapseTags).forEach((node) => tags.push(genTag(node)));
|
|
20291
|
+
const rest = nodes.slice(props.maxCollapseTags);
|
|
20292
|
+
const restCount = rest.length;
|
|
20293
|
+
if (restCount) {
|
|
20294
|
+
if (props.collapseTags) {
|
|
20295
|
+
tags.push({
|
|
20296
|
+
key: -1,
|
|
20297
|
+
text: `+ ${restCount}`,
|
|
20298
|
+
closable: false,
|
|
20299
|
+
isCollapseTag: true
|
|
20300
|
+
});
|
|
20301
|
+
} else {
|
|
20302
|
+
rest.forEach((node) => tags.push(genTag(node)));
|
|
20303
|
+
}
|
|
20304
|
+
}
|
|
20305
|
+
}
|
|
20306
|
+
presentTags.value = tags;
|
|
20307
|
+
};
|
|
20308
|
+
const calculateSuggestions = () => {
|
|
20309
|
+
var _a, _b;
|
|
20310
|
+
const { filterMethod, showAllLevels, separator } = props;
|
|
20311
|
+
const res = (_b = (_a = cascaderPanelRef.value) == null ? void 0 : _a.getFlattedNodes(!props.props.checkStrictly)) == null ? void 0 : _b.filter((node) => {
|
|
20312
|
+
if (node.isDisabled)
|
|
20313
|
+
return false;
|
|
20314
|
+
node.calcText(showAllLevels, separator);
|
|
20315
|
+
return filterMethod(node, searchKeyword.value);
|
|
20316
|
+
});
|
|
20317
|
+
if (multiple.value) {
|
|
20318
|
+
presentTags.value.forEach((tag) => {
|
|
20319
|
+
tag.hitState = false;
|
|
20320
|
+
});
|
|
20321
|
+
allPresentTags.value.forEach((tag) => {
|
|
20322
|
+
tag.hitState = false;
|
|
20323
|
+
});
|
|
20324
|
+
}
|
|
20325
|
+
filtering.value = true;
|
|
20326
|
+
suggestions.value = res;
|
|
20327
|
+
updatePopperPosition();
|
|
20328
|
+
};
|
|
20329
|
+
const focusFirstNode = () => {
|
|
20330
|
+
var _a;
|
|
20331
|
+
let firstNode;
|
|
20332
|
+
if (filtering.value && suggestionPanel.value) {
|
|
20333
|
+
firstNode = suggestionPanel.value.$el.querySelector(`.${nsCascader.e("suggestion-item")}`);
|
|
20334
|
+
} else {
|
|
20335
|
+
firstNode = (_a = cascaderPanelRef.value) == null ? void 0 : _a.$el.querySelector(`.${nsCascader.b("node")}[tabindex="-1"]`);
|
|
20336
|
+
}
|
|
20337
|
+
if (firstNode) {
|
|
20338
|
+
firstNode.focus();
|
|
20339
|
+
!filtering.value && firstNode.click();
|
|
20340
|
+
}
|
|
20341
|
+
};
|
|
20342
|
+
const updateStyle = () => {
|
|
20343
|
+
var _a, _b;
|
|
20344
|
+
const inputInner = (_a = input.value) == null ? void 0 : _a.input;
|
|
20345
|
+
const tagWrapperEl = tagWrapper.value;
|
|
20346
|
+
const suggestionPanelEl = (_b = suggestionPanel.value) == null ? void 0 : _b.$el;
|
|
20347
|
+
if (!isClient || !inputInner)
|
|
20348
|
+
return;
|
|
20349
|
+
if (suggestionPanelEl) {
|
|
20350
|
+
const suggestionList = suggestionPanelEl.querySelector(`.${nsCascader.e("suggestion-list")}`);
|
|
20351
|
+
suggestionList.style.minWidth = `${inputInner.offsetWidth}px`;
|
|
20352
|
+
}
|
|
20353
|
+
if (tagWrapperEl) {
|
|
20354
|
+
const { offsetHeight } = tagWrapperEl;
|
|
20355
|
+
const height = presentTags.value.length > 0 ? `${Math.max(offsetHeight, inputInitialHeight) - 2}px` : `${inputInitialHeight}px`;
|
|
20356
|
+
inputInner.style.height = height;
|
|
20357
|
+
updatePopperPosition();
|
|
20358
|
+
}
|
|
20359
|
+
};
|
|
20360
|
+
const getCheckedNodes = (leafOnly) => {
|
|
20361
|
+
var _a;
|
|
20362
|
+
return (_a = cascaderPanelRef.value) == null ? void 0 : _a.getCheckedNodes(leafOnly);
|
|
20363
|
+
};
|
|
20364
|
+
const handleExpandChange = (value) => {
|
|
20365
|
+
updatePopperPosition();
|
|
20366
|
+
emit("expandChange", value);
|
|
20367
|
+
};
|
|
20368
|
+
const handleKeyDown = (e) => {
|
|
20369
|
+
if (isComposing.value)
|
|
20370
|
+
return;
|
|
20371
|
+
switch (e.code) {
|
|
20372
|
+
case EVENT_CODE.enter:
|
|
20373
|
+
case EVENT_CODE.numpadEnter:
|
|
20374
|
+
togglePopperVisible();
|
|
20375
|
+
break;
|
|
20376
|
+
case EVENT_CODE.down:
|
|
20377
|
+
togglePopperVisible(true);
|
|
20378
|
+
nextTick(focusFirstNode);
|
|
20379
|
+
e.preventDefault();
|
|
20380
|
+
break;
|
|
20381
|
+
case EVENT_CODE.esc:
|
|
20382
|
+
if (popperVisible.value === true) {
|
|
20383
|
+
e.preventDefault();
|
|
20384
|
+
e.stopPropagation();
|
|
20385
|
+
togglePopperVisible(false);
|
|
20386
|
+
}
|
|
20387
|
+
break;
|
|
20388
|
+
case EVENT_CODE.tab:
|
|
20389
|
+
togglePopperVisible(false);
|
|
20390
|
+
break;
|
|
20391
|
+
}
|
|
20392
|
+
};
|
|
20393
|
+
const handleClear = () => {
|
|
20394
|
+
var _a;
|
|
20395
|
+
(_a = cascaderPanelRef.value) == null ? void 0 : _a.clearCheckedNodes();
|
|
20396
|
+
if (!popperVisible.value && props.filterable) {
|
|
20397
|
+
syncPresentTextValue();
|
|
20398
|
+
}
|
|
20399
|
+
togglePopperVisible(false);
|
|
20400
|
+
emit("clear");
|
|
20401
|
+
};
|
|
20402
|
+
const syncPresentTextValue = () => {
|
|
20403
|
+
const { value } = presentText;
|
|
20404
|
+
inputValue.value = value;
|
|
20405
|
+
searchInputValue.value = value;
|
|
20406
|
+
};
|
|
20407
|
+
const handleSuggestionClick = (node) => {
|
|
20408
|
+
var _a, _b;
|
|
20409
|
+
const { checked } = node;
|
|
20410
|
+
if (multiple.value) {
|
|
20411
|
+
(_a = cascaderPanelRef.value) == null ? void 0 : _a.handleCheckChange(node, !checked, false);
|
|
20412
|
+
} else {
|
|
20413
|
+
!checked && ((_b = cascaderPanelRef.value) == null ? void 0 : _b.handleCheckChange(node, true, false));
|
|
20414
|
+
togglePopperVisible(false);
|
|
20415
|
+
}
|
|
20416
|
+
};
|
|
20417
|
+
const handleSuggestionKeyDown = (e) => {
|
|
20418
|
+
const target = e.target;
|
|
20419
|
+
const { code } = e;
|
|
20420
|
+
switch (code) {
|
|
20421
|
+
case EVENT_CODE.up:
|
|
20422
|
+
case EVENT_CODE.down: {
|
|
20423
|
+
const distance = code === EVENT_CODE.up ? -1 : 1;
|
|
20424
|
+
focusNode(getSibling(target, distance, `.${nsCascader.e("suggestion-item")}[tabindex="-1"]`));
|
|
20425
|
+
break;
|
|
20426
|
+
}
|
|
20427
|
+
case EVENT_CODE.enter:
|
|
20428
|
+
case EVENT_CODE.numpadEnter:
|
|
20429
|
+
target.click();
|
|
20430
|
+
break;
|
|
20431
|
+
}
|
|
20432
|
+
};
|
|
20433
|
+
const handleDelete = () => {
|
|
20434
|
+
const tags = presentTags.value;
|
|
20435
|
+
const lastTag = tags[tags.length - 1];
|
|
20436
|
+
pressDeleteCount = searchInputValue.value ? 0 : pressDeleteCount + 1;
|
|
20437
|
+
if (!lastTag || !pressDeleteCount || props.collapseTags && tags.length > 1)
|
|
20438
|
+
return;
|
|
20439
|
+
if (lastTag.hitState) {
|
|
20440
|
+
deleteTag(lastTag);
|
|
20441
|
+
} else {
|
|
20442
|
+
lastTag.hitState = true;
|
|
20443
|
+
}
|
|
20444
|
+
};
|
|
20445
|
+
const handleFocus = (e) => {
|
|
20446
|
+
const el = e.target;
|
|
20447
|
+
const name = nsCascader.e("search-input");
|
|
20448
|
+
if (el.className === name) {
|
|
20449
|
+
filterFocus.value = true;
|
|
20450
|
+
}
|
|
20451
|
+
emit("focus", e);
|
|
20452
|
+
};
|
|
20453
|
+
const handleBlur = (e) => {
|
|
20454
|
+
filterFocus.value = false;
|
|
20455
|
+
emit("blur", e);
|
|
20456
|
+
};
|
|
20457
|
+
const handleFilter = debounce(() => {
|
|
20458
|
+
const { value } = searchKeyword;
|
|
20459
|
+
if (!value)
|
|
20460
|
+
return;
|
|
20461
|
+
const passed = props.beforeFilter(value);
|
|
20462
|
+
if (isPromise(passed)) {
|
|
20463
|
+
passed.then(calculateSuggestions).catch(() => {
|
|
20464
|
+
});
|
|
20465
|
+
} else if (passed !== false) {
|
|
20466
|
+
calculateSuggestions();
|
|
20467
|
+
} else {
|
|
20468
|
+
hideSuggestionPanel();
|
|
20469
|
+
}
|
|
20470
|
+
}, props.debounce);
|
|
20471
|
+
const handleInput = (val, e) => {
|
|
20472
|
+
!popperVisible.value && togglePopperVisible(true);
|
|
20473
|
+
if (e == null ? void 0 : e.isComposing)
|
|
20474
|
+
return;
|
|
20475
|
+
val ? handleFilter() : hideSuggestionPanel();
|
|
20476
|
+
};
|
|
20477
|
+
const getInputInnerHeight = (inputInner) => Number.parseFloat(useCssVar(nsInput.cssVarName("input-height"), inputInner).value) - 2;
|
|
20478
|
+
watch(filtering, updatePopperPosition);
|
|
20479
|
+
watch([checkedNodes, isDisabled, () => props.collapseTags], calculatePresentTags);
|
|
20480
|
+
watch(presentTags, () => {
|
|
20481
|
+
nextTick(() => updateStyle());
|
|
20482
|
+
});
|
|
20483
|
+
watch(realSize, async () => {
|
|
20484
|
+
await nextTick();
|
|
20485
|
+
const inputInner = input.value.input;
|
|
20486
|
+
inputInitialHeight = getInputInnerHeight(inputInner) || inputInitialHeight;
|
|
20487
|
+
updateStyle();
|
|
20488
|
+
});
|
|
20489
|
+
watch(presentText, syncPresentTextValue, { immediate: true });
|
|
20490
|
+
onMounted(() => {
|
|
20491
|
+
const inputInner = input.value.input;
|
|
20492
|
+
const inputInnerHeight = getInputInnerHeight(inputInner);
|
|
20493
|
+
inputInitialHeight = inputInner.offsetHeight || inputInnerHeight;
|
|
20494
|
+
useResizeObserver(inputInner, updateStyle);
|
|
20495
|
+
});
|
|
20496
|
+
expose({
|
|
20497
|
+
getCheckedNodes,
|
|
20498
|
+
cascaderPanelRef,
|
|
20499
|
+
togglePopperVisible,
|
|
20500
|
+
contentRef,
|
|
20501
|
+
presentText
|
|
20502
|
+
});
|
|
20503
|
+
return (_ctx, _cache) => {
|
|
20504
|
+
return openBlock(), createBlock(unref(ElTooltip), {
|
|
20505
|
+
ref_key: "tooltipRef",
|
|
20506
|
+
ref: tooltipRef,
|
|
20507
|
+
visible: popperVisible.value,
|
|
20508
|
+
teleported: _ctx.teleported,
|
|
20509
|
+
"popper-class": [unref(nsCascader).e("dropdown"), _ctx.popperClass],
|
|
20510
|
+
"popper-options": popperOptions,
|
|
20511
|
+
"fallback-placements": _ctx.fallbackPlacements,
|
|
20512
|
+
"stop-popper-mouse-event": false,
|
|
20513
|
+
"gpu-acceleration": false,
|
|
20514
|
+
placement: _ctx.placement,
|
|
20515
|
+
transition: `${unref(nsCascader).namespace.value}-zoom-in-top`,
|
|
20516
|
+
effect: "light",
|
|
20517
|
+
pure: "",
|
|
20518
|
+
persistent: _ctx.persistent,
|
|
20519
|
+
onHide: hideSuggestionPanel
|
|
20520
|
+
}, {
|
|
20521
|
+
default: withCtx(() => [
|
|
20522
|
+
withDirectives((openBlock(), createElementBlock("div", {
|
|
20523
|
+
class: normalizeClass(unref(cascaderKls)),
|
|
20524
|
+
style: normalizeStyle(unref(cascaderStyle)),
|
|
20525
|
+
onClick: () => togglePopperVisible(unref(readonly) ? void 0 : true),
|
|
20526
|
+
onKeydown: handleKeyDown,
|
|
20527
|
+
onMouseenter: ($event) => inputHover.value = true,
|
|
20528
|
+
onMouseleave: ($event) => inputHover.value = false
|
|
20529
|
+
}, [
|
|
20530
|
+
createVNode(unref(ElInput), {
|
|
20531
|
+
ref_key: "input",
|
|
20532
|
+
ref: input,
|
|
20533
|
+
modelValue: inputValue.value,
|
|
20534
|
+
"onUpdate:modelValue": ($event) => inputValue.value = $event,
|
|
20535
|
+
placeholder: unref(currentPlaceholder),
|
|
20536
|
+
readonly: unref(readonly),
|
|
20537
|
+
disabled: unref(isDisabled),
|
|
20538
|
+
"validate-event": false,
|
|
20539
|
+
size: unref(realSize),
|
|
20540
|
+
class: normalizeClass(unref(inputClass)),
|
|
20541
|
+
tabindex: unref(multiple) && _ctx.filterable && !unref(isDisabled) ? -1 : void 0,
|
|
20542
|
+
onCompositionstart: unref(handleComposition),
|
|
20543
|
+
onCompositionupdate: unref(handleComposition),
|
|
20544
|
+
onCompositionend: unref(handleComposition),
|
|
20545
|
+
onFocus: handleFocus,
|
|
20546
|
+
onBlur: handleBlur,
|
|
20547
|
+
onInput: handleInput
|
|
20548
|
+
}, {
|
|
20549
|
+
suffix: withCtx(() => [
|
|
20550
|
+
unref(clearBtnVisible) ? (openBlock(), createBlock(unref(ElIcon), {
|
|
20551
|
+
key: "clear",
|
|
20552
|
+
class: normalizeClass([unref(nsInput).e("icon"), "icon-circle-close"]),
|
|
20553
|
+
onClick: withModifiers(handleClear, ["stop"])
|
|
20554
|
+
}, {
|
|
20555
|
+
default: withCtx(() => [
|
|
20556
|
+
createVNode(unref(circle_close_default))
|
|
20557
|
+
]),
|
|
20558
|
+
_: 1
|
|
20559
|
+
}, 8, ["class", "onClick"])) : (openBlock(), createBlock(unref(ElIcon), {
|
|
20560
|
+
key: "arrow-down",
|
|
20561
|
+
class: normalizeClass(unref(cascaderIconKls)),
|
|
20562
|
+
onClick: withModifiers(($event) => togglePopperVisible(), ["stop"])
|
|
20563
|
+
}, {
|
|
20564
|
+
default: withCtx(() => [
|
|
20565
|
+
createVNode(unref(arrow_down_default))
|
|
20566
|
+
]),
|
|
20567
|
+
_: 1
|
|
20568
|
+
}, 8, ["class", "onClick"]))
|
|
20569
|
+
]),
|
|
20570
|
+
_: 1
|
|
20571
|
+
}, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "readonly", "disabled", "size", "class", "tabindex", "onCompositionstart", "onCompositionupdate", "onCompositionend"]),
|
|
20572
|
+
unref(multiple) ? (openBlock(), createElementBlock("div", {
|
|
20573
|
+
key: 0,
|
|
20574
|
+
ref_key: "tagWrapper",
|
|
20575
|
+
ref: tagWrapper,
|
|
20576
|
+
class: normalizeClass([
|
|
20577
|
+
unref(nsCascader).e("tags"),
|
|
20578
|
+
unref(nsCascader).is("validate", Boolean(unref(validateState)))
|
|
20579
|
+
])
|
|
20580
|
+
}, [
|
|
20581
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(presentTags.value, (tag) => {
|
|
20582
|
+
return openBlock(), createBlock(unref(ElTag), {
|
|
20583
|
+
key: tag.key,
|
|
20584
|
+
type: _ctx.tagType,
|
|
20585
|
+
size: unref(tagSize),
|
|
20586
|
+
effect: _ctx.tagEffect,
|
|
20587
|
+
hit: tag.hitState,
|
|
20588
|
+
closable: tag.closable,
|
|
20589
|
+
"disable-transitions": "",
|
|
20590
|
+
onClose: ($event) => deleteTag(tag)
|
|
20591
|
+
}, {
|
|
20592
|
+
default: withCtx(() => [
|
|
20593
|
+
tag.isCollapseTag === false ? (openBlock(), createElementBlock("span", { key: 0 }, toDisplayString(tag.text), 1)) : (openBlock(), createBlock(unref(ElTooltip), {
|
|
20594
|
+
key: 1,
|
|
20595
|
+
disabled: popperVisible.value || !_ctx.collapseTagsTooltip,
|
|
20596
|
+
"fallback-placements": ["bottom", "top", "right", "left"],
|
|
20597
|
+
placement: "bottom",
|
|
20598
|
+
effect: "light"
|
|
20599
|
+
}, {
|
|
20600
|
+
default: withCtx(() => [
|
|
20601
|
+
createElementVNode("span", null, toDisplayString(tag.text), 1)
|
|
20602
|
+
]),
|
|
20603
|
+
content: withCtx(() => [
|
|
20604
|
+
createElementVNode("div", {
|
|
20605
|
+
class: normalizeClass(unref(nsCascader).e("collapse-tags"))
|
|
20606
|
+
}, [
|
|
20607
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(allPresentTags.value.slice(_ctx.maxCollapseTags), (tag2, idx) => {
|
|
20608
|
+
return openBlock(), createElementBlock("div", {
|
|
20609
|
+
key: idx,
|
|
20610
|
+
class: normalizeClass(unref(nsCascader).e("collapse-tag"))
|
|
20611
|
+
}, [
|
|
20612
|
+
(openBlock(), createBlock(unref(ElTag), {
|
|
20613
|
+
key: tag2.key,
|
|
20614
|
+
class: "in-tooltip",
|
|
20615
|
+
type: _ctx.tagType,
|
|
20616
|
+
size: unref(tagSize),
|
|
20617
|
+
effect: _ctx.tagEffect,
|
|
20618
|
+
hit: tag2.hitState,
|
|
20619
|
+
closable: tag2.closable,
|
|
20620
|
+
"disable-transitions": "",
|
|
20621
|
+
onClose: ($event) => deleteTag(tag2)
|
|
20622
|
+
}, {
|
|
20623
|
+
default: withCtx(() => [
|
|
20624
|
+
createElementVNode("span", null, toDisplayString(tag2.text), 1)
|
|
20625
|
+
]),
|
|
20626
|
+
_: 2
|
|
20627
|
+
}, 1032, ["type", "size", "effect", "hit", "closable", "onClose"]))
|
|
20628
|
+
], 2);
|
|
20629
|
+
}), 128))
|
|
20630
|
+
], 2)
|
|
20631
|
+
]),
|
|
20632
|
+
_: 2
|
|
20633
|
+
}, 1032, ["disabled"]))
|
|
20634
|
+
]),
|
|
20635
|
+
_: 2
|
|
20636
|
+
}, 1032, ["type", "size", "effect", "hit", "closable", "onClose"]);
|
|
20637
|
+
}), 128)),
|
|
20638
|
+
_ctx.filterable && !unref(isDisabled) ? withDirectives((openBlock(), createElementBlock("input", {
|
|
20639
|
+
key: 0,
|
|
20640
|
+
"onUpdate:modelValue": ($event) => searchInputValue.value = $event,
|
|
20641
|
+
type: "text",
|
|
20642
|
+
class: normalizeClass(unref(nsCascader).e("search-input")),
|
|
20643
|
+
placeholder: unref(presentText) ? "" : unref(inputPlaceholder),
|
|
20644
|
+
onInput: (e) => handleInput(searchInputValue.value, e),
|
|
20645
|
+
onClick: withModifiers(($event) => togglePopperVisible(true), ["stop"]),
|
|
20646
|
+
onKeydown: withKeys(handleDelete, ["delete"]),
|
|
20647
|
+
onCompositionstart: unref(handleComposition),
|
|
20648
|
+
onCompositionupdate: unref(handleComposition),
|
|
20649
|
+
onCompositionend: unref(handleComposition),
|
|
20650
|
+
onFocus: handleFocus,
|
|
20651
|
+
onBlur: handleBlur
|
|
20652
|
+
}, null, 42, ["onUpdate:modelValue", "placeholder", "onInput", "onClick", "onKeydown", "onCompositionstart", "onCompositionupdate", "onCompositionend"])), [
|
|
20653
|
+
[vModelText, searchInputValue.value]
|
|
20654
|
+
]) : createCommentVNode("v-if", true)
|
|
20655
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
20656
|
+
], 46, ["onClick", "onMouseenter", "onMouseleave"])), [
|
|
20657
|
+
[unref(ClickOutside), () => togglePopperVisible(false), unref(contentRef)]
|
|
20658
|
+
])
|
|
20659
|
+
]),
|
|
20660
|
+
content: withCtx(() => [
|
|
20661
|
+
withDirectives(createVNode(unref(ElCascaderPanel), {
|
|
20662
|
+
ref_key: "cascaderPanelRef",
|
|
20663
|
+
ref: cascaderPanelRef,
|
|
20664
|
+
modelValue: unref(checkedValue),
|
|
20665
|
+
"onUpdate:modelValue": ($event) => isRef(checkedValue) ? checkedValue.value = $event : null,
|
|
20666
|
+
options: _ctx.options,
|
|
20667
|
+
props: props.props,
|
|
20668
|
+
border: false,
|
|
20669
|
+
"render-label": _ctx.$slots.default,
|
|
20670
|
+
onExpandChange: handleExpandChange,
|
|
20671
|
+
onClose: ($event) => _ctx.$nextTick(() => togglePopperVisible(false))
|
|
20672
|
+
}, {
|
|
20673
|
+
empty: withCtx(() => [
|
|
20674
|
+
renderSlot(_ctx.$slots, "empty")
|
|
20675
|
+
]),
|
|
20676
|
+
_: 3
|
|
20677
|
+
}, 8, ["modelValue", "onUpdate:modelValue", "options", "props", "render-label", "onClose"]), [
|
|
20678
|
+
[vShow, !filtering.value]
|
|
20679
|
+
]),
|
|
20680
|
+
_ctx.filterable ? withDirectives((openBlock(), createBlock(unref(ElScrollbar), {
|
|
20681
|
+
key: 0,
|
|
20682
|
+
ref_key: "suggestionPanel",
|
|
20683
|
+
ref: suggestionPanel,
|
|
20684
|
+
tag: "ul",
|
|
20685
|
+
class: normalizeClass(unref(nsCascader).e("suggestion-panel")),
|
|
20686
|
+
"view-class": unref(nsCascader).e("suggestion-list"),
|
|
20687
|
+
onKeydown: handleSuggestionKeyDown
|
|
20688
|
+
}, {
|
|
20689
|
+
default: withCtx(() => [
|
|
20690
|
+
suggestions.value.length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(suggestions.value, (item) => {
|
|
20691
|
+
return openBlock(), createElementBlock("li", {
|
|
20692
|
+
key: item.uid,
|
|
20693
|
+
class: normalizeClass([
|
|
20694
|
+
unref(nsCascader).e("suggestion-item"),
|
|
20695
|
+
unref(nsCascader).is("checked", item.checked)
|
|
20696
|
+
]),
|
|
20697
|
+
tabindex: -1,
|
|
20698
|
+
onClick: ($event) => handleSuggestionClick(item)
|
|
20699
|
+
}, [
|
|
20700
|
+
createElementVNode("span", null, toDisplayString(item.text), 1),
|
|
20701
|
+
item.checked ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
|
|
20702
|
+
default: withCtx(() => [
|
|
20703
|
+
createVNode(unref(check_default))
|
|
20704
|
+
]),
|
|
20705
|
+
_: 1
|
|
20706
|
+
})) : createCommentVNode("v-if", true)
|
|
20707
|
+
], 10, ["onClick"]);
|
|
20708
|
+
}), 128)) : renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
|
|
20709
|
+
createElementVNode("li", {
|
|
20710
|
+
class: normalizeClass(unref(nsCascader).e("empty-text"))
|
|
20711
|
+
}, toDisplayString(unref(t)("el.cascader.noMatch")), 3)
|
|
20712
|
+
])
|
|
20713
|
+
]),
|
|
20714
|
+
_: 3
|
|
20715
|
+
}, 8, ["class", "view-class"])), [
|
|
20716
|
+
[vShow, filtering.value]
|
|
20717
|
+
]) : createCommentVNode("v-if", true)
|
|
20718
|
+
]),
|
|
20719
|
+
_: 3
|
|
20720
|
+
}, 8, ["visible", "teleported", "popper-class", "fallback-placements", "placement", "transition", "persistent"]);
|
|
20721
|
+
};
|
|
20722
|
+
}
|
|
20723
|
+
});
|
|
20724
|
+
var Cascader$1 = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__file", "cascader.vue"]]);
|
|
20725
|
+
|
|
20726
|
+
const ElCascader = withInstall(Cascader$1);
|
|
20727
|
+
|
|
18246
20728
|
const REPEAT_INTERVAL = 100;
|
|
18247
20729
|
const REPEAT_DELAY = 600;
|
|
18248
20730
|
const vRepeatClick = {
|
|
@@ -18279,22 +20761,22 @@ const vRepeatClick = {
|
|
|
18279
20761
|
}
|
|
18280
20762
|
};
|
|
18281
20763
|
|
|
18282
|
-
const _sfc_main$
|
|
20764
|
+
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
18283
20765
|
inheritAttrs: false
|
|
18284
20766
|
});
|
|
18285
20767
|
function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18286
20768
|
return renderSlot(_ctx.$slots, "default");
|
|
18287
20769
|
}
|
|
18288
|
-
var Collection = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
20770
|
+
var Collection = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$8], ["__file", "collection.vue"]]);
|
|
18289
20771
|
|
|
18290
|
-
const _sfc_main$
|
|
20772
|
+
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
18291
20773
|
name: "ElCollectionItem",
|
|
18292
20774
|
inheritAttrs: false
|
|
18293
20775
|
});
|
|
18294
20776
|
function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
18295
20777
|
return renderSlot(_ctx.$slots, "default");
|
|
18296
20778
|
}
|
|
18297
|
-
var CollectionItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
20779
|
+
var CollectionItem = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$7], ["__file", "collection-item.vue"]]);
|
|
18298
20780
|
|
|
18299
20781
|
const COLLECTION_ITEM_SIGN = `data-el-collection-item`;
|
|
18300
20782
|
const createCollectionWithScope = (name) => {
|
|
@@ -18440,12 +20922,6 @@ buildProps({
|
|
|
18440
20922
|
buildProps({
|
|
18441
20923
|
onKeydown: { type: definePropType(Function) }
|
|
18442
20924
|
});
|
|
18443
|
-
[
|
|
18444
|
-
EVENT_CODE.down,
|
|
18445
|
-
EVENT_CODE.pageDown,
|
|
18446
|
-
EVENT_CODE.home
|
|
18447
|
-
];
|
|
18448
|
-
[EVENT_CODE.up, EVENT_CODE.pageUp, EVENT_CODE.end];
|
|
18449
20925
|
createCollectionWithScope("Dropdown");
|
|
18450
20926
|
|
|
18451
20927
|
const inputNumberProps = buildProps({
|
|
@@ -18504,11 +20980,11 @@ const inputNumberEmits = {
|
|
|
18504
20980
|
[UPDATE_MODEL_EVENT]: (val) => isNumber(val) || isNil(val)
|
|
18505
20981
|
};
|
|
18506
20982
|
|
|
18507
|
-
const __default__$
|
|
20983
|
+
const __default__$h = defineComponent({
|
|
18508
20984
|
name: "ElInputNumber"
|
|
18509
20985
|
});
|
|
18510
|
-
const _sfc_main$
|
|
18511
|
-
...__default__$
|
|
20986
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
20987
|
+
...__default__$h,
|
|
18512
20988
|
props: inputNumberProps,
|
|
18513
20989
|
emits: inputNumberEmits,
|
|
18514
20990
|
setup(__props, { expose, emit }) {
|
|
@@ -18834,7 +21310,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
18834
21310
|
};
|
|
18835
21311
|
}
|
|
18836
21312
|
});
|
|
18837
|
-
var InputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
21313
|
+
var InputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__file", "input-number.vue"]]);
|
|
18838
21314
|
|
|
18839
21315
|
const ElInputNumber = withInstall(InputNumber);
|
|
18840
21316
|
|
|
@@ -18881,11 +21357,11 @@ const linkEmits = {
|
|
|
18881
21357
|
click: (evt) => evt instanceof MouseEvent
|
|
18882
21358
|
};
|
|
18883
21359
|
|
|
18884
|
-
const __default__$
|
|
21360
|
+
const __default__$g = defineComponent({
|
|
18885
21361
|
name: "ElLink"
|
|
18886
21362
|
});
|
|
18887
|
-
const _sfc_main$
|
|
18888
|
-
...__default__$
|
|
21363
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
21364
|
+
...__default__$g,
|
|
18889
21365
|
props: linkProps,
|
|
18890
21366
|
emits: linkEmits,
|
|
18891
21367
|
setup(__props, { emit }) {
|
|
@@ -18925,7 +21401,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
18925
21401
|
};
|
|
18926
21402
|
}
|
|
18927
21403
|
});
|
|
18928
|
-
var Link = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
21404
|
+
var Link = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__file", "link.vue"]]);
|
|
18929
21405
|
|
|
18930
21406
|
const ElLink = withInstall(Link);
|
|
18931
21407
|
|
|
@@ -18936,12 +21412,12 @@ function useOption$1(props, states) {
|
|
|
18936
21412
|
const select = inject(selectKey);
|
|
18937
21413
|
const selectGroup = inject(selectGroupKey, { disabled: false });
|
|
18938
21414
|
const itemSelected = computed(() => {
|
|
18939
|
-
return contains(castArray(select.props.modelValue), props.value);
|
|
21415
|
+
return contains(castArray$1(select.props.modelValue), props.value);
|
|
18940
21416
|
});
|
|
18941
21417
|
const limitReached = computed(() => {
|
|
18942
21418
|
var _a;
|
|
18943
21419
|
if (select.props.multiple) {
|
|
18944
|
-
const modelValue = castArray((_a = select.props.modelValue) != null ? _a : []);
|
|
21420
|
+
const modelValue = castArray$1((_a = select.props.modelValue) != null ? _a : []);
|
|
18945
21421
|
return !itemSelected.value && modelValue.length >= select.props.multipleLimit && select.props.multipleLimit > 0;
|
|
18946
21422
|
} else {
|
|
18947
21423
|
return false;
|
|
@@ -19007,7 +21483,7 @@ function useOption$1(props, states) {
|
|
|
19007
21483
|
};
|
|
19008
21484
|
}
|
|
19009
21485
|
|
|
19010
|
-
const _sfc_main$
|
|
21486
|
+
const _sfc_main$n = defineComponent({
|
|
19011
21487
|
name: "ElOption",
|
|
19012
21488
|
componentName: "ElOption",
|
|
19013
21489
|
props: {
|
|
@@ -19097,9 +21573,9 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
19097
21573
|
[vShow, _ctx.visible]
|
|
19098
21574
|
]);
|
|
19099
21575
|
}
|
|
19100
|
-
var Option = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
21576
|
+
var Option = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$6], ["__file", "option.vue"]]);
|
|
19101
21577
|
|
|
19102
|
-
const _sfc_main$
|
|
21578
|
+
const _sfc_main$m = defineComponent({
|
|
19103
21579
|
name: "ElSelectDropdown",
|
|
19104
21580
|
componentName: "ElSelectDropdown",
|
|
19105
21581
|
setup() {
|
|
@@ -19146,7 +21622,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
19146
21622
|
], 2)) : createCommentVNode("v-if", true)
|
|
19147
21623
|
], 6);
|
|
19148
21624
|
}
|
|
19149
|
-
var ElSelectMenu$1 = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
21625
|
+
var ElSelectMenu$1 = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$5], ["__file", "select-dropdown.vue"]]);
|
|
19150
21626
|
|
|
19151
21627
|
const useSelect$1 = (props, emit) => {
|
|
19152
21628
|
const { t } = useLocale();
|
|
@@ -19286,7 +21762,7 @@ const useSelect$1 = (props, emit) => {
|
|
|
19286
21762
|
});
|
|
19287
21763
|
const shouldShowPlaceholder = computed(() => {
|
|
19288
21764
|
if (props.multiple && !isUndefined(props.modelValue)) {
|
|
19289
|
-
return castArray(props.modelValue).length === 0 && !states.inputValue;
|
|
21765
|
+
return castArray$1(props.modelValue).length === 0 && !states.inputValue;
|
|
19290
21766
|
}
|
|
19291
21767
|
const value = isArray$1(props.modelValue) ? props.modelValue[0] : props.modelValue;
|
|
19292
21768
|
return props.filterable || isUndefined(value) ? !states.inputValue : true;
|
|
@@ -19382,7 +21858,7 @@ const useSelect$1 = (props, emit) => {
|
|
|
19382
21858
|
}
|
|
19383
21859
|
const result = [];
|
|
19384
21860
|
if (!isUndefined(props.modelValue)) {
|
|
19385
|
-
castArray(props.modelValue).forEach((value) => {
|
|
21861
|
+
castArray$1(props.modelValue).forEach((value) => {
|
|
19386
21862
|
result.push(getOption(value));
|
|
19387
21863
|
});
|
|
19388
21864
|
}
|
|
@@ -19463,7 +21939,7 @@ const useSelect$1 = (props, emit) => {
|
|
|
19463
21939
|
if (e.code === EVENT_CODE.delete)
|
|
19464
21940
|
return;
|
|
19465
21941
|
if (e.target.value.length <= 0) {
|
|
19466
|
-
const value = castArray(props.modelValue).slice();
|
|
21942
|
+
const value = castArray$1(props.modelValue).slice();
|
|
19467
21943
|
const lastNotDisabledIndex = getLastNotDisabledIndex(value);
|
|
19468
21944
|
if (lastNotDisabledIndex < 0)
|
|
19469
21945
|
return;
|
|
@@ -19477,7 +21953,7 @@ const useSelect$1 = (props, emit) => {
|
|
|
19477
21953
|
const deleteTag = (event, tag) => {
|
|
19478
21954
|
const index = states.selected.indexOf(tag);
|
|
19479
21955
|
if (index > -1 && !selectDisabled.value) {
|
|
19480
|
-
const value = castArray(props.modelValue).slice();
|
|
21956
|
+
const value = castArray$1(props.modelValue).slice();
|
|
19481
21957
|
value.splice(index, 1);
|
|
19482
21958
|
emit(UPDATE_MODEL_EVENT, value);
|
|
19483
21959
|
emitChange(value);
|
|
@@ -19505,7 +21981,7 @@ const useSelect$1 = (props, emit) => {
|
|
|
19505
21981
|
const handleOptionSelect = (option) => {
|
|
19506
21982
|
var _a;
|
|
19507
21983
|
if (props.multiple) {
|
|
19508
|
-
const value = castArray((_a = props.modelValue) != null ? _a : []).slice();
|
|
21984
|
+
const value = castArray$1((_a = props.modelValue) != null ? _a : []).slice();
|
|
19509
21985
|
const optionIndex = getValueIndex(value, option);
|
|
19510
21986
|
if (optionIndex > -1) {
|
|
19511
21987
|
value.splice(optionIndex, 1);
|
|
@@ -19912,7 +22388,7 @@ const SelectProps$1 = buildProps({
|
|
|
19912
22388
|
});
|
|
19913
22389
|
|
|
19914
22390
|
const COMPONENT_NAME = "ElSelect";
|
|
19915
|
-
const _sfc_main$
|
|
22391
|
+
const _sfc_main$l = defineComponent({
|
|
19916
22392
|
name: COMPONENT_NAME,
|
|
19917
22393
|
componentName: COMPONENT_NAME,
|
|
19918
22394
|
components: {
|
|
@@ -20322,9 +22798,9 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
20322
22798
|
[_directive_click_outside, _ctx.handleClickOutside, _ctx.popperRef]
|
|
20323
22799
|
]);
|
|
20324
22800
|
}
|
|
20325
|
-
var Select$
|
|
22801
|
+
var Select$2 = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$4], ["__file", "select.vue"]]);
|
|
20326
22802
|
|
|
20327
|
-
const _sfc_main$
|
|
22803
|
+
const _sfc_main$k = defineComponent({
|
|
20328
22804
|
name: "ElOptionGroup",
|
|
20329
22805
|
componentName: "ElOptionGroup",
|
|
20330
22806
|
props: {
|
|
@@ -20345,7 +22821,7 @@ const _sfc_main$i = defineComponent({
|
|
|
20345
22821
|
return ((_a = node.type) == null ? void 0 : _a.name) === "ElOption" && !!((_b = node.component) == null ? void 0 : _b.proxy);
|
|
20346
22822
|
};
|
|
20347
22823
|
const flattedChildren = (node) => {
|
|
20348
|
-
const Nodes = castArray(node);
|
|
22824
|
+
const Nodes = castArray$1(node);
|
|
20349
22825
|
const children2 = [];
|
|
20350
22826
|
Nodes.forEach((child) => {
|
|
20351
22827
|
var _a, _b;
|
|
@@ -20396,9 +22872,9 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
20396
22872
|
[vShow, _ctx.visible]
|
|
20397
22873
|
]);
|
|
20398
22874
|
}
|
|
20399
|
-
var OptionGroup = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
22875
|
+
var OptionGroup = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$3], ["__file", "option-group.vue"]]);
|
|
20400
22876
|
|
|
20401
|
-
const ElSelect = withInstall(Select$
|
|
22877
|
+
const ElSelect = withInstall(Select$2, {
|
|
20402
22878
|
Option,
|
|
20403
22879
|
OptionGroup
|
|
20404
22880
|
});
|
|
@@ -20467,11 +22943,11 @@ const popoverEmits = {
|
|
|
20467
22943
|
};
|
|
20468
22944
|
|
|
20469
22945
|
const updateEventKeyRaw = `onUpdate:visible`;
|
|
20470
|
-
const __default__$
|
|
22946
|
+
const __default__$f = defineComponent({
|
|
20471
22947
|
name: "ElPopover"
|
|
20472
22948
|
});
|
|
20473
|
-
const _sfc_main$
|
|
20474
|
-
...__default__$
|
|
22949
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
22950
|
+
...__default__$f,
|
|
20475
22951
|
props: popoverProps,
|
|
20476
22952
|
emits: popoverEmits,
|
|
20477
22953
|
setup(__props, { expose, emit }) {
|
|
@@ -20570,7 +23046,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
20570
23046
|
};
|
|
20571
23047
|
}
|
|
20572
23048
|
});
|
|
20573
|
-
var Popover = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
23049
|
+
var Popover = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__file", "popover.vue"]]);
|
|
20574
23050
|
|
|
20575
23051
|
const attachEvents = (el, binding) => {
|
|
20576
23052
|
const popperComponent = binding.arg || binding.value;
|
|
@@ -20594,7 +23070,7 @@ const ElPopover = withInstall(Popover, {
|
|
|
20594
23070
|
directive: ElPopoverDirective
|
|
20595
23071
|
});
|
|
20596
23072
|
|
|
20597
|
-
const _sfc_main$
|
|
23073
|
+
const _sfc_main$i = defineComponent({
|
|
20598
23074
|
props: {
|
|
20599
23075
|
item: {
|
|
20600
23076
|
type: Object,
|
|
@@ -20618,7 +23094,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
20618
23094
|
style: normalizeStyle({ ..._ctx.style, lineHeight: `${_ctx.height}px` })
|
|
20619
23095
|
}, toDisplayString(_ctx.item.label), 7);
|
|
20620
23096
|
}
|
|
20621
|
-
var GroupItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
23097
|
+
var GroupItem = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$2], ["__file", "group-item.vue"]]);
|
|
20622
23098
|
|
|
20623
23099
|
function useOption(props, { emit }) {
|
|
20624
23100
|
return {
|
|
@@ -20795,7 +23271,7 @@ const OptionProps = buildProps({
|
|
|
20795
23271
|
selected: Boolean,
|
|
20796
23272
|
created: Boolean
|
|
20797
23273
|
});
|
|
20798
|
-
const selectEmits = {
|
|
23274
|
+
const selectEmits$1 = {
|
|
20799
23275
|
[UPDATE_MODEL_EVENT]: (val) => true,
|
|
20800
23276
|
[CHANGE_EVENT]: (val) => true,
|
|
20801
23277
|
"remove-tag": (val) => true,
|
|
@@ -20811,7 +23287,7 @@ const optionEmits = {
|
|
|
20811
23287
|
|
|
20812
23288
|
const selectV2InjectionKey = Symbol("ElSelectV2Injection");
|
|
20813
23289
|
|
|
20814
|
-
const _sfc_main$
|
|
23290
|
+
const _sfc_main$h = defineComponent({
|
|
20815
23291
|
props: OptionProps,
|
|
20816
23292
|
emits: optionEmits,
|
|
20817
23293
|
setup(props, { emit }) {
|
|
@@ -20850,7 +23326,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
20850
23326
|
])
|
|
20851
23327
|
], 46, ["aria-selected", "onMousemove", "onClick"]);
|
|
20852
23328
|
}
|
|
20853
|
-
var OptionItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
23329
|
+
var OptionItem = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$1], ["__file", "option-item.vue"]]);
|
|
20854
23330
|
|
|
20855
23331
|
var safeIsNaN = Number.isNaN || function ponyfill(value) {
|
|
20856
23332
|
return typeof value === "number" && value !== value;
|
|
@@ -22864,7 +25340,7 @@ const useSelect = (props, emit) => {
|
|
|
22864
25340
|
};
|
|
22865
25341
|
};
|
|
22866
25342
|
|
|
22867
|
-
const _sfc_main$
|
|
25343
|
+
const _sfc_main$g = defineComponent({
|
|
22868
25344
|
name: "ElSelectV2",
|
|
22869
25345
|
components: {
|
|
22870
25346
|
ElSelectMenu,
|
|
@@ -22874,7 +25350,7 @@ const _sfc_main$e = defineComponent({
|
|
|
22874
25350
|
},
|
|
22875
25351
|
directives: { ClickOutside },
|
|
22876
25352
|
props: SelectProps,
|
|
22877
|
-
emits: selectEmits,
|
|
25353
|
+
emits: selectEmits$1,
|
|
22878
25354
|
setup(props, { emit }) {
|
|
22879
25355
|
const modelValue = computed(() => {
|
|
22880
25356
|
const { modelValue: rawModelValue, multiple } = props;
|
|
@@ -23251,9 +25727,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
23251
25727
|
[_directive_click_outside, _ctx.handleClickOutside, _ctx.popperRef]
|
|
23252
25728
|
]);
|
|
23253
25729
|
}
|
|
23254
|
-
var Select = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
25730
|
+
var Select$1 = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render], ["__file", "select.vue"]]);
|
|
23255
25731
|
|
|
23256
|
-
const ElSelectV2 = withInstall(Select);
|
|
25732
|
+
const ElSelectV2 = withInstall(Select$1);
|
|
23257
25733
|
|
|
23258
25734
|
const _hoisted_1$b = ["onClick"];
|
|
23259
25735
|
const _hoisted_2$9 = { class: "hzzt-dropdown-name" };
|
|
@@ -23262,11 +25738,11 @@ const _hoisted_4$5 = { class: "hzzt-dropdown-menu" };
|
|
|
23262
25738
|
const _hoisted_5$3 = ["onClick"];
|
|
23263
25739
|
const _hoisted_6$3 = { class: "submenu" };
|
|
23264
25740
|
const _hoisted_7$3 = ["onClick"];
|
|
23265
|
-
const __default__$
|
|
25741
|
+
const __default__$e = defineComponent({
|
|
23266
25742
|
name: "HzztDropDown"
|
|
23267
25743
|
});
|
|
23268
|
-
const _sfc_main$
|
|
23269
|
-
...__default__$
|
|
25744
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
25745
|
+
...__default__$e,
|
|
23270
25746
|
props: {
|
|
23271
25747
|
options: {
|
|
23272
25748
|
type: definePropType$1(Array),
|
|
@@ -23326,7 +25802,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
23326
25802
|
createElementVNode("ul", _hoisted_4$5, [
|
|
23327
25803
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option, index) => {
|
|
23328
25804
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
23329
|
-
unref(isEmpty)(option[__props.props.children]) ? (openBlock(), createElementBlock("li", {
|
|
25805
|
+
unref(isEmpty$1)(option[__props.props.children]) ? (openBlock(), createElementBlock("li", {
|
|
23330
25806
|
key: index,
|
|
23331
25807
|
class: normalizeClass({
|
|
23332
25808
|
"hzzt-dropdown-menu-item": true,
|
|
@@ -23375,7 +25851,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
23375
25851
|
};
|
|
23376
25852
|
}
|
|
23377
25853
|
});
|
|
23378
|
-
var Dropdown = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
25854
|
+
var Dropdown = /* @__PURE__ */ _export_sfc$1(_sfc_main$f, [["__file", "index.vue"]]);
|
|
23379
25855
|
|
|
23380
25856
|
const HzztDropdown = withInstall$1(Dropdown);
|
|
23381
25857
|
|
|
@@ -23389,11 +25865,11 @@ const _hoisted_7$2 = {
|
|
|
23389
25865
|
key: 0,
|
|
23390
25866
|
class: "hzzt-collapse-text"
|
|
23391
25867
|
};
|
|
23392
|
-
const __default__$
|
|
25868
|
+
const __default__$d = defineComponent({
|
|
23393
25869
|
name: "HzztCollapse"
|
|
23394
25870
|
});
|
|
23395
|
-
const _sfc_main$
|
|
23396
|
-
...__default__$
|
|
25871
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
25872
|
+
...__default__$d,
|
|
23397
25873
|
props: {
|
|
23398
25874
|
defaultActive: {
|
|
23399
25875
|
type: Boolean,
|
|
@@ -23439,11 +25915,11 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
23439
25915
|
};
|
|
23440
25916
|
}
|
|
23441
25917
|
});
|
|
23442
|
-
var Collapse = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
25918
|
+
var Collapse = /* @__PURE__ */ _export_sfc$1(_sfc_main$e, [["__file", "collapse.vue"]]);
|
|
23443
25919
|
|
|
23444
25920
|
const HzztCollapse = withInstall$1(Collapse);
|
|
23445
25921
|
|
|
23446
|
-
const _sfc_main$
|
|
25922
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
23447
25923
|
__name: "index",
|
|
23448
25924
|
props: {
|
|
23449
25925
|
name: {
|
|
@@ -23469,7 +25945,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
23469
25945
|
};
|
|
23470
25946
|
}
|
|
23471
25947
|
});
|
|
23472
|
-
var HzztIcon$1 = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
25948
|
+
var HzztIcon$1 = /* @__PURE__ */ _export_sfc$1(_sfc_main$d, [["__file", "index.vue"]]);
|
|
23473
25949
|
|
|
23474
25950
|
const _hoisted_1$9 = { class: "hzzt-tab flex align-items-center justify-content-between wrap" };
|
|
23475
25951
|
const _hoisted_2$7 = { class: "flex align-items-center" };
|
|
@@ -23481,11 +25957,11 @@ const _hoisted_6$1 = {
|
|
|
23481
25957
|
class: "hzzt-tab-badge-count"
|
|
23482
25958
|
};
|
|
23483
25959
|
const _hoisted_7$1 = { class: "flex wrap" };
|
|
23484
|
-
const __default__$
|
|
25960
|
+
const __default__$c = defineComponent({
|
|
23485
25961
|
name: "HzztTab"
|
|
23486
25962
|
});
|
|
23487
|
-
const _sfc_main$
|
|
23488
|
-
...__default__$
|
|
25963
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
25964
|
+
...__default__$c,
|
|
23489
25965
|
props: {
|
|
23490
25966
|
tabList: {
|
|
23491
25967
|
type: Array,
|
|
@@ -23556,7 +26032,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
23556
26032
|
};
|
|
23557
26033
|
}
|
|
23558
26034
|
});
|
|
23559
|
-
var Tab = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
26035
|
+
var Tab = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["__file", "index.vue"]]);
|
|
23560
26036
|
|
|
23561
26037
|
const HzztTab = withInstall$1(Tab);
|
|
23562
26038
|
|
|
@@ -23576,11 +26052,11 @@ const _hoisted_1$8 = { class: "flex justify-content-between hzzt-pagination" };
|
|
|
23576
26052
|
const _hoisted_2$6 = { class: "flex align-items-center font-12 hzzt-pagination-total" };
|
|
23577
26053
|
const _hoisted_3$3 = { class: "flex align-items-center hzzt-pagination-page font-14" };
|
|
23578
26054
|
const _hoisted_4$2 = { class: "flex" };
|
|
23579
|
-
const __default__$
|
|
26055
|
+
const __default__$b = defineComponent({
|
|
23580
26056
|
name: "HzztPagination"
|
|
23581
26057
|
});
|
|
23582
|
-
const _sfc_main$
|
|
23583
|
-
...__default__$
|
|
26058
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
26059
|
+
...__default__$b,
|
|
23584
26060
|
props: {
|
|
23585
26061
|
pagination: {
|
|
23586
26062
|
type: Object,
|
|
@@ -23630,18 +26106,18 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
23630
26106
|
};
|
|
23631
26107
|
}
|
|
23632
26108
|
});
|
|
23633
|
-
var Pagination = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
26109
|
+
var Pagination = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["__file", "index.vue"]]);
|
|
23634
26110
|
|
|
23635
26111
|
const HzztPagination = withInstall$1(Pagination);
|
|
23636
26112
|
|
|
23637
26113
|
const _hoisted_1$7 = { class: "flex align-content-center" };
|
|
23638
26114
|
const _hoisted_2$5 = { style: { "max-width": "300px" } };
|
|
23639
26115
|
const _hoisted_3$2 = { style: { "padding": "0", "margin": "0", "word-break": "break-all", "white-space": "pre-wrap" } };
|
|
23640
|
-
const __default__$
|
|
26116
|
+
const __default__$a = defineComponent({
|
|
23641
26117
|
name: "HzztTooltip"
|
|
23642
26118
|
});
|
|
23643
|
-
const _sfc_main$
|
|
23644
|
-
...__default__$
|
|
26119
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
26120
|
+
...__default__$a,
|
|
23645
26121
|
props: {
|
|
23646
26122
|
content: {
|
|
23647
26123
|
type: String,
|
|
@@ -23675,7 +26151,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
23675
26151
|
};
|
|
23676
26152
|
}
|
|
23677
26153
|
});
|
|
23678
|
-
var Tooltip = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
26154
|
+
var Tooltip = /* @__PURE__ */ _export_sfc$1(_sfc_main$a, [["__file", "tooltip.vue"]]);
|
|
23679
26155
|
|
|
23680
26156
|
const HzztTooltip = withInstall$1(Tooltip);
|
|
23681
26157
|
|
|
@@ -23692,11 +26168,11 @@ const _hoisted_4$1 = {
|
|
|
23692
26168
|
key: 0,
|
|
23693
26169
|
class: "margin-l-1 margin-r-2"
|
|
23694
26170
|
};
|
|
23695
|
-
const __default__$
|
|
26171
|
+
const __default__$9 = defineComponent({
|
|
23696
26172
|
name: "HzztPageSize"
|
|
23697
26173
|
});
|
|
23698
|
-
const _sfc_main$
|
|
23699
|
-
...__default__$
|
|
26174
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
26175
|
+
...__default__$9,
|
|
23700
26176
|
props: {
|
|
23701
26177
|
modelValue: {
|
|
23702
26178
|
type: Number,
|
|
@@ -23823,15 +26299,15 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
23823
26299
|
};
|
|
23824
26300
|
}
|
|
23825
26301
|
});
|
|
23826
|
-
var PageSize = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
26302
|
+
var PageSize = /* @__PURE__ */ _export_sfc$1(_sfc_main$9, [["__file", "index.vue"]]);
|
|
23827
26303
|
|
|
23828
26304
|
const HzztPageSize = withInstall$1(PageSize);
|
|
23829
26305
|
|
|
23830
|
-
const __default__$
|
|
26306
|
+
const __default__$8 = defineComponent({
|
|
23831
26307
|
name: "HzztConfirmPassword"
|
|
23832
26308
|
});
|
|
23833
|
-
const _sfc_main$
|
|
23834
|
-
...__default__$
|
|
26309
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
26310
|
+
...__default__$8,
|
|
23835
26311
|
props: {
|
|
23836
26312
|
placeholder: {
|
|
23837
26313
|
type: String,
|
|
@@ -23891,16 +26367,16 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
23891
26367
|
};
|
|
23892
26368
|
}
|
|
23893
26369
|
});
|
|
23894
|
-
var ConfirmPassword = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
26370
|
+
var ConfirmPassword = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["__file", "confirm-password.vue"]]);
|
|
23895
26371
|
|
|
23896
26372
|
const HzztConfirmPassword = withInstall$1(ConfirmPassword);
|
|
23897
26373
|
|
|
23898
26374
|
const _hoisted_1$5 = ["onClick"];
|
|
23899
|
-
const __default__$
|
|
26375
|
+
const __default__$7 = defineComponent({
|
|
23900
26376
|
name: "HzztCheckButton"
|
|
23901
26377
|
});
|
|
23902
|
-
const _sfc_main$
|
|
23903
|
-
...__default__$
|
|
26378
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
26379
|
+
...__default__$7,
|
|
23904
26380
|
props: {
|
|
23905
26381
|
options: {
|
|
23906
26382
|
type: Array,
|
|
@@ -23970,7 +26446,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
23970
26446
|
};
|
|
23971
26447
|
}
|
|
23972
26448
|
});
|
|
23973
|
-
var CheckButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
26449
|
+
var CheckButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$7, [["__file", "index.vue"]]);
|
|
23974
26450
|
|
|
23975
26451
|
const HzztCheckButton = withInstall$1(CheckButton);
|
|
23976
26452
|
|
|
@@ -24183,11 +26659,11 @@ var dayjs_min = {exports: {}};
|
|
|
24183
26659
|
var dayjs = dayjs_min.exports;
|
|
24184
26660
|
|
|
24185
26661
|
const parseDate = function(date, format, lang) {
|
|
24186
|
-
const day = isEmpty(format) || format === "x" ? dayjs(date).locale(lang) : dayjs(date, format).locale(lang);
|
|
26662
|
+
const day = isEmpty$1(format) || format === "x" ? dayjs(date).locale(lang) : dayjs(date, format).locale(lang);
|
|
24187
26663
|
return day.isValid() ? day : void 0;
|
|
24188
26664
|
};
|
|
24189
26665
|
const formatter = function(date, format, lang) {
|
|
24190
|
-
if (isEmpty(format))
|
|
26666
|
+
if (isEmpty$1(format))
|
|
24191
26667
|
return date;
|
|
24192
26668
|
if (format === "x")
|
|
24193
26669
|
return +date;
|
|
@@ -24228,11 +26704,11 @@ const _hoisted_8 = { class: "cell" };
|
|
|
24228
26704
|
const _hoisted_9 = { class: "cell" };
|
|
24229
26705
|
const _hoisted_10 = { class: "cell" };
|
|
24230
26706
|
const _hoisted_11 = { class: "cell" };
|
|
24231
|
-
const __default__$
|
|
26707
|
+
const __default__$6 = defineComponent({
|
|
24232
26708
|
name: "HzztQuarterPicker"
|
|
24233
26709
|
});
|
|
24234
|
-
const _sfc_main$
|
|
24235
|
-
...__default__$
|
|
26710
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
26711
|
+
...__default__$6,
|
|
24236
26712
|
props: {
|
|
24237
26713
|
size: useSizeProp$1,
|
|
24238
26714
|
format: {
|
|
@@ -24472,7 +26948,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
24472
26948
|
};
|
|
24473
26949
|
}
|
|
24474
26950
|
});
|
|
24475
|
-
var QuarterPicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
26951
|
+
var QuarterPicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$6, [["__file", "index.vue"]]);
|
|
24476
26952
|
|
|
24477
26953
|
const HzztQuarterPicker = withInstall$1(QuarterPicker);
|
|
24478
26954
|
|
|
@@ -24512,12 +26988,12 @@ const _hoisted_2$2 = {
|
|
|
24512
26988
|
class: "width-100%",
|
|
24513
26989
|
style: { "overflow": "hidden" }
|
|
24514
26990
|
};
|
|
24515
|
-
const __default__$
|
|
26991
|
+
const __default__$5 = defineComponent({
|
|
24516
26992
|
inheritAttrs: false,
|
|
24517
26993
|
name: "HzztScan"
|
|
24518
26994
|
});
|
|
24519
|
-
const _sfc_main$
|
|
24520
|
-
...__default__$
|
|
26995
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
26996
|
+
...__default__$5,
|
|
24521
26997
|
props: scanProps,
|
|
24522
26998
|
emits: scanEmits,
|
|
24523
26999
|
setup(__props, { expose, emit }) {
|
|
@@ -24636,7 +27112,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
24636
27112
|
};
|
|
24637
27113
|
}
|
|
24638
27114
|
});
|
|
24639
|
-
var Scan = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
27115
|
+
var Scan = /* @__PURE__ */ _export_sfc$1(_sfc_main$5, [["__file", "scan.vue"]]);
|
|
24640
27116
|
|
|
24641
27117
|
const HzztScan = withInstall$1(Scan);
|
|
24642
27118
|
|
|
@@ -24682,11 +27158,11 @@ const selectInputEmits = {
|
|
|
24682
27158
|
|
|
24683
27159
|
const _hoisted_1$2 = { slot: "append" };
|
|
24684
27160
|
const _hoisted_2$1 = { key: 0 };
|
|
24685
|
-
const __default__$
|
|
27161
|
+
const __default__$4 = defineComponent({
|
|
24686
27162
|
name: "HzztSelectInput"
|
|
24687
27163
|
});
|
|
24688
|
-
const _sfc_main$
|
|
24689
|
-
...__default__$
|
|
27164
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
27165
|
+
...__default__$4,
|
|
24690
27166
|
props: selectInputProps,
|
|
24691
27167
|
emits: selectInputEmits,
|
|
24692
27168
|
setup(__props, { emit }) {
|
|
@@ -24795,7 +27271,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
24795
27271
|
};
|
|
24796
27272
|
}
|
|
24797
27273
|
});
|
|
24798
|
-
var SelectInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
27274
|
+
var SelectInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$4, [["__file", "select-input.vue"]]);
|
|
24799
27275
|
|
|
24800
27276
|
const HzztSelectInput = withInstall$1(SelectInput);
|
|
24801
27277
|
|
|
@@ -24826,11 +27302,11 @@ const selectTextareaEmits = {
|
|
|
24826
27302
|
|
|
24827
27303
|
const _hoisted_1$1 = { class: "flex column" };
|
|
24828
27304
|
const _hoisted_2 = { class: "flex align-items-center" };
|
|
24829
|
-
const __default__$
|
|
27305
|
+
const __default__$3 = defineComponent({
|
|
24830
27306
|
name: "HzztSelectTextarea"
|
|
24831
27307
|
});
|
|
24832
|
-
const _sfc_main$
|
|
24833
|
-
...__default__$
|
|
27308
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
27309
|
+
...__default__$3,
|
|
24834
27310
|
props: selectTextareaProps,
|
|
24835
27311
|
emits: selectTextareaEmits,
|
|
24836
27312
|
setup(__props, { emit }) {
|
|
@@ -24866,6 +27342,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
24866
27342
|
function selectChange(val) {
|
|
24867
27343
|
if (!inputVal.value && inputVal.value !== 0)
|
|
24868
27344
|
inputVal.value = "";
|
|
27345
|
+
selectValue.value = "";
|
|
24869
27346
|
let content = val;
|
|
24870
27347
|
if (!props.replace) {
|
|
24871
27348
|
const inputEl = inputRef.value.$el.getElementsByTagName("textarea")[0];
|
|
@@ -24915,7 +27392,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
24915
27392
|
};
|
|
24916
27393
|
}
|
|
24917
27394
|
});
|
|
24918
|
-
var SelectTextarea = /* @__PURE__ */ _export_sfc$1(_sfc_main$
|
|
27395
|
+
var SelectTextarea = /* @__PURE__ */ _export_sfc$1(_sfc_main$3, [["__file", "select-textarea.vue"]]);
|
|
24919
27396
|
|
|
24920
27397
|
const HzztSelectTextarea = withInstall$1(SelectTextarea);
|
|
24921
27398
|
|
|
@@ -24941,11 +27418,11 @@ const inputRangeEmits = {
|
|
|
24941
27418
|
};
|
|
24942
27419
|
|
|
24943
27420
|
const _hoisted_1 = /* @__PURE__ */ createElementVNode("span", { class: "margin-h-1" }, "\u2014\u2014", -1);
|
|
24944
|
-
const __default__ = defineComponent({
|
|
27421
|
+
const __default__$2 = defineComponent({
|
|
24945
27422
|
name: "HzztInputRange"
|
|
24946
27423
|
});
|
|
24947
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
24948
|
-
...__default__,
|
|
27424
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
27425
|
+
...__default__$2,
|
|
24949
27426
|
props: inputRangeProps,
|
|
24950
27427
|
emits: inputRangeEmits,
|
|
24951
27428
|
setup(__props, { emit }) {
|
|
@@ -24968,7 +27445,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
24968
27445
|
deep: true
|
|
24969
27446
|
});
|
|
24970
27447
|
function change() {
|
|
24971
|
-
if (startValue.value
|
|
27448
|
+
if (startValue.value || endValue.value) {
|
|
24972
27449
|
const modelValue = [startValue.value, endValue.value];
|
|
24973
27450
|
emit("update:modelValue", modelValue);
|
|
24974
27451
|
emit("change", modelValue);
|
|
@@ -25009,10 +27486,379 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
25009
27486
|
};
|
|
25010
27487
|
}
|
|
25011
27488
|
});
|
|
25012
|
-
var InputRange = /* @__PURE__ */ _export_sfc$1(_sfc_main, [["__file", "input-range.vue"]]);
|
|
27489
|
+
var InputRange = /* @__PURE__ */ _export_sfc$1(_sfc_main$2, [["__file", "input-range.vue"]]);
|
|
25013
27490
|
|
|
25014
27491
|
const HzztInputRange = withInstall$1(InputRange);
|
|
25015
27492
|
|
|
27493
|
+
const cascaderProps = buildProps$1({
|
|
27494
|
+
cascaderProps: {
|
|
27495
|
+
type: Object,
|
|
27496
|
+
default: () => ({
|
|
27497
|
+
showAllLevels: true
|
|
27498
|
+
})
|
|
27499
|
+
},
|
|
27500
|
+
disabled: Boolean,
|
|
27501
|
+
readonly: Boolean,
|
|
27502
|
+
clearable: Boolean,
|
|
27503
|
+
size: useSizeProp$1,
|
|
27504
|
+
options: {
|
|
27505
|
+
type: definePropType$1(Array),
|
|
27506
|
+
default: () => []
|
|
27507
|
+
},
|
|
27508
|
+
placeholder: {
|
|
27509
|
+
type: String,
|
|
27510
|
+
default: ""
|
|
27511
|
+
},
|
|
27512
|
+
modelValue: {
|
|
27513
|
+
type: definePropType$1([
|
|
27514
|
+
String
|
|
27515
|
+
]),
|
|
27516
|
+
default: ""
|
|
27517
|
+
}
|
|
27518
|
+
});
|
|
27519
|
+
const cascaderEmits = {
|
|
27520
|
+
[UPDATE_MODEL_EVENT$1]: (value) => isString$1(value),
|
|
27521
|
+
input: (value) => isString$1(value),
|
|
27522
|
+
change: (value) => isString$1(value)
|
|
27523
|
+
};
|
|
27524
|
+
|
|
27525
|
+
function getCascaderId(targetId = "", list = []) {
|
|
27526
|
+
function get(list2, arr = []) {
|
|
27527
|
+
var _a;
|
|
27528
|
+
for (let i = 0; i < list2.length; i++) {
|
|
27529
|
+
const item = list2[i];
|
|
27530
|
+
if (item.value === targetId) {
|
|
27531
|
+
arr.unshift(item.value);
|
|
27532
|
+
break;
|
|
27533
|
+
}
|
|
27534
|
+
if ((_a = item == null ? void 0 : item.children) == null ? void 0 : _a.length) {
|
|
27535
|
+
arr = get(item.children, arr);
|
|
27536
|
+
if (arr.length) {
|
|
27537
|
+
if (item.value) {
|
|
27538
|
+
arr.unshift(item.value);
|
|
27539
|
+
}
|
|
27540
|
+
break;
|
|
27541
|
+
}
|
|
27542
|
+
}
|
|
27543
|
+
}
|
|
27544
|
+
return arr;
|
|
27545
|
+
}
|
|
27546
|
+
return get(list, []);
|
|
27547
|
+
}
|
|
27548
|
+
|
|
27549
|
+
const __default__$1 = defineComponent({
|
|
27550
|
+
name: "HzztCascader"
|
|
27551
|
+
});
|
|
27552
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
27553
|
+
...__default__$1,
|
|
27554
|
+
props: cascaderProps,
|
|
27555
|
+
emits: cascaderEmits,
|
|
27556
|
+
setup(__props, { emit }) {
|
|
27557
|
+
const props = __props;
|
|
27558
|
+
const attrs = useAttrs$1();
|
|
27559
|
+
const inputVal = ref(props.modelValue);
|
|
27560
|
+
const cascaderVal = ref();
|
|
27561
|
+
const inputRef = ref();
|
|
27562
|
+
const cascaderRef = ref();
|
|
27563
|
+
const nsCascader = useNamespace$1("cascader");
|
|
27564
|
+
const formSize = useFormSize();
|
|
27565
|
+
const formDisabled = useFormDisabled();
|
|
27566
|
+
const trueSize = computed(() => props.size || formSize.value || useGlobalSize$1().value);
|
|
27567
|
+
const trueDisabled = computed(() => props.disabled || formDisabled.value);
|
|
27568
|
+
const containerCls = computed(() => [
|
|
27569
|
+
"relative",
|
|
27570
|
+
nsCascader.b(),
|
|
27571
|
+
nsCascader.m(trueSize.value)
|
|
27572
|
+
]);
|
|
27573
|
+
const inputCls = computed(() => [
|
|
27574
|
+
nsCascader.e("input")
|
|
27575
|
+
]);
|
|
27576
|
+
const cascaderCls = computed(() => [
|
|
27577
|
+
nsCascader.e("cascader")
|
|
27578
|
+
]);
|
|
27579
|
+
const _inputProps = computed(() => ({
|
|
27580
|
+
disabled: trueDisabled.value,
|
|
27581
|
+
size: trueSize.value,
|
|
27582
|
+
clearable: props.clearable,
|
|
27583
|
+
placeholder: props.placeholder,
|
|
27584
|
+
readonly: props.readonly,
|
|
27585
|
+
...attrs
|
|
27586
|
+
}));
|
|
27587
|
+
const _cascaderProps = computed(() => ({
|
|
27588
|
+
options: props.options,
|
|
27589
|
+
disabled: trueDisabled.value,
|
|
27590
|
+
size: trueSize.value,
|
|
27591
|
+
clearable: props.clearable,
|
|
27592
|
+
placeholder: props.placeholder,
|
|
27593
|
+
props: { checkStrictly: true, expandTrigger: "hover" },
|
|
27594
|
+
filterable: true,
|
|
27595
|
+
separator: "/",
|
|
27596
|
+
showAllLevels: true,
|
|
27597
|
+
...props.cascaderProps
|
|
27598
|
+
}));
|
|
27599
|
+
watch(() => props.modelValue, (v) => {
|
|
27600
|
+
inputVal.value = v;
|
|
27601
|
+
getCascaderVal();
|
|
27602
|
+
});
|
|
27603
|
+
watch(() => props.options, (v) => {
|
|
27604
|
+
if (!v)
|
|
27605
|
+
return;
|
|
27606
|
+
getCascaderVal();
|
|
27607
|
+
});
|
|
27608
|
+
getCascaderVal();
|
|
27609
|
+
function input(str) {
|
|
27610
|
+
emit("update:modelValue", str);
|
|
27611
|
+
emit("input", str);
|
|
27612
|
+
}
|
|
27613
|
+
function change(str) {
|
|
27614
|
+
emit("change", str);
|
|
27615
|
+
}
|
|
27616
|
+
function click(e) {
|
|
27617
|
+
cascaderRef.value.togglePopperVisible();
|
|
27618
|
+
const target = e.target;
|
|
27619
|
+
target.focus();
|
|
27620
|
+
}
|
|
27621
|
+
function cascaderChange(val) {
|
|
27622
|
+
const separator = _cascaderProps.value.separator || "/";
|
|
27623
|
+
inputVal.value = val ? isArray$1(val) ? val.join(separator) : [val].join(separator) : "";
|
|
27624
|
+
input(inputVal.value);
|
|
27625
|
+
change(inputVal.value);
|
|
27626
|
+
}
|
|
27627
|
+
function getCascaderVal() {
|
|
27628
|
+
const separator = _cascaderProps.value.separator || "/";
|
|
27629
|
+
if (_cascaderProps.value.showAllLevels === false) {
|
|
27630
|
+
const list = getCascaderId(props.modelValue, props.options);
|
|
27631
|
+
cascaderVal.value = list.join(separator);
|
|
27632
|
+
} else {
|
|
27633
|
+
cascaderVal.value = (props.modelValue || "").split(separator);
|
|
27634
|
+
}
|
|
27635
|
+
}
|
|
27636
|
+
return (_ctx, _cache) => {
|
|
27637
|
+
return openBlock(), createElementBlock("div", {
|
|
27638
|
+
class: normalizeClass(unref(containerCls))
|
|
27639
|
+
}, [
|
|
27640
|
+
createVNode(unref(ElInput), mergeProps({
|
|
27641
|
+
class: unref(inputCls),
|
|
27642
|
+
modelValue: inputVal.value,
|
|
27643
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputVal.value = $event),
|
|
27644
|
+
ref_key: "inputRef",
|
|
27645
|
+
ref: inputRef
|
|
27646
|
+
}, unref(_inputProps), {
|
|
27647
|
+
onInput: input,
|
|
27648
|
+
onClick: click,
|
|
27649
|
+
onChange: change
|
|
27650
|
+
}), null, 16, ["class", "modelValue"]),
|
|
27651
|
+
createVNode(unref(ElCascader), mergeProps({
|
|
27652
|
+
class: unref(cascaderCls),
|
|
27653
|
+
modelValue: cascaderVal.value,
|
|
27654
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => cascaderVal.value = $event),
|
|
27655
|
+
ref_key: "cascaderRef",
|
|
27656
|
+
ref: cascaderRef
|
|
27657
|
+
}, unref(_cascaderProps), { onChange: cascaderChange }), null, 16, ["class", "modelValue"])
|
|
27658
|
+
], 2);
|
|
27659
|
+
};
|
|
27660
|
+
}
|
|
27661
|
+
});
|
|
27662
|
+
var Cascader = /* @__PURE__ */ _export_sfc$1(_sfc_main$1, [["__file", "cascader.vue"]]);
|
|
27663
|
+
|
|
27664
|
+
const HzztCascader = withInstall$1(Cascader);
|
|
27665
|
+
|
|
27666
|
+
const selectProps = buildProps$1({
|
|
27667
|
+
selectProps: Object,
|
|
27668
|
+
options: {
|
|
27669
|
+
type: definePropType$1(Array),
|
|
27670
|
+
default: () => []
|
|
27671
|
+
},
|
|
27672
|
+
modelValue: {
|
|
27673
|
+
type: definePropType$1([
|
|
27674
|
+
String
|
|
27675
|
+
]),
|
|
27676
|
+
default: ""
|
|
27677
|
+
},
|
|
27678
|
+
disabled: Boolean,
|
|
27679
|
+
readonly: Boolean,
|
|
27680
|
+
clearable: Boolean,
|
|
27681
|
+
placeholder: String,
|
|
27682
|
+
size: useSizeProp$1
|
|
27683
|
+
});
|
|
27684
|
+
const selectEmits = {
|
|
27685
|
+
[UPDATE_MODEL_EVENT$1]: (value) => isString$1(value),
|
|
27686
|
+
"input": (value) => isString$1(value),
|
|
27687
|
+
"change": (value) => isString$1(value),
|
|
27688
|
+
"arrow-down": (e) => e,
|
|
27689
|
+
"arrow-up": (e) => e,
|
|
27690
|
+
"arrow-left": (e) => e,
|
|
27691
|
+
"arrow-right": (e) => e,
|
|
27692
|
+
"enter": (e) => e
|
|
27693
|
+
};
|
|
27694
|
+
|
|
27695
|
+
const __default__ = defineComponent({
|
|
27696
|
+
name: "HzztSelect",
|
|
27697
|
+
inheritAttrs: false
|
|
27698
|
+
});
|
|
27699
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
27700
|
+
...__default__,
|
|
27701
|
+
props: selectProps,
|
|
27702
|
+
emits: selectEmits,
|
|
27703
|
+
setup(__props, { emit }) {
|
|
27704
|
+
const props = __props;
|
|
27705
|
+
const attrs = useAttrs$1();
|
|
27706
|
+
const inputVal = ref(props.modelValue);
|
|
27707
|
+
const selectVal = ref();
|
|
27708
|
+
const inputRef = ref();
|
|
27709
|
+
const selectRef = ref();
|
|
27710
|
+
const arrowName = ref("arrow-down");
|
|
27711
|
+
const nsSelect = useNamespace$1("select");
|
|
27712
|
+
const formSize = useFormSize();
|
|
27713
|
+
const formDisabled = useFormDisabled();
|
|
27714
|
+
const trueSize = computed(() => props.size || formSize.value || useGlobalSize$1().value);
|
|
27715
|
+
const trueDisabled = computed(() => props.disabled || formDisabled.value);
|
|
27716
|
+
const trueReadonly = computed(() => props.readonly || trueDisabled.value);
|
|
27717
|
+
const containerCls = computed(() => [
|
|
27718
|
+
"relative",
|
|
27719
|
+
"line-height-1",
|
|
27720
|
+
attrs.class,
|
|
27721
|
+
nsSelect.b(),
|
|
27722
|
+
nsSelect.m(trueSize.value)
|
|
27723
|
+
]);
|
|
27724
|
+
const containerStyle = computed(() => attrs.style);
|
|
27725
|
+
const inputCls = computed(() => [
|
|
27726
|
+
nsSelect.e("input"),
|
|
27727
|
+
"width-100%"
|
|
27728
|
+
]);
|
|
27729
|
+
const selectCls = computed(() => [
|
|
27730
|
+
nsSelect.e("select"),
|
|
27731
|
+
"width-100%"
|
|
27732
|
+
]);
|
|
27733
|
+
const _inputProps = computed(() => ({
|
|
27734
|
+
disabled: trueDisabled.value,
|
|
27735
|
+
size: trueSize.value,
|
|
27736
|
+
clearable: props.clearable,
|
|
27737
|
+
placeholder: props.placeholder,
|
|
27738
|
+
readonly: props.readonly,
|
|
27739
|
+
...attrs,
|
|
27740
|
+
class: "",
|
|
27741
|
+
style: {
|
|
27742
|
+
position: trueReadonly.value ? "static" : "absolute",
|
|
27743
|
+
left: 0,
|
|
27744
|
+
top: 0,
|
|
27745
|
+
right: 0,
|
|
27746
|
+
zIndex: 2
|
|
27747
|
+
}
|
|
27748
|
+
}));
|
|
27749
|
+
const _selectProps = computed(() => ({
|
|
27750
|
+
options: props.options,
|
|
27751
|
+
size: trueSize.value,
|
|
27752
|
+
filterable: true,
|
|
27753
|
+
popperClass: "select-v2-popper-min-width-100",
|
|
27754
|
+
...props.selectProps
|
|
27755
|
+
}));
|
|
27756
|
+
watch(() => props.modelValue, (v) => {
|
|
27757
|
+
inputVal.value = v;
|
|
27758
|
+
});
|
|
27759
|
+
watch(() => inputVal.value, (v) => {
|
|
27760
|
+
selectVal.value = v;
|
|
27761
|
+
});
|
|
27762
|
+
function input(str) {
|
|
27763
|
+
var _a;
|
|
27764
|
+
if ((_a = selectRef.value) == null ? void 0 : _a.dropdownMenuVisible) {
|
|
27765
|
+
selectRef.value.states.inputValue = inputVal.value;
|
|
27766
|
+
selectRef.value.debouncedOnInputChange();
|
|
27767
|
+
}
|
|
27768
|
+
emit("update:modelValue", str);
|
|
27769
|
+
emit("input", str);
|
|
27770
|
+
}
|
|
27771
|
+
function change(str) {
|
|
27772
|
+
emit("change", str);
|
|
27773
|
+
}
|
|
27774
|
+
function keydown(e) {
|
|
27775
|
+
var _a, _b;
|
|
27776
|
+
const key = "key" in e && e.key;
|
|
27777
|
+
if (key === "ArrowDown") {
|
|
27778
|
+
emit("arrow-down", e);
|
|
27779
|
+
selectRef.value.dropdownMenuVisible = false;
|
|
27780
|
+
} else if (key === "ArrowUp") {
|
|
27781
|
+
emit("arrow-up", e);
|
|
27782
|
+
selectRef.value.dropdownMenuVisible = false;
|
|
27783
|
+
} else if (key === "ArrowLeft") {
|
|
27784
|
+
const index = inputRef.value.input.selectionStart;
|
|
27785
|
+
if (index === 0) {
|
|
27786
|
+
emit("arrow-left", e);
|
|
27787
|
+
selectRef.value.dropdownMenuVisible = false;
|
|
27788
|
+
}
|
|
27789
|
+
} else if (key === "ArrowRight") {
|
|
27790
|
+
const index = inputRef.value.input.selectionStart;
|
|
27791
|
+
if (((_b = (_a = inputVal.value) == null ? void 0 : _a.length) != null ? _b : 0) === index) {
|
|
27792
|
+
emit("arrow-right", e);
|
|
27793
|
+
selectRef.value.dropdownMenuVisible = false;
|
|
27794
|
+
}
|
|
27795
|
+
} else if (key === "Enter") {
|
|
27796
|
+
emit("enter", e);
|
|
27797
|
+
selectRef.value.dropdownMenuVisible = false;
|
|
27798
|
+
}
|
|
27799
|
+
}
|
|
27800
|
+
function showSelect() {
|
|
27801
|
+
if (selectRef.value) {
|
|
27802
|
+
selectRef.value.dropdownMenuVisible = !selectRef.value.dropdownMenuVisible;
|
|
27803
|
+
}
|
|
27804
|
+
}
|
|
27805
|
+
function selectChange(v) {
|
|
27806
|
+
emit("update:modelValue", v);
|
|
27807
|
+
inputVal.value = v;
|
|
27808
|
+
setTimeout(() => {
|
|
27809
|
+
inputRef.value.focus();
|
|
27810
|
+
selectRef.value.dropdownMenuVisible = false;
|
|
27811
|
+
});
|
|
27812
|
+
emit("change", inputVal.value);
|
|
27813
|
+
}
|
|
27814
|
+
function selectVisibleChange(v) {
|
|
27815
|
+
arrowName.value = v ? "arrow-up" : "arrow-down";
|
|
27816
|
+
}
|
|
27817
|
+
return (_ctx, _cache) => {
|
|
27818
|
+
return openBlock(), createElementBlock("div", {
|
|
27819
|
+
class: normalizeClass(unref(containerCls)),
|
|
27820
|
+
style: normalizeStyle(unref(containerStyle))
|
|
27821
|
+
}, [
|
|
27822
|
+
createVNode(unref(ElInput), mergeProps({
|
|
27823
|
+
class: unref(inputCls),
|
|
27824
|
+
modelValue: inputVal.value,
|
|
27825
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputVal.value = $event),
|
|
27826
|
+
ref_key: "inputRef",
|
|
27827
|
+
ref: inputRef
|
|
27828
|
+
}, unref(_inputProps), {
|
|
27829
|
+
onInput: input,
|
|
27830
|
+
onChange: change,
|
|
27831
|
+
onKeydown: keydown
|
|
27832
|
+
}), {
|
|
27833
|
+
suffix: withCtx(() => [
|
|
27834
|
+
!unref(trueReadonly) ? (openBlock(), createBlock(HzztIcon$1, {
|
|
27835
|
+
key: 0,
|
|
27836
|
+
class: "pointer",
|
|
27837
|
+
name: arrowName.value,
|
|
27838
|
+
onClick: showSelect
|
|
27839
|
+
}, null, 8, ["name"])) : createCommentVNode("v-if", true)
|
|
27840
|
+
]),
|
|
27841
|
+
_: 1
|
|
27842
|
+
}, 16, ["class", "modelValue"]),
|
|
27843
|
+
!unref(trueReadonly) ? (openBlock(), createBlock(unref(ElSelectV2), mergeProps({
|
|
27844
|
+
key: 0,
|
|
27845
|
+
class: unref(selectCls),
|
|
27846
|
+
modelValue: selectVal.value,
|
|
27847
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => selectVal.value = $event),
|
|
27848
|
+
ref_key: "selectRef",
|
|
27849
|
+
ref: selectRef
|
|
27850
|
+
}, unref(_selectProps), {
|
|
27851
|
+
onChange: selectChange,
|
|
27852
|
+
onVisibleChange: selectVisibleChange
|
|
27853
|
+
}), null, 16, ["class", "modelValue"])) : createCommentVNode("v-if", true)
|
|
27854
|
+
], 6);
|
|
27855
|
+
};
|
|
27856
|
+
}
|
|
27857
|
+
});
|
|
27858
|
+
var Select = /* @__PURE__ */ _export_sfc$1(_sfc_main, [["__file", "select.vue"]]);
|
|
27859
|
+
|
|
27860
|
+
const HzztSelect = withInstall$1(Select);
|
|
27861
|
+
|
|
25016
27862
|
var Components = [
|
|
25017
27863
|
HzztConfigProvider,
|
|
25018
27864
|
HzztTitle,
|
|
@@ -25029,7 +27875,9 @@ var Components = [
|
|
|
25029
27875
|
HzztScan,
|
|
25030
27876
|
HzztSelectInput,
|
|
25031
27877
|
HzztSelectTextarea,
|
|
25032
|
-
HzztInputRange
|
|
27878
|
+
HzztInputRange,
|
|
27879
|
+
HzztCascader,
|
|
27880
|
+
HzztSelect
|
|
25033
27881
|
];
|
|
25034
27882
|
|
|
25035
27883
|
var Plugins = [];
|
|
@@ -25241,4 +28089,4 @@ function initMouseEvent(el, callback) {
|
|
|
25241
28089
|
const install = installer.install;
|
|
25242
28090
|
const version = installer.version;
|
|
25243
28091
|
|
|
25244
|
-
export { Blur, CHANGE_EVENT$1 as CHANGE_EVENT, Download, Drag, Height, Highlight, HzztCheckButton, HzztCollapse, HzztConfigProvider, HzztConfirmPassword, HzztDropdown, HzztIcon, HzztInputRange, HzztPageSize, HzztPagination, HzztQuarterPicker, HzztScan, HzztSelectInput, HzztSelectTextarea, HzztTab, HzztTitle, HzztTooltip, INPUT_EVENT$1 as INPUT_EVENT, INSTALLED_KEY, SIZE_INJECTION_KEY$1 as SIZE_INJECTION_KEY, UPDATE_MODEL_EVENT$1 as UPDATE_MODEL_EVENT, WEEK_DAYS, buildLocaleContext$1 as buildLocaleContext, buildTranslator$1 as buildTranslator, componentSizeMap, componentSizes$1 as componentSizes, configProviderContextKey$1 as configProviderContextKey, configProviderProps, datePickTypes, installer as default, defaultNamespace$1 as defaultNamespace, inputRangeEmits, inputRangeProps, insertCursorPosition, install, localeContextKey$1 as localeContextKey, makeInstaller, namespaceContextKey$1 as namespaceContextKey, numberToLetter, provideGlobalConfig, scanEmits, scanProps, selectInputEmits, selectInputProps, selectTextareaEmits, selectTextareaProps, titleProps, translate$1 as translate, useGetDerivedNamespace$1 as useGetDerivedNamespace, useGlobalConfig$1 as useGlobalConfig, useGlobalSize$1 as useGlobalSize, useLocale$1 as useLocale, useNamespace$1 as useNamespace, useSizeProp$1 as useSizeProp, useSizeProps, version };
|
|
28092
|
+
export { Blur, CHANGE_EVENT$1 as CHANGE_EVENT, Download, Drag, Height, Highlight, HzztCascader, HzztCheckButton, HzztCollapse, HzztConfigProvider, HzztConfirmPassword, HzztDropdown, HzztIcon, HzztInputRange, HzztPageSize, HzztPagination, HzztQuarterPicker, HzztScan, HzztSelect, HzztSelectInput, HzztSelectTextarea, HzztTab, HzztTitle, HzztTooltip, INPUT_EVENT$1 as INPUT_EVENT, INSTALLED_KEY, SIZE_INJECTION_KEY$1 as SIZE_INJECTION_KEY, UPDATE_MODEL_EVENT$1 as UPDATE_MODEL_EVENT, WEEK_DAYS, buildLocaleContext$1 as buildLocaleContext, buildTranslator$1 as buildTranslator, cascaderEmits, cascaderProps, componentSizeMap, componentSizes$1 as componentSizes, configProviderContextKey$1 as configProviderContextKey, configProviderProps, datePickTypes, installer as default, defaultNamespace$1 as defaultNamespace, inputRangeEmits, inputRangeProps, insertCursorPosition, install, localeContextKey$1 as localeContextKey, makeInstaller, namespaceContextKey$1 as namespaceContextKey, numberToLetter, provideGlobalConfig, scanEmits, scanProps, selectEmits, selectInputEmits, selectInputProps, selectProps, selectTextareaEmits, selectTextareaProps, titleProps, translate$1 as translate, useGetDerivedNamespace$1 as useGetDerivedNamespace, useGlobalConfig$1 as useGlobalConfig, useGlobalSize$1 as useGlobalSize, useLocale$1 as useLocale, useNamespace$1 as useNamespace, useSizeProp$1 as useSizeProp, useSizeProps, version };
|