@bikdotai/bik-component-library 0.0.875-beta.2 → 0.0.875-beta.3
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/cjs/components/agent-builder/components/ConfigToolPanel.js +11 -11
- package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +2 -2
- package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js +4 -4
- package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/utils/sourceIcons.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/OpennedDropdown.js.map +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +27 -10
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/MenuList.js.map +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js.map +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js.map +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/utils/iterationOnOptions.js +1 -1
- package/dist/cjs/components/dropdown/OpenedDropdown/utils/iterationOnOptions.js.map +1 -1
- package/dist/cjs/components/dropdown/hooks/useDropdown.js +1 -1
- package/dist/cjs/components/dropdown/hooks/useDropdown.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.d.ts +0 -12
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.js +145 -149
- package/dist/esm/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.d.ts +0 -12
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +82 -86
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionPicker.js +5 -5
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.d.ts +0 -12
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.js +48 -52
- package/dist/esm/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/index.d.ts +2 -18
- package/dist/esm/components/agent-builder/utils/sourceIcons.js +43 -43
- package/dist/esm/components/agent-builder/utils/toolActions.js +3 -3
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js +300 -278
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.js.map +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.d.ts +8 -0
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js +170 -126
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuItem.js.map +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.d.ts +4 -0
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js +144 -112
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.js.map +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.d.ts +1 -0
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js +32 -31
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/SelectAllMenu.js.map +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.d.ts +2 -0
- package/dist/esm/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js +54 -39
- package/dist/esm/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.js.map +1 -1
- package/dist/esm/components/dropdown/OpenedDropdown/utils/iterationOnOptions.d.ts +18 -16
- package/dist/esm/components/dropdown/OpenedDropdown/utils/iterationOnOptions.js +73 -27
- package/dist/esm/components/dropdown/OpenedDropdown/utils/iterationOnOptions.js.map +1 -1
- package/dist/esm/components/dropdown/hooks/useDropdown.d.ts +4 -17
- package/dist/esm/components/dropdown/hooks/useDropdown.js +176 -163
- package/dist/esm/components/dropdown/hooks/useDropdown.js.map +1 -1
- package/dist/esm/components/dropdown/type.d.ts +22 -0
- package/dist/esm/index.js +772 -816
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,403 +1,425 @@
|
|
|
1
|
-
import { jsx as u, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useCallback as
|
|
5
|
-
import { ZeroState as
|
|
6
|
-
import { useOutside as
|
|
7
|
-
import { COLORS as
|
|
8
|
-
import { useDropdown as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
1
|
+
import { jsx as u, jsxs as _ } from "react/jsx-runtime";
|
|
2
|
+
import et from "../../../../assets/icons/errorInfo.svg.js";
|
|
3
|
+
import tt from "../../../../assets/icons/refresh-purple.svg.js";
|
|
4
|
+
import { useCallback as ae, useState as E, useRef as g, useEffect as a } from "react";
|
|
5
|
+
import { ZeroState as nt } from "../../../zeroState/ZeroState.js";
|
|
6
|
+
import { useOutside as ot } from "../../../../hooks/useOutside.js";
|
|
7
|
+
import { COLORS as R } from "../../../../constants/Theme.js";
|
|
8
|
+
import { useDropdown as rt } from "../../hooks/useDropdown.js";
|
|
9
|
+
import { getNestedParentValues as fe, flattenSelectableOptions as st } from "../utils/iterationOnOptions.js";
|
|
10
|
+
import { Description as lt } from "./description/Description.js";
|
|
11
|
+
import { FreeFormMenu as ct } from "./menu/FreeFormMenu.js";
|
|
12
|
+
import { MenuList as it } from "./menu/MenuList.js";
|
|
13
|
+
import { SelectAllMenu as ut } from "./menu/SelectAllMenu.js";
|
|
14
|
+
import dt from "./multiSelect/MultiSelectDropdownBottomBar.js";
|
|
15
|
+
import { OpennedDropdownContainer as at, MenuListContainer as ft } from "./OpennedDropdown.styled.js";
|
|
16
|
+
import { SearchBox as pt } from "./searchbox/SearchBox.js";
|
|
17
|
+
import { SearchZeroState as ht } from "./searchbox/SearchZeroState.js";
|
|
18
|
+
const ee = {
|
|
18
19
|
height: 304,
|
|
19
20
|
width: 290
|
|
20
|
-
},
|
|
21
|
-
options:
|
|
22
|
-
isSearchable:
|
|
23
|
-
searchPlaceholder:
|
|
24
|
-
staticMenuHeight:
|
|
25
|
-
isMultiSelect:
|
|
26
|
-
maxSelections:
|
|
27
|
-
width:
|
|
28
|
-
allowFreeForm:
|
|
29
|
-
height:
|
|
30
|
-
onClose:
|
|
31
|
-
onSelect:
|
|
32
|
-
onSearch:
|
|
33
|
-
version:
|
|
34
|
-
skipSorting:
|
|
35
|
-
headerRef:
|
|
36
|
-
hideSelectAll:
|
|
37
|
-
primaryButtonText:
|
|
38
|
-
onInfiniteScroll:
|
|
39
|
-
onMultiSelectClear:
|
|
40
|
-
onDropdownItemClick:
|
|
41
|
-
buttonOptions:
|
|
42
|
-
isSearchLoading:
|
|
43
|
-
isOptionsLoading:
|
|
44
|
-
optionsErrorState:
|
|
45
|
-
disableSearchOptions:
|
|
46
|
-
disableSearchedOptionExcept:
|
|
47
|
-
useDefaultCursor:
|
|
48
|
-
containerStyle:
|
|
49
|
-
zeroState:
|
|
50
|
-
isDraggable:
|
|
51
|
-
onOptionsReorder:
|
|
52
|
-
hideClearButton:
|
|
53
|
-
showCheckboxForCustomElement:
|
|
54
|
-
checkboxActiveColor:
|
|
55
|
-
brandSelectedRow:
|
|
21
|
+
}, Bt = ({
|
|
22
|
+
options: f,
|
|
23
|
+
isSearchable: T,
|
|
24
|
+
searchPlaceholder: pe,
|
|
25
|
+
staticMenuHeight: te,
|
|
26
|
+
isMultiSelect: l,
|
|
27
|
+
maxSelections: D,
|
|
28
|
+
width: v,
|
|
29
|
+
allowFreeForm: ne,
|
|
30
|
+
height: he,
|
|
31
|
+
onClose: oe,
|
|
32
|
+
onSelect: me,
|
|
33
|
+
onSearch: p,
|
|
34
|
+
version: c,
|
|
35
|
+
skipSorting: ge,
|
|
36
|
+
headerRef: we,
|
|
37
|
+
hideSelectAll: ye,
|
|
38
|
+
primaryButtonText: Te,
|
|
39
|
+
onInfiniteScroll: be,
|
|
40
|
+
onMultiSelectClear: xe,
|
|
41
|
+
onDropdownItemClick: W,
|
|
42
|
+
buttonOptions: Oe,
|
|
43
|
+
isSearchLoading: Se,
|
|
44
|
+
isOptionsLoading: Le,
|
|
45
|
+
optionsErrorState: b,
|
|
46
|
+
disableSearchOptions: Ce,
|
|
47
|
+
disableSearchedOptionExcept: ke,
|
|
48
|
+
useDefaultCursor: Ie,
|
|
49
|
+
containerStyle: Ee = {},
|
|
50
|
+
zeroState: q = void 0,
|
|
51
|
+
isDraggable: x = !1,
|
|
52
|
+
onOptionsReorder: O,
|
|
53
|
+
hideClearButton: Re = !1,
|
|
54
|
+
showCheckboxForCustomElement: De = !1,
|
|
55
|
+
checkboxActiveColor: V,
|
|
56
|
+
brandSelectedRow: Z,
|
|
57
|
+
childrenLayout: h,
|
|
58
|
+
collapsibleChildren: A,
|
|
59
|
+
defaultCollapsed: j,
|
|
60
|
+
hideSelectedCount: We
|
|
56
61
|
}) => {
|
|
57
|
-
const
|
|
62
|
+
const K = ae(
|
|
58
63
|
(e) => {
|
|
59
|
-
if (!
|
|
60
|
-
const t = [],
|
|
61
|
-
return e.forEach((
|
|
62
|
-
|
|
63
|
-
}), [...t, ...
|
|
64
|
+
if (!x || !l) return e;
|
|
65
|
+
const t = [], o = [];
|
|
66
|
+
return e.forEach((i) => {
|
|
67
|
+
i.options ? o.push(i) : i.selected ? t.push(i) : o.push(i);
|
|
68
|
+
}), [...t, ...o];
|
|
64
69
|
},
|
|
65
|
-
[
|
|
66
|
-
), [
|
|
67
|
-
() =>
|
|
68
|
-
),
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}, [
|
|
72
|
-
|
|
73
|
-
}, [
|
|
74
|
-
|
|
75
|
-
}, [
|
|
76
|
-
|
|
70
|
+
[x, l]
|
|
71
|
+
), [B, re] = E(
|
|
72
|
+
() => K(f)
|
|
73
|
+
), se = g(B), le = g(!1), N = g(O);
|
|
74
|
+
a(() => {
|
|
75
|
+
re(K(f));
|
|
76
|
+
}, [f, K]), a(() => {
|
|
77
|
+
se.current = B;
|
|
78
|
+
}, [B]), a(() => {
|
|
79
|
+
N.current = O;
|
|
80
|
+
}, [O]), a(() => () => {
|
|
81
|
+
le.current && N.current && N.current(se.current);
|
|
77
82
|
}, []);
|
|
78
|
-
const
|
|
83
|
+
const Ae = ae(
|
|
79
84
|
(e) => {
|
|
80
|
-
|
|
85
|
+
re(e), c === "2.0" ? O?.(e) : le.current = !0;
|
|
81
86
|
},
|
|
82
|
-
[
|
|
83
|
-
),
|
|
84
|
-
dropdownOptions:
|
|
85
|
-
search:
|
|
86
|
-
searchedString:
|
|
87
|
-
searchedOptions:
|
|
88
|
-
searchError:
|
|
89
|
-
retrySearch:
|
|
90
|
-
onApplyHandler:
|
|
91
|
-
selectAllHandler:
|
|
87
|
+
[O, c]
|
|
88
|
+
), Be = x ? B : f, {
|
|
89
|
+
dropdownOptions: m,
|
|
90
|
+
search: Fe,
|
|
91
|
+
searchedString: n,
|
|
92
|
+
searchedOptions: S,
|
|
93
|
+
searchError: Pe,
|
|
94
|
+
retrySearch: He,
|
|
95
|
+
onApplyHandler: $,
|
|
96
|
+
selectAllHandler: Ue,
|
|
92
97
|
onMultiSelectClear: ve,
|
|
93
|
-
onFreeFormSelect:
|
|
94
|
-
onMultiSelectApply:
|
|
95
|
-
latestDropdownOptionsRef:
|
|
96
|
-
getSelectedOptions:
|
|
97
|
-
getCurrentSelectionCount:
|
|
98
|
-
} =
|
|
98
|
+
onFreeFormSelect: qe,
|
|
99
|
+
onMultiSelectApply: Ve,
|
|
100
|
+
latestDropdownOptionsRef: Ze,
|
|
101
|
+
getSelectedOptions: je,
|
|
102
|
+
getCurrentSelectionCount: Ke
|
|
103
|
+
} = rt(
|
|
104
|
+
c,
|
|
105
|
+
Be,
|
|
106
|
+
me,
|
|
107
|
+
ge || x,
|
|
99
108
|
l,
|
|
109
|
+
p,
|
|
100
110
|
Ce,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
ke,
|
|
112
|
+
D,
|
|
113
|
+
h
|
|
114
|
+
), [Ne, z] = E(v ?? ee.width), [w, M] = E(null), [F, G] = E(-1), [P, ce] = E(
|
|
115
|
+
() => A && j ? fe(f) : []
|
|
116
|
+
), J = g(P);
|
|
117
|
+
a(() => {
|
|
118
|
+
if (!A || !j) return;
|
|
119
|
+
const e = fe(f).filter(
|
|
120
|
+
(t) => !J.current.includes(t)
|
|
121
|
+
);
|
|
122
|
+
e.length && (J.current = [
|
|
123
|
+
...J.current,
|
|
124
|
+
...e
|
|
125
|
+
], ce((t) => [...t, ...e]));
|
|
126
|
+
}, [f, A, j]);
|
|
127
|
+
const $e = (e) => {
|
|
128
|
+
ce(
|
|
129
|
+
(t) => t.includes(e) ? t.filter((o) => o !== e) : [...t, e]
|
|
130
|
+
), G(-1);
|
|
131
|
+
}, L = g(null), ie = g([]), Q = g(null);
|
|
132
|
+
ot(
|
|
133
|
+
L,
|
|
111
134
|
() => {
|
|
112
|
-
if (
|
|
113
|
-
const e =
|
|
114
|
-
|
|
135
|
+
if (M(null), l && c === "2.0") {
|
|
136
|
+
const e = je(
|
|
137
|
+
Ze.current
|
|
115
138
|
);
|
|
116
|
-
|
|
139
|
+
oe?.(e);
|
|
117
140
|
} else
|
|
118
|
-
|
|
141
|
+
oe?.(m);
|
|
119
142
|
},
|
|
120
|
-
[
|
|
121
|
-
),
|
|
143
|
+
[we, ie]
|
|
144
|
+
), a(() => {
|
|
122
145
|
const e = setTimeout(() => {
|
|
123
|
-
|
|
146
|
+
L.current && L.current.focus({ preventScroll: !0 });
|
|
124
147
|
}, 0);
|
|
125
148
|
return () => clearTimeout(e);
|
|
126
|
-
}, [])
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
s.disabled || t.push(s);
|
|
137
|
-
}
|
|
138
|
-
}), t;
|
|
139
|
-
};
|
|
140
|
-
f(() => {
|
|
141
|
-
const e = (n) => {
|
|
142
|
-
const r = Ue(o && d ? O : a);
|
|
143
|
-
if (r.length !== 0) {
|
|
144
|
-
if (n.key === "ArrowDown")
|
|
145
|
-
n.preventDefault(), te((c) => {
|
|
146
|
-
const S = c < r.length - 1 ? c + 1 : 0;
|
|
149
|
+
}, []), a(() => {
|
|
150
|
+
const e = (o) => {
|
|
151
|
+
const d = st(
|
|
152
|
+
n && p ? S : m,
|
|
153
|
+
h === "nested" ? { collapsedParents: P } : void 0
|
|
154
|
+
);
|
|
155
|
+
if (d.length !== 0) {
|
|
156
|
+
if (o.key === "ArrowDown")
|
|
157
|
+
o.preventDefault(), G((r) => {
|
|
158
|
+
const s = r < d.length - 1 ? r + 1 : 0;
|
|
147
159
|
return setTimeout(() => {
|
|
148
|
-
const
|
|
149
|
-
`[data-option-index="${
|
|
160
|
+
const I = Q.current?.querySelector(
|
|
161
|
+
`[data-option-index="${s}"]`
|
|
150
162
|
);
|
|
151
|
-
|
|
163
|
+
I && I.scrollIntoView({
|
|
152
164
|
block: "nearest",
|
|
153
165
|
behavior: "smooth"
|
|
154
166
|
});
|
|
155
|
-
}, 0),
|
|
167
|
+
}, 0), s;
|
|
156
168
|
});
|
|
157
|
-
else if (
|
|
158
|
-
|
|
159
|
-
const
|
|
169
|
+
else if (o.key === "ArrowUp")
|
|
170
|
+
o.preventDefault(), G((r) => {
|
|
171
|
+
const s = r > 0 ? r - 1 : d.length - 1;
|
|
160
172
|
return setTimeout(() => {
|
|
161
|
-
const
|
|
162
|
-
`[data-option-index="${
|
|
173
|
+
const I = Q.current?.querySelector(
|
|
174
|
+
`[data-option-index="${s}"]`
|
|
163
175
|
);
|
|
164
|
-
|
|
176
|
+
I && I.scrollIntoView({
|
|
165
177
|
block: "nearest",
|
|
166
178
|
behavior: "smooth"
|
|
167
179
|
});
|
|
168
|
-
}, 0),
|
|
180
|
+
}, 0), s;
|
|
169
181
|
});
|
|
170
|
-
else if (
|
|
171
|
-
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
...
|
|
175
|
-
selected: !
|
|
176
|
-
}),
|
|
182
|
+
else if (o.key === "Enter" && F >= 0) {
|
|
183
|
+
o.preventDefault();
|
|
184
|
+
const r = d[F];
|
|
185
|
+
r && ($({
|
|
186
|
+
...r,
|
|
187
|
+
selected: !r.selected
|
|
188
|
+
}), W && W(r));
|
|
177
189
|
}
|
|
178
190
|
}
|
|
179
|
-
}, t =
|
|
191
|
+
}, t = L.current;
|
|
180
192
|
if (t)
|
|
181
193
|
return t.addEventListener("keydown", e), () => {
|
|
182
194
|
t.removeEventListener("keydown", e);
|
|
183
195
|
};
|
|
184
196
|
}, [
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
197
|
+
F,
|
|
198
|
+
n,
|
|
199
|
+
S,
|
|
200
|
+
m,
|
|
201
|
+
p,
|
|
202
|
+
$,
|
|
203
|
+
W,
|
|
204
|
+
h,
|
|
205
|
+
P
|
|
192
206
|
]);
|
|
193
|
-
const
|
|
194
|
-
function
|
|
195
|
-
|
|
207
|
+
const y = he ?? ee.height, H = typeof y == "number" ? T && l ? y - 96 : T && !l || !T && l ? y - 48 : y : y;
|
|
208
|
+
function ze(e, t) {
|
|
209
|
+
M(e && t ? {
|
|
196
210
|
title: e,
|
|
197
211
|
description: t
|
|
198
212
|
} : null);
|
|
199
213
|
}
|
|
200
|
-
|
|
201
|
-
const e =
|
|
202
|
-
if (
|
|
203
|
-
|
|
214
|
+
a(() => {
|
|
215
|
+
const e = v ?? ee.width;
|
|
216
|
+
if (w === null)
|
|
217
|
+
z(e);
|
|
204
218
|
else if (typeof e == "number")
|
|
205
|
-
|
|
219
|
+
z(e * 2);
|
|
206
220
|
else if (typeof e == "string" && e.endsWith("px")) {
|
|
207
221
|
const t = parseInt(e.replace("px", "")) * 2;
|
|
208
|
-
|
|
222
|
+
z(t);
|
|
209
223
|
}
|
|
210
|
-
}, [
|
|
211
|
-
const
|
|
212
|
-
if (!
|
|
224
|
+
}, [w]);
|
|
225
|
+
const U = [], X = ((e) => {
|
|
226
|
+
if (!l || !D && D !== 0)
|
|
213
227
|
return e;
|
|
214
|
-
const
|
|
215
|
-
return
|
|
216
|
-
if (
|
|
228
|
+
const o = Ke(m) >= D;
|
|
229
|
+
return o ? e.map((i) => {
|
|
230
|
+
if (i.options)
|
|
217
231
|
return {
|
|
218
|
-
...
|
|
219
|
-
options:
|
|
220
|
-
...
|
|
221
|
-
disabled:
|
|
232
|
+
...i,
|
|
233
|
+
options: i.options.map((s) => ({
|
|
234
|
+
...s,
|
|
235
|
+
disabled: s.disabled || !s.selected && o
|
|
222
236
|
}))
|
|
223
237
|
};
|
|
224
|
-
{
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
238
|
+
const d = (s) => ({
|
|
239
|
+
...s,
|
|
240
|
+
disabled: s.disabled || !s.selected
|
|
241
|
+
}), r = d(i);
|
|
242
|
+
return h === "nested" && r.children?.length ? {
|
|
243
|
+
...r,
|
|
244
|
+
children: r.children.map(d)
|
|
245
|
+
} : r;
|
|
231
246
|
}) : e;
|
|
232
247
|
})(
|
|
233
|
-
(
|
|
234
|
-
if (
|
|
248
|
+
(n && p ? S : m).map((e) => {
|
|
249
|
+
if (n && !p)
|
|
235
250
|
if (e.options) {
|
|
236
251
|
const t = { ...e };
|
|
237
|
-
return t.options = t.options.filter((
|
|
238
|
-
!
|
|
252
|
+
return t.options = t.options.filter((o) => o.label?.toLowerCase().includes(n.toLowerCase()) ? (U.push(
|
|
253
|
+
!n || o.label === n
|
|
239
254
|
), !0) : !1), t.options.length > 0 ? t : null;
|
|
240
255
|
} else
|
|
241
|
-
return e.label?.toLowerCase().includes(
|
|
242
|
-
!
|
|
256
|
+
return e.label?.toLowerCase().includes(n.toLowerCase()) || e.searchKey?.toLowerCase().includes(n.toLowerCase()) ? (U.push(
|
|
257
|
+
!n || e.label === n
|
|
243
258
|
), e) : null;
|
|
244
259
|
return e;
|
|
245
260
|
}).filter((e) => e !== null)
|
|
246
|
-
),
|
|
261
|
+
), Y = !!T && n && X.length === 0, C = !n && !!Le, k = !n && !!b && !C, Me = !n && !X.length && !C && !k, ue = C || k || Me, Ge = q?.title || "No results found", Je = q?.subTitle || "Please try again later or contact us at support@bik.ai if you require further assistance.", Qe = b?.title || "Failed to load options", Xe = b?.subTitle || "Something went wrong while fetching the list. Please try again", Ye = {
|
|
247
262
|
buttonText: "Try again",
|
|
248
263
|
buttonType: "text",
|
|
249
264
|
size: "small",
|
|
250
|
-
buttonTextColor:
|
|
251
|
-
customIconColor:
|
|
252
|
-
LeadingIcon:
|
|
253
|
-
},
|
|
265
|
+
buttonTextColor: R.background.inverseLight,
|
|
266
|
+
customIconColor: R.background.inverseLight,
|
|
267
|
+
LeadingIcon: tt
|
|
268
|
+
}, de = {
|
|
254
269
|
IconHolderStyle: {
|
|
255
|
-
background:
|
|
270
|
+
background: R.background.negative.light
|
|
256
271
|
},
|
|
257
|
-
Icon: /* @__PURE__ */ u(
|
|
258
|
-
...
|
|
272
|
+
Icon: /* @__PURE__ */ u(et, { color: R.content.negative, width: 24, height: 24 }),
|
|
273
|
+
...b
|
|
259
274
|
};
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
...
|
|
275
|
+
de.actionButton = {
|
|
276
|
+
...Ye,
|
|
277
|
+
...b?.actionButton ?? {}
|
|
263
278
|
};
|
|
264
|
-
const
|
|
265
|
-
return /* @__PURE__ */
|
|
266
|
-
|
|
279
|
+
const _e = C ? void 0 : k ? de : q;
|
|
280
|
+
return /* @__PURE__ */ _(
|
|
281
|
+
at,
|
|
267
282
|
{
|
|
268
|
-
version:
|
|
269
|
-
ref:
|
|
283
|
+
version: c,
|
|
284
|
+
ref: L,
|
|
270
285
|
tabIndex: -1,
|
|
271
286
|
style: {
|
|
272
287
|
// maxWidth: descriptionInfo ? 800 : 400,
|
|
273
|
-
width:
|
|
274
|
-
...
|
|
288
|
+
width: Ne,
|
|
289
|
+
...Ee,
|
|
275
290
|
outline: "none"
|
|
276
291
|
},
|
|
277
292
|
children: [
|
|
278
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ _(
|
|
279
294
|
"div",
|
|
280
295
|
{
|
|
281
296
|
style: {
|
|
282
|
-
width:
|
|
297
|
+
width: w ? "50%" : "100%",
|
|
283
298
|
display: "flex",
|
|
284
299
|
flexDirection: "column",
|
|
285
300
|
background: "white"
|
|
286
301
|
},
|
|
287
302
|
children: [
|
|
288
|
-
!!
|
|
289
|
-
|
|
303
|
+
!!T && /* @__PURE__ */ u(
|
|
304
|
+
pt,
|
|
290
305
|
{
|
|
291
|
-
onSearch:
|
|
292
|
-
version:
|
|
293
|
-
placeholder:
|
|
306
|
+
onSearch: Fe,
|
|
307
|
+
version: c,
|
|
308
|
+
placeholder: pe
|
|
294
309
|
}
|
|
295
310
|
),
|
|
296
|
-
|
|
311
|
+
ue ? /* @__PURE__ */ u(
|
|
297
312
|
"div",
|
|
298
313
|
{
|
|
299
314
|
"data-testid": "dropdown-options-zero-state",
|
|
300
315
|
style: {
|
|
301
|
-
height:
|
|
316
|
+
height: te ? H : y,
|
|
302
317
|
display: "flex",
|
|
303
|
-
background:
|
|
318
|
+
background: R.background.base
|
|
304
319
|
},
|
|
305
320
|
children: /* @__PURE__ */ u(
|
|
306
|
-
|
|
321
|
+
nt,
|
|
307
322
|
{
|
|
308
|
-
...
|
|
309
|
-
isLoading:
|
|
310
|
-
title:
|
|
311
|
-
subTitle:
|
|
323
|
+
..._e ?? {},
|
|
324
|
+
isLoading: C,
|
|
325
|
+
title: k ? Qe : Ge,
|
|
326
|
+
subTitle: k ? Xe : Je
|
|
312
327
|
}
|
|
313
328
|
)
|
|
314
329
|
}
|
|
315
|
-
) : /* @__PURE__ */
|
|
316
|
-
|
|
330
|
+
) : /* @__PURE__ */ _(
|
|
331
|
+
ft,
|
|
317
332
|
{
|
|
318
333
|
"data-testid": "dropdown-menu-list",
|
|
319
|
-
minHeight:
|
|
320
|
-
maxHeight:
|
|
321
|
-
ref:
|
|
334
|
+
minHeight: te ? H : void 0,
|
|
335
|
+
maxHeight: H,
|
|
336
|
+
ref: Q,
|
|
322
337
|
children: [
|
|
323
|
-
!!
|
|
324
|
-
|
|
338
|
+
!!l && !Y && !ye && /* @__PURE__ */ u(
|
|
339
|
+
ut,
|
|
325
340
|
{
|
|
326
|
-
version:
|
|
327
|
-
options:
|
|
328
|
-
onSelect:
|
|
329
|
-
checkboxActiveColor:
|
|
330
|
-
brandSelectedRow:
|
|
341
|
+
version: c,
|
|
342
|
+
options: n && p ? S : m,
|
|
343
|
+
onSelect: Ue,
|
|
344
|
+
checkboxActiveColor: V,
|
|
345
|
+
brandSelectedRow: Z,
|
|
346
|
+
childrenLayout: h
|
|
331
347
|
}
|
|
332
348
|
),
|
|
333
|
-
!
|
|
334
|
-
|
|
349
|
+
!ne && Y && /* @__PURE__ */ u(
|
|
350
|
+
ht,
|
|
335
351
|
{
|
|
336
|
-
isLoading:
|
|
337
|
-
errorMessage:
|
|
338
|
-
onRetry:
|
|
339
|
-
height:
|
|
340
|
-
searchedString:
|
|
341
|
-
containerWidth:
|
|
342
|
-
version:
|
|
352
|
+
isLoading: Se,
|
|
353
|
+
errorMessage: Pe,
|
|
354
|
+
onRetry: He,
|
|
355
|
+
height: H,
|
|
356
|
+
searchedString: n,
|
|
357
|
+
containerWidth: v,
|
|
358
|
+
version: c
|
|
343
359
|
}
|
|
344
360
|
),
|
|
345
|
-
|
|
346
|
-
|
|
361
|
+
ne && (Y || !!U.length && U.every((e) => e === !1)) && /* @__PURE__ */ u(
|
|
362
|
+
ct,
|
|
347
363
|
{
|
|
348
|
-
version:
|
|
349
|
-
isMultiSelect:
|
|
350
|
-
onSelect:
|
|
351
|
-
searchedString:
|
|
352
|
-
checkboxActiveColor:
|
|
353
|
-
brandSelectedRow:
|
|
364
|
+
version: c,
|
|
365
|
+
isMultiSelect: l,
|
|
366
|
+
onSelect: qe,
|
|
367
|
+
searchedString: n,
|
|
368
|
+
checkboxActiveColor: V,
|
|
369
|
+
brandSelectedRow: Z
|
|
354
370
|
}
|
|
355
371
|
),
|
|
356
372
|
/* @__PURE__ */ u(
|
|
357
|
-
|
|
373
|
+
it,
|
|
358
374
|
{
|
|
359
|
-
onInfiniteScroll:
|
|
360
|
-
onDropdownItemClick:
|
|
361
|
-
version:
|
|
362
|
-
onSelect:
|
|
363
|
-
showDescription:
|
|
364
|
-
isMultiSelect:
|
|
365
|
-
options:
|
|
366
|
-
useDefaultCursor:
|
|
367
|
-
ref:
|
|
368
|
-
focusedIndex:
|
|
369
|
-
isDraggable:
|
|
370
|
-
onOptionsReorder:
|
|
371
|
-
showCheckboxForCustomElement:
|
|
372
|
-
checkboxActiveColor:
|
|
373
|
-
brandSelectedRow:
|
|
375
|
+
onInfiniteScroll: be,
|
|
376
|
+
onDropdownItemClick: W,
|
|
377
|
+
version: c,
|
|
378
|
+
onSelect: $,
|
|
379
|
+
showDescription: ze,
|
|
380
|
+
isMultiSelect: l,
|
|
381
|
+
options: X,
|
|
382
|
+
useDefaultCursor: Ie,
|
|
383
|
+
ref: ie,
|
|
384
|
+
focusedIndex: F,
|
|
385
|
+
isDraggable: x,
|
|
386
|
+
onOptionsReorder: Ae,
|
|
387
|
+
showCheckboxForCustomElement: De,
|
|
388
|
+
checkboxActiveColor: V,
|
|
389
|
+
brandSelectedRow: Z,
|
|
390
|
+
childrenLayout: h,
|
|
391
|
+
collapsibleChildren: A,
|
|
392
|
+
collapsedParents: P,
|
|
393
|
+
onToggleCollapsed: $e
|
|
374
394
|
}
|
|
375
395
|
)
|
|
376
396
|
]
|
|
377
397
|
}
|
|
378
398
|
),
|
|
379
|
-
!!
|
|
380
|
-
|
|
399
|
+
!!l && !ue && c !== "2.0" && /* @__PURE__ */ u(
|
|
400
|
+
dt,
|
|
381
401
|
{
|
|
382
402
|
onClear: () => {
|
|
383
|
-
ve(),
|
|
403
|
+
ve(), xe?.();
|
|
384
404
|
},
|
|
385
|
-
onApply:
|
|
386
|
-
list:
|
|
387
|
-
buttonText:
|
|
388
|
-
buttonOptions:
|
|
389
|
-
hideClearButton:
|
|
405
|
+
onApply: Ve,
|
|
406
|
+
list: n && p ? S : m,
|
|
407
|
+
buttonText: Te,
|
|
408
|
+
buttonOptions: Oe,
|
|
409
|
+
hideClearButton: Re,
|
|
410
|
+
hideSelectedCount: We,
|
|
411
|
+
childrenLayout: h
|
|
390
412
|
}
|
|
391
413
|
)
|
|
392
414
|
]
|
|
393
415
|
}
|
|
394
416
|
),
|
|
395
|
-
!!
|
|
396
|
-
|
|
417
|
+
!!w && /* @__PURE__ */ u(
|
|
418
|
+
lt,
|
|
397
419
|
{
|
|
398
|
-
title:
|
|
399
|
-
description:
|
|
400
|
-
version:
|
|
420
|
+
title: w.title,
|
|
421
|
+
description: w.description,
|
|
422
|
+
version: c
|
|
401
423
|
}
|
|
402
424
|
)
|
|
403
425
|
]
|
|
@@ -405,6 +427,6 @@ const G = {
|
|
|
405
427
|
);
|
|
406
428
|
};
|
|
407
429
|
export {
|
|
408
|
-
|
|
430
|
+
Bt as OpenedDropdown
|
|
409
431
|
};
|
|
410
432
|
//# sourceMappingURL=OpennedDropdown.js.map
|