@companix/uikit 0.0.59 → 0.0.61
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/OptionsPopover.d.ts +41 -0
- package/dist/Select/SelectInput.d.ts +2 -1
- package/dist/Select/index.d.ts +5 -8
- package/dist/SelectTags/index.d.ts +7 -10
- package/dist/bundle.es12.js +74 -61
- package/dist/bundle.es13.js +2 -2
- package/dist/bundle.es15.js +1 -1
- package/dist/bundle.es21.js +1 -1
- package/dist/bundle.es22.js +1 -1
- package/dist/bundle.es23.js +1 -1
- package/dist/bundle.es26.js +1 -1
- package/dist/bundle.es27.js +71 -65
- package/dist/bundle.es28.js +4 -4
- package/dist/bundle.es29.js +2 -2
- package/dist/bundle.es32.js +2 -2
- package/dist/bundle.es36.js +1 -1
- package/dist/bundle.es40.js +1 -1
- package/dist/bundle.es41.js +1 -1
- package/dist/bundle.es42.js +1 -1
- package/dist/bundle.es48.js +39 -40
- package/dist/bundle.es50.js +66 -31
- package/dist/bundle.es51.js +24 -4
- package/dist/bundle.es52.js +35 -20
- package/dist/bundle.es53.js +5 -39
- package/dist/bundle.es54.js +14 -5
- package/dist/bundle.es55.js +13 -13
- package/dist/bundle.es56.js +69 -13
- package/dist/bundle.es57.js +66 -68
- package/dist/bundle.es58.js +69 -67
- package/dist/bundle.es59.js +10 -69
- package/dist/bundle.es60.js +42 -10
- package/dist/bundle.es61.js +14 -42
- package/dist/bundle.es62.js +32 -15
- package/dist/bundle.es63.js +61 -23
- package/dist/bundle.es64.js +13 -69
- package/dist/bundle.es65.js +74 -13
- package/dist/bundle.es66.js +45 -71
- package/dist/bundle.es67.js +13 -48
- package/package.json +1 -1
- package/dist/Select/SelectLoader.d.ts +0 -1
- package/dist/Select/SelectOptions.d.ts +0 -19
- package/dist/bundle.es68.js +0 -16
package/dist/bundle.es48.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { jsxs as o, jsx as
|
|
1
|
+
import { jsxs as o, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import A from "classnames";
|
|
3
|
-
import { attr as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { VisuallyHidden as
|
|
6
|
-
import { mergeRefs as
|
|
7
|
-
import { SelectRightElements as
|
|
8
|
-
const V =
|
|
3
|
+
import { attr as s } from "@companix/utils-browser";
|
|
4
|
+
import { forwardRef as w, useRef as y, useCallback as D } from "react";
|
|
5
|
+
import { VisuallyHidden as S } from "@radix-ui/react-visually-hidden";
|
|
6
|
+
import { mergeRefs as T } from "react-merge-refs";
|
|
7
|
+
import { SelectRightElements as j } from "./bundle.es59.js";
|
|
8
|
+
const V = w(
|
|
9
9
|
({
|
|
10
10
|
required: a,
|
|
11
|
-
size:
|
|
12
|
-
fill:
|
|
13
|
-
leftElement:
|
|
14
|
-
className:
|
|
15
|
-
value:
|
|
16
|
-
clearButton:
|
|
11
|
+
size: i,
|
|
12
|
+
fill: u,
|
|
13
|
+
leftElement: l,
|
|
14
|
+
className: d,
|
|
15
|
+
value: c,
|
|
16
|
+
clearButton: m,
|
|
17
17
|
placeholder: p,
|
|
18
|
-
clearButtonIcon:
|
|
18
|
+
clearButtonIcon: f,
|
|
19
19
|
disabled: r,
|
|
20
|
-
onClear:
|
|
21
|
-
inputRef:
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
const e =
|
|
20
|
+
onClear: h,
|
|
21
|
+
inputRef: C,
|
|
22
|
+
onClick: I
|
|
23
|
+
}, N) => {
|
|
24
|
+
const e = y(null), k = D(
|
|
25
25
|
(t) => {
|
|
26
26
|
if (!e.current || !document)
|
|
27
27
|
return;
|
|
@@ -31,51 +31,50 @@ const V = y(
|
|
|
31
31
|
), v = (t) => {
|
|
32
32
|
document && document.activeElement === e.current && t.preventDefault();
|
|
33
33
|
}, F = (t) => {
|
|
34
|
-
r ||
|
|
34
|
+
r || k(t);
|
|
35
35
|
}, g = (t) => {
|
|
36
36
|
v(t);
|
|
37
37
|
}, R = (t) => {
|
|
38
|
-
e.current && e.current.focus(),
|
|
38
|
+
e.current && e.current.focus(), h?.(t);
|
|
39
39
|
};
|
|
40
40
|
return /* @__PURE__ */ o(
|
|
41
41
|
"div",
|
|
42
42
|
{
|
|
43
|
-
ref:
|
|
44
|
-
className: A("form select",
|
|
45
|
-
"data-size":
|
|
46
|
-
"data-fill":
|
|
47
|
-
"data-required":
|
|
48
|
-
"data-disabled":
|
|
43
|
+
ref: N,
|
|
44
|
+
className: A("form select", d),
|
|
45
|
+
"data-size": i ?? "md",
|
|
46
|
+
"data-fill": s(u),
|
|
47
|
+
"data-required": s(a),
|
|
48
|
+
"data-disabled": s(r),
|
|
49
49
|
onMouseDown: g,
|
|
50
|
-
...i,
|
|
51
50
|
onClick: F,
|
|
52
51
|
children: [
|
|
53
52
|
/* @__PURE__ */ o("div", { className: "select-layout form-input", children: [
|
|
54
|
-
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
-
!
|
|
57
|
-
|
|
53
|
+
l && /* @__PURE__ */ n("div", { className: "select-element", children: l }),
|
|
54
|
+
/* @__PURE__ */ n("div", { className: "select-content", children: /* @__PURE__ */ o("div", { className: "select-content-text", "aria-disabled": r, children: [
|
|
55
|
+
!c && /* @__PURE__ */ n("span", { className: "select-placeholder", children: p }),
|
|
56
|
+
c
|
|
58
57
|
] }) }),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
|
|
58
|
+
/* @__PURE__ */ n("div", { className: "select-element", children: /* @__PURE__ */ n(
|
|
59
|
+
j,
|
|
61
60
|
{
|
|
62
|
-
clearButton:
|
|
63
|
-
value: !!
|
|
64
|
-
clearButtonIcon:
|
|
61
|
+
clearButton: m,
|
|
62
|
+
value: !!c,
|
|
63
|
+
clearButtonIcon: f,
|
|
65
64
|
onClear: R
|
|
66
65
|
}
|
|
67
66
|
) })
|
|
68
67
|
] }),
|
|
69
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ n(S, { asChild: !0, children: /* @__PURE__ */ n(
|
|
70
69
|
"input",
|
|
71
70
|
{
|
|
72
|
-
ref:
|
|
71
|
+
ref: T([C, e]),
|
|
73
72
|
autoComplete: "off",
|
|
74
73
|
autoCapitalize: "none",
|
|
75
74
|
autoCorrect: "off",
|
|
76
75
|
spellCheck: "false",
|
|
77
76
|
"aria-autocomplete": "none",
|
|
78
|
-
onClick:
|
|
77
|
+
onClick: I,
|
|
79
78
|
readOnly: !0
|
|
80
79
|
}
|
|
81
80
|
) })
|
package/dist/bundle.es50.js
CHANGED
|
@@ -1,46 +1,81 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useEffect as O } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { jsx as i, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as h, useEffect as O } from "react";
|
|
3
|
+
import { Spinner as L } from "./bundle.es6.js";
|
|
4
|
+
import { OptionItem as u } from "./bundle.es14.js";
|
|
5
|
+
import { OptionsList as C } from "./bundle.es16.js";
|
|
6
|
+
import { Icon as R } from "./bundle.es33.js";
|
|
7
|
+
import { faPlus as S } from "@companix/icons-solid";
|
|
8
|
+
const b = () => ({ isLoading: !1, options: [] }), k = (s) => {
|
|
9
|
+
const { onOptionsLoaded: n, useOptions: r = b, options: o } = s, t = r();
|
|
10
|
+
return O(() => {
|
|
11
|
+
t.options.length > 0 && n?.(t.options);
|
|
12
|
+
}, [t.options]), o ? { options: o, isLoading: void 0 } : t;
|
|
13
|
+
}, z = (s) => {
|
|
14
|
+
const {
|
|
15
|
+
isActive: n,
|
|
16
|
+
emptyText: r,
|
|
17
|
+
scrollboxRef: o,
|
|
18
|
+
optionsWrapperRef: t,
|
|
19
|
+
addOption: c,
|
|
20
|
+
onOpened: p,
|
|
21
|
+
onSelect: a,
|
|
22
|
+
minimalOptions: m,
|
|
23
|
+
filterOptions: l,
|
|
24
|
+
disableFiltering: e,
|
|
25
|
+
...d
|
|
26
|
+
} = s, { options: f, isLoading: v } = k(d), x = h(() => l && !e ? f.filter(l) : f, [f, l, e]);
|
|
27
|
+
return v ? /* @__PURE__ */ i("div", { className: "select-popover-loading", children: /* @__PURE__ */ i(L, { size: 24 }) }) : /* @__PURE__ */ i(
|
|
28
|
+
y,
|
|
29
|
+
{
|
|
30
|
+
options: x,
|
|
31
|
+
isActive: n,
|
|
32
|
+
emptyText: r,
|
|
33
|
+
scrollboxRef: o,
|
|
34
|
+
optionsWrapperRef: t,
|
|
35
|
+
minimalOptions: m,
|
|
36
|
+
addOption: c,
|
|
37
|
+
onOpened: p,
|
|
38
|
+
onSelect: a
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}, y = (s) => {
|
|
8
42
|
const {
|
|
9
|
-
isActive:
|
|
10
|
-
onOpened:
|
|
11
|
-
addOption:
|
|
12
|
-
scrollboxRef:
|
|
13
|
-
optionsWrapperRef:
|
|
14
|
-
options:
|
|
15
|
-
onSelect:
|
|
16
|
-
minimalOptions:
|
|
17
|
-
emptyText:
|
|
43
|
+
isActive: n,
|
|
44
|
+
onOpened: r,
|
|
45
|
+
addOption: o,
|
|
46
|
+
scrollboxRef: t,
|
|
47
|
+
optionsWrapperRef: c,
|
|
48
|
+
options: p,
|
|
49
|
+
onSelect: a,
|
|
50
|
+
minimalOptions: m,
|
|
51
|
+
emptyText: l = "Ничего не найдено"
|
|
18
52
|
} = s;
|
|
19
53
|
return O(() => {
|
|
20
|
-
|
|
21
|
-
}, []), /* @__PURE__ */
|
|
22
|
-
|
|
23
|
-
|
|
54
|
+
r?.(p.findIndex((e) => n(e.value)));
|
|
55
|
+
}, []), /* @__PURE__ */ g(C, { scrollboxRef: t, optionsWrapperRef: c, maxHeight: 300, children: [
|
|
56
|
+
o && /* @__PURE__ */ i(
|
|
57
|
+
u,
|
|
24
58
|
{
|
|
25
59
|
className: "select-add-option",
|
|
26
|
-
icon: /* @__PURE__ */
|
|
27
|
-
title:
|
|
28
|
-
onClick:
|
|
60
|
+
icon: /* @__PURE__ */ i(R, { icon: S }),
|
|
61
|
+
title: o.text,
|
|
62
|
+
onClick: o.onClick
|
|
29
63
|
}
|
|
30
64
|
),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
65
|
+
p.length === 0 && !o && /* @__PURE__ */ i("div", { className: "select-tags-empty", children: l }),
|
|
66
|
+
p.map((e, d) => /* @__PURE__ */ i(
|
|
67
|
+
u,
|
|
34
68
|
{
|
|
35
|
-
active:
|
|
36
|
-
onClick: () =>
|
|
37
|
-
minimal:
|
|
38
|
-
...
|
|
69
|
+
active: n(e.value),
|
|
70
|
+
onClick: () => a?.(e.value),
|
|
71
|
+
minimal: m,
|
|
72
|
+
...e
|
|
39
73
|
},
|
|
40
74
|
`select-option-${d}`
|
|
41
75
|
))
|
|
42
76
|
] });
|
|
43
77
|
};
|
|
44
78
|
export {
|
|
45
|
-
|
|
79
|
+
z as OptionsPopover,
|
|
80
|
+
y as SelectOptionsList
|
|
46
81
|
};
|
package/dist/bundle.es51.js
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as m, useCallback as i } from "react";
|
|
3
|
+
import c from "react-input-mask";
|
|
4
|
+
const I = m(
|
|
5
|
+
({ mask: r, maskChar: f = "_", onChange: n, onValueChange: o, ...a }, e) => {
|
|
6
|
+
const p = i(
|
|
7
|
+
(t) => {
|
|
8
|
+
n?.(t), o?.(t.target.value, t.target);
|
|
9
|
+
},
|
|
10
|
+
[n, o]
|
|
11
|
+
);
|
|
12
|
+
return r ? /* @__PURE__ */ u(
|
|
13
|
+
c,
|
|
14
|
+
{
|
|
15
|
+
inputRef: e,
|
|
16
|
+
mask: r,
|
|
17
|
+
maskChar: f,
|
|
18
|
+
onChange: p,
|
|
19
|
+
...a
|
|
20
|
+
}
|
|
21
|
+
) : /* @__PURE__ */ u("input", { ref: e, ...a, onChange: p });
|
|
22
|
+
}
|
|
23
|
+
);
|
|
4
24
|
export {
|
|
5
|
-
|
|
25
|
+
I as InputElement
|
|
6
26
|
};
|
package/dist/bundle.es52.js
CHANGED
|
@@ -1,26 +1,41 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsxs as b, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import h from "classnames";
|
|
3
|
+
import { attr as e } from "@companix/utils-browser";
|
|
4
|
+
import { forwardRef as x } from "react";
|
|
5
|
+
import { useInputPadding as N } from "./bundle.es64.js";
|
|
6
|
+
const v = x(
|
|
7
|
+
({
|
|
8
|
+
required: s,
|
|
9
|
+
disabled: t,
|
|
10
|
+
size: i,
|
|
11
|
+
fill: d,
|
|
12
|
+
leftElement: r,
|
|
13
|
+
rightElement: a,
|
|
14
|
+
className: f,
|
|
15
|
+
inputRef: m,
|
|
16
|
+
children: n,
|
|
17
|
+
...p
|
|
18
|
+
}, c) => {
|
|
19
|
+
const { leftRef: l, rightRef: u } = N(m, [r, a]);
|
|
20
|
+
return /* @__PURE__ */ b(
|
|
21
|
+
"div",
|
|
14
22
|
{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
ref: c,
|
|
24
|
+
className: h("form", f),
|
|
25
|
+
"data-size": i ?? "md",
|
|
26
|
+
"data-fill": e(d),
|
|
27
|
+
"data-required": e(s),
|
|
28
|
+
"data-disabled": e(t),
|
|
29
|
+
...p,
|
|
30
|
+
children: [
|
|
31
|
+
r && /* @__PURE__ */ o("span", { ref: l, className: "form-input-base-left-element", children: r }),
|
|
32
|
+
n,
|
|
33
|
+
a && /* @__PURE__ */ o("span", { ref: u, className: "form-input-base-right-element", children: a })
|
|
34
|
+
]
|
|
20
35
|
}
|
|
21
|
-
)
|
|
36
|
+
);
|
|
22
37
|
}
|
|
23
38
|
);
|
|
24
39
|
export {
|
|
25
|
-
|
|
40
|
+
v as InputContainer
|
|
26
41
|
};
|
package/dist/bundle.es53.js
CHANGED
|
@@ -1,41 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { useInputPadding as N } from "./bundle.es65.js";
|
|
6
|
-
const v = x(
|
|
7
|
-
({
|
|
8
|
-
required: s,
|
|
9
|
-
disabled: t,
|
|
10
|
-
size: i,
|
|
11
|
-
fill: d,
|
|
12
|
-
leftElement: r,
|
|
13
|
-
rightElement: a,
|
|
14
|
-
className: f,
|
|
15
|
-
inputRef: m,
|
|
16
|
-
children: n,
|
|
17
|
-
...p
|
|
18
|
-
}, c) => {
|
|
19
|
-
const { leftRef: l, rightRef: u } = N(m, [r, a]);
|
|
20
|
-
return /* @__PURE__ */ b(
|
|
21
|
-
"div",
|
|
22
|
-
{
|
|
23
|
-
ref: c,
|
|
24
|
-
className: h("form", f),
|
|
25
|
-
"data-size": i ?? "md",
|
|
26
|
-
"data-fill": e(d),
|
|
27
|
-
"data-required": e(s),
|
|
28
|
-
"data-disabled": e(t),
|
|
29
|
-
...p,
|
|
30
|
-
children: [
|
|
31
|
-
r && /* @__PURE__ */ o("span", { ref: l, className: "form-input-base-left-element", children: r }),
|
|
32
|
-
n,
|
|
33
|
-
a && /* @__PURE__ */ o("span", { ref: u, className: "form-input-base-right-element", children: a })
|
|
34
|
-
]
|
|
35
|
-
}
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
);
|
|
1
|
+
import { useEffect as r } from "react";
|
|
2
|
+
const n = ({ callback: e }) => (r(() => () => {
|
|
3
|
+
e?.();
|
|
4
|
+
}, []), null);
|
|
39
5
|
export {
|
|
40
|
-
|
|
6
|
+
n as RemoveListener
|
|
41
7
|
};
|
package/dist/bundle.es54.js
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
e
|
|
4
|
-
|
|
1
|
+
import { useState as e } from "react";
|
|
2
|
+
const d = ({ onClick: t }) => {
|
|
3
|
+
const [a, s] = e({ isLoading: !1, isError: !1 });
|
|
4
|
+
return { ...a, handleClick: (r) => {
|
|
5
|
+
a.isLoading || t(() => {
|
|
6
|
+
s({ isLoading: !0, isError: !1 });
|
|
7
|
+
}, r).then(() => {
|
|
8
|
+
s({ isLoading: !1, isError: !1 });
|
|
9
|
+
}).catch(() => {
|
|
10
|
+
s({ isLoading: !1, isError: !0 });
|
|
11
|
+
});
|
|
12
|
+
} };
|
|
13
|
+
};
|
|
5
14
|
export {
|
|
6
|
-
|
|
15
|
+
d as useLoading
|
|
7
16
|
};
|
package/dist/bundle.es55.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { useRef as i, useCallback as o } from "react";
|
|
2
|
+
const f = (e, s) => {
|
|
3
|
+
const r = i(null), c = i(void 0), n = o(
|
|
4
|
+
(t) => {
|
|
5
|
+
s && t.offsetParent && (t.style.height = "", t.style.height = `${t.scrollHeight}px`, t.scrollHeight !== c.current && e && (e(t), c.current = t.scrollHeight));
|
|
6
|
+
},
|
|
7
|
+
[s, e]
|
|
8
|
+
), l = o(() => {
|
|
9
|
+
const t = r.current;
|
|
10
|
+
t && n(t);
|
|
11
|
+
}, [r, n]);
|
|
12
|
+
return [r, l];
|
|
13
13
|
};
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
f as useResizeTextarea
|
|
16
16
|
};
|
package/dist/bundle.es56.js
CHANGED
|
@@ -1,16 +1,72 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as D, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { dateToFormat as $, weeks as g, createVoids as p, getDayIndex as b, getFirstDay as u, getMonthMaxDay as k } from "./bundle.es58.js";
|
|
3
|
+
import { CalendarHeader as F } from "./bundle.es65.js";
|
|
4
|
+
import { useCalendar as j } from "./bundle.es66.js";
|
|
5
|
+
import { attr as m } from "@companix/utils-browser";
|
|
6
|
+
import { isSameDate as f } from "./bundle.es57.js";
|
|
7
|
+
import { useLayoutEffect as I } from "react";
|
|
8
|
+
const T = ({ disablePickers: c, value: e, onChange: i, ...l }) => {
|
|
9
|
+
const {
|
|
10
|
+
viewDate: n,
|
|
11
|
+
setViewDate: r,
|
|
12
|
+
setNextMonth: N,
|
|
13
|
+
setPrevMonth: x,
|
|
14
|
+
isMonthDisabled: M,
|
|
15
|
+
isYearDisabled: v,
|
|
16
|
+
isDayDisabled: w
|
|
17
|
+
} = j(l);
|
|
18
|
+
I(() => {
|
|
19
|
+
e && r(e);
|
|
20
|
+
}, [e]);
|
|
21
|
+
const o = $(n), h = n.getMonth(), y = n.getFullYear(), C = /* @__PURE__ */ new Date();
|
|
22
|
+
return /* @__PURE__ */ D("div", { className: "calendar", children: [
|
|
23
|
+
/* @__PURE__ */ t(
|
|
24
|
+
F,
|
|
25
|
+
{
|
|
26
|
+
viewDate: n,
|
|
27
|
+
onChange: r,
|
|
28
|
+
onNextMonth: N,
|
|
29
|
+
onPrevMonth: x,
|
|
30
|
+
disablePickers: c,
|
|
31
|
+
isMonthDisabled: M,
|
|
32
|
+
isYearDisabled: v
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
/* @__PURE__ */ t("div", { className: "calendar-names", children: g.map((d, a) => /* @__PURE__ */ t("div", { className: "calendar-name", children: d }, `week-name-${a}`)) }),
|
|
36
|
+
/* @__PURE__ */ D("div", { className: "calendar-days", children: [
|
|
37
|
+
p(b(u(o.month, o.year))).map((d, a) => /* @__PURE__ */ t("div", { className: "calendar-day", "data-void": !0 }, `void-${d}-${a}`)),
|
|
38
|
+
p(k(o.month, o.year)).map((d, a) => {
|
|
39
|
+
const s = new Date(y, h, a + 1);
|
|
40
|
+
return /* @__PURE__ */ t(
|
|
41
|
+
P,
|
|
42
|
+
{
|
|
43
|
+
day: a + 1,
|
|
44
|
+
disabled: w(s),
|
|
45
|
+
selected: !!(e && f(e, s)),
|
|
46
|
+
today: f(s, C),
|
|
47
|
+
onSelect: () => i?.(s)
|
|
48
|
+
},
|
|
49
|
+
`date-${d}-${y}-${h}-${a}`
|
|
50
|
+
);
|
|
51
|
+
})
|
|
52
|
+
] })
|
|
53
|
+
] });
|
|
54
|
+
}, P = ({ day: c, disabled: e, selected: i, today: l, onSelect: n }) => {
|
|
55
|
+
const r = () => {
|
|
56
|
+
e || n?.();
|
|
57
|
+
};
|
|
58
|
+
return /* @__PURE__ */ t(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
className: "calendar-day",
|
|
62
|
+
"data-disabled": m(e),
|
|
63
|
+
"data-selected": m(i),
|
|
64
|
+
"data-today": m(l),
|
|
65
|
+
onClick: r,
|
|
66
|
+
children: /* @__PURE__ */ t("span", { className: "calendar-day-number", children: c })
|
|
67
|
+
}
|
|
68
|
+
);
|
|
13
69
|
};
|
|
14
70
|
export {
|
|
15
|
-
|
|
71
|
+
T as Calendar
|
|
16
72
|
};
|
package/dist/bundle.es57.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
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
`date-${d}-${y}-${h}-${a}`
|
|
50
|
-
);
|
|
51
|
-
})
|
|
52
|
-
] })
|
|
53
|
-
] });
|
|
54
|
-
}, P = ({ day: c, disabled: e, selected: i, today: l, onSelect: n }) => {
|
|
55
|
-
const r = () => {
|
|
56
|
-
e || n?.();
|
|
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;
|
|
57
48
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
);
|
|
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]);
|
|
69
58
|
};
|
|
70
59
|
export {
|
|
71
|
-
|
|
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
|
};
|