react-artasys-ui 0.1.31 → 0.1.32
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.
- package/LICENSE +20 -20
- package/README.md +6 -6
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Checkbox/Checkbox.d.ts +2 -2
- package/dist/Components/Arrow/Arrow.d.ts +1 -1
- package/dist/Dropdown/Dropdown.d.ts +2 -2
- package/dist/Dropdown/Item.d.ts +1 -1
- package/dist/Dropdown/Items.d.ts +1 -1
- package/dist/File/File.d.ts +1 -1
- package/dist/FileInput/FileInput.d.ts +3 -3
- package/dist/Form/Element/Element.d.ts +2 -2
- package/dist/Form/Element/index.d.ts +2 -2
- package/dist/Form/Form.d.ts +1 -1
- package/dist/Input/Input.d.ts +3 -3
- package/dist/Loading/Loading.d.ts +1 -1
- package/dist/Progress/Progress.d.ts +1 -1
- package/dist/Provider/Provider.d.ts +1 -1
- package/dist/Select/Optgroup.d.ts +1 -1
- package/dist/Select/Option.d.ts +1 -1
- package/dist/Select/Select.d.ts +2 -2
- package/dist/Spinner/Spinner.d.ts +1 -1
- package/dist/TextArea/TextArea.d.ts +2 -2
- package/dist/UploadImages/Image.d.ts +1 -1
- package/dist/UploadImages/UploadImages.d.ts +1 -1
- package/dist/helpers.d.ts +3 -0
- package/dist/index.cjs.js +9 -9
- package/dist/index.d.ts +2 -2
- package/dist/index.es.js +947 -667
- package/dist/styles.css +1 -1
- package/package.json +89 -84
package/dist/index.es.js
CHANGED
|
@@ -47,46 +47,34 @@ var m = {
|
|
|
47
47
|
}) : /* @__PURE__ */ t(g, {})
|
|
48
48
|
})]
|
|
49
49
|
});
|
|
50
|
-
}, b = (e) => e.type === "checkbox", x = (e) => e instanceof Date, S = (e) => e == null, C = (e) => typeof e == "object", w = (e) => !S(e) && !Array.isArray(e) && C(e) && !x(e),
|
|
50
|
+
}, b = (e) => e.type === "checkbox", x = (e) => e instanceof Date, S = (e) => e == null, C = (e) => typeof e == "object", w = (e) => !S(e) && !Array.isArray(e) && C(e) && !x(e), ee = (e) => w(e) && e.target ? b(e.target) ? e.target.checked : e.target.value : e, T = (e, t) => t.split(".").some((t, n, r) => !isNaN(Number(t)) && e.has(r.slice(0, n).join("."))), E = (e) => {
|
|
51
51
|
let t = e.constructor && e.constructor.prototype;
|
|
52
52
|
return w(t) && t.hasOwnProperty("isPrototypeOf");
|
|
53
|
-
},
|
|
54
|
-
function
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
}, D = typeof window < "u" && window.HTMLElement !== void 0 && typeof document < "u";
|
|
54
|
+
function O(e) {
|
|
55
|
+
if (e instanceof Date) return new Date(e);
|
|
56
|
+
let t = typeof FileList < "u" && e instanceof FileList;
|
|
57
|
+
if (D && (e instanceof Blob || t)) return e;
|
|
58
|
+
let n = Array.isArray(e);
|
|
59
|
+
if (!n && !(w(e) && E(e))) return e;
|
|
60
|
+
let r = n ? [] : Object.create(Object.getPrototypeOf(e));
|
|
61
|
+
for (let t in e) Object.prototype.hasOwnProperty.call(e, t) && (r[t] = O(e[t]));
|
|
62
|
+
return r;
|
|
62
63
|
}
|
|
63
|
-
var
|
|
64
|
-
if (!t || !w(e)) return n;
|
|
65
|
-
let r = te(t.split(/[,[\].]+?/)).reduce((e, t) => S(e) ? e : e[t], e);
|
|
66
|
-
return A(r) || r === e ? A(e[t]) ? n : e[t] : r;
|
|
67
|
-
}, M = (e) => typeof e == "boolean", ne = (e) => /^\w*$/.test(e), N = (e) => te(e.replace(/["|']|\]/g, "").split(/\.|\[/)), P = (e, t, n) => {
|
|
68
|
-
let r = -1, i = ne(t) ? [t] : N(t), a = i.length, o = a - 1;
|
|
69
|
-
for (; ++r < a;) {
|
|
70
|
-
let t = i[r], a = n;
|
|
71
|
-
if (r !== o) {
|
|
72
|
-
let n = e[t];
|
|
73
|
-
a = w(n) || Array.isArray(n) ? n : isNaN(+i[r + 1]) ? {} : [];
|
|
74
|
-
}
|
|
75
|
-
if (t === "__proto__" || t === "constructor" || t === "prototype") return;
|
|
76
|
-
e[t] = a, e = e[t];
|
|
77
|
-
}
|
|
78
|
-
return e;
|
|
79
|
-
}, re = {
|
|
64
|
+
var k = {
|
|
80
65
|
BLUR: "blur",
|
|
81
66
|
FOCUS_OUT: "focusout",
|
|
82
|
-
CHANGE: "change"
|
|
83
|
-
|
|
67
|
+
CHANGE: "change",
|
|
68
|
+
SUBMIT: "submit",
|
|
69
|
+
TRIGGER: "trigger",
|
|
70
|
+
VALID: "valid"
|
|
71
|
+
}, A = {
|
|
84
72
|
onBlur: "onBlur",
|
|
85
73
|
onChange: "onChange",
|
|
86
74
|
onSubmit: "onSubmit",
|
|
87
75
|
onTouched: "onTouched",
|
|
88
76
|
all: "all"
|
|
89
|
-
},
|
|
77
|
+
}, j = {
|
|
90
78
|
max: "max",
|
|
91
79
|
min: "min",
|
|
92
80
|
maxLength: "maxLength",
|
|
@@ -94,66 +82,173 @@ var te = (e) => Array.isArray(e) ? e.filter(Boolean) : [], A = (e) => e === void
|
|
|
94
82
|
pattern: "pattern",
|
|
95
83
|
required: "required",
|
|
96
84
|
validate: "validate"
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
85
|
+
}, te = "root", ne = [
|
|
86
|
+
"__proto__",
|
|
87
|
+
"constructor",
|
|
88
|
+
"prototype"
|
|
89
|
+
], re = /^\w*$/, ie = (e) => re.test(e), M = (e) => e === void 0, ae = /[.[\]'"]/, oe = (e) => e.split(ae).filter(Boolean), N = (e, t, n) => {
|
|
90
|
+
if (!t || !w(e)) return n;
|
|
91
|
+
let r = ie(t) ? [t] : oe(t);
|
|
92
|
+
if (r.some((e) => ne.includes(e))) return n;
|
|
93
|
+
let i = r.reduce((e, t) => S(e) ? void 0 : e[t], e);
|
|
94
|
+
return M(i) || i === e ? M(e[t]) ? n : e[t] : i;
|
|
95
|
+
}, P = (e) => typeof e == "boolean", F = (e) => typeof e == "function", I = (e, t, n) => {
|
|
96
|
+
let r = -1, i = ie(t) ? [t] : oe(t), a = i.length, o = a - 1;
|
|
97
|
+
for (; ++r < a;) {
|
|
98
|
+
let t = i[r], a = n;
|
|
99
|
+
if (r !== o) {
|
|
100
|
+
let n = e[t];
|
|
101
|
+
a = w(n) || Array.isArray(n) ? n : isNaN(+i[r + 1]) ? {} : [];
|
|
102
|
+
}
|
|
103
|
+
if (ne.includes(t)) return;
|
|
104
|
+
e[t] = a, e = e[t];
|
|
105
|
+
}
|
|
106
|
+
}, se = r.createContext(null);
|
|
107
|
+
se.displayName = "HookFormControlContext";
|
|
108
|
+
var ce = (e, t, n, r = !0) => {
|
|
109
|
+
let i = {};
|
|
101
110
|
for (let a in e) Object.defineProperty(i, a, { get: () => {
|
|
102
111
|
let i = a;
|
|
103
|
-
return t._proxyFormState[i] !==
|
|
112
|
+
return t._proxyFormState[i] !== A.all && (t._proxyFormState[i] = !r || A.all), n && (n[i] = !0), e[i];
|
|
104
113
|
} });
|
|
105
114
|
return i;
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
}, le = D ? r.useLayoutEffect : r.useEffect, L = (e) => typeof e == "string", ue = (e, t, n, r, i) => L(e) ? (r && t.watch.add(e), N(n, e, i)) : Array.isArray(e) ? e.map((e) => (r && t.watch.add(e), N(n, e))) : (r && (t.watchAll = !0), n), de = (e) => S(e) || !C(e), R = (e, t) => t.length === 0 && !Array.isArray(e) && !E(e);
|
|
116
|
+
function z(e, t, n = /* @__PURE__ */ new WeakMap()) {
|
|
117
|
+
if (e === t) return !0;
|
|
118
|
+
if (de(e) || de(t)) return Object.is(e, t);
|
|
119
|
+
if (x(e) && x(t)) return Object.is(e.getTime(), t.getTime());
|
|
120
|
+
let r = Object.keys(e), i = Object.keys(t);
|
|
121
|
+
if (r.length !== i.length) return !1;
|
|
122
|
+
if (R(e, r) || R(t, i)) return Object.is(e, t);
|
|
123
|
+
if (!r.length && Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
124
|
+
let a = n.get(e);
|
|
125
|
+
if (a && a.has(t)) return !0;
|
|
126
|
+
if (a) a.add(t);
|
|
127
|
+
else {
|
|
128
|
+
let r = /* @__PURE__ */ new WeakSet();
|
|
129
|
+
r.add(t), n.set(e, r);
|
|
130
|
+
}
|
|
131
|
+
for (let i of r) {
|
|
132
|
+
let r = e[i];
|
|
133
|
+
if (!(i in t)) return !1;
|
|
134
|
+
if (i !== "ref") {
|
|
135
|
+
let e = t[i];
|
|
136
|
+
if (x(r) && x(e) || (w(r) || Array.isArray(r)) && (w(e) || Array.isArray(e)) ? !z(r, e, n) : !Object.is(r, e)) return !1;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return !0;
|
|
119
140
|
}
|
|
120
|
-
var
|
|
141
|
+
var fe = r.createContext(null);
|
|
142
|
+
fe.displayName = "HookFormContext";
|
|
143
|
+
var pe = (e, t, n, r, i) => t ? {
|
|
121
144
|
...n[e],
|
|
122
145
|
types: {
|
|
123
146
|
...n[e] && n[e].types ? n[e].types : {},
|
|
124
147
|
[r]: i || !0
|
|
125
148
|
}
|
|
126
|
-
} : {},
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
} else if (w(a) && ue(a, t)) break;
|
|
149
|
+
} : {}, me = (e) => Array.isArray(e) ? e.filter(Boolean) : [], he = (e) => Array.isArray(e) ? e : [e], ge = () => {
|
|
150
|
+
let e = [];
|
|
151
|
+
return {
|
|
152
|
+
get observers() {
|
|
153
|
+
return e;
|
|
154
|
+
},
|
|
155
|
+
next: (t) => {
|
|
156
|
+
for (let n of e) n.next && n.next(t);
|
|
157
|
+
},
|
|
158
|
+
subscribe: (t) => (e.push(t), { unsubscribe: () => {
|
|
159
|
+
e = e.filter((e) => e !== t);
|
|
160
|
+
} }),
|
|
161
|
+
unsubscribe: () => {
|
|
162
|
+
e = [];
|
|
141
163
|
}
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
function _e(e, t) {
|
|
167
|
+
let n = {};
|
|
168
|
+
for (let r in e) if (e.hasOwnProperty(r)) {
|
|
169
|
+
let i = e[r], a = t[r];
|
|
170
|
+
if (i && w(i) && a) {
|
|
171
|
+
let e = _e(i, a);
|
|
172
|
+
w(e) && (n[r] = e);
|
|
173
|
+
} else e[r] && (n[r] = a);
|
|
142
174
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
if (!O) return !1;
|
|
175
|
+
return n;
|
|
176
|
+
}
|
|
177
|
+
var B = (e) => w(e) && !Object.keys(e).length, ve = (e) => e.type === "file", ye = (e) => {
|
|
178
|
+
if (!D) return !1;
|
|
148
179
|
let t = e ? e.ownerDocument : 0;
|
|
149
180
|
return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
|
|
150
|
-
},
|
|
181
|
+
}, be = (e) => e.type === "select-multiple", V = (e) => e.type === "radio", xe = (e) => V(e) || b(e), Se = (e) => ye(e) && e.isConnected;
|
|
182
|
+
function Ce(e, t) {
|
|
183
|
+
let n = t.slice(0, -1).length, r = 0;
|
|
184
|
+
for (; r < n;) {
|
|
185
|
+
if (S(e)) {
|
|
186
|
+
e = void 0;
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
e = e[t[r]], r++;
|
|
190
|
+
}
|
|
191
|
+
return e;
|
|
192
|
+
}
|
|
193
|
+
function H(e) {
|
|
194
|
+
for (let t in e) if (e.hasOwnProperty(t) && !M(e[t])) return !1;
|
|
195
|
+
return !0;
|
|
196
|
+
}
|
|
197
|
+
function U(e, t) {
|
|
198
|
+
if (L(t) && Object.prototype.hasOwnProperty.call(e, t)) return delete e[t], e;
|
|
199
|
+
let n = Array.isArray(t) ? t : ie(t) ? [t] : oe(t), r = n.length === 1 ? e : Ce(e, n), i = n.length - 1, a = n[i];
|
|
200
|
+
return r && delete r[a], i !== 0 && (w(r) && B(r) || Array.isArray(r) && H(r)) && U(e, n.slice(0, -1)), e;
|
|
201
|
+
}
|
|
202
|
+
var we = (e) => {
|
|
203
|
+
for (let t in e) if (F(e[t])) return !0;
|
|
204
|
+
return !1;
|
|
205
|
+
};
|
|
206
|
+
function Te(e) {
|
|
207
|
+
return Array.isArray(e) || w(e) && !we(e);
|
|
208
|
+
}
|
|
209
|
+
function Ee(e, t = {}) {
|
|
210
|
+
for (let n in e) {
|
|
211
|
+
let r = e[n];
|
|
212
|
+
Te(r) ? (t[n] = Array.isArray(r) ? [] : {}, Ee(r, t[n])) : M(r) || (t[n] = !0);
|
|
213
|
+
}
|
|
214
|
+
return t;
|
|
215
|
+
}
|
|
216
|
+
function De(e) {
|
|
217
|
+
if (e !== !1) {
|
|
218
|
+
if (e === !0) return !0;
|
|
219
|
+
if (Array.isArray(e)) {
|
|
220
|
+
let t = e.map((e) => De(e));
|
|
221
|
+
return t.some((e) => e !== void 0) ? t : void 0;
|
|
222
|
+
}
|
|
223
|
+
if (w(e)) {
|
|
224
|
+
let t = {};
|
|
225
|
+
for (let n in e) {
|
|
226
|
+
let r = De(e[n]);
|
|
227
|
+
M(r) || (t[n] = r);
|
|
228
|
+
}
|
|
229
|
+
return Object.keys(t).length ? t : void 0;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
function W(e, t, n) {
|
|
234
|
+
n ||= Ee(t);
|
|
235
|
+
for (let r in e) {
|
|
236
|
+
let i = e[r];
|
|
237
|
+
if (Te(i)) M(t) || de(n[r]) ? n[r] = Ee(i, Array.isArray(i) ? [] : {}) : W(i, S(t) ? {} : t[r], n[r]);
|
|
238
|
+
else {
|
|
239
|
+
let e = t[r];
|
|
240
|
+
n[r] = !z(i, e);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return De(n) || {};
|
|
244
|
+
}
|
|
245
|
+
var Oe = {
|
|
151
246
|
value: !1,
|
|
152
247
|
isValid: !1
|
|
153
|
-
},
|
|
248
|
+
}, G = {
|
|
154
249
|
value: !0,
|
|
155
250
|
isValid: !0
|
|
156
|
-
},
|
|
251
|
+
}, ke = (e) => {
|
|
157
252
|
if (Array.isArray(e)) {
|
|
158
253
|
if (e.length > 1) {
|
|
159
254
|
let t = e.filter((e) => e && e.checked && !e.disabled).map((e) => e.value);
|
|
@@ -162,35 +257,114 @@ var B = (e) => typeof e == "string", oe = (e, t, n, r, i) => B(e) ? (r && t.watc
|
|
|
162
257
|
isValid: !!t.length
|
|
163
258
|
};
|
|
164
259
|
}
|
|
165
|
-
return e[0].checked && !e[0].disabled ? e[0].attributes && !
|
|
260
|
+
return e[0].checked && !e[0].disabled ? e[0].attributes && !M(e[0].attributes.value) ? M(e[0].value) || e[0].value === "" ? G : {
|
|
166
261
|
value: e[0].value,
|
|
167
262
|
isValid: !0
|
|
168
|
-
} :
|
|
263
|
+
} : G : Oe;
|
|
169
264
|
}
|
|
170
|
-
return
|
|
171
|
-
},
|
|
265
|
+
return Oe;
|
|
266
|
+
}, Ae = (e, { valueAsNumber: t, valueAsDate: n, setValueAs: r }) => M(e) ? e : t ? e === "" ? NaN : e && +e : n && L(e) ? new Date(e) : r ? r(e) : e, je = {
|
|
172
267
|
isValid: !1,
|
|
173
268
|
value: null
|
|
174
|
-
},
|
|
269
|
+
}, Me = (e) => Array.isArray(e) ? e.reduce((e, t) => t && t.checked && !t.disabled ? {
|
|
175
270
|
isValid: !0,
|
|
176
271
|
value: t.value
|
|
177
|
-
} : e,
|
|
178
|
-
function
|
|
179
|
-
|
|
272
|
+
} : e, je) : je;
|
|
273
|
+
function Ne(e) {
|
|
274
|
+
let t = e.ref;
|
|
275
|
+
return ve(t) ? t.files : V(t) ? Me(e.refs).value : be(t) ? [...t.selectedOptions].map(({ value: e }) => e) : b(t) ? ke(e.refs).value : Ae(M(t.value) ? e.ref.value : t.value, e);
|
|
276
|
+
}
|
|
277
|
+
var Pe = (e, t, n, r) => {
|
|
278
|
+
let i = {};
|
|
279
|
+
for (let n of e) {
|
|
280
|
+
let e = N(t, n);
|
|
281
|
+
e && I(i, n, e._f);
|
|
282
|
+
}
|
|
283
|
+
return {
|
|
284
|
+
criteriaMode: n,
|
|
285
|
+
names: [...e],
|
|
286
|
+
fields: i,
|
|
287
|
+
shouldUseNativeValidation: r
|
|
288
|
+
};
|
|
289
|
+
}, K = (e) => e instanceof RegExp, Fe = (e) => M(e) ? e : K(e) ? e.source : w(e) ? K(e.value) ? e.value.source : e.value : e, Ie = (e) => ({
|
|
290
|
+
isOnSubmit: !e || e === A.onSubmit,
|
|
291
|
+
isOnBlur: e === A.onBlur,
|
|
292
|
+
isOnChange: e === A.onChange,
|
|
293
|
+
isOnAll: e === A.all,
|
|
294
|
+
isOnTouch: e === A.onTouched
|
|
295
|
+
}), Le = "AsyncFunction", Re = (e) => {
|
|
296
|
+
if (!e || !e.validate) return !1;
|
|
297
|
+
if (F(e.validate)) return e.validate.constructor.name === Le;
|
|
298
|
+
if (w(e.validate)) {
|
|
299
|
+
for (let t in e.validate) if (e.validate[t].constructor.name === Le) return !0;
|
|
300
|
+
}
|
|
301
|
+
return !1;
|
|
302
|
+
}, ze = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), Be = (e, t, n) => {
|
|
303
|
+
if (n) return !1;
|
|
304
|
+
if (t.watchAll || t.watch.has(e)) return !0;
|
|
305
|
+
for (let n of t.watch) if (e.startsWith(n) && e.charAt(n.length) === ".") return !0;
|
|
306
|
+
return !1;
|
|
307
|
+
}, Ve = (e, t, n, r) => {
|
|
308
|
+
for (let i of n || Object.keys(e)) {
|
|
309
|
+
let n = N(e, i);
|
|
310
|
+
if (n) {
|
|
311
|
+
let { _f: e, ...a } = n;
|
|
312
|
+
if (e) {
|
|
313
|
+
if (e.refs && e.refs[0] && t(e.refs[0], i) && !r || e.ref && t(e.ref, e.name) && !r) return !0;
|
|
314
|
+
if (Ve(a, t)) break;
|
|
315
|
+
} else if (w(a) && Ve(a, t)) break;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
function He(e, t, n) {
|
|
320
|
+
let r = N(e, n);
|
|
321
|
+
if (r || ie(n)) return {
|
|
322
|
+
error: r,
|
|
323
|
+
name: n
|
|
324
|
+
};
|
|
325
|
+
let i = n.split(".");
|
|
326
|
+
for (; i.length;) {
|
|
327
|
+
let r = i.join("."), a = N(t, r), o = N(e, r);
|
|
328
|
+
if (a && !Array.isArray(a) && n !== r) return { name: n };
|
|
329
|
+
if (o && o.type) return {
|
|
330
|
+
name: r,
|
|
331
|
+
error: o
|
|
332
|
+
};
|
|
333
|
+
if (o && o.root && o.root.type) return {
|
|
334
|
+
name: `${r}.root`,
|
|
335
|
+
error: o.root
|
|
336
|
+
};
|
|
337
|
+
i.pop();
|
|
338
|
+
}
|
|
339
|
+
return { name: n };
|
|
340
|
+
}
|
|
341
|
+
var Ue = (e, t, n, r) => {
|
|
342
|
+
n(e);
|
|
343
|
+
let { name: i, ...a } = e, o = Object.keys(a);
|
|
344
|
+
return !o.length || r && o.length >= Object.keys(t).length || o.find((e) => t[e] === (!r || A.all));
|
|
345
|
+
}, We = (e, t, n) => !e || !t || e === t || he(e).some((e) => e && (n ? e === t : e.startsWith(t) || t.startsWith(e))), Ge = (e, t, n, r, i) => i.isOnAll ? !1 : !n && i.isOnTouch ? !(t || e) : (n ? r.isOnBlur : i.isOnBlur) ? !e : (n ? r.isOnChange : i.isOnChange) ? e : !0, Ke = (e, t) => !me(N(e, t)).length && U(e, t), qe = (e, t, n) => {
|
|
346
|
+
let r = N(e, n), i = Array.isArray(r) ? r : [];
|
|
347
|
+
return I(i, te, t[n]), I(e, n, i), e;
|
|
348
|
+
};
|
|
349
|
+
function Je(e, t, n = "validate") {
|
|
350
|
+
if (L(e) || Array.isArray(e) && e.every(L) || P(e) && !e) return {
|
|
180
351
|
type: n,
|
|
181
|
-
message:
|
|
352
|
+
message: L(e) ? e : "",
|
|
182
353
|
ref: t
|
|
183
354
|
};
|
|
184
355
|
}
|
|
185
|
-
var
|
|
356
|
+
var q = (e) => w(e) && !K(e) ? e : {
|
|
186
357
|
value: e,
|
|
187
358
|
message: ""
|
|
188
|
-
},
|
|
189
|
-
let { ref: o, refs: s, required: c, maxLength: l, minLength: u, min: d, max: f, pattern: p, validate: m, name: h, valueAsNumber: g, mount: _ } = e._f, v =
|
|
359
|
+
}, Ye = async (e, t, n, r, i, a) => {
|
|
360
|
+
let { ref: o, refs: s, required: c, maxLength: l, minLength: u, min: d, max: f, pattern: p, validate: m, name: h, valueAsNumber: g, mount: _ } = e._f, v = N(n, h);
|
|
190
361
|
if (!_ || t.has(h)) return {};
|
|
191
362
|
let y = s ? s[0] : o, x = (e) => {
|
|
192
|
-
i && y.reportValidity
|
|
193
|
-
|
|
363
|
+
if (i && y.reportValidity) {
|
|
364
|
+
let t = P(e) ? "" : e || "";
|
|
365
|
+
s ? s.forEach((e) => e.setCustomValidity(t)) : y.setCustomValidity(t), y.reportValidity();
|
|
366
|
+
}
|
|
367
|
+
}, C = {}, ee = V(o), T = b(o), E = ee || T, D = (g || ve(o)) && M(o.value) && M(v) || ye(o) && o.value === "" || v === "" || Array.isArray(v) && !v.length, O = pe.bind(null, h, r, C), k = (e, t, n, r = j.maxLength, i = j.minLength) => {
|
|
194
368
|
let a = e ? t : n;
|
|
195
369
|
C[h] = {
|
|
196
370
|
type: e ? r : i,
|
|
@@ -199,196 +373,105 @@ var G = (e) => w(e) && !U(e) ? e : {
|
|
|
199
373
|
...O(e ? r : i, a)
|
|
200
374
|
};
|
|
201
375
|
};
|
|
202
|
-
if (a ? !Array.isArray(v) || !v.length : c && (!
|
|
203
|
-
let { value: e, message: t } =
|
|
376
|
+
if (a ? !Array.isArray(v) || !v.length : c && (!E && (D || S(v)) || P(v) && !v || T && !ke(s).isValid || ee && !Me(s).isValid)) {
|
|
377
|
+
let { value: e, message: t } = L(c) ? {
|
|
204
378
|
value: !!c,
|
|
205
379
|
message: c
|
|
206
|
-
} :
|
|
380
|
+
} : q(c);
|
|
207
381
|
if (e && (C[h] = {
|
|
208
|
-
type:
|
|
382
|
+
type: j.required,
|
|
209
383
|
message: t,
|
|
210
384
|
ref: y,
|
|
211
|
-
...O(
|
|
385
|
+
...O(j.required, t)
|
|
212
386
|
}, !r)) return x(t), C;
|
|
213
387
|
}
|
|
214
388
|
if (!D && (!S(d) || !S(f))) {
|
|
215
|
-
let e, t, n =
|
|
389
|
+
let e, t, n = q(f), i = q(d);
|
|
216
390
|
if (!S(v) && !isNaN(v)) {
|
|
217
391
|
let r = o.valueAsNumber || v && +v;
|
|
218
392
|
S(n.value) || (e = r > n.value), S(i.value) || (t = r < i.value);
|
|
219
393
|
} else {
|
|
220
394
|
let r = o.valueAsDate || new Date(v), a = (e) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + e), s = o.type == "time", c = o.type == "week";
|
|
221
|
-
|
|
395
|
+
L(n.value) && v && (e = s ? a(v) > a(n.value) : c ? v > n.value : r > new Date(n.value)), L(i.value) && v && (t = s ? a(v) < a(i.value) : c ? v < i.value : r < new Date(i.value));
|
|
222
396
|
}
|
|
223
|
-
if ((e || t) && (k(!!e, n.message, i.message,
|
|
397
|
+
if ((e || t) && (k(!!e, n.message, i.message, j.max, j.min), !r)) return x(C[h].message), C;
|
|
224
398
|
}
|
|
225
|
-
if ((l || u) && !D && (
|
|
226
|
-
let e =
|
|
399
|
+
if ((l || u) && !D && (L(v) || a && Array.isArray(v))) {
|
|
400
|
+
let e = q(l), t = q(u), n = !S(e.value) && v.length > +e.value, i = !S(t.value) && v.length < +t.value;
|
|
227
401
|
if ((n || i) && (k(n, e.message, t.message), !r)) return x(C[h].message), C;
|
|
228
402
|
}
|
|
229
|
-
if (p && !D &&
|
|
230
|
-
let { value: e, message: t } =
|
|
231
|
-
if (
|
|
232
|
-
type:
|
|
403
|
+
if (p && !D && L(v)) {
|
|
404
|
+
let { value: e, message: t } = q(p);
|
|
405
|
+
if (K(e) && !v.match(e) && (C[h] = {
|
|
406
|
+
type: j.pattern,
|
|
233
407
|
message: t,
|
|
234
408
|
ref: o,
|
|
235
|
-
...O(
|
|
409
|
+
...O(j.pattern, t)
|
|
236
410
|
}, !r)) return x(t), C;
|
|
237
411
|
}
|
|
238
412
|
if (m) {
|
|
239
|
-
if (
|
|
240
|
-
let e =
|
|
413
|
+
if (F(m)) {
|
|
414
|
+
let e = Je(await m(v, n), y);
|
|
241
415
|
if (e && (C[h] = {
|
|
242
416
|
...e,
|
|
243
|
-
...O(
|
|
417
|
+
...O(j.validate, e.message)
|
|
244
418
|
}, !r)) return x(e.message), C;
|
|
245
419
|
} else if (w(m)) {
|
|
246
420
|
let e = {};
|
|
247
421
|
for (let t in m) {
|
|
248
|
-
if (!
|
|
249
|
-
let i =
|
|
422
|
+
if (!B(e) && !r) break;
|
|
423
|
+
let i = Je(await m[t](v, n), y, t);
|
|
250
424
|
i && (e = {
|
|
251
425
|
...i,
|
|
252
426
|
...O(t, i.message)
|
|
253
427
|
}, x(i.message), r && (C[h] = e));
|
|
254
428
|
}
|
|
255
|
-
if (!
|
|
429
|
+
if (!B(e) && (C[h] = {
|
|
256
430
|
ref: y,
|
|
257
431
|
...e
|
|
258
432
|
}, !r)) return C;
|
|
259
433
|
}
|
|
260
434
|
}
|
|
261
435
|
return x(!0), C;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
for (; r < n;) e = A(e) ? r++ : e[t[r++]];
|
|
266
|
-
return e;
|
|
267
|
-
}
|
|
268
|
-
function Se(e) {
|
|
269
|
-
for (let t in e) if (e.hasOwnProperty(t) && !A(e[t])) return !1;
|
|
270
|
-
return !0;
|
|
271
|
-
}
|
|
272
|
-
function K(e, t) {
|
|
273
|
-
let n = Array.isArray(t) ? t : ne(t) ? [t] : N(t), r = n.length === 1 ? e : xe(e, n), i = n.length - 1, a = n[i];
|
|
274
|
-
return r && delete r[a], i !== 0 && (w(r) && R(r) || Array.isArray(r) && Se(r)) && K(e, n.slice(0, -1)), e;
|
|
275
|
-
}
|
|
276
|
-
var Ce = () => {
|
|
277
|
-
let e = [];
|
|
278
|
-
return {
|
|
279
|
-
get observers() {
|
|
280
|
-
return e;
|
|
281
|
-
},
|
|
282
|
-
next: (t) => {
|
|
283
|
-
for (let n of e) n.next && n.next(t);
|
|
284
|
-
},
|
|
285
|
-
subscribe: (t) => (e.push(t), { unsubscribe: () => {
|
|
286
|
-
e = e.filter((e) => e !== t);
|
|
287
|
-
} }),
|
|
288
|
-
unsubscribe: () => {
|
|
289
|
-
e = [];
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
}, we = (e) => S(e) || !C(e);
|
|
293
|
-
function q(e, t) {
|
|
294
|
-
if (we(e) || we(t)) return e === t;
|
|
295
|
-
if (x(e) && x(t)) return e.getTime() === t.getTime();
|
|
296
|
-
let n = Object.keys(e), r = Object.keys(t);
|
|
297
|
-
if (n.length !== r.length) return !1;
|
|
298
|
-
for (let i of n) {
|
|
299
|
-
let n = e[i];
|
|
300
|
-
if (!r.includes(i)) return !1;
|
|
301
|
-
if (i !== "ref") {
|
|
302
|
-
let e = t[i];
|
|
303
|
-
if (x(n) && x(e) || w(n) && w(e) || Array.isArray(n) && Array.isArray(e) ? !q(n, e) : n !== e) return !1;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
return !0;
|
|
307
|
-
}
|
|
308
|
-
var Te = (e) => e.type === "select-multiple", Ee = (e) => H(e) || b(e), De = (e) => pe(e) && e.isConnected, Oe = (e) => {
|
|
309
|
-
for (let t in e) if (V(e[t])) return !0;
|
|
310
|
-
return !1;
|
|
311
|
-
};
|
|
312
|
-
function J(e, t = {}) {
|
|
313
|
-
let n = Array.isArray(e);
|
|
314
|
-
if (w(e) || n) for (let n in e) Array.isArray(e[n]) || w(e[n]) && !Oe(e[n]) ? (t[n] = Array.isArray(e[n]) ? [] : {}, J(e[n], t[n])) : S(e[n]) || (t[n] = !0);
|
|
315
|
-
return t;
|
|
316
|
-
}
|
|
317
|
-
function ke(e, t, n) {
|
|
318
|
-
let r = Array.isArray(e);
|
|
319
|
-
if (w(e) || r) for (let r in e) Array.isArray(e[r]) || w(e[r]) && !Oe(e[r]) ? A(t) || we(n[r]) ? n[r] = Array.isArray(e[r]) ? J(e[r], []) : { ...J(e[r]) } : ke(e[r], S(t) ? {} : t[r], n[r]) : n[r] = !q(e[r], t[r]);
|
|
320
|
-
return n;
|
|
321
|
-
}
|
|
322
|
-
var Ae = (e, t) => ke(e, t, J(t)), je = (e, { valueAsNumber: t, valueAsDate: n, setValueAs: r }) => A(e) ? e : t ? e === "" ? NaN : e && +e : n && B(e) ? new Date(e) : r ? r(e) : e;
|
|
323
|
-
function Me(e) {
|
|
324
|
-
let t = e.ref;
|
|
325
|
-
return fe(t) ? t.files : H(t) ? ve(e.refs).value : Te(t) ? [...t.selectedOptions].map(({ value: e }) => e) : b(t) ? ge(e.refs).value : je(A(t.value) ? e.ref.value : t.value, e);
|
|
326
|
-
}
|
|
327
|
-
var Ne = (e, t, n, r) => {
|
|
328
|
-
let i = {};
|
|
329
|
-
for (let n of e) {
|
|
330
|
-
let e = j(t, n);
|
|
331
|
-
e && P(i, n, e._f);
|
|
332
|
-
}
|
|
333
|
-
return {
|
|
334
|
-
criteriaMode: n,
|
|
335
|
-
names: [...e],
|
|
336
|
-
fields: i,
|
|
337
|
-
shouldUseNativeValidation: r
|
|
338
|
-
};
|
|
339
|
-
}, Pe = (e) => A(e) ? e : U(e) ? e.source : w(e) ? U(e.value) ? e.value.source : e.value : e, Fe = "AsyncFunction", Ie = (e) => !!e && !!e.validate && !!(V(e.validate) && e.validate.constructor.name === Fe || w(e.validate) && Object.values(e.validate).find((e) => e.constructor.name === Fe)), Le = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
|
|
340
|
-
function Re(e, t, n) {
|
|
341
|
-
let r = j(e, n);
|
|
342
|
-
if (r || ne(n)) return {
|
|
343
|
-
error: r,
|
|
344
|
-
name: n
|
|
345
|
-
};
|
|
346
|
-
let i = n.split(".");
|
|
347
|
-
for (; i.length;) {
|
|
348
|
-
let r = i.join("."), a = j(t, r), o = j(e, r);
|
|
349
|
-
if (a && !Array.isArray(a) && n !== r) return { name: n };
|
|
350
|
-
if (o && o.type) return {
|
|
351
|
-
name: r,
|
|
352
|
-
error: o
|
|
353
|
-
};
|
|
354
|
-
i.pop();
|
|
355
|
-
}
|
|
356
|
-
return { name: n };
|
|
357
|
-
}
|
|
358
|
-
var ze = (e, t, n, r, i) => i.isOnAll ? !1 : !n && i.isOnTouch ? !(t || e) : (n ? r.isOnBlur : i.isOnBlur) ? !e : (n ? r.isOnChange : i.isOnChange) ? e : !0, Be = (e, t) => !te(j(e, t)).length && K(e, t), Ve = {
|
|
359
|
-
mode: F.onSubmit,
|
|
360
|
-
reValidateMode: F.onChange,
|
|
436
|
+
}, Xe = {
|
|
437
|
+
mode: A.onSubmit,
|
|
438
|
+
reValidateMode: A.onChange,
|
|
361
439
|
shouldFocusError: !0
|
|
440
|
+
}, Ze = "form", Qe = {
|
|
441
|
+
submitCount: 0,
|
|
442
|
+
isDirty: !1,
|
|
443
|
+
isReady: !1,
|
|
444
|
+
isValidating: !1,
|
|
445
|
+
isSubmitted: !1,
|
|
446
|
+
isSubmitting: !1,
|
|
447
|
+
isSubmitSuccessful: !1,
|
|
448
|
+
isValid: !1,
|
|
449
|
+
touchedFields: {},
|
|
450
|
+
dirtyFields: {},
|
|
451
|
+
validatingFields: {}
|
|
362
452
|
};
|
|
363
|
-
function
|
|
453
|
+
function $e(e = {}) {
|
|
364
454
|
let t = {
|
|
365
|
-
...
|
|
455
|
+
...Xe,
|
|
366
456
|
...e
|
|
367
457
|
}, n = {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
isLoading: V(t.defaultValues),
|
|
371
|
-
isValidating: !1,
|
|
372
|
-
isSubmitted: !1,
|
|
373
|
-
isSubmitting: !1,
|
|
374
|
-
isSubmitSuccessful: !1,
|
|
375
|
-
isValid: !1,
|
|
376
|
-
touchedFields: {},
|
|
377
|
-
dirtyFields: {},
|
|
378
|
-
validatingFields: {},
|
|
458
|
+
...O(Qe),
|
|
459
|
+
isLoading: F(t.defaultValues),
|
|
379
460
|
errors: t.errors || {},
|
|
380
461
|
disabled: t.disabled || !1
|
|
381
|
-
}, r = {}, i = (w(t.defaultValues) || w(t.values)) &&
|
|
462
|
+
}, r = {}, i = (w(t.defaultValues) || w(t.values)) && O(t.defaultValues || t.values) || {}, a = t.shouldUnregister ? {} : O(i), o = {
|
|
382
463
|
action: !1,
|
|
383
464
|
mount: !1,
|
|
384
|
-
watch: !1
|
|
465
|
+
watch: !1,
|
|
466
|
+
keepIsValid: !1
|
|
385
467
|
}, s = {
|
|
386
468
|
mount: /* @__PURE__ */ new Set(),
|
|
387
469
|
disabled: /* @__PURE__ */ new Set(),
|
|
388
470
|
unMount: /* @__PURE__ */ new Set(),
|
|
389
471
|
array: /* @__PURE__ */ new Set(),
|
|
390
|
-
watch: /* @__PURE__ */ new Set()
|
|
391
|
-
|
|
472
|
+
watch: /* @__PURE__ */ new Set(),
|
|
473
|
+
registerName: /* @__PURE__ */ new Set()
|
|
474
|
+
}, c, l = 0, u = 0, d = Ie(t.mode), f = Ie(t.reValidateMode), p = {
|
|
392
475
|
isDirty: !1,
|
|
393
476
|
dirtyFields: !1,
|
|
394
477
|
validatingFields: !1,
|
|
@@ -396,226 +479,359 @@ function He(e = {}) {
|
|
|
396
479
|
isValidating: !1,
|
|
397
480
|
isValid: !1,
|
|
398
481
|
errors: !1
|
|
399
|
-
},
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
}, f = ce(t.mode), p = ce(t.reValidateMode), m = t.criteriaMode === F.all, h = (e) => (t) => {
|
|
482
|
+
}, m = { ...p }, h = { ...m }, g = {
|
|
483
|
+
array: ge(),
|
|
484
|
+
state: ge()
|
|
485
|
+
}, _ = t.criteriaMode === A.all, v = (e) => (t) => {
|
|
404
486
|
clearTimeout(l), l = setTimeout(e, t);
|
|
405
|
-
},
|
|
406
|
-
if (!t.disabled && (
|
|
407
|
-
let e
|
|
408
|
-
e
|
|
487
|
+
}, y = async (e) => {
|
|
488
|
+
if (!o.keepIsValid && !t.disabled && (m.isValid || h.isValid || e)) {
|
|
489
|
+
let e;
|
|
490
|
+
t.resolver ? (e = B((await R()).errors), C()) : e = await V({
|
|
491
|
+
fields: r,
|
|
492
|
+
onlyCheckValid: !0,
|
|
493
|
+
eventType: k.VALID
|
|
494
|
+
}), e !== n.isValid && g.state.next({ isValid: e });
|
|
409
495
|
}
|
|
410
|
-
},
|
|
411
|
-
!t.disabled && (
|
|
412
|
-
e && (r ?
|
|
413
|
-
}),
|
|
496
|
+
}, C = (e, r) => {
|
|
497
|
+
!t.disabled && (m.isValidating || m.validatingFields || h.isValidating || h.validatingFields) && ((e || Array.from(s.mount)).forEach((e) => {
|
|
498
|
+
e && (r ? I(n.validatingFields, e, r) : U(n.validatingFields, e));
|
|
499
|
+
}), g.state.next({
|
|
414
500
|
validatingFields: n.validatingFields,
|
|
415
|
-
isValidating: !
|
|
501
|
+
isValidating: !B(n.validatingFields)
|
|
416
502
|
}));
|
|
417
|
-
},
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
503
|
+
}, E = () => {
|
|
504
|
+
n.dirtyFields = W(i, a);
|
|
505
|
+
}, ne = (e, i = [], s, c, l = !0, u = !0) => {
|
|
506
|
+
if (c && s && !t.disabled) {
|
|
507
|
+
if (o.action = !0, u && Array.isArray(N(r, e))) {
|
|
508
|
+
let t = s(N(r, e), c.argA, c.argB);
|
|
509
|
+
l && I(r, e, t);
|
|
422
510
|
}
|
|
423
|
-
if (
|
|
424
|
-
let t =
|
|
425
|
-
|
|
511
|
+
if (u && Array.isArray(N(n.errors, e))) {
|
|
512
|
+
let t = s(N(n.errors, e), c.argA, c.argB);
|
|
513
|
+
l && I(n.errors, e, t), Ke(n.errors, e);
|
|
426
514
|
}
|
|
427
|
-
if (
|
|
428
|
-
let t =
|
|
429
|
-
|
|
515
|
+
if ((m.touchedFields || h.touchedFields) && u && Array.isArray(N(n.touchedFields, e))) {
|
|
516
|
+
let t = s(N(n.touchedFields, e), c.argA, c.argB);
|
|
517
|
+
l && I(n.touchedFields, e, t);
|
|
430
518
|
}
|
|
431
|
-
|
|
519
|
+
(m.dirtyFields || h.dirtyFields) && E(), g.state.next({
|
|
432
520
|
name: e,
|
|
433
|
-
isDirty:
|
|
521
|
+
isDirty: H(e, i),
|
|
434
522
|
dirtyFields: n.dirtyFields,
|
|
435
523
|
errors: n.errors,
|
|
436
524
|
isValid: n.isValid
|
|
437
525
|
});
|
|
438
|
-
} else
|
|
439
|
-
},
|
|
440
|
-
|
|
441
|
-
},
|
|
442
|
-
n.errors = e,
|
|
526
|
+
} else I(a, e, i);
|
|
527
|
+
}, re = (e, t) => {
|
|
528
|
+
I(n.errors, e, t), n.errors = { ...n.errors }, g.state.next({ errors: n.errors });
|
|
529
|
+
}, ae = (e) => {
|
|
530
|
+
n.errors = e, g.state.next({
|
|
443
531
|
errors: n.errors,
|
|
444
532
|
isValid: !1
|
|
445
533
|
});
|
|
446
|
-
},
|
|
447
|
-
let
|
|
448
|
-
|
|
449
|
-
let
|
|
450
|
-
|
|
534
|
+
}, se = (e) => {
|
|
535
|
+
let t = ie(e) ? [e] : oe(e), n = a, r = i;
|
|
536
|
+
for (let e = 0; e < t.length - 1; e++) {
|
|
537
|
+
let i = t[e];
|
|
538
|
+
if (n = S(n) ? n : n[i], r = S(r) ? r : r[i], n === null && r !== null) return !0;
|
|
539
|
+
}
|
|
540
|
+
return !1;
|
|
541
|
+
}, ce = (t, c, l, u) => {
|
|
542
|
+
let d = N(r, t);
|
|
543
|
+
if (d) {
|
|
544
|
+
if (se(t)) return;
|
|
545
|
+
let r = M(N(a, t)), f = N(a, t, M(l) ? N(i, t) : l);
|
|
546
|
+
M(f) || u && u.defaultChecked || c ? I(a, t, c ? f : Ne(d._f)) : Ee(t, f), o.mount && !o.action && (y(), r && n.isDirty && (m.isDirty || h.isDirty) && (H() || (n.isDirty = !1, g.state.next({ ...n }))), e.shouldUnregister && r && !M(N(a, t)) && Be(t, s) && (o.watch = !0));
|
|
451
547
|
}
|
|
452
|
-
},
|
|
453
|
-
let l = !1,
|
|
548
|
+
}, le = (e, r, o, s, c) => {
|
|
549
|
+
let l = !1, u = !1, d = { name: e };
|
|
454
550
|
if (!t.disabled) {
|
|
455
|
-
let t = !!(j(r, e) && j(r, e)._f && j(r, e)._f.disabled);
|
|
456
551
|
if (!o || s) {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
f = !!(!t && j(n.dirtyFields, e)), r || t ? K(n.dirtyFields, e) : P(n.dirtyFields, e, !0), p.dirtyFields = n.dirtyFields, l ||= u.dirtyFields && f !== !r;
|
|
552
|
+
let t = z(N(i, e), r);
|
|
553
|
+
(m.isDirty || h.isDirty) && (u = n.isDirty, n.isDirty = d.isDirty = !t || H(), l = u !== d.isDirty), u = !!N(n.dirtyFields, e), t === n.isDirty ? t ? U(n.dirtyFields, e) : I(n.dirtyFields, e, !0) : n.dirtyFields = W(i, a), d.dirtyFields = n.dirtyFields, l ||= (m.dirtyFields || h.dirtyFields) && u !== !t;
|
|
460
554
|
}
|
|
461
555
|
if (o) {
|
|
462
|
-
let t =
|
|
463
|
-
t || (
|
|
556
|
+
let t = N(n.touchedFields, e);
|
|
557
|
+
t || (I(n.touchedFields, e, o), d.touchedFields = n.touchedFields, l ||= (m.touchedFields || h.touchedFields) && t !== o);
|
|
464
558
|
}
|
|
465
|
-
l && c &&
|
|
559
|
+
l && c && g.state.next(d);
|
|
466
560
|
}
|
|
467
|
-
return l ?
|
|
468
|
-
},
|
|
469
|
-
let o =
|
|
470
|
-
if (t.delayError && i ? (c =
|
|
561
|
+
return l ? d : {};
|
|
562
|
+
}, de = (e, r, i, a) => {
|
|
563
|
+
let o = N(n.errors, e), s = (m.isValid || h.isValid) && P(r) && n.isValid !== r;
|
|
564
|
+
if (t.delayError && i ? (c = v(() => re(e, i)), c(t.delayError)) : (clearTimeout(l), c = null, i ? I(n.errors, e, i) : U(n.errors, e), n.errors = { ...n.errors }), (i ? !z(o, i) : o) || !B(a) || s) {
|
|
471
565
|
let t = {
|
|
472
566
|
...a,
|
|
473
|
-
...s &&
|
|
567
|
+
...s && P(r) ? { isValid: r } : {},
|
|
474
568
|
errors: n.errors,
|
|
475
569
|
name: e
|
|
476
570
|
};
|
|
477
571
|
n = {
|
|
478
572
|
...n,
|
|
479
573
|
...t
|
|
480
|
-
},
|
|
574
|
+
}, g.state.next(t);
|
|
481
575
|
}
|
|
482
|
-
},
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
}
|
|
492
|
-
else n.errors = t;
|
|
576
|
+
}, R = async (e) => (C(e, !0), await t.resolver(a, t.context, Pe(e || s.mount, r, t.criteriaMode, t.shouldUseNativeValidation))), fe = async (e) => {
|
|
577
|
+
let { errors: t } = await R(e);
|
|
578
|
+
if (C(e), e) {
|
|
579
|
+
for (let r of e) {
|
|
580
|
+
let e = N(t, r);
|
|
581
|
+
e ? s.array.has(r) && w(e) && !Object.keys(e).some((e) => !Number.isNaN(Number(e))) ? qe(n.errors, { [r]: e }, r) : I(n.errors, r, e) : U(n.errors, r);
|
|
582
|
+
}
|
|
583
|
+
n.errors = { ...n.errors };
|
|
584
|
+
} else n.errors = t;
|
|
493
585
|
return t;
|
|
494
|
-
},
|
|
495
|
-
|
|
496
|
-
let
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
586
|
+
}, pe = async ({ name: t, eventType: r }) => {
|
|
587
|
+
if (e.validate) {
|
|
588
|
+
let i = await e.validate({
|
|
589
|
+
formValues: a,
|
|
590
|
+
formState: n,
|
|
591
|
+
name: t,
|
|
592
|
+
eventType: r
|
|
593
|
+
});
|
|
594
|
+
if (w(i)) for (let e in i) {
|
|
595
|
+
let t = i[e];
|
|
596
|
+
t && $e(`${Ze}.${e}`, {
|
|
597
|
+
message: L(t.message) ? t.message : "",
|
|
598
|
+
type: t.type || j.validate
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
else L(i) || !i ? $e(Ze, {
|
|
602
|
+
message: i || "",
|
|
603
|
+
type: j.validate
|
|
604
|
+
}) : q(Ze);
|
|
605
|
+
return i;
|
|
606
|
+
}
|
|
607
|
+
return !0;
|
|
608
|
+
}, V = async ({ fields: r, onlyCheckValid: i, name: o, eventType: c, context: l = {
|
|
609
|
+
valid: !0,
|
|
610
|
+
runRootValidation: !1
|
|
611
|
+
} }) => {
|
|
612
|
+
if (e.validate && (l.runRootValidation = !0, !await pe({
|
|
613
|
+
name: o,
|
|
614
|
+
eventType: c
|
|
615
|
+
}) && (l.valid = !1, i))) return l.valid;
|
|
616
|
+
for (let o in r) {
|
|
617
|
+
let u = r[o];
|
|
618
|
+
if (u) {
|
|
619
|
+
let { _f: r, ...d } = u;
|
|
620
|
+
if (r) {
|
|
621
|
+
let o = s.array.has(r.name), c = u._f && Re(u._f), d = m.validatingFields || m.isValidating || h.validatingFields || h.isValidating;
|
|
622
|
+
c && d && C([r.name], !0);
|
|
623
|
+
let f = await Ye(u, s.disabled, a, _, t.shouldUseNativeValidation && !i, o);
|
|
624
|
+
if (c && d && C([r.name]), f[r.name] && (l.valid = !1, i) || (!i && (N(f, r.name) ? o ? qe(n.errors, f, r.name) : I(n.errors, r.name, f[r.name]) : U(n.errors, r.name)), e.shouldUseNativeValidation && f[r.name])) break;
|
|
505
625
|
}
|
|
506
|
-
!
|
|
626
|
+
!B(d) && await V({
|
|
627
|
+
context: l,
|
|
628
|
+
onlyCheckValid: i,
|
|
629
|
+
fields: d,
|
|
630
|
+
name: o,
|
|
631
|
+
eventType: c
|
|
632
|
+
});
|
|
507
633
|
}
|
|
508
634
|
}
|
|
509
|
-
return
|
|
510
|
-
},
|
|
635
|
+
return l.valid;
|
|
636
|
+
}, Ce = () => {
|
|
511
637
|
for (let e of s.unMount) {
|
|
512
|
-
let t =
|
|
513
|
-
t && (t._f.refs ? t._f.refs.every((e) => !
|
|
638
|
+
let t = N(r, e);
|
|
639
|
+
t && (t._f.refs ? t._f.refs.every((e) => !Se(e)) : !Se(t._f.ref)) && Y(e);
|
|
514
640
|
}
|
|
515
641
|
s.unMount = /* @__PURE__ */ new Set();
|
|
516
|
-
},
|
|
517
|
-
let
|
|
518
|
-
if (
|
|
519
|
-
let n =
|
|
520
|
-
n && (!n.disabled &&
|
|
642
|
+
}, H = (e, n) => !t.disabled && (e && n && I(a, e, n), !z(o.mount ? a : i, i)), we = (e, t, n) => ue(e, s, { ...o.mount ? a : M(t) ? i : L(e) ? { [e]: t } : t }, n, t), Te = (e) => me(N(o.mount ? a : i, e, t.shouldUnregister ? N(i, e, []) : [])), Ee = (e, t, n = {}, i = !1, o = !1) => {
|
|
643
|
+
let s = N(r, e), c = t;
|
|
644
|
+
if (s) {
|
|
645
|
+
let n = s._f;
|
|
646
|
+
n && (!n.disabled && I(a, e, Ae(t, n)), c = ye(n.ref) && S(t) ? "" : t, be(n.ref) ? [...n.ref.options].forEach((e) => e.selected = c.includes(e.value)) : n.refs ? b(n.ref) ? n.refs.forEach((e) => {
|
|
647
|
+
(!e.defaultChecked || !e.disabled) && (Array.isArray(c) ? e.checked = !!c.find((t) => t === e.value) : e.checked = c === e.value || !!c);
|
|
648
|
+
}) : n.refs.forEach((e) => e.checked = e.value === c) : ve(n.ref) ? n.ref.value = "" : (n.ref.value = c, !n.ref.type && !o && g.state.next({
|
|
521
649
|
name: e,
|
|
522
|
-
values:
|
|
650
|
+
values: i ? a : O(a)
|
|
523
651
|
})));
|
|
524
652
|
}
|
|
525
|
-
(n.shouldDirty || n.shouldTouch) &&
|
|
526
|
-
},
|
|
527
|
-
for (let
|
|
528
|
-
|
|
529
|
-
|
|
653
|
+
(n.shouldDirty || n.shouldTouch) && le(e, c, n.shouldTouch, n.shouldDirty, !o), n.shouldValidate && K(e);
|
|
654
|
+
}, De = (e, t, n, i = !1, a = !1) => {
|
|
655
|
+
for (let o in t) {
|
|
656
|
+
if (!t.hasOwnProperty(o)) return;
|
|
657
|
+
let c = t[o], l = e + "." + o, u = N(r, l);
|
|
658
|
+
(s.array.has(e) || w(c) || u && !u._f) && !x(c) ? De(l, c, n, i, a) : Ee(l, c, n, i, a);
|
|
530
659
|
}
|
|
531
|
-
},
|
|
532
|
-
let
|
|
533
|
-
|
|
660
|
+
}, Oe = (e, t, i, c, l = !1) => {
|
|
661
|
+
let u = N(r, e), d = s.array.has(e), f = c ? t : O(t), p = z(N(a, e), f);
|
|
662
|
+
if (p || I(a, e, f), d) g.array.next({
|
|
534
663
|
name: e,
|
|
535
|
-
values:
|
|
536
|
-
}), (
|
|
664
|
+
values: c ? a : O(a)
|
|
665
|
+
}), (m.isDirty || m.dirtyFields || h.isDirty || h.dirtyFields) && i.shouldDirty && (E(), l || g.state.next({
|
|
537
666
|
name: e,
|
|
538
|
-
dirtyFields:
|
|
539
|
-
isDirty:
|
|
540
|
-
}))
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
667
|
+
dirtyFields: n.dirtyFields,
|
|
668
|
+
isDirty: H(e, f)
|
|
669
|
+
}));
|
|
670
|
+
else {
|
|
671
|
+
let t = Array.isArray(f) && !f.length || B(f);
|
|
672
|
+
!u || u._f || S(f) || t ? Ee(e, f, i, c, l) : De(e, f, i, c, l);
|
|
673
|
+
}
|
|
674
|
+
if (!p && !l) {
|
|
675
|
+
let t = Be(e, s), r = c ? a : O(a);
|
|
676
|
+
g.state.next({
|
|
677
|
+
...t && n,
|
|
678
|
+
name: o.mount || t ? e : void 0,
|
|
679
|
+
values: r
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
}, G = (e, t, n = {}) => Oe(e, t, n, !1), ke = (e, t = {}) => {
|
|
683
|
+
let r = F(e) ? e(a) : e;
|
|
684
|
+
if (!z(a, r)) {
|
|
685
|
+
a = {
|
|
686
|
+
...a,
|
|
687
|
+
...r
|
|
688
|
+
};
|
|
689
|
+
for (let e of s.mount) Oe(e, N(r, e), t, !0, !0);
|
|
690
|
+
g.state.next({
|
|
691
|
+
...n,
|
|
692
|
+
name: void 0,
|
|
693
|
+
type: void 0,
|
|
694
|
+
...u ? { values: a } : {}
|
|
695
|
+
}), t.shouldValidate && y();
|
|
696
|
+
}
|
|
697
|
+
}, je = async (i) => {
|
|
545
698
|
o.mount = !0;
|
|
546
|
-
let
|
|
547
|
-
|
|
699
|
+
let l = i.target, p = l.name, v = !0, b = N(r, p), S = (e) => {
|
|
700
|
+
v = Number.isNaN(e) || x(e) && isNaN(e.getTime()) || z(e, N(a, p, e));
|
|
548
701
|
};
|
|
549
|
-
if (
|
|
550
|
-
let
|
|
551
|
-
|
|
552
|
-
let
|
|
553
|
-
if (!
|
|
554
|
-
name:
|
|
555
|
-
type:
|
|
556
|
-
values:
|
|
557
|
-
}),
|
|
558
|
-
name:
|
|
559
|
-
...
|
|
702
|
+
if (b) {
|
|
703
|
+
let o, x, w = l.type ? Ne(b._f) : ee(i), T = i.type === k.BLUR || i.type === k.FOCUS_OUT, E = !ze(b._f) && !e.validate && !t.resolver && !N(n.errors, p) && !b._f.deps, D = E || Ge(T, N(n.touchedFields, p), n.isSubmitted, f, d), A = Be(p, s, T);
|
|
704
|
+
I(a, p, w), T ? (!l || !l.readOnly) && (b._f.onBlur && b._f.onBlur(i), c && c(0)) : b._f.onChange && b._f.onChange(i);
|
|
705
|
+
let j = le(p, w, T), te = !B(j) || A;
|
|
706
|
+
if (!T && g.state.next({
|
|
707
|
+
name: p,
|
|
708
|
+
type: i.type,
|
|
709
|
+
...u ? { values: O(a) } : {}
|
|
710
|
+
}), D) return (!E || !n.isValid) && (m.isValid || h.isValid) && (t.mode === "onBlur" ? T && y() : T || y()), te && g.state.next({
|
|
711
|
+
name: p,
|
|
712
|
+
...A ? {} : j
|
|
560
713
|
});
|
|
561
|
-
if (!
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
714
|
+
if (!t.resolver && e.validate && await pe({
|
|
715
|
+
name: p,
|
|
716
|
+
eventType: i.type
|
|
717
|
+
}), !T && A && g.state.next({ ...n }), t.resolver) {
|
|
718
|
+
let { errors: e } = await R([p]);
|
|
719
|
+
if (C([p]), S(w), !v) {
|
|
720
|
+
!B(j) && g.state.next(j);
|
|
721
|
+
return;
|
|
566
722
|
}
|
|
567
|
-
|
|
568
|
-
|
|
723
|
+
let t = He(n.errors, r, p), i = He(e, r, t.name || p);
|
|
724
|
+
o = i.error, p = i.name, x = B(e);
|
|
725
|
+
} else C([p], !0), o = (await Ye(b, s.disabled, a, _, t.shouldUseNativeValidation))[p], C([p]), S(w), v && (o ? x = !1 : (m.isValid || h.isValid) && (x = await V({
|
|
726
|
+
fields: r,
|
|
727
|
+
onlyCheckValid: !0,
|
|
728
|
+
name: p,
|
|
729
|
+
eventType: i.type
|
|
730
|
+
})));
|
|
731
|
+
v && (b._f.deps && (!Array.isArray(b._f.deps) || b._f.deps.length > 0) && K(b._f.deps), de(p, x, o, j));
|
|
569
732
|
}
|
|
570
|
-
},
|
|
571
|
-
if (
|
|
572
|
-
},
|
|
573
|
-
let a, o, c =
|
|
733
|
+
}, Me = (e, t) => {
|
|
734
|
+
if (N(n.errors, t) && e.focus) return e.focus(), 1;
|
|
735
|
+
}, K = async (e, i = {}) => {
|
|
736
|
+
let a, o, c = he(e);
|
|
574
737
|
if (t.resolver) {
|
|
575
|
-
let t = await
|
|
576
|
-
a =
|
|
738
|
+
let t = await fe(M(e) ? e : c);
|
|
739
|
+
a = B(t), o = e ? !c.some((e) => N(t, e)) : a;
|
|
577
740
|
} else e ? (o = (await Promise.all(c.map(async (e) => {
|
|
578
|
-
let t =
|
|
579
|
-
return await
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
741
|
+
let t = N(r, e);
|
|
742
|
+
return await V({
|
|
743
|
+
fields: t && t._f ? { [e]: t } : t,
|
|
744
|
+
eventType: k.TRIGGER
|
|
745
|
+
});
|
|
746
|
+
}))).every(Boolean), !(!o && !n.isValid) && y()) : o = a = await V({
|
|
747
|
+
fields: r,
|
|
748
|
+
name: e,
|
|
749
|
+
eventType: k.TRIGGER
|
|
750
|
+
});
|
|
751
|
+
return g.state.next({
|
|
752
|
+
...!L(e) || (m.isValid || h.isValid) && a !== n.isValid ? {} : { name: e },
|
|
583
753
|
...t.resolver || !e ? { isValid: a } : {},
|
|
584
754
|
errors: n.errors
|
|
585
|
-
}), i.shouldFocus && !o &&
|
|
586
|
-
},
|
|
587
|
-
let
|
|
588
|
-
return
|
|
589
|
-
},
|
|
590
|
-
invalid: !!
|
|
591
|
-
isDirty: !!
|
|
592
|
-
error:
|
|
593
|
-
isValidating: !!
|
|
594
|
-
isTouched: !!
|
|
595
|
-
}),
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
755
|
+
}), i.shouldFocus && !o && Ve(r, Me, e ? c : s.mount), o;
|
|
756
|
+
}, Le = (e, t) => {
|
|
757
|
+
let r = { ...o.mount ? a : i };
|
|
758
|
+
return t && (r = _e(t.dirtyFields ? n.dirtyFields : n.touchedFields, r)), M(e) ? r : L(e) ? N(r, e) : e.map((e) => N(r, e));
|
|
759
|
+
}, Je = (e, t) => ({
|
|
760
|
+
invalid: !!N((t || n).errors, e),
|
|
761
|
+
isDirty: !!N((t || n).dirtyFields, e),
|
|
762
|
+
error: N((t || n).errors, e),
|
|
763
|
+
isValidating: !!N(n.validatingFields, e),
|
|
764
|
+
isTouched: !!N((t || n).touchedFields, e)
|
|
765
|
+
}), q = (e) => {
|
|
766
|
+
let t = e ? he(e) : void 0;
|
|
767
|
+
t?.forEach((e) => U(n.errors, e)), t ? t.forEach((e) => {
|
|
768
|
+
g.state.next({
|
|
769
|
+
name: e,
|
|
770
|
+
errors: n.errors
|
|
771
|
+
});
|
|
772
|
+
}) : g.state.next({ errors: {} });
|
|
773
|
+
}, $e = (e, t, i) => {
|
|
774
|
+
let a = (N(r, e, { _f: {} })._f || {}).ref, { ref: o, message: s, type: c, ...l } = N(n.errors, e) || {};
|
|
775
|
+
I(n.errors, e, {
|
|
600
776
|
...l,
|
|
601
777
|
...t,
|
|
602
778
|
ref: a
|
|
603
|
-
}),
|
|
779
|
+
}), g.state.next({
|
|
604
780
|
name: e,
|
|
605
781
|
errors: n.errors,
|
|
606
782
|
isValid: !1
|
|
607
783
|
}), i && i.shouldFocus && a && a.focus && a.focus();
|
|
608
|
-
},
|
|
609
|
-
|
|
610
|
-
|
|
784
|
+
}, et = (e, t) => {
|
|
785
|
+
if (F(e)) {
|
|
786
|
+
u++;
|
|
787
|
+
let { unsubscribe: n } = g.state.subscribe({ next: (n) => "values" in n && e(n.values || we(void 0, t), n) }), r = !1;
|
|
788
|
+
return { unsubscribe: () => {
|
|
789
|
+
r || (r = !0, u--, n());
|
|
790
|
+
} };
|
|
791
|
+
}
|
|
792
|
+
return we(e, t, !0);
|
|
793
|
+
}, tt = (e) => {
|
|
794
|
+
let t = !!e.formState?.values;
|
|
795
|
+
t && u++;
|
|
796
|
+
let { unsubscribe: r } = g.state.subscribe({ next: (t) => {
|
|
797
|
+
if (We(e.name, t.name, e.exact) && Ue(t, e.formState || m, lt, e.reRenderRoot)) {
|
|
798
|
+
let r = { ...a };
|
|
799
|
+
e.callback({
|
|
800
|
+
values: r,
|
|
801
|
+
...n,
|
|
802
|
+
...t,
|
|
803
|
+
defaultValues: i
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
} });
|
|
807
|
+
if (!t) return r;
|
|
808
|
+
let o = !1;
|
|
809
|
+
return () => {
|
|
810
|
+
o || (o = !0, u--, r());
|
|
811
|
+
};
|
|
812
|
+
}, J = (e) => (o.mount = !0, h = {
|
|
813
|
+
...h,
|
|
814
|
+
...e.formState
|
|
815
|
+
}, tt({
|
|
816
|
+
...e,
|
|
817
|
+
formState: {
|
|
818
|
+
...p,
|
|
819
|
+
...e.formState
|
|
820
|
+
}
|
|
821
|
+
})), Y = (e, o = {}) => {
|
|
822
|
+
for (let c of e ? he(e) : s.mount) s.mount.delete(c), s.array.delete(c), o.keepValue || (U(r, c), U(a, c)), !o.keepError && U(n.errors, c), !o.keepDirty && U(n.dirtyFields, c), !o.keepTouched && U(n.touchedFields, c), !o.keepIsValidating && U(n.validatingFields, c), !t.shouldUnregister && !o.keepDefaultValue && U(i, c);
|
|
823
|
+
g.state.next({ values: O(a) }), g.state.next({
|
|
611
824
|
...n,
|
|
612
|
-
...o.keepDirty ? { isDirty:
|
|
613
|
-
}), !o.keepIsValid &&
|
|
614
|
-
},
|
|
615
|
-
(
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
825
|
+
...o.keepDirty ? { isDirty: H() } : {}
|
|
826
|
+
}), !o.keepIsValid && y();
|
|
827
|
+
}, nt = ({ disabled: e, name: t }) => {
|
|
828
|
+
if (P(e) && o.mount || e || s.disabled.has(t)) {
|
|
829
|
+
let n = s.disabled.has(t) !== !!e;
|
|
830
|
+
e ? s.disabled.add(t) : s.disabled.delete(t), n && o.mount && !o.action && y();
|
|
831
|
+
}
|
|
832
|
+
}, X = (e, n = {}) => {
|
|
833
|
+
let a = N(r, e), c = P(n.disabled) || P(t.disabled), l = !s.registerName.has(e) && a && a._f && !a._f.mount;
|
|
834
|
+
return I(r, e, {
|
|
619
835
|
...a || {},
|
|
620
836
|
_f: {
|
|
621
837
|
...a && a._f ? a._f : { ref: { name: e } },
|
|
@@ -623,90 +839,95 @@ function He(e = {}) {
|
|
|
623
839
|
mount: !0,
|
|
624
840
|
...n
|
|
625
841
|
}
|
|
626
|
-
}), s.mount.add(e), a ?
|
|
627
|
-
|
|
628
|
-
disabled: M(n.disabled) ? n.disabled : t.disabled,
|
|
842
|
+
}), s.mount.add(e), a && !l ? nt({
|
|
843
|
+
disabled: P(n.disabled) ? n.disabled : t.disabled,
|
|
629
844
|
name: e
|
|
630
|
-
}) :
|
|
845
|
+
}) : ce(e, !0, n.value), {
|
|
631
846
|
...c ? { disabled: n.disabled || t.disabled } : {},
|
|
632
847
|
...t.progressive ? {
|
|
633
848
|
required: !!n.required,
|
|
634
|
-
min:
|
|
635
|
-
max:
|
|
636
|
-
minLength:
|
|
637
|
-
maxLength:
|
|
638
|
-
pattern:
|
|
849
|
+
min: Fe(n.min),
|
|
850
|
+
max: Fe(n.max),
|
|
851
|
+
minLength: Fe(n.minLength),
|
|
852
|
+
maxLength: Fe(n.maxLength),
|
|
853
|
+
pattern: Fe(n.pattern)
|
|
639
854
|
} : {},
|
|
640
855
|
name: e,
|
|
641
|
-
onChange:
|
|
642
|
-
onBlur:
|
|
856
|
+
onChange: je,
|
|
857
|
+
onBlur: je,
|
|
643
858
|
ref: (c) => {
|
|
644
859
|
if (c) {
|
|
645
|
-
|
|
646
|
-
let t =
|
|
647
|
-
if (o ?
|
|
648
|
-
|
|
860
|
+
s.registerName.add(e), X(e, n), s.registerName.delete(e), a = N(r, e);
|
|
861
|
+
let t = M(c.value) && c.querySelectorAll && c.querySelectorAll("input,select,textarea")[0] || c, o = xe(t), l = a._f.refs || [];
|
|
862
|
+
if (o ? l.find((e) => e === t) : t === a._f.ref) return;
|
|
863
|
+
I(r, e, { _f: {
|
|
649
864
|
...a._f,
|
|
650
865
|
...o ? {
|
|
651
866
|
refs: [
|
|
652
|
-
...
|
|
867
|
+
...l.filter(Se),
|
|
653
868
|
t,
|
|
654
|
-
...Array.isArray(
|
|
869
|
+
...Array.isArray(N(i, e)) ? [{}] : []
|
|
655
870
|
],
|
|
656
871
|
ref: {
|
|
657
872
|
type: t.type,
|
|
658
873
|
name: e
|
|
659
874
|
}
|
|
660
875
|
} : { ref: t }
|
|
661
|
-
} }),
|
|
662
|
-
} else a =
|
|
876
|
+
} }), ce(e, !1, void 0, t);
|
|
877
|
+
} else a = N(r, e, {}), a._f && (a._f.mount = !1), (t.shouldUnregister || n.shouldUnregister) && !(T(s.array, e) && o.action) && s.unMount.add(e);
|
|
663
878
|
}
|
|
664
879
|
};
|
|
665
|
-
},
|
|
666
|
-
|
|
667
|
-
let i =
|
|
880
|
+
}, rt = () => t.shouldFocusError && !t.shouldUseNativeValidation && Ve(r, Me, s.mount), it = (e) => {
|
|
881
|
+
P(e) && (g.state.next({ disabled: e }), Ve(r, (t, n) => {
|
|
882
|
+
let i = N(r, n);
|
|
668
883
|
i && (t.disabled = i._f.disabled || e, Array.isArray(i._f.refs) && i._f.refs.forEach((t) => {
|
|
669
884
|
t.disabled = i._f.disabled || e;
|
|
670
885
|
}));
|
|
671
886
|
}, 0, !1));
|
|
672
|
-
},
|
|
887
|
+
}, at = (e, i) => async (o) => {
|
|
673
888
|
let c;
|
|
674
889
|
o && (o.preventDefault && o.preventDefault(), o.persist && o.persist());
|
|
675
|
-
let l =
|
|
676
|
-
if (
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
890
|
+
let l = O(a);
|
|
891
|
+
if (g.state.next({ isSubmitting: !0 }), t.resolver) {
|
|
892
|
+
let { errors: e, values: t } = await R();
|
|
893
|
+
C(), n.errors = e, l = O(t);
|
|
894
|
+
} else await V({
|
|
895
|
+
fields: r,
|
|
896
|
+
eventType: k.SUBMIT
|
|
897
|
+
});
|
|
898
|
+
if (s.disabled.size) for (let e of s.disabled) U(l, e);
|
|
899
|
+
if (U(n.errors, te), B(n.errors)) {
|
|
900
|
+
g.state.next({ errors: {} });
|
|
683
901
|
try {
|
|
684
902
|
await e(l, o);
|
|
685
903
|
} catch (e) {
|
|
686
904
|
c = e;
|
|
687
905
|
}
|
|
688
|
-
} else i && await i({ ...n.errors }, o),
|
|
689
|
-
if (
|
|
906
|
+
} else i && await i({ ...n.errors }, o), rt(), setTimeout(rt);
|
|
907
|
+
if (g.state.next({
|
|
690
908
|
isSubmitted: !0,
|
|
691
909
|
isSubmitting: !1,
|
|
692
|
-
isSubmitSuccessful:
|
|
910
|
+
isSubmitSuccessful: B(n.errors) && !c,
|
|
693
911
|
submitCount: n.submitCount + 1,
|
|
694
912
|
errors: n.errors
|
|
695
913
|
}), c) throw c;
|
|
696
|
-
},
|
|
697
|
-
|
|
698
|
-
},
|
|
699
|
-
let l = e ?
|
|
914
|
+
}, ot = (e, t = {}) => {
|
|
915
|
+
N(r, e) && (M(t.defaultValue) ? G(e, O(N(i, e))) : (G(e, t.defaultValue), I(i, e, O(t.defaultValue))), t.keepTouched || U(n.touchedFields, e), t.keepDirty || (U(n.dirtyFields, e), n.isDirty = t.defaultValue ? H(e, O(N(i, e))) : H()), t.keepError || (U(n.errors, e), m.isValid && y()), g.state.next({ ...n }));
|
|
916
|
+
}, st = (e, c = {}) => {
|
|
917
|
+
let l = e ? O(e) : i, u = O(l), d = B(e), f = u;
|
|
700
918
|
if (c.keepDefaultValues || (i = l), !c.keepValues) {
|
|
701
919
|
if (c.keepDirtyValues) {
|
|
702
|
-
let e = new Set([...s.mount, ...Object.keys(
|
|
703
|
-
for (let t of Array.from(e))
|
|
920
|
+
let e = /* @__PURE__ */ new Set([...s.mount, ...Object.keys(W(i, a))]);
|
|
921
|
+
for (let t of Array.from(e)) {
|
|
922
|
+
let e = N(n.dirtyFields, t), r = N(a, t), i = N(f, t);
|
|
923
|
+
e && !M(r) ? I(f, t, r) : !e && !M(i) && G(t, i);
|
|
924
|
+
}
|
|
704
925
|
} else {
|
|
705
|
-
if (
|
|
706
|
-
let t =
|
|
926
|
+
if (D && M(e)) for (let e of s.mount) {
|
|
927
|
+
let t = N(r, e);
|
|
707
928
|
if (t && t._f) {
|
|
708
929
|
let e = Array.isArray(t._f.refs) ? t._f.refs[0] : t._f.ref;
|
|
709
|
-
if (
|
|
930
|
+
if (ye(e)) {
|
|
710
931
|
let t = e.closest("form");
|
|
711
932
|
if (t) {
|
|
712
933
|
t.reset();
|
|
@@ -715,58 +936,76 @@ function He(e = {}) {
|
|
|
715
936
|
}
|
|
716
937
|
}
|
|
717
938
|
}
|
|
718
|
-
|
|
939
|
+
if (c.keepFieldsRef) for (let e of s.mount) G(e, N(f, e));
|
|
940
|
+
else r = {};
|
|
719
941
|
}
|
|
720
|
-
|
|
942
|
+
if (t.shouldUnregister) {
|
|
943
|
+
if (a = c.keepDefaultValues ? O(i) : {}, c.keepFieldsRef) for (let e of s.mount) I(a, e, N(f, e));
|
|
944
|
+
} else a = O(f);
|
|
945
|
+
g.array.next({ values: { ...f } }), g.state.next({ values: { ...f } });
|
|
721
946
|
}
|
|
722
947
|
s = {
|
|
723
948
|
mount: c.keepDirtyValues ? s.mount : /* @__PURE__ */ new Set(),
|
|
724
949
|
unMount: /* @__PURE__ */ new Set(),
|
|
725
950
|
array: /* @__PURE__ */ new Set(),
|
|
951
|
+
registerName: /* @__PURE__ */ new Set(),
|
|
726
952
|
disabled: /* @__PURE__ */ new Set(),
|
|
727
953
|
watch: /* @__PURE__ */ new Set(),
|
|
728
954
|
watchAll: !1,
|
|
729
955
|
focus: ""
|
|
730
|
-
}, o.mount = !
|
|
956
|
+
}, o.mount = !m.isValid || !!c.keepIsValid || !!c.keepDirtyValues || !t.shouldUnregister && !B(f), o.watch = !!t.shouldUnregister, o.keepIsValid = !!c.keepIsValid, o.action = !1, c.keepErrors || (n.errors = {}), g.state.next({
|
|
731
957
|
submitCount: c.keepSubmitCount ? n.submitCount : 0,
|
|
732
|
-
isDirty:
|
|
958
|
+
isDirty: d ? !1 : c.keepDirty ? n.isDirty : c.keepValues ? H() : !!(c.keepDefaultValues && !z(e, i)),
|
|
733
959
|
isSubmitted: c.keepIsSubmitted ? n.isSubmitted : !1,
|
|
734
|
-
dirtyFields:
|
|
960
|
+
dirtyFields: d ? {} : c.keepDirtyValues ? c.keepDefaultValues && a ? W(i, a) : n.dirtyFields : c.keepDefaultValues && e ? W(i, e) : c.keepDirty ? n.dirtyFields : {},
|
|
735
961
|
touchedFields: c.keepTouched ? n.touchedFields : {},
|
|
736
962
|
errors: c.keepErrors ? n.errors : {},
|
|
737
963
|
isSubmitSuccessful: c.keepIsSubmitSuccessful ? n.isSubmitSuccessful : !1,
|
|
738
|
-
isSubmitting: !1
|
|
964
|
+
isSubmitting: !1,
|
|
965
|
+
defaultValues: i
|
|
739
966
|
});
|
|
740
|
-
},
|
|
741
|
-
|
|
967
|
+
}, ct = (e, n) => st(F(e) ? e(a) : e, {
|
|
968
|
+
...t.resetOptions,
|
|
969
|
+
...n
|
|
970
|
+
}), Z = (e, t = {}) => {
|
|
971
|
+
let n = N(r, e), i = n && n._f;
|
|
972
|
+
if (i) {
|
|
973
|
+
let e = i.refs ? i.refs[0] : i.ref;
|
|
974
|
+
e.focus && setTimeout(() => {
|
|
975
|
+
e.focus(), t.shouldSelect && F(e.select) && e.select();
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
}, lt = (e) => {
|
|
979
|
+
n = {
|
|
980
|
+
...n,
|
|
981
|
+
...e
|
|
982
|
+
};
|
|
983
|
+
}, ut = {
|
|
742
984
|
control: {
|
|
743
|
-
register:
|
|
744
|
-
unregister:
|
|
745
|
-
getFieldState:
|
|
746
|
-
handleSubmit:
|
|
747
|
-
setError:
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
985
|
+
register: X,
|
|
986
|
+
unregister: Y,
|
|
987
|
+
getFieldState: Je,
|
|
988
|
+
handleSubmit: at,
|
|
989
|
+
setError: $e,
|
|
990
|
+
_subscribe: tt,
|
|
991
|
+
_runSchema: R,
|
|
992
|
+
_updateIsValidating: C,
|
|
993
|
+
_focusError: rt,
|
|
994
|
+
_getWatch: we,
|
|
995
|
+
_getDirty: H,
|
|
996
|
+
_setValid: y,
|
|
997
|
+
_setFieldArray: ne,
|
|
998
|
+
_setDisabledField: nt,
|
|
999
|
+
_setErrors: ae,
|
|
1000
|
+
_getFieldArray: Te,
|
|
1001
|
+
_reset: st,
|
|
1002
|
+
_resetDefaultValues: () => F(t.defaultValues) && t.defaultValues().then((e) => {
|
|
1003
|
+
ct(e, t.resetOptions), g.state.next({ isLoading: !1 });
|
|
759
1004
|
}),
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
};
|
|
765
|
-
},
|
|
766
|
-
_disableForm: Fe,
|
|
767
|
-
_subjects: d,
|
|
768
|
-
_proxyFormState: u,
|
|
769
|
-
_setErrors: C,
|
|
1005
|
+
_removeUnmounted: Ce,
|
|
1006
|
+
_disableForm: it,
|
|
1007
|
+
_subjects: g,
|
|
1008
|
+
_proxyFormState: m,
|
|
770
1009
|
get _fields() {
|
|
771
1010
|
return r;
|
|
772
1011
|
},
|
|
@@ -791,9 +1030,6 @@ function He(e = {}) {
|
|
|
791
1030
|
get _formState() {
|
|
792
1031
|
return n;
|
|
793
1032
|
},
|
|
794
|
-
set _formState(e) {
|
|
795
|
-
n = e;
|
|
796
|
-
},
|
|
797
1033
|
get _options() {
|
|
798
1034
|
return t;
|
|
799
1035
|
},
|
|
@@ -801,76 +1037,101 @@ function He(e = {}) {
|
|
|
801
1037
|
t = {
|
|
802
1038
|
...t,
|
|
803
1039
|
...e
|
|
804
|
-
};
|
|
1040
|
+
}, d = Ie(t.mode), f = Ie(t.reValidateMode);
|
|
805
1041
|
}
|
|
806
1042
|
},
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
let e = i.refs ? i.refs[0] : i.ref;
|
|
822
|
-
e.focus && (e.focus(), t.shouldSelect && V(e.select) && e.select());
|
|
1043
|
+
subscribe: J,
|
|
1044
|
+
trigger: K,
|
|
1045
|
+
register: X,
|
|
1046
|
+
handleSubmit: at,
|
|
1047
|
+
watch: et,
|
|
1048
|
+
setValue: G,
|
|
1049
|
+
setValues: ke,
|
|
1050
|
+
getValues: Le,
|
|
1051
|
+
reset: ct,
|
|
1052
|
+
resetField: ot,
|
|
1053
|
+
resetDefaultValues: (e, t = {}) => {
|
|
1054
|
+
if (i = O(e), !t.keepDirty) {
|
|
1055
|
+
let e = W(i, a);
|
|
1056
|
+
n.dirtyFields = e, n.isDirty = !B(e);
|
|
823
1057
|
}
|
|
1058
|
+
t.keepIsValid || y(), g.state.next({
|
|
1059
|
+
...n,
|
|
1060
|
+
defaultValues: i
|
|
1061
|
+
});
|
|
824
1062
|
},
|
|
825
|
-
|
|
1063
|
+
clearErrors: q,
|
|
1064
|
+
unregister: Y,
|
|
1065
|
+
setError: $e,
|
|
1066
|
+
setFocus: Z,
|
|
1067
|
+
getFieldState: Je
|
|
1068
|
+
};
|
|
1069
|
+
return {
|
|
1070
|
+
...ut,
|
|
1071
|
+
formControl: ut
|
|
826
1072
|
};
|
|
827
1073
|
}
|
|
828
|
-
function
|
|
829
|
-
let t = r.useRef(void 0), n = r.useRef(void 0),
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
isLoading: V(e.defaultValues),
|
|
833
|
-
isSubmitted: !1,
|
|
834
|
-
isSubmitting: !1,
|
|
835
|
-
isSubmitSuccessful: !1,
|
|
836
|
-
isValid: !1,
|
|
837
|
-
submitCount: 0,
|
|
838
|
-
dirtyFields: {},
|
|
839
|
-
touchedFields: {},
|
|
840
|
-
validatingFields: {},
|
|
1074
|
+
function et(e = {}) {
|
|
1075
|
+
let t = r.useRef(void 0), n = r.useRef(void 0), i = r.useRef(e.formControl), [a, o] = r.useState(() => ({
|
|
1076
|
+
...O(Qe),
|
|
1077
|
+
isLoading: F(e.defaultValues),
|
|
841
1078
|
errors: e.errors || {},
|
|
842
1079
|
disabled: e.disabled || !1,
|
|
843
|
-
defaultValues:
|
|
844
|
-
});
|
|
845
|
-
t.current
|
|
846
|
-
...
|
|
847
|
-
formState:
|
|
848
|
-
};
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
1080
|
+
defaultValues: F(e.defaultValues) ? void 0 : e.defaultValues
|
|
1081
|
+
}));
|
|
1082
|
+
if (!t.current || e.formControl && i.current !== e.formControl) if (i.current = e.formControl, e.formControl) t.current = {
|
|
1083
|
+
...e.formControl,
|
|
1084
|
+
formState: a
|
|
1085
|
+
}, e.defaultValues && !F(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
|
|
1086
|
+
else {
|
|
1087
|
+
let { formControl: n, ...r } = $e(e);
|
|
1088
|
+
t.current = {
|
|
1089
|
+
...r,
|
|
1090
|
+
formState: a
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
let s = t.current.control;
|
|
1094
|
+
return s._options = e, le(() => {
|
|
1095
|
+
let e = s._subscribe({
|
|
1096
|
+
formState: s._proxyFormState,
|
|
1097
|
+
callback: () => o({
|
|
1098
|
+
...s._formState,
|
|
1099
|
+
defaultValues: s._defaultValues
|
|
1100
|
+
}),
|
|
1101
|
+
reRenderRoot: !0
|
|
1102
|
+
});
|
|
1103
|
+
return o((e) => ({
|
|
1104
|
+
...e,
|
|
1105
|
+
isReady: !0
|
|
1106
|
+
})), s._formState.isReady = !0, e;
|
|
1107
|
+
}, [s]), r.useEffect(() => s._disableForm(e.disabled), [s, e.disabled]), r.useEffect(() => {
|
|
1108
|
+
e.mode && (s._options.mode = e.mode), e.reValidateMode && (s._options.reValidateMode = e.reValidateMode);
|
|
1109
|
+
}, [
|
|
1110
|
+
s,
|
|
1111
|
+
e.mode,
|
|
1112
|
+
e.reValidateMode
|
|
1113
|
+
]), r.useEffect(() => {
|
|
1114
|
+
e.errors && (s._setErrors(e.errors), s._focusError());
|
|
1115
|
+
}, [s, e.errors]), r.useEffect(() => {
|
|
1116
|
+
e.shouldUnregister && s._subjects.state.next({ values: s._getWatch() });
|
|
1117
|
+
}, [s, e.shouldUnregister]), r.useEffect(() => {
|
|
1118
|
+
if (s._proxyFormState.isDirty) {
|
|
1119
|
+
let e = s._getDirty();
|
|
1120
|
+
e !== a.isDirty && s._subjects.state.next({ isDirty: e });
|
|
859
1121
|
}
|
|
860
|
-
}, [
|
|
861
|
-
e.values && !
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
}, [e.shouldUnregister, o]), t.current.formState = L(i, o), t.current;
|
|
1122
|
+
}, [s, a.isDirty]), r.useEffect(() => {
|
|
1123
|
+
e.values && !z(e.values, n.current) ? (s._reset(e.values, {
|
|
1124
|
+
keepFieldsRef: !0,
|
|
1125
|
+
...s._options.resetOptions
|
|
1126
|
+
}), s._options.resetOptions?.keepIsValid || s._setValid(), n.current = e.values, o((e) => ({ ...e }))) : s._resetDefaultValues();
|
|
1127
|
+
}, [s, e.values]), r.useEffect(() => {
|
|
1128
|
+
s._state.mount || (s._setValid(), s._state.mount = !0), s._state.watch && (s._state.watch = !1, s._subjects.state.next({ ...s._formState })), s._removeUnmounted();
|
|
1129
|
+
}), t.current.formState = r.useMemo(() => ce(a, s), [s, a]), t.current;
|
|
869
1130
|
}
|
|
870
1131
|
//#endregion
|
|
871
1132
|
//#region src/Form/useForm.tsx
|
|
872
|
-
var
|
|
873
|
-
let [n, r] = p(), i =
|
|
1133
|
+
var tt = () => {
|
|
1134
|
+
let [n, r] = p(), i = et({ reValidateMode: "onChange" }), a = (e, t) => {
|
|
874
1135
|
let n = i.register(e, t), a = (t) => (r(null), i.clearErrors(e), n.onChange(t)), o = i?.formState.errors, s = i.watch(e);
|
|
875
1136
|
return {
|
|
876
1137
|
...n,
|
|
@@ -890,62 +1151,66 @@ var We = () => {
|
|
|
890
1151
|
GlobalError: s,
|
|
891
1152
|
setErrors: o
|
|
892
1153
|
};
|
|
893
|
-
},
|
|
1154
|
+
}, J = {
|
|
894
1155
|
container: "style-module__container__JyG0-",
|
|
895
1156
|
"loading-container": "style-module__loading-container__sphNQ",
|
|
896
1157
|
hidden: "style-module__hidden__jvJWI",
|
|
897
|
-
element: "style-module__element__Ex50N",
|
|
898
1158
|
disabled: "style-module__disabled__p40Jo",
|
|
1159
|
+
error: "style-module__error__pSghy",
|
|
899
1160
|
placeholder: "style-module__placeholder__c-V0V",
|
|
900
|
-
|
|
901
|
-
},
|
|
1161
|
+
element: "style-module__element__Ex50N"
|
|
1162
|
+
}, Y = {
|
|
902
1163
|
loading: "style-module__loading__r9fwC",
|
|
903
1164
|
dot: "style-module__dot__mMqu2",
|
|
904
1165
|
bounce: "style-module__bounce__ikJLW",
|
|
905
1166
|
light: "style-module__light__Kubs1",
|
|
906
1167
|
secondary: "style-module__secondary__EkNcU",
|
|
907
1168
|
"secondary-light": "style-module__secondary-light__cJeWY"
|
|
908
|
-
},
|
|
1169
|
+
}, nt = ({ color: e = "primary", ...r }) => {
|
|
909
1170
|
let i = ["ui-loading"];
|
|
910
|
-
return i.push(
|
|
1171
|
+
return i.push(Y.loading), e && i.push(Y[e], "ui-loading-" + e), /* @__PURE__ */ n("div", {
|
|
911
1172
|
...r,
|
|
912
1173
|
className: i.join(" "),
|
|
913
1174
|
children: [
|
|
914
|
-
/* @__PURE__ */ t("div", { className:
|
|
915
|
-
/* @__PURE__ */ t("div", { className:
|
|
916
|
-
/* @__PURE__ */ t("div", { className:
|
|
917
|
-
/* @__PURE__ */ t("div", { className:
|
|
1175
|
+
/* @__PURE__ */ t("div", { className: Y.dot }),
|
|
1176
|
+
/* @__PURE__ */ t("div", { className: Y.dot }),
|
|
1177
|
+
/* @__PURE__ */ t("div", { className: Y.dot }),
|
|
1178
|
+
/* @__PURE__ */ t("div", { className: Y.dot })
|
|
918
1179
|
]
|
|
919
1180
|
});
|
|
920
|
-
}, X = ({ children: r, beforeElement: a, afterElement: o, error: s, placeholder: c, styleContainer: u, classNameContainer:
|
|
921
|
-
let [
|
|
922
|
-
l(() => {
|
|
923
|
-
|
|
924
|
-
}, [s])
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
1181
|
+
}, X = ({ children: r, beforeElement: a, afterElement: o, error: s, placeholder: c, styleContainer: u, classNameContainer: f, hiddenContainer: m, formvalue: h, wait: g, ..._ }) => {
|
|
1182
|
+
let [v, y] = p("");
|
|
1183
|
+
return l(() => {
|
|
1184
|
+
y(s ?? "");
|
|
1185
|
+
}, [s]), /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("label", {
|
|
1186
|
+
className: d(() => {
|
|
1187
|
+
let e = ["ui-form-element-container"];
|
|
1188
|
+
return e.push(J.container), v && e.push(J.error), _.disabled && e.push(J.disabled), m && e.push(J.hidden), f && e.push(f), e.join(" ");
|
|
1189
|
+
}, [
|
|
1190
|
+
v,
|
|
1191
|
+
_.disabled,
|
|
1192
|
+
m,
|
|
1193
|
+
f
|
|
1194
|
+
]),
|
|
928
1195
|
style: u,
|
|
929
|
-
children:
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
className: "ui-form-error " + Y.error,
|
|
946
|
-
children: _
|
|
1196
|
+
children: /* @__PURE__ */ n("div", {
|
|
1197
|
+
className: "ui-form-element " + J.element,
|
|
1198
|
+
children: [
|
|
1199
|
+
a ? i(a, { key: "ui-before-element" }) : null,
|
|
1200
|
+
typeof r == "function" ? r(_) : null,
|
|
1201
|
+
c && g ? "" : /* @__PURE__ */ t("span", {
|
|
1202
|
+
className: "ui-form-element-placeholder " + J.placeholder,
|
|
1203
|
+
children: c
|
|
1204
|
+
}),
|
|
1205
|
+
g && /* @__PURE__ */ t(nt, {}),
|
|
1206
|
+
o ? i(o, { key: "ui-after-element" }) : null
|
|
1207
|
+
]
|
|
1208
|
+
})
|
|
1209
|
+
}), v && /* @__PURE__ */ t("div", {
|
|
1210
|
+
className: "ui-form-error " + J.error,
|
|
1211
|
+
children: v
|
|
947
1212
|
})] });
|
|
948
|
-
},
|
|
1213
|
+
}, rt = y, it = o(({ onChange: e, onInput: n, onChangeText: r, wait: i, disabled: a, formvalue: o, children: s, ...c }, u) => {
|
|
949
1214
|
let [d, f] = p(""), m = (t) => {
|
|
950
1215
|
typeof e == "function" && e(t), typeof r == "function" && r(t.target.value);
|
|
951
1216
|
}, h = (e) => {
|
|
@@ -967,7 +1232,7 @@ var We = () => {
|
|
|
967
1232
|
ref: u
|
|
968
1233
|
})
|
|
969
1234
|
});
|
|
970
|
-
}),
|
|
1235
|
+
}), at = o(({ onChange: e, onInput: n, onChangeText: r, formvalue: i, wait: a, ...o }, s) => {
|
|
971
1236
|
let c = f(null), [d, m] = p(o.value ?? i ?? ""), h = (t) => {
|
|
972
1237
|
typeof e == "function" && e(t), typeof r == "function" && r(t.target.value);
|
|
973
1238
|
}, g = (e) => {
|
|
@@ -997,13 +1262,13 @@ var We = () => {
|
|
|
997
1262
|
ref: c
|
|
998
1263
|
})
|
|
999
1264
|
});
|
|
1000
|
-
}),
|
|
1265
|
+
}), ot = {
|
|
1001
1266
|
"file-btn": "style-module__file-btn__WajPw",
|
|
1002
1267
|
icon: "style-module__icon__f1VPN"
|
|
1003
|
-
},
|
|
1268
|
+
}, st = ({ onChange: r, onChangeFiles: i, accept: a, multiple: o, wait: c, children: l, className: u, icon: d, ...p }) => {
|
|
1004
1269
|
let m = f(null), h = `
|
|
1005
|
-
${
|
|
1006
|
-
${d && !c ?
|
|
1270
|
+
${ot["file-btn"]}
|
|
1271
|
+
${d && !c ? ot.icon : ""}
|
|
1007
1272
|
`.trim(), g = s((e) => {
|
|
1008
1273
|
let t = e.target.files;
|
|
1009
1274
|
typeof r == "function" && r(e), typeof i == "function" && i(t);
|
|
@@ -1024,7 +1289,7 @@ var We = () => {
|
|
|
1024
1289
|
children: !c && (l || "Выбрать файл")
|
|
1025
1290
|
})] })
|
|
1026
1291
|
});
|
|
1027
|
-
},
|
|
1292
|
+
}, ct = ({ onChange: e, children: n, multiple: r, accept: i, ...a }) => {
|
|
1028
1293
|
let o = f(null), s = (t) => {
|
|
1029
1294
|
let n = t.target;
|
|
1030
1295
|
if (n.files) for (let t of n.files) {
|
|
@@ -1069,7 +1334,7 @@ var We = () => {
|
|
|
1069
1334
|
"normal-btn": "style-module__normal-btn__qHevU",
|
|
1070
1335
|
"small-btn": "style-module__small-btn__Axtvq",
|
|
1071
1336
|
"large-btn": "style-module__large-btn__X3--3"
|
|
1072
|
-
},
|
|
1337
|
+
}, lt = ({ children: e, className: r, classNameContainer: i, styleContainer: a, wait: o = !1, variant: s, size: c = "normal", icon: l, ...u }) => {
|
|
1073
1338
|
let d = `
|
|
1074
1339
|
${Z.btn}
|
|
1075
1340
|
${s && Z[`btn-${s}`]}
|
|
@@ -1086,16 +1351,16 @@ var We = () => {
|
|
|
1086
1351
|
children: !o && e
|
|
1087
1352
|
}), o && /* @__PURE__ */ t("div", {
|
|
1088
1353
|
className: "ui-button-spinner " + Z["wait-indicator"] + (o ? " " + Z.active : ""),
|
|
1089
|
-
children: /* @__PURE__ */ t(
|
|
1354
|
+
children: /* @__PURE__ */ t(nt, { color: s })
|
|
1090
1355
|
})]
|
|
1091
1356
|
});
|
|
1092
|
-
},
|
|
1357
|
+
}, ut = {
|
|
1093
1358
|
container: "style-module__container__Qt7Ix",
|
|
1094
1359
|
image: "style-module__image__1qdut",
|
|
1095
1360
|
new: "style-module__new__fOnXf",
|
|
1096
1361
|
close: "style-module__close__9k-p1",
|
|
1097
1362
|
wait: "style-module__wait__qnGnj"
|
|
1098
|
-
},
|
|
1363
|
+
}, dt = ({ onChange: e, onClick: r, onId: i, onRemove: a, ...o }) => {
|
|
1099
1364
|
let { base64: s, src: c } = o, [u, d] = p(!0), m = f(!1), h = f(), _ = (e) => {
|
|
1100
1365
|
h.current = e, typeof i == "function" && i(e);
|
|
1101
1366
|
};
|
|
@@ -1107,7 +1372,7 @@ var We = () => {
|
|
|
1107
1372
|
id: h.current
|
|
1108
1373
|
});
|
|
1109
1374
|
}, []), /* @__PURE__ */ n("span", {
|
|
1110
|
-
className:
|
|
1375
|
+
className: ut.image,
|
|
1111
1376
|
onClick: () => {
|
|
1112
1377
|
typeof r == "function" && r({
|
|
1113
1378
|
...o,
|
|
@@ -1118,7 +1383,7 @@ var We = () => {
|
|
|
1118
1383
|
},
|
|
1119
1384
|
children: [
|
|
1120
1385
|
/* @__PURE__ */ t("span", {
|
|
1121
|
-
className:
|
|
1386
|
+
className: ut.close,
|
|
1122
1387
|
onClick: (e) => {
|
|
1123
1388
|
if (!e.target) return;
|
|
1124
1389
|
let t = e.target;
|
|
@@ -1136,12 +1401,12 @@ var We = () => {
|
|
|
1136
1401
|
}
|
|
1137
1402
|
}),
|
|
1138
1403
|
u && /* @__PURE__ */ t("span", {
|
|
1139
|
-
className:
|
|
1404
|
+
className: ut.wait,
|
|
1140
1405
|
children: /* @__PURE__ */ t(g, {})
|
|
1141
1406
|
})
|
|
1142
1407
|
]
|
|
1143
1408
|
});
|
|
1144
|
-
},
|
|
1409
|
+
}, ft = ({ imagesArray: e, onChange: r, onChangeArray: i, onClick: a }) => {
|
|
1145
1410
|
let [o, s] = p([]), c = (e) => {
|
|
1146
1411
|
s((t) => [...t, { ...e }]);
|
|
1147
1412
|
}, u = (e) => (t) => {
|
|
@@ -1152,25 +1417,25 @@ var We = () => {
|
|
|
1152
1417
|
}, [o]), l(() => {
|
|
1153
1418
|
e && s(e);
|
|
1154
1419
|
}, [e]), /* @__PURE__ */ n("div", {
|
|
1155
|
-
className:
|
|
1156
|
-
children: [o.map((e, n) => /* @__PURE__ */ t(
|
|
1420
|
+
className: ut.container,
|
|
1421
|
+
children: [o.map((e, n) => /* @__PURE__ */ t(dt, {
|
|
1157
1422
|
...e,
|
|
1158
1423
|
onChange: r,
|
|
1159
1424
|
onClick: a,
|
|
1160
1425
|
onRemove: d(e),
|
|
1161
1426
|
onId: u(e)
|
|
1162
|
-
}, e.name + n)), /* @__PURE__ */ t(
|
|
1427
|
+
}, e.name + n)), /* @__PURE__ */ t(ct, {
|
|
1163
1428
|
onChange: c,
|
|
1164
1429
|
accept: ["image/png"],
|
|
1165
|
-
className:
|
|
1430
|
+
className: ut.new,
|
|
1166
1431
|
multiple: !0
|
|
1167
1432
|
})]
|
|
1168
1433
|
});
|
|
1169
|
-
},
|
|
1434
|
+
}, pt = {
|
|
1170
1435
|
container: "style-module__container__tUkU0",
|
|
1171
1436
|
text: "style-module__text__5dksK",
|
|
1172
1437
|
indicator: "style-module__indicator__BdmZs"
|
|
1173
|
-
},
|
|
1438
|
+
}, mt = o(({ type: e = "checkbox", hiddenContainer: r = !0, placeholder: i, onChecked: a, onChange: o, ...s }, c) => {
|
|
1174
1439
|
let l = (e) => {
|
|
1175
1440
|
typeof o == "function" && o(e), typeof a == "function" && a(e.target.checked, s.value);
|
|
1176
1441
|
};
|
|
@@ -1178,7 +1443,7 @@ var We = () => {
|
|
|
1178
1443
|
...s,
|
|
1179
1444
|
hiddenContainer: r,
|
|
1180
1445
|
children: (r) => /* @__PURE__ */ n("div", {
|
|
1181
|
-
className: "ui-checkbox-container " +
|
|
1446
|
+
className: "ui-checkbox-container " + pt.container,
|
|
1182
1447
|
children: [
|
|
1183
1448
|
/* @__PURE__ */ t("input", {
|
|
1184
1449
|
...r,
|
|
@@ -1187,23 +1452,23 @@ var We = () => {
|
|
|
1187
1452
|
onChange: l,
|
|
1188
1453
|
ref: c
|
|
1189
1454
|
}),
|
|
1190
|
-
/* @__PURE__ */ t("span", { className: "ui-checkbox-indicator " +
|
|
1455
|
+
/* @__PURE__ */ t("span", { className: "ui-checkbox-indicator " + pt.indicator }),
|
|
1191
1456
|
/* @__PURE__ */ t("span", {
|
|
1192
|
-
className: "ui-checkbox-text " +
|
|
1457
|
+
className: "ui-checkbox-text " + pt.text,
|
|
1193
1458
|
children: i
|
|
1194
1459
|
})
|
|
1195
1460
|
]
|
|
1196
1461
|
})
|
|
1197
1462
|
});
|
|
1198
|
-
}),
|
|
1463
|
+
}), ht = {
|
|
1199
1464
|
container: "style-module__container__nvLZo",
|
|
1200
1465
|
down: "style-module__down__0mCw1",
|
|
1201
1466
|
up: "style-module__up__4e9Cz",
|
|
1202
1467
|
left: "style-module__left__tsvvk",
|
|
1203
1468
|
right: "style-module__right__-YgfC"
|
|
1204
|
-
},
|
|
1469
|
+
}, gt = ({ className: e, direction: n = "down", ...r }) => {
|
|
1205
1470
|
let i = ["ui-component-arrow"];
|
|
1206
|
-
return i.push(
|
|
1471
|
+
return i.push(ht.container), n && i.push(ht[n]), e && i.push(e), /* @__PURE__ */ t("div", {
|
|
1207
1472
|
...r,
|
|
1208
1473
|
className: i.join(" ")
|
|
1209
1474
|
});
|
|
@@ -1223,86 +1488,92 @@ var We = () => {
|
|
|
1223
1488
|
title: "style-module__title__x7nug",
|
|
1224
1489
|
active: "style-module__active__ORdtQ",
|
|
1225
1490
|
disabled: "style-module__disabled__xA0bc"
|
|
1226
|
-
},
|
|
1491
|
+
}, _t = "ui-", vt = (e, t, n) => {
|
|
1492
|
+
let r = _t + (n ? n + "-" : "");
|
|
1493
|
+
return Array.isArray(e) ? e.map(() => vt(e, t, r)).join(" ") : `${t[e]} ${r}${e}`;
|
|
1494
|
+
}, yt = a({
|
|
1227
1495
|
selected: "",
|
|
1228
1496
|
emptyValue: { current: {} },
|
|
1229
1497
|
setSelect: (e) => {},
|
|
1230
1498
|
setSelected: (e) => {},
|
|
1231
1499
|
setTitle: (e) => {}
|
|
1232
|
-
}),
|
|
1233
|
-
let c = f(null),
|
|
1234
|
-
o.disabled ||
|
|
1235
|
-
}, S = () => {
|
|
1236
|
-
g(!1);
|
|
1500
|
+
}), bt = o(({ children: e, onChangeSelect: r, value: i, formvalue: a, ...o }, s) => {
|
|
1501
|
+
let c = f(null), m = f(null), h = f(!1), [g, _] = p(!1), [v, y] = p(""), [b, x] = p(), S = () => {
|
|
1502
|
+
o.disabled || _(!0);
|
|
1237
1503
|
}, C = () => {
|
|
1238
|
-
|
|
1239
|
-
}, w = (
|
|
1240
|
-
(
|
|
1504
|
+
_(!1);
|
|
1505
|
+
}, w = () => {
|
|
1506
|
+
g ? C() : S();
|
|
1507
|
+
}, ee = (e) => {
|
|
1508
|
+
(Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set)?.call(m.current, e);
|
|
1241
1509
|
let t = new Event("input", { bubbles: !0 });
|
|
1242
|
-
|
|
1510
|
+
m.current.dispatchEvent(t);
|
|
1243
1511
|
}, T = (e) => {
|
|
1244
|
-
typeof r == "function" && r(e), i === void 0 &&
|
|
1512
|
+
typeof r == "function" && r(e), i === void 0 && y(e), C();
|
|
1245
1513
|
}, E = (e) => {
|
|
1246
|
-
o.disabled || (typeof o.onInput == "function" && o.onInput(e), typeof o.onChange == "function" && o.onChange(e),
|
|
1514
|
+
o.disabled || (typeof o.onInput == "function" && o.onInput(e), typeof o.onChange == "function" && o.onChange(e), y(e.target.value));
|
|
1247
1515
|
};
|
|
1248
1516
|
l(() => {
|
|
1249
|
-
|
|
1250
|
-
}, [
|
|
1251
|
-
|
|
1517
|
+
v && ee(v);
|
|
1518
|
+
}, [v]), l(() => {
|
|
1519
|
+
y(String(i ?? a));
|
|
1252
1520
|
}, [i, a]), l(() => {
|
|
1253
1521
|
let e = c.current, t = e.classList;
|
|
1254
|
-
|
|
1522
|
+
g ? (t.remove(Q.hidden), requestAnimationFrame(() => {
|
|
1255
1523
|
t.add(Q.opened), e?.focus();
|
|
1256
1524
|
})) : (t.contains(Q.opened) && (e.ontransitionend = () => {
|
|
1257
1525
|
t.add(Q.hidden), e.ontransitionend = null;
|
|
1258
1526
|
}), t.remove(Q.opened));
|
|
1259
|
-
}, [
|
|
1260
|
-
let
|
|
1261
|
-
|
|
1527
|
+
}, [g]), u(s, () => m.current, []);
|
|
1528
|
+
let D = d(() => {
|
|
1529
|
+
let e = [vt("container", Q, "select")];
|
|
1530
|
+
return e.push(Q.hidden), e;
|
|
1531
|
+
}, []);
|
|
1532
|
+
return /* @__PURE__ */ t(X, {
|
|
1262
1533
|
...o,
|
|
1263
|
-
classNameContainer:
|
|
1264
|
-
children: (r) => /* @__PURE__ */ n(
|
|
1534
|
+
classNameContainer: vt("container-element", Q, "select"),
|
|
1535
|
+
children: (r) => /* @__PURE__ */ n(yt.Provider, {
|
|
1265
1536
|
value: {
|
|
1266
|
-
selected:
|
|
1267
|
-
emptyValue:
|
|
1537
|
+
selected: v,
|
|
1538
|
+
emptyValue: h,
|
|
1268
1539
|
setSelect: T,
|
|
1269
|
-
setSelected:
|
|
1270
|
-
setTitle:
|
|
1540
|
+
setSelected: y,
|
|
1541
|
+
setTitle: x
|
|
1271
1542
|
},
|
|
1272
1543
|
children: [/* @__PURE__ */ t("input", {
|
|
1273
1544
|
...r,
|
|
1274
1545
|
type: "hidden",
|
|
1275
|
-
value:
|
|
1546
|
+
value: v,
|
|
1276
1547
|
onInput: E,
|
|
1277
|
-
ref:
|
|
1548
|
+
ref: m
|
|
1278
1549
|
}), /* @__PURE__ */ n("div", {
|
|
1279
|
-
className:
|
|
1550
|
+
className: D.join(" "),
|
|
1280
1551
|
ref: c,
|
|
1281
1552
|
tabIndex: 1,
|
|
1282
|
-
onBlur:
|
|
1553
|
+
onBlur: C,
|
|
1283
1554
|
children: [/* @__PURE__ */ n("div", {
|
|
1284
1555
|
className: Q.select,
|
|
1285
|
-
onClick:
|
|
1556
|
+
onClick: w,
|
|
1286
1557
|
children: [/* @__PURE__ */ t("span", {
|
|
1287
|
-
className:
|
|
1288
|
-
children:
|
|
1289
|
-
}), /* @__PURE__ */ t(
|
|
1558
|
+
className: vt("title", Q, "select"),
|
|
1559
|
+
children: b
|
|
1560
|
+
}), /* @__PURE__ */ t(gt, { className: vt("arrow", Q, "select") })]
|
|
1290
1561
|
}), /* @__PURE__ */ t("ul", {
|
|
1291
|
-
className:
|
|
1562
|
+
className: vt("select-list", Q, "select"),
|
|
1292
1563
|
children: e
|
|
1293
1564
|
})]
|
|
1294
1565
|
})]
|
|
1295
1566
|
})
|
|
1296
1567
|
});
|
|
1297
|
-
}),
|
|
1298
|
-
let s = c(
|
|
1568
|
+
}), xt = ({ children: e, value: n, disabled: r, hidden: i, onClick: a, ...o }) => {
|
|
1569
|
+
let s = c(yt), u = (e) => {
|
|
1299
1570
|
n === void 0 || r || (s.setSelect(n), typeof a == "function" && a(e));
|
|
1300
1571
|
};
|
|
1301
1572
|
if (l(() => {
|
|
1302
1573
|
e && (n === s.selected || !s.emptyValue.current) && (s.setTitle(e), !s.emptyValue.current && n && s.setSelected(n), s.emptyValue.current = !0);
|
|
1303
1574
|
}, [s.selected, s.emptyValue.current]), i) return null;
|
|
1304
1575
|
let f = d(() => {
|
|
1305
|
-
let e = ["ui-select-option"];
|
|
1576
|
+
let e = [vt("ui-select-option", Q, "select")];
|
|
1306
1577
|
return e.push(Q.option), s.selected === n && e.push(Q.active, "active"), r && e.push(Q.disabled, "disabled"), e;
|
|
1307
1578
|
}, [s.selected, r]);
|
|
1308
1579
|
return /* @__PURE__ */ t("li", {
|
|
@@ -1311,19 +1582,19 @@ var We = () => {
|
|
|
1311
1582
|
className: f.join(" "),
|
|
1312
1583
|
children: e
|
|
1313
1584
|
});
|
|
1314
|
-
},
|
|
1585
|
+
}, St = ({ children: e, label: r }) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ n("ul", {
|
|
1315
1586
|
className: Q.optgpoup,
|
|
1316
1587
|
children: [r && /* @__PURE__ */ t("li", {
|
|
1317
1588
|
className: Q.label,
|
|
1318
1589
|
children: r
|
|
1319
1590
|
}), e]
|
|
1320
|
-
}) }),
|
|
1321
|
-
...o(({ ...e }, n) => /* @__PURE__ */ t(
|
|
1591
|
+
}) }), Ct = {
|
|
1592
|
+
...o(({ ...e }, n) => /* @__PURE__ */ t(bt, {
|
|
1322
1593
|
...e,
|
|
1323
1594
|
ref: n
|
|
1324
1595
|
})),
|
|
1325
|
-
Option:
|
|
1326
|
-
Optgroup:
|
|
1596
|
+
Option: xt,
|
|
1597
|
+
Optgroup: St
|
|
1327
1598
|
}, $ = {
|
|
1328
1599
|
container: "style-module__container__3-2SP",
|
|
1329
1600
|
hide: "style-module__hide__4ywHX",
|
|
@@ -1335,7 +1606,7 @@ var We = () => {
|
|
|
1335
1606
|
opened: "style-module__opened__GjGrB",
|
|
1336
1607
|
arrow: "style-module__arrow__SCvqs",
|
|
1337
1608
|
item: "style-module__item__v8SnZ"
|
|
1338
|
-
},
|
|
1609
|
+
}, wt = ({ items: e, isOpen: n, enableRerenderItems: r, disabled: i }) => {
|
|
1339
1610
|
let a = f(null), o = d(() => r ? n ? e : null : e, [
|
|
1340
1611
|
r,
|
|
1341
1612
|
e,
|
|
@@ -1348,62 +1619,71 @@ var We = () => {
|
|
|
1348
1619
|
children: o,
|
|
1349
1620
|
ref: a
|
|
1350
1621
|
});
|
|
1351
|
-
},
|
|
1352
|
-
let
|
|
1353
|
-
|
|
1354
|
-
}, C = () => {
|
|
1355
|
-
x((e) => u ? !1 : !e);
|
|
1622
|
+
}, Tt = a({ close: () => {} }), Et = ({ children: e, className: r, items: i, arrow: a = !0, direction: o = "down", position: s = "right", split: c = !1, disabled: u, hover: m = !1, enableRerenderItems: h = !0, onShow: g, onHide: _, ...v }) => {
|
|
1623
|
+
let y = f(null), b = f(null), [x, S] = p(!1), C = () => {
|
|
1624
|
+
S(!1);
|
|
1356
1625
|
}, w = () => {
|
|
1357
|
-
|
|
1358
|
-
}, T = () => {
|
|
1359
|
-
y.current || (!c || d) && C();
|
|
1360
|
-
}, E = (e) => {
|
|
1361
|
-
e.currentTarget.contains(e.relatedTarget) || S();
|
|
1626
|
+
S(!0);
|
|
1362
1627
|
}, ee = () => {
|
|
1363
|
-
|
|
1364
|
-
},
|
|
1365
|
-
|
|
1628
|
+
S((e) => u ? !1 : !e);
|
|
1629
|
+
}, T = () => {
|
|
1630
|
+
ee();
|
|
1631
|
+
}, E = () => {
|
|
1632
|
+
b.current || (!c || m) && ee();
|
|
1633
|
+
}, D = (e) => {
|
|
1634
|
+
e.currentTarget.contains(e.relatedTarget) || C();
|
|
1635
|
+
}, O = () => {
|
|
1636
|
+
!m || x || b.current || (b.current = setTimeout(w, 50));
|
|
1637
|
+
}, k = () => {
|
|
1638
|
+
b.current &&= (clearTimeout(b.current), null);
|
|
1366
1639
|
};
|
|
1367
1640
|
l(() => {
|
|
1368
|
-
let e =
|
|
1369
|
-
|
|
1370
|
-
}, [
|
|
1371
|
-
let
|
|
1372
|
-
|
|
1373
|
-
|
|
1641
|
+
let e = y.current, t = e?.classList;
|
|
1642
|
+
x ? (t?.add($.opened), e?.focus(), typeof g == "function" && g()) : (t?.remove($.opened), typeof _ == "function" && _());
|
|
1643
|
+
}, [x]);
|
|
1644
|
+
let A = d(() => {
|
|
1645
|
+
let e = ["ui-dropdown"];
|
|
1646
|
+
return e.push($.container), r && e.push(r), o && e.push($[o]), s && e.push($[s]), e.join(" ");
|
|
1647
|
+
}, [
|
|
1648
|
+
r,
|
|
1649
|
+
o,
|
|
1650
|
+
s
|
|
1651
|
+
]);
|
|
1652
|
+
return /* @__PURE__ */ t(Tt.Provider, {
|
|
1653
|
+
value: { close: C },
|
|
1374
1654
|
children: /* @__PURE__ */ n("div", {
|
|
1375
|
-
...
|
|
1376
|
-
className:
|
|
1377
|
-
ref:
|
|
1378
|
-
onMouseEnter:
|
|
1379
|
-
onMouseLeave:
|
|
1655
|
+
...v,
|
|
1656
|
+
className: A,
|
|
1657
|
+
ref: y,
|
|
1658
|
+
onMouseEnter: O,
|
|
1659
|
+
onMouseLeave: k,
|
|
1380
1660
|
tabIndex: 1,
|
|
1381
|
-
onBlur:
|
|
1661
|
+
onBlur: D,
|
|
1382
1662
|
children: [
|
|
1383
|
-
s === "left" && !u && /* @__PURE__ */ t(
|
|
1663
|
+
s === "left" && !u && /* @__PURE__ */ t(gt, {
|
|
1384
1664
|
className: $.arrow,
|
|
1385
|
-
onClick:
|
|
1665
|
+
onClick: T
|
|
1386
1666
|
}),
|
|
1387
1667
|
/* @__PURE__ */ t("div", {
|
|
1388
|
-
onClick:
|
|
1389
|
-
className: "ui-dropdown-block" + (
|
|
1668
|
+
onClick: E,
|
|
1669
|
+
className: "ui-dropdown-block" + (x ? " " + $.hide : ""),
|
|
1390
1670
|
children: e
|
|
1391
1671
|
}),
|
|
1392
|
-
s === "right" && !u && a && /* @__PURE__ */ t(
|
|
1672
|
+
s === "right" && !u && a && /* @__PURE__ */ t(gt, {
|
|
1393
1673
|
className: $.arrow,
|
|
1394
|
-
onClick:
|
|
1674
|
+
onClick: T
|
|
1395
1675
|
}),
|
|
1396
|
-
/* @__PURE__ */ t(
|
|
1397
|
-
isOpen:
|
|
1676
|
+
/* @__PURE__ */ t(wt, {
|
|
1677
|
+
isOpen: x,
|
|
1398
1678
|
disabled: u,
|
|
1399
|
-
enableRerenderItems:
|
|
1679
|
+
enableRerenderItems: h,
|
|
1400
1680
|
items: i
|
|
1401
1681
|
})
|
|
1402
1682
|
]
|
|
1403
1683
|
})
|
|
1404
1684
|
});
|
|
1405
|
-
},
|
|
1406
|
-
let s = c(
|
|
1685
|
+
}, Dt = ({ children: e, onClick: n, autoClose: r = !0, active: i, className: a, ...o }) => {
|
|
1686
|
+
let s = c(Tt), l = (e) => {
|
|
1407
1687
|
typeof n == "function" && n(e), r && s.close();
|
|
1408
1688
|
}, u = ["ui-dropdown-item"];
|
|
1409
1689
|
return u.push($.item), i && u.push($.active, "active"), a && u.push(a), /* @__PURE__ */ t("li", {
|
|
@@ -1412,12 +1692,12 @@ var We = () => {
|
|
|
1412
1692
|
className: u.join(" "),
|
|
1413
1693
|
children: typeof e == "function" ? e(s) : e
|
|
1414
1694
|
});
|
|
1415
|
-
},
|
|
1416
|
-
...o(({ ...e }, n) => /* @__PURE__ */ t(
|
|
1417
|
-
Item:
|
|
1418
|
-
},
|
|
1695
|
+
}, Ot = {
|
|
1696
|
+
...o(({ ...e }, n) => /* @__PURE__ */ t(Et, { ...e })),
|
|
1697
|
+
Item: Dt
|
|
1698
|
+
}, kt = a({}), At = ({ children: e }) => /* @__PURE__ */ t(kt.Provider, {
|
|
1419
1699
|
value: {},
|
|
1420
1700
|
children: e
|
|
1421
1701
|
});
|
|
1422
1702
|
//#endregion
|
|
1423
|
-
export {
|
|
1703
|
+
export { lt as Button, mt as Checkbox, Ot as Dropdown, Dt as DropdownItem, X as Element, X as FormElement, ct as File, st as FileInput, rt as Form, it as Input, nt as Loading, v as Progress, At as Provider, Ct as Select, St as SelectOptgroup, xt as SelectOption, g as Spinner, at as TextArea, ft as UploadImages, tt as useForm };
|