@react-aria/combobox 3.15.0 → 3.16.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.
Files changed (191) hide show
  1. package/dist/import.mjs +2 -2
  2. package/dist/main.js +2 -2
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +2 -2
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +2 -0
  7. package/package.json +15 -27
  8. package/src/index.ts +3 -3
  9. package/dist/ar-AE.main.js +0 -22
  10. package/dist/ar-AE.main.js.map +0 -1
  11. package/dist/ar-AE.mjs +0 -24
  12. package/dist/ar-AE.module.js +0 -24
  13. package/dist/ar-AE.module.js.map +0 -1
  14. package/dist/bg-BG.main.js +0 -22
  15. package/dist/bg-BG.main.js.map +0 -1
  16. package/dist/bg-BG.mjs +0 -24
  17. package/dist/bg-BG.module.js +0 -24
  18. package/dist/bg-BG.module.js.map +0 -1
  19. package/dist/cs-CZ.main.js +0 -22
  20. package/dist/cs-CZ.main.js.map +0 -1
  21. package/dist/cs-CZ.mjs +0 -24
  22. package/dist/cs-CZ.module.js +0 -24
  23. package/dist/cs-CZ.module.js.map +0 -1
  24. package/dist/da-DK.main.js +0 -22
  25. package/dist/da-DK.main.js.map +0 -1
  26. package/dist/da-DK.mjs +0 -24
  27. package/dist/da-DK.module.js +0 -24
  28. package/dist/da-DK.module.js.map +0 -1
  29. package/dist/de-DE.main.js +0 -22
  30. package/dist/de-DE.main.js.map +0 -1
  31. package/dist/de-DE.mjs +0 -24
  32. package/dist/de-DE.module.js +0 -24
  33. package/dist/de-DE.module.js.map +0 -1
  34. package/dist/el-GR.main.js +0 -22
  35. package/dist/el-GR.main.js.map +0 -1
  36. package/dist/el-GR.mjs +0 -24
  37. package/dist/el-GR.module.js +0 -24
  38. package/dist/el-GR.module.js.map +0 -1
  39. package/dist/en-US.main.js +0 -22
  40. package/dist/en-US.main.js.map +0 -1
  41. package/dist/en-US.mjs +0 -24
  42. package/dist/en-US.module.js +0 -24
  43. package/dist/en-US.module.js.map +0 -1
  44. package/dist/es-ES.main.js +0 -22
  45. package/dist/es-ES.main.js.map +0 -1
  46. package/dist/es-ES.mjs +0 -24
  47. package/dist/es-ES.module.js +0 -24
  48. package/dist/es-ES.module.js.map +0 -1
  49. package/dist/et-EE.main.js +0 -22
  50. package/dist/et-EE.main.js.map +0 -1
  51. package/dist/et-EE.mjs +0 -24
  52. package/dist/et-EE.module.js +0 -24
  53. package/dist/et-EE.module.js.map +0 -1
  54. package/dist/fi-FI.main.js +0 -22
  55. package/dist/fi-FI.main.js.map +0 -1
  56. package/dist/fi-FI.mjs +0 -24
  57. package/dist/fi-FI.module.js +0 -24
  58. package/dist/fi-FI.module.js.map +0 -1
  59. package/dist/fr-FR.main.js +0 -22
  60. package/dist/fr-FR.main.js.map +0 -1
  61. package/dist/fr-FR.mjs +0 -24
  62. package/dist/fr-FR.module.js +0 -24
  63. package/dist/fr-FR.module.js.map +0 -1
  64. package/dist/he-IL.main.js +0 -22
  65. package/dist/he-IL.main.js.map +0 -1
  66. package/dist/he-IL.mjs +0 -24
  67. package/dist/he-IL.module.js +0 -24
  68. package/dist/he-IL.module.js.map +0 -1
  69. package/dist/hr-HR.main.js +0 -22
  70. package/dist/hr-HR.main.js.map +0 -1
  71. package/dist/hr-HR.mjs +0 -24
  72. package/dist/hr-HR.module.js +0 -24
  73. package/dist/hr-HR.module.js.map +0 -1
  74. package/dist/hu-HU.main.js +0 -22
  75. package/dist/hu-HU.main.js.map +0 -1
  76. package/dist/hu-HU.mjs +0 -24
  77. package/dist/hu-HU.module.js +0 -24
  78. package/dist/hu-HU.module.js.map +0 -1
  79. package/dist/intlStrings.main.js +0 -108
  80. package/dist/intlStrings.main.js.map +0 -1
  81. package/dist/intlStrings.mjs +0 -110
  82. package/dist/intlStrings.module.js +0 -110
  83. package/dist/intlStrings.module.js.map +0 -1
  84. package/dist/it-IT.main.js +0 -22
  85. package/dist/it-IT.main.js.map +0 -1
  86. package/dist/it-IT.mjs +0 -24
  87. package/dist/it-IT.module.js +0 -24
  88. package/dist/it-IT.module.js.map +0 -1
  89. package/dist/ja-JP.main.js +0 -22
  90. package/dist/ja-JP.main.js.map +0 -1
  91. package/dist/ja-JP.mjs +0 -24
  92. package/dist/ja-JP.module.js +0 -24
  93. package/dist/ja-JP.module.js.map +0 -1
  94. package/dist/ko-KR.main.js +0 -22
  95. package/dist/ko-KR.main.js.map +0 -1
  96. package/dist/ko-KR.mjs +0 -24
  97. package/dist/ko-KR.module.js +0 -24
  98. package/dist/ko-KR.module.js.map +0 -1
  99. package/dist/lt-LT.main.js +0 -22
  100. package/dist/lt-LT.main.js.map +0 -1
  101. package/dist/lt-LT.mjs +0 -24
  102. package/dist/lt-LT.module.js +0 -24
  103. package/dist/lt-LT.module.js.map +0 -1
  104. package/dist/lv-LV.main.js +0 -22
  105. package/dist/lv-LV.main.js.map +0 -1
  106. package/dist/lv-LV.mjs +0 -24
  107. package/dist/lv-LV.module.js +0 -24
  108. package/dist/lv-LV.module.js.map +0 -1
  109. package/dist/nb-NO.main.js +0 -22
  110. package/dist/nb-NO.main.js.map +0 -1
  111. package/dist/nb-NO.mjs +0 -24
  112. package/dist/nb-NO.module.js +0 -24
  113. package/dist/nb-NO.module.js.map +0 -1
  114. package/dist/nl-NL.main.js +0 -22
  115. package/dist/nl-NL.main.js.map +0 -1
  116. package/dist/nl-NL.mjs +0 -24
  117. package/dist/nl-NL.module.js +0 -24
  118. package/dist/nl-NL.module.js.map +0 -1
  119. package/dist/pl-PL.main.js +0 -22
  120. package/dist/pl-PL.main.js.map +0 -1
  121. package/dist/pl-PL.mjs +0 -24
  122. package/dist/pl-PL.module.js +0 -24
  123. package/dist/pl-PL.module.js.map +0 -1
  124. package/dist/pt-BR.main.js +0 -22
  125. package/dist/pt-BR.main.js.map +0 -1
  126. package/dist/pt-BR.mjs +0 -24
  127. package/dist/pt-BR.module.js +0 -24
  128. package/dist/pt-BR.module.js.map +0 -1
  129. package/dist/pt-PT.main.js +0 -22
  130. package/dist/pt-PT.main.js.map +0 -1
  131. package/dist/pt-PT.mjs +0 -24
  132. package/dist/pt-PT.module.js +0 -24
  133. package/dist/pt-PT.module.js.map +0 -1
  134. package/dist/ro-RO.main.js +0 -22
  135. package/dist/ro-RO.main.js.map +0 -1
  136. package/dist/ro-RO.mjs +0 -24
  137. package/dist/ro-RO.module.js +0 -24
  138. package/dist/ro-RO.module.js.map +0 -1
  139. package/dist/ru-RU.main.js +0 -22
  140. package/dist/ru-RU.main.js.map +0 -1
  141. package/dist/ru-RU.mjs +0 -24
  142. package/dist/ru-RU.module.js +0 -24
  143. package/dist/ru-RU.module.js.map +0 -1
  144. package/dist/sk-SK.main.js +0 -22
  145. package/dist/sk-SK.main.js.map +0 -1
  146. package/dist/sk-SK.mjs +0 -24
  147. package/dist/sk-SK.module.js +0 -24
  148. package/dist/sk-SK.module.js.map +0 -1
  149. package/dist/sl-SI.main.js +0 -22
  150. package/dist/sl-SI.main.js.map +0 -1
  151. package/dist/sl-SI.mjs +0 -24
  152. package/dist/sl-SI.module.js +0 -24
  153. package/dist/sl-SI.module.js.map +0 -1
  154. package/dist/sr-SP.main.js +0 -22
  155. package/dist/sr-SP.main.js.map +0 -1
  156. package/dist/sr-SP.mjs +0 -24
  157. package/dist/sr-SP.module.js +0 -24
  158. package/dist/sr-SP.module.js.map +0 -1
  159. package/dist/sv-SE.main.js +0 -22
  160. package/dist/sv-SE.main.js.map +0 -1
  161. package/dist/sv-SE.mjs +0 -24
  162. package/dist/sv-SE.module.js +0 -24
  163. package/dist/sv-SE.module.js.map +0 -1
  164. package/dist/tr-TR.main.js +0 -22
  165. package/dist/tr-TR.main.js.map +0 -1
  166. package/dist/tr-TR.mjs +0 -24
  167. package/dist/tr-TR.module.js +0 -24
  168. package/dist/tr-TR.module.js.map +0 -1
  169. package/dist/types.d.ts +0 -50
  170. package/dist/types.d.ts.map +0 -1
  171. package/dist/uk-UA.main.js +0 -22
  172. package/dist/uk-UA.main.js.map +0 -1
  173. package/dist/uk-UA.mjs +0 -24
  174. package/dist/uk-UA.module.js +0 -24
  175. package/dist/uk-UA.module.js.map +0 -1
  176. package/dist/useComboBox.main.js +0 -375
  177. package/dist/useComboBox.main.js.map +0 -1
  178. package/dist/useComboBox.mjs +0 -370
  179. package/dist/useComboBox.module.js +0 -370
  180. package/dist/useComboBox.module.js.map +0 -1
  181. package/dist/zh-CN.main.js +0 -22
  182. package/dist/zh-CN.main.js.map +0 -1
  183. package/dist/zh-CN.mjs +0 -24
  184. package/dist/zh-CN.module.js +0 -24
  185. package/dist/zh-CN.module.js.map +0 -1
  186. package/dist/zh-TW.main.js +0 -22
  187. package/dist/zh-TW.main.js.map +0 -1
  188. package/dist/zh-TW.mjs +0 -24
  189. package/dist/zh-TW.module.js +0 -24
  190. package/dist/zh-TW.module.js.map +0 -1
  191. package/src/useComboBox.ts +0 -450
