@companix/uikit 0.0.64 → 0.0.66
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/Select/index.d.ts +1 -1
- package/dist/__utils/utils.d.ts +4 -0
- package/dist/bundle.es12.js +30 -29
- package/dist/bundle.es13.js +66 -64
- package/dist/bundle.es14.js +2 -2
- package/dist/bundle.es16.js +1 -1
- package/dist/bundle.es22.js +1 -1
- package/dist/bundle.es23.js +1 -1
- package/dist/bundle.es24.js +1 -1
- package/dist/bundle.es27.js +1 -1
- package/dist/bundle.es28.js +3 -3
- package/dist/bundle.es29.js +1 -1
- package/dist/bundle.es32.js +48 -48
- package/dist/bundle.es42.js +1 -1
- package/dist/bundle.es50.js +47 -43
- package/dist/bundle.es51.js +73 -23
- package/dist/bundle.es52.js +20 -35
- package/dist/bundle.es53.js +39 -5
- package/dist/bundle.es54.js +5 -14
- package/dist/bundle.es55.js +13 -13
- package/dist/bundle.es56.js +13 -69
- package/dist/bundle.es57.js +68 -66
- package/dist/bundle.es58.js +67 -69
- package/dist/bundle.es60.js +1 -1
- package/dist/bundle.es64.js +74 -13
- package/dist/bundle.es65.js +45 -71
- package/dist/bundle.es66.js +13 -48
- package/package.json +1 -1
package/dist/bundle.es58.js
CHANGED
|
@@ -1,72 +1,70 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
import { useMemo as D, useCallback as c } from "react";
|
|
2
|
+
function l(e, t) {
|
|
3
|
+
return e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
|
|
4
|
+
}
|
|
5
|
+
function f(e) {
|
|
6
|
+
const t = new Date(e);
|
|
7
|
+
return t.setHours(0, 0, 0, 0), t;
|
|
8
|
+
}
|
|
9
|
+
function h(e) {
|
|
10
|
+
const t = new Date(e);
|
|
11
|
+
return t.setHours(23, 59, 59, 999), t;
|
|
12
|
+
}
|
|
13
|
+
function M(e, t = {}) {
|
|
14
|
+
const { min: n, max: r, withTime: s = !1 } = t;
|
|
15
|
+
return !s && (n && l(e, n) || r && l(e, r)) ? !1 : !!(n && e < n || r && e > r);
|
|
16
|
+
}
|
|
17
|
+
function m(e, t) {
|
|
18
|
+
const n = new Date(e);
|
|
19
|
+
if (!t)
|
|
20
|
+
return n;
|
|
21
|
+
const r = n.getDate(), s = new Date(e);
|
|
22
|
+
s.setMonth(n.getMonth() + t + 1, 0);
|
|
23
|
+
const a = s.getDate();
|
|
24
|
+
return r >= a ? s : (n.setFullYear(s.getFullYear(), s.getMonth(), r), n);
|
|
25
|
+
}
|
|
26
|
+
function F(e, t) {
|
|
27
|
+
return m(e, -1);
|
|
28
|
+
}
|
|
29
|
+
function g(e) {
|
|
30
|
+
const t = new Date(e), n = new Date(t);
|
|
31
|
+
return n.setFullYear(t.getFullYear(), t.getMonth() + 1, 0), n.setHours(0, 0, 0, 0), n.getDate();
|
|
32
|
+
}
|
|
33
|
+
function Y(e, t) {
|
|
34
|
+
const n = new Date(e);
|
|
35
|
+
return n.setFullYear(t), n;
|
|
36
|
+
}
|
|
37
|
+
function y(e, t) {
|
|
38
|
+
const n = new Date(e), r = n.getFullYear(), s = n.getDate(), a = new Date(e);
|
|
39
|
+
a.setFullYear(r, t, 15), a.setHours(0, 0, 0, 0);
|
|
40
|
+
const u = g(a);
|
|
41
|
+
return n.setMonth(t, Math.min(s, u)), n;
|
|
42
|
+
}
|
|
43
|
+
const w = (e) => {
|
|
44
|
+
const { disableFuture: t, disablePast: n, maxDateTime: r, minDateTime: s, shouldDisableDate: a } = e;
|
|
45
|
+
return (u, i) => {
|
|
46
|
+
const o = /* @__PURE__ */ new Date();
|
|
47
|
+
return a ? a(u) : t ? f(u) > o : n ? h(u) < o : s || r ? M(u, { min: s, max: r, withTime: i }) : !1;
|
|
48
|
+
};
|
|
49
|
+
}, d = (e) => {
|
|
50
|
+
const t = D(() => w(e), [
|
|
51
|
+
e.disableFuture,
|
|
52
|
+
e.disablePast,
|
|
53
|
+
e.shouldDisableDate,
|
|
54
|
+
e.minDateTime,
|
|
55
|
+
e.maxDateTime
|
|
56
|
+
]);
|
|
57
|
+
return c(t, [t]);
|
|
54
58
|
};
|
|
55
59
|
export {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
F as getMonths,
|
|
67
|
-
h as getTimeValue,
|
|
68
|
-
_ as getTimesOptions,
|
|
69
|
-
w as getYears,
|
|
70
|
-
Y as removeDigits,
|
|
71
|
-
A as weeks
|
|
60
|
+
m as addMonths,
|
|
61
|
+
w as createDayDisableChecker,
|
|
62
|
+
h as endOfDay,
|
|
63
|
+
M as isDayMinMaxRestricted,
|
|
64
|
+
l as isSameDate,
|
|
65
|
+
y as setMonth,
|
|
66
|
+
Y as setYear,
|
|
67
|
+
f as startOfDay,
|
|
68
|
+
F as subMonths,
|
|
69
|
+
d as useDayDisableCheker
|
|
72
70
|
};
|
package/dist/bundle.es60.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DefaultMonths as f, getMonthMaxDay as i } from "./bundle.
|
|
1
|
+
import { DefaultMonths as f, getMonthMaxDay as i } from "./bundle.es51.js";
|
|
2
2
|
import { useMemo as s } from "react";
|
|
3
3
|
import { range as l } from "@companix/utils-js";
|
|
4
4
|
const p = { day: 31, month: 12, year: 2050 }, u = { day: 1, month: 1, year: 1900 }, I = ({ min: t = u, max: e = p, now: r }) => {
|
package/dist/bundle.es64.js
CHANGED
|
@@ -1,16 +1,77 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as d, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as u, useMemo as h } from "react";
|
|
3
|
+
import { Select as p } from "./bundle.es12.js";
|
|
4
|
+
import { getMonths as k, getYears as z, DEFAULT_MAX_YEAR as f, DEFAULT_MIN_YEAR as g } from "./bundle.es51.js";
|
|
5
|
+
import { Icon as C } from "./bundle.es33.js";
|
|
6
|
+
import { faChevronLeft as E, faChevronRight as T } from "@companix/icons-solid";
|
|
7
|
+
import { setMonth as _, setYear as F } from "./bundle.es58.js";
|
|
8
|
+
const y = ({
|
|
9
|
+
viewDate: n,
|
|
10
|
+
onChange: c,
|
|
11
|
+
isMonthDisabled: a,
|
|
12
|
+
isYearDisabled: m,
|
|
13
|
+
onNextMonth: N,
|
|
14
|
+
onPrevMonth: v
|
|
15
|
+
}) => {
|
|
16
|
+
const e = n.getFullYear(), r = n.getMonth(), s = "ru", M = u(
|
|
17
|
+
(t) => {
|
|
18
|
+
c(_(n, t));
|
|
19
|
+
},
|
|
20
|
+
[c, n]
|
|
21
|
+
), x = u(
|
|
22
|
+
(t) => {
|
|
23
|
+
c(F(n, t));
|
|
24
|
+
},
|
|
25
|
+
[c, n]
|
|
26
|
+
), A = h(() => k(s).map((t) => ({
|
|
27
|
+
...t,
|
|
28
|
+
className: "capitalize",
|
|
29
|
+
disabled: a && a(t.value)
|
|
30
|
+
})), [s, a]), Y = h(() => z(e, 100).map((t) => ({
|
|
31
|
+
...t,
|
|
32
|
+
disabled: m && m(t.value)
|
|
33
|
+
})), [e, m]);
|
|
34
|
+
let l = r === 11 && e === f;
|
|
35
|
+
a && !l && (l = a(
|
|
36
|
+
r === 11 ? 0 : r + 1,
|
|
37
|
+
r === 11 ? Math.min(e + 1, f) : e
|
|
38
|
+
));
|
|
39
|
+
let i = r === 0 && e === g;
|
|
40
|
+
return a && !i && (i = a(
|
|
41
|
+
r === 0 ? 11 : r - 1,
|
|
42
|
+
r === 0 ? Math.max(e - 1, g) : e
|
|
43
|
+
)), /* @__PURE__ */ d("div", { className: "calendar-header", children: [
|
|
44
|
+
!i && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "left", onClick: v, children: /* @__PURE__ */ o(C, { icon: E }) }),
|
|
45
|
+
/* @__PURE__ */ d("div", { className: "calendar-pickers", children: [
|
|
46
|
+
/* @__PURE__ */ o(
|
|
47
|
+
p,
|
|
48
|
+
{
|
|
49
|
+
fill: !0,
|
|
50
|
+
options: Y,
|
|
51
|
+
size: "sm",
|
|
52
|
+
value: e,
|
|
53
|
+
minimalOptions: !0,
|
|
54
|
+
matchTarget: "min-width",
|
|
55
|
+
onChange: (t) => x(t)
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
/* @__PURE__ */ o(
|
|
59
|
+
p,
|
|
60
|
+
{
|
|
61
|
+
fill: !0,
|
|
62
|
+
options: A,
|
|
63
|
+
size: "sm",
|
|
64
|
+
className: "capitalize",
|
|
65
|
+
value: r,
|
|
66
|
+
minimalOptions: !0,
|
|
67
|
+
matchTarget: "min-width",
|
|
68
|
+
onChange: (t) => M(t)
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] }),
|
|
72
|
+
!l && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "right", onClick: N, children: /* @__PURE__ */ o(C, { icon: T }) })
|
|
73
|
+
] });
|
|
13
74
|
};
|
|
14
75
|
export {
|
|
15
|
-
|
|
76
|
+
y as CalendarHeader
|
|
16
77
|
};
|
package/dist/bundle.es65.js
CHANGED
|
@@ -1,77 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
isMonthDisabled: a,
|
|
12
|
-
isYearDisabled: m,
|
|
13
|
-
onNextMonth: N,
|
|
14
|
-
onPrevMonth: v
|
|
1
|
+
import { subMonths as L, addMonths as N, useDayDisableCheker as R } from "./bundle.es58.js";
|
|
2
|
+
import { DEFAULT_MIN_YEAR as w, DEFAULT_MAX_YEAR as A } from "./bundle.es51.js";
|
|
3
|
+
import { useState as U, useCallback as M } from "react";
|
|
4
|
+
const X = ({
|
|
5
|
+
value: p,
|
|
6
|
+
disablePast: r,
|
|
7
|
+
disableFuture: c,
|
|
8
|
+
shouldDisableDate: E,
|
|
9
|
+
minDateTime: l,
|
|
10
|
+
maxDateTime: s
|
|
15
11
|
}) => {
|
|
16
|
-
const e =
|
|
17
|
-
(
|
|
18
|
-
|
|
12
|
+
const [e, u] = U(p || /* @__PURE__ */ new Date()), _ = M(() => {
|
|
13
|
+
u(L(e));
|
|
14
|
+
}, [e]), C = M(() => {
|
|
15
|
+
u(N(e, 1));
|
|
16
|
+
}, [e]), D = R({
|
|
17
|
+
disableFuture: c,
|
|
18
|
+
disablePast: r,
|
|
19
|
+
shouldDisableDate: E,
|
|
20
|
+
minDateTime: l,
|
|
21
|
+
maxDateTime: s
|
|
22
|
+
}), k = M(
|
|
23
|
+
(o, t) => {
|
|
24
|
+
const n = /* @__PURE__ */ new Date();
|
|
25
|
+
t = t || e.getFullYear();
|
|
26
|
+
const h = l ? l.getMonth() : 0, Y = s ? s.getMonth() : 11, F = l?.getFullYear() || w, f = s?.getFullYear() || A;
|
|
27
|
+
let g = t >= F && t <= f ? t === F && h > o || t === f && o > Y : !0;
|
|
28
|
+
return c && (g = g || (t === n.getFullYear() ? o > n.getMonth() : t > n.getFullYear())), r && (g = g || (t === n.getFullYear() ? o < n.getMonth() : t < n.getFullYear())), g;
|
|
19
29
|
},
|
|
20
|
-
[c,
|
|
21
|
-
),
|
|
22
|
-
(
|
|
23
|
-
|
|
30
|
+
[c, r, e, l, s]
|
|
31
|
+
), v = M(
|
|
32
|
+
(o) => {
|
|
33
|
+
const t = /* @__PURE__ */ new Date(), n = l?.getFullYear() || w, h = s?.getFullYear() || A;
|
|
34
|
+
let Y = n > o || o > h;
|
|
35
|
+
return c && (Y = Y || o > t.getFullYear()), r && (Y = Y || o < t.getFullYear()), Y;
|
|
24
36
|
},
|
|
25
|
-
[c,
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
r === 11 ? 0 : r + 1,
|
|
37
|
-
r === 11 ? Math.min(e + 1, f) : e
|
|
38
|
-
));
|
|
39
|
-
let i = r === 0 && e === g;
|
|
40
|
-
return a && !i && (i = a(
|
|
41
|
-
r === 0 ? 11 : r - 1,
|
|
42
|
-
r === 0 ? Math.max(e - 1, g) : e
|
|
43
|
-
)), /* @__PURE__ */ d("div", { className: "calendar-header", children: [
|
|
44
|
-
!i && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "left", onClick: v, children: /* @__PURE__ */ o(C, { icon: E }) }),
|
|
45
|
-
/* @__PURE__ */ d("div", { className: "calendar-pickers", children: [
|
|
46
|
-
/* @__PURE__ */ o(
|
|
47
|
-
p,
|
|
48
|
-
{
|
|
49
|
-
fill: !0,
|
|
50
|
-
options: Y,
|
|
51
|
-
size: "sm",
|
|
52
|
-
value: e,
|
|
53
|
-
minimalOptions: !0,
|
|
54
|
-
matchTarget: "min-width",
|
|
55
|
-
onChange: (t) => x(t)
|
|
56
|
-
}
|
|
57
|
-
),
|
|
58
|
-
/* @__PURE__ */ o(
|
|
59
|
-
p,
|
|
60
|
-
{
|
|
61
|
-
fill: !0,
|
|
62
|
-
options: A,
|
|
63
|
-
size: "sm",
|
|
64
|
-
className: "capitalize",
|
|
65
|
-
value: r,
|
|
66
|
-
minimalOptions: !0,
|
|
67
|
-
matchTarget: "min-width",
|
|
68
|
-
onChange: (t) => M(t)
|
|
69
|
-
}
|
|
70
|
-
)
|
|
71
|
-
] }),
|
|
72
|
-
!l && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "right", onClick: N, children: /* @__PURE__ */ o(C, { icon: T }) })
|
|
73
|
-
] });
|
|
37
|
+
[c, r, l, s]
|
|
38
|
+
);
|
|
39
|
+
return {
|
|
40
|
+
viewDate: e,
|
|
41
|
+
setViewDate: u,
|
|
42
|
+
setPrevMonth: _,
|
|
43
|
+
setNextMonth: C,
|
|
44
|
+
isDayDisabled: D,
|
|
45
|
+
isMonthDisabled: k,
|
|
46
|
+
isYearDisabled: v
|
|
47
|
+
};
|
|
74
48
|
};
|
|
75
49
|
export {
|
|
76
|
-
|
|
50
|
+
X as useCalendar
|
|
77
51
|
};
|
package/dist/bundle.es66.js
CHANGED
|
@@ -1,51 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
u(L(e));
|
|
14
|
-
}, [e]), C = M(() => {
|
|
15
|
-
u(N(e, 1));
|
|
16
|
-
}, [e]), D = R({
|
|
17
|
-
disableFuture: c,
|
|
18
|
-
disablePast: r,
|
|
19
|
-
shouldDisableDate: E,
|
|
20
|
-
minDateTime: l,
|
|
21
|
-
maxDateTime: s
|
|
22
|
-
}), k = M(
|
|
23
|
-
(o, t) => {
|
|
24
|
-
const n = /* @__PURE__ */ new Date();
|
|
25
|
-
t = t || e.getFullYear();
|
|
26
|
-
const h = l ? l.getMonth() : 0, Y = s ? s.getMonth() : 11, F = l?.getFullYear() || w, f = s?.getFullYear() || A;
|
|
27
|
-
let g = t >= F && t <= f ? t === F && h > o || t === f && o > Y : !0;
|
|
28
|
-
return c && (g = g || (t === n.getFullYear() ? o > n.getMonth() : t > n.getFullYear())), r && (g = g || (t === n.getFullYear() ? o < n.getMonth() : t < n.getFullYear())), g;
|
|
29
|
-
},
|
|
30
|
-
[c, r, e, l, s]
|
|
31
|
-
), v = M(
|
|
32
|
-
(o) => {
|
|
33
|
-
const t = /* @__PURE__ */ new Date(), n = l?.getFullYear() || w, h = s?.getFullYear() || A;
|
|
34
|
-
let Y = n > o || o > h;
|
|
35
|
-
return c && (Y = Y || o > t.getFullYear()), r && (Y = Y || o < t.getFullYear()), Y;
|
|
36
|
-
},
|
|
37
|
-
[c, r, l, s]
|
|
38
|
-
);
|
|
39
|
-
return {
|
|
40
|
-
viewDate: e,
|
|
41
|
-
setViewDate: u,
|
|
42
|
-
setPrevMonth: _,
|
|
43
|
-
setNextMonth: C,
|
|
44
|
-
isDayDisabled: D,
|
|
45
|
-
isMonthDisabled: k,
|
|
46
|
-
isYearDisabled: v
|
|
47
|
-
};
|
|
1
|
+
import { useRef as l, useCallback as p } from "react";
|
|
2
|
+
import { useEffectWithLayout as d } from "./bundle.es67.js";
|
|
3
|
+
const g = (r, f) => {
|
|
4
|
+
const c = l(null), i = l(null), o = { Right: c, Left: i }, u = p((t) => {
|
|
5
|
+
if (r.current) {
|
|
6
|
+
const n = r.current.style, e = o[t];
|
|
7
|
+
e.current && e.current.clientWidth ? n[`padding${t}`] !== `${e.current.clientWidth}px` && (n[`padding${t}`] = `${e.current.clientWidth}px`) : n[`padding${t}`] && (n[`padding${t}`] = "");
|
|
8
|
+
}
|
|
9
|
+
}, []);
|
|
10
|
+
return d(() => {
|
|
11
|
+
u("Left"), u("Right");
|
|
12
|
+
}, f), { rightRef: c, leftRef: i };
|
|
48
13
|
};
|
|
49
14
|
export {
|
|
50
|
-
|
|
15
|
+
g as useInputPadding
|
|
51
16
|
};
|