@companix/uikit 0.0.71 → 0.0.72
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/OptionsPopover.d.ts +1 -0
- package/dist/bundle.es50.js +54 -53
- package/package.json +1 -1
package/dist/bundle.es50.js
CHANGED
|
@@ -1,87 +1,88 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
1
|
+
import { jsx as i, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as y, useEffect as h } from "react";
|
|
3
3
|
import { Spinner as k } from "./bundle.es6.js";
|
|
4
4
|
import { OptionItem as C } from "./bundle.es15.js";
|
|
5
|
-
import { OptionsList as
|
|
6
|
-
import { Icon as
|
|
5
|
+
import { OptionsList as P } from "./bundle.es17.js";
|
|
6
|
+
import { Icon as T } from "./bundle.es33.js";
|
|
7
7
|
import { faPlus as R } from "@companix/icons-solid";
|
|
8
|
-
const S = () => ({ isLoading: !1, options: [] }), b = (
|
|
9
|
-
const { onOptionsLoaded:
|
|
8
|
+
const S = () => ({ isLoading: !1, options: [] }), b = (s) => {
|
|
9
|
+
const { onOptionsLoaded: e, useOptions: p = S, options: o } = s, t = p();
|
|
10
10
|
return h(() => {
|
|
11
|
-
t.options.length > 0 &&
|
|
11
|
+
t.options.length > 0 && e?.(t.options);
|
|
12
12
|
}, [t.options]), o ? { options: o, isLoading: !1 } : t;
|
|
13
|
-
}, F = (
|
|
13
|
+
}, F = (s) => {
|
|
14
14
|
const {
|
|
15
|
-
isActive:
|
|
16
|
-
emptyText:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
isActive: e,
|
|
16
|
+
emptyText: p,
|
|
17
|
+
isLoading: o,
|
|
18
|
+
scrollboxRef: t,
|
|
19
|
+
optionsWrapperRef: a,
|
|
20
|
+
addOption: r,
|
|
21
|
+
onOpened: d,
|
|
22
|
+
onSelect: f,
|
|
22
23
|
minimalOptions: O,
|
|
23
|
-
filterOptions:
|
|
24
|
-
disableFiltering:
|
|
25
|
-
close:
|
|
26
|
-
...
|
|
27
|
-
} =
|
|
28
|
-
return
|
|
24
|
+
filterOptions: c,
|
|
25
|
+
disableFiltering: n,
|
|
26
|
+
close: m,
|
|
27
|
+
...u
|
|
28
|
+
} = s, { emptyText: x, options: l, isLoading: g } = b(u), L = y(() => c && !n ? l.filter(c) : l, [l, c, n]);
|
|
29
|
+
return g ?? o ? /* @__PURE__ */ i("div", { className: "select-popover-loading", children: /* @__PURE__ */ i(k, { size: 24 }) }) : /* @__PURE__ */ i(
|
|
29
30
|
I,
|
|
30
31
|
{
|
|
31
|
-
options:
|
|
32
|
-
isActive:
|
|
33
|
-
emptyText:
|
|
34
|
-
scrollboxRef:
|
|
35
|
-
optionsWrapperRef:
|
|
32
|
+
options: L,
|
|
33
|
+
isActive: e,
|
|
34
|
+
emptyText: x ?? p,
|
|
35
|
+
scrollboxRef: t,
|
|
36
|
+
optionsWrapperRef: a,
|
|
36
37
|
minimalOptions: O,
|
|
37
|
-
addOption:
|
|
38
|
-
onOpened:
|
|
39
|
-
onSelect:
|
|
40
|
-
close:
|
|
38
|
+
addOption: r,
|
|
39
|
+
onOpened: d,
|
|
40
|
+
onSelect: f,
|
|
41
|
+
close: m
|
|
41
42
|
}
|
|
42
43
|
);
|
|
43
|
-
}, I = (
|
|
44
|
+
}, I = (s) => {
|
|
44
45
|
const {
|
|
45
|
-
isActive:
|
|
46
|
-
onOpened:
|
|
46
|
+
isActive: e,
|
|
47
|
+
onOpened: p,
|
|
47
48
|
addOption: o,
|
|
48
49
|
scrollboxRef: t,
|
|
49
|
-
optionsWrapperRef:
|
|
50
|
-
options:
|
|
50
|
+
optionsWrapperRef: a,
|
|
51
|
+
options: r,
|
|
51
52
|
onSelect: d,
|
|
52
|
-
minimalOptions:
|
|
53
|
-
emptyText:
|
|
54
|
-
close:
|
|
55
|
-
} =
|
|
53
|
+
minimalOptions: f,
|
|
54
|
+
emptyText: O = "Ничего не найдено",
|
|
55
|
+
close: c
|
|
56
|
+
} = s;
|
|
56
57
|
return h(() => {
|
|
57
|
-
|
|
58
|
-
}, []), /* @__PURE__ */
|
|
59
|
-
o && /* @__PURE__ */
|
|
58
|
+
p?.(r.findIndex(({ value: n }) => e(n)));
|
|
59
|
+
}, []), /* @__PURE__ */ v(P, { scrollboxRef: t, optionsWrapperRef: a, maxHeight: 300, children: [
|
|
60
|
+
o && /* @__PURE__ */ i(
|
|
60
61
|
C,
|
|
61
62
|
{
|
|
62
63
|
className: "select-add-option",
|
|
63
|
-
icon: /* @__PURE__ */
|
|
64
|
+
icon: /* @__PURE__ */ i(T, { icon: R }),
|
|
64
65
|
title: o.text,
|
|
65
66
|
onClick: o.onClick,
|
|
66
67
|
onClickCapture: () => {
|
|
67
|
-
o.closeOnClick &&
|
|
68
|
+
o.closeOnClick && c();
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
),
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
r.length === 0 && !o && /* @__PURE__ */ i("div", { className: "select-tags-empty", children: O }),
|
|
73
|
+
r.map(({ title: n, value: m, className: u, icon: x, disabled: l, label: g }, L) => /* @__PURE__ */ i(
|
|
73
74
|
C,
|
|
74
75
|
{
|
|
75
|
-
active:
|
|
76
|
-
onClick: () => d?.(
|
|
77
|
-
minimal:
|
|
78
|
-
disabled:
|
|
76
|
+
active: e(m),
|
|
77
|
+
onClick: () => d?.(m),
|
|
78
|
+
minimal: f,
|
|
79
|
+
disabled: l,
|
|
79
80
|
className: u,
|
|
80
|
-
title:
|
|
81
|
+
title: n,
|
|
81
82
|
label: g,
|
|
82
|
-
icon:
|
|
83
|
+
icon: x
|
|
83
84
|
},
|
|
84
|
-
`select-option-${
|
|
85
|
+
`select-option-${L}`
|
|
85
86
|
))
|
|
86
87
|
] });
|
|
87
88
|
};
|