@alixpartners/ui-components 2.0.0-beta.9 → 2.0.1
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/README.md +2 -2
- package/dist/ap-logos-Cl1TR5nm.js +4 -0
- package/dist/assets/Banner.css +1 -1
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Checkbox.css +1 -1
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/DragAndDrop.css +1 -1
- package/dist/assets/Dropdown.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/LogosGallery.css +1 -0
- package/dist/assets/NavBar.css +1 -1
- package/dist/assets/SplitButton.css +1 -1
- package/dist/assets/TabNavigation.css +1 -1
- package/dist/assets/Tag.css +1 -1
- package/dist/assets/Textarea.css +1 -1
- package/dist/assets/Toast.css +1 -1
- package/dist/assets/ap-icons-types.d.ts +1 -1
- package/dist/assets/ap-icons.d.ts +1 -1
- package/dist/assets/ap-logos-types.d.ts +1 -0
- package/dist/assets/ap-logos.d.ts +1 -0
- package/dist/assets/main.css +1 -1
- package/dist/components/Button/Button.d.ts +11 -12
- package/dist/components/Button/Button.js +15 -14
- package/dist/components/Creatable/Creatable.d.ts +3 -1
- package/dist/components/Creatable/Creatable.js +26 -25
- package/dist/components/Dialog/Dialog.d.ts +15 -4
- package/dist/components/Dialog/Dialog.js +58 -42
- package/dist/components/DragAndDrop/DragAndDrop.d.ts +4 -1
- package/dist/components/DragAndDrop/DragAndDrop.js +82 -72
- package/dist/components/Dropdown/Dropdown.d.ts +8 -1
- package/dist/components/Dropdown/Dropdown.js +354 -320
- package/dist/components/Icons/IconsGallery.js +1 -1
- package/dist/components/Input/Input.d.ts +23 -22
- package/dist/components/Input/Input.js +62 -60
- package/dist/components/Logo/Logo.d.ts +8 -0
- package/dist/components/Logo/Logo.js +57 -0
- package/dist/components/Logos/LogosGallery.d.ts +1 -0
- package/dist/components/Logos/LogosGallery.js +16 -0
- package/dist/components/NavBar/NavBar.d.ts +13 -5
- package/dist/components/NavBar/NavBar.js +246 -230
- package/dist/components/SplitButton/SplitButton.js +20 -18
- package/dist/components/Tab/Tab.js +19 -19
- package/dist/components/TabNavigation/TabNavigation.js +11 -10
- package/dist/components/Tag/Tag.js +8 -8
- package/dist/components/Textarea/Textarea.d.ts +2 -2
- package/dist/components/Toast/Toast.js +2 -2
- package/dist/components/Toast/Toast.test.js +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +12 -10
- package/dist/main.d.ts +5 -3
- package/dist/main.js +29 -25
- package/dist/storybook-docs-page.d.ts +4 -1
- package/package.json +1 -1
|
@@ -1,118 +1,118 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { c as
|
|
1
|
+
import { jsx as t, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { c as R } from "../../clsx-OuTLNxxd.js";
|
|
3
3
|
import * as m from "react";
|
|
4
|
-
import { useState as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { u as
|
|
12
|
-
import { c as
|
|
13
|
-
import { h as
|
|
14
|
-
import { u as
|
|
15
|
-
import { P as
|
|
16
|
-
import '../../assets/Dropdown.css';var
|
|
17
|
-
|
|
18
|
-
]),
|
|
4
|
+
import { useState as W, useRef as U, useEffect as q, useCallback as ae } from "react";
|
|
5
|
+
import K from "../Icon/Icon.js";
|
|
6
|
+
import co from "../Toggle/Toggle.js";
|
|
7
|
+
import ce from "../Button/Button.js";
|
|
8
|
+
import ge from "../Ghost/Ghost.js";
|
|
9
|
+
import io from "../Search/Search.js";
|
|
10
|
+
import po from "../Tooltip/Tooltip.js";
|
|
11
|
+
import { u as uo, c as _o, d as Ce, P as Ie, a as X, g as mo } from "../../index-DWydnyjJ.js";
|
|
12
|
+
import { c as Ne, R as fo, A as Pe, P as wo, D as vo, C as ho, a as bo } from "../../index-DieLVN0p.js";
|
|
13
|
+
import { h as Do, R as go, u as Co, F as Io } from "../../index-BGZDIjm9.js";
|
|
14
|
+
import { u as No } from "../../index-2H7slGYV.js";
|
|
15
|
+
import { P as Oe } from "../../index-DpfPnSMn.js";
|
|
16
|
+
import '../../assets/Dropdown.css';var te = "Popover", [Ae, Xt] = _o(te, [
|
|
17
|
+
Ne
|
|
18
|
+
]), Y = Ne(), [Po, G] = Ae(te), Re = (n) => {
|
|
19
19
|
const {
|
|
20
20
|
__scopePopover: p,
|
|
21
|
-
children:
|
|
22
|
-
open:
|
|
23
|
-
defaultOpen:
|
|
24
|
-
onOpenChange:
|
|
21
|
+
children: a,
|
|
22
|
+
open: l,
|
|
23
|
+
defaultOpen: c,
|
|
24
|
+
onOpenChange: s,
|
|
25
25
|
modal: _ = !1
|
|
26
|
-
} = n, u =
|
|
27
|
-
prop:
|
|
28
|
-
defaultProp:
|
|
29
|
-
onChange:
|
|
30
|
-
caller:
|
|
26
|
+
} = n, u = Y(p), y = m.useRef(null), [D, E] = m.useState(!1), [T, L] = uo({
|
|
27
|
+
prop: l,
|
|
28
|
+
defaultProp: c ?? !1,
|
|
29
|
+
onChange: s,
|
|
30
|
+
caller: te
|
|
31
31
|
});
|
|
32
|
-
return /* @__PURE__ */ t(
|
|
33
|
-
|
|
32
|
+
return /* @__PURE__ */ t(fo, { ...u, children: /* @__PURE__ */ t(
|
|
33
|
+
Po,
|
|
34
34
|
{
|
|
35
35
|
scope: p,
|
|
36
|
-
contentId:
|
|
37
|
-
triggerRef:
|
|
38
|
-
open:
|
|
39
|
-
onOpenChange:
|
|
40
|
-
onOpenToggle: m.useCallback(() =>
|
|
41
|
-
hasCustomAnchor:
|
|
42
|
-
onCustomAnchorAdd: m.useCallback(() =>
|
|
43
|
-
onCustomAnchorRemove: m.useCallback(() =>
|
|
36
|
+
contentId: No(),
|
|
37
|
+
triggerRef: y,
|
|
38
|
+
open: T,
|
|
39
|
+
onOpenChange: L,
|
|
40
|
+
onOpenToggle: m.useCallback(() => L((i) => !i), [L]),
|
|
41
|
+
hasCustomAnchor: D,
|
|
42
|
+
onCustomAnchorAdd: m.useCallback(() => E(!0), []),
|
|
43
|
+
onCustomAnchorRemove: m.useCallback(() => E(!1), []),
|
|
44
44
|
modal: _,
|
|
45
|
-
children:
|
|
45
|
+
children: a
|
|
46
46
|
}
|
|
47
47
|
) });
|
|
48
48
|
};
|
|
49
|
-
|
|
50
|
-
var
|
|
49
|
+
Re.displayName = te;
|
|
50
|
+
var ye = "PopoverAnchor", Le = m.forwardRef(
|
|
51
51
|
(n, p) => {
|
|
52
|
-
const { __scopePopover:
|
|
53
|
-
return m.useEffect(() => (_(), () => u()), [_, u]), /* @__PURE__ */ t(
|
|
52
|
+
const { __scopePopover: a, ...l } = n, c = G(ye, a), s = Y(a), { onCustomAnchorAdd: _, onCustomAnchorRemove: u } = c;
|
|
53
|
+
return m.useEffect(() => (_(), () => u()), [_, u]), /* @__PURE__ */ t(Pe, { ...s, ...l, ref: p });
|
|
54
54
|
}
|
|
55
55
|
);
|
|
56
|
-
|
|
57
|
-
var
|
|
56
|
+
Le.displayName = ye;
|
|
57
|
+
var xe = "PopoverTrigger", ke = m.forwardRef(
|
|
58
58
|
(n, p) => {
|
|
59
|
-
const { __scopePopover:
|
|
60
|
-
|
|
59
|
+
const { __scopePopover: a, ...l } = n, c = G(xe, a), s = Y(a), _ = Ce(p, c.triggerRef), u = /* @__PURE__ */ t(
|
|
60
|
+
Ie.button,
|
|
61
61
|
{
|
|
62
62
|
type: "button",
|
|
63
63
|
"aria-haspopup": "dialog",
|
|
64
|
-
"aria-expanded":
|
|
65
|
-
"aria-controls":
|
|
66
|
-
"data-state":
|
|
67
|
-
...
|
|
64
|
+
"aria-expanded": c.open,
|
|
65
|
+
"aria-controls": c.contentId,
|
|
66
|
+
"data-state": Te(c.open),
|
|
67
|
+
...l,
|
|
68
68
|
ref: _,
|
|
69
|
-
onClick:
|
|
69
|
+
onClick: X(n.onClick, c.onOpenToggle)
|
|
70
70
|
}
|
|
71
71
|
);
|
|
72
|
-
return
|
|
72
|
+
return c.hasCustomAnchor ? u : /* @__PURE__ */ t(Pe, { asChild: !0, ...s, children: u });
|
|
73
73
|
}
|
|
74
74
|
);
|
|
75
|
-
|
|
76
|
-
var
|
|
75
|
+
ke.displayName = xe;
|
|
76
|
+
var ie = "PopoverPortal", [Oo, Ao] = Ae(ie, {
|
|
77
77
|
forceMount: void 0
|
|
78
|
-
}),
|
|
79
|
-
const { __scopePopover: p, forceMount:
|
|
80
|
-
return /* @__PURE__ */ t(
|
|
78
|
+
}), Ee = (n) => {
|
|
79
|
+
const { __scopePopover: p, forceMount: a, children: l, container: c } = n, s = G(ie, p);
|
|
80
|
+
return /* @__PURE__ */ t(Oo, { scope: p, forceMount: a, children: /* @__PURE__ */ t(Oe, { present: a || s.open, children: /* @__PURE__ */ t(wo, { asChild: !0, container: c, children: l }) }) });
|
|
81
81
|
};
|
|
82
|
-
|
|
83
|
-
var
|
|
82
|
+
Ee.displayName = ie;
|
|
83
|
+
var J = "PopoverContent", Me = m.forwardRef(
|
|
84
84
|
(n, p) => {
|
|
85
|
-
const
|
|
86
|
-
return /* @__PURE__ */ t(
|
|
85
|
+
const a = Ao(J, n.__scopePopover), { forceMount: l = a.forceMount, ...c } = n, s = G(J, n.__scopePopover);
|
|
86
|
+
return /* @__PURE__ */ t(Oe, { present: l || s.open, children: s.modal ? /* @__PURE__ */ t(yo, { ...c, ref: p }) : /* @__PURE__ */ t(Lo, { ...c, ref: p }) });
|
|
87
87
|
}
|
|
88
88
|
);
|
|
89
|
-
|
|
90
|
-
var
|
|
89
|
+
Me.displayName = J;
|
|
90
|
+
var Ro = mo("PopoverContent.RemoveScroll"), yo = m.forwardRef(
|
|
91
91
|
(n, p) => {
|
|
92
|
-
const
|
|
92
|
+
const a = G(J, n.__scopePopover), l = m.useRef(null), c = Ce(p, l), s = m.useRef(!1);
|
|
93
93
|
return m.useEffect(() => {
|
|
94
|
-
const _ =
|
|
95
|
-
if (_) return
|
|
96
|
-
}, []), /* @__PURE__ */ t(
|
|
97
|
-
|
|
94
|
+
const _ = l.current;
|
|
95
|
+
if (_) return Do(_);
|
|
96
|
+
}, []), /* @__PURE__ */ t(go, { as: Ro, allowPinchZoom: !0, children: /* @__PURE__ */ t(
|
|
97
|
+
Se,
|
|
98
98
|
{
|
|
99
99
|
...n,
|
|
100
|
-
ref:
|
|
101
|
-
trapFocus:
|
|
100
|
+
ref: c,
|
|
101
|
+
trapFocus: a.open,
|
|
102
102
|
disableOutsidePointerEvents: !0,
|
|
103
|
-
onCloseAutoFocus:
|
|
103
|
+
onCloseAutoFocus: X(n.onCloseAutoFocus, (_) => {
|
|
104
104
|
var u;
|
|
105
|
-
_.preventDefault(),
|
|
105
|
+
_.preventDefault(), s.current || (u = a.triggerRef.current) == null || u.focus();
|
|
106
106
|
}),
|
|
107
|
-
onPointerDownOutside:
|
|
107
|
+
onPointerDownOutside: X(
|
|
108
108
|
n.onPointerDownOutside,
|
|
109
109
|
(_) => {
|
|
110
|
-
const u = _.detail.originalEvent,
|
|
111
|
-
|
|
110
|
+
const u = _.detail.originalEvent, y = u.button === 0 && u.ctrlKey === !0, D = u.button === 2 || y;
|
|
111
|
+
s.current = D;
|
|
112
112
|
},
|
|
113
113
|
{ checkForDefaultPrevented: !1 }
|
|
114
114
|
),
|
|
115
|
-
onFocusOutside:
|
|
115
|
+
onFocusOutside: X(
|
|
116
116
|
n.onFocusOutside,
|
|
117
117
|
(_) => _.preventDefault(),
|
|
118
118
|
{ checkForDefaultPrevented: !1 }
|
|
@@ -120,72 +120,72 @@ var vo = to("PopoverContent.RemoveScroll"), ho = m.forwardRef(
|
|
|
120
120
|
}
|
|
121
121
|
) });
|
|
122
122
|
}
|
|
123
|
-
),
|
|
123
|
+
), Lo = m.forwardRef(
|
|
124
124
|
(n, p) => {
|
|
125
|
-
const
|
|
125
|
+
const a = G(J, n.__scopePopover), l = m.useRef(!1), c = m.useRef(!1);
|
|
126
126
|
return /* @__PURE__ */ t(
|
|
127
|
-
|
|
127
|
+
Se,
|
|
128
128
|
{
|
|
129
129
|
...n,
|
|
130
130
|
ref: p,
|
|
131
131
|
trapFocus: !1,
|
|
132
132
|
disableOutsidePointerEvents: !1,
|
|
133
|
-
onCloseAutoFocus: (
|
|
133
|
+
onCloseAutoFocus: (s) => {
|
|
134
134
|
var _, u;
|
|
135
|
-
(_ = n.onCloseAutoFocus) == null || _.call(n,
|
|
135
|
+
(_ = n.onCloseAutoFocus) == null || _.call(n, s), s.defaultPrevented || (l.current || (u = a.triggerRef.current) == null || u.focus(), s.preventDefault()), l.current = !1, c.current = !1;
|
|
136
136
|
},
|
|
137
|
-
onInteractOutside: (
|
|
138
|
-
var
|
|
139
|
-
(
|
|
140
|
-
const _ =
|
|
141
|
-
((
|
|
137
|
+
onInteractOutside: (s) => {
|
|
138
|
+
var y, D;
|
|
139
|
+
(y = n.onInteractOutside) == null || y.call(n, s), s.defaultPrevented || (l.current = !0, s.detail.originalEvent.type === "pointerdown" && (c.current = !0));
|
|
140
|
+
const _ = s.target;
|
|
141
|
+
((D = a.triggerRef.current) == null ? void 0 : D.contains(_)) && s.preventDefault(), s.detail.originalEvent.type === "focusin" && c.current && s.preventDefault();
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
);
|
|
145
145
|
}
|
|
146
|
-
),
|
|
146
|
+
), Se = m.forwardRef(
|
|
147
147
|
(n, p) => {
|
|
148
148
|
const {
|
|
149
|
-
__scopePopover:
|
|
150
|
-
trapFocus:
|
|
151
|
-
onOpenAutoFocus:
|
|
152
|
-
onCloseAutoFocus:
|
|
149
|
+
__scopePopover: a,
|
|
150
|
+
trapFocus: l,
|
|
151
|
+
onOpenAutoFocus: c,
|
|
152
|
+
onCloseAutoFocus: s,
|
|
153
153
|
disableOutsidePointerEvents: _,
|
|
154
154
|
onEscapeKeyDown: u,
|
|
155
|
-
onPointerDownOutside:
|
|
156
|
-
onFocusOutside:
|
|
157
|
-
onInteractOutside:
|
|
158
|
-
...
|
|
159
|
-
} = n,
|
|
160
|
-
return
|
|
161
|
-
|
|
155
|
+
onPointerDownOutside: y,
|
|
156
|
+
onFocusOutside: D,
|
|
157
|
+
onInteractOutside: E,
|
|
158
|
+
...T
|
|
159
|
+
} = n, L = G(J, a), i = Y(a);
|
|
160
|
+
return Co(), /* @__PURE__ */ t(
|
|
161
|
+
Io,
|
|
162
162
|
{
|
|
163
163
|
asChild: !0,
|
|
164
164
|
loop: !0,
|
|
165
|
-
trapped:
|
|
166
|
-
onMountAutoFocus:
|
|
167
|
-
onUnmountAutoFocus:
|
|
165
|
+
trapped: l,
|
|
166
|
+
onMountAutoFocus: c,
|
|
167
|
+
onUnmountAutoFocus: s,
|
|
168
168
|
children: /* @__PURE__ */ t(
|
|
169
|
-
|
|
169
|
+
vo,
|
|
170
170
|
{
|
|
171
171
|
asChild: !0,
|
|
172
172
|
disableOutsidePointerEvents: _,
|
|
173
|
-
onInteractOutside:
|
|
173
|
+
onInteractOutside: E,
|
|
174
174
|
onEscapeKeyDown: u,
|
|
175
|
-
onPointerDownOutside:
|
|
176
|
-
onFocusOutside:
|
|
177
|
-
onDismiss: () =>
|
|
175
|
+
onPointerDownOutside: y,
|
|
176
|
+
onFocusOutside: D,
|
|
177
|
+
onDismiss: () => L.onOpenChange(!1),
|
|
178
178
|
children: /* @__PURE__ */ t(
|
|
179
|
-
|
|
179
|
+
ho,
|
|
180
180
|
{
|
|
181
|
-
"data-state":
|
|
181
|
+
"data-state": Te(L.open),
|
|
182
182
|
role: "dialog",
|
|
183
|
-
id:
|
|
183
|
+
id: L.contentId,
|
|
184
184
|
...i,
|
|
185
|
-
...
|
|
185
|
+
...T,
|
|
186
186
|
ref: p,
|
|
187
187
|
style: {
|
|
188
|
-
...
|
|
188
|
+
...T.style,
|
|
189
189
|
"--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
190
190
|
"--radix-popover-content-available-width": "var(--radix-popper-available-width)",
|
|
191
191
|
"--radix-popover-content-available-height": "var(--radix-popper-available-height)",
|
|
@@ -199,294 +199,328 @@ var vo = to("PopoverContent.RemoveScroll"), ho = m.forwardRef(
|
|
|
199
199
|
}
|
|
200
200
|
);
|
|
201
201
|
}
|
|
202
|
-
),
|
|
202
|
+
), Fe = "PopoverClose", xo = m.forwardRef(
|
|
203
203
|
(n, p) => {
|
|
204
|
-
const { __scopePopover:
|
|
204
|
+
const { __scopePopover: a, ...l } = n, c = G(Fe, a);
|
|
205
205
|
return /* @__PURE__ */ t(
|
|
206
|
-
|
|
206
|
+
Ie.button,
|
|
207
207
|
{
|
|
208
208
|
type: "button",
|
|
209
|
-
...
|
|
209
|
+
...l,
|
|
210
210
|
ref: p,
|
|
211
|
-
onClick:
|
|
211
|
+
onClick: X(n.onClick, () => c.onOpenChange(!1))
|
|
212
212
|
}
|
|
213
213
|
);
|
|
214
214
|
}
|
|
215
215
|
);
|
|
216
|
-
|
|
217
|
-
var
|
|
216
|
+
xo.displayName = Fe;
|
|
217
|
+
var ko = "PopoverArrow", Eo = m.forwardRef(
|
|
218
218
|
(n, p) => {
|
|
219
|
-
const { __scopePopover:
|
|
220
|
-
return /* @__PURE__ */ t(
|
|
219
|
+
const { __scopePopover: a, ...l } = n, c = Y(a);
|
|
220
|
+
return /* @__PURE__ */ t(bo, { ...c, ...l, ref: p });
|
|
221
221
|
}
|
|
222
222
|
);
|
|
223
|
-
|
|
224
|
-
function
|
|
223
|
+
Eo.displayName = ko;
|
|
224
|
+
function Te(n) {
|
|
225
225
|
return n ? "open" : "closed";
|
|
226
226
|
}
|
|
227
|
-
var
|
|
228
|
-
const
|
|
229
|
-
dropdownContainer:
|
|
230
|
-
dropdownLabel:
|
|
231
|
-
|
|
227
|
+
var Mo = Re, So = Le, Fo = ke, To = Ee, Vo = Me;
|
|
228
|
+
const Bo = "Dropdown-module__dropdownContainer___beNhQ", Wo = "Dropdown-module__dropdownLabel___T9FmB", Go = "Dropdown-module__dropdownLabelDisabled___SLRmM", zo = "Dropdown-module__required___ChI1m", qo = "Dropdown-module__dropdownWrapper___AUuWD", Jo = "Dropdown-module__dropdownTrigger___Rue93", $o = "Dropdown-module__dropdownTriggerDisabled___63wkd", jo = "Dropdown-module__dropdownTriggerOpen___cbm8V", Uo = "Dropdown-module__dropdownTriggerError___Uu02x", Ko = "Dropdown-module__dropdownContent___zLMhL", Xo = "Dropdown-module__dropdownSelectedItems___iXnpQ", Yo = "Dropdown-module__selectedItemsCreatable___SCjLK", Zo = "Dropdown-module__selectedItem___2jO4z", Ho = "Dropdown-module__selectedItemLabel___efVI-", Qo = "Dropdown-module__removeButton___9r85B", et = "Dropdown-module__removeIcon___st3b-", ot = "Dropdown-module__singleSelectedCreatableItem___BKFLb", tt = "Dropdown-module__singleSelectedCreatableItemRemoveButton___w3XXp", rt = "Dropdown-module__selectedOptionLabel___7Zdh3", nt = "Dropdown-module__placeholder___fWdch", dt = "Dropdown-module__dropdownActions___d55Fa", st = "Dropdown-module__dropdownArrow___dLbrb", lt = "Dropdown-module__dropdownArrowOpen___Z4Nh1", at = "Dropdown-module__dropdownMenu___toYcy", ct = "Dropdown-module__dropdownMenuToolbar___gFne0", it = "Dropdown-module__searchContainer___4kUvD", pt = "Dropdown-module__search___JmgDx", ut = "Dropdown-module__dropdownCreatableSearchContainer___sbs0F", _t = "Dropdown-module__disabled___0FjAX", mt = "Dropdown-module__dropdownCreatableError___gwBGw", ft = "Dropdown-module__creatableInput___meKz6", wt = "Dropdown-module__optionsList___rk2hi", vt = "Dropdown-module__categoryGroup___Np2bP", ht = "Dropdown-module__categoryDivider___Gh6F0", bt = "Dropdown-module__categoryLabel___B9IDR", Dt = "Dropdown-module__optionItem___7pi10", gt = "Dropdown-module__optionItemDisabled___aepUD", Ct = "Dropdown-module__optionItemFocused___u2781", It = "Dropdown-module__optionContent___nf1VC", Nt = "Dropdown-module__optionLabel___sJerM", Pt = "Dropdown-module__tickIcon___hYdCr", Ot = "Dropdown-module__noOptions___8vmhM", At = "Dropdown-module__helpers___s4ulA", Rt = "Dropdown-module__helpText___YooJE", yt = "Dropdown-module__helpTextDisabled___Ct4qq", Lt = "Dropdown-module__helpLink___-Zwpq", xt = "Dropdown-module__helpLinkDisabled___r-opC", kt = "Dropdown-module__errorMessage___3Mopi", Et = "Dropdown-module__selectAllContainer___Dlk3J", Mt = "Dropdown-module__actionButtons___-2nvr", o = {
|
|
229
|
+
dropdownContainer: Bo,
|
|
230
|
+
dropdownLabel: Wo,
|
|
231
|
+
"label-text": "Dropdown-module__label-text___VEqG-",
|
|
232
|
+
dropdownLabelDisabled: Go,
|
|
232
233
|
"label-tooltip-icon": "Dropdown-module__label-tooltip-icon___JYVOm",
|
|
233
|
-
required:
|
|
234
|
-
dropdownWrapper:
|
|
234
|
+
required: zo,
|
|
235
|
+
dropdownWrapper: qo,
|
|
235
236
|
"dropdown-menu-trigger": "Dropdown-module__dropdown-menu-trigger___fgqVT",
|
|
236
|
-
dropdownTrigger:
|
|
237
|
-
dropdownTriggerDisabled:
|
|
238
|
-
dropdownTriggerOpen:
|
|
239
|
-
dropdownTriggerError:
|
|
240
|
-
dropdownContent:
|
|
241
|
-
dropdownSelectedItems:
|
|
242
|
-
selectedItemsCreatable:
|
|
243
|
-
selectedItem:
|
|
244
|
-
selectedItemLabel:
|
|
245
|
-
removeButton:
|
|
246
|
-
removeIcon:
|
|
247
|
-
singleSelectedCreatableItem:
|
|
248
|
-
singleSelectedCreatableItemRemoveButton:
|
|
249
|
-
selectedOptionLabel:
|
|
250
|
-
placeholder:
|
|
251
|
-
dropdownActions:
|
|
252
|
-
dropdownArrow:
|
|
253
|
-
dropdownArrowOpen:
|
|
254
|
-
dropdownMenu:
|
|
255
|
-
dropdownMenuRight: Ho,
|
|
237
|
+
dropdownTrigger: Jo,
|
|
238
|
+
dropdownTriggerDisabled: $o,
|
|
239
|
+
dropdownTriggerOpen: jo,
|
|
240
|
+
dropdownTriggerError: Uo,
|
|
241
|
+
dropdownContent: Ko,
|
|
242
|
+
dropdownSelectedItems: Xo,
|
|
243
|
+
selectedItemsCreatable: Yo,
|
|
244
|
+
selectedItem: Zo,
|
|
245
|
+
selectedItemLabel: Ho,
|
|
246
|
+
removeButton: Qo,
|
|
247
|
+
removeIcon: et,
|
|
248
|
+
singleSelectedCreatableItem: ot,
|
|
249
|
+
singleSelectedCreatableItemRemoveButton: tt,
|
|
250
|
+
selectedOptionLabel: rt,
|
|
251
|
+
placeholder: nt,
|
|
252
|
+
dropdownActions: dt,
|
|
253
|
+
dropdownArrow: st,
|
|
254
|
+
dropdownArrowOpen: lt,
|
|
255
|
+
dropdownMenu: at,
|
|
256
256
|
"dropdown-container-grouped": "Dropdown-module__dropdown-container-grouped___1twhU",
|
|
257
257
|
"dropdown-container-multi-select": "Dropdown-module__dropdown-container-multi-select___zdaum",
|
|
258
|
-
dropdownMenuToolbar:
|
|
259
|
-
searchContainer:
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
258
|
+
dropdownMenuToolbar: ct,
|
|
259
|
+
searchContainer: it,
|
|
260
|
+
search: pt,
|
|
261
|
+
dropdownCreatableSearchContainer: ut,
|
|
262
|
+
disabled: _t,
|
|
263
|
+
dropdownCreatableError: mt,
|
|
264
|
+
creatableInput: ft,
|
|
265
|
+
optionsList: wt,
|
|
266
|
+
categoryGroup: vt,
|
|
267
|
+
categoryDivider: ht,
|
|
268
|
+
categoryLabel: bt,
|
|
269
|
+
optionItem: Dt,
|
|
270
|
+
optionItemDisabled: gt,
|
|
271
|
+
optionItemFocused: Ct,
|
|
272
|
+
optionContent: It,
|
|
273
|
+
optionLabel: Nt,
|
|
274
|
+
tickIcon: Pt,
|
|
275
|
+
noOptions: Ot,
|
|
276
|
+
helpers: At,
|
|
277
|
+
helpText: Rt,
|
|
278
|
+
helpTextDisabled: yt,
|
|
279
|
+
helpLink: Lt,
|
|
280
|
+
helpLinkDisabled: xt,
|
|
281
|
+
errorMessage: kt,
|
|
282
|
+
selectAllContainer: Et,
|
|
283
|
+
actionButtons: Mt
|
|
283
284
|
};
|
|
284
|
-
function
|
|
285
|
+
function Yt({
|
|
285
286
|
className: n,
|
|
286
287
|
label: p,
|
|
287
|
-
options:
|
|
288
|
-
value:
|
|
289
|
-
placeholder:
|
|
290
|
-
disabled:
|
|
288
|
+
options: a,
|
|
289
|
+
value: l = [],
|
|
290
|
+
placeholder: c = "Select options...",
|
|
291
|
+
disabled: s = !1,
|
|
291
292
|
required: _ = !1,
|
|
292
293
|
searchable: u = !1,
|
|
293
|
-
searchPlaceholder:
|
|
294
|
-
errorMessage:
|
|
295
|
-
helpText:
|
|
296
|
-
helpLink:
|
|
297
|
-
helpLinkText:
|
|
294
|
+
searchPlaceholder: y = "Search options...",
|
|
295
|
+
errorMessage: D,
|
|
296
|
+
helpText: E,
|
|
297
|
+
helpLink: T,
|
|
298
|
+
helpLinkText: L,
|
|
298
299
|
onChange: i,
|
|
299
300
|
onSearch: M,
|
|
300
|
-
multiSelect:
|
|
301
|
-
grouped:
|
|
302
|
-
align:
|
|
303
|
-
onToggleChange:
|
|
304
|
-
toggleLabel:
|
|
305
|
-
isCreatable:
|
|
306
|
-
dropdownTriggerClassName:
|
|
307
|
-
dropdownMenuClassName:
|
|
308
|
-
hideSelectedItems:
|
|
309
|
-
labelTooltip:
|
|
310
|
-
isTagsFields:
|
|
311
|
-
|
|
301
|
+
multiSelect: g = !1,
|
|
302
|
+
grouped: Ve = !1,
|
|
303
|
+
align: pe = "left",
|
|
304
|
+
onToggleChange: Z,
|
|
305
|
+
toggleLabel: Be,
|
|
306
|
+
isCreatable: C = !1,
|
|
307
|
+
dropdownTriggerClassName: We,
|
|
308
|
+
dropdownMenuClassName: Ge,
|
|
309
|
+
hideSelectedItems: ze = !1,
|
|
310
|
+
labelTooltip: z,
|
|
311
|
+
isTagsFields: I = !1,
|
|
312
|
+
unselect: H = !1,
|
|
313
|
+
selectedOptionLabel: qe = "option selected",
|
|
314
|
+
selectedOptionsLabel: Je = "options selected",
|
|
315
|
+
allOptionsSelectedLabel: Q,
|
|
316
|
+
caseSensitive: re = !1,
|
|
317
|
+
...$e
|
|
312
318
|
}) {
|
|
313
|
-
const [
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}, [
|
|
319
|
+
const [f, S] = W(l), [h, O] = W(!1), [ne, N] = W(""), [$, w] = W(-1), [F, x] = W([]), ue = U(null), _e = U(null), ee = U(null), j = U(null), [me, je] = W(0), [Ue, Ke] = W(0), [Xe, Ye] = W(l.length > 0 ? l.join(", ") : c ?? ""), fe = U(l);
|
|
320
|
+
q(() => {
|
|
321
|
+
JSON.stringify(fe.current) !== JSON.stringify(l) && (S(l), fe.current = l);
|
|
322
|
+
}, [l]), q(() => {
|
|
317
323
|
var d;
|
|
318
|
-
const e = (d =
|
|
319
|
-
e &&
|
|
320
|
-
}, []),
|
|
324
|
+
const e = (d = _e.current) == null ? void 0 : d.getBoundingClientRect().width;
|
|
325
|
+
e && je(e);
|
|
326
|
+
}, []), q(() => {
|
|
321
327
|
var d;
|
|
322
|
-
const e = (d =
|
|
323
|
-
e &&
|
|
324
|
-
}, []),
|
|
325
|
-
|
|
326
|
-
}, [
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
},
|
|
328
|
+
const e = (d = ee.current) == null ? void 0 : d.getBoundingClientRect().width;
|
|
329
|
+
e && Ke(e);
|
|
330
|
+
}, []), q(() => {
|
|
331
|
+
h && x([...f]);
|
|
332
|
+
}, [h, f]);
|
|
333
|
+
const k = ne.trim(), P = a.filter((e) => {
|
|
334
|
+
const d = re ? e.label : e.label.toLowerCase(), r = re ? k : k.toLowerCase();
|
|
335
|
+
return d.includes(r);
|
|
336
|
+
});
|
|
337
|
+
q(() => {
|
|
338
|
+
Ye(l.length > 0 ? l.join(", ") : c ?? "");
|
|
339
|
+
}, [l, c]), q(() => {
|
|
340
|
+
h && (u || C || I) && j.current && j.current.focus();
|
|
341
|
+
}, [h, u, C, I]);
|
|
342
|
+
const Ze = (e) => {
|
|
343
|
+
O(e), e ? (x([...f]), N(""), w(-1)) : (N(""), w(-1), x([]));
|
|
344
|
+
}, de = ae((e) => {
|
|
336
345
|
if (e.disabled) return;
|
|
337
346
|
let d = [];
|
|
338
|
-
if (
|
|
339
|
-
d =
|
|
347
|
+
if (g)
|
|
348
|
+
d = F.includes(e.value) ? F.filter((r) => r !== e.value) : [...F, e.value];
|
|
340
349
|
else {
|
|
341
|
-
|
|
350
|
+
if (f.includes(e.value))
|
|
351
|
+
if (H)
|
|
352
|
+
d = [];
|
|
353
|
+
else
|
|
354
|
+
return;
|
|
355
|
+
else
|
|
356
|
+
d = [e.value];
|
|
357
|
+
S(d), i == null || i(d), O(!1), N(""), w(-1), x([]);
|
|
342
358
|
return;
|
|
343
359
|
}
|
|
344
|
-
|
|
345
|
-
}, [
|
|
346
|
-
F
|
|
347
|
-
},
|
|
348
|
-
|
|
349
|
-
},
|
|
350
|
-
N(e),
|
|
351
|
-
},
|
|
360
|
+
x(d);
|
|
361
|
+
}, [g, i, F, f, H]), He = () => {
|
|
362
|
+
S(F), i == null || i(F), O(!1), N(""), w(-1), x([]);
|
|
363
|
+
}, Qe = () => {
|
|
364
|
+
O(!1), N(""), w(-1), x([]);
|
|
365
|
+
}, eo = (e) => {
|
|
366
|
+
N(e), w(-1), M == null || M(e);
|
|
367
|
+
}, oo = ae((e) => {
|
|
368
|
+
var r;
|
|
352
369
|
const d = {
|
|
353
370
|
value: e,
|
|
354
371
|
label: e,
|
|
355
372
|
disabled: !1
|
|
356
373
|
};
|
|
357
|
-
if (
|
|
358
|
-
const
|
|
359
|
-
|
|
374
|
+
if (a.push(d), g) {
|
|
375
|
+
const B = f.includes(e) ? f : [...f, e];
|
|
376
|
+
S(B), i == null || i(B), N(""), O(!0), w(-1);
|
|
360
377
|
} else {
|
|
361
|
-
const
|
|
362
|
-
|
|
378
|
+
const V = [e];
|
|
379
|
+
S(V), i == null || i(V), N(""), O(!1), w(-1);
|
|
363
380
|
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
381
|
+
(r = ee.current) == null || r.focus();
|
|
382
|
+
}, [g, i, a, f]), se = ae((e) => {
|
|
383
|
+
var d;
|
|
384
|
+
if (!e.disabled) {
|
|
385
|
+
if (g) {
|
|
386
|
+
const V = f.includes(e.value) ? f.filter((B) => B !== e.value) : [...f, e.value];
|
|
387
|
+
S(V), i == null || i(V), O(!0), N(""), w(-1);
|
|
388
|
+
} else if (f.includes(e.value)) {
|
|
389
|
+
if (H) {
|
|
390
|
+
const r = [];
|
|
391
|
+
S(r), i == null || i(r), O(!1), N(""), w(-1);
|
|
392
|
+
}
|
|
369
393
|
} else {
|
|
370
|
-
const
|
|
371
|
-
|
|
394
|
+
const r = [e.value];
|
|
395
|
+
S(r), i == null || i(r), O(!1), N(""), w(-1);
|
|
372
396
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
},
|
|
376
|
-
|
|
377
|
-
},
|
|
378
|
-
|
|
379
|
-
},
|
|
380
|
-
|
|
381
|
-
|
|
397
|
+
(d = ee.current) == null || d.focus();
|
|
398
|
+
}
|
|
399
|
+
}, [g, i, f, H]), to = (e) => {
|
|
400
|
+
O(!0), N(e), w(-1), M == null || M(e);
|
|
401
|
+
}, we = (e) => {
|
|
402
|
+
O(!0), N(e), w(-1), M == null || M(e);
|
|
403
|
+
}, ro = (e) => {
|
|
404
|
+
Z == null || Z(e);
|
|
405
|
+
}, ve = (e) => {
|
|
406
|
+
const d = f.filter((r) => r !== e);
|
|
407
|
+
S(d), i == null || i(d);
|
|
382
408
|
};
|
|
383
|
-
|
|
409
|
+
q(() => {
|
|
384
410
|
const e = (d) => {
|
|
385
|
-
if (
|
|
411
|
+
if (h)
|
|
386
412
|
switch (d.key) {
|
|
387
413
|
case "ArrowDown":
|
|
388
|
-
d.preventDefault(),
|
|
414
|
+
d.preventDefault(), w((r) => r < P.length - 1 ? r + 1 : 0);
|
|
389
415
|
break;
|
|
390
416
|
case "ArrowUp":
|
|
391
|
-
d.preventDefault(),
|
|
417
|
+
d.preventDefault(), w((r) => r > 0 ? r - 1 : P.length - 1);
|
|
392
418
|
break;
|
|
393
419
|
case "Enter":
|
|
394
|
-
if (d.preventDefault(),
|
|
395
|
-
const
|
|
396
|
-
|
|
420
|
+
if (d.preventDefault(), $ >= 0 && $ < P.length) {
|
|
421
|
+
const r = P[$];
|
|
422
|
+
C || I ? se(r) : de(r);
|
|
397
423
|
}
|
|
398
424
|
break;
|
|
399
425
|
case "Escape":
|
|
400
|
-
d.preventDefault(),
|
|
426
|
+
d.preventDefault(), O(!1), N(""), w(-1), x([]);
|
|
401
427
|
break;
|
|
402
428
|
}
|
|
403
429
|
};
|
|
404
430
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
405
|
-
}, [
|
|
406
|
-
const
|
|
407
|
-
const
|
|
408
|
-
return e[
|
|
409
|
-
}, {}),
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
431
|
+
}, [h, $, P, C, I, se, de]);
|
|
432
|
+
const oe = C || I ? f : h ? F : f, b = a.filter((e) => oe.includes(e.value)), he = !!D, no = JSON.stringify(F) !== JSON.stringify(f), be = a.filter((e) => !e.disabled), De = be.length > 0 && be.every((e) => oe.includes(e.value)), so = P.reduce((e, d) => {
|
|
433
|
+
const r = d.category || "default";
|
|
434
|
+
return e[r] || (e[r] = []), e[r].push(d), e;
|
|
435
|
+
}, {}), lo = P, {
|
|
436
|
+
onBlur: A,
|
|
437
|
+
...le
|
|
438
|
+
} = $e;
|
|
439
|
+
return /* @__PURE__ */ v("div", { ref: ue, className: R(o.dropdownContainer, Ve && o["dropdown-container-grouped"], g && o["dropdown-container-multi-select"], n), ...le, children: [
|
|
440
|
+
p && /* @__PURE__ */ v("label", { className: R(o.dropdownLabel, s && o.dropdownLabelDisabled), children: [
|
|
441
|
+
/* @__PURE__ */ t("span", { title: p, className: o["label-text"], children: p }),
|
|
413
442
|
_ && /* @__PURE__ */ t("span", { className: o.required, children: "*" }),
|
|
414
|
-
|
|
443
|
+
z && /* @__PURE__ */ t(po, { content: z.content, size: z.size, theme: z.theme, tipSide: z.tipSide, tipAlignment: z.tipAlignment, startVisible: z.startVisible, children: /* @__PURE__ */ t(K, { icon: "ap-icon-info", className: o["label-tooltip-icon"] }) })
|
|
415
444
|
] }),
|
|
416
|
-
/* @__PURE__ */ t(
|
|
417
|
-
!
|
|
418
|
-
|
|
445
|
+
/* @__PURE__ */ t(Mo, { open: h, onOpenChange: Ze, children: /* @__PURE__ */ v("div", { className: o.dropdownWrapper, children: [
|
|
446
|
+
!C && !I && /* @__PURE__ */ t(Fo, { disabled: s, className: R(o["dropdown-menu-trigger"], o.dropdownTrigger, We, h && o.dropdownTriggerOpen, s && o.dropdownTriggerDisabled, he && o.dropdownTriggerError), ref: _e, onBlur: (e) => {
|
|
447
|
+
h || A == null || A(e);
|
|
448
|
+
}, ...le, children: /* @__PURE__ */ v("div", { className: o.dropdownContent, children: [
|
|
449
|
+
!ze && /* @__PURE__ */ t("div", { className: o.dropdownSelectedItems, children: b.length > 0 ? g ? De && Q ? Q : b.length === 1 ? ` ${b.length} ${qe}` : ` ${b.length} ${Je}` : (
|
|
419
450
|
// For single select, show the selected option label
|
|
420
|
-
/* @__PURE__ */ t("span", { className: o.selectedOptionLabel, children:
|
|
421
|
-
) : /* @__PURE__ */ t("span", { title:
|
|
422
|
-
/* @__PURE__ */ t("div", { className: o.dropdownActions, children: /* @__PURE__ */ t(
|
|
451
|
+
/* @__PURE__ */ t("span", { className: o.selectedOptionLabel, children: b[0].label })
|
|
452
|
+
) : /* @__PURE__ */ t("span", { title: Xe, className: o.placeholder, children: c }) }),
|
|
453
|
+
/* @__PURE__ */ t("div", { className: o.dropdownActions, children: /* @__PURE__ */ t(K, { icon: "ap-icon-expand-more", className: R(o.dropdownArrow, h && o.dropdownArrowOpen) }) })
|
|
423
454
|
] }) }),
|
|
424
|
-
(
|
|
455
|
+
(C || I) && /* @__PURE__ */ t(So, { children: /* @__PURE__ */ v("div", { tabIndex: 0, ref: ee, className: R(o.dropdownCreatableSearchContainer, s && o.disabled, he && o.dropdownCreatableError), onBlur: (e) => {
|
|
456
|
+
h || A == null || A(e);
|
|
457
|
+
}, onClick: () => {
|
|
425
458
|
var e;
|
|
426
|
-
if (!
|
|
427
|
-
return
|
|
428
|
-
(e =
|
|
429
|
-
},
|
|
430
|
-
|
|
431
|
-
I.length,
|
|
432
|
-
" options selected"
|
|
433
|
-
] }) }) : I.map((e) => /* @__PURE__ */ f("div", { className: o.selectedItem, children: [
|
|
459
|
+
if (!g && b.length > 0)
|
|
460
|
+
return we("");
|
|
461
|
+
(e = j.current) == null || e.focus();
|
|
462
|
+
}, ...le, children: [
|
|
463
|
+
b.length > 0 && /* @__PURE__ */ t("div", { className: R(o.selectedItemsCreatable), children: g ? b.length > 3 ? /* @__PURE__ */ t("div", { className: o.selectedItem, children: /* @__PURE__ */ t("span", { className: o.selectedItemLabel, children: De && Q ? Q : `${b.length} options selected` }) }) : b.map((e) => /* @__PURE__ */ v("div", { className: o.selectedItem, children: [
|
|
434
464
|
/* @__PURE__ */ t("span", { className: o.selectedItemLabel, children: e.label }),
|
|
435
|
-
/* @__PURE__ */ t("button", { type: "button", className: o.removeButton, onClick: () =>
|
|
436
|
-
] }, e.value)) :
|
|
437
|
-
/* @__PURE__ */ t("span", { className: o.selectedItemLabel, children:
|
|
438
|
-
/* @__PURE__ */ t(
|
|
465
|
+
/* @__PURE__ */ t("button", { type: "button", className: o.removeButton, onClick: () => ve(e.value), disabled: s, children: /* @__PURE__ */ t(K, { icon: "ap-icon-close", className: o.removeIcon }) })
|
|
466
|
+
] }, e.value)) : b.length > 0 && /* @__PURE__ */ v("div", { className: o.singleSelectedCreatableItem, children: [
|
|
467
|
+
/* @__PURE__ */ t("span", { className: o.selectedItemLabel, children: b[0].label }),
|
|
468
|
+
/* @__PURE__ */ t(ce, { type: "tertiary", variant: "default", size: "sm", onClick: () => ve(b[0].value), disabled: s, icon: "ap-icon-add-filled", className: o.singleSelectedCreatableItemRemoveButton })
|
|
439
469
|
] }) }),
|
|
440
|
-
(
|
|
441
|
-
|
|
470
|
+
(g || !b.length) && /* @__PURE__ */ t("input", { ref: j, placeholder: b.length > 0 ? "" : y, value: ne, onChange: (e) => to(e.target.value), onFocus: (e) => we(e.target.value), onBlur: (e) => {
|
|
471
|
+
h || A == null || A(e);
|
|
472
|
+
}, disabled: s, className: o.creatableInput }),
|
|
473
|
+
/* @__PURE__ */ t("div", { className: o.dropdownActions, children: /* @__PURE__ */ t(K, { icon: "ap-icon-expand-more", className: R(o.dropdownArrow, h && o.dropdownArrowOpen) }) })
|
|
442
474
|
] }) }),
|
|
443
|
-
/* @__PURE__ */ t(
|
|
444
|
-
minWidth:
|
|
475
|
+
/* @__PURE__ */ t(To, { children: /* @__PURE__ */ t(Vo, { align: pe === "right" ? "end" : "start", side: "bottom", avoidCollisions: !0, sideOffset: 6, collisionPadding: 8, style: {
|
|
476
|
+
minWidth: me,
|
|
477
|
+
zIndex: 9999
|
|
445
478
|
}, onInteractOutside: (e) => {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
479
|
+
var r;
|
|
480
|
+
e.target === j.current && e.preventDefault(), ((r = ue.current) == null ? void 0 : r.contains(e.target)) || A == null || A(e);
|
|
481
|
+
}, children: h && /* @__PURE__ */ v("div", { style: {
|
|
482
|
+
minWidth: C || I ? Ue : me
|
|
483
|
+
}, className: R(o.dropdownMenu, Ge, pe === "right" && o.dropdownMenuRight), children: [
|
|
484
|
+
!C && !I && (u || g) && /* @__PURE__ */ v("div", { className: o.dropdownMenuToolbar, children: [
|
|
485
|
+
u && /* @__PURE__ */ v("div", { className: o.searchContainer, children: [
|
|
486
|
+
/* @__PURE__ */ t(io, { placeholder: y, value: ne, onChange: eo, className: o.search }),
|
|
487
|
+
Z && /* @__PURE__ */ t(co, { label: Be, onChange: ro })
|
|
454
488
|
] }),
|
|
455
|
-
|
|
456
|
-
/* @__PURE__ */ t(
|
|
457
|
-
const e =
|
|
458
|
-
|
|
459
|
-
}, disabled:
|
|
460
|
-
/* @__PURE__ */ t(
|
|
489
|
+
g && !C && !I && /* @__PURE__ */ v("div", { className: o.selectAllContainer, children: [
|
|
490
|
+
/* @__PURE__ */ t(ge, { variant: "default", noIcon: !0, onClick: () => {
|
|
491
|
+
const e = P.filter((d) => !d.disabled).map((d) => d.value);
|
|
492
|
+
x(e);
|
|
493
|
+
}, disabled: P.filter((e) => !e.disabled).length === 0, children: "Select all" }),
|
|
494
|
+
/* @__PURE__ */ t(ge, { variant: "default", noIcon: !0, onClick: () => x([]), disabled: F.length === 0, children: "Deselect all" })
|
|
461
495
|
] })
|
|
462
496
|
] }),
|
|
463
|
-
/* @__PURE__ */
|
|
464
|
-
|
|
497
|
+
/* @__PURE__ */ v("div", { className: o.optionsList, "data-dropdown-options-list": !0, children: [
|
|
498
|
+
P.length > 0 ? Object.entries(so).map(([e, d]) => /* @__PURE__ */ v("div", { className: o.categoryGroup, children: [
|
|
465
499
|
e !== "default" && /* @__PURE__ */ t("div", { className: o.categoryDivider, children: /* @__PURE__ */ t("span", { className: o.categoryLabel, children: e }) }),
|
|
466
|
-
d.map((
|
|
467
|
-
const
|
|
468
|
-
return /* @__PURE__ */ t("button", { title: (
|
|
469
|
-
/* @__PURE__ */ t("span", { className: o.optionLabel, children:
|
|
470
|
-
|
|
471
|
-
] }) },
|
|
500
|
+
d.map((r) => {
|
|
501
|
+
const V = lo.indexOf(r), B = P.find((ao) => ao.value === r.value);
|
|
502
|
+
return /* @__PURE__ */ t("button", { title: (B == null ? void 0 : B.label) || r.label, type: "button", className: R(o.optionItem, oe.includes(r.value) && o.optionItemSelected, r.disabled && o.optionItemDisabled, V === $ && o.optionItemFocused), onClick: () => C || I ? se(r) : de(r), disabled: r.disabled, "data-dropdown-option-item": !0, children: /* @__PURE__ */ v("div", { className: o.optionContent, children: [
|
|
503
|
+
/* @__PURE__ */ t("span", { className: o.optionLabel, children: r.label }),
|
|
504
|
+
oe.includes(r.value) && /* @__PURE__ */ t(K, { icon: "ap-icon-check", className: o.tickIcon })
|
|
505
|
+
] }) }, r.value);
|
|
472
506
|
})
|
|
473
507
|
] }, e)) : null,
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
508
|
+
C && k !== "" && !a.find((e) => re ? e.label === k : e.label.toLowerCase() === k.toLowerCase()) && /* @__PURE__ */ t("button", { type: "button", className: R(o.optionItem, o.optionItemCreatable), title: k ? `Create "${k}"` : "Create new option", onClick: () => oo(k), children: /* @__PURE__ */ t("div", { className: o.optionContent, children: /* @__PURE__ */ t("span", { className: o.optionLabel, children: k ? `Create "${k}"` : "Create new option" }) }) }),
|
|
509
|
+
P.length === 0 && !C && !I && /* @__PURE__ */ t("div", { className: o.noOptions, children: "No options found" }),
|
|
510
|
+
P.length === 0 && I && /* @__PURE__ */ t("div", { className: o.noOptions, children: "No options found" })
|
|
477
511
|
] }),
|
|
478
|
-
|
|
479
|
-
/* @__PURE__ */ t(
|
|
480
|
-
/* @__PURE__ */ t(
|
|
512
|
+
g && !C && !I && /* @__PURE__ */ v("div", { className: o.actionButtons, children: [
|
|
513
|
+
/* @__PURE__ */ t(ce, { type: "primary", variant: "cancel", size: "md", onClick: Qe, children: "Cancel" }),
|
|
514
|
+
/* @__PURE__ */ t(ce, { type: "primary", variant: "default", size: "md", onClick: He, disabled: !no, children: "Apply" })
|
|
481
515
|
] })
|
|
482
516
|
] }) }) })
|
|
483
517
|
] }) }),
|
|
484
|
-
(
|
|
485
|
-
|
|
486
|
-
|
|
518
|
+
(D || E || T && L) && /* @__PURE__ */ v("div", { className: o.helpers, children: [
|
|
519
|
+
D ? /* @__PURE__ */ t("span", { title: D, className: o.errorMessage, children: D }) : E && /* @__PURE__ */ t("span", { title: E, className: R(o.helpText, s && o.helpTextDisabled), children: E }),
|
|
520
|
+
T && L && /* @__PURE__ */ t("a", { href: T, className: R(o.helpLink, s && o.helpLinkDisabled), target: "_blank", rel: "noopener noreferrer", children: L })
|
|
487
521
|
] })
|
|
488
522
|
] });
|
|
489
523
|
}
|
|
490
524
|
export {
|
|
491
|
-
|
|
525
|
+
Yt as default
|
|
492
526
|
};
|