@web-utils/form-ui 1.0.0-beta18 → 1.0.0-beta19

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 (44) hide show
  1. package/chunks/{DkqF25wT.mjs → B3DY36vM.mjs} +1 -1
  2. package/chunks/{53gSZ624.mjs → B9-9iYg8.mjs} +2 -1
  3. package/chunks/{7Desvoh-.mjs → BAm_wcwz.mjs} +6 -2
  4. package/chunks/{7vQ29mMd.mjs → BSriw1Qr.mjs} +1 -1
  5. package/chunks/{DUDm42gn.mjs → Be_E_4G0.mjs} +16 -10
  6. package/chunks/{D2WviyxF.mjs → Bk3PtIYo.mjs} +6 -1
  7. package/chunks/{Bj5l6sFx.mjs → CJeq96R0.mjs} +1 -1
  8. package/chunks/CNtf2MHr.mjs +106 -0
  9. package/chunks/{BsbfEk0E.mjs → CPE8fqJc.mjs} +2 -2
  10. package/chunks/{DH1_fmkX.mjs → DAS1h_Ei.mjs} +2 -2
  11. package/chunks/{Bb5BT11-.mjs → D_Xobj10.mjs} +2 -2
  12. package/chunks/{CKw_uzPc.mjs → DgCwGit4.mjs} +1 -1
  13. package/chunks/nJ1-P9vh.mjs +189 -0
  14. package/constants.d.ts +10 -0
  15. package/constants.mjs +2 -2
  16. package/form-date-picker/index.mjs +1 -1
  17. package/form-holder/index.mjs +1 -1
  18. package/form-input/index.mjs +1 -1
  19. package/form-input-cron-expression/index.mjs +1 -1
  20. package/form-input-email/index.mjs +1 -1
  21. package/form-input-id-card/index.mjs +1 -1
  22. package/form-input-number/index.mjs +1 -1
  23. package/form-input-phone-number/index.mjs +1 -1
  24. package/form-item-config-provider/index.mjs +6 -6
  25. package/form-item-group/index.d.ts +91 -17
  26. package/form-item-group/index.mjs +2 -94
  27. package/form-item-group/style.css +1 -1
  28. package/form-radio-group/index.mjs +1 -1
  29. package/form-rate/index.mjs +1 -1
  30. package/form-row/index.mjs +1 -1
  31. package/form-select/index.mjs +1 -1
  32. package/form-slider/index.mjs +1 -1
  33. package/form-switch/index.d.ts +18 -4
  34. package/form-switch/index.mjs +1 -1
  35. package/form-text/index.d.ts +2 -0
  36. package/form-text/index.mjs +1 -1
  37. package/index.mjs +16 -16
  38. package/package.json +1 -1
  39. package/web-types.json +1 -1
  40. package/chunks/DCKxvrCR.mjs +0 -189
  41. /package/chunks/{Q9EsFJ4H.mjs → B7fKv2-x.mjs} +0 -0
  42. /package/chunks/{CFwUzdTu.mjs → BJObhbQz.mjs} +0 -0
  43. /package/chunks/{B4LDPAZu.mjs → D7hrSVVl.mjs} +0 -0
  44. /package/chunks/{98bTmBOR.mjs → DdDv8RSI.mjs} +0 -0
