@layers.digital/layers-design-system-vue3 1.0.0 → 1.0.2

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 (97) hide show
  1. package/dist/components/LLinearProgress/LLinearProgress.vue.d.ts +29 -0
  2. package/dist/index.d.ts +1 -0
  3. package/dist/layers-design-system-vue3.cjs +1 -1
  4. package/dist/layers-design-system-vue3.js +15 -12
  5. package/dist/layers-design-system-vue310.cjs +1 -1
  6. package/dist/layers-design-system-vue310.js +2 -2
  7. package/dist/layers-design-system-vue311.cjs +1 -1
  8. package/dist/layers-design-system-vue311.js +44 -7
  9. package/dist/layers-design-system-vue312.cjs +1 -1
  10. package/dist/layers-design-system-vue312.js +2 -40
  11. package/dist/layers-design-system-vue313.cjs +1 -1
  12. package/dist/layers-design-system-vue313.js +7 -2
  13. package/dist/layers-design-system-vue314.cjs +1 -1
  14. package/dist/layers-design-system-vue314.js +33 -39
  15. package/dist/layers-design-system-vue316.cjs +1 -1
  16. package/dist/layers-design-system-vue316.js +46 -2
  17. package/dist/layers-design-system-vue317.cjs +1 -1
  18. package/dist/layers-design-system-vue317.js +2 -2
  19. package/dist/layers-design-system-vue318.cjs +1 -1
  20. package/dist/layers-design-system-vue318.js +2 -24
  21. package/dist/layers-design-system-vue319.cjs +1 -1
  22. package/dist/layers-design-system-vue319.js +2 -2
  23. package/dist/layers-design-system-vue32.cjs +1 -1
  24. package/dist/layers-design-system-vue32.js +3 -3
  25. package/dist/layers-design-system-vue320.cjs +1 -1
  26. package/dist/layers-design-system-vue320.js +24 -2
  27. package/dist/layers-design-system-vue321.cjs +1 -1
  28. package/dist/layers-design-system-vue321.js +2 -2
  29. package/dist/layers-design-system-vue322.cjs +1 -1
  30. package/dist/layers-design-system-vue322.js +2 -2
  31. package/dist/layers-design-system-vue323.cjs +1 -38
  32. package/dist/layers-design-system-vue323.js +3 -27192
  33. package/dist/layers-design-system-vue324.cjs +1 -1
  34. package/dist/layers-design-system-vue324.js +2 -240
  35. package/dist/layers-design-system-vue325.cjs +1 -12
  36. package/dist/layers-design-system-vue325.js +2 -1173
  37. package/dist/layers-design-system-vue326.cjs +35 -10
  38. package/dist/layers-design-system-vue326.js +27067 -1856
  39. package/dist/layers-design-system-vue327.cjs +1 -1
  40. package/dist/layers-design-system-vue327.js +824 -9
  41. package/dist/layers-design-system-vue328.cjs +1 -1
  42. package/dist/layers-design-system-vue328.js +2019 -1659
  43. package/dist/layers-design-system-vue329.cjs +9 -1
  44. package/dist/layers-design-system-vue329.js +489 -2050
  45. package/dist/layers-design-system-vue33.cjs +1 -1
  46. package/dist/layers-design-system-vue33.js +3 -3
  47. package/dist/layers-design-system-vue330.cjs +12 -9
  48. package/dist/layers-design-system-vue330.js +1137 -500
  49. package/dist/layers-design-system-vue331.cjs +1 -1
  50. package/dist/layers-design-system-vue331.js +1 -1
  51. package/dist/layers-design-system-vue332.cjs +13 -1
  52. package/dist/layers-design-system-vue332.js +1981 -2
  53. package/dist/layers-design-system-vue333.cjs +1 -1
  54. package/dist/layers-design-system-vue333.js +2 -2
  55. package/dist/layers-design-system-vue335.cjs +1 -1
  56. package/dist/layers-design-system-vue335.js +2 -2
  57. package/dist/layers-design-system-vue336.cjs +1 -1
  58. package/dist/layers-design-system-vue336.js +2 -2
  59. package/dist/layers-design-system-vue337.cjs +1 -1
  60. package/dist/layers-design-system-vue337.js +2 -2
  61. package/dist/layers-design-system-vue338.cjs +1 -1
  62. package/dist/layers-design-system-vue338.js +9 -2
  63. package/dist/layers-design-system-vue339.cjs +1 -1
  64. package/dist/layers-design-system-vue339.js +1686 -773
  65. package/dist/layers-design-system-vue34.cjs +1 -1
  66. package/dist/layers-design-system-vue34.js +3 -3
  67. package/dist/layers-design-system-vue340.cjs +1 -1
  68. package/dist/layers-design-system-vue340.js +2 -2
  69. package/dist/layers-design-system-vue341.js +2 -2
  70. package/dist/layers-design-system-vue342.cjs +1 -1
  71. package/dist/layers-design-system-vue342.js +2 -2
  72. package/dist/layers-design-system-vue343.cjs +1 -1
  73. package/dist/layers-design-system-vue343.js +2 -113
  74. package/dist/layers-design-system-vue344.cjs +1 -1
  75. package/dist/layers-design-system-vue344.js +2 -2
  76. package/dist/layers-design-system-vue345.cjs +1 -1
  77. package/dist/layers-design-system-vue345.js +104 -78
  78. package/dist/layers-design-system-vue346.cjs +1 -1
  79. package/dist/layers-design-system-vue346.js +2 -2
  80. package/dist/layers-design-system-vue347.cjs +1 -0
  81. package/dist/layers-design-system-vue347.js +242 -0
  82. package/dist/layers-design-system-vue348.cjs +1 -0
  83. package/dist/layers-design-system-vue348.js +89 -0
  84. package/dist/layers-design-system-vue349.cjs +1 -0
  85. package/dist/layers-design-system-vue349.js +4 -0
  86. package/dist/layers-design-system-vue35.cjs +1 -1
  87. package/dist/layers-design-system-vue35.js +9 -9
  88. package/dist/layers-design-system-vue36.cjs +1 -1
  89. package/dist/layers-design-system-vue36.js +8 -8
  90. package/dist/layers-design-system-vue37.cjs +1 -1
  91. package/dist/layers-design-system-vue37.js +3 -3
  92. package/dist/layers-design-system-vue38.cjs +1 -1
  93. package/dist/layers-design-system-vue38.js +4 -4
  94. package/dist/layers-design-system-vue39.cjs +1 -1
  95. package/dist/layers-design-system-vue39.js +17 -40
  96. package/dist/style.css +1 -1
  97. package/package.json +2 -2
