@tamagui/react-native-web-lite 1.125.6 → 1.125.8

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 (274) hide show
  1. package/dist/esm/AccessibilityInfo/index.native.js +58 -62
  2. package/dist/esm/AccessibilityInfo/index.native.js.map +1 -6
  3. package/dist/esm/ActivityIndicator/__tests__/index-test.native.js +85 -55
  4. package/dist/esm/ActivityIndicator/__tests__/index-test.native.js.map +1 -6
  5. package/dist/esm/ActivityIndicator/index.native.js +82 -90
  6. package/dist/esm/ActivityIndicator/index.native.js.map +1 -6
  7. package/dist/esm/Alert/index.native.js +14 -18
  8. package/dist/esm/Alert/index.native.js.map +1 -6
  9. package/dist/esm/AppRegistry/AppContainer.native.js +30 -26
  10. package/dist/esm/AppRegistry/AppContainer.native.js.map +1 -6
  11. package/dist/esm/AppRegistry/__tests__/index-test.native.js +13 -13
  12. package/dist/esm/AppRegistry/__tests__/index-test.native.js.map +1 -6
  13. package/dist/esm/AppRegistry/__tests__/index-test.node.native.js +45 -34
  14. package/dist/esm/AppRegistry/__tests__/index-test.node.native.js.map +1 -6
  15. package/dist/esm/AppRegistry/index.native.js +50 -55
  16. package/dist/esm/AppRegistry/index.native.js.map +1 -6
  17. package/dist/esm/AppRegistry/renderApplication.native.js +33 -27
  18. package/dist/esm/AppRegistry/renderApplication.native.js.map +1 -6
  19. package/dist/esm/AppState/__tests__/index-test.native.js +9 -10
  20. package/dist/esm/AppState/__tests__/index-test.native.js.map +1 -6
  21. package/dist/esm/AppState/index.native.js +45 -51
  22. package/dist/esm/AppState/index.native.js.map +1 -6
  23. package/dist/esm/Appearance/index.native.js +27 -24
  24. package/dist/esm/Appearance/index.native.js.map +1 -6
  25. package/dist/esm/BackHandler/index.native.js +11 -13
  26. package/dist/esm/BackHandler/index.native.js.map +1 -6
  27. package/dist/esm/Batchinator/index.native.js +19 -23
  28. package/dist/esm/Batchinator/index.native.js.map +1 -6
  29. package/dist/esm/Clipboard/index.native.js +21 -26
  30. package/dist/esm/Clipboard/index.native.js.map +1 -6
  31. package/dist/esm/DeviceEmitter.native.js +3 -5
  32. package/dist/esm/DeviceEmitter.native.js.map +1 -6
  33. package/dist/esm/DeviceInfo/index.native.js +41 -33
  34. package/dist/esm/DeviceInfo/index.native.js.map +1 -6
  35. package/dist/esm/Dimensions/__tests__/index-test.native.js +9 -8
  36. package/dist/esm/Dimensions/__tests__/index-test.native.js.map +1 -6
  37. package/dist/esm/Dimensions/index.native.js +49 -53
  38. package/dist/esm/Dimensions/index.native.js.map +1 -6
  39. package/dist/esm/FlatList.native.js +137 -131
  40. package/dist/esm/FlatList.native.js.map +1 -6
  41. package/dist/esm/I18nManager/index.native.js +10 -13
  42. package/dist/esm/I18nManager/index.native.js.map +1 -6
  43. package/dist/esm/Image/index.native.js +174 -149
  44. package/dist/esm/Image/index.native.js.map +1 -6
  45. package/dist/esm/Image/types.native.js +2 -1
  46. package/dist/esm/Image/types.native.js.map +1 -6
  47. package/dist/esm/ImageBackground/__tests__/index-test.native.js +27 -19
  48. package/dist/esm/ImageBackground/__tests__/index-test.native.js.map +1 -6
  49. package/dist/esm/ImageBackground/index.native.js +35 -33
  50. package/dist/esm/ImageBackground/index.native.js.map +1 -6
  51. package/dist/esm/InteractionManager/TaskQueue.native.js +46 -51
  52. package/dist/esm/InteractionManager/TaskQueue.native.js.map +1 -6
  53. package/dist/esm/InteractionManager/index.native.js +66 -60
  54. package/dist/esm/InteractionManager/index.native.js.map +1 -6
  55. package/dist/esm/Keyboard/index.native.js +13 -17
  56. package/dist/esm/Keyboard/index.native.js.map +1 -6
  57. package/dist/esm/KeyboardAvoidingView/index.native.js +34 -44
  58. package/dist/esm/KeyboardAvoidingView/index.native.js.map +1 -6
  59. package/dist/esm/Linking/__tests__/index-test.native.js +9 -9
  60. package/dist/esm/Linking/__tests__/index-test.native.js.map +1 -6
  61. package/dist/esm/Linking/index.native.js +42 -49
  62. package/dist/esm/Linking/index.native.js.map +1 -6
  63. package/dist/esm/LogBox/index.native.js +7 -12
  64. package/dist/esm/LogBox/index.native.js.map +1 -6
  65. package/dist/esm/Modal/ModalAnimation.native.js +89 -112
  66. package/dist/esm/Modal/ModalAnimation.native.js.map +1 -6
  67. package/dist/esm/Modal/ModalContent.native.js +52 -54
  68. package/dist/esm/Modal/ModalContent.native.js.map +1 -6
  69. package/dist/esm/Modal/ModalFocusTrap.native.js +49 -52
  70. package/dist/esm/Modal/ModalFocusTrap.native.js.map +1 -6
  71. package/dist/esm/Modal/ModalPortal.native.js +9 -11
  72. package/dist/esm/Modal/ModalPortal.native.js.map +1 -6
  73. package/dist/esm/Modal/index.native.js +53 -45
  74. package/dist/esm/Modal/index.native.js.map +1 -6
  75. package/dist/esm/NativeModules/index.native.js +5 -6
  76. package/dist/esm/NativeModules/index.native.js.map +1 -6
  77. package/dist/esm/PanResponder/Alternative.js +157 -122
  78. package/dist/esm/PanResponder/Alternative.js.map +1 -6
  79. package/dist/esm/PanResponder/index.native.js +3 -5
  80. package/dist/esm/PanResponder/index.native.js.map +1 -6
  81. package/dist/esm/PixelRatio/index.native.js +48 -59
  82. package/dist/esm/PixelRatio/index.native.js.map +1 -6
  83. package/dist/esm/Pressable/index.native.js +70 -67
  84. package/dist/esm/Pressable/index.native.js.map +1 -6
  85. package/dist/esm/RefreshControl/index.native.js +4 -6
  86. package/dist/esm/RefreshControl/index.native.js.map +1 -6
  87. package/dist/esm/SafeAreaView/index.native.js +24 -21
  88. package/dist/esm/SafeAreaView/index.native.js.map +1 -6
  89. package/dist/esm/ScrollView/ScrollViewBase.native.js +61 -50
  90. package/dist/esm/ScrollView/ScrollViewBase.native.js.map +1 -6
  91. package/dist/esm/ScrollView/index.native.js +183 -211
  92. package/dist/esm/ScrollView/index.native.js.map +1 -6
  93. package/dist/esm/Share/index.native.js +29 -36
  94. package/dist/esm/Share/index.native.js.map +1 -6
  95. package/dist/esm/StatusBar/index.native.js +3 -6
  96. package/dist/esm/StatusBar/index.native.js.map +1 -6
  97. package/dist/esm/Text/index.native.js +128 -100
  98. package/dist/esm/Text/index.native.js.map +1 -6
  99. package/dist/esm/Text/types.native.js +2 -1
  100. package/dist/esm/Text/types.native.js.map +1 -6
  101. package/dist/esm/TextInput/__tests__/index-test.native.js +445 -259
  102. package/dist/esm/TextInput/__tests__/index-test.native.js.map +1 -6
  103. package/dist/esm/TextInput/index.native.js +210 -147
  104. package/dist/esm/TextInput/index.native.js.map +1 -6
  105. package/dist/esm/TextInput/types.native.js +2 -1
  106. package/dist/esm/TextInput/types.native.js.map +1 -6
  107. package/dist/esm/TouchableOpacity.native.js +63 -67
  108. package/dist/esm/TouchableOpacity.native.js.map +1 -6
  109. package/dist/esm/TouchableWithoutFeedback.native.js +49 -45
  110. package/dist/esm/TouchableWithoutFeedback.native.js.map +1 -6
  111. package/dist/esm/UnimplementedView.native.js +22 -30
  112. package/dist/esm/UnimplementedView.native.js.map +1 -6
  113. package/dist/esm/Vibration/index.native.js +14 -14
  114. package/dist/esm/Vibration/index.native.js.map +1 -6
  115. package/dist/esm/View/index.native.js +84 -55
  116. package/dist/esm/View/index.native.js.map +1 -6
  117. package/dist/esm/View/types.native.js +2 -1
  118. package/dist/esm/View/types.native.js.map +1 -6
  119. package/dist/esm/createElement/__tests__/index-test.native.js +398 -195
  120. package/dist/esm/createElement/__tests__/index-test.native.js.map +1 -6
  121. package/dist/esm/createElement/index.native.js +18 -16
  122. package/dist/esm/createElement/index.native.js.map +1 -6
  123. package/dist/esm/createReactDOMStyle.native.js +2 -4
  124. package/dist/esm/createReactDOMStyle.native.js.map +1 -6
  125. package/dist/esm/index.native.js +47 -123
  126. package/dist/esm/index.native.js.map +1 -6
  127. package/dist/esm/render/index.native.js +6 -15
  128. package/dist/esm/render/index.native.js.map +1 -6
  129. package/dist/esm/styleTypes.native.js +2 -1
  130. package/dist/esm/styleTypes.native.js.map +1 -6
  131. package/dist/esm/types.native.js +2 -1
  132. package/dist/esm/types.native.js.map +1 -6
  133. package/dist/esm/useColorScheme/index.native.js +7 -7
  134. package/dist/esm/useColorScheme/index.native.js.map +1 -6
  135. package/dist/esm/useLocaleContext/index.native.js +2 -4
  136. package/dist/esm/useLocaleContext/index.native.js.map +1 -6
  137. package/dist/esm/useWindowDimensions/index.native.js +9 -9
  138. package/dist/esm/useWindowDimensions/index.native.js.map +1 -6
  139. package/dist/esm/vendor/react-native/Animated/Animated.native.js +16 -17
  140. package/dist/esm/vendor/react-native/Animated/Animated.native.js.map +1 -6
  141. package/dist/esm/vendor/react-native/Animated/AnimatedEvent.native.js +72 -99
  142. package/dist/esm/vendor/react-native/Animated/AnimatedEvent.native.js.map +1 -6
  143. package/dist/esm/vendor/react-native/Animated/AnimatedImplementation.native.js +465 -436
  144. package/dist/esm/vendor/react-native/Animated/AnimatedImplementation.native.js.map +1 -6
  145. package/dist/esm/vendor/react-native/Animated/AnimatedMock.native.js +97 -91
  146. package/dist/esm/vendor/react-native/Animated/AnimatedMock.native.js.map +1 -6
  147. package/dist/esm/vendor/react-native/Animated/AnimatedPlatformConfig.native.js +2 -1
  148. package/dist/esm/vendor/react-native/Animated/AnimatedPlatformConfig.native.js.map +1 -6
  149. package/dist/esm/vendor/react-native/Animated/Easing.native.js +194 -231
  150. package/dist/esm/vendor/react-native/Animated/Easing.native.js.map +1 -6
  151. package/dist/esm/vendor/react-native/Animated/NativeAnimatedHelper.native.js +206 -222
  152. package/dist/esm/vendor/react-native/Animated/NativeAnimatedHelper.native.js.map +1 -6
  153. package/dist/esm/vendor/react-native/Animated/NativeAnimatedModule.native.js +3 -5
  154. package/dist/esm/vendor/react-native/Animated/NativeAnimatedModule.native.js.map +1 -6
  155. package/dist/esm/vendor/react-native/Animated/NativeAnimatedTurboModule.native.js +3 -5
  156. package/dist/esm/vendor/react-native/Animated/NativeAnimatedTurboModule.native.js.map +1 -6
  157. package/dist/esm/vendor/react-native/Animated/SpringConfig.native.js +5 -5
  158. package/dist/esm/vendor/react-native/Animated/SpringConfig.native.js.map +1 -6
  159. package/dist/esm/vendor/react-native/Animated/animations/Animation.native.js +25 -37
  160. package/dist/esm/vendor/react-native/Animated/animations/Animation.native.js.map +1 -6
  161. package/dist/esm/vendor/react-native/Animated/animations/DecayAnimation.native.js +42 -54
  162. package/dist/esm/vendor/react-native/Animated/animations/DecayAnimation.native.js.map +1 -6
  163. package/dist/esm/vendor/react-native/Animated/animations/SpringAnimation.native.js +72 -72
  164. package/dist/esm/vendor/react-native/Animated/animations/SpringAnimation.native.js.map +1 -6
  165. package/dist/esm/vendor/react-native/Animated/animations/TimingAnimation.native.js +45 -60
  166. package/dist/esm/vendor/react-native/Animated/animations/TimingAnimation.native.js.map +1 -6
  167. package/dist/esm/vendor/react-native/Animated/bezier.native.js +23 -20
  168. package/dist/esm/vendor/react-native/Animated/bezier.native.js.map +1 -6
  169. package/dist/esm/vendor/react-native/Animated/components/AnimatedImage.native.js +4 -6
  170. package/dist/esm/vendor/react-native/Animated/components/AnimatedImage.native.js.map +1 -6
  171. package/dist/esm/vendor/react-native/Animated/components/AnimatedScrollView.native.js +12 -13
  172. package/dist/esm/vendor/react-native/Animated/components/AnimatedScrollView.native.js.map +1 -6
  173. package/dist/esm/vendor/react-native/Animated/components/AnimatedText.native.js +4 -6
  174. package/dist/esm/vendor/react-native/Animated/components/AnimatedText.native.js.map +1 -6
  175. package/dist/esm/vendor/react-native/Animated/components/AnimatedView.native.js +4 -6
  176. package/dist/esm/vendor/react-native/Animated/components/AnimatedView.native.js.map +1 -6
  177. package/dist/esm/vendor/react-native/Animated/createAnimatedComponent.native.js +17 -11
  178. package/dist/esm/vendor/react-native/Animated/createAnimatedComponent.native.js.map +1 -6
  179. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedAddition.native.js +39 -55
  180. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedAddition.native.js.map +1 -6
  181. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedColor.native.js +180 -197
  182. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedColor.native.js.map +1 -6
  183. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedDiffClamp.native.js +39 -51
  184. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedDiffClamp.native.js.map +1 -6
  185. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedDivision.native.js +42 -57
  186. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedDivision.native.js.map +1 -6
  187. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedInterpolation.native.js +99 -116
  188. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedInterpolation.native.js.map +1 -6
  189. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedModulo.native.js +37 -50
  190. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedModulo.native.js.map +1 -6
  191. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedMultiplication.native.js +39 -55
  192. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedMultiplication.native.js.map +1 -6
  193. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedNode.native.js +61 -89
  194. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedNode.native.js.map +1 -6
  195. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedProps.native.js +52 -70
  196. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedProps.native.js.map +1 -6
  197. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedStyle.native.js +50 -68
  198. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedStyle.native.js.map +1 -6
  199. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedSubtraction.native.js +39 -55
  200. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedSubtraction.native.js.map +1 -6
  201. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedTracking.native.js +41 -53
  202. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedTracking.native.js.map +1 -6
  203. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedTransform.native.js +44 -57
  204. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedTransform.native.js.map +1 -6
  205. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedValue.native.js +70 -99
  206. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedValue.native.js.map +1 -6
  207. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedValueXY.native.js +64 -82
  208. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedValueXY.native.js.map +1 -6
  209. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedWithChildren.native.js +40 -53
  210. package/dist/esm/vendor/react-native/Animated/nodes/AnimatedWithChildren.native.js.map +1 -6
  211. package/dist/esm/vendor/react-native/Animated/useAnimatedProps.native.js +50 -58
  212. package/dist/esm/vendor/react-native/Animated/useAnimatedProps.native.js.map +1 -6
  213. package/dist/esm/vendor/react-native/FeatureFlags.native.js +8 -10
  214. package/dist/esm/vendor/react-native/FeatureFlags.native.js.map +1 -6
  215. package/dist/esm/vendor/react-native/FillRateHelper/index.native.js +58 -59
  216. package/dist/esm/vendor/react-native/FillRateHelper/index.native.js.map +1 -6
  217. package/dist/esm/vendor/react-native/NativeEventEmitter/RCTDeviceEventEmitter.native.js +3 -5
  218. package/dist/esm/vendor/react-native/NativeEventEmitter/RCTDeviceEventEmitter.native.js.map +1 -6
  219. package/dist/esm/vendor/react-native/NativeEventEmitter/index.native.js +46 -55
  220. package/dist/esm/vendor/react-native/NativeEventEmitter/index.native.js.map +1 -6
  221. package/dist/esm/vendor/react-native/PanResponder/index.native.js +224 -219
  222. package/dist/esm/vendor/react-native/PanResponder/index.native.js.map +1 -6
  223. package/dist/esm/vendor/react-native/TouchHistoryMath/index.native.js +58 -81
  224. package/dist/esm/vendor/react-native/TouchHistoryMath/index.native.js.map +1 -6
  225. package/dist/esm/vendor/react-native/TurboModule/RCTExport.native.js +2 -1
  226. package/dist/esm/vendor/react-native/TurboModule/RCTExport.native.js.map +1 -6
  227. package/dist/esm/vendor/react-native/TurboModule/TurboModuleRegistry.native.js +2 -5
  228. package/dist/esm/vendor/react-native/TurboModule/TurboModuleRegistry.native.js.map +1 -6
  229. package/dist/esm/vendor/react-native/Types/CoreEventTypes.native.js +2 -1
  230. package/dist/esm/vendor/react-native/Types/CoreEventTypes.native.js.map +1 -6
  231. package/dist/esm/vendor/react-native/Utilities/clamp.native.js +2 -4
  232. package/dist/esm/vendor/react-native/Utilities/clamp.native.js.map +1 -6
  233. package/dist/esm/vendor/react-native/Utilities/setAndForwardRef.native.js +5 -6
  234. package/dist/esm/vendor/react-native/Utilities/setAndForwardRef.native.js.map +1 -6
  235. package/dist/esm/vendor/react-native/ViewabilityHelper.native.js +127 -129
  236. package/dist/esm/vendor/react-native/ViewabilityHelper.native.js.map +1 -6
  237. package/dist/esm/vendor/react-native/VirtualizeUtils/index.native.js +51 -50
  238. package/dist/esm/vendor/react-native/VirtualizeUtils/index.native.js.map +1 -6
  239. package/dist/esm/vendor/react-native/VirtualizedList/CellRenderMask.native.js +60 -73
  240. package/dist/esm/vendor/react-native/VirtualizedList/CellRenderMask.native.js.map +1 -6
  241. package/dist/esm/vendor/react-native/VirtualizedList/ChildListCollection.native.js +96 -96
  242. package/dist/esm/vendor/react-native/VirtualizedList/ChildListCollection.native.js.map +1 -6
  243. package/dist/esm/vendor/react-native/VirtualizedList/StateSafePureComponent.native.js +57 -64
  244. package/dist/esm/vendor/react-native/VirtualizedList/StateSafePureComponent.native.js.map +1 -6
  245. package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.native.js +105 -117
  246. package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.native.js.map +1 -6
  247. package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListContext.native.js +35 -37
  248. package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListContext.native.js.map +1 -6
  249. package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListProps.native.js +2 -1
  250. package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListProps.native.js.map +1 -6
  251. package/dist/esm/vendor/react-native/VirtualizedList/index.native.js +817 -760
  252. package/dist/esm/vendor/react-native/VirtualizedList/index.native.js.map +1 -6
  253. package/dist/esm/vendor/react-native/deepDiffer/index.native.js +17 -29
  254. package/dist/esm/vendor/react-native/deepDiffer/index.native.js.map +1 -6
  255. package/dist/esm/vendor/react-native/emitter/EventEmitter.native.js +3 -5
  256. package/dist/esm/vendor/react-native/emitter/EventEmitter.native.js.map +1 -6
  257. package/dist/esm/vendor/react-native/emitter/EventSubscription.native.js +2 -1
  258. package/dist/esm/vendor/react-native/emitter/EventSubscription.native.js.map +1 -6
  259. package/dist/esm/vendor/react-native/emitter/_EmitterSubscription.native.js +24 -33
  260. package/dist/esm/vendor/react-native/emitter/_EmitterSubscription.native.js.map +1 -6
  261. package/dist/esm/vendor/react-native/emitter/_EventEmitter.native.js +41 -51
  262. package/dist/esm/vendor/react-native/emitter/_EventEmitter.native.js.map +1 -6
  263. package/dist/esm/vendor/react-native/emitter/_EventSubscription.native.js +12 -16
  264. package/dist/esm/vendor/react-native/emitter/_EventSubscription.native.js.map +1 -6
  265. package/dist/esm/vendor/react-native/emitter/_EventSubscriptionVendor.native.js +21 -26
  266. package/dist/esm/vendor/react-native/emitter/_EventSubscriptionVendor.native.js.map +1 -6
  267. package/dist/esm/vendor/react-native/infoLog/index.native.js +3 -6
  268. package/dist/esm/vendor/react-native/infoLog/index.native.js.map +1 -6
  269. package/dist/esm/vendor/react-native/useRefEffect.native.js +4 -8
  270. package/dist/esm/vendor/react-native/useRefEffect.native.js.map +1 -6
  271. package/dist/esm/without-animated.native.js +51 -112
  272. package/dist/esm/without-animated.native.js.map +1 -6
  273. package/package.json +6 -6
  274. package/src/vendor/react-native/Animated/NativeAnimatedHelper.js +1 -1
