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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. app-rn-runtime/components/advanced/carousel/carousel-content/carousel-content.component.js +1 -1
  2. app-rn-runtime/components/advanced/carousel/carousel-content/carousel-content.component.js.map +1 -1
  3. app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js +1 -1
  4. app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js.map +1 -1
  5. app-rn-runtime/components/advanced/carousel/carousel.component.js +1 -1
  6. app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
  7. app-rn-runtime/components/advanced/login/login.component.js +1 -1
  8. app-rn-runtime/components/advanced/login/login.component.js.map +1 -1
  9. app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.component.js +5 -5
  10. app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.component.js.map +1 -1
  11. app-rn-runtime/components/advanced/webview/webview.component.js +1 -1
  12. app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
  13. app-rn-runtime/components/basic/anchor/anchor.component.js +1 -1
  14. app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
  15. app-rn-runtime/components/basic/button/button.component.js +1 -1
  16. app-rn-runtime/components/basic/button/button.component.js.map +1 -1
  17. app-rn-runtime/components/basic/buttongroup/buttongroup.component.js +1 -1
  18. app-rn-runtime/components/basic/buttongroup/buttongroup.component.js.map +1 -1
  19. app-rn-runtime/components/basic/custom/custom.component.js +25 -0
  20. app-rn-runtime/components/basic/custom/custom.component.js.map +1 -0
  21. app-rn-runtime/components/basic/custom/custom.props.js +16 -0
  22. app-rn-runtime/components/basic/custom/custom.props.js.map +1 -0
  23. app-rn-runtime/components/basic/custom/custom.styles.js +18 -0
  24. app-rn-runtime/components/basic/custom/custom.styles.js.map +1 -0
  25. app-rn-runtime/components/basic/icon/icon.component.js +1 -1
  26. app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
  27. app-rn-runtime/components/basic/label/label.component.js +1 -1
  28. app-rn-runtime/components/basic/label/label.component.js.map +1 -1
  29. app-rn-runtime/components/basic/lottie/lottie.component.js +137 -0
  30. app-rn-runtime/components/basic/lottie/lottie.component.js.map +1 -0
  31. app-rn-runtime/components/basic/lottie/lottie.props.js +14 -0
  32. app-rn-runtime/components/basic/lottie/lottie.props.js.map +1 -0
  33. app-rn-runtime/components/basic/lottie/lottie.styles.js +11 -0
  34. app-rn-runtime/components/basic/lottie/lottie.styles.js.map +1 -0
  35. app-rn-runtime/components/basic/message/message.component.js +1 -1
  36. app-rn-runtime/components/basic/message/message.component.js.map +1 -1
  37. app-rn-runtime/components/basic/picture/picture.component.js +37 -26
  38. app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
  39. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +3 -2
  40. app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
  41. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +1 -1
  42. app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
  43. app-rn-runtime/components/basic/search/search.component.js +4 -1
  44. app-rn-runtime/components/basic/search/search.component.js.map +1 -1
  45. app-rn-runtime/components/basic/spinner/spinner.component.js +10 -10
  46. app-rn-runtime/components/basic/spinner/spinner.component.js.map +1 -1
  47. app-rn-runtime/components/basic/video/video.component.js +56 -0
  48. app-rn-runtime/components/basic/video/video.component.js.map +1 -0
  49. app-rn-runtime/components/basic/video/video.props.js +22 -0
  50. app-rn-runtime/components/basic/video/video.props.js.map +1 -0
  51. app-rn-runtime/components/basic/video/video.styles.js +11 -0
  52. app-rn-runtime/components/basic/video/video.styles.js.map +1 -0
  53. app-rn-runtime/components/container/accordion/accordion.component.js +1 -1
  54. app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
  55. app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +1 -1
  56. app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
  57. app-rn-runtime/components/container/container.component.js +1 -1
  58. app-rn-runtime/components/container/container.component.js.map +1 -1
  59. app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js +1 -1
  60. app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js.map +1 -1
  61. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js +1 -1
  62. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js.map +1 -1
  63. app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js +1 -1
  64. app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js.map +1 -1
  65. app-rn-runtime/components/container/linearlayout/linearlayout.component.js +1 -1
  66. app-rn-runtime/components/container/linearlayout/linearlayout.component.js.map +1 -1
  67. app-rn-runtime/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js +1 -1
  68. app-rn-runtime/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js.map +1 -1
  69. app-rn-runtime/components/container/panel/panel-content/panel-content.component.js +1 -1
  70. app-rn-runtime/components/container/panel/panel-content/panel-content.component.js.map +1 -1
  71. app-rn-runtime/components/container/panel/panel-footer/panel-footer.component.js +1 -1
  72. app-rn-runtime/components/container/panel/panel-footer/panel-footer.component.js.map +1 -1
  73. app-rn-runtime/components/container/panel/panel.component.js +1 -1
  74. app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
  75. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +12 -4
  76. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
  77. app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js +2 -1
  78. app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
  79. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +1 -1
  80. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
  81. app-rn-runtime/components/container/tabs/tabs.component.js +68 -67
  82. app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
  83. app-rn-runtime/components/container/tabs/tabs.props.js +1 -0
  84. app-rn-runtime/components/container/tabs/tabs.props.js.map +1 -1
  85. app-rn-runtime/components/container/tabs/tabs.styles.js +1 -1
  86. app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
  87. app-rn-runtime/components/container/tile/tile.component.js +1 -1
  88. app-rn-runtime/components/container/tile/tile.component.js.map +1 -1
  89. app-rn-runtime/components/container/wizard/wizard.component.js +1 -1
  90. app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
  91. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +1 -1
  92. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  93. app-rn-runtime/components/data/card/card-content/card-content.component.js +1 -1
  94. app-rn-runtime/components/data/card/card-content/card-content.component.js.map +1 -1
  95. app-rn-runtime/components/data/card/card-footer/card-footer.component.js +1 -1
  96. app-rn-runtime/components/data/card/card-footer/card-footer.component.js.map +1 -1
  97. app-rn-runtime/components/data/card/card.component.js +1 -1
  98. app-rn-runtime/components/data/card/card.component.js.map +1 -1
  99. app-rn-runtime/components/data/form/form-action/form-action.component.js +0 -6
  100. app-rn-runtime/components/data/form/form-action/form-action.component.js.map +1 -1
  101. app-rn-runtime/components/data/form/form-body/form-body.component.js +1 -1
  102. app-rn-runtime/components/data/form/form-body/form-body.component.js.map +1 -1
  103. app-rn-runtime/components/data/form/form-field/form-field.component.js +1 -1
  104. app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
  105. app-rn-runtime/components/data/form/form-footer/form-footer.component.js +1 -1
  106. app-rn-runtime/components/data/form/form-footer/form-footer.component.js.map +1 -1
  107. app-rn-runtime/components/data/form/form.component.js +1 -30
  108. app-rn-runtime/components/data/form/form.component.js.map +1 -1
  109. app-rn-runtime/components/data/list/list-template/list-template.component.js +1 -1
  110. app-rn-runtime/components/data/list/list-template/list-template.component.js.map +1 -1
  111. app-rn-runtime/components/data/list/list.component.js +1 -4
  112. app-rn-runtime/components/data/list/list.component.js.map +1 -1
  113. app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js +1 -1
  114. app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js.map +1 -1
  115. app-rn-runtime/components/device/camera/camera.component.js +3 -0
  116. app-rn-runtime/components/device/camera/camera.component.js.map +1 -1
  117. app-rn-runtime/components/dialogs/dialog/dialog.component.js +1 -1
  118. app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
  119. app-rn-runtime/components/dialogs/dialogactions/dialogactions.component.js +1 -1
  120. app-rn-runtime/components/dialogs/dialogactions/dialogactions.component.js.map +1 -1
  121. app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js +1 -1
  122. app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
  123. app-rn-runtime/components/input/calendar/calendar.component.js +1 -1
  124. app-rn-runtime/components/input/calendar/calendar.component.js.map +1 -1
  125. app-rn-runtime/components/input/checkbox/checkbox.component.js +1 -16
  126. app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
  127. app-rn-runtime/components/input/checkboxset/checkboxset.component.js +0 -38
  128. app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
  129. app-rn-runtime/components/input/composite/composite.component.js +1 -1
  130. app-rn-runtime/components/input/composite/composite.component.js.map +1 -1
  131. app-rn-runtime/components/input/epoch/base-datetime.component.js +1 -1
  132. app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
  133. app-rn-runtime/components/input/fileupload/fileupload.component.js +1 -1
  134. app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
  135. app-rn-runtime/components/input/number/number.component.js +0 -9
  136. app-rn-runtime/components/input/number/number.component.js.map +1 -1
  137. app-rn-runtime/components/input/radioset/radioset.component.js +0 -40
  138. app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
  139. app-rn-runtime/components/input/rating/rating.component.js +1 -1
  140. app-rn-runtime/components/input/rating/rating.component.js.map +1 -1
  141. app-rn-runtime/components/input/slider/slider.component.js +1 -1
  142. app-rn-runtime/components/input/slider/slider.component.js.map +1 -1
  143. app-rn-runtime/components/input/switch/switch.component.js +19 -22
  144. app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
  145. app-rn-runtime/components/input/switch/switch.styles.js +7 -7
  146. app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
  147. app-rn-runtime/components/input/text/text.component.js +1 -10
  148. app-rn-runtime/components/input/text/text.component.js.map +1 -1
  149. app-rn-runtime/components/input/textarea/textarea.component.js +0 -10
  150. app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
  151. app-rn-runtime/components/input/toggle/toggle.component.js +1 -1
  152. app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
  153. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +1 -1
  154. app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
  155. app-rn-runtime/components/navigation/basenav/basenav.props.js +1 -0
  156. app-rn-runtime/components/navigation/basenav/basenav.props.js.map +1 -1
  157. app-rn-runtime/components/navigation/menu/menu.component.js +2 -1
  158. app-rn-runtime/components/navigation/menu/menu.component.js.map +1 -1
  159. app-rn-runtime/components/navigation/navbar/navbar.component.js +2 -0
  160. app-rn-runtime/components/navigation/navbar/navbar.component.js.map +1 -1
  161. app-rn-runtime/components/navigation/navitem/navitem.component.js +4 -3
  162. app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
  163. app-rn-runtime/components/navigation/navitem/navitem.props.js +1 -0
  164. app-rn-runtime/components/navigation/navitem/navitem.props.js.map +1 -1
  165. app-rn-runtime/components/navigation/popover/popover.component.js +1 -1
  166. app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
  167. app-rn-runtime/components/page/content/content.component.js +1 -1
  168. app-rn-runtime/components/page/content/content.component.js.map +1 -1
  169. app-rn-runtime/components/page/left-panel/left-panel.component.js +1 -1
  170. app-rn-runtime/components/page/left-panel/left-panel.component.js.map +1 -1
  171. app-rn-runtime/components/page/page-content/page-content.component.js +2 -2
  172. app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
  173. app-rn-runtime/components/page/page.component.js +1 -1
  174. app-rn-runtime/components/page/page.component.js.map +1 -1
  175. app-rn-runtime/components/page/partial/partial.component.js +1 -1
  176. app-rn-runtime/components/page/partial/partial.component.js.map +1 -1
  177. app-rn-runtime/components/page/partial-container/partial-container.component.js +1 -1
  178. app-rn-runtime/components/page/partial-container/partial-container.component.js.map +1 -1
  179. app-rn-runtime/components/page/tabbar/tabbar.component.js +2 -1
  180. app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
  181. app-rn-runtime/components/prefab/prefab-container.component.js +1 -1
  182. app-rn-runtime/components/prefab/prefab-container.component.js.map +1 -1
  183. app-rn-runtime/core/asset.provider.js +5 -0
  184. app-rn-runtime/core/asset.provider.js.map +1 -0
  185. app-rn-runtime/core/base.component.js +113 -41
  186. app-rn-runtime/core/base.component.js.map +1 -1
  187. app-rn-runtime/core/imageSizeEstimator.js +1 -0
  188. app-rn-runtime/core/imageSizeEstimator.js.map +1 -1
  189. app-rn-runtime/gestures/swipe.animation.js +105 -0
  190. app-rn-runtime/gestures/swipe.animation.js.map +1 -0
  191. app-rn-runtime/package.json +4 -3
  192. app-rn-runtime/runtime/App.js +11 -2
  193. app-rn-runtime/runtime/App.js.map +1 -1
  194. app-rn-runtime/runtime/base-fragment.component.js +6 -4
  195. app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
  196. app-rn-runtime/runtime/navigator/drawer.navigator.js +4 -0
  197. app-rn-runtime/runtime/navigator/drawer.navigator.js.map +1 -1
  198. app-rn-runtime/runtime/navigator/stack.navigator.js +5 -1
  199. app-rn-runtime/runtime/navigator/stack.navigator.js.map +1 -1
  200. app-rn-runtime/runtime/services/app-spinner.service.js +5 -1
  201. app-rn-runtime/runtime/services/app-spinner.service.js.map +1 -1
  202. app-rn-runtime/runtime/services/app-toast.service.js +1 -1
  203. app-rn-runtime/runtime/services/app-toast.service.js.map +1 -1
  204. app-rn-runtime/styles/background.component.js +259 -0
  205. app-rn-runtime/styles/background.component.js.map +1 -0
  206. app-rn-runtime/styles/style-prop.validator.js +38 -8
  207. app-rn-runtime/styles/style-prop.validator.js.map +1 -1
  208. app-rn-runtime/styles/style-props.js +93 -0
  209. app-rn-runtime/styles/style-props.js.map +1 -0
  210. app-rn-runtime/styles/theme.js +6 -37
  211. app-rn-runtime/styles/theme.js.map +1 -1
  212. app-rn-runtime/variables/http.service.js +3 -12
  213. app-rn-runtime/variables/http.service.js.map +1 -1
  214. app-rn-runtime/variables/service-variable.js +13 -7
  215. app-rn-runtime/variables/service-variable.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["axios","WS_CONSTANTS","get","isEmpty","isWebPreviewMode","injector","HttpService","send","options","variable","serviceInfo","headers","requestBody","data","isProxyCall","url","cancelTokenSource","CancelToken","source","startsWith","queryParams","split","config","baseUrl","relativePath","consumes","formData","FormData","parameters","forEach","p","v","dataBinding","name","append","methodType","isNonDataMethod","NON_DATA_AXIOS_METHODS","indexOf","toUpperCase","axiosConfig","cancelToken","token","withCredentials","Promise","resolve","reject","apply","then","result","err","sendCall","requestParams","response","getLocale","appConfig","appLocale","messages","cancel","uploadFile","event","error","httpService"],"sources":["http.service.ts"],"sourcesContent":["import axios from 'axios';\nimport { HttpClientService } from '@wavemaker/variables/src/types/http-client.service';\nimport { WS_CONSTANTS } from '@wavemaker/app-rn-runtime/variables/utils/variable.constants';\nimport { get, isEmpty } from 'lodash';\nimport AppConfig from '@wavemaker/app-rn-runtime/core/AppConfig';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\n\nexport class HttpService implements HttpClientService {\n\n send(options: any, variable: any) {\n const serviceInfo = variable.serviceInfo;\n let headers: any = options.headers,\n requestBody: any = options.data,\n isProxyCall = isWebPreviewMode() ? get(serviceInfo, 'proxySettings.web') : get(serviceInfo, 'proxySettings.mobile'),\n url: string = isProxyCall ? '.' + options.url : options.url;\n variable.cancelTokenSource = axios.CancelToken.source();\n if (!isWebPreviewMode()\n && !(url.startsWith('http://') || url.startsWith(\"https://\"))) {\n const queryParams = options.url.split('?');\n url = variable.config.baseUrl + serviceInfo.relativePath;\n if (!isEmpty(queryParams[1])) {\n url = url + '?' + queryParams[1];\n }\n }\n if (!isWebPreviewMode() && (variable?.serviceInfo?.consumes||[])[0] === 'multipart/form-data') {\n headers['Content-Type'] = 'multipart/form-data';\n let formData = new FormData();\n (variable.serviceInfo.parameters||[]).forEach((p: any) => {\n const v = variable.dataBinding[p.name];\n if (v) {\n formData.append(p.name, variable.dataBinding[p.name]);\n }\n });\n requestBody = formData;\n }\n const methodType: string = serviceInfo.methodType;\n const isNonDataMethod: boolean = WS_CONSTANTS.NON_DATA_AXIOS_METHODS.indexOf(methodType.toUpperCase()) > -1;\n const axiosConfig = {\n headers: headers,\n cancelToken: variable.cancelTokenSource.token,\n withCredentials: true\n };\n return new Promise((resolve, reject) => {\n // @ts-ignore\n axios[methodType].apply(variable, ( isNonDataMethod ? [url, axiosConfig] : [url, requestBody || {}, axiosConfig]))\n .then((result: any) => {\n resolve(result);\n }, (err: any) => {\n reject(err);\n })\n })\n }\n\n sendCall(requestParams: any, variable: any) {\n return new Promise((resolve, reject) => {\n this.send(requestParams, variable).then((response: any) => {\n resolve(response);\n }, (err: any) => {\n reject(err);\n });\n });\n }\n\n getLocale() {\n const appConfig = injector.get<AppConfig>('APP_CONFIG');\n return appConfig.appLocale.messages;\n }\n\n cancel(variable: any) {\n variable.cancelTokenSource.cancel();\n }\n\n uploadFile(url: any, data: any, variable: any, options?: any) {\n const requestParams = {\n url: url,\n data: data\n }\n return new Promise((resolve, reject) => {\n return this.send(requestParams, variable).then((event: any) => {\n resolve(event.data);\n }, (error: any) => {\n reject(error);\n });\n });\n }\n}\n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TANTS","isWebPreviewMode","injector","HttpService","send","options","variable","serviceInfo","headers","requestBody","data","url","cancelTokenSource","CancelToken","source","consumes","formData","FormData","parameters","forEach","p","v","params","name","append","methodType","isNonDataMethod","NON_DATA_AXIOS_METHODS","indexOf","toUpperCase","axiosConfig","cancelToken","token","withCredentials","Promise","resolve","reject","apply","then","result","err","sendCall","requestParams","response","getLocale","appConfig","get","appLocale","messages","cancel","uploadFile","event","error","httpService"],"sources":["http.service.ts"],"sourcesContent":["import axios from 'axios';\nimport { HttpClientService } from '@wavemaker/variables/src/types/http-client.service';\nimport { WS_CONSTANTS } from '@wavemaker/app-rn-runtime/variables/utils/variable.constants';\nimport { get, isEmpty } from 'lodash';\nimport AppConfig from '@wavemaker/app-rn-runtime/core/AppConfig';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\n\nexport class HttpService implements HttpClientService {\n\n send(options: any, variable: any) {\n const serviceInfo = variable.serviceInfo;\n let headers: any = options.headers,\n requestBody: any = options.data,\n url: string = options.url;\n variable.cancelTokenSource = axios.CancelToken.source();\n if (!isWebPreviewMode() && (variable?.serviceInfo?.consumes||[])[0] === 'multipart/form-data') {\n headers['Content-Type'] = 'multipart/form-data';\n let formData = new FormData();\n (variable.serviceInfo.parameters||[]).forEach((p: any) => {\n const v = variable.params[p.name];\n if (v) {\n formData.append(p.name, variable.params[p.name]);\n }\n });\n requestBody = formData;\n }\n const methodType: string = serviceInfo.methodType;\n const isNonDataMethod: boolean = WS_CONSTANTS.NON_DATA_AXIOS_METHODS.indexOf(methodType.toUpperCase()) > -1;\n const axiosConfig = {\n headers: headers,\n cancelToken: variable.cancelTokenSource.token,\n withCredentials: true\n };\n return new Promise((resolve, reject) => {\n // @ts-ignore\n axios[methodType].apply(variable, ( isNonDataMethod ? [url, axiosConfig] : [url, requestBody || {}, axiosConfig]))\n .then((result: any) => {\n resolve(result);\n }, (err: any) => {\n reject(err);\n })\n })\n }\n\n sendCall(requestParams: any, variable: any) {\n return new Promise((resolve, reject) => {\n this.send(requestParams, variable).then((response: any) => {\n resolve(response);\n }, (err: any) => {\n reject(err);\n });\n });\n }\n\n getLocale() {\n const appConfig = injector.get<AppConfig>('APP_CONFIG');\n return appConfig.appLocale.messages;\n }\n\n cancel(variable: any) {\n variable.cancelTokenSource.cancel();\n }\n\n uploadFile(url: any, data: any, variable: any, options?: any) {\n const requestParams = {\n url: url,\n data: data\n }\n return new Promise((resolve, reject) => {\n return this.send(requestParams, variable).then((event: any) => {\n resolve(event.data);\n }, (error: any) => {\n reject(error);\n });\n });\n }\n}\n\nconst httpService = new HttpService();\n\nexport default httpService;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,YAAY,QAAQ,8DAA8D;AAG3F,SAASC,gBAAgB,QAAQ,sCAAsC;AACvE,OAAOC,QAAQ,MAAM,yCAAyC;AAE9D,OAAO,MAAMC,WAAW,CAA8B;EAEpDC,IAAI,CAACC,OAAY,EAAEC,QAAa,EAAE;IAAA;IAChC,MAAMC,WAAW,GAAGD,QAAQ,CAACC,WAAW;IACxC,IAAIC,OAAY,GAAGH,OAAO,CAACG,OAAO;MAChCC,WAAgB,GAAGJ,OAAO,CAACK,IAAI;MAC/BC,GAAW,GAAGN,OAAO,CAACM,GAAG;IACzBL,QAAQ,CAACM,iBAAiB,GAAGb,KAAK,CAACc,WAAW,CAACC,MAAM,EAAE;IACzD,IAAI,CAACb,gBAAgB,EAAE,IAAI,CAAC,CAAAK,QAAQ,aAARA,QAAQ,gDAARA,QAAQ,CAAEC,WAAW,0DAArB,sBAAuBQ,QAAQ,KAAE,EAAE,EAAE,CAAC,CAAC,KAAK,qBAAqB,EAAE;MAC7FP,OAAO,CAAC,cAAc,CAAC,GAAG,qBAAqB;MAC/C,IAAIQ,QAAQ,GAAG,IAAIC,QAAQ,EAAE;MAC7B,CAACX,QAAQ,CAACC,WAAW,CAACW,UAAU,IAAE,EAAE,EAAEC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QAAa,IAAK;QACvDR,OAAO,CAACQ,QAAQ,CAAC;MACrB,CAAC,EAAGH,GAAQ,IAAK;QACfJ,MAAM,CAACI,GAAG,CAAC;MACb,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;EAEAI,SAAS,GAAG;IACV,MAAMC,SAAS,GAAG3C,QAAQ,CAAC4C,GAAG,CAAY,YAAY,CAAC;IACvD,OAAOD,SAAS,CAACE,SAAS,CAACC,QAAQ;EACrC;EAEAC,MAAM,CAAC3C,QAAa,EAAE;IACpBA,QAAQ,CAACM,iBAAiB,CAACqC,MAAM,EAAE;EACrC;EAEAC,UAAU,CAACvC,GAAQ,EAAED,IAAS,EAAEJ,QAAa,EAAED,OAAa,EAAE;IAC5D,MAAMqC,aAAa,GAAG;MACpB/B,GAAG,EAAEA,GAAG;MACRD,IAAI,EAAEA;IACR,CAAC;IACD,OAAO,IAAIwB,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;MACtC,OAAO,IAAI,CAAChC,IAAI,CAACsC,aAAa,EAAEpC,QAAQ,CAAC,CAACgC,IAAI,CAAEa,KAAU,IAAK;QAC7DhB,OAAO,CAACgB,KAAK,CAACzC,IAAI,CAAC;MACrB,CAAC,EAAG0C,KAAU,IAAK;QACjBhB,MAAM,CAACgB,KAAK,CAAC;MACf,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ;AACF;AAEA,MAAMC,WAAW,GAAG,IAAIlD,WAAW,EAAE;AAErC,eAAekD,WAAW"}
