@wavemaker/app-rn-runtime 11.4.0-next.26251 → 11.4.0-next.28151

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 (215) hide show
  1. app-rn-runtime/components/advanced/carousel/carousel-content/carousel-content.component.js +1 -1
  2. app-rn-runtime/components/advanced/carousel/carousel-content/carousel-content.component.js.map +1 -1
  3. app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js +1 -1
  4. app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js.map +1 -1
  5. app-rn-runtime/components/advanced/carousel/carousel.component.js +1 -1
  6. app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
  7. app-rn-runtime/components/advanced/login/login.component.js +1 -1
  8. app-rn-runtime/components/advanced/login/login.component.js.map +1 -1
  9. app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.component.js +5 -5
  10. app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.component.js.map +1 -1
  11. app-rn-runtime/components/advanced/webview/webview.component.js +1 -1
  12. app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
  13. app-rn-runtime/components/basic/anchor/anchor.component.js +1 -1
  14. app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
  15. app-rn-runtime/components/basic/button/button.component.js +1 -1
  16. app-rn-runtime/components/basic/button/button.component.js.map +1 -1
  17. app-rn-runtime/components/basic/buttongroup/buttongroup.component.js +1 -1
  18. app-rn-runtime/components/basic/buttongroup/buttongroup.component.js.map +1 -1
  19. app-rn-runtime/components/basic/custom/custom.component.js +25 -0
  20. app-rn-runtime/components/basic/custom/custom.component.js.map +1 -0
  21. app-rn-runtime/components/basic/custom/custom.props.js +16 -0
  22. app-rn-runtime/components/basic/custom/custom.props.js.map +1 -0
  23. app-rn-runtime/components/basic/custom/custom.styles.js +18 -0
  24. app-rn-runtime/components/basic/custom/custom.styles.js.map +1 -0
  25. app-rn-runtime/components/basic/icon/icon.component.js +1 -1
  26. app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
  27. app-rn-runtime/components/basic/label/label.component.js +1 -1
  28. app-rn-runtime/components/basic/label/label.component.js.map +1 -1
  29. app-rn-runtime/components/basic/lottie/lottie.component.js +137 -0
  30. app-rn-runtime/components/basic/lottie/lottie.component.js.map +1 -0
  31. app-rn-runtime/components/basic/lottie/lottie.props.js +14 -0
  32. app-rn-runtime/components/basic/lottie/lottie.props.js.map +1 -0
  33. app-rn-runtime/components/basic/lottie/lottie.styles.js +11 -0
  34. app-rn-runtime/components/basic/lottie/lottie.styles.js.map +1 -0
  35. app-rn-runtime/components/basic/message/message.component.js +1 -1
  36. app-rn-runtime/components/basic/message/message.component.js.map +1 -1
  37. app-rn-runtime/components/basic/picture/picture.component.js +37 -26
  38. app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
  39. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +3 -2
  40. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
  41. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +1 -1
  42. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
  43. app-rn-runtime/components/basic/search/search.component.js +4 -1
  44. app-rn-runtime/components/basic/search/search.component.js.map +1 -1
  45. app-rn-runtime/components/basic/spinner/spinner.component.js +10 -10
  46. app-rn-runtime/components/basic/spinner/spinner.component.js.map +1 -1
  47. app-rn-runtime/components/basic/video/video.component.js +56 -0
  48. app-rn-runtime/components/basic/video/video.component.js.map +1 -0
  49. app-rn-runtime/components/basic/video/video.props.js +22 -0
  50. app-rn-runtime/components/basic/video/video.props.js.map +1 -0
  51. app-rn-runtime/components/basic/video/video.styles.js +11 -0
  52. app-rn-runtime/components/basic/video/video.styles.js.map +1 -0
  53. app-rn-runtime/components/container/accordion/accordion.component.js +1 -1
  54. app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
  55. app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +1 -1
  56. app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
  57. app-rn-runtime/components/container/container.component.js +1 -1
  58. app-rn-runtime/components/container/container.component.js.map +1 -1
  59. app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js +1 -1
  60. app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js.map +1 -1
  61. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js +1 -1
  62. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js.map +1 -1
  63. app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js +1 -1
  64. app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js.map +1 -1
  65. app-rn-runtime/components/container/linearlayout/linearlayout.component.js +1 -1
  66. app-rn-runtime/components/container/linearlayout/linearlayout.component.js.map +1 -1
  67. app-rn-runtime/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js +1 -1
  68. app-rn-runtime/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js.map +1 -1
  69. app-rn-runtime/components/container/panel/panel-content/panel-content.component.js +1 -1
  70. app-rn-runtime/components/container/panel/panel-content/panel-content.component.js.map +1 -1
  71. app-rn-runtime/components/container/panel/panel-footer/panel-footer.component.js +1 -1
  72. app-rn-runtime/components/container/panel/panel-footer/panel-footer.component.js.map +1 -1
  73. app-rn-runtime/components/container/panel/panel.component.js +1 -1
  74. app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
  75. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +12 -4
  76. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
  77. app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js +2 -1
  78. app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
  79. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +1 -1
  80. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
  81. app-rn-runtime/components/container/tabs/tabs.component.js +68 -67
  82. app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
  83. app-rn-runtime/components/container/tabs/tabs.props.js +1 -0
  84. app-rn-runtime/components/container/tabs/tabs.props.js.map +1 -1
  85. app-rn-runtime/components/container/tabs/tabs.styles.js +1 -1
  86. app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
  87. app-rn-runtime/components/container/tile/tile.component.js +1 -1
  88. app-rn-runtime/components/container/tile/tile.component.js.map +1 -1
  89. app-rn-runtime/components/container/wizard/wizard.component.js +1 -1
  90. app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
  91. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +1 -1
  92. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  93. app-rn-runtime/components/data/card/card-content/card-content.component.js +1 -1
  94. app-rn-runtime/components/data/card/card-content/card-content.component.js.map +1 -1
  95. app-rn-runtime/components/data/card/card-footer/card-footer.component.js +1 -1
  96. app-rn-runtime/components/data/card/card-footer/card-footer.component.js.map +1 -1
  97. app-rn-runtime/components/data/card/card.component.js +1 -1
  98. app-rn-runtime/components/data/card/card.component.js.map +1 -1
  99. app-rn-runtime/components/data/form/form-action/form-action.component.js +0 -6
  100. app-rn-runtime/components/data/form/form-action/form-action.component.js.map +1 -1
  101. app-rn-runtime/components/data/form/form-body/form-body.component.js +1 -1
  102. app-rn-runtime/components/data/form/form-body/form-body.component.js.map +1 -1
  103. app-rn-runtime/components/data/form/form-field/form-field.component.js +1 -1
  104. app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
  105. app-rn-runtime/components/data/form/form-footer/form-footer.component.js +1 -1
  106. app-rn-runtime/components/data/form/form-footer/form-footer.component.js.map +1 -1
  107. app-rn-runtime/components/data/form/form.component.js +1 -30
  108. app-rn-runtime/components/data/form/form.component.js.map +1 -1
  109. app-rn-runtime/components/data/list/list-template/list-template.component.js +1 -1
  110. app-rn-runtime/components/data/list/list-template/list-template.component.js.map +1 -1
  111. app-rn-runtime/components/data/list/list.component.js +1 -4
  112. app-rn-runtime/components/data/list/list.component.js.map +1 -1
  113. app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js +1 -1
  114. app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js.map +1 -1
  115. app-rn-runtime/components/device/camera/camera.component.js +3 -0
  116. app-rn-runtime/components/device/camera/camera.component.js.map +1 -1
  117. app-rn-runtime/components/dialogs/dialog/dialog.component.js +1 -1
  118. app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
  119. app-rn-runtime/components/dialogs/dialogactions/dialogactions.component.js +1 -1
  120. app-rn-runtime/components/dialogs/dialogactions/dialogactions.component.js.map +1 -1
  121. app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js +1 -1
  122. app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
  123. app-rn-runtime/components/input/calendar/calendar.component.js +1 -1
  124. app-rn-runtime/components/input/calendar/calendar.component.js.map +1 -1
  125. app-rn-runtime/components/input/checkbox/checkbox.component.js +1 -16
  126. app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
  127. app-rn-runtime/components/input/checkboxset/checkboxset.component.js +0 -38
  128. app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
  129. app-rn-runtime/components/input/composite/composite.component.js +1 -1
  130. app-rn-runtime/components/input/composite/composite.component.js.map +1 -1
  131. app-rn-runtime/components/input/epoch/base-datetime.component.js +1 -1
  132. app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
  133. app-rn-runtime/components/input/fileupload/fileupload.component.js +1 -1
  134. app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
  135. app-rn-runtime/components/input/number/number.component.js +0 -9
  136. app-rn-runtime/components/input/number/number.component.js.map +1 -1
  137. app-rn-runtime/components/input/radioset/radioset.component.js +0 -40
  138. app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
  139. app-rn-runtime/components/input/rating/rating.component.js +1 -1
  140. app-rn-runtime/components/input/rating/rating.component.js.map +1 -1
  141. app-rn-runtime/components/input/slider/slider.component.js +1 -1
  142. app-rn-runtime/components/input/slider/slider.component.js.map +1 -1
  143. app-rn-runtime/components/input/switch/switch.component.js +19 -22
  144. app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
  145. app-rn-runtime/components/input/switch/switch.styles.js +7 -7
  146. app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
  147. app-rn-runtime/components/input/text/text.component.js +1 -10
  148. app-rn-runtime/components/input/text/text.component.js.map +1 -1
  149. app-rn-runtime/components/input/textarea/textarea.component.js +0 -10
  150. app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
  151. app-rn-runtime/components/input/toggle/toggle.component.js +1 -1
  152. app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
  153. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +1 -1
  154. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
  155. app-rn-runtime/components/navigation/basenav/basenav.props.js +1 -0
  156. app-rn-runtime/components/navigation/basenav/basenav.props.js.map +1 -1
  157. app-rn-runtime/components/navigation/menu/menu.component.js +2 -1
  158. app-rn-runtime/components/navigation/menu/menu.component.js.map +1 -1
  159. app-rn-runtime/components/navigation/navbar/navbar.component.js +2 -0
  160. app-rn-runtime/components/navigation/navbar/navbar.component.js.map +1 -1
  161. app-rn-runtime/components/navigation/navitem/navitem.component.js +4 -3
  162. app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
  163. app-rn-runtime/components/navigation/navitem/navitem.props.js +1 -0
  164. app-rn-runtime/components/navigation/navitem/navitem.props.js.map +1 -1
  165. app-rn-runtime/components/navigation/popover/popover.component.js +1 -1
  166. app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
  167. app-rn-runtime/components/page/content/content.component.js +1 -1
  168. app-rn-runtime/components/page/content/content.component.js.map +1 -1
  169. app-rn-runtime/components/page/left-panel/left-panel.component.js +1 -1
  170. app-rn-runtime/components/page/left-panel/left-panel.component.js.map +1 -1
  171. app-rn-runtime/components/page/page-content/page-content.component.js +2 -2
  172. app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
  173. app-rn-runtime/components/page/page.component.js +1 -1
  174. app-rn-runtime/components/page/page.component.js.map +1 -1
  175. app-rn-runtime/components/page/partial/partial.component.js +1 -1
  176. app-rn-runtime/components/page/partial/partial.component.js.map +1 -1
  177. app-rn-runtime/components/page/partial-container/partial-container.component.js +1 -1
  178. app-rn-runtime/components/page/partial-container/partial-container.component.js.map +1 -1
  179. app-rn-runtime/components/page/tabbar/tabbar.component.js +2 -1
  180. app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
  181. app-rn-runtime/components/prefab/prefab-container.component.js +1 -1
  182. app-rn-runtime/components/prefab/prefab-container.component.js.map +1 -1
  183. app-rn-runtime/core/asset.provider.js +5 -0
  184. app-rn-runtime/core/asset.provider.js.map +1 -0
  185. app-rn-runtime/core/base.component.js +113 -41
  186. app-rn-runtime/core/base.component.js.map +1 -1
  187. app-rn-runtime/core/imageSizeEstimator.js +1 -0
  188. app-rn-runtime/core/imageSizeEstimator.js.map +1 -1
  189. app-rn-runtime/gestures/swipe.animation.js +105 -0
  190. app-rn-runtime/gestures/swipe.animation.js.map +1 -0
  191. app-rn-runtime/package.json +4 -3
  192. app-rn-runtime/runtime/App.js +11 -2
  193. app-rn-runtime/runtime/App.js.map +1 -1
  194. app-rn-runtime/runtime/base-fragment.component.js +6 -4
  195. app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
  196. app-rn-runtime/runtime/navigator/drawer.navigator.js +4 -0
  197. app-rn-runtime/runtime/navigator/drawer.navigator.js.map +1 -1
  198. app-rn-runtime/runtime/navigator/stack.navigator.js +5 -1
  199. app-rn-runtime/runtime/navigator/stack.navigator.js.map +1 -1
  200. app-rn-runtime/runtime/services/app-spinner.service.js +5 -1
  201. app-rn-runtime/runtime/services/app-spinner.service.js.map +1 -1
  202. app-rn-runtime/runtime/services/app-toast.service.js +1 -1
  203. app-rn-runtime/runtime/services/app-toast.service.js.map +1 -1
  204. app-rn-runtime/styles/background.component.js +259 -0
  205. app-rn-runtime/styles/background.component.js.map +1 -0
  206. app-rn-runtime/styles/style-prop.validator.js +38 -8
  207. app-rn-runtime/styles/style-prop.validator.js.map +1 -1
  208. app-rn-runtime/styles/style-props.js +93 -0
  209. app-rn-runtime/styles/style-props.js.map +1 -0
  210. app-rn-runtime/styles/theme.js +6 -37
  211. app-rn-runtime/styles/theme.js.map +1 -1
  212. app-rn-runtime/variables/http.service.js +3 -12
  213. app-rn-runtime/variables/http.service.js.map +1 -1
  214. app-rn-runtime/variables/service-variable.js +13 -7
  215. app-rn-runtime/variables/service-variable.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["React","Animated","Easing","Text","FontAwesome","BaseComponent","BaseComponentState","WmIconProps","DEFAULT_CLASS","WavIcon","StreamlineLightIcon","StreamlineRegularIcon","Tappable","Animatedview","createSkeleton","ICON_SIZES","Map","ICON_ROTATTION","WmIconState","WmIcon","constructor","props","Value","getIconDef","iconClass","iconDef","rotate","splits","split","isFontAwesome","find","v","isStreamlineLightIcon","isStreamlineRegularIcon","type","startsWith","substring","isWavIcon","indexOf","animation","size","map","get","spin","stopAnimation","spinValue","setValue","timing","toValue","duration","easing","linear","useNativeDriver","start","componentDidMount","componentWillUnmount","onPropertyChange","name","$new","$old","updateState","getCustomIcon","style","customIcon","theme","mergeStyle","getStyle","iconclass","icon","styles","customIconContent","content","fontFamily","decodeURIComponent","renderSkeleton","skeleton","root","width","skeletonwidth","iconsize","height","skeletonheight","renderIcon","state","color","text","transform","iconSize","fontSize","show","WMCustomIcon","interpolate","inputRange","outputRange","opacity","renderWidget","iconposition","caption"],"sources":["icon.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Animated, Easing, Text } from 'react-native';\nimport { FontAwesome } from '@expo/vector-icons';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmIconProps from './icon.props';\nimport { DEFAULT_CLASS, WmIconStyles } from './icon.styles';\nimport WavIcon from './wavicon/wavicon.component';\nimport StreamlineLightIcon from './streamline-light-icon/streamline-light-icon.component';\nimport StreamlineRegularIcon from './streamline-regular-icon/streamline-regular-icon.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport WmSkeleton, { createSkeleton } from '../skeleton/skeleton.component';\n\ninterface IconDef {\n isFontAwesome: boolean;\n isWavIcon: boolean;\n isStreamlineLightIcon: boolean;\n isStreamlineRegularIcon: boolean;\n type: string;\n rotate: string;\n size: number;\n animation: string;\n}\n\nconst ICON_SIZES = new Map([\n ['fa-lg', 24],\n ['fa-2x', 36],\n ['fa-3x', 48],\n ['fa-4x', 60],\n ['fa-5x', 72]\n]);\n\nconst ICON_ROTATTION = new Map([\n ['fa-rotate-90', '90deg'],\n ['fa-rotate-180', '180deg'],\n ['fa-rotate-270', '270deg']\n]);\n\nexport class WmIconState extends BaseComponentState<WmIconProps> {\n public iconDef = {} as IconDef;\n}\n\nexport default class WmIcon extends BaseComponent<WmIconProps, WmIconState, WmIconStyles> {\n spinValue = new Animated.Value(0);\n pulseValue = new Animated.Value(0);\n public stopAnimation = true; \n\n constructor(props: WmIconProps) {\n super(props, DEFAULT_CLASS, new WmIconProps());\n }\n\n getIconDef(iconClass: string): IconDef {\n const iconDef = {\n rotate: '0'\n } as IconDef;\n const splits = iconClass.split(' ');\n iconDef.isFontAwesome = !!splits.find(v => v === 'fa');\n iconDef.isStreamlineLightIcon = !!splits.find(v => v === 'wm-sl-l');\n iconDef.isStreamlineRegularIcon = !!splits.find(v => v === 'wm-sl-r');\n if (iconDef.isFontAwesome) {\n iconDef.type = splits.find(v => v.startsWith('fa-'))?.substring(3) || '';\n } else if (iconDef.isStreamlineLightIcon) {\n iconDef.type = splits.find(v => v.startsWith('sl-'))?.substring(3) || '';\n } else if (iconDef.isStreamlineRegularIcon) {\n iconDef.type = splits.find(v => v.startsWith('sl-'))?.substring(3) || '';\n } else {\n iconDef.isWavIcon = !iconDef.isFontAwesome && !!splits.find(v => v === 'wi');\n iconDef.type = (iconDef.isWavIcon && splits.find(v => v.startsWith('wi-'))?.substring(3)) || '';\n }\n if (iconClass.indexOf('fa-spin') >= 0) {\n iconDef.animation = 'spin';\n } else if (iconClass.indexOf('fa-pulse') >= 0) {\n iconDef.animation = 'pulse';\n }\n iconDef.size = splits.map(v => ICON_SIZES.get(v)).find(v => !!v) || 12;\n iconDef.rotate = splits.map(v => ICON_ROTATTION.get(v)).find(v => !!v) || '0deg';\n return iconDef;\n }\n\n private spin () {\n if (this.stopAnimation) {\n return;\n }\n this.spinValue.setValue(0);\n Animated.timing(\n this.spinValue,\n {\n toValue: 1,\n duration: 1000,\n easing: Easing.linear,\n useNativeDriver: true\n }\n ).start(() => this.spin());\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.spin();\n }\n\n componentWillUnmount(): void {\n super.componentWillUnmount();\n this.stopAnimation = true;\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n super.onPropertyChange(name, $new, $old);\n switch(name) {\n case 'iconclass':\n $new && this.updateState({iconDef: this.getIconDef($new)} as WmIconState);\n break;\n }\n }\n\n private getCustomIcon(props: WmIconProps, style: any) {\n const customIcon = this.theme.mergeStyle({}, this.theme.getStyle(props?.iconclass || '')?.icon || this.styles.icon);\n const customIconContent = customIcon?.content;\n if (customIconContent) {\n delete customIcon.content;\n return (<Text\n style={[style, customIcon.fontFamily ? {fontFamily: customIcon.fontFamily}: null]}>\n {decodeURIComponent(customIconContent)}\n </Text>);\n }\n return null;\n }\n\n public renderSkeleton(props: WmIconProps) {\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: this.props.skeletonwidth || this.props.iconsize || this.styles.root.width,\n height: this.props.skeletonheight || this.props.iconsize || this.styles.root.height\n });\n }\n\n renderIcon(props: WmIconProps) {\n const iconDef = this.state.iconDef;\n if (!iconDef) {\n return null;\n }\n let icon = null;\n const style = [{\n color: this.styles.root.color || this.styles.text.color\n }, this.styles.icon, {transform: [{rotate: iconDef.rotate}]}];\n const customIcon = this.getCustomIcon(props, style);\n const iconSize = props.iconsize || this.styles.root.fontSize || this.styles.text.fontSize || iconDef.size;\n if (props.show && iconDef && iconDef.isFontAwesome) {\n //@ts-ignore type information is not matching\n icon = (<FontAwesome name={customIcon ? '' : iconDef.type}\n style={style}\n size={iconSize}>\n {customIcon}\n </FontAwesome>);\n } else if (props.show && iconDef) {\n let WMCustomIcon = WavIcon as unknown;\n if (iconDef.isStreamlineLightIcon) {\n WMCustomIcon = StreamlineLightIcon;\n } else if (iconDef.isStreamlineRegularIcon) {\n WMCustomIcon = StreamlineRegularIcon;\n }\n //@ts-ignore type information is not matching\n icon = WMCustomIcon ? (<WMCustomIcon name={customIcon ? '' : iconDef.type}\n style={style}\n size={iconSize}>\n {customIcon}\n </WMCustomIcon>) : null;\n }\n if (icon && iconDef.animation === 'spin') {\n const rotate = this.spinValue.interpolate({ inputRange: [0, 1], outputRange: ['0deg', '360deg']});\n const animation = { transform: [{ rotate }] };\n this.stopAnimation = false;\n return (<Animated.View style={animation}>{icon}</Animated.View>);\n } else if (icon && iconDef.animation === 'pulse') {\n const opacity = this.spinValue.interpolate({ inputRange: [0, 1], outputRange: [0, 1]});\n const animation = { opacity: opacity };\n this.stopAnimation = false;\n return (<Animated.View style={animation}>{icon}</Animated.View>);\n } else {\n this.stopAnimation = true;\n }\n return icon;\n }\n\n renderWidget(props: WmIconProps) {\n let icon = this.renderIcon(props);\n return (\n <Tappable target={this}>\n <Animatedview entryanimation={props.animation} style={this.styles.root}>\n {(props.iconposition === 'left' && icon) || null}\n {(props.caption && (<Text style={this.styles.text}>{props.caption}</Text>)) || null}\n {(props.iconposition === 'right' && icon) || null}\n </Animatedview>\n </Tappable>\n );\n }\n}\n"],"mappings":";;;AAA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,CAAC,CAAC,EAAE,CAAC,CAAC;QAAEC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC;MAAC,CAAC,CAAC;MACtF,MAAMtD,SAAS,GAAG;QAAEuD,OAAO,EAAEA;MAAQ,CAAC;MACtC,IAAI,CAAClD,aAAa,GAAG,KAAK;MAC1B,oBAAQ,oBAAC,QAAQ,CAAC,IAAI;QAAC,KAAK,EAAEL;MAAU,GAAE6B,IAAI,CAAiB;IACjE,CAAC,MAAM;MACL,IAAI,CAACxB,aAAa,GAAG,IAAI;IAC3B;IACA,OAAOwB,IAAI;EACb;EAEA2B,YAAY,CAAC1E,KAAkB,EAAE;IAC/B,IAAI+C,IAAI,GAAG,IAAI,CAACc,UAAU,CAAC7D,KAAK,CAAC;IACjC,oBACE,oBAAC,QAAQ;MAAC,MAAM,EAAE;IAAK,gBACrB,oBAAC,YAAY;MAAC,cAAc,EAAEA,KAAK,CAACkB,SAAU;MAAC,KAAK,EAAE,IAAI,CAAC8B,MAAM,CAACO;IAAK,GACnEvD,KAAK,CAAC2E,YAAY,KAAK,MAAM,IAAI5B,IAAI,IAAK,IAAI,EAC9C/C,KAAK,CAAC4E,OAAO,iBAAK,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAAC5B,MAAM,CAACgB;IAAK,GAAEhE,KAAK,CAAC4E,OAAO,CAAS,IAAK,IAAI,EACjF5E,KAAK,CAAC2E,YAAY,KAAK,OAAO,IAAI5B,IAAI,IAAK,IAAI,CACpC,CACN;EAEf;AACF"}