@@ -10,13 +10,13 @@ function findInput(container) {
10
10
  function findTextArea(container) {
11
11
  return container.querySelector("textarea");
12
12
  }
13
- var testIfDocumentIsFocused = function(message, fn) {
14
- document.hasFocus && document.hasFocus() ? test(message, fn) : test.skip(`${message} \u2013 document is not focused`, function() {
15
- });
13
+ var testIfDocumentIsFocused = function (message, fn) {
14
+ document.hasFocus && document.hasFocus() ? test(message, fn) : test.skip(`${message} \u2013 document is not focused`, function () {});
16
15
  };
17
16
  function createEvent(type) {
18
- var data = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, event = document.createEvent("CustomEvent");
19
- return event.initCustomEvent(type, !0, !0), data != null && Object.keys(data).forEach(function(key) {
17
+ var data = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {},
18
+ event = document.createEvent("CustomEvent");
19
+ return event.initCustomEvent(type, !0, !0), data != null && Object.keys(data).forEach(function (key) {
20
20
  var value = data[key];
21
21
  key === "timeStamp" && !value || Object.defineProperty(event, key, {
22
22
  value
@@ -24,8 +24,16 @@ function createEvent(type) {
24
24
  }), event;
25
25
  }
26
26
  function createKeyboardEvent(type) {
27
- var { altKey = !1, ctrlKey = !1, isComposing = !1, key = "", keyCode = 0, metaKey = !1, preventDefault = function() {
28
- }, shiftKey = !1 } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
27
+ var {
28
+ altKey = !1,
29
+ ctrlKey = !1,
30
+ isComposing = !1,
31
+ key = "",
32
+ keyCode = 0,
33
+ metaKey = !1,
34
+ preventDefault = function () {},
35
+ shiftKey = !1
36
+ } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
29
37
  return createEvent(type, {
30
38
  altKey,
31
39
  ctrlKey,
@@ -40,185 +48,276 @@ function createKeyboardEvent(type) {
40
48
  function keydown(payload) {
41
49
  return createKeyboardEvent("keydown", payload);
42
50
  }
43
- describe("components/TextInput", function() {
44
- describe('prop "autoComplete"', function() {
45
- test('value "on"', function() {
46
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {})), input = findInput(container);
51
+ describe("components/TextInput", function () {
52
+ describe('prop "autoComplete"', function () {
53
+ test('value "on"', function () {
54
+ var {
55
+ container
56
+ } = render(/* @__PURE__ */_jsx(TextInput, {})),
57
+ input = findInput(container);
47
58
  expect(input.getAttribute("autoComplete")).toEqual("on");
48
- }), test('value "off"', function() {
49
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
50
- autoComplete: "off"
51
- })), input = findInput(container);
59
+ }), test('value "off"', function () {
60
+ var {
61
+ container
62
+ } = render(/* @__PURE__ */_jsx(TextInput, {
63
+ autoComplete: "off"
64
+ })),
65
+ input = findInput(container);
52
66
  expect(input.getAttribute("autoComplete")).toEqual("off");
53
- }), test("autoCompleteType fallback", function() {
54
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
55
- autoCompleteType: "off"
56
- })), input = findInput(container);
67
+ }), test("autoCompleteType fallback", function () {
68
+ var {
69
+ container
70
+ } = render(/* @__PURE__ */_jsx(TextInput, {
71
+ autoCompleteType: "off"
72
+ })),
73
+ input = findInput(container);
57
74
  expect(input.getAttribute("autoComplete")).toEqual("off");
58
75
  });
59
- }), describe('prop "autoFocus"', function() {
60
- test('value "false"', function() {
61
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {})), input = findInput(container);
76
+ }), describe('prop "autoFocus"', function () {
77
+ test('value "false"', function () {
78
+ var {
79
+ container
80
+ } = render(/* @__PURE__ */_jsx(TextInput, {})),
81
+ input = findInput(container);
62
82
  expect(document.activeElement).not.toBe(input);
63
- }), test('value "true"', function() {
64
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
65
- autoFocus: !0
66
- })), input = findInput(container);
83
+ }), test('value "true"', function () {
84
+ var {
85
+ container
86
+ } = render(/* @__PURE__ */_jsx(TextInput, {
87
+ autoFocus: !0
88
+ })),
89
+ input = findInput(container);
67
90
  expect(document.activeElement).toBe(input);
68
91
  });
69
- }), describe('prop "clearTextOnFocus"', function() {
92
+ }), describe('prop "clearTextOnFocus"', function () {
70
93
  var defaultValue = "defaultValue";
71
- testIfDocumentIsFocused('value "false"', function() {
72
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
73
- defaultValue
74
- })), input = findInput(container);
94
+ testIfDocumentIsFocused('value "false"', function () {
95
+ var {
96
+ container
97
+ } = render(/* @__PURE__ */_jsx(TextInput, {
98
+ defaultValue
99
+ })),
100
+ input = findInput(container);
75
101
  input.focus(), expect(input.node.value).toEqual(defaultValue);
76
- }), testIfDocumentIsFocused('value "true"', function() {
77
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
78
- clearTextOnFocus: !0,
79
- defaultValue
80
- })), input = findInput(container);
102
+ }), testIfDocumentIsFocused('value "true"', function () {
103
+ var {
104
+ container
105
+ } = render(/* @__PURE__ */_jsx(TextInput, {
106
+ clearTextOnFocus: !0,
107
+ defaultValue
108
+ })),
109
+ input = findInput(container);
81
110
  input.focus(), expect(input.node.value).toEqual("");
82
111
  });
83
- }), test('prop "defaultValue"', function() {
84
- var defaultValue = "defaultValue", { container } = render(/* @__PURE__ */ _jsx(TextInput, {
85
- defaultValue
86
- })), input = findInput(container);
112
+ }), test('prop "defaultValue"', function () {
113
+ var defaultValue = "defaultValue",
114
+ {
115
+ container
116
+ } = render(/* @__PURE__ */_jsx(TextInput, {
117
+ defaultValue
118
+ })),
119
+ input = findInput(container);
87
120
  expect(input.value).toEqual(defaultValue);
88
- }), describe('prop "disabled"', function() {
89
- test('value "false"', function() {
90
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {})), input = findInput(container);
121
+ }), describe('prop "disabled"', function () {
122
+ test('value "false"', function () {
123
+ var {
124
+ container
125
+ } = render(/* @__PURE__ */_jsx(TextInput, {})),
126
+ input = findInput(container);
91
127
  expect(input.disabled).toEqual(!1);
92
- }), test('value "true"', function() {
93
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
94
- disabled: !0
95
- })), input = findInput(container);
128
+ }), test('value "true"', function () {
129
+ var {
130
+ container
131
+ } = render(/* @__PURE__ */_jsx(TextInput, {
132
+ disabled: !0
133
+ })),
134
+ input = findInput(container);
96
135
  expect(input.disabled).toEqual(!0);
97
136
  });
98
- }), describe('prop "editable"', function() {
99
- test('value "true"', function() {
100
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {})), input = findInput(container);
137
+ }), describe('prop "editable"', function () {
138
+ test('value "true"', function () {
139
+ var {
140
+ container
141
+ } = render(/* @__PURE__ */_jsx(TextInput, {})),
142
+ input = findInput(container);
101
143
  expect(input.readOnly).toEqual(!1);
102
- }), test('value "false"', function() {
103
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
104
- editable: !1
105
- })), input = findInput(container);
144
+ }), test('value "false"', function () {
145
+ var {
146
+ container
147
+ } = render(/* @__PURE__ */_jsx(TextInput, {
148
+ editable: !1
149
+ })),
150
+ input = findInput(container);
106
151
  expect(input.readOnly).toEqual(!0);
107
152
  });
