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