@companix/uikit 0.0.49 → 0.0.50
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/Select/Select.scss +7 -0
- package/dist/Select/index.d.ts +1 -0
- package/dist/bundle.es12.js +29 -27
- package/dist/bundle.es6.js +1 -1
- package/package.json +1 -1
package/dist/Select/Select.scss
CHANGED
package/dist/Select/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export interface SelectParams {
|
|
|
18
18
|
scrollTo: (index: number) => void;
|
|
19
19
|
}>;
|
|
20
20
|
addOption?: SelectAddOption;
|
|
21
|
+
isLoading?: boolean;
|
|
21
22
|
}
|
|
22
23
|
export type SelectProps<T> = Omit<SelectFormProps, 'value' | 'onChange' | 'closeButton'> & DependedValueType<T> & SelectParams & {
|
|
23
24
|
value: T | null;
|
package/dist/bundle.es12.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as I, useImperativeHandle as T } from "react";
|
|
3
3
|
import { Popover as b } from "./bundle.es10.js";
|
|
4
|
-
import { useFroozeClosing as
|
|
5
|
-
import { SelectInput as
|
|
6
|
-
import { useScrollListController as
|
|
4
|
+
import { useFroozeClosing as B } from "./bundle.es45.js";
|
|
5
|
+
import { SelectInput as D } from "./bundle.es46.js";
|
|
6
|
+
import { useScrollListController as L } from "./bundle.es47.js";
|
|
7
7
|
import { SelectOptions as j } from "./bundle.es48.js";
|
|
8
8
|
import { mergeRefs as w } from "react-merge-refs";
|
|
9
|
-
|
|
9
|
+
import { Spinner as H } from "./bundle.es6.js";
|
|
10
|
+
const Q = (a) => {
|
|
10
11
|
const {
|
|
11
|
-
options:
|
|
12
|
-
onChange:
|
|
13
|
-
value:
|
|
12
|
+
options: t,
|
|
13
|
+
onChange: l,
|
|
14
|
+
value: i,
|
|
14
15
|
minimalOptions: m,
|
|
15
16
|
matchTarget: f = "width",
|
|
16
17
|
children: u,
|
|
@@ -19,55 +20,56 @@ const J = (a) => {
|
|
|
19
20
|
popoverRef: v,
|
|
20
21
|
clearButton: s,
|
|
21
22
|
addOption: h,
|
|
23
|
+
isLoading: g,
|
|
22
24
|
...x
|
|
23
|
-
} = a,
|
|
24
|
-
const o =
|
|
25
|
+
} = a, r = I(() => {
|
|
26
|
+
const o = i === null ? -1 : t.findIndex((e) => e.value === i);
|
|
25
27
|
return {
|
|
26
28
|
index: o,
|
|
27
|
-
option:
|
|
29
|
+
option: t[o]
|
|
28
30
|
};
|
|
29
|
-
}, [
|
|
31
|
+
}, [t, i]), R = r.option?.value ?? null, { popoverRef: C, froozePopoverPosition: O, handleAnimationEnd: P } = B(), { scrollToElement: c, optionsWrapperRef: S, scrollBoxRef: A } = L();
|
|
30
32
|
T(d, () => ({
|
|
31
33
|
scrollTo: (o) => c(o, "top")
|
|
32
34
|
}));
|
|
33
|
-
const
|
|
34
|
-
O(),
|
|
35
|
+
const z = (o, e) => {
|
|
36
|
+
O(), l(o), e();
|
|
35
37
|
}, E = (o) => {
|
|
36
|
-
o.stopPropagation(), s &&
|
|
38
|
+
o.stopPropagation(), s && l(null);
|
|
37
39
|
}, F = () => {
|
|
38
|
-
|
|
40
|
+
r.index !== -1 && c(r.index, "center");
|
|
39
41
|
};
|
|
40
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ n(
|
|
41
43
|
b,
|
|
42
44
|
{
|
|
43
45
|
minimal: !0,
|
|
44
46
|
ref: w([C, v]),
|
|
45
47
|
sideOffset: 0,
|
|
46
48
|
matchTarget: f,
|
|
47
|
-
onAnimationEnd:
|
|
49
|
+
onAnimationEnd: P,
|
|
48
50
|
onOpenAutoFocus: (o) => o.preventDefault(),
|
|
49
51
|
onCloseAutoFocus: (o) => o.preventDefault(),
|
|
50
52
|
disabled: p,
|
|
51
|
-
content: ({ close: o }) => /* @__PURE__ */
|
|
53
|
+
content: ({ close: o }) => g ? /* @__PURE__ */ n("div", { className: "select-popover-loading", children: /* @__PURE__ */ n(H, { size: 24 }) }) : /* @__PURE__ */ n(
|
|
52
54
|
j,
|
|
53
55
|
{
|
|
54
|
-
options:
|
|
56
|
+
options: t,
|
|
55
57
|
active: R,
|
|
56
|
-
scrollboxRef:
|
|
57
|
-
optionsWrapperRef:
|
|
58
|
+
scrollboxRef: A,
|
|
59
|
+
optionsWrapperRef: S,
|
|
58
60
|
minimalOptions: m,
|
|
59
61
|
addOption: h,
|
|
60
62
|
onOpened: F,
|
|
61
|
-
onSelect: (e) =>
|
|
63
|
+
onSelect: (e) => z(e, o)
|
|
62
64
|
}
|
|
63
65
|
),
|
|
64
|
-
children: u ?? /* @__PURE__ */
|
|
65
|
-
|
|
66
|
+
children: u ?? /* @__PURE__ */ n(
|
|
67
|
+
D,
|
|
66
68
|
{
|
|
67
69
|
...x,
|
|
68
70
|
disabled: p,
|
|
69
71
|
clearButton: s,
|
|
70
|
-
value:
|
|
72
|
+
value: r.option?.title ?? "",
|
|
71
73
|
onClear: E
|
|
72
74
|
}
|
|
73
75
|
)
|
|
@@ -75,5 +77,5 @@ const J = (a) => {
|
|
|
75
77
|
);
|
|
76
78
|
};
|
|
77
79
|
export {
|
|
78
|
-
|
|
80
|
+
Q as Select
|
|
79
81
|
};
|
package/dist/bundle.es6.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import o from "classnames";
|
|
3
|
-
const i = ({ size: r =
|
|
3
|
+
const i = ({ size: r = 18, className: t, color: e }) => /* @__PURE__ */ n(
|
|
4
4
|
"div",
|
|
5
5
|
{
|
|
6
6
|
style: { width: `${r}px`, height: `${r}px`, color: e },
|