@web-utils/form-ui 1.0.0-beta2 → 1.0.0-beta21

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 (128) hide show
  1. package/base.css +1 -1
  2. package/chunks/1chbbDUh.mjs +98 -0
  3. package/chunks/5HLN3g1u.mjs +51 -0
  4. package/chunks/B5B9au3z.mjs +180 -0
  5. package/chunks/BI2XOQW3.mjs +226 -0
  6. package/chunks/BLpnMrum.mjs +189 -0
  7. package/chunks/BNpqILFO.mjs +95 -0
  8. package/chunks/Bb43eI1f.mjs +93 -0
  9. package/chunks/BbrVRWUo.mjs +73 -0
  10. package/chunks/Bd1I-R29.mjs +53 -0
  11. package/chunks/Bh_CMUlo.mjs +12 -0
  12. package/chunks/Bv-Gn_Jd.mjs +42 -0
  13. package/chunks/C4MTLHn4.mjs +26 -0
  14. package/chunks/CI4RZnNc.mjs +26 -0
  15. package/chunks/CnsFNU2A.mjs +17 -0
  16. package/chunks/Cw8pz9hK.mjs +222 -0
  17. package/chunks/D4v0MyB_.mjs +106 -0
  18. package/chunks/D9GcEl6r.mjs +8 -0
  19. package/chunks/DGhMkri0.mjs +88 -0
  20. package/chunks/DOI7ju3i.mjs +108 -0
  21. package/chunks/DRDj0e_k.mjs +171 -0
  22. package/chunks/Dq3yxEPg.mjs +106 -0
  23. package/chunks/Dy5-h_Tx.mjs +108 -0
  24. package/chunks/RcygoTkQ.mjs +26 -0
  25. package/chunks/iWlTrkaC.mjs +76 -0
  26. package/chunks/lTFu0zgR.mjs +106 -0
  27. package/chunks/wfL1FAwc.mjs +1360 -0
  28. package/constants.d.ts +42 -0
  29. package/constants.mjs +3 -3
  30. package/element-dialog/index.d.ts +96 -0
  31. package/element-dialog/index.mjs +2 -92
  32. package/element-dialog/style.css +1 -1
  33. package/empty-view/index.d.ts +29 -0
  34. package/flex-scroll-area/index.d.ts +22 -0
  35. package/form-advice/index.d.ts +9 -0
  36. package/form-advice/index.mjs +13 -12
  37. package/form-cascader/index.d.ts +2 -0
  38. package/form-cascader/index.mjs +10 -0
  39. package/form-cell/index.d.ts +25 -0
  40. package/form-check-box-group/index.d.ts +293 -0
  41. package/form-check-box-group/index.mjs +1 -1
  42. package/form-checkbox/index.d.ts +271 -0
  43. package/form-checkbox/index.mjs +1 -1
  44. package/form-date-picker/index.d.ts +421 -0
  45. package/form-date-picker/index.mjs +1 -1
  46. package/form-holder/index.d.ts +166 -0
  47. package/form-holder/index.mjs +1 -1
  48. package/form-holder/style.css +1 -1
  49. package/form-image/index.d.ts +224 -0
  50. package/form-image/index.mjs +1 -1
  51. package/form-input/index.d.ts +387 -0
  52. package/form-input/index.mjs +1 -1
  53. package/form-input/style.css +1 -0
  54. package/form-input-cron-expression/index.d.ts +215 -0
  55. package/form-input-cron-expression/index.mjs +2 -0
  56. package/form-input-cron-expression/style.css +1 -0
  57. package/form-input-email/index.d.ts +363 -0
  58. package/form-input-email/index.mjs +1 -1
  59. package/form-input-id-card/index.d.ts +363 -0
  60. package/form-input-id-card/index.mjs +1 -1
  61. package/form-input-number/index.d.ts +325 -0
  62. package/form-input-number/index.mjs +1 -1
  63. package/form-input-phone-number/index.d.ts +363 -0
  64. package/form-input-phone-number/index.mjs +1 -1
  65. package/form-input-tag/index.d.ts +2 -0
  66. package/form-input-time/index.d.ts +2 -0
  67. package/form-item-config-provider/index.d.ts +22 -0
  68. package/form-item-config-provider/index.mjs +24 -0
  69. package/form-item-group/index.d.ts +92 -0
  70. package/form-item-group/index.mjs +2 -78
  71. package/form-item-group/style.css +1 -1
  72. package/form-item-x/index.d.ts +184 -0
  73. package/form-item-x/index.mjs +1 -1
  74. package/form-item-x/style.css +1 -0
  75. package/form-radio-group/index.d.ts +281 -0
  76. package/form-radio-group/index.mjs +1 -1
  77. package/form-rate/index.d.ts +319 -0
  78. package/form-rate/index.mjs +1 -1
  79. package/form-red-table/index.d.ts +21 -0
  80. package/form-red-table/index.mjs +27 -26
  81. package/form-row/index.d.ts +11 -0
  82. package/form-row/index.mjs +1 -1
  83. package/form-select/index.d.ts +540 -0
  84. package/form-select/index.mjs +1 -1
  85. package/form-slider/index.d.ts +348 -0
  86. package/form-slider/index.mjs +1 -1
  87. package/form-switch/index.d.ts +337 -0
  88. package/form-switch/index.mjs +1 -1
  89. package/form-text/index.d.ts +227 -0
  90. package/form-text/index.mjs +1 -1
  91. package/form-view/index.d.ts +2 -0
  92. package/index.d.ts +42 -0
  93. package/index.mjs +39 -34
  94. package/month-calendar/index.d.ts +80 -0
  95. package/month-calendar/index.mjs +312 -0
  96. package/month-calendar/style.css +1 -0
  97. package/package.json +10 -7
  98. package/resolver.d.ts +9 -0
  99. package/resolver.mjs +29 -0
  100. package/table-view/index.d.ts +2 -0
  101. package/toolbar/index.d.ts +2 -0
  102. package/toolbar-button/index.d.ts +2 -0
  103. package/vue-cron/index.d.ts +191 -0
  104. package/vue-cron/index.mjs +2 -0
  105. package/vue-cron/style.css +1 -0
  106. package/web-types.json +1 -1
  107. package/year-calendar/index.d.ts +99 -0
  108. package/year-calendar/index.mjs +174 -0
  109. package/year-calendar/style.css +1 -0
  110. package/chunks/B4M_TFeR.mjs +0 -152
  111. package/chunks/B5BIQCcK.mjs +0 -149
  112. package/chunks/BHNKrW1j.mjs +0 -61
  113. package/chunks/BO9jWhBl.mjs +0 -46
  114. package/chunks/BZ8aOa78.mjs +0 -35
  115. package/chunks/Bsz7y4Xp.mjs +0 -73
  116. package/chunks/Bxj372sF.mjs +0 -53
  117. package/chunks/C33EmJN8.mjs +0 -32
  118. package/chunks/C6Li3-l7.mjs +0 -28
  119. package/chunks/CBcdalMX.mjs +0 -35
  120. package/chunks/CdRsyF0n.mjs +0 -43
  121. package/chunks/ClNahmiU.mjs +0 -23
  122. package/chunks/CstztYMu.mjs +0 -28
  123. package/chunks/DC9b53M6.mjs +0 -32
  124. package/chunks/DDVAgRED.mjs +0 -36
  125. package/chunks/DpJQABVD.mjs +0 -91
  126. package/chunks/ZsLNWI9x.mjs +0 -46
  127. package/chunks/jn_iQrVZ.mjs +0 -28
  128. package/input/style.css +0 -1
