@wavemaker/app-rn-runtime 11.3.2-rc.5253 → 11.4.0-next.1417012

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 (221) hide show
  1. app-rn-runtime/actions/notification-action.js +4 -5
  2. app-rn-runtime/actions/notification-action.js.map +1 -1
  3. app-rn-runtime/components/advanced/carousel/carousel-content/carousel-content.component.js +1 -1
  4. app-rn-runtime/components/advanced/carousel/carousel-content/carousel-content.component.js.map +1 -1
  5. app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js +1 -1
  6. app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js.map +1 -1
  7. app-rn-runtime/components/advanced/carousel/carousel.component.js +1 -1
  8. app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
  9. app-rn-runtime/components/advanced/login/login.component.js +1 -1
  10. app-rn-runtime/components/advanced/login/login.component.js.map +1 -1
  11. app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.component.js +5 -5
  12. app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.component.js.map +1 -1
  13. app-rn-runtime/components/advanced/webview/webview.component.js +1 -1
  14. app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
  15. app-rn-runtime/components/basic/anchor/anchor.component.js +1 -1
  16. app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
  17. app-rn-runtime/components/basic/button/button.component.js +1 -1
  18. app-rn-runtime/components/basic/button/button.component.js.map +1 -1
  19. app-rn-runtime/components/basic/buttongroup/buttongroup.component.js +1 -1
  20. app-rn-runtime/components/basic/buttongroup/buttongroup.component.js.map +1 -1
  21. app-rn-runtime/components/basic/icon/icon.component.js +1 -1
  22. app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
  23. app-rn-runtime/components/basic/label/label.component.js +1 -1
  24. app-rn-runtime/components/basic/label/label.component.js.map +1 -1
  25. app-rn-runtime/components/basic/message/message.component.js +1 -1
  26. app-rn-runtime/components/basic/message/message.component.js.map +1 -1
  27. app-rn-runtime/components/basic/picture/picture.component.js +26 -37
  28. app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
  29. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +2 -3
  30. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
  31. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +1 -1
  32. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
  33. app-rn-runtime/components/basic/search/search.component.js +1 -4
  34. app-rn-runtime/components/basic/search/search.component.js.map +1 -1
  35. app-rn-runtime/components/basic/spinner/spinner.component.js +1 -1
  36. app-rn-runtime/components/basic/spinner/spinner.component.js.map +1 -1
  37. app-rn-runtime/components/container/accordion/accordion.component.js +1 -1
  38. app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
  39. app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +1 -1
  40. app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
  41. app-rn-runtime/components/container/container.component.js +1 -1
  42. app-rn-runtime/components/container/container.component.js.map +1 -1
  43. app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js +1 -1
  44. app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js.map +1 -1
  45. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js +1 -1
  46. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js.map +1 -1
  47. app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js +1 -1
  48. app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js.map +1 -1
  49. app-rn-runtime/components/container/linearlayout/linearlayout.component.js +1 -1
  50. app-rn-runtime/components/container/linearlayout/linearlayout.component.js.map +1 -1
  51. app-rn-runtime/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js +1 -1
  52. app-rn-runtime/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js.map +1 -1
  53. app-rn-runtime/components/container/panel/panel-content/panel-content.component.js +1 -1
  54. app-rn-runtime/components/container/panel/panel-content/panel-content.component.js.map +1 -1
  55. app-rn-runtime/components/container/panel/panel-footer/panel-footer.component.js +1 -1
  56. app-rn-runtime/components/container/panel/panel-footer/panel-footer.component.js.map +1 -1
  57. app-rn-runtime/components/container/panel/panel.component.js +1 -1
  58. app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
  59. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +4 -12
  60. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
  61. app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js +1 -2
  62. app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
  63. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +2 -5
  64. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
  65. app-rn-runtime/components/container/tabs/tabs.component.js +64 -80
  66. app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
  67. app-rn-runtime/components/container/tabs/tabs.props.js +0 -1
  68. app-rn-runtime/components/container/tabs/tabs.props.js.map +1 -1
  69. app-rn-runtime/components/container/tabs/tabs.styles.js +1 -1
  70. app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
  71. app-rn-runtime/components/container/tile/tile.component.js +1 -1
  72. app-rn-runtime/components/container/tile/tile.component.js.map +1 -1
  73. app-rn-runtime/components/container/wizard/wizard.component.js +1 -1
  74. app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
  75. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +1 -1
  76. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  77. app-rn-runtime/components/data/card/card-content/card-content.component.js +1 -1
  78. app-rn-runtime/components/data/card/card-content/card-content.component.js.map +1 -1
  79. app-rn-runtime/components/data/card/card-footer/card-footer.component.js +1 -1
  80. app-rn-runtime/components/data/card/card-footer/card-footer.component.js.map +1 -1
  81. app-rn-runtime/components/data/card/card.component.js +1 -1
  82. app-rn-runtime/components/data/card/card.component.js.map +1 -1
  83. app-rn-runtime/components/data/form/form-action/form-action.component.js +6 -0
  84. app-rn-runtime/components/data/form/form-action/form-action.component.js.map +1 -1
  85. app-rn-runtime/components/data/form/form-body/form-body.component.js +1 -1
  86. app-rn-runtime/components/data/form/form-body/form-body.component.js.map +1 -1
  87. app-rn-runtime/components/data/form/form-field/form-field.component.js +1 -1
  88. app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
  89. app-rn-runtime/components/data/form/form-footer/form-footer.component.js +1 -1
  90. app-rn-runtime/components/data/form/form-footer/form-footer.component.js.map +1 -1
  91. app-rn-runtime/components/data/form/form.component.js +31 -2
  92. app-rn-runtime/components/data/form/form.component.js.map +1 -1
  93. app-rn-runtime/components/data/list/list-template/list-template.component.js +1 -1
  94. app-rn-runtime/components/data/list/list-template/list-template.component.js.map +1 -1
  95. app-rn-runtime/components/data/list/list.component.js +8 -17
  96. app-rn-runtime/components/data/list/list.component.js.map +1 -1
  97. app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js +2 -3
  98. app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js.map +1 -1
  99. app-rn-runtime/components/device/camera/camera.component.js +4 -9
  100. app-rn-runtime/components/device/camera/camera.component.js.map +1 -1
  101. app-rn-runtime/components/device/camera/camera.props.js +1 -0
  102. app-rn-runtime/components/device/camera/camera.props.js.map +1 -1
  103. app-rn-runtime/components/dialogs/dialog/dialog.component.js +1 -1
  104. app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
  105. app-rn-runtime/components/dialogs/dialogactions/dialogactions.component.js +1 -1
  106. app-rn-runtime/components/dialogs/dialogactions/dialogactions.component.js.map +1 -1
  107. app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js +1 -1
  108. app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
  109. app-rn-runtime/components/input/baseinput/baseinput.component.js +0 -7
  110. app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
  111. app-rn-runtime/components/input/calendar/calendar.component.js +1 -1
  112. app-rn-runtime/components/input/calendar/calendar.component.js.map +1 -1
  113. app-rn-runtime/components/input/checkbox/checkbox.component.js +16 -1
  114. app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
  115. app-rn-runtime/components/input/checkboxset/checkboxset.component.js +38 -0
  116. app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
  117. app-rn-runtime/components/input/composite/composite.component.js +1 -1
  118. app-rn-runtime/components/input/composite/composite.component.js.map +1 -1
  119. app-rn-runtime/components/input/epoch/base-datetime.component.js +1 -1
  120. app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
  121. app-rn-runtime/components/input/fileupload/fileupload.component.js +1 -1
  122. app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
  123. app-rn-runtime/components/input/number/number.component.js +9 -0
  124. app-rn-runtime/components/input/number/number.component.js.map +1 -1
  125. app-rn-runtime/components/input/radioset/radioset.component.js +40 -0
  126. app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
  127. app-rn-runtime/components/input/rating/rating.component.js +1 -1
  128. app-rn-runtime/components/input/rating/rating.component.js.map +1 -1
  129. app-rn-runtime/components/input/slider/slider.component.js +1 -1
  130. app-rn-runtime/components/input/slider/slider.component.js.map +1 -1
  131. app-rn-runtime/components/input/switch/switch.component.js +22 -19
  132. app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
  133. app-rn-runtime/components/input/switch/switch.styles.js +7 -7
  134. app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
  135. app-rn-runtime/components/input/text/text.component.js +10 -1
  136. app-rn-runtime/components/input/text/text.component.js.map +1 -1
  137. app-rn-runtime/components/input/textarea/textarea.component.js +10 -0
  138. app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
  139. app-rn-runtime/components/input/toggle/toggle.component.js +1 -1
  140. app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
  141. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +1 -1
  142. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
  143. app-rn-runtime/components/navigation/basenav/basenav.props.js +0 -1
  144. app-rn-runtime/components/navigation/basenav/basenav.props.js.map +1 -1
  145. app-rn-runtime/components/navigation/menu/menu.component.js +1 -2
  146. app-rn-runtime/components/navigation/menu/menu.component.js.map +1 -1
  147. app-rn-runtime/components/navigation/navbar/navbar.component.js +0 -2
  148. app-rn-runtime/components/navigation/navbar/navbar.component.js.map +1 -1
  149. app-rn-runtime/components/navigation/navitem/navitem.component.js +3 -4
  150. app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
  151. app-rn-runtime/components/navigation/navitem/navitem.props.js +0 -1
  152. app-rn-runtime/components/navigation/navitem/navitem.props.js.map +1 -1
  153. app-rn-runtime/components/navigation/popover/popover.component.js +1 -1
  154. app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
  155. app-rn-runtime/components/page/content/content.component.js +1 -1
  156. app-rn-runtime/components/page/content/content.component.js.map +1 -1
  157. app-rn-runtime/components/page/left-panel/left-panel.component.js +1 -1
  158. app-rn-runtime/components/page/left-panel/left-panel.component.js.map +1 -1
  159. app-rn-runtime/components/page/page-content/page-content.component.js +2 -2
  160. app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
  161. app-rn-runtime/components/page/page.component.js +1 -1
  162. app-rn-runtime/components/page/page.component.js.map +1 -1
  163. app-rn-runtime/components/page/partial/partial.component.js +1 -1
  164. app-rn-runtime/components/page/partial/partial.component.js.map +1 -1
  165. app-rn-runtime/components/page/partial-container/partial-container.component.js +1 -1
  166. app-rn-runtime/components/page/partial-container/partial-container.component.js.map +1 -1
  167. app-rn-runtime/components/page/partial-container/partial-container.styles.js +1 -2
  168. app-rn-runtime/components/page/partial-container/partial-container.styles.js.map +1 -1
  169. app-rn-runtime/components/page/tabbar/tabbar.component.js +1 -2
  170. app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
  171. app-rn-runtime/components/prefab/prefab-container.component.js +1 -1
  172. app-rn-runtime/components/prefab/prefab-container.component.js.map +1 -1
  173. app-rn-runtime/core/base.component.js +41 -113
  174. app-rn-runtime/core/base.component.js.map +1 -1
  175. app-rn-runtime/core/imageSizeEstimator.js +0 -1
  176. app-rn-runtime/core/imageSizeEstimator.js.map +1 -1
  177. app-rn-runtime/core/injector.js +1 -15
  178. app-rn-runtime/core/injector.js.map +1 -1
  179. app-rn-runtime/core/tappable.component.js +2 -9
  180. app-rn-runtime/core/tappable.component.js.map +1 -1
  181. app-rn-runtime/core/utils.js +0 -6
  182. app-rn-runtime/core/utils.js.map +1 -1
  183. app-rn-runtime/package.json +5 -5
  184. app-rn-runtime/runtime/App.js +14 -13
  185. app-rn-runtime/runtime/App.js.map +1 -1
  186. app-rn-runtime/runtime/App.navigator.js +12 -2
  187. app-rn-runtime/runtime/App.navigator.js.map +1 -1
  188. app-rn-runtime/runtime/base-fragment.component.js +4 -6
  189. app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
  190. app-rn-runtime/runtime/navigator/drawer.navigator.js +0 -4
  191. app-rn-runtime/runtime/navigator/drawer.navigator.js.map +1 -1
  192. app-rn-runtime/runtime/navigator/stack.navigator.js +1 -5
  193. app-rn-runtime/runtime/navigator/stack.navigator.js.map +1 -1
  194. app-rn-runtime/runtime/services/device/camera-service.js +6 -28
  195. app-rn-runtime/runtime/services/device/camera-service.js.map +1 -1
  196. app-rn-runtime/runtime/services/device/scan-service.js +14 -15
  197. app-rn-runtime/runtime/services/device/scan-service.js.map +1 -1
  198. app-rn-runtime/styles/style-prop.validator.js +6 -11
  199. app-rn-runtime/styles/style-prop.validator.js.map +1 -1
  200. app-rn-runtime/styles/theme.js +36 -5
  201. app-rn-runtime/styles/theme.js.map +1 -1
  202. app-rn-runtime/variables/device/camera/capture-image.operation.js.map +1 -1
  203. app-rn-runtime/variables/device/camera/capture-video.operation.js.map +1 -1
  204. app-rn-runtime/variables/device/file/upload-file.operation.js +21 -43
  205. app-rn-runtime/variables/device/file/upload-file.operation.js.map +1 -1
  206. app-rn-runtime/variables/service-variable.js +7 -18
  207. app-rn-runtime/variables/service-variable.js.map +1 -1
  208. app-rn-runtime/components/basic/video/video.component.js +0 -56
  209. app-rn-runtime/components/basic/video/video.component.js.map +0 -1
  210. app-rn-runtime/components/basic/video/video.props.js +0 -22
  211. app-rn-runtime/components/basic/video/video.props.js.map +0 -1
  212. app-rn-runtime/components/basic/video/video.styles.js +0 -11
  213. app-rn-runtime/components/basic/video/video.styles.js.map +0 -1
  214. app-rn-runtime/core/asset.provider.js +0 -5
  215. app-rn-runtime/core/asset.provider.js.map +0 -1
  216. app-rn-runtime/gestures/swipe.animation.js +0 -105
  217. app-rn-runtime/gestures/swipe.animation.js.map +0 -1
  218. app-rn-runtime/styles/background.component.js +0 -259
  219. app-rn-runtime/styles/background.component.js.map +0 -1
  220. app-rn-runtime/styles/style-props.js +0 -93
  221. app-rn-runtime/styles/style-props.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","get","filter","isNil","injector","toBoolean","toNumber","BaseComponent","BaseProps","BASE_THEME","ThemeProvider","VariableEvents","default","_viewPort","EVENTS","viewportEvents","WmFormField","WmForm","ToastConsumer","spinnerService","AppI18nService","FragmentProps","BaseFragment","constructor","props","defaultProps","createElement","text","title","okButtonText","cancelButtonText","onOk","onCancel","onClose","App","appConfig","app","formatters","Actions","Object","assign","Variables","cleanup","push","subscribe","ORIENTATION_CHANGE","$new","$old","isDetached","targetWidget","invokeEventCallback","proxy","screenWidth","width","screenHeight","height","SIZE_CHANGE","theme","destroy","baseUrl","url","resourceBaseUrl","onDestroy","onContentReady","onReady","refresh","onComponentChange","w","onComponentInit","id","name","Widgets","formWidgets","formFields","parentFormRef","pid","forEach","ff","formKey","registerFormFields","formfield","formRef","fragments","onComponentDestroy","formfields","handleUrl","startsWith","getDateFormat","fmt","dateFormat","replace","getTimeFormat","timeFormat","getDateTimeFormat","dateTimeFormat","getCurrencySymbol","currencyCode","getStyle","classes","inlineStyles","trim","length","mergeStyle","resetAppLocale","appLocale","messages","values","f","eval","fn","failOnError","call","e","val","componentWillUnmount","componentDidMount","memoize","key","o","_memoize","initVariableSpinner","variables","v","actions","concat","map","BEFORE_INVOKE","show","message","spinner","AFTER_INVOKE","hide","onFragmentReady","cleanUpVariablesandActions","fragmentVariables","fragmentActions","startUpActions","a","invoke","Promise","all","startUpVariables","s","catch","then","startUpVariablesLoaded","showContent","onAttach","watcher","isActive","unmute","refreshdataonattach","componentWillAttach","onDetach","mute","componentWillDetach","forceUpdate","render","autoUpdateVariables","value","invokeOnParamChange","toastService","toaster","renderWidget"],"sources":["base-fragment.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport { get, filter, isNil } from 'lodash';\n\nimport AppConfig from '@wavemaker/app-rn-runtime/core/AppConfig';\nimport { Formatter } from '@wavemaker/app-rn-runtime/core/formatters';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\nimport { toBoolean, toNumber } from '@wavemaker/app-rn-runtime/core/utils';\nimport { BaseComponent, BaseComponentState, BaseStyles, BaseProps, LifecycleListener } from '@wavemaker/app-rn-runtime/core/base.component';\nimport BASE_THEME, { Theme, ThemeProvider } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseVariable, VariableEvents } from '@wavemaker/app-rn-runtime/variables/base-variable';\nimport { default as _viewPort, EVENTS as viewportEvents } from '@wavemaker/app-rn-runtime/core/viewport';\nimport App from './App';\nimport WmFormField from '@wavemaker/app-rn-runtime/components/data/form/form-field/form-field.component';\nimport WmForm from '@wavemaker/app-rn-runtime/components/data/form/form.component';\nimport { ToastConsumer, ToastService } from '@wavemaker/app-rn-runtime/core/toast.service';\nimport spinnerService from '@wavemaker/app-rn-runtime/runtime/services/app-spinner.service';\n\nimport AppI18nService from './services/app-i18n.service';\nimport { Watcher } from './watcher';\n\nexport class FragmentProps extends BaseProps {\n\n}\n\nexport interface FragmentState<T extends FragmentProps> extends BaseComponentState<T> {}\n\nexport type FragmentStyles = BaseStyles & {};\nexport default abstract class BaseFragment<P extends FragmentProps, S extends FragmentState<P>> extends BaseComponent<P, S, FragmentStyles> implements LifecycleListener {\n public App: App;\n public onReady: Function = () => {};\n public baseUrl = '';\n public resourceBaseUrl = '';\n public targetWidget = null as unknown as BaseComponent<any, any, any>;\n public Widgets: any = {};\n public Variables: any = {};\n public theme: Theme = BASE_THEME;\n public appLocale: any = {};\n private startUpVariables: string[] = [];\n private startUpVariablesLoaded = false;\n private startUpActions: string[] = [];\n private autoUpdateVariables: string[] = [];\n private cleanUpVariablesandActions: BaseVariable<any>[] = [];\n public fragmentVariables: any = {};\n public fragmentActions: any = {};\n public Actions: any = {};\n public appConfig = injector.get<AppConfig>('APP_CONFIG');\n public cache = false;\n public refreshdataonattach= true;\n public isReactNativeApp = true;\n public fragments: any = {};\n public isDetached = false;\n public _memoize = {} as any;\n public toaster: any;\n public formatters: Map<string, Formatter>;\n public serviceDefinitions = {} as any;\n public Viewport = _viewPort;\n public loadingMessage = React.createElement(Text, [] as any, ['loading...']);\n public showContent = false;\n public notification = {\n text: '',\n title: '',\n okButtonText: '',\n cancelButtonText: '',\n onOk: () => {},\n onCancel: () => {},\n onClose: () => {}\n };\n public watcher: Watcher = null as any;\n constructor(props: P, defaultProps?: P) {\n super(props, null as any, defaultProps);\n this.App = this.appConfig.app;\n this.formatters = this.App.formatters;\n this.Actions = Object.assign({}, this.App.Actions);\n this.Variables = Object.assign({}, this.App.Variables);\n this.cleanup.push(_viewPort.subscribe(viewportEvents.ORIENTATION_CHANGE, ($new: any, $old: any) => {\n !this.isDetached && this.targetWidget && this.targetWidget.invokeEventCallback('onOrientationchange', [null, this.proxy,\n {screenWidth: _viewPort.width,\n screenHeight: _viewPort.height}]);\n }));\n this.cleanup.push(_viewPort.subscribe(viewportEvents.SIZE_CHANGE, ($new: any, $old: any) => {\n !this.isDetached && this.targetWidget && this.targetWidget.invokeEventCallback('onResize', [null, this.proxy,\n {screenWidth: $new.width,\n screenHeight: $new.height}]);\n }));\n this.cleanup.push(() => this.theme?.destroy());\n this.baseUrl = this.appConfig.url;\n this.resourceBaseUrl = this.appConfig.url;\n this.cleanup.push(() => this.onDestroy());\n }\n\n onContentReady() {\n this.onReady();\n this.appConfig.refresh();\n this.targetWidget && this.targetWidget.invokeEventCallback('onLoad', [null, this.proxy]);\n this.onContentReady = () => {};\n }\n\n onComponentChange(w: BaseComponent<any, any, any>) {\n this.refresh();\n }\n\n onComponentInit(w: BaseComponent<any, any, any>) {\n const id = w.props.id || w.props.name;\n\n if (w instanceof WmForm) {\n if (!this.Widgets[id]) {\n this.Widgets[id] = w;\n }\n const formWidgets = this.Widgets[id].formWidgets;\n const formFields = this.Widgets[id].formFields;\n this.Widgets[id] = w;\n if (w.parentFormRef) {\n let pid = w.parentFormRef.props.id || w.parentFormRef.props.name;\n formFields.forEach((ff: any) => {\n const formKey = ff.props.formKey || ff.props.name;\n this.Widgets[pid].formFields.push(ff);\n this.Widgets[pid].formWidgets[formKey] = formWidgets[ff.props.name];\n });\n }\n w.registerFormFields(formFields, formWidgets);\n return;\n }\n if (w.props.formfield) {\n if (!this.Widgets[w.props.formRef]) {\n this.Widgets[w.props.formRef] = {formFields: [], formWidgets: {}};\n } else if (!this.Widgets[w.props.formRef].formFields) {\n this.Widgets[w.props.formRef].formFields = [];\n }\n this.Widgets[w.props.formRef].formWidgets[w.props.name] = w;\n return;\n }\n if (w instanceof WmFormField) {\n if (!this.Widgets[w.props.formRef]) {\n this.Widgets[w.props.formRef] = {};\n }\n if (!this.Widgets[w.props.formRef].formFields) {\n this.Widgets[w.props.formRef].formFields = [];\n }\n this.Widgets[w.props.formRef].formWidgets = this.Widgets[w.props.formRef].formWidgets || {};\n this.Widgets[w.props.formRef].formFields.push(w);\n return;\n }\n this.Widgets[id] = w;\n if (w instanceof BaseFragment && w !== this) {\n this.fragments[id] = w;\n }\n }\n\n onComponentDestroy(w: BaseComponent<any, any, any>) {\n const id = w.props.id || w.props.name;\n delete this.Widgets[id];\n if (w instanceof BaseFragment) {\n delete this.fragments[id];\n }\n if (w instanceof WmForm) {\n w.formWidgets = {};\n w.formFields = [];\n w.formfields = {};\n }\n }\n\n handleUrl(url: string) {\n if (!url.startsWith('http') && !url.startsWith('file:')) {\n return this.appConfig.url + (url.startsWith('/') ? '' : '/') + url;\n }\n return url;\n }\n\n getDateFormat(fmt?: string) {\n // getting formats from appLocale when app locale is loaded locally.\n return (fmt || AppI18nService.dateFormat || get(this.appConfig, 'appLocale.formats.date')).replace(/d/g, 'D').replace(/E/g, 'd').replace(/y/g, 'Y');\n }\n\n getTimeFormat(fmt?: string) {\n return fmt || AppI18nService.timeFormat || get(this.appConfig, 'appLocale.formats.time');\n }\n\n getDateTimeFormat(fmt?: string) {\n return (fmt || AppI18nService.dateTimeFormat || (get(this.appConfig, 'appLocale.formats.date') + ' ' + get(this.appConfig, 'appLocale.formats.time'))).replace(/d/g, 'D').replace(/E/g, 'd').replace(/y/g, 'Y');\n }\n\n getCurrencySymbol(fmt?: string) {\n return (fmt || AppI18nService.currencyCode || 'USD');\n }\n\n getStyle(classes: string, inlineStyles:any = {}) {\n if (classes && classes.trim().length > 0) {\n return this.theme.mergeStyle({}, this.theme.getStyle(classes), inlineStyles);\n }\n return inlineStyles;\n }\n\n resetAppLocale() {\n this.appLocale = this.appConfig.appLocale.messages;\n Object.values(this.fragments).forEach((f: any) => (f as BaseFragment<any, any>).resetAppLocale());\n }\n\n eval(fn: Function, failOnError = false) {\n try {\n return fn.call(this);\n } catch (e) {\n if (failOnError) {\n throw e;\n } else {\n return null;\n }\n }\n }\n\n toBoolean(val: any) {\n if (isNil(val)) {\n return val;\n }\n return toBoolean(val);\n }\n\n toNumber(val: any) {\n if (isNil(val)) {\n return val;\n }\n return toNumber(val);\n }\n\n componentWillUnmount() {\n super.componentWillUnmount();\n this.targetWidget && this.targetWidget.invokeEventCallback('onDestroy', [null, this.proxy]);\n }\n\n componentDidMount(): void {\n this.resetAppLocale();\n super.componentDidMount();\n }\n\n memoize(key: string, o: any) {\n if (!this._memoize[key]) {\n this._memoize[key] = o;\n }\n return this._memoize[key];\n }\n\n initVariableSpinner() {\n let variables = filter(this.Variables, (v: BaseVariable<any>) => !!get(v, 'config.spinnerContext'));\n const actions = filter(this.Actions, (v: BaseVariable<any>) => !!get(v, 'config.spinnerContext'));\n variables = variables.concat(actions);\n if (!variables.length) {\n return;\n }\n this.cleanup.push(...variables.map(v => {\n return ((v as BaseVariable<any>)\n .subscribe(VariableEvents.BEFORE_INVOKE, () => {\n spinnerService.show({\n message: get(v, 'config.spinnerMessage'),\n spinner: this.App.appConfig.spinner\n });\n }))\n }));\n this.cleanup.push(...variables.map(v => {\n return ((v as BaseVariable<any>)\n .subscribe(VariableEvents.AFTER_INVOKE, () => {\n spinnerService.hide();\n }));\n }));\n }\n\n onFragmentReady() {\n this.cleanup.push(...Object.values({...this.Variables, ...this.Actions}).map(v => {\n return ((v as BaseVariable<any>)\n .subscribe(VariableEvents.AFTER_INVOKE, () => this.App.refresh()));\n }));\n this.initVariableSpinner();\n this.cleanUpVariablesandActions.push(...Object.values({...this.fragmentVariables, ...this.fragmentActions} as BaseVariable<any>));\n this.startUpActions.map(a => this.Actions[a] && this.Actions[a].invoke());\n return Promise.all(this.startUpVariables.map(s => this.Variables[s] && this.Variables[s].invoke()))\n .catch(() => {\n // catch errors and show content\n })\n .then(() => {\n this.startUpVariablesLoaded = true;\n this.showContent = true;\n this.appConfig.refresh();\n });\n }\n\n onAttach() {\n this.isDetached = false;\n this.watcher.isActive = true;\n this.resetAppLocale();\n Object.values(this.fragments).forEach((f: any) => f.onAttach());\n this.cleanUpVariablesandActions.forEach((v: any) => v.unmute && v.unmute());\n this.targetWidget?.invokeEventCallback('onAttach', [null, this.proxy]);\n if (this.refreshdataonattach) {\n Promise.all(this.startUpVariables.map(s => this.Variables[s] && this.Variables[s].invoke()));\n }\n Object.values(this.Widgets).forEach((w: any) => { \n w.componentWillAttach && w.componentWillAttach();\n });\n }\n\n onDetach() {\n this.isDetached = true;\n this.watcher.isActive = false;\n Object.values(this.fragments).forEach((f: any) => f.onDetach());\n this.cleanUpVariablesandActions.forEach((v: any) => v.mute && v.mute());\n this.targetWidget?.invokeEventCallback('onDetach', [null, this.proxy]);\n Object.values(this.Widgets).forEach((w: any) => { \n w.componentWillDetach && w.componentWillDetach();\n });\n }\n\n onDestroy() {\n this.cleanUpVariablesandActions.forEach((v: any) => v.destroy());\n this.watcher.destroy();\n }\n\n refresh() {\n (injector.get('AppConfig') as AppConfig).refresh();\n }\n\n forceUpdate() {\n super.forceUpdate();\n Object.values(this.fragments).forEach((f: any) => (f as BaseFragment<any, any>).forceUpdate());\n }\n\n render() {\n if (this.startUpVariablesLoaded) {\n this.autoUpdateVariables\n .forEach(value => this.Variables[value]?.invokeOnParamChange());\n }\n return (<ThemeProvider value={this.theme}>\n <ToastConsumer>\n {(toastService: ToastService) => {\n this.toaster = toastService;\n return this.renderWidget(this.props);\n }}\n </ToastConsumer>\n\n </ThemeProvider>);\n }\n}\n\n\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,GAAG,EAAEC,MAAM,EAAEC,KAAK,QAAQ,QAAQ;AAI3C,OAAOC,QAAQ,MAAM,yCAAyC;AAC9D,SAASC,SAAS,EAAEC,QAAQ,QAAQ,sCAAsC;AAC1E,SAASC,aAAa,EAAkCC,SAAS,QAA2B,+CAA+C;AAC3I,OAAOC,UAAU,IAAWC,aAAa,QAAQ,wCAAwC;AACzF,SAAuBC,cAAc,QAAQ,mDAAmD;AAChG,SAASC,OAAO,IAAIC,SAAS,EAAEC,MAAM,IAAIC,cAAc,QAAQ,yCAAyC;AAExG,OAAOC,WAAW,MAAM,gFAAgF;AACxG,OAAOC,MAAM,MAAM,+DAA+D;AAClF,SAASC,a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ACRwG,YAA0B,IAAK;MAC/B,IAAI,CAACC,OAAO,GAAGD,YAAY;MAC3B,OAAO,IAAI,CAACE,YAAY,CAAC,IAAI,CAAC3I,KAAK,CAAC;IACtC,CAAC,CACa,CAEJ;EAClB;AACJ"}
1
+ {"version":3,"names":["React","Text","get","filter","isNil","injector","toBoolean","toNumber","BaseComponent","BaseProps","BASE_THEME","ThemeProvider","VariableEvents","default","_viewPort","EVENTS","viewportEvents","WmFormField","WmForm","ToastConsumer","spinnerService","AppI18nService","FragmentProps","BaseFragment","constructor","props","defaultProps","createElement","text","title","okButtonText","cancelButtonText","onOk","onCancel","onClose","App","appConfig","app","formatters","Actions","Object","assign","Variables","cleanup","push","subscribe","ORIENTATION_CHANGE","$new","$old","isDetached","targetWidget","invokeEventCallback","proxy","screenWidth","width","screenHeight","height","SIZE_CHANGE","theme","destroy","baseUrl","url","resourceBaseUrl","onDestroy","onContentReady","onReady","refresh","onComponentChange","w","onComponentInit","id","name","Widgets","formWidgets","formFields","parentFormRef","pid","forEach","ff","formKey","registerFormFields","formfield","formRef","fragments","onComponentDestroy","formfields","handleUrl","startsWith","getDateFormat","fmt","dateFormat","replace","getTimeFormat","timeFormat","getDateTimeFormat","dateTimeFormat","getCurrencySymbol","currencyCode","getStyle","classes","inlineStyles","trim","length","mergeStyle","resetAppLocale","appLocale","messages","values","f","eval","fn","failOnError","call","e","val","componentWillUnmount","componentDidMount","memoize","key","o","_memoize","initVariableSpinner","variables","v","actions","concat","map","BEFORE_INVOKE","show","message","spinner","AFTER_INVOKE","hide","onFragmentReady","cleanUpVariablesandActions","fragmentVariables","fragmentActions","startUpActions","a","invoke","Promise","all","startUpVariables","s","catch","then","startUpVariablesLoaded","showContent","onAttach","watcher","isActive","unmute","refreshdataonattach","componentWillAttach","onDetach","mute","componentWillDetach","forceUpdate","render","autoUpdateVariables","value","invokeOnParamChange","toastService","toaster","renderWidget"],"sources":["base-fragment.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport { get, filter, isNil } from 'lodash';\n\nimport AppConfig from '@wavemaker/app-rn-runtime/core/AppConfig';\nimport { Formatter } from '@wavemaker/app-rn-runtime/core/formatters';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\nimport { toBoolean, toNumber } from '@wavemaker/app-rn-runtime/core/utils';\nimport { BaseComponent, BaseComponentState, BaseStyles, BaseProps, LifecycleListener } from '@wavemaker/app-rn-runtime/core/base.component';\nimport BASE_THEME, { Theme, ThemeProvider } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseVariable, VariableEvents } from '@wavemaker/app-rn-runtime/variables/base-variable';\nimport { default as _viewPort, EVENTS as viewportEvents } from '@wavemaker/app-rn-runtime/core/viewport';\nimport App from './App';\nimport WmFormField from '@wavemaker/app-rn-runtime/components/data/form/form-field/form-field.component';\nimport WmForm from '@wavemaker/app-rn-runtime/components/data/form/form.component';\nimport { ToastConsumer, ToastService } from '@wavemaker/app-rn-runtime/core/toast.service';\nimport spinnerService from '@wavemaker/app-rn-runtime/runtime/services/app-spinner.service';\n\nimport AppI18nService from './services/app-i18n.service';\nimport { Watcher } from './watcher';\n\nexport class FragmentProps extends BaseProps {\n\n}\n\nexport interface FragmentState<T extends FragmentProps> extends BaseComponentState<T> {}\n\nexport type FragmentStyles = BaseStyles & {};\nexport default abstract class BaseFragment<P extends FragmentProps, S extends FragmentState<P>> extends BaseComponent<P, S, FragmentStyles> implements LifecycleListener {\n public App: App;\n public onReady: Function = () => {};\n public baseUrl = '';\n public resourceBaseUrl = '';\n public targetWidget = null as unknown as BaseComponent<any, any, any>;\n public Widgets: any = {};\n public Variables: any = {};\n public theme: Theme = BASE_THEME;\n public appLocale: any = {};\n private startUpVariables: string[] = [];\n private startUpVariablesLoaded = false;\n private startUpActions: string[] = [];\n private autoUpdateVariables: string[] = [];\n private cleanUpVariablesandActions: BaseVariable<any>[] = [];\n public fragmentVariables: any = {};\n public fragmentActions: any = {};\n public Actions: any = {};\n public appConfig = injector.get<AppConfig>('APP_CONFIG');\n public cache = false;\n public refreshdataonattach= true;\n public isReactNativeApp = true;\n public fragments: any = {};\n public isDetached = false;\n public _memoize = {} as any;\n public toaster: any;\n public formatters: Map<string, Formatter>;\n public serviceDefinitions = {} as any;\n public Viewport = _viewPort;\n public loadingMessage = React.createElement(Text, [] as any, ['loading...']);\n public showContent = false;\n public notification = {\n text: '',\n title: '',\n okButtonText: '',\n cancelButtonText: '',\n onOk: () => {},\n onCancel: () => {},\n onClose: () => {}\n };\n public watcher: Watcher = null as any;\n constructor(props: P, defaultProps?: P) {\n super(props, null as any, defaultProps);\n this.App = this.appConfig.app;\n this.formatters = this.App.formatters;\n this.Actions = Object.assign({}, this.App.Actions);\n this.Variables = Object.assign({}, this.App.Variables);\n this.cleanup.push(_viewPort.subscribe(viewportEvents.ORIENTATION_CHANGE, ($new: any, $old: any) => {\n !this.isDetached && this.targetWidget && this.targetWidget.invokeEventCallback('onOrientationchange', [null, this.proxy,\n {screenWidth: _viewPort.width,\n screenHeight: _viewPort.height}]);\n }));\n this.cleanup.push(_viewPort.subscribe(viewportEvents.SIZE_CHANGE, ($new: any, $old: any) => {\n !this.isDetached && this.targetWidget && this.targetWidget.invokeEventCallback('onResize', [null, this.proxy,\n {screenWidth: $new.width,\n screenHeight: $new.height}]);\n }));\n this.cleanup.push(() => this.theme?.destroy());\n this.baseUrl = this.appConfig.url;\n this.resourceBaseUrl = this.appConfig.url;\n this.cleanup.push(() => this.onDestroy());\n }\n\n onContentReady() {\n this.onReady();\n this.appConfig.refresh();\n this.targetWidget && this.targetWidget.invokeEventCallback('onLoad', [null, this.proxy]);\n this.onContentReady = () => {};\n }\n\n onComponentChange(w: BaseComponent<any, any, any>) {\n this.refresh();\n }\n\n onComponentInit(w: BaseComponent<any, any, any>) {\n const id = w.props.id || w.props.name;\n\n if (w instanceof WmForm) {\n if (!this.Widgets[id]) {\n this.Widgets[id] = w;\n }\n const formWidgets = this.Widgets[id].formWidgets;\n const formFields = this.Widgets[id].formFields;\n this.Widgets[id] = w;\n if (w.parentFormRef) {\n let pid = w.parentFormRef.props.id || w.parentFormRef.props.name;\n formFields.forEach((ff: any) => {\n const formKey = ff.props.formKey || ff.props.name;\n this.Widgets[pid].formFields.push(ff);\n this.Widgets[pid].formWidgets[formKey] = formWidgets[ff.props.name];\n });\n }\n w.registerFormFields(formFields, formWidgets);\n return;\n }\n if (w.props.formfield) {\n if (!this.Widgets[w.props.formRef]) {\n this.Widgets[w.props.formRef] = {formFields: [], formWidgets: {}};\n } else if (!this.Widgets[w.props.formRef].formFields) {\n this.Widgets[w.props.formRef].formFields = [];\n }\n this.Widgets[w.props.formRef].formWidgets[w.props.name] = w;\n return;\n }\n if (w instanceof WmFormField) {\n if (!this.Widgets[w.props.formRef]) {\n this.Widgets[w.props.formRef] = {};\n }\n if (!this.Widgets[w.props.formRef].formFields) {\n this.Widgets[w.props.formRef].formFields = [];\n }\n this.Widgets[w.props.formRef].formWidgets = this.Widgets[w.props.formRef].formWidgets || {};\n this.Widgets[w.props.formRef].formFields.push(w);\n return;\n }\n this.Widgets[id] = w;\n if (w instanceof BaseFragment && w !== this) {\n this.fragments[id] = w;\n }\n }\n\n onComponentDestroy(w: BaseComponent<any, any, any>) {\n const id = w.props.id || w.props.name;\n delete this.Widgets[id];\n if (w instanceof BaseFragment) {\n delete this.fragments[id];\n }\n if (w instanceof WmForm) {\n w.formWidgets = {};\n w.formFields = [];\n w.formfields = {};\n }\n }\n\n handleUrl(url: string) {\n if (!url.startsWith('http') && !url.startsWith('file:')) {\n return this.appConfig.url + (url.startsWith('/') ? '' : '/') + url;\n }\n return url;\n }\n\n getDateFormat(fmt?: string) {\n // getting formats from appLocale when app locale is loaded locally.\n return (fmt || AppI18nService.dateFormat || get(this.appConfig, 'appLocale.formats.date')).replace(/d/g, 'D').replace(/E/g, 'd').replace(/y/g, 'Y');\n }\n\n getTimeFormat(fmt?: string) {\n return fmt || AppI18nService.timeFormat || get(this.appConfig, 'appLocale.formats.time');\n }\n\n getDateTimeFormat(fmt?: string) {\n return (fmt || AppI18nService.dateTimeFormat || (get(this.appConfig, 'appLocale.formats.date') + ' ' + get(this.appConfig, 'appLocale.formats.time'))).replace(/d/g, 'D').replace(/E/g, 'd').replace(/y/g, 'Y');\n }\n\n getCurrencySymbol(fmt?: string) {\n return (fmt || AppI18nService.currencyCode || 'USD');\n }\n\n getStyle(classes: string, inlineStyles:any = {}) {\n if (classes && classes.trim().length > 0) {\n return this.theme.mergeStyle({}, this.theme.getStyle(classes), inlineStyles);\n }\n return inlineStyles;\n }\n\n resetAppLocale() {\n this.appLocale = this.appConfig.appLocale.messages;\n Object.values(this.fragments).forEach((f: any) => (f as BaseFragment<any, any>).resetAppLocale());\n }\n\n eval(fn: Function, failOnError = false) {\n try {\n return fn.call(this);\n } catch (e) {\n if (failOnError) {\n throw e;\n } else {\n return null;\n }\n }\n }\n\n toBoolean(val: any) {\n if (isNil(val)) {\n return val;\n }\n return toBoolean(val);\n }\n\n toNumber(val: any) {\n if (isNil(val)) {\n return val;\n }\n return toNumber(val);\n }\n\n componentWillUnmount() {\n super.componentWillUnmount();\n this.targetWidget && this.targetWidget.invokeEventCallback('onDestroy', [null, this.proxy]);\n }\n\n componentDidMount(): void {\n this.resetAppLocale();\n super.componentDidMount();\n }\n\n memoize(key: string, o: any) {\n if (!this._memoize[key]) {\n this._memoize[key] = o;\n }\n return this._memoize[key];\n }\n\n initVariableSpinner() {\n let variables = filter(this.Variables, (v: BaseVariable<any>) => !!get(v, 'config.spinnerContext'));\n const actions = filter(this.Actions, (v: BaseVariable<any>) => !!get(v, 'config.spinnerContext'));\n variables = variables.concat(actions);\n if (!variables.length) {\n return;\n }\n this.cleanup.push(...variables.map(v => {\n return ((v as BaseVariable<any>)\n .subscribe(VariableEvents.BEFORE_INVOKE, () => {\n spinnerService.show({\n message: get(v, 'config.spinnerMessage'),\n spinner: this.App.appConfig.spinner\n });\n }))\n }));\n this.cleanup.push(...variables.map(v => {\n return ((v as BaseVariable<any>)\n .subscribe(VariableEvents.AFTER_INVOKE, () => {\n spinnerService.hide();\n }));\n }));\n }\n\n onFragmentReady() {\n this.cleanup.push(...Object.values({...this.Variables, ...this.Actions}).map(v => {\n return ((v as BaseVariable<any>)\n .subscribe(VariableEvents.AFTER_INVOKE, () => this.App.refresh()));\n }));\n this.initVariableSpinner();\n this.cleanUpVariablesandActions.push(...Object.values({...this.fragmentVariables, ...this.fragmentActions} as BaseVariable<any>));\n this.startUpActions.map(a => this.Actions[a] && this.Actions[a].invoke());\n return Promise.all(this.startUpVariables.map(s => this.Variables[s] && this.Variables[s].invoke()))\n .catch(() => {\n // catch errors and show content\n })\n .then(() => {\n this.startUpVariablesLoaded = true;\n this.showContent = true;\n this.appConfig.refresh();\n });\n }\n\n onAttach() {\n this.isDetached = false;\n this.watcher.isActive = true;\n this.resetAppLocale();\n Object.values(this.fragments).forEach((f: any) => f.onAttach());\n this.cleanUpVariablesandActions.forEach((v: any) => v.unmute && v.unmute());\n this.targetWidget?.invokeEventCallback('onAttach', [null, this.proxy]);\n if (this.refreshdataonattach) {\n Promise.all(this.startUpVariables.map(s => this.Variables[s] && this.Variables[s].invoke()));\n }\n Object.values(this.Widgets).forEach((w: any) => { \n w.componentWillAttach && w.componentWillAttach();\n });\n }\n\n onDetach() {\n this.isDetached = true;\n this.watcher.isActive = false;\n Object.values(this.fragments).forEach((f: any) => f.onDetach());\n this.cleanUpVariablesandActions.forEach((v: any) => v.mute && v.mute());\n this.targetWidget?.invokeEventCallback('onDetach', [null, this.proxy]);\n Object.values(this.Widgets).forEach((w: any) => { \n w.componentWillDetach && w.componentWillDetach();\n });\n }\n\n onDestroy() {\n this.cleanUpVariablesandActions.forEach((v: any) => v.destroy());\n this.watcher.destroy();\n }\n\n refresh() {\n (injector.get('AppConfig') as AppConfig).refresh();\n }\n\n forceUpdate() {\n super.forceUpdate();\n Object.values(this.fragments).forEach((f: any) => (f as BaseFragment<any, any>).forceUpdate());\n }\n\n render() {\n this.autoUpdateVariables.forEach(value => this.Variables[value]?.invokeOnParamChange());\n return (<ThemeProvider value={this.theme}>\n <ToastConsumer>\n {(toastService: ToastService) => {\n this.toaster = toastService;\n return this.renderWidget(this.props);\n }}\n </ToastConsumer>\n\n </ThemeProvider>);\n }\n}\n\n\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,GAAG,EAAEC,MAAM,EAAEC,KAAK,QAAQ,QAAQ;AAI3C,OAAOC,QAAQ,MAAM,yCAAyC;AAC9D,SAASC,SAAS,EAAEC,QAAQ,QAAQ,sCAAsC;AAC1E,SAASC,aAAa,EAAkCC,SAAS,QAA2B,+CAA+C;AAC3I,OAAOC,UAAU,IAAWC,aAAa,QAAQ,wCAAwC;AACzF,SAAuBC,cAAc,QAAQ,mDAAmD;AAChG,SAASC,OAAO,IAAIC,SAAS,EAAEC,MAAM,IAAIC,cAAc,QAAQ,yCAAyC;AAExG,OAAOC,WAAW,MAAM,gFAAgF;AACxG,OAAOC,MAAM,MAAM,+DAA+D;AAClF,SAASC,aAAa,QAAsB,8CAA8C;AAC1F,OAAOC,cAAc,MAAM,gEAAgE;AAE3F,OAAOC,cAAc,MAAM,6BAA6B;AAGxD,OAAO,MAAMC,aAAa,SAASb,SAAS,CAAC;AAO7C,eAAe,MAAec,YAAY,SAA8Df,aAAa,CAAoD;EAyCrKgB,WAAW,CAACC,KAAQ,EAAEC,YAAgB,EAAE;IACpC,KAAK,CAACD,KAAK,EAAE,IAAI,EAASC,YAAY,CAAC;IAAC;IAAA,iCAxCjB,MAAM,CAAC,CAAC;IAAA,iCAClB,EAAE;IAAA,yCACM,EAAE;IAAA,sCACL,IAAI;IAAA,iCACJ,CAAC,CAAC;IAAA,mCACA,CAAC,CAAC;IAAA,+BACJhB,UAAU;IAAA,mCACR,CAAC,CAAC;IAAA,0CACW,EAAE;IAAA,gDACN,KAAK;IAAA,wCACH,EAAE;IAAA,6CACG,EAAE;IAAA,oDACgB,E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,IAAKA,CAAC,CAAChE,OAAO,EAAE,CAAC;IAChE,IAAI,CAAC0F,OAAO,CAAC1F,OAAO,EAAE;EACxB;EAEAO,OAAO,GAAG;IACP7D,QAAQ,CAACH,GAAG,CAAC,WAAW,CAAC,CAAegE,OAAO,EAAE;EACpD;EAEA2F,WAAW,GAAG;IACZ,KAAK,CAACA,WAAW,EAAE;IACnBrH,MAAM,CAACmE,MAAM,CAAC,IAAI,CAACxB,SAAS,CAAC,CAACN,OAAO,CAAE+B,CAAM,IAAMA,CAAC,CAA4BiD,WAAW,EAAE,CAAC;EAChG;EAEAC,MAAM,GAAG;IACP,IAAI,CAACC,mBAAmB,CAAClF,OAAO,CAACmF,KAAK;MAAA;MAAA,gCAAI,IAAI,CAACtH,SAAS,CAACsH,KAAK,CAAC,0DAArB,sBAAuBC,mBAAmB,EAAE;IAAA,EAAC;IACvF,oBAAQ,oBAAC,aAAa;MAAC,KAAK,EAAE,IAAI,CAACvG;IAAM,gBACvC,oBAAC,aAAa,QACRwG,YAA0B,IAAK;MAC/B,IAAI,CAACC,OAAO,GAAGD,YAAY;MAC3B,OAAO,IAAI,CAACE,YAAY,CAAC,IAAI,CAAC3I,KAAK,CAAC;IACtC,CAAC,CACa,CAEJ;EAClB;AACJ"}
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { createDrawerNavigator } from '@react-navigation/drawer';
3
- import ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';
4
3
  const Drawer = createDrawerNavigator();
5
4
  class AppDrawerNavigator extends React.Component {
6
5
  constructor(props) {
@@ -15,9 +14,6 @@ class AppDrawerNavigator extends React.Component {
15
14
  headerShown: false,
16
15
  gestureHandlerProps: {
17
16
  enabled: !this.props.hide
18
- },
19
- drawerStyle: {
20
- backgroundColor: ThemeVariables.INSTANCE.pageContentBgColor
21
17
  }
22
18
  }
23
19
  }, /*#__PURE__*/React.createElement(Drawer.Screen, {
@@ -1 +1 @@
1
- {"version":3,"names":["React","createDrawerNavigator","ThemeVariables","Drawer","AppDrawerNavigator","Component","constructor","props","render","content","drawerType","type","headerShown","gestureHandlerProps","enabled","hide","drawerStyle","backgroundColor","INSTANCE","pageContentBgColor","_props","rootComponent"],"sources":["drawer.navigator.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { createDrawerNavigator } from '@react-navigation/drawer';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nconst Drawer = createDrawerNavigator();\n\ninterface AppDrawerNavigatorProps {\n content: (props: any) => ReactNode;\n hide: boolean,\n type: any;\n rootComponent: React.ReactNode;\n}\n\nclass AppDrawerNavigator extends React.Component<AppDrawerNavigatorProps, any, any> {\n\n constructor(props: AppDrawerNavigatorProps) {\n super(props);\n }\n\n render(){\n return (<Drawer.Navigator\n initialRouteName=\"pages\"\n drawerContent={this.props.content}\n screenOptions={{\n drawerType: this.props.type,\n headerShown: false,\n gestureHandlerProps: { enabled: !this.props.hide },\n drawerStyle: { backgroundColor: ThemeVariables.INSTANCE.pageContentBgColor }\n }}>\n <Drawer.Screen name=\"pages\">\n {(_props) => this.props.rootComponent}\n </Drawer.Screen>\n </Drawer.Navigator>);\n }\n}\n\nexport default AppDrawerNavigator;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,SAASC,qBAAqB,QAAQ,0BAA0B;AAChE,OAAOC,cAAc,MAAM,kDAAkD;AAC7E,MAAMC,MAAM,GAAGF,qBAAqB,EAAE;AAStC,MAAMG,kBAAkB,SAASJ,KAAK,CAACK,SAAS,CAAoC;EAElFC,WAAW,CAACC,KAA8B,EAAE;IAC1C,KAAK,CAACA,KAAK,CAAC;EACd;EAEAC,MAAM,GAAE;IACN,oBAAQ,oBAAC,MAAM,CAAC,SAAS;MACvB,gBAAgB,EAAC,OAAO;MACxB,aAAa,EAAE,IAAI,CAACD,KAAK,CAACE,OAAQ;MAClC,aAAa,EAAE;QACXC,UAAU,EAAE,IAAI,CAACH,KAAK,CAACI,IAAI;QAC3BC,WAAW,EAAE,KAAK;QAClBC,mBAAmB,EAAE;UAAEC,OAAO,EAAE,CAAC,IAAI,CAACP,KAAK,CAACQ;QAAK,CAAC;QAClDC,WAAW,EAAE;UAAEC,eAAe,EAAGf,cAAc,CAACgB,QAAQ,CAACC;QAAmB;MAChF;IAAE,gBACF,oBAAC,MAAM,CAAC,MAAM;MAAC,IAAI,EAAC;IAAO,GACvBC,MAAM,IAAK,IAAI,CAACb,KAAK,CAACc,aAAa,CACvB,CACC;EACrB;AACF;AAEA,eAAejB,kBAAkB"}
1
+ {"version":3,"names":["React","createDrawerNavigator","Drawer","AppDrawerNavigator","Component","constructor","props","render","content","drawerType","type","headerShown","gestureHandlerProps","enabled","hide","_props","rootComponent"],"sources":["drawer.navigator.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { createDrawerNavigator } from '@react-navigation/drawer';\nconst Drawer = createDrawerNavigator();\n\ninterface AppDrawerNavigatorProps {\n content: (props: any) => ReactNode;\n hide: boolean,\n type: any;\n rootComponent: React.ReactNode;\n}\n\nclass AppDrawerNavigator extends React.Component<AppDrawerNavigatorProps, any, any> {\n\n constructor(props: AppDrawerNavigatorProps) {\n super(props);\n }\n\n render(){\n return (<Drawer.Navigator\n initialRouteName=\"pages\"\n drawerContent={this.props.content}\n screenOptions={{\n drawerType: this.props.type,\n headerShown: false,\n gestureHandlerProps: { enabled: !this.props.hide },\n }}>\n <Drawer.Screen name=\"pages\">\n {(_props) => this.props.rootComponent}\n </Drawer.Screen>\n </Drawer.Navigator>);\n }\n}\n\nexport default AppDrawerNavigator;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,SAASC,qBAAqB,QAAQ,0BAA0B;AAChE,MAAMC,MAAM,GAAGD,qBAAqB,EAAE;AAStC,MAAME,kBAAkB,SAASH,KAAK,CAACI,SAAS,CAAoC;EAElFC,WAAW,CAACC,KAA8B,EAAE;IAC1C,KAAK,CAACA,KAAK,CAAC;EACd;EAEAC,MAAM,GAAE;IACN,oBAAQ,oBAAC,MAAM,CAAC,SAAS;MACvB,gBAAgB,EAAC,OAAO;MACxB,aAAa,EAAE,IAAI,CAACD,KAAK,CAACE,OAAQ;MAClC,aAAa,EAAE;QACXC,UAAU,EAAE,IAAI,CAACH,KAAK,CAACI,IAAI;QAC3BC,WAAW,EAAE,KAAK;QAClBC,mBAAmB,EAAE;UAAEC,OAAO,EAAE,CAAC,IAAI,CAACP,KAAK,CAACQ;QAAK;MACrD;IAAE,gBACF,oBAAC,MAAM,CAAC,MAAM;MAAC,IAAI,EAAC;IAAO,GACvBC,MAAM,IAAK,IAAI,CAACT,KAAK,CAACU,aAAa,CACvB,CACC;EACrB;AACF;AAEA,eAAeb,kBAAkB"}
@@ -4,7 +4,6 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
4
4
  import React from 'react';
5
5
  import { View } from 'react-native';
6
6
  import { createStackNavigator } from '@react-navigation/stack';
7
- import ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';
8
7
  const Stack = createStackNavigator();
9
8
  const pages = {};
10
9
  class Screen extends React.Component {
@@ -68,10 +67,7 @@ const AppStackNavigator = props => {
68
67
  return getPageId(p.name, params);
69
68
  },
70
69
  options: {
71
- headerShown: false,
72
- cardStyle: {
73
- backgroundColor: ThemeVariables.INSTANCE.pageContentBgColor
74
- }
70
+ headerShown: false
75
71
  }
76
72
  });
77
73
  }));
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","createStackNavigator","ThemeVariables","Stack","pages","Screen","Component","constructor","props","state","renew","page","createPage","navigation","cleanUp","push","addListener","setState","createElement","route","name","component","destroyMe","setTimeout","componentWillUnmount","forEach","fn","render","getPageId","pageName","pageParams","pageParamsStr","Object","keys","sort","map","k","join","AppStackNavigator","landingPage","p","params","headerShown","cardStyle","backgroundColor","INSTANCE","pageContentBgColor"],"sources":["stack.navigator.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { createStackNavigator } from '@react-navigation/stack';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\nconst Stack = createStackNavigator();\n\ninterface AppStackNavigatorProps {\n pages: any[];\n landingPage: string; \n}\n\nconst pages = {} as any;\n\nclass Screen extends React.Component {\n\n private cleanUp = [] as Function[];\n\n constructor(props: any) {\n super(props);\n this.state = {\n renew: false,\n page: this.createPage()\n };\n const navigation = (this.props as any).navigation as any;\n this.cleanUp.push(navigation.addListener('focus', () => {\n const state = (this.state as any);\n if (state.renew) {\n state.page = this.createPage();\n this.setState(() => ({\n renew: false,\n page: state.page\n }));\n }\n }));\n }\n\n private createPage() {\n const props = this.props as any;\n return React.createElement(pages[props.route.name].component, {...props, destroyMe: () => {\n setTimeout(() => {\n this.setState(() => ({renew: true, page: null}));\n }, 100);\n }});\n }\n\n componentWillUnmount() {\n this.cleanUp.forEach(fn => fn && fn());\n }\n\n render() {\n return (this.state as any).page || (<View/>);\n }\n}\n\nconst getPageId = (pageName: string, pageParams: any) => {\n const pageParamsStr = pageParams ? Object.keys(pageParams)\n .sort()\n .map((k: string) => `${k}=${pageParams[k]}`)\n .join('&') : '';\n return `${pageName}?${pageParamsStr}`;\n}\n\nconst AppStackNavigator = (props: AppStackNavigatorProps) => {\n return (<Stack.Navigator initialRouteName={props.landingPage}>\n {props.pages.map(p => {\n pages[p.name] = p;\n return (\n <Stack.Screen key={p.name}\n name={p.name}\n component={Screen}\n getId={({params}) => getPageId(p.name, params)}\n options={{\n headerShown: false,\n cardStyle: {\n backgroundColor: ThemeVariables.INSTANCE.pageContentBgColor\n }\n }}\n />);\n })}\n </Stack.Navigator>);\n};\n\nexport default AppStackNavigator;"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,oBAAoB,QAAQ,yBAAyB;AAC9D,OAAOC,cAAc,MAAM,kDAAkD;AAE7E,MAAMC,KAAK,GAAGF,oBAAoB,EAAE;AAOpC,MAAMG,KAAK,GAAG,C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KAAK,CAASE,IAAI,iBAAK,oBAAC,IAAI,OAAG;EAC9C;AACF;AAEA,MAAMiB,SAAS,GAAG,CAACC,QAAgB,EAAEC,UAAe,KAAK;EACvD,MAAMC,aAAa,GAAGD,UAAU,GAAGE,MAAM,CAACC,IAAI,CAACH,UAAU,CAAC,CACvDI,IAAI,EAAE,CACNC,GAAG,CAAEC,CAAS,IAAM,GAAEA,CAAE,IAAGN,UAAU,CAACM,CAAC,CAAE,EAAC,CAAC,CAC3CC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;EACjB,OAAQ,GAAER,QAAS,IAAGE,aAAc,EAAC;AACvC,CAAC;AAED,MAAMO,iBAAiB,GAAI9B,KAA6B,IAAK;EAC3D,oBAAQ,oBAAC,KAAK,CAAC,SAAS;IAAC,gBAAgB,EAAEA,KAAK,CAAC+B;EAAY,GAC1D/B,KAAK,CAACJ,KAAK,CAAC+B,GAAG,CAACK,CAAC,IAAI;IACpBpC,KAAK,CAACoC,CAAC,CAACpB,IAAI,CAAC,GAAGoB,CAAC;IACjB,oBACE,oBAAC,KAAK,CAAC,MAAM;MAAC,GAAG,EAAEA,CAAC,CAACpB,IAAK;MACxB,IAAI,EAAEoB,CAAC,CAACpB,IAAK;MACb,SAAS,EAAEf,MAAO;MAClB,KAAK,EAAE;QAAA,IAAC;UAACoC;QAAM,CAAC;QAAA,OAAKb,SAAS,CAACY,CAAC,CAACpB,IAAI,EAAEqB,MAAM,CAAC;MAAA,CAAC;MAC/C,OAAO,EAAE;QACPC,WAAW,EAAE,KAAK;QAClBC,SAAS,EAAE;UACTC,eAAe,EAAE1C,cAAc,CAAC2C,QAAQ,CAACC;QAC3C;MACF;IAAE,EACF;EACJ,CAAC,CAAC,CACY;AACpB,CAAC;AAED,eAAeR,iBAAiB"}
1
+ {"version":3,"names":["React","View","createStackNavigator","Stack","pages","Screen","Component","constructor","props","state","renew","page","createPage","navigation","cleanUp","push","addListener","setState","createElement","route","name","component","destroyMe","setTimeout","componentWillUnmount","forEach","fn","render","getPageId","pageName","pageParams","pageParamsStr","Object","keys","sort","map","k","join","AppStackNavigator","landingPage","p","params","headerShown"],"sources":["stack.navigator.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { createStackNavigator } from '@react-navigation/stack';\n\nconst Stack = createStackNavigator();\n\ninterface AppStackNavigatorProps {\n pages: any[];\n landingPage: string; \n}\n\nconst pages = {} as any;\n\nclass Screen extends React.Component {\n\n private cleanUp = [] as Function[];\n\n constructor(props: any) {\n super(props);\n this.state = {\n renew: false,\n page: this.createPage()\n };\n const navigation = (this.props as any).navigation as any;\n this.cleanUp.push(navigation.addListener('focus', () => {\n const state = (this.state as any);\n if (state.renew) {\n state.page = this.createPage();\n this.setState(() => ({\n renew: false,\n page: state.page\n }));\n }\n }));\n }\n\n private createPage() {\n const props = this.props as any;\n return React.createElement(pages[props.route.name].component, {...props, destroyMe: () => {\n setTimeout(() => {\n this.setState(() => ({renew: true, page: null}));\n }, 100);\n }});\n }\n\n componentWillUnmount() {\n this.cleanUp.forEach(fn => fn && fn());\n }\n\n render() {\n return (this.state as any).page || (<View/>);\n }\n}\n\nconst getPageId = (pageName: string, pageParams: any) => {\n const pageParamsStr = pageParams ? Object.keys(pageParams)\n .sort()\n .map((k: string) => `${k}=${pageParams[k]}`)\n .join('&') : '';\n return `${pageName}?${pageParamsStr}`;\n}\n\nconst AppStackNavigator = (props: AppStackNavigatorProps) => {\n return (<Stack.Navigator initialRouteName={props.landingPage}>\n {props.pages.map(p => {\n pages[p.name] = p;\n return (\n <Stack.Screen key={p.name}\n name={p.name}\n component={Screen}\n getId={({params}) => getPageId(p.name, params)}\n options={{\n headerShown: false\n }}\n />);\n })}\n </Stack.Navigator>);\n};\n\nexport default AppStackNavigator;"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,oBAAoB,QAAQ,yBAAyB;AAE9D,MAAMC,KAAK,GAAGD,oBAA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AAM,GAAG;IACP,OAAQ,IAAI,CAAClB,KAAK,CAASE,IAAI,iBAAK,oBAAC,IAAI,OAAG;EAC9C;AACF;AAEA,MAAMiB,SAAS,GAAG,CAACC,QAAgB,EAAEC,UAAe,KAAK;EACvD,MAAMC,aAAa,GAAGD,UAAU,GAAGE,MAAM,CAACC,IAAI,CAACH,UAAU,CAAC,CACvDI,IAAI,EAAE,CACNC,GAAG,CAAEC,CAAS,IAAM,GAAEA,CAAE,IAAGN,UAAU,CAACM,CAAC,CAAE,EAAC,CAAC,CAC3CC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;EACjB,OAAQ,GAAER,QAAS,IAAGE,aAAc,EAAC;AACvC,CAAC;AAED,MAAMO,iBAAiB,GAAI9B,KAA6B,IAAK;EAC3D,oBAAQ,oBAAC,KAAK,CAAC,SAAS;IAAC,gBAAgB,EAAEA,KAAK,CAAC+B;EAAY,GAC1D/B,KAAK,CAACJ,KAAK,CAAC+B,GAAG,CAACK,CAAC,IAAI;IACpBpC,KAAK,CAACoC,CAAC,CAACpB,IAAI,CAAC,GAAGoB,CAAC;IACjB,oBACE,oBAAC,KAAK,CAAC,MAAM;MAAC,GAAG,EAAEA,CAAC,CAACpB,IAAK;MACxB,IAAI,EAAEoB,CAAC,CAACpB,IAAK;MACb,SAAS,EAAEf,MAAO;MAClB,KAAK,EAAE;QAAA,IAAC;UAACoC;QAAM,CAAC;QAAA,OAAKb,SAAS,CAACY,CAAC,CAACpB,IAAI,EAAEqB,MAAM,CAAC;MAAA,CAAC;MAC/C,OAAO,EAAE;QACPC,WAAW,EAAE;MACf;IAAE,EACF;EACJ,CAAC,CAAC,CACY;AACpB,CAAC;AAED,eAAeJ,iBAAiB"}
@@ -6,7 +6,6 @@ import { ImageBackground, TouchableOpacity, View } from "react-native";
6
6
  import { Ionicons } from "@expo/vector-icons";
7
7
  import { ResizeMode, Video } from "expo-av";
8
8
  import { Camera, CameraType } from "expo-camera";
9
- import * as FileSystem from "expo-file-system";
10
9
  import permissionManager from '@wavemaker/app-rn-runtime/runtime/services/device/permissions';
11
10
  import appDisplayManagerService from "@wavemaker/app-rn-runtime/runtime/services/app-display-manager.service";
12
11
  const styles = {
@@ -37,17 +36,14 @@ const styles = {
37
36
  },
38
37
  leftWrapper: {
39
38
  flex: 1,
40
- justifyContent: 'center',
41
39
  alignItems: 'flex-start'
42
40
  },
43
41
  midWrapper: {
44
42
  flex: 1,
45
- justifyContent: 'center',
46
43
  alignItems: 'center'
47
44
  },
48
45
  rightWrapper: {
49
46
  flex: 1,
50
- justifyContent: 'center',
51
47
  alignItems: 'flex-end'
52
48
  },
53
49
  circle: {
@@ -83,12 +79,8 @@ export class CameraService {
83
79
  captureType: 'video',
84
80
  onSuccess: o => {
85
81
  destroy.call(this.displayManager);
86
- /*o.content().catch(() => {}).then(base64 => {
87
- resolve({videoPath: o.uri, content: base64 || ''});
88
- });*/
89
82
  resolve({
90
- videoPath: o.uri,
91
- content: ''
83
+ videoPath: o.uri
92
84
  });
93
85
  },
94
86
  onCancel: () => {
@@ -108,11 +100,8 @@ export class CameraService {
108
100
  captureType: 'image',
109
101
  onSuccess: o => {
110
102
  destroy.call(this.displayManager);
111
- o.content().catch(() => {}).then(base64 => {
112
- resolve({
113
- imagePath: o.uri,
114
- content: base64 || ''
115
- });
103
+ resolve({
104
+ imagePath: o.uri
116
105
  });
117
106
  },
118
107
  onCancel: () => {
@@ -148,11 +137,6 @@ export class CameraView extends React.Component {
148
137
  _defineProperty(this, "camera", {});
149
138
  _defineProperty(this, "startRecord", async () => {
150
139
  this.camera.recordAsync().then(response => {
151
- response.content = async () => {
152
- return await FileSystem.readAsStringAsync(response.uri, {
153
- encoding: 'base64'
154
- });
155
- };
156
140
  this.setState({
157
141
  cameraContent: response,
158
142
  isCaptured: true
@@ -198,15 +182,9 @@ export class CameraView extends React.Component {
198
182
  base64: false,
199
183
  skipProcessing: true,
200
184
  onPictureSaved: response => {
201
- response.content = async () => {
202
- return await FileSystem.readAsStringAsync(response.uri, {
203
- encoding: 'base64'
204
- });
205
- };
206
185
  this.setState({
207
186
  cameraContent: response,
208
- isCaptured: true,
209
- showActionBtns: true
187
+ isCaptured: true
210
188
  });
211
189
  }
212
190
  };
@@ -292,7 +270,7 @@ export class CameraView extends React.Component {
292
270
  source: {
293
271
  uri: this.state.cameraContent.uri
294
272
  },
295
- resizeMode: ResizeMode.CONTAIN,
273
+ resizeMode: ResizeMode.COVER,
296
274
  style: {
297
275
  flex: 1
298
276
  }
@@ -306,7 +284,7 @@ export class CameraView extends React.Component {
306
284
  shouldPlay: true,
307
285
  useNativeControls: true,
308
286
  isLooping: true,
309
- resizeMode: ResizeMode.CONTAIN
287
+ resizeMode: ResizeMode.COVER
310
288
  });
311
289
  }
312
290
  render() {
@@ -1 +1 @@
1
- {"version":3,"names":["React","ImageBackground","TouchableOpacity","View","Ionicons","ResizeMode","Video","Camera","CameraType","FileSystem","permissionManager","appDisplayManagerService","styles","preview","top","left","right","flexGrow","backgroundColor","actionBtn","flex","padding","paddingHorizontal","alignSelf","margin","actionBar","flexDirection","justifyContent","position","bottom","leftWrapper","alignItems","midWrapper","rightWrapper","circle","display","outerCircle","borderWidth","height","width","borderRadius","borderColor","innerCircle","CameraService","constructor","displayManager","back","captureVideo","options","Promise","resolve","reject","requestPermissions","then","destroy","show","content","type","o","call","videoPath","uri","captureImage","params","catch","base64","imagePath","CameraViewProps","CameraViewState","CameraView","Component","props","camera","recordAsync","response","readAsStringAsync","encoding","setState","cameraContent","isCaptured","state","showActionBtns","recording","stopRecording","toggleCapture","captureType","takePicture","startRecord","stopRecord","quality","skipProcessing","onPictureSaved","takePictureAsync","getActionsTemplate","closeView","onCancel","bind","onSuccess","cameraType","getPreviewTemplate","actions","CONTAIN","render","ref","cameraService"],"sources":["camera-service.tsx"],"sourcesContent":["import React from \"react\";\nimport { ImageBackground, TouchableOpacity, View, ViewStyle } from \"react-native\";\nimport { Ionicons } from \"@expo/vector-icons\";\nimport { ResizeMode, Video } from \"expo-av\";\nimport { Camera, CameraType } from \"expo-camera\";\nimport * as FileSystem from \"expo-file-system\";\n\nimport { DisplayManager } from \"@wavemaker/app-rn-runtime/core/display.manager\";\nimport { CaptureVideoOutput } from \"@wavemaker/app-rn-runtime/variables/device/camera/capture-video.operation\";\nimport { CaptureImageOutput } from \"@wavemaker/app-rn-runtime/variables/device/camera/capture-image.operation\";\nimport permissionManager from '@wavemaker/app-rn-runtime/runtime/services/device/permissions';\nimport { CameraInput } from \"@wavemaker/app-rn-runtime/core/device/camera-service\";\nimport { Input } from \"@wavemaker/app-rn-runtime/variables/device/operation.provider\";\nimport appDisplayManagerService from \"@wavemaker/app-rn-runtime/runtime/services/app-display-manager.service\";\nconst styles = {\n preview: {\n top: 0,\n left: 0,\n right: 0,\n flexGrow: 1,\n backgroundColor: 'black'\n },\n actionBtn: {\n flex: 0,\n padding: 15,\n paddingHorizontal: 20,\n alignSelf: 'center',\n margin: 20,\n } as ViewStyle,\n actionBar: {\n flex: 0,\n flexDirection: 'row',\n justifyContent: 'center',\n backgroundColor: 'rgba(0,0,0,0.6)',\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n padding: 20\n } as ViewStyle,\n leftWrapper: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'flex-start',\n } as ViewStyle,\n midWrapper: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n } as ViewStyle,\n rightWrapper: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'flex-end',\n } as ViewStyle,\n circle: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n } as ViewStyle,\n outerCircle: {\n borderWidth: 3,\n height: 50,\n width: 50,\n borderRadius: 25,\n borderColor: 'white'\n },\n innerCircle: {\n borderRadius:2,\n height: 20,\n width:20,\n backgroundColor: 'red'\n }\n};\n\nexport interface CameraVideoInput extends Input {}\n\nexport class CameraService {\n private type= CameraType.back;\n\n constructor(private displayManager: DisplayManager) {\n }\n\n public captureVideo(options?: CameraVideoInput): Promise<CaptureVideoOutput> {\n return new Promise((resolve, reject) => {\n permissionManager.requestPermissions('video').then(() => {\n const destroy = this.displayManager.show({\n content: (<CameraView type={this.type} captureType={'video'} onSuccess={(o) => {\n destroy.call(this.displayManager);\n /*o.content().catch(() => {}).then(base64 => {\n resolve({videoPath: o.uri, content: base64 || ''});\n });*/\n resolve({videoPath: o.uri, content: ''});\n }}\n onCancel={() => {\n destroy.call(this.displayManager);\n }}\n ></CameraView>)\n });\n }, reject);\n });\n }\n\n public captureImage(params: CameraInput): Promise<CaptureImageOutput> {\n return new Promise((resolve, reject) => {\n permissionManager.requestPermissions('image').then(() => {\n const destroy = this.displayManager.show({\n content: (<CameraView type={this.type} captureType={'image'} onSuccess={(o) => {\n destroy.call(this.displayManager);\n o.content().catch(() => {}).then(base64 => {\n resolve({imagePath: o.uri, content: base64 || ''});\n });\n }} onCancel={() => {destroy.call(this.displayManager);}}\n ></CameraView>)\n });\n }, reject);\n });\n }\n}\n\ninterface CameraOutput {\n uri: string;\n content: () => Promise<string>;\n}\n\nclass CameraViewProps {\n type: 'front' | 'back' = 'back' as CameraType;\n captureType: 'image' | 'video' = 'image';\n onSuccess: (o: CameraOutput) => any = () => {};\n onCancel: () => any = () => {};\n}\n\nclass CameraViewState {\n recording: boolean = false;\n showActionBtns: boolean = false;\n cameraType: CameraType = CameraType.back;\n isCaptured: boolean = false;\n closeView: boolean = false;\n cameraContent: CameraOutput = {} as CameraOutput;\n}\n\nexport class CameraView extends React.Component<CameraViewProps, CameraViewState> {\n private camera: Camera = {} as Camera;\n\n constructor(props: CameraViewProps) {\n super(props);\n this.state = new CameraViewState();\n }\n\n toggleCapture() {\n if (this.props.captureType === 'image') {\n this.takePicture();\n } else {\n if (!this.state.recording) {\n this.startRecord();\n } else {\n this.stopRecord();\n this.setState({showActionBtns: true} as CameraViewState);\n }\n }\n }\n\n async takePicture() {\n const options = {\n quality: 0.5,\n base64: false,\n skipProcessing: true,\n onPictureSaved: (response: any) => {\n response.content = async () => {\n return await FileSystem.readAsStringAsync(response.uri, { encoding: 'base64' });\n };\n this.setState({ \n cameraContent: response,\n isCaptured: true,\n showActionBtns: true } as CameraViewState);\n }\n }\n await this.camera.takePictureAsync(options);\n\n if (this.state.showActionBtns) {\n this.setState({showActionBtns: false} as CameraViewState);\n }\n this.setState({showActionBtns: true} as CameraViewState);\n }\n\n // start recording\n startRecord = async () => {\n this.camera.recordAsync().then((response: any) => {\n response.content = async () => {\n return await FileSystem.readAsStringAsync(response.uri, { encoding: 'base64' });\n };\n this.setState({ cameraContent: response, isCaptured: true } as CameraViewState);\n });\n if (this.state.showActionBtns) {\n this.setState({showActionBtns: false} as CameraViewState);\n }\n\n this.setState({recording: true} as CameraViewState);\n };\n\n // stop recording\n stopRecord = async () => {\n this.camera.stopRecording();\n this.setState({recording: false} as CameraViewState);\n this.setState({showActionBtns: true} as CameraViewState);\n };\n\n getActionsTemplate() {\n return <View style={styles.actionBar}>\n <View style={styles.leftWrapper}>\n <TouchableOpacity\n onPress={() => {\n this.setState({ cameraContent: {uri: ''}, isCaptured: false, closeView: true } as CameraViewState);\n this.props.onCancel();\n }}>\n <Ionicons name='close-circle' size={32} color='white' />\n </TouchableOpacity>\n </View>\n <View style={styles.midWrapper}>\n {!this.state.isCaptured ? <TouchableOpacity style={[styles.circle, styles.outerCircle, this.props.captureType === 'video' && !this.state.recording ? { backgroundColor: \"red\" } : {},\n this.props.captureType === 'image' ? { backgroundColor: \"white\" } : {}]}\n onPress={this.toggleCapture.bind(this)}>\n <View style={[styles.circle as ViewStyle, this.props.captureType === 'image' ? {} : styles.innerCircle, this.props.captureType === 'image' ? { backgroundColor: \"white\" } : {}]}></View>\n </TouchableOpacity> : null}\n </View>\n <View style={styles.rightWrapper}>\n {this.state.showActionBtns ? (<TouchableOpacity\n onPress={() => {\n this.setState({ isCaptured: false, closeView: true } as CameraViewState);\n this.props.onSuccess(this.state.cameraContent);\n this.setState({ cameraContent: {uri: ''} } as CameraViewState);\n }}>\n <Ionicons name='checkmark-circle' size={32} color='white'/>\n </TouchableOpacity>) : (<TouchableOpacity\n onPress={() => {\n this.setState({cameraType: this.state.cameraType === 'back' ? 'front' : 'back'} as CameraViewState);\n }}>\n <Ionicons name='camera-reverse' size={32} color='white' />\n </TouchableOpacity>)}\n </View>\n </View>\n }\n\n getPreviewTemplate(actions: any) {\n return this.props.captureType === 'image' ?\n <ImageBackground source={{uri : this.state.cameraContent.uri}} resizeMode={ResizeMode.CONTAIN} style={{flex: 1}} />\n : <Video\n style={{ flex: 1 }}\n source={{\n uri: this.state.cameraContent.uri,\n }}\n shouldPlay={true}\n useNativeControls\n isLooping\n resizeMode={ResizeMode.CONTAIN}\n ></Video>\n }\n\n render() {\n if (this.state.closeView) {\n return null;\n }\n const actions = this.getActionsTemplate();\n return (\n <View style={styles.preview}>\n {this.state.isCaptured ? (\n this.getPreviewTemplate(actions)\n ) : (\n <Camera type={CameraType[this.state.cameraType]} ref={(ref: Camera) => { this.camera = ref; }}\n style={{flex: 1}}\n onCameraReady={() => {}}>\n\n </Camera>)}\n {actions}\n </View>)\n }\n}\nconst cameraService = new CameraService(appDisplayManagerService);\nexport default cameraService;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,eAAe,EAAEC,gBAAgB,EAAEC,IAAI,QAAmB,cAAc;AACjF,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,UAAU,EAAEC,KAAK,QAAQ,SAAS;AAC3C,SAASC,MAAM,EAAEC,UAAU,QAAQ,aAAa;AAChD,OAAO,KAAKC,UAAU,MAAM,kBAAkB;AAK9C,OAAOC,iBAAiB,MAAM,+DAA+D;AAG7F,OAAOC,wBAAwB,MAAM,wEAAwE;AAC7G,MAAMC,MAAM,GAAG;EACbC,OAAO,EAAE;IACPC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,QAAQ,EAAE,CAAC;IACXC,eAAe,EAAE;EACnB,CAAC;EACD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IAAI,CAAC7B,KAAK,CAACc,WAAW,KAAK,OAAO,gBACvC,oBAAC,eAAe;MAAC,MAAM,EAAE;QAACxB,GAAG,EAAG,IAAI,CAACmB,KAAK,CAACF,aAAa,CAACjB;MAAG,CAAE;MAAC,UAAU,EAAExD,UAAU,CAACgG,OAAQ;MAAC,KAAK,EAAE;QAACjF,IAAI,EAAE;MAAC;IAAE,EAAG,gBACjH,oBAAC,KAAK;MACJ,KAAK,EAAE;QAAEA,IAAI,EAAE;MAAE,CAAE;MACnB,MAAM,EAAE;QACNyC,GAAG,EAAE,IAAI,CAACmB,KAAK,CAACF,aAAa,CAACjB;MAChC,CAAE;MACF,UAAU,EAAE,IAAK;MACjB,iBAAiB;MACjB,SAAS;MACT,UAAU,EAAExD,UAAU,CAACgG;IAAQ,EACxB;EACf;EAEAC,MAAM,GAAG;IACP,IAAI,IAAI,CAACtB,KAAK,CAACc,SAAS,EAAE;MACxB,OAAO,IAAI;IACb;IACA,MAAMM,OAAO,GAAG,IAAI,CAACP,kBAAkB,EAAE;IACzC,oBACE,oBAAC,IAAI;MAAC,KAAK,EAAEjF,MAAM,CAACC;IAAQ,GACzB,IAAI,CAACmE,KAAK,CAACD,UAAU,GACpB,IAAI,CAACoB,kBAAkB,CAACC,OAAO,CAAC,gBAEhC,oBAAC,MAAM;MAAC,IAAI,EAAE5F,UAAU,CAAC,IAAI,CAACwE,KAAK,CAACkB,UAAU,CAAE;MAAC,GAAG,EAAGK,GAAW,IAAK;QAAE,IAAI,CAAC/B,MAAM,GAAG+B,GAAG;MAAE,CAAE;MAC1F,KAAK,EAAE;QAACnF,IAAI,EAAE;MAAC,CAAE;MACjB,aAAa,EAAE,MAAM,CAAC;IAAE,EAElB,EACXgF,OAAO,CACH;EACX;AACF;AACA,MAAMI,aAAa,GAAG,IAAI7D,aAAa,CAAChC,wBAAwB,CAAC;AACjE,eAAe6F,aAAa"}
1
+ {"version":3,"names":["React","ImageBackground","TouchableOpacity","View","Ionicons","ResizeMode","Video","Camera","CameraType","permissionManager","appDisplayManagerService","styles","preview","top","left","right","flexGrow","backgroundColor","actionBtn","flex","padding","paddingHorizontal","alignSelf","margin","actionBar","flexDirection","justifyContent","position","bottom","leftWrapper","alignItems","midWrapper","rightWrapper","circle","display","outerCircle","borderWidth","height","width","borderRadius","borderColor","innerCircle","CameraService","constructor","displayManager","back","captureVideo","options","Promise","resolve","reject","requestPermissions","then","destroy","show","content","type","o","call","videoPath","uri","captureImage","params","imagePath","CameraViewProps","CameraViewState","CameraView","Component","props","camera","recordAsync","response","setState","cameraContent","isCaptured","state","showActionBtns","recording","stopRecording","toggleCapture","captureType","takePicture","startRecord","stopRecord","quality","base64","skipProcessing","onPictureSaved","takePictureAsync","getActionsTemplate","closeView","onCancel","bind","onSuccess","cameraType","getPreviewTemplate","actions","COVER","render","ref","cameraService"],"sources":["camera-service.tsx"],"sourcesContent":["import React from \"react\";\nimport { ImageBackground, TouchableOpacity, View, ViewStyle } from \"react-native\";\nimport { Ionicons } from \"@expo/vector-icons\";\nimport { ResizeMode, Video } from \"expo-av\";\nimport { Camera, CameraType } from \"expo-camera\";\n\nimport { DisplayManager } from \"@wavemaker/app-rn-runtime/core/display.manager\";\nimport { CaptureVideoOutput } from \"@wavemaker/app-rn-runtime/variables/device/camera/capture-video.operation\";\nimport { CaptureImageOutput } from \"@wavemaker/app-rn-runtime/variables/device/camera/capture-image.operation\";\nimport permissionManager from '@wavemaker/app-rn-runtime/runtime/services/device/permissions';\nimport { CameraInput } from \"@wavemaker/app-rn-runtime/core/device/camera-service\";\nimport { Input } from \"@wavemaker/app-rn-runtime/variables/device/operation.provider\";\nimport appDisplayManagerService from \"@wavemaker/app-rn-runtime/runtime/services/app-display-manager.service\";\nconst styles = {\n preview: {\n top: 0,\n left: 0,\n right: 0,\n flexGrow: 1,\n backgroundColor: 'black'\n },\n actionBtn: {\n flex: 0,\n padding: 15,\n paddingHorizontal: 20,\n alignSelf: 'center',\n margin: 20,\n } as ViewStyle,\n actionBar: {\n flex: 0,\n flexDirection: 'row',\n justifyContent: 'center',\n backgroundColor: 'rgba(0,0,0,0.6)',\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n padding: 20\n } as ViewStyle,\n leftWrapper: {\n flex: 1,\n alignItems: 'flex-start',\n } as ViewStyle,\n midWrapper: {\n flex: 1,\n alignItems: 'center',\n } as ViewStyle,\n rightWrapper: {\n flex: 1,\n alignItems: 'flex-end',\n } as ViewStyle,\n circle: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n } as ViewStyle,\n outerCircle: {\n borderWidth: 3,\n height: 50,\n width: 50,\n borderRadius: 25,\n borderColor: 'white'\n },\n innerCircle: {\n borderRadius:2,\n height: 20,\n width:20,\n backgroundColor: 'red'\n }\n};\n\nexport interface CameraVideoInput extends Input {}\n\nexport class CameraService {\n private type= CameraType.back;\n\n constructor(private displayManager: DisplayManager) {\n }\n\n public captureVideo(options?: CameraVideoInput): Promise<CaptureVideoOutput> {\n return new Promise((resolve, reject) => {\n permissionManager.requestPermissions('video').then(() => {\n const destroy = this.displayManager.show({\n content: (<CameraView type={this.type} captureType={'video'} onSuccess={(o) => {\n destroy.call(this.displayManager);\n resolve({videoPath: o.uri});\n }}\n onCancel={() => {\n destroy.call(this.displayManager);\n }}\n ></CameraView>)\n });\n }, reject);\n });\n }\n\n public captureImage(params: CameraInput): Promise<CaptureImageOutput> {\n return new Promise((resolve, reject) => {\n permissionManager.requestPermissions('image').then(() => {\n const destroy = this.displayManager.show({\n content: (<CameraView type={this.type} captureType={'image'} onSuccess={(o) => {\n destroy.call(this.displayManager);\n resolve({imagePath: o.uri});\n }} onCancel={() => {destroy.call(this.displayManager);}}\n ></CameraView>)\n });\n }, reject);\n });\n }\n}\n\ninterface CameraOutput {\n uri: string;\n}\n\nclass CameraViewProps {\n type: 'front' | 'back' = 'back' as CameraType;\n captureType: 'image' | 'video' = 'image';\n onSuccess: (o: CameraOutput) => any = () => {};\n onCancel: () => any = () => {};\n}\n\nclass CameraViewState {\n recording: boolean = false;\n showActionBtns: boolean = false;\n cameraType: CameraType = CameraType.back;\n isCaptured: boolean = false;\n closeView: boolean = false;\n cameraContent: CameraOutput = {} as CameraOutput;\n}\n\nexport class CameraView extends React.Component<CameraViewProps, CameraViewState> {\n private camera: Camera = {} as Camera;\n\n constructor(props: CameraViewProps) {\n super(props);\n this.state = new CameraViewState();\n }\n\n toggleCapture() {\n if (this.props.captureType === 'image') {\n this.takePicture();\n } else {\n if (!this.state.recording) {\n this.startRecord();\n } else {\n this.stopRecord();\n this.setState({showActionBtns: true} as CameraViewState);\n }\n }\n }\n\n async takePicture() {\n const options = {\n quality: 0.5,\n base64: false,\n skipProcessing: true,\n onPictureSaved: (response: any) => {\n this.setState({ cameraContent: response, isCaptured: true } as CameraViewState);\n }\n }\n await this.camera.takePictureAsync(options);\n\n if (this.state.showActionBtns) {\n this.setState({showActionBtns: false} as CameraViewState);\n }\n this.setState({showActionBtns: true} as CameraViewState);\n }\n\n // start recording\n startRecord = async () => {\n this.camera.recordAsync().then((response: any) => {\n this.setState({ cameraContent: response, isCaptured: true } as CameraViewState);\n });\n if (this.state.showActionBtns) {\n this.setState({showActionBtns: false} as CameraViewState);\n }\n\n this.setState({recording: true} as CameraViewState);\n };\n\n // stop recording\n stopRecord = async () => {\n this.camera.stopRecording();\n this.setState({recording: false} as CameraViewState);\n this.setState({showActionBtns: true} as CameraViewState);\n };\n\n getActionsTemplate() {\n return <View style={styles.actionBar}>\n <View style={styles.leftWrapper}>\n <TouchableOpacity\n onPress={() => {\n this.setState({ cameraContent: {uri: ''}, isCaptured: false, closeView: true } as CameraViewState);\n this.props.onCancel();\n }}>\n <Ionicons name='close-circle' size={32} color='white' />\n </TouchableOpacity>\n </View>\n <View style={styles.midWrapper}>\n {!this.state.isCaptured ? <TouchableOpacity style={[styles.circle, styles.outerCircle, this.props.captureType === 'video' && !this.state.recording ? { backgroundColor: \"red\" } : {},\n this.props.captureType === 'image' ? { backgroundColor: \"white\" } : {}]}\n onPress={this.toggleCapture.bind(this)}>\n <View style={[styles.circle as ViewStyle, this.props.captureType === 'image' ? {} : styles.innerCircle, this.props.captureType === 'image' ? { backgroundColor: \"white\" } : {}]}></View>\n </TouchableOpacity> : null}\n </View>\n <View style={styles.rightWrapper}>\n {this.state.showActionBtns ? (<TouchableOpacity\n onPress={() => {\n this.setState({ isCaptured: false, closeView: true } as CameraViewState);\n this.props.onSuccess(this.state.cameraContent);\n this.setState({ cameraContent: {uri: ''} } as CameraViewState);\n }}>\n <Ionicons name='checkmark-circle' size={32} color='white'/>\n </TouchableOpacity>) : (<TouchableOpacity\n onPress={() => {\n this.setState({cameraType: this.state.cameraType === 'back' ? 'front' : 'back'} as CameraViewState);\n }}>\n <Ionicons name='camera-reverse' size={32} color='white' />\n </TouchableOpacity>)}\n </View>\n </View>\n }\n\n getPreviewTemplate(actions: any) {\n return this.props.captureType === 'image' ?\n <ImageBackground source={{uri : this.state.cameraContent.uri}} resizeMode={ResizeMode.COVER} style={{flex: 1}} />\n : <Video\n style={{ flex: 1 }}\n source={{\n uri: this.state.cameraContent.uri,\n }}\n shouldPlay={true}\n useNativeControls\n isLooping\n resizeMode={ResizeMode.COVER}\n ></Video>\n }\n\n render() {\n if (this.state.closeView) {\n return null;\n }\n const actions = this.getActionsTemplate();\n return (\n <View style={styles.preview}>\n {this.state.isCaptured ? (\n this.getPreviewTemplate(actions)\n ) : (\n <Camera type={CameraType[this.state.cameraType]} ref={(ref: Camera) => { this.camera = ref; }}\n style={{flex: 1}}\n onCameraReady={() => {}}>\n\n </Camera>)}\n {actions}\n </View>)\n }\n}\nconst cameraService = new CameraService(appDisplayManagerService);\nexport default cameraService;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,eAAe,EAAEC,gBAAgB,EAAEC,IAAI,QAAmB,cAAc;AACjF,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,UAAU,EAAEC,KAAK,QAAQ,SAAS;AAC3C,SAASC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AACe,KAAK,CAACF,aAAa,CAACb;MAChC,CAAE;MACF,UAAU,EAAE,IAAK;MACjB,iBAAiB;MACjB,SAAS;MACT,UAAU,EAAEvD,UAAU,CAAC4F;IAAM,EACtB;EACf;EAEAC,MAAM,GAAG;IACP,IAAI,IAAI,CAACvB,KAAK,CAACe,SAAS,EAAE;MACxB,OAAO,IAAI;IACb;IACA,MAAMM,OAAO,GAAG,IAAI,CAACP,kBAAkB,EAAE;IACzC,oBACE,oBAAC,IAAI;MAAC,KAAK,EAAE9E,MAAM,CAACC;IAAQ,GACzB,IAAI,CAAC+D,KAAK,CAACD,UAAU,GACpB,IAAI,CAACqB,kBAAkB,CAACC,OAAO,CAAC,gBAEhC,oBAAC,MAAM;MAAC,IAAI,EAAExF,UAAU,CAAC,IAAI,CAACmE,KAAK,CAACmB,UAAU,CAAE;MAAC,GAAG,EAAGK,GAAW,IAAK;QAAE,IAAI,CAAC9B,MAAM,GAAG8B,GAAG;MAAE,CAAE;MAC1F,KAAK,EAAE;QAAChF,IAAI,EAAE;MAAC,CAAE;MACjB,aAAa,EAAE,MAAM,CAAC;IAAE,EAElB,EACX6E,OAAO,CACH;EACX;AACF;AACA,MAAMI,aAAa,GAAG,IAAI1D,aAAa,CAAChC,wBAAwB,CAAC;AACjE,eAAe0F,aAAa"}
@@ -30,9 +30,8 @@ const styles = StyleSheet.create({
30
30
  },
31
31
  closeWrapper: {
32
32
  flex: 1,
33
- justifyContent: 'flex-end',
34
- alignItems: 'center',
35
- paddingBottom: 32
33
+ alignItems: 'flex-end',
34
+ paddingRight: 10
36
35
  },
37
36
  topWrapper: {
38
37
  flex: 2,
@@ -79,16 +78,6 @@ export class ScanService {
79
78
  style: StyleSheet.absoluteFillObject
80
79
  }, /*#__PURE__*/React.createElement(View, {
81
80
  style: styles.topWrapper
82
- }), /*#__PURE__*/React.createElement(View, {
83
- style: styles.centerWrapper
84
- }, /*#__PURE__*/React.createElement(View, {
85
- style: styles.leftWrapper
86
- }), /*#__PURE__*/React.createElement(View, {
87
- style: styles.focused
88
- }), /*#__PURE__*/React.createElement(View, {
89
- style: styles.rightWrapper
90
- })), /*#__PURE__*/React.createElement(View, {
91
- style: styles.bottomWrapper
92
81
  }, /*#__PURE__*/React.createElement(View, {
93
82
  style: styles.closeWrapper
94
83
  }, /*#__PURE__*/React.createElement(TouchableOpacity, {
@@ -97,9 +86,19 @@ export class ScanService {
97
86
  }
98
87
  }, /*#__PURE__*/React.createElement(Ionicons, {
99
88
  name: "close-circle",
100
- size: 48,
89
+ size: 32,
101
90
  color: "white"
102
- })))))
91
+ })))), /*#__PURE__*/React.createElement(View, {
92
+ style: styles.centerWrapper
93
+ }, /*#__PURE__*/React.createElement(View, {
94
+ style: styles.leftWrapper
95
+ }), /*#__PURE__*/React.createElement(View, {
96
+ style: styles.focused
97
+ }), /*#__PURE__*/React.createElement(View, {
98
+ style: styles.rightWrapper
99
+ })), /*#__PURE__*/React.createElement(View, {
100
+ style: styles.bottomWrapper
101
+ }))
103
102
  });
104
103
  }, reject);
105
104
  }).then(response => {
@@ -1 +1 @@
1
- {"version":3,"names":["Camera","Ionicons","BarCodeScanner","Platform","StyleSheet","TouchableOpacity","View","React","permissionManager","appDisplayManagerService","barcodeFormatOptions","opacity","styles","create","container","flex","flexDirection","closeWrapper","justifyContent","alignItems","paddingBottom","topWrapper","backgroundColor","centerWrapper","leftWrapper","focused","rightWrapper","bottomWrapper","ScanService","constructor","displayManager","scanBarcode","params","format","barcodeFormat","OS","undefined","Promise","resolve","reject","requestPermissions","then","destroy","show","content","barCodeTypes","Constants","BarCodeType","result","call","absoluteFillObject","response","type","values","Object","index","indexOf","keys","text","data","cancelled","scanService"],"sources":["scan-service.tsx"],"sourcesContent":["import { Camera } from 'expo-camera';\nimport { Ionicons } from '@expo/vector-icons';\nimport { BarCodeScanner } from 'expo-barcode-scanner';\nimport { Platform, StyleSheet, TouchableOpacity, View } from 'react-native';\nimport React from 'react';\nimport { ScanInput, ScanOutput } from '@wavemaker/app-rn-runtime/variables/device/scan/scan.operation';\nimport { DisplayManager } from '@wavemaker/app-rn-runtime/core/display.manager';\nimport permissionManager from '@wavemaker/app-rn-runtime/runtime/services/device/permissions';\nimport appDisplayManagerService from '@wavemaker/app-rn-runtime/runtime/services/app-display-manager.service';\n\ninterface objectMap {\n [key: string]: string\n}\n\nconst barcodeFormatOptions: objectMap = {\n 'ALL': 'ALL',\n 'CODABAR': 'codabar',\n 'CODE_39': 'code39',\n 'CODE_93': 'code93',\n 'CODE_128': 'code128',\n 'DATA_MATRIX': 'datamatrix',\n 'EAN_8': 'ean8',\n 'EAN_13': 'ean13',\n 'ITF': 'itf14',\n 'PDF_417': 'pdf417',\n 'QR_CODE': 'qr',\n 'RSS14': 'rss14',\n 'RSS_EXPANDED': 'rssexpanded',\n 'UPC_E': 'upc_e',\n 'UPC_A': 'upc_a'\n};\nconst opacity = 'rgba(0, 0, 0, 0.6)';\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n flexDirection: 'column'\n },\n closeWrapper: {\n flex: 1,\n justifyContent: 'flex-end',\n alignItems: 'center',\n paddingBottom: 32\n },\n topWrapper: {\n flex: 2,\n backgroundColor: opacity\n },\n centerWrapper: {\n flex: 2,\n flexDirection: 'row'\n },\n leftWrapper: {\n flex: 2,\n backgroundColor: opacity\n },\n focused: {\n flex: 10\n },\n rightWrapper: {\n flex: 2,\n backgroundColor: opacity\n },\n bottomWrapper: {\n flex: 2,\n backgroundColor: opacity\n },\n});\n\nexport class ScanService {\n\n constructor(private displayManager: DisplayManager) {}\n\n public scanBarcode(params: ScanInput): Promise<ScanOutput> {\n const format = params?.barcodeFormat || 'ALL';\n const barcodeFormat: string | undefined = Platform.OS === 'ios' ? undefined : barcodeFormatOptions[format];\n return new Promise((resolve, reject) => {\n permissionManager.requestPermissions('camera').then(() => {\n const destroy = this.displayManager.show({\n content: (<Camera\n barCodeScannerSettings={barcodeFormat ? {\n barCodeTypes: [BarCodeScanner.Constants.BarCodeType[barcodeFormat]],\n }: undefined}\n onBarCodeScanned={(result) => {\n destroy.call(this.displayManager);\n resolve(result);\n }}\n style={StyleSheet.absoluteFillObject}\n >\n <View style={styles.topWrapper}>\n </View>\n <View style={styles.centerWrapper}>\n <View style={styles.leftWrapper}/>\n <View style={styles.focused}/>\n <View style={styles.rightWrapper}/>\n </View>\n <View style={styles.bottomWrapper}>\n \n <View style={styles.closeWrapper}>\n <TouchableOpacity\n onPress={() => {\n destroy.call(this.displayManager);\n }}>\n <Ionicons name='close-circle' size={48} color='white' />\n </TouchableOpacity>\n </View>\n </View>\n </Camera>)\n });\n }, reject)\n }).then((response: any) => {\n let format;\n if (response.type) {\n const values = Object.values(BarCodeScanner.Constants.BarCodeType);\n const index = values.indexOf(response.type);\n format = index > -1 ? Object.keys(BarCodeScanner.Constants.BarCodeType)[index] : '';\n }\n return Promise.resolve({\n text: response.data,\n format : format || response.type,\n cancelled : false\n });\n });\n }\n}\nconst scanService = new ScanService(appDisplayManagerService);\nexport default scanService;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,aAAa;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,cAAc,QAAQ,sBAAsB;AACrD,SAASC,QAAQ,EAAEC,UAAU,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AAC3E,OAAOC,KAAK,MAAM,OAAO;AAGzB,OAAOC,iBAAiB,MAAM,+DAA+D;AAC7F,OAAOC,wBAAwB,MAAM,wEAAwE;AAM7G,MAAMC,oBAA+B,GAAG;EACtC,KAAK,EAAE,KAAK;EACZ,SAAS,EAAE,SAAS;EACpB,SAAS,EAAE,QAAQ;EACnB,SAAS,EAAE,QAAQ;EACnB,UAAU,EAAE,SAAS;EACrB,aAAa,EAAE,YAAY;EAC3B,OAAO,EAAE,MAAM;EACf,QAAQ,EAAE,OAAO;EACjB,KAAK,EAAE,OAAO;EACd,SAAS,EAAE,QAAQ;EACnB,SAAS,EAAE,IAAI;EACf,OAAO,EAAE,OAAO;EAChB,cAAc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AAQ,CAACC,IAAI,EAAE;QACjB,MAAMC,MAAM,GAAGC,MAAM,CAACD,MAAM,CAACnD,cAAc,CAAC4C,SAAS,CAACC,WAAW,CAAC;QAClE,MAAMQ,KAAK,GAAGF,MAAM,CAACG,OAAO,CAACL,QAAQ,CAACC,IAAI,CAAC;QAC3CnB,MAAM,GAAGsB,KAAK,GAAG,CAAC,CAAC,GAAGD,MAAM,CAACG,IAAI,CAACvD,cAAc,CAAC4C,SAAS,CAACC,WAAW,CAAC,CAACQ,KAAK,CAAC,GAAG,EAAE;MACrF;MACA,OAAOlB,OAAO,CAACC,OAAO,CAAC;QACrBoB,IAAI,EAAEP,QAAQ,CAACQ,IAAI;QACnB1B,MAAM,EAAGA,MAAM,IAAIkB,QAAQ,CAACC,IAAI;QAChCQ,SAAS,EAAG;MACd,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;AACF;AACA,MAAMC,WAAW,GAAG,IAAIjC,WAAW,CAACnB,wBAAwB,CAAC;AAC7D,eAAeoD,WAAW"}
1
+ {"version":3,"names":["Camera","Ionicons","BarCodeScanner","Platform","StyleSheet","TouchableOpacity","View","React","permissionManager","appDisplayManagerService","barcodeFormatOptions","opacity","styles","create","container","flex","flexDirection","closeWrapper","alignItems","paddingRight","topWrapper","backgroundColor","centerWrapper","leftWrapper","focused","rightWrapper","bottomWrapper","ScanService","constructor","displayManager","scanBarcode","params","format","barcodeFormat","OS","undefined","Promise","resolve","reject","requestPermissions","then","destroy","show","content","barCodeTypes","Constants","BarCodeType","result","call","absoluteFillObject","response","type","values","Object","index","indexOf","keys","text","data","cancelled","scanService"],"sources":["scan-service.tsx"],"sourcesContent":["import { Camera } from 'expo-camera';\nimport { Ionicons } from '@expo/vector-icons';\nimport { BarCodeScanner } from 'expo-barcode-scanner';\nimport { Platform, StyleSheet, TouchableOpacity, View } from 'react-native';\nimport React from 'react';\nimport { ScanInput, ScanOutput } from '@wavemaker/app-rn-runtime/variables/device/scan/scan.operation';\nimport { DisplayManager } from '@wavemaker/app-rn-runtime/core/display.manager';\nimport permissionManager from '@wavemaker/app-rn-runtime/runtime/services/device/permissions';\nimport appDisplayManagerService from '@wavemaker/app-rn-runtime/runtime/services/app-display-manager.service';\n\ninterface objectMap {\n [key: string]: string\n}\n\nconst barcodeFormatOptions: objectMap = {\n 'ALL': 'ALL',\n 'CODABAR': 'codabar',\n 'CODE_39': 'code39',\n 'CODE_93': 'code93',\n 'CODE_128': 'code128',\n 'DATA_MATRIX': 'datamatrix',\n 'EAN_8': 'ean8',\n 'EAN_13': 'ean13',\n 'ITF': 'itf14',\n 'PDF_417': 'pdf417',\n 'QR_CODE': 'qr',\n 'RSS14': 'rss14',\n 'RSS_EXPANDED': 'rssexpanded',\n 'UPC_E': 'upc_e',\n 'UPC_A': 'upc_a'\n};\nconst opacity = 'rgba(0, 0, 0, 0.6)';\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n flexDirection: 'column'\n },\n closeWrapper: {\n flex: 1,\n alignItems: 'flex-end',\n paddingRight: 10\n },\n topWrapper: {\n flex: 2,\n backgroundColor: opacity\n },\n centerWrapper: {\n flex: 2,\n flexDirection: 'row'\n },\n leftWrapper: {\n flex: 2,\n backgroundColor: opacity\n },\n focused: {\n flex: 10\n },\n rightWrapper: {\n flex: 2,\n backgroundColor: opacity\n },\n bottomWrapper: {\n flex: 2,\n backgroundColor: opacity\n },\n});\n\nexport class ScanService {\n\n constructor(private displayManager: DisplayManager) {}\n\n public scanBarcode(params: ScanInput): Promise<ScanOutput> {\n const format = params?.barcodeFormat || 'ALL';\n const barcodeFormat: string | undefined = Platform.OS === 'ios' ? undefined : barcodeFormatOptions[format];\n return new Promise((resolve, reject) => {\n permissionManager.requestPermissions('camera').then(() => {\n const destroy = this.displayManager.show({\n content: (<Camera\n barCodeScannerSettings={barcodeFormat ? {\n barCodeTypes: [BarCodeScanner.Constants.BarCodeType[barcodeFormat]],\n }: undefined}\n onBarCodeScanned={(result) => {\n destroy.call(this.displayManager);\n resolve(result);\n }}\n style={StyleSheet.absoluteFillObject}\n >\n <View style={styles.topWrapper}>\n <View style={styles.closeWrapper}>\n <TouchableOpacity\n onPress={() => {\n destroy.call(this.displayManager);\n }}>\n <Ionicons name='close-circle' size={32} color='white' />\n </TouchableOpacity>\n </View>\n </View>\n <View style={styles.centerWrapper}>\n <View style={styles.leftWrapper}/>\n <View style={styles.focused}/>\n <View style={styles.rightWrapper}/>\n </View>\n <View style={styles.bottomWrapper}/>\n </Camera>)\n });\n }, reject)\n }).then((response: any) => {\n let format;\n if (response.type) {\n const values = Object.values(BarCodeScanner.Constants.BarCodeType);\n const index = values.indexOf(response.type);\n format = index > -1 ? Object.keys(BarCodeScanner.Constants.BarCodeType)[index] : '';\n }\n return Promise.resolve({\n text: response.data,\n format : format || response.type,\n cancelled : false\n });\n });\n }\n}\nconst scanService = new ScanService(appDisplayManagerService);\nexport default scanService;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,aAAa;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,cAAc,QAAQ,sBAAsB;AACrD,SAASC,QAAQ,EAAEC,UAAU,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AAC3E,OAAOC,KAAK,MAAM,OAAO;AAGzB,OAAOC,iBAAiB,MAAM,+DAA+D;AAC7F,OAAOC,wBAAwB,MAAM,wEAAwE;AAM7G,MAAMC,oBAA+B,GAAG;EACtC,KAAK,EAAE,KAAK;EACZ,SAAS,EAAE,SAAS;EACpB,SAAS,EAAE,QAAQ;EACnB,SAAS,EAAE,QAAQ;EACnB,UAAU,EAAE,SAAS;EACrB,aAAa,EAAE,YAAY;EAC3B,OAAO,EAAE,MAAM;EACf,QAAQ,EAAE,OAAO;EACjB,KAAK,EAAE,OAAO;EACd,SAAS,EAAE,QAAQ;EACnB,SAAS,EAAE,IAAI;EACf,OAAO,EAAE,OAAO;EAChB,cAAc,EAAE,aAAa;EAC7B,OAAO,EAAE,OAAO;EAChB,OAAO,EAAE;AACX,C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SAAS,CAACC,WAAW,CAAC;QAClE,MAAMQ,KAAK,GAAGF,MAAM,CAACG,OAAO,CAACL,QAAQ,CAACC,IAAI,CAAC;QAC3CnB,MAAM,GAAGsB,KAAK,GAAG,CAAC,CAAC,GAAGD,MAAM,CAACG,IAAI,CAACtD,cAAc,CAAC2C,SAAS,CAACC,WAAW,CAAC,CAACQ,KAAK,CAAC,GAAG,EAAE;MACrF;MACA,OAAOlB,OAAO,CAACC,OAAO,CAAC;QACrBoB,IAAI,EAAEP,QAAQ,CAACQ,IAAI;QACnB1B,MAAM,EAAGA,MAAM,IAAIkB,QAAQ,CAACC,IAAI;QAChCQ,SAAS,EAAG;MACd,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;AACF;AACA,MAAMC,WAAW,GAAG,IAAIjC,WAAW,CAAClB,wBAAwB,CAAC;AAC7D,eAAemD,WAAW"}
@@ -1,5 +1,4 @@
1
1
  import { isNumber, isString } from 'lodash-es';
2
- import * as Font from 'expo-font';
3
2
  const isColor = c => true;
4
3
  const isStringOrNumber = v => isNumber(v) || isString(v);
5
4
  const isIn = function () {
@@ -109,8 +108,12 @@ const STYLE_PROP_TYPE_INFO = {
109
108
  isValid: isIn('solid', 'dotted', 'dashed'),
110
109
  ref: 'https://reactnative.dev/docs/view-style-props#borderstyle'
111
110
  },
111
+ borderTopColor: {
112
+ isValid: isNumber,
113
+ ref: 'https://reactnative.dev/docs/view-style-props#bordertopcolor'
114
+ },
112
115
  borderTopEndRadius: {
113
- isValid: isColor,
116
+ isValid: isNumber,
114
117
  ref: 'https://reactnative.dev/docs/view-style-props#bordertopendradius'
115
118
  },
116
119
  borderTopLeftRadius: {
@@ -186,8 +189,7 @@ const STYLE_PROP_TYPE_INFO = {
186
189
  ref: 'https://reactnative.dev/docs/layout-props#flexwrap'
187
190
  },
188
191
  fontFamily: {
189
- isValid: v => Font.isLoaded(v),
190
- errorMsg: v => `Font '${v}' is not loaded. Font family names are case-sensitive. Please add font either in theme or app.`,
192
+ isValid: isString,
191
193
  ref: 'https://reactnative.dev/docs/text-style-props#fontfamily'
192
194
  },
193
195
  fontSize: {
@@ -431,11 +433,4 @@ export const isValidStyleProp = (name, value) => {
431
433
  const info = STYLE_PROP_TYPE_INFO[name];
432
434
  return !info || info.isValid(value);
433
435
  };
434
- export const getErrorMessage = (name, value) => {
435
- const info = STYLE_PROP_TYPE_INFO[name];
436
- if (info && info.errorMsg) {
437
- return info.errorMsg(value);
438
- }
439
- return `'${value}' is not a valid value to '${name}'.`;
440
- };
441
436
  //# sourceMappingURL=style-prop.validator.js.map