@konstructio/ui 0.1.2-alpha.39 → 0.1.2-alpha.40
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/components/MultiSelectDropdown/MultiSelectDropdown.js +26 -13
- package/dist/components/MultiSelectDropdown/components/Item/Item.js +22 -17
- package/dist/components/MultiSelectDropdown/components/List/List.js +22 -14
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +45 -36
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +7 -5
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +103 -84
- package/dist/index.d.ts +9 -2
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,21 +1,34 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { MultiSelectDropdownProvider as
|
|
4
|
-
import { Wrapper as
|
|
5
|
-
const
|
|
6
|
-
({
|
|
7
|
-
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as n } from "react";
|
|
3
|
+
import { MultiSelectDropdownProvider as a } from "./contexts/MultiSelectDropdown.provider.js";
|
|
4
|
+
import { Wrapper as s } from "./components/Wrapper/Wrapper.js";
|
|
5
|
+
const u = n(
|
|
6
|
+
({
|
|
7
|
+
options: t,
|
|
8
|
+
multiselect: e,
|
|
9
|
+
value: p,
|
|
10
|
+
onChange: i,
|
|
11
|
+
onBlur: l,
|
|
12
|
+
name: o,
|
|
13
|
+
isLoading: d,
|
|
14
|
+
noOptionsText: m,
|
|
15
|
+
...f
|
|
16
|
+
}, c) => /* @__PURE__ */ r(
|
|
17
|
+
a,
|
|
8
18
|
{
|
|
9
19
|
defaultOptions: t,
|
|
10
|
-
multiselect:
|
|
11
|
-
value:
|
|
20
|
+
multiselect: e,
|
|
21
|
+
value: p,
|
|
12
22
|
onChange: i,
|
|
13
|
-
onBlur:
|
|
14
|
-
name:
|
|
15
|
-
|
|
23
|
+
onBlur: l,
|
|
24
|
+
name: o,
|
|
25
|
+
isLoading: d,
|
|
26
|
+
noOptionsText: m,
|
|
27
|
+
children: /* @__PURE__ */ r(s, { ref: c, ...f, name: o })
|
|
16
28
|
}
|
|
17
29
|
)
|
|
18
30
|
);
|
|
31
|
+
u.displayName = "MultiSelectDropdown";
|
|
19
32
|
export {
|
|
20
|
-
|
|
33
|
+
u as MultiSelectDropdown
|
|
21
34
|
};
|
|
@@ -1,27 +1,32 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { cn as
|
|
3
|
-
import { wrapperVariants as
|
|
4
|
-
import { useMultiSelectDropdown as
|
|
5
|
-
import { Typography as
|
|
6
|
-
import { Tag as
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { cn as i } from "../../../../utils/index.js";
|
|
3
|
+
import { wrapperVariants as s } from "./Item.variants.js";
|
|
4
|
+
import { useMultiSelectDropdown as c } from "../../contexts/MultiSelectDropdown.hook.js";
|
|
5
|
+
import { Typography as p } from "../../../Typography/Typography.js";
|
|
6
|
+
import { Tag as n } from "../../../Tag/Tag.js";
|
|
7
|
+
const u = ({
|
|
8
|
+
option: r,
|
|
9
|
+
theme: e,
|
|
10
|
+
isSelected: a,
|
|
11
|
+
className: o
|
|
12
|
+
}) => {
|
|
13
|
+
const { onSelectOption: l } = c();
|
|
14
|
+
return /* @__PURE__ */ m(
|
|
10
15
|
"li",
|
|
11
16
|
{
|
|
12
17
|
role: "option",
|
|
13
|
-
"data-theme":
|
|
14
|
-
className:
|
|
15
|
-
onClick: () =>
|
|
18
|
+
"data-theme": e,
|
|
19
|
+
className: i(s({ isSelected: a }), o),
|
|
20
|
+
onClick: () => l(r),
|
|
16
21
|
children: [
|
|
17
|
-
/* @__PURE__ */ t(
|
|
18
|
-
/* @__PURE__ */ t(
|
|
19
|
-
|
|
22
|
+
/* @__PURE__ */ t(p, { variant: "body2", className: "text-slate-800", children: r.label }),
|
|
23
|
+
r.tagLabel && /* @__PURE__ */ t(
|
|
24
|
+
n,
|
|
20
25
|
{
|
|
21
26
|
id: r.id,
|
|
22
27
|
label: r.tagLabel,
|
|
23
28
|
color: r.tagColor,
|
|
24
|
-
isSelected:
|
|
29
|
+
isSelected: a
|
|
25
30
|
}
|
|
26
31
|
)
|
|
27
32
|
]
|
|
@@ -29,5 +34,5 @@ const x = ({ option: r, theme: a, isSelected: o }) => {
|
|
|
29
34
|
);
|
|
30
35
|
};
|
|
31
36
|
export {
|
|
32
|
-
|
|
37
|
+
u as Item
|
|
33
38
|
};
|
|
@@ -1,28 +1,36 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { cn as
|
|
3
|
-
import { Item as
|
|
2
|
+
import { cn as m } from "../../../../utils/index.js";
|
|
3
|
+
import { Item as i } from "../Item/Item.js";
|
|
4
4
|
import { wrapperVariants as p } from "./List.variants.js";
|
|
5
|
-
import { useMultiSelectDropdown as
|
|
6
|
-
import { Typography as
|
|
7
|
-
const y = ({ theme:
|
|
8
|
-
const { options:
|
|
9
|
-
return /* @__PURE__ */ e("ul", { role: "listbox", "data-theme":
|
|
10
|
-
|
|
5
|
+
import { useMultiSelectDropdown as c } from "../../contexts/MultiSelectDropdown.hook.js";
|
|
6
|
+
import { Typography as d } from "../../../Typography/Typography.js";
|
|
7
|
+
const y = ({ theme: s }) => {
|
|
8
|
+
const { options: o, selectedOptions: n, isLoading: r, noOptionsText: a } = c();
|
|
9
|
+
return /* @__PURE__ */ e("ul", { role: "listbox", "data-theme": s, className: m(p()), children: r ? /* @__PURE__ */ e(
|
|
10
|
+
i,
|
|
11
|
+
{
|
|
12
|
+
option: { id: "loading", label: "Loading..." },
|
|
13
|
+
className: "select-none pointer-events-none",
|
|
14
|
+
isSelected: !1
|
|
15
|
+
},
|
|
16
|
+
"loading"
|
|
17
|
+
) : o.length > 0 ? o.map((t) => /* @__PURE__ */ e(
|
|
18
|
+
i,
|
|
11
19
|
{
|
|
12
20
|
option: t,
|
|
13
|
-
isSelected:
|
|
14
|
-
(
|
|
21
|
+
isSelected: n.some(
|
|
22
|
+
(l) => l.id === t.id
|
|
15
23
|
)
|
|
16
24
|
},
|
|
17
25
|
t.id
|
|
18
|
-
)) : /* @__PURE__ */ e(
|
|
19
|
-
|
|
26
|
+
)) : /* @__PURE__ */ e("li", { className: "select-none", children: /* @__PURE__ */ e(
|
|
27
|
+
d,
|
|
20
28
|
{
|
|
21
29
|
variant: "body2",
|
|
22
30
|
className: "text-zinc-800 dark:text-slate-50 italic px-2 py-2",
|
|
23
|
-
children: "No options"
|
|
31
|
+
children: a ?? "No options"
|
|
24
32
|
}
|
|
25
|
-
) });
|
|
33
|
+
) }) });
|
|
26
34
|
};
|
|
27
35
|
export {
|
|
28
36
|
y as List
|
|
@@ -2,22 +2,30 @@ import "../Item/Item.js";
|
|
|
2
2
|
import { List as v } from "../List/List.js";
|
|
3
3
|
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
4
4
|
import * as c from "react";
|
|
5
|
-
import { forwardRef as
|
|
6
|
-
import {
|
|
7
|
-
import { cn as
|
|
8
|
-
import { useMultiSelectDropdown as
|
|
9
|
-
import { labelVariants as
|
|
10
|
-
import { C as
|
|
11
|
-
import { useMultiSelectDropdown as
|
|
12
|
-
|
|
5
|
+
import { forwardRef as b, useId as S, useImperativeHandle as C } from "react";
|
|
6
|
+
import { S as O } from "../../../../loader-juvMSJ9L.js";
|
|
7
|
+
import { cn as t } from "../../../../utils/index.js";
|
|
8
|
+
import { useMultiSelectDropdown as k } from "../../hooks/useMultiSelectDropdown.js";
|
|
9
|
+
import { labelVariants as D, multiSelectDropdownVariants as M, wrapperVariants as R } from "../../MultiSelectDropdown.variants.js";
|
|
10
|
+
import { C as y } from "../../../../chevron-up-CRyLc5Ml.js";
|
|
11
|
+
import { useMultiSelectDropdown as I } from "../../contexts/MultiSelectDropdown.hook.js";
|
|
12
|
+
import { Tag as V } from "../../../Tag/Tag.js";
|
|
13
|
+
const j = (r) => /* @__PURE__ */ c.createElement("svg", { width: 9, height: 9, viewBox: "0 0 9 9", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...r }, /* @__PURE__ */ c.createElement("path", { d: "M8.16667 0.8225L7.34417 0L4.08333 3.26083L0.8225 0L0 0.8225L3.26083 4.08333L0 7.34417L0.8225 8.16667L4.08333 4.90583L7.34417 8.16667L8.16667 7.34417L4.90583 4.08333L8.16667 0.8225Z", fill: "#364153" })), E = b(
|
|
13
14
|
({ label: r, labelClassName: p, name: l, placeholder: d = "", theme: h, wrapperClassName: f }, u) => {
|
|
14
|
-
const
|
|
15
|
-
|
|
15
|
+
const o = S(), {
|
|
16
|
+
selectedOptions: n,
|
|
17
|
+
isOpen: s,
|
|
18
|
+
onOpen: w,
|
|
19
|
+
onRemoveOption: L,
|
|
20
|
+
inputRef: i,
|
|
21
|
+
isLoading: g
|
|
22
|
+
} = I(), { wrapperRef: x, handleOpen: N } = k();
|
|
23
|
+
return C(u, () => i.current, [i]), /* @__PURE__ */ m(
|
|
16
24
|
"div",
|
|
17
25
|
{
|
|
18
|
-
ref:
|
|
19
|
-
className:
|
|
20
|
-
|
|
26
|
+
ref: x,
|
|
27
|
+
className: t(
|
|
28
|
+
R({
|
|
21
29
|
className: f
|
|
22
30
|
})
|
|
23
31
|
),
|
|
@@ -26,9 +34,9 @@ const I = (r) => /* @__PURE__ */ c.createElement("svg", { width: 9, height: 9, v
|
|
|
26
34
|
r ? /* @__PURE__ */ e(
|
|
27
35
|
"label",
|
|
28
36
|
{
|
|
29
|
-
htmlFor: l ??
|
|
30
|
-
className:
|
|
31
|
-
|
|
37
|
+
htmlFor: l ?? o,
|
|
38
|
+
className: t(
|
|
39
|
+
D({
|
|
32
40
|
className: p
|
|
33
41
|
})
|
|
34
42
|
),
|
|
@@ -39,36 +47,36 @@ const I = (r) => /* @__PURE__ */ c.createElement("svg", { width: 9, height: 9, v
|
|
|
39
47
|
/* @__PURE__ */ m(
|
|
40
48
|
"div",
|
|
41
49
|
{
|
|
42
|
-
id: l ??
|
|
43
|
-
className:
|
|
50
|
+
id: l ?? o,
|
|
51
|
+
className: t(M()),
|
|
44
52
|
role: "combobox",
|
|
45
|
-
onClick:
|
|
46
|
-
"aria-expanded":
|
|
53
|
+
onClick: N,
|
|
54
|
+
"aria-expanded": s,
|
|
47
55
|
children: [
|
|
48
|
-
n.length === 0 ? /* @__PURE__ */ e("span", { className: "text-base text-inherit select-none", children: d }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: n.map((
|
|
49
|
-
|
|
56
|
+
n.length === 0 ? /* @__PURE__ */ e("span", { className: "text-base text-inherit select-none", children: d }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: n.map((a) => /* @__PURE__ */ e(
|
|
57
|
+
V,
|
|
50
58
|
{
|
|
51
|
-
id:
|
|
52
|
-
label:
|
|
53
|
-
color:
|
|
59
|
+
id: a.id,
|
|
60
|
+
label: a.tagLabel || a.label || "",
|
|
61
|
+
color: a.tagColor || "gray-800",
|
|
54
62
|
className: "select-none gap-2",
|
|
55
63
|
rightIcon: /* @__PURE__ */ e(
|
|
56
|
-
|
|
64
|
+
j,
|
|
57
65
|
{
|
|
58
66
|
className: "w-2 h-2",
|
|
59
|
-
onClick: () => L(
|
|
67
|
+
onClick: () => L(a)
|
|
60
68
|
}
|
|
61
69
|
),
|
|
62
|
-
"data-value":
|
|
70
|
+
"data-value": a.label
|
|
63
71
|
},
|
|
64
|
-
|
|
72
|
+
a.id
|
|
65
73
|
)) }),
|
|
66
|
-
/* @__PURE__ */ e(
|
|
67
|
-
|
|
74
|
+
g ? /* @__PURE__ */ e(O, { className: "w-4 h-4 text-slate-400 animate-spin shrink-0" }) : /* @__PURE__ */ e(
|
|
75
|
+
y,
|
|
68
76
|
{
|
|
69
|
-
className:
|
|
77
|
+
className: t(
|
|
70
78
|
"w-4 h-4 text-inherit transition-all duration-50 shrink-0",
|
|
71
|
-
|
|
79
|
+
s ? "rotate-0" : "rotate-180"
|
|
72
80
|
)
|
|
73
81
|
}
|
|
74
82
|
)
|
|
@@ -78,19 +86,20 @@ const I = (r) => /* @__PURE__ */ c.createElement("svg", { width: 9, height: 9, v
|
|
|
78
86
|
/* @__PURE__ */ e(
|
|
79
87
|
"input",
|
|
80
88
|
{
|
|
81
|
-
ref:
|
|
89
|
+
ref: i,
|
|
82
90
|
type: "text",
|
|
83
91
|
name: l,
|
|
84
92
|
className: "hidden",
|
|
85
93
|
readOnly: !0
|
|
86
94
|
}
|
|
87
95
|
),
|
|
88
|
-
|
|
96
|
+
s ? /* @__PURE__ */ e(v, {}) : null
|
|
89
97
|
]
|
|
90
98
|
}
|
|
91
99
|
);
|
|
92
100
|
}
|
|
93
101
|
);
|
|
102
|
+
E.displayName = "MultiSelectDropdownWrapper";
|
|
94
103
|
export {
|
|
95
|
-
|
|
104
|
+
E as Wrapper
|
|
96
105
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createContext as
|
|
2
|
-
const
|
|
1
|
+
import { createContext as n } from "react";
|
|
2
|
+
const t = {
|
|
3
3
|
options: [],
|
|
4
4
|
selectedOptions: [],
|
|
5
5
|
isOpen: !1,
|
|
@@ -12,8 +12,10 @@ const n = {
|
|
|
12
12
|
},
|
|
13
13
|
onOpen() {
|
|
14
14
|
throw new Error("Function not implemented.");
|
|
15
|
-
}
|
|
16
|
-
|
|
15
|
+
},
|
|
16
|
+
isLoading: !1,
|
|
17
|
+
noOptionsText: void 0
|
|
18
|
+
}, e = n(t);
|
|
17
19
|
export {
|
|
18
|
-
|
|
20
|
+
e as MultiSelectDropdownContext
|
|
19
21
|
};
|
|
@@ -1,119 +1,138 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { MultiSelectDropdownContext as
|
|
4
|
-
import { useToggle as
|
|
5
|
-
const
|
|
1
|
+
import { jsx as V } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as k, useState as R, useEffect as g, useCallback as S } from "react";
|
|
3
|
+
import { MultiSelectDropdownContext as C } from "./MultiSelectDropdown.context.js";
|
|
4
|
+
import { useToggle as E } from "../../../hooks/useToggle.js";
|
|
5
|
+
const q = ({
|
|
6
6
|
children: x,
|
|
7
|
-
defaultOptions:
|
|
8
|
-
multiselect:
|
|
9
|
-
value:
|
|
10
|
-
onChange:
|
|
11
|
-
onBlur:
|
|
12
|
-
name:
|
|
7
|
+
defaultOptions: r = [],
|
|
8
|
+
multiselect: i = !0,
|
|
9
|
+
value: f,
|
|
10
|
+
onChange: m,
|
|
11
|
+
onBlur: u,
|
|
12
|
+
name: h,
|
|
13
|
+
isLoading: b,
|
|
14
|
+
noOptionsText: j
|
|
13
15
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
if (
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
const d = k(null), [w, I] = E(!1), [y, p] = R(r), [c, v] = R([]), o = f !== void 0;
|
|
17
|
+
g(() => {
|
|
18
|
+
if (!o) {
|
|
19
|
+
const n = new Set(
|
|
20
|
+
c.map((e) => e.id)
|
|
21
|
+
);
|
|
22
|
+
p(
|
|
23
|
+
i ? r.filter((e) => !n.has(e.id)) : r.map((e) => ({
|
|
24
|
+
...e,
|
|
25
|
+
isSelected: n.has(e.id)
|
|
26
|
+
}))
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
}, [r, i, o, c]), g(() => {
|
|
30
|
+
if (o) {
|
|
31
|
+
const n = f || [];
|
|
32
|
+
v(n);
|
|
33
|
+
const e = new Set(n.map((s) => s.id));
|
|
34
|
+
p(
|
|
35
|
+
i ? r.filter((s) => !e.has(s.id)) : r.map((s) => ({
|
|
22
36
|
...s,
|
|
23
|
-
isSelected:
|
|
37
|
+
isSelected: e.has(s.id)
|
|
24
38
|
}))
|
|
25
39
|
);
|
|
26
40
|
}
|
|
27
|
-
}, [
|
|
28
|
-
const
|
|
29
|
-
(
|
|
30
|
-
const
|
|
31
|
-
id:
|
|
32
|
-
value:
|
|
33
|
-
})), s = JSON.stringify(
|
|
34
|
-
|
|
41
|
+
}, [f, o, r, i]);
|
|
42
|
+
const l = S(
|
|
43
|
+
(n) => {
|
|
44
|
+
const e = n.map(({ id: t, value: O, label: P }) => ({
|
|
45
|
+
id: t,
|
|
46
|
+
value: O ?? P
|
|
47
|
+
})), s = JSON.stringify(e);
|
|
48
|
+
d.current && (d.current.value = s), m && m({
|
|
35
49
|
target: {
|
|
36
|
-
value:
|
|
37
|
-
name:
|
|
50
|
+
value: n,
|
|
51
|
+
name: h ?? ""
|
|
38
52
|
}
|
|
39
53
|
});
|
|
40
54
|
},
|
|
41
|
-
[
|
|
42
|
-
),
|
|
43
|
-
(
|
|
44
|
-
const
|
|
45
|
-
|
|
55
|
+
[m, h]
|
|
56
|
+
), a = S(
|
|
57
|
+
(n) => {
|
|
58
|
+
const e = w;
|
|
59
|
+
I(n), e && n === !1 && u && d.current && u({
|
|
60
|
+
target: d.current,
|
|
61
|
+
type: "blur"
|
|
62
|
+
});
|
|
46
63
|
},
|
|
47
|
-
[
|
|
48
|
-
),
|
|
49
|
-
(
|
|
50
|
-
if (
|
|
51
|
-
const
|
|
52
|
-
...
|
|
53
|
-
|
|
64
|
+
[w, I, u, d]
|
|
65
|
+
), D = S(
|
|
66
|
+
(n) => {
|
|
67
|
+
if (o) {
|
|
68
|
+
const t = [
|
|
69
|
+
...i ? c : [],
|
|
70
|
+
n
|
|
54
71
|
];
|
|
55
|
-
|
|
72
|
+
l(t), a(!1);
|
|
56
73
|
return;
|
|
57
74
|
}
|
|
58
|
-
const
|
|
59
|
-
...
|
|
60
|
-
|
|
75
|
+
const e = [
|
|
76
|
+
...i ? c : [],
|
|
77
|
+
n
|
|
61
78
|
];
|
|
62
|
-
v(
|
|
63
|
-
const s =
|
|
64
|
-
|
|
65
|
-
(
|
|
66
|
-
) :
|
|
67
|
-
...
|
|
68
|
-
isSelected: s.includes(
|
|
69
|
-
}))),
|
|
79
|
+
v(e);
|
|
80
|
+
const s = e.map((t) => t.id);
|
|
81
|
+
p(() => i ? r.filter(
|
|
82
|
+
(t) => !s.includes(t.id)
|
|
83
|
+
) : r.map((t) => ({
|
|
84
|
+
...t,
|
|
85
|
+
isSelected: s.includes(t.id)
|
|
86
|
+
}))), l(e), a(!1);
|
|
70
87
|
},
|
|
71
88
|
[
|
|
72
|
-
|
|
73
|
-
d,
|
|
74
|
-
c,
|
|
75
|
-
i,
|
|
89
|
+
r,
|
|
76
90
|
l,
|
|
77
|
-
|
|
91
|
+
i,
|
|
92
|
+
c,
|
|
93
|
+
a,
|
|
94
|
+
o
|
|
78
95
|
]
|
|
79
|
-
),
|
|
80
|
-
(
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
83
|
-
(
|
|
96
|
+
), M = S(
|
|
97
|
+
(n) => {
|
|
98
|
+
if (o) {
|
|
99
|
+
const t = c.filter(
|
|
100
|
+
(O) => O.id !== n.id
|
|
84
101
|
);
|
|
85
|
-
|
|
102
|
+
l(t);
|
|
86
103
|
return;
|
|
87
104
|
}
|
|
88
|
-
const
|
|
89
|
-
(
|
|
105
|
+
const e = c.filter(
|
|
106
|
+
(t) => t.id !== n.id
|
|
90
107
|
);
|
|
91
|
-
v(
|
|
92
|
-
const s =
|
|
93
|
-
|
|
94
|
-
() =>
|
|
95
|
-
(
|
|
108
|
+
v(e);
|
|
109
|
+
const s = e.map((t) => t.id);
|
|
110
|
+
p(
|
|
111
|
+
() => r.filter(
|
|
112
|
+
(t) => !s.includes(t.id)
|
|
96
113
|
)
|
|
97
|
-
),
|
|
114
|
+
), l(e);
|
|
98
115
|
},
|
|
99
|
-
[
|
|
116
|
+
[r, l, c, o]
|
|
100
117
|
);
|
|
101
|
-
return /* @__PURE__ */
|
|
102
|
-
|
|
118
|
+
return /* @__PURE__ */ V(
|
|
119
|
+
C.Provider,
|
|
103
120
|
{
|
|
104
121
|
value: {
|
|
105
|
-
options:
|
|
106
|
-
selectedOptions:
|
|
107
|
-
isOpen:
|
|
108
|
-
inputRef:
|
|
109
|
-
onSelectOption:
|
|
110
|
-
onRemoveOption:
|
|
111
|
-
onOpen:
|
|
122
|
+
options: y,
|
|
123
|
+
selectedOptions: c,
|
|
124
|
+
isOpen: w,
|
|
125
|
+
inputRef: d,
|
|
126
|
+
onSelectOption: D,
|
|
127
|
+
onRemoveOption: M,
|
|
128
|
+
onOpen: a,
|
|
129
|
+
isLoading: b,
|
|
130
|
+
noOptionsText: j
|
|
112
131
|
},
|
|
113
132
|
children: x
|
|
114
133
|
}
|
|
115
134
|
);
|
|
116
135
|
};
|
|
117
136
|
export {
|
|
118
|
-
|
|
137
|
+
q as MultiSelectDropdownProvider
|
|
119
138
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -378,7 +378,7 @@ export declare const MultiSelectDropdown: FC<MultiSelectDropdownProps>;
|
|
|
378
378
|
declare type MultiSelectDropdownOption = {
|
|
379
379
|
id: string | number;
|
|
380
380
|
label: string;
|
|
381
|
-
tagLabel
|
|
381
|
+
tagLabel?: string;
|
|
382
382
|
tagColor?: TagProps['color'];
|
|
383
383
|
value?: string;
|
|
384
384
|
};
|
|
@@ -393,7 +393,9 @@ declare interface MultiSelectDropdownProps extends VariantProps<typeof multiSele
|
|
|
393
393
|
multiselect?: boolean;
|
|
394
394
|
value?: MultiSelectDropdownOption[];
|
|
395
395
|
onChange?: OnChangeFn_2;
|
|
396
|
-
onBlur?:
|
|
396
|
+
onBlur?: OnBlurFn;
|
|
397
|
+
isLoading?: boolean;
|
|
398
|
+
noOptionsText?: string;
|
|
397
399
|
}
|
|
398
400
|
|
|
399
401
|
declare const multiSelectDropdownVariants: (props?: ClassProp | undefined) => string;
|
|
@@ -486,6 +488,11 @@ declare interface NumberInputProps extends VariantProps<typeof numberInputVarian
|
|
|
486
488
|
|
|
487
489
|
declare const numberInputVariants: (props?: ClassProp | undefined) => string;
|
|
488
490
|
|
|
491
|
+
declare type OnBlurFn = (event: {
|
|
492
|
+
target: HTMLInputElement | null;
|
|
493
|
+
type?: string;
|
|
494
|
+
}) => void;
|
|
495
|
+
|
|
489
496
|
declare type OnChangeFn = (params: {
|
|
490
497
|
target: {
|
|
491
498
|
value: string;
|
package/dist/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@konstructio/ui",
|
|
3
3
|
"description": "A set of reusable and customizable React components built for konstruct.io",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.1.2-alpha.
|
|
5
|
+
"version": "0.1.2-alpha.39",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@konstructio/ui",
|
|
3
3
|
"description": "A set of reusable and customizable React components built for konstruct.io",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.1.2-alpha.
|
|
5
|
+
"version": "0.1.2-alpha.40",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"main": "dist/index.js",
|