straw-ui-vue 0.1.55 → 0.1.56
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/straw-ui.js +80 -64
- package/package.json +1 -1
package/dist/straw-ui.js
CHANGED
|
@@ -4876,17 +4876,17 @@ var Jn = ["for"], Yn = /* @__PURE__ */ F({
|
|
|
4876
4876
|
] }
|
|
4877
4877
|
},
|
|
4878
4878
|
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),
|
|
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(() => Object.keys(r)), p = D(() => c.value.length > 0), m = D(() => !!a.node.disabled);
|
|
4880
4880
|
return (e, t) => {
|
|
4881
4881
|
let r = pe("st-tree-node", !0);
|
|
4882
4882
|
return B(), O(tr, {
|
|
4883
|
-
disabled:
|
|
4883
|
+
disabled: m.value,
|
|
4884
4884
|
indent: a.indent,
|
|
4885
4885
|
value: o.value
|
|
4886
4886
|
}, {
|
|
4887
4887
|
default: Z(() => [P(Vn, {
|
|
4888
4888
|
class: R(["st-tree-node", G(n).class]),
|
|
4889
|
-
disabled:
|
|
4889
|
+
disabled: m.value,
|
|
4890
4890
|
style: z(G(n).style),
|
|
4891
4891
|
value: o.value
|
|
4892
4892
|
}, {
|
|
@@ -4929,12 +4929,15 @@ var Jn = ["for"], Yn = /* @__PURE__ */ F({
|
|
|
4929
4929
|
"disabled",
|
|
4930
4930
|
"style",
|
|
4931
4931
|
"value"
|
|
4932
|
-
]),
|
|
4933
|
-
default: Z(() => [(B(!0), A(w, null, H(c.value, (
|
|
4934
|
-
key:
|
|
4935
|
-
node:
|
|
4936
|
-
}),
|
|
4937
|
-
|
|
4932
|
+
]), p.value ? (B(), O(er, { key: 0 }, {
|
|
4933
|
+
default: Z(() => [(B(!0), A(w, null, H(c.value, (t) => (B(), O(r, ae({ ref_for: !0 }, a, {
|
|
4934
|
+
key: t[a.valueKey],
|
|
4935
|
+
node: t
|
|
4936
|
+
}), M({ _: 2 }, [H(f.value, (t) => ({
|
|
4937
|
+
name: t,
|
|
4938
|
+
fn: Z((n) => [U(e.$slots, t, ae({ ref_for: !0 }, n))])
|
|
4939
|
+
}))]), 1040, ["node"]))), 128))]),
|
|
4940
|
+
_: 3
|
|
4938
4941
|
})) : k("", !0)]),
|
|
4939
4942
|
_: 3
|
|
4940
4943
|
}, 8, [
|
|
@@ -5427,72 +5430,76 @@ var Jn = ["for"], Yn = /* @__PURE__ */ F({
|
|
|
5427
5430
|
function S(e) {
|
|
5428
5431
|
return e.length === 0 ? "" : x(u.showPath ? e : e.slice(-1));
|
|
5429
5432
|
}
|
|
5430
|
-
|
|
5431
|
-
|
|
5433
|
+
function C(e) {
|
|
5434
|
+
let t = b(e);
|
|
5435
|
+
return t.length > 0 ? S(t) : String(e);
|
|
5436
|
+
}
|
|
5437
|
+
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` } : {});
|
|
5438
|
+
function k() {
|
|
5432
5439
|
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
5440
|
}
|
|
5434
|
-
function
|
|
5441
|
+
function A(e) {
|
|
5435
5442
|
if (f.value = e, l("visibleChange", e), e) {
|
|
5436
5443
|
let e = d.value?.$el;
|
|
5437
|
-
e && (h.value = e.getBoundingClientRect().width),
|
|
5444
|
+
e && (h.value = e.getBoundingClientRect().width), k();
|
|
5438
5445
|
}
|
|
5439
5446
|
}
|
|
5440
|
-
function
|
|
5447
|
+
function N(e, t, n) {
|
|
5441
5448
|
let a = v.value.get(e);
|
|
5442
5449
|
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
5450
|
}
|
|
5444
|
-
function
|
|
5451
|
+
function F(e, t) {
|
|
5445
5452
|
let n = t.filter((e) => e.length > 0).map((e) => [...e]);
|
|
5446
5453
|
o.value = n, a.value = [...e], l("change", [...e]);
|
|
5447
5454
|
}
|
|
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
5455
|
function ne() {
|
|
5452
|
-
|
|
5456
|
+
u.multiple ? (o.value = [], a.value = [], l("change", [])) : (i.value = [], r.value = void 0, l("change", void 0)), g.value = [], l("clear");
|
|
5453
5457
|
}
|
|
5454
5458
|
function re() {
|
|
5455
|
-
d.value?.
|
|
5459
|
+
d.value?.focus();
|
|
5456
5460
|
}
|
|
5457
5461
|
function ie() {
|
|
5458
|
-
|
|
5462
|
+
d.value?.blur();
|
|
5459
5463
|
}
|
|
5460
5464
|
function I() {
|
|
5461
|
-
|
|
5465
|
+
ne();
|
|
5462
5466
|
}
|
|
5463
5467
|
function ae() {
|
|
5468
|
+
u.disabled || (f.value = !0);
|
|
5469
|
+
}
|
|
5470
|
+
function L() {
|
|
5464
5471
|
f.value = !1;
|
|
5465
5472
|
}
|
|
5466
5473
|
return t({
|
|
5467
|
-
focus:
|
|
5468
|
-
blur:
|
|
5469
|
-
clear:
|
|
5470
|
-
open:
|
|
5471
|
-
close:
|
|
5474
|
+
focus: re,
|
|
5475
|
+
blur: ie,
|
|
5476
|
+
clear: I,
|
|
5477
|
+
open: ae,
|
|
5478
|
+
close: L
|
|
5472
5479
|
}), (e, t) => (B(), O(Jt, {
|
|
5473
5480
|
visible: f.value,
|
|
5474
5481
|
"onUpdate:visible": t[5] ||= (e) => f.value = e,
|
|
5475
5482
|
"content-class": u.popoverClass,
|
|
5476
|
-
"content-style":
|
|
5483
|
+
"content-style": ee.value,
|
|
5477
5484
|
disabled: u.disabled,
|
|
5478
5485
|
"show-arrow": !1,
|
|
5479
5486
|
placement: "bottom-left",
|
|
5480
5487
|
trigger: "click",
|
|
5481
|
-
onVisibleChange:
|
|
5488
|
+
onVisibleChange: A
|
|
5482
5489
|
}, {
|
|
5483
5490
|
trigger: Z(() => [P(dn, {
|
|
5484
5491
|
ref_key: "inputRef",
|
|
5485
5492
|
ref: d,
|
|
5486
5493
|
class: R(G(p)("st-cascade-desktop", { "st-cascade-desktop--focused": f.value }, G(s).class)),
|
|
5487
|
-
clearable:
|
|
5494
|
+
clearable: E.value,
|
|
5488
5495
|
disabled: u.disabled,
|
|
5489
5496
|
"floating-label": u.floatingLabel,
|
|
5490
|
-
"model-value":
|
|
5491
|
-
placeholder:
|
|
5497
|
+
"model-value": w.value,
|
|
5498
|
+
placeholder: T.value,
|
|
5492
5499
|
size: u.size,
|
|
5493
5500
|
style: z(G(s).style),
|
|
5494
5501
|
readonly: "",
|
|
5495
|
-
onClear:
|
|
5502
|
+
onClear: ne,
|
|
5496
5503
|
onMouseenter: t[0] ||= (e) => m.value = !0,
|
|
5497
5504
|
onMouseleave: t[1] ||= (e) => m.value = !1
|
|
5498
5505
|
}, M({
|
|
@@ -5532,11 +5539,13 @@ var Jn = ["for"], Yn = /* @__PURE__ */ F({
|
|
|
5532
5539
|
"expand-on-click": y.value,
|
|
5533
5540
|
"label-key": u.labelKey,
|
|
5534
5541
|
list: u.list,
|
|
5542
|
+
"model-value": r.value,
|
|
5543
|
+
"selected-keys": a.value,
|
|
5535
5544
|
selection: u.multiple,
|
|
5536
5545
|
strict: u.strict,
|
|
5537
5546
|
"value-key": u.valueKey,
|
|
5538
|
-
onChange:
|
|
5539
|
-
onCheck:
|
|
5547
|
+
onChange: N,
|
|
5548
|
+
onCheck: F
|
|
5540
5549
|
}, M({ _: 2 }, [c.label ? {
|
|
5541
5550
|
name: "label",
|
|
5542
5551
|
fn: Z((t) => [U(e.$slots, "label", oe(te(t)))]),
|
|
@@ -5549,6 +5558,8 @@ var Jn = ["for"], Yn = /* @__PURE__ */ F({
|
|
|
5549
5558
|
"expand-on-click",
|
|
5550
5559
|
"label-key",
|
|
5551
5560
|
"list",
|
|
5561
|
+
"model-value",
|
|
5562
|
+
"selected-keys",
|
|
5552
5563
|
"selection",
|
|
5553
5564
|
"strict",
|
|
5554
5565
|
"value-key"
|
|
@@ -7728,17 +7739,22 @@ var ri = /* @__PURE__ */ F({
|
|
|
7728
7739
|
let t = e[e.length - 1], n = (t === void 0 ? void 0 : d.value.get(t))?.isLeaf ?? !1;
|
|
7729
7740
|
x.value = n ? Math.max(0, e.length - 1) : e.length;
|
|
7730
7741
|
});
|
|
7731
|
-
let T = D(() => u.columnHeight)
|
|
7732
|
-
function
|
|
7733
|
-
|
|
7742
|
+
let T = D(() => u.columnHeight);
|
|
7743
|
+
function E(e) {
|
|
7744
|
+
let t = h(e);
|
|
7745
|
+
return t.length > 0 ? m(t) : String(e);
|
|
7734
7746
|
}
|
|
7747
|
+
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
7748
|
function ne() {
|
|
7736
|
-
|
|
7749
|
+
y.value = [...i.value], b.value = o.value.map((e) => [...e]);
|
|
7737
7750
|
}
|
|
7738
7751
|
function re() {
|
|
7739
|
-
l("visibleChange", !
|
|
7752
|
+
l("visibleChange", !0);
|
|
7740
7753
|
}
|
|
7741
7754
|
function ie() {
|
|
7755
|
+
l("visibleChange", !1);
|
|
7756
|
+
}
|
|
7757
|
+
function I() {
|
|
7742
7758
|
if (u.multiple) {
|
|
7743
7759
|
let e = b.value.map((e) => [...e]), t = e.map((e) => e[e.length - 1]);
|
|
7744
7760
|
o.value = e, a.value = t, l("change", [...t]), l("confirm", [...t]);
|
|
@@ -7748,36 +7764,36 @@ var ri = /* @__PURE__ */ F({
|
|
|
7748
7764
|
}
|
|
7749
7765
|
_.value = !1;
|
|
7750
7766
|
}
|
|
7751
|
-
function I() {
|
|
7752
|
-
l("cancel"), _.value = !1;
|
|
7753
|
-
}
|
|
7754
7767
|
function ae() {
|
|
7755
|
-
|
|
7768
|
+
l("cancel"), _.value = !1;
|
|
7756
7769
|
}
|
|
7757
7770
|
function L() {
|
|
7758
|
-
|
|
7771
|
+
u.multiple ? (o.value = [], a.value = [], l("change", [])) : (i.value = [], r.value = void 0, l("change", void 0)), l("clear");
|
|
7759
7772
|
}
|
|
7760
7773
|
function se() {
|
|
7761
|
-
g.value?.
|
|
7774
|
+
g.value?.focus();
|
|
7762
7775
|
}
|
|
7763
7776
|
function ce() {
|
|
7764
|
-
|
|
7777
|
+
g.value?.blur();
|
|
7765
7778
|
}
|
|
7766
7779
|
function le() {
|
|
7767
|
-
|
|
7780
|
+
L();
|
|
7768
7781
|
}
|
|
7769
7782
|
function ue() {
|
|
7770
|
-
|
|
7783
|
+
u.disabled || (ne(), _.value = !0);
|
|
7771
7784
|
}
|
|
7772
7785
|
function de() {
|
|
7786
|
+
ue();
|
|
7787
|
+
}
|
|
7788
|
+
function fe() {
|
|
7773
7789
|
_.value = !1;
|
|
7774
7790
|
}
|
|
7775
7791
|
return t({
|
|
7776
|
-
focus:
|
|
7777
|
-
blur:
|
|
7778
|
-
clear:
|
|
7779
|
-
open:
|
|
7780
|
-
close:
|
|
7792
|
+
focus: se,
|
|
7793
|
+
blur: ce,
|
|
7794
|
+
clear: le,
|
|
7795
|
+
open: de,
|
|
7796
|
+
close: fe
|
|
7781
7797
|
}), (e, t) => (B(), O(pi, {
|
|
7782
7798
|
"active-path": S.value,
|
|
7783
7799
|
"onUpdate:activePath": t[4] ||= (e) => S.value = e,
|
|
@@ -7798,16 +7814,16 @@ var ri = /* @__PURE__ */ F({
|
|
|
7798
7814
|
ref_key: "inputRef",
|
|
7799
7815
|
ref: g,
|
|
7800
7816
|
class: R(G(p)("st-cascade-phone", G(s).class)),
|
|
7801
|
-
clearable:
|
|
7817
|
+
clearable: A.value,
|
|
7802
7818
|
disabled: u.disabled,
|
|
7803
7819
|
"floating-label": u.floatingLabel,
|
|
7804
|
-
"model-value":
|
|
7805
|
-
placeholder:
|
|
7820
|
+
"model-value": ee.value,
|
|
7821
|
+
placeholder: k.value,
|
|
7806
7822
|
size: u.size,
|
|
7807
7823
|
style: z(G(s).style),
|
|
7808
7824
|
readonly: "",
|
|
7809
|
-
onClear:
|
|
7810
|
-
onClick:
|
|
7825
|
+
onClear: L,
|
|
7826
|
+
onClick: ue,
|
|
7811
7827
|
onMouseenter: t[0] ||= (e) => v.value = !0,
|
|
7812
7828
|
onMouseleave: t[1] ||= (e) => v.value = !1
|
|
7813
7829
|
}, M({
|
|
@@ -7838,23 +7854,23 @@ var ri = /* @__PURE__ */ F({
|
|
|
7838
7854
|
title: u.title,
|
|
7839
7855
|
closable: "",
|
|
7840
7856
|
placement: "bottom",
|
|
7841
|
-
onClose:
|
|
7842
|
-
onOpen:
|
|
7857
|
+
onClose: ie,
|
|
7858
|
+
onOpen: re
|
|
7843
7859
|
}, M({
|
|
7844
7860
|
footer: Z(() => [j("div", vi, [P(dt, {
|
|
7845
7861
|
class: "flex-1 min-w-0",
|
|
7846
7862
|
size: u.size,
|
|
7847
7863
|
color: "default",
|
|
7848
|
-
onClick:
|
|
7864
|
+
onClick: ae
|
|
7849
7865
|
}, {
|
|
7850
7866
|
default: Z(() => [N(W(u.cancelText), 1)]),
|
|
7851
7867
|
_: 1
|
|
7852
7868
|
}, 8, ["size"]), P(dt, {
|
|
7853
7869
|
class: "flex-1 min-w-0",
|
|
7854
|
-
disabled: !
|
|
7870
|
+
disabled: !F.value,
|
|
7855
7871
|
size: u.size,
|
|
7856
7872
|
color: "primary",
|
|
7857
|
-
onClick:
|
|
7873
|
+
onClick: I
|
|
7858
7874
|
}, {
|
|
7859
7875
|
default: Z(() => [N(W(u.confirmText), 1)]),
|
|
7860
7876
|
_: 1
|