@companix/uikit 0.1.14 → 0.1.16
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/DrawerMobile/MobileDrawer.scss +71 -0
- package/dist/DrawerMobile/constants.d.ts +9 -0
- package/dist/DrawerMobile/context.d.ts +18 -0
- package/dist/DrawerMobile/helpers.d.ts +13 -0
- package/dist/DrawerMobile/index.d.ts +17 -0
- package/dist/DrawerMobile/types.d.ts +5 -0
- package/dist/DrawerMobile/use-prevent-scroll.d.ts +5 -0
- package/dist/Popup/index.d.ts +4 -2
- package/dist/Scrollable/Scrollable.scss +0 -5
- package/dist/__helpers/createPopupRegistry.d.ts +4 -0
- package/dist/bundle.es.js +112 -109
- package/dist/bundle.es10.js +1 -1
- package/dist/bundle.es13.js +4 -4
- package/dist/bundle.es14.js +4 -4
- package/dist/bundle.es15.js +2 -2
- package/dist/bundle.es16.js +1 -1
- package/dist/bundle.es17.js +1 -1
- package/dist/bundle.es19.js +1 -1
- package/dist/bundle.es22.js +1 -1
- package/dist/bundle.es23.js +260 -13
- package/dist/bundle.es24.js +14 -21
- package/dist/bundle.es25.js +20 -37
- package/dist/bundle.es26.js +38 -21
- package/dist/bundle.es27.js +20 -18
- package/dist/bundle.es28.js +18 -20
- package/dist/bundle.es29.js +20 -43
- package/dist/bundle.es30.js +37 -114
- package/dist/bundle.es31.js +119 -72
- package/dist/bundle.es32.js +68 -38
- package/dist/bundle.es33.js +42 -10
- package/dist/bundle.es34.js +11 -85
- package/dist/bundle.es35.js +85 -19
- package/dist/bundle.es36.js +20 -7
- package/dist/bundle.es37.js +7 -3
- package/dist/bundle.es38.js +3 -23
- package/dist/bundle.es39.js +16 -45
- package/dist/bundle.es40.js +51 -56
- package/dist/bundle.es41.js +57 -162
- package/dist/bundle.es42.js +160 -79
- package/dist/bundle.es43.js +81 -7
- package/dist/bundle.es44.js +7 -35
- package/dist/bundle.es45.js +33 -20
- package/dist/bundle.es46.js +19 -47
- package/dist/bundle.es47.js +49 -11
- package/dist/bundle.es48.js +11 -13
- package/dist/bundle.es49.js +13 -13
- package/dist/bundle.es50.js +13 -30
- package/dist/bundle.es51.js +29 -25
- package/dist/bundle.es52.js +17 -29
- package/dist/bundle.es53.js +36 -48
- package/dist/bundle.es54.js +49 -50
- package/dist/bundle.es55.js +56 -8
- package/dist/bundle.es56.js +8 -26
- package/dist/bundle.es57.js +27 -5
- package/dist/bundle.es58.js +5 -66
- package/dist/bundle.es59.js +66 -23
- package/dist/bundle.es60.js +22 -23
- package/dist/bundle.es61.js +24 -88
- package/dist/bundle.es62.js +88 -18
- package/dist/bundle.es63.js +17 -92
- package/dist/bundle.es64.js +92 -73
- package/dist/bundle.es65.js +73 -23
- package/dist/bundle.es66.js +20 -35
- package/dist/bundle.es67.js +37 -68
- package/dist/bundle.es68.js +23 -10
- package/dist/bundle.es69.js +78 -42
- package/dist/bundle.es70.js +93 -33
- package/dist/bundle.es71.js +10 -66
- package/dist/bundle.es72.js +69 -40
- package/dist/bundle.es73.js +10 -14
- package/dist/bundle.es74.js +43 -32
- package/dist/bundle.es75.js +32 -69
- package/dist/bundle.es76.js +64 -12
- package/dist/bundle.es77.js +41 -75
- package/dist/bundle.es78.js +14 -48
- package/dist/bundle.es79.js +32 -14
- package/dist/bundle.es80.js +72 -0
- package/dist/bundle.es81.js +77 -0
- package/dist/bundle.es82.js +51 -0
- package/dist/bundle.es83.js +16 -0
- package/dist/bundle.es84.js +16 -0
- package/dist/bundle.es9.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.scss +1 -0
- package/package.json +1 -1
package/dist/bundle.es72.js
CHANGED
|
@@ -1,43 +1,72 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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.es65.js";
|
|
3
|
+
import { CalendarHeader as F } from "./bundle.es81.js";
|
|
4
|
+
import { useCalendar as j } from "./bundle.es82.js";
|
|
5
|
+
import { attr as m } from "@companix/utils-browser";
|
|
6
|
+
import { isSameDate as f } from "./bundle.es59.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?.();
|
|
24
57
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
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
|
+
);
|
|
69
|
+
};
|
|
36
70
|
export {
|
|
37
|
-
|
|
38
|
-
a as getNodeTextContent,
|
|
39
|
-
l as getPlainTextOffset,
|
|
40
|
-
f as getTextSelectionOffsets,
|
|
41
|
-
d as normalizeEditorText,
|
|
42
|
-
g as scrollSelectionIntoView
|
|
71
|
+
T as Calendar
|
|
43
72
|
};
|
package/dist/bundle.es73.js
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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;
|
|
1
|
+
import { jsxs as r, Fragment as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { faXmark as i, faChevronDown as m } from "@companix/icons-solid";
|
|
3
|
+
import { Icon as o } from "./bundle.es36.js";
|
|
4
|
+
const f = (n) => {
|
|
5
|
+
const { clearButton: c, clearButtonIcon: t, value: s, onClear: l } = n;
|
|
6
|
+
return /* @__PURE__ */ r(a, { children: [
|
|
7
|
+
c && s && /* @__PURE__ */ e("button", { className: "select-close-button", onClick: l, children: t ?? /* @__PURE__ */ e(o, { className: "select-close-icon", icon: i, size: "xxxs" }) }),
|
|
8
|
+
/* @__PURE__ */ e(o, { className: "expand-icon select-expand", icon: m, size: "xxxs" })
|
|
9
|
+
] });
|
|
12
10
|
};
|
|
13
11
|
export {
|
|
14
|
-
|
|
15
|
-
m as getSystemColorScheme,
|
|
16
|
-
s as updateDOM
|
|
12
|
+
f as SelectRightElements
|
|
17
13
|
};
|
package/dist/bundle.es74.js
CHANGED
|
@@ -1,34 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
const
|
|
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 { DefaultMonths as f, getMonthMaxDay as i } from "./bundle.es65.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);
|
|
16
|
+
}
|
|
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 };
|
|
40
|
+
};
|
|
32
41
|
export {
|
|
33
|
-
|
|
42
|
+
p as defaultMax,
|
|
43
|
+
u as defaultMin,
|
|
44
|
+
I as useCalendarOptions
|
|
34
45
|
};
|
package/dist/bundle.es75.js
CHANGED
|
@@ -1,72 +1,35 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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`);
|
|
1
|
+
import { jsxs as E, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as p, useState as v, useLayoutEffect as N, useEffect as y } from "react";
|
|
3
|
+
import { Editor as R } from "./bundle.es42.js";
|
|
4
|
+
const k = (d) => {
|
|
5
|
+
const {
|
|
6
|
+
id: e,
|
|
7
|
+
className: f,
|
|
8
|
+
inputClassName: i,
|
|
9
|
+
placeholderClassName: m,
|
|
10
|
+
placeholder: r,
|
|
11
|
+
value: s,
|
|
12
|
+
inputMode: n,
|
|
13
|
+
onCreate: b,
|
|
14
|
+
onClick: A
|
|
15
|
+
} = d, u = p(null), o = p(null), [h, a] = v(!0);
|
|
16
|
+
return N(() => {
|
|
17
|
+
const t = document.createElement("span");
|
|
18
|
+
t.setAttribute("contenteditable", "true"), t.setAttribute("class", i), t.dataset.placeholder = r, e && t.setAttribute("id", e), n && t.setAttribute("inputmode", n), u.current && u.current.appendChild(t);
|
|
19
|
+
const l = new R(t), C = l.onContentChange((x) => {
|
|
20
|
+
a(x.length === 0);
|
|
27
21
|
});
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
c
|
|
36
|
-
{
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
});
|
|
22
|
+
return b(l), o.current = t, () => {
|
|
23
|
+
C(), o.current = null, t.remove();
|
|
24
|
+
};
|
|
25
|
+
}, []), y(() => {
|
|
26
|
+
const t = o.current;
|
|
27
|
+
t && (e && t.setAttribute("id", e), n && t.setAttribute("inputmode", n), s && (t.textContent = s, a(!1)), t.setAttribute("class", i), t.setAttribute("role", "textbox"), t.setAttribute("aria-multiline", "true"), r && t.setAttribute("aria-label", r));
|
|
28
|
+
}, [e, i, n, r, s]), /* @__PURE__ */ E("div", { role: "presentation", className: f, children: [
|
|
29
|
+
h && /* @__PURE__ */ c("span", { "aria-hidden": "true", className: m, children: r }),
|
|
30
|
+
/* @__PURE__ */ c("div", { role: "presentation", ref: u, onClick: A })
|
|
31
|
+
] });
|
|
32
|
+
};
|
|
70
33
|
export {
|
|
71
|
-
|
|
34
|
+
k as WriteBarInput
|
|
72
35
|
};
|
package/dist/bundle.es76.js
CHANGED
|
@@ -1,16 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
var a = /* @__PURE__ */ ((o) => (o.Mod = "Mod", o.Alt = "Alt", o.Shift = "Shift", o.Meta = "Meta", o))(a || {});
|
|
2
|
+
const l = [
|
|
3
|
+
"Shift",
|
|
4
|
+
"Mod",
|
|
5
|
+
"ArrowDown",
|
|
6
|
+
"ArrowUp",
|
|
7
|
+
"Mod+ArrowDown",
|
|
8
|
+
"Mod+ArrowUp",
|
|
9
|
+
"Enter",
|
|
10
|
+
"Escape",
|
|
11
|
+
"Backspace",
|
|
12
|
+
"Shift+Enter",
|
|
13
|
+
"Mod+Enter",
|
|
14
|
+
"ArrowLeft",
|
|
15
|
+
"ArrowRight",
|
|
16
|
+
"Tab",
|
|
17
|
+
"Shift+Tab",
|
|
18
|
+
"Space",
|
|
19
|
+
"Mod+B",
|
|
20
|
+
"Mod+U",
|
|
21
|
+
"Mod+I",
|
|
22
|
+
"Mod+S",
|
|
23
|
+
"Mod+K",
|
|
24
|
+
"Mod+Equal",
|
|
25
|
+
"Mod+Shift+Equal",
|
|
26
|
+
"Mod+Minus",
|
|
27
|
+
"Mod+Shift+Minus",
|
|
28
|
+
"PageUp",
|
|
29
|
+
"PageDown",
|
|
30
|
+
"Home",
|
|
31
|
+
"End"
|
|
32
|
+
], c = typeof navigator < "u" && /Mac|iPhone|iPad|iPod/i.test(navigator.platform), d = (o) => o.key === "Meta" || o.metaKey, s = (o) => o.key === "Control" || o.ctrlKey, M = {
|
|
33
|
+
Mod: (o) => c ? d(o) : s(o),
|
|
34
|
+
Alt: (o) => o.key === "Alt" || o.altKey,
|
|
35
|
+
Shift: (o) => o.key === "Shift" || o.shiftKey,
|
|
36
|
+
Meta: (o) => c ? s(o) : d(o)
|
|
37
|
+
}, f = (o) => {
|
|
38
|
+
try {
|
|
39
|
+
const t = [];
|
|
40
|
+
for (const e of Object.values(a))
|
|
41
|
+
M[e](o) && t.push(e);
|
|
42
|
+
if (["Meta", "Control", "Alt", "Shift"].includes(o.key)) {
|
|
43
|
+
const e = t.join("+");
|
|
44
|
+
return { key: e, code: e };
|
|
8
45
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
46
|
+
const r = ["Key", "Digit", "Numpad"].find((e) => o.code.startsWith(e)), n = r ? o.code.slice(r.length) : o.code, i = o.key.length === 1 ? o.key.toUpperCase() : o.key;
|
|
47
|
+
return {
|
|
48
|
+
key: [...t, i].join("+"),
|
|
49
|
+
code: [...t, n].join("+")
|
|
50
|
+
};
|
|
51
|
+
} catch {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
}, y = (o) => {
|
|
55
|
+
const t = f(o);
|
|
56
|
+
if (!t)
|
|
57
|
+
return null;
|
|
58
|
+
const { key: r, code: n } = t;
|
|
59
|
+
return [r, n].find((i) => l.includes(i)) ?? null;
|
|
60
|
+
}, u = (o) => (t) => {
|
|
61
|
+
o(y(t), t);
|
|
13
62
|
};
|
|
14
63
|
export {
|
|
15
|
-
|
|
64
|
+
a as Modifier,
|
|
65
|
+
f as getKeyCombo,
|
|
66
|
+
y as getModuleKeyCombo,
|
|
67
|
+
u as onElementKeyDownFactory
|
|
16
68
|
};
|
package/dist/bundle.es77.js
CHANGED
|
@@ -1,77 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
r === 11 ? 0 : r + 1,
|
|
37
|
-
r === 11 ? Math.min(e + 1, f) : e
|
|
38
|
-
));
|
|
39
|
-
let i = r === 0 && e === g;
|
|
40
|
-
return a && !i && (i = a(
|
|
41
|
-
r === 0 ? 11 : r - 1,
|
|
42
|
-
r === 0 ? Math.max(e - 1, g) : e
|
|
43
|
-
)), /* @__PURE__ */ d("div", { className: "calendar-header", children: [
|
|
44
|
-
!i && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "left", onClick: v, children: /* @__PURE__ */ o(C, { icon: E }) }),
|
|
45
|
-
/* @__PURE__ */ d("div", { className: "calendar-pickers", children: [
|
|
46
|
-
/* @__PURE__ */ o(
|
|
47
|
-
p,
|
|
48
|
-
{
|
|
49
|
-
fill: !0,
|
|
50
|
-
options: Y,
|
|
51
|
-
size: "sm",
|
|
52
|
-
value: e,
|
|
53
|
-
minimalOptions: !0,
|
|
54
|
-
matchTarget: "min-width",
|
|
55
|
-
onChange: (t) => x(t)
|
|
56
|
-
}
|
|
57
|
-
),
|
|
58
|
-
/* @__PURE__ */ o(
|
|
59
|
-
p,
|
|
60
|
-
{
|
|
61
|
-
fill: !0,
|
|
62
|
-
options: A,
|
|
63
|
-
size: "sm",
|
|
64
|
-
className: "capitalize",
|
|
65
|
-
value: r,
|
|
66
|
-
minimalOptions: !0,
|
|
67
|
-
matchTarget: "min-width",
|
|
68
|
-
onChange: (t) => M(t)
|
|
69
|
-
}
|
|
70
|
-
)
|
|
71
|
-
] }),
|
|
72
|
-
!l && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "right", onClick: N, children: /* @__PURE__ */ o(C, { icon: T }) })
|
|
73
|
-
] });
|
|
74
|
-
};
|
|
1
|
+
import { isTextNode as s, isElementNode as i } from "@companix/utils-browser";
|
|
2
|
+
const a = (t) => s(t) ? t.nodeValue || "" : i(t) && t.nodeName === "IMG" ? t.getAttribute("alt") || "" : i(t) && t.nodeName === "DIV" || i(t) && t.nodeName === "BR" && !(t.parentElement && i(t.parentElement) && t.parentElement.nodeName === "DIV" && t.parentElement.getAttribute("contenteditable") !== "true") ? `
|
|
3
|
+
` : "", m = (t) => {
|
|
4
|
+
const e = document.getSelection();
|
|
5
|
+
if (!e || e.rangeCount === 0)
|
|
6
|
+
return {};
|
|
7
|
+
const n = e.getRangeAt(0);
|
|
8
|
+
return n && t.contains(n.commonAncestorContainer) ? { range: n, selection: e } : {};
|
|
9
|
+
}, l = (t, e, n) => {
|
|
10
|
+
let r = n, o = e;
|
|
11
|
+
t === e && (r = 0, o = t.childNodes[n]);
|
|
12
|
+
const c = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT);
|
|
13
|
+
for (; c.nextNode(); ) {
|
|
14
|
+
if (c.currentNode === o)
|
|
15
|
+
return r;
|
|
16
|
+
r += a(c.currentNode).length;
|
|
17
|
+
}
|
|
18
|
+
return r;
|
|
19
|
+
}, f = (t, e) => {
|
|
20
|
+
const n = l(t, e.startContainer, e.startOffset);
|
|
21
|
+
return {
|
|
22
|
+
from: n,
|
|
23
|
+
to: e.collapsed ? n : l(t, e.endContainer, e.endOffset)
|
|
24
|
+
};
|
|
25
|
+
}, g = () => {
|
|
26
|
+
const t = window.getSelection();
|
|
27
|
+
if (!t || !t.rangeCount) return;
|
|
28
|
+
const e = t.getRangeAt(0);
|
|
29
|
+
if (e.commonAncestorContainer === document) return;
|
|
30
|
+
const n = e.commonAncestorContainer.parentElement;
|
|
31
|
+
if (!n) return;
|
|
32
|
+
const r = n.getBoundingClientRect(), o = e.getBoundingClientRect().bottom - r.bottom;
|
|
33
|
+
o > 0 && n.scrollBy({ top: o });
|
|
34
|
+
}, d = (t) => t.replace(/ /gi, " ").replace(/<br\s*\/?>/gi, `
|
|
35
|
+
`);
|
|
75
36
|
export {
|
|
76
|
-
|
|
37
|
+
m as getEditorSelection,
|
|
38
|
+
a as getNodeTextContent,
|
|
39
|
+
l as getPlainTextOffset,
|
|
40
|
+
f as getTextSelectionOffsets,
|
|
41
|
+
d as normalizeEditorText,
|
|
42
|
+
g as scrollSelectionIntoView
|
|
77
43
|
};
|
package/dist/bundle.es78.js
CHANGED
|
@@ -1,51 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const [e, u] = U(p || /* @__PURE__ */ new Date()), _ = M(() => {
|
|
13
|
-
u(L(e, 1));
|
|
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
|
-
};
|
|
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;
|
|
48
12
|
};
|
|
49
13
|
export {
|
|
50
|
-
|
|
14
|
+
r as getColorScheme,
|
|
15
|
+
m as getSystemColorScheme,
|
|
16
|
+
s as updateDOM
|
|
51
17
|
};
|
package/dist/bundle.es79.js
CHANGED
|
@@ -1,16 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsx as s, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as f, useState as c, useImperativeHandle as u } from "react";
|
|
3
|
+
import { AlertDialog as x } from "./bundle.es26.js";
|
|
4
|
+
const g = f((l, a) => {
|
|
5
|
+
const [i, o] = c([]);
|
|
6
|
+
u(
|
|
7
|
+
a,
|
|
8
|
+
() => ({
|
|
9
|
+
showAlert: (e) => {
|
|
10
|
+
o((t) => [...t, e]);
|
|
11
|
+
}
|
|
12
|
+
}),
|
|
13
|
+
[]
|
|
14
|
+
);
|
|
15
|
+
const d = (e) => {
|
|
16
|
+
o((t) => {
|
|
17
|
+
const r = [...t], n = r.findIndex((m) => m.id === e);
|
|
18
|
+
return n !== -1 && r.splice(n, 1), r;
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ s(p, { children: i.map(({ id: e, ...t }) => /* @__PURE__ */ s(
|
|
22
|
+
x,
|
|
23
|
+
{
|
|
24
|
+
defaultOpen: !0,
|
|
25
|
+
onClosed: () => d(e),
|
|
26
|
+
...l,
|
|
27
|
+
...t
|
|
28
|
+
},
|
|
29
|
+
`alert-${e}`
|
|
30
|
+
)) });
|
|
31
|
+
});
|
|
14
32
|
export {
|
|
15
|
-
|
|
33
|
+
g as Viewport
|
|
16
34
|
};
|