@wavemaker/app-rn-runtime 12.0.0-next.45032 → 12.0.0-next.45501

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. app-rn-runtime/components/advanced/carousel/carousel.component.js +18 -3
  2. app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
  3. app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
  4. app-rn-runtime/components/basic/anchor/anchor.component.js +2 -2
  5. app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
  6. app-rn-runtime/components/basic/animatedview.component.js +6 -2
  7. app-rn-runtime/components/basic/animatedview.component.js.map +1 -1
  8. app-rn-runtime/components/basic/audio/audio.component.js.map +1 -1
  9. app-rn-runtime/components/basic/button/button.component.js +5 -4
  10. app-rn-runtime/components/basic/button/button.component.js.map +1 -1
  11. app-rn-runtime/components/basic/icon/icon.component.js +4 -4
  12. app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
  13. app-rn-runtime/components/basic/label/label.component.js.map +1 -1
  14. app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
  15. app-rn-runtime/components/basic/message/message.component.js.map +1 -1
  16. app-rn-runtime/components/basic/picture/picture.component.js +1 -2
  17. app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
  18. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +2 -2
  19. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
  20. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +5 -5
  21. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
  22. app-rn-runtime/components/basic/search/search.component.js.map +1 -1
  23. app-rn-runtime/components/basic/spinner/spinner.component.js +2 -3
  24. app-rn-runtime/components/basic/spinner/spinner.component.js.map +1 -1
  25. app-rn-runtime/components/basic/spinner/spinner.styles.js +3 -2
  26. app-rn-runtime/components/basic/spinner/spinner.styles.js.map +1 -1
  27. app-rn-runtime/components/basic/video/video.component.js.map +1 -1
  28. app-rn-runtime/components/basic/video/video.styles.js +4 -1
  29. app-rn-runtime/components/basic/video/video.styles.js.map +1 -1
  30. app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
  31. app-rn-runtime/components/chart/basechart.component.js +31 -2
  32. app-rn-runtime/components/chart/basechart.component.js.map +1 -1
  33. app-rn-runtime/components/chart/basechart.props.js +1 -0
  34. app-rn-runtime/components/chart/basechart.props.js.map +1 -1
  35. app-rn-runtime/components/chart/basechart.styles.js +4 -0
  36. app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
  37. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +15 -3
  38. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
  39. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +4 -1
  40. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  41. app-rn-runtime/components/chart/stack-chart/stack-chart.component.js +37 -11
  42. app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -1
  43. app-rn-runtime/components/container/accordion/accordion.component.js +3 -1
  44. app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
  45. app-rn-runtime/components/container/accordion/accordion.styles.js +1 -0
  46. app-rn-runtime/components/container/accordion/accordion.styles.js.map +1 -1
  47. app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js.map +1 -1
  48. app-rn-runtime/components/container/panel/panel.component.js +4 -2
  49. app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
  50. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +2 -3
  51. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
  52. app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
  53. app-rn-runtime/components/container/wizard/wizard.component.js +27 -11
  54. app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
  55. app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
  56. app-rn-runtime/components/data/list/list.component.js.map +1 -1
  57. app-rn-runtime/components/dialogs/dialog/dialog.component.js +5 -3
  58. app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
  59. app-rn-runtime/components/input/basedataset/basedataset.component.js.map +1 -1
  60. app-rn-runtime/components/input/baseinput/baseinput.component.js +11 -4
  61. app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
  62. app-rn-runtime/components/input/baseinput/baseinput.props.js +1 -0
  63. app-rn-runtime/components/input/baseinput/baseinput.props.js.map +1 -1
  64. app-rn-runtime/components/input/basenumber/basenumber.component.js +25 -12
  65. app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
  66. app-rn-runtime/components/input/basenumber/basenumber.props.js +2 -0
  67. app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
  68. app-rn-runtime/components/input/checkbox/checkbox.component.js +5 -6
  69. app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
  70. app-rn-runtime/components/input/checkboxset/checkboxset.component.js +3 -2
  71. app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
  72. app-rn-runtime/components/input/chips/chips.component.js +3 -2
  73. app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
  74. app-rn-runtime/components/input/currency/currency.component.js +16 -1
  75. app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
  76. app-rn-runtime/components/input/epoch/base-datetime.component.js +22 -5
  77. app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
  78. app-rn-runtime/components/input/epoch/wheel-date-picker.component.js +123 -12
  79. app-rn-runtime/components/input/epoch/wheel-date-picker.component.js.map +1 -1
  80. app-rn-runtime/components/input/epoch/wheelpicker/wheelpicker.component.js.map +1 -1
  81. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js +4 -0
  82. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js.map +1 -1
  83. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js +2 -0
  84. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js.map +1 -1
  85. app-rn-runtime/components/input/number/number.component.js +6 -3
  86. app-rn-runtime/components/input/number/number.component.js.map +1 -1
  87. app-rn-runtime/components/input/radioset/radioset.component.js +6 -6
  88. app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
  89. app-rn-runtime/components/input/select/select.component.js +23 -9
  90. app-rn-runtime/components/input/select/select.component.js.map +1 -1
  91. app-rn-runtime/components/input/switch/switch.component.js +2 -2
  92. app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
  93. app-rn-runtime/components/input/toggle/toggle.component.js +2 -4
  94. app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
  95. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +2 -2
  96. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
  97. app-rn-runtime/components/navigation/basenav/basenav.component.js.map +1 -1
  98. app-rn-runtime/components/navigation/navitem/navitem.component.js +2 -3
  99. app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
  100. app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
  101. app-rn-runtime/components/page/tabbar/curve.js.map +1 -1
  102. app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
  103. app-rn-runtime/core/base.component.js +2 -1
  104. app-rn-runtime/core/base.component.js.map +1 -1
  105. app-rn-runtime/core/components/textinput.component.js +4 -3
  106. app-rn-runtime/core/components/textinput.component.js.map +1 -1
  107. app-rn-runtime/core/formatters.js.map +1 -1
  108. app-rn-runtime/core/key.extractor.js.map +1 -1
  109. app-rn-runtime/core/props.provider.js +3 -0
  110. app-rn-runtime/core/props.provider.js.map +1 -1
  111. app-rn-runtime/core/storage.service.js.map +1 -1
  112. app-rn-runtime/core/tappable.component.js +26 -25
  113. app-rn-runtime/core/tappable.component.js.map +1 -1
  114. app-rn-runtime/core/ui-preferences.context.js +7 -0
  115. app-rn-runtime/core/ui-preferences.context.js.map +1 -0
  116. app-rn-runtime/core/utils.js +66 -4
  117. app-rn-runtime/core/utils.js.map +1 -1
  118. app-rn-runtime/package.json +28 -7
  119. app-rn-runtime/runtime/App.js +2 -1
  120. app-rn-runtime/runtime/App.js.map +1 -1
  121. app-rn-runtime/runtime/App.navigator.js.map +1 -1
  122. app-rn-runtime/runtime/base-fragment.component.js +15 -0
  123. app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
  124. app-rn-runtime/runtime/base-page.component.js.map +1 -1
  125. app-rn-runtime/runtime/base-prefab.component.js.map +1 -1
  126. app-rn-runtime/runtime/navigator/stack.navigator.js.map +1 -1
  127. app-rn-runtime/runtime/services/app-i18n.service.js +10 -0
  128. app-rn-runtime/runtime/services/app-i18n.service.js.map +1 -1
  129. app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
  130. app-rn-runtime/runtime/services/app-spinner.service.js +1 -1
  131. app-rn-runtime/runtime/services/app-spinner.service.js.map +1 -1
  132. app-rn-runtime/runtime/services/webprocess.service.js.map +1 -1
  133. app-rn-runtime/runtime/watcher.js.map +1 -1
  134. app-rn-runtime/styles/background.component.js +1 -0
  135. app-rn-runtime/styles/background.component.js.map +1 -1
  136. app-rn-runtime/styles/style-prop.validator.js.map +1 -1
  137. app-rn-runtime/styles/theme.js.map +1 -1
  138. app-rn-runtime/variables/base-variable.js.map +1 -1
  139. app-rn-runtime/variables/device/file/upload-file.operation.js.map +1 -1
  140. app-rn-runtime/variables/device-variable.js.map +1 -1
  141. app-rn-runtime/variables/service-variable.js.map +1 -1
@@ -1,3 +1,4 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
2
  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
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
4
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
@@ -109,6 +110,9 @@ export default class WmCarousel extends BaseComponent {
109
110
  return 'list_item_' + this.keyExtractor.getKey(item, true);
110
111
  }
111
112
  autoPlay() {
113
+ if (!this.initialized) {
114
+ return;
115
+ }
112
116
  const props = this.state.props;
113
117
  this.stopPlay && this.stopPlay();
114
118
  if (props.animation === 'auto' && props.animationinterval) {
@@ -124,6 +128,12 @@ export default class WmCarousel extends BaseComponent {
124
128
  }, 1000);
125
129
  }
126
130
  }
131
+ stopAnimation() {
132
+ this.stopPlay();
133
+ }
134
+ startAnimation() {
135
+ this.autoPlay();
136
+ }
127
137
  onPropertyChange(name, $new, $old) {
128
138
  super.onPropertyChange(name, $new, $old);
129
139
  switch (name) {
@@ -194,10 +204,11 @@ export default class WmCarousel extends BaseComponent {
194
204
  flexDirection: this.isRTL ? 'row-reverse' : 'row'
195
205
  }
196
206
  }, data.map((item, index) => {
197
- return index >= minIndex && index <= maxIndex ? /*#__PURE__*/React.createElement(View, {
198
- key: 'dots_' + this.generateItemKey(item, index, this.state.props),
207
+ return index >= minIndex && index <= maxIndex ? /*#__PURE__*/React.createElement(View, _extends({
208
+ key: 'dots_' + this.generateItemKey(item, index, this.state.props)
209
+ }, this.getTestPropsForAction('indicator' + index), {
199
210
  style: [this.styles.dotStyle]
200
- }) : null;
211
+ })) : null;
201
212
  }), /*#__PURE__*/React.createElement(Animated.View, {
202
213
  style: [this.styles.dotStyle, this.styles.activeDotStyle, {
203
214
  width: undefined,
@@ -220,6 +231,10 @@ export default class WmCarousel extends BaseComponent {
220
231
  }]
221
232
  }))));
222
233
  }
