@web-utils/form-ui 1.0.0-beta26 → 1.0.0-beta28

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 (93) hide show
  1. package/chunks/{BPbmq_Fz.mjs → B99alfW4.mjs} +28 -29
  2. package/chunks/BQ77eAb3.mjs +71 -0
  3. package/chunks/BV_N8p9t.mjs +83 -0
  4. package/chunks/BV_P9a8o.mjs +100 -0
  5. package/chunks/Bd1O2CP5.mjs +637 -0
  6. package/chunks/{DzMQIy5h.mjs → BgDYHgyH.mjs} +1 -1
  7. package/chunks/{BJP-5-0v.mjs → BmZieBZW.mjs} +2 -2
  8. package/chunks/{ADvOhGAW.mjs → Br4i8stg.mjs} +1 -1
  9. package/chunks/{ltggbLWM.mjs → C3a15Ful.mjs} +2 -2
  10. package/chunks/{BAE_vglg.mjs → C4bM8miy.mjs} +2 -2
  11. package/chunks/{D-ffcm89.mjs → Cby3mvvZ.mjs} +2 -2
  12. package/chunks/{tRXOz6_G.mjs → Cc3EJjbV.mjs} +2 -2
  13. package/chunks/{lVzx0-GH.mjs → Cgl-hCE5.mjs} +2 -2
  14. package/chunks/{DJTwM7o_.mjs → Ci1XxmdE.mjs} +3 -3
  15. package/chunks/{mjEH6tHn.mjs → CsfgUCe9.mjs} +1 -1
  16. package/chunks/{o5196FMX.mjs → CugRu2Ka.mjs} +3 -3
  17. package/chunks/{DlFC9IZx.mjs → Cy-4nmyC.mjs} +2 -2
  18. package/chunks/{qRpPD8iK.mjs → D1EOkWJ7.mjs} +2 -2
  19. package/chunks/{DGYsSu6t.mjs → DO8dVGef.mjs} +2 -2
  20. package/chunks/{BhmGnR4F.mjs → DazglPJZ.mjs} +1 -1
  21. package/chunks/{CCc9Zjms.mjs → Dt6gY213.mjs} +2 -2
  22. package/chunks/{3QpBKdDM.mjs → DtAYXPvz.mjs} +2 -2
  23. package/chunks/{Cme51jl3.mjs → JhyiXnbd.mjs} +2 -2
  24. package/chunks/{CotIhBXj.mjs → S64sNmuR.mjs} +2 -2
  25. package/chunks/{Dn79Y_Rb.mjs → bnRb5PUB.mjs} +2 -2
  26. package/chunks/{CnP5qx9A.mjs → q1SlJP1y.mjs} +2 -2
  27. package/dict-render/index.d.ts +28 -0
  28. package/element-dialog/index.d.ts +6 -6
  29. package/element-dialog/index.mjs +1 -1
  30. package/form-cascader/index.d.ts +2 -2
  31. package/form-cascader/index.mjs +1 -1
  32. package/form-check-box-group/index.d.ts +1 -1
  33. package/form-check-box-group/index.mjs +1 -1
  34. package/form-checkbox/index.d.ts +1 -1
  35. package/form-checkbox/index.mjs +1 -1
  36. package/form-date-picker/index.d.ts +2 -2
  37. package/form-date-picker/index.mjs +1 -1
  38. package/form-holder/index.mjs +1 -1
  39. package/form-image/index.d.ts +1 -1
  40. package/form-image/index.mjs +1 -1
  41. package/form-input/index.d.ts +1 -1
  42. package/form-input/index.mjs +1 -1
  43. package/form-input-cron-expression/index.d.ts +1 -1
  44. package/form-input-cron-expression/index.mjs +1 -1
  45. package/form-input-email/index.d.ts +1 -1
  46. package/form-input-email/index.mjs +1 -1
  47. package/form-input-id-card/index.d.ts +1 -1
  48. package/form-input-id-card/index.mjs +1 -1
  49. package/form-input-number/index.d.ts +1 -1
  50. package/form-input-number/index.mjs +1 -1
  51. package/form-input-phone-number/index.d.ts +1 -1
  52. package/form-input-phone-number/index.mjs +1 -1
  53. package/form-item-x/index.d.ts +1 -1
  54. package/form-item-x/index.mjs +1 -1
  55. package/form-radio-group/index.d.ts +1 -1
  56. package/form-radio-group/index.mjs +1 -1
  57. package/form-rate/index.d.ts +1 -1
  58. package/form-rate/index.mjs +1 -1
  59. package/form-select/index.d.ts +2 -2
  60. package/form-select/index.mjs +1 -1
  61. package/form-slider/index.d.ts +2 -2
  62. package/form-slider/index.mjs +1 -1
  63. package/form-switch/index.d.ts +1 -1
  64. package/form-switch/index.mjs +1 -1
  65. package/form-text/index.d.ts +1 -1
  66. package/form-text/index.mjs +1 -1
  67. package/helper/dictionary.mjs +7 -7
  68. package/hook/useVisibilityChange.d.ts +4 -0
  69. package/hook/useVisibilityChange.mjs +14 -0
  70. package/iframe-window/index.mjs +1 -1
  71. package/index.d.ts +5 -1
  72. package/index.mjs +32 -28
  73. package/package.json +2 -1
  74. package/pageable-table/index.d.ts +436 -0
  75. package/pageable-table/index.mjs +2 -0
  76. package/pageable-table/style.css +1 -0
  77. package/resize-observer/index.d.ts +8 -0
  78. package/resize-observer/index.mjs +40 -0
  79. package/resize-observer/style.css +1 -0
  80. package/table-column/index.d.ts +160 -0
  81. package/table-column/index.mjs +2 -0
  82. package/table-column/style.css +1 -0
  83. package/table-column-def/index.d.ts +85 -0
  84. package/table-column-def/index.mjs +11 -0
  85. package/table-column-filter/index.d.ts +11 -0
  86. package/table-column-filterable/index.d.ts +10 -0
  87. package/toolbar/index.mjs +1 -1
  88. package/toolbar-button/index.mjs +1 -1
  89. package/web-types.json +1 -1
  90. package/year-calendar/index.mjs +1 -1
  91. package/chunks/BVLgLg_s.mjs +0 -53
  92. /package/chunks/{DS8NSFKr.mjs → 4ZuVpQf6.mjs} +0 -0
  93. /package/chunks/{Bgny2wyC.mjs → dM-icPM8.mjs} +0 -0