@@ -1,24 +0,0 @@
1
- var $69ba655c7853c08e$exports = {};
2
- $69ba655c7853c08e$exports = {
3
- "buttonLabel": `Visa f\xf6rslag`,
4
- "countAnnouncement": (args, formatter)=>`${formatter.plural(args.optionCount, {
5
- one: ()=>`${formatter.number(args.optionCount)} alternativ`,
6
- other: ()=>`${formatter.number(args.optionCount)} alternativ`
7
- })} tillg\xe4ngliga.`,
8
- "focusAnnouncement": (args, formatter)=>`${formatter.select({
9
- true: ()=>`Ingick i gruppen ${args.groupTitle} med ${formatter.plural(args.groupCount, {
10
- one: ()=>`${formatter.number(args.groupCount)} alternativ`,
11
- other: ()=>`${formatter.number(args.groupCount)} alternativ`
12
- })}. `,
13
- other: ``
14
- }, args.isGroupChange)}${args.optionText}${formatter.select({
15
- true: `, valda`,
16
- other: ``
17
- }, args.isSelected)}`,
18
- "listboxLabel": `F\xf6rslag`,
19
- "selectedAnnouncement": (args)=>`${args.optionText}, valda`
20
- };
21
-
22
-
23
- export {$69ba655c7853c08e$exports as default};
24
- //# sourceMappingURL=sv-SE.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,eAAe,CAAC,eAAY,CAAC;IAC/C,qBAAqB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,WAAW,EAAE;YAAC,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,WAAW,EAAE,WAAW,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,WAAW,EAAE,WAAW,CAAC;QAAA,GAAG,iBAAc,CAAC;IACjO,qBAAqB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC;YAAC,MAAM,IAAM,CAAC,iBAAiB,EAAE,KAAK,UAAU,CAAC,KAAK,EAAE,UAAU,MAAM,CAAC,KAAK,UAAU,EAAE;oBAAC,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,UAAU,EAAE,WAAW,CAAC;oBAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,UAAU,EAAE,WAAW,CAAC;gBAAA,GAAG,EAAE,CAAC;YAAE,OAAO,EAAE;QAAA,GAAG,KAAK,aAAa,IAAI,KAAK,UAAU,GAAG,UAAU,MAAM,CAAC;YAAC,MAAM,CAAC,OAAO,CAAC;YAAE,OAAO,EAAE;QAAA,GAAG,KAAK,UAAU,GAAG;IAClZ,gBAAgB,CAAC,UAAO,CAAC;IACzB,wBAAwB,CAAC,OAAS,GAAG,KAAK,UAAU,CAAC,OAAO,CAAC;AAC/D","sources":["packages/@react-aria/combobox/intl/sv-SE.json"],"sourcesContent":["{\n \"buttonLabel\": \"Visa förslag\",\n \"countAnnouncement\": \"{optionCount, plural, one {# alternativ} other {# alternativ}} tillgängliga.\",\n \"focusAnnouncement\": \"{isGroupChange, select, true {Ingick i gruppen {groupTitle} med {groupCount, plural, one {# alternativ} other {# alternativ}}. } other {}}{optionText}{isSelected, select, true {, valda} other {}}\",\n \"listboxLabel\": \"Förslag\",\n \"selectedAnnouncement\": \"{optionText}, valda\"\n}\n"],"names":[],"version":3,"file":"sv-SE.module.js.map"}
@@ -1,22 +0,0 @@
1
- module.exports = {
2
- "buttonLabel": `\xd6nerileri g\xf6ster`,
3
- "countAnnouncement": (args, formatter)=>`${formatter.plural(args.optionCount, {
4
- one: ()=>`${formatter.number(args.optionCount)} se\xe7enek`,
5
- other: ()=>`${formatter.number(args.optionCount)} se\xe7enekler`
6
- })} kullan\u{131}labilir.`,
7
- "focusAnnouncement": (args, formatter)=>`${formatter.select({
8
- true: ()=>`Girilen grup ${args.groupTitle}, ile ${formatter.plural(args.groupCount, {
9
- one: ()=>`${formatter.number(args.groupCount)} se\xe7enek`,
10
- other: ()=>`${formatter.number(args.groupCount)} se\xe7enekler`
11
- })}. `,
12
- other: ``
13
- }, args.isGroupChange)}${args.optionText}${formatter.select({
14
- true: `, se\xe7ildi`,
15
- other: ``
16
- }, args.isSelected)}`,
17
- "listboxLabel": `\xd6neriler`,
18
- "selectedAnnouncement": (args)=>`${args.optionText}, se\xe7ildi`
19
- };
20
-
21
-
22
- //# sourceMappingURL=tr-TR.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,eAAe,CAAC,sBAAgB,CAAC;IACnD,qBAAqB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,WAAW,EAAE;YAAC,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,WAAW,EAAE,WAAQ,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,WAAW,EAAE,cAAW,CAAC;QAAA,GAAG,sBAAgB,CAAC;IAChO,qBAAqB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC;YAAC,MAAM,IAAM,CAAC,aAAa,EAAE,KAAK,UAAU,CAAC,MAAM,EAAE,UAAU,MAAM,CAAC,KAAK,UAAU,EAAE;oBAAC,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,UAAU,EAAE,WAAQ,CAAC;oBAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,UAAU,EAAE,cAAW,CAAC;gBAAA,GAAG,EAAE,CAAC;YAAE,OAAO,EAAE;QAAA,GAAG,KAAK,aAAa,IAAI,KAAK,UAAU,GAAG,UAAU,MAAM,CAAC;YAAC,MAAM,CAAC,YAAS,CAAC;YAAE,OAAO,EAAE;QAAA,GAAG,KAAK,UAAU,GAAG;IAC9Y,gBAAgB,CAAC,WAAQ,CAAC;IAC1B,wBAAwB,CAAC,OAAS,GAAG,KAAK,UAAU,CAAC,YAAS,CAAC;AACjE","sources":["packages/@react-aria/combobox/intl/tr-TR.json"],"sourcesContent":["{\n \"buttonLabel\": \"Önerileri göster\",\n \"countAnnouncement\": \"{optionCount, plural, one {# seçenek} other {# seçenekler}} kullanılabilir.\",\n \"focusAnnouncement\": \"{isGroupChange, select, true {Girilen grup {groupTitle}, ile {groupCount, plural, one {# seçenek} other {# seçenekler}}. } other {}}{optionText}{isSelected, select, true {, seçildi} other {}}\",\n \"listboxLabel\": \"Öneriler\",\n \"selectedAnnouncement\": \"{optionText}, seçildi\"\n}\n"],"names":[],"version":3,"file":"tr-TR.main.js.map"}
package/dist/tr-TR.mjs DELETED
@@ -1,24 +0,0 @@
1
- var $a79794784d61577c$exports = {};
2
- $a79794784d61577c$exports = {
3
- "buttonLabel": `\xd6nerileri g\xf6ster`,
4
- "countAnnouncement": (args, formatter)=>`${formatter.plural(args.optionCount, {
5
- one: ()=>`${formatter.number(args.optionCount)} se\xe7enek`,
6
- other: ()=>`${formatter.number(args.optionCount)} se\xe7enekler`
7
- })} kullan\u{131}labilir.`,
8
- "focusAnnouncement": (args, formatter)=>`${formatter.select({
9
- true: ()=>`Girilen grup ${args.groupTitle}, ile ${formatter.plural(args.groupCount, {
10
- one: ()=>`${formatter.number(args.groupCount)} se\xe7enek`,
11
- other: ()=>`${formatter.number(args.groupCount)} se\xe7enekler`
12
- })}. `,
13
- other: ``
14
- }, args.isGroupChange)}${args.optionText}${formatter.select({
15
- true: `, se\xe7ildi`,
16
- other: ``
17
- }, args.isSelected)}`,
18
- "listboxLabel": `\xd6neriler`,
19
- "selectedAnnouncement": (args)=>`${args.optionText}, se\xe7ildi`
20
- };
21
-
22
-
23
- export {$a79794784d61577c$exports as default};
24
- //# sourceMappingURL=tr-TR.module.js.map
@@ -1,24 +0,0 @@
1
- var $a79794784d61577c$exports = {};
2
- $a79794784d61577c$exports = {
3
- "buttonLabel": `\xd6nerileri g\xf6ster`,
4
- "countAnnouncement": (args, formatter)=>`${formatter.plural(args.optionCount, {
5
- one: ()=>`${formatter.number(args.optionCount)} se\xe7enek`,
6
- other: ()=>`${formatter.number(args.optionCount)} se\xe7enekler`
7
- })} kullan\u{131}labilir.`,
8
- "focusAnnouncement": (args, formatter)=>`${formatter.select({
9
- true: ()=>`Girilen grup ${args.groupTitle}, ile ${formatter.plural(args.groupCount, {
10
- one: ()=>`${formatter.number(args.groupCount)} se\xe7enek`,
11
- other: ()=>`${formatter.number(args.groupCount)} se\xe7enekler`
12
- })}. `,
13
- other: ``
14
- }, args.isGroupChange)}${args.optionText}${formatter.select({
15
- true: `, se\xe7ildi`,
16
- other: ``
17
- }, args.isSelected)}`,
18
- "listboxLabel": `\xd6neriler`,
19
- "selectedAnnouncement": (args)=>`${args.optionText}, se\xe7ildi`
20
- };
21
-
22
-
23
- export {$a79794784d61577c$exports as default};
24
- //# sourceMappingURL=tr-TR.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,eAAe,CAAC,sBAAgB,CAAC;IACnD,qBAAqB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,WAAW,EAAE;YAAC,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,WAAW,EAAE,WAAQ,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,WAAW,EAAE,cAAW,CAAC;QAAA,GAAG,sBAAgB,CAAC;IAChO,qBAAqB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC;YAAC,MAAM,IAAM,CAAC,aAAa,EAAE,KAAK,UAAU,CAAC,MAAM,EAAE,UAAU,MAAM,CAAC,KAAK,UAAU,EAAE;oBAAC,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,UAAU,EAAE,WAAQ,CAAC;oBAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,UAAU,EAAE,cAAW,CAAC;gBAAA,GAAG,EAAE,CAAC;YAAE,OAAO,EAAE;QAAA,GAAG,KAAK,aAAa,IAAI,KAAK,UAAU,GAAG,UAAU,MAAM,CAAC;YAAC,MAAM,CAAC,YAAS,CAAC;YAAE,OAAO,EAAE;QAAA,GAAG,KAAK,UAAU,GAAG;IAC9Y,gBAAgB,CAAC,WAAQ,CAAC;IAC1B,wBAAwB,CAAC,OAAS,GAAG,KAAK,UAAU,CAAC,YAAS,CAAC;AACjE","sources":["packages/@react-aria/combobox/intl/tr-TR.json"],"sourcesContent":["{\n \"buttonLabel\": \"Önerileri göster\",\n \"countAnnouncement\": \"{optionCount, plural, one {# seçenek} other {# seçenekler}} kullanılabilir.\",\n \"focusAnnouncement\": \"{isGroupChange, select, true {Girilen grup {groupTitle}, ile {groupCount, plural, one {# seçenek} other {# seçenekler}}. } other {}}{optionText}{isSelected, select, true {, seçildi} other {}}\",\n \"listboxLabel\": \"Öneriler\",\n \"selectedAnnouncement\": \"{optionText}, seçildi\"\n}\n"],"names":[],"version":3,"file":"tr-TR.module.js.map"}
package/dist/types.d.ts DELETED
@@ -1,50 +0,0 @@
1
- import { AriaButtonProps } from "@react-types/button";
2
- import { AriaComboBoxProps, SelectionMode } from "@react-types/combobox";
3
- import { AriaListBoxOptions } from "@react-aria/listbox";
4
- import { DOMAttributes, KeyboardDelegate, LayoutDelegate, RefObject, ValidationResult } from "@react-types/shared";
5
- import { ComboBoxState } from "@react-stately/combobox";
6
- import { InputHTMLAttributes } from "react";
7
- export interface AriaComboBoxOptions<T, M extends SelectionMode = 'single'> extends Omit<AriaComboBoxProps<T, M>, 'children'> {
8
- /** The ref for the input element. */
9
- inputRef: RefObject<HTMLInputElement | null>;
10
- /** The ref for the list box popover. */
11
- popoverRef: RefObject<Element | null>;
12
- /** The ref for the list box. */
13
- listBoxRef: RefObject<HTMLElement | null>;
14
- /** The ref for the optional list box popup trigger button. */
15
- buttonRef?: RefObject<Element | null>;
16
- /** An optional keyboard delegate implementation, to override the default. */
17
- keyboardDelegate?: KeyboardDelegate;
18
- /**
19
- * A delegate object that provides layout information for items in the collection.
20
- * By default this uses the DOM, but this can be overridden to implement things like
21
- * virtualized scrolling.
22
- */
23
- layoutDelegate?: LayoutDelegate;
24
- }
25
- export interface ComboBoxAria<T> extends ValidationResult {
26
- /** Props for the label element. */
27
- labelProps: DOMAttributes;
28
- /** Props for the combo box input element. */
29
- inputProps: InputHTMLAttributes<HTMLInputElement>;
30
- /** Props for the list box, to be passed to `useListBox`. */
31
- listBoxProps: AriaListBoxOptions<T>;
32
- /** Props for the optional trigger button, to be passed to `useButton`. */
33
- buttonProps: AriaButtonProps;
34
- /** Props for the element representing the selected value. */
35
- valueProps: DOMAttributes;
36
- /** Props for the combo box description element, if any. */
37
- descriptionProps: DOMAttributes;
38
- /** Props for the combo box error message element, if any. */
39
- errorMessageProps: DOMAttributes;
40
- }
41
- /**
42
- * Provides the behavior and accessibility implementation for a combo box component.
43
- * A combo box combines a text input with a listbox, allowing users to filter a list of options to items matching a query.
44
- * @param props - Props for the combo box.
45
- * @param state - State for the select, as returned by `useComboBoxState`.
46
- */
47
- export function useComboBox<T, M extends SelectionMode = 'single'>(props: AriaComboBoxOptions<T, M>, state: ComboBoxState<T, M>): ComboBoxAria<T>;
48
- export type { AriaComboBoxProps } from '@react-types/combobox';
49
-
50
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;AAgCA,qCAAqC,CAAC,EAAE,CAAC,SAAS,aAAa,GAAG,QAAQ,CAAE,SAAQ,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC;IAC3H,qCAAqC;IACrC,QAAQ,EAAE,UAAU,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAC7C,wCAAwC;IACxC,UAAU,EAAE,UAAU,OAAO,GAAG,IAAI,CAAC,CAAC;IACtC,gCAAgC;IAChC,UAAU,EAAE,UAAU,WAAW,GAAG,IAAI,CAAC,CAAC;IAC1C,+DAA+D;IAC/D,SAAS,CAAC,EAAE,UAAU,OAAO,GAAG,IAAI,CAAC,CAAC;IACtC,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,CAAA;CAChC;AAED,8BAA8B,CAAC,CAAE,SAAQ,gBAAgB;IACvD,mCAAmC;IACnC,UAAU,EAAE,aAAa,CAAC;IAC1B,6CAA6C;IAC7C,UAAU,EAAE,oBAAoB,gBAAgB,CAAC,CAAC;IAClD,4DAA4D;IAC5D,YAAY,EAAE,mBAAmB,CAAC,CAAC,CAAC;IACpC,0EAA0E;IAC1E,WAAW,EAAE,eAAe,CAAC;IAC7B,6DAA6D;IAC7D,UAAU,EAAE,aAAa,CAAC;IAC1B,2DAA2D;IAC3D,gBAAgB,EAAE,aAAa,CAAC;IAChC,6DAA6D;IAC7D,iBAAiB,EAAE,aAAa,CAAA;CACjC;AAED;;;;;GAKG;AACH,4BAA4B,CAAC,EAAE,CAAC,SAAS,aAAa,GAAG,QAAQ,EAAE,KAAK,EAAE,oBAAoB,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CA6VhJ;AC1ZD,YAAY,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC","sources":["packages/@react-aria/combobox/src/packages/@react-aria/combobox/src/useComboBox.ts","packages/@react-aria/combobox/src/packages/@react-aria/combobox/src/index.ts","packages/@react-aria/combobox/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport {useComboBox} from './useComboBox';\nexport type {AriaComboBoxOptions, ComboBoxAria} from './useComboBox';\nexport type {AriaComboBoxProps} from '@react-types/combobox';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -1,22 +0,0 @@
1
- module.exports = {
2
- "buttonLabel": `\u{41F}\u{43E}\u{43A}\u{430}\u{437}\u{430}\u{442}\u{438} \u{43F}\u{440}\u{43E}\u{43F}\u{43E}\u{437}\u{438}\u{446}\u{456}\u{457}`,
3
- "countAnnouncement": (args, formatter)=>`${formatter.plural(args.optionCount, {
4
- one: ()=>`${formatter.number(args.optionCount)} \u{43F}\u{430}\u{440}\u{430}\u{43C}\u{435}\u{442}\u{440}`,
5
- other: ()=>`${formatter.number(args.optionCount)} \u{43F}\u{430}\u{440}\u{430}\u{43C}\u{435}\u{442}\u{440}\u{438}(-\u{456}\u{432})`
6
- })} \u{434}\u{43E}\u{441}\u{442}\u{443}\u{43F}\u{43D}\u{43E}.`,
7
- "focusAnnouncement": (args, formatter)=>`${formatter.select({
8
- true: ()=>`\u{412}\u{432}\u{435}\u{434}\u{435}\u{43D}\u{430} \u{433}\u{440}\u{443}\u{43F}\u{430} ${args.groupTitle}, \u{437} ${formatter.plural(args.groupCount, {
9
- one: ()=>`${formatter.number(args.groupCount)} \u{43F}\u{430}\u{440}\u{430}\u{43C}\u{435}\u{442}\u{440}`,
10
- other: ()=>`${formatter.number(args.groupCount)} \u{43F}\u{430}\u{440}\u{430}\u{43C}\u{435}\u{442}\u{440}\u{438}(-\u{456}\u{432})`
11
- })}. `,
12
- other: ``
13
- }, args.isGroupChange)}${args.optionText}${formatter.select({
14
- true: `, \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E}`,
15
- other: ``
16
- }, args.isSelected)}`,
17
- "listboxLabel": `\u{41F}\u{440}\u{43E}\u{43F}\u{43E}\u{437}\u{438}\u{446}\u{456}\u{457}`,
18
- "selectedAnnouncement": (args)=>`${args.optionText}, \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E}`
19
- };
20
-
21
-
22
- //# sourceMappingURL=uk-UA.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,eAAe,CAAC,+HAAmB,CAAC;IACtD,qBAAqB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,WAAW,EAAE;YAAC,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,WAAW,EAAE,yDAAS,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,WAAW,EAAE,iFAAe,CAAC;QAAA,GAAG,0DAAU,CAAC;IAC/N,qBAAqB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC;YAAC,MAAM,IAAM,CAAC,sFAAc,EAAE,KAAK,UAAU,CAAC,UAAI,EAAE,UAAU,MAAM,CAAC,KAAK,UAAU,EAAE;oBAAC,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,UAAU,EAAE,yDAAS,CAAC;oBAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,UAAU,EAAE,iFAAe,CAAC;gBAAA,GAAG,EAAE,CAAC;YAAE,OAAO,EAAE;QAAA,GAAG,KAAK,aAAa,IAAI,KAAK,UAAU,GAAG,UAAU,MAAM,CAAC;YAAC,MAAM,CAAC,mDAAS,CAAC;YAAE,OAAO,EAAE;QAAA,GAAG,KAAK,UAAU,GAAG;IAClZ,gBAAgB,CAAC,sEAAU,CAAC;IAC5B,wBAAwB,CAAC,OAAS,GAAG,KAAK,UAAU,CAAC,mDAAS,CAAC;AACjE","sources":["packages/@react-aria/combobox/intl/uk-UA.json"],"sourcesContent":["{\n \"buttonLabel\": \"Показати пропозиції\",\n \"countAnnouncement\": \"{optionCount, plural, one {# параметр} other {# параметри(-ів)}} доступно.\",\n \"focusAnnouncement\": \"{isGroupChange, select, true {Введена група {groupTitle}, з {groupCount, plural, one {# параметр} other {# параметри(-ів)}}. } other {}}{optionText}{isSelected, select, true {, вибрано} other {}}\",\n \"listboxLabel\": \"Пропозиції\",\n \"selectedAnnouncement\": \"{optionText}, вибрано\"\n}\n"],"names":[],"version":3,"file":"uk-UA.main.js.map"}
package/dist/uk-UA.mjs DELETED
@@ -1,24 +0,0 @@
1
- var $c2845791417ebaf4$exports = {};
2
- $c2845791417ebaf4$exports = {
3
- "buttonLabel": `\u{41F}\u{43E}\u{43A}\u{430}\u{437}\u{430}\u{442}\u{438} \u{43F}\u{440}\u{43E}\u{43F}\u{43E}\u{437}\u{438}\u{446}\u{456}\u{457}`,
4
- "countAnnouncement": (args, formatter)=>`${formatter.plural(args.optionCount, {
5
- one: ()=>`${formatter.number(args.optionCount)} \u{43F}\u{430}\u{440}\u{430}\u{43C}\u{435}\u{442}\u{440}`,
6
- other: ()=>`${formatter.number(args.optionCount)} \u{43F}\u{430}\u{440}\u{430}\u{43C}\u{435}\u{442}\u{440}\u{438}(-\u{456}\u{432})`
7
- })} \u{434}\u{43E}\u{441}\u{442}\u{443}\u{43F}\u{43D}\u{43E}.`,
8
- "focusAnnouncement": (args, formatter)=>`${formatter.select({
9
- true: ()=>`\u{412}\u{432}\u{435}\u{434}\u{435}\u{43D}\u{430} \u{433}\u{440}\u{443}\u{43F}\u{430} ${args.groupTitle}, \u{437} ${formatter.plural(args.groupCount, {
10
- one: ()=>`${formatter.number(args.groupCount)} \u{43F}\u{430}\u{440}\u{430}\u{43C}\u{435}\u{442}\u{440}`,
11
- other: ()=>`${formatter.number(args.groupCount)} \u{43F}\u{430}\u{440}\u{430}\u{43C}\u{435}\u{442}\u{440}\u{438}(-\u{456}\u{432})`
12
- })}. `,
13
- other: ``
14
- }, args.isGroupChange)}${args.optionText}${formatter.select({
15
- true: `, \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E}`,
16
- other: ``
17
- }, args.isSelected)}`,
18
- "listboxLabel": `\u{41F}\u{440}\u{43E}\u{43F}\u{43E}\u{437}\u{438}\u{446}\u{456}\u{457}`,
19
- "selectedAnnouncement": (args)=>`${args.optionText}, \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E}`
20
- };
21
-
22
-
23
- export {$c2845791417ebaf4$exports as default};
24
- //# sourceMappingURL=uk-UA.module.js.map
@@ -1,24 +0,0 @@
1
- var $c2845791417ebaf4$exports = {};
2
- $c2845791417ebaf4$exports = {
3
- "buttonLabel": `\u{41F}\u{43E}\u{43A}\u{430}\u{437}\u{430}\u{442}\u{438} \u{43F}\u{440}\u{43E}\u{43F}\u{43E}\u{437}\u{438}\u{446}\u{456}\u{457}`,
4
- "countAnnouncement": (args, formatter)=>`${formatter.plural(args.optionCount, {
5
- one: ()=>`${formatter.number(args.optionCount)} \u{43F}\u{430}\u{440}\u{430}\u{43C}\u{435}\u{442}\u{440}`,
6
- other: ()=>`${formatter.number(args.optionCount)} \u{43F}\u{430}\u{440}\u{430}\u{43C}\u{435}\u{442}\u{440}\u{438}(-\u{456}\u{432})`
7
- })} \u{434}\u{43E}\u{441}\u{442}\u{443}\u{43F}\u{43D}\u{43E}.`,
8
- "focusAnnouncement": (args, formatter)=>`${formatter.select({
9
- true: ()=>`\u{412}\u{432}\u{435}\u{434}\u{435}\u{43D}\u{430} \u{433}\u{440}\u{443}\u{43F}\u{430} ${args.groupTitle}, \u{437} ${formatter.plural(args.groupCount, {
10
- one: ()=>`${formatter.number(args.groupCount)} \u{43F}\u{430}\u{440}\u{430}\u{43C}\u{435}\u{442}\u{440}`,
11
- other: ()=>`${formatter.number(args.groupCount)} \u{43F}\u{430}\u{440}\u{430}\u{43C}\u{435}\u{442}\u{440}\u{438}(-\u{456}\u{432})`
12
- })}. `,
13
- other: ``
14
- }, args.isGroupChange)}${args.optionText}${formatter.select({
15
- true: `, \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E}`,
16
- other: ``
17
- }, args.isSelected)}`,
18
- "listboxLabel": `\u{41F}\u{440}\u{43E}\u{43F}\u{43E}\u{437}\u{438}\u{446}\u{456}\u{457}`,
19
- "selectedAnnouncement": (args)=>`${args.optionText}, \u{432}\u{438}\u{431}\u{440}\u{430}\u{43D}\u{43E}`
20
- };
21
-
22
-
23
- export {$c2845791417ebaf4$exports as default};
24
- //# sourceMappingURL=uk-UA.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,eAAe,CAAC,+HAAmB,CAAC;IACtD,qBAAqB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,WAAW,EAAE;YAAC,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,WAAW,EAAE,yDAAS,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,WAAW,EAAE,iFAAe,CAAC;QAAA,GAAG,0DAAU,CAAC;IAC/N,qBAAqB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC;YAAC,MAAM,IAAM,CAAC,sFAAc,EAAE,KAAK,UAAU,CAAC,UAAI,EAAE,UAAU,MAAM,CAAC,KAAK,UAAU,EAAE;oBAAC,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,UAAU,EAAE,yDAAS,CAAC;oBAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,UAAU,EAAE,iFAAe,CAAC;gBAAA,GAAG,EAAE,CAAC;YAAE,OAAO,EAAE;QAAA,GAAG,KAAK,aAAa,IAAI,KAAK,UAAU,GAAG,UAAU,MAAM,CAAC;YAAC,MAAM,CAAC,mDAAS,CAAC;YAAE,OAAO,EAAE;QAAA,GAAG,KAAK,UAAU,GAAG;IAClZ,gBAAgB,CAAC,sEAAU,CAAC;IAC5B,wBAAwB,CAAC,OAAS,GAAG,KAAK,UAAU,CAAC,mDAAS,CAAC;AACjE","sources":["packages/@react-aria/combobox/intl/uk-UA.json"],"sourcesContent":["{\n \"buttonLabel\": \"Показати пропозиції\",\n \"countAnnouncement\": \"{optionCount, plural, one {# параметр} other {# параметри(-ів)}} доступно.\",\n \"focusAnnouncement\": \"{isGroupChange, select, true {Введена група {groupTitle}, з {groupCount, plural, one {# параметр} other {# параметри(-ів)}}. } other {}}{optionText}{isSelected, select, true {, вибрано} other {}}\",\n \"listboxLabel\": \"Пропозиції\",\n \"selectedAnnouncement\": \"{optionText}, вибрано\"\n}\n"],"names":[],"version":3,"file":"uk-UA.module.js.map"}
@@ -1,375 +0,0 @@
1
- var $8d1e5da058b86bb9$exports = require("./intlStrings.main.js");
2
- var $BGXP4$reactarialiveannouncer = require("@react-aria/live-announcer");
3
- var $BGXP4$reactariaoverlays = require("@react-aria/overlays");
4
- var $BGXP4$reactarialistbox = require("@react-aria/listbox");
5
- var $BGXP4$reactariautils = require("@react-aria/utils");
6
- var $BGXP4$reactariafocus = require("@react-aria/focus");
7
- var $BGXP4$react = require("react");
8
- var $BGXP4$reactstatelycollections = require("@react-stately/collections");
9
- var $BGXP4$reactariaselection = require("@react-aria/selection");
10
- var $BGXP4$reactstatelyform = require("@react-stately/form");
11
- var $BGXP4$reactariainteractions = require("@react-aria/interactions");
12
- var $BGXP4$reactariai18n = require("@react-aria/i18n");
13
- var $BGXP4$reactariamenu = require("@react-aria/menu");
14
- var $BGXP4$reactariatextfield = require("@react-aria/textfield");
15
-
16
-
17
- function $parcel$interopDefault(a) {
18
- return a && a.__esModule ? a.default : a;
19
- }
20
-
21
- function $parcel$export(e, n, v, s) {
22
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
23
- }
24
-
25
- $parcel$export(module.exports, "useComboBox", () => $242452271d1e4c0e$export$8c18d1b4f7232bbf);
26
- /*
27
- * Copyright 2020 Adobe. All rights reserved.
28
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
29
- * you may not use this file except in compliance with the License. You may obtain a copy
30
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
31
- *
32
- * Unless required by applicable law or agreed to in writing, software distributed under
33
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
34
- * OF ANY KIND, either express or implied. See the License for the specific language
35
- * governing permissions and limitations under the License.
36
- */
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
- function $242452271d1e4c0e$export$8c18d1b4f7232bbf(props, state) {
51
- let { buttonRef: buttonRef, popoverRef: popoverRef, inputRef: inputRef, listBoxRef: listBoxRef, keyboardDelegate: keyboardDelegate, layoutDelegate: layoutDelegate, shouldFocusWrap: // completionMode = 'suggest',
52
- shouldFocusWrap, isReadOnly: isReadOnly, isDisabled: isDisabled } = props;
53
- let backupBtnRef = (0, $BGXP4$react.useRef)(null);
54
- buttonRef = buttonRef !== null && buttonRef !== void 0 ? buttonRef : backupBtnRef;
55
- let stringFormatter = (0, $BGXP4$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($8d1e5da058b86bb9$exports))), '@react-aria/combobox');
56
- let { menuTriggerProps: menuTriggerProps, menuProps: menuProps } = (0, $BGXP4$reactariamenu.useMenuTrigger)({
57
- type: 'listbox',
58
- isDisabled: isDisabled || isReadOnly
59
- }, state, buttonRef);
60
- // Set listbox id so it can be used when calling getItemId later
61
- (0, $BGXP4$reactarialistbox.listData).set(state, {
62
- id: menuProps.id
63
- });
64
- // By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).
65
- // When virtualized, the layout object will be passed in as a prop and override this.
66
- let { collection: collection } = state;
67
- let { disabledKeys: disabledKeys } = state.selectionManager;
68
- let delegate = (0, $BGXP4$react.useMemo)(()=>keyboardDelegate || new (0, $BGXP4$reactariaselection.ListKeyboardDelegate)({
69
- collection: collection,
70
- disabledKeys: disabledKeys,
71
- ref: listBoxRef,
72
- layoutDelegate: layoutDelegate
73
- }), [
74
- keyboardDelegate,
75
- layoutDelegate,
76
- collection,
77
- disabledKeys,
78
- listBoxRef
79
- ]);
80
- // Use useSelectableCollection to get the keyboard handlers to apply to the textfield
81
- let { collectionProps: collectionProps } = (0, $BGXP4$reactariaselection.useSelectableCollection)({
82
- selectionManager: state.selectionManager,
83
- keyboardDelegate: delegate,
84
- disallowTypeAhead: true,
85
- disallowEmptySelection: true,
86
- shouldFocusWrap: shouldFocusWrap,
87
- ref: inputRef,
88
- // Prevent item scroll behavior from being applied here, should be handled in the user's Popover + ListBox component
89
- isVirtualized: true
90
- });
91
- let router = (0, $BGXP4$reactariautils.useRouter)();
92
- // For textfield specific keydown operations
93
- let onKeyDown = (e)=>{
94
- if (e.nativeEvent.isComposing) return;
95
- switch(e.key){
96
- case 'Enter':
97
- case 'Tab':
98
- // Prevent form submission if menu is open since we may be selecting a option
99
- if (state.isOpen && e.key === 'Enter') e.preventDefault();
100
- // If the focused item is a link, trigger opening it. Items that are links are not selectable.
101
- if (state.isOpen && listBoxRef.current && state.selectionManager.focusedKey != null) {
102
- let collectionItem = state.collection.getItem(state.selectionManager.focusedKey);
103
- if (collectionItem === null || collectionItem === void 0 ? void 0 : collectionItem.props.href) {
104
- let item = listBoxRef.current.querySelector(`[data-key="${CSS.escape(state.selectionManager.focusedKey.toString())}"]`);
105
- if (e.key === 'Enter' && item instanceof HTMLAnchorElement) router.open(item, e, collectionItem.props.href, collectionItem.props.routerOptions);
106
- state.close();
107
- break;
108
- } else if (collectionItem === null || collectionItem === void 0 ? void 0 : collectionItem.props.onAction) {
109
- collectionItem.props.onAction();
110
- state.close();
111
- break;
112
- }
113
- }
114
- state.commit();
115
- break;
116
- case 'Escape':
117
- if (!state.selectionManager.isEmpty || state.inputValue === '' || props.allowsCustomValue) e.continuePropagation();
118
- state.revert();
119
- break;
120
- case 'ArrowDown':
121
- state.open('first', 'manual');
122
- break;
123
- case 'ArrowUp':
124
- state.open('last', 'manual');
125
- break;
126
- case 'ArrowLeft':
127
- case 'ArrowRight':
128
- state.selectionManager.setFocusedKey(null);
129
- break;
130
- }
131
- };
132
- let onBlur = (e)=>{
133
- let blurFromButton = (buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) && buttonRef.current === e.relatedTarget;
134
- let blurIntoPopover = (0, $BGXP4$reactariautils.nodeContains)(popoverRef.current, e.relatedTarget);
135
- // Ignore blur if focused moved to the button(if exists) or into the popover.
136
- if (blurFromButton || blurIntoPopover) return;
137
- if (props.onBlur) props.onBlur(e);
138
- state.setFocused(false);
139
- };
140
- let onFocus = (e)=>{
141
- if (state.isFocused) return;
142
- if (props.onFocus) props.onFocus(e);
143
- state.setFocused(true);
144
- };
145
- let valueId = $242452271d1e4c0e$var$useValueId([
146
- state.selectedItems,
147
- state.selectionManager.selectionMode
148
- ]);
149
- let { isInvalid: isInvalid, validationErrors: validationErrors, validationDetails: validationDetails } = state.displayValidation;
150
- let { labelProps: labelProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $BGXP4$reactariatextfield.useTextField)({
151
- ...props,
152
- onChange: state.setInputValue,
153
- onKeyDown: !isReadOnly ? (0, $BGXP4$reactariautils.chain)(state.isOpen && collectionProps.onKeyDown, onKeyDown, props.onKeyDown) : props.onKeyDown,
154
- onBlur: onBlur,
155
- value: state.inputValue,
156
- defaultValue: state.defaultInputValue,
157
- onFocus: onFocus,
158
- autoComplete: 'off',
159
- validate: undefined,
160
- [(0, $BGXP4$reactstatelyform.privateValidationStateProp)]: state,
161
- 'aria-describedby': [
162
- valueId,
163
- props['aria-describedby']
164
- ].filter(Boolean).join(' ') || undefined
165
- }, inputRef);
166
- (0, $BGXP4$reactariautils.useFormReset)(inputRef, state.defaultValue, state.setValue);
167
- // Press handlers for the ComboBox button
168
- let onPress = (e)=>{
169
- if (e.pointerType === 'touch') {
170
- var // Focus the input field in case it isn't focused yet
171
- _inputRef_current;
172
- (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
173
- state.toggle(null, 'manual');
174
- }
175
- };
176
- let onPressStart = (e)=>{
177
- if (e.pointerType !== 'touch') {
178
- var _inputRef_current;
179
- (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
180
- state.toggle(e.pointerType === 'keyboard' || e.pointerType === 'virtual' ? 'first' : null, 'manual');
181
- }
182
- };
183
- let triggerLabelProps = (0, $BGXP4$reactariautils.useLabels)({
184
- id: menuTriggerProps.id,
185
- 'aria-label': stringFormatter.format('buttonLabel'),
186
- 'aria-labelledby': props['aria-labelledby'] || labelProps.id
187
- });
188
- let listBoxProps = (0, $BGXP4$reactariautils.useLabels)({
189
- id: menuProps.id,
190
- 'aria-label': stringFormatter.format('listboxLabel'),
191
- 'aria-labelledby': props['aria-labelledby'] || labelProps.id
192
- });
193
- // If a touch happens on direct center of ComboBox input, might be virtual click from iPad so open ComboBox menu
194
- let lastEventTime = (0, $BGXP4$react.useRef)(0);
195
- let onTouchEnd = (e)=>{
196
- if (isDisabled || isReadOnly) return;
197
- // Sometimes VoiceOver on iOS fires two touchend events in quick succession. Ignore the second one.
198
- if (e.timeStamp - lastEventTime.current < 500) {
199
- var _inputRef_current;
200
- e.preventDefault();
201
- (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
202
- return;
203
- }
204
- let rect = (0, $BGXP4$reactariautils.getEventTarget)(e).getBoundingClientRect();
205
- let touch = e.changedTouches[0];
206
- let centerX = Math.ceil(rect.left + .5 * rect.width);
207
- let centerY = Math.ceil(rect.top + .5 * rect.height);
208
- if (touch.clientX === centerX && touch.clientY === centerY) {
209
- var _inputRef_current1;
210
- e.preventDefault();
211
- (_inputRef_current1 = inputRef.current) === null || _inputRef_current1 === void 0 ? void 0 : _inputRef_current1.focus();
212
- state.toggle(null, 'manual');
213
- lastEventTime.current = e.timeStamp;
214
- }
215
- };
216
- // VoiceOver has issues with announcing aria-activedescendant properly on change
217
- // (especially on iOS). We use a live region announcer to announce focus changes
218
- // manually. In addition, section titles are announced when navigating into a new section.
219
- let focusedItem = state.selectionManager.focusedKey != null && state.isOpen ? state.collection.getItem(state.selectionManager.focusedKey) : undefined;
220
- var _focusedItem_parentKey;
221
- let sectionKey = (_focusedItem_parentKey = focusedItem === null || focusedItem === void 0 ? void 0 : focusedItem.parentKey) !== null && _focusedItem_parentKey !== void 0 ? _focusedItem_parentKey : null;
222
- var _state_selectionManager_focusedKey;
223
- let itemKey = (_state_selectionManager_focusedKey = state.selectionManager.focusedKey) !== null && _state_selectionManager_focusedKey !== void 0 ? _state_selectionManager_focusedKey : null;
224
- let lastSection = (0, $BGXP4$react.useRef)(sectionKey);
225
- let lastItem = (0, $BGXP4$react.useRef)(itemKey);
226
- (0, $BGXP4$react.useEffect)(()=>{
227
- if ((0, $BGXP4$reactariautils.isAppleDevice)() && focusedItem != null && itemKey != null && itemKey !== lastItem.current) {
228
- let isSelected = state.selectionManager.isSelected(itemKey);
229
- let section = sectionKey != null ? state.collection.getItem(sectionKey) : null;
230
- let sectionTitle = (section === null || section === void 0 ? void 0 : section['aria-label']) || (typeof (section === null || section === void 0 ? void 0 : section.rendered) === 'string' ? section.rendered : '') || '';
231
- var _ref;
232
- let announcement = stringFormatter.format('focusAnnouncement', {
233
- isGroupChange: (_ref = section && sectionKey !== lastSection.current) !== null && _ref !== void 0 ? _ref : false,
234
- groupTitle: sectionTitle,
235
- groupCount: section ? [
236
- ...(0, $BGXP4$reactstatelycollections.getChildNodes)(section, state.collection)
237
- ].length : 0,
238
- optionText: focusedItem['aria-label'] || focusedItem.textValue || '',
239
- isSelected: isSelected
240
- });
241
- (0, $BGXP4$reactarialiveannouncer.announce)(announcement);
242
- }
243
- lastSection.current = sectionKey;
244
- lastItem.current = itemKey;
245
- });
246
- // Announce the number of available suggestions when it changes
247
- let optionCount = (0, $BGXP4$reactstatelycollections.getItemCount)(state.collection);
248
- let lastSize = (0, $BGXP4$react.useRef)(optionCount);
249
- let lastOpen = (0, $BGXP4$react.useRef)(state.isOpen);
250
- (0, $BGXP4$react.useEffect)(()=>{
251
- // Only announce the number of options available when the menu opens if there is no
252
- // focused item, otherwise screen readers will typically read e.g. "1 of 6".
253
- // The exception is VoiceOver since this isn't included in the message above.
254
- let didOpenWithoutFocusedItem = state.isOpen !== lastOpen.current && (state.selectionManager.focusedKey == null || (0, $BGXP4$reactariautils.isAppleDevice)());
255
- if (state.isOpen && (didOpenWithoutFocusedItem || optionCount !== lastSize.current)) {
256
- let announcement = stringFormatter.format('countAnnouncement', {
257
- optionCount: optionCount
258
- });
259
- (0, $BGXP4$reactarialiveannouncer.announce)(announcement);
260
- }
261
- lastSize.current = optionCount;
262
- lastOpen.current = state.isOpen;
263
- });
264
- // Announce when a selection occurs for VoiceOver. Other screen readers typically do this automatically.
265
- // TODO: do we need to do this for multi-select?
266
- let lastSelectedKey = (0, $BGXP4$react.useRef)(state.selectedKey);
267
- (0, $BGXP4$react.useEffect)(()=>{
268
- if ((0, $BGXP4$reactariautils.isAppleDevice)() && state.isFocused && state.selectedItem && state.selectedKey !== lastSelectedKey.current) {
269
- let optionText = state.selectedItem['aria-label'] || state.selectedItem.textValue || '';
270
- let announcement = stringFormatter.format('selectedAnnouncement', {
271
- optionText: optionText
272
- });
273
- (0, $BGXP4$reactarialiveannouncer.announce)(announcement);
274
- }
275
- lastSelectedKey.current = state.selectedKey;
276
- });
277
- (0, $BGXP4$react.useEffect)(()=>{
278
- if (state.isOpen) return (0, $BGXP4$reactariaoverlays.ariaHideOutside)([
279
- inputRef.current,
280
- popoverRef.current
281
- ].filter((element)=>element != null));
282
- }, [
283
- state.isOpen,
284
- inputRef,
285
- popoverRef
286
- ]);
287
- (0, $BGXP4$reactariautils.useUpdateEffect)(()=>{
288
- // Re-show focus ring when there is no virtually focused item.
289
- if (!focusedItem && inputRef.current && (0, $BGXP4$reactariautils.getActiveElement)((0, $BGXP4$reactariautils.getOwnerDocument)(inputRef.current)) === inputRef.current) (0, $BGXP4$reactariafocus.dispatchVirtualFocus)(inputRef.current, null);
290
- }, [
291
- focusedItem
292
- ]);
293
- (0, $BGXP4$reactariautils.useEvent)(listBoxRef, 'react-aria-item-action', state.isOpen ? ()=>{
294
- state.close();
295
- } : undefined);
296
- // usePopover -> useOverlay calls useInteractOutside, but ComboBox is non-modal, so `isDismissable` is false
297
- // Because of this, onInteractOutside is not passed to useInteractOutside, so we need to call it here.
298
- (0, $BGXP4$reactariainteractions.useInteractOutside)({
299
- ref: popoverRef,
300
- onInteractOutside: (e)=>{
301
- let target = (0, $BGXP4$reactariautils.getEventTarget)(e);
302
- if ((0, $BGXP4$reactariautils.nodeContains)(buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current, target) || (0, $BGXP4$reactariautils.nodeContains)(inputRef.current, target)) return;
303
- state.close();
304
- },
305
- isDisabled: !state.isOpen
306
- });
307
- return {
308
- labelProps: labelProps,
309
- buttonProps: {
310
- ...menuTriggerProps,
311
- ...triggerLabelProps,
312
- excludeFromTabOrder: true,
313
- preventFocusOnPress: true,
314
- onPress: onPress,
315
- onPressStart: onPressStart,
316
- isDisabled: isDisabled || isReadOnly
317
- },
318
- inputProps: (0, $BGXP4$reactariautils.mergeProps)(inputProps, {
319
- role: 'combobox',
320
- 'aria-expanded': menuTriggerProps['aria-expanded'],
321
- 'aria-controls': state.isOpen ? menuProps.id : undefined,
322
- // TODO: readd proper logic for completionMode = complete (aria-autocomplete: both)
323
- 'aria-autocomplete': 'list',
324
- 'aria-activedescendant': focusedItem ? (0, $BGXP4$reactarialistbox.getItemId)(state, focusedItem.key) : undefined,
325
- onTouchEnd: onTouchEnd,
326
- // This disable's iOS's autocorrect suggestions, since the combo box provides its own suggestions.
327
- autoCorrect: 'off',
328
- // This disable's the macOS Safari spell check auto corrections.
329
- spellCheck: 'false'
330
- }),
331
- listBoxProps: (0, $BGXP4$reactariautils.mergeProps)(menuProps, listBoxProps, {
332
- autoFocus: state.focusStrategy || true,
333
- shouldUseVirtualFocus: true,
334
- shouldSelectOnPressUp: true,
335
- shouldFocusOnHover: true,
336
- linkBehavior: 'selection',
337
- ['UNSTABLE_itemBehavior']: 'action'
338
- }),
339
- valueProps: {
340
- id: valueId
341
- },
342
- descriptionProps: descriptionProps,
343
- errorMessageProps: errorMessageProps,
344
- isInvalid: isInvalid,
345
- validationErrors: validationErrors,
346
- validationDetails: validationDetails
347
- };
348
- }
349
- // This is a modified version of useSlotId that uses useEffect instead of useLayoutEffect.
350
- // Triggering re-renders from useLayoutEffect breaks useComboBoxState's useEffect logic in React 18.
351
- // These re-renders preempt async state updates in the useEffect, which ends up running multiple times
352
- // prior to the state being updated. This results in onSelectionChange being called multiple times.
353
- // TODO: refactor useComboBoxState to avoid this.
354
- function $242452271d1e4c0e$var$useValueId(depArray = []) {
355
- let id = (0, $BGXP4$reactariautils.useId)();
356
- let [exists, setExists] = (0, $BGXP4$react.useState)(true);
357
- let [lastDeps, setLastDeps] = (0, $BGXP4$react.useState)(depArray);
358
- // If the deps changed, set exists to true so we can test whether the element exists.
359
- if (lastDeps.some((v, i)=>!Object.is(v, depArray[i]))) {
360
- setExists(true);
361
- setLastDeps(depArray);
362
- }
363
- (0, $BGXP4$react.useEffect)(()=>{
364
- if (exists && !document.getElementById(id)) // eslint-disable-next-line react-hooks/set-state-in-effect
365
- setExists(false);
366
- }, [
367
- id,
368
- exists,
369
- lastDeps
370
- ]);
371
- return exists ? id : undefined;
372
- }
373
-
374
-
375
- //# sourceMappingURL=useComboBox.main.js.map