@web-utils/form-ui 1.0.0-beta1 → 1.0.0-beta11

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 (89) hide show
  1. package/base.css +1 -1
  2. package/chunks/8R_Eq-Q1.mjs +94 -0
  3. package/chunks/{ClNahmiU.mjs → 9r0_sTqG.mjs} +6 -6
  4. package/chunks/{CdRsyF0n.mjs → B0sH1q9x.mjs} +10 -10
  5. package/chunks/{ZsLNWI9x.mjs → B7c_xqYl.mjs} +10 -9
  6. package/chunks/C-lymD_X.mjs +167 -0
  7. package/chunks/{Bxj372sF.mjs → CBsIU5Nz.mjs} +14 -13
  8. package/chunks/CItjaxJe.mjs +28622 -0
  9. package/chunks/{CBcdalMX.mjs → CnmwUrOm.mjs} +8 -8
  10. package/chunks/{CstztYMu.mjs → CoU4aVFm.mjs} +4 -4
  11. package/chunks/{jn_iQrVZ.mjs → D6lrfzE7.mjs} +4 -4
  12. package/chunks/{DpJQABVD.mjs → DDKk9iwV.mjs} +24 -23
  13. package/chunks/{C33EmJN8.mjs → DF-zPBqJ.mjs} +6 -6
  14. package/chunks/{C6Li3-l7.mjs → DPkBzek6.mjs} +4 -4
  15. package/chunks/{Bsz7y4Xp.mjs → DQS-CovH.mjs} +16 -15
  16. package/chunks/{BO9jWhBl.mjs → DuPXiRRS.mjs} +10 -9
  17. package/chunks/EReAG82c.mjs +4 -0
  18. package/chunks/{DC9b53M6.mjs → MyHLh1cw.mjs} +6 -6
  19. package/chunks/{BZ8aOa78.mjs → TVsbSR1G.mjs} +9 -9
  20. package/chunks/{DDVAgRED.mjs → nNDPU9_n.mjs} +6 -6
  21. package/constants.d.ts +7 -0
  22. package/constants.mjs +3 -3
  23. package/element-dialog/index.d.ts +53 -0
  24. package/element-dialog/index.mjs +46 -32
  25. package/element-dialog/style.css +1 -1
  26. package/empty-view/index.d.ts +29 -0
  27. package/flex-scroll-area/index.d.ts +22 -0
  28. package/form-advice/index.d.ts +9 -0
  29. package/form-cell/index.d.ts +25 -0
  30. package/form-check-box-group/index.d.ts +119 -0
  31. package/form-check-box-group/index.mjs +1 -1
  32. package/form-checkbox/index.d.ts +107 -0
  33. package/form-checkbox/index.mjs +1 -1
  34. package/form-date-picker/index.d.ts +134 -0
  35. package/form-date-picker/index.mjs +1 -1
  36. package/form-holder/index.d.ts +95 -0
  37. package/form-holder/index.mjs +1 -1
  38. package/form-image/index.d.ts +106 -0
  39. package/form-image/index.mjs +1 -1
  40. package/form-input/index.d.ts +146 -0
  41. package/form-input/index.mjs +1 -1
  42. package/form-input/style.css +1 -0
  43. package/form-input-email/index.d.ts +105 -0
  44. package/form-input-email/index.mjs +1 -1
  45. package/form-input-id-card/index.d.ts +105 -0
  46. package/form-input-id-card/index.mjs +1 -1
  47. package/form-input-number/index.d.ts +121 -0
  48. package/form-input-number/index.mjs +1 -1
  49. package/form-input-phone-number/index.d.ts +105 -0
  50. package/form-input-phone-number/index.mjs +1 -1
  51. package/form-input-tag/index.d.ts +2 -0
  52. package/form-input-time/index.d.ts +2 -0
  53. package/form-item-config-provider/index.d.ts +20 -0
  54. package/form-item-config-provider/index.mjs +24 -0
  55. package/form-item-group/index.d.ts +18 -0
  56. package/form-item-x/index.d.ts +75 -0
  57. package/form-item-x/index.mjs +1 -1
  58. package/form-radio-group/index.d.ts +107 -0
  59. package/form-radio-group/index.mjs +1 -1
  60. package/form-rate/index.d.ts +105 -0
  61. package/form-rate/index.mjs +1 -1
  62. package/form-red-table/index.d.ts +21 -0
  63. package/form-row/index.d.ts +11 -0
  64. package/form-row/index.mjs +1 -1
  65. package/form-select/index.d.ts +107 -0
  66. package/form-select/index.mjs +1 -1
  67. package/form-slider/index.d.ts +105 -0
  68. package/form-slider/index.mjs +1 -1
  69. package/form-switch/index.d.ts +105 -0
  70. package/form-switch/index.mjs +1 -1
  71. package/form-text/index.d.ts +101 -0
  72. package/form-text/index.mjs +1 -1
  73. package/form-view/index.d.ts +2 -0
  74. package/index.d.ts +38 -0
  75. package/index.mjs +64 -37
  76. package/input/style.css +1 -1
  77. package/json-editor/index.d.ts +32 -0
  78. package/json-editor/index.mjs +2 -0
  79. package/json-editor/style.css +1 -0
  80. package/package.json +7 -7
  81. package/resolver.d.ts +9 -0
  82. package/resolver.mjs +81 -0
  83. package/table-view/index.d.ts +2 -0
  84. package/toolbar/index.d.ts +2 -0
  85. package/toolbar-button/index.d.ts +2 -0
  86. package/web-types.json +1 -1
  87. package/chunks/B4M_TFeR.mjs +0 -152
  88. package/chunks/BHNKrW1j.mjs +0 -61
  89. /package/chunks/{B5BIQCcK.mjs → 5J-OUxoQ.mjs} +0 -0
