@companix/uikit 0.0.9 → 0.0.12

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.
Files changed (44) hide show
  1. package/README.md +16 -0
  2. package/dist/DatePicker/index.d.ts +1 -1
  3. package/dist/FormGroup/FormGroup.scss +32 -0
  4. package/dist/FormGroup/index.d.ts +10 -0
  5. package/dist/{Form → Input}/index.d.ts +1 -1
  6. package/dist/NumberInput/index.d.ts +1 -1
  7. package/dist/Select/index.d.ts +1 -1
  8. package/dist/bundle.es.js +18 -16
  9. package/dist/bundle.es10.js +1 -1
  10. package/dist/bundle.es11.js +7 -7
  11. package/dist/bundle.es14.js +1 -1
  12. package/dist/bundle.es19.js +1 -1
  13. package/dist/bundle.es20.js +1 -1
  14. package/dist/bundle.es23.js +1 -1
  15. package/dist/bundle.es24.js +2 -2
  16. package/dist/bundle.es25.js +14 -14
  17. package/dist/bundle.es27.js +11 -10
  18. package/dist/bundle.es28.js +10 -24
  19. package/dist/bundle.es29.js +17 -28
  20. package/dist/bundle.es30.js +32 -20
  21. package/dist/bundle.es31.js +24 -81
  22. package/dist/bundle.es32.js +81 -18
  23. package/dist/bundle.es33.js +17 -13
  24. package/dist/bundle.es34.js +14 -22
  25. package/dist/bundle.es35.js +22 -5
  26. package/dist/bundle.es36.js +5 -21
  27. package/dist/bundle.es37.js +20 -13
  28. package/dist/bundle.es38.js +13 -69
  29. package/dist/bundle.es39.js +68 -66
  30. package/dist/bundle.es40.js +67 -31
  31. package/dist/bundle.es41.js +23 -59
  32. package/dist/bundle.es42.js +63 -38
  33. package/dist/bundle.es43.js +42 -30
  34. package/dist/bundle.es44.js +30 -74
  35. package/dist/bundle.es45.js +71 -45
  36. package/dist/bundle.es46.js +51 -0
  37. package/dist/bundle.es8.js +3 -3
  38. package/dist/bundle.es9.js +26 -24
  39. package/dist/index.d.ts +2 -1
  40. package/dist/index.scss +3 -2
  41. package/package.json +4 -3
  42. package/dist/normalize.css +0 -376
  43. /package/dist/{Form → Input}/Form.scss +0 -0
  44. /package/dist/{Form → Input}/Input.scss +0 -0