@@ -0,0 +1,99 @@
1
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
+ showYearSelector: {
3
+ type: BooleanConstructor;
4
+ default: () => true;
5
+ };
6
+ activeDates: {
7
+ type: ArrayConstructor;
8
+ default: () => never[];
9
+ validator: (dateArray: unknown) => true;
10
+ };
11
+ modelValue: {
12
+ type: (StringConstructor | NumberConstructor)[];
13
+ default: number;
14
+ };
15
+ lang: {
16
+ type: StringConstructor;
17
+ default: string;
18
+ };
19
+ activeClass: {
20
+ type: StringConstructor;
21
+ default: () => "";
22
+ };
23
+ prefixClass: {
24
+ type: StringConstructor;
25
+ default: () => "calendar--active";
26
+ };
27
+ hideWeekend: {
28
+ type: BooleanConstructor;
29
+ default: boolean;
30
+ };
31
+ hideSunday: {
32
+ type: BooleanConstructor;
33
+ default: boolean;
34
+ };
35
+ }>, {}, {
36
+ isUsingString: boolean;
37
+ }, {
38
+ month(): {};
39
+ activeYear: {
40
+ get(): number;
41
+ set(val: any): void;
42
+ };
43
+ }, {
44
+ changeYear(idx: any): void;
45
+ toggleDate(dateObj: any): void;
46
+ modifiedActiveDates(dateIndex: any, activeDate: any): unknown[];
47
+ monthClick(monthYearInfo: any): void;
48
+ }, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("update:modelValue" | "toggleDate" | "monthClick" | "update:activeDates")[], "update:modelValue" | "toggleDate" | "monthClick" | "update:activeDates", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
49
+ showYearSelector: {
50
+ type: BooleanConstructor;
51
+ default: () => true;
52
+ };
53
+ activeDates: {
54
+ type: ArrayConstructor;
55
+ default: () => never[];
56
+ validator: (dateArray: unknown) => true;
57
+ };
58
+ modelValue: {
59
+ type: (StringConstructor | NumberConstructor)[];
60
+ default: number;
61
+ };
62
+ lang: {
63
+ type: StringConstructor;
64
+ default: string;
65
+ };
66
+ activeClass: {
67
+ type: StringConstructor;
68
+ default: () => "";
69
+ };
70
+ prefixClass: {
71
+ type: StringConstructor;
72
+ default: () => "calendar--active";
73
+ };
74
+ hideWeekend: {
75
+ type: BooleanConstructor;
76
+ default: boolean;
77
+ };
78
+ hideSunday: {
79
+ type: BooleanConstructor;
80
+ default: boolean;
81
+ };
82
+ }>> & Readonly<{
83
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
84
+ onToggleDate?: ((...args: any[]) => any) | undefined;
85
+ onMonthClick?: ((...args: any[]) => any) | undefined;
86
+ "onUpdate:activeDates"?: ((...args: any[]) => any) | undefined;
87
+ }>, {
88
+ modelValue: string | number;
89
+ activeDates: unknown[];
90
+ lang: string;
91
+ activeClass: string;
92
+ prefixClass: string;
93
+ showYearSelector: boolean;
94
+ hideWeekend: boolean;
95
+ hideSunday: boolean;
96
+ }, {}, {
97
+ MonthCalendar: any;
98
+ }, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
99
+ export default _default;
@@ -0,0 +1,174 @@
1
+ import { t as e } from "../chunks/D9GcEl6r.mjs";
2
+ import t from "../month-calendar/index.mjs";
3
+ import { Fragment as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createStaticVNode as o, createVNode as s, normalizeClass as c, openBlock as l, renderList as u, toDisplayString as d } from "vue";
4
+ import f from "dayjs";
5
+ //#region src/components/material-year-calendar/YearCalendar.vue
6
+ var p = {
7
+ name: "YearCalendar",
8
+ components: { MonthCalendar: t },
9
+ props: {
10
+ showYearSelector: {
11
+ type: Boolean,
12
+ default: () => !0
13
+ },
14
+ activeDates: {
15
+ type: Array,
16
+ default: () => [],
17
+ validator: (e) => {
18
+ let t = !0, n = null;
19
+ return e.forEach((e) => {
20
+ typeof e == "string" ? n = e : typeof e == "object" && Object.prototype.hasOwnProperty.call(e, "date") && (n = e.date), /^\d{4}\-\d{1,2}\-\d{1,2}$/.test(n) || (t = !1);
21
+ let r = n.split("-"), i = parseInt(r[2], 10), a = parseInt(r[1], 10), o = parseInt(r[0], 10);
22
+ (o < 1e3 || o > 3e3 || a === 0 || a > 12) && (t = !1);
23
+ let s = [
24
+ 31,
25
+ 28,
26
+ 31,
27
+ 30,
28
+ 31,
29
+ 30,
30
+ 31,
31
+ 31,
32
+ 30,
33
+ 31,
34
+ 30,
35
+ 31
36
+ ];
37
+ (o % 400 == 0 || o % 100 != 0 && o % 4 == 0) && (s[1] = 29), i > 0 && i <= s[a - 1] || (t = !1);
38
+ }), t;
39
+ }
40
+ },
41
+ modelValue: {
42
+ type: [String, Number],
43
+ default: f().year()
44
+ },
45
+ lang: {
46
+ type: String,
47
+ default: "en"
48
+ },
49
+ activeClass: {
50
+ type: String,
51
+ default: () => ""
52
+ },
53
+ prefixClass: {
54
+ type: String,
55
+ default: () => "calendar--active"
56
+ },
57
+ hideWeekend: {
58
+ type: Boolean,
59
+ default: !1
60
+ },
61
+ hideSunday: {
62
+ type: Boolean,
63
+ default: !1
64
+ }
65
+ },
66
+ emits: [
67
+ "toggleDate",
68
+ "monthClick",
69
+ "update:activeDates",
70
+ "update:modelValue"
71
+ ],
72
+ data() {
73
+ return { isUsingString: !0 };
74
+ },
75
+ computed: {
76
+ month() {
77
+ let e = {};
78
+ return this.activeDates.forEach((t) => {
79
+ let n;
80
+ if (n = typeof t == "string" ? {
81
+ date: t,
82
+ className: this.activeClass
83
+ } : {
84
+ date: t.date,
85
+ className: t.className || ""
86
+ }, f(n.date).year() !== parseInt(this.modelValue)) return;
87
+ let r = (f(n.date).month() + 1).toString();
88
+ e[r] || (e[r] = []), e[r].push(n);
89
+ }), e;
90
+ },
91
+ activeYear: {
92
+ get() {
93
+ return parseInt(this.modelValue);
94
+ },
95
+ set(e) {
96
+ this.$emit("update:modelValue", e);
97
+ }
98
+ }
99
+ },
100
+ created() {
101
+ this.isUsingString = this.activeDates.length && typeof this.activeDates[0] == "string";
102
+ },
103
+ methods: {
104
+ changeYear(e) {
105
+ this.activeYear = e + this.activeYear - 3;
106
+ },
107
+ toggleDate(e) {
108
+ let t = f().set("year", this.modelValue).set("month", e.month - 1).set("date", e.date).format("YYYY-MM-DD");
109
+ this.$emit("toggleDate", {
110
+ date: t,
111
+ selected: e.selected,
112
+ className: e.className
113
+ });
114
+ let n, r;
115
+ if (this.isUsingString) n = this.activeDates.indexOf(t), r = this.modifiedActiveDates(n, t);
116
+ else {
117
+ let i = {
118
+ date: t,
119
+ className: e.className
120
+ };
121
+ n = this.activeDates.indexOf(this.activeDates.find((e) => e.date === t)), r = this.modifiedActiveDates(n, i);
122
+ }
123
+ this.$emit("update:activeDates", r);
124
+ },
125
+ modifiedActiveDates(e, t) {
126
+ let n = [...this.activeDates];
127
+ return e === -1 ? n.push(t) : n.splice(e, 1), n;
128
+ },
129
+ monthClick(e) {
130
+ this.$emit("monthClick", e);
131
+ }
132
+ }
133
+ }, m = { class: "vue-calendar__container" }, h = {
134
+ key: 0,
135
+ class: "container__year"
136
+ }, g = ["onClick"];
137
+ function _(e, f, p, _, v, y) {
138
+ let b = t;
139
+ return l(), i("div", m, [p.showYearSelector ? (l(), i("div", h, [
140
+ r(" <span><button @click=\"addYear(-1)\">back</button></span> "),
141
+ (l(), i(n, null, u(5, (e) => a("span", {
142
+ key: e,
143
+ class: "year__chooser",
144
+ onClick: (t) => y.changeYear(e)
145
+ }, d(e + y.activeYear - 3), 9, g)), 64)),
146
+ r(" <span><button @click=\"addYear(1)\">next</button></span> ")
147
+ ])) : r("v-if", !0), a("div", { class: c(["container__months", {
148
+ "hide-weekend": p.hideWeekend,
149
+ "hide-sunday": p.hideSunday
150
+ }]) }, [(l(), i(n, null, u(12, (e) => s(b, {
151
+ key: `month-${e}`,
152
+ class: "container__month",
153
+ year: y.activeYear,
154
+ month: e,
155
+ "active-dates": y.month[e],
156
+ "active-class": p.activeClass,
157
+ lang: p.lang,
158
+ "prefix-class": p.prefixClass,
159
+ onToggleDate: y.toggleDate,
160
+ onMonthClickEvent: y.monthClick
161
+ }, null, 8, [
162
+ "year",
163
+ "month",
164
+ "active-dates",
165
+ "active-class",
166
+ "lang",
167
+ "prefix-class",
168
+ "onToggleDate",
169
+ "onMonthClickEvent"
170
+ ])), 64)), f[0] || (f[0] = o("<div class=\"container__month p-0\" data-v-dc54a16d></div><div class=\"container__month p-0\" data-v-dc54a16d></div><div class=\"container__month p-0\" data-v-dc54a16d></div><div class=\"container__month p-0\" data-v-dc54a16d></div><div class=\"container__month p-0\" data-v-dc54a16d></div>", 5))], 2)]);
171
+ }
172
+ var v = /* @__PURE__ */ e(p, [["render", _], ["__scopeId", "data-v-dc54a16d"]]);
173
+ //#endregion
174
+ export { v as default };
@@ -0,0 +1 @@
1
+ .container__months.hide-sunday .calendar__day:nth-of-type(7n){display:none}.container__months.hide-sunday .calendar__day{flex:16.66%}.container__months.hide-weekend .calendar__day:nth-of-type(7n),.container__months.hide-weekend .calendar__day:nth-of-type(7n-1){display:none}.container__months.hide-weekend .calendar__day{flex:19%}.vue-calendar__container[data-v-dc54a16d]{background-color:#f6f6f3;border-radius:2px;min-width:0;text-decoration:none;position:relative;box-shadow:0 2px 1px -1px #0003,0 1px 1px #00000024,0 1px 3px #0000001f}.vue-calendar__container .container__year[data-v-dc54a16d]{-webkit-user-select:none;user-select:none;text-align:center;background-color:#fff;flex:100%;height:65px;font-size:24px;display:flex}.vue-calendar__container .container__year .year__chooser[data-v-dc54a16d]{cursor:pointer;color:#000000e6;flex:1;justify-content:center;align-items:center;height:100%;display:flex}.vue-calendar__container .container__year .year__chooser[data-v-dc54a16d]:hover{background-color:#6666661a}.vue-calendar__container .container__year .year__chooser[data-v-dc54a16d]:nth-child(4n-3){color:#0000004d}.vue-calendar__container .container__year .year__chooser[data-v-dc54a16d]:nth-child(2n){color:#0009}.vue-calendar__container .container__year .year__chooser[data-v-dc54a16d]:nth-child(3){box-shadow:inset 0 -3px #4792bd}.vue-calendar__container .container__months[data-v-dc54a16d]{flex-wrap:wrap;padding:15px;display:flex}.vue-calendar__container .container__month[data-v-dc54a16d]{flex:16.66%;padding:8px}@media (max-width:1300px){.vue-calendar__container .container__month[data-v-dc54a16d]{flex:25%}}@media (max-width:992px){.vue-calendar__container .container__month[data-v-dc54a16d]{flex:33.3%}}@media (max-width:768px){.vue-calendar__container .container__month[data-v-dc54a16d]{flex:50%}}@media (max-width:450px){.vue-calendar__container .container__month[data-v-dc54a16d]{flex:100%}}.vue-calendar__container .p-0[data-v-dc54a16d]{padding: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,149 +0,0 @@
1
- import e from "../form-advice/index.mjs";
2
- import t from "../form-red-table/index.mjs";
3
- import { ElForm as n, ElRow as r } from "element-plus/es";
4
- import { computed as i, createVNode as a, inject as o, nextTick as s, provide as c, reactive as l, useTemplateRef as u, watch as d } from "vue";
5
- import { animate as f } from "@web-utils/core";
6
- //#endregion
7
- //#region src/components/form/FormHolder.vue
8
- var p = {
9
- name: "FormHolder",
10
- inheritAttrs: !1,
11
- props: {
12
- model: Object,
13
- size: String,
14
- disabled: {
15
- type: Boolean,
16
- default: void 0
17
- },
18
- labelPosition: {
19
- type: String,
20
- default: "right"
21
- },
22
- labelWidth: {
23
- type: [String, Number],
24
- default: "auto"
25
- },
26
- required: {
27
- type: Boolean,
28
- default: !0
29
- },
30
- requiredFields: Array,
31
- disabledFields: Array,
32
- enabledFields: Array,
33
- showAdvice: {
34
- type: Boolean,
35
- default: !0
36
- },
37
- columns: [Array, Object],
38
- colCount: Number,
39
- notTableForm: {
40
- type: Boolean,
41
- default: void 0
42
- },
43
- commentValueColspan: Number,
44
- commentLabelColspan: Number,
45
- showMessage: {
46
- type: Boolean,
47
- default: !0
48
- },
49
- wrapRow: {
50
- type: Boolean,
51
- default: !0
52
- }
53
- },
54
- setup(p, { slots: m, expose: h }) {
55
- let g = o("formView", null), _ = u("form"), v = i(() => p.notTableForm === void 0 ? (g == null ? void 0 : g.tableForm) === void 0 ? !1 : g == null ? void 0 : g.tableForm : !p.notTableForm), y = i(() => v.value ? !1 : p.showMessage), b = i(() => {
56
- let e = {};
57
- return p.disabledFields && p.disabledFields.forEach((t) => {
58
- e[t] = !0;
59
- }), e;
60
- }), x = i(() => {
61
- let e = {};
62
- return p.enabledFields && p.enabledFields.length && p.enabledFields.forEach((t) => {
63
- e[t] = !0;
64
- }), e;
65
- }), S = i(() => {
66
- let e = {};
67
- return p.requiredFields && p.requiredFields.length && p.requiredFields.forEach((t) => {
68
- e[t] = !0;
69
- }), e;
70
- }), C = i(() => p.disabled === !0 ? !0 : p.disabled), w = i(() => p.enabledFields), T = i(() => p.requiredFields), E = i(() => p.disabledFields), D = async () => {
71
- await s();
72
- let e = _.value.$el.querySelector(".el-form-item.is-error");
73
- e && e.scrollIntoView({
74
- block: "center",
75
- inline: "center",
76
- behavior: "smooth"
77
- });
78
- }, O = async () => {
79
- try {
80
- return await _.value.validate();
81
- } catch {
82
- throw await D(), _.value.$el.querySelectorAll(".el-form-item.is-error .el-form-item__content > :first-child").forEach((e) => {
83
- f(e, "breathe-animation");
84
- }), Error("表单验证不通过!");
85
- }
86
- }, k = (e) => _.value.validateField(e), A = (e) => _.value.resetFields(e), j = (e) => _.value.scrollToField(e), M = (e) => _.value.clearValidate(e), N = () => _.value.getField(), P = (e) => _.value.setInitialValues(e), F = () => _.value.fields;
87
- d(() => p.required, () => {
88
- M();
89
- });
90
- let I = l({
91
- tableForm: v,
92
- disabled: C,
93
- enabledFields: w,
94
- requiredFields: T,
95
- enabledFieldsMap: x,
96
- disabledFieldsMap: b,
97
- requiredFieldsMap: S,
98
- disabledFields: E,
99
- scrollIntoRequiredField: D,
100
- formRef: _,
101
- validate: O,
102
- validateField: k,
103
- resetFields: A,
104
- scrollToField: j,
105
- clearValidate: M,
106
- getField: N,
107
- setInitialValues: P,
108
- getFields: F
109
- });
110
- return c("formHolder", I), h(I), () => a(n, {
111
- ref: "form",
112
- class: "form-holder",
113
- model: p.model,
114
- size: p.size,
115
- "show-message": y.value,
116
- disabled: p.disabled,
117
- "label-width": p.labelWidth,
118
- "label-position": p.labelPosition
119
- }, { default: () => {
120
- if (v.value) {
121
- var n, i, o;
122
- return [
123
- (n = m.top) == null ? void 0 : n.call(m),
124
- a(t, {
125
- class: { "hide-error-message": v },
126
- columns: p.columns,
127
- "col-count": p.colCount
128
- }, { default: () => {
129
- var t;
130
- return [(t = m.default) == null ? void 0 : t.call(m), p.showAdvice ? a(e, {
131
- "label-colspan": p.commentLabelColspan,
132
- "value-colspan": p.commentValueColspan
133
- }, null) : null];
134
- } }),
135
- (i = m.bottom) == null ? void 0 : i.call(m),
136
- a("div", { class: "red-form-footer" }, [(o = m.footer) == null ? void 0 : o.call(m)])
137
- ];
138
- } else {
139
- var s;
140
- return p.wrapRow ? a(r, null, { default: () => {
141
- var e;
142
- return [(e = m.default) == null ? void 0 : e.call(m)];
143
- } }) : (s = m.default) == null ? void 0 : s.call(m);
144
- }
145
- } });
146
- }
147
- };
148
- //#endregion
149
- export { p 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 };
@@ -1,46 +0,0 @@
1
- import { a as e, n as t, t as n } from "./B4M_TFeR.mjs";
2
- import { ElRadio as r, ElRadioGroup as i } from "element-plus/es";
3
- import { createVNode as a, isVNode as o } from "vue";
4
- //#region src/components/form/FormRadioGroup.vue?vue&type=script&lang.jsx
5
- function s(e) {
6
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !o(e);
7
- }
8
- //#endregion
9
- //#region src/components/form/FormRadioGroup.vue
10
- var c = {
11
- name: "FormRadioGroup",
12
- inheritAttrs: !1,
13
- props: {
14
- ...t,
15
- modelValue: [
16
- String,
17
- Number,
18
- Boolean
19
- ],
20
- options: Array
21
- },
22
- emits: [...n],
23
- setup(t, { emit: n, slots: o }) {
24
- let { emitInput: c, render: l, placeholder: u, disabled: d } = e(t, {
25
- emit: n,
26
- slots: o
27
- });
28
- return () => l({ vNodes: a(i, {
29
- modelValue: t.modelValue,
30
- disabled: d.value,
31
- "onUpdate:modelValue": c,
32
- placeholder: u.value
33
- }, {
34
- ...o,
35
- default: o.default || (() => {
36
- var e;
37
- return (e = t.options) == null ? void 0 : e.map(({ value: e, label: t }) => a(r, {
38
- key: e,
39
- value: e
40
- }, s(t) ? t : { default: () => [t] }));
41
- })
42
- }) });
43
- }
44
- };
45
- //#endregion
46
- export { c as t };