@memobit/libs 3.8.1 → 3.8.2

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.
@@ -1,10 +1,10 @@
1
1
  import './Calendar.css';
2
- import { Tooltip as f } from "../Tooltip/Tooltip2.js";
3
- import { addMonths as H, getMonthMatrix as ue, isAfter as _e, isBefore as x, isSameDay as _, isToday as he, isWeekend as me } from "../../helpers/Datetime.js";
2
+ import { Tooltip as _ } from "../Tooltip/Tooltip2.js";
3
+ import { addMonths as H, formatDate as ue, getMonthMatrix as _e, isAfter as he, isBefore as A, isSameDay as h, isToday as me, isWeekend as fe } from "../../helpers/Datetime.js";
4
4
  /* empty css */
5
- import { useMemo as fe, useState as M } from "react";
6
- import { Fragment as V, jsx as n, jsxs as h } from "react/jsx-runtime";
7
- var d = 12, T = [
5
+ import { useMemo as ye, useState as M } from "react";
6
+ import { Fragment as V, jsx as n, jsxs as m } from "react/jsx-runtime";
7
+ var d = 12, S = [
8
8
  "January",
9
9
  "February",
10
10
  "March",
@@ -17,7 +17,7 @@ var d = 12, T = [
17
17
  "October",
18
18
  "November",
19
19
  "December"
20
- ], ye = [
20
+ ], ge = [
21
21
  "Sun",
22
22
  "Mon",
23
23
  "Tue",
@@ -25,7 +25,7 @@ var d = 12, T = [
25
25
  "Thu",
26
26
  "Fri",
27
27
  "Sat"
28
- ], ge = [
28
+ ], be = [
29
29
  "Mon",
30
30
  "Tue",
31
31
  "Wed",
@@ -33,7 +33,7 @@ var d = 12, T = [
33
33
  "Fri",
34
34
  "Sat",
35
35
  "Sun"
36
- ], Fe = ({ value: r, onChange: m, mode: i = "single", minDate: A, maxDate: v, disabledDates: p, firstDayOfWeek: D = 0, showToday: j = !0, yearOnly: I = !1, className: G = "", currentMonth: R, onMonthChange: c, showHeader: F = !0, rangeStart: J, onRangeStartChange: Y }) => {
36
+ ], we = ({ value: r, onChange: f, mode: i = "single", minDate: T, maxDate: v, disabledDates: p, firstDayOfWeek: D = 0, showToday: j = !0, yearOnly: R = !1, className: G = "", currentMonth: I, onMonthChange: c, showHeader: F = !0, rangeStart: J, onRangeStartChange: Y }) => {
37
37
  const [P, u] = M(() => {
38
38
  if (r) {
39
39
  if (r instanceof Date) return new Date(r.getFullYear(), r.getMonth(), 1);
@@ -41,17 +41,17 @@ var d = 12, T = [
41
41
  if (Array.isArray(r) && r.length > 0) return new Date(r[0].getFullYear(), r[0].getMonth(), 1);
42
42
  }
43
43
  return new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1);
44
- }), [y, g] = M("days"), [b, S] = M(() => {
45
- const e = (R ?? P).getFullYear();
44
+ }), [y, g] = M("days"), [b, k] = M(() => {
45
+ const e = (I ?? P).getFullYear();
46
46
  return Math.floor(e / d) * d;
47
- }), [O, E] = M(null), a = R ?? P, o = J ?? O, B = fe(() => ue(a.getFullYear(), a.getMonth(), D), [a, D]), W = D === 1 ? ge : ye, k = (e) => A && x(e, A) || v && _e(e, v) ? !0 : p ? typeof p == "function" ? p(e) : p.some((t) => _(t, e)) : !1, q = (e) => {
47
+ }), [O, E] = M(null), a = I ?? P, o = J ?? O, B = ye(() => _e(a.getFullYear(), a.getMonth(), D), [a, D]), W = D === 1 ? be : ge, w = (e) => T && A(e, T) || v && he(e, v) ? !0 : p ? typeof p == "function" ? p(e) : p.some((t) => h(t, e)) : !1, q = (e) => {
48
48
  if (!r) return !1;
49
- if (i === "single" && r instanceof Date) return _(e, r);
49
+ if (i === "single" && r instanceof Date) return h(e, r);
50
50
  if (i === "range") {
51
- if (o) return _(e, o);
52
- if (r && "start" in r) return _(e, r.start) || _(e, r.end);
51
+ if (o) return h(e, o);
52
+ if (r && "start" in r) return h(e, r.start) || h(e, r.end);
53
53
  }
54
- return i === "multiple" && Array.isArray(r) ? r.some((t) => _(t, e)) : !1;
54
+ return i === "multiple" && Array.isArray(r) ? r.some((t) => h(t, e)) : !1;
55
55
  }, z = (e) => {
56
56
  if (i === "range" && r && "start" in r) {
57
57
  const { start: t, end: l } = r, s = e.getTime();
@@ -59,24 +59,24 @@ var d = 12, T = [
59
59
  }
60
60
  return !1;
61
61
  }, K = (e) => i === "range" && o ? e.getTime() > o.getTime() : !1, L = (e) => e.getMonth() === a.getMonth(), Q = (e) => {
62
- if (!k(e)) {
63
- if (i === "single") m?.(e);
62
+ if (!w(e)) {
63
+ if (i === "single") f?.(e);
64
64
  else if (i === "range")
65
65
  if (!o)
66
- Y ? Y(e) : (E(e), m?.(void 0));
66
+ Y ? Y(e) : (E(e), f?.(void 0));
67
67
  else {
68
- const t = x(e, o) ? e : o, l = x(e, o) ? o : e;
69
- m?.({
68
+ const t = A(e, o) ? e : o, l = A(e, o) ? o : e;
69
+ f?.({
70
70
  start: t,
71
71
  end: l
72
72
  }), Y ? Y(null) : E(null);
73
73
  }
74
74
  else if (i === "multiple") {
75
- const t = Array.isArray(r) ? r : [], l = t.findIndex((s) => _(s, e));
75
+ const t = Array.isArray(r) ? r : [], l = t.findIndex((s) => h(s, e));
76
76
  if (l >= 0) {
77
- const s = t.filter((w, N) => N !== l);
78
- m?.(s.length > 0 ? s : void 0);
79
- } else m?.([...t, e]);
77
+ const s = t.filter((x, N) => N !== l);
78
+ f?.(s.length > 0 ? s : void 0);
79
+ } else f?.([...t, e]);
80
80
  }
81
81
  }
82
82
  }, U = () => {
@@ -87,11 +87,11 @@ var d = 12, T = [
87
87
  c ? c(e) : u(e);
88
88
  }, Z = () => {
89
89
  const e = /* @__PURE__ */ new Date(), t = new Date(e.getFullYear(), e.getMonth(), 1);
90
- c ? c(t) : u(t), g("days"), i === "single" && m?.(e);
90
+ c ? c(t) : u(t), g("days"), i === "single" && f?.(e);
91
91
  }, C = () => {
92
92
  F && g("months");
93
93
  }, $ = () => {
94
- F && (S(Math.floor(a.getFullYear() / d) * d), g("years"));
94
+ F && (k(Math.floor(a.getFullYear() / d) * d), g("years"));
95
95
  }, ee = (e) => {
96
96
  const t = new Date(a.getFullYear(), e, 1);
97
97
  c ? c(t) : u(t), g("days");
@@ -99,9 +99,9 @@ var d = 12, T = [
99
99
  const t = new Date(e, a.getMonth(), 1);
100
100
  c ? c(t) : u(t), g("months");
101
101
  }, ne = () => {
102
- S(b - d);
102
+ k(b - d);
103
103
  }, re = () => {
104
- S(b + d);
104
+ k(b + d);
105
105
  }, ae = () => {
106
106
  const e = new Date(a.getFullYear() - 1, a.getMonth(), 1);
107
107
  c ? c(e) : u(e);
@@ -114,11 +114,11 @@ var d = 12, T = [
114
114
  return e;
115
115
  }, ce = (e) => {
116
116
  const t = ["calendar__day"];
117
- return L(e) ? (q(e) && t.push("calendar__day--selected"), z(e) && t.push("calendar__day--in-range"), K(e) && t.push("calendar__day--hover-range")) : t.push("calendar__day--other-month"), he(e) && t.push("calendar__day--today"), me(e) && t.push("calendar__day--weekend"), k(e) && t.push("calendar__day--disabled"), t.join(" ");
118
- }, ie = () => y === "years" ? /* @__PURE__ */ h("div", {
117
+ return L(e) ? (q(e) && t.push("calendar__day--selected"), z(e) && t.push("calendar__day--in-range"), K(e) && t.push("calendar__day--hover-range")) : t.push("calendar__day--other-month"), me(e) && t.push("calendar__day--today"), fe(e) && t.push("calendar__day--weekend"), w(e) && t.push("calendar__day--disabled"), t.join(" ");
118
+ }, ie = () => y === "years" ? /* @__PURE__ */ m("div", {
119
119
  className: "calendar__header",
120
120
  children: [
121
- /* @__PURE__ */ n(f, {
121
+ /* @__PURE__ */ n(_, {
122
122
  title: "Previous years",
123
123
  children: /* @__PURE__ */ n("button", {
124
124
  type: "button",
@@ -127,7 +127,7 @@ var d = 12, T = [
127
127
  children: "‹"
128
128
  })
129
129
  }),
130
- /* @__PURE__ */ h("div", {
130
+ /* @__PURE__ */ m("div", {
131
131
  className: "calendar__month-year",
132
132
  children: [
133
133
  b,
@@ -135,7 +135,7 @@ var d = 12, T = [
135
135
  b + d - 1
136
136
  ]
137
137
  }),
138
- /* @__PURE__ */ n(f, {
138
+ /* @__PURE__ */ n(_, {
139
139
  title: "Next years",
140
140
  children: /* @__PURE__ */ n("button", {
141
141
  type: "button",
@@ -145,10 +145,10 @@ var d = 12, T = [
145
145
  })
146
146
  })
147
147
  ]
148
- }) : y === "months" ? /* @__PURE__ */ h("div", {
148
+ }) : y === "months" ? /* @__PURE__ */ m("div", {
149
149
  className: "calendar__header",
150
150
  children: [
151
- /* @__PURE__ */ n(f, {
151
+ /* @__PURE__ */ n(_, {
152
152
  title: "Previous year",
153
153
  children: /* @__PURE__ */ n("button", {
154
154
  type: "button",
@@ -163,7 +163,7 @@ var d = 12, T = [
163
163
  onClick: $,
164
164
  children: a.getFullYear()
165
165
  }),
166
- /* @__PURE__ */ n(f, {
166
+ /* @__PURE__ */ n(_, {
167
167
  title: "Next year",
168
168
  children: /* @__PURE__ */ n("button", {
169
169
  type: "button",
@@ -173,10 +173,10 @@ var d = 12, T = [
173
173
  })
174
174
  })
175
175
  ]
176
- }) : /* @__PURE__ */ h("div", {
176
+ }) : /* @__PURE__ */ m("div", {
177
177
  className: "calendar__header",
178
178
  children: [
179
- /* @__PURE__ */ n(f, {
179
+ /* @__PURE__ */ n(_, {
180
180
  title: "Previous month",
181
181
  children: /* @__PURE__ */ n("button", {
182
182
  type: "button",
@@ -187,14 +187,14 @@ var d = 12, T = [
187
187
  }),
188
188
  /* @__PURE__ */ n("div", {
189
189
  className: "calendar__month-year",
190
- children: I ? /* @__PURE__ */ n("span", {
190
+ children: R ? /* @__PURE__ */ n("span", {
191
191
  className: "calendar__header-label",
192
- children: T[a.getMonth()]
193
- }) : /* @__PURE__ */ h(V, { children: [/* @__PURE__ */ n("button", {
192
+ children: S[a.getMonth()]
193
+ }) : /* @__PURE__ */ m(V, { children: [/* @__PURE__ */ n("button", {
194
194
  type: "button",
195
195
  className: "calendar__header-button",
196
196
  onClick: C,
197
- children: T[a.getMonth()]
197
+ children: S[a.getMonth()]
198
198
  }), /* @__PURE__ */ n("button", {
199
199
  type: "button",
200
200
  className: "calendar__header-button",
@@ -202,7 +202,7 @@ var d = 12, T = [
202
202
  children: a.getFullYear()
203
203
  })] })
204
204
  }),
205
- /* @__PURE__ */ n(f, {
205
+ /* @__PURE__ */ n(_, {
206
206
  title: "Next month",
207
207
  children: /* @__PURE__ */ n("button", {
208
208
  type: "button",
@@ -227,22 +227,22 @@ var d = 12, T = [
227
227
  const e = (/* @__PURE__ */ new Date()).getMonth(), t = (/* @__PURE__ */ new Date()).getFullYear(), l = a.getMonth(), s = a.getFullYear();
228
228
  return /* @__PURE__ */ n("div", {
229
229
  className: "calendar__months-grid",
230
- children: T.map((w, N) => /* @__PURE__ */ n("button", {
230
+ children: S.map((x, N) => /* @__PURE__ */ n("button", {
231
231
  type: "button",
232
232
  className: `calendar__month-item ${N === l && s === a.getFullYear() ? "calendar__month-item--selected" : ""} ${N === e && t === a.getFullYear() ? "calendar__month-item--current" : ""}`,
233
233
  onClick: () => ee(N),
234
- children: w.substring(0, 3)
235
- }, w))
234
+ children: x.substring(0, 3)
235
+ }, x))
236
236
  });
237
237
  };
238
- return /* @__PURE__ */ h("div", {
238
+ return /* @__PURE__ */ m("div", {
239
239
  className: `calendar ${G}`,
240
240
  children: [
241
241
  F && ie(),
242
242
  y === "years" && oe(),
243
243
  y === "months" && de(),
244
- y === "days" && /* @__PURE__ */ h(V, { children: [
245
- j && !I && /* @__PURE__ */ n("div", {
244
+ y === "days" && /* @__PURE__ */ m(V, { children: [
245
+ j && !R && /* @__PURE__ */ n("div", {
246
246
  className: "calendar__today-section",
247
247
  children: /* @__PURE__ */ n("button", {
248
248
  type: "button",
@@ -262,13 +262,15 @@ var d = 12, T = [
262
262
  className: "calendar__days",
263
263
  children: B.map((e, t) => /* @__PURE__ */ n("div", {
264
264
  className: "calendar__week",
265
- children: e.map((l, s) => /* @__PURE__ */ n("button", {
266
- type: "button",
267
- className: ce(l),
268
- onClick: () => Q(l),
269
- disabled: k(l),
270
- title: l.toDateString(),
271
- children: l.getDate()
265
+ children: e.map((l, s) => /* @__PURE__ */ n(_, {
266
+ title: ue(l, "DD MMM YYYY"),
267
+ children: /* @__PURE__ */ n("button", {
268
+ type: "button",
269
+ className: ce(l),
270
+ onClick: () => Q(l),
271
+ disabled: w(l),
272
+ children: l.getDate()
273
+ })
272
274
  }, s))
273
275
  }, t))
274
276
  })
@@ -277,5 +279,5 @@ var d = 12, T = [
277
279
  });
278
280
  };
279
281
  export {
280
- Fe as Calendar
282
+ we as Calendar
281
283
  };
@@ -1 +1 @@
1
- :root{--radius-sm:4px;--radius:8px;--radius-full:9999px;--checkbox-size:18px;--radio-size:18px;--body-background-glow:none;--spacing-1:1px;--spacing-2:2px;--spacing-4:4px;--spacing-6:6px;--spacing-8:8px;--spacing-12:12px;--spacing-16:16px;--spacing-20:20px;--spacing-24:24px;--spacing-32:32px;--spacing-40:40px;--spacing-48:48px;--spacing-60:60px;--spacing-64:64px;--spacing-80:80px;--spacing-100:100px;--spacing-200:200px;--spacing-300:300px;--spacing-400:400px;--font-size-xxs:.625rem;--font-size-xs:.75rem;--font-size-sm:.875rem;--font-size-md:1rem;--font-size-lg:1.25rem;--font-size-xl:1.5rem;--font-size-xxl:2rem;--font-size-xxxl:3rem;--font-family-display:var(--font-family,sans-serif);--font-family-mono:ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;--form-control-font-family:var(--font-family,sans-serif);--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--line-height-none:1;--line-height-tight:1.2;--line-height-normal:1.5;--line-height-loose:1.8;--duration-hover:.2s;--duration-fade:.3s;--duration-slide:.4s;--transition-fast:.15s ease-in-out;--transition-moderate:.3s ease-in-out;--transition-slow:.5s ease-in-out}.datepicker{width:100%;max-width:300px;display:inline-block;position:relative}.datepicker__input{background-color:var(--form-control-background-color);border:var(--spacing-1) solid var(--form-control-border-color);border-radius:var(--radius-sm);color:var(--form-control-color);cursor:pointer;justify-content:space-between;align-items:center;gap:var(--spacing-8);padding:var(--spacing-12);font-size:var(--font-size-sm);line-height:var(--line-height-normal);box-sizing:border-box;transition:border-color .2s,background-color .2s;display:flex}.datepicker__input:hover:not(.datepicker__input--disabled){border-color:var(--form-control-focus-border-color)}.datepicker__input--open{border-color:var(--form-control-focus-border-color);background-color:var(--form-control-focus-background-color)}.datepicker__input--disabled{opacity:.5;cursor:not-allowed}.datepicker__value{font-size:inherit;white-space:nowrap;text-overflow:ellipsis;flex:1;overflow:hidden}.datepicker__value--placeholder{color:var(--form-control-placeholder-color)}.datepicker__actions{align-items:center;gap:var(--spacing-4);display:flex}.datepicker__clear{color:var(--form-control-placeholder-color);cursor:pointer;font-size:var(--font-size-md);background:0 0;border:none;padding:0;line-height:1;transition:color .2s}.datepicker__clear:hover{color:var(--form-control-color)}.datepicker__icon{font-size:var(--font-size-md);line-height:1}.datepicker__dropdown{background-color:var(--calendar-background-color);border:1px solid var(--calendar-border-color);border-radius:var(--radius);padding:var(--spacing-16);box-sizing:border-box;min-width:280px;max-height:calc(100vh - var(--spacing-32));z-index:1100;position:fixed;top:0;left:0;overflow-y:auto;box-shadow:0 4px 12px #00000026}.datepicker__dropdown--inline{margin-top:var(--spacing-12);box-shadow:none;z-index:auto;max-height:none;position:static;overflow:visible}.datepicker__dropdown-close{width:var(--spacing-32);height:var(--spacing-32);margin:calc(var(--spacing-16) * -1) calc(var(--spacing-16) * -1) 0 auto;border-radius:var(--radius-full);color:var(--body-sub-title-color);cursor:pointer;z-index:1;background:0 0;border:none;justify-content:center;align-items:center;transition:color .2s,background-color .2s;display:flex;position:sticky;top:0}.datepicker__dropdown-close:hover{color:var(--body-color);background-color:var(--card-background-accent-color)}.datepicker__time{border-top:1px solid var(--calendar-border-color);margin-top:var(--spacing-16);padding-top:var(--spacing-16)}
1
+ :root{--radius-sm:4px;--radius:8px;--radius-full:9999px;--checkbox-size:18px;--radio-size:18px;--body-background-glow:none;--spacing-1:1px;--spacing-2:2px;--spacing-4:4px;--spacing-6:6px;--spacing-8:8px;--spacing-12:12px;--spacing-16:16px;--spacing-20:20px;--spacing-24:24px;--spacing-32:32px;--spacing-40:40px;--spacing-48:48px;--spacing-60:60px;--spacing-64:64px;--spacing-80:80px;--spacing-100:100px;--spacing-200:200px;--spacing-300:300px;--spacing-400:400px;--font-size-xxs:.625rem;--font-size-xs:.75rem;--font-size-sm:.875rem;--font-size-md:1rem;--font-size-lg:1.25rem;--font-size-xl:1.5rem;--font-size-xxl:2rem;--font-size-xxxl:3rem;--font-family-display:var(--font-family,sans-serif);--font-family-mono:ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;--form-control-font-family:var(--font-family,sans-serif);--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--line-height-none:1;--line-height-tight:1.2;--line-height-normal:1.5;--line-height-loose:1.8;--duration-hover:.2s;--duration-fade:.3s;--duration-slide:.4s;--transition-fast:.15s ease-in-out;--transition-moderate:.3s ease-in-out;--transition-slow:.5s ease-in-out}.datepicker{width:100%;max-width:300px;display:inline-block;position:relative}.datepicker__input{background-color:var(--form-control-background-color);border:var(--spacing-1) solid var(--form-control-border-color);border-radius:var(--radius-sm);color:var(--form-control-color);cursor:pointer;justify-content:space-between;align-items:center;gap:var(--spacing-8);padding:var(--spacing-12);font-size:var(--font-size-sm);line-height:var(--line-height-normal);box-sizing:border-box;transition:border-color .2s,background-color .2s;display:flex}.datepicker__input:hover:not(.datepicker__input--disabled){border-color:var(--form-control-focus-border-color)}.datepicker__input--open{border-color:var(--form-control-focus-border-color);background-color:var(--form-control-focus-background-color)}.datepicker__input--disabled{opacity:.5;cursor:not-allowed}.datepicker__value{font-size:inherit;white-space:nowrap;text-overflow:ellipsis;flex:1;overflow:hidden}.datepicker__value--placeholder{color:var(--form-control-placeholder-color)}.datepicker__actions{align-items:center;gap:var(--spacing-4);display:flex}.datepicker__clear{color:var(--form-control-placeholder-color);cursor:pointer;font-size:var(--font-size-md);background:0 0;border:none;padding:0;line-height:1;transition:color .2s}.datepicker__clear:hover{color:var(--form-control-color)}.datepicker__icon{font-size:var(--font-size-md);line-height:1}.datepicker__dropdown{gap:var(--spacing-12);background-color:var(--calendar-background-color);border:1px solid var(--calendar-border-color);border-radius:var(--radius);padding:var(--spacing-8) var(--spacing-16) var(--spacing-16);box-sizing:border-box;min-width:280px;max-height:calc(100vh - var(--spacing-32));z-index:1100;flex-direction:column;display:flex;position:fixed;top:0;left:0;overflow-y:auto;box-shadow:0 4px 12px #00000026}.datepicker__dropdown>*{flex-shrink:0}.datepicker__dropdown .calendar{background-color:#0000;border:none;border-radius:0;padding:0}.datepicker__dropdown--inline{margin-top:var(--spacing-12);padding-top:var(--spacing-16);box-shadow:none;z-index:auto;max-height:none;position:static;overflow:visible}.datepicker__dropdown-close{width:var(--spacing-32);height:var(--spacing-32);border-radius:var(--radius-full);color:var(--body-sub-title-color);cursor:pointer;z-index:1;background:0 0;border:none;flex-shrink:0;justify-content:center;align-self:flex-end;align-items:center;transition:color .2s,background-color .2s;display:flex;position:sticky;top:0}.datepicker__dropdown-close:hover{color:var(--body-color);background-color:var(--card-background-accent-color)}.datepicker__time{border-top:1px solid var(--calendar-border-color);padding-top:var(--spacing-16)}
@@ -1,22 +1,22 @@
1
1
  import './DatePicker.css';
2
2
  import { Icon as H } from "../Icon/Icon2.js";
3
- import { Tooltip as Y } from "../Tooltip/Tooltip2.js";
3
+ import { Tooltip as E } from "../Tooltip/Tooltip2.js";
4
4
  import { APP_DATE_FORMAT as Z, formatDate as l } from "../../helpers/Datetime.js";
5
5
  import { Calendar as O } from "../Calendar/Calendar2.js";
6
6
  import { TimePicker as ee } from "../TimePicker/TimePicker2.js";
7
7
  /* empty css */
8
- import { useCallback as te, useEffect as x, useRef as E, useState as D } from "react";
9
- import { Fragment as ne, jsx as i, jsxs as h } from "react/jsx-runtime";
8
+ import { useCallback as te, useEffect as x, useRef as L, useState as D } from "react";
9
+ import { Fragment as ne, jsx as r, jsxs as h } from "react/jsx-runtime";
10
10
  import { createPortal as re } from "react-dom";
11
- var me = ({ value: t, onChange: g, mode: s = "single", withTime: f = !1, timeFormat: L = "24h", withSeconds: w = !1, withClock: M = !1, clockSize: P = 208, minuteStep: I = 1, dateFormat: _ = Z, placeholder: z = "Select date...", disabled: b = !1, clearable: F = !0, autoClose: N = !0, alwaysOpen: r = !1, ...C }) => {
12
- const [j, u] = D(!1), [k, S] = D({
11
+ var me = ({ value: t, onChange: g, mode: s = "single", withTime: f = !1, timeFormat: M = "24h", withSeconds: w = !1, withClock: P = !1, clockSize: I = 208, minuteStep: z = 1, dateFormat: _ = Z, placeholder: F = "Select date...", disabled: b = !1, clearable: j = !0, autoClose: N = !0, alwaysOpen: i = !1, ...C }) => {
12
+ const [B, u] = D(!1), [k, S] = D({
13
13
  hours: 0,
14
14
  minutes: 0,
15
15
  seconds: 0
16
- }), [B, p] = D(null), [q, $] = D({
16
+ }), [q, p] = D(null), [y, $] = D({
17
17
  position: "fixed",
18
18
  visibility: "hidden"
19
- }), m = E(null), c = E(null);
19
+ }), m = L(null), c = L(null);
20
20
  x(() => {
21
21
  f && t instanceof Date && S({
22
22
  hours: t.getHours(),
@@ -24,26 +24,26 @@ var me = ({ value: t, onChange: g, mode: s = "single", withTime: f = !1, timeFor
24
24
  seconds: t.getSeconds()
25
25
  });
26
26
  }, [t, f]);
27
- const o = r ? !b : j;
27
+ const o = i ? !b : B;
28
28
  x(() => {
29
- if (r) return;
29
+ if (i) return;
30
30
  const e = (n) => {
31
31
  o && m.current && c.current && !m.current.contains(n.target) && !c.current.contains(n.target) && (p(null), u(!1));
32
32
  };
33
33
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
34
- }, [r, o]);
34
+ }, [i, o]);
35
35
  const a = te(() => {
36
- if (r || !o || !m.current || !c.current) return;
37
- const e = m.current.getBoundingClientRect(), n = c.current.getBoundingClientRect(), d = 16, A = 8, Q = window.innerHeight - e.bottom - d, T = e.top - d, U = Q < n.height && T > n.height ? e.top - n.height - A : e.bottom + A, V = Math.max(d, Math.min(U, window.innerHeight - n.height - d)), X = Math.max(d, Math.min(e.left, window.innerWidth - n.width - d));
36
+ if (i || !o || !m.current || !c.current) return;
37
+ const e = m.current.getBoundingClientRect(), n = c.current.getBoundingClientRect(), d = 16, A = 8, T = window.innerHeight - e.bottom - d, U = e.top - d, V = T < n.height && U > n.height ? e.top - n.height - A : e.bottom + A, X = Math.max(d, Math.min(V, window.innerHeight - n.height - d)), Y = Math.max(d, Math.min(e.left, window.innerWidth - n.width - d));
38
38
  $({
39
39
  position: "fixed",
40
- top: `${V}px`,
41
- left: `${X}px`,
40
+ top: `${X}px`,
41
+ left: `${Y}px`,
42
42
  zIndex: 1100
43
43
  });
44
- }, [r, o]);
44
+ }, [i, o]);
45
45
  x(() => {
46
- if (r || !o) {
46
+ if (i || !o) {
47
47
  $({
48
48
  position: "fixed",
49
49
  visibility: "hidden"
@@ -57,48 +57,48 @@ var me = ({ value: t, onChange: g, mode: s = "single", withTime: f = !1, timeFor
57
57
  cancelAnimationFrame(e), n.disconnect(), window.removeEventListener("resize", a), window.removeEventListener("scroll", a, !0);
58
58
  };
59
59
  }, [
60
- r,
60
+ i,
61
61
  o,
62
62
  a
63
63
  ]);
64
- const y = () => {
64
+ const W = () => {
65
65
  if (!t) return "";
66
66
  if (s === "single" && t instanceof Date) {
67
67
  const e = l(t, _);
68
68
  return f ? `${e} ${w ? l(t, "HH:mm:ss") : l(t, "HH:mm")}` : e;
69
69
  }
70
70
  return s === "range" && t && "start" in t ? `${l(t.start, _)} - ${l(t.end, _)}` : s === "multiple" && Array.isArray(t) ? t.map((e) => l(e, _)).join(", ") : "";
71
- }, W = (e) => {
71
+ }, G = (e) => {
72
72
  if (!f || !(e instanceof Date)) {
73
- g?.(e), N && s !== "multiple" && !r && u(!1);
73
+ g?.(e), N && s !== "multiple" && !i && u(!1);
74
74
  return;
75
75
  }
76
76
  const n = new Date(e);
77
- n.setHours(k.hours, k.minutes, k.seconds), g?.(n), N && !r && u(!1);
78
- }, G = (e) => {
77
+ n.setHours(k.hours, k.minutes, k.seconds), g?.(n), N && !i && u(!1);
78
+ }, J = (e) => {
79
79
  if (S(e), !(t instanceof Date)) return;
80
80
  const n = new Date(t);
81
81
  n.setHours(e.hours, e.minutes, e.seconds), g?.(n);
82
- }, J = (e) => {
82
+ }, K = (e) => {
83
83
  e.stopPropagation(), p(null), g?.(void 0);
84
- }, K = () => {
84
+ }, Q = () => {
85
85
  p(null), u(!1);
86
- }, R = y(), v = () => /* @__PURE__ */ h(ne, { children: [/* @__PURE__ */ i(O, {
86
+ }, R = W(), v = () => /* @__PURE__ */ h(ne, { children: [/* @__PURE__ */ r(O, {
87
87
  ...C,
88
88
  mode: s,
89
89
  value: t,
90
- onChange: W,
91
- rangeStart: s === "range" ? B : C.rangeStart,
90
+ onChange: G,
91
+ rangeStart: s === "range" ? q : C.rangeStart,
92
92
  onRangeStartChange: s === "range" ? p : C.onRangeStartChange
93
- }), f && s === "single" && t instanceof Date && /* @__PURE__ */ i("div", {
93
+ }), f && s === "single" && t instanceof Date && /* @__PURE__ */ r("div", {
94
94
  className: "datepicker__time",
95
- children: /* @__PURE__ */ i(ee, {
96
- clockSize: P,
97
- format: L,
98
- minuteStep: I,
99
- onChange: G,
95
+ children: /* @__PURE__ */ r(ee, {
96
+ clockSize: I,
97
+ format: M,
98
+ minuteStep: z,
99
+ onChange: J,
100
100
  value: k,
101
- withClock: M,
101
+ withClock: P,
102
102
  withSeconds: w
103
103
  })
104
104
  })] });
@@ -108,40 +108,42 @@ var me = ({ value: t, onChange: g, mode: s = "single", withTime: f = !1, timeFor
108
108
  ref: m,
109
109
  className: `datepicker__input ${b ? "datepicker__input--disabled" : ""} ${o ? "datepicker__input--open" : ""}`,
110
110
  onClick: () => {
111
- b || r || (o && p(null), u(!o));
111
+ b || i || (o && p(null), u(!o));
112
112
  },
113
- children: [/* @__PURE__ */ i("span", {
113
+ children: [/* @__PURE__ */ r("span", {
114
114
  className: `datepicker__value ${R ? "" : "datepicker__value--placeholder"}`,
115
- children: R || z
115
+ children: R || F
116
116
  }), /* @__PURE__ */ h("div", {
117
117
  className: "datepicker__actions",
118
- children: [F && R && /* @__PURE__ */ i(Y, {
118
+ children: [j && R && /* @__PURE__ */ r(E, {
119
119
  title: "Clear",
120
- children: /* @__PURE__ */ i("button", {
120
+ children: /* @__PURE__ */ r("button", {
121
121
  type: "button",
122
122
  className: "datepicker__clear",
123
- onClick: J,
123
+ onClick: K,
124
124
  children: "×"
125
125
  })
126
- }), /* @__PURE__ */ i("span", {
126
+ }), /* @__PURE__ */ r("span", {
127
127
  className: "datepicker__icon",
128
- children: /* @__PURE__ */ i(H, { name: "calendar" })
128
+ children: /* @__PURE__ */ r(H, { name: "calendar" })
129
129
  })]
130
130
  })]
131
- }), o && (r ? /* @__PURE__ */ i("div", {
131
+ }), o && (i ? /* @__PURE__ */ r("div", {
132
132
  ref: c,
133
133
  className: "datepicker__dropdown datepicker__dropdown--inline",
134
134
  children: v()
135
135
  }) : re(/* @__PURE__ */ h("div", {
136
136
  ref: c,
137
137
  className: "datepicker__dropdown",
138
- style: q,
139
- children: [/* @__PURE__ */ i("button", {
140
- type: "button",
141
- className: "datepicker__dropdown-close",
142
- onClick: K,
138
+ style: y,
139
+ children: [/* @__PURE__ */ r(E, {
143
140
  title: "Close",
144
- children: /* @__PURE__ */ i(H, { name: "clear" })
141
+ children: /* @__PURE__ */ r("button", {
142
+ type: "button",
143
+ className: "datepicker__dropdown-close",
144
+ onClick: Q,
145
+ children: /* @__PURE__ */ r(H, { name: "clear" })
146
+ })
145
147
  }), v()]
146
148
  }), document.body))]
147
149
  });
@@ -23,7 +23,7 @@ var r = (i) => {
23
23
  const o = {
24
24
  ...i,
25
25
  lib: d,
26
- libBuildNumber: 491,
26
+ libBuildNumber: 493,
27
27
  libCommit: n,
28
28
  libBuildDate: t
29
29
  };
package/dist/version.js CHANGED
@@ -1,7 +1,7 @@
1
- var I = "3.8.1", B = 491, L = "573fbac", _ = "2026-10-12T08:29:45.572Z", a = "491";
1
+ var I = "3.8.2", B = 493, L = "26077c7", _ = "2026-10-13T14:15:24.319Z", r = "493";
2
2
  export {
3
3
  _ as LIB_BUILD_DATE,
4
- a as LIB_BUILD_ID,
4
+ r as LIB_BUILD_ID,
5
5
  B as LIB_BUILD_NUMBER,
6
6
  L as LIB_COMMIT,
7
7
  I as LIB_VERSION
package/dist/version.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "3.8.1",
3
- "buildNumber": 491,
4
- "commit": "573fbac",
5
- "buildDate": "2026-10-12T08:29:45.572Z"
2
+ "version": "3.8.2",
3
+ "buildNumber": 493,
4
+ "commit": "26077c7",
5
+ "buildDate": "2026-10-13T14:15:24.319Z"
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memobit/libs",
3
- "version": "3.8.1",
3
+ "version": "3.8.2",
4
4
  "description": "React component library powering the Memobit apps — 100+ components, helpers and hooks. Icons ship as @memobit/icons and themes as @memobit/themes. TypeScript-first, ESM-only, React 19.",
5
5
  "keywords": [
6
6
  "react",