@oracle/oraclejet-preact 20.1.1 → 20.1.2

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 (655) hide show
  1. package/amd/AccordionItemMultiple-7cfecf03.js +1 -1
  2. package/amd/AccordionItemSingle-6c70951e.js +1 -1
  3. package/amd/BarChart-379e0e10.js +1 -1
  4. package/amd/{BaseButton-9bf908ec.js → BaseButton-5a0ad529.js} +2 -2
  5. package/amd/{BaseButton-9bf908ec.js.map → BaseButton-5a0ad529.js.map} +1 -1
  6. package/amd/BaseCardView-825b1327.js +1 -1
  7. package/amd/{BaseCardViewSelectionTest-ac780d4f.js → BaseCardViewSelectionTest-66f166ce.js} +2 -2
  8. package/amd/{BaseCardViewSelectionTest-ac780d4f.js.map → BaseCardViewSelectionTest-66f166ce.js.map} +1 -1
  9. package/amd/BaseDiagram-7757c344.js +1 -1
  10. package/amd/BaseRichSelection-57e02c2d.js +1 -1
  11. package/amd/BaseSelector-3c7b8b87.js +1 -1
  12. package/amd/BaseSwatchView-2c401b4d.js +1 -1
  13. package/amd/BaseTabBarItem-6e22fcbc.js +1 -1
  14. package/amd/Button-e5d7c0e3.js +2 -0
  15. package/amd/{Button-d541cd67.js.map → Button-e5d7c0e3.js.map} +1 -1
  16. package/amd/ButtonSet-9f26cc51.js +1 -1
  17. package/amd/ButtonSetButton-ded680bb.js +1 -1
  18. package/amd/ButtonSetIconButton-b64b0830.js +1 -1
  19. package/amd/{Center-27a71002.js → Center-17925696.js} +2 -2
  20. package/amd/{Center-27a71002.js.map → Center-17925696.js.map} +1 -1
  21. package/amd/Chart-57d1c518.js +1 -1
  22. package/amd/Checkbox-3e80f017.js +1 -1
  23. package/amd/CheckboxControl-0746682f.js +1 -1
  24. package/amd/CheckboxRadioField-03179844.js +1 -1
  25. package/amd/CheckboxRadioLabelValueLayout-b728e6ec.js +1 -1
  26. package/amd/CheckboxSetContext-2e486ea8.js +2 -0
  27. package/{es/CheckboxSetContext-1be56556.js.map → amd/CheckboxSetContext-2e486ea8.js.map} +1 -1
  28. package/amd/Chip-8280de2e.js +1 -1
  29. package/amd/ClearIcon-a066df59.js +1 -1
  30. package/amd/CollapseIcon-a62fd41c.js +1 -1
  31. package/amd/Collapsible-0bf0c371.js +1 -1
  32. package/amd/CollapsibleNavigationList-91858994.js +1 -1
  33. package/amd/ColorPalette-43ffde6d.js +2 -0
  34. package/amd/{ColorPalette-f05a9dad.js.map → ColorPalette-43ffde6d.js.map} +1 -1
  35. package/amd/ColorPicker-3b4180e9.js +2 -0
  36. package/amd/{ColorPicker-236d84f0.js.map → ColorPicker-3b4180e9.js.map} +1 -1
  37. package/amd/ColorSwatch-52a06d25.js +1 -1
  38. package/amd/ComboChart-9cc157af.js +1 -1
  39. package/amd/CompactHelpSource-09ac9fe1.js +1 -1
  40. package/amd/CompactLabelAssistance-65c63769.js +2 -0
  41. package/amd/{CompactLabelAssistance-7bb76228.js.map → CompactLabelAssistance-65c63769.js.map} +1 -1
  42. package/amd/CompactUserAssistance-2fc90192.js +1 -1
  43. package/amd/ComponentMessageContainer-d5d70f71.js +1 -1
  44. package/amd/ConveyorBelt-e54ce1f7.js +1 -1
  45. package/amd/{DatePicker-89255880.js → DatePicker-ed971798.js} +2 -2
  46. package/amd/{DatePicker-89255880.js.map → DatePicker-ed971798.js.map} +1 -1
  47. package/amd/DatePickerHeader-b75e4c72.js +1 -1
  48. package/amd/{Dialog-ed9c4105.js → Dialog-9a4dbe57.js} +2 -2
  49. package/amd/{Dialog-ed9c4105.js.map → Dialog-9a4dbe57.js.map} +1 -1
  50. package/amd/DirectionalCollapseArrowIcon-ddc18f4b.js +1 -1
  51. package/amd/DirectionalExpandArrowIcon-9c710193.js +1 -1
  52. package/amd/DragHandle-29eba15d.js +2 -0
  53. package/amd/{DragHandle-652ffa0f.js.map → DragHandle-29eba15d.js.map} +1 -1
  54. package/amd/{DrawerPopup-ff31d785.js → DrawerPopup-c9e6374e.js} +2 -2
  55. package/amd/{DrawerPopup-ff31d785.js.map → DrawerPopup-c9e6374e.js.map} +1 -1
  56. package/amd/{Dropdown-d1438b58.js → Dropdown-9eed614a.js} +2 -2
  57. package/amd/{Dropdown-d1438b58.js.map → Dropdown-9eed614a.js.map} +1 -1
  58. package/amd/EmbeddedIconButton-d1472ac1.js +2 -0
  59. package/amd/{EmbeddedIconButton-c3cb14c0.js.map → EmbeddedIconButton-d1472ac1.js.map} +1 -1
  60. package/amd/{EnvironmentProvider-75ba928e.js → EnvironmentProvider-403bf554.js} +2 -2
  61. package/amd/{EnvironmentProvider-75ba928e.js.map → EnvironmentProvider-403bf554.js.map} +1 -1
  62. package/amd/ExpandableList-d7b3d65c.js +1 -1
  63. package/amd/Expander-683df228.js +1 -1
  64. package/amd/FilePicker-9e24c421.js +1 -1
  65. package/amd/FlatTreeView-5de96ffd.js +1 -1
  66. package/amd/Flex-4b81b412.js +2 -0
  67. package/amd/{Flex-71f83c12.js.map → Flex-4b81b412.js.map} +1 -1
  68. package/amd/{Floating-08c98ebd.js → Floating-9d6ab071.js} +2 -2
  69. package/amd/{Floating-08c98ebd.js.map → Floating-9d6ab071.js.map} +1 -1
  70. package/amd/FormLayout-023ab8de.js +1 -1
  71. package/amd/Gantt-cdd9d3cb.js +1 -1
  72. package/amd/{Grid-5324e17b.js → Grid-caac1c86.js} +2 -2
  73. package/amd/{Grid-5324e17b.js.map → Grid-caac1c86.js.map} +1 -1
  74. package/amd/GroupLoadingIndicator-4daed099.js +1 -1
  75. package/amd/HighlightText-ee76c447.js +2 -0
  76. package/amd/{HighlightText-365ba020.js.map → HighlightText-ee76c447.js.map} +1 -1
  77. package/amd/Icon-b9a01da9.js +1 -1
  78. package/amd/IconButton-d78fe636.js +1 -1
  79. package/amd/IconMenuButton-74b41e62.js +1 -1
  80. package/amd/IconProgressButton-28f72faa.js +1 -1
  81. package/amd/IconSwitchButton-22893e1f.js +1 -1
  82. package/amd/IconToggleButton-9f1c8265.js +1 -1
  83. package/amd/{IconUserAssistance-e80bf779.js → IconUserAssistance-682b85a2.js} +2 -2
  84. package/amd/{IconUserAssistance-e80bf779.js.map → IconUserAssistance-682b85a2.js.map} +1 -1
  85. package/amd/Indexer-27340b0e.js +1 -1
  86. package/amd/InlineHelpSource-8d8b6a8b.js +1 -1
  87. package/amd/InlineSelectSingle-4e6a631c.js +1 -1
  88. package/amd/InlineUserAssistance-91f9ace1.js +1 -1
  89. package/amd/InputColor-3eca248b.js +2 -0
  90. package/amd/{InputColor-a1fcd3b3.js.map → InputColor-3eca248b.js.map} +1 -1
  91. package/amd/InputDateMask-acdfc589.js +1 -1
  92. package/amd/InputDatePicker-22518a24.js +2 -0
  93. package/amd/{InputDatePicker-b16a1592.js.map → InputDatePicker-22518a24.js.map} +1 -1
  94. package/amd/InputPassword-9a1d268d.js +1 -1
  95. package/amd/InputSensitiveText-e6519508.js +1 -1
  96. package/amd/InputText-8712623e.js +1 -1
  97. package/amd/Label-286bacb8.js +1 -1
  98. package/amd/LabelValueLayout-36bc12e2.js +1 -1
  99. package/amd/{Layer-64bf71ad.js → Layer-1971eddb.js} +2 -2
  100. package/amd/{Layer-64bf71ad.js.map → Layer-1971eddb.js.map} +1 -1
  101. package/amd/{LayerHost-1a734852.js → LayerHost-0b288129.js} +2 -2
  102. package/amd/{LayerHost-1a734852.js.map → LayerHost-0b288129.js.map} +1 -1
  103. package/amd/LayerManager-426c669d.js +2 -0
  104. package/amd/{LayerManager-5ba8e6ed.js.map → LayerManager-426c669d.js.map} +1 -1
  105. package/amd/Legend-e09a1733.js +1 -1
  106. package/amd/LineAreaChart-08247f99.js +1 -1
  107. package/amd/Link-20f7e72d.js +1 -1
  108. package/amd/List-8d95a024.js +1 -1
  109. package/amd/{ListItemLayout-23390b90.js → ListItemLayout-2dbba38a.js} +2 -2
  110. package/amd/{ListItemLayout-23390b90.js.map → ListItemLayout-2dbba38a.js.map} +1 -1
  111. package/amd/ListView-fe5d340a.js +1 -1
  112. package/amd/LiveRegion-dbefb95b.js +2 -0
  113. package/amd/{LiveRegion-1553833d.js.map → LiveRegion-dbefb95b.js.map} +1 -1
  114. package/amd/{MaxLengthLiveRegion-5172c87a.js → MaxLengthLiveRegion-8f9f7247.js} +2 -2
  115. package/amd/{MaxLengthLiveRegion-5172c87a.js.map → MaxLengthLiveRegion-8f9f7247.js.map} +1 -1
  116. package/amd/Menu-4b445ba5.js +1 -1
  117. package/amd/MenuButton-8428a792.js +1 -1
  118. package/amd/MenuItem-f3de5e35.js +1 -1
  119. package/amd/Message-bbea21c4.js +1 -1
  120. package/amd/MessageBanner-5c18f23c.js +1 -1
  121. package/amd/MessageLayer-cb7cbb34.js +2 -0
  122. package/amd/{MessageLayer-24870def.js.map → MessageLayer-cb7cbb34.js.map} +1 -1
  123. package/amd/MessageToast-9e27adaa.js +1 -1
  124. package/amd/MessagesManager-4d5f6217.js +1 -1
  125. package/amd/MeterBar-e8e95881.js +1 -1
  126. package/amd/MeterCircle-46d479de.js +1 -1
  127. package/amd/Modal-95bf034f.js +1 -1
  128. package/amd/{MonthView-15e7e2cc.js → MonthView-93a866a6.js} +2 -2
  129. package/amd/{MonthView-15e7e2cc.js.map → MonthView-93a866a6.js.map} +1 -1
  130. package/amd/NavigationListItem-dea4c9e9.js +1 -1
  131. package/amd/NavigationListLinkItem-e376a039.js +1 -1
  132. package/amd/NumberInputText-4a58ed41.js +1 -1
  133. package/amd/OverflowTabBarItem-f23d35fd.js +1 -1
  134. package/amd/PRIVATE_BaseCardView.js +1 -1
  135. package/amd/PRIVATE_BaseDiagram.js +1 -1
  136. package/amd/PRIVATE_BaseSelector.js +1 -1
  137. package/amd/PRIVATE_BaseSwatchView.js +1 -1
  138. package/amd/PRIVATE_Chart.js +1 -1
  139. package/amd/PRIVATE_CheckboxControl.js +1 -1
  140. package/amd/PRIVATE_CheckboxRadioField.js +1 -1
  141. package/amd/PRIVATE_ClearIcon.js +1 -1
  142. package/amd/PRIVATE_CollapsibleNavigationList.js +1 -1
  143. package/amd/PRIVATE_DatePickerHeader.js +1 -1
  144. package/amd/PRIVATE_DatePickerLayout.js +1 -1
  145. package/amd/PRIVATE_EmbeddedIconButton.js +1 -1
  146. package/amd/PRIVATE_Expander.js +1 -1
  147. package/amd/PRIVATE_FormControls.js +1 -1
  148. package/amd/PRIVATE_IconSwitchButton.js +1 -1
  149. package/amd/PRIVATE_Icons/CheckboxCrossed.js +1 -1
  150. package/amd/PRIVATE_Icons/CheckboxMixed.js +1 -1
  151. package/amd/PRIVATE_Icons/CheckboxOff.js +1 -1
  152. package/amd/PRIVATE_Icons/CheckboxOn.js +1 -1
  153. package/amd/PRIVATE_Icons/DragV.js +1 -1
  154. package/amd/PRIVATE_Icons/None.js +1 -1
  155. package/amd/PRIVATE_List.js +1 -1
  156. package/amd/PRIVATE_Message.js +1 -1
  157. package/amd/PRIVATE_MessageLayer.js +1 -1
  158. package/amd/PRIVATE_MonthView.js +1 -1
  159. package/amd/PRIVATE_MonthYearGridView.js +1 -1
  160. package/amd/PRIVATE_PlotArea.js +1 -1
  161. package/amd/PRIVATE_RevealToggleIcon.js +1 -1
  162. package/amd/PRIVATE_RichSelectionCommon.js +1 -1
  163. package/amd/PRIVATE_SelectCommon.js +1 -1
  164. package/amd/PRIVATE_StyledCard.js +1 -1
  165. package/amd/PRIVATE_StyledCheckbox.js +1 -1
  166. package/amd/PRIVATE_StyledSwitch.js +1 -1
  167. package/amd/PRIVATE_SwatchFlexView.js +1 -1
  168. package/amd/PRIVATE_Table.js +1 -1
  169. package/amd/PRIVATE_TableDisplay.js +1 -1
  170. package/amd/PRIVATE_TableList.js +1 -1
  171. package/amd/PRIVATE_ThemedIcons/CalendarIcon.js +1 -1
  172. package/amd/PRIVATE_ThemedIcons/ChartMarqueeSelectIcon.js +1 -1
  173. package/amd/PRIVATE_ThemedIcons/ChartPanIcon.js +1 -1
  174. package/amd/PRIVATE_ThemedIcons/ChartZoomIcon.js +1 -1
  175. package/amd/PRIVATE_ThemedIcons/CheckIcon.js +1 -1
  176. package/amd/PRIVATE_ThemedIcons/CheckboxCrossedIcon.js +1 -1
  177. package/amd/PRIVATE_ThemedIcons/CheckboxMixedIcon.js +1 -1
  178. package/amd/PRIVATE_ThemedIcons/CheckboxOffIcon.js +1 -1
  179. package/amd/PRIVATE_ThemedIcons/CheckboxOnIcon.js +1 -1
  180. package/amd/PRIVATE_ThemedIcons/CloseIcon.js +1 -1
  181. package/amd/PRIVATE_ThemedIcons/CollapseIcon.js +1 -1
  182. package/amd/PRIVATE_ThemedIcons/CollapseUpIcon.js +1 -1
  183. package/amd/PRIVATE_ThemedIcons/DecrementIcon.js +1 -1
  184. package/amd/PRIVATE_ThemedIcons/DeleteIcon.js +1 -1
  185. package/amd/PRIVATE_ThemedIcons/DirectionalCollapseArrowIcon.js +1 -1
  186. package/amd/PRIVATE_ThemedIcons/DirectionalExpandArrowIcon.js +1 -1
  187. package/amd/PRIVATE_ThemedIcons/DragHandleIcon.js +1 -1
  188. package/amd/PRIVATE_ThemedIcons/DropdownArrowIcon.js +1 -1
  189. package/amd/PRIVATE_ThemedIcons/ExpandIcon.js +1 -1
  190. package/amd/PRIVATE_ThemedIcons/HelpIcon.js +1 -1
  191. package/amd/PRIVATE_ThemedIcons/IncrementIcon.js +1 -1
  192. package/amd/PRIVATE_ThemedIcons/MenuButtonDropdownIcon.js +1 -1
  193. package/amd/PRIVATE_ThemedIcons/MessageConfirmationIcon.js +1 -1
  194. package/amd/PRIVATE_ThemedIcons/MessageErrorIcon.js +1 -1
  195. package/amd/PRIVATE_ThemedIcons/MessageInfoIcon.js +1 -1
  196. package/amd/PRIVATE_ThemedIcons/MessageWarningIcon.js +1 -1
  197. package/amd/PRIVATE_ThemedIcons/MinusIcon.js +1 -1
  198. package/amd/PRIVATE_ThemedIcons/NavDownIcon.js +1 -1
  199. package/amd/PRIVATE_ThemedIcons/None.js +1 -1
  200. package/amd/PRIVATE_ThemedIcons/OverviewHorizontalDragHandleIcon.js +1 -1
  201. package/amd/PRIVATE_ThemedIcons/PlusIcon.js +1 -1
  202. package/amd/PRIVATE_ThemedIcons/RadioOffIcon.js +1 -1
  203. package/amd/PRIVATE_ThemedIcons/RadioOnIcon.js +1 -1
  204. package/amd/PRIVATE_ThemedIcons/SortAscendingIcon.js +1 -1
  205. package/amd/PRIVATE_ThemedIcons/SortDescendingIcon.js +1 -1
  206. package/amd/PRIVATE_ThemedIcons/ViewHideIcon.js +1 -1
  207. package/amd/PRIVATE_ThemedIcons/ViewIcon.js +1 -1
  208. package/amd/PRIVATE_TimeComponent.js +1 -1
  209. package/amd/PRIVATE_TruncatingLink.js +1 -1
  210. package/amd/PRIVATE_VisOverview.js +1 -1
  211. package/amd/PRIVATE_VisStatusMessage.js +1 -1
  212. package/amd/PRIVATE_VisTabularDatatip.js +1 -1
  213. package/amd/PictoChart-1262b65e.js +1 -1
  214. package/amd/PieChart-0e4eacd7.js +1 -1
  215. package/amd/{Popup-575d49f7.js → Popup-feb5bf60.js} +2 -2
  216. package/amd/{Popup-575d49f7.js.map → Popup-feb5bf60.js.map} +1 -1
  217. package/amd/{ProgressBar-4074bb67.js → ProgressBar-d7aa356a.js} +2 -2
  218. package/amd/{ProgressBar-4074bb67.js.map → ProgressBar-d7aa356a.js.map} +1 -1
  219. package/amd/ProgressButton-71c1dda9.js +1 -1
  220. package/amd/ProgressButtonLabelLayout-4f7aa87d.js +1 -1
  221. package/amd/{ProgressCircle-df7641ef.js → ProgressCircle-8a94e670.js} +2 -2
  222. package/amd/{ProgressCircle-df7641ef.js.map → ProgressCircle-8a94e670.js.map} +1 -1
  223. package/amd/RadioItem-c5f0676c.js +1 -1
  224. package/amd/RadioSet-c3ad77d7.js +1 -1
  225. package/amd/RatingGauge-d0e95f46.js +1 -1
  226. package/amd/ReadonlyTextFieldInput-41384d7e.js +1 -1
  227. package/amd/{ReferenceLineArea-27698a8f.js → ReferenceLineArea-450530dd.js} +2 -2
  228. package/amd/{ReferenceLineArea-27698a8f.js.map → ReferenceLineArea-450530dd.js.map} +1 -1
  229. package/amd/RemovableNavigationListItem-5e5a9068.js +1 -1
  230. package/amd/RemovableTabBarItem-ce314e8b.js +1 -1
  231. package/amd/ReorderableTabBar-3ff37ba7.js +1 -1
  232. package/amd/RevealToggleIcon-bd35b257.js +1 -1
  233. package/amd/ScatterChart-af0d8118.js +1 -1
  234. package/amd/SectionalLegend-aa7254ff.js +1 -1
  235. package/amd/{SectionedContent-32ec078e.js → SectionedContent-a89bafc6.js} +2 -2
  236. package/amd/{SectionedContent-32ec078e.js.map → SectionedContent-a89bafc6.js.map} +1 -1
  237. package/amd/SegmentStyles.styles.css +12 -9
  238. package/amd/SegmentStyles.styles2.css +9 -12
  239. package/amd/SelectMobileFieldInput-b1524b1e.js +1 -1
  240. package/amd/SelectMultiple-f70618cf.js +1 -1
  241. package/amd/SelectSingle-971886ab.js +1 -1
  242. package/amd/{SelectorAll-e9acae58.js → SelectorAll-6652fd3f.js} +2 -2
  243. package/amd/{SelectorAll-e9acae58.js.map → SelectorAll-6652fd3f.js.map} +1 -1
  244. package/amd/Sheet-1d02491d.js +1 -1
  245. package/amd/SortControl-ec2db600.js +1 -1
  246. package/amd/SplitMenuButton-bf59897c.js +1 -1
  247. package/amd/StyledCard-4baafee3.js +1 -1
  248. package/amd/{StyledLabelValueLayout-16ac9a5e.js → StyledLabelValueLayout-907bc2d3.js} +2 -2
  249. package/amd/{StyledLabelValueLayout-16ac9a5e.js.map → StyledLabelValueLayout-907bc2d3.js.map} +1 -1
  250. package/amd/StyledSwitch-0881e505.js +1 -1
  251. package/amd/StyledTextField-f533c9e9.js +1 -1
  252. package/amd/Submenu-99c05da1.js +1 -1
  253. package/amd/TabBar-8ab0fd0d.js +1 -1
  254. package/amd/TabBarContextMenu-06f7beb2.js +1 -1
  255. package/amd/TabBarLayout-4eb6c732.js +1 -1
  256. package/amd/TabBarMixed-41258b80.js +1 -1
  257. package/amd/{TabBarMixedSeparator-c77d8e96.js → TabBarMixedSeparator-019d266b.js} +2 -2
  258. package/amd/{TabBarMixedSeparator-c77d8e96.js.map → TabBarMixedSeparator-019d266b.js.map} +1 -1
  259. package/amd/Table-2d35f829.js +1 -1
  260. package/amd/TableColGroup-30abc1ce.js +1 -1
  261. package/amd/TableDisplay-e3a86f26.js +1 -1
  262. package/amd/TagCloud-4970d243.js +1 -1
  263. package/amd/TextArea-6b324b42.js +1 -1
  264. package/amd/TextAreaAutosize-5d9bf2b2.js +1 -1
  265. package/amd/TextField-1da09ebc.js +1 -1
  266. package/amd/TextFieldInput-f8635c62.js +1 -1
  267. package/amd/Theme-redwood/theme.css +147 -147
  268. package/amd/Theme-stable/theme.css +255 -255
  269. package/amd/TimeComponentCanvas2D-a17f51f1.js +1 -1
  270. package/amd/ToggleButton-c9e433d4.js +1 -1
  271. package/amd/Toolbar-663b9254.js +1 -1
  272. package/amd/TruncatingBadge-80a8c903.js +1 -1
  273. package/amd/TruncatingLink-aa577ffc.js +1 -1
  274. package/amd/TruncatingText-bdbdd4d4.js +1 -1
  275. package/amd/UNSAFE_AccordionItemMultiple.js +1 -1
  276. package/amd/UNSAFE_AccordionItemSingle.js +1 -1
  277. package/amd/UNSAFE_ActionCard.js +1 -1
  278. package/amd/UNSAFE_BarChart/__test__/BarChart.spec.js +1 -1
  279. package/amd/UNSAFE_BarChart.js +1 -1
  280. package/amd/UNSAFE_BareButton.js +1 -1
  281. package/amd/UNSAFE_BaseButton.js +1 -1
  282. package/amd/UNSAFE_Button.js +1 -1
  283. package/amd/UNSAFE_ButtonLayout/tests/ButtonLayout.spec.js +1 -1
  284. package/amd/UNSAFE_ButtonSet.js +1 -1
  285. package/amd/UNSAFE_ButtonSetButton.js +1 -1
  286. package/amd/UNSAFE_ButtonSetIconButton.js +1 -1
  287. package/amd/UNSAFE_ButtonSetItem.js +1 -1
  288. package/amd/UNSAFE_ButtonSetMultiple.js +1 -1
  289. package/amd/UNSAFE_ButtonSetSingle.js +1 -1
  290. package/amd/UNSAFE_Card.js +1 -1
  291. package/amd/UNSAFE_CardFlexView.js +1 -1
  292. package/amd/UNSAFE_CardGridView.js +1 -1
  293. package/amd/UNSAFE_Center.js +1 -1
  294. package/amd/UNSAFE_Checkbox.js +1 -1
  295. package/amd/UNSAFE_CheckboxItem.js +1 -1
  296. package/amd/UNSAFE_CheckboxItem.js.map +1 -1
  297. package/amd/UNSAFE_CheckboxRadioField.js +1 -1
  298. package/amd/UNSAFE_CheckboxSet.js +1 -1
  299. package/amd/UNSAFE_CheckboxSet.js.map +1 -1
  300. package/amd/UNSAFE_Chip.js +1 -1
  301. package/amd/UNSAFE_Collapsible.js +1 -1
  302. package/amd/UNSAFE_ColorPalette.js +1 -1
  303. package/amd/UNSAFE_ColorPicker.js +1 -1
  304. package/amd/UNSAFE_ColorSwatch.js +1 -1
  305. package/amd/UNSAFE_ComboChart.js +1 -1
  306. package/amd/UNSAFE_ComponentMessage.js +1 -1
  307. package/amd/UNSAFE_ContainerDiagram.js +1 -1
  308. package/amd/UNSAFE_ConveyorBelt.js +1 -1
  309. package/amd/UNSAFE_DatePicker.js +1 -1
  310. package/amd/UNSAFE_Diagram.js +1 -1
  311. package/amd/UNSAFE_Dialog.js +1 -1
  312. package/amd/UNSAFE_DragHandle.js +1 -1
  313. package/amd/UNSAFE_DrawerLayout.js +1 -1
  314. package/amd/UNSAFE_DrawerPopup.js +1 -1
  315. package/amd/UNSAFE_Dropdown.js +1 -1
  316. package/amd/UNSAFE_Environment.js +1 -1
  317. package/amd/UNSAFE_ExpandableList.js +1 -1
  318. package/amd/UNSAFE_FilePicker.js +1 -1
  319. package/amd/UNSAFE_FlatTreeView.js +1 -1
  320. package/amd/UNSAFE_Flex.js +1 -1
  321. package/amd/UNSAFE_Floating.js +1 -1
  322. package/amd/UNSAFE_FormLayout.js +1 -1
  323. package/amd/UNSAFE_Gantt.js +1 -1
  324. package/amd/UNSAFE_Grid.js +1 -1
  325. package/amd/UNSAFE_HighlightText.js +1 -1
  326. package/amd/UNSAFE_Icon.js +1 -1
  327. package/amd/UNSAFE_IconButton.js +1 -1
  328. package/amd/UNSAFE_IconMenuButton.js +1 -1
  329. package/amd/UNSAFE_IconProgressButton.js +1 -1
  330. package/amd/UNSAFE_IconToggleButton.js +1 -1
  331. package/amd/UNSAFE_Indexer.js +1 -1
  332. package/amd/UNSAFE_InlineSelectSingle.js +1 -1
  333. package/amd/UNSAFE_InputColor.js +1 -1
  334. package/amd/UNSAFE_InputDateMask/themes/SegmentStyles.css.js +1 -1
  335. package/amd/UNSAFE_InputDateMask.js +1 -1
  336. package/amd/UNSAFE_InputDatePicker.js +1 -1
  337. package/amd/UNSAFE_InputPassword.js +1 -1
  338. package/amd/UNSAFE_InputSensitiveText.js +1 -1
  339. package/amd/UNSAFE_InputText.js +1 -1
  340. package/amd/UNSAFE_InputTimeMask/themes/SegmentStyles.css.js +1 -1
  341. package/amd/UNSAFE_InputTimeMask.js +1 -1
  342. package/amd/UNSAFE_InputTimeMask.js.map +1 -1
  343. package/amd/UNSAFE_Label.js +1 -1
  344. package/amd/UNSAFE_LabelValueLayout.js +1 -1
  345. package/amd/UNSAFE_LabelledLink.js +1 -1
  346. package/amd/UNSAFE_Layer.js +1 -1
  347. package/amd/UNSAFE_Legend.js +1 -1
  348. package/amd/UNSAFE_LineAreaChart.js +1 -1
  349. package/amd/UNSAFE_Link.js +1 -1
  350. package/amd/UNSAFE_ListItemLayout.js +1 -1
  351. package/amd/UNSAFE_ListView.js +1 -1
  352. package/amd/UNSAFE_LiveRegion.js +1 -1
  353. package/amd/UNSAFE_Menu.js +1 -1
  354. package/amd/UNSAFE_MenuButton.js +1 -1
  355. package/amd/UNSAFE_MessageBanner.js +1 -1
  356. package/amd/UNSAFE_MessageToast.js +1 -1
  357. package/amd/UNSAFE_MeterBar.js +1 -1
  358. package/amd/UNSAFE_MeterCircle.js +1 -1
  359. package/amd/UNSAFE_Modal.js +1 -1
  360. package/amd/UNSAFE_NavigationList.js +1 -1
  361. package/amd/UNSAFE_NavigationListCommon.js +1 -1
  362. package/amd/UNSAFE_NumberInputText.js +1 -1
  363. package/amd/UNSAFE_OverflowTabBar.js +1 -1
  364. package/amd/UNSAFE_PictoChart.js +1 -1
  365. package/amd/UNSAFE_PieChart/__test__/PieChart.spec.js +1 -1
  366. package/amd/UNSAFE_PieChart.js +1 -1
  367. package/amd/UNSAFE_Popup.js +1 -1
  368. package/amd/UNSAFE_ProgressBar.js +1 -1
  369. package/amd/UNSAFE_ProgressButton.js +1 -1
  370. package/amd/UNSAFE_ProgressButtonLabelLayout.js +1 -1
  371. package/amd/UNSAFE_ProgressCircle.js +1 -1
  372. package/amd/UNSAFE_RadioItem.js +1 -1
  373. package/amd/UNSAFE_RadioSet.js +1 -1
  374. package/amd/UNSAFE_RatingGauge.js +1 -1
  375. package/amd/UNSAFE_ReorderableTabBar.js +1 -1
  376. package/amd/UNSAFE_RichCheckboxSet.js +1 -1
  377. package/amd/UNSAFE_RichCheckboxSet.js.map +1 -1
  378. package/amd/UNSAFE_RichRadioSet.js +1 -1
  379. package/amd/UNSAFE_RichSelectionItem.js +1 -1
  380. package/amd/UNSAFE_RichSelectionItem.js.map +1 -1
  381. package/amd/UNSAFE_ScatterChart.js +1 -1
  382. package/amd/UNSAFE_SectionalLegend.js +1 -1
  383. package/amd/UNSAFE_SelectMultiple.js +1 -1
  384. package/amd/UNSAFE_SelectSingle.js +1 -1
  385. package/amd/UNSAFE_SelectionCard.js +1 -1
  386. package/amd/UNSAFE_Selector.js +1 -1
  387. package/amd/UNSAFE_SelectorAll.js +1 -1
  388. package/amd/UNSAFE_Sheet/__test__/Sheet.spec.js +1 -1
  389. package/amd/UNSAFE_Sheet.js +1 -1
  390. package/amd/UNSAFE_SortControl.js +1 -1
  391. package/amd/UNSAFE_SplitMenuButton.js +1 -1
  392. package/amd/UNSAFE_Switch.js +1 -1
  393. package/amd/UNSAFE_TabBar.js +1 -1
  394. package/amd/UNSAFE_TabBarCommon.js +1 -1
  395. package/amd/UNSAFE_TabBarMixed.js +1 -1
  396. package/amd/UNSAFE_TableView.js +1 -1
  397. package/amd/UNSAFE_TagCloud.js +1 -1
  398. package/amd/UNSAFE_TextArea.js +1 -1
  399. package/amd/UNSAFE_TextAreaAutosize.js +1 -1
  400. package/amd/UNSAFE_TextField.js +1 -1
  401. package/amd/UNSAFE_ToggleButton.js +1 -1
  402. package/amd/UNSAFE_Toolbar/tests/Toolbar.spec.js +1 -1
  403. package/amd/UNSAFE_Toolbar.js +1 -1
  404. package/amd/UNSAFE_Train.js +1 -1
  405. package/amd/UNSAFE_TruncatingBadge.js +1 -1
  406. package/amd/UNSAFE_TruncatingText.js +1 -1
  407. package/amd/UNSAFE_UserAssistance.js +1 -1
  408. package/amd/UNSAFE_View.js +1 -1
  409. package/amd/UNSAFE_VirtualizedListView.js +1 -1
  410. package/amd/UNSAFE_VisInvalidDataMessage.js +1 -1
  411. package/amd/UNSAFE_VisNoDataMessage.js +1 -1
  412. package/amd/UNSAFE_VisProgressiveLoader/__test__/VisProgressiveLoader.spec.js +1 -1
  413. package/amd/UNSAFE_VisProgressiveLoader.js +1 -1
  414. package/amd/UNSAFE_WindowOverlay.js +1 -1
  415. package/amd/{View-215ec211.js → View-35699bb2.js} +2 -2
  416. package/amd/{View-215ec211.js.map → View-35699bb2.js.map} +1 -1
  417. package/amd/{VisInvalidDataMessage-139a0bf8.js → VisInvalidDataMessage-8e7534a7.js} +2 -2
  418. package/amd/{VisInvalidDataMessage-139a0bf8.js.map → VisInvalidDataMessage-8e7534a7.js.map} +1 -1
  419. package/amd/VisNoDataMessage-fc41dae3.js +2 -0
  420. package/amd/{VisNoDataMessage-e4eb08f6.js.map → VisNoDataMessage-fc41dae3.js.map} +1 -1
  421. package/amd/{VisPlaceholder-a7cac338.js → VisPlaceholder-1bbfb2f0.js} +2 -2
  422. package/amd/{VisPlaceholder-a7cac338.js.map → VisPlaceholder-1bbfb2f0.js.map} +1 -1
  423. package/amd/{VisProgressiveLoader-10192b41.js → VisProgressiveLoader-eeac2e00.js} +2 -2
  424. package/amd/{VisProgressiveLoader-10192b41.js.map → VisProgressiveLoader-eeac2e00.js.map} +1 -1
  425. package/amd/{VisStatusMessage-307f20e9.js → VisStatusMessage-ac3a90aa.js} +2 -2
  426. package/amd/{VisStatusMessage-307f20e9.js.map → VisStatusMessage-ac3a90aa.js.map} +1 -1
  427. package/amd/{VisTabularDatatip-d6b9f28f.js → VisTabularDatatip-93d56ae8.js} +2 -2
  428. package/amd/{VisTabularDatatip-d6b9f28f.js.map → VisTabularDatatip-93d56ae8.js.map} +1 -1
  429. package/amd/{WindowOverlay-55232139.js → WindowOverlay-11d88211.js} +2 -2
  430. package/amd/{WindowOverlay-55232139.js.map → WindowOverlay-11d88211.js.map} +1 -1
  431. package/amd/{YearsGridView-ef191926.js → YearsGridView-09b45b4e.js} +2 -2
  432. package/amd/{YearsGridView-ef191926.js.map → YearsGridView-09b45b4e.js.map} +1 -1
  433. package/amd/hoc/PRIVATE_withDirectionIcon.js +1 -1
  434. package/amd/hoc/PRIVATE_withThemeIcon.js +1 -1
  435. package/amd/hoc/UNSAFE_withThemeProps.js +1 -1
  436. package/amd/hooks/PRIVATE_useChartContextMenu.js +1 -1
  437. package/amd/hooks/PRIVATE_useChartDatatip.js +1 -1
  438. package/amd/hooks/PRIVATE_useChartEvents.js +1 -1
  439. package/amd/hooks/PRIVATE_useChartMarquee.js +1 -1
  440. package/amd/hooks/PRIVATE_useCollectionFocusRing.js +1 -1
  441. package/amd/hooks/PRIVATE_useCssVars.js +1 -1
  442. package/amd/hooks/PRIVATE_useCurrentKey.js +1 -1
  443. package/amd/hooks/PRIVATE_useDatatip.js +1 -1
  444. package/amd/hooks/PRIVATE_useDetectHorizontalOverflow.js +1 -1
  445. package/amd/hooks/PRIVATE_useFloating.js +1 -1
  446. package/amd/hooks/PRIVATE_useItemAction.js +1 -1
  447. package/amd/hooks/PRIVATE_useListCommon.js +1 -1
  448. package/amd/hooks/PRIVATE_useOutsideMousedown.js +1 -1
  449. package/amd/hooks/PRIVATE_useRadioFocusManager.js +1 -1
  450. package/amd/hooks/PRIVATE_useReorderable.js +1 -1
  451. package/amd/hooks/PRIVATE_useRovingTabIndexContainer.js +1 -1
  452. package/amd/hooks/PRIVATE_useSelection.js +1 -1
  453. package/amd/hooks/PRIVATE_useTabBar.js +1 -1
  454. package/amd/hooks/PRIVATE_useTabbableModeSet.js +1 -1
  455. package/amd/hooks/PRIVATE_useTooltipOnTruncation.js +1 -1
  456. package/amd/hooks/PRIVATE_useVisContextMenu.js +1 -1
  457. package/amd/hooks/PRIVATE_useVisDragModeControls.js +1 -1
  458. package/amd/hooks/PRIVATE_useVisEvents.js +1 -1
  459. package/amd/hooks/PRIVATE_useVisMeterEvents.js +1 -1
  460. package/amd/hooks/PRIVATE_useVisSelection.js +1 -1
  461. package/amd/hooks/UNSAFE_useBareButton.js +1 -1
  462. package/amd/hooks/UNSAFE_useColorScheme.js +1 -1
  463. package/amd/hooks/UNSAFE_useCurrentBgColor.js +1 -1
  464. package/amd/hooks/UNSAFE_useDensity.js +1 -1
  465. package/amd/hooks/UNSAFE_useHiddenTestMethod.js +1 -1
  466. package/amd/hooks/UNSAFE_useOutsideClick.js +1 -1
  467. package/amd/hooks/UNSAFE_usePrefixSuffix.js +1 -1
  468. package/amd/hooks/UNSAFE_useScale.js +1 -1
  469. package/amd/hooks/UNSAFE_useTestId.js +1 -1
  470. package/amd/hooks/UNSAFE_useTheme.js +1 -1
  471. package/amd/hooks/UNSAFE_useThemeInterpolations.js +1 -1
  472. package/amd/hooks/UNSAFE_useTooltip.js +1 -1
  473. package/amd/hooks/UNSAFE_useTranslationBundle.js +1 -1
  474. package/amd/hooks/UNSAFE_useUser.js +1 -1
  475. package/amd/{index-4f562976.js → index-5899fd61.js} +2 -2
  476. package/amd/index-5899fd61.js.map +1 -0
  477. package/amd/listViewSelectionTests-c5492828.js +1 -1
  478. package/amd/popupUtils-d42db8bf.js +2 -0
  479. package/amd/{popupUtils-71ea5dd1.js.map → popupUtils-d42db8bf.js.map} +1 -1
  480. package/amd/render-0e124b25.js +2 -0
  481. package/amd/{render-40923005.js.map → render-0e124b25.js.map} +1 -1
  482. package/amd/{tabbableUtils-7fa099af.js → tabbableUtils-0f5a148a.js} +2 -2
  483. package/amd/{tabbableUtils-7fa099af.js.map → tabbableUtils-0f5a148a.js.map} +1 -1
  484. package/amd/{testData-db08ddc1.js → testData-0ee09770.js} +2 -2
  485. package/amd/{testData-db08ddc1.js.map → testData-0ee09770.js.map} +1 -1
  486. package/amd/{testData-d92d6bdb.js → testData-c84b4335.js} +2 -2
  487. package/amd/{testData-d92d6bdb.js.map → testData-c84b4335.js.map} +1 -1
  488. package/amd/{tooltipUtils-0761844d.js → tooltipUtils-66f3844a.js} +2 -2
  489. package/amd/{tooltipUtils-0761844d.js.map → tooltipUtils-66f3844a.js.map} +1 -1
  490. package/amd/useBareButton-0afa84c2.js +1 -1
  491. package/amd/useCellNavigation-fe5a7be7.js +1 -1
  492. package/amd/useChartContextMenu-1490ade6.js +1 -1
  493. package/amd/{useChartDatatip-1255260f.js → useChartDatatip-1dc977ae.js} +2 -2
  494. package/amd/{useChartDatatip-1255260f.js.map → useChartDatatip-1dc977ae.js.map} +1 -1
  495. package/amd/{useColorScheme-6cb3a3b7.js → useColorScheme-097c31ff.js} +2 -2
  496. package/amd/{useColorScheme-6cb3a3b7.js.map → useColorScheme-097c31ff.js.map} +1 -1
  497. package/amd/useContextMenu-c4fc924d.js +1 -1
  498. package/amd/{useCssVars-d0c0bfa2.js → useCssVars-3194b2f6.js} +2 -2
  499. package/amd/{useCssVars-d0c0bfa2.js.map → useCssVars-3194b2f6.js.map} +1 -1
  500. package/amd/{useCurrentBgColor-3044b50a.js → useCurrentBgColor-6f440613.js} +2 -2
  501. package/amd/{useCurrentBgColor-3044b50a.js.map → useCurrentBgColor-6f440613.js.map} +1 -1
  502. package/amd/useCurrentKey-5749e7fb.js +2 -0
  503. package/amd/{useCurrentKey-05038cac.js.map → useCurrentKey-5749e7fb.js.map} +1 -1
  504. package/amd/{useDatatip-656c8df6.js → useDatatip-df022581.js} +2 -2
  505. package/amd/{useDatatip-656c8df6.js.map → useDatatip-df022581.js.map} +1 -1
  506. package/amd/{useDensity-622a2d34.js → useDensity-8a10fc70.js} +2 -2
  507. package/amd/{useDensity-622a2d34.js.map → useDensity-8a10fc70.js.map} +1 -1
  508. package/amd/useDisplayValue-a15b1a34.js +1 -1
  509. package/amd/{useExpandCollapse-d8799966.js → useExpandCollapse-41860b2a.js} +2 -2
  510. package/amd/{useExpandCollapse-d8799966.js.map → useExpandCollapse-41860b2a.js.map} +1 -1
  511. package/amd/{useFloating-0bdf9133.js → useFloating-5cb85d2b.js} +2 -2
  512. package/amd/{useFloating-0bdf9133.js.map → useFloating-5cb85d2b.js.map} +1 -1
  513. package/amd/{useHiddenTestMethod-6bbe8a43.js → useHiddenTestMethod-8321d341.js} +2 -2
  514. package/amd/{useHiddenTestMethod-6bbe8a43.js.map → useHiddenTestMethod-8321d341.js.map} +1 -1
  515. package/amd/useKeyboardEvents-f0419128.js +2 -0
  516. package/amd/{useKeyboardEvents-191a444a.js.map → useKeyboardEvents-f0419128.js.map} +1 -1
  517. package/amd/useLegendContextMenu-9b6f6083.js +1 -1
  518. package/amd/useMeterDatatip-5598534c.js +2 -0
  519. package/amd/{useMeterDatatip-d6977d41.js.map → useMeterDatatip-5598534c.js.map} +1 -1
  520. package/amd/useNavigation-8d7dae30.js +1 -1
  521. package/amd/{useOutsideClick-ace4f686.js → useOutsideClick-b9b661a4.js} +2 -2
  522. package/amd/{useOutsideClick-ace4f686.js.map → useOutsideClick-b9b661a4.js.map} +1 -1
  523. package/amd/{useOutsideMousedown-62fa309c.js → useOutsideMousedown-cb88da60.js} +2 -2
  524. package/amd/{useOutsideMousedown-62fa309c.js.map → useOutsideMousedown-cb88da60.js.map} +1 -1
  525. package/amd/usePopupAnimation-dc282b02.js +2 -0
  526. package/amd/{usePopupAnimation-389749fc.js.map → usePopupAnimation-dc282b02.js.map} +1 -1
  527. package/amd/usePrefixSuffix-dd2cae55.js +2 -0
  528. package/amd/{usePrefixSuffix-7371ec52.js.map → usePrefixSuffix-dd2cae55.js.map} +1 -1
  529. package/amd/useRadioFocusManager-462e28eb.js +2 -0
  530. package/amd/{useRadioFocusManager-c613d2fc.js.map → useRadioFocusManager-462e28eb.js.map} +1 -1
  531. package/amd/{useReorderableItem-6ab59e42.js → useReorderableItem-0f9d7742.js} +2 -2
  532. package/amd/{useReorderableItem-6ab59e42.js.map → useReorderableItem-0f9d7742.js.map} +1 -1
  533. package/amd/{useRovingTabIndexContainer-a8b8ab8f.js → useRovingTabIndexContainer-9aa2fbcf.js} +2 -2
  534. package/amd/{useRovingTabIndexContainer-a8b8ab8f.js.map → useRovingTabIndexContainer-9aa2fbcf.js.map} +1 -1
  535. package/amd/{useScale-404175fb.js → useScale-04a448c3.js} +2 -2
  536. package/amd/{useScale-404175fb.js.map → useScale-04a448c3.js.map} +1 -1
  537. package/amd/useSelectCommon-be138f8d.js +1 -1
  538. package/amd/{useSelectDrill-a749b7f8.js → useSelectDrill-2a3c2b81.js} +2 -2
  539. package/amd/{useSelectDrill-a749b7f8.js.map → useSelectDrill-2a3c2b81.js.map} +1 -1
  540. package/amd/{useSelection-8f66e2ab.js → useSelection-00add7e4.js} +2 -2
  541. package/amd/{useSelection-8f66e2ab.js.map → useSelection-00add7e4.js.map} +1 -1
  542. package/amd/{useSelection-48cb7bdf.js → useSelection-aecb6b23.js} +2 -2
  543. package/amd/{useSelection-48cb7bdf.js.map → useSelection-aecb6b23.js.map} +1 -1
  544. package/amd/useTabBar-50c4da2d.js +1 -1
  545. package/amd/{useTabBarItemTooltip-0c13e9b4.js → useTabBarItemTooltip-fac844e2.js} +2 -2
  546. package/amd/{useTabBarItemTooltip-0c13e9b4.js.map → useTabBarItemTooltip-fac844e2.js.map} +1 -1
  547. package/amd/{useTestId-6160e7a2.js → useTestId-f4240cbd.js} +2 -2
  548. package/amd/{useTestId-6160e7a2.js.map → useTestId-f4240cbd.js.map} +1 -1
  549. package/amd/{useTheme-59bafcbb.js → useTheme-da27e1d1.js} +2 -2
  550. package/amd/{useTheme-59bafcbb.js.map → useTheme-da27e1d1.js.map} +1 -1
  551. package/amd/useThemeInterpolations-cc05b0f0.js +2 -0
  552. package/amd/{useThemeInterpolations-53e9343f.js.map → useThemeInterpolations-cc05b0f0.js.map} +1 -1
  553. package/amd/useTooltip-c8aaf38a.js +2 -0
  554. package/amd/{useTooltip-5615359f.js.map → useTooltip-c8aaf38a.js.map} +1 -1
  555. package/amd/{useTooltipControlled-0e181f1a.js → useTooltipControlled-af5409d4.js} +2 -2
  556. package/amd/{useTooltipControlled-0e181f1a.js.map → useTooltipControlled-af5409d4.js.map} +1 -1
  557. package/amd/useTooltipOnTruncation-129d7663.js +2 -0
  558. package/amd/{useTooltipOnTruncation-5c26fe42.js.map → useTooltipOnTruncation-129d7663.js.map} +1 -1
  559. package/amd/{useTranslationBundle-db326955.js → useTranslationBundle-e4dd341e.js} +2 -2
  560. package/amd/{useTranslationBundle-db326955.js.map → useTranslationBundle-e4dd341e.js.map} +1 -1
  561. package/amd/{useUser-e0677e8d.js → useUser-08901aba.js} +2 -2
  562. package/amd/{useUser-e0677e8d.js.map → useUser-08901aba.js.map} +1 -1
  563. package/amd/useVisDragModeControls-47a4f754.js +1 -1
  564. package/amd/{useVisEvents-4860cd24.js → useVisEvents-5f18ab46.js} +2 -2
  565. package/amd/{useVisEvents-4860cd24.js.map → useVisEvents-5f18ab46.js.map} +1 -1
  566. package/amd/utils/PRIVATE_collectionUtils.js +1 -1
  567. package/amd/utils/PRIVATE_tabBarUtils.js +1 -1
  568. package/amd/utils/PRIVATE_tooltipUtils.js +1 -1
  569. package/amd/utils/PRIVATE_visTestUtils.js +1 -1
  570. package/amd/utils/UNSAFE_popupUtils.js +1 -1
  571. package/amd/{withDirectionIcon-07d1a4ee.js → withDirectionIcon-cea07c6e.js} +2 -2
  572. package/amd/{withDirectionIcon-07d1a4ee.js.map → withDirectionIcon-cea07c6e.js.map} +1 -1
  573. package/amd/withThemeProps-88ad9dea.js +1 -1
  574. package/cjs/{BaseCardView-b34fe51b.js → BaseCardView-5690e60a.js} +1 -4
  575. package/cjs/{BaseCardView-b34fe51b.js.map → BaseCardView-5690e60a.js.map} +1 -1
  576. package/cjs/{ColorPicker-24ef1a81.js → ColorPicker-3e500453.js} +2 -2
  577. package/cjs/{ColorPicker-24ef1a81.js.map → ColorPicker-3e500453.js.map} +1 -1
  578. package/cjs/PRIVATE_BaseCardView.js +1 -1
  579. package/cjs/PRIVATE_TableList.js +4 -4
  580. package/cjs/{TabBar-ab270d09.js → TabBar-a6629ef8.js} +1 -3
  581. package/cjs/{TabBar-ab270d09.js.map → TabBar-a6629ef8.js.map} +1 -1
  582. package/cjs/Theme-redwood/theme.css +152 -152
  583. package/cjs/Theme-stable/theme.css +164 -164
  584. package/cjs/UNSAFE_CardFlexView.js +1 -1
  585. package/cjs/UNSAFE_CardGridView.js +1 -1
  586. package/cjs/UNSAFE_ColorPicker.js +25 -25
  587. package/cjs/UNSAFE_InputColor.js +2 -2
  588. package/cjs/UNSAFE_ListView.js +53 -53
  589. package/cjs/UNSAFE_OverflowTabBar.js +10 -10
  590. package/cjs/UNSAFE_ReorderableTabBar.js +12 -12
  591. package/cjs/UNSAFE_TabBar.js +10 -10
  592. package/cjs/UNSAFE_TabBarMixed.js +8 -8
  593. package/es/{Chart-c9ad6478.js → Chart-ec6a48d2.js} +2 -2
  594. package/es/{Chart-c9ad6478.js.map → Chart-ec6a48d2.js.map} +1 -1
  595. package/es/CheckboxSet-ac2fc1ca.js +51 -0
  596. package/{amd/CheckboxSet-2242fd14.js.map → es/CheckboxSet-ac2fc1ca.js.map} +1 -1
  597. package/es/FormLayoutVariants.styles.css +14 -14
  598. package/es/FormLayoutVariants.styles2.css +14 -14
  599. package/es/PRIVATE_Chart.js +4 -4
  600. package/es/Theme-redwood/theme.css +435 -435
  601. package/es/Theme-stable/theme.css +552 -552
  602. package/es/UNSAFE_BarChart.js +4 -4
  603. package/es/UNSAFE_CheckboxItem.js +122 -61
  604. package/es/UNSAFE_CheckboxItem.js.map +1 -1
  605. package/es/UNSAFE_CheckboxSet.js +15 -49
  606. package/es/UNSAFE_CheckboxSet.js.map +1 -1
  607. package/es/UNSAFE_ComboChart.js +4 -4
  608. package/es/UNSAFE_FormLayout/themes/redwood/FormLayoutTheme.js +1 -1
  609. package/es/UNSAFE_FormLayout/themes/redwood/FormLayoutVariants.css.js +1 -1
  610. package/es/UNSAFE_FormLayout/themes/stable/FormLayoutTheme.js +1 -1
  611. package/es/UNSAFE_FormLayout/themes/stable/FormLayoutVariants.css.js +1 -1
  612. package/es/UNSAFE_FormLayout.js +1 -1
  613. package/es/UNSAFE_InputDatePicker.js +92 -92
  614. package/es/UNSAFE_LineAreaChart.js +4 -4
  615. package/es/UNSAFE_RichCheckboxSet.js +46 -42
  616. package/es/UNSAFE_RichCheckboxSet.js.map +1 -1
  617. package/es/UNSAFE_RichSelectionItem.js +152 -89
  618. package/es/UNSAFE_RichSelectionItem.js.map +1 -1
  619. package/es/UNSAFE_ScatterChart.js +4 -4
  620. package/es/UNSAFE_TextArea.js +226 -106
  621. package/es/UNSAFE_TextArea.js.map +1 -1
  622. package/es/UNSAFE_TextAreaAutosize.js +1 -1
  623. package/es/useTextAreaAltEnter-ac460f4c.js +61 -0
  624. package/es/useTextAreaAltEnter-ac460f4c.js.map +1 -0
  625. package/package.json +2 -2
  626. package/amd/Button-d541cd67.js +0 -2
  627. package/amd/CheckboxSet-2242fd14.js +0 -2
  628. package/amd/ColorPalette-f05a9dad.js +0 -2
  629. package/amd/ColorPicker-236d84f0.js +0 -2
  630. package/amd/CompactLabelAssistance-7bb76228.js +0 -2
  631. package/amd/DragHandle-652ffa0f.js +0 -2
  632. package/amd/EmbeddedIconButton-c3cb14c0.js +0 -2
  633. package/amd/Flex-71f83c12.js +0 -2
  634. package/amd/HighlightText-365ba020.js +0 -2
  635. package/amd/InputColor-a1fcd3b3.js +0 -2
  636. package/amd/InputDatePicker-b16a1592.js +0 -2
  637. package/amd/LayerManager-5ba8e6ed.js +0 -2
  638. package/amd/LiveRegion-1553833d.js +0 -2
  639. package/amd/MessageLayer-24870def.js +0 -2
  640. package/amd/VisNoDataMessage-e4eb08f6.js +0 -2
  641. package/amd/index-4f562976.js.map +0 -1
  642. package/amd/popupUtils-71ea5dd1.js +0 -2
  643. package/amd/render-40923005.js +0 -2
  644. package/amd/useCurrentKey-05038cac.js +0 -2
  645. package/amd/useKeyboardEvents-191a444a.js +0 -2
  646. package/amd/useMeterDatatip-d6977d41.js +0 -2
  647. package/amd/usePopupAnimation-389749fc.js +0 -2
  648. package/amd/usePrefixSuffix-7371ec52.js +0 -2
  649. package/amd/useRadioFocusManager-c613d2fc.js +0 -2
  650. package/amd/useThemeInterpolations-53e9343f.js +0 -2
  651. package/amd/useTooltip-5615359f.js +0 -2
  652. package/amd/useTooltipOnTruncation-5c26fe42.js +0 -2
  653. package/es/CheckboxSetContext-1be56556.js +0 -9
  654. package/es/TextArea-72682112.js +0 -225
  655. package/es/TextArea-72682112.js.map +0 -1
