@sproutsocial/seeds-react-menu 1.8.5 → 1.8.6
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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +16 -0
- package/dist/esm/v2/index.js +20 -4
- package/dist/esm/v2/index.js.map +1 -1
- package/dist/v2/index.d.mts +10 -4
- package/dist/v2/index.d.ts +10 -4
- package/dist/v2/index.js +20 -4
- package/dist/v2/index.js.map +1 -1
- package/package.json +1 -1
- package/src/v2/Autocomplete/MultiAutocomplete.tsx +4 -0
- package/src/v2/Autocomplete/SingleAutocomplete.tsx +4 -0
- package/src/v2/Common-V2/props.ts +4 -0
- package/src/v2/SearchableSelect/SearchableMultiSelect.tsx +4 -0
- package/src/v2/SearchableSelect/SearchableSelect.tsx +4 -0
- package/src/v2/Select/MultiSelect.tsx +4 -0
- package/src/v2/Select/SingleSelect.tsx +4 -0
package/package.json
CHANGED
|
@@ -72,6 +72,8 @@ export function MultiAutocomplete<T extends DataWithId>({
|
|
|
72
72
|
stateReducer = defaultReducer,
|
|
73
73
|
menuProps,
|
|
74
74
|
inputType = "checkbox",
|
|
75
|
+
onPointerDownOutside,
|
|
76
|
+
onInteractOutside,
|
|
75
77
|
}: MultiAutocompleteProps<T>) {
|
|
76
78
|
const [uncontrolledInputValue, setUncontrolledInputValue] =
|
|
77
79
|
useState<string>("");
|
|
@@ -379,6 +381,8 @@ export function MultiAutocomplete<T extends DataWithId>({
|
|
|
379
381
|
// Prevent default auto-focus behavior
|
|
380
382
|
e.preventDefault();
|
|
381
383
|
}}
|
|
384
|
+
onPointerDownOutside={onPointerDownOutside}
|
|
385
|
+
onInteractOutside={onInteractOutside}
|
|
382
386
|
animationConfig={menuAnimationConfig}
|
|
383
387
|
content={
|
|
384
388
|
<ComboboxContent
|
|
@@ -65,6 +65,8 @@ export function SingleAutocomplete<T extends DataWithId>({
|
|
|
65
65
|
menuProps,
|
|
66
66
|
inputType = "icon",
|
|
67
67
|
includePlaceholderItem = false,
|
|
68
|
+
onPointerDownOutside,
|
|
69
|
+
onInteractOutside,
|
|
68
70
|
}: SingleAutocompleteProps<T>) {
|
|
69
71
|
const [uncontrolledInputValue, setUncontrolledInputValue] =
|
|
70
72
|
useState<string>("");
|
|
@@ -300,6 +302,8 @@ export function SingleAutocomplete<T extends DataWithId>({
|
|
|
300
302
|
// Prevent default auto-focus behavior
|
|
301
303
|
e.preventDefault();
|
|
302
304
|
}}
|
|
305
|
+
onPointerDownOutside={onPointerDownOutside}
|
|
306
|
+
onInteractOutside={onInteractOutside}
|
|
303
307
|
content={
|
|
304
308
|
<ComboboxContent
|
|
305
309
|
items={items}
|
|
@@ -18,6 +18,10 @@ export interface BaseSelectProps<T extends DataWithId> {
|
|
|
18
18
|
onIsOpenChange?: (isOpen: boolean) => void;
|
|
19
19
|
stateReducer?: any;
|
|
20
20
|
menuProps?: React.HTMLAttributes<HTMLDivElement>;
|
|
21
|
+
onPointerDownOutside?: (
|
|
22
|
+
event: CustomEvent<{ originalEvent: PointerEvent }>
|
|
23
|
+
) => void;
|
|
24
|
+
onInteractOutside?: (event: CustomEvent<{ originalEvent: Event }>) => void;
|
|
21
25
|
}
|
|
22
26
|
/**
|
|
23
27
|
* Props common to all single-select components
|
|
@@ -76,6 +76,8 @@ export function SearchableMultiSelect<T extends DataWithId>({
|
|
|
76
76
|
onIsOpenChange,
|
|
77
77
|
stateReducer = defaultReducer,
|
|
78
78
|
triggerButtonProps,
|
|
79
|
+
onPointerDownOutside,
|
|
80
|
+
onInteractOutside,
|
|
79
81
|
}: SearchableMultiSelectProps<T>) {
|
|
80
82
|
const [uncontrolledInputValue, setUncontrolledInputValue] =
|
|
81
83
|
useState<string>("");
|
|
@@ -383,6 +385,8 @@ export function SearchableMultiSelect<T extends DataWithId>({
|
|
|
383
385
|
// Prevent default auto-focus behavior
|
|
384
386
|
e.preventDefault();
|
|
385
387
|
}}
|
|
388
|
+
onPointerDownOutside={onPointerDownOutside}
|
|
389
|
+
onInteractOutside={onInteractOutside}
|
|
386
390
|
content={
|
|
387
391
|
<div>
|
|
388
392
|
{/* Input inside the Popout */}
|
|
@@ -72,6 +72,8 @@ export function SearchableSelect<T extends DataWithId>({
|
|
|
72
72
|
onIsOpenChange,
|
|
73
73
|
stateReducer = defaultReducer,
|
|
74
74
|
triggerButtonProps,
|
|
75
|
+
onPointerDownOutside,
|
|
76
|
+
onInteractOutside,
|
|
75
77
|
}: SearchableSelectProps<T>) {
|
|
76
78
|
const [uncontrolledInputValue, setUncontrolledInputValue] =
|
|
77
79
|
useState<string>("");
|
|
@@ -273,6 +275,8 @@ export function SearchableSelect<T extends DataWithId>({
|
|
|
273
275
|
// Prevent default auto-focus behavior
|
|
274
276
|
e.preventDefault();
|
|
275
277
|
}}
|
|
278
|
+
onPointerDownOutside={onPointerDownOutside}
|
|
279
|
+
onInteractOutside={onInteractOutside}
|
|
276
280
|
content={
|
|
277
281
|
<div>
|
|
278
282
|
{/* Input inside the Popout */}
|
|
@@ -77,6 +77,8 @@ export function MultiSelect<T extends DataWithId>({
|
|
|
77
77
|
menuProps,
|
|
78
78
|
inputType = "checkbox",
|
|
79
79
|
shouldOverflow,
|
|
80
|
+
onPointerDownOutside,
|
|
81
|
+
onInteractOutside,
|
|
80
82
|
}: MultiSelectProps<T>) {
|
|
81
83
|
const [uncontrolledSelectedItemIds, setUncontrolledSelectedItemIds] =
|
|
82
84
|
useState<T["id"][]>([]);
|
|
@@ -341,6 +343,8 @@ export function MultiSelect<T extends DataWithId>({
|
|
|
341
343
|
// Prevent default auto-focus behavior
|
|
342
344
|
e.preventDefault();
|
|
343
345
|
}}
|
|
346
|
+
onPointerDownOutside={onPointerDownOutside}
|
|
347
|
+
onInteractOutside={onInteractOutside}
|
|
344
348
|
animationConfig={menuAnimationConfig}
|
|
345
349
|
content={
|
|
346
350
|
<ComboboxContent
|
|
@@ -64,6 +64,8 @@ export function SingleSelect<T extends DataWithId>({
|
|
|
64
64
|
menuProps,
|
|
65
65
|
inputType = "icon",
|
|
66
66
|
removePlaceholderItem = false,
|
|
67
|
+
onPointerDownOutside,
|
|
68
|
+
onInteractOutside,
|
|
67
69
|
}: SingleSelectProps<T>) {
|
|
68
70
|
const [uncontrolledSelectedItemId, setUncontrolledSelectedItemId] = useState<
|
|
69
71
|
T["id"] | null
|
|
@@ -221,6 +223,8 @@ export function SingleSelect<T extends DataWithId>({
|
|
|
221
223
|
// Prevent default auto-focus behavior
|
|
222
224
|
e.preventDefault();
|
|
223
225
|
}}
|
|
226
|
+
onPointerDownOutside={onPointerDownOutside}
|
|
227
|
+
onInteractOutside={onInteractOutside}
|
|
224
228
|
content={
|
|
225
229
|
<ComboboxContent
|
|
226
230
|
items={items}
|