@companix/uikit 0.0.28 → 0.0.29
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/Input/Input.d.ts +1 -0
- package/dist/bundle.es45.js +1 -1
- package/dist/bundle.es51.js +2 -2
- package/dist/bundle.es61.js +20 -76
- package/dist/bundle.es62.js +2 -49
- package/dist/bundle.es63.js +76 -20
- package/dist/bundle.es64.js +49 -2
- package/dist/bundle.es9.js +22 -21
- package/package.json +1 -1
package/dist/Input/Input.d.ts
CHANGED
|
@@ -9,5 +9,6 @@ export interface InputProps extends Omit<InputContainerProps, 'inputRef' | 'chil
|
|
|
9
9
|
inputClassName?: string;
|
|
10
10
|
mask?: string;
|
|
11
11
|
maskChar?: string;
|
|
12
|
+
type?: React.HTMLInputTypeAttribute;
|
|
12
13
|
}
|
|
13
14
|
export declare const Input: import('react').ForwardRefExoticComponent<InputProps & import('react').RefAttributes<HTMLDivElement>>;
|
package/dist/bundle.es45.js
CHANGED
package/dist/bundle.es51.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.es53.js";
|
|
3
|
-
import { CalendarHeader as F } from "./bundle.
|
|
4
|
-
import { useCalendar as j } from "./bundle.
|
|
3
|
+
import { CalendarHeader as F } from "./bundle.es63.js";
|
|
4
|
+
import { useCalendar as j } from "./bundle.es64.js";
|
|
5
5
|
import { attr as m } from "@companix/utils-browser";
|
|
6
6
|
import { isSameDate as f } from "./bundle.es52.js";
|
|
7
7
|
import { useLayoutEffect as I } from "react";
|
package/dist/bundle.es61.js
CHANGED
|
@@ -1,78 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
[m, n]
|
|
22
|
-
), E = h(
|
|
23
|
-
(t) => {
|
|
24
|
-
m(T(n, t));
|
|
25
|
-
},
|
|
26
|
-
[m, n]
|
|
27
|
-
), M = d(() => Y(i).map((t) => ({
|
|
28
|
-
...t,
|
|
29
|
-
className: "capitalize",
|
|
30
|
-
disabled: a && a(t.value)
|
|
31
|
-
})), [i, a]), A = d(() => k(r, 100).map((t) => ({
|
|
32
|
-
...t,
|
|
33
|
-
disabled: c && c(t.value)
|
|
34
|
-
})), [r, c]);
|
|
35
|
-
let l = e === 11 && r === u;
|
|
36
|
-
a && !l && (l = a(
|
|
37
|
-
e === 11 ? 0 : e + 1,
|
|
38
|
-
e === 11 ? Math.min(r + 1, u) : r
|
|
39
|
-
));
|
|
40
|
-
let s = e === 0 && r === g;
|
|
41
|
-
return a && !s && (s = a(
|
|
42
|
-
e === 0 ? 11 : e - 1,
|
|
43
|
-
e === 0 ? Math.max(r - 1, g) : r
|
|
44
|
-
)), /* @__PURE__ */ f("div", { className: "calendar-header", children: [
|
|
45
|
-
!s && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "left", onClick: x, children: /* @__PURE__ */ o(C, { icon: L.faChevronLeft }) }),
|
|
46
|
-
/* @__PURE__ */ f("div", { className: "calendar-pickers", children: [
|
|
47
|
-
/* @__PURE__ */ o(
|
|
48
|
-
p,
|
|
49
|
-
{
|
|
50
|
-
fill: !0,
|
|
51
|
-
options: A,
|
|
52
|
-
size: "sm",
|
|
53
|
-
value: r,
|
|
54
|
-
minimalOptions: !0,
|
|
55
|
-
matchTarget: "min-width",
|
|
56
|
-
onChange: (t) => E(t)
|
|
57
|
-
}
|
|
58
|
-
),
|
|
59
|
-
/* @__PURE__ */ o(
|
|
60
|
-
p,
|
|
61
|
-
{
|
|
62
|
-
fill: !0,
|
|
63
|
-
options: M,
|
|
64
|
-
size: "sm",
|
|
65
|
-
className: "capitalize",
|
|
66
|
-
value: e,
|
|
67
|
-
minimalOptions: !0,
|
|
68
|
-
matchTarget: "min-width",
|
|
69
|
-
onChange: (t) => N(t)
|
|
70
|
-
}
|
|
71
|
-
)
|
|
72
|
-
] }),
|
|
73
|
-
!l && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "right", onClick: v, children: /* @__PURE__ */ o(C, { icon: z.faChevronRight }) })
|
|
74
|
-
] });
|
|
75
|
-
};
|
|
1
|
+
import { __exports as e } from "./bundle.es62.js";
|
|
2
|
+
var v;
|
|
3
|
+
function d() {
|
|
4
|
+
return v ? e : (v = 1, (function(a) {
|
|
5
|
+
Object.defineProperty(a, "__esModule", { value: !0 });
|
|
6
|
+
var c = "fas", n = "check", r = 448, f = 512, i = [10003, 10004], h = "f00c", u = "M434.8 70.1c14.3 10.4 17.5 30.4 7.1 44.7l-256 352c-5.5 7.6-14 12.3-23.4 13.1s-18.5-2.7-25.1-9.3l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l101.5 101.5 234-321.7c10.4-14.3 30.4-17.5 44.7-7.1z";
|
|
7
|
+
a.definition = {
|
|
8
|
+
prefix: c,
|
|
9
|
+
iconName: n,
|
|
10
|
+
icon: [
|
|
11
|
+
r,
|
|
12
|
+
f,
|
|
13
|
+
i,
|
|
14
|
+
h,
|
|
15
|
+
u
|
|
16
|
+
]
|
|
17
|
+
}, a.faCheck = a.definition, a.prefix = c, a.iconName = n, a.width = r, a.height = f, a.ligatures = i, a.unicode = h, a.svgPathData = u, a.aliases = i;
|
|
18
|
+
})(e), e);
|
|
19
|
+
}
|
|
76
20
|
export {
|
|
77
|
-
|
|
21
|
+
d as __require
|
|
78
22
|
};
|
package/dist/bundle.es62.js
CHANGED
|
@@ -1,51 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { DEFAULT_MIN_YEAR as w, DEFAULT_MAX_YEAR as A } from "./bundle.es53.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
|
-
};
|
|
48
|
-
};
|
|
1
|
+
var a = {};
|
|
49
2
|
export {
|
|
50
|
-
|
|
3
|
+
a as __exports
|
|
51
4
|
};
|
package/dist/bundle.es63.js
CHANGED
|
@@ -1,22 +1,78 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { jsxs as f, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as h, useMemo as d } from "react";
|
|
3
|
+
import { Select as p } from "./bundle.es8.js";
|
|
4
|
+
import { getMonths as Y, getYears as k, DEFAULT_MAX_YEAR as u, DEFAULT_MIN_YEAR as g } from "./bundle.es53.js";
|
|
5
|
+
import { Icon as C } from "./bundle.es30.js";
|
|
6
|
+
import { f as z } from "./bundle.es72.js";
|
|
7
|
+
import { f as L } from "./bundle.es73.js";
|
|
8
|
+
import { setMonth as R, setYear as T } from "./bundle.es52.js";
|
|
9
|
+
const S = ({
|
|
10
|
+
viewDate: n,
|
|
11
|
+
onChange: m,
|
|
12
|
+
isMonthDisabled: a,
|
|
13
|
+
isYearDisabled: c,
|
|
14
|
+
onNextMonth: v,
|
|
15
|
+
onPrevMonth: x
|
|
16
|
+
}) => {
|
|
17
|
+
const r = n.getFullYear(), e = n.getMonth(), i = "ru", N = h(
|
|
18
|
+
(t) => {
|
|
19
|
+
m(R(n, t));
|
|
20
|
+
},
|
|
21
|
+
[m, n]
|
|
22
|
+
), E = h(
|
|
23
|
+
(t) => {
|
|
24
|
+
m(T(n, t));
|
|
25
|
+
},
|
|
26
|
+
[m, n]
|
|
27
|
+
), M = d(() => Y(i).map((t) => ({
|
|
28
|
+
...t,
|
|
29
|
+
className: "capitalize",
|
|
30
|
+
disabled: a && a(t.value)
|
|
31
|
+
})), [i, a]), A = d(() => k(r, 100).map((t) => ({
|
|
32
|
+
...t,
|
|
33
|
+
disabled: c && c(t.value)
|
|
34
|
+
})), [r, c]);
|
|
35
|
+
let l = e === 11 && r === u;
|
|
36
|
+
a && !l && (l = a(
|
|
37
|
+
e === 11 ? 0 : e + 1,
|
|
38
|
+
e === 11 ? Math.min(r + 1, u) : r
|
|
39
|
+
));
|
|
40
|
+
let s = e === 0 && r === g;
|
|
41
|
+
return a && !s && (s = a(
|
|
42
|
+
e === 0 ? 11 : e - 1,
|
|
43
|
+
e === 0 ? Math.max(r - 1, g) : r
|
|
44
|
+
)), /* @__PURE__ */ f("div", { className: "calendar-header", children: [
|
|
45
|
+
!s && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "left", onClick: x, children: /* @__PURE__ */ o(C, { icon: L.faChevronLeft }) }),
|
|
46
|
+
/* @__PURE__ */ f("div", { className: "calendar-pickers", children: [
|
|
47
|
+
/* @__PURE__ */ o(
|
|
48
|
+
p,
|
|
49
|
+
{
|
|
50
|
+
fill: !0,
|
|
51
|
+
options: A,
|
|
52
|
+
size: "sm",
|
|
53
|
+
value: r,
|
|
54
|
+
minimalOptions: !0,
|
|
55
|
+
matchTarget: "min-width",
|
|
56
|
+
onChange: (t) => E(t)
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ o(
|
|
60
|
+
p,
|
|
61
|
+
{
|
|
62
|
+
fill: !0,
|
|
63
|
+
options: M,
|
|
64
|
+
size: "sm",
|
|
65
|
+
className: "capitalize",
|
|
66
|
+
value: e,
|
|
67
|
+
minimalOptions: !0,
|
|
68
|
+
matchTarget: "min-width",
|
|
69
|
+
onChange: (t) => N(t)
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] }),
|
|
73
|
+
!l && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "right", onClick: v, children: /* @__PURE__ */ o(C, { icon: z.faChevronRight }) })
|
|
74
|
+
] });
|
|
75
|
+
};
|
|
20
76
|
export {
|
|
21
|
-
|
|
77
|
+
S as CalendarHeader
|
|
22
78
|
};
|
package/dist/bundle.es64.js
CHANGED
|
@@ -1,4 +1,51 @@
|
|
|
1
|
-
|
|
1
|
+
import { subMonths as L, addMonths as N, useDayDisableCheker as R } from "./bundle.es52.js";
|
|
2
|
+
import { DEFAULT_MIN_YEAR as w, DEFAULT_MAX_YEAR as A } from "./bundle.es53.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
|
+
};
|
|
48
|
+
};
|
|
2
49
|
export {
|
|
3
|
-
|
|
50
|
+
X as useCalendar
|
|
4
51
|
};
|
package/dist/bundle.es9.js
CHANGED
|
@@ -1,42 +1,43 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { mergeRefs as
|
|
4
|
-
import { InputElement as
|
|
5
|
-
import { InputContainer as
|
|
6
|
-
import
|
|
7
|
-
const
|
|
2
|
+
import { forwardRef as b, useRef as R } from "react";
|
|
3
|
+
import { mergeRefs as c } from "react-merge-refs";
|
|
4
|
+
import { InputElement as x } from "./bundle.es43.js";
|
|
5
|
+
import { InputContainer as I } from "./bundle.es44.js";
|
|
6
|
+
import g from "classnames";
|
|
7
|
+
const k = b(
|
|
8
8
|
({
|
|
9
9
|
onChange: m,
|
|
10
10
|
onValueChange: f,
|
|
11
11
|
readOnly: i,
|
|
12
12
|
inputClassName: o,
|
|
13
|
-
value:
|
|
14
|
-
placeholder:
|
|
13
|
+
value: n,
|
|
14
|
+
placeholder: p,
|
|
15
15
|
mask: d,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
type: s = "text",
|
|
17
|
+
maskChar: u,
|
|
18
|
+
inputRef: a,
|
|
18
19
|
...e
|
|
19
|
-
},
|
|
20
|
-
const r =
|
|
21
|
-
return /* @__PURE__ */ t(
|
|
22
|
-
|
|
20
|
+
}, l) => {
|
|
21
|
+
const r = R(null);
|
|
22
|
+
return /* @__PURE__ */ t(I, { ref: l, inputRef: r, ...e, children: /* @__PURE__ */ t(
|
|
23
|
+
x,
|
|
23
24
|
{
|
|
24
|
-
type:
|
|
25
|
-
ref:
|
|
26
|
-
className:
|
|
25
|
+
type: s,
|
|
26
|
+
ref: c([r, a]),
|
|
27
|
+
className: g("form-input form-input-base", o),
|
|
27
28
|
"aria-disabled": e.disabled,
|
|
28
29
|
onChange: m,
|
|
29
30
|
onValueChange: f,
|
|
30
|
-
value:
|
|
31
|
-
placeholder:
|
|
31
|
+
value: n,
|
|
32
|
+
placeholder: p,
|
|
32
33
|
disabled: e.disabled,
|
|
33
34
|
readOnly: i,
|
|
34
|
-
maskChar:
|
|
35
|
+
maskChar: u,
|
|
35
36
|
mask: d
|
|
36
37
|
}
|
|
37
38
|
) });
|
|
38
39
|
}
|
|
39
40
|
);
|
|
40
41
|
export {
|
|
41
|
-
|
|
42
|
+
k as Input
|
|
42
43
|
};
|