@@ -1,20 +1,83 @@
1
- import { useRef as i, useCallback as T } from "react";
2
- const a = () => {
3
- const t = i(null), l = i(null);
4
- return { scrollToElement: T(
5
- (r, u = !1) => {
6
- const o = t.current, s = l.current;
7
- if (!o || !s || r < 0 || r > s.children.length)
8
- return;
9
- const n = s.children[r];
10
- if (!n)
11
- return;
12
- const c = o.offsetHeight, f = o.scrollTop, e = n.offsetTop, p = n.offsetHeight;
13
- u ? o.scrollTop = e - c / 2 + p / 2 : e + p > c + f ? o.scrollTop = e - c + p : e < f && (o.scrollTop = e);
14
- },
15
- [l, t]
16
- ), scrollBoxRef: t, optionsWrapperRef: l };
17
- };
1
+ import { jsxs as n, jsx as c } from "react/jsx-runtime";
2
+ import b from "classnames";
3
+ import { attr as r } from "@companix/utils-browser";
4
+ import { forwardRef as g, useRef as w, useCallback as y } from "react";
5
+ import { Icon as a } from "./bundle.es35.js";
6
+ import { faClose as D, faChevronDown as R } from "@fortawesome/free-solid-svg-icons";
7
+ import { VisuallyHidden as T } from "@radix-ui/react-visually-hidden";
8
+ const V = g(
9
+ ({
10
+ required: u,
11
+ size: d,
12
+ fill: m,
13
+ leftElement: l,
14
+ className: p,
15
+ value: o,
16
+ clearButton: f,
17
+ placeholder: C,
18
+ clearButtonIcon: h,
19
+ disabled: s,
20
+ onClear: I,
21
+ ...i
22
+ }, N) => {
23
+ const e = w(null), k = y(
24
+ (t) => {
25
+ if (!e.current || !document)
26
+ return;
27
+ t.target !== e.current && (e.current.click(), document.activeElement !== e.current && e.current.focus());
28
+ },
29
+ [e]
30
+ ), x = (t) => {
31
+ document && document.activeElement === e.current && t.preventDefault();
32
+ }, v = (t) => {
33
+ s || k(t);
34
+ }, F = (t) => {
35
+ x(t);
36
+ }, z = (t) => {
37
+ e.current && e.current.focus(), I?.(t);
38
+ };
39
+ return /* @__PURE__ */ n(
40
+ "div",
41
+ {
42
+ ref: N,
43
+ className: b("form select", p),
44
+ "data-size": d ?? "md",
45
+ "data-fill": r(m),
46
+ "data-required": r(u),
47
+ "data-disabled": r(s),
48
+ onMouseDown: F,
49
+ ...i,
50
+ onClick: v,
51
+ children: [
52
+ /* @__PURE__ */ n("div", { className: "select-layout form-input", children: [
53
+ l && /* @__PURE__ */ c("div", { className: "select-element", children: l }),
54
+ /* @__PURE__ */ c("div", { className: "select-content", children: /* @__PURE__ */ n("div", { className: "select-content-text", "aria-disabled": s, children: [
55
+ !o && /* @__PURE__ */ c("span", { className: "select-placeholder", children: C }),
56
+ o
57
+ ] }) }),
58
+ /* @__PURE__ */ n("div", { className: "select-element", children: [
59
+ f && o && /* @__PURE__ */ c("button", { className: "select-close-button", onClick: z, children: h ?? /* @__PURE__ */ c(a, { className: "select-close-icon", icon: D, size: "xxxs" }) }),
60
+ /* @__PURE__ */ c(a, { className: "expand-icon select-expand", icon: R, size: "xxxs" })
61
+ ] })
62
+ ] }),
63
+ /* @__PURE__ */ c(T, { asChild: !0, children: /* @__PURE__ */ c(
64
+ "input",
65
+ {
66
+ ref: e,
67
+ autoComplete: "off",
68
+ autoCapitalize: "none",
69
+ autoCorrect: "off",
70
+ spellCheck: "false",
71
+ "aria-autocomplete": "none",
72
+ onClick: i.onClick,
73
+ readOnly: !0
74
+ }
75
+ ) })
76
+ ]
77
+ }
78
+ );
79
+ }
80
+ );
18
81
  export {
19
- a as useScrollListController
82
+ V as SelectInput
20
83
  };