@@ -1,7 +1,9 @@
1
1
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
2
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
3
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
- import { isEqual, isEmpty } from 'lodash';
4
+ import { VariableEvents } from './base-variable';
5
+ import { isEqual } from 'lodash';
6
+ import { deepCopy } from '@wavemaker/app-rn-runtime/core/utils';
5
7
  import { ServiceVariable as _ServiceVariable } from '@wavemaker/variables/src/model/variable/service-variable';
6
8
  import httpService from '@wavemaker/app-rn-runtime/variables/http.service';
7
9
  import injector from '@wavemaker/app-rn-runtime/core/injector';
@@ -14,7 +16,7 @@ export class ServiceVariable extends _ServiceVariable {
14
16
  const variableConfig = {
15
17
  name: config.name,
16
18
  dataSet: config.paramProvider(),
17
- dataBinding: config.paramProvider(),
19
+ dataBinding: {},
18
20
  isList: config.isList,
19
21
  service: config.service,
20
22
  serviceType: config.serviceType,
@@ -34,7 +36,7 @@ export class ServiceVariable extends _ServiceVariable {
34
36
  return config.onCanUpdate && config.onCanUpdate(args.variable, args.data, args.options);
35
37
  },
36
38
  onBeforeUpdate: (context, args) => {
37
- return config.onBeforeUpdate && config.onBeforeUpdate(args.variable, args.data, args.options);
39
+ return config.onBeforeUpdate && config.onBeforeUpdate(args.variable, args.inputData, args.options);
38
40
  },
39
41
  onResult: (context, args) => {
40
42
  return config.onResult && config.onResult(args.variable, args.data, args.options);
@@ -48,6 +50,9 @@ export class ServiceVariable extends _ServiceVariable {
48
50
  _defineProperty(this, "cancelTokenSource", void 0);
49
51
  _defineProperty(this, "params", {});
50
52
  _defineProperty(this, "appConfig", injector.get('APP_CONFIG'));
53
+ this.subscribe(VariableEvents.AFTER_INVOKE, () => {
54
+ this.dataBinding = {};
55
+ });
51
56
  }
52
57
  invokeOnParamChange() {
53
58
  const last = this.params;
@@ -68,11 +73,12 @@ export class ServiceVariable extends _ServiceVariable {
68
73
  }
69
74
  invoke(options, onSuccess, onError) {
70
75
  this.params = this.config.paramProvider();
71
- let params = options ? options.inputFields ? options.inputFields : options : undefined;
72
- if (!params) {
73
- params = !isEmpty(this.dataBinding) ? this.dataBinding : this.config.paramProvider();
76
+ this.params = deepCopy({}, this.params, this.dataBinding);
77
+ if (options) {
78
+ this.params = deepCopy({}, this.params, options.inputFields ? options.inputFields : options);
74
79
  }
75
- this.dataBinding = params;
80
+ options = options || {};
81
+ options.inputFields = this.params;
76
82
  // service definitions data depends on whether user logged in or not
77
83
  // Try to get the latest definition
78
84
  this.serviceInfo = this.config.getServiceInfo();
@@ -1 +1 @@
1
- {"version":3,"names":["isEqual","isEmpty","ServiceVariable","_ServiceVariable","httpService","injector","_ServiceVariableEvents","constructor","config","variableConfig","name","dataSet","paramProvider","dataBinding","isList","service","serviceType","maxResults","_context","operation","operationId","serviceInfo","getServiceInfo","httpClientService","onSuccess","context","args","variable","data","options","onError","onCanUpdate","onBeforeUpdate","onResult","onBeforeDatasetReady","get","invokeOnParamChange","last","params","latest","invoke","Promise","resolve","doNext","currentPage","reject","onDataUpdated","appConfig","refresh","inputFields","undefined","console","error"],"sources":["service-variable.ts"],"sourcesContent":["import { VariableConfig, VariableEvents } from './base-variable';\nimport { isEqual, isEmpty } from 'lodash';\nimport AppConfig from '@wavemaker/app-rn-runtime/core/AppConfig';\nimport { $queue } from './utils/inflight-queue';\nimport { ServiceVariable as _ServiceVariable } from '@wavemaker/variables/src/model/variable/service-variable';\nimport httpService from '@wavemaker/app-rn-runtime/variables/http.service';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\n\nexport interface ServiceVariableConfig extends VariableConfig {\n baseUrl: string;\n maxResults: number;\n _context: any;\n serviceType: string;\n onCanUpdate: any;\n onBeforeUpdate: any;\n onResult: any;\n onBeforeDatasetReady: any;\n inFlightBehavior: string;\n getServiceInfo: Function;\n}\n\nenum _ServiceVariableEvents {\n BEFORE_INVOKE = 'beforeInvoke'\n}\nexport type ServiceVariableEvents = _ServiceVariableEvents | VariableEvents;\n\nexport class ServiceVariable extends _ServiceVariable {\n private cancelTokenSource: any;\n params: any = {};\n public appConfig = injector.get<AppConfig>('APP_CONFIG');\n\n constructor(public config: ServiceVariableConfig) {\n const variableConfig = {\n name: config.name,\n dataSet: config.paramProvider(),\n dataBinding: config.paramProvider(),\n isList: config.isList,\n service: config.service,\n serviceType: config.serviceType,\n maxResults: config.maxResults,\n _context: config._context,\n operation: config.operation,\n operationId: config.operationId,\n serviceInfo: config.getServiceInfo(),\n httpClientService: httpService,\n onSuccess: (context: any, args: any) => {\n return config.onSuccess && config.onSuccess(args.variable, args.data, args.options);\n },\n onError: (context: any, args: any) => {\n return config.onError && config.onError(args.variable, args.data, args.options);\n },\n onCanUpdate: (context: any, args: any) => {\n return config.onCanUpdate && config.onCanUpdate(args.variable, args.data, args.options);\n },\n onBeforeUpdate: (context: any, args: any) => {\n return config.onBeforeUpdate && config.onBeforeUpdate(args.variable, args.data, args.options);\n },\n onResult: (context: any, args: any) => {\n return config.onResult && config.onResult(args.variable, args.data, args.options);\n },\n onBeforeDatasetReady: (context: any, args: any) => {\n return config.onBeforeDatasetReady && config.onBeforeDatasetReady(args.variable, args.data, args.options);\n }\n }\n super(variableConfig);\n }\n\n invokeOnParamChange() {\n const last = this.params;\n const latest = this.config.paramProvider();\n if (!isEqual(last, latest)) {\n this.invoke(latest);\n }\n return Promise.resolve(this);\n }\n\n public doNext(currentPage: number) {\n // this.invoke({\n // page: currentPage\n // });\n return Promise.reject(this);\n }\n\n onDataUpdated() {\n this.appConfig.refresh(false);\n }\n\n invoke(options? : any, onSuccess?: Function, onError?: Function) {\n this.params = this.config.paramProvider();\n let params = options ? (options.inputFields ? options.inputFields : options) : undefined;\n if (!params) {\n params = !isEmpty(this.dataBinding) ? this.dataBinding : this.config.paramProvider();\n }\n this.dataBinding = params;\n // service definitions data depends on whether user logged in or not\n // Try to get the latest definition\n this.serviceInfo = this.config.getServiceInfo();\n if (!this.serviceInfo) {\n console.error(`Service Info is missing for (${this.name}) variable.`)\n }\n return super.invoke(options, onSuccess, onError);\n }\n\n // cancel($file?: any) {\n // // CHecks if there is any pending requests in the queue\n // if ($queue.requestsQueue.has(this)) {\n // // If the request is a File upload request then modify the elements associated with file upload\n // // else unsubscribe from the observable on the variable.\n // if (false) {\n // // $file._uploadProgress.unsubscribe();\n // // $file.status = 'abort';\n // // this.totalFilesCount--;\n // // initiateCallback(VARIABLE_CONSTANTS.EVENT.ABORT, variable, $file);\n // // if (!this.isFileUploadInProgress(variable.dataBinding) && this.totalFilesCount === 0) {\n // // $queue.process(variable);\n // // // notify inflight variable\n // // this.notifyInflight(variable, false);\n // // }\n // } else {\n // if (true) {\n // this.cancelTokenSource.cancel();\n // $queue.process(this);\n // // notify inflight variable\n // //this.notifyInflight(variable, false);\n // }\n // }\n // }\n // }\n\n // setInput(key: any, val?: any, options?: any) {\n // this.params = merge({}, this.config.paramProvider(), _setInput(this.params, key, val, options));\n // return this.params;\n // }\n}\n"],"mappings":";;;AACA,SAASA,OAAO,EAAEC,OAAO,QAAQ,QAAQ;AAGzC,SAASC,eAAe,IAAIC,gBAAgB,QAAQ,0DAA0D;AAC9G,OAAOC,WAAW,MAAM,kDAAkD;AAC1E,OAAOC,QAAQ,MAAM,yCAAyC;AAAC,IAe1DC,sBAAsB;AAAA,WAAtBA,sBAAsB;EAAtBA,sBAAsB;AAAA,GAAtBA,sBAAsB,KAAtBA,sBAAsB;AAK3B,OAAO,MAAMJ,eAAe,SAASC,gBAAgB,CAAC;EAKpDI,WAAW,CAAQC,MAA6B,EAAE;IAChD,MAAMC,cAAc,GAAG;MACrBC,IAAI,EAAEF,MAAM,CAACE,IAAI;MACjBC,OAAO,EAAEH,MAAM,CAACI,aAAa,EAAE;MAC/BC,WAAW,EAAEL,MAAM,CAACI,aAAa,EAAE;MACnCE,MAAM,EAAEN,MAAM,CAACM,MAAM;MACrBC,OAAO,EAAEP,MAAM,CAACO,OAAO;MACvBC,WAAW,EAAER,MAAM,CAACQ,WAAW;MAC/BC,UAAU,EAAET,MAAM,CAACS,UAAU;MAC7BC,QAAQ,EAAEV,MAAM,CAACU,QAAQ;MAC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CAACC,WAAW,GAAGyB,MAAM;IACvB;IACF;IACA,IAAI,CAACjB,WAAW,GAAG,IAAI,CAACb,MAAM,CAACc,cAAc,EAAE;IAC/C,IAAI,CAAC,IAAI,CAACD,WAAW,EAAE;MACrB8B,OAAO,CAACC,KAAK,CAAE,gCAA+B,IAAI,CAAC1C,IAAK,aAAY,CAAC;IACvE;IACA,OAAO,KAAK,CAAC8B,MAAM,CAACX,OAAO,EAAEL,SAAS,EAAEM,OAAO,CAAC;EAClD;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;AACF"}
1
+ {"version":3,"names":["VariableEvents","isEqual","deepCopy","ServiceVariable","_ServiceVariable","httpService","injector","_ServiceVariableEvents","constructor","config","variableConfig","name","dataSet","paramProvider","dataBinding","isList","service","serviceType","maxResults","_context","operation","operationId","serviceInfo","getServiceInfo","httpClientService","onSuccess","context","args","variable","data","options","onError","onCanUpdate","onBeforeUpdate","inputData","onResult","onBeforeDatasetReady","get","subscribe","AFTER_INVOKE","invokeOnParamChange","last","params","latest","invoke","Promise","resolve","doNext","currentPage","reject","onDataUpdated","appConfig","refresh","inputFields","console","error"],"sources":["service-variable.ts"],"sourcesContent":["import { VariableConfig, VariableEvents } from './base-variable';\nimport { isEqual, assignIn } from 'lodash';\nimport AppConfig from '@wavemaker/app-rn-runtime/core/AppConfig';\nimport { deepCopy } from '@wavemaker/app-rn-runtime/core/utils';\nimport { ServiceVariable as _ServiceVariable } from '@wavemaker/variables/src/model/variable/service-variable';\nimport httpService from '@wavemaker/app-rn-runtime/variables/http.service';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\n\nexport interface ServiceVariableConfig extends VariableConfig {\n baseUrl: string;\n maxResults: number;\n _context: any;\n serviceType: string;\n onCanUpdate: any;\n onBeforeUpdate: any;\n onResult: any;\n onBeforeDatasetReady: any;\n inFlightBehavior: string;\n getServiceInfo: Function;\n}\n\nenum _ServiceVariableEvents {\n BEFORE_INVOKE = 'beforeInvoke'\n}\nexport type ServiceVariableEvents = _ServiceVariableEvents | VariableEvents;\n\nexport class ServiceVariable extends _ServiceVariable {\n private cancelTokenSource: any;\n params: any = {};\n public appConfig = injector.get<AppConfig>('APP_CONFIG');\n\n constructor(public config: ServiceVariableConfig) {\n const variableConfig = {\n name: config.name,\n dataSet: config.paramProvider(),\n dataBinding: {},\n isList: config.isList,\n service: config.service,\n serviceType: config.serviceType,\n maxResults: config.maxResults,\n _context: config._context,\n operation: config.operation,\n operationId: config.operationId,\n serviceInfo: config.getServiceInfo(),\n httpClientService: httpService,\n onSuccess: (context: any, args: any) => {\n return config.onSuccess && config.onSuccess(args.variable, args.data, args.options);\n },\n onError: (context: any, args: any) => {\n return config.onError && config.onError(args.variable, args.data, args.options);\n },\n onCanUpdate: (context: any, args: any) => {\n return config.onCanUpdate && config.onCanUpdate(args.variable, args.data, args.options);\n },\n onBeforeUpdate: (context: any, args: any) => {\n return config.onBeforeUpdate && config.onBeforeUpdate(args.variable, args.inputData, args.options);\n },\n onResult: (context: any, args: any) => {\n return config.onResult && config.onResult(args.variable, args.data, args.options);\n },\n onBeforeDatasetReady: (context: any, args: any) => {\n return config.onBeforeDatasetReady && config.onBeforeDatasetReady(args.variable, args.data, args.options);\n }\n }\n super(variableConfig);\n this.subscribe(VariableEvents.AFTER_INVOKE, () => {\n this.dataBinding = {};\n });\n }\n\n invokeOnParamChange() {\n const last = this.params;\n const latest = this.config.paramProvider();\n if (!isEqual(last, latest)) {\n this.invoke(latest);\n }\n return Promise.resolve(this);\n }\n\n public doNext(currentPage: number) {\n // this.invoke({\n // page: currentPage\n // });\n return Promise.reject(this);\n }\n\n onDataUpdated() {\n this.appConfig.refresh(false);\n }\n\n invoke(options? : any, onSuccess?: Function, onError?: Function) {\n this.params = this.config.paramProvider();\n this.params = deepCopy({} as any, this.params, this.dataBinding);\n if (options) {\n this.params = deepCopy({} as any, this.params, options.inputFields ? options.inputFields : options);\n }\n options = options || {};\n options.inputFields = this.params;\n // service definitions data depends on whether user logged in or not\n // Try to get the latest definition\n this.serviceInfo = this.config.getServiceInfo();\n if (!this.serviceInfo) {\n console.error(`Service Info is missing for (${this.name}) variable.`)\n }\n return super.invoke(options, onSuccess, onError);\n }\n\n // cancel($file?: any) {\n // // CHecks if there is any pending requests in the queue\n // if ($queue.requestsQueue.has(this)) {\n // // If the request is a File upload request then modify the elements associated with file upload\n // // else unsubscribe from the observable on the variable.\n // if (false) {\n // // $file._uploadProgress.unsubscribe();\n // // $file.status = 'abort';\n // // this.totalFilesCount--;\n // // initiateCallback(VARIABLE_CONSTANTS.EVENT.ABORT, variable, $file);\n // // if (!this.isFileUploadInProgress(variable.dataBinding) && this.totalFilesCount === 0) {\n // // $queue.process(variable);\n // // // notify inflight variable\n // // this.notifyInflight(variable, false);\n // // }\n // } else {\n // if (true) {\n // this.cancelTokenSource.cancel();\n // $queue.process(this);\n // // notify inflight variable\n // //this.notifyInflight(variable, false);\n // }\n // }\n // }\n // }\n\n // setInput(key: any, val?: any, options?: any) {\n // this.params = merge({}, this.config.paramProvider(), _setInput(this.params, key, val, options));\n // return this.params;\n // }\n}\n"],"mappings":";;;AAAA,SAAyBA,cAAc,QAAQ,iBAAiB;AAChE,SAASC,OAAO,QAAkB,QAAQ;AAE1C,SAASC,QAAQ,QAAQ,sCAAsC;AAC/D,SAASC,eAAe,IAAIC,gBAAgB,QAAQ,0DAA0D;AAC9G,OAAOC,WAAW,MAAM,kDAAkD;AAC1E,OAAOC,QAAQ,MAAM,yCAAyC;AAAC,IAe1DC,sBAAsB;AAAA,WAAtBA,sBAAsB;EAAtBA,sBAAsB;AAAA,GAAtBA,sBAAsB,KAAtBA,sBAAsB;AAK3B,OAAO,MAAMJ,eAAe,SAASC,gBAAgB,CAAC;EAKpDI,WAAW,CAAQC,MAA6B,EAAE;IAChD,MAAMC,cAAc,GAAG;MACrBC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