@wavemaker-ai/app-rn-runtime 1.0.0-rc.647655 → 1.0.0-rc.647684

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/components/advanced/offline-banner/offline-banner.component.js +68 -0
  2. package/components/advanced/offline-banner/offline-banner.component.js.map +1 -0
  3. package/components/advanced/offline-banner/offline-banner.props.js +12 -0
  4. package/components/advanced/offline-banner/offline-banner.props.js.map +1 -0
  5. package/components/advanced/offline-banner/offline-banner.styles.js +99 -0
  6. package/components/advanced/offline-banner/offline-banner.styles.js.map +1 -0
  7. package/components/advanced/webview/webview.component.js +2 -2
  8. package/components/advanced/webview/webview.component.js.map +1 -1
  9. package/components/advanced/webview/webview.props.js +1 -1
  10. package/components/advanced/webview/webview.props.js.map +1 -1
  11. package/components/basic/anchor/anchor.component.js +4 -4
  12. package/components/basic/anchor/anchor.component.js.map +1 -1
  13. package/components/basic/anchor/anchor.props.js +1 -0
  14. package/components/basic/anchor/anchor.props.js.map +1 -1
  15. package/components/basic/icon/icon.component.js +29 -2
  16. package/components/basic/icon/icon.component.js.map +1 -1
  17. package/components/basic/icon/svg-url-icon.component.js +80 -0
  18. package/components/basic/icon/svg-url-icon.component.js.map +1 -0
  19. package/components/basic/search/search.component.js +3 -1
  20. package/components/basic/search/search.component.js.map +1 -1
  21. package/components/basic/search/search.props.js +3 -0
  22. package/components/basic/search/search.props.js.map +1 -1
  23. package/components/basic/spinner/spinner.component.js +1 -0
  24. package/components/basic/spinner/spinner.component.js.map +1 -1
  25. package/components/basic/spinner/spinner.props.js +1 -0
  26. package/components/basic/spinner/spinner.props.js.map +1 -1
  27. package/components/chart/area-chart/area-chart.component.js +95 -96
  28. package/components/chart/area-chart/area-chart.component.js.map +1 -1
  29. package/components/chart/area-chart/area-chart.props.js +2 -0
  30. package/components/chart/area-chart/area-chart.props.js.map +1 -1
  31. package/components/chart/bar-chart/bar-chart.component.js +89 -100
  32. package/components/chart/bar-chart/bar-chart.component.js.map +1 -1
  33. package/components/chart/basechart.component.js +117 -96
  34. package/components/chart/basechart.component.js.map +1 -1
  35. package/components/chart/basechart.props.js +13 -0
  36. package/components/chart/basechart.props.js.map +1 -1
  37. package/components/chart/basechart.styles.js +0 -1
  38. package/components/chart/basechart.styles.js.map +1 -1
  39. package/components/chart/bubble-chart/bubble-chart.component.js +93 -72
  40. package/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
  41. package/components/chart/bubble-chart/bubble-chart.props.js +1 -0
  42. package/components/chart/bubble-chart/bubble-chart.props.js.map +1 -1
  43. package/components/chart/line-chart/line-chart.component.js +112 -80
  44. package/components/chart/line-chart/line-chart.component.js.map +1 -1
  45. package/components/chart/pie-chart/pie-chart.component.js +92 -168
  46. package/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  47. package/components/chart/pie-chart/pie-chart.props.js +1 -0
  48. package/components/chart/pie-chart/pie-chart.props.js.map +1 -1
  49. package/components/container/accordion/accordion.component.js +11 -3
  50. package/components/container/accordion/accordion.component.js.map +1 -1
  51. package/components/container/accordion/accordion.props.js +2 -0
  52. package/components/container/accordion/accordion.props.js.map +1 -1
  53. package/components/container/accordion/accordionpane/accordionpane.component.js +6 -2
  54. package/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
  55. package/components/container/accordion/accordionpane/accordionpane.props.js +1 -0
  56. package/components/container/accordion/accordionpane/accordionpane.props.js.map +1 -1
  57. package/components/container/container.component.js +3 -0
  58. package/components/container/container.component.js.map +1 -1
  59. package/components/container/panel/panel.component.js +3 -1
  60. package/components/container/panel/panel.component.js.map +1 -1
  61. package/components/container/panel/panel.props.js +2 -0
  62. package/components/container/panel/panel.props.js.map +1 -1
  63. package/components/container/tabs/tabpane/tabpane.component.js +6 -2
  64. package/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
  65. package/components/container/wizard/wizard.component.js +7 -3
  66. package/components/container/wizard/wizard.component.js.map +1 -1
  67. package/components/container/wizard/wizard.props.js +1 -0
  68. package/components/container/wizard/wizard.props.js.map +1 -1
  69. package/components/container/wizard/wizardstep/wizardstep.component.js +6 -2
  70. package/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  71. package/components/container/wizard/wizardstep/wizardstep.props.js +3 -0
  72. package/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
  73. package/components/data/form/form.component.js +3 -2
  74. package/components/data/form/form.component.js.map +1 -1
  75. package/components/data/form/form.props.js +1 -0
  76. package/components/data/form/form.props.js.map +1 -1
  77. package/components/data/list/list-template/list-template.component.js +3 -0
  78. package/components/data/list/list-template/list-template.component.js.map +1 -1
  79. package/components/data/list/list.component.js +11 -7
  80. package/components/data/list/list.component.js.map +1 -1
  81. package/components/data/list/list.props.js +2 -0
  82. package/components/data/list/list.props.js.map +1 -1
  83. package/components/data/list/list.styles.js +1 -14
  84. package/components/data/list/list.styles.js.map +1 -1
  85. package/components/input/basedataset/basedataset.component.js +2 -1
  86. package/components/input/basedataset/basedataset.component.js.map +1 -1
  87. package/components/input/basedataset/basedataset.props.js +1 -0
  88. package/components/input/basedataset/basedataset.props.js.map +1 -1
  89. package/components/input/fileupload/fileupload.component.js +1 -0
  90. package/components/input/fileupload/fileupload.component.js.map +1 -1
  91. package/components/input/fileupload/fileupload.props.js +1 -0
  92. package/components/input/fileupload/fileupload.props.js.map +1 -1
  93. package/components/input/rating/rating.component.js +4 -2
  94. package/components/input/rating/rating.component.js.map +1 -1
  95. package/components/input/rating/rating.props.js +4 -0
  96. package/components/input/rating/rating.props.js.map +1 -1
  97. package/components/input/switch/switch.component.js +2 -1
  98. package/components/input/switch/switch.component.js.map +1 -1
  99. package/components/input/text/text.component.js +6 -3
  100. package/components/input/text/text.component.js.map +1 -1
  101. package/components/input/text/text.props.js +2 -0
  102. package/components/input/text/text.props.js.map +1 -1
  103. package/components/navigation/basenav/basenav.component.js +2 -0
  104. package/components/navigation/basenav/basenav.component.js.map +1 -1
  105. package/components/navigation/basenav/basenav.props.js +1 -0
  106. package/components/navigation/basenav/basenav.props.js.map +1 -1
  107. package/components/navigation/menu/menu.component.js +3 -0
  108. package/components/navigation/menu/menu.component.js.map +1 -1
  109. package/components/navigation/menu/menu.props.js +2 -0
  110. package/components/navigation/menu/menu.props.js.map +1 -1
  111. package/components/navigation/popover/popover.component.js +1 -0
  112. package/components/navigation/popover/popover.component.js.map +1 -1
  113. package/components/navigation/popover/popover.props.js +1 -0
  114. package/components/navigation/popover/popover.props.js.map +1 -1
  115. package/components/page/page-content/page-content.component.js +3 -0
  116. package/components/page/page-content/page-content.component.js.map +1 -1
  117. package/components/page/page-content/page-content.props.js +2 -0
  118. package/components/page/page-content/page-content.props.js.map +1 -1
  119. package/components/page/page.component.js +95 -2
  120. package/components/page/page.component.js.map +1 -1
  121. package/components/page/page.props.js +3 -0
  122. package/components/page/page.props.js.map +1 -1
  123. package/components/page/tabbar/tabbar.component.js +5 -3
  124. package/components/page/tabbar/tabbar.component.js.map +1 -1
  125. package/components/page/tabbar/tabbar.props.js +1 -0
  126. package/components/page/tabbar/tabbar.props.js.map +1 -1
  127. package/components-prism/basic/search/search.component.js +208 -0
  128. package/components-prism/basic/search/search.component.js.map +1 -0
  129. package/components-prism/basic/search/search.props.js +15 -0
  130. package/components-prism/basic/search/search.props.js.map +1 -0
  131. package/components-prism/basic/search/search.styles.js +127 -0
  132. package/components-prism/basic/search/search.styles.js.map +1 -0
  133. package/core/accessibility.js +9 -0
  134. package/core/accessibility.js.map +1 -1
  135. package/core/auto-layout.utils.js +59 -0
  136. package/core/auto-layout.utils.js.map +1 -1
  137. package/core/base.component.js +22 -1
  138. package/core/base.component.js.map +1 -1
  139. package/core/components/floatinglabel.component.js +2 -2
  140. package/core/components/floatinglabel.component.js.map +1 -1
  141. package/core/components/textinput.component.js +1 -0
  142. package/core/components/textinput.component.js.map +1 -1
  143. package/core/network.service.js.map +1 -1
  144. package/core/utils.js +16 -0
  145. package/core/utils.js.map +1 -1
  146. package/npm-shrinkwrap.json +707 -1504
  147. package/package-lock.json +707 -1504
  148. package/package.json +11 -6
  149. package/runtime/base-fragment.component.js +7 -1
  150. package/runtime/base-fragment.component.js.map +1 -1
  151. package/runtime/base-page.component.js +24 -0
  152. package/runtime/base-page.component.js.map +1 -1
  153. package/runtime/base-partial.component.js.map +1 -1
  154. package/variables/http.service.js +6 -1
  155. package/variables/http.service.js.map +1 -1
  156. package/variables/interceptor/intercept-context.impl.js +46 -0
  157. package/variables/interceptor/intercept-context.impl.js.map +1 -0
  158. package/variables/interceptor/interceptor.factory.js +78 -0
  159. package/variables/interceptor/interceptor.factory.js.map +1 -0
  160. package/variables/interceptor/persistent.storage.js +142 -0
  161. package/variables/interceptor/persistent.storage.js.map +1 -0
  162. package/variables/interceptor/service-variable-interceptor.js +52 -0
  163. package/variables/interceptor/service-variable-interceptor.js.map +1 -0
  164. package/variables/service-variable.js +109 -1
  165. package/variables/service-variable.js.map +1 -1
