@zag-js/combobox 0.71.0 → 0.73.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 +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +24 -0
- package/dist/index.mjs +24 -0
- package/package.json +11 -11
package/dist/index.d.mts
CHANGED
|
@@ -387,6 +387,14 @@ interface MachineApi<T extends PropTypes = PropTypes, V extends CollectionItem =
|
|
|
387
387
|
* Function to set the positioning options
|
|
388
388
|
*/
|
|
389
389
|
reposition(options?: Partial<PositioningOptions>): void;
|
|
390
|
+
/**
|
|
391
|
+
* Whether the combobox allows multiple selections
|
|
392
|
+
*/
|
|
393
|
+
multiple: boolean;
|
|
394
|
+
/**
|
|
395
|
+
* Whether the combobox is disabled
|
|
396
|
+
*/
|
|
397
|
+
disabled: boolean;
|
|
390
398
|
getRootProps(): T["element"];
|
|
391
399
|
getLabelProps(): T["label"];
|
|
392
400
|
getControlProps(): T["element"];
|
package/dist/index.d.ts
CHANGED
|
@@ -387,6 +387,14 @@ interface MachineApi<T extends PropTypes = PropTypes, V extends CollectionItem =
|
|
|
387
387
|
* Function to set the positioning options
|
|
388
388
|
*/
|
|
389
389
|
reposition(options?: Partial<PositioningOptions>): void;
|
|
390
|
+
/**
|
|
391
|
+
* Whether the combobox allows multiple selections
|
|
392
|
+
*/
|
|
393
|
+
multiple: boolean;
|
|
394
|
+
/**
|
|
395
|
+
* Whether the combobox is disabled
|
|
396
|
+
*/
|
|
397
|
+
disabled: boolean;
|
|
390
398
|
getRootProps(): T["element"];
|
|
391
399
|
getLabelProps(): T["label"];
|
|
392
400
|
getControlProps(): T["element"];
|
package/dist/index.js
CHANGED
|
@@ -108,6 +108,8 @@ function connect(state, send, normalize) {
|
|
|
108
108
|
hasSelectedItems: state.context.hasSelectedItems,
|
|
109
109
|
selectedItems: state.context.selectedItems,
|
|
110
110
|
collection: state.context.collection,
|
|
111
|
+
multiple: !!state.context.multiple,
|
|
112
|
+
disabled: !!disabled,
|
|
111
113
|
reposition(options = {}) {
|
|
112
114
|
send({ type: "POSITIONING.SET", options });
|
|
113
115
|
},
|
|
@@ -736,6 +738,17 @@ function machine(userContext) {
|
|
|
736
738
|
}
|
|
737
739
|
],
|
|
738
740
|
"INPUT.ENTER": [
|
|
741
|
+
// == group 1 ==
|
|
742
|
+
{
|
|
743
|
+
guard: and("isOpenControlled", "isCustomValue", not("hasHighlightedItem"), not("allowCustomValue")),
|
|
744
|
+
actions: ["revertInputValue", "invokeOnClose"]
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
guard: and("isCustomValue", not("hasHighlightedItem"), not("allowCustomValue")),
|
|
748
|
+
target: "focused",
|
|
749
|
+
actions: ["revertInputValue", "invokeOnClose"]
|
|
750
|
+
},
|
|
751
|
+
// == group 2 ==
|
|
739
752
|
{
|
|
740
753
|
guard: and("isOpenControlled", "closeOnSelect"),
|
|
741
754
|
actions: ["selectHighlightedItem", "invokeOnClose"]
|
|
@@ -893,6 +906,17 @@ function machine(userContext) {
|
|
|
893
906
|
actions: ["highlightLastItem"]
|
|
894
907
|
},
|
|
895
908
|
"INPUT.ENTER": [
|
|
909
|
+
// == group 1 ==
|
|
910
|
+
{
|
|
911
|
+
guard: and("isOpenControlled", "isCustomValue", not("hasHighlightedItem"), not("allowCustomValue")),
|
|
912
|
+
actions: ["revertInputValue", "invokeOnClose"]
|
|
913
|
+
},
|
|
914
|
+
{
|
|
915
|
+
guard: and("isCustomValue", not("hasHighlightedItem"), not("allowCustomValue")),
|
|
916
|
+
target: "focused",
|
|
917
|
+
actions: ["revertInputValue", "invokeOnClose"]
|
|
918
|
+
},
|
|
919
|
+
// == group 2 ==
|
|
896
920
|
{
|
|
897
921
|
guard: and("isOpenControlled", "closeOnSelect"),
|
|
898
922
|
actions: ["selectHighlightedItem", "invokeOnClose"]
|
package/dist/index.mjs
CHANGED
|
@@ -106,6 +106,8 @@ function connect(state, send, normalize) {
|
|
|
106
106
|
hasSelectedItems: state.context.hasSelectedItems,
|
|
107
107
|
selectedItems: state.context.selectedItems,
|
|
108
108
|
collection: state.context.collection,
|
|
109
|
+
multiple: !!state.context.multiple,
|
|
110
|
+
disabled: !!disabled,
|
|
109
111
|
reposition(options = {}) {
|
|
110
112
|
send({ type: "POSITIONING.SET", options });
|
|
111
113
|
},
|
|
@@ -734,6 +736,17 @@ function machine(userContext) {
|
|
|
734
736
|
}
|
|
735
737
|
],
|
|
736
738
|
"INPUT.ENTER": [
|
|
739
|
+
// == group 1 ==
|
|
740
|
+
{
|
|
741
|
+
guard: and("isOpenControlled", "isCustomValue", not("hasHighlightedItem"), not("allowCustomValue")),
|
|
742
|
+
actions: ["revertInputValue", "invokeOnClose"]
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
guard: and("isCustomValue", not("hasHighlightedItem"), not("allowCustomValue")),
|
|
746
|
+
target: "focused",
|
|
747
|
+
actions: ["revertInputValue", "invokeOnClose"]
|
|
748
|
+
},
|
|
749
|
+
// == group 2 ==
|
|
737
750
|
{
|
|
738
751
|
guard: and("isOpenControlled", "closeOnSelect"),
|
|
739
752
|
actions: ["selectHighlightedItem", "invokeOnClose"]
|
|
@@ -891,6 +904,17 @@ function machine(userContext) {
|
|
|
891
904
|
actions: ["highlightLastItem"]
|
|
892
905
|
},
|
|
893
906
|
"INPUT.ENTER": [
|
|
907
|
+
// == group 1 ==
|
|
908
|
+
{
|
|
909
|
+
guard: and("isOpenControlled", "isCustomValue", not("hasHighlightedItem"), not("allowCustomValue")),
|
|
910
|
+
actions: ["revertInputValue", "invokeOnClose"]
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
guard: and("isCustomValue", not("hasHighlightedItem"), not("allowCustomValue")),
|
|
914
|
+
target: "focused",
|
|
915
|
+
actions: ["revertInputValue", "invokeOnClose"]
|
|
916
|
+
},
|
|
917
|
+
// == group 2 ==
|
|
894
918
|
{
|
|
895
919
|
guard: and("isOpenControlled", "closeOnSelect"),
|
|
896
920
|
actions: ["selectHighlightedItem", "invokeOnClose"]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/combobox",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.73.0",
|
|
4
4
|
"description": "Core logic for the combobox widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -26,16 +26,16 @@
|
|
|
26
26
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@zag-js/anatomy": "0.
|
|
30
|
-
"@zag-js/aria-hidden": "0.
|
|
31
|
-
"@zag-js/collection": "0.
|
|
32
|
-
"@zag-js/core": "0.
|
|
33
|
-
"@zag-js/dismissable": "0.
|
|
34
|
-
"@zag-js/dom-query": "0.
|
|
35
|
-
"@zag-js/dom-event": "0.
|
|
36
|
-
"@zag-js/utils": "0.
|
|
37
|
-
"@zag-js/popper": "0.
|
|
38
|
-
"@zag-js/types": "0.
|
|
29
|
+
"@zag-js/anatomy": "0.73.0",
|
|
30
|
+
"@zag-js/aria-hidden": "0.73.0",
|
|
31
|
+
"@zag-js/collection": "0.73.0",
|
|
32
|
+
"@zag-js/core": "0.73.0",
|
|
33
|
+
"@zag-js/dismissable": "0.73.0",
|
|
34
|
+
"@zag-js/dom-query": "0.73.0",
|
|
35
|
+
"@zag-js/dom-event": "0.73.0",
|
|
36
|
+
"@zag-js/utils": "0.73.0",
|
|
37
|
+
"@zag-js/popper": "0.73.0",
|
|
38
|
+
"@zag-js/types": "0.73.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"clean-package": "2.2.0"
|