@@ -1,16 +1,20 @@
1
- import { useRef as u, useLayoutEffect as f, useEffect as s } from "react";
2
- const o = (t, r) => {
3
- const e = u(!1);
4
- f(() => {
5
- e.current = !0, t();
6
- }, []), s(() => {
7
- if (e.current) {
8
- e.current = !1;
9
- return;
10
- }
11
- t();
12
- }, r);
1
+ import { useRef as i, useCallback as T } from "react";
2
+ const a = () => {
3
+ const t = i(null), l = i(null);
4
+ return { scrollToElement: T(
5
+ (r, u = !1) => {
6
+ const o = t.current, s = l.current;
7
+ if (!o || !s || r < 0 || r > s.children.length)
8
+ return;
9
+ const n = s.children[r];
10
+ if (!n)
11
+ return;
12
+ const c = o.offsetHeight, f = o.scrollTop, e = n.offsetTop, p = n.offsetHeight;
13
+ u ? o.scrollTop = e - c / 2 + p / 2 : e + p > c + f ? o.scrollTop = e - c + p : e < f && (o.scrollTop = e);
14
+ },
15
+ [l, t]
16
+ ), scrollBoxRef: t, optionsWrapperRef: l };
13
17
  };
14
18
  export {
15
- o as useLayoutAndUpdate
19
+ a as useScrollListController
16
20
  };
@@ -1,24 +1,16 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import f from "classnames";
3
- import { forwardRef as l } from "react";
4
- const g = l(
5
- ({ icon: r, className: t, size: i = "m", ...e }, a) => {
6
- const [n, c, , , m] = r.icon;
7
- return /* @__PURE__ */ o(
8
- "svg",
9
- {
10
- ref: a,
11
- "data-prefix": r.prefix,
12
- "data-icon": r.iconName,
13
- viewBox: `0 0 ${n} ${c}`,
14
- className: f(`icon icon-size-${i}`, t),
15
- ...e,
16
- role: "img",
17
- children: /* @__PURE__ */ o(s, { paths: m })
18
- }
19
- );
20
- }
21
- ), s = ({ paths: r }) => Array.isArray(r) ? /* @__PURE__ */ o("g", { children: r.map((t, i) => /* @__PURE__ */ o("path", { fill: "currentColor", d: t }, `-d-${i}`)) }) : /* @__PURE__ */ o("path", { fill: "currentColor", d: r });
1
+ import { useRef as u, useLayoutEffect as f, useEffect as s } from "react";
2
+ const o = (t, r) => {
3
+ const e = u(!1);
4
+ f(() => {
5
+ e.current = !0, t();
6
+ }, []), s(() => {
7
+ if (e.current) {
8
+ e.current = !1;
9
+ return;
10
+ }
11
+ t();
12
+ }, r);
13
+ };
22
14
  export {
23
- g as Icon
15
+ o as useLayoutAndUpdate
24
16
  };
@@ -1,7 +1,24 @@
1
- import { useEffect as r } from "react";
2
- const n = ({ callback: e }) => (r(() => () => {
3
- e?.();
4
- }, []), null);
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import f from "classnames";
3
+ import { forwardRef as l } from "react";
4
+ const g = l(
5
+ ({ icon: r, className: t, size: i = "m", ...e }, a) => {
6
+ const [n, c, , , m] = r.icon;
7
+ return /* @__PURE__ */ o(
8
+ "svg",
9
+ {
10
+ ref: a,
11
+ "data-prefix": r.prefix,
12
+ "data-icon": r.iconName,
13
+ viewBox: `0 0 ${n} ${c}`,
14
+ className: f(`icon icon-size-${i}`, t),
15
+ ...e,
16
+ role: "img",
17
+ children: /* @__PURE__ */ o(s, { paths: m })
18
+ }
19
+ );
20
+ }
21
+ ), s = ({ paths: r }) => Array.isArray(r) ? /* @__PURE__ */ o("g", { children: r.map((t, i) => /* @__PURE__ */ o("path", { fill: "currentColor", d: t }, `-d-${i}`)) }) : /* @__PURE__ */ o("path", { fill: "currentColor", d: r });
5
22
  export {
6
- n as RemoveListener
23
+ g as Icon
7
24
  };
@@ -1,23 +1,7 @@
1
- import { useState as a } from "react";
2
- const l = ({ onClick: i }) => {
3
- const [e, s] = a({ isLoading: !1, isError: !1 });
4
- return {
5
- ...e,
6
- handleClick: (o) => {
7
- e.isLoading || i(() => s({ isLoading: !0, isError: !1 }), o).then(() => {
8
- s({
9
- isLoading: !1,
10
- isError: !1
11
- });
12
- }).catch((r) => {
13
- console.log(r), s({
14
- isLoading: !1,
15
- isError: !0
16
- });
17
- });
18
- }
19
- };
20
- };
1
+ import { useEffect as r } from "react";
2
+ const n = ({ callback: e }) => (r(() => () => {
3
+ e?.();
4
+ }, []), null);
21
5
  export {
22
- l as useLoading
6
+ n as RemoveListener
23
7
  };
@@ -1,16 +1,23 @@
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];
1
+ import { useState as a } from "react";
2
+ const l = ({ onClick: i }) => {
3
+ const [e, s] = a({ isLoading: !1, isError: !1 });
4
+ return {
5
+ ...e,
6
+ handleClick: (o) => {
7
+ e.isLoading || i(() => s({ isLoading: !0, isError: !1 }), o).then(() => {
8
+ s({
9
+ isLoading: !1,
10
+ isError: !1
11
+ });
12
+ }).catch((r) => {
13
+ console.log(r), s({
14
+ isLoading: !1,
15
+ isError: !0
16
+ });
17
+ });
18
+ }
19
+ };
13
20
  };
14
21
  export {
15
- f as useResizeTextarea
22
+ l as useLoading
16
23
  };
@@ -1,72 +1,16 @@
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.es43.js";
3
- import { CalendarHeader as F } from "./bundle.es44.js";
4
- import { useCalendar as j } from "./bundle.es45.js";
5
- import { attr as m } from "@companix/utils-browser";
6
- import { isSameDate as f } from "./bundle.es39.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?.();
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
- T as Calendar
15
+ f as useResizeTextarea
72
16
  };
@@ -1,70 +1,72 @@
1
- import { useMemo as D, useCallback as c } from "react";
2
- function l(e, t) {
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;
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.es44.js";
3
+ import { CalendarHeader as F } from "./bundle.es45.js";
4
+ import { useCalendar as j } from "./bundle.es46.js";
5
+ import { attr as m } from "@companix/utils-browser";
6
+ import { isSameDate as f } from "./bundle.es40.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?.();
48
57
  };
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
+ 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
+ );
58
69
  };
59
70
  export {
60
- m as addMonths,
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
71
+ T as Calendar
70
72
  };
@@ -1,34 +1,70 @@
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.es19.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
- });
1
+ import { useMemo as D, useCallback as c } from "react";
2
+ function l(e, t) {
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;
20
48
  };
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
- });
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
+ };
32
59
  export {
33
- g as Viewport
60
+ m as addMonths,
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
34
70
  };