@dazhicheng/ui 1.5.239 → 1.5.241
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Te, mergeModels as
|
|
1
|
+
import { defineComponent as Te, mergeModels as K, useModel as We, computed as u, watch as V, ref as h, useTemplateRef as S, onMounted as De, unref as n, createElementBlock as U, openBlock as w, normalizeClass as z, createVNode as j, mergeProps as Ie, withCtx as Ke, withDirectives as Ue, normalizeStyle as ze, createBlock as q, createCommentVNode as H, nextTick as $ } 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 je } from "../../../packages/hooks/src/useDesign.js";
|
|
4
4
|
import "axios";
|
|
@@ -12,7 +12,7 @@ import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.j
|
|
|
12
12
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
13
13
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
14
14
|
import "../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
15
|
-
import { cloneDeep as
|
|
15
|
+
import { cloneDeep as J, isEqual as Je } from "lodash-es";
|
|
16
16
|
import { useResizeObserver as Qe } from "@vueuse/core";
|
|
17
17
|
import { useSelectCollapseOptions as Xe } from "../../tt-form/src/hooks/useSelectCollapse.js";
|
|
18
18
|
import { ALL as Ye } from "./common.js";
|
|
@@ -25,7 +25,7 @@ import { usePanelSelectSelection as al } from "./hooks/usePanelSelection.js";
|
|
|
25
25
|
const p = 4, Fl = /* @__PURE__ */ Te({
|
|
26
26
|
name: "TtPanelSelect",
|
|
27
27
|
__name: "index",
|
|
28
|
-
props: /* @__PURE__ */
|
|
28
|
+
props: /* @__PURE__ */ K({
|
|
29
29
|
disabled: { type: Boolean, default: !1 },
|
|
30
30
|
showNav: { type: Boolean, default: !0 },
|
|
31
31
|
multiple: { type: Boolean, default: !0 },
|
|
@@ -59,17 +59,17 @@ const p = 4, Fl = /* @__PURE__ */ Te({
|
|
|
59
59
|
modelValue: {},
|
|
60
60
|
modelModifiers: {}
|
|
61
61
|
}),
|
|
62
|
-
emits: /* @__PURE__ */
|
|
63
|
-
setup(F, { expose:
|
|
64
|
-
const
|
|
65
|
-
loading:
|
|
62
|
+
emits: /* @__PURE__ */ K(["visible-change", "change"], ["update:modelValue"]),
|
|
63
|
+
setup(F, { expose: Q, emit: X }) {
|
|
64
|
+
const Y = He, Z = qe, t = F, R = X, { prefixCls: c } = je("panel-select"), {
|
|
65
|
+
loading: ee,
|
|
66
66
|
fetchApi: m,
|
|
67
|
-
treeOptions:
|
|
67
|
+
treeOptions: le,
|
|
68
68
|
navTreeOptions: N,
|
|
69
|
-
navNodes:
|
|
69
|
+
navNodes: te,
|
|
70
70
|
leafNodes: f,
|
|
71
|
-
isFirstLoaded:
|
|
72
|
-
buildOptionGroups:
|
|
71
|
+
isFirstLoaded: ae,
|
|
72
|
+
buildOptionGroups: oe
|
|
73
73
|
} = tl(t), a = We(F, "modelValue"), B = u(() => t.disabled);
|
|
74
74
|
function g(e) {
|
|
75
75
|
if (e === t.showAllField) return { label: "全部", value: t.showAllField };
|
|
@@ -124,7 +124,7 @@ const p = 4, Fl = /* @__PURE__ */ Te({
|
|
|
124
124
|
e && (O.value = e.offsetWidth);
|
|
125
125
|
}
|
|
126
126
|
Qe(v, () => L());
|
|
127
|
-
const
|
|
127
|
+
const ne = u(() => ({
|
|
128
128
|
componentProps: {
|
|
129
129
|
multiple: t.multiple,
|
|
130
130
|
component: {
|
|
@@ -134,19 +134,19 @@ const p = 4, Fl = /* @__PURE__ */ Te({
|
|
|
134
134
|
component: "ElSelect",
|
|
135
135
|
selectWrapRef: v,
|
|
136
136
|
selectRef: M
|
|
137
|
-
})), { selectComponentProps:
|
|
137
|
+
})), { selectComponentProps: ie } = Xe(ne), _ = u(() => {
|
|
138
138
|
const e = A.value.trim().toLowerCase();
|
|
139
139
|
if (!e) return N.value;
|
|
140
140
|
const l = (o) => {
|
|
141
141
|
const i = [];
|
|
142
142
|
return o.forEach((r) => {
|
|
143
|
-
var
|
|
144
|
-
const s = (
|
|
143
|
+
var I;
|
|
144
|
+
const s = (I = r.children) != null && I.length ? l(r.children) : void 0;
|
|
145
145
|
(String(r.label).toLowerCase().includes(e) || s && s.length) && i.push({ ...r, children: s != null && s.length ? s : void 0 });
|
|
146
146
|
}), i;
|
|
147
147
|
};
|
|
148
148
|
return l(N.value);
|
|
149
|
-
}),
|
|
149
|
+
}), re = u(() => {
|
|
150
150
|
const e = [], l = (o) => {
|
|
151
151
|
o.forEach((i) => {
|
|
152
152
|
var r;
|
|
@@ -154,13 +154,13 @@ const p = 4, Fl = /* @__PURE__ */ Te({
|
|
|
154
154
|
});
|
|
155
155
|
};
|
|
156
156
|
return l(_.value), e;
|
|
157
|
-
}), y = u(() =>
|
|
157
|
+
}), y = u(() => oe(f.value, x.value)), ue = u(() => {
|
|
158
158
|
const e = "minmax(var(--tt-panel-select-middle-width, 450px), 1fr)";
|
|
159
159
|
return t.showNav && !t.multiple ? `200px ${e}` : !t.showNav && t.multiple ? `${e} 180px` : !t.showNav && !t.multiple ? e : `200px ${e} 180px`;
|
|
160
|
-
}),
|
|
160
|
+
}), se = u(() => {
|
|
161
161
|
const e = "var(--tt-panel-select-middle-width, 450px)";
|
|
162
162
|
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)`;
|
|
163
|
-
}),
|
|
163
|
+
}), de = u(() => {
|
|
164
164
|
const e = [];
|
|
165
165
|
return y.value.forEach((l) => {
|
|
166
166
|
!(t.showOriginMode && l.value === "__origin__") && e.push({ key: `group-${String(l.value)}`, type: "group", group: l });
|
|
@@ -177,38 +177,38 @@ const p = 4, Fl = /* @__PURE__ */ Te({
|
|
|
177
177
|
}
|
|
178
178
|
}), e;
|
|
179
179
|
}), {
|
|
180
|
-
selectedOptions:
|
|
181
|
-
isAllChecked:
|
|
182
|
-
isIndeterminate:
|
|
183
|
-
isGroupChecked:
|
|
184
|
-
isGroupIndeterminate:
|
|
185
|
-
handleGroupCheck:
|
|
186
|
-
handleAllOptionCheck:
|
|
187
|
-
handleOptionCheck:
|
|
188
|
-
handleOptionsCheck:
|
|
180
|
+
selectedOptions: ce,
|
|
181
|
+
isAllChecked: pe,
|
|
182
|
+
isIndeterminate: me,
|
|
183
|
+
isGroupChecked: fe,
|
|
184
|
+
isGroupIndeterminate: he,
|
|
185
|
+
handleGroupCheck: ve,
|
|
186
|
+
handleAllOptionCheck: ye,
|
|
187
|
+
handleOptionCheck: we,
|
|
188
|
+
handleOptionsCheck: ge,
|
|
189
189
|
handleCheckAll: T,
|
|
190
|
-
removeSelected:
|
|
190
|
+
removeSelected: ke
|
|
191
191
|
} = al({
|
|
192
192
|
multiple: u(() => t.multiple),
|
|
193
193
|
modelValue: a,
|
|
194
194
|
selectedValues: k,
|
|
195
195
|
leafNodes: f,
|
|
196
196
|
allValue: u(() => t.showAllField)
|
|
197
|
-
}),
|
|
198
|
-
(e, l) => (e[String(l.value)] = me(l), e),
|
|
199
|
-
{}
|
|
200
|
-
)), Ce = u(() => y.value.reduce(
|
|
197
|
+
}), Ce = u(() => y.value.reduce(
|
|
201
198
|
(e, l) => (e[String(l.value)] = fe(l), e),
|
|
202
199
|
{}
|
|
203
|
-
)), Ae = u(() =>
|
|
204
|
-
|
|
200
|
+
)), Ae = u(() => y.value.reduce(
|
|
201
|
+
(e, l) => (e[String(l.value)] = he(l), e),
|
|
202
|
+
{}
|
|
203
|
+
)), xe = u(() => k.value.includes(t.showAllField)), W = u(() => [...t.showAll ? [{ label: "全部", value: t.showAllField }] : [], ...f.value.map((l) => ({ ...l }))]);
|
|
204
|
+
function be(e) {
|
|
205
205
|
const l = n(W);
|
|
206
206
|
if (Array.isArray(e))
|
|
207
207
|
return l.filter((o) => e.some((i) => i === o.value));
|
|
208
208
|
if (e !== void 0)
|
|
209
209
|
return l.find((o) => o.value === e);
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function Oe(e) {
|
|
212
212
|
var o, i;
|
|
213
213
|
if (t.showPinyinMode || (o = e.children) != null && o.some((r) => {
|
|
214
214
|
var s;
|
|
@@ -217,43 +217,43 @@ const p = 4, Fl = /* @__PURE__ */ Te({
|
|
|
217
217
|
const l = f.value.find((r) => r.path.some((s) => s.value === e.value));
|
|
218
218
|
return (i = l == null ? void 0 : l.path.at(-2)) == null ? void 0 : i.value;
|
|
219
219
|
}
|
|
220
|
-
function
|
|
220
|
+
function Ve(e) {
|
|
221
221
|
C.value = e.value;
|
|
222
|
-
const l =
|
|
222
|
+
const l = Oe(e);
|
|
223
223
|
b.value = void 0, $(() => {
|
|
224
224
|
var o;
|
|
225
225
|
b.value = l, l !== void 0 && ((o = G.value) == null || o.scrollToGroup(l));
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function Se(e) {
|
|
229
229
|
A.value = e;
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function $e(e) {
|
|
232
232
|
x.value = e;
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function Fe(e, l) {
|
|
235
235
|
const o = y.value.find((i) => i.value === e);
|
|
236
|
-
o &&
|
|
236
|
+
o && ve(o, l);
|
|
237
237
|
}
|
|
238
|
-
async function
|
|
239
|
-
R("visible-change", e), e && (await $(), L(), t.alwaysLoad ? await m() : !t.immediate && !n(
|
|
238
|
+
async function Re(e) {
|
|
239
|
+
R("visible-change", e), e && (await $(), L(), t.alwaysLoad ? await m() : !t.immediate && !n(ae) && await m());
|
|
240
240
|
}
|
|
241
|
-
function
|
|
242
|
-
R("change", e,
|
|
241
|
+
function D(e) {
|
|
242
|
+
R("change", e, J(n(W)), be(e));
|
|
243
243
|
}
|
|
244
244
|
function Ne(e) {
|
|
245
245
|
$(() => {
|
|
246
246
|
const l = n(a);
|
|
247
|
-
Je(l, e) ||
|
|
247
|
+
Je(l, e) || D(l);
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
250
|
function d(e) {
|
|
251
|
-
const l =
|
|
251
|
+
const l = J(n(a));
|
|
252
252
|
e(), Ne(l);
|
|
253
253
|
}
|
|
254
254
|
function Be(e) {
|
|
255
255
|
d(() => {
|
|
256
|
-
|
|
256
|
+
ye(e);
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
259
|
function Ee(e) {
|
|
@@ -263,22 +263,22 @@ const p = 4, Fl = /* @__PURE__ */ Te({
|
|
|
263
263
|
}
|
|
264
264
|
function Pe(e, l) {
|
|
265
265
|
d(() => {
|
|
266
|
-
|
|
266
|
+
Fe(e, l);
|
|
267
267
|
});
|
|
268
268
|
}
|
|
269
269
|
function Ge(e, l) {
|
|
270
270
|
d(() => {
|
|
271
|
-
|
|
271
|
+
we(e, l);
|
|
272
272
|
});
|
|
273
273
|
}
|
|
274
274
|
function Me(e, l) {
|
|
275
275
|
d(() => {
|
|
276
|
-
|
|
276
|
+
ge(e, l);
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
279
|
function Le(e) {
|
|
280
280
|
d(() => {
|
|
281
|
-
|
|
281
|
+
ke(e);
|
|
282
282
|
});
|
|
283
283
|
}
|
|
284
284
|
function _e() {
|
|
@@ -293,7 +293,7 @@ const p = 4, Fl = /* @__PURE__ */ Te({
|
|
|
293
293
|
},
|
|
294
294
|
{ deep: !0 }
|
|
295
295
|
), V(
|
|
296
|
-
|
|
296
|
+
te,
|
|
297
297
|
(e) => {
|
|
298
298
|
var l;
|
|
299
299
|
C.value !== void 0 || !e.length || (C.value = (l = e[0]) == null ? void 0 : l.value);
|
|
@@ -301,90 +301,91 @@ const p = 4, Fl = /* @__PURE__ */ Te({
|
|
|
301
301
|
{ immediate: !0 }
|
|
302
302
|
), De(() => {
|
|
303
303
|
t.immediate && m();
|
|
304
|
-
}),
|
|
304
|
+
}), Q({
|
|
305
305
|
/** 重新加载数据源*/
|
|
306
306
|
reload: m,
|
|
307
307
|
/** 获取当前归一化后的树形选项数据 */
|
|
308
|
-
getOptions: () => n(
|
|
308
|
+
getOptions: () => n(le),
|
|
309
309
|
/** 获取当前v-model值 */
|
|
310
310
|
getValue: () => n(a)
|
|
311
|
-
}), (e, l) => (w(),
|
|
311
|
+
}), (e, l) => (w(), U("div", {
|
|
312
312
|
ref_key: "selectWrapRef",
|
|
313
313
|
ref: v,
|
|
314
|
-
class:
|
|
314
|
+
class: z(n(c))
|
|
315
315
|
}, [
|
|
316
|
-
|
|
316
|
+
j(n(Z), Ie({
|
|
317
317
|
ref_key: "selectRef",
|
|
318
318
|
ref: M,
|
|
319
319
|
modelValue: P.value,
|
|
320
320
|
"onUpdate:modelValue": l[0] || (l[0] = (o) => P.value = o)
|
|
321
|
-
}, n(
|
|
321
|
+
}, n(ie), {
|
|
322
322
|
multiple: e.multiple,
|
|
323
323
|
filterable: !1,
|
|
324
324
|
placeholder: e.placeholder,
|
|
325
325
|
disabled: e.disabled,
|
|
326
326
|
"popper-class": `${n(c)}__popper vxe-table--ignore-clear`,
|
|
327
|
-
onVisibleChange:
|
|
327
|
+
onVisibleChange: Re,
|
|
328
|
+
onChange: D
|
|
328
329
|
}), {
|
|
329
330
|
empty: Ke(() => [
|
|
330
|
-
Ue((w(),
|
|
331
|
+
Ue((w(), U("div", {
|
|
331
332
|
"element-loading-text": "加载中",
|
|
332
|
-
class:
|
|
333
|
+
class: z(`${n(c)}__panel`),
|
|
333
334
|
style: ze({
|
|
334
|
-
"--columns":
|
|
335
|
-
"--panel-min-width":
|
|
335
|
+
"--columns": ue.value,
|
|
336
|
+
"--panel-min-width": se.value,
|
|
336
337
|
"--panel-width": O.value ? `${O.value}px` : "100%"
|
|
337
338
|
})
|
|
338
339
|
}, [
|
|
339
|
-
t.showNav ? (w(),
|
|
340
|
+
t.showNav ? (w(), q(Ze, {
|
|
340
341
|
key: 0,
|
|
341
342
|
"prefix-cls": n(c),
|
|
342
343
|
keyword: A.value,
|
|
343
344
|
"tree-data": _.value,
|
|
344
|
-
"expanded-keys":
|
|
345
|
+
"expanded-keys": re.value,
|
|
345
346
|
"left-placeholder": e.leftPlaceholder,
|
|
346
|
-
"onUpdate:keyword":
|
|
347
|
-
onSelect:
|
|
348
|
-
}, null, 8, ["prefix-cls", "keyword", "tree-data", "expanded-keys", "left-placeholder"])) :
|
|
349
|
-
|
|
347
|
+
"onUpdate:keyword": Se,
|
|
348
|
+
onSelect: Ve
|
|
349
|
+
}, null, 8, ["prefix-cls", "keyword", "tree-data", "expanded-keys", "left-placeholder"])) : H("", !0),
|
|
350
|
+
j(el, {
|
|
350
351
|
ref_key: "middleRef",
|
|
351
352
|
ref: G,
|
|
352
353
|
"prefix-cls": n(c),
|
|
353
354
|
multiple: e.multiple,
|
|
354
355
|
keyword: x.value,
|
|
355
|
-
rows:
|
|
356
|
+
rows: de.value,
|
|
356
357
|
disabled: B.value,
|
|
357
358
|
"show-all": t.showAll,
|
|
358
359
|
"option-per-row": p,
|
|
359
360
|
"row-height": 40,
|
|
360
361
|
"selected-values": k.value,
|
|
361
|
-
"is-all-checked": n(
|
|
362
|
-
"is-indeterminate": n(
|
|
363
|
-
"all-checked":
|
|
362
|
+
"is-all-checked": n(pe),
|
|
363
|
+
"is-indeterminate": n(me),
|
|
364
|
+
"all-checked": xe.value,
|
|
364
365
|
"scroll-to-group-value": b.value,
|
|
365
|
-
"group-checked-map":
|
|
366
|
-
"group-indeterminate-map":
|
|
366
|
+
"group-checked-map": Ce.value,
|
|
367
|
+
"group-indeterminate-map": Ae.value,
|
|
367
368
|
"paste-search": e.pasteSearch,
|
|
368
369
|
separator: e.separator,
|
|
369
370
|
"middle-placeholder": e.middlePlaceholder,
|
|
370
|
-
"onUpdate:keyword":
|
|
371
|
+
"onUpdate:keyword": $e,
|
|
371
372
|
onAllCheck: Be,
|
|
372
373
|
onCheckAll: Ee,
|
|
373
374
|
onGroupCheck: Pe,
|
|
374
375
|
onOptionCheck: Ge,
|
|
375
376
|
onOptionsCheck: Me
|
|
376
377
|
}, null, 8, ["prefix-cls", "multiple", "keyword", "rows", "disabled", "show-all", "selected-values", "is-all-checked", "is-indeterminate", "all-checked", "scroll-to-group-value", "group-checked-map", "group-indeterminate-map", "paste-search", "separator", "middle-placeholder"]),
|
|
377
|
-
t.multiple ? (w(),
|
|
378
|
+
t.multiple ? (w(), q(ll, {
|
|
378
379
|
key: 1,
|
|
379
380
|
"prefix-cls": n(c),
|
|
380
381
|
multiple: e.multiple,
|
|
381
382
|
disabled: B.value,
|
|
382
|
-
"selected-options": n(
|
|
383
|
+
"selected-options": n(ce),
|
|
383
384
|
onClearAll: _e,
|
|
384
385
|
onRemove: Le
|
|
385
|
-
}, null, 8, ["prefix-cls", "multiple", "disabled", "selected-options"])) :
|
|
386
|
+
}, null, 8, ["prefix-cls", "multiple", "disabled", "selected-options"])) : H("", !0)
|
|
386
387
|
], 6)), [
|
|
387
|
-
[n(
|
|
388
|
+
[n(Y), n(ee)]
|
|
388
389
|
])
|
|
389
390
|
]),
|
|
390
391
|
_: 1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dazhicheng/ui",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.241",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
"vue-router": "^5.0.2",
|
|
68
68
|
"vxe-pc-ui": "^4.12.36",
|
|
69
69
|
"vxe-table": "^4.17.48",
|
|
70
|
-
"@dazhicheng/hooks": "1.4.
|
|
71
|
-
"@dazhicheng/utils": "1.3.
|
|
70
|
+
"@dazhicheng/hooks": "1.4.46",
|
|
71
|
+
"@dazhicheng/utils": "1.3.43"
|
|
72
72
|
},
|
|
73
73
|
"files": [
|
|
74
74
|
"dist"
|