@@ -1,2 +1,2 @@
1
- define(['exports', 'preact/hooks', './LayerHost-1a734852', 'preact/jsx-runtime', 'preact/compat'], (function(e,t,n,o,r){"use strict";e.useHiddenTestMethod=function({elementRef:e,method:o,name:r}){const c=t.useContext(n.EnvironmentContext);t.useEffect((()=>{e.current&&"production"!==c.mode&&(e.current[r]=o)}),[c.mode,e,o,r])}}));
2
- //# sourceMappingURL=useHiddenTestMethod-6bbe8a43.js.map
1
+ define(['exports', 'preact/hooks', './LayerHost-0b288129', 'preact/jsx-runtime', 'preact/compat'], (function(e,t,n,o,r){"use strict";e.useHiddenTestMethod=function({elementRef:e,method:o,name:r}){const c=t.useContext(n.EnvironmentContext);t.useEffect((()=>{e.current&&"production"!==c.mode&&(e.current[r]=o)}),[c.mode,e,o,r])}}));
2
+ //# sourceMappingURL=useHiddenTestMethod-8321d341.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useHiddenTestMethod-6bbe8a43.js","sources":["../../src/hooks/UNSAFE_useHiddenTestMethod/useHiddenTestMethod.ts"],"sourcesContent":["import { RefObject } from 'preact';\nimport { useEffect } from 'preact/hooks';\nimport { EnvironmentContext } from '../../UNSAFE_Environment';\nimport { useContext } from 'preact/hooks';\n\ntype UseHiddenTestMethodProps = {\n elementRef: RefObject<HTMLElement>;\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n method: (...args: any[]) => void;\n name: string;\n};\n\n/**\n * This hook is used to add a hidden method to a component's root DOM element\n * that can be called by test adapters. The hidden method is only added when\n * we are not running in production mode, i.e. it's only used for testing.\n *\n * @param elementRef The ref to a component's root DOM element\n * @param method The hidden method to expose in the DOM\n * @param name The name of the hidden method in the DOM\n */\nexport function useHiddenTestMethod({ elementRef, method, name }: UseHiddenTestMethodProps) {\n const context = useContext(EnvironmentContext);\n\n // Add the hidden method to the DOM element only when mode !== production.\n useEffect(() => {\n if (elementRef.current && context.mode !== 'production') {\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n (elementRef.current as any)[name] = method;\n }\n }, [context.mode, elementRef, method, name]);\n}\n"],"names":["elementRef","method","name","context","useContext","EnvironmentContext","useEffect","current","mode"],"mappings":"sJAqBM,UAA8BA,WAAEA,EAAUC,OAAEA,EAAMC,KAAEA,IACxD,MAAMC,EAAUC,aAAWC,EAAAA,oBAG3BC,EAAAA,WAAU,KACJN,EAAWO,SAA4B,eAAjBJ,EAAQK,OAE/BR,EAAWO,QAAgBL,GAAQD,EACrC,GACA,CAACE,EAAQK,KAAMR,EAAYC,EAAQC,GACxC"}
1
+ {"version":3,"file":"useHiddenTestMethod-8321d341.js","sources":["../../src/hooks/UNSAFE_useHiddenTestMethod/useHiddenTestMethod.ts"],"sourcesContent":["import { RefObject } from 'preact';\nimport { useEffect } from 'preact/hooks';\nimport { EnvironmentContext } from '../../UNSAFE_Environment';\nimport { useContext } from 'preact/hooks';\n\ntype UseHiddenTestMethodProps = {\n elementRef: RefObject<HTMLElement>;\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n method: (...args: any[]) => void;\n name: string;\n};\n\n/**\n * This hook is used to add a hidden method to a component's root DOM element\n * that can be called by test adapters. The hidden method is only added when\n * we are not running in production mode, i.e. it's only used for testing.\n *\n * @param elementRef The ref to a component's root DOM element\n * @param method The hidden method to expose in the DOM\n * @param name The name of the hidden method in the DOM\n */\nexport function useHiddenTestMethod({ elementRef, method, name }: UseHiddenTestMethodProps) {\n const context = useContext(EnvironmentContext);\n\n // Add the hidden method to the DOM element only when mode !== production.\n useEffect(() => {\n if (elementRef.current && context.mode !== 'production') {\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n (elementRef.current as any)[name] = method;\n }\n }, [context.mode, elementRef, method, name]);\n}\n"],"names":["elementRef","method","name","context","useContext","EnvironmentContext","useEffect","current","mode"],"mappings":"sJAqBM,UAA8BA,WAAEA,EAAUC,OAAEA,EAAMC,KAAEA,IACxD,MAAMC,EAAUC,aAAWC,EAAAA,oBAG3BC,EAAAA,WAAU,KACJN,EAAWO,SAA4B,eAAjBJ,EAAQK,OAE/BR,EAAWO,QAAgBL,GAAQD,EACrC,GACA,CAACE,EAAQK,KAAMR,EAAYC,EAAQC,GACxC"}
@@ -0,0 +1,2 @@
1
+ define(['exports', './useUser-08901aba', './meterUtils-0278713d'], (function(e,a,t){"use strict";const r=(e,a,t)=>{t?.({value:e}),a.current=e},s=e=>{e.preventDefault(),e.stopPropagation()};e.handleInput=r,e.useKeyboardEvents=function(e,n,o,c,u,i,b){const{direction:h}=a.useUser(),k="rtl"===h,p=t.adjustForStep(e+c,c,n,o),d=t.adjustForStep(e-c,c,n,o);return{onKeyUp:a=>{switch(a.key){case"Enter":i?.({value:e}),s(a);break;case"Tab":r(e,u,b),s(a);break;case"Home":r(n,u,b),s(a);break;case"End":r(o,u,b),s(a)}},onKeyDown:e=>{switch(e.key){case"Tab":return;case"ArrowDown":r(Math.max(n,d),u,b),s(e);break;case"ArrowUp":r(Math.min(o,p),u,b),s(e);break;case"ArrowLeft":{const a=k?Math.min(o,p):Math.max(n,d);r(a,u,b),s(e);break}case"ArrowRight":{const a=k?Math.max(n,d):Math.min(o,p);r(a,u,b),s(e);break}}}}}}));
2
+ //# sourceMappingURL=useKeyboardEvents-f0419128.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useKeyboardEvents-191a444a.js","sources":["../../src/hooks/PRIVATE_useVisMeterEvents/events.ts","../../src/hooks/PRIVATE_useVisMeterEvents/useKeyboardEvents.ts"],"sourcesContent":["import type { MutableRef } from 'preact/hooks';\nimport { InputDetail } from '#utils/UNSAFE_meterUtils';\n\nexport const handleInput = (\n inputValue: number | undefined,\n currentInput: MutableRef<number | undefined>,\n onInput?: (detail: InputDetail) => void\n) => {\n onInput?.({ value: inputValue } as InputDetail);\n currentInput.current = inputValue;\n};\n\nexport const cancelEvent = (event: Event) => {\n event.preventDefault();\n event.stopPropagation();\n};\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { MutableRef } from 'preact/hooks';\nimport { useUser } from '#hooks/UNSAFE_useUser';\nimport { handleInput, cancelEvent } from './events';\nimport { CommitDetail, InputDetail } from '#utils/UNSAFE_meterUtils';\nimport { adjustForStep } from '#utils/PRIVATE_meterUtils/meterUtils';\n\nexport function useKeyboardEvents(\n value: number,\n min: number,\n max: number,\n step: number,\n currentInputRef: MutableRef<number | undefined>,\n onCommit?: (detail: CommitDetail) => void,\n onInput?: (detail: InputDetail) => void\n) {\n const { direction } = useUser();\n\n const isRtl = direction === 'rtl';\n\n const stepIncrementedVal = adjustForStep(value + step, step, min, max);\n const stepDecrementedVal = adjustForStep(value - step, step, min, max);\n\n const keyDownHandler = (event: KeyboardEvent) => {\n const key = event.key;\n\n switch (key) {\n case 'Tab':\n return;\n case 'ArrowDown':\n handleInput(Math.max(min, stepDecrementedVal), currentInputRef, onInput);\n cancelEvent(event);\n break;\n case 'ArrowUp':\n handleInput(Math.min(max, stepIncrementedVal), currentInputRef, onInput);\n cancelEvent(event);\n break;\n case 'ArrowLeft': {\n const inputValue = isRtl\n ? Math.min(max, stepIncrementedVal)\n : Math.max(min, stepDecrementedVal);\n handleInput(inputValue, currentInputRef, onInput);\n cancelEvent(event);\n break;\n }\n case 'ArrowRight': {\n const inputValue = isRtl\n ? Math.max(min, stepDecrementedVal)\n : Math.min(max, stepIncrementedVal);\n handleInput(inputValue, currentInputRef, onInput);\n cancelEvent(event);\n break;\n }\n }\n };\n\n const keyUpHandler = (event: KeyboardEvent) => {\n const key = event.key;\n\n switch (key) {\n case 'Enter':\n onCommit?.({ value: value } as CommitDetail);\n cancelEvent(event);\n break;\n case 'Tab':\n handleInput(value, currentInputRef, onInput);\n cancelEvent(event);\n break;\n case 'Home':\n handleInput(min, currentInputRef, onInput);\n cancelEvent(event);\n break;\n case 'End':\n handleInput(max, currentInputRef, onInput);\n cancelEvent(event);\n break;\n }\n };\n\n return {\n onKeyUp: keyUpHandler,\n onKeyDown: keyDownHandler\n };\n}\n"],"names":["handleInput","inputValue","currentInput","onInput","value","current","cancelEvent","event","preventDefault","stopPropagation","min","max","step","currentInputRef","onCommit","direction","useUser","isRtl","stepIncrementedVal","adjustForStep","stepDecrementedVal","onKeyUp","key","onKeyDown","Math"],"mappings":"8FAGa,MAAAA,EAAc,CACzBC,EACAC,EACAC,KAEAA,IAAU,CAAEC,MAAOH,IACnBC,EAAaG,QAAUJ,CAAU,EAGtBK,EAAeC,IAC1BA,EAAMC,iBACND,EAAME,iBAAiB,sCCAT,SACdL,EACAM,EACAC,EACAC,EACAC,EACAC,EACAX,GAEA,MAAMY,UAAEA,GAAcC,EAAAA,UAEhBC,EAAsB,QAAdF,EAERG,EAAqBC,EAAAA,cAAcf,EAAQQ,EAAMA,EAAMF,EAAKC,GAC5DS,EAAqBD,EAAAA,cAAcf,EAAQQ,EAAMA,EAAMF,EAAKC,GA0DlE,MAAO,CACLU,QAxBoBd,IAGpB,OAFYA,EAAMe,KAGhB,IAAK,QACHR,IAAW,CAAEV,MAAOA,IACpBE,EAAYC,GACZ,MACF,IAAK,MACHP,EAAYI,EAAOS,EAAiBV,GACpCG,EAAYC,GACZ,MACF,IAAK,OACHP,EAAYU,EAAKG,EAAiBV,GAClCG,EAAYC,GACZ,MACF,IAAK,MACHP,EAAYW,EAAKE,EAAiBV,GAClCG,EAAYC,GAEf,EAKDgB,UA1DsBhB,IAGtB,OAFYA,EAAMe,KAGhB,IAAK,MACH,OACF,IAAK,YACHtB,EAAYwB,KAAKb,IAAID,EAAKU,GAAqBP,EAAiBV,GAChEG,EAAYC,GACZ,MACF,IAAK,UACHP,EAAYwB,KAAKd,IAAIC,EAAKO,GAAqBL,EAAiBV,GAChEG,EAAYC,GACZ,MACF,IAAK,YAAa,CAChB,MAAMN,EAAagB,EACfO,KAAKd,IAAIC,EAAKO,GACdM,KAAKb,IAAID,EAAKU,GAClBpB,EAAYC,EAAYY,EAAiBV,GACzCG,EAAYC,GACZ,KACD,CACD,IAAK,aAAc,CACjB,MAAMN,EAAagB,EACfO,KAAKb,IAAID,EAAKU,GACdI,KAAKd,IAAIC,EAAKO,GAClBlB,EAAYC,EAAYY,EAAiBV,GACzCG,EAAYC,GACZ,KACD,EACF,EA8BL"}
1
+ {"version":3,"file":"useKeyboardEvents-f0419128.js","sources":["../../src/hooks/PRIVATE_useVisMeterEvents/events.ts","../../src/hooks/PRIVATE_useVisMeterEvents/useKeyboardEvents.ts"],"sourcesContent":["import type { MutableRef } from 'preact/hooks';\nimport { InputDetail } from '#utils/UNSAFE_meterUtils';\n\nexport const handleInput = (\n inputValue: number | undefined,\n currentInput: MutableRef<number | undefined>,\n onInput?: (detail: InputDetail) => void\n) => {\n onInput?.({ value: inputValue } as InputDetail);\n currentInput.current = inputValue;\n};\n\nexport const cancelEvent = (event: Event) => {\n event.preventDefault();\n event.stopPropagation();\n};\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { MutableRef } from 'preact/hooks';\nimport { useUser } from '#hooks/UNSAFE_useUser';\nimport { handleInput, cancelEvent } from './events';\nimport { CommitDetail, InputDetail } from '#utils/UNSAFE_meterUtils';\nimport { adjustForStep } from '#utils/PRIVATE_meterUtils/meterUtils';\n\nexport function useKeyboardEvents(\n value: number,\n min: number,\n max: number,\n step: number,\n currentInputRef: MutableRef<number | undefined>,\n onCommit?: (detail: CommitDetail) => void,\n onInput?: (detail: InputDetail) => void\n) {\n const { direction } = useUser();\n\n const isRtl = direction === 'rtl';\n\n const stepIncrementedVal = adjustForStep(value + step, step, min, max);\n const stepDecrementedVal = adjustForStep(value - step, step, min, max);\n\n const keyDownHandler = (event: KeyboardEvent) => {\n const key = event.key;\n\n switch (key) {\n case 'Tab':\n return;\n case 'ArrowDown':\n handleInput(Math.max(min, stepDecrementedVal), currentInputRef, onInput);\n cancelEvent(event);\n break;\n case 'ArrowUp':\n handleInput(Math.min(max, stepIncrementedVal), currentInputRef, onInput);\n cancelEvent(event);\n break;\n case 'ArrowLeft': {\n const inputValue = isRtl\n ? Math.min(max, stepIncrementedVal)\n : Math.max(min, stepDecrementedVal);\n handleInput(inputValue, currentInputRef, onInput);\n cancelEvent(event);\n break;\n }\n case 'ArrowRight': {\n const inputValue = isRtl\n ? Math.max(min, stepDecrementedVal)\n : Math.min(max, stepIncrementedVal);\n handleInput(inputValue, currentInputRef, onInput);\n cancelEvent(event);\n break;\n }\n }\n };\n\n const keyUpHandler = (event: KeyboardEvent) => {\n const key = event.key;\n\n switch (key) {\n case 'Enter':\n onCommit?.({ value: value } as CommitDetail);\n cancelEvent(event);\n break;\n case 'Tab':\n handleInput(value, currentInputRef, onInput);\n cancelEvent(event);\n break;\n case 'Home':\n handleInput(min, currentInputRef, onInput);\n cancelEvent(event);\n break;\n case 'End':\n handleInput(max, currentInputRef, onInput);\n cancelEvent(event);\n break;\n }\n };\n\n return {\n onKeyUp: keyUpHandler,\n onKeyDown: keyDownHandler\n };\n}\n"],"names":["handleInput","inputValue","currentInput","onInput","value","current","cancelEvent","event","preventDefault","stopPropagation","min","max","step","currentInputRef","onCommit","direction","useUser","isRtl","stepIncrementedVal","adjustForStep","stepDecrementedVal","onKeyUp","key","onKeyDown","Math"],"mappings":"8FAGa,MAAAA,EAAc,CACzBC,EACAC,EACAC,KAEAA,IAAU,CAAEC,MAAOH,IACnBC,EAAaG,QAAUJ,CAAU,EAGtBK,EAAeC,IAC1BA,EAAMC,iBACND,EAAME,iBAAiB,sCCAT,SACdL,EACAM,EACAC,EACAC,EACAC,EACAC,EACAX,GAEA,MAAMY,UAAEA,GAAcC,EAAAA,UAEhBC,EAAsB,QAAdF,EAERG,EAAqBC,EAAAA,cAAcf,EAAQQ,EAAMA,EAAMF,EAAKC,GAC5DS,EAAqBD,EAAAA,cAAcf,EAAQQ,EAAMA,EAAMF,EAAKC,GA0DlE,MAAO,CACLU,QAxBoBd,IAGpB,OAFYA,EAAMe,KAGhB,IAAK,QACHR,IAAW,CAAEV,MAAOA,IACpBE,EAAYC,GACZ,MACF,IAAK,MACHP,EAAYI,EAAOS,EAAiBV,GACpCG,EAAYC,GACZ,MACF,IAAK,OACHP,EAAYU,EAAKG,EAAiBV,GAClCG,EAAYC,GACZ,MACF,IAAK,MACHP,EAAYW,EAAKE,EAAiBV,GAClCG,EAAYC,GAEf,EAKDgB,UA1DsBhB,IAGtB,OAFYA,EAAMe,KAGhB,IAAK,MACH,OACF,IAAK,YACHtB,EAAYwB,KAAKb,IAAID,EAAKU,GAAqBP,EAAiBV,GAChEG,EAAYC,GACZ,MACF,IAAK,UACHP,EAAYwB,KAAKd,IAAIC,EAAKO,GAAqBL,EAAiBV,GAChEG,EAAYC,GACZ,MACF,IAAK,YAAa,CAChB,MAAMN,EAAagB,EACfO,KAAKd,IAAIC,EAAKO,GACdM,KAAKb,IAAID,EAAKU,GAClBpB,EAAYC,EAAYY,EAAiBV,GACzCG,EAAYC,GACZ,KACD,CACD,IAAK,aAAc,CACjB,MAAMN,EAAagB,EACfO,KAAKb,IAAID,EAAKU,GACdI,KAAKd,IAAIC,EAAKO,GAClBlB,EAAYC,EAAYY,EAAiBV,GACzCG,EAAYC,GACZ,KACD,EACF,EA8BL"}
@@ -1,2 +1,2 @@
1
- define(['exports', 'preact/jsx-runtime', './classNames-08d99695', 'preact/compat', './PRIVATE_BaseLegend/themes/LegendStyles.css', './useLegendDnd-9b550023', './SvgSymbol-b672024f', './Text-31cabc49', 'preact/hooks', './useUser-e0677e8d', './datatipUtils-6846028e', './useDatatip-656c8df6', './useContextMenu-c4fc924d', './Menu-4b445ba5', './MenuItem-f3de5e35', 'preact', './logger-0f873e29', './LayerHost-1a734852', 'css!./TooltipContentStyles.styles.css', 'module', './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css', './tooltipUtils-0761844d', 'css!./IconStyle.styles.css', './SelectMenuGroupContext-67f24a8f', './UNSAFE_Menu/themes/MenuItemStyles.css', './UNSAFE_Separator/themes/SeparatorStyles.css', 'css!./MenuSeparatorStyles.styles.css', 'module', './UNSAFE_Menu/themes/redwood/MenuSeparatorVariants.css', 'css!./MenuStyles.styles.css'], (function(e,t,n,o,i,s,r,l,a,d,c,u,m,h,x,g,y,p,C,f,S,I,b,M,v,F,T,k,A,R){"use strict";function w(e){const{imageMarkerStyle:n}=i.styles;return t.jsx("img",{class:n,src:e.source,role:"none"})}const L=({markerColor:e="#a6acb1",lineColor:n="#a6acb1",markerShape:o="square",isHidden:s=!1,lineStyle:l="none",...a})=>{const{legendSymbolBaseStyle:d}=i.styles,c=!(null==a.width&&null==a.height)&&("rectangle"===o||"ellipse"===o),u="none"!=l&&"none"!=o?2:3;return t.jsx("div",{className:d,style:{width:a.width,height:a.height},children:a.source?t.jsx(w,{source:a.source}):t.jsx(r.SvgSymbol,{setAspectRatioNone:c,markerShape:s?"square":o,lineStyle:s?"none":l,lineColor:n,lineLength:a.lineLength,lineWidth:null!=a.lineWidth?a.lineWidth:u,markerColor:s?"transparent":e,borderColor:s?e||n:a.borderColor,setAbsolutePos:!0})})},W=({text:e,type:o="label",id:s,align:r="start",...a})=>{const{legendTextBaseStyle:d,legendTextTitle:c,legendTitleStartAlign:u,legendTitleCenterAlign:m,legendTitleEndAlign:h}=i.styles,x="title"===o;return t.jsx("div",{class:n.classNames([d,x?c:"",x&&"start"===r?u:"",x&&"center"===r?m:"",x&&"end"===r?h:""]),style:{...a},children:t.jsx(l.Text,{size:"inherit",variant:"inherit",weight:"inherit",truncation:"ellipsis",id:s,children:e})})},D=o.forwardRef((({id:e,text:o,sectionIdx:r,itemIdx:l,itemId:a,isHighlighted:d,symbolHeight:c,symbolWidth:u,isFocused:m,isCurrent:h,isHidden:x,actionable:g="inherit",hoverBehavior:y="none",hideAndShowBehavior:p="off",...C},f)=>{const S={fontFamily:C.textFontFamily,fontSize:C.textFontSize,color:C.textColor,fontStyle:C.textFontStyle,fontWeight:C.textFontWeight,textDecoration:C.textTextDecoration},I={lineStyle:C.lineStyle,lineWidth:C.lineWidth,markerShape:C.markerShape,markerColor:C.markerColor,source:C.source,borderColor:C.borderColor,lineColor:C.lineColor},b=d||null==d,{legendItemBaseStyle:M,legendItemOpacity:v,legendItemFocusRing:F}=i.styles;return t.jsxs("div",{class:n.classNames([M,s.getLegendCurrentItemStyle(h,d,p,y,x,g),b?"":v,m?F:"",C.class]),style:{gridRow:C.gridRow,gridColumn:C.gridCol,minWidth:void 0!==C.minWidth?`${C.minWidth}px`:void 0},id:e,ref:f,"data-oj-private-section":r,"data-oj-private-item":l,"data-oj-private-item-id":a,role:null!=x?"menuitemcheckbox":"img","aria-checked":null!=x?!x:void 0,"aria-label":C["aria-label"]||o,children:[t.jsx(L,{...I,isHidden:x,lineLength:u,width:null!=u?`${u}px`:void 0,height:null!=c?`${c}px`:void 0}),t.jsx(W,{...S,text:o,type:"label"})]})})),P=(e,t,n,o)=>{let i=0,s=c.DATATIP_OFFSET;if(e.current&&n.isCurrent&&t.current){const n=t.current,r=e.current.getBoundingClientRect();i=r.x+r.width/2-(n.x+n.width/2),i=o?-1*i:i,s+=n.y-r.y,s=Math.min(c.DATATIP_OFFSET,Math.max(s,r.height-n.height+c.DATATIP_OFFSET))}return{crossAxis:i,mainAxis:s}};e.BaseLegend=({orientation:e="horizontal",highlightedIds:o,hiddenIds:r,focusedItemInfo:l,hoveredItemInfo:a,sectionIdx:d,activeId:c,isReadOnly:u,items:m,symbolHeight:h,symbolWidth:x,hideAndShowBehavior:g="off",hoverBehavior:y="none",isTestEnv:p,...C})=>{const f="horizontal"===e,S=f?`repeat(${C.itemsPerRow}, ${C.itemWidth})`:void 0,{baseLegendStyles:I,baseLegendHorizontal:b,baseLegendVertical:M,baseLegendVerticalItem:v,baseLegendPaddingBottom:F,baseLegendPaddingTop:T,baseLegendPaddingEnd:k}=i.styles;return t.jsx("div",{className:n.classNames([I,f?b:M]),style:{gridTemplateColumns:S,maxWidth:"100%"},children:m.map(((e,i)=>{const{markerColor:S,markerShape:I,source:b,borderColor:M,lineColor:A,isCurrent:R,isFocused:w,isHidden:L,isHighlighted:W,key:P,actionable:j,text:B,lineStyle:H,lineWidth:E}=s.getItemProps(e,i,d,l,u,a,r,o),N=l.sectionIdx===d&&l.itemIdx===i,{gridRow:U,gridCol:_}=s.getGridCellIndices(m.length,i,C.itemsPerRow,C.itemsPerCol),O=null!=U&&U!=C.itemsPerCol,z=null!=U&&1!=U;return t.jsx(D,{ref:N?C.focusedItemRef:void 0,text:B,itemIdx:i,sectionIdx:d,itemId:p?e.id:void 0,symbolHeight:h,symbolWidth:x,markerColor:S,markerShape:I,lineStyle:H,lineWidth:E,source:b,borderColor:M,"aria-label":e["aria-label"],lineColor:A,isCurrent:R,isFocused:w,isHidden:L,isHighlighted:W,gridRow:U,gridCol:_,minWidth:C.itemWidth,id:R?c:"",textColor:C.textColor,textFontFamily:C.textFontFamily,textFontSize:C.textFontSize,textFontStyle:C.textFontStyle,textFontWeight:C.textFontWeight,textTextDecoration:C.textTextDecoration,class:n.classNames([f?"":v,z?T:"",O?F:"",k]),hideAndShowBehavior:g,hoverBehavior:y,actionable:j},P)}))})},e.LegendText=W,e.useLegendContextMenu=({rootRef:e,contextMenuConfig:t,focusedItemInfo:n,items:o,isReadOnly:i,onContextMenuDismissed:r})=>{const{contextMenuProps:l,contextMenuContent:a}=m.useContextMenu({onContextMenuHandler:({gesture:t,target:i})=>{if("keyboard"===t){const t=n.itemIdx,i=e.current?.querySelector(`[data-oj-private-item="${t}"]`)||null;return{type:"element",context:{type:"item",data:o[t]},elem:i}}const r=s.getItemInfo(i)?.itemIdx,l=void 0!==r?o[r]:null;return{type:"pointer",context:l?{type:"item",data:l}:{type:"background"}}},contextMenuOptions:{isDisabled:!t||i},rootRef:e,contextMenuConfig:t,onContextMenuDismissed:r});return{contextMenuContent:a,contextMenuProps:l}},e.useLegendDatatip=function({rootDimsRef:e,focusedItemRef:t,focusedItemInfo:n,touchResponse:o,isDisabled:i,datatip:s,items:r,hoveredItemInfo:l,sections:c}){const{direction:m}=d.useUser(),h="rtl"===m,[x,g]=a.useState(P(t,e,n,h));let y,p,C;a.useLayoutEffect((()=>{g(P(t,e,n,h))}),[n,t,h,e]);const f=n?.isCurrent?n:l?.isCurrent?l:void 0;if(f){const{itemIdx:e,sectionIdx:t}=f,n=c&&c.length>0?c[t].items[e]:r&&r[e];if(n){const o={data:n,itemIndex:e,sectionIndex:t,id:n.id};y=n.datatip;const i=s?.(o);i&&(y=i.content,p=i.borderColor,C=i.defaultContainer)}}const S=n?.isCurrent?"element":"pointer";return u.useDatatip({content:y,placement:"top",anchor:S,offset:x,touchResponse:o,isDisabled:i,borderColor:p,defaultContainer:C})},e.useSectionalLegendContextMenu=({rootRef:e,contextMenuConfig:t,focusedItemInfo:n,sections:o,isReadOnly:i,onContextMenuDismissed:r})=>{const{contextMenuProps:l,contextMenuContent:a}=m.useContextMenu({onContextMenuHandler:({gesture:t,target:i})=>{if("keyboard"===t){const t=n.itemIdx,i=n.sectionIdx,s=o[i]?.items[t];if(s){return{type:"element",context:{type:"item",itemIndexPath:[i,t],data:s},elem:e.current?.querySelector(`[data-oj-private-item="${t}"][data-oj-private-section="${i}"]`)||null}}}const r=s.getItemInfo(i)?.itemIdx,l=s.getItemInfo(i)?.sectionIdx,a=void 0!==l&&void 0!==r?o[l]?.items[r]:null;return{type:"pointer",context:a?{type:"item",data:a,itemIndexPath:[l,r]}:{type:"background"}}},contextMenuOptions:{isDisabled:!t||i},rootRef:e,contextMenuConfig:t,onContextMenuDismissed:r});return{contextMenuContent:a,contextMenuProps:l}}}));
1
+ define(['exports', 'preact/jsx-runtime', './classNames-08d99695', 'preact/compat', './PRIVATE_BaseLegend/themes/LegendStyles.css', './useLegendDnd-9b550023', './SvgSymbol-b672024f', './Text-31cabc49', 'preact/hooks', './useUser-08901aba', './datatipUtils-6846028e', './useDatatip-df022581', './useContextMenu-c4fc924d', './Menu-4b445ba5', './MenuItem-f3de5e35', 'preact', './logger-0f873e29', './LayerHost-0b288129', 'css!./TooltipContentStyles.styles.css', 'module', './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css', './tooltipUtils-66f3844a', 'css!./IconStyle.styles.css', './SelectMenuGroupContext-67f24a8f', './UNSAFE_Menu/themes/MenuItemStyles.css', './UNSAFE_Separator/themes/SeparatorStyles.css', 'css!./MenuSeparatorStyles.styles.css', 'module', './UNSAFE_Menu/themes/redwood/MenuSeparatorVariants.css', 'css!./MenuStyles.styles.css'], (function(e,t,n,o,i,s,r,l,a,d,c,u,m,h,x,g,y,p,C,f,S,I,b,M,v,F,T,k,A,R){"use strict";function w(e){const{imageMarkerStyle:n}=i.styles;return t.jsx("img",{class:n,src:e.source,role:"none"})}const L=({markerColor:e="#a6acb1",lineColor:n="#a6acb1",markerShape:o="square",isHidden:s=!1,lineStyle:l="none",...a})=>{const{legendSymbolBaseStyle:d}=i.styles,c=!(null==a.width&&null==a.height)&&("rectangle"===o||"ellipse"===o),u="none"!=l&&"none"!=o?2:3;return t.jsx("div",{className:d,style:{width:a.width,height:a.height},children:a.source?t.jsx(w,{source:a.source}):t.jsx(r.SvgSymbol,{setAspectRatioNone:c,markerShape:s?"square":o,lineStyle:s?"none":l,lineColor:n,lineLength:a.lineLength,lineWidth:null!=a.lineWidth?a.lineWidth:u,markerColor:s?"transparent":e,borderColor:s?e||n:a.borderColor,setAbsolutePos:!0})})},W=({text:e,type:o="label",id:s,align:r="start",...a})=>{const{legendTextBaseStyle:d,legendTextTitle:c,legendTitleStartAlign:u,legendTitleCenterAlign:m,legendTitleEndAlign:h}=i.styles,x="title"===o;return t.jsx("div",{class:n.classNames([d,x?c:"",x&&"start"===r?u:"",x&&"center"===r?m:"",x&&"end"===r?h:""]),style:{...a},children:t.jsx(l.Text,{size:"inherit",variant:"inherit",weight:"inherit",truncation:"ellipsis",id:s,children:e})})},D=o.forwardRef((({id:e,text:o,sectionIdx:r,itemIdx:l,itemId:a,isHighlighted:d,symbolHeight:c,symbolWidth:u,isFocused:m,isCurrent:h,isHidden:x,actionable:g="inherit",hoverBehavior:y="none",hideAndShowBehavior:p="off",...C},f)=>{const S={fontFamily:C.textFontFamily,fontSize:C.textFontSize,color:C.textColor,fontStyle:C.textFontStyle,fontWeight:C.textFontWeight,textDecoration:C.textTextDecoration},I={lineStyle:C.lineStyle,lineWidth:C.lineWidth,markerShape:C.markerShape,markerColor:C.markerColor,source:C.source,borderColor:C.borderColor,lineColor:C.lineColor},b=d||null==d,{legendItemBaseStyle:M,legendItemOpacity:v,legendItemFocusRing:F}=i.styles;return t.jsxs("div",{class:n.classNames([M,s.getLegendCurrentItemStyle(h,d,p,y,x,g),b?"":v,m?F:"",C.class]),style:{gridRow:C.gridRow,gridColumn:C.gridCol,minWidth:void 0!==C.minWidth?`${C.minWidth}px`:void 0},id:e,ref:f,"data-oj-private-section":r,"data-oj-private-item":l,"data-oj-private-item-id":a,role:null!=x?"menuitemcheckbox":"img","aria-checked":null!=x?!x:void 0,"aria-label":C["aria-label"]||o,children:[t.jsx(L,{...I,isHidden:x,lineLength:u,width:null!=u?`${u}px`:void 0,height:null!=c?`${c}px`:void 0}),t.jsx(W,{...S,text:o,type:"label"})]})})),P=(e,t,n,o)=>{let i=0,s=c.DATATIP_OFFSET;if(e.current&&n.isCurrent&&t.current){const n=t.current,r=e.current.getBoundingClientRect();i=r.x+r.width/2-(n.x+n.width/2),i=o?-1*i:i,s+=n.y-r.y,s=Math.min(c.DATATIP_OFFSET,Math.max(s,r.height-n.height+c.DATATIP_OFFSET))}return{crossAxis:i,mainAxis:s}};e.BaseLegend=({orientation:e="horizontal",highlightedIds:o,hiddenIds:r,focusedItemInfo:l,hoveredItemInfo:a,sectionIdx:d,activeId:c,isReadOnly:u,items:m,symbolHeight:h,symbolWidth:x,hideAndShowBehavior:g="off",hoverBehavior:y="none",isTestEnv:p,...C})=>{const f="horizontal"===e,S=f?`repeat(${C.itemsPerRow}, ${C.itemWidth})`:void 0,{baseLegendStyles:I,baseLegendHorizontal:b,baseLegendVertical:M,baseLegendVerticalItem:v,baseLegendPaddingBottom:F,baseLegendPaddingTop:T,baseLegendPaddingEnd:k}=i.styles;return t.jsx("div",{className:n.classNames([I,f?b:M]),style:{gridTemplateColumns:S,maxWidth:"100%"},children:m.map(((e,i)=>{const{markerColor:S,markerShape:I,source:b,borderColor:M,lineColor:A,isCurrent:R,isFocused:w,isHidden:L,isHighlighted:W,key:P,actionable:j,text:B,lineStyle:H,lineWidth:E}=s.getItemProps(e,i,d,l,u,a,r,o),N=l.sectionIdx===d&&l.itemIdx===i,{gridRow:U,gridCol:_}=s.getGridCellIndices(m.length,i,C.itemsPerRow,C.itemsPerCol),O=null!=U&&U!=C.itemsPerCol,z=null!=U&&1!=U;return t.jsx(D,{ref:N?C.focusedItemRef:void 0,text:B,itemIdx:i,sectionIdx:d,itemId:p?e.id:void 0,symbolHeight:h,symbolWidth:x,markerColor:S,markerShape:I,lineStyle:H,lineWidth:E,source:b,borderColor:M,"aria-label":e["aria-label"],lineColor:A,isCurrent:R,isFocused:w,isHidden:L,isHighlighted:W,gridRow:U,gridCol:_,minWidth:C.itemWidth,id:R?c:"",textColor:C.textColor,textFontFamily:C.textFontFamily,textFontSize:C.textFontSize,textFontStyle:C.textFontStyle,textFontWeight:C.textFontWeight,textTextDecoration:C.textTextDecoration,class:n.classNames([f?"":v,z?T:"",O?F:"",k]),hideAndShowBehavior:g,hoverBehavior:y,actionable:j},P)}))})},e.LegendText=W,e.useLegendContextMenu=({rootRef:e,contextMenuConfig:t,focusedItemInfo:n,items:o,isReadOnly:i,onContextMenuDismissed:r})=>{const{contextMenuProps:l,contextMenuContent:a}=m.useContextMenu({onContextMenuHandler:({gesture:t,target:i})=>{if("keyboard"===t){const t=n.itemIdx,i=e.current?.querySelector(`[data-oj-private-item="${t}"]`)||null;return{type:"element",context:{type:"item",data:o[t]},elem:i}}const r=s.getItemInfo(i)?.itemIdx,l=void 0!==r?o[r]:null;return{type:"pointer",context:l?{type:"item",data:l}:{type:"background"}}},contextMenuOptions:{isDisabled:!t||i},rootRef:e,contextMenuConfig:t,onContextMenuDismissed:r});return{contextMenuContent:a,contextMenuProps:l}},e.useLegendDatatip=function({rootDimsRef:e,focusedItemRef:t,focusedItemInfo:n,touchResponse:o,isDisabled:i,datatip:s,items:r,hoveredItemInfo:l,sections:c}){const{direction:m}=d.useUser(),h="rtl"===m,[x,g]=a.useState(P(t,e,n,h));let y,p,C;a.useLayoutEffect((()=>{g(P(t,e,n,h))}),[n,t,h,e]);const f=n?.isCurrent?n:l?.isCurrent?l:void 0;if(f){const{itemIdx:e,sectionIdx:t}=f,n=c&&c.length>0?c[t].items[e]:r&&r[e];if(n){const o={data:n,itemIndex:e,sectionIndex:t,id:n.id};y=n.datatip;const i=s?.(o);i&&(y=i.content,p=i.borderColor,C=i.defaultContainer)}}const S=n?.isCurrent?"element":"pointer";return u.useDatatip({content:y,placement:"top",anchor:S,offset:x,touchResponse:o,isDisabled:i,borderColor:p,defaultContainer:C})},e.useSectionalLegendContextMenu=({rootRef:e,contextMenuConfig:t,focusedItemInfo:n,sections:o,isReadOnly:i,onContextMenuDismissed:r})=>{const{contextMenuProps:l,contextMenuContent:a}=m.useContextMenu({onContextMenuHandler:({gesture:t,target:i})=>{if("keyboard"===t){const t=n.itemIdx,i=n.sectionIdx,s=o[i]?.items[t];if(s){return{type:"element",context:{type:"item",itemIndexPath:[i,t],data:s},elem:e.current?.querySelector(`[data-oj-private-item="${t}"][data-oj-private-section="${i}"]`)||null}}}const r=s.getItemInfo(i)?.itemIdx,l=s.getItemInfo(i)?.sectionIdx,a=void 0!==l&&void 0!==r?o[l]?.items[r]:null;return{type:"pointer",context:a?{type:"item",data:a,itemIndexPath:[l,r]}:{type:"background"}}},contextMenuOptions:{isDisabled:!t||i},rootRef:e,contextMenuConfig:t,onContextMenuDismissed:r});return{contextMenuContent:a,contextMenuProps:l}}}));
2
2
  //# sourceMappingURL=useLegendContextMenu-9b6f6083.js.map
