@dazhicheng/ui 1.6.37 → 1.6.39
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-drawer/src/components/DrawerHeader.vue.js +2 -2
- package/dist/components/tt-icon/index.vue.js +2 -2
- package/dist/components/tt-loading/src/loading.vue.js +2 -2
- package/dist/components/tt-modal/src/RenderModal.vue.js +258 -231
- package/dist/components/tt-modal/src/utils/modal-z-index.d.ts +7 -0
- package/dist/components/tt-modal/src/utils/modal-z-index.js +16 -14
- package/dist/components/tt-modal/src/utils/resolve-modal-target.d.ts +13 -0
- package/dist/components/tt-modal/src/utils/resolve-modal-target.js +106 -73
- package/dist/components/tt-panel-select/src/index.vue.js +61 -64
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as ze, mergeModels as I, useModel as je, computed as s, watch as V, ref as h, useTemplateRef as O, unref as i, onMounted as qe, createElementBlock as z, openBlock as
|
|
1
|
+
import { defineComponent as ze, mergeModels as I, useModel as je, computed as s, watch as V, ref as h, useTemplateRef as O, unref as i, onMounted as qe, createElementBlock as z, openBlock as k, normalizeClass as j, createVNode as q, mergeProps as He, withCtx as Je, withDirectives as Qe, normalizeStyle as Xe, createBlock as H, createCommentVNode as J, nextTick as M } from "vue";
|
|
2
2
|
import "../../../node_modules/.pnpm/vue-types@5.1.3_vue@3.5.21_typescript@5.9.3_/node_modules/vue-types/shim/index.modern.js";
|
|
3
3
|
import { useDesign as Ye } from "../../../packages/hooks/src/useDesign.js";
|
|
4
4
|
import "axios";
|
|
@@ -72,13 +72,13 @@ const p = 4, Tl = /* @__PURE__ */ ze({
|
|
|
72
72
|
leafNodes: f,
|
|
73
73
|
isFirstLoaded: ae,
|
|
74
74
|
buildOptionGroups: oe
|
|
75
|
-
} = sl(t),
|
|
75
|
+
} = sl(t), n = je(E, "modelValue");
|
|
76
76
|
let L;
|
|
77
77
|
const P = s(() => t.disabled), ne = s(() => {
|
|
78
78
|
const e = /* @__PURE__ */ new Map();
|
|
79
79
|
return f.value.forEach((l) => e.set(l.value, l.label)), e;
|
|
80
80
|
});
|
|
81
|
-
function
|
|
81
|
+
function A(e) {
|
|
82
82
|
return e === t.showAllField ? { label: "全部", value: t.showAllField } : { label: ne.value.get(e) ?? String(e), value: e };
|
|
83
83
|
}
|
|
84
84
|
function $(e) {
|
|
@@ -87,23 +87,23 @@ const p = 4, Tl = /* @__PURE__ */ ze({
|
|
|
87
87
|
}
|
|
88
88
|
const re = s({
|
|
89
89
|
get() {
|
|
90
|
-
return Array.isArray(
|
|
90
|
+
return Array.isArray(n.value) ? t.multiple ? n.value : n.value.slice(-1) : n.value === void 0 ? [] : [n.value];
|
|
91
91
|
},
|
|
92
92
|
set(e) {
|
|
93
|
-
|
|
93
|
+
n.value = t.multiple ? [...e] : e.at(-1);
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
|
-
V([() => t.multiple, () =>
|
|
96
|
+
V([() => t.multiple, () => n.value], ([e, l]) => {
|
|
97
97
|
if (e) {
|
|
98
|
-
Array.isArray(l) || (
|
|
98
|
+
Array.isArray(l) || (n.value = l === void 0 ? [] : [l]);
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
Array.isArray(l) && (
|
|
101
|
+
Array.isArray(l) && (n.value = l.at(-1));
|
|
102
102
|
});
|
|
103
|
-
const
|
|
103
|
+
const C = h(), v = h(""), y = h(""), b = h(), S = O("middleRef"), w = O("selectWrapRef"), N = O("selectRef"), x = h(0);
|
|
104
104
|
function B() {
|
|
105
105
|
const e = w.value;
|
|
106
|
-
e && (
|
|
106
|
+
e && (x.value = e.offsetWidth);
|
|
107
107
|
}
|
|
108
108
|
ll(w, () => B());
|
|
109
109
|
const ie = s(() => ({
|
|
@@ -120,23 +120,23 @@ const p = 4, Tl = /* @__PURE__ */ ze({
|
|
|
120
120
|
const e = v.value.trim().toLowerCase();
|
|
121
121
|
if (!e) return R.value;
|
|
122
122
|
const l = (a) => {
|
|
123
|
-
const
|
|
124
|
-
return a.forEach((
|
|
123
|
+
const o = [];
|
|
124
|
+
return a.forEach((r) => {
|
|
125
125
|
var U;
|
|
126
|
-
const u = (U =
|
|
127
|
-
(String(
|
|
128
|
-
}),
|
|
126
|
+
const u = (U = r.children) != null && U.length ? l(r.children) : void 0;
|
|
127
|
+
(String(r.label).toLowerCase().includes(e) || u && u.length) && o.push({ ...r, children: u != null && u.length ? u : void 0 });
|
|
128
|
+
}), o;
|
|
129
129
|
};
|
|
130
130
|
return l(R.value);
|
|
131
131
|
}), ue = s(() => {
|
|
132
132
|
const e = [], l = (a) => {
|
|
133
|
-
a.forEach((
|
|
134
|
-
var
|
|
135
|
-
e.push(
|
|
133
|
+
a.forEach((o) => {
|
|
134
|
+
var r;
|
|
135
|
+
e.push(o.value), (r = o.children) != null && r.length && l(o.children);
|
|
136
136
|
});
|
|
137
137
|
};
|
|
138
138
|
return l(T.value), e;
|
|
139
|
-
}),
|
|
139
|
+
}), g = s(() => oe(f.value, y.value)), de = s(() => {
|
|
140
140
|
const e = "minmax(var(--tt-panel-select-middle-width, 450px), 1fr)";
|
|
141
141
|
return t.showNav && !t.multiple ? `200px ${e}` : !t.showNav && t.multiple ? `${e} 180px` : !t.showNav && !t.multiple ? e : `200px ${e} 180px`;
|
|
142
142
|
}), ce = s(() => {
|
|
@@ -144,17 +144,17 @@ const p = 4, Tl = /* @__PURE__ */ ze({
|
|
|
144
144
|
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)`;
|
|
145
145
|
}), pe = s(() => {
|
|
146
146
|
const e = [];
|
|
147
|
-
return
|
|
147
|
+
return g.value.forEach((l) => {
|
|
148
148
|
!(t.showOriginMode && l.value === "__origin__") && e.push({ key: `group-${String(l.value)}`, type: "group", group: l });
|
|
149
|
-
const
|
|
150
|
-
for (let
|
|
151
|
-
const u =
|
|
149
|
+
const o = Math.ceil(l.options.length / p);
|
|
150
|
+
for (let r = 0; r < l.options.length; r += p) {
|
|
151
|
+
const u = r / p;
|
|
152
152
|
e.push({
|
|
153
|
-
key: `options-${String(l.value)}-${
|
|
153
|
+
key: `options-${String(l.value)}-${r / p}`,
|
|
154
154
|
type: "options",
|
|
155
155
|
group: l,
|
|
156
|
-
options: l.options.slice(
|
|
157
|
-
isLast: u ===
|
|
156
|
+
options: l.options.slice(r, r + p),
|
|
157
|
+
isLast: u === o - 1
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
}), e;
|
|
@@ -174,35 +174,35 @@ const p = 4, Tl = /* @__PURE__ */ ze({
|
|
|
174
174
|
withLockedSelectedValues: Se
|
|
175
175
|
} = ul({
|
|
176
176
|
multiple: s(() => t.multiple),
|
|
177
|
-
modelValue:
|
|
177
|
+
modelValue: n,
|
|
178
178
|
selectedValues: re,
|
|
179
179
|
leafNodes: f,
|
|
180
180
|
allValue: s(() => t.showAllField)
|
|
181
181
|
}), G = s({
|
|
182
182
|
get() {
|
|
183
183
|
if (t.multiple)
|
|
184
|
-
return (Array.isArray(
|
|
185
|
-
if (Array.isArray(
|
|
186
|
-
const e =
|
|
187
|
-
return e === void 0 ? void 0 :
|
|
184
|
+
return (Array.isArray(n.value) ? n.value : n.value === void 0 ? [] : [n.value]).map((l) => A(l));
|
|
185
|
+
if (Array.isArray(n.value)) {
|
|
186
|
+
const e = n.value.at(-1);
|
|
187
|
+
return e === void 0 ? void 0 : A(e);
|
|
188
188
|
}
|
|
189
|
-
return
|
|
189
|
+
return n.value === void 0 ? void 0 : A(n.value);
|
|
190
190
|
},
|
|
191
191
|
set(e) {
|
|
192
|
-
const l = i(
|
|
192
|
+
const l = i(n);
|
|
193
193
|
if (L = Array.isArray(l) ? [...l] : l, t.multiple) {
|
|
194
|
-
const
|
|
195
|
-
|
|
194
|
+
const o = (Array.isArray(e) ? e : []).map((r) => $(r)).filter((r) => r !== void 0);
|
|
195
|
+
n.value = Se(o);
|
|
196
196
|
return;
|
|
197
197
|
}
|
|
198
|
-
|
|
198
|
+
n.value = $(e);
|
|
199
199
|
}
|
|
200
200
|
}), W = s(
|
|
201
201
|
() => {
|
|
202
202
|
const e = {}, l = {};
|
|
203
|
-
return
|
|
204
|
-
const { enabledCount:
|
|
205
|
-
e[u] =
|
|
203
|
+
return g.value.forEach((a) => {
|
|
204
|
+
const { enabledCount: o, checkedCount: r } = ve(a), u = String(a.value);
|
|
205
|
+
e[u] = o > 0 && r === o, l[u] = o > 0 && r > 0 && r < o;
|
|
206
206
|
}), { checkedMap: e, indeterminateMap: l };
|
|
207
207
|
}
|
|
208
208
|
), xe = s(() => W.value.checkedMap), Ve = s(() => W.value.indeterminateMap), Oe = s(() => _.value.has(t.showAllField)), D = s(() => [...t.showAll ? [{ label: "全部", value: t.showAllField }] : [], ...f.value.map((l) => ({ ...l }))]);
|
|
@@ -210,26 +210,23 @@ const p = 4, Tl = /* @__PURE__ */ ze({
|
|
|
210
210
|
const l = i(D);
|
|
211
211
|
if (Array.isArray(e)) {
|
|
212
212
|
const a = new Set(e);
|
|
213
|
-
return l.filter((
|
|
213
|
+
return l.filter((o) => o.value !== void 0 && a.has(o.value));
|
|
214
214
|
}
|
|
215
215
|
if (e !== void 0)
|
|
216
216
|
return l.find((a) => a.value === e);
|
|
217
217
|
}
|
|
218
218
|
function Ee(e) {
|
|
219
|
-
var a
|
|
220
|
-
if (t.showPinyinMode ||
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
})) return e.value;
|
|
224
|
-
const l = f.value.find((o) => o.path.some((u) => u.value === e.value));
|
|
225
|
-
return (n = l == null ? void 0 : l.path.at(-2)) == null ? void 0 : n.value;
|
|
219
|
+
var a;
|
|
220
|
+
if (t.showPinyinMode || g.value.some((o) => o.value === e.value)) return e.value;
|
|
221
|
+
const l = f.value.find((o) => o.path.some((r) => r.value === e.value));
|
|
222
|
+
return (a = l == null ? void 0 : l.path.at(-2)) == null ? void 0 : a.value;
|
|
226
223
|
}
|
|
227
224
|
function Fe(e) {
|
|
228
|
-
|
|
225
|
+
C.value = e.value;
|
|
229
226
|
const l = Ee(e);
|
|
230
|
-
|
|
227
|
+
b.value = void 0, M(() => {
|
|
231
228
|
var a;
|
|
232
|
-
|
|
229
|
+
b.value = l, l !== void 0 && ((a = S.value) == null || a.scrollToGroup(l));
|
|
233
230
|
});
|
|
234
231
|
}
|
|
235
232
|
function Re(e) {
|
|
@@ -239,12 +236,12 @@ const p = 4, Tl = /* @__PURE__ */ ze({
|
|
|
239
236
|
y.value = e;
|
|
240
237
|
}
|
|
241
238
|
function Pe(e, l) {
|
|
242
|
-
const a =
|
|
239
|
+
const a = g.value.find((o) => o.value === e);
|
|
243
240
|
a && ye(a, l);
|
|
244
241
|
}
|
|
245
242
|
async function $e(e) {
|
|
246
243
|
var l;
|
|
247
|
-
F("visible-change", e), e && (y.value = "", v.value = "", await M(), (l =
|
|
244
|
+
F("visible-change", e), e && (y.value = "", v.value = "", await M(), (l = S.value) == null || l.inputFocus(), B(), t.alwaysLoad ? await m() : !t.immediate && !i(ae) && await m());
|
|
248
245
|
}
|
|
249
246
|
function Ne() {
|
|
250
247
|
K(L);
|
|
@@ -253,16 +250,16 @@ const p = 4, Tl = /* @__PURE__ */ ze({
|
|
|
253
250
|
F("change", e, [...i(D)], Me(e));
|
|
254
251
|
}
|
|
255
252
|
function Te(e, l) {
|
|
256
|
-
return Array.isArray(e) && Array.isArray(l) ? e.length === l.length && e.every((a,
|
|
253
|
+
return Array.isArray(e) && Array.isArray(l) ? e.length === l.length && e.every((a, o) => a === l[o]) : e === l;
|
|
257
254
|
}
|
|
258
255
|
function K(e) {
|
|
259
256
|
M(() => {
|
|
260
|
-
const l = i(
|
|
257
|
+
const l = i(n);
|
|
261
258
|
Te(l, e) || Be(l);
|
|
262
259
|
});
|
|
263
260
|
}
|
|
264
261
|
function d(e) {
|
|
265
|
-
const l = i(
|
|
262
|
+
const l = i(n), a = Array.isArray(l) ? [...l] : l;
|
|
266
263
|
e(), K(a);
|
|
267
264
|
}
|
|
268
265
|
function _e(e) {
|
|
@@ -310,7 +307,7 @@ const p = 4, Tl = /* @__PURE__ */ ze({
|
|
|
310
307
|
te,
|
|
311
308
|
(e) => {
|
|
312
309
|
var l;
|
|
313
|
-
|
|
310
|
+
C.value !== void 0 || !e.length || (C.value = (l = e[0]) == null ? void 0 : l.value);
|
|
314
311
|
},
|
|
315
312
|
{ immediate: !0 }
|
|
316
313
|
), qe(() => {
|
|
@@ -321,8 +318,8 @@ const p = 4, Tl = /* @__PURE__ */ ze({
|
|
|
321
318
|
/** 获取当前归一化后的树形选项数据 */
|
|
322
319
|
getOptions: () => i(le),
|
|
323
320
|
/** 获取当前v-model值 */
|
|
324
|
-
getValue: () => i(
|
|
325
|
-
}), (e, l) => (
|
|
321
|
+
getValue: () => i(n)
|
|
322
|
+
}), (e, l) => (k(), z("div", {
|
|
326
323
|
ref_key: "selectWrapRef",
|
|
327
324
|
ref: w,
|
|
328
325
|
class: j(i(c))
|
|
@@ -344,16 +341,16 @@ const p = 4, Tl = /* @__PURE__ */ ze({
|
|
|
344
341
|
onChange: Ne
|
|
345
342
|
}), {
|
|
346
343
|
empty: Je(() => [
|
|
347
|
-
Qe((
|
|
344
|
+
Qe((k(), z("div", {
|
|
348
345
|
"element-loading-text": "加载中",
|
|
349
346
|
class: j(`${i(c)}__panel`),
|
|
350
347
|
style: Xe({
|
|
351
348
|
"--columns": de.value,
|
|
352
349
|
"--panel-min-width": ce.value,
|
|
353
|
-
"--panel-width":
|
|
350
|
+
"--panel-width": x.value ? `${x.value}px` : "100%"
|
|
354
351
|
})
|
|
355
352
|
}, [
|
|
356
|
-
t.showNav ? (
|
|
353
|
+
t.showNav ? (k(), H(nl, {
|
|
357
354
|
key: 0,
|
|
358
355
|
"prefix-cls": i(c),
|
|
359
356
|
keyword: v.value,
|
|
@@ -365,7 +362,7 @@ const p = 4, Tl = /* @__PURE__ */ ze({
|
|
|
365
362
|
}, null, 8, ["prefix-cls", "keyword", "tree-data", "expanded-keys", "left-placeholder"])) : J("", !0),
|
|
366
363
|
q(rl, {
|
|
367
364
|
ref_key: "middleRef",
|
|
368
|
-
ref:
|
|
365
|
+
ref: S,
|
|
369
366
|
"prefix-cls": i(c),
|
|
370
367
|
multiple: e.multiple,
|
|
371
368
|
keyword: y.value,
|
|
@@ -378,7 +375,7 @@ const p = 4, Tl = /* @__PURE__ */ ze({
|
|
|
378
375
|
"is-all-checked": i(fe),
|
|
379
376
|
"is-indeterminate": i(he),
|
|
380
377
|
"all-checked": Oe.value,
|
|
381
|
-
"scroll-to-group-value":
|
|
378
|
+
"scroll-to-group-value": b.value,
|
|
382
379
|
"group-checked-map": xe.value,
|
|
383
380
|
"group-indeterminate-map": Ve.value,
|
|
384
381
|
"paste-search": e.pasteSearch,
|
|
@@ -391,7 +388,7 @@ const p = 4, Tl = /* @__PURE__ */ ze({
|
|
|
391
388
|
onOptionCheck: De,
|
|
392
389
|
onOptionsCheck: Ke
|
|
393
390
|
}, null, 8, ["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"]),
|
|
394
|
-
t.multiple ? (
|
|
391
|
+
t.multiple ? (k(), H(il, {
|
|
395
392
|
key: 1,
|
|
396
393
|
"prefix-cls": i(c),
|
|
397
394
|
multiple: e.multiple,
|