108
- }), describe('prop "keyboardType"', function() {
109
- test("default value", function() {
110
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
111
- keyboardType: "default"
112
- })), input = findInput(container);
153
+ }), describe('prop "keyboardType"', function () {
154
+ test("default value", function () {
155
+ var {
156
+ container
157
+ } = render(/* @__PURE__ */_jsx(TextInput, {
158
+ keyboardType: "default"
159
+ })),
160
+ input = findInput(container);
113
161
  expect(input.type).toEqual("text");
114
- }), test('value "email-address"', function() {
115
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
116
- keyboardType: "email-address"
117
- })), input = findInput(container);
162
+ }), test('value "email-address"', function () {
163
+ var {
164
+ container
165
+ } = render(/* @__PURE__ */_jsx(TextInput, {
166
+ keyboardType: "email-address"
167
+ })),
168
+ input = findInput(container);
118
169
  expect(input.type).toEqual("email");
119
- }), test('value "decimal-pad"', function() {
120
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
121
- keyboardType: "decimal-pad"
122
- })), input = findInput(container);
170
+ }), test('value "decimal-pad"', function () {
171
+ var {
172
+ container
173
+ } = render(/* @__PURE__ */_jsx(TextInput, {
174
+ keyboardType: "decimal-pad"
175
+ })),
176
+ input = findInput(container);
123
177
  expect(input.inputMode).toEqual("decimal");
124
- }), test('value "number-pad"', function() {
125
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
126
- keyboardType: "number-pad"
127
- })), input = findInput(container);
178
+ }), test('value "number-pad"', function () {
179
+ var {
180
+ container
181
+ } = render(/* @__PURE__ */_jsx(TextInput, {
182
+ keyboardType: "number-pad"
183
+ })),
184
+ input = findInput(container);
128
185
  expect(input.inputMode).toEqual("numeric");
129
- }), test('value "numeric"', function() {
130
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
131
- keyboardType: "numeric"
132
- })), input = findInput(container);
186
+ }), test('value "numeric"', function () {
187
+ var {
188
+ container
189
+ } = render(/* @__PURE__ */_jsx(TextInput, {
190
+ keyboardType: "numeric"
191
+ })),
192
+ input = findInput(container);
133
193
  expect(input.inputMode).toEqual("numeric");
134
- }), test('value "phone-pad"', function() {
135
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
136
- keyboardType: "phone-pad"
137
- })), input = findInput(container);
194
+ }), test('value "phone-pad"', function () {
195
+ var {
196
+ container
197
+ } = render(/* @__PURE__ */_jsx(TextInput, {
198
+ keyboardType: "phone-pad"
199
+ })),
200
+ input = findInput(container);
138
201
  expect(input.type).toEqual("tel");
139
- }), test('value "url"', function() {
140
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
141
- keyboardType: "url"
142
- })), input = findInput(container);
202
+ }), test('value "url"', function () {
203
+ var {
204
+ container
205
+ } = render(/* @__PURE__ */_jsx(TextInput, {
206
+ keyboardType: "url"
207
+ })),
208
+ input = findInput(container);
143
209
  expect(input.type).toEqual("url");
144
210
  });