@@ -0,0 +1,2 @@
1
+ define(['exports', 'preact/hooks', './useKeyboardEvents-f0419128', './useDatatip-df022581'], (function(t,e,n,r){"use strict";t.useMeterDatatip=function(t,e,n,o){const i=void 0===n?`${t}`:n,{datatipContent:u,datatipProps:c}=r.useDatatip({content:i,anchor:e.current?"pointer":"element",offset:{mainAxis:8,crossAxis:0},placement:"top",touchResponse:"touchStart"});return c["aria-describedby"]=[o,c["aria-describedby"]].filter(Boolean).join(" ")||void 0,{datatipContent:u,datatipProps:c}},t.usePointerEvents=function(t,r,o,i,u,c,a){const s=e.useRef(!1);return{onPointerUp:t=>{s.current=!1;const e=r(t);void 0!==e&&c?.({value:e}),u.current=!0},onBlur:()=>{s.current=!1,c?.({value:t}),u.current=!1},onPointerMove:t=>{if(s.current){const e=r(t);void 0!==e&&e!=i.current&&n.handleInput(e,i,a)}u.current=!0},onPointerDown:t=>{s.current=!0,o.current?.setPointerCapture(t.pointerId);const e=r(t);void 0!==e&&e!=i.current&&n.handleInput(e,i,a),u.current=!0},onPointerLeave:()=>{u.current=!1},onPointerEnter:()=>{u.current=!0}}}}));
2
+ //# sourceMappingURL=useMeterDatatip-5598534c.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMeterDatatip-d6977d41.js","sources":["../../src/hooks/PRIVATE_useVisMeterEvents/useMeterDatatip.tsx","../../src/hooks/PRIVATE_useVisMeterEvents/usePointerEvents.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { MutableRef } from 'preact/hooks';\nimport { useDatatip } from '#hooks/PRIVATE_useDatatip';\n\nexport function useMeterDatatip(\n value: number,\n isPointerActiveRef: MutableRef<boolean>,\n datatip?: string | null,\n ariaDescribedBy?: string\n) {\n const datatipText = datatip === undefined ? `${value}` : datatip;\n const { datatipContent, datatipProps } = useDatatip({\n content: datatipText,\n anchor: isPointerActiveRef.current ? 'pointer' : 'element',\n offset: {\n mainAxis: 8,\n crossAxis: 0\n },\n placement: 'top',\n touchResponse: 'touchStart'\n });\n\n datatipProps['aria-describedby'] =\n [ariaDescribedBy, datatipProps['aria-describedby']].filter(Boolean).join(' ') || undefined;\n\n return { datatipContent, datatipProps };\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport type { RefObject } from 'preact';\nimport { MutableRef, useRef } from 'preact/hooks';\nimport { handleInput } from './events';\nimport { CommitDetail, InputDetail } from '#utils/UNSAFE_meterUtils';\n\ntype getValueFromEvent = (event: PointerEvent) => number | undefined;\n\nexport function usePointerEvents(\n value: number | undefined,\n getValue: getValueFromEvent,\n targetRef: RefObject<HTMLDivElement>,\n currentInputRef: MutableRef<number | undefined>,\n isPointerActiveRef: MutableRef<boolean | undefined>,\n onCommit?: (detail: CommitDetail) => void,\n onInput?: (detail: InputDetail) => void\n) {\n const isPointerDown = useRef<boolean>(false);\n\n const onPointerUp = (event: PointerEvent) => {\n isPointerDown.current = false;\n const val = getValue(event);\n if (val !== undefined) {\n onCommit?.({ value: val } as CommitDetail);\n }\n isPointerActiveRef.current = true;\n };\n\n const onPointerMove = (event: PointerEvent) => {\n if (isPointerDown.current) {\n const val = getValue(event);\n if (val !== undefined && val != currentInputRef.current) {\n handleInput(val, currentInputRef, onInput);\n }\n }\n isPointerActiveRef.current = true;\n };\n\n const onPointerDown = (event: PointerEvent) => {\n isPointerDown.current = true;\n targetRef.current?.setPointerCapture(event.pointerId);\n const val = getValue(event);\n if (val !== undefined && val != currentInputRef.current) {\n handleInput(val, currentInputRef, onInput);\n }\n isPointerActiveRef.current = true;\n };\n\n const onBlur = () => {\n isPointerDown.current = false;\n onCommit?.({ value: value } as CommitDetail);\n isPointerActiveRef.current = false;\n };\n\n const onPointerLeave = () => {\n isPointerActiveRef.current = false;\n };\n\n const onPointerEnter = () => {\n isPointerActiveRef.current = true;\n };\n\n return {\n onPointerUp,\n onBlur,\n onPointerMove,\n onPointerDown,\n onPointerLeave,\n onPointerEnter\n };\n}\n"],"names":["value","isPointerActiveRef","datatip","ariaDescribedBy","datatipText","undefined","datatipContent","datatipProps","useDatatip","content","anchor","current","offset","mainAxis","crossAxis","placement","touchResponse","filter","Boolean","join","getValue","targetRef","currentInputRef","onCommit","onInput","isPointerDown","useRef","onPointerUp","event","val","onBlur","onPointerMove","handleInput","onPointerDown","setPointerCapture","pointerId","onPointerLeave","onPointerEnter"],"mappings":"2IAUM,SACJA,EACAC,EACAC,EACAC,GAEA,MAAMC,OAA0BC,IAAZH,EAAwB,GAAGF,IAAUE,GACnDI,eAAEA,EAAcC,aAAEA,GAAiBC,aAAW,CAClDC,QAASL,EACTM,OAAQT,EAAmBU,QAAU,UAAY,UACjDC,OAAQ,CACNC,SAAU,EACVC,UAAW,GAEbC,UAAW,MACXC,cAAe,eAMjB,OAHAT,EAAa,oBACX,CAACJ,EAAiBI,EAAa,qBAAqBU,OAAOC,SAASC,KAAK,WAAQd,EAE5E,CAAEC,iBAAgBC,eAC3B,qBClBgB,SACdP,EACAoB,EACAC,EACAC,EACArB,EACAsB,EACAC,GAEA,MAAMC,EAAgBC,UAAgB,GA6CtC,MAAO,CACLC,YA5CmBC,IACnBH,EAAcd,SAAU,EACxB,MAAMkB,EAAMT,EAASQ,QACTvB,IAARwB,GACFN,IAAW,CAAEvB,MAAO6B,IAEtB5B,EAAmBU,SAAU,CAAI,EAuCjCmB,OAhBa,KACbL,EAAcd,SAAU,EACxBY,IAAW,CAAEvB,MAAOA,IACpBC,EAAmBU,SAAU,CAAK,EAclCoB,cArCqBH,IACrB,GAAIH,EAAcd,QAAS,CACzB,MAAMkB,EAAMT,EAASQ,QACTvB,IAARwB,GAAqBA,GAAOP,EAAgBX,SAC9CqB,EAAAA,YAAYH,EAAKP,EAAiBE,EAErC,CACDvB,EAAmBU,SAAU,CAAI,EA+BjCsB,cA5BqBL,IACrBH,EAAcd,SAAU,EACxBU,EAAUV,SAASuB,kBAAkBN,EAAMO,WAC3C,MAAMN,EAAMT,EAASQ,QACTvB,IAARwB,GAAqBA,GAAOP,EAAgBX,SAC9CqB,EAAAA,YAAYH,EAAKP,EAAiBE,GAEpCvB,EAAmBU,SAAU,CAAI,EAsBjCyB,eAbqB,KACrBnC,EAAmBU,SAAU,CAAK,EAalC0B,eAVqB,KACrBpC,EAAmBU,SAAU,CAAI,EAWrC"}
1
+ {"version":3,"file":"useMeterDatatip-5598534c.js","sources":["../../src/hooks/PRIVATE_useVisMeterEvents/useMeterDatatip.tsx","../../src/hooks/PRIVATE_useVisMeterEvents/usePointerEvents.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { MutableRef } from 'preact/hooks';\nimport { useDatatip } from '#hooks/PRIVATE_useDatatip';\n\nexport function useMeterDatatip(\n value: number,\n isPointerActiveRef: MutableRef<boolean>,\n datatip?: string | null,\n ariaDescribedBy?: string\n) {\n const datatipText = datatip === undefined ? `${value}` : datatip;\n const { datatipContent, datatipProps } = useDatatip({\n content: datatipText,\n anchor: isPointerActiveRef.current ? 'pointer' : 'element',\n offset: {\n mainAxis: 8,\n crossAxis: 0\n },\n placement: 'top',\n touchResponse: 'touchStart'\n });\n\n datatipProps['aria-describedby'] =\n [ariaDescribedBy, datatipProps['aria-describedby']].filter(Boolean).join(' ') || undefined;\n\n return { datatipContent, datatipProps };\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport type { RefObject } from 'preact';\nimport { MutableRef, useRef } from 'preact/hooks';\nimport { handleInput } from './events';\nimport { CommitDetail, InputDetail } from '#utils/UNSAFE_meterUtils';\n\ntype getValueFromEvent = (event: PointerEvent) => number | undefined;\n\nexport function usePointerEvents(\n value: number | undefined,\n getValue: getValueFromEvent,\n targetRef: RefObject<HTMLDivElement>,\n currentInputRef: MutableRef<number | undefined>,\n isPointerActiveRef: MutableRef<boolean | undefined>,\n onCommit?: (detail: CommitDetail) => void,\n onInput?: (detail: InputDetail) => void\n) {\n const isPointerDown = useRef<boolean>(false);\n\n const onPointerUp = (event: PointerEvent) => {\n isPointerDown.current = false;\n const val = getValue(event);\n if (val !== undefined) {\n onCommit?.({ value: val } as CommitDetail);\n }\n isPointerActiveRef.current = true;\n };\n\n const onPointerMove = (event: PointerEvent) => {\n if (isPointerDown.current) {\n const val = getValue(event);\n if (val !== undefined && val != currentInputRef.current) {\n handleInput(val, currentInputRef, onInput);\n }\n }\n isPointerActiveRef.current = true;\n };\n\n const onPointerDown = (event: PointerEvent) => {\n isPointerDown.current = true;\n targetRef.current?.setPointerCapture(event.pointerId);\n const val = getValue(event);\n if (val !== undefined && val != currentInputRef.current) {\n handleInput(val, currentInputRef, onInput);\n }\n isPointerActiveRef.current = true;\n };\n\n const onBlur = () => {\n isPointerDown.current = false;\n onCommit?.({ value: value } as CommitDetail);\n isPointerActiveRef.current = false;\n };\n\n const onPointerLeave = () => {\n isPointerActiveRef.current = false;\n };\n\n const onPointerEnter = () => {\n isPointerActiveRef.current = true;\n };\n\n return {\n onPointerUp,\n onBlur,\n onPointerMove,\n onPointerDown,\n onPointerLeave,\n onPointerEnter\n };\n}\n"],"names":["value","isPointerActiveRef","datatip","ariaDescribedBy","datatipText","undefined","datatipContent","datatipProps","useDatatip","content","anchor","current","offset","mainAxis","crossAxis","placement","touchResponse","filter","Boolean","join","getValue","targetRef","currentInputRef","onCommit","onInput","isPointerDown","useRef","onPointerUp","event","val","onBlur","onPointerMove","handleInput","onPointerDown","setPointerCapture","pointerId","onPointerLeave","onPointerEnter"],"mappings":"2IAUM,SACJA,EACAC,EACAC,EACAC,GAEA,MAAMC,OAA0BC,IAAZH,EAAwB,GAAGF,IAAUE,GACnDI,eAAEA,EAAcC,aAAEA,GAAiBC,aAAW,CAClDC,QAASL,EACTM,OAAQT,EAAmBU,QAAU,UAAY,UACjDC,OAAQ,CACNC,SAAU,EACVC,UAAW,GAEbC,UAAW,MACXC,cAAe,eAMjB,OAHAT,EAAa,oBACX,CAACJ,EAAiBI,EAAa,qBAAqBU,OAAOC,SAASC,KAAK,WAAQd,EAE5E,CAAEC,iBAAgBC,eAC3B,qBClBgB,SACdP,EACAoB,EACAC,EACAC,EACArB,EACAsB,EACAC,GAEA,MAAMC,EAAgBC,UAAgB,GA6CtC,MAAO,CACLC,YA5CmBC,IACnBH,EAAcd,SAAU,EACxB,MAAMkB,EAAMT,EAASQ,QACTvB,IAARwB,GACFN,IAAW,CAAEvB,MAAO6B,IAEtB5B,EAAmBU,SAAU,CAAI,EAuCjCmB,OAhBa,KACbL,EAAcd,SAAU,EACxBY,IAAW,CAAEvB,MAAOA,IACpBC,EAAmBU,SAAU,CAAK,EAclCoB,cArCqBH,IACrB,GAAIH,EAAcd,QAAS,CACzB,MAAMkB,EAAMT,EAASQ,QACTvB,IAARwB,GAAqBA,GAAOP,EAAgBX,SAC9CqB,EAAAA,YAAYH,EAAKP,EAAiBE,EAErC,CACDvB,EAAmBU,SAAU,CAAI,EA+BjCsB,cA5BqBL,IACrBH,EAAcd,SAAU,EACxBU,EAAUV,SAASuB,kBAAkBN,EAAMO,WAC3C,MAAMN,EAAMT,EAASQ,QACTvB,IAARwB,GAAqBA,GAAOP,EAAgBX,SAC9CqB,EAAAA,YAAYH,EAAKP,EAAiBE,GAEpCvB,EAAmBU,SAAU,CAAI,EAsBjCyB,eAbqB,KACrBnC,EAAmBU,SAAU,CAAK,EAalC0B,eAVqB,KACrBpC,EAAmBU,SAAU,CAAI,EAWrC"}
@@ -1,2 +1,2 @@
1
- define(['exports', 'preact/hooks', './useCurrentKey-05038cac', './useReorderableContext-a5453bd7', './useCollectionFocusRing-734be5a1', './useTabbableModeSet-45117f02', './collectionUtils-3951928f', './mergeProps-bcfa6a92', './keys-4755c121'], (function(e,r,t,n,o,c,u,s,i){"use strict";const l=(e,t)=>{const[o,c]=r.useState(),u=r.useRef(),s=r.useRef(!1),i=n.useReorderableContext(),l=r.useMemo((()=>e=>{const r=e.value;c({rowKey:r}),t?.(e),null!=i?.currentItemKey&&(i.currentItemKey.current=r)}),[t,i?.currentItemKey]);return u.current!==e&&(u.current=e,o?.rowKey!==e?.rowKey&&(s.current=!0,l({value:e?.rowKey}))),r.useEffect((()=>{s.current=!1})),{currentKey:o?.rowKey,onCurrentKeyChange:l,isCurrentItemOverridden:s.current}},a=(e,r,t)=>{if(e&&r&&(e.scrollIntoViewIfNeeded?e.scrollIntoViewIfNeeded():e.scrollIntoView({block:"nearest"}),t>0)){const n=r.getBoundingClientRect(),o=e.getBoundingClientRect(),c=n.top+t-o.top;c>0&&(r.scrollTop=r.scrollTop-c)}},d=(e,r,t,n)=>{if(r.current){const o=t?.scrollerRef.current,c=n?n(r.current):0;a(e,o||r.current,c)}},f=e=>!(!e.parentElement||!e.parentElement.classList.contains("oj-listview-expander"));e.LIST_ITEM_SELECTOR="[data-oj-list-item]",e.excludeGroup=(e,r)=>{if(!r.all){const t=e.data.filter((e=>!e.metadata.isLeaf)).map((e=>e.metadata.key)),n=Array.from(r.keys.values()).filter((e=>!t.includes(e)));return{...r,keys:new Set(n)}}return r},e.getViewportConfig=(e,r)=>r??{scrollerRef:e},e.isMultipleSelection=e=>"multiple"===e||"multipleToggle"===e,e.scrollToVisible=a,e.useCurrentItemOverride=l,e.useNavigation=(e,n,a,y,K,C,b,g,m,p,v,w,R,I)=>{const k=r.useRef(),E=r.useRef(!0),{currentKey:T,onCurrentKeyChange:x,isCurrentItemOverridden:S}=l(C,b),[A,h]=c.useTabbableModeSet(n,(e=>f(e)?null:u.keyExtractor(e,y)),T,x,void 0,void 0,I),{currentKeyProps:D}=t.useCurrentKey((e=>u.keyExtractor(e,y)),p,A(T),K.ArrowUp(T),K.ArrowDown(T),K.ArrowLeft?.(T),K.ArrowRight?.(T),T,x),[O,V]=o.useCollectionFocusRing(n,Object.keys(K)),F=r.useCallback((e=>{const r=u.keyExtractor(e.target,y);i.isKeyDefined(r)&&(k.current=r,r!==T&&(E.current=!1))}),[T]),L=r.useCallback((()=>{if(n.current&&(!v||A(void 0))){const e=k.current||u.getFirstVisibleKey(n.current,y);i.isKeyDefined(e)&&x({value:e})}}),[n,T,x,v,A]),M=r.useCallback((e=>{if(f(e.target))n.current?.focus({preventScroll:!0});else if(n.current)if(i.isKeyDefined(T)){const e=u.findElementByKey(n.current,T,y);e?(E.current&&d(e,n,g,m),E.current=!0):L()}else L()}),[n,T,L,g,m]);return r.useEffect((()=>{if(w&&n.current&&i.isKeyDefined(T)){const e=u.findElementByKey(n.current,T,y);if(e){const r=a(e),t=n.current.getAttribute("aria-activedescendant");if(""!==r&&t!==r){n.current.setAttribute("aria-activedescendant",r);const t=n.current?.contains(document.activeElement);(!S&&t||R)&&d(e,n,g,m)}}}}),[e,n,T,a,g,m,S,w,R]),{navigationProps:s.mergeProps(D,V,v?h:{},{onFocus:M,onPointerDown:F}),currentKey:T,onCurrentKeyChange:x,isCurrentItemOverridden:S,showFocusRing:O,isCurrentTabbableKey:A}}}));
1
+ define(['exports', 'preact/hooks', './useCurrentKey-5749e7fb', './useReorderableContext-a5453bd7', './useCollectionFocusRing-734be5a1', './useTabbableModeSet-45117f02', './collectionUtils-3951928f', './mergeProps-bcfa6a92', './keys-4755c121'], (function(e,r,t,n,o,c,u,s,i){"use strict";const l=(e,t)=>{const[o,c]=r.useState(),u=r.useRef(),s=r.useRef(!1),i=n.useReorderableContext(),l=r.useMemo((()=>e=>{const r=e.value;c({rowKey:r}),t?.(e),null!=i?.currentItemKey&&(i.currentItemKey.current=r)}),[t,i?.currentItemKey]);return u.current!==e&&(u.current=e,o?.rowKey!==e?.rowKey&&(s.current=!0,l({value:e?.rowKey}))),r.useEffect((()=>{s.current=!1})),{currentKey:o?.rowKey,onCurrentKeyChange:l,isCurrentItemOverridden:s.current}},a=(e,r,t)=>{if(e&&r&&(e.scrollIntoViewIfNeeded?e.scrollIntoViewIfNeeded():e.scrollIntoView({block:"nearest"}),t>0)){const n=r.getBoundingClientRect(),o=e.getBoundingClientRect(),c=n.top+t-o.top;c>0&&(r.scrollTop=r.scrollTop-c)}},f=(e,r,t,n)=>{if(r.current){const o=t?.scrollerRef.current,c=n?n(r.current):0;a(e,o||r.current,c)}},d=e=>!(!e.parentElement||!e.parentElement.classList.contains("oj-listview-expander"));e.LIST_ITEM_SELECTOR="[data-oj-list-item]",e.excludeGroup=(e,r)=>{if(!r.all){const t=e.data.filter((e=>!e.metadata.isLeaf)).map((e=>e.metadata.key)),n=Array.from(r.keys.values()).filter((e=>!t.includes(e)));return{...r,keys:new Set(n)}}return r},e.getViewportConfig=(e,r)=>r??{scrollerRef:e},e.isMultipleSelection=e=>"multiple"===e||"multipleToggle"===e,e.scrollToVisible=a,e.useCurrentItemOverride=l,e.useNavigation=(e,n,a,y,K,b,C,g,m,p,v,w,R,I)=>{const k=r.useRef(),E=r.useRef(!0),{currentKey:T,onCurrentKeyChange:x,isCurrentItemOverridden:S}=l(b,C),[A,h]=c.useTabbableModeSet(n,(e=>d(e)?null:u.keyExtractor(e,y)),T,x,void 0,void 0,I),{currentKeyProps:D}=t.useCurrentKey((e=>u.keyExtractor(e,y)),p,A(T),K.ArrowUp(T),K.ArrowDown(T),K.ArrowLeft?.(T),K.ArrowRight?.(T),T,x),[O,V]=o.useCollectionFocusRing(n,Object.keys(K)),F=r.useCallback((e=>{const r=u.keyExtractor(e.target,y);i.isKeyDefined(r)&&(k.current=r,r!==T&&(E.current=!1))}),[T]),L=r.useCallback((()=>{if(n.current&&(!v||A(void 0))){const e=k.current||u.getFirstVisibleKey(n.current,y);i.isKeyDefined(e)&&x({value:e})}}),[n,T,x,v,A]),M=r.useCallback((e=>{if(d(e.target))n.current?.focus({preventScroll:!0});else if(n.current)if(i.isKeyDefined(T)){const e=u.findElementByKey(n.current,T,y);e?(E.current&&f(e,n,g,m),E.current=!0):L()}else L()}),[n,T,L,g,m]);return r.useEffect((()=>{if(w&&n.current&&i.isKeyDefined(T)){const e=u.findElementByKey(n.current,T,y);if(e){const r=a(e),t=n.current.getAttribute("aria-activedescendant");if(""!==r&&t!==r){n.current.setAttribute("aria-activedescendant",r);const t=n.current?.contains(document.activeElement);(!S&&t||R)&&f(e,n,g,m)}}}}),[e,n,T,a,g,m,S,w,R]),{navigationProps:s.mergeProps(D,V,v?h:{},{onFocus:M,onPointerDown:F}),currentKey:T,onCurrentKeyChange:x,isCurrentItemOverridden:S,showFocusRing:O,isCurrentTabbableKey:A}}}));
2
2
  //# sourceMappingURL=useNavigation-8d7dae30.js.map