@@ -1,11 +1,11 @@
1
- import { n as e } from "./BVLgLg_s.mjs";
2
- import { hasAuthority as t } from "../api/index.mjs";
3
- import { toolbarContextKey as n } from "../constants/index.mjs";
4
- import { t as r } from "./Bgny2wyC.mjs";
5
- import { NOOP as i, capitalize as a } from "@web-utils/core";
6
- import { Comment as o, createVNode as s } from "vue";
1
+ import { i as e } from "./BQ77eAb3.mjs";
2
+ import { goBack as t, hasAuthority as n } from "../api/index.mjs";
3
+ import { toolbarContextKey as r } from "../constants/index.mjs";
4
+ import { t as i } from "./dM-icPM8.mjs";
5
+ import { NOOP as a, capitalize as o } from "@web-utils/core";
6
+ import { Comment as s, createVNode as c } from "vue";
7
7
  //#region src/components/toolbar/Toolbar.vue?vue&type=script&lang.jsx
8
- var c = {
8
+ var l = {
9
9
  back: {
10
10
  label: "返回",
11
11
  type: "primary",
@@ -114,10 +114,10 @@ var c = {
114
114
  separateLine: !1,
115
115
  circle: !0
116
116
  }
117
- }, l = {
117
+ }, u = {
118
118
  name: "Toolbar",
119
119
  provide() {
120
- return { [n]: this };
120
+ return { [r]: this };
121
121
  },
122
122
  props: {
123
123
  searchable: Boolean,
@@ -138,47 +138,46 @@ var c = {
138
138
  computed: {},
139
139
  methods: {
140
140
  goBack() {
141
- let e = this.$route.path;
142
- this.tabs.length === 1 ? window.close() : this.$bus("closeTab", e, this);
141
+ t(this.$route.path);
143
142
  },
144
- createButton(t, { label: n, icon: o, type: c, separateLine: l = !0, loadable: u, circle: d, onClick: f, title: p }) {
143
+ createButton(t, { label: n, icon: r, type: s, separateLine: l = !0, loadable: u, circle: d, onClick: f, title: p }) {
145
144
  var m;
146
145
  let h, g = ((m = this.label) == null ? void 0 : m[t]) || n;
147
146
  return h = f || (["back", "cancel"].includes(t) ? this.goBack : (n) => {
148
- (e(this.$attrs, { withOn: !0 })[`on${a(t)}`] || i)(n);
149
- }), s(r, {
147
+ (e(this.$attrs, { withOn: !0 })[`on${o(t)}`] || a)(n);
148
+ }), c(i, {
150
149
  "separate-line": l,
151
- icon: o,
150
+ icon: r,
152
151
  title: p,
153
152
  label: g,
154
153
  loadable: u,
155
154
  circle: d,
156
155
  footer: this.footer,
157
- type: c,
156
+ type: s,
158
157
  onClick: h
159
158
  }, null);
160
159
  },
161
160
  getLeftButtons() {
162
- var e, n, r;
161
+ var e, t, r;
163
162
  let { createButton: i } = this;
164
- return (r = (((e = (n = this.$slots)["toolbar-left"]) == null ? void 0 : e.call(n)) || this.buttons.flatMap((e) => {
165
- let t = c[e];
163
+ return (r = (((e = (t = this.$slots)["toolbar-left"]) == null ? void 0 : e.call(t)) || this.buttons.flatMap((e) => {
164
+ let t = l[e];
166
165
  if (t) {
167
166
  var n, r;
168
167
  return ((n = (r = this.$slots)[e]) == null ? void 0 : n.call(r)) || i(e, t);
169
168
  } else if (e === "slot") {
170
- var a, s;
171
- let e = ((a = (s = this.$slots).default) == null ? void 0 : a.call(s, {
169
+ var a, o;
170
+ let e = ((a = (o = this.$slots).default) == null ? void 0 : a.call(o, {
172
171
  buttons: this.buttons,
173
172
  footer: this.footer
174
173
  })) ?? null;
175
174
  if (e && e.length === 1) {
176
- var l;
177
- return e == null || (l = e[0]) == null || (l = l.children) == null ? void 0 : l.filter((e) => e.type !== o);
175
+ var c;
176
+ return e == null || (c = e[0]) == null || (c = c.children) == null ? void 0 : c.filter((e) => e.type !== s);
178
177
  }
179
178
  return e || [];
180
179
  } else return null;
181
- })).filter((e) => e)) == null ? void 0 : r.filter((e) => e.props.privilege ? t(e.props.privilege) : !0);
180
+ })).filter((e) => e)) == null ? void 0 : r.filter((e) => e.props.privilege ? n(e.props.privilege) : !0);
182
181
  },
183
182
  getRightButtons() {
184
183
  var e, t, n, r;
@@ -191,18 +190,18 @@ var c = {
191
190
  return i || a;
192
191
  },
193
192
  getSearchButton() {
194
- return this.searchable ? this.createButton("search", c.search) : null;
193
+ return this.searchable ? this.createButton("search", l.search) : null;
195
194
  },
196
195
  getRefreshButton() {
197
- return this.refreshable ? this.createButton("reload", c.reload) : null;
196
+ return this.refreshable ? this.createButton("reload", l.reload) : null;
198
197
  },
199
198
  getSettingsButton() {
200
- return this.refreshable ? this.createButton("settings", c.settings) : null;
199
+ return this.refreshable ? this.createButton("settings", l.settings) : null;
201
200
  }
202
201
  },
203
202
  render() {
204
- return this.footer ? s("div", { class: "footer-bar" }, [this.getLeftButtons()]) : s("div", { class: "toolbar" }, [s("div", { class: "toolbar-left" }, [this.getLeftButtons()]), s("div", { class: "toolbar-right" }, [this.getRightButtons()])]);
203
+ return this.footer ? c("div", { class: "footer-bar" }, [this.getLeftButtons()]) : c("div", { class: "toolbar" }, [c("div", { class: "toolbar-left" }, [this.getLeftButtons()]), c("div", { class: "toolbar-right" }, [this.getRightButtons()])]);
205
204
  }
206
205
  };
207
206
  //#endregion
208
- export { l as t };
207
+ export { u as t };
@@ -0,0 +1,71 @@
1
+ import { capitalize as e, copy as t, isArray as n, uncapitalize as r } from "@web-utils/core";
2
+ import { computed as i } from "vue";
3
+ import { ElMessage as a } from "element-plus";
4
+ //#region src/utils/index.ts
5
+ var o = (t, n, r, i) => {
6
+ let a = {};
7
+ if (n) for (let e in t) n(e) && (a[e] = t[e]);
8
+ return r && r.forEach((t) => {
9
+ a[`on${e(t)}`] = (...e) => i(t, ...e);
10
+ }), a;
11
+ }, s = (e, { emit: t, events: n, predicate: r }) => i(() => o(e, r, n, t)), c = (e, { withOn: t = !1 } = {}) => {
12
+ let n = {};
13
+ for (let i in e) i.startsWith("on") && (t ? n[i] = e[i] : n[r(i.replace(/^on/, ""))] = e[i]);
14
+ return n;
15
+ }, l = (e, t = "id", n = "label") => {
16
+ let r = [];
17
+ function i(e, a) {
18
+ if (!e) return;
19
+ let o = [...a, {
20
+ [t]: e[t],
21
+ [n]: e[n]
22
+ }];
23
+ if (!e.children || e.children.length === 0) {
24
+ r.push(o);
25
+ return;
26
+ }
27
+ e.children.forEach((e) => {
28
+ i(e, o);
29
+ });
30
+ }
31
+ return e.forEach((e) => i(e, [])), r;
32
+ }, u = (e, t = "id", n = "label") => {
33
+ let r = [];
34
+ return l(e).forEach((e) => {
35
+ let i = [], a = [];
36
+ for (let r = 0; r < e.length; r++) i.push(e[r][t]), a.push(e[r][n]);
37
+ r.push({
38
+ value: i.join("/"),
39
+ label: a.join("/")
40
+ });
41
+ }), r;
42
+ }, d = (e, t = "id", n = "label") => {
43
+ let r = {};
44
+ return l(e).forEach((e) => {
45
+ let i = [], a = [];
46
+ for (let r = 0; r < e.length; r++) i.push(e[r][t]), a.push(e[r][n]);
47
+ r[i.join("/")] = {
48
+ value: i.join("/"),
49
+ label: a.join("/")
50
+ };
51
+ }), r;
52
+ };
53
+ function f(e) {
54
+ t(e, () => a.success({
55
+ duration: 1e3,
56
+ message: "复制成功!",
57
+ type: "success"
58
+ }), () => a.error({
59
+ duration: 1e3,
60
+ message: "复制失败!",
61
+ type: "error"
62
+ }));
63
+ }
64
+ var p = (e) => {
65
+ let t = [];
66
+ return e && (n(e) ? e.forEach((e) => {
67
+ n(e) ? t.push(...p(e)) : e && t.push(e);
68
+ }) : e && t.push(e)), t;
69
+ };
70
+ //#endregion
71
+ export { d as a, c as i, p as n, u as o, o as r, s, f as t };
@@ -0,0 +1,83 @@
1
+ //#region src/components/table/table-column.ts
2
+ var e = {
3
+ type: {
4
+ type: String,
5
+ default: "default"
6
+ },
7
+ index: [Number, Function],
8
+ label: String,
9
+ columnKey: String,
10
+ prop: String,
11
+ width: [String, Number],
12
+ minWidth: [String, Number],
13
+ fixed: [Boolean, String],
14
+ renderHeader: Function,
15
+ sortable: [Boolean, String],
16
+ sortMethod: Function,
17
+ sortBy: [
18
+ Function,
19
+ String,
20
+ Array
21
+ ],
22
+ sortOrders: {
23
+ type: Array,
24
+ default: () => [
25
+ "ascending",
26
+ "descending",
27
+ null
28
+ ]
29
+ },
30
+ resizable: {
31
+ type: Boolean,
32
+ default: !0
33
+ },
34
+ formatter: Function,
35
+ showOverflowTooltip: {
36
+ type: [Boolean, Object],
37
+ default: !0
38
+ },
39
+ align: {
40
+ type: String,
41
+ default: "left"
42
+ },
43
+ headerAlign: {
44
+ type: String,
45
+ default: "left"
46
+ },
47
+ className: String,
48
+ labelClassName: String,
49
+ selectable: Function,
50
+ reserveSelection: {
51
+ type: Boolean,
52
+ default: !1
53
+ },
54
+ filters: Array,
55
+ filterPlacement: String,
56
+ filterClassName: String,
57
+ filterMultiple: {
58
+ type: Boolean,
59
+ default: !0
60
+ },
61
+ filterMethod: Function,
62
+ filteredValue: {
63
+ type: Array,
64
+ default: () => []
65
+ },
66
+ tooltipFormatter: Function,
67
+ property: String,
68
+ showTooltipWhenOverflow: Boolean,
69
+ clickable: Boolean,
70
+ cellClick: Function,
71
+ dictType: String,
72
+ options: Array,
73
+ autoUpdate: Boolean,
74
+ treeDict: Boolean,
75
+ idAsValue: {
76
+ type: Boolean,
77
+ default: !0
78
+ },
79
+ labelAsValue: Boolean,
80
+ maxWidth: String
81
+ };
82
+ //#endregion
83
+ export { e as t };
@@ -0,0 +1,100 @@
1
+ import { n as e } from "./BQ77eAb3.mjs";
2
+ import { getDictLabel as t } from "../helper/dictionary.mjs";
3
+ import { tableViewContextKey as n } from "../constants/index.mjs";
4
+ import { t as r } from "./BV_N8p9t.mjs";
5
+ import { computed as i, createVNode as a, inject as o, mergeProps as s, ref as c, watchEffect as l } from "vue";
6
+ import { ElTableColumn as u } from "element-plus/es";
7
+ //#endregion
8
+ //#region src/components/table/components/DictRender.vue
9
+ var d = {
10
+ name: "DictRender",
11
+ inheritAttrs: !1,
12
+ props: {
13
+ row: Object,
14
+ column: Object,
15
+ dictType: String,
16
+ options: Array,
17
+ treeDict: Boolean,
18
+ idAsValue: {
19
+ type: Boolean,
20
+ default: !0
21
+ },
22
+ labelAsValue: Boolean
23
+ },
24
+ setup(e, { attrs: n }) {
25
+ let r = c(null), o = i(() => e.row[e.column.property]);
26
+ return l(async () => {
27
+ if (e.dictType) r.value = await t(e.dictType, o.value, !0, {
28
+ options: !0,
29
+ treeDict: e.treeDict,
30
+ idAsValue: e.idAsValue,
31
+ labelAsValue: e.labelAsValue
32
+ });
33
+ else {
34
+ var n;
35
+ r.value = ((n = e.options) == null || (n = n.find((e) => `${e.modelValue}` == `${e.value}`)) == null ? void 0 : n.label) ?? `${o.value}`;
36
+ }
37
+ }), () => a("span", n, [r.value]);
38
+ }
39
+ }, f = {
40
+ selection: !0,
41
+ "single-selection": !0,
42
+ index: !0,
43
+ expand: !0
44
+ }, p = (e, t, n, r, i) => {
45
+ var a;
46
+ let o = (e == null || (a = e.$parent) == null ? void 0 : a.rowDbClick) || (e == null ? void 0 : e.rowDbClick);
47
+ o == null || o(t, n, r, i);
48
+ }, m = (e) => {
49
+ let t = e.target;
50
+ for (; t && t.tagName.toUpperCase() !== "HTML";) {
51
+ if (t.tagName.toUpperCase() === "TD") return t;
52
+ t = t.parentNode;
53
+ }
54
+ return null;
55
+ }, h = () => {}, g = (t) => !e(t).length, _ = {
56
+ name: "TableColumn",
57
+ props: { ...r },
58
+ setup(e, { slots: t, attrs: r }) {
59
+ let i = o(n, null);
60
+ return () => {
61
+ let { clickable: n, cellClick: o, ...c } = e, l, _ = f[e.type];
62
+ if (!_) {
63
+ let s = n || r.onClick || o;
64
+ (s || e.dictType || e.options) && (l = (n) => {
65
+ var c;
66
+ let { row: l, column: u } = n, f = s ? (e) => {
67
+ let t = m(e);
68
+ if (r.onClick || o) {
69
+ var n;
70
+ (n = r.onClick) == null || n.call(r, l, u, l, u, t, e), o == null || o(l, u, l, u, t, e);
71
+ } else p(i, l, u, t, e);
72
+ } : h, _ = t == null || (c = t.default) == null ? void 0 : c.call(t, n);
73
+ return g(_) && (_ = null), (e.dictType || e.options) && !_ ? a(d, {
74
+ class: { "is-clickable": s },
75
+ onClick: f,
76
+ row: l,
77
+ column: u,
78
+ dictType: e.dictType,
79
+ treeDict: e.treeDict,
80
+ idAsValue: e.idAsValue,
81
+ labelAsValue: e.labelAsValue,
82
+ options: e.options
83
+ }, null) : s ? a("span", {
84
+ class: "is-clickable",
85
+ onClick: f
86
+ }, [_ || (l == null ? void 0 : l[u == null ? void 0 : u.property])]) : _;
87
+ });
88
+ }
89
+ return a(u, s(c, {
90
+ key: r.filterable,
91
+ showOverflowTooltip: _ ? !1 : c.showOverflowTooltip
92
+ }), {
93
+ ...t,
94
+ default: l || t.default
95
+ });
96
+ };
97
+ }
98
+ };
99
+ //#endregion
100
+ export { _ as t };