145
- }), test('prop "maxLength"', function() {
146
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {})), input = findInput(container);
147
- expect(input.getAttribute("maxLength")).toEqual(null), { container } = render(/* @__PURE__ */ _jsx(TextInput, {
211
+ }), test('prop "maxLength"', function () {
212
+ var {
213
+ container
214
+ } = render(/* @__PURE__ */_jsx(TextInput, {})),
215
+ input = findInput(container);
216
+ expect(input.getAttribute("maxLength")).toEqual(null), {
217
+ container
218
+ } = render(/* @__PURE__ */_jsx(TextInput, {
148
219
  maxLength: 10
149
220
  })), input = findInput(container), expect(input.getAttribute("maxLength")).toEqual("10");
150
- }), describe('prop "multiline"', function() {
151
- test('value "false"', function() {
152
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {})), input = findInput(container);
221
+ }), describe('prop "multiline"', function () {
222
+ test('value "false"', function () {
223
+ var {
224
+ container
225
+ } = render(/* @__PURE__ */_jsx(TextInput, {})),
226
+ input = findInput(container);
153
227
  expect(input).toBeDefined();
154
- }), test('value "true"', function() {
155
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
156
- multiline: !0
157
- })), textarea = findTextArea(container);
228
+ }), test('value "true"', function () {
229
+ var {
230
+ container
231
+ } = render(/* @__PURE__ */_jsx(TextInput, {
232
+ multiline: !0
233
+ })),
234
+ textarea = findTextArea(container);
158
235
  expect(textarea).toBeDefined();
159
236
  });
