@fluentui/react-combobox 9.3.4 → 9.4.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 (207) hide show
  1. package/CHANGELOG.json +66 -1
  2. package/CHANGELOG.md +22 -2
  3. package/dist/index.d.ts +2 -2
  4. package/lib/Combobox.js +0 -1
  5. package/lib/Combobox.js.map +1 -1
  6. package/lib/Dropdown.js +0 -1
  7. package/lib/Dropdown.js.map +1 -1
  8. package/lib/Listbox.js +0 -1
  9. package/lib/Listbox.js.map +1 -1
  10. package/lib/Option.js +0 -1
  11. package/lib/Option.js.map +1 -1
  12. package/lib/OptionGroup.js +0 -1
  13. package/lib/OptionGroup.js.map +1 -1
  14. package/lib/Selection.js +1 -0
  15. package/lib/Selection.js.map +1 -0
  16. package/lib/components/Combobox/Combobox.js +6 -8
  17. package/lib/components/Combobox/Combobox.js.map +1 -1
  18. package/lib/components/Combobox/Combobox.types.js +0 -1
  19. package/lib/components/Combobox/Combobox.types.js.map +1 -1
  20. package/lib/components/Combobox/index.js +0 -1
  21. package/lib/components/Combobox/index.js.map +1 -1
  22. package/lib/components/Combobox/renderCombobox.js +6 -11
  23. package/lib/components/Combobox/renderCombobox.js.map +1 -1
  24. package/lib/components/Combobox/useCombobox.js +228 -251
  25. package/lib/components/Combobox/useCombobox.js.map +1 -1
  26. package/lib/components/Combobox/useComboboxStyles.styles.js.map +1 -1
  27. package/lib/components/Dropdown/Dropdown.js +6 -8
  28. package/lib/components/Dropdown/Dropdown.js.map +1 -1
  29. package/lib/components/Dropdown/Dropdown.types.js +1 -2
  30. package/lib/components/Dropdown/Dropdown.types.js.map +1 -1
  31. package/lib/components/Dropdown/index.js +0 -1
  32. package/lib/components/Dropdown/index.js.map +1 -1
  33. package/lib/components/Dropdown/renderDropdown.js +6 -11
  34. package/lib/components/Dropdown/renderDropdown.js.map +1 -1
  35. package/lib/components/Dropdown/useDropdown.js +127 -136
  36. package/lib/components/Dropdown/useDropdown.js.map +1 -1
  37. package/lib/components/Dropdown/useDropdownStyles.styles.js.map +1 -1
  38. package/lib/components/Listbox/Listbox.js +6 -8
  39. package/lib/components/Listbox/Listbox.js.map +1 -1
  40. package/lib/components/Listbox/Listbox.types.js +1 -2
  41. package/lib/components/Listbox/Listbox.types.js.map +1 -1
  42. package/lib/components/Listbox/index.js +0 -1
  43. package/lib/components/Listbox/index.js.map +1 -1
  44. package/lib/components/Listbox/renderListbox.js +6 -11
  45. package/lib/components/Listbox/renderListbox.js.map +1 -1
  46. package/lib/components/Listbox/useListbox.js +77 -89
  47. package/lib/components/Listbox/useListbox.js.map +1 -1
  48. package/lib/components/Listbox/useListboxStyles.styles.js.map +1 -1
  49. package/lib/components/Option/Option.js +5 -7
  50. package/lib/components/Option/Option.js.map +1 -1
  51. package/lib/components/Option/Option.types.js +0 -1
  52. package/lib/components/Option/Option.types.js.map +1 -1
  53. package/lib/components/Option/index.js +0 -1
  54. package/lib/components/Option/index.js.map +1 -1
  55. package/lib/components/Option/renderOption.js +4 -9
  56. package/lib/components/Option/renderOption.js.map +1 -1
  57. package/lib/components/Option/useOption.js +115 -113
  58. package/lib/components/Option/useOption.js.map +1 -1
  59. package/lib/components/Option/useOptionStyles.styles.js.map +1 -1
  60. package/lib/components/OptionGroup/OptionGroup.js +5 -7
  61. package/lib/components/OptionGroup/OptionGroup.js.map +1 -1
  62. package/lib/components/OptionGroup/OptionGroup.types.js +1 -2
  63. package/lib/components/OptionGroup/OptionGroup.types.js.map +1 -1
  64. package/lib/components/OptionGroup/index.js +0 -1
  65. package/lib/components/OptionGroup/index.js.map +1 -1
  66. package/lib/components/OptionGroup/renderOptionGroup.js +4 -9
  67. package/lib/components/OptionGroup/renderOptionGroup.js.map +1 -1
  68. package/lib/components/OptionGroup/useOptionGroup.js +21 -25
  69. package/lib/components/OptionGroup/useOptionGroup.js.map +1 -1
  70. package/lib/components/OptionGroup/useOptionGroupStyles.styles.js.map +1 -1
  71. package/lib/contexts/ComboboxContext.js +16 -17
  72. package/lib/contexts/ComboboxContext.js.map +1 -1
  73. package/lib/contexts/ListboxContext.js +12 -13
  74. package/lib/contexts/ListboxContext.js.map +1 -1
  75. package/lib/contexts/useComboboxContextValues.js +16 -28
  76. package/lib/contexts/useComboboxContextValues.js.map +1 -1
  77. package/lib/contexts/useListboxContextValues.js +17 -26
  78. package/lib/contexts/useListboxContextValues.js.map +1 -1
  79. package/lib/index.js +0 -1
  80. package/lib/index.js.map +1 -1
  81. package/lib/utils/ComboboxBase.types.js +0 -1
  82. package/lib/utils/ComboboxBase.types.js.map +1 -1
  83. package/lib/utils/OptionCollection.types.js +1 -2
  84. package/lib/utils/OptionCollection.types.js.map +1 -1
  85. package/lib/utils/Selection.types.js +0 -1
  86. package/lib/utils/Selection.types.js.map +1 -1
  87. package/lib/utils/dropdownKeyActions.js +66 -77
  88. package/lib/utils/dropdownKeyActions.js.map +1 -1
  89. package/lib/utils/internalTokens.js +3 -4
  90. package/lib/utils/internalTokens.js.map +1 -1
  91. package/lib/utils/useComboboxBaseState.js +94 -96
  92. package/lib/utils/useComboboxBaseState.js.map +1 -1
  93. package/lib/utils/useComboboxPopup.js +33 -30
  94. package/lib/utils/useComboboxPopup.js.map +1 -1
  95. package/lib/utils/useOptionCollection.js +65 -64
  96. package/lib/utils/useOptionCollection.js.map +1 -1
  97. package/lib/utils/useScrollOptionsIntoView.js +25 -32
  98. package/lib/utils/useScrollOptionsIntoView.js.map +1 -1
  99. package/lib/utils/useSelection.js +57 -49
  100. package/lib/utils/useSelection.js.map +1 -1
  101. package/lib/utils/useTriggerListboxSlots.js +105 -119
  102. package/lib/utils/useTriggerListboxSlots.js.map +1 -1
  103. package/lib-commonjs/Combobox.js +0 -3
  104. package/lib-commonjs/Combobox.js.map +1 -1
  105. package/lib-commonjs/Dropdown.js +0 -3
  106. package/lib-commonjs/Dropdown.js.map +1 -1
  107. package/lib-commonjs/Listbox.js +0 -3
  108. package/lib-commonjs/Listbox.js.map +1 -1
  109. package/lib-commonjs/Option.js +0 -3
  110. package/lib-commonjs/Option.js.map +1 -1
  111. package/lib-commonjs/OptionGroup.js +0 -3
  112. package/lib-commonjs/OptionGroup.js.map +1 -1
  113. package/lib-commonjs/Selection.js +6 -0
  114. package/lib-commonjs/Selection.js.map +1 -0
  115. package/lib-commonjs/components/Combobox/Combobox.js +1 -3
  116. package/lib-commonjs/components/Combobox/Combobox.js.map +1 -1
  117. package/lib-commonjs/components/Combobox/Combobox.types.js +0 -3
  118. package/lib-commonjs/components/Combobox/Combobox.types.js.map +1 -1
  119. package/lib-commonjs/components/Combobox/index.js +0 -3
  120. package/lib-commonjs/components/Combobox/index.js.map +1 -1
  121. package/lib-commonjs/components/Combobox/renderCombobox.js +1 -3
  122. package/lib-commonjs/components/Combobox/renderCombobox.js.map +1 -1
  123. package/lib-commonjs/components/Combobox/useCombobox.js +1 -3
  124. package/lib-commonjs/components/Combobox/useCombobox.js.map +1 -1
  125. package/lib-commonjs/components/Combobox/useComboboxStyles.styles.js +0 -2
  126. package/lib-commonjs/components/Combobox/useComboboxStyles.styles.js.map +1 -1
  127. package/lib-commonjs/components/Dropdown/Dropdown.js +1 -3
  128. package/lib-commonjs/components/Dropdown/Dropdown.js.map +1 -1
  129. package/lib-commonjs/components/Dropdown/Dropdown.types.js +0 -3
  130. package/lib-commonjs/components/Dropdown/Dropdown.types.js.map +1 -1
  131. package/lib-commonjs/components/Dropdown/index.js +0 -3
  132. package/lib-commonjs/components/Dropdown/index.js.map +1 -1
  133. package/lib-commonjs/components/Dropdown/renderDropdown.js +1 -3
  134. package/lib-commonjs/components/Dropdown/renderDropdown.js.map +1 -1
  135. package/lib-commonjs/components/Dropdown/useDropdown.js +1 -3
  136. package/lib-commonjs/components/Dropdown/useDropdown.js.map +1 -1
  137. package/lib-commonjs/components/Dropdown/useDropdownStyles.styles.js +0 -2
  138. package/lib-commonjs/components/Dropdown/useDropdownStyles.styles.js.map +1 -1
  139. package/lib-commonjs/components/Listbox/Listbox.js +1 -3
  140. package/lib-commonjs/components/Listbox/Listbox.js.map +1 -1
  141. package/lib-commonjs/components/Listbox/Listbox.types.js +0 -3
  142. package/lib-commonjs/components/Listbox/Listbox.types.js.map +1 -1
  143. package/lib-commonjs/components/Listbox/index.js +0 -3
  144. package/lib-commonjs/components/Listbox/index.js.map +1 -1
  145. package/lib-commonjs/components/Listbox/renderListbox.js +1 -3
  146. package/lib-commonjs/components/Listbox/renderListbox.js.map +1 -1
  147. package/lib-commonjs/components/Listbox/useListbox.js +1 -3
  148. package/lib-commonjs/components/Listbox/useListbox.js.map +1 -1
  149. package/lib-commonjs/components/Listbox/useListboxStyles.styles.js +0 -2
  150. package/lib-commonjs/components/Listbox/useListboxStyles.styles.js.map +1 -1
  151. package/lib-commonjs/components/Option/Option.js +1 -3
  152. package/lib-commonjs/components/Option/Option.js.map +1 -1
  153. package/lib-commonjs/components/Option/Option.types.js +0 -3
  154. package/lib-commonjs/components/Option/Option.types.js.map +1 -1
  155. package/lib-commonjs/components/Option/index.js +0 -3
  156. package/lib-commonjs/components/Option/index.js.map +1 -1
  157. package/lib-commonjs/components/Option/renderOption.js +1 -3
  158. package/lib-commonjs/components/Option/renderOption.js.map +1 -1
  159. package/lib-commonjs/components/Option/useOption.js +1 -3
  160. package/lib-commonjs/components/Option/useOption.js.map +1 -1
  161. package/lib-commonjs/components/Option/useOptionStyles.styles.js +0 -2
  162. package/lib-commonjs/components/Option/useOptionStyles.styles.js.map +1 -1
  163. package/lib-commonjs/components/OptionGroup/OptionGroup.js +1 -3
  164. package/lib-commonjs/components/OptionGroup/OptionGroup.js.map +1 -1
  165. package/lib-commonjs/components/OptionGroup/OptionGroup.types.js +0 -3
  166. package/lib-commonjs/components/OptionGroup/OptionGroup.types.js.map +1 -1
  167. package/lib-commonjs/components/OptionGroup/index.js +0 -3
  168. package/lib-commonjs/components/OptionGroup/index.js.map +1 -1
  169. package/lib-commonjs/components/OptionGroup/renderOptionGroup.js +1 -3
  170. package/lib-commonjs/components/OptionGroup/renderOptionGroup.js.map +1 -1
  171. package/lib-commonjs/components/OptionGroup/useOptionGroup.js +1 -3
  172. package/lib-commonjs/components/OptionGroup/useOptionGroup.js.map +1 -1
  173. package/lib-commonjs/components/OptionGroup/useOptionGroupStyles.styles.js +0 -2
  174. package/lib-commonjs/components/OptionGroup/useOptionGroupStyles.styles.js.map +1 -1
  175. package/lib-commonjs/contexts/ComboboxContext.js +2 -4
  176. package/lib-commonjs/contexts/ComboboxContext.js.map +1 -1
  177. package/lib-commonjs/contexts/ListboxContext.js +2 -4
  178. package/lib-commonjs/contexts/ListboxContext.js.map +1 -1
  179. package/lib-commonjs/contexts/useComboboxContextValues.js +1 -3
  180. package/lib-commonjs/contexts/useComboboxContextValues.js.map +1 -1
  181. package/lib-commonjs/contexts/useListboxContextValues.js +1 -3
  182. package/lib-commonjs/contexts/useListboxContextValues.js.map +1 -1
  183. package/lib-commonjs/index.js +0 -3
  184. package/lib-commonjs/index.js.map +1 -1
  185. package/lib-commonjs/utils/ComboboxBase.types.js +0 -3
  186. package/lib-commonjs/utils/ComboboxBase.types.js.map +1 -1
  187. package/lib-commonjs/utils/OptionCollection.types.js +0 -3
  188. package/lib-commonjs/utils/OptionCollection.types.js.map +1 -1
  189. package/lib-commonjs/utils/Selection.types.js +0 -3
  190. package/lib-commonjs/utils/Selection.types.js.map +1 -1
  191. package/lib-commonjs/utils/dropdownKeyActions.js +1 -3
  192. package/lib-commonjs/utils/dropdownKeyActions.js.map +1 -1
  193. package/lib-commonjs/utils/internalTokens.js +1 -3
  194. package/lib-commonjs/utils/internalTokens.js.map +1 -1
  195. package/lib-commonjs/utils/useComboboxBaseState.js +1 -3
  196. package/lib-commonjs/utils/useComboboxBaseState.js.map +1 -1
  197. package/lib-commonjs/utils/useComboboxPopup.js +1 -3
  198. package/lib-commonjs/utils/useComboboxPopup.js.map +1 -1
  199. package/lib-commonjs/utils/useOptionCollection.js +1 -3
  200. package/lib-commonjs/utils/useOptionCollection.js.map +1 -1
  201. package/lib-commonjs/utils/useScrollOptionsIntoView.js +1 -3
  202. package/lib-commonjs/utils/useScrollOptionsIntoView.js.map +1 -1
  203. package/lib-commonjs/utils/useSelection.js +1 -3
  204. package/lib-commonjs/utils/useSelection.js.map +1 -1
  205. package/lib-commonjs/utils/useTriggerListboxSlots.js +5 -7
  206. package/lib-commonjs/utils/useTriggerListboxSlots.js.map +1 -1
  207. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/contexts/useListboxContextValues.js"],"sourcesContent":["import { useContextSelector, useHasParentContext } from '@fluentui/react-context-selector';\nimport { ComboboxContext } from './ComboboxContext';\nexport function useListboxContextValues(state) {\n const hasComboboxContext = useHasParentContext(ComboboxContext);\n const {\n activeOption,\n focusVisible,\n multiselect,\n registerOption,\n selectedOptions,\n selectOption,\n setActiveOption\n } = state;\n // get register/unregister functions from parent combobox context\n const comboboxRegisterOption = useContextSelector(ComboboxContext, ctx => ctx.registerOption);\n const registerOptionValue = hasComboboxContext ? comboboxRegisterOption : registerOption;\n const listbox = {\n activeOption,\n focusVisible,\n multiselect,\n registerOption: registerOptionValue,\n selectedOptions,\n selectOption,\n setActiveOption\n };\n return {\n listbox\n };\n}\n//# sourceMappingURL=useListboxContextValues.js.map"],"names":["useListboxContextValues","state","hasComboboxContext","useHasParentContext","ComboboxContext","activeOption","focusVisible","multiselect","registerOption","selectedOptions","selectOption","setActiveOption","comboboxRegisterOption","useContextSelector","ctx","registerOptionValue","listbox"],"mappings":";;;;+BAEgBA;;aAAAA;;sCAFwC;iCACxB;AACzB,SAASA,wBAAwBC,KAAK,EAAE;IAC7C,MAAMC,qBAAqBC,IAAAA,yCAAmB,EAACC,gCAAe;IAC9D,MAAM,EACJC,aAAY,EACZC,aAAY,EACZC,YAAW,EACXC,eAAc,EACdC,gBAAe,EACfC,aAAY,EACZC,gBAAe,EAChB,GAAGV;IACJ,iEAAiE;IACjE,MAAMW,yBAAyBC,IAAAA,wCAAkB,EAACT,gCAAe,EAAEU,CAAAA,MAAOA,IAAIN,cAAc;IAC5F,MAAMO,sBAAsBb,qBAAqBU,yBAAyBJ,cAAc;IACxF,MAAMQ,UAAU;QACdX;QACAC;QACAC;QACAC,gBAAgBO;QAChBN;QACAC;QACAC;IACF;IACA,OAAO;QACLK;IACF;AACF,EACA,mDAAmD"}
1
+ {"version":3,"sources":["useListboxContextValues.js"],"sourcesContent":["import { useContextSelector, useHasParentContext } from '@fluentui/react-context-selector';\nimport { ComboboxContext } from './ComboboxContext';\nexport function useListboxContextValues(state) {\n const hasComboboxContext = useHasParentContext(ComboboxContext);\n const { activeOption , focusVisible , multiselect , registerOption , selectedOptions , selectOption , setActiveOption } = state;\n // get register/unregister functions from parent combobox context\n const comboboxRegisterOption = useContextSelector(ComboboxContext, (ctx)=>ctx.registerOption);\n const registerOptionValue = hasComboboxContext ? comboboxRegisterOption : registerOption;\n const listbox = {\n activeOption,\n focusVisible,\n multiselect,\n registerOption: registerOptionValue,\n selectedOptions,\n selectOption,\n setActiveOption\n };\n return {\n listbox\n };\n}\n"],"names":["useListboxContextValues","state","hasComboboxContext","useHasParentContext","ComboboxContext","activeOption","focusVisible","multiselect","registerOption","selectedOptions","selectOption","setActiveOption","comboboxRegisterOption","useContextSelector","ctx","registerOptionValue","listbox"],"mappings":";;;;+BAEgBA;;aAAAA;;sCAFwC;iCACxB;AACzB,SAASA,wBAAwBC,KAAK,EAAE;IAC3C,MAAMC,qBAAqBC,IAAAA,yCAAmB,EAACC,gCAAe;IAC9D,MAAM,EAAEC,aAAY,EAAGC,aAAY,EAAGC,YAAW,EAAGC,eAAc,EAAGC,gBAAe,EAAGC,aAAY,EAAGC,gBAAe,EAAG,GAAGV;IAC3H,iEAAiE;IACjE,MAAMW,yBAAyBC,IAAAA,wCAAkB,EAACT,gCAAe,EAAE,CAACU,MAAMA,IAAIN,cAAc;IAC5F,MAAMO,sBAAsBb,qBAAqBU,yBAAyBJ,cAAc;IACxF,MAAMQ,UAAU;QACZX;QACAC;QACAC;QACAC,gBAAgBO;QAChBN;QACAC;QACAC;IACJ;IACA,OAAO;QACHK;IACJ;AACJ"}
@@ -48,6 +48,3 @@ const _option = require("./Option");
48
48
  const _combobox = require("./Combobox");
49
49
  const _dropdown = require("./Dropdown");
50
50
  const _optionGroup = require("./OptionGroup");
51
- //# sourceMappingURL=index.js.map
52
-
53
- //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { ComboboxProvider } from './contexts/ComboboxContext';\nexport { ListboxProvider } from './contexts/ListboxContext';\nexport { useComboboxContextValues } from './contexts/useComboboxContextValues';\nexport { useListboxContextValues } from './contexts/useListboxContextValues';\nexport { Listbox, listboxClassNames, renderListbox_unstable, useListboxStyles_unstable, useListbox_unstable } from './Listbox';\nexport { Option, optionClassNames, renderOption_unstable, useOptionStyles_unstable, useOption_unstable } from './Option';\nexport { Combobox, comboboxClassNames, renderCombobox_unstable, useComboboxStyles_unstable, useCombobox_unstable } from './Combobox';\nexport { Dropdown, dropdownClassNames, renderDropdown_unstable, useDropdownStyles_unstable, useDropdown_unstable } from './Dropdown';\nexport { OptionGroup, optionGroupClassNames, renderOptionGroup_unstable, useOptionGroupStyles_unstable, useOptionGroup_unstable } from './OptionGroup';\n//# sourceMappingURL=index.js.map"],"names":["ComboboxProvider","ListboxProvider","useComboboxContextValues","useListboxContextValues","Listbox","listboxClassNames","renderListbox_unstable","useListboxStyles_unstable","useListbox_unstable","Option","optionClassNames","renderOption_unstable","useOptionStyles_unstable","useOption_unstable","Combobox","comboboxClassNames","renderCombobox_unstable","useComboboxStyles_unstable","useCombobox_unstable","Dropdown","dropdownClassNames","renderDropdown_unstable","useDropdownStyles_unstable","useDropdown_unstable","OptionGroup","optionGroupClassNames","renderOptionGroup_unstable","useOptionGroupStyles_unstable","useOptionGroup_unstable"],"mappings":";;;;;;;;;;;IAASA,gBAAgB,MAAhBA,iCAAgB;IAChBC,eAAe,MAAfA,+BAAe;IACfC,wBAAwB,MAAxBA,kDAAwB;IACxBC,uBAAuB,MAAvBA,gDAAuB;IACvBC,OAAO,MAAPA,gBAAO;IAAEC,iBAAiB,MAAjBA,0BAAiB;IAAEC,sBAAsB,MAAtBA,+BAAsB;IAAEC,yBAAyB,MAAzBA,kCAAyB;IAAEC,mBAAmB,MAAnBA,4BAAmB;IAClGC,MAAM,MAANA,cAAM;IAAEC,gBAAgB,MAAhBA,wBAAgB;IAAEC,qBAAqB,MAArBA,6BAAqB;IAAEC,wBAAwB,MAAxBA,gCAAwB;IAAEC,kBAAkB,MAAlBA,0BAAkB;IAC7FC,QAAQ,MAARA,kBAAQ;IAAEC,kBAAkB,MAAlBA,4BAAkB;IAAEC,uBAAuB,MAAvBA,iCAAuB;IAAEC,0BAA0B,MAA1BA,oCAA0B;IAAEC,oBAAoB,MAApBA,8BAAoB;IACvGC,QAAQ,MAARA,kBAAQ;IAAEC,kBAAkB,MAAlBA,4BAAkB;IAAEC,uBAAuB,MAAvBA,iCAAuB;IAAEC,0BAA0B,MAA1BA,oCAA0B;IAAEC,oBAAoB,MAApBA,8BAAoB;IACvGC,WAAW,MAAXA,wBAAW;IAAEC,qBAAqB,MAArBA,kCAAqB;IAAEC,0BAA0B,MAA1BA,uCAA0B;IAAEC,6BAA6B,MAA7BA,0CAA6B;IAAEC,uBAAuB,MAAvBA,oCAAuB;;iCAR9F;gCACD;0CACS;yCACD;yBAC2E;wBACL;0BACU;0BACA;6BACe;CACvI,iCAAiC"}
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export { ComboboxProvider } from './contexts/ComboboxContext';\nexport { ListboxProvider } from './contexts/ListboxContext';\nexport { useComboboxContextValues } from './contexts/useComboboxContextValues';\nexport { useListboxContextValues } from './contexts/useListboxContextValues';\nexport { Listbox, listboxClassNames, renderListbox_unstable, useListboxStyles_unstable, useListbox_unstable } from './Listbox';\nexport { Option, optionClassNames, renderOption_unstable, useOptionStyles_unstable, useOption_unstable } from './Option';\nexport { Combobox, comboboxClassNames, renderCombobox_unstable, useComboboxStyles_unstable, useCombobox_unstable } from './Combobox';\nexport { Dropdown, dropdownClassNames, renderDropdown_unstable, useDropdownStyles_unstable, useDropdown_unstable } from './Dropdown';\nexport { OptionGroup, optionGroupClassNames, renderOptionGroup_unstable, useOptionGroupStyles_unstable, useOptionGroup_unstable } from './OptionGroup';\n"],"names":["ComboboxProvider","ListboxProvider","useComboboxContextValues","useListboxContextValues","Listbox","listboxClassNames","renderListbox_unstable","useListboxStyles_unstable","useListbox_unstable","Option","optionClassNames","renderOption_unstable","useOptionStyles_unstable","useOption_unstable","Combobox","comboboxClassNames","renderCombobox_unstable","useComboboxStyles_unstable","useCombobox_unstable","Dropdown","dropdownClassNames","renderDropdown_unstable","useDropdownStyles_unstable","useDropdown_unstable","OptionGroup","optionGroupClassNames","renderOptionGroup_unstable","useOptionGroupStyles_unstable","useOptionGroup_unstable"],"mappings":";;;;;;;;;;;IAASA,gBAAgB,MAAhBA,iCAAgB;IAChBC,eAAe,MAAfA,+BAAe;IACfC,wBAAwB,MAAxBA,kDAAwB;IACxBC,uBAAuB,MAAvBA,gDAAuB;IACvBC,OAAO,MAAPA,gBAAO;IAAEC,iBAAiB,MAAjBA,0BAAiB;IAAEC,sBAAsB,MAAtBA,+BAAsB;IAAEC,yBAAyB,MAAzBA,kCAAyB;IAAEC,mBAAmB,MAAnBA,4BAAmB;IAClGC,MAAM,MAANA,cAAM;IAAEC,gBAAgB,MAAhBA,wBAAgB;IAAEC,qBAAqB,MAArBA,6BAAqB;IAAEC,wBAAwB,MAAxBA,gCAAwB;IAAEC,kBAAkB,MAAlBA,0BAAkB;IAC7FC,QAAQ,MAARA,kBAAQ;IAAEC,kBAAkB,MAAlBA,4BAAkB;IAAEC,uBAAuB,MAAvBA,iCAAuB;IAAEC,0BAA0B,MAA1BA,oCAA0B;IAAEC,oBAAoB,MAApBA,8BAAoB;IACvGC,QAAQ,MAARA,kBAAQ;IAAEC,kBAAkB,MAAlBA,4BAAkB;IAAEC,uBAAuB,MAAvBA,iCAAuB;IAAEC,0BAA0B,MAA1BA,oCAA0B;IAAEC,oBAAoB,MAApBA,8BAAoB;IACvGC,WAAW,MAAXA,wBAAW;IAAEC,qBAAqB,MAArBA,kCAAqB;IAAEC,0BAA0B,MAA1BA,uCAA0B;IAAEC,6BAA6B,MAA7BA,0CAA6B;IAAEC,uBAAuB,MAAvBA,oCAAuB;;iCAR9F;gCACD;0CACS;yCACD;yBAC2E;wBACL;0BACU;0BACA;6BACe"}
@@ -4,6 +4,3 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
6
6
  const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
7
- //# sourceMappingURL=ComboboxBase.types.js.map
8
-
9
- //# sourceMappingURL=ComboboxBase.types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/ComboboxBase.types.js"],"sourcesContent":["import * as React from 'react';\n//# sourceMappingURL=ComboboxBase.types.js.map"],"names":[],"mappings":";;;;;6DAAuB;CACvB,8CAA8C"}
1
+ {"version":3,"sources":["ComboboxBase.types.js"],"sourcesContent":["import * as React from 'react';\n"],"names":[],"mappings":";;;;;6DAAuB"}
@@ -2,6 +2,3 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- //# sourceMappingURL=OptionCollection.types.js.map
6
-
7
- //# sourceMappingURL=OptionCollection.types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/OptionCollection.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=OptionCollection.types.js.map"],"names":[],"mappings":";;;;CACA,kDAAkD"}
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -4,6 +4,3 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
6
6
  const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
7
- //# sourceMappingURL=Selection.types.js.map
8
-
9
- //# sourceMappingURL=Selection.types.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/Selection.types.js"],"sourcesContent":["import * as React from 'react';\n//# sourceMappingURL=Selection.types.js.map"],"names":[],"mappings":";;;;;6DAAuB;CACvB,2CAA2C"}
1
+ {"version":3,"sources":["Selection.types.js"],"sourcesContent":["import * as React from 'react';\n"],"names":[],"mappings":";;;;;6DAAuB"}
@@ -84,6 +84,4 @@ function getIndexFromAction(action, currentIndex, maxIndex) {
84
84
  default:
85
85
  return currentIndex;
86
86
  }
87
- } //# sourceMappingURL=dropdownKeyActions.js.map
88
-
89
- //# sourceMappingURL=dropdownKeyActions.js.map
87
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/dropdownKeyActions.js"],"sourcesContent":["import * as keys from '@fluentui/keyboard-keys';\nimport * as React from 'react';\n/**\n * Converts a keyboard interaction into a defined action\n */\nexport function getDropdownActionFromKey(e, options = {}) {\n const {\n open = true,\n multiselect = false\n } = options;\n const code = e.key;\n const {\n altKey,\n ctrlKey,\n key,\n metaKey\n } = e;\n // typing action occurs whether open or closed\n if (key.length === 1 && code !== keys.Space && !altKey && !ctrlKey && !metaKey) {\n return 'Type';\n }\n // handle opening the dropdown if closed\n if (!open) {\n if (code === keys.ArrowDown || code === keys.ArrowUp || code === keys.Enter || code === keys.Space) {\n return 'Open';\n }\n // if the dropdown is closed and an action did not match the above, do nothing\n return 'None';\n }\n // select or close actions\n if (code === keys.ArrowUp && altKey || code === keys.Enter || !multiselect && code === keys.Space) {\n return 'CloseSelect';\n }\n if (multiselect && code === keys.Space) {\n return 'Select';\n }\n if (code === keys.Escape) {\n return 'Close';\n }\n // navigation interactions\n if (code === keys.ArrowDown) {\n return 'Next';\n }\n if (code === keys.ArrowUp) {\n return 'Previous';\n }\n if (code === keys.Home) {\n return 'First';\n }\n if (code === keys.End) {\n return 'Last';\n }\n if (code === keys.PageUp) {\n return 'PageUp';\n }\n if (code === keys.PageDown) {\n return 'PageDown';\n }\n if (code === keys.Tab) {\n return 'Tab';\n }\n // if nothing matched, return none\n return 'None';\n}\n/**\n * Returns the requested option index from an action\n */\nexport function getIndexFromAction(action, currentIndex, maxIndex) {\n switch (action) {\n case 'Next':\n return Math.min(maxIndex, currentIndex + 1);\n break;\n case 'Previous':\n return Math.max(0, currentIndex - 1);\n case 'First':\n return 0;\n case 'Last':\n return maxIndex;\n case 'PageDown':\n return Math.min(maxIndex, currentIndex + 10);\n case 'PageUp':\n return Math.max(0, currentIndex - 10);\n default:\n return currentIndex;\n }\n}\n//# sourceMappingURL=dropdownKeyActions.js.map"],"names":["getDropdownActionFromKey","getIndexFromAction","e","options","open","multiselect","code","key","altKey","ctrlKey","metaKey","length","keys","Space","ArrowDown","ArrowUp","Enter","Escape","Home","End","PageUp","PageDown","Tab","action","currentIndex","maxIndex","Math","min","max"],"mappings":";;;;;;;;;;;IAKgBA,wBAAwB,MAAxBA;IA8DAC,kBAAkB,MAAlBA;;;oEAnEM;6DACC;AAIhB,SAASD,yBAAyBE,CAAC,EAAEC,UAAU,CAAC,CAAC,EAAE;IACxD,MAAM,EACJC,MAAO,IAAI,CAAA,EACXC,aAAc,KAAK,CAAA,EACpB,GAAGF;IACJ,MAAMG,OAAOJ,EAAEK,GAAG;IAClB,MAAM,EACJC,OAAM,EACNC,QAAO,EACPF,IAAG,EACHG,QAAO,EACR,GAAGR;IACJ,8CAA8C;IAC9C,IAAIK,IAAII,MAAM,KAAK,KAAKL,SAASM,cAAKC,KAAK,IAAI,CAACL,UAAU,CAACC,WAAW,CAACC,SAAS;QAC9E,OAAO;IACT,CAAC;IACD,wCAAwC;IACxC,IAAI,CAACN,MAAM;QACT,IAAIE,SAASM,cAAKE,SAAS,IAAIR,SAASM,cAAKG,OAAO,IAAIT,SAASM,cAAKI,KAAK,IAAIV,SAASM,cAAKC,KAAK,EAAE;YAClG,OAAO;QACT,CAAC;QACD,8EAA8E;QAC9E,OAAO;IACT,CAAC;IACD,0BAA0B;IAC1B,IAAIP,SAASM,cAAKG,OAAO,IAAIP,UAAUF,SAASM,cAAKI,KAAK,IAAI,CAACX,eAAeC,SAASM,cAAKC,KAAK,EAAE;QACjG,OAAO;IACT,CAAC;IACD,IAAIR,eAAeC,SAASM,cAAKC,KAAK,EAAE;QACtC,OAAO;IACT,CAAC;IACD,IAAIP,SAASM,cAAKK,MAAM,EAAE;QACxB,OAAO;IACT,CAAC;IACD,0BAA0B;IAC1B,IAAIX,SAASM,cAAKE,SAAS,EAAE;QAC3B,OAAO;IACT,CAAC;IACD,IAAIR,SAASM,cAAKG,OAAO,EAAE;QACzB,OAAO;IACT,CAAC;IACD,IAAIT,SAASM,cAAKM,IAAI,EAAE;QACtB,OAAO;IACT,CAAC;IACD,IAAIZ,SAASM,cAAKO,GAAG,EAAE;QACrB,OAAO;IACT,CAAC;IACD,IAAIb,SAASM,cAAKQ,MAAM,EAAE;QACxB,OAAO;IACT,CAAC;IACD,IAAId,SAASM,cAAKS,QAAQ,EAAE;QAC1B,OAAO;IACT,CAAC;IACD,IAAIf,SAASM,cAAKU,GAAG,EAAE;QACrB,OAAO;IACT,CAAC;IACD,kCAAkC;IAClC,OAAO;AACT;AAIO,SAASrB,mBAAmBsB,MAAM,EAAEC,YAAY,EAAEC,QAAQ,EAAE;IACjE,OAAQF;QACN,KAAK;YACH,OAAOG,KAAKC,GAAG,CAACF,UAAUD,eAAe;YACzC,KAAM;QACR,KAAK;YACH,OAAOE,KAAKE,GAAG,CAAC,GAAGJ,eAAe;QACpC,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAOC;QACT,KAAK;YACH,OAAOC,KAAKC,GAAG,CAACF,UAAUD,eAAe;QAC3C,KAAK;YACH,OAAOE,KAAKE,GAAG,CAAC,GAAGJ,eAAe;QACpC;YACE,OAAOA;IACX;AACF,EACA,8CAA8C"}
1
+ {"version":3,"sources":["dropdownKeyActions.js"],"sourcesContent":["import * as keys from '@fluentui/keyboard-keys';\nimport * as React from 'react';\n/**\n * Converts a keyboard interaction into a defined action\n */ export function getDropdownActionFromKey(e, options = {}) {\n const { open =true , multiselect =false } = options;\n const code = e.key;\n const { altKey , ctrlKey , key , metaKey } = e;\n // typing action occurs whether open or closed\n if (key.length === 1 && code !== keys.Space && !altKey && !ctrlKey && !metaKey) {\n return 'Type';\n }\n // handle opening the dropdown if closed\n if (!open) {\n if (code === keys.ArrowDown || code === keys.ArrowUp || code === keys.Enter || code === keys.Space) {\n return 'Open';\n }\n // if the dropdown is closed and an action did not match the above, do nothing\n return 'None';\n }\n // select or close actions\n if (code === keys.ArrowUp && altKey || code === keys.Enter || !multiselect && code === keys.Space) {\n return 'CloseSelect';\n }\n if (multiselect && code === keys.Space) {\n return 'Select';\n }\n if (code === keys.Escape) {\n return 'Close';\n }\n // navigation interactions\n if (code === keys.ArrowDown) {\n return 'Next';\n }\n if (code === keys.ArrowUp) {\n return 'Previous';\n }\n if (code === keys.Home) {\n return 'First';\n }\n if (code === keys.End) {\n return 'Last';\n }\n if (code === keys.PageUp) {\n return 'PageUp';\n }\n if (code === keys.PageDown) {\n return 'PageDown';\n }\n if (code === keys.Tab) {\n return 'Tab';\n }\n // if nothing matched, return none\n return 'None';\n}\n/**\n * Returns the requested option index from an action\n */ export function getIndexFromAction(action, currentIndex, maxIndex) {\n switch(action){\n case 'Next':\n return Math.min(maxIndex, currentIndex + 1);\n break;\n case 'Previous':\n return Math.max(0, currentIndex - 1);\n case 'First':\n return 0;\n case 'Last':\n return maxIndex;\n case 'PageDown':\n return Math.min(maxIndex, currentIndex + 10);\n case 'PageUp':\n return Math.max(0, currentIndex - 10);\n default:\n return currentIndex;\n }\n}\n"],"names":["getDropdownActionFromKey","getIndexFromAction","e","options","open","multiselect","code","key","altKey","ctrlKey","metaKey","length","keys","Space","ArrowDown","ArrowUp","Enter","Escape","Home","End","PageUp","PageDown","Tab","action","currentIndex","maxIndex","Math","min","max"],"mappings":";;;;;;;;;;;IAIoBA,wBAAwB,MAAxBA;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;IACX,CAAC;IACD,IAAId,SAASM,cAAKS,QAAQ,EAAE;QACxB,OAAO;IACX,CAAC;IACD,IAAIf,SAASM,cAAKU,GAAG,EAAE;QACnB,OAAO;IACX,CAAC;IACD,kCAAkC;IAClC,OAAO;AACX;AAGW,SAASrB,mBAAmBsB,MAAM,EAAEC,YAAY,EAAEC,QAAQ,EAAE;IACnE,OAAOF;QACH,KAAK;YACD,OAAOG,KAAKC,GAAG,CAACF,UAAUD,eAAe;YACzC,KAAM;QACV,KAAK;YACD,OAAOE,KAAKE,GAAG,CAAC,GAAGJ,eAAe;QACtC,KAAK;YACD,OAAO;QACX,KAAK;YACD,OAAOC;QACX,KAAK;YACD,OAAOC,KAAKC,GAAG,CAACF,UAAUD,eAAe;QAC7C,KAAK;YACD,OAAOE,KAAKE,GAAG,CAAC,GAAGJ,eAAe;QACtC;YACI,OAAOA;IACf;AACJ"}
@@ -10,6 +10,4 @@ const iconSizes = {
10
10
  small: '16px',
11
11
  medium: '20px',
12
12
  large: '24px'
13
- }; //# sourceMappingURL=internalTokens.js.map
14
-
15
- //# sourceMappingURL=internalTokens.js.map
13
+ };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/internalTokens.js"],"sourcesContent":["export const iconSizes = {\n small: '16px',\n medium: '20px',\n large: '24px'\n};\n//# sourceMappingURL=internalTokens.js.map"],"names":["iconSizes","small","medium","large"],"mappings":";;;;+BAAaA;;aAAAA;;AAAN,MAAMA,YAAY;IACvBC,OAAO;IACPC,QAAQ;IACRC,OAAO;AACT,GACA,0CAA0C"}
1
+ {"version":3,"sources":["internalTokens.js"],"sourcesContent":["export const iconSizes = {\n small: '16px',\n medium: '20px',\n large: '24px'\n};\n"],"names":["iconSizes","small","medium","large"],"mappings":";;;;+BAAaA;;aAAAA;;AAAN,MAAMA,YAAY;IACrBC,OAAO;IACPC,QAAQ;IACRC,OAAO;AACX"}
@@ -112,6 +112,4 @@ const useComboboxBaseState = (props)=>{
112
112
  size,
113
113
  value
114
114
  };
