@sit-onyx/headless 0.4.0-dev-20251110091137 → 0.4.0-dev-20251111093451

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.
@@ -99,4 +99,5 @@ export declare const createListbox: <TValue extends ListboxValue, TMultiple exte
99
99
  isFocused: Ref<boolean, boolean>;
100
100
  }, {
101
101
  getOptionId: (value: TValue) => string;
102
+ getOptionValueById: (id: string) => TValue | undefined;
102
103
  }>;
package/dist/index.js CHANGED
@@ -434,6 +434,10 @@ const createListbox = createBuilder(
434
434
  }
435
435
  return descendantKeyIdMap.get(value);
436
436
  };
437
+ const getOptionValueById = (id) => {
438
+ const entries = Array.from(descendantKeyIdMap.entries());
439
+ return entries.find(([_value, key]) => key === id)?.[0];
440
+ };
437
441
  const isFocused = ref(false);
438
442
  watchEffect(async () => {
439
443
  if (!isExpanded.value || options.activeOption.value == void 0 || !isFocused.value && !options.controlled) {
@@ -527,7 +531,8 @@ const createListbox = createBuilder(
527
531
  isFocused
528
532
  },
529
533
  internals: {
530
- getOptionId
534
+ getOptionId,
535
+ getOptionValueById
531
536
  }
532
537
  };
533
538
  }
@@ -646,7 +651,7 @@ const createComboBox = createBuilder(
646
651
  });
647
652
  const {
648
653
  elements: { option, group, listbox },
649
- internals: { getOptionId }
654
+ internals: { getOptionId, getOptionValueById }
650
655
  } = createListbox({
651
656
  label: listLabel,
652
657
  description: listDescription,
@@ -697,7 +702,8 @@ const createComboBox = createBuilder(
697
702
  tabindex: "-1",
698
703
  onClick: () => onToggle?.()
699
704
  }))
700
- }
705
+ },
706
+ internals: { getOptionId, getOptionValueById }
701
707
  };
702
708
  }
703
709
  );
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sit-onyx/headless",
3
3
  "description": "Headless composables for Vue",
4
- "version": "0.4.0-dev-20251110091137",
4
+ "version": "0.4.0-dev-20251111093451",
5
5
  "type": "module",
6
6
  "author": "Schwarz IT KG",
7
7
  "license": "Apache-2.0",