clayui-multi-select 3.165.0

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.
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var index_exports = {};
20
+ __export(index_exports, {
21
+ default: () => index_default,
22
+ itemLabelFilter: () => import_MultiSelect.itemLabelFilter
23
+ });
24
+ module.exports = __toCommonJS(index_exports);
25
+ var import_autocomplete = require("@clayui/autocomplete");
26
+ var import_MultiSelect = require("./MultiSelect");
27
+ var index_default = Object.assign(import_MultiSelect.MultiSelect, { Item: import_autocomplete.Item });
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var types_exports = {};
16
+ module.exports = __toCommonJS(types_exports);
@@ -0,0 +1,324 @@
1
+ import { ClayInput } from "@clayui/form";
2
+ import Icon from "@clayui/icon";
3
+ import Label from "@clayui/label";
4
+ import {
5
+ Keys,
6
+ getLocatorValue,
7
+ sub,
8
+ useId
9
+ } from "@clayui/shared";
10
+ import React, { useCallback, useEffect, useRef, useState } from "react";
11
+ const DELIMITER_KEYS = ["Enter", ","];
12
+ const KeysNavigation = [Keys.Left, Keys.Right, Keys.Up, Keys.Down];
13
+ const KeysSides = [Keys.Left, Keys.Right];
14
+ let counterUid = 0;
15
+ const Labels = React.forwardRef(
16
+ function Labels2({
17
+ allowDuplicateValues = true,
18
+ allowsCustomLabel,
19
+ "aria-activedescendant": activeDescendant,
20
+ ariaDescriptionId,
21
+ closeButtonAriaLabel,
22
+ disabled,
23
+ inputName,
24
+ "insetAfter": _,
25
+ labels,
26
+ lastChangesRef,
27
+ locator,
28
+ onChange,
29
+ onFocusChange,
30
+ onLabelsChange,
31
+ placeholder,
32
+ spritemap,
33
+ suggestionList,
34
+ value,
35
+ ...otherProps
36
+ }, ref) {
37
+ const inputRef = useRef(null);
38
+ const labelsRef = useRef(null);
39
+ const lastItemRef = useRef(null);
40
+ const [isLabelFocused, setIsLabelFocused] = useState(
41
+ null
42
+ );
43
+ const [lastFocusedItem, setLastFocusedItem] = useState(
44
+ null
45
+ );
46
+ const inputElementRef = ref || inputRef;
47
+ const labelId = useId();
48
+ const getSourceItemByLabel = (label) => {
49
+ return suggestionList.find(
50
+ (item) => getLocatorValue({
51
+ item,
52
+ locator: locator.label
53
+ }) === label
54
+ );
55
+ };
56
+ const getNewItem = (value2) => {
57
+ counterUid++;
58
+ const labelKey = typeof locator.label === "function" ? "label" : locator.label;
59
+ const valueKey = typeof locator.value === "function" ? "value" : locator.value;
60
+ return getSourceItemByLabel(value2) || {
61
+ key: `key_${counterUid}`,
62
+ [labelKey]: value2,
63
+ [valueKey]: value2
64
+ };
65
+ };
66
+ const onRemove = useCallback(
67
+ (label, index) => {
68
+ if (labelsRef.current) {
69
+ const focusableElements = Array.from(
70
+ labelsRef.current.querySelectorAll("button")
71
+ );
72
+ const activeElement = document.activeElement.tagName === "SPAN" ? document.activeElement.querySelector("button") : document.activeElement;
73
+ const position = focusableElements.indexOf(
74
+ activeElement
75
+ );
76
+ const closeElement = focusableElements[focusableElements.length - 1 > position ? position + 1 : position - 1];
77
+ if (closeElement) {
78
+ closeElement.focus();
79
+ setLastFocusedItem(closeElement.getAttribute("id"));
80
+ } else {
81
+ inputElementRef.current?.focus();
82
+ setLastFocusedItem(null);
83
+ }
84
+ }
85
+ lastChangesRef.current = {
86
+ action: "removed",
87
+ label
88
+ };
89
+ onLabelsChange(
90
+ labels.filter((_2, itemIndex) => itemIndex !== index)
91
+ );
92
+ },
93
+ [labels]
94
+ );
95
+ useEffect(() => {
96
+ if (labelsRef.current) {
97
+ const focusableElements = Array.from(
98
+ labelsRef.current.querySelectorAll(
99
+ ".label [aria-describedby]"
100
+ )
101
+ );
102
+ const addedLabel = focusableElements[focusableElements.length - 1];
103
+ if (addedLabel) {
104
+ setLastFocusedItem(addedLabel.getAttribute("id"));
105
+ }
106
+ }
107
+ }, [labels]);
108
+ return /* @__PURE__ */ React.createElement(ClayInput.GroupItem, null, /* @__PURE__ */ React.createElement(ClayInput.Group, null, /* @__PURE__ */ React.createElement(
109
+ ClayInput.GroupItem,
110
+ {
111
+ "aria-labelledby": otherProps["aria-labelledby"],
112
+ className: "d-contents",
113
+ onFocus: (event) => setLastFocusedItem(event.target.getAttribute("id")),
114
+ onKeyDown: (event) => {
115
+ if (KeysNavigation.includes(event.key)) {
116
+ event.preventDefault();
117
+ const focusableElements = Array.from(
118
+ event.currentTarget.querySelectorAll(
119
+ KeysSides.includes(event.key) ? "[role=gridcell][tabindex], button" : lastFocusedItem?.includes(
120
+ "span"
121
+ ) ? "[role=gridcell][tabindex]" : "button"
122
+ )
123
+ );
124
+ const position = focusableElements.indexOf(
125
+ document.activeElement
126
+ );
127
+ const key = KeysSides.includes(event.key) ? Keys.Left : Keys.Up;
128
+ const label = focusableElements[event.key === key ? position - 1 : position + 1];
129
+ if (label) {
130
+ setLastFocusedItem(
131
+ label.getAttribute("id")
132
+ );
133
+ label.focus();
134
+ }
135
+ }
136
+ if (event.key === Keys.Home || event.key === Keys.End) {
137
+ event.preventDefault();
138
+ const isLabel = lastFocusedItem.includes("span");
139
+ if (isLabel && event.key === Keys.Home || !isLabel && event.key === Keys.End) {
140
+ return;
141
+ }
142
+ const label = event.currentTarget.querySelector(
143
+ `[id=${lastFocusedItem?.replace(
144
+ isLabel ? "span" : "close",
145
+ event.key === Keys.Home ? "span" : "close"
146
+ )}]`
147
+ );
148
+ if (label) {
149
+ setLastFocusedItem(
150
+ label.getAttribute("id")
151
+ );
152
+ label.focus();
153
+ }
154
+ }
155
+ },
156
+ prepend: true,
157
+ ref: (ref2) => {
158
+ labelsRef.current = ref2;
159
+ },
160
+ role: "grid",
161
+ shrink: true
162
+ },
163
+ labels.map((item, i) => {
164
+ const value2 = getLocatorValue({
165
+ item,
166
+ locator: locator.value
167
+ });
168
+ const uid = getLocatorValue({
169
+ item,
170
+ locator: locator.id
171
+ }) ?? value2;
172
+ const id = `${labelId}-label-${uid}-span`;
173
+ const closeId = `${labelId}-label-${uid}-close`;
174
+ const label = getLocatorValue({
175
+ item,
176
+ locator: locator.label
177
+ });
178
+ return /* @__PURE__ */ React.createElement(React.Fragment, { key: id }, /* @__PURE__ */ React.createElement(
179
+ Label,
180
+ {
181
+ className: isLabelFocused === id ? "focus" : void 0,
182
+ onKeyDown: ({ key }) => {
183
+ if (key === Keys.Backspace) {
184
+ onRemove(label || "", i);
185
+ }
186
+ },
187
+ role: "row",
188
+ spritemap,
189
+ tabIndex: -1,
190
+ withClose: false
191
+ },
192
+ /* @__PURE__ */ React.createElement(
193
+ Label.ItemExpand,
194
+ {
195
+ "aria-describedby": ariaDescriptionId,
196
+ id,
197
+ onBlur: () => setIsLabelFocused(null),
198
+ onFocus: () => setIsLabelFocused(id),
199
+ role: "gridcell",
200
+ style: { outline: "none" },
201
+ tabIndex: lastFocusedItem === null && i === 0 || lastFocusedItem === id ? 0 : -1
202
+ },
203
+ label
204
+ ),
205
+ /* @__PURE__ */ React.createElement(Label.ItemAfter, { role: "gridcell" }, /* @__PURE__ */ React.createElement(
206
+ "button",
207
+ {
208
+ "aria-label": sub(
209
+ closeButtonAriaLabel,
210
+ [label || ""]
211
+ ),
212
+ className: "close",
213
+ disabled,
214
+ id: closeId,
215
+ onClick: () => onRemove(label || "", i),
216
+ ref: (ref2) => {
217
+ if (i === labels.length - 1) {
218
+ lastItemRef.current = ref2;
219
+ }
220
+ },
221
+ tabIndex: lastFocusedItem === closeId ? 0 : -1,
222
+ type: "button"
223
+ },
224
+ /* @__PURE__ */ React.createElement(
225
+ Icon,
226
+ {
227
+ spritemap,
228
+ symbol: "times-small"
229
+ }
230
+ )
231
+ ))
232
+ ), inputName && /* @__PURE__ */ React.createElement(
233
+ "input",
234
+ {
235
+ name: inputName,
236
+ type: "hidden",
237
+ value: value2
238
+ }
239
+ ));
240
+ })
241
+ ), /* @__PURE__ */ React.createElement(ClayInput.GroupItem, { prepend: true }, /* @__PURE__ */ React.createElement(
242
+ "input",
243
+ {
244
+ ...otherProps,
245
+ "aria-activedescendant": activeDescendant,
246
+ className: "form-control-inset",
247
+ disabled,
248
+ onBlur: (event) => {
249
+ if (otherProps.onBlur) {
250
+ otherProps.onBlur(event);
251
+ }
252
+ onFocusChange(false);
253
+ },
254
+ onChange: (event) => {
255
+ const { value: value2 } = event.target;
256
+ event.target.value = allowsCustomLabel ? value2.replace(",", "") : value2;
257
+ onChange(event);
258
+ },
259
+ onFocus: (event) => {
260
+ if (otherProps.onFocus) {
261
+ otherProps.onFocus(event);
262
+ }
263
+ onFocusChange(true);
264
+ },
265
+ onKeyDown: (event) => {
266
+ if (otherProps.onKeyDown) {
267
+ otherProps.onKeyDown(event);
268
+ }
269
+ const { key } = event;
270
+ if (key === Keys.Backspace && !value) {
271
+ event.preventDefault();
272
+ }
273
+ if (key === Keys.Enter && (activeDescendant || event.defaultPrevented)) {
274
+ return;
275
+ }
276
+ if (allowsCustomLabel && value.trim() && DELIMITER_KEYS.includes(key)) {
277
+ if (!allowDuplicateValues && value && labels.find(
278
+ (label) => label.label?.toLowerCase() === `${value}`.toLowerCase()
279
+ )) {
280
+ onChange({ target: { value: "" } });
281
+ return;
282
+ }
283
+ event.preventDefault();
284
+ lastChangesRef.current = {
285
+ action: "added",
286
+ label: value
287
+ };
288
+ onLabelsChange([
289
+ ...labels,
290
+ getNewItem(value)
291
+ ]);
292
+ onChange({ target: { value: "" } });
293
+ } else if (!value && key === Keys.Backspace && inputElementRef.current && lastItemRef.current) {
294
+ inputElementRef.current.blur();
295
+ lastItemRef.current.focus();
296
+ }
297
+ },
298
+ onPaste: (event) => {
299
+ if (otherProps.onPaste) {
300
+ otherProps.onPaste(event);
301
+ }
302
+ if (event.defaultPrevented) {
303
+ return;
304
+ }
305
+ const pastedText = event.clipboardData.getData("Text");
306
+ const pastedItems = pastedText.split(",").map(
307
+ (itemLabel) => getNewItem(itemLabel.trim())
308
+ ).filter(Boolean);
309
+ if (allowsCustomLabel && !!pastedItems.length) {
310
+ event.preventDefault();
311
+ onLabelsChange([...labels, ...pastedItems]);
312
+ }
313
+ },
314
+ placeholder: labels.length ? void 0 : placeholder,
315
+ ref: inputElementRef,
316
+ type: "text",
317
+ value
318
+ }
319
+ ))));
320
+ }
321
+ );
322
+ export {
323
+ Labels
324
+ };
@@ -0,0 +1,306 @@
1
+ import ACT, {
2
+ Autocomplete,
3
+ Item as AutocompleteItem
4
+ } from "@clayui/autocomplete";
5
+ import { ClayButtonWithIcon } from "@clayui/button";
6
+ import { KeyboardArrowsIndicator } from "@clayui/core";
7
+ import { ClayInput } from "@clayui/form";
8
+ import {
9
+ ClayPortal,
10
+ FocusScope,
11
+ getLocatorValue,
12
+ sub,
13
+ useControlledState,
14
+ useId
15
+ } from "@clayui/shared";
16
+ import classNames from "classnames";
17
+ import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
18
+ import { Labels } from "./Labels";
19
+ const MultiSelect = React.forwardRef(function MultiSelectInner({
20
+ active: externalActive,
21
+ allowsCustomLabel = true,
22
+ allowDuplicateValues = true,
23
+ alignmentByViewport,
24
+ children,
25
+ clearAllTitle = "Clear All",
26
+ closeButtonAriaLabel = "Remove {0}",
27
+ defaultActive = false,
28
+ defaultItems = [],
29
+ defaultValue = "",
30
+ disabled,
31
+ disabledClearAll,
32
+ displayKeyboardArrowsIndicator = false,
33
+ hotkeysDescription,
34
+ inputName,
35
+ inputValue,
36
+ isLoading: _i,
37
+ isValid = true,
38
+ items: externalItems,
39
+ liveRegion,
40
+ locator = {
41
+ id: "key",
42
+ label: "label",
43
+ value: "value"
44
+ },
45
+ loadingState,
46
+ menuRenderer: MenuRenderer,
47
+ messages = {
48
+ hotkeys: "Press backspace to delete the current row.",
49
+ labelAdded: "Label {0} added to the list",
50
+ labelRemoved: "Label {0} removed to the list",
51
+ listCount: "{0} option available.",
52
+ listCountPlural: "{0} options available.",
53
+ loading: "Loading...",
54
+ notFound: "No results found"
55
+ },
56
+ onActiveChange,
57
+ onChange,
58
+ onClearAllButtonClick,
59
+ onItemsChange,
60
+ onLoadMore,
61
+ placeholder,
62
+ size,
63
+ sourceItems = null,
64
+ spritemap,
65
+ icon,
66
+ value: externalValue,
67
+ ...otherProps
68
+ }, ref) {
69
+ const containerRef = useRef(null);
70
+ const inputRef = useRef(null);
71
+ const lastChangesRef = useRef(null);
72
+ const [isFocused, setIsFocused] = useState(false);
73
+ const [items, setItems] = useControlledState({
74
+ defaultName: "defaultItems",
75
+ defaultValue: defaultItems,
76
+ handleName: "onItemsChange",
77
+ name: "items",
78
+ onChange: onItemsChange,
79
+ value: externalItems
80
+ });
81
+ const [value, setValue] = useControlledState({
82
+ defaultName: "defaultValue",
83
+ defaultValue,
84
+ handleName: "onChange",
85
+ name: "value",
86
+ onChange,
87
+ value: externalValue ?? inputValue
88
+ });
89
+ const [active, setActive] = useControlledState({
90
+ defaultName: "defaultActive",
91
+ defaultValue: defaultActive,
92
+ handleName: "onActiveChange",
93
+ name: "active",
94
+ onChange: onActiveChange,
95
+ value: externalActive
96
+ });
97
+ const selectedKeys = useMemo(() => {
98
+ return items.map(
99
+ (item) => String(
100
+ getLocatorValue({
101
+ item,
102
+ locator: locator.value
103
+ })
104
+ )
105
+ );
106
+ }, [items, locator.value]);
107
+ const inputElementRef = ref || inputRef;
108
+ const ariaDescriptionId = useId();
109
+ const hasAsyncItems = !!onLoadMore || typeof loadingState === "number";
110
+ const Container = MenuRenderer ? FocusScope : React.Fragment;
111
+ const containerProps = MenuRenderer ? { arrowKeysUpDown: false } : {};
112
+ useEffect(() => {
113
+ if (MenuRenderer) {
114
+ console.warn(
115
+ `<ClayMultiSelect />: You are using 'menuRenderer' which is deprecated and missing the new features and improvements that have been implemented in the component try to migrate to the new composition based API to custom list items.`
116
+ );
117
+ }
118
+ if (allowsCustomLabel && (typeof locator.label === "function" || typeof locator.value === "function")) {
119
+ console.warn(
120
+ `<ClayMultiSelect />: Custom labels cannot be created because the expected structure of the label is unknown. Please disable allowsCustomLabel or update the locators to be strings rather than functions.`
121
+ );
122
+ }
123
+ }, []);
124
+ useEffect(() => {
125
+ if (MenuRenderer && sourceItems) {
126
+ setActive(!!value && sourceItems.length !== 0);
127
+ }
128
+ }, [value, sourceItems]);
129
+ const memoizedChildren = useCallback(
130
+ (item) => {
131
+ const handleItemClick = (event) => {
132
+ event.preventDefault();
133
+ setActive(false);
134
+ if (!allowDuplicateValues && items.find((dropdownItem) => {
135
+ return getLocatorValue({
136
+ item: dropdownItem,
137
+ locator: locator.value
138
+ }) === getLocatorValue({
139
+ item,
140
+ locator: locator.value
141
+ });
142
+ })) {
143
+ return;
144
+ }
145
+ setItems([...items, item]);
146
+ setValue("");
147
+ };
148
+ if (children && typeof children === "function") {
149
+ const child = children(item);
150
+ return React.cloneElement(child, {
151
+ onClick: (event) => {
152
+ if (child.props.onClick) {
153
+ child.props.onClick(event);
154
+ }
155
+ if (event.defaultPrevented) {
156
+ return;
157
+ }
158
+ handleItemClick(event);
159
+ }
160
+ });
161
+ }
162
+ return /* @__PURE__ */ React.createElement(
163
+ AutocompleteItem,
164
+ {
165
+ key: getLocatorValue({
166
+ item,
167
+ locator: locator.value
168
+ }),
169
+ onClick: handleItemClick
170
+ },
171
+ getLocatorValue({
172
+ item,
173
+ locator: locator.label
174
+ })
175
+ );
176
+ },
177
+ [children, locator, items, setItems, allowDuplicateValues]
178
+ );
179
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Container, { ...containerProps }, /* @__PURE__ */ React.createElement(
180
+ "div",
181
+ {
182
+ className: classNames(
183
+ "form-control form-control-tag-group input-group",
184
+ {
185
+ focus: isFocused && isValid,
186
+ [`form-control-tag-group-${size}`]: size
187
+ }
188
+ ),
189
+ ref: containerRef
190
+ },
191
+ /* @__PURE__ */ React.createElement(
192
+ Autocomplete,
193
+ {
194
+ ...otherProps,
195
+ UNSAFE_loadingShrink: true,
196
+ active: MenuRenderer ? false : active,
197
+ allowsCustomLabel: typeof locator.label === "function" || typeof locator.value === "function" ? false : allowsCustomLabel,
198
+ allowsCustomValue: true,
199
+ ariaDescriptionId,
200
+ as: Labels,
201
+ closeButtonAriaLabel,
202
+ containerElementRef: containerRef,
203
+ defaultItems: !hasAsyncItems ? sourceItems : void 0,
204
+ disabled,
205
+ filterKey: locator.label,
206
+ inputName,
207
+ items: hasAsyncItems ? sourceItems : void 0,
208
+ labels: items,
209
+ lastChangesRef,
210
+ loadingState,
211
+ locator,
212
+ menuTrigger: "focus",
213
+ messages,
214
+ onActiveChange: MenuRenderer ? () => {
215
+ } : setActive,
216
+ onChange: setValue,
217
+ onFocus: MenuRenderer && sourceItems ? (event) => {
218
+ if (otherProps.onFocus) {
219
+ otherProps.onFocus(event);
220
+ }
221
+ setActive(
222
+ !!value && sourceItems.length !== 0
223
+ );
224
+ } : otherProps.onFocus,
225
+ onFocusChange: setIsFocused,
226
+ onItemsChange: hasAsyncItems ? () => {
227
+ } : void 0,
228
+ onLabelsChange: setItems,
229
+ onLoadMore,
230
+ placeholder,
231
+ ref: inputElementRef,
232
+ selectedKeys,
233
+ spritemap,
234
+ suggestionList: sourceItems ?? [],
235
+ value
236
+ },
237
+ memoizedChildren
238
+ ),
239
+ sourceItems && MenuRenderer && !!sourceItems.length && /* @__PURE__ */ React.createElement(
240
+ ACT.DropDown,
241
+ {
242
+ active,
243
+ alignElementRef: containerRef,
244
+ alignmentByViewport,
245
+ onActiveChange: setActive
246
+ },
247
+ /* @__PURE__ */ React.createElement(
248
+ MenuRenderer,
249
+ {
250
+ inputValue: value,
251
+ locator,
252
+ onItemClick: (item) => {
253
+ setItems([...items, item]);
254
+ setValue("");
255
+ if (inputElementRef.current) {
256
+ inputElementRef.current.focus();
257
+ }
258
+ },
259
+ sourceItems,
260
+ value
261
+ }
262
+ )
263
+ ),
264
+ !disabled && !disabledClearAll && (value || !!items.length) ? /* @__PURE__ */ React.createElement(ClayInput.GroupItem, { shrink: true }, /* @__PURE__ */ React.createElement(
265
+ ClayButtonWithIcon,
266
+ {
267
+ "aria-label": clearAllTitle,
268
+ borderless: true,
269
+ className: "component-action",
270
+ displayType: "secondary",
271
+ onClick: () => {
272
+ if (onClearAllButtonClick) {
273
+ onClearAllButtonClick();
274
+ } else {
275
+ setItems([]);
276
+ setValue("");
277
+ }
278
+ if (inputElementRef.current) {
279
+ inputElementRef.current.focus();
280
+ }
281
+ },
282
+ outline: true,
283
+ spritemap,
284
+ symbol: "times-circle",
285
+ title: clearAllTitle
286
+ }
287
+ )) : icon,
288
+ /* @__PURE__ */ React.createElement("div", { className: "sr-only" }, /* @__PURE__ */ React.createElement("span", { id: ariaDescriptionId }, hotkeysDescription ?? messages.hotkeys), /* @__PURE__ */ React.createElement("span", { "aria-live": "polite", "aria-relevant": "text" }, lastChangesRef.current ? sub(
289
+ liveRegion ? liveRegion[lastChangesRef.current.action] : lastChangesRef.current.action === "added" ? messages.labelAdded : messages.labelRemoved,
290
+ [lastChangesRef.current.label]
291
+ ) : null))
292
+ )), active && displayKeyboardArrowsIndicator && /* @__PURE__ */ React.createElement(ClayPortal, null, /* @__PURE__ */ React.createElement(
293
+ KeyboardArrowsIndicator,
294
+ {
295
+ anchorRef: containerRef,
296
+ direction: "vertical"
297
+ }
298
+ )));
299
+ });
300
+ function itemLabelFilter(items, _value, _locator = "label") {
301
+ return items;
302
+ }
303
+ export {
304
+ MultiSelect,
305
+ itemLabelFilter
306
+ };
@@ -0,0 +1,7 @@
1
+ import { Item } from "@clayui/autocomplete";
2
+ import { MultiSelect, itemLabelFilter } from "./MultiSelect";
3
+ var index_default = Object.assign(MultiSelect, { Item });
4
+ export {
5
+ index_default as default,
6
+ itemLabelFilter
7
+ };
File without changes