@elcrm/form 0.0.64 → 0.0.65
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 +53 -27
- package/dist/core/Field.d.ts +3 -2
- package/dist/core/Field.js +1 -1
- package/dist/fields/Date.d.ts +2 -11
- package/dist/fields/Date.js +97 -90
- package/dist/fields/Input.d.ts +7 -22
- package/dist/fields/Input.js +110 -38
- package/dist/fields/Mask.d.ts +1 -1
- package/dist/fields/Mask.js +54 -48
- package/dist/fields/Modal.d.ts +7 -7
- package/dist/fields/Modal.js +37 -30
- package/dist/fields/Money.d.ts +8 -29
- package/dist/fields/Money.js +60 -53
- package/dist/fields/Numeric.d.ts +1 -1
- package/dist/fields/Numeric.js +46 -42
- package/dist/fields/Options.d.ts +9 -7
- package/dist/fields/Options.js +38 -32
- package/dist/fields/Password.d.ts +1 -1
- package/dist/fields/Password.js +90 -37
- package/dist/fields/Phone.d.ts +2 -20
- package/dist/fields/Phone.js +58 -55
- package/dist/fields/Range.d.ts +1 -1
- package/dist/fields/Range.js +74 -72
- package/dist/fields/Select.d.ts +1 -1
- package/dist/fields/Select.js +58 -55
- package/dist/fields/Textarea.d.ts +2 -22
- package/dist/fields/Textarea.js +37 -32
- package/dist/fields/Time.d.ts +1 -1
- package/dist/fields/Time.js +65 -63
- package/dist/fields/type.d.ts +50 -15
- package/dist/fields/visibility.d.ts +6 -0
- package/dist/fields/visibility.js +6 -0
- package/dist/hooks/use.d.ts +0 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/index.umd.js +0 -2
- package/dist/style.css +0 -5
package/dist/fields/Input.js
CHANGED
|
@@ -2,54 +2,126 @@ import e from "../styles/Field.module.js";
|
|
|
2
2
|
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
|
-
import "
|
|
6
|
-
import
|
|
5
|
+
import { isEmptyTextLike as a } from "./visibility.js";
|
|
6
|
+
import o from "react";
|
|
7
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
8
|
//#region src/lib/fields/Input.tsx
|
|
8
|
-
function
|
|
9
|
-
let { value:
|
|
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, native: T = !1, autoComplete: E, inputType: D = "text", id: O }) {
|
|
10
|
+
let { value: k, version: A } = n(u, f, l), j = !g, M = typeof k == "string" || typeof k == "number" ? String(k) : "", N = o.useRef(null);
|
|
11
|
+
o.useEffect(() => {
|
|
12
|
+
if (!T) return;
|
|
13
|
+
let e = N.current;
|
|
14
|
+
e && e.value !== M && (e.value = M);
|
|
15
|
+
}, [T, M]);
|
|
16
|
+
let P = (e) => {
|
|
10
17
|
let t = {
|
|
11
18
|
value: (e.target.textContent || "").trim(),
|
|
12
|
-
name:
|
|
13
|
-
reload: C
|
|
19
|
+
name: f
|
|
14
20
|
};
|
|
15
|
-
|
|
16
|
-
},
|
|
21
|
+
u && f && u.onValue(t), d && d !== u?.onValue && d(t);
|
|
22
|
+
}, F = (e) => {
|
|
23
|
+
let t = {
|
|
24
|
+
value: e.target.value,
|
|
25
|
+
name: f
|
|
26
|
+
};
|
|
27
|
+
u && f && u.onValue(t), d && d !== u?.onValue && d(t);
|
|
28
|
+
}, I = (e) => {
|
|
17
29
|
let t = e.target;
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
30
|
+
C && (t.textContent || "").trim().length >= C && e.key !== "Backspace" && e.preventDefault(), e.key === "Enter" && e.preventDefault();
|
|
31
|
+
}, L = (e) => {
|
|
32
|
+
e.key === "Enter" && e.preventDefault();
|
|
33
|
+
}, R = (e) => r.Paste(C || 0, i(e));
|
|
34
|
+
if (h && a(k)) return "";
|
|
35
|
+
let z = (e) => {
|
|
36
|
+
r.Blur(e), _?.({
|
|
37
|
+
value: (e.target.textContent || "").trim(),
|
|
38
|
+
name: f
|
|
39
|
+
});
|
|
40
|
+
}, B = (e) => {
|
|
41
|
+
_?.({
|
|
42
|
+
value: (e.target.value || "").trim(),
|
|
43
|
+
name: f
|
|
44
|
+
});
|
|
45
|
+
}, V = (e) => {
|
|
46
|
+
r.Focus({ target: e.currentTarget });
|
|
47
|
+
}, H = {};
|
|
48
|
+
return p && (H.placeholder = p), j && (H.edit = ""), T ? /* @__PURE__ */ c(t, {
|
|
23
49
|
type: "input",
|
|
24
|
-
|
|
25
|
-
error:
|
|
26
|
-
element_blok: { className: [
|
|
27
|
-
element_input: {
|
|
50
|
+
label: m,
|
|
51
|
+
error: x,
|
|
52
|
+
element_blok: { className: [v || ""] },
|
|
53
|
+
element_input: {
|
|
54
|
+
className: [e.w],
|
|
55
|
+
props: { "data-disabled": g || !j ? "true" : void 0 }
|
|
56
|
+
},
|
|
28
57
|
children: [
|
|
29
|
-
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
onFocus: (e) => {
|
|
38
|
-
r.Focus({ target: e.currentTarget });
|
|
58
|
+
b,
|
|
59
|
+
/* @__PURE__ */ s("div", {
|
|
60
|
+
style: {
|
|
61
|
+
flex: 1,
|
|
62
|
+
minWidth: 0,
|
|
63
|
+
display: "flex",
|
|
64
|
+
alignItems: "center"
|
|
39
65
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
66
|
+
children: /* @__PURE__ */ s("input", {
|
|
67
|
+
id: O,
|
|
68
|
+
ref: N,
|
|
69
|
+
type: D,
|
|
70
|
+
name: f || void 0,
|
|
71
|
+
defaultValue: M,
|
|
72
|
+
placeholder: p,
|
|
73
|
+
maxLength: C,
|
|
74
|
+
spellCheck: w,
|
|
75
|
+
disabled: g,
|
|
76
|
+
readOnly: g,
|
|
77
|
+
autoComplete: E,
|
|
78
|
+
inputMode: S || "text",
|
|
79
|
+
"aria-label": m || p || "Текст",
|
|
80
|
+
"aria-disabled": g || !j ? !0 : void 0,
|
|
81
|
+
tabIndex: g ? -1 : 0,
|
|
82
|
+
onChange: F,
|
|
83
|
+
onBlur: B,
|
|
84
|
+
onKeyDown: L,
|
|
85
|
+
style: {
|
|
86
|
+
width: "100%",
|
|
87
|
+
border: "none",
|
|
88
|
+
outline: "none",
|
|
89
|
+
background: "transparent",
|
|
90
|
+
font: "inherit",
|
|
91
|
+
color: "inherit",
|
|
92
|
+
padding: 0,
|
|
93
|
+
margin: 0,
|
|
94
|
+
boxSizing: "border-box"
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
}),
|
|
98
|
+
y
|
|
99
|
+
]
|
|
100
|
+
}) : /* @__PURE__ */ c(t, {
|
|
101
|
+
type: "input",
|
|
102
|
+
label: m,
|
|
103
|
+
error: x,
|
|
104
|
+
element_blok: { className: [v] },
|
|
105
|
+
element_input: { className: [e.w] },
|
|
106
|
+
children: [
|
|
107
|
+
b,
|
|
108
|
+
/* @__PURE__ */ s("div", {
|
|
109
|
+
id: O,
|
|
110
|
+
onBlur: z,
|
|
111
|
+
onFocus: V,
|
|
112
|
+
onPaste: R,
|
|
113
|
+
onInput: P,
|
|
114
|
+
onKeyDown: I,
|
|
115
|
+
spellCheck: w,
|
|
116
|
+
inputMode: S || "text",
|
|
117
|
+
contentEditable: j ? "plaintext-only" : !1,
|
|
46
118
|
suppressContentEditableWarning: !0,
|
|
47
|
-
...
|
|
48
|
-
children: typeof
|
|
49
|
-
},
|
|
50
|
-
|
|
119
|
+
...H,
|
|
120
|
+
children: typeof k == "string" || typeof k == "number" ? String(k) : ""
|
|
121
|
+
}, A),
|
|
122
|
+
y
|
|
51
123
|
]
|
|
52
124
|
});
|
|
53
125
|
}
|
|
54
126
|
//#endregion
|
|
55
|
-
export {
|
|
127
|
+
export { l as default };
|
package/dist/fields/Mask.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { TInput } from './type';
|
|
|
2
2
|
type TMask = TInput & {
|
|
3
3
|
format?: string;
|
|
4
4
|
};
|
|
5
|
-
declare function MaskField({ value, form, onValue,
|
|
5
|
+
declare function MaskField({ value, form, onValue, onBlur: onBlurField, name, format, placeholder, label, error, hidden, disabled, className, after, before, inputmode, view, }: TMask): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
declare namespace MaskField {
|
|
7
7
|
var displayName: string;
|
|
8
8
|
}
|
package/dist/fields/Mask.js
CHANGED
|
@@ -2,10 +2,11 @@ import e from "../styles/Field.module.js";
|
|
|
2
2
|
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
|
+
import { isEmptyTextLike as a } from "./visibility.js";
|
|
5
6
|
import "react";
|
|
6
|
-
import { Fragment as
|
|
7
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
8
|
//#region src/lib/fields/Mask.tsx
|
|
8
|
-
function
|
|
9
|
+
function l(e) {
|
|
9
10
|
let t = window.getSelection();
|
|
10
11
|
if (!t || t.rangeCount === 0) return 0;
|
|
11
12
|
let n = t.getRangeAt(0);
|
|
@@ -13,83 +14,88 @@ function s(e) {
|
|
|
13
14
|
let r = document.createRange();
|
|
14
15
|
return r.selectNodeContents(e), r.setEnd(n.startContainer, n.startOffset), r.toString().length;
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
+
function u(e, t) {
|
|
17
18
|
if (t <= 0) return 0;
|
|
18
19
|
let n = 0;
|
|
19
20
|
for (let r = 0; r < e.length; r++) if (/\d/.test(e[r]) && (n++, n === t)) return r + 1;
|
|
20
21
|
return e.length;
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
let { value: E, version: D } = n(u, p, l);
|
|
25
|
-
v = !!(v && (E === "" || E === void 0)) && !(y && b);
|
|
26
|
-
let O = m, k = !0, A = 0, j = (e, t) => {
|
|
23
|
+
function d({ value: d = "", form: f, onValue: p, onBlur: m, name: h = "", format: g = "+_(___) ___-__-__", placeholder: _ = "", label: v = "", error: y = "", hidden: b = !1, disabled: x = !1, className: S = "", after: C = "", before: w = "", inputmode: T = "numeric", view: E }) {
|
|
24
|
+
let D = !x, { value: O, version: k } = n(f, h, d), A = g, j = !0, M = 0, N = (e, t) => {
|
|
27
25
|
let n = t.firstChild;
|
|
28
26
|
if (!n || n.nodeType !== Node.TEXT_NODE) return;
|
|
29
27
|
let r = n.textContent?.length ?? 0, i = Math.max(0, Math.min(e, r)), a = document.createRange(), o = window.getSelection();
|
|
30
28
|
o && (a.setStart(n, i), a.collapse(!0), o.removeAllRanges(), o.addRange(a), t.focus());
|
|
31
|
-
},
|
|
32
|
-
|
|
29
|
+
}, P = (e) => r.PasteOne(i(e)), F = (e) => {
|
|
30
|
+
A = g, j = !0, M = 0;
|
|
33
31
|
let t = 0, n = "", r = e.replace(/\D/g, "");
|
|
34
|
-
r === "" && (
|
|
32
|
+
r === "" && (j = !0);
|
|
35
33
|
let i = r.split(""), a = "";
|
|
36
34
|
i.forEach((e) => {
|
|
37
|
-
|
|
35
|
+
j && (a += e, j && (M = ("" + a).length, A = g.replace(/* @__PURE__ */ RegExp("[0-9]", "g"), "_"), n = ""), M > ("" + a).length && (j = !0, A = g.replace(/* @__PURE__ */ RegExp("[0-9]", "g"), "_"), n = ""));
|
|
38
36
|
});
|
|
39
|
-
let o =
|
|
37
|
+
let o = A.replace(/\D/g, "");
|
|
40
38
|
return o.length >= r.length && (r = o), {
|
|
41
|
-
q:
|
|
39
|
+
q: A.replace(/[_\d]/g, function() {
|
|
42
40
|
return r.charAt(t++) || "_";
|
|
43
41
|
}),
|
|
44
42
|
i: t,
|
|
45
43
|
v: r,
|
|
46
44
|
f: n
|
|
47
45
|
};
|
|
48
|
-
},
|
|
49
|
-
let t = e.target, n = t.textContent || "", r =
|
|
46
|
+
}, I = F(String(O || "")), L = (e) => {
|
|
47
|
+
let t = e.target, n = t.textContent || "", r = l(t), i = n.slice(0, r).replace(/\D/g, "").length, a = F(n);
|
|
50
48
|
t.textContent = a.q;
|
|
51
|
-
let o =
|
|
49
|
+
let o = u(a.q, i);
|
|
52
50
|
a.q.length > 0 && queueMicrotask(() => {
|
|
53
|
-
|
|
51
|
+
N(Math.min(o, a.q.length), t);
|
|
54
52
|
});
|
|
55
|
-
let
|
|
53
|
+
let s = {
|
|
56
54
|
value: a.q.replace(/\D/g, ""),
|
|
57
|
-
name:
|
|
55
|
+
name: h
|
|
58
56
|
};
|
|
59
|
-
|
|
60
|
-
},
|
|
57
|
+
f && h && f.onValue(s), p && p !== f?.onValue && p(s);
|
|
58
|
+
}, R = (e) => {
|
|
61
59
|
e.key === "Enter" && e.preventDefault();
|
|
62
|
-
},
|
|
63
|
-
r.Blur(e),
|
|
60
|
+
}, z = (e) => {
|
|
61
|
+
r.Blur(e), m && m({
|
|
64
62
|
value: (e.target.textContent ?? "").replace(/\D/g, ""),
|
|
65
|
-
name:
|
|
63
|
+
name: h
|
|
66
64
|
});
|
|
67
|
-
},
|
|
65
|
+
}, B = (e) => {
|
|
68
66
|
r.Focus({ target: e.currentTarget });
|
|
69
|
-
},
|
|
70
|
-
|
|
67
|
+
}, V = {};
|
|
68
|
+
_ && (V.placeholder = _), V.inputMode = T ?? "numeric";
|
|
69
|
+
let H = String(O ?? "").replace(/\D/g, "");
|
|
70
|
+
return b && a(H) ? /* @__PURE__ */ s(o, {}) : /* @__PURE__ */ c(t, {
|
|
71
71
|
type: "input",
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
label: v,
|
|
73
|
+
error: y,
|
|
74
|
+
element_blok: { className: [S] },
|
|
74
75
|
element_input: { className: [e.w] },
|
|
75
|
-
children:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
76
|
+
children: [
|
|
77
|
+
w,
|
|
78
|
+
/* @__PURE__ */ s("div", {
|
|
79
|
+
onPaste: P,
|
|
80
|
+
onInput: L,
|
|
81
|
+
onKeyDown: R,
|
|
82
|
+
onBlur: z,
|
|
83
|
+
onFocus: B,
|
|
84
|
+
role: "textbox",
|
|
85
|
+
spellCheck: !1,
|
|
86
|
+
"aria-label": v || _ || h || "Маска",
|
|
87
|
+
"aria-disabled": !D,
|
|
88
|
+
tabIndex: x ? -1 : 0,
|
|
89
|
+
"data-disabled": !D,
|
|
90
|
+
contentEditable: D ? "plaintext-only" : !1,
|
|
91
|
+
suppressContentEditableWarning: !0,
|
|
92
|
+
...V,
|
|
93
|
+
children: I.q
|
|
94
|
+
}, k),
|
|
95
|
+
C
|
|
96
|
+
]
|
|
91
97
|
});
|
|
92
98
|
}
|
|
93
|
-
|
|
99
|
+
d.displayName = "MaskField";
|
|
94
100
|
//#endregion
|
|
95
|
-
export {
|
|
101
|
+
export { d as default };
|
package/dist/fields/Modal.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { UseFormApi } from '../hooks/use';
|
|
2
3
|
import { TValue } from './type';
|
|
3
4
|
interface Input {
|
|
@@ -6,19 +7,18 @@ interface Input {
|
|
|
6
7
|
onValue?: (data: TValue) => void | Promise<void>;
|
|
7
8
|
name: string;
|
|
8
9
|
placeholder?: string;
|
|
9
|
-
|
|
10
|
+
label?: string;
|
|
10
11
|
error?: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
after?: string;
|
|
12
|
+
hidden?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
after?: ReactNode;
|
|
15
|
+
before?: ReactNode;
|
|
16
16
|
view?: string;
|
|
17
17
|
className?: string;
|
|
18
18
|
modal: string;
|
|
19
19
|
options?: Record<string | number, unknown>;
|
|
20
20
|
}
|
|
21
|
-
declare function ModalField({ value, form, onValue, name, placeholder,
|
|
21
|
+
declare function ModalField({ value, form, onValue, name, placeholder, label, error, hidden, disabled, after, before, view, modal, options, className, }: Input): import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
declare namespace ModalField {
|
|
23
23
|
var displayName: string;
|
|
24
24
|
}
|
package/dist/fields/Modal.js
CHANGED
|
@@ -1,55 +1,62 @@
|
|
|
1
1
|
import e from "../styles/Field.module.js";
|
|
2
2
|
import t from "../core/Field.js";
|
|
3
3
|
import { useFormFieldState as n } from "../hooks/use.js";
|
|
4
|
-
import {
|
|
4
|
+
import { isEmptyTextLike as r } from "./visibility.js";
|
|
5
|
+
import { useFormInit as i } from "../FormInitContext.js";
|
|
5
6
|
import "react";
|
|
6
|
-
import { Fragment as
|
|
7
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
8
|
//#region src/lib/fields/Modal.tsx
|
|
8
|
-
function
|
|
9
|
-
let { onModal:
|
|
9
|
+
function c({ value: c, form: l, onValue: u, name: d, placeholder: f = "", label: p, error: m, hidden: h = !1, disabled: g = !1, after: _, before: v, view: y, modal: b, options: x, className: S }) {
|
|
10
|
+
let { onModal: C } = i(), { value: w } = n(l, d, c), T = w, E = (e) => e ? Array.isArray(e) ? e[1] || "" : e : "", D = (e) => {
|
|
10
11
|
if (Array.isArray(e) && e.length >= 2) return [e[0], String(e[1] ?? "")];
|
|
11
12
|
if (typeof e == "object" && e) {
|
|
12
13
|
let t = e;
|
|
13
14
|
if (t.id !== void 0 && t.name !== void 0) return [t.id, t.name];
|
|
14
15
|
}
|
|
15
16
|
return String(e ?? "");
|
|
16
|
-
},
|
|
17
|
+
}, O = (e) => {
|
|
17
18
|
let t = {
|
|
18
|
-
value:
|
|
19
|
-
name:
|
|
19
|
+
value: D(e),
|
|
20
|
+
name: d
|
|
20
21
|
};
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
if (
|
|
24
|
-
if (!
|
|
25
|
-
let e =
|
|
22
|
+
l && d && l.setValue(t), u && u !== l?.onValue && u(t);
|
|
23
|
+
}, k = () => {
|
|
24
|
+
if (g) return;
|
|
25
|
+
if (!b) return console.error("modal - empty");
|
|
26
|
+
let e = b.split(".");
|
|
26
27
|
if (e.length < 2) return console.error("modal должен быть в формате 'module.name'");
|
|
27
|
-
let t = Array.isArray(
|
|
28
|
-
|
|
28
|
+
let t = Array.isArray(T) ? T[0] : T;
|
|
29
|
+
C({
|
|
29
30
|
module: e[0],
|
|
30
31
|
modalName: e[1],
|
|
31
|
-
callback:
|
|
32
|
-
onValue:
|
|
33
|
-
options:
|
|
34
|
-
fieldName:
|
|
32
|
+
callback: O,
|
|
33
|
+
onValue: O,
|
|
34
|
+
options: x,
|
|
35
|
+
fieldName: d,
|
|
35
36
|
value: t
|
|
36
37
|
});
|
|
37
|
-
},
|
|
38
|
-
|
|
38
|
+
}, A = {};
|
|
39
|
+
f && (A.placeholder = f);
|
|
40
|
+
let j = r(E(T));
|
|
41
|
+
return h && j ? /* @__PURE__ */ o(a, {}) : /* @__PURE__ */ s(t, {
|
|
39
42
|
type: "input",
|
|
40
|
-
|
|
41
|
-
element_blok: { className: [
|
|
42
|
-
error:
|
|
43
|
+
label: p,
|
|
44
|
+
element_blok: { className: [S || ""] },
|
|
45
|
+
error: m,
|
|
43
46
|
element_input: {
|
|
44
47
|
className: [e.w],
|
|
45
|
-
props: { onClick:
|
|
48
|
+
props: { onClick: k }
|
|
46
49
|
},
|
|
47
|
-
children:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
children: [
|
|
51
|
+
v,
|
|
52
|
+
/* @__PURE__ */ o("div", {
|
|
53
|
+
...A,
|
|
54
|
+
children: E(T)
|
|
55
|
+
}),
|
|
56
|
+
_
|
|
57
|
+
]
|
|
51
58
|
});
|
|
52
59
|
}
|
|
53
|
-
|
|
60
|
+
c.displayName = "ModalField";
|
|
54
61
|
//#endregion
|
|
55
|
-
export {
|
|
62
|
+
export { c as default };
|
package/dist/fields/Money.d.ts
CHANGED
|
@@ -1,34 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/** Связь с useForm — подписка и синхронизация значения */
|
|
5
|
-
form?: UseFormApi;
|
|
6
|
-
onValue?: (payload: {
|
|
7
|
-
value: number;
|
|
8
|
-
name?: string;
|
|
9
|
-
}) => void;
|
|
10
|
-
onSave?: (payload: {
|
|
11
|
-
value: number;
|
|
12
|
-
name?: string;
|
|
13
|
-
}) => void;
|
|
14
|
-
name?: string;
|
|
15
|
-
placeholder?: string;
|
|
16
|
-
title?: string;
|
|
17
|
-
label?: string;
|
|
18
|
-
error?: string;
|
|
19
|
-
hide?: boolean;
|
|
20
|
-
edit?: boolean;
|
|
21
|
-
active?: boolean;
|
|
22
|
-
after?: string;
|
|
23
|
-
show?: boolean;
|
|
24
|
-
view?: string;
|
|
25
|
-
type?: string;
|
|
26
|
-
className?: string;
|
|
1
|
+
import { TInput } from './type';
|
|
2
|
+
type TMoney = TInput & {
|
|
3
|
+
/** Курс для отображения (множитель при записи в форму) */
|
|
27
4
|
course?: number;
|
|
5
|
+
/** Кнопка очистки */
|
|
28
6
|
isClear?: boolean;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
7
|
+
/** Режим фильтра символов при вводе */
|
|
8
|
+
type?: string;
|
|
9
|
+
};
|
|
10
|
+
declare function MoneyField({ value, form, onValue, name, placeholder, label, error, hidden, disabled, onBlur: onBlurField, className, after, before, inputmode, course, view, type, isClear, }: TMoney): import("react/jsx-runtime").JSX.Element | "";
|
|
32
11
|
declare namespace MoneyField {
|
|
33
12
|
var displayName: string;
|
|
34
13
|
}
|