@wavemaker/app-rn-runtime 12.0.0-next.45752 → 12.0.0-next.46502

Sign up to get free protection for your applications and to get access to all the features.
Files changed (289) hide show
  1. app-rn-runtime/components/advanced/carousel/carousel.component.js +14 -2
  2. app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
  3. app-rn-runtime/components/advanced/carousel/carousel.props.js +1 -0
  4. app-rn-runtime/components/advanced/carousel/carousel.props.js.map +1 -1
  5. app-rn-runtime/components/advanced/carousel/carousel.styles.js +15 -0
  6. app-rn-runtime/components/advanced/carousel/carousel.styles.js.map +1 -1
  7. app-rn-runtime/components/basic/anchor/anchor.component.js +15 -5
  8. app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
  9. app-rn-runtime/components/basic/anchor/anchor.styles.js +3 -0
  10. app-rn-runtime/components/basic/anchor/anchor.styles.js.map +1 -1
  11. app-rn-runtime/components/basic/audio/audio.component.js +9 -2
  12. app-rn-runtime/components/basic/audio/audio.component.js.map +1 -1
  13. app-rn-runtime/components/basic/audio/audio.styles.js +7 -0
  14. app-rn-runtime/components/basic/audio/audio.styles.js.map +1 -1
  15. app-rn-runtime/components/basic/button/button.component.js +15 -2
  16. app-rn-runtime/components/basic/button/button.component.js.map +1 -1
  17. app-rn-runtime/components/basic/custom/custom.component.js +1 -1
  18. app-rn-runtime/components/basic/custom/custom.component.js.map +1 -1
  19. app-rn-runtime/components/basic/icon/icon.component.js +10 -2
  20. app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
  21. app-rn-runtime/components/basic/label/label.component.js +13 -3
  22. app-rn-runtime/components/basic/label/label.component.js.map +1 -1
  23. app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
  24. app-rn-runtime/components/basic/lottie/lottie.component.js +3 -1
  25. app-rn-runtime/components/basic/lottie/lottie.component.js.map +1 -1
  26. app-rn-runtime/components/basic/search/search.component.js +10 -1
  27. app-rn-runtime/components/basic/search/search.component.js.map +1 -1
  28. app-rn-runtime/components/basic/search/search.props.js +3 -0
  29. app-rn-runtime/components/basic/search/search.props.js.map +1 -1
  30. app-rn-runtime/components/basic/search/search.styles.js +5 -0
  31. app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
  32. app-rn-runtime/components/basic/skeleton/skeleton.component.js +6 -3
  33. app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
  34. app-rn-runtime/components/basic/skeleton/skeleton.props.js +9 -1
  35. app-rn-runtime/components/basic/skeleton/skeleton.props.js.map +1 -1
  36. app-rn-runtime/components/basic/video/video.component.js +6 -0
  37. app-rn-runtime/components/basic/video/video.component.js.map +1 -1
  38. app-rn-runtime/components/basic/video/video.styles.js +7 -1
  39. app-rn-runtime/components/basic/video/video.styles.js.map +1 -1
  40. app-rn-runtime/components/chart/area-chart/area-chart.component.js +2 -1
  41. app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
  42. app-rn-runtime/components/chart/area-chart/area-chart.styles.js +7 -1
  43. app-rn-runtime/components/chart/area-chart/area-chart.styles.js.map +1 -1
  44. app-rn-runtime/components/chart/bar-chart/bar-chart.styles.js +7 -1
  45. app-rn-runtime/components/chart/bar-chart/bar-chart.styles.js.map +1 -1
  46. app-rn-runtime/components/chart/basechart.component.js +23 -0
  47. app-rn-runtime/components/chart/basechart.component.js.map +1 -1
  48. app-rn-runtime/components/chart/basechart.props.js +2 -2
  49. app-rn-runtime/components/chart/basechart.props.js.map +1 -1
  50. app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
  51. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +1 -1
  52. app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
  53. app-rn-runtime/components/chart/bubble-chart/bubble-chart.styles.js +7 -1
  54. app-rn-runtime/components/chart/bubble-chart/bubble-chart.styles.js.map +1 -1
  55. app-rn-runtime/components/chart/column-chart/column-chart.styles.js +7 -1
  56. app-rn-runtime/components/chart/column-chart/column-chart.styles.js.map +1 -1
  57. app-rn-runtime/components/chart/donut-chart/donut-chart.styles.js +7 -1
  58. app-rn-runtime/components/chart/donut-chart/donut-chart.styles.js.map +1 -1
  59. app-rn-runtime/components/chart/line-chart/line-chart.props.js +2 -0
  60. app-rn-runtime/components/chart/line-chart/line-chart.props.js.map +1 -1
  61. app-rn-runtime/components/chart/line-chart/line-chart.styles.js +7 -1
  62. app-rn-runtime/components/chart/line-chart/line-chart.styles.js.map +1 -1
  63. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +2 -1
  64. app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
  65. app-rn-runtime/components/chart/pie-chart/pie-chart.styles.js +7 -1
  66. app-rn-runtime/components/chart/pie-chart/pie-chart.styles.js.map +1 -1
  67. app-rn-runtime/components/container/accordion/accordion.component.js +58 -11
  68. app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
  69. app-rn-runtime/components/container/accordion/accordion.props.js.map +1 -1
  70. app-rn-runtime/components/container/accordion/accordion.styles.js +4 -0
  71. app-rn-runtime/components/container/accordion/accordion.styles.js.map +1 -1
  72. app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +11 -1
  73. app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
  74. app-rn-runtime/components/container/container.component.js +44 -3
  75. app-rn-runtime/components/container/container.component.js.map +1 -1
  76. app-rn-runtime/components/container/container.props.js +1 -0
  77. app-rn-runtime/components/container/container.props.js.map +1 -1
  78. app-rn-runtime/components/container/container.styles.js +7 -0
  79. app-rn-runtime/components/container/container.styles.js.map +1 -1
  80. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js +5 -1
  81. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js.map +1 -1
  82. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js +6 -1
  83. app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js.map +1 -1
  84. app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js +28 -2
  85. app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js.map +1 -1
  86. app-rn-runtime/components/container/layoutgrid/layoutgrid.props.js.map +1 -1
  87. app-rn-runtime/components/container/layoutgrid/layoutgrid.styles.js +4 -1
  88. app-rn-runtime/components/container/layoutgrid/layoutgrid.styles.js.map +1 -1
  89. app-rn-runtime/components/container/linearlayout/linearlayout.component.js +31 -5
  90. app-rn-runtime/components/container/linearlayout/linearlayout.component.js.map +1 -1
  91. app-rn-runtime/components/container/linearlayout/linearlayout.props.js.map +1 -1
  92. app-rn-runtime/components/container/linearlayout/linearlayout.styles.js +4 -1
  93. app-rn-runtime/components/container/linearlayout/linearlayout.styles.js.map +1 -1
  94. app-rn-runtime/components/container/panel/panel.component.js +43 -4
  95. app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
  96. app-rn-runtime/components/container/panel/panel.props.js.map +1 -1
  97. app-rn-runtime/components/container/panel/panel.styles.js +3 -0
  98. app-rn-runtime/components/container/panel/panel.styles.js.map +1 -1
  99. app-rn-runtime/components/container/partial-host.component.js.map +1 -1
  100. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +2 -2
  101. app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
  102. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +11 -1
  103. app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
  104. app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js +1 -0
  105. app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js.map +1 -1
  106. app-rn-runtime/components/container/tabs/tabs.component.js +41 -6
  107. app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
  108. app-rn-runtime/components/container/tabs/tabs.styles.js +4 -1
  109. app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
  110. app-rn-runtime/components/container/tile/tile.component.js +28 -2
  111. app-rn-runtime/components/container/tile/tile.component.js.map +1 -1
  112. app-rn-runtime/components/container/tile/tile.props.js.map +1 -1
  113. app-rn-runtime/components/container/tile/tile.styles.js +6 -1
  114. app-rn-runtime/components/container/tile/tile.styles.js.map +1 -1
  115. app-rn-runtime/components/container/wizard/wizard.component.js +39 -6
  116. app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
  117. app-rn-runtime/components/container/wizard/wizard.props.js.map +1 -1
  118. app-rn-runtime/components/container/wizard/wizard.styles.js +3 -0
  119. app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
  120. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +8 -1
  121. app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
  122. app-rn-runtime/components/data/card/card-content/card-content.component.js +6 -2
  123. app-rn-runtime/components/data/card/card-content/card-content.component.js.map +1 -1
  124. app-rn-runtime/components/data/card/card-content/card-content.styles.js +4 -1
  125. app-rn-runtime/components/data/card/card-content/card-content.styles.js.map +1 -1
  126. app-rn-runtime/components/data/card/card.component.js +18 -0
  127. app-rn-runtime/components/data/card/card.component.js.map +1 -1
  128. app-rn-runtime/components/data/card/card.styles.js +3 -0
  129. app-rn-runtime/components/data/card/card.styles.js.map +1 -1
  130. app-rn-runtime/components/data/form/form-field/form-field.component.js +2 -1
  131. app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
  132. app-rn-runtime/components/data/form/form.component.js +1 -1
  133. app-rn-runtime/components/data/form/form.component.js.map +1 -1
  134. app-rn-runtime/components/data/form/form.props.js +1 -0
  135. app-rn-runtime/components/data/form/form.props.js.map +1 -1
  136. app-rn-runtime/components/data/list/list-template/list-template.component.js +15 -1
  137. app-rn-runtime/components/data/list/list-template/list-template.component.js.map +1 -1
  138. app-rn-runtime/components/data/list/list-template/list-template.props.js +1 -0
  139. app-rn-runtime/components/data/list/list-template/list-template.props.js.map +1 -1
  140. app-rn-runtime/components/data/list/list-template/list-template.styles.js +11 -1
  141. app-rn-runtime/components/data/list/list-template/list-template.styles.js.map +1 -1
  142. app-rn-runtime/components/data/list/list.component.js +32 -24
  143. app-rn-runtime/components/data/list/list.component.js.map +1 -1
  144. app-rn-runtime/components/data/list/list.props.js +1 -0
  145. app-rn-runtime/components/data/list/list.props.js.map +1 -1
  146. app-rn-runtime/components/data/list/list.styles.js +9 -0
  147. app-rn-runtime/components/data/list/list.styles.js.map +1 -1
  148. app-rn-runtime/components/dialogs/dialog/dialog.styles.js.map +1 -1
  149. app-rn-runtime/components/input/baseinput/baseinput.component.js +46 -10
  150. app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
  151. app-rn-runtime/components/input/basenumber/basenumber.component.js +19 -6
  152. app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
  153. app-rn-runtime/components/input/calendar/calendar.component.js +25 -0
  154. app-rn-runtime/components/input/calendar/calendar.component.js.map +1 -1
  155. app-rn-runtime/components/input/calendar/calendar.styles.js +19 -0
  156. app-rn-runtime/components/input/calendar/calendar.styles.js.map +1 -1
  157. app-rn-runtime/components/input/checkbox/checkbox.component.js +23 -3
  158. app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
  159. app-rn-runtime/components/input/checkbox/checkbox.styles.js +19 -2
  160. app-rn-runtime/components/input/checkbox/checkbox.styles.js.map +1 -1
  161. app-rn-runtime/components/input/checkboxset/checkboxset.component.js +21 -1
  162. app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
  163. app-rn-runtime/components/input/checkboxset/checkboxset.props.js +1 -0
  164. app-rn-runtime/components/input/checkboxset/checkboxset.props.js.map +1 -1
  165. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js +1 -0
  166. app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
  167. app-rn-runtime/components/input/chips/chips.component.js +16 -2
  168. app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
  169. app-rn-runtime/components/input/chips/chips.styles.js +8 -0
  170. app-rn-runtime/components/input/chips/chips.styles.js.map +1 -1
  171. app-rn-runtime/components/input/currency/currency.component.js +14 -4
  172. app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
  173. app-rn-runtime/components/input/currency/currency.styles.js +43 -1
  174. app-rn-runtime/components/input/currency/currency.styles.js.map +1 -1
  175. app-rn-runtime/components/input/epoch/base-datetime.component.js +26 -5
  176. app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
  177. app-rn-runtime/components/input/epoch/datetime/datetime.props.js +6 -0
  178. app-rn-runtime/components/input/epoch/datetime/datetime.props.js.map +1 -1
  179. app-rn-runtime/components/input/epoch/datetime/datetime.styles.js +13 -0
  180. app-rn-runtime/components/input/epoch/datetime/datetime.styles.js.map +1 -1
  181. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js +7 -4
  182. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js.map +1 -1
  183. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js +3 -0
  184. app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js.map +1 -1
  185. app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.component.js +7 -4
  186. app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.component.js.map +1 -1
  187. app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.props.js +3 -0
  188. app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.props.js.map +1 -1
  189. app-rn-runtime/components/input/number/number.component.js +17 -3
  190. app-rn-runtime/components/input/number/number.component.js.map +1 -1
  191. app-rn-runtime/components/input/number/number.styles.js +24 -1
  192. app-rn-runtime/components/input/number/number.styles.js.map +1 -1
  193. app-rn-runtime/components/input/radioset/radioset.component.js +33 -8
  194. app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
  195. app-rn-runtime/components/input/radioset/radioset.props.js +2 -0
  196. app-rn-runtime/components/input/radioset/radioset.props.js.map +1 -1
  197. app-rn-runtime/components/input/radioset/radioset.styles.js +7 -0
  198. app-rn-runtime/components/input/radioset/radioset.styles.js.map +1 -1
  199. app-rn-runtime/components/input/select/select.component.js +11 -3
  200. app-rn-runtime/components/input/select/select.component.js.map +1 -1
  201. app-rn-runtime/components/input/select/select.styles.js +24 -0
  202. app-rn-runtime/components/input/select/select.styles.js.map +1 -1
  203. app-rn-runtime/components/input/switch/switch.component.js +13 -3
  204. app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
  205. app-rn-runtime/components/input/switch/switch.styles.js +15 -0
  206. app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
  207. app-rn-runtime/components/input/text/text.component.js +26 -2
  208. app-rn-runtime/components/input/text/text.component.js.map +1 -1
  209. app-rn-runtime/components/input/text/text.props.js +3 -0
  210. app-rn-runtime/components/input/text/text.props.js.map +1 -1
  211. app-rn-runtime/components/input/text/text.styles.js +3 -0
  212. app-rn-runtime/components/input/text/text.styles.js.map +1 -1
  213. app-rn-runtime/components/input/textarea/textarea.component.js +24 -1
  214. app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
  215. app-rn-runtime/components/input/textarea/textarea.props.js +2 -0
  216. app-rn-runtime/components/input/textarea/textarea.props.js.map +1 -1
  217. app-rn-runtime/components/input/textarea/textarea.styles.js +3 -0
  218. app-rn-runtime/components/input/textarea/textarea.styles.js.map +1 -1
  219. app-rn-runtime/components/input/toggle/toggle.component.js +6 -0
  220. app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
  221. app-rn-runtime/components/input/toggle/toggle.props.js +2 -0
  222. app-rn-runtime/components/input/toggle/toggle.props.js.map +1 -1
  223. app-rn-runtime/components/input/toggle/toggle.styles.js +7 -0
  224. app-rn-runtime/components/input/toggle/toggle.styles.js.map +1 -1
  225. app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
  226. app-rn-runtime/components/page/content/content.component.js.map +1 -1
  227. app-rn-runtime/components/page/left-panel/left-panel.component.js +4 -1
  228. app-rn-runtime/components/page/left-panel/left-panel.component.js.map +1 -1
  229. app-rn-runtime/components/page/page-content/page-content.component.js +70 -14
  230. app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
  231. app-rn-runtime/components/page/page-content/page-content.props.js +2 -2
  232. app-rn-runtime/components/page/page-content/page-content.props.js.map +1 -1
  233. app-rn-runtime/components/page/page-content/page-content.styles.js +6 -1
  234. app-rn-runtime/components/page/page-content/page-content.styles.js.map +1 -1
  235. app-rn-runtime/components/page/page.component.js.map +1 -1
  236. app-rn-runtime/components/page/page.props.js.map +1 -1
  237. app-rn-runtime/components/page/page.styles.js +7 -1
  238. app-rn-runtime/components/page/page.styles.js.map +1 -1
  239. app-rn-runtime/components/page/partial/partial.component.js +27 -1
  240. app-rn-runtime/components/page/partial/partial.component.js.map +1 -1
  241. app-rn-runtime/components/page/partial/partial.props.js.map +1 -1
  242. app-rn-runtime/components/page/partial/partial.styles.js +6 -1
  243. app-rn-runtime/components/page/partial/partial.styles.js.map +1 -1
  244. app-rn-runtime/components/prefab/prefab-container.component.js +27 -1
  245. app-rn-runtime/components/prefab/prefab-container.component.js.map +1 -1
  246. app-rn-runtime/components/prefab/prefab-container.props.js.map +1 -1
  247. app-rn-runtime/components/prefab/prefab-container.styles.js +6 -1
  248. app-rn-runtime/components/prefab/prefab-container.styles.js.map +1 -1
  249. app-rn-runtime/core/AppConfig.js.map +1 -1
  250. app-rn-runtime/core/base.component.js +33 -6
  251. app-rn-runtime/core/base.component.js.map +1 -1
  252. app-rn-runtime/core/components/textinput.component.js +9 -7
  253. app-rn-runtime/core/components/textinput.component.js.map +1 -1
  254. app-rn-runtime/core/props.provider.js +0 -1
  255. app-rn-runtime/core/props.provider.js.map +1 -1
  256. app-rn-runtime/core/storage.service.js +15 -0
  257. app-rn-runtime/core/storage.service.js.map +1 -1
  258. app-rn-runtime/core/tappable.component.js +10 -4
  259. app-rn-runtime/core/tappable.component.js.map +1 -1
  260. app-rn-runtime/core/utils.js +5 -0
  261. app-rn-runtime/core/utils.js.map +1 -1
  262. app-rn-runtime/core/wm-component-tree.js +58 -0
  263. app-rn-runtime/core/wm-component-tree.js.map +1 -0
  264. app-rn-runtime/package.json +13 -6
  265. app-rn-runtime/runtime/App.js +23 -9
  266. app-rn-runtime/runtime/App.js.map +1 -1
  267. app-rn-runtime/runtime/App.navigator.js +1 -0
  268. app-rn-runtime/runtime/App.navigator.js.map +1 -1
  269. app-rn-runtime/runtime/base-fragment.component.js +46 -13
  270. app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
  271. app-rn-runtime/runtime/base-page.component.js +38 -2
  272. app-rn-runtime/runtime/base-page.component.js.map +1 -1
  273. app-rn-runtime/runtime/base-partial.component.js +3 -0
  274. app-rn-runtime/runtime/base-partial.component.js.map +1 -1
  275. app-rn-runtime/runtime/base-prefab.component.js.map +1 -1
  276. app-rn-runtime/runtime/navigator/drawer.navigator.js +19 -10
  277. app-rn-runtime/runtime/navigator/drawer.navigator.js.map +1 -1
  278. app-rn-runtime/runtime/services/app-modal.service.js +4 -4
  279. app-rn-runtime/runtime/services/app-modal.service.js.map +1 -1
  280. app-rn-runtime/runtime/services/app-security.service.js +17 -1
  281. app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
  282. app-rn-runtime/styles/theme.js +10 -0
  283. app-rn-runtime/styles/theme.js.map +1 -1
  284. app-rn-runtime/styles/theme.variables.js +2 -1
  285. app-rn-runtime/styles/theme.variables.js.map +1 -1
  286. app-rn-runtime/variables/http.service.js +5 -1
  287. app-rn-runtime/variables/http.service.js.map +1 -1
  288. app-rn-runtime/variables/live-variable.js +14 -0
  289. app-rn-runtime/variables/live-variable.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","isEqual","isNil","get","find","cloneDeep","forEach","keys","WmFormFieldProps","DEFAULT_CLASS","PERFORMANCE_LOGGER","WmFormFieldState","constructor","args","_defineProperty","WmFormField","props","form","formScope","componentDidMount","_this$form","_this$form2","_this$form3","formwidget","formKey","formWidgets","name","registerFormFields","formFields","onFieldChangeEvt","$new","$old","isDefault","notifyChanges","updateState","datavalue","invokeEventCallback","undefined","validateFormField","updateDataOutput","call","observeOn","fields","field","formfield","f","proxy","notifyForFields","push","validate","setTimeout","getPromiseList","validators","arr","fn","promise","Function","bind","Promise","setAsyncValidators","_asyncValidatorFn","all","then","err","validationMsg","hasOwnProperty","messageKeys","toString","setInvalidState","setValidators","_cloneValidators","_syncValidators","obj","index","key","defaultValidatorMessages","value","propsObj","updateFormWidgetDataset","res","displayField","dataset","data","datafield","displayfield","state","msg","isValid","validationmessage","onPropertyChange","debug","applyDefaultValue","setPrimaryKey","setReadOnlyState","updateMode","_this$formwidget","readonly","_this$formwidget2","_this$_syncValidators","_this$formwidget3","errorType","errormsg","errorMessage","renderWidget","childrenWithProps","Children","map","renderFormFields","children","child","cloneElement","maskchar","displayformat","invokeEvent","triggerValidation","onFieldChange","formRef","placeholder","createElement","style","styles","root","_background","_extends","getTestPropsForLabel","errorMsg"],"sources":["form-field.component.tsx"],"sourcesContent":["import React from 'react';\nimport {Text, View} from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { widgetsWithUndefinedValue } from '@wavemaker/app-rn-runtime/core/utils';\nimport { isEqual, isNil, get, find, cloneDeep, forEach, keys } from 'lodash';\n\nimport WmFormFieldProps from './form-field.props';\nimport { DEFAULT_CLASS, WmFormFieldStyles } from './form-field.styles';\nimport {PERFORMANCE_LOGGER} from \"@wavemaker/app-rn-runtime/core/logger\";\n\nexport class WmFormFieldState extends BaseComponentState<WmFormFieldProps> {\n isValid = true;\n}\n\nexport default class WmFormField extends BaseComponent<WmFormFieldProps, WmFormFieldState, WmFormFieldStyles> {\n public form: any;\n public formwidget: any;\n public _syncValidators: any;\n public defaultValidatorMessages: any = [];\n private notifyForFields: any = [];\n private _asyncValidatorFn: any;\n constructor(props: WmFormFieldProps) {\n super(props, DEFAULT_CLASS, new WmFormFieldProps(), new WmFormFieldState());\n if (!this.form) {\n this.form = props.formScope && props.formScope();\n }\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.formwidget = (this.props.formKey && this.form?.formWidgets[this.props.formKey])\n || (this.props.name && this.form?.formWidgets[this.props.name]);\n this.form?.registerFormFields(this.form.formFields, this.form.formWidgets);\n }\n\n onFieldChangeEvt(name: string, $new: any, $old: any, isDefault: boolean) {\n this.notifyChanges();\n if (!isEqual($old, $new)) {\n this.updateState({ props: { datavalue: $new }} as WmFormFieldState, () => {\n !isDefault && this.invokeEventCallback('onChange', [undefined, this, $new, $old]);\n this.validateFormField();\n });\n if (this.form) {\n this.form.updateDataOutput.call(this.form, get(this.props, 'formKey', this.props.name), $new);\n }\n }\n }\n\n // Registers observer of validation fields\n observeOn(fields: any) {\n forEach(fields, (field) => {\n const formfield = find(this.form.formFields, (f) => f.proxy.name === field);\n if (formfield) {\n formfield.notifyForFields.push(this);\n }\n });\n }\n\n // Notifies changes to observing validation fields\n notifyChanges() {\n forEach(this.notifyForFields, (field) => {\n field.formwidget.validate(field.formwidget.datavalue);\n setTimeout(() => field.validateFormField());\n });\n }\n\n getPromiseList(validators: any) {\n const arr: any = [];\n forEach(validators, (fn) => {\n let promise = fn;\n if (fn instanceof Function && fn.bind) {\n promise = fn(this.formwidget.proxy, this.form);\n }\n if (promise instanceof Promise) {\n arr.push(promise);\n }\n });\n return arr;\n }\n\n // this method sets the asyncValidation on the form field. Assigns validationmessages from the returned response\n setAsyncValidators(validators: any) {\n this._asyncValidatorFn = () => {\n return Promise.all(this.getPromiseList(validators)).then(() => {\n return null;\n }, err => {\n let validationMsg: string;\n // if err obj has validationMessage key, then set validationMessage using this value\n // else return the value of the first key in the err object as validation message.\n if (err.hasOwnProperty('errorMessage')) {\n validationMsg = get(err, 'errorMessage');\n } else {\n const messageKeys = keys(err);\n validationMsg = (err[messageKeys[0]]).toString();\n }\n this.setInvalidState(validationMsg);\n return err;\n })\n };\n }\n\n // sets the default validation on the form field\n setValidators(validators: any) {\n let _cloneValidators = cloneDeep(validators);\n this._syncValidators = [];\n forEach(_cloneValidators, (obj, index) => {\n // custom validation is bound to function.\n if (obj && obj instanceof Function) {\n // passing formwidget and form as arguments to the obj (i.e. validator function)\n _cloneValidators[index] = obj.bind(undefined, this.formwidget.proxy, this.form);\n this._syncValidators.push(_cloneValidators[index]);\n } else {\n // checks for default validator like required, maxchars etc.\n const key = get(obj, 'type');\n this.defaultValidatorMessages[key] = get(obj, 'errorMessage');\n const value = get(obj, 'validator');\n let propsObj: any = {\n props: {}\n };\n propsObj.props[key] = value;\n key === 'required' && this.updateState(propsObj as WmFormFieldState);\n this.formwidget.updateState(propsObj as WmFormFieldState);\n }\n });\n }\n\n updateFormWidgetDataset(res: any, displayField: string) {\n this.formwidget.updateState({\n props: {\n dataset: res.data,\n datafield: 'All Fields',\n displayfield: this.formwidget.state.props.displayfield || displayField,\n }\n } as WmFormFieldState);\n }\n\n setInvalidState(msg: string) {\n this.updateState({\n isValid: false,\n props: {\n validationmessage: msg\n }\n } as WmFormFieldState)\n this.formwidget.updateState({\n isValid: false,\n props: {\n validationmessage: msg\n }\n } as WmFormFieldState);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'datavalue':\n if (!isEqual($old, $new)) {\n PERFORMANCE_LOGGER.debug(`form field ${this.props.name} changed from ${$old} to ${$new}`);\n }\n break;\n case 'defaultvalue':\n if (!isEqual($old, $new)) {\n get(this, 'form') && this.form.applyDefaultValue(this);\n }\n break;\n case 'primary-key':\n if ($new) {\n this.form.setPrimaryKey(this.props.name);\n }\n break;\n }\n }\n\n setReadOnlyState(updateMode: any) {\n this.formwidget?.updateState({\n props: {\n readonly: !updateMode,\n }\n } as WmFormFieldState);\n }\n\n validateFormField() {\n if (this.formwidget?.state.isValid === false) {\n const errorType = this.formwidget?.state?.errorType;\n let validationMsg = get(this.defaultValidatorMessages, errorType);\n if (validationMsg) {\n if (validationMsg instanceof Function) {\n // passing formwidget and form as arguments to the errorMessage function.\n validationMsg = validationMsg(this.formwidget.proxy, this.form);\n }\n this.updateState({ props: {\n validationmessage: validationMsg\n }} as WmFormFieldState);\n }\n this.updateState({ isValid: false} as WmFormFieldState);\n } else {\n this.updateState({ isValid: true } as WmFormFieldState);\n }\n\n this._syncValidators?.forEach((fn: any) => {\n const errormsg = fn();\n let validationMsg = errormsg?.errorMessage;\n if (validationMsg) {\n if (validationMsg instanceof Function) {\n // passing formwidget and form as arguments to the errorMessage function.\n validationMsg = validationMsg(this.formwidget.proxy, this.form);\n }\n this.setInvalidState(validationMsg);\n }\n })\n\n this._asyncValidatorFn && this._asyncValidatorFn();\n\n }\n\n get value(){\n return this.state.props.datavalue;\n }\n\n renderWidget(props: WmFormFieldProps) {\n var childrenWithProps = React.Children.map(props.renderFormFields(this.proxy).props.children, (child) => {\n return React.cloneElement(child, {\n datavalue: props.datavalue,\n value: this.value,\n isValid: this.state.isValid,\n maskchar: props.maskchar,\n displayformat: props.displayformat,\n invokeEvent: this.invokeEventCallback.bind(this),\n triggerValidation: this.validateFormField.bind(this),\n onFieldChange: this.onFieldChangeEvt.bind(this),\n formRef: props.formRef,\n ...(!isNil(props?.placeholder) ? { placeholder: props.placeholder } : {})\n });\n });\n return (\n <View style={this.styles.root}>{this._background}{childrenWithProps}\n {this.state.isValid === false && <Text {...this.getTestPropsForLabel('error_msg')} style={this.styles.errorMsg}>{props.validationmessage}</Text>}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,IAAI,EAAEC,IAAI,QAAO,cAAc;AACvC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,OAAO,EAAEC,KAAK,EAAEC,GAAG,EAAEC,IAAI,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,QAAQ;AAE5E,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,aAAa,QAA2B,qBAAqB;AACtE,SAAQC,kBAAkB,QAAO,uCAAuC;AAExE,OAAO,MAAMC,gBAAgB,SAASX,kBAAkB,CAAmB;EAAAY,YAAA,GAAAC,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iB,EAChE,IAAI,CAACnB,KAAK,CAACE,OAAO,KAAK,KAAK,iBAAI3F,KAAA,CAAA0H,aAAA,CAACzH,IAAI,EAAA8H,QAAA,KAAK,IAAI,CAACC,oBAAoB,CAAC,WAAW,CAAC;MAAEL,KAAK,EAAE,IAAI,CAACC,MAAM,CAACK;IAAS,IAAE7G,KAAK,CAACwE,iBAAwB,CAC3I,CAAC;EAEX;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","Text","View","BaseComponent","BaseComponentState","isEqual","isNil","get","find","cloneDeep","forEach","keys","WmFormFieldProps","DEFAULT_CLASS","PERFORMANCE_LOGGER","WmFormFieldState","constructor","args","_defineProperty","WmFormField","props","form","formScope","componentDidMount","_this$form","_this$form2","_this$form3","formwidget","formKey","formWidgets","name","registerFormFields","formFields","onFieldChangeEvt","$new","$old","isDefault","notifyChanges","updateState","datavalue","invokeEventCallback","undefined","validateFormField","updateDataOutput","call","observeOn","fields","field","formfield","f","proxy","notifyForFields","push","validate","setTimeout","getPromiseList","validators","arr","fn","promise","Function","bind","Promise","setAsyncValidators","_asyncValidatorFn","all","then","err","validationMsg","hasOwnProperty","messageKeys","toString","setInvalidState","setValidators","_cloneValidators","_syncValidators","obj","index","key","defaultValidatorMessages","value","propsObj","updateFormWidgetDataset","res","displayField","dataset","data","datafield","displayfield","state","msg","isValid","validationmessage","onPropertyChange","debug","applyDefaultValue","setPrimaryKey","setReadOnlyState","updateMode","_this$formwidget","readonly","_this$formwidget2","_this$_syncValidators","_this$formwidget3","errorType","errormsg","errorMessage","renderWidget","childrenWithProps","Children","map","renderFormFields","children","child","_child$props","cloneElement","maskchar","displayformat","invokeEvent","triggerValidation","onFieldChange","formRef","placeholder","createElement","style","styles","root","_background","_extends","getTestPropsForLabel","errorMsg"],"sources":["form-field.component.tsx"],"sourcesContent":["import React from 'react';\nimport {Text, View} from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { widgetsWithUndefinedValue } from '@wavemaker/app-rn-runtime/core/utils';\nimport { isEqual, isNil, get, find, cloneDeep, forEach, keys } from 'lodash';\n\nimport WmFormFieldProps from './form-field.props';\nimport { DEFAULT_CLASS, WmFormFieldStyles } from './form-field.styles';\nimport {PERFORMANCE_LOGGER} from \"@wavemaker/app-rn-runtime/core/logger\";\n\nexport class WmFormFieldState extends BaseComponentState<WmFormFieldProps> {\n isValid = true;\n}\n\nexport default class WmFormField extends BaseComponent<WmFormFieldProps, WmFormFieldState, WmFormFieldStyles> {\n public form: any;\n public formwidget: any;\n public _syncValidators: any;\n public defaultValidatorMessages: any = [];\n private notifyForFields: any = [];\n private _asyncValidatorFn: any;\n constructor(props: WmFormFieldProps) {\n super(props, DEFAULT_CLASS, new WmFormFieldProps(), new WmFormFieldState());\n if (!this.form) {\n this.form = props.formScope && props.formScope();\n }\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.formwidget = (this.props.formKey && this.form?.formWidgets[this.props.formKey])\n || (this.props.name && this.form?.formWidgets[this.props.name]);\n this.form?.registerFormFields(this.form.formFields, this.form.formWidgets);\n }\n\n onFieldChangeEvt(name: string, $new: any, $old: any, isDefault: boolean) {\n this.notifyChanges();\n if (!isEqual($old, $new)) {\n this.updateState({ props: { datavalue: $new }} as WmFormFieldState, () => {\n !isDefault && this.invokeEventCallback('onChange', [undefined, this, $new, $old]);\n this.validateFormField();\n });\n if (this.form) {\n this.form.updateDataOutput.call(this.form, get(this.props, 'formKey', this.props.name), $new);\n }\n }\n }\n\n // Registers observer of validation fields\n observeOn(fields: any) {\n forEach(fields, (field) => {\n const formfield = find(this.form.formFields, (f) => f.proxy.name === field);\n if (formfield) {\n formfield.notifyForFields.push(this);\n }\n });\n }\n\n // Notifies changes to observing validation fields\n notifyChanges() {\n forEach(this.notifyForFields, (field) => {\n field.formwidget.validate(field.formwidget.datavalue);\n setTimeout(() => field.validateFormField());\n });\n }\n\n getPromiseList(validators: any) {\n const arr: any = [];\n forEach(validators, (fn) => {\n let promise = fn;\n if (fn instanceof Function && fn.bind) {\n promise = fn(this.formwidget.proxy, this.form);\n }\n if (promise instanceof Promise) {\n arr.push(promise);\n }\n });\n return arr;\n }\n\n // this method sets the asyncValidation on the form field. Assigns validationmessages from the returned response\n setAsyncValidators(validators: any) {\n this._asyncValidatorFn = () => {\n return Promise.all(this.getPromiseList(validators)).then(() => {\n return null;\n }, err => {\n let validationMsg: string;\n // if err obj has validationMessage key, then set validationMessage using this value\n // else return the value of the first key in the err object as validation message.\n if (err.hasOwnProperty('errorMessage')) {\n validationMsg = get(err, 'errorMessage');\n } else {\n const messageKeys = keys(err);\n validationMsg = (err[messageKeys[0]]).toString();\n }\n this.setInvalidState(validationMsg);\n return err;\n })\n };\n }\n\n // sets the default validation on the form field\n setValidators(validators: any) {\n let _cloneValidators = cloneDeep(validators);\n this._syncValidators = [];\n forEach(_cloneValidators, (obj, index) => {\n // custom validation is bound to function.\n if (obj && obj instanceof Function) {\n // passing formwidget and form as arguments to the obj (i.e. validator function)\n _cloneValidators[index] = obj.bind(undefined, this.formwidget.proxy, this.form);\n this._syncValidators.push(_cloneValidators[index]);\n } else {\n // checks for default validator like required, maxchars etc.\n const key = get(obj, 'type');\n this.defaultValidatorMessages[key] = get(obj, 'errorMessage');\n const value = get(obj, 'validator');\n let propsObj: any = {\n props: {}\n };\n propsObj.props[key] = value;\n key === 'required' && this.updateState(propsObj as WmFormFieldState);\n this.formwidget.updateState(propsObj as WmFormFieldState);\n }\n });\n }\n\n updateFormWidgetDataset(res: any, displayField: string) {\n this.formwidget.updateState({\n props: {\n dataset: res.data,\n datafield: 'All Fields',\n displayfield: this.formwidget.state.props.displayfield || displayField,\n }\n } as WmFormFieldState);\n }\n\n setInvalidState(msg: string) {\n this.updateState({\n isValid: false,\n props: {\n validationmessage: msg\n }\n } as WmFormFieldState)\n this.formwidget.updateState({\n isValid: false,\n props: {\n validationmessage: msg\n }\n } as WmFormFieldState);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'datavalue':\n if (!isEqual($old, $new)) {\n PERFORMANCE_LOGGER.debug(`form field ${this.props.name} changed from ${$old} to ${$new}`);\n }\n break;\n case 'defaultvalue':\n if (!isEqual($old, $new)) {\n get(this, 'form') && this.form.applyDefaultValue(this);\n }\n break;\n case 'primary-key':\n if ($new) {\n this.form.setPrimaryKey(this.props.name);\n }\n break;\n }\n }\n\n setReadOnlyState(updateMode: any) {\n this.formwidget?.updateState({\n props: {\n readonly: !updateMode,\n }\n } as WmFormFieldState);\n }\n\n validateFormField() {\n if (this.formwidget?.state.isValid === false) {\n const errorType = this.formwidget?.state?.errorType;\n let validationMsg = get(this.defaultValidatorMessages, errorType);\n if (validationMsg) {\n if (validationMsg instanceof Function) {\n // passing formwidget and form as arguments to the errorMessage function.\n validationMsg = validationMsg(this.formwidget.proxy, this.form);\n }\n this.updateState({ props: {\n validationmessage: validationMsg\n }} as WmFormFieldState);\n }\n this.updateState({ isValid: false} as WmFormFieldState);\n } else {\n this.updateState({ isValid: true } as WmFormFieldState);\n }\n\n this._syncValidators?.forEach((fn: any) => {\n const errormsg = fn();\n let validationMsg = errormsg?.errorMessage;\n if (validationMsg) {\n if (validationMsg instanceof Function) {\n // passing formwidget and form as arguments to the errorMessage function.\n validationMsg = validationMsg(this.formwidget.proxy, this.form);\n }\n this.setInvalidState(validationMsg);\n }\n })\n\n this._asyncValidatorFn && this._asyncValidatorFn();\n\n }\n\n get value(){\n return this.state.props.datavalue;\n }\n\n renderWidget(props: WmFormFieldProps) {\n var childrenWithProps = React.Children.map(props.renderFormFields(this.proxy).props.children, (child) => {\n return React.cloneElement(child, {\n datavalue: props.datavalue || child?.props?.datavalue,\n value: this.value,\n isValid: this.state.isValid,\n maskchar: props.maskchar,\n displayformat: props.displayformat,\n invokeEvent: this.invokeEventCallback.bind(this),\n triggerValidation: this.validateFormField.bind(this),\n onFieldChange: this.onFieldChangeEvt.bind(this),\n formRef: props.formRef,\n ...(!isNil(props?.placeholder) ? { placeholder: props.placeholder } : {})\n });\n });\n return (\n <View style={this.styles.root}>{this._background}{childrenWithProps}\n {this.state.isValid === false && <Text {...this.getTestPropsForLabel('error_msg')} style={this.styles.errorMsg}>{props.validationmessage}</Text>}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,IAAI,EAAEC,IAAI,QAAO,cAAc;AACvC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,OAAO,EAAEC,KAAK,EAAEC,GAAG,EAAEC,IAAI,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,QAAQ;AAE5E,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,SAASC,aAAa,QAA2B,qBAAqB;AACtE,SAAQC,kBAAkB,QAAO,uCAAuC;AAExE,OAAO,MAAMC,gBAAgB,SAASX,kBAAkB,CAAmB;EAAAY,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,kBAC/D,IAAI;EAAA;AAChB;AAEA,eAAe,MAAMC,WAAW,SAAShB,aAAa,CAAwD;EAO5Ga,WAAWA,CAACI,KAAuB,EAAE;IACnC,KAAK,CAACA,KAAK,EAAEP,aAAa,EAAE,IAAID,gBAAgB,CAAC,CAAC,EAAE,IAAIG,gBAAgB,CAAC,CAAC,CAAC;IAACG,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,mCAJvC,EAAE;IAAAA,eAAA,0BACV,EAAE;IAAAA,eAAA;IAI/B,IAAI,CAAC,IAAI,CAACG,IAAI,EAAE;MACd,IAAI,CAACA,IAAI,GAAGD,KAAK,CAACE,SAAS,IAAIF,KAAK,CAACE,SAAS,CAAC,CAAC;IAClD;EACF;EAEAC,iBAAiBA,CAAA,EAAG;IAAA,IAAAC,UAAA,EAAAC,WAAA,EAAAC,WAAA;IAClB,KAAK,CAACH,iBAAiB,CAAC,CAAC;IACzB,IAAI,CAACI,UAAU,GAAI,IAAI,CAACP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IAAI,CAACF,KAAK,CAACE,OAAO;QAC3ByB,QAAQ,EAAEhG,KAAK,CAACgG,QAAQ;QACxBC,aAAa,EAAEjG,KAAK,CAACiG,aAAa;QAClCC,WAAW,EAAE,IAAI,CAAC9E,mBAAmB,CAACqB,IAAI,CAAC,IAAI,CAAC;QAChD0D,iBAAiB,EAAE,IAAI,CAAC7E,iBAAiB,CAACmB,IAAI,CAAC,IAAI,CAAC;QACpD2D,aAAa,EAAE,IAAI,CAACvF,gBAAgB,CAAC4B,IAAI,CAAC,IAAI,CAAC;QAC/C4D,OAAO,EAAErG,KAAK,CAACqG,OAAO;QACtB,IAAI,CAACnH,KAAK,CAACc,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEsG,WAAW,CAAC,GAAG;UAAEA,WAAW,EAAEtG,KAAK,CAACsG;QAAY,CAAC,GAAG,CAAC,CAAC;MACzE,CAAC,CAAC;IACP,CAAC,CAAC;IACF,oBACE1H,KAAA,CAAA2H,aAAA,CAACzH,IAAI;MAAC0H,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAK,GAAE,IAAI,CAACC,WAAW,EAAEnB,iBAAiB,EAChE,IAAI,CAACnB,KAAK,CAACE,OAAO,KAAK,KAAK,iBAAI3F,KAAA,CAAA2H,aAAA,CAAC1H,IAAI,EAAA+H,QAAA,KAAK,IAAI,CAACC,oBAAoB,CAAC,WAAW,CAAC;MAAEL,KAAK,EAAE,IAAI,CAACC,MAAM,CAACK;IAAS,IAAE9G,KAAK,CAACwE,iBAAwB,CAC3I,CAAC;EAEX;AACF","ignoreList":[]}
