@cldemo/ui-kit 1.1.3 → 1.1.4
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/buildLibs/all/index.cjs +8 -8
- package/buildLibs/all/index.js +12157 -12048
- package/buildLibs/common/globalConfig.cjs +1 -1
- package/buildLibs/common/globalConfig.js +29 -15
- package/buildLibs/common/i18n/en.cjs +1 -1
- package/buildLibs/common/i18n/en.js +3 -1
- package/buildLibs/common/i18n/zh_CN.cjs +1 -1
- package/buildLibs/common/i18n/zh_CN.js +3 -1
- package/buildLibs/common/index.cjs +1 -1
- package/buildLibs/common/index.js +26 -24
- package/buildLibs/mobile/index.cjs +5 -5
- package/buildLibs/mobile/index.js +5902 -5852
- package/buildLibs/modules/shared/{Index.vue_vue_type_script_setup_true_lang-CKoVf-v1.js → Index.vue_vue_type_script_setup_true_lang-88gNFuK4.js} +2 -2
- package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-BQXxDHbe.js +254 -0
- package/buildLibs/modules/shared/{Index.vue_vue_type_script_setup_true_lang-D0g1xGPL.js → Index.vue_vue_type_script_setup_true_lang-BR0S3Sfl.js} +3 -3
- package/buildLibs/modules/shared/{Index.vue_vue_type_script_setup_true_lang-RRUPY9bd.js → Index.vue_vue_type_script_setup_true_lang-BrfAVhNV.js} +153 -145
- package/buildLibs/modules/shared/{Index.vue_vue_type_script_setup_true_lang-DdLVG0R0.js → Index.vue_vue_type_script_setup_true_lang-Bw_jRoEX.js} +67 -59
- package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-C6Zd584S.js +2536 -0
- package/buildLibs/modules/shared/{Index.vue_vue_type_script_setup_true_lang-BOcOO9-n.js → Index.vue_vue_type_script_setup_true_lang-CD66oCaI.js} +386 -375
- package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-CEBiLDTm.js +310 -0
- package/buildLibs/modules/shared/{Index.vue_vue_type_script_setup_true_lang-C0DgaU5I.js → Index.vue_vue_type_script_setup_true_lang-CRlBvcCg.js} +53 -47
- package/buildLibs/modules/shared/{Index.vue_vue_type_script_setup_true_lang-DqZBB8fM.js → Index.vue_vue_type_script_setup_true_lang-CdYh3Pzs.js} +1 -1
- package/buildLibs/modules/shared/{Index.vue_vue_type_script_setup_true_lang-XiSSYx4X.js → Index.vue_vue_type_script_setup_true_lang-D7YeNBdk.js} +120 -113
- package/buildLibs/{utils/Shared/Index.vue_vue_type_script_setup_true_lang-DKMVQrVU.js → modules/shared/Index.vue_vue_type_script_setup_true_lang-D9sq4n9i.js} +66 -60
- package/buildLibs/modules/shared/{Index.vue_vue_type_script_setup_true_lang-CRKrLCa6.js → Index.vue_vue_type_script_setup_true_lang-DFeBj9IN.js} +209 -201
- package/buildLibs/modules/shared/{Index.vue_vue_type_script_setup_true_lang-D7bJ5UAn.js → Index.vue_vue_type_script_setup_true_lang-DY3tZQZe.js} +63 -55
- package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-D_73B6av.js +1533 -0
- package/buildLibs/modules/shared/{Validate.vue_vue_type_script_setup_true_lang-3s_3ut9M.js → Validate.vue_vue_type_script_setup_true_lang-hn1Tat7L.js} +102 -92
- package/buildLibs/types/All/index.d.ts +1 -1
- package/buildLibs/types/Common/globalConfig.d.ts +29 -0
- package/buildLibs/types/Common/globalTypes.d.ts +11 -0
- package/buildLibs/types/Common/i18n/en.d.ts +2 -0
- package/buildLibs/types/Common/i18n/zh_CN.d.ts +2 -0
- package/buildLibs/types/Common/index.d.ts +1 -1
- package/buildLibs/types/Element/CheckBox/Index.vue.d.ts +9 -0
- package/buildLibs/types/Element/Input/Index.vue.d.ts +9 -0
- package/buildLibs/types/Element/InputNumber/Index.vue.d.ts +9 -0
- package/buildLibs/types/Element/InputNumberStepper/Index.vue.d.ts +9 -0
- package/buildLibs/types/Element/InputTextarea/Index.vue.d.ts +9 -0
- package/buildLibs/types/Element/Radio/Index.vue.d.ts +9 -0
- package/buildLibs/types/Web/DateTime/Index.vue.d.ts +9 -0
- package/buildLibs/types/Web/FileUpload/Index.vue.d.ts +9 -0
- package/buildLibs/types/Web/Select/Index.vue.d.ts +9 -0
- package/buildLibs/types/Web/SelectCascade/Index.vue.d.ts +9 -0
- package/buildLibs/types/Web/SelectMove/Index.vue.d.ts +9 -0
- package/buildLibs/types/Web/SelectTag/Index.vue.d.ts +9 -0
- package/buildLibs/types/Web/SelectTree/Index.vue.d.ts +9 -0
- package/buildLibs/types/Web/Tree/Index.vue.d.ts +9 -0
- package/buildLibs/types/Web/componentsInstalls.d.ts +90 -0
- package/buildLibs/utils/Element/ClCheckbox.cjs +1 -1
- package/buildLibs/utils/Element/ClCheckbox.js +1 -1
- package/buildLibs/utils/Element/ClInput.cjs +1 -1
- package/buildLibs/utils/Element/ClInput.js +1 -1
- package/buildLibs/utils/Element/ClInputCaptcha.cjs +1 -1
- package/buildLibs/utils/Element/ClInputCaptcha.js +1 -1
- package/buildLibs/utils/Element/ClInputNumber.cjs +1 -1
- package/buildLibs/utils/Element/ClInputNumber.js +1 -1
- package/buildLibs/utils/Element/ClInputNumberStepper.cjs +1 -1
- package/buildLibs/utils/Element/ClInputNumberStepper.js +1 -1
- package/buildLibs/utils/Element/ClInputPassword.cjs +1 -1
- package/buildLibs/utils/Element/ClInputPassword.js +1 -1
- package/buildLibs/utils/Element/ClInputSearch.cjs +1 -1
- package/buildLibs/utils/Element/ClInputSearch.js +1 -1
- package/buildLibs/utils/Element/ClInputTextarea.cjs +1 -1
- package/buildLibs/utils/Element/ClInputTextarea.js +1 -1
- package/buildLibs/utils/Element/ClRadio.cjs +1 -1
- package/buildLibs/utils/Element/ClRadio.js +1 -1
- package/buildLibs/utils/Element/__provide__/Validate.cjs +1 -1
- package/buildLibs/utils/Element/__provide__/Validate.js +13 -3
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-C1OgPpoJ.js → Index.vue_vue_type_script_setup_true_lang-0S6ab-Lp.js} +120 -113
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-neC9NxKi.js → Index.vue_vue_type_script_setup_true_lang-2Fe9SkjL.js} +209 -201
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-2THK822S.js +254 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BO4cal3i.js → Index.vue_vue_type_script_setup_true_lang-2dwwjiTV.js} +386 -375
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-5itnjwU_.js +1 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-ChnRq_PS.js → Index.vue_vue_type_script_setup_true_lang-B0MJO0JM.js} +2 -2
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-BIO6Me43.js +1 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-BN9ybiKv.js +1 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-BpG7AHvM.js +1 -0
- package/buildLibs/{modules/shared/Index.vue_vue_type_script_setup_true_lang-CAe8mhTl.js → utils/Shared/Index.vue_vue_type_script_setup_true_lang-CATwJnes.js} +66 -60
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CW4fM0by.js +1 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-DxYJbPyJ.js → Index.vue_vue_type_script_setup_true_lang-C_exHzjc.js} +3 -3
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CsCn637u.js +2 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-D_XMW7K4.js → Index.vue_vue_type_script_setup_true_lang-D4a5Iaue.js} +153 -145
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DXPZYc0c.js +1 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DY4m6Xyj.js +1 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DZCt32jb.js +1533 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DZF2gj7X.js +2536 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-De1eNjwC.js +1 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-C6Evk0-z.js → Index.vue_vue_type_script_setup_true_lang-DtAy8lm9.js} +53 -47
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DvN-fBNd.js +1 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DwBf338f.js +1 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Cg_benGj.js → Index.vue_vue_type_script_setup_true_lang-F9tBnc_7.js} +63 -55
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-HfnOtuMz.js +310 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Dwkuei2j.js → Index.vue_vue_type_script_setup_true_lang-VjIva6RM.js} +1 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-j7gxlOeM.js +1 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-CgdGs-U2.js → Index.vue_vue_type_script_setup_true_lang-lKDQFZtY.js} +67 -59
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Dzm58mMQ.js → Index.vue_vue_type_script_setup_true_lang-nAMiORzN.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-CizRrQsH.js → Index.vue_vue_type_script_setup_true_lang-oovIcT38.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BIFHYrzc.js → Index.vue_vue_type_script_setup_true_lang-qqnmaRnk.js} +1 -1
- package/buildLibs/utils/Web/ClColorPicker.cjs +1 -1
- package/buildLibs/utils/Web/ClColorPicker.js +1 -1
- package/buildLibs/utils/Web/ClCropperPreview.cjs +1 -1
- package/buildLibs/utils/Web/ClCropperPreview.js +1 -1
- package/buildLibs/utils/Web/ClDateTime.cjs +1 -1
- package/buildLibs/utils/Web/ClDateTime.js +1 -1
- package/buildLibs/utils/Web/ClFileUpload.cjs +1 -1
- package/buildLibs/utils/Web/ClFileUpload.js +1 -1
- package/buildLibs/utils/Web/ClInputTag.cjs +1 -1
- package/buildLibs/utils/Web/ClInputTag.js +1 -1
- package/buildLibs/utils/Web/ClPaginate.cjs +1 -1
- package/buildLibs/utils/Web/ClPaginate.js +1 -1
- package/buildLibs/utils/Web/ClSelect.cjs +1 -1
- package/buildLibs/utils/Web/ClSelect.js +1 -1
- package/buildLibs/utils/Web/ClSelectCascade.cjs +1 -1
- package/buildLibs/utils/Web/ClSelectCascade.js +1 -1
- package/buildLibs/utils/Web/ClSelectMove.cjs +1 -1
- package/buildLibs/utils/Web/ClSelectMove.js +655 -647
- package/buildLibs/utils/Web/ClSelectTag.cjs +1 -1
- package/buildLibs/utils/Web/ClSelectTag.js +1 -1
- package/buildLibs/utils/Web/ClSelectTree.cjs +1 -1
- package/buildLibs/utils/Web/ClSelectTree.js +71 -63
- package/buildLibs/utils/Web/ClTable.cjs +1 -1
- package/buildLibs/utils/Web/ClTable.js +1 -1
- package/buildLibs/utils/Web/ClTree.cjs +1 -1
- package/buildLibs/utils/Web/ClTree.js +1 -1
- package/buildLibs/utils/Web/ClXEditable.cjs +1 -1
- package/buildLibs/utils/Web/ClXEditable.js +10 -10
- package/buildLibs/web/index.cjs +7 -7
- package/buildLibs/web/index.js +10792 -10685
- package/docs/components/Element/Checkbox.md +2 -1
- package/docs/components/Element/Form.md +15 -0
- package/docs/components/Element/Input.md +2 -1
- package/docs/components/Element/InputNumber.md +2 -1
- package/docs/components/Element/InputNumberStepper.md +2 -1
- package/docs/components/Element/InputTextarea.md +2 -1
- package/docs/components/Element/Radio.md +2 -1
- package/docs/components/Web/DateTime.md +2 -1
- package/docs/components/Web/FileUpload.md +2 -1
- package/docs/components/Web/Select.md +2 -1
- package/docs/components/Web/SelectCascade.md +1 -0
- package/docs/components/Web/SelectMove.md +2 -1
- package/docs/components/Web/SelectTag.md +1 -0
- package/docs/components/Web/SelectTree.md +2 -1
- package/docs/components/Web/Tree.md +2 -1
- package/package.json +1 -1
- package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-CiNidFJt.js +0 -246
- package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-DC6727pS.js +0 -2528
- package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-EXqjkKwS.js +0 -302
- package/buildLibs/modules/shared/Index.vue_vue_type_script_setup_true_lang-Hg16dgRQ.js +0 -1527
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-5aX79Fcf.js +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-BRvOcf4B.js +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-Ba8Z8fOP.js +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-BjNP5odR.js +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CQ3RGLek.js +0 -302
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CY5fRV6o.js +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CYN4r-Mx.js +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-C_7ArHlU.js +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CuJjJvft.js +0 -2
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CwjigRBx.js +0 -2528
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-D6cmq0Tf.js +0 -1527
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-Dbf-3Nik.js +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DgD_gHit.js +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-FowII7_3.js +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-c7oxeU_j.js +0 -246
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-vLqCsSbV.js +0 -1
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as Ae, defineAsyncComponent as He, inject as Be, useTemplateRef as ge, ref as ce, computed as H, onMounted as Ke, onBeforeUnmount as Ne, onDeactivated as Je, onActivated as je, watch as ee, nextTick as de, openBlock as _, createElementBlock as O, unref as N, createVNode as ye, Fragment as ue, createBlock as xe, normalizeStyle as Oe, withCtx as Ie, createElementVNode as te, normalizeClass as Pe, toDisplayString as me, reactive as qe, provide as We } from "vue";
|
|
2
|
+
import Q from "@cldemo/ui-kit/common/log";
|
|
3
3
|
import t from "@cldemo/ui-kit/common/base";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { _ as
|
|
7
|
-
import { _ as
|
|
8
|
-
import { _ as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { _ as
|
|
4
|
+
import K from "@cldemo/ui-kit/common/Element";
|
|
5
|
+
import { getPlaintextOutText as Ue } from "@cldemo/ui-kit/common/globalConfig";
|
|
6
|
+
import { _ as ze } from "./Index.vue_vue_type_script_setup_true_lang-BiBeEf5V.js";
|
|
7
|
+
import { _ as Ge } from "./List.vue_vue_type_script_setup_true_lang-Chy0eAps.js";
|
|
8
|
+
import { _ as Xe } from "./Index.vue_vue_type_script_setup_true_lang-CdYh3Pzs.js";
|
|
9
|
+
import { _ as Fe } from "./One.vue_vue_type_script_setup_true_lang-bPEj13DH.js";
|
|
10
|
+
import { a as $e } from "./language-CZZEj4e3.js";
|
|
11
|
+
import { _ as Qe } from "./Index.vue_vue_type_script_setup_true_lang-CIA-Kc0M.js";
|
|
12
|
+
import { _ as Ye } from "./Index.vue_vue_type_script_setup_true_lang-B2Ste7lk.js";
|
|
12
13
|
/* empty css */
|
|
13
|
-
const
|
|
14
|
+
const Ze = ["id"], et = {
|
|
14
15
|
key: 0,
|
|
15
16
|
class: "select-inDropdown-search",
|
|
16
17
|
role: "search",
|
|
17
18
|
"aria-label": "搜索选项"
|
|
18
|
-
},
|
|
19
|
+
}, tt = {
|
|
19
20
|
key: 2,
|
|
20
21
|
class: "select-inDropdown-checkboxAll"
|
|
21
|
-
},
|
|
22
|
+
}, nt = ["aria-selected", "aria-disabled", "onClick"], at = { class: "select-inDropdown-item-inner" }, lt = {
|
|
22
23
|
key: 0,
|
|
23
24
|
class: "select-inDropdown-checkbox"
|
|
24
|
-
},
|
|
25
|
+
}, st = ["innerHTML"], ot = {
|
|
25
26
|
key: 5,
|
|
26
27
|
class: "select-inDropdown-body"
|
|
27
|
-
},
|
|
28
|
+
}, it = { class: "select-inDropdown-empty" }, Ve = 35, rt = 210, ct = 20, dt = /* @__PURE__ */ Ae({
|
|
28
29
|
name: "ClSelectInDropdown",
|
|
29
30
|
__name: "Dropdown",
|
|
30
31
|
props: {
|
|
@@ -114,39 +115,39 @@ const Qe = ["id"], Ye = {
|
|
|
114
115
|
onError: (c) => !0
|
|
115
116
|
// desc: 服务端加载/搜索失败时触发,入参为中文错误提示
|
|
116
117
|
},
|
|
117
|
-
setup(c, { expose:
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
const k =
|
|
118
|
+
setup(c, { expose: fe, emit: J }) {
|
|
119
|
+
const i = He(() => import("vue-virtual-scroller").then((n) => (Promise.resolve({ }), n.RecycleScroller))), s = c, T = J, { optPageLanguage: Y, getPageLanguage: ne } = $e();
|
|
120
|
+
ne("common");
|
|
121
|
+
const k = Be("$SelectTop", {}), V = typeof k.getSelectData == "function", b = ge("refElSearch"), P = ge("refElScroller"), I = ge("refElRoot");
|
|
121
122
|
let v = !0;
|
|
122
123
|
const S = { isScrollLoading: !1, hasMoreData: !0 };
|
|
123
|
-
let
|
|
124
|
-
const
|
|
125
|
-
let
|
|
126
|
-
const
|
|
127
|
-
let
|
|
128
|
-
const
|
|
124
|
+
let u = [], A = 0, M = 0;
|
|
125
|
+
const ae = s.id, le = `select-inList-${s.keyIndex || ""}`;
|
|
126
|
+
let $ = !1;
|
|
127
|
+
const W = ce(""), E = ce([]), se = ce([]);
|
|
128
|
+
let oe = {};
|
|
129
|
+
const ve = (n) => {
|
|
129
130
|
const l = n.id.toString();
|
|
130
131
|
if (s.isMultiple && s.isCascade && n._hasChildren && V) {
|
|
131
|
-
const
|
|
132
|
-
if (
|
|
133
|
-
const y =
|
|
132
|
+
const f = k.getAllChildIds(l).filter((h) => !k.getSelectValueInfo(h)?.isDisabled);
|
|
133
|
+
if (f.length === 0) return 0;
|
|
134
|
+
const y = f.filter(
|
|
134
135
|
(h) => t.isExistValue(s.selectId, h)
|
|
135
136
|
).length;
|
|
136
|
-
return y === 0 ? 0 : y ===
|
|
137
|
+
return y === 0 ? 0 : y === f.length ? 2 : 1;
|
|
137
138
|
}
|
|
138
139
|
return t.isExistValue(s.selectId, l) ? 2 : 0;
|
|
139
|
-
},
|
|
140
|
+
}, pe = (n) => ve(n) === 2, Ee = (n) => ve(n) === 1, Te = H(() => {
|
|
140
141
|
let n = !1;
|
|
141
|
-
return
|
|
142
|
-
}),
|
|
142
|
+
return se.value.length > 0 && s.selectId.length >= se.value.length && (n = t.isContainArr(s.selectId, se.value)), n;
|
|
143
|
+
}), ke = (n) => {
|
|
143
144
|
if (!n || typeof n != "object") return "";
|
|
144
145
|
let l = t.isNonEmptyString(s.showDropDownTextFormat) ? s.showDropDownTextFormat : "";
|
|
145
146
|
n._level >= 1 && t.isNonEmptyString(s.showDropDownTextFormatSub) && (l = s.showDropDownTextFormatSub);
|
|
146
147
|
let a = t.isEmpty(l) ? n.name : t.convertStringFormat(l, n);
|
|
147
148
|
return t.isHtml(a) ? t.isEmpty(l) && t.isHtml(n.name) ? a = t.encodeHTML(n.name) : a = t.convertStringFormatEncodeHTML(l, n) : typeof a == "string" && a.indexOf("<") > -1 && (a = t.encodeHTML(a)), a;
|
|
148
|
-
},
|
|
149
|
-
const l =
|
|
149
|
+
}, U = (n) => {
|
|
150
|
+
const l = oe[n] || {};
|
|
150
151
|
if (t.isBoolean(l._isTypeRadio))
|
|
151
152
|
return l._isTypeRadio;
|
|
152
153
|
if (V) {
|
|
@@ -155,39 +156,39 @@ const Qe = ["id"], Ye = {
|
|
|
155
156
|
return a._isTypeRadio;
|
|
156
157
|
}
|
|
157
158
|
return !1;
|
|
158
|
-
},
|
|
159
|
+
}, z = () => {
|
|
159
160
|
const n = [];
|
|
160
|
-
|
|
161
|
+
oe = t.getJsonByList(E.value), E.value.forEach((l) => {
|
|
161
162
|
if (!t.isObject(l)) return;
|
|
162
163
|
const a = typeof l.id;
|
|
163
164
|
if (l.id == null || a !== "string" && (a !== "number" || !t.isFinite(l.id)))
|
|
164
165
|
return;
|
|
165
|
-
const
|
|
166
|
-
if (!(s.isCascade && l._hasChildren) && !
|
|
167
|
-
if (t.isExistValue(n,
|
|
168
|
-
l.isDisabled ? t.isExistValue(s.selectId,
|
|
166
|
+
const f = l.id.toString();
|
|
167
|
+
if (!(s.isCascade && l._hasChildren) && !U(f)) {
|
|
168
|
+
if (t.isExistValue(n, f)) return;
|
|
169
|
+
l.isDisabled ? t.isExistValue(s.selectId, f) && n.push(f) : n.push(f);
|
|
169
170
|
}
|
|
170
|
-
}),
|
|
171
|
+
}), se.value = n;
|
|
171
172
|
}, G = (n) => {
|
|
172
|
-
const l = s.parentKey, a = s.topParentValue,
|
|
173
|
+
const l = s.parentKey, a = s.topParentValue, f = {};
|
|
173
174
|
n.forEach((g) => {
|
|
174
175
|
if (!t.isObject(g) || g.id == null || typeof g.id != "string" && (typeof g.id != "number" || !t.isFinite(g.id)))
|
|
175
176
|
return;
|
|
176
177
|
const x = g[l], L = x != null && (typeof x == "string" || typeof x == "number") ? x.toString() : "";
|
|
177
|
-
L !== "" && L !== String(a) && (
|
|
178
|
+
L !== "" && L !== String(a) && (f[L] || (f[L] = []), f[L].push(g));
|
|
178
179
|
});
|
|
179
180
|
const y = [], h = (g, x, L, w) => {
|
|
180
|
-
g.forEach((
|
|
181
|
-
const
|
|
182
|
-
if (w.has(
|
|
183
|
-
w.add(
|
|
184
|
-
const
|
|
181
|
+
g.forEach((B) => {
|
|
182
|
+
const re = B.id.toString();
|
|
183
|
+
if (w.has(re)) return;
|
|
184
|
+
w.add(re);
|
|
185
|
+
const R = f[re] || [];
|
|
185
186
|
y.push({
|
|
186
|
-
...
|
|
187
|
+
...B,
|
|
187
188
|
_level: x,
|
|
188
189
|
_parentName: L,
|
|
189
|
-
_hasChildren:
|
|
190
|
-
}),
|
|
190
|
+
_hasChildren: R.length > 0
|
|
191
|
+
}), R.length > 0 && h(R, x + 1, B.name, w);
|
|
191
192
|
});
|
|
192
193
|
}, C = n.filter((g) => {
|
|
193
194
|
if (!t.isObject(g) || g.id == null || typeof g.id != "string" && (typeof g.id != "number" || !t.isFinite(g.id)))
|
|
@@ -200,38 +201,38 @@ const Qe = ["id"], Ye = {
|
|
|
200
201
|
if (!V) return n;
|
|
201
202
|
const a = n.filter(
|
|
202
203
|
(w) => w != null && w.id != null && (typeof w.id == "string" || typeof w.id == "number" && t.isFinite(w.id))
|
|
203
|
-
),
|
|
204
|
+
), f = l.filter(
|
|
204
205
|
(w) => w != null && w.id != null && (typeof w.id == "string" || typeof w.id == "number" && t.isFinite(w.id))
|
|
205
206
|
), y = s.parentKey, h = s.topParentValue, C = /* @__PURE__ */ new Set(), g = new Set(a.map((w) => w.id.toString()));
|
|
206
207
|
a.forEach((w) => {
|
|
207
|
-
const
|
|
208
|
-
C.add(
|
|
209
|
-
const
|
|
210
|
-
let
|
|
211
|
-
for (;
|
|
212
|
-
const
|
|
213
|
-
if (
|
|
214
|
-
|
|
208
|
+
const B = w.id.toString();
|
|
209
|
+
C.add(B);
|
|
210
|
+
const re = /* @__PURE__ */ new Set();
|
|
211
|
+
let R = w[y];
|
|
212
|
+
for (; R != null && (typeof R == "string" || typeof R == "number") && R.toString() !== String(h); ) {
|
|
213
|
+
const o = R.toString();
|
|
214
|
+
if (re.has(o)) break;
|
|
215
|
+
re.add(o), g.has(o) || C.add(o), R = k.getSelectValueInfo(o)?.[y];
|
|
215
216
|
}
|
|
216
|
-
k.getAllChildIds(
|
|
217
|
-
C.add(
|
|
217
|
+
k.getAllChildIds(B).forEach((o) => {
|
|
218
|
+
C.add(o);
|
|
218
219
|
});
|
|
219
220
|
});
|
|
220
|
-
const x =
|
|
221
|
+
const x = f.filter((w) => C.has(w.id.toString())), L = new Set(x.map((w) => w.id.toString()));
|
|
221
222
|
return C.forEach((w) => {
|
|
222
223
|
if (!L.has(w)) {
|
|
223
|
-
const
|
|
224
|
-
|
|
224
|
+
const B = k.getSelectValueInfo(w);
|
|
225
|
+
B && Object.keys(B).length > 0 && x.push(B);
|
|
225
226
|
}
|
|
226
227
|
}), x;
|
|
227
228
|
}, we = () => {
|
|
228
|
-
v && (v = !1, S.hasMoreData = !0, s.isCascade ? (
|
|
229
|
+
v && (v = !1, S.hasMoreData = !0, s.isCascade ? (u = [...s.originalData || []], E.value = G(u)) : E.value = t.getListClone(s.originalData).filter(
|
|
229
230
|
(n) => n != null && n.id != null && (typeof n.id == "string" || typeof n.id == "number" && t.isFinite(n.id))
|
|
230
|
-
),
|
|
231
|
+
), z(), _e(), W.value = "", de(() => {
|
|
231
232
|
b.value && b.value.setValue("");
|
|
232
233
|
}));
|
|
233
|
-
},
|
|
234
|
-
|
|
234
|
+
}, _e = () => {
|
|
235
|
+
de(() => {
|
|
235
236
|
if (P.value && s.selectId.length > 0) {
|
|
236
237
|
const n = E.value.findIndex(
|
|
237
238
|
(l) => l.id != null && t.isExistValue(s.selectId, l.id.toString())
|
|
@@ -239,16 +240,16 @@ const Qe = ["id"], Ye = {
|
|
|
239
240
|
n > -1 && P.value.scrollToItem(n);
|
|
240
241
|
}
|
|
241
242
|
});
|
|
242
|
-
},
|
|
243
|
-
const l = [], a =
|
|
243
|
+
}, he = (n) => {
|
|
244
|
+
const l = [], a = oe[n] || {}, f = s.isCascade && a._hasChildren;
|
|
244
245
|
if (s.isMultiple)
|
|
245
|
-
if (
|
|
246
|
+
if (U(n))
|
|
246
247
|
t.isExistValue(s.selectId, n) ? s.selectId.forEach((y) => {
|
|
247
248
|
y !== n && l.push(y);
|
|
248
249
|
}) : (s.selectId.forEach((y) => {
|
|
249
|
-
|
|
250
|
+
U(y) || l.push(y);
|
|
250
251
|
}), l.push(n));
|
|
251
|
-
else if (
|
|
252
|
+
else if (f && V) {
|
|
252
253
|
const y = k.getAllChildIds(n), h = y.filter((g) => !k.getSelectValueInfo(g)?.isDisabled), C = h.length > 0 && h.every((g) => t.isExistValue(s.selectId, g));
|
|
253
254
|
s.selectId.forEach((g) => {
|
|
254
255
|
y.includes(g) ? y.includes(g) && k.getSelectValueInfo(g)?.isDisabled && l.push(g) : l.push(g);
|
|
@@ -260,20 +261,20 @@ const Qe = ["id"], Ye = {
|
|
|
260
261
|
y !== n && l.push(y);
|
|
261
262
|
}), t.isExistValue(s.selectId, n) || l.push(n);
|
|
262
263
|
else {
|
|
263
|
-
if (
|
|
264
|
+
if (f && !s.parentSelectable)
|
|
264
265
|
return [...s.selectId];
|
|
265
266
|
l.push(n);
|
|
266
267
|
}
|
|
267
268
|
return l;
|
|
268
|
-
},
|
|
269
|
+
}, ie = (n) => {
|
|
269
270
|
const l = E.value;
|
|
270
271
|
if (l.length === 0) return;
|
|
271
272
|
let a = -1;
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
y.id.toString() ===
|
|
275
|
-
}), a += n, a < 0 ? a = 0 : a >= l.length && (a = l.length - 1)) : a = 0,
|
|
276
|
-
},
|
|
273
|
+
const f = W.value;
|
|
274
|
+
f.length > 0 ? (l.forEach((y, h) => {
|
|
275
|
+
y.id.toString() === f && (a = h);
|
|
276
|
+
}), a += n, a < 0 ? a = 0 : a >= l.length && (a = l.length - 1)) : a = 0, W.value = l[a].id.toString(), P.value && P.value.scrollToItem(a);
|
|
277
|
+
}, j = (n) => {
|
|
277
278
|
let l = n.keyCode;
|
|
278
279
|
if (!t.isUndefined(l))
|
|
279
280
|
switch (l = l.toString(), l) {
|
|
@@ -283,13 +284,13 @@ const Qe = ["id"], Ye = {
|
|
|
283
284
|
break;
|
|
284
285
|
}
|
|
285
286
|
case "38":
|
|
286
|
-
n.preventDefault(), n.stopPropagation(),
|
|
287
|
+
n.preventDefault(), n.stopPropagation(), ie(-1);
|
|
287
288
|
break;
|
|
288
289
|
case "40":
|
|
289
|
-
n.preventDefault(), n.stopPropagation(),
|
|
290
|
+
n.preventDefault(), n.stopPropagation(), ie(1);
|
|
290
291
|
break;
|
|
291
292
|
}
|
|
292
|
-
},
|
|
293
|
+
}, q = (n) => {
|
|
293
294
|
let l = n.keyCode;
|
|
294
295
|
if (!t.isUndefined(l))
|
|
295
296
|
switch (l = l.toString(), l) {
|
|
@@ -297,19 +298,19 @@ const Qe = ["id"], Ye = {
|
|
|
297
298
|
V && k.closeDropdown?.();
|
|
298
299
|
break;
|
|
299
300
|
case "13": {
|
|
300
|
-
const a =
|
|
301
|
+
const a = W.value;
|
|
301
302
|
if (!a || s.disabled || !s.isOpen) break;
|
|
302
|
-
const
|
|
303
|
-
if (n.target !== document.body && !
|
|
304
|
-
const h =
|
|
303
|
+
const f = I.value && n.target instanceof Node && I.value.contains(n.target);
|
|
304
|
+
if (n.target !== document.body && !f || !E.value.some((C) => C.id.toString() === a) || oe[a]?.isDisabled) break;
|
|
305
|
+
const h = he(a);
|
|
305
306
|
T("onChange", h);
|
|
306
307
|
break;
|
|
307
308
|
}
|
|
308
309
|
}
|
|
309
|
-
},
|
|
310
|
-
const { _level: a, _parentName:
|
|
310
|
+
}, X = (n) => n.map((l) => {
|
|
311
|
+
const { _level: a, _parentName: f, _hasChildren: y, ...h } = l;
|
|
311
312
|
return h;
|
|
312
|
-
}),
|
|
313
|
+
}), Ce = async () => {
|
|
313
314
|
if (s.serverCallback && !(S.isScrollLoading || !S.hasMoreData) && (S.isScrollLoading = !0, s.serverCallback)) {
|
|
314
315
|
const n = ++M, l = E.value;
|
|
315
316
|
try {
|
|
@@ -318,17 +319,17 @@ const Qe = ["id"], Ye = {
|
|
|
318
319
|
const C = b.value.getValue();
|
|
319
320
|
t.isEmpty(C) || (a.search = C);
|
|
320
321
|
}
|
|
321
|
-
const
|
|
322
|
+
const f = await s.serverCallback(a);
|
|
322
323
|
if (n !== M || l !== E.value) return;
|
|
323
|
-
if (!Array.isArray(
|
|
324
|
-
|
|
324
|
+
if (!Array.isArray(f)) {
|
|
325
|
+
Q.error("ClSelect", "_loadMore 服务端返回数据格式异常(非数组):", typeof f), T("onError", "服务端加载失败:返回数据格式异常");
|
|
325
326
|
return;
|
|
326
327
|
}
|
|
327
|
-
if (
|
|
328
|
+
if (f.length === 0) {
|
|
328
329
|
S.hasMoreData = !1;
|
|
329
330
|
return;
|
|
330
331
|
}
|
|
331
|
-
const y = new Set(l.map((C) => C?.id?.toString()).filter(Boolean)), h =
|
|
332
|
+
const y = new Set(l.map((C) => C?.id?.toString()).filter(Boolean)), h = f.filter((C) => {
|
|
332
333
|
if (C?.id == null) return !1;
|
|
333
334
|
const g = typeof C.id;
|
|
334
335
|
return g !== "string" && (g !== "number" || !t.isFinite(C.id)) ? !1 : !y.has(C.id.toString());
|
|
@@ -337,66 +338,66 @@ const Qe = ["id"], Ye = {
|
|
|
337
338
|
S.hasMoreData = !1;
|
|
338
339
|
return;
|
|
339
340
|
}
|
|
340
|
-
s.isCascade ? a.search ? E.value = G([...E.value, ...h]) : (
|
|
341
|
+
s.isCascade ? a.search ? E.value = G([...E.value, ...h]) : (u.length === 0 && (u = X(E.value)), u.length === 0 && (u = [...s.originalData]), u.push(...h), E.value = G(u)) : E.value.push(...h), z(), V && (k.convertListToJson(h), k.refreshDisplayLabels?.());
|
|
341
342
|
} catch (a) {
|
|
342
|
-
|
|
343
|
+
Q.error("ClSelect", "_loadMore 服务端加载失败:", a), T("onError", "服务端加载失败,请稍后重试");
|
|
343
344
|
} finally {
|
|
344
345
|
S.isScrollLoading = !1;
|
|
345
346
|
}
|
|
346
347
|
}
|
|
347
|
-
},
|
|
348
|
+
}, De = () => {
|
|
348
349
|
we(), T("onInitComplete");
|
|
349
350
|
};
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
}), He(() => {
|
|
353
|
-
$.offListener(window, "keydown", J), $.offListener(window, "keyup", B), R = !1;
|
|
351
|
+
Ke(() => {
|
|
352
|
+
De();
|
|
354
353
|
}), Ne(() => {
|
|
355
|
-
|
|
354
|
+
K.offListener(window, "keydown", j), K.offListener(window, "keyup", q), $ = !1;
|
|
356
355
|
}), Je(() => {
|
|
357
|
-
|
|
358
|
-
}),
|
|
356
|
+
K.offListener(window, "keydown", j), K.offListener(window, "keyup", q), $ = !1;
|
|
357
|
+
}), je(() => {
|
|
358
|
+
s.isOpen && !$ && (K.onListener(window, "keydown", j), K.onListener(window, "keyup", q), $ = !0);
|
|
359
|
+
}), ee(
|
|
359
360
|
() => s.isOpen,
|
|
360
361
|
(n) => {
|
|
361
362
|
n ? (v = !0, we()) : S.isScrollLoading = !1;
|
|
362
363
|
}
|
|
363
|
-
),
|
|
364
|
+
), ee(
|
|
364
365
|
() => s.originalData,
|
|
365
366
|
(n) => {
|
|
366
|
-
v = !0, s.isCascade ? (
|
|
367
|
+
v = !0, s.isCascade ? (u = [...n || []], E.value = G(u)) : E.value = t.getListClone(n).filter(
|
|
367
368
|
(l) => l != null && l.id != null && (typeof l.id == "string" || typeof l.id == "number" && t.isFinite(l.id))
|
|
368
|
-
),
|
|
369
|
+
), z(), S.hasMoreData = !0, W.value = "", de(() => {
|
|
369
370
|
b.value && b.value.setValue("");
|
|
370
371
|
});
|
|
371
372
|
}
|
|
372
373
|
);
|
|
373
|
-
const
|
|
374
|
+
const Me = async (n) => {
|
|
374
375
|
const l = ++A;
|
|
375
376
|
M = Math.max(M, l + 1);
|
|
376
377
|
let a = [];
|
|
377
|
-
if (s.isCascade && (
|
|
378
|
+
if (s.isCascade && (u = []), S.hasMoreData = !0, s.serverCallback) {
|
|
378
379
|
try {
|
|
379
|
-
if (a = await s.serverCallback({ search: n, offset: 0 }), Array.isArray(a) || (
|
|
380
|
+
if (a = await s.serverCallback({ search: n, offset: 0 }), Array.isArray(a) || (Q.error("ClSelect", "onSearch 服务端返回数据格式异常(非数组):", typeof a), T("onError", "服务端搜索失败:返回数据格式异常"), a = []), l !== A) return;
|
|
380
381
|
V && k.convertListToJson(a);
|
|
381
|
-
} catch (
|
|
382
|
-
|
|
382
|
+
} catch (f) {
|
|
383
|
+
Q.error("ClSelect", "onSearch 服务端搜索失败:", f), T("onError", "服务端搜索失败,请稍后重试"), a = [];
|
|
383
384
|
}
|
|
384
385
|
if (l !== A) return;
|
|
385
386
|
s.isCascade && (a = Se(a, s.originalData), a = G(a));
|
|
386
387
|
} else {
|
|
387
|
-
const
|
|
388
|
+
const f = s.originalData.filter(
|
|
388
389
|
(y) => y != null && y.id != null && (typeof y.id == "string" || typeof y.id == "number" && t.isFinite(y.id))
|
|
389
390
|
);
|
|
390
391
|
if (t.isEmpty(n))
|
|
391
|
-
a =
|
|
392
|
+
a = f;
|
|
392
393
|
else {
|
|
393
|
-
s.searchKeyType !== "||" && s.searchKeyType !== "&&" &&
|
|
394
|
+
s.searchKeyType !== "||" && s.searchKeyType !== "&&" && Q.warn(
|
|
394
395
|
"ClSelect",
|
|
395
396
|
"onSearch searchKeyType 未知值,已降级为 OR 匹配:",
|
|
396
397
|
s.searchKeyType
|
|
397
398
|
);
|
|
398
399
|
const y = n.toLowerCase(), h = t.isArray(s.searchKey) ? s.searchKey : ["name"], C = h.length;
|
|
399
|
-
|
|
400
|
+
f.forEach((g) => {
|
|
400
401
|
const x = [];
|
|
401
402
|
for (let L = 0; L < C; L++) {
|
|
402
403
|
const w = g[h[L]];
|
|
@@ -419,112 +420,112 @@ const Qe = ["id"], Ye = {
|
|
|
419
420
|
s.isCascade && (t.isEmpty(n) || (a = Se(a, s.originalData)), a = G(a));
|
|
420
421
|
}
|
|
421
422
|
E.value = a.filter(
|
|
422
|
-
(
|
|
423
|
-
),
|
|
424
|
-
},
|
|
423
|
+
(f) => f != null && f.id != null && (typeof f.id == "string" || typeof f.id == "number" && t.isFinite(f.id))
|
|
424
|
+
), z(), W.value = "", V && k.calculationDropdownPosition();
|
|
425
|
+
}, be = (n) => {
|
|
425
426
|
if (!s.disabled && s.isMultiple) {
|
|
426
427
|
const l = [], a = [];
|
|
427
|
-
|
|
428
|
-
n.value ? t.isExistValue(s.selectId, h) || l.push(h) : t.isExistValue(s.selectId, h) && (
|
|
428
|
+
se.value.forEach((h) => {
|
|
429
|
+
n.value ? t.isExistValue(s.selectId, h) || l.push(h) : t.isExistValue(s.selectId, h) && (oe[h]?.isDisabled || a.push(h));
|
|
429
430
|
});
|
|
430
|
-
const
|
|
431
|
+
const f = t.getArrClone(s.selectId);
|
|
431
432
|
a.length > 0 && a.forEach((h) => {
|
|
432
|
-
const C =
|
|
433
|
-
C > -1 &&
|
|
433
|
+
const C = f.indexOf(h);
|
|
434
|
+
C > -1 && f.splice(C, 1);
|
|
434
435
|
}), l.length > 0 && l.forEach((h) => {
|
|
435
|
-
t.isExistValue(
|
|
436
|
+
t.isExistValue(f, h) || f.push(h);
|
|
436
437
|
});
|
|
437
438
|
const y = [];
|
|
438
|
-
|
|
439
|
-
(!
|
|
439
|
+
f.forEach((h) => {
|
|
440
|
+
(!U(h) || t.isExistValue(s.selectId, h)) && y.push(h);
|
|
440
441
|
}), T("onChange", y);
|
|
441
442
|
}
|
|
442
|
-
},
|
|
443
|
+
}, Z = (n) => {
|
|
443
444
|
if (n.id == null || typeof n.id != "string" && (typeof n.id != "number" || !t.isFinite(n.id)) || n.isDisabled || s.disabled) return;
|
|
444
|
-
const l = n.id.toString(), a =
|
|
445
|
+
const l = n.id.toString(), a = he(l);
|
|
445
446
|
T("onChange", a);
|
|
446
447
|
};
|
|
447
|
-
return
|
|
448
|
+
return fe({
|
|
448
449
|
initOpenShow: (n) => {
|
|
449
|
-
n ?
|
|
450
|
+
n ? $ || (K.onListener(window, "keydown", j), K.onListener(window, "keyup", q), $ = !0) : $ && (K.offListener(window, "keydown", j), K.offListener(window, "keyup", q), $ = !1);
|
|
450
451
|
}
|
|
451
452
|
}), (n, l) => (_(), O("div", {
|
|
452
453
|
class: "select-inDropdown-container",
|
|
453
|
-
id:
|
|
454
|
+
id: N(ae),
|
|
454
455
|
ref_key: "refElRoot",
|
|
455
456
|
ref: I
|
|
456
457
|
}, [
|
|
457
|
-
c.isSearch ? (_(), O("div",
|
|
458
|
-
|
|
458
|
+
c.isSearch ? (_(), O("div", et, [
|
|
459
|
+
ye(Xe, {
|
|
459
460
|
ref_key: "refElSearch",
|
|
460
461
|
ref: b,
|
|
461
462
|
placeholder: c.searchPlaceholder,
|
|
462
463
|
disabled: c.disabled,
|
|
463
|
-
onOnChange:
|
|
464
|
+
onOnChange: Me
|
|
464
465
|
}, null, 8, ["placeholder", "disabled"])
|
|
465
|
-
])) : (_(), O(
|
|
466
|
-
c.isMultiple && c.isCheckBoxAll && E.value.length > 0 ? (_(), O("div",
|
|
467
|
-
|
|
468
|
-
forId: `${
|
|
469
|
-
label:
|
|
470
|
-
value:
|
|
466
|
+
])) : (_(), O(ue, { key: 1 }, [], 64)),
|
|
467
|
+
c.isMultiple && c.isCheckBoxAll && E.value.length > 0 ? (_(), O("div", tt, [
|
|
468
|
+
ye(Fe, {
|
|
469
|
+
forId: `${le}-cb-all`,
|
|
470
|
+
label: N(Y).checkboxAll,
|
|
471
|
+
value: Te.value,
|
|
471
472
|
disabled: c.disabled,
|
|
472
|
-
onOnChange:
|
|
473
|
+
onOnChange: be
|
|
473
474
|
}, null, 8, ["forId", "label", "value", "disabled"])
|
|
474
|
-
])) : (_(), O(
|
|
475
|
-
E.value.length > 0 ? (_(),
|
|
475
|
+
])) : (_(), O(ue, { key: 3 }, [], 64)),
|
|
476
|
+
E.value.length > 0 ? (_(), xe(N(i), {
|
|
476
477
|
key: 4,
|
|
477
478
|
class: "select-inDropdown-body select-inDropdown-scroller",
|
|
478
479
|
role: "listbox",
|
|
479
|
-
style:
|
|
480
|
+
style: Oe({ height: Math.min(E.value.length * Ve, rt) + "px" }),
|
|
480
481
|
items: E.value,
|
|
481
|
-
"item-size":
|
|
482
|
+
"item-size": Ve,
|
|
482
483
|
"key-field": "id",
|
|
483
484
|
ref_key: "refElScroller",
|
|
484
485
|
ref: P,
|
|
485
|
-
onScrollEnd:
|
|
486
|
+
onScrollEnd: Ce
|
|
486
487
|
}, {
|
|
487
|
-
default:
|
|
488
|
-
|
|
488
|
+
default: Ie(({ item: a }) => [
|
|
489
|
+
te("div", {
|
|
489
490
|
role: "option",
|
|
490
|
-
"aria-selected":
|
|
491
|
+
"aria-selected": pe(a),
|
|
491
492
|
"aria-disabled": a.isDisabled || !1,
|
|
492
|
-
class:
|
|
493
|
-
"option-selected":
|
|
493
|
+
class: Pe({
|
|
494
|
+
"option-selected": pe(a),
|
|
494
495
|
"option-disabled": a.isDisabled,
|
|
495
|
-
"option-hoverKeydown":
|
|
496
|
+
"option-hoverKeydown": W.value === a.id.toString(),
|
|
496
497
|
"select-inDropdown-item-child": a._level >= 1
|
|
497
498
|
}),
|
|
498
|
-
style:
|
|
499
|
-
height:
|
|
500
|
-
paddingLeft: a._level ? a._level *
|
|
499
|
+
style: Oe({
|
|
500
|
+
height: Ve + "px",
|
|
501
|
+
paddingLeft: a._level ? a._level * ct + "px" : void 0
|
|
501
502
|
}),
|
|
502
|
-
onClick: (
|
|
503
|
+
onClick: (f) => Z(a)
|
|
503
504
|
}, [
|
|
504
|
-
|
|
505
|
-
c.isMultiple ? (_(), O("div",
|
|
506
|
-
|
|
507
|
-
name: `${
|
|
508
|
-
forId: `${
|
|
509
|
-
value:
|
|
510
|
-
indeterminate:
|
|
505
|
+
te("div", at, [
|
|
506
|
+
c.isMultiple ? (_(), O("div", lt, [
|
|
507
|
+
ye(Fe, {
|
|
508
|
+
name: `${le}-cb`,
|
|
509
|
+
forId: `${le}-cb-${a.id}`,
|
|
510
|
+
value: pe(a),
|
|
511
|
+
indeterminate: Ee(a),
|
|
511
512
|
disabled: a.isDisabled
|
|
512
513
|
}, null, 8, ["name", "forId", "value", "indeterminate", "disabled"])
|
|
513
|
-
])) : (_(), O(
|
|
514
|
-
|
|
514
|
+
])) : (_(), O(ue, { key: 1 }, [], 64)),
|
|
515
|
+
te("div", {
|
|
515
516
|
class: "select-inDropdown-title",
|
|
516
|
-
innerHTML:
|
|
517
|
-
}, null, 8,
|
|
517
|
+
innerHTML: ke(a)
|
|
518
|
+
}, null, 8, st)
|
|
518
519
|
])
|
|
519
|
-
], 14,
|
|
520
|
+
], 14, nt)
|
|
520
521
|
]),
|
|
521
522
|
_: 1
|
|
522
|
-
}, 8, ["style", "items"])) : (_(), O("div",
|
|
523
|
-
|
|
523
|
+
}, 8, ["style", "items"])) : (_(), O("div", ot, [
|
|
524
|
+
te("div", it, me(N(Y).noResultsText), 1)
|
|
524
525
|
]))
|
|
525
|
-
], 8,
|
|
526
|
+
], 8, Ze));
|
|
526
527
|
}
|
|
527
|
-
}),
|
|
528
|
+
}), ut = ["id"], ft = { class: "select-inTag-title" }, pt = { class: "select-inTag-operate" }, ht = { class: "select-inTag-body" }, gt = /* @__PURE__ */ Ae({
|
|
528
529
|
name: "ClSelectInTags",
|
|
529
530
|
__name: "Tags",
|
|
530
531
|
props: {
|
|
@@ -542,56 +543,56 @@ const Qe = ["id"], Ye = {
|
|
|
542
543
|
onRemove: (c) => !0
|
|
543
544
|
// desc: 移除已选标签时触发
|
|
544
545
|
},
|
|
545
|
-
setup(c, { emit:
|
|
546
|
-
const
|
|
547
|
-
|
|
548
|
-
const
|
|
546
|
+
setup(c, { emit: fe }) {
|
|
547
|
+
const J = c, i = fe, s = J.id, { optPageLanguage: T, getPageLanguage: Y } = $e();
|
|
548
|
+
Y("common");
|
|
549
|
+
const ne = Be("$SelectTop", {}), k = typeof ne.getSelectData == "function", V = H(() => k ? t.isArray(J.selectId) ? ne.getSelectData(J.selectId) : [] : []), b = H(() => k ? V.value.length : 0), P = H(() => t.isArray(V.value) ? V.value.some((S) => t.isObject(S) ? !(t.isBoolean(S.isDisabled) && S.isDisabled) : !1) : !1), I = () => {
|
|
549
550
|
const S = V.value;
|
|
550
551
|
if (!t.isArray(S)) return;
|
|
551
|
-
const
|
|
552
|
+
const u = [];
|
|
552
553
|
let A = !1;
|
|
553
554
|
S.forEach((M) => {
|
|
554
555
|
if (!t.isObject(M)) return;
|
|
555
|
-
(t.isBoolean(M.isDisabled) ? !!M.isDisabled : !1) ? (typeof M.id == "string" && !t.isEmpty(M.id) || typeof M.id == "number" && t.isFinite(M.id)) &&
|
|
556
|
-
}), A &&
|
|
556
|
+
(t.isBoolean(M.isDisabled) ? !!M.isDisabled : !1) ? (typeof M.id == "string" && !t.isEmpty(M.id) || typeof M.id == "number" && t.isFinite(M.id)) && u.push(M.id.toString()) : A = !0;
|
|
557
|
+
}), A && i("onRemove", u);
|
|
557
558
|
}, v = (S) => {
|
|
558
|
-
if (!t.isArray(
|
|
559
|
-
const
|
|
559
|
+
if (!t.isArray(J.selectId) || t.isEmpty(S)) return;
|
|
560
|
+
const u = String(S), A = J.selectId.findIndex((ae) => String(ae) === u);
|
|
560
561
|
if (A === -1)
|
|
561
562
|
return;
|
|
562
|
-
const M = t.getArrClone(
|
|
563
|
-
M.splice(A, 1),
|
|
563
|
+
const M = t.getArrClone(J.selectId);
|
|
564
|
+
M.splice(A, 1), i("onRemove", M);
|
|
564
565
|
};
|
|
565
|
-
return (S,
|
|
566
|
+
return (S, u) => (_(), O("div", {
|
|
566
567
|
class: "select-inTag-container",
|
|
567
|
-
id:
|
|
568
|
+
id: N(s)
|
|
568
569
|
}, [
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
P.value ? (_(),
|
|
570
|
+
te("div", ft, [
|
|
571
|
+
te("span", null, me(N(T).selected) + " " + me(b.value) + " " + me(N(T).count), 1),
|
|
572
|
+
te("span", pt, [
|
|
573
|
+
P.value ? (_(), xe(Qe, {
|
|
573
574
|
key: 0,
|
|
574
575
|
class: "select-inTag-deleteAll",
|
|
575
576
|
name: "remove",
|
|
576
|
-
title:
|
|
577
|
-
"aria-label":
|
|
577
|
+
title: N(T).deleteAll,
|
|
578
|
+
"aria-label": N(T).deleteAll,
|
|
578
579
|
onClick: I
|
|
579
|
-
}, null, 8, ["title", "aria-label"])) : (_(), O(
|
|
580
|
+
}, null, 8, ["title", "aria-label"])) : (_(), O(ue, { key: 1 }, [], 64))
|
|
580
581
|
])
|
|
581
582
|
]),
|
|
582
|
-
|
|
583
|
-
|
|
583
|
+
te("div", ht, [
|
|
584
|
+
ye(Ye, {
|
|
584
585
|
showTextFormat: c.showTextFormat,
|
|
585
586
|
list: V.value,
|
|
586
587
|
onOnRemove: v
|
|
587
588
|
}, null, 8, ["showTextFormat", "list"])
|
|
588
589
|
])
|
|
589
|
-
], 8,
|
|
590
|
+
], 8, ut));
|
|
590
591
|
}
|
|
591
|
-
}),
|
|
592
|
+
}), yt = ["id"], mt = {
|
|
592
593
|
key: 0,
|
|
593
594
|
class: "select-inText-num"
|
|
594
|
-
},
|
|
595
|
+
}, Lt = /* @__PURE__ */ Ae({
|
|
595
596
|
name: "ClSelect",
|
|
596
597
|
__name: "Index",
|
|
597
598
|
props: {
|
|
@@ -711,6 +712,11 @@ const Qe = ["id"], Ye = {
|
|
|
711
712
|
default: !1
|
|
712
713
|
// desc: 是否纯文本只读模式,只渲染选中项文本不挂载下拉面板
|
|
713
714
|
},
|
|
715
|
+
plaintextEmptyText: {
|
|
716
|
+
type: String,
|
|
717
|
+
default: void 0
|
|
718
|
+
// desc: 纯文本只读模式下值为空时的显示文本(默认 "-",显式传空串则显示空白;未显式传时依次读取组件配置段与 plaintextGlobal 段)
|
|
719
|
+
},
|
|
714
720
|
plaintextSeparator: {
|
|
715
721
|
type: String,
|
|
716
722
|
default: ","
|
|
@@ -736,7 +742,7 @@ const Qe = ["id"], Ye = {
|
|
|
736
742
|
// desc: v-model 值更新时触发
|
|
737
743
|
"update:modelValue": (c) => !0,
|
|
738
744
|
// desc: 标准 v-model 支持(等价 update:value)
|
|
739
|
-
onChange: (c,
|
|
745
|
+
onChange: (c, fe) => !0,
|
|
740
746
|
// desc: 选中值变更时触发
|
|
741
747
|
onInit: () => !0,
|
|
742
748
|
// desc: 组件初始化完成时触发
|
|
@@ -745,8 +751,8 @@ const Qe = ["id"], Ye = {
|
|
|
745
751
|
onError: (c) => !0
|
|
746
752
|
// desc: 服务端加载/搜索失败时触发,入参为中文错误提示
|
|
747
753
|
},
|
|
748
|
-
setup(c, { expose:
|
|
749
|
-
const
|
|
754
|
+
setup(c, { expose: fe, emit: J }) {
|
|
755
|
+
const i = c, s = J, T = ge("refElDropdownLayer"), Y = ge("refElList"), ne = ge("refElTags"), k = `select-${t.getRandom(8)}`, V = i.id, b = qe({
|
|
750
756
|
isOpen: !1,
|
|
751
757
|
dropDownPos: "down",
|
|
752
758
|
tagHeight: "",
|
|
@@ -763,85 +769,87 @@ const Qe = ["id"], Ye = {
|
|
|
763
769
|
// id → 该节点下所有叶子 id
|
|
764
770
|
allChildMap: {}
|
|
765
771
|
// id → 该节点下所有后代 id(含中间层)
|
|
766
|
-
}, S =
|
|
767
|
-
let
|
|
768
|
-
const
|
|
772
|
+
}, S = ce(!1), u = ce([]), A = ce([]), M = ce([]);
|
|
773
|
+
let ae = !1;
|
|
774
|
+
const le = H(() => t.isNonEmptyString(i.showTextFormat) ? i.showTextFormat : i.isCascade ? "${name}(${parentName})" : ""), $ = H(() => {
|
|
769
775
|
let e = { "panel-select": !0 };
|
|
770
|
-
return
|
|
771
|
-
}),
|
|
772
|
-
const e = t.isString(
|
|
776
|
+
return i.theme === "noBorder" && (e["select-theme-noBorder"] = !0), e = t.getJsonMerge(e, K.getClassNameJson(i.className)), t.getStringByJson(e, " ");
|
|
777
|
+
}), W = H(() => `${$.value} cl-plaintext-value`), E = H(() => {
|
|
778
|
+
const e = t.isString(i.plaintextSeparator) ? i.plaintextSeparator : ",";
|
|
773
779
|
return M.value.join(e);
|
|
774
|
-
}),
|
|
780
|
+
}), se = H(
|
|
781
|
+
() => Ue("select", i.plaintextEmptyText, E.value, i.value)
|
|
782
|
+
), oe = H(() => {
|
|
775
783
|
let e = { "select-inDropdown": !0 };
|
|
776
|
-
return
|
|
777
|
-
}),
|
|
784
|
+
return i.theme === "noBorder" && (e["select-inDropdown-noBorder"] = !0), b.isOpen && i.multiple && i.isShowTag && (e["select-inTag-ext"] = !0, e[`select-inTag-${b.tagDirection}`] = !0), e = t.getJsonMerge(e, K.getClassNameJson(i.classDropDown)), t.getStringByJson(e, " ");
|
|
785
|
+
}), ve = H(() => {
|
|
778
786
|
const e = {
|
|
779
787
|
"select-inTag": !0,
|
|
780
788
|
"select-inTag-open": b.isOpen
|
|
781
789
|
};
|
|
782
790
|
return e[`select-inTag-${b.dropDownPos}`] = !0, e[`select-inTag-${b.tagDirection}`] = !0, e;
|
|
783
|
-
}),
|
|
791
|
+
}), pe = (e) => {
|
|
784
792
|
s("update:value", e), s("update:modelValue", e);
|
|
785
|
-
},
|
|
786
|
-
|
|
793
|
+
}, Ee = (e, o) => {
|
|
794
|
+
pe(e), s("onChange", e, o);
|
|
787
795
|
}, Te = () => {
|
|
788
|
-
|
|
796
|
+
ae || (ae = !0, de(() => {
|
|
789
797
|
s("onInit");
|
|
790
798
|
}));
|
|
791
799
|
}, ke = (e) => {
|
|
792
|
-
|
|
800
|
+
de(() => {
|
|
793
801
|
s("onOpen", e);
|
|
794
802
|
});
|
|
795
|
-
},
|
|
803
|
+
}, U = () => {
|
|
796
804
|
const e = [];
|
|
797
|
-
return
|
|
798
|
-
t.isExistJsonKey(I,
|
|
805
|
+
return u.value.forEach((o) => {
|
|
806
|
+
t.isExistJsonKey(I, o) && e.push(o);
|
|
799
807
|
}), e;
|
|
800
|
-
},
|
|
808
|
+
}, z = (e) => {
|
|
801
809
|
if (t.isEmpty(e) || !t.isArray(e)) return;
|
|
802
|
-
const
|
|
810
|
+
const o = {}, r = i.parentKey, p = i.topParentValue;
|
|
803
811
|
if (e.forEach((d) => {
|
|
804
812
|
if (!t.isObject(d)) {
|
|
805
|
-
|
|
813
|
+
Q.warn("ClSelect", "_convertListToJson 跳过非对象数据项:", d);
|
|
806
814
|
return;
|
|
807
815
|
}
|
|
808
816
|
if (!(typeof d.id == "string" || typeof d.id == "number" && t.isFinite(d.id))) {
|
|
809
|
-
|
|
817
|
+
Q.warn("ClSelect", "_convertListToJson 跳过无 id 或 id 类型异常的数据项:", d);
|
|
810
818
|
return;
|
|
811
819
|
}
|
|
812
820
|
const D = d.id.toString();
|
|
813
|
-
|
|
814
|
-
}), I = t.getJsonMerge(I,
|
|
821
|
+
o[D] = t.getJsonClone(d);
|
|
822
|
+
}), I = t.getJsonMerge(I, o), i.serverCallback && !S.value && !t.isEmpty(o) && (S.value = !0, i.value != null && i.value !== "" && (q(i.value), j())), i.isCascade && Object.keys(I).forEach((d) => {
|
|
815
823
|
const m = I[d][r], D = m != null && (typeof m == "string" || typeof m == "number") ? m.toString() : "";
|
|
816
824
|
if (D !== "" && D !== String(p)) {
|
|
817
825
|
const F = I[D];
|
|
818
826
|
F?.name && (I[d].parentName = F.name);
|
|
819
827
|
}
|
|
820
|
-
}),
|
|
821
|
-
const d =
|
|
822
|
-
t.isEqualArr(
|
|
828
|
+
}), i.isCascade && (G(), i.isOutMerge && i.multiple && u.value.length > 0)) {
|
|
829
|
+
const d = he(u.value);
|
|
830
|
+
t.isEqualArr(u.value, d) || (u.value = d, P = d);
|
|
823
831
|
}
|
|
824
|
-
if (
|
|
825
|
-
const d =
|
|
832
|
+
if (i.multiple && u.value.length > 1) {
|
|
833
|
+
const d = u.value.filter((m) => {
|
|
826
834
|
const D = I[m];
|
|
827
835
|
return t.isBoolean(D?._isTypeRadio) && D._isTypeRadio;
|
|
828
836
|
});
|
|
829
837
|
if (d.length > 1) {
|
|
830
|
-
const m = d[d.length - 1], D =
|
|
838
|
+
const m = d[d.length - 1], D = u.value.filter(
|
|
831
839
|
(F) => F === m || !d.includes(F)
|
|
832
840
|
);
|
|
833
|
-
t.isEqualArr(
|
|
841
|
+
t.isEqualArr(u.value, D) || (u.value = D, Z());
|
|
834
842
|
}
|
|
835
843
|
}
|
|
836
|
-
|
|
837
|
-
},
|
|
838
|
-
const e =
|
|
844
|
+
u.value.length > 0 && (u.value = [...u.value]);
|
|
845
|
+
}, G = () => {
|
|
846
|
+
const e = i.parentKey, o = i.topParentValue;
|
|
839
847
|
v.childrenMap = {}, v.parentMap = {}, v.lastChildMap = {}, v.allChildMap = {}, Object.keys(I).forEach((p) => {
|
|
840
848
|
const m = I[p][e], D = m != null && (typeof m == "string" || typeof m == "number") ? m.toString() : "";
|
|
841
|
-
D !== "" && D !== String(
|
|
849
|
+
D !== "" && D !== String(o) && (v.parentMap[p] = D, v.childrenMap[D] || (v.childrenMap[D] = []), v.childrenMap[D].push(p));
|
|
842
850
|
});
|
|
843
|
-
},
|
|
844
|
-
const
|
|
851
|
+
}, Se = (e) => {
|
|
852
|
+
const o = (r, p) => {
|
|
845
853
|
if (v.lastChildMap[r])
|
|
846
854
|
return v.lastChildMap[r];
|
|
847
855
|
if (p.has(r)) return [];
|
|
@@ -851,12 +859,12 @@ const Qe = ["id"], Ye = {
|
|
|
851
859
|
return v.lastChildMap[r] = [r], [r];
|
|
852
860
|
const m = [];
|
|
853
861
|
return d.forEach((D) => {
|
|
854
|
-
m.push(...
|
|
862
|
+
m.push(...o(D, new Set(p)));
|
|
855
863
|
}), v.lastChildMap[r] = m, m;
|
|
856
864
|
};
|
|
857
|
-
return
|
|
858
|
-
},
|
|
859
|
-
const
|
|
865
|
+
return o(e, /* @__PURE__ */ new Set());
|
|
866
|
+
}, we = (e) => {
|
|
867
|
+
const o = (r, p) => {
|
|
860
868
|
if (v.allChildMap[r])
|
|
861
869
|
return v.allChildMap[r];
|
|
862
870
|
if (p.has(r)) return [];
|
|
@@ -866,16 +874,16 @@ const Qe = ["id"], Ye = {
|
|
|
866
874
|
return v.allChildMap[r] = [], [];
|
|
867
875
|
const m = [];
|
|
868
876
|
d.forEach((F) => {
|
|
869
|
-
m.push(F), m.push(...
|
|
877
|
+
m.push(F), m.push(...o(F, new Set(p)));
|
|
870
878
|
});
|
|
871
879
|
const D = Array.from(new Set(m));
|
|
872
880
|
return v.allChildMap[r] = D, D;
|
|
873
881
|
};
|
|
874
|
-
return
|
|
875
|
-
},
|
|
882
|
+
return o(e, /* @__PURE__ */ new Set());
|
|
883
|
+
}, _e = (e) => {
|
|
876
884
|
if (e.length === 0) return [];
|
|
877
|
-
const
|
|
878
|
-
for (const d of
|
|
885
|
+
const o = new Set(e), r = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Set();
|
|
886
|
+
for (const d of o) {
|
|
879
887
|
const m = v.parentMap[d];
|
|
880
888
|
m && !p.has(m) && r.add(m);
|
|
881
889
|
}
|
|
@@ -887,141 +895,144 @@ const Qe = ["id"], Ye = {
|
|
|
887
895
|
if (!m || m.length === 0) continue;
|
|
888
896
|
let D = !0;
|
|
889
897
|
for (const F of m)
|
|
890
|
-
if (!
|
|
898
|
+
if (!o.has(F)) {
|
|
891
899
|
D = !1;
|
|
892
900
|
break;
|
|
893
901
|
}
|
|
894
902
|
if (D) {
|
|
895
|
-
for (const
|
|
896
|
-
|
|
903
|
+
for (const Re of m) o.delete(Re);
|
|
904
|
+
o.add(d);
|
|
897
905
|
const F = v.parentMap[d];
|
|
898
906
|
F && !p.has(F) && r.add(F);
|
|
899
907
|
}
|
|
900
908
|
}
|
|
901
|
-
return [...
|
|
902
|
-
},
|
|
909
|
+
return [...o];
|
|
910
|
+
}, he = (e) => {
|
|
903
911
|
if (e.length === 0) return [];
|
|
904
|
-
const
|
|
912
|
+
const o = [];
|
|
905
913
|
return e.forEach((r) => {
|
|
906
|
-
|
|
907
|
-
}), t.getArrUnique(
|
|
908
|
-
},
|
|
909
|
-
if (S.value && !t.isEmpty(
|
|
910
|
-
if (t.isEmpty(I) ||
|
|
911
|
-
const e =
|
|
912
|
-
if (!t.isEqualArr(
|
|
913
|
-
const
|
|
914
|
-
|
|
915
|
-
const r =
|
|
916
|
-
|
|
914
|
+
o.push(...Se(r));
|
|
915
|
+
}), t.getArrUnique(o);
|
|
916
|
+
}, ie = (e) => !i.isCascade || !i.multiple ? e : i.isOutMerge ? _e(e) : he(e), j = () => {
|
|
917
|
+
if (S.value && !t.isEmpty(u.value)) {
|
|
918
|
+
if (t.isEmpty(I) || i.serverCallback) return;
|
|
919
|
+
const e = U();
|
|
920
|
+
if (!t.isEqualArr(u.value, e)) {
|
|
921
|
+
const o = u.value.filter((p) => !e.includes(p));
|
|
922
|
+
o.length > 0 && Q.warn("ClSelect", "以下 id 在数据列表中不存在,已自动清除:", o), u.value = e, P = e;
|
|
923
|
+
const r = ie(e);
|
|
924
|
+
pe(r.join(","));
|
|
917
925
|
}
|
|
918
926
|
}
|
|
919
|
-
},
|
|
927
|
+
}, q = (e) => {
|
|
920
928
|
if (e != null && typeof e != "string" && (typeof e != "number" || !t.isFinite(e))) {
|
|
921
|
-
|
|
929
|
+
Q.warn("ClSelect", "setValue 收到非预期类型值:", typeof e, e);
|
|
922
930
|
return;
|
|
923
931
|
}
|
|
924
|
-
let
|
|
925
|
-
|
|
926
|
-
let r = t.isEqualArr(
|
|
927
|
-
r && (r =
|
|
928
|
-
},
|
|
929
|
-
const
|
|
930
|
-
return
|
|
931
|
-
const d =
|
|
932
|
+
let o = e == null || e === "" ? [] : e.toString().split(",").filter((p) => p !== "");
|
|
933
|
+
o = t.getArrUnique(o), i.isCascade && i.isOutMerge && o.length > 0 && i.multiple && (o = he(o));
|
|
934
|
+
let r = t.isEqualArr(u.value, o);
|
|
935
|
+
r && (r = o.join(",") === u.value.join(",")), r || (P = o, u.value = o);
|
|
936
|
+
}, X = (e) => t.isExistJsonKey(I, e) ? t.getJsonClone(I[e]) : {}, Ce = (e) => {
|
|
937
|
+
const o = t.isArray(e) ? e : u.value, r = [];
|
|
938
|
+
return o.forEach((p) => {
|
|
939
|
+
const d = X(p);
|
|
932
940
|
t.isEmpty(d) || r.push(d);
|
|
933
941
|
}), r;
|
|
934
942
|
}, De = (e) => {
|
|
935
|
-
const r =
|
|
943
|
+
const r = i.isCascade && !i.multiple && (v.childrenMap[e.id?.toString()]?.length > 0 || !v.parentMap[e.id?.toString()]) && t.isEmpty(i.showTextFormat) ? "" : le.value;
|
|
936
944
|
let p = t.isEmpty(r) ? e.name ?? "" : t.convertStringFormat(r, e);
|
|
937
945
|
return t.isHtml(p) ? p = t.isEmpty(r) ? t.encodeHTML(e.name) : t.convertStringFormatEncodeHTML(r, e) : typeof p == "string" && p.indexOf("<") > -1 && (p = t.encodeHTML(p)), p;
|
|
938
|
-
},
|
|
939
|
-
if (t.isNonEmptyString(
|
|
946
|
+
}, Me = (e) => {
|
|
947
|
+
if (t.isNonEmptyString(i.showTextFormat))
|
|
940
948
|
return t.removeHTMLTags(De(e));
|
|
941
|
-
const
|
|
949
|
+
const o = t.isString(i.plaintextLevelSeparator) ? i.plaintextLevelSeparator : " > ", r = t.isString(e?.name) ? e.name : "", p = t.isString(e?.parentName) ? e.parentName : "", d = i.isCascade && t.isNonEmptyString(p) ? `${p}${o}${r}` : r;
|
|
942
950
|
return t.removeHTMLTags(d);
|
|
943
951
|
}, be = () => {
|
|
944
952
|
const e = Ce();
|
|
945
|
-
A.value = e.map((
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
953
|
+
A.value = e.map((o) => De(o)), M.value = u.value.map((o) => {
|
|
954
|
+
const r = X(o);
|
|
955
|
+
return t.isEmpty(r) ? o : Me(r);
|
|
956
|
+
});
|
|
957
|
+
}, Z = () => {
|
|
958
|
+
const e = U();
|
|
959
|
+
P = e, u.value = e;
|
|
960
|
+
const o = ie(e), r = o.join(",");
|
|
950
961
|
let p;
|
|
951
|
-
if (
|
|
962
|
+
if (i.multiple) {
|
|
952
963
|
const d = [];
|
|
953
|
-
|
|
954
|
-
const D =
|
|
964
|
+
o.forEach((m) => {
|
|
965
|
+
const D = X(m);
|
|
955
966
|
t.isEmpty(D) || d.push(D);
|
|
956
967
|
}), p = d;
|
|
957
968
|
} else
|
|
958
|
-
p =
|
|
959
|
-
|
|
960
|
-
},
|
|
961
|
-
b.isOpen || !t.isEqualArr(
|
|
962
|
-
}, Me = () => {
|
|
963
|
-
S.value || (S.value = !0, W(o.list), J(o.value), oe());
|
|
969
|
+
p = X(r), t.isEmpty(p) && (p = null);
|
|
970
|
+
Ee(r, p);
|
|
971
|
+
}, Le = () => {
|
|
972
|
+
b.isOpen || !t.isEqualArr(u.value, P) && Z();
|
|
964
973
|
}, n = () => {
|
|
965
|
-
|
|
974
|
+
S.value || (S.value = !0, z(i.list), q(i.value), j());
|
|
966
975
|
}, l = () => {
|
|
976
|
+
!S.value && i.list && i.list.length > 0 && n();
|
|
977
|
+
}, a = () => {
|
|
967
978
|
import("vue-virtual-scroller").then(() => {
|
|
968
979
|
Promise.resolve({ });
|
|
969
980
|
});
|
|
970
981
|
};
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
982
|
+
Ke(() => {
|
|
983
|
+
i.isPlaintext || a(), de(() => {
|
|
984
|
+
l();
|
|
974
985
|
});
|
|
975
|
-
}),
|
|
986
|
+
}), ee(S, (e) => {
|
|
976
987
|
e && Te();
|
|
977
|
-
}),
|
|
978
|
-
() =>
|
|
979
|
-
(e,
|
|
980
|
-
S.value || (e && e.length > 0 ||
|
|
988
|
+
}), ee(
|
|
989
|
+
() => i.list,
|
|
990
|
+
(e, o) => {
|
|
991
|
+
S.value || (e && e.length > 0 || o === void 0) && (S.value = !0);
|
|
981
992
|
}
|
|
982
|
-
),
|
|
983
|
-
const d =
|
|
984
|
-
!S.value && d.length > 0 && (S.value = !0),
|
|
985
|
-
}),
|
|
986
|
-
|
|
987
|
-
}),
|
|
988
|
-
() =>
|
|
993
|
+
), ee([() => i.value, () => i.list], ([e, o], [r, p]) => {
|
|
994
|
+
const d = o || [];
|
|
995
|
+
!S.value && d.length > 0 && (S.value = !0), o !== p && (I = {}, v.childrenMap = {}, v.parentMap = {}, v.lastChildMap = {}, v.allChildMap = {}), z(d), e !== void 0 && q(e), j();
|
|
996
|
+
}), ee([u, () => i.list], ([e, o]) => {
|
|
997
|
+
o && o.length > 0 && t.isEmpty(I) && z(o), be();
|
|
998
|
+
}), ee(
|
|
999
|
+
() => i.isOutMerge,
|
|
989
1000
|
() => {
|
|
990
|
-
|
|
1001
|
+
i.isCascade && i.multiple && u.value.length > 0 && ie(U()).join(",") !== String(i.value ?? "") && Z();
|
|
991
1002
|
}
|
|
992
|
-
),
|
|
993
|
-
|
|
1003
|
+
), ee([() => i.parentKey, () => i.topParentValue], () => {
|
|
1004
|
+
i.isCascade && !t.isEmpty(I) && G();
|
|
994
1005
|
});
|
|
995
|
-
const
|
|
996
|
-
e &&
|
|
997
|
-
|
|
1006
|
+
const f = (e) => {
|
|
1007
|
+
e && i.disabled || (b.isOpen = e, e ? P = u.value : Le(), de(() => {
|
|
1008
|
+
Y.value && Y.value.initOpenShow(e);
|
|
998
1009
|
}), ke(e));
|
|
999
|
-
},
|
|
1000
|
-
|
|
1001
|
-
}, y = (e) => {
|
|
1002
|
-
if (b.dropDownPos = e.use.dropDownPos, o.multiple && o.isShowTag) {
|
|
1003
|
-
const i = Z.value?.$el?.offsetWidth || 0;
|
|
1004
|
-
b.tagHeight = o.theme === "default" ? `${e.original.dropDownHeight + 1}px` : `${e.original.dropDownHeight}px`;
|
|
1005
|
-
const r = e.original.winWidth - (e.original.controlOffset.left + e.original.dropDownWidth) >= i ? "right" : "left";
|
|
1006
|
-
b.tagDirection = r, r === "right" ? b.tagLeft = `${e.original.dropDownWidth - 1}px` : b.tagLeft = `${(e.original.dropDownWidth - e.original.textWidth + i + 1) * -1}px`;
|
|
1007
|
-
}
|
|
1010
|
+
}, y = () => {
|
|
1011
|
+
i.disabled || (u.value = [], i.multiple && i.multipleRealTimeChange ? Z() : Le());
|
|
1008
1012
|
}, h = (e) => {
|
|
1009
|
-
|
|
1013
|
+
if (b.dropDownPos = e.use.dropDownPos, i.multiple && i.isShowTag) {
|
|
1014
|
+
const o = ne.value?.$el?.offsetWidth || 0;
|
|
1015
|
+
b.tagHeight = i.theme === "default" ? `${e.original.dropDownHeight + 1}px` : `${e.original.dropDownHeight}px`;
|
|
1016
|
+
const r = e.original.winWidth - (e.original.controlOffset.left + e.original.dropDownWidth) >= o ? "right" : "left";
|
|
1017
|
+
b.tagDirection = r, r === "right" ? b.tagLeft = `${e.original.dropDownWidth - 1}px` : b.tagLeft = `${(e.original.dropDownWidth - e.original.textWidth + o + 1) * -1}px`;
|
|
1018
|
+
}
|
|
1010
1019
|
}, C = (e) => {
|
|
1011
|
-
|
|
1020
|
+
u.value = e, i.multiple ? i.multipleRealTimeChange && Z() : T.value?.setOpen(!1);
|
|
1012
1021
|
}, g = (e) => {
|
|
1022
|
+
i.disabled || (u.value = e, Z());
|
|
1023
|
+
}, x = (e) => {
|
|
1013
1024
|
s("onError", e);
|
|
1014
|
-
},
|
|
1025
|
+
}, L = () => {
|
|
1015
1026
|
T.value && (T.value.checkIsShowOpen() || T.value.initCompleteOpen());
|
|
1016
1027
|
};
|
|
1017
|
-
|
|
1028
|
+
We("$SelectTop", {
|
|
1018
1029
|
getSelectData: Ce,
|
|
1019
|
-
getSelectValueInfo:
|
|
1020
|
-
getAllChildIds:
|
|
1030
|
+
getSelectValueInfo: X,
|
|
1031
|
+
getAllChildIds: we,
|
|
1021
1032
|
calculationDropdownPosition: () => {
|
|
1022
1033
|
T.value?.calculationPosition();
|
|
1023
1034
|
},
|
|
1024
|
-
convertListToJson:
|
|
1035
|
+
convertListToJson: z,
|
|
1025
1036
|
closeDropdown: () => {
|
|
1026
1037
|
T.value?.setOpen(!1);
|
|
1027
1038
|
},
|
|
@@ -1029,43 +1040,43 @@ const Qe = ["id"], Ye = {
|
|
|
1029
1040
|
be();
|
|
1030
1041
|
}
|
|
1031
1042
|
});
|
|
1032
|
-
const
|
|
1033
|
-
const e =
|
|
1034
|
-
return
|
|
1043
|
+
const w = () => {
|
|
1044
|
+
const e = U();
|
|
1045
|
+
return ie(e).join(",");
|
|
1035
1046
|
};
|
|
1036
|
-
return
|
|
1037
|
-
getValue:
|
|
1047
|
+
return fe({
|
|
1048
|
+
getValue: w,
|
|
1038
1049
|
getValueData: () => {
|
|
1039
|
-
const e =
|
|
1040
|
-
if (
|
|
1050
|
+
const e = w();
|
|
1051
|
+
if (i.multiple) {
|
|
1041
1052
|
const r = e ? e.split(",") : [], p = [];
|
|
1042
1053
|
return r.forEach((d) => {
|
|
1043
|
-
const m =
|
|
1054
|
+
const m = X(d);
|
|
1044
1055
|
t.isEmpty(m) || p.push(m);
|
|
1045
1056
|
}), p;
|
|
1046
1057
|
}
|
|
1047
1058
|
if (!e) return null;
|
|
1048
|
-
const
|
|
1049
|
-
return t.isEmpty(
|
|
1059
|
+
const o = X(e);
|
|
1060
|
+
return t.isEmpty(o) ? null : o;
|
|
1050
1061
|
},
|
|
1051
1062
|
setValue: (e) => {
|
|
1052
|
-
|
|
1063
|
+
q(e), j();
|
|
1053
1064
|
},
|
|
1054
1065
|
runInitComplete: () => {
|
|
1055
|
-
|
|
1066
|
+
n();
|
|
1056
1067
|
}
|
|
1057
|
-
}), (e,
|
|
1068
|
+
}), (e, o) => c.isPlaintext ? (_(), O("div", {
|
|
1058
1069
|
key: 0,
|
|
1059
|
-
id:
|
|
1060
|
-
class:
|
|
1061
|
-
},
|
|
1070
|
+
id: N(V),
|
|
1071
|
+
class: Pe(W.value)
|
|
1072
|
+
}, me(se.value), 11, yt)) : (_(), xe(Ge, {
|
|
1062
1073
|
key: 1,
|
|
1063
|
-
id:
|
|
1074
|
+
id: N(V),
|
|
1064
1075
|
ref_key: "refElDropdownLayer",
|
|
1065
1076
|
ref: T,
|
|
1066
|
-
classParent:
|
|
1077
|
+
classParent: $.value,
|
|
1067
1078
|
classText: "select-inText",
|
|
1068
|
-
classDropDown:
|
|
1079
|
+
classDropDown: oe.value,
|
|
1069
1080
|
placeholder: c.placeholder,
|
|
1070
1081
|
isDisabled: c.disabled,
|
|
1071
1082
|
isClear: c.isClear,
|
|
@@ -1075,22 +1086,22 @@ const Qe = ["id"], Ye = {
|
|
|
1075
1086
|
appendContainer: c.appendContainer,
|
|
1076
1087
|
appendFollowWidth: c.theme !== "noBorder",
|
|
1077
1088
|
onOpenBeforeCallback: c.onOpenBefore,
|
|
1078
|
-
onOnChangeOpen:
|
|
1079
|
-
onOnClear:
|
|
1080
|
-
onOnChangePosition:
|
|
1089
|
+
onOnChangeOpen: f,
|
|
1090
|
+
onOnClear: y,
|
|
1091
|
+
onOnChangePosition: h
|
|
1081
1092
|
}, {
|
|
1082
|
-
textExtend:
|
|
1083
|
-
c.multiple ? (_(), O("span",
|
|
1084
|
-
A.value.length > 1 ? (_(),
|
|
1093
|
+
textExtend: Ie(() => [
|
|
1094
|
+
c.multiple ? (_(), O("span", mt, [
|
|
1095
|
+
A.value.length > 1 ? (_(), xe(ze, {
|
|
1085
1096
|
key: 0,
|
|
1086
1097
|
num: A.value.length
|
|
1087
|
-
}, null, 8, ["num"])) : (_(), O(
|
|
1088
|
-
])) : (_(), O(
|
|
1098
|
+
}, null, 8, ["num"])) : (_(), O(ue, { key: 1 }, [], 64))
|
|
1099
|
+
])) : (_(), O(ue, { key: 1 }, [], 64))
|
|
1089
1100
|
]),
|
|
1090
|
-
dropdown:
|
|
1091
|
-
|
|
1101
|
+
dropdown: Ie(() => [
|
|
1102
|
+
ye(dt, {
|
|
1092
1103
|
ref_key: "refElList",
|
|
1093
|
-
ref:
|
|
1104
|
+
ref: Y,
|
|
1094
1105
|
isSearch: c.isSearch,
|
|
1095
1106
|
searchPlaceholder: c.searchPlaceholder,
|
|
1096
1107
|
searchKey: c.searchKey,
|
|
@@ -1105,34 +1116,34 @@ const Qe = ["id"], Ye = {
|
|
|
1105
1116
|
topParentValue: c.topParentValue,
|
|
1106
1117
|
originalData: c.list,
|
|
1107
1118
|
keyIndex: k,
|
|
1108
|
-
selectId:
|
|
1119
|
+
selectId: u.value,
|
|
1109
1120
|
disabled: c.disabled,
|
|
1110
1121
|
isOpen: b.isOpen,
|
|
1111
1122
|
serverCallback: c.serverCallback,
|
|
1112
|
-
onOnChange:
|
|
1113
|
-
onOnInitComplete:
|
|
1114
|
-
onOnError:
|
|
1123
|
+
onOnChange: C,
|
|
1124
|
+
onOnInitComplete: L,
|
|
1125
|
+
onOnError: x
|
|
1115
1126
|
}, null, 8, ["isSearch", "searchPlaceholder", "searchKey", "searchKeyType", "isMultiple", "isCheckBoxAll", "showDropDownTextFormat", "showDropDownTextFormatSub", "isCascade", "parentSelectable", "parentKey", "topParentValue", "originalData", "selectId", "disabled", "isOpen", "serverCallback"])
|
|
1116
1127
|
]),
|
|
1117
|
-
dropdownExtend:
|
|
1128
|
+
dropdownExtend: Ie(() => [
|
|
1118
1129
|
c.multiple && c.isShowTag ? (_(), O("div", {
|
|
1119
1130
|
key: 0,
|
|
1120
|
-
class:
|
|
1121
|
-
style:
|
|
1131
|
+
class: Pe(ve.value),
|
|
1132
|
+
style: Oe({ height: b.tagHeight, left: b.tagLeft }),
|
|
1122
1133
|
ref_key: "refElTags",
|
|
1123
|
-
ref:
|
|
1134
|
+
ref: ne
|
|
1124
1135
|
}, [
|
|
1125
|
-
|
|
1126
|
-
showTextFormat:
|
|
1127
|
-
selectId:
|
|
1128
|
-
onOnRemove:
|
|
1136
|
+
ye(gt, {
|
|
1137
|
+
showTextFormat: le.value,
|
|
1138
|
+
selectId: u.value,
|
|
1139
|
+
onOnRemove: g
|
|
1129
1140
|
}, null, 8, ["showTextFormat", "selectId"])
|
|
1130
|
-
], 6)) : (_(), O(
|
|
1141
|
+
], 6)) : (_(), O(ue, { key: 1 }, [], 64))
|
|
1131
1142
|
]),
|
|
1132
1143
|
_: 1
|
|
1133
1144
|
}, 8, ["id", "classParent", "classDropDown", "placeholder", "isDisabled", "isClear", "textLabel", "textArrowDirection", "transitionLeave", "appendContainer", "appendFollowWidth", "onOpenBeforeCallback"]));
|
|
1134
1145
|
}
|
|
1135
1146
|
});
|
|
1136
1147
|
export {
|
|
1137
|
-
|
|
1148
|
+
Lt as _
|
|
1138
1149
|
};
|