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

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 (102) hide show
  1. package/base.css +1 -1
  2. package/chunks/53gSZ624.mjs +41 -0
  3. package/chunks/7Desvoh-.mjs +222 -0
  4. package/chunks/7vQ29mMd.mjs +53 -0
  5. package/chunks/8ORg8rrN.mjs +108 -0
  6. package/chunks/B4LDPAZu.mjs +98 -0
  7. package/chunks/B5B9au3z.mjs +180 -0
  8. package/chunks/BVzpe2oN.mjs +76 -0
  9. package/chunks/Bb5BT11-.mjs +26 -0
  10. package/chunks/Bh_CMUlo.mjs +12 -0
  11. package/chunks/Bj5l6sFx.mjs +73 -0
  12. package/chunks/BsbfEk0E.mjs +26 -0
  13. package/chunks/C1DlzLpD.mjs +222 -0
  14. package/chunks/CFwUzdTu.mjs +95 -0
  15. package/chunks/CKw_uzPc.mjs +108 -0
  16. package/chunks/D2WviyxF.mjs +166 -0
  17. package/chunks/D9GcEl6r.mjs +8 -0
  18. package/chunks/DCKxvrCR.mjs +189 -0
  19. package/chunks/DH1_fmkX.mjs +26 -0
  20. package/chunks/DUDm42gn.mjs +100 -0
  21. package/chunks/DgbDpRQg.mjs +51 -0
  22. package/chunks/DkqF25wT.mjs +106 -0
  23. package/chunks/DynLjTwi.mjs +17 -0
  24. package/chunks/Q9EsFJ4H.mjs +88 -0
  25. package/chunks/wfL1FAwc.mjs +1360 -0
  26. package/constants.d.ts +26 -1
  27. package/constants.mjs +2 -2
  28. package/element-dialog/index.d.ts +58 -15
  29. package/element-dialog/index.mjs +2 -94
  30. package/form-cascader/index.d.ts +2 -0
  31. package/form-cascader/index.mjs +10 -0
  32. package/form-check-box-group/index.d.ts +196 -22
  33. package/form-check-box-group/index.mjs +1 -1
  34. package/form-checkbox/index.d.ts +188 -24
  35. package/form-checkbox/index.mjs +1 -1
  36. package/form-date-picker/index.d.ts +307 -20
  37. package/form-date-picker/index.mjs +1 -1
  38. package/form-holder/index.d.ts +92 -21
  39. package/form-holder/index.mjs +1 -1
  40. package/form-holder/style.css +1 -1
  41. package/form-image/index.d.ts +138 -20
  42. package/form-image/index.mjs +1 -1
  43. package/form-input/index.d.ts +281 -40
  44. package/form-input/index.mjs +1 -1
  45. package/form-input-cron-expression/index.d.ts +215 -0
  46. package/form-input-cron-expression/index.mjs +2 -0
  47. package/form-input-cron-expression/style.css +1 -0
  48. package/form-input-email/index.d.ts +279 -21
  49. package/form-input-email/index.mjs +1 -1
  50. package/form-input-id-card/index.d.ts +279 -21
  51. package/form-input-id-card/index.mjs +1 -1
  52. package/form-input-number/index.d.ts +228 -24
  53. package/form-input-number/index.mjs +1 -1
  54. package/form-input-phone-number/index.d.ts +279 -21
  55. package/form-input-phone-number/index.mjs +1 -1
  56. package/form-item-config-provider/index.d.ts +3 -1
  57. package/form-item-config-provider/index.mjs +1 -1
  58. package/form-item-group/index.mjs +46 -30
  59. package/form-item-x/index.d.ts +124 -15
  60. package/form-item-x/index.mjs +1 -1
  61. package/form-radio-group/index.d.ts +196 -22
  62. package/form-radio-group/index.mjs +1 -1
  63. package/form-rate/index.d.ts +232 -18
  64. package/form-rate/index.mjs +1 -1
  65. package/form-row/index.mjs +1 -1
  66. package/form-select/index.d.ts +455 -22
  67. package/form-select/index.mjs +1 -1
  68. package/form-slider/index.d.ts +261 -18
  69. package/form-slider/index.mjs +1 -1
  70. package/form-switch/index.d.ts +238 -20
  71. package/form-switch/index.mjs +1 -1
  72. package/form-text/index.d.ts +144 -20
  73. package/form-text/index.mjs +1 -1
  74. package/index.d.ts +4 -1
  75. package/index.mjs +37 -60
  76. package/month-calendar/index.mjs +312 -2
  77. package/month-calendar/style.css +1 -1
  78. package/package.json +3 -1
  79. package/vue-cron/index.d.ts +191 -0
  80. package/vue-cron/index.mjs +2 -0
  81. package/vue-cron/style.css +1 -0
  82. package/web-types.json +1 -1
  83. package/year-calendar/index.mjs +2 -1
  84. package/chunks/B5BIQCcK.mjs +0 -149
  85. package/chunks/BDhGvPmU.mjs +0 -32
  86. package/chunks/BXOvvlL2.mjs +0 -35
  87. package/chunks/C6tYoDfK.mjs +0 -43
  88. package/chunks/CAYDWMXC.mjs +0 -47
  89. package/chunks/CXHvVx2H.mjs +0 -54
  90. package/chunks/CykRgGj0.mjs +0 -90
  91. package/chunks/D4SiGR5u.mjs +0 -28
  92. package/chunks/DAEpRn3D.mjs +0 -28
  93. package/chunks/DK2YoEOD.mjs +0 -167
  94. package/chunks/DL4ovOwO.mjs +0 -36
  95. package/chunks/DXrQ5tWJ.mjs +0 -35
  96. package/chunks/Xww4oyW1.mjs +0 -47
  97. package/chunks/ciEWoJ1U.mjs +0 -23
  98. package/chunks/dwnrVqcq.mjs +0 -315
  99. package/chunks/jpMiw_3M.mjs +0 -74
  100. package/chunks/vlkluoXb.mjs +0 -32
  101. package/chunks/wo0ekOcp.mjs +0 -28
  102. /package/chunks/{CI_28Uw4.mjs → 98bTmBOR.mjs} +0 -0