160
- }), describe('prop "numberOfLines"', function() {
161
- test('without "multiline"', function() {
162
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
163
- numberOfLines: 2
164
- })), input = findInput(container), textarea = findTextArea(container);
237
+ }), describe('prop "numberOfLines"', function () {
238
+ test('without "multiline"', function () {
239
+ var {
240
+ container
241
+ } = render(/* @__PURE__ */_jsx(TextInput, {
242
+ numberOfLines: 2
243
+ })),
244
+ input = findInput(container),
245
+ textarea = findTextArea(container);
165
246
  expect(input).toBeDefined(), expect(textarea).toBeNull();
166
- }), test('with "multiline"', function() {
167
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
168
- multiline: !0,
169
- numberOfLines: 3
170
- })), textarea = findTextArea(container);
247
+ }), test('with "multiline"', function () {
248
+ var {
249
+ container
250
+ } = render(/* @__PURE__ */_jsx(TextInput, {
251
+ multiline: !0,
252
+ numberOfLines: 3
253
+ })),
254
+ textarea = findTextArea(container);
171
255
  expect(textarea.getAttribute("rows")).toEqual("3");
172
256
  });
173
- }), test('prop "onBlur"', function() {
174
- var onBlur = jest.fn(), ref = /* @__PURE__ */ React.createRef();
175
- act(function() {
176
- render(/* @__PURE__ */ _jsx(TextInput, {
257
+ }), test('prop "onBlur"', function () {
258
+ var onBlur = jest.fn(),
259
+ ref = /* @__PURE__ */React.createRef();
260
+ act(function () {
261
+ render(/* @__PURE__ */_jsx(TextInput, {
177
262
  onBlur,
178
263
  ref
179
264
  }));
180
265
  });
181
- var target = createEventTarget(ref.current), body = createEventTarget(document.body);
182
- act(function() {
266
+ var target = createEventTarget(ref.current),
267
+ body = createEventTarget(document.body);
268
+ act(function () {
183
269
  target.focus(), body.focus({
184
270
  relatedTarget: target.node
185
271
  });
186
272
  }), expect(onBlur).toHaveBeenCalledTimes(1), expect(TextInput.State.currentlyFocusedField()).toBe(null);
187
- }), test.skip('prop "onChange"', function() {
188
- var onChange = jest.fn(), { container } = render(/* @__PURE__ */ _jsx(TextInput, {
189
- onChange
190
- })), input = findInput(container);
273
+ }), test.skip('prop "onChange"', function () {
274
+ var onChange = jest.fn(),
275
+ {
276
+ container
277
+ } = render(/* @__PURE__ */_jsx(TextInput, {
278
+ onChange
279
+ })),
280
+ input = findInput(container);
191
281
  input.dispatchEvent(new window.Event("change", {
192
282
  bubbles: !0
193
283
  })), expect(onChange).toHaveBeenCalledTimes(1);
194
- }), test.skip('prop "onChangeText"', function() {
195
- var onChangeText = jest.fn(), { container } = render(/* @__PURE__ */ _jsx(TextInput, {
196
- onChangeText
197
- })), input = findInput(container);
284
+ }), test.skip('prop "onChangeText"', function () {
285
+ var onChangeText = jest.fn(),
286
+ {
287
+ container
288
+ } = render(/* @__PURE__ */_jsx(TextInput, {
289
+ onChangeText
290
+ })),
291
+ input = findInput(container);
198
292
  input.dispatchEvent(keydown({
199
293
  key: "a"
200
294
  })), input.dispatchEvent(new window.Event("change", {
201
295
  bubbles: !0
202
296
  })), expect(onChangeText).toHaveBeenCalledTimes(1), expect(onChangeText).toBeCalledWith("a");
203
- }), test('prop "onFocus"', function() {
204
- var onFocus = jest.fn(), ref = /* @__PURE__ */ React.createRef();
205
- act(function() {
206
- render(/* @__PURE__ */ _jsx(TextInput, {
297
+ }), test('prop "onFocus"', function () {
298
+ var onFocus = jest.fn(),
299
+ ref = /* @__PURE__ */React.createRef();
300
+ act(function () {
301
+ render(/* @__PURE__ */_jsx(TextInput, {
207
302
  onFocus,
208
303
  ref
209
304
  }));
210
305
  });
211
306
  var target = createEventTarget(ref.current);
212
- act(function() {
307
+ act(function () {
213
308
  target.focus();
214
309
  }), expect(onFocus).toHaveBeenCalledTimes(1), target.node.focus(), expect(TextInput.State.currentlyFocusedField()).toBe(target.node);
215
- }), describe('prop "onKeyPress"', function() {
216
- test("arrow key", function() {
217
- var onKeyPress = jest.fn(function(e) {
218
- e.persist();
219
- }), { container } = render(/* @__PURE__ */ _jsx(TextInput, {
220
- onKeyPress
221
- })), input = findInput(container);
310
+ }), describe('prop "onKeyPress"', function () {
311
+ test("arrow key", function () {
312
+ var onKeyPress = jest.fn(function (e) {
313
+ e.persist();
314
+ }),
315
+ {
316
+ container
317
+ } = render(/* @__PURE__ */_jsx(TextInput, {
318
+ onKeyPress
319
+ })),
320
+ input = findInput(container);
222
321
  input.dispatchEvent(keydown({
223
322
  key: "ArrowLeft"
224
323
  })), expect(onKeyPress).toHaveBeenCalledTimes(1), expect(onKeyPress).toBeCalledWith(expect.objectContaining({
@@ -231,12 +330,16 @@ describe("components/TextInput", function() {
231
330
  target: expect.anything()
232
331
  })
233
332
  }));
234
- }), test("backspace key", function() {
235
- var onKeyPress = jest.fn(function(e) {
236
- e.persist();
237
- }), { container } = render(/* @__PURE__ */ _jsx(TextInput, {
238
- onKeyPress
239
- })), input = findInput(container);
333
+ }), test("backspace key", function () {
334
+ var onKeyPress = jest.fn(function (e) {
335
+ e.persist();
336
+ }),
337
+ {
338
+ container
339
+ } = render(/* @__PURE__ */_jsx(TextInput, {
340
+ onKeyPress
341
+ })),
342
+ input = findInput(container);
240
343
  input.dispatchEvent(keydown({
241
344
  key: "Backspace"
242
345
  })), expect(onKeyPress).toHaveBeenCalledTimes(1), expect(onKeyPress).toBeCalledWith(expect.objectContaining({
@@ -249,12 +352,16 @@ describe("components/TextInput", function() {
249
352
  target: expect.anything()
250
353
  })
251
354
  }));
252
- }), test("enter key", function() {
253
- var onKeyPress = jest.fn(function(e) {
254
- e.persist();
255
- }), { container } = render(/* @__PURE__ */ _jsx(TextInput, {
256
- onKeyPress
257
- })), input = findInput(container);
355
+ }), test("enter key", function () {
356
+ var onKeyPress = jest.fn(function (e) {
357
+ e.persist();
358
+ }),
359
+ {
360
+ container
361
+ } = render(/* @__PURE__ */_jsx(TextInput, {
362
+ onKeyPress
363
+ })),
364
+ input = findInput(container);
258
365
  input.dispatchEvent(keydown({
259
366
  key: "Enter"
260
367
  })), expect(onKeyPress).toHaveBeenCalledTimes(1), expect(onKeyPress).toBeCalledWith(expect.objectContaining({
@@ -267,12 +374,16 @@ describe("components/TextInput", function() {
267
374
  target: expect.anything()
268
375
  })
269
376
  }));
270
- }), test("escape key", function() {
271
- var onKeyPress = jest.fn(function(e) {
272
- e.persist();
273
- }), { container } = render(/* @__PURE__ */ _jsx(TextInput, {
274
- onKeyPress
275
- })), input = findInput(container);
377
+ }), test("escape key", function () {
378
+ var onKeyPress = jest.fn(function (e) {
379
+ e.persist();
380
+ }),
381
+ {
382
+ container
383
+ } = render(/* @__PURE__ */_jsx(TextInput, {
384
+ onKeyPress
385
+ })),
386
+ input = findInput(container);
276
387
  input.dispatchEvent(keydown({
277
388
  key: "Escape"
278
389
  })), expect(onKeyPress).toHaveBeenCalledTimes(1), expect(onKeyPress).toBeCalledWith(expect.objectContaining({
@@ -285,12 +396,16 @@ describe("components/TextInput", function() {
285
396
  target: expect.anything()
286
397
  })
287
398
  }));
288
- }), test("space key", function() {
289
- var onKeyPress = jest.fn(function(e) {
290
- e.persist();
291
- }), { container } = render(/* @__PURE__ */ _jsx(TextInput, {
292
- onKeyPress
293
- })), input = findInput(container);
399
+ }), test("space key", function () {
400
+ var onKeyPress = jest.fn(function (e) {
401
+ e.persist();
402
+ }),
403
+ {
404
+ container
405
+ } = render(/* @__PURE__ */_jsx(TextInput, {
406
+ onKeyPress
407
+ })),
408
+ input = findInput(container);
294
409
  input.dispatchEvent(keydown({
295
410
  key: " "
296
411
  })), expect(onKeyPress).toHaveBeenCalledTimes(1), expect(onKeyPress).toBeCalledWith(expect.objectContaining({
@@ -303,12 +418,16 @@ describe("components/TextInput", function() {
303
418
  target: expect.anything()
304
419
  })
305
420
  }));
306
- }), test("tab key", function() {
307
- var onKeyPress = jest.fn(function(e) {
308
- e.persist();
309
- }), { container } = render(/* @__PURE__ */ _jsx(TextInput, {
310
- onKeyPress
311
- })), input = findInput(container);
421
+ }), test("tab key", function () {
422
+ var onKeyPress = jest.fn(function (e) {
423
+ e.persist();
424
+ }),
425
+ {
426
+ container
427
+ } = render(/* @__PURE__ */_jsx(TextInput, {
428
+ onKeyPress
429
+ })),
430
+ input = findInput(container);
312
431
  input.dispatchEvent(keydown({
313
432
  key: "Tab"
314
433
  })), expect(onKeyPress).toHaveBeenCalledTimes(1), expect(onKeyPress).toBeCalledWith(expect.objectContaining({
@@ -321,12 +440,16 @@ describe("components/TextInput", function() {
321
440
  target: expect.anything()
322
441
  })
323
442
  }));
324
- }), test("text key", function() {
325
- var onKeyPress = jest.fn(function(e) {
326
- e.persist();
327
- }), { container } = render(/* @__PURE__ */ _jsx(TextInput, {
328
- onKeyPress
329
- })), input = findInput(container);
443
+ }), test("text key", function () {
444
+ var onKeyPress = jest.fn(function (e) {
445
+ e.persist();
446
+ }),
447
+ {
448
+ container
449
+ } = render(/* @__PURE__ */_jsx(TextInput, {
450
+ onKeyPress
451
+ })),
452
+ input = findInput(container);
330
453
  input.dispatchEvent(keydown({
331
454
  key: "a"
332
455
  })), expect(onKeyPress).toHaveBeenCalledTimes(1), expect(onKeyPress).toBeCalledWith(expect.objectContaining({
@@ -339,12 +462,16 @@ describe("components/TextInput", function() {
339
462
  target: expect.anything()
340
463
  })
341
464
  }));
342
- }), test("modifier keys are included", function() {
343
- var onKeyPress = jest.fn(function(e) {
344
- e.persist();
345
- }), { container } = render(/* @__PURE__ */ _jsx(TextInput, {
346
- onKeyPress
347
- })), input = findInput(container);
465
+ }), test("modifier keys are included", function () {
466
+ var onKeyPress = jest.fn(function (e) {
467
+ e.persist();
468
+ }),
469
+ {
470
+ container
471
+ } = render(/* @__PURE__ */_jsx(TextInput, {
472
+ onKeyPress
473
+ })),
474
+ input = findInput(container);
348
475
  input.dispatchEvent(keydown({
349
476
  altKey: !0,
350
477
  ctrlKey: !0,
@@ -361,52 +488,70 @@ describe("components/TextInput", function() {
361
488
  target: expect.anything()
362
489
  })
363
490
  }));
364
- }), test('meta key + Enter calls "onKeyPress"', function() {
365
- var onKeyPress = jest.fn(function(e) {
366
- e.persist();
367
- }), { container } = render(/* @__PURE__ */ _jsx(TextInput, {
368
- onKeyPress
369
- })), input = findInput(container);
491
+ }), test('meta key + Enter calls "onKeyPress"', function () {
492
+ var onKeyPress = jest.fn(function (e) {
493
+ e.persist();
494
+ }),
495
+ {
496
+ container
497
+ } = render(/* @__PURE__ */_jsx(TextInput, {
498
+ onKeyPress
499
+ })),
500
+ input = findInput(container);
370
501
  input.dispatchEvent(keydown({
371
502
  metaKey: !0,
372
503
  key: "Enter"
373
504
  })), expect(onKeyPress).toHaveBeenCalledTimes(1);
374
505
  });
375
- }), describe('prop "onSelectionChange"', function() {
376
- test("is called on select", function() {
377
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
378
- defaultValue: "12345",
379
- onSelectionChange
380
- })), input = findInput(container);
506
+ }), describe('prop "onSelectionChange"', function () {
507
+ test("is called on select", function () {
508
+ var {
509
+ container
510
+ } = render(/* @__PURE__ */_jsx(TextInput, {
511
+ defaultValue: "12345",
512
+ onSelectionChange
513
+ })),
514
+ input = findInput(container);
381
515
  input.selectionStart = 0, input.selectionEnd = 3, input.dispatchEvent(new window.Event("select", {}));
382
516
  function onSelectionChange(e) {
383
517
  expect(e.nativeEvent.selection.end).toEqual(3), expect(e.nativeEvent.selection.start).toEqual(0);
384
518
  }
385
- }), test.skip("is called on change", function() {
386
- var onSelectionChange = jest.fn(), { container } = render(/* @__PURE__ */ _jsx(TextInput, {
387
- onSelectionChange
388
- })), input = findInput(container);
519
+ }), test.skip("is called on change", function () {
520
+ var onSelectionChange = jest.fn(),
521
+ {
522
+ container
523
+ } = render(/* @__PURE__ */_jsx(TextInput, {
524
+ onSelectionChange
525
+ })),
526
+ input = findInput(container);
389
527
  input.dispatchEvent(new window.Event("input", {
390
528
  bubbles: !0
391
529
  })), expect(onSelectionChange).toHaveBeenCalledTimes(1);
392
530
  });
393
- }), describe('prop "onSubmitEditing"', function() {
394
- test("single-line input", function(done) {
395
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
396
- defaultValue: "12345",
397
- onSubmitEditing
398
- })), input = findInput(container);
531
+ }), describe('prop "onSubmitEditing"', function () {
532
+ test("single-line input", function (done) {
533
+ var {
534
+ container
535
+ } = render(/* @__PURE__ */_jsx(TextInput, {
536
+ defaultValue: "12345",
537
+ onSubmitEditing
538
+ })),
539
+ input = findInput(container);
399
540
  input.dispatchEvent(keydown({
400
541
  key: "Enter"
401
542
  }));
402
543
  function onSubmitEditing(e) {
403
544
  expect(e.nativeEvent.target).toBeDefined(), expect(e.nativeEvent.text).toBe("12345"), done();
404
545
  }
405
- }), test("single-line input while composing", function() {
406
- var onSubmitEditing = jest.fn(), { container } = render(/* @__PURE__ */ _jsx(TextInput, {
407
- defaultValue: "12345",
408
- onSubmitEditing
409
- })), input = findInput(container);
546
+ }), test("single-line input while composing", function () {
547
+ var onSubmitEditing = jest.fn(),
548
+ {
549
+ container
550
+ } = render(/* @__PURE__ */_jsx(TextInput, {
551
+ defaultValue: "12345",
552
+ onSubmitEditing
553
+ })),
554
+ input = findInput(container);
410
555
  input.dispatchEvent(keydown({
411
556
  key: "Enter",
412
557
  isComposing: !0,
@@ -416,22 +561,31 @@ describe("components/TextInput", function() {
416
561
  isComposing: !1,
417
562
  keyCode: 229
418
563
  })), expect(onSubmitEditing).not.toHaveBeenCalled();
419
- }), test("multi-line input", function() {
420
- var onSubmitEditing = jest.fn(), { container } = render(/* @__PURE__ */ _jsx(TextInput, {
421
- defaultValue: "12345",
422
- multiline: !0,
423
- onSubmitEditing
424
- })), textarea = findTextArea(container);
564
+ }), test("multi-line input", function () {
565
+ var onSubmitEditing = jest.fn(),
566
+ {
567
+ container
568
+ } = render(/* @__PURE__ */_jsx(TextInput, {
569
+ defaultValue: "12345",
570
+ multiline: !0,
571
+ onSubmitEditing
572
+ })),
573
+ textarea = findTextArea(container);
425
574
  textarea.dispatchEvent(keydown({
426
575
  key: "Enter"
427
576
  })), expect(onSubmitEditing).not.toHaveBeenCalled();
428
- }), test('multi-line input with "blurOnSubmit" triggers "onSubmitEditing"', function() {
429
- var onSubmitEditing = jest.fn(), preventDefault = jest.fn(), { container } = render(/* @__PURE__ */ _jsx(TextInput, {
430
- blurOnSubmit: !0,
431
- defaultValue: "12345",
432
- multiline: !0,
433
- onSubmitEditing
434
- })), textarea = findTextArea(container);
577
+ }), test('multi-line input with "blurOnSubmit" triggers "onSubmitEditing"', function () {
578
+ var onSubmitEditing = jest.fn(),
579
+ preventDefault = jest.fn(),
580
+ {
581
+ container
582
+ } = render(/* @__PURE__ */_jsx(TextInput, {
583
+ blurOnSubmit: !0,
584
+ defaultValue: "12345",
585
+ multiline: !0,
586
+ onSubmitEditing
587
+ })),
588
+ textarea = findTextArea(container);
435
589
  textarea.dispatchEvent(keydown({
436
590
  key: "Enter",
437
591
  preventDefault,
@@ -443,75 +597,107 @@ describe("components/TextInput", function() {
443
597
  preventDefault
444
598
  })), expect(onSubmitEditing).toHaveBeenCalledTimes(1), expect(preventDefault).toHaveBeenCalledTimes(1);
445
599
  });
446
- }), test('prop "returnKeyType"', function() {
447
- var returnKeyType = "previous", { container } = render(/* @__PURE__ */ _jsx(TextInput, {
448
- returnKeyType
449
- })), input = findInput(container);
600
+ }), test('prop "returnKeyType"', function () {
601
+ var returnKeyType = "previous",
602
+ {
603
+ container
604
+ } = render(/* @__PURE__ */_jsx(TextInput, {
605
+ returnKeyType
606
+ })),
607
+ input = findInput(container);
450
608
  expect(input.getAttribute("enterkeyhint")).toEqual(returnKeyType);
451
- }), test('prop "secureTextEntry"', function() {
452
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
453
- secureTextEntry: !0
454
- })), input = findInput(container);
455
- expect(input.getAttribute("type")).toEqual("password"), { container } = render(/* @__PURE__ */ _jsx(TextInput, {
609
+ }), test('prop "secureTextEntry"', function () {
610
+ var {
611
+ container
612
+ } = render(/* @__PURE__ */_jsx(TextInput, {
613
+ secureTextEntry: !0
614
+ })),
615
+ input = findInput(container);
616
+ expect(input.getAttribute("type")).toEqual("password"), {
617
+ container
618
+ } = render(/* @__PURE__ */_jsx(TextInput, {
456
619
  multiline: !0,
457
620
  secureTextEntry: !0
458
621
  }));
459
622
  var textarea = findTextArea(container);
460
623
  expect(textarea.getAttribute("type")).toEqual(null);
461
- }), describe('prop "selectTextOnFocus"', function() {
462
- testIfDocumentIsFocused('value "false"', function() {
463
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
464
- defaultValue: "text"
465
- })), input = findInput(container);
624
+ }), describe('prop "selectTextOnFocus"', function () {
625
+ testIfDocumentIsFocused('value "false"', function () {
626
+ var {
627
+ container
628
+ } = render(/* @__PURE__ */_jsx(TextInput, {
629
+ defaultValue: "text"
630
+ })),
631
+ input = findInput(container);
466
632
  input.focus(), expect(input.selectionEnd).toEqual(4), expect(input.selectionStart).toEqual(4);
467
633
  });
468
- }), describe('prop "selection"', function() {
469
- test("set cursor location", function() {
634
+ }), describe('prop "selection"', function () {
635
+ test("set cursor location", function () {
470
636
  var cursorLocation = {
471
- start: 3,
472
- end: 3
473
- }, { container: defaultContainer } = render(/* @__PURE__ */ _jsx(TextInput, {
474
- defaultValue: "12345"
475
- })), inputDefaultSelection = findInput(defaultContainer);
637
+ start: 3,
638
+ end: 3
639
+ },
640
+ {
641
+ container: defaultContainer
642
+ } = render(/* @__PURE__ */_jsx(TextInput, {
643
+ defaultValue: "12345"
644
+ })),
645
+ inputDefaultSelection = findInput(defaultContainer);
476
646
  expect(inputDefaultSelection.selectionStart).toEqual(5), expect(inputDefaultSelection.selectionEnd).toEqual(5);
477
- var { container: customContainer } = render(/* @__PURE__ */ _jsx(TextInput, {
478
- defaultValue: "12345",
479
- selection: cursorLocation
480
- })), inputCustomSelection = findInput(customContainer);
647
+ var {
648
+ container: customContainer
649
+ } = render(/* @__PURE__ */_jsx(TextInput, {
650
+ defaultValue: "12345",
651
+ selection: cursorLocation
652
+ })),
653
+ inputCustomSelection = findInput(customContainer);
481
654
  expect(inputCustomSelection.selectionStart).toEqual(cursorLocation.start), expect(inputCustomSelection.selectionEnd).toEqual(cursorLocation.end);
482
655
  });
483
- }), describe('prop "spellCheck"', function() {
484
- test("default value", function() {
485
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {})), input = findInput(container);
656
+ }), describe('prop "spellCheck"', function () {
657
+ test("default value", function () {
658
+ var {
659
+ container
660
+ } = render(/* @__PURE__ */_jsx(TextInput, {})),
661
+ input = findInput(container);
486
662
  expect(input.getAttribute("spellCheck")).toEqual("true");
487
- }), test('inherit from "autoCorrect"', function() {
488
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
489
- autoCorrect: !1
490
- })), input = findInput(container);
663
+ }), test('inherit from "autoCorrect"', function () {
664
+ var {
665
+ container
666
+ } = render(/* @__PURE__ */_jsx(TextInput, {
667
+ autoCorrect: !1
668
+ })),
669
+ input = findInput(container);
491
670
  expect(input.getAttribute("spellCheck")).toEqual("false");
492
- }), test('value "false"', function() {
493
- var { container } = render(/* @__PURE__ */ _jsx(TextInput, {
494
- spellCheck: !1
495
- })), input = findInput(container);
671
+ }), test('value "false"', function () {
672
+ var {
673
+ container
674
+ } = render(/* @__PURE__ */_jsx(TextInput, {
675
+ spellCheck: !1
676
+ })),
677
+ input = findInput(container);
496
678
  expect(input.getAttribute("spellCheck")).toEqual("false");
497
679
  });
498
- }), test('prop "value"', function() {
499
- var value = "value", { container } = render(/* @__PURE__ */ _jsx(TextInput, {
500
- value
501
- })), input = findInput(container);
680
+ }), test('prop "value"', function () {
681
+ var value = "value",
682
+ {
683
+ container
684
+ } = render(/* @__PURE__ */_jsx(TextInput, {
685
+ value
686
+ })),
687
+ input = findInput(container);
502
688
  expect(input.value).toEqual(value);
503
- }), describe("imperative methods", function() {
504
- test("node.clear()", function() {
505
- var ref = /* @__PURE__ */ React.createRef();
506
- render(/* @__PURE__ */ _jsx(TextInput, {
689
+ }), describe("imperative methods", function () {
690
+ test("node.clear()", function () {
691
+ var ref = /* @__PURE__ */React.createRef();
692
+ render(/* @__PURE__ */_jsx(TextInput, {
507
693
  ref
508
694
  })), expect(typeof ref.current.clear).toBe("function");
509
- }), test("node.isFocused()", function() {
510
- var ref = /* @__PURE__ */ React.createRef();
511
- render(/* @__PURE__ */ _jsx(TextInput, {
695
+ }), test("node.isFocused()", function () {
696
+ var ref = /* @__PURE__ */React.createRef();
697
+ render(/* @__PURE__ */_jsx(TextInput, {
512
698
  ref
513
699
  })), expect(typeof ref.current.isFocused).toBe("function");
514
700
  });
515
701
  });
516
702
  });
517
- //# sourceMappingURL=index-test.js.map
703
+ //# sourceMappingURL=index-test.native.js.map