115
- }; //# sourceMappingURL=useComboboxBaseState.js.map
116
-
117
- //# sourceMappingURL=useComboboxBaseState.js.map
115
+ };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/useComboboxBaseState.js"],"sourcesContent":["import * as React from 'react';\nimport { useControllableState, useFirstMount } from '@fluentui/react-utilities';\nimport { useOptionCollection } from '../utils/useOptionCollection';\nimport { useSelection } from '../utils/useSelection';\n/**\n * State shared between Combobox and Dropdown components\n */\nexport const useComboboxBaseState = props => {\n const {\n appearance = 'outline',\n children,\n editable = false,\n inlinePopup = false,\n multiselect,\n onOpenChange,\n size = 'medium'\n } = props;\n const optionCollection = useOptionCollection();\n const {\n getOptionAtIndex,\n getOptionsMatchingValue\n } = optionCollection;\n const [activeOption, setActiveOption] = React.useState();\n // track whether keyboard focus outline should be shown\n // tabster/keyborg doesn't work here, since the actual keyboard focus target doesn't move\n const [focusVisible, setFocusVisible] = React.useState(false);\n // track focused state to conditionally render collapsed listbox\n const [hasFocus, setHasFocus] = React.useState(false);\n const ignoreNextBlur = React.useRef(false);\n const selectionState = useSelection(props);\n const {\n selectedOptions\n } = selectionState;\n // calculate value based on props, internal value changes, and selected options\n const isFirstMount = useFirstMount();\n const [controllableValue, setValue] = useControllableState({\n state: props.value,\n initialState: undefined\n });\n const value = React.useMemo(() => {\n // don't compute the value if it is defined through props or setValue,\n if (controllableValue !== undefined) {\n return controllableValue;\n }\n // handle defaultValue here, so it is overridden by selection\n if (isFirstMount && props.defaultValue !== undefined) {\n return props.defaultValue;\n }\n const selectedOptionsText = getOptionsMatchingValue(optionValue => {\n return selectedOptions.includes(optionValue);\n }).map(option => option.text);\n if (multiselect) {\n // editable inputs should not display multiple selected options in the input as text\n return editable ? '' : selectedOptionsText.join(', ');\n }\n return selectedOptionsText[0];\n // do not change value after isFirstMount changes,\n // we do not want to accidentally override defaultValue on a second render\n // unless another value is intentionally set\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [controllableValue, editable, getOptionsMatchingValue, multiselect, props.defaultValue, selectedOptions]);\n // Handle open state, which is shared with options in context\n const [open, setOpenState] = useControllableState({\n state: props.open,\n defaultState: props.defaultOpen,\n initialState: false\n });\n const setOpen = React.useCallback((event, newState) => {\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(event, {\n open: newState\n });\n setOpenState(newState);\n }, [onOpenChange, setOpenState]);\n // update active option based on change in open state or children\n React.useEffect(() => {\n if (open && !activeOption) {\n // if it is single-select and there is a selected option, start at the selected option\n if (!multiselect && selectedOptions.length > 0) {\n const selectedOption = getOptionsMatchingValue(v => v === selectedOptions[0]).pop();\n selectedOption && setActiveOption(selectedOption);\n } else {\n setActiveOption(getOptionAtIndex(0));\n }\n } else if (!open) {\n // reset the active option when closing\n setActiveOption(undefined);\n }\n // this should only be run in response to changes in the open state or children\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open, children]);\n return {\n ...optionCollection,\n ...selectionState,\n activeOption,\n appearance,\n focusVisible,\n hasFocus,\n ignoreNextBlur,\n inlinePopup,\n open,\n setActiveOption,\n setFocusVisible,\n setHasFocus,\n setOpen,\n setValue,\n size,\n value\n };\n};\n//# sourceMappingURL=useComboboxBaseState.js.map"],"names":["useComboboxBaseState","props","appearance","children","editable","inlinePopup","multiselect","onOpenChange","size","optionCollection","useOptionCollection","getOptionAtIndex","getOptionsMatchingValue","activeOption","setActiveOption","React","useState","focusVisible","setFocusVisible","hasFocus","setHasFocus","ignoreNextBlur","useRef","selectionState","useSelection","selectedOptions","isFirstMount","useFirstMount","controllableValue","setValue","useControllableState","state","value","initialState","undefined","useMemo","defaultValue","selectedOptionsText","optionValue","includes","map","option","text","join","open","setOpenState","defaultState","defaultOpen","setOpen","useCallback","event","newState","useEffect","length","selectedOption","v","pop"],"mappings":";;;;+BAOaA;;aAAAA;;;6DAPU;gCAC6B;qCAChB;8BACP;AAItB,MAAMA,uBAAuBC,CAAAA,QAAS;IAC3C,MAAM,EACJC,YAAa,UAAS,EACtBC,SAAQ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kDAAkD;IAClD,0EAA0E;IAC1E,4CAA4C;IAC5C,uDAAuD;IACzD,GAAG;QAACT;QAAmBxB;QAAUQ;QAAyBN;QAAaL,MAAMmC,YAAY;QAAEX;KAAgB;IAC3G,6DAA6D;IAC7D,MAAM,CAACmB,MAAMC,aAAa,GAAGf,IAAAA,oCAAoB,EAAC;QAChDC,OAAO9B,MAAM2C,IAAI;QACjBE,cAAc7C,MAAM8C,WAAW;QAC/Bd,cAAc,KAAK;IACrB;IACA,MAAMe,UAAUjC,OAAMkC,WAAW,CAAC,CAACC,OAAOC,WAAa;QACrD5C,iBAAiB,IAAI,IAAIA,iBAAiB,KAAK,IAAI,KAAK,IAAIA,aAAa2C,OAAO;YAC9EN,MAAMO;QACR,EAAE;QACFN,aAAaM;IACf,GAAG;QAAC5C;QAAcsC;KAAa;IAC/B,iEAAiE;IACjE9B,OAAMqC,SAAS,CAAC,IAAM;QACpB,IAAIR,QAAQ,CAAC/B,cAAc;YACzB,sFAAsF;YACtF,IAAI,CAACP,eAAemB,gBAAgB4B,MAAM,GAAG,GAAG;gBAC9C,MAAMC,iBAAiB1C,wBAAwB2C,CAAAA,IAAKA,MAAM9B,eAAe,CAAC,EAAE,EAAE+B,GAAG;gBACjFF,kBAAkBxC,gBAAgBwC;YACpC,OAAO;gBACLxC,gBAAgBH,iBAAiB;YACnC,CAAC;QACH,OAAO,IAAI,CAACiC,MAAM;YAChB,uCAAuC;YACvC9B,gBAAgBoB;QAClB,CAAC;IACD,+EAA+E;IAC/E,uDAAuD;IACzD,GAAG;QAACU;QAAMzC;KAAS;IACnB,OAAO;QACL,GAAGM,gBAAgB;QACnB,GAAGc,cAAc;QACjBV;QACAX;QACAe;QACAE;QACAE;QACAhB;QACAuC;QACA9B;QACAI;QACAE;QACA4B;QACAnB;QACArB;QACAwB;IACF;AACF,GACA,gDAAgD"}
1
+ {"version":3,"sources":["useComboboxBaseState.js"],"sourcesContent":["import * as React from 'react';\nimport { useControllableState, useFirstMount } from '@fluentui/react-utilities';\nimport { useOptionCollection } from '../utils/useOptionCollection';\nimport { useSelection } from '../utils/useSelection';\n/**\n * State shared between Combobox and Dropdown components\n */ export const useComboboxBaseState = (props)=>{\n const { appearance ='outline' , children , editable =false , inlinePopup =false , multiselect , onOpenChange , size ='medium' } = props;\n const optionCollection = useOptionCollection();\n const { getOptionAtIndex , getOptionsMatchingValue } = optionCollection;\n const [activeOption, setActiveOption] = React.useState();\n // track whether keyboard focus outline should be shown\n // tabster/keyborg doesn't work here, since the actual keyboard focus target doesn't move\n const [focusVisible, setFocusVisible] = React.useState(false);\n // track focused state to conditionally render collapsed listbox\n const [hasFocus, setHasFocus] = React.useState(false);\n const ignoreNextBlur = React.useRef(false);\n const selectionState = useSelection(props);\n const { selectedOptions } = selectionState;\n // calculate value based on props, internal value changes, and selected options\n const isFirstMount = useFirstMount();\n const [controllableValue, setValue] = useControllableState({\n state: props.value,\n initialState: undefined\n });\n const value = React.useMemo(()=>{\n // don't compute the value if it is defined through props or setValue,\n if (controllableValue !== undefined) {\n return controllableValue;\n }\n // handle defaultValue here, so it is overridden by selection\n if (isFirstMount && props.defaultValue !== undefined) {\n return props.defaultValue;\n }\n const selectedOptionsText = getOptionsMatchingValue((optionValue)=>{\n return selectedOptions.includes(optionValue);\n }).map((option)=>option.text);\n if (multiselect) {\n // editable inputs should not display multiple selected options in the input as text\n return editable ? '' : selectedOptionsText.join(', ');\n }\n return selectedOptionsText[0];\n // do not change value after isFirstMount changes,\n // we do not want to accidentally override defaultValue on a second render\n // unless another value is intentionally set\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n controllableValue,\n editable,\n getOptionsMatchingValue,\n multiselect,\n props.defaultValue,\n selectedOptions\n ]);\n // Handle open state, which is shared with options in context\n const [open, setOpenState] = useControllableState({\n state: props.open,\n defaultState: props.defaultOpen,\n initialState: false\n });\n const setOpen = React.useCallback((event, newState)=>{\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(event, {\n open: newState\n });\n setOpenState(newState);\n }, [\n onOpenChange,\n setOpenState\n ]);\n // update active option based on change in open state or children\n React.useEffect(()=>{\n if (open && !activeOption) {\n // if it is single-select and there is a selected option, start at the selected option\n if (!multiselect && selectedOptions.length > 0) {\n const selectedOption = getOptionsMatchingValue((v)=>v === selectedOptions[0]).pop();\n selectedOption && setActiveOption(selectedOption);\n } else {\n setActiveOption(getOptionAtIndex(0));\n }\n } else if (!open) {\n // reset the active option when closing\n setActiveOption(undefined);\n }\n // this should only be run in response to changes in the open state or children\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n open,\n children\n ]);\n return {\n ...optionCollection,\n ...selectionState,\n activeOption,\n appearance,\n focusVisible,\n hasFocus,\n ignoreNextBlur,\n inlinePopup,\n open,\n setActiveOption,\n setFocusVisible,\n setHasFocus,\n setOpen,\n setValue,\n size,\n value\n };\n};\n"],"names":["useComboboxBaseState","props","appearance","children","editable","inlinePopup","multiselect","onOpenChange","size","optionCollection","useOptionCollection","getOptionAtIndex","getOptionsMatchingValue","activeOption","setActiveOption","React","useState","focusVisible","setFocusVisible","hasFocus","setHasFocus","ignoreNextBlur","useRef","selectionState","useSelection","selectedOptions","isFirstMount","useFirstMount","controllableValue","setValue","useControllableState","state","value","initialState","undefined","useMemo","defaultValue","selectedOptionsText","optionValue","includes","map","option","text","join","open","setOpenState","defaultState","defaultOpen","setOpen","useCallback","event","newState","useEffect","length","selectedOption","v","pop"],"mappings":";;;;+BAMiBA;;aAAAA;;;6DANM;gCAC6B;qCAChB;8BACP;AAGlB,MAAMA,uBAAuB,CAACC,QAAQ;IAC7C,MAAM,EAAEC,YAAY,UAAS,EAAGC,SAAQ,EAAGC,UAAU,KAAK,CAAA,EAAGC,aAAa,KAAK,CAAA,EAAGC,YAAW,EAAGC,aAAY,EAAGC,MAAM,SAAQ,EAAG,GAAGP;IACnI,MAAMQ,mBAAmBC,IAAAA,wCAAmB;IAC5C,MAAM,EAAEC,iBAAgB,EAAGC,wBAAuB,EAAG,GAAGH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9CC,OAAO9B,MAAM2C,IAAI;QACjBE,cAAc7C,MAAM8C,WAAW;QAC/Bd,cAAc,KAAK;IACvB;IACA,MAAMe,UAAUjC,OAAMkC,WAAW,CAAC,CAACC,OAAOC,WAAW;QACjD5C,iBAAiB,IAAI,IAAIA,iBAAiB,KAAK,IAAI,KAAK,IAAIA,aAAa2C,OAAO;YAC5EN,MAAMO;QACV,EAAE;QACFN,aAAaM;IACjB,GAAG;QACC5C;QACAsC;KACH;IACD,iEAAiE;IACjE9B,OAAMqC,SAAS,CAAC,IAAI;QAChB,IAAIR,QAAQ,CAAC/B,cAAc;YACvB,sFAAsF;YACtF,IAAI,CAACP,eAAemB,gBAAgB4B,MAAM,GAAG,GAAG;gBAC5C,MAAMC,iBAAiB1C,wBAAwB,CAAC2C,IAAIA,MAAM9B,eAAe,CAAC,EAAE,EAAE+B,GAAG;gBACjFF,kBAAkBxC,gBAAgBwC;YACtC,OAAO;gBACHxC,gBAAgBH,iBAAiB;YACrC,CAAC;QACL,OAAO,IAAI,CAACiC,MAAM;YACd,uCAAuC;YACvC9B,gBAAgBoB;QACpB,CAAC;IACL,+EAA+E;IAC/E,uDAAuD;IACvD,GAAG;QACCU;QACAzC;KACH;IACD,OAAO;QACH,GAAGM,gBAAgB;QACnB,GAAGc,cAAc;QACjBV;QACAX;QACAe;QACAE;QACAE;QACAhB;QACAuC;QACA9B;QACAI;QACAE;QACA4B;QACAnB;QACArB;QACAwB;IACJ;AACJ"}
@@ -42,6 +42,4 @@ function useComboboxPopup(props, triggerShorthand, listboxShorthand) {
42
42
  },
43
43
  listbox
44
44
  ];
