@draftbit/core 48.4.8-f6d6b8.2 → 48.4.8-fa5021.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 (298) hide show
  1. package/lib/typescript/tsconfig.tsbuildinfo +1 -1
  2. package/package.json +3 -3
  3. package/src/Provider.js +10 -0
  4. package/src/Provider.js.map +1 -0
  5. package/src/components/AccordionGroup.js +45 -0
  6. package/src/components/AccordionGroup.js.map +1 -0
  7. package/src/components/ActionSheet/ActionSheet.js +46 -0
  8. package/src/components/ActionSheet/ActionSheet.js.map +1 -0
  9. package/src/components/ActionSheet/ActionSheetCancel.js +7 -0
  10. package/src/components/ActionSheet/ActionSheetCancel.js.map +1 -0
  11. package/src/components/ActionSheet/ActionSheetItem.js +31 -0
  12. package/src/components/ActionSheet/ActionSheetItem.js.map +1 -0
  13. package/src/components/ActionSheet/index.js +4 -0
  14. package/src/components/ActionSheet/index.js.map +1 -0
  15. package/src/components/AspectRatio.js +19 -0
  16. package/src/components/AspectRatio.js.map +1 -0
  17. package/src/components/BottomSheet/BottomSheet.js +72 -0
  18. package/src/components/BottomSheet/BottomSheet.js.map +1 -0
  19. package/src/components/BottomSheet/BottomSheetComponent.js +438 -0
  20. package/src/components/BottomSheet/BottomSheetComponent.js.map +1 -0
  21. package/src/components/BottomSheet/index.js +2 -0
  22. package/src/components/BottomSheet/index.js.map +1 -0
  23. package/src/components/Button.js +121 -0
  24. package/src/components/Button.js.map +1 -0
  25. package/src/components/Checkbox/Checkbox.js +63 -0
  26. package/src/components/Checkbox/Checkbox.js.map +1 -0
  27. package/src/components/Checkbox/CheckboxGroupRow.js +77 -0
  28. package/src/components/Checkbox/CheckboxGroupRow.js.map +1 -0
  29. package/src/components/Checkbox/CheckboxRow.js +78 -0
  30. package/src/components/Checkbox/CheckboxRow.js.map +1 -0
  31. package/src/components/Checkbox/context.js +15 -0
  32. package/src/components/Checkbox/context.js.map +1 -0
  33. package/src/components/Checkbox/index.js +3 -0
  34. package/src/components/Checkbox/index.js.map +1 -0
  35. package/src/components/Config.js +65 -0
  36. package/src/components/Config.js.map +1 -0
  37. package/src/components/DatePicker/DatePicker.js +384 -0
  38. package/src/components/DatePicker/DatePicker.js.map +1 -0
  39. package/src/components/DatePicker/DatePickerComponent.js +14 -0
  40. package/src/components/DatePicker/DatePickerComponent.js.map +1 -0
  41. package/src/components/DatePicker/DatePickerComponent.web.js +31 -0
  42. package/src/components/DatePicker/DatePickerComponent.web.js.map +1 -0
  43. package/src/components/DatePicker/DatePickerComponentType.js +2 -0
  44. package/src/components/DatePicker/DatePickerComponentType.js.map +1 -0
  45. package/src/components/DeckSwiper/DeckSwiper.js +91 -0
  46. package/src/components/DeckSwiper/DeckSwiper.js.map +1 -0
  47. package/src/components/DeckSwiper/DeckSwiperCard.js +21 -0
  48. package/src/components/DeckSwiper/DeckSwiperCard.js.map +1 -0
  49. package/src/components/DeckSwiper/index.js +3 -0
  50. package/src/components/DeckSwiper/index.js.map +1 -0
  51. package/src/components/Divider.js +14 -0
  52. package/src/components/Divider.js.map +1 -0
  53. package/src/components/Elevation.js +21 -0
  54. package/src/components/Elevation.js.map +1 -0
  55. package/src/components/FormRow.js +20 -0
  56. package/src/components/FormRow.js.map +1 -0
  57. package/src/components/IconButton.js +36 -0
  58. package/src/components/IconButton.js.map +1 -0
  59. package/src/components/Image.js +48 -0
  60. package/src/components/Image.js.map +1 -0
  61. package/src/components/Layout/AspectRatio.js +7 -0
  62. package/src/components/Layout/AspectRatio.js.map +1 -0
  63. package/src/components/Layout/Center.js +15 -0
  64. package/src/components/Layout/Center.js.map +1 -0
  65. package/src/components/Layout/Circle.js +16 -0
  66. package/src/components/Layout/Circle.js.map +1 -0
  67. package/src/components/Layout/HStack.js +12 -0
  68. package/src/components/Layout/HStack.js.map +1 -0
  69. package/src/components/Layout/LayoutCommon.js +8 -0
  70. package/src/components/Layout/LayoutCommon.js.map +1 -0
  71. package/src/components/Layout/Spacer.js +15 -0
  72. package/src/components/Layout/Spacer.js.map +1 -0
  73. package/src/components/Layout/Square.js +25 -0
  74. package/src/components/Layout/Square.js.map +1 -0
  75. package/src/components/Layout/VStack.js +12 -0
  76. package/src/components/Layout/VStack.js.map +1 -0
  77. package/src/components/Layout/ZStack.js +20 -0
  78. package/src/components/Layout/ZStack.js.map +1 -0
  79. package/src/components/Layout/index.js +9 -0
  80. package/src/components/Layout/index.js.map +1 -0
  81. package/src/components/Markdown.js +11 -0
  82. package/src/components/Markdown.js.map +1 -0
  83. package/src/components/MediaPlayer/AudioPlayer/AudioPlayerCommon.js +2 -0
  84. package/src/components/MediaPlayer/AudioPlayer/AudioPlayerCommon.js.map +1 -0
  85. package/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +126 -0
  86. package/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js.map +1 -0
  87. package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +93 -0
  88. package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js.map +1 -0
  89. package/src/components/MediaPlayer/AudioPlayer/index.js +15 -0
  90. package/src/components/MediaPlayer/AudioPlayer/index.js.map +1 -0
  91. package/src/components/MediaPlayer/MediaPlaybackWrapper.js +42 -0
  92. package/src/components/MediaPlayer/MediaPlaybackWrapper.js.map +1 -0
  93. package/src/components/MediaPlayer/MediaPlayerCommon.js +24 -0
  94. package/src/components/MediaPlayer/MediaPlayerCommon.js.map +1 -0
  95. package/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js +75 -0
  96. package/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js.map +1 -0
  97. package/src/components/MediaPlayer/VideoPlayer/index.js +2 -0
  98. package/src/components/MediaPlayer/VideoPlayer/index.js.map +1 -0
  99. package/src/components/NumberInput.js +60 -0
  100. package/src/components/NumberInput.js.map +1 -0
  101. package/src/components/Picker/Picker.js +288 -0
  102. package/src/components/Picker/Picker.js.map +1 -0
  103. package/src/components/Picker/PickerComponent.android.js +70 -0
  104. package/src/components/Picker/PickerComponent.android.js.map +1 -0
  105. package/src/components/Picker/PickerComponent.ios.js +80 -0
  106. package/src/components/Picker/PickerComponent.ios.js.map +1 -0
  107. package/src/components/Picker/PickerComponent.web.js +71 -0
  108. package/src/components/Picker/PickerComponent.web.js.map +1 -0
  109. package/src/components/Picker/PickerTypes.js +2 -0
  110. package/src/components/Picker/PickerTypes.js.map +1 -0
  111. package/src/components/PinInput/CustomPinInputCell.js +11 -0
  112. package/src/components/PinInput/CustomPinInputCell.js.map +1 -0
  113. package/src/components/PinInput/PinInput.js +70 -0
  114. package/src/components/PinInput/PinInput.js.map +1 -0
  115. package/src/components/PinInput/PinInputText.js +14 -0
  116. package/src/components/PinInput/PinInputText.js.map +1 -0
  117. package/src/components/PinInput/index.js +4 -0
  118. package/src/components/PinInput/index.js.map +1 -0
  119. package/src/components/Portal/Portal.js +36 -0
  120. package/src/components/Portal/Portal.js.map +1 -0
  121. package/src/components/Portal/PortalConsumer.js +28 -0
  122. package/src/components/Portal/PortalConsumer.js.map +1 -0
  123. package/src/components/Portal/PortalHost.js +108 -0
  124. package/src/components/Portal/PortalHost.js.map +1 -0
  125. package/src/components/Portal/PortalManager.js +33 -0
  126. package/src/components/Portal/PortalManager.js.map +1 -0
  127. package/src/components/Pressable.js +13 -0
  128. package/src/components/Pressable.js.map +1 -0
  129. package/src/components/Progress/CircularProgress/CircularProgress.js +103 -0
  130. package/src/components/Progress/CircularProgress/CircularProgress.js.map +1 -0
  131. package/src/components/Progress/CircularProgress/index.js +14 -0
  132. package/src/components/Progress/CircularProgress/index.js.map +1 -0
  133. package/src/components/Progress/IndeterminateProgress.js +39 -0
  134. package/src/components/Progress/IndeterminateProgress.js.map +1 -0
  135. package/src/components/Progress/LinearProgress/LinearProgress.js +56 -0
  136. package/src/components/Progress/LinearProgress/LinearProgress.js.map +1 -0
  137. package/src/components/Progress/LinearProgress/index.js +14 -0
  138. package/src/components/Progress/LinearProgress/index.js.map +1 -0
  139. package/src/components/Progress/ProgressCommon.js +2 -0
  140. package/src/components/Progress/ProgressCommon.js.map +1 -0
  141. package/src/components/ProgressIndicator.js +28 -0
  142. package/src/components/ProgressIndicator.js.map +1 -0
  143. package/src/components/RadioButton/RadioButton.js +18 -0
  144. package/src/components/RadioButton/RadioButton.js.map +1 -0
  145. package/src/components/RadioButton/RadioButtonGroup.js +44 -0
  146. package/src/components/RadioButton/RadioButtonGroup.js.map +1 -0
  147. package/src/components/RadioButton/RadioButtonRow.js +77 -0
  148. package/src/components/RadioButton/RadioButtonRow.js.map +1 -0
  149. package/src/components/RadioButton/context.js +15 -0
  150. package/src/components/RadioButton/context.js.map +1 -0
  151. package/src/components/RadioButton/index.js +4 -0
  152. package/src/components/RadioButton/index.js.map +1 -0
  153. package/src/components/Row.js +49 -0
  154. package/src/components/Row.js.map +1 -0
  155. package/src/components/SVG.js +14 -0
  156. package/src/components/SVG.js.map +1 -0
  157. package/src/components/ScreenContainer.js +36 -0
  158. package/src/components/ScreenContainer.js.map +1 -0
  159. package/src/components/SectionList/SectionHeader.js +14 -0
  160. package/src/components/SectionList/SectionHeader.js.map +1 -0
  161. package/src/components/SectionList/SectionList.js +101 -0
  162. package/src/components/SectionList/SectionList.js.map +1 -0
  163. package/src/components/SectionList/index.js +3 -0
  164. package/src/components/SectionList/index.js.map +1 -0
  165. package/src/components/Shadow.js +26 -0
  166. package/src/components/Shadow.js.map +1 -0
  167. package/src/components/Slider.js +64 -0
  168. package/src/components/Slider.js.map +1 -0
  169. package/src/components/StarRating.js +51 -0
  170. package/src/components/StarRating.js.map +1 -0
  171. package/src/components/StepIndicator.js +347 -0
  172. package/src/components/StepIndicator.js.map +1 -0
  173. package/src/components/Stepper.js +42 -0
  174. package/src/components/Stepper.js.map +1 -0
  175. package/src/components/Surface.js +33 -0
  176. package/src/components/Surface.js.map +1 -0
  177. package/src/components/SwipeableItem/SwipeableItem.js +119 -0
  178. package/src/components/SwipeableItem/SwipeableItem.js.map +1 -0
  179. package/src/components/SwipeableItem/SwipeableItemButton.js +6 -0
  180. package/src/components/SwipeableItem/SwipeableItemButton.js.map +1 -0
  181. package/src/components/SwipeableItem/SwipeableItemCommon.js +44 -0
  182. package/src/components/SwipeableItem/SwipeableItemCommon.js.map +1 -0
  183. package/src/components/SwipeableItem/SwipeableList.js +29 -0
  184. package/src/components/SwipeableItem/SwipeableList.js.map +1 -0
  185. package/src/components/SwipeableItem/index.js +4 -0
  186. package/src/components/SwipeableItem/index.js.map +1 -0
  187. package/src/components/Swiper/Swiper.js +74 -0
  188. package/src/components/Swiper/Swiper.js.map +1 -0
  189. package/src/components/Swiper/SwiperItem.js +10 -0
  190. package/src/components/Swiper/SwiperItem.js.map +1 -0
  191. package/src/components/Swiper/index.js +3 -0
  192. package/src/components/Swiper/index.js.map +1 -0
  193. package/src/components/Switch.js +57 -0
  194. package/src/components/Switch.js.map +1 -0
  195. package/src/components/TabView/TabView.js +55 -0
  196. package/src/components/TabView/TabView.js.map +1 -0
  197. package/src/components/TabView/TabViewItem.js +12 -0
  198. package/src/components/TabView/TabViewItem.js.map +1 -0
  199. package/src/components/TabView/index.js +3 -0
  200. package/src/components/TabView/index.js.map +1 -0
  201. package/src/components/Table/Table.js +94 -0
  202. package/src/components/Table/Table.js.map +1 -0
  203. package/src/components/Table/TableCell.js +34 -0
  204. package/src/components/Table/TableCell.js.map +1 -0
  205. package/src/components/Table/TableCommon.js +13 -0
  206. package/src/components/Table/TableCommon.js.map +1 -0
  207. package/src/components/Table/TableRow.js +40 -0
  208. package/src/components/Table/TableRow.js.map +1 -0
  209. package/src/components/Table/index.js +4 -0
  210. package/src/components/Table/index.js.map +1 -0
  211. package/src/components/Text.js +34 -0
  212. package/src/components/Text.js.map +1 -0
  213. package/src/components/TextField.js +430 -0
  214. package/src/components/TextField.js.map +1 -0
  215. package/src/components/TextInput.js +15 -0
  216. package/src/components/TextInput.js.map +1 -0
  217. package/src/components/Touchable.js +13 -0
  218. package/src/components/Touchable.js.map +1 -0
  219. package/src/components/Touchable.web.js +3 -0
  220. package/src/components/Touchable.web.js.map +1 -0
  221. package/src/components/Typography.js +37 -0
  222. package/src/components/Typography.js.map +1 -0
  223. package/src/components/YoutubePlayer/YoutubePlayer.js +21 -0
  224. package/src/components/YoutubePlayer/YoutubePlayer.js.map +1 -0
  225. package/src/components/YoutubePlayer/YoutubePlayer.native.js +10 -0
  226. package/src/components/YoutubePlayer/YoutubePlayer.native.js.map +1 -0
  227. package/src/components/YoutubePlayer/YoutubePlayerProps.js +2 -0
  228. package/src/components/YoutubePlayer/YoutubePlayerProps.js.map +1 -0
  229. package/src/components/YoutubePlayer/index.js +2 -0
  230. package/src/components/YoutubePlayer/index.js.map +1 -0
  231. package/src/components/useAuthState.js +35 -0
  232. package/src/components/useAuthState.js.map +1 -0
  233. package/src/constants.js +11 -0
  234. package/src/constants.js.map +1 -0
  235. package/src/deprecated-components/AccordionItem.js +36 -0
  236. package/src/deprecated-components/AccordionItem.js.map +1 -0
  237. package/src/deprecated-components/AnimatedCircularProgress.js +47 -0
  238. package/src/deprecated-components/AnimatedCircularProgress.js.map +1 -0
  239. package/src/deprecated-components/AvatarEdit.js +34 -0
  240. package/src/deprecated-components/AvatarEdit.js.map +1 -0
  241. package/src/deprecated-components/Banner.js +113 -0
  242. package/src/deprecated-components/Banner.js.map +1 -0
  243. package/src/deprecated-components/Card.js +61 -0
  244. package/src/deprecated-components/Card.js.map +1 -0
  245. package/src/deprecated-components/CheckboxGroup.js +25 -0
  246. package/src/deprecated-components/CheckboxGroup.js.map +1 -0
  247. package/src/deprecated-components/CircleImage.js +12 -0
  248. package/src/deprecated-components/CircleImage.js.map +1 -0
  249. package/src/deprecated-components/CircularProgress.js +85 -0
  250. package/src/deprecated-components/CircularProgress.js.map +1 -0
  251. package/src/deprecated-components/Container.js +47 -0
  252. package/src/deprecated-components/Container.js.map +1 -0
  253. package/src/deprecated-components/DeprecatedButton.js +87 -0
  254. package/src/deprecated-components/DeprecatedButton.js.map +1 -0
  255. package/src/deprecated-components/DeprecatedCardWrapper.js +22 -0
  256. package/src/deprecated-components/DeprecatedCardWrapper.js.map +1 -0
  257. package/src/deprecated-components/DeprecatedFAB.js +118 -0
  258. package/src/deprecated-components/DeprecatedFAB.js.map +1 -0
  259. package/src/deprecated-components/FAB.js +50 -0
  260. package/src/deprecated-components/FAB.js.map +1 -0
  261. package/src/deprecated-components/FieldSearchBarFull.js +57 -0
  262. package/src/deprecated-components/FieldSearchBarFull.js.map +1 -0
  263. package/src/deprecated-components/Layout.js +69 -0
  264. package/src/deprecated-components/Layout.js.map +1 -0
  265. package/src/deprecated-components/ProgressBar.js +122 -0
  266. package/src/deprecated-components/ProgressBar.js.map +1 -0
  267. package/src/deprecated-components/ProgressCircle.js +17 -0
  268. package/src/deprecated-components/ProgressCircle.js.map +1 -0
  269. package/src/deprecated-components/RadioButtonFieldGroup.js +21 -0
  270. package/src/deprecated-components/RadioButtonFieldGroup.js.map +1 -0
  271. package/src/deprecated-components/RowBodyIcon.js +12 -0
  272. package/src/deprecated-components/RowBodyIcon.js.map +1 -0
  273. package/src/deprecated-components/RowHeadlineImageCaption.js +16 -0
  274. package/src/deprecated-components/RowHeadlineImageCaption.js.map +1 -0
  275. package/src/deprecated-components/RowHeadlineImageIcon.js +18 -0
  276. package/src/deprecated-components/RowHeadlineImageIcon.js.map +1 -0
  277. package/src/deprecated-components/ToggleButton.js +43 -0
  278. package/src/deprecated-components/ToggleButton.js.map +1 -0
  279. package/src/hooks.js +25 -0
  280. package/src/hooks.js.map +1 -0
  281. package/src/index.js +66 -0
  282. package/src/index.js.map +1 -0
  283. package/src/interfaces/Icon.js +9 -0
  284. package/src/interfaces/Icon.js.map +1 -0
  285. package/src/styles/DarkTheme.js +27 -0
  286. package/src/styles/DarkTheme.js.map +1 -0
  287. package/src/styles/DefaultTheme.js +112 -0
  288. package/src/styles/DefaultTheme.js.map +1 -0
  289. package/src/styles/fonts.js +63 -0
  290. package/src/styles/fonts.js.map +1 -0
  291. package/src/styles/overlay.js +61 -0
  292. package/src/styles/overlay.js.map +1 -0
  293. package/src/styles/shadow.js +52 -0
  294. package/src/styles/shadow.js.map +1 -0
  295. package/src/theming.js +4 -0
  296. package/src/theming.js.map +1 -0
  297. package/src/utilities.js +180 -0
  298. package/src/utilities.js.map +1 -0
