stone-kit 0.0.236 → 0.0.239
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/dist/{Modal-G1ISsPJt.js → Modal-258KOiTO.js} +413 -412
- package/dist/{SortSelect-nD0x1SSi.js → SortSelect-C_Ue6qxA.js} +5 -4
- package/dist/components/FormModal/ui/ModalForm.d.ts +6 -1
- package/dist/components/FormModal/ui/ModalForm.js +491 -461
- package/dist/components/LotCard/ui/LotCard.js +6 -5
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/Modal/ui/Modal.js +1 -1
- package/dist/components/Modal/ui/Modal.types.d.ts +1 -0
- package/dist/components/SortSelect/index.js +1 -1
- package/dist/components/SortSelect/ui/SortSelect.js +5 -4
- package/dist/components/TabSwitcher/index.js +1 -1
- package/dist/components/TabSwitcher/ui/TabSwitcher.js +5 -4
- package/dist/components/TextArea/TextArea.js +20 -0
- package/dist/components/TextArea/TextArea.types.d.ts +11 -0
- package/dist/components/TextArea/TextArea.types.js +1 -0
- package/dist/{index-DB-VhohW.js → index-CbZmuQco.js} +1 -1
- package/dist/main.js +2 -2
- package/dist/shared/const.d.ts +1 -0
- package/dist/shared/const.js +6 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,63 +1,64 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { I as xt } from "../../../index-
|
|
3
|
-
import { M as Vt } from "../../../Modal-
|
|
4
|
-
import { Flex as
|
|
5
|
-
import { Input as
|
|
6
|
-
import
|
|
1
|
+
import { jsx as N, jsxs as Se } from "react/jsx-runtime";
|
|
2
|
+
import { I as xt } from "../../../index-CbZmuQco.js";
|
|
3
|
+
import { M as Vt } from "../../../Modal-258KOiTO.js";
|
|
4
|
+
import { Flex as At } from "../../Flex/ui/Flex.js";
|
|
5
|
+
import { Input as Ee } from "../../Input/ui/Input.js";
|
|
6
|
+
import P from "react";
|
|
7
7
|
import { Button as Ke } from "../../Button/ui/Button.js";
|
|
8
|
-
import { NewIcon as
|
|
9
|
-
import { phoneReg as wt, nameReg as pt } from "../utils/reg.js";
|
|
8
|
+
import { NewIcon as Ft } from "../../NewIcon/ui/NewIcon.js";
|
|
9
|
+
import { phoneReg as wt, nameReg as pt, emailReg as Dt } from "../utils/reg.js";
|
|
10
10
|
import { CheckBox as Ge } from "../../CheckBox/CheckBox.js";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
import { TextArea as kt } from "../../TextArea/TextArea.js";
|
|
12
|
+
const St = "_btn_m4eyd_1", Et = "_modal_m4eyd_9", Ct = "_modalBody_m4eyd_16", Bt = "_root_m4eyd_21", Tt = "_title_m4eyd_31", Rt = "_description_m4eyd_38", Lt = "_inputWrapper_m4eyd_45", X = {
|
|
13
|
+
btn: St,
|
|
14
|
+
modal: Et,
|
|
15
|
+
modalBody: Ct,
|
|
16
|
+
root: Bt,
|
|
17
|
+
title: Tt,
|
|
18
|
+
description: Rt,
|
|
19
|
+
inputWrapper: Lt
|
|
19
20
|
};
|
|
20
|
-
var
|
|
21
|
-
const
|
|
22
|
-
var S = (e) => !B(e) && !Array.isArray(e) &&
|
|
21
|
+
var he = (e) => e.type === "checkbox", ue = (e) => e instanceof Date, B = (e) => e == null;
|
|
22
|
+
const at = (e) => typeof e == "object";
|
|
23
|
+
var S = (e) => !B(e) && !Array.isArray(e) && at(e) && !ue(e), Mt = (e) => S(e) && e.target ? he(e.target) ? e.target.checked : e.target.value : e, Ot = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Nt = (e, s) => e.has(Ot(s)), Ut = (e) => {
|
|
23
24
|
const s = e.constructor && e.constructor.prototype;
|
|
24
25
|
return S(s) && s.hasOwnProperty("isPrototypeOf");
|
|
25
|
-
},
|
|
26
|
-
function
|
|
26
|
+
}, Re = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
27
|
+
function q(e) {
|
|
27
28
|
let s;
|
|
28
29
|
const r = Array.isArray(e);
|
|
29
30
|
if (e instanceof Date)
|
|
30
31
|
s = new Date(e);
|
|
31
32
|
else if (e instanceof Set)
|
|
32
33
|
s = new Set(e);
|
|
33
|
-
else if (!(
|
|
34
|
-
if (s = r ? [] : {}, !r && !
|
|
34
|
+
else if (!(Re && (e instanceof Blob || e instanceof FileList)) && (r || S(e)))
|
|
35
|
+
if (s = r ? [] : {}, !r && !Ut(e))
|
|
35
36
|
s = e;
|
|
36
37
|
else
|
|
37
|
-
for (const
|
|
38
|
-
e.hasOwnProperty(
|
|
38
|
+
for (const n in e)
|
|
39
|
+
e.hasOwnProperty(n) && (s[n] = q(e[n]));
|
|
39
40
|
else
|
|
40
41
|
return e;
|
|
41
42
|
return s;
|
|
42
43
|
}
|
|
43
|
-
var
|
|
44
|
+
var Fe = (e) => Array.isArray(e) ? e.filter(Boolean) : [], w = (e) => e === void 0, f = (e, s, r) => {
|
|
44
45
|
if (!s || !S(e))
|
|
45
46
|
return r;
|
|
46
|
-
const
|
|
47
|
-
return
|
|
48
|
-
}, Y = (e) => typeof e == "boolean",
|
|
49
|
-
let
|
|
50
|
-
const u =
|
|
51
|
-
for (; ++
|
|
52
|
-
const g = u[
|
|
53
|
-
let
|
|
54
|
-
if (
|
|
47
|
+
const n = Fe(s.split(/[,[\].]+?/)).reduce((u, l) => B(u) ? u : u[l], e);
|
|
48
|
+
return w(n) || n === e ? w(e[s]) ? r : e[s] : n;
|
|
49
|
+
}, Y = (e) => typeof e == "boolean", Le = (e) => /^\w*$/.test(e), lt = (e) => Fe(e.replace(/["|']|\]/g, "").split(/\.|\[/)), A = (e, s, r) => {
|
|
50
|
+
let n = -1;
|
|
51
|
+
const u = Le(s) ? [s] : lt(s), l = u.length, y = l - 1;
|
|
52
|
+
for (; ++n < l; ) {
|
|
53
|
+
const g = u[n];
|
|
54
|
+
let L = r;
|
|
55
|
+
if (n !== y) {
|
|
55
56
|
const M = e[g];
|
|
56
|
-
|
|
57
|
+
L = S(M) || Array.isArray(M) ? M : isNaN(+u[n + 1]) ? {} : [];
|
|
57
58
|
}
|
|
58
59
|
if (g === "__proto__")
|
|
59
60
|
return;
|
|
60
|
-
e[g] =
|
|
61
|
+
e[g] = L, e = e[g];
|
|
61
62
|
}
|
|
62
63
|
return e;
|
|
63
64
|
};
|
|
@@ -65,13 +66,13 @@ const Je = {
|
|
|
65
66
|
BLUR: "blur",
|
|
66
67
|
FOCUS_OUT: "focusout",
|
|
67
68
|
CHANGE: "change"
|
|
68
|
-
},
|
|
69
|
+
}, $ = {
|
|
69
70
|
onBlur: "onBlur",
|
|
70
71
|
onChange: "onChange",
|
|
71
72
|
onSubmit: "onSubmit",
|
|
72
73
|
onTouched: "onTouched",
|
|
73
74
|
all: "all"
|
|
74
|
-
},
|
|
75
|
+
}, J = {
|
|
75
76
|
max: "max",
|
|
76
77
|
min: "min",
|
|
77
78
|
maxLength: "maxLength",
|
|
@@ -80,27 +81,27 @@ const Je = {
|
|
|
80
81
|
required: "required",
|
|
81
82
|
validate: "validate"
|
|
82
83
|
};
|
|
83
|
-
|
|
84
|
-
var
|
|
84
|
+
P.createContext(null);
|
|
85
|
+
var It = (e, s, r, n = !0) => {
|
|
85
86
|
const u = {
|
|
86
87
|
defaultValues: s._defaultValues
|
|
87
88
|
};
|
|
88
|
-
for (const
|
|
89
|
-
Object.defineProperty(u,
|
|
89
|
+
for (const l in e)
|
|
90
|
+
Object.defineProperty(u, l, {
|
|
90
91
|
get: () => {
|
|
91
|
-
const y =
|
|
92
|
-
return s._proxyFormState[y] !==
|
|
92
|
+
const y = l;
|
|
93
|
+
return s._proxyFormState[y] !== $.all && (s._proxyFormState[y] = !n || $.all), e[y];
|
|
93
94
|
}
|
|
94
95
|
});
|
|
95
96
|
return u;
|
|
96
|
-
},
|
|
97
|
+
}, R = (e) => S(e) && !Object.keys(e).length, qt = (e, s, r, n) => {
|
|
97
98
|
r(e);
|
|
98
|
-
const { name: u, ...
|
|
99
|
-
return
|
|
99
|
+
const { name: u, ...l } = e;
|
|
100
|
+
return R(l) || Object.keys(l).length >= Object.keys(s).length || Object.keys(l).find((y) => s[y] === $.all);
|
|
100
101
|
}, _e = (e) => Array.isArray(e) ? e : [e];
|
|
101
|
-
function
|
|
102
|
-
const s =
|
|
103
|
-
s.current = e,
|
|
102
|
+
function Pt(e) {
|
|
103
|
+
const s = P.useRef(e);
|
|
104
|
+
s.current = e, P.useEffect(() => {
|
|
104
105
|
const r = !e.disabled && s.current.subject && s.current.subject.subscribe({
|
|
105
106
|
next: s.current.next
|
|
106
107
|
});
|
|
@@ -109,49 +110,49 @@ function It(e) {
|
|
|
109
110
|
};
|
|
110
111
|
}, [e.disabled]);
|
|
111
112
|
}
|
|
112
|
-
var
|
|
113
|
+
var G = (e) => typeof e == "string", Wt = (e, s, r, n, u) => G(e) ? (n && s.watch.add(e), f(r, e, u)) : Array.isArray(e) ? e.map((l) => (n && s.watch.add(l), f(r, l))) : (n && (s.watchAll = !0), r), Ht = (e, s, r, n, u) => s ? {
|
|
113
114
|
...r[e],
|
|
114
115
|
types: {
|
|
115
116
|
...r[e] && r[e].types ? r[e].types : {},
|
|
116
|
-
[
|
|
117
|
+
[n]: u || !0
|
|
117
118
|
}
|
|
118
119
|
} : {}, Qe = (e) => ({
|
|
119
|
-
isOnSubmit: !e || e ===
|
|
120
|
-
isOnBlur: e ===
|
|
121
|
-
isOnChange: e ===
|
|
122
|
-
isOnAll: e ===
|
|
123
|
-
isOnTouch: e ===
|
|
124
|
-
}), Xe = (e, s, r) => !r && (s.watchAll || s.watch.has(e) || [...s.watch].some((
|
|
125
|
-
const
|
|
120
|
+
isOnSubmit: !e || e === $.onSubmit,
|
|
121
|
+
isOnBlur: e === $.onBlur,
|
|
122
|
+
isOnChange: e === $.onChange,
|
|
123
|
+
isOnAll: e === $.all,
|
|
124
|
+
isOnTouch: e === $.onTouched
|
|
125
|
+
}), Xe = (e, s, r) => !r && (s.watchAll || s.watch.has(e) || [...s.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
|
|
126
|
+
const ye = (e, s, r, n) => {
|
|
126
127
|
for (const u of r || Object.keys(e)) {
|
|
127
|
-
const
|
|
128
|
-
if (
|
|
129
|
-
const { _f: y, ...g } =
|
|
128
|
+
const l = f(e, u);
|
|
129
|
+
if (l) {
|
|
130
|
+
const { _f: y, ...g } = l;
|
|
130
131
|
if (y) {
|
|
131
|
-
if (y.refs && y.refs[0] && s(y.refs[0], u) && !
|
|
132
|
+
if (y.refs && y.refs[0] && s(y.refs[0], u) && !n)
|
|
132
133
|
break;
|
|
133
|
-
if (y.ref && s(y.ref, y.name) && !
|
|
134
|
+
if (y.ref && s(y.ref, y.name) && !n)
|
|
134
135
|
break;
|
|
135
|
-
|
|
136
|
+
ye(g, s);
|
|
136
137
|
} else
|
|
137
|
-
S(g) &&
|
|
138
|
+
S(g) && ye(g, s);
|
|
138
139
|
}
|
|
139
140
|
}
|
|
140
141
|
};
|
|
141
|
-
var
|
|
142
|
-
const
|
|
143
|
-
return
|
|
144
|
-
},
|
|
145
|
-
if (!
|
|
142
|
+
var zt = (e, s, r) => {
|
|
143
|
+
const n = _e(f(e, r));
|
|
144
|
+
return A(n, "root", s[r]), A(e, r, n), e;
|
|
145
|
+
}, Me = (e) => e.type === "file", Z = (e) => typeof e == "function", be = (e) => {
|
|
146
|
+
if (!Re)
|
|
146
147
|
return !1;
|
|
147
148
|
const s = e ? e.ownerDocument : 0;
|
|
148
149
|
return e instanceof (s && s.defaultView ? s.defaultView.HTMLElement : HTMLElement);
|
|
149
|
-
}, me = (e) =>
|
|
150
|
+
}, me = (e) => G(e), Oe = (e) => e.type === "radio", xe = (e) => e instanceof RegExp;
|
|
150
151
|
const Ye = {
|
|
151
152
|
value: !1,
|
|
152
153
|
isValid: !1
|
|
153
154
|
}, Ze = { value: !0, isValid: !0 };
|
|
154
|
-
var
|
|
155
|
+
var nt = (e) => {
|
|
155
156
|
if (Array.isArray(e)) {
|
|
156
157
|
if (e.length > 1) {
|
|
157
158
|
const s = e.filter((r) => r && r.checked && !r.disabled).map((r) => r.value);
|
|
@@ -159,7 +160,7 @@ var lt = (e) => {
|
|
|
159
160
|
}
|
|
160
161
|
return e[0].checked && !e[0].disabled ? (
|
|
161
162
|
// @ts-expect-error expected to work in the browser
|
|
162
|
-
e[0].attributes && !
|
|
163
|
+
e[0].attributes && !w(e[0].attributes.value) ? w(e[0].value) || e[0].value === "" ? Ze : { value: e[0].value, isValid: !0 } : Ze
|
|
163
164
|
) : Ye;
|
|
164
165
|
}
|
|
165
166
|
return Ye;
|
|
@@ -183,198 +184,198 @@ function tt(e, s, r = "validate") {
|
|
|
183
184
|
var ne = (e) => S(e) && !xe(e) ? e : {
|
|
184
185
|
value: e,
|
|
185
186
|
message: ""
|
|
186
|
-
}, rt = async (e, s, r,
|
|
187
|
-
const { ref:
|
|
188
|
-
if (
|
|
187
|
+
}, rt = async (e, s, r, n, u) => {
|
|
188
|
+
const { ref: l, refs: y, required: g, maxLength: L, minLength: M, min: V, max: v, pattern: re, validate: j, name: C, valueAsNumber: se, mount: T, disabled: K } = e._f, m = f(s, C);
|
|
189
|
+
if (!T || K)
|
|
189
190
|
return {};
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
},
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
type: _ ? E :
|
|
196
|
-
message:
|
|
197
|
-
ref:
|
|
198
|
-
...
|
|
191
|
+
const W = y ? y[0] : l, H = (_) => {
|
|
192
|
+
n && W.reportValidity && (W.setCustomValidity(Y(_) ? "" : _ || ""), W.reportValidity());
|
|
193
|
+
}, F = {}, Q = Oe(l), ie = he(l), ee = Q || ie, ae = (se || Me(l)) && w(l.value) && w(m) || be(l) && l.value === "" || m === "" || Array.isArray(m) && !m.length, U = Ht.bind(null, C, r, F), ge = (_, b, D, E = J.maxLength, z = J.minLength) => {
|
|
194
|
+
const I = _ ? b : D;
|
|
195
|
+
F[C] = {
|
|
196
|
+
type: _ ? E : z,
|
|
197
|
+
message: I,
|
|
198
|
+
ref: l,
|
|
199
|
+
...U(_ ? E : z, I)
|
|
199
200
|
};
|
|
200
201
|
};
|
|
201
|
-
if (u ? !Array.isArray(m) || !m.length : g && (!ee && (
|
|
202
|
+
if (u ? !Array.isArray(m) || !m.length : g && (!ee && (ae || B(m)) || Y(m) && !m || ie && !nt(y).isValid || Q && !ut(y).isValid)) {
|
|
202
203
|
const { value: _, message: b } = me(g) ? { value: !!g, message: g } : ne(g);
|
|
203
|
-
if (_ && (
|
|
204
|
-
type:
|
|
204
|
+
if (_ && (F[C] = {
|
|
205
|
+
type: J.required,
|
|
205
206
|
message: b,
|
|
206
|
-
ref:
|
|
207
|
-
...
|
|
207
|
+
ref: W,
|
|
208
|
+
...U(J.required, b)
|
|
208
209
|
}, !r))
|
|
209
|
-
return
|
|
210
|
+
return H(b), F;
|
|
210
211
|
}
|
|
211
|
-
if (!
|
|
212
|
+
if (!ae && (!B(V) || !B(v))) {
|
|
212
213
|
let _, b;
|
|
213
|
-
const D = ne(v), E = ne(
|
|
214
|
+
const D = ne(v), E = ne(V);
|
|
214
215
|
if (!B(m) && !isNaN(m)) {
|
|
215
|
-
const
|
|
216
|
-
B(D.value) || (_ =
|
|
216
|
+
const z = l.valueAsNumber || m && +m;
|
|
217
|
+
B(D.value) || (_ = z > D.value), B(E.value) || (b = z < E.value);
|
|
217
218
|
} else {
|
|
218
|
-
const
|
|
219
|
-
|
|
219
|
+
const z = l.valueAsDate || new Date(m), I = (de) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + de), oe = l.type == "time", ce = l.type == "week";
|
|
220
|
+
G(D.value) && m && (_ = oe ? I(m) > I(D.value) : ce ? m > D.value : z > new Date(D.value)), G(E.value) && m && (b = oe ? I(m) < I(E.value) : ce ? m < E.value : z < new Date(E.value));
|
|
220
221
|
}
|
|
221
|
-
if ((_ || b) && (ge(!!_, D.message, E.message,
|
|
222
|
-
return
|
|
222
|
+
if ((_ || b) && (ge(!!_, D.message, E.message, J.max, J.min), !r))
|
|
223
|
+
return H(F[C].message), F;
|
|
223
224
|
}
|
|
224
|
-
if ((
|
|
225
|
-
const _ = ne(
|
|
225
|
+
if ((L || M) && !ae && (G(m) || u && Array.isArray(m))) {
|
|
226
|
+
const _ = ne(L), b = ne(M), D = !B(_.value) && m.length > +_.value, E = !B(b.value) && m.length < +b.value;
|
|
226
227
|
if ((D || E) && (ge(D, _.message, b.message), !r))
|
|
227
|
-
return
|
|
228
|
+
return H(F[C].message), F;
|
|
228
229
|
}
|
|
229
|
-
if (
|
|
230
|
-
const { value: _, message: b } = ne(
|
|
231
|
-
if (xe(_) && !m.match(_) && (
|
|
232
|
-
type:
|
|
230
|
+
if (re && !ae && G(m)) {
|
|
231
|
+
const { value: _, message: b } = ne(re);
|
|
232
|
+
if (xe(_) && !m.match(_) && (F[C] = {
|
|
233
|
+
type: J.pattern,
|
|
233
234
|
message: b,
|
|
234
|
-
ref:
|
|
235
|
-
...
|
|
235
|
+
ref: l,
|
|
236
|
+
...U(J.pattern, b)
|
|
236
237
|
}, !r))
|
|
237
|
-
return
|
|
238
|
+
return H(b), F;
|
|
238
239
|
}
|
|
239
|
-
if (
|
|
240
|
-
if (Z(
|
|
241
|
-
const _ = await
|
|
242
|
-
if (b && (
|
|
240
|
+
if (j) {
|
|
241
|
+
if (Z(j)) {
|
|
242
|
+
const _ = await j(m, s), b = tt(_, W);
|
|
243
|
+
if (b && (F[C] = {
|
|
243
244
|
...b,
|
|
244
|
-
...
|
|
245
|
+
...U(J.validate, b.message)
|
|
245
246
|
}, !r))
|
|
246
|
-
return
|
|
247
|
-
} else if (S(
|
|
247
|
+
return H(b.message), F;
|
|
248
|
+
} else if (S(j)) {
|
|
248
249
|
let _ = {};
|
|
249
|
-
for (const b in
|
|
250
|
-
if (!
|
|
250
|
+
for (const b in j) {
|
|
251
|
+
if (!R(_) && !r)
|
|
251
252
|
break;
|
|
252
|
-
const D = tt(await
|
|
253
|
+
const D = tt(await j[b](m, s), W, b);
|
|
253
254
|
D && (_ = {
|
|
254
255
|
...D,
|
|
255
|
-
...
|
|
256
|
-
},
|
|
256
|
+
...U(b, D.message)
|
|
257
|
+
}, H(D.message), r && (F[C] = _));
|
|
257
258
|
}
|
|
258
|
-
if (!
|
|
259
|
-
ref:
|
|
259
|
+
if (!R(_) && (F[C] = {
|
|
260
|
+
ref: W,
|
|
260
261
|
..._
|
|
261
262
|
}, !r))
|
|
262
|
-
return
|
|
263
|
+
return F;
|
|
263
264
|
}
|
|
264
265
|
}
|
|
265
|
-
return
|
|
266
|
+
return H(!0), F;
|
|
266
267
|
};
|
|
267
|
-
function
|
|
268
|
+
function $t(e, s) {
|
|
268
269
|
const r = s.slice(0, -1).length;
|
|
269
|
-
let
|
|
270
|
-
for (;
|
|
271
|
-
e =
|
|
270
|
+
let n = 0;
|
|
271
|
+
for (; n < r; )
|
|
272
|
+
e = w(e) ? n++ : e[s[n++]];
|
|
272
273
|
return e;
|
|
273
274
|
}
|
|
274
|
-
function
|
|
275
|
+
function jt(e) {
|
|
275
276
|
for (const s in e)
|
|
276
|
-
if (e.hasOwnProperty(s) && !
|
|
277
|
+
if (e.hasOwnProperty(s) && !w(e[s]))
|
|
277
278
|
return !1;
|
|
278
279
|
return !0;
|
|
279
280
|
}
|
|
280
281
|
function k(e, s) {
|
|
281
|
-
const r = Array.isArray(s) ? s :
|
|
282
|
-
return
|
|
282
|
+
const r = Array.isArray(s) ? s : Le(s) ? [s] : lt(s), n = r.length === 1 ? e : $t(e, r), u = r.length - 1, l = r[u];
|
|
283
|
+
return n && delete n[l], u !== 0 && (S(n) && R(n) || Array.isArray(n) && jt(n)) && k(e, r.slice(0, -1)), e;
|
|
283
284
|
}
|
|
284
|
-
var
|
|
285
|
+
var Ce = () => {
|
|
285
286
|
let e = [];
|
|
286
287
|
return {
|
|
287
288
|
get observers() {
|
|
288
289
|
return e;
|
|
289
290
|
},
|
|
290
291
|
next: (u) => {
|
|
291
|
-
for (const
|
|
292
|
-
|
|
292
|
+
for (const l of e)
|
|
293
|
+
l.next && l.next(u);
|
|
293
294
|
},
|
|
294
295
|
subscribe: (u) => (e.push(u), {
|
|
295
296
|
unsubscribe: () => {
|
|
296
|
-
e = e.filter((
|
|
297
|
+
e = e.filter((l) => l !== u);
|
|
297
298
|
}
|
|
298
299
|
}),
|
|
299
300
|
unsubscribe: () => {
|
|
300
301
|
e = [];
|
|
301
302
|
}
|
|
302
303
|
};
|
|
303
|
-
}, Ve = (e) => B(e) || !
|
|
304
|
+
}, Ve = (e) => B(e) || !at(e);
|
|
304
305
|
function te(e, s) {
|
|
305
306
|
if (Ve(e) || Ve(s))
|
|
306
307
|
return e === s;
|
|
307
|
-
if (
|
|
308
|
+
if (ue(e) && ue(s))
|
|
308
309
|
return e.getTime() === s.getTime();
|
|
309
|
-
const r = Object.keys(e),
|
|
310
|
-
if (r.length !==
|
|
310
|
+
const r = Object.keys(e), n = Object.keys(s);
|
|
311
|
+
if (r.length !== n.length)
|
|
311
312
|
return !1;
|
|
312
313
|
for (const u of r) {
|
|
313
|
-
const
|
|
314
|
-
if (!
|
|
314
|
+
const l = e[u];
|
|
315
|
+
if (!n.includes(u))
|
|
315
316
|
return !1;
|
|
316
317
|
if (u !== "ref") {
|
|
317
318
|
const y = s[u];
|
|
318
|
-
if (
|
|
319
|
+
if (ue(l) && ue(y) || S(l) && S(y) || Array.isArray(l) && Array.isArray(y) ? !te(l, y) : l !== y)
|
|
319
320
|
return !1;
|
|
320
321
|
}
|
|
321
322
|
}
|
|
322
323
|
return !0;
|
|
323
324
|
}
|
|
324
|
-
var ot = (e) => e.type === "select-multiple",
|
|
325
|
+
var ot = (e) => e.type === "select-multiple", Kt = (e) => Oe(e) || he(e), Be = (e) => be(e) && e.isConnected, ct = (e) => {
|
|
325
326
|
for (const s in e)
|
|
326
327
|
if (Z(e[s]))
|
|
327
328
|
return !0;
|
|
328
329
|
return !1;
|
|
329
330
|
};
|
|
330
|
-
function
|
|
331
|
+
function Ae(e, s = {}) {
|
|
331
332
|
const r = Array.isArray(e);
|
|
332
333
|
if (S(e) || r)
|
|
333
|
-
for (const
|
|
334
|
-
Array.isArray(e[
|
|
334
|
+
for (const n in e)
|
|
335
|
+
Array.isArray(e[n]) || S(e[n]) && !ct(e[n]) ? (s[n] = Array.isArray(e[n]) ? [] : {}, Ae(e[n], s[n])) : B(e[n]) || (s[n] = !0);
|
|
335
336
|
return s;
|
|
336
337
|
}
|
|
337
|
-
function
|
|
338
|
-
const
|
|
339
|
-
if (S(e) ||
|
|
338
|
+
function dt(e, s, r) {
|
|
339
|
+
const n = Array.isArray(e);
|
|
340
|
+
if (S(e) || n)
|
|
340
341
|
for (const u in e)
|
|
341
|
-
Array.isArray(e[u]) || S(e[u]) && !ct(e[u]) ?
|
|
342
|
+
Array.isArray(e[u]) || S(e[u]) && !ct(e[u]) ? w(s) || Ve(r[u]) ? r[u] = Array.isArray(e[u]) ? Ae(e[u], []) : { ...Ae(e[u]) } : dt(e[u], B(s) ? {} : s[u], r[u]) : r[u] = !te(e[u], s[u]);
|
|
342
343
|
return r;
|
|
343
344
|
}
|
|
344
|
-
var ve = (e, s) =>
|
|
345
|
-
function
|
|
345
|
+
var ve = (e, s) => dt(e, s, Ae(s)), ft = (e, { valueAsNumber: s, valueAsDate: r, setValueAs: n }) => w(e) ? e : s ? e === "" ? NaN : e && +e : r && G(e) ? new Date(e) : n ? n(e) : e;
|
|
346
|
+
function Te(e) {
|
|
346
347
|
const s = e.ref;
|
|
347
348
|
if (!(e.refs ? e.refs.every((r) => r.disabled) : s.disabled))
|
|
348
|
-
return
|
|
349
|
+
return Me(s) ? s.files : Oe(s) ? ut(e.refs).value : ot(s) ? [...s.selectedOptions].map(({ value: r }) => r) : he(s) ? nt(e.refs).value : ft(w(s.value) ? e.ref.value : s.value, e);
|
|
349
350
|
}
|
|
350
|
-
var
|
|
351
|
+
var Gt = (e, s, r, n) => {
|
|
351
352
|
const u = {};
|
|
352
|
-
for (const
|
|
353
|
-
const y =
|
|
354
|
-
y &&
|
|
353
|
+
for (const l of e) {
|
|
354
|
+
const y = f(s, l);
|
|
355
|
+
y && A(u, l, y._f);
|
|
355
356
|
}
|
|
356
357
|
return {
|
|
357
358
|
criteriaMode: r,
|
|
358
359
|
names: [...e],
|
|
359
360
|
fields: u,
|
|
360
|
-
shouldUseNativeValidation:
|
|
361
|
+
shouldUseNativeValidation: n
|
|
361
362
|
};
|
|
362
|
-
}, fe = (e) =>
|
|
363
|
+
}, fe = (e) => w(e) ? e : xe(e) ? e.source : S(e) ? xe(e.value) ? e.value.source : e.value : e, Jt = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
|
|
363
364
|
function st(e, s, r) {
|
|
364
|
-
const
|
|
365
|
-
if (
|
|
365
|
+
const n = f(e, r);
|
|
366
|
+
if (n || Le(r))
|
|
366
367
|
return {
|
|
367
|
-
error:
|
|
368
|
+
error: n,
|
|
368
369
|
name: r
|
|
369
370
|
};
|
|
370
371
|
const u = r.split(".");
|
|
371
372
|
for (; u.length; ) {
|
|
372
|
-
const
|
|
373
|
-
if (y && !Array.isArray(y) && r !==
|
|
373
|
+
const l = u.join("."), y = f(s, l), g = f(e, l);
|
|
374
|
+
if (y && !Array.isArray(y) && r !== l)
|
|
374
375
|
return { name: r };
|
|
375
376
|
if (g && g.type)
|
|
376
377
|
return {
|
|
377
|
-
name:
|
|
378
|
+
name: l,
|
|
378
379
|
error: g
|
|
379
380
|
};
|
|
380
381
|
u.pop();
|
|
@@ -383,15 +384,15 @@ function st(e, s, r) {
|
|
|
383
384
|
name: r
|
|
384
385
|
};
|
|
385
386
|
}
|
|
386
|
-
var
|
|
387
|
-
const
|
|
388
|
-
mode:
|
|
389
|
-
reValidateMode:
|
|
387
|
+
var Qt = (e, s, r, n, u) => u.isOnAll ? !1 : !r && u.isOnTouch ? !(s || e) : (r ? n.isOnBlur : u.isOnBlur) ? !e : (r ? n.isOnChange : u.isOnChange) ? e : !0, Xt = (e, s) => !Fe(f(e, s)).length && k(e, s);
|
|
388
|
+
const Yt = {
|
|
389
|
+
mode: $.onSubmit,
|
|
390
|
+
reValidateMode: $.onChange,
|
|
390
391
|
shouldFocusError: !0
|
|
391
392
|
};
|
|
392
|
-
function
|
|
393
|
+
function Zt(e = {}) {
|
|
393
394
|
let s = {
|
|
394
|
-
...
|
|
395
|
+
...Yt,
|
|
395
396
|
...e
|
|
396
397
|
}, r = {
|
|
397
398
|
submitCount: 0,
|
|
@@ -407,7 +408,7 @@ function Xt(e = {}) {
|
|
|
407
408
|
validatingFields: {},
|
|
408
409
|
errors: s.errors || {},
|
|
409
410
|
disabled: s.disabled || !1
|
|
410
|
-
},
|
|
411
|
+
}, n = {}, u = S(s.defaultValues) || S(s.values) ? q(s.defaultValues || s.values) || {} : {}, l = s.shouldUnregister ? {} : q(u), y = {
|
|
411
412
|
action: !1,
|
|
412
413
|
mount: !1,
|
|
413
414
|
watch: !1
|
|
@@ -416,8 +417,8 @@ function Xt(e = {}) {
|
|
|
416
417
|
unMount: /* @__PURE__ */ new Set(),
|
|
417
418
|
array: /* @__PURE__ */ new Set(),
|
|
418
419
|
watch: /* @__PURE__ */ new Set()
|
|
419
|
-
},
|
|
420
|
-
const
|
|
420
|
+
}, L, M = 0;
|
|
421
|
+
const V = {
|
|
421
422
|
isDirty: !1,
|
|
422
423
|
dirtyFields: !1,
|
|
423
424
|
validatingFields: !1,
|
|
@@ -426,40 +427,40 @@ function Xt(e = {}) {
|
|
|
426
427
|
isValid: !1,
|
|
427
428
|
errors: !1
|
|
428
429
|
}, v = {
|
|
429
|
-
values:
|
|
430
|
-
array:
|
|
431
|
-
state:
|
|
432
|
-
},
|
|
430
|
+
values: Ce(),
|
|
431
|
+
array: Ce(),
|
|
432
|
+
state: Ce()
|
|
433
|
+
}, re = Qe(s.mode), j = Qe(s.reValidateMode), C = s.criteriaMode === $.all, se = (t) => (i) => {
|
|
433
434
|
clearTimeout(M), M = setTimeout(t, i);
|
|
434
|
-
},
|
|
435
|
-
if (
|
|
436
|
-
const i = s.resolver ?
|
|
435
|
+
}, T = async (t) => {
|
|
436
|
+
if (V.isValid || t) {
|
|
437
|
+
const i = s.resolver ? R((await ee()).errors) : await U(n, !0);
|
|
437
438
|
i !== r.isValid && v.state.next({
|
|
438
439
|
isValid: i
|
|
439
440
|
});
|
|
440
441
|
}
|
|
441
|
-
},
|
|
442
|
-
(
|
|
443
|
-
|
|
442
|
+
}, K = (t, i) => {
|
|
443
|
+
(V.isValidating || V.validatingFields) && ((t || Array.from(g.mount)).forEach((a) => {
|
|
444
|
+
a && (i ? A(r.validatingFields, a, i) : k(r.validatingFields, a));
|
|
444
445
|
}), v.state.next({
|
|
445
446
|
validatingFields: r.validatingFields,
|
|
446
|
-
isValidating: !
|
|
447
|
+
isValidating: !R(r.validatingFields)
|
|
447
448
|
}));
|
|
448
|
-
}, m = (t, i = [],
|
|
449
|
-
if (
|
|
450
|
-
if (y.action = !0, o && Array.isArray(
|
|
451
|
-
const h =
|
|
452
|
-
c &&
|
|
449
|
+
}, m = (t, i = [], a, d, c = !0, o = !0) => {
|
|
450
|
+
if (d && a) {
|
|
451
|
+
if (y.action = !0, o && Array.isArray(f(n, t))) {
|
|
452
|
+
const h = a(f(n, t), d.argA, d.argB);
|
|
453
|
+
c && A(n, t, h);
|
|
453
454
|
}
|
|
454
|
-
if (o && Array.isArray(
|
|
455
|
-
const h =
|
|
456
|
-
c &&
|
|
455
|
+
if (o && Array.isArray(f(r.errors, t))) {
|
|
456
|
+
const h = a(f(r.errors, t), d.argA, d.argB);
|
|
457
|
+
c && A(r.errors, t, h), Xt(r.errors, t);
|
|
457
458
|
}
|
|
458
|
-
if (
|
|
459
|
-
const h =
|
|
460
|
-
c &&
|
|
459
|
+
if (V.touchedFields && o && Array.isArray(f(r.touchedFields, t))) {
|
|
460
|
+
const h = a(f(r.touchedFields, t), d.argA, d.argB);
|
|
461
|
+
c && A(r.touchedFields, t, h);
|
|
461
462
|
}
|
|
462
|
-
|
|
463
|
+
V.dirtyFields && (r.dirtyFields = ve(u, l)), v.state.next({
|
|
463
464
|
name: t,
|
|
464
465
|
isDirty: _(t, i),
|
|
465
466
|
dirtyFields: r.dirtyFields,
|
|
@@ -467,42 +468,42 @@ function Xt(e = {}) {
|
|
|
467
468
|
isValid: r.isValid
|
|
468
469
|
});
|
|
469
470
|
} else
|
|
470
|
-
|
|
471
|
-
},
|
|
472
|
-
|
|
471
|
+
A(l, t, i);
|
|
472
|
+
}, W = (t, i) => {
|
|
473
|
+
A(r.errors, t, i), v.state.next({
|
|
473
474
|
errors: r.errors
|
|
474
475
|
});
|
|
475
|
-
},
|
|
476
|
+
}, H = (t) => {
|
|
476
477
|
r.errors = t, v.state.next({
|
|
477
478
|
errors: r.errors,
|
|
478
479
|
isValid: !1
|
|
479
480
|
});
|
|
480
|
-
},
|
|
481
|
-
const c =
|
|
481
|
+
}, F = (t, i, a, d) => {
|
|
482
|
+
const c = f(n, t);
|
|
482
483
|
if (c) {
|
|
483
|
-
const o =
|
|
484
|
-
|
|
484
|
+
const o = f(l, t, w(a) ? f(u, t) : a);
|
|
485
|
+
w(o) || d && d.defaultChecked || i ? A(l, t, i ? o : Te(c._f)) : E(t, o), y.mount && T();
|
|
485
486
|
}
|
|
486
|
-
},
|
|
487
|
+
}, Q = (t, i, a, d, c) => {
|
|
487
488
|
let o = !1, h = !1;
|
|
488
489
|
const x = {
|
|
489
490
|
name: t
|
|
490
|
-
},
|
|
491
|
-
if (!
|
|
492
|
-
|
|
493
|
-
const
|
|
494
|
-
h = !!(!
|
|
491
|
+
}, p = !!(f(n, t) && f(n, t)._f && f(n, t)._f.disabled);
|
|
492
|
+
if (!a || d) {
|
|
493
|
+
V.isDirty && (h = r.isDirty, r.isDirty = x.isDirty = _(), o = h !== x.isDirty);
|
|
494
|
+
const O = p || te(f(u, t), i);
|
|
495
|
+
h = !!(!p && f(r.dirtyFields, t)), O || p ? k(r.dirtyFields, t) : A(r.dirtyFields, t, !0), x.dirtyFields = r.dirtyFields, o = o || V.dirtyFields && h !== !O;
|
|
495
496
|
}
|
|
496
|
-
if (
|
|
497
|
-
const
|
|
498
|
-
|
|
497
|
+
if (a) {
|
|
498
|
+
const O = f(r.touchedFields, t);
|
|
499
|
+
O || (A(r.touchedFields, t, a), x.touchedFields = r.touchedFields, o = o || V.touchedFields && O !== a);
|
|
499
500
|
}
|
|
500
501
|
return o && c && v.state.next(x), o ? x : {};
|
|
501
|
-
},
|
|
502
|
-
const c =
|
|
503
|
-
if (e.delayError &&
|
|
502
|
+
}, ie = (t, i, a, d) => {
|
|
503
|
+
const c = f(r.errors, t), o = V.isValid && Y(i) && r.isValid !== i;
|
|
504
|
+
if (e.delayError && a ? (L = se(() => W(t, a)), L(e.delayError)) : (clearTimeout(M), L = null, a ? A(r.errors, t, a) : k(r.errors, t)), (a ? !te(c, a) : c) || !R(d) || o) {
|
|
504
505
|
const h = {
|
|
505
|
-
...
|
|
506
|
+
...d,
|
|
506
507
|
...o && Y(i) ? { isValid: i } : {},
|
|
507
508
|
errors: r.errors,
|
|
508
509
|
name: t
|
|
@@ -513,182 +514,182 @@ function Xt(e = {}) {
|
|
|
513
514
|
}, v.state.next(h);
|
|
514
515
|
}
|
|
515
516
|
}, ee = async (t) => {
|
|
516
|
-
|
|
517
|
-
const i = await s.resolver(
|
|
518
|
-
return
|
|
519
|
-
},
|
|
517
|
+
K(t, !0);
|
|
518
|
+
const i = await s.resolver(l, s.context, Gt(t || g.mount, n, s.criteriaMode, s.shouldUseNativeValidation));
|
|
519
|
+
return K(t), i;
|
|
520
|
+
}, ae = async (t) => {
|
|
520
521
|
const { errors: i } = await ee(t);
|
|
521
522
|
if (t)
|
|
522
|
-
for (const
|
|
523
|
-
const
|
|
524
|
-
|
|
523
|
+
for (const a of t) {
|
|
524
|
+
const d = f(i, a);
|
|
525
|
+
d ? A(r.errors, a, d) : k(r.errors, a);
|
|
525
526
|
}
|
|
526
527
|
else
|
|
527
528
|
r.errors = i;
|
|
528
529
|
return i;
|
|
529
|
-
},
|
|
530
|
+
}, U = async (t, i, a = {
|
|
530
531
|
valid: !0
|
|
531
532
|
}) => {
|
|
532
|
-
for (const
|
|
533
|
-
const c = t[
|
|
533
|
+
for (const d in t) {
|
|
534
|
+
const c = t[d];
|
|
534
535
|
if (c) {
|
|
535
536
|
const { _f: o, ...h } = c;
|
|
536
537
|
if (o) {
|
|
537
538
|
const x = g.array.has(o.name);
|
|
538
|
-
|
|
539
|
-
const
|
|
540
|
-
if (
|
|
539
|
+
K([d], !0);
|
|
540
|
+
const p = await rt(c, l, C, s.shouldUseNativeValidation && !i, x);
|
|
541
|
+
if (K([d]), p[o.name] && (a.valid = !1, i))
|
|
541
542
|
break;
|
|
542
|
-
!i && (
|
|
543
|
+
!i && (f(p, o.name) ? x ? zt(r.errors, p, o.name) : A(r.errors, o.name, p[o.name]) : k(r.errors, o.name));
|
|
543
544
|
}
|
|
544
|
-
!
|
|
545
|
+
!R(h) && await U(h, i, a);
|
|
545
546
|
}
|
|
546
547
|
}
|
|
547
|
-
return
|
|
548
|
+
return a.valid;
|
|
548
549
|
}, ge = () => {
|
|
549
550
|
for (const t of g.unMount) {
|
|
550
|
-
const i =
|
|
551
|
-
i && (i._f.refs ? i._f.refs.every((
|
|
551
|
+
const i = f(n, t);
|
|
552
|
+
i && (i._f.refs ? i._f.refs.every((a) => !Be(a)) : !Be(i._f.ref)) && we(t);
|
|
552
553
|
}
|
|
553
554
|
g.unMount = /* @__PURE__ */ new Set();
|
|
554
|
-
}, _ = (t, i) => (t && i &&
|
|
555
|
-
...y.mount ?
|
|
556
|
-
},
|
|
557
|
-
const
|
|
555
|
+
}, _ = (t, i) => (t && i && A(l, t, i), !te(Ne(), u)), b = (t, i, a) => Wt(t, g, {
|
|
556
|
+
...y.mount ? l : w(i) ? u : G(t) ? { [t]: i } : i
|
|
557
|
+
}, a, i), D = (t) => Fe(f(y.mount ? l : u, t, e.shouldUnregister ? f(u, t, []) : [])), E = (t, i, a = {}) => {
|
|
558
|
+
const d = f(n, t);
|
|
558
559
|
let c = i;
|
|
559
|
-
if (
|
|
560
|
-
const o =
|
|
561
|
-
o && (!o.disabled &&
|
|
560
|
+
if (d) {
|
|
561
|
+
const o = d._f;
|
|
562
|
+
o && (!o.disabled && A(l, t, ft(i, o)), c = be(o.ref) && B(i) ? "" : i, ot(o.ref) ? [...o.ref.options].forEach((h) => h.selected = c.includes(h.value)) : o.refs ? he(o.ref) ? o.refs.length > 1 ? o.refs.forEach((h) => (!h.defaultChecked || !h.disabled) && (h.checked = Array.isArray(c) ? !!c.find((x) => x === h.value) : c === h.value)) : o.refs[0] && (o.refs[0].checked = !!c) : o.refs.forEach((h) => h.checked = h.value === c) : Me(o.ref) ? o.ref.value = "" : (o.ref.value = c, o.ref.type || v.values.next({
|
|
562
563
|
name: t,
|
|
563
|
-
values: { ...
|
|
564
|
+
values: { ...l }
|
|
564
565
|
})));
|
|
565
566
|
}
|
|
566
|
-
(
|
|
567
|
-
},
|
|
568
|
-
for (const
|
|
569
|
-
const c = i[
|
|
570
|
-
(g.array.has(t) || !Ve(c) || h && !h._f) && !
|
|
567
|
+
(a.shouldDirty || a.shouldTouch) && Q(t, c, a.shouldTouch, a.shouldDirty, !0), a.shouldValidate && de(t);
|
|
568
|
+
}, z = (t, i, a) => {
|
|
569
|
+
for (const d in i) {
|
|
570
|
+
const c = i[d], o = `${t}.${d}`, h = f(n, o);
|
|
571
|
+
(g.array.has(t) || !Ve(c) || h && !h._f) && !ue(c) ? z(o, c, a) : E(o, c, a);
|
|
571
572
|
}
|
|
572
|
-
},
|
|
573
|
-
const
|
|
574
|
-
|
|
573
|
+
}, I = (t, i, a = {}) => {
|
|
574
|
+
const d = f(n, t), c = g.array.has(t), o = q(i);
|
|
575
|
+
A(l, t, o), c ? (v.array.next({
|
|
575
576
|
name: t,
|
|
576
|
-
values: { ...
|
|
577
|
-
}), (
|
|
577
|
+
values: { ...l }
|
|
578
|
+
}), (V.isDirty || V.dirtyFields) && a.shouldDirty && v.state.next({
|
|
578
579
|
name: t,
|
|
579
|
-
dirtyFields: ve(u,
|
|
580
|
+
dirtyFields: ve(u, l),
|
|
580
581
|
isDirty: _(t, o)
|
|
581
|
-
})) :
|
|
582
|
+
})) : d && !d._f && !B(o) ? z(t, o, a) : E(t, o, a), Xe(t, g) && v.state.next({ ...r }), v.values.next({
|
|
582
583
|
name: y.mount ? t : void 0,
|
|
583
|
-
values: { ...
|
|
584
|
+
values: { ...l }
|
|
584
585
|
});
|
|
585
|
-
},
|
|
586
|
+
}, oe = async (t) => {
|
|
586
587
|
y.mount = !0;
|
|
587
588
|
const i = t.target;
|
|
588
|
-
let
|
|
589
|
-
const c =
|
|
590
|
-
|
|
589
|
+
let a = i.name, d = !0;
|
|
590
|
+
const c = f(n, a), o = () => i.type ? Te(c._f) : Mt(t), h = (x) => {
|
|
591
|
+
d = Number.isNaN(x) || x === f(l, a, x);
|
|
591
592
|
};
|
|
592
593
|
if (c) {
|
|
593
|
-
let x,
|
|
594
|
-
const
|
|
595
|
-
|
|
596
|
-
const ke =
|
|
597
|
-
if (!
|
|
598
|
-
name:
|
|
594
|
+
let x, p;
|
|
595
|
+
const O = o(), le = t.type === Je.BLUR || t.type === Je.FOCUS_OUT, _t = !Jt(c._f) && !s.resolver && !f(r.errors, a) && !c._f.deps || Qt(le, f(r.touchedFields, a), r.isSubmitted, j, re), De = Xe(a, g, le);
|
|
596
|
+
A(l, a, O), le ? (c._f.onBlur && c._f.onBlur(t), L && L(0)) : c._f.onChange && c._f.onChange(t);
|
|
597
|
+
const ke = Q(a, O, le, !1), mt = !R(ke) || De;
|
|
598
|
+
if (!le && v.values.next({
|
|
599
|
+
name: a,
|
|
599
600
|
type: t.type,
|
|
600
|
-
values: { ...
|
|
601
|
+
values: { ...l }
|
|
601
602
|
}), _t)
|
|
602
|
-
return
|
|
603
|
-
if (!
|
|
604
|
-
const { errors:
|
|
605
|
-
if (h(
|
|
606
|
-
const bt = st(r.errors,
|
|
607
|
-
x =
|
|
603
|
+
return V.isValid && T(), mt && v.state.next({ name: a, ...De ? {} : ke });
|
|
604
|
+
if (!le && De && v.state.next({ ...r }), s.resolver) {
|
|
605
|
+
const { errors: $e } = await ee([a]);
|
|
606
|
+
if (h(O), d) {
|
|
607
|
+
const bt = st(r.errors, n, a), je = st($e, n, bt.name || a);
|
|
608
|
+
x = je.error, a = je.name, p = R($e);
|
|
608
609
|
}
|
|
609
610
|
} else
|
|
610
|
-
|
|
611
|
-
|
|
611
|
+
K([a], !0), x = (await rt(c, l, C, s.shouldUseNativeValidation))[a], K([a]), h(O), d && (x ? p = !1 : V.isValid && (p = await U(n, !0)));
|
|
612
|
+
d && (c._f.deps && de(c._f.deps), ie(a, p, x, ke));
|
|
612
613
|
}
|
|
613
|
-
},
|
|
614
|
-
if (
|
|
614
|
+
}, ce = (t, i) => {
|
|
615
|
+
if (f(r.errors, i) && t.focus)
|
|
615
616
|
return t.focus(), 1;
|
|
616
|
-
},
|
|
617
|
-
let
|
|
617
|
+
}, de = async (t, i = {}) => {
|
|
618
|
+
let a, d;
|
|
618
619
|
const c = _e(t);
|
|
619
620
|
if (s.resolver) {
|
|
620
|
-
const o = await
|
|
621
|
-
|
|
621
|
+
const o = await ae(w(t) ? t : c);
|
|
622
|
+
a = R(o), d = t ? !c.some((h) => f(o, h)) : a;
|
|
622
623
|
} else
|
|
623
|
-
t ? (
|
|
624
|
-
const h =
|
|
625
|
-
return await
|
|
626
|
-
}))).every(Boolean), !(!
|
|
624
|
+
t ? (d = (await Promise.all(c.map(async (o) => {
|
|
625
|
+
const h = f(n, o);
|
|
626
|
+
return await U(h && h._f ? { [o]: h } : h);
|
|
627
|
+
}))).every(Boolean), !(!d && !r.isValid) && T()) : d = a = await U(n);
|
|
627
628
|
return v.state.next({
|
|
628
|
-
...!
|
|
629
|
-
...s.resolver || !t ? { isValid:
|
|
629
|
+
...!G(t) || V.isValid && a !== r.isValid ? {} : { name: t },
|
|
630
|
+
...s.resolver || !t ? { isValid: a } : {},
|
|
630
631
|
errors: r.errors
|
|
631
|
-
}), i.shouldFocus && !
|
|
632
|
-
},
|
|
632
|
+
}), i.shouldFocus && !d && ye(n, ce, t ? c : g.mount), d;
|
|
633
|
+
}, Ne = (t) => {
|
|
633
634
|
const i = {
|
|
634
|
-
...y.mount ?
|
|
635
|
+
...y.mount ? l : u
|
|
635
636
|
};
|
|
636
|
-
return
|
|
637
|
-
},
|
|
638
|
-
invalid: !!
|
|
639
|
-
isDirty: !!
|
|
640
|
-
error:
|
|
641
|
-
isValidating: !!
|
|
642
|
-
isTouched: !!
|
|
637
|
+
return w(t) ? i : G(t) ? f(i, t) : t.map((a) => f(i, a));
|
|
638
|
+
}, Ue = (t, i) => ({
|
|
639
|
+
invalid: !!f((i || r).errors, t),
|
|
640
|
+
isDirty: !!f((i || r).dirtyFields, t),
|
|
641
|
+
error: f((i || r).errors, t),
|
|
642
|
+
isValidating: !!f(r.validatingFields, t),
|
|
643
|
+
isTouched: !!f((i || r).touchedFields, t)
|
|
643
644
|
}), yt = (t) => {
|
|
644
645
|
t && _e(t).forEach((i) => k(r.errors, i)), v.state.next({
|
|
645
646
|
errors: t ? r.errors : {}
|
|
646
647
|
});
|
|
647
|
-
},
|
|
648
|
-
const
|
|
649
|
-
|
|
650
|
-
...
|
|
648
|
+
}, Ie = (t, i, a) => {
|
|
649
|
+
const d = (f(n, t, { _f: {} })._f || {}).ref, c = f(r.errors, t) || {}, { ref: o, message: h, type: x, ...p } = c;
|
|
650
|
+
A(r.errors, t, {
|
|
651
|
+
...p,
|
|
651
652
|
...i,
|
|
652
|
-
ref:
|
|
653
|
+
ref: d
|
|
653
654
|
}), v.state.next({
|
|
654
655
|
name: t,
|
|
655
656
|
errors: r.errors,
|
|
656
657
|
isValid: !1
|
|
657
|
-
}),
|
|
658
|
+
}), a && a.shouldFocus && d && d.focus && d.focus();
|
|
658
659
|
}, ht = (t, i) => Z(t) ? v.values.subscribe({
|
|
659
|
-
next: (
|
|
660
|
+
next: (a) => t(b(void 0, i), a)
|
|
660
661
|
}) : b(t, i, !0), we = (t, i = {}) => {
|
|
661
|
-
for (const
|
|
662
|
-
g.mount.delete(
|
|
662
|
+
for (const a of t ? _e(t) : g.mount)
|
|
663
|
+
g.mount.delete(a), g.array.delete(a), i.keepValue || (k(n, a), k(l, a)), !i.keepError && k(r.errors, a), !i.keepDirty && k(r.dirtyFields, a), !i.keepTouched && k(r.touchedFields, a), !i.keepIsValidating && k(r.validatingFields, a), !s.shouldUnregister && !i.keepDefaultValue && k(u, a);
|
|
663
664
|
v.values.next({
|
|
664
|
-
values: { ...
|
|
665
|
+
values: { ...l }
|
|
665
666
|
}), v.state.next({
|
|
666
667
|
...r,
|
|
667
668
|
...i.keepDirty ? { isDirty: _() } : {}
|
|
668
|
-
}), !i.keepIsValid &&
|
|
669
|
-
},
|
|
669
|
+
}), !i.keepIsValid && T();
|
|
670
|
+
}, qe = ({ disabled: t, name: i, field: a, fields: d, value: c }) => {
|
|
670
671
|
if (Y(t) && y.mount || t) {
|
|
671
|
-
const o = t ? void 0 :
|
|
672
|
-
|
|
672
|
+
const o = t ? void 0 : w(c) ? Te(a ? a._f : f(d, i)._f) : c;
|
|
673
|
+
A(l, i, o), Q(i, o, !1, !1, !0);
|
|
673
674
|
}
|
|
674
675
|
}, pe = (t, i = {}) => {
|
|
675
|
-
let
|
|
676
|
-
const
|
|
677
|
-
return
|
|
678
|
-
...
|
|
676
|
+
let a = f(n, t);
|
|
677
|
+
const d = Y(i.disabled);
|
|
678
|
+
return A(n, t, {
|
|
679
|
+
...a || {},
|
|
679
680
|
_f: {
|
|
680
|
-
...
|
|
681
|
+
...a && a._f ? a._f : { ref: { name: t } },
|
|
681
682
|
name: t,
|
|
682
683
|
mount: !0,
|
|
683
684
|
...i
|
|
684
685
|
}
|
|
685
|
-
}), g.mount.add(t),
|
|
686
|
-
field:
|
|
686
|
+
}), g.mount.add(t), a ? qe({
|
|
687
|
+
field: a,
|
|
687
688
|
disabled: i.disabled,
|
|
688
689
|
name: t,
|
|
689
690
|
value: i.value
|
|
690
|
-
}) :
|
|
691
|
-
...
|
|
691
|
+
}) : F(t, !0, i.value), {
|
|
692
|
+
...d ? { disabled: i.disabled } : {},
|
|
692
693
|
...s.progressive ? {
|
|
693
694
|
required: !!i.required,
|
|
694
695
|
min: fe(i.min),
|
|
@@ -698,94 +699,94 @@ function Xt(e = {}) {
|
|
|
698
699
|
pattern: fe(i.pattern)
|
|
699
700
|
} : {},
|
|
700
701
|
name: t,
|
|
701
|
-
onChange:
|
|
702
|
-
onBlur:
|
|
702
|
+
onChange: oe,
|
|
703
|
+
onBlur: oe,
|
|
703
704
|
ref: (c) => {
|
|
704
705
|
if (c) {
|
|
705
|
-
pe(t, i),
|
|
706
|
-
const o =
|
|
707
|
-
if (h ? x.find((
|
|
706
|
+
pe(t, i), a = f(n, t);
|
|
707
|
+
const o = w(c.value) && c.querySelectorAll && c.querySelectorAll("input,select,textarea")[0] || c, h = Kt(o), x = a._f.refs || [];
|
|
708
|
+
if (h ? x.find((p) => p === o) : o === a._f.ref)
|
|
708
709
|
return;
|
|
709
|
-
|
|
710
|
+
A(n, t, {
|
|
710
711
|
_f: {
|
|
711
|
-
...
|
|
712
|
+
...a._f,
|
|
712
713
|
...h ? {
|
|
713
714
|
refs: [
|
|
714
|
-
...x.filter(
|
|
715
|
+
...x.filter(Be),
|
|
715
716
|
o,
|
|
716
|
-
...Array.isArray(
|
|
717
|
+
...Array.isArray(f(u, t)) ? [{}] : []
|
|
717
718
|
],
|
|
718
719
|
ref: { type: o.type, name: t }
|
|
719
720
|
} : { ref: o }
|
|
720
721
|
}
|
|
721
|
-
}),
|
|
722
|
+
}), F(t, !1, void 0, o);
|
|
722
723
|
} else
|
|
723
|
-
|
|
724
|
+
a = f(n, t, {}), a._f && (a._f.mount = !1), (s.shouldUnregister || i.shouldUnregister) && !(Nt(g.array, t) && y.action) && g.unMount.add(t);
|
|
724
725
|
}
|
|
725
726
|
};
|
|
726
|
-
}, Pe = () => s.shouldFocusError &&
|
|
727
|
-
Y(t) && (v.state.next({ disabled: t }),
|
|
728
|
-
const
|
|
729
|
-
|
|
730
|
-
c.disabled =
|
|
727
|
+
}, Pe = () => s.shouldFocusError && ye(n, ce, g.mount), gt = (t) => {
|
|
728
|
+
Y(t) && (v.state.next({ disabled: t }), ye(n, (i, a) => {
|
|
729
|
+
const d = f(n, a);
|
|
730
|
+
d && (i.disabled = d._f.disabled || t, Array.isArray(d._f.refs) && d._f.refs.forEach((c) => {
|
|
731
|
+
c.disabled = d._f.disabled || t;
|
|
731
732
|
}));
|
|
732
733
|
}, 0, !1));
|
|
733
|
-
},
|
|
734
|
-
let
|
|
735
|
-
|
|
736
|
-
let c =
|
|
734
|
+
}, We = (t, i) => async (a) => {
|
|
735
|
+
let d;
|
|
736
|
+
a && (a.preventDefault && a.preventDefault(), a.persist && a.persist());
|
|
737
|
+
let c = q(l);
|
|
737
738
|
if (v.state.next({
|
|
738
739
|
isSubmitting: !0
|
|
739
740
|
}), s.resolver) {
|
|
740
741
|
const { errors: o, values: h } = await ee();
|
|
741
742
|
r.errors = o, c = h;
|
|
742
743
|
} else
|
|
743
|
-
await
|
|
744
|
-
if (k(r.errors, "root"),
|
|
744
|
+
await U(n);
|
|
745
|
+
if (k(r.errors, "root"), R(r.errors)) {
|
|
745
746
|
v.state.next({
|
|
746
747
|
errors: {}
|
|
747
748
|
});
|
|
748
749
|
try {
|
|
749
|
-
await t(c,
|
|
750
|
+
await t(c, a);
|
|
750
751
|
} catch (o) {
|
|
751
|
-
|
|
752
|
+
d = o;
|
|
752
753
|
}
|
|
753
754
|
} else
|
|
754
|
-
i && await i({ ...r.errors },
|
|
755
|
+
i && await i({ ...r.errors }, a), Pe(), setTimeout(Pe);
|
|
755
756
|
if (v.state.next({
|
|
756
757
|
isSubmitted: !0,
|
|
757
758
|
isSubmitting: !1,
|
|
758
|
-
isSubmitSuccessful:
|
|
759
|
+
isSubmitSuccessful: R(r.errors) && !d,
|
|
759
760
|
submitCount: r.submitCount + 1,
|
|
760
761
|
errors: r.errors
|
|
761
|
-
}),
|
|
762
|
-
throw
|
|
762
|
+
}), d)
|
|
763
|
+
throw d;
|
|
763
764
|
}, vt = (t, i = {}) => {
|
|
764
|
-
|
|
765
|
-
},
|
|
766
|
-
const
|
|
767
|
-
if (i.keepDefaultValues || (u =
|
|
765
|
+
f(n, t) && (w(i.defaultValue) ? I(t, q(f(u, t))) : (I(t, i.defaultValue), A(u, t, q(i.defaultValue))), i.keepTouched || k(r.touchedFields, t), i.keepDirty || (k(r.dirtyFields, t), r.isDirty = i.defaultValue ? _(t, q(f(u, t))) : _()), i.keepError || (k(r.errors, t), V.isValid && T()), v.state.next({ ...r }));
|
|
766
|
+
}, He = (t, i = {}) => {
|
|
767
|
+
const a = t ? q(t) : u, d = q(a), c = R(t), o = c ? u : d;
|
|
768
|
+
if (i.keepDefaultValues || (u = a), !i.keepValues) {
|
|
768
769
|
if (i.keepDirtyValues)
|
|
769
770
|
for (const h of g.mount)
|
|
770
|
-
|
|
771
|
+
f(r.dirtyFields, h) ? A(o, h, f(l, h)) : I(h, f(o, h));
|
|
771
772
|
else {
|
|
772
|
-
if (
|
|
773
|
+
if (Re && w(t))
|
|
773
774
|
for (const h of g.mount) {
|
|
774
|
-
const x =
|
|
775
|
+
const x = f(n, h);
|
|
775
776
|
if (x && x._f) {
|
|
776
|
-
const
|
|
777
|
-
if (be(
|
|
778
|
-
const
|
|
779
|
-
if (
|
|
780
|
-
|
|
777
|
+
const p = Array.isArray(x._f.refs) ? x._f.refs[0] : x._f.ref;
|
|
778
|
+
if (be(p)) {
|
|
779
|
+
const O = p.closest("form");
|
|
780
|
+
if (O) {
|
|
781
|
+
O.reset();
|
|
781
782
|
break;
|
|
782
783
|
}
|
|
783
784
|
}
|
|
784
785
|
}
|
|
785
786
|
}
|
|
786
|
-
|
|
787
|
+
n = {};
|
|
787
788
|
}
|
|
788
|
-
|
|
789
|
+
l = e.shouldUnregister ? i.keepDefaultValues ? q(u) : {} : q(o), v.array.next({
|
|
789
790
|
values: { ...o }
|
|
790
791
|
}), v.values.next({
|
|
791
792
|
values: { ...o }
|
|
@@ -798,35 +799,35 @@ function Xt(e = {}) {
|
|
|
798
799
|
watch: /* @__PURE__ */ new Set(),
|
|
799
800
|
watchAll: !1,
|
|
800
801
|
focus: ""
|
|
801
|
-
}, y.mount = !
|
|
802
|
+
}, y.mount = !V.isValid || !!i.keepIsValid || !!i.keepDirtyValues, y.watch = !!e.shouldUnregister, v.state.next({
|
|
802
803
|
submitCount: i.keepSubmitCount ? r.submitCount : 0,
|
|
803
804
|
isDirty: c ? !1 : i.keepDirty ? r.isDirty : !!(i.keepDefaultValues && !te(t, u)),
|
|
804
805
|
isSubmitted: i.keepIsSubmitted ? r.isSubmitted : !1,
|
|
805
|
-
dirtyFields: c ? {} : i.keepDirtyValues ? i.keepDefaultValues &&
|
|
806
|
+
dirtyFields: c ? {} : i.keepDirtyValues ? i.keepDefaultValues && l ? ve(u, l) : r.dirtyFields : i.keepDefaultValues && t ? ve(u, t) : i.keepDirty ? r.dirtyFields : {},
|
|
806
807
|
touchedFields: i.keepTouched ? r.touchedFields : {},
|
|
807
808
|
errors: i.keepErrors ? r.errors : {},
|
|
808
809
|
isSubmitSuccessful: i.keepIsSubmitSuccessful ? r.isSubmitSuccessful : !1,
|
|
809
810
|
isSubmitting: !1
|
|
810
811
|
});
|
|
811
|
-
},
|
|
812
|
+
}, ze = (t, i) => He(Z(t) ? t(l) : t, i);
|
|
812
813
|
return {
|
|
813
814
|
control: {
|
|
814
815
|
register: pe,
|
|
815
816
|
unregister: we,
|
|
816
|
-
getFieldState:
|
|
817
|
-
handleSubmit:
|
|
818
|
-
setError:
|
|
817
|
+
getFieldState: Ue,
|
|
818
|
+
handleSubmit: We,
|
|
819
|
+
setError: Ie,
|
|
819
820
|
_executeSchema: ee,
|
|
820
821
|
_getWatch: b,
|
|
821
822
|
_getDirty: _,
|
|
822
|
-
_updateValid:
|
|
823
|
+
_updateValid: T,
|
|
823
824
|
_removeUnmounted: ge,
|
|
824
825
|
_updateFieldArray: m,
|
|
825
|
-
_updateDisabledField:
|
|
826
|
+
_updateDisabledField: qe,
|
|
826
827
|
_getFieldArray: D,
|
|
827
|
-
_reset:
|
|
828
|
+
_reset: He,
|
|
828
829
|
_resetDefaultValues: () => Z(s.defaultValues) && s.defaultValues().then((t) => {
|
|
829
|
-
|
|
830
|
+
ze(t, s.resetOptions), v.state.next({
|
|
830
831
|
isLoading: !1
|
|
831
832
|
});
|
|
832
833
|
}),
|
|
@@ -838,13 +839,13 @@ function Xt(e = {}) {
|
|
|
838
839
|
},
|
|
839
840
|
_disableForm: gt,
|
|
840
841
|
_subjects: v,
|
|
841
|
-
_proxyFormState:
|
|
842
|
-
_setErrors:
|
|
842
|
+
_proxyFormState: V,
|
|
843
|
+
_setErrors: H,
|
|
843
844
|
get _fields() {
|
|
844
|
-
return
|
|
845
|
+
return n;
|
|
845
846
|
},
|
|
846
847
|
get _formValues() {
|
|
847
|
-
return
|
|
848
|
+
return l;
|
|
848
849
|
},
|
|
849
850
|
get _state() {
|
|
850
851
|
return y;
|
|
@@ -877,29 +878,29 @@ function Xt(e = {}) {
|
|
|
877
878
|
};
|
|
878
879
|
}
|
|
879
880
|
},
|
|
880
|
-
trigger:
|
|
881
|
+
trigger: de,
|
|
881
882
|
register: pe,
|
|
882
|
-
handleSubmit:
|
|
883
|
+
handleSubmit: We,
|
|
883
884
|
watch: ht,
|
|
884
|
-
setValue:
|
|
885
|
-
getValues:
|
|
886
|
-
reset:
|
|
885
|
+
setValue: I,
|
|
886
|
+
getValues: Ne,
|
|
887
|
+
reset: ze,
|
|
887
888
|
resetField: vt,
|
|
888
889
|
clearErrors: yt,
|
|
889
890
|
unregister: we,
|
|
890
|
-
setError:
|
|
891
|
+
setError: Ie,
|
|
891
892
|
setFocus: (t, i = {}) => {
|
|
892
|
-
const
|
|
893
|
-
if (
|
|
894
|
-
const c =
|
|
893
|
+
const a = f(n, t), d = a && a._f;
|
|
894
|
+
if (d) {
|
|
895
|
+
const c = d.refs ? d.refs[0] : d.ref;
|
|
895
896
|
c.focus && (c.focus(), i.shouldSelect && c.select());
|
|
896
897
|
}
|
|
897
898
|
},
|
|
898
|
-
getFieldState:
|
|
899
|
+
getFieldState: Ue
|
|
899
900
|
};
|
|
900
901
|
}
|
|
901
|
-
function
|
|
902
|
-
const s =
|
|
902
|
+
function er(e = {}) {
|
|
903
|
+
const s = P.useRef(), r = P.useRef(), [n, u] = P.useState({
|
|
903
904
|
isDirty: !1,
|
|
904
905
|
isValidating: !1,
|
|
905
906
|
isLoading: Z(e.defaultValues),
|
|
@@ -916,60 +917,64 @@ function Yt(e = {}) {
|
|
|
916
917
|
defaultValues: Z(e.defaultValues) ? void 0 : e.defaultValues
|
|
917
918
|
});
|
|
918
919
|
s.current || (s.current = {
|
|
919
|
-
...
|
|
920
|
-
formState:
|
|
920
|
+
...Zt(e),
|
|
921
|
+
formState: n
|
|
921
922
|
});
|
|
922
|
-
const
|
|
923
|
-
return
|
|
924
|
-
subject:
|
|
923
|
+
const l = s.current.control;
|
|
924
|
+
return l._options = e, Pt({
|
|
925
|
+
subject: l._subjects.state,
|
|
925
926
|
next: (y) => {
|
|
926
|
-
|
|
927
|
+
qt(y, l._proxyFormState, l._updateFormState) && u({ ...l._formState });
|
|
927
928
|
}
|
|
928
|
-
}),
|
|
929
|
-
if (
|
|
930
|
-
const y =
|
|
931
|
-
y !==
|
|
929
|
+
}), P.useEffect(() => l._disableForm(e.disabled), [l, e.disabled]), P.useEffect(() => {
|
|
930
|
+
if (l._proxyFormState.isDirty) {
|
|
931
|
+
const y = l._getDirty();
|
|
932
|
+
y !== n.isDirty && l._subjects.state.next({
|
|
932
933
|
isDirty: y
|
|
933
934
|
});
|
|
934
935
|
}
|
|
935
|
-
}, [
|
|
936
|
-
e.values && !te(e.values, r.current) ? (
|
|
937
|
-
}, [e.values,
|
|
938
|
-
e.errors &&
|
|
939
|
-
}, [e.errors,
|
|
940
|
-
|
|
941
|
-
}),
|
|
942
|
-
e.shouldUnregister &&
|
|
943
|
-
values:
|
|
936
|
+
}, [l, n.isDirty]), P.useEffect(() => {
|
|
937
|
+
e.values && !te(e.values, r.current) ? (l._reset(e.values, l._options.resetOptions), r.current = e.values, u((y) => ({ ...y }))) : l._resetDefaultValues();
|
|
938
|
+
}, [e.values, l]), P.useEffect(() => {
|
|
939
|
+
e.errors && l._setErrors(e.errors);
|
|
940
|
+
}, [e.errors, l]), P.useEffect(() => {
|
|
941
|
+
l._state.mount || (l._updateValid(), l._state.mount = !0), l._state.watch && (l._state.watch = !1, l._subjects.state.next({ ...l._formState })), l._removeUnmounted();
|
|
942
|
+
}), P.useEffect(() => {
|
|
943
|
+
e.shouldUnregister && l._subjects.values.next({
|
|
944
|
+
values: l._getWatch()
|
|
944
945
|
});
|
|
945
|
-
}, [e.shouldUnregister,
|
|
946
|
+
}, [e.shouldUnregister, l]), s.current.formState = It(n, l), s.current;
|
|
946
947
|
}
|
|
947
948
|
const it = `Я принимаю условия Политики обработки
|
|
948
949
|
и защиты персональных данных, даю согласия на обработку персональных
|
|
949
|
-
данных`,
|
|
950
|
+
данных`, gr = ({
|
|
950
951
|
isFormOpen: e,
|
|
951
952
|
setIsFormOpen: s,
|
|
952
953
|
title: r,
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
954
|
+
isEmail: n,
|
|
955
|
+
isTextArea: u,
|
|
956
|
+
textAreaPlaceholder: l,
|
|
957
|
+
subTitle: y,
|
|
958
|
+
submitHandler: g,
|
|
959
|
+
rowsTextArea: L = 2,
|
|
960
|
+
personalCheckBox: M = { text: it, isRequired: !0 },
|
|
961
|
+
advCheckBox: V = { text: it, isRequired: !0 }
|
|
957
962
|
}) => {
|
|
958
963
|
const {
|
|
959
|
-
register:
|
|
960
|
-
handleSubmit:
|
|
961
|
-
trigger:
|
|
962
|
-
reset:
|
|
963
|
-
watch:
|
|
964
|
-
formState: { errors:
|
|
965
|
-
} =
|
|
964
|
+
register: v,
|
|
965
|
+
handleSubmit: re,
|
|
966
|
+
trigger: j,
|
|
967
|
+
reset: C,
|
|
968
|
+
watch: se,
|
|
969
|
+
formState: { errors: T }
|
|
970
|
+
} = er(), { onChange: K, onBlur: m, ...W } = v("phone", {
|
|
966
971
|
required: !0,
|
|
967
972
|
pattern: { value: wt, message: "" },
|
|
968
|
-
onBlur: () =>
|
|
969
|
-
}),
|
|
970
|
-
|
|
973
|
+
onBlur: () => j("phone")
|
|
974
|
+
}), H = se("personalCheckBox"), F = se("advCheckBox"), Q = (ie) => {
|
|
975
|
+
g(ie), C();
|
|
971
976
|
};
|
|
972
|
-
return /* @__PURE__ */
|
|
977
|
+
return /* @__PURE__ */ N(
|
|
973
978
|
Vt,
|
|
974
979
|
{
|
|
975
980
|
isOpen: e,
|
|
@@ -979,73 +984,98 @@ const it = `Я принимаю условия Политики обработк
|
|
|
979
984
|
isTransparentBack: !0,
|
|
980
985
|
additionalClassModalBody: X.modalBody,
|
|
981
986
|
children: /* @__PURE__ */ Se("div", { className: X.root, children: [
|
|
982
|
-
/* @__PURE__ */
|
|
983
|
-
/* @__PURE__ */
|
|
987
|
+
/* @__PURE__ */ N("div", { className: X.title, dangerouslySetInnerHTML: { __html: r ?? "Оставить обращение" } }),
|
|
988
|
+
/* @__PURE__ */ N(
|
|
984
989
|
"div",
|
|
985
990
|
{
|
|
986
991
|
className: X.description,
|
|
987
|
-
dangerouslySetInnerHTML: { __html:
|
|
992
|
+
dangerouslySetInnerHTML: { __html: y ?? "Оставьте номер телефона для получения консультации" }
|
|
988
993
|
}
|
|
989
994
|
),
|
|
990
|
-
/* @__PURE__ */ Se("form", { onSubmit:
|
|
991
|
-
/* @__PURE__ */ Se(
|
|
992
|
-
/* @__PURE__ */
|
|
993
|
-
|
|
995
|
+
/* @__PURE__ */ Se("form", { onSubmit: re(Q), children: [
|
|
996
|
+
/* @__PURE__ */ Se(At, { className: X.inputWrapper, children: [
|
|
997
|
+
/* @__PURE__ */ N(
|
|
998
|
+
Ee,
|
|
994
999
|
{
|
|
995
1000
|
width: "full",
|
|
996
1001
|
size_s: "small",
|
|
997
1002
|
variant: "light",
|
|
998
1003
|
placeholder: "Введите имя",
|
|
999
1004
|
"data-testid": "modal_name",
|
|
1000
|
-
...
|
|
1001
|
-
error: !!
|
|
1005
|
+
...v("name", { required: !0, pattern: pt }),
|
|
1006
|
+
error: !!T.name
|
|
1002
1007
|
}
|
|
1003
1008
|
),
|
|
1004
|
-
/* @__PURE__ */
|
|
1009
|
+
/* @__PURE__ */ N(
|
|
1005
1010
|
xt,
|
|
1006
1011
|
{
|
|
1007
1012
|
inputMode: "numeric",
|
|
1008
1013
|
name: "phone",
|
|
1009
1014
|
mask: "+7 (999) 999-99-99",
|
|
1010
|
-
onChange:
|
|
1015
|
+
onChange: K,
|
|
1011
1016
|
placeholder: "+7 (- - -) - - - - - - -",
|
|
1012
|
-
onBlur:
|
|
1013
|
-
children: /* @__PURE__ */
|
|
1014
|
-
|
|
1017
|
+
onBlur: m,
|
|
1018
|
+
children: /* @__PURE__ */ N(
|
|
1019
|
+
Ee,
|
|
1015
1020
|
{
|
|
1016
1021
|
width: "full",
|
|
1017
1022
|
"data-testid": "phone_modal",
|
|
1018
1023
|
type: "tel",
|
|
1019
1024
|
size_s: "small",
|
|
1020
1025
|
variant: "light",
|
|
1021
|
-
...
|
|
1022
|
-
...
|
|
1023
|
-
error: !!
|
|
1026
|
+
...W,
|
|
1027
|
+
...v("phone"),
|
|
1028
|
+
error: !!T.phone
|
|
1024
1029
|
}
|
|
1025
1030
|
)
|
|
1026
1031
|
}
|
|
1027
1032
|
),
|
|
1028
|
-
|
|
1033
|
+
n && /* @__PURE__ */ N(
|
|
1034
|
+
Ee,
|
|
1035
|
+
{
|
|
1036
|
+
width: "full",
|
|
1037
|
+
size_s: "small",
|
|
1038
|
+
variant: "light",
|
|
1039
|
+
placeholder: "Введите email",
|
|
1040
|
+
"data-testid": "modal_email",
|
|
1041
|
+
...v(
|
|
1042
|
+
"email",
|
|
1043
|
+
{ required: !1, pattern: Dt }
|
|
1044
|
+
),
|
|
1045
|
+
error: !!T.email
|
|
1046
|
+
}
|
|
1047
|
+
),
|
|
1048
|
+
u && /* @__PURE__ */ N(
|
|
1049
|
+
kt,
|
|
1050
|
+
{
|
|
1051
|
+
"data-testid": "modal_textarea",
|
|
1052
|
+
placeholder: l,
|
|
1053
|
+
rows: L,
|
|
1054
|
+
width: "full",
|
|
1055
|
+
...v("textarea")
|
|
1056
|
+
}
|
|
1057
|
+
),
|
|
1058
|
+
V && /* @__PURE__ */ N(
|
|
1029
1059
|
Ge,
|
|
1030
1060
|
{
|
|
1031
1061
|
"data-testid": "modal_advCheckBox",
|
|
1032
|
-
isChecked:
|
|
1033
|
-
error: !!
|
|
1034
|
-
text:
|
|
1035
|
-
...
|
|
1062
|
+
isChecked: F,
|
|
1063
|
+
error: !!T.advCheckBox,
|
|
1064
|
+
text: V.text,
|
|
1065
|
+
...v("advCheckBox", { required: V == null ? void 0 : V.isRequired })
|
|
1036
1066
|
}
|
|
1037
1067
|
),
|
|
1038
|
-
/* @__PURE__ */
|
|
1068
|
+
/* @__PURE__ */ N(
|
|
1039
1069
|
Ge,
|
|
1040
1070
|
{
|
|
1041
1071
|
"data-testid": "modal_personalCheckBox",
|
|
1042
|
-
isChecked:
|
|
1043
|
-
error: !!
|
|
1044
|
-
text:
|
|
1045
|
-
...
|
|
1072
|
+
isChecked: H,
|
|
1073
|
+
error: !!T.personalCheckBox,
|
|
1074
|
+
text: M.text,
|
|
1075
|
+
...v("personalCheckBox", { required: M.isRequired })
|
|
1046
1076
|
}
|
|
1047
1077
|
),
|
|
1048
|
-
/* @__PURE__ */
|
|
1078
|
+
/* @__PURE__ */ N(
|
|
1049
1079
|
Ke,
|
|
1050
1080
|
{
|
|
1051
1081
|
"data-testid": "modal_submit",
|
|
@@ -1059,7 +1089,7 @@ const it = `Я принимаю условия Политики обработк
|
|
|
1059
1089
|
}
|
|
1060
1090
|
)
|
|
1061
1091
|
] }),
|
|
1062
|
-
/* @__PURE__ */
|
|
1092
|
+
/* @__PURE__ */ N(
|
|
1063
1093
|
Ke,
|
|
1064
1094
|
{
|
|
1065
1095
|
additionalClass: X.btn,
|
|
@@ -1068,8 +1098,8 @@ const it = `Я принимаю условия Политики обработк
|
|
|
1068
1098
|
variant: "gray",
|
|
1069
1099
|
type: "button",
|
|
1070
1100
|
size: "small",
|
|
1071
|
-
children: /* @__PURE__ */
|
|
1072
|
-
|
|
1101
|
+
children: /* @__PURE__ */ N(
|
|
1102
|
+
Ft,
|
|
1073
1103
|
{
|
|
1074
1104
|
name: "close",
|
|
1075
1105
|
size: "16",
|
|
@@ -1084,5 +1114,5 @@ const it = `Я принимаю условия Политики обработк
|
|
|
1084
1114
|
);
|
|
1085
1115
|
};
|
|
1086
1116
|
export {
|
|
1087
|
-
|
|
1117
|
+
gr as ModalForm
|
|
1088
1118
|
};
|