straw-ui-vue 0.1.51 → 0.1.52
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 +54 -51
- package/package.json +1 -1
package/dist/straw-ui.js
CHANGED
|
@@ -5046,27 +5046,27 @@ var Yn = ["for"], Xn = /* @__PURE__ */ F({
|
|
|
5046
5046
|
"update:selected"
|
|
5047
5047
|
]),
|
|
5048
5048
|
setup(e, { expose: t, emit: n }) {
|
|
5049
|
-
let r = K(), i = J(), a = n, o = e, s = q(e, "modelValue"), c = q(e, "path"), l = q(e, "expandedKeys"), u = q(e, "selectedKeys"), d = q(e, "selectedPaths"), f = q(e, "selected"), p = V(""), m = V(!1);
|
|
5050
|
-
function
|
|
5049
|
+
let r = K(), i = J(), a = n, o = e, s = q(e, "modelValue"), c = q(e, "path"), l = q(e, "expandedKeys"), u = q(e, "selectedKeys"), d = q(e, "selectedPaths"), f = q(e, "selected"), p = V(""), m = V(!1), h = D(() => Object.keys(i));
|
|
5050
|
+
function g(e) {
|
|
5051
5051
|
return e[o.valueKey];
|
|
5052
5052
|
}
|
|
5053
|
-
function
|
|
5053
|
+
function _(e) {
|
|
5054
5054
|
return e[o.childrenKey] ?? [];
|
|
5055
5055
|
}
|
|
5056
|
-
let
|
|
5056
|
+
let v = D(() => {
|
|
5057
5057
|
let e = /* @__PURE__ */ new Map(), t = (n) => {
|
|
5058
|
-
for (let r of n) e.set(
|
|
5058
|
+
for (let r of n) e.set(g(r), r), t(_(r));
|
|
5059
5059
|
};
|
|
5060
5060
|
return t(o.list), e;
|
|
5061
|
-
}),
|
|
5061
|
+
}), y = D(() => {
|
|
5062
5062
|
let e = [], t = (n) => {
|
|
5063
5063
|
for (let r of n) {
|
|
5064
|
-
let n =
|
|
5065
|
-
n.length > 0 && e.push(
|
|
5064
|
+
let n = _(r);
|
|
5065
|
+
n.length > 0 && e.push(g(r)), t(n);
|
|
5066
5066
|
}
|
|
5067
5067
|
};
|
|
5068
5068
|
return t(o.list), e;
|
|
5069
|
-
}),
|
|
5069
|
+
}), b = D(() => {
|
|
5070
5070
|
if (!o.filter || !p.value || !o.filterNodeMethod) return {
|
|
5071
5071
|
list: o.list,
|
|
5072
5072
|
keys: []
|
|
@@ -5074,8 +5074,8 @@ var Yn = ["for"], Xn = /* @__PURE__ */ F({
|
|
|
5074
5074
|
let e = [], t = (n) => {
|
|
5075
5075
|
let r = [];
|
|
5076
5076
|
for (let i of n) {
|
|
5077
|
-
let n =
|
|
5078
|
-
(o.filterNodeMethod(p.value, i) || a.length > 0) && (a.length > 0 ? (e.push(
|
|
5077
|
+
let n = _(i), a = t(n);
|
|
5078
|
+
(o.filterNodeMethod(p.value, i) || a.length > 0) && (a.length > 0 ? (e.push(g(i)), r.push({
|
|
5079
5079
|
...i,
|
|
5080
5080
|
[o.childrenKey]: a
|
|
5081
5081
|
})) : r.push(i));
|
|
@@ -5086,82 +5086,82 @@ var Yn = ["for"], Xn = /* @__PURE__ */ F({
|
|
|
5086
5086
|
list: t(o.list),
|
|
5087
5087
|
keys: e
|
|
5088
5088
|
};
|
|
5089
|
-
}),
|
|
5090
|
-
function x(e, t) {
|
|
5091
|
-
return e.length === t.length && e.every((e, n) => e === t[n]);
|
|
5092
|
-
}
|
|
5089
|
+
}), x = D(() => b.value.list);
|
|
5093
5090
|
function S(e, t) {
|
|
5094
5091
|
return e.length === t.length && e.every((e, n) => e === t[n]);
|
|
5095
5092
|
}
|
|
5096
|
-
function C() {
|
|
5097
|
-
|
|
5098
|
-
S(e, f.value) || (f.value = e);
|
|
5093
|
+
function C(e, t) {
|
|
5094
|
+
return e.length === t.length && e.every((e, n) => e === t[n]);
|
|
5099
5095
|
}
|
|
5100
5096
|
function T() {
|
|
5101
|
-
let e =
|
|
5102
|
-
|
|
5097
|
+
let e = u.value.map((e) => v.value.get(e)).filter((e) => !!e);
|
|
5098
|
+
C(e, f.value) || (f.value = e);
|
|
5103
5099
|
}
|
|
5104
|
-
|
|
5105
|
-
|
|
5100
|
+
function E() {
|
|
5101
|
+
let e = f.value.map((e) => g(e));
|
|
5102
|
+
S(e, u.value) || (u.value = e);
|
|
5103
|
+
}
|
|
5104
|
+
X(u, T), X(f, E), u.value.length > 0 ? T() : E(), D(() => [.../* @__PURE__ */ new Set([...l.value, ...b.value.keys])]);
|
|
5105
|
+
function ee(e) {
|
|
5106
5106
|
let t = [], n = (r, i) => {
|
|
5107
5107
|
for (let a of r) {
|
|
5108
|
-
let r =
|
|
5109
|
-
r.length > 0 && i < e && t.push(
|
|
5108
|
+
let r = _(a);
|
|
5109
|
+
r.length > 0 && i < e && t.push(g(a)), n(r, i + 1);
|
|
5110
5110
|
}
|
|
5111
5111
|
};
|
|
5112
5112
|
return n(o.list, 0), t;
|
|
5113
5113
|
}
|
|
5114
|
-
function
|
|
5114
|
+
function k(e, t = []) {
|
|
5115
5115
|
for (let n of e) {
|
|
5116
|
-
let e = [...t,
|
|
5116
|
+
let e = [...t, g(n)], r = _(n);
|
|
5117
5117
|
if (r.length === 0) return {
|
|
5118
5118
|
node: n,
|
|
5119
5119
|
path: e
|
|
5120
5120
|
};
|
|
5121
|
-
let i =
|
|
5121
|
+
let i = k(r, e);
|
|
5122
5122
|
if (i) return i;
|
|
5123
5123
|
}
|
|
5124
5124
|
}
|
|
5125
5125
|
X(() => o.list, () => {
|
|
5126
|
-
if (!(m.value || o.list.length === 0) && (m.value = !0, o.defaultExpandedAll ? l.value = [...
|
|
5127
|
-
let e = o.list[0], t = o.deepChange ?
|
|
5126
|
+
if (!(m.value || o.list.length === 0) && (m.value = !0, o.defaultExpandedAll ? l.value = [...y.value] : o.defaultExpandedLevel > 0 && (l.value = ee(o.defaultExpandedLevel)), o.autoChange && s.value === void 0)) {
|
|
5127
|
+
let e = o.list[0], t = o.deepChange ? k(o.list) : e ? {
|
|
5128
5128
|
node: e,
|
|
5129
|
-
path: [
|
|
5129
|
+
path: [g(e)]
|
|
5130
5130
|
} : void 0;
|
|
5131
|
-
t && (s.value =
|
|
5131
|
+
t && (s.value = g(t.node), c.value = [...t.path], a("change", s.value, t.node, t.path));
|
|
5132
5132
|
}
|
|
5133
5133
|
}, { immediate: !0 });
|
|
5134
|
-
function k(e, t) {
|
|
5135
|
-
a("change", e, _.value.get(e), t);
|
|
5136
|
-
}
|
|
5137
5134
|
function j(e, t) {
|
|
5135
|
+
a("change", e, v.value.get(e), t);
|
|
5136
|
+
}
|
|
5137
|
+
function N(e, t) {
|
|
5138
5138
|
a("expand", e, t);
|
|
5139
5139
|
}
|
|
5140
|
-
function
|
|
5140
|
+
function P(e, t) {
|
|
5141
5141
|
a("check", e, t);
|
|
5142
5142
|
}
|
|
5143
|
-
function
|
|
5143
|
+
function F(e) {
|
|
5144
5144
|
l.value = e;
|
|
5145
5145
|
}
|
|
5146
|
-
function
|
|
5147
|
-
l.value = [...
|
|
5146
|
+
function te() {
|
|
5147
|
+
l.value = [...y.value];
|
|
5148
5148
|
}
|
|
5149
|
-
function
|
|
5149
|
+
function ne() {
|
|
5150
5150
|
l.value = [];
|
|
5151
5151
|
}
|
|
5152
|
-
function
|
|
5152
|
+
function re(e) {
|
|
5153
5153
|
p.value = e;
|
|
5154
5154
|
}
|
|
5155
5155
|
return t({
|
|
5156
|
-
expandAll:
|
|
5157
|
-
collapseAll:
|
|
5158
|
-
filter:
|
|
5156
|
+
expandAll: te,
|
|
5157
|
+
collapseAll: ne,
|
|
5158
|
+
filter: re
|
|
5159
5159
|
}), (e, t) => (B(), O(Vn, {
|
|
5160
5160
|
class: R(["st-tree", G(r).class]),
|
|
5161
5161
|
modelValue: s.value,
|
|
5162
5162
|
"onUpdate:modelValue": t[0] ||= (e) => s.value = e,
|
|
5163
5163
|
"expanded-keys": l.value,
|
|
5164
|
-
"onUpdate:expandedKeys": [t[1] ||= (e) => l.value = e,
|
|
5164
|
+
"onUpdate:expandedKeys": [t[1] ||= (e) => l.value = e, F],
|
|
5165
5165
|
path: c.value,
|
|
5166
5166
|
"onUpdate:path": t[2] ||= (e) => c.value = e,
|
|
5167
5167
|
"selected-keys": u.value,
|
|
@@ -5173,22 +5173,25 @@ var Yn = ["for"], Xn = /* @__PURE__ */ F({
|
|
|
5173
5173
|
selection: o.selection,
|
|
5174
5174
|
strict: o.strict,
|
|
5175
5175
|
style: z(G(r).style),
|
|
5176
|
-
onChange:
|
|
5177
|
-
onCheck:
|
|
5178
|
-
onExpand:
|
|
5176
|
+
onChange: j,
|
|
5177
|
+
onCheck: P,
|
|
5178
|
+
onExpand: N
|
|
5179
5179
|
}, {
|
|
5180
|
-
default: Z(() => [
|
|
5180
|
+
default: Z(() => [x.value.length > 0 ? (B(!0), A(w, { key: 0 }, H(x.value, (t) => (B(), O(rr, {
|
|
5181
5181
|
"arrow-class": o.arrowClass,
|
|
5182
5182
|
"arrow-style": o.arrowStyle,
|
|
5183
5183
|
"children-key": o.childrenKey,
|
|
5184
5184
|
indent: o.indent,
|
|
5185
|
-
key:
|
|
5185
|
+
key: g(t),
|
|
5186
5186
|
"label-class": o.labelClass,
|
|
5187
5187
|
"label-key": o.labelKey,
|
|
5188
5188
|
"label-style": o.labelStyle,
|
|
5189
|
-
node:
|
|
5189
|
+
node: t,
|
|
5190
5190
|
"value-key": o.valueKey
|
|
5191
|
-
},
|
|
5191
|
+
}, M({ _: 2 }, [H(h.value, (t) => ({
|
|
5192
|
+
name: t,
|
|
5193
|
+
fn: Z((n) => [U(e.$slots, t, ae({ ref_for: !0 }, n))])
|
|
5194
|
+
}))]), 1032, [
|
|
5192
5195
|
"arrow-class",
|
|
5193
5196
|
"arrow-style",
|
|
5194
5197
|
"children-key",
|