@codeleap/mobile 1.9.26 → 1.9.29

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 (133) hide show
  1. package/dist/components/Backdrop.d.ts +66 -0
  2. package/dist/components/Backdrop.js +70 -0
  3. package/dist/components/Backdrop.js.map +1 -0
  4. package/dist/components/Button.d.ts +11 -4
  5. package/dist/components/Button.js +17 -6
  6. package/dist/components/Button.js.map +1 -1
  7. package/dist/components/EmptyPlaceholder.d.ts +12 -0
  8. package/dist/components/EmptyPlaceholder.js +54 -0
  9. package/dist/components/EmptyPlaceholder.js.map +1 -0
  10. package/dist/components/FileInput.js +0 -2
  11. package/dist/components/FileInput.js.map +1 -1
  12. package/dist/components/Gap.d.ts +8 -0
  13. package/dist/components/Gap.js +60 -0
  14. package/dist/components/Gap.js.map +1 -0
  15. package/dist/components/Image.js +2 -2
  16. package/dist/components/Image.js.map +1 -1
  17. package/dist/components/List.d.ts +25 -6
  18. package/dist/components/List.js +20 -3
  19. package/dist/components/List.js.map +1 -1
  20. package/dist/components/Modal/index.d.ts +2 -1
  21. package/dist/components/Modal/index.js +27 -27
  22. package/dist/components/Modal/index.js.map +1 -1
  23. package/dist/components/Modal/styles.d.ts +4 -15
  24. package/dist/components/Modal/styles.js +27 -23
  25. package/dist/components/Modal/styles.js.map +1 -1
  26. package/dist/components/NewModal/index.d.ts +27 -0
  27. package/dist/components/NewModal/index.js +99 -0
  28. package/dist/components/NewModal/index.js.map +1 -0
  29. package/dist/components/NewModal/styles.d.ts +57 -0
  30. package/dist/components/NewModal/styles.js +58 -0
  31. package/dist/components/NewModal/styles.js.map +1 -0
  32. package/dist/components/NewPager/index.js +3 -7
  33. package/dist/components/NewPager/index.js.map +1 -1
  34. package/dist/components/Overlay.js +13 -9
  35. package/dist/components/Overlay.js.map +1 -1
  36. package/dist/components/Scroll.d.ts +4 -2
  37. package/dist/components/Scroll.js.map +1 -1
  38. package/dist/components/SegmentedControl/index.d.ts +42 -0
  39. package/dist/components/SegmentedControl/index.js +137 -0
  40. package/dist/components/SegmentedControl/index.js.map +1 -0
  41. package/dist/components/SegmentedControl/styles.d.ts +54 -0
  42. package/dist/components/SegmentedControl/styles.js +36 -0
  43. package/dist/components/SegmentedControl/styles.js.map +1 -0
  44. package/dist/components/SegmentedControl.d.ts +5 -0
  45. package/dist/components/SegmentedControl.js +32 -0
  46. package/dist/components/SegmentedControl.js.map +1 -0
  47. package/dist/components/Select/index.js +1 -1
  48. package/dist/components/Select/index.js.map +1 -1
  49. package/dist/components/Text.d.ts +8 -3
  50. package/dist/components/Text.js +12 -5
  51. package/dist/components/Text.js.map +1 -1
  52. package/dist/components/TextInput.d.ts +4 -2
  53. package/dist/components/TextInput.js +2 -2
  54. package/dist/components/TextInput.js.map +1 -1
  55. package/dist/components/Touchable.d.ts +5 -3
  56. package/dist/components/Touchable.js +26 -19
  57. package/dist/components/Touchable.js.map +1 -1
  58. package/dist/components/View.js +1 -1
  59. package/dist/components/View.js.map +1 -1
  60. package/dist/components/_Modal/index.d.ts +27 -0
  61. package/dist/components/_Modal/index.js +114 -0
  62. package/dist/components/_Modal/index.js.map +1 -0
  63. package/dist/components/_Modal/styles.d.ts +64 -0
  64. package/dist/components/_Modal/styles.js +60 -0
  65. package/dist/components/_Modal/styles.js.map +1 -0
  66. package/dist/components/components.d.ts +5 -1
  67. package/dist/components/components.js +5 -1
  68. package/dist/components/components.js.map +1 -1
  69. package/dist/index.d.ts +4 -0
  70. package/dist/index.js +18 -1
  71. package/dist/index.js.map +1 -1
  72. package/dist/modules/textInputMask.d.ts +4 -7
  73. package/dist/modules/types/textInputMask.d.ts +5 -10
  74. package/dist/utils/ModalManager/components.d.ts +12 -0
  75. package/dist/utils/ModalManager/components.js +86 -0
  76. package/dist/utils/ModalManager/components.js.map +1 -0
  77. package/dist/utils/ModalManager/context.d.ts +47 -0
  78. package/dist/utils/ModalManager/context.js +196 -0
  79. package/dist/utils/ModalManager/context.js.map +1 -0
  80. package/dist/utils/ModalManager/index.d.ts +10 -0
  81. package/dist/utils/ModalManager/index.js +12 -0
  82. package/dist/utils/ModalManager/index.js.map +1 -0
  83. package/dist/utils/PermissionManager/components.d.ts +18 -0
  84. package/dist/utils/PermissionManager/components.js +52 -0
  85. package/dist/utils/PermissionManager/components.js.map +1 -0
  86. package/dist/utils/PermissionManager/context.d.ts +52 -0
  87. package/dist/utils/PermissionManager/context.js +325 -0
  88. package/dist/utils/PermissionManager/context.js.map +1 -0
  89. package/dist/utils/PermissionManager/index.d.ts +4 -0
  90. package/dist/utils/PermissionManager/index.js +9 -0
  91. package/dist/utils/PermissionManager/index.js.map +1 -0
  92. package/dist/utils/PermissionManager/types.d.ts +13 -0
  93. package/dist/utils/PermissionManager/types.js +3 -0
  94. package/dist/utils/PermissionManager/types.js.map +1 -0
  95. package/dist/utils/hooks.d.ts +6 -0
  96. package/dist/utils/hooks.js +62 -0
  97. package/dist/utils/hooks.js.map +1 -0
  98. package/package.json +2 -1
  99. package/src/components/Backdrop.tsx +77 -0
  100. package/src/components/Button.tsx +31 -8
  101. package/src/components/EmptyPlaceholder.tsx +53 -0
  102. package/src/components/FileInput.tsx +2 -2
  103. package/src/components/Gap.tsx +40 -0
  104. package/src/components/Image.tsx +3 -2
  105. package/src/components/List.tsx +50 -6
  106. package/src/components/Modal/index.tsx +39 -49
  107. package/src/components/Modal/styles.ts +36 -39
  108. package/src/components/NewPager/index.tsx +5 -7
  109. package/src/components/Overlay.tsx +22 -13
  110. package/src/components/Pager/index.tsx +19 -19
  111. package/src/components/Pager/styles.ts +6 -7
  112. package/src/components/Scroll.tsx +3 -1
  113. package/src/components/SegmentedControl/index.tsx +182 -0
  114. package/src/components/SegmentedControl/styles.ts +65 -0
  115. package/src/components/Select/index.tsx +1 -2
  116. package/src/components/Text.tsx +23 -10
  117. package/src/components/TextInput.tsx +4 -2
  118. package/src/components/Touchable.tsx +31 -20
  119. package/src/components/View.tsx +1 -1
  120. package/src/components/_Modal/index.tsx +162 -0
  121. package/src/components/_Modal/styles.ts +125 -0
  122. package/src/components/components.ts +5 -1
  123. package/src/index.ts +6 -0
  124. package/src/modules/imageCropPicker.d.ts +497 -0
  125. package/src/modules/index.d.ts +186 -0
  126. package/src/modules/types/textInputMask.ts +6 -10
  127. package/src/utils/ModalManager/components.tsx +69 -0
  128. package/src/utils/ModalManager/context.tsx +247 -0
  129. package/src/utils/ModalManager/index.ts +13 -0
  130. package/src/utils/PermissionManager/context.tsx +299 -0
  131. package/src/utils/PermissionManager/index.ts +20 -0
  132. package/src/utils/PermissionManager/types.ts +24 -0
  133. package/src/utils/hooks.ts +65 -0
