stone-kit 0.0.422 → 0.0.424
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/README.md +59 -59
- package/dist/components/FormModal/ui/ModalForm.js +176 -175
- package/dist/components/FormModal/utils/reg.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
# Stone-kit
|
|
2
|
-
|
|
3
|
-
Uikit for stone redesign 2.0
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
Package installation:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm i stone-kit@latest
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
For Next.js page router in App.tsx:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
import 'stone-kit/dist/style.css'
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
and then:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
import {Button} from 'stone-kit'
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
For other projects u can immediately:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
import {Button} from 'stone-kit'
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Docs
|
|
34
|
-
|
|
35
|
-
### ButtonProps
|
|
36
|
-
|
|
37
|
-
size: optional, size of button. types : 'large' | 'medium' | 'small' | 'tiny'
|
|
38
|
-
|
|
39
|
-
pre: optional, insert icon/text before button text. type: ReactNode
|
|
40
|
-
|
|
41
|
-
post: optional, insert icon/text after button text. type: ReactNode
|
|
42
|
-
|
|
43
|
-
variant: optional, color variants of button. type:
|
|
44
|
-
'blue',
|
|
45
|
-
'gray',
|
|
46
|
-
'whiteStroke',
|
|
47
|
-
'sokolniki',
|
|
48
|
-
'black',
|
|
49
|
-
'whiteFilled'
|
|
50
|
-
|
|
51
|
-
width: optional, width of button. type: 'auto' | 'full'
|
|
52
|
-
|
|
53
|
-
additionalClass: optional, add your custom class to button. type: 'string'
|
|
54
|
-
|
|
55
|
-
as: optional, u can convert button to link. type: 'button' | 'link'. 'button' by default.
|
|
56
|
-
|
|
57
|
-
### MobileButtonProps
|
|
58
|
-
|
|
59
|
-
### Tag
|
|
1
|
+
# Stone-kit
|
|
2
|
+
|
|
3
|
+
Uikit for stone redesign 2.0
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Package installation:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i stone-kit@latest
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
For Next.js page router in App.tsx:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
import 'stone-kit/dist/style.css'
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
and then:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
import {Button} from 'stone-kit'
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
For other projects u can immediately:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
import {Button} from 'stone-kit'
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Docs
|
|
34
|
+
|
|
35
|
+
### ButtonProps
|
|
36
|
+
|
|
37
|
+
size: optional, size of button. types : 'large' | 'medium' | 'small' | 'tiny'
|
|
38
|
+
|
|
39
|
+
pre: optional, insert icon/text before button text. type: ReactNode
|
|
40
|
+
|
|
41
|
+
post: optional, insert icon/text after button text. type: ReactNode
|
|
42
|
+
|
|
43
|
+
variant: optional, color variants of button. type:
|
|
44
|
+
'blue',
|
|
45
|
+
'gray',
|
|
46
|
+
'whiteStroke',
|
|
47
|
+
'sokolniki',
|
|
48
|
+
'black',
|
|
49
|
+
'whiteFilled'
|
|
50
|
+
|
|
51
|
+
width: optional, width of button. type: 'auto' | 'full'
|
|
52
|
+
|
|
53
|
+
additionalClass: optional, add your custom class to button. type: 'string'
|
|
54
|
+
|
|
55
|
+
as: optional, u can convert button to link. type: 'button' | 'link'. 'button' by default.
|
|
56
|
+
|
|
57
|
+
### MobileButtonProps
|
|
58
|
+
|
|
59
|
+
### Tag
|
|
@@ -6,16 +6,16 @@ import { Input as Ee } from "../../Input/ui/Input.js";
|
|
|
6
6
|
import $ from "react";
|
|
7
7
|
import { Button as Ke } from "../../Button/ui/Button.js";
|
|
8
8
|
import { NewIcon as Ge } from "../../NewIcon/ui/NewIcon.js";
|
|
9
|
-
import { phoneReg as
|
|
9
|
+
import { phoneReg as pr, nameReg as Ar, emailReg as kr } from "../utils/reg.js";
|
|
10
10
|
import { CheckBox as Je } from "../../CheckBox/CheckBox.js";
|
|
11
11
|
import { TextArea as wr } from "../../TextArea/TextArea.js";
|
|
12
12
|
import { useClientWidth as Dr } from "../../../shared/useClientWidth.js";
|
|
13
|
-
const Sr = "_btn_7n08v_1", Er = "_modal_7n08v_9",
|
|
13
|
+
const Sr = "_btn_7n08v_1", Er = "_modal_7n08v_9", Tr = "_modalBody_7n08v_16", Br = "_root_7n08v_21", Cr = "_title_7n08v_34", Lr = "_description_7n08v_41", Rr = "_inputWrapper_7n08v_48", Mr = "_linkPolicy_7n08v_55", Or = "_telegramLink_7n08v_60", Nr = "_telegramWrapper_7n08v_65", Ur = "_telegram_7n08v_60", Ir = "_orText_7n08v_88", U = {
|
|
14
14
|
btn: Sr,
|
|
15
15
|
modal: Er,
|
|
16
|
-
modalBody:
|
|
17
|
-
root:
|
|
18
|
-
title:
|
|
16
|
+
modalBody: Tr,
|
|
17
|
+
root: Br,
|
|
18
|
+
title: Cr,
|
|
19
19
|
description: Lr,
|
|
20
20
|
inputWrapper: Rr,
|
|
21
21
|
linkPolicy: Mr,
|
|
@@ -24,9 +24,9 @@ const Sr = "_btn_7n08v_1", Er = "_modal_7n08v_9", Cr = "_modalBody_7n08v_16", Tr
|
|
|
24
24
|
telegram: Ur,
|
|
25
25
|
orText: Ir
|
|
26
26
|
};
|
|
27
|
-
var ve = (e) => e.type === "checkbox", ue = (e) => e instanceof Date,
|
|
27
|
+
var ve = (e) => e.type === "checkbox", ue = (e) => e instanceof Date, M = (e) => e == null;
|
|
28
28
|
const lr = (e) => typeof e == "object";
|
|
29
|
-
var E = (e) => !
|
|
29
|
+
var E = (e) => !M(e) && !Array.isArray(e) && lr(e) && !ue(e), Pr = (e) => E(e) && e.target ? ve(e.target) ? e.target.checked : e.target.value : e, Wr = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, qr = (e, s) => e.has(Wr(s)), Hr = (e) => {
|
|
30
30
|
const s = e.constructor && e.constructor.prototype;
|
|
31
31
|
return E(s) && s.hasOwnProperty("isPrototypeOf");
|
|
32
32
|
}, Le = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
@@ -47,24 +47,24 @@ function z(e) {
|
|
|
47
47
|
return e;
|
|
48
48
|
return s;
|
|
49
49
|
}
|
|
50
|
-
var
|
|
50
|
+
var Ae = (e) => Array.isArray(e) ? e.filter(Boolean) : [], k = (e) => e === void 0, f = (e, s, t) => {
|
|
51
51
|
if (!s || !E(e))
|
|
52
52
|
return t;
|
|
53
|
-
const n =
|
|
53
|
+
const n = Ae(s.split(/[,[\].]+?/)).reduce((o, a) => M(o) ? o : o[a], e);
|
|
54
54
|
return k(n) || n === e ? k(e[s]) ? t : e[s] : n;
|
|
55
|
-
}, re = (e) => typeof e == "boolean", Re = (e) => /^\w*$/.test(e), ar = (e) =>
|
|
55
|
+
}, re = (e) => typeof e == "boolean", Re = (e) => /^\w*$/.test(e), ar = (e) => Ae(e.replace(/["|']|\]/g, "").split(/\.|\[/)), V = (e, s, t) => {
|
|
56
56
|
let n = -1;
|
|
57
57
|
const o = Re(s) ? [s] : ar(s), a = o.length, y = a - 1;
|
|
58
58
|
for (; ++n < a; ) {
|
|
59
59
|
const g = o[n];
|
|
60
|
-
let
|
|
60
|
+
let O = t;
|
|
61
61
|
if (n !== y) {
|
|
62
|
-
const
|
|
63
|
-
|
|
62
|
+
const P = e[g];
|
|
63
|
+
O = E(P) || Array.isArray(P) ? P : isNaN(+o[n + 1]) ? {} : [];
|
|
64
64
|
}
|
|
65
65
|
if (g === "__proto__")
|
|
66
66
|
return;
|
|
67
|
-
e[g] =
|
|
67
|
+
e[g] = O, e = e[g];
|
|
68
68
|
}
|
|
69
69
|
return e;
|
|
70
70
|
};
|
|
@@ -100,10 +100,10 @@ var zr = (e, s, t, n = !0) => {
|
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
return o;
|
|
103
|
-
},
|
|
103
|
+
}, I = (e) => E(e) && !Object.keys(e).length, $r = (e, s, t, n) => {
|
|
104
104
|
t(e);
|
|
105
105
|
const { name: o, ...a } = e;
|
|
106
|
-
return
|
|
106
|
+
return I(a) || Object.keys(a).length >= Object.keys(s).length || Object.keys(a).find((y) => s[y] === G.all);
|
|
107
107
|
}, me = (e) => Array.isArray(e) ? e : [e];
|
|
108
108
|
function jr(e) {
|
|
109
109
|
const s = $.useRef(e);
|
|
@@ -191,85 +191,85 @@ var oe = (e) => E(e) && !Ve(e) ? e : {
|
|
|
191
191
|
value: e,
|
|
192
192
|
message: ""
|
|
193
193
|
}, sr = async (e, s, t, n, o) => {
|
|
194
|
-
const { ref: a, refs: y, required: g, maxLength:
|
|
195
|
-
if (!
|
|
194
|
+
const { ref: a, refs: y, required: g, maxLength: O, minLength: P, min: F, max: _, pattern: le, validate: J, name: R, valueAsNumber: ce, mount: B, disabled: L } = e._f, m = f(s, R);
|
|
195
|
+
if (!B || L)
|
|
196
196
|
return {};
|
|
197
197
|
const j = y ? y[0] : a, K = (v) => {
|
|
198
198
|
n && j.reportValidity && (j.setCustomValidity(re(v) ? "" : v || ""), j.reportValidity());
|
|
199
|
-
},
|
|
200
|
-
const H = v ? b :
|
|
201
|
-
|
|
202
|
-
type: v ?
|
|
199
|
+
}, p = {}, C = Oe(a), se = ve(a), X = C || se, Z = (ce || Me(a)) && k(a.value) && k(m) || xe(a) && a.value === "" || m === "" || Array.isArray(m) && !m.length, N = Gr.bind(null, R, t, p), ae = (v, b, A, T = Y.maxLength, W = Y.minLength) => {
|
|
200
|
+
const H = v ? b : A;
|
|
201
|
+
p[R] = {
|
|
202
|
+
type: v ? T : W,
|
|
203
203
|
message: H,
|
|
204
204
|
ref: a,
|
|
205
|
-
...
|
|
205
|
+
...N(v ? T : W, H)
|
|
206
206
|
};
|
|
207
207
|
};
|
|
208
|
-
if (o ? !Array.isArray(m) || !m.length : g && (!X && (Z ||
|
|
208
|
+
if (o ? !Array.isArray(m) || !m.length : g && (!X && (Z || M(m)) || re(m) && !m || se && !nr(y).isValid || C && !or(y).isValid)) {
|
|
209
209
|
const { value: v, message: b } = be(g) ? { value: !!g, message: g } : oe(g);
|
|
210
|
-
if (v && (
|
|
210
|
+
if (v && (p[R] = {
|
|
211
211
|
type: Y.required,
|
|
212
212
|
message: b,
|
|
213
213
|
ref: j,
|
|
214
|
-
...
|
|
214
|
+
...N(Y.required, b)
|
|
215
215
|
}, !t))
|
|
216
|
-
return K(b),
|
|
216
|
+
return K(b), p;
|
|
217
217
|
}
|
|
218
|
-
if (!Z && (!
|
|
218
|
+
if (!Z && (!M(F) || !M(_))) {
|
|
219
219
|
let v, b;
|
|
220
|
-
const
|
|
221
|
-
if (!
|
|
222
|
-
const
|
|
223
|
-
|
|
220
|
+
const A = oe(_), T = oe(F);
|
|
221
|
+
if (!M(m) && !isNaN(m)) {
|
|
222
|
+
const W = a.valueAsNumber || m && +m;
|
|
223
|
+
M(A.value) || (v = W > A.value), M(T.value) || (b = W < T.value);
|
|
224
224
|
} else {
|
|
225
|
-
const
|
|
226
|
-
Q(
|
|
225
|
+
const W = a.valueAsDate || new Date(m), H = (ye) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ye), de = a.type == "time", fe = a.type == "week";
|
|
226
|
+
Q(A.value) && m && (v = de ? H(m) > H(A.value) : fe ? m > A.value : W > new Date(A.value)), Q(T.value) && m && (b = de ? H(m) < H(T.value) : fe ? m < T.value : W < new Date(T.value));
|
|
227
227
|
}
|
|
228
|
-
if ((v || b) && (ae(!!v,
|
|
229
|
-
return K(
|
|
228
|
+
if ((v || b) && (ae(!!v, A.message, T.message, Y.max, Y.min), !t))
|
|
229
|
+
return K(p[R].message), p;
|
|
230
230
|
}
|
|
231
|
-
if ((
|
|
232
|
-
const v = oe(
|
|
233
|
-
if ((
|
|
234
|
-
return K(
|
|
231
|
+
if ((O || P) && !Z && (Q(m) || o && Array.isArray(m))) {
|
|
232
|
+
const v = oe(O), b = oe(P), A = !M(v.value) && m.length > +v.value, T = !M(b.value) && m.length < +b.value;
|
|
233
|
+
if ((A || T) && (ae(A, v.message, b.message), !t))
|
|
234
|
+
return K(p[R].message), p;
|
|
235
235
|
}
|
|
236
236
|
if (le && !Z && Q(m)) {
|
|
237
237
|
const { value: v, message: b } = oe(le);
|
|
238
|
-
if (Ve(v) && !m.match(v) && (
|
|
238
|
+
if (Ve(v) && !m.match(v) && (p[R] = {
|
|
239
239
|
type: Y.pattern,
|
|
240
240
|
message: b,
|
|
241
241
|
ref: a,
|
|
242
|
-
...
|
|
242
|
+
...N(Y.pattern, b)
|
|
243
243
|
}, !t))
|
|
244
|
-
return K(b),
|
|
244
|
+
return K(b), p;
|
|
245
245
|
}
|
|
246
246
|
if (J) {
|
|
247
247
|
if (te(J)) {
|
|
248
248
|
const v = await J(m, s), b = tr(v, j);
|
|
249
|
-
if (b && (
|
|
249
|
+
if (b && (p[R] = {
|
|
250
250
|
...b,
|
|
251
|
-
...
|
|
251
|
+
...N(Y.validate, b.message)
|
|
252
252
|
}, !t))
|
|
253
|
-
return K(b.message),
|
|
253
|
+
return K(b.message), p;
|
|
254
254
|
} else if (E(J)) {
|
|
255
255
|
let v = {};
|
|
256
256
|
for (const b in J) {
|
|
257
|
-
if (!
|
|
257
|
+
if (!I(v) && !t)
|
|
258
258
|
break;
|
|
259
|
-
const
|
|
260
|
-
|
|
261
|
-
...
|
|
262
|
-
...
|
|
263
|
-
}, K(
|
|
259
|
+
const A = tr(await J[b](m, s), j, b);
|
|
260
|
+
A && (v = {
|
|
261
|
+
...A,
|
|
262
|
+
...N(b, A.message)
|
|
263
|
+
}, K(A.message), t && (p[R] = v));
|
|
264
264
|
}
|
|
265
|
-
if (!
|
|
265
|
+
if (!I(v) && (p[R] = {
|
|
266
266
|
ref: j,
|
|
267
267
|
...v
|
|
268
268
|
}, !t))
|
|
269
|
-
return
|
|
269
|
+
return p;
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
return K(!0),
|
|
272
|
+
return K(!0), p;
|
|
273
273
|
};
|
|
274
274
|
function Qr(e, s) {
|
|
275
275
|
const t = s.slice(0, -1).length;
|
|
@@ -286,9 +286,9 @@ function Xr(e) {
|
|
|
286
286
|
}
|
|
287
287
|
function S(e, s) {
|
|
288
288
|
const t = Array.isArray(s) ? s : Re(s) ? [s] : ar(s), n = t.length === 1 ? e : Qr(e, t), o = t.length - 1, a = t[o];
|
|
289
|
-
return n && delete n[a], o !== 0 && (E(n) &&
|
|
289
|
+
return n && delete n[a], o !== 0 && (E(n) && I(n) || Array.isArray(n) && Xr(n)) && S(e, t.slice(0, -1)), e;
|
|
290
290
|
}
|
|
291
|
-
var
|
|
291
|
+
var Te = () => {
|
|
292
292
|
let e = [];
|
|
293
293
|
return {
|
|
294
294
|
get observers() {
|
|
@@ -307,7 +307,7 @@ var Ce = () => {
|
|
|
307
307
|
e = [];
|
|
308
308
|
}
|
|
309
309
|
};
|
|
310
|
-
}, Fe = (e) =>
|
|
310
|
+
}, Fe = (e) => M(e) || !lr(e);
|
|
311
311
|
function ie(e, s) {
|
|
312
312
|
if (Fe(e) || Fe(s))
|
|
313
313
|
return e === s;
|
|
@@ -328,28 +328,28 @@ function ie(e, s) {
|
|
|
328
328
|
}
|
|
329
329
|
return !0;
|
|
330
330
|
}
|
|
331
|
-
var ur = (e) => e.type === "select-multiple", Yr = (e) => Oe(e) || ve(e),
|
|
331
|
+
var ur = (e) => e.type === "select-multiple", Yr = (e) => Oe(e) || ve(e), Be = (e) => xe(e) && e.isConnected, cr = (e) => {
|
|
332
332
|
for (const s in e)
|
|
333
333
|
if (te(e[s]))
|
|
334
334
|
return !0;
|
|
335
335
|
return !1;
|
|
336
336
|
};
|
|
337
|
-
function
|
|
337
|
+
function pe(e, s = {}) {
|
|
338
338
|
const t = Array.isArray(e);
|
|
339
339
|
if (E(e) || t)
|
|
340
340
|
for (const n in e)
|
|
341
|
-
Array.isArray(e[n]) || E(e[n]) && !cr(e[n]) ? (s[n] = Array.isArray(e[n]) ? [] : {},
|
|
341
|
+
Array.isArray(e[n]) || E(e[n]) && !cr(e[n]) ? (s[n] = Array.isArray(e[n]) ? [] : {}, pe(e[n], s[n])) : M(e[n]) || (s[n] = !0);
|
|
342
342
|
return s;
|
|
343
343
|
}
|
|
344
344
|
function dr(e, s, t) {
|
|
345
345
|
const n = Array.isArray(e);
|
|
346
346
|
if (E(e) || n)
|
|
347
347
|
for (const o in e)
|
|
348
|
-
Array.isArray(e[o]) || E(e[o]) && !cr(e[o]) ? k(s) || Fe(t[o]) ? t[o] = Array.isArray(e[o]) ?
|
|
348
|
+
Array.isArray(e[o]) || E(e[o]) && !cr(e[o]) ? k(s) || Fe(t[o]) ? t[o] = Array.isArray(e[o]) ? pe(e[o], []) : { ...pe(e[o]) } : dr(e[o], M(s) ? {} : s[o], t[o]) : t[o] = !ie(e[o], s[o]);
|
|
349
349
|
return t;
|
|
350
350
|
}
|
|
351
|
-
var _e = (e, s) => dr(e, s,
|
|
352
|
-
function
|
|
351
|
+
var _e = (e, s) => dr(e, s, pe(s)), fr = (e, { valueAsNumber: s, valueAsDate: t, setValueAs: n }) => k(e) ? e : s ? e === "" ? NaN : e && +e : t && Q(e) ? new Date(e) : n ? n(e) : e;
|
|
352
|
+
function Ce(e) {
|
|
353
353
|
const s = e.ref;
|
|
354
354
|
if (!(e.refs ? e.refs.every((t) => t.disabled) : s.disabled))
|
|
355
355
|
return Me(s) ? s.files : Oe(s) ? or(e.refs).value : ur(s) ? [...s.selectedOptions].map(({ value: t }) => t) : ve(s) ? nr(e.refs).value : fr(k(s.value) ? e.ref.value : s.value, e);
|
|
@@ -390,7 +390,7 @@ function ir(e, s, t) {
|
|
|
390
390
|
name: t
|
|
391
391
|
};
|
|
392
392
|
}
|
|
393
|
-
var rt = (e, s, t, n, o) => o.isOnAll ? !1 : !t && o.isOnTouch ? !(s || e) : (t ? n.isOnBlur : o.isOnBlur) ? !e : (t ? n.isOnChange : o.isOnChange) ? e : !0, tt = (e, s) => !
|
|
393
|
+
var rt = (e, s, t, n, o) => o.isOnAll ? !1 : !t && o.isOnTouch ? !(s || e) : (t ? n.isOnBlur : o.isOnBlur) ? !e : (t ? n.isOnChange : o.isOnChange) ? e : !0, tt = (e, s) => !Ae(f(e, s)).length && S(e, s);
|
|
394
394
|
const st = {
|
|
395
395
|
mode: G.onSubmit,
|
|
396
396
|
reValidateMode: G.onChange,
|
|
@@ -423,7 +423,7 @@ function it(e = {}) {
|
|
|
423
423
|
unMount: /* @__PURE__ */ new Set(),
|
|
424
424
|
array: /* @__PURE__ */ new Set(),
|
|
425
425
|
watch: /* @__PURE__ */ new Set()
|
|
426
|
-
},
|
|
426
|
+
}, O, P = 0;
|
|
427
427
|
const F = {
|
|
428
428
|
isDirty: !1,
|
|
429
429
|
dirtyFields: !1,
|
|
@@ -433,24 +433,24 @@ function it(e = {}) {
|
|
|
433
433
|
isValid: !1,
|
|
434
434
|
errors: !1
|
|
435
435
|
}, _ = {
|
|
436
|
-
values:
|
|
437
|
-
array:
|
|
438
|
-
state:
|
|
439
|
-
}, le = Xe(s.mode), J = Xe(s.reValidateMode),
|
|
440
|
-
clearTimeout(
|
|
441
|
-
},
|
|
436
|
+
values: Te(),
|
|
437
|
+
array: Te(),
|
|
438
|
+
state: Te()
|
|
439
|
+
}, le = Xe(s.mode), J = Xe(s.reValidateMode), R = s.criteriaMode === G.all, ce = (r) => (i) => {
|
|
440
|
+
clearTimeout(P), P = setTimeout(r, i);
|
|
441
|
+
}, B = async (r) => {
|
|
442
442
|
if (F.isValid || r) {
|
|
443
|
-
const i = s.resolver ?
|
|
443
|
+
const i = s.resolver ? I((await X()).errors) : await N(n, !0);
|
|
444
444
|
i !== t.isValid && _.state.next({
|
|
445
445
|
isValid: i
|
|
446
446
|
});
|
|
447
447
|
}
|
|
448
|
-
},
|
|
448
|
+
}, L = (r, i) => {
|
|
449
449
|
(F.isValidating || F.validatingFields) && ((r || Array.from(g.mount)).forEach((l) => {
|
|
450
450
|
l && (i ? V(t.validatingFields, l, i) : S(t.validatingFields, l));
|
|
451
451
|
}), _.state.next({
|
|
452
452
|
validatingFields: t.validatingFields,
|
|
453
|
-
isValidating: !
|
|
453
|
+
isValidating: !I(t.validatingFields)
|
|
454
454
|
}));
|
|
455
455
|
}, m = (r, i = [], l, d, c = !0, u = !0) => {
|
|
456
456
|
if (d && l) {
|
|
@@ -484,30 +484,30 @@ function it(e = {}) {
|
|
|
484
484
|
errors: t.errors,
|
|
485
485
|
isValid: !1
|
|
486
486
|
});
|
|
487
|
-
},
|
|
487
|
+
}, p = (r, i, l, d) => {
|
|
488
488
|
const c = f(n, r);
|
|
489
489
|
if (c) {
|
|
490
490
|
const u = f(a, r, k(l) ? f(o, r) : l);
|
|
491
|
-
k(u) || d && d.defaultChecked || i ? V(a, r, i ? u :
|
|
491
|
+
k(u) || d && d.defaultChecked || i ? V(a, r, i ? u : Ce(c._f)) : T(r, u), y.mount && B();
|
|
492
492
|
}
|
|
493
|
-
},
|
|
493
|
+
}, C = (r, i, l, d, c) => {
|
|
494
494
|
let u = !1, h = !1;
|
|
495
495
|
const x = {
|
|
496
496
|
name: r
|
|
497
497
|
}, w = !!(f(n, r) && f(n, r)._f && f(n, r)._f.disabled);
|
|
498
498
|
if (!l || d) {
|
|
499
499
|
F.isDirty && (h = t.isDirty, t.isDirty = x.isDirty = v(), u = h !== x.isDirty);
|
|
500
|
-
const
|
|
501
|
-
h = !!(!w && f(t.dirtyFields, r)),
|
|
500
|
+
const q = w || ie(f(o, r), i);
|
|
501
|
+
h = !!(!w && f(t.dirtyFields, r)), q || w ? S(t.dirtyFields, r) : V(t.dirtyFields, r, !0), x.dirtyFields = t.dirtyFields, u = u || F.dirtyFields && h !== !q;
|
|
502
502
|
}
|
|
503
503
|
if (l) {
|
|
504
|
-
const
|
|
505
|
-
|
|
504
|
+
const q = f(t.touchedFields, r);
|
|
505
|
+
q || (V(t.touchedFields, r, l), x.touchedFields = t.touchedFields, u = u || F.touchedFields && q !== l);
|
|
506
506
|
}
|
|
507
507
|
return u && c && _.state.next(x), u ? x : {};
|
|
508
508
|
}, se = (r, i, l, d) => {
|
|
509
509
|
const c = f(t.errors, r), u = F.isValid && re(i) && t.isValid !== i;
|
|
510
|
-
if (e.delayError && l ? (
|
|
510
|
+
if (e.delayError && l ? (O = ce(() => j(r, l)), O(e.delayError)) : (clearTimeout(P), O = null, l ? V(t.errors, r, l) : S(t.errors, r)), (l ? !ie(c, l) : c) || !I(d) || u) {
|
|
511
511
|
const h = {
|
|
512
512
|
...d,
|
|
513
513
|
...u && re(i) ? { isValid: i } : {},
|
|
@@ -520,9 +520,9 @@ function it(e = {}) {
|
|
|
520
520
|
}, _.state.next(h);
|
|
521
521
|
}
|
|
522
522
|
}, X = async (r) => {
|
|
523
|
-
|
|
523
|
+
L(r, !0);
|
|
524
524
|
const i = await s.resolver(a, s.context, Zr(r || g.mount, n, s.criteriaMode, s.shouldUseNativeValidation));
|
|
525
|
-
return
|
|
525
|
+
return L(r), i;
|
|
526
526
|
}, Z = async (r) => {
|
|
527
527
|
const { errors: i } = await X(r);
|
|
528
528
|
if (r)
|
|
@@ -533,7 +533,7 @@ function it(e = {}) {
|
|
|
533
533
|
else
|
|
534
534
|
t.errors = i;
|
|
535
535
|
return i;
|
|
536
|
-
},
|
|
536
|
+
}, N = async (r, i, l = {
|
|
537
537
|
valid: !0
|
|
538
538
|
}) => {
|
|
539
539
|
for (const d in r) {
|
|
@@ -542,39 +542,39 @@ function it(e = {}) {
|
|
|
542
542
|
const { _f: u, ...h } = c;
|
|
543
543
|
if (u) {
|
|
544
544
|
const x = g.array.has(u.name);
|
|
545
|
-
|
|
546
|
-
const w = await sr(c, a,
|
|
547
|
-
if (
|
|
545
|
+
L([d], !0);
|
|
546
|
+
const w = await sr(c, a, R, s.shouldUseNativeValidation && !i, x);
|
|
547
|
+
if (L([d]), w[u.name] && (l.valid = !1, i))
|
|
548
548
|
break;
|
|
549
549
|
!i && (f(w, u.name) ? x ? Jr(t.errors, w, u.name) : V(t.errors, u.name, w[u.name]) : S(t.errors, u.name));
|
|
550
550
|
}
|
|
551
|
-
!
|
|
551
|
+
!I(h) && await N(h, i, l);
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
554
|
return l.valid;
|
|
555
555
|
}, ae = () => {
|
|
556
556
|
for (const r of g.unMount) {
|
|
557
557
|
const i = f(n, r);
|
|
558
|
-
i && (i._f.refs ? i._f.refs.every((l) => !
|
|
558
|
+
i && (i._f.refs ? i._f.refs.every((l) => !Be(l)) : !Be(i._f.ref)) && ke(r);
|
|
559
559
|
}
|
|
560
560
|
g.unMount = /* @__PURE__ */ new Set();
|
|
561
561
|
}, v = (r, i) => (r && i && V(a, r, i), !ie(Ne(), o)), b = (r, i, l) => Kr(r, g, {
|
|
562
562
|
...y.mount ? a : k(i) ? o : Q(r) ? { [r]: i } : i
|
|
563
|
-
}, l, i),
|
|
563
|
+
}, l, i), A = (r) => Ae(f(y.mount ? a : o, r, e.shouldUnregister ? f(o, r, []) : [])), T = (r, i, l = {}) => {
|
|
564
564
|
const d = f(n, r);
|
|
565
565
|
let c = i;
|
|
566
566
|
if (d) {
|
|
567
567
|
const u = d._f;
|
|
568
|
-
u && (!u.disabled && V(a, r, fr(i, u)), c = xe(u.ref) &&
|
|
568
|
+
u && (!u.disabled && V(a, r, fr(i, u)), c = xe(u.ref) && M(i) ? "" : i, ur(u.ref) ? [...u.ref.options].forEach((h) => h.selected = c.includes(h.value)) : u.refs ? ve(u.ref) ? u.refs.length > 1 ? u.refs.forEach((h) => (!h.defaultChecked || !h.disabled) && (h.checked = Array.isArray(c) ? !!c.find((x) => x === h.value) : c === h.value)) : u.refs[0] && (u.refs[0].checked = !!c) : u.refs.forEach((h) => h.checked = h.value === c) : Me(u.ref) ? u.ref.value = "" : (u.ref.value = c, u.ref.type || _.values.next({
|
|
569
569
|
name: r,
|
|
570
570
|
values: { ...a }
|
|
571
571
|
})));
|
|
572
572
|
}
|
|
573
|
-
(l.shouldDirty || l.shouldTouch) &&
|
|
574
|
-
},
|
|
573
|
+
(l.shouldDirty || l.shouldTouch) && C(r, c, l.shouldTouch, l.shouldDirty, !0), l.shouldValidate && ye(r);
|
|
574
|
+
}, W = (r, i, l) => {
|
|
575
575
|
for (const d in i) {
|
|
576
576
|
const c = i[d], u = `${r}.${d}`, h = f(n, u);
|
|
577
|
-
(g.array.has(r) || !Fe(c) || h && !h._f) && !ue(c) ?
|
|
577
|
+
(g.array.has(r) || !Fe(c) || h && !h._f) && !ue(c) ? W(u, c, l) : T(u, c, l);
|
|
578
578
|
}
|
|
579
579
|
}, H = (r, i, l = {}) => {
|
|
580
580
|
const d = f(n, r), c = g.array.has(r), u = z(i);
|
|
@@ -585,7 +585,7 @@ function it(e = {}) {
|
|
|
585
585
|
name: r,
|
|
586
586
|
dirtyFields: _e(o, a),
|
|
587
587
|
isDirty: v(r, u)
|
|
588
|
-
})) : d && !d._f && !
|
|
588
|
+
})) : d && !d._f && !M(u) ? W(r, u, l) : T(r, u, l), Ye(r, g) && _.state.next({ ...t }), _.values.next({
|
|
589
589
|
name: y.mount ? r : void 0,
|
|
590
590
|
values: { ...a }
|
|
591
591
|
});
|
|
@@ -593,28 +593,28 @@ function it(e = {}) {
|
|
|
593
593
|
y.mount = !0;
|
|
594
594
|
const i = r.target;
|
|
595
595
|
let l = i.name, d = !0;
|
|
596
|
-
const c = f(n, l), u = () => i.type ?
|
|
596
|
+
const c = f(n, l), u = () => i.type ? Ce(c._f) : Pr(r), h = (x) => {
|
|
597
597
|
d = Number.isNaN(x) || x === f(a, l, x);
|
|
598
598
|
};
|
|
599
599
|
if (c) {
|
|
600
600
|
let x, w;
|
|
601
|
-
const
|
|
602
|
-
V(a, l,
|
|
603
|
-
const Se =
|
|
601
|
+
const q = u(), ne = r.type === Qe.BLUR || r.type === Qe.FOCUS_OUT, _r = !et(c._f) && !s.resolver && !f(t.errors, l) && !c._f.deps || rt(ne, f(t.touchedFields, l), t.isSubmitted, J, le), De = Ye(l, g, ne);
|
|
602
|
+
V(a, l, q), ne ? (c._f.onBlur && c._f.onBlur(r), O && O(0)) : c._f.onChange && c._f.onChange(r);
|
|
603
|
+
const Se = C(l, q, ne, !1), mr = !I(Se) || De;
|
|
604
604
|
if (!ne && _.values.next({
|
|
605
605
|
name: l,
|
|
606
606
|
type: r.type,
|
|
607
607
|
values: { ...a }
|
|
608
608
|
}), _r)
|
|
609
|
-
return F.isValid &&
|
|
609
|
+
return F.isValid && B(), mr && _.state.next({ name: l, ...De ? {} : Se });
|
|
610
610
|
if (!ne && De && _.state.next({ ...t }), s.resolver) {
|
|
611
611
|
const { errors: $e } = await X([l]);
|
|
612
|
-
if (h(
|
|
612
|
+
if (h(q), d) {
|
|
613
613
|
const br = ir(t.errors, n, l), je = ir($e, n, br.name || l);
|
|
614
|
-
x = je.error, l = je.name, w =
|
|
614
|
+
x = je.error, l = je.name, w = I($e);
|
|
615
615
|
}
|
|
616
616
|
} else
|
|
617
|
-
|
|
617
|
+
L([l], !0), x = (await sr(c, a, R, s.shouldUseNativeValidation))[l], L([l]), h(q), d && (x ? w = !1 : F.isValid && (w = await N(n, !0)));
|
|
618
618
|
d && (c._f.deps && ye(c._f.deps), se(l, w, x, Se));
|
|
619
619
|
}
|
|
620
620
|
}, fe = (r, i) => {
|
|
@@ -625,12 +625,12 @@ function it(e = {}) {
|
|
|
625
625
|
const c = me(r);
|
|
626
626
|
if (s.resolver) {
|
|
627
627
|
const u = await Z(k(r) ? r : c);
|
|
628
|
-
l =
|
|
628
|
+
l = I(u), d = r ? !c.some((h) => f(u, h)) : l;
|
|
629
629
|
} else
|
|
630
630
|
r ? (d = (await Promise.all(c.map(async (u) => {
|
|
631
631
|
const h = f(n, u);
|
|
632
|
-
return await
|
|
633
|
-
}))).every(Boolean), !(!d && !t.isValid) &&
|
|
632
|
+
return await N(h && h._f ? { [u]: h } : h);
|
|
633
|
+
}))).every(Boolean), !(!d && !t.isValid) && B()) : d = l = await N(n);
|
|
634
634
|
return _.state.next({
|
|
635
635
|
...!Q(r) || F.isValid && l !== t.isValid ? {} : { name: r },
|
|
636
636
|
...s.resolver || !r ? { isValid: l } : {},
|
|
@@ -672,11 +672,11 @@ function it(e = {}) {
|
|
|
672
672
|
}), _.state.next({
|
|
673
673
|
...t,
|
|
674
674
|
...i.keepDirty ? { isDirty: v() } : {}
|
|
675
|
-
}), !i.keepIsValid &&
|
|
675
|
+
}), !i.keepIsValid && B();
|
|
676
676
|
}, Pe = ({ disabled: r, name: i, field: l, fields: d, value: c }) => {
|
|
677
677
|
if (re(r) && y.mount || r) {
|
|
678
|
-
const u = r ? void 0 : k(c) ?
|
|
679
|
-
V(a, i, u),
|
|
678
|
+
const u = r ? void 0 : k(c) ? Ce(l ? l._f : f(d, i)._f) : c;
|
|
679
|
+
V(a, i, u), C(i, u, !1, !1, !0);
|
|
680
680
|
}
|
|
681
681
|
}, we = (r, i = {}) => {
|
|
682
682
|
let l = f(n, r);
|
|
@@ -694,7 +694,7 @@ function it(e = {}) {
|
|
|
694
694
|
disabled: i.disabled,
|
|
695
695
|
name: r,
|
|
696
696
|
value: i.value
|
|
697
|
-
}) :
|
|
697
|
+
}) : p(r, !0, i.value), {
|
|
698
698
|
...d ? { disabled: i.disabled } : {},
|
|
699
699
|
...s.progressive ? {
|
|
700
700
|
required: !!i.required,
|
|
@@ -718,26 +718,26 @@ function it(e = {}) {
|
|
|
718
718
|
...l._f,
|
|
719
719
|
...h ? {
|
|
720
720
|
refs: [
|
|
721
|
-
...x.filter(
|
|
721
|
+
...x.filter(Be),
|
|
722
722
|
u,
|
|
723
723
|
...Array.isArray(f(o, r)) ? [{}] : []
|
|
724
724
|
],
|
|
725
725
|
ref: { type: u.type, name: r }
|
|
726
726
|
} : { ref: u }
|
|
727
727
|
}
|
|
728
|
-
}),
|
|
728
|
+
}), p(r, !1, void 0, u);
|
|
729
729
|
} else
|
|
730
|
-
l = f(n, r, {}), l._f && (l._f.mount = !1), (s.shouldUnregister || i.shouldUnregister) && !(
|
|
730
|
+
l = f(n, r, {}), l._f && (l._f.mount = !1), (s.shouldUnregister || i.shouldUnregister) && !(qr(g.array, r) && y.action) && g.unMount.add(r);
|
|
731
731
|
}
|
|
732
732
|
};
|
|
733
|
-
},
|
|
733
|
+
}, We = () => s.shouldFocusError && ge(n, fe, g.mount), gr = (r) => {
|
|
734
734
|
re(r) && (_.state.next({ disabled: r }), ge(n, (i, l) => {
|
|
735
735
|
const d = f(n, l);
|
|
736
736
|
d && (i.disabled = d._f.disabled || r, Array.isArray(d._f.refs) && d._f.refs.forEach((c) => {
|
|
737
737
|
c.disabled = d._f.disabled || r;
|
|
738
738
|
}));
|
|
739
739
|
}, 0, !1));
|
|
740
|
-
},
|
|
740
|
+
}, qe = (r, i) => async (l) => {
|
|
741
741
|
let d;
|
|
742
742
|
l && (l.preventDefault && l.preventDefault(), l.persist && l.persist());
|
|
743
743
|
let c = z(a);
|
|
@@ -747,8 +747,8 @@ function it(e = {}) {
|
|
|
747
747
|
const { errors: u, values: h } = await X();
|
|
748
748
|
t.errors = u, c = h;
|
|
749
749
|
} else
|
|
750
|
-
await
|
|
751
|
-
if (S(t.errors, "root"),
|
|
750
|
+
await N(n);
|
|
751
|
+
if (S(t.errors, "root"), I(t.errors)) {
|
|
752
752
|
_.state.next({
|
|
753
753
|
errors: {}
|
|
754
754
|
});
|
|
@@ -758,19 +758,19 @@ function it(e = {}) {
|
|
|
758
758
|
d = u;
|
|
759
759
|
}
|
|
760
760
|
} else
|
|
761
|
-
i && await i({ ...t.errors }, l),
|
|
761
|
+
i && await i({ ...t.errors }, l), We(), setTimeout(We);
|
|
762
762
|
if (_.state.next({
|
|
763
763
|
isSubmitted: !0,
|
|
764
764
|
isSubmitting: !1,
|
|
765
|
-
isSubmitSuccessful:
|
|
765
|
+
isSubmitSuccessful: I(t.errors) && !d,
|
|
766
766
|
submitCount: t.submitCount + 1,
|
|
767
767
|
errors: t.errors
|
|
768
768
|
}), d)
|
|
769
769
|
throw d;
|
|
770
770
|
}, vr = (r, i = {}) => {
|
|
771
|
-
f(n, r) && (k(i.defaultValue) ? H(r, z(f(o, r))) : (H(r, i.defaultValue), V(o, r, z(i.defaultValue))), i.keepTouched || S(t.touchedFields, r), i.keepDirty || (S(t.dirtyFields, r), t.isDirty = i.defaultValue ? v(r, z(f(o, r))) : v()), i.keepError || (S(t.errors, r), F.isValid &&
|
|
771
|
+
f(n, r) && (k(i.defaultValue) ? H(r, z(f(o, r))) : (H(r, i.defaultValue), V(o, r, z(i.defaultValue))), i.keepTouched || S(t.touchedFields, r), i.keepDirty || (S(t.dirtyFields, r), t.isDirty = i.defaultValue ? v(r, z(f(o, r))) : v()), i.keepError || (S(t.errors, r), F.isValid && B()), _.state.next({ ...t }));
|
|
772
772
|
}, He = (r, i = {}) => {
|
|
773
|
-
const l = r ? z(r) : o, d = z(l), c =
|
|
773
|
+
const l = r ? z(r) : o, d = z(l), c = I(r), u = c ? o : d;
|
|
774
774
|
if (i.keepDefaultValues || (o = l), !i.keepValues) {
|
|
775
775
|
if (i.keepDirtyValues)
|
|
776
776
|
for (const h of g.mount)
|
|
@@ -782,9 +782,9 @@ function it(e = {}) {
|
|
|
782
782
|
if (x && x._f) {
|
|
783
783
|
const w = Array.isArray(x._f.refs) ? x._f.refs[0] : x._f.ref;
|
|
784
784
|
if (xe(w)) {
|
|
785
|
-
const
|
|
786
|
-
if (
|
|
787
|
-
|
|
785
|
+
const q = w.closest("form");
|
|
786
|
+
if (q) {
|
|
787
|
+
q.reset();
|
|
788
788
|
break;
|
|
789
789
|
}
|
|
790
790
|
}
|
|
@@ -821,16 +821,16 @@ function it(e = {}) {
|
|
|
821
821
|
register: we,
|
|
822
822
|
unregister: ke,
|
|
823
823
|
getFieldState: Ue,
|
|
824
|
-
handleSubmit:
|
|
824
|
+
handleSubmit: qe,
|
|
825
825
|
setError: Ie,
|
|
826
826
|
_executeSchema: X,
|
|
827
827
|
_getWatch: b,
|
|
828
828
|
_getDirty: v,
|
|
829
|
-
_updateValid:
|
|
829
|
+
_updateValid: B,
|
|
830
830
|
_removeUnmounted: ae,
|
|
831
831
|
_updateFieldArray: m,
|
|
832
832
|
_updateDisabledField: Pe,
|
|
833
|
-
_getFieldArray:
|
|
833
|
+
_getFieldArray: A,
|
|
834
834
|
_reset: He,
|
|
835
835
|
_resetDefaultValues: () => te(s.defaultValues) && s.defaultValues().then((r) => {
|
|
836
836
|
ze(r, s.resetOptions), _.state.next({
|
|
@@ -886,7 +886,7 @@ function it(e = {}) {
|
|
|
886
886
|
},
|
|
887
887
|
trigger: ye,
|
|
888
888
|
register: we,
|
|
889
|
-
handleSubmit:
|
|
889
|
+
handleSubmit: qe,
|
|
890
890
|
watch: hr,
|
|
891
891
|
setValue: H,
|
|
892
892
|
getValues: Ne,
|
|
@@ -960,78 +960,78 @@ const at = "Я принимаю условия Политики обработк
|
|
|
960
960
|
isPhone: a,
|
|
961
961
|
isTextArea: y,
|
|
962
962
|
telegramLink: g = "https://t.me/stone_developer",
|
|
963
|
-
isRequiredPhone:
|
|
964
|
-
isRequiredEmail:
|
|
963
|
+
isRequiredPhone: O = !0,
|
|
964
|
+
isRequiredEmail: P = !1,
|
|
965
965
|
isRequiredPhoneOrEmail: F,
|
|
966
966
|
textAreaPlaceholder: _,
|
|
967
967
|
subTitle: le,
|
|
968
968
|
submitHandler: J,
|
|
969
|
-
modalWidth:
|
|
969
|
+
modalWidth: R = "442px",
|
|
970
970
|
rowsTextArea: ce = 2,
|
|
971
|
-
advCheckBox:
|
|
971
|
+
advCheckBox: B = { text: at, isRequired: !0 }
|
|
972
972
|
}) => {
|
|
973
973
|
const {
|
|
974
|
-
register:
|
|
974
|
+
register: L,
|
|
975
975
|
handleSubmit: m,
|
|
976
976
|
trigger: j,
|
|
977
977
|
reset: K,
|
|
978
|
-
watch:
|
|
979
|
-
formState: { errors:
|
|
980
|
-
} = lt(), se = !!
|
|
981
|
-
required:
|
|
982
|
-
pattern: { value:
|
|
978
|
+
watch: p,
|
|
979
|
+
formState: { errors: C }
|
|
980
|
+
} = lt(), se = !!p("email"), { onChange: X, onBlur: Z, ...N } = L("phone", {
|
|
981
|
+
required: O || F ? !se : !0,
|
|
982
|
+
pattern: { value: pr, message: "" },
|
|
983
983
|
onBlur: () => j("phone")
|
|
984
|
-
}), { isMobile: ae, currentClientWidth: v } = Dr(), b =
|
|
985
|
-
J(
|
|
984
|
+
}), { isMobile: ae, currentClientWidth: v } = Dr(), b = p("personalCheckBox"), A = p("advCheckBox"), T = (W) => {
|
|
985
|
+
J(W), K();
|
|
986
986
|
};
|
|
987
987
|
return v ? /* @__PURE__ */ D(
|
|
988
988
|
Vr,
|
|
989
989
|
{
|
|
990
990
|
isOpen: e,
|
|
991
991
|
emitIsOpen: () => s(!1),
|
|
992
|
-
additionalClass:
|
|
992
|
+
additionalClass: U.modal,
|
|
993
993
|
opacity: 0.7,
|
|
994
994
|
isTransparentBack: !0,
|
|
995
|
-
additionalClassModalBody:
|
|
995
|
+
additionalClassModalBody: U.modalBody,
|
|
996
996
|
children: /* @__PURE__ */ ee(
|
|
997
997
|
"div",
|
|
998
998
|
{
|
|
999
|
-
className:
|
|
1000
|
-
style: { width: ae ? "100%" :
|
|
999
|
+
className: U.root,
|
|
1000
|
+
style: { width: ae ? "100%" : R },
|
|
1001
1001
|
children: [
|
|
1002
1002
|
/* @__PURE__ */ D(
|
|
1003
1003
|
"div",
|
|
1004
1004
|
{
|
|
1005
|
-
className:
|
|
1005
|
+
className: U.title,
|
|
1006
1006
|
dangerouslySetInnerHTML: { __html: n ?? "Оставить обращение" }
|
|
1007
1007
|
}
|
|
1008
1008
|
),
|
|
1009
|
-
t && /* @__PURE__ */ ee("div", { className:
|
|
1009
|
+
t && /* @__PURE__ */ ee("div", { className: U.telegramWrapper, children: [
|
|
1010
1010
|
/* @__PURE__ */ D(
|
|
1011
1011
|
"a",
|
|
1012
1012
|
{
|
|
1013
|
-
className:
|
|
1013
|
+
className: U.telegramLink,
|
|
1014
1014
|
href: g,
|
|
1015
1015
|
target: "_blank",
|
|
1016
|
-
children: /* @__PURE__ */ ee("div", { className:
|
|
1016
|
+
children: /* @__PURE__ */ ee("div", { className: U.telegram, children: [
|
|
1017
1017
|
/* @__PURE__ */ D("div", { children: "Подписаться в Telegram" }),
|
|
1018
1018
|
/* @__PURE__ */ D(Ge, { name: "telegram" })
|
|
1019
1019
|
] })
|
|
1020
1020
|
}
|
|
1021
1021
|
),
|
|
1022
|
-
/* @__PURE__ */ D("div", { className:
|
|
1022
|
+
/* @__PURE__ */ D("div", { className: U.orText, children: "или" })
|
|
1023
1023
|
] }),
|
|
1024
1024
|
!t && /* @__PURE__ */ D(
|
|
1025
1025
|
"div",
|
|
1026
1026
|
{
|
|
1027
|
-
className:
|
|
1027
|
+
className: U.description,
|
|
1028
1028
|
dangerouslySetInnerHTML: {
|
|
1029
1029
|
__html: le && !t ? "Оставьте номер телефона для получения консультации" : `${/* @__PURE__ */ D("div", { children: "привет" })}`
|
|
1030
1030
|
}
|
|
1031
1031
|
}
|
|
1032
1032
|
),
|
|
1033
|
-
/* @__PURE__ */ ee("form", { onSubmit: m(
|
|
1034
|
-
/* @__PURE__ */ ee(Fr, { className:
|
|
1033
|
+
/* @__PURE__ */ ee("form", { onSubmit: m(T), children: [
|
|
1034
|
+
/* @__PURE__ */ ee(Fr, { className: U.inputWrapper, children: [
|
|
1035
1035
|
/* @__PURE__ */ D(
|
|
1036
1036
|
Ee,
|
|
1037
1037
|
{
|
|
@@ -1040,8 +1040,8 @@ const at = "Я принимаю условия Политики обработк
|
|
|
1040
1040
|
variant: "light",
|
|
1041
1041
|
placeholder: "Введите имя",
|
|
1042
1042
|
"data-testid": "modal_name",
|
|
1043
|
-
...
|
|
1044
|
-
error: !!
|
|
1043
|
+
...L("name", { required: !0, pattern: Ar }),
|
|
1044
|
+
error: !!C.name
|
|
1045
1045
|
}
|
|
1046
1046
|
),
|
|
1047
1047
|
a && /* @__PURE__ */ D(
|
|
@@ -1061,9 +1061,9 @@ const at = "Я принимаю условия Политики обработк
|
|
|
1061
1061
|
type: "tel",
|
|
1062
1062
|
size_s: "small",
|
|
1063
1063
|
variant: "light",
|
|
1064
|
-
...
|
|
1065
|
-
...
|
|
1066
|
-
error: !!
|
|
1064
|
+
...N,
|
|
1065
|
+
...L("phone"),
|
|
1066
|
+
error: !!C.phone
|
|
1067
1067
|
}
|
|
1068
1068
|
)
|
|
1069
1069
|
}
|
|
@@ -1076,11 +1076,11 @@ const at = "Я принимаю условия Политики обработк
|
|
|
1076
1076
|
variant: "light",
|
|
1077
1077
|
placeholder: "Введите email",
|
|
1078
1078
|
"data-testid": "modal_email",
|
|
1079
|
-
...
|
|
1080
|
-
required:
|
|
1079
|
+
...L("email", {
|
|
1080
|
+
required: P || F && !se,
|
|
1081
1081
|
pattern: kr
|
|
1082
1082
|
}),
|
|
1083
|
-
error: !!
|
|
1083
|
+
error: !!C.email
|
|
1084
1084
|
}
|
|
1085
1085
|
),
|
|
1086
1086
|
y && /* @__PURE__ */ D(
|
|
@@ -1090,17 +1090,17 @@ const at = "Я принимаю условия Политики обработк
|
|
|
1090
1090
|
placeholder: _,
|
|
1091
1091
|
rows: ce,
|
|
1092
1092
|
width: "full",
|
|
1093
|
-
...
|
|
1093
|
+
...L("textarea")
|
|
1094
1094
|
}
|
|
1095
1095
|
),
|
|
1096
|
-
|
|
1096
|
+
B && !t && /* @__PURE__ */ D(
|
|
1097
1097
|
Je,
|
|
1098
1098
|
{
|
|
1099
1099
|
"data-testid": "modal_advCheckBox",
|
|
1100
|
-
isChecked:
|
|
1101
|
-
error: !!
|
|
1102
|
-
text:
|
|
1103
|
-
...
|
|
1100
|
+
isChecked: A,
|
|
1101
|
+
error: !!C.advCheckBox,
|
|
1102
|
+
text: B.text,
|
|
1103
|
+
...L("advCheckBox", { required: B == null ? void 0 : B.isRequired })
|
|
1104
1104
|
}
|
|
1105
1105
|
),
|
|
1106
1106
|
/* @__PURE__ */ ee(
|
|
@@ -1108,8 +1108,8 @@ const at = "Я принимаю условия Политики обработк
|
|
|
1108
1108
|
{
|
|
1109
1109
|
"data-testid": "modal_personalCheckBox",
|
|
1110
1110
|
isChecked: b,
|
|
1111
|
-
error: !!
|
|
1112
|
-
...
|
|
1111
|
+
error: !!C.personalCheckBox,
|
|
1112
|
+
...L("personalCheckBox", { required: !t }),
|
|
1113
1113
|
children: [
|
|
1114
1114
|
t && /* @__PURE__ */ ee("div", { children: [
|
|
1115
1115
|
"Согласен(-на)",
|
|
@@ -1117,7 +1117,7 @@ const at = "Я принимаю условия Политики обработк
|
|
|
1117
1117
|
/* @__PURE__ */ D(
|
|
1118
1118
|
"a",
|
|
1119
1119
|
{
|
|
1120
|
-
className:
|
|
1120
|
+
className: U.linkPolicy,
|
|
1121
1121
|
href: "/documents/soglasie-na-rassylki",
|
|
1122
1122
|
children: "получать новости, информацию по сделке и рекламу"
|
|
1123
1123
|
}
|
|
@@ -1131,7 +1131,7 @@ const at = "Я принимаю условия Политики обработк
|
|
|
1131
1131
|
/* @__PURE__ */ D(
|
|
1132
1132
|
"a",
|
|
1133
1133
|
{
|
|
1134
|
-
className:
|
|
1134
|
+
className: U.linkPolicy,
|
|
1135
1135
|
href: "/documents/docs",
|
|
1136
1136
|
children: "Политики обработки и защиты персональных данных"
|
|
1137
1137
|
}
|
|
@@ -1150,15 +1150,16 @@ const at = "Я принимаю условия Политики обработк
|
|
|
1150
1150
|
type: "submit",
|
|
1151
1151
|
size: "large",
|
|
1152
1152
|
as: "button",
|
|
1153
|
-
additionalClass:
|
|
1154
|
-
|
|
1153
|
+
additionalClass: U.modalBtn,
|
|
1154
|
+
disabled: !!C.name || !!C.phone && O || !!C.email && P || !!C.advCheckBox && (B == null ? void 0 : B.isRequired) || !!C.personalCheckBox && !t,
|
|
1155
|
+
children: "Отправить запрос"
|
|
1155
1156
|
}
|
|
1156
1157
|
)
|
|
1157
1158
|
] }),
|
|
1158
1159
|
/* @__PURE__ */ D(
|
|
1159
1160
|
Ke,
|
|
1160
1161
|
{
|
|
1161
|
-
additionalClass:
|
|
1162
|
+
additionalClass: U.btn,
|
|
1162
1163
|
onClick: () => s(!1),
|
|
1163
1164
|
as: "button",
|
|
1164
1165
|
variant: "gray",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e = /^((8|\+7)[\- ]?)?(\(?\d{3}\)?[\- ]?)?[\d\- ]{10}/g, n =
|
|
1
|
+
const e = /^((8|\+7)[\- ]?)?(\(?\d{3}\)?[\- ]?)?[\d\- ]{10}/g, n = new RegExp("^(?!.*\\.\\.)[A-Z0-9._%+-]+(?<!\\.)@[A-Z0-9-]+\\.[A-Z]{2,}$", "i"), o = /^((([а-яА-ЯЁё-]){1,30})(\s{1,3}|)){1,5}$|^((([a-zA-Z-'`]){1,30})(\s{1,3}|)){1,5}$/u;
|
|
2
2
|
export {
|
|
3
3
|
n as emailReg,
|
|
4
4
|
o as nameReg,
|