@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.
Files changed (46) hide show
  1. package/chunks/configComponents.BHkQi547.mjs +45 -0
  2. package/chunks/{confirmable-mixin.D9aKzKZ9.mjs → confirmable-mixin.B2TtLAdk.mjs} +23 -22
  3. package/chunks/dictionary.D9gKwItv.mjs +68 -0
  4. package/chunks/{form-input.BsT_5fuJ.mjs → form-input.CvFdwlEV.mjs} +2 -2
  5. package/chunks/{form-item.CLZf7hCo.mjs → form-item.LWjePsPa.mjs} +16 -16
  6. package/chunks/{index.d3MV3Wq2.mjs → index.B2TRddqf.mjs} +30 -27
  7. package/confirm-button/index.mjs +1 -1
  8. package/confirmable/index.mjs +1 -1
  9. package/data-table-picker/index.mjs +1 -1
  10. package/editable-tree/index.mjs +1 -1
  11. package/element-dialog/index.mjs +17 -16
  12. package/form-cascader/index.mjs +24 -24
  13. package/form-checkbox/index.mjs +15 -15
  14. package/form-checkbox-group/index.mjs +14 -14
  15. package/form-date-picker/index.mjs +2 -2
  16. package/form-holder/index.mjs +1 -1
  17. package/form-input/index.mjs +11 -11
  18. package/form-input-cron-expression/index.mjs +11 -11
  19. package/form-input-email/index.mjs +13 -13
  20. package/form-input-id-card/index.mjs +12 -12
  21. package/form-input-number/index.mjs +2 -2
  22. package/form-input-phone-number/index.mjs +22 -22
  23. package/form-input-tag/index.mjs +2 -2
  24. package/form-input-time/index.mjs +15 -15
  25. package/form-item/index.mjs +1 -1
  26. package/form-radio-group/index.mjs +26 -26
  27. package/form-select/index.mjs +17 -17
  28. package/form-switch/index.mjs +13 -13
  29. package/form-table/index.mjs +6 -6
  30. package/form-table-plus/index.mjs +4 -4
  31. package/form-textarea/index.mjs +13 -13
  32. package/form-tree-select/index.mjs +8 -8
  33. package/form-tree-select-multiple/index.mjs +2 -2
  34. package/index.mjs +408 -406
  35. package/package.json +1 -1
  36. package/pageable-table/index.mjs +48 -48
  37. package/pageable-view/index.mjs +1 -1
  38. package/picker-table-view/index.mjs +25 -24
  39. package/table-column/index.mjs +1 -1
  40. package/table-view/index.mjs +35 -36
  41. package/tabs-view/index.mjs +2 -2
  42. package/toolbar/index.mjs +52 -53
  43. package/toolbar-button/index.mjs +2 -2
  44. package/web-types.json +1 -1
  45. package/chunks/configComponents.BDhlZU8F.mjs +0 -23
  46. package/chunks/dictionary.DsN-2ukC.mjs +0 -70
package/toolbar/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { h as u } from "vue";
2
- import { copy as g, NOOP as d } from "@web-utils/core";
3
- import { g as f } from "../chunks/configComponents.BDhlZU8F.mjs";
4
- import { n as y } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
5
- const h = {
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
- }, B = {
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
- (o = (n = f.toolbar) == null ? void 0 : n.goBack) == null || o.call(n, e);
140
+ g(e);
142
141
  },