@@ -0,0 +1,497 @@
1
+ /* eslint-disable @typescript-eslint/no-namespace */
2
+ declare module 'react-native-image-crop-picker' {
3
+ /**
4
+ * AVAssetExportPreset presets.
5
+ *
6
+ * @see https://developer.apple.com/documentation/avfoundation/avassetexportsession/export_preset_names_for_quicktime_files_of_a_given_size
7
+ */
8
+ type CompressVideoPresets =
9
+ | '640x480'
10
+ | '960x540'
11
+ | '1280x720'
12
+ | '1920x1080'
13
+ | 'HEVC3840x2160'
14
+ | 'LowQuality'
15
+ | 'MediumQuality'
16
+ | 'HighestQuality'
17
+ | 'Passthrough'
18
+
19
+ /**
20
+ * iOS smart album types
21
+ *
22
+ * @see https://developer.apple.com/documentation/photokit/phassetcollectionsubtype
23
+ */
24
+ type SmartAlbums =
25
+ | 'Regular'
26
+ | 'SyncedEvent'
27
+ | 'SyncedFaces'
28
+ | 'SyncedAlbum'
29
+ | 'Imported'
30
+ | 'PhotoStream'
31
+ | 'CloudShared'
32
+ | 'Generic'
33
+ | 'Panoramas'
34
+ | 'Videos'
35
+ | 'Favorites'
36
+ | 'Timelapses'
37
+ | 'AllHidden'
38
+ | 'RecentlyAdded'
39
+ | 'Bursts'
40
+ | 'SlomoVideos'
41
+ | 'UserLibrary'
42
+ | 'Screenshots'
43
+ | 'SelfPortraits'
44
+ /** >= iOS 10.2 */
45
+ | 'DepthEffect'
46
+ /** >= iOS 10.3 */
47
+ | 'LivePhotos'
48
+ /** >= iOS 11 */
49
+ | 'Animated'
50
+ | 'LongExposure'
51
+
52
+ export interface CommonOptions {
53
+ /**
54
+ * Enable or disable multiple image selection.
55
+ *
56
+ * @default false
57
+ */
58
+ multiple?: boolean
59
+
60
+ /**
61
+ * Min number of files to select when using `multiple` option.
62
+ *
63
+ * @platform iOS only
64
+ * @default 1
65
+ */
66
+ minFiles?: number
67
+
68
+ /**
69
+ * Max number of files to select when using `multiple` option.
70
+ *
71
+ * @platform iOS only
72
+ * @default 5
73
+ */
74
+ maxFiles?: number
75
+
76
+ /**
77
+ * Promise will resolve/reject once ViewController completion block is called.
78
+ *
79
+ * @platform iOS only
80
+ * @default true
81
+ */
82
+ waitAnimationEnd?: boolean
83
+
84
+ /**
85
+ * List of smart albums to choose from.
86
+ *
87
+ * @platform iOS only
88
+ * @default ['UserLibrary', 'PhotoStream', 'Panoramas', 'Videos', 'Bursts']
89
+ */
90
+ smartAlbums?: SmartAlbums[]
91
+
92
+ /**
93
+ * Whether to default to the front camera when opened. Please note that not all
94
+ * Android devices handle this parameter, see
95
+ * [issue #1058](https://github.com/ivpusic/react-native-image-crop-picker/issues/1058).
96
+ *
97
+ * @default false
98
+ */
99
+ useFrontCamera?: boolean
100
+
101
+ /**
102
+ * Text displayed while photo is loading in picker.
103
+ *
104
+ * @default 'Processing assets...'
105
+ */
106
+ loadingLabelText?: string
107
+
108
+ /**
109
+ * Whether to show the number of selected assets.
110
+ *
111
+ * @default true
112
+ */
113
+ showsSelectedCount?: boolean
114
+
115
+ /**
116
+ * Applies a sort order on the creation date on how media is displayed within the
117
+ * albums/detail photo views when opening the image picker.
118
+ *
119
+ * @platform iOS only
120
+ * @default 'none'
121
+ */
122
+ sortOrder?: 'none' | 'asc' | 'desc'
123
+
124
+ /**
125
+ * Whether to display bottom controls.
126
+ *
127
+ * @platform Android only
128
+ * @default false
129
+ */
130
+ hideBottomControls?: boolean
131
+
132
+ /**
133
+ * When set to false, does not write temporary files for the selected images. This is useful
134
+ * to improve performance when you are retrieving file contents with the includeBase64 option
135
+ * and don't need to read files from disk.
136
+ *
137
+ * @platform iOS only
138
+ * @default true
139
+ */
140
+ writeTempFile?: boolean
141
+ }
142
+
143
+ type ImageOptions = CommonOptions & {
144
+ mediaType: 'photo'
145
+
146
+ /**
147
+ * Width of result image when used with `cropping` option.
148
+ */
149
+ width?: number
150
+
151
+ /**
152
+ * Height of result image when used with `cropping` option.
153
+ */
154
+ height?: number
155
+
156
+ /**
157
+ * When set to true, the image file content will be available as a base64-encoded string in
158
+ * the data property. Hint: To use this string as an image source, use it like:
159
+ * <Image source={{uri: `data:${image.mime};base64,${image.data}`}} />
160
+ *
161
+ * @default false
162
+ */
163
+ includeBase64?: boolean
164
+
165
+ /**
166
+ * Include image exif data in the response.
167
+ *
168
+ * @default false
169
+ */
170
+ includeExif?: boolean
171
+
172
+ /**
173
+ * Whether to convert photos to JPG. This will also convert any Live Photo into its JPG representation.
174
+ *
175
+ * @default false
176
+ */
177
+ forceJpg?: boolean
178
+
179
+ /**
180
+ * Enable or disable cropping.
181
+ *
182
+ * @default false
183
+ */
184
+ cropping?: boolean
185
+
186
+ /**
187
+ * When set to true, the image will always fill the mask space.
188
+ *
189
+ * @default true
190
+ */
191
+ avoidEmptySpaceAroundImage?: boolean
192
+
193
+ /**
194
+ * When cropping image, determines ActiveWidget color.
195
+ *
196
+ * @platform Android only
197
+ * @default '#424242'
198
+ */
199
+ cropperActiveWidgetColor?: string
200
+
201
+ /**
202
+ * When cropping image, determines the color of StatusBar.
203
+ *
204
+ * @platform Android only
205
+ * @default '#424242'
206
+ */
207
+ cropperStatusBarColor?: string
208
+
209
+ /**
210
+ * When cropping image, determines the color of Toolbar.
211
+ *
212
+ * @platform Android only
213
+ * @default '#424242'
214
+ */
215
+ cropperToolbarColor?: string
216
+
217
+ /**
218
+ * When cropping image, determines the color of Toolbar text and buttons.
219
+ *
220
+ * @platform Android only
221
+ * @default 'darker orange'
222
+ */
223
+ cropperToolbarWidgetColor?: string
224
+
225
+ /**
226
+ * When cropping image, determines the title of Toolbar.
227
+ *
228
+ * @default 'Edit Photo'
229
+ */
230
+ cropperToolbarTitle?: string
231
+
232
+ /**
233
+ * Enables user to apply custom rectangle area for cropping.
234
+ *
235
+ * @platform iOS only
236
+ * @default false
237
+ */
238
+ freeStyleCropEnabled?: boolean
239
+
240
+ /**
241
+ * cropperTintColor
242
+ */
243
+ cropperTintColor?: string
244
+
245
+ /**
246
+ * Enable or disable circular cropping mask.
247
+ *
248
+ * @default false
249
+ */
250
+ cropperCircleOverlay?: boolean
251
+
252
+ /**
253
+ * Cancel button text.
254
+ *
255
+ * @default 'Cancel'
256
+ */
257
+ cropperCancelText?: string
258
+
259
+ /**
260
+ * Choose button text.
261
+ *
262
+ * @default 'Choose'
263
+ */
264
+ cropperChooseText?: string
265
+
266
+ /**
267
+ * Enable or disable cropper rotate buttons.
268
+ *
269
+ * @platform iOS only
270
+ * @default false
271
+ */
272
+ cropperRotateButtonsHidden?: boolean
273
+
274
+ /**
275
+ * Whether to show the 3x3 grid on top of the image during cropping.
276
+ *
277
+ * @platform Android only
278
+ * @default true
279
+ */
280
+ showCropGuidelines?: boolean
281
+
282
+ /**
283
+ * Whether to show the square crop frame during cropping
284
+ *
285
+ * @platform Android only
286
+ * @default true
287
+ */
288
+ showCropFrame?: boolean
289
+
290
+ /**
291
+ * Whether to enable rotating the image by hand gesture.
292
+ *
293
+ * @platform Android only
294
+ * @default false
295
+ */
296
+ enableRotationGesture?: boolean
297
+
298
+ /**
299
+ * When cropping image, disables the color setters for cropping library.
300
+ *
301
+ * @platform Android only
302
+ * @default false
303
+ */
304
+ disableCropperColorSetters?: boolean
305
+
306
+ /**
307
+ * Compress image with maximum width.
308
+ *
309
+ * @default null
310
+ */
311
+ compressImageMaxWidth?: number
312
+
313
+ /**
314
+ * Compress image with maximum height.
315
+ *
316
+ * @default null
317
+ */
318
+ compressImageMaxHeight?: number
319
+
320
+ /**
321
+ * Compress image with quality (from 0 to 1, where 1 is best quality). On iOS, values larger
322
+ * than 0.8 don't produce a noticeable quality increase in most images, while a value of 0.8
323
+ * will reduce the file size by about half or less compared to a value of 1.
324
+ *
325
+ * @default Android: 1, iOS: 0.8
326
+ */
327
+ compressImageQuality?: number
328
+ }
329
+
330
+ type CropperOptions = ImageOptions & {
331
+ /**
332
+ * Selected image location
333
+ */
334
+ path: string
335
+ }
336
+
337
+ type VideoOptions = CommonOptions & {
338
+ mediaType: 'video'
339
+
340
+ /**
341
+ * Choose which preset will be used for video compression.
342
+ *
343
+ * @platform iOS only
344
+ * @default 'MediumQuality'
345
+ */
346
+ compressVideoPreset?: CompressVideoPresets
347
+ }
348
+
349
+ type AnyOptions = Omit<ImageOptions, 'mediaType'> & Omit<VideoOptions, 'mediaType'> & {
350
+ mediaType?: 'any'
351
+ }
352
+
353
+ export type Options = AnyOptions | VideoOptions | ImageOptions
354
+
355
+ interface ImageVideoCommon {
356
+ /**
357
+ * Selected image location. This is null when the `writeTempFile` option is set to `false`.
358
+ */
359
+ path: string
360
+
361
+ /**
362
+ * Selected image size in bytes.
363
+ */
364
+ size: number
365
+
366
+ /**
367
+ * Selected image/video width.
368
+ */
369
+ width: number
370
+
371
+ /**
372
+ * Selected image/video height.
373
+ */
374
+ height: number
375
+
376
+ /**
377
+ * Selected image MIME type (image/jpeg, image/png, etc).
378
+ */
379
+ mime: string
380
+
381
+ /**
382
+ * Extracted exif data from image. Response format is platform specific.
383
+ */
384
+ exif?: null | object
385
+
386
+ /**
387
+ * Selected image's localidentifier, used for PHAsset searching.
388
+ *
389
+ * @platform iOS only
390
+ */
391
+ localIdentifier?: string
392
+
393
+ /**
394
+ * Selected image's source path, do not have write access.
395
+ *
396
+ * @platform iOS only
397
+ */
398
+ sourceURL?: string
399
+
400
+ /**
401
+ * Selected image/video's filename.
402
+ *
403
+ * @platform iOS only
404
+ */
405
+ filename?: string
406
+
407
+ /**
408
+ * UNIX timestamp when image was created.
409
+ *
410
+ * @platform iOS only
411
+ */
412
+ creationDate?: string
413
+
414
+ /**
415
+ * UNIX timestamp when image was last modified.
416
+ */
417
+ modificationDate?: string
418
+ }
419
+
420
+ export interface Image extends ImageVideoCommon {
421
+ /**
422
+ * Optional base64 selected file representation.
423
+ */
424
+ data?: string | null
425
+
426
+ /**
427
+ * Cropped image rectangle (width, height, x, y).
428
+ */
429
+ cropRect?: CropRect | null
430
+ }
431
+
432
+ export interface Video extends ImageVideoCommon {
433
+ /**
434
+ * Video duration in milliseconds
435
+ */
436
+ duration: number | null
437
+ }
438
+
439
+ export type ImageOrVideo = Image | Video
440
+
441
+ export interface CropRect {
442
+ x: number
443
+ y: number
444
+ width: number
445
+ height: number
446
+ }
447
+
448
+ type PickerErrorCodeCommon =
449
+ | 'E_PICKER_CANCELLED'
450
+ | 'E_NO_IMAGE_DATA_FOUND'
451
+ | 'E_NO_LIBRARY_PERMISSION'
452
+ | 'E_NO_CAMERA_PERMISSION'
453
+ | 'E_ERROR_WHILE_CLEANING_FILES'
454
+
455
+ type PickerErrorCodeIOS =
456
+ | 'E_PICKER_CANNOT_RUN_CAMERA_ON_SIMULATOR'
457
+ | 'E_CROPPER_IMAGE_NOT_FOUND'
458
+ | 'E_CANNOT_SAVE_IMAGE'
459
+ | 'E_CANNOT_PROCESS_VIDEO'
460
+
461
+ type PickerErrorCodeAndroid =
462
+ | 'E_ACTIVITY_DOES_NOT_EXIST'
463
+ | 'E_CALLBACK_ERROR'
464
+ | 'E_FAILED_TO_SHOW_PICKER'
465
+ | 'E_FAILED_TO_OPEN_CAMERA'
466
+ | 'E_CAMERA_IS_NOT_AVAILABLE'
467
+ | 'E_CANNOT_LAUNCH_CAMERA'
468
+
469
+ export type PickerErrorCode = PickerErrorCodeCommon | PickerErrorCodeIOS | PickerErrorCodeAndroid
470
+
471
+ /** Change return type based on `multiple` property. */
472
+ export type PossibleArray<O, T> = O extends { multiple: true } ? T[] : T
473
+
474
+ /** Isolate return type based on `mediaType` property. */
475
+ type MediaType<O> =
476
+ O extends { mediaType: 'photo' } ? Image :
477
+ O extends { mediaType: 'video' } ? Video :
478
+ ImageOrVideo
479
+
480
+ export function openPicker<O extends Options>(options: O): Promise<PossibleArray<O, MediaType<O>>>
481
+ export function openCamera<O extends Options>(options: O): Promise<PossibleArray<O, MediaType<O>>>
482
+ export function openCropper(options: CropperOptions): Promise<Image>
483
+ export function clean(): Promise<void>
484
+ export function cleanSingle(path: string): Promise<void>
485
+
486
+ export interface ImageCropPicker {
487
+ openPicker<O extends Options>(options: O): Promise<PossibleArray<O, MediaType<O>>>
488
+ openCamera<O extends Options>(options: O): Promise<PossibleArray<O, MediaType<O>>>
489
+ openCropper(options: CropperOptions): Promise<Image>
490
+ clean(): Promise<void>
491
+ cleanSingle(path: string): Promise<void>
492
+ }
493
+
494
+ const ImageCropPicker: ImageCropPicker
495
+
496
+ export default ImageCropPicker
497
+ }
@@ -494,3 +494,189 @@ declare module 'react-native-image-crop-picker' {
494
494
 
495
495
  export default ImageCropPicker
496
496
  }
