@zag-js/combobox
Advanced tools
Comparing version 0.76.0 to 0.77.0
@@ -33,7 +33,2 @@ import { InteractOutsideHandlers } from '@zag-js/dismissable'; | ||
} | ||
interface SelectionValueDetails<T extends CollectionItem = CollectionItem> { | ||
inputValue: string; | ||
selectedItems: T[]; | ||
valueAsString: string; | ||
} | ||
interface ScrollToIndexDetails { | ||
@@ -197,6 +192,2 @@ index: number; | ||
/** | ||
* Function to get the display value of the selected item | ||
*/ | ||
getSelectionValue?: ((details: SelectionValueDetails<T>) => string) | undefined; | ||
/** | ||
* Whether to open the combobox on arrow key press | ||
@@ -420,2 +411,2 @@ * @default true | ||
export { type MachineApi as Api, type UserDefinedContext as Context, type ElementIds, type HighlightChangeDetails, type InputValueChangeDetails, type IntlTranslations, type ItemGroupLabelProps, type ItemGroupProps, type ItemProps, type ItemState, type OpenChangeDetails, type ScrollToIndexDetails, type SelectionValueDetails, type Service, type TriggerProps, type ValueChangeDetails, anatomy, collection, connect, machine }; | ||
export { type MachineApi as Api, type UserDefinedContext as Context, type ElementIds, type HighlightChangeDetails, type InputValueChangeDetails, type IntlTranslations, type ItemGroupLabelProps, type ItemGroupProps, type ItemProps, type ItemState, type OpenChangeDetails, type ScrollToIndexDetails, type Service, type TriggerProps, type ValueChangeDetails, anatomy, collection, connect, machine }; |
@@ -1146,3 +1146,3 @@ 'use strict'; | ||
set.value(ctx2, ctx2.highlightedValue); | ||
set.inputValue(ctx2, getInputValue(ctx2, true)); | ||
set.inputValue(ctx2, getInputValue(ctx2)); | ||
}, | ||
@@ -1152,3 +1152,3 @@ selectItem(ctx2, evt) { | ||
set.value(ctx2, evt.value); | ||
set.inputValue(ctx2, getInputValue(ctx2, true)); | ||
set.inputValue(ctx2, getInputValue(ctx2)); | ||
}, | ||
@@ -1335,10 +1335,3 @@ clearItem(ctx2, evt) { | ||
} | ||
function getInputValue(ctx, selection) { | ||
if (ctx.getSelectionValue && selection) { | ||
return ctx.getSelectionValue({ | ||
inputValue: ctx.inputValue, | ||
selectedItems: Array.from(ctx.selectedItems), | ||
valueAsString: ctx.valueAsString | ||
}); | ||
} | ||
function getInputValue(ctx) { | ||
return utils.match(ctx.selectionBehavior, { | ||
@@ -1345,0 +1338,0 @@ preserve: ctx.inputValue, |
{ | ||
"name": "@zag-js/combobox", | ||
"version": "0.76.0", | ||
"version": "0.77.0", | ||
"description": "Core logic for the combobox widget implemented as a state machine", | ||
@@ -29,12 +29,12 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/anatomy": "0.76.0", | ||
"@zag-js/aria-hidden": "0.76.0", | ||
"@zag-js/collection": "0.76.0", | ||
"@zag-js/core": "0.76.0", | ||
"@zag-js/dismissable": "0.76.0", | ||
"@zag-js/dom-query": "0.76.0", | ||
"@zag-js/dom-event": "0.76.0", | ||
"@zag-js/utils": "0.76.0", | ||
"@zag-js/popper": "0.76.0", | ||
"@zag-js/types": "0.76.0" | ||
"@zag-js/anatomy": "0.77.0", | ||
"@zag-js/aria-hidden": "0.77.0", | ||
"@zag-js/collection": "0.77.0", | ||
"@zag-js/core": "0.77.0", | ||
"@zag-js/dismissable": "0.77.0", | ||
"@zag-js/dom-query": "0.77.0", | ||
"@zag-js/dom-event": "0.77.0", | ||
"@zag-js/utils": "0.77.0", | ||
"@zag-js/popper": "0.77.0", | ||
"@zag-js/types": "0.77.0" | ||
}, | ||
@@ -41,0 +41,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
124184
3202
+ Added@zag-js/anatomy@0.77.0(transitive)
+ Added@zag-js/aria-hidden@0.77.0(transitive)
+ Added@zag-js/collection@0.77.0(transitive)
+ Added@zag-js/core@0.77.0(transitive)
+ Added@zag-js/dismissable@0.77.0(transitive)
+ Added@zag-js/dom-event@0.77.0(transitive)
+ Added@zag-js/dom-query@0.77.0(transitive)
+ Added@zag-js/interact-outside@0.77.0(transitive)
+ Added@zag-js/popper@0.77.0(transitive)
+ Added@zag-js/store@0.77.0(transitive)
+ Added@zag-js/text-selection@0.77.0(transitive)
+ Added@zag-js/types@0.77.0(transitive)
+ Added@zag-js/utils@0.77.0(transitive)
- Removed@zag-js/anatomy@0.76.0(transitive)
- Removed@zag-js/aria-hidden@0.76.0(transitive)
- Removed@zag-js/collection@0.76.0(transitive)
- Removed@zag-js/core@0.76.0(transitive)
- Removed@zag-js/dismissable@0.76.0(transitive)
- Removed@zag-js/dom-event@0.76.0(transitive)
- Removed@zag-js/dom-query@0.76.0(transitive)
- Removed@zag-js/interact-outside@0.76.0(transitive)
- Removed@zag-js/popper@0.76.0(transitive)
- Removed@zag-js/store@0.76.0(transitive)
- Removed@zag-js/text-selection@0.76.0(transitive)
- Removed@zag-js/types@0.76.0(transitive)
- Removed@zag-js/utils@0.76.0(transitive)
- Removedtree-visit@0.4.2(transitive)
Updated@zag-js/anatomy@0.77.0
Updated@zag-js/aria-hidden@0.77.0
Updated@zag-js/collection@0.77.0
Updated@zag-js/core@0.77.0
Updated@zag-js/dismissable@0.77.0
Updated@zag-js/dom-event@0.77.0
Updated@zag-js/dom-query@0.77.0
Updated@zag-js/popper@0.77.0
Updated@zag-js/types@0.77.0
Updated@zag-js/utils@0.77.0