@@ -1,4 +1,5 @@
1
- import { n as e, t } from "../chunks/dwnrVqcq.mjs";
1
+ import { t as e } from "../chunks/D9GcEl6r.mjs";
2
+ import t from "../month-calendar/index.mjs";
2
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";
3
4
  import f from "dayjs";
4
5
  //#region src/components/material-year-calendar/YearCalendar.vue
@@ -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,32 +0,0 @@
1
- import { n as e, o as t, r as n } from "./DK2YoEOD.mjs";
2
- import { ElRate as r } from "element-plus/es";
3
- import { createVNode as i, isVNode as a } from "vue";
4
- //#region src/components/form/FormRate.vue?vue&type=script&lang.jsx
5
- function o(e) {
6
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !a(e);
7
- }
8
- //#endregion
9
- //#region src/components/form/FormRate.vue
10
- var s = {
11
- name: "FormRate",
12
- inheritAttrs: !1,
13
- props: {
14
- ...n,
15
- modelValue: Number
16
- },
17
- emits: { ...e },
18
- setup(e, { emit: n, slots: a }) {
19
- let { emitInput: s, render: c, disabled: l } = t(e, {
20
- emit: n,
21
- slots: a
22
- });
23
- return () => c({ vNodes: i(r, {
24
- modelValue: e.modelValue,
25
- clearable: !0,
26
- disabled: l.value,
27
- "onUpdate:modelValue": s
28
- }, o(a) ? a : { default: () => [a] }) });
29
- }
30
- };
31
- //#endregion
32
- export { s as t };
@@ -1,35 +0,0 @@
1
- import { c as e, i as t, r as n } from "./DK2YoEOD.mjs";
2
- import { ElImage as r } from "element-plus/es";
3
- import { createVNode as i, isVNode as a } from "vue";
4
- //#region src/components/form/FormImage.vue?vue&type=script&lang.jsx
5
- function o(e) {
6
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !a(e);
7
- }
8
- //#endregion
9
- //#region src/components/form/FormImage.vue
10
- var s = {
11
- name: "FormImage",
12
- inheritAttrs: !1,
13
- props: {
14
- ...n,
15
- src: String,
16
- fit: String,
17
- hideOnClickModal: Boolean
18
- },
19
- setup(n, { slots: a, attrs: s }) {
20
- let c = e(n);
21
- return () => t(n, {
22
- vNodes: i(r, {
23
- src: n.src,
24
- fit: n.fit,
25
- "preview-src-list": [n.src],
26
- "hide-on-click-modal": n.hideOnClickModal,
27
- style: s.style
28
- }, o(a) ? a : { default: () => [a] }),
29
- formItemProps: c,
30
- slots: a
31
- });
32
- }
33
- };
34
- //#endregion
35
- export { s as t };
@@ -1,43 +0,0 @@
1
- import { n as e, o as t, r as n } from "./DK2YoEOD.mjs";
2
- import { ElInputNumber as r } from "element-plus/es";
3
- import { createVNode as i } from "vue";
4
- //#endregion
5
- //#region src/components/form/FormInputNumber.vue
6
- var a = {
7
- name: "FormInputNumber",
8
- inheritAttrs: !1,
9
- props: {
10
- ...n,
11
- modelValue: Number,
12
- controls: Boolean,
13
- align: {
14
- type: String,
15
- default: "left"
16
- },
17
- prefix: String,
18
- suffix: String
19
- },
20
- emits: { ...e },
21
- setup(e, { emit: n, slots: a }) {
22
- let { emitInput: o, render: s, placeholder: c, disabled: l } = t(e, {
23
- emit: n,
24
- slots: a
25
- });
26
- return () => s({ vNodes: i(r, {
27
- style: "width: 100%",
28
- align: e.align,
29
- modelValue: e.modelValue,
30
- disabled: l.value,
31
- controls: e.controls,
32
- "onUpdate:modelValue": o,
33
- placeholder: c.value
34
- }, {
35
- prefix: a.prefix || e.prefix ? () => e.prefix : null,
36
- suffix: a.suffix || e.suffix ? () => e.suffix : null,
37
- "decrease-icon": a["decrease-icon"],
38
- "increase-icon": a["increase-icon"]
39
- }) });
40
- }
41
- };
42
- //#endregion
43
- export { a as t };
@@ -1,47 +0,0 @@
1
- import { n as e, o as t, r as n } from "./DK2YoEOD.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
- ...n,
15
- modelValue: [
16
- String,
17
- Number,
18
- Boolean
19
- ],
20
- options: Array
21
- },
22
- emits: { ...e },
23
- setup(e, { emit: n, slots: o }) {
24
- let { emitInput: c, render: l, placeholder: u, disabled: d } = t(e, {
25
- emit: n,
26
- slots: o,
27
- messagePrefix: "请选择"
28
- });
29
- return () => l({ vNodes: a(i, {
30
- modelValue: e.modelValue,
31
- disabled: d.value,
32
- "onUpdate:modelValue": c,
33
- placeholder: u.value
34
- }, {
35
- ...o,
36
- default: o.default || (() => {
37
- var t;
38
- return (t = e.options) == null ? void 0 : t.map(({ value: e, label: t }) => a(r, {
39
- key: e,
40
- value: e
41
- }, s(t) ? t : { default: () => [t] }));
42
- })
43
- }) });
44
- }
45
- };
46
- //#endregion
47
- export { c as t };
@@ -1,54 +0,0 @@
1
- import { n as e, o as t, r as n } from "./DK2YoEOD.mjs";
2
- import { ElCheckbox as r, ElCheckboxGroup as i } from "element-plus/es";
3
- import { computed as a, createVNode as o, isVNode as s } from "vue";
4
- //#region src/components/form/FormCheckBoxGroup.vue?vue&type=script&lang.jsx
5
- function c(e) {
6
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !s(e);
7
- }
8
- //#endregion
9
- //#region src/components/form/FormCheckBoxGroup.vue
10
- var l = {
11
- name: "FormCheckBoxGroup",
12
- inheritAttrs: !1,
13
- props: {
14
- ...n,
15
- modelValue: [Array, String],
16
- options: Array,
17
- stringMode: Boolean,
18
- delimiter: {
19
- type: String,
20
- default: ","
21
- }
22
- },
23
- emits: { ...e },
24
- setup(e, { emit: n, slots: s }) {
25
- let { emitInput: l, render: u, placeholder: d, disabled: f } = t(e, {
26
- emit: n,
27
- slots: s,
28
- messagePrefix: "请选择"
29
- }), p = (t) => l(e.stringMode ? t.join(e.delimiter) : t), m = a(() => {
30
- if (e.stringMode) {
31
- var t;
32
- return Array.isArray(e.modelValue) ? e.modelValue.filter((e) => e) : ((t = e.modelValue) == null ? void 0 : t.split(e.delimiter).filter((e) => e)) ?? [];
33
- }
34
- return e.modelValue || [];
35
- });
36
- return () => u({ vNodes: o(i, {
37
- modelValue: m.value,
38
- disabled: f.value,
39
- "onUpdate:modelValue": p,
40
- placeholder: d.value
41
- }, {
42
- ...s,
43
- default: s.default || (() => {
44
- var t;
45
- return (t = e.options) == null ? void 0 : t.map(({ value: e, label: t }) => o(r, {
46
- key: e,
47
- value: e
48
- }, c(t) ? t : { default: () => [t] }));
49
- })
50
- }) });
51
- }
52
- };
53
- //#endregion
54
- export { l as t };
@@ -1,90 +0,0 @@
1
- import { n as e, o as t, r as n, t as r } from "./DK2YoEOD.mjs";
2
- import { ElInput as i } from "element-plus/es";
3
- import { computed as a, createVNode as o } from "vue";
4
- import { validatePhoneNum as s } from "@web-utils/core";
5
- //#region src/util/form-validate.js
6
- var c = (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 l(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 u = {
13
- name: "FormInput",
14
- inheritAttrs: !1,
15
- props: {
16
- ...n,
17
- modelValue: String,
18
- type: String,
19
- rows: Number,
20
- prepend: String,
21
- append: String,
22
- prefix: String,
23
- suffix: String,
24
- readonlyGrey: {
25
- type: Boolean,
26
- default: !0
27
- },
28
- maxLength: {
29
- type: String,
30
- default: "255"
31
- },
32
- picker: Boolean,
33
- suffixIcon: String,
34
- prefixIcon: String
35
- },
36
- emits: {
37
- ...e,
38
- click: null,
39
- clear: null
40
- },
41
- setup(e, { emit: n, slots: u }) {
42
- let d = `请输入正确的${e.label}!`, { emitInput: f, render: p, placeholder: m, disabled: h } = t(e, {
43
- emit: n,
44
- slots: u,
45
- rules: a(() => {
46
- if (!e.type || e.type === "textarea") return null;
47
- let t = {
48
- message: d,
49
- trigger: "blur"
50
- };
51
- if (e.type === "email") t.validator = c;
52
- else if (e.type === "idcard") t.validator = l;
53
- else if (e.type === "phone") t.validator = s;
54
- else return null;
55
- return [t];
56
- })
57
- }), g = (e) => {
58
- n("click", e);
59
- }, _ = () => {
60
- n("clear");
61
- };
62
- return () => p({ vNodes: o(i, {
63
- class: ["form-input", {
64
- "is-readonly": e.readonlyGrey && e.readonly && !e.picker,
65
- "el-input-cursor-pointer": e.picker && !h.value
66
- }],
67
- modelValue: e.modelValue,
68
- type: e.type,
69
- clearable: !0,
70
- rows: e.rows,
71
- readonly: e.readonly || e.picker,
72
- maxLength: e.maxLength,
73
- onClick: g,
74
- onClear: _,
75
- "prefix-icon": r({ icon: e.picker ? "el-icon-search" : e.prefixIcon }),
76
- "suffix-icon": r({ icon: e.suffixIcon }),
77
- disabled: h.value,
78
- "onUpdate:modelValue": f,
79
- placeholder: m.value
80
- }, {
81
- prefix: u.prefix || e.prefix ? () => e.prefix : null,
82
- suffix: u.suffix || e.suffix ? () => e.suffix : null,
83
- "password-icon": u["password-icon"],
84
- prepend: u.prepend || e.prepend ? () => e.prepend : null,
85
- append: u.append || e.append ? () => e.append : null
86
- }) });
87
- }
88
- };
89
- //#endregion
90
- export { u as t };
@@ -1,28 +0,0 @@
1
- import { a as e, n as t, r as n } from "./DK2YoEOD.mjs";
2
- import { t as r } from "./CykRgGj0.mjs";
3
- import { createVNode as i, isVNode as a, mergeProps as o } from "vue";
4
- //#region src/components/form/FormInputIdCard.vue?vue&type=script&lang.jsx
5
- function s(e) {
6
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !a(e);
7
- }
8
- //#endregion
9
- //#region src/components/form/FormInputIdCard.vue
10
- var c = {
11
- name: "FormInputIdCard",
12
- inheritAttrs: !1,
13
- props: {
14
- ...n,
15
- modelValue: String
16
- },
17
- emits: { ...t },
18
- setup(t, { emit: n, slots: a }) {
19
- let c = (t) => e(n, t);
20
- return () => i(r, o(t, {
21
- modelValue: t.modelValue,
22
- type: "idcard",
23
- "onUpdate:modelValue": c
24
- }), s(a) ? a : { default: () => [a] });
25
- }
26
- };
27
- //#endregion
28
- export { c as t };
@@ -1,28 +0,0 @@
1
- import { a as e, n as t, r as n } from "./DK2YoEOD.mjs";
2
- import { t as r } from "./CykRgGj0.mjs";
3
- import { createVNode as i, isVNode as a, mergeProps as o } from "vue";
4
- //#region src/components/form/FormInputEmail.vue?vue&type=script&lang.jsx
5
- function s(e) {
6
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !a(e);
7
- }
8
- //#endregion
9
- //#region src/components/form/FormInputEmail.vue
10
- var c = {
11
- name: "FormInputEmail",
12
- inheritAttrs: !1,
13
- props: {
14
- ...n,
15
- modelValue: String
16
- },
17
- emits: { ...t },
18
- setup(t, { emit: n, slots: a }) {
19
- let c = (t) => e(n, t);
20
- return () => i(r, o(t, {
21
- modelValue: t.modelValue,
22
- type: "email",
23
- "onUpdate:modelValue": c
24
- }), s(a) ? a : { default: () => [a] });
25
- }
26
- };
27
- //#endregion
28
- export { c as t };
@@ -1,167 +0,0 @@
1
- import { formItemConfigProviderContextKey as e } from "../constants.mjs";
2
- import { ElCol as t, ElFormItem as n, ElTooltip as r } from "element-plus/es";
3
- import { computed as i, createVNode as a, h as o, inject as s, mergeProps as c, nextTick as l, unref as u, useTemplateRef as d } from "vue";
4
- import { ElCol as f, rowContextKey as p } from "element-plus";
5
- //#region src/components/form/form-item.js
6
- var m = {
7
- label: String,
8
- prop: String,
9
- required: Boolean,
10
- rules: Array,
11
- messagePrefix: String,
12
- message: String,
13
- wrapCol: {
14
- type: Boolean,
15
- default: !0
16
- },
17
- fixedSpan: Number,
18
- span: {
19
- type: Number,
20
- default: 12
21
- },
22
- block: Boolean,
23
- unwrap: Boolean,
24
- half: Boolean,
25
- formItemClass: String,
26
- hideLabel: Boolean,
27
- tips: { type: String },
28
- tipsAfterLabel: {
29
- type: Boolean,
30
- default: !1
31
- },
32
- labelColspan: [Number, String],
33
- inputColspan: [Number, String],
34
- labelRowspan: [Number, String],
35
- inputRowspan: [Number, String]
36
- }, h = (e) => {
37
- let t = s("formHolder", null);
38
- return i(() => e.required === !0 ? !0 : (t == null ? void 0 : t.requiredFieldsMap[e.prop]) === !0);
39
- }, g = (e, { rules: t, messagePrefix: n } = {}) => {
40
- let r = h(e);
41
- return i(() => {
42
- let i = {}, a = u(t);
43
- return Object.keys(m).forEach((t) => {
44
- t === "rules" ? e[t] && a ? i[t] = [...e[t], ...a] : e[t] ? i[t] = e[t] : a && (i[t] = a) : t === "messagePrefix" ? i[t] = e.messagePrefix || n : i[t] = e[t];
45
- }), i.required = r.value, i;
46
- });
47
- }, _ = {
48
- name: "FormItemX",
49
- inheritAttrs: !1,
50
- props: { ...m },
51
- setup(o, { attrs: u, slots: f, expose: m }) {
52
- let g = s(p, null), _ = s(e, null), v = s("formHolder", null), y = u.embed ? i(() => u.disabled) : b(o), x = i(() => (_ == null ? void 0 : _.reactive) === !0 && _.block === !1 && o.fixedSpan === void 0 && !o.half), S = h(o), C = d("formItem"), w = i(() => (_ == null ? void 0 : _.wrapCol) === !1 ? !1 : !!g && o.wrapCol), T = i(() => v != null && v.tableForm ? "" : _ != null && _.block ? "100%" : o.half && w.value ? `calc(50% - ${g.gutter.value / 2}px)` : ""), E = i(() => (_ == null ? void 0 : _.block) === !0 || o.block || o.half ? 24 : o.span), D = i(() => {
53
- if (y.value) return [];
54
- if (S.value) {
55
- let e = {
56
- required: !0,
57
- message: o.message || `${o.messagePrefix || "请输入"}${o.label}`
58
- };
59
- return o.rules ? [...o.rules, e] : [e];
60
- }
61
- return o.rules;
62
- });
63
- return m({
64
- clearValidate: async () => {
65
- var e;
66
- await l(), (e = C.value) == null || e.clearValidate();
67
- },
68
- validate: async () => {
69
- var e;
70
- await l(), (e = C.value) == null || e.validate();
71
- }
72
- }), () => {
73
- var e;
74
- let i = f.tips || o.tips, s = i ? a(r, {
75
- effect: "light",
76
- content: o.tips,
77
- offset: 4
78
- }, {
79
- default: () => a("i", { class: "el-icon-info form-item-input-info" }, null),
80
- content: f.tips ? f.tips : null
81
- }) : null, l = a(n, {
82
- ref: "formItem",
83
- style: { width: T.value },
84
- label: o.label,
85
- class: [
86
- "form-item",
87
- o.formItemClass,
88
- {
89
- "form-item-hide-label": o.hideLabel,
90
- "with-tips": !o.tipsAfterLabel && i,
91
- required: y.value === !1 && S.value
92
- }
93
- ],
94
- prop: o.prop,
95
- rules: D.value
96
- }, {
97
- ...f,
98
- default: () => {
99
- var e;
100
- return [(e = f.default) == null ? void 0 : e.call(f, {
101
- disabled: y.value,
102
- required: S.value
103
- }), i && !o.tipsAfterLabel ? s : null];
104
- },
105
- label: () => [f.label ? f.label() : o.label, o.tipsAfterLabel ? s : null]
106
- }), u = [l, (e = f.below) == null ? void 0 : e.call(f)];
107
- return o.unwrap ? u : w.value ? a(t, c({ span: E.value }, x.value ? {
108
- xs: 24,
109
- sm: 12,
110
- md: 12,
111
- lg: 8,
112
- xl: 6
113
- } : {}), { default: () => u }) : l;
114
- };
115
- }
116
- }, v = "update:modelValue", y = {
117
- ...m,
118
- wrapFormItem: {
119
- type: Boolean,
120
- default: !0
121
- },
122
- disabled: {
123
- type: Boolean,
124
- default: void 0
125
- },
126
- col: Boolean,
127
- readonly: Boolean
128
- }, b = (e) => {
129
- let t = s("formHolder", null), n = s("formItemGroup", null);
130
- return i(() => {
131
- if (e.disabled !== void 0) return e.disabled;
132
- if (t) {
133
- if (t.requiredFieldsMap[e.prop] === !0 || t.enabledFieldsMap[e.prop] === !0) return !1;
134
- if (t.disabledFieldsMap[e.prop] === !0) return !0;
135
- }
136
- return (n == null ? void 0 : n.enabled) === !0 ? !1 : (n == null ? void 0 : n.disabled) === !0 ? !0 : (t == null ? void 0 : t.disabled) === !0;
137
- });
138
- }, x = { [v]: null }, S = (e, t) => e(v, t), C = (e, { vNodes: t, formItemProps: n, slots: r, disabled: i }) => e.wrapFormItem ? o(_, {
139
- ...n.value,
140
- embed: !0,
141
- disabled: i == null ? void 0 : i.value
142
- }, {
143
- default: () => t,
144
- label: r.label,
145
- error: r.error,
146
- tips: r.tips,
147
- below: r.below
148
- }) : t, w = (e, { emit: t, slots: n, rules: r, messagePrefix: a = "请输入" }) => {
149
- let s = g(e, {
150
- rules: r,
151
- messagePrefix: a
152
- }), c = b(e), l = (e) => S(t, e), u = (t) => e.col ? o(f, { span: e.block ? 24 : e.span }, { default: () => t }) : t;
153
- return {
154
- emitInput: l,
155
- render: ({ vNodes: t }) => C(e, {
156
- vNodes: u(t),
157
- formItemProps: s,
158
- slots: n,
159
- disabled: c
160
- }),
161
- placeholder: i(() => c.value ? "" : `${a}${e.label}`),
162
- disabled: c,
163
- formItemProps: s
164
- };
165
- }, T = (e) => e.icon ? o("i", { class: e.icon }) : null;
166
- //#endregion
167
- export { S as a, g as c, C as i, x as n, w as o, y as r, _ as s, T as t };