@@ -1,538 +1,1175 @@
1
- import { useFormItem as De, useFormItemInputId as Ke, useFormSize as je, useFormDisabled as We, useSizeProp as Ue, UPDATE_MODEL_EVENT as se } from "./layers-design-system-vue325.js";
2
- import { ValidateComponentsMap as Ye, view_default as Xe, hide_default as Ze, ElIcon as A, circle_close_default as qe, iconPropType as xe } from "./layers-design-system-vue331.js";
3
- import { buildProps as Ge, useNamespace as we, isNil_default as Je, useResizeObserver as Qe, debugWarn as Se, NOOP as et, withInstall as tt, fromPairs_default as ot, useEventListener as at, definePropType as te, isString as oe, isClient as nt, isObject as Ce, isNumber as Ie, _export_sfc as st, isFirefox as rt } from "./layers-design-system-vue326.js";
4
- import { defineComponent as ze, useAttrs as lt, useSlots as it, computed as p, shallowRef as X, ref as N, watch as Z, nextTick as F, onMounted as ut, toRef as dt, withDirectives as ct, openBlock as m, createElementBlock as S, mergeProps as ae, unref as t, createCommentVNode as y, Fragment as ne, normalizeClass as b, renderSlot as W, createElementVNode as V, createBlock as I, withCtx as B, resolveDynamicComponent as U, withModifiers as pt, createVNode as ft, toDisplayString as Y, normalizeStyle as vt, vShow as mt, getCurrentInstance as ke } from "vue";
5
- var yt = (a) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(a), ht = (a) => a, bt = ["class", "style"], gt = /^on[A-Z]/, xt = (a = {}) => {
6
- const { excludeListeners: f = !1, excludeKeys: i } = a, o = p(() => ((i == null ? void 0 : i.value) || []).concat(bt)), l = ke();
7
- return l ? p(() => {
8
- var r;
9
- return ot(Object.entries((r = l.proxy) == null ? void 0 : r.$attrs).filter(([u]) => !o.value.includes(u) && !(f && gt.test(u))));
10
- }) : p(() => ({}));
11
- };
12
- function wt(a) {
13
- const f = N();
14
- function i() {
15
- if (a.value == null)
16
- return;
17
- const { selectionStart: l, selectionEnd: r, value: u } = a.value;
18
- if (l == null || r == null)
19
- return;
20
- const x = u.slice(0, Math.max(0, l)), d = u.slice(Math.max(0, r));
21
- f.value = {
22
- selectionStart: l,
23
- selectionEnd: r,
24
- value: u,
25
- beforeTxt: x,
26
- afterTxt: d
27
- };
28
- }
29
- function o() {
30
- if (a.value == null || f.value == null)
31
- return;
32
- const { value: l } = a.value, { beforeTxt: r, afterTxt: u, selectionStart: x } = f.value;
33
- if (r == null || u == null || x == null)
34
- return;
35
- let d = l.length;
36
- if (l.endsWith(u))
37
- d = l.length - u.length;
38
- else if (l.startsWith(r))
39
- d = r.length;
40
- else {
41
- const g = r[x - 1], v = l.indexOf(g, x - 1);
42
- v !== -1 && (d = v + 1);
43
- }
44
- a.value.setSelectionRange(d, d);
45
- }
46
- return [i, o];
47
- }
48
- function St(a, { afterFocus: f, afterBlur: i } = {}) {
49
- const o = ke(), { emit: l } = o, r = X(), u = N(!1), x = (v) => {
50
- u.value || (u.value = !0, l("focus", v), f == null || f());
51
- }, d = (v) => {
52
- var c;
53
- v.relatedTarget && ((c = r.value) != null && c.contains(v.relatedTarget)) || (u.value = !1, l("blur", v), i == null || i());
54
- }, g = () => {
55
- var v;
56
- (v = a.value) == null || v.focus();
1
+ import { buildProp as lr, buildProps as Fe, definePropType as ce, useNamespace as qe, debugWarn as fr, throwError as ur, useResizeObserver as dr, refDebounced as cr, addUnit as Pe, isBoolean as Be, isString as pe, getProp as fe, castArray_default as ve, clone_default as Se, withInstall as pr, withNoopInstall as vr, useGetDerivedNamespace as mr, isArray as hr, isFunction as De, _export_sfc as Ce } from "./layers-design-system-vue332.js";
2
+ import { defineComponent as X, computed as _, watch as k, provide as Ue, reactive as Ke, toRefs as Je, openBlock as me, createElementBlock as Ye, normalizeClass as Y, unref as E, renderSlot as ne, inject as L, ref as W, onMounted as xe, onBeforeUnmount as Ze, onUpdated as gr, createVNode as ae, Fragment as yr, useSlots as br, withCtx as ue, createBlock as wr, resolveDynamicComponent as Fr, normalizeStyle as Ie, createTextVNode as qr, toDisplayString as je, createCommentVNode as Ne, createElementVNode as Re, TransitionGroup as xr, toRef as Er, onUnmounted as _r, nextTick as Ge, getCurrentInstance as ke } from "vue";
3
+ var Et = "update:modelValue", _t = "change", Ot = "input", Ee = ["", "default", "small", "large"], At = {
4
+ large: 40,
5
+ default: 32,
6
+ small: 24
7
+ }, He = (i) => {
8
+ const e = ke();
9
+ return _(() => {
10
+ var r, n;
11
+ return (n = (r = e == null ? void 0 : e.proxy) == null ? void 0 : r.$props) == null ? void 0 : n[i];
12
+ });
13
+ }, Ve = {
14
+ prefix: Math.floor(Math.random() * 1e4),
15
+ current: 0
16
+ }, Or = Symbol("elIdInjection"), Ar = () => ke() ? L(Or, Ve) : Ve, Qe = (i) => {
17
+ const e = Ar(), r = mr();
18
+ return _(() => E(i) || `${r.value}-id-${e.prefix}-${e.current++}`);
19
+ }, Pt = lr({
20
+ type: String,
21
+ values: Ee,
22
+ required: !1
23
+ }), Pr = Symbol("size"), Sr = () => {
24
+ const i = L(Pr, {});
25
+ return _(() => E(i.size) || "");
26
+ }, K = Symbol("formContextKey"), H = Symbol("formItemContextKey"), Xe = (i, e = {}) => {
27
+ const r = W(void 0), n = e.prop ? r : He("size"), t = e.global ? r : Sr(), o = e.form ? { size: void 0 } : L(K, void 0), a = e.formItem ? { size: void 0 } : L(H, void 0);
28
+ return _(() => n.value || E(i) || (a == null ? void 0 : a.size) || (o == null ? void 0 : o.size) || t.value || "");
29
+ }, St = (i) => {
30
+ const e = He("disabled"), r = L(K, void 0);
31
+ return _(() => e.value || E(i) || (r == null ? void 0 : r.disabled) || !1);
32
+ }, It = () => {
33
+ const i = L(K, void 0), e = L(H, void 0);
34
+ return {
35
+ form: i,
36
+ formItem: e
57
37
  };
58
- return Z(r, (v) => {
59
- v && v.setAttribute("tabindex", "-1");
60
- }), at(r, "click", g), {
61
- wrapperRef: r,
62
- isFocused: u,
63
- handleFocus: x,
64
- handleBlur: d
38
+ }, jt = (i, {
39
+ formItemContext: e,
40
+ disableIdGeneration: r,
41
+ disableIdManagement: n
42
+ }) => {
43
+ r || (r = W(!1)), n || (n = W(!1));
44
+ const t = W();
45
+ let o;
46
+ const a = _(() => {
47
+ var s;
48
+ return !!(!i.label && e && e.inputIds && ((s = e.inputIds) == null ? void 0 : s.length) <= 1);
49
+ });
50
+ return xe(() => {
51
+ o = k([Er(i, "id"), r], ([s, u]) => {
52
+ const g = s ?? (u ? void 0 : Qe().value);
53
+ g !== t.value && (e != null && e.removeInputId && (t.value && e.removeInputId(t.value), !(n != null && n.value) && !u && g && e.addInputId(g)), t.value = g);
54
+ }, { immediate: !0 });
55
+ }), _r(() => {
56
+ o && o(), e != null && e.removeInputId && t.value && e.removeInputId(t.value);
57
+ }), {
58
+ isLabeledByFormItem: a,
59
+ inputId: t
65
60
  };
66
- }
67
- var w = void 0, Ct = `
68
- height:0 !important;
69
- visibility:hidden !important;
70
- ${rt() ? "" : "overflow:hidden !important;"}
71
- position:absolute !important;
72
- z-index:-1000 !important;
73
- top:0 !important;
74
- right:0 !important;
75
- `, It = [
76
- "letter-spacing",
77
- "line-height",
78
- "padding-top",
79
- "padding-bottom",
80
- "font-family",
81
- "font-weight",
82
- "font-size",
83
- "text-rendering",
84
- "text-transform",
85
- "width",
86
- "text-indent",
87
- "padding-left",
88
- "padding-right",
89
- "border-width",
90
- "box-sizing"
91
- ];
92
- function Et(a) {
93
- const f = window.getComputedStyle(a), i = f.getPropertyValue("box-sizing"), o = Number.parseFloat(f.getPropertyValue("padding-bottom")) + Number.parseFloat(f.getPropertyValue("padding-top")), l = Number.parseFloat(f.getPropertyValue("border-bottom-width")) + Number.parseFloat(f.getPropertyValue("border-top-width"));
94
- return { contextStyle: It.map((u) => `${u}:${f.getPropertyValue(u)}`).join(";"), paddingSize: o, borderSize: l, boxSizing: i };
95
- }
96
- function Ee(a, f = 1, i) {
97
- var o;
98
- w || (w = document.createElement("textarea"), document.body.appendChild(w));
99
- const { paddingSize: l, borderSize: r, boxSizing: u, contextStyle: x } = Et(a);
100
- w.setAttribute("style", `${x};${Ct}`), w.value = a.value || a.placeholder || "";
101
- let d = w.scrollHeight;
102
- const g = {};
103
- u === "border-box" ? d = d + r : u === "content-box" && (d = d - l), w.value = "";
104
- const v = w.scrollHeight - l;
105
- if (Ie(f)) {
106
- let c = v * f;
107
- u === "border-box" && (c = c + l + r), d = Math.max(c, d), g.minHeight = `${c}px`;
108
- }
109
- if (Ie(i)) {
110
- let c = v * i;
111
- u === "border-box" && (c = c + l + r), d = Math.min(c, d);
112
- }
113
- return g.height = `${d}px`, (o = w.parentNode) == null || o.removeChild(w), w = void 0, g;
114
- }
115
- var zt = Ge({
116
- id: {
61
+ }, Ir = Fe({
62
+ size: {
117
63
  type: String,
118
- default: void 0
64
+ values: Ee
119
65
  },
120
- size: Ue,
121
- disabled: Boolean,
122
- modelValue: {
123
- type: te([
124
- String,
125
- Number,
126
- Object
127
- ]),
128
- default: ""
66
+ disabled: Boolean
67
+ }), jr = Fe({
68
+ ...Ir,
69
+ model: Object,
70
+ rules: {
71
+ type: ce(Object)
129
72
  },
130
- type: {
73
+ labelPosition: {
131
74
  type: String,
132
- default: "text"
75
+ values: ["left", "right", "top"],
76
+ default: "right"
133
77
  },
134
- resize: {
78
+ requireAsteriskPosition: {
135
79
  type: String,
136
- values: ["none", "both", "horizontal", "vertical"]
80
+ values: ["left", "right"],
81
+ default: "left"
137
82
  },
138
- autosize: {
139
- type: te([Boolean, Object]),
140
- default: !1
83
+ labelWidth: {
84
+ type: [String, Number],
85
+ default: ""
141
86
  },
142
- autocomplete: {
87
+ labelSuffix: {
143
88
  type: String,
144
- default: "off"
89
+ default: ""
145
90
  },
146
- formatter: {
147
- type: Function
91
+ inline: Boolean,
92
+ inlineMessage: Boolean,
93
+ statusIcon: Boolean,
94
+ showMessage: {
95
+ type: Boolean,
96
+ default: !0
148
97
  },
149
- parser: {
150
- type: Function
98
+ validateOnRuleChange: {
99
+ type: Boolean,
100
+ default: !0
151
101
  },
152
- placeholder: {
153
- type: String
102
+ hideRequiredAsterisk: Boolean,
103
+ scrollToError: Boolean,
104
+ scrollIntoViewOptions: {
105
+ type: [Object, Boolean]
106
+ }
107
+ }), Nr = {
108
+ validate: (i, e, r) => (hr(i) || pe(i)) && Be(e) && pe(r)
109
+ }, Rr = [
110
+ "",
111
+ "error",
112
+ "validating",
113
+ "success"
114
+ ], Vr = Fe({
115
+ label: String,
116
+ labelWidth: {
117
+ type: [String, Number],
118
+ default: ""
154
119
  },
155
- form: {
156
- type: String
120
+ prop: {
121
+ type: ce([String, Array])
157
122
  },
158
- readonly: {
123
+ required: {
159
124
  type: Boolean,
160
- default: !1
125
+ default: void 0
161
126
  },
162
- clearable: {
163
- type: Boolean,
164
- default: !1
127
+ rules: {
128
+ type: ce([Object, Array])
165
129
  },
166
- showPassword: {
167
- type: Boolean,
168
- default: !1
130
+ error: String,
131
+ validateStatus: {
132
+ type: String,
133
+ values: Rr
169
134
  },
170
- showWordLimit: {
135
+ for: String,
136
+ inlineMessage: {
137
+ type: [String, Boolean],
138
+ default: ""
139
+ },
140
+ showMessage: {
171
141
  type: Boolean,
172
- default: !1
142
+ default: !0
143
+ },
144
+ size: {
145
+ type: String,
146
+ values: Ee
147
+ }
148
+ });
149
+ function Mr() {
150
+ const i = W([]), e = _(() => {
151
+ if (!i.value.length)
152
+ return "0";
153
+ const o = Math.max(...i.value);
154
+ return o ? `${o}px` : "";
155
+ });
156
+ function r(o) {
157
+ const a = i.value.indexOf(o);
158
+ return a === -1 && e.value, a;
159
+ }
160
+ function n(o, a) {
161
+ if (o && a) {
162
+ const s = r(a);
163
+ i.value.splice(s, 1, o);
164
+ } else
165
+ o && i.value.push(o);
166
+ }
167
+ function t(o) {
168
+ const a = r(o);
169
+ a > -1 && i.value.splice(a, 1);
170
+ }
171
+ return {
172
+ autoLabelWidth: e,
173
+ registerLabelWidth: n,
174
+ deregisterLabelWidth: t
175
+ };
176
+ }
177
+ var re = (i, e) => {
178
+ const r = ve(e);
179
+ return r.length > 0 ? i.filter((n) => n.prop && r.includes(n.prop)) : i;
180
+ }, Wr = "ElForm", Lr = X({
181
+ name: Wr
182
+ }), Tr = /* @__PURE__ */ X({
183
+ ...Lr,
184
+ props: jr,
185
+ emits: Nr,
186
+ setup(i, { expose: e, emit: r }) {
187
+ const n = i, t = [], o = Xe(), a = qe("form"), s = _(() => {
188
+ const { labelPosition: v, inline: l } = n;
189
+ return [
190
+ a.b(),
191
+ a.m(o.value || "default"),
192
+ {
193
+ [a.m(`label-${v}`)]: v,
194
+ [a.m("inline")]: l
195
+ }
196
+ ];
197
+ }), u = (v) => {
198
+ t.push(v);
199
+ }, g = (v) => {
200
+ v.prop && t.splice(t.indexOf(v), 1);
201
+ }, p = (v = []) => {
202
+ n.model && re(t, v).forEach((l) => l.resetField());
203
+ }, y = (v = []) => {
204
+ re(t, v).forEach((l) => l.clearValidate());
205
+ }, w = _(() => !!n.model), O = (v) => {
206
+ if (t.length === 0)
207
+ return [];
208
+ const l = re(t, v);
209
+ return l.length ? l : [];
210
+ }, A = async (v) => b(void 0, v), d = async (v = []) => {
211
+ if (!w.value)
212
+ return !1;
213
+ const l = O(v);
214
+ if (l.length === 0)
215
+ return !0;
216
+ let h = {};
217
+ for (const q of l)
218
+ try {
219
+ await q.validate("");
220
+ } catch (x) {
221
+ h = {
222
+ ...h,
223
+ ...x
224
+ };
225
+ }
226
+ return Object.keys(h).length === 0 ? !0 : Promise.reject(h);
227
+ }, b = async (v = [], l) => {
228
+ const h = !De(l);
229
+ try {
230
+ const q = await d(v);
231
+ return q === !0 && (l == null || l(q)), q;
232
+ } catch (q) {
233
+ if (q instanceof Error)
234
+ throw q;
235
+ const x = q;
236
+ return n.scrollToError && f(Object.keys(x)[0]), l == null || l(!1, x), h && Promise.reject(x);
237
+ }
238
+ }, f = (v) => {
239
+ var l;
240
+ const h = re(t, v)[0];
241
+ h && ((l = h.$el) == null || l.scrollIntoView(n.scrollIntoViewOptions));
242
+ };
243
+ return k(() => n.rules, () => {
244
+ n.validateOnRuleChange && A().catch((v) => fr());
245
+ }, { deep: !0 }), Ue(K, Ke({
246
+ ...Je(n),
247
+ emit: r,
248
+ resetFields: p,
249
+ clearValidate: y,
250
+ validateField: b,
251
+ addField: u,
252
+ removeField: g,
253
+ ...Mr()
254
+ })), e({
255
+ validate: A,
256
+ validateField: b,
257
+ resetFields: p,
258
+ clearValidate: y,
259
+ scrollToField: f
260
+ }), (v, l) => (me(), Ye("form", {
261
+ class: Y(E(s))
262
+ }, [
263
+ ne(v.$slots, "default")
264
+ ], 2));
265
+ }
266
+ }), $r = /* @__PURE__ */ Ce(Tr, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/form/src/form.vue"]]);
267
+ function z() {
268
+ return z = Object.assign ? Object.assign.bind() : function(i) {
269
+ for (var e = 1; e < arguments.length; e++) {
270
+ var r = arguments[e];
271
+ for (var n in r)
272
+ Object.prototype.hasOwnProperty.call(r, n) && (i[n] = r[n]);
273
+ }
274
+ return i;
275
+ }, z.apply(this, arguments);
276
+ }
277
+ function zr(i, e) {
278
+ i.prototype = Object.create(e.prototype), i.prototype.constructor = i, Q(i, e);
279
+ }
280
+ function he(i) {
281
+ return he = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(r) {
282
+ return r.__proto__ || Object.getPrototypeOf(r);
283
+ }, he(i);
284
+ }
285
+ function Q(i, e) {
286
+ return Q = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, t) {
287
+ return n.__proto__ = t, n;
288
+ }, Q(i, e);
289
+ }
290
+ function Br() {
291
+ if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
292
+ return !1;
293
+ if (typeof Proxy == "function")
294
+ return !0;
295
+ try {
296
+ return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
297
+ })), !0;
298
+ } catch {
299
+ return !1;
300
+ }
301
+ }
302
+ function ie(i, e, r) {
303
+ return Br() ? ie = Reflect.construct.bind() : ie = function(t, o, a) {
304
+ var s = [null];
305
+ s.push.apply(s, o);
306
+ var u = Function.bind.apply(t, s), g = new u();
307
+ return a && Q(g, a.prototype), g;
308
+ }, ie.apply(null, arguments);
309
+ }
310
+ function Dr(i) {
311
+ return Function.toString.call(i).indexOf("[native code]") !== -1;
312
+ }
313
+ function ge(i) {
314
+ var e = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
315
+ return ge = function(n) {
316
+ if (n === null || !Dr(n))
317
+ return n;
318
+ if (typeof n != "function")
319
+ throw new TypeError("Super expression must either be null or a function");
320
+ if (typeof e < "u") {
321
+ if (e.has(n))
322
+ return e.get(n);
323
+ e.set(n, t);
324
+ }
325
+ function t() {
326
+ return ie(n, arguments, he(this).constructor);
327
+ }
328
+ return t.prototype = Object.create(n.prototype, {
329
+ constructor: {
330
+ value: t,
331
+ enumerable: !1,
332
+ writable: !0,
333
+ configurable: !0
334
+ }
335
+ }), Q(t, n);
336
+ }, ge(i);
337
+ }
338
+ var Cr = /%[sdj%]/g, Ur = function() {
339
+ };
340
+ typeof process < "u" && process.env;
341
+ function ye(i) {
342
+ if (!i || !i.length)
343
+ return null;
344
+ var e = {};
345
+ return i.forEach(function(r) {
346
+ var n = r.field;
347
+ e[n] = e[n] || [], e[n].push(r);
348
+ }), e;
349
+ }
350
+ function N(i) {
351
+ for (var e = arguments.length, r = new Array(e > 1 ? e - 1 : 0), n = 1; n < e; n++)
352
+ r[n - 1] = arguments[n];
353
+ var t = 0, o = r.length;
354
+ if (typeof i == "function")
355
+ return i.apply(null, r);
356
+ if (typeof i == "string") {
357
+ var a = i.replace(Cr, function(s) {
358
+ if (s === "%%")
359
+ return "%";
360
+ if (t >= o)
361
+ return s;
362
+ switch (s) {
363
+ case "%s":
364
+ return String(r[t++]);
365
+ case "%d":
366
+ return Number(r[t++]);
367
+ case "%j":
368
+ try {
369
+ return JSON.stringify(r[t++]);
370
+ } catch {
371
+ return "[Circular]";
372
+ }
373
+ break;
374
+ default:
375
+ return s;
376
+ }
377
+ });
378
+ return a;
379
+ }
380
+ return i;
381
+ }
382
+ function Kr(i) {
383
+ return i === "string" || i === "url" || i === "hex" || i === "email" || i === "date" || i === "pattern";
384
+ }
385
+ function P(i, e) {
386
+ return !!(i == null || e === "array" && Array.isArray(i) && !i.length || Kr(e) && typeof i == "string" && !i);
387
+ }
388
+ function Jr(i, e, r) {
389
+ var n = [], t = 0, o = i.length;
390
+ function a(s) {
391
+ n.push.apply(n, s || []), t++, t === o && r(n);
392
+ }
393
+ i.forEach(function(s) {
394
+ e(s, a);
395
+ });
396
+ }
397
+ function Me(i, e, r) {
398
+ var n = 0, t = i.length;
399
+ function o(a) {
400
+ if (a && a.length) {
401
+ r(a);
402
+ return;
403
+ }
404
+ var s = n;
405
+ n = n + 1, s < t ? e(i[s], o) : r([]);
406
+ }
407
+ o([]);
408
+ }
409
+ function Yr(i) {
410
+ var e = [];
411
+ return Object.keys(i).forEach(function(r) {
412
+ e.push.apply(e, i[r] || []);
413
+ }), e;
414
+ }
415
+ var We = /* @__PURE__ */ function(i) {
416
+ zr(e, i);
417
+ function e(r, n) {
418
+ var t;
419
+ return t = i.call(this, "Async Validation Error") || this, t.errors = r, t.fields = n, t;
420
+ }
421
+ return e;
422
+ }(/* @__PURE__ */ ge(Error));
423
+ function Zr(i, e, r, n, t) {
424
+ if (e.first) {
425
+ var o = new Promise(function(w, O) {
426
+ var A = function(f) {
427
+ return n(f), f.length ? O(new We(f, ye(f))) : w(t);
428
+ }, d = Yr(i);
429
+ Me(d, r, A);
430
+ });
431
+ return o.catch(function(w) {
432
+ return w;
433
+ }), o;
434
+ }
435
+ var a = e.firstFields === !0 ? Object.keys(i) : e.firstFields || [], s = Object.keys(i), u = s.length, g = 0, p = [], y = new Promise(function(w, O) {
436
+ var A = function(b) {
437
+ if (p.push.apply(p, b), g++, g === u)
438
+ return n(p), p.length ? O(new We(p, ye(p))) : w(t);
439
+ };
440
+ s.length || (n(p), w(t)), s.forEach(function(d) {
441
+ var b = i[d];
442
+ a.indexOf(d) !== -1 ? Me(b, r, A) : Jr(b, r, A);
443
+ });
444
+ });
445
+ return y.catch(function(w) {
446
+ return w;
447
+ }), y;
448
+ }
449
+ function Gr(i) {
450
+ return !!(i && i.message !== void 0);
451
+ }
452
+ function kr(i, e) {
453
+ for (var r = i, n = 0; n < e.length; n++) {
454
+ if (r == null)
455
+ return r;
456
+ r = r[e[n]];
457
+ }
458
+ return r;
459
+ }
460
+ function Le(i, e) {
461
+ return function(r) {
462
+ var n;
463
+ return i.fullFields ? n = kr(e, i.fullFields) : n = e[r.field || i.fullField], Gr(r) ? (r.field = r.field || i.fullField, r.fieldValue = n, r) : {
464
+ message: typeof r == "function" ? r() : r,
465
+ fieldValue: n,
466
+ field: r.field || i.fullField
467
+ };
468
+ };
469
+ }
470
+ function Te(i, e) {
471
+ if (e) {
472
+ for (var r in e)
473
+ if (e.hasOwnProperty(r)) {
474
+ var n = e[r];
475
+ typeof n == "object" && typeof i[r] == "object" ? i[r] = z({}, i[r], n) : i[r] = n;
476
+ }
477
+ }
478
+ return i;
479
+ }
480
+ var er = function(e, r, n, t, o, a) {
481
+ e.required && (!n.hasOwnProperty(e.field) || P(r, a || e.type)) && t.push(N(o.messages.required, e.fullField));
482
+ }, Hr = function(e, r, n, t, o) {
483
+ (/^\s+$/.test(r) || r === "") && t.push(N(o.messages.whitespace, e.fullField));
484
+ }, te, Qr = function() {
485
+ if (te)
486
+ return te;
487
+ var i = "[a-fA-F\\d:]", e = function(h) {
488
+ return h && h.includeBoundaries ? "(?:(?<=\\s|^)(?=" + i + ")|(?<=" + i + ")(?=\\s|$))" : "";
489
+ }, r = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}", n = "[a-fA-F\\d]{1,4}", t = (`
490
+ (?:
491
+ (?:` + n + ":){7}(?:" + n + `|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
492
+ (?:` + n + ":){6}(?:" + r + "|:" + n + `|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
493
+ (?:` + n + ":){5}(?::" + r + "|(?::" + n + `){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
494
+ (?:` + n + ":){4}(?:(?::" + n + "){0,1}:" + r + "|(?::" + n + `){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
495
+ (?:` + n + ":){3}(?:(?::" + n + "){0,2}:" + r + "|(?::" + n + `){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
496
+ (?:` + n + ":){2}(?:(?::" + n + "){0,3}:" + r + "|(?::" + n + `){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
497
+ (?:` + n + ":){1}(?:(?::" + n + "){0,4}:" + r + "|(?::" + n + `){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
498
+ (?::(?:(?::` + n + "){0,5}:" + r + "|(?::" + n + `){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
499
+ )(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
500
+ `).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), o = new RegExp("(?:^" + r + "$)|(?:^" + t + "$)"), a = new RegExp("^" + r + "$"), s = new RegExp("^" + t + "$"), u = function(h) {
501
+ return h && h.exact ? o : new RegExp("(?:" + e(h) + r + e(h) + ")|(?:" + e(h) + t + e(h) + ")", "g");
502
+ };
503
+ u.v4 = function(l) {
504
+ return l && l.exact ? a : new RegExp("" + e(l) + r + e(l), "g");
505
+ }, u.v6 = function(l) {
506
+ return l && l.exact ? s : new RegExp("" + e(l) + t + e(l), "g");
507
+ };
508
+ var g = "(?:(?:[a-z]+:)?//)", p = "(?:\\S+(?::\\S*)?@)?", y = u.v4().source, w = u.v6().source, O = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", A = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", d = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", b = "(?::\\d{2,5})?", f = '(?:[/?#][^\\s"]*)?', v = "(?:" + g + "|www\\.)" + p + "(?:localhost|" + y + "|" + w + "|" + O + A + d + ")" + b + f;
509
+ return te = new RegExp("(?:^" + v + "$)", "i"), te;
510
+ }, $e = {
511
+ // http://emailregex.com/
512
+ email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
513
+ // url: new RegExp(
514
+ // '^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$',
515
+ // 'i',
516
+ // ),
517
+ hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
518
+ }, Z = {
519
+ integer: function(e) {
520
+ return Z.number(e) && parseInt(e, 10) === e;
173
521
  },
174
- suffixIcon: {
175
- type: xe
522
+ float: function(e) {
523
+ return Z.number(e) && !Z.integer(e);
176
524
  },
177
- prefixIcon: {
178
- type: xe
525
+ array: function(e) {
526
+ return Array.isArray(e);
179
527
  },
180
- containerRole: {
181
- type: String,
182
- default: void 0
528
+ regexp: function(e) {
529
+ if (e instanceof RegExp)
530
+ return !0;
531
+ try {
532
+ return !!new RegExp(e);
533
+ } catch {
534
+ return !1;
535
+ }
183
536
  },
184
- label: {
185
- type: String,
186
- default: void 0
537
+ date: function(e) {
538
+ return typeof e.getTime == "function" && typeof e.getMonth == "function" && typeof e.getYear == "function" && !isNaN(e.getTime());
187
539
  },
188
- tabindex: {
189
- type: [String, Number],
190
- default: 0
540
+ number: function(e) {
541
+ return isNaN(e) ? !1 : typeof e == "number";
191
542
  },
192
- validateEvent: {
193
- type: Boolean,
194
- default: !0
543
+ object: function(e) {
544
+ return typeof e == "object" && !Z.array(e);
545
+ },
546
+ method: function(e) {
547
+ return typeof e == "function";
195
548
  },
196
- inputStyle: {
197
- type: te([Object, Array, String]),
198
- default: () => ht({})
199
- }
200
- }), kt = {
201
- [se]: (a) => oe(a),
202
- input: (a) => oe(a),
203
- change: (a) => oe(a),
204
- focus: (a) => a instanceof FocusEvent,
205
- blur: (a) => a instanceof FocusEvent,
206
- clear: () => !0,
207
- mouseleave: (a) => a instanceof MouseEvent,
208
- mouseenter: (a) => a instanceof MouseEvent,
209
- keydown: (a) => a instanceof Event,
210
- compositionstart: (a) => a instanceof CompositionEvent,
211
- compositionupdate: (a) => a instanceof CompositionEvent,
212
- compositionend: (a) => a instanceof CompositionEvent
213
- }, Pt = ["role"], Ft = ["id", "type", "disabled", "formatter", "parser", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form"], Vt = ["id", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form"], Nt = ze({
214
- name: "ElInput",
215
- inheritAttrs: !1
216
- }), Tt = /* @__PURE__ */ ze({
217
- ...Nt,
218
- props: zt,
219
- emits: kt,
220
- setup(a, { expose: f, emit: i }) {
221
- const o = a, l = lt(), r = it(), u = p(() => {
222
- const e = {};
223
- return o.containerRole === "combobox" && (e["aria-haspopup"] = l["aria-haspopup"], e["aria-owns"] = l["aria-owns"], e["aria-expanded"] = l["aria-expanded"]), e;
224
- }), x = p(() => [
225
- o.type === "textarea" ? le.b() : s.b(),
226
- s.m(Pe.value),
227
- s.is("disabled", z.value),
228
- s.is("exceed", Te.value),
229
- {
230
- [s.b("group")]: r.prepend || r.append,
231
- [s.bm("group", "append")]: r.append,
232
- [s.bm("group", "prepend")]: r.prepend,
233
- [s.m("prefix")]: r.prefix || o.prefixIcon,
234
- [s.m("suffix")]: r.suffix || o.suffixIcon || o.clearable || o.showPassword,
235
- [s.bm("suffix", "password-clear")]: K.value && J.value
236
- },
237
- l.class
238
- ]), d = p(() => [
239
- s.e("wrapper"),
240
- s.is("focus", G.value)
241
- ]), g = xt({
242
- excludeKeys: p(() => Object.keys(u.value))
243
- }), { form: v, formItem: c } = De(), { inputId: re } = Ke(o, {
244
- formItemContext: c
245
- }), Pe = je(), z = We(), s = we("input"), le = we("textarea"), L = X(), C = X(), q = N(!1), T = N(!1), O = N(!1), ie = N(), _ = X(o.inputStyle), k = p(() => L.value || C.value), { wrapperRef: Fe, isFocused: G, handleFocus: H, handleBlur: D } = St(k, {
246
- afterBlur() {
247
- var e;
248
- o.validateEvent && ((e = c == null ? void 0 : c.validate) == null || e.call(c, "blur").catch((n) => Se()));
549
+ email: function(e) {
550
+ return typeof e == "string" && e.length <= 320 && !!e.match($e.email);
551
+ },
552
+ url: function(e) {
553
+ return typeof e == "string" && e.length <= 2048 && !!e.match(Qr());
554
+ },
555
+ hex: function(e) {
556
+ return typeof e == "string" && !!e.match($e.hex);
557
+ }
558
+ }, Xr = function(e, r, n, t, o) {
559
+ if (e.required && r === void 0) {
560
+ er(e, r, n, t, o);
561
+ return;
562
+ }
563
+ var a = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], s = e.type;
564
+ a.indexOf(s) > -1 ? Z[s](r) || t.push(N(o.messages.types[s], e.fullField, e.type)) : s && typeof r !== e.type && t.push(N(o.messages.types[s], e.fullField, e.type));
565
+ }, et = function(e, r, n, t, o) {
566
+ var a = typeof e.len == "number", s = typeof e.min == "number", u = typeof e.max == "number", g = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, p = r, y = null, w = typeof r == "number", O = typeof r == "string", A = Array.isArray(r);
567
+ if (w ? y = "number" : O ? y = "string" : A && (y = "array"), !y)
568
+ return !1;
569
+ A && (p = r.length), O && (p = r.replace(g, "_").length), a ? p !== e.len && t.push(N(o.messages[y].len, e.fullField, e.len)) : s && !u && p < e.min ? t.push(N(o.messages[y].min, e.fullField, e.min)) : u && !s && p > e.max ? t.push(N(o.messages[y].max, e.fullField, e.max)) : s && u && (p < e.min || p > e.max) && t.push(N(o.messages[y].range, e.fullField, e.min, e.max));
570
+ }, U = "enum", rt = function(e, r, n, t, o) {
571
+ e[U] = Array.isArray(e[U]) ? e[U] : [], e[U].indexOf(r) === -1 && t.push(N(o.messages[U], e.fullField, e[U].join(", ")));
572
+ }, tt = function(e, r, n, t, o) {
573
+ if (e.pattern) {
574
+ if (e.pattern instanceof RegExp)
575
+ e.pattern.lastIndex = 0, e.pattern.test(r) || t.push(N(o.messages.pattern.mismatch, e.fullField, r, e.pattern));
576
+ else if (typeof e.pattern == "string") {
577
+ var a = new RegExp(e.pattern);
578
+ a.test(r) || t.push(N(o.messages.pattern.mismatch, e.fullField, r, e.pattern));
579
+ }
580
+ }
581
+ }, m = {
582
+ required: er,
583
+ whitespace: Hr,
584
+ type: Xr,
585
+ range: et,
586
+ enum: rt,
587
+ pattern: tt
588
+ }, nt = function(e, r, n, t, o) {
589
+ var a = [], s = e.required || !e.required && t.hasOwnProperty(e.field);
590
+ if (s) {
591
+ if (P(r, "string") && !e.required)
592
+ return n();
593
+ m.required(e, r, t, a, o, "string"), P(r, "string") || (m.type(e, r, t, a, o), m.range(e, r, t, a, o), m.pattern(e, r, t, a, o), e.whitespace === !0 && m.whitespace(e, r, t, a, o));
594
+ }
595
+ n(a);
596
+ }, it = function(e, r, n, t, o) {
597
+ var a = [], s = e.required || !e.required && t.hasOwnProperty(e.field);
598
+ if (s) {
599
+ if (P(r) && !e.required)
600
+ return n();
601
+ m.required(e, r, t, a, o), r !== void 0 && m.type(e, r, t, a, o);
602
+ }
603
+ n(a);
604
+ }, at = function(e, r, n, t, o) {
605
+ var a = [], s = e.required || !e.required && t.hasOwnProperty(e.field);
606
+ if (s) {
607
+ if (r === "" && (r = void 0), P(r) && !e.required)
608
+ return n();
609
+ m.required(e, r, t, a, o), r !== void 0 && (m.type(e, r, t, a, o), m.range(e, r, t, a, o));
610
+ }
611
+ n(a);
612
+ }, ot = function(e, r, n, t, o) {
613
+ var a = [], s = e.required || !e.required && t.hasOwnProperty(e.field);
614
+ if (s) {
615
+ if (P(r) && !e.required)
616
+ return n();
617
+ m.required(e, r, t, a, o), r !== void 0 && m.type(e, r, t, a, o);
618
+ }
619
+ n(a);
620
+ }, st = function(e, r, n, t, o) {
621
+ var a = [], s = e.required || !e.required && t.hasOwnProperty(e.field);
622
+ if (s) {
623
+ if (P(r) && !e.required)
624
+ return n();
625
+ m.required(e, r, t, a, o), P(r) || m.type(e, r, t, a, o);
626
+ }
627
+ n(a);
628
+ }, lt = function(e, r, n, t, o) {
629
+ var a = [], s = e.required || !e.required && t.hasOwnProperty(e.field);
630
+ if (s) {
631
+ if (P(r) && !e.required)
632
+ return n();
633
+ m.required(e, r, t, a, o), r !== void 0 && (m.type(e, r, t, a, o), m.range(e, r, t, a, o));
634
+ }
635
+ n(a);
636
+ }, ft = function(e, r, n, t, o) {
637
+ var a = [], s = e.required || !e.required && t.hasOwnProperty(e.field);
638
+ if (s) {
639
+ if (P(r) && !e.required)
640
+ return n();
641
+ m.required(e, r, t, a, o), r !== void 0 && (m.type(e, r, t, a, o), m.range(e, r, t, a, o));
642
+ }
643
+ n(a);
644
+ }, ut = function(e, r, n, t, o) {
645
+ var a = [], s = e.required || !e.required && t.hasOwnProperty(e.field);
646
+ if (s) {
647
+ if (r == null && !e.required)
648
+ return n();
649
+ m.required(e, r, t, a, o, "array"), r != null && (m.type(e, r, t, a, o), m.range(e, r, t, a, o));
650
+ }
651
+ n(a);
652
+ }, dt = function(e, r, n, t, o) {
653
+ var a = [], s = e.required || !e.required && t.hasOwnProperty(e.field);
654
+ if (s) {
655
+ if (P(r) && !e.required)
656
+ return n();
657
+ m.required(e, r, t, a, o), r !== void 0 && m.type(e, r, t, a, o);
658
+ }
659
+ n(a);
660
+ }, ct = "enum", pt = function(e, r, n, t, o) {
661
+ var a = [], s = e.required || !e.required && t.hasOwnProperty(e.field);
662
+ if (s) {
663
+ if (P(r) && !e.required)
664
+ return n();
665
+ m.required(e, r, t, a, o), r !== void 0 && m[ct](e, r, t, a, o);
666
+ }
667
+ n(a);
668
+ }, vt = function(e, r, n, t, o) {
669
+ var a = [], s = e.required || !e.required && t.hasOwnProperty(e.field);
670
+ if (s) {
671
+ if (P(r, "string") && !e.required)
672
+ return n();
673
+ m.required(e, r, t, a, o), P(r, "string") || m.pattern(e, r, t, a, o);
674
+ }
675
+ n(a);
676
+ }, mt = function(e, r, n, t, o) {
677
+ var a = [], s = e.required || !e.required && t.hasOwnProperty(e.field);
678
+ if (s) {
679
+ if (P(r, "date") && !e.required)
680
+ return n();
681
+ if (m.required(e, r, t, a, o), !P(r, "date")) {
682
+ var u;
683
+ r instanceof Date ? u = r : u = new Date(r), m.type(e, u, t, a, o), u && m.range(e, u.getTime(), t, a, o);
684
+ }
685
+ }
686
+ n(a);
687
+ }, ht = function(e, r, n, t, o) {
688
+ var a = [], s = Array.isArray(r) ? "array" : typeof r;
689
+ m.required(e, r, t, a, o, s), n(a);
690
+ }, de = function(e, r, n, t, o) {
691
+ var a = e.type, s = [], u = e.required || !e.required && t.hasOwnProperty(e.field);
692
+ if (u) {
693
+ if (P(r, a) && !e.required)
694
+ return n();
695
+ m.required(e, r, t, s, o, a), P(r, a) || m.type(e, r, t, s, o);
696
+ }
697
+ n(s);
698
+ }, gt = function(e, r, n, t, o) {
699
+ var a = [], s = e.required || !e.required && t.hasOwnProperty(e.field);
700
+ if (s) {
701
+ if (P(r) && !e.required)
702
+ return n();
703
+ m.required(e, r, t, a, o);
704
+ }
705
+ n(a);
706
+ }, G = {
707
+ string: nt,
708
+ method: it,
709
+ number: at,
710
+ boolean: ot,
711
+ regexp: st,
712
+ integer: lt,
713
+ float: ft,
714
+ array: ut,
715
+ object: dt,
716
+ enum: pt,
717
+ pattern: vt,
718
+ date: mt,
719
+ url: de,
720
+ hex: de,
721
+ email: de,
722
+ required: ht,
723
+ any: gt
724
+ };
725
+ function be() {
726
+ return {
727
+ default: "Validation error on field %s",
728
+ required: "%s is required",
729
+ enum: "%s must be one of %s",
730
+ whitespace: "%s cannot be empty",
731
+ date: {
732
+ format: "%s date %s is invalid for format %s",
733
+ parse: "%s date could not be parsed, %s is invalid ",
734
+ invalid: "%s date %s is invalid"
735
+ },
736
+ types: {
737
+ string: "%s is not a %s",
738
+ method: "%s is not a %s (function)",
739
+ array: "%s is not an %s",
740
+ object: "%s is not an %s",
741
+ number: "%s is not a %s",
742
+ date: "%s is not a %s",
743
+ boolean: "%s is not a %s",
744
+ integer: "%s is not an %s",
745
+ float: "%s is not a %s",
746
+ regexp: "%s is not a valid %s",
747
+ email: "%s is not a valid %s",
748
+ url: "%s is not a valid %s",
749
+ hex: "%s is not a valid %s"
750
+ },
751
+ string: {
752
+ len: "%s must be exactly %s characters",
753
+ min: "%s must be at least %s characters",
754
+ max: "%s cannot be longer than %s characters",
755
+ range: "%s must be between %s and %s characters"
756
+ },
757
+ number: {
758
+ len: "%s must equal %s",
759
+ min: "%s cannot be less than %s",
760
+ max: "%s cannot be greater than %s",
761
+ range: "%s must be between %s and %s"
762
+ },
763
+ array: {
764
+ len: "%s must be exactly %s in length",
765
+ min: "%s cannot be less than %s in length",
766
+ max: "%s cannot be greater than %s in length",
767
+ range: "%s must be between %s and %s in length"
768
+ },
769
+ pattern: {
770
+ mismatch: "%s value %s does not match pattern %s"
771
+ },
772
+ clone: function() {
773
+ var e = JSON.parse(JSON.stringify(this));
774
+ return e.clone = this.clone, e;
775
+ }
776
+ };
777
+ }
778
+ var we = be(), ee = /* @__PURE__ */ function() {
779
+ function i(r) {
780
+ this.rules = null, this._messages = we, this.define(r);
781
+ }
782
+ var e = i.prototype;
783
+ return e.define = function(n) {
784
+ var t = this;
785
+ if (!n)
786
+ throw new Error("Cannot configure a schema with no rules");
787
+ if (typeof n != "object" || Array.isArray(n))
788
+ throw new Error("Rules must be an object");
789
+ this.rules = {}, Object.keys(n).forEach(function(o) {
790
+ var a = n[o];
791
+ t.rules[o] = Array.isArray(a) ? a : [a];
792
+ });
793
+ }, e.messages = function(n) {
794
+ return n && (this._messages = Te(be(), n)), this._messages;
795
+ }, e.validate = function(n, t, o) {
796
+ var a = this;
797
+ t === void 0 && (t = {}), o === void 0 && (o = function() {
798
+ });
799
+ var s = n, u = t, g = o;
800
+ if (typeof u == "function" && (g = u, u = {}), !this.rules || Object.keys(this.rules).length === 0)
801
+ return g && g(null, s), Promise.resolve(s);
802
+ function p(d) {
803
+ var b = [], f = {};
804
+ function v(h) {
805
+ if (Array.isArray(h)) {
806
+ var q;
807
+ b = (q = b).concat.apply(q, h);
808
+ } else
809
+ b.push(h);
249
810
  }
250
- }), ue = p(() => {
251
- var e;
252
- return (e = v == null ? void 0 : v.statusIcon) != null ? e : !1;
253
- }), R = p(() => (c == null ? void 0 : c.validateState) || ""), de = p(() => R.value && Ye[R.value]), Ve = p(() => O.value ? Xe : Ze), Ne = p(() => [
254
- l.style,
255
- o.inputStyle
256
- ]), ce = p(() => [
257
- o.inputStyle,
258
- _.value,
259
- { resize: o.resize }
260
- ]), E = p(() => Je(o.modelValue) ? "" : String(o.modelValue)), K = p(() => o.clearable && !z.value && !o.readonly && !!E.value && (G.value || q.value)), J = p(() => o.showPassword && !z.value && !o.readonly && !!E.value && (!!E.value || G.value)), P = p(() => o.showWordLimit && !!g.value.maxlength && (o.type === "text" || o.type === "textarea") && !z.value && !o.readonly && !o.showPassword), Q = p(() => E.value.length), Te = p(() => !!P.value && Q.value > Number(g.value.maxlength)), Re = p(() => !!r.suffix || !!o.suffixIcon || K.value || o.showPassword || P.value || !!R.value && ue.value), [$e, Me] = wt(L);
261
- Qe(C, (e) => {
262
- if (Ae(), !P.value || o.resize !== "both")
263
- return;
264
- const n = e[0], { width: h } = n.contentRect;
265
- ie.value = {
266
- right: `calc(100% - ${h + 15 + 6}px)`
267
- };
811
+ for (var l = 0; l < d.length; l++)
812
+ v(d[l]);
813
+ b.length ? (f = ye(b), g(b, f)) : g(null, s);
814
+ }
815
+ if (u.messages) {
816
+ var y = this.messages();
817
+ y === we && (y = be()), Te(y, u.messages), u.messages = y;
818
+ } else
819
+ u.messages = this.messages();
820
+ var w = {}, O = u.keys || Object.keys(this.rules);
821
+ O.forEach(function(d) {
822
+ var b = a.rules[d], f = s[d];
823
+ b.forEach(function(v) {
824
+ var l = v;
825
+ typeof l.transform == "function" && (s === n && (s = z({}, s)), f = s[d] = l.transform(f)), typeof l == "function" ? l = {
826
+ validator: l
827
+ } : l = z({}, l), l.validator = a.getValidationMethod(l), l.validator && (l.field = d, l.fullField = l.fullField || d, l.type = a.getType(l), w[d] = w[d] || [], w[d].push({
828
+ rule: l,
829
+ value: f,
830
+ source: s,
831
+ field: d
832
+ }));
833
+ });
268
834
  });
269
- const $ = () => {
270
- const { type: e, autosize: n } = o;
271
- if (!(!nt || e !== "textarea" || !C.value))
272
- if (n) {
273
- const h = Ce(n) ? n.minRows : void 0, j = Ce(n) ? n.maxRows : void 0, ge = Ee(C.value, h, j);
274
- _.value = {
275
- overflowY: "hidden",
276
- ...ge
277
- }, F(() => {
278
- C.value.offsetHeight, _.value = ge;
835
+ var A = {};
836
+ return Zr(w, u, function(d, b) {
837
+ var f = d.rule, v = (f.type === "object" || f.type === "array") && (typeof f.fields == "object" || typeof f.defaultField == "object");
838
+ v = v && (f.required || !f.required && d.value), f.field = d.field;
839
+ function l(x, V) {
840
+ return z({}, V, {
841
+ fullField: f.fullField + "." + x,
842
+ fullFields: f.fullFields ? [].concat(f.fullFields, [x]) : [x]
843
+ });
844
+ }
845
+ function h(x) {
846
+ x === void 0 && (x = []);
847
+ var V = Array.isArray(x) ? x : [x];
848
+ !u.suppressWarning && V.length && i.warning("async-validator:", V), V.length && f.message !== void 0 && (V = [].concat(f.message));
849
+ var j = V.map(Le(f, s));
850
+ if (u.first && j.length)
851
+ return A[f.field] = 1, b(j);
852
+ if (!v)
853
+ b(j);
854
+ else {
855
+ if (f.required && !d.value)
856
+ return f.message !== void 0 ? j = [].concat(f.message).map(Le(f, s)) : u.error && (j = [u.error(f, N(u.messages.required, f.field))]), b(j);
857
+ var $ = {};
858
+ f.defaultField && Object.keys(d.value).map(function(M) {
859
+ $[M] = f.defaultField;
860
+ }), $ = z({}, $, d.rule.fields);
861
+ var J = {};
862
+ Object.keys($).forEach(function(M) {
863
+ var R = $[M], oe = Array.isArray(R) ? R : [R];
864
+ J[M] = oe.map(l.bind(null, M));
865
+ });
866
+ var B = new i(J);
867
+ B.messages(u.messages), d.rule.options && (d.rule.options.messages = u.messages, d.rule.options.error = u.error), B.validate(d.value, d.rule.options || u, function(M) {
868
+ var R = [];
869
+ j && j.length && R.push.apply(R, j), M && M.length && R.push.apply(R, M), b(R.length ? R : null);
279
870
  });
280
- } else
281
- _.value = {
282
- minHeight: Ee(C.value).minHeight
283
- };
284
- }, Ae = ((e) => {
285
- let n = !1;
286
- return () => {
287
- var h;
288
- if (n || !o.autosize)
289
- return;
290
- ((h = C.value) == null ? void 0 : h.offsetParent) === null || (e(), n = !0);
291
- };
292
- })($), M = () => {
293
- const e = k.value, n = o.formatter ? o.formatter(E.value) : E.value;
294
- !e || e.value === n || (e.value = n);
295
- }, ee = async (e) => {
296
- $e();
297
- let { value: n } = e.target;
298
- if (o.formatter && (n = o.parser ? o.parser(n) : n), !T.value) {
299
- if (n === E.value) {
300
- M();
301
- return;
302
871
  }
303
- i(se, n), i("input", n), await F(), M(), Me();
304
872
  }
305
- }, pe = (e) => {
306
- i("change", e.target.value);
307
- }, fe = (e) => {
308
- i("compositionstart", e), T.value = !0;
309
- }, ve = (e) => {
310
- var n;
311
- i("compositionupdate", e);
312
- const h = (n = e.target) == null ? void 0 : n.value, j = h[h.length - 1] || "";
313
- T.value = !yt(j);
314
- }, me = (e) => {
315
- i("compositionend", e), T.value && (T.value = !1, ee(e));
316
- }, Be = () => {
317
- O.value = !O.value, ye();
318
- }, ye = async () => {
319
- var e;
320
- await F(), (e = k.value) == null || e.focus();
321
- }, Le = () => {
322
- var e;
323
- return (e = k.value) == null ? void 0 : e.blur();
324
- }, Oe = (e) => {
325
- q.value = !1, i("mouseleave", e);
326
- }, _e = (e) => {
327
- q.value = !0, i("mouseenter", e);
328
- }, he = (e) => {
329
- i("keydown", e);
330
- }, He = () => {
331
- var e;
332
- (e = k.value) == null || e.select();
333
- }, be = () => {
334
- i(se, ""), i("change", ""), i("clear"), i("input", "");
873
+ var q;
874
+ if (f.asyncValidator)
875
+ q = f.asyncValidator(f, d.value, h, d.source, u);
876
+ else if (f.validator) {
877
+ try {
878
+ q = f.validator(f, d.value, h, d.source, u);
879
+ } catch (x) {
880
+ console.error == null || console.error(x), u.suppressValidatorError || setTimeout(function() {
881
+ throw x;
882
+ }, 0), h(x.message);
883
+ }
884
+ q === !0 ? h() : q === !1 ? h(typeof f.message == "function" ? f.message(f.fullField || f.field) : f.message || (f.fullField || f.field) + " fails") : q instanceof Array ? h(q) : q instanceof Error && h(q.message);
885
+ }
886
+ q && q.then && q.then(function() {
887
+ return h();
888
+ }, function(x) {
889
+ return h(x);
890
+ });
891
+ }, function(d) {
892
+ p(d);
893
+ }, s);
894
+ }, e.getType = function(n) {
895
+ if (n.type === void 0 && n.pattern instanceof RegExp && (n.type = "pattern"), typeof n.validator != "function" && n.type && !G.hasOwnProperty(n.type))
896
+ throw new Error(N("Unknown rule type %s", n.type));
897
+ return n.type || "string";
898
+ }, e.getValidationMethod = function(n) {
899
+ if (typeof n.validator == "function")
900
+ return n.validator;
901
+ var t = Object.keys(n), o = t.indexOf("message");
902
+ return o !== -1 && t.splice(o, 1), t.length === 1 && t[0] === "required" ? G.required : G[this.getType(n)] || void 0;
903
+ }, i;
904
+ }();
905
+ ee.register = function(e, r) {
906
+ if (typeof r != "function")
907
+ throw new Error("Cannot register a validator by type, validator is not a function");
908
+ G[e] = r;
909
+ };
910
+ ee.warning = Ur;
911
+ ee.messages = we;
912
+ ee.validators = G;
913
+ var ze = "ElLabelWrap", yt = X({
914
+ name: ze,
915
+ props: {
916
+ isAutoWidth: Boolean,
917
+ updateAll: Boolean
918
+ },
919
+ setup(i, {
920
+ slots: e
921
+ }) {
922
+ const r = L(K, void 0), n = L(H);
923
+ n || ur(ze, "usage: <el-form-item><label-wrap /></el-form-item>");
924
+ const t = qe("form"), o = W(), a = W(0), s = () => {
925
+ var p;
926
+ if ((p = o.value) != null && p.firstElementChild) {
927
+ const y = window.getComputedStyle(o.value.firstElementChild).width;
928
+ return Math.ceil(Number.parseFloat(y));
929
+ } else
930
+ return 0;
931
+ }, u = (p = "update") => {
932
+ Ge(() => {
933
+ e.default && i.isAutoWidth && (p === "update" ? a.value = s() : p === "remove" && (r == null || r.deregisterLabelWidth(a.value)));
934
+ });
935
+ }, g = () => u("update");
936
+ return xe(() => {
937
+ g();
938
+ }), Ze(() => {
939
+ u("remove");
940
+ }), gr(() => g()), k(a, (p, y) => {
941
+ i.updateAll && (r == null || r.registerLabelWidth(p, y));
942
+ }), dr(_(() => {
943
+ var p, y;
944
+ return (y = (p = o.value) == null ? void 0 : p.firstElementChild) != null ? y : null;
945
+ }), g), () => {
946
+ var p, y;
947
+ if (!e)
948
+ return null;
949
+ const {
950
+ isAutoWidth: w
951
+ } = i;
952
+ if (w) {
953
+ const O = r == null ? void 0 : r.autoLabelWidth, A = n == null ? void 0 : n.hasLabel, d = {};
954
+ if (A && O && O !== "auto") {
955
+ const b = Math.max(0, Number.parseInt(O, 10) - a.value), f = r.labelPosition === "left" ? "marginRight" : "marginLeft";
956
+ b && (d[f] = `${b}px`);
957
+ }
958
+ return ae("div", {
959
+ ref: o,
960
+ class: [t.be("item", "label-wrap")],
961
+ style: d
962
+ }, [(p = e.default) == null ? void 0 : p.call(e)]);
963
+ } else
964
+ return ae(yr, {
965
+ ref: o
966
+ }, [(y = e.default) == null ? void 0 : y.call(e)]);
335
967
  };
336
- return Z(() => o.modelValue, () => {
337
- var e;
338
- F(() => $()), o.validateEvent && ((e = c == null ? void 0 : c.validate) == null || e.call(c, "change").catch((n) => Se()));
339
- }), Z(E, () => M()), Z(() => o.type, async () => {
340
- await F(), M(), $();
341
- }), ut(() => {
342
- !o.formatter && o.parser, M(), F($);
343
- }), f({
344
- input: L,
345
- textarea: C,
346
- ref: k,
347
- textareaStyle: ce,
348
- autosize: dt(o, "autosize"),
349
- focus: ye,
350
- blur: Le,
351
- select: He,
352
- clear: be,
353
- resizeTextarea: $
354
- }), (e, n) => ct((m(), S("div", ae(t(u), {
355
- class: t(x),
356
- style: t(Ne),
357
- role: e.containerRole,
358
- onMouseenter: _e,
359
- onMouseleave: Oe
360
- }), [
361
- y(" input "),
362
- e.type !== "textarea" ? (m(), S(ne, { key: 0 }, [
363
- y(" prepend slot "),
364
- e.$slots.prepend ? (m(), S("div", {
365
- key: 0,
366
- class: b(t(s).be("group", "prepend"))
367
- }, [
368
- W(e.$slots, "prepend")
369
- ], 2)) : y("v-if", !0),
370
- V("div", {
371
- ref_key: "wrapperRef",
372
- ref: Fe,
373
- class: b(t(d))
374
- }, [
375
- y(" prefix slot "),
376
- e.$slots.prefix || e.prefixIcon ? (m(), S("span", {
377
- key: 0,
378
- class: b(t(s).e("prefix"))
379
- }, [
380
- V("span", {
381
- class: b(t(s).e("prefix-inner"))
382
- }, [
383
- W(e.$slots, "prefix"),
384
- e.prefixIcon ? (m(), I(t(A), {
385
- key: 0,
386
- class: b(t(s).e("icon"))
387
- }, {
388
- default: B(() => [
389
- (m(), I(U(e.prefixIcon)))
390
- ]),
391
- _: 1
392
- }, 8, ["class"])) : y("v-if", !0)
393
- ], 2)
394
- ], 2)) : y("v-if", !0),
395
- V("input", ae({
396
- id: t(re),
397
- ref_key: "input",
398
- ref: L,
399
- class: t(s).e("inner")
400
- }, t(g), {
401
- type: e.showPassword ? O.value ? "text" : "password" : e.type,
402
- disabled: t(z),
403
- formatter: e.formatter,
404
- parser: e.parser,
405
- readonly: e.readonly,
406
- autocomplete: e.autocomplete,
407
- tabindex: e.tabindex,
408
- "aria-label": e.label,
409
- placeholder: e.placeholder,
410
- style: e.inputStyle,
411
- form: o.form,
412
- onCompositionstart: fe,
413
- onCompositionupdate: ve,
414
- onCompositionend: me,
415
- onInput: ee,
416
- onFocus: n[0] || (n[0] = (...h) => t(H) && t(H)(...h)),
417
- onBlur: n[1] || (n[1] = (...h) => t(D) && t(D)(...h)),
418
- onChange: pe,
419
- onKeydown: he
420
- }), null, 16, Ft),
421
- y(" suffix slot "),
422
- t(Re) ? (m(), S("span", {
423
- key: 1,
424
- class: b(t(s).e("suffix"))
425
- }, [
426
- V("span", {
427
- class: b(t(s).e("suffix-inner"))
428
- }, [
429
- !t(K) || !t(J) || !t(P) ? (m(), S(ne, { key: 0 }, [
430
- W(e.$slots, "suffix"),
431
- e.suffixIcon ? (m(), I(t(A), {
432
- key: 0,
433
- class: b(t(s).e("icon"))
434
- }, {
435
- default: B(() => [
436
- (m(), I(U(e.suffixIcon)))
437
- ]),
438
- _: 1
439
- }, 8, ["class"])) : y("v-if", !0)
440
- ], 64)) : y("v-if", !0),
441
- t(K) ? (m(), I(t(A), {
442
- key: 1,
443
- class: b([t(s).e("icon"), t(s).e("clear")]),
444
- onMousedown: pt(t(et), ["prevent"]),
445
- onClick: be
446
- }, {
447
- default: B(() => [
448
- ft(t(qe))
449
- ]),
450
- _: 1
451
- }, 8, ["class", "onMousedown"])) : y("v-if", !0),
452
- t(J) ? (m(), I(t(A), {
453
- key: 2,
454
- class: b([t(s).e("icon"), t(s).e("password")]),
455
- onClick: Be
456
- }, {
457
- default: B(() => [
458
- (m(), I(U(t(Ve))))
459
- ]),
460
- _: 1
461
- }, 8, ["class"])) : y("v-if", !0),
462
- t(P) ? (m(), S("span", {
463
- key: 3,
464
- class: b(t(s).e("count"))
465
- }, [
466
- V("span", {
467
- class: b(t(s).e("count-inner"))
468
- }, Y(t(Q)) + " / " + Y(t(g).maxlength), 3)
469
- ], 2)) : y("v-if", !0),
470
- t(R) && t(de) && t(ue) ? (m(), I(t(A), {
471
- key: 4,
472
- class: b([
473
- t(s).e("icon"),
474
- t(s).e("validateIcon"),
475
- t(s).is("loading", t(R) === "validating")
968
+ }
969
+ }), bt = ["role", "aria-labelledby"], wt = X({
970
+ name: "ElFormItem"
971
+ }), Ft = /* @__PURE__ */ X({
972
+ ...wt,
973
+ props: Vr,
974
+ setup(i, { expose: e }) {
975
+ const r = i, n = br(), t = L(K, void 0), o = L(H, void 0), a = Xe(void 0, { formItem: !1 }), s = qe("form-item"), u = Qe().value, g = W([]), p = W(""), y = cr(p, 100), w = W(""), O = W();
976
+ let A, d = !1;
977
+ const b = _(() => {
978
+ if ((t == null ? void 0 : t.labelPosition) === "top")
979
+ return {};
980
+ const c = Pe(r.labelWidth || (t == null ? void 0 : t.labelWidth) || "");
981
+ return c ? { width: c } : {};
982
+ }), f = _(() => {
983
+ if ((t == null ? void 0 : t.labelPosition) === "top" || t != null && t.inline)
984
+ return {};
985
+ if (!r.label && !r.labelWidth && $)
986
+ return {};
987
+ const c = Pe(r.labelWidth || (t == null ? void 0 : t.labelWidth) || "");
988
+ return !r.label && !n.label ? { marginLeft: c } : {};
989
+ }), v = _(() => [
990
+ s.b(),
991
+ s.m(a.value),
992
+ s.is("error", p.value === "error"),
993
+ s.is("validating", p.value === "validating"),
994
+ s.is("success", p.value === "success"),
995
+ s.is("required", oe.value || r.required),
996
+ s.is("no-asterisk", t == null ? void 0 : t.hideRequiredAsterisk),
997
+ (t == null ? void 0 : t.requireAsteriskPosition) === "right" ? "asterisk-right" : "asterisk-left",
998
+ { [s.m("feedback")]: t == null ? void 0 : t.statusIcon }
999
+ ]), l = _(() => Be(r.inlineMessage) ? r.inlineMessage : (t == null ? void 0 : t.inlineMessage) || !1), h = _(() => [
1000
+ s.e("error"),
1001
+ { [s.em("error", "inline")]: l.value }
1002
+ ]), q = _(() => r.prop ? pe(r.prop) ? r.prop : r.prop.join(".") : ""), x = _(() => !!(r.label || n.label)), V = _(() => r.for || g.value.length === 1 ? g.value[0] : void 0), j = _(() => !V.value && x.value), $ = !!o, J = _(() => {
1003
+ const c = t == null ? void 0 : t.model;
1004
+ if (!(!c || !r.prop))
1005
+ return fe(c, r.prop).value;
1006
+ }), B = _(() => {
1007
+ const { required: c } = r, F = [];
1008
+ r.rules && F.push(...ve(r.rules));
1009
+ const I = t == null ? void 0 : t.rules;
1010
+ if (I && r.prop) {
1011
+ const S = fe(I, r.prop).value;
1012
+ S && F.push(...ve(S));
1013
+ }
1014
+ if (c !== void 0) {
1015
+ const S = F.map((T, C) => [T, C]).filter(([T]) => Object.keys(T).includes("required"));
1016
+ if (S.length > 0)
1017
+ for (const [T, C] of S)
1018
+ T.required !== c && (F[C] = { ...T, required: c });
1019
+ else
1020
+ F.push({ required: c });
1021
+ }
1022
+ return F;
1023
+ }), M = _(() => B.value.length > 0), R = (c) => B.value.filter((I) => !I.trigger || !c ? !0 : Array.isArray(I.trigger) ? I.trigger.includes(c) : I.trigger === c).map(({ trigger: I, ...S }) => S), oe = _(() => B.value.some((c) => c.required)), tr = _(() => {
1024
+ var c;
1025
+ return y.value === "error" && r.showMessage && ((c = t == null ? void 0 : t.showMessage) != null ? c : !0);
1026
+ }), _e = _(() => `${r.label || ""}${(t == null ? void 0 : t.labelSuffix) || ""}`), D = (c) => {
1027
+ p.value = c;
1028
+ }, nr = (c) => {
1029
+ var F, I;
1030
+ const { errors: S, fields: T } = c;
1031
+ (!S || !T) && console.error(c), D("error"), w.value = S ? (I = (F = S == null ? void 0 : S[0]) == null ? void 0 : F.message) != null ? I : `${r.prop} is required` : "", t == null || t.emit("validate", r.prop, !1, w.value);
1032
+ }, ir = () => {
1033
+ D("success"), t == null || t.emit("validate", r.prop, !0, "");
1034
+ }, ar = async (c) => {
1035
+ const F = q.value;
1036
+ return new ee({
1037
+ [F]: c
1038
+ }).validate({ [F]: J.value }, { firstFields: !0 }).then(() => (ir(), !0)).catch((S) => (nr(S), Promise.reject(S)));
1039
+ }, Oe = async (c, F) => {
1040
+ if (d || !r.prop)
1041
+ return !1;
1042
+ const I = De(F);
1043
+ if (!M.value)
1044
+ return F == null || F(!1), !1;
1045
+ const S = R(c);
1046
+ return S.length === 0 ? (F == null || F(!0), !0) : (D("validating"), ar(S).then(() => (F == null || F(!0), !0)).catch((T) => {
1047
+ const { fields: C } = T;
1048
+ return F == null || F(!1, C), I ? !1 : Promise.reject(C);
1049
+ }));
1050
+ }, se = () => {
1051
+ D(""), w.value = "", d = !1;
1052
+ }, Ae = async () => {
1053
+ const c = t == null ? void 0 : t.model;
1054
+ if (!c || !r.prop)
1055
+ return;
1056
+ const F = fe(c, r.prop);
1057
+ d = !0, F.value = Se(A), await Ge(), se(), d = !1;
1058
+ }, or = (c) => {
1059
+ g.value.includes(c) || g.value.push(c);
1060
+ }, sr = (c) => {
1061
+ g.value = g.value.filter((F) => F !== c);
1062
+ };
1063
+ k(() => r.error, (c) => {
1064
+ w.value = c || "", D(c ? "error" : "");
1065
+ }, { immediate: !0 }), k(() => r.validateStatus, (c) => D(c || ""));
1066
+ const le = Ke({
1067
+ ...Je(r),
1068
+ $el: O,
1069
+ size: a,
1070
+ validateState: p,
1071
+ labelId: u,
1072
+ inputIds: g,
1073
+ isGroup: j,
1074
+ hasLabel: x,
1075
+ addInputId: or,
1076
+ removeInputId: sr,
1077
+ resetField: Ae,
1078
+ clearValidate: se,
1079
+ validate: Oe
1080
+ });
1081
+ return Ue(H, le), xe(() => {
1082
+ r.prop && (t == null || t.addField(le), A = Se(J.value));
1083
+ }), Ze(() => {
1084
+ t == null || t.removeField(le);
1085
+ }), e({
1086
+ size: a,
1087
+ validateMessage: w,
1088
+ validateState: p,
1089
+ validate: Oe,
1090
+ clearValidate: se,
1091
+ resetField: Ae
1092
+ }), (c, F) => {
1093
+ var I;
1094
+ return me(), Ye("div", {
1095
+ ref_key: "formItemRef",
1096
+ ref: O,
1097
+ class: Y(E(v)),
1098
+ role: E(j) ? "group" : void 0,
1099
+ "aria-labelledby": E(j) ? E(u) : void 0
1100
+ }, [
1101
+ ae(E(yt), {
1102
+ "is-auto-width": E(b).width === "auto",
1103
+ "update-all": ((I = E(t)) == null ? void 0 : I.labelWidth) === "auto"
1104
+ }, {
1105
+ default: ue(() => [
1106
+ E(x) ? (me(), wr(Fr(E(V) ? "label" : "div"), {
1107
+ key: 0,
1108
+ id: E(u),
1109
+ for: E(V),
1110
+ class: Y(E(s).e("label")),
1111
+ style: Ie(E(b))
1112
+ }, {
1113
+ default: ue(() => [
1114
+ ne(c.$slots, "label", { label: E(_e) }, () => [
1115
+ qr(je(E(_e)), 1)
476
1116
  ])
477
- }, {
478
- default: B(() => [
479
- (m(), I(U(t(de))))
480
- ]),
481
- _: 1
482
- }, 8, ["class"])) : y("v-if", !0)
483
- ], 2)
484
- ], 2)) : y("v-if", !0)
485
- ], 2),
486
- y(" append slot "),
487
- e.$slots.append ? (m(), S("div", {
488
- key: 1,
489
- class: b(t(s).be("group", "append"))
1117
+ ]),
1118
+ _: 3
1119
+ }, 8, ["id", "for", "class", "style"])) : Ne("v-if", !0)
1120
+ ]),
1121
+ _: 3
1122
+ }, 8, ["is-auto-width", "update-all"]),
1123
+ Re("div", {
1124
+ class: Y(E(s).e("content")),
1125
+ style: Ie(E(f))
490
1126
  }, [
491
- W(e.$slots, "append")
492
- ], 2)) : y("v-if", !0)
493
- ], 64)) : (m(), S(ne, { key: 1 }, [
494
- y(" textarea "),
495
- V("textarea", ae({
496
- id: t(re),
497
- ref_key: "textarea",
498
- ref: C,
499
- class: t(le).e("inner")
500
- }, t(g), {
501
- tabindex: e.tabindex,
502
- disabled: t(z),
503
- readonly: e.readonly,
504
- autocomplete: e.autocomplete,
505
- style: t(ce),
506
- "aria-label": e.label,
507
- placeholder: e.placeholder,
508
- form: o.form,
509
- onCompositionstart: fe,
510
- onCompositionupdate: ve,
511
- onCompositionend: me,
512
- onInput: ee,
513
- onFocus: n[2] || (n[2] = (...h) => t(H) && t(H)(...h)),
514
- onBlur: n[3] || (n[3] = (...h) => t(D) && t(D)(...h)),
515
- onChange: pe,
516
- onKeydown: he
517
- }), null, 16, Vt),
518
- t(P) ? (m(), S("span", {
519
- key: 0,
520
- style: vt(ie.value),
521
- class: b(t(s).e("count"))
522
- }, Y(t(Q)) + " / " + Y(t(g).maxlength), 7)) : y("v-if", !0)
523
- ], 64))
524
- ], 16, Pt)), [
525
- [mt, e.type !== "hidden"]
526
- ]);
527
- }
528
- }), Rt = /* @__PURE__ */ st(Tt, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/input/src/input.vue"]]), Ot = tt(Rt);
1127
+ ne(c.$slots, "default"),
1128
+ ae(xr, {
1129
+ name: `${E(s).namespace.value}-zoom-in-top`
1130
+ }, {
1131
+ default: ue(() => [
1132
+ E(tr) ? ne(c.$slots, "error", {
1133
+ key: 0,
1134
+ error: w.value
1135
+ }, () => [
1136
+ Re("div", {
1137
+ class: Y(E(h))
1138
+ }, je(w.value), 3)
1139
+ ]) : Ne("v-if", !0)
1140
+ ]),
1141
+ _: 3
1142
+ }, 8, ["name"])
1143
+ ], 6)
1144
+ ], 10, bt);
1145
+ };
1146
+ }
1147
+ }), rr = /* @__PURE__ */ Ce(Ft, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/form/src/form-item.vue"]]);
1148
+ pr($r, {
1149
+ FormItem: rr
1150
+ });
1151
+ vr(rr);
529
1152
  export {
530
- Ot as ElInput,
531
- kt as inputEmits,
532
- zt as inputProps,
533
- yt as isKorean,
534
- ht as mutable,
535
- xt as useAttrs,
536
- wt as useCursor,
537
- St as useFocusController
1153
+ _t as CHANGE_EVENT,
1154
+ Or as ID_INJECTION_KEY,
1155
+ Ot as INPUT_EVENT,
1156
+ Pr as SIZE_INJECTION_KEY,
1157
+ Et as UPDATE_MODEL_EVENT,
1158
+ At as componentSizeMap,
1159
+ Ee as componentSizes,
1160
+ K as formContextKey,
1161
+ Nr as formEmits,
1162
+ H as formItemContextKey,
1163
+ Vr as formItemProps,
1164
+ Rr as formItemValidateStates,
1165
+ jr as formProps,
1166
+ St as useFormDisabled,
1167
+ It as useFormItem,
1168
+ jt as useFormItemInputId,
1169
+ Xe as useFormSize,
1170
+ Sr as useGlobalSize,
1171
+ Qe as useId,
1172
+ Ar as useIdInjection,
1173
+ He as useProp,
1174
+ Pt as useSizeProp
538
1175
  };