@@ -0,0 +1,80 @@
1
+ import * as React from "react";
2
+ import { View, StyleSheet } from "react-native";
3
+ import { SafeAreaView } from "react-native-safe-area-context";
4
+ import omit from "lodash.omit";
5
+ import { Picker as NativePicker } from "@react-native-picker/picker";
6
+ import { withTheme } from "../../theming";
7
+ import Portal from "../Portal/Portal";
8
+ import Button from "../../deprecated-components/DeprecatedButton";
9
+ import TextField from "../TextField";
10
+ import Touchable from "../Touchable";
11
+ import { extractStyles } from "../../utilities";
12
+ const Picker = ({ Icon, style, options, placeholder, selectedValue, disabled = false, onValueChange = () => { }, theme: { colors }, ...props }) => {
13
+ var _a, _b;
14
+ const { viewStyles: { borderRadius, // eslint-disable-line @typescript-eslint/no-unused-vars
15
+ borderWidth, // eslint-disable-line @typescript-eslint/no-unused-vars
16
+ borderTopWidth, // eslint-disable-line @typescript-eslint/no-unused-vars
17
+ borderRightWidth, // eslint-disable-line @typescript-eslint/no-unused-vars
18
+ borderBottomWidth, // eslint-disable-line @typescript-eslint/no-unused-vars
19
+ borderLeftWidth, // eslint-disable-line @typescript-eslint/no-unused-vars
20
+ borderColor, // eslint-disable-line @typescript-eslint/no-unused-vars
21
+ backgroundColor, // eslint-disable-line @typescript-eslint/no-unused-vars
22
+ padding, // eslint-disable-line @typescript-eslint/no-unused-vars
23
+ paddingTop, // eslint-disable-line @typescript-eslint/no-unused-vars
24
+ paddingRight, // eslint-disable-line @typescript-eslint/no-unused-vars
25
+ paddingBottom, // eslint-disable-line @typescript-eslint/no-unused-vars
26
+ paddingLeft, // eslint-disable-line @typescript-eslint/no-unused-vars
27
+ ...viewStyles }, } = extractStyles(style);
28
+ const textField = React.useRef(undefined);
29
+ const [pickerVisible, setIsPickerVisible] = React.useState(false);
30
+ const toggleVisibility = () => {
31
+ setIsPickerVisible(!pickerVisible);
32
+ // @ts-ignore
33
+ textField.current.toggleFocus(); // cannot determine if method exists due to component being wrapped in a withTheme()
34
+ };
35
+ const stylesWithoutMargin = style &&
36
+ omit(StyleSheet.flatten(style), [
37
+ "margin",
38
+ "marginTop",
39
+ "marginRight",
40
+ "marginBottom",
41
+ "marginLeft",
42
+ ]);
43
+ const selectedLabel = selectedValue &&
44
+ ((_b = (_a = options.find((o) => o.value === selectedValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : selectedValue);
45
+ return (React.createElement(View, { style: [styles.container, viewStyles] },
46
+ React.createElement(Touchable, { disabled: disabled, onPress: toggleVisibility },
47
+ React.createElement(TextField, { ...props, value: String(selectedLabel), placeholder: placeholder,
48
+ // @ts-ignore
49
+ ref: textField, disabled: disabled, pointerEvents: "none",
50
+ // @ts-expect-error
51
+ style: stylesWithoutMargin, Icon: Icon })),
52
+ pickerVisible && (React.createElement(Portal, null,
53
+ React.createElement(View, { style: [styles.picker, { backgroundColor: colors.divider }] },
54
+ React.createElement(SafeAreaView, { style: styles.pickerContainer },
55
+ React.createElement(Button, { Icon: Icon, type: "text", onPress: toggleVisibility, style: styles.closeButton }, "Close"),
56
+ React.createElement(NativePicker, { style: { backgroundColor: "white" }, selectedValue: selectedValue, onValueChange: onValueChange }, options.map((o) => (React.createElement(NativePicker.Item, { label: o.label, value: o.value, key: o.value }))))))))));
57
+ };
58
+ const styles = StyleSheet.create({
59
+ container: {
60
+ alignSelf: "stretch",
61
+ },
62
+ picker: {
63
+ position: "absolute",
64
+ bottom: 0,
65
+ left: 0,
66
+ right: 0,
67
+ flexDirection: "row",
68
+ justifyContent: "center",
69
+ },
70
+ pickerContainer: {
71
+ backgroundColor: "white",
72
+ flexDirection: "column",
73
+ width: "100%",
74
+ },
75
+ closeButton: {
76
+ alignSelf: "flex-end",
77
+ },
78
+ });
79
+ export default withTheme(Picker);
80
+ //# sourceMappingURL=PickerComponent.ios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PickerComponent.ios.js","sourceRoot":"","sources":["PickerComponent.ios.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,IAAI,MAAM,aAAa,CAAC;AAE/B,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,MAAM,MAAM,8CAA8C,CAAC;AAClE,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,MAAM,MAAM,GAA8C,CAAC,EACzD,IAAI,EACJ,KAAK,EACL,OAAO,EACP,WAAW,EACX,aAAa,EACb,QAAQ,GAAG,KAAK,EAChB,aAAa,GAAG,GAAG,EAAE,GAAE,CAAC,EACxB,KAAK,EAAE,EAAE,MAAM,EAAE,EACjB,GAAG,KAAK,EACT,EAAE,EAAE;;IACH,MAAM,EACJ,UAAU,EAAE,EACV,YAAY,EAAE,wDAAwD;IACtE,WAAW,EAAE,wDAAwD;IACrE,cAAc,EAAE,wDAAwD;IACxE,gBAAgB,EAAE,wDAAwD;IAC1E,iBAAiB,EAAE,wDAAwD;IAC3E,eAAe,EAAE,wDAAwD;IACzE,WAAW,EAAE,wDAAwD;IACrE,eAAe,EAAE,wDAAwD;IACzE,OAAO,EAAE,wDAAwD;IACjE,UAAU,EAAE,wDAAwD;IACpE,YAAY,EAAE,wDAAwD;IACtE,aAAa,EAAE,wDAAwD;IACvE,WAAW,EAAE,wDAAwD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IAAC,KAAK,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,eAAe,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;gBAC/D,oBAAC,YAAY,IAAC,KAAK,EAAE,MAAM,CAAC,eAAe;oBACzC,oBAAC,MAAM,IACL,IAAI,EAAE,IAAI,EACV,IAAI,EAAC,MAAM,EACX,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,MAAM,CAAC,WAAW,YAGlB;oBACT,oBAAC,YAAY,IACX,KAAK,EAAE,EAAE,eAAe,EAAE,OAAO,EAAE,EACnC,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,IAE3B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CACvB,oBAAC,YAAY,CAAC,IAAI,IAChB,KAAK,EAAE,CAAC,CAAC,KAAK,EACd,KAAK,EAAE,CAAC,CAAC,KAAK,EACd,GAAG,EAAE,CAAC,CAAC,KAAK,GACZ,CACH,CAAC,CACW,CACF,CACV,CACA,CACV,CACI,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,SAAS,EAAE,SAAS;KACrB;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,UAAU;QACpB,MAAM,EAAE,CAAC;QACT,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,QAAQ;KACzB;IACD,eAAe,EAAE;QACf,eAAe,EAAE,OAAO;QACxB,aAAa,EAAE,QAAQ;QACvB,KAAK,EAAE,MAAM;KACd;IACD,WAAW,EAAE;QACX,SAAS,EAAE,UAAU;KACtB;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,71 @@
1
+ import * as React from "react";
2
+ import { View, StyleSheet } from "react-native";
3
+ import { Picker as NativePicker } from "@react-native-picker/picker";
4
+ import omit from "lodash.omit";
5
+ import { withTheme } from "../../theming";
6
+ import { extractStyles } from "../../utilities";
7
+ import TextField from "../TextField";
8
+ import Touchable from "../Touchable";
9
+ const Picker = ({ style, options, placeholder, selectedValue, disabled = false, onValueChange: onValueChangeOverride = () => { }, ...props }) => {
10
+ var _a, _b;
11
+ const { viewStyles: { borderRadius, // eslint-disable-line @typescript-eslint/no-unused-vars
12
+ borderWidth, // eslint-disable-line @typescript-eslint/no-unused-vars
13
+ borderTopWidth, // eslint-disable-line @typescript-eslint/no-unused-vars
14
+ borderRightWidth, // eslint-disable-line @typescript-eslint/no-unused-vars
15
+ borderBottomWidth, // eslint-disable-line @typescript-eslint/no-unused-vars
16
+ borderLeftWidth, // eslint-disable-line @typescript-eslint/no-unused-vars
17
+ borderColor, // eslint-disable-line @typescript-eslint/no-unused-vars
18
+ backgroundColor, // eslint-disable-line @typescript-eslint/no-unused-vars
19
+ padding, // eslint-disable-line @typescript-eslint/no-unused-vars
20
+ paddingTop, // eslint-disable-line @typescript-eslint/no-unused-vars
21
+ paddingRight, // eslint-disable-line @typescript-eslint/no-unused-vars
22
+ paddingBottom, // eslint-disable-line @typescript-eslint/no-unused-vars
23
+ paddingLeft, // eslint-disable-line @typescript-eslint/no-unused-vars
24
+ ...viewStyles }, } = extractStyles(style);
25
+ const textField = React.useRef(undefined);
26
+ const onValueChange = (itemValue, itemIndex) => {
27
+ toggleFocus();
28
+ onValueChangeOverride(itemValue, itemIndex);
29
+ };
30
+ const toggleFocus = () => {
31
+ if (!disabled) {
32
+ // @ts-ignore
33
+ textField.current.toggleFocus(); // cannot determine if method exists due to component being wrapped in a withTheme()
34
+ }
35
+ };
36
+ const stylesWithoutMargin = style &&
37
+ omit(StyleSheet.flatten(style), [
38
+ "margin",
39
+ "marginTop",
40
+ "marginRight",
41
+ "marginBottom",
42
+ "marginLeft",
43
+ ]);
44
+ const selectedLabel = selectedValue &&
45
+ ((_b = (_a = options.find((o) => o.value === selectedValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : selectedValue);
46
+ return (React.createElement(Touchable, { disabled: disabled, onPress: toggleFocus, style: [styles.container, viewStyles] },
47
+ React.createElement(View, null,
48
+ React.createElement(NativePicker, { enabled: !disabled, selectedValue: selectedValue, onValueChange: onValueChange, style: {
49
+ flex: 1,
50
+ opacity: 0,
51
+ position: "absolute",
52
+ top: 0,
53
+ left: 0,
54
+ right: 0,
55
+ bottom: 0,
56
+ width: "100%",
57
+ } }, options.map((o) => (React.createElement(NativePicker.Item, { label: o.label, value: o.value, key: o.value })))),
58
+ React.createElement(View, { pointerEvents: "none" },
59
+ React.createElement(TextField, { ...props, value: selectedLabel, placeholder: placeholder,
60
+ // @ts-ignore
61
+ ref: textField, disabled: disabled,
62
+ // @ts-expect-error
63
+ style: stylesWithoutMargin })))));
64
+ };
65
+ const styles = StyleSheet.create({
66
+ container: {
67
+ alignSelf: "stretch",
68
+ },
69
+ });
70
+ export default withTheme(Picker);
71
+ //# sourceMappingURL=PickerComponent.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PickerComponent.web.js","sourceRoot":"","sources":["PickerComponent.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,SAAS,MAAM,cAAc,CAAC;AAGrC,MAAM,MAAM,GAAmC,CAAC,EAC9C,KAAK,EACL,OAAO,EACP,WAAW,EACX,aAAa,EACb,QAAQ,GAAG,KAAK,EAChB,aAAa,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 +1 @@
1
+ {"version":3,"file":"PickerTypes.js","sourceRoot":"","sources":["PickerTypes.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { View } from "react-native";
3
+ /**
4
+ * Simple View wrapper component to create a custom pin input cell
5
+ * Meant to be used in PinInput's renderItem
6
+ */
7
+ const CustomPinInputCell = ({ style, children }) => {
8
+ return React.createElement(View, { style: style, children: children });
9
+ };
10
+ export default CustomPinInputCell;
11
+ //# sourceMappingURL=CustomPinInputCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomPinInputCell.js","sourceRoot":"","sources":["CustomPinInputCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAwB,IAAI,EAAE,MAAM,cAAc,CAAC;AAM1D;;;GAGG;AACH,MAAM,kBAAkB,GAEpB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC1B,OAAO,oBAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC;AACpD,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,70 @@
1
+ import React from "react";
2
+ import { View, StyleSheet, } from "react-native";
3
+ import TextInput from "../TextInput";
4
+ import { CodeField, useClearByFocusCell, } from "react-native-confirmation-code-field";
5
+ import { withTheme } from "../../theming";
6
+ import PinInputText from "./PinInputText";
7
+ import { extractStyles } from "../../utilities";
8
+ const PinInput = React.forwardRef(({ theme, onInputFull, cellCount = 4, clearOnCellFocus = true, blurOnFull = true, renderItem, value, onChangeText, focusedBorderColor = theme.colors.primary, unFocusedBorderColor = theme.colors.disabled, focusedBackgroundColor, unFocusedBackgroundColor, focusedBorderWidth = 2, unFocusedBorderWidth = 1, focusedTextColor = theme.colors.strong, unFocusedTextColor = focusedTextColor, style, ...rest }, ref) => {
9
+ const newPinInputRef = React.useRef(null);
10
+ // Use the provided ref or default to new ref when not provided
11
+ const pinInputRef = ref
12
+ ? ref
13
+ : newPinInputRef;
14
+ const { viewStyles, textStyles } = extractStyles(style);
15
+ // Clears input of a cell when focused, configured as explained here (https://github.com/retyui/react-native-confirmation-code-field/blob/master/API.md#useclearbyfocuscellvalue-string-setvalue-text-string--void)
16
+ const [codeFieldProps, getCellOnLayout] = useClearByFocusCell({
17
+ value,
18
+ setValue: (text) => onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(text),
19
+ });
20
+ React.useEffect(() => {
21
+ var _a;
22
+ if ((value === null || value === void 0 ? void 0 : value.length) === cellCount) {
23
+ if (blurOnFull) {
24
+ (_a = pinInputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
25
+ }
26
+ onInputFull === null || onInputFull === void 0 ? void 0 : onInputFull(value);
27
+ }
28
+ // eslint-disable-next-line react-hooks/exhaustive-deps
29
+ }, [value, cellCount, blurOnFull, pinInputRef]);
30
+ return (React.createElement(CodeField, { ref: pinInputRef, ...(clearOnCellFocus ? codeFieldProps : {}), value: value, onChangeText: onChangeText, textInputStyle: { height: "100%" }, InputComponent: TextInput, cellCount: cellCount, renderCell: ({ symbol: cellValue, index, isFocused }) => (React.createElement(View, { key: index, onLayout: clearOnCellFocus ? getCellOnLayout(index) : undefined, style: { flex: 1 } }, (renderItem === null || renderItem === void 0 ? void 0 : renderItem({ cellValue, index, isFocused })) || (React.createElement(View, { testID: "default-code-input-cell", style: [
31
+ styles.cell,
32
+ {
33
+ borderWidth: isFocused
34
+ ? focusedBorderWidth
35
+ : unFocusedBorderWidth,
36
+ borderColor: isFocused
37
+ ? focusedBorderColor
38
+ : unFocusedBorderColor,
39
+ backgroundColor: isFocused
40
+ ? focusedBackgroundColor
41
+ : unFocusedBackgroundColor,
42
+ },
43
+ viewStyles,
44
+ ] },
45
+ React.createElement(PinInputText, { style: [
46
+ styles.cellText,
47
+ {
48
+ color: isFocused ? focusedTextColor : unFocusedTextColor,
49
+ },
50
+ textStyles,
51
+ ], isFocused: isFocused }, cellValue))))), ...rest }));
52
+ });
53
+ const styles = StyleSheet.create({
54
+ cell: {
55
+ marginStart: 5,
56
+ marginEnd: 5,
57
+ padding: 5,
58
+ borderRadius: 5,
59
+ justifyContent: "center",
60
+ alignItems: "center",
61
+ aspectRatio: 1,
62
+ maxWidth: 70,
63
+ maxHeight: 70,
64
+ },
65
+ cellText: {
66
+ fontSize: 25,
67
+ },
68
+ });
69
+ export default withTheme(PinInput);
70
+ //# sourceMappingURL=PinInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PinInput.js","sourceRoot":"","sources":["PinInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAIL,IAAI,EACJ,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,OAAO,SAA6B,MAAM,cAAc,CAAC;AACzD,OAAO,EACL,SAAS,EACT,mBAAmB,GACpB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AA0BhD,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAC/B,CACE,EACE,KAAK,EACL,WAAW,EACX,SAAS,GAAG,CAAC,EACb,gBAAgB,GAAG,IAAI,EACvB,UAAU,GAAG,IAAI,EACjB,UAAU,EACV,KAAK,EACL,YAAY,EACZ,kBAAkB,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,EACzC,oBAAoB,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,EAC5C,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB,GAAG,CAAC,EACtB,oBAAoB,GAAG,CAAC,EACxB,gBAAgB,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,EACtC,kBAAkB,GAAG,gBAAgB,EACrC,KAAK,EACL,GAAG,IAAI,EACR,EACD,GAAG,EACH,EAA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;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { Text } from "react-native";
3
+ import { withTheme } from "../../theming";
4
+ import { Cursor } from "react-native-confirmation-code-field";
5
+ /**
6
+ * Text component that can conditionally render a blinking cursor when focused and empty
7
+ * Meant to be used within a CustomPinInputCell component
8
+ */
9
+ const CustomPinInputText = ({ isFocused, cursorBlinkDuration, cursorText, style, theme, children, ...rest }) => {
10
+ return (React.createElement(Text, { style: [{ color: theme.colors.strong }, style], ...rest }, children ||
11
+ (isFocused ? (React.createElement(Cursor, { cursorSymbol: cursorText, delay: cursorBlinkDuration })) : null)));
12
+ };
13
+ export default withTheme(CustomPinInputText);
14
+ //# sourceMappingURL=PinInputText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PinInputText.js","sourceRoot":"","sources":["PinInputText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAa,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAS9D;;;GAGG;AACH,MAAM,kBAAkB,GAAsC,CAAC,EAC7D,SAAS,EACT,mBAAmB,EACnB,UAAU,EACV,KAAK,EACL,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,EAAE;IACH,OAAO,CACL,oBAAC,IAAI,IAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,KAAK,CAAC,KAAM,IAAI,IAC3D,QAAQ;QACP,CAAC,SAAS,CAAC,CAAC,CAAC,CACX,oBAAC,MAAM,IAAC,YAAY,EAAE,UAAU,EAAE,KAAK,EAAE,mBAAmB,GAAI,CACjE,CAAC,CAAC,CAAC,IAAI,CAAC,CACN,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { default as PinInput } from "./PinInput";
2
+ export { default as CustomPinInputCell } from "./CustomPinInputCell";
3
+ export { default as PinInputText } from "./PinInputText";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import * as React from "react";
2
+ import PortalConsumer from "./PortalConsumer";
3
+ import PortalHost, { PortalContext } from "./PortalHost";
4
+ import { ThemeProvider, withTheme } from "../../theming";
5
+ /**
6
+ * Portal allows to render a component at a different place in the parent tree.
7
+ * You can use it to render content which should appear above other elements, similar to `Modal`.
8
+ * It requires a [`Portal.Host`](portal-host.html) component to be rendered somewhere in the parent tree.
9
+ *
10
+ * ## Usage
11
+ * ```js
12
+ * import * as React from 'react';
13
+ * import { Portal, Text } from 'react-native-paper';
14
+ *
15
+ * export default class MyComponent extends React.Component {
16
+ * render() {
17
+ * return (
18
+ * <Portal>
19
+ * <Text>This is rendered at a different place</Text>
20
+ * </Portal>
21
+ * );
22
+ * }
23
+ * }
24
+ * ```
25
+ */
26
+ class Portal extends React.Component {
27
+ render() {
28
+ const { children, theme } = this.props;
29
+ return (React.createElement(PortalContext.Consumer, null, (manager) => (React.createElement(PortalConsumer, { manager: manager },
30
+ React.createElement(ThemeProvider, { theme: theme }, children)))));
31
+ }
32
+ }
33
+ // @component ./PortalHost.tsx
34
+ Portal.Host = PortalHost;
35
+ export default withTheme(Portal);
36
+ //# sourceMappingURL=Portal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Portal.js","sourceRoot":"","sources":["Portal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,UAAU,EAAE,EAAE,aAAa,EAAiB,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAczD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAO,SAAQ,KAAK,CAAC,SAAgB;IAIzC,MAAM;QACJ,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAEvC,OAAO,CACL,oBAAC,aAAa,CAAC,QAAQ,QACpB,CAAC,OAAO,EAAE,EAAE,CAAC,CACZ,oBAAC,cAAc,IAAC,OAAO,EAAE,OAAwB;YAE/C,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,IAAG,QAAQ,CAAiB,CACxC,CAClB,CACsB,CAC1B,CAAC;IACJ,CAAC;;AAhBD,8BAA8B;AACvB,WAAI,GAAG,UAAU,CAAC;AAkB3B,eAAe,SAAS,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,28 @@
1
+ import * as React from "react";
2
+ export default class PortalConsumer extends React.Component {
3
+ async componentDidMount() {
4
+ this.checkManager();
5
+ // Delay updating to prevent React from going to infinite loop
6
+ await Promise.resolve();
7
+ this.key = this.props.manager.mount(this.props.children);
8
+ }
9
+ componentDidUpdate() {
10
+ this.checkManager();
11
+ this.props.manager.update(this.key, this.props.children);
12
+ }
13
+ componentWillUnmount() {
14
+ this.checkManager();
15
+ this.props.manager.unmount(this.key);
16
+ }
17
+ checkManager() {
18
+ if (!this.props.manager) {
19
+ throw new Error("Looks like you forgot to wrap your root component with `Provider` component from `react-native-paper`.\n\n" +
20
+ "Please read our getting-started guide and make sure you've followed all the required steps.\n\n" +
21
+ "https://callstack.github.io/react-native-paper/getting-started.html");
22
+ }
23
+ }
24
+ render() {
25
+ return null;
26
+ }
27
+ }
28
+ //# sourceMappingURL=PortalConsumer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PortalConsumer.js","sourceRoot":"","sources":["PortalConsumer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,KAAK,CAAC,SAAgB;IAChE,KAAK,CAAC,iBAAiB;QACrB,IAAI,CAAC,YAAY,EAAE,CAAC;QAEpB,8DAA8D;QAC9D,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;QAExB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC3D,CAAC;IAED,kBAAkB;QAChB,IAAI,CAAC,YAAY,EAAE,CAAC;QAEpB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC3D,CAAC;IAED,oBAAoB;QAClB,IAAI,CAAC,YAAY,EAAE,CAAC;QAEpB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvC,CAAC;IAIO,YAAY;QAClB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE;YACvB,MAAM,IAAI,KAAK,CACb,4GAA4G;gBAC1G,iGAAiG;gBACjG,qEAAqE,CACxE,CAAC;SACH;IACH,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,108 @@
1
+ import * as React from "react";
2
+ import { View, StyleSheet } from "react-native";
3
+ import PortalManager from "./PortalManager";
4
+ export const PortalContext = React.createContext(null);
5
+ /**
6
+ * Portal host renders all of its children `Portal` elements.
7
+ * For example, you can wrap a screen in `Portal.Host` to render items above the screen.
8
+ * If you're using the `Provider` component, it already includes `Portal.Host`.
9
+ *
10
+ * ## Usage
11
+ * ```js
12
+ * import * as React from 'react';
13
+ * import { Text } from 'react-native';
14
+ * import { Portal } from 'react-native-paper';
15
+ *
16
+ * export default class MyComponent extends React.Component {
17
+ * render() {
18
+ * return (
19
+ * <Portal.Host>
20
+ * <Text>Content of the app</Text>
21
+ * </Portal.Host>
22
+ * );
23
+ * }
24
+ * }
25
+ * ```
26
+ *
27
+ * Here any `Portal` elements under `<App />` are rendered alongside `<App />` and will appear above `<App />` like a `Modal`.
28
+ */
29
+ export default class PortalHost extends React.Component {
30
+ constructor() {
31
+ super(...arguments);
32
+ this.setManager = (manager) => {
33
+ this.manager = manager;
34
+ };
35
+ this.mount = (children) => {
36
+ const key = this.nextKey++;
37
+ if (this.manager) {
38
+ this.manager.mount(key, children);
39
+ }
40
+ else {
41
+ this.queue.push({ type: "mount", key, children });
42
+ }
43
+ return key;
44
+ };
45
+ this.update = (key, children) => {
46
+ if (this.manager) {
47
+ this.manager.update(key, children);
48
+ }
49
+ else {
50
+ const op = { type: "mount", key, children };
51
+ const index = this.queue.findIndex((o) => o.type === "mount" || (o.type === "update" && o.key === key));
52
+ if (index > -1) {
53
+ // @ts-ignore
54
+ this.queue[index] = op;
55
+ }
56
+ else {
57
+ this.queue.push(op);
58
+ }
59
+ }
60
+ };
61
+ this.unmount = (key) => {
62
+ if (this.manager) {
63
+ this.manager.unmount(key);
64
+ }
65
+ else {
66
+ this.queue.push({ type: "unmount", key });
67
+ }
68
+ };
69
+ this.nextKey = 0;
70
+ this.queue = [];
71
+ }
72
+ componentDidMount() {
73
+ const manager = this.manager;
74
+ const queue = this.queue;
75
+ while (queue.length && manager) {
76
+ const action = queue.pop();
77
+ if (action) {
78
+ switch (action.type) {
79
+ case "mount":
80
+ manager.mount(action.key, action.children);
81
+ break;
82
+ case "update":
83
+ manager.update(action.key, action.children);
84
+ break;
85
+ case "unmount":
86
+ manager.unmount(action.key);
87
+ break;
88
+ }
89
+ }
90
+ }
91
+ }
92
+ render() {
93
+ return (React.createElement(PortalContext.Provider, { value: {
94
+ mount: this.mount,
95
+ update: this.update,
96
+ unmount: this.unmount,
97
+ } },
98
+ React.createElement(View, { style: styles.container, collapsable: false, pointerEvents: "box-none" }, this.props.children),
99
+ React.createElement(PortalManager, { ref: this.setManager })));
100
+ }
101
+ }
102
+ PortalHost.displayName = "Portal.Host";
103
+ const styles = StyleSheet.create({
104
+ container: {
105
+ flex: 1,
106
+ },
107
+ });
108
+ //# sourceMappingURL=PortalHost.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PortalHost.js","sourceRoot":"","sources":["PortalHost.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAiB5C,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAgB,IAAW,CAAC,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,KAAK,CAAC,SAAgB;IAA9D;;QAyBU,eAAU,GAAG,CAAC,OAAyC,EAAE,EAAE;YACjE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACzB,CAAC,CAAC;QAEM,UAAK,GAAG,CAAC,QAAyB,EAAE,EAAE;YAC5C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;YAE3B,IAAI,IAAI,CAAC,OAAO,EAAE;gBAChB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;aACnC;iBAAM;gBACL,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAA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K,CAAC;QAEzB,OAAO,KAAK,CAAC,MAAM,IAAI,OAAO,EAAE;YAC9B,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;YAC3B,IAAI,MAAM,EAAE;gBACV,QAAQ,MAAM,CAAC,IAAI,EAAE;oBACnB,KAAK,OAAO;wBACV,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;wBAC3C,MAAM;oBACR,KAAK,QAAQ;wBACX,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;wBAC5C,MAAM;oBACR,KAAK,SAAS;wBACZ,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;wBAC5B,MAAM;iBACT;aACF;SACF;IACH,CAAC;IAgDD,MAAM;QACJ,OAAO,CACL,oBAAC,aAAa,CAAC,QAAQ,IACrB,KAAK,EAAE;gBACL,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,OAAO,EAAE,IAAI,CAAC,OAAO;aACtB;YAGD,oBAAC,IAAI,IACH,KAAK,EAAE,MAAM,CAAC,SAAS,EACvB,WAAW,EAAE,KAAK,EAClB,aAAa,EAAC,UAAU,IAEvB,IAAI,CAAC,KAAK,CAAC,QAAQ,CACf;YACP,oBAAC,aAAa,IAAC,GAAG,EAAE,IAAI,CAAC,UAAU,GAAI,CAChB,CAC1B,CAAC;IACJ,CAAC;;AA1FM,sBAAW,GAAG,aAAa,CAAC;AA6FrC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,IAAI,EAAE,CAAC;KACR;CACF,CAAC,CAAC"}
@@ -0,0 +1,33 @@
1
+ import * as React from "react";
2
+ import { View, StyleSheet } from "react-native";
3
+ /**
4
+ * Portal host is the component which actually renders all Portals.
5
+ */
6
+ export default class PortalManager extends React.PureComponent {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.state = {
10
+ portals: [],
11
+ };
12
+ this.mount = (key, children) => {
13
+ this.setState((state) => ({
14
+ portals: [...state.portals, { key, children }],
15
+ }));
16
+ };
17
+ this.update = (key, children) => this.setState((state) => ({
18
+ portals: state.portals.map((item) => {
19
+ if (item.key === key) {
20
+ return { ...item, children };
21
+ }
22
+ return item;
23
+ }),
24
+ }));
25
+ this.unmount = (key) => this.setState((state) => ({
26
+ portals: state.portals.filter((item) => item.key !== key),
27
+ }));
28
+ }
29
+ render() {
30
+ return this.state.portals.map(({ key, children }) => (React.createElement(View, { key: key, collapsable: false /* Need collapsable=false here to clip the elevations, otherwise they appear above sibling components */, pointerEvents: "box-none", style: StyleSheet.absoluteFill }, children)));
31
+ }
32
+ }
33
+ //# sourceMappingURL=PortalManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PortalManager.js","sourceRoot":"","sources":["PortalManager.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAShD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK,CAAC,aAAwB;IAAzE;;QACE,UAAK,GAAU;YACb,OAAO,EAAE,EAAE;SACZ,CAAC;QAEF,UAAK,GAAG,CAAC,GAAW,EAAE,QAAyB,EAAE,EAAE;YACjD,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBACxB,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;aAC/C,CAAC,CAAC,CAAC;QACN,CAAC,CAAC;QAEF,WAAM,GAAG,CAAC,GAAW,EAAE,QAAyB,EAAE,EAAE,CAClD,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YACxB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;gBAClC,IAAI,IAAI,CAAC,GAAG,KAAK,GAAG,EAAE;oBACpB,OAAO,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC;iBAC9B;gBACD,OAAO,IAAI,CAAC;YACd,CAAC,CAAC;SACH,CAAC,CAAC,CAAC;QAEN,YAAO,GAAG,CAAC,GAAW,EAAE,EAAE,CACxB,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YACxB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC;SAC1D,CAAC,CAAC,CAAC;IAgBR,CAAC;IAdC,MAAM;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACnD,oBAAC,IAAI,IACH,GAAG,EAAE,GAAG,EACR,WAAW,EACT,KAAK,CAAC,wGAAwG,EAEhH,aAAa,EAAC,UAAU,EACxB,KAAK,EAAE,UAAU,CAAC,YAAY,IAE7B,QAAQ,CACJ,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { Pressable as NativePressable, } from "react-native";
3
+ export default function Pressable({ children, disabled, onPress, activeOpacity = 0.8, disabledOpacity = 0.8, delayLongPress, hitSlop, style, ...props }) {
4
+ return (React.createElement(NativePressable, { onPress: onPress, disabled: disabled, delayLongPress: delayLongPress ? delayLongPress : 500, hitSlop: hitSlop ? hitSlop : 8, style: ({ pressed }) => {
5
+ return [
6
+ {
7
+ opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1,
8
+ },
9
+ style,
10
+ ];
11
+ }, ...props }, children));
12
+ }
13
+ //# sourceMappingURL=Pressable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pressable.js","sourceRoot":"","sources":["Pressable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,SAAS,IAAI,eAAe,GAG7B,MAAM,cAAc,CAAC;AAQtB,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,aAAa,GAAG,GAAG,EACnB,eAAe,GAAG,GAAG,EACrB,cAAc,EACd,OAAO,EACP,KAAK,EACL,GAAG,KAAK,EACF;IACN,OAAO,CACL,oBAAC,eAAe,IACd,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,EACrD,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAC9B,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;YACrB,OAAO;gBACL;oBACE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;iBAClE;gBACD,KAAK;aACN,CAAC;QACJ,CAAC,KACG,KAAK,IAER,QAAQ,CACO,CACnB,CAAC;AACJ,CAAC"}