@dazhicheng/ui 1.6.82 → 1.6.84
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/dist/assets/svg/download.svg.js +1 -1
- package/dist/components/tt-area/TtArea.vue.js +1 -1
- package/dist/components/tt-button/index.d.ts +28 -28
- package/dist/components/tt-button/index.vue.d.ts +16 -16
- package/dist/components/tt-custom-export-modal/src/assets/search.svg.js +5 -5
- package/dist/components/tt-custom-export-modal/src/assets/star.svg.js +3 -3
- package/dist/components/tt-custom-export-modal/src/assets/trash.svg.js +7 -7
- package/dist/components/tt-custom-export-modal/src/components/FieldGridSection.vue.js +1 -1
- package/dist/components/tt-drawer/index.d.ts +109 -109
- package/dist/components/tt-drawer/src/RenderDrawer.vue.d.ts +60 -60
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +2 -2
- package/dist/components/tt-empty/index.d.ts +4 -4
- package/dist/components/tt-form/src/components/FormElInput.vue.d.ts +10 -10
- package/dist/components/tt-icon/index.vue.js +2 -2
- package/dist/components/tt-image/index.d.ts +29 -29
- package/dist/components/tt-image/src/components/ImageViewer.d.ts +20 -20
- package/dist/components/tt-image/tt-image.d.ts +29 -29
- package/dist/components/tt-input-textarea/index.vue.d.ts +40 -40
- package/dist/components/tt-loading/src/loading.vue.js +2 -2
- package/dist/components/tt-modal/index.d.ts +150 -150
- package/dist/components/tt-modal/src/RenderModal.vue.d.ts +42 -42
- package/dist/components/tt-modal/src/RenderModal.vue.js +179 -171
- package/dist/components/tt-modal/src/hooks/useModalRender.d.ts +17 -17
- package/dist/components/tt-modal/src/utils/modal-z-index.d.ts +20 -0
- package/dist/components/tt-modal/src/utils/modal-z-index.js +26 -16
- package/dist/components/tt-modal/src/utils/resolve-modal-target.js +3 -3
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.d.ts +5 -5
- package/dist/components/tt-panel-select/src/index.vue.d.ts +5 -5
- package/dist/components/tt-panel-select/src/index.vue.js +251 -237
- package/dist/components/tt-table/index.js +2 -2
- package/dist/components/tt-table/src/TableForm.vue.js +2 -2
- package/dist/components/tt-upload/index.d.ts +60 -60
- package/dist/components/tt-upload/src/TtUpload.vue.d.ts +37 -37
- package/dist/components/tt-upload/src/typing.d.ts +17 -17
- package/dist/hooks/codeToValueMissingBridge.d.ts +5 -0
- package/dist/hooks/missingOptionsCache.d.ts +5 -0
- package/dist/hooks/missingOptionsCache.js +140 -105
- package/dist/index.js +117 -101
- package/dist/packages/utils/src/business.js +6 -0
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as gl, mergeModels as se, ref as m, computed as i, useModel as yl, watch as x, useTemplateRef as B, unref as s, onMounted as wl, createElementBlock as _, openBlock as y, normalizeClass as S, createVNode as ue, mergeProps as Al, withCtx as ce, withDirectives as Cl, normalizeStyle as kl, createBlock as de, createCommentVNode as T, createElementVNode as pe, toDisplayString as xl, nextTick as G } from "vue";
|
|
2
2
|
import "../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.34_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
|
|
3
|
-
import { useDesign as
|
|
3
|
+
import { useDesign as Sl } from "../../../packages/hooks/src/useDesign.js";
|
|
4
4
|
import "axios";
|
|
5
|
-
import { ElSelect as
|
|
6
|
-
import { isString as
|
|
5
|
+
import { useZIndex as bl, ElSelect as Ol, vLoading as Ml } from "element-plus";
|
|
6
|
+
import { isString as Vl } from "../../../packages/utils/src/is.js";
|
|
7
7
|
import "dayjs";
|
|
8
8
|
import "numeral";
|
|
9
9
|
import "xe-utils";
|
|
@@ -17,20 +17,21 @@ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-
|
|
|
17
17
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
18
18
|
import "lodash-es";
|
|
19
19
|
import "vue-router";
|
|
20
|
-
import { missingOptionsEchoVersion as
|
|
21
|
-
import { useDebounceFn as
|
|
22
|
-
import { useSelectCollapseOptions as
|
|
23
|
-
import {
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import {
|
|
20
|
+
import { missingOptionsEchoVersion as El, getPanelMissingEchoOptions as Pl, expandJoinedOptionValues as Fl, diffPanelMissingCodes as $l, ensurePanelResolveMissingOptions as Nl, PANEL_MISSING_ECHO_DEFAULT_SCOPE as fe } from "../../../hooks/missingOptionsCache.js";
|
|
21
|
+
import { useDebounceFn as Ll, useResizeObserver as Rl } from "@vueuse/core";
|
|
22
|
+
import { useSelectCollapseOptions as Bl } from "../../tt-form/src/hooks/useSelectCollapse.js";
|
|
23
|
+
import { ensureElementPlusAboveOpenModals as _l } from "../../tt-modal/src/utils/modal-z-index.js";
|
|
24
|
+
import { splitPanelSelectText as D, ALL as Tl, DEFAULT_PANEL_SELECT_SEPARATORS as Gl } from "./common.js";
|
|
25
|
+
import Dl from "./components/PanelLeft.vue.js";
|
|
26
|
+
import Il from "./components/PanelMiddle.vue.js";
|
|
27
|
+
import Kl from "./components/PanelRight.vue.js";
|
|
28
|
+
import { usePanelSelectData as Wl } from "./hooks/usePanelData.js";
|
|
29
|
+
import { usePanelSelectSelection as Ul } from "./hooks/usePanelSelection.js";
|
|
29
30
|
/* empty css */
|
|
30
|
-
const
|
|
31
|
+
const v = 4, Ct = /* @__PURE__ */ gl({
|
|
31
32
|
name: "TtPanelSelect",
|
|
32
33
|
__name: "index",
|
|
33
|
-
props: /* @__PURE__ */
|
|
34
|
+
props: /* @__PURE__ */ se({
|
|
34
35
|
allowCreate: { type: Boolean, default: !1 },
|
|
35
36
|
disabled: { type: Boolean, default: !1 },
|
|
36
37
|
showNav: { type: Boolean, default: !0 },
|
|
@@ -41,7 +42,7 @@ const m = 4, ht = /* @__PURE__ */ fl({
|
|
|
41
42
|
resultField: { default: "" },
|
|
42
43
|
options: { default: () => [] },
|
|
43
44
|
resolveMissingOptions: { type: Function, default: void 0 },
|
|
44
|
-
missingEchoKey: { default:
|
|
45
|
+
missingEchoKey: { default: fe },
|
|
45
46
|
treeConfig: { default: () => ({
|
|
46
47
|
transform: !1,
|
|
47
48
|
labelField: "label",
|
|
@@ -54,11 +55,11 @@ const m = 4, ht = /* @__PURE__ */ fl({
|
|
|
54
55
|
immediate: { type: Boolean, default: !0 },
|
|
55
56
|
beforeFetch: { type: Function, default: void 0 },
|
|
56
57
|
afterFetch: { type: Function, default: void 0 },
|
|
57
|
-
separator: { default: () => [...
|
|
58
|
+
separator: { default: () => [...Gl] },
|
|
58
59
|
pasteSearch: { type: Boolean, default: !0 },
|
|
59
60
|
alwaysLoad: { type: Boolean, default: !1 },
|
|
60
61
|
showAll: { type: Boolean, default: !0 },
|
|
61
|
-
showAllField: { default:
|
|
62
|
+
showAllField: { default: Tl },
|
|
62
63
|
showPinyinMode: { type: Boolean, default: !1 },
|
|
63
64
|
showOriginMode: { type: Boolean, default: !0 },
|
|
64
65
|
leftPlaceholder: { default: "支持模糊搜索" },
|
|
@@ -68,10 +69,13 @@ const m = 4, ht = /* @__PURE__ */ fl({
|
|
|
68
69
|
modelValue: {},
|
|
69
70
|
modelModifiers: {}
|
|
70
71
|
}),
|
|
71
|
-
emits: /* @__PURE__ */
|
|
72
|
-
setup(c, { expose:
|
|
73
|
-
const
|
|
74
|
-
function
|
|
72
|
+
emits: /* @__PURE__ */ se(["visible-change", "change", "focus"], ["update:modelValue"]),
|
|
73
|
+
setup(c, { expose: he, emit: me }) {
|
|
74
|
+
const ve = Ml, ge = Ol, t = c, b = me, { prefixCls: d } = Sl("panel-select"), I = bl(), O = m();
|
|
75
|
+
function M() {
|
|
76
|
+
_l(I), O.value = I.nextZIndex();
|
|
77
|
+
}
|
|
78
|
+
function ye(e = []) {
|
|
75
79
|
const l = /* @__PURE__ */ new Set(), a = (o) => {
|
|
76
80
|
o.forEach((n) => {
|
|
77
81
|
var u;
|
|
@@ -84,110 +88,110 @@ const m = 4, ht = /* @__PURE__ */ fl({
|
|
|
84
88
|
};
|
|
85
89
|
return a(e), l;
|
|
86
90
|
}
|
|
87
|
-
function
|
|
91
|
+
function we(e) {
|
|
88
92
|
return Array.isArray(e) ? e : e == null || e === "" ? [] : [e];
|
|
89
93
|
}
|
|
90
|
-
function
|
|
91
|
-
return t.missingEchoKey ||
|
|
94
|
+
function K() {
|
|
95
|
+
return t.missingEchoKey || fe;
|
|
92
96
|
}
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
const e = t.options || [], l =
|
|
97
|
+
const Ae = i(() => {
|
|
98
|
+
El.value;
|
|
99
|
+
const e = t.options || [], l = Pl(K());
|
|
96
100
|
if (!l.length) return e;
|
|
97
|
-
const a =
|
|
101
|
+
const a = ye(e), o = l.filter(
|
|
98
102
|
(n) => n.value !== void 0 && n.value !== null && !a.has(n.value)
|
|
99
103
|
);
|
|
100
104
|
return o.length ? [...e, ...o] : e;
|
|
101
|
-
}),
|
|
105
|
+
}), Ce = new Proxy(t, {
|
|
102
106
|
get(e, l, a) {
|
|
103
|
-
return l === "options" ?
|
|
107
|
+
return l === "options" ? Ae.value : Reflect.get(e, l, a);
|
|
104
108
|
}
|
|
105
109
|
}), {
|
|
106
|
-
loading:
|
|
107
|
-
fetchApi:
|
|
108
|
-
treeOptions:
|
|
109
|
-
navTreeOptions:
|
|
110
|
-
navNodes:
|
|
110
|
+
loading: W,
|
|
111
|
+
fetchApi: g,
|
|
112
|
+
treeOptions: ke,
|
|
113
|
+
navTreeOptions: U,
|
|
114
|
+
navNodes: xe,
|
|
111
115
|
leafNodes: f,
|
|
112
|
-
isFirstLoaded:
|
|
113
|
-
filterNodes:
|
|
114
|
-
buildOptionGroups:
|
|
115
|
-
} =
|
|
116
|
-
let
|
|
117
|
-
const
|
|
116
|
+
isFirstLoaded: Z,
|
|
117
|
+
filterNodes: Se,
|
|
118
|
+
buildOptionGroups: z
|
|
119
|
+
} = Wl(Ce), r = yl(c, "modelValue");
|
|
120
|
+
let j;
|
|
121
|
+
const H = i(() => t.disabled), be = i(() => {
|
|
118
122
|
if (!t.multiple)
|
|
119
123
|
return t.allowCreate ? `${t.placeholder ? t.placeholder : "请选择"}(可创建)` : t.placeholder;
|
|
120
124
|
const e = t.showMultiple ? "支持多选和全选" : "支持多选", l = typeof t.placeholder == "string" && t.placeholder.trim() ? t.placeholder.trim().replace(/[,,]\s*$/, "") : "请选择", a = l.includes("支持多选和全选") || l.includes("支持多选") ? l : `${l},${e}`;
|
|
121
125
|
return t.allowCreate ? `${a}(可创建)` : a;
|
|
122
|
-
}),
|
|
126
|
+
}), Oe = i(() => {
|
|
123
127
|
const e = /* @__PURE__ */ new Map();
|
|
124
128
|
return f.value.forEach((l) => e.set(l.value, l.label)), e;
|
|
125
|
-
}),
|
|
129
|
+
}), J = i(() => {
|
|
126
130
|
const e = /* @__PURE__ */ new Map();
|
|
127
131
|
return f.value.forEach((l) => {
|
|
128
132
|
var a;
|
|
129
133
|
(l.deleted === !0 || ((a = l.raw) == null ? void 0 : a.deleted) === !0) && e.set(l.value, !0);
|
|
130
134
|
}), e;
|
|
131
135
|
});
|
|
132
|
-
function
|
|
136
|
+
function V(e) {
|
|
133
137
|
return e === t.showAllField ? { label: "全部", value: t.showAllField } : {
|
|
134
|
-
label:
|
|
138
|
+
label: Oe.value.get(e) ?? String(e),
|
|
135
139
|
value: e,
|
|
136
|
-
deleted:
|
|
140
|
+
deleted: J.value.get(e) === !0
|
|
137
141
|
};
|
|
138
142
|
}
|
|
139
|
-
function
|
|
140
|
-
return e == null ? !1 :
|
|
143
|
+
function Me(e) {
|
|
144
|
+
return e == null ? !1 : J.value.get(e) === !0;
|
|
141
145
|
}
|
|
142
|
-
const
|
|
146
|
+
const Ve = Ll(async () => {
|
|
143
147
|
const e = t.resolveMissingOptions;
|
|
144
148
|
if (!e) return;
|
|
145
|
-
const l =
|
|
146
|
-
|
|
149
|
+
const l = Fl(
|
|
150
|
+
we(r.value).filter((n) => n !== t.showAllField)
|
|
147
151
|
);
|
|
148
152
|
if (!l.length) return;
|
|
149
|
-
const a =
|
|
150
|
-
|
|
153
|
+
const a = K();
|
|
154
|
+
$l(a, l, t.options || []).length && await Nl(a, l, t.options || [], (n) => e(n));
|
|
151
155
|
}, 64);
|
|
152
|
-
|
|
156
|
+
x(
|
|
153
157
|
[r, () => t.options, () => t.showAllField, () => t.missingEchoKey],
|
|
154
158
|
() => {
|
|
155
|
-
t.resolveMissingOptions &&
|
|
159
|
+
t.resolveMissingOptions && Ve();
|
|
156
160
|
},
|
|
157
161
|
{ immediate: !0, deep: !0 }
|
|
158
162
|
);
|
|
159
|
-
function
|
|
163
|
+
function q(e) {
|
|
160
164
|
if (e != null)
|
|
161
165
|
return typeof e == "object" && "value" in e ? e.value : e;
|
|
162
166
|
}
|
|
163
|
-
const
|
|
167
|
+
const Q = i({
|
|
164
168
|
get() {
|
|
165
169
|
return Array.isArray(r.value) ? t.multiple ? r.value : r.value.slice(-1) : r.value === void 0 ? [] : [r.value];
|
|
166
170
|
},
|
|
167
171
|
set(e) {
|
|
168
172
|
r.value = t.multiple ? [...e] : e.at(-1);
|
|
169
173
|
}
|
|
170
|
-
}),
|
|
174
|
+
}), E = i(() => {
|
|
171
175
|
if (!t.allowCreate) return [];
|
|
172
176
|
const e = new Set(f.value.map((a) => a.value)), l = [];
|
|
173
|
-
return new Set(
|
|
174
|
-
!
|
|
177
|
+
return new Set(Q.value).forEach((a) => {
|
|
178
|
+
!Vl(a) || a === t.showAllField || e.has(a) || l.push({ label: a, value: a, level: 0, path: [], raw: { label: a, value: a } });
|
|
175
179
|
}), l;
|
|
176
|
-
}),
|
|
177
|
-
|
|
180
|
+
}), P = i(() => [...f.value, ...E.value]);
|
|
181
|
+
x([() => t.multiple, () => r.value], ([e, l]) => {
|
|
178
182
|
if (e) {
|
|
179
183
|
Array.isArray(l) || (r.value = l === void 0 ? [] : [l]);
|
|
180
184
|
return;
|
|
181
185
|
}
|
|
182
186
|
Array.isArray(l) && (r.value = l.at(-1));
|
|
183
187
|
});
|
|
184
|
-
const
|
|
185
|
-
function
|
|
188
|
+
const F = m(), w = m(""), p = m(""), $ = m(), N = B("middleRef"), A = B("selectWrapRef"), X = B("selectRef"), L = m(0);
|
|
189
|
+
function Y() {
|
|
186
190
|
const e = A.value;
|
|
187
|
-
e && (
|
|
191
|
+
e && (L.value = e.offsetWidth);
|
|
188
192
|
}
|
|
189
|
-
|
|
190
|
-
const
|
|
193
|
+
Rl(A, () => Y());
|
|
194
|
+
const Ee = i(() => ({
|
|
191
195
|
componentProps: {
|
|
192
196
|
multiple: t.multiple,
|
|
193
197
|
component: {
|
|
@@ -196,135 +200,144 @@ const m = 4, ht = /* @__PURE__ */ fl({
|
|
|
196
200
|
},
|
|
197
201
|
component: "TtPanelSelect",
|
|
198
202
|
selectWrapRef: A,
|
|
199
|
-
selectRef:
|
|
200
|
-
})), { selectComponentProps:
|
|
201
|
-
const e =
|
|
202
|
-
|
|
203
|
+
selectRef: X
|
|
204
|
+
})), { selectComponentProps: Pe } = Bl(Ee), Fe = i(() => {
|
|
205
|
+
const e = Pe.value || {}, l = e.popperStyle && typeof e.popperStyle == "object" && !Array.isArray(e.popperStyle) ? e.popperStyle : {};
|
|
206
|
+
return {
|
|
207
|
+
...e,
|
|
208
|
+
popperStyle: {
|
|
209
|
+
...l,
|
|
210
|
+
...O.value != null ? { zIndex: O.value } : {}
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
}), ee = i(() => {
|
|
214
|
+
const e = w.value.trim().toLowerCase();
|
|
215
|
+
if (!e) return U.value;
|
|
203
216
|
const l = (a) => {
|
|
204
217
|
const o = [];
|
|
205
218
|
return a.forEach((n) => {
|
|
206
|
-
var
|
|
207
|
-
const u = (
|
|
219
|
+
var ie;
|
|
220
|
+
const u = (ie = n.children) != null && ie.length ? l(n.children) : void 0;
|
|
208
221
|
(String(n.label).toLowerCase().includes(e) || u && u.length) && o.push({ ...n, children: u != null && u.length ? u : void 0 });
|
|
209
222
|
}), o;
|
|
210
223
|
};
|
|
211
|
-
return l(
|
|
212
|
-
}),
|
|
224
|
+
return l(U.value);
|
|
225
|
+
}), $e = i(() => {
|
|
213
226
|
const e = [], l = (a) => {
|
|
214
227
|
a.forEach((o) => {
|
|
215
228
|
var n;
|
|
216
229
|
e.push(o.value), (n = o.children) != null && n.length && l(o.children);
|
|
217
230
|
});
|
|
218
231
|
};
|
|
219
|
-
return l(
|
|
232
|
+
return l(ee.value), e;
|
|
220
233
|
}), C = i(
|
|
221
|
-
() =>
|
|
234
|
+
() => Le(p.value).map((e) => ({
|
|
222
235
|
label: e,
|
|
223
236
|
value: e,
|
|
224
237
|
level: 0,
|
|
225
238
|
path: [],
|
|
226
239
|
raw: { label: e, value: e }
|
|
227
240
|
}))
|
|
228
|
-
),
|
|
229
|
-
const e =
|
|
241
|
+
), Ne = i(() => [...P.value, ...C.value]), k = i(() => {
|
|
242
|
+
const e = z(f.value, p.value), l = Se([...E.value, ...C.value], p.value);
|
|
230
243
|
if (!l.length) return e;
|
|
231
244
|
const a = new Map(l.map((u) => [u.value, u])), o = [];
|
|
232
|
-
|
|
233
|
-
const
|
|
234
|
-
|
|
245
|
+
D(p.value, t.separator).forEach((u) => {
|
|
246
|
+
const R = a.get(u);
|
|
247
|
+
R && (o.push(R), a.delete(u));
|
|
235
248
|
}), o.push(...a.values());
|
|
236
249
|
let n = "__created__";
|
|
237
250
|
for (; e.some((u) => u.value === n); ) n += "_";
|
|
238
251
|
return [{ value: n, label: "自定义", options: o }, ...e];
|
|
239
252
|
});
|
|
240
|
-
function
|
|
241
|
-
if (!t.allowCreate || t.disabled ||
|
|
242
|
-
const l =
|
|
243
|
-
if (!l.length ||
|
|
244
|
-
const a = new Set(
|
|
253
|
+
function Le(e) {
|
|
254
|
+
if (!t.allowCreate || t.disabled || W.value || t.api && !Z.value) return [];
|
|
255
|
+
const l = D(e, t.separator);
|
|
256
|
+
if (!l.length || z(f.value, e).length) return [];
|
|
257
|
+
const a = new Set(P.value.map((o) => `${o.value}`));
|
|
245
258
|
return [...new Set(l)].filter((o) => o !== `${t.showAllField}` && !a.has(o));
|
|
246
259
|
}
|
|
247
|
-
function
|
|
260
|
+
function Re() {
|
|
248
261
|
if (!C.value.length) return;
|
|
249
262
|
const e = new Set(
|
|
250
|
-
[...
|
|
251
|
-
), l = [...new Set(
|
|
263
|
+
[...E.value, ...C.value].map((a) => a.value)
|
|
264
|
+
), l = [...new Set(D(p.value, t.separator))].filter(
|
|
252
265
|
(a) => e.has(a)
|
|
253
266
|
);
|
|
254
|
-
|
|
267
|
+
re(l, !0);
|
|
255
268
|
}
|
|
256
|
-
const
|
|
269
|
+
const Be = i(() => {
|
|
257
270
|
const e = "minmax(var(--tt-panel-select-middle-width, 450px), 1fr)";
|
|
258
271
|
return t.showNav && !t.multiple ? `200px ${e}` : !t.showNav && t.multiple ? `${e} 180px` : !t.showNav && !t.multiple ? e : `200px ${e} 180px`;
|
|
259
|
-
}),
|
|
272
|
+
}), _e = i(() => {
|
|
260
273
|
const e = "var(--tt-panel-select-middle-width, 450px)";
|
|
261
274
|
return t.showNav && !t.multiple ? `max(calc(200px + ${e}), 800px)` : !t.showNav && t.multiple ? `max(calc(${e} + 180px), 800px)` : !t.showNav && !t.multiple ? `max(${e}, 800px)` : `max(calc(200px + ${e} + 180px), 800px)`;
|
|
262
|
-
}),
|
|
275
|
+
}), Te = i(() => {
|
|
263
276
|
const e = [];
|
|
264
277
|
return k.value.forEach((l) => {
|
|
265
278
|
!(t.showOriginMode && l.value === "__origin__") && e.push({ key: `group-${String(l.value)}`, type: "group", group: l });
|
|
266
|
-
const o = Math.ceil(l.options.length /
|
|
267
|
-
for (let n = 0; n < l.options.length; n +=
|
|
268
|
-
const u = n /
|
|
279
|
+
const o = Math.ceil(l.options.length / v);
|
|
280
|
+
for (let n = 0; n < l.options.length; n += v) {
|
|
281
|
+
const u = n / v;
|
|
269
282
|
e.push({
|
|
270
|
-
key: `options-${String(l.value)}-${n /
|
|
283
|
+
key: `options-${String(l.value)}-${n / v}`,
|
|
271
284
|
type: "options",
|
|
272
285
|
group: l,
|
|
273
|
-
options: l.options.slice(n, n +
|
|
286
|
+
options: l.options.slice(n, n + v),
|
|
274
287
|
isLast: u === o - 1
|
|
275
288
|
});
|
|
276
289
|
}
|
|
277
290
|
}), e;
|
|
278
291
|
}), {
|
|
279
|
-
selectedOptions:
|
|
280
|
-
selectedValueSet:
|
|
281
|
-
isAllChecked:
|
|
282
|
-
isIndeterminate:
|
|
283
|
-
getGroupCheckCount:
|
|
284
|
-
handleGroupCheck:
|
|
285
|
-
handleAllOptionCheck:
|
|
286
|
-
handleOptionCheck:
|
|
287
|
-
handleOptionsCheck:
|
|
288
|
-
handleCheckAll:
|
|
289
|
-
clearSelected:
|
|
290
|
-
removeSelected:
|
|
291
|
-
withLockedSelectedValues:
|
|
292
|
-
} =
|
|
292
|
+
selectedOptions: Ge,
|
|
293
|
+
selectedValueSet: le,
|
|
294
|
+
isAllChecked: De,
|
|
295
|
+
isIndeterminate: Ie,
|
|
296
|
+
getGroupCheckCount: Ke,
|
|
297
|
+
handleGroupCheck: We,
|
|
298
|
+
handleAllOptionCheck: Ue,
|
|
299
|
+
handleOptionCheck: Ze,
|
|
300
|
+
handleOptionsCheck: ze,
|
|
301
|
+
handleCheckAll: je,
|
|
302
|
+
clearSelected: He,
|
|
303
|
+
removeSelected: Je,
|
|
304
|
+
withLockedSelectedValues: qe
|
|
305
|
+
} = Ul({
|
|
293
306
|
multiple: i(() => t.multiple),
|
|
294
307
|
modelValue: r,
|
|
295
|
-
selectedValues:
|
|
296
|
-
leafNodes:
|
|
308
|
+
selectedValues: Q,
|
|
309
|
+
leafNodes: Ne,
|
|
297
310
|
allValue: i(() => t.showAllField)
|
|
298
|
-
}),
|
|
311
|
+
}), te = i({
|
|
299
312
|
get() {
|
|
300
313
|
if (t.multiple)
|
|
301
|
-
return (Array.isArray(r.value) ? r.value : r.value === void 0 ? [] : [r.value]).map((l) =>
|
|
314
|
+
return (Array.isArray(r.value) ? r.value : r.value === void 0 ? [] : [r.value]).map((l) => V(l));
|
|
302
315
|
if (Array.isArray(r.value)) {
|
|
303
316
|
const e = r.value.at(-1);
|
|
304
|
-
return e === void 0 ? void 0 :
|
|
317
|
+
return e === void 0 ? void 0 : V(e);
|
|
305
318
|
}
|
|
306
|
-
return r.value === void 0 ? void 0 :
|
|
319
|
+
return r.value === void 0 ? void 0 : V(r.value);
|
|
307
320
|
},
|
|
308
321
|
set(e) {
|
|
309
322
|
const l = s(r);
|
|
310
|
-
if (
|
|
311
|
-
const o = (Array.isArray(e) ? e : []).map((n) =>
|
|
312
|
-
r.value =
|
|
323
|
+
if (j = Array.isArray(l) ? [...l] : l, t.multiple) {
|
|
324
|
+
const o = (Array.isArray(e) ? e : []).map((n) => q(n)).filter((n) => n !== void 0);
|
|
325
|
+
r.value = qe(o);
|
|
313
326
|
return;
|
|
314
327
|
}
|
|
315
|
-
r.value =
|
|
328
|
+
r.value = q(e);
|
|
316
329
|
}
|
|
317
|
-
}),
|
|
330
|
+
}), ae = i(
|
|
318
331
|
() => {
|
|
319
332
|
const e = {}, l = {};
|
|
320
333
|
return k.value.forEach((a) => {
|
|
321
|
-
const { enabledCount: o, checkedCount: n } =
|
|
334
|
+
const { enabledCount: o, checkedCount: n } = Ke(a), u = String(a.value);
|
|
322
335
|
e[u] = o > 0 && n === o, l[u] = o > 0 && n > 0 && n < o;
|
|
323
336
|
}), { checkedMap: e, indeterminateMap: l };
|
|
324
337
|
}
|
|
325
|
-
),
|
|
326
|
-
function
|
|
327
|
-
const l = s(
|
|
338
|
+
), Qe = i(() => ae.value.checkedMap), Xe = i(() => ae.value.indeterminateMap), Ye = i(() => le.value.has(t.showAllField)), oe = i(() => [...t.showAll ? [{ label: "全部", value: t.showAllField }] : [], ...P.value.map((l) => ({ ...l }))]);
|
|
339
|
+
function el(e) {
|
|
340
|
+
const l = s(oe);
|
|
328
341
|
if (Array.isArray(e)) {
|
|
329
342
|
const a = new Set(e);
|
|
330
343
|
return l.filter((o) => o.value !== void 0 && a.has(o.value));
|
|
@@ -332,215 +345,216 @@ const m = 4, ht = /* @__PURE__ */ fl({
|
|
|
332
345
|
if (e !== void 0)
|
|
333
346
|
return l.find((a) => a.value === e);
|
|
334
347
|
}
|
|
335
|
-
function
|
|
348
|
+
function ll(e) {
|
|
336
349
|
var a;
|
|
337
350
|
if (t.showPinyinMode || k.value.some((o) => o.value === e.value)) return e.value;
|
|
338
351
|
const l = f.value.find((o) => o.path.some((n) => n.value === e.value));
|
|
339
352
|
return (a = l == null ? void 0 : l.path.at(-2)) == null ? void 0 : a.value;
|
|
340
353
|
}
|
|
341
|
-
function
|
|
342
|
-
|
|
343
|
-
const l =
|
|
344
|
-
|
|
354
|
+
function tl(e) {
|
|
355
|
+
F.value = e.value;
|
|
356
|
+
const l = ll(e);
|
|
357
|
+
$.value = void 0, G(() => {
|
|
345
358
|
var a;
|
|
346
|
-
|
|
359
|
+
$.value = l, l !== void 0 && ((a = N.value) == null || a.scrollToGroup(l));
|
|
347
360
|
});
|
|
348
361
|
}
|
|
349
|
-
function
|
|
350
|
-
|
|
362
|
+
function al(e) {
|
|
363
|
+
w.value = e;
|
|
351
364
|
}
|
|
352
|
-
function
|
|
365
|
+
function ol(e) {
|
|
353
366
|
p.value = e;
|
|
354
367
|
}
|
|
355
|
-
function
|
|
368
|
+
function nl(e, l) {
|
|
356
369
|
const a = k.value.find((o) => o.value === e);
|
|
357
|
-
a &&
|
|
370
|
+
a && We(a, l);
|
|
358
371
|
}
|
|
359
|
-
async function
|
|
372
|
+
async function rl(e) {
|
|
360
373
|
var l;
|
|
361
|
-
|
|
374
|
+
b("visible-change", e), e && (M(), p.value = "", w.value = "", await G(), (l = N.value) == null || l.inputFocus(), Y(), t.alwaysLoad ? await g() : !t.immediate && !s(Z) && await g());
|
|
362
375
|
}
|
|
363
|
-
function
|
|
364
|
-
|
|
376
|
+
function il() {
|
|
377
|
+
ne(j);
|
|
365
378
|
}
|
|
366
|
-
function
|
|
367
|
-
|
|
379
|
+
function sl(e) {
|
|
380
|
+
b("change", e, [...s(oe)], el(e));
|
|
368
381
|
}
|
|
369
|
-
function
|
|
382
|
+
function ul(e, l) {
|
|
370
383
|
return Array.isArray(e) && Array.isArray(l) ? e.length === l.length && e.every((a, o) => a === l[o]) : e === l;
|
|
371
384
|
}
|
|
372
|
-
function
|
|
373
|
-
|
|
385
|
+
function ne(e) {
|
|
386
|
+
G(() => {
|
|
374
387
|
const l = s(r);
|
|
375
|
-
|
|
388
|
+
ul(l, e) || sl(l);
|
|
376
389
|
});
|
|
377
390
|
}
|
|
378
391
|
function h(e) {
|
|
379
392
|
const l = s(r), a = Array.isArray(l) ? [...l] : l;
|
|
380
|
-
e(),
|
|
393
|
+
e(), ne(a);
|
|
381
394
|
}
|
|
382
|
-
function
|
|
395
|
+
function cl(e) {
|
|
383
396
|
h(() => {
|
|
384
|
-
|
|
397
|
+
Ue(e);
|
|
385
398
|
});
|
|
386
399
|
}
|
|
387
|
-
function
|
|
400
|
+
function dl(e) {
|
|
388
401
|
h(() => {
|
|
389
|
-
|
|
402
|
+
je(e);
|
|
390
403
|
});
|
|
391
404
|
}
|
|
392
|
-
function
|
|
405
|
+
function pl(e, l) {
|
|
393
406
|
h(() => {
|
|
394
|
-
|
|
407
|
+
nl(e, l);
|
|
395
408
|
});
|
|
396
409
|
}
|
|
397
|
-
function
|
|
410
|
+
function fl(e, l) {
|
|
398
411
|
h(() => {
|
|
399
|
-
|
|
412
|
+
Ze(e, l);
|
|
400
413
|
});
|
|
401
414
|
}
|
|
402
|
-
function
|
|
415
|
+
function re(e, l) {
|
|
403
416
|
h(() => {
|
|
404
|
-
|
|
417
|
+
ze(e, l);
|
|
405
418
|
});
|
|
406
419
|
}
|
|
407
|
-
function
|
|
420
|
+
function hl(e) {
|
|
408
421
|
h(() => {
|
|
409
|
-
|
|
422
|
+
Je(e);
|
|
410
423
|
});
|
|
411
424
|
}
|
|
412
|
-
function
|
|
425
|
+
function ml() {
|
|
413
426
|
h(() => {
|
|
414
|
-
|
|
427
|
+
He();
|
|
415
428
|
});
|
|
416
429
|
}
|
|
417
|
-
function
|
|
418
|
-
|
|
430
|
+
function vl(e) {
|
|
431
|
+
M(), b("focus", e);
|
|
419
432
|
}
|
|
420
|
-
return
|
|
433
|
+
return x(
|
|
421
434
|
() => t.params,
|
|
422
435
|
() => {
|
|
423
|
-
|
|
436
|
+
g();
|
|
424
437
|
},
|
|
425
438
|
{ deep: !0 }
|
|
426
|
-
),
|
|
427
|
-
|
|
439
|
+
), x(
|
|
440
|
+
xe,
|
|
428
441
|
(e) => {
|
|
429
442
|
var l;
|
|
430
|
-
|
|
443
|
+
F.value !== void 0 || !e.length || (F.value = (l = e[0]) == null ? void 0 : l.value);
|
|
431
444
|
},
|
|
432
445
|
{ immediate: !0 }
|
|
433
|
-
),
|
|
434
|
-
t.immediate &&
|
|
435
|
-
}),
|
|
446
|
+
), wl(() => {
|
|
447
|
+
t.immediate && g();
|
|
448
|
+
}), he({
|
|
436
449
|
/** 重新加载数据源*/
|
|
437
|
-
reload:
|
|
450
|
+
reload: g,
|
|
438
451
|
/** 获取当前归一化后的树形选项数据 */
|
|
439
|
-
getOptions: () => s(
|
|
452
|
+
getOptions: () => s(ke),
|
|
440
453
|
/** 获取当前v-model值 */
|
|
441
454
|
getValue: () => s(r)
|
|
442
|
-
}), (e, l) => (
|
|
455
|
+
}), (e, l) => (y(), _("div", {
|
|
443
456
|
ref_key: "selectWrapRef",
|
|
444
457
|
ref: A,
|
|
445
|
-
class:
|
|
458
|
+
class: S(s(d)),
|
|
459
|
+
onPointerdownCapture: M
|
|
446
460
|
}, [
|
|
447
|
-
|
|
461
|
+
ue(s(ge), Al({
|
|
448
462
|
ref_key: "selectRef",
|
|
449
|
-
ref:
|
|
450
|
-
modelValue:
|
|
451
|
-
"onUpdate:modelValue": l[0] || (l[0] = (a) =>
|
|
452
|
-
},
|
|
463
|
+
ref: X,
|
|
464
|
+
modelValue: te.value,
|
|
465
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => te.value = a)
|
|
466
|
+
}, Fe.value, {
|
|
453
467
|
multiple: c.multiple,
|
|
454
468
|
filterable: !1,
|
|
455
|
-
placeholder:
|
|
469
|
+
placeholder: be.value,
|
|
456
470
|
persistent: !1,
|
|
457
471
|
"fallback-placements": ["bottom-start", "bottom-end", "bottom", "top-start", "top-end", "top", "right", "left"],
|
|
458
472
|
disabled: c.disabled,
|
|
459
473
|
"popper-class": `${s(d)}__popper vxe-table--ignore-clear`,
|
|
460
|
-
onVisibleChange:
|
|
461
|
-
onChange:
|
|
462
|
-
onFocus:
|
|
474
|
+
onVisibleChange: rl,
|
|
475
|
+
onChange: il,
|
|
476
|
+
onFocus: vl
|
|
463
477
|
}), {
|
|
464
|
-
label:
|
|
465
|
-
|
|
466
|
-
class:
|
|
478
|
+
label: ce(({ label: a, value: o }) => [
|
|
479
|
+
pe("span", {
|
|
480
|
+
class: S(`${s(d)}__trigger-label`)
|
|
467
481
|
}, [
|
|
468
|
-
|
|
469
|
-
|
|
482
|
+
pe("span", null, xl(a), 1),
|
|
483
|
+
Me(o) ? (y(), _("span", {
|
|
470
484
|
key: 0,
|
|
471
|
-
class:
|
|
472
|
-
}, "删", 2)) :
|
|
485
|
+
class: S(`${s(d)}__deleted-mark`)
|
|
486
|
+
}, "删", 2)) : T("", !0)
|
|
473
487
|
], 2)
|
|
474
488
|
]),
|
|
475
|
-
empty:
|
|
476
|
-
|
|
489
|
+
empty: ce(() => [
|
|
490
|
+
Cl((y(), _("div", {
|
|
477
491
|
"element-loading-text": "加载中",
|
|
478
|
-
class:
|
|
479
|
-
style:
|
|
480
|
-
"--columns":
|
|
481
|
-
"--panel-min-width":
|
|
482
|
-
"--panel-width":
|
|
492
|
+
class: S(`${s(d)}__panel`),
|
|
493
|
+
style: kl({
|
|
494
|
+
"--columns": Be.value,
|
|
495
|
+
"--panel-min-width": _e.value,
|
|
496
|
+
"--panel-width": L.value ? `${L.value}px` : "100%"
|
|
483
497
|
})
|
|
484
498
|
}, [
|
|
485
|
-
t.showNav ? (
|
|
499
|
+
t.showNav ? (y(), de(Dl, {
|
|
486
500
|
key: 0,
|
|
487
501
|
"prefix-cls": s(d),
|
|
488
|
-
keyword:
|
|
489
|
-
"tree-data":
|
|
490
|
-
"expanded-keys":
|
|
502
|
+
keyword: w.value,
|
|
503
|
+
"tree-data": ee.value,
|
|
504
|
+
"expanded-keys": $e.value,
|
|
491
505
|
"left-placeholder": c.leftPlaceholder,
|
|
492
|
-
"onUpdate:keyword":
|
|
493
|
-
onSelect:
|
|
494
|
-
}, null, 8, ["prefix-cls", "keyword", "tree-data", "expanded-keys", "left-placeholder"])) :
|
|
495
|
-
|
|
506
|
+
"onUpdate:keyword": al,
|
|
507
|
+
onSelect: tl
|
|
508
|
+
}, null, 8, ["prefix-cls", "keyword", "tree-data", "expanded-keys", "left-placeholder"])) : T("", !0),
|
|
509
|
+
ue(Il, {
|
|
496
510
|
ref_key: "middleRef",
|
|
497
|
-
ref:
|
|
511
|
+
ref: N,
|
|
498
512
|
"allow-create": t.allowCreate,
|
|
499
513
|
"prefix-cls": s(d),
|
|
500
514
|
multiple: c.multiple,
|
|
501
515
|
keyword: p.value,
|
|
502
|
-
rows:
|
|
503
|
-
disabled:
|
|
516
|
+
rows: Te.value,
|
|
517
|
+
disabled: H.value,
|
|
504
518
|
"show-all": t.showAll,
|
|
505
|
-
"option-per-row":
|
|
519
|
+
"option-per-row": v,
|
|
506
520
|
"row-height": 40,
|
|
507
|
-
"selected-value-set": s(
|
|
508
|
-
"is-all-checked": s(
|
|
509
|
-
"is-indeterminate": s(
|
|
510
|
-
"all-checked":
|
|
511
|
-
"scroll-to-group-value":
|
|
512
|
-
"group-checked-map":
|
|
513
|
-
"group-indeterminate-map":
|
|
521
|
+
"selected-value-set": s(le),
|
|
522
|
+
"is-all-checked": s(De),
|
|
523
|
+
"is-indeterminate": s(Ie),
|
|
524
|
+
"all-checked": Ye.value,
|
|
525
|
+
"scroll-to-group-value": $.value,
|
|
526
|
+
"group-checked-map": Qe.value,
|
|
527
|
+
"group-indeterminate-map": Xe.value,
|
|
514
528
|
"paste-search": c.pasteSearch,
|
|
515
529
|
separator: c.separator,
|
|
516
530
|
"middle-placeholder": c.middlePlaceholder,
|
|
517
531
|
"show-multiple": c.showMultiple,
|
|
518
|
-
"onUpdate:keyword":
|
|
519
|
-
onAllCheck:
|
|
520
|
-
onCheckAll:
|
|
521
|
-
onGroupCheck:
|
|
522
|
-
onOptionCheck:
|
|
523
|
-
onOptionsCheck:
|
|
524
|
-
onSelectCreatedOptions:
|
|
532
|
+
"onUpdate:keyword": ol,
|
|
533
|
+
onAllCheck: cl,
|
|
534
|
+
onCheckAll: dl,
|
|
535
|
+
onGroupCheck: pl,
|
|
536
|
+
onOptionCheck: fl,
|
|
537
|
+
onOptionsCheck: re,
|
|
538
|
+
onSelectCreatedOptions: Re
|
|
525
539
|
}, null, 8, ["allow-create", "prefix-cls", "multiple", "keyword", "rows", "disabled", "show-all", "selected-value-set", "is-all-checked", "is-indeterminate", "all-checked", "scroll-to-group-value", "group-checked-map", "group-indeterminate-map", "paste-search", "separator", "middle-placeholder", "show-multiple"]),
|
|
526
|
-
t.multiple ? (
|
|
540
|
+
t.multiple ? (y(), de(Kl, {
|
|
527
541
|
key: 1,
|
|
528
542
|
"prefix-cls": s(d),
|
|
529
543
|
multiple: c.multiple,
|
|
530
|
-
disabled:
|
|
531
|
-
"selected-options": s(
|
|
532
|
-
onClearAll:
|
|
533
|
-
onRemove:
|
|
534
|
-
}, null, 8, ["prefix-cls", "multiple", "disabled", "selected-options"])) :
|
|
544
|
+
disabled: H.value,
|
|
545
|
+
"selected-options": s(Ge),
|
|
546
|
+
onClearAll: ml,
|
|
547
|
+
onRemove: hl
|
|
548
|
+
}, null, 8, ["prefix-cls", "multiple", "disabled", "selected-options"])) : T("", !0)
|
|
535
549
|
], 6)), [
|
|
536
|
-
[s(
|
|
550
|
+
[s(ve), s(W)]
|
|
537
551
|
])
|
|
538
552
|
]),
|
|
539
553
|
_: 1
|
|
540
554
|
}, 16, ["modelValue", "multiple", "placeholder", "disabled", "popper-class"])
|
|
541
|
-
],
|
|
555
|
+
], 34));
|
|
542
556
|
}
|
|
543
557
|
});
|
|
544
558
|
export {
|
|
545
|
-
|
|
559
|
+
Ct as default
|
|
546
560
|
};
|