@web-utils/form-ui 1.0.0-beta55 → 1.0.0-beta57

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 (167) hide show
  1. package/api/index.d.ts +6 -0
  2. package/chunks/-qKZw-3p2.mjs +23 -0
  3. package/chunks/{B3A-CnYr.mjs → 33G2_TH8.mjs} +4 -4
  4. package/chunks/{gLPy4Sus.mjs → 8P-OAGbj.mjs} +1 -1
  5. package/chunks/B2PuSZ_F.mjs +35 -0
  6. package/chunks/B6B-rhhB.mjs +37 -0
  7. package/chunks/{C7Mak2La.mjs → BHT38Us-.mjs} +7 -6
  8. package/chunks/BWoKh6f6.mjs +66 -0
  9. package/chunks/{Dt_s96gL2.mjs → BXrA0SYn2.mjs} +2 -2
  10. package/chunks/BZ0v5mka.mjs +30 -0
  11. package/chunks/CE1uX9hJ.mjs +95 -0
  12. package/chunks/CGnOR2gn.mjs +59 -0
  13. package/chunks/CJ1-f8sg.mjs +30 -0
  14. package/chunks/{5KomemiE2.mjs → CUq3MOiQ2.mjs} +29 -29
  15. package/chunks/CdzoVG6J.mjs +47 -0
  16. package/chunks/{Dg4R65aG2.mjs → CqoMZ9Wo2.mjs} +2 -2
  17. package/chunks/CrQmTHMA.mjs +105 -0
  18. package/chunks/Crh2RUrS.mjs +106 -0
  19. package/chunks/DBUJ7Bva.mjs +56 -0
  20. package/chunks/DB_UKPay.mjs +27 -0
  21. package/chunks/{BvKUeniN.mjs → DEC2O0q-.mjs} +46 -44
  22. package/chunks/{BoJgSMkL.mjs → DUhF8YOY.mjs} +2 -2
  23. package/chunks/Du1PslcN.mjs +28 -0
  24. package/chunks/{Dluor05A.mjs → DyEYDv4B.mjs} +7 -6
  25. package/chunks/EAJCsX8W.mjs +32 -0
  26. package/chunks/{Bq62m7IR2.mjs → T4GdQtY8.mjs} +11 -11
  27. package/chunks/ZFJ73RWd2.mjs +29 -0
  28. package/chunks/{D2B9Y3oT.mjs → fmIV_kHp.mjs} +2 -2
  29. package/chunks/h5488Kii.mjs +27 -0
  30. package/chunks/k3cC9SGC.mjs +27 -0
  31. package/chunks/{CauzhVSa2.mjs → rJWvEBq9.mjs} +12 -12
  32. package/chunks/{7GmKqdbC.mjs → usyXQe35.mjs} +1 -1
  33. package/chunks/{BpCiVuKL.mjs → v3wbYL_-.mjs} +7 -6
  34. package/chunks/vd9nXj8B.mjs +59 -0
  35. package/chunks/{g8MIBMw92.mjs → ztBRZQwM.mjs} +13 -13
  36. package/confirm-button/index.mjs +1 -1
  37. package/confirmable/index.mjs +1 -1
  38. package/constants/index.d.ts +18 -0
  39. package/editable-tree/index.d.ts +27 -0
  40. package/editable-tree/index.mjs +591 -2
  41. package/element-dialog/index.mjs +1 -1
  42. package/element-resize-observer/index.mjs +1 -1
  43. package/form-cascader/index.mjs +1 -1
  44. package/form-checkbox/index.mjs +1 -1
  45. package/form-checkbox-group/index.d.ts +3 -0
  46. package/form-checkbox-group/index.mjs +1 -1
  47. package/form-date-picker/index.d.ts +6 -0
  48. package/form-date-picker/index.mjs +1 -1
  49. package/form-holder/index.mjs +1 -1
  50. package/form-holder/style.css +1 -1
  51. package/form-image/index.mjs +1 -1
  52. package/form-input/index.mjs +1 -1
  53. package/form-input-cron-expression/index.mjs +1 -1
  54. package/form-input-email/index.mjs +1 -1
  55. package/form-input-id-card/index.mjs +1 -1
  56. package/form-input-number/index.mjs +1 -1
  57. package/form-input-phone-number/index.mjs +1 -1
  58. package/form-input-tag/index.mjs +1 -1
  59. package/form-input-time/index.mjs +1 -1
  60. package/form-item-config-provider/index.d.ts +18 -0
  61. package/form-item-group/index.mjs +1 -1
  62. package/form-item-x/index.mjs +1 -1
  63. package/form-item-x/style.css +1 -1
  64. package/form-radio-group/index.mjs +1 -1
  65. package/form-rate/index.mjs +1 -1
  66. package/form-row/index.mjs +1 -1
  67. package/form-select/index.mjs +1 -1
  68. package/form-slider/index.mjs +1 -1
  69. package/form-switch/index.mjs +1 -1
  70. package/form-table/index.mjs +1 -1
  71. package/form-table-plus/index.mjs +1 -1
  72. package/form-text/index.mjs +1 -1
  73. package/form-textarea/index.mjs +1 -1
  74. package/form-time-select/index.mjs +1 -1
  75. package/helper/dictionary.d.ts +14 -0
  76. package/helper/dictionary.mjs +1 -1
  77. package/helper/form-item.d.ts +8 -1
  78. package/helper/form-item.mjs +27 -2
  79. package/helper/input.d.ts +3 -0
  80. package/helper/input.mjs +1 -1
  81. package/helper/sub-table-plus.d.ts +60 -0
  82. package/iframe-window/index.mjs +1 -1
  83. package/index.css +1 -1
  84. package/index.mjs +37 -37
  85. package/package.json +1 -1
  86. package/pageable-table/index.mjs +1 -1
  87. package/props/cascader.d.ts +326 -0
  88. package/{chunks/Czz_49pC.mjs → props/cascader.mjs} +8 -58
  89. package/props/checkbox-group.d.ts +213 -0
  90. package/props/checkbox-group.mjs +83 -0
  91. package/props/checkbox.d.ts +202 -0
  92. package/props/checkbox.mjs +71 -0
  93. package/props/col.d.ts +74 -0
  94. package/props/col.mjs +32 -0
  95. package/props/common.d.ts +114 -0
  96. package/props/common.mjs +18 -0
  97. package/props/date.d.ts +339 -0
  98. package/props/date.mjs +145 -0
  99. package/props/form-item.d.ts +144 -0
  100. package/props/form-item.mjs +73 -0
  101. package/props/form.d.ts +157 -0
  102. package/props/form.mjs +89 -0
  103. package/props/image.d.ts +102 -0
  104. package/props/image.mjs +10 -0
  105. package/props/input-cron.d.ts +102 -0
  106. package/props/input-cron.mjs +16 -0
  107. package/props/input-number.d.ts +216 -0
  108. package/props/input-number.mjs +72 -0
  109. package/props/input-tag.d.ts +123 -0
  110. package/props/input-tag.mjs +33 -0
  111. package/props/input.d.ts +299 -0
  112. package/props/input.mjs +97 -0
  113. package/props/radio-group.d.ts +205 -0
  114. package/props/radio-group.mjs +84 -0
  115. package/props/rate.d.ts +211 -0
  116. package/{chunks/D0kIhzQo.mjs → props/rate.mjs} +7 -28
  117. package/props/select.d.ts +450 -0
  118. package/props/select.mjs +218 -0
  119. package/props/slide.d.ts +235 -0
  120. package/{chunks/DZrQmH9Y.mjs → props/slide.mjs} +7 -28
  121. package/props/switch.d.ts +229 -0
  122. package/{chunks/ecpQ-ODX.mjs → props/switch.mjs} +7 -33
  123. package/props/text.d.ts +127 -0
  124. package/props/text.mjs +22 -0
  125. package/props/textarea.d.ts +266 -0
  126. package/{chunks/CNK4mfga.mjs → props/textarea.mjs} +19 -31
  127. package/props/time-select.d.ts +216 -0
  128. package/props/time-select.mjs +67 -0
  129. package/props/time.d.ts +304 -0
  130. package/{chunks/C3MF_-bN.mjs → props/time.mjs} +8 -39
  131. package/props/tree.d.ts +76 -0
  132. package/props/tree.mjs +75 -0
  133. package/sub-table/index.d.ts +3 -0
  134. package/sub-table/index.mjs +1 -1
  135. package/sub-table-plus/index.mjs +1 -1
  136. package/table-column/index.mjs +1 -1
  137. package/table-column-def/index.mjs +1 -1
  138. package/table-view/index.mjs +13 -13
  139. package/toolbar/index.mjs +1 -1
  140. package/toolbar-button/index.mjs +1 -1
  141. package/vue-cron/index.mjs +1 -1
  142. package/web-types.json +1 -1
  143. package/x-input-tag/index.mjs +2 -2
  144. package/year-calendar/index.mjs +1 -1
  145. package/year-calendar/style.css +1 -1
  146. package/chunks/6GcIyEQV.mjs +0 -95
  147. package/chunks/8c9TEVNY.mjs +0 -36
  148. package/chunks/AAZfNtly.mjs +0 -119
  149. package/chunks/BKlMENhV.mjs +0 -57
  150. package/chunks/BNVYEWWW.mjs +0 -57
  151. package/chunks/BTuzBfTA.mjs +0 -141
  152. package/chunks/C6Dq9Dgb.mjs +0 -17
  153. package/chunks/C6u76g6o.mjs +0 -158
  154. package/chunks/CLO5X9Lb.mjs +0 -176
  155. package/chunks/CdoiMj7L2.mjs +0 -39
  156. package/chunks/DTVTvvq-.mjs +0 -189
  157. package/chunks/DWE67l1f.mjs +0 -317
  158. package/chunks/DWMePN6q.mjs +0 -660
  159. package/chunks/D_L1p3vm2.mjs +0 -90
  160. package/chunks/Dy_5vPdP.mjs +0 -101
  161. package/chunks/Goee5Y-H.mjs +0 -198
  162. /package/chunks/{BlxLaWcU.mjs → 6av50rJm.mjs} +0 -0
  163. /package/chunks/{CkOD-_VV.mjs → B1MSrc6f.mjs} +0 -0
  164. /package/chunks/{BNqVEHk_.mjs → C-0zqLII.mjs} +0 -0
  165. /package/chunks/{xq_LR6R2.mjs → CI1ehQi5.mjs} +0 -0
  166. /package/chunks/{DcTVYqeJ.mjs → DuOxL6xh.mjs} +0 -0
  167. /package/chunks/{CXsoKP22.mjs → mekxD3ef.mjs} +0 -0
