@elcrm/form 0.0.82 → 0.0.84
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/assets/styles/Color.module.css +1 -1
- package/dist/assets/styles/Field.module.css +1 -1
- package/dist/assets/styles/Form.module.css +1 -1
- package/dist/assets/styles/Select.module.css +1 -1
- package/dist/core/Field.js +1 -1
- package/dist/fields/Color.js +189 -185
- package/dist/fields/Date.js +145 -140
- package/dist/fields/Password.js +5 -17
- package/dist/fields/Select.js +47 -43
- package/dist/fields/Time.js +107 -104
- package/dist/index.js +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/overlayZ.d.ts +7 -0
- package/dist/overlayZ.js +21 -0
- package/dist/package.js +1 -1
- package/dist/style.css +4 -4
- package/dist/styles/Color.module.js +23 -23
- package/dist/styles/Field.module.js +72 -72
- package/dist/styles/Form.module.js +8 -8
- package/dist/styles/Select.module.js +5 -5
- package/package.json +1 -1
package/dist/fields/Date.js
CHANGED
|
@@ -3,21 +3,22 @@ import t from "../core/Field.js";
|
|
|
3
3
|
import { useFormFieldState as n } from "../hooks/use.js";
|
|
4
4
|
import { isEmptyTextLike as r } from "./visibility.js";
|
|
5
5
|
import i from "../styles/Form.module.js";
|
|
6
|
-
import a from "
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
6
|
+
import { acquireOverlayZIndex as a, releaseOverlayZIndex as o } from "../overlayZ.js";
|
|
7
|
+
import s from "react";
|
|
8
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
|
+
import { createPortal as d } from "react-dom";
|
|
9
10
|
//#region src/lib/fields/Date.tsx
|
|
10
|
-
function
|
|
11
|
+
function f(e) {
|
|
11
12
|
return !!(e == null || typeof e == "string" && r(e) || e instanceof Date && Number.isNaN(e.getTime()));
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
+
function p(e, t, n, r) {
|
|
14
15
|
let i = new Date(e, t - 1, 1);
|
|
15
16
|
return !(n && new Date(e, t, 0) < n || r && i > r);
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
+
function m(e, t, n) {
|
|
18
19
|
return !(t && e < t.getFullYear() || n && e > n.getFullYear());
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
+
function h(e, t, n) {
|
|
21
22
|
let r = e;
|
|
22
23
|
if (t) {
|
|
23
24
|
let e = t.getFullYear();
|
|
@@ -29,12 +30,12 @@ function p(e, t, n) {
|
|
|
29
30
|
}
|
|
30
31
|
return r;
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
+
function g(e) {
|
|
33
34
|
if (!(e instanceof HTMLElement)) return !1;
|
|
34
35
|
let t = e.tagName;
|
|
35
36
|
return t === "INPUT" || t === "TEXTAREA" || t === "SELECT" ? !0 : !!e.isContentEditable;
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
+
function _(e) {
|
|
38
39
|
let t = (e || "").trim();
|
|
39
40
|
if (!t) return null;
|
|
40
41
|
let n = t.split(/\s+/)[0].replace(/,/g, "."), r = (e, t, n) => {
|
|
@@ -48,15 +49,15 @@ function h(e) {
|
|
|
48
49
|
let a = n.replace(/\D/g, "");
|
|
49
50
|
return a.length === 8 ? r(parseInt(a.slice(4, 8), 10), parseInt(a.slice(2, 4), 10), parseInt(a.slice(0, 2), 10)) || r(parseInt(a.slice(0, 4), 10), parseInt(a.slice(4, 6), 10), parseInt(a.slice(6, 8), 10)) : null;
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
+
function v(e, t, n) {
|
|
52
53
|
let r = e.getTime();
|
|
53
54
|
return t && r < t.getTime() && (r = t.getTime()), n && r > n.getTime() && (r = n.getTime()), new Date(r);
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
-
return e.getFullYear() + "-" +
|
|
56
|
+
function y(e) {
|
|
57
|
+
return e.getFullYear() + "-" + w(2, e.getMonth() + 1) + "-" + w(2, e.getDate());
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
-
let j =
|
|
59
|
+
function b({ label: i = "", error: a, hidden: o = !1, className: p, placeholder: m, disabled: h = !1, onValue: b, max: S, min: C, form: w, icon: E, name: D = "", value: O, after: k = "", before: A = "" }) {
|
|
60
|
+
let j = s.useCallback((e) => {
|
|
60
61
|
if (e == null || typeof e == "string" && r(e)) return "";
|
|
61
62
|
if (e instanceof Date) return Number.isNaN(e.getTime()) ? "" : e;
|
|
62
63
|
if (typeof e == "string" || typeof e == "number") {
|
|
@@ -64,7 +65,7 @@ function v({ label: i = "", error: d, hidden: f = !1, className: p, placeholder:
|
|
|
64
65
|
return Number.isNaN(t.getTime()) ? "" : e;
|
|
65
66
|
}
|
|
66
67
|
return "";
|
|
67
|
-
}, []), { value: M } = n(
|
|
68
|
+
}, []), { value: M } = n(w, D, O), [N, P] = s.useState(j(M)), F = s.useRef(null), [I, L] = s.useState(null), [R, z] = s.useState(!1), B = s.useCallback(() => {
|
|
68
69
|
let e = F.current;
|
|
69
70
|
if (!e) return;
|
|
70
71
|
let t = e.getBoundingClientRect();
|
|
@@ -74,7 +75,7 @@ function v({ label: i = "", error: d, hidden: f = !1, className: p, placeholder:
|
|
|
74
75
|
b: t.bottom
|
|
75
76
|
});
|
|
76
77
|
}, []);
|
|
77
|
-
|
|
78
|
+
s.useEffect(() => {
|
|
78
79
|
if (!R) return;
|
|
79
80
|
B();
|
|
80
81
|
let e = () => {
|
|
@@ -83,31 +84,31 @@ function v({ label: i = "", error: d, hidden: f = !1, className: p, placeholder:
|
|
|
83
84
|
return window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
|
|
84
85
|
window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
|
|
85
86
|
};
|
|
86
|
-
}, [R, B]),
|
|
87
|
+
}, [R, B]), s.useEffect(() => {
|
|
87
88
|
P(j(M));
|
|
88
89
|
}, [M, j]);
|
|
89
|
-
let V =
|
|
90
|
+
let V = s.useCallback((e) => {
|
|
90
91
|
let t = {
|
|
91
92
|
value: e,
|
|
92
93
|
name: D
|
|
93
94
|
};
|
|
94
|
-
P(e),
|
|
95
|
+
P(e), w && D && w.setValue(t), b && b !== w?.onValue && b(t);
|
|
95
96
|
}, [
|
|
96
|
-
|
|
97
|
+
w,
|
|
97
98
|
D,
|
|
98
|
-
|
|
99
|
+
b
|
|
99
100
|
]);
|
|
100
|
-
|
|
101
|
-
if (!R ||
|
|
101
|
+
s.useEffect(() => {
|
|
102
|
+
if (!R || h) return;
|
|
102
103
|
let e = "", t = (t) => {
|
|
103
|
-
let n =
|
|
104
|
+
let n = _(t);
|
|
104
105
|
if (!n) return !1;
|
|
105
|
-
let r =
|
|
106
|
+
let r = y(v(n, C, S));
|
|
106
107
|
return r === e ? !0 : (e = r, V(r), z(!1), !0);
|
|
107
108
|
}, n = (e) => {
|
|
108
|
-
|
|
109
|
+
g(e.target) || t(e.clipboardData?.getData("text/plain") ?? "") && (e.preventDefault(), e.stopPropagation());
|
|
109
110
|
}, r = (e) => {
|
|
110
|
-
(e.ctrlKey || e.metaKey) && (e.key !== "v" && e.key !== "V" ||
|
|
111
|
+
(e.ctrlKey || e.metaKey) && (e.key !== "v" && e.key !== "V" || g(e.target) || navigator.clipboard?.readText && (e.preventDefault(), navigator.clipboard.readText().then((e) => {
|
|
111
112
|
t(e);
|
|
112
113
|
})));
|
|
113
114
|
};
|
|
@@ -116,13 +117,13 @@ function v({ label: i = "", error: d, hidden: f = !1, className: p, placeholder:
|
|
|
116
117
|
};
|
|
117
118
|
}, [
|
|
118
119
|
R,
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
h,
|
|
121
|
+
C,
|
|
121
122
|
S,
|
|
122
123
|
V
|
|
123
124
|
]);
|
|
124
125
|
let H = (e) => {
|
|
125
|
-
if (
|
|
126
|
+
if (h) return;
|
|
126
127
|
let t = e.currentTarget.getBoundingClientRect();
|
|
127
128
|
L({
|
|
128
129
|
x: t.left,
|
|
@@ -130,72 +131,74 @@ function v({ label: i = "", error: d, hidden: f = !1, className: p, placeholder:
|
|
|
130
131
|
b: t.bottom
|
|
131
132
|
}), z(!0);
|
|
132
133
|
}, U = {};
|
|
133
|
-
|
|
134
|
+
m && (U.placeholder = m);
|
|
134
135
|
let W = M == null || M === "" || typeof M == "string" && r(M);
|
|
135
|
-
return
|
|
136
|
+
return o && W ? /* @__PURE__ */ l(c, {}) : /* @__PURE__ */ u(c, { children: [E ? E() : /* @__PURE__ */ u(t, {
|
|
136
137
|
type: "date",
|
|
137
138
|
label: i,
|
|
138
|
-
error:
|
|
139
|
+
error: a,
|
|
139
140
|
element_blok: { className: [p || ""] },
|
|
140
141
|
element_input: {
|
|
141
142
|
className: [e.w],
|
|
142
|
-
props: { "data-disabled":
|
|
143
|
+
props: { "data-disabled": h ? "true" : void 0 }
|
|
143
144
|
},
|
|
144
145
|
children: [
|
|
145
|
-
A ? /* @__PURE__ */
|
|
146
|
+
A ? /* @__PURE__ */ l("span", {
|
|
146
147
|
className: e.affix,
|
|
147
148
|
children: A
|
|
148
149
|
}) : null,
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ l("div", {
|
|
150
151
|
ref: F,
|
|
151
152
|
onClick: H,
|
|
152
153
|
onKeyDown: (e) => {
|
|
153
154
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), H(e));
|
|
154
155
|
},
|
|
155
|
-
tabIndex:
|
|
156
|
+
tabIndex: h ? -1 : 0,
|
|
156
157
|
role: "button",
|
|
157
158
|
"aria-haspopup": "dialog",
|
|
158
159
|
"aria-expanded": R,
|
|
159
|
-
"aria-label": i ||
|
|
160
|
-
"data-edit":
|
|
160
|
+
"aria-label": i || m || "Дата",
|
|
161
|
+
"data-edit": h ? void 0 : "true",
|
|
161
162
|
...U,
|
|
162
|
-
style: { cursor:
|
|
163
|
-
children:
|
|
163
|
+
style: { cursor: h ? "not-allowed" : "pointer" },
|
|
164
|
+
children: f(N) ? "" : T(N, "dd.mm.yyyy")
|
|
164
165
|
}),
|
|
165
|
-
k ? /* @__PURE__ */
|
|
166
|
+
k ? /* @__PURE__ */ l("span", {
|
|
166
167
|
className: e.affix,
|
|
167
168
|
children: k
|
|
168
169
|
}) : null
|
|
169
170
|
]
|
|
170
|
-
}), R && I &&
|
|
171
|
+
}), R && I && d(/* @__PURE__ */ l(x, {
|
|
171
172
|
position: I,
|
|
172
173
|
onValue: V,
|
|
173
174
|
date: N,
|
|
174
175
|
max: S,
|
|
175
|
-
min:
|
|
176
|
+
min: C,
|
|
176
177
|
onOpen: z,
|
|
177
178
|
className: p
|
|
178
179
|
}, "elcrm-date-popup"), document.body)] });
|
|
179
180
|
}
|
|
180
|
-
|
|
181
|
-
var
|
|
182
|
-
let
|
|
183
|
-
|
|
184
|
-
let
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
181
|
+
b.displayName = "DateField";
|
|
182
|
+
var x = ({ date: e, onValue: t, position: n, max: r, min: d, className: f, onOpen: g }) => {
|
|
183
|
+
let [_] = s.useState(() => a());
|
|
184
|
+
s.useEffect(() => () => o(_), [_]);
|
|
185
|
+
let v = /* @__PURE__ */ new Date(), y = new Date(e);
|
|
186
|
+
Number.isNaN(y.getTime()) && (y = /* @__PURE__ */ new Date());
|
|
187
|
+
let b = {
|
|
188
|
+
y: v.getFullYear(),
|
|
189
|
+
d: v.getDate(),
|
|
190
|
+
m: v.getMonth() + 1
|
|
191
|
+
}, x = {
|
|
192
|
+
y: y.getFullYear(),
|
|
193
|
+
d: y.getDate(),
|
|
194
|
+
m: y.getMonth() + 1
|
|
195
|
+
}, [S, T] = s.useState({
|
|
196
|
+
y: x.y,
|
|
197
|
+
m: x.m
|
|
198
|
+
}), [E, D] = s.useState("days"), [O, k] = s.useState(() => h(x.y - 5, d, r)), A = (e) => {
|
|
196
199
|
let t = e.getDay();
|
|
197
200
|
return t === 0 && (t = 7), t - 1;
|
|
198
|
-
},
|
|
201
|
+
}, j = [
|
|
199
202
|
"пн",
|
|
200
203
|
"вт",
|
|
201
204
|
"ср",
|
|
@@ -203,146 +206,148 @@ var y = ({ date: e, onValue: t, position: n, max: r, min: l, className: u, onOpe
|
|
|
203
206
|
"пт",
|
|
204
207
|
"сб",
|
|
205
208
|
"вс"
|
|
206
|
-
],
|
|
207
|
-
for (let e = 0; e <
|
|
208
|
-
for (;
|
|
209
|
-
let
|
|
210
|
-
|
|
211
|
-
}, N = () => {
|
|
212
|
-
V(y.m + 1, y.y);
|
|
213
|
-
}, P = () => {
|
|
214
|
-
V(y.m - 1, y.y);
|
|
215
|
-
}, F = () => {
|
|
216
|
-
C === "days" ? P() : C === "months" ? V(y.m, y.y - 1) : E((e) => p(e - 12, l, r));
|
|
209
|
+
], M = S.m - 1, N = new Date(S.y, M), P = [];
|
|
210
|
+
for (let e = 0; e < A(N); e++) P.push(0);
|
|
211
|
+
for (; N.getMonth() === M;) P.push(N.getDate()), N.setDate(N.getDate() + 1);
|
|
212
|
+
let F = () => {
|
|
213
|
+
g(!1);
|
|
217
214
|
}, I = () => {
|
|
218
|
-
|
|
219
|
-
}, L = (
|
|
220
|
-
|
|
221
|
-
}, R = (
|
|
222
|
-
|
|
223
|
-
|
|
215
|
+
W(S.m + 1, S.y);
|
|
216
|
+
}, L = () => {
|
|
217
|
+
W(S.m - 1, S.y);
|
|
218
|
+
}, R = () => {
|
|
219
|
+
E === "days" ? L() : E === "months" ? W(S.m, S.y - 1) : k((e) => h(e - 12, d, r));
|
|
220
|
+
}, z = () => {
|
|
221
|
+
E === "days" ? I() : E === "months" ? W(S.m, S.y + 1) : k((e) => h(e + 12, d, r));
|
|
222
|
+
}, B = (e) => {
|
|
223
|
+
e.stopPropagation(), k(h(S.y - 5, d, r)), D("years");
|
|
224
|
+
}, V = (e) => {
|
|
225
|
+
p(S.y, e, d, r) && (T({
|
|
226
|
+
y: S.y,
|
|
224
227
|
m: e
|
|
225
|
-
}),
|
|
226
|
-
},
|
|
227
|
-
|
|
228
|
+
}), D("days"));
|
|
229
|
+
}, H = (e) => {
|
|
230
|
+
m(e, d, r) && (T({
|
|
228
231
|
y: e,
|
|
229
|
-
m:
|
|
230
|
-
}),
|
|
231
|
-
},
|
|
232
|
-
t(
|
|
233
|
-
},
|
|
234
|
-
t = e > 12 ? t + 1 : e < 1 ? t - 1 : t, e = e > 12 ? 1 : e < 1 ? 12 : e,
|
|
232
|
+
m: S.m
|
|
233
|
+
}), D("days"));
|
|
234
|
+
}, U = (e) => {
|
|
235
|
+
t(S.y + "-" + w(2, S.m) + "-" + w(2, e)), F();
|
|
236
|
+
}, W = (e, t) => {
|
|
237
|
+
t = e > 12 ? t + 1 : e < 1 ? t - 1 : t, e = e > 12 ? 1 : e < 1 ? 12 : e, T({
|
|
235
238
|
y: t,
|
|
236
239
|
m: e
|
|
237
240
|
});
|
|
238
|
-
},
|
|
241
|
+
}, G = (e) => b.y === S.y && b.m === S.m && b.d === e ? { "data-active": "true" } : {}, K = (e) => x.y === S.y && x.m === S.m && x.d === e ? { "data-current": "true" } : {}, q = (e) => {
|
|
239
242
|
let t = !0;
|
|
240
|
-
return r && r.getTime() < new Date(
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
let
|
|
244
|
-
return
|
|
243
|
+
return r && r.getTime() < new Date(S.y, S.m - 1, e).getTime() && (t = !1), d && d.getTime() > new Date(S.y, S.m - 1, e).getTime() && (t = !1), t;
|
|
244
|
+
}, J = window.innerHeight - n.b < 360 ? Math.max(8, n.y - 360) : n.b;
|
|
245
|
+
J = Math.min(J, window.innerHeight - 360 - 8), J = Math.max(8, J);
|
|
246
|
+
let Y = window.innerWidth - n.x < 270 ? n.x - 246 : n.x;
|
|
247
|
+
return Y = Math.max(8, Math.min(Y, window.innerWidth - 270 - 8)), /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", {
|
|
245
248
|
className: i.o,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
+
style: { zIndex: _ },
|
|
250
|
+
onClick: () => F()
|
|
251
|
+
}), /* @__PURE__ */ u("div", {
|
|
252
|
+
className: [i.c, f && f + "-backdrop"].join(" "),
|
|
249
253
|
style: {
|
|
250
|
-
top:
|
|
251
|
-
left:
|
|
254
|
+
top: J + "px",
|
|
255
|
+
left: Y + "px",
|
|
256
|
+
zIndex: _ + 1
|
|
252
257
|
},
|
|
253
258
|
onClick: (e) => e.stopPropagation(),
|
|
254
259
|
children: [
|
|
255
|
-
/* @__PURE__ */
|
|
256
|
-
/* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ u("s", { children: [
|
|
261
|
+
/* @__PURE__ */ l("i", {
|
|
257
262
|
onClick: (e) => {
|
|
258
|
-
e.stopPropagation(),
|
|
263
|
+
e.stopPropagation(), R();
|
|
259
264
|
},
|
|
260
|
-
children: /* @__PURE__ */
|
|
265
|
+
children: /* @__PURE__ */ l("svg", {
|
|
261
266
|
width: "16",
|
|
262
267
|
height: "16",
|
|
263
268
|
fill: "currentColor",
|
|
264
269
|
viewBox: "0 0 24 24",
|
|
265
270
|
xmlns: "http://www.w3.org/2000/svg",
|
|
266
|
-
children: /* @__PURE__ */
|
|
271
|
+
children: /* @__PURE__ */ l("path", { d: "m15.09 4.594-7.646 6.553a1.126 1.126 0 0 0 0 1.708l7.647 6.552c.73.625 1.857.107 1.857-.854V5.447c0-.961-1.127-1.48-1.857-.853Z" })
|
|
267
272
|
})
|
|
268
273
|
}),
|
|
269
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ u("h2", { children: [/* @__PURE__ */ l("span", {
|
|
270
275
|
className: i.dateHeaderMonth,
|
|
271
276
|
onClick: (e) => {
|
|
272
|
-
e.stopPropagation(),
|
|
277
|
+
e.stopPropagation(), D(E === "years" ? "months" : E === "months" ? "days" : "months");
|
|
273
278
|
},
|
|
274
|
-
title:
|
|
275
|
-
children:
|
|
276
|
-
}), /* @__PURE__ */
|
|
279
|
+
title: E === "years" ? "К списку месяцев" : E === "months" ? "К календарю" : "Выбрать месяц",
|
|
280
|
+
children: C(S.m).name
|
|
281
|
+
}), /* @__PURE__ */ l("span", {
|
|
277
282
|
className: i.dateHeaderYear,
|
|
278
283
|
onClick: (e) => {
|
|
279
|
-
e.stopPropagation(),
|
|
284
|
+
e.stopPropagation(), E === "years" ? D("days") : B(e);
|
|
280
285
|
},
|
|
281
|
-
title:
|
|
282
|
-
children:
|
|
286
|
+
title: E === "years" ? "К календарю" : "Выбрать год",
|
|
287
|
+
children: S.y
|
|
283
288
|
})] }),
|
|
284
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ l("i", {
|
|
285
290
|
onClick: (e) => {
|
|
286
|
-
e.stopPropagation(),
|
|
291
|
+
e.stopPropagation(), z();
|
|
287
292
|
},
|
|
288
|
-
children: /* @__PURE__ */
|
|
293
|
+
children: /* @__PURE__ */ l("svg", {
|
|
289
294
|
width: "16",
|
|
290
295
|
height: "16",
|
|
291
296
|
fill: "currentColor",
|
|
292
297
|
viewBox: "0 0 24 24",
|
|
293
298
|
xmlns: "http://www.w3.org/2000/svg",
|
|
294
|
-
children: /* @__PURE__ */
|
|
299
|
+
children: /* @__PURE__ */ l("path", { d: "m8.91 19.406 7.646-6.552a1.125 1.125 0 0 0 0-1.709L8.91 4.593c-.73-.625-1.857-.107-1.857.854v13.107c0 .96 1.127 1.479 1.857.852Z" })
|
|
295
300
|
})
|
|
296
301
|
})
|
|
297
302
|
] }),
|
|
298
|
-
|
|
303
|
+
E === "days" && /* @__PURE__ */ u("div", {
|
|
299
304
|
"grid-calendar": "",
|
|
300
|
-
children: [
|
|
301
|
-
...
|
|
302
|
-
...
|
|
303
|
-
onClick: () =>
|
|
305
|
+
children: [j.map((e, t) => /* @__PURE__ */ l("p", { children: e }, "v" + t)), P.map((e, t) => /* @__PURE__ */ l("span", { children: e !== 0 && q(e) ? /* @__PURE__ */ l("b", {
|
|
306
|
+
...G(e),
|
|
307
|
+
...K(e),
|
|
308
|
+
onClick: () => U(e),
|
|
304
309
|
children: e
|
|
305
|
-
}) : /* @__PURE__ */
|
|
306
|
-
...
|
|
307
|
-
...
|
|
310
|
+
}) : /* @__PURE__ */ l("p", {
|
|
311
|
+
...G(e),
|
|
312
|
+
...K(e),
|
|
308
313
|
children: e === 0 ? "" : e
|
|
309
314
|
}) }, t))]
|
|
310
315
|
}),
|
|
311
|
-
|
|
316
|
+
E === "months" && /* @__PURE__ */ l("div", {
|
|
312
317
|
"grid-month": "",
|
|
313
318
|
children: Array.from({ length: 12 }, (e, t) => {
|
|
314
|
-
let n = t + 1, a =
|
|
315
|
-
return /* @__PURE__ */
|
|
319
|
+
let n = t + 1, a = p(S.y, n, d, r), o = b.y === S.y && b.m === n ? { "data-active": "true" } : {}, s = x.y === S.y && x.m === n ? { "data-current": "true" } : {};
|
|
320
|
+
return /* @__PURE__ */ l("b", {
|
|
316
321
|
className: a ? "" : i.dateHeaderDisabled,
|
|
317
322
|
...o,
|
|
318
|
-
...
|
|
319
|
-
onClick: () => a &&
|
|
320
|
-
children:
|
|
323
|
+
...s,
|
|
324
|
+
onClick: () => a && V(n),
|
|
325
|
+
children: C(n).abc
|
|
321
326
|
}, n);
|
|
322
327
|
})
|
|
323
328
|
}),
|
|
324
|
-
|
|
329
|
+
E === "years" && /* @__PURE__ */ l("div", {
|
|
325
330
|
"grid-month": "",
|
|
326
331
|
children: Array.from({ length: 12 }, (e, t) => {
|
|
327
|
-
let n =
|
|
328
|
-
return /* @__PURE__ */
|
|
332
|
+
let n = O + t, a = m(n, d, r), o = b.y === n ? { "data-active": "true" } : {}, s = x.y === n ? { "data-current": "true" } : {};
|
|
333
|
+
return /* @__PURE__ */ l("b", {
|
|
329
334
|
className: a ? "" : i.dateHeaderDisabled,
|
|
330
335
|
...o,
|
|
331
|
-
...
|
|
332
|
-
onClick: () => a &&
|
|
336
|
+
...s,
|
|
337
|
+
onClick: () => a && H(n),
|
|
333
338
|
children: n
|
|
334
339
|
}, n);
|
|
335
340
|
})
|
|
336
341
|
})
|
|
337
342
|
]
|
|
338
343
|
})] });
|
|
339
|
-
},
|
|
344
|
+
}, S = {
|
|
340
345
|
val: "01",
|
|
341
346
|
name: "—",
|
|
342
347
|
names: "—",
|
|
343
348
|
abc: "—"
|
|
344
349
|
};
|
|
345
|
-
function
|
|
350
|
+
function C(e) {
|
|
346
351
|
let t = typeof e == "number" ? e : new Date(e).getMonth() + 1;
|
|
347
352
|
return (!Number.isFinite(t) || t < 1 || t > 12) && (t = (/* @__PURE__ */ new Date()).getMonth() + 1), {
|
|
348
353
|
1: {
|
|
@@ -417,14 +422,14 @@ function x(e) {
|
|
|
417
422
|
names: "Декабря",
|
|
418
423
|
abc: "Дек"
|
|
419
424
|
}
|
|
420
|
-
}[t] ??
|
|
425
|
+
}[t] ?? S;
|
|
421
426
|
}
|
|
422
|
-
function
|
|
427
|
+
function w(e, t) {
|
|
423
428
|
let n = t + "";
|
|
424
429
|
for (; n.length < e;) n = "0" + n;
|
|
425
430
|
return n;
|
|
426
431
|
}
|
|
427
|
-
function
|
|
432
|
+
function T(e, t) {
|
|
428
433
|
let n, r;
|
|
429
434
|
t === void 0 ? (r = String(e), n = /* @__PURE__ */ new Date()) : (r = t, n = new Date(e)), Number.isNaN(n.getTime()) && (n = /* @__PURE__ */ new Date());
|
|
430
435
|
let i = r, a = {
|
|
@@ -442,4 +447,4 @@ function C(e, t) {
|
|
|
442
447
|
return i;
|
|
443
448
|
}
|
|
444
449
|
//#endregion
|
|
445
|
-
export {
|
|
450
|
+
export { b as default };
|
package/dist/fields/Password.js
CHANGED
|
@@ -9,8 +9,8 @@ import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
|
9
9
|
function c() {
|
|
10
10
|
return /* @__PURE__ */ s("svg", {
|
|
11
11
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
-
width: "
|
|
13
|
-
height: "
|
|
12
|
+
width: "20",
|
|
13
|
+
height: "20",
|
|
14
14
|
viewBox: "0 0 24 24",
|
|
15
15
|
fill: "none",
|
|
16
16
|
stroke: "currentColor",
|
|
@@ -28,8 +28,8 @@ function c() {
|
|
|
28
28
|
function l() {
|
|
29
29
|
return /* @__PURE__ */ s("svg", {
|
|
30
30
|
xmlns: "http://www.w3.org/2000/svg",
|
|
31
|
-
width: "
|
|
32
|
-
height: "
|
|
31
|
+
width: "20",
|
|
32
|
+
height: "20",
|
|
33
33
|
viewBox: "0 0 24 24",
|
|
34
34
|
fill: "none",
|
|
35
35
|
stroke: "currentColor",
|
|
@@ -123,24 +123,12 @@ function u({ value: u, form: d, onValue: f, name: p = "", placeholder: m = "", l
|
|
|
123
123
|
}),
|
|
124
124
|
/* @__PURE__ */ o("button", {
|
|
125
125
|
type: "button",
|
|
126
|
+
className: e.affix,
|
|
126
127
|
tabIndex: v ? -1 : 0,
|
|
127
128
|
"aria-label": D ? "Скрыть пароль" : "Показать пароль",
|
|
128
129
|
"aria-pressed": D,
|
|
129
130
|
disabled: v,
|
|
130
131
|
onClick: () => !v && O(!D),
|
|
131
|
-
style: {
|
|
132
|
-
cursor: v ? "not-allowed" : "pointer",
|
|
133
|
-
alignSelf: "center",
|
|
134
|
-
display: "inline-flex",
|
|
135
|
-
alignItems: "center",
|
|
136
|
-
justifyContent: "center",
|
|
137
|
-
padding: 0,
|
|
138
|
-
margin: 0,
|
|
139
|
-
border: "none",
|
|
140
|
-
background: "transparent",
|
|
141
|
-
color: "var(--field-icon-color, var(--field-placeholder))",
|
|
142
|
-
font: "inherit"
|
|
143
|
-
},
|
|
144
132
|
children: D ? L : I
|
|
145
133
|
}),
|
|
146
134
|
x ? /* @__PURE__ */ o("span", {
|