@companix/uikit 0.0.32 → 0.0.34
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/ThemeProvider/script.d.ts +1 -0
- package/dist/bundle.es.js +86 -77
- 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 -36
- package/dist/bundle.es33.js +22 -11
- package/dist/bundle.es34.js +6 -24
- package/dist/bundle.es35.js +33 -37
- package/dist/bundle.es36.js +20 -49
- package/dist/bundle.es37.js +10 -42
- package/dist/bundle.es38.js +24 -8
- package/dist/bundle.es39.js +35 -20
- package/dist/bundle.es4.js +44 -10
- package/dist/bundle.es40.js +51 -87
- package/dist/bundle.es41.js +42 -17
- package/dist/bundle.es42.js +8 -19
- package/dist/bundle.es43.js +25 -24
- package/dist/bundle.es44.js +24 -39
- package/dist/bundle.es45.js +87 -3
- package/dist/bundle.es46.js +18 -5
- package/dist/bundle.es47.js +19 -13
- package/dist/bundle.es48.js +24 -14
- package/dist/bundle.es49.js +39 -3
- package/dist/bundle.es5.js +8 -85
- package/dist/bundle.es50.js +3 -3
- package/dist/bundle.es51.js +5 -70
- package/dist/bundle.es52.js +13 -67
- package/dist/bundle.es53.js +13 -69
- package/dist/bundle.es54.js +3 -12
- package/dist/bundle.es55.js +3 -43
- package/dist/bundle.es56.js +69 -14
- package/dist/bundle.es57.js +67 -23
- 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 +41 -12
- package/dist/bundle.es61.js +15 -20
- package/dist/bundle.es62.js +32 -2
- package/dist/bundle.es63.js +69 -19
- package/dist/bundle.es64.js +76 -2
- package/dist/bundle.es65.js +49 -21
- package/dist/bundle.es66.js +14 -2
- package/dist/bundle.es67.js +9 -9
- package/dist/bundle.es68.js +2 -76
- 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 +3 -20
- package/dist/bundle.es75.js +3 -2
- package/dist/bundle.es76.js +14 -20
- package/dist/bundle.es77.js +2 -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 +7 -0
- package/dist/index.scss +2 -0
- package/package.json +1 -1
package/dist/bundle.es58.js
CHANGED
|
@@ -1,34 +1,72 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return
|
|
1
|
+
import { clamp as m } from "@companix/utils-browser";
|
|
2
|
+
import { formatTime as i } from "@companix/utils-js";
|
|
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
|
|
19
46
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
`alert-${e}`
|
|
30
|
-
)) });
|
|
31
|
-
});
|
|
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
|
+
};
|
|
32
55
|
export {
|
|
33
|
-
|
|
56
|
+
c as DEFAULT_MAX_YEAR,
|
|
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
|
|
34
72
|
};
|
package/dist/bundle.es59.js
CHANGED
|
@@ -1,72 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
showToast: (t) => {
|
|
13
|
-
p((o) => {
|
|
14
|
-
const e = [...o], n = o.findIndex((s) => s.id === t.id);
|
|
15
|
-
return n === -1 ? e.push(t) : e[n] = t, e;
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}),
|
|
19
|
-
[]
|
|
20
|
-
);
|
|
21
|
-
const m = P((t) => {
|
|
22
|
-
t.forEach(({ id: o }, e) => {
|
|
23
|
-
let n = 0;
|
|
24
|
-
for (let s = e + 1; s < t.length; s++)
|
|
25
|
-
a[t[s].id] && (n += a[t[s].id].clientHeight + d);
|
|
26
|
-
a[o] && a[o].style.setProperty("--offset", `${n}px`);
|
|
27
|
-
});
|
|
28
|
-
}, []), v = (t) => {
|
|
29
|
-
p((o) => {
|
|
30
|
-
const e = [...o], n = e.findIndex((s) => s.id === t);
|
|
31
|
-
return n !== -1 && e.splice(n, 1), e;
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
return /* @__PURE__ */ y(
|
|
35
|
-
c.Provider,
|
|
36
|
-
{
|
|
37
|
-
swipeThreshold: x,
|
|
38
|
-
swipeDirection: u[`${l}-${f}`],
|
|
39
|
-
children: [
|
|
40
|
-
i.map(({ id: t, ...o }) => /* @__PURE__ */ j(
|
|
41
|
-
E,
|
|
42
|
-
{
|
|
43
|
-
...o,
|
|
44
|
-
id: t,
|
|
45
|
-
key: `toaster-${t}`,
|
|
46
|
-
duration: o.duration ?? g,
|
|
47
|
-
closeIcon: T,
|
|
48
|
-
onInitialized: (e) => {
|
|
49
|
-
a[t] = e, m(i);
|
|
50
|
-
},
|
|
51
|
-
onClosing: () => {
|
|
52
|
-
delete a[t], m(i);
|
|
53
|
-
},
|
|
54
|
-
onClosed: () => v(t)
|
|
55
|
-
}
|
|
56
|
-
)),
|
|
57
|
-
/* @__PURE__ */ I(
|
|
58
|
-
c.Viewport,
|
|
59
|
-
{
|
|
60
|
-
"data-side": l,
|
|
61
|
-
"data-align": f,
|
|
62
|
-
className: "toaster-viewport",
|
|
63
|
-
style: k({ "--toasters-gap": `${d}px` })
|
|
64
|
-
}
|
|
65
|
-
)
|
|
66
|
-
]
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
});
|
|
1
|
+
import { jsxs as a, Fragment as l, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { f as i } from "./bundle.es55.js";
|
|
3
|
+
import { f as m } from "./bundle.es54.js";
|
|
4
|
+
import { Icon as e } from "./bundle.es33.js";
|
|
5
|
+
const C = (s) => {
|
|
6
|
+
const { clearButton: n, clearButtonIcon: t, value: c, onClear: r } = s;
|
|
7
|
+
return /* @__PURE__ */ a(l, { children: [
|
|
8
|
+
n && c && /* @__PURE__ */ o("button", { className: "select-close-button", onClick: r, children: t ?? /* @__PURE__ */ o(e, { className: "select-close-icon", icon: i.faClose, size: "xxxs" }) }),
|
|
9
|
+
/* @__PURE__ */ o(e, { className: "expand-icon select-expand", icon: m.faChevronDown, size: "xxxs" })
|
|
10
|
+
] });
|
|
11
|
+
};
|
|
70
12
|
export {
|
|
71
|
-
|
|
13
|
+
C as SelectRightElements
|
|
72
14
|
};
|
package/dist/bundle.es6.js
CHANGED
|
@@ -1,87 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}) => {
|
|
12
|
-
const l = d(null), t = d(null), r = f(() => ({ positons: { top: 0, y: 0 }, scrollRatio: 0 }), []), i = f(() => ({
|
|
13
|
-
start() {
|
|
14
|
-
document.addEventListener("mousemove", a), document.addEventListener("mouseup", m);
|
|
15
|
-
},
|
|
16
|
-
clear() {
|
|
17
|
-
document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", m);
|
|
18
|
-
}
|
|
19
|
-
}), []);
|
|
20
|
-
T(() => {
|
|
21
|
-
const o = new ResizeObserver(u);
|
|
22
|
-
return t.current && p(t.current, (e) => {
|
|
23
|
-
o.observe(e);
|
|
24
|
-
}), () => {
|
|
25
|
-
t.current && p(t.current, (e) => {
|
|
26
|
-
o.unobserve(e);
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
}, []), H(() => {
|
|
30
|
-
u();
|
|
31
|
-
}, []);
|
|
32
|
-
const u = n(() => {
|
|
33
|
-
const { current: o } = t, { current: e } = l;
|
|
34
|
-
if (e && o) {
|
|
35
|
-
const s = o.clientHeight / o.scrollHeight;
|
|
36
|
-
e.style.height = h(s * 100), e.style.display = s === 1 ? "none" : "block", r.scrollRatio = s;
|
|
37
|
-
}
|
|
38
|
-
}, []), a = n(({ clientY: o }) => {
|
|
39
|
-
const { current: e } = t;
|
|
40
|
-
if (e) {
|
|
41
|
-
const s = o - r.positons.y;
|
|
42
|
-
e.scrollTop = r.positons.top + s / r.scrollRatio;
|
|
43
|
-
}
|
|
44
|
-
}, []), m = n(() => {
|
|
45
|
-
i.clear();
|
|
46
|
-
}, []), E = n(({ clientY: o }) => {
|
|
47
|
-
const { current: e } = t;
|
|
48
|
-
e && (r.positons = {
|
|
49
|
-
top: e.scrollTop,
|
|
50
|
-
y: o
|
|
51
|
-
}), i.start();
|
|
52
|
-
}, []), M = () => {
|
|
53
|
-
requestAnimationFrame(() => {
|
|
54
|
-
const { current: o } = t, { current: e } = l;
|
|
55
|
-
e && o && (e.style.top = h(o.scrollTop * 100 / o.scrollHeight));
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
return /* @__PURE__ */ x("div", { className: "relative h-full overflow-hidden", children: [
|
|
59
|
-
/* @__PURE__ */ c(
|
|
60
|
-
"div",
|
|
61
|
-
{
|
|
62
|
-
className: L("hidden-scroll h-full overflow-y-scroll", g),
|
|
63
|
-
onScroll: M,
|
|
64
|
-
ref: t,
|
|
65
|
-
children: b
|
|
66
|
-
}
|
|
67
|
-
),
|
|
68
|
-
/* @__PURE__ */ c(
|
|
69
|
-
"div",
|
|
70
|
-
{
|
|
71
|
-
className: "absolute right-0 top-0 box-border h-full",
|
|
72
|
-
style: { width: v(w), padding: v(R) },
|
|
73
|
-
children: /* @__PURE__ */ c(
|
|
74
|
-
"div",
|
|
75
|
-
{
|
|
76
|
-
onMouseDown: E,
|
|
77
|
-
className: `${y} relative w-full rounded-full`,
|
|
78
|
-
ref: l
|
|
79
|
-
}
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
)
|
|
83
|
-
] });
|
|
84
|
-
};
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import n from "classnames";
|
|
3
|
+
const d = ({ size: r = 40, className: t, width: e = 2, color: i = "inherit" }) => /* @__PURE__ */ o(
|
|
4
|
+
"div",
|
|
5
|
+
{
|
|
6
|
+
style: { width: `${r}px`, height: `${r}px`, color: i, borderWidth: `${e}px` },
|
|
7
|
+
className: n("spinner-border", t),
|
|
8
|
+
role: "status"
|
|
9
|
+
}
|
|
10
|
+
);
|
|
85
11
|
export {
|
|
86
|
-
|
|
12
|
+
d as Spinner
|
|
87
13
|
};
|
package/dist/bundle.es60.js
CHANGED
|
@@ -1,16 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { DefaultMonths as f, getMonthMaxDay as i } from "./bundle.es58.js";
|
|
2
|
+
import { useMemo as s } from "react";
|
|
3
|
+
import { range as l } from "@companix/utils-js";
|
|
4
|
+
const p = { day: 31, month: 12, year: 2050 }, u = { day: 1, month: 1, year: 1900 }, I = ({ min: t = u, max: e = p, now: r }) => {
|
|
5
|
+
const h = s(() => l(e.year, t.year).map((n) => ({
|
|
6
|
+
title: n.toString(),
|
|
7
|
+
value: n
|
|
8
|
+
})), [e.year, t.year]), d = s(() => {
|
|
9
|
+
const n = f.map((o, a) => ({
|
|
10
|
+
title: o,
|
|
11
|
+
value: a + 1
|
|
12
|
+
}));
|
|
13
|
+
if (t.month && r.year === t.year) {
|
|
14
|
+
const o = n.findIndex(({ value: a }) => a === t.month);
|
|
15
|
+
n.splice(0, o);
|
|
8
16
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
17
|
+
if (e.month && r.year === e.year) {
|
|
18
|
+
const o = n.findIndex(({ value: a }) => a === e.month);
|
|
19
|
+
n.splice(o + 1, n.length);
|
|
20
|
+
}
|
|
21
|
+
return n;
|
|
22
|
+
}, [r.year, t.year, t.month, e.year, e.month]), c = s(() => {
|
|
23
|
+
if (r.month === 0)
|
|
24
|
+
return [];
|
|
25
|
+
const n = i(r.month, r.year), o = Array.from({ length: n }, (a, y) => ({
|
|
26
|
+
title: `${y + 1}`,
|
|
27
|
+
value: y + 1
|
|
28
|
+
}));
|
|
29
|
+
if (t.day && r.month === t.month && r.year === t.year) {
|
|
30
|
+
const a = o.findIndex(({ value: y }) => y === t.day);
|
|
31
|
+
o.splice(0, a);
|
|
32
|
+
}
|
|
33
|
+
if (e.day && r.month === e.month && r.year === e.year) {
|
|
34
|
+
const a = o.findIndex(({ value: y }) => y === e.day);
|
|
35
|
+
o.splice(a + 1, o.length);
|
|
36
|
+
}
|
|
37
|
+
return o;
|
|
38
|
+
}, [r.month, r.year, t, e]);
|
|
39
|
+
return { years: h, months: d, days: c };
|
|
13
40
|
};
|
|
14
41
|
export {
|
|
15
|
-
|
|
42
|
+
p as defaultMax,
|
|
43
|
+
u as defaultMin,
|
|
44
|
+
I as useCalendarOptions
|
|
16
45
|
};
|
package/dist/bundle.es61.js
CHANGED
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
}
|
|
1
|
+
const r = (e, o) => {
|
|
2
|
+
let t;
|
|
3
|
+
try {
|
|
4
|
+
t = localStorage.getItem(e) || void 0;
|
|
5
|
+
} catch {
|
|
6
|
+
}
|
|
7
|
+
return t ?? o;
|
|
8
|
+
}, m = (e) => (e || (e = window.matchMedia("(prefers-color-scheme: dark)")), e.matches ? "dark" : "light"), s = (e) => {
|
|
9
|
+
const [o, t] = ["theme-light", "theme-dark"];
|
|
10
|
+
let c = e;
|
|
11
|
+
e === "system" && (c = m()), document.documentElement.classList.remove(o, t), document.documentElement.classList.add(c === "dark" ? t : o), document.documentElement.style.colorScheme = c;
|
|
12
|
+
};
|
|
20
13
|
export {
|
|
21
|
-
|
|
14
|
+
r as getColorScheme,
|
|
15
|
+
m as getSystemColorScheme,
|
|
16
|
+
s as updateDOM
|
|
22
17
|
};
|
package/dist/bundle.es62.js
CHANGED
|
@@ -1,4 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as s, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as f, useState as u, useImperativeHandle as c } from "react";
|
|
3
|
+
import { AlertDialog as x } from "./bundle.es22.js";
|
|
4
|
+
const g = f((a, l) => {
|
|
5
|
+
const [i, n] = u([]);
|
|
6
|
+
c(
|
|
7
|
+
l,
|
|
8
|
+
() => ({
|
|
9
|
+
showAlert: (e) => {
|
|
10
|
+
n((t) => [...t, e]);
|
|
11
|
+
}
|
|
12
|
+
}),
|
|
13
|
+
[]
|
|
14
|
+
);
|
|
15
|
+
const d = (e) => {
|
|
16
|
+
n((t) => {
|
|
17
|
+
const r = [...t], o = r.findIndex((m) => m.id === e);
|
|
18
|
+
return o !== -1 && r.splice(o, 1), r;
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ s(p, { children: i.map(({ id: e, ...t }) => /* @__PURE__ */ s(
|
|
22
|
+
x,
|
|
23
|
+
{
|
|
24
|
+
defaultOpen: !0,
|
|
25
|
+
onUnMounted: () => d(e),
|
|
26
|
+
...a,
|
|
27
|
+
...t
|
|
28
|
+
},
|
|
29
|
+
`alert-${e}`
|
|
30
|
+
)) });
|
|
31
|
+
});
|
|
2
32
|
export {
|
|
3
|
-
|
|
33
|
+
g as Viewport
|
|
4
34
|
};
|
package/dist/bundle.es63.js
CHANGED
|
@@ -1,22 +1,72 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsxs as y, jsx as I } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as $, useState as b, useMemo as C, useImperativeHandle as w, useCallback as P, createElement as j } from "react";
|
|
3
|
+
import * as c from "@radix-ui/react-toast";
|
|
4
|
+
import { customCSS as k } from "@companix/utils-browser";
|
|
5
|
+
import { Toast as E } from "./bundle.es40.js";
|
|
6
|
+
var u = /* @__PURE__ */ ((r) => (r["top-center"] = "up", r["top-left"] = "left", r["top-right"] = "right", r["bottom-center"] = "down", r["bottom-left"] = "left", r["bottom-right"] = "right", r))(u || {});
|
|
7
|
+
const M = $((r, h) => {
|
|
8
|
+
const { side: l = "top", align: f = "center", gap: d = 14, duration: g, swipeThreshold: x, closeIcon: T } = r, [i, p] = b([]), a = C(() => ({}), []);
|
|
9
|
+
w(
|
|
10
|
+
h,
|
|
11
|
+
() => ({
|
|
12
|
+
showToast: (t) => {
|
|
13
|
+
p((o) => {
|
|
14
|
+
const e = [...o], n = o.findIndex((s) => s.id === t.id);
|
|
15
|
+
return n === -1 ? e.push(t) : e[n] = t, e;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}),
|
|
19
|
+
[]
|
|
20
|
+
);
|
|
21
|
+
const m = P((t) => {
|
|
22
|
+
t.forEach(({ id: o }, e) => {
|
|
23
|
+
let n = 0;
|
|
24
|
+
for (let s = e + 1; s < t.length; s++)
|
|
25
|
+
a[t[s].id] && (n += a[t[s].id].clientHeight + d);
|
|
26
|
+
a[o] && a[o].style.setProperty("--offset", `${n}px`);
|
|
27
|
+
});
|
|
28
|
+
}, []), v = (t) => {
|
|
29
|
+
p((o) => {
|
|
30
|
+
const e = [...o], n = e.findIndex((s) => s.id === t);
|
|
31
|
+
return n !== -1 && e.splice(n, 1), e;
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ y(
|
|
35
|
+
c.Provider,
|
|
36
|
+
{
|
|
37
|
+
swipeThreshold: x,
|
|
38
|
+
swipeDirection: u[`${l}-${f}`],
|
|
39
|
+
children: [
|
|
40
|
+
i.map(({ id: t, ...o }) => /* @__PURE__ */ j(
|
|
41
|
+
E,
|
|
42
|
+
{
|
|
43
|
+
...o,
|
|
44
|
+
id: t,
|
|
45
|
+
key: `toaster-${t}`,
|
|
46
|
+
duration: o.duration ?? g,
|
|
47
|
+
closeIcon: T,
|
|
48
|
+
onInitialized: (e) => {
|
|
49
|
+
a[t] = e, m(i);
|
|
50
|
+
},
|
|
51
|
+
onClosing: () => {
|
|
52
|
+
delete a[t], m(i);
|
|
53
|
+
},
|
|
54
|
+
onClosed: () => v(t)
|
|
55
|
+
}
|
|
56
|
+
)),
|
|
57
|
+
/* @__PURE__ */ I(
|
|
58
|
+
c.Viewport,
|
|
59
|
+
{
|
|
60
|
+
"data-side": l,
|
|
61
|
+
"data-align": f,
|
|
62
|
+
className: "toaster-viewport",
|
|
63
|
+
style: k({ "--toasters-gap": `${d}px` })
|
|
64
|
+
}
|
|
65
|
+
)
|
|
16
66
|
]
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
}
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
});
|
|
20
70
|
export {
|
|
21
|
-
|
|
71
|
+
M as Viewport
|
|
22
72
|
};
|
package/dist/bundle.es64.js
CHANGED
|
@@ -1,4 +1,78 @@
|
|
|
1
|
-
|
|
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.es12.js";
|
|
4
|
+
import { getMonths as Y, getYears as k, DEFAULT_MAX_YEAR as u, DEFAULT_MIN_YEAR as g } from "./bundle.es58.js";
|
|
5
|
+
import { Icon as C } from "./bundle.es33.js";
|
|
6
|
+
import { f as z } from "./bundle.es74.js";
|
|
7
|
+
import { f as L } from "./bundle.es75.js";
|
|
8
|
+
import { setMonth as R, setYear as T } from "./bundle.es57.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
|
+
};
|
|
2
76
|
export {
|
|
3
|
-
|
|
77
|
+
S as CalendarHeader
|
|
4
78
|
};
|