@web-utils/component 4.0.4 → 4.0.6
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/chunks/configComponents.BHkQi547.mjs +45 -0
- package/chunks/{confirmable-mixin.D9aKzKZ9.mjs → confirmable-mixin.B2TtLAdk.mjs} +23 -22
- package/chunks/dictionary.D9gKwItv.mjs +68 -0
- package/chunks/{form-input.BsT_5fuJ.mjs → form-input.CvFdwlEV.mjs} +2 -2
- package/chunks/{form-item.CLZf7hCo.mjs → form-item.LWjePsPa.mjs} +16 -16
- package/chunks/{index.d3MV3Wq2.mjs → index.B2TRddqf.mjs} +30 -27
- package/confirm-button/index.mjs +1 -1
- package/confirmable/index.mjs +1 -1
- package/data-table-picker/index.mjs +1 -1
- package/editable-tree/index.mjs +1 -1
- package/element-dialog/index.mjs +17 -16
- package/form-cascader/index.mjs +24 -24
- package/form-checkbox/index.mjs +15 -15
- package/form-checkbox-group/index.mjs +14 -14
- package/form-date-picker/index.mjs +2 -2
- package/form-holder/index.mjs +1 -1
- package/form-input/index.mjs +11 -11
- package/form-input-cron-expression/index.mjs +11 -11
- package/form-input-email/index.mjs +13 -13
- package/form-input-id-card/index.mjs +12 -12
- package/form-input-number/index.mjs +2 -2
- package/form-input-phone-number/index.mjs +22 -22
- package/form-input-tag/index.mjs +2 -2
- package/form-input-time/index.mjs +15 -15
- package/form-item/index.mjs +1 -1
- package/form-radio-group/index.mjs +26 -26
- package/form-select/index.mjs +17 -17
- package/form-switch/index.mjs +13 -13
- package/form-table/index.mjs +6 -6
- package/form-table-plus/index.mjs +4 -4
- package/form-textarea/index.mjs +13 -13
- package/form-tree-select/index.mjs +8 -8
- package/form-tree-select-multiple/index.mjs +2 -2
- package/index.mjs +408 -406
- package/package.json +1 -1
- package/pageable-table/index.mjs +48 -48
- package/pageable-view/index.mjs +1 -1
- package/picker-table-view/index.mjs +25 -24
- package/table-column/index.mjs +1 -1
- package/table-view/index.mjs +35 -36
- package/tabs-view/index.mjs +2 -2
- package/toolbar/index.mjs +52 -53
- package/toolbar-button/index.mjs +2 -2
- package/web-types.json +1 -1
- package/chunks/configComponents.BDhlZU8F.mjs +0 -23
- package/chunks/dictionary.DsN-2ukC.mjs +0 -70
package/toolbar/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { h as
|
|
2
|
-
import { copy as
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
const
|
|
1
|
+
import { h as p } from "vue";
|
|
2
|
+
import { copy as m, NOOP as d } from "@web-utils/core";
|
|
3
|
+
import { h as y, b as g } from "../chunks/configComponents.BHkQi547.mjs";
|
|
4
|
+
import { n as B } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
5
|
+
const u = {
|
|
6
6
|
back: {
|
|
7
7
|
label: "返回",
|
|
8
8
|
type: "primary",
|
|
@@ -111,7 +111,7 @@ const h = {
|
|
|
111
111
|
separateLine: !1,
|
|
112
112
|
circle: !0
|
|
113
113
|
}
|
|
114
|
-
},
|
|
114
|
+
}, _ = {
|
|
115
115
|
name: "Toolbar",
|
|
116
116
|
provide() {
|
|
117
117
|
return {
|
|
@@ -136,120 +136,119 @@ const h = {
|
|
|
136
136
|
},
|
|
137
137
|
methods: {
|
|
138
138
|
goBack() {
|
|
139
|
-
var n, o;
|
|
140
139
|
const e = this.$route.path;
|
|
141
|
-
(
|
|
140
|
+
g(e);
|
|
142
141
|
},
|
|
143
142
|
createButton(e, {
|
|
144
|
-
label:
|
|
145
|
-
icon:
|
|
146
|
-
type:
|
|
147
|
-
separateLine:
|
|
143
|
+
label: h,
|
|
144
|
+
icon: i,
|
|
145
|
+
type: n,
|
|
146
|
+
separateLine: a = !0,
|
|
148
147
|
loadable: t,
|
|
149
|
-
circle:
|
|
150
|
-
onClick:
|
|
151
|
-
title:
|
|
148
|
+
circle: o,
|
|
149
|
+
onClick: s,
|
|
150
|
+
title: r
|
|
152
151
|
}) {
|
|
153
152
|
var b;
|
|
154
|
-
let
|
|
155
|
-
const
|
|
156
|
-
return
|
|
153
|
+
let l;
|
|
154
|
+
const c = ((b = this.label) == null ? void 0 : b[e]) || h;
|
|
155
|
+
return s ? l = s : ["back", "cancel"].includes(e) ? l = this.goBack : l = (f) => (this.$listeners[e] || d)(f), p("ToolbarButton", {
|
|
157
156
|
attrs: {
|
|
158
|
-
"separate-line":
|
|
159
|
-
icon:
|
|
160
|
-
title:
|
|
161
|
-
label:
|
|
157
|
+
"separate-line": a,
|
|
158
|
+
icon: i,
|
|
159
|
+
title: r,
|
|
160
|
+
label: c,
|
|
162
161
|
loadable: t,
|
|
163
|
-
circle:
|
|
162
|
+
circle: o,
|
|
164
163
|
footer: this.footer,
|
|
165
|
-
type:
|
|
164
|
+
type: n
|
|
166
165
|
},
|
|
167
166
|
on: {
|
|
168
|
-
click:
|
|
167
|
+
click: l
|
|
169
168
|
}
|
|
170
169
|
});
|
|
171
170
|
},
|
|
172
171
|
getLeftButtons() {
|
|
173
|
-
var
|
|
172
|
+
var n, a;
|
|
174
173
|
const {
|
|
175
174
|
createButton: e
|
|
176
|
-
} = this,
|
|
177
|
-
var
|
|
178
|
-
const
|
|
179
|
-
return
|
|
175
|
+
} = this, i = ((a = (n = this.$scopedSlots)["toolbar-left"]) == null ? void 0 : a.call(n)) || this.buttons.flatMap((t) => {
|
|
176
|
+
var s, r, l, c;
|
|
177
|
+
const o = u[t];
|
|
178
|
+
return o ? ((r = (s = this.$scopedSlots)[t]) == null ? void 0 : r.call(s)) || e(t, o) : t === "slot" ? ((c = (l = this.$scopedSlots).default) == null ? void 0 : c.call(l, {
|
|
180
179
|
buttons: this.buttons,
|
|
181
180
|
footer: this.footer
|
|
182
181
|
})) ?? null : null;
|
|
183
182
|
});
|
|
184
|
-
return
|
|
185
|
-
var
|
|
186
|
-
return (
|
|
183
|
+
return i == null ? void 0 : i.filter((t) => {
|
|
184
|
+
var o;
|
|
185
|
+
return (o = t == null ? void 0 : t.componentOptions) != null && o.propsData.privilege ? y(t.componentOptions.propsData.privilege) : !0;
|
|
187
186
|
});
|
|
188
187
|
},
|
|
189
188
|
getRightButtons() {
|
|
190
|
-
var
|
|
191
|
-
const e = (
|
|
189
|
+
var n, a, t, o;
|
|
190
|
+
const e = (a = (n = this.$scopedSlots)["toolbar-right"]) == null ? void 0 : a.call(n), i = [...((o = (t = this.$scopedSlots)["toolbar-right-button"]) == null ? void 0 : o.call(t)) || [], this.getRefreshButton(), this.getSettingsButton(), this.getSearchButton()];
|
|
192
191
|
if (process.env.NODE_ENV === "development" && this.$parent.toggleSearch) {
|
|
193
192
|
const {
|
|
194
|
-
createButton:
|
|
193
|
+
createButton: s
|
|
195
194
|
} = this;
|
|
196
|
-
|
|
195
|
+
i.push(s("copyColumnWidth", {
|
|
197
196
|
label: "复制列宽",
|
|
198
197
|
title: "复制列宽",
|
|
199
198
|
icon: "el-icon-document-copy",
|
|
200
199
|
separateLine: !1,
|
|
201
200
|
circle: !0,
|
|
202
201
|
onClick: () => {
|
|
203
|
-
let
|
|
204
|
-
|
|
205
|
-
`),
|
|
202
|
+
let r = Array.from(this.$el.parentNode.querySelectorAll(".el-table__header > colgroup > col"));
|
|
203
|
+
r = r.filter((l, c) => c > 1 && c < r.length - 1).map((l) => `width="${l.getAttribute("width")}"`).join(`
|
|
204
|
+
`), m(r, () => {
|
|
206
205
|
this.$message.success("复制成功");
|
|
207
206
|
});
|
|
208
207
|
}
|
|
209
208
|
}));
|
|
210
209
|
}
|
|
211
|
-
return e ||
|
|
210
|
+
return e || i;
|
|
212
211
|
},
|
|
213
212
|
getSearchButton() {
|
|
214
213
|
const {
|
|
215
214
|
createButton: e
|
|
216
215
|
} = this;
|
|
217
|
-
return this.searchable ? e("search",
|
|
216
|
+
return this.searchable ? e("search", u.search) : null;
|
|
218
217
|
},
|
|
219
218
|
getRefreshButton() {
|
|
220
219
|
const {
|
|
221
220
|
createButton: e
|
|
222
221
|
} = this;
|
|
223
|
-
return this.refreshable ? e("reload",
|
|
222
|
+
return this.refreshable ? e("reload", u.reload) : null;
|
|
224
223
|
},
|
|
225
224
|
getSettingsButton() {
|
|
226
225
|
const {
|
|
227
226
|
createButton: e
|
|
228
227
|
} = this;
|
|
229
|
-
return this.refreshable ? e("settings",
|
|
228
|
+
return this.refreshable ? e("settings", u.settings) : null;
|
|
230
229
|
}
|
|
231
230
|
},
|
|
232
231
|
render() {
|
|
233
|
-
return this.footer ?
|
|
232
|
+
return this.footer ? p("div", {
|
|
234
233
|
class: "footer-bar"
|
|
235
|
-
}, [this.getLeftButtons()]) :
|
|
234
|
+
}, [this.getLeftButtons()]) : p("div", {
|
|
236
235
|
class: "toolbar"
|
|
237
|
-
}, [
|
|
236
|
+
}, [p("div", {
|
|
238
237
|
class: "toolbar-left"
|
|
239
|
-
}, [this.getLeftButtons()]),
|
|
238
|
+
}, [this.getLeftButtons()]), p("div", {
|
|
240
239
|
class: "toolbar-right"
|
|
241
240
|
}, [this.getRightButtons()])]);
|
|
242
241
|
}
|
|
243
|
-
},
|
|
244
|
-
var v = /* @__PURE__ */
|
|
245
|
-
B,
|
|
242
|
+
}, S = null, $ = null;
|
|
243
|
+
var v = /* @__PURE__ */ B(
|
|
246
244
|
_,
|
|
247
245
|
S,
|
|
246
|
+
$,
|
|
248
247
|
!1,
|
|
249
248
|
null,
|
|
250
249
|
null
|
|
251
250
|
);
|
|
252
|
-
const
|
|
251
|
+
const O = v.exports;
|
|
253
252
|
export {
|
|
254
|
-
|
|
253
|
+
O as default
|
|
255
254
|
};
|
package/toolbar-button/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isFunction as n, isArray as r } from "@web-utils/core";
|
|
2
|
-
import {
|
|
2
|
+
import { h as a } from "../chunks/configComponents.BHkQi547.mjs";
|
|
3
3
|
import { n as l } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
|
|
4
4
|
const s = {
|
|
5
5
|
name: "ToolbarButton",
|
|
@@ -49,7 +49,7 @@ const s = {
|
|
|
49
49
|
},
|
|
50
50
|
computed: {
|
|
51
51
|
isVisible() {
|
|
52
|
-
return this.privilege ? a
|
|
52
|
+
return this.privilege ? a(this.privilege) : !0;
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
methods: {
|
package/web-types.json
CHANGED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { isObject as u, isString as c } from "@web-utils/core";
|
|
2
|
-
const g = {
|
|
3
|
-
privilege: {
|
|
4
|
-
processButtons(e) {
|
|
5
|
-
return e.map((t) => {
|
|
6
|
-
var r, n;
|
|
7
|
-
if (u(t)) {
|
|
8
|
-
const o = t, s = {};
|
|
9
|
-
for (const i in o)
|
|
10
|
-
c(o[i]) && (s[i] = (n = (r = g.privilege) == null ? void 0 : r.hasAuthority) == null ? void 0 : n.call(r, o[i]));
|
|
11
|
-
return s;
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
});
|
|
15
|
-
},
|
|
16
|
-
hasAuthority(e) {
|
|
17
|
-
return !0;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
g
|
|
23
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { t as u, a as l } from "./core.DJEgjQW6.mjs";
|
|
2
|
-
import { g as h } from "./configComponents.BDhlZU8F.mjs";
|
|
3
|
-
const d = {}, D = {}, $ = {}, T = (t, c = !0, { options: o, treeDict: n, idAsValue: i, labelAsValue: r } = {}) => {
|
|
4
|
-
let e = t;
|
|
5
|
-
n && (e = `${t}-${i}-${r}${o ? "-options" : ""}`);
|
|
6
|
-
const a = d[e];
|
|
7
|
-
return c && a ? a : n ? C(t, c, { idAsValue: i, labelAsValue: r }) : w(t, c);
|
|
8
|
-
}, w = (t, c = !0) => {
|
|
9
|
-
if ($[t])
|
|
10
|
-
return $[t];
|
|
11
|
-
const o = new Promise((n, i) => {
|
|
12
|
-
var r, e;
|
|
13
|
-
c && d[t] ? n(d[t]) : ((e = (r = h) == null ? void 0 : r.dict) != null && e.remote && n([]), h.dict.remote(t).then((a) => {
|
|
14
|
-
let s = a.data.data;
|
|
15
|
-
if (c) {
|
|
16
|
-
const f = {};
|
|
17
|
-
s.forEach(({ label: g, value: m }) => {
|
|
18
|
-
f[m] = Object.freeze({ label: g, value: m });
|
|
19
|
-
}), D[t] = f, s = Object.freeze(s), d[t] = s;
|
|
20
|
-
}
|
|
21
|
-
$[t] = null, n(s);
|
|
22
|
-
}).catch((a) => {
|
|
23
|
-
$[t] = null, i(a);
|
|
24
|
-
}));
|
|
25
|
-
});
|
|
26
|
-
return $[t] = o, o;
|
|
27
|
-
}, C = (t, c = !0, { idAsValue: o, labelAsValue: n } = {}) => {
|
|
28
|
-
const i = `${t}-${o}-${n}`;
|
|
29
|
-
if ($[i])
|
|
30
|
-
return $[i];
|
|
31
|
-
const r = new Promise((e, a) => {
|
|
32
|
-
var s, f;
|
|
33
|
-
c && d[i] ? e(d[i]) : ((f = (s = h) == null ? void 0 : s.dict) != null && f.getDictTreeByType && e([]), h.dict.getDictTreeByType(t, { idAsValue: o, labelAsValue: n }).then((g) => {
|
|
34
|
-
const m = g.data.data;
|
|
35
|
-
c && (d[i] = m, d[`${i}-options`] = u(m), D[i] = l(m)), $[i] = null, e(m);
|
|
36
|
-
}).catch((g) => {
|
|
37
|
-
$[i] = null, a(g);
|
|
38
|
-
}));
|
|
39
|
-
});
|
|
40
|
-
return $[i] = r, r;
|
|
41
|
-
}, b = async (t, c, o = !0, { treeDict: n, idAsValue: i, labelAsValue: r } = {}) => {
|
|
42
|
-
let e = t;
|
|
43
|
-
n && (e = `${t}-${i}-${r}`);
|
|
44
|
-
const a = D[e];
|
|
45
|
-
let s;
|
|
46
|
-
if (o && a)
|
|
47
|
-
s = a[c];
|
|
48
|
-
else {
|
|
49
|
-
let f = await T(t, o, { treeDict: n, idAsValue: i, labelAsValue: r });
|
|
50
|
-
if (o)
|
|
51
|
-
s = D[e][c];
|
|
52
|
-
else {
|
|
53
|
-
n && (f = u(f));
|
|
54
|
-
for (let g = 0; g < f.length; g++) {
|
|
55
|
-
const m = f[g];
|
|
56
|
-
if (m.value === c) {
|
|
57
|
-
s = m;
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return s;
|
|
64
|
-
}, j = async (t, c, o = !0, { treeDict: n, idAsValue: i, labelAsValue: r } = {}) => {
|
|
65
|
-
var e;
|
|
66
|
-
return ((e = await b(t, c, o, { treeDict: n, idAsValue: i, labelAsValue: r })) == null ? void 0 : e.label) || c || "";
|
|
67
|
-
};
|
|
68
|
-
export {
|
|
69
|
-
j as g
|
|
70
|
-
};
|