@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.
@@ -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 "react";
7
- import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
8
- import { createPortal as l } from "react-dom";
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 u(e) {
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 d(e, t, n, r) {
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 f(e, t, n) {
18
+ function m(e, t, n) {
18
19
  return !(t && e < t.getFullYear() || n && e > n.getFullYear());
19
20
  }
20
- function p(e, t, n) {
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 m(e) {
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 h(e) {
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 g(e, t, n) {
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 _(e) {
56
- return e.getFullYear() + "-" + S(2, e.getMonth() + 1) + "-" + S(2, e.getDate());
56
+ function y(e) {
57
+ return e.getFullYear() + "-" + w(2, e.getMonth() + 1) + "-" + w(2, e.getDate());
57
58
  }
58
- function v({ label: i = "", error: d, hidden: f = !1, className: p, placeholder: v, disabled: b = !1, onValue: x, max: S, min: w, form: T, icon: E, name: D = "", value: O, after: k = "", before: A = "" }) {
59
- let j = a.useCallback((e) => {
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(T, D, O), [N, P] = a.useState(j(M)), F = a.useRef(null), [I, L] = a.useState(null), [R, z] = a.useState(!1), B = a.useCallback(() => {
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
- a.useEffect(() => {
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]), a.useEffect(() => {
87
+ }, [R, B]), s.useEffect(() => {
87
88
  P(j(M));
88
89
  }, [M, j]);
89
- let V = a.useCallback((e) => {
90
+ let V = s.useCallback((e) => {
90
91
  let t = {
91
92
  value: e,
92
93
  name: D
93
94
  };
94
- P(e), T && D && T.setValue(t), x && x !== T?.onValue && x(t);
95
+ P(e), w && D && w.setValue(t), b && b !== w?.onValue && b(t);
95
96
  }, [
96
- T,
97
+ w,
97
98
  D,
98
- x
99
+ b
99
100
  ]);
100
- a.useEffect(() => {
101
- if (!R || b) return;
101
+ s.useEffect(() => {
102
+ if (!R || h) return;
102
103
  let e = "", t = (t) => {
103
- let n = h(t);
104
+ let n = _(t);
104
105
  if (!n) return !1;
105
- let r = _(g(n, w, S));
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
- m(e.target) || t(e.clipboardData?.getData("text/plain") ?? "") && (e.preventDefault(), e.stopPropagation());
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" || m(e.target) || navigator.clipboard?.readText && (e.preventDefault(), navigator.clipboard.readText().then((e) => {
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
- b,
120
- w,
120
+ h,
121
+ C,
121
122
  S,
122
123
  V
123
124
  ]);
124
125
  let H = (e) => {
125
- if (b) return;
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
- v && (U.placeholder = v);
134
+ m && (U.placeholder = m);
134
135
  let W = M == null || M === "" || typeof M == "string" && r(M);
135
- return f && W ? /* @__PURE__ */ s(o, {}) : /* @__PURE__ */ c(o, { children: [E ? E() : /* @__PURE__ */ c(t, {
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: d,
139
+ error: a,
139
140
  element_blok: { className: [p || ""] },
140
141
  element_input: {
141
142
  className: [e.w],
142
- props: { "data-disabled": b ? "true" : void 0 }
143
+ props: { "data-disabled": h ? "true" : void 0 }
143
144
  },
144
145
  children: [
145
- A ? /* @__PURE__ */ s("span", {
146
+ A ? /* @__PURE__ */ l("span", {
146
147
  className: e.affix,
147
148
  children: A
148
149
  }) : null,
149
- /* @__PURE__ */ s("div", {
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: b ? -1 : 0,
156
+ tabIndex: h ? -1 : 0,
156
157
  role: "button",
157
158
  "aria-haspopup": "dialog",
158
159
  "aria-expanded": R,
159
- "aria-label": i || v || "Дата",
160
- "data-edit": b ? void 0 : "true",
160
+ "aria-label": i || m || "Дата",
161
+ "data-edit": h ? void 0 : "true",
161
162
  ...U,
162
- style: { cursor: b ? "not-allowed" : "pointer" },
163
- children: u(N) ? "" : C(N, "dd.mm.yyyy")
163
+ style: { cursor: h ? "not-allowed" : "pointer" },
164
+ children: f(N) ? "" : T(N, "dd.mm.yyyy")
164
165
  }),
165
- k ? /* @__PURE__ */ s("span", {
166
+ k ? /* @__PURE__ */ l("span", {
166
167
  className: e.affix,
167
168
  children: k
168
169
  }) : null
169
170
  ]
170
- }), R && I && l(/* @__PURE__ */ s(y, {
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: w,
176
+ min: C,
176
177
  onOpen: z,
177
178
  className: p
178
179
  }, "elcrm-date-popup"), document.body)] });
179
180
  }
180
- v.displayName = "DateField";
181
- var y = ({ date: e, onValue: t, position: n, max: r, min: l, className: u, onOpen: m }) => {
182
- let h = /* @__PURE__ */ new Date(), g = new Date(e);
183
- Number.isNaN(g.getTime()) && (g = /* @__PURE__ */ new Date());
184
- let _ = {
185
- y: h.getFullYear(),
186
- d: h.getDate(),
187
- m: h.getMonth() + 1
188
- }, v = {
189
- y: g.getFullYear(),
190
- d: g.getDate(),
191
- m: g.getMonth() + 1
192
- }, [y, b] = a.useState({
193
- y: v.y,
194
- m: v.m
195
- }), [C, w] = a.useState("days"), [T, E] = a.useState(() => p(v.y - 5, l, r)), D = (e) => {
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
- }, O = [
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
- ], k = y.m - 1, A = new Date(y.y, k), j = [];
207
- for (let e = 0; e < D(A); e++) j.push(0);
208
- for (; A.getMonth() === k;) j.push(A.getDate()), A.setDate(A.getDate() + 1);
209
- let M = () => {
210
- m(!1);
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
- C === "days" ? N() : C === "months" ? V(y.m, y.y + 1) : E((e) => p(e + 12, l, r));
219
- }, L = (e) => {
220
- e.stopPropagation(), E(p(y.y - 5, l, r)), w("years");
221
- }, R = (e) => {
222
- d(y.y, e, l, r) && (b({
223
- y: y.y,
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
- }), w("days"));
226
- }, z = (e) => {
227
- f(e, l, r) && (b({
228
+ }), D("days"));
229
+ }, H = (e) => {
230
+ m(e, d, r) && (T({
228
231
  y: e,
229
- m: y.m
230
- }), w("days"));
231
- }, B = (e) => {
232
- t(y.y + "-" + S(2, y.m) + "-" + S(2, e)), M();
233
- }, V = (e, t) => {
234
- t = e > 12 ? t + 1 : e < 1 ? t - 1 : t, e = e > 12 ? 1 : e < 1 ? 12 : e, b({
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
- }, H = (e) => _.y === y.y && _.m === y.m && _.d === e ? { "data-active": "true" } : {}, U = (e) => v.y === y.y && v.m === y.m && v.d === e ? { "data-current": "true" } : {}, W = (e) => {
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(y.y, y.m - 1, e).getTime() && (t = !1), l && l.getTime() > new Date(y.y, y.m - 1, e).getTime() && (t = !1), t;
241
- }, G = window.innerHeight - n.b < 360 ? Math.max(8, n.y - 360) : n.b;
242
- G = Math.min(G, window.innerHeight - 360 - 8), G = Math.max(8, G);
243
- let K = window.innerWidth - n.x < 270 ? n.x - 246 : n.x;
244
- return K = Math.max(8, Math.min(K, window.innerWidth - 270 - 8)), /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("div", {
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
- onClick: () => M()
247
- }), /* @__PURE__ */ c("div", {
248
- className: [i.c, u && u + "-backdrop"].join(" "),
249
+ style: { zIndex: _ },
250
+ onClick: () => F()
251
+ }), /* @__PURE__ */ u("div", {
252
+ className: [i.c, f && f + "-backdrop"].join(" "),
249
253
  style: {
250
- top: G + "px",
251
- left: K + "px"
254
+ top: J + "px",
255
+ left: Y + "px",
256
+ zIndex: _ + 1
252
257
  },
253
258
  onClick: (e) => e.stopPropagation(),
254
259
  children: [
255
- /* @__PURE__ */ c("s", { children: [
256
- /* @__PURE__ */ s("i", {
260
+ /* @__PURE__ */ u("s", { children: [
261
+ /* @__PURE__ */ l("i", {
257
262
  onClick: (e) => {
258
- e.stopPropagation(), F();
263
+ e.stopPropagation(), R();
259
264
  },
260
- children: /* @__PURE__ */ s("svg", {
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__ */ s("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" })
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__ */ c("h2", { children: [/* @__PURE__ */ s("span", {
274
+ /* @__PURE__ */ u("h2", { children: [/* @__PURE__ */ l("span", {
270
275
  className: i.dateHeaderMonth,
271
276
  onClick: (e) => {
272
- e.stopPropagation(), w(C === "years" ? "months" : C === "months" ? "days" : "months");
277
+ e.stopPropagation(), D(E === "years" ? "months" : E === "months" ? "days" : "months");
273
278
  },
274
- title: C === "years" ? "К списку месяцев" : C === "months" ? "К календарю" : "Выбрать месяц",
275
- children: x(y.m).name
276
- }), /* @__PURE__ */ s("span", {
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(), C === "years" ? w("days") : L(e);
284
+ e.stopPropagation(), E === "years" ? D("days") : B(e);
280
285
  },
281
- title: C === "years" ? "К календарю" : "Выбрать год",
282
- children: y.y
286
+ title: E === "years" ? "К календарю" : "Выбрать год",
287
+ children: S.y
283
288
  })] }),
284
- /* @__PURE__ */ s("i", {
289
+ /* @__PURE__ */ l("i", {
285
290
  onClick: (e) => {
286
- e.stopPropagation(), I();
291
+ e.stopPropagation(), z();
287
292
  },
288
- children: /* @__PURE__ */ s("svg", {
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__ */ s("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" })
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
- C === "days" && /* @__PURE__ */ c("div", {
303
+ E === "days" && /* @__PURE__ */ u("div", {
299
304
  "grid-calendar": "",
300
- children: [O.map((e, t) => /* @__PURE__ */ s("p", { children: e }, "v" + t)), j.map((e, t) => /* @__PURE__ */ s("span", { children: e !== 0 && W(e) ? /* @__PURE__ */ s("b", {
301
- ...H(e),
302
- ...U(e),
303
- onClick: () => B(e),
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__ */ s("p", {
306
- ...H(e),
307
- ...U(e),
310
+ }) : /* @__PURE__ */ l("p", {
311
+ ...G(e),
312
+ ...K(e),
308
313
  children: e === 0 ? "" : e
309
314
  }) }, t))]
310
315
  }),
311
- C === "months" && /* @__PURE__ */ s("div", {
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 = d(y.y, n, l, r), o = _.y === y.y && _.m === n ? { "data-active": "true" } : {}, c = v.y === y.y && v.m === n ? { "data-current": "true" } : {};
315
- return /* @__PURE__ */ s("b", {
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
- ...c,
319
- onClick: () => a && R(n),
320
- children: x(n).abc
323
+ ...s,
324
+ onClick: () => a && V(n),
325
+ children: C(n).abc
321
326
  }, n);
322
327
  })
323
328
  }),
324
- C === "years" && /* @__PURE__ */ s("div", {
329
+ E === "years" && /* @__PURE__ */ l("div", {
325
330
  "grid-month": "",
326
331
  children: Array.from({ length: 12 }, (e, t) => {
327
- let n = T + t, a = f(n, l, r), o = _.y === n ? { "data-active": "true" } : {}, c = v.y === n ? { "data-current": "true" } : {};
328
- return /* @__PURE__ */ s("b", {
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
- ...c,
332
- onClick: () => a && z(n),
336
+ ...s,
337
+ onClick: () => a && H(n),
333
338
  children: n
334
339
  }, n);
335
340
  })
336
341
  })
337
342
  ]
338
343
  })] });
339
- }, b = {
344
+ }, S = {
340
345
  val: "01",
341
346
  name: "—",
342
347
  names: "—",
343
348
  abc: "—"
344
349
  };
345
- function x(e) {
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] ?? b;
425
+ }[t] ?? S;
421
426
  }
422
- function S(e, t) {
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 C(e, t) {
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 { v as default };
450
+ export { b as default };
@@ -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: "1.25em",
13
- height: "1.25em",
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: "1.25em",
32
- height: "1.25em",
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", {