45
- } //# sourceMappingURL=useComboboxPopup.js.map
46
-
47
- //# sourceMappingURL=useComboboxPopup.js.map
45
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/useComboboxPopup.js"],"sourcesContent":["import { resolvePositioningShorthand, usePositioning } from '@fluentui/react-positioning';\nimport { useMergedRefs } from '@fluentui/react-utilities';\nexport function useComboboxPopup(props, triggerShorthand, listboxShorthand) {\n const {\n positioning\n } = props;\n // Set a default set of fallback positions to try if the dropdown does not fit on screen\n const fallbackPositions = ['above', 'after', 'after-top', 'before', 'before-top'];\n // popper options\n const popperOptions = {\n position: 'below',\n align: 'start',\n offset: {\n crossAxis: 0,\n mainAxis: 2\n },\n fallbackPositions,\n ...resolvePositioningShorthand(positioning)\n };\n const {\n targetRef,\n containerRef\n } = usePositioning(popperOptions);\n const listboxRef = useMergedRefs(listboxShorthand === null || listboxShorthand === void 0 ? void 0 : listboxShorthand.ref, containerRef);\n const listbox = listboxShorthand && {\n ...listboxShorthand,\n ref: listboxRef\n };\n return [{\n ...triggerShorthand,\n ref: useMergedRefs(triggerShorthand === null || triggerShorthand === void 0 ? void 0 : triggerShorthand.ref, targetRef)\n }, listbox];\n}\n//# sourceMappingURL=useComboboxPopup.js.map"],"names":["useComboboxPopup","props","triggerShorthand","listboxShorthand","positioning","fallbackPositions","popperOptions","position","align","offset","crossAxis","mainAxis","resolvePositioningShorthand","targetRef","containerRef","usePositioning","listboxRef","useMergedRefs","ref","listbox"],"mappings":";;;;+BAEgBA;;aAAAA;;kCAF4C;gCAC9B;AACvB,SAASA,iBAAiBC,KAAK,EAAEC,gBAAgB,EAAEC,gBAAgB,EAAE;IAC1E,MAAM,EACJC,YAAW,EACZ,GAAGH;IACJ,wFAAwF;IACxF,MAAMI,oBAAoB;QAAC;QAAS;QAAS;QAAa;QAAU;KAAa;IACjF,iBAAiB;IACjB,MAAMC,gBAAgB;QACpBC,UAAU;QACVC,OAAO;QACPC,QAAQ;YACNC,WAAW;YACXC,UAAU;QACZ;QACAN;QACA,GAAGO,IAAAA,6CAA2B,EAACR,YAAY;IAC7C;IACA,MAAM,EACJS,UAAS,EACTC,aAAY,EACb,GAAGC,IAAAA,gCAAc,EAACT;IACnB,MAAMU,aAAaC,IAAAA,6BAAa,EAACd,qBAAqB,IAAI,IAAIA,qBAAqB,KAAK,IAAI,KAAK,IAAIA,iBAAiBe,GAAG,EAAEJ;IAC3H,MAAMK,UAAUhB,oBAAoB;QAClC,GAAGA,gBAAgB;QACnBe,KAAKF;IACP;IACA,OAAO;QAAC;YACN,GAAGd,gBAAgB;YACnBgB,KAAKD,IAAAA,6BAAa,EAACf,qBAAqB,IAAI,IAAIA,qBAAqB,KAAK,IAAI,KAAK,IAAIA,iBAAiBgB,GAAG,EAAEL;QAC/G;QAAGM;KAAQ;AACb,EACA,4CAA4C"}
1
+ {"version":3,"sources":["useComboboxPopup.js"],"sourcesContent":["import { resolvePositioningShorthand, usePositioning } from '@fluentui/react-positioning';\nimport { useMergedRefs } from '@fluentui/react-utilities';\nexport function useComboboxPopup(props, triggerShorthand, listboxShorthand) {\n const { positioning } = props;\n // Set a default set of fallback positions to try if the dropdown does not fit on screen\n const fallbackPositions = [\n 'above',\n 'after',\n 'after-top',\n 'before',\n 'before-top'\n ];\n // popper options\n const popperOptions = {\n position: 'below',\n align: 'start',\n offset: {\n crossAxis: 0,\n mainAxis: 2\n },\n fallbackPositions,\n ...resolvePositioningShorthand(positioning)\n };\n const { targetRef , containerRef } = usePositioning(popperOptions);\n const listboxRef = useMergedRefs(listboxShorthand === null || listboxShorthand === void 0 ? void 0 : listboxShorthand.ref, containerRef);\n const listbox = listboxShorthand && {\n ...listboxShorthand,\n ref: listboxRef\n };\n return [\n {\n ...triggerShorthand,\n ref: useMergedRefs(triggerShorthand === null || triggerShorthand === void 0 ? void 0 : triggerShorthand.ref, targetRef)\n },\n listbox\n ];\n}\n"],"names":["useComboboxPopup","props","triggerShorthand","listboxShorthand","positioning","fallbackPositions","popperOptions","position","align","offset","crossAxis","mainAxis","resolvePositioningShorthand","targetRef","containerRef","usePositioning","listboxRef","useMergedRefs","ref","listbox"],"mappings":";;;;+BAEgBA;;aAAAA;;kCAF4C;gCAC9B;AACvB,SAASA,iBAAiBC,KAAK,EAAEC,gBAAgB,EAAEC,gBAAgB,EAAE;IACxE,MAAM,EAAEC,YAAW,EAAG,GAAGH;IACzB,wFAAwF;IACxF,MAAMI,oBAAoB;QACtB;QACA;QACA;QACA;QACA;KACH;IACD,iBAAiB;IACjB,MAAMC,gBAAgB;QAClBC,UAAU;QACVC,OAAO;QACPC,QAAQ;YACJC,WAAW;YACXC,UAAU;QACd;QACAN;QACA,GAAGO,IAAAA,6CAA2B,EAACR,YAAY;IAC/C;IACA,MAAM,EAAES,UAAS,EAAGC,aAAY,EAAG,GAAGC,IAAAA,gCAAc,EAACT;IACrD,MAAMU,aAAaC,IAAAA,6BAAa,EAACd,qBAAqB,IAAI,IAAIA,qBAAqB,KAAK,IAAI,KAAK,IAAIA,iBAAiBe,GAAG,EAAEJ;IAC3H,MAAMK,UAAUhB,oBAAoB;QAChC,GAAGA,gBAAgB;QACnBe,KAAKF;IACT;IACA,OAAO;QACH;YACI,GAAGd,gBAAgB;YACnBgB,KAAKD,IAAAA,6BAAa,EAACf,qBAAqB,IAAI,IAAIA,qBAAqB,KAAK,IAAI,KAAK,IAAIA,iBAAiBgB,GAAG,EAAEL;QACjH;QACAM;KACH;AACL"}
@@ -75,6 +75,4 @@ const useOptionCollection = ()=>{
75
75
  options: nodes.current.map((node)=>node.option),
76
76
  registerOption
77
77
  };
78
- }; //# sourceMappingURL=useOptionCollection.js.map
79
-
80
- //# sourceMappingURL=useOptionCollection.js.map
78
+ };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/useOptionCollection.js"],"sourcesContent":["import * as React from 'react';\n/**\n * A hook for managing a collection of child Options\n */\nexport const useOptionCollection = () => {\n const nodes = React.useRef([]);\n const collectionAPI = React.useMemo(() => {\n const getCount = () => nodes.current.length;\n const getOptionAtIndex = index => {\n var _nodes_current_index;\n return (_nodes_current_index = nodes.current[index]) === null || _nodes_current_index === void 0 ? void 0 : _nodes_current_index.option;\n };\n const getIndexOfId = id => nodes.current.findIndex(node => node.option.id === id);\n const getOptionById = id => {\n const item = nodes.current.find(node => node.option.id === id);\n return item === null || item === void 0 ? void 0 : item.option;\n };\n const getOptionsMatchingText = matcher => {\n return nodes.current.filter(node => matcher(node.option.text)).map(node => node.option);\n };\n const getOptionsMatchingValue = matcher => {\n return nodes.current.filter(node => matcher(node.option.value)).map(node => node.option);\n };\n return {\n getCount,\n getOptionAtIndex,\n getIndexOfId,\n getOptionById,\n getOptionsMatchingText,\n getOptionsMatchingValue\n };\n }, []);\n const registerOption = React.useCallback((option, element) => {\n var _nodes_current_index;\n const index = nodes.current.findIndex(node => {\n if (!node.element || !element) {\n return false;\n }\n if (node.option.id === option.id) {\n return true;\n }\n // use the DOM method compareDocumentPosition to order the current node against registered nodes\n // eslint-disable-next-line no-bitwise\n return node.element.compareDocumentPosition(element) & Node.DOCUMENT_POSITION_PRECEDING;\n });\n // do not register the option if it already exists\n if (((_nodes_current_index = nodes.current[index]) === null || _nodes_current_index === void 0 ? void 0 : _nodes_current_index.option.id) !== option.id) {\n const newItem = {\n element,\n option\n };\n // If an index is not found we will push the element to the end.\n if (index === -1) {\n nodes.current = [...nodes.current, newItem];\n } else {\n nodes.current.splice(index, 0, newItem);\n }\n }\n // return the unregister function\n return () => {\n nodes.current = nodes.current.filter(node => node.option.id !== option.id);\n };\n }, []);\n return {\n ...collectionAPI,\n options: nodes.current.map(node => node.option),\n registerOption\n };\n};\n//# sourceMappingURL=useOptionCollection.js.map"],"names":["useOptionCollection","nodes","React","useRef","collectionAPI","useMemo","getCount","current","length","getOptionAtIndex","index","_nodes_current_index","option","getIndexOfId","id","findIndex","node","getOptionById","item","find","getOptionsMatchingText","matcher","filter","text","map","getOptionsMatchingValue","value","registerOption","useCallback","element","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","newItem","splice","options"],"mappings":";;;;+BAIaA;;aAAAA;;;6DAJU;AAIhB,MAAMA,sBAAsB,IAAM;IACvC,MAAMC,QAAQC,OAAMC,MAAM,CAAC,EAAE;IAC7B,MAAMC,gBAAgBF,OAAMG,OAAO,CAAC,IAAM;QACxC,MAAMC,WAAW,IAAML,MAAMM,OAAO,CAACC,MAAM;QAC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AKF,OAAOE,EAAE,EAAE;gBAChC,OAAO,IAAI;YACb,CAAC;YACD,gGAAgG;YAChG,sCAAsC;YACtC,OAAOE,KAAKa,OAAO,CAACC,uBAAuB,CAACD,WAAWE,KAAKC,2BAA2B;QACzF;QACA,kDAAkD;QAClD,IAAI,AAAC,CAAA,AAACrB,CAAAA,uBAAuBV,MAAMM,OAAO,CAACG,MAAM,AAAD,MAAO,IAAI,IAAIC,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBC,MAAM,CAACE,EAAE,AAAD,MAAOF,OAAOE,EAAE,EAAE;YACvJ,MAAMmB,UAAU;gBACdJ;gBACAjB;YACF;YACA,gEAAgE;YAChE,IAAIF,UAAU,CAAC,GAAG;gBAChBT,MAAMM,OAAO,GAAG;uBAAIN,MAAMM,OAAO;oBAAE0B;iBAAQ;YAC7C,OAAO;gBACLhC,MAAMM,OAAO,CAAC2B,MAAM,CAACxB,OAAO,GAAGuB;YACjC,CAAC;QACH,CAAC;QACD,iCAAiC;QACjC,OAAO,IAAM;YACXhC,MAAMM,OAAO,GAAGN,MAAMM,OAAO,CAACe,MAAM,CAACN,CAAAA,OAAQA,KAAKJ,MAAM,CAACE,EAAE,KAAKF,OAAOE,EAAE;QAC3E;IACF,GAAG,EAAE;IACL,OAAO;QACL,GAAGV,aAAa;QAChB+B,SAASlC,MAAMM,OAAO,CAACiB,GAAG,CAACR,CAAAA,OAAQA,KAAKJ,MAAM;QAC9Ce;IACF;AACF,GACA,+CAA+C"}
1
+ {"version":3,"sources":["useOptionCollection.js"],"sourcesContent":["import * as React from 'react';\n/**\n * A hook for managing a collection of child Options\n */ export const useOptionCollection = ()=>{\n const nodes = React.useRef([]);\n const collectionAPI = React.useMemo(()=>{\n const getCount = ()=>nodes.current.length;\n const getOptionAtIndex = (index)=>{\n var _nodes_current_index;\n return (_nodes_current_index = nodes.current[index]) === null || _nodes_current_index === void 0 ? void 0 : _nodes_current_index.option;\n };\n const getIndexOfId = (id)=>nodes.current.findIndex((node)=>node.option.id === id);\n const getOptionById = (id)=>{\n const item = nodes.current.find((node)=>node.option.id === id);\n return item === null || item === void 0 ? void 0 : item.option;\n };\n const getOptionsMatchingText = (matcher)=>{\n return nodes.current.filter((node)=>matcher(node.option.text)).map((node)=>node.option);\n };\n const getOptionsMatchingValue = (matcher)=>{\n return nodes.current.filter((node)=>matcher(node.option.value)).map((node)=>node.option);\n };\n return {\n getCount,\n getOptionAtIndex,\n getIndexOfId,\n getOptionById,\n getOptionsMatchingText,\n getOptionsMatchingValue\n };\n }, []);\n const registerOption = React.useCallback((option, element)=>{\n var _nodes_current_index;\n const index = nodes.current.findIndex((node)=>{\n if (!node.element || !element) {\n return false;\n }\n if (node.option.id === option.id) {\n return true;\n }\n // use the DOM method compareDocumentPosition to order the current node against registered nodes\n // eslint-disable-next-line no-bitwise\n return node.element.compareDocumentPosition(element) & Node.DOCUMENT_POSITION_PRECEDING;\n });\n // do not register the option if it already exists\n if (((_nodes_current_index = nodes.current[index]) === null || _nodes_current_index === void 0 ? void 0 : _nodes_current_index.option.id) !== option.id) {\n const newItem = {\n element,\n option\n };\n // If an index is not found we will push the element to the end.\n if (index === -1) {\n nodes.current = [\n ...nodes.current,\n newItem\n ];\n } else {\n nodes.current.splice(index, 0, newItem);\n }\n }\n // return the unregister function\n return ()=>{\n nodes.current = nodes.current.filter((node)=>node.option.id !== option.id);\n };\n }, []);\n return {\n ...collectionAPI,\n options: nodes.current.map((node)=>node.option),\n registerOption\n };\n};\n"],"names":["useOptionCollection","nodes","React","useRef","collectionAPI","useMemo","getCount","current","length","getOptionAtIndex","index","_nodes_current_index","option","getIndexOfId","id","findIndex","node","getOptionById","item","find","getOptionsMatchingText","matcher","filter","text","map","getOptionsMatchingValue","value","registerOption","useCallback","element","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","newItem","splice","options"],"mappings":";;;;+BAGiBA;;aAAAA;;;6DAHM;AAGZ,MAAMA,sBAAsB,IAAI;IACvC,MAAMC,QAAQC,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AI,CAACA,KAAKa,OAAO,IAAI,CAACA,SAAS;gBAC3B,OAAO,KAAK;YAChB,CAAC;YACD,IAAIb,KAAKJ,MAAM,CAACE,EAAE,KAAKF,OAAOE,EAAE,EAAE;gBAC9B,OAAO,IAAI;YACf,CAAC;YACD,gGAAgG;YAChG,sCAAsC;YACtC,OAAOE,KAAKa,OAAO,CAACC,uBAAuB,CAACD,WAAWE,KAAKC,2BAA2B;QAC3F;QACA,kDAAkD;QAClD,IAAI,AAAC,CAAA,AAACrB,CAAAA,uBAAuBV,MAAMM,OAAO,CAACG,MAAM,AAAD,MAAO,IAAI,IAAIC,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBC,MAAM,CAACE,EAAE,AAAD,MAAOF,OAAOE,EAAE,EAAE;YACrJ,MAAMmB,UAAU;gBACZJ;gBACAjB;YACJ;YACA,gEAAgE;YAChE,IAAIF,UAAU,CAAC,GAAG;gBACdT,MAAMM,OAAO,GAAG;uBACTN,MAAMM,OAAO;oBAChB0B;iBACH;YACL,OAAO;gBACHhC,MAAMM,OAAO,CAAC2B,MAAM,CAACxB,OAAO,GAAGuB;YACnC,CAAC;QACL,CAAC;QACD,iCAAiC;QACjC,OAAO,IAAI;YACPhC,MAAMM,OAAO,GAAGN,MAAMM,OAAO,CAACe,MAAM,CAAC,CAACN,OAAOA,KAAKJ,MAAM,CAACE,EAAE,KAAKF,OAAOE,EAAE;QAC7E;IACJ,GAAG,EAAE;IACL,OAAO;QACH,GAAGV,aAAa;QAChB+B,SAASlC,MAAMM,OAAO,CAACiB,GAAG,CAAC,CAACR,OAAOA,KAAKJ,MAAM;QAC9Ce;IACJ;AACJ"}
@@ -35,6 +35,4 @@ function useScrollOptionsIntoView(state) {
35
35
  activeOption
36
36
  ]);
37
37
  return scrollContainerRef;
38
- } //# sourceMappingURL=useScrollOptionsIntoView.js.map
39
-
40
- //# sourceMappingURL=useScrollOptionsIntoView.js.map
38
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/useScrollOptionsIntoView.js"],"sourcesContent":["import * as React from 'react';\nimport { canUseDOM } from '@fluentui/react-utilities';\nexport function useScrollOptionsIntoView(state) {\n const {\n activeOption\n } = state;\n const scrollContainerRef = React.useRef(null);\n React.useEffect(() => {\n if (scrollContainerRef.current && activeOption && canUseDOM()) {\n const activeOptionElement = scrollContainerRef.current.querySelector(`#${activeOption.id}`);\n if (!activeOptionElement) {\n return;\n }\n const {\n offsetHeight,\n offsetTop\n } = activeOptionElement;\n const {\n offsetHeight: parentOffsetHeight,\n scrollTop\n } = scrollContainerRef.current;\n const isAbove = offsetTop < scrollTop;\n const isBelow = offsetTop + offsetHeight > scrollTop + parentOffsetHeight;\n // add a small buffer for general visual nicety\n // it looks slightly better if the option has some space from the top/bottom while arrowing\n const buffer = 2;\n if (isAbove) {\n scrollContainerRef.current.scrollTo(0, offsetTop - buffer);\n } else if (isBelow) {\n scrollContainerRef.current.scrollTo(0, offsetTop - parentOffsetHeight + offsetHeight + buffer);\n }\n }\n }, [activeOption]);\n return scrollContainerRef;\n}\n//# sourceMappingURL=useScrollOptionsIntoView.js.map"],"names":["useScrollOptionsIntoView","state","activeOption","scrollContainerRef","React","useRef","useEffect","current","canUseDOM","activeOptionElement","querySelector","id","offsetHeight","offsetTop","parentOffsetHeight","scrollTop","isAbove","isBelow","buffer","scrollTo"],"mappings":";;;;+BAEgBA;;aAAAA;;;6DAFO;gCACG;AACnB,SAASA,yBAAyBC,KAAK,EAAE;IAC9C,MAAM,EACJC,aAAY,EACb,GAAGD;IACJ,MAAME,qBAAqBC,OAAMC,MAAM,CAAC,IAAI;IAC5CD,OAAME,SAAS,CAAC,IAAM;QACpB,IAAIH,mBAAmBI,OAAO,IAAIL,gBAAgBM,IAAAA,yBAAS,KAAI;YAC7D,MAAMC,sBAAsBN,mBAAmBI,OAAO,CAACG,aAAa,CAAC,CAAC,CAAC,EAAER,aAAaS,EAAE,CAAC,CAAC;YAC1F,IAAI,CAACF,qBAAqB;gBACxB;YACF,CAAC;YACD,MAAM,EACJG,aAAY,EACZC,UAAS,EACV,GAAGJ;YACJ,MAAM,EACJG,cAAcE,mBAAkB,EAChCC,UAAS,EACV,GAAGZ,mBAAmBI,OAAO;YAC9B,MAAMS,UAAUH,YAAYE;YAC5B,MAAME,UAAUJ,YAAYD,eAAeG,YAAYD;YACvD,+CAA+C;YAC/C,2FAA2F;YAC3F,MAAMI,SAAS;YACf,IAAIF,SAAS;gBACXb,mBAAmBI,OAAO,CAACY,QAAQ,CAAC,GAAGN,YAAYK;YACrD,OAAO,IAAID,SAAS;gBAClBd,mBAAmBI,OAAO,CAACY,QAAQ,CAAC,GAAGN,YAAYC,qBAAqBF,eAAeM;YACzF,CAAC;QACH,CAAC;IACH,GAAG;QAAChB;KAAa;IACjB,OAAOC;AACT,EACA,oDAAoD"}
1
+ {"version":3,"sources":["useScrollOptionsIntoView.js"],"sourcesContent":["import * as React from 'react';\nimport { canUseDOM } from '@fluentui/react-utilities';\nexport function useScrollOptionsIntoView(state) {\n const { activeOption } = state;\n const scrollContainerRef = React.useRef(null);\n React.useEffect(()=>{\n if (scrollContainerRef.current && activeOption && canUseDOM()) {\n const activeOptionElement = scrollContainerRef.current.querySelector(`#${activeOption.id}`);\n if (!activeOptionElement) {\n return;\n }\n const { offsetHeight , offsetTop } = activeOptionElement;\n const { offsetHeight: parentOffsetHeight , scrollTop } = scrollContainerRef.current;\n const isAbove = offsetTop < scrollTop;\n const isBelow = offsetTop + offsetHeight > scrollTop + parentOffsetHeight;\n // add a small buffer for general visual nicety\n // it looks slightly better if the option has some space from the top/bottom while arrowing\n const buffer = 2;\n if (isAbove) {\n scrollContainerRef.current.scrollTo(0, offsetTop - buffer);\n } else if (isBelow) {\n scrollContainerRef.current.scrollTo(0, offsetTop - parentOffsetHeight + offsetHeight + buffer);\n }\n }\n }, [\n activeOption\n ]);\n return scrollContainerRef;\n}\n"],"names":["useScrollOptionsIntoView","state","activeOption","scrollContainerRef","React","useRef","useEffect","current","canUseDOM","activeOptionElement","querySelector","id","offsetHeight","offsetTop","parentOffsetHeight","scrollTop","isAbove","isBelow","buffer","scrollTo"],"mappings":";;;;+BAEgBA;;aAAAA;;;6DAFO;gCACG;AACnB,SAASA,yBAAyBC,KAAK,EAAE;IAC5C,MAAM,EAAEC,aAAY,EAAG,GAAGD;IAC1B,MAAME,qBAAqBC,OAAMC,MAAM,CAAC,IAAI;IAC5CD,OAAME,SAAS,CAAC,IAAI;QAChB,IAAIH,mBAAmBI,OAAO,IAAIL,gBAAgBM,IAAAA,yBAAS,KAAI;YAC3D,MAAMC,sBAAsBN,mBAAmBI,OAAO,CAACG,aAAa,CAAC,CAAC,CAAC,EAAER,aAAaS,EAAE,CAAC,CAAC;YAC1F,IAAI,CAACF,qBAAqB;gBACtB;YACJ,CAAC;YACD,MAAM,EAAEG,aAAY,EAAGC,UAAS,EAAG,GAAGJ;YACtC,MAAM,EAAEG,cAAcE,mBAAkB,EAAGC,UAAS,EAAG,GAAGZ,mBAAmBI,OAAO;YACpF,MAAMS,UAAUH,YAAYE;YAC5B,MAAME,UAAUJ,YAAYD,eAAeG,YAAYD;YACvD,+CAA+C;YAC/C,2FAA2F;YAC3F,MAAMI,SAAS;YACf,IAAIF,SAAS;gBACTb,mBAAmBI,OAAO,CAACY,QAAQ,CAAC,GAAGN,YAAYK;YACvD,OAAO,IAAID,SAAS;gBAChBd,mBAAmBI,OAAO,CAACY,QAAQ,CAAC,GAAGN,YAAYC,qBAAqBF,eAAeM;YAC3F,CAAC;QACL,CAAC;IACL,GAAG;QACChB;KACH;IACD,OAAOC;AACX"}
@@ -66,6 +66,4 @@ const useSelection = (props)=>{
66
66
  selectOption,
67
67
  selectedOptions
68
68
  };
69
- }; //# sourceMappingURL=useSelection.js.map
70
-
71
- //# sourceMappingURL=useSelection.js.map
69
+ };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/useSelection.js"],"sourcesContent":["import { useCallback } from 'react';\nimport { useControllableState } from '@fluentui/react-utilities';\nexport const useSelection = props => {\n const {\n defaultSelectedOptions,\n multiselect,\n onOptionSelect\n } = props;\n const [selectedOptions, setSelectedOptions] = useControllableState({\n state: props.selectedOptions,\n defaultState: defaultSelectedOptions,\n initialState: []\n });\n const selectOption = useCallback((event, option) => {\n // if the option is disabled, do nothing\n if (option.disabled) {\n return;\n }\n // for single-select, always return the selected option\n let newSelection = [option.value];\n // toggle selected state of the option for multiselect\n if (multiselect) {\n const selectedIndex = selectedOptions.findIndex(o => o === option.value);\n if (selectedIndex > -1) {\n // deselect option\n newSelection = [...selectedOptions.slice(0, selectedIndex), ...selectedOptions.slice(selectedIndex + 1)];\n } else {\n // select option\n newSelection = [...selectedOptions, option.value];\n }\n }\n setSelectedOptions(newSelection);\n onOptionSelect === null || onOptionSelect === void 0 ? void 0 : onOptionSelect(event, {\n optionValue: option.value,\n optionText: option.text,\n selectedOptions: newSelection\n });\n }, [onOptionSelect, multiselect, selectedOptions, setSelectedOptions]);\n const clearSelection = event => {\n setSelectedOptions([]);\n onOptionSelect === null || onOptionSelect === void 0 ? void 0 : onOptionSelect(event, {\n optionValue: undefined,\n optionText: undefined,\n selectedOptions: []\n });\n };\n return {\n clearSelection,\n selectOption,\n selectedOptions\n };\n};\n//# sourceMappingURL=useSelection.js.map"],"names":["useSelection","props","defaultSelectedOptions","multiselect","onOptionSelect","selectedOptions","setSelectedOptions","useControllableState","state","defaultState","initialState","selectOption","useCallback","event","option","disabled","newSelection","value","selectedIndex","findIndex","o","slice","optionValue","optionText","text","clearSelection","undefined"],"mappings":";;;;+BAEaA;;aAAAA;;uBAFe;gCACS;AAC9B,MAAMA,eAAeC,CAAAA,QAAS;IACnC,MAAM,EACJC,uBAAsB,EACtBC,YAAW,EACXC,eAAc,EACf,GAAGH;IACJ,MAAM,CAACI,iBAAiBC,mBAAmB,GAAGC,IAAAA,oCAAoB,EAAC;QACjEC,OAAOP,MAAMI,eAAe;QAC5BI,cAAcP;QACdQ,cAAc,EAAE;IAClB;IACA,MAAMC,eAAeC,IAAAA,kBAAW,EAAC,CAACC,OAAOC,SAAW;QAClD,wCAAwC;QACxC,IAAIA,OAAOC,QAAQ,EAAE;YACnB;QACF,CAAC;QACD,uDAAuD;QACvD,IAAIC,eAAe;YAACF,OAAOG,KAAK;SAAC;QACjC,sDAAsD;QACtD,IAAId,aAAa;YACf,MAAMe,gBAAgBb,gBAAgBc,SAAS,CAACC,CAAAA,IAAKA,MAAMN,OAAOG,KAAK;YACvE,IAAIC,gBAAgB,CAAC,GAAG;gBACtB,kBAAkB;gBAClBF,eAAe;uBAAIX,gBAAgBgB,KAAK,CAAC,GAAGH;uBAAmBb,gBAAgBgB,KAAK,CAACH,gBAAgB;iBAAG;YAC1G,OAAO;gBACL,gBAAgB;gBAChBF,eAAe;uBAAIX;oBAAiBS,OAAOG,KAAK;iBAAC;YACnD,CAAC;QACH,CAAC;QACDX,mBAAmBU;QACnBZ,mBAAmB,IAAI,IAAIA,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAeS,OAAO;YACpFS,aAAaR,OAAOG,KAAK;YACzBM,YAAYT,OAAOU,IAAI;YACvBnB,iBAAiBW;QACnB,EAAE;IACJ,GAAG;QAACZ;QAAgBD;QAAaE;QAAiBC;KAAmB;IACrE,MAAMmB,iBAAiBZ,CAAAA,QAAS;QAC9BP,mBAAmB,EAAE;QACrBF,mBAAmB,IAAI,IAAIA,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAeS,OAAO;YACpFS,aAAaI;YACbH,YAAYG;YACZrB,iBAAiB,EAAE;QACrB,EAAE;IACJ;IACA,OAAO;QACLoB;QACAd;QACAN;IACF;AACF,GACA,wCAAwC"}
1
+ {"version":3,"sources":["useSelection.js"],"sourcesContent":["import { useCallback } from 'react';\nimport { useControllableState } from '@fluentui/react-utilities';\nexport const useSelection = (props)=>{\n const { defaultSelectedOptions , multiselect , onOptionSelect } = props;\n const [selectedOptions, setSelectedOptions] = useControllableState({\n state: props.selectedOptions,\n defaultState: defaultSelectedOptions,\n initialState: []\n });\n const selectOption = useCallback((event, option)=>{\n // if the option is disabled, do nothing\n if (option.disabled) {\n return;\n }\n // for single-select, always return the selected option\n let newSelection = [\n option.value\n ];\n // toggle selected state of the option for multiselect\n if (multiselect) {\n const selectedIndex = selectedOptions.findIndex((o)=>o === option.value);\n if (selectedIndex > -1) {\n // deselect option\n newSelection = [\n ...selectedOptions.slice(0, selectedIndex),\n ...selectedOptions.slice(selectedIndex + 1)\n ];\n } else {\n // select option\n newSelection = [\n ...selectedOptions,\n option.value\n ];\n }\n }\n setSelectedOptions(newSelection);\n onOptionSelect === null || onOptionSelect === void 0 ? void 0 : onOptionSelect(event, {\n optionValue: option.value,\n optionText: option.text,\n selectedOptions: newSelection\n });\n }, [\n onOptionSelect,\n multiselect,\n selectedOptions,\n setSelectedOptions\n ]);\n const clearSelection = (event)=>{\n setSelectedOptions([]);\n onOptionSelect === null || onOptionSelect === void 0 ? void 0 : onOptionSelect(event, {\n optionValue: undefined,\n optionText: undefined,\n selectedOptions: []\n });\n };\n return {\n clearSelection,\n selectOption,\n selectedOptions\n };\n};\n"],"names":["useSelection","props","defaultSelectedOptions","multiselect","onOptionSelect","selectedOptions","setSelectedOptions","useControllableState","state","defaultState","initialState","selectOption","useCallback","event","option","disabled","newSelection","value","selectedIndex","findIndex","o","slice","optionValue","optionText","text","clearSelection","undefined"],"mappings":";;;;+BAEaA;;aAAAA;;uBAFe;gCACS;AAC9B,MAAMA,eAAe,CAACC,QAAQ;IACjC,MAAM,EAAEC,uBAAsB,EAAGC,YAAW,EAAGC,eAAc,EAAG,GAAGH;IACnE,MAAM,CAACI,iBAAiBC,mBAAmB,GAAGC,IAAAA,oCAAoB,EAAC;QAC/DC,OAAOP,MAAMI,eAAe;QAC5BI,cAAcP;QACdQ,cAAc,EAAE;IACpB;IACA,MAAMC,eAAeC,IAAAA,kBAAW,EAAC,CAACC,OAAOC,SAAS;QAC9C,wCAAwC;QACxC,IAAIA,OAAOC,QAAQ,EAAE;YACjB;QACJ,CAAC;QACD,uDAAuD;QACvD,IAAIC,eAAe;YACfF,OAAOG,KAAK;SACf;QACD,sDAAsD;QACtD,IAAId,aAAa;YACb,MAAMe,gBAAgBb,gBAAgBc,SAAS,CAAC,CAACC,IAAIA,MAAMN,OAAOG,KAAK;YACvE,IAAIC,gBAAgB,CAAC,GAAG;gBACpB,kBAAkB;gBAClBF,eAAe;uBACRX,gBAAgBgB,KAAK,CAAC,GAAGH;uBACzBb,gBAAgBgB,KAAK,CAACH,gBAAgB;iBAC5C;YACL,OAAO;gBACH,gBAAgB;gBAChBF,eAAe;uBACRX;oBACHS,OAAOG,KAAK;iBACf;YACL,CAAC;QACL,CAAC;QACDX,mBAAmBU;QACnBZ,mBAAmB,IAAI,IAAIA,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAeS,OAAO;YAClFS,aAAaR,OAAOG,KAAK;YACzBM,YAAYT,OAAOU,IAAI;YACvBnB,iBAAiBW;QACrB,EAAE;IACN,GAAG;QACCZ;QACAD;QACAE;QACAC;KACH;IACD,MAAMmB,iBAAiB,CAACZ,QAAQ;QAC5BP,mBAAmB,EAAE;QACrBF,mBAAmB,IAAI,IAAIA,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAeS,OAAO;YAClFS,aAAaI;YACbH,YAAYG;YACZrB,iBAAiB,EAAE;QACvB,EAAE;IACN;IACA,OAAO;QACHoB;QACAd;QACAN;IACJ;AACJ"}
@@ -35,10 +35,10 @@ function useTriggerListboxSlots(props, state, ref, triggerSlot, listboxSlot) {
35
35
  ref: (0, _reactUtilities.useMergedRefs)(ref, triggerSlot === null || triggerSlot === void 0 ? void 0 : triggerSlot.ref, triggerRef)
36
36
  };
37
37
  /*
38
- * Handle focus when clicking the listbox popup:
39
- * 1. Move focus back to the button/input when the listbox is clicked (otherwise it goes to body)
40
- * 2. Do not close the listbox on button/input blur when clicking into the listbox
41
- */ const listboxOnClick = (0, _reactUtilities.useEventCallback)((0, _reactUtilities.mergeCallbacks)((event)=>{
38
+ * Handle focus when clicking the listbox popup:
39
+ * 1. Move focus back to the button/input when the listbox is clicked (otherwise it goes to body)
40
+ * 2. Do not close the listbox on button/input blur when clicking into the listbox
41
+ */ const listboxOnClick = (0, _reactUtilities.useEventCallback)((0, _reactUtilities.mergeCallbacks)((event)=>{
42
42
  var _triggerRef_current;
43
43
  (_triggerRef_current = triggerRef.current) === null || _triggerRef_current === void 0 ? void 0 : _triggerRef_current.focus();
44
44
  }, listbox === null || listbox === void 0 ? void 0 : listbox.onClick));
@@ -116,6 +116,4 @@ function useTriggerListboxSlots(props, state, ref, triggerSlot, listboxSlot) {
116
116
  trigger,
117
117
  listbox
118
118
  ];
119
- } //# sourceMappingURL=useTriggerListboxSlots.js.map
120
-
121
- //# sourceMappingURL=useTriggerListboxSlots.js.map
119
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/utils/useTriggerListboxSlots.js"],"sourcesContent":["import * as React from 'react';\nimport { mergeCallbacks, useId, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { getDropdownActionFromKey, getIndexFromAction } from '../utils/dropdownKeyActions';\n/*\n * useTriggerListboxSlots returns a tuple of trigger/listbox shorthand,\n * with the semantics and event handlers needed for the Combobox and Dropdown components.\n * The element type of the ref should always match the element type used in the trigger shorthand.\n */\nexport function useTriggerListboxSlots(props, state, ref, triggerSlot, listboxSlot) {\n const {\n multiselect\n } = props;\n const {\n activeOption,\n getCount,\n getIndexOfId,\n getOptionAtIndex,\n ignoreNextBlur,\n open,\n selectOption,\n setActiveOption,\n setFocusVisible,\n setHasFocus,\n setOpen\n } = state;\n // handle trigger focus/blur\n const triggerRef = React.useRef(null);\n // resolve listbox shorthand props\n const listboxId = useId('fluent-listbox', listboxSlot === null || listboxSlot === void 0 ? void 0 : listboxSlot.id);\n const listbox = listboxSlot && {\n id: listboxId,\n multiselect,\n tabIndex: undefined,\n ...listboxSlot\n };\n // resolve trigger shorthand props\n const trigger = {\n 'aria-expanded': open,\n 'aria-activedescendant': open ? activeOption === null || activeOption === void 0 ? void 0 : activeOption.id : undefined,\n role: 'combobox',\n ...triggerSlot,\n // explicitly type the ref as an intersection here to prevent type errors\n // since the `children` prop has mutually incompatible types between input/button\n // functionally both ref and triggerRef will always be the same element type\n ref: useMergedRefs(ref, triggerSlot === null || triggerSlot === void 0 ? void 0 : triggerSlot.ref, triggerRef)\n };\n /*\n * Handle focus when clicking the listbox popup:\n * 1. Move focus back to the button/input when the listbox is clicked (otherwise it goes to body)\n * 2. Do not close the listbox on button/input blur when clicking into the listbox\n */\n const listboxOnClick = useEventCallback(mergeCallbacks(event => {\n var _triggerRef_current;\n (_triggerRef_current = triggerRef.current) === null || _triggerRef_current === void 0 ? void 0 : _triggerRef_current.focus();\n }, listbox === null || listbox === void 0 ? void 0 : listbox.onClick));\n const listboxOnMouseOver = useEventCallback(mergeCallbacks(event => {\n setFocusVisible(false);\n }, listbox === null || listbox === void 0 ? void 0 : listbox.onMouseOver));\n const listboxOnMouseDown = useEventCallback(mergeCallbacks(event => {\n ignoreNextBlur.current = true;\n }, listbox === null || listbox === void 0 ? void 0 : listbox.onMouseDown));\n // listbox is nullable, only add event handlers if it exists\n if (listbox) {\n listbox.onClick = listboxOnClick;\n listbox.onMouseOver = listboxOnMouseOver;\n listbox.onMouseDown = listboxOnMouseDown;\n }\n // the trigger should open/close the popup on click or blur\n trigger.onBlur = mergeCallbacks(event => {\n if (!ignoreNextBlur.current) {\n setOpen(event, false);\n }\n ignoreNextBlur.current = false;\n setHasFocus(false);\n }, trigger.onBlur);\n trigger.onClick = mergeCallbacks(event => {\n setOpen(event, !open);\n }, trigger.onClick);\n trigger.onFocus = mergeCallbacks(event => {\n setHasFocus(true);\n }, trigger.onFocus);\n // handle combobox keyboard interaction\n trigger.onKeyDown = mergeCallbacks(event => {\n const action = getDropdownActionFromKey(event, {\n open,\n multiselect\n });\n const maxIndex = getCount() - 1;\n const activeIndex = activeOption ? getIndexOfId(activeOption.id) : -1;\n let newIndex = activeIndex;\n switch (action) {\n case 'Open':\n event.preventDefault();\n setFocusVisible(true);\n setOpen(event, true);\n break;\n case 'Close':\n // stop propagation for escape key to avoid dismissing any parent popups\n event.stopPropagation();\n event.preventDefault();\n setOpen(event, false);\n break;\n case 'CloseSelect':\n !multiselect && !(activeOption === null || activeOption === void 0 ? void 0 : activeOption.disabled) && setOpen(event, false);\n // fallthrough\n case 'Select':\n activeOption && selectOption(event, activeOption);\n event.preventDefault();\n break;\n case 'Tab':\n !multiselect && activeOption && selectOption(event, activeOption);\n break;\n default:\n newIndex = getIndexFromAction(action, activeIndex, maxIndex);\n }\n if (newIndex !== activeIndex) {\n // prevent default page scroll/keyboard action if the index changed\n event.preventDefault();\n setActiveOption(getOptionAtIndex(newIndex));\n setFocusVisible(true);\n }\n }, trigger.onKeyDown);\n trigger.onMouseOver = mergeCallbacks(event => {\n setFocusVisible(false);\n }, trigger.onMouseOver);\n return [trigger, listbox];\n}\n//# sourceMappingURL=useTriggerListboxSlots.js.map"],"names":["useTriggerListboxSlots","props","state","ref","triggerSlot","listboxSlot","multiselect","activeOption","getCount","getIndexOfId","getOptionAtIndex","ignoreNextBlur","open","selectOption","setActiveOption","setFocusVisible","setHasFocus","setOpen","triggerRef","React","useRef","listboxId","useId","id","listbox","tabIndex","undefined","trigger","role","useMergedRefs","listboxOnClick","useEventCallback","mergeCallbacks","event","_triggerRef_current","current","focus","onClick","listboxOnMouseOver","onMouseOver","listboxOnMouseDown","onMouseDown","onBlur","onFocus","onKeyDown","action","getDropdownActionFromKey","maxIndex","activeIndex","newIndex","preventDefault","stopPropagation","disabled","getIndexFromAction"],"mappings":";;;;+BAQgBA;;aAAAA;;;6DARO;gCACgD;oCACV;AAMtD,SAASA,uBAAuBC,KAAK,EAAEC,KAAK,EAAEC,GAAG,EAAEC,WAAW,EAAEC,WAAW,EAAE;IAClF,MAAM,EACJC,YAAW,EACZ,GAAGL;IACJ,MAAM,EACJM,aAAY,EACZC,SAAQ,EACRC,aAAY,EACZC,iBAAgB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ACpBjC,QAAQgB,OAAO,KAAK;gBACpB,KAAM;YACR,KAAK;gBACH,CAAC3B,eAAe,CAAEC,CAAAA,iBAAiB,IAAI,IAAIA,iBAAiB,KAAK,IAAI,KAAK,IAAIA,aAAa6C,QAAQ,AAAD,KAAMnC,QAAQgB,OAAO,KAAK;YAC9H,cAAc;YACd,KAAK;gBACH1B,gBAAgBM,aAAaoB,OAAO1B;gBACpC0B,MAAMiB,cAAc;gBACpB,KAAM;YACR,KAAK;gBACH,CAAC5C,eAAeC,gBAAgBM,aAAaoB,OAAO1B;gBACpD,KAAM;YACR;gBACE0C,WAAWI,IAAAA,sCAAkB,EAACR,QAAQG,aAAaD;QACvD;QACA,IAAIE,aAAaD,aAAa;YAC5B,mEAAmE;YACnEf,MAAMiB,cAAc;YACpBpC,gBAAgBJ,iBAAiBuC;YACjClC,gBAAgB,IAAI;QACtB,CAAC;IACH,GAAGY,QAAQiB,SAAS;IACpBjB,QAAQY,WAAW,GAAGP,IAAAA,8BAAc,EAACC,CAAAA,QAAS;QAC5ClB,gBAAgB,KAAK;IACvB,GAAGY,QAAQY,WAAW;IACtB,OAAO;QAACZ;QAASH;KAAQ;AAC3B,EACA,kDAAkD"}
1
+ {"version":3,"sources":["useTriggerListboxSlots.js"],"sourcesContent":["import * as React from 'react';\nimport { mergeCallbacks, useId, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { getDropdownActionFromKey, getIndexFromAction } from '../utils/dropdownKeyActions';\n/*\n * useTriggerListboxSlots returns a tuple of trigger/listbox shorthand,\n * with the semantics and event handlers needed for the Combobox and Dropdown components.\n * The element type of the ref should always match the element type used in the trigger shorthand.\n */ export function useTriggerListboxSlots(props, state, ref, triggerSlot, listboxSlot) {\n const { multiselect } = props;\n const { activeOption , getCount , getIndexOfId , getOptionAtIndex , ignoreNextBlur , open , selectOption , setActiveOption , setFocusVisible , setHasFocus , setOpen } = state;\n // handle trigger focus/blur\n const triggerRef = React.useRef(null);\n // resolve listbox shorthand props\n const listboxId = useId('fluent-listbox', listboxSlot === null || listboxSlot === void 0 ? void 0 : listboxSlot.id);\n const listbox = listboxSlot && {\n id: listboxId,\n multiselect,\n tabIndex: undefined,\n ...listboxSlot\n };\n // resolve trigger shorthand props\n const trigger = {\n 'aria-expanded': open,\n 'aria-activedescendant': open ? activeOption === null || activeOption === void 0 ? void 0 : activeOption.id : undefined,\n role: 'combobox',\n ...triggerSlot,\n // explicitly type the ref as an intersection here to prevent type errors\n // since the `children` prop has mutually incompatible types between input/button\n // functionally both ref and triggerRef will always be the same element type\n ref: useMergedRefs(ref, triggerSlot === null || triggerSlot === void 0 ? void 0 : triggerSlot.ref, triggerRef)\n };\n /*\n * Handle focus when clicking the listbox popup:\n * 1. Move focus back to the button/input when the listbox is clicked (otherwise it goes to body)\n * 2. Do not close the listbox on button/input blur when clicking into the listbox\n */ const listboxOnClick = useEventCallback(mergeCallbacks((event)=>{\n var _triggerRef_current;\n (_triggerRef_current = triggerRef.current) === null || _triggerRef_current === void 0 ? void 0 : _triggerRef_current.focus();\n }, listbox === null || listbox === void 0 ? void 0 : listbox.onClick));\n const listboxOnMouseOver = useEventCallback(mergeCallbacks((event)=>{\n setFocusVisible(false);\n }, listbox === null || listbox === void 0 ? void 0 : listbox.onMouseOver));\n const listboxOnMouseDown = useEventCallback(mergeCallbacks((event)=>{\n ignoreNextBlur.current = true;\n }, listbox === null || listbox === void 0 ? void 0 : listbox.onMouseDown));\n // listbox is nullable, only add event handlers if it exists\n if (listbox) {\n listbox.onClick = listboxOnClick;\n listbox.onMouseOver = listboxOnMouseOver;\n listbox.onMouseDown = listboxOnMouseDown;\n }\n // the trigger should open/close the popup on click or blur\n trigger.onBlur = mergeCallbacks((event)=>{\n if (!ignoreNextBlur.current) {\n setOpen(event, false);\n }\n ignoreNextBlur.current = false;\n setHasFocus(false);\n }, trigger.onBlur);\n trigger.onClick = mergeCallbacks((event)=>{\n setOpen(event, !open);\n }, trigger.onClick);\n trigger.onFocus = mergeCallbacks((event)=>{\n setHasFocus(true);\n }, trigger.onFocus);\n // handle combobox keyboard interaction\n trigger.onKeyDown = mergeCallbacks((event)=>{\n const action = getDropdownActionFromKey(event, {\n open,\n multiselect\n });\n const maxIndex = getCount() - 1;\n const activeIndex = activeOption ? getIndexOfId(activeOption.id) : -1;\n let newIndex = activeIndex;\n switch(action){\n case 'Open':\n event.preventDefault();\n setFocusVisible(true);\n setOpen(event, true);\n break;\n case 'Close':\n // stop propagation for escape key to avoid dismissing any parent popups\n event.stopPropagation();\n event.preventDefault();\n setOpen(event, false);\n break;\n case 'CloseSelect':\n !multiselect && !(activeOption === null || activeOption === void 0 ? void 0 : activeOption.disabled) && setOpen(event, false);\n // fallthrough\n case 'Select':\n activeOption && selectOption(event, activeOption);\n event.preventDefault();\n break;\n case 'Tab':\n !multiselect && activeOption && selectOption(event, activeOption);\n break;\n default:\n newIndex = getIndexFromAction(action, activeIndex, maxIndex);\n }\n if (newIndex !== activeIndex) {\n // prevent default page scroll/keyboard action if the index changed\n event.preventDefault();\n setActiveOption(getOptionAtIndex(newIndex));\n setFocusVisible(true);\n }\n }, trigger.onKeyDown);\n trigger.onMouseOver = mergeCallbacks((event)=>{\n setFocusVisible(false);\n }, trigger.onMouseOver);\n return [\n trigger,\n listbox\n ];\n}\n"],"names":["useTriggerListboxSlots","props","state","ref","triggerSlot","listboxSlot","multiselect","activeOption","getCount","getIndexOfId","getOptionAtIndex","ignoreNextBlur","open","selectOption","setActiveOption","setFocusVisible","setHasFocus","setOpen","triggerRef","React","useRef","listboxId","useId","id","listbox","tabIndex","undefined","trigger","role","useMergedRefs","listboxOnClick","useEventCallback","mergeCallbacks","event","_triggerRef_current","current","focus","onClick","listboxOnMouseOver","onMouseOver","listboxOnMouseDown","onMouseDown","onBlur","onFocus","onKeyDown","action","getDropdownActionFromKey","maxIndex","activeIndex","newIndex","preventDefault","stopPropagation","disabled","getIndexFromAction"],"mappings":";;;;+BAOoBA;;aAAAA;;;6DAPG;gCACgD;oCACV;AAKlD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B,WAAWD;QACf,OAAOH;YACH,KAAK;gBACDZ,MAAMiB,cAAc;gBACpBnC,gBAAgB,IAAI;gBACpBE,QAAQgB,OAAO,IAAI;gBACnB,KAAM;YACV,KAAK;gBACD,wEAAwE;gBACxEA,MAAMkB,eAAe;gBACrBlB,MAAMiB,cAAc;gBACpBjC,QAAQgB,OAAO,KAAK;gBACpB,KAAM;YACV,KAAK;gBACD,CAAC3B,eAAe,CAAEC,CAAAA,iBAAiB,IAAI,IAAIA,iBAAiB,KAAK,IAAI,KAAK,IAAIA,aAAa6C,QAAQ,AAAD,KAAMnC,QAAQgB,OAAO,KAAK;YAChI,cAAc;YACd,KAAK;gBACD1B,gBAAgBM,aAAaoB,OAAO1B;gBACpC0B,MAAMiB,cAAc;gBACpB,KAAM;YACV,KAAK;gBACD,CAAC5C,eAAeC,gBAAgBM,aAAaoB,OAAO1B;gBACpD,KAAM;YACV;gBACI0C,WAAWI,IAAAA,sCAAkB,EAACR,QAAQG,aAAaD;QAC3D;QACA,IAAIE,aAAaD,aAAa;YAC1B,mEAAmE;YACnEf,MAAMiB,cAAc;YACpBpC,gBAAgBJ,iBAAiBuC;YACjClC,gBAAgB,IAAI;QACxB,CAAC;IACL,GAAGY,QAAQiB,SAAS;IACpBjB,QAAQY,WAAW,GAAGP,IAAAA,8BAAc,EAAC,CAACC,QAAQ;QAC1ClB,gBAAgB,KAAK;IACzB,GAAGY,QAAQY,WAAW;IACtB,OAAO;QACHZ;QACAH;KACH;AACL"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-combobox",
3
- "version": "9.3.4",
3
+ "version": "9.4.0",
4
4
  "description": "Fluent UI React Combobox component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -28,22 +28,22 @@
28
28
  "devDependencies": {
29
29
  "@fluentui/eslint-plugin": "*",
30
30
  "@fluentui/react-conformance": "*",
31
- "@fluentui/react-conformance-griffel": "9.0.0-beta.21",
31
+ "@fluentui/react-conformance-griffel": "9.0.0-beta.22",
32
32
  "@fluentui/scripts-api-extractor": "*",
33
33
  "@fluentui/scripts-tasks": "*"
34
34
  },
35
35
  "dependencies": {
36
36
  "@fluentui/keyboard-keys": "^9.0.3",
37
- "@fluentui/react-context-selector": "^9.1.21",
38
- "@fluentui/react-field": "^9.1.5",
37
+ "@fluentui/react-context-selector": "^9.1.22",
38
+ "@fluentui/react-field": "^9.1.6",
39
39
  "@fluentui/react-icons": "^2.0.196",
40
- "@fluentui/react-jsx-runtime": "9.0.0-alpha.5",
41
- "@fluentui/react-portal": "^9.2.11",
42
- "@fluentui/react-positioning": "^9.5.14",
40
+ "@fluentui/react-jsx-runtime": "9.0.0-alpha.6",
41
+ "@fluentui/react-portal": "^9.2.12",
42
+ "@fluentui/react-positioning": "^9.6.0",
43
43
  "@fluentui/react-shared-contexts": "^9.5.0",
44
44
  "@fluentui/react-theme": "^9.1.8",
45
- "@fluentui/react-utilities": "^9.9.1",
46
- "@griffel/react": "^1.5.2",
45
+ "@fluentui/react-utilities": "^9.9.2",
46
+ "@griffel/react": "^1.5.7",
47
47
  "@swc/helpers": "^0.4.14"
48
48
  },
49
49
  "peerDependencies": {