@elcrm/form 0.0.69 → 0.0.71

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.
@@ -3,15 +3,21 @@ import t from "../core/Field.js";
3
3
  import { useFormFieldState as n } from "../hooks/use.js";
4
4
  import r, { asEditableClipboard as i } from "../events/onEvent.js";
5
5
  import { isEmptyTextLike as a } from "./visibility.js";
6
- import "react";
7
- import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
6
+ import o from "react";
7
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
8
8
  //#region src/lib/fields/Numeric.tsx
9
- function l({ value: l, form: u, onValue: d, name: f = "", placeholder: p = "", label: m = "", hidden: h = !1, disabled: g = !1, onBlur: _, className: v = "", after: y = "", before: b = "", error: x = "", inputmode: S = "numeric", maxLength: C, max: w, view: T }) {
10
- let E = !g, { value: D, version: O } = n(u, f, l);
11
- p = p === void 0 ? "" : p, w = w === void 0 ? 99 : w;
12
- let k = C ?? w, A = !1, j = (e) => {
9
+ function u({ value: u, form: d, onValue: f, name: p = "", placeholder: m = "", label: h = "", hidden: g = !1, disabled: _ = !1, onBlur: v, className: y = "", after: b = "", before: x = "", error: S = "", inputmode: C = "numeric", maxLength: w, max: T, view: E }) {
10
+ let D = !_, { value: O, version: k } = n(d, p, u);
11
+ m = m === void 0 ? "" : m, T = T === void 0 ? 99 : T;
12
+ let A = O != null && O !== "" ? String(O) : "", j = o.useRef(null), M = o.useRef(!1);
13
+ o.useLayoutEffect(() => {
14
+ if (M.current) return;
15
+ let e = j.current;
16
+ e && e.textContent !== A && (e.textContent = A);
17
+ }, [A, k]);
18
+ let N = w ?? T, P = !1, F = (e) => {
13
19
  let t = e.currentTarget, n = (t.textContent || "").replace(/\D/g, "");
14
- n.length > k && (n = n.slice(0, k), t.textContent = n, queueMicrotask(() => {
20
+ n.length > N && (n = n.slice(0, N), t.textContent = n, queueMicrotask(() => {
15
21
  let e = t.firstChild;
16
22
  if (e && e.nodeType === Node.TEXT_NODE) {
17
23
  let t = n.length, r = window.getSelection(), i = document.createRange();
@@ -20,54 +26,55 @@ function l({ value: l, form: u, onValue: d, name: f = "", placeholder: p = "", l
20
26
  }));
21
27
  let r = {
22
28
  value: n,
23
- name: f
29
+ name: p
24
30
  };
25
- u && f && u.onValue(r), d && d !== u?.onValue && d(r);
26
- }, M = (e) => {
31
+ d && p && d.onValue(r), f && f !== d?.onValue && f(r);
32
+ }, I = (e) => {
33
+ M.current = !0;
27
34
  let t = e.currentTarget;
28
35
  t.textContent = (t.textContent || "").replace(/\D/g, ""), r.Focus({ target: e.currentTarget });
29
- }, N = (e) => {
30
- if (A && e.which === 86) return;
31
- if (e.which === 17 || e.which === 91) return A = !0;
36
+ }, L = (e) => {
37
+ if (P && e.which === 86) return;
38
+ if (e.which === 17 || e.which === 91) return P = !0;
32
39
  if (e.key === "Backspace") return;
33
40
  let t = (e.currentTarget.textContent ?? "").replace(/\D/g, "").length;
34
- k > 0 && t >= k && e.key.length === 1 && /\d/.test(e.key) && e.preventDefault(), e.key === "Enter" && e.preventDefault(), e.key.length === 1 && !/\d/.test(e.key) && e.preventDefault();
35
- }, P = (e) => {
36
- if (e.which === 17 || e.which === 91) return A = !1;
37
- }, F = (e) => r.PasteDigits(k, i(e)), I = (e) => {
38
- r.Blur(e), _?.({
41
+ N > 0 && t >= N && e.key.length === 1 && /\d/.test(e.key) && e.preventDefault(), e.key === "Enter" && e.preventDefault(), e.key.length === 1 && !/\d/.test(e.key) && e.preventDefault();
42
+ }, R = (e) => {
43
+ if (e.which === 17 || e.which === 91) return P = !1;
44
+ }, z = (e) => r.PasteDigits(N, i(e)), B = (e) => {
45
+ r.Blur(e), v?.({
39
46
  value: e.currentTarget.textContent,
40
- name: f
41
- });
42
- }, L = {};
43
- return E && (L.edit = ""), L.inputMode = S ?? "numeric", p && (L.placeholder = p), h && a(D) ? /* @__PURE__ */ s(o, {}) : /* @__PURE__ */ c(t, {
47
+ name: p
48
+ }), M.current = !1;
49
+ }, V = {};
50
+ return D && (V.edit = ""), V.inputMode = C ?? "numeric", m && (V.placeholder = m), g && a(O) ? /* @__PURE__ */ c(s, {}) : /* @__PURE__ */ l(t, {
44
51
  type: "numeric",
45
- label: m,
46
- error: x,
47
- element_blok: { className: [v || ""] },
52
+ label: h,
53
+ error: S,
54
+ element_blok: { className: [y || ""] },
48
55
  element_input: { className: [e.w] },
49
56
  children: [
50
- b,
51
- /* @__PURE__ */ s("div", {
52
- onPaste: F,
53
- onInput: j,
54
- onFocus: M,
55
- onBlur: I,
56
- onKeyDown: N,
57
- onKeyUp: P,
57
+ x,
58
+ /* @__PURE__ */ c("div", {
59
+ ref: j,
60
+ onPaste: z,
61
+ onInput: F,
62
+ onFocus: I,
63
+ onBlur: B,
64
+ onKeyDown: L,
65
+ onKeyUp: R,
58
66
  spellCheck: !1,
59
67
  role: "textbox",
60
- tabIndex: E ? 0 : -1,
61
- "aria-label": m || p || "Число",
62
- contentEditable: E ? "plaintext-only" : !1,
68
+ tabIndex: D ? 0 : -1,
69
+ "aria-label": h || m || "Число",
70
+ contentEditable: D ? "plaintext-only" : !1,
63
71
  suppressContentEditableWarning: !0,
64
- ...L,
65
- children: D
66
- }, O),
67
- y
72
+ ...V
73
+ }),
74
+ b
68
75
  ]
69
76
  });
70
77
  }
71
- l.displayName = "NumberField";
78
+ u.displayName = "NumberField";
72
79
  //#endregion
73
- export { l as default };
80
+ export { u as default };
@@ -15,29 +15,23 @@ function c({ value: c, form: l, onValue: u, name: d, placeholder: f = "", separa
15
15
  modalName: e[1],
16
16
  callback: (e) => {
17
17
  let t = e;
18
- if (u) {
19
- let e = {
20
- value: v === "array" ? Object.keys(t) : v === "string" ? Object.keys(t).filter((e) => t[e]).join(p) : t,
21
- name: d
22
- };
23
- switch (l && d && l.setValue(e), v) {
24
- case "array":
25
- u !== l?.onValue && u({
26
- value: Object.keys(t),
27
- name: d
28
- });
29
- break;
30
- case "string":
31
- u !== l?.onValue && u({
32
- value: Object.keys(t).filter((e) => t[e]).join(p),
33
- name: d
34
- });
35
- break;
36
- default: u !== l?.onValue && u({
37
- value: t,
18
+ if (u) switch (v === "array" || v === "string" && Object.keys(t).filter((e) => t[e]).join(p), v) {
19
+ case "array":
20
+ u !== l?.onValue && u({
21
+ value: Object.keys(t),
22
+ name: d
23
+ });
24
+ break;
25
+ case "string":
26
+ u !== l?.onValue && u({
27
+ value: Object.keys(t).filter((e) => t[e]).join(p),
38
28
  name: d
39
29
  });
40
- }
30
+ break;
31
+ default: u !== l?.onValue && u({
32
+ value: t,
33
+ name: d
34
+ });
41
35
  }
42
36
  },
43
37
  onValue: u,
@@ -46,7 +46,7 @@ function l() {
46
46
  });
47
47
  }
48
48
  function u({ value: u, form: d, onValue: f, name: p = "", placeholder: m = "", label: h, error: g, hidden: _ = !1, disabled: v = !1, onBlur: y, className: b, after: x = "", before: S = "", native: C = !1, maxLength: w, eyes: T }) {
49
- let [E, D] = a.useState(!1), { value: O } = n(d, p, u), k = a.useRef(null), A = typeof O == "string" ? O : O == null ? "" : String(O);
49
+ let { value: E } = n(d, p, u), [D, O] = a.useState(!1), k = a.useRef(null), A = typeof E == "string" ? E : E == null ? "" : String(E);
50
50
  a.useEffect(() => {
51
51
  let e = k.current;
52
52
  e && e.value !== A && (e.value = A);
@@ -90,7 +90,7 @@ function u({ value: u, form: d, onValue: f, name: p = "", placeholder: m = "", l
90
90
  alignItems: "center"
91
91
  },
92
92
  children: /* @__PURE__ */ o("input", {
93
- type: E ? "text" : "password",
93
+ type: D ? "text" : "password",
94
94
  defaultValue: A,
95
95
  ref: k,
96
96
  onChange: M,
@@ -121,13 +121,10 @@ function u({ value: u, form: d, onValue: f, name: p = "", placeholder: m = "", l
121
121
  /* @__PURE__ */ o("button", {
122
122
  type: "button",
123
123
  tabIndex: v ? -1 : 0,
124
- "aria-label": E ? "Скрыть пароль" : "Показать пароль",
125
- "aria-pressed": E,
124
+ "aria-label": D ? "Скрыть пароль" : "Показать пароль",
125
+ "aria-pressed": D,
126
126
  disabled: v,
127
- onClick: () => !v && D(!E),
128
- onKeyDown: (e) => {
129
- v || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), D(!E));
130
- },
127
+ onClick: () => !v && O(!D),
131
128
  style: {
132
129
  cursor: v ? "not-allowed" : "pointer",
133
130
  alignSelf: "center",
@@ -142,7 +139,7 @@ function u({ value: u, form: d, onValue: f, name: p = "", placeholder: m = "", l
142
139
  color: "inherit",
143
140
  font: "inherit"
144
141
  },
145
- children: E ? L : I
142
+ children: D ? L : I
146
143
  }),
147
144
  x
148
145
  ]
@@ -5,10 +5,10 @@ import r, { asEditableClipboard as i } from "../events/onEvent.js";
5
5
  import { isEmptyTextLike as a } from "./visibility.js";
6
6
  import o from "../mask/MaskPhone.js";
7
7
  import { useFormInit as s } from "../FormInitContext.js";
8
- import "react";
9
- import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
8
+ import c from "react";
9
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
10
10
  //#region src/lib/fields/Phone.tsx
11
- function d(e) {
11
+ function f(e) {
12
12
  let t = window.getSelection();
13
13
  if (!t || t.rangeCount === 0) return 0;
14
14
  let n = t.getRangeAt(0);
@@ -16,97 +16,107 @@ function d(e) {
16
16
  let r = document.createRange();
17
17
  return r.selectNodeContents(e), r.setEnd(n.startContainer, n.startOffset), r.toString().length;
18
18
  }
19
- function f(e, t) {
19
+ function p(e, t) {
20
20
  if (t <= 0) return 0;
21
21
  let n = 0;
22
22
  for (let r = 0; r < e.length; r++) if (/\d/.test(e[r]) && (n++, n === t)) return r + 1;
23
23
  return e.length;
24
24
  }
25
- function p({ value: p, form: m, onValue: h, onBlur: g, name: _ = "", placeholder: v = "", label: y = "", error: b = "", hidden: x = !1, disabled: S = !1, className: C = "", after: w = "", before: T = "", inputmode: E = "tel", view: D }) {
26
- let { onNotice: O } = s(), k = !S, { value: A, version: j } = n(m, _, p), M = "+_(___) ___-__-__", N = !0, P = 0, F = (e, t) => {
25
+ function m({ value: m, form: h, onValue: g, onBlur: _, name: v = "", placeholder: y = "", label: b = "", error: x = "", hidden: S = !1, disabled: C = !1, className: w = "", after: T = "", before: E = "", inputmode: D = "tel", view: O }) {
26
+ let { onNotice: k } = s(), A = !C, { value: j, version: M } = n(h, v, m), N = c.useRef(null), P = c.useRef(!1), F = "+_(___) ___-__-__", I = !0, L = 0, R = (e, t) => {
27
27
  let n = t.firstChild;
28
28
  if (!n || n.nodeType !== Node.TEXT_NODE) return;
29
29
  let r = n.textContent?.length ?? 0, i = Math.max(0, Math.min(e, r)), a = document.createRange(), o = window.getSelection();
30
30
  o && (a.setStart(n, i), a.collapse(!0), o.removeAllRanges(), o.addRange(a), t.focus());
31
- }, I = (e) => {
32
- let t = e.target, n = t.textContent || "", r = d(t), i = n.slice(0, r).replace(/\D/g, "").length, a = R(n);
31
+ }, z = (e) => {
32
+ let t = e.target, n = t.textContent || "", r = f(t), i = n.slice(0, r).replace(/\D/g, "").length, a = V(n);
33
33
  t.textContent = a.q;
34
- let o = f(a.q, i);
34
+ let o = p(a.q, i);
35
35
  a.q.length > 0 && queueMicrotask(() => {
36
- F(Math.min(o, a.q.length), t);
36
+ R(Math.min(o, a.q.length), t);
37
37
  });
38
38
  let s = {
39
39
  value: a.q.replace(/\D/g, ""),
40
- name: _ || ""
40
+ name: v || ""
41
41
  };
42
- m && _ && m.onValue(s), h && h !== m?.onValue && h(s);
43
- }, L = (e) => r.PasteOne(i(e)), R = (e) => {
44
- M = "+_(___) ___-__-__", N = !0, P = 0;
42
+ h && v && h.onValue(s), g && g !== h?.onValue && g(s);
43
+ }, B = (e) => r.PasteOne(i(e)), V = (e) => {
44
+ F = "+_(___) ___-__-__", I = !0, L = 0;
45
45
  let t = 0, n = "", r = e.replace(/\D/g, "");
46
- r === "" && (N = !0);
46
+ r === "" && (I = !0);
47
47
  let i = r.split(""), a = "";
48
48
  i.forEach((e) => {
49
- N && (a += e, o[a] !== void 0 && N ? (N = !1, M = o[a].mask.replace(/* @__PURE__ */ RegExp("[0-9]", "g"), "_"), n = o[a].code) : (N && (P = ("" + a).length, M = `+${a}_(___) ___-__-__`.replace(/* @__PURE__ */ RegExp("[0-9]", "g"), "_"), n = ""), P > ("" + a).length && (N = !0, M = `+${a}_(___) ___-__-__`.replace(/* @__PURE__ */ RegExp("[0-9]", "g"), "_"), n = "")));
49
+ I && (a += e, o[a] !== void 0 && I ? (I = !1, F = o[a].mask.replace(/* @__PURE__ */ RegExp("[0-9]", "g"), "_"), n = o[a].code) : (I && (L = ("" + a).length, F = `+${a}_(___) ___-__-__`.replace(/* @__PURE__ */ RegExp("[0-9]", "g"), "_"), n = ""), L > ("" + a).length && (I = !0, F = `+${a}_(___) ___-__-__`.replace(/* @__PURE__ */ RegExp("[0-9]", "g"), "_"), n = "")));
50
50
  });
51
- let s = M.replace(/\D/g, "");
51
+ let s = F.replace(/\D/g, "");
52
52
  return s.length >= r.length && (r = s), {
53
- q: M.replace(/[_\d]/g, function() {
53
+ q: F.replace(/[_\d]/g, function() {
54
54
  return r.charAt(t++) || "_";
55
55
  }),
56
56
  i: t,
57
57
  v: r,
58
58
  f: n
59
59
  };
60
- }, z = (e) => {
60
+ };
61
+ c.useLayoutEffect(() => {
62
+ if (P.current) return;
63
+ let e = N.current;
64
+ if (!e) return;
65
+ let t = V(String(j || ""));
66
+ e.textContent !== t.q && (e.textContent = t.q);
67
+ }, [j, M]);
68
+ let H = (e) => {
61
69
  e.preventDefault();
62
70
  let t = e.target;
63
71
  navigator.clipboard.writeText((t.textContent || "").replace(/\D/g, "")).then(function() {
64
- O("Данные в буфер обмене");
72
+ k("Данные в буфер обмене");
65
73
  }, function(e) {
66
74
  console.error("Async: Could not copy text: ", e);
67
75
  });
68
- }, B = R(String(A || "")), V = (e) => {
76
+ };
77
+ V(String(j || ""));
78
+ let U = (e) => {
69
79
  e.key === "Enter" && e.preventDefault();
70
- }, H = (e) => {
71
- r.Blur(e), g && g({
80
+ }, W = (e) => {
81
+ r.Blur(e), _ && _({
72
82
  value: (e.target.textContent || "").replace(/\D/g, ""),
73
- name: _ || ""
74
- });
75
- }, U = (e) => {
76
- r.Focus({ target: e.currentTarget });
77
- }, W = {};
78
- v && (W.placeholder = v), W.inputMode = E ?? "tel";
79
- let G = String(A ?? "").replace(/\D/g, "");
80
- return x && a(G) ? /* @__PURE__ */ l(c, {}) : /* @__PURE__ */ u(t, {
83
+ name: v || ""
84
+ }), P.current = !1;
85
+ }, G = (e) => {
86
+ P.current = !0, r.Focus({ target: e.currentTarget });
87
+ }, K = {};
88
+ y && (K.placeholder = y), K.inputMode = D ?? "tel";
89
+ let q = String(j ?? "").replace(/\D/g, "");
90
+ return S && a(q) ? /* @__PURE__ */ u(l, {}) : /* @__PURE__ */ d(t, {
81
91
  type: "input",
82
- label: y,
83
- error: b,
84
- element_blok: { className: [C] },
92
+ label: b,
93
+ error: x,
94
+ element_blok: { className: [w] },
85
95
  element_input: { className: [e.w] },
86
96
  children: [
87
- T,
88
- /* @__PURE__ */ l("div", {
89
- onPaste: L,
90
- onInput: I,
91
- onKeyDown: V,
92
- onContextMenu: z,
93
- onBlur: H,
94
- onFocus: U,
97
+ E,
98
+ /* @__PURE__ */ u("div", {
99
+ ref: N,
100
+ onPaste: B,
101
+ onInput: z,
102
+ onKeyDown: U,
103
+ onContextMenu: H,
104
+ onBlur: W,
105
+ onFocus: G,
95
106
  spellCheck: !1,
96
107
  role: "textbox",
97
- "aria-label": y || v || "Телефон",
98
- "aria-disabled": !k,
99
- tabIndex: S ? -1 : 0,
100
- "data-disabled": !k,
101
- contentEditable: k ? "plaintext-only" : !1,
108
+ "aria-label": b || y || "Телефон",
109
+ "aria-disabled": !A,
110
+ tabIndex: C ? -1 : 0,
111
+ "data-disabled": !A,
112
+ contentEditable: A ? "plaintext-only" : !1,
102
113
  suppressContentEditableWarning: !0,
103
- ...W,
104
- children: B.q
105
- }, j),
106
- w
114
+ ...K
115
+ }),
116
+ T
107
117
  ]
108
118
  });
109
119
  }
110
- p.displayName = "PhoneField";
120
+ m.displayName = "PhoneField";
111
121
  //#endregion
112
- export { p as default };
122
+ export { m as default };
@@ -17,7 +17,7 @@ function c({ value: c = 0, form: l, onValue: u, onBlur: d, name: f = "", placeho
17
17
  value: s(e, x, S, C),
18
18
  name: f || ""
19
19
  };
20
- l && f && l.setValue(t), u && u !== l?.onValue && u(t);
20
+ u && u !== l?.onValue && u(t);
21
21
  }, [
22
22
  l,
23
23
  f,
@@ -3,50 +3,59 @@ import t from "../core/Field.js";
3
3
  import { useFormFieldState as n } from "../hooks/use.js";
4
4
  import r, { asEditableClipboard as i } from "../events/onEvent.js";
5
5
  import { isEmptyTextLike as a } from "./visibility.js";
6
- import "react";
7
- import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
6
+ import o from "react";
7
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
8
8
  //#region src/lib/fields/Textarea.tsx
9
- function l({ value: l, form: u, onValue: d, name: f = "", placeholder: p = "", label: m = "", hidden: h = !1, disabled: g = !1, onBlur: _, className: v = "", after: y = "", before: b = "", error: x = "", inputmode: S = "text", maxLength: C, spellCheck: w = !0 }) {
10
- let { value: T, version: E } = n(u, f || "", l), D = !g, O = (e) => {
9
+ function u({ value: u, form: d, onValue: f, name: p = "", placeholder: m = "", label: h = "", hidden: g = !1, disabled: _ = !1, onBlur: v, className: y = "", after: b = "", before: x = "", error: S = "", inputmode: C = "text", maxLength: w, spellCheck: T = !0 }) {
10
+ let { value: E, version: D } = n(d, p || "", u), O = !_, k = String(E ?? ""), A = o.useRef(null), j = o.useRef(!1);
11
+ o.useLayoutEffect(() => {
12
+ if (j.current) return;
13
+ let e = A.current;
14
+ e && e.innerText !== k && (e.innerText = k);
15
+ }, [k, D]);
16
+ let M = (e) => {
11
17
  let t = {
12
18
  value: e.currentTarget.innerText,
13
- name: f || ""
19
+ name: p || ""
14
20
  };
15
- u && f && u.onValue(t), d && d !== u?.onValue && d(t);
16
- }, k = (e) => {
21
+ d && p && d.onValue(t), f && f !== d?.onValue && f(t);
22
+ }, N = (e) => {
17
23
  let t = (e.currentTarget.textContent ?? "").trim();
18
- C && t.length >= C && e.key !== "Backspace" && e.preventDefault(), e.key === "Enter" && !e.shiftKey && e.preventDefault();
19
- }, A = (e) => r.Paste(C || 0, i(e));
20
- if (h && a(T)) return /* @__PURE__ */ s(o, {});
21
- let j = {};
22
- return p && (j.placeholder = p), D && (j.edit = ""), j.inputMode = S || "text", /* @__PURE__ */ c(t, {
24
+ w && t.length >= w && e.key !== "Backspace" && e.preventDefault(), e.key === "Enter" && !e.shiftKey && e.preventDefault();
25
+ }, P = (e) => r.Paste(w || 0, i(e));
26
+ if (g && a(E)) return /* @__PURE__ */ c(s, {});
27
+ let F = {};
28
+ return m && (F.placeholder = m), O && (F.edit = ""), F.inputMode = C || "text", /* @__PURE__ */ l(t, {
23
29
  type: "note",
24
- label: m,
25
- error: x,
26
- element_blok: { className: [v || ""] },
30
+ label: h,
31
+ error: S,
32
+ element_blok: { className: [y || ""] },
27
33
  element_input: { className: [e.n] },
28
34
  children: [
29
- b,
30
- /* @__PURE__ */ s("div", {
31
- onPaste: A,
32
- onInput: O,
35
+ x,
36
+ /* @__PURE__ */ c("div", {
37
+ ref: A,
38
+ onPaste: P,
39
+ onInput: M,
40
+ onFocus: () => {
41
+ j.current = !0;
42
+ },
33
43
  onBlur: (e) => {
34
- r.Blur(e), _?.({
44
+ r.Blur(e), v?.({
35
45
  value: (e.currentTarget.textContent ?? "").trim(),
36
- name: f || ""
37
- });
46
+ name: p || ""
47
+ }), j.current = !1;
38
48
  },
39
- onKeyDown: k,
40
- spellCheck: w,
41
- contentEditable: D ? "plaintext-only" : !1,
49
+ onKeyDown: N,
50
+ spellCheck: T,
51
+ contentEditable: O ? "plaintext-only" : !1,
42
52
  suppressContentEditableWarning: !0,
43
- ...j,
44
- children: T
45
- }, E),
46
- y
53
+ ...F
54
+ }),
55
+ b
47
56
  ]
48
57
  });
49
58
  }
50
- l.displayName = "TextareaField";
59
+ u.displayName = "TextareaField";
51
60
  //#endregion
52
- export { l as default };
61
+ export { u as default };
@@ -82,7 +82,7 @@ function _(e, t, n) {
82
82
  }
83
83
  return p(Math.floor(i / 60), i % 60);
84
84
  }
85
- function v({ value: h = "", form: v, onValue: ee, onBlur: y, name: b = "", placeholder: x = "", label: S = "", hidden: C = !1, disabled: w = !1, error: T = "", className: E = "", after: D = "", before: te = "", step: O = 60, min: k, max: A, id: j, spellCheck: M = !1, align: N = "start" }) {
85
+ function v({ value: h = "", form: v, onValue: ee, onBlur: y, name: b = "", placeholder: x = "", label: S = "", hidden: C = !1, disabled: w = !1, error: T = "", className: E = "", after: te = "", before: D = "", step: O = 60, min: k, max: A, id: j, spellCheck: M = !1, align: N = "start" }) {
86
86
  let { value: P, version: F } = n(v, b, h), I = d(P), L = !w, R = i.useRef(null), z = i.useRef(null), B = i.useRef(null), [V, H] = i.useState(!1);
87
87
  i.useLayoutEffect(() => {
88
88
  if (!V || !L) return;
@@ -165,10 +165,7 @@ function v({ value: h = "", form: v, onValue: ee, onBlur: y, name: b = "", place
165
165
  let n = t.relatedTarget;
166
166
  if (n && e.contains(n)) return;
167
167
  let r = U();
168
- v && b && v.setValue({
169
- name: b,
170
- value: r
171
- }), y && b && y({
168
+ y && b && y({
172
169
  value: r,
173
170
  name: b
174
171
  }), H(!1);
@@ -198,7 +195,7 @@ function v({ value: h = "", form: v, onValue: ee, onBlur: y, name: b = "", place
198
195
  props: { "data-disabled": w || !L ? "true" : void 0 }
199
196
  },
200
197
  children: [
201
- te,
198
+ D,
202
199
  /* @__PURE__ */ o("div", {
203
200
  ref: B,
204
201
  className: e.timeInner,
@@ -244,8 +241,8 @@ function v({ value: h = "", form: v, onValue: ee, onBlur: y, name: b = "", place
244
241
  children: !L || !V ? Q === null ? "" : l(Q) : null
245
242
  })
246
243
  ]
247
- }, F),
248
- D
244
+ }),
245
+ te
249
246
  ]
250
247
  });
251
248
  }