@companix/uikit 0.1.16 → 0.1.18
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/OptionItem/Option.scss +12 -0
- package/dist/Select/SelectInput.d.ts +1 -0
- package/dist/Select/SelectRight.d.ts +1 -0
- package/dist/Tabs/index.d.ts +4 -4
- package/dist/bundle.es13.js +31 -30
- package/dist/bundle.es16.js +22 -19
- package/dist/bundle.es28.js +13 -13
- package/dist/bundle.es62.js +30 -28
- package/dist/bundle.es64.js +21 -20
- package/dist/bundle.es67.js +1 -1
- package/dist/bundle.es72.js +2 -2
- package/dist/bundle.es73.js +9 -8
- package/dist/bundle.es81.js +13 -74
- package/dist/bundle.es82.js +71 -45
- package/dist/bundle.es83.js +48 -13
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -31,12 +31,24 @@
|
|
|
31
31
|
max-width: 100%;
|
|
32
32
|
gap: 8px;
|
|
33
33
|
|
|
34
|
+
&-layout {
|
|
35
|
+
width: 100%;
|
|
36
|
+
}
|
|
37
|
+
|
|
34
38
|
&-inner {
|
|
35
39
|
@include mixins.use-styles(option, content, layout);
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
42
|
|
|
43
|
+
&-header {
|
|
44
|
+
align-items: center;
|
|
45
|
+
width: 100%;
|
|
46
|
+
display: flex;
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
}
|
|
49
|
+
|
|
39
50
|
&-title {
|
|
51
|
+
flex: 1;
|
|
40
52
|
word-break: break-word;
|
|
41
53
|
}
|
|
42
54
|
|
|
@@ -9,6 +9,7 @@ export interface SelectFormProps {
|
|
|
9
9
|
fill?: boolean;
|
|
10
10
|
clearButton?: boolean;
|
|
11
11
|
clearButtonIcon?: boolean;
|
|
12
|
+
customElement?: React.ReactNode;
|
|
12
13
|
inputRef?: React.Ref<HTMLInputElement>;
|
|
13
14
|
onClear?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
14
15
|
onClick?: () => void;
|
|
@@ -2,6 +2,7 @@ interface SelectRightElementsProps {
|
|
|
2
2
|
onClear?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
3
3
|
clearButton?: boolean;
|
|
4
4
|
clearButtonIcon?: React.ReactNode;
|
|
5
|
+
customElement?: React.ReactNode;
|
|
5
6
|
value: boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare const SelectRightElements: (props: SelectRightElementsProps) => import("react/jsx-runtime").JSX.Element;
|
package/dist/Tabs/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export interface TabsProps {
|
|
1
|
+
export interface TabsProps<T extends string> {
|
|
2
2
|
children: React.ReactNode;
|
|
3
|
-
onChange: (value:
|
|
4
|
-
value:
|
|
3
|
+
onChange: (value: T) => void;
|
|
4
|
+
value: T;
|
|
5
5
|
}
|
|
6
6
|
export declare const Tabs: {
|
|
7
|
-
({ children, value, onChange }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
<T extends string>({ children, value, onChange }: TabsProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
Tab: ({ children, value, ...restProps }: TabProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
};
|
|
10
10
|
interface TabProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
package/dist/bundle.es13.js
CHANGED
|
@@ -10,33 +10,33 @@ const Z = (t) => {
|
|
|
10
10
|
const {
|
|
11
11
|
onChange: i,
|
|
12
12
|
value: n,
|
|
13
|
-
matchTarget:
|
|
14
|
-
children:
|
|
15
|
-
scrollRef:
|
|
16
|
-
popoverRef:
|
|
13
|
+
matchTarget: f = "width",
|
|
14
|
+
children: m,
|
|
15
|
+
scrollRef: d,
|
|
16
|
+
popoverRef: v,
|
|
17
17
|
clearButton: s,
|
|
18
18
|
// select props
|
|
19
19
|
disabled: a,
|
|
20
|
-
required:
|
|
21
|
-
className:
|
|
22
|
-
clearButtonIcon:
|
|
23
|
-
leftElement:
|
|
24
|
-
inputRef:
|
|
20
|
+
required: h,
|
|
21
|
+
className: O,
|
|
22
|
+
clearButtonIcon: R,
|
|
23
|
+
leftElement: C,
|
|
24
|
+
inputRef: P,
|
|
25
25
|
onClear: y,
|
|
26
|
-
fill:
|
|
26
|
+
fill: E,
|
|
27
27
|
size: g,
|
|
28
|
-
placeholder:
|
|
29
|
-
onClick:
|
|
28
|
+
placeholder: A,
|
|
29
|
+
onClick: S,
|
|
30
30
|
// options popover
|
|
31
|
-
...
|
|
31
|
+
...x
|
|
32
32
|
} = t, r = L({});
|
|
33
33
|
j(() => {
|
|
34
34
|
(t.options ?? t.defaultOptions ?? []).forEach((e) => {
|
|
35
35
|
r.current[e.value] = e;
|
|
36
36
|
});
|
|
37
37
|
}, [t.options, t.defaultOptions]);
|
|
38
|
-
const
|
|
39
|
-
k(
|
|
38
|
+
const c = n === null ? null : r.current[n] ?? null, { popoverRef: z, froozePopoverPosition: B, handleAnimationEnd: F } = w(), { scrollToElement: p, optionsWrapperRef: I, scrollBoxRef: T } = M();
|
|
39
|
+
k(d, () => ({
|
|
40
40
|
scrollTo: (o) => p(o, "top")
|
|
41
41
|
}));
|
|
42
42
|
const b = (o, e) => {
|
|
@@ -48,9 +48,9 @@ const Z = (t) => {
|
|
|
48
48
|
q,
|
|
49
49
|
{
|
|
50
50
|
minimal: !0,
|
|
51
|
-
ref: W([z,
|
|
51
|
+
ref: W([z, v]),
|
|
52
52
|
sideOffset: 0,
|
|
53
|
-
matchTarget:
|
|
53
|
+
matchTarget: f,
|
|
54
54
|
onAnimationEnd: F,
|
|
55
55
|
onOpenAutoFocus: (o) => o.preventDefault(),
|
|
56
56
|
onCloseAutoFocus: (o) => o.preventDefault(),
|
|
@@ -58,7 +58,7 @@ const Z = (t) => {
|
|
|
58
58
|
content: ({ close: o }) => /* @__PURE__ */ l(
|
|
59
59
|
N,
|
|
60
60
|
{
|
|
61
|
-
...
|
|
61
|
+
...x,
|
|
62
62
|
close: o,
|
|
63
63
|
isActive: (e) => e === n,
|
|
64
64
|
onSelect: (e) => b(e, o),
|
|
@@ -66,28 +66,29 @@ const Z = (t) => {
|
|
|
66
66
|
optionsWrapperRef: I,
|
|
67
67
|
onOpened: (e) => p(e, "center"),
|
|
68
68
|
onOptionsLoaded: (e) => {
|
|
69
|
-
e.forEach((
|
|
70
|
-
r.current[
|
|
69
|
+
e.forEach((u) => {
|
|
70
|
+
r.current[u.value] = u;
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
),
|
|
75
|
-
children:
|
|
75
|
+
children: m ?? /* @__PURE__ */ l(
|
|
76
76
|
H,
|
|
77
77
|
{
|
|
78
|
-
required:
|
|
79
|
-
className:
|
|
80
|
-
leftElement:
|
|
81
|
-
inputRef:
|
|
78
|
+
required: h,
|
|
79
|
+
className: O,
|
|
80
|
+
leftElement: C,
|
|
81
|
+
inputRef: P,
|
|
82
82
|
onClear: D,
|
|
83
|
-
fill:
|
|
83
|
+
fill: E,
|
|
84
84
|
size: g,
|
|
85
|
-
placeholder:
|
|
86
|
-
onClick:
|
|
85
|
+
placeholder: A,
|
|
86
|
+
onClick: S,
|
|
87
87
|
disabled: a,
|
|
88
88
|
clearButton: s,
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
customElement: c?.indicator,
|
|
90
|
+
clearButtonIcon: R,
|
|
91
|
+
value: c?.title ?? ""
|
|
91
92
|
}
|
|
92
93
|
)
|
|
93
94
|
}
|
package/dist/bundle.es16.js
CHANGED
|
@@ -1,38 +1,41 @@
|
|
|
1
1
|
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { Icon as
|
|
2
|
+
import v from "classnames";
|
|
3
|
+
import { Icon as k } from "./bundle.es36.js";
|
|
4
4
|
import { attr as t } from "@companix/utils-browser";
|
|
5
|
-
import { forwardRef as
|
|
6
|
-
import { faCheck as
|
|
7
|
-
const
|
|
8
|
-
({ title: d, icon:
|
|
9
|
-
const f = (
|
|
10
|
-
|
|
5
|
+
import { forwardRef as x } from "react";
|
|
6
|
+
import { faCheck as C } from "@companix/icons-solid";
|
|
7
|
+
const R = x(
|
|
8
|
+
({ title: d, icon: e, active: n, label: c, indicator: l, disabled: a, minimal: r, onClick: s, className: m, ...p }, h) => {
|
|
9
|
+
const f = (N) => {
|
|
10
|
+
a || s?.(N);
|
|
11
11
|
};
|
|
12
12
|
return /* @__PURE__ */ i(
|
|
13
13
|
"div",
|
|
14
14
|
{
|
|
15
|
-
ref:
|
|
16
|
-
...
|
|
17
|
-
className:
|
|
18
|
-
"data-selected": t(
|
|
19
|
-
"data-disabled": t(
|
|
20
|
-
"data-minimal": t(
|
|
15
|
+
ref: h,
|
|
16
|
+
...p,
|
|
17
|
+
className: v("option", m),
|
|
18
|
+
"data-selected": t(n),
|
|
19
|
+
"data-disabled": t(a),
|
|
20
|
+
"data-minimal": t(r),
|
|
21
21
|
onClick: f,
|
|
22
22
|
children: [
|
|
23
23
|
/* @__PURE__ */ i("div", { className: "option-content", children: [
|
|
24
|
-
|
|
24
|
+
e && /* @__PURE__ */ o("div", { className: "option-icon", children: e }),
|
|
25
25
|
/* @__PURE__ */ i("div", { className: "option-content-layout", children: [
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
|
|
26
|
+
/* @__PURE__ */ i("div", { className: "option-header", children: [
|
|
27
|
+
/* @__PURE__ */ o("div", { className: "option-title", children: d }),
|
|
28
|
+
l
|
|
29
|
+
] }),
|
|
30
|
+
c && /* @__PURE__ */ o("div", { className: "option-label", children: c })
|
|
28
31
|
] })
|
|
29
32
|
] }),
|
|
30
|
-
|
|
33
|
+
n && !r && /* @__PURE__ */ o("div", { className: "option-check", children: /* @__PURE__ */ o(k, { icon: C }) })
|
|
31
34
|
]
|
|
32
35
|
}
|
|
33
36
|
);
|
|
34
37
|
}
|
|
35
38
|
);
|
|
36
39
|
export {
|
|
37
|
-
|
|
40
|
+
R as OptionItem
|
|
38
41
|
};
|
package/dist/bundle.es28.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { useTabSlider as
|
|
1
|
+
import { jsx as a, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import { useTabSlider as l, makeTabId as m } from "./bundle.es60.js";
|
|
3
3
|
import * as n from "@radix-ui/react-tabs";
|
|
4
|
-
import { useRef as
|
|
5
|
-
const o =
|
|
6
|
-
const t =
|
|
7
|
-
return /* @__PURE__ */ a(n.Root, { value: e, onValueChange: r, children: /* @__PURE__ */ a(o.Provider, { value: { baseId: i, containerRef: t }, children: /* @__PURE__ */
|
|
8
|
-
/* @__PURE__ */ a(
|
|
4
|
+
import { useRef as f, useId as T, createContext as u, useContext as c } from "react";
|
|
5
|
+
const o = u({ baseId: "", containerRef: {} }), x = ({ children: s, value: e, onChange: r }) => {
|
|
6
|
+
const t = f(null), i = T().replaceAll(":", "");
|
|
7
|
+
return /* @__PURE__ */ a(n.Root, { value: e, onValueChange: (d) => r(d), children: /* @__PURE__ */ a(o.Provider, { value: { baseId: i, containerRef: t }, children: /* @__PURE__ */ b(n.List, { className: "tabs", ref: t, children: [
|
|
8
|
+
/* @__PURE__ */ a(I, { value: e }),
|
|
9
9
|
s
|
|
10
10
|
] }) }) });
|
|
11
|
-
},
|
|
12
|
-
const { baseId: e, containerRef: r } = c(o), t =
|
|
11
|
+
}, I = ({ value: s }) => {
|
|
12
|
+
const { baseId: e, containerRef: r } = c(o), t = l({ baseId: e, value: s, containerRef: r });
|
|
13
13
|
return /* @__PURE__ */ a("div", { className: "tab-indicator-container", style: t, children: /* @__PURE__ */ a("div", { className: "tab-indicator" }) });
|
|
14
|
-
},
|
|
14
|
+
}, p = ({ children: s, value: e, ...r }) => {
|
|
15
15
|
const { baseId: t } = c(o);
|
|
16
|
-
return /* @__PURE__ */ a(n.Trigger, { ...r, id:
|
|
16
|
+
return /* @__PURE__ */ a(n.Trigger, { ...r, id: m(t, e), className: "tab", value: e, children: s });
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
x.Tab = p;
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
x as Tabs
|
|
21
21
|
};
|
package/dist/bundle.es62.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as o, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import y from "classnames";
|
|
3
3
|
import { attr as s } from "@companix/utils-browser";
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { VisuallyHidden as
|
|
6
|
-
import { mergeRefs as
|
|
7
|
-
import { SelectRightElements as
|
|
8
|
-
const
|
|
4
|
+
import { forwardRef as D, useRef as S, useCallback as T } from "react";
|
|
5
|
+
import { VisuallyHidden as j } from "@radix-ui/react-visually-hidden";
|
|
6
|
+
import { mergeRefs as z } from "react-merge-refs";
|
|
7
|
+
import { SelectRightElements as B } from "./bundle.es73.js";
|
|
8
|
+
const G = D(
|
|
9
9
|
({
|
|
10
10
|
required: a,
|
|
11
11
|
size: i,
|
|
@@ -16,40 +16,41 @@ const W = y(
|
|
|
16
16
|
clearButton: m,
|
|
17
17
|
placeholder: p,
|
|
18
18
|
clearButtonIcon: f,
|
|
19
|
+
customElement: h,
|
|
19
20
|
disabled: r,
|
|
20
|
-
onClear:
|
|
21
|
-
inputRef:
|
|
22
|
-
onClick:
|
|
23
|
-
...
|
|
24
|
-
},
|
|
25
|
-
const e =
|
|
21
|
+
onClear: C,
|
|
22
|
+
inputRef: I,
|
|
23
|
+
onClick: N,
|
|
24
|
+
...k
|
|
25
|
+
}, v) => {
|
|
26
|
+
const e = S(null), F = T(
|
|
26
27
|
(t) => {
|
|
27
28
|
if (!e.current || !document)
|
|
28
29
|
return;
|
|
29
30
|
t.target !== e.current && (e.current.click(), document.activeElement !== e.current && e.current.focus());
|
|
30
31
|
},
|
|
31
32
|
[e]
|
|
32
|
-
),
|
|
33
|
+
), g = (t) => {
|
|
33
34
|
document && document.activeElement === e.current && t.preventDefault();
|
|
34
|
-
}, g = (t) => {
|
|
35
|
-
r || v(t);
|
|
36
35
|
}, R = (t) => {
|
|
37
|
-
F(t);
|
|
36
|
+
r || F(t);
|
|
38
37
|
}, x = (t) => {
|
|
39
|
-
|
|
38
|
+
g(t);
|
|
39
|
+
}, A = (t) => {
|
|
40
|
+
e.current && e.current.focus(), C?.(t);
|
|
40
41
|
};
|
|
41
42
|
return /* @__PURE__ */ o(
|
|
42
43
|
"div",
|
|
43
44
|
{
|
|
44
|
-
ref:
|
|
45
|
-
className:
|
|
45
|
+
ref: v,
|
|
46
|
+
className: y("form select", d),
|
|
46
47
|
"data-size": i ?? "md",
|
|
47
48
|
"data-fill": s(u),
|
|
48
49
|
"data-required": s(a),
|
|
49
50
|
"data-disabled": s(r),
|
|
50
|
-
onMouseDown:
|
|
51
|
-
onClick:
|
|
52
|
-
...
|
|
51
|
+
onMouseDown: x,
|
|
52
|
+
onClick: R,
|
|
53
|
+
...k,
|
|
53
54
|
children: [
|
|
54
55
|
/* @__PURE__ */ o("div", { className: "select-layout form-input", children: [
|
|
55
56
|
l && /* @__PURE__ */ n("div", { className: "select-element", children: l }),
|
|
@@ -58,25 +59,26 @@ const W = y(
|
|
|
58
59
|
c
|
|
59
60
|
] }) }),
|
|
60
61
|
/* @__PURE__ */ n("div", { className: "select-element", children: /* @__PURE__ */ n(
|
|
61
|
-
|
|
62
|
+
B,
|
|
62
63
|
{
|
|
64
|
+
customElement: h,
|
|
63
65
|
clearButton: m,
|
|
64
66
|
value: !!c,
|
|
65
67
|
clearButtonIcon: f,
|
|
66
|
-
onClear:
|
|
68
|
+
onClear: A
|
|
67
69
|
}
|
|
68
70
|
) })
|
|
69
71
|
] }),
|
|
70
|
-
/* @__PURE__ */ n(
|
|
72
|
+
/* @__PURE__ */ n(j, { asChild: !0, children: /* @__PURE__ */ n(
|
|
71
73
|
"input",
|
|
72
74
|
{
|
|
73
|
-
ref:
|
|
75
|
+
ref: z([I, e]),
|
|
74
76
|
autoComplete: "off",
|
|
75
77
|
autoCapitalize: "none",
|
|
76
78
|
autoCorrect: "off",
|
|
77
79
|
spellCheck: "false",
|
|
78
80
|
"aria-autocomplete": "none",
|
|
79
|
-
onClick:
|
|
81
|
+
onClick: N,
|
|
80
82
|
readOnly: !0
|
|
81
83
|
}
|
|
82
84
|
) })
|
|
@@ -86,5 +88,5 @@ const W = y(
|
|
|
86
88
|
}
|
|
87
89
|
);
|
|
88
90
|
export {
|
|
89
|
-
|
|
91
|
+
G as SelectInput
|
|
90
92
|
};
|
package/dist/bundle.es64.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { Spinner as
|
|
1
|
+
import { jsx as i, jsxs as y } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as P, useEffect as C } from "react";
|
|
3
|
+
import { Spinner as T } from "./bundle.es7.js";
|
|
4
4
|
import { OptionItem as L } from "./bundle.es16.js";
|
|
5
|
-
import { OptionsList as
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { faPlus as
|
|
8
|
-
const
|
|
9
|
-
const { onOptionsLoaded: n, useOptions: s =
|
|
5
|
+
import { OptionsList as R } from "./bundle.es18.js";
|
|
6
|
+
import { Icon as S } from "./bundle.es36.js";
|
|
7
|
+
import { faPlus as b } from "@companix/icons-solid";
|
|
8
|
+
const I = () => ({ isLoading: !1, options: [] }), N = (e) => {
|
|
9
|
+
const { onOptionsLoaded: n, useOptions: s = I, options: o } = e, t = s();
|
|
10
10
|
return C(() => {
|
|
11
11
|
t.options.length > 0 && n?.(t.options);
|
|
12
12
|
}, [t.options]), o ? { options: o, isLoading: !1 } : t;
|
|
13
|
-
},
|
|
13
|
+
}, M = (e) => {
|
|
14
14
|
const {
|
|
15
15
|
isActive: n,
|
|
16
16
|
emptyText: s,
|
|
@@ -25,9 +25,9 @@ const b = () => ({ isLoading: !1, options: [] }), I = (e) => {
|
|
|
25
25
|
disableFiltering: l,
|
|
26
26
|
close: c,
|
|
27
27
|
...m
|
|
28
|
-
} = e, { emptyText: x, options: a, isLoading: g } =
|
|
29
|
-
return g ?? o ? /* @__PURE__ */ i("div", { className: "select-popover-loading", children: /* @__PURE__ */ i(
|
|
30
|
-
|
|
28
|
+
} = e, { emptyText: x, options: a, isLoading: g } = N(m), v = P(() => r && !l ? a.filter(r) : a, [a, r, l]);
|
|
29
|
+
return g ?? o ? /* @__PURE__ */ i("div", { className: "select-popover-loading", children: /* @__PURE__ */ i(T, { size: 24 }) }) : /* @__PURE__ */ i(
|
|
30
|
+
j,
|
|
31
31
|
{
|
|
32
32
|
options: v,
|
|
33
33
|
isActive: n,
|
|
@@ -41,7 +41,7 @@ const b = () => ({ isLoading: !1, options: [] }), I = (e) => {
|
|
|
41
41
|
close: c
|
|
42
42
|
}
|
|
43
43
|
);
|
|
44
|
-
},
|
|
44
|
+
}, j = (e) => {
|
|
45
45
|
const {
|
|
46
46
|
isActive: n,
|
|
47
47
|
onOpened: s,
|
|
@@ -61,7 +61,7 @@ const b = () => ({ isLoading: !1, options: [] }), I = (e) => {
|
|
|
61
61
|
L,
|
|
62
62
|
{
|
|
63
63
|
className: "select-add-option",
|
|
64
|
-
icon: /* @__PURE__ */ i(
|
|
64
|
+
icon: /* @__PURE__ */ i(S, { icon: b }),
|
|
65
65
|
title: o.text,
|
|
66
66
|
onClick: o.onClick,
|
|
67
67
|
onClickCapture: () => {
|
|
@@ -69,10 +69,10 @@ const b = () => ({ isLoading: !1, options: [] }), I = (e) => {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
) : void 0;
|
|
72
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ y(R, { scrollboxRef: t, optionsWrapperRef: d, maxHeight: 300, children: [
|
|
73
73
|
(o?.position === void 0 || o?.position === "first") && l,
|
|
74
74
|
p.length === 0 && !o && /* @__PURE__ */ i("div", { className: "select-tags-noneresults", children: u }),
|
|
75
|
-
p.map(({ title: c, value: m, className: x, icon: a, disabled: g,
|
|
75
|
+
p.map(({ title: c, value: m, className: x, icon: a, disabled: g, indicator: v, label: h }, k) => /* @__PURE__ */ i(
|
|
76
76
|
L,
|
|
77
77
|
{
|
|
78
78
|
active: n(m),
|
|
@@ -81,15 +81,16 @@ const b = () => ({ isLoading: !1, options: [] }), I = (e) => {
|
|
|
81
81
|
disabled: g,
|
|
82
82
|
className: x,
|
|
83
83
|
title: c,
|
|
84
|
-
label:
|
|
84
|
+
label: h,
|
|
85
|
+
indicator: v,
|
|
85
86
|
icon: a
|
|
86
87
|
},
|
|
87
|
-
`select-option-${
|
|
88
|
+
`select-option-${k}`
|
|
88
89
|
)),
|
|
89
90
|
o?.position === "last" && l
|
|
90
91
|
] });
|
|
91
92
|
};
|
|
92
93
|
export {
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
M as OptionsPopover,
|
|
95
|
+
j as SelectOptionsList
|
|
95
96
|
};
|
package/dist/bundle.es67.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs as b, jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import h from "classnames";
|
|
3
3
|
import { attr as e } from "@companix/utils-browser";
|
|
4
4
|
import { forwardRef as x } from "react";
|
|
5
|
-
import { useInputPadding as N } from "./bundle.
|
|
5
|
+
import { useInputPadding as N } from "./bundle.es81.js";
|
|
6
6
|
const v = x(
|
|
7
7
|
({
|
|
8
8
|
required: s,
|
package/dist/bundle.es72.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as D, jsx as t } from "react/jsx-runtime";
|
|
2
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.
|
|
4
|
-
import { useCalendar as j } from "./bundle.
|
|
3
|
+
import { CalendarHeader as F } from "./bundle.es82.js";
|
|
4
|
+
import { useCalendar as j } from "./bundle.es83.js";
|
|
5
5
|
import { attr as m } from "@companix/utils-browser";
|
|
6
6
|
import { isSameDate as f } from "./bundle.es59.js";
|
|
7
7
|
import { useLayoutEffect as I } from "react";
|
package/dist/bundle.es73.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { faXmark as i, faChevronDown as
|
|
1
|
+
import { jsxs as a, Fragment as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { faXmark as i, faChevronDown as x } from "@companix/icons-solid";
|
|
3
3
|
import { Icon as o } from "./bundle.es36.js";
|
|
4
|
-
const
|
|
5
|
-
const { clearButton: c, clearButtonIcon:
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
|
|
8
|
-
/* @__PURE__ */ e(
|
|
4
|
+
const d = (n) => {
|
|
5
|
+
const { customElement: t, clearButton: c, clearButtonIcon: s, value: l, onClear: r } = n;
|
|
6
|
+
return /* @__PURE__ */ a(m, { children: [
|
|
7
|
+
t,
|
|
8
|
+
c && l && /* @__PURE__ */ e("button", { className: "select-close-button", onClick: r, children: s ?? /* @__PURE__ */ e(o, { className: "select-close-icon", icon: i, size: "xxxs" }) }),
|
|
9
|
+
/* @__PURE__ */ e(o, { className: "expand-icon select-expand", icon: x, size: "xxxs" })
|
|
9
10
|
] });
|
|
10
11
|
};
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
+
d as SelectRightElements
|
|
13
14
|
};
|
package/dist/bundle.es81.js
CHANGED
|
@@ -1,77 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
onNextMonth: N,
|
|
14
|
-
onPrevMonth: v
|
|
15
|
-
}) => {
|
|
16
|
-
const e = n.getFullYear(), r = n.getMonth(), s = "ru", M = u(
|
|
17
|
-
(t) => {
|
|
18
|
-
c(_(n, t));
|
|
19
|
-
},
|
|
20
|
-
[c, n]
|
|
21
|
-
), x = u(
|
|
22
|
-
(t) => {
|
|
23
|
-
c(F(n, t));
|
|
24
|
-
},
|
|
25
|
-
[c, n]
|
|
26
|
-
), A = h(() => k(s).map((t) => ({
|
|
27
|
-
...t,
|
|
28
|
-
className: "capitalize",
|
|
29
|
-
disabled: a && a(t.value)
|
|
30
|
-
})), [s, a]), Y = h(() => z(e, 100).map((t) => ({
|
|
31
|
-
...t,
|
|
32
|
-
disabled: m && m(t.value)
|
|
33
|
-
})), [e, m]);
|
|
34
|
-
let l = r === 11 && e === f;
|
|
35
|
-
a && !l && (l = a(
|
|
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
|
-
] });
|
|
1
|
+
import { useRef as l, useCallback as p } from "react";
|
|
2
|
+
import { useEffectWithLayout as d } from "./bundle.es84.js";
|
|
3
|
+
const g = (r, f) => {
|
|
4
|
+
const c = l(null), i = l(null), o = { Right: c, Left: i }, u = p((t) => {
|
|
5
|
+
if (r.current) {
|
|
6
|
+
const n = r.current.style, e = o[t];
|
|
7
|
+
e.current && e.current.clientWidth ? n[`padding${t}`] !== `${e.current.clientWidth}px` && (n[`padding${t}`] = `${e.current.clientWidth}px`) : n[`padding${t}`] && (n[`padding${t}`] = "");
|
|
8
|
+
}
|
|
9
|
+
}, []);
|
|
10
|
+
return d(() => {
|
|
11
|
+
u("Left"), u("Right");
|
|
12
|
+
}, f), { rightRef: c, leftRef: i };
|
|
74
13
|
};
|
|
75
14
|
export {
|
|
76
|
-
|
|
15
|
+
g as useInputPadding
|
|
77
16
|
};
|
package/dist/bundle.es82.js
CHANGED
|
@@ -1,51 +1,77 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsxs as d, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as u, useMemo as h } from "react";
|
|
3
|
+
import { Select as p } from "./bundle.es13.js";
|
|
4
|
+
import { getMonths as k, getYears as z, DEFAULT_MAX_YEAR as f, DEFAULT_MIN_YEAR as g } from "./bundle.es65.js";
|
|
5
|
+
import { Icon as C } from "./bundle.es36.js";
|
|
6
|
+
import { faChevronLeft as E, faChevronRight as T } from "@companix/icons-solid";
|
|
7
|
+
import { setMonth as _, setYear as F } from "./bundle.es59.js";
|
|
8
|
+
const y = ({
|
|
9
|
+
viewDate: n,
|
|
10
|
+
onChange: c,
|
|
11
|
+
isMonthDisabled: a,
|
|
12
|
+
isYearDisabled: m,
|
|
13
|
+
onNextMonth: N,
|
|
14
|
+
onPrevMonth: v
|
|
11
15
|
}) => {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
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;
|
|
16
|
+
const e = n.getFullYear(), r = n.getMonth(), s = "ru", M = u(
|
|
17
|
+
(t) => {
|
|
18
|
+
c(_(n, t));
|
|
29
19
|
},
|
|
30
|
-
[c,
|
|
31
|
-
),
|
|
32
|
-
(
|
|
33
|
-
|
|
34
|
-
let Y = n > o || o > h;
|
|
35
|
-
return c && (Y = Y || o > t.getFullYear()), r && (Y = Y || o < t.getFullYear()), Y;
|
|
20
|
+
[c, n]
|
|
21
|
+
), x = u(
|
|
22
|
+
(t) => {
|
|
23
|
+
c(F(n, t));
|
|
36
24
|
},
|
|
37
|
-
[c,
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
25
|
+
[c, n]
|
|
26
|
+
), A = h(() => k(s).map((t) => ({
|
|
27
|
+
...t,
|
|
28
|
+
className: "capitalize",
|
|
29
|
+
disabled: a && a(t.value)
|
|
30
|
+
})), [s, a]), Y = h(() => z(e, 100).map((t) => ({
|
|
31
|
+
...t,
|
|
32
|
+
disabled: m && m(t.value)
|
|
33
|
+
})), [e, m]);
|
|
34
|
+
let l = r === 11 && e === f;
|
|
35
|
+
a && !l && (l = a(
|
|
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
|
+
] });
|
|
48
74
|
};
|
|
49
75
|
export {
|
|
50
|
-
|
|
76
|
+
y as CalendarHeader
|
|
51
77
|
};
|
package/dist/bundle.es83.js
CHANGED
|
@@ -1,16 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { subMonths as L, addMonths as N, useDayDisableCheker as R } from "./bundle.es59.js";
|
|
2
|
+
import { DEFAULT_MIN_YEAR as w, DEFAULT_MAX_YEAR as A } from "./bundle.es65.js";
|
|
3
|
+
import { useState as U, useCallback as M } from "react";
|
|
4
|
+
const X = ({
|
|
5
|
+
value: p,
|
|
6
|
+
disablePast: r,
|
|
7
|
+
disableFuture: c,
|
|
8
|
+
shouldDisableDate: E,
|
|
9
|
+
minDateTime: l,
|
|
10
|
+
maxDateTime: s
|
|
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
|
+
};
|
|
13
48
|
};
|
|
14
49
|
export {
|
|
15
|
-
|
|
50
|
+
X as useCalendar
|
|
16
51
|
};
|
package/dist/types.d.ts
CHANGED