@companix/uikit 0.1.6 → 0.1.8
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/Button/Button.scss +3 -1
- package/dist/Checkbox/Checkbox.scss +2 -2
- package/dist/OptionItem/Option.scss +2 -2
- package/dist/Popover/Popover.scss +2 -1
- package/dist/Radio/Radio.scss +2 -2
- package/dist/Scrollable/Scrollable.scss +2 -0
- package/dist/Segments/Segments.scss +2 -2
- package/dist/Select/Select.scss +4 -3
- package/dist/SelectTags/SelectTags.scss +2 -2
- package/dist/Tabs/Tabs.scss +2 -2
- package/dist/bundle.es62.js +20 -20
- package/dist/bundle.es65.js +1 -1
- package/dist/bundle.es66.js +2 -2
- package/dist/bundle.es72.js +13 -74
- package/dist/bundle.es73.js +71 -45
- package/dist/bundle.es74.js +48 -13
- package/dist/bundle.es8.js +30 -30
- package/package.json +1 -1
package/dist/Button/Button.scss
CHANGED
|
@@ -12,11 +12,13 @@
|
|
|
12
12
|
|
|
13
13
|
&:hover {
|
|
14
14
|
@include mixins.use-styles(button, $appearance, $mode, hovered);
|
|
15
|
+
z-index: 1;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
&[data-active],
|
|
18
19
|
&:active {
|
|
19
20
|
@include mixins.use-styles(button, $appearance, $mode, pressed);
|
|
21
|
+
z-index: 2;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
&[data-loading] {
|
|
@@ -28,7 +30,7 @@
|
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
&[disabled] {
|
|
31
|
-
@include mixins.use-styles(button, $appearance, $mode,
|
|
33
|
+
@include mixins.use-styles(button, $appearance, $mode, disable);
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
&:not([data-disabled]):not([data-required]):hover {
|
|
12
12
|
.checkbox-box[data-state='unchecked'] {
|
|
13
|
-
@include mixins.use-styles(checkbox, box,
|
|
13
|
+
@include mixins.use-styles(checkbox, box, hovered);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
&:not([data-disabled]):not([data-required]):active {
|
|
18
18
|
.checkbox-box[data-state='unchecked'] {
|
|
19
|
-
@include mixins.use-styles(checkbox, box,
|
|
19
|
+
@include mixins.use-styles(checkbox, box, pressed);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
cursor: pointer;
|
|
65
65
|
|
|
66
66
|
&:hover {
|
|
67
|
-
@include mixins.use-styles(option,
|
|
67
|
+
@include mixins.use-styles(option, hovered);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
&:active {
|
|
71
|
-
@include mixins.use-styles(option,
|
|
71
|
+
@include mixins.use-styles(option, pressed);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
package/dist/Radio/Radio.scss
CHANGED
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
|
|
16
16
|
&:not([data-required]):not([data-disabled]):hover {
|
|
17
17
|
.radio-box[data-state='unchecked'] {
|
|
18
|
-
@include mixins.use-styles(radio, box,
|
|
18
|
+
@include mixins.use-styles(radio, box, hovered);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
&:not([data-required]):not([data-disabled]):active {
|
|
23
23
|
.radio-box[data-state='unchecked'] {
|
|
24
|
-
@include mixins.use-styles(radio, box,
|
|
24
|
+
@include mixins.use-styles(radio, box, pressed);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
|
|
43
43
|
&:not([data-selected]) {
|
|
44
44
|
&:hover {
|
|
45
|
-
@include mixins.use-styles(segment-control, option,
|
|
45
|
+
@include mixins.use-styles(segment-control, option, hovered);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
&:active {
|
|
49
|
-
@include mixins.use-styles(segment-control, option,
|
|
49
|
+
@include mixins.use-styles(segment-control, option, pressed);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
package/dist/Select/Select.scss
CHANGED
|
@@ -73,10 +73,11 @@
|
|
|
73
73
|
padding: 0px var(--form_space, 0);
|
|
74
74
|
height: 100%;
|
|
75
75
|
outline: none;
|
|
76
|
-
|
|
76
|
+
|
|
77
|
+
@include mixins.use-styles(select, tools);
|
|
77
78
|
|
|
78
79
|
&:hover {
|
|
79
|
-
|
|
80
|
+
@include mixins.use-styles(select, tools, hovered);
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
83
|
|
|
@@ -93,7 +94,7 @@
|
|
|
93
94
|
|
|
94
95
|
.expand-icon {
|
|
95
96
|
transition: transform 0.2s;
|
|
96
|
-
@include mixins.use-styles(select,
|
|
97
|
+
@include mixins.use-styles(select, tools);
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
.form {
|
package/dist/Tabs/Tabs.scss
CHANGED
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
&:not([data-disabled]):not([data-state='active']):hover {
|
|
52
|
-
@include mixins.use-styles(tab,
|
|
52
|
+
@include mixins.use-styles(tab, hovered);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
&[data-state='active'] {
|
|
56
|
-
@include mixins.use-styles(tab,
|
|
56
|
+
@include mixins.use-styles(tab, pressed);
|
|
57
57
|
}
|
|
58
58
|
}
|
package/dist/bundle.es62.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { useMemo as
|
|
1
|
+
import { jsx as i, jsxs as k } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as y, useEffect as C } from "react";
|
|
3
3
|
import { Spinner as P } from "./bundle.es7.js";
|
|
4
4
|
import { OptionItem as L } from "./bundle.es16.js";
|
|
5
5
|
import { OptionsList as T } from "./bundle.es18.js";
|
|
6
6
|
import { Icon as R } from "./bundle.es35.js";
|
|
7
7
|
import { faPlus as S } from "@companix/icons-solid";
|
|
8
|
-
const b = () => ({ isLoading: !1, options: [] }), I = (
|
|
9
|
-
const { onOptionsLoaded:
|
|
8
|
+
const b = () => ({ isLoading: !1, options: [] }), I = (e) => {
|
|
9
|
+
const { onOptionsLoaded: n, useOptions: s = b, options: o } = e, t = s();
|
|
10
10
|
return C(() => {
|
|
11
|
-
t.options.length > 0 &&
|
|
11
|
+
t.options.length > 0 && n?.(t.options);
|
|
12
12
|
}, [t.options]), o ? { options: o, isLoading: !1 } : t;
|
|
13
|
-
}, H = (
|
|
13
|
+
}, H = (e) => {
|
|
14
14
|
const {
|
|
15
|
-
isActive:
|
|
15
|
+
isActive: n,
|
|
16
16
|
emptyText: s,
|
|
17
17
|
isLoading: o,
|
|
18
18
|
scrollboxRef: t,
|
|
@@ -24,13 +24,13 @@ const b = () => ({ isLoading: !1, options: [] }), I = (n) => {
|
|
|
24
24
|
filterOptions: r,
|
|
25
25
|
disableFiltering: l,
|
|
26
26
|
close: c,
|
|
27
|
-
...
|
|
28
|
-
} =
|
|
27
|
+
...m
|
|
28
|
+
} = e, { emptyText: x, options: a, isLoading: g } = I(m), v = y(() => r && !l ? a.filter(r) : a, [a, r, l]);
|
|
29
29
|
return g ?? o ? /* @__PURE__ */ i("div", { className: "select-popover-loading", children: /* @__PURE__ */ i(P, { size: 24 }) }) : /* @__PURE__ */ i(
|
|
30
30
|
N,
|
|
31
31
|
{
|
|
32
32
|
options: v,
|
|
33
|
-
isActive:
|
|
33
|
+
isActive: n,
|
|
34
34
|
emptyText: x ?? s,
|
|
35
35
|
scrollboxRef: t,
|
|
36
36
|
optionsWrapperRef: d,
|
|
@@ -41,9 +41,9 @@ const b = () => ({ isLoading: !1, options: [] }), I = (n) => {
|
|
|
41
41
|
close: c
|
|
42
42
|
}
|
|
43
43
|
);
|
|
44
|
-
}, N = (
|
|
44
|
+
}, N = (e) => {
|
|
45
45
|
const {
|
|
46
|
-
isActive:
|
|
46
|
+
isActive: n,
|
|
47
47
|
onOpened: s,
|
|
48
48
|
addOption: o,
|
|
49
49
|
scrollboxRef: t,
|
|
@@ -53,9 +53,9 @@ const b = () => ({ isLoading: !1, options: [] }), I = (n) => {
|
|
|
53
53
|
minimalOptions: O,
|
|
54
54
|
emptyText: u = "Ничего не найдено",
|
|
55
55
|
close: r
|
|
56
|
-
} =
|
|
56
|
+
} = e;
|
|
57
57
|
C(() => {
|
|
58
|
-
s?.(p.findIndex(({ value: c }) =>
|
|
58
|
+
s?.(p.findIndex(({ value: c }) => n(c)));
|
|
59
59
|
}, []);
|
|
60
60
|
const l = o ? /* @__PURE__ */ i(
|
|
61
61
|
L,
|
|
@@ -69,20 +69,20 @@ const b = () => ({ isLoading: !1, options: [] }), I = (n) => {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
) : void 0;
|
|
72
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ k(T, { scrollboxRef: t, optionsWrapperRef: d, maxHeight: 300, children: [
|
|
73
73
|
(o?.position === void 0 || o?.position === "first") && l,
|
|
74
|
-
p.length === 0 && !o && /* @__PURE__ */ i("div", { className: "select-tags-
|
|
75
|
-
p.map(({ title: c, value:
|
|
74
|
+
p.length === 0 && !o && /* @__PURE__ */ i("div", { className: "select-tags-noneresults", children: u }),
|
|
75
|
+
p.map(({ title: c, value: m, className: x, icon: a, disabled: g, label: v }, h) => /* @__PURE__ */ i(
|
|
76
76
|
L,
|
|
77
77
|
{
|
|
78
|
-
active:
|
|
79
|
-
onClick: () => f?.(
|
|
78
|
+
active: n(m),
|
|
79
|
+
onClick: () => f?.(m),
|
|
80
80
|
minimal: O,
|
|
81
81
|
disabled: g,
|
|
82
82
|
className: x,
|
|
83
83
|
title: c,
|
|
84
84
|
label: v,
|
|
85
|
-
icon:
|
|
85
|
+
icon: a
|
|
86
86
|
},
|
|
87
87
|
`select-option-${h}`
|
|
88
88
|
)),
|
package/dist/bundle.es65.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs as b, jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import h from "classnames";
|
|
3
3
|
import { attr as e } from "@companix/utils-browser";
|
|
4
4
|
import { forwardRef as x } from "react";
|
|
5
|
-
import { useInputPadding as N } from "./bundle.
|
|
5
|
+
import { useInputPadding as N } from "./bundle.es72.js";
|
|
6
6
|
const v = x(
|
|
7
7
|
({
|
|
8
8
|
required: s,
|
package/dist/bundle.es66.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as D, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { dateToFormat as $, weeks as g, createVoids as p, getDayIndex as b, getFirstDay as u, getMonthMaxDay as k } from "./bundle.es63.js";
|
|
3
|
-
import { CalendarHeader as F } from "./bundle.
|
|
4
|
-
import { useCalendar as j } from "./bundle.
|
|
3
|
+
import { CalendarHeader as F } from "./bundle.es73.js";
|
|
4
|
+
import { useCalendar as j } from "./bundle.es74.js";
|
|
5
5
|
import { attr as m } from "@companix/utils-browser";
|
|
6
6
|
import { isSameDate as f } from "./bundle.es57.js";
|
|
7
7
|
import { useLayoutEffect as I } from "react";
|
package/dist/bundle.es72.js
CHANGED
|
@@ -1,77 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
] });
|
|
1
|
+
import { useRef as l, useCallback as p } from "react";
|
|
2
|
+
import { useEffectWithLayout as d } from "./bundle.es75.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 };
|
|
74
13
|
};
|
|
75
14
|
export {
|
|
76
|
-
|
|
15
|
+
g as useInputPadding
|
|
77
16
|
};
|
package/dist/bundle.es73.js
CHANGED
|
@@ -1,51 +1,77 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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.es13.js";
|
|
4
|
+
import { getMonths as k, getYears as z, DEFAULT_MAX_YEAR as f, DEFAULT_MIN_YEAR as g } from "./bundle.es63.js";
|
|
5
|
+
import { Icon as C } from "./bundle.es35.js";
|
|
6
|
+
import { faChevronLeft as E, faChevronRight as T } from "@companix/icons-solid";
|
|
7
|
+
import { setMonth as _, setYear as F } from "./bundle.es57.js";
|
|
8
|
+
const y = ({
|
|
9
|
+
viewDate: n,
|
|
10
|
+
onChange: c,
|
|
11
|
+
isMonthDisabled: a,
|
|
12
|
+
isYearDisabled: m,
|
|
13
|
+
onNextMonth: N,
|
|
14
|
+
onPrevMonth: v
|
|
11
15
|
}) => {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
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;
|
|
16
|
+
const e = n.getFullYear(), r = n.getMonth(), s = "ru", M = u(
|
|
17
|
+
(t) => {
|
|
18
|
+
c(_(n, t));
|
|
29
19
|
},
|
|
30
|
-
[c,
|
|
31
|
-
),
|
|
32
|
-
(
|
|
33
|
-
|
|
34
|
-
let Y = n > o || o > h;
|
|
35
|
-
return c && (Y = Y || o > t.getFullYear()), r && (Y = Y || o < t.getFullYear()), Y;
|
|
20
|
+
[c, n]
|
|
21
|
+
), x = u(
|
|
22
|
+
(t) => {
|
|
23
|
+
c(F(n, t));
|
|
36
24
|
},
|
|
37
|
-
[c,
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
+
] });
|
|
48
74
|
};
|
|
49
75
|
export {
|
|
50
|
-
|
|
76
|
+
y as CalendarHeader
|
|
51
77
|
};
|
package/dist/bundle.es74.js
CHANGED
|
@@ -1,16 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { subMonths as L, addMonths as N, useDayDisableCheker as R } from "./bundle.es57.js";
|
|
2
|
+
import { DEFAULT_MIN_YEAR as w, DEFAULT_MAX_YEAR as A } from "./bundle.es63.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
|
|
11
|
+
}) => {
|
|
12
|
+
const [e, u] = U(p || /* @__PURE__ */ new Date()), _ = M(() => {
|
|
13
|
+
u(L(e, 1));
|
|
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
|
+
};
|
|
13
48
|
};
|
|
14
49
|
export {
|
|
15
|
-
|
|
50
|
+
X as useCalendar
|
|
16
51
|
};
|
package/dist/bundle.es8.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { jsx as I } from "react/jsx-runtime";
|
|
2
2
|
import B from "classnames";
|
|
3
3
|
import { forwardRef as L } from "react";
|
|
4
|
-
import { customCSS as i, px as r, attr as
|
|
5
|
-
const C = L((o,
|
|
4
|
+
import { customCSS as i, px as r, attr as m } from "@companix/utils-browser";
|
|
5
|
+
const C = L((o, s) => {
|
|
6
6
|
let {
|
|
7
|
-
interactionKind:
|
|
8
|
-
thumbPos:
|
|
9
|
-
thumbPadding:
|
|
10
|
-
heightAuto:
|
|
11
|
-
scrollX:
|
|
12
|
-
className:
|
|
7
|
+
interactionKind: g = "static",
|
|
8
|
+
thumbPos: h = "center",
|
|
9
|
+
thumbPadding: l = 4,
|
|
10
|
+
heightAuto: u,
|
|
11
|
+
scrollX: p,
|
|
12
|
+
className: b,
|
|
13
13
|
scrollY: n,
|
|
14
|
-
preventOnMouse:
|
|
15
|
-
onWheel:
|
|
16
|
-
maxHeight:
|
|
17
|
-
onScroll:
|
|
18
|
-
thumbColor:
|
|
14
|
+
preventOnMouse: f,
|
|
15
|
+
onWheel: w,
|
|
16
|
+
maxHeight: a,
|
|
17
|
+
onScroll: x,
|
|
18
|
+
thumbColor: d,
|
|
19
19
|
children: v
|
|
20
20
|
} = o;
|
|
21
21
|
const S = (() => {
|
|
22
22
|
if (o.implementation === "edge") {
|
|
23
|
-
|
|
23
|
+
l = 0;
|
|
24
24
|
const { padding: t, scrollbarWidth: e } = o;
|
|
25
25
|
return {
|
|
26
26
|
...i({ "--scrollbar-width": r(e) }),
|
|
@@ -28,15 +28,15 @@ const C = L((o, m) => {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
if (o.implementation === "outer") {
|
|
31
|
-
const { shadowPadding: t = 0, noneCorrect: e, scrollbarWidth:
|
|
31
|
+
const { shadowPadding: t = 0, noneCorrect: e, scrollbarWidth: c } = o;
|
|
32
32
|
return window.IS_MOBILE ? {
|
|
33
33
|
padding: t,
|
|
34
34
|
margin: -t
|
|
35
35
|
} : {
|
|
36
|
-
...i({ "--scrollbar-width": r(
|
|
36
|
+
...i({ "--scrollbar-width": r(c) }),
|
|
37
37
|
padding: t,
|
|
38
38
|
margin: -t,
|
|
39
|
-
marginRight: e ? void 0 : `calc(-${
|
|
39
|
+
marginRight: e ? void 0 : `calc(-${c}px - ${t}px)`,
|
|
40
40
|
marginBottom: 0
|
|
41
41
|
};
|
|
42
42
|
}
|
|
@@ -55,28 +55,28 @@ const C = L((o, m) => {
|
|
|
55
55
|
return /* @__PURE__ */ I(
|
|
56
56
|
"div",
|
|
57
57
|
{
|
|
58
|
-
ref:
|
|
59
|
-
onWheel:
|
|
60
|
-
onScroll:
|
|
58
|
+
ref: s,
|
|
59
|
+
onWheel: w,
|
|
60
|
+
onScroll: x,
|
|
61
61
|
onMouseDown: (t) => {
|
|
62
|
-
|
|
62
|
+
f && t.preventDefault();
|
|
63
63
|
},
|
|
64
64
|
style: {
|
|
65
65
|
...S,
|
|
66
66
|
...o.style,
|
|
67
|
-
maxHeight:
|
|
68
|
-
...i({ "--thumb-padding": r(
|
|
69
|
-
...i({ "--thumb-color":
|
|
67
|
+
maxHeight: a ? r(a) : void 0,
|
|
68
|
+
...i({ "--thumb-padding": r(l) }),
|
|
69
|
+
...d ? i({ "--thumb-color": d }) : {}
|
|
70
70
|
},
|
|
71
|
-
"data-scroll-x":
|
|
72
|
-
"data-scroll-y":
|
|
71
|
+
"data-scroll-x": m(p),
|
|
72
|
+
"data-scroll-y": m(n),
|
|
73
73
|
className: B(
|
|
74
74
|
!window.IS_MOBILE && "scrollable",
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
b,
|
|
76
|
+
u ? "" : "h-full",
|
|
77
77
|
{
|
|
78
|
-
"scrollable-hover-interaction":
|
|
79
|
-
"scrollable-border-position":
|
|
78
|
+
"scrollable-hover-interaction": g === "hover",
|
|
79
|
+
"scrollable-border-position": h === "border"
|
|
80
80
|
}
|
|
81
81
|
),
|
|
82
82
|
children: v
|