234
+ componentDidMount() {
235
+ super.componentDidMount();
236
+ this.autoPlay();
237
+ }
223
238
  renderWidget(props) {
224
239
  var _data, _this$styles$slide;
225
240
  const hasNavs = props.controls === 'both' || props.controls === 'navs';
@@ -1 +1 @@
1
- {"version":3,"names":["React","isArray","isUndefined","Animated","Easing","View","DefaultKeyExtractor","WmIcon","BaseComponent","BaseComponentState","SwipeAnimation","Tappable","WmCarouselProps","DEFAULT_CLASS","WmCarouselState","constructor","args","_defineProperty","WmCarousel","props","Value","bounds","e","_this$slidesLayout","_this$slidesLayout$ac","activeTabIndex","state","activeIndex","lower","slidesLayout","filter","l","i","reduce","s","width","center","upper","computePhase","value","_this$slidesLayout$ac2","w","Math","abs","onLower","onSlideChange","onUpper","noOfSlides","_this$animationView","animationView","setPosition","index","prevIndex","updateState","invokeEventCallback","animatePagination","item","type","renderSlide","children","data","dataset","length","_this$animationView2","_this$animationView3","goToUpper","_this$animationView4","goToLower","cleanup","push","stopPlay","addSlideLayout","nativeEvent","layout","forceUpdate","generateItemKey","itemkey","_showSkeleton","keyExtractor","getKey","autoPlay","animation","animationinterval","intervalId","setInterval","next","clearInterval","setTimeout","_this$animationView5","onPropertyChange","name","$new","$old","_this$keyExtractor","clear","min","_this$styles$dotStyle","_this$styles$dotStyle2","_this$styles$dotStyle3","margin","styles","dotStyle","marginLeft","marginRight","size","position","max","scale","options","useNativeDriver","duration","easing","out","linear","sequence","timing","dotScale","toValue","parallel","dotPosition","isRTL","start","renderPagination","maxNoOfDots","maxnoofdots","minIndex","maxIndex","createElement","style","dotsWrapperStyle","flexDirection","map","key","activeDotStyle","undefined","height","transform","translateX","right","left","renderWidget","_data","_this$styles$slide","hasNavs","controls","hasDots","slideScale","slideTranslateX","slide","_this$styles$slide2","_this$styles$slide3","find","o","root","_background","enableGestures","enablegestures","flex","direction","ref","r","handlers","animationHandlers","slideMinWidth","_this$animationView6","_this$animationView7","isActive","animationPhase","interpolate","inputRange","outputRange","onLayout","bind","firstSlide","lastSlide","activeSlide","onTap","_this$animationView8","rippleColor","renderItem","btnPanel","id","getTestId","iconclass","prevBtn","prev","accessibilitylabel","nextBtn"],"sources":["carousel.component.tsx"],"sourcesContent":["import React from 'react';\nimport { isArray, isUndefined } from 'lodash-es';\nimport { Animated, Easing, View, LayoutChangeEvent, LayoutRectangle } from 'react-native';\nimport { DefaultKeyExtractor } from '@wavemaker/app-rn-runtime/core/key.extractor';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport * as SwipeAnimation from '@wavemaker/app-rn-runtime/gestures/swipe.animation';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\n\nimport WmCarouselProps from './carousel.props';\nimport { DEFAULT_CLASS, WmCarouselStyles } from './carousel.styles';\n\nexport class WmCarouselState extends BaseComponentState<WmCarouselProps> {\n activeIndex = 1;\n}\n\nexport default class WmCarousel extends BaseComponent<WmCarouselProps, WmCarouselState, WmCarouselStyles> {\n\n noOfSlides: number = 0;\n private slidesLayout: LayoutRectangle[] = [];\n private keyExtractor = new DefaultKeyExtractor();\n stopPlay: Function = null as any;\n private dotScale = new Animated.Value(0);\n private dotPosition = new Animated.Value(0);\n private animationView: SwipeAnimation.View | null = null as any;\n private animationHandlers = {\n bounds: (e) => {\n const activeTabIndex = this.state.activeIndex - 1;\n let lower = 0;\n if (activeTabIndex > 0) {\n lower = this.slidesLayout\n .filter((l , i) => i < activeTabIndex - 1)\n .reduce((s, l) => s + l.width, 0);\n }\n let center = lower + (this.slidesLayout[activeTabIndex - 1]?.width || 0);\n let upper = center + (this.slidesLayout[activeTabIndex]?.width || 0);\n return {\n lower: -1 * lower,\n center: -1 * center,\n upper: -1 * upper\n };\n },\n computePhase: (value) => {\n const activeTabIndex = this.state.activeIndex - 1;\n const w = this.slidesLayout[activeTabIndex]?.width || 0;\n return w && Math.abs(value / w);\n },\n onLower: (e) => {\n this.onSlideChange(this.state.activeIndex - 1);\n },\n onUpper: (e) => {\n if(this.noOfSlides < this.state.activeIndex + 1){\n this.onSlideChange(1);\n this.animationView?.setPosition(0);\n }\n else{\n this.onSlideChange(this.state.activeIndex + 1);\n }\n }\n } as SwipeAnimation.Handlers;\n\n constructor(props: WmCarouselProps) {\n super(props, DEFAULT_CLASS, new WmCarouselProps(), new WmCarouselState());\n this.cleanup.push(() => {\n this.stopPlay && this.stopPlay();\n })\n }\n\n addSlideLayout(index: number, nativeEvent: LayoutChangeEvent) {\n this.slidesLayout[index] = nativeEvent.nativeEvent.layout;\n if (index === this.state.activeIndex) {\n this.forceUpdate();\n }\n }\n\n private generateItemKey(item: any, index: number, props: WmCarouselProps) {\n if (props.itemkey && item && !this._showSkeleton) {\n return props.itemkey(item, index);\n }\n return 'list_item_' + this.keyExtractor.getKey(item, true);\n }\n\n autoPlay() {\n const props = this.state.props;\n this.stopPlay && this.stopPlay();\n if (props.animation === 'auto' && props.animationinterval) {\n const intervalId = setInterval(() => {\n this.next();\n }, props.animationinterval * 1000);\n this.stopPlay = () => clearInterval(intervalId);\n } else {\n setTimeout(() => {\n this.onSlideChange(1);\n this.animationView?.setPosition(0);\n }, 1000);\n }\n }\n\n onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch (name) {\n case 'dataset': {\n this.keyExtractor?.clear();\n this.updateState({\n activeIndex: Math.min(this.state.activeIndex, $new?.length || 1)\n } as WmCarouselState);\n break;\n }\n case 'animation':\n case 'animationinterval' : {\n this.autoPlay();\n }\n }\n }\n\n animatePagination(index: number) {\n const prevIndex = this.state.activeIndex;\n const margin = ((this.styles.dotStyle?.marginLeft as number)|| 0) + \n ((this.styles.dotStyle?.marginRight as number)|| 0)\n const width = (this.styles.dotStyle?.width as number)|| 2;\n const size = margin + width;\n const position = Math.max(index - 1, 0) * size;\n const scale = Math.abs(index - prevIndex) * size;\n const options = {\n useNativeDriver: true,\n duration: 200,\n easing: Easing.out(Easing.linear)\n };\n if (prevIndex < index) {\n Animated.sequence([\n Animated.timing(this.dotScale, {\n toValue: scale,\n ...options\n }),\n Animated.parallel([\n Animated.timing(this.dotScale, {\n toValue: 0,\n ...options\n }),\n Animated.timing(this.dotPosition, {\n toValue: (this.isRTL ? -1: 1) * position,\n ...options\n })\n ])\n ]).start();\n } else if (prevIndex > index) {\n Animated.sequence([\n Animated.parallel([\n Animated.timing(this.dotScale, {\n toValue: scale,\n ...options\n }),\n Animated.timing(this.dotPosition, {\n toValue: (this.isRTL ? -1: 1) * position,\n ...options\n })\n ]),\n Animated.timing(this.dotScale, {\n toValue: 0,\n ...options\n }),\n ]).start();\n } \n }\n\n onSlideChange = (index: number) => {\n const prevIndex = this.state.activeIndex;\n this.updateState({\n activeIndex: index\n } as WmCarouselState,\n () => this.invokeEventCallback('onChange', [this, index, prevIndex]));\n this.animatePagination(index);\n }\n\n renderItem = (item: any, index: number) => {\n const props = this.state.props;\n if (props.type === 'dynamic') {\n return props.renderSlide ? props.renderSlide(item, index, this) : null;\n }\n return props.children[index];\n }\n\n next = () => {\n const props = this.state.props;\n const data = props.type === 'dynamic' ? props.dataset : props.children;\n if (this.state.activeIndex >= data?.length || 0) {\n this.onSlideChange(1);\n this.animationView?.setPosition(0);\n } else {\n this.animationView?.goToUpper();\n }\n }\n\n prev = () => {\n this.animationView?.goToLower();\n }\n\n renderPagination(data: any) {\n const maxNoOfDots = this.state.props.maxnoofdots;\n let minIndex = Math.max(this.state.activeIndex - maxNoOfDots + 1, 0);\n let maxIndex = Math.min(minIndex + maxNoOfDots - 1, data.length);\n if (maxIndex === data.length) {\n minIndex = maxIndex - maxNoOfDots;\n }\n return (<View style={this.styles.dotsWrapperStyle}>\n <View style={{flexDirection: this.isRTL ? 'row-reverse' : 'row'}}>\n {\n data.map((item: any, index: number) => {\n return index >= minIndex && index <= maxIndex ? (\n <View key={'dots_' + this.generateItemKey(item, index, this.state.props)} \n style={[this.styles.dotStyle]}>\n </View>) : null;\n })\n }\n <Animated.View style={[\n this.styles.dotStyle,\n this.styles.activeDotStyle, {\n width: undefined,\n height: undefined,\n transform: [{\n translateX: this.dotPosition\n }]\n }, this.isRTL ? { right: 0 } : { left: 0}]}>\n <Animated.View style={[{\n width: 1,\n height: 1\n }, {\n // This is failing in Android\n // minWidth: this.dotScale\n }]}>\n </Animated.View>\n </Animated.View>\n </View>\n </View>);\n }\n\n renderWidget(props: WmCarouselProps) {\n const hasNavs = props.controls === 'both' || props.controls ==='navs';\n const hasDots = props.controls === 'both' || props.controls ==='indicators';\n let styles = this.styles;\n let data = props.type === 'dynamic' ? props.dataset : props.children;\n data = isArray(data) ? data : [];\n this.noOfSlides = data?.length || 0;\n let slideScale = undefined as any;\n let slideTranslateX = undefined as any;\n if (isArray(this.styles.slide?.transform)) {\n slideScale = (this.styles.slide?.transform?.find(o => !isUndefined((o as any).scale)) as any)?.scale;\n slideTranslateX = (this.styles.slide?.transform?.find(o => !isUndefined((o as any).translateX)) as any)?.translateX;\n }\n // TODO: loop prop on Carousel is not working Refer: https://github.com/meliorence/react-native-snap-carousel/issues/608\n return (\n <View style={styles.root}>\n {this._background}\n <SwipeAnimation.View \n enableGestures={props.enablegestures && this.noOfSlides > 1}\n style={{\n flex: 1\n }}\n direction='horizontal'\n ref={(r) => {this.animationView = r}}\n handlers = {this.animationHandlers}\n slideMinWidth={this.styles.slide.width}\n >\n {data.map((item: any, index: number) => {\n const isActive = index === this.state.activeIndex - 1;\n let scale = this.animationView?.animationPhase.interpolate({\n inputRange: [-2000, index - 1, index, index + 1, 2000],\n outputRange: [slideScale, slideScale, 1, slideScale, slideScale]\n });\n let translateX = this.animationView?.animationPhase.interpolate({\n inputRange: [-2000, index - 1, index, index + 1, 2000],\n outputRange: [-56, -56, 0, 56, 56]\n });\n return (\n <Animated.View key={this.generateItemKey(item, index, props)}\n onLayout={this.addSlideLayout.bind(this, index)}\n style={[\n {height: props.type === 'dynamic' ? undefined : '100%'},\n this.styles.slide,\n index === 0 ? this.styles.firstSlide : null,\n index === data.length - 1 ? this.styles.lastSlide: null,\n isActive ? this.styles.activeSlide: null,\n translateX && scale ? {\n transform: [\n {\n translateX: !isUndefined(slideTranslateX) ? slideTranslateX : translateX\n }, {\n scale: scale\n }\n ]\n } : null]}>\n <Tappable onTap={() => {\n this.onSlideChange(index + 1);\n const position = this.slidesLayout\n .filter((l , i) => i < index)\n .reduce((s, l) => s + l.width, 0);\n this.animationView?.setPosition(-1 * position);\n }} rippleColor={this.styles.root.rippleColor} styles={{height: \"100%\"}}>\n {this.renderItem(item, index)}\n </Tappable>\n </Animated.View>\n );\n })}\n </SwipeAnimation.View>\n {hasNavs ? (\n <View style={styles.btnPanel}>\n <WmIcon\n id={this.getTestId('prev_icon')}\n iconclass=\"wi wi-chevron-left fa-2x\"\n styles={styles.prevBtn}\n onTap={this.prev}\n accessibilitylabel='back'/>\n <WmIcon\n id={this.getTestId('next_icon')}\n iconclass=\"wi wi-chevron-right fa-2x\"\n styles={styles.nextBtn}\n onTap={this.next}\n accessibilitylabel='next'/>\n </View>): null}\n {hasDots && data ? this.renderPagination(data) : null}\n </View>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,EAAEC,WAAW,QAAQ,WAAW;AAChD,SAASC,QAAQ,EAAEC,MAAM,EAAEC,IAAI,QAA4C,cAAc;AACzF,SAASC,mBAAmB,QAAQ,8CAA8C;AAClF,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAO,KAAKC,cAAc,MAAM,oDAAoD;AACpF,SAASC,QAAQ,QAAQ,mDAAmD;AAE5E,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,SAASC,aAAa,QAA0B,mBAAmB;AAEnE,OAAO,MAAMC,eAAe,SAASL,kBAAkB,CAAkB;EAAAM,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,sBACzD,CAAC;EAAA;AACjB;AAEA,eAAe,MAAMC,UAAU,SAASV,aA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","View","DefaultKeyExtractor","WmIcon","BaseComponent","BaseComponentState","SwipeAnimation","Tappable","WmCarouselProps","DEFAULT_CLASS","WmCarouselState","constructor","args","_defineProperty","WmCarousel","props","Value","bounds","e","_this$slidesLayout","_this$slidesLayout$ac","activeTabIndex","state","activeIndex","lower","slidesLayout","filter","l","i","reduce","s","width","center","upper","computePhase","value","_this$slidesLayout$ac2","w","Math","abs","onLower","onSlideChange","onUpper","noOfSlides","_this$animationView","animationView","setPosition","index","prevIndex","updateState","invokeEventCallback","animatePagination","item","type","renderSlide","children","data","dataset","length","_this$animationView2","_this$animationView3","goToUpper","_this$animationView4","goToLower","cleanup","push","stopPlay","addSlideLayout","nativeEvent","layout","forceUpdate","generateItemKey","itemkey","_showSkeleton","keyExtractor","getKey","autoPlay","initialized","animation","animationinterval","intervalId","setInterval","next","clearInterval","setTimeout","_this$animationView5","stopAnimation","startAnimation","onPropertyChange","name","$new","$old","_this$keyExtractor","clear","min","_this$styles$dotStyle","_this$styles$dotStyle2","_this$styles$dotStyle3","margin","styles","dotStyle","marginLeft","marginRight","size","position","max","scale","options","useNativeDriver","duration","easing","out","linear","sequence","timing","dotScale","toValue","parallel","dotPosition","isRTL","start","renderPagination","maxNoOfDots","maxnoofdots","minIndex","maxIndex","createElement","style","dotsWrapperStyle","flexDirection","map","_extends","key","getTestPropsForAction","activeDotStyle","undefined","height","transform","translateX","right","left","componentDidMount","renderWidget","_data","_this$styles$slide","hasNavs","controls","hasDots","slideScale","slideTranslateX","slide","_this$styles$slide2","_this$styles$slide3","find","o","root","_background","enableGestures","enablegestures","flex","direction","ref","r","handlers","animationHandlers","slideMinWidth","_this$animationView6","_this$animationView7","isActive","animationPhase","interpolate","inputRange","outputRange","onLayout","bind","firstSlide","lastSlide","activeSlide","onTap","_this$animationView8","rippleColor","renderItem","btnPanel","id","getTestId","iconclass","prevBtn","prev","accessibilitylabel","nextBtn"],"sources":["carousel.component.tsx"],"sourcesContent":["import React from 'react';\nimport { isArray, isUndefined } from 'lodash-es';\nimport { Animated, Easing, View, LayoutChangeEvent, LayoutRectangle } from 'react-native';\nimport { DefaultKeyExtractor } from '@wavemaker/app-rn-runtime/core/key.extractor';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport * as SwipeAnimation from '@wavemaker/app-rn-runtime/gestures/swipe.animation';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\n\nimport WmCarouselProps from './carousel.props';\nimport { DEFAULT_CLASS, WmCarouselStyles } from './carousel.styles';\n\nexport class WmCarouselState extends BaseComponentState<WmCarouselProps> {\n activeIndex = 1;\n}\n\nexport default class WmCarousel extends BaseComponent<WmCarouselProps, WmCarouselState, WmCarouselStyles> {\n\n noOfSlides: number = 0;\n private slidesLayout: LayoutRectangle[] = [];\n private keyExtractor = new DefaultKeyExtractor();\n stopPlay: Function = null as any;\n private dotScale = new Animated.Value(0);\n private dotPosition = new Animated.Value(0);\n private animationView: SwipeAnimation.View | null = null as any;\n private animationHandlers = {\n bounds: (e) => {\n const activeTabIndex = this.state.activeIndex - 1;\n let lower = 0;\n if (activeTabIndex > 0) {\n lower = this.slidesLayout\n .filter((l , i) => i < activeTabIndex - 1)\n .reduce((s, l) => s + l.width, 0);\n }\n let center = lower + (this.slidesLayout[activeTabIndex - 1]?.width || 0);\n let upper = center + (this.slidesLayout[activeTabIndex]?.width || 0);\n return {\n lower: -1 * lower,\n center: -1 * center,\n upper: -1 * upper\n };\n },\n computePhase: (value) => {\n const activeTabIndex = this.state.activeIndex - 1;\n const w = this.slidesLayout[activeTabIndex]?.width || 0;\n return w && Math.abs(value / w);\n },\n onLower: (e) => {\n this.onSlideChange(this.state.activeIndex - 1);\n },\n onUpper: (e) => {\n if(this.noOfSlides < this.state.activeIndex + 1){\n this.onSlideChange(1);\n this.animationView?.setPosition(0);\n }\n else{\n this.onSlideChange(this.state.activeIndex + 1);\n }\n }\n } as SwipeAnimation.Handlers;\n\n constructor(props: WmCarouselProps) {\n super(props, DEFAULT_CLASS, new WmCarouselProps(), new WmCarouselState());\n this.cleanup.push(() => {\n this.stopPlay && this.stopPlay();\n })\n }\n\n addSlideLayout(index: number, nativeEvent: LayoutChangeEvent) {\n this.slidesLayout[index] = nativeEvent.nativeEvent.layout;\n if (index === this.state.activeIndex) {\n this.forceUpdate();\n }\n }\n\n private generateItemKey(item: any, index: number, props: WmCarouselProps) {\n if (props.itemkey && item && !this._showSkeleton) {\n return props.itemkey(item, index);\n }\n return 'list_item_' + this.keyExtractor.getKey(item, true);\n }\n\n autoPlay() {\n if(!this.initialized){\n return;\n }\n const props = this.state.props;\n this.stopPlay && this.stopPlay();\n if (props.animation === 'auto' && props.animationinterval) {\n const intervalId = setInterval(() => {\n this.next();\n }, props.animationinterval * 1000);\n this.stopPlay = () => clearInterval(intervalId);\n } else {\n setTimeout(() => {\n this.onSlideChange(1);\n this.animationView?.setPosition(0);\n }, 1000);\n }\n }\n\n stopAnimation(){ \n this.stopPlay();\n }\n startAnimation() {\n this.autoPlay();\n }\n \n\n onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch (name) {\n case 'dataset': {\n this.keyExtractor?.clear();\n this.updateState({\n activeIndex: Math.min(this.state.activeIndex, $new?.length || 1)\n } as WmCarouselState);\n break;\n }\n case 'animation':\n case 'animationinterval' : {\n this.autoPlay();\n }\n }\n }\n\n animatePagination(index: number) {\n const prevIndex = this.state.activeIndex;\n const margin = ((this.styles.dotStyle?.marginLeft as number)|| 0) + \n ((this.styles.dotStyle?.marginRight as number)|| 0)\n const width = (this.styles.dotStyle?.width as number)|| 2;\n const size = margin + width;\n const position = Math.max(index - 1, 0) * size;\n const scale = Math.abs(index - prevIndex) * size;\n const options = {\n useNativeDriver: true,\n duration: 200,\n easing: Easing.out(Easing.linear)\n };\n if (prevIndex < index) {\n Animated.sequence([\n Animated.timing(this.dotScale, {\n toValue: scale,\n ...options\n }),\n Animated.parallel([\n Animated.timing(this.dotScale, {\n toValue: 0,\n ...options\n }),\n Animated.timing(this.dotPosition, {\n toValue: (this.isRTL ? -1: 1) * position,\n ...options\n })\n ])\n ]).start();\n } else if (prevIndex > index) {\n Animated.sequence([\n Animated.parallel([\n Animated.timing(this.dotScale, {\n toValue: scale,\n ...options\n }),\n Animated.timing(this.dotPosition, {\n toValue: (this.isRTL ? -1: 1) * position,\n ...options\n })\n ]),\n Animated.timing(this.dotScale, {\n toValue: 0,\n ...options\n }),\n ]).start();\n } \n }\n\n onSlideChange = (index: number) => {\n const prevIndex = this.state.activeIndex;\n this.updateState({\n activeIndex: index\n } as WmCarouselState,\n () => this.invokeEventCallback('onChange', [this, index, prevIndex]));\n this.animatePagination(index);\n }\n\n renderItem = (item: any, index: number) => {\n const props = this.state.props;\n if (props.type === 'dynamic') {\n return props.renderSlide ? props.renderSlide(item, index, this) : null;\n }\n return props.children[index];\n }\n\n next = () => {\n const props = this.state.props;\n const data = props.type === 'dynamic' ? props.dataset : props.children;\n if (this.state.activeIndex >= data?.length || 0) {\n this.onSlideChange(1);\n this.animationView?.setPosition(0);\n } else {\n this.animationView?.goToUpper();\n }\n }\n\n prev = () => {\n this.animationView?.goToLower();\n }\n\n renderPagination(data: any) {\n const maxNoOfDots = this.state.props.maxnoofdots;\n let minIndex = Math.max(this.state.activeIndex - maxNoOfDots + 1, 0);\n let maxIndex = Math.min(minIndex + maxNoOfDots - 1, data.length);\n if (maxIndex === data.length) {\n minIndex = maxIndex - maxNoOfDots;\n }\n return (<View style={this.styles.dotsWrapperStyle}>\n <View style={{flexDirection: this.isRTL ? 'row-reverse' : 'row'}}>\n {\n data.map((item: any, index: number) => {\n return index >= minIndex && index <= maxIndex ? (\n <View key={'dots_' + this.generateItemKey(item, index, this.state.props)} {...this.getTestPropsForAction('indicator'+index)}\n style={[this.styles.dotStyle]}>\n </View>) : null;\n })\n }\n <Animated.View style={[\n this.styles.dotStyle,\n this.styles.activeDotStyle, {\n width: undefined,\n height: undefined,\n transform: [{\n translateX: this.dotPosition\n }]\n }, this.isRTL ? { right: 0 } : { left: 0}]}>\n <Animated.View style={[{\n width: 1,\n height: 1\n }, {\n // This is failing in Android\n // minWidth: this.dotScale\n }]}>\n </Animated.View>\n </Animated.View>\n </View>\n </View>);\n }\n\n componentDidMount(): void {\n super.componentDidMount();\n this.autoPlay();\n }\n\n renderWidget(props: WmCarouselProps) {\n const hasNavs = props.controls === 'both' || props.controls ==='navs';\n const hasDots = props.controls === 'both' || props.controls ==='indicators';\n let styles = this.styles;\n let data = props.type === 'dynamic' ? props.dataset : props.children;\n data = isArray(data) ? data : [];\n this.noOfSlides = data?.length || 0;\n let slideScale = undefined as any;\n let slideTranslateX = undefined as any;\n if (isArray(this.styles.slide?.transform)) {\n slideScale = (this.styles.slide?.transform?.find(o => !isUndefined((o as any).scale)) as any)?.scale;\n slideTranslateX = (this.styles.slide?.transform?.find(o => !isUndefined((o as any).translateX)) as any)?.translateX;\n }\n // TODO: loop prop on Carousel is not working Refer: https://github.com/meliorence/react-native-snap-carousel/issues/608\n return (\n <View style={styles.root}>\n {this._background}\n <SwipeAnimation.View \n enableGestures={props.enablegestures && this.noOfSlides > 1}\n style={{\n flex: 1\n }}\n direction='horizontal'\n ref={(r) => {this.animationView = r}}\n handlers = {this.animationHandlers}\n slideMinWidth={this.styles.slide.width}\n >\n {data.map((item: any, index: number) => {\n const isActive = index === this.state.activeIndex - 1;\n let scale = this.animationView?.animationPhase.interpolate({\n inputRange: [-2000, index - 1, index, index + 1, 2000],\n outputRange: [slideScale, slideScale, 1, slideScale, slideScale]\n });\n let translateX = this.animationView?.animationPhase.interpolate({\n inputRange: [-2000, index - 1, index, index + 1, 2000],\n outputRange: [-56, -56, 0, 56, 56]\n });\n return (\n <Animated.View key={this.generateItemKey(item, index, props)}\n onLayout={this.addSlideLayout.bind(this, index)}\n style={[\n {height: props.type === 'dynamic' ? undefined : '100%'},\n this.styles.slide,\n index === 0 ? this.styles.firstSlide : null,\n index === data.length - 1 ? this.styles.lastSlide: null,\n isActive ? this.styles.activeSlide: null,\n translateX && scale ? {\n transform: [\n {\n translateX: !isUndefined(slideTranslateX) ? slideTranslateX : translateX\n }, {\n scale: scale\n }\n ]\n } : null]}>\n <Tappable onTap={() => {\n this.onSlideChange(index + 1);\n const position = this.slidesLayout\n .filter((l , i) => i < index)\n .reduce((s, l) => s + l.width, 0);\n this.animationView?.setPosition(-1 * position);\n }} rippleColor={this.styles.root.rippleColor} styles={{height: \"100%\"}}>\n {this.renderItem(item, index)}\n </Tappable>\n </Animated.View>\n );\n })}\n </SwipeAnimation.View>\n {hasNavs ? (\n <View style={styles.btnPanel}>\n <WmIcon\n id={this.getTestId('prev_icon')}\n iconclass=\"wi wi-chevron-left fa-2x\"\n styles={styles.prevBtn}\n onTap={this.prev}\n accessibilitylabel='back'/>\n <WmIcon\n id={this.getTestId('next_icon')}\n iconclass=\"wi wi-chevron-right fa-2x\"\n styles={styles.nextBtn}\n onTap={this.next}\n accessibilitylabel='next'/>\n </View>): null}\n {hasDots && data ? this.renderPagination(data) : null}\n </View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,EAAEC,WAAW,QAAQ,WAAW;AAChD,SAASC,QAAQ,EAAEC,MAAM,EAAEC,IAAI,QAA4C,cAAc;AACzF,SAASC,mBAAmB,QAAQ,8CAA8C;AAClF,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAO,KAAKC,cAAc,MAAM,oDAAoD;AACpF,SAASC,QAAQ,QAAQ,mDAAmD;AAE5E,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,SAASC,aAAa,QAA0B,mBAAmB;AAEnE,OAAO,MAAMC,eAAe,SAASL,kBAAkB,CAAkB;EAAAM,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,sBACzD,CAAC;EAAA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AA,CAAAkI,aAAA,CAAC3H,MAAM;MACLoL,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,WAAW,CAAE;MAChCC,SAAS,EAAC,2BAA2B;MACrCtF,MAAM,EAAEA,MAAM,CAAC0F,OAAQ;MACvBX,KAAK,EAAE,IAAI,CAAChG,IAAK;MACjB0G,kBAAkB,EAAC;IAAM,CAAC,CACxB,CAAC,GAAG,IAAI,EACbzC,OAAO,IAAI3F,IAAI,GAAG,IAAI,CAACiE,gBAAgB,CAACjE,IAAI,CAAC,GAAG,IAC/C,CAAC;EACX;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["React","BackHandler","Platform","View","WebView","HideMode","BaseComponent","BaseComponentState","WmWebviewProps","DEFAULT_CLASS","AccessibilityWidgetType","getAccessibilityProps","isAndroid","isWebPreviewMode","WmWebViewState","constructor","args","_defineProperty","title","src","WmWebview","props","webview","webViewState","canGoBack","goBack","event","_event$nativeEvent","data","nativeEvent","startsWith","id","match","callback","invokeJSCallbacks","result","substring","indexOf","parseResult","invokeEventCallback","hideMode","DONOT_ADD_TO_DOM","addEventListener","handleBackButtonPress","componentWillUnmount","removeEventListener","_this$state$currentTa","state","currentTarget","currentsrc","_this$state$currentTa2","executeScript","fn","Promise","resolve","reject","Date","now","injectJavaScript","insertCSS","style","replace","JSON","parse","e","getTitle","iframe","contentWindow","document","onLoad","updateState","renderWidget","createElement","styles","root","_background","OS","width","height","_extends","ref","nestedScrollEnabled","source","uri","testID","getTestId","WEBVIEW","incognito","onMessage","sharedCookiesEnabled","onNavigationStateChange","scrollEnabled","onLoadEnd","url"],"sources":["webview.component.tsx"],"sourcesContent":["import React from 'react';\nimport { BackHandler, Platform, View } from 'react-native';\nimport { WebView, WebViewNavigation, WebViewMessageEvent } from 'react-native-webview';\nimport { HideMode } from '@wavemaker/app-rn-runtime/core/if.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmWebviewProps from './webview.props';\nimport { DEFAULT_CLASS, WebviewStyles } from './webview.styles';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\nimport { isAndroid, isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\n\nclass WmWebViewState extends BaseComponentState<WmWebviewProps> {\n currentTarget = {\n title: '',\n src: ''\n };\n\n}\n\nexport default class WmWebview extends BaseComponent<WmWebviewProps, WmWebViewState, WebviewStyles> {\n\n private webview: WebView | null = null as any;\n private webViewState: WebViewNavigation = null as any;\n private invokeJSCallbacks = {} as any;\n\n constructor(props: WmWebviewProps) {\n super(props, DEFAULT_CLASS, new WmWebviewProps());\n this.hideMode = HideMode.DONOT_ADD_TO_DOM;\n if (isAndroid() && !isWebPreviewMode()) {\n BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonPress);\n }\n }\n\n componentWillUnmount() {\n super.componentWillUnmount();\n if (isAndroid() && !isWebPreviewMode()) {\n BackHandler.removeEventListener('hardwareBackPress', this.handleBackButtonPress);\n }\n }\n\n handleBackButtonPress = (): boolean => {\n if (this.webview && this.webViewState && this.webViewState.canGoBack) {\n this.webview.goBack();\n return true;\n }\n return false;\n }\n\n get title() {\n return this.state.currentTarget?.title;\n }\n\n get currentsrc() {\n return this.state.currentTarget?.src;\n }\n\n executeScript(fn: string) {\n return new Promise((resolve, reject) => {\n if (this.webview) {\n const id = '' + Date.now();\n this.invokeJSCallbacks[id] = resolve;\n fn = `\n (function(){\n try{\n return (${fn});\n } catch(e) {\n return e.getMessage();\n }\n }())\n `;\n this.webview.injectJavaScript(\n `window.ReactNativeWebView.postMessage('afterInjectJavaScript:' + ${id} + ':' + JSON.stringify(${fn}))`\n );\n } else {\n reject();\n }\n });\n }\n\n insertCSS(style = '') {\n style = style.replace(/[\\n\\t\\r]/g, '');\n return this.executeScript(`\n function() {\n const style = document.createElement('style');\n style.innerHTML = '${style}';\n document.head.appendChild(style);\n return 'SUCCESS';\n }()\n `);\n }\n\n parseResult(result: string) {\n try {\n return JSON.parse(result);\n } catch(e) {\n if (result === 'undefined' || result === 'null') {\n return null;\n }\n return result;\n }\n }\n\n onMessage = (event: WebViewMessageEvent) => {\n const data: string = event.nativeEvent?.data;\n if (data && data.startsWith('afterInjectJavaScript')) {\n const id = data?.match(/\\:([0-9]+)\\:/);\n const callback = id && this.invokeJSCallbacks[id[1]];\n const result = data.substring(data.indexOf(':', data.indexOf(':') + 1) + 1);\n callback && callback(this.parseResult(result));\n } else {\n this.invokeEventCallback('onMessage', [event, this]);\n }\n }\n\n getTitle(iframe: any) {\n try {\n return iframe.currentTarget.contentWindow.document.title;\n } catch(e) {\n // browser blocks cross origin access to iframe content.\n }\n }\n\n public onLoad(e: any, title: string, src: string) {\n this.updateState({\n currentTarget: {\n title: title,\n src: src\n }\n } as WmWebViewState, () => {\n this.invokeEventCallback('onLoad', [e, this]);\n });\n }\n\n protected renderWidget(props: WmWebviewProps) {\n return (\n <View style={this.styles.root}>\n {this._background}\n {Platform.OS === 'web' ?\n (<iframe src={props.src} width={'100%'} height={'100%'}\n onLoad={(e) => this.onLoad(e, this.getTitle(e.currentTarget), (e.currentTarget as any).src)}></iframe>) :\n (<WebView\n ref={(ref) => this.webview = ref}\n nestedScrollEnabled={true}\n style={this.styles.webview}\n source={{\n uri: props.src\n }}\n testID={this.getTestId('web_view')}\n {...getAccessibilityProps(AccessibilityWidgetType.WEBVIEW, props)}\n incognito={props.incognito}\n onMessage={this.onMessage}\n sharedCookiesEnabled={true}\n onNavigationStateChange={(state) => {\n this.webViewState = state;\n }}\n scrollEnabled={true}\n onLoadEnd={(e) => this.onLoad(e, e.nativeEvent.title, e.nativeEvent.url)}>\n </WebView>)}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,WAAW,EAAEC,QAAQ,EAAEC,IAAI,QAAQ,cAAc;AAC1D,SAASC,OAAO,QAAgD,sBAAsB;AACtF,SAASC,QAAQ,QAAQ,6CAA6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AK;MAC3B,CAAE;MACF4C,aAAa,EAAE,IAAK;MACpBC,SAAS,EAAG5B,CAAC,IAAK,IAAI,CAACK,MAAM,CAACL,CAAC,EAAEA,CAAC,CAACnC,WAAW,CAACX,KAAK,EAAE8C,CAAC,CAACnC,WAAW,CAACgE,GAAG;IAAE,EAClE,CACP,CAAC;EAEX;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","BackHandler","Platform","View","WebView","HideMode","BaseComponent","BaseComponentState","WmWebviewProps","DEFAULT_CLASS","AccessibilityWidgetType","getAccessibilityProps","isAndroid","isWebPreviewMode","WmWebViewState","constructor","args","_defineProperty","title","src","WmWebview","props","webview","webViewState","canGoBack","goBack","event","_event$nativeEvent","data","nativeEvent","startsWith","id","match","callback","invokeJSCallbacks","result","substring","indexOf","parseResult","invokeEventCallback","hideMode","DONOT_ADD_TO_DOM","addEventListener","handleBackButtonPress","componentWillUnmount","removeEventListener","_this$state$currentTa","state","currentTarget","currentsrc","_this$state$currentTa2","executeScript","fn","Promise","resolve","reject","Date","now","injectJavaScript","insertCSS","style","replace","JSON","parse","e","getTitle","iframe","contentWindow","document","onLoad","updateState","renderWidget","createElement","styles","root","_background","OS","width","height","_extends","ref","nestedScrollEnabled","source","uri","testID","getTestId","WEBVIEW","incognito","onMessage","sharedCookiesEnabled","onNavigationStateChange","scrollEnabled","onLoadEnd","url"],"sources":["webview.component.tsx"],"sourcesContent":["import React from 'react';\nimport { BackHandler, Platform, View } from 'react-native';\nimport { WebView, WebViewNavigation, WebViewMessageEvent } from 'react-native-webview';\nimport { HideMode } from '@wavemaker/app-rn-runtime/core/if.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmWebviewProps from './webview.props';\nimport { DEFAULT_CLASS, WebviewStyles } from './webview.styles';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\nimport { isAndroid, isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\n\nclass WmWebViewState extends BaseComponentState<WmWebviewProps> {\n currentTarget = {\n title: '',\n src: ''\n };\n\n}\n\nexport default class WmWebview extends BaseComponent<WmWebviewProps, WmWebViewState, WebviewStyles> {\n\n private webview: WebView | null = null as any;\n private webViewState: WebViewNavigation = null as any;\n private invokeJSCallbacks = {} as any;\n\n constructor(props: WmWebviewProps) {\n super(props, DEFAULT_CLASS, new WmWebviewProps());\n this.hideMode = HideMode.DONOT_ADD_TO_DOM;\n if (isAndroid() && !isWebPreviewMode()) {\n BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonPress);\n }\n }\n\n componentWillUnmount() {\n super.componentWillUnmount();\n if (isAndroid() && !isWebPreviewMode()) {\n BackHandler.removeEventListener('hardwareBackPress', this.handleBackButtonPress);\n }\n }\n\n handleBackButtonPress = (): boolean => {\n if (this.webview && this.webViewState && this.webViewState.canGoBack) {\n this.webview.goBack();\n return true;\n }\n return false;\n }\n\n get title() {\n return this.state.currentTarget?.title;\n }\n\n get currentsrc() {\n return this.state.currentTarget?.src;\n }\n\n executeScript(fn: string) {\n return new Promise((resolve, reject) => {\n if (this.webview) {\n const id = '' + Date.now();\n this.invokeJSCallbacks[id] = resolve;\n fn = `\n (function(){\n try{\n return (${fn});\n } catch(e) {\n return e.getMessage();\n }\n }())\n `;\n this.webview.injectJavaScript(\n `window.ReactNativeWebView.postMessage('afterInjectJavaScript:' + ${id} + ':' + JSON.stringify(${fn}))`\n );\n } else {\n reject();\n }\n });\n }\n\n insertCSS(style = '') {\n style = style.replace(/[\\n\\t\\r]/g, '');\n return this.executeScript(`\n function() {\n const style = document.createElement('style');\n style.innerHTML = '${style}';\n document.head.appendChild(style);\n return 'SUCCESS';\n }()\n `);\n }\n\n parseResult(result: string) {\n try {\n return JSON.parse(result);\n } catch(e) {\n if (result === 'undefined' || result === 'null') {\n return null;\n }\n return result;\n }\n }\n\n onMessage = (event: WebViewMessageEvent) => {\n const data: string = event.nativeEvent?.data;\n if (data && data.startsWith('afterInjectJavaScript')) {\n const id = data?.match(/\\:([0-9]+)\\:/);\n const callback = id && this.invokeJSCallbacks[id[1]];\n const result = data.substring(data.indexOf(':', data.indexOf(':') + 1) + 1);\n callback && callback(this.parseResult(result));\n } else {\n this.invokeEventCallback('onMessage', [event, this]);\n }\n }\n\n getTitle(iframe: any) {\n try {\n return iframe.currentTarget.contentWindow.document.title;\n } catch(e) {\n // browser blocks cross origin access to iframe content.\n }\n }\n\n public onLoad(e: any, title: string, src: string) {\n this.updateState({\n currentTarget: {\n title: title,\n src: src\n }\n } as WmWebViewState, () => {\n this.invokeEventCallback('onLoad', [e, this]);\n });\n }\n\n protected renderWidget(props: WmWebviewProps) {\n return (\n <View style={this.styles.root}>\n {this._background}\n {Platform.OS === 'web' ?\n (<iframe src={props.src} width={'100%'} height={'100%'}\n onLoad={(e) => this.onLoad(e, this.getTitle(e.currentTarget), (e.currentTarget as any).src)}></iframe>) :\n (<WebView\n ref={(ref) => this.webview = ref}\n nestedScrollEnabled={true}\n style={this.styles.webview}\n source={{\n uri: props.src\n }}\n testID={this.getTestId('web_view')}\n {...getAccessibilityProps(AccessibilityWidgetType.WEBVIEW, props)}\n incognito={props.incognito}\n onMessage={this.onMessage}\n sharedCookiesEnabled={true}\n onNavigationStateChange={(state) => {\n this.webViewState = state;\n }}\n scrollEnabled={true}\n onLoadEnd={(e) => this.onLoad(e, e.nativeEvent.title, e.nativeEvent.url)}>\n </WebView>)}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,WAAW,EAAEC,QAAQ,EAAEC,IAAI,QAAQ,cAAc;AAC1D,SAASC,OAAO,QAAgD,sBAAsB;AACtF,SAASC,QAAQ,QAAQ,6CAA6C;AACtE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,cAAc,MAAM,iBAAiB;AAC5C,SAASC,aAAa,QAAuB,kBAAkB;AAC/D,SAASC,uBAAuB,EAAEC,qBA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AAC,CAACnC,WAAW,CAACgE,GAAG;IAAE,EAClE,CACP,CAAC;EAEX;AACF","ignoreList":[]}
@@ -59,9 +59,9 @@ export default class WmAnchor extends BaseComponent {
59
59
  iconwidth: iconwidth
60
60
  });
61
61
  //@ts-ignore
62
- const badge = badgevalue != undefined ? /*#__PURE__*/React.createElement(Badge, {
62
+ const badge = badgevalue != undefined ? /*#__PURE__*/React.createElement(Badge, _extends({
63
63
  style: this.styles.badge
64
- }, badgevalue) : null;
64
+ }, this.getTestProps('badge')), badgevalue) : null;
65
65
  return /*#__PURE__*/React.createElement(NavigationServiceConsumer, null, navigationService => /*#__PURE__*/React.createElement(Animatedview, {
66
66
  entryanimation: props.animation,
67
67
  delay: props.animationdelay,
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","Badge","BaseComponent","BaseComponentState","Tappable","WmIcon","encodeUrl","AccessibilityWidgetType","getAccessibilityProps","NavigationServiceConsumer","WmAnchorProps","DEFAULT_CLASS","Animatedview","createSkeleton","WmAnchorState","WmAnchor","constructor","props","onTap","navigationService","e","state","hyperlink","link","encodeurl","openUrl","target","invokeEventCallback","proxy","renderSkeleton","theme","styles","skeleton","root","width","skeletonwidth","height","skeletonheight","renderWidget","iconclass","iconurl","name","iconheight","iconmargin","iconwidth","badgevalue","icon","text","color","createElement","id","getTestId","hint","badge","undefined","style","entryanimation","animation","delay","animationdelay","justifyContent","_extends","getTestPropsForAction","flexDirection","iconposition","_background","caption","getTestPropsForLabel","ANCHOR","numberOfLines","nooflines"],"sources":["anchor.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport { Badge } from 'react-native-paper';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { SyntheticEvent, Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { encodeUrl } from '@wavemaker/app-rn-runtime/core/utils';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\nimport NavigationService, { NavigationServiceConsumer } from '@wavemaker/app-rn-runtime/core/navigation.service';\n\nimport WmAnchorProps from './anchor.props';\nimport { DEFAULT_CLASS, WmAnchorStyles } from './anchor.styles';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport { createSkeleton } from '../skeleton/skeleton.component';\n\nexport class WmAnchorState extends BaseComponentState<WmAnchorProps> {\n\n}\n\nexport default class WmAnchor extends BaseComponent<WmAnchorProps, WmAnchorState, WmAnchorStyles> {\n\n constructor(props: WmAnchorProps) {\n super(props, DEFAULT_CLASS, new WmAnchorProps());\n }\n\n onTap(navigationService: NavigationService, e: SyntheticEvent) {\n const props = this.state.props;\n if (props.hyperlink) {\n const link = props.encodeurl ? encodeUrl(props.hyperlink) : props.hyperlink;\n navigationService.openUrl(link, {\n target: this.state.props.target\n });\n }\n this.invokeEventCallback('onTap', [e, this.proxy]);\n }\n\n public renderSkeleton(props: WmAnchorProps){\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: this.props.skeletonwidth || this.styles.root.width,\n height: this.props.skeletonheight || this.styles.root.height\n });\n }\n\n renderWidget(props: WmAnchorProps) {\n const {\n iconclass,\n iconurl,\n name,\n iconheight,\n iconmargin,\n iconwidth,\n badgevalue,\n } = props;\n\n if (this.styles.icon && this.styles.icon.text) {\n this.styles.icon.text.color = this.styles.text.color;\n }\n\n const icon = (iconclass || iconurl) && (\n <WmIcon\n id={this.getTestId('icon')}\n styles={this.styles.icon}\n hint={props?.hint}\n name={name + '_icon'}\n iconclass={iconclass}\n iconurl={iconurl}\n iconheight={iconheight}\n iconmargin={iconmargin}\n iconwidth={iconwidth}\n />\n );\n //@ts-ignore\n const badge = badgevalue != undefined ? (<Badge style={this.styles.badge}>{badgevalue}</Badge>): null;\n return (\n <NavigationServiceConsumer>\n {(navigationService: NavigationService) =>\n (<Animatedview entryanimation={props.animation} delay={props.animationdelay} style={{width: this.styles.root.width, height: this.styles.root.height, justifyContent: 'center'}}>\n <Tappable {...this.getTestPropsForAction()} target={this} styles={[this.styles.root, this.styles.root.width && this.styles.root.height ? { width: '100%', height: '100%'} : null, {flexDirection: props.iconposition === 'top' ? 'column': 'row'}]}\n onTap={props.hyperlink || props.onTap ? (e: SyntheticEvent) => this.onTap(navigationService, e) : undefined}>\n {this._background}\n {props.iconposition === 'top' && icon}\n {props.iconposition === 'left' && icon}\n {props.caption ? (<Text style={this.styles.text}\n {...this.getTestPropsForLabel('caption')}\n {...getAccessibilityProps(AccessibilityWidgetType.ANCHOR, props)}\n numberOfLines={props.nooflines}>{props.caption}</Text>) : null}\n {props.iconposition === 'right' && icon}\n {badge}\n </Tappable>\n </Animatedview>)\n }\n </NavigationServiceConsumer>\n );\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAAyBC,QAAQ,QAAQ,mDAAmD;AAC5F,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAASC,SAAS,QAAQ,sCAAsC;AAChE,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAC7G,SAA4BC,yBAAyB,QAAQ,mDAAmD;AAEhH,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAASC,cAAc,QAAQ,gCAAgC;AAE/D,OAAO,MAAMC,aAAa,SAASX,kBAAkB,CAAgB;AAIrE,eAAe,MAAMY,QAAQ,SAASb,aAAa,CAA+C;EAEhGc,WAAWA,CAACC,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAEN,aAAa,EAAE,IAAID,aAAa,CAAC,CAAC,CAAC;EAClD;EAEAQ,KAAKA,CAACC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H,MAAM,CAACE,IAAI,CAACG,MAAM,GAAG;QAAEF,KAAK,EAAE,MAAM;QAAEE,MAAM,EAAE;MAAM,CAAC,GAAG,IAAI,EAAE;QAAC2B,aAAa,EAAE9C,KAAK,CAAC+C,YAAY,KAAK,KAAK,GAAG,QAAQ,GAAE;MAAK,CAAC,CAAE;MACjP9C,KAAK,EAAED,KAAK,CAACK,SAAS,IAAIL,KAAK,CAACC,KAAK,GAAIE,CAAiB,IAAK,IAAI,CAACF,KAAK,CAACC,iBAAiB,EAAEC,CAAC,CAAC,GAAGkC;IAAU,IAC3G,IAAI,CAACW,WAAW,EAChBhD,KAAK,CAAC+C,YAAY,KAAK,KAAK,IAAIlB,IAAI,EACpC7B,KAAK,CAAC+C,YAAY,KAAK,MAAM,IAAIlB,IAAI,EACrC7B,KAAK,CAACiD,OAAO,gBAAInE,KAAA,CAAAkD,aAAA,CAACjD,IAAI,EAAA6D,QAAA;MAACN,KAAK,EAAE,IAAI,CAACxB,MAAM,CAACgB;IAAK,GAC5C,IAAI,CAACoB,oBAAoB,CAAC,SAAS,CAAC,EACpC3D,qBAAqB,CAACD,uBAAuB,CAAC6D,MAAM,EAAEnD,KAAK,CAAC;MAChEoD,aAAa,EAAEpD,KAAK,CAACqD;IAAU,IAAErD,KAAK,CAACiD,OAAc,CAAC,GAAI,IAAI,EAC7DjD,KAAK,CAAC+C,YAAY,KAAK,OAAO,IAAIlB,IAAI,EACtCO,KACO,CACE,CAES,CAAC;EAEhC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","Text","Badge","BaseComponent","BaseComponentState","Tappable","WmIcon","encodeUrl","AccessibilityWidgetType","getAccessibilityProps","NavigationServiceConsumer","WmAnchorProps","DEFAULT_CLASS","Animatedview","createSkeleton","WmAnchorState","WmAnchor","constructor","props","onTap","navigationService","e","state","hyperlink","link","encodeurl","openUrl","target","invokeEventCallback","proxy","renderSkeleton","theme","styles","skeleton","root","width","skeletonwidth","height","skeletonheight","renderWidget","iconclass","iconurl","name","iconheight","iconmargin","iconwidth","badgevalue","icon","text","color","createElement","id","getTestId","hint","badge","undefined","_extends","style","getTestProps","entryanimation","animation","delay","animationdelay","justifyContent","getTestPropsForAction","flexDirection","iconposition","_background","caption","getTestPropsForLabel","ANCHOR","numberOfLines","nooflines"],"sources":["anchor.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport { Badge } from 'react-native-paper';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { SyntheticEvent, Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { encodeUrl } from '@wavemaker/app-rn-runtime/core/utils';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\nimport NavigationService, { NavigationServiceConsumer } from '@wavemaker/app-rn-runtime/core/navigation.service';\n\nimport WmAnchorProps from './anchor.props';\nimport { DEFAULT_CLASS, WmAnchorStyles } from './anchor.styles';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport { createSkeleton } from '../skeleton/skeleton.component';\n\nexport class WmAnchorState extends BaseComponentState<WmAnchorProps> {\n\n}\n\nexport default class WmAnchor extends BaseComponent<WmAnchorProps, WmAnchorState, WmAnchorStyles> {\n\n constructor(props: WmAnchorProps) {\n super(props, DEFAULT_CLASS, new WmAnchorProps());\n }\n\n onTap(navigationService: NavigationService, e: SyntheticEvent) {\n const props = this.state.props;\n if (props.hyperlink) {\n const link = props.encodeurl ? encodeUrl(props.hyperlink) : props.hyperlink;\n navigationService.openUrl(link, {\n target: this.state.props.target\n });\n }\n this.invokeEventCallback('onTap', [e, this.proxy]);\n }\n\n public renderSkeleton(props: WmAnchorProps){\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: this.props.skeletonwidth || this.styles.root.width,\n height: this.props.skeletonheight || this.styles.root.height\n });\n }\n\n renderWidget(props: WmAnchorProps) {\n const {\n iconclass,\n iconurl,\n name,\n iconheight,\n iconmargin,\n iconwidth,\n badgevalue,\n } = props;\n\n if (this.styles.icon && this.styles.icon.text) {\n this.styles.icon.text.color = this.styles.text.color;\n }\n\n const icon = (iconclass || iconurl) && (\n <WmIcon\n id={this.getTestId('icon')}\n styles={this.styles.icon}\n hint={props?.hint}\n name={name + '_icon'}\n iconclass={iconclass}\n iconurl={iconurl}\n iconheight={iconheight}\n iconmargin={iconmargin}\n iconwidth={iconwidth}\n />\n );\n //@ts-ignore\n const badge = badgevalue != undefined ? (<Badge style={this.styles.badge} {...this.getTestProps('badge')}>{badgevalue}</Badge>): null;\n return (\n <NavigationServiceConsumer>\n {(navigationService: NavigationService) =>\n (<Animatedview entryanimation={props.animation} delay={props.animationdelay} style={{width: this.styles.root.width, height: this.styles.root.height, justifyContent: 'center'}}>\n <Tappable {...this.getTestPropsForAction()} target={this} styles={[this.styles.root, this.styles.root.width && this.styles.root.height ? { width: '100%', height: '100%'} : null, {flexDirection: props.iconposition === 'top' ? 'column': 'row'}]}\n onTap={props.hyperlink || props.onTap ? (e: SyntheticEvent) => this.onTap(navigationService, e) : undefined}>\n {this._background}\n {props.iconposition === 'top' && icon}\n {props.iconposition === 'left' && icon}\n {props.caption ? (<Text style={this.styles.text}\n {...this.getTestPropsForLabel('caption')}\n {...getAccessibilityProps(AccessibilityWidgetType.ANCHOR, props)}\n numberOfLines={props.nooflines}>{props.caption}</Text>) : null}\n {props.iconposition === 'right' && icon}\n {badge}\n </Tappable>\n </Animatedview>)\n }\n </NavigationServiceConsumer>\n );\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAAyBC,QAAQ,QAAQ,mDAAmD;AAC5F,OAAOC,MAAM,MAAM,gEAAgE;AAC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B,CAACD,uBAAuB,CAAC8D,MAAM,EAAEpD,KAAK,CAAC;MAChEqD,aAAa,EAAErD,KAAK,CAACsD;IAAU,IAAEtD,KAAK,CAACkD,OAAc,CAAC,GAAI,IAAI,EAC7DlD,KAAK,CAACgD,YAAY,KAAK,OAAO,IAAInB,IAAI,EACtCO,KACO,CACE,CAES,CAAC;EAEhC;AACF","ignoreList":[]}
@@ -207,9 +207,13 @@ export class Animatedview extends React.Component {
207
207
  style: this.props.style,
208
208
  iterationCount: this.props.iterationCount,
209
209
  ref: this.handleViewRef
210
- }, this.props.accessibilityProps), this.props.children) : /*#__PURE__*/React.createElement(View, _extends({
210
+ }, this.props.accessibilityProps, {
211
+ testID: "animatableView"
212
+ }), this.props.children) : /*#__PURE__*/React.createElement(View, _extends({
211
213
  style: this.props.style
212
- }, this.props.accessibilityProps), this.props.children);
214
+ }, this.props.accessibilityProps, {
215
+ testID: "non_animatableView"
216
+ }), this.props.children);
213
217
  }
214
218
  }
215
219
  _defineProperty(Animatedview, "defaultProps", {
@@ -1 +1 @@
1
- {"version":3,"names":["React","Animatable","initializeRegistryWithDefinitions","View","AnimatedviewProps","constructor","_defineProperty","AnimationMap","bounce","flash","pulse","rotate","rubberBand","shake","swing","tada","wobble","bounceIn","bounceInDown","bounceInLeft","bounceInRight","bounceInUp","fadeIn","fadeInDown","fadeInDownBig","fadeInLeft","fadeInLeftBig","fadeInRight","fadeInRightBig","fadeInUp","fadeInUpBig","flipInX","flipInY","lightSpeedIn","slideInDown","slideInLeft","slideInRight","slideInUp","zoomIn","zoomInDown","zoomInLeft","zoomInRight","zoomInUp","CustomAnimationMap","transform","rotateY","rotateX","flipOutY","flipOutX","from","translateY","to","slideOutUp","slideOutDown","opacity","fadeOutDown","fadeOutUp","Animatedview","Component","props","ref","view","triggerEntry","animate","entryanimation","duration","then","endState","finished","triggerExit","exitanimation","render","createElement","_extends","animation","delay","useNativeDriver","style","iterationCount","handleViewRef","accessibilityProps","children"],"sources":["animatedview.component.tsx"],"sourcesContent":["import React from 'react';\nimport * as Animatable from 'react-native-animatable';\nimport { initializeRegistryWithDefinitions } from 'react-native-animatable';\nimport { View, ViewProps, ViewStyle } from 'react-native';\n\nexport default class AnimatedviewProps {\n entryanimation?: string = null as any;\n children?: any;\n duration?: number = null as any;\n delay?: number = null as any;\n iterationCount?:any;\n style?: any;\n exitanimation?: string = null as any;\n accessibilityProps?: any;\n}\n\nconst AnimationMap: any = {\n bounce: 'bounce',\n flash: 'flash',\n pulse: 'pulse',\n rotate: 'rotate',\n rubberBand: 'rubberBand',\n shake: 'shake',\n swing: 'swing',\n tada: 'tada',\n wobble: 'wobble',\n bounceIn: 'bounceOut',\n bounceInDown: 'bounceOutUp',\n bounceInLeft: 'bounceOutRight',\n bounceInRight: 'bounceOutLeft',\n bounceInUp: 'bounceOutDown',\n fadeIn: 'fadeOut',\n fadeInDown: 'fadeOutUp',\n fadeInDownBig: 'fadeOutUpBig',\n fadeInLeft: 'fadeOutRight',\n fadeInLeftBig: 'fadeOutRightBig',\n fadeInRight: 'fadeOutLeft',\n fadeInRightBig: 'fadeOutLeftBig',\n fadeInUp: 'fadeOutDown',\n fadeInUpBig: 'fadeOutDownBig',\n flipInX: 'flipOutX',\n flipInY: 'flipOutY',\n lightSpeedIn: 'lightSpeedOut',\n slideInDown: 'slideOutUp',\n slideInLeft: 'slideOutRight',\n slideInRight: 'slideOutLeft',\n slideInUp: 'slideOutDown',\n zoomIn: 'zoomOut',\n zoomInDown: 'zoomOutUp',\n zoomInLeft: 'zoomOutRight',\n zoomInRight: 'zoomOutLeft',\n zoomInUp: 'zoomOutDown'\n};\n\nconst CustomAnimationMap: any = {\n flipInY: {\n 0: {\n transform: [{rotateY: \"0deg\"}]\n },\n 1: {\n transform: [{rotateY: \"360deg\"}]\n }\n },\n flipInX: {\n 0: {\n transform: [{rotateX: \"0deg\"}]\n },\n 1: {\n transform: [{rotateX: \"360deg\"}]\n }\n },\n flipOutY: {\n 0: {\n transform: [{rotateY: \"3600deg\"}]\n },\n 1: {\n transform: [{rotateY: \"0deg\"}]\n }\n },\n flipOutX: {\n 0: {\n transform: [{rotateX: \"360deg\"}]\n },\n 1: {\n transform: [{rotateX: \"0deg\"}]\n }\n },\n slideInDown : {\n from: { translateY: -20 },\n to: { translateY: 0 }\n },\n slideInUp : {\n from: { translateY: 20 },\n to: { translateY: 0 }\n },\n slideOutUp: {\n from: { translateY: 0 },\n to: { translateY: -20 }\n },\n slideOutDown : {\n from: { translateY: 0 },\n to: { translateY: 20 }\n },\n fadeInDown: {\n from: { opacity: 0, translateY: -20 },\n to: { opacity: 1, translateY: 0 }\n },\n fadeInUp: {\n from: { opacity: 0, translateY: 20 },\n to: { opacity: 1, translateY: 0 }\n },\n fadeOutDown: {\n from: { opacity: 1, translateY: 0 },\n to: { opacity: 0, translateY: 20 }\n },\n fadeOutUp: {\n from: { opacity: 1, translateY: 0 },\n to: { opacity: 0, translateY: -20 }\n }\n};\n\nexport class Animatedview extends React.Component<AnimatedviewProps> {\n static defaultProps: AnimatedviewProps = {\n duration: 200\n };\n\n private view: Animatable.View = null as any;\n\n constructor(props: AnimatedviewProps) {\n super(props);\n initializeRegistryWithDefinitions(CustomAnimationMap);\n }\n\n triggerEntry() {\n return (this as any).view.animate(this.props.entryanimation, this.props.duration).then((endState: any) => endState.finished)\n }\n\n triggerExit() {\n if (!this.view) {\n return;\n }\n if (this.props.exitanimation) {\n return (this as any).view.animate(this.props.exitanimation, this.props.duration, 1).then((endState: any) => endState.finished)\n } else {\n return (this as any).view.animate(AnimationMap[this.props.entryanimation || ''], this.props.duration, 1).then((endState: any) => endState.finished)\n }\n }\n\n // @ts-ignore\n handleViewRef = (ref: Animatable.View<ViewProps, ViewStyle>) => this.view = ref;\n\n render() {\n return this.props.entryanimation ? (\n <Animatable.View\n animation={this.props.entryanimation}\n duration={this.props.duration}\n delay={this.props.delay}\n useNativeDriver={true}\n style={this.props.style}\n iterationCount={this.props.iterationCount}\n ref={this.handleViewRef}\n {...this.props.accessibilityProps}>\n {this.props.children}\n </Animatable.View>\n ): (<View style={this.props.style} {...this.props.accessibilityProps}>{this.props.children}</View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAO,KAAKC,UAAU,MAAM,yBAAyB;AACrD,SAASC,iCAAiC,QAAQ,yBAAyB;AAC3E,SAASC,IAAI,QAA8B,cAAc;AAEzD,eAAe,MAAMC,iBAAiB,CAAC;EAAAC,YAAA;IAAAC,eAAA,yBACX,IAAI;IAAAA,eAAA;IAAAA,eAAA,mBAEV,IAAI;IAAAA,eAAA,gBACP,IAAI;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,wBAGI,IAAI;IAAAA,eAAA;EAAA;AAE/B;AAEA,MAAMC,YAAiB,GAAG;EACxBC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,OAAO;EACdC,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE,QAAQ;EAChBC,UAAU,EAAE,YAAY;EACxBC,KAAK,EAAE,OAAO;EACdC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,QAAQ;EAChBC,QAAQ,EAAE,WAAW;EACrBC,YAAY,EAAE,aAAa;EAC3BC,YAAY,EAAE,gBAAgB;EAC9BC,aAAa,EAAE,eAAe;EAC9BC,UAAU,EAAE,eAAe;EAC3BC,MAAM,EAAE,SAAS;EACjBC,UAAU,EAAE,WAAW;EACvBC,aAAa,EAAE,cAAc;EAC7BC,UAAU,EAAE,cAAc;EAC1BC,aAAa,EAAE,iBAAiB;EAChCC,WAAW,EAAE,aAAa;EAC1BC,cAAc,EAAE,gBAAgB;EAChCC,QAAQ,EAAE,aAAa;EACvBC,WAAW,EAAE,gBAAgB;EAC7BC,OAAO,EAAE,UAAU;EACnBC,OAAO,EAAE,UAAU;EACnBC,YAAY,EAAE,eAAe;EAC7BC,WAAW,EAAE,YAAY;EACzBC,WAAW,EAAE,eAAe;EAC5BC,YAAY,E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,GAAG,EAAE,IAAI,CAACmB;IAAc,GACpB,IAAI,CAACpB,KAAK,CAACqB,kBAAkB,GAC/B,IAAI,CAACrB,KAAK,CAACsB,QACG,CAAC,gBAChBjF,KAAA,CAAAwE,aAAA,CAACrE,IAAI,EAAAsE,QAAA;MAACI,KAAK,EAAE,IAAI,CAAClB,KAAK,CAACkB;IAAM,GAAK,IAAI,CAAClB,KAAK,CAACqB,kBAAkB,GAAG,IAAI,CAACrB,KAAK,CAACsB,QAAe,CAAE;EACrG;AACF;AAAC3E,eAAA,CA7CYmD,YAAY,kBACkB;EACvCQ,QAAQ,EAAE;AACZ,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","Animatable","initializeRegistryWithDefinitions","View","AnimatedviewProps","constructor","_defineProperty","AnimationMap","bounce","flash","pulse","rotate","rubberBand","shake","swing","tada","wobble","bounceIn","bounceInDown","bounceInLeft","bounceInRight","bounceInUp","fadeIn","fadeInDown","fadeInDownBig","fadeInLeft","fadeInLeftBig","fadeInRight","fadeInRightBig","fadeInUp","fadeInUpBig","flipInX","flipInY","lightSpeedIn","slideInDown","slideInLeft","slideInRight","slideInUp","zoomIn","zoomInDown","zoomInLeft","zoomInRight","zoomInUp","CustomAnimationMap","transform","rotateY","rotateX","flipOutY","flipOutX","from","translateY","to","slideOutUp","slideOutDown","opacity","fadeOutDown","fadeOutUp","Animatedview","Component","props","ref","view","triggerEntry","animate","entryanimation","duration","then","endState","finished","triggerExit","exitanimation","render","createElement","_extends","animation","delay","useNativeDriver","style","iterationCount","handleViewRef","accessibilityProps","testID","children"],"sources":["animatedview.component.tsx"],"sourcesContent":["import React from 'react';\nimport * as Animatable from 'react-native-animatable';\nimport { initializeRegistryWithDefinitions } from 'react-native-animatable';\nimport { View, ViewProps, ViewStyle } from 'react-native';\n\nexport default class AnimatedviewProps {\n entryanimation?: string = null as any;\n children?: any;\n duration?: number = null as any;\n delay?: number = null as any;\n iterationCount?:any;\n style?: any;\n exitanimation?: string = null as any;\n accessibilityProps?: any;\n}\n\nconst AnimationMap: any = {\n bounce: 'bounce',\n flash: 'flash',\n pulse: 'pulse',\n rotate: 'rotate',\n rubberBand: 'rubberBand',\n shake: 'shake',\n swing: 'swing',\n tada: 'tada',\n wobble: 'wobble',\n bounceIn: 'bounceOut',\n bounceInDown: 'bounceOutUp',\n bounceInLeft: 'bounceOutRight',\n bounceInRight: 'bounceOutLeft',\n bounceInUp: 'bounceOutDown',\n fadeIn: 'fadeOut',\n fadeInDown: 'fadeOutUp',\n fadeInDownBig: 'fadeOutUpBig',\n fadeInLeft: 'fadeOutRight',\n fadeInLeftBig: 'fadeOutRightBig',\n fadeInRight: 'fadeOutLeft',\n fadeInRightBig: 'fadeOutLeftBig',\n fadeInUp: 'fadeOutDown',\n fadeInUpBig: 'fadeOutDownBig',\n flipInX: 'flipOutX',\n flipInY: 'flipOutY',\n lightSpeedIn: 'lightSpeedOut',\n slideInDown: 'slideOutUp',\n slideInLeft: 'slideOutRight',\n slideInRight: 'slideOutLeft',\n slideInUp: 'slideOutDown',\n zoomIn: 'zoomOut',\n zoomInDown: 'zoomOutUp',\n zoomInLeft: 'zoomOutRight',\n zoomInRight: 'zoomOutLeft',\n zoomInUp: 'zoomOutDown'\n};\n\nconst CustomAnimationMap: any = {\n flipInY: {\n 0: {\n transform: [{rotateY: \"0deg\"}]\n },\n 1: {\n transform: [{rotateY: \"360deg\"}]\n }\n },\n flipInX: {\n 0: {\n transform: [{rotateX: \"0deg\"}]\n },\n 1: {\n transform: [{rotateX: \"360deg\"}]\n }\n },\n flipOutY: {\n 0: {\n transform: [{rotateY: \"3600deg\"}]\n },\n 1: {\n transform: [{rotateY: \"0deg\"}]\n }\n },\n flipOutX: {\n 0: {\n transform: [{rotateX: \"360deg\"}]\n },\n 1: {\n transform: [{rotateX: \"0deg\"}]\n }\n },\n slideInDown : {\n from: { translateY: -20 },\n to: { translateY: 0 }\n },\n slideInUp : {\n from: { translateY: 20 },\n to: { translateY: 0 }\n },\n slideOutUp: {\n from: { translateY: 0 },\n to: { translateY: -20 }\n },\n slideOutDown : {\n from: { translateY: 0 },\n to: { translateY: 20 }\n },\n fadeInDown: {\n from: { opacity: 0, translateY: -20 },\n to: { opacity: 1, translateY: 0 }\n },\n fadeInUp: {\n from: { opacity: 0, translateY: 20 },\n to: { opacity: 1, translateY: 0 }\n },\n fadeOutDown: {\n from: { opacity: 1, translateY: 0 },\n to: { opacity: 0, translateY: 20 }\n },\n fadeOutUp: {\n from: { opacity: 1, translateY: 0 },\n to: { opacity: 0, translateY: -20 }\n }\n};\n\nexport class Animatedview extends React.Component<AnimatedviewProps> {\n static defaultProps: AnimatedviewProps = {\n duration: 200\n };\n\n private view: Animatable.View = null as any;\n\n constructor(props: AnimatedviewProps) {\n super(props);\n initializeRegistryWithDefinitions(CustomAnimationMap);\n }\n\n triggerEntry() {\n return (this as any).view.animate(this.props.entryanimation, this.props.duration).then((endState: any) => endState.finished)\n }\n\n triggerExit() {\n if (!this.view) {\n return;\n }\n if (this.props.exitanimation) {\n return (this as any).view.animate(this.props.exitanimation, this.props.duration, 1).then((endState: any) => endState.finished)\n } else {\n return (this as any).view.animate(AnimationMap[this.props.entryanimation || ''], this.props.duration, 1).then((endState: any) => endState.finished)\n }\n }\n\n // @ts-ignore\n handleViewRef = (ref: Animatable.View<ViewProps, ViewStyle>) => this.view = ref;\n\n render() {\n return this.props.entryanimation ? (\n <Animatable.View\n animation={this.props.entryanimation}\n duration={this.props.duration}\n delay={this.props.delay}\n useNativeDriver={true}\n style={this.props.style}\n iterationCount={this.props.iterationCount}\n ref={this.handleViewRef}\n {...this.props.accessibilityProps}\n testID=\"animatableView\"\n >\n {this.props.children}\n </Animatable.View>\n ): (<View style={this.props.style} {...this.props.accessibilityProps} testID=\"non_animatableView\">{this.props.children}</View>);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAO,KAAKC,UAAU,MAAM,yBAAyB;AACrD,SAASC,iCAAiC,QAAQ,yBAAyB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K,EAAE,IAAI,CAAClB,KAAK,CAACkB;IAAM,GAAK,IAAI,CAAClB,KAAK,CAACqB,kBAAkB;MAAEC,MAAM,EAAC;IAAoB,IAAE,IAAI,CAACtB,KAAK,CAACuB,QAAe,CAAE;EACjI;AACF;AAAC5E,eAAA,CA/CYmD,YAAY,kBACkB;EACvCQ,QAAQ,EAAE;AACZ,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["React","Platform","Text","View","Slider","isString","Audio","BaseComponent","BaseComponentState","WmAudioProps","DEFAULT_CLASS","WmIcon","isWebPreviewMode","WmAudioState","constructor","args","_defineProperty","WmAudio","props","onPropertyChange","name","$new","$old","initialized","Promise","resolve","then","_this$sound","sound","unloadAsync","onSeekChange","state","playing","autoplay","play","getSource","source","loadAsset","mp3format","uri","addPadding","str","maxLen","pad","length","formatTime","v","t","mins","Math","floor","seconds","round","setTimer","cancelTimer","timer","setInterval","currentTime","totalTime","loop","replay","stop","setState","max","offsetTime","clearInterval","_this$sound2","pause","updateState","replayAsync","loading","playAsync","Sound","createAsync","isMuted","muted","res","getStatusAsync","status","catch","_this$sound3","pauseAsync","mute","setStatusAsync","unmute","time","_this$sound4","setPositionAsync","componentDidMount","setTimeout","componentWillUnmount","renderWidget","controls","createElement","style","styles","root","_background","id","getTestId","playIcon","iconclass","onTap","pauseIcon","text","testID","step","flex","value","disabled","onValueChange","bind","minimumValue","inverted","isRTL","OS","maximumValue","thumbTintColor","slider","thumb","backgroundColor","minimumTrackTintColor","minimumTrack","maximumTrackTintColor","maximumTrack","muteIcon","unmuteIcon"],"sources":["audio.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform, Text, View } from 'react-native';\nimport Slider from '@react-native-community/slider';\nimport { isString } from 'lodash-es';\nimport { Audio } from 'expo-av';\nimport { Sound } from 'expo-av/build/Audio';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmAudioProps from './audio.props';\nimport { DEFAULT_CLASS, WmAudioStyles } from './audio.styles';\nimport WmIcon from '../icon/icon.component';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\n\nexport class WmAudioState extends BaseComponentState<WmAudioProps> {\n playing = false;\n currentTime = 0;\n totalTime = 0;\n}\n\nexport default class WmAudio extends BaseComponent<WmAudioProps, WmAudioState, WmAudioStyles> {\n\n private loading = false;\n private sound: Sound = null as any;\n private timer: any;\n private offsetTime = 0;\n\n constructor(props: WmAudioProps) {\n super(props, DEFAULT_CLASS, new WmAudioProps(), new WmAudioState());\n }\n\n onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch(name) {\n case 'mp3format': {\n if (this.initialized) {\n Promise.resolve()\n .then(() => this.sound?.unloadAsync())\n .then(() => {\n this.sound = null as any;\n this.onSeekChange(0);\n if (this.state.playing \n || this.state.props.autoplay) {\n this.play();\n }\n });\n }\n }\n break;\n case 'autoplay':\n if (this.initialized && $new) {\n this.play();\n }\n }\n }\n\n getSource() {\n const source = this.loadAsset \n && this.state.props.mp3format\n && this.loadAsset(this.state.props.mp3format as string);\n if (isString(source)) {\n return {\n uri: source\n };\n }\n return source;\n }\n\n addPadding(str: string, maxLen: number, pad = '0'): string {\n if (str.length < maxLen) {\n return this.addPadding(pad + str, maxLen, pad);\n }\n return str;\n }\n\n formatTime(v: number) {\n const t = v/60;\n const mins = Math.floor(t);\n const seconds = Math.round((t - mins) * 60);\n return this.addPadding(mins+ '', 2) + ':' + this.addPadding(seconds+ '', 2);\n }\n\n setTimer() {\n this.cancelTimer();\n this.timer = setInterval(() => {\n if (this.state.currentTime >= this.state.totalTime) {\n if (this.state.props.loop) {\n this.replay();\n } else {\n this.stop();\n }\n return;\n }\n this.setState({\n currentTime: Math.max(this.offsetTime + this.state.currentTime + 1, 0)\n } as WmAudioState);\n this.offsetTime = 0;\n }, 1000);\n }\n\n cancelTimer() {\n clearInterval(this.timer);\n }\n\n stop() {\n this.pause();\n this.sound?.unloadAsync();\n this.sound = null as any;\n this.cancelTimer();\n this.offsetTime = 0;\n this.updateState({\n currentTime: 0\n } as WmAudioState);\n }\n\n replay() {\n this.updateState({\n currentTime: 0\n } as WmAudioState, () => {\n this.sound.replayAsync();\n });\n }\n\n play() {\n if (isWebPreviewMode() \n || this.loading\n || (this.state.playing && this.sound)) {\n return;\n }\n if (this.sound) {\n this.sound.playAsync();\n this.setTimer();\n this.updateState({\n playing: true\n } as WmAudioState);\n } else {\n this.loading = true;\n const source = this.getSource();\n source && Audio.Sound.createAsync(source, {\n isMuted: this.state.props.muted\n })\n .then((res) => {\n this.sound = res.sound;\n this.sound.playAsync();\n this.sound.getStatusAsync().then((status: any) => {\n this.updateState({\n currentTime: 0,\n totalTime: Math.round(status['durationMillis']/1000)\n } as WmAudioState, () => this.setTimer());\n });\n this.updateState({\n playing: true\n } as WmAudioState);\n }).catch(() => {}).then(() => {\n this.loading = false;\n });\n }\n }\n\n pause() {\n this.cancelTimer();\n this.sound?.pauseAsync().then(() => {\n this.updateState({\n playing: false\n } as WmAudioState);\n })\n }\n\n mute() {\n this.sound.setStatusAsync({\n isMuted: true\n }).then(() => {\n this.updateState({\n props: {\n muted: true\n }\n } as WmAudioState);\n });\n }\n\n unmute() {\n this.sound.setStatusAsync({\n isMuted: false\n }).then(() => {\n this.updateState({\n props: {\n muted: false\n }\n } as WmAudioState);\n });\n }\n\n onSeekChange(time: number) {\n if (time !== this.state.currentTime) {\n this.offsetTime = time - this.state.currentTime;\n this.sound?.setPositionAsync(time * 1000);\n }\n }\n\n componentDidMount(): void {\n super.componentDidMount();\n //without settimeout, app is crashing with errors\n setTimeout(() => {\n if (this.state.props.autoplay) {\n this.play();\n }\n }, 1000);\n }\n\n componentWillUnmount(): void {\n super.componentWillUnmount();\n this.stop();\n }\n\n renderWidget(props: WmAudioProps) {\n return props.controls ? (\n <View style={this.styles.root}>\n {this._background}\n {!this.state.playing ? (<WmIcon \n id={this.getTestId('play')}\n name={props.name + \"_play\"}\n styles={this.styles.playIcon}\n iconclass=\"wi wi-play-arrow fa-2x\"\n onTap={() => this.play()}></WmIcon>) : (\n <WmIcon name={props.name + \"_pause\"}\n id={this.getTestId('pause')}\n iconclass=\"wi wi-pause fa-2x\"\n styles={this.styles.pauseIcon}\n onTap={() => this.pause()}></WmIcon>)}\n <Text style={this.styles.text}>\n {`${this.formatTime(this.state.currentTime)} / ${this.formatTime(this.state.totalTime)}`}\n </Text>\n <Slider\n testID={this.getTestId('slider')}\n step={1}\n style={{flex: 1}}\n value={this.state.currentTime}\n disabled={isWebPreviewMode()}\n onValueChange={this.onSeekChange.bind(this)}\n minimumValue={0}\n inverted={this.isRTL && (Platform.OS==\"android\" || Platform.OS==\"web\")}\n maximumValue={this.state.totalTime || 1}\n thumbTintColor={this.styles.slider.thumb.backgroundColor as string}\n minimumTrackTintColor={this.styles.slider.minimumTrack.backgroundColor as string}\n maximumTrackTintColor={this.styles.slider.maximumTrack.backgroundColor as string}\n />\n {!props.muted ? (<WmIcon name={props.name + \"_mute\"}\n id={this.getTestId('mute')}\n iconclass=\"wi wi-volume-up fa-2x\"\n styles={this.styles.muteIcon}\n onTap={() => this.mute()}></WmIcon>) :\n (<WmIcon name={props.name + \"_unmute\"}\n id={this.getTestId('unmute')}\n iconclass=\"wi wi-volume-off fa-2x\"\n styles={this.styles.unmuteIcon}\n onTap={() => this.unmute()}></WmIcon>)}\n </View>) : null; \n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACnD,OAAOC,MAAM,MAAM,gCAAgC;AACnD,SAASC,QAAQ,QAAQ,WAAW;AACpC,SAASC,KAAK,QAAQ,SAAS;AAE/B,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,YAAY,MAAM,eAAe;AACxC,SAASC,aAAa,QAAuB,gBAAgB;AAC7D,OAAOC,MAAM,MAAM,wBAAwB;AAC3C,SAAS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C,wBAAwB;MAClCN,MAAM,EAAE,IAAI,CAACA,MAAM,CAAC+B,UAAW;MAC/BxB,KAAK,EAAEA,CAAA,KAAM,IAAI,CAAClB,MAAM,CAAC;IAAE,CAAS,CAClC,CAAC,GAAI,IAAI;EACnB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","Platform","Text","View","Slider","isString","Audio","BaseComponent","BaseComponentState","WmAudioProps","DEFAULT_CLASS","WmIcon","isWebPreviewMode","WmAudioState","constructor","args","_defineProperty","WmAudio","props","onPropertyChange","name","$new","$old","initialized","Promise","resolve","then","_this$sound","sound","unloadAsync","onSeekChange","state","playing","autoplay","play","getSource","source","loadAsset","mp3format","uri","addPadding","str","maxLen","pad","length","formatTime","v","t","mins","Math","floor","seconds","round","setTimer","cancelTimer","timer","setInterval","currentTime","totalTime","loop","replay","stop","setState","max","offsetTime","clearInterval","_this$sound2","pause","updateState","replayAsync","loading","playAsync","Sound","createAsync","isMuted","muted","res","getStatusAsync","status","catch","_this$sound3","pauseAsync","mute","setStatusAsync","unmute","time","_this$sound4","setPositionAsync","componentDidMount","setTimeout","componentWillUnmount","renderWidget","controls","createElement","style","styles","root","_background","id","getTestId","playIcon","iconclass","onTap","pauseIcon","text","testID","step","flex","value","disabled","onValueChange","bind","minimumValue","inverted","isRTL","OS","maximumValue","thumbTintColor","slider","thumb","backgroundColor","minimumTrackTintColor","minimumTrack","maximumTrackTintColor","maximumTrack","muteIcon","unmuteIcon"],"sources":["audio.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform, Text, View } from 'react-native';\nimport Slider from '@react-native-community/slider';\nimport { isString } from 'lodash-es';\nimport { Audio } from 'expo-av';\nimport { Sound } from 'expo-av/build/Audio';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmAudioProps from './audio.props';\nimport { DEFAULT_CLASS, WmAudioStyles } from './audio.styles';\nimport WmIcon from '../icon/icon.component';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\n\nexport class WmAudioState extends BaseComponentState<WmAudioProps> {\n playing = false;\n currentTime = 0;\n totalTime = 0;\n}\n\nexport default class WmAudio extends BaseComponent<WmAudioProps, WmAudioState, WmAudioStyles> {\n\n private loading = false;\n private sound: Sound = null as any;\n private timer: any;\n private offsetTime = 0;\n\n constructor(props: WmAudioProps) {\n super(props, DEFAULT_CLASS, new WmAudioProps(), new WmAudioState());\n }\n\n onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch(name) {\n case 'mp3format': {\n if (this.initialized) {\n Promise.resolve()\n .then(() => this.sound?.unloadAsync())\n .then(() => {\n this.sound = null as any;\n this.onSeekChange(0);\n if (this.state.playing \n || this.state.props.autoplay) {\n this.play();\n }\n });\n }\n }\n break;\n case 'autoplay':\n if (this.initialized && $new) {\n this.play();\n }\n }\n }\n\n getSource() {\n const source = this.loadAsset \n && this.state.props.mp3format\n && this.loadAsset(this.state.props.mp3format as string);\n if (isString(source)) {\n return {\n uri: source\n };\n }\n return source;\n }\n\n addPadding(str: string, maxLen: number, pad = '0'): string {\n if (str.length < maxLen) {\n return this.addPadding(pad + str, maxLen, pad);\n }\n return str;\n }\n\n formatTime(v: number) {\n const t = v/60;\n const mins = Math.floor(t);\n const seconds = Math.round((t - mins) * 60);\n return this.addPadding(mins+ '', 2) + ':' + this.addPadding(seconds+ '', 2);\n }\n\n setTimer() {\n this.cancelTimer();\n this.timer = setInterval(() => {\n if (this.state.currentTime >= this.state.totalTime) {\n if (this.state.props.loop) {\n this.replay();\n } else {\n this.stop();\n }\n return;\n }\n this.setState({\n currentTime: Math.max(this.offsetTime + this.state.currentTime + 1, 0)\n } as WmAudioState);\n this.offsetTime = 0;\n }, 1000);\n }\n\n cancelTimer() {\n clearInterval(this.timer);\n }\n\n stop() {\n this.pause();\n this.sound?.unloadAsync();\n this.sound = null as any;\n this.cancelTimer();\n this.offsetTime = 0;\n this.updateState({\n currentTime: 0\n } as WmAudioState);\n }\n\n replay() {\n this.updateState({\n currentTime: 0\n } as WmAudioState, () => {\n this.sound.replayAsync();\n });\n }\n\n play() {\n if (isWebPreviewMode() \n || this.loading\n || (this.state.playing && this.sound)) {\n return;\n }\n if (this.sound) {\n this.sound.playAsync();\n this.setTimer();\n this.updateState({\n playing: true\n } as WmAudioState);\n } else {\n this.loading = true;\n const source = this.getSource();\n source && Audio.Sound.createAsync(source, {\n isMuted: this.state.props.muted\n })\n .then((res) => {\n this.sound = res.sound;\n this.sound.playAsync();\n this.sound.getStatusAsync().then((status: any) => {\n this.updateState({\n currentTime: 0,\n totalTime: Math.round(status['durationMillis']/1000)\n } as WmAudioState, () => this.setTimer());\n });\n this.updateState({\n playing: true\n } as WmAudioState);\n }).catch(() => {}).then(() => {\n this.loading = false;\n });\n }\n }\n\n pause() {\n this.cancelTimer();\n this.sound?.pauseAsync().then(() => {\n this.updateState({\n playing: false\n } as WmAudioState);\n })\n }\n\n mute() {\n this.sound.setStatusAsync({\n isMuted: true\n }).then(() => {\n this.updateState({\n props: {\n muted: true\n }\n } as WmAudioState);\n });\n }\n\n unmute() {\n this.sound.setStatusAsync({\n isMuted: false\n }).then(() => {\n this.updateState({\n props: {\n muted: false\n }\n } as WmAudioState);\n });\n }\n\n onSeekChange(time: number) {\n if (time !== this.state.currentTime) {\n this.offsetTime = time - this.state.currentTime;\n this.sound?.setPositionAsync(time * 1000);\n }\n }\n\n componentDidMount(): void {\n super.componentDidMount();\n //without settimeout, app is crashing with errors\n setTimeout(() => {\n if (this.state.props.autoplay) {\n this.play();\n }\n }, 1000);\n }\n\n componentWillUnmount(): void {\n super.componentWillUnmount();\n this.stop();\n }\n\n renderWidget(props: WmAudioProps) {\n return props.controls ? (\n <View style={this.styles.root}>\n {this._background}\n {!this.state.playing ? (<WmIcon \n id={this.getTestId('play')}\n name={props.name + \"_play\"}\n styles={this.styles.playIcon}\n iconclass=\"wi wi-play-arrow fa-2x\"\n onTap={() => this.play()}></WmIcon>) : (\n <WmIcon name={props.name + \"_pause\"}\n id={this.getTestId('pause')}\n iconclass=\"wi wi-pause fa-2x\"\n styles={this.styles.pauseIcon}\n onTap={() => this.pause()}></WmIcon>)}\n <Text style={this.styles.text}>\n {`${this.formatTime(this.state.currentTime)} / ${this.formatTime(this.state.totalTime)}`}\n </Text>\n <Slider\n testID={this.getTestId('slider')}\n step={1}\n style={{flex: 1}}\n value={this.state.currentTime}\n disabled={isWebPreviewMode()}\n onValueChange={this.onSeekChange.bind(this)}\n minimumValue={0}\n inverted={this.isRTL && (Platform.OS==\"android\" || Platform.OS==\"web\")}\n maximumValue={this.state.totalTime || 1}\n thumbTintColor={this.styles.slider.thumb.backgroundColor as string}\n minimumTrackTintColor={this.styles.slider.minimumTrack.backgroundColor as string}\n maximumTrackTintColor={this.styles.slider.maximumTrack.backgroundColor as string}\n />\n {!props.muted ? (<WmIcon name={props.name + \"_mute\"}\n id={this.getTestId('mute')}\n iconclass=\"wi wi-volume-up fa-2x\"\n styles={this.styles.muteIcon}\n onTap={() => this.mute()}></WmIcon>) :\n (<WmIcon name={props.name + \"_unmute\"}\n id={this.getTestId('unmute')}\n iconclass=\"wi wi-volume-off fa-2x\"\n styles={this.styles.unmuteIcon}\n onTap={() => this.unmute()}></WmIcon>)}\n </View>) : null; \n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACnD,OAAOC,MAAM,MAAM,gCAAgC;AACnD,SAASC,QAAQ,QAAQ,WAAW;AACpC,SAASC,KAAK,QAAQ,SAAS;AAE/B,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,YAAY,MAAM,eAAe;AACxC,SAASC,aAAa,QAAuB,gBAAgB;AAC7D,OAAOC,MAAM,MAAM,wBAAwB;AAC3C,SAASC,gBAAgB,QAAQ,sCAAsC;AAEvE,OAAO,MAAMC,YAAY,SAASL,kBAAkB,CAAe;EAAA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EAAEA,CAAA,KAAM,IAAI,CAAClB,MAAM,CAAC;IAAE,CAAS,CAClC,CAAC,GAAI,IAAI;EACnB;AACF","ignoreList":[]}
@@ -25,7 +25,8 @@ export default class WmButton extends BaseComponent {
25
25
  iconmargin,
26
26
  iconwidth
27
27
  }) {
28
- return iconclass || iconurl ? /*#__PURE__*/React.createElement(WmIcon, _extends({}, this.getTestPropsForLabel('icon'), {
28
+ return iconclass || iconurl ? /*#__PURE__*/React.createElement(WmIcon, {
29
+ id: this.getTestId('icon'),
29
30
  hint: hint,
30
31
  styles: this.styles.icon,
31
32
  name: `${name}_icon`,
@@ -35,13 +36,13 @@ export default class WmButton extends BaseComponent {
35
36
  iconheight: iconheight,
36
37
  iconmargin: iconmargin,
37
38
  iconwidth: iconwidth
38
- })) : null;
39
+ }) : null;
39
40
  }
40
41
  prepareBadge(props) {
41
42
  //@ts-ignore
42
- return /*#__PURE__*/React.createElement(Badge, {
43
+ return /*#__PURE__*/React.createElement(Badge, _extends({
43
44
  style: this.styles.badge
44
- }, props.badgevalue);
45
+ }, this.getTestProps('badge')), props.badgevalue);
45
46
  }
46
47
  renderSkeleton(prop) {
47
48
  return createSkeleton(this.theme, this.styles.skeleton, {
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","Tappable","Badge","WmButtonProps","DEFAULT_CLASS","WmIcon","Animatedview","createSkeleton","AccessibilityWidgetType","getAccessibilityProps","WmButtonState","WmButton","constructor","props","prepareIcon","iconclass","iconurl","hint","name","iconsize","iconheight","iconmargin","iconwidth","createElement","_extends","getTestPropsForLabel","styles","icon","prepareBadge","style","badge","badgevalue","renderSkeleton","prop","theme","skeleton","root","width","skeletonwidth","height","skeletonheight","renderWidget","Fragment","entryanimation","animation","delay","animationdelay","paddingTop","paddingBottom","paddingLeft","paddingRight","overflow","flexDirection","flex","_background","justifyContent","rippleColor","target","getTestPropsForAction","accessibilityProps","BUTTON","content","iconposition","caption","text","importantForAccessibility"],"sources":["button.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, 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';\nimport { Badge } from 'react-native-paper';\n\nimport WmButtonProps from './button.props';\nimport { DEFAULT_CLASS, WmButtonStyles } from './button.styles';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport { createSkeleton } from '../skeleton/skeleton.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\n\nexport class WmButtonState extends BaseComponentState<WmButtonProps> {\n\n}\n\nexport default class WmButton extends BaseComponent<WmButtonProps, WmButtonState, WmButtonStyles> {\n\n constructor(props: WmButtonProps) {\n super(props, DEFAULT_CLASS, new WmButtonProps());\n }\n\n private prepareIcon({\n iconclass,\n iconurl,\n hint,\n name,\n iconsize,\n iconheight,\n iconmargin,\n iconwidth,\n }: any) {\n return iconclass || iconurl\n ? (<WmIcon\n {...this.getTestPropsForLabel('icon')}\n hint={hint}\n styles={this.styles.icon}\n name={`${name}_icon`}\n iconclass={iconclass}\n iconsize={iconsize}\n iconurl={iconurl}\n iconheight={iconheight}\n iconmargin={iconmargin}\n iconwidth={iconwidth}\n />): null;\n }\n\n private prepareBadge(props: any) {\n //@ts-ignore\n return (<Badge style={this.styles.badge}>{props.badgevalue}</Badge>);\n }\n\n public renderSkeleton(prop: WmButtonProps) {\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: (this.props.skeletonwidth || this.styles.root.width)as DimensionValue,\n height: (this.props.skeletonheight || this.styles.root.height) as DimensionValue\n });\n }\n\n renderWidget(props: WmButtonProps) {\n return (\n <>\n <Animatedview entryanimation={props.animation} delay={props.animationdelay}\n style={[\n this.styles.root,\n {\n paddingTop: 0,\n paddingBottom: 0,\n paddingLeft: 0,\n paddingRight: 0,\n overflow: 'hidden',\n flexDirection: 'column'\n },\n this.styles.root.height == \"100%\" ? {flex: 1}:{}\n ]}\n // accessibilityProps={{...getAccessibilityProps(\n // AccessibilityWidgetType.BUTTON,\n // props\n // )}}\n >\n {this._background}\n <Tappable\n styles={{\n paddingTop: this.styles.root.paddingTop,\n paddingBottom: this.styles.root.paddingBottom,\n paddingLeft: this.styles.root.paddingLeft,\n paddingRight: this.styles.root.paddingRight,\n width: '100%',\n height: this.styles.root.height ? '100%' : null,\n justifyContent: 'center',\n }}\n rippleColor = {this.styles.root.rippleColor}\n target={this}\n {...this.getTestPropsForAction()}\n accessibilityProps={{...getAccessibilityProps(\n AccessibilityWidgetType.BUTTON,\n props\n )}}>\n <View\n style={[\n this.styles.content,\n { flexDirection: props.iconposition === 'top' ? 'column' : 'row' }\n ]}>\n {props.iconposition === 'top' && this.prepareIcon(props)}\n {props.iconposition === 'left' && this.prepareIcon(props)}\n {props.caption ? (\n <Text\n style={this.styles.text}\n {...this.getTestPropsForLabel('caption')}\n importantForAccessibility={'no'}\n // accessibilityLabel={`${props.caption}`}\n >\n {props.caption}\n </Text>\n ) : null}\n {props.iconposition === 'right' && this.prepareIcon(props)}\n </View>\n </Tappable>\n </Animatedview>\n {props.badgevalue && this.prepareBadge(props)}\n </>\n );\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzD,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,KAAK,QAAQ,oBAAoB;AAE1C,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAASC,YAAY,QAAQ,mEAAmE;AAChG,SAASC,cAAc,QAAQ,gCAAgC;AAC/D,SAASC,uBAAuB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AW,EAAI,IAAI,CAAC9B,MAAM,CAACU,IAAI,CAACoB,WAAY;MAC5CC,MAAM,EAAE;IAAK,GACT,IAAI,CAACC,qBAAqB,CAAC,CAAC;MAChCC,kBAAkB,EAAE;QAAC,GAAGlD,qBAAqB,CAC3CD,uBAAuB,CAACoD,MAAM,EAC9B/C,KACF;MAAC;IAAE,iBACHjB,KAAA,CAAA2B,aAAA,CAACzB,IAAI;MACH+B,KAAK,EAAE,CACL,IAAI,CAACH,MAAM,CAACmC,OAAO,EACnB;QAAET,aAAa,EAAEvC,KAAK,CAACiD,YAAY,KAAK,KAAK,GAAG,QAAQ,GAAG;MAAM,CAAC;IAClE,GACDjD,KAAK,CAACiD,YAAY,KAAK,KAAK,IAAI,IAAI,CAAChD,WAAW,CAACD,KAAK,CAAC,EACvDA,KAAK,CAACiD,YAAY,KAAK,MAAM,IAAI,IAAI,CAAChD,WAAW,CAACD,KAAK,CAAC,EACxDA,KAAK,CAACkD,OAAO,gBACZnE,KAAA,CAAA2B,aAAA,CAAC1B,IAAI,EAAA2B,QAAA;MACHK,KAAK,EAAE,IAAI,CAACH,MAAM,CAACsC;IAAK,GACpB,IAAI,CAACvC,oBAAoB,CAAC,SAAS,CAAC;MACxCwC,yBAAyB,EAAE;MAC3B;IAAA,IAECpD,KAAK,CAACkD,OACH,CAAC,GACL,IAAI,EACPlD,KAAK,CAACiD,YAAY,KAAK,OAAO,IAAI,IAAI,CAAChD,WAAW,CAACD,KAAK,CACrD,CACE,CACE,CAAC,EACdA,KAAK,CAACkB,UAAU,IAAI,IAAI,CAACH,YAAY,CAACf,KAAK,CAC1C,CAAC;EAEP;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","Tappable","Badge","WmButtonProps","DEFAULT_CLASS","WmIcon","Animatedview","createSkeleton","AccessibilityWidgetType","getAccessibilityProps","WmButtonState","WmButton","constructor","props","prepareIcon","iconclass","iconurl","hint","name","iconsize","iconheight","iconmargin","iconwidth","createElement","id","getTestId","styles","icon","prepareBadge","_extends","style","badge","getTestProps","badgevalue","renderSkeleton","prop","theme","skeleton","root","width","skeletonwidth","height","skeletonheight","renderWidget","Fragment","entryanimation","animation","delay","animationdelay","paddingTop","paddingBottom","paddingLeft","paddingRight","overflow","flexDirection","flex","_background","justifyContent","rippleColor","target","getTestPropsForAction","accessibilityProps","BUTTON","content","iconposition","caption","text","getTestPropsForLabel","importantForAccessibility"],"sources":["button.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, 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';\nimport { Badge } from 'react-native-paper';\n\nimport WmButtonProps from './button.props';\nimport { DEFAULT_CLASS, WmButtonStyles } from './button.styles';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { Animatedview } from '@wavemaker/app-rn-runtime/components/basic/animatedview.component';\nimport { createSkeleton } from '../skeleton/skeleton.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\n\nexport class WmButtonState extends BaseComponentState<WmButtonProps> {\n\n}\n\nexport default class WmButton extends BaseComponent<WmButtonProps, WmButtonState, WmButtonStyles> {\n\n constructor(props: WmButtonProps) {\n super(props, DEFAULT_CLASS, new WmButtonProps());\n }\n\n private prepareIcon({\n iconclass,\n iconurl,\n hint,\n name,\n iconsize,\n iconheight,\n iconmargin,\n iconwidth,\n }: any) {\n return iconclass || iconurl\n ? (<WmIcon\n id={this.getTestId('icon')}\n hint={hint}\n styles={this.styles.icon}\n name={`${name}_icon`}\n iconclass={iconclass}\n iconsize={iconsize}\n iconurl={iconurl}\n iconheight={iconheight}\n iconmargin={iconmargin}\n iconwidth={iconwidth}\n />): null;\n }\n\n private prepareBadge(props: any) {\n //@ts-ignore\n return (<Badge style={this.styles.badge} {...this.getTestProps('badge')}>{props.badgevalue}</Badge>);\n }\n\n public renderSkeleton(prop: WmButtonProps) {\n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n width: (this.props.skeletonwidth || this.styles.root.width)as DimensionValue,\n height: (this.props.skeletonheight || this.styles.root.height) as DimensionValue\n });\n }\n\n renderWidget(props: WmButtonProps) {\n return (\n <>\n <Animatedview entryanimation={props.animation} delay={props.animationdelay}\n style={[\n this.styles.root,\n {\n paddingTop: 0,\n paddingBottom: 0,\n paddingLeft: 0,\n paddingRight: 0,\n overflow: 'hidden',\n flexDirection: 'column'\n },\n this.styles.root.height == \"100%\" ? {flex: 1}:{}\n ]}\n // accessibilityProps={{...getAccessibilityProps(\n // AccessibilityWidgetType.BUTTON,\n // props\n // )}}\n >\n {this._background}\n <Tappable\n styles={{\n paddingTop: this.styles.root.paddingTop,\n paddingBottom: this.styles.root.paddingBottom,\n paddingLeft: this.styles.root.paddingLeft,\n paddingRight: this.styles.root.paddingRight,\n width: '100%',\n height: this.styles.root.height ? '100%' : null,\n justifyContent: 'center',\n }}\n rippleColor = {this.styles.root.rippleColor}\n target={this}\n {...this.getTestPropsForAction()}\n accessibilityProps={{...getAccessibilityProps(\n AccessibilityWidgetType.BUTTON,\n props\n )}}>\n <View\n style={[\n this.styles.content,\n { flexDirection: props.iconposition === 'top' ? 'column' : 'row' }\n ]}>\n {props.iconposition === 'top' && this.prepareIcon(props)}\n {props.iconposition === 'left' && this.prepareIcon(props)}\n {props.caption ? (\n <Text\n style={this.styles.text}\n {...this.getTestPropsForLabel('caption')}\n importantForAccessibility={'no'}\n // accessibilityLabel={`${props.caption}`}\n >\n {props.caption}\n </Text>\n ) : null}\n {props.iconposition === 'right' && this.prepareIcon(props)}\n </View>\n </Tappable>\n </Animatedview>\n {props.badgevalue && this.prepareBadge(props)}\n </>\n );\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAyBC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzD,SAASC,aAAa,EAA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AClD,WAAW,CAACD,KAAK,CACrD,CACE,CACE,CAAC,EACdA,KAAK,CAACoB,UAAU,IAAI,IAAI,CAACL,YAAY,CAACf,KAAK,CAC1C,CAAC;EAEP;AACF","ignoreList":[]}
@@ -179,11 +179,11 @@ export default class WmIcon extends BaseComponent {
179
179
  const iconSize = props.iconsize || this.styles.root.fontSize || this.styles.text.fontSize || iconDef.size;
180
180
  if (props.show && iconDef && iconDef.isFontAwesome) {
181
181
  //@ts-ignore type information is not matching
182
- iconJsx = /*#__PURE__*/React.createElement(FontAwesome, {
182
+ iconJsx = /*#__PURE__*/React.createElement(FontAwesome, _extends({
183
183
  name: customIcon ? '' : iconDef.type,
184
184
  style: style,
185
185
  size: iconSize
186
- }, customIcon);
186
+ }, this.getTestProps('icon')), customIcon);
187
187
  } else if (props.show && iconDef) {
188
188
  var _this$styles$icon;
189
189
  let WMCustomIcon = WavIcon;
@@ -195,11 +195,11 @@ export default class WmIcon extends BaseComponent {
195
195
  return null;
196
196
  }
197
197
  //@ts-ignore type information is not matching
198
- iconJsx = WMCustomIcon ? /*#__PURE__*/React.createElement(WMCustomIcon, {
198
+ iconJsx = WMCustomIcon ? /*#__PURE__*/React.createElement(WMCustomIcon, _extends({
199
199
  name: customIcon ? '' : iconDef.type,
200
200
  style: style,
201
201
  size: iconSize
202
- }, customIcon) : null;
202
+ }, this.getTestProps('icon')), customIcon) : null;
203
203
  }
204
204
  if (iconJsx && iconDef.animation === 'spin') {
205
205
  const rotate = this.spinValue.interpolate({