@companix/uikit 0.0.15 → 0.0.17
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/DatePicker/index.d.ts +2 -3
- package/dist/Input/Form.scss +1 -4
- package/dist/Input/InlineInput.d.ts +0 -0
- package/dist/Input/{index.d.ts → Input.d.ts} +4 -8
- package/dist/Input/Input.scss +23 -0
- package/dist/Input/InputContainer.d.ts +11 -0
- package/dist/Input/InputElement.d.ts +7 -0
- package/dist/NumberInput/index.d.ts +2 -2
- package/dist/Select/SelectOptions.d.ts +12 -0
- package/dist/Select/SelectRight.d.ts +8 -0
- package/dist/Select/index.d.ts +5 -1
- package/dist/SelectTags/SelectTags.scss +1 -0
- package/dist/SelectTags/index.d.ts +1 -0
- package/dist/TimePicker/index.d.ts +10 -0
- package/dist/__hooks/use-input-padding.d.ts +5 -0
- package/dist/__hooks/use-scrollbox.d.ts +1 -1
- package/dist/__hooks/use-update.d.ts +1 -1
- package/dist/__utils/utils.d.ts +15 -1
- package/dist/bundle.es.js +30 -26
- package/dist/bundle.es10.js +1 -1
- package/dist/bundle.es14.js +1 -1
- package/dist/bundle.es19.js +1 -1
- package/dist/bundle.es20.js +1 -1
- package/dist/bundle.es23.js +1 -1
- package/dist/bundle.es24.js +48 -46
- package/dist/bundle.es25.js +93 -85
- package/dist/bundle.es26.js +67 -29
- package/dist/bundle.es27.js +34 -10
- package/dist/bundle.es28.js +11 -10
- package/dist/bundle.es29.js +82 -21
- package/dist/bundle.es30.js +10 -35
- package/dist/bundle.es31.js +21 -20
- package/dist/bundle.es32.js +36 -83
- package/dist/bundle.es33.js +23 -17
- package/dist/bundle.es34.js +87 -14
- package/dist/bundle.es35.js +18 -22
- package/dist/bundle.es36.js +20 -5
- package/dist/bundle.es37.js +24 -14
- package/dist/bundle.es38.js +39 -14
- package/dist/bundle.es39.js +20 -68
- package/dist/bundle.es40.js +5 -68
- package/dist/bundle.es41.js +13 -31
- package/dist/bundle.es42.js +14 -68
- package/dist/bundle.es43.js +66 -39
- package/dist/bundle.es44.js +67 -30
- package/dist/bundle.es45.js +69 -74
- package/dist/bundle.es46.js +10 -48
- package/dist/bundle.es47.js +45 -0
- package/dist/bundle.es48.js +34 -0
- package/dist/bundle.es49.js +70 -0
- package/dist/bundle.es50.js +16 -0
- package/dist/bundle.es51.js +45 -0
- package/dist/bundle.es52.js +77 -0
- package/dist/bundle.es53.js +51 -0
- package/dist/bundle.es54.js +16 -0
- package/dist/bundle.es8.js +54 -62
- package/dist/bundle.es9.js +35 -70
- package/dist/index.d.ts +3 -1
- package/dist/index.scss +2 -2
- package/dist/types.d.ts +4 -0
- package/package.json +2 -3
package/dist/bundle.es32.js
CHANGED
|
@@ -1,85 +1,38 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
-
}, g = (t) => {
|
|
37
|
-
v(t);
|
|
38
|
-
}, z = (t) => {
|
|
39
|
-
e.current && e.current.focus(), I?.(t);
|
|
40
|
-
};
|
|
41
|
-
return /* @__PURE__ */ n(
|
|
42
|
-
"div",
|
|
43
|
-
{
|
|
44
|
-
ref: k,
|
|
45
|
-
className: R("form select", f),
|
|
46
|
-
"data-size": d ?? "md",
|
|
47
|
-
"data-fill": r(m),
|
|
48
|
-
"data-required": r(u),
|
|
49
|
-
"data-disabled": r(s),
|
|
50
|
-
onMouseDown: g,
|
|
51
|
-
...i,
|
|
52
|
-
onClick: F,
|
|
53
|
-
children: [
|
|
54
|
-
/* @__PURE__ */ n("div", { className: "select-layout form-input", children: [
|
|
55
|
-
l && /* @__PURE__ */ c("div", { className: "select-element", children: l }),
|
|
56
|
-
/* @__PURE__ */ c("div", { className: "select-content", children: /* @__PURE__ */ n("div", { className: "select-content-text", "aria-disabled": s, children: [
|
|
57
|
-
!o && /* @__PURE__ */ c("span", { className: "select-placeholder", children: C }),
|
|
58
|
-
o
|
|
59
|
-
] }) }),
|
|
60
|
-
/* @__PURE__ */ n("div", { className: "select-element", children: [
|
|
61
|
-
p && o && /* @__PURE__ */ c("button", { className: "select-close-button", onClick: z, children: h ?? /* @__PURE__ */ c(a, { className: "select-close-icon", icon: D, size: "xxxs" }) }),
|
|
62
|
-
/* @__PURE__ */ c(a, { className: "expand-icon select-expand", icon: T, size: "xxxs" })
|
|
63
|
-
] })
|
|
64
|
-
] }),
|
|
65
|
-
/* @__PURE__ */ c(j, { asChild: !0, children: /* @__PURE__ */ c(
|
|
66
|
-
"input",
|
|
67
|
-
{
|
|
68
|
-
ref: O([N, e]),
|
|
69
|
-
autoComplete: "off",
|
|
70
|
-
autoCapitalize: "none",
|
|
71
|
-
autoCorrect: "off",
|
|
72
|
-
spellCheck: "false",
|
|
73
|
-
"aria-autocomplete": "none",
|
|
74
|
-
onClick: i.onClick,
|
|
75
|
-
readOnly: !0
|
|
76
|
-
}
|
|
77
|
-
) })
|
|
78
|
-
]
|
|
79
|
-
}
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
);
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { hash as d } from "@companix/utils-js";
|
|
3
|
+
import { Viewport as s } from "./bundle.es49.js";
|
|
4
|
+
import { useRef as c, useMemo as l } from "react";
|
|
5
|
+
const f = (i = {}) => {
|
|
6
|
+
const t = {
|
|
7
|
+
emit: (e) => {
|
|
8
|
+
console.error("uninitialized", e);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
return {
|
|
12
|
+
send: (e) => {
|
|
13
|
+
t.emit({ ...e, id: d() });
|
|
14
|
+
},
|
|
15
|
+
Viewport: (e = {}) => {
|
|
16
|
+
const n = c(null);
|
|
17
|
+
return l(() => {
|
|
18
|
+
t.emit = (r) => {
|
|
19
|
+
n.current && n.current.addToast(r);
|
|
20
|
+
};
|
|
21
|
+
}, []), /* @__PURE__ */ a(
|
|
22
|
+
s,
|
|
23
|
+
{
|
|
24
|
+
ref: n,
|
|
25
|
+
align: e.align ?? i.align,
|
|
26
|
+
closeIcon: e.closeIcon ?? i.closeIcon,
|
|
27
|
+
duration: e.duration ?? i.duration,
|
|
28
|
+
gap: e.gap ?? i.gap,
|
|
29
|
+
side: e.side ?? i.side,
|
|
30
|
+
swipeThreshold: e.swipeThreshold ?? i.swipeThreshold
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
};
|
|
83
36
|
export {
|
|
84
|
-
|
|
37
|
+
f as createToaster
|
|
85
38
|
};
|
package/dist/bundle.es33.js
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
const
|
|
3
|
-
const t =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { useRef as s, useCallback as c } from "react";
|
|
2
|
+
const p = () => {
|
|
3
|
+
const t = s(null), r = s({ cb: null }), i = c(() => {
|
|
4
|
+
if (t.current && t.current.parentElement) {
|
|
5
|
+
const e = t.current.parentElement, u = e.style.getPropertyValue("--radix-popper-anchor-width"), n = e.style.getPropertyValue("transform"), o = new MutationObserver(() => {
|
|
6
|
+
e.style.transform !== n && e.style.setProperty("transform", n);
|
|
7
|
+
});
|
|
8
|
+
o.observe(e, {
|
|
9
|
+
attributes: !0,
|
|
10
|
+
attributeFilter: ["style"]
|
|
11
|
+
}), r.current.cb = () => {
|
|
12
|
+
o.disconnect();
|
|
13
|
+
}, t.current.style.setProperty("--radix-popover-trigger-width", u);
|
|
14
|
+
}
|
|
15
|
+
}, []), l = c(() => {
|
|
16
|
+
r.current.cb && (r.current.cb(), r.current.cb = null);
|
|
17
|
+
}, []);
|
|
18
|
+
return {
|
|
19
|
+
popoverRef: t,
|
|
20
|
+
handleAnimationEnd: l,
|
|
21
|
+
froozePopoverPosition: i
|
|
22
|
+
};
|
|
17
23
|
};
|
|
18
24
|
export {
|
|
19
|
-
|
|
25
|
+
p as useFroozeClosing
|
|
20
26
|
};
|
package/dist/bundle.es34.js
CHANGED
|
@@ -1,16 +1,89 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsxs as o, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import A from "classnames";
|
|
3
|
+
import { attr as l } from "@companix/utils-browser";
|
|
4
|
+
import { forwardRef as y, useRef as S, useCallback as T } from "react";
|
|
5
|
+
import { VisuallyHidden as j } from "@radix-ui/react-visually-hidden";
|
|
6
|
+
import { mergeRefs as w } from "react-merge-refs";
|
|
7
|
+
import { SelectRightElements as z } from "./bundle.es46.js";
|
|
8
|
+
const V = y(
|
|
9
|
+
({
|
|
10
|
+
required: a,
|
|
11
|
+
size: u,
|
|
12
|
+
fill: d,
|
|
13
|
+
leftElement: s,
|
|
14
|
+
className: m,
|
|
15
|
+
value: n,
|
|
16
|
+
clearButton: f,
|
|
17
|
+
placeholder: p,
|
|
18
|
+
clearButtonIcon: h,
|
|
19
|
+
disabled: r,
|
|
20
|
+
onClear: C,
|
|
21
|
+
inputRef: I,
|
|
22
|
+
...i
|
|
23
|
+
}, k) => {
|
|
24
|
+
const e = S(null), N = T(
|
|
25
|
+
(t) => {
|
|
26
|
+
if (!e.current || !document)
|
|
27
|
+
return;
|
|
28
|
+
t.target !== e.current && (e.current.click(), document.activeElement !== e.current && e.current.focus());
|
|
29
|
+
},
|
|
30
|
+
[e]
|
|
31
|
+
), v = (t) => {
|
|
32
|
+
document && document.activeElement === e.current && t.preventDefault();
|
|
33
|
+
}, F = (t) => {
|
|
34
|
+
r || N(t);
|
|
35
|
+
}, g = (t) => {
|
|
36
|
+
v(t);
|
|
37
|
+
}, R = (t) => {
|
|
38
|
+
e.current && e.current.focus(), C?.(t);
|
|
39
|
+
};
|
|
40
|
+
return /* @__PURE__ */ o(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
ref: k,
|
|
44
|
+
className: A("form select", m),
|
|
45
|
+
"data-size": u ?? "md",
|
|
46
|
+
"data-fill": l(d),
|
|
47
|
+
"data-required": l(a),
|
|
48
|
+
"data-disabled": l(r),
|
|
49
|
+
onMouseDown: g,
|
|
50
|
+
...i,
|
|
51
|
+
onClick: F,
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ o("div", { className: "select-layout form-input", children: [
|
|
54
|
+
s && /* @__PURE__ */ c("div", { className: "select-element", children: s }),
|
|
55
|
+
/* @__PURE__ */ c("div", { className: "select-content", children: /* @__PURE__ */ o("div", { className: "select-content-text", "aria-disabled": r, children: [
|
|
56
|
+
!n && /* @__PURE__ */ c("span", { className: "select-placeholder", children: p }),
|
|
57
|
+
n
|
|
58
|
+
] }) }),
|
|
59
|
+
/* @__PURE__ */ c("div", { className: "select-element", children: /* @__PURE__ */ c(
|
|
60
|
+
z,
|
|
61
|
+
{
|
|
62
|
+
clearButton: f,
|
|
63
|
+
value: !!n,
|
|
64
|
+
clearButtonIcon: h,
|
|
65
|
+
onClear: R
|
|
66
|
+
}
|
|
67
|
+
) })
|
|
68
|
+
] }),
|
|
69
|
+
/* @__PURE__ */ c(j, { asChild: !0, children: /* @__PURE__ */ c(
|
|
70
|
+
"input",
|
|
71
|
+
{
|
|
72
|
+
ref: w([I, e]),
|
|
73
|
+
autoComplete: "off",
|
|
74
|
+
autoCapitalize: "none",
|
|
75
|
+
autoCorrect: "off",
|
|
76
|
+
spellCheck: "false",
|
|
77
|
+
"aria-autocomplete": "none",
|
|
78
|
+
onClick: i.onClick,
|
|
79
|
+
readOnly: !0
|
|
80
|
+
}
|
|
81
|
+
) })
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
);
|
|
14
87
|
export {
|
|
15
|
-
|
|
88
|
+
V as SelectInput
|
|
16
89
|
};
|
package/dist/bundle.es35.js
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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, useCallback as T } from "react";
|
|
2
|
+
const g = () => {
|
|
3
|
+
const l = u(null), t = u(null);
|
|
4
|
+
return { scrollToElement: T(
|
|
5
|
+
(r, f) => {
|
|
6
|
+
const o = l.current, s = t.current;
|
|
7
|
+
if (!o || !s || r < 0 || r > s.children.length)
|
|
8
|
+
return;
|
|
9
|
+
const c = s.children[r];
|
|
10
|
+
if (!c)
|
|
11
|
+
return;
|
|
12
|
+
const n = o.offsetHeight, i = o.scrollTop, e = c.offsetTop, p = c.offsetHeight;
|
|
13
|
+
f === "center" ? o.scrollTop = e - n / 2 + p / 2 : f === "top" ? o.scrollTop = e : e + p > n + i ? o.scrollTop = e - n + p : e < i && (o.scrollTop = e);
|
|
14
|
+
},
|
|
15
|
+
[t, l]
|
|
16
|
+
), scrollBoxRef: l, optionsWrapperRef: t };
|
|
17
|
+
};
|
|
22
18
|
export {
|
|
23
|
-
g as
|
|
19
|
+
g as useScrollListController
|
|
24
20
|
};
|
package/dist/bundle.es36.js
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as a } from "react";
|
|
3
|
+
import { OptionItem as f } from "./bundle.es10.js";
|
|
4
|
+
import { OptionsList as O } from "./bundle.es12.js";
|
|
5
|
+
const h = (t) => {
|
|
6
|
+
const { active: i, onOpened: m, scrollboxRef: n, optionsWrapperRef: r, options: p, onSelect: s, minimalOptions: c } = t;
|
|
7
|
+
return a(() => {
|
|
8
|
+
m?.();
|
|
9
|
+
}, []), /* @__PURE__ */ o(O, { scrollboxRef: n, optionsWrapperRef: r, maxHeight: 300, children: p.map((e, l) => /* @__PURE__ */ o(
|
|
10
|
+
f,
|
|
11
|
+
{
|
|
12
|
+
active: i === e.value,
|
|
13
|
+
onClick: () => s?.(e.value),
|
|
14
|
+
minimal: c,
|
|
15
|
+
...e
|
|
16
|
+
},
|
|
17
|
+
`select-option-${l}`
|
|
18
|
+
)) });
|
|
19
|
+
};
|
|
5
20
|
export {
|
|
6
|
-
|
|
21
|
+
h as SelectOptions
|
|
7
22
|
};
|
package/dist/bundle.es37.js
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as m, useCallback as i } from "react";
|
|
3
|
+
import c from "react-input-mask";
|
|
4
|
+
const I = m(
|
|
5
|
+
({ mask: r, maskChar: f, onChange: n, onValueChange: o, ...a }, e) => {
|
|
6
|
+
const p = i(
|
|
7
|
+
(t) => {
|
|
8
|
+
n?.(t), o?.(t.target.value, t.target);
|
|
9
|
+
},
|
|
10
|
+
[n, o]
|
|
11
|
+
);
|
|
12
|
+
return r ? /* @__PURE__ */ u(
|
|
13
|
+
c,
|
|
14
|
+
{
|
|
15
|
+
inputRef: e,
|
|
16
|
+
mask: r,
|
|
17
|
+
maskChar: f,
|
|
18
|
+
onChange: p,
|
|
19
|
+
...a
|
|
20
|
+
}
|
|
21
|
+
) : /* @__PURE__ */ u("input", { ref: e, ...a, onChange: p });
|
|
22
|
+
}
|
|
23
|
+
);
|
|
14
24
|
export {
|
|
15
|
-
|
|
25
|
+
I as InputElement
|
|
16
26
|
};
|
package/dist/bundle.es38.js
CHANGED
|
@@ -1,16 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsxs as b, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import h from "classnames";
|
|
3
|
+
import { attr as e } from "@companix/utils-browser";
|
|
4
|
+
import { forwardRef as x } from "react";
|
|
5
|
+
import { useInputPadding as N } from "./bundle.es50.js";
|
|
6
|
+
const v = x(
|
|
7
|
+
({
|
|
8
|
+
required: s,
|
|
9
|
+
disabled: t,
|
|
10
|
+
size: i,
|
|
11
|
+
fill: d,
|
|
12
|
+
leftElement: r,
|
|
13
|
+
rightElement: a,
|
|
14
|
+
className: f,
|
|
15
|
+
inputRef: m,
|
|
16
|
+
children: n,
|
|
17
|
+
...p
|
|
18
|
+
}, c) => {
|
|
19
|
+
const { leftRef: l, rightRef: u } = N(m, [r, a]);
|
|
20
|
+
return /* @__PURE__ */ b(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
ref: c,
|
|
24
|
+
className: h("form", f),
|
|
25
|
+
"data-size": i ?? "md",
|
|
26
|
+
"data-fill": e(d),
|
|
27
|
+
"data-required": e(s),
|
|
28
|
+
"data-disabled": e(t),
|
|
29
|
+
...p,
|
|
30
|
+
children: [
|
|
31
|
+
r && /* @__PURE__ */ o("span", { ref: l, className: "form-input-base-left-element", children: r }),
|
|
32
|
+
n,
|
|
33
|
+
a && /* @__PURE__ */ o("span", { ref: u, className: "form-input-base-right-element", children: a })
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
);
|
|
14
39
|
export {
|
|
15
|
-
|
|
40
|
+
v as InputContainer
|
|
16
41
|
};
|
package/dist/bundle.es39.js
CHANGED
|
@@ -1,72 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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,
|
|
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",
|
|
25
9
|
{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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 })
|
|
33
18
|
}
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
);
|
|
69
|
-
};
|
|
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 });
|
|
70
22
|
export {
|
|
71
|
-
|
|
23
|
+
g as Icon
|
|
72
24
|
};
|
package/dist/bundle.es40.js
CHANGED
|
@@ -1,70 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
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;
|
|
48
|
-
};
|
|
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
|
-
};
|
|
1
|
+
import { useEffect as r } from "react";
|
|
2
|
+
const n = ({ callback: e }) => (r(() => () => {
|
|
3
|
+
e?.();
|
|
4
|
+
}, []), null);
|
|
59
5
|
export {
|
|
60
|
-
|
|
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
|
|
6
|
+
n as RemoveListener
|
|
70
7
|
};
|
package/dist/bundle.es41.js
CHANGED
|
@@ -1,34 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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;
|
|
1
|
+
import { useState as e } from "react";
|
|
2
|
+
const d = ({ onClick: t }) => {
|
|
3
|
+
const [a, s] = e({ isLoading: !1, isError: !1 });
|
|
4
|
+
return { ...a, handleClick: (r) => {
|
|
5
|
+
a.isLoading || t(() => {
|
|
6
|
+
s({ isLoading: !0, isError: !1 });
|
|
7
|
+
}, r).then(() => {
|
|
8
|
+
s({ isLoading: !1, isError: !1 });
|
|
9
|
+
}).catch(() => {
|
|
10
|
+
s({ isLoading: !1, isError: !0 });
|
|
19
11
|
});
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
x,
|
|
23
|
-
{
|
|
24
|
-
defaultOpen: !0,
|
|
25
|
-
onUnMounted: () => d(e),
|
|
26
|
-
...a,
|
|
27
|
-
...t
|
|
28
|
-
},
|
|
29
|
-
`alert-${e}`
|
|
30
|
-
)) });
|
|
31
|
-
});
|
|
12
|
+
} };
|
|
13
|
+
};
|
|
32
14
|
export {
|
|
33
|
-
|
|
15
|
+
d as useLoading
|
|
34
16
|
};
|