@@ -1,2 +1,2 @@
1
- define(['exports', 'preact/hooks', './arrayUtils-6ee96a35', './Layer-64bf71ad', './useModal-536cb7ff'], (function(e,t,r,n,o){"use strict";const s=e=>e?.ownerDocument??document;e.useOutsideClick=({isDisabled:e=!1,ref:u,handler:c})=>{const a=t.useRef(null);t.useEffect((()=>{const t=r.coerceArray(u);if(!c||e||t.length>0&&t.findIndex((e=>null===e.current))>-1)return;const i=e=>{a.current=e.target},l=e=>{a.current===e.target&&((e,t)=>{const r=e.target;if(!r)return!1;if(!s(r).contains(r))return!1;if(t.some((e=>e.current?.contains(r))))return!1;const u=e=>{let t=e.parentElement;for(;t;){if(t[n.LOGICAL_PARENT])return t[n.LOGICAL_PARENT];t=t.parentElement}return null};if(r[o.MODAL_OVERLAY])return!!t.some((e=>{const t=e.current?.closest('[data-oj-layer="modal"]');return t&&t.contains(r)}));let c=u(r);for(;c;){if(t.some((e=>e.current?.contains(c))))return!1;c=u(c)}const a=r.closest('[data-oj-layer="modal"]');return!(a&&!t.some((e=>a.contains(e.current)))||t.some((e=>((e,t)=>{const r=e?.closest("[data-oj-layer]");return!(!r||!r.contains(t))})(e.current,r))))})(e,t)&&c?.(e),a.current=null},d=t[0],f=s(d.current);return f?(f.addEventListener("mousedown",i,!0),f.addEventListener("mouseup",l,!0),()=>{f.removeEventListener("mousedown",i,!0),f.removeEventListener("mouseup",l,!0)}):void 0}),[e,c,u])}}));
2
- //# sourceMappingURL=useOutsideClick-ace4f686.js.map
1
+ define(['exports', 'preact/hooks', './arrayUtils-6ee96a35', './Layer-1971eddb', './useModal-536cb7ff'], (function(e,t,r,n,o){"use strict";const s=e=>e?.ownerDocument??document;e.useOutsideClick=({isDisabled:e=!1,ref:u,handler:c})=>{const a=t.useRef(null);t.useEffect((()=>{const t=r.coerceArray(u);if(!c||e||t.length>0&&t.findIndex((e=>null===e.current))>-1)return;const i=e=>{a.current=e.target},l=e=>{a.current===e.target&&((e,t)=>{const r=e.target;if(!r)return!1;if(!s(r).contains(r))return!1;if(t.some((e=>e.current?.contains(r))))return!1;const u=e=>{let t=e.parentElement;for(;t;){if(t[n.LOGICAL_PARENT])return t[n.LOGICAL_PARENT];t=t.parentElement}return null};if(r[o.MODAL_OVERLAY])return!!t.some((e=>{const t=e.current?.closest('[data-oj-layer="modal"]');return t&&t.contains(r)}));let c=u(r);for(;c;){if(t.some((e=>e.current?.contains(c))))return!1;c=u(c)}const a=r.closest('[data-oj-layer="modal"]');return!(a&&!t.some((e=>a.contains(e.current)))||t.some((e=>((e,t)=>{const r=e?.closest("[data-oj-layer]");return!(!r||!r.contains(t))})(e.current,r))))})(e,t)&&c?.(e),a.current=null},d=t[0],f=s(d.current);return f?(f.addEventListener("mousedown",i,!0),f.addEventListener("mouseup",l,!0),()=>{f.removeEventListener("mousedown",i,!0),f.removeEventListener("mouseup",l,!0)}):void 0}),[e,c,u])}}));
2
+ //# sourceMappingURL=useOutsideClick-b9b661a4.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useOutsideClick-ace4f686.js","sources":["../../src/hooks/UNSAFE_useOutsideClick/useOutsideClick.ts"],"sourcesContent":["/**\n * `useClickOutside` hook for capturing clicking outside of an element\n */\nimport type { RefObject } from 'preact';\nimport { useEffect, useRef } from 'preact/hooks';\nimport { coerceArray } from '../../utils/UNSAFE_arrayUtils';\nimport { LOGICAL_PARENT } from '../../UNSAFE_Layer/Layer';\nimport { MODAL_OVERLAY, BackdropElement } from '#UNSAFE_Modal/hooks/useModal';\n\ntype Props = {\n /**\n * If true outside click is disabled\n */\n isDisabled?: boolean;\n /**\n * Reference to element or array of elements relative to which outside click is performed\n */\n ref: RefObject<HTMLElement> | RefObject<HTMLElement>[];\n /**\n * Outside click callback\n */\n handler?: (event: MouseEvent) => void;\n};\n\n/**\n * Checks if the mouse event target is inside of any of the specified containers, or if it\n * occurs in a layer whose 'logicalParent' belongs to one of the containers.\n *\n * @param event a mouse event associated with the potential \"outside click\" action\n * @param ref an array of references to elements that are considered \"inside\"\n * @returns 'true' if the event occurs \"outside\" of the specified list of containers\n */\nconst isPointOutside = (event: Event, ref: RefObject<HTMLElement>[]) => {\n const target = event.target as HTMLElement;\n\n // if the event has no target, consider it \"inside\"\n if (!target) {\n return false;\n }\n\n const doc = getDocument(target);\n if (!doc.contains(target)) {\n return false;\n }\n\n // if the target is contained in any of the target containers, it is not \"outside\"\n if (ref.some((elRef: RefObject<HTMLElement>) => elRef.current?.contains(target))) {\n return false;\n }\n\n const findLogicalParent = (elem: Element): Element | null => {\n let elemParent = elem.parentElement as any;\n while (elemParent) {\n if (elemParent[LOGICAL_PARENT]) {\n return elemParent[LOGICAL_PARENT];\n }\n elemParent = elemParent.parentElement;\n }\n return null;\n };\n\n const parentLayerContainsTarget = (element: HTMLElement | null, target: Node): boolean => {\n const parentLayer = element?.closest('[data-oj-layer]');\n if (parentLayer && parentLayer.contains(target)) {\n return true;\n }\n return false;\n };\n\n // Handle backdrop clicks before consulting logical-parent ownership. A popup layer may be\n // logically parented to its launcher, but clicks on its own modal overlay must still count\n // as outside clicks for components that support auto-dismiss on the scrim.\n if ((target as BackdropElement)[MODAL_OVERLAY]) {\n if (\n !ref.some((elRef: RefObject<HTMLElement>) => {\n const modalParent = elRef.current?.closest('[data-oj-layer=\"modal\"]');\n return modalParent && modalParent.contains(target);\n })\n ) {\n return false;\n } else {\n return true;\n }\n }\n\n // Check if the target is logically owned by any of the refs\n let logicalParent = findLogicalParent(target);\n while (logicalParent) {\n if (ref.some((elRef: RefObject<HTMLElement>) => elRef.current?.contains(logicalParent))) {\n return false;\n }\n logicalParent = findLogicalParent(logicalParent);\n }\n\n // if the target is a child of a modal layer other than any of the refs,\n // the click occurs in another modal layer which must be above our elem\n const modalParent = target.closest('[data-oj-layer=\"modal\"]');\n if (\n modalParent &&\n !ref.some((elRef: RefObject<HTMLElement>) => modalParent.contains(elRef.current))\n ) {\n return false;\n }\n\n // lastly, look for target's parent based purely on the layer hierarchy\n if (\n ref.some((elRef: RefObject<HTMLElement>) => parentLayerContainsTarget(elRef.current, target))\n ) {\n return false;\n }\n\n return true;\n};\n\nconst getDocument = (node?: Node): Document => node?.ownerDocument ?? document;\n\nexport const useOutsideClick = ({ isDisabled: disabled = false, ref, handler }: Props) => {\n // use ref to store mutable data and not cause a re-render\n const mouseDownTargetRef = useRef<EventTarget | null>(null);\n\n useEffect(() => {\n const refs = coerceArray(ref);\n if (\n !handler ||\n disabled ||\n (refs.length > 0 && refs.findIndex((elRef) => elRef.current === null) > -1)\n )\n return;\n const onMouseDown = (event: MouseEvent) => {\n mouseDownTargetRef.current = event.target;\n };\n\n const onMouseUp = (event: MouseEvent) => {\n if (mouseDownTargetRef.current === event.target && isPointOutside(event, refs)) {\n handler?.(event);\n }\n mouseDownTargetRef.current = null;\n };\n const firstElRef = refs[0];\n const doc = getDocument(firstElRef.current!);\n if (doc) {\n doc.addEventListener('mousedown', onMouseDown, true);\n doc.addEventListener('mouseup', onMouseUp, true);\n\n return () => {\n doc.removeEventListener('mousedown', onMouseDown, true);\n doc.removeEventListener('mouseup', onMouseUp, true);\n };\n }\n return undefined;\n }, [disabled, handler, ref]);\n};\n"],"names":["getDocument","node","ownerDocument","document","isDisabled","disabled","ref","handler","mouseDownTargetRef","useRef","useEffect","refs","coerceArray","length","findIndex","elRef","current","onMouseDown","event","target","onMouseUp","contains","some","findLogicalParent","elem","elemParent","parentElement","LOGICAL_PARENT","MODAL_OVERLAY","modalParent","closest","logicalParent","element","parentLayer","parentLayerContainsTarget","isPointOutside","firstElRef","doc","addEventListener","removeEventListener"],"mappings":"qIAgCA,MAkFMA,EAAeC,GAA0BA,GAAMC,eAAiBC,2BAEvC,EAAGC,WAAYC,GAAW,EAAOC,MAAKC,cAEnE,MAAMC,EAAqBC,SAA2B,MAEtDC,EAAAA,WAAU,KACR,MAAMC,EAAOC,cAAYN,GACzB,IACGC,GACDF,GACCM,EAAKE,OAAS,GAAKF,EAAKG,WAAWC,GAA4B,OAAlBA,EAAMC,WAAqB,EAEzE,OACF,MAAMC,EAAeC,IACnBV,EAAmBQ,QAAUE,EAAMC,MAAM,EAGrCC,EAAaF,IACbV,EAAmBQ,UAAYE,EAAMC,QArGxB,EAACD,EAAcZ,KACpC,MAAMa,EAASD,EAAMC,OAGrB,IAAKA,EACH,OAAO,EAIT,IADYnB,EAAYmB,GACfE,SAASF,GAChB,OAAO,EAIT,GAAIb,EAAIgB,MAAMP,GAAkCA,EAAMC,SAASK,SAASF,KACtE,OAAO,EAGT,MAAMI,EAAqBC,IACzB,IAAIC,EAAaD,EAAKE,cACtB,KAAOD,GAAY,CACjB,GAAIA,EAAWE,EAAAA,gBACb,OAAOF,EAAWE,EAAAA,gBAEpBF,EAAaA,EAAWC,aACzB,CACD,OAAO,IAAI,EAcb,GAAKP,EAA2BS,EAAAA,eAC9B,QACGtB,EAAIgB,MAAMP,IACT,MAAMc,EAAcd,EAAMC,SAASc,QAAQ,2BAC3C,OAAOD,GAAeA,EAAYR,SAASF,EAAO,IAUxD,IAAIY,EAAgBR,EAAkBJ,GACtC,KAAOY,GAAe,CACpB,GAAIzB,EAAIgB,MAAMP,GAAkCA,EAAMC,SAASK,SAASU,KACtE,OAAO,EAETA,EAAgBR,EAAkBQ,EACnC,CAID,MAAMF,EAAcV,EAAOW,QAAQ,2BACnC,QACED,IACCvB,EAAIgB,MAAMP,GAAkCc,EAAYR,SAASN,EAAMC,YAOxEV,EAAIgB,MAAMP,GA7CsB,EAACiB,EAA6Bb,KAC9D,MAAMc,EAAcD,GAASF,QAAQ,mBACrC,SAAIG,IAAeA,EAAYZ,SAASF,GAG5B,EAwCgCe,CAA0BnB,EAAMC,QAASG,KAK5E,EAsB4CgB,CAAejB,EAAOP,IACvEJ,IAAUW,GAEZV,EAAmBQ,QAAU,IAAI,EAE7BoB,EAAazB,EAAK,GAClB0B,EAAMrC,EAAYoC,EAAWpB,SACnC,OAAIqB,GACFA,EAAIC,iBAAiB,YAAarB,GAAa,GAC/CoB,EAAIC,iBAAiB,UAAWlB,GAAW,GAEpC,KACLiB,EAAIE,oBAAoB,YAAatB,GAAa,GAClDoB,EAAIE,oBAAoB,UAAWnB,GAAW,EAAK,QANvD,CASgB,GACf,CAACf,EAAUE,EAASD,GAAK"}
1
+ {"version":3,"file":"useOutsideClick-b9b661a4.js","sources":["../../src/hooks/UNSAFE_useOutsideClick/useOutsideClick.ts"],"sourcesContent":["/**\n * `useClickOutside` hook for capturing clicking outside of an element\n */\nimport type { RefObject } from 'preact';\nimport { useEffect, useRef } from 'preact/hooks';\nimport { coerceArray } from '../../utils/UNSAFE_arrayUtils';\nimport { LOGICAL_PARENT } from '../../UNSAFE_Layer/Layer';\nimport { MODAL_OVERLAY, BackdropElement } from '#UNSAFE_Modal/hooks/useModal';\n\ntype Props = {\n /**\n * If true outside click is disabled\n */\n isDisabled?: boolean;\n /**\n * Reference to element or array of elements relative to which outside click is performed\n */\n ref: RefObject<HTMLElement> | RefObject<HTMLElement>[];\n /**\n * Outside click callback\n */\n handler?: (event: MouseEvent) => void;\n};\n\n/**\n * Checks if the mouse event target is inside of any of the specified containers, or if it\n * occurs in a layer whose 'logicalParent' belongs to one of the containers.\n *\n * @param event a mouse event associated with the potential \"outside click\" action\n * @param ref an array of references to elements that are considered \"inside\"\n * @returns 'true' if the event occurs \"outside\" of the specified list of containers\n */\nconst isPointOutside = (event: Event, ref: RefObject<HTMLElement>[]) => {\n const target = event.target as HTMLElement;\n\n // if the event has no target, consider it \"inside\"\n if (!target) {\n return false;\n }\n\n const doc = getDocument(target);\n if (!doc.contains(target)) {\n return false;\n }\n\n // if the target is contained in any of the target containers, it is not \"outside\"\n if (ref.some((elRef: RefObject<HTMLElement>) => elRef.current?.contains(target))) {\n return false;\n }\n\n const findLogicalParent = (elem: Element): Element | null => {\n let elemParent = elem.parentElement as any;\n while (elemParent) {\n if (elemParent[LOGICAL_PARENT]) {\n return elemParent[LOGICAL_PARENT];\n }\n elemParent = elemParent.parentElement;\n }\n return null;\n };\n\n const parentLayerContainsTarget = (element: HTMLElement | null, target: Node): boolean => {\n const parentLayer = element?.closest('[data-oj-layer]');\n if (parentLayer && parentLayer.contains(target)) {\n return true;\n }\n return false;\n };\n\n // Handle backdrop clicks before consulting logical-parent ownership. A popup layer may be\n // logically parented to its launcher, but clicks on its own modal overlay must still count\n // as outside clicks for components that support auto-dismiss on the scrim.\n if ((target as BackdropElement)[MODAL_OVERLAY]) {\n if (\n !ref.some((elRef: RefObject<HTMLElement>) => {\n const modalParent = elRef.current?.closest('[data-oj-layer=\"modal\"]');\n return modalParent && modalParent.contains(target);\n })\n ) {\n return false;\n } else {\n return true;\n }\n }\n\n // Check if the target is logically owned by any of the refs\n let logicalParent = findLogicalParent(target);\n while (logicalParent) {\n if (ref.some((elRef: RefObject<HTMLElement>) => elRef.current?.contains(logicalParent))) {\n return false;\n }\n logicalParent = findLogicalParent(logicalParent);\n }\n\n // if the target is a child of a modal layer other than any of the refs,\n // the click occurs in another modal layer which must be above our elem\n const modalParent = target.closest('[data-oj-layer=\"modal\"]');\n if (\n modalParent &&\n !ref.some((elRef: RefObject<HTMLElement>) => modalParent.contains(elRef.current))\n ) {\n return false;\n }\n\n // lastly, look for target's parent based purely on the layer hierarchy\n if (\n ref.some((elRef: RefObject<HTMLElement>) => parentLayerContainsTarget(elRef.current, target))\n ) {\n return false;\n }\n\n return true;\n};\n\nconst getDocument = (node?: Node): Document => node?.ownerDocument ?? document;\n\nexport const useOutsideClick = ({ isDisabled: disabled = false, ref, handler }: Props) => {\n // use ref to store mutable data and not cause a re-render\n const mouseDownTargetRef = useRef<EventTarget | null>(null);\n\n useEffect(() => {\n const refs = coerceArray(ref);\n if (\n !handler ||\n disabled ||\n (refs.length > 0 && refs.findIndex((elRef) => elRef.current === null) > -1)\n )\n return;\n const onMouseDown = (event: MouseEvent) => {\n mouseDownTargetRef.current = event.target;\n };\n\n const onMouseUp = (event: MouseEvent) => {\n if (mouseDownTargetRef.current === event.target && isPointOutside(event, refs)) {\n handler?.(event);\n }\n mouseDownTargetRef.current = null;\n };\n const firstElRef = refs[0];\n const doc = getDocument(firstElRef.current!);\n if (doc) {\n doc.addEventListener('mousedown', onMouseDown, true);\n doc.addEventListener('mouseup', onMouseUp, true);\n\n return () => {\n doc.removeEventListener('mousedown', onMouseDown, true);\n doc.removeEventListener('mouseup', onMouseUp, true);\n };\n }\n return undefined;\n }, [disabled, handler, ref]);\n};\n"],"names":["getDocument","node","ownerDocument","document","isDisabled","disabled","ref","handler","mouseDownTargetRef","useRef","useEffect","refs","coerceArray","length","findIndex","elRef","current","onMouseDown","event","target","onMouseUp","contains","some","findLogicalParent","elem","elemParent","parentElement","LOGICAL_PARENT","MODAL_OVERLAY","modalParent","closest","logicalParent","element","parentLayer","parentLayerContainsTarget","isPointOutside","firstElRef","doc","addEventListener","removeEventListener"],"mappings":"qIAgCA,MAkFMA,EAAeC,GAA0BA,GAAMC,eAAiBC,2BAEvC,EAAGC,WAAYC,GAAW,EAAOC,MAAKC,cAEnE,MAAMC,EAAqBC,SAA2B,MAEtDC,EAAAA,WAAU,KACR,MAAMC,EAAOC,cAAYN,GACzB,IACGC,GACDF,GACCM,EAAKE,OAAS,GAAKF,EAAKG,WAAWC,GAA4B,OAAlBA,EAAMC,WAAqB,EAEzE,OACF,MAAMC,EAAeC,IACnBV,EAAmBQ,QAAUE,EAAMC,MAAM,EAGrCC,EAAaF,IACbV,EAAmBQ,UAAYE,EAAMC,QArGxB,EAACD,EAAcZ,KACpC,MAAMa,EAASD,EAAMC,OAGrB,IAAKA,EACH,OAAO,EAIT,IADYnB,EAAYmB,GACfE,SAASF,GAChB,OAAO,EAIT,GAAIb,EAAIgB,MAAMP,GAAkCA,EAAMC,SAASK,SAASF,KACtE,OAAO,EAGT,MAAMI,EAAqBC,IACzB,IAAIC,EAAaD,EAAKE,cACtB,KAAOD,GAAY,CACjB,GAAIA,EAAWE,EAAAA,gBACb,OAAOF,EAAWE,EAAAA,gBAEpBF,EAAaA,EAAWC,aACzB,CACD,OAAO,IAAI,EAcb,GAAKP,EAA2BS,EAAAA,eAC9B,QACGtB,EAAIgB,MAAMP,IACT,MAAMc,EAAcd,EAAMC,SAASc,QAAQ,2BAC3C,OAAOD,GAAeA,EAAYR,SAASF,EAAO,IAUxD,IAAIY,EAAgBR,EAAkBJ,GACtC,KAAOY,GAAe,CACpB,GAAIzB,EAAIgB,MAAMP,GAAkCA,EAAMC,SAASK,SAASU,KACtE,OAAO,EAETA,EAAgBR,EAAkBQ,EACnC,CAID,MAAMF,EAAcV,EAAOW,QAAQ,2BACnC,QACED,IACCvB,EAAIgB,MAAMP,GAAkCc,EAAYR,SAASN,EAAMC,YAOxEV,EAAIgB,MAAMP,GA7CsB,EAACiB,EAA6Bb,KAC9D,MAAMc,EAAcD,GAASF,QAAQ,mBACrC,SAAIG,IAAeA,EAAYZ,SAASF,GAG5B,EAwCgCe,CAA0BnB,EAAMC,QAASG,KAK5E,EAsB4CgB,CAAejB,EAAOP,IACvEJ,IAAUW,GAEZV,EAAmBQ,QAAU,IAAI,EAE7BoB,EAAazB,EAAK,GAClB0B,EAAMrC,EAAYoC,EAAWpB,SACnC,OAAIqB,GACFA,EAAIC,iBAAiB,YAAarB,GAAa,GAC/CoB,EAAIC,iBAAiB,UAAWlB,GAAW,GAEpC,KACLiB,EAAIE,oBAAoB,YAAatB,GAAa,GAClDoB,EAAIE,oBAAoB,UAAWnB,GAAW,EAAK,QANvD,CASgB,GACf,CAACf,EAAUE,EAASD,GAAK"}
@@ -1,2 +1,2 @@
1
- define(['exports', 'preact/hooks', './arrayUtils-6ee96a35', './popupUtils-71ea5dd1'], (function(e,n,r,t){"use strict";const o=e=>e?.ownerDocument??document;e.useOutsideMousedown=({isDisabled:e=!1,ref:s,handler:c})=>{n.useEffect((()=>{const n=r.coerceArray(s);if(!c||e||n.length>0&&n.findIndex((e=>null===e.current))>-1)return;const u=e=>{((e,n)=>{const r=e.target;if(r&&!o(r).contains(r))return!1;return n.every((e=>!e.current?.contains(r)&&!t.isLogicalAncestor(e.current,r)))})(e,n)&&c?.(e)},i=n[0],d=o(i.current);return d?(d.addEventListener("mousedown",u,!0),()=>{d.removeEventListener("mousedown",u,!0)}):void 0}),[e,c,s])}}));
2
- //# sourceMappingURL=useOutsideMousedown-62fa309c.js.map
1
+ define(['exports', 'preact/hooks', './arrayUtils-6ee96a35', './popupUtils-d42db8bf'], (function(e,n,r,t){"use strict";const o=e=>e?.ownerDocument??document;e.useOutsideMousedown=({isDisabled:e=!1,ref:s,handler:c})=>{n.useEffect((()=>{const n=r.coerceArray(s);if(!c||e||n.length>0&&n.findIndex((e=>null===e.current))>-1)return;const u=e=>{((e,n)=>{const r=e.target;if(r&&!o(r).contains(r))return!1;return n.every((e=>!e.current?.contains(r)&&!t.isLogicalAncestor(e.current,r)))})(e,n)&&c?.(e)},i=n[0],d=o(i.current);return d?(d.addEventListener("mousedown",u,!0),()=>{d.removeEventListener("mousedown",u,!0)}):void 0}),[e,c,s])}}));
2
+ //# sourceMappingURL=useOutsideMousedown-cb88da60.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useOutsideMousedown-62fa309c.js","sources":["../../src/hooks/PRIVATE_useOutsideMousedown/useOutsideMousedown.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\n/**\n * `useOutsideMousedown` hook for capturing mousedown outside of an element\n */\nimport type { RefObject } from 'preact';\nimport { useEffect } from 'preact/hooks';\nimport { coerceArray } from '../../utils/UNSAFE_arrayUtils';\nimport { isLogicalAncestor } from '#utils/UNSAFE_popupUtils';\n\ntype Props = {\n /**\n * If true outside mousedown is disabled\n */\n isDisabled?: boolean;\n /**\n * Reference to element or array of elements relative to which outside mousedown is performed\n */\n ref: RefObject<HTMLElement> | RefObject<HTMLElement>[];\n /**\n * Outside mousedown callback\n */\n handler?: (event: MouseEvent) => void;\n};\n\nconst isPointOutside = (event: Event, ref: RefObject<HTMLElement>[]) => {\n const target = event.target as HTMLElement;\n if (target) {\n const doc = getDocument(target);\n if (!doc.contains(target)) return false;\n }\n return ref.every(\n (elRef) =>\n !elRef.current?.contains(target) && !isLogicalAncestor(elRef.current as HTMLElement, target)\n );\n};\n\nconst getDocument = (node?: Node): Document => node?.ownerDocument ?? document;\n\nexport const useOutsideMousedown = ({ isDisabled: disabled = false, ref, handler }: Props) => {\n useEffect(() => {\n const refs = coerceArray(ref);\n if (\n !handler ||\n disabled ||\n (refs.length > 0 && refs.findIndex((elRef) => elRef.current === null) > -1)\n )\n return;\n\n const onMouseDown = (event: MouseEvent) => {\n if (isPointOutside(event, refs)) {\n handler?.(event);\n }\n };\n const firstElRef = refs[0];\n const doc = getDocument(firstElRef.current!);\n if (doc) {\n doc.addEventListener('mousedown', onMouseDown, true);\n\n return () => {\n doc.removeEventListener('mousedown', onMouseDown, true);\n };\n }\n return undefined;\n }, [disabled, handler, ref]);\n};\n"],"names":["getDocument","node","ownerDocument","document","isDisabled","disabled","ref","handler","useEffect","refs","coerceArray","length","findIndex","elRef","current","onMouseDown","event","target","contains","every","isLogicalAncestor","isPointOutside","firstElRef","doc","addEventListener","removeEventListener"],"mappings":"kHA+BA,MAYMA,EAAeC,GAA0BA,GAAMC,eAAiBC,+BAEnC,EAAGC,WAAYC,GAAW,EAAOC,MAAKC,cACvEC,EAAAA,WAAU,KACR,MAAMC,EAAOC,cAAYJ,GACzB,IACGC,GACDF,GACCI,EAAKE,OAAS,GAAKF,EAAKG,WAAWC,GAA4B,OAAlBA,EAAMC,WAAqB,EAEzE,OAEF,MAAMC,EAAeC,IAxBF,EAACA,EAAcV,KACpC,MAAMW,EAASD,EAAMC,OACrB,GAAIA,IACUjB,EAAYiB,GACfC,SAASD,GAAS,OAAO,EAEpC,OAAOX,EAAIa,OACRN,IACEA,EAAMC,SAASI,SAASD,KAAYG,EAAAA,kBAAkBP,EAAMC,QAAwBG,IACxF,EAgBOI,CAAeL,EAAOP,IACxBF,IAAUS,EACX,EAEGM,EAAab,EAAK,GAClBc,EAAMvB,EAAYsB,EAAWR,SACnC,OAAIS,GACFA,EAAIC,iBAAiB,YAAaT,GAAa,GAExC,KACLQ,EAAIE,oBAAoB,YAAaV,GAAa,EAAK,QAJ3D,CAOgB,GACf,CAACV,EAAUE,EAASD,GAAK"}
1
+ {"version":3,"file":"useOutsideMousedown-cb88da60.js","sources":["../../src/hooks/PRIVATE_useOutsideMousedown/useOutsideMousedown.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\n/**\n * `useOutsideMousedown` hook for capturing mousedown outside of an element\n */\nimport type { RefObject } from 'preact';\nimport { useEffect } from 'preact/hooks';\nimport { coerceArray } from '../../utils/UNSAFE_arrayUtils';\nimport { isLogicalAncestor } from '#utils/UNSAFE_popupUtils';\n\ntype Props = {\n /**\n * If true outside mousedown is disabled\n */\n isDisabled?: boolean;\n /**\n * Reference to element or array of elements relative to which outside mousedown is performed\n */\n ref: RefObject<HTMLElement> | RefObject<HTMLElement>[];\n /**\n * Outside mousedown callback\n */\n handler?: (event: MouseEvent) => void;\n};\n\nconst isPointOutside = (event: Event, ref: RefObject<HTMLElement>[]) => {\n const target = event.target as HTMLElement;\n if (target) {\n const doc = getDocument(target);\n if (!doc.contains(target)) return false;\n }\n return ref.every(\n (elRef) =>\n !elRef.current?.contains(target) && !isLogicalAncestor(elRef.current as HTMLElement, target)\n );\n};\n\nconst getDocument = (node?: Node): Document => node?.ownerDocument ?? document;\n\nexport const useOutsideMousedown = ({ isDisabled: disabled = false, ref, handler }: Props) => {\n useEffect(() => {\n const refs = coerceArray(ref);\n if (\n !handler ||\n disabled ||\n (refs.length > 0 && refs.findIndex((elRef) => elRef.current === null) > -1)\n )\n return;\n\n const onMouseDown = (event: MouseEvent) => {\n if (isPointOutside(event, refs)) {\n handler?.(event);\n }\n };\n const firstElRef = refs[0];\n const doc = getDocument(firstElRef.current!);\n if (doc) {\n doc.addEventListener('mousedown', onMouseDown, true);\n\n return () => {\n doc.removeEventListener('mousedown', onMouseDown, true);\n };\n }\n return undefined;\n }, [disabled, handler, ref]);\n};\n"],"names":["getDocument","node","ownerDocument","document","isDisabled","disabled","ref","handler","useEffect","refs","coerceArray","length","findIndex","elRef","current","onMouseDown","event","target","contains","every","isLogicalAncestor","isPointOutside","firstElRef","doc","addEventListener","removeEventListener"],"mappings":"kHA+BA,MAYMA,EAAeC,GAA0BA,GAAMC,eAAiBC,+BAEnC,EAAGC,WAAYC,GAAW,EAAOC,MAAKC,cACvEC,EAAAA,WAAU,KACR,MAAMC,EAAOC,cAAYJ,GACzB,IACGC,GACDF,GACCI,EAAKE,OAAS,GAAKF,EAAKG,WAAWC,GAA4B,OAAlBA,EAAMC,WAAqB,EAEzE,OAEF,MAAMC,EAAeC,IAxBF,EAACA,EAAcV,KACpC,MAAMW,EAASD,EAAMC,OACrB,GAAIA,IACUjB,EAAYiB,GACfC,SAASD,GAAS,OAAO,EAEpC,OAAOX,EAAIa,OACRN,IACEA,EAAMC,SAASI,SAASD,KAAYG,EAAAA,kBAAkBP,EAAMC,QAAwBG,IACxF,EAgBOI,CAAeL,EAAOP,IACxBF,IAAUS,EACX,EAEGM,EAAab,EAAK,GAClBc,EAAMvB,EAAYsB,EAAWR,SACnC,OAAIS,GACFA,EAAIC,iBAAiB,YAAaT,GAAa,GAExC,KACLQ,EAAIE,oBAAoB,YAAaV,GAAa,EAAK,QAJ3D,CAOgB,GACf,CAACV,EAAUE,EAASD,GAAK"}
@@ -0,0 +1,2 @@
1
+ define(['exports', './useAnimationStatus-0cae3dff', './useUser-08901aba', 'preact/hooks', './popupAnimationUtils-49b93365'], (function(n,t,e,i,a){"use strict";const o={opening:n=>({from:{scaleX:0,scaleY:0,opacity:0,transformOrigin:a.getTransformOrigin(n.placement,n.direction)},to:{scaleX:1,scaleY:1,opacity:1,transformOrigin:a.getTransformOrigin(n.placement,n.direction)},options:{duration:200}}),closing:n=>({from:{scaleX:1,scaleY:1,opacity:1,transformOrigin:a.getTransformOrigin(n.placement,n.direction)},to:{scaleX:0,scaleY:0,opacity:0,transformOrigin:a.getTransformOrigin(n.placement,n.direction)},options:{duration:200}})};n.usePopupAnimation=function(n){const{isOpen:a,isAnimatedOnMount:r,onTransitionEnd:s,placement:c,animationStates:m,onPosition:u}=n,[l,p]=i.useState(c),{direction:f}=e.useUser(),{setAnimationElementRef:d,animationElementRef:g,status:O}=t.useAnimationStatus({isOpen:a,isAnimatedOnMount:r,animationStates:m??o,onTransitionEnd:s}),A=g,E=i.useCallback((n=>{null!==A.current&&(A.current.placement=n.placement),l!==n.placement&&p(n.placement),u?.(n)}),[u,A,l]);return i.useEffect((()=>{null!=A&&null!=A.current&&"unmounted"!=O&&(A.current.placement!==l&&(A.current.placement=l),A.current.direction=f)}),[A,l,f,O]),{setAnimationElementRef:d,status:O,onPosition:E}}}));
2
+ //# sourceMappingURL=usePopupAnimation-dc282b02.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePopupAnimation-389749fc.js","sources":["../../src/UNSAFE_Popup/usePopupAnimation.ts"],"sourcesContent":["import { Placement, Floating } from '../UNSAFE_Floating';\nimport {\n useAnimationStatus,\n AnimationStatus,\n AnimationStatusProps,\n AnimationStates\n} from '../hooks/PRIVATE_useAnimationStatus';\nimport { useUser } from '../hooks/UNSAFE_useUser';\nimport { useEffect, useCallback, useState } from 'preact/hooks';\nimport { getTransformOrigin } from '../utils/PRIVATE_popupAnimationUtils';\nimport { ComponentProps } from 'preact';\n\n/**\n * The placement and direction aware HTML element\n * The useAnimation hook do not allow to change dynamically the animation states,\n * but allows a function that returns animation states config. The function takes\n * the animated node of type <E extends HTMLElement> as an argument. This could be used\n * to extend HTMLElement with placement and direction.\n */\nexport type AnimationPopupElement = HTMLElement & {\n placement?: Placement;\n direction?: 'ltr' | 'rtl';\n};\n\ntype PopupAnimationProps = Omit<AnimationStatusProps, 'animationStates'> & {\n /**\n * Specifies placement of the Popup relative to the anchor.\n */\n placement: Placement;\n\n /**\n * animationStates is the configuration of the animations, how the element should be animated\n */\n animationStates?: AnimationStates;\n\n /**\n * Triggered when placement or coordinates are changed after collision is detected\n */\n onPosition?: ComponentProps<typeof Floating>['onPosition'];\n};\n\nconst animationStates = {\n opening: (node: AnimationPopupElement) => {\n return {\n //zoomIn\n from: {\n scaleX: 0,\n scaleY: 0,\n opacity: 0,\n transformOrigin: getTransformOrigin(node.placement, node.direction)\n },\n to: {\n scaleX: 1,\n scaleY: 1,\n opacity: 1,\n transformOrigin: getTransformOrigin(node.placement, node.direction)\n },\n options: {\n duration: 200\n }\n };\n },\n closing: (node: AnimationPopupElement) => {\n return {\n //zoomOut\n from: {\n scaleX: 1,\n scaleY: 1,\n opacity: 1,\n transformOrigin: getTransformOrigin(node.placement, node.direction)\n },\n to: {\n scaleX: 0,\n scaleY: 0,\n opacity: 0,\n transformOrigin: getTransformOrigin(node.placement, node.direction)\n },\n options: {\n duration: 200\n }\n };\n }\n};\n\nexport function usePopupAnimation(props: PopupAnimationProps): {\n status: AnimationStatus;\n setAnimationElementRef: (node: HTMLElement | null) => void;\n onPosition: ComponentProps<typeof Floating>['onPosition'];\n} {\n const {\n isOpen,\n isAnimatedOnMount,\n onTransitionEnd,\n placement,\n animationStates: propsAnimationStates,\n onPosition\n } = props;\n\n //The animationPlacement is used for the case of flipping.\n const [animationPlacement, setAnimationPlacement] = useState<Placement>(placement);\n const { direction } = useUser();\n const { setAnimationElementRef, animationElementRef, status } =\n useAnimationStatus<AnimationPopupElement>({\n isOpen: isOpen,\n isAnimatedOnMount: isAnimatedOnMount,\n animationStates: propsAnimationStates ?? animationStates,\n onTransitionEnd\n });\n const popupElementRef = animationElementRef;\n\n const onPositionAnimated = useCallback<Required<ComponentProps<typeof Floating>>['onPosition']>(\n (data) => {\n if (popupElementRef.current !== null) {\n // if flips happens we need to change the placement in the animations.\n // There are cases where animation is done before even running the useEffect below. Due to that we update current placement of the node here\n popupElementRef.current.placement = data.placement;\n }\n if (animationPlacement !== data.placement) {\n setAnimationPlacement(data.placement);\n }\n onPosition?.(data);\n },\n [onPosition, popupElementRef, animationPlacement]\n );\n\n //This is needed for the case if popup flips and changes the placement.\n useEffect(() => {\n if (popupElementRef != null && popupElementRef.current != null && status != 'unmounted') {\n if (popupElementRef.current.placement !== animationPlacement) {\n popupElementRef.current.placement = animationPlacement;\n }\n popupElementRef.current.direction = direction;\n }\n }, [popupElementRef, animationPlacement, direction, status]);\n return { setAnimationElementRef, status, onPosition: onPositionAnimated };\n}\n"],"names":["animationStates","opening","node","from","scaleX","scaleY","opacity","transformOrigin","getTransformOrigin","placement","direction","to","options","duration","closing","props","isOpen","isAnimatedOnMount","onTransitionEnd","propsAnimationStates","onPosition","animationPlacement","setAnimationPlacement","useState","useUser","setAnimationElementRef","animationElementRef","status","useAnimationStatus","popupElementRef","onPositionAnimated","useCallback","data","current","useEffect"],"mappings":"0JAyCA,MAAMA,EAAkB,CACtBC,QAAUC,IACD,CAELC,KAAM,CACJC,OAAQ,EACRC,OAAQ,EACRC,QAAS,EACTC,gBAAiBC,EAAAA,mBAAmBN,EAAKO,UAAWP,EAAKQ,YAE3DC,GAAI,CACFP,OAAQ,EACRC,OAAQ,EACRC,QAAS,EACTC,gBAAiBC,EAAAA,mBAAmBN,EAAKO,UAAWP,EAAKQ,YAE3DE,QAAS,CACPC,SAAU,OAIhBC,QAAUZ,IACD,CAELC,KAAM,CACJC,OAAQ,EACRC,OAAQ,EACRC,QAAS,EACTC,gBAAiBC,EAAAA,mBAAmBN,EAAKO,UAAWP,EAAKQ,YAE3DC,GAAI,CACFP,OAAQ,EACRC,OAAQ,EACRC,QAAS,EACTC,gBAAiBC,EAAAA,mBAAmBN,EAAKO,UAAWP,EAAKQ,YAE3DE,QAAS,CACPC,SAAU,4BAMZ,SAA4BE,GAKhC,MAAMC,OACJA,EAAMC,kBACNA,EAAiBC,gBACjBA,EAAeT,UACfA,EACAT,gBAAiBmB,EAAoBC,WACrCA,GACEL,GAGGM,EAAoBC,GAAyBC,EAAQA,SAAYd,IAClEC,UAAEA,GAAcc,EAAAA,WAChBC,uBAAEA,EAAsBC,oBAAEA,EAAmBC,OAAEA,GACnDC,EAAAA,mBAA0C,CACxCZ,OAAQA,EACRC,kBAAmBA,EACnBjB,gBAAiBmB,GAAwBnB,EACzCkB,oBAEEW,EAAkBH,EAElBI,EAAqBC,eACxBC,IACiC,OAA5BH,EAAgBI,UAGlBJ,EAAgBI,QAAQxB,UAAYuB,EAAKvB,WAEvCY,IAAuBW,EAAKvB,WAC9Ba,EAAsBU,EAAKvB,WAE7BW,IAAaY,EAAK,GAEpB,CAACZ,EAAYS,EAAiBR,IAYhC,OARAa,EAAAA,WAAU,KACe,MAAnBL,GAAsD,MAA3BA,EAAgBI,SAA6B,aAAVN,IAC5DE,EAAgBI,QAAQxB,YAAcY,IACxCQ,EAAgBI,QAAQxB,UAAYY,GAEtCQ,EAAgBI,QAAQvB,UAAYA,EACrC,GACA,CAACmB,EAAiBR,EAAoBX,EAAWiB,IAC7C,CAAEF,yBAAwBE,SAAQP,WAAYU,EACvD"}
1
+ {"version":3,"file":"usePopupAnimation-dc282b02.js","sources":["../../src/UNSAFE_Popup/usePopupAnimation.ts"],"sourcesContent":["import { Placement, Floating } from '../UNSAFE_Floating';\nimport {\n useAnimationStatus,\n AnimationStatus,\n AnimationStatusProps,\n AnimationStates\n} from '../hooks/PRIVATE_useAnimationStatus';\nimport { useUser } from '../hooks/UNSAFE_useUser';\nimport { useEffect, useCallback, useState } from 'preact/hooks';\nimport { getTransformOrigin } from '../utils/PRIVATE_popupAnimationUtils';\nimport { ComponentProps } from 'preact';\n\n/**\n * The placement and direction aware HTML element\n * The useAnimation hook do not allow to change dynamically the animation states,\n * but allows a function that returns animation states config. The function takes\n * the animated node of type <E extends HTMLElement> as an argument. This could be used\n * to extend HTMLElement with placement and direction.\n */\nexport type AnimationPopupElement = HTMLElement & {\n placement?: Placement;\n direction?: 'ltr' | 'rtl';\n};\n\ntype PopupAnimationProps = Omit<AnimationStatusProps, 'animationStates'> & {\n /**\n * Specifies placement of the Popup relative to the anchor.\n */\n placement: Placement;\n\n /**\n * animationStates is the configuration of the animations, how the element should be animated\n */\n animationStates?: AnimationStates;\n\n /**\n * Triggered when placement or coordinates are changed after collision is detected\n */\n onPosition?: ComponentProps<typeof Floating>['onPosition'];\n};\n\nconst animationStates = {\n opening: (node: AnimationPopupElement) => {\n return {\n //zoomIn\n from: {\n scaleX: 0,\n scaleY: 0,\n opacity: 0,\n transformOrigin: getTransformOrigin(node.placement, node.direction)\n },\n to: {\n scaleX: 1,\n scaleY: 1,\n opacity: 1,\n transformOrigin: getTransformOrigin(node.placement, node.direction)\n },\n options: {\n duration: 200\n }\n };\n },\n closing: (node: AnimationPopupElement) => {\n return {\n //zoomOut\n from: {\n scaleX: 1,\n scaleY: 1,\n opacity: 1,\n transformOrigin: getTransformOrigin(node.placement, node.direction)\n },\n to: {\n scaleX: 0,\n scaleY: 0,\n opacity: 0,\n transformOrigin: getTransformOrigin(node.placement, node.direction)\n },\n options: {\n duration: 200\n }\n };\n }\n};\n\nexport function usePopupAnimation(props: PopupAnimationProps): {\n status: AnimationStatus;\n setAnimationElementRef: (node: HTMLElement | null) => void;\n onPosition: ComponentProps<typeof Floating>['onPosition'];\n} {\n const {\n isOpen,\n isAnimatedOnMount,\n onTransitionEnd,\n placement,\n animationStates: propsAnimationStates,\n onPosition\n } = props;\n\n //The animationPlacement is used for the case of flipping.\n const [animationPlacement, setAnimationPlacement] = useState<Placement>(placement);\n const { direction } = useUser();\n const { setAnimationElementRef, animationElementRef, status } =\n useAnimationStatus<AnimationPopupElement>({\n isOpen: isOpen,\n isAnimatedOnMount: isAnimatedOnMount,\n animationStates: propsAnimationStates ?? animationStates,\n onTransitionEnd\n });\n const popupElementRef = animationElementRef;\n\n const onPositionAnimated = useCallback<Required<ComponentProps<typeof Floating>>['onPosition']>(\n (data) => {\n if (popupElementRef.current !== null) {\n // if flips happens we need to change the placement in the animations.\n // There are cases where animation is done before even running the useEffect below. Due to that we update current placement of the node here\n popupElementRef.current.placement = data.placement;\n }\n if (animationPlacement !== data.placement) {\n setAnimationPlacement(data.placement);\n }\n onPosition?.(data);\n },\n [onPosition, popupElementRef, animationPlacement]\n );\n\n //This is needed for the case if popup flips and changes the placement.\n useEffect(() => {\n if (popupElementRef != null && popupElementRef.current != null && status != 'unmounted') {\n if (popupElementRef.current.placement !== animationPlacement) {\n popupElementRef.current.placement = animationPlacement;\n }\n popupElementRef.current.direction = direction;\n }\n }, [popupElementRef, animationPlacement, direction, status]);\n return { setAnimationElementRef, status, onPosition: onPositionAnimated };\n}\n"],"names":["animationStates","opening","node","from","scaleX","scaleY","opacity","transformOrigin","getTransformOrigin","placement","direction","to","options","duration","closing","props","isOpen","isAnimatedOnMount","onTransitionEnd","propsAnimationStates","onPosition","animationPlacement","setAnimationPlacement","useState","useUser","setAnimationElementRef","animationElementRef","status","useAnimationStatus","popupElementRef","onPositionAnimated","useCallback","data","current","useEffect"],"mappings":"0JAyCA,MAAMA,EAAkB,CACtBC,QAAUC,IACD,CAELC,KAAM,CACJC,OAAQ,EACRC,OAAQ,EACRC,QAAS,EACTC,gBAAiBC,EAAAA,mBAAmBN,EAAKO,UAAWP,EAAKQ,YAE3DC,GAAI,CACFP,OAAQ,EACRC,OAAQ,EACRC,QAAS,EACTC,gBAAiBC,EAAAA,mBAAmBN,EAAKO,UAAWP,EAAKQ,YAE3DE,QAAS,CACPC,SAAU,OAIhBC,QAAUZ,IACD,CAELC,KAAM,CACJC,OAAQ,EACRC,OAAQ,EACRC,QAAS,EACTC,gBAAiBC,EAAAA,mBAAmBN,EAAKO,UAAWP,EAAKQ,YAE3DC,GAAI,CACFP,OAAQ,EACRC,OAAQ,EACRC,QAAS,EACTC,gBAAiBC,EAAAA,mBAAmBN,EAAKO,UAAWP,EAAKQ,YAE3DE,QAAS,CACPC,SAAU,4BAMZ,SAA4BE,GAKhC,MAAMC,OACJA,EAAMC,kBACNA,EAAiBC,gBACjBA,EAAeT,UACfA,EACAT,gBAAiBmB,EAAoBC,WACrCA,GACEL,GAGGM,EAAoBC,GAAyBC,EAAQA,SAAYd,IAClEC,UAAEA,GAAcc,EAAAA,WAChBC,uBAAEA,EAAsBC,oBAAEA,EAAmBC,OAAEA,GACnDC,EAAAA,mBAA0C,CACxCZ,OAAQA,EACRC,kBAAmBA,EACnBjB,gBAAiBmB,GAAwBnB,EACzCkB,oBAEEW,EAAkBH,EAElBI,EAAqBC,eACxBC,IACiC,OAA5BH,EAAgBI,UAGlBJ,EAAgBI,QAAQxB,UAAYuB,EAAKvB,WAEvCY,IAAuBW,EAAKvB,WAC9Ba,EAAsBU,EAAKvB,WAE7BW,IAAaY,EAAK,GAEpB,CAACZ,EAAYS,EAAiBR,IAYhC,OARAa,EAAAA,WAAU,KACe,MAAnBL,GAAsD,MAA3BA,EAAgBI,SAA6B,aAAVN,IAC5DE,EAAgBI,QAAQxB,YAAcY,IACxCQ,EAAgBI,QAAQxB,UAAYY,GAEtCQ,EAAgBI,QAAQvB,UAAYA,EACrC,GACA,CAACmB,EAAiBR,EAAoBX,EAAWiB,IAC7C,CAAEF,yBAAwBE,SAAQP,WAAYU,EACvD"}
@@ -0,0 +1,2 @@
1
+ define(['exports', './stringUtils-4ffd9d59', './useUser-08901aba'], (function(e,i,s){"use strict";e.usePrefixSuffix=({baseId:e,hasEndContent:t,hasInsideLabel:d,hasStartContent:a,hasValue:n,isDisabled:r,isFocused:f,labelId:o,prefix:u,suffix:l,value:x})=>{const{direction:$}=s.useUser(),v=`${e}-prefix`,b=`${e}-suffix`,h=void 0!==u&&""!==u,c=void 0!==l&&""!==l,p=h&&!r&&(n||f),I=c&&!r&&(n||f),P=h||c?function(e,i,s,t,d){if(!i)return d;const a="ltr"===e,n=void 0===s?"":a?`${s} `:` ${s}`,r=void 0===t?"":a?` ${t}`:`${t} `,f=`${n}${d}${r}`,o=`${r}${d}${n}`;return a?f:o}($,n,u,l,x):x;return{shouldRenderPrefix:p,shouldRenderSuffix:I,prefixProps:{id:v,hasEndContent:t,hasInsideLabel:d,hasStartContent:a,isDisabled:r,isFocused:f,text:u??"",variant:"prefix"},suffixProps:{id:b,hasInsideLabel:d,isDisabled:r,isFocused:f,text:l??"",variant:"suffix"},valuePrefixSuffix:P,ariaLabelledBy:h||c?i.l([o,h?v:void 0,c?b:void 0]):void 0}}}));
2
+ //# sourceMappingURL=usePrefixSuffix-dd2cae55.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePrefixSuffix-7371ec52.js","sources":["../../src/hooks/UNSAFE_usePrefixSuffix/usePrefixSuffix.tsx"],"sourcesContent":["import { merge } from '@oracle/oraclejet-internal-utilities/stringUtils';\nimport { useUser } from '../UNSAFE_useUser';\n\ntype Props = {\n baseId: string;\n hasEndContent?: boolean;\n hasInsideLabel?: boolean;\n hasStartContent?: boolean;\n hasValue?: boolean;\n isDisabled?: boolean;\n isFocused?: boolean;\n labelId?: string;\n prefix?: string;\n suffix?: string;\n value?: string;\n};\n\ntype PrefixSuffixVariant = 'prefix' | 'suffix';\n\n// returns the prefix and/or suffix components\n// if the condition in which they should be shown is met.\nexport const usePrefixSuffix = ({\n baseId,\n hasEndContent,\n hasInsideLabel,\n hasStartContent,\n hasValue,\n isDisabled,\n isFocused,\n labelId,\n prefix,\n suffix,\n value\n}: Props) => {\n const { direction } = useUser();\n // for accessibility, if you have a prefix, then you must have a prefixId\n const prefixId = `${baseId}-prefix`;\n const suffixId = `${baseId}-suffix`;\n const hasPrefixText = prefix !== undefined && prefix !== '';\n const hasSuffixText = suffix !== undefined && suffix !== '';\n const shouldRenderPrefix = hasPrefixText && !isDisabled && (hasValue || isFocused);\n const shouldRenderSuffix = hasSuffixText && !isDisabled && (hasValue || isFocused);\n\n // get value and prefix/suffix if available and return as plain text.\n const valuePrefixSuffix =\n hasPrefixText || hasSuffixText ? getText(direction, hasValue, prefix, suffix, value) : value;\n // get aria-labelledby if there is a prefix or suffix text\n const ariaLabelledBy =\n hasPrefixText || hasSuffixText\n ? merge([labelId, hasPrefixText ? prefixId : undefined, hasSuffixText ? suffixId : undefined])\n : undefined;\n const prefixProps = {\n id: prefixId,\n hasEndContent,\n hasInsideLabel,\n hasStartContent,\n isDisabled,\n isFocused,\n text: prefix ?? '',\n variant: 'prefix' as PrefixSuffixVariant\n };\n const suffixProps = {\n id: suffixId,\n hasInsideLabel,\n isDisabled,\n isFocused,\n text: suffix ?? '',\n variant: 'suffix' as PrefixSuffixVariant\n };\n\n return {\n shouldRenderPrefix,\n shouldRenderSuffix,\n prefixProps,\n suffixProps,\n valuePrefixSuffix,\n ariaLabelledBy\n };\n};\n\n/**\n * Returns the value to render in plain text, taking into account the prefix and suffix\n * and reading direction. Do not add a prefix/suffix if the component doesn't have a value.\n * @returns string | undefined\n */\nfunction getText(\n direction: 'ltr' | 'rtl',\n hasValue?: boolean,\n prefix?: string,\n suffix?: string,\n value?: string\n) {\n // Do not add a prefix/suffix if the component doesn't have a value.\n if (!hasValue) {\n return value;\n }\n // TODO: direction is 'ltr' even though the storybook is rtl.\n // Test this when the storybook bug is fixed. ?src=confmacro\n const isLTR = direction === 'ltr';\n const plainPrefix = prefix === undefined ? `` : isLTR ? `${prefix} ` : ` ${prefix}`;\n const plainSuffix = suffix === undefined ? `` : isLTR ? ` ${suffix}` : `${suffix} `;\n\n const ltrPlainText = `${plainPrefix}${value}${plainSuffix}`;\n const rtlPlainText = `${plainSuffix}${value}${plainPrefix}`;\n return isLTR ? ltrPlainText : rtlPlainText;\n}\n"],"names":["baseId","hasEndContent","hasInsideLabel","hasStartContent","hasValue","isDisabled","isFocused","labelId","prefix","suffix","value","direction","useUser","prefixId","suffixId","hasPrefixText","undefined","hasSuffixText","shouldRenderPrefix","shouldRenderSuffix","valuePrefixSuffix","isLTR","plainPrefix","plainSuffix","ltrPlainText","rtlPlainText","getText","prefixProps","id","text","variant","suffixProps","ariaLabelledBy","merge"],"mappings":"iHAqB+B,EAC7BA,SACAC,gBACAC,iBACAC,kBACAC,WACAC,aACAC,YACAC,UACAC,SACAC,SACAC,YAEA,MAAMC,UAAEA,GAAcC,EAAAA,UAEhBC,EAAW,GAAGb,WACdc,EAAW,GAAGd,WACde,OAA2BC,IAAXR,GAAmC,KAAXA,EACxCS,OAA2BD,IAAXP,GAAmC,KAAXA,EACxCS,EAAqBH,IAAkBV,IAAeD,GAAYE,GAClEa,EAAqBF,IAAkBZ,IAAeD,GAAYE,GAGlEc,EACJL,GAAiBE,EAwCrB,SACEN,EACAP,EACAI,EACAC,EACAC,GAGA,IAAKN,EACH,OAAOM,EAIT,MAAMW,EAAsB,QAAdV,EACRW,OAAyBN,IAAXR,EAAuB,GAAKa,EAAQ,GAAGb,KAAY,IAAIA,IACrEe,OAAyBP,IAAXP,EAAuB,GAAKY,EAAQ,IAAIZ,IAAW,GAAGA,KAEpEe,EAAe,GAAGF,IAAcZ,IAAQa,IACxCE,EAAe,GAAGF,IAAcb,IAAQY,IAC9C,OAAOD,EAAQG,EAAeC,CAChC,CA5DqCC,CAAQf,EAAWP,EAAUI,EAAQC,EAAQC,GAASA,EAyBzF,MAAO,CACLQ,qBACAC,qBACAQ,YAtBkB,CAClBC,GAAIf,EACJZ,gBACAC,iBACAC,kBACAE,aACAC,YACAuB,KAAMrB,GAAU,GAChBsB,QAAS,UAeTC,YAbkB,CAClBH,GAAId,EACJZ,iBACAG,aACAC,YACAuB,KAAMpB,GAAU,GAChBqB,QAAS,UAQTV,oBACAY,eA5BAjB,GAAiBE,EACbgB,IAAM,CAAC1B,EAASQ,EAAgBF,OAAWG,EAAWC,EAAgBH,OAAWE,SACjFA,EA2BL"}
1
+ {"version":3,"file":"usePrefixSuffix-dd2cae55.js","sources":["../../src/hooks/UNSAFE_usePrefixSuffix/usePrefixSuffix.tsx"],"sourcesContent":["import { merge } from '@oracle/oraclejet-internal-utilities/stringUtils';\nimport { useUser } from '../UNSAFE_useUser';\n\ntype Props = {\n baseId: string;\n hasEndContent?: boolean;\n hasInsideLabel?: boolean;\n hasStartContent?: boolean;\n hasValue?: boolean;\n isDisabled?: boolean;\n isFocused?: boolean;\n labelId?: string;\n prefix?: string;\n suffix?: string;\n value?: string;\n};\n\ntype PrefixSuffixVariant = 'prefix' | 'suffix';\n\n// returns the prefix and/or suffix components\n// if the condition in which they should be shown is met.\nexport const usePrefixSuffix = ({\n baseId,\n hasEndContent,\n hasInsideLabel,\n hasStartContent,\n hasValue,\n isDisabled,\n isFocused,\n labelId,\n prefix,\n suffix,\n value\n}: Props) => {\n const { direction } = useUser();\n // for accessibility, if you have a prefix, then you must have a prefixId\n const prefixId = `${baseId}-prefix`;\n const suffixId = `${baseId}-suffix`;\n const hasPrefixText = prefix !== undefined && prefix !== '';\n const hasSuffixText = suffix !== undefined && suffix !== '';\n const shouldRenderPrefix = hasPrefixText && !isDisabled && (hasValue || isFocused);\n const shouldRenderSuffix = hasSuffixText && !isDisabled && (hasValue || isFocused);\n\n // get value and prefix/suffix if available and return as plain text.\n const valuePrefixSuffix =\n hasPrefixText || hasSuffixText ? getText(direction, hasValue, prefix, suffix, value) : value;\n // get aria-labelledby if there is a prefix or suffix text\n const ariaLabelledBy =\n hasPrefixText || hasSuffixText\n ? merge([labelId, hasPrefixText ? prefixId : undefined, hasSuffixText ? suffixId : undefined])\n : undefined;\n const prefixProps = {\n id: prefixId,\n hasEndContent,\n hasInsideLabel,\n hasStartContent,\n isDisabled,\n isFocused,\n text: prefix ?? '',\n variant: 'prefix' as PrefixSuffixVariant\n };\n const suffixProps = {\n id: suffixId,\n hasInsideLabel,\n isDisabled,\n isFocused,\n text: suffix ?? '',\n variant: 'suffix' as PrefixSuffixVariant\n };\n\n return {\n shouldRenderPrefix,\n shouldRenderSuffix,\n prefixProps,\n suffixProps,\n valuePrefixSuffix,\n ariaLabelledBy\n };\n};\n\n/**\n * Returns the value to render in plain text, taking into account the prefix and suffix\n * and reading direction. Do not add a prefix/suffix if the component doesn't have a value.\n * @returns string | undefined\n */\nfunction getText(\n direction: 'ltr' | 'rtl',\n hasValue?: boolean,\n prefix?: string,\n suffix?: string,\n value?: string\n) {\n // Do not add a prefix/suffix if the component doesn't have a value.\n if (!hasValue) {\n return value;\n }\n // TODO: direction is 'ltr' even though the storybook is rtl.\n // Test this when the storybook bug is fixed. ?src=confmacro\n const isLTR = direction === 'ltr';\n const plainPrefix = prefix === undefined ? `` : isLTR ? `${prefix} ` : ` ${prefix}`;\n const plainSuffix = suffix === undefined ? `` : isLTR ? ` ${suffix}` : `${suffix} `;\n\n const ltrPlainText = `${plainPrefix}${value}${plainSuffix}`;\n const rtlPlainText = `${plainSuffix}${value}${plainPrefix}`;\n return isLTR ? ltrPlainText : rtlPlainText;\n}\n"],"names":["baseId","hasEndContent","hasInsideLabel","hasStartContent","hasValue","isDisabled","isFocused","labelId","prefix","suffix","value","direction","useUser","prefixId","suffixId","hasPrefixText","undefined","hasSuffixText","shouldRenderPrefix","shouldRenderSuffix","valuePrefixSuffix","isLTR","plainPrefix","plainSuffix","ltrPlainText","rtlPlainText","getText","prefixProps","id","text","variant","suffixProps","ariaLabelledBy","merge"],"mappings":"iHAqB+B,EAC7BA,SACAC,gBACAC,iBACAC,kBACAC,WACAC,aACAC,YACAC,UACAC,SACAC,SACAC,YAEA,MAAMC,UAAEA,GAAcC,EAAAA,UAEhBC,EAAW,GAAGb,WACdc,EAAW,GAAGd,WACde,OAA2BC,IAAXR,GAAmC,KAAXA,EACxCS,OAA2BD,IAAXP,GAAmC,KAAXA,EACxCS,EAAqBH,IAAkBV,IAAeD,GAAYE,GAClEa,EAAqBF,IAAkBZ,IAAeD,GAAYE,GAGlEc,EACJL,GAAiBE,EAwCrB,SACEN,EACAP,EACAI,EACAC,EACAC,GAGA,IAAKN,EACH,OAAOM,EAIT,MAAMW,EAAsB,QAAdV,EACRW,OAAyBN,IAAXR,EAAuB,GAAKa,EAAQ,GAAGb,KAAY,IAAIA,IACrEe,OAAyBP,IAAXP,EAAuB,GAAKY,EAAQ,IAAIZ,IAAW,GAAGA,KAEpEe,EAAe,GAAGF,IAAcZ,IAAQa,IACxCE,EAAe,GAAGF,IAAcb,IAAQY,IAC9C,OAAOD,EAAQG,EAAeC,CAChC,CA5DqCC,CAAQf,EAAWP,EAAUI,EAAQC,EAAQC,GAASA,EAyBzF,MAAO,CACLQ,qBACAC,qBACAQ,YAtBkB,CAClBC,GAAIf,EACJZ,gBACAC,iBACAC,kBACAE,aACAC,YACAuB,KAAMrB,GAAU,GAChBsB,QAAS,UAeTC,YAbkB,CAClBH,GAAId,EACJZ,iBACAG,aACAC,YACAuB,KAAMpB,GAAU,GAChBqB,QAAS,UAQTV,oBACAY,eA5BAjB,GAAiBE,EACbgB,IAAM,CAAC1B,EAASQ,EAAgBF,OAAWG,EAAWC,EAAgBH,OAAWE,SACjFA,EA2BL"}
@@ -0,0 +1,2 @@
1
+ define(['exports', 'preact/hooks', './useUser-08901aba', './clientHints-6d361eaa'], (function(e,r,t,n){"use strict";e.useRadioFocusManager=(e,c)=>{const u=r.useRef([]),s=r.useRef(0),o="rtl"===t.useUser().direction,a="safari"===n.getClientHints().browser,l=r.useCallback((()=>{const e=u.current;if(!e.length)return;const r=s.current,t=a?Math.min(r+1,e.length-1):(r+1)%e.length;s.current=t,e[t]?.focus()}),[a]),f=r.useCallback((()=>{const e=u.current;if(!e.length)return;const r=s.current,t=a?Math.max(r-1,0):(r-1+e.length)%e.length;s.current=t,e[t]?.focus()}),[a]),i=r.useCallback((e=>{s.current=e}),[]),h=r.useCallback((()=>{const e=u.current;e.length&&e[s.current].focus()}),[]),g=r.useCallback((e=>{const{key:r}=e,t={ArrowDown:l,ArrowUp:f,ArrowRight:o&&!a?f:l,ArrowLeft:o&&!a?l:f}[r];t&&(e.preventDefault(),t())}),[l,f,o,a]),d=r.useCallback((()=>{if(!e.current)return;const r=e.current.querySelectorAll("[data-checked]");u.current=Array.from(r),s.current>=u.current.length&&i(u.current.length-1)}),[e,i]);return r.useEffect((()=>{const r=e?.current;r&&d()}),[d,c,e]),{focusNext:l,focusPrevious:f,resetFocus:h,setFocusIndex:i,focusIndex:s.current,handleArrowKeyPress:g}}}));
2
+ //# sourceMappingURL=useRadioFocusManager-462e28eb.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRadioFocusManager-c613d2fc.js","sources":["../../src/hooks/PRIVATE_useRadioFocusManager/useRadioFocusManager.ts"],"sourcesContent":["import type { ComponentChildren, RefObject } from 'preact';\nimport { useCallback, useEffect, useRef } from 'preact/hooks';\nimport { useUser } from '#hooks/UNSAFE_useUser';\nimport { getClientHints } from '#utils/PRIVATE_clientHints';\n\n/**\n * A hook to manage focus for readonly radio elements within a container. In Safari,\n * the manager will not wrap focus from first and last element when navigating with arrow keys,\n * while other browsers will. While in Safari and RTL mode, it will also match the behavior of\n * useCollectionFocusRing by not reversing the left/right arrow key behavior.\n *\n * Manager will automatically reset whenever containerRef or children change. However, it will\n * retain the current focus index if it does not exceed the number of focusable elements.\n * In that case, it will reset to the last element.\n *\n * @param containerRef - A ref to the container element that holds the radio elements.\n * @param children - The children within the container.\n * @returns An object with methods to manage focus among the radio elements.\n */\nconst useRadioFocusManager = (\n containerRef: RefObject<HTMLDivElement | null>,\n children: ComponentChildren\n) => {\n // array of focusable elements\n const focusableElementsRef = useRef<HTMLElement[]>([]);\n\n // current index\n const focusIndexRef = useRef(0);\n\n // determine if the direction is RTL for arrow key handling\n const isRtl = useUser().direction === 'rtl';\n const isSafari = getClientHints().browser === 'safari';\n\n // move focus to the next radio element\n const focusNext = useCallback(() => {\n const elements = focusableElementsRef.current;\n if (!elements.length) return;\n\n const curr = focusIndexRef.current;\n // clamp on Safari to match arrow key behavior in useCollectionFocusRing, wrap elsewhere\n const nextIndex = isSafari\n ? Math.min(curr + 1, elements.length - 1)\n : (curr + 1) % elements.length;\n\n focusIndexRef.current = nextIndex;\n elements[nextIndex]?.focus();\n }, [isSafari]);\n\n // move focus to the previous radio element\n const focusPrevious = useCallback(() => {\n const elements = focusableElementsRef.current;\n if (!elements.length) return;\n\n const curr = focusIndexRef.current;\n // clamp on Safari to match arrow key behavior in useCollectionFocusRing, wrap elsewhere\n const prevIndex = isSafari\n ? Math.max(curr - 1, 0)\n : (curr - 1 + elements.length) % elements.length;\n\n focusIndexRef.current = prevIndex;\n elements[prevIndex]?.focus();\n }, [isSafari]);\n\n // explicitly set the focus index\n const setFocusIndex = useCallback((index: number) => {\n focusIndexRef.current = index;\n }, []);\n\n // reset focus to the element indicated by the current index, mainly for testing purposes\n const resetFocus = useCallback(() => {\n const elements = focusableElementsRef.current;\n if (!elements.length) return;\n elements[focusIndexRef.current].focus();\n }, []);\n\n // handle ArrowUp/Down/Left/Right key presses to navigate radios\n const handleArrowKeyPress = useCallback(\n (event: KeyboardEvent) => {\n const { key } = event;\n\n const handler: Record<string, (() => void) | undefined> = {\n ArrowDown: focusNext,\n ArrowUp: focusPrevious,\n ArrowRight: isRtl && !isSafari ? focusPrevious : focusNext,\n ArrowLeft: isRtl && !isSafari ? focusNext : focusPrevious\n };\n\n const action = handler[key];\n if (action) {\n event.preventDefault();\n action();\n }\n },\n [focusNext, focusPrevious, isRtl, isSafari]\n );\n\n const resetManager = useCallback(() => {\n if (!containerRef.current) return;\n const elements = containerRef.current.querySelectorAll(\n '[data-checked]'\n ) as NodeListOf<HTMLElement>;\n focusableElementsRef.current = Array.from(elements);\n\n // reset index to last item if previous index is greater than the new items\n if (focusIndexRef.current >= focusableElementsRef.current.length) {\n setFocusIndex(focusableElementsRef.current.length - 1);\n }\n }, [containerRef, setFocusIndex]);\n\n // reset the manager whenever children change\n useEffect(() => {\n const container = containerRef?.current;\n if (!container) return;\n resetManager();\n }, [resetManager, children, containerRef]);\n\n return {\n focusNext,\n focusPrevious,\n resetFocus,\n setFocusIndex,\n focusIndex: focusIndexRef.current,\n handleArrowKeyPress\n };\n};\n\nexport { useRadioFocusManager };\n"],"names":["containerRef","children","focusableElementsRef","useRef","focusIndexRef","isRtl","useUser","direction","isSafari","getClientHints","browser","focusNext","useCallback","elements","current","length","curr","nextIndex","Math","min","focus","focusPrevious","prevIndex","max","setFocusIndex","index","resetFocus","handleArrowKeyPress","event","key","action","ArrowDown","ArrowUp","ArrowRight","ArrowLeft","preventDefault","resetManager","querySelectorAll","Array","from","useEffect","container","focusIndex"],"mappings":"uIAmB6B,CAC3BA,EACAC,KAGA,MAAMC,EAAuBC,SAAsB,IAG7CC,EAAgBD,SAAO,GAGvBE,EAAgC,QAAxBC,EAAAA,UAAUC,UAClBC,EAAwC,WAA7BC,EAAAA,iBAAiBC,QAG5BC,EAAYC,EAAAA,aAAY,KAC5B,MAAMC,EAAWX,EAAqBY,QACtC,IAAKD,EAASE,OAAQ,OAEtB,MAAMC,EAAOZ,EAAcU,QAErBG,EAAYT,EACdU,KAAKC,IAAIH,EAAO,EAAGH,EAASE,OAAS,IACpCC,EAAO,GAAKH,EAASE,OAE1BX,EAAcU,QAAUG,EACxBJ,EAASI,IAAYG,OAAO,GAC3B,CAACZ,IAGEa,EAAgBT,EAAAA,aAAY,KAChC,MAAMC,EAAWX,EAAqBY,QACtC,IAAKD,EAASE,OAAQ,OAEtB,MAAMC,EAAOZ,EAAcU,QAErBQ,EAAYd,EACdU,KAAKK,IAAIP,EAAO,EAAG,IAClBA,EAAO,EAAIH,EAASE,QAAUF,EAASE,OAE5CX,EAAcU,QAAUQ,EACxBT,EAASS,IAAYF,OAAO,GAC3B,CAACZ,IAGEgB,EAAgBZ,eAAaa,IACjCrB,EAAcU,QAAUW,CAAK,GAC5B,IAGGC,EAAad,EAAAA,aAAY,KAC7B,MAAMC,EAAWX,EAAqBY,QACjCD,EAASE,QACdF,EAAST,EAAcU,SAASM,OAAO,GACtC,IAGGO,EAAsBf,eACzBgB,IACC,MAAMC,IAAEA,GAAQD,EASVE,EAPoD,CACxDC,UAAWpB,EACXqB,QAASX,EACTY,WAAY5B,IAAUG,EAAWa,EAAgBV,EACjDuB,UAAW7B,IAAUG,EAAWG,EAAYU,GAGvBQ,GACnBC,IACFF,EAAMO,iBACNL,IACD,GAEH,CAACnB,EAAWU,EAAehB,EAAOG,IAG9B4B,EAAexB,EAAAA,aAAY,KAC/B,IAAKZ,EAAac,QAAS,OAC3B,MAAMD,EAAWb,EAAac,QAAQuB,iBACpC,kBAEFnC,EAAqBY,QAAUwB,MAAMC,KAAK1B,GAGtCT,EAAcU,SAAWZ,EAAqBY,QAAQC,QACxDS,EAActB,EAAqBY,QAAQC,OAAS,EACrD,GACA,CAACf,EAAcwB,IASlB,OANAgB,EAAAA,WAAU,KACR,MAAMC,EAAYzC,GAAcc,QAC3B2B,GACLL,GAAc,GACb,CAACA,EAAcnC,EAAUD,IAErB,CACLW,YACAU,gBACAK,aACAF,gBACAkB,WAAYtC,EAAcU,QAC1Ba,sBACD"}
1
+ {"version":3,"file":"useRadioFocusManager-462e28eb.js","sources":["../../src/hooks/PRIVATE_useRadioFocusManager/useRadioFocusManager.ts"],"sourcesContent":["import type { ComponentChildren, RefObject } from 'preact';\nimport { useCallback, useEffect, useRef } from 'preact/hooks';\nimport { useUser } from '#hooks/UNSAFE_useUser';\nimport { getClientHints } from '#utils/PRIVATE_clientHints';\n\n/**\n * A hook to manage focus for readonly radio elements within a container. In Safari,\n * the manager will not wrap focus from first and last element when navigating with arrow keys,\n * while other browsers will. While in Safari and RTL mode, it will also match the behavior of\n * useCollectionFocusRing by not reversing the left/right arrow key behavior.\n *\n * Manager will automatically reset whenever containerRef or children change. However, it will\n * retain the current focus index if it does not exceed the number of focusable elements.\n * In that case, it will reset to the last element.\n *\n * @param containerRef - A ref to the container element that holds the radio elements.\n * @param children - The children within the container.\n * @returns An object with methods to manage focus among the radio elements.\n */\nconst useRadioFocusManager = (\n containerRef: RefObject<HTMLDivElement | null>,\n children: ComponentChildren\n) => {\n // array of focusable elements\n const focusableElementsRef = useRef<HTMLElement[]>([]);\n\n // current index\n const focusIndexRef = useRef(0);\n\n // determine if the direction is RTL for arrow key handling\n const isRtl = useUser().direction === 'rtl';\n const isSafari = getClientHints().browser === 'safari';\n\n // move focus to the next radio element\n const focusNext = useCallback(() => {\n const elements = focusableElementsRef.current;\n if (!elements.length) return;\n\n const curr = focusIndexRef.current;\n // clamp on Safari to match arrow key behavior in useCollectionFocusRing, wrap elsewhere\n const nextIndex = isSafari\n ? Math.min(curr + 1, elements.length - 1)\n : (curr + 1) % elements.length;\n\n focusIndexRef.current = nextIndex;\n elements[nextIndex]?.focus();\n }, [isSafari]);\n\n // move focus to the previous radio element\n const focusPrevious = useCallback(() => {\n const elements = focusableElementsRef.current;\n if (!elements.length) return;\n\n const curr = focusIndexRef.current;\n // clamp on Safari to match arrow key behavior in useCollectionFocusRing, wrap elsewhere\n const prevIndex = isSafari\n ? Math.max(curr - 1, 0)\n : (curr - 1 + elements.length) % elements.length;\n\n focusIndexRef.current = prevIndex;\n elements[prevIndex]?.focus();\n }, [isSafari]);\n\n // explicitly set the focus index\n const setFocusIndex = useCallback((index: number) => {\n focusIndexRef.current = index;\n }, []);\n\n // reset focus to the element indicated by the current index, mainly for testing purposes\n const resetFocus = useCallback(() => {\n const elements = focusableElementsRef.current;\n if (!elements.length) return;\n elements[focusIndexRef.current].focus();\n }, []);\n\n // handle ArrowUp/Down/Left/Right key presses to navigate radios\n const handleArrowKeyPress = useCallback(\n (event: KeyboardEvent) => {\n const { key } = event;\n\n const handler: Record<string, (() => void) | undefined> = {\n ArrowDown: focusNext,\n ArrowUp: focusPrevious,\n ArrowRight: isRtl && !isSafari ? focusPrevious : focusNext,\n ArrowLeft: isRtl && !isSafari ? focusNext : focusPrevious\n };\n\n const action = handler[key];\n if (action) {\n event.preventDefault();\n action();\n }\n },\n [focusNext, focusPrevious, isRtl, isSafari]\n );\n\n const resetManager = useCallback(() => {\n if (!containerRef.current) return;\n const elements = containerRef.current.querySelectorAll(\n '[data-checked]'\n ) as NodeListOf<HTMLElement>;\n focusableElementsRef.current = Array.from(elements);\n\n // reset index to last item if previous index is greater than the new items\n if (focusIndexRef.current >= focusableElementsRef.current.length) {\n setFocusIndex(focusableElementsRef.current.length - 1);\n }\n }, [containerRef, setFocusIndex]);\n\n // reset the manager whenever children change\n useEffect(() => {\n const container = containerRef?.current;\n if (!container) return;\n resetManager();\n }, [resetManager, children, containerRef]);\n\n return {\n focusNext,\n focusPrevious,\n resetFocus,\n setFocusIndex,\n focusIndex: focusIndexRef.current,\n handleArrowKeyPress\n };\n};\n\nexport { useRadioFocusManager };\n"],"names":["containerRef","children","focusableElementsRef","useRef","focusIndexRef","isRtl","useUser","direction","isSafari","getClientHints","browser","focusNext","useCallback","elements","current","length","curr","nextIndex","Math","min","focus","focusPrevious","prevIndex","max","setFocusIndex","index","resetFocus","handleArrowKeyPress","event","key","action","ArrowDown","ArrowUp","ArrowRight","ArrowLeft","preventDefault","resetManager","querySelectorAll","Array","from","useEffect","container","focusIndex"],"mappings":"uIAmB6B,CAC3BA,EACAC,KAGA,MAAMC,EAAuBC,SAAsB,IAG7CC,EAAgBD,SAAO,GAGvBE,EAAgC,QAAxBC,EAAAA,UAAUC,UAClBC,EAAwC,WAA7BC,EAAAA,iBAAiBC,QAG5BC,EAAYC,EAAAA,aAAY,KAC5B,MAAMC,EAAWX,EAAqBY,QACtC,IAAKD,EAASE,OAAQ,OAEtB,MAAMC,EAAOZ,EAAcU,QAErBG,EAAYT,EACdU,KAAKC,IAAIH,EAAO,EAAGH,EAASE,OAAS,IACpCC,EAAO,GAAKH,EAASE,OAE1BX,EAAcU,QAAUG,EACxBJ,EAASI,IAAYG,OAAO,GAC3B,CAACZ,IAGEa,EAAgBT,EAAAA,aAAY,KAChC,MAAMC,EAAWX,EAAqBY,QACtC,IAAKD,EAASE,OAAQ,OAEtB,MAAMC,EAAOZ,EAAcU,QAErBQ,EAAYd,EACdU,KAAKK,IAAIP,EAAO,EAAG,IAClBA,EAAO,EAAIH,EAASE,QAAUF,EAASE,OAE5CX,EAAcU,QAAUQ,EACxBT,EAASS,IAAYF,OAAO,GAC3B,CAACZ,IAGEgB,EAAgBZ,eAAaa,IACjCrB,EAAcU,QAAUW,CAAK,GAC5B,IAGGC,EAAad,EAAAA,aAAY,KAC7B,MAAMC,EAAWX,EAAqBY,QACjCD,EAASE,QACdF,EAAST,EAAcU,SAASM,OAAO,GACtC,IAGGO,EAAsBf,eACzBgB,IACC,MAAMC,IAAEA,GAAQD,EASVE,EAPoD,CACxDC,UAAWpB,EACXqB,QAASX,EACTY,WAAY5B,IAAUG,EAAWa,EAAgBV,EACjDuB,UAAW7B,IAAUG,EAAWG,EAAYU,GAGvBQ,GACnBC,IACFF,EAAMO,iBACNL,IACD,GAEH,CAACnB,EAAWU,EAAehB,EAAOG,IAG9B4B,EAAexB,EAAAA,aAAY,KAC/B,IAAKZ,EAAac,QAAS,OAC3B,MAAMD,EAAWb,EAAac,QAAQuB,iBACpC,kBAEFnC,EAAqBY,QAAUwB,MAAMC,KAAK1B,GAGtCT,EAAcU,SAAWZ,EAAqBY,QAAQC,QACxDS,EAActB,EAAqBY,QAAQC,OAAS,EACrD,GACA,CAACf,EAAcwB,IASlB,OANAgB,EAAAA,WAAU,KACR,MAAMC,EAAYzC,GAAcc,QAC3B2B,GACLL,GAAc,GACb,CAACA,EAAcnC,EAAUD,IAErB,CACLW,YACAU,gBACAK,aACAF,gBACAkB,WAAYtC,EAAcU,QAC1Ba,sBACD"}
@@ -1,2 +1,2 @@
1
- define(['exports', 'preact/hooks', './useId-c9578d26', './useUser-e0677e8d', './useTranslationBundle-db326955', './clientHints-6d361eaa', './collectionUtils-3951928f', './classNames-08d99695', './mergeProps-bcfa6a92', './dndUtils-9d9ccdc5', './hooks/PRIVATE_useReorderable/themes/ReorderableItemStyles.css', './keys-4755c121'], (function(e,r,t,s,o,n,a,l,c,i,f,u){"use strict";const d=(e,r,t,s,o)=>{const n=t>0?t-1:0,a=t<s?t+1:s;switch(e){case"ArrowLeft":return r?a:n;case"ArrowRight":return r?n:a;case"ArrowUp":if(o)return t<o?t:t-o;case"ArrowDown":if(o)return t>s-o?t:t+o;default:return}};e.useReorderable=function(e){const{onReorder:l,rootRef:c,itemSelector:i,isDisabled:f,columns:u}=e,y=r.useRef(),{direction:m}=s.useUser(),g="rtl"===m,v=o.useTranslationBundle("@oracle/oraclejet-preact"),b="reorderable_"+t.useId(),{deviceType:p,platform:D}=n.getClientHints(),K="windows"===D?v.accControlKey():v.accCommandKey(),A="phone"===p||"tablet"===p?"":v.accReorderInstructions({keyPressed:K}),[R,w]=r.useState(""),I=r.useCallback((e=>{if((e.metaKey||e.ctrlKey)&&e.shiftKey&&["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(e.key)&&l&&c.current){e.metaKey&&e.preventDefault();const r=[...a.getItemKeysArray(c.current,i)],t=r.length-1,s=r.indexOf(y.current),o=d(e.key,g,s,t,u);if(void 0!==o&&s!==o){const t=r[o]?.toString();r.splice(s,1),r.splice(o,0,y.current),l?.({reorderedKeys:r,itemKeys:[y.current],referenceKey:0===o?null:r[o-1]});const n="ArrowLeft"===e.key||"ArrowUp"===e.key?v.accPositionBefore():v.accPositionAfter(),a=y?.current?.toString();t&&n&&a&&w(v.accAnnounceMovedKey({itemKey:a,position:n,referenceKey:t}))}}}),[y,l,u,g,i,c,v]);return{reorderProps:f?{}:{onKeyDown:I},reorderContext:{currentItemKey:y},reorderInstructionsId:b,reorderInstructions:A,reorderStatus:R}},e.useReorderableItem=function(e){const{isDisabled:t,dragKey:o,setDragKey:n,onReorder:d,ref:y,rootRef:m,itemStyles:g,getItem:v,setTransferData:b,itemSelector:p,isVertical:D}=e,[K,A]=r.useState(void 0);r.useEffect((()=>{if(y.current){const e=v(),r=null!=e?a.getKey(e):void 0;A(r)}}),[o]);const[R,w]=r.useState(),I=r.useRef(),h=r.useRef(void 0),k=l.classNames([f.styles.itemDragger,g.itemDragger]),{direction:O}=s.useUser(),P="rtl"===O,S=r.useCallback((e=>{const r=v();let t=e.target;const s=null!=r?a.getKey(r):void 0;let o;for(;t;){if(t.hasAttribute("data-oj-draggable")){o=t;break}if(t===r)break;t=t.parentElement}o?y?.current&&n&&(h.current=i.createDragImage(y.current,k),y.current!==o?e?.dataTransfer?.setDragImage(h.current,o.offsetLeft+o.offsetWidth/2,o.offsetTop+o.offsetHeight/2):e?.dataTransfer?.setDragImage(h.current,o.offsetWidth/2,o.offsetHeight/2),b(e),n(s)):(e.preventDefault(),e.stopPropagation())}),[v,b,k,y,n]),C=r.useCallback((e=>{u.isKeyDefined(o)&&e.preventDefault()}),[o]),T=r.useCallback((()=>{n?.(void 0),document.body.removeChild(h.current)}),[n]),U=r.useCallback((()=>{if(m?.current){const e=v(),r=null!=e?a.getKey(e):void 0,t=a.getItemKeysArray(m.current,p);let s;const l=[...t],c=l.indexOf(o);if(null!=r){const e=l.indexOf(r);null!=c&&null!=e&&c!=e&&(s=P?c<e?"before"===R?e:e-1:"before"===R?e+1:e:c<e?"before"===R?e-1:e:"before"===R?e:e+1)}if(void 0!==s&&c!==s){const e=t[c];l.splice(c,1),l.splice(s,0,e),d?.({reorderedKeys:l,itemKeys:[o],referenceKey:0===s?null:l[s-1]}),w(void 0),n?.(void 0)}}}),[o,R,v,P,p,d,m,n]);if(t)return{};const B=null!=K&&K===o,E=l.classNames([f.styles.itemDnd,B&&f.styles.itemDragged]),L=l.classNames([g.itemOverlayFront,D?f.styles.itemOverlayVertical:f.styles.itemOverlay,"before"===R&&f.styles.itemOverlayBefore,"before"===R&&P&&f.styles.itemOverlayBeforeRtl]),x=l.classNames([g.itemOverlayFront,g.itemOverlayRear,D?f.styles.itemOverlayVertical:f.styles.itemOverlay,"after"===R&&f.styles.itemOverlayAfter,"after"===R&&P&&f.styles.itemOverlayAfterRtl]);return{rootProps:c.mergeProps({ref:y,onDragStart:S,onDragEnd:T,onDragOver:C,onDrop:U,isDisabled:t,class:E}),isDragged:B,overlayZoneBeforeProps:c.mergeProps({onDragEnter:()=>{w("before"),I.current="before"},onDragLeave:()=>{"before"===I.current&&w(void 0)},class:L}),overlayZoneAfterProps:c.mergeProps({onDragEnter:()=>{w("after"),I.current="after"},onDragLeave:()=>{"after"===I.current&&w(void 0)},class:x})}}}));
2
- //# sourceMappingURL=useReorderableItem-6ab59e42.js.map
1
+ define(['exports', 'preact/hooks', './useId-c9578d26', './useUser-08901aba', './useTranslationBundle-e4dd341e', './clientHints-6d361eaa', './collectionUtils-3951928f', './classNames-08d99695', './mergeProps-bcfa6a92', './dndUtils-9d9ccdc5', './hooks/PRIVATE_useReorderable/themes/ReorderableItemStyles.css', './keys-4755c121'], (function(e,r,t,s,o,n,a,l,c,i,f,u){"use strict";const d=(e,r,t,s,o)=>{const n=t>0?t-1:0,a=t<s?t+1:s;switch(e){case"ArrowLeft":return r?a:n;case"ArrowRight":return r?n:a;case"ArrowUp":if(o)return t<o?t:t-o;case"ArrowDown":if(o)return t>s-o?t:t+o;default:return}};e.useReorderable=function(e){const{onReorder:l,rootRef:c,itemSelector:i,isDisabled:f,columns:u}=e,y=r.useRef(),{direction:m}=s.useUser(),g="rtl"===m,v=o.useTranslationBundle("@oracle/oraclejet-preact"),b="reorderable_"+t.useId(),{deviceType:p,platform:D}=n.getClientHints(),K="windows"===D?v.accControlKey():v.accCommandKey(),A="phone"===p||"tablet"===p?"":v.accReorderInstructions({keyPressed:K}),[R,w]=r.useState(""),I=r.useCallback((e=>{if((e.metaKey||e.ctrlKey)&&e.shiftKey&&["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(e.key)&&l&&c.current){e.metaKey&&e.preventDefault();const r=[...a.getItemKeysArray(c.current,i)],t=r.length-1,s=r.indexOf(y.current),o=d(e.key,g,s,t,u);if(void 0!==o&&s!==o){const t=r[o]?.toString();r.splice(s,1),r.splice(o,0,y.current),l?.({reorderedKeys:r,itemKeys:[y.current],referenceKey:0===o?null:r[o-1]});const n="ArrowLeft"===e.key||"ArrowUp"===e.key?v.accPositionBefore():v.accPositionAfter(),a=y?.current?.toString();t&&n&&a&&w(v.accAnnounceMovedKey({itemKey:a,position:n,referenceKey:t}))}}}),[y,l,u,g,i,c,v]);return{reorderProps:f?{}:{onKeyDown:I},reorderContext:{currentItemKey:y},reorderInstructionsId:b,reorderInstructions:A,reorderStatus:R}},e.useReorderableItem=function(e){const{isDisabled:t,dragKey:o,setDragKey:n,onReorder:d,ref:y,rootRef:m,itemStyles:g,getItem:v,setTransferData:b,itemSelector:p,isVertical:D}=e,[K,A]=r.useState(void 0);r.useEffect((()=>{if(y.current){const e=v(),r=null!=e?a.getKey(e):void 0;A(r)}}),[o]);const[R,w]=r.useState(),I=r.useRef(),h=r.useRef(void 0),k=l.classNames([f.styles.itemDragger,g.itemDragger]),{direction:O}=s.useUser(),P="rtl"===O,S=r.useCallback((e=>{const r=v();let t=e.target;const s=null!=r?a.getKey(r):void 0;let o;for(;t;){if(t.hasAttribute("data-oj-draggable")){o=t;break}if(t===r)break;t=t.parentElement}o?y?.current&&n&&(h.current=i.createDragImage(y.current,k),y.current!==o?e?.dataTransfer?.setDragImage(h.current,o.offsetLeft+o.offsetWidth/2,o.offsetTop+o.offsetHeight/2):e?.dataTransfer?.setDragImage(h.current,o.offsetWidth/2,o.offsetHeight/2),b(e),n(s)):(e.preventDefault(),e.stopPropagation())}),[v,b,k,y,n]),C=r.useCallback((e=>{u.isKeyDefined(o)&&e.preventDefault()}),[o]),T=r.useCallback((()=>{n?.(void 0),document.body.removeChild(h.current)}),[n]),U=r.useCallback((()=>{if(m?.current){const e=v(),r=null!=e?a.getKey(e):void 0,t=a.getItemKeysArray(m.current,p);let s;const l=[...t],c=l.indexOf(o);if(null!=r){const e=l.indexOf(r);null!=c&&null!=e&&c!=e&&(s=P?c<e?"before"===R?e:e-1:"before"===R?e+1:e:c<e?"before"===R?e-1:e:"before"===R?e:e+1)}if(void 0!==s&&c!==s){const e=t[c];l.splice(c,1),l.splice(s,0,e),d?.({reorderedKeys:l,itemKeys:[o],referenceKey:0===s?null:l[s-1]}),w(void 0),n?.(void 0)}}}),[o,R,v,P,p,d,m,n]);if(t)return{};const B=null!=K&&K===o,E=l.classNames([f.styles.itemDnd,B&&f.styles.itemDragged]),L=l.classNames([g.itemOverlayFront,D?f.styles.itemOverlayVertical:f.styles.itemOverlay,"before"===R&&f.styles.itemOverlayBefore,"before"===R&&P&&f.styles.itemOverlayBeforeRtl]),x=l.classNames([g.itemOverlayFront,g.itemOverlayRear,D?f.styles.itemOverlayVertical:f.styles.itemOverlay,"after"===R&&f.styles.itemOverlayAfter,"after"===R&&P&&f.styles.itemOverlayAfterRtl]);return{rootProps:c.mergeProps({ref:y,onDragStart:S,onDragEnd:T,onDragOver:C,onDrop:U,isDisabled:t,class:E}),isDragged:B,overlayZoneBeforeProps:c.mergeProps({onDragEnter:()=>{w("before"),I.current="before"},onDragLeave:()=>{"before"===I.current&&w(void 0)},class:L}),overlayZoneAfterProps:c.mergeProps({onDragEnter:()=>{w("after"),I.current="after"},onDragLeave:()=>{"after"===I.current&&w(void 0)},class:x})}}}));
2
+ //# sourceMappingURL=useReorderableItem-0f9d7742.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useReorderableItem-6ab59e42.js","sources":["../../src/hooks/PRIVATE_useReorderable/useReorderable.ts","../../src/hooks/PRIVATE_useReorderable/useReorderableItem.ts"],"sourcesContent":["import type { RefObject } from 'preact';\nimport { useRef, useCallback, useState } from 'preact/hooks';\nimport { useId } from '#hooks/UNSAFE_useId';\nimport { useUser } from '#hooks/UNSAFE_useUser';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport { getClientHints } from '#utils/PRIVATE_clientHints';\nimport { getItemKeysArray } from '#utils/PRIVATE_collectionUtils';\nimport { BundleType } from '#resources/nls/bundle';\nimport { ReorderProps } from '#UNSAFE_Collection/Reorderable.types';\n\ntype useReorderableProps<K> = ReorderProps<K> & {\n rootRef: RefObject<HTMLDivElement>;\n itemSelector: string;\n isDisabled?: boolean;\n columns?: number;\n};\n\n/**\n * Implements keyboard reorder behavior for list-like components, e.g. TabBar, ListView, CardView\n */\nexport function useReorderable<K extends string | number>(options: useReorderableProps<K>) {\n const { onReorder, rootRef, itemSelector, isDisabled, columns } = options;\n\n const currentItemKey = useRef<K | undefined>();\n const { direction } = useUser();\n const isRtl = direction === 'rtl';\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const reorderInstructionsId = 'reorderable_' + useId();\n const { deviceType, platform } = getClientHints();\n const keyPressed =\n platform === 'windows' ? translations.accControlKey() : translations.accCommandKey();\n const reorderInstructions =\n deviceType === 'phone' || deviceType === 'tablet'\n ? ''\n : translations.accReorderInstructions({\n keyPressed: keyPressed\n });\n const [reorderStatus, setReorderStatus] = useState<string | undefined>('');\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent) => {\n const keyHandlers = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'];\n if (\n (e.metaKey || e.ctrlKey) &&\n e.shiftKey &&\n keyHandlers.includes(e.key) &&\n onReorder &&\n rootRef.current\n ) {\n if (e.metaKey) {\n e.preventDefault();\n }\n const itemKeysArray = getItemKeysArray(rootRef.current, itemSelector);\n const newArray = [...itemKeysArray];\n const lastIndex = newArray.length - 1;\n const currentItemIndex = newArray.indexOf(currentItemKey.current);\n // get reference item index and reordered keys\n const referenceItemIndex = getReferenceItemIndex(\n e.key,\n isRtl,\n currentItemIndex,\n lastIndex,\n columns\n );\n if (referenceItemIndex !== undefined && currentItemIndex !== referenceItemIndex) {\n const referenceKey = newArray[referenceItemIndex]?.toString();\n newArray.splice(currentItemIndex, 1);\n newArray.splice(referenceItemIndex as number, 0, currentItemKey.current);\n onReorder?.({\n reorderedKeys: newArray as K[],\n itemKeys: [currentItemKey.current as K],\n // If the dragged items were dropped at the very beginning, the referenceKey will be null.\n referenceKey: referenceItemIndex === 0 ? null : (newArray[referenceItemIndex - 1] as K)\n });\n // set acc status\n const isPrev = e.key === 'ArrowLeft' || e.key === 'ArrowUp' ? true : false;\n const position = isPrev\n ? translations.accPositionBefore()\n : translations.accPositionAfter();\n const itemKeyString = currentItemKey?.current?.toString();\n if (referenceKey && position && itemKeyString) {\n setReorderStatus(\n translations.accAnnounceMovedKey({\n itemKey: itemKeyString,\n position: position,\n referenceKey: referenceKey\n })\n );\n }\n }\n }\n },\n [currentItemKey, onReorder, columns, isRtl, itemSelector, rootRef, translations]\n );\n\n const eventProps = isDisabled ? {} : { onKeyDown };\n\n return {\n reorderProps: eventProps,\n reorderContext: {\n currentItemKey\n },\n reorderInstructionsId,\n reorderInstructions,\n reorderStatus\n } as const;\n}\n\n/**\n * A helper function to get referenceItemIndex during keyboard reordering\n *\n * @param eventKey the arrow event keys\n * @param isRtl whether RTL is enabled\n * @param currentItemIndex the index of current item\n * @param lastIndex the last index\n * @param columns optional param to specify the number of columns, for keyboard reordering by arrow up/down keys.\n */\nconst getReferenceItemIndex = (\n eventKey: string,\n isRtl: boolean,\n currentItemIndex: number,\n lastIndex: number,\n columns?: number\n) => {\n const leftDropIndex = currentItemIndex > 0 ? currentItemIndex - 1 : 0;\n const rightDropIndex = currentItemIndex < lastIndex ? currentItemIndex + 1 : lastIndex;\n switch (eventKey) {\n case 'ArrowLeft':\n return isRtl ? rightDropIndex : leftDropIndex;\n case 'ArrowRight':\n return isRtl ? leftDropIndex : rightDropIndex;\n case 'ArrowUp':\n if (columns) {\n // if the current item is at the top row, arrow up should not move anywhere\n return currentItemIndex < columns ? currentItemIndex : currentItemIndex - columns;\n }\n case 'ArrowDown':\n if (columns) {\n // if the current item is at the bottom row, arrow down should not move anywhere\n return currentItemIndex > lastIndex - columns\n ? currentItemIndex\n : currentItemIndex + columns;\n }\n default:\n return undefined;\n }\n};\n","import type { RefObject } from 'preact';\nimport { useState, useRef, useCallback, useEffect } from 'preact/hooks';\nimport { classNames } from '#utils/UNSAFE_classNames';\nimport { mergeProps } from '#utils/UNSAFE_mergeProps';\nimport { createDragImage } from '#utils/PRIVATE_dndUtils';\nimport { getKey, getItemKeysArray } from '#utils/PRIVATE_collectionUtils';\nimport { useUser } from '#hooks/UNSAFE_useUser';\nimport { ReorderableItemProps } from '#UNSAFE_Collection/Reorderable.types';\nimport { styles } from './themes/ReorderableItemStyles.css';\nimport { isKeyDefined } from '#utils/UNSAFE_keys';\n\nexport type useReorderableOptions<K extends string | number> = Omit<\n ReorderableItemProps<K>,\n 'children'\n> & {\n isDisabled: boolean;\n ref: RefObject<HTMLDivElement>;\n getItem: () => Element | null | undefined; // a function to get the reorderable item\n setTransferData: (event: DragEvent) => void; // a function to set the transfer data and type\n itemStyles: {\n // component specific style for two overlay divs, e.g. component has different gap sizes\n itemOverlayFront: string;\n itemOverlayRear: string;\n itemDragger?: string; // component specific style for drag image\n };\n itemSelector: string;\n isVertical?: boolean; // used when the component is vertical and has one column, e.g. ListView\n};\n\n/**\n * Implements mouse reorder behavior for list-like components, e.g. TabBar, ListView, CardView\n */\nexport function useReorderableItem<K extends string | number>(options: useReorderableOptions<K>) {\n const {\n isDisabled,\n dragKey,\n setDragKey,\n onReorder,\n ref,\n rootRef,\n itemStyles,\n getItem,\n setTransferData,\n itemSelector,\n isVertical\n } = options;\n\n const [itemKey, setItemKey] = useState<K | undefined>(undefined);\n\n // This is used to set the current itemKey and that in turn sets isDragged class. It needs to be updated everytime dragKey changes because otherwise itemKey will be the previously draggedKey\n useEffect(() => {\n if (ref.current) {\n const item = getItem();\n const key = item != null ? (getKey(item as HTMLElement) as K) : undefined;\n setItemKey(key);\n }\n }, [dragKey]);\n\n const [position, setPosition] = useState<'before' | 'after' | undefined>();\n const pendingPositionRef = useRef<typeof position>();\n const dragImgRef = useRef<HTMLElement | undefined>(undefined);\n\n const itemDraggerClasses = classNames([styles.itemDragger, itemStyles.itemDragger]);\n\n const { direction } = useUser();\n const isRtl = direction === 'rtl';\n\n /**\n * Drag start handler\n * The data-oj-draggable attribute need to be required and set to true to the target element. This\n * attribute is used to identify which element can act as drag handles during the drag and drop process.\n */\n const handleDragStart = useCallback(\n (e: DragEvent) => {\n const item = getItem();\n let targetElement: HTMLElement | null = e.target as HTMLElement;\n const currentDragKey = item != null ? (getKey(item as HTMLElement) as K) : undefined;\n\n let dragHandle;\n while (targetElement) {\n //data-oj-draggable attribute is only to use to draggable element\n if (targetElement.hasAttribute('data-oj-draggable')) {\n dragHandle = targetElement;\n break;\n } else if (targetElement === item) {\n break;\n }\n targetElement = targetElement.parentElement;\n }\n\n if (!dragHandle) {\n e.preventDefault();\n e.stopPropagation();\n } else {\n if (ref?.current && setDragKey) {\n dragImgRef.current = createDragImage(ref.current, itemDraggerClasses);\n if (ref.current !== dragHandle) {\n e?.dataTransfer?.setDragImage(\n dragImgRef.current,\n dragHandle.offsetLeft + dragHandle.offsetWidth / 2,\n dragHandle.offsetTop + dragHandle.offsetHeight / 2\n );\n } else {\n e?.dataTransfer?.setDragImage(\n dragImgRef.current,\n dragHandle.offsetWidth / 2,\n dragHandle.offsetHeight / 2\n );\n }\n setTransferData(e);\n setDragKey(currentDragKey as K);\n }\n }\n },\n [getItem, setTransferData, itemDraggerClasses, ref, setDragKey]\n );\n\n const handleDragOver = useCallback(\n (e: DragEvent) => {\n if (isKeyDefined(dragKey)) {\n e.preventDefault();\n }\n },\n [dragKey]\n );\n\n //Once drag is over, reset styling of dragged item to it's original styling\n const handleDragEnd = useCallback(() => {\n setDragKey?.(undefined);\n document.body.removeChild(dragImgRef.current as HTMLElement);\n }, [setDragKey]);\n\n // detect drop target position on the overlay divs and render drop target\n const handleDragEnterBeforeZone = () => {\n setPosition('before');\n pendingPositionRef.current = 'before';\n };\n\n const handleDragLeaveBeforeZone = () => {\n if (pendingPositionRef.current === 'before') {\n setPosition(undefined);\n }\n };\n\n const handleDragEnterAfterZone = () => {\n setPosition('after');\n pendingPositionRef.current = 'after';\n };\n\n const handleDragLeaveAfterZone = () => {\n if (pendingPositionRef.current === 'after') {\n setPosition(undefined);\n }\n };\n\n const handleDrop = useCallback(() => {\n if (rootRef?.current) {\n const item = getItem();\n const currentDropKey = item != null ? (getKey(item as HTMLElement) as K) : undefined;\n const reference = currentDropKey;\n const itemKeys = getItemKeysArray(rootRef.current, itemSelector);\n let insertPos;\n const newArray = [...itemKeys];\n const dragIndex = newArray.indexOf(dragKey);\n if (reference != null) {\n const dropIndex = newArray.indexOf(reference);\n if (dragIndex != null && dropIndex != null && dragIndex != dropIndex) {\n if (!isRtl) {\n if (dragIndex < dropIndex) {\n insertPos = position === 'before' ? dropIndex - 1 : dropIndex;\n } else {\n insertPos = position === 'before' ? dropIndex : dropIndex + 1;\n }\n } else {\n if (dragIndex < dropIndex) {\n insertPos = position === 'before' ? dropIndex : dropIndex - 1;\n } else {\n insertPos = position === 'before' ? dropIndex + 1 : dropIndex;\n }\n }\n }\n }\n if (insertPos !== undefined && dragIndex !== insertPos) {\n const sourceData = itemKeys[dragIndex];\n newArray.splice(dragIndex, 1);\n newArray.splice(insertPos as number, 0, sourceData);\n onReorder?.({\n reorderedKeys: newArray as K[],\n itemKeys: [dragKey as K],\n // If the dragged items were dropped at the very beginning, the referenceKey will be null.\n referenceKey: insertPos === 0 ? null : (newArray[insertPos - 1] as K)\n });\n setPosition(undefined);\n setDragKey?.(undefined);\n }\n }\n }, [dragKey, position, getItem, isRtl, itemSelector, onReorder, rootRef, setDragKey]);\n\n if (isDisabled) {\n return {};\n }\n\n //change dragged item visual to appear disable\n const isDragged = itemKey != null && itemKey === dragKey;\n\n const dndItemClasses = classNames([styles.itemDnd, isDragged && styles.itemDragged]);\n\n const itemOverlayClassesBefore = classNames([\n itemStyles.itemOverlayFront,\n isVertical ? styles.itemOverlayVertical : styles.itemOverlay,\n position === 'before' && styles.itemOverlayBefore,\n position === 'before' && isRtl && styles.itemOverlayBeforeRtl\n ]);\n const itemOverlayClassesAfter = classNames([\n itemStyles.itemOverlayFront,\n itemStyles.itemOverlayRear,\n isVertical ? styles.itemOverlayVertical : styles.itemOverlay,\n position === 'after' && styles.itemOverlayAfter,\n position === 'after' && isRtl && styles.itemOverlayAfterRtl\n ]);\n\n return {\n rootProps: mergeProps({\n ref: ref,\n onDragStart: handleDragStart,\n onDragEnd: handleDragEnd,\n onDragOver: handleDragOver,\n onDrop: handleDrop,\n isDisabled: isDisabled,\n class: dndItemClasses\n }),\n isDragged: isDragged,\n overlayZoneBeforeProps: mergeProps({\n onDragEnter: handleDragEnterBeforeZone,\n onDragLeave: handleDragLeaveBeforeZone,\n class: itemOverlayClassesBefore\n }),\n overlayZoneAfterProps: mergeProps({\n onDragEnter: handleDragEnterAfterZone,\n onDragLeave: handleDragLeaveAfterZone,\n class: itemOverlayClassesAfter\n })\n } as const;\n}\n"],"names":["getReferenceItemIndex","eventKey","isRtl","currentItemIndex","lastIndex","columns","leftDropIndex","rightDropIndex","options","onReorder","rootRef","itemSelector","isDisabled","currentItemKey","useRef","direction","useUser","translations","useTranslationBundle","reorderInstructionsId","useId","deviceType","platform","getClientHints","keyPressed","accControlKey","accCommandKey","reorderInstructions","accReorderInstructions","reorderStatus","setReorderStatus","useState","onKeyDown","useCallback","e","metaKey","ctrlKey","shiftKey","includes","key","current","preventDefault","newArray","getItemKeysArray","length","indexOf","referenceItemIndex","undefined","referenceKey","toString","splice","reorderedKeys","itemKeys","position","accPositionBefore","accPositionAfter","itemKeyString","accAnnounceMovedKey","itemKey","reorderProps","reorderContext","dragKey","setDragKey","ref","itemStyles","getItem","setTransferData","isVertical","setItemKey","useEffect","item","getKey","setPosition","pendingPositionRef","dragImgRef","itemDraggerClasses","classNames","styles","itemDragger","handleDragStart","targetElement","target","currentDragKey","dragHandle","hasAttribute","parentElement","createDragImage","dataTransfer","setDragImage","offsetLeft","offsetWidth","offsetTop","offsetHeight","stopPropagation","handleDragOver","isKeyDefined","handleDragEnd","document","body","removeChild","handleDrop","reference","insertPos","dragIndex","dropIndex","sourceData","isDragged","dndItemClasses","itemDnd","itemDragged","itemOverlayClassesBefore","itemOverlayFront","itemOverlayVertical","itemOverlay","itemOverlayBefore","itemOverlayBeforeRtl","itemOverlayClassesAfter","itemOverlayRear","itemOverlayAfter","itemOverlayAfterRtl","rootProps","mergeProps","onDragStart","onDragEnd","onDragOver","onDrop","class","overlayZoneBeforeProps","onDragEnter","onDragLeave","overlayZoneAfterProps"],"mappings":"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"}
1
+ {"version":3,"file":"useReorderableItem-0f9d7742.js","sources":["../../src/hooks/PRIVATE_useReorderable/useReorderable.ts","../../src/hooks/PRIVATE_useReorderable/useReorderableItem.ts"],"sourcesContent":["import type { RefObject } from 'preact';\nimport { useRef, useCallback, useState } from 'preact/hooks';\nimport { useId } from '#hooks/UNSAFE_useId';\nimport { useUser } from '#hooks/UNSAFE_useUser';\nimport { useTranslationBundle } from '#hooks/UNSAFE_useTranslationBundle';\nimport { getClientHints } from '#utils/PRIVATE_clientHints';\nimport { getItemKeysArray } from '#utils/PRIVATE_collectionUtils';\nimport { BundleType } from '#resources/nls/bundle';\nimport { ReorderProps } from '#UNSAFE_Collection/Reorderable.types';\n\ntype useReorderableProps<K> = ReorderProps<K> & {\n rootRef: RefObject<HTMLDivElement>;\n itemSelector: string;\n isDisabled?: boolean;\n columns?: number;\n};\n\n/**\n * Implements keyboard reorder behavior for list-like components, e.g. TabBar, ListView, CardView\n */\nexport function useReorderable<K extends string | number>(options: useReorderableProps<K>) {\n const { onReorder, rootRef, itemSelector, isDisabled, columns } = options;\n\n const currentItemKey = useRef<K | undefined>();\n const { direction } = useUser();\n const isRtl = direction === 'rtl';\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const reorderInstructionsId = 'reorderable_' + useId();\n const { deviceType, platform } = getClientHints();\n const keyPressed =\n platform === 'windows' ? translations.accControlKey() : translations.accCommandKey();\n const reorderInstructions =\n deviceType === 'phone' || deviceType === 'tablet'\n ? ''\n : translations.accReorderInstructions({\n keyPressed: keyPressed\n });\n const [reorderStatus, setReorderStatus] = useState<string | undefined>('');\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent) => {\n const keyHandlers = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'];\n if (\n (e.metaKey || e.ctrlKey) &&\n e.shiftKey &&\n keyHandlers.includes(e.key) &&\n onReorder &&\n rootRef.current\n ) {\n if (e.metaKey) {\n e.preventDefault();\n }\n const itemKeysArray = getItemKeysArray(rootRef.current, itemSelector);\n const newArray = [...itemKeysArray];\n const lastIndex = newArray.length - 1;\n const currentItemIndex = newArray.indexOf(currentItemKey.current);\n // get reference item index and reordered keys\n const referenceItemIndex = getReferenceItemIndex(\n e.key,\n isRtl,\n currentItemIndex,\n lastIndex,\n columns\n );\n if (referenceItemIndex !== undefined && currentItemIndex !== referenceItemIndex) {\n const referenceKey = newArray[referenceItemIndex]?.toString();\n newArray.splice(currentItemIndex, 1);\n newArray.splice(referenceItemIndex as number, 0, currentItemKey.current);\n onReorder?.({\n reorderedKeys: newArray as K[],\n itemKeys: [currentItemKey.current as K],\n // If the dragged items were dropped at the very beginning, the referenceKey will be null.\n referenceKey: referenceItemIndex === 0 ? null : (newArray[referenceItemIndex - 1] as K)\n });\n // set acc status\n const isPrev = e.key === 'ArrowLeft' || e.key === 'ArrowUp' ? true : false;\n const position = isPrev\n ? translations.accPositionBefore()\n : translations.accPositionAfter();\n const itemKeyString = currentItemKey?.current?.toString();\n if (referenceKey && position && itemKeyString) {\n setReorderStatus(\n translations.accAnnounceMovedKey({\n itemKey: itemKeyString,\n position: position,\n referenceKey: referenceKey\n })\n );\n }\n }\n }\n },\n [currentItemKey, onReorder, columns, isRtl, itemSelector, rootRef, translations]\n );\n\n const eventProps = isDisabled ? {} : { onKeyDown };\n\n return {\n reorderProps: eventProps,\n reorderContext: {\n currentItemKey\n },\n reorderInstructionsId,\n reorderInstructions,\n reorderStatus\n } as const;\n}\n\n/**\n * A helper function to get referenceItemIndex during keyboard reordering\n *\n * @param eventKey the arrow event keys\n * @param isRtl whether RTL is enabled\n * @param currentItemIndex the index of current item\n * @param lastIndex the last index\n * @param columns optional param to specify the number of columns, for keyboard reordering by arrow up/down keys.\n */\nconst getReferenceItemIndex = (\n eventKey: string,\n isRtl: boolean,\n currentItemIndex: number,\n lastIndex: number,\n columns?: number\n) => {\n const leftDropIndex = currentItemIndex > 0 ? currentItemIndex - 1 : 0;\n const rightDropIndex = currentItemIndex < lastIndex ? currentItemIndex + 1 : lastIndex;\n switch (eventKey) {\n case 'ArrowLeft':\n return isRtl ? rightDropIndex : leftDropIndex;\n case 'ArrowRight':\n return isRtl ? leftDropIndex : rightDropIndex;\n case 'ArrowUp':\n if (columns) {\n // if the current item is at the top row, arrow up should not move anywhere\n return currentItemIndex < columns ? currentItemIndex : currentItemIndex - columns;\n }\n case 'ArrowDown':\n if (columns) {\n // if the current item is at the bottom row, arrow down should not move anywhere\n return currentItemIndex > lastIndex - columns\n ? currentItemIndex\n : currentItemIndex + columns;\n }\n default:\n return undefined;\n }\n};\n","import type { RefObject } from 'preact';\nimport { useState, useRef, useCallback, useEffect } from 'preact/hooks';\nimport { classNames } from '#utils/UNSAFE_classNames';\nimport { mergeProps } from '#utils/UNSAFE_mergeProps';\nimport { createDragImage } from '#utils/PRIVATE_dndUtils';\nimport { getKey, getItemKeysArray } from '#utils/PRIVATE_collectionUtils';\nimport { useUser } from '#hooks/UNSAFE_useUser';\nimport { ReorderableItemProps } from '#UNSAFE_Collection/Reorderable.types';\nimport { styles } from './themes/ReorderableItemStyles.css';\nimport { isKeyDefined } from '#utils/UNSAFE_keys';\n\nexport type useReorderableOptions<K extends string | number> = Omit<\n ReorderableItemProps<K>,\n 'children'\n> & {\n isDisabled: boolean;\n ref: RefObject<HTMLDivElement>;\n getItem: () => Element | null | undefined; // a function to get the reorderable item\n setTransferData: (event: DragEvent) => void; // a function to set the transfer data and type\n itemStyles: {\n // component specific style for two overlay divs, e.g. component has different gap sizes\n itemOverlayFront: string;\n itemOverlayRear: string;\n itemDragger?: string; // component specific style for drag image\n };\n itemSelector: string;\n isVertical?: boolean; // used when the component is vertical and has one column, e.g. ListView\n};\n\n/**\n * Implements mouse reorder behavior for list-like components, e.g. TabBar, ListView, CardView\n */\nexport function useReorderableItem<K extends string | number>(options: useReorderableOptions<K>) {\n const {\n isDisabled,\n dragKey,\n setDragKey,\n onReorder,\n ref,\n rootRef,\n itemStyles,\n getItem,\n setTransferData,\n itemSelector,\n isVertical\n } = options;\n\n const [itemKey, setItemKey] = useState<K | undefined>(undefined);\n\n // This is used to set the current itemKey and that in turn sets isDragged class. It needs to be updated everytime dragKey changes because otherwise itemKey will be the previously draggedKey\n useEffect(() => {\n if (ref.current) {\n const item = getItem();\n const key = item != null ? (getKey(item as HTMLElement) as K) : undefined;\n setItemKey(key);\n }\n }, [dragKey]);\n\n const [position, setPosition] = useState<'before' | 'after' | undefined>();\n const pendingPositionRef = useRef<typeof position>();\n const dragImgRef = useRef<HTMLElement | undefined>(undefined);\n\n const itemDraggerClasses = classNames([styles.itemDragger, itemStyles.itemDragger]);\n\n const { direction } = useUser();\n const isRtl = direction === 'rtl';\n\n /**\n * Drag start handler\n * The data-oj-draggable attribute need to be required and set to true to the target element. This\n * attribute is used to identify which element can act as drag handles during the drag and drop process.\n */\n const handleDragStart = useCallback(\n (e: DragEvent) => {\n const item = getItem();\n let targetElement: HTMLElement | null = e.target as HTMLElement;\n const currentDragKey = item != null ? (getKey(item as HTMLElement) as K) : undefined;\n\n let dragHandle;\n while (targetElement) {\n //data-oj-draggable attribute is only to use to draggable element\n if (targetElement.hasAttribute('data-oj-draggable')) {\n dragHandle = targetElement;\n break;\n } else if (targetElement === item) {\n break;\n }\n targetElement = targetElement.parentElement;\n }\n\n if (!dragHandle) {\n e.preventDefault();\n e.stopPropagation();\n } else {\n if (ref?.current && setDragKey) {\n dragImgRef.current = createDragImage(ref.current, itemDraggerClasses);\n if (ref.current !== dragHandle) {\n e?.dataTransfer?.setDragImage(\n dragImgRef.current,\n dragHandle.offsetLeft + dragHandle.offsetWidth / 2,\n dragHandle.offsetTop + dragHandle.offsetHeight / 2\n );\n } else {\n e?.dataTransfer?.setDragImage(\n dragImgRef.current,\n dragHandle.offsetWidth / 2,\n dragHandle.offsetHeight / 2\n );\n }\n setTransferData(e);\n setDragKey(currentDragKey as K);\n }\n }\n },\n [getItem, setTransferData, itemDraggerClasses, ref, setDragKey]\n );\n\n const handleDragOver = useCallback(\n (e: DragEvent) => {\n if (isKeyDefined(dragKey)) {\n e.preventDefault();\n }\n },\n [dragKey]\n );\n\n //Once drag is over, reset styling of dragged item to it's original styling\n const handleDragEnd = useCallback(() => {\n setDragKey?.(undefined);\n document.body.removeChild(dragImgRef.current as HTMLElement);\n }, [setDragKey]);\n\n // detect drop target position on the overlay divs and render drop target\n const handleDragEnterBeforeZone = () => {\n setPosition('before');\n pendingPositionRef.current = 'before';\n };\n\n const handleDragLeaveBeforeZone = () => {\n if (pendingPositionRef.current === 'before') {\n setPosition(undefined);\n }\n };\n\n const handleDragEnterAfterZone = () => {\n setPosition('after');\n pendingPositionRef.current = 'after';\n };\n\n const handleDragLeaveAfterZone = () => {\n if (pendingPositionRef.current === 'after') {\n setPosition(undefined);\n }\n };\n\n const handleDrop = useCallback(() => {\n if (rootRef?.current) {\n const item = getItem();\n const currentDropKey = item != null ? (getKey(item as HTMLElement) as K) : undefined;\n const reference = currentDropKey;\n const itemKeys = getItemKeysArray(rootRef.current, itemSelector);\n let insertPos;\n const newArray = [...itemKeys];\n const dragIndex = newArray.indexOf(dragKey);\n if (reference != null) {\n const dropIndex = newArray.indexOf(reference);\n if (dragIndex != null && dropIndex != null && dragIndex != dropIndex) {\n if (!isRtl) {\n if (dragIndex < dropIndex) {\n insertPos = position === 'before' ? dropIndex - 1 : dropIndex;\n } else {\n insertPos = position === 'before' ? dropIndex : dropIndex + 1;\n }\n } else {\n if (dragIndex < dropIndex) {\n insertPos = position === 'before' ? dropIndex : dropIndex - 1;\n } else {\n insertPos = position === 'before' ? dropIndex + 1 : dropIndex;\n }\n }\n }\n }\n if (insertPos !== undefined && dragIndex !== insertPos) {\n const sourceData = itemKeys[dragIndex];\n newArray.splice(dragIndex, 1);\n newArray.splice(insertPos as number, 0, sourceData);\n onReorder?.({\n reorderedKeys: newArray as K[],\n itemKeys: [dragKey as K],\n // If the dragged items were dropped at the very beginning, the referenceKey will be null.\n referenceKey: insertPos === 0 ? null : (newArray[insertPos - 1] as K)\n });\n setPosition(undefined);\n setDragKey?.(undefined);\n }\n }\n }, [dragKey, position, getItem, isRtl, itemSelector, onReorder, rootRef, setDragKey]);\n\n if (isDisabled) {\n return {};\n }\n\n //change dragged item visual to appear disable\n const isDragged = itemKey != null && itemKey === dragKey;\n\n const dndItemClasses = classNames([styles.itemDnd, isDragged && styles.itemDragged]);\n\n const itemOverlayClassesBefore = classNames([\n itemStyles.itemOverlayFront,\n isVertical ? styles.itemOverlayVertical : styles.itemOverlay,\n position === 'before' && styles.itemOverlayBefore,\n position === 'before' && isRtl && styles.itemOverlayBeforeRtl\n ]);\n const itemOverlayClassesAfter = classNames([\n itemStyles.itemOverlayFront,\n itemStyles.itemOverlayRear,\n isVertical ? styles.itemOverlayVertical : styles.itemOverlay,\n position === 'after' && styles.itemOverlayAfter,\n position === 'after' && isRtl && styles.itemOverlayAfterRtl\n ]);\n\n return {\n rootProps: mergeProps({\n ref: ref,\n onDragStart: handleDragStart,\n onDragEnd: handleDragEnd,\n onDragOver: handleDragOver,\n onDrop: handleDrop,\n isDisabled: isDisabled,\n class: dndItemClasses\n }),\n isDragged: isDragged,\n overlayZoneBeforeProps: mergeProps({\n onDragEnter: handleDragEnterBeforeZone,\n onDragLeave: handleDragLeaveBeforeZone,\n class: itemOverlayClassesBefore\n }),\n overlayZoneAfterProps: mergeProps({\n onDragEnter: handleDragEnterAfterZone,\n onDragLeave: handleDragLeaveAfterZone,\n class: itemOverlayClassesAfter\n })\n } as const;\n}\n"],"names":["getReferenceItemIndex","eventKey","isRtl","currentItemIndex","lastIndex","columns","leftDropIndex","rightDropIndex","options","onReorder","rootRef","itemSelector","isDisabled","currentItemKey","useRef","direction","useUser","translations","useTranslationBundle","reorderInstructionsId","useId","deviceType","platform","getClientHints","keyPressed","accControlKey","accCommandKey","reorderInstructions","accReorderInstructions","reorderStatus","setReorderStatus","useState","onKeyDown","useCallback","e","metaKey","ctrlKey","shiftKey","includes","key","current","preventDefault","newArray","getItemKeysArray","length","indexOf","referenceItemIndex","undefined","referenceKey","toString","splice","reorderedKeys","itemKeys","position","accPositionBefore","accPositionAfter","itemKeyString","accAnnounceMovedKey","itemKey","reorderProps","reorderContext","dragKey","setDragKey","ref","itemStyles","getItem","setTransferData","isVertical","setItemKey","useEffect","item","getKey","setPosition","pendingPositionRef","dragImgRef","itemDraggerClasses","classNames","styles","itemDragger","handleDragStart","targetElement","target","currentDragKey","dragHandle","hasAttribute","parentElement","createDragImage","dataTransfer","setDragImage","offsetLeft","offsetWidth","offsetTop","offsetHeight","stopPropagation","handleDragOver","isKeyDefined","handleDragEnd","document","body","removeChild","handleDrop","reference","insertPos","dragIndex","dropIndex","sourceData","isDragged","dndItemClasses","itemDnd","itemDragged","itemOverlayClassesBefore","itemOverlayFront","itemOverlayVertical","itemOverlay","itemOverlayBefore","itemOverlayBeforeRtl","itemOverlayClassesAfter","itemOverlayRear","itemOverlayAfter","itemOverlayAfterRtl","rootProps","mergeProps","onDragStart","onDragEnd","onDragOver","onDrop","class","overlayZoneBeforeProps","onDragEnter","onDragLeave","overlayZoneAfterProps"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- define(['exports', 'preact/hooks', './useUser-e0677e8d', './clientHints-6d361eaa'], (function(e,t,r,n){"use strict";const o=(e,t=!1)=>{if(t){const t=e.closest("data-oj-roving-tabindex-item");t&&(e=t)}return e.getAttribute("data-oj-roving-tabindex-item")||void 0},s=(e,t)=>{const r=e.findIndex((e=>o(e)===t));return-1===r?0:r},i=(e,t,r,n)=>{const o=s(e,r);let i=-1;return(!n&&"ArrowRight"===t||n&&"ArrowLeft"===t)&&(i=o===e.length-1?0:o+1),(!n&&"ArrowLeft"===t||n&&"ArrowRight"===t)&&(i=0===o?e.length-1:o-1),e[i]};e.useRovingTabIndexContainer=(e,c)=>{const u=t.useRef(null),{direction:a}=r.useUser(),d="rtl"===a,[f,g]=t.useState(void 0),[l,h]=t.useState(!1),b=n.getClientHints(),[w,A]=t.useState(!1),v=()=>u.current?Array.from(u.current.querySelectorAll("[data-oj-roving-tabindex-item]")):[];t.useEffect((()=>{if(!u.current)return;const e=v();A(e.length>0)}),[c]);const x={ref:u,onBlur:()=>h(!1),onFocus:e=>{if(e.target!==e.currentTarget)e.target&&g(o(e.target));else{const e=v();if(0===e.length)return;A(e.length>0);e[s(e,f)].focus()}},onKeyDown:e=>{if("ArrowRight"===e.code||"ArrowLeft"===e.code){const t=v();if(0===t.length)return;i(t,e.code,f,d).focus()}else e.shiftKey&&"Tab"===e.code&&h(!0)},..."safari"===b.browser&&{onMouseDown:e=>{const t=o(e.target,!0);t&&g(t)}},tabIndex:l||e||!w?void 0:0};return{focusedId:f,rovingTabIndexContainerProps:x}}}));
2
- //# sourceMappingURL=useRovingTabIndexContainer-a8b8ab8f.js.map
1
+ define(['exports', 'preact/hooks', './useUser-08901aba', './clientHints-6d361eaa'], (function(e,t,r,n){"use strict";const o=(e,t=!1)=>{if(t){const t=e.closest("data-oj-roving-tabindex-item");t&&(e=t)}return e.getAttribute("data-oj-roving-tabindex-item")||void 0},s=(e,t)=>{const r=e.findIndex((e=>o(e)===t));return-1===r?0:r},i=(e,t,r,n)=>{const o=s(e,r);let i=-1;return(!n&&"ArrowRight"===t||n&&"ArrowLeft"===t)&&(i=o===e.length-1?0:o+1),(!n&&"ArrowLeft"===t||n&&"ArrowRight"===t)&&(i=0===o?e.length-1:o-1),e[i]};e.useRovingTabIndexContainer=(e,a)=>{const c=t.useRef(null),{direction:u}=r.useUser(),d="rtl"===u,[f,g]=t.useState(void 0),[l,h]=t.useState(!1),b=n.getClientHints(),[w,A]=t.useState(!1),v=()=>c.current?Array.from(c.current.querySelectorAll("[data-oj-roving-tabindex-item]")):[];t.useEffect((()=>{if(!c.current)return;const e=v();A(e.length>0)}),[a]);const x={ref:c,onBlur:()=>h(!1),onFocus:e=>{if(e.target!==e.currentTarget)e.target&&g(o(e.target));else{const e=v();if(0===e.length)return;A(e.length>0);e[s(e,f)].focus()}},onKeyDown:e=>{if("ArrowRight"===e.code||"ArrowLeft"===e.code){const t=v();if(0===t.length)return;i(t,e.code,f,d).focus()}else e.shiftKey&&"Tab"===e.code&&h(!0)},..."safari"===b.browser&&{onMouseDown:e=>{const t=o(e.target,!0);t&&g(t)}},tabIndex:l||e||!w?void 0:0};return{focusedId:f,rovingTabIndexContainerProps:x}}}));
2
+ //# sourceMappingURL=useRovingTabIndexContainer-9aa2fbcf.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRovingTabIndexContainer-a8b8ab8f.js","sources":["../../src/hooks/PRIVATE_useRovingTabIndexContainer/useRovingTabIndexContainer.tsx"],"sourcesContent":["import { useState, useRef, useEffect } from 'preact/hooks';\nimport { useUser } from '../UNSAFE_useUser';\nimport { getClientHints } from '../../utils/PRIVATE_clientHints';\nimport type { ComponentChildren } from 'preact';\n\n/**\n * Utility hook for setting up roving tab indexes on children of the consuming parent container\n * For more details: https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex\n * @param isDisabled boolean flag to communicate disabled state of consumer\n * @returns id of currently focused element, and props to be spread onto the consuming element\n */\nconst useRovingTabIndexContainer = (\n isDisabled?: boolean,\n containerChildren?: ComponentChildren\n) => {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const { direction } = useUser();\n const isRtl = direction === 'rtl';\n const [focusedId, setFocusedId] = useState<string | undefined>(undefined);\n const [isShiftTabbing, setIsShiftTabbing] = useState(false); // shift tabbing is tracked in order to toggle wrapper out of the tab order\n const clientHints = getClientHints();\n const [hasFocusableItems, setHasFocusableItems] = useState(false);\n\n const getRovingItems = () => {\n return rootRef.current\n ? Array.from(rootRef.current.querySelectorAll<HTMLElement>('[data-oj-roving-tabindex-item]'))\n : [];\n };\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.code === 'ArrowRight' || e.code === 'ArrowLeft') {\n const items = getRovingItems();\n if (items.length === 0) return;\n const nextItem = getNextItem(items, e.code, focusedId, isRtl);\n nextItem.focus();\n } else if (e.shiftKey && e.code === 'Tab') {\n setIsShiftTabbing(true);\n }\n };\n\n // In Safari 16 and earlier, clicking on an HTML button element does not trigger a focus(in) event,\n // and as such our handleFocus logic does not kick in and our focusedId state is never updated.\n // To work around this, we manually update the focusedId in response to mouse downs. This has been fixed in Safari 17.\n // This fix can be removed once Safari 18 is released.\n const handleMouseDown = (e: MouseEvent) => {\n const rovingItemId = getRovingItemId(e.target as HTMLElement, true);\n if (rovingItemId) {\n setFocusedId(rovingItemId);\n }\n };\n\n const handleFocus = (e: FocusEvent) => {\n if (e.target !== e.currentTarget) {\n //focus has moved to one of the roving items\n if (e.target) {\n setFocusedId(getRovingItemId(e.target as HTMLElement));\n }\n } else {\n //focus has moved to the container, and has to be passed onto the eligble item to receive focus\n const items = getRovingItems();\n if (items.length === 0) return;\n setHasFocusableItems(items.length > 0);\n const currentIndex = getCurrentRovingIndex(items, focusedId);\n items[currentIndex].focus();\n }\n };\n\n useEffect(() => {\n if (!rootRef.current) return;\n\n const items = getRovingItems();\n setHasFocusableItems(items.length > 0);\n }, [containerChildren]);\n\n const rovingTabIndexContainerProps = {\n ref: rootRef,\n onBlur: () => setIsShiftTabbing(false),\n onFocus: handleFocus,\n onKeyDown: handleKeyDown,\n ...(clientHints.browser === 'safari' && { onMouseDown: handleMouseDown }), // mouseDown handler needed for Safari 16\n tabIndex: isShiftTabbing || isDisabled || !hasFocusableItems ? undefined : 0 // tab index is needed on the container in order to pass focus to the first child\n };\n\n return { focusedId, rovingTabIndexContainerProps };\n};\n\nconst getRovingItemId = (item: Element, useClosest = false) => {\n if (useClosest) {\n const ancestor = item.closest('data-oj-roving-tabindex-item');\n if (ancestor) {\n item = ancestor;\n }\n }\n\n return item.getAttribute('data-oj-roving-tabindex-item') || undefined;\n};\n\nconst getCurrentRovingIndex = (items: HTMLElement[], focusedId: string | undefined) => {\n const currentIndex = items.findIndex((item) => getRovingItemId(item) === focusedId);\n return currentIndex === -1 ? 0 : currentIndex;\n};\n\nconst getNextItem = (\n items: HTMLElement[],\n eventCode: string,\n focusedId: string | undefined,\n isRtl: boolean\n) => {\n const currentIndex = getCurrentRovingIndex(items, focusedId);\n let nextIndex = -1;\n if ((!isRtl && eventCode === 'ArrowRight') || (isRtl && eventCode === 'ArrowLeft')) {\n nextIndex = currentIndex === items.length - 1 ? 0 : currentIndex + 1;\n }\n if ((!isRtl && eventCode === 'ArrowLeft') || (isRtl && eventCode === 'ArrowRight')) {\n nextIndex = currentIndex === 0 ? items.length - 1 : currentIndex - 1;\n }\n return items[nextIndex];\n};\n\nexport { useRovingTabIndexContainer };\n"],"names":["getRovingItemId","item","useClosest","ancestor","closest","getAttribute","undefined","getCurrentRovingIndex","items","focusedId","currentIndex","findIndex","getNextItem","eventCode","isRtl","nextIndex","length","isDisabled","containerChildren","rootRef","useRef","direction","useUser","setFocusedId","useState","isShiftTabbing","setIsShiftTabbing","clientHints","getClientHints","hasFocusableItems","setHasFocusableItems","getRovingItems","current","Array","from","querySelectorAll","useEffect","rovingTabIndexContainerProps","ref","onBlur","onFocus","e","target","currentTarget","focus","onKeyDown","code","shiftKey","browser","onMouseDown","rovingItemId","tabIndex"],"mappings":"gHAWA,MA2EMA,EAAkB,CAACC,EAAeC,GAAa,KACnD,GAAIA,EAAY,CACd,MAAMC,EAAWF,EAAKG,QAAQ,gCAC1BD,IACFF,EAAOE,EAEV,CAED,OAAOF,EAAKI,aAAa,sCAAmCC,CAAS,EAGjEC,EAAwB,CAACC,EAAsBC,KACnD,MAAMC,EAAeF,EAAMG,WAAWV,GAASD,EAAgBC,KAAUQ,IACzE,OAAyB,IAAlBC,EAAsB,EAAIA,CAAY,EAGzCE,EAAc,CAClBJ,EACAK,EACAJ,EACAK,KAEA,MAAMJ,EAAeH,EAAsBC,EAAOC,GAClD,IAAIM,GAAa,EAOjB,QANMD,GAAuB,eAAdD,GAAgCC,GAAuB,cAAdD,KACtDE,EAAYL,IAAiBF,EAAMQ,OAAS,EAAI,EAAIN,EAAe,KAE/DI,GAAuB,cAAdD,GAA+BC,GAAuB,eAAdD,KACrDE,EAA6B,IAAjBL,EAAqBF,EAAMQ,OAAS,EAAIN,EAAe,GAE9DF,EAAMO,EAAU,+BAzGU,CACjCE,EACAC,KAEA,MAAMC,EAAUC,SAA8B,OACxCC,UAAEA,GAAcC,EAAAA,UAChBR,EAAsB,QAAdO,GACPZ,EAAWc,GAAgBC,EAAQA,cAAqBlB,IACxDmB,EAAgBC,GAAqBF,EAAQA,UAAC,GAC/CG,EAAcC,EAAAA,kBACbC,EAAmBC,GAAwBN,EAAQA,UAAC,GAErDO,EAAiB,IACdZ,EAAQa,QACXC,MAAMC,KAAKf,EAAQa,QAAQG,iBAA8B,mCACzD,GAyCNC,EAAAA,WAAU,KACR,IAAKjB,EAAQa,QAAS,OAEtB,MAAMxB,EAAQuB,IACdD,EAAqBtB,EAAMQ,OAAS,EAAE,GACrC,CAACE,IAEJ,MAAMmB,EAA+B,CACnCC,IAAKnB,EACLoB,OAAQ,IAAMb,GAAkB,GAChCc,QA1BmBC,IACnB,GAAIA,EAAEC,SAAWD,EAAEE,cAEbF,EAAEC,QACJnB,EAAavB,EAAgByC,EAAEC,aAE5B,CAEL,MAAMlC,EAAQuB,IACd,GAAqB,IAAjBvB,EAAMQ,OAAc,OACxBc,EAAqBtB,EAAMQ,OAAS,GAEpCR,EADqBD,EAAsBC,EAAOC,IAC9BmC,OACrB,GAcDC,UAjDqBJ,IACrB,GAAe,eAAXA,EAAEK,MAAoC,cAAXL,EAAEK,KAAsB,CACrD,MAAMtC,EAAQuB,IACd,GAAqB,IAAjBvB,EAAMQ,OAAc,OACPJ,EAAYJ,EAAOiC,EAAEK,KAAMrC,EAAWK,GAC9C8B,OACV,MAAUH,EAAEM,UAAuB,QAAXN,EAAEK,MACzBpB,GAAkB,EACnB,KA0C2B,WAAxBC,EAAYqB,SAAwB,CAAEC,YAnCnBR,IACvB,MAAMS,EAAelD,EAAgByC,EAAEC,QAAuB,GAC1DQ,GACF3B,EAAa2B,EACd,GAgCDC,SAAU1B,GAAkBR,IAAeY,OAAoBvB,EAAY,GAG7E,MAAO,CAAEG,YAAW4B,+BAA8B"}
1
+ {"version":3,"file":"useRovingTabIndexContainer-9aa2fbcf.js","sources":["../../src/hooks/PRIVATE_useRovingTabIndexContainer/useRovingTabIndexContainer.tsx"],"sourcesContent":["import { useState, useRef, useEffect } from 'preact/hooks';\nimport { useUser } from '../UNSAFE_useUser';\nimport { getClientHints } from '../../utils/PRIVATE_clientHints';\nimport type { ComponentChildren } from 'preact';\n\n/**\n * Utility hook for setting up roving tab indexes on children of the consuming parent container\n * For more details: https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex\n * @param isDisabled boolean flag to communicate disabled state of consumer\n * @returns id of currently focused element, and props to be spread onto the consuming element\n */\nconst useRovingTabIndexContainer = (\n isDisabled?: boolean,\n containerChildren?: ComponentChildren\n) => {\n const rootRef = useRef<HTMLDivElement | null>(null);\n const { direction } = useUser();\n const isRtl = direction === 'rtl';\n const [focusedId, setFocusedId] = useState<string | undefined>(undefined);\n const [isShiftTabbing, setIsShiftTabbing] = useState(false); // shift tabbing is tracked in order to toggle wrapper out of the tab order\n const clientHints = getClientHints();\n const [hasFocusableItems, setHasFocusableItems] = useState(false);\n\n const getRovingItems = () => {\n return rootRef.current\n ? Array.from(rootRef.current.querySelectorAll<HTMLElement>('[data-oj-roving-tabindex-item]'))\n : [];\n };\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.code === 'ArrowRight' || e.code === 'ArrowLeft') {\n const items = getRovingItems();\n if (items.length === 0) return;\n const nextItem = getNextItem(items, e.code, focusedId, isRtl);\n nextItem.focus();\n } else if (e.shiftKey && e.code === 'Tab') {\n setIsShiftTabbing(true);\n }\n };\n\n // In Safari 16 and earlier, clicking on an HTML button element does not trigger a focus(in) event,\n // and as such our handleFocus logic does not kick in and our focusedId state is never updated.\n // To work around this, we manually update the focusedId in response to mouse downs. This has been fixed in Safari 17.\n // This fix can be removed once Safari 18 is released.\n const handleMouseDown = (e: MouseEvent) => {\n const rovingItemId = getRovingItemId(e.target as HTMLElement, true);\n if (rovingItemId) {\n setFocusedId(rovingItemId);\n }\n };\n\n const handleFocus = (e: FocusEvent) => {\n if (e.target !== e.currentTarget) {\n //focus has moved to one of the roving items\n if (e.target) {\n setFocusedId(getRovingItemId(e.target as HTMLElement));\n }\n } else {\n //focus has moved to the container, and has to be passed onto the eligble item to receive focus\n const items = getRovingItems();\n if (items.length === 0) return;\n setHasFocusableItems(items.length > 0);\n const currentIndex = getCurrentRovingIndex(items, focusedId);\n items[currentIndex].focus();\n }\n };\n\n useEffect(() => {\n if (!rootRef.current) return;\n\n const items = getRovingItems();\n setHasFocusableItems(items.length > 0);\n }, [containerChildren]);\n\n const rovingTabIndexContainerProps = {\n ref: rootRef,\n onBlur: () => setIsShiftTabbing(false),\n onFocus: handleFocus,\n onKeyDown: handleKeyDown,\n ...(clientHints.browser === 'safari' && { onMouseDown: handleMouseDown }), // mouseDown handler needed for Safari 16\n tabIndex: isShiftTabbing || isDisabled || !hasFocusableItems ? undefined : 0 // tab index is needed on the container in order to pass focus to the first child\n };\n\n return { focusedId, rovingTabIndexContainerProps };\n};\n\nconst getRovingItemId = (item: Element, useClosest = false) => {\n if (useClosest) {\n const ancestor = item.closest('data-oj-roving-tabindex-item');\n if (ancestor) {\n item = ancestor;\n }\n }\n\n return item.getAttribute('data-oj-roving-tabindex-item') || undefined;\n};\n\nconst getCurrentRovingIndex = (items: HTMLElement[], focusedId: string | undefined) => {\n const currentIndex = items.findIndex((item) => getRovingItemId(item) === focusedId);\n return currentIndex === -1 ? 0 : currentIndex;\n};\n\nconst getNextItem = (\n items: HTMLElement[],\n eventCode: string,\n focusedId: string | undefined,\n isRtl: boolean\n) => {\n const currentIndex = getCurrentRovingIndex(items, focusedId);\n let nextIndex = -1;\n if ((!isRtl && eventCode === 'ArrowRight') || (isRtl && eventCode === 'ArrowLeft')) {\n nextIndex = currentIndex === items.length - 1 ? 0 : currentIndex + 1;\n }\n if ((!isRtl && eventCode === 'ArrowLeft') || (isRtl && eventCode === 'ArrowRight')) {\n nextIndex = currentIndex === 0 ? items.length - 1 : currentIndex - 1;\n }\n return items[nextIndex];\n};\n\nexport { useRovingTabIndexContainer };\n"],"names":["getRovingItemId","item","useClosest","ancestor","closest","getAttribute","undefined","getCurrentRovingIndex","items","focusedId","currentIndex","findIndex","getNextItem","eventCode","isRtl","nextIndex","length","isDisabled","containerChildren","rootRef","useRef","direction","useUser","setFocusedId","useState","isShiftTabbing","setIsShiftTabbing","clientHints","getClientHints","hasFocusableItems","setHasFocusableItems","getRovingItems","current","Array","from","querySelectorAll","useEffect","rovingTabIndexContainerProps","ref","onBlur","onFocus","e","target","currentTarget","focus","onKeyDown","code","shiftKey","browser","onMouseDown","rovingItemId","tabIndex"],"mappings":"gHAWA,MA2EMA,EAAkB,CAACC,EAAeC,GAAa,KACnD,GAAIA,EAAY,CACd,MAAMC,EAAWF,EAAKG,QAAQ,gCAC1BD,IACFF,EAAOE,EAEV,CAED,OAAOF,EAAKI,aAAa,sCAAmCC,CAAS,EAGjEC,EAAwB,CAACC,EAAsBC,KACnD,MAAMC,EAAeF,EAAMG,WAAWV,GAASD,EAAgBC,KAAUQ,IACzE,OAAyB,IAAlBC,EAAsB,EAAIA,CAAY,EAGzCE,EAAc,CAClBJ,EACAK,EACAJ,EACAK,KAEA,MAAMJ,EAAeH,EAAsBC,EAAOC,GAClD,IAAIM,GAAa,EAOjB,QANMD,GAAuB,eAAdD,GAAgCC,GAAuB,cAAdD,KACtDE,EAAYL,IAAiBF,EAAMQ,OAAS,EAAI,EAAIN,EAAe,KAE/DI,GAAuB,cAAdD,GAA+BC,GAAuB,eAAdD,KACrDE,EAA6B,IAAjBL,EAAqBF,EAAMQ,OAAS,EAAIN,EAAe,GAE9DF,EAAMO,EAAU,+BAzGU,CACjCE,EACAC,KAEA,MAAMC,EAAUC,SAA8B,OACxCC,UAAEA,GAAcC,EAAAA,UAChBR,EAAsB,QAAdO,GACPZ,EAAWc,GAAgBC,EAAQA,cAAqBlB,IACxDmB,EAAgBC,GAAqBF,EAAQA,UAAC,GAC/CG,EAAcC,EAAAA,kBACbC,EAAmBC,GAAwBN,EAAQA,UAAC,GAErDO,EAAiB,IACdZ,EAAQa,QACXC,MAAMC,KAAKf,EAAQa,QAAQG,iBAA8B,mCACzD,GAyCNC,EAAAA,WAAU,KACR,IAAKjB,EAAQa,QAAS,OAEtB,MAAMxB,EAAQuB,IACdD,EAAqBtB,EAAMQ,OAAS,EAAE,GACrC,CAACE,IAEJ,MAAMmB,EAA+B,CACnCC,IAAKnB,EACLoB,OAAQ,IAAMb,GAAkB,GAChCc,QA1BmBC,IACnB,GAAIA,EAAEC,SAAWD,EAAEE,cAEbF,EAAEC,QACJnB,EAAavB,EAAgByC,EAAEC,aAE5B,CAEL,MAAMlC,EAAQuB,IACd,GAAqB,IAAjBvB,EAAMQ,OAAc,OACxBc,EAAqBtB,EAAMQ,OAAS,GAEpCR,EADqBD,EAAsBC,EAAOC,IAC9BmC,OACrB,GAcDC,UAjDqBJ,IACrB,GAAe,eAAXA,EAAEK,MAAoC,cAAXL,EAAEK,KAAsB,CACrD,MAAMtC,EAAQuB,IACd,GAAqB,IAAjBvB,EAAMQ,OAAc,OACPJ,EAAYJ,EAAOiC,EAAEK,KAAMrC,EAAWK,GAC9C8B,OACV,MAAUH,EAAEM,UAAuB,QAAXN,EAAEK,MACzBpB,GAAkB,EACnB,KA0C2B,WAAxBC,EAAYqB,SAAwB,CAAEC,YAnCnBR,IACvB,MAAMS,EAAelD,EAAgByC,EAAEC,QAAuB,GAC1DQ,GACF3B,EAAa2B,EACd,GAgCDC,SAAU1B,GAAkBR,IAAeY,OAAoBvB,EAAY,GAG7E,MAAO,CAAEG,YAAW4B,+BAA8B"}
@@ -1,2 +1,2 @@
1
- define(['exports', 'preact/hooks', './LayerHost-1a734852', 'preact/jsx-runtime', 'preact/compat'], (function(e,t,n,o,r){"use strict";e.useScale=function(){return t.useContext(n.EnvironmentContext).scale}}));
2
- //# sourceMappingURL=useScale-404175fb.js.map
1
+ define(['exports', 'preact/hooks', './LayerHost-0b288129', 'preact/jsx-runtime', 'preact/compat'], (function(e,t,n,o,r){"use strict";e.useScale=function(){return t.useContext(n.EnvironmentContext).scale}}));
2
+ //# sourceMappingURL=useScale-04a448c3.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useScale-404175fb.js","sources":["../../src/hooks/UNSAFE_useScale/useScale.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { useContext } from 'preact/hooks';\nimport { EnvironmentContext } from '../../UNSAFE_Environment';\n\nexport function useScale() {\n return useContext(EnvironmentContext).scale;\n}\n"],"names":["useContext","EnvironmentContext","scale"],"mappings":"sJAWE,OAAOA,EAAUA,WAACC,sBAAoBC,KACxC"}
1
+ {"version":3,"file":"useScale-04a448c3.js","sources":["../../src/hooks/UNSAFE_useScale/useScale.ts"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { useContext } from 'preact/hooks';\nimport { EnvironmentContext } from '../../UNSAFE_Environment';\n\nexport function useScale() {\n return useContext(EnvironmentContext).scale;\n}\n"],"names":["useContext","EnvironmentContext","scale"],"mappings":"sJAWE,OAAOA,EAAUA,WAACC,sBAAoBC,KACxC"}