@web-utils/form-ui 1.0.0-beta3 → 1.0.0-beta31

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 (176) hide show
  1. package/api/index.d.ts +60 -0
  2. package/api/index.mjs +42 -0
  3. package/awesome-button/index.d.ts +60 -0
  4. package/awesome-button/index.mjs +49 -0
  5. package/base.css +1 -1
  6. package/chunks/4ZuVpQf6.mjs +478 -0
  7. package/chunks/B99alfW4.mjs +207 -0
  8. package/chunks/BQ77eAb3.mjs +71 -0
  9. package/chunks/BV_N8p9t.mjs +83 -0
  10. package/chunks/BV_P9a8o.mjs +100 -0
  11. package/chunks/BgDYHgyH.mjs +189 -0
  12. package/chunks/Bm5eiSmT.mjs +79 -0
  13. package/chunks/BmZieBZW.mjs +88 -0
  14. package/chunks/Br4i8stg.mjs +222 -0
  15. package/chunks/C3a15Ful.mjs +95 -0
  16. package/chunks/C44-CFi-.mjs +636 -0
  17. package/chunks/C4bM8miy.mjs +174 -0
  18. package/chunks/C9J3j0PX.mjs +93 -0
  19. package/chunks/Cby3mvvZ.mjs +216 -0
  20. package/chunks/Cc3EJjbV.mjs +25 -0
  21. package/chunks/Cgl-hCE5.mjs +25 -0
  22. package/chunks/Ci1XxmdE.mjs +51 -0
  23. package/chunks/CkFapoKt.mjs +8 -0
  24. package/chunks/CsfgUCe9.mjs +17 -0
  25. package/chunks/CugRu2Ka.mjs +42 -0
  26. package/chunks/Cy-4nmyC.mjs +106 -0
  27. package/chunks/D1EOkWJ7.mjs +25 -0
  28. package/chunks/D1G2MMMx.mjs +1360 -0
  29. package/chunks/DO8dVGef.mjs +98 -0
  30. package/chunks/DazglPJZ.mjs +180 -0
  31. package/chunks/Dt6gY213.mjs +62 -0
  32. package/chunks/DtAYXPvz.mjs +108 -0
  33. package/chunks/JhyiXnbd.mjs +76 -0
  34. package/chunks/S64sNmuR.mjs +226 -0
  35. package/chunks/bnRb5PUB.mjs +108 -0
  36. package/chunks/dM-icPM8.mjs +107 -0
  37. package/chunks/pxFLMMUm.mjs +110 -0
  38. package/chunks/q1SlJP1y.mjs +171 -0
  39. package/confirm-button/index.d.ts +113 -0
  40. package/confirm-button/index.mjs +35 -0
  41. package/confirmable/index.d.ts +84 -0
  42. package/confirmable/index.mjs +8 -0
  43. package/constants/index.d.ts +42 -0
  44. package/constants/index.mjs +4 -0
  45. package/dict-render/index.d.ts +28 -0
  46. package/element-dialog/index.d.ts +374 -0
  47. package/element-dialog/index.mjs +2 -91
  48. package/empty-view/index.d.ts +29 -0
  49. package/empty-view/index.mjs +1 -1
  50. package/flex-scroll-area/index.d.ts +22 -0
  51. package/flex-scroll-area/index.mjs +1 -1
  52. package/form-advice/index.d.ts +9 -0
  53. package/form-advice/index.mjs +13 -12
  54. package/form-button/index.d.ts +114 -0
  55. package/form-button/index.mjs +36 -0
  56. package/form-cascader/index.d.ts +486 -0
  57. package/form-cascader/index.mjs +2 -0
  58. package/form-cell/index.d.ts +25 -0
  59. package/form-check-box-group/index.d.ts +295 -0
  60. package/form-check-box-group/index.mjs +1 -1
  61. package/form-checkbox/index.d.ts +273 -0
  62. package/form-checkbox/index.mjs +1 -1
  63. package/form-date-picker/index.d.ts +423 -0
  64. package/form-date-picker/index.mjs +1 -1
  65. package/form-holder/index.d.ts +166 -0
  66. package/form-holder/index.mjs +1 -1
  67. package/form-holder/style.css +1 -1
  68. package/form-image/index.d.ts +226 -0
  69. package/form-image/index.mjs +1 -1
  70. package/form-input/index.d.ts +389 -0
  71. package/form-input/index.mjs +1 -1
  72. package/form-input/style.css +1 -0
  73. package/form-input-cron-expression/index.d.ts +217 -0
  74. package/form-input-cron-expression/index.mjs +2 -0
  75. package/form-input-cron-expression/style.css +1 -0
  76. package/form-input-email/index.d.ts +363 -0
  77. package/form-input-email/index.mjs +1 -1
  78. package/form-input-id-card/index.d.ts +363 -0
  79. package/form-input-id-card/index.mjs +1 -1
  80. package/form-input-number/index.d.ts +327 -0
  81. package/form-input-number/index.mjs +1 -1
  82. package/form-input-phone-number/index.d.ts +363 -0
  83. package/form-input-phone-number/index.mjs +1 -1
  84. package/form-input-tag/index.d.ts +2 -0
  85. package/form-input-time/index.d.ts +2 -0
  86. package/form-item-config-provider/index.d.ts +22 -0
  87. package/form-item-config-provider/index.mjs +24 -0
  88. package/form-item-group/index.d.ts +94 -0
  89. package/form-item-group/index.mjs +2 -78
  90. package/form-item-group/style.css +1 -1
  91. package/form-item-x/index.d.ts +184 -0
  92. package/form-item-x/index.mjs +1 -1
  93. package/form-item-x/style.css +1 -0
  94. package/form-radio-group/index.d.ts +283 -0
  95. package/form-radio-group/index.mjs +1 -1
  96. package/form-rate/index.d.ts +321 -0
  97. package/form-rate/index.mjs +1 -1
  98. package/form-red-table/index.d.ts +21 -0
  99. package/form-red-table/index.mjs +27 -26
  100. package/form-row/index.d.ts +11 -0
  101. package/form-row/index.mjs +1 -1
  102. package/form-select/index.d.ts +542 -0
  103. package/form-select/index.mjs +1 -1
  104. package/form-slider/index.d.ts +350 -0
  105. package/form-slider/index.mjs +1 -1
  106. package/form-switch/index.d.ts +339 -0
  107. package/form-switch/index.mjs +1 -1
  108. package/form-text/index.d.ts +229 -0
  109. package/form-text/index.mjs +1 -1
  110. package/form-view/index.d.ts +2 -0
  111. package/form-view/index.mjs +1 -1
  112. package/helper/dictionary.d.ts +15 -0
  113. package/helper/dictionary.mjs +97 -0
  114. package/hook/useDictionary.d.ts +60 -0
  115. package/hook/useDictionary.mjs +15 -0
  116. package/hook/useVisibilityChange.d.ts +4 -0
  117. package/hook/useVisibilityChange.mjs +14 -0
  118. package/iframe-window/index.d.ts +9 -0
  119. package/iframe-window/index.mjs +37 -0
  120. package/iframe-window/style.css +1 -0
  121. package/index.d.ts +51 -0
  122. package/index.mjs +51 -37
  123. package/month-calendar/index.d.ts +80 -0
  124. package/package.json +12 -7
  125. package/pageable-table/index.d.ts +436 -0
  126. package/pageable-table/index.mjs +2 -0
  127. package/pageable-table/style.css +1 -0
  128. package/resize-observer/index.d.ts +8 -0
  129. package/resize-observer/index.mjs +40 -0
  130. package/resize-observer/style.css +1 -0
  131. package/resolver/index.d.ts +9 -0
  132. package/resolver/index.mjs +29 -0
  133. package/table-column/index.d.ts +160 -0
  134. package/table-column/index.mjs +2 -0
  135. package/table-column/style.css +1 -0
  136. package/table-column-def/index.d.ts +85 -0
  137. package/table-column-def/index.mjs +11 -0
  138. package/table-column-filter/index.d.ts +11 -0
  139. package/table-column-filterable/index.d.ts +10 -0
  140. package/table-view/index.d.ts +2 -0
  141. package/table-view/index.mjs +1 -1
  142. package/toolbar/index.d.ts +129 -0
  143. package/toolbar/index.mjs +1 -8
  144. package/toolbar/style.css +1 -0
  145. package/toolbar-button/index.d.ts +77 -0
  146. package/toolbar-button/index.mjs +1 -8
  147. package/vue-cron/index.d.ts +191 -0
  148. package/vue-cron/index.mjs +2 -0
  149. package/vue-cron/style.css +1 -0
  150. package/web-types.json +1 -1
  151. package/x-input-tag/index.d.ts +2 -0
  152. package/x-input-tag/index.mjs +226 -0
  153. package/x-input-tag/style.css +1 -0
  154. package/year-calendar/index.d.ts +99 -0
  155. package/year-calendar/index.mjs +2 -0
  156. package/year-calendar/style.css +1 -0
  157. package/chunks/B4M_TFeR.mjs +0 -152
  158. package/chunks/B5BIQCcK.mjs +0 -149
  159. package/chunks/BHNKrW1j.mjs +0 -61
  160. package/chunks/BO9jWhBl.mjs +0 -46
  161. package/chunks/BZ8aOa78.mjs +0 -35
  162. package/chunks/Bsz7y4Xp.mjs +0 -73
  163. package/chunks/Bxj372sF.mjs +0 -53
  164. package/chunks/C33EmJN8.mjs +0 -32
  165. package/chunks/C6Li3-l7.mjs +0 -28
  166. package/chunks/CBcdalMX.mjs +0 -35
  167. package/chunks/CdRsyF0n.mjs +0 -43
  168. package/chunks/ClNahmiU.mjs +0 -23
  169. package/chunks/CstztYMu.mjs +0 -28
  170. package/chunks/DC9b53M6.mjs +0 -32
  171. package/chunks/DDVAgRED.mjs +0 -36
  172. package/chunks/DpJQABVD.mjs +0 -91
  173. package/chunks/ZsLNWI9x.mjs +0 -46
  174. package/chunks/jn_iQrVZ.mjs +0 -28
  175. package/constants.mjs +0 -4
  176. package/input/style.css +0 -1