497
+
498
+ import * as React from 'react'
499
+ import {
500
+ ScrollViewProps,
501
+ FlatListProps,
502
+ SectionListProps,
503
+ } from 'react-native'
504
+ export namespace KeyboardAwareScrollViewTypes {
505
+ interface KeyboardAwareProps {
506
+ /**
507
+ * Catches the reference of the component.
508
+ *
509
+ *
510
+ * @type {function}
511
+ * @memberof KeyboardAwareProps
512
+ */
513
+ innerRef?: (ref: JSX.Element) => void
514
+ /**
515
+ * Adds an extra offset that represents the TabBarIOS height.
516
+ *
517
+ * Default is false
518
+ * @type {boolean}
519
+ * @memberof KeyboardAwareProps
520
+ */
521
+ viewIsInsideTabBar?: boolean
522
+
523
+ /**
524
+ * Coordinates that will be used to reset the scroll when the keyboard hides.
525
+ *
526
+ * @type {{
527
+ * x: number,
528
+ * y: number
529
+ * }}
530
+ * @memberof KeyboardAwareProps
531
+ */
532
+ resetScrollToCoords?: {
533
+ x: number
534
+ y: number
535
+ }
536
+
537
+ /**
538
+ * Lets the user enable or disable automatic resetScrollToCoords
539
+ *
540
+ * @type {boolean}
541
+ * @memberof KeyboardAwareProps
542
+ */
543
+ enableResetScrollToCoords?: boolean
544
+
545
+ /**
546
+ * When focus in TextInput will scroll the position
547
+ *
548
+ * Default is true
549
+ *
550
+ * @type {boolean}
551
+ * @memberof KeyboardAwareProps
552
+ */
553
+
554
+ enableAutomaticScroll?: boolean
555
+ /**
556
+ * Enables keyboard aware settings for Android
557
+ *
558
+ * Default is false
559
+ *
560
+ * @type {boolean}
561
+ * @memberof KeyboardAwareProps
562
+ */
563
+ enableOnAndroid?: boolean
564
+
565
+ /**
566
+ * Adds an extra offset when focusing the TextInputs.
567
+ *
568
+ * Default is 75
569
+ * @type {number}
570
+ * @memberof KeyboardAwareProps
571
+ */
572
+ extraHeight?: number
573
+
574
+ /**
575
+ * Adds an extra offset to the keyboard.
576
+ * Useful if you want to stick elements above the keyboard.
577
+ *
578
+ * Default is 0
579
+ *
580
+ * @type {number}
581
+ * @memberof KeyboardAwareProps
582
+ */
583
+ extraScrollHeight?: number
584
+
585
+ /**
586
+ * Sets the delay time before scrolling to new position
587
+ *
588
+ * Default is 250
589
+ *
590
+ * @type {number}
591
+ * @memberof KeyboardAwareProps
592
+ */
593
+ keyboardOpeningTime?: number
594
+
595
+ /**
596
+ * Callback when the keyboard will show.
597
+ *
598
+ * @param frames Information about the keyboard frame and animation.
599
+ */
600
+ onKeyboardWillShow?: (frames: Object) => void
601
+
602
+ /**
603
+ * Callback when the keyboard did show.
604
+ *
605
+ * @param frames Information about the keyboard frame and animation.
606
+ */
607
+ onKeyboardDidShow?: (frames: Object) => void
608
+
609
+ /**
610
+ * Callback when the keyboard will hide.
611
+ *
612
+ * @param frames Information about the keyboard frame and animation.
613
+ */
614
+ onKeyboardWillHide?: (frames: Object) => void
615
+
616
+ /**
617
+ * Callback when the keyboard did hide.
618
+ *
619
+ * @param frames Information about the keyboard frame and animation.
620
+ */
621
+ onKeyboardDidHide?: (frames: Object) => void
622
+
623
+ /**
624
+ * Callback when the keyboard frame will change.
625
+ *
626
+ * @param frames Information about the keyboard frame and animation.
627
+ */
628
+ onKeyboardWillChangeFrame?: (frames: Object) => void
629
+
630
+ /**
631
+ * Callback when the keyboard frame did change.
632
+ *
633
+ * @param frames Information about the keyboard frame and animation.
634
+ */
635
+ onKeyboardDidChangeFrame?: (frames: Object) => void
636
+ }
637
+
638
+ interface KeyboardAwareScrollViewProps
639
+ extends KeyboardAwareProps,
640
+ ScrollViewProps {}
641
+ interface KeyboardAwareFlatListProps<ItemT>
642
+ extends KeyboardAwareProps,
643
+ FlatListProps<ItemT> {}
644
+ interface KeyboardAwareSectionListProps<ItemT>
645
+ extends KeyboardAwareProps,
646
+ SectionListProps<ItemT> {}
647
+
648
+ interface KeyboardAwareState {
649
+ keyboardSpace: number
650
+ }
651
+
652
+ declare class ScrollableComponent<P, S> extends React.Component<P, S> {
653
+ getScrollResponder: () => void
654
+
655
+ scrollToPosition: (x: number, y: number, animated?: boolean) => void
656
+
657
+ scrollToEnd: (animated?: boolean) => void
658
+
659
+ scrollForExtraHeightOnAndroid: (extraHeight: number) => void
660
+
661
+ scrollToFocusedInput: (
662
+ reactNode: Object,
663
+ extraHeight?: number,
664
+ keyboardOpeningTime?: number
665
+ ) => void
666
+ }
667
+
668
+ export class KeyboardAwareMixin {}
669
+ export class KeyboardAwareScrollView extends ScrollableComponent<
670
+ KeyboardAwareScrollViewProps,
671
+ KeyboardAwareState
672
+ > {}
673
+ export class KeyboardAwareFlatList extends ScrollableComponent<
674
+ KeyboardAwareFlatListProps<any>,
675
+ KeyboardAwareState
676
+ > {}
677
+ export class KeyboardAwareSectionList extends ScrollableComponent<
678
+ KeyboardAwareSectionListProps<any>,
679
+ KeyboardAwareState
680
+ > {}
681
+
682
+ }
@@ -1,13 +1,9 @@
1
1
  import { FormTypes } from '@codeleap/common'
2
- import { ComponentPropsWithoutRef } from 'react'
3
- import { TextInput as NativeTextInput } from 'react-native'
4
- type NativeProps = ComponentPropsWithoutRef<typeof NativeTextInput>
5
- // @ts-ignore
2
+ import { TextInputProps } from 'react-native'
3
+
6
4
  import { TextInputMaskProps as RNTextInputMaskProps } from 'react-native-masked-text'
7
5
 
8
- export type TextInputMaskProps = {
9
- masking: FormTypes.TextField['masking'] & {
10
- type: RNTextInputMaskProps['type']
11
- }
12
- onChangeText?: (maskedText:string, unmaskedText:string) => any
13
- } & NativeProps & RNTextInputMaskProps
6
+ export type TextInputMaskProps =Omit<RNTextInputMaskProps, keyof TextInputProps > & {
7
+ masking: FormTypes.TextField['masking']
8
+ onChangeText: RNTextInputMaskProps['onChangeText']
9
+ }