@zag-js/combobox 1.18.4 → 1.19.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.
- package/dist/index.d.mts +28 -28
- package/dist/index.d.ts +28 -28
- package/package.json +10 -10
package/dist/index.d.mts
CHANGED
|
@@ -65,10 +65,10 @@ type ElementIds = Partial<{
|
|
|
65
65
|
content: string;
|
|
66
66
|
trigger: string;
|
|
67
67
|
clearTrigger: string;
|
|
68
|
-
item(id: string, index?: number)
|
|
68
|
+
item: (id: string, index?: number) => string;
|
|
69
69
|
positioner: string;
|
|
70
|
-
itemGroup(id: string | number)
|
|
71
|
-
itemGroupLabel(id: string | number)
|
|
70
|
+
itemGroup: (id: string | number) => string;
|
|
71
|
+
itemGroupLabel: (id: string | number) => string;
|
|
72
72
|
}>;
|
|
73
73
|
interface ComboboxProps<T extends CollectionItem = CollectionItem> extends DirectionProperty, CommonProperties, InteractOutsideHandlers {
|
|
74
74
|
/**
|
|
@@ -345,16 +345,16 @@ interface ComboboxApi<T extends PropTypes = PropTypes, V extends CollectionItem
|
|
|
345
345
|
/**
|
|
346
346
|
* The value of the combobox input
|
|
347
347
|
*/
|
|
348
|
-
setHighlightValue(value: string)
|
|
348
|
+
setHighlightValue: (value: string) => void;
|
|
349
349
|
/**
|
|
350
350
|
* Function to clear the highlighted value
|
|
351
351
|
*/
|
|
352
|
-
clearHighlightValue
|
|
352
|
+
clearHighlightValue: VoidFunction;
|
|
353
353
|
/**
|
|
354
354
|
* Function to sync the selected items with the value.
|
|
355
355
|
* Useful when `value` is updated from async sources.
|
|
356
356
|
*/
|
|
357
|
-
syncSelectedItems
|
|
357
|
+
syncSelectedItems: VoidFunction;
|
|
358
358
|
/**
|
|
359
359
|
* The selected items
|
|
360
360
|
*/
|
|
@@ -374,31 +374,31 @@ interface ComboboxApi<T extends PropTypes = PropTypes, V extends CollectionItem
|
|
|
374
374
|
/**
|
|
375
375
|
* Function to select a value
|
|
376
376
|
*/
|
|
377
|
-
selectValue(value: string)
|
|
377
|
+
selectValue: (value: string) => void;
|
|
378
378
|
/**
|
|
379
379
|
* Function to set the value of the combobox
|
|
380
380
|
*/
|
|
381
|
-
setValue(value: string[])
|
|
381
|
+
setValue: (value: string[]) => void;
|
|
382
382
|
/**
|
|
383
383
|
* Function to clear the value of the combobox
|
|
384
384
|
*/
|
|
385
|
-
clearValue(value?: string)
|
|
385
|
+
clearValue: (value?: string) => void;
|
|
386
386
|
/**
|
|
387
387
|
* Function to focus on the combobox input
|
|
388
388
|
*/
|
|
389
|
-
focus
|
|
389
|
+
focus: VoidFunction;
|
|
390
390
|
/**
|
|
391
391
|
* Function to set the input value of the combobox
|
|
392
392
|
*/
|
|
393
|
-
setInputValue(value: string, reason?: InputValueChangeReason)
|
|
393
|
+
setInputValue: (value: string, reason?: InputValueChangeReason) => void;
|
|
394
394
|
/**
|
|
395
395
|
* Returns the state of a combobox item
|
|
396
396
|
*/
|
|
397
|
-
getItemState(props: ItemProps)
|
|
397
|
+
getItemState: (props: ItemProps) => ItemState;
|
|
398
398
|
/**
|
|
399
399
|
* Function to open or close the combobox
|
|
400
400
|
*/
|
|
401
|
-
setOpen(open: boolean, reason?: OpenChangeReason)
|
|
401
|
+
setOpen: (open: boolean, reason?: OpenChangeReason) => void;
|
|
402
402
|
/**
|
|
403
403
|
* Function to toggle the combobox
|
|
404
404
|
*/
|
|
@@ -406,7 +406,7 @@ interface ComboboxApi<T extends PropTypes = PropTypes, V extends CollectionItem
|
|
|
406
406
|
/**
|
|
407
407
|
* Function to set the positioning options
|
|
408
408
|
*/
|
|
409
|
-
reposition(options?: Partial<PositioningOptions>)
|
|
409
|
+
reposition: (options?: Partial<PositioningOptions>) => void;
|
|
410
410
|
/**
|
|
411
411
|
* Whether the combobox allows multiple selections
|
|
412
412
|
*/
|
|
@@ -415,20 +415,20 @@ interface ComboboxApi<T extends PropTypes = PropTypes, V extends CollectionItem
|
|
|
415
415
|
* Whether the combobox is disabled
|
|
416
416
|
*/
|
|
417
417
|
disabled: boolean;
|
|
418
|
-
getRootProps()
|
|
419
|
-
getLabelProps()
|
|
420
|
-
getControlProps()
|
|
421
|
-
getPositionerProps()
|
|
422
|
-
getInputProps()
|
|
423
|
-
getContentProps()
|
|
424
|
-
getTriggerProps(props?: TriggerProps)
|
|
425
|
-
getClearTriggerProps()
|
|
426
|
-
getListProps()
|
|
427
|
-
getItemProps(props: ItemProps)
|
|
428
|
-
getItemTextProps(props: ItemProps)
|
|
429
|
-
getItemIndicatorProps(props: ItemProps)
|
|
430
|
-
getItemGroupProps(props: ItemGroupProps)
|
|
431
|
-
getItemGroupLabelProps(props: ItemGroupLabelProps)
|
|
418
|
+
getRootProps: () => T["element"];
|
|
419
|
+
getLabelProps: () => T["label"];
|
|
420
|
+
getControlProps: () => T["element"];
|
|
421
|
+
getPositionerProps: () => T["element"];
|
|
422
|
+
getInputProps: () => T["input"];
|
|
423
|
+
getContentProps: () => T["element"];
|
|
424
|
+
getTriggerProps: (props?: TriggerProps) => T["button"];
|
|
425
|
+
getClearTriggerProps: () => T["button"];
|
|
426
|
+
getListProps: () => T["element"];
|
|
427
|
+
getItemProps: (props: ItemProps) => T["element"];
|
|
428
|
+
getItemTextProps: (props: ItemProps) => T["element"];
|
|
429
|
+
getItemIndicatorProps: (props: ItemProps) => T["element"];
|
|
430
|
+
getItemGroupProps: (props: ItemGroupProps) => T["element"];
|
|
431
|
+
getItemGroupLabelProps: (props: ItemGroupLabelProps) => T["element"];
|
|
432
432
|
}
|
|
433
433
|
|
|
434
434
|
declare function connect<T extends PropTypes, V extends CollectionItem>(service: ComboboxService<V>, normalize: NormalizeProps<T>): ComboboxApi<T, V>;
|
package/dist/index.d.ts
CHANGED
|
@@ -65,10 +65,10 @@ type ElementIds = Partial<{
|
|
|
65
65
|
content: string;
|
|
66
66
|
trigger: string;
|
|
67
67
|
clearTrigger: string;
|
|
68
|
-
item(id: string, index?: number)
|
|
68
|
+
item: (id: string, index?: number) => string;
|
|
69
69
|
positioner: string;
|
|
70
|
-
itemGroup(id: string | number)
|
|
71
|
-
itemGroupLabel(id: string | number)
|
|
70
|
+
itemGroup: (id: string | number) => string;
|
|
71
|
+
itemGroupLabel: (id: string | number) => string;
|
|
72
72
|
}>;
|
|
73
73
|
interface ComboboxProps<T extends CollectionItem = CollectionItem> extends DirectionProperty, CommonProperties, InteractOutsideHandlers {
|
|
74
74
|
/**
|
|
@@ -345,16 +345,16 @@ interface ComboboxApi<T extends PropTypes = PropTypes, V extends CollectionItem
|
|
|
345
345
|
/**
|
|
346
346
|
* The value of the combobox input
|
|
347
347
|
*/
|
|
348
|
-
setHighlightValue(value: string)
|
|
348
|
+
setHighlightValue: (value: string) => void;
|
|
349
349
|
/**
|
|
350
350
|
* Function to clear the highlighted value
|
|
351
351
|
*/
|
|
352
|
-
clearHighlightValue
|
|
352
|
+
clearHighlightValue: VoidFunction;
|
|
353
353
|
/**
|
|
354
354
|
* Function to sync the selected items with the value.
|
|
355
355
|
* Useful when `value` is updated from async sources.
|
|
356
356
|
*/
|
|
357
|
-
syncSelectedItems
|
|
357
|
+
syncSelectedItems: VoidFunction;
|
|
358
358
|
/**
|
|
359
359
|
* The selected items
|
|
360
360
|
*/
|
|
@@ -374,31 +374,31 @@ interface ComboboxApi<T extends PropTypes = PropTypes, V extends CollectionItem
|
|
|
374
374
|
/**
|
|
375
375
|
* Function to select a value
|
|
376
376
|
*/
|
|
377
|
-
selectValue(value: string)
|
|
377
|
+
selectValue: (value: string) => void;
|
|
378
378
|
/**
|
|
379
379
|
* Function to set the value of the combobox
|
|
380
380
|
*/
|
|
381
|
-
setValue(value: string[])
|
|
381
|
+
setValue: (value: string[]) => void;
|
|
382
382
|
/**
|
|
383
383
|
* Function to clear the value of the combobox
|
|
384
384
|
*/
|
|
385
|
-
clearValue(value?: string)
|
|
385
|
+
clearValue: (value?: string) => void;
|
|
386
386
|
/**
|
|
387
387
|
* Function to focus on the combobox input
|
|
388
388
|
*/
|
|
389
|
-
focus
|
|
389
|
+
focus: VoidFunction;
|
|
390
390
|
/**
|
|
391
391
|
* Function to set the input value of the combobox
|
|
392
392
|
*/
|
|
393
|
-
setInputValue(value: string, reason?: InputValueChangeReason)
|
|
393
|
+
setInputValue: (value: string, reason?: InputValueChangeReason) => void;
|
|
394
394
|
/**
|
|
395
395
|
* Returns the state of a combobox item
|
|
396
396
|
*/
|
|
397
|
-
getItemState(props: ItemProps)
|
|
397
|
+
getItemState: (props: ItemProps) => ItemState;
|
|
398
398
|
/**
|
|
399
399
|
* Function to open or close the combobox
|
|
400
400
|
*/
|
|
401
|
-
setOpen(open: boolean, reason?: OpenChangeReason)
|
|
401
|
+
setOpen: (open: boolean, reason?: OpenChangeReason) => void;
|
|
402
402
|
/**
|
|
403
403
|
* Function to toggle the combobox
|
|
404
404
|
*/
|
|
@@ -406,7 +406,7 @@ interface ComboboxApi<T extends PropTypes = PropTypes, V extends CollectionItem
|
|
|
406
406
|
/**
|
|
407
407
|
* Function to set the positioning options
|
|
408
408
|
*/
|
|
409
|
-
reposition(options?: Partial<PositioningOptions>)
|
|
409
|
+
reposition: (options?: Partial<PositioningOptions>) => void;
|
|
410
410
|
/**
|
|
411
411
|
* Whether the combobox allows multiple selections
|
|
412
412
|
*/
|
|
@@ -415,20 +415,20 @@ interface ComboboxApi<T extends PropTypes = PropTypes, V extends CollectionItem
|
|
|
415
415
|
* Whether the combobox is disabled
|
|
416
416
|
*/
|
|
417
417
|
disabled: boolean;
|
|
418
|
-
getRootProps()
|
|
419
|
-
getLabelProps()
|
|
420
|
-
getControlProps()
|
|
421
|
-
getPositionerProps()
|
|
422
|
-
getInputProps()
|
|
423
|
-
getContentProps()
|
|
424
|
-
getTriggerProps(props?: TriggerProps)
|
|
425
|
-
getClearTriggerProps()
|
|
426
|
-
getListProps()
|
|
427
|
-
getItemProps(props: ItemProps)
|
|
428
|
-
getItemTextProps(props: ItemProps)
|
|
429
|
-
getItemIndicatorProps(props: ItemProps)
|
|
430
|
-
getItemGroupProps(props: ItemGroupProps)
|
|
431
|
-
getItemGroupLabelProps(props: ItemGroupLabelProps)
|
|
418
|
+
getRootProps: () => T["element"];
|
|
419
|
+
getLabelProps: () => T["label"];
|
|
420
|
+
getControlProps: () => T["element"];
|
|
421
|
+
getPositionerProps: () => T["element"];
|
|
422
|
+
getInputProps: () => T["input"];
|
|
423
|
+
getContentProps: () => T["element"];
|
|
424
|
+
getTriggerProps: (props?: TriggerProps) => T["button"];
|
|
425
|
+
getClearTriggerProps: () => T["button"];
|
|
426
|
+
getListProps: () => T["element"];
|
|
427
|
+
getItemProps: (props: ItemProps) => T["element"];
|
|
428
|
+
getItemTextProps: (props: ItemProps) => T["element"];
|
|
429
|
+
getItemIndicatorProps: (props: ItemProps) => T["element"];
|
|
430
|
+
getItemGroupProps: (props: ItemGroupProps) => T["element"];
|
|
431
|
+
getItemGroupLabelProps: (props: ItemGroupLabelProps) => T["element"];
|
|
432
432
|
}
|
|
433
433
|
|
|
434
434
|
declare function connect<T extends PropTypes, V extends CollectionItem>(service: ComboboxService<V>, normalize: NormalizeProps<T>): ComboboxApi<T, V>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/combobox",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"description": "Core logic for the combobox widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@zag-js/anatomy": "1.
|
|
30
|
-
"@zag-js/aria-hidden": "1.
|
|
31
|
-
"@zag-js/collection": "1.
|
|
32
|
-
"@zag-js/core": "1.
|
|
33
|
-
"@zag-js/dismissable": "1.
|
|
34
|
-
"@zag-js/dom-query": "1.
|
|
35
|
-
"@zag-js/utils": "1.
|
|
36
|
-
"@zag-js/popper": "1.
|
|
37
|
-
"@zag-js/types": "1.
|
|
29
|
+
"@zag-js/anatomy": "1.19.0",
|
|
30
|
+
"@zag-js/aria-hidden": "1.19.0",
|
|
31
|
+
"@zag-js/collection": "1.19.0",
|
|
32
|
+
"@zag-js/core": "1.19.0",
|
|
33
|
+
"@zag-js/dismissable": "1.19.0",
|
|
34
|
+
"@zag-js/dom-query": "1.19.0",
|
|
35
|
+
"@zag-js/utils": "1.19.0",
|
|
36
|
+
"@zag-js/popper": "1.19.0",
|
|
37
|
+
"@zag-js/types": "1.19.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"clean-package": "2.2.0"
|