@@ -0,0 +1,207 @@
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
+ //#region src/components/toolbar/Toolbar.vue?vue&type=script&lang.jsx
8
+ var l = {
9
+ back: {
10
+ label: "返回",
11
+ type: "primary",
12
+ icon: "el-icon-arrow-left"
13
+ },
14
+ cancel: {
15
+ label: "取消",
16
+ icon: "el-icon-close"
17
+ },
18
+ create: {
19
+ label: "新增",
20
+ type: "primary",
21
+ icon: "el-icon-plus"
22
+ },
23
+ save: {
24
+ label: "保存",
25
+ type: "primary",
26
+ icon: "el-icon-takeaway-box",
27
+ loadable: !0
28
+ },
29
+ withdraw: {
30
+ label: "提取",
31
+ type: "primary",
32
+ icon: "el-icon-refresh-left"
33
+ },
34
+ edit: {
35
+ label: "编辑",
36
+ type: "primary",
37
+ icon: "el-icon-edit-outline"
38
+ },
39
+ submit: {
40
+ label: "审批办理",
41
+ type: "primary",
42
+ icon: "el-icon-s-promotion"
43
+ },
44
+ publish: {
45
+ label: "发布",
46
+ type: "primary",
47
+ icon: "el-icon-s-promotion"
48
+ },
49
+ agree: {
50
+ label: "同意",
51
+ type: "primary",
52
+ icon: "el-icon-check"
53
+ },
54
+ disagree: {
55
+ label: "不同意",
56
+ type: "primary",
57
+ icon: "el-icon-close"
58
+ },
59
+ reject: {
60
+ label: "退回",
61
+ type: "primary",
62
+ icon: "el-icon-s-release"
63
+ },
64
+ finish: {
65
+ label: "完成",
66
+ type: "primary",
67
+ icon: "el-icon-circle-check"
68
+ },
69
+ enable: {
70
+ label: "启用",
71
+ type: "primary",
72
+ icon: "el-icon-circle-check"
73
+ },
74
+ exp: {
75
+ label: "导出",
76
+ type: "primary",
77
+ icon: "el-icon-download"
78
+ },
79
+ imp: {
80
+ label: "导入",
81
+ type: "primary",
82
+ icon: "el-icon-upload"
83
+ },
84
+ del: {
85
+ label: "删除",
86
+ type: "primary",
87
+ icon: "el-icon-delete"
88
+ },
89
+ print: {
90
+ label: "打印",
91
+ type: "primary",
92
+ icon: "el-icon-printer"
93
+ },
94
+ disabled: {
95
+ label: "禁用",
96
+ type: "primary",
97
+ icon: "el-icon-remove-outline"
98
+ },
99
+ reload: {
100
+ label: "刷新",
101
+ icon: "el-icon-refresh",
102
+ separateLine: !1,
103
+ circle: !0
104
+ },
105
+ settings: {
106
+ label: "设置",
107
+ icon: "el-icon-s-operation",
108
+ separateLine: !1,
109
+ circle: !0
110
+ },
111
+ search: {
112
+ label: "搜索",
113
+ icon: "el-icon-search",
114
+ separateLine: !1,
115
+ circle: !0
116
+ }
117
+ }, u = {
118
+ name: "Toolbar",
119
+ provide() {
120
+ return { [r]: this };
121
+ },
122
+ props: {
123
+ searchable: Boolean,
124
+ refreshable: Boolean,
125
+ buttons: {
126
+ type: Array,
127
+ default: () => ["back"]
128
+ },
129
+ back: Function,
130
+ cancel: Function,
131
+ emitter: {
132
+ type: String,
133
+ default: "self"
134
+ },
135
+ footer: Boolean,
136
+ label: Object
137
+ },
138
+ computed: {},
139
+ methods: {
140
+ goBack() {
141
+ t(this.$route.path);
142
+ },
143
+ createButton(t, { label: n, icon: r, type: s, separateLine: l = !0, loadable: u, circle: d, onClick: f, title: p }) {
144
+ var m;
145
+ let h, g = ((m = this.label) == null ? void 0 : m[t]) || n;
146
+ return h = f || (["back", "cancel"].includes(t) ? this.goBack : (n) => {
147
+ (e(this.$attrs, { withOn: !0 })[`on${o(t)}`] || a)(n);
148
+ }), c(i, {
149
+ "separate-line": l,
150
+ icon: r,
151
+ title: p,
152
+ label: g,
153
+ loadable: u,
154
+ circle: d,
155
+ footer: this.footer,
156
+ type: s,
157
+ onClick: h
158
+ }, null);
159
+ },
160
+ getLeftButtons() {
161
+ var e, t, r;
162
+ let { createButton: i } = this;
163
+ return (r = (((e = (t = this.$slots)["toolbar-left"]) == null ? void 0 : e.call(t)) || this.buttons.flatMap((e) => {
164
+ let t = l[e];
165
+ if (t) {
166
+ var n, r;
167
+ return ((n = (r = this.$slots)[e]) == null ? void 0 : n.call(r)) || i(e, t);
168
+ } else if (e === "slot") {
169
+ var a, o;
170
+ let e = ((a = (o = this.$slots).default) == null ? void 0 : a.call(o, {
171
+ buttons: this.buttons,
172
+ footer: this.footer
173
+ })) ?? null;
174
+ if (e && e.length === 1) {
175
+ var c;
176
+ return e == null || (c = e[0]) == null || (c = c.children) == null ? void 0 : c.filter((e) => e.type !== s);
177
+ }
178
+ return e || [];
179
+ } else return null;
180
+ })).filter((e) => e)) == null ? void 0 : r.filter((e) => e.props.privilege ? n(e.props.privilege) : !0);
181
+ },
182
+ getRightButtons() {
183
+ var e, t, n, r;
184
+ let i = (e = (t = this.$slots)["toolbar-right"]) == null ? void 0 : e.call(t), a = [
185
+ ...((n = (r = this.$slots)["toolbar-right-button"]) == null ? void 0 : n.call(r)) || [],
186
+ this.getRefreshButton(),
187
+ this.getSettingsButton(),
188
+ this.getSearchButton()
189
+ ];
190
+ return i || a;
191
+ },
192
+ getSearchButton() {
193
+ return this.searchable ? this.createButton("search", l.search) : null;
194
+ },
195
+ getRefreshButton() {
196
+ return this.refreshable ? this.createButton("reload", l.reload) : null;
197
+ },
198
+ getSettingsButton() {
199
+ return this.refreshable ? this.createButton("settings", l.settings) : null;
200
+ }
201
+ },
202
+ render() {
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()])]);
204
+ }
205
+ };
206
+ //#endregion
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 };
@@ -0,0 +1,189 @@
1
+ import { s as e } from "./BQ77eAb3.mjs";
2
+ import { formHolderContextKey as t, formViewContextKey as n } from "../constants/index.mjs";
3
+ import r from "../form-advice/index.mjs";
4
+ import i from "../form-red-table/index.mjs";
5
+ import { animate as a } from "@web-utils/core";
6
+ import { computed as o, createVNode as s, inject as c, mergeProps as l, nextTick as u, provide as d, reactive as f, toRef as p, useTemplateRef as m } from "vue";
7
+ import { ElForm as h, ElRow as g } from "element-plus/es";
8
+ //#region src/components/form/props/form.ts
9
+ var _ = {
10
+ model: Object,
11
+ rules: Object,
12
+ inline: {
13
+ type: Boolean,
14
+ default: !1
15
+ },
16
+ labelPosition: {
17
+ type: String,
18
+ default: "right"
19
+ },
20
+ labelWidth: {
21
+ type: [String, Number],
22
+ default: "auto"
23
+ },
24
+ labelSuffix: {
25
+ type: String,
26
+ default: ""
27
+ },
28
+ hideRequiredAsterisk: {
29
+ type: Boolean,
30
+ default: !1
31
+ },
32
+ requireAsteriskPosition: {
33
+ type: String,
34
+ default: "left"
35
+ },
36
+ showMessage: {
37
+ type: Boolean,
38
+ default: !0
39
+ },
40
+ inlineMessage: {
41
+ type: Boolean,
42
+ default: !1
43
+ },
44
+ statusIcon: {
45
+ type: Boolean,
46
+ default: !1
47
+ },
48
+ validateOnRuleChange: {
49
+ type: Boolean,
50
+ default: !0
51
+ },
52
+ size: String,
53
+ disabled: {
54
+ type: Boolean,
55
+ default: void 0
56
+ },
57
+ scrollToError: {
58
+ type: Boolean,
59
+ default: !1
60
+ },
61
+ scrollIntoViewOptions: [Object, Boolean],
62
+ requiredFields: Array,
63
+ disabledFields: Array,
64
+ enabledFields: Array,
65
+ showAdvice: {
66
+ type: Boolean,
67
+ default: !0
68
+ },
69
+ columns: [Array, Object],
70
+ colCount: Number,
71
+ notTableForm: {
72
+ type: Boolean,
73
+ default: void 0
74
+ },
75
+ commentValueColspan: Number,
76
+ commentLabelColspan: Number,
77
+ wrapRow: {
78
+ type: Boolean,
79
+ default: !0
80
+ }
81
+ }, v = {
82
+ showMessage: !0,
83
+ required: !0,
84
+ requiredFields: !0,
85
+ disabledFields: !0,
86
+ enabledFields: !0,
87
+ showAdvice: !0,
88
+ columns: !0,
89
+ colCount: !0,
90
+ notTableForm: !0,
91
+ commentValueColspan: !0,
92
+ commentLabelColspan: !0,
93
+ wrapRow: !0
94
+ }, y = ["validate"], b = (e) => v[e] !== !0, x = {
95
+ name: "FormHolder",
96
+ inheritAttrs: !1,
97
+ props: { ..._ },
98
+ emits: { validate: null },
99
+ setup(_, { slots: v, expose: x, emit: S }) {
100
+ let C = e(_, {
101
+ emit: S,
102
+ events: y,
103
+ predicate: b
104
+ }), w = c(n, null), T = m("form"), E = o(() => _.notTableForm === void 0 ? (w == null ? void 0 : w.tableForm) === void 0 ? !1 : w == null ? void 0 : w.tableForm : !_.notTableForm), D = o(() => E.value ? !1 : _.showMessage), O = o(() => {
105
+ let e = {};
106
+ return _.disabledFields && _.disabledFields.forEach((t) => {
107
+ e[t] = !0;
108
+ }), e;
109
+ }), k = o(() => {
110
+ let e = {};
111
+ return _.enabledFields && _.enabledFields.length && _.enabledFields.forEach((t) => {
112
+ e[t] = !0;
113
+ }), e;
114
+ }), A = o(() => {
115
+ let e = {};
116
+ return _.requiredFields && _.requiredFields.length && _.requiredFields.forEach((t) => {
117
+ e[t] = !0;
118
+ }), e;
119
+ }), j = o(() => _.disabled === !0 ? !0 : _.disabled), M = p(() => _.enabledFields), N = p(() => _.requiredFields), P = p(() => _.disabledFields), F = async () => {
120
+ await u();
121
+ let e = T.value.$el.querySelector(".el-form-item.is-error");
122
+ e && e.scrollIntoView({
123
+ block: "center",
124
+ inline: "center",
125
+ behavior: "smooth"
126
+ });
127
+ }, I = f({
128
+ tableForm: E,
129
+ disabled: j,
130
+ enabledFields: M,
131
+ requiredFields: N,
132
+ enabledFieldsMap: k,
133
+ disabledFieldsMap: O,
134
+ requiredFieldsMap: A,
135
+ disabledFields: P,
136
+ scrollIntoRequiredField: F,
137
+ formRef: T,
138
+ validate: async () => {
139
+ try {
140
+ return await T.value.validate();
141
+ } catch {
142
+ throw await F(), T.value.$el.querySelectorAll(".el-form-item.is-error .el-form-item__content > :first-child").forEach((e) => {
143
+ a(e, "breathe-animation");
144
+ }), Error("表单验证不通过!");
145
+ }
146
+ },
147
+ validateField: (e) => T.value.validateField(e),
148
+ resetFields: (e) => T.value.resetFields(e),
149
+ scrollToField: (e) => T.value.scrollToField(e),
150
+ clearValidate: (e) => T.value.clearValidate(e),
151
+ getField: () => T.value.getField(),
152
+ setInitialValues: (e) => T.value.setInitialValues(e),
153
+ getFields: () => T.value.fields
154
+ });
155
+ return d(t, I), x(I), () => s(h, l({
156
+ ref: "form",
157
+ class: "form-holder",
158
+ "show-message": D.value
159
+ }, C.value), { default: () => {
160
+ if (E.value) {
161
+ var e, t, n;
162
+ return [
163
+ (e = v.top) == null ? void 0 : e.call(v),
164
+ s(i, {
165
+ class: { "hide-error-message": E.value },
166
+ columns: _.columns,
167
+ "col-count": _.colCount
168
+ }, { default: () => {
169
+ var e;
170
+ return [(e = v.default) == null ? void 0 : e.call(v), _.showAdvice ? s(r, {
171
+ "label-colspan": _.commentLabelColspan,
172
+ "value-colspan": _.commentValueColspan
173
+ }, null) : null];
174
+ } }),
175
+ (t = v.bottom) == null ? void 0 : t.call(v),
176
+ s("div", { class: "red-form-footer" }, [(n = v.footer) == null ? void 0 : n.call(v)])
177
+ ];
178
+ } else {
179
+ var a;
180
+ return _.wrapRow ? s(g, null, { default: () => {
181
+ var e;
182
+ return [(e = v.default) == null ? void 0 : e.call(v)];
183
+ } }) : (a = v.default) == null ? void 0 : a.call(v);
184
+ }
185
+ } });
186
+ }
187
+ };
188
+ //#endregion
189
+ export { x as t };