@@ -1,152 +0,0 @@
1
- import { ElCol as e, ElFormItem as t, ElTooltip as n } from "element-plus/es";
2
- import { computed as r, createVNode as i, h as a, inject as o, isVNode as s, nextTick as c, unref as l, useTemplateRef as u } from "vue";
3
- import { ElCol as d, rowContextKey as f } from "element-plus";
4
- //#region src/components/form/form-item.js
5
- var p = {
6
- label: String,
7
- prop: String,
8
- required: Boolean,
9
- rules: Array,
10
- span: {
11
- type: Number,
12
- default: 12
13
- },
14
- block: Boolean,
15
- formItemClass: String,
16
- hideLabel: Boolean,
17
- tips: { type: String },
18
- tipsAfterLabel: {
19
- type: Boolean,
20
- default: !1
21
- },
22
- labelColspan: [Number, String],
23
- inputColspan: [Number, String],
24
- labelRowspan: [Number, String],
25
- inputRowspan: [Number, String]
26
- }, m = (e) => {
27
- let t = o("formHolder", null);
28
- return r(() => e.required === !0 ? !0 : (t == null ? void 0 : t.requiredFieldsMap[e.prop]) === !0);
29
- }, h = (e, { rules: t } = {}) => {
30
- let n = m(e);
31
- return r(() => {
32
- let r = {}, i = l(t);
33
- return Object.keys(p).forEach((t) => {
34
- t === "rules" ? e[t] && i ? r[t] = [...e[t], ...i] : e[t] ? r[t] = e[t] : i && (r[t] = i) : r[t] = e[t];
35
- }), r.required = n.value, r;
36
- });
37
- };
38
- //#endregion
39
- //#region src/components/form/FormItemX.vue?vue&type=script&lang.jsx
40
- function g(e) {
41
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !s(e);
42
- }
43
- //#endregion
44
- //#region src/components/form/FormItemX.vue
45
- var _ = {
46
- name: "FormItemX",
47
- inheritAttrs: !1,
48
- props: { ...p },
49
- setup(a, { attrs: s, slots: l, expose: d }) {
50
- let p = o(f, null), h = s.embed ? r(() => s.disabled) : b(a), _ = m(a), v = u("formItem"), y = r(() => !!p), x = r(() => {
51
- if (h.value) return [];
52
- if (_.value) {
53
- let e = {
54
- required: !0,
55
- message: `请输入${a.label}`
56
- };
57
- return a.rules ? [...a.rules, e] : [e];
58
- }
59
- return a.rules;
60
- });
61
- return d({
62
- clearValidate: async () => {
63
- var e;
64
- await c(), (e = v.value) == null || e.clearValidate();
65
- },
66
- validate: async () => {
67
- var e;
68
- await c(), (e = v.value) == null || e.validate();
69
- }
70
- }), () => {
71
- let r = l.tips || a.tips, o = r ? i(n, {
72
- effect: "light",
73
- content: a.tips,
74
- offset: 4
75
- }, {
76
- default: () => i("i", { class: "el-icon-info form-item-input-info" }, null),
77
- content: l.tips ? l.tips : null
78
- }) : null, s = i(t, {
79
- ref: "formItem",
80
- label: a.label,
81
- class: [
82
- "form-item",
83
- a.formItemClass,
84
- {
85
- "form-item-hide-label": a.hideLabel,
86
- "with-tips": !a.tipsAfterLabel && r,
87
- required: h.value === !1 && _.value
88
- }
89
- ],
90
- prop: a.prop,
91
- rules: x.value
92
- }, {
93
- ...l,
94
- default: () => {
95
- var e;
96
- return [(e = l.default) == null ? void 0 : e.call(l, {
97
- disabled: h.value,
98
- required: _.value
99
- }), r && !a.tipsAfterLabel ? o : null];
100
- },
101
- label: () => [l.label ? l.label() : a.label, a.tipsAfterLabel ? o : null]
102
- });
103
- return y.value ? i(e, { span: a.block ? 24 : a.span }, g(s) ? s : { default: () => [s] }) : s;
104
- };
105
- }
106
- }, v = "update:modelValue", y = {
107
- ...p,
108
- wrapFormItem: {
109
- type: Boolean,
110
- default: !0
111
- },
112
- disabled: {
113
- type: Boolean,
114
- default: void 0
115
- },
116
- col: Boolean
117
- }, b = (e) => {
118
- let t = o("formHolder", null), n = o("formItemGroup", null);
119
- return r(() => {
120
- if (e.disabled !== void 0) return e.disabled;
121
- if (t) {
122
- if (t.requiredFieldsMap[e.prop] === !0 || t.enabledFieldsMap[e.prop] === !0) return !1;
123
- if (t.disabledFieldsMap[e.prop] === !0) return !0;
124
- }
125
- return (n == null ? void 0 : n.enabled) === !0 ? !1 : (n == null ? void 0 : n.disabled) === !0 ? !0 : (t == null ? void 0 : t.disabled) === !0;
126
- });
127
- }, x = [v], S = (e, t) => e(v, t), C = (e, { vNodes: t, formItemProps: n, slots: r, disabled: i }) => e.wrapFormItem ? a(_, {
128
- ...n.value,
129
- embed: !0,
130
- disabled: i == null ? void 0 : i.value
131
- }, {
132
- default: () => t,
133
- label: r.label,
134
- error: r.error,
135
- tips: r.tips
136
- }) : t, w = (e, { emit: t, slots: n, rules: i }) => {
137
- let o = h(e, { rules: i }), s = b(e), c = (e) => S(t, e), l = (t) => e.col ? a(d, { span: e.block ? 24 : e.span }, { default: () => t }) : t;
138
- return {
139
- emitInput: c,
140
- render: ({ vNodes: t }) => C(e, {
141
- vNodes: l(t),
142
- formItemProps: o,
143
- slots: n,
144
- disabled: s
145
- }),
146
- placeholder: r(() => s.value ? "" : `请输入${e.label}`),
147
- disabled: s,
148
- formItemProps: o
149
- };
150
- };
151
- //#endregion
152
- export { w as a, S as i, y as n, _ as o, C as r, h as s, x as t };
@@ -1,61 +0,0 @@
1
- import { a as e, n as t, t as n } from "./B4M_TFeR.mjs";
2
- import { ElInput as r } from "element-plus/es";
3
- import { computed as i, createVNode as a } from "vue";
4
- import { validatePhoneNum as o } from "@web-utils/core";
5
- //#region src/util/form-validate.js
6
- var s = (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();
7
- function c(e, t, n) {
8
- 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();
9
- }
10
- //#endregion
11
- //#region src/components/form/FormInput.vue
12
- var l = {
13
- name: "FormInput",
14
- inheritAttrs: !1,
15
- props: {
16
- ...t,
17
- modelValue: String,
18
- type: String,
19
- rows: Number,
20
- prepend: String,
21
- append: String,
22
- prefix: String,
23
- suffix: String
24
- },
25
- emits: [...n],
26
- setup(t, { emit: n, slots: l }) {
27
- let u = `请输入正确的${t.label}!`, { emitInput: d, render: f, placeholder: p, disabled: m } = e(t, {
28
- emit: n,
29
- slots: l,
30
- rules: i(() => {
31
- if (!t.type || t.type === "textarea") return null;
32
- let e = {
33
- message: u,
34
- trigger: "blur"
35
- };
36
- if (t.type === "email") e.validator = s;
37
- else if (t.type === "idcard") e.validator = c;
38
- else if (t.type === "phone") e.validator = o;
39
- else return null;
40
- return [e];
41
- })
42
- });
43
- return () => f({ vNodes: a(r, {
44
- modelValue: t.modelValue,
45
- type: t.type,
46
- clearable: !0,
47
- rows: t.rows,
48
- disabled: m.value,
49
- "onUpdate:modelValue": d,
50
- placeholder: p.value
51
- }, {
52
- prefix: l.prefix || t.prefix ? () => t.prefix : null,
53
- suffix: l.suffix || t.suffix ? () => t.suffix : null,
54
- "password-icon": l["password-icon"],
55
- prepend: l.prepend || t.prepend ? () => t.prepend : null,
56
- append: l.append || t.append ? () => t.append : null
57
- }) });
58
- }
59
- };
60
- //#endregion
61
- export { l as t };
File without changes