@sproutsocial/seeds-react-menu 1.11.9 → 1.12.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.
@@ -1425,7 +1425,9 @@ function MultiCombobox(props) {
1425
1425
  emptyText = "No results found.",
1426
1426
  isLoading = false,
1427
1427
  loadingText = "Loading...",
1428
- filter
1428
+ filter,
1429
+ inputValue,
1430
+ onInputValueChange
1429
1431
  } = props;
1430
1432
  const isChildrenMode = "children" in props && props.children != null;
1431
1433
  const data = isChildrenMode ? [] : props.data;
@@ -1439,7 +1441,9 @@ function MultiCombobox(props) {
1439
1441
  const groupBy = isChildrenMode ? void 0 : props.groupBy;
1440
1442
  const renderGroupHeading = isChildrenMode ? void 0 : props.renderGroupHeading;
1441
1443
  const selectHeadings = isChildrenMode ? false : props.selectHeadings ?? false;
1442
- const selectAll = isChildrenMode ? false : props.selectAll ?? false;
1444
+ const selectAllProp = isChildrenMode ? false : props.selectAll ?? false;
1445
+ const selectAll = Boolean(selectAllProp);
1446
+ const selectAllLabel = typeof selectAllProp === "string" ? selectAllProp : "Select all";
1443
1447
  const isVirtualized = isChildrenMode ? false : props.isVirtualized ?? false;
1444
1448
  const children = isChildrenMode ? props.children : void 0;
1445
1449
  const selectedItemIds = props.selectedItemIds;
@@ -1466,15 +1470,20 @@ function MultiCombobox(props) {
1466
1470
  [visibleData, groupBy]
1467
1471
  );
1468
1472
  const flatItems = React9.useMemo(() => {
1469
- if (!groups || !selectHeadings && !selectAll) return null;
1473
+ if (!selectHeadings && !selectAll) return null;
1474
+ if (!groups && !selectAll) return null;
1470
1475
  const rows = [];
1471
1476
  if (selectAll) rows.push(SELECT_ALL_SENTINEL);
1472
- for (const group of groups) {
1473
- rows.push(makeGroupHeaderSentinel(group.value));
1474
- rows.push(...group.items);
1477
+ if (groups) {
1478
+ for (const group of groups) {
1479
+ rows.push(makeGroupHeaderSentinel(group.value));
1480
+ rows.push(...group.items);
1481
+ }
1482
+ } else {
1483
+ rows.push(...visibleData);
1475
1484
  }
1476
1485
  return rows;
1477
- }, [groups, selectHeadings, selectAll]);
1486
+ }, [groups, visibleData, selectHeadings, selectAll]);
1478
1487
  function setSelectedItems(items) {
1479
1488
  if (!isControlled) setInternalValue(items);
1480
1489
  if (onSelectedItemIdsChange)
@@ -1532,7 +1541,7 @@ function MultiCombobox(props) {
1532
1541
  const state = selectedCount === 0 ? "none" : selectedCount === totalCount ? "all" : "partial";
1533
1542
  return /* @__PURE__ */ jsxs7(ComboboxSelectAllItem, { value: row, children: [
1534
1543
  /* @__PURE__ */ jsx9(ComboboxGroupHeaderCheckbox, { $state: state, id: "__selectAll" }),
1535
- "Select all"
1544
+ selectAllLabel
1536
1545
  ] }, "__selectAll");
1537
1546
  }
1538
1547
  if (isGroupHeaderSentinel2(row)) {
@@ -1580,8 +1589,13 @@ function MultiCombobox(props) {
1580
1589
  virtualized: isVirtualized,
1581
1590
  open,
1582
1591
  disabled: props.disabled,
1583
- onOpenChange: setOpen,
1592
+ onOpenChange: (nextOpen, eventDetails) => {
1593
+ if (!nextOpen && eventDetails.reason === "item-press") return;
1594
+ setOpen(nextOpen);
1595
+ },
1584
1596
  filter,
1597
+ inputValue,
1598
+ onInputValueChange,
1585
1599
  onItemHighlighted: isVirtualized ? (item, { reason, index }) => {
1586
1600
  const virt = virtualizerRef.current;
1587
1601
  if (!item || !virt) return;