@@ -1,189 +0,0 @@
1
- import { formHolderContextKey as e } from "../constants.mjs";
2
- import { n as t } from "./Bh_CMUlo.mjs";
3
- import n from "../form-advice/index.mjs";
4
- import r from "../form-red-table/index.mjs";
5
- import { ElForm as i, ElRow as a } from "element-plus/es";
6
- import { computed as o, createVNode as s, inject as c, mergeProps as l, nextTick as u, provide as d, reactive as f, useTemplateRef as p } from "vue";
7
- import { animate as m } from "@web-utils/core";
8
- //#region src/components/form/props/form.js
9
- var h = {
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
- }, g = {
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
- }, _ = ["validate"], v = (e) => g[e] !== !0, y = {
95
- name: "FormHolder",
96
- inheritAttrs: !1,
97
- props: { ...h },
98
- emits: { validate: null },
99
- setup(h, { slots: g, expose: y, emit: b }) {
100
- let x = t(h, {
101
- emit: b,
102
- events: _,
103
- predicate: v
104
- }), S = c("formView", null), C = p("form"), w = o(() => h.notTableForm === void 0 ? (S == null ? void 0 : S.tableForm) === void 0 ? !1 : S == null ? void 0 : S.tableForm : !h.notTableForm), T = o(() => w.value ? !1 : h.showMessage), E = o(() => {
105
- let e = {};
106
- return h.disabledFields && h.disabledFields.forEach((t) => {
107
- e[t] = !0;
108
- }), e;
109
- }), D = o(() => {
110
- let e = {};
111
- return h.enabledFields && h.enabledFields.length && h.enabledFields.forEach((t) => {
112
- e[t] = !0;
113
- }), e;
114
- }), O = o(() => {
115
- let e = {};
116
- return h.requiredFields && h.requiredFields.length && h.requiredFields.forEach((t) => {
117
- e[t] = !0;
118
- }), e;
119
- }), k = o(() => h.disabled === !0 ? !0 : h.disabled), A = o(() => h.enabledFields), j = o(() => h.requiredFields), M = o(() => h.disabledFields), N = async () => {
120
- await u();
121
- let e = C.value.$el.querySelector(".el-form-item.is-error");
122
- e && e.scrollIntoView({
123
- block: "center",
124
- inline: "center",
125
- behavior: "smooth"
126
- });
127
- }, P = f({
128
- tableForm: w,
129
- disabled: k,
130
- enabledFields: A,
131
- requiredFields: j,
132
- enabledFieldsMap: D,
133
- disabledFieldsMap: E,
134
- requiredFieldsMap: O,
135
- disabledFields: M,
136
- scrollIntoRequiredField: N,
137
- formRef: C,
138
- validate: async () => {
139
- try {
140
- return await C.value.validate();
141
- } catch {
142
- throw await N(), C.value.$el.querySelectorAll(".el-form-item.is-error .el-form-item__content > :first-child").forEach((e) => {
143
- m(e, "breathe-animation");
144
- }), Error("表单验证不通过!");
145
- }
146
- },
147
- validateField: (e) => C.value.validateField(e),
148
- resetFields: (e) => C.value.resetFields(e),
149
- scrollToField: (e) => C.value.scrollToField(e),
150
- clearValidate: (e) => C.value.clearValidate(e),
151
- getField: () => C.value.getField(),
152
- setInitialValues: (e) => C.value.setInitialValues(e),
153
- getFields: () => C.value.fields
154
- });
155
- return d(e, P), y(P), () => s(i, l({
156
- ref: "form",
157
- class: "form-holder",
158
- "show-message": T.value
159
- }, x.value), { default: () => {
160
- if (w.value) {
161
- var e, t, i;
162
- return [
163
- (e = g.top) == null ? void 0 : e.call(g),
164
- s(r, {
165
- class: { "hide-error-message": w.value },
166
- columns: h.columns,
167
- "col-count": h.colCount
168
- }, { default: () => {
169
- var e;
170
- return [(e = g.default) == null ? void 0 : e.call(g), h.showAdvice ? s(n, {
171
- "label-colspan": h.commentLabelColspan,
172
- "value-colspan": h.commentValueColspan
173
- }, null) : null];
174
- } }),
175
- (t = g.bottom) == null ? void 0 : t.call(g),
176
- s("div", { class: "red-form-footer" }, [(i = g.footer) == null ? void 0 : i.call(g)])
177
- ];
178
- } else {
179
- var o;
180
- return h.wrapRow ? s(a, null, { default: () => {
181
- var e;
182
- return [(e = g.default) == null ? void 0 : e.call(g)];
183
- } }) : (o = g.default) == null ? void 0 : o.call(g);
184
- }
185
- } });
186
- }
187
- };
188
- //#endregion
189
- export { y as t };
File without changes
File without changes
File without changes
File without changes