1
+ {"version":3,"names":["React","Animated","Easing","Text","FontAwesome","BaseComponent","BaseComponentState","WmIconProps","DEFAULT_CLASS","WavIcon","StreamlineLightIcon","StreamlineRegularIcon","Tappable","Animatedview","createSkeleton","ICON_SIZES","Map","ICON_ROTATTION","WmIconState","WmIcon","constructor","props","Value","getIconDef","iconClass","iconDef","rotate","splits","split","isFontAwesome","find","v","isStreamlineLightIcon","isStreamlineRegularIcon","type","startsWith","substring","isWavIcon","indexOf","animation","size","map","get","spin","stopAnimation","spinValue","setValue","timing","toValue","duration","easing","linear","useNativeDriver","start","componentDidMount","componentWillUnmount","onPropertyChange","name","$new","$old","updateState","getCustomIcon","style","customIcon","theme","mergeStyle","getStyle","iconclass","icon","styles","customIconContent","content","fontFamily","decodeURIComponent","renderSkeleton","skeleton","root","width","skeletonwidth","iconsize","height","skeletonheight","renderIcon","state","color","text","transform","iconSize","fontSize","show","WMCustomIcon","interpolate","inputRange","outputRange","opacity","renderWidget","_background","iconposition","caption"],"sources":["icon.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Animated, Easing, Text } from 'react-native';\nimport { FontAwesome } from '@expo/vector-icons';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmIconProps from './icon.props';\nimport { DEFAULT_CLASS, WmIconStyles } from './icon.styles';\nimport WavIcon from './wavicon/wavicon.component';\nimport StreamlineLightIcon from './streamline-light-icon/streamline-light-icon.component';\nimport StreamlineRegularIcon from './streamline-regular-icon/streamline-regular-icon.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport WmSkeleton, { createSkeleton } from '../skeleton/skeleton.component';\n\ninterface IconDef {\n isFontAwesome: boolean;\n isWavIcon: boolean;\n isStreamlineLightIcon: boolean;\n isStreamlineRegularIcon: boolean;\n type: string;\n rotate: string;\n size: number;\n animation: string;\n}\n\nconst ICON_SIZES = new Map([\n ['fa-lg', 24],\n ['fa-2x', 36],\n ['fa-3x', 48],\n ['fa-4x', 60],\n ['fa-5x', 72]\n]);\n\nconst ICON_ROTATTION = new Map([\n ['fa-rotate-90', '90deg'],\n ['fa-rotate-180', '180deg'],\n ['fa-rotate-270', '270deg']\n]);\n\nexport class WmIconState extends BaseComponentState<WmIconProps> {\n public iconDef = {} as IconDef;\n}\n\nexport default class WmIcon extends BaseComponent<WmIconProps, WmIconState, WmIconStyles> {\n spinValue = new Animated.Value(0);\n pulseValue = new Animated.Value(0);\n public stopAnimation = true; \n\n constructor(props: WmIconProps) {\n super(props, DEFAULT_CLASS, new WmIconProps());\n }\n\n getIconDef(iconClass: string): IconDef {\n const iconDef = {\n rotate: '0'\n } as IconDef;\n const splits = iconClass.split(' ');\n iconDef.isFontAwesome = !!splits.find(v => v === 'fa');\n iconDef.isStreamlineLightIcon = !!splits.find(v => v === 'wm-sl-l');\n iconDef.isStreamlineRegularIcon = !!splits.find(v => v === 'wm-sl-r');\n if (iconDef.isFontAwesome) {\n iconDef.type = splits.find(v => v.startsWith('fa-'))?.substring(3) || '';\n } else if (iconDef.isStreamlineLightIcon) {\n iconDef.type = splits.find(v => v.startsWith('sl-'))?.substring(3) || '';\n } else if (iconDef.isStreamlineRegularIcon) {\n iconDef.type = splits.find(v => v.startsWith('sl-'))?.substring(3) || '';\n } else {\n iconDef.isWavIcon = !iconDef.isFontAwesome && !!splits.find(v => v === 'wi');\n iconDef.type = (iconDef.isWavIcon && splits.find(v => v.startsWith('wi-'))?.substring(3)) || '';\n }\n if (iconClass.indexOf('fa-spin') >= 0) {\n iconDef.animation = 'spin';\n } else if (iconClass.indexOf('fa-pulse') >= 0) {\n iconDef.animation = 'pulse';\n }\n iconDef.size = splits.map(v => ICON_SIZES.get(v)).find(v => !!v) || 12;\n iconDef.rotate = splits.map(v => ICON_ROTATTION.get(v)).find(v => !!v) || '0deg';\n return iconDef;\n }\n\n private spin () {\n if (this.stopAnimation) {\n return;\n }\n this.spinValue.setValue(0);\n Animated.timing(\n this.spinValue,\n {\n toValue: 1,\n duration: 1000,\n easing: Easing.linear,\n useNativeDriver: true\n }\n ).start(() => this.spin());\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.spin();\n }\n\n componentWillUnmount(): void {\n super.componentWillUnmount();\n this.stopAnimation = true;\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n super.onPropertyChange(name, $new, $old);\n switch(name) {\n case 'iconclass':\n $new && this.updateState({iconDef: this.getIconDef($new)} as WmIconState);\n break;\n }\n }\n\n private getCustomIcon(props: WmIconProps, style: any) {\n const customIcon = this.theme.mergeStyle({}, this.theme.getStyle(props?.iconclass || '')?.icon || this.styles.icon);\n const customIconContent = customIcon?.content;\n if (customIconContent) {\n delete customIcon.content;\n return (<Text\n style={[style, customIcon.fontFamily ? {fontFamily: customIcon.fontFamily}: null]}>\n {decodeURIComponent(customIconContent)}\n </Text>);\n }\n return null;\n }\n\n public renderSkeleton(props: WmIconProps) {\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: this.props.skeletonwidth || this.props.iconsize || this.styles.root.width,\n height: this.props.skeletonheight || this.props.iconsize || this.styles.root.height\n });\n }\n\n renderIcon(props: WmIconProps) {\n const iconDef = this.state.iconDef;\n if (!iconDef) {\n return null;\n }\n let icon = null;\n const style = [{\n color: this.styles.root.color || this.styles.text.color\n }, this.styles.icon, {transform: [{rotate: iconDef.rotate}]}];\n const customIcon = this.getCustomIcon(props, style);\n const iconSize = props.iconsize || this.styles.root.fontSize || this.styles.text.fontSize || iconDef.size;\n if (props.show && iconDef && iconDef.isFontAwesome) {\n //@ts-ignore type information is not matching\n icon = (<FontAwesome name={customIcon ? '' : iconDef.type}\n style={style}\n size={iconSize}>\n {customIcon}\n </FontAwesome>);\n } else if (props.show && iconDef) {\n let WMCustomIcon = WavIcon as unknown;\n if (iconDef.isStreamlineLightIcon) {\n WMCustomIcon = StreamlineLightIcon;\n } else if (iconDef.isStreamlineRegularIcon) {\n WMCustomIcon = StreamlineRegularIcon;\n }\n //@ts-ignore type information is not matching\n icon = WMCustomIcon ? (<WMCustomIcon name={customIcon ? '' : iconDef.type}\n style={style}\n size={iconSize}>\n {customIcon}\n </WMCustomIcon>) : null;\n }\n if (icon && iconDef.animation === 'spin') {\n const rotate = this.spinValue.interpolate({ inputRange: [0, 1], outputRange: ['0deg', '360deg']});\n const animation = { transform: [{ rotate }] };\n this.stopAnimation = false;\n return (<Animated.View style={animation}>{icon}</Animated.View>);\n } else if (icon && iconDef.animation === 'pulse') {\n const opacity = this.spinValue.interpolate({ inputRange: [0, 1], outputRange: [0, 1]});\n const animation = { opacity: opacity };\n this.stopAnimation = false;\n return (<Animated.View style={animation}>{icon}</Animated.View>);\n } else {\n this.stopAnimation = true;\n }\n return icon;\n }\n\n renderWidget(props: WmIconProps) {\n let icon = this.renderIcon(props);\n return (\n <Tappable target={this}>\n <Animatedview entryanimation={props.animation} style={this.styles.root}>\n {this._background}\n {(props.iconposition === 'left' && icon) || null}\n {(props.caption && (<Text style={this.styles.text}>{props.caption}</Text>)) || null}\n {(props.iconposition === 'right' && icon) || null}\n </Animatedview>\n </Tappable>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,MAAM,EAAEC,IAAI,QAAQ,cAAc;AACrD,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,WAAW,MAAM,cAAc;AACtC,SAASC,aAAa,QAAsB,eAAe;AAC3D,OAAOC,OAAO,MAAM,6BAA6B;AACjD,OAAOC,mBAAmB,MAAM,yDAAyD;AACzF,OAAOC,qBAAqB,MAAM,6DAA6D;AAC/F,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAAqBC,cAAc,QAAQ,gCAAgC;AAa3E,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAAC,CACzB,CAAC,OAAO,EAAE,EAAE,CAAC,EACb,CAAC,OAAO,EAAE,EAAE,CAAC,EACb,CAAC,OAAO,EAAE,EAAE,CAAC,EACb,CAAC,OAAO,EAAE,EAAE,CAAC,EACb,CAAC,OAAO,EAAE,EAAE,CAAC,CACd,CAAC;AAEF,MAAMC,cAAc,GAAG,IAAID,GAAG,CAAC,CAC7B,CAAC,cAAc,EAAE,OAAO,CAAC,EACzB,CAAC,eAAe,EAAE,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AE,IAAI,CAAC7B,MAAM,CAACgB;IAAK,GAAEhE,KAAK,CAAC6E,OAAO,CAAS,IAAK,IAAI,EACjF7E,KAAK,CAAC4E,YAAY,KAAK,OAAO,IAAI7B,IAAI,IAAK,IAAI,CACpC,CACN;EAEf;AACF"}
@@ -51,7 +51,7 @@ export default class WmLabel extends BaseComponent {
51
51
  return !isNil(props.caption) ? /*#__PURE__*/React.createElement(Animatedview, {
52
52
  entryanimation: props.animation,
53
53
  style: this.styles.root
54
- }, /*#__PURE__*/React.createElement(Tappable, {
54
+ }, this._background, /*#__PURE__*/React.createElement(Tappable, {
55
55
  target: this
56
56
  }, /*#__PURE__*/React.createElement(Text, {
57
57
  style: [this.styles.text, {
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","Tappable","WmLabelProps","DEFAULT_CLASS","isNil","toString","Animatedview","createSkeleton","WmLabelState","WmLabel","constructor","props","getAsterisk","styles","asterisk","getMultilineSkeleton","width","height","borderRadius","marginBottom","theme","skeleton","renderSkeleton","skeletonWidth","skeletonwidth","root","skeletonHeight","skeletonheight","text","fontSize","multilineskeleton","renderWidget","caption","animation","color","isValid","wrap","undefined","required"],"sources":["label.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\n\nimport WmLabelProps from './label.props';\nimport { DEFAULT_CLASS, WmLabelStyles } from './label.styles';\nimport { isNil, toString } from 'lodash-es';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport WmSkeleton, { createSkeleton } from '../skeleton/skeleton.component';\nimport { totalMonths } from 'react-native-paper-dates/lib/typescript/Date/dateUtils';\n\nexport class WmLabelState extends BaseComponentState<WmLabelProps> {\n\n}\n\nexport default class WmLabel extends BaseComponent<WmLabelProps, WmLabelState, WmLabelStyles> {\n\n constructor(props: WmLabelProps) {\n super(props, DEFAULT_CLASS, new WmLabelProps());\n }\n\n private getAsterisk () {\n return <Text style={this.styles.asterisk}>*</Text>;\n }\n\n private getMultilineSkeleton(width: any, height: any) {\n const styles = {\n borderRadius:4,\n marginBottom: 10,\n height: height\n };\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...styles,\n width: width,\n height: height\n });\n }\n\n public renderSkeleton(props: WmLabelProps){\n const skeletonWidth = this.props.skeletonwidth || this.styles.root?.width;\n const skeletonHeight = this.props.skeletonheight || this.styles.root?.height || this.styles.text.fontSize;\n if(this.props.multilineskeleton) {\n return (<View style={{\n width: skeletonWidth\n }}>\n {this.getMultilineSkeleton('100%', skeletonHeight)}\n {this.getMultilineSkeleton('70%', skeletonHeight)}\n {this.getMultilineSkeleton('40%', skeletonHeight)}\n </View>)\n }\n else{\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: skeletonWidth,\n height: skeletonHeight\n }); \n }\n }\n\n renderWidget(props: WmLabelProps) {\n return !isNil(props.caption)? (\n <Animatedview entryanimation={props.animation} style={this.styles.root}>\n <Tappable target={this}>\n <Text\n style={[this.styles.text, \n {color: props.isValid === false ? 'red' : this.styles.text.color}]}\n numberOfLines={props.wrap ? undefined : 1}>\n {toString(props.caption)}\n {props.required && this.getAsterisk()}\n </Text>\n </Tappable>\n </Animatedview>\n ): null;\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAASC,QAAQ,QAAQ,mDAAmD;AAE5E,OAAOC,YAAY,MAAM,eAAe;AACxC,SAASC,aAAa,QAAuB,gBAAgB;AAC7D,SAASC,KAAK,EAAEC,QAAQ,QAAQ,WAAW;AAC3C,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAAqBC,cAAc,QAAQ,gCAAgC;AAG3E,OAAO,MAAMC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EAAEW,cAAc,CAAC,CAC5C;IACT,CAAC,MACG;MACF,OAAOnB,cAAc,CAAC,IAAI,CAACa,KAAK,EAAE,IAAI,CAACP,MAAM,CAACQ,QAAQ,EAAE;QACtD,GAAG,IAAI,CAACR,MAAM,CAACY,IAAI;QACnBT,KAAK,EAAEO,aAAa;QACpBN,MAAM,EAAES;MACV,CAAC,CAAC;IACJ;EACF;EAEAK,YAAY,CAACpB,KAAmB,EAAE;IAChC,OAAO,CAACP,KAAK,CAACO,KAAK,CAACqB,OAAO,CAAC,gBAC1B,oBAAC,YAAY;MAAC,cAAc,EAAErB,KAAK,CAACsB,SAAU;MAAC,KAAK,EAAE,IAAI,CAACpB,MAAM,CAACY;IAAK,gBACrE,oBAAC,QAAQ;MAAC,MAAM,EAAE;IAAK,gBACnB,oBAAC,IAAI;MACH,KAAK,EAAE,CAAC,IAAI,CAACZ,MAAM,CAACe,IAAI,EACtB;QAACM,KAAK,EAAEvB,KAAK,CAACwB,OAAO,KAAK,KAAK,GAAG,KAAK,GAAG,IAAI,CAACtB,MAAM,CAACe,IAAI,CAACM;MAAK,CAAC,CAAE;MACrE,aAAa,EAAEvB,KAAK,CAACyB,IAAI,GAAGC,SAAS,GAAG;IAAE,GACzChC,QAAQ,CAACM,KAAK,CAACqB,OAAO,CAAC,EACvBrB,KAAK,CAAC2B,QAAQ,IAAI,IAAI,CAAC1B,WAAW,EAAE,CAChC,CACA,CACE,GACd,IAAI;EACT;AACF"}
1
+ {"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","Tappable","WmLabelProps","DEFAULT_CLASS","isNil","toString","Animatedview","createSkeleton","WmLabelState","WmLabel","constructor","props","getAsterisk","styles","asterisk","getMultilineSkeleton","width","height","borderRadius","marginBottom","theme","skeleton","renderSkeleton","skeletonWidth","skeletonwidth","root","skeletonHeight","skeletonheight","text","fontSize","multilineskeleton","renderWidget","caption","animation","_background","color","isValid","wrap","undefined","required"],"sources":["label.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\n\nimport WmLabelProps from './label.props';\nimport { DEFAULT_CLASS, WmLabelStyles } from './label.styles';\nimport { isNil, toString } from 'lodash-es';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport WmSkeleton, { createSkeleton } from '../skeleton/skeleton.component';\nimport { totalMonths } from 'react-native-paper-dates/lib/typescript/Date/dateUtils';\n\nexport class WmLabelState extends BaseComponentState<WmLabelProps> {\n\n}\n\nexport default class WmLabel extends BaseComponent<WmLabelProps, WmLabelState, WmLabelStyles> {\n\n constructor(props: WmLabelProps) {\n super(props, DEFAULT_CLASS, new WmLabelProps());\n }\n\n private getAsterisk () {\n return <Text style={this.styles.asterisk}>*</Text>;\n }\n\n private getMultilineSkeleton(width: any, height: any) {\n const styles = {\n borderRadius:4,\n marginBottom: 10,\n height: height\n };\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...styles,\n width: width,\n height: height\n });\n }\n\n public renderSkeleton(props: WmLabelProps){\n const skeletonWidth = this.props.skeletonwidth || this.styles.root?.width;\n const skeletonHeight = this.props.skeletonheight || this.styles.root?.height || this.styles.text.fontSize;\n if(this.props.multilineskeleton) {\n return (<View style={{\n width: skeletonWidth\n }}>\n {this.getMultilineSkeleton('100%', skeletonHeight)}\n {this.getMultilineSkeleton('70%', skeletonHeight)}\n {this.getMultilineSkeleton('40%', skeletonHeight)}\n </View>)\n }\n else{\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: skeletonWidth,\n height: skeletonHeight\n }); \n }\n }\n\n renderWidget(props: WmLabelProps) {\n return !isNil(props.caption)? (\n <Animatedview entryanimation={props.animation} style={this.styles.root}>\n {this._background}\n <Tappable target={this}>\n <Text\n style={[this.styles.text, \n {color: props.isValid === false ? 'red' : this.styles.text.color}]}\n numberOfLines={props.wrap ? undefined : 1}>\n {toString(props.caption)}\n {props.required && this.getAsterisk()}\n </Text>\n </Tappable>\n </Animatedview>\n ): null;\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAASC,QAAQ,QAAQ,mDAAmD;AAE5E,OAAOC,YAAY,MAAM,eAAe;AACxC,SAASC,aAAa,QAAuB,gBAAgB;AAC7D,SAASC,KAAK,EAAEC,QAAQ,QAAQ,WAAW;AAC3C,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAAqBC,cAAc,QAAQ,gCAAgC;AAG3E,OAAO,MAAMC,YAAY,SAASR,kBAAkB,CAAe;AAInE,eAAe,MAAMS,OAAO,SAASV,aAAa,CAA4C;EAE5FW,WAAW,CAACC,KAAmB,EAAE;IAC/B,KAAK,CAACA,KAAK,EAAER,aAAa,EAAE,IAAID,YAAY,EAAE,CAAC;EACjD;EAEQU,WAAW,GAAI;IACrB,oBAAO,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAS,GAAC,GAAC,CAAO;EACpD;EAEQC,oBAAoB,CAACC,KAAU,EAAEC,MAAW,EAAE;IACpD,MAAMJ,MAAM,GAAG;MACbK,YAAY,EAAC,CAAC;MACdC,YAAY,EAAE,EAAE;MAChBF,MAAM,EAAEA;IACV,CAAC;IACD,OAAOV,cAAc,CAAC,IAAI,CAACa,KAAK,EAAE,IAAI,CAACP,MAAM,CAACQ,QAAQ,EAAE;MACtD,GAAGR,MAAM;MACTG,KAAK,EAAEA,KAAK;MACZC,MAAM,EAAEA;IACV,CAAC,CAAC;EACJ;EAEOK,cAAc,CAACX,KAAmB,EAAC;IAAA;IACxC,MAAMY,aAAa,GAAG,IAAI,CAACZ,KAAK,CAACa,aAAa,0BAAI,IAAI,CAACX,MAAM,CAACY,IAAI,sDAAhB,kBAA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,GAAG;IAAE,GACzCjC,QAAQ,CAACM,KAAK,CAACqB,OAAO,CAAC,EACvBrB,KAAK,CAAC4B,QAAQ,IAAI,IAAI,CAAC3B,WAAW,EAAE,CAChC,CACA,CACE,GACd,IAAI;EACT;AACF"}
@@ -0,0 +1,137 @@
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
+ import React from 'react';
5
+ import axios from 'axios';
6
+ import { Platform, View } from 'react-native';
7
+ import LottieView from 'lottie-react-native';
8
+ import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';
9
+ import WmLottieProps from './lottie.props';
10
+ import { DEFAULT_CLASS } from './lottie.styles';
11
+ export class WmLottieState extends BaseComponentState {
12
+ constructor() {
13
+ super(...arguments);
14
+ _defineProperty(this, "animationData", void 0);
15
+ _defineProperty(this, "isCompleted", false);
16
+ }
17
+ }
18
+ export default class WmLottie extends BaseComponent {
19
+ constructor(props) {
20
+ super(props, DEFAULT_CLASS, new WmLottieProps(), new WmLottieState());
21
+ _defineProperty(this, "lottie", /*#__PURE__*/React.createRef());
22
+ }
23
+ play() {
24
+ if (this.lottie.current) {
25
+ if (this.state.isCompleted) {
26
+ this.reset();
27
+ } else {
28
+ this.lottie.current.play();
29
+ this.invokeEventCallback('onPlay', [null, this.proxy]);
30
+ }
31
+ }
32
+ }
33
+ pause() {
34
+ if (this.lottie.current) {
35
+ this.lottie.current.pause();
36
+ this.invokeEventCallback('onPause', [null, this.proxy]);
37
+ }
38
+ }
39
+ reset() {
40
+ if (this.lottie.current) {
41
+ if (this.lottie.current.reset) {
42
+ this.lottie.current.reset();
43
+ this.lottie.current.play();
44
+ } else if (this.lottie.current.goToAndPlay) {
45
+ this.lottie.current.goToAndPlay(0);
46
+ } else {
47
+ return;
48
+ }
49
+ this.invokeEventCallback('onPlay', [null, this.proxy]);
50
+ this.updateState({
51
+ isCompleted: false
52
+ });
53
+ }
54
+ }
55
+ onReady() {
56
+ this.invokeEventCallback('onReady', [null, this.proxy]);
57
+ if (this.state.props.autoplay) {
58
+ this.invokeEventCallback('onPlay', [null, this.proxy]);
59
+ }
60
+ }
61
+ loadAnimationData() {
62
+ if (this.state.animationData || !this.loadAsset) {
63
+ return;
64
+ }
65
+ if (Platform.OS == 'web') {
66
+ const url = this.loadAsset(this.state.props.source);
67
+ axios.get(url).then(_ref => {
68
+ let {
69
+ data
70
+ } = _ref;
71
+ this.updateState({
72
+ animationData: data
73
+ }, () => this.onReady());
74
+ });
75
+ } else {
76
+ this.updateState({
77
+ animationData: this.loadAsset(this.state.props.source)
78
+ }, () => this.onReady());
79
+ }
80
+ }
81
+ onPropertyChange(name, $new, $old) {
82
+ super.onPropertyChange(name, $new, $old);
83
+ switch (name) {
84
+ case 'src':
85
+ this.loadAnimationData();
86
+ break;
87
+ case 'loop':
88
+ if (this.initialized && !this.state.isCompleted && ($new || this.state.props.autoplay)) {
89
+ setTimeout(() => this.reset(), 200);
90
+ }
91
+ break;
92
+ }
93
+ }
94
+ componentDidMount() {
95
+ super.componentDidMount();
96
+ this.loadAnimationData();
97
+ }
98
+ renderWebLottie(props) {
99
+ const Lottie = require('react-lottie-player');
100
+ return /*#__PURE__*/React.createElement(Lottie, {
101
+ animationData: this.state.animationData,
102
+ ref: this.lottie,
103
+ loop: props.loop,
104
+ play: props.autoplay,
105
+ speed: props.speed,
106
+ style: this.styles.lottie,
107
+ onComplete: () => {
108
+ this.updateState({
109
+ isCompleted: true
110
+ });
111
+ this.invokeEventCallback('onComplete', [null, this.proxy]);
112
+ }
113
+ });
114
+ }
115
+ renderNativeLottie(props) {
116
+ return /*#__PURE__*/React.createElement(LottieView, {
117
+ source: this.state.animationData,
118
+ ref: this.lottie,
119
+ autoPlay: props.autoplay,
120
+ speed: props.speed,
121
+ loop: props.loop,
122
+ style: this.styles.lottie,
123
+ onAnimationFinish: () => {
124
+ this.updateState({
125
+ isCompleted: true
126
+ });
127
+ this.invokeEventCallback('onComplete', [null, this.proxy]);
128
+ }
129
+ });
130
+ }
131
+ renderWidget(props) {
132
+ return /*#__PURE__*/React.createElement(View, {
133
+ style: this.styles.root
134
+ }, this._background, this.state.animationData ? Platform.OS == 'web' ? this.renderWebLottie(props) : this.renderNativeLottie(props) : null);
135
+ }
136
+ }
137
+ //# sourceMappingURL=lottie.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","axios","Platform","View","LottieView","BaseComponent","BaseComponentState","WmLottieProps","DEFAULT_CLASS","WmLottieState","WmLottie","constructor","props","createRef","play","lottie","current","state","isCompleted","reset","invokeEventCallback","proxy","pause","goToAndPlay","updateState","onReady","autoplay","loadAnimationData","animationData","loadAsset","OS","url","source","get","then","data","onPropertyChange","name","$new","$old","initialized","setTimeout","componentDidMount","renderWebLottie","Lottie","require","loop","speed","styles","renderNativeLottie","renderWidget","root","_background"],"sources":["lottie.component.tsx"],"sourcesContent":["import React from 'react';\nimport axios from 'axios';\nimport { Platform, View } from 'react-native';\nimport LottieView from 'lottie-react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmLottieProps from './lottie.props';\nimport { DEFAULT_CLASS, WmLottieStyles } from './lottie.styles';\n\nexport class WmLottieState extends BaseComponentState<WmLottieProps> {\n animationData: any;\n isCompleted = false;\n}\n\nexport default class WmLottie extends BaseComponent<WmLottieProps, WmLottieState, WmLottieStyles> {\n\n private lottie = React.createRef<LottieView>();\n\n constructor(props: WmLottieProps) {\n super(props, DEFAULT_CLASS, new WmLottieProps(), new WmLottieState());\n }\n \n play() {\n if (this.lottie.current) {\n if (this.state.isCompleted) {\n this.reset();\n } else {\n this.lottie.current.play();\n this.invokeEventCallback('onPlay', [null, this.proxy]);\n }\n }\n }\n\n pause() {\n if (this.lottie.current) {\n this.lottie.current.pause();\n this.invokeEventCallback('onPause', [null, this.proxy]);\n }\n }\n\n reset() {\n if (this.lottie.current) {\n if (this.lottie.current.reset) {\n this.lottie.current.reset();\n this.lottie.current.play();\n } else if((this.lottie.current as any).goToAndPlay) {\n (this.lottie.current as any).goToAndPlay(0);\n } else {\n return;\n }\n this.invokeEventCallback('onPlay', [null, this.proxy]);\n this.updateState({\n isCompleted: false\n } as WmLottieState);\n }\n \n }\n\n private onReady() {\n this.invokeEventCallback('onReady', [null, this.proxy]);\n if (this.state.props.autoplay) {\n this.invokeEventCallback('onPlay', [null, this.proxy]);\n }\n }\n\n private loadAnimationData() {\n if (this.state.animationData || ! this.loadAsset) {\n return;\n }\n if (Platform.OS == 'web') {\n const url = this.loadAsset(this.state.props.source) as string;\n axios.get(url).then(({data}) => {\n this.updateState({\n animationData: data\n } as WmLottieState, () => this.onReady());\n });\n } else {\n this.updateState({\n animationData: this.loadAsset(this.state.props.source)\n } as WmLottieState, () => this.onReady());\n }\n }\n\n onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch(name) {\n case 'src':\n this.loadAnimationData();\n break;\n case 'loop':\n if (this.initialized && \n !this.state.isCompleted && \n ($new || this.state.props.autoplay)) {\n setTimeout(() => this.reset(), 200);\n }\n break;\n }\n }\n\n componentDidMount(): void {\n super.componentDidMount();\n this.loadAnimationData();\n }\n\n private renderWebLottie(props: WmLottieProps) {\n const Lottie = require('react-lottie-player');\n return (<Lottie \n animationData={this.state.animationData}\n ref= {this.lottie}\n loop={props.loop}\n play={props.autoplay}\n speed={props.speed}\n style={this.styles.lottie}\n onComplete={() => {\n this.updateState({\n isCompleted: true\n } as WmLottieState);\n this.invokeEventCallback('onComplete', [null, this.proxy]);\n }}/>);\n }\n\n private renderNativeLottie(props: WmLottieProps) {\n return (\n <LottieView\n source={this.state.animationData}\n ref= {this.lottie}\n autoPlay={props.autoplay}\n speed={props.speed}\n loop={props.loop}\n style={this.styles.lottie} \n onAnimationFinish={() => {\n this.updateState({\n isCompleted: true\n } as WmLottieState);\n this.invokeEventCallback('onComplete', [null, this.proxy]);\n }}\n />\n );\n }\n\n renderWidget(props: WmLottieProps) {\n return (\n <View style={this.styles.root}>\n {this._background}\n {this.state.animationData ? \n (Platform.OS == 'web' ? this.renderWebLottie(props) : this.renderNativeLottie(props)) \n : null \n }\n </View>); \n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,IAAI,QAAQ,cAAc;AAC7C,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAE/D,OAAO,MAAMC,aAAa,SAASH,kBAAkB,CAAgB;EAAA;IAAA;IAAA;IAAA,qCAErD,KAAK;EAAA;AACrB;AAEA,eAAe,MAAMI,QAAQ,SAASL,aAAa,CAA+C;EAIhGM,WAAW,CAACC,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,aAAa,EAAE,EAAE,IAAIE,aAAa,EAAE,CAAC;IAAC,6CAHvDT,KAAK,CAACa,SAAS,EAAc;EAI9C;EAEAC,IAAI,GAAG;IACL,IAAI,IAAI,CAACC,MAAM,CAACC,OAAO,EAAE;MACvB,IAAI,IAAI,CAACC,KAAK,CAACC,WAAW,EAAE;QAC1B,IAAI,CAACC,KAAK,EAAE;MACd,CAAC,MAAM;QACL,IAAI,CAACJ,MAAM,CAACC,OAAO,CAACF,IAAI,EAAE;QAC1B,IAAI,C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W,aAAa,GACtB1B,QAAQ,CAAC4B,EAAE,IAAI,KAAK,GAAI,IAAI,CAACa,eAAe,CAAC/B,KAAK,CAAC,GAAG,IAAI,CAACqC,kBAAkB,CAACrC,KAAK,CAAC,GACnF,IAAI,CAEH;EACX;AACF"}
@@ -0,0 +1,14 @@
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
+ import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';
5
+ export default class WmLottieProps extends BaseProps {
6
+ constructor() {
7
+ super(...arguments);
8
+ _defineProperty(this, "speed", 1);
9
+ _defineProperty(this, "autoplay", false);
10
+ _defineProperty(this, "loop", false);
11
+ _defineProperty(this, "source", '');
12
+ }
13
+ }
14
+ //# sourceMappingURL=lottie.props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["BaseProps","WmLottieProps"],"sources":["lottie.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmLottieProps extends BaseProps {\n speed = 1;\n autoplay = false;\n loop = false;\n source: string = '';\n}"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,aAAa,SAASD,SAAS,CAAC;EAAA;IAAA;IAAA,+BAC1C,CAAC;IAAA,kCACC,KAAK;IAAA,8BACT,KAAK;IAAA,gCACK,EAAE;EAAA;AACrB"}
@@ -0,0 +1,11 @@
1
+ import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';
2
+ import { defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';
3
+ export const DEFAULT_CLASS = 'app-lottie';
4
+ BASE_THEME.registerStyle((themeVariables, addStyle) => {
5
+ const defaultStyles = defineStyles({
6
+ root: {},
7
+ text: {}
8
+ });
9
+ addStyle(DEFAULT_CLASS, '', defaultStyles);
10
+ });
11
+ //# sourceMappingURL=lottie.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","text"],"sources":["lottie.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport type WmLottieStyles = BaseStyles & {};\n\nexport const DEFAULT_CLASS = 'app-lottie';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles = defineStyles<WmLottieStyles>({\n root: {},\n text: {}\n });\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAIxF,OAAO,MAAMC,aAAa,GAAG,YAAY;AACzCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAAa,GAAGL,YAAY,CAAiB;IAC/CM,IAAI,EAAE,CAAC,CAAC;IACRC,IAAI,EAAE,CAAC;EACX,CAAC,CAAC;EACFH,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC9C,CAAC,CAAC"}
@@ -54,7 +54,7 @@ export default class WmMessage extends BaseComponent {
54
54
  return /*#__PURE__*/React.createElement(Animatedview, {
55
55
  entryanimation: props.animation,
56
56
  style: styles.root
57
- }, /*#__PURE__*/React.createElement(WmIcon, {
57
+ }, this._background, /*#__PURE__*/React.createElement(WmIcon, {
58
58
  iconclass: props.type && MESSAGE_ICONS[props.type],
59
59
  styles: styles.icon
60
60
  }), /*#__PURE__*/React.createElement(View, {
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Text","BaseComponent","BaseComponentState","WmMessageProps","DEFAULT_CLASS","WmIcon","WmButton","Animatedview","WmMessageState","MESSAGE_ICONS","DEFAULT_TITLE","WmMessage","constructor","props","updateState","show","invokeEventCallback","showMessage","hideMessage","renderWidget","styles","theme","mergeStyle","getStyle","type","variant","animation","root","icon","message","title","text","caption","hideclose","closeBtn","close"],"sources":["message.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmMessageProps from './message.props';\nimport { DEFAULT_CLASS, WmMessageStyles } from './message.styles';\nimport WmIcon from '../icon/icon.component';\nimport WmButton from '../button/button.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\n\nexport class WmMessageState extends BaseComponentState<WmMessageProps> {}\n\nconst MESSAGE_ICONS = {\n 'success': 'wm-sl-l sl-check',\n 'warning': 'wm-sl-l sl-alarm-bell',\n 'error': 'fa fa-times-circle',\n 'info': 'wi wi-info',\n 'loading': 'fa fa-spinner fa-spin'\n};\n\nconst DEFAULT_TITLE = {\n 'success': 'Success',\n 'warning': 'Warning',\n 'error': 'Error',\n 'info': 'Info',\n 'loading': 'Processing'\n} as any;\n\nexport default class WmMessage extends BaseComponent<WmMessageProps, WmMessageState, WmMessageStyles> {\n\n constructor(props: WmMessageProps) {\n super(props, DEFAULT_CLASS, new WmMessageProps());\n }\n\n showMessage() {\n this.updateState({\n props: {\n show: true\n }\n } as WmMessageState);\n }\n\n hideMessage() {\n this.updateState({\n props: {\n show: false\n }\n } as WmMessageState);\n }\n\n close = () => {\n this.updateState({props: {\n show : false\n }}, () => this.invokeEventCallback('onClose', [null, this]));\n }\n\n renderWidget(props: WmMessageProps) {\n const styles = this.theme.mergeStyle(this.theme.getStyle(`${props.type}-${props.variant}-message`), this.styles);\n return (<Animatedview entryanimation={props.animation} style={styles.root}>\n <WmIcon\n iconclass={props.type && MESSAGE_ICONS[props.type]}\n styles={styles.icon}></WmIcon>\n <View style={styles.message}>\n <Text style={styles.title}>{props.title || DEFAULT_TITLE[props.type || '']}</Text>\n <Text style={styles.text}>{props.caption}</Text>\n </View>\n {props.hideclose ? null : (\n <WmButton\n iconclass=\"wi wi-close\"\n styles={styles.closeBtn}\n onTap={this.close}></WmButton>\n )}\n </Animatedview>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,cAAc,MAAM,iBAAiB;AAC5C,SAASC,aAAa,QAAyB,kBAAkB;AACjE,OAAOC,MAAM,MAAM,wBAAwB;AAC3C,OAAOC,QAAQ,MAAM,4BAA4B;AACjD,SAASC,YAAY,QAAQ,mEAAmE;AAEhG,OAAO,MAAMC,cAAc,SAASN,kBAAkB,CAAiB;AAEvE,MAAMO,aAAa,GAAG;EACpB,SAAS,EAAE,kBAAkB;EAC7B,SAAS,EAAE,uBAAuB;EAClC,OAAO,EAAE,oBAAoB;EAC7B,MAAM,EAAE,YAAY;EACpB,SAAS,EAAE;AACb,CAAC;AAED,MAAMC,aAAa,GAAG;EACpB,SAAS,EAAE,SAAS;EACpB,SAAS,EAAE,SAAS;EACpB,OAAO,EAAE,OAAO;EAChB,MAAM,EAAE,MAAM;EACd,SAAS,EAAE;AACb,CAAQ;AAER,eAAe,MAAMC,SAAS,SAASV,aAAa,CAAkD;EAEpGW,WAAW,CAACC,KAAqB,EAAE;IACjC,KAAK,CAACA,KAAK,EAAET,aAAa,EAAE,IAAID,cAAc,EAAE,CAAC;IAAC,+BAmB5C,MAAM;MACZ,IAAI,CAACW,WAAW,CAAC;QAACD,KAAK,EAAE;UACvBE,IAAI,EAAG;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EAAEb,MAAM,CAACc,QAAS;MACxB,KAAK,EAAE,IAAI,CAACC;IAAM,EACrB,CACY;EACjB;AACF"}
1
+ {"version":3,"names":["React","View","Text","BaseComponent","BaseComponentState","WmMessageProps","DEFAULT_CLASS","WmIcon","WmButton","Animatedview","WmMessageState","MESSAGE_ICONS","DEFAULT_TITLE","WmMessage","constructor","props","updateState","show","invokeEventCallback","showMessage","hideMessage","renderWidget","styles","theme","mergeStyle","getStyle","type","variant","animation","root","_background","icon","message","title","text","caption","hideclose","closeBtn","close"],"sources":["message.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmMessageProps from './message.props';\nimport { DEFAULT_CLASS, WmMessageStyles } from './message.styles';\nimport WmIcon from '../icon/icon.component';\nimport WmButton from '../button/button.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\n\nexport class WmMessageState extends BaseComponentState<WmMessageProps> {}\n\nconst MESSAGE_ICONS = {\n 'success': 'wm-sl-l sl-check',\n 'warning': 'wm-sl-l sl-alarm-bell',\n 'error': 'fa fa-times-circle',\n 'info': 'wi wi-info',\n 'loading': 'fa fa-spinner fa-spin'\n};\n\nconst DEFAULT_TITLE = {\n 'success': 'Success',\n 'warning': 'Warning',\n 'error': 'Error',\n 'info': 'Info',\n 'loading': 'Processing'\n} as any;\n\nexport default class WmMessage extends BaseComponent<WmMessageProps, WmMessageState, WmMessageStyles> {\n\n constructor(props: WmMessageProps) {\n super(props, DEFAULT_CLASS, new WmMessageProps());\n }\n\n showMessage() {\n this.updateState({\n props: {\n show: true\n }\n } as WmMessageState);\n }\n\n hideMessage() {\n this.updateState({\n props: {\n show: false\n }\n } as WmMessageState);\n }\n\n close = () => {\n this.updateState({props: {\n show : false\n }}, () => this.invokeEventCallback('onClose', [null, this]));\n }\n\n renderWidget(props: WmMessageProps) {\n const styles = this.theme.mergeStyle(this.theme.getStyle(`${props.type}-${props.variant}-message`), this.styles);\n return (<Animatedview entryanimation={props.animation} style={styles.root}>\n {this._background}\n <WmIcon\n iconclass={props.type && MESSAGE_ICONS[props.type]}\n styles={styles.icon}></WmIcon>\n <View style={styles.message}>\n <Text style={styles.title}>{props.title || DEFAULT_TITLE[props.type || '']}</Text>\n <Text style={styles.text}>{props.caption}</Text>\n </View>\n {props.hideclose ? null : (\n <WmButton\n iconclass=\"wi wi-close\"\n styles={styles.closeBtn}\n onTap={this.close}></WmButton>\n )}\n </Animatedview>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,cAAc,MAAM,iBAAiB;AAC5C,SAASC,aAAa,QAAyB,kBAAkB;AACjE,OAAOC,MAAM,MAAM,wBAAwB;AAC3C,OAAOC,QAAQ,MAAM,4BAA4B;AACjD,SAASC,YAAY,QAAQ,mEAAmE;AAEhG,OAAO,MAAMC,cAAc,SAASN,kBAAkB,CAAiB;AAEvE,MAAMO,aAAa,GAAG;EACpB,SAAS,EAAE,kBAAkB;EAC7B,SAAS,EAAE,uBAAuB;EAClC,OAAO,EAAE,oBAAoB;EAC7B,MAAM,EAAE,YAAY;EACpB,SAAS,EAAE;AACb,CAAC;AAED,MAAMC,aAAa,GAAG;EACpB,SAAS,EAAE,SAAS;EACpB,SAAS,EAAE,SAAS;EACpB,OAAO,EAAE,OAAO;EAChB,MAAM,EAAE,MAAM;EACd,SAAS,EAAE;AACb,CAAQ;AAER,eAAe,MAAMC,SAAS,SAASV,aAAa,CAAkD;EAEpGW,WAAW,CAACC,KAAqB,EAAE;IACjC,KAAK,CAACA,KAAK,EAAET,aAAa,EAAE,IAAID,cAAc,EAAE,CAAC;IAAC,+BAmB5C,MAAM;MACZ,IAAI,CAACW,WAAW,CAAC;QAACD,KAAK,EAAE;UAC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AQ;MACP,SAAS,EAAC,aAAa;MACvB,MAAM,EAAEd,MAAM,CAACe,QAAS;MACxB,KAAK,EAAE,IAAI,CAACC;IAAM,EACrB,CACY;EACjB;AACF"}
@@ -25,6 +25,8 @@ export class WmPictureState extends BaseComponentState {
25
25
  export default class WmPicture extends BaseComponent {
26
26
  constructor(props) {
27
27
  super(props, DEFAULT_CLASS, new WmPictureProps());
28
+ _defineProperty(this, "_pictureSource", null);
29
+ _defineProperty(this, "_picturePlaceHolder", null);
28
30
  _defineProperty(this, "onViewLayoutChange", e => {
29
31
  let imageWidth = e.nativeEvent.layout.width;
30
32
  let imageHeight = e.nativeEvent.layout.height;
@@ -45,34 +47,41 @@ export default class WmPicture extends BaseComponent {
45
47
  });
46
48
  });
47
49
  }
50
+ loadImage(image) {
51
+ if (!image || !this.loadAsset) {
52
+ return null;
53
+ }
54
+ const imageSrc = this.loadAsset(image);
55
+ if (imageSrc && typeof imageSrc === 'object' && typeof imageSrc.default === 'function') {
56
+ return null;
57
+ }
58
+ if (isNumber(imageSrc)) {
59
+ const {
60
+ width,
61
+ height
62
+ } = Image.resolveAssetSource(imageSrc);
63
+ this.updateState({
64
+ naturalImageWidth: width,
65
+ naturalImageHeight: height
66
+ });
67
+ } else if (imageSrc !== null) {
68
+ const cancel = ImageSizeEstimator.getSize(imageSrc, (width, height) => {
69
+ this.updateState({
70
+ naturalImageWidth: width,
71
+ naturalImageHeight: height
72
+ });
73
+ this.cleanup.splice(this.cleanup.indexOf(cancel), 1);
74
+ });
75
+ this.cleanup.push(cancel);
76
+ }
77
+ return imageSrc;
78
+ }
48
79
  onPropertyChange(name, $new, $old) {
49
- let imageSrc;
50
80
  switch (name) {
51
81
  case 'picturesource':
82
+ this._pictureSource = null;
52
83
  case 'pictureplaceholder':
53
- imageSrc = this.state.props.picturesource || $new;
54
- if (imageSrc && typeof imageSrc === 'object' && typeof imageSrc.default === 'function') {
55
- return;
56
- }
57
- if (isNumber(imageSrc)) {
58
- const {
59
- width,
60
- height
61
- } = Image.resolveAssetSource(imageSrc);
62
- this.updateState({
63
- naturalImageWidth: width,
64
- naturalImageHeight: height
65
- });
66
- } else if (imageSrc !== null) {
67
- const cancel = ImageSizeEstimator.getSize(imageSrc, (width, height) => {
68
- this.updateState({
69
- naturalImageWidth: width,
70
- naturalImageHeight: height
71
- });
72
- this.cleanup.splice(this.cleanup.indexOf(cancel), 1);
73
- });
74
- this.cleanup.push(cancel);
75
- }
84
+ this._picturePlaceHolder = null;
76
85
  break;
77
86
  }
78
87
  }
@@ -144,7 +153,9 @@ export default class WmPicture extends BaseComponent {
144
153
  const imageWidth = this.state.imageWidth;
145
154
  const imageHeight = this.state.imageHeight;
146
155
  const shapeStyles = this.createShape(props.shape, imageWidth);
147
- const imgSrc = props.picturesource || props.pictureplaceholder;
156
+ this._pictureSource = this._pictureSource || this.loadImage(props.picturesource);
157
+ this._picturePlaceHolder = this._picturePlaceHolder || this.loadImage(props.pictureplaceholder);
158
+ const imgSrc = this._pictureSource || this._picturePlaceHolder;
148
159
  let elementToshow;
149
160
  if (imgSrc) {
150
161
  elementToshow = this.getElementToShow(props, imgSrc, shapeStyles);
@@ -154,7 +165,7 @@ export default class WmPicture extends BaseComponent {
154
165
  width: imageWidth,
155
166
  height: imageHeight
156
167
  }, this.styles.root, shapeStyles.root, shapeStyles.picture]
157
- }, /*#__PURE__*/React.createElement(View, {
168
+ }, this._background, /*#__PURE__*/React.createElement(View, {
158
169
  style: [{
159
170
  overflow: 'hidden',
160
171
  width: '100%',
@@ -1 +1 @@
1
- {"version":3,"names":["React","Image","View","SvgUri","isNumber","isString","Tappable","BaseComponent","BaseComponentState","ImageSizeEstimator","isWebPreviewMode","WmPictureProps","DEFAULT_CLASS","Animatedview","createSkeleton","WmPictureState","WmPicture","constructor","props","e","imageWidth","nativeEvent","layout","width","imageHeight","height","styles","root","includes","state","naturalImageHeight","naturalImageWidth","updateState","onPropertyChange","name","$new","$old","imageSrc","picturesource","default","resolveAssetSource","cancel","getSize","cleanup","splice","indexOf","push","createShape","shape","picture","borderRadius","theme","getStyle","getElementToShow","imgSrc","shapeStyles","elementToshow","source","imgStyle","resizemode","createElement","isSvg","startsWith","uri","renderSkeleton","skeletonWidth","skeletonwidth","skeletonHeight","skeletonheight","skeleton","renderWidget","pictureplaceholder","overflow","onViewLayoutChange","animation"],"sources":["picture.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Image, LayoutChangeEvent, View } from 'react-native';\nimport { SvgUri } from 'react-native-svg';\nimport { isNumber, isString } from 'lodash-es';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport ImageSizeEstimator from '@wavemaker/app-rn-runtime/core/imageSizeEstimator';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\n\nimport WmPictureProps from './picture.props';\nimport { DEFAULT_CLASS, WmPictureStyles } from './picture.styles';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport WmSkeleton, { createSkeleton } from '../skeleton/skeleton.component';\n\nexport class WmPictureState extends BaseComponentState<WmPictureProps> {\n naturalImageWidth: number = 0;\n naturalImageHeight: number = 0;\n imageWidth: number = 0;\n imageHeight: number = 0;\n}\n\nexport default class WmPicture extends BaseComponent<WmPictureProps, WmPictureState, WmPictureStyles> {\n\n constructor(props: WmPictureProps) {\n super(props, DEFAULT_CLASS, new WmPictureProps());\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n let imageSrc;\n switch(name) {\n case 'picturesource':\n case 'pictureplaceholder':\n imageSrc = this.state.props.picturesource || $new;\n if (imageSrc && typeof imageSrc === 'object' && typeof imageSrc.default === 'function') {\n return;\n }\n if (isNumber(imageSrc)) {\n const {width, height} = Image.resolveAssetSource(imageSrc);\n this.updateState({\n naturalImageWidth: width,\n naturalImageHeight: height\n } as WmPictureState);\n } else if (imageSrc !== null) {\n const cancel = ImageSizeEstimator.getSize(imageSrc, (width: number, height: number) => {\n this.updateState({\n naturalImageWidth: width,\n naturalImageHeight: height\n } as WmPictureState);\n this.cleanup.splice(this.cleanup.indexOf(cancel), 1);\n });\n this.cleanup.push(cancel);\n }\n break;\n }\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let imageWidth = e.nativeEvent.layout.width;\n let imageHeight = e.nativeEvent.layout.height;\n if (!imageWidth && !imageHeight) {\n return;\n }\n if (!this.styles.root.height\n || (typeof this.styles.root.height === 'string'\n && !this.styles.root.height.includes('%'))) {\n imageHeight = 0;\n }\n if (imageWidth && !imageHeight) {\n imageHeight = imageWidth * this.state.naturalImageHeight / this.state.naturalImageWidth;\n } else if (imageHeight && !imageWidth) {\n imageWidth = imageHeight * this.state.naturalImageWidth / this.state.naturalImageHeight;\n }\n this.updateState({\n imageWidth: imageWidth,\n imageHeight: imageHeight\n } as WmPictureState);\n };\n\n createShape(shape: string | undefined, imageWidth?: number | string): WmPictureStyles {\n if (shape) {\n switch(shape) {\n case 'circle':\n return {\n picture: {\n borderRadius: isNumber(imageWidth) ? imageWidth / 2 : 4\n }\n } as WmPictureStyles;\n case 'rounded' :\n return (this.theme.getStyle('rounded-image') as WmPictureStyles);\n case 'thumbnail' :\n return (this.theme.getStyle('thumbnail-image') as WmPictureStyles);\n }\n }\n return {} as WmPictureStyles;\n }\n\n getElementToShow(props: WmPictureProps, imgSrc: any, shapeStyles: WmPictureStyles) {\n let elementToshow, source;\n if (imgSrc && typeof imgSrc === 'object' && typeof imgSrc?.default === 'function') {\n let imgStyle : any = {};\n if (props.resizemode === 'contain') {\n imgStyle['width'] = '100%';\n imgStyle['height'] = '100%';\n }\n elementToshow = React.createElement(imgSrc?.default, imgStyle);\n } else if (!isWebPreviewMode() && props.isSvg) {\n // svg from uri\n elementToshow = <SvgUri width={this.styles.root.width} height={this.styles.root.height} uri={imgSrc}/>;\n } else if (isString(imgSrc) && (imgSrc.startsWith('http') || imgSrc.startsWith('file:'))) {\n source = {\n uri: imgSrc\n };\n } else {\n source = imgSrc;\n }\n if (this.state.naturalImageWidth) {\n elementToshow = <Image style={[this.styles.picture, shapeStyles.picture]} resizeMode={props.resizemode} source={source}/>;\n }\n return elementToshow;\n }\n \n public renderSkeleton(props: WmPictureProps){\n const imageWidth = this.state.imageWidth;\n const imageHeight = this.state.imageHeight;\n const shapeStyles = this.createShape(this.props.shape, imageWidth);\n const skeletonWidth = this.props.skeletonwidth || this.styles.root?.width || shapeStyles.root?.width || shapeStyles.picture?.width || imageWidth; \n const skeletonHeight = this.props.skeletonheight || this.styles.root?.height || shapeStyles.root?.height || shapeStyles.picture?.height || imageHeight;\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n borderRadius: this.props.shape == 'circle' && this.styles.root?.width ? 25 : shapeStyles.picture?.borderRadius || shapeStyles.root?.borderRadius || this.styles.root?.borderRadius || 4,\n width: skeletonWidth,\n height: skeletonHeight\n });\n }\n\n renderWidget(props: WmPictureProps) {\n const imageWidth = this.state.imageWidth;\n const imageHeight = this.state.imageHeight;\n const shapeStyles = this.createShape(props.shape, imageWidth);\n const imgSrc: any = props.picturesource || props.pictureplaceholder;\n let elementToshow;\n if (imgSrc) {\n elementToshow = this.getElementToShow(props, imgSrc, shapeStyles);\n }\n return imgSrc && (this.state.naturalImageWidth || props.isSvg) ? (\n <View style={[{\n width: imageWidth,\n height: imageHeight\n }, this.styles.root, shapeStyles.root, shapeStyles.picture]}>\n <View style={[{overflow: 'hidden', width: '100%',\n height: '100%'}]} onLayout={this.onViewLayoutChange}>\n <Tappable target={this} styles={{width: imageWidth ? null : '100%', height: imageHeight ? null : '100%'}}>\n <Animatedview entryanimation={props.animation} style={[{\n height: imageHeight,\n width: imageWidth,\n borderRadius: shapeStyles.picture?.borderRadius\n }]}>\n {this.state.imageWidth ? elementToshow : null}\n </Animatedview>\n </Tappable>\n </View>\n </View>\n ): null;\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,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nE;IACA,OAAOD,MAAM,KAAK,IAAI,CAACzB,KAAK,CAACE,iBAAiB,IAAIb,KAAK,CAAC2C,KAAK,CAAC,gBAC5D,oBAAC,IAAI;MAAC,KAAK,EAAE,CAAC;QACZtC,KAAK,EAAEH,UAAU;QACjBK,MAAM,EAAED;MACV,CAAC,EAAE,IAAI,CAACE,MAAM,CAACC,IAAI,EAAE4B,WAAW,CAAC5B,IAAI,EAAE4B,WAAW,CAACN,OAAO;IAAE,gBAC5D,oBAAC,IAAI;MAAC,KAAK,EAAE,CAAC;QAACuB,QAAQ,EAAE,QAAQ;QAAEjD,KAAK,EAAE,MAAM;QAC9CE,MAAM,EAAE;MAAM,CAAC,CAAE;MAAC,QAAQ,EAAE,IAAI,CAACgD;IAAmB,gBACpD,oBAAC,QAAQ;MAAC,MAAM,EAAE,IAAK;MAAC,MAAM,EAAE;QAAClD,KAAK,EAAEH,UAAU,GAAG,IAAI,GAAG,MAAM;QAAEK,MAAM,EAAED,WAAW,GAAG,IAAI,GAAG;MAAM;IAAE,gBACvG,oBAAC,YAAY;MAAC,cAAc,EAAEN,KAAK,CAACwD,SAAU;MAAC,KAAK,EAAE,CAAC;QACjDjD,MAAM,EAAED,WAAW;QACnBD,KAAK,EAAEH,UAAU;QACjB8B,YAAY,2BAAEK,WAAW,CAACN,OAAO,0DAAnB,sBAAqBC;MACrC,CAAC;IAAE,GACF,IAAI,CAACrB,KAAK,CAACT,UAAU,GAAGoC,aAAa,GAAG,IAAI,CAChC,CACN,CACN,CACF,GACN,IAAI;EACT;AACF"}
1
+ {"version":3,"names":["React","Image","View","SvgUri","isNumber","isString","Tappable","BaseComponent","BaseComponentState","ImageSizeEstimator","isWebPreviewMode","WmPictureProps","DEFAULT_CLASS","Animatedview","createSkeleton","WmPictureState","WmPicture","constructor","props","e","imageWidth","nativeEvent","layout","width","imageHeight","height","styles","root","includes","state","naturalImageHeight","naturalImageWidth","updateState","loadImage","image","loadAsset","imageSrc","default","resolveAssetSource","cancel","getSize","cleanup","splice","indexOf","push","onPropertyChange","name","$new","$old","_pictureSource","_picturePlaceHolder","createShape","shape","picture","borderRadius","theme","getStyle","getElementToShow","imgSrc","shapeStyles","elementToshow","source","imgStyle","resizemode","createElement","isSvg","startsWith","uri","renderSkeleton","skeletonWidth","skeletonwidth","skeletonHeight","skeletonheight","skeleton","renderWidget","picturesource","pictureplaceholder","_background","overflow","onViewLayoutChange","animation"],"sources":["picture.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Image, LayoutChangeEvent, View } from 'react-native';\nimport { SvgUri } from 'react-native-svg';\nimport { isNumber, isString } from 'lodash-es';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport ImageSizeEstimator from '@wavemaker/app-rn-runtime/core/imageSizeEstimator';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\n\nimport WmPictureProps from './picture.props';\nimport { DEFAULT_CLASS, WmPictureStyles } from './picture.styles';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport WmSkeleton, { createSkeleton } from '../skeleton/skeleton.component';\n\nexport class WmPictureState extends BaseComponentState<WmPictureProps> {\n naturalImageWidth: number = 0;\n naturalImageHeight: number = 0;\n imageWidth: number = 0;\n imageHeight: number = 0;\n}\n\nexport default class WmPicture extends BaseComponent<WmPictureProps, WmPictureState, WmPictureStyles> {\n\n private _pictureSource = null as any;\n private _picturePlaceHolder = null as any;\n\n constructor(props: WmPictureProps) {\n super(props, DEFAULT_CLASS, new WmPictureProps());\n }\n\n loadImage(image: string | undefined) {\n if (!image || !this.loadAsset) {\n return null;\n }\n const imageSrc = this.loadAsset(image) as any;\n if (imageSrc && typeof imageSrc === 'object' && typeof imageSrc.default === 'function') {\n return null;\n }\n if (isNumber(imageSrc)) {\n const {width, height} = Image.resolveAssetSource(imageSrc);\n this.updateState({\n naturalImageWidth: width,\n naturalImageHeight: height\n } as WmPictureState);\n } else if (imageSrc !== null) {\n const cancel = ImageSizeEstimator.getSize(imageSrc, (width: number, height: number) => {\n this.updateState({\n naturalImageWidth: width,\n naturalImageHeight: height\n } as WmPictureState);\n this.cleanup.splice(this.cleanup.indexOf(cancel), 1);\n });\n this.cleanup.push(cancel);\n }\n return imageSrc;\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch(name) {\n case 'picturesource':\n this._pictureSource = null;\n case 'pictureplaceholder':\n this._picturePlaceHolder = null;\n break;\n }\n }\n\n onViewLayoutChange = (e: LayoutChangeEvent) => {\n let imageWidth = e.nativeEvent.layout.width;\n let imageHeight = e.nativeEvent.layout.height;\n if (!imageWidth && !imageHeight) {\n return;\n }\n if (!this.styles.root.height\n || (typeof this.styles.root.height === 'string'\n && !this.styles.root.height.includes('%'))) {\n imageHeight = 0;\n }\n if (imageWidth && !imageHeight) {\n imageHeight = imageWidth * this.state.naturalImageHeight / this.state.naturalImageWidth;\n } else if (imageHeight && !imageWidth) {\n imageWidth = imageHeight * this.state.naturalImageWidth / this.state.naturalImageHeight;\n }\n this.updateState({\n imageWidth: imageWidth,\n imageHeight: imageHeight\n } as WmPictureState);\n };\n\n createShape(shape: string | undefined, imageWidth?: number | string): WmPictureStyles {\n if (shape) {\n switch(shape) {\n case 'circle':\n return {\n picture: {\n borderRadius: isNumber(imageWidth) ? imageWidth / 2 : 4\n }\n } as WmPictureStyles;\n case 'rounded' :\n return (this.theme.getStyle('rounded-image') as WmPictureStyles);\n case 'thumbnail' :\n return (this.theme.getStyle('thumbnail-image') as WmPictureStyles);\n }\n }\n return {} as WmPictureStyles;\n }\n\n getElementToShow(props: WmPictureProps, imgSrc: any, shapeStyles: WmPictureStyles) {\n let elementToshow, source;\n if (imgSrc && typeof imgSrc === 'object' && typeof imgSrc?.default === 'function') {\n let imgStyle : any = {};\n if (props.resizemode === 'contain') {\n imgStyle['width'] = '100%';\n imgStyle['height'] = '100%';\n }\n elementToshow = React.createElement(imgSrc?.default, imgStyle);\n } else if (!isWebPreviewMode() && props.isSvg) {\n // svg from uri\n elementToshow = <SvgUri width={this.styles.root.width} height={this.styles.root.height} uri={imgSrc}/>;\n } else if (isString(imgSrc) && (imgSrc.startsWith('http') || imgSrc.startsWith('file:'))) {\n source = {\n uri: imgSrc\n };\n } else {\n source = imgSrc;\n }\n if (this.state.naturalImageWidth) {\n elementToshow = <Image style={[this.styles.picture, shapeStyles.picture]} resizeMode={props.resizemode} source={source}/>;\n }\n return elementToshow;\n }\n \n public renderSkeleton(props: WmPictureProps){\n const imageWidth = this.state.imageWidth;\n const imageHeight = this.state.imageHeight;\n const shapeStyles = this.createShape(this.props.shape, imageWidth);\n const skeletonWidth = this.props.skeletonwidth || this.styles.root?.width || shapeStyles.root?.width || shapeStyles.picture?.width || imageWidth; \n const skeletonHeight = this.props.skeletonheight || this.styles.root?.height || shapeStyles.root?.height || shapeStyles.picture?.height || imageHeight;\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n borderRadius: this.props.shape == 'circle' && this.styles.root?.width ? 25 : shapeStyles.picture?.borderRadius || shapeStyles.root?.borderRadius || this.styles.root?.borderRadius || 4,\n width: skeletonWidth,\n height: skeletonHeight\n });\n }\n\n renderWidget(props: WmPictureProps) {\n const imageWidth = this.state.imageWidth;\n const imageHeight = this.state.imageHeight;\n const shapeStyles = this.createShape(props.shape, imageWidth);\n this._pictureSource = this._pictureSource || this.loadImage(props.picturesource);\n this._picturePlaceHolder = this._picturePlaceHolder || this.loadImage(props.pictureplaceholder);\n const imgSrc: any = this._pictureSource || this._picturePlaceHolder;\n let elementToshow;\n if (imgSrc) {\n elementToshow = this.getElementToShow(props, imgSrc, shapeStyles);\n }\n return imgSrc && (this.state.naturalImageWidth || props.isSvg) ? (\n <View style={[{\n width: imageWidth,\n height: imageHeight\n }, this.styles.root, shapeStyles.root, shapeStyles.picture]}>\n {this._background}\n <View style={[{overflow: 'hidden', width: '100%',\n height: '100%'}]} onLayout={this.onViewLayoutChange}>\n <Tappable target={this} styles={{width: imageWidth ? null : '100%', height: imageHeight ? null : '100%'}}>\n <Animatedview entryanimation={props.animation} style={[{\n height: imageHeight,\n width: imageWidth,\n borderRadius: shapeStyles.picture?.borderRadius\n }]}>\n {this.state.imageWidth ? elementToshow : null}\n </Animatedview>\n </Tappable>\n </View>\n </View>\n ): null;\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,EAAqBC,IAAI,QAAQ,cAAc;AAC7D,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,QAAQ,EAAEC,QAAQ,QAAQ,WAAW;AAC9C,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,kBAAkB,MAAM,mDAAmD;AAClF,SAASC,gBAAgB,QAAQ,sCAAsC;AAEvE,OAAOC,cAAc,MAAM,iBAAiB;AAC5C,SAASC,aAAa,QAAyB,kBAAkB;AACjE,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAAqBC,cAAc,QAAQ,gCAAgC;AAE3E,OAAO,MAAMC,cAAc,SAASP,kBAAkB,CAAiB;EAAA;IAAA;IAAA,2CACzC,CAAC;IAAA,4CACA,CAAC;IAAA,oCACT,CAAC;IAAA,qCACA,CAAC;EAAA;AACzB;AAEA,eAAe,MAAMQ,SAAS,SAAST,aAAa,CAAkD;EAKpGU,WAAW,CAACC,KAAqB,EAAE;IACjC,KAAK,CAACA,KAAK,EAAEN,aAAa,EAAE,IAAID,cAAc,EAAE,CAAC;IAAC,wCAJ3B,IAAI;IAAA,6CACC,IAAI;IAAA,4CA2CZQ,CAAoB,IAAK;MAC7C,IAAIC,UAAU,GAAGD,CAAC,CAACE,WAAW,CAACC,MAAM,CAACC,KAAK;MAC3C,IAAIC,WAAW,GAAGL,CAAC,CAACE,WAAW,CAACC,MAAM,CAACG,MAAM;MAC7C,IAAI,CAACL,UAAU,IAAI,CAACI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gBACpD,oBAAC,QAAQ;MAAC,MAAM,EAAE,IAAK;MAAC,MAAM,EAAE;QAACxD,KAAK,EAAEH,UAAU,GAAG,IAAI,GAAG,MAAM;QAAEK,MAAM,EAAED,WAAW,GAAG,IAAI,GAAG;MAAM;IAAE,gBACvG,oBAAC,YAAY;MAAC,cAAc,EAAEN,KAAK,CAAC8D,SAAU;MAAC,KAAK,EAAE,CAAC;QACjDvD,MAAM,EAAED,WAAW;QACnBD,KAAK,EAAEH,UAAU;QACjBkC,YAAY,2BAAEK,WAAW,CAACN,OAAO,0DAAnB,sBAAqBC;MACrC,CAAC;IAAE,GACF,IAAI,CAACzB,KAAK,CAACT,UAAU,GAAGwC,aAAa,GAAG,IAAI,CAChC,CACN,CACN,CACF,GACN,IAAI;EACT;AACF"}
@@ -11,11 +11,12 @@ export default class WmProgressBar extends BaseComponent {
11
11
  super(props, DEFAULT_CLASS, new WmProgressBarProps());
12
12
  }
13
13
  renderWidget(props) {
14
- const value = (props.datavalue - props.minvalue) / (props.maxvalue - props.minvalue);
14
+ let value = (props.datavalue - props.minvalue) / (props.maxvalue - props.minvalue);
15
+ value = Math.round(isNaN(value) ? 0 : value);
15
16
  const styles = this.theme.mergeStyle(this.theme.getStyle(`app-${props.type}-progress-bar`), this.styles);
16
17
  return /*#__PURE__*/React.createElement(View, {
17
18
  style: styles.root
18
- }, /*#__PURE__*/React.createElement(Tappable, {
19
+ }, this._background, /*#__PURE__*/React.createElement(Tappable, {
19
20
  target: this,
20
21
  styles: {
21
22
  root: {
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","ProgressBar","Tappable","BaseComponent","BaseComponentState","WmProgressBarProps","DEFAULT_CLASS","WmProgressBarState","WmProgressBar","constructor","props","renderWidget","value","datavalue","minvalue","maxvalue","styles","theme","mergeStyle","getStyle","type","root","width","height","progressValue","color","progressBar"],"sources":["progress-bar.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { ProgressBar } from 'react-native-paper';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmProgressBarProps from './progress-bar.props';\nimport { DEFAULT_CLASS, WmProgressBarStyles } from './progress-bar.styles';\n\nexport class WmProgressBarState extends BaseComponentState<WmProgressBarProps> {}\n\nexport default class WmProgressBar extends BaseComponent<WmProgressBarProps, WmProgressBarState, WmProgressBarStyles> {\n\n constructor(props: WmProgressBarProps) {\n super(props, DEFAULT_CLASS, new WmProgressBarProps());\n }\n\n renderWidget(props: WmProgressBarProps) {\n const value = (props.datavalue - props.minvalue) / (props.maxvalue - props.minvalue);\n const styles = this.theme.mergeStyle(this.theme.getStyle(`app-${props.type}-progress-bar`), this.styles);\n return (\n <View style={styles.root}>\n <Tappable target={this} styles={{root:{width: '100%', height: '100%'}}}>\n <ProgressBar\n progress={value}\n color={styles.progressValue.color}\n style={[styles.progressBar, {height: styles.root.height || styles.progressBar.height}]}></ProgressBar>\n </Tappable>\n </View>); \n }\n\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,SAASC,aAAa,QAA6B,uBAAuB;AAE1E,OAAO,MAAMC,kBAAkB,SAASH,kBAAkB,CAAqB;AAE/E,eAAe,MAAMI,aAAa,SAASL,aAAa,CAA8D;EAEpHM,WAAW,CAACC,KAAyB,EAAE;IACrC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,kBAAkB,EAAE,CAAC;EACvD;EAEAM,YAAY,CAACD,KAAyB,EAAE;IACtC,MAAME,KAAK,GAAG,CAACF,KAAK,CAACG,SAAS,GAAGH,KAAK,CAACI,QAAQ,KAAKJ,KAAK,CAACK,QAAQ,GAAGL,KAAK,CAACI,QAAQ,CAAC;IACpF,MAAME,MAAM,GAAG,IAAI,CAACC,KAAK,CAACC,UAAU,CAAC,IAAI,CAACD,KAAK,CAACE,QAAQ,CAAE,OAAMT,KAAK,CAACU,IAAK,eAAc,CAAC,EAAE,IAAI,CAACJ,MAAM,CAAC;IACxG,oBACA,oBAAC,IAAI;MAAC,KAAK,EAAEA,MAAM,CAACK;IAAK,gBACvB,oBAAC,QAAQ;MAAC,MAAM,EAAE,IAAK;MAAC,MAAM,EAAE;QAACA,IAAI,EAAC;UAACC,KAAK,EAAE,MAAM;UAAEC,MAAM,EAAE;QAAM;MAAC;IAAE,gBACrE,oBAAC,WAAW;MACV,QAAQ,EAAEX,KAAM;MAChB,KAAK,EAAEI,MAAM,CAACQ,aAAa,CAACC,KAAM;MAClC,KAAK,EAAE,CAACT,MAAM,CAACU,WAAW,EAAE;QAACH,MAAM,EAAEP,MAAM,CAACK,IAAI,CAACE,MAAM,IAAIP,MAAM,CAACU,WAAW,CAACH;MAAM,CAAC;IAAE,EAAe,CAC/F,CACN;EACT;AAEF"}
1
+ {"version":3,"names":["React","View","ProgressBar","Tappable","BaseComponent","BaseComponentState","WmProgressBarProps","DEFAULT_CLASS","WmProgressBarState","WmProgressBar","constructor","props","renderWidget","value","datavalue","minvalue","maxvalue","Math","round","isNaN","styles","theme","mergeStyle","getStyle","type","root","_background","width","height","progressValue","color","progressBar"],"sources":["progress-bar.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { ProgressBar } from 'react-native-paper';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmProgressBarProps from './progress-bar.props';\nimport { DEFAULT_CLASS, WmProgressBarStyles } from './progress-bar.styles';\n\nexport class WmProgressBarState extends BaseComponentState<WmProgressBarProps> {}\n\nexport default class WmProgressBar extends BaseComponent<WmProgressBarProps, WmProgressBarState, WmProgressBarStyles> {\n\n constructor(props: WmProgressBarProps) {\n super(props, DEFAULT_CLASS, new WmProgressBarProps());\n }\n\n renderWidget(props: WmProgressBarProps) {\n let value = (props.datavalue - props.minvalue) / (props.maxvalue - props.minvalue);\n value = Math.round(isNaN(value) ? 0 : value);\n const styles = this.theme.mergeStyle(this.theme.getStyle(`app-${props.type}-progress-bar`), this.styles);\n return (\n <View style={styles.root}>\n {this._background}\n <Tappable target={this} styles={{root:{width: '100%', height: '100%'}}}>\n <ProgressBar\n progress={value}\n color={styles.progressValue.color}\n style={[styles.progressBar, {height: styles.root.height || styles.progressBar.height}]}></ProgressBar>\n </Tappable>\n </View>); \n }\n\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,SAASC,aAAa,QAA6B,uBAAuB;AAE1E,OAAO,MAAMC,kBAAkB,SAASH,kBAAkB,CAAqB;AAE/E,eAAe,MAAMI,aAAa,SAASL,aAAa,CAA8D;EAEpHM,WAAW,CAACC,KAAyB,EAAE;IACrC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,kBAAkB,EAAE,CAAC;EACvD;EAEAM,YAAY,CAACD,KAAyB,EAAE;IACtC,IAAIE,KAAK,GAAG,CAACF,KAAK,CAACG,SAAS,GAAGH,KAAK,CAACI,QAAQ,KAAKJ,KAAK,CAACK,QAAQ,GAAGL,KAAK,CAACI,QAAQ,CAAC;IAClFF,KAAK,GAAGI,IAAI,CAACC,KAAK,CAACC,KAAK,CAACN,KAAK,CAAC,GAAG,CAAC,GAAGA,KAAK,CAAC;IAC5C,MAAMO,MAAM,GAAG,IAAI,CAACC,KAAK,CAACC,UAAU,CAAC,IAAI,CAACD,KAAK,CAACE,QAAQ,CAAE,OAAMZ,KAAK,CAACa,IAAK,eAAc,CAAC,EAAE,IAAI,CAACJ,MAAM,CAAC;IACxG,oBACA,oBAAC,IAAI;MAAC,KAAK,EAAEA,MAAM,CAACK;IAAK,GACtB,IAAI,CAACC,WAAW,eACjB,oBAAC,QAAQ;MAAC,MAAM,EAAE,IAAK;MAAC,MAAM,EAAE;QAACD,IAAI,EAAC;UAACE,KAAK,EAAE,MAAM;UAAEC,MAAM,EAAE;QAAM;MAAC;IAAE,gBACrE,oBAAC,WAAW;MACV,QAAQ,EAAEf,KAAM;MAChB,KAAK,EAAEO,MAAM,CAACS,aAAa,CAACC,KAAM;MAClC,KAAK,EAAE,CAACV,MAAM,CAACW,WAAW,EAAE;QAACH,MAAM,EAAER,MAAM,CAACK,IAAI,CAACG,MAAM,IAAIR,MAAM,CAACW,WAAW,CAACH;MAAM,CAAC;IAAE,EAAe,CAC/F,CACN;EACT;AAEF"}
@@ -44,7 +44,7 @@ export default class WmProgressCircle extends BaseComponent {
44
44
  return /*#__PURE__*/React.createElement(View, {
45
45
  style: styles.root,
46
46
  onLayout: this.onLayout.bind(this)
47
- }, /*#__PURE__*/React.createElement(Tappable, {
47
+ }, this._background, /*#__PURE__*/React.createElement(Tappable, {
48
48
  target: this,
49
49
  styles: {
50
50
  root: {
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Text","isNumber","AnimatedCircularProgress","Tappable","BaseComponent","BaseComponentState","WmProgressCircleProps","DEFAULT_CLASS","WmProgressCircleState","WmProgressCircle","constructor","props","onLayout","e","width","nativeEvent","layout","height","radius","state","Math","min","updateState","renderWidget","value","datavalue","minvalue","maxvalue","styles","theme","mergeStyle","getStyle","type","showText","captionplacement","root","bind","progressValue","backgroundColor","buttStyle","progressCircle","fill","alignItems","text","title","subtitle","subTitle"],"sources":["progress-circle.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View, Text } from 'react-native';\nimport { isNumber } from 'lodash';\nimport { AnimatedCircularProgress } from 'react-native-circular-progress';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmProgressCircleProps from './progress-circle.props';\nimport { DEFAULT_CLASS, WmProgressCircleStyles } from './progress-circle.styles';\n\n\nexport class WmProgressCircleState extends BaseComponentState<WmProgressCircleProps> {\n radius = 10;\n}\n\nexport default class WmProgressCircle extends BaseComponent<WmProgressCircleProps, WmProgressCircleState, WmProgressCircleStyles> {\n\n constructor(props: WmProgressCircleProps) {\n super(props, DEFAULT_CLASS, new WmProgressCircleProps(), new WmProgressCircleState());\n }\n\n onLayout(e: LayoutChangeEvent) {\n const width = e.nativeEvent.layout.width;\n const height = e.nativeEvent.layout.height;\n let radius = this.state.radius;\n if (!width) {\n radius = height;\n } else if (!height) {\n radius = width;\n } else {\n radius = Math.min(width, height);\n }\n this.updateState({\n radius: radius\n } as WmProgressCircleState);\n }\n\n renderWidget(props: WmProgressCircleProps) {\n let value = 0;\n if (isNumber(props.datavalue) && isNumber(props.minvalue) && isNumber(props.maxvalue)) {\n value = (+props.datavalue - (+props.minvalue)) / (+props.maxvalue - (+props.minvalue)) * 100;\n }\n const styles = this.theme.mergeStyle(this.theme.getStyle(`app-${props.type}-progress-circle`), this.styles);\n const showText = props.captionplacement !== 'hidden';\n return (\n <View style={styles.root} onLayout={this.onLayout.bind(this)}>\n <Tappable target={this} styles={{root:{width: '100%', height: '100%'}}}>\n <AnimatedCircularProgress\n fill={value}\n width={styles.progressValue.height}\n backgroundWidth={styles.progressValue.height}\n rotation={0}\n tintColor={styles.progressValue.backgroundColor}\n lineCap={styles.progressValue.buttStyle || \"butt\"}\n backgroundColor={styles.progressCircle.backgroundColor}\n size={this.state.radius}>\n {(fill) => (<View style={{alignItems: 'center'}}>\n <Text style={styles.text}>{ showText ? props.title || value : '' }</Text>\n {showText && props.subtitle ? (<Text style={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AI,CAACnB,KAAK,CAACD;IAAO,GACpBuB,IAAI,iBAAM,oBAAC,IAAI;MAAC,KAAK,EAAE;QAACC,UAAU,EAAE;MAAQ;IAAE,gBAClC,oBAAC,IAAI;MAAC,KAAK,EAAEd,MAAM,CAACe;IAAK,GAAGV,QAAQ,GAAGtB,KAAK,CAACiC,KAAK,IAAIpB,KAAK,GAAG,EAAE,CAAS,EACxES,QAAQ,IAAItB,KAAK,CAACkC,QAAQ,gBAAI,oBAAC,IAAI;MAAC,KAAK,EAAEjB,MAAM,CAACkB;IAAS,GAAGnC,KAAK,CAACkC,QAAQ,CAAS,GAAI,IAAI,CACxF,CACG,CAClB,CACN;EACT;AACF"}
1
+ {"version":3,"names":["React","View","Text","isNumber","AnimatedCircularProgress","Tappable","BaseComponent","BaseComponentState","WmProgressCircleProps","DEFAULT_CLASS","WmProgressCircleState","WmProgressCircle","constructor","props","onLayout","e","width","nativeEvent","layout","height","radius","state","Math","min","updateState","renderWidget","value","datavalue","minvalue","maxvalue","styles","theme","mergeStyle","getStyle","type","showText","captionplacement","root","bind","_background","progressValue","backgroundColor","buttStyle","progressCircle","fill","alignItems","text","title","subtitle","subTitle"],"sources":["progress-circle.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, View, Text } from 'react-native';\nimport { isNumber } from 'lodash';\nimport { AnimatedCircularProgress } from 'react-native-circular-progress';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmProgressCircleProps from './progress-circle.props';\nimport { DEFAULT_CLASS, WmProgressCircleStyles } from './progress-circle.styles';\n\n\nexport class WmProgressCircleState extends BaseComponentState<WmProgressCircleProps> {\n radius = 10;\n}\n\nexport default class WmProgressCircle extends BaseComponent<WmProgressCircleProps, WmProgressCircleState, WmProgressCircleStyles> {\n\n constructor(props: WmProgressCircleProps) {\n super(props, DEFAULT_CLASS, new WmProgressCircleProps(), new WmProgressCircleState());\n }\n\n onLayout(e: LayoutChangeEvent) {\n const width = e.nativeEvent.layout.width;\n const height = e.nativeEvent.layout.height;\n let radius = this.state.radius;\n if (!width) {\n radius = height;\n } else if (!height) {\n radius = width;\n } else {\n radius = Math.min(width, height);\n }\n this.updateState({\n radius: radius\n } as WmProgressCircleState);\n }\n\n renderWidget(props: WmProgressCircleProps) {\n let value = 0;\n if (isNumber(props.datavalue) && isNumber(props.minvalue) && isNumber(props.maxvalue)) {\n value = (+props.datavalue - (+props.minvalue)) / (+props.maxvalue - (+props.minvalue)) * 100;\n }\n const styles = this.theme.mergeStyle(this.theme.getStyle(`app-${props.type}-progress-circle`), this.styles);\n const showText = props.captionplacement !== 'hidden';\n return (\n <View style={styles.root} onLayout={this.onLayout.bind(this)}>\n {this._background}\n <Tappable target={this} styles={{root:{width: '100%', height: '100%'}}}>\n <AnimatedCircularProgress\n fill={value}\n width={styles.progressValue.height}\n backgroundWidth={styles.progressValue.height}\n rotation={0}\n tintColor={styles.progressValue.backgroundColor}\n lineCap={styles.progressValue.buttStyle || \"butt\"}\n backgroundColor={styles.progressCircle.backgroundColor}\n size={this.state.radius}>\n {(fill) => (<View style={{alignItems: 'center'}}>\n <Text style={styles.text}>{ showText ? props.title || value : '' }</Text>\n {showText && props.subtitle ? (<Text style={styles.subTitle}>{ props.subtitle }</Text>) : null}\n </View>)} \n </AnimatedCircularProgress>\n </Tappable>\n </View>); \n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAC5D,SAASC,QAAQ,QAAQ,QAAQ;AACjC,SAASC,wBAAwB,QAAQ,gCAAgC;AACzE,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,qBAAqB,MAAM,yBAAyB;AAC3D,SAASC,aAAa,QAAgC,0BAA0B;AAGhF,OAAO,MAAMC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