@@ -1,158 +0,0 @@
1
- import { n as e, o as t, t as n } from "./BvKUeniN.mjs";
2
- import { n as r, t as i } from "./C6Dq9Dgb.mjs";
3
- import { validatePhoneNum as a } from "@web-utils/core";
4
- import { computed as o, createVNode as s, mergeProps as c, useModel as l } from "vue";
5
- import { ElInput as u } from "element-plus/es";
6
- //#region src/utils/form-validate.ts
7
- var d = (e, t, n) => t && !/^[A-Za-z0-9\u4e00-\u9fa5_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(t) ? n(/* @__PURE__ */ Error("invalid")) : n();
8
- function f(e, t, n) {
9
- t && !/^[1-9][0-9]{5}(18|19|(2[0-9]))[0-9]{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)[0-9]{3}[0-9Xx]$/.test(t) ? n(/* @__PURE__ */ Error("invalid")) : n();
10
- }
11
- function p(e, t, n) {
12
- if (this.$refs.table.$refs.table.records.length === 0) {
13
- n(Error(e.message || `请添加${e.label}`));
14
- return;
15
- }
16
- n();
17
- }
18
- //#endregion
19
- //#region src/components/form/props/input.ts
20
- var m = {
21
- ...r,
22
- ...i,
23
- type: {
24
- type: String,
25
- default: "text"
26
- },
27
- modelValue: [String, Number],
28
- modelModifiers: Object,
29
- maxlength: {
30
- type: [String, Number],
31
- default: 255
32
- },
33
- minlength: [String, Number],
34
- showWordLimit: {
35
- type: Boolean,
36
- default: !1
37
- },
38
- wordLimitPosition: {
39
- type: String,
40
- default: "inside"
41
- },
42
- placeholder: String,
43
- clearable: {
44
- type: Boolean,
45
- default: !0
46
- },
47
- clearIcon: [String, Object],
48
- formatter: Function,
49
- parser: Function,
50
- showPassword: {
51
- type: Boolean,
52
- default: !1
53
- },
54
- size: String,
55
- prefixIcon: [String, Object],
56
- suffixIcon: [String, Object],
57
- rows: {
58
- type: Number,
59
- default: 4
60
- },
61
- autosize: [Boolean, Object],
62
- autocomplete: {
63
- type: String,
64
- default: "off"
65
- },
66
- name: String,
67
- readonly: {
68
- type: Boolean,
69
- default: !1
70
- },
71
- max: [String, Number],
72
- min: [String, Number],
73
- step: [String, Number],
74
- resize: String,
75
- autofocus: {
76
- type: Boolean,
77
- default: !1
78
- },
79
- form: String,
80
- ariaLabel: String,
81
- tabindex: [String, Number],
82
- validateEvent: {
83
- type: Boolean,
84
- default: !0
85
- },
86
- inputStyle: [String, Object],
87
- inputmode: String,
88
- countGraphemes: Function,
89
- prepend: String,
90
- append: String,
91
- prefix: String,
92
- suffix: String,
93
- picker: Boolean,
94
- readonlyGrey: {
95
- type: Boolean,
96
- default: !0
97
- }
98
- }, h = {
99
- readonly: !0,
100
- prefixIcon: !0,
101
- disabled: !0,
102
- suffixIcon: !0,
103
- placeholder: !0,
104
- modelValue: !0,
105
- block: !0,
106
- readonlyGrey: !0,
107
- picker: !0,
108
- append: !0,
109
- prefix: !0,
110
- suffix: !0,
111
- prepend: !0
112
- }, g = (e) => r[e] === void 0 && h[e] !== !0, _ = {
113
- name: "FormInput",
114
- inheritAttrs: !1,
115
- props: { ...m },
116
- emits: { ...e },
117
- setup(e, { emit: r, slots: i, attrs: p }) {
118
- let m = l(e, "modelValue"), h = `请输入正确的${e.label}!`, { render: _, placeholder: v, disabled: y, listeners: b, inputProps: x, printing: S } = t(e, {
119
- emit: r,
120
- slots: i,
121
- attrs: p,
122
- rules: o(() => {
123
- if (!e.type || e.type === "textarea") return null;
124
- let t = {
125
- message: h,
126
- trigger: "blur"
127
- };
128
- if (e.type === "email") t.validator = d;
129
- else if (e.type === "idcard") t.validator = f;
130
- else if (e.type === "phone") t.validator = a;
131
- else return null;
132
- return [t];
133
- }),
134
- predicate: g
135
- });
136
- return () => _({ vNodes: S.value ? e.modelValue : s(u, c(b.value, x.value, {
137
- class: ["form-input", {
138
- "is-readonly": e.readonlyGrey && e.readonly && !e.picker,
139
- "el-input-cursor-pointer": e.picker && !y.value
140
- }],
141
- modelValue: m.value,
142
- "onUpdate:modelValue": (e) => m.value = e,
143
- disabled: y.value,
144
- placeholder: v.value,
145
- readonly: e.readonly || e.picker,
146
- "prefix-icon": n({ icon: e.picker ? "el-icon-search" : e.prefixIcon }),
147
- "suffix-icon": n({ icon: e.suffixIcon })
148
- }), {
149
- prefix: i.prefix || e.prefix ? () => e.prefix : null,
150
- suffix: i.suffix || e.suffix ? () => e.suffix : null,
151
- "password-icon": i["password-icon"],
152
- prepend: i.prepend || e.prepend ? () => e.prepend : null,
153
- append: i.append || e.append ? () => e.append : null
154
- }) });
155
- }
156
- };
157
- //#endregion
158
- export { m as n, p as r, _ as t };
@@ -1,176 +0,0 @@
1
- import { n as e, o as t } from "./BvKUeniN.mjs";
2
- import { n } from "./C6Dq9Dgb.mjs";
3
- import { useDictionary as r } from "../hook/useDictionary.mjs";
4
- import { t as i } from "./C6u76g6o.mjs";
5
- import { computed as a, createVNode as o, defineComponent as s, isVNode as c, mergeProps as l, useModel as u } from "vue";
6
- import { ElCheckbox as d, ElCheckboxButton as f, ElCheckboxGroup as p } from "element-plus/es";
7
- //#region src/components/form/props/checkbox-group.ts
8
- var m = {
9
- ...n,
10
- modelValue: {
11
- type: [Array, String],
12
- default: () => []
13
- },
14
- size: String,
15
- min: Number,
16
- max: Number,
17
- ariaLabel: String,
18
- textColor: {
19
- type: String,
20
- default: "#ffffff"
21
- },
22
- fill: {
23
- type: String,
24
- default: "#409eff"
25
- },
26
- tag: {
27
- type: String,
28
- default: "div"
29
- },
30
- validateEvent: {
31
- type: Boolean,
32
- default: !0
33
- },
34
- options: {
35
- type: Array,
36
- default: () => []
37
- },
38
- props: {
39
- type: Object,
40
- default: () => ({
41
- value: "value",
42
- label: "label",
43
- disabled: "disabled"
44
- })
45
- },
46
- type: {
47
- type: String,
48
- default: "checkbox"
49
- },
50
- stringMode: Boolean,
51
- delimiter: {
52
- type: String,
53
- default: ","
54
- },
55
- other: [String],
56
- otherVal: [String],
57
- otherProp: String,
58
- otherPlaceholder: String,
59
- otherLabel: String,
60
- otherWidth: {
61
- type: String,
62
- default: "200px"
63
- },
64
- otherMaxLength: String,
65
- gender: Boolean,
66
- confirm: Boolean,
67
- labelProp: {
68
- type: String,
69
- default: "name"
70
- },
71
- valueProp: {
72
- type: String,
73
- default: "code"
74
- },
75
- split: Boolean,
76
- sort: Boolean,
77
- classic: Boolean,
78
- fillRow: Boolean,
79
- ellipsis: Boolean,
80
- dictType: String
81
- }, h = {
82
- modelValue: !0,
83
- type: !0,
84
- disabled: !0,
85
- options: !0
86
- }, g = (e) => n[e] === void 0 && h[e] !== !0;
87
- //#endregion
88
- //#region src/components/form/FormCheckboxGroup.vue?vue&type=script&lang.jsx
89
- function _(e) {
90
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !c(e);
91
- }
92
- //#endregion
93
- //#region src/components/form/FormCheckboxGroup.vue
94
- var v = /* @__PURE__ */ s({
95
- name: "FormCheckboxGroup",
96
- inheritAttrs: !1,
97
- props: { ...m },
98
- emits: {
99
- ...e,
100
- "update:other": null
101
- },
102
- setup(e, { emit: n, slots: s, attrs: c }) {
103
- let m = u(e, "other"), { emitInput: h, render: v, disabled: y, listeners: b, inputProps: x } = t(e, {
104
- emit: n,
105
- slots: s,
106
- attrs: c,
107
- predicate: g,
108
- messagePrefix: "请选择",
109
- class: a(() => ["form-checkbox-group", {
110
- "form-checkbox-group-row": e.fillRow,
111
- "form-checkbox-group-row-break-word": e.fillRow,
112
- "form-checkbox-group-row-ellipsis": e.ellipsis
113
- }])
114
- }), S = (t) => {
115
- let n = t;
116
- e.sort && (n = t.sort()), e.stringMode || e.split ? h(n.join(",")) : h(n);
117
- }, C = a(() => {
118
- if (e.stringMode || e.split) {
119
- var t;
120
- return Array.isArray(e.modelValue) ? e.modelValue.filter((e) => e) : ((t = e.modelValue) == null ? void 0 : t.split(e.delimiter).filter((e) => e)) ?? [];
121
- }
122
- return e.modelValue || [];
123
- }), w = a(() => e.classic ? "label" : e.labelProp), T = a(() => e.classic ? "value" : e.valueProp), { dictItems: E } = r(e), D = a(() => e.dictType ? E.value : e.gender ? [{
124
- [w.value]: "男",
125
- [T.value]: "男"
126
- }, {
127
- [w.value]: "女",
128
- [T.value]: "女"
129
- }] : e.confirm ? [{
130
- [w.value]: "是",
131
- [T.value]: "是"
132
- }, {
133
- [w.value]: "否",
134
- [T.value]: "否"
135
- }] : e.options);
136
- return () => v({ vNodes: [o(p, l(b.value, x.value, {
137
- modelValue: C.value,
138
- disabled: y.value,
139
- "onUpdate:modelValue": S
140
- }), {
141
- ...s,
142
- default: s.default || (() => {
143
- var t;
144
- return (t = D.value) == null ? void 0 : t.map(({ value: t, label: n, disabled: r }) => e.type === "button" ? o(f, {
145
- key: t,
146
- value: t,
147
- disabled: r
148
- }, _(n) ? n : { default: () => [n] }) : o(d, {
149
- key: t,
150
- value: t,
151
- disabled: r
152
- }, _(n) ? n : { default: () => [n] }));
153
- })
154
- }), C.value.includes(e.otherVal) ? o(i, {
155
- "wrap-col": !1,
156
- class: "form-checkbox-group-other",
157
- "hide-label": !0,
158
- "label-width": "0",
159
- prop: e.otherProp,
160
- disabled: y.value,
161
- required: !!e.otherProp,
162
- placeholder: e.otherPlaceholder,
163
- label: e.otherLabel,
164
- "show-message": !!e.otherLabel,
165
- style: e.otherLabel ? { width: e.otherWidth } : {
166
- marginBottom: 0,
167
- width: e.otherWidth
168
- },
169
- modelValue: m.value,
170
- "onUpdate:modelValue": (e) => m.value = e,
171
- "max-length": e.otherMaxLength
172
- }, null) : null] });
173
- }
174
- });
175
- //#endregion
176
- export { v as t };
@@ -1,39 +0,0 @@
1
- import { f as e } from "./DcTVYqeJ.mjs";
2
- import { t } from "./AAZfNtly.mjs";
3
- import { r as n } from "./BvKUeniN.mjs";
4
- import { n as r } from "./C6Dq9Dgb.mjs";
5
- import { createVNode as i, mergeProps as a } from "vue";
6
- import { ElText as o } from "element-plus/es";
7
- //#region src/components/form/props/text.ts
8
- var s = {
9
- ...r,
10
- type: String,
11
- size: {
12
- type: String,
13
- default: "default"
14
- },
15
- truncated: {
16
- type: Boolean,
17
- default: !1
18
- },
19
- lineClamp: [String, Number],
20
- tag: {
21
- type: String,
22
- default: "span"
23
- },
24
- text: String
25
- }, c = { modelValue: !0 }, l = (e) => r[e] === void 0 && c[e] !== !0, u = {
26
- name: "FormText",
27
- inheritAttrs: !1,
28
- props: { ...s },
29
- setup(r, { slots: s, attrs: c }) {
30
- let u = t(r, { attrs: c }), d = e(r, l);
31
- return () => n(r, {
32
- vNodes: i(o, a(d.value, c), { default: s.default || (() => r.text) }),
33
- formItemProps: u,
34
- slots: s
35
- });
36
- }
37
- };
38
- //#endregion
39
- export { u as t };
@@ -1,189 +0,0 @@
1
- import { d as e } from "./DcTVYqeJ.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 = (e) => v[e] !== !0, b = {
95
- name: "FormHolder",
96
- inheritAttrs: !1,
97
- props: { ..._ },
98
- emits: {},
99
- setup(_, { slots: v, expose: b, attrs: x }) {
100
- let { autoBindProps: S, listeners: C } = e(_, { predicate: y }), 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(() => {
101
- let e = {};
102
- return _.disabledFields && _.disabledFields.forEach((t) => {
103
- e[t] = !0;
104
- }), e;
105
- }), k = o(() => {
106
- let e = {};
107
- return _.enabledFields && _.enabledFields.length && _.enabledFields.forEach((t) => {
108
- e[t] = !0;
109
- }), e;
110
- }), A = o(() => {
111
- let e = {};
112
- return _.requiredFields && _.requiredFields.length && _.requiredFields.forEach((t) => {
113
- e[t] = !0;
114
- }), e;
115
- }), j = o(() => _.disabled === !0 ? !0 : _.disabled), M = p(() => _.enabledFields), N = p(() => _.requiredFields), P = p(() => _.disabledFields), F = async () => {
116
- await u();
117
- let e = T.value.$el.querySelector(".el-form-item.is-error");
118
- e && e.scrollIntoView({
119
- block: "center",
120
- inline: "center",
121
- behavior: "smooth"
122
- });
123
- }, I = f({
124
- tableForm: E,
125
- disabled: j,
126
- enabledFields: M,
127
- requiredFields: N,
128
- enabledFieldsMap: k,
129
- disabledFieldsMap: O,
130
- requiredFieldsMap: A,
131
- disabledFields: P,
132
- scrollIntoRequiredField: F,
133
- formRef: T,
134
- validate: async () => {
135
- try {
136
- return await T.value.validate();
137
- } catch {
138
- throw await F(), T.value.$el.querySelectorAll(".el-form-item.is-error .el-form-item__content > :first-child").forEach((e) => {
139
- a(e, "breathe-animation");
140
- }), Error("表单验证不通过!");
141
- }
142
- },
143
- validateField: (e) => T.value.validateField(e),
144
- resetFields: (e) => T.value.resetFields(e),
145
- scrollToField: (e) => T.value.scrollToField(e),
146
- clearValidate: (e) => T.value.clearValidate(e),
147
- getField: () => T.value.getField(),
148
- setInitialValues: (e) => T.value.setInitialValues(e),
149
- getFields: () => T.value.fields
150
- });
151
- return d(t, I), b(I), () => s(h, l(C.value, S.value, x, {
152
- ref: "form",
153
- class: [
154
- "form-holder",
155
- "clear-fix",
156
- { "red-form": E }
157
- ],
158
- "show-message": D.value
159
- }), { 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 { b as t };