143
142
  createButton(e, {
144
- label: n,
145
- icon: o,
146
- type: a,
147
- separateLine: s = !0,
143
+ label: h,
144
+ icon: i,
145
+ type: n,
146
+ separateLine: a = !0,
148
147
  loadable: t,
149
- circle: l,
150
- onClick: c,
151
- title: i
148
+ circle: o,
149
+ onClick: s,
150
+ title: r
152
151
  }) {
153
152
  var b;
154
- let r;
155
- const p = ((b = this.label) == null ? void 0 : b[e]) || n;
156
- return c ? r = c : ["back", "cancel"].includes(e) ? r = this.goBack : r = (m) => (this.$listeners[e] || d)(m), u("ToolbarButton", {
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": s,
159
- icon: o,
160
- title: i,
161
- label: p,
157
+ "separate-line": a,
158
+ icon: i,
159
+ title: r,
160
+ label: c,
162
161
  loadable: t,
163
- circle: l,
162
+ circle: o,
164
163
  footer: this.footer,
165
- type: a
164
+ type: n
166
165
  },
167
166
  on: {
168
- click: r
167
+ click: l
169
168
  }
170
169
  });
171
170
  },
172
171
  getLeftButtons() {
173
- var a, s;
172
+ var n, a;
174
173
  const {
175
174
  createButton: e
176
- } = this, o = ((s = (a = this.$scopedSlots)["toolbar-left"]) == null ? void 0 : s.call(a)) || this.buttons.flatMap((t) => {
177
- var c, i, r, p;
178
- const l = h[t];
179
- return l ? ((i = (c = this.$scopedSlots)[t]) == null ? void 0 : i.call(c)) || e(t, l) : t === "slot" ? ((p = (r = this.$scopedSlots).default) == null ? void 0 : p.call(r, {
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 o == null ? void 0 : o.filter((t) => {
185
- var l;
186
- return (l = t == null ? void 0 : t.componentOptions) != null && l.propsData.privilege ? f.privilege.hasAuthority(t.componentOptions.propsData.privilege) : !0;
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 a, s, t, l;
191
- const e = (s = (a = this.$scopedSlots)["toolbar-right"]) == null ? void 0 : s.call(a), o = [...((l = (t = this.$scopedSlots)["toolbar-right-button"]) == null ? void 0 : l.call(t)) || [], this.getRefreshButton(), this.getSettingsButton(), this.getSearchButton()];
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: c
193
+ createButton: s
195
194
  } = this;
196
- o.push(c("copyColumnWidth", {
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 i = Array.from(this.$el.parentNode.querySelectorAll(".el-table__header > colgroup > col"));
204
- i = i.filter((r, p) => p > 1 && p < i.length - 1).map((r) => `width="${r.getAttribute("width")}"`).join(`
205
- `), g(i, () => {
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 || o;
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", h.search) : null;
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", h.reload) : null;
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", h.settings) : null;
228
+ return this.refreshable ? e("settings", u.settings) : null;
230
229
  }
231
230
  },
232
231
  render() {
233
- return this.footer ? u("div", {
232
+ return this.footer ? p("div", {
234
233
  class: "footer-bar"
235
- }, [this.getLeftButtons()]) : u("div", {
234
+ }, [this.getLeftButtons()]) : p("div", {
236
235
  class: "toolbar"
237
- }, [u("div", {
236
+ }, [p("div", {
238
237
  class: "toolbar-left"
239
- }, [this.getLeftButtons()]), u("div", {
238
+ }, [this.getLeftButtons()]), p("div", {
240
239
  class: "toolbar-right"
241
240
  }, [this.getRightButtons()])]);
242
241
  }
243
- }, _ = null, S = null;
244
- var v = /* @__PURE__ */ y(
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 R = v.exports;
251
+ const O = v.exports;
253
252
  export {
254
- R as default
253
+ O as default
255
254
  };
@@ -1,5 +1,5 @@
1
1
  import { isFunction as n, isArray as r } from "@web-utils/core";
2
- import { g as a } from "../chunks/configComponents.BDhlZU8F.mjs";
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.privilege.hasAuthority(this.privilege) : !0;
52
+ return this.privilege ? a(this.privilege) : !0;
53
53
  }
54
54
  },
55
55
  methods: {
package/web-types.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "framework": "vue",
4
4
  "name": "@web-utils/component",
5
- "version": "4.0.4",
5
+ "version": "4.0.6",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "description-markup": "markdown",
@@ -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
- };