@companix/uikit 0.0.33 → 0.0.35
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/Avatar/Avatar.scss +64 -0
- package/dist/Avatar/helpers.d.ts +10 -0
- package/dist/Avatar/index.d.ts +8 -0
- package/dist/Avatar/types.d.ts +2 -0
- package/dist/Icon/index.d.ts +2 -3
- package/dist/Segments/Segments.scss +57 -0
- package/dist/Segments/index.d.ts +11 -0
- package/dist/bundle.es.js +86 -80
- package/dist/bundle.es10.js +78 -39
- package/dist/bundle.es11.js +26 -36
- package/dist/bundle.es12.js +75 -56
- package/dist/bundle.es13.js +39 -19
- package/dist/bundle.es14.js +36 -33
- package/dist/bundle.es15.js +54 -23
- package/dist/bundle.es16.js +21 -45
- package/dist/bundle.es17.js +29 -19
- package/dist/bundle.es18.js +21 -25
- package/dist/bundle.es19.js +45 -38
- package/dist/bundle.es2.js +42 -45
- package/dist/bundle.es20.js +21 -14
- package/dist/bundle.es21.js +28 -33
- package/dist/bundle.es22.js +38 -21
- package/dist/bundle.es23.js +12 -38
- package/dist/bundle.es24.js +32 -114
- package/dist/bundle.es25.js +20 -120
- package/dist/bundle.es26.js +40 -72
- package/dist/bundle.es27.js +115 -32
- package/dist/bundle.es28.js +120 -11
- package/dist/bundle.es29.js +71 -83
- package/dist/bundle.es3.js +2 -8
- package/dist/bundle.es30.js +31 -20
- package/dist/bundle.es31.js +11 -6
- package/dist/bundle.es32.js +83 -32
- package/dist/bundle.es33.js +21 -21
- package/dist/bundle.es34.js +6 -10
- package/dist/bundle.es35.js +33 -23
- package/dist/bundle.es36.js +20 -37
- package/dist/bundle.es37.js +10 -50
- package/dist/bundle.es38.js +22 -40
- package/dist/bundle.es39.js +38 -8
- package/dist/bundle.es4.js +44 -10
- package/dist/bundle.es40.js +48 -21
- package/dist/bundle.es41.js +42 -86
- package/dist/bundle.es42.js +8 -17
- package/dist/bundle.es43.js +24 -19
- package/dist/bundle.es44.js +24 -24
- package/dist/bundle.es45.js +77 -29
- package/dist/bundle.es46.js +18 -3
- package/dist/bundle.es47.js +20 -5
- package/dist/bundle.es48.js +24 -14
- package/dist/bundle.es49.js +39 -14
- package/dist/bundle.es5.js +8 -85
- package/dist/bundle.es50.js +3 -3
- package/dist/bundle.es51.js +5 -3
- package/dist/bundle.es52.js +13 -69
- package/dist/bundle.es53.js +13 -67
- package/dist/bundle.es54.js +3 -70
- package/dist/bundle.es55.js +3 -12
- package/dist/bundle.es56.js +68 -41
- package/dist/bundle.es57.js +67 -14
- package/dist/bundle.es58.js +69 -31
- package/dist/bundle.es59.js +12 -70
- package/dist/bundle.es6.js +11 -85
- package/dist/bundle.es60.js +43 -20
- package/dist/bundle.es61.js +15 -2
- package/dist/bundle.es62.js +32 -14
- package/dist/bundle.es63.js +69 -19
- package/dist/bundle.es64.js +14 -2
- package/dist/bundle.es65.js +17 -18
- package/dist/bundle.es67.js +76 -20
- package/dist/bundle.es68.js +45 -72
- package/dist/bundle.es69.js +20 -49
- package/dist/bundle.es7.js +84 -79
- package/dist/bundle.es70.js +2 -2
- package/dist/bundle.es71.js +21 -14
- package/dist/bundle.es72.js +2 -3
- package/dist/bundle.es73.js +20 -3
- package/dist/bundle.es74.js +14 -20
- package/dist/bundle.es75.js +2 -2
- package/dist/bundle.es76.js +3 -20
- package/dist/bundle.es77.js +3 -2
- package/dist/bundle.es78.js +22 -0
- package/dist/bundle.es79.js +4 -0
- package/dist/bundle.es8.js +83 -24
- package/dist/bundle.es80.js +22 -0
- package/dist/bundle.es81.js +4 -0
- package/dist/bundle.es9.js +20 -73
- package/dist/index.d.ts +6 -0
- package/dist/index.scss +2 -0
- package/package.json +2 -1
package/dist/bundle.es26.js
CHANGED
|
@@ -1,76 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { useResizeTextarea as x } from "./bundle.es53.js";
|
|
3
|
+
import { attr as e, callMultiple as u } from "@companix/utils-browser";
|
|
4
|
+
import { useEffect as z } from "react";
|
|
5
|
+
import { mergeRefs as R } from "react-merge-refs";
|
|
6
|
+
const q = ({
|
|
7
|
+
onResize: m,
|
|
8
|
+
grow: a = !1,
|
|
9
|
+
value: t,
|
|
10
|
+
onChange: s,
|
|
11
|
+
disabled: o,
|
|
12
|
+
required: i,
|
|
13
|
+
rows: l = 2,
|
|
14
|
+
fill: p = !1,
|
|
15
|
+
textAreaRef: c,
|
|
16
|
+
...d
|
|
16
17
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
matchTarget: "min-width"
|
|
41
|
-
}
|
|
42
|
-
),
|
|
43
|
-
/* @__PURE__ */ h(
|
|
44
|
-
c,
|
|
45
|
-
{
|
|
46
|
-
placeholder: "Месяц",
|
|
47
|
-
className: "w-full",
|
|
48
|
-
options: w,
|
|
49
|
-
onChange: (t) => s("month", t),
|
|
50
|
-
value: a.month,
|
|
51
|
-
disabled: r,
|
|
52
|
-
required: m,
|
|
53
|
-
size: i,
|
|
54
|
-
minimalOptions: !0,
|
|
55
|
-
matchTarget: "min-width"
|
|
56
|
-
}
|
|
57
|
-
),
|
|
58
|
-
!g && /* @__PURE__ */ h(
|
|
59
|
-
c,
|
|
60
|
-
{
|
|
61
|
-
placeholder: "День",
|
|
62
|
-
options: f,
|
|
63
|
-
disabled: r || f.length === 0,
|
|
64
|
-
onChange: (t) => s("day", t),
|
|
65
|
-
value: a.day,
|
|
66
|
-
required: m,
|
|
67
|
-
size: i,
|
|
68
|
-
minimalOptions: !0,
|
|
69
|
-
matchTarget: "min-width"
|
|
70
|
-
}
|
|
71
|
-
)
|
|
72
|
-
] });
|
|
18
|
+
const [n, r] = x(m, a);
|
|
19
|
+
return z(r, [r, t]), /* @__PURE__ */ f(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: "form form-textarea",
|
|
23
|
+
"data-required": e(i),
|
|
24
|
+
"data-disabled": e(o),
|
|
25
|
+
"data-fill": e(p),
|
|
26
|
+
children: /* @__PURE__ */ f(
|
|
27
|
+
"textarea",
|
|
28
|
+
{
|
|
29
|
+
className: "form-input",
|
|
30
|
+
"data-grow": e(a),
|
|
31
|
+
value: t,
|
|
32
|
+
ref: R([c, n]),
|
|
33
|
+
rows: l,
|
|
34
|
+
disabled: o,
|
|
35
|
+
onChange: u(s, r),
|
|
36
|
+
...d
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
);
|
|
73
41
|
};
|
|
74
42
|
export {
|
|
75
|
-
|
|
43
|
+
q as TextArea
|
|
76
44
|
};
|
package/dist/bundle.es27.js
CHANGED
|
@@ -1,35 +1,118 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import { jsx as o, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { useFroozeClosing as M } from "./bundle.es44.js";
|
|
3
|
+
import { Popover as j } from "./bundle.es10.js";
|
|
4
|
+
import { OptionItem as q } from "./bundle.es14.js";
|
|
5
|
+
import { OptionsList as V } from "./bundle.es16.js";
|
|
6
|
+
import { Icon as d } from "./bundle.es33.js";
|
|
7
|
+
import { useState as B, useRef as h, useMemo as g } from "react";
|
|
8
|
+
import { f as H } from "./bundle.es54.js";
|
|
9
|
+
import { f as Q } from "./bundle.es55.js";
|
|
10
|
+
import { attr as x, getActiveElementByAnotherElement as G, contains as J } from "@companix/utils-browser";
|
|
11
|
+
import { mergeRefs as K } from "react-merge-refs";
|
|
12
|
+
const se = (C) => {
|
|
13
|
+
const {
|
|
14
|
+
options: r,
|
|
15
|
+
closeAfterSelect: v,
|
|
16
|
+
placeholder: N,
|
|
17
|
+
onChange: c,
|
|
18
|
+
emptyText: R = "Ничего не найдено",
|
|
19
|
+
readOnly: m,
|
|
20
|
+
size: z = "md",
|
|
21
|
+
value: n,
|
|
22
|
+
inputRef: A,
|
|
23
|
+
disabled: u,
|
|
24
|
+
required: D
|
|
25
|
+
} = C, [a, E] = B(""), i = h(null), w = h(null), { popoverRef: f, froozePopoverPosition: y, handleAnimationEnd: b } = M(), O = g(() => {
|
|
26
|
+
const e = {};
|
|
27
|
+
return r.forEach((t) => {
|
|
28
|
+
e[t.value] = t;
|
|
29
|
+
}), e;
|
|
30
|
+
}, [r]), P = (e) => n.includes(e) ? [...n] : [...n, e], T = (e) => n.filter((t) => e !== t), k = (e, t) => {
|
|
31
|
+
v ? (y(), c(e), t()) : c(e);
|
|
32
|
+
}, p = g(() => a.trim() ? r.filter(({ title: e }) => {
|
|
33
|
+
const t = e.toLowerCase(), s = a.trim().toLowerCase();
|
|
34
|
+
return t.indexOf(s) >= 0;
|
|
35
|
+
}) : r, [a, r]), I = (e) => {
|
|
36
|
+
if (u) return;
|
|
37
|
+
f.current && f.current.getAttribute("data-state") === "open" && e.preventDefault();
|
|
38
|
+
const t = G(e.currentTarget);
|
|
39
|
+
e.defaultPrevented || J(e.currentTarget, t) || i.current && i.current.focus();
|
|
40
|
+
}, S = (e) => {
|
|
41
|
+
e.target !== i.current && e.preventDefault();
|
|
42
|
+
}, $ = (e, t) => {
|
|
43
|
+
e.stopPropagation(), c(T(t));
|
|
44
|
+
};
|
|
45
|
+
return /* @__PURE__ */ o(
|
|
46
|
+
j,
|
|
47
|
+
{
|
|
48
|
+
minimal: !0,
|
|
49
|
+
ref: f,
|
|
50
|
+
sideOffset: 0,
|
|
51
|
+
matchTarget: "width",
|
|
52
|
+
onAnimationEnd: b,
|
|
53
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
54
|
+
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
55
|
+
content: ({ close: e }) => /* @__PURE__ */ l(V, { maxHeight: 300, children: [
|
|
56
|
+
p.length === 0 && /* @__PURE__ */ o("div", { className: "select-tags-empty", children: R }),
|
|
57
|
+
p.map(({ value: t, title: s, icon: F }, L) => /* @__PURE__ */ o(
|
|
58
|
+
q,
|
|
59
|
+
{
|
|
60
|
+
active: n.includes(t),
|
|
61
|
+
onClick: () => k(P(t), e),
|
|
62
|
+
title: s,
|
|
63
|
+
icon: F
|
|
64
|
+
},
|
|
65
|
+
`option-item-${t}-${L}`
|
|
66
|
+
))
|
|
67
|
+
] }),
|
|
68
|
+
children: /* @__PURE__ */ o(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
className: "form",
|
|
72
|
+
onClick: I,
|
|
73
|
+
onMouseDown: S,
|
|
74
|
+
"data-size": z,
|
|
75
|
+
"data-required": x(D),
|
|
76
|
+
children: /* @__PURE__ */ l("div", { className: "select-tags-container", children: [
|
|
77
|
+
/* @__PURE__ */ l("div", { className: "select-tags", children: [
|
|
78
|
+
n.length > 0 && /* @__PURE__ */ o(
|
|
79
|
+
"div",
|
|
80
|
+
{
|
|
81
|
+
className: "tag-container",
|
|
82
|
+
ref: w,
|
|
83
|
+
role: "listbox",
|
|
84
|
+
"data-readonly": x(m),
|
|
85
|
+
children: n.map((e, t) => /* @__PURE__ */ l("div", { className: "tag", children: [
|
|
86
|
+
/* @__PURE__ */ o("span", { className: "tag-name", children: O[e].title }),
|
|
87
|
+
/* @__PURE__ */ o("button", { className: "tag-close-button", onClick: (s) => $(s, e), children: /* @__PURE__ */ o(d, { className: "tag-close-icon", icon: Q.faClose, size: "xxxs" }) })
|
|
88
|
+
] }, `tag-option-${e}-${t}`))
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
(!m || n.length === 0) && /* @__PURE__ */ o(
|
|
92
|
+
"input",
|
|
93
|
+
{
|
|
94
|
+
ref: K([A, i]),
|
|
95
|
+
type: "text",
|
|
96
|
+
autoCapitalize: "none",
|
|
97
|
+
autoComplete: "off",
|
|
98
|
+
autoCorrect: "off",
|
|
99
|
+
className: "form-input",
|
|
100
|
+
spellCheck: !1,
|
|
101
|
+
value: a,
|
|
102
|
+
disabled: u,
|
|
103
|
+
readOnly: m,
|
|
104
|
+
placeholder: N,
|
|
105
|
+
onChange: ({ target: e }) => E(e.value)
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
] }),
|
|
109
|
+
/* @__PURE__ */ o(d, { className: "expand-icon", icon: H.faChevronDown, size: "xxxs" })
|
|
110
|
+
] })
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
);
|
|
32
115
|
};
|
|
33
116
|
export {
|
|
34
|
-
|
|
117
|
+
se as SelectTags
|
|
35
118
|
};
|
package/dist/bundle.es28.js
CHANGED
|
@@ -1,14 +1,123 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { Popover as T } from "./bundle.es10.js";
|
|
3
|
+
import { Input as w } from "./bundle.es13.js";
|
|
4
|
+
import { useState as A, useRef as j } from "react";
|
|
5
|
+
import { Calendar as E } from "./bundle.es56.js";
|
|
6
|
+
import { useDayDisableCheker as N } from "./bundle.es57.js";
|
|
7
|
+
import { getNum as h, formatTime as v } from "@companix/utils-js";
|
|
8
|
+
import { removeDigits as O } from "./bundle.es58.js";
|
|
9
|
+
import { SelectRightElements as Y } from "./bundle.es59.js";
|
|
10
|
+
const i = {
|
|
11
|
+
char: "-",
|
|
12
|
+
toString: (e) => {
|
|
13
|
+
if (e) {
|
|
14
|
+
const n = v(e.getDate()), r = v(e.getMonth() + 1), l = e.getFullYear();
|
|
15
|
+
return [n, r, l].join(i.char);
|
|
16
|
+
}
|
|
17
|
+
return "";
|
|
18
|
+
},
|
|
19
|
+
toValue: (e) => {
|
|
20
|
+
const n = e.split(i.char);
|
|
21
|
+
if (n.length === 3) {
|
|
22
|
+
const [r, l, a] = [h(n[0]), h(n[1]), h(n[2])];
|
|
23
|
+
if (r && l && a) {
|
|
24
|
+
const o = new Date(a, l - 1, r);
|
|
25
|
+
if (o.getFullYear() === a && o.getDate() === r && o.getMonth() === l - 1)
|
|
26
|
+
return o;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
}, U = (e) => {
|
|
32
|
+
const {
|
|
33
|
+
clearButton: n,
|
|
34
|
+
clearButtonIcon: r,
|
|
35
|
+
children: l,
|
|
36
|
+
disabled: a,
|
|
37
|
+
// calendar props
|
|
38
|
+
value: o,
|
|
39
|
+
enableTime: y,
|
|
40
|
+
disablePickers: I,
|
|
41
|
+
showNeighboringMonth: P,
|
|
42
|
+
onChange: c,
|
|
43
|
+
shouldDisableDate: g,
|
|
44
|
+
viewDate: S,
|
|
45
|
+
disablePast: d,
|
|
46
|
+
disableFuture: D,
|
|
47
|
+
minDateTime: C,
|
|
48
|
+
maxDateTime: b,
|
|
49
|
+
// input props
|
|
50
|
+
...V
|
|
51
|
+
} = e, [m, s] = A(() => i.toString(o ?? null)), p = j(null), k = N({
|
|
52
|
+
disableFuture: D,
|
|
53
|
+
disablePast: d,
|
|
54
|
+
shouldDisableDate: g,
|
|
55
|
+
minDateTime: C,
|
|
56
|
+
maxDateTime: b
|
|
57
|
+
}), B = (t) => {
|
|
58
|
+
a || p.current && p.current.getAttribute("data-state") === "open" && t.preventDefault();
|
|
59
|
+
}, F = (t) => {
|
|
60
|
+
t.stopPropagation(), s(""), c?.(null);
|
|
61
|
+
}, x = (t) => {
|
|
62
|
+
s(t);
|
|
63
|
+
const f = i.toValue(t);
|
|
64
|
+
f && !k(f) && c?.(f);
|
|
65
|
+
}, M = () => {
|
|
66
|
+
const t = i.toValue(m);
|
|
67
|
+
(!t || k(t)) && s(i.toString(o ?? null));
|
|
68
|
+
}, R = (t) => {
|
|
69
|
+
c?.(t), s(i.toString(t));
|
|
70
|
+
};
|
|
71
|
+
return /* @__PURE__ */ u(
|
|
72
|
+
T,
|
|
73
|
+
{
|
|
74
|
+
minimal: !0,
|
|
75
|
+
ref: p,
|
|
76
|
+
sideOffset: 0,
|
|
77
|
+
onOpenAutoFocus: (t) => t.preventDefault(),
|
|
78
|
+
onCloseAutoFocus: (t) => t.preventDefault(),
|
|
79
|
+
disabled: a,
|
|
80
|
+
fitMaxHeight: !1,
|
|
81
|
+
content: () => /* @__PURE__ */ u(
|
|
82
|
+
E,
|
|
83
|
+
{
|
|
84
|
+
value: o,
|
|
85
|
+
disablePast: d,
|
|
86
|
+
disableFuture: D,
|
|
87
|
+
enableTime: y,
|
|
88
|
+
disablePickers: I,
|
|
89
|
+
showNeighboringMonth: P,
|
|
90
|
+
onChange: R,
|
|
91
|
+
shouldDisableDate: g,
|
|
92
|
+
viewDate: S,
|
|
93
|
+
minDateTime: C,
|
|
94
|
+
maxDateTime: b
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
children: /* @__PURE__ */ u(
|
|
98
|
+
w,
|
|
99
|
+
{
|
|
100
|
+
...V,
|
|
101
|
+
value: m,
|
|
102
|
+
disabled: a,
|
|
103
|
+
onClick: B,
|
|
104
|
+
onValueChange: x,
|
|
105
|
+
onBlur: M,
|
|
106
|
+
mask: "99-99-9999",
|
|
107
|
+
rightElement: /* @__PURE__ */ u(
|
|
108
|
+
Y,
|
|
109
|
+
{
|
|
110
|
+
clearButton: n,
|
|
111
|
+
clearButtonIcon: r,
|
|
112
|
+
value: !!O(m, ["-", "_"]),
|
|
113
|
+
onClear: F
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
);
|
|
11
120
|
};
|
|
12
121
|
export {
|
|
13
|
-
|
|
122
|
+
U as DatePicker
|
|
14
123
|
};
|
package/dist/bundle.es29.js
CHANGED
|
@@ -1,88 +1,76 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, [h, n]), [o, l] = P(() => r.toString(n)), x = (t) => {
|
|
28
|
-
l(t);
|
|
29
|
-
const u = r.toValue(t);
|
|
30
|
-
u && e?.(u);
|
|
31
|
-
}, B = (t) => {
|
|
32
|
-
a || m.current && m.current.getAttribute("data-state") === "open" && t.preventDefault();
|
|
33
|
-
}, O = () => {
|
|
34
|
-
r.toValue(o) === null && l(r.toString(n ?? null));
|
|
35
|
-
}, R = (t) => {
|
|
36
|
-
e?.(r.toValue(t)), l(t);
|
|
37
|
-
}, k = (t) => {
|
|
38
|
-
t.stopPropagation(), l(""), e?.(null);
|
|
1
|
+
import { jsxs as D, jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as M, useEffect as C } from "react";
|
|
3
|
+
import { Select as c } from "./bundle.es12.js";
|
|
4
|
+
import { createDateValidation as O, getMonthMaxDay as T } from "./bundle.es58.js";
|
|
5
|
+
import { defaultMin as j, defaultMax as N, useCalendarOptions as V } from "./bundle.es60.js";
|
|
6
|
+
const B = ({
|
|
7
|
+
min: o = j,
|
|
8
|
+
max: e = N,
|
|
9
|
+
disabled: r,
|
|
10
|
+
value: a,
|
|
11
|
+
noDaySelect: g,
|
|
12
|
+
noYearSelect: u,
|
|
13
|
+
onChange: l,
|
|
14
|
+
required: m,
|
|
15
|
+
size: i
|
|
16
|
+
}) => {
|
|
17
|
+
const d = M(() => O({ min: o, max: e }), [o, e]);
|
|
18
|
+
C(() => {
|
|
19
|
+
const t = d(a);
|
|
20
|
+
t && l(t);
|
|
21
|
+
}, [d, a]);
|
|
22
|
+
const { years: p, months: w, days: f } = V({ min: o, max: e, now: a }), s = (t, x) => {
|
|
23
|
+
const n = { ...a };
|
|
24
|
+
n[t] = x;
|
|
25
|
+
const y = T(n.month, n.year);
|
|
26
|
+
n.day = n.day > y ? y : n.day, l(n);
|
|
39
27
|
};
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
28
|
+
return /* @__PURE__ */ D("div", { className: "data-input", children: [
|
|
29
|
+
!u && p.length > 0 && /* @__PURE__ */ h(
|
|
30
|
+
c,
|
|
31
|
+
{
|
|
32
|
+
placeholder: "Год",
|
|
33
|
+
options: p,
|
|
34
|
+
onChange: (t) => s("year", t),
|
|
35
|
+
value: a.year,
|
|
36
|
+
required: m,
|
|
37
|
+
disabled: r,
|
|
38
|
+
size: i,
|
|
39
|
+
minimalOptions: !0,
|
|
40
|
+
matchTarget: "min-width"
|
|
49
41
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
)
|
|
83
|
-
}
|
|
84
|
-
);
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ h(
|
|
44
|
+
c,
|
|
45
|
+
{
|
|
46
|
+
placeholder: "Месяц",
|
|
47
|
+
className: "w-full",
|
|
48
|
+
options: w,
|
|
49
|
+
onChange: (t) => s("month", t),
|
|
50
|
+
value: a.month,
|
|
51
|
+
disabled: r,
|
|
52
|
+
required: m,
|
|
53
|
+
size: i,
|
|
54
|
+
minimalOptions: !0,
|
|
55
|
+
matchTarget: "min-width"
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
!g && /* @__PURE__ */ h(
|
|
59
|
+
c,
|
|
60
|
+
{
|
|
61
|
+
placeholder: "День",
|
|
62
|
+
options: f,
|
|
63
|
+
disabled: r || f.length === 0,
|
|
64
|
+
onChange: (t) => s("day", t),
|
|
65
|
+
value: a.day,
|
|
66
|
+
required: m,
|
|
67
|
+
size: i,
|
|
68
|
+
minimalOptions: !0,
|
|
69
|
+
matchTarget: "min-width"
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] });
|
|
85
73
|
};
|
|
86
74
|
export {
|
|
87
|
-
|
|
75
|
+
B as DateInput
|
|
88
76
|
};
|
package/dist/bundle.es3.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { forwardRef as p } from "react";
|
|
3
|
-
import a from "classnames";
|
|
4
|
-
import { attr as i } from "@companix/utils-browser";
|
|
5
|
-
const c = p(
|
|
6
|
-
({ children: r, className: o, fill: t }, m) => /* @__PURE__ */ f("div", { ref: m, className: a("button-group", o), "data-fill": i(t), children: r })
|
|
7
|
-
);
|
|
1
|
+
const a = [16, 20, 24, 28, 32, 36, 40, 44, 48, 56, 64, 72, 80, 88, 96];
|
|
8
2
|
export {
|
|
9
|
-
|
|
3
|
+
a as avatarSizes
|
|
10
4
|
};
|
package/dist/bundle.es30.js
CHANGED
|
@@ -1,24 +1,35 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsxs as s, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { VisuallyHidden as p } from "@radix-ui/react-visually-hidden";
|
|
3
|
+
import { useRef as h, useMemo as m } from "react";
|
|
4
|
+
const j = ({
|
|
5
|
+
onChange: l,
|
|
6
|
+
disabled: n,
|
|
7
|
+
children: o,
|
|
8
|
+
multiple: f,
|
|
9
|
+
mimes: e,
|
|
10
|
+
className: a
|
|
11
|
+
}) => {
|
|
12
|
+
const t = h(null), u = (r) => {
|
|
13
|
+
n || (r.target.files && l?.(Array.from(r.target.files)), t.current && (t.current.value = ""));
|
|
14
|
+
}, c = m(() => {
|
|
15
|
+
if (e)
|
|
16
|
+
return e.map((r) => `${r}/*`).join(",");
|
|
17
|
+
}, [e]);
|
|
18
|
+
return /* @__PURE__ */ s("label", { className: a, children: [
|
|
19
|
+
o,
|
|
20
|
+
/* @__PURE__ */ i(p, { asChild: !0, children: /* @__PURE__ */ i(
|
|
21
|
+
"input",
|
|
9
22
|
{
|
|
10
|
-
ref:
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
role: "img",
|
|
17
|
-
children: /* @__PURE__ */ o(s, { paths: m })
|
|
23
|
+
ref: t,
|
|
24
|
+
type: "file",
|
|
25
|
+
multiple: f,
|
|
26
|
+
accept: c,
|
|
27
|
+
onChange: u,
|
|
28
|
+
disabled: n
|
|
18
29
|
}
|
|
19
|
-
)
|
|
20
|
-
}
|
|
21
|
-
|
|
30
|
+
) })
|
|
31
|
+
] });
|
|
32
|
+
};
|
|
22
33
|
export {
|
|
23
|
-
|
|
34
|
+
j as FileOverlay
|
|
24
35
|
};
|
package/dist/bundle.es31.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsxs as p, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import t from "classnames";
|
|
3
|
+
import { attr as n } from "@companix/utils-browser";
|
|
4
|
+
const u = (o) => {
|
|
5
|
+
const { fill: e, className: l, label: c, children: i, caption: r, apperance: m = "neutral" } = o;
|
|
6
|
+
return /* @__PURE__ */ p("div", { className: t("form-group", l), "data-fill": n(e), children: [
|
|
7
|
+
/* @__PURE__ */ a("div", { className: "form-group-label", children: c }),
|
|
8
|
+
i,
|
|
9
|
+
r && /* @__PURE__ */ a("div", { className: "form-group-caption", "data-appearance": m, children: r })
|
|
10
|
+
] });
|
|
6
11
|
};
|
|
7
12
|
export {
|
|
8
|
-
|
|
13
|
+
u as FormGroup
|
|
9
14
|
};
|