@companix/uikit 0.0.19 → 0.0.20
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/bundle.es10.js +14 -14
- package/dist/bundle.es14.js +11 -11
- package/dist/bundle.es19.js +1 -1
- package/dist/bundle.es20.js +1 -1
- package/dist/bundle.es23.js +1 -1
- package/dist/bundle.es24.js +35 -34
- package/dist/bundle.es25.js +4 -4
- package/dist/bundle.es26.js +2 -2
- package/dist/bundle.es29.js +2 -2
- package/dist/bundle.es31.js +1 -1
- package/dist/bundle.es32.js +1 -1
- package/dist/bundle.es34.js +1 -1
- package/dist/bundle.es38.js +1 -1
- package/dist/bundle.es40.js +3 -5
- package/dist/bundle.es41.js +5 -14
- package/dist/bundle.es42.js +13 -13
- package/dist/bundle.es43.js +13 -69
- package/dist/bundle.es44.js +3 -68
- package/dist/bundle.es45.js +3 -70
- package/dist/bundle.es46.js +68 -9
- package/dist/bundle.es47.js +66 -41
- package/dist/bundle.es48.js +69 -31
- package/dist/bundle.es49.js +12 -68
- package/dist/bundle.es50.js +41 -12
- package/dist/bundle.es51.js +31 -42
- package/dist/bundle.es52.js +68 -75
- package/dist/bundle.es53.js +20 -49
- package/dist/bundle.es54.js +2 -14
- package/dist/bundle.es55.js +45 -0
- package/dist/bundle.es56.js +22 -0
- package/dist/bundle.es57.js +4 -0
- package/dist/bundle.es58.js +23 -0
- package/dist/bundle.es59.js +4 -0
- package/dist/bundle.es60.js +22 -0
- package/dist/bundle.es61.js +16 -0
- package/dist/bundle.es62.js +78 -0
- package/dist/bundle.es63.js +51 -0
- package/dist/bundle.es64.js +4 -0
- package/dist/bundle.es65.js +16 -0
- package/dist/bundle.es66.js +5 -0
- package/dist/bundle.es67.js +5 -0
- package/dist/bundle.es68.js +22 -0
- package/dist/bundle.es69.js +4 -0
- package/dist/bundle.es70.js +22 -0
- package/dist/bundle.es71.js +4 -0
- package/package.json +1 -1
package/dist/bundle.es10.js
CHANGED
|
@@ -3,36 +3,36 @@ import N from "classnames";
|
|
|
3
3
|
import { Icon as v } from "./bundle.es39.js";
|
|
4
4
|
import { attr as t } from "@companix/utils-browser";
|
|
5
5
|
import { forwardRef as k } from "react";
|
|
6
|
-
import {
|
|
7
|
-
const
|
|
8
|
-
({ title:
|
|
6
|
+
import { f as x } from "./bundle.es40.js";
|
|
7
|
+
const E = k(
|
|
8
|
+
({ title: s, icon: c, active: e, label: n, disabled: a, minimal: r, onClick: d, className: l, ...m }, p) => {
|
|
9
9
|
const f = (h) => {
|
|
10
|
-
|
|
10
|
+
a || d?.(h);
|
|
11
11
|
};
|
|
12
12
|
return /* @__PURE__ */ i(
|
|
13
13
|
"div",
|
|
14
14
|
{
|
|
15
15
|
ref: p,
|
|
16
|
-
...
|
|
17
|
-
className: N("option",
|
|
18
|
-
"data-selected": t(
|
|
19
|
-
"data-disabled": t(
|
|
20
|
-
"data-minimal": t(
|
|
16
|
+
...m,
|
|
17
|
+
className: N("option", l),
|
|
18
|
+
"data-selected": t(e),
|
|
19
|
+
"data-disabled": t(a),
|
|
20
|
+
"data-minimal": t(r),
|
|
21
21
|
onClick: f,
|
|
22
22
|
children: [
|
|
23
23
|
/* @__PURE__ */ i("div", { className: "option-content", children: [
|
|
24
|
-
|
|
24
|
+
c && /* @__PURE__ */ o("div", { className: "option-icon", children: c }),
|
|
25
25
|
/* @__PURE__ */ i("div", { className: "option-content-layout", children: [
|
|
26
|
-
/* @__PURE__ */ o("div", { className: "option-title", children:
|
|
27
|
-
|
|
26
|
+
/* @__PURE__ */ o("div", { className: "option-title", children: s }),
|
|
27
|
+
n && /* @__PURE__ */ o("div", { className: "option-label", children: n })
|
|
28
28
|
] })
|
|
29
29
|
] }),
|
|
30
|
-
|
|
30
|
+
e && !r && /* @__PURE__ */ o("div", { className: "option-check", children: /* @__PURE__ */ o(v, { icon: x.faCheck }) })
|
|
31
31
|
]
|
|
32
32
|
}
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
);
|
|
36
36
|
export {
|
|
37
|
-
|
|
37
|
+
E as OptionItem
|
|
38
38
|
};
|
package/dist/bundle.es14.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as d, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import * as t from "@radix-ui/react-checkbox";
|
|
3
3
|
import { Icon as h } from "./bundle.es39.js";
|
|
4
|
-
import {
|
|
4
|
+
import { f as l } from "./bundle.es40.js";
|
|
5
5
|
import { useId as n } from "react";
|
|
6
6
|
import { attr as c } from "@companix/utils-browser";
|
|
7
|
-
const
|
|
7
|
+
const N = ({ checked: a, required: s, disabled: r, onCheckedChange: m, size: x, label: e }) => {
|
|
8
8
|
const i = n();
|
|
9
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ d(
|
|
10
10
|
"div",
|
|
11
11
|
{
|
|
12
12
|
className: "checkbox",
|
|
13
|
-
"data-size":
|
|
14
|
-
"data-required": c(
|
|
13
|
+
"data-size": x ?? "md",
|
|
14
|
+
"data-required": c(s && !a),
|
|
15
15
|
"data-disabled": c(r),
|
|
16
16
|
children: [
|
|
17
17
|
/* @__PURE__ */ o(
|
|
18
18
|
t.Root,
|
|
19
19
|
{
|
|
20
20
|
className: "checkbox-box",
|
|
21
|
-
checked:
|
|
22
|
-
onCheckedChange:
|
|
21
|
+
checked: a,
|
|
22
|
+
onCheckedChange: m,
|
|
23
23
|
disabled: r,
|
|
24
24
|
id: i,
|
|
25
|
-
children: /* @__PURE__ */ o(t.Indicator, { className: "checkbox-icon", children: /* @__PURE__ */ o(h, { icon: l, size: "xxxs" }) })
|
|
25
|
+
children: /* @__PURE__ */ o(t.Indicator, { className: "checkbox-icon", children: /* @__PURE__ */ o(h, { icon: l.faCheck, size: "xxxs" }) })
|
|
26
26
|
}
|
|
27
27
|
),
|
|
28
|
-
|
|
28
|
+
e && /* @__PURE__ */ o("label", { className: "checkbox-label", htmlFor: i, "data-disabled": c(r), children: e })
|
|
29
29
|
]
|
|
30
30
|
}
|
|
31
31
|
);
|
|
32
32
|
};
|
|
33
33
|
export {
|
|
34
|
-
|
|
34
|
+
N as Checkbox
|
|
35
35
|
};
|
package/dist/bundle.es19.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "@radix-ui/react-alert-dialog";
|
|
3
3
|
import { Button as c } from "./bundle.es2.js";
|
|
4
|
-
import { RemoveListener as N } from "./bundle.
|
|
4
|
+
import { RemoveListener as N } from "./bundle.es41.js";
|
|
5
5
|
import { VisuallyHidden as u } from "@radix-ui/react-visually-hidden";
|
|
6
6
|
const C = ({
|
|
7
7
|
open: d,
|
package/dist/bundle.es20.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Button as m } from "./bundle.es2.js";
|
|
3
|
-
import { useLoading as p } from "./bundle.
|
|
3
|
+
import { useLoading as p } from "./bundle.es42.js";
|
|
4
4
|
const g = ({ onClick: o, appearance: r = "primary", ...i }) => {
|
|
5
5
|
const { isLoading: n, isError: t, handleClick: a } = p({ onClick: o });
|
|
6
6
|
return /* @__PURE__ */ e(
|
package/dist/bundle.es23.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
-
import { useResizeTextarea as x } from "./bundle.
|
|
2
|
+
import { useResizeTextarea as x } from "./bundle.es43.js";
|
|
3
3
|
import { attr as e, callMultiple as u } from "@companix/utils-browser";
|
|
4
4
|
import { useEffect as z } from "react";
|
|
5
5
|
import { mergeRefs as R } from "react-merge-refs";
|
package/dist/bundle.es24.js
CHANGED
|
@@ -1,57 +1,58 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
1
|
+
import { jsx as o, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { useFroozeClosing as M } from "./bundle.es33.js";
|
|
3
3
|
import { Popover as j } from "./bundle.es6.js";
|
|
4
4
|
import { OptionItem as q } from "./bundle.es10.js";
|
|
5
5
|
import { OptionsList as V } from "./bundle.es12.js";
|
|
6
6
|
import { useState as B, useRef as d, useMemo as h } from "react";
|
|
7
7
|
import { Icon as g } from "./bundle.es39.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { f as H } from "./bundle.es44.js";
|
|
9
|
+
import { f as Q } from "./bundle.es45.js";
|
|
10
|
+
import { attr as x, getActiveElementByAnotherElement as G, contains as J } from "@companix/utils-browser";
|
|
10
11
|
import { mergeRefs as K } from "react-merge-refs";
|
|
11
|
-
const
|
|
12
|
+
const se = (C) => {
|
|
12
13
|
const {
|
|
13
14
|
options: r,
|
|
14
|
-
closeAfterSelect:
|
|
15
|
+
closeAfterSelect: v,
|
|
15
16
|
placeholder: N,
|
|
16
|
-
onChange:
|
|
17
|
+
onChange: c,
|
|
17
18
|
emptyText: R = "Ничего не найдено",
|
|
18
19
|
readOnly: m,
|
|
19
20
|
size: z = "md",
|
|
20
21
|
value: n,
|
|
21
22
|
inputRef: A,
|
|
22
|
-
disabled:
|
|
23
|
-
required:
|
|
24
|
-
} =
|
|
23
|
+
disabled: u,
|
|
24
|
+
required: D
|
|
25
|
+
} = C, [a, E] = B(""), i = d(null), w = d(null), { popoverRef: f, froozePopoverPosition: y, handleAnimationEnd: b } = M(), O = h(() => {
|
|
25
26
|
const e = {};
|
|
26
27
|
return r.forEach((t) => {
|
|
27
28
|
e[t.value] = t;
|
|
28
29
|
}), e;
|
|
29
30
|
}, [r]), P = (e) => n.includes(e) ? [...n] : [...n, e], T = (e) => n.filter((t) => e !== t), k = (e, t) => {
|
|
30
|
-
|
|
31
|
-
}, p = h(() =>
|
|
32
|
-
const t = e.toLowerCase(), s =
|
|
31
|
+
v ? (y(), c(e), t()) : c(e);
|
|
32
|
+
}, p = h(() => a.trim() ? r.filter(({ title: e }) => {
|
|
33
|
+
const t = e.toLowerCase(), s = a.trim().toLowerCase();
|
|
33
34
|
return t.indexOf(s) >= 0;
|
|
34
|
-
}) : r, [
|
|
35
|
-
if (
|
|
36
|
-
|
|
35
|
+
}) : r, [a, r]), I = (e) => {
|
|
36
|
+
if (u) return;
|
|
37
|
+
f.current && f.current.getAttribute("data-state") === "open" && e.preventDefault();
|
|
37
38
|
const t = G(e.currentTarget);
|
|
38
|
-
e.defaultPrevented || J(e.currentTarget, t) ||
|
|
39
|
+
e.defaultPrevented || J(e.currentTarget, t) || i.current && i.current.focus();
|
|
39
40
|
}, S = (e) => {
|
|
40
|
-
e.target !==
|
|
41
|
+
e.target !== i.current && e.preventDefault();
|
|
41
42
|
}, $ = (e, t) => {
|
|
42
|
-
e.stopPropagation(),
|
|
43
|
+
e.stopPropagation(), c(T(t));
|
|
43
44
|
};
|
|
44
45
|
return /* @__PURE__ */ o(
|
|
45
46
|
j,
|
|
46
47
|
{
|
|
47
48
|
minimal: !0,
|
|
48
|
-
ref:
|
|
49
|
+
ref: f,
|
|
49
50
|
sideOffset: 0,
|
|
50
51
|
matchTarget: "width",
|
|
51
|
-
onAnimationEnd:
|
|
52
|
+
onAnimationEnd: b,
|
|
52
53
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
53
54
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
54
|
-
content: ({ close: e }) => /* @__PURE__ */
|
|
55
|
+
content: ({ close: e }) => /* @__PURE__ */ l(V, { maxHeight: 300, children: [
|
|
55
56
|
p.length === 0 && /* @__PURE__ */ o("div", { className: "select-tags-empty", children: R }),
|
|
56
57
|
p.map(({ value: t, title: s, icon: F }, L) => /* @__PURE__ */ o(
|
|
57
58
|
q,
|
|
@@ -71,41 +72,41 @@ const re = (x) => {
|
|
|
71
72
|
onClick: I,
|
|
72
73
|
onMouseDown: S,
|
|
73
74
|
"data-size": z,
|
|
74
|
-
"data-required":
|
|
75
|
-
children: /* @__PURE__ */
|
|
76
|
-
/* @__PURE__ */
|
|
75
|
+
"data-required": x(D),
|
|
76
|
+
children: /* @__PURE__ */ l("div", { className: "select-tags-container", children: [
|
|
77
|
+
/* @__PURE__ */ l("div", { className: "select-tags", children: [
|
|
77
78
|
n.length > 0 && /* @__PURE__ */ o(
|
|
78
79
|
"div",
|
|
79
80
|
{
|
|
80
81
|
className: "tag-container",
|
|
81
|
-
ref:
|
|
82
|
+
ref: w,
|
|
82
83
|
role: "listbox",
|
|
83
|
-
"data-readonly":
|
|
84
|
-
children: n.map((e, t) => /* @__PURE__ */
|
|
84
|
+
"data-readonly": x(m),
|
|
85
|
+
children: n.map((e, t) => /* @__PURE__ */ l("div", { className: "tag", children: [
|
|
85
86
|
/* @__PURE__ */ o("span", { className: "tag-name", children: O[e].title }),
|
|
86
|
-
/* @__PURE__ */ o("button", { className: "tag-close-button", onClick: (s) => $(s, e), children: /* @__PURE__ */ o(g, { className: "tag-close-icon", icon:
|
|
87
|
+
/* @__PURE__ */ o("button", { className: "tag-close-button", onClick: (s) => $(s, e), children: /* @__PURE__ */ o(g, { className: "tag-close-icon", icon: Q.faClose, size: "xxxs" }) })
|
|
87
88
|
] }, `tag-option-${e}-${t}`))
|
|
88
89
|
}
|
|
89
90
|
),
|
|
90
91
|
(!m || n.length === 0) && /* @__PURE__ */ o(
|
|
91
92
|
"input",
|
|
92
93
|
{
|
|
93
|
-
ref: K([A,
|
|
94
|
+
ref: K([A, i]),
|
|
94
95
|
type: "text",
|
|
95
96
|
autoCapitalize: "none",
|
|
96
97
|
autoComplete: "off",
|
|
97
98
|
autoCorrect: "off",
|
|
98
99
|
className: "form-input",
|
|
99
100
|
spellCheck: !1,
|
|
100
|
-
value:
|
|
101
|
-
disabled:
|
|
101
|
+
value: a,
|
|
102
|
+
disabled: u,
|
|
102
103
|
readOnly: m,
|
|
103
104
|
placeholder: N,
|
|
104
|
-
onChange: ({ target: e }) =>
|
|
105
|
+
onChange: ({ target: e }) => E(e.value)
|
|
105
106
|
}
|
|
106
107
|
)
|
|
107
108
|
] }),
|
|
108
|
-
/* @__PURE__ */ o(g, { className: "expand-icon", icon:
|
|
109
|
+
/* @__PURE__ */ o(g, { className: "expand-icon", icon: H.faChevronDown, size: "xxxs" })
|
|
109
110
|
] })
|
|
110
111
|
}
|
|
111
112
|
)
|
|
@@ -113,5 +114,5 @@ const re = (x) => {
|
|
|
113
114
|
);
|
|
114
115
|
};
|
|
115
116
|
export {
|
|
116
|
-
|
|
117
|
+
se as SelectTags
|
|
117
118
|
};
|
package/dist/bundle.es25.js
CHANGED
|
@@ -2,11 +2,11 @@ import { jsx as u } from "react/jsx-runtime";
|
|
|
2
2
|
import { Popover as x } from "./bundle.es6.js";
|
|
3
3
|
import { Input as A } from "./bundle.es9.js";
|
|
4
4
|
import { useState as M, useRef as j } from "react";
|
|
5
|
-
import { Calendar as E } from "./bundle.
|
|
6
|
-
import { useDayDisableCheker as N } from "./bundle.
|
|
5
|
+
import { Calendar as E } from "./bundle.es46.js";
|
|
6
|
+
import { useDayDisableCheker as N } from "./bundle.es47.js";
|
|
7
7
|
import { getNum as f, formatTime as v } from "@companix/utils-js";
|
|
8
|
-
import { removeDigits as O } from "./bundle.
|
|
9
|
-
import { SelectRightElements as Y } from "./bundle.
|
|
8
|
+
import { removeDigits as O } from "./bundle.es48.js";
|
|
9
|
+
import { SelectRightElements as Y } from "./bundle.es49.js";
|
|
10
10
|
const i = {
|
|
11
11
|
char: "-",
|
|
12
12
|
toString: (e) => {
|
package/dist/bundle.es26.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as D, jsx as h } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as M, useEffect as C } from "react";
|
|
3
3
|
import { Select as c } from "./bundle.es8.js";
|
|
4
|
-
import { createDateValidation as O, getMonthMaxDay as T } from "./bundle.
|
|
5
|
-
import { defaultMin as j, defaultMax as N, useCalendarOptions as V } from "./bundle.
|
|
4
|
+
import { createDateValidation as O, getMonthMaxDay as T } from "./bundle.es48.js";
|
|
5
|
+
import { defaultMin as j, defaultMax as N, useCalendarOptions as V } from "./bundle.es50.js";
|
|
6
6
|
const B = ({
|
|
7
7
|
min: o = j,
|
|
8
8
|
max: e = N,
|
package/dist/bundle.es29.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as g } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as _, useMemo as b, useState as P, useEffect as j } from "react";
|
|
3
3
|
import { getNum as v } from "@companix/utils-js";
|
|
4
|
-
import { getTimesOptions as D, getTimeValue as A, removeDigits as W, convertTimeToOption as q } from "./bundle.
|
|
5
|
-
import { SelectRightElements as w } from "./bundle.
|
|
4
|
+
import { getTimesOptions as D, getTimeValue as A, removeDigits as W, convertTimeToOption as q } from "./bundle.es48.js";
|
|
5
|
+
import { SelectRightElements as w } from "./bundle.es49.js";
|
|
6
6
|
import { Select as y } from "./bundle.es8.js";
|
|
7
7
|
import { Input as z } from "./bundle.es9.js";
|
|
8
8
|
const r = {
|
package/dist/bundle.es31.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { hash as m } from "@companix/utils-js";
|
|
3
3
|
import { useRef as n, useMemo as s } from "react";
|
|
4
|
-
import { Viewport as u } from "./bundle.
|
|
4
|
+
import { Viewport as u } from "./bundle.es51.js";
|
|
5
5
|
const h = (t = {}) => {
|
|
6
6
|
const e = {
|
|
7
7
|
emit: (r) => {
|
package/dist/bundle.es32.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { hash as d } from "@companix/utils-js";
|
|
3
|
-
import { Viewport as s } from "./bundle.
|
|
3
|
+
import { Viewport as s } from "./bundle.es52.js";
|
|
4
4
|
import { useRef as c, useMemo as l } from "react";
|
|
5
5
|
const f = (i = {}) => {
|
|
6
6
|
const t = {
|
package/dist/bundle.es34.js
CHANGED
|
@@ -4,7 +4,7 @@ import { attr as l } from "@companix/utils-browser";
|
|
|
4
4
|
import { forwardRef as y, useRef as S, useCallback as T } from "react";
|
|
5
5
|
import { VisuallyHidden as j } from "@radix-ui/react-visually-hidden";
|
|
6
6
|
import { mergeRefs as w } from "react-merge-refs";
|
|
7
|
-
import { SelectRightElements as z } from "./bundle.
|
|
7
|
+
import { SelectRightElements as z } from "./bundle.es49.js";
|
|
8
8
|
const V = y(
|
|
9
9
|
({
|
|
10
10
|
required: a,
|
package/dist/bundle.es38.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.es61.js";
|
|
6
6
|
const v = x(
|
|
7
7
|
({
|
|
8
8
|
required: s,
|
package/dist/bundle.es40.js
CHANGED
package/dist/bundle.es41.js
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
};
|
|
1
|
+
import { useEffect as r } from "react";
|
|
2
|
+
const n = ({ callback: e }) => (r(() => () => {
|
|
3
|
+
e?.();
|
|
4
|
+
}, []), null);
|
|
14
5
|
export {
|
|
15
|
-
|
|
6
|
+
n as RemoveListener
|
|
16
7
|
};
|
package/dist/bundle.es42.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
13
|
};
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
d as useLoading
|
|
16
16
|
};
|
package/dist/bundle.es43.js
CHANGED
|
@@ -1,72 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
);
|
|
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];
|
|
69
13
|
};
|
|
70
14
|
export {
|
|
71
|
-
|
|
15
|
+
f as useResizeTextarea
|
|
72
16
|
};
|
package/dist/bundle.es44.js
CHANGED
|
@@ -1,70 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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]);
|
|
58
|
-
};
|
|
1
|
+
import { __require as r } from "./bundle.es56.js";
|
|
2
|
+
var e = /* @__PURE__ */ r();
|
|
59
3
|
export {
|
|
60
|
-
|
|
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
|
|
4
|
+
e as f
|
|
70
5
|
};
|
package/dist/bundle.es45.js
CHANGED
|
@@ -1,72 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const g = (n, r) => new Date(r, n, 0).getDate(), u = (n, r) => new Date(r, n - 1, 1).getDay(), D = (n) => n === 0 ? 6 : n - 1, d = (n) => new Array(n).fill(0), T = (n) => ({
|
|
4
|
-
day: n.getDate(),
|
|
5
|
-
month: n.getMonth() + 1,
|
|
6
|
-
year: n.getFullYear()
|
|
7
|
-
}), p = ({ min: n, max: r }) => (t) => {
|
|
8
|
-
if (n.year === t.year) {
|
|
9
|
-
if (t.month !== 0 && t.month < n.month)
|
|
10
|
-
return t.month = 0, t.day = 0, t;
|
|
11
|
-
if (t.month === n.month && t.day < n.day && t.day !== 0)
|
|
12
|
-
return t.day = 0, t;
|
|
13
|
-
}
|
|
14
|
-
if (r.year === t.year) {
|
|
15
|
-
if (t.month !== 0 && t.month > r.month)
|
|
16
|
-
return t.month = 0, t.day = 0, t;
|
|
17
|
-
if (t.month === r.month && t.day > r.day && t.day !== 0)
|
|
18
|
-
return t.day = 0, t;
|
|
19
|
-
}
|
|
20
|
-
}, A = ["Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"], M = [
|
|
21
|
-
"Январь",
|
|
22
|
-
"Февраль",
|
|
23
|
-
"Март",
|
|
24
|
-
"Апрель",
|
|
25
|
-
"Май",
|
|
26
|
-
"Июнь",
|
|
27
|
-
"Июль",
|
|
28
|
-
"Август",
|
|
29
|
-
"Сентябрь",
|
|
30
|
-
"Октябрь",
|
|
31
|
-
"Ноябрь",
|
|
32
|
-
"Декабрь"
|
|
33
|
-
], c = 9999, a = 100, w = (n, r) => {
|
|
34
|
-
const t = [], o = m(n - r, a, c), e = m(n + r, a, c);
|
|
35
|
-
for (let s = o; s <= e; s++)
|
|
36
|
-
t.push({ title: String(s).padStart(4, "0"), value: s });
|
|
37
|
-
return t;
|
|
38
|
-
}, F = (n) => {
|
|
39
|
-
const r = [], t = new Intl.DateTimeFormat(n, {
|
|
40
|
-
month: "long"
|
|
41
|
-
});
|
|
42
|
-
for (let o = 0; o < 12; o++)
|
|
43
|
-
r.push({
|
|
44
|
-
title: t.format(new Date(2023, o, 15)),
|
|
45
|
-
value: o
|
|
46
|
-
});
|
|
47
|
-
return r;
|
|
48
|
-
}, Y = (n, r) => r.reduce((t, o) => t.replaceAll(o, ""), n.trim()), E = ({ hours: n, minutes: r }, t = ":") => [i(n), i(r)].join(t), h = (n, r = ":") => {
|
|
49
|
-
const [t, o] = [i(n.hours), i(n.minutes)], e = [t, o].join(r);
|
|
50
|
-
return { title: e, value: e, hours: t, minutes: o };
|
|
51
|
-
}, _ = (n, r = ":") => {
|
|
52
|
-
const t = { minutes: -n, hours: 0 };
|
|
53
|
-
return Array.from({ length: 1440 / n }).map(() => (t.minutes += n, t.minutes === 60 && (t.minutes = 0, t.hours++), h(t, r)));
|
|
54
|
-
};
|
|
1
|
+
import { __require as r } from "./bundle.es58.js";
|
|
2
|
+
var o = /* @__PURE__ */ r();
|
|
55
3
|
export {
|
|
56
|
-
|
|
57
|
-
a as DEFAULT_MIN_YEAR,
|
|
58
|
-
M as DefaultMonths,
|
|
59
|
-
E as convertTimeToOption,
|
|
60
|
-
p as createDateValidation,
|
|
61
|
-
d as createVoids,
|
|
62
|
-
T as dateToFormat,
|
|
63
|
-
D as getDayIndex,
|
|
64
|
-
u as getFirstDay,
|
|
65
|
-
g as getMonthMaxDay,
|
|
66
|
-
F as getMonths,
|
|
67
|
-
h as getTimeValue,
|
|
68
|
-
_ as getTimesOptions,
|
|
69
|
-
w as getYears,
|
|
70
|
-
Y as removeDigits,
|
|
71
|
-
A as weeks
|
|
4
|
+
o as f
|
|
72
5
|
};
|