straw-ui-vue 0.1.55 → 0.1.57
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/README.md +1 -1
- package/dist/components/st-tree/index.d.ts +9 -0
- package/dist/components/st-tree/st-tree-group.d.ts +1 -0
- package/dist/components/st-tree/st-tree.d.ts +1 -0
- package/dist/components/st-tree/types/st-tree-group.d.ts +2 -0
- package/dist/components/st-tree/types/st-tree.d.ts +2 -0
- package/dist/straw-ui.js +160 -117
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,6 +37,7 @@ export declare const StTree: {
|
|
|
37
37
|
selection: boolean;
|
|
38
38
|
indent: number;
|
|
39
39
|
defaultExpandedLevel: number;
|
|
40
|
+
expandParent: boolean;
|
|
40
41
|
autoChange: boolean;
|
|
41
42
|
deepChange: boolean;
|
|
42
43
|
accordion: boolean;
|
|
@@ -76,6 +77,7 @@ export declare const StTree: {
|
|
|
76
77
|
selection: boolean;
|
|
77
78
|
indent: number;
|
|
78
79
|
defaultExpandedLevel: number;
|
|
80
|
+
expandParent: boolean;
|
|
79
81
|
autoChange: boolean;
|
|
80
82
|
deepChange: boolean;
|
|
81
83
|
accordion: boolean;
|
|
@@ -122,6 +124,7 @@ export declare const StTree: {
|
|
|
122
124
|
selection: boolean;
|
|
123
125
|
indent: number;
|
|
124
126
|
defaultExpandedLevel: number;
|
|
127
|
+
expandParent: boolean;
|
|
125
128
|
autoChange: boolean;
|
|
126
129
|
deepChange: boolean;
|
|
127
130
|
accordion: boolean;
|
|
@@ -159,6 +162,7 @@ export declare const StTree: {
|
|
|
159
162
|
expandOnClick: boolean;
|
|
160
163
|
selection: boolean;
|
|
161
164
|
indent: number;
|
|
165
|
+
expandParent: boolean;
|
|
162
166
|
accordion: boolean;
|
|
163
167
|
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
164
168
|
P: {};
|
|
@@ -187,6 +191,7 @@ export declare const StTree: {
|
|
|
187
191
|
expandOnClick: boolean;
|
|
188
192
|
selection: boolean;
|
|
189
193
|
indent: number;
|
|
194
|
+
expandParent: boolean;
|
|
190
195
|
accordion: boolean;
|
|
191
196
|
}>;
|
|
192
197
|
__isFragment?: never;
|
|
@@ -221,6 +226,7 @@ export declare const StTree: {
|
|
|
221
226
|
expandOnClick: boolean;
|
|
222
227
|
selection: boolean;
|
|
223
228
|
indent: number;
|
|
229
|
+
expandParent: boolean;
|
|
224
230
|
accordion: boolean;
|
|
225
231
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
226
232
|
$slots: import('./index.ts').StTreeGroupSlots;
|
|
@@ -382,6 +388,7 @@ export declare const StTreeGroup: {
|
|
|
382
388
|
expandOnClick: boolean;
|
|
383
389
|
selection: boolean;
|
|
384
390
|
indent: number;
|
|
391
|
+
expandParent: boolean;
|
|
385
392
|
accordion: boolean;
|
|
386
393
|
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
387
394
|
P: {};
|
|
@@ -410,6 +417,7 @@ export declare const StTreeGroup: {
|
|
|
410
417
|
expandOnClick: boolean;
|
|
411
418
|
selection: boolean;
|
|
412
419
|
indent: number;
|
|
420
|
+
expandParent: boolean;
|
|
413
421
|
accordion: boolean;
|
|
414
422
|
}>;
|
|
415
423
|
__isFragment?: never;
|
|
@@ -444,6 +452,7 @@ export declare const StTreeGroup: {
|
|
|
444
452
|
expandOnClick: boolean;
|
|
445
453
|
selection: boolean;
|
|
446
454
|
indent: number;
|
|
455
|
+
expandParent: boolean;
|
|
447
456
|
accordion: boolean;
|
|
448
457
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
449
458
|
$slots: import('./index.ts').StTreeGroupSlots;
|
|
@@ -38,6 +38,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
|
|
|
38
38
|
expandOnClick: boolean;
|
|
39
39
|
selection: boolean;
|
|
40
40
|
indent: number;
|
|
41
|
+
expandParent: boolean;
|
|
41
42
|
accordion: boolean;
|
|
42
43
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
43
44
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -34,6 +34,8 @@ export interface StTreeProps {
|
|
|
34
34
|
defaultExpandedLevel?: number;
|
|
35
35
|
/** 默认展开全部层级 */
|
|
36
36
|
defaultExpandedAll?: boolean;
|
|
37
|
+
/** 选中值(含初始值)变化时自动展开其全部父级节点 */
|
|
38
|
+
expandParent?: boolean;
|
|
37
39
|
/** 当绑定值 modelValue 没有值时,是否默认选择第一个节点 */
|
|
38
40
|
autoChange?: boolean;
|
|
39
41
|
/** 当 autoChange 为 true 时,是否深度选择(选择第一个最子级节点) */
|
package/dist/straw-ui.js
CHANGED
|
@@ -4306,6 +4306,10 @@ var Sn = ["data-index"], Cn = /* @__PURE__ */ F({
|
|
|
4306
4306
|
type: Boolean,
|
|
4307
4307
|
default: !1
|
|
4308
4308
|
},
|
|
4309
|
+
expandParent: {
|
|
4310
|
+
type: Boolean,
|
|
4311
|
+
default: !1
|
|
4312
|
+
},
|
|
4309
4313
|
indent: { default: 10 }
|
|
4310
4314
|
}, {
|
|
4311
4315
|
modelValue: {},
|
|
@@ -4344,10 +4348,23 @@ var Sn = ["data-index"], Cn = /* @__PURE__ */ F({
|
|
|
4344
4348
|
return e.length === t.length && e.every((e, n) => e === t[n]);
|
|
4345
4349
|
}
|
|
4346
4350
|
function h(e) {
|
|
4351
|
+
if (!l.expandParent || e.length < 2) return;
|
|
4352
|
+
let t = e.slice(0, -1).filter((e) => !i.value.includes(e));
|
|
4353
|
+
t.length !== 0 && (i.value = [...i.value, ...t]);
|
|
4354
|
+
}
|
|
4355
|
+
let g = !1;
|
|
4356
|
+
function _() {
|
|
4357
|
+
g || n.value !== void 0 && r.value[r.value.length - 1] !== n.value && (g = !0, L(() => {
|
|
4358
|
+
if (g = !1, n.value === void 0 || r.value[r.value.length - 1] === n.value) return;
|
|
4359
|
+
let e = f(n.value);
|
|
4360
|
+
e.length !== 0 && (r.value = e, h(e));
|
|
4361
|
+
}));
|
|
4362
|
+
}
|
|
4363
|
+
function v(e) {
|
|
4347
4364
|
let t = f(e);
|
|
4348
|
-
n.value = e, r.value = t, l.expandOnClick &&
|
|
4365
|
+
n.value = e, r.value = t, l.expandOnClick && x(e).length > 0 && y(e), c("change", e, t);
|
|
4349
4366
|
}
|
|
4350
|
-
function
|
|
4367
|
+
function y(e) {
|
|
4351
4368
|
let t = i.value.includes(e);
|
|
4352
4369
|
if (t) i.value = i.value.filter((t) => t !== e);
|
|
4353
4370
|
else {
|
|
@@ -4360,47 +4377,47 @@ var Sn = ["data-index"], Cn = /* @__PURE__ */ F({
|
|
|
4360
4377
|
}
|
|
4361
4378
|
c("expand", e, !t);
|
|
4362
4379
|
}
|
|
4363
|
-
function
|
|
4380
|
+
function b(e) {
|
|
4364
4381
|
let t = a.value.includes(e), n;
|
|
4365
|
-
n = l.strict ? t ?
|
|
4382
|
+
n = l.strict ? t ? w(e) : C(e) : t ? a.value.filter((t) => t !== e) : [...a.value, e];
|
|
4366
4383
|
let r = n.map(f);
|
|
4367
4384
|
a.value = n, o.value = r, c("check", n, r);
|
|
4368
4385
|
}
|
|
4369
|
-
function
|
|
4386
|
+
function x(e) {
|
|
4370
4387
|
let t = [];
|
|
4371
4388
|
for (let [n, r] of d) r === e && t.push(n);
|
|
4372
4389
|
return t;
|
|
4373
4390
|
}
|
|
4374
|
-
function
|
|
4391
|
+
function S(e) {
|
|
4375
4392
|
let t = [];
|
|
4376
|
-
for (let n of
|
|
4393
|
+
for (let n of x(e)) t.push(n, ...S(n));
|
|
4377
4394
|
return t;
|
|
4378
4395
|
}
|
|
4379
|
-
function
|
|
4396
|
+
function C(e) {
|
|
4380
4397
|
let t = /* @__PURE__ */ new Set([
|
|
4381
4398
|
...a.value,
|
|
4382
4399
|
e,
|
|
4383
|
-
...
|
|
4400
|
+
...S(e)
|
|
4384
4401
|
]), n = d.get(e);
|
|
4385
|
-
for (; n !== void 0 &&
|
|
4402
|
+
for (; n !== void 0 && x(n).every((e) => t.has(e));) t.add(n), n = d.get(n);
|
|
4386
4403
|
return [...t];
|
|
4387
4404
|
}
|
|
4388
|
-
function
|
|
4389
|
-
let t = /* @__PURE__ */ new Set([e, ...
|
|
4405
|
+
function w(e) {
|
|
4406
|
+
let t = /* @__PURE__ */ new Set([e, ...S(e)]), n = d.get(e);
|
|
4390
4407
|
for (; n !== void 0;) t.add(n), n = d.get(n);
|
|
4391
4408
|
return a.value.filter((e) => !t.has(e));
|
|
4392
4409
|
}
|
|
4393
|
-
function
|
|
4410
|
+
function T(e) {
|
|
4394
4411
|
let t = new Set(e);
|
|
4395
|
-
for (let n of e) for (let e of
|
|
4412
|
+
for (let n of e) for (let e of S(n)) t.add(e);
|
|
4396
4413
|
let n = !0;
|
|
4397
4414
|
for (; n;) {
|
|
4398
4415
|
n = !1;
|
|
4399
|
-
for (let [, e] of d) e === void 0 || t.has(e) ||
|
|
4416
|
+
for (let [, e] of d) e === void 0 || t.has(e) || x(e).every((e) => t.has(e)) && (t.add(e), n = !0);
|
|
4400
4417
|
}
|
|
4401
4418
|
return [...t];
|
|
4402
4419
|
}
|
|
4403
|
-
let
|
|
4420
|
+
let E = D(() => {
|
|
4404
4421
|
let e = /* @__PURE__ */ new Set();
|
|
4405
4422
|
if (!l.strict) return e;
|
|
4406
4423
|
let t = new Set(a.value);
|
|
@@ -4411,7 +4428,11 @@ var Sn = ["data-index"], Cn = /* @__PURE__ */ F({
|
|
|
4411
4428
|
return e;
|
|
4412
4429
|
});
|
|
4413
4430
|
ce(() => {
|
|
4414
|
-
l.strict && a.value.length > 0 && (a.value =
|
|
4431
|
+
if (l.strict && a.value.length > 0 && (a.value = T(a.value)), n.value !== void 0 && r.value.length === 0) {
|
|
4432
|
+
let e = f(n.value);
|
|
4433
|
+
e.length > 0 && (r.value = e, h(e));
|
|
4434
|
+
} else h(r.value);
|
|
4435
|
+
a.value.length > 0 && o.value.length === 0 && (o.value = a.value.map(f));
|
|
4415
4436
|
}), X(n, (e) => {
|
|
4416
4437
|
if (e === r.value[r.value.length - 1]) return;
|
|
4417
4438
|
if (e === void 0) {
|
|
@@ -4419,10 +4440,10 @@ var Sn = ["data-index"], Cn = /* @__PURE__ */ F({
|
|
|
4419
4440
|
return;
|
|
4420
4441
|
}
|
|
4421
4442
|
let t = f(e);
|
|
4422
|
-
t.length > 0 && (r.value = t);
|
|
4443
|
+
t.length > 0 && (r.value = t, h(t));
|
|
4423
4444
|
}), X(r, (e) => {
|
|
4424
4445
|
let t = e[e.length - 1];
|
|
4425
|
-
n.value !== t && (n.value = t);
|
|
4446
|
+
n.value !== t && (n.value = t), h(e);
|
|
4426
4447
|
}), X(a, (e) => {
|
|
4427
4448
|
if (m(e, o.value.map((e) => e[e.length - 1]))) return;
|
|
4428
4449
|
let t = e.map(f);
|
|
@@ -4431,24 +4452,24 @@ var Sn = ["data-index"], Cn = /* @__PURE__ */ F({
|
|
|
4431
4452
|
let t = e.map((e) => e[e.length - 1]);
|
|
4432
4453
|
m(t, a.value) || (a.value = t);
|
|
4433
4454
|
});
|
|
4434
|
-
function
|
|
4435
|
-
d.set(e, t);
|
|
4455
|
+
function ee(e, t) {
|
|
4456
|
+
d.set(e, t), _();
|
|
4436
4457
|
}
|
|
4437
|
-
function
|
|
4458
|
+
function O(e) {
|
|
4438
4459
|
d.delete(e);
|
|
4439
4460
|
}
|
|
4440
4461
|
return In({
|
|
4441
4462
|
modelValue: n,
|
|
4442
4463
|
expandedKeys: i,
|
|
4443
4464
|
selectedKeys: a,
|
|
4444
|
-
indeterminateKeys:
|
|
4465
|
+
indeterminateKeys: E,
|
|
4445
4466
|
selection: _e(() => l.selection),
|
|
4446
4467
|
accordion: _e(() => l.accordion),
|
|
4447
|
-
setSelected:
|
|
4448
|
-
toggleExpand:
|
|
4449
|
-
toggleChecked:
|
|
4450
|
-
registerNode:
|
|
4451
|
-
unregisterNode:
|
|
4468
|
+
setSelected: v,
|
|
4469
|
+
toggleExpand: y,
|
|
4470
|
+
toggleChecked: b,
|
|
4471
|
+
registerNode: ee,
|
|
4472
|
+
unregisterNode: O
|
|
4452
4473
|
}), (e, t) => (B(), A("div", {
|
|
4453
4474
|
class: R(["st-tree-group", u.value]),
|
|
4454
4475
|
style: z(G(s).style)
|
|
@@ -4876,17 +4897,17 @@ var Jn = ["for"], Yn = /* @__PURE__ */ F({
|
|
|
4876
4897
|
] }
|
|
4877
4898
|
},
|
|
4878
4899
|
setup(e, { emit: t }) {
|
|
4879
|
-
let n = K(), r = J(), i = Ln(), a = e, o = D(() => a.node[a.valueKey]), s = D(() => String(a.node[a.labelKey] ?? "")), c = D(() => a.node[a.childrenKey] ?? []), l = D(() => i?.selection.value ?? !1), u = D(() => !!r.action), d = D(() => !!r.arrow), f = D(() => c.value.length > 0),
|
|
4900
|
+
let n = K(), r = J(), i = Ln(), a = e, o = D(() => a.node[a.valueKey]), s = D(() => String(a.node[a.labelKey] ?? "")), c = D(() => a.node[a.childrenKey] ?? []), l = D(() => i?.selection.value ?? !1), u = D(() => !!r.action), d = D(() => !!r.arrow), f = D(() => Object.keys(r)), p = D(() => c.value.length > 0), m = D(() => !!a.node.disabled);
|
|
4880
4901
|
return (e, t) => {
|
|
4881
4902
|
let r = pe("st-tree-node", !0);
|
|
4882
4903
|
return B(), O(tr, {
|
|
4883
|
-
disabled:
|
|
4904
|
+
disabled: m.value,
|
|
4884
4905
|
indent: a.indent,
|
|
4885
4906
|
value: o.value
|
|
4886
4907
|
}, {
|
|
4887
4908
|
default: Z(() => [P(Vn, {
|
|
4888
4909
|
class: R(["st-tree-node", G(n).class]),
|
|
4889
|
-
disabled:
|
|
4910
|
+
disabled: m.value,
|
|
4890
4911
|
style: z(G(n).style),
|
|
4891
4912
|
value: o.value
|
|
4892
4913
|
}, {
|
|
@@ -4929,12 +4950,15 @@ var Jn = ["for"], Yn = /* @__PURE__ */ F({
|
|
|
4929
4950
|
"disabled",
|
|
4930
4951
|
"style",
|
|
4931
4952
|
"value"
|
|
4932
|
-
]),
|
|
4933
|
-
default: Z(() => [(B(!0), A(w, null, H(c.value, (
|
|
4934
|
-
key:
|
|
4935
|
-
node:
|
|
4936
|
-
}),
|
|
4937
|
-
|
|
4953
|
+
]), p.value ? (B(), O(er, { key: 0 }, {
|
|
4954
|
+
default: Z(() => [(B(!0), A(w, null, H(c.value, (t) => (B(), O(r, ae({ ref_for: !0 }, a, {
|
|
4955
|
+
key: t[a.valueKey],
|
|
4956
|
+
node: t
|
|
4957
|
+
}), M({ _: 2 }, [H(f.value, (t) => ({
|
|
4958
|
+
name: t,
|
|
4959
|
+
fn: Z((n) => [U(e.$slots, t, ae({ ref_for: !0 }, n))])
|
|
4960
|
+
}))]), 1040, ["node"]))), 128))]),
|
|
4961
|
+
_: 3
|
|
4938
4962
|
})) : k("", !0)]),
|
|
4939
4963
|
_: 3
|
|
4940
4964
|
}, 8, [
|
|
@@ -5063,6 +5087,10 @@ var Jn = ["for"], Yn = /* @__PURE__ */ F({
|
|
|
5063
5087
|
type: Boolean,
|
|
5064
5088
|
default: !1
|
|
5065
5089
|
},
|
|
5090
|
+
expandParent: {
|
|
5091
|
+
type: Boolean,
|
|
5092
|
+
default: !0
|
|
5093
|
+
},
|
|
5066
5094
|
autoChange: {
|
|
5067
5095
|
type: Boolean,
|
|
5068
5096
|
default: !1
|
|
@@ -5263,6 +5291,7 @@ var Jn = ["for"], Yn = /* @__PURE__ */ F({
|
|
|
5263
5291
|
"onUpdate:selectedPaths": t[4] ||= (e) => d.value = e,
|
|
5264
5292
|
accordion: o.accordion,
|
|
5265
5293
|
"expand-on-click": o.expandOnClick,
|
|
5294
|
+
"expand-parent": o.expandParent,
|
|
5266
5295
|
selection: o.selection,
|
|
5267
5296
|
strict: o.strict,
|
|
5268
5297
|
style: z(G(r).style),
|
|
@@ -5305,6 +5334,7 @@ var Jn = ["for"], Yn = /* @__PURE__ */ F({
|
|
|
5305
5334
|
"accordion",
|
|
5306
5335
|
"class",
|
|
5307
5336
|
"expand-on-click",
|
|
5337
|
+
"expand-parent",
|
|
5308
5338
|
"selection",
|
|
5309
5339
|
"strict",
|
|
5310
5340
|
"style"
|
|
@@ -5427,72 +5457,76 @@ var Jn = ["for"], Yn = /* @__PURE__ */ F({
|
|
|
5427
5457
|
function S(e) {
|
|
5428
5458
|
return e.length === 0 ? "" : x(u.showPath ? e : e.slice(-1));
|
|
5429
5459
|
}
|
|
5430
|
-
|
|
5431
|
-
|
|
5460
|
+
function C(e) {
|
|
5461
|
+
let t = b(e);
|
|
5462
|
+
return t.length > 0 ? S(t) : String(e);
|
|
5463
|
+
}
|
|
5464
|
+
let w = D(() => u.multiple ? (a.value.length > 0 ? a.value.map((e) => C(e)) : o.value.map((e) => S(e))).filter((e) => e.length > 0).join(", ") : r.value === void 0 ? S(i.value) : C(r.value)), T = D(() => u.placeholder || "请选择"), E = D(() => !u.clearable || u.disabled || !m.value ? !1 : w.value.length > 0), ee = D(() => u.popoverStyle ? u.popoverStyle : h.value > 0 ? { minWidth: `${h.value}px` } : {});
|
|
5465
|
+
function k() {
|
|
5432
5466
|
u.multiple || (g.value = [...i.value], i.value.length > 0 && (_.value = [.../* @__PURE__ */ new Set([..._.value, ...i.value.slice(0, -1)])])), u.defaultExpandedAll && (_.value = [...v.value.values()].filter((e) => !e.isLeaf).map((e) => e.path[e.path.length - 1]));
|
|
5433
5467
|
}
|
|
5434
|
-
function
|
|
5468
|
+
function A(e) {
|
|
5435
5469
|
if (f.value = e, l("visibleChange", e), e) {
|
|
5436
5470
|
let e = d.value?.$el;
|
|
5437
|
-
e && (h.value = e.getBoundingClientRect().width),
|
|
5471
|
+
e && (h.value = e.getBoundingClientRect().width), k();
|
|
5438
5472
|
}
|
|
5439
5473
|
}
|
|
5440
|
-
function
|
|
5474
|
+
function N(e, t, n) {
|
|
5441
5475
|
let a = v.value.get(e);
|
|
5442
5476
|
a && (a.isLeaf || !u.multiple && !u.strict) && (i.value = n.length > 0 ? [...n] : [...a.path], r.value = e, l("change", e), f.value = !1);
|
|
5443
5477
|
}
|
|
5444
|
-
function
|
|
5478
|
+
function F(e, t) {
|
|
5445
5479
|
let n = t.filter((e) => e.length > 0).map((e) => [...e]);
|
|
5446
5480
|
o.value = n, a.value = [...e], l("change", [...e]);
|
|
5447
5481
|
}
|
|
5448
|
-
function F() {
|
|
5449
|
-
u.multiple ? (o.value = [], a.value = [], l("change", [])) : (i.value = [], r.value = void 0, l("change", void 0)), g.value = [], l("clear");
|
|
5450
|
-
}
|
|
5451
5482
|
function ne() {
|
|
5452
|
-
|
|
5483
|
+
u.multiple ? (o.value = [], a.value = [], l("change", [])) : (i.value = [], r.value = void 0, l("change", void 0)), g.value = [], l("clear");
|
|
5453
5484
|
}
|
|
5454
5485
|
function re() {
|
|
5455
|
-
d.value?.
|
|
5486
|
+
d.value?.focus();
|
|
5456
5487
|
}
|
|
5457
5488
|
function ie() {
|
|
5458
|
-
|
|
5489
|
+
d.value?.blur();
|
|
5459
5490
|
}
|
|
5460
5491
|
function I() {
|
|
5461
|
-
|
|
5492
|
+
ne();
|
|
5462
5493
|
}
|
|
5463
5494
|
function ae() {
|
|
5495
|
+
u.disabled || (f.value = !0);
|
|
5496
|
+
}
|
|
5497
|
+
function L() {
|
|
5464
5498
|
f.value = !1;
|
|
5465
5499
|
}
|
|
5466
5500
|
return t({
|
|
5467
|
-
focus:
|
|
5468
|
-
blur:
|
|
5469
|
-
clear:
|
|
5470
|
-
open:
|
|
5471
|
-
close:
|
|
5501
|
+
focus: re,
|
|
5502
|
+
blur: ie,
|
|
5503
|
+
clear: I,
|
|
5504
|
+
open: ae,
|
|
5505
|
+
close: L
|
|
5472
5506
|
}), (e, t) => (B(), O(Jt, {
|
|
5473
5507
|
visible: f.value,
|
|
5474
5508
|
"onUpdate:visible": t[5] ||= (e) => f.value = e,
|
|
5475
5509
|
"content-class": u.popoverClass,
|
|
5476
|
-
"content-style":
|
|
5510
|
+
"content-style": ee.value,
|
|
5477
5511
|
disabled: u.disabled,
|
|
5478
5512
|
"show-arrow": !1,
|
|
5479
5513
|
placement: "bottom-left",
|
|
5480
5514
|
trigger: "click",
|
|
5481
|
-
onVisibleChange:
|
|
5515
|
+
onVisibleChange: A
|
|
5482
5516
|
}, {
|
|
5483
5517
|
trigger: Z(() => [P(dn, {
|
|
5484
5518
|
ref_key: "inputRef",
|
|
5485
5519
|
ref: d,
|
|
5486
5520
|
class: R(G(p)("st-cascade-desktop", { "st-cascade-desktop--focused": f.value }, G(s).class)),
|
|
5487
|
-
clearable:
|
|
5521
|
+
clearable: E.value,
|
|
5488
5522
|
disabled: u.disabled,
|
|
5489
5523
|
"floating-label": u.floatingLabel,
|
|
5490
|
-
"model-value":
|
|
5491
|
-
placeholder:
|
|
5524
|
+
"model-value": w.value,
|
|
5525
|
+
placeholder: T.value,
|
|
5492
5526
|
size: u.size,
|
|
5493
5527
|
style: z(G(s).style),
|
|
5494
5528
|
readonly: "",
|
|
5495
|
-
onClear:
|
|
5529
|
+
onClear: ne,
|
|
5496
5530
|
onMouseenter: t[0] ||= (e) => m.value = !0,
|
|
5497
5531
|
onMouseleave: t[1] ||= (e) => m.value = !1
|
|
5498
5532
|
}, M({
|
|
@@ -5532,11 +5566,13 @@ var Jn = ["for"], Yn = /* @__PURE__ */ F({
|
|
|
5532
5566
|
"expand-on-click": y.value,
|
|
5533
5567
|
"label-key": u.labelKey,
|
|
5534
5568
|
list: u.list,
|
|
5569
|
+
"model-value": r.value,
|
|
5570
|
+
"selected-keys": a.value,
|
|
5535
5571
|
selection: u.multiple,
|
|
5536
5572
|
strict: u.strict,
|
|
5537
5573
|
"value-key": u.valueKey,
|
|
5538
|
-
onChange:
|
|
5539
|
-
onCheck:
|
|
5574
|
+
onChange: N,
|
|
5575
|
+
onCheck: F
|
|
5540
5576
|
}, M({ _: 2 }, [c.label ? {
|
|
5541
5577
|
name: "label",
|
|
5542
5578
|
fn: Z((t) => [U(e.$slots, "label", oe(te(t)))]),
|
|
@@ -5549,6 +5585,8 @@ var Jn = ["for"], Yn = /* @__PURE__ */ F({
|
|
|
5549
5585
|
"expand-on-click",
|
|
5550
5586
|
"label-key",
|
|
5551
5587
|
"list",
|
|
5588
|
+
"model-value",
|
|
5589
|
+
"selected-keys",
|
|
5552
5590
|
"selection",
|
|
5553
5591
|
"strict",
|
|
5554
5592
|
"value-key"
|
|
@@ -7728,17 +7766,22 @@ var ri = /* @__PURE__ */ F({
|
|
|
7728
7766
|
let t = e[e.length - 1], n = (t === void 0 ? void 0 : d.value.get(t))?.isLeaf ?? !1;
|
|
7729
7767
|
x.value = n ? Math.max(0, e.length - 1) : e.length;
|
|
7730
7768
|
});
|
|
7731
|
-
let T = D(() => u.columnHeight)
|
|
7732
|
-
function
|
|
7733
|
-
|
|
7769
|
+
let T = D(() => u.columnHeight);
|
|
7770
|
+
function E(e) {
|
|
7771
|
+
let t = h(e);
|
|
7772
|
+
return t.length > 0 ? m(t) : String(e);
|
|
7734
7773
|
}
|
|
7774
|
+
let ee = D(() => u.multiple ? (a.value.length > 0 ? a.value.map((e) => E(e)) : o.value.map((e) => m(e))).filter((e) => e.length > 0).join(", ") : r.value === void 0 ? m(i.value) : E(r.value)), k = D(() => u.placeholder || "请选择"), A = D(() => !u.clearable || u.disabled || !v.value ? !1 : ee.value.length > 0), F = D(() => u.multiple ? !0 : u.strict ? C.value?.isLeaf ?? !1 : S.value.length > 0);
|
|
7735
7775
|
function ne() {
|
|
7736
|
-
|
|
7776
|
+
y.value = [...i.value], b.value = o.value.map((e) => [...e]);
|
|
7737
7777
|
}
|
|
7738
7778
|
function re() {
|
|
7739
|
-
l("visibleChange", !
|
|
7779
|
+
l("visibleChange", !0);
|
|
7740
7780
|
}
|
|
7741
7781
|
function ie() {
|
|
7782
|
+
l("visibleChange", !1);
|
|
7783
|
+
}
|
|
7784
|
+
function I() {
|
|
7742
7785
|
if (u.multiple) {
|
|
7743
7786
|
let e = b.value.map((e) => [...e]), t = e.map((e) => e[e.length - 1]);
|
|
7744
7787
|
o.value = e, a.value = t, l("change", [...t]), l("confirm", [...t]);
|
|
@@ -7748,36 +7791,36 @@ var ri = /* @__PURE__ */ F({
|
|
|
7748
7791
|
}
|
|
7749
7792
|
_.value = !1;
|
|
7750
7793
|
}
|
|
7751
|
-
function I() {
|
|
7752
|
-
l("cancel"), _.value = !1;
|
|
7753
|
-
}
|
|
7754
7794
|
function ae() {
|
|
7755
|
-
|
|
7795
|
+
l("cancel"), _.value = !1;
|
|
7756
7796
|
}
|
|
7757
7797
|
function L() {
|
|
7758
|
-
|
|
7798
|
+
u.multiple ? (o.value = [], a.value = [], l("change", [])) : (i.value = [], r.value = void 0, l("change", void 0)), l("clear");
|
|
7759
7799
|
}
|
|
7760
7800
|
function se() {
|
|
7761
|
-
g.value?.
|
|
7801
|
+
g.value?.focus();
|
|
7762
7802
|
}
|
|
7763
7803
|
function ce() {
|
|
7764
|
-
|
|
7804
|
+
g.value?.blur();
|
|
7765
7805
|
}
|
|
7766
7806
|
function le() {
|
|
7767
|
-
|
|
7807
|
+
L();
|
|
7768
7808
|
}
|
|
7769
7809
|
function ue() {
|
|
7770
|
-
|
|
7810
|
+
u.disabled || (ne(), _.value = !0);
|
|
7771
7811
|
}
|
|
7772
7812
|
function de() {
|
|
7813
|
+
ue();
|
|
7814
|
+
}
|
|
7815
|
+
function fe() {
|
|
7773
7816
|
_.value = !1;
|
|
7774
7817
|
}
|
|
7775
7818
|
return t({
|
|
7776
|
-
focus:
|
|
7777
|
-
blur:
|
|
7778
|
-
clear:
|
|
7779
|
-
open:
|
|
7780
|
-
close:
|
|
7819
|
+
focus: se,
|
|
7820
|
+
blur: ce,
|
|
7821
|
+
clear: le,
|
|
7822
|
+
open: de,
|
|
7823
|
+
close: fe
|
|
7781
7824
|
}), (e, t) => (B(), O(pi, {
|
|
7782
7825
|
"active-path": S.value,
|
|
7783
7826
|
"onUpdate:activePath": t[4] ||= (e) => S.value = e,
|
|
@@ -7798,16 +7841,16 @@ var ri = /* @__PURE__ */ F({
|
|
|
7798
7841
|
ref_key: "inputRef",
|
|
7799
7842
|
ref: g,
|
|
7800
7843
|
class: R(G(p)("st-cascade-phone", G(s).class)),
|
|
7801
|
-
clearable:
|
|
7844
|
+
clearable: A.value,
|
|
7802
7845
|
disabled: u.disabled,
|
|
7803
7846
|
"floating-label": u.floatingLabel,
|
|
7804
|
-
"model-value":
|
|
7805
|
-
placeholder:
|
|
7847
|
+
"model-value": ee.value,
|
|
7848
|
+
placeholder: k.value,
|
|
7806
7849
|
size: u.size,
|
|
7807
7850
|
style: z(G(s).style),
|
|
7808
7851
|
readonly: "",
|
|
7809
|
-
onClear:
|
|
7810
|
-
onClick:
|
|
7852
|
+
onClear: L,
|
|
7853
|
+
onClick: ue,
|
|
7811
7854
|
onMouseenter: t[0] ||= (e) => v.value = !0,
|
|
7812
7855
|
onMouseleave: t[1] ||= (e) => v.value = !1
|
|
7813
7856
|
}, M({
|
|
@@ -7838,23 +7881,23 @@ var ri = /* @__PURE__ */ F({
|
|
|
7838
7881
|
title: u.title,
|
|
7839
7882
|
closable: "",
|
|
7840
7883
|
placement: "bottom",
|
|
7841
|
-
onClose:
|
|
7842
|
-
onOpen:
|
|
7884
|
+
onClose: ie,
|
|
7885
|
+
onOpen: re
|
|
7843
7886
|
}, M({
|
|
7844
7887
|
footer: Z(() => [j("div", vi, [P(dt, {
|
|
7845
7888
|
class: "flex-1 min-w-0",
|
|
7846
7889
|
size: u.size,
|
|
7847
7890
|
color: "default",
|
|
7848
|
-
onClick:
|
|
7891
|
+
onClick: ae
|
|
7849
7892
|
}, {
|
|
7850
7893
|
default: Z(() => [N(W(u.cancelText), 1)]),
|
|
7851
7894
|
_: 1
|
|
7852
7895
|
}, 8, ["size"]), P(dt, {
|
|
7853
7896
|
class: "flex-1 min-w-0",
|
|
7854
|
-
disabled: !
|
|
7897
|
+
disabled: !F.value,
|
|
7855
7898
|
size: u.size,
|
|
7856
7899
|
color: "primary",
|
|
7857
|
-
onClick:
|
|
7900
|
+
onClick: I
|
|
7858
7901
|
}, {
|
|
7859
7902
|
default: Z(() => [N(W(u.confirmText), 1)]),
|
|
7860
7903
|
_: 1
|
|
@@ -22034,42 +22077,42 @@ var dh = /* @__PURE__ */ F({
|
|
|
22034
22077
|
setup(e, { expose: t, emit: n }) {
|
|
22035
22078
|
let r = e;
|
|
22036
22079
|
J();
|
|
22037
|
-
let i = n, a = K(),
|
|
22038
|
-
Object.assign(
|
|
22039
|
-
splitterClass:
|
|
22040
|
-
splitterStyle:
|
|
22041
|
-
handleClass:
|
|
22042
|
-
handleStyle:
|
|
22043
|
-
gutterClass:
|
|
22044
|
-
}), ah(
|
|
22045
|
-
t !== null && e === null && i("resize",
|
|
22080
|
+
let i = n, a = K(), s = Y("containerRef"), c = _e(r, "direction"), l = _e(r, "showCollapseButton"), u = _e(r, "splitterClass"), d = _e(r, "splitterStyle"), f = _e(r, "handleClass"), m = _e(r, "handleStyle"), h = _e(r, "gutterClass"), g = uh(c, l);
|
|
22081
|
+
Object.assign(g, {
|
|
22082
|
+
splitterClass: u,
|
|
22083
|
+
splitterStyle: d,
|
|
22084
|
+
handleClass: f,
|
|
22085
|
+
handleStyle: m,
|
|
22086
|
+
gutterClass: h
|
|
22087
|
+
}), ah(g), X(() => g.activeGutter.value, (e, t) => {
|
|
22088
|
+
t !== null && e === null && i("resize", g.panels.value.map((e) => ({ ...e })));
|
|
22046
22089
|
}), ce(() => {
|
|
22047
22090
|
requestAnimationFrame(() => {
|
|
22048
22091
|
requestAnimationFrame(() => {
|
|
22049
|
-
|
|
22092
|
+
g.initializePanelSizes(s.value);
|
|
22050
22093
|
});
|
|
22051
|
-
})
|
|
22052
|
-
}),
|
|
22053
|
-
|
|
22094
|
+
});
|
|
22095
|
+
}), o(s, () => {
|
|
22096
|
+
g.updateFlexPanelSize();
|
|
22054
22097
|
});
|
|
22055
|
-
function
|
|
22056
|
-
return
|
|
22098
|
+
function _() {
|
|
22099
|
+
return g.panels.value.map((e) => ({ ...e }));
|
|
22057
22100
|
}
|
|
22058
|
-
function
|
|
22059
|
-
let n =
|
|
22060
|
-
n && (n.size = t, n.desiredSize = t,
|
|
22101
|
+
function v(e, t) {
|
|
22102
|
+
let n = g.panels.value.find((t) => t.id === e);
|
|
22103
|
+
n && (n.size = t, n.desiredSize = t, g.updateFlexPanelSize());
|
|
22061
22104
|
}
|
|
22062
|
-
function
|
|
22063
|
-
|
|
22105
|
+
function y() {
|
|
22106
|
+
g.initializePanelSizes(null);
|
|
22064
22107
|
}
|
|
22065
22108
|
return t({
|
|
22066
|
-
getPanels:
|
|
22067
|
-
setPanelSize:
|
|
22068
|
-
resetSizes:
|
|
22109
|
+
getPanels: _,
|
|
22110
|
+
setPanelSize: v,
|
|
22111
|
+
resetSizes: y
|
|
22069
22112
|
}), (e, t) => (B(), A("div", {
|
|
22070
22113
|
ref_key: "containerRef",
|
|
22071
|
-
ref:
|
|
22072
|
-
class: R(G(p)("flex w-full h-full overflow-hidden box-border gap-0", G(
|
|
22114
|
+
ref: s,
|
|
22115
|
+
class: R(G(p)("flex w-full h-full overflow-hidden box-border gap-0", G(g).direction.value === "horizontal" ? "flex-row" : "flex-col", G(a).class, r.splitterClass)),
|
|
22073
22116
|
style: z([G(a).style, r.splitterStyle])
|
|
22074
22117
|
}, [U(e.$slots, "default")], 6));
|
|
22075
22118
|
}
|