@companix/uikit 0.0.80 → 0.0.82
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 +4 -0
- package/dist/__helpers/{createDialogRegistry.d.ts → createPopupRegistry.d.ts} +7 -3
- package/dist/bundle.es.js +32 -31
- package/dist/bundle.es45.js +38 -33
- package/dist/bundle.es57.js +1 -1
- package/dist/bundle.es60.js +2 -2
- package/dist/bundle.es67.js +13 -74
- package/dist/bundle.es68.js +71 -45
- package/dist/bundle.es69.js +48 -13
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
package/dist/Button/Button.scss
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DialogProps } from '../Dialog';
|
|
2
|
+
import { DrawerProps } from '../Drawer';
|
|
2
3
|
export interface PopupProps<T> {
|
|
3
4
|
data: T;
|
|
4
5
|
close: () => void;
|
|
@@ -19,8 +20,11 @@ type PopupsRegistry<T extends Store> = {
|
|
|
19
20
|
Close: CloseAgent<T>;
|
|
20
21
|
Open: OpenAgent<T>;
|
|
21
22
|
};
|
|
22
|
-
export declare const
|
|
23
|
-
interface
|
|
23
|
+
export declare const createPopupRegistry: <T extends Store>(mapping: T) => PopupsRegistry<T>;
|
|
24
|
+
interface DialogShellProps extends Omit<DialogProps, 'open' | 'onOpenChange' | 'onClosed'> {
|
|
24
25
|
}
|
|
25
|
-
export declare const DialogShell: ({ children, ...props }:
|
|
26
|
+
export declare const DialogShell: ({ children, ...props }: DialogShellProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
interface DrawerShellProps extends Omit<DrawerProps, 'open' | 'onOpenChange' | 'onClosed'> {
|
|
28
|
+
}
|
|
29
|
+
export declare const DrawerShell: ({ children, ...props }: DrawerShellProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
30
|
export {};
|
package/dist/bundle.es.js
CHANGED
|
@@ -2,17 +2,17 @@ import { Avatar as e } from "./bundle.es2.js";
|
|
|
2
2
|
import { avatarSizes as p } from "./bundle.es3.js";
|
|
3
3
|
import { Button as x } from "./bundle.es4.js";
|
|
4
4
|
import { ButtonGroup as a } from "./bundle.es5.js";
|
|
5
|
-
import { Spinner as
|
|
5
|
+
import { Spinner as l } from "./bundle.es6.js";
|
|
6
6
|
import { Scrollable as n } from "./bundle.es7.js";
|
|
7
|
-
import { ImitateScroll as
|
|
8
|
-
import { Segments as
|
|
7
|
+
import { ImitateScroll as s } from "./bundle.es8.js";
|
|
8
|
+
import { Segments as g } from "./bundle.es9.js";
|
|
9
9
|
import { Popover as h } from "./bundle.es10.js";
|
|
10
|
-
import { Tooltip as
|
|
10
|
+
import { Tooltip as v } from "./bundle.es11.js";
|
|
11
11
|
import { Select as B } from "./bundle.es12.js";
|
|
12
12
|
import { SelectTags as R } from "./bundle.es13.js";
|
|
13
13
|
import { Input as k } from "./bundle.es14.js";
|
|
14
14
|
import { OptionItem as b } from "./bundle.es15.js";
|
|
15
|
-
import { NumberInput as
|
|
15
|
+
import { NumberInput as L } from "./bundle.es16.js";
|
|
16
16
|
import { OptionsList as C } from "./bundle.es17.js";
|
|
17
17
|
import { Checkbox as O } from "./bundle.es18.js";
|
|
18
18
|
import { Switch as z } from "./bundle.es19.js";
|
|
@@ -29,22 +29,22 @@ import { DateInput as to } from "./bundle.es29.js";
|
|
|
29
29
|
import { FileOverlay as mo } from "./bundle.es30.js";
|
|
30
30
|
import { FormGroup as fo } from "./bundle.es31.js";
|
|
31
31
|
import { TimePicker as io } from "./bundle.es32.js";
|
|
32
|
-
import { Icon as
|
|
33
|
-
import { ProgressBar as
|
|
34
|
-
import { Skeleton as
|
|
32
|
+
import { Icon as co } from "./bundle.es33.js";
|
|
33
|
+
import { ProgressBar as So } from "./bundle.es34.js";
|
|
34
|
+
import { Skeleton as uo } from "./bundle.es35.js";
|
|
35
35
|
import { Blank as To } from "./bundle.es36.js";
|
|
36
|
-
import { ProgressRing as
|
|
37
|
-
import { ThemeProvider as
|
|
36
|
+
import { ProgressRing as Po } from "./bundle.es37.js";
|
|
37
|
+
import { ThemeProvider as Do, useTheme as Bo } from "./bundle.es38.js";
|
|
38
38
|
import { ColorSchemeScript as Ro, colorSchemeScript as ko } from "./bundle.es39.js";
|
|
39
39
|
import { useLocalStorage as bo } from "./bundle.es40.js";
|
|
40
|
-
import { useBooleanState as
|
|
40
|
+
import { useBooleanState as Lo } from "./bundle.es41.js";
|
|
41
41
|
import { createAlertAgent as Co } from "./bundle.es42.js";
|
|
42
42
|
import { createToaster as Oo } from "./bundle.es43.js";
|
|
43
43
|
import { Toast as zo } from "./bundle.es44.js";
|
|
44
|
-
import { DialogShell as jo,
|
|
45
|
-
import { createPopoversRegistry as
|
|
46
|
-
import { createScope as
|
|
47
|
-
import { RemoveListener as
|
|
44
|
+
import { DialogShell as jo, DrawerShell as qo, createPopupRegistry as Eo } from "./bundle.es45.js";
|
|
45
|
+
import { createPopoversRegistry as Jo } from "./bundle.es46.js";
|
|
46
|
+
import { createScope as Mo, createStaticScope as Qo } from "./bundle.es47.js";
|
|
47
|
+
import { RemoveListener as Vo } from "./bundle.es48.js";
|
|
48
48
|
export {
|
|
49
49
|
Q as AlertDialog,
|
|
50
50
|
e as Avatar,
|
|
@@ -59,43 +59,44 @@ export {
|
|
|
59
59
|
K as Dialog,
|
|
60
60
|
jo as DialogShell,
|
|
61
61
|
H as Drawer,
|
|
62
|
+
qo as DrawerShell,
|
|
62
63
|
mo as FileOverlay,
|
|
63
64
|
fo as FormGroup,
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
co as Icon,
|
|
66
|
+
s as ImitateScroll,
|
|
66
67
|
k as Input,
|
|
67
68
|
V as LoadingButton,
|
|
68
|
-
|
|
69
|
+
L as NumberInput,
|
|
69
70
|
b as OptionItem,
|
|
70
71
|
C as OptionsList,
|
|
71
72
|
h as Popover,
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
So as ProgressBar,
|
|
74
|
+
Po as ProgressRing,
|
|
74
75
|
j as Radio,
|
|
75
76
|
q as RadioGroup,
|
|
76
|
-
|
|
77
|
+
Vo as RemoveListener,
|
|
77
78
|
n as Scrollable,
|
|
78
|
-
|
|
79
|
+
g as Segments,
|
|
79
80
|
B as Select,
|
|
80
81
|
R as SelectTags,
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
uo as Skeleton,
|
|
83
|
+
l as Spinner,
|
|
83
84
|
z as Switch,
|
|
84
85
|
X as Tabs,
|
|
85
86
|
$ as TextArea,
|
|
86
|
-
|
|
87
|
+
Do as ThemeProvider,
|
|
87
88
|
io as TimePicker,
|
|
88
89
|
zo as Toast,
|
|
89
|
-
|
|
90
|
+
v as Tooltip,
|
|
90
91
|
p as avatarSizes,
|
|
91
92
|
ko as colorSchemeScript,
|
|
92
93
|
Co as createAlertAgent,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
Jo as createPopoversRegistry,
|
|
95
|
+
Eo as createPopupRegistry,
|
|
96
|
+
Mo as createScope,
|
|
97
|
+
Qo as createStaticScope,
|
|
97
98
|
Oo as createToaster,
|
|
98
|
-
|
|
99
|
+
Lo as useBooleanState,
|
|
99
100
|
bo as useLocalStorage,
|
|
100
101
|
Bo as useTheme
|
|
101
102
|
};
|
package/dist/bundle.es45.js
CHANGED
|
@@ -1,45 +1,50 @@
|
|
|
1
|
-
import { jsx as r, Fragment as
|
|
2
|
-
import { useContext as C, createContext as
|
|
3
|
-
import { Dialog as D } from "./bundle.es22.js";
|
|
1
|
+
import { jsx as r, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as C, createContext as x, useState as P, useEffect as g, useCallback as u } from "react";
|
|
4
3
|
import { hash as v } from "@companix/utils-js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import { Dialog as w } from "./bundle.es22.js";
|
|
5
|
+
import { Drawer as D } from "./bundle.es21.js";
|
|
6
|
+
const j = (o) => {
|
|
7
|
+
const t = {}, e = {}, p = [], c = v();
|
|
8
|
+
for (const n in o)
|
|
9
|
+
t[n] = () => {
|
|
10
|
+
}, e[n] = () => {
|
|
11
|
+
}, p.push(() => /* @__PURE__ */ r(S, { Open: t, Close: e, name: n, Content: o[n] }));
|
|
11
12
|
return {
|
|
12
|
-
Open:
|
|
13
|
-
Close:
|
|
14
|
-
Overlay: () => /* @__PURE__ */ r(
|
|
13
|
+
Open: t,
|
|
14
|
+
Close: e,
|
|
15
|
+
Overlay: () => /* @__PURE__ */ r(h, { children: p.map((n, s) => /* @__PURE__ */ r(n, {}, `popup-${c}-${s}`)) })
|
|
15
16
|
};
|
|
16
|
-
},
|
|
17
|
-
const [{ data: c, open:
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
}, S = ({ name: o, Open: t, Close: e, Content: p }) => {
|
|
18
|
+
const [{ data: c, open: n }, s] = P({ data: null, open: !1 });
|
|
19
|
+
g(() => {
|
|
20
|
+
t[o] = (a) => {
|
|
20
21
|
s({ data: a, open: !0 });
|
|
21
|
-
},
|
|
22
|
-
|
|
22
|
+
}, e[o] = () => {
|
|
23
|
+
n && l();
|
|
23
24
|
};
|
|
24
25
|
}, []);
|
|
25
|
-
const
|
|
26
|
+
const l = u(() => {
|
|
26
27
|
s(({ data: a }) => ({ data: a, open: !1 }));
|
|
27
|
-
}, []),
|
|
28
|
+
}, []), d = u(() => {
|
|
28
29
|
s({ data: null, open: !1 });
|
|
29
|
-
}, []),
|
|
30
|
-
a ||
|
|
30
|
+
}, []), m = u((a) => {
|
|
31
|
+
a || l();
|
|
31
32
|
}, []);
|
|
32
|
-
return c ? /* @__PURE__ */ r(i.Provider, { value: { open:
|
|
33
|
-
}, i =
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
36
|
-
throw new Error("
|
|
37
|
-
return
|
|
38
|
-
},
|
|
39
|
-
const
|
|
40
|
-
return /* @__PURE__ */ r(
|
|
33
|
+
return c ? /* @__PURE__ */ r(i.Provider, { value: { open: n, onOpenChange: m, onClosed: d }, children: /* @__PURE__ */ r(p, { data: c, close: l }) }) : null;
|
|
34
|
+
}, i = x(null), f = () => {
|
|
35
|
+
const o = C(i);
|
|
36
|
+
if (!o)
|
|
37
|
+
throw new Error("Popup context not provided");
|
|
38
|
+
return o;
|
|
39
|
+
}, k = ({ children: o, ...t }) => {
|
|
40
|
+
const e = f();
|
|
41
|
+
return /* @__PURE__ */ r(w, { ...e, ...t, children: o });
|
|
42
|
+
}, F = ({ children: o, ...t }) => {
|
|
43
|
+
const e = f();
|
|
44
|
+
return /* @__PURE__ */ r(D, { ...e, ...t, children: o });
|
|
41
45
|
};
|
|
42
46
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
k as DialogShell,
|
|
48
|
+
F as DrawerShell,
|
|
49
|
+
j as createPopupRegistry
|
|
45
50
|
};
|
package/dist/bundle.es57.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.es67.js";
|
|
6
6
|
const v = x(
|
|
7
7
|
({
|
|
8
8
|
required: s,
|
package/dist/bundle.es60.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.es55.js";
|
|
3
|
-
import { CalendarHeader as F } from "./bundle.
|
|
4
|
-
import { useCalendar as j } from "./bundle.
|
|
3
|
+
import { CalendarHeader as F } from "./bundle.es68.js";
|
|
4
|
+
import { useCalendar as j } from "./bundle.es69.js";
|
|
5
5
|
import { attr as m } from "@companix/utils-browser";
|
|
6
6
|
import { isSameDate as f } from "./bundle.es61.js";
|
|
7
7
|
import { useLayoutEffect as I } from "react";
|
package/dist/bundle.es67.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.es70.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.es68.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.es12.js";
|
|
4
|
+
import { getMonths as k, getYears as z, DEFAULT_MAX_YEAR as f, DEFAULT_MIN_YEAR as g } from "./bundle.es55.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.es61.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.es69.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.es61.js";
|
|
2
|
+
import { DEFAULT_MIN_YEAR as w, DEFAULT_MAX_YEAR as A } from "./bundle.es55.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));
|
|
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/index.d.ts
CHANGED
|
@@ -79,9 +79,9 @@ export { Toast } from './Toaster/Toast';
|
|
|
79
79
|
export * from './types';
|
|
80
80
|
export type { CalendarProps } from './Calendar/Calendar';
|
|
81
81
|
export type { OptionsSource, UseOptionsResponse } from './Select/OptionsPopover';
|
|
82
|
-
export {
|
|
82
|
+
export { createPopupRegistry, DialogShell, DrawerShell } from './__helpers/createPopupRegistry';
|
|
83
83
|
export { createPopoversRegistry } from './__helpers/createPopoversRegistry';
|
|
84
84
|
export { createScope, createStaticScope } from './__helpers/createScope';
|
|
85
|
-
export type { PopupProps } from './__helpers/
|
|
85
|
+
export type { PopupProps } from './__helpers/createPopupRegistry';
|
|
86
86
|
export type { PopoverContentProps } from './__helpers/createPopoversRegistry';
|
|
87
87
|
export { RemoveListener } from './__utils/RemoveListener';
|