@@ -355,7 +355,7 @@ export default class WmForm extends BaseComponent {
355
355
  dataoutput: current
356
356
  }
357
357
  });
358
- this.parentFormRef && this.parentFormRef.updateDataOutput(undefined, this.formdataoutput);
358
+ this.parentFormRef && this.parentFormRef.updateDataOutput && this.parentFormRef.updateDataOutput(undefined, this.formdataoutput);
359
359
  this.updateState({
360
360
  props: {
361
361
  dataoutput: this.formdataoutput
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","BaseComponent","BaseComponentState","isDefined","debounce","find","forEach","isNil","get","set","cloneDeep","isEmpty","WmLabel","WmIcon","WmMessage","ToastConsumer","WmFormProps","DEFAULT_CLASS","isDataSetWidget","WmFormState","constructor","args","_defineProperty","WmForm","props","handleSubmit","componentDidMount","getParentFormRef","parentForm","pformName","current","parent","parentFormRef","setReadonlyFields","_this$formFields","formFields","field","setReadOnlyState","state","isUpdateMode","setReadonlyState","updateMode","updateState","setTimeout","showActions","edit","new","cancel","delete","registerFormFields","formWidgets","w","form","formwidget","formKey","name","f","formfields","applyFormData","applyDefaultValue","formdataoutput","datavalue","dataoutput","_this$buttonArray","buttonArray","action","show","registerFormActions","formActions","_updateFieldOnDataSourceChange","isDataSetBound","widget","isRelated","relatedData","_this$parentFormRef","formData","formdata","formField","_formField$props","fw","key","setState","isDefault","updateFormFieldDefaultValue","dv","defaultvalue","_formField$props2","invokeEventCallback","bind","undefined","formreset","ff","defaultValue","id","_widget","isValid","reset","submit","_debouncedSubmitForm","generateFormFields","userFields","fields","metadata","data","onBeforerender","proxy","dynamicForm","generateComponent","onPropertyChange","$new","$old","_this$formFields2","setPrimaryKey","fieldName","primaryKey","indexOf","push","validateFieldsOnSubmit","val","onValidate","required","generator","msg","defaultValidatorMessages","validationmessage","validate","event","preventDefault","onBeforesubmit","formSubmit","onResultCb","error","response","status","onSuccess","postmessage","toggleMessage","onError","errormessage","updateDataOutput","Object","assign","type","message","messagelayout","showInlineMsg","toaster","showToast","placement","styles","bottom","text","hideOnClick","duration","onMsgClose","renderWidget","createElement","toastService","style","root","_background","iconclass","title","subheading","heading","flex","flexDirection","getTestId","listIcon","caption","accessibilityrole","hideclose","onClose","children"],"sources":["form.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { isDefined, widgetsWithUndefinedValue } from '@wavemaker/app-rn-runtime/core/utils';\nimport { debounce, find, forEach, isNil, get, set, cloneDeep, isEmpty } from 'lodash';\n\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmFormField, { WmFormFieldState } from '@wavemaker/app-rn-runtime/components/data/form/form-field/form-field.component';\nimport WmMessage from '@wavemaker/app-rn-runtime/components/basic/message/message.component';\nimport { ToastConsumer, ToastService } from '@wavemaker/app-rn-runtime/core/toast.service';\n\nimport WmFormProps from './form.props';\nimport { DEFAULT_CLASS, WmFormStyles } from './form.styles';\nimport WmSkeleton, { createSkeleton } from '../../basic/skeleton/skeleton.component';\nimport { WmSkeletonStyles } from '../../basic/skeleton/skeleton.styles';\nimport { isDataSetWidget } from '@wavemaker/app-rn-runtime/core/utils';\nimport WmFormAction, {\n WmFormActionState\n} from '@wavemaker/app-rn-runtime/components/data/form/form-action/form-action.component';\n\nexport class WmFormState extends BaseComponentState<WmFormProps> {\n isValid = false;\n type: 'success' | 'warning' | 'error' | 'info' | 'loading' | undefined = 'success';\n message: string = '';\n showInlineMsg: boolean = false;\n isUpdateMode: boolean = true;\n dynamicForm: any;\n}\nexport default class WmForm extends BaseComponent<WmFormProps, WmFormState, WmFormStyles> {\n public formFields: Array<WmFormField> = []; // contains array of direct widget elements [WmText, WmNumber, WmCurrent]\n public parentFormRef: any;\n public formfields: {[key: string]: WmFormField} = {};\n public formdataoutput: any;\n private toaster: any;\n public formActions: Array<WmFormAction> = [];\n primaryKey = [];\n buttonArray: Array<WmFormAction> = [];\n formWidgets: { [key: string]: BaseComponent<any, any, any> } = {}; // object containing key as name of formField and value as WmFormField proxy.\n constructor(props: WmFormProps) {\n super(props, DEFAULT_CLASS, new WmFormProps(), new WmFormState());\n }\n\n private _debouncedSubmitForm = debounce(this.handleSubmit, 250);\n\n componentDidMount() {\n super.componentDidMount();\n this.getParentFormRef(this.props.parentForm);\n }\n\n getParentFormRef(pformName: string) {\n let current = this.parent;\n while (current) {\n if (get(current, 'props.name') === pformName) {\n this.parentFormRef = current;\n break;\n }\n current = current.parent;\n }\n }\n\n setReadonlyFields() {\n this.formFields?.forEach((field: any) => {\n field.setReadOnlyState(this.state.isUpdateMode);\n });\n }\n\n setReadonlyState(updateMode: any) {\n this.updateState({\n isUpdateMode: updateMode,\n } as WmFormState);\n setTimeout(() => {\n this.showActions();\n this.setReadonlyFields();\n }, 100);\n }\n\n edit() {\n this.setReadonlyState(true);\n }\n\n new() {\n this.setReadonlyState(true);\n }\n\n cancel() {\n this.setReadonlyState(false);\n }\n\n delete() { }\n\n registerFormFields(\n formFields: Array<WmFormField>,\n formWidgets: { [key: string]: BaseComponent<any, any, any> }\n ) {\n forEach(formFields, (w: WmFormField) => {\n if (!w.form) {\n w.form = this;\n w.formwidget = (w.props.formKey && formWidgets[w.props.formKey])\n || (w.props.name && formWidgets[w.props.name]);\n }\n });\n\n this.formFields = formFields;\n this.formWidgets = formWidgets;\n\n formFields?.forEach((f: WmFormField) => {\n if (f.props.name) {\n set(this.formfields, f.props.name, f);\n }\n })\n\n this.setReadonlyFields();\n\n this.applyFormData();\n this.applyDefaultValue();\n\n // setting default form dataoutput.\n if (!this.formdataoutput) {\n this.formdataoutput = {};\n formFields?.forEach((w: WmFormField) => {\n const name = get(w.props, 'formKey') || w.props.name;\n if (name) {\n set(this.formdataoutput, name, w.props.datavalue);\n }\n });\n this.updateState({\n props: {\n dataoutput: this.formdataoutput\n }\n } as WmFormState);\n }\n }\n\n showActions () {\n this.buttonArray?.forEach((action: any) => {\n action.updateState({\n props: {\n show: action.updateMode === this.state.isUpdateMode\n }} as WmFormActionState);\n });\n }\n\n registerFormActions(formActions: Array<WmFormAction>) {\n this.buttonArray = formActions;\n this.showActions();\n }\n\n private _updateFieldOnDataSourceChange(field: WmFormField, formFields: Array<WmFormField>) {\n if (!field.state.props.isDataSetBound && isDataSetWidget(field.props.widget)) {\n if (field.state.props.isRelated) {\n field.updateState({\n props: {\n isDataSetBound: true\n }} as WmFormFieldState);\n this.props.relatedData && this.props.relatedData(field);\n }\n }\n }\n\n applyFormData() {\n let formData = this.state.props.formdata || this.parentFormRef?.state.props.formdata;\n if (!formData || (this.parentFormRef && this.state.props.formdata)) {\n return;\n }\n forEach(this.formFields, (formField: WmFormField) => {\n let fw = formField.props?.name && this.formWidgets[formField.props.name];\n if (!fw) {\n fw = find(this.formWidgets, (fw: BaseComponent<any, any, any>) => {\n return get(fw, 'formfieldname') === formField.props.name\n });\n }\n let key = get(formField, 'formKey') || get(fw, 'props.name');\n fw && fw.setState({ isDefault: true });\n formField.updateState({\n props: {\n datavalue: get(formData, key)\n }\n } as WmFormFieldState);\n });\n }\n\n updateFormFieldDefaultValue(formField: WmFormField) {\n if (formField) {\n const dv = formField.state.props.defaultvalue;\n if (isDefined(dv) && dv !== null && this.formFields) {\n let field = formField.props?.name && this.formWidgets[formField.props.name];\n if (!field) {\n field = find(this.formWidgets, (fw: BaseComponent<any, any, any>) => {\n return get(fw, 'formfieldname') === formField.props.name\n });\n }\n if (field) {\n field.setState({ isDefault: true });\n field.updateState({\n props: {\n datavalue: dv\n }\n }, this.invokeEventCallback.bind(formField, 'onFieldChange', [undefined, formField, dv]));\n }\n }\n }\n }\n\n get dataoutput() {\n return this.formdataoutput;\n }\n\n applyDefaultValue(formField?: WmFormField) {\n if (formField) {\n this.updateFormFieldDefaultValue(formField);\n return;\n }\n forEach(this.formFields, (w: WmFormField) => {\n this.updateFormFieldDefaultValue(w);\n });\n }\n\n formreset() {\n this.formdataoutput = {};\n forEach(this.formFields, (ff: WmFormField) => {\n const defaultValue = isNil(ff.state.props.defaultvalue) ? '' : ff.state.props.defaultvalue;\n ff.updateState({\n props : {\n datavalue: defaultValue\n }\n } as WmFormFieldState, () => {\n const id = ff.props.formKey || ff.props.name;\n if (id) {\n let widget: BaseComponent<any, any, any> | undefined | any = this.formWidgets[id];\n if (!widget) {\n widget = find(this.formWidgets, (fw: BaseComponent<any, any, any>) => {\n return get(fw, 'formfieldname') === ff.props.name\n });\n }\n widget.updateState({\n isValid: true,\n props : {\n datavalue: defaultValue\n }\n }, () => ff.updateState({\n isValid: true\n } as WmFormFieldState));\n widget?.reset();\n }\n }\n );\n });\n }\n\n submit() {\n this._debouncedSubmitForm();\n }\n\n // Function to generate and compile the form fields from the metadata\n generateFormFields() {\n let userFields;\n let fields = this.state.props.metadata ? this.state.props.metadata.data || this.state.props.metadata : [];\n\n if (isEmpty(fields)) {\n return;\n }\n\n if (this.props.onBeforerender) {\n userFields = this.invokeEventCallback('onBeforerender', [fields, this.proxy]);\n if (userFields) {\n fields = userFields;\n }\n }\n\n this.updateState({\n dynamicForm: this.props.generateComponent(fields, this.props.name)\n } as WmFormState);\n\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'formdata':\n if ($new) {\n this.applyFormData();\n }\n break;\n case 'defaultmode':\n this.updateState({\n isUpdateMode: $new && $new === 'Edit' ? true : false,\n } as WmFormState);\n break;\n case 'dataset':\n this.formFields?.forEach((w: WmFormField) => {\n this._updateFieldOnDataSourceChange(w, this.formFields);\n });\n break;\n case 'metadata':\n this.generateFormFields();\n break;\n }\n }\n setPrimaryKey(fieldName: string) {\n /*Store the primary key of data*/\n this.primaryKey = this.primaryKey || [];\n // @ts-ignore\n if (this.primaryKey.indexOf(fieldName) === -1) {\n // @ts-ignore\n this.primaryKey.push(fieldName);\n }\n }\n // Disable the form submit if form is in invalid state. Highlight all the invalid fields if validation type is default\n validateFieldsOnSubmit() {\n let isValid = true;\n forEach(this.formFields, (field) => {\n const val = field?.state.props.datavalue;\n\n const onValidate = get(field, 'props.onValidate');\n onValidate && onValidate(field);\n if (!val && field?.state.props.required && ((field?.props.primaryKey && field?.props.generator === 'assigned') || !field?.props.primaryKey)) {\n isValid = false;\n const msg = get(field.defaultValidatorMessages, 'required') || field.state.props.validationmessage;\n field.updateState({ isValid: isValid, props: {\n validationmessage: msg\n }} as WmFormFieldState);\n field.formwidget.validate && field.formwidget.validate(val);\n }\n // check for isvalid state of formwidget\n if (field.formwidget.state.isValid === false) {\n isValid = false;\n }\n });\n return isValid;\n }\n\n // @ts-ignore\n handleSubmit(event?: any) {\n event?.preventDefault();\n const formData = cloneDeep(this.state.props.dataoutput || this.formdataoutput);\n\n if (!this.validateFieldsOnSubmit()) {\n return false;\n }\n if (this.props.onBeforesubmit) {\n this.invokeEventCallback('onBeforesubmit', [ null, this.proxy, formData ]);\n }\n if (this.props.formSubmit) {\n this.props.formSubmit(formData, ((data: any) => {\n this.invokeEventCallback('onSubmit', [ null, this.proxy, formData ]);\n this.onResultCb(get(data, 'params'), 'success');\n }), ((error: any) => {\n this.invokeEventCallback('onSubmit', [ null, this.proxy, formData ]);\n this.onResultCb(error, '');\n }));\n } else {\n this.invokeEventCallback('onSubmit', [ null, this.proxy, formData ]);\n }\n }\n\n onResultCb(response: any, status: string, event?: any) {\n this.invokeEventCallback('onResult', [ null, this.proxy, response ]);\n if (status) {\n this.invokeEventCallback('onSuccess', [ null, this.proxy, response ]);\n !this.props.onSuccess && this.state.props.postmessage && this.toggleMessage('success', this.state.props.postmessage);\n } else {\n this.invokeEventCallback('onError', [ null, this.proxy, response ]);\n !this.props.onError && this.toggleMessage('error', this.state.props.errormessage || get(response, 'message'));\n }\n }\n\n updateDataOutput(key: string, val: any) {\n const current = this.formdataoutput || {};\n if (key) {\n set(current, key, val);\n } else {\n Object.assign(current, val)\n }\n this.formdataoutput = current;\n this.updateState({ props: { dataoutput: current }} as WmFormState);\n this.parentFormRef && this.parentFormRef.updateDataOutput(undefined, this.formdataoutput);\n this.updateState({\n props: {\n dataoutput: this.formdataoutput\n }\n } as WmFormState);\n }\n\n toggleMessage(\n type: 'success' | 'warning' | 'error' | 'info' | 'loading' | undefined,\n message: string\n ) {\n if (this.state.props.messagelayout === 'Inline') {\n this.setState({\n type: type,\n message: message,\n showInlineMsg: true\n } as WmFormState)\n return;\n }\n this.toaster.showToast({\n name: this, placement: \"\", styles: {bottom: 0},\n text: message,\n type: type,\n hideOnClick: true,\n duration: 5000\n });\n }\n\n onMsgClose() {\n this.setState({\n showInlineMsg: false\n } as WmFormState)\n }\n\n renderWidget(props: WmFormProps) {\n return (\n <ToastConsumer>\n {(toastService: ToastService) => {\n this.toaster = toastService;\n return <View style={this.styles.root}>\n {this._background}\n {props.iconclass || props.title || props.subheading ? (\n <View style={this.styles.heading}>\n <View style={{flex: 1, flexDirection: 'row'}}>\n <WmIcon id={this.getTestId('icon')} styles={this.styles.listIcon} iconclass={props.iconclass}></WmIcon>\n <View>\n <WmLabel id={this.getTestId('title')} styles={this.styles.title} caption={props.title} accessibilityrole='header'></WmLabel>\n <WmLabel id={this.getTestId('description')} styles={this.styles.subheading} caption={props.subheading}></WmLabel>\n </View>\n </View>\n </View>\n ) : null}\n {this.state.showInlineMsg ? <WmMessage type={this.state.type} caption={this.state.message} hideclose={false} onClose={this.onMsgClose.bind(this)}></WmMessage> : null\n }\n { props.metadata && this.state.dynamicForm }\n { props.children}\n </View>\n }\n }\n </ToastConsumer>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAASC,SAAS,QAAmC,sCAAsC;AAC3F,SAASC,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAEC,KAAK,EAAEC,GAAG,EAAEC,GAAG,EAAEC,SAAS,EAAEC,OAAO,QAAQ,QAAQ;AAErF,OAAOC,OAAO,MAAM,kEAAkE;AACtF,OAAOC,MAAM,MAAM,gEAAgE;AAEnF,OAAOC,SAAS,MAAM,sEAAsE;AAC5F,SAASC,aAAa,QAAsB,8CAA8C;AAE1F,OAAOC,WAAW,MAAM,cAAc;AACtC,SAASC,aAAa,QAAsB,eAAe;AAG3D,SAASC,eAAe,QAAQ,sCAAsC;AAKtE,OAAO,MAAMC,WAAW,SAASjB,kBAAkB,CAAc;EAAAkB,YAAA,GAAAC,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AC,eACxGlK,KAAA,CAAA6J,aAAA,CAAC5J,IAAI,qBACHD,KAAA,CAAA6J,aAAA,CAAChJ,OAAO;QAACiF,EAAE,EAAE,IAAI,CAAC0E,SAAS,CAAC,OAAO,CAAE;QAAClB,MAAM,EAAE,IAAI,CAACA,MAAM,CAACa,KAAM;QAACO,OAAO,EAAEjJ,KAAK,CAAC0I,KAAM;QAACQ,iBAAiB,EAAC;MAAQ,CAAU,CAAC,eAC5H3K,KAAA,CAAA6J,aAAA,CAAChJ,OAAO;QAACiF,EAAE,EAAE,IAAI,CAAC0E,SAAS,CAAC,aAAa,CAAE;QAAClB,MAAM,EAAE,IAAI,CAACA,MAAM,CAACc,UAAW;QAACM,OAAO,EAAEjJ,KAAK,CAAC2I;MAAW,CAAU,CAC5G,CACF,CACF,CAAC,GACL,IAAI,EACP,IAAI,CAAC7H,KAAK,CAAC2G,aAAa,gBAAGlJ,KAAA,CAAA6J,aAAA,CAAC9I,SAAS;QAACgI,IAAI,EAAE,IAAI,CAACxG,KAAK,CAACwG,IAAK;QAAC2B,OAAO,EAAE,IAAI,CAACnI,KAAK,CAACyG,OAAQ;QAAC4B,SAAS,EAAE,KAAM;QAACC,OAAO,EAAE,IAAI,CAAClB,UAAU,CAAClE,IAAI,CAAC,IAAI;MAAE,CAAY,CAAC,GAAG,IAAI,EAEnKhE,KAAK,CAAC8E,QAAQ,IAAI,IAAI,CAAChE,KAAK,CAACoE,WAAW,EACxClF,KAAK,CAACqJ,QACJ,CAAC;IACT,CAEa,CAAC;EAEpB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","View","BaseComponent","BaseComponentState","isDefined","debounce","find","forEach","isNil","get","set","cloneDeep","isEmpty","WmLabel","WmIcon","WmMessage","ToastConsumer","WmFormProps","DEFAULT_CLASS","isDataSetWidget","WmFormState","constructor","args","_defineProperty","WmForm","props","handleSubmit","componentDidMount","getParentFormRef","parentForm","pformName","current","parent","parentFormRef","setReadonlyFields","_this$formFields","formFields","field","setReadOnlyState","state","isUpdateMode","setReadonlyState","updateMode","updateState","setTimeout","showActions","edit","new","cancel","delete","registerFormFields","formWidgets","w","form","formwidget","formKey","name","f","formfields","applyFormData","applyDefaultValue","formdataoutput","datavalue","dataoutput","_this$buttonArray","buttonArray","action","show","registerFormActions","formActions","_updateFieldOnDataSourceChange","isDataSetBound","widget","isRelated","relatedData","_this$parentFormRef","formData","formdata","formField","_formField$props","fw","key","setState","isDefault","updateFormFieldDefaultValue","dv","defaultvalue","_formField$props2","invokeEventCallback","bind","undefined","formreset","ff","defaultValue","id","_widget","isValid","reset","submit","_debouncedSubmitForm","generateFormFields","userFields","fields","metadata","data","onBeforerender","proxy","dynamicForm","generateComponent","onPropertyChange","$new","$old","_this$formFields2","setPrimaryKey","fieldName","primaryKey","indexOf","push","validateFieldsOnSubmit","val","onValidate","required","generator","msg","defaultValidatorMessages","validationmessage","validate","event","preventDefault","onBeforesubmit","formSubmit","onResultCb","error","response","status","onSuccess","postmessage","toggleMessage","onError","errormessage","updateDataOutput","Object","assign","type","message","messagelayout","showInlineMsg","toaster","showToast","placement","styles","bottom","text","hideOnClick","duration","onMsgClose","renderWidget","createElement","toastService","style","root","_background","iconclass","title","subheading","heading","flex","flexDirection","getTestId","listIcon","caption","accessibilityrole","hideclose","onClose","children"],"sources":["form.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { isDefined, widgetsWithUndefinedValue } from '@wavemaker/app-rn-runtime/core/utils';\nimport { debounce, find, forEach, isNil, get, set, cloneDeep, isEmpty } from 'lodash';\n\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmFormField, { WmFormFieldState } from '@wavemaker/app-rn-runtime/components/data/form/form-field/form-field.component';\nimport WmMessage from '@wavemaker/app-rn-runtime/components/basic/message/message.component';\nimport { ToastConsumer, ToastService } from '@wavemaker/app-rn-runtime/core/toast.service';\n\nimport WmFormProps from './form.props';\nimport { DEFAULT_CLASS, WmFormStyles } from './form.styles';\nimport { isDataSetWidget } from '@wavemaker/app-rn-runtime/core/utils';\nimport WmFormAction, {\n WmFormActionState\n} from '@wavemaker/app-rn-runtime/components/data/form/form-action/form-action.component';\n\nexport class WmFormState extends BaseComponentState<WmFormProps> {\n isValid = false;\n type: 'success' | 'warning' | 'error' | 'info' | 'loading' | undefined = 'success';\n message: string = '';\n showInlineMsg: boolean = false;\n isUpdateMode: boolean = true;\n dynamicForm: any;\n}\nexport default class WmForm extends BaseComponent<WmFormProps, WmFormState, WmFormStyles> {\n public formFields: Array<WmFormField> = []; // contains array of direct widget elements [WmText, WmNumber, WmCurrent]\n public parentFormRef: any;\n public formfields: {[key: string]: WmFormField} = {};\n public formdataoutput: any;\n private toaster: any;\n public formActions: Array<WmFormAction> = [];\n primaryKey = [];\n buttonArray: Array<WmFormAction> = [];\n formWidgets: { [key: string]: BaseComponent<any, any, any> } = {}; // object containing key as name of formField and value as WmFormField proxy.\n constructor(props: WmFormProps) {\n super(props, DEFAULT_CLASS, new WmFormProps(), new WmFormState());\n }\n\n private _debouncedSubmitForm = debounce(this.handleSubmit, 250);\n\n componentDidMount() {\n super.componentDidMount();\n this.getParentFormRef(this.props.parentForm);\n }\n\n getParentFormRef(pformName: string) {\n let current = this.parent;\n while (current) {\n if (get(current, 'props.name') === pformName) {\n this.parentFormRef = current;\n break;\n }\n current = current.parent;\n }\n }\n\n setReadonlyFields() {\n this.formFields?.forEach((field: any) => {\n field.setReadOnlyState(this.state.isUpdateMode);\n });\n }\n\n setReadonlyState(updateMode: any) {\n this.updateState({\n isUpdateMode: updateMode,\n } as WmFormState);\n setTimeout(() => {\n this.showActions();\n this.setReadonlyFields();\n }, 100);\n }\n\n edit() {\n this.setReadonlyState(true);\n }\n\n new() {\n this.setReadonlyState(true);\n }\n\n cancel() {\n this.setReadonlyState(false);\n }\n\n delete() { }\n\n registerFormFields(\n formFields: Array<WmFormField>,\n formWidgets: { [key: string]: BaseComponent<any, any, any> }\n ) {\n forEach(formFields, (w: WmFormField) => {\n if (!w.form) {\n w.form = this;\n w.formwidget = (w.props.formKey && formWidgets[w.props.formKey])\n || (w.props.name && formWidgets[w.props.name]);\n }\n });\n\n this.formFields = formFields;\n this.formWidgets = formWidgets;\n\n formFields?.forEach((f: WmFormField) => {\n if (f.props.name) {\n set(this.formfields, f.props.name, f);\n }\n })\n\n this.setReadonlyFields();\n\n this.applyFormData();\n this.applyDefaultValue();\n\n // setting default form dataoutput.\n if (!this.formdataoutput) {\n this.formdataoutput = {};\n formFields?.forEach((w: WmFormField) => {\n const name = get(w.props, 'formKey') || w.props.name;\n if (name) {\n set(this.formdataoutput, name, w.props.datavalue);\n }\n });\n this.updateState({\n props: {\n dataoutput: this.formdataoutput\n }\n } as WmFormState);\n }\n }\n\n showActions () {\n this.buttonArray?.forEach((action: any) => {\n action.updateState({\n props: {\n show: action.updateMode === this.state.isUpdateMode\n }} as WmFormActionState);\n });\n }\n\n registerFormActions(formActions: Array<WmFormAction>) {\n this.buttonArray = formActions;\n this.showActions();\n }\n\n private _updateFieldOnDataSourceChange(field: WmFormField, formFields: Array<WmFormField>) {\n if (!field.state.props.isDataSetBound && isDataSetWidget(field.props.widget)) {\n if (field.state.props.isRelated) {\n field.updateState({\n props: {\n isDataSetBound: true\n }} as WmFormFieldState);\n this.props.relatedData && this.props.relatedData(field);\n }\n }\n }\n\n applyFormData() {\n let formData = this.state.props.formdata || this.parentFormRef?.state.props.formdata;\n if (!formData || (this.parentFormRef && this.state.props.formdata)) {\n return;\n }\n forEach(this.formFields, (formField: WmFormField) => {\n let fw = formField.props?.name && this.formWidgets[formField.props.name];\n if (!fw) {\n fw = find(this.formWidgets, (fw: BaseComponent<any, any, any>) => {\n return get(fw, 'formfieldname') === formField.props.name\n });\n }\n let key = get(formField, 'formKey') || get(fw, 'props.name');\n fw && fw.setState({ isDefault: true });\n formField.updateState({\n props: {\n datavalue: get(formData, key)\n }\n } as WmFormFieldState);\n });\n }\n\n updateFormFieldDefaultValue(formField: WmFormField) {\n if (formField) {\n const dv = formField.state.props.defaultvalue;\n if (isDefined(dv) && dv !== null && this.formFields) {\n let field = formField.props?.name && this.formWidgets[formField.props.name];\n if (!field) {\n field = find(this.formWidgets, (fw: BaseComponent<any, any, any>) => {\n return get(fw, 'formfieldname') === formField.props.name\n });\n }\n if (field) {\n field.setState({ isDefault: true });\n field.updateState({\n props: {\n datavalue: dv\n }\n }, this.invokeEventCallback.bind(formField, 'onFieldChange', [undefined, formField, dv]));\n }\n }\n }\n }\n\n get dataoutput() {\n return this.formdataoutput;\n }\n\n applyDefaultValue(formField?: WmFormField) {\n if (formField) {\n this.updateFormFieldDefaultValue(formField);\n return;\n }\n forEach(this.formFields, (w: WmFormField) => {\n this.updateFormFieldDefaultValue(w);\n });\n }\n\n formreset() {\n this.formdataoutput = {};\n forEach(this.formFields, (ff: WmFormField) => {\n const defaultValue = isNil(ff.state.props.defaultvalue) ? '' : ff.state.props.defaultvalue;\n ff.updateState({\n props : {\n datavalue: defaultValue\n }\n } as WmFormFieldState, () => {\n const id = ff.props.formKey || ff.props.name;\n if (id) {\n let widget: BaseComponent<any, any, any> | undefined | any = this.formWidgets[id];\n if (!widget) {\n widget = find(this.formWidgets, (fw: BaseComponent<any, any, any>) => {\n return get(fw, 'formfieldname') === ff.props.name\n });\n }\n widget.updateState({\n isValid: true,\n props : {\n datavalue: defaultValue\n }\n }, () => ff.updateState({\n isValid: true\n } as WmFormFieldState));\n widget?.reset();\n }\n }\n );\n });\n }\n\n submit() {\n this._debouncedSubmitForm();\n }\n\n // Function to generate and compile the form fields from the metadata\n generateFormFields() {\n let userFields;\n let fields = this.state.props.metadata ? this.state.props.metadata.data || this.state.props.metadata : [];\n\n if (isEmpty(fields)) {\n return;\n }\n\n if (this.props.onBeforerender) {\n userFields = this.invokeEventCallback('onBeforerender', [fields, this.proxy]);\n if (userFields) {\n fields = userFields;\n }\n }\n\n this.updateState({\n dynamicForm: this.props.generateComponent(fields, this.props.name)\n } as WmFormState);\n\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch (name) {\n case 'formdata':\n if ($new) {\n this.applyFormData();\n }\n break;\n case 'defaultmode':\n this.updateState({\n isUpdateMode: $new && $new === 'Edit' ? true : false,\n } as WmFormState);\n break;\n case 'dataset':\n this.formFields?.forEach((w: WmFormField) => {\n this._updateFieldOnDataSourceChange(w, this.formFields);\n });\n break;\n case 'metadata':\n this.generateFormFields();\n break;\n }\n }\n setPrimaryKey(fieldName: string) {\n /*Store the primary key of data*/\n this.primaryKey = this.primaryKey || [];\n // @ts-ignore\n if (this.primaryKey.indexOf(fieldName) === -1) {\n // @ts-ignore\n this.primaryKey.push(fieldName);\n }\n }\n // Disable the form submit if form is in invalid state. Highlight all the invalid fields if validation type is default\n validateFieldsOnSubmit() {\n let isValid = true;\n forEach(this.formFields, (field) => {\n const val = field?.state.props.datavalue;\n\n const onValidate = get(field, 'props.onValidate');\n onValidate && onValidate(field);\n if (!val && field?.state.props.required && ((field?.props.primaryKey && field?.props.generator === 'assigned') || !field?.props.primaryKey)) {\n isValid = false;\n const msg = get(field.defaultValidatorMessages, 'required') || field.state.props.validationmessage;\n field.updateState({ isValid: isValid, props: {\n validationmessage: msg\n }} as WmFormFieldState);\n field.formwidget.validate && field.formwidget.validate(val);\n }\n // check for isvalid state of formwidget\n if (field.formwidget.state.isValid === false) {\n isValid = false;\n }\n });\n return isValid;\n }\n\n // @ts-ignore\n handleSubmit(event?: any) {\n event?.preventDefault();\n const formData = cloneDeep(this.state.props.dataoutput || this.formdataoutput);\n\n if (!this.validateFieldsOnSubmit()) {\n return false;\n }\n if (this.props.onBeforesubmit) {\n this.invokeEventCallback('onBeforesubmit', [ null, this.proxy, formData ]);\n }\n if (this.props.formSubmit) {\n this.props.formSubmit(formData, ((data: any) => {\n this.invokeEventCallback('onSubmit', [ null, this.proxy, formData ]);\n this.onResultCb(get(data, 'params'), 'success');\n }), ((error: any) => {\n this.invokeEventCallback('onSubmit', [ null, this.proxy, formData ]);\n this.onResultCb(error, '');\n }));\n } else {\n this.invokeEventCallback('onSubmit', [ null, this.proxy, formData ]);\n }\n }\n\n onResultCb(response: any, status: string, event?: any) {\n this.invokeEventCallback('onResult', [ null, this.proxy, response ]);\n if (status) {\n this.invokeEventCallback('onSuccess', [ null, this.proxy, response ]);\n !this.props.onSuccess && this.state.props.postmessage && this.toggleMessage('success', this.state.props.postmessage);\n } else {\n this.invokeEventCallback('onError', [ null, this.proxy, response ]);\n !this.props.onError && this.toggleMessage('error', this.state.props.errormessage || get(response, 'message'));\n }\n }\n\n updateDataOutput(key: string, val: any) {\n const current = this.formdataoutput || {};\n if (key) {\n set(current, key, val);\n } else {\n Object.assign(current, val)\n }\n this.formdataoutput = current;\n this.updateState({ props: { dataoutput: current }} as WmFormState);\n this.parentFormRef && this.parentFormRef.updateDataOutput && this.parentFormRef.updateDataOutput(undefined, this.formdataoutput);\n this.updateState({\n props: {\n dataoutput: this.formdataoutput\n }\n } as WmFormState);\n }\n\n toggleMessage(\n type: 'success' | 'warning' | 'error' | 'info' | 'loading' | undefined,\n message: string\n ) {\n if (this.state.props.messagelayout === 'Inline') {\n this.setState({\n type: type,\n message: message,\n showInlineMsg: true\n } as WmFormState)\n return;\n }\n this.toaster.showToast({\n name: this, placement: \"\", styles: {bottom: 0},\n text: message,\n type: type,\n hideOnClick: true,\n duration: 5000\n });\n }\n\n onMsgClose() {\n this.setState({\n showInlineMsg: false\n } as WmFormState)\n }\n\n renderWidget(props: WmFormProps) {\n return (\n <ToastConsumer>\n {(toastService: ToastService) => {\n this.toaster = toastService;\n return <View style={this.styles.root}>\n {this._background}\n {props.iconclass || props.title || props.subheading ? (\n <View style={this.styles.heading}>\n <View style={{flex: 1, flexDirection: 'row'}}>\n <WmIcon id={this.getTestId('icon')} styles={this.styles.listIcon} iconclass={props.iconclass}></WmIcon>\n <View>\n <WmLabel id={this.getTestId('title')} styles={this.styles.title} caption={props.title} accessibilityrole='header'></WmLabel>\n <WmLabel id={this.getTestId('description')} styles={this.styles.subheading} caption={props.subheading}></WmLabel>\n </View>\n </View>\n </View>\n ) : null}\n {this.state.showInlineMsg ? <WmMessage type={this.state.type} caption={this.state.message} hideclose={false} onClose={this.onMsgClose.bind(this)}></WmMessage> : null\n }\n { props.metadata && this.state.dynamicForm }\n { props.children}\n </View>\n }\n }\n </ToastConsumer>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,SAASC,SAAS,QAAmC,sCAAsC;AAC3F,SAASC,QAAQ,EAAEC,IAAI,EAAEC,OAAO,EAAEC,KAAK,EAAEC,GAAG,EAAEC,GAAG,EAAEC,SAAS,EAAEC,OAAO,QAAQ,QAAQ;AAErF,OAAOC,OAAO,MAAM,kEAAkE;AACtF,OAAOC,MAAM,MAAM,gEAAgE;AAEnF,OAAOC,SAAS,MAAM,sEAAsE;AAC5F,SAASC,aAAa,QAAsB,8CAA8C;AAE1F,OAAOC,WAAW,MAAM,cAAc;AACtC,SAASC,aAAa,QAAsB,eAAe;AAC3D,SAASC,eAAe,QAAQ,sCAAsC;AAKtE,OAAO,MAAMC,WAAW,SAASjB,kBAAkB,CAAc;EAAAkB,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,kBACrD,KAAK;IAAAA,eAAA,eAC0D,SAAS;IAAAA,eAAA,kBAChE,EAAE;IAAAA,eAAA,wBACK,KAAK;IAAAA,eAAA,uBACN,IAAI;IAAAA,eAAA;EAAA;AAE9B;AACA,eAAe,MAAMC,MAAM,SAAStB,aAAa,CAAyC;EASrB;EACnEmB,WAAWA,CAACI,KAAkB,EAAE;IAC9B,KAAK,CAACA,KAAK,EAAEP,aAAa,EAAE,IAAID,WAAW,CAAC,CAAC,EAAE,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A6J,aAAA,CAAChJ,OAAO;QAACiF,EAAE,EAAE,IAAI,CAAC0E,SAAS,CAAC,aAAa,CAAE;QAAClB,MAAM,EAAE,IAAI,CAACA,MAAM,CAACc,UAAW;QAACM,OAAO,EAAEjJ,KAAK,CAAC2I;MAAW,CAAU,CAC5G,CACF,CACF,CAAC,GACL,IAAI,EACP,IAAI,CAAC7H,KAAK,CAAC2G,aAAa,gBAAGlJ,KAAA,CAAA6J,aAAA,CAAC9I,SAAS;QAACgI,IAAI,EAAE,IAAI,CAACxG,KAAK,CAACwG,IAAK;QAAC2B,OAAO,EAAE,IAAI,CAACnI,KAAK,CAACyG,OAAQ;QAAC4B,SAAS,EAAE,KAAM;QAACC,OAAO,EAAE,IAAI,CAAClB,UAAU,CAAClE,IAAI,CAAC,IAAI;MAAE,CAAY,CAAC,GAAG,IAAI,EAEnKhE,KAAK,CAAC8E,QAAQ,IAAI,IAAI,CAAChE,KAAK,CAACoE,WAAW,EACxClF,KAAK,CAACqJ,QACJ,CAAC;IACT,CAEa,CAAC;EAEpB;AACF","ignoreList":[]}
@@ -25,6 +25,7 @@ export default class WmFormProps extends BaseProps {
25
25
  _defineProperty(this, "onError", () => {});
26
26
  _defineProperty(this, "onBeforerender", () => {});
27
27
  _defineProperty(this, "generateComponent", metadata => {});
28
+ _defineProperty(this, "showinfoskeleton", false);
28
29
  }
29
30
  }
30
31
  //# sourceMappingURL=form.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BaseProps","WmFormProps","constructor","args","_defineProperty","metadata"],"sources":["form.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmFormProps extends BaseProps {\n children: any;\n dataoutput: any;\n onBeforeservicecall: any;\n onBeforesubmit: any;\n formdata: any;\n parentForm: string = '';\n metadata: any;\n title: any;\n subheading: any;\n iconclass: any;\n postmessage: string = 'Data posted successfully';\n errormessage: string = 'An error occured. Please try again!';\n messagelayout: string = 'Inline';\n formSubmit: Function = () => {};\n formSuccess: Function = () => {};\n relatedData: Function = () => {};\n onSuccess: Function = () => {};\n onError: Function = () => {};\n onBeforerender: Function = () => {};\n generateComponent: Function = (metadata:any) => {};\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,WAAW,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,qBAM5B,EAAE;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,sBAKD,0BAA0B;IAAAA,eAAA,uBACzB,qCAAqC;IAAAA,eAAA,wBACpC,QAAQ;IAAAA,eAAA,qBACT,MAAM,CAAC,CAAC;IAAAA,eAAA,sBACP,MAAM,CAAC,CAAC;IAAAA,eAAA,sBACR,MAAM,CAAC,CAAC;IAAAA,eAAA,oBACV,MAAM,CAAC,CAAC;IAAAA,eAAA,kBACV,MAAM,CAAC,CAAC;IAAAA,eAAA,yBACD,MAAM,CAAC,CAAC;IAAAA,eAAA,4BACJC,QAAY,IAAK,CAAC,CAAC;EAAA;AACpD","ignoreList":[]}
1
+ {"version":3,"names":["BaseProps","WmFormProps","constructor","args","_defineProperty","metadata"],"sources":["form.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmFormProps extends BaseProps {\n children: any;\n dataoutput: any;\n onBeforeservicecall: any;\n onBeforesubmit: any;\n formdata: any;\n parentForm: string = '';\n metadata: any;\n title: any;\n subheading: any;\n iconclass: any;\n postmessage: string = 'Data posted successfully';\n errormessage: string = 'An error occured. Please try again!';\n messagelayout: string = 'Inline';\n formSubmit: Function = () => {};\n formSuccess: Function = () => {};\n relatedData: Function = () => {};\n onSuccess: Function = () => {};\n onError: Function = () => {};\n onBeforerender: Function = () => {};\n generateComponent: Function = (metadata:any) => {};\n showinfoskeleton: boolean = false;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,WAAW,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,qBAM5B,EAAE;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,sBAKD,0BAA0B;IAAAA,eAAA,uBACzB,qCAAqC;IAAAA,eAAA,wBACpC,QAAQ;IAAAA,eAAA,qBACT,MAAM,CAAC,CAAC;IAAAA,eAAA,sBACP,MAAM,CAAC,CAAC;IAAAA,eAAA,sBACR,MAAM,CAAC,CAAC;IAAAA,eAAA,oBACV,MAAM,CAAC,CAAC;IAAAA,eAAA,kBACV,MAAM,CAAC,CAAC;IAAAA,eAAA,yBACD,MAAM,CAAC,CAAC;IAAAA,eAAA,4BACJC,QAAY,IAAK,CAAC,CAAC;IAAAD,eAAA,2BACtB,KAAK;EAAA;AACnC","ignoreList":[]}
@@ -4,6 +4,7 @@ import { isNil } from 'lodash';
4
4
  import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';
5
5
  import WmListTemplateProps from './list-template.props';
6
6
  import { DEFAULT_CLASS } from './list-template.styles';
7
+ import { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';
7
8
  export class WmListTemplateState extends BaseComponentState {}
8
9
  export default class WmListTemplate extends BaseComponent {
9
10
  constructor(props) {
@@ -11,6 +12,15 @@ export default class WmListTemplate extends BaseComponent {
11
12
  }
12
13
  renderWidget(props) {
13
14
  var _style;
15
+ if (this._showSkeleton && !props.showskeletonchildren) {
16
+ return createSkeleton(this.theme, this.styles.skeleton, {
17
+ ...this.styles.root
18
+ }, /*#__PURE__*/React.createElement(View, {
19
+ style: [this.styles.root, {
20
+ opacity: 0
21
+ }]
22
+ }, props.children));
23
+ }
14
24
  const list = this.parent;
15
25
  const listProps = list.state.props;
16
26
  const isHorizontalList = listProps.direction === 'horizontal';
@@ -23,8 +33,12 @@ export default class WmListTemplate extends BaseComponent {
23
33
  }
24
34
  }, style);
25
35
  }
36
+ const styles = [this.styles.root, (_style = style) === null || _style === void 0 ? void 0 : _style.root];
37
+ if (this._showSkeleton) {
38
+ styles.push(this.styles.skeleton.root);
39
+ }
26
40
  return /*#__PURE__*/React.createElement(View, {
27
- style: [this.styles.root, (_style = style) === null || _style === void 0 ? void 0 : _style.root]
41
+ style: styles
28
42
  }, this._background, props.children);
29
43
  }
30
44
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","isNil","BaseComponent","BaseComponentState","WmListTemplateProps","DEFAULT_CLASS","WmListTemplateState","WmListTemplate","constructor","props","renderWidget","_style","list","parent","listProps","state","isHorizontalList","direction","noOfCols","getNoOfColumns","style","theme","getStyle","mergeStyle","root","flex","createElement","styles","_background","children"],"sources":["list-template.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { isNil } from 'lodash';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmListTemplateProps from './list-template.props';\nimport { DEFAULT_CLASS, WmListTemplateStyles } from './list-template.styles';\nimport WmList from '../list.component';\n\nexport class WmListTemplateState extends BaseComponentState<WmListTemplateProps> {\n\n}\n\nexport default class WmListTemplate extends BaseComponent<WmListTemplateProps, WmListTemplateState, WmListTemplateStyles> {\n\n constructor(props: WmListTemplateProps) {\n super(props, DEFAULT_CLASS, new WmListTemplateProps());\n }\n\n renderWidget(props: WmListTemplateProps) {\n const list = (this.parent as WmList);\n const listProps = list.state.props;\n const isHorizontalList = listProps.direction === 'horizontal';\n const noOfCols = list.getNoOfColumns();\n let style = this.theme.getStyle( isHorizontalList ? 'horizontal-list-template' : 'vertical-list-template');\n if (isNil(style['flex']) && !isHorizontalList && noOfCols === 1) {\n style = this.theme.mergeStyle({root: {flex: 1}}, style);\n }\n return (\n <View style={[this.styles.root, style?.root]}>{this._background}{props.children}</View>\n ); \n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,KAAK,QAAQ,QAAQ;AAC9B,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,mBAAmB,MAAM,uBAAuB;AACvD,SAASC,aAAa,QAA8B,wBAAwB;AAG5E,OAAO,MAAMC,mBAAmB,SAASH,kBAAkB,CAAsB;AAIjF,eAAe,MAAMI,cAAc,SAASL,aAAa,CAAiE;EAExHM,WAAWA,CAACC,KAA0B,EAAE;IACtC,KAAK,CAACA,KAAK,EAAEJ,aAAa,EAAE,IAAID,mBAAmB,CAAC,CAAC,CAAC;EACxD;EAEAM,YAAYA,CAACD,KAA0B,EAAE;IAAA,IAAAE,MAAA;IACvC,MAAMC,IAAI,GAAI,IAAI,CAACC,MAAiB;IACpC,MAAMC,SAAS,GAAGF,IAAI,CAACG,KAAK,CAACN,KAAK;IAClC,MAAMO,gBAAgB,GAAGF,SAAS,CAACG,SAAS,KAAK,YAAY;IAC7D,MAAMC,QAAQ,GAAGN,IAAI,CAACO,cAAc,CAAC,CAAC;IACtC,IAAIC,KAAK,GAAG,IAAI,CAACC,KAAK,CAACC,QAAQ,CAAEN,gBAAgB,GAAG,0BAA0B,GAAG,wBAAwB,CAAC;IAC1G,IAAIf,KAAK,CAACmB,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAACJ,gBAAgB,IAAIE,QAAQ,KAAK,CAAC,EAAE;MAC7DE,KAAK,GAAG,IAAI,CAACC,KAAK,CAACE,UAAU,CAAC;QAACC,IAAI,EAAE;UAACC,IAAI,EAAE;QAAC;MAAC,CAAC,EAAEL,KAAK,CAAC;IAC3D;IACA,oBACErB,KAAA,CAAA2B,aAAA,CAAC1B,IAAI;MAACoB,KAAK,EAAE,CAAC,IAAI,CAACO,MAAM,CAACH,IAAI,GAAAb,MAAA,GAAES,KAAK,cAAAT,MAAA,uBAALA,MAAA,CAAOa,IAAI;IAAE,GAAE,IAAI,CAACI,WAAW,EAAEnB,KAAK,CAACoB,QAAe,CAAC;EAE3F;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","View","isNil","BaseComponent","BaseComponentState","WmListTemplateProps","DEFAULT_CLASS","createSkeleton","WmListTemplateState","WmListTemplate","constructor","props","renderWidget","_style","_showSkeleton","showskeletonchildren","theme","styles","skeleton","root","createElement","style","opacity","children","list","parent","listProps","state","isHorizontalList","direction","noOfCols","getNoOfColumns","getStyle","mergeStyle","flex","push","_background"],"sources":["list-template.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { isNil } from 'lodash';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmListTemplateProps from './list-template.props';\nimport { DEFAULT_CLASS, WmListTemplateStyles } from './list-template.styles';\nimport WmList from '../list.component';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\n\nexport class WmListTemplateState extends BaseComponentState<WmListTemplateProps> {\n\n}\n\nexport default class WmListTemplate extends BaseComponent<WmListTemplateProps, WmListTemplateState, WmListTemplateStyles> {\n\n constructor(props: WmListTemplateProps) {\n super(props, DEFAULT_CLASS, new WmListTemplateProps());\n }\n\n renderWidget(props: WmListTemplateProps) {\n\n if(this._showSkeleton && !props.showskeletonchildren) { \n return createSkeleton(this.theme, this.styles.skeleton, {\n ...this.styles.root,\n }, (<View style={[this.styles.root, {opacity: 0}]}>\n {props.children}\n </View>))\n }\n \n const list = (this.parent as WmList);\n const listProps = list.state.props;\n const isHorizontalList = listProps.direction === 'horizontal';\n const noOfCols = list.getNoOfColumns();\n let style = this.theme.getStyle( isHorizontalList ? 'horizontal-list-template' : 'vertical-list-template');\n if (isNil(style['flex']) && !isHorizontalList && noOfCols === 1) {\n style = this.theme.mergeStyle({root: {flex: 1}}, style);\n }\n const styles = [this.styles.root, style?.root];\n if(this._showSkeleton) {\n styles.push(this.styles.skeleton.root)\n }\n return (\n <View style={styles}>{this._background}{props.children}</View>\n ); \n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,KAAK,QAAQ,QAAQ;AAC9B,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,mBAAmB,MAAM,uBAAuB;AACvD,SAASC,aAAa,QAA8B,wBAAwB;AAE5E,SAASC,cAAc,QAAQ,wEAAwE;AAEvG,OAAO,MAAMC,mBAAmB,SAASJ,kBAAkB,CAAsB;AAIjF,eAAe,MAAMK,cAAc,SAASN,aAAa,CAAiE;EAExHO,WAAWA,CAACC,KAA0B,EAAE;IACtC,KAAK,CAACA,KAAK,EAAEL,aAAa,EAAE,IAAID,mBAAmB,CAAC,CAAC,CAAC;EACxD;EAEAO,YAAYA,CAACD,KAA0B,EAAE;IAAA,IAAAE,MAAA;IAEvC,IAAG,IAAI,CAACC,aAAa,IAAI,CAACH,KAAK,CAACI,oBAAoB,EAAE;MACpD,OAAOR,cAAc,CAAC,IAAI,CAACS,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC,QAAQ,EAAE;QACtD,GAAG,IAAI,CAACD,MAAM,CAACE;MAChB,CAAC,eAAGnB,KAAA,CAAAoB,aAAA,CAACnB,IAAI;QAACoB,KAAK,EAAE,CAAC,IAAI,CAACJ,MAAM,CAACE,IAAI,EAAE;UAACG,OAAO,EAAE;QAAC,CAAC;MAAE,GAChDX,KAAK,CAACY,QACH,CAAE,CAAC;IACX;IAEA,MAAMC,IAAI,GAAI,IAAI,CAACC,MAAiB;IACpC,MAAMC,SAAS,GAAGF,IAAI,CAACG,KAAK,CAAChB,KAAK;IAClC,MAAMiB,gBAAgB,GAAGF,SAAS,CAACG,SAAS,KAAK,YAAY;IAC7D,MAAMC,QAAQ,GAAGN,IAAI,CAACO,cAAc,CAAC,CAAC;IACtC,IAAIV,KAAK,GAAG,IAAI,CAACL,KAAK,CAACgB,QAAQ,CAAEJ,gBAAgB,GAAG,0BAA0B,GAAG,wBAAwB,CAAC;IAC1G,IAAI1B,KAAK,CAACmB,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAACO,gBAAgB,IAAIE,QAAQ,KAAK,CAAC,EAAE;MAC7DT,KAAK,GAAG,IAAI,CAACL,KAAK,CAACiB,UAAU,CAAC;QAACd,IAAI,EAAE;UAACe,IAAI,EAAE;QAAC;MAAC,CAAC,EAAEb,KAAK,CAAC;IAC3D;IACA,MAAMJ,MAAM,GAAG,CAAC,IAAI,CAACA,MAAM,CAACE,IAAI,GAAAN,MAAA,GAAEQ,KAAK,cAAAR,MAAA,uBAALA,MAAA,CAAOM,IAAI,CAAC;IAC9C,IAAG,IAAI,CAACL,aAAa,EAAE;MACrBG,MAAM,CAACkB,IAAI,CAAC,IAAI,CAAClB,MAAM,CAACC,QAAQ,CAACC,IAAI,CAAC;IACxC;IACA,oBACEnB,KAAA,CAAAoB,aAAA,CAACnB,IAAI;MAACoB,KAAK,EAAEJ;IAAO,GAAE,IAAI,CAACmB,WAAW,EAAEzB,KAAK,CAACY,QAAe,CAAC;EAElE;AACF","ignoreList":[]}
@@ -6,6 +6,7 @@ export default class WmListTemplateProps extends BaseProps {
6
6
  constructor(...args) {
7
7
  super(...args);
8
8
  _defineProperty(this, "children", void 0);
9
+ _defineProperty(this, "showskeletonchildren", true);
9
10
  }
10
11
  }
11
12
  //# sourceMappingURL=list-template.props.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BaseProps","WmListTemplateProps","constructor","args","_defineProperty"],"sources":["list-template.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmListTemplateProps extends BaseProps {\n children: any;\n}"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,mBAAmB,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;EAAA;AAE3D","ignoreList":[]}
1
+ {"version":3,"names":["BaseProps","WmListTemplateProps","constructor","args","_defineProperty"],"sources":["list-template.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmListTemplateProps extends BaseProps {\n children: any;\n showskeletonchildren = true;\n}"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,mBAAmB,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;IAAAA,eAAA,+BAElC,IAAI;EAAA;AAC7B","ignoreList":[]}
@@ -6,7 +6,17 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
6
6
  root: {
7
7
  backgroundColor: themeVariables.listHeaderBgColor
8
8
  },
9
- text: {}
9
+ text: {},
10
+ skeleton: {
11
+ root: {
12
+ backgroundColor: themeVariables.skeletonBgColor,
13
+ paddingLeft: 10,
14
+ paddingRight: 10,
15
+ paddingTop: 16,
16
+ paddingBottom: 16,
17
+ flex: 1
18
+ }
19
+ }
10
20
  });
11
21
  addStyle(DEFAULT_CLASS, '', defaultStyles);
12
22
  addStyle('list-card-template', '', {
@@ -1 +1 @@
1
- {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","backgroundColor","listHeaderBgColor","text","borderBottomWidth"],"sources":["list-template.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport type WmListTemplateStyles = BaseStyles & {};\n\nexport const DEFAULT_CLASS = 'app-list-template';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmListTemplateStyles = defineStyles<WmListTemplateStyles>({\n root: {\n backgroundColor: themeVariables.listHeaderBgColor,\n },\n text: {}\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle('list-card-template', '', {\n root : {\n borderBottomWidth: 0,\n // marginLeft: 35,\n }\n } as WmListTemplateStyles);\n addStyle('horizontal-list-template', '', {\n root : {}\n } as WmListTemplateStyles);\n addStyle('vertical-list-template', '', {\n root : {\n }\n } as WmListTemplateStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAIxF,OAAO,MAAMC,aAAa,GAAG,mBAAmB;AAChDF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAAmC,GAAGL,YAAY,CAAuB;IAC3EM,IAAI,EAAE;MACFC,eAAe,EAAEJ,cAAc,CAACK;IACpC,CAAC;IACDC,IAAI,EAAE,CAAC;EACX,CAAC,CAAC;EAEFL,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAAC,oBAAoB,EAAE,EAAE,EAAE;IAC/BE,IAAI,EAAG;MACHI,iBAAiB,EAAE;MACnB;IACJ;EACJ,CAAyB,CAAC;EAC1BN,QAAQ,CAAC,0BAA0B,EAAE,EAAE,EAAE;IACrCE,IAAI,EAAG,CAAC;EACZ,CAAyB,CAAC;EAC1BF,QAAQ,CAAC,wBAAwB,EAAE,EAAE,EAAE;IACnCE,IAAI,EAAG,CACP;EACJ,CAAyB,CAAC;AAC9B,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","backgroundColor","listHeaderBgColor","text","skeleton","skeletonBgColor","paddingLeft","paddingRight","paddingTop","paddingBottom","flex","borderBottomWidth"],"sources":["list-template.styles.ts"],"sourcesContent":["import BASE_THEME from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmListTemplateStyles = BaseStyles & {\n skeleton: WmSkeletonStyles\n};\n\nexport const DEFAULT_CLASS = 'app-list-template';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmListTemplateStyles = defineStyles<WmListTemplateStyles>({\n root: {\n backgroundColor: themeVariables.listHeaderBgColor,\n },\n text: {},\n skeleton: {\n root: {\n backgroundColor: themeVariables.skeletonBgColor,\n paddingLeft: 10,\n paddingRight: 10,\n paddingTop: 16,\n paddingBottom: 16,\n flex: 1\n }\n } as any as WmSkeletonStyles\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle('list-card-template', '', {\n root : {\n borderBottomWidth: 0,\n // marginLeft: 35,\n }\n } as WmListTemplateStyles);\n addStyle('horizontal-list-template', '', {\n root : {}\n } as WmListTemplateStyles);\n addStyle('vertical-list-template', '', {\n root : {\n }\n } as WmListTemplateStyles);\n});"],"mappings":"AAAA,OAAOA,UAAU,MAAM,wCAAwC;AAC/D,SAAqBC,YAAY,QAAQ,+CAA+C;AAOxF,OAAO,MAAMC,aAAa,GAAG,mBAAmB;AAChDF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACnD,MAAMC,aAAmC,GAAGL,YAAY,CAAuB;IAC3EM,IAAI,EAAE;MACFC,eAAe,EAAEJ,cAAc,CAACK;IACpC,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,QAAQ,EAAE;MACNJ,IAAI,EAAE;QACFC,eAAe,EAAEJ,cAAc,CAACQ,eAAe;QAC/CC,WAAW,EAAE,EAAE;QACfC,YAAY,EAAE,EAAE;QAChBC,UAAU,EAAE,EAAE;QACdC,aAAa,EAAE,EAAE;QACjBC,IAAI,EAAE;MACV;IACJ;EACJ,CAAC,CAAC;EAEFZ,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAAC,oBAAoB,EAAE,EAAE,EAAE;IAC/BE,IAAI,EAAG;MACHW,iBAAiB,EAAE;MACnB;IACJ;EACJ,CAAyB,CAAC;EAC1Bb,QAAQ,CAAC,0BAA0B,EAAE,EAAE,EAAE;IACrCE,IAAI,EAAG,CAAC;EACZ,CAAyB,CAAC;EAC1BF,QAAQ,CAAC,wBAAwB,EAAE,EAAE,EAAE;IACnCE,IAAI,EAAG,CACP;EACJ,CAAyB,CAAC;AAC9B,CAAC,CAAC","ignoreList":[]}
@@ -6,7 +6,7 @@ import React from 'react';
6
6
  import { ActivityIndicator, SectionList, Text, View, FlatList } from 'react-native';
7
7
  import { isArray, isEmpty, isNil, isNumber, round } from 'lodash-es';
8
8
  import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';
9
- import { getGroupedData, isDefined } from "@wavemaker/app-rn-runtime/core/utils";
9
+ import { getGroupedData, getNumberOfEmptyObjects, isDefined } from "@wavemaker/app-rn-runtime/core/utils";
10
10
  import { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';
11
11
  import { DefaultKeyExtractor } from '@wavemaker/app-rn-runtime/core/key.extractor';
12
12
  import WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';
@@ -316,6 +316,10 @@ export default class WmList extends BaseComponent {
316
316
  renderItem(item, index, props) {
317
317
  const cols = this.getNoOfColumns();
318
318
  const isHorizontal = props.direction === 'horizontal';
319
+ const styles = this._showSkeleton ? {
320
+ ...this.styles.item,
321
+ ...this.styles.skeleton.root
322
+ } : this.styles.item;
319
323
  return index < this.state.maxRecordsToShow || isHorizontal ? /*#__PURE__*/React.createElement(Swipeable, {
320
324
  renderLeftActions: () => this.renderLeftActions(),
321
325
  renderRightActions: () => this.renderRightActions(),
@@ -324,7 +328,7 @@ export default class WmList extends BaseComponent {
324
328
  flex: null
325
329
  } : {}
326
330
  }, /*#__PURE__*/React.createElement(View, {
327
- style: [this.styles.item, props.itemclass ? this.theme.getStyle(props.itemclass(item, index)) : null, this.isSelected(item) ? this.styles.selectedItem : {}]
331
+ style: [styles, props.itemclass ? this.theme.getStyle(props.itemclass(item, index)) : null, this.isSelected(item) ? this.styles.selectedItem : {}]
328
332
  }, /*#__PURE__*/React.createElement(Tappable, _extends({}, this.getTestPropsForAction(`item${index}`), {
329
333
  onTap: $event => this.onSelect(item, index, $event),
330
334
  onLongTap: () => this.invokeEventCallback('onLongtap', [null, this.proxy]),
@@ -404,31 +408,35 @@ export default class WmList extends BaseComponent {
404
408
  return /*#__PURE__*/React.createElement(View, {
405
409
  style: this.styles.root,
406
410
  onLayout: e => this.onLayoutChange(e)
407
- }, !isEmpty(this.state.groupedData) ? this.state.groupedData.map((v, i) => /*#__PURE__*/React.createElement(View, {
408
- style: this.styles.group,
409
- key: v.key || this.keyExtractor.getKey(v, true)
410
- }, this.renderHeader(props, v.key), /*#__PURE__*/React.createElement(FlatList, _extends({
411
- key: props.name + '_' + (isHorizontal ? 'H' : 'V') + props.itemsperrow.xs,
412
- keyExtractor: (item, i) => this.generateItemKey(item, i, props),
413
- scrollEnabled: isHorizontal,
414
- horizontal: isHorizontal,
415
- data: isEmpty(v.data[0]) ? [] : v.data,
416
- ListEmptyComponent: itemInfo => this.renderEmptyMessage(isHorizontal, itemInfo.item, itemInfo.index, props),
417
- renderItem: itemInfo => this.renderItem(itemInfo.item, itemInfo.index, props)
418
- }, isHorizontal ? {} : {
419
- numColumns: this.getNoOfColumns()
420
- })), this.loadDataOnDemand || v.data.length > this.state.maxRecordsToShow ? this.loadingData ? this.renderLoadingIcon(props) : /*#__PURE__*/React.createElement(WmLabel, {
421
- id: this.getTestId('ondemandmessage'),
422
- styles: this.styles.onDemandMessage,
423
- caption: this.hasMoreData && !isHorizontal ? props.ondemandmessage : props.nodatamessage,
424
- onTap: () => this.loadData()
425
- }) : null)) : this.renderEmptyMessage(isHorizontal, null, null, props));
411
+ }, !isEmpty(this.state.groupedData) ? this.state.groupedData.map((v, i) => {
412
+ var _ref;
413
+ return /*#__PURE__*/React.createElement(View, {
414
+ style: this.styles.group,
415
+ key: v.key || this.keyExtractor.getKey(v, true)
416
+ }, this.renderHeader(props, v.key), /*#__PURE__*/React.createElement(FlatList, _extends({
417
+ key: props.name + '_' + (isHorizontal ? 'H' : 'V') + props.itemsperrow.xs,
418
+ keyExtractor: (item, i) => this.generateItemKey(item, i, props),
419
+ scrollEnabled: isHorizontal,
420
+ horizontal: isHorizontal,
421
+ data: this._showSkeleton ? [...getNumberOfEmptyObjects((_ref = this.props.numberofskeletonitems) !== null && _ref !== void 0 ? _ref : 3)] : isEmpty(v.data[0]) ? [] : v.data,
422
+ ListEmptyComponent: itemInfo => this.renderEmptyMessage(isHorizontal, itemInfo.item, itemInfo.index, props),
423
+ renderItem: itemInfo => this.renderItem(itemInfo.item, itemInfo.index, props)
424
+ }, isHorizontal ? {} : {
425
+ numColumns: this.getNoOfColumns()
426
+ })), this.loadDataOnDemand || v.data.length > this.state.maxRecordsToShow ? this.loadingData ? this.renderLoadingIcon(props) : /*#__PURE__*/React.createElement(WmLabel, {
427
+ id: this.getTestId('ondemandmessage'),
428
+ styles: this.styles.onDemandMessage,
429
+ caption: this.hasMoreData && !isHorizontal ? props.ondemandmessage : props.nodatamessage,
430
+ onTap: () => this.loadData()
431
+ }) : null);
432
+ }) : this.renderEmptyMessage(isHorizontal, null, null, props));
426
433
  }
427
- getSectionListData() {
434
+ getSectionListData(props) {
428
435
  if (this._showSkeleton) {
436
+ var _ref2;
429
437
  return [{
430
438
  key: '',
431
- data: [{}, {}, {}]
439
+ data: [...getNumberOfEmptyObjects((_ref2 = this.props.numberofskeletonitems) !== null && _ref2 !== void 0 ? _ref2 : 3)]
432
440
  }];
433
441
  } else if (this.state.groupedData && this.state.groupedData[0] && this.state.groupedData[0]['data'].length) {
434
442
  return this.state.groupedData;
@@ -440,7 +448,7 @@ export default class WmList extends BaseComponent {
440
448
  keyExtractor: (item, i) => this.generateItemKey(item, i, props),
441
449
  horizontal: isHorizontal,
442
450
  contentContainerStyle: this.styles.root,
443
- sections: this.getSectionListData(),
451
+ sections: this.getSectionListData(props),
444
452
  renderSectionHeader: ({
445
453
  section: {
446
454
  key,