@@ -0,0 +1,68 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ import React from 'react';
3
+ import { View } from 'react-native';
4
+ import WmPicture from '@wavemaker-ai/app-rn-runtime/components/basic/picture/picture.component';
5
+ import WmLabel from '@wavemaker-ai/app-rn-runtime/components/basic/label/label.component';
6
+ import injector from '@wavemaker-ai/app-rn-runtime/core/injector';
7
+ import WmButton from '@wavemaker-ai/app-rn-runtime/components/basic/button/button.component';
8
+ import { BaseComponent, BaseComponentState } from '@wavemaker-ai/app-rn-runtime/core/base.component';
9
+ import WmOfflineBannerProps from './offline-banner.props';
10
+ import { DEFAULT_CLASS } from './offline-banner.styles';
11
+ import { SafeAreaInsetsContext } from 'react-native-safe-area-context';
12
+ import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';
13
+ class WMOfflineBannerState extends BaseComponentState {}
14
+ class OfflineBanner extends BaseComponent {
15
+ constructor(props) {
16
+ super(props, DEFAULT_CLASS, new WmOfflineBannerProps(), new WMOfflineBannerState());
17
+ }
18
+ renderWidget(props) {
19
+ var _appConfig$appLocale;
20
+ const appConfig = injector.get('APP_CONFIG');
21
+ const appLocale = (appConfig === null || appConfig === void 0 || (_appConfig$appLocale = appConfig.appLocale) === null || _appConfig$appLocale === void 0 ? void 0 : _appConfig$appLocale.messages) || {};
22
+ return /*#__PURE__*/React.createElement(SafeAreaInsetsContext.Consumer, null, (insets = {
23
+ top: 0,
24
+ bottom: 0,
25
+ left: 0,
26
+ right: 0
27
+ }) => {
28
+ var _appConfig$preference, _appConfig$preference2, _appConfig$preference3, _appConfig$preference4;
29
+ return /*#__PURE__*/React.createElement(View, _extends({
30
+ style: [{
31
+ paddingTop: insets === null || insets === void 0 ? void 0 : insets.top,
32
+ paddingBottom: insets === null || insets === void 0 ? void 0 : insets.bottom
33
+ }, this.styles.root]
34
+ }, getAccessibilityProps(AccessibilityWidgetType.OFFLINE_BANNER, {
35
+ accessibilitylabel: 'You are currently offline',
36
+ hint: 'Connection status notification'
37
+ })), /*#__PURE__*/React.createElement(View, {
38
+ style: this.styles.infoContainer
39
+ }, /*#__PURE__*/React.createElement(View, {
40
+ style: this.styles.imageContainer
41
+ }, /*#__PURE__*/React.createElement(WmPicture, {
42
+ picturesource: appConfig === null || appConfig === void 0 || (_appConfig$preference = appConfig.preferences) === null || _appConfig$preference === void 0 ? void 0 : _appConfig$preference.offlineImage,
43
+ resizemode: "contain",
44
+ name: "offline_picture",
45
+ classname: "offline-banner-image"
46
+ })), /*#__PURE__*/React.createElement(View, {
47
+ style: this.styles.textContainer
48
+ }, /*#__PURE__*/React.createElement(WmLabel, {
49
+ caption: appLocale.LABEL_OFFLINE_TITLE || (appConfig === null || appConfig === void 0 || (_appConfig$preference2 = appConfig.preferences) === null || _appConfig$preference2 === void 0 ? void 0 : _appConfig$preference2.offlineTitle) || 'No Internet connection',
50
+ classname: "offline-banner-message"
51
+ }), /*#__PURE__*/React.createElement(WmLabel, {
52
+ caption: appLocale.MESSAGE_OFFLINE_DESCRIPTION || (appConfig === null || appConfig === void 0 || (_appConfig$preference3 = appConfig.preferences) === null || _appConfig$preference3 === void 0 ? void 0 : _appConfig$preference3.offlineMessage) || 'You appear to be offline. Please check your internet connection.',
53
+ classname: "offline-banner-description"
54
+ }))), /*#__PURE__*/React.createElement(View, {
55
+ style: this.styles.buttonContainer
56
+ }, /*#__PURE__*/React.createElement(WmButton, {
57
+ caption: appLocale.LABEL_OFFLINE_RETRY || (appConfig === null || appConfig === void 0 || (_appConfig$preference4 = appConfig.preferences) === null || _appConfig$preference4 === void 0 ? void 0 : _appConfig$preference4.offlineRetry) || 'Try Again',
58
+ classname: "offline-banner-retry-button",
59
+ onTap: () => {
60
+ props.onRetry();
61
+ }
62
+ })));
63
+ });
64
+ }
65
+ }
66
+ ;
67
+ export default OfflineBanner;
68
+ //# sourceMappingURL=offline-banner.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","View","WmPicture","WmLabel","injector","WmButton","BaseComponent","BaseComponentState","WmOfflineBannerProps","DEFAULT_CLASS","SafeAreaInsetsContext","AccessibilityWidgetType","getAccessibilityProps","WMOfflineBannerState","OfflineBanner","constructor","props","renderWidget","_appConfig$appLocale","appConfig","get","appLocale","messages","createElement","Consumer","insets","top","bottom","left","right","_appConfig$preference","_appConfig$preference2","_appConfig$preference3","_appConfig$preference4","_extends","style","paddingTop","paddingBottom","styles","root","OFFLINE_BANNER","accessibilitylabel","hint","infoContainer","imageContainer","picturesource","preferences","offlineImage","resizemode","name","classname","textContainer","caption","LABEL_OFFLINE_TITLE","offlineTitle","MESSAGE_OFFLINE_DESCRIPTION","offlineMessage","buttonContainer","LABEL_OFFLINE_RETRY","offlineRetry","onTap","onRetry"],"sources":["offline-banner.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Alert, View } from 'react-native';\nimport WmPicture from '@wavemaker-ai/app-rn-runtime/components/basic/picture/picture.component';\nimport WmLabel from '@wavemaker-ai/app-rn-runtime/components/basic/label/label.component';\nimport AppConfig from '@wavemaker-ai/app-rn-runtime/core/AppConfig';\nimport injector from '@wavemaker-ai/app-rn-runtime/core/injector';\nimport WmButton from '@wavemaker-ai/app-rn-runtime/components/basic/button/button.component';\nimport { BaseComponent, BaseComponentState, BaseProps } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport WmOfflineBannerProps from './offline-banner.props';\nimport { DEFAULT_CLASS, WmOfflineBannerStyles } from './offline-banner.styles';\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\n\nclass WMOfflineBannerState extends BaseComponentState<WmOfflineBannerProps> {}\n\nclass OfflineBanner extends BaseComponent<WmOfflineBannerProps, WMOfflineBannerState, WmOfflineBannerStyles> {\n constructor(props: WmOfflineBannerProps) {\n super(props, DEFAULT_CLASS, new WmOfflineBannerProps(), new WMOfflineBannerState());\n }\n\n renderWidget(props: WmOfflineBannerProps) {\n\n const appConfig = injector.get<AppConfig>('APP_CONFIG');\n const appLocale = appConfig?.appLocale?.messages || {};\n\n return <SafeAreaInsetsContext.Consumer>\n {(insets = { top: 0, bottom: 0, left: 0, right: 0 }) => {\n return (\n <View\n style={[\n { paddingTop: insets?.top, paddingBottom: insets?.bottom },\n this.styles.root,\n ]}\n {...getAccessibilityProps(AccessibilityWidgetType.OFFLINE_BANNER, {\n accessibilitylabel: 'You are currently offline',\n hint: 'Connection status notification'\n })}\n >\n <View style={this.styles.infoContainer}>\n\n <View style={this.styles.imageContainer}>\n <WmPicture\n picturesource={appConfig?.preferences?.offlineImage}\n resizemode=\"contain\"\n name=\"offline_picture\"\n classname='offline-banner-image'\n />\n </View>\n <View style={this.styles.textContainer}>\n <WmLabel\n caption={appLocale.LABEL_OFFLINE_TITLE || appConfig?.preferences?.offlineTitle || 'No Internet connection'}\n classname='offline-banner-message'\n />\n <WmLabel\n caption={appLocale.MESSAGE_OFFLINE_DESCRIPTION || appConfig?.preferences?.offlineMessage || 'You appear to be offline. Please check your internet connection.'}\n classname='offline-banner-description'\n />\n </View>\n </View>\n <View style={this.styles.buttonContainer}>\n <WmButton\n caption={appLocale.LABEL_OFFLINE_RETRY || appConfig?.preferences?.offlineRetry || 'Try Again'}\n classname={\"offline-banner-retry-button\"}\n onTap={() => {\n props.onRetry();\n }}\n />\n </View>\n </View> )\n }}\n </SafeAreaInsetsContext.Consumer>\n }\n};\n\nexport default OfflineBanner;"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAiBC,IAAI,QAAQ,cAAc;AAC3C,OAAOC,SAAS,MAAM,yEAAyE;AAC/F,OAAOC,OAAO,MAAM,qEAAqE;AAEzF,OAAOC,QAAQ,MAAM,4CAA4C;AACjE,OAAOC,QAAQ,MAAM,uEAAuE;AAC5F,SAASC,aAAa,EAAEC,kBAAkB,QAAmB,kDAAkD;AAC/G,OAAOC,oBAAoB,MAAM,wBAAwB;AACzD,SAASC,aAAa,QAA+B,yBAAyB;AAC9E,SAAUC,qBAAqB,QAAQ,gCAAgC;AACvE,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,iDAAiD;AAEhH,MAAMC,oBAAoB,SAASN,kBAAkB,CAAuB;AAE5E,MAAMO,aAAa,SAASR,aAAa,CAAoE;EAC3GS,WAAWA,CAACC,KAA2B,EAAE;IACvC,KAAK,CAACA,KAAK,EAAEP,aAAa,EAAE,IAAID,oBAAoB,CAAC,CAAC,EAAE,IAAIK,oBAAoB,CAAC,CAAC,CAAC;EACrF;EAEAI,YAAYA,CAACD,KAA2B,EAAE;IAAA,IAAAE,oBAAA;IAExC,MAAMC,SAAS,GAAGf,QAAQ,CAACgB,GAAG,CAAY,YAAY,CAAC;IACvD,MAAMC,SAAS,GAAG,CAAAF,SAAS,aAATA,SAAS,gBAAAD,oBAAA,GAATC,SAAS,CAAEE,SAA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E,IAAI,CAACG,MAAM,CAACa;MAAc,gBACvCnD,KAAA,CAAAuB,aAAA,CAACpB,OAAO;QACNiD,OAAO,EAAE/B,SAAS,CAACgC,mBAAmB,KAAIlC,SAAS,aAATA,SAAS,gBAAAY,sBAAA,GAATZ,SAAS,CAAE2B,WAAW,cAAAf,sBAAA,uBAAtBA,sBAAA,CAAwBuB,YAAY,KAAI,wBAAyB;QAC3GJ,SAAS,EAAC;MAAwB,CACjC,CAAC,eACJlD,KAAA,CAAAuB,aAAA,CAACpB,OAAO;QACNiD,OAAO,EAAE/B,SAAS,CAACkC,2BAA2B,KAAIpC,SAAS,aAATA,SAAS,gBAAAa,sBAAA,GAATb,SAAS,CAAE2B,WAAW,cAAAd,sBAAA,uBAAtBA,sBAAA,CAAwBwB,cAAc,KAAI,kEAAmE;QAC/JN,SAAS,EAAC;MAA4B,CACrC,CACG,CACA,CAAC,eACPlD,KAAA,CAAAuB,aAAA,CAACtB,IAAI;QAACkC,KAAK,EAAE,IAAI,CAACG,MAAM,CAACmB;MAAgB,gBACzCzD,KAAA,CAAAuB,aAAA,CAAClB,QAAQ;QACP+C,OAAO,EAAE/B,SAAS,CAACqC,mBAAmB,KAAIvC,SAAS,aAATA,SAAS,gBAAAc,sBAAA,GAATd,SAAS,CAAE2B,WAAW,cAAAb,sBAAA,uBAAtBA,sBAAA,CAAwB0B,YAAY,KAAI,WAAY;QAChGT,SAAS,EAAE,6BAA8B;QACzCU,KAAK,EAAEA,CAAA,KAAM;UACX5C,KAAK,CAAC6C,OAAO,CAAC,CAAC;QAChB;MAAE,CACH,CACK,CACA,CAAC;IACR,CACgC,CAAC;EACnC;AACF;AAAC;AAED,eAAe/C,aAAa","ignoreList":[]}
@@ -0,0 +1,12 @@
1
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ 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); }
4
+ import { BaseProps } from '@wavemaker-ai/app-rn-runtime/core/base.component';
5
+ export default class WmOfflineBannerProps extends BaseProps {
6
+ constructor(...args) {
7
+ super(...args);
8
+ _defineProperty(this, "onRetry", null);
9
+ _defineProperty(this, "message", 'No Internet Connection');
10
+ }
11
+ }
12
+ //# sourceMappingURL=offline-banner.props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["BaseProps","WmOfflineBannerProps","constructor","args","_defineProperty"],"sources":["offline-banner.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker-ai/app-rn-runtime/core/base.component';\n\nexport default class WmOfflineBannerProps extends BaseProps {\n onRetry: () => void = null as any;\n message?: string = 'No Internet Connection';\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,kDAAkD;AAE5E,eAAe,MAAMC,oBAAoB,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,kBACpC,IAAI;IAAAA,eAAA,kBACP,wBAAwB;EAAA;AAC7C","ignoreList":[]}
@@ -0,0 +1,99 @@
1
+ import BASE_THEME from '@wavemaker-ai/app-rn-runtime/styles/theme';
2
+ import { defineStyles } from '@wavemaker-ai/app-rn-runtime/core/base.component';
3
+ export const DEFAULT_CLASS = 'app-offline-banner';
4
+ BASE_THEME.registerStyle((themeVariables, addStyle) => {
5
+ const defaultStyles = defineStyles({
6
+ root: {
7
+ flex: 1,
8
+ paddingHorizontal: 20,
9
+ backgroundColor: '#fff',
10
+ justifyContent: 'center'
11
+ },
12
+ textContainer: {},
13
+ text: {},
14
+ infoContainer: {
15
+ flex: 1,
16
+ width: '100%',
17
+ justifyContent: 'center'
18
+ },
19
+ imageContainer: {
20
+ alignItems: 'center',
21
+ marginVertical: 24
22
+ },
23
+ errorImage: {
24
+ width: '80%',
25
+ maxWidth: 150,
26
+ height: undefined,
27
+ aspectRatio: 1.2,
28
+ maxHeight: 150,
29
+ alignSelf: 'center'
30
+ },
31
+ title: {
32
+ fontSize: 24,
33
+ fontWeight: '700',
34
+ textAlign: 'center',
35
+ color: '#2d3748',
36
+ marginBottom: 8
37
+ },
38
+ subtitle: {
39
+ fontSize: 14,
40
+ textAlign: 'center',
41
+ color: '#71717A',
42
+ marginBottom: 24,
43
+ fontWeight: '400'
44
+ },
45
+ buttonContainer: {
46
+ width: '100%',
47
+ maxWidth: 400,
48
+ alignSelf: 'center',
49
+ marginTop: 24,
50
+ marginBottom: 16
51
+ }
52
+ });
53
+ addStyle(DEFAULT_CLASS, '', defaultStyles);
54
+ addStyle('offline-banner-image', '', {
55
+ root: {
56
+ width: '80%',
57
+ maxWidth: 150,
58
+ height: undefined,
59
+ aspectRatio: 1.2,
60
+ maxHeight: 150,
61
+ alignSelf: 'center'
62
+ }
63
+ });
64
+ addStyle('offline-banner-message', '', {
65
+ root: {
66
+ alignSelf: 'center'
67
+ },
68
+ text: defaultStyles.title
69
+ });
70
+ addStyle('offline-banner-description', '', {
71
+ root: {
72
+ alignSelf: 'center'
73
+ },
74
+ text: defaultStyles.subtitle
75
+ });
76
+ addStyle('offline-banner-retry-button', '', {
77
+ root: {
78
+ backgroundColor: themeVariables.buttonPrimaryColor,
79
+ borderRadius: 12,
80
+ paddingVertical: 16,
81
+ paddingHorizontal: 24,
82
+ alignItems: 'center',
83
+ alignSelf: 'center',
84
+ width: '100%'
85
+ },
86
+ text: {
87
+ color: '#ffffff',
88
+ fontWeight: '700',
89
+ fontSize: 16,
90
+ lineHeight: 24,
91
+ textAlign: 'center'
92
+ },
93
+ badge: {
94
+ backgroundColor: '#ffffff',
95
+ color: '#3498db'
96
+ }
97
+ });
98
+ });
99
+ //# sourceMappingURL=offline-banner.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flex","paddingHorizontal","backgroundColor","justifyContent","textContainer","text","infoContainer","width","imageContainer","alignItems","marginVertical","errorImage","maxWidth","height","undefined","aspectRatio","maxHeight","alignSelf","title","fontSize","fontWeight","textAlign","color","marginBottom","subtitle","buttonContainer","marginTop","buttonPrimaryColor","borderRadius","paddingVertical","lineHeight","badge"],"sources":["offline-banner.styles.ts"],"sourcesContent":["import { WmSkeletonStyles } from '../../basic/skeleton/skeleton.styles';\nimport BASE_THEME, { AllStyle } from '@wavemaker-ai/app-rn-runtime/styles/theme';\nimport {\n BaseStyles,\n defineStyles,\n} from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport { WmLabelStyles } from '@wavemaker-ai/app-rn-runtime/components/basic/label/label.styles';\nimport { WmButtonStyles } from '@wavemaker-ai/app-rn-runtime/components/basic/button/button.styles';\n\nexport type WmOfflineBannerStyles = BaseStyles & {\n imageContainer: AllStyle;\n textContainer: AllStyle;\n infoContainer: AllStyle;\n errorImage: AllStyle;\n title: AllStyle;\n subtitle: AllStyle;\n buttonContainer: AllStyle;\n};\n\nexport const DEFAULT_CLASS = 'app-offline-banner';\n\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmOfflineBannerStyles = defineStyles({\n root: {\n flex: 1,\n paddingHorizontal: 20,\n backgroundColor: '#fff',\n justifyContent: 'center',\n },\n textContainer: {\n },\n text: {},\n infoContainer: {\n flex: 1,\n width: '100%',\n justifyContent: 'center',\n },\n imageContainer: {\n alignItems: 'center',\n marginVertical: 24,\n },\n errorImage: {\n width: '80%',\n maxWidth: 150,\n height: undefined,\n aspectRatio: 1.2,\n maxHeight: 150,\n alignSelf: 'center',\n },\n title: {\n fontSize: 24,\n fontWeight: '700',\n textAlign: 'center',\n color: '#2d3748',\n marginBottom: 8,\n },\n subtitle: {\n fontSize: 14,\n textAlign: 'center',\n color: '#71717A',\n marginBottom: 24,\n fontWeight: '400',\n },\n buttonContainer: {\n width: '100%',\n maxWidth: 400,\n alignSelf: 'center',\n marginTop: 24,\n marginBottom: 16,\n },\n })\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n\n addStyle('offline-banner-image', '', {\n root: {\n width: '80%',\n maxWidth: 150,\n height: undefined,\n aspectRatio: 1.2,\n maxHeight: 150,\n alignSelf: 'center', \n } as any\n });\n\n addStyle('offline-banner-message', '', {\n root: { alignSelf: 'center' },\n text: defaultStyles.title,\n } as WmLabelStyles);\n\n addStyle('offline-banner-description', '', {\n root: { alignSelf: 'center' },\n text: defaultStyles.subtitle,\n } as WmLabelStyles);\n\n addStyle('offline-banner-retry-button', '', {\n root: {\n backgroundColor: themeVariables.buttonPrimaryColor,\n borderRadius: 12,\n paddingVertical: 16,\n paddingHorizontal: 24,\n alignItems: 'center',\n alignSelf: 'center',\n width: '100%',\n },\n text: {\n color: '#ffffff',\n fontWeight: '700',\n fontSize: 16,\n lineHeight: 24,\n textAlign: 'center',\n },\n badge: {\n backgroundColor: '#ffffff',\n color: '#3498db',\n }\n });\n\n});\n\n\n"],"mappings":"AACA,OAAOA,UAAU,MAAoB,2CAA2C;AAChF,SAEEC,YAAY,QACP,kDAAkD;AAczD,OAAO,MAAMC,aAAa,GAAG,oBAAoB;AAEjDF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAAoC,GAAGL,YAAY,CAAC;IACxDM,IAAI,EAAE;MACJC,IAAI,EAAE,CAAC;MACPC,iBAAiB,EAAE,EAAE;MACrBC,eAAe,EAAE,MAAM;MACvBC,cAAc,EAAE;IAClB,CAAC;IACDC,aAAa,EAAE,CACf,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,aAAa,EAAE;MACbN,IAAI,EAAE,CAAC;MACPO,KAAK,EAAE,MAAM;MACbJ,cAAc,EAAE;IAClB,CAAC;IACDK,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EAAE;IAAS,CAAC;IAC7BZ,IAAI,EAAEP,aAAa,CAAC0B;EACtB,CAAkB,CAAC;EAEnB3B,QAAQ,CAAC,6BAA6B,EAAE,EAAE,EAAE;IAC1CE,IAAI,EAAE;MACJG,eAAe,EAAEN,cAAc,CAAC+B,kBAAkB;MAClDC,YAAY,EAAE,EAAE;MAChBC,eAAe,EAAE,EAAE;MACnB5B,iBAAiB,EAAE,EAAE;MACrBQ,UAAU,EAAE,QAAQ;MACpBQ,SAAS,EAAE,QAAQ;MACnBV,KAAK,EAAE;IACT,CAAC;IACDF,IAAI,EAAE;MACJiB,KAAK,EAAE,SAAS;MAChBF,UAAU,EAAE,KAAK;MACjBD,QAAQ,EAAE,EAAE;MACZW,UAAU,EAAE,EAAE;MACdT,SAAS,EAAE;IACb,CAAC;IACDU,KAAK,EAAE;MACL7B,eAAe,EAAE,SAAS;MAC1BoB,KAAK,EAAE;IACT;EACF,CAAC,CAAC;AAEJ,CAAC,CAAC","ignoreList":[]}
@@ -139,9 +139,9 @@ export default class WmWebview extends BaseComponent {
139
139
  containerStyle: this.styles.webview
140
140
  // style={this.styles.webview} // when using style, there are some inconsistencies observed in Android. containerStyle gives us a uniformity in IOS and Android.
141
141
  ,
142
- source: {
142
+ source: props.src ? {
143
143
  uri: props.src
144
- },
144
+ } : undefined,
145
145
  testID: this.getTestId('web_view')
146
146
  }, getAccessibilityProps(AccessibilityWidgetType.WEBVIEW, props), {
147
147
  incognito: props.incognito,
@@ -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","backHandlerSubscription","addEventListener","handleBackButtonPress","componentWillUnmount","remove","_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","onLayout","handleLayout","_background","OS","width","height","_extends","ref","nestedScrollEnabled","containerStyle","source","uri","testID","getTestId","WEBVIEW","incognito","onMessage","sharedCookiesEnabled","onNavigationStateChange","scrollEnabled","onLoadEnd","url","allowsFullscreenVideo","allowsInlineMediaPlayback"],"sources":["webview.component.tsx"],"sourcesContent":["import React from 'react';\nimport { BackHandler, Platform, View, NativeEventSubscription } from 'react-native';\nimport { WebView, WebViewNavigation, WebViewMessageEvent } from 'react-native-webview';\nimport { HideMode } from '@wavemaker-ai/app-rn-runtime/core/if.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker-ai/app-rn-runtime/core/base.component';\n\nimport WmWebviewProps from './webview.props';\nimport { DEFAULT_CLASS, WebviewStyles } from './webview.styles';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\nimport { isAndroid, isWebPreviewMode } from '@wavemaker-ai/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 private backHandlerSubscription: NativeEventSubscription | null = null;\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 this.backHandlerSubscription = BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonPress);\n }\n }\n\n componentWillUnmount() {\n super.componentWillUnmount();\n if (this.backHandlerSubscription) {\n this.backHandlerSubscription.remove();\n this.backHandlerSubscription = null;\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\n style={this.styles.root}\n onLayout={(event) => this.handleLayout(event)}\n >\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 containerStyle = {this.styles.webview}\n // style={this.styles.webview} // when using style, there are some inconsistencies observed in Android. containerStyle gives us a uniformity in IOS and Android.\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 allowsFullscreenVideo={true}\n allowsInlineMediaPlayback={true}\n >\n </WebView>)}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,WAAW,EAAEC,QAAQ,EAAEC,IAAI,QAAiC,cAAc;AACnF,SAASC,OAAO,QAAgD,sBAAsB;AACtF,SAASC,QAAQ,QAAQ,gDAAgD;AACzE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,kDAAkD;AAEpG,OAAOC,cAAc,MAAM,iBAAiB;AAC5C,SAASC,aAAa,QAAuB,kBAAkB;AAC/D,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,iDAAiD;AAChH,SAASC,SAAS,EAAEC,gBAAgB,QAAQ,yCAAyC;AAErF,MAAMC,cAAc,SAASP,kBAAkB,CAAiB;EAAAQ,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,wBAC9C;MACdC,KAAK,EAAE,EAAE;MACTC,GAAG,EAAE;IACP,CAAC;EAAA;AAEH;AAEA,eAAe,MAAMC,SAAS,SAASd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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","backHandlerSubscription","addEventListener","handleBackButtonPress","componentWillUnmount","remove","_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","onLayout","handleLayout","_background","OS","width","height","_extends","ref","nestedScrollEnabled","containerStyle","source","uri","undefined","testID","getTestId","WEBVIEW","incognito","onMessage","sharedCookiesEnabled","onNavigationStateChange","scrollEnabled","onLoadEnd","url","allowsFullscreenVideo","allowsInlineMediaPlayback"],"sources":["webview.component.tsx"],"sourcesContent":["import React from 'react';\nimport { BackHandler, Platform, View, NativeEventSubscription } from 'react-native';\nimport { WebView, WebViewNavigation, WebViewMessageEvent } from 'react-native-webview';\nimport { HideMode } from '@wavemaker-ai/app-rn-runtime/core/if.component';\nimport { BaseComponent, BaseComponentState } from '@wavemaker-ai/app-rn-runtime/core/base.component';\n\nimport WmWebviewProps from './webview.props';\nimport { DEFAULT_CLASS, WebviewStyles } from './webview.styles';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\nimport { isAndroid, isWebPreviewMode } from '@wavemaker-ai/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 private backHandlerSubscription: NativeEventSubscription | null = null;\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 this.backHandlerSubscription = BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonPress);\n }\n }\n\n componentWillUnmount() {\n super.componentWillUnmount();\n if (this.backHandlerSubscription) {\n this.backHandlerSubscription.remove();\n this.backHandlerSubscription = null;\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\n style={this.styles.root}\n onLayout={(event) => this.handleLayout(event)}\n >\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 containerStyle = {this.styles.webview}\n // style={this.styles.webview} // when using style, there are some inconsistencies observed in Android. containerStyle gives us a uniformity in IOS and Android.\n source={props.src ? { uri: props.src } : undefined}\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 allowsFullscreenVideo={true}\n allowsInlineMediaPlayback={true}\n >\n </WebView>)}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,WAAW,EAAEC,QAAQ,EAAEC,IAAI,QAAiC,cAAc;AACnF,SAASC,OAAO,QAAgD,sBAAsB;AACtF,SAASC,QAAQ,QAAQ,gDAAgD;AACzE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,kDAAkD;AAEpG,OAAOC,cAAc,MAAM,iBAAiB;AAC5C,SAASC,aAAa,QAAuB,kBAAkB;AAC/D,SAASC,u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AACzB,YAAY,GAAGyB,KAAK;MAC3B,CAAE;MACFgD,aAAa,EAAE,IAAK;MACpBC,SAAS,EAAGhC,CAAC,IAAK,IAAI,CAACK,MAAM,CAACL,CAAC,EAAEA,CAAC,CAACpC,WAAW,CAACX,KAAK,EAAE+C,CAAC,CAACpC,WAAW,CAACqE,GAAG,CAAE;MACzEC,qBAAqB,EAAE,IAAK;MAC5BC,yBAAyB,EAAE;IAAK,EAEzB,CACP,CAAC;EAEX;AACF","ignoreList":[]}
@@ -5,7 +5,7 @@ import { BaseProps } from '@wavemaker-ai/app-rn-runtime/core/base.component';
5
5
  export default class WmWebviewProps extends BaseProps {
6
6
  constructor(...args) {
7
7
  super(...args);
8
- _defineProperty(this, "src", null);
8
+ _defineProperty(this, "src", '');
9
9
  _defineProperty(this, "incognito", false);
10
10
  _defineProperty(this, "onLoad", null);
11
11
  _defineProperty(this, "accessibilitylabel", undefined);
@@ -1 +1 @@
1
- {"version":3,"names":["BaseProps","WmWebviewProps","constructor","args","_defineProperty","undefined"],"sources":["webview.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport WmWebview from './webview.component';\nimport { AccessibilityRole } from 'react-native';\n\nexport default class WmWebviewProps extends BaseProps {\n src: string = null as any;\n incognito? = false;\n onLoad?: ($event: any, $widget: WmWebview) => void = null as any;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,kDAAkD;AAI5E,eAAe,MAAMC,cAAc,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,cACtC,IAAI;IAAAA,eAAA,oBACL,KAAK;IAAAA,eAAA,iBACmC,IAAI;IAAAA,eAAA,6BAC3BC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA;EAAA;AAE3B","ignoreList":[]}
1
+ {"version":3,"names":["BaseProps","WmWebviewProps","constructor","args","_defineProperty","undefined"],"sources":["webview.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport WmWebview from './webview.component';\nimport { AccessibilityRole } from 'react-native';\n\nexport default class WmWebviewProps extends BaseProps {\n src: string = '';\n incognito? = false;\n onLoad?: ($event: any, $widget: WmWebview) => void = null as any;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,kDAAkD;AAI5E,eAAe,MAAMC,cAAc,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,cACtC,EAAE;IAAAA,eAAA,oBACH,KAAK;IAAAA,eAAA,iBACmC,IAAI;IAAAA,eAAA,6BAC3BC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA;EAAA;AAE3B","ignoreList":[]}
@@ -74,8 +74,8 @@ export default class WmAnchor extends BaseComponent {
74
74
  iconwidth: iconwidth,
75
75
  accessible: false
76
76
  });
77
- const leftIcon = lefticon => {
78
- if (!lefticon) {
77
+ const leftIcon = (lefticon, lefticonurl) => {
78
+ if (!lefticon && !lefticonurl) {
79
79
  return /*#__PURE__*/React.createElement(React.Fragment, null);
80
80
  }
81
81
  return /*#__PURE__*/React.createElement(WmIcon, {
@@ -84,7 +84,7 @@ export default class WmAnchor extends BaseComponent {
84
84
  hint: props === null || props === void 0 ? void 0 : props.hint,
85
85
  name: name + '_icon',
86
86
  iconclass: lefticon,
87
- iconurl: iconurl,
87
+ iconurl: lefticonurl,
88
88
  iconheight: iconheight,
89
89
  iconmargin: iconmargin,
90
90
  iconwidth: iconwidth,
@@ -113,7 +113,7 @@ export default class WmAnchor extends BaseComponent {
113
113
  accessibilityProps: {
114
114
  ...getAccessibilityProps(AccessibilityWidgetType.ANCHOR, props)
115
115
  }
116
- }), this._background, props.iconposition === 'top' && icon, props.iconposition === 'left' && icon, props.lefticonclass && /*#__PURE__*/React.createElement(React.Fragment, null, leftIcon(props.lefticonclass)), props.caption ? /*#__PURE__*/React.createElement(Text, _extends({
116
+ }), this._background, props.iconposition === 'top' && icon, props.iconposition === 'left' && icon, (props.lefticonclass || props.lefticonurl) && /*#__PURE__*/React.createElement(React.Fragment, null, leftIcon(props.lefticonclass, props.lefticonurl)), props.caption ? /*#__PURE__*/React.createElement(Text, _extends({
117
117
  style: this.styles.text
118
118
  }, this.getTestPropsForLabel('caption'), {
119
119
  numberOfLines: props.nooflines,
@@ -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","renderBadge","badgevalue","_showSkeleton","badgeSkeleton","badge","undefined","createElement","style","importantForAccessibility","renderWidget","iconclass","iconurl","name","iconheight","iconmargin","iconwidth","icon","text","color","id","getTestId","hint","accessible","leftIcon","lefticon","Fragment","entryanimation","animation","delay","animationdelay","justifyContent","onLayout","event","handleLayout","_extends","getTestPropsForAction","flexDirection","iconposition","disableTouchEffect","disabletoucheffect","accessibilityProps","ANCHOR","_background","lefticonclass","caption","getTestPropsForLabel","numberOfLines","nooflines"],"sources":["anchor.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, Text } from 'react-native';\nimport { Badge } from 'react-native-paper';\nimport { BaseComponent, BaseComponentState } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport { SyntheticEvent, Tappable } from '@wavemaker-ai/app-rn-runtime/core/tappable.component';\nimport WmIcon from '@wavemaker-ai/app-rn-runtime/components/basic/icon/icon.component';\nimport { encodeUrl } from '@wavemaker-ai/app-rn-runtime/core/utils';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\nimport NavigationService, { NavigationServiceConsumer } from '@wavemaker-ai/app-rn-runtime/core/navigation.service';\n\nimport WmAnchorProps from './anchor.props';\nimport { DEFAULT_CLASS, WmAnchorStyles } from './anchor.styles';\nimport { Animatedview } from '@wavemaker-ai/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 renderBadge() {\n const { badgevalue } = this.props;\n if(this._showSkeleton) {\n return createSkeleton(this.theme, this.styles.badgeSkeleton, {\n ...this.styles.badge,\n // marginTop: -50\n })\n }\n return badgevalue != undefined ? (<Badge style={this.styles.badge} importantForAccessibility=\"no\">{badgevalue}</Badge>): null;\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 accessible={false}\n />\n );\n\n const leftIcon = (lefticon: string | undefined) => {\n if(!lefticon) {\n return <></>\n }\n\n return (\n <WmIcon\n id={this.getTestId('left-icon')}\n styles={this.styles.lefticon}\n hint={props?.hint}\n name={name + '_icon'}\n iconclass={lefticon}\n iconurl={iconurl}\n iconheight={iconheight}\n iconmargin={iconmargin}\n iconwidth={iconwidth}\n accessible={false}\n />\n )\n }\n return (\n <NavigationServiceConsumer>\n {(navigationService: NavigationService) =>\n (<Animatedview\n entryanimation={props.animation}\n delay={props.animationdelay}\n style={{width: this.styles.root.width, height: this.styles.root.height, justifyContent: 'center'}}\n onLayout={(event: LayoutChangeEvent) => this.handleLayout(event)}\n >\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 disableTouchEffect={this.state.props.disabletoucheffect}\n accessibilityProps={{...getAccessibilityProps(\n AccessibilityWidgetType.ANCHOR,\n props\n )}}>\n {this._background}\n {props.iconposition === 'top' && icon}\n {props.iconposition === 'left' && icon}\n {props.lefticonclass &&\n <>\n {leftIcon(props.lefticonclass)}\n </>\n } \n {props.caption ? (<Text style={this.styles.text}\n {...this.getTestPropsForLabel('caption')}\n numberOfLines={props.nooflines} importantForAccessibility='no'>{props.caption}</Text>) : null}\n {props.iconposition === 'right' && icon}\n {this.renderBadge()}\n </Tappable>\n </Animatedview>)\n }\n </NavigationServiceConsumer>\n );\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,QAAQ,cAAc;AACtD,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,aA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AI,EAAAwE,QAAA;MAAC3B,KAAK,EAAE,IAAI,CAACd,MAAM,CAACwB;IAAK,GAC5C,IAAI,CAAC4B,oBAAoB,CAAC,SAAS,CAAC;MACxCC,aAAa,EAAEnE,KAAK,CAACoE,SAAU;MAACvC,yBAAyB,EAAC;IAAI,IAAE7B,KAAK,CAACiE,OAAc,CAAC,GAAI,IAAI,EAC5FjE,KAAK,CAAC0D,YAAY,KAAK,OAAO,IAAIrB,IAAI,EACtC,IAAI,CAAChB,WAAW,CAAC,CACV,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","renderBadge","badgevalue","_showSkeleton","badgeSkeleton","badge","undefined","createElement","style","importantForAccessibility","renderWidget","iconclass","iconurl","name","iconheight","iconmargin","iconwidth","icon","text","color","id","getTestId","hint","accessible","leftIcon","lefticon","lefticonurl","Fragment","entryanimation","animation","delay","animationdelay","justifyContent","onLayout","event","handleLayout","_extends","getTestPropsForAction","flexDirection","iconposition","disableTouchEffect","disabletoucheffect","accessibilityProps","ANCHOR","_background","lefticonclass","caption","getTestPropsForLabel","numberOfLines","nooflines"],"sources":["anchor.component.tsx"],"sourcesContent":["import React from 'react';\nimport { LayoutChangeEvent, Text } from 'react-native';\nimport { Badge } from 'react-native-paper';\nimport { BaseComponent, BaseComponentState } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport { SyntheticEvent, Tappable } from '@wavemaker-ai/app-rn-runtime/core/tappable.component';\nimport WmIcon from '@wavemaker-ai/app-rn-runtime/components/basic/icon/icon.component';\nimport { encodeUrl } from '@wavemaker-ai/app-rn-runtime/core/utils';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';\nimport NavigationService, { NavigationServiceConsumer } from '@wavemaker-ai/app-rn-runtime/core/navigation.service';\n\nimport WmAnchorProps from './anchor.props';\nimport { DEFAULT_CLASS, WmAnchorStyles } from './anchor.styles';\nimport { Animatedview } from '@wavemaker-ai/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 renderBadge() {\n const { badgevalue } = this.props;\n if(this._showSkeleton) {\n return createSkeleton(this.theme, this.styles.badgeSkeleton, {\n ...this.styles.badge,\n // marginTop: -50\n })\n }\n return badgevalue != undefined ? (<Badge style={this.styles.badge} importantForAccessibility=\"no\">{badgevalue}</Badge>): null;\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 accessible={false}\n />\n );\n\n const leftIcon = (lefticon: string | undefined, lefticonurl: string | undefined) => {\n if(!lefticon && !lefticonurl) {\n return <></>\n }\n\n return (\n <WmIcon\n id={this.getTestId('left-icon')}\n styles={this.styles.lefticon}\n hint={props?.hint}\n name={name + '_icon'}\n iconclass={lefticon}\n iconurl={lefticonurl}\n iconheight={iconheight}\n iconmargin={iconmargin}\n iconwidth={iconwidth}\n accessible={false}\n />\n )\n }\n return (\n <NavigationServiceConsumer>\n {(navigationService: NavigationService) =>\n (<Animatedview\n entryanimation={props.animation}\n delay={props.animationdelay}\n style={{width: this.styles.root.width, height: this.styles.root.height, justifyContent: 'center'}}\n onLayout={(event: LayoutChangeEvent) => this.handleLayout(event)}\n >\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 disableTouchEffect={this.state.props.disabletoucheffect}\n accessibilityProps={{...getAccessibilityProps(\n AccessibilityWidgetType.ANCHOR,\n props\n )}}>\n {this._background}\n {props.iconposition === 'top' && icon}\n {props.iconposition === 'left' && icon}\n {(props.lefticonclass || props.lefticonurl) &&\n <>\n {leftIcon(props.lefticonclass, props.lefticonurl)}\n </>\n }\n {props.caption ? (<Text style={this.styles.text}\n {...this.getTestPropsForLabel('caption')}\n numberOfLines={props.nooflines} importantForAccessibility='no'>{props.caption}</Text>) : null}\n {props.iconposition === 'right' && icon}\n {this.renderBadge()}\n </Tappable>\n </Animatedview>)\n }\n </NavigationServiceConsumer>\n );\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,QAAQ,cAA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H,QAAQ,CAAC5C,KAAK,CAACiE,aAAa,EAAEjE,KAAK,CAAC8C,WAAW,CAChD,CAAC,EAEJ9C,KAAK,CAACkE,OAAO,gBAAIpF,KAAA,CAAA6C,aAAA,CAAC5C,IAAI,EAAAyE,QAAA;MAAC5B,KAAK,EAAE,IAAI,CAACd,MAAM,CAACwB;IAAK,GAC5C,IAAI,CAAC6B,oBAAoB,CAAC,SAAS,CAAC;MACxCC,aAAa,EAAEpE,KAAK,CAACqE,SAAU;MAACxC,yBAAyB,EAAC;IAAI,IAAE7B,KAAK,CAACkE,OAAc,CAAC,GAAI,IAAI,EAC5FlE,KAAK,CAAC2D,YAAY,KAAK,OAAO,IAAItB,IAAI,EACtC,IAAI,CAAChB,WAAW,CAAC,CACV,CACE,CAES,CAAC;EAEhC;AACF","ignoreList":[]}
@@ -29,6 +29,7 @@ export default class WmAnchorProps extends BaseProps {
29
29
  _defineProperty(this, "accessibilityrole", 'link');
30
30
  _defineProperty(this, "nooflines", undefined);
31
31
  _defineProperty(this, "lefticonclass", void 0);
32
+ _defineProperty(this, "lefticonurl", void 0);
32
33
  }
33
34
  }
34
35
  //# sourceMappingURL=anchor.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BaseProps","WmAnchorProps","constructor","args","_defineProperty","undefined"],"sources":["anchor.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport { AccessibilityRole } from 'react-native';\nexport default class WmAnchorProps extends BaseProps {\n animation?: string = null as any;\n animationdelay?: number = null as any;\n caption? = 'Link';\n hyperlink?: string = null as any;\n encodeurl?: boolean = false;\n badgevalue?: string = null as any;\n width?: string = null as any;\n height?: string = null as any;\n iconclass?: string = null as any;\n iconposition?: string = 'left';\n target?: string = '_blank';\n onTap?: any;\n skeletonwidth?: number;\n skeletonheight?: number;\n iconurl?: string = null as any;\n iconheight?: number = null as any;\n iconwidth?: number = null as any;\n iconmargin?: number = null as any;\n accessible?: boolean = true;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole = 'link';\n nooflines?: any = undefined;\n lefticonclass?: string;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,kDAAkD;AAE5E,eAAe,MAAMC,aAAa,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBAC5B,IAAI;IAAAA,eAAA,yBACC,IAAI;IAAAA,eAAA,kBACnB,MAAM;IAAAA,eAAA,oBACI,IAAI;IAAAA,eAAA,oBACH,KAAK;IAAAA,eAAA,qBACL,IAAI;IAAAA,eAAA,gBACT,IAAI;IAAAA,eAAA,iBACH,IAAI;IAAAA,eAAA,oBACD,IAAI;IAAAA,eAAA,uBACD,MAAM;IAAAA,eAAA,iBACZ,QAAQ;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,kBAIP,IAAI;IAAAA,eAAA,qBACD,IAAI;IAAAA,eAAA,oBACL,IAAI;IAAAA,eAAA,qBACH,IAAI;IAAAA,eAAA,qBACH,IAAI;IAAAA,eAAA,6BACGC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA,4BACe,MAAM;IAAAA,eAAA,oBAC5BC,SAAS;IAAAD,eAAA;EAAA;AAE/B","ignoreList":[]}
1
+ {"version":3,"names":["BaseProps","WmAnchorProps","constructor","args","_defineProperty","undefined"],"sources":["anchor.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker-ai/app-rn-runtime/core/base.component';\nimport { AccessibilityRole } from 'react-native';\nexport default class WmAnchorProps extends BaseProps {\n animation?: string = null as any;\n animationdelay?: number = null as any;\n caption? = 'Link';\n hyperlink?: string = null as any;\n encodeurl?: boolean = false;\n badgevalue?: string = null as any;\n width?: string = null as any;\n height?: string = null as any;\n iconclass?: string = null as any;\n iconposition?: string = 'left';\n target?: string = '_blank';\n onTap?: any;\n skeletonwidth?: number;\n skeletonheight?: number;\n iconurl?: string = null as any;\n iconheight?: number = null as any;\n iconwidth?: number = null as any;\n iconmargin?: number = null as any;\n accessible?: boolean = true;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n accessibilityrole?: AccessibilityRole = 'link';\n nooflines?: any = undefined;\n lefticonclass?: string;\n lefticonurl?: string;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,kDAAkD;AAE5E,eAAe,MAAMC,aAAa,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBAC5B,IAAI;IAAAA,eAAA,yBACC,IAAI;IAAAA,eAAA,kBACnB,MAAM;IAAAA,eAAA,oBACI,IAAI;IAAAA,eAAA,oBACH,KAAK;IAAAA,eAAA,qBACL,IAAI;IAAAA,eAAA,gBACT,IAAI;IAAAA,eAAA,iBACH,IAAI;IAAAA,eAAA,oBACD,IAAI;IAAAA,eAAA,uBACD,MAAM;IAAAA,eAAA,iBACZ,QAAQ;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,kBAIP,IAAI;IAAAA,eAAA,qBACD,IAAI;IAAAA,eAAA,oBACL,IAAI;IAAAA,eAAA,qBACH,IAAI;IAAAA,eAAA,qBACH,IAAI;IAAAA,eAAA,6BACGC,SAAS;IAAAD,eAAA,eACvBC,SAAS;IAAAD,eAAA,4BACe,MAAM;IAAAA,eAAA,oBAC5BC,SAAS;IAAAD,eAAA;IAAAA,eAAA;EAAA;AAG/B","ignoreList":[]}
@@ -5,6 +5,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
5
5
  import React from 'react';
6
6
  import { Animated, Easing, Text, Image, View } from 'react-native';
7
7
  import { FontAwesome } from '@expo/vector-icons';
8
+ import SvgUrlIcon from './svg-url-icon.component';
8
9
  import { BaseComponent, BaseComponentState } from '@wavemaker-ai/app-rn-runtime/core/base.component';
9
10
  import { isFullPathUrl } from '@wavemaker-ai/app-rn-runtime/core/utils';
10
11
  import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker-ai/app-rn-runtime/core/accessibility';
@@ -123,7 +124,7 @@ export default class WmIcon extends BaseComponent {
123
124
  });
124
125
  }
125
126
  getElementToShow(props, iconSrc) {
126
- var _this$styles$image, _this$styles$image2, _this$styles$image3;
127
+ var _this$styles$image, _this$styles$image2, _props$iconurl, _this$styles$image3;
127
128
  const {
128
129
  iconmargin,
129
130
  iconheight,
@@ -133,6 +134,32 @@ export default class WmIcon extends BaseComponent {
133
134
  let elementToshow, source;
134
135
  if (iconwidth) width = iconwidth;else if (iconheight) width = iconheight;else width = ((_this$styles$image = this.styles.image) === null || _this$styles$image === void 0 ? void 0 : _this$styles$image.width) || 12;
135
136
  if (iconheight) height = iconheight;else if (iconwidth) height = iconwidth;else height = ((_this$styles$image2 = this.styles.image) === null || _this$styles$image2 === void 0 ? void 0 : _this$styles$image2.height) || 12;
137
+ const SvgComponent = typeof iconSrc === 'function' ? iconSrc : iconSrc && typeof iconSrc === 'object' && typeof (iconSrc === null || iconSrc === void 0 ? void 0 : iconSrc.default) === 'function' ? iconSrc.default : null;
138
+ if (SvgComponent) {
139
+ var _this$styles$root, _this$styles$text, _this$styles$root2, _this$styles$text2;
140
+ const color = ((_this$styles$root = this.styles.root) === null || _this$styles$root === void 0 ? void 0 : _this$styles$root.color) || ((_this$styles$text = this.styles.text) === null || _this$styles$text === void 0 ? void 0 : _this$styles$text.color);
141
+ const size = props.iconsize || ((_this$styles$root2 = this.styles.root) === null || _this$styles$root2 === void 0 ? void 0 : _this$styles$root2.fontSize) || ((_this$styles$text2 = this.styles.text) === null || _this$styles$text2 === void 0 ? void 0 : _this$styles$text2.fontSize) || width;
142
+ return /*#__PURE__*/React.createElement(SvgComponent, {
143
+ width: size,
144
+ height: size,
145
+ color: color || undefined
146
+ });
147
+ }
148
+ const isSvgUrl = typeof iconSrc === 'string' && (((_props$iconurl = props.iconurl) === null || _props$iconurl === void 0 ? void 0 : _props$iconurl.toLowerCase().endsWith('.svg')) || iconSrc.toLowerCase().endsWith('.svg'));
149
+ if (isSvgUrl) {
150
+ var _this$styles$root3, _this$styles$text3, _this$styles$root4, _this$styles$text4;
151
+ const color = ((_this$styles$root3 = this.styles.root) === null || _this$styles$root3 === void 0 ? void 0 : _this$styles$root3.color) || ((_this$styles$text3 = this.styles.text) === null || _this$styles$text3 === void 0 ? void 0 : _this$styles$text3.color);
152
+ const size = props.iconsize || ((_this$styles$root4 = this.styles.root) === null || _this$styles$root4 === void 0 ? void 0 : _this$styles$root4.fontSize) || ((_this$styles$text4 = this.styles.text) === null || _this$styles$text4 === void 0 ? void 0 : _this$styles$text4.fontSize) || width;
153
+ return /*#__PURE__*/React.createElement(SvgUrlIcon, {
154
+ uri: iconSrc,
155
+ width: size,
156
+ height: size,
157
+ color: color ? String(color) : undefined,
158
+ style: {
159
+ margin: iconmargin !== null && iconmargin !== void 0 ? iconmargin : 0
160
+ }
161
+ });
162
+ }
136
163
  if (isFullPathUrl(iconSrc)) {
137
164
  source = {
138
165
  uri: iconSrc
@@ -157,7 +184,7 @@ export default class WmIcon extends BaseComponent {
157
184
  return null;
158
185
  }
159
186
  const iconImageSrc = this.loadAsset(iconImage);
160
- if (iconImageSrc && typeof iconImageSrc !== 'function') {
187
+ if (iconImageSrc != null) {
161
188
  return iconImageSrc;
162
189
  }
163
190
  return null;