straw-ui-vue 0.1.56 → 0.1.58
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 +81 -54
- 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)
|
|
@@ -5066,6 +5087,10 @@ var Jn = ["for"], Yn = /* @__PURE__ */ F({
|
|
|
5066
5087
|
type: Boolean,
|
|
5067
5088
|
default: !1
|
|
5068
5089
|
},
|
|
5090
|
+
expandParent: {
|
|
5091
|
+
type: Boolean,
|
|
5092
|
+
default: !0
|
|
5093
|
+
},
|
|
5069
5094
|
autoChange: {
|
|
5070
5095
|
type: Boolean,
|
|
5071
5096
|
default: !1
|
|
@@ -5266,6 +5291,7 @@ var Jn = ["for"], Yn = /* @__PURE__ */ F({
|
|
|
5266
5291
|
"onUpdate:selectedPaths": t[4] ||= (e) => d.value = e,
|
|
5267
5292
|
accordion: o.accordion,
|
|
5268
5293
|
"expand-on-click": o.expandOnClick,
|
|
5294
|
+
"expand-parent": o.expandParent,
|
|
5269
5295
|
selection: o.selection,
|
|
5270
5296
|
strict: o.strict,
|
|
5271
5297
|
style: z(G(r).style),
|
|
@@ -5308,6 +5334,7 @@ var Jn = ["for"], Yn = /* @__PURE__ */ F({
|
|
|
5308
5334
|
"accordion",
|
|
5309
5335
|
"class",
|
|
5310
5336
|
"expand-on-click",
|
|
5337
|
+
"expand-parent",
|
|
5311
5338
|
"selection",
|
|
5312
5339
|
"strict",
|
|
5313
5340
|
"style"
|
|
@@ -9124,7 +9151,7 @@ var ma = /* @__PURE__ */ F({
|
|
|
9124
9151
|
className: "w-120"
|
|
9125
9152
|
}, {
|
|
9126
9153
|
variants: { fullscreen: !0 },
|
|
9127
|
-
className: "inset-0 w-full! h-full!"
|
|
9154
|
+
className: "inset-0 w-full! h-full! max-w-none! max-h-none!"
|
|
9128
9155
|
}]
|
|
9129
9156
|
}), u = D(() => p(l({
|
|
9130
9157
|
fullscreen: i.fullscreen,
|
|
@@ -22050,42 +22077,42 @@ var dh = /* @__PURE__ */ F({
|
|
|
22050
22077
|
setup(e, { expose: t, emit: n }) {
|
|
22051
22078
|
let r = e;
|
|
22052
22079
|
J();
|
|
22053
|
-
let i = n, a = K(),
|
|
22054
|
-
Object.assign(
|
|
22055
|
-
splitterClass:
|
|
22056
|
-
splitterStyle:
|
|
22057
|
-
handleClass:
|
|
22058
|
-
handleStyle:
|
|
22059
|
-
gutterClass:
|
|
22060
|
-
}), ah(
|
|
22061
|
-
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 })));
|
|
22062
22089
|
}), ce(() => {
|
|
22063
22090
|
requestAnimationFrame(() => {
|
|
22064
22091
|
requestAnimationFrame(() => {
|
|
22065
|
-
|
|
22092
|
+
g.initializePanelSizes(s.value);
|
|
22066
22093
|
});
|
|
22067
|
-
})
|
|
22068
|
-
}),
|
|
22069
|
-
|
|
22094
|
+
});
|
|
22095
|
+
}), o(s, () => {
|
|
22096
|
+
g.updateFlexPanelSize();
|
|
22070
22097
|
});
|
|
22071
|
-
function
|
|
22072
|
-
return
|
|
22098
|
+
function _() {
|
|
22099
|
+
return g.panels.value.map((e) => ({ ...e }));
|
|
22073
22100
|
}
|
|
22074
|
-
function
|
|
22075
|
-
let n =
|
|
22076
|
-
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());
|
|
22077
22104
|
}
|
|
22078
|
-
function
|
|
22079
|
-
|
|
22105
|
+
function y() {
|
|
22106
|
+
g.initializePanelSizes(null);
|
|
22080
22107
|
}
|
|
22081
22108
|
return t({
|
|
22082
|
-
getPanels:
|
|
22083
|
-
setPanelSize:
|
|
22084
|
-
resetSizes:
|
|
22109
|
+
getPanels: _,
|
|
22110
|
+
setPanelSize: v,
|
|
22111
|
+
resetSizes: y
|
|
22085
22112
|
}), (e, t) => (B(), A("div", {
|
|
22086
22113
|
ref_key: "containerRef",
|
|
22087
|
-
ref:
|
|
22088
|
-
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)),
|
|
22089
22116
|
style: z([G(a).style, r.splitterStyle])
|
|
22090
22117
|
}, [U(e.$slots, "default")], 6));
|
|
22091
22118
|
}
|