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

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 (81) hide show
  1. package/chunks/{B3yVc-P62.mjs → 5KomemiE2.mjs} +20 -20
  2. package/chunks/{H70Z56YY.mjs → 6GcIyEQV.mjs} +8 -8
  3. package/chunks/{DjnHvHXo.mjs → 8c9TEVNY.mjs} +3 -2
  4. package/chunks/AAZfNtly.mjs +119 -0
  5. package/chunks/{ByTyNsWf.mjs → B3A-CnYr.mjs} +2 -2
  6. package/chunks/{D5EQJdPL.mjs → BKlMENhV.mjs} +8 -8
  7. package/chunks/{9MExJqL-.mjs → BNVYEWWW.mjs} +7 -7
  8. package/chunks/{c0Niqotr.mjs → BTuzBfTA.mjs} +18 -18
  9. package/chunks/{DawYTjoT.mjs → BpCiVuKL.mjs} +2 -2
  10. package/chunks/{D7R9Or2m2.mjs → Bq62m7IR2.mjs} +13 -13
  11. package/chunks/BvKUeniN.mjs +127 -0
  12. package/chunks/{CGuDBVCB.mjs → C3MF_-bN.mjs} +11 -11
  13. package/chunks/{BNXbI4OG.mjs → C6Dq9Dgb.mjs} +1 -1
  14. package/chunks/{DwkOWXIR.mjs → C6u76g6o.mjs} +21 -21
  15. package/chunks/{B6yWUT6z.mjs → C7Mak2La.mjs} +2 -2
  16. package/chunks/{BV-XUugQ.mjs → CLO5X9Lb.mjs} +34 -34
  17. package/chunks/{DFFNxlqD.mjs → CNK4mfga.mjs} +3 -3
  18. package/chunks/{BEvOkSfB.mjs → CauzhVSa2.mjs} +10 -10
  19. package/chunks/{BJYlobMz2.mjs → CdoiMj7L2.mjs} +3 -2
  20. package/chunks/{CgN7m-1v.mjs → Czz_49pC.mjs} +22 -22
  21. package/chunks/{XwerN1TU.mjs → D0kIhzQo.mjs} +5 -5
  22. package/chunks/{CGDnQr1c.mjs → D2B9Y3oT.mjs} +1 -1
  23. package/chunks/{oVFbZ6yk.mjs → DTVTvvq-.mjs} +5 -1
  24. package/chunks/{BjGlxyi6.mjs → DWE67l1f.mjs} +47 -47
  25. package/chunks/{BqC_VU52.mjs → DZrQmH9Y.mjs} +5 -5
  26. package/chunks/{BgTCTXs72.mjs → D_L1p3vm2.mjs} +6 -6
  27. package/chunks/{BqzJ6vY6.mjs → Dluor05A.mjs} +2 -2
  28. package/chunks/{z5FJgzdc.mjs → Dy_5vPdP.mjs} +8 -8
  29. package/chunks/{Dytof5EW.mjs → Goee5Y-H.mjs} +13 -13
  30. package/chunks/{CB9QUXUX.mjs → ecpQ-ODX.mjs} +5 -5
  31. package/chunks/{D9IFsT272.mjs → g8MIBMw92.mjs} +10 -10
  32. package/form-cascader/index.mjs +1 -1
  33. package/form-checkbox/index.mjs +1 -1
  34. package/form-checkbox-group/index.mjs +1 -1
  35. package/form-date-picker/index.mjs +1 -1
  36. package/form-holder/index.mjs +1 -1
  37. package/form-image/index.mjs +1 -1
  38. package/form-input/index.mjs +1 -1
  39. package/form-input-cron-expression/index.mjs +1 -1
  40. package/form-input-email/index.mjs +1 -1
  41. package/form-input-id-card/index.mjs +1 -1
  42. package/form-input-number/index.mjs +1 -1
  43. package/form-input-phone-number/index.mjs +1 -1
  44. package/form-input-tag/index.mjs +1 -1
  45. package/form-input-time/index.mjs +1 -1
  46. package/form-item-group/index.mjs +1 -1
  47. package/form-item-x/index.mjs +1 -1
  48. package/form-radio-group/index.mjs +1 -1
  49. package/form-rate/index.mjs +1 -1
  50. package/form-row/index.mjs +1 -1
  51. package/form-select/index.mjs +1 -1
  52. package/form-slider/index.mjs +1 -1
  53. package/form-switch/index.mjs +1 -1
  54. package/form-table/index.mjs +1 -1
  55. package/form-table-plus/index.mjs +1 -1
  56. package/form-text/index.mjs +1 -1
  57. package/form-textarea/index.mjs +1 -1
  58. package/form-time-select/index.mjs +1 -1
  59. package/helper/form-item.d.ts +10 -0
  60. package/helper/form-item.mjs +2 -0
  61. package/helper/input.d.ts +44 -0
  62. package/helper/input.mjs +2 -0
  63. package/index.mjs +34 -34
  64. package/package.json +1 -1
  65. package/pageable-table/index.mjs +1 -1
  66. package/sub-table/index.mjs +1 -1
  67. package/sub-table-plus/index.mjs +1 -1
  68. package/table-column/index.mjs +1 -1
  69. package/table-column-def/index.mjs +1 -1
  70. package/table-view/index.mjs +3 -3
  71. package/toolbar/index.mjs +1 -1
  72. package/vue-cron/index.mjs +1 -1
  73. package/web-types.json +1 -1
  74. package/year-calendar/index.mjs +1 -1
  75. package/chunks/BHbMJZPp.mjs +0 -237
  76. /package/chunks/{B_RAcbs_.mjs → BNqVEHk_.mjs} +0 -0
  77. /package/chunks/{DOP3aBxf.mjs → BlxLaWcU.mjs} +0 -0
  78. /package/chunks/{CPvdsnRN.mjs → BoJgSMkL.mjs} +0 -0
  79. /package/chunks/{GI8krYU82.mjs → Dg4R65aG2.mjs} +0 -0
  80. /package/chunks/{DyCO22Ia2.mjs → Dt_s96gL2.mjs} +0 -0
  81. /package/chunks/{XoImEoke.mjs → xq_LR6R2.mjs} +0 -0
@@ -1,2 +1,2 @@
1
- import { t as e } from "../chunks/GI8krYU82.mjs";
1
+ import { t as e } from "../chunks/Dg4R65aG2.mjs";
2
2
  export { e as default };
@@ -1,237 +0,0 @@
1
- import { f as e, o as t, p as n } from "./DcTVYqeJ.mjs";
2
- import { formHolderContextKey as r, formItemConfigProviderContextKey as i, formItemGroupContextKey as a, formViewContextKey as o } from "../constants/index.mjs";
3
- import { isArray as s, isPlainObject as c, isString as l } from "@web-utils/core";
4
- import { computed as u, createVNode as d, h as f, inject as p, mergeProps as m, nextTick as h, unref as g, useTemplateRef as _ } from "vue";
5
- import { ElCol as v, rowContextKey as y } from "element-plus";
6
- import { ElCol as b, ElFormItem as x, ElTooltip as S } from "element-plus/es";
7
- //#region src/components/form/props/form-item.ts
8
- var C = {
9
- prop: [String, Array],
10
- label: String,
11
- labelPosition: {
12
- type: String,
13
- default: ""
14
- },
15
- labelWidth: [String, Number],
16
- required: {
17
- type: Boolean,
18
- default: !1
19
- },
20
- rules: Object,
21
- error: String,
22
- showMessage: {
23
- type: Boolean,
24
- default: !0
25
- },
26
- inlineMessage: {
27
- type: Boolean,
28
- default: !1
29
- },
30
- size: String,
31
- for: String,
32
- validateStatus: String,
33
- messagePrefix: String,
34
- message: String,
35
- wrapCol: {
36
- type: Boolean,
37
- default: !0
38
- },
39
- fixedSpan: Number,
40
- block: {
41
- type: Boolean,
42
- default: void 0
43
- },
44
- unwrap: Boolean,
45
- half: Boolean,
46
- formItemClass: String,
47
- hideLabel: Boolean,
48
- tips: { type: String },
49
- tipsAfterLabel: {
50
- type: Boolean,
51
- default: !1
52
- },
53
- labelColspan: [Number, String],
54
- inputColspan: [Number, String],
55
- labelRowspan: [Number, String],
56
- inputRowspan: [Number, String]
57
- }, w = {
58
- required: !0,
59
- rules: !0,
60
- messagePrefix: !0,
61
- message: !0,
62
- wrapCol: !0,
63
- fixedSpan: !0,
64
- block: !0,
65
- unwrap: !0,
66
- half: !0,
67
- formItemClass: !0,
68
- hideLabel: !0,
69
- tips: !0,
70
- tipsAfterLabel: !0,
71
- labelColspan: !0,
72
- inputColspan: !0,
73
- labelRowspan: !0,
74
- inputRowspan: !0
75
- }, T = (e) => C[e] !== void 0 && w[e] !== !0, E = (e, { emit: n, events: r, predicate: i }) => u(() => t(e, i, r, n)), D = {
76
- span: {
77
- type: Number,
78
- default: 12
79
- },
80
- offset: {
81
- type: Number,
82
- default: 0
83
- },
84
- push: {
85
- type: Number,
86
- default: 0
87
- },
88
- pull: {
89
- type: Number,
90
- default: 0
91
- },
92
- xs: { type: [Number, Object] },
93
- sm: { type: [Number, Object] },
94
- md: { type: [Number, Object] },
95
- lg: { type: [Number, Object] },
96
- xl: { type: [Number, Object] },
97
- tag: {
98
- type: String,
99
- default: "div"
100
- }
101
- }, O = { span: !0 }, k = (e) => D[e] !== void 0 && O[e] !== !0, A = (e, { emit: n, events: r, predicate: i }) => u(() => t(e, i, r, n)), j = (e) => {
102
- let t = p(r, null);
103
- return u(() => e.required === !0 ? !0 : (t == null ? void 0 : t.requiredFieldsMap[e.prop]) === !0);
104
- }, M = (e, t) => {
105
- l(t) ? e.push(t) : s(t) ? e.push(...t) : c(t) && e.push(t);
106
- }, N = (e, { rules: t, attrs: n, block: r, class: i, messagePrefix: a, message: o } = {}) => {
107
- let s = j(e);
108
- return u(() => {
109
- let c = { message: o }, l = g(t);
110
- Object.keys({
111
- ...C,
112
- ...D
113
- }).forEach((t) => {
114
- t === "rules" ? e[t] && l ? c[t] = [...e[t], ...l] : e[t] ? c[t] = e[t] : l && (c[t] = l) : t === "messagePrefix" ? c[t] = e.messagePrefix || a : t === "block" ? c[t] = r ?? e.block : c[t] = e[t];
115
- });
116
- let u = [];
117
- return M(u, g(n == null ? void 0 : n.class)), M(u, g(i)), c.required = s.value, c.class = u, c.style = n == null ? void 0 : n.style, c;
118
- });
119
- }, P = {
120
- name: "FormItemX",
121
- inheritAttrs: !1,
122
- props: {
123
- ...C,
124
- ...D
125
- },
126
- setup(e, { attrs: t, slots: n, expose: a }) {
127
- let o = p(y, null), s = p(i, null), c = p(r, null), l = t.embed ? u(() => t.disabled) : I(e), f = E(e, { predicate: T }), g = A(e, { predicate: k }), v = u(() => (s == null ? void 0 : s.reactive) === !0 && s.block === !1 && e.fixedSpan === void 0 && !e.half), C = j(e), w = _("formItem"), D = u(() => (s == null ? void 0 : s.wrapCol) === !1 ? !1 : !!o && e.wrapCol), O = u(() => c != null && c.tableForm ? "" : s != null && s.block ? "100%" : e.half && D.value ? `calc(50% - ${o.gutter.value / 2}px)` : ""), M = u(() => (s == null ? void 0 : s.block) === !0 || e.block || e.half ? 24 : e.span), N = u(() => {
128
- if (l.value) return [];
129
- if (C.value) {
130
- let t = {
131
- required: !0,
132
- message: e.message || `${e.messagePrefix || "请输入"}${e.label}`
133
- };
134
- return e.rules ? [...e.rules, t] : [t];
135
- }
136
- return e.rules;
137
- });
138
- return a({
139
- clearValidate: async () => {
140
- var e;
141
- await h(), (e = w.value) == null || e.clearValidate();
142
- },
143
- validate: async () => {
144
- var e;
145
- await h(), (e = w.value) == null || e.validate();
146
- }
147
- }), () => {
148
- var r;
149
- let i = n.tips || e.tips, a = i ? d(S, {
150
- effect: "light",
151
- content: e.tips,
152
- offset: 4
153
- }, {
154
- default: () => d("i", { class: "el-icon-info form-item-input-info" }, null),
155
- content: n.tips ? n.tips : null
156
- }) : null, o = d(x, m(f.value, t, {
157
- ref: "formItem",
158
- style: { width: O.value },
159
- class: [
160
- "form-item",
161
- e.formItemClass,
162
- {
163
- "form-item-hide-label": e.hideLabel,
164
- "with-tips": !e.tipsAfterLabel && i,
165
- required: l.value === !1 && C.value
166
- }
167
- ],
168
- rules: N.value
169
- }), {
170
- ...n,
171
- default: () => {
172
- var t;
173
- return [(t = n.default) == null ? void 0 : t.call(n, {
174
- disabled: l.value,
175
- required: C.value
176
- }), i && !e.tipsAfterLabel ? a : null];
177
- },
178
- label: () => [n.label ? n.label() : e.label, e.tipsAfterLabel ? a : null]
179
- }), s = [o, (r = n.below) == null ? void 0 : r.call(n)];
180
- return e.unwrap ? s : D.value ? d(b, m(g.value, v.value ? {
181
- xs: 24,
182
- sm: 12,
183
- md: 12,
184
- lg: 8,
185
- xl: 6
186
- } : {}, { span: M.value }), { default: () => s }) : o;
187
- };
188
- }
189
- }, F = "update:modelValue", I = (e) => {
190
- let t = p(r, null), n = p(a, null);
191
- return u(() => {
192
- if (e.disabled !== void 0) return e.disabled;
193
- if (t) {
194
- if (t.requiredFieldsMap[e.prop] === !0 || t.enabledFieldsMap[e.prop] === !0) return !1;
195
- if (t.disabledFieldsMap[e.prop] === !0) return !0;
196
- }
197
- return (n == null ? void 0 : n.enabled) === !0 ? !1 : (n == null ? void 0 : n.disabled) === !0 ? !0 : (t == null ? void 0 : t.disabled) === !0;
198
- });
199
- }, L = { [F]: null }, R = (e, t) => e(F, t), z = (e, { vNodes: t, formItemProps: n, slots: r, disabled: i }) => e.wrapFormItem ? f(P, {
200
- ...n.value,
201
- embed: !0,
202
- disabled: i == null ? void 0 : i.value
203
- }, {
204
- default: () => t,
205
- label: r.label,
206
- error: r.error,
207
- tips: r.tips,
208
- below: r.below
209
- }) : t, B = (r, { emit: i, slots: a, events: s, predicate: c, removeOn: l = !1, attrs: d, block: m, class: h, rules: g, messagePrefix: _ = "请输入", extraFormItemProps: y }) => {
210
- let b = I(r), x = p(o, null), S = u(() => b.value ? "" : `${_}${r.label}`), C = N(r, {
211
- rules: g,
212
- block: m === void 0 ? r.type === "textarea" && r.block === void 0 ? !0 : r.block : m,
213
- attrs: d,
214
- class: h,
215
- message: S.value,
216
- messagePrefix: _,
217
- ...y
218
- }), w = (e) => R(i, e), T = (e) => r.col ? f(v, { span: r.block ? 24 : r.span }, { default: () => e }) : e, E = ({ vNodes: e }) => z(r, {
219
- vNodes: T(e),
220
- formItemProps: C,
221
- slots: a,
222
- disabled: b
223
- }), D = u(() => t(r, c, s, i)), O = n({ removeOn: l });
224
- return {
225
- emitInput: w,
226
- render: E,
227
- placeholder: S,
228
- disabled: b,
229
- formItemProps: C,
230
- autoBind: D,
231
- inputProps: e(r, c),
232
- listeners: O,
233
- printing: u(() => (x == null ? void 0 : x.printing) === !0)
234
- };
235
- }, V = (e) => e.icon ? f("i", { class: e.icon }) : null;
236
- //#endregion
237
- export { P as a, C as c, B as i, L as n, N as o, z as r, D as s, V as t };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes