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