@wavemaker/app-ng-runtime 11.8.0-next.24904 → 11.8.0-next.27301

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. app-ng-runtime/build-task/bundles/index.umd.js +5 -5
  2. app-ng-runtime/build-task/esm2022/basic/progress/progress-bar/progress-bar.build.mjs +1 -1
  3. app-ng-runtime/build-task/esm2022/page/page.build.mjs +3 -2
  4. app-ng-runtime/build-task/fesm2022/index.mjs +2 -1
  5. app-ng-runtime/build-task/fesm2022/index.mjs.map +1 -1
  6. app-ng-runtime/components/advanced/carousel/bundles/index.umd.js +5 -5
  7. app-ng-runtime/components/advanced/carousel/esm2022/carousel.animator.mjs +3 -2
  8. app-ng-runtime/components/advanced/carousel/esm2022/carousel.directive.mjs +1 -1
  9. app-ng-runtime/components/advanced/carousel/fesm2022/index.mjs +2 -1
  10. app-ng-runtime/components/advanced/carousel/fesm2022/index.mjs.map +1 -1
  11. app-ng-runtime/components/advanced/login/bundles/index.umd.js +6 -6
  12. app-ng-runtime/components/advanced/login/esm2022/login.component.mjs +4 -3
  13. app-ng-runtime/components/advanced/login/fesm2022/index.mjs +3 -2
  14. app-ng-runtime/components/advanced/login/fesm2022/index.mjs.map +1 -1
  15. app-ng-runtime/components/base/bundles/index.umd.js +203 -171
  16. app-ng-runtime/components/base/esm2022/directives/show-in-device.directive.mjs +1 -1
  17. app-ng-runtime/components/base/esm2022/pipes/custom-pipes.mjs +12 -11
  18. app-ng-runtime/components/base/esm2022/pipes/wm-pipe.mjs +3 -2
  19. app-ng-runtime/components/base/esm2022/utils/data-utils.mjs +30 -29
  20. app-ng-runtime/components/base/esm2022/utils/form-utils.mjs +47 -41
  21. app-ng-runtime/components/base/esm2022/utils/live-utils.mjs +8 -7
  22. app-ng-runtime/components/base/esm2022/utils/widget-utils.mjs +28 -27
  23. app-ng-runtime/components/base/esm2022/widgets/common/base/base-container.component.mjs +4 -3
  24. app-ng-runtime/components/base/esm2022/widgets/common/base/base-field-validations.mjs +24 -21
  25. app-ng-runtime/components/base/esm2022/widgets/common/base/base.component.mjs +12 -11
  26. app-ng-runtime/components/base/esm2022/widgets/common/base/dataset-aware-nav.component.mjs +40 -14
  27. app-ng-runtime/components/base/esm2022/widgets/common/base/partial-container.directive.mjs +3 -2
  28. app-ng-runtime/components/base/esm2022/widgets/common/dialog/dialog.service.mjs +3 -2
  29. app-ng-runtime/components/base/esm2022/widgets/common/lazy-load/lazy-load.directive.mjs +1 -1
  30. app-ng-runtime/components/base/esm2022/widgets/common/partial/partial.directive.mjs +3 -2
  31. app-ng-runtime/components/base/esm2022/widgets/common/partial-param/partial-param.directive.mjs +3 -2
  32. app-ng-runtime/components/base/esm2022/widgets/common/smooth-scroll/smooth-scroll.directive.mjs +6 -5
  33. app-ng-runtime/components/base/esm2022/widgets/framework/deviceview.mjs +1 -1
  34. app-ng-runtime/components/base/esm2022/widgets/framework/property-change-handler.mjs +3 -2
  35. app-ng-runtime/components/base/esm2022/widgets/framework/widget-proxy-provider.mjs +4 -3
  36. app-ng-runtime/components/base/fesm2022/index.mjs +206 -173
  37. app-ng-runtime/components/base/fesm2022/index.mjs.map +1 -1
  38. app-ng-runtime/components/base/pipes/custom-pipes.d.ts +1 -1
  39. app-ng-runtime/components/base/utils/data-utils.d.ts +0 -1
  40. app-ng-runtime/components/base/utils/widget-utils.d.ts +2 -2
  41. app-ng-runtime/components/base/widgets/common/base/base-field-validations.d.ts +1 -1
  42. app-ng-runtime/components/base/widgets/common/base/partial-container.directive.d.ts +1 -1
  43. app-ng-runtime/components/basic/default/bundles/index.umd.js +10 -10
  44. app-ng-runtime/components/basic/default/esm2022/label/label.directive.mjs +4 -3
  45. app-ng-runtime/components/basic/default/esm2022/spinner/spinner.component.mjs +6 -5
  46. app-ng-runtime/components/basic/default/fesm2022/index.mjs +7 -6
  47. app-ng-runtime/components/basic/default/fesm2022/index.mjs.map +1 -1
  48. app-ng-runtime/components/basic/progress/bundles/index.umd.js +13 -13
  49. app-ng-runtime/components/basic/progress/esm2022/progress-bar/progress-bar.component.mjs +5 -4
  50. app-ng-runtime/components/basic/progress/esm2022/progress-circle/progress-circle.component.mjs +6 -5
  51. app-ng-runtime/components/basic/progress/esm2022/utils.mjs +3 -3
  52. app-ng-runtime/components/basic/progress/fesm2022/index.mjs +10 -9
  53. app-ng-runtime/components/basic/progress/fesm2022/index.mjs.map +1 -1
  54. app-ng-runtime/components/basic/rich-text-editor/bundles/index.umd.js +15 -10
  55. app-ng-runtime/components/basic/rich-text-editor/esm2022/rich-text-editor.component.mjs +14 -8
  56. app-ng-runtime/components/basic/rich-text-editor/fesm2022/index.mjs +13 -7
  57. app-ng-runtime/components/basic/rich-text-editor/fesm2022/index.mjs.map +1 -1
  58. app-ng-runtime/components/basic/rich-text-editor/rich-text-editor.component.d.ts +2 -2
  59. app-ng-runtime/components/basic/search/bundles/index.umd.js +67 -65
  60. app-ng-runtime/components/basic/search/esm2022/data-provider/data-provider.mjs +1 -1
  61. app-ng-runtime/components/basic/search/esm2022/data-provider/local-data-provider.mjs +26 -23
  62. app-ng-runtime/components/basic/search/esm2022/data-provider/remote-data-provider.mjs +12 -11
  63. app-ng-runtime/components/basic/search/esm2022/search.component.mjs +31 -30
  64. app-ng-runtime/components/basic/search/fesm2022/index.mjs +66 -63
  65. app-ng-runtime/components/basic/search/fesm2022/index.mjs.map +1 -1
  66. app-ng-runtime/components/basic/tree/bundles/index.umd.js +9 -9
  67. app-ng-runtime/components/basic/tree/esm2022/tree.component.mjs +7 -6
  68. app-ng-runtime/components/basic/tree/fesm2022/index.mjs +6 -5
  69. app-ng-runtime/components/basic/tree/fesm2022/index.mjs.map +1 -1
  70. app-ng-runtime/components/chart/bundles/index.umd.js +72 -63
  71. app-ng-runtime/components/chart/chart.component.d.ts +1 -1
  72. app-ng-runtime/components/chart/chart.utils.d.ts +3 -3
  73. app-ng-runtime/components/chart/esm2022/chart.component.mjs +58 -48
  74. app-ng-runtime/components/chart/esm2022/chart.utils.mjs +14 -13
  75. app-ng-runtime/components/chart/fesm2022/index.mjs +69 -59
  76. app-ng-runtime/components/chart/fesm2022/index.mjs.map +1 -1
  77. app-ng-runtime/components/containers/accordion/bundles/index.umd.js +16 -16
  78. app-ng-runtime/components/containers/accordion/esm2022/accordion.directive.mjs +14 -13
  79. app-ng-runtime/components/containers/accordion/fesm2022/index.mjs +13 -12
  80. app-ng-runtime/components/containers/accordion/fesm2022/index.mjs.map +1 -1
  81. app-ng-runtime/components/containers/panel/bundles/index.umd.js +5 -5
  82. app-ng-runtime/components/containers/panel/esm2022/panel.component.mjs +3 -2
  83. app-ng-runtime/components/containers/panel/fesm2022/index.mjs +2 -1
  84. app-ng-runtime/components/containers/panel/fesm2022/index.mjs.map +1 -1
  85. app-ng-runtime/components/containers/panel/panel.component.d.ts +1 -1
  86. app-ng-runtime/components/containers/tabs/bundles/index.umd.js +17 -17
  87. app-ng-runtime/components/containers/tabs/esm2022/tabs.component.mjs +15 -14
  88. app-ng-runtime/components/containers/tabs/fesm2022/index.mjs +14 -13
  89. app-ng-runtime/components/containers/tabs/fesm2022/index.mjs.map +1 -1
  90. app-ng-runtime/components/data/form/bundles/index.umd.js +75 -75
  91. app-ng-runtime/components/data/form/esm2022/form-action/form-action.directive.mjs +3 -2
  92. app-ng-runtime/components/data/form/esm2022/form-field/form-field.directive.mjs +10 -9
  93. app-ng-runtime/components/data/form/esm2022/form.component.mjs +54 -53
  94. app-ng-runtime/components/data/form/esm2022/live-filter/live-filter.directive.mjs +3 -2
  95. app-ng-runtime/components/data/form/esm2022/live-form/live-form.directive.mjs +11 -10
  96. app-ng-runtime/components/data/form/fesm2022/index.mjs +77 -76
  97. app-ng-runtime/components/data/form/fesm2022/index.mjs.map +1 -1
  98. app-ng-runtime/components/data/form/form.component.d.ts +2 -2
  99. app-ng-runtime/components/data/form/live-form/live-form.directive.d.ts +1 -1
  100. app-ng-runtime/components/data/list/bundles/index.umd.js +692 -687
  101. app-ng-runtime/components/data/list/esm2022/list-item.directive.mjs +1 -1
  102. app-ng-runtime/components/data/list/esm2022/list.animator.mjs +5 -3
  103. app-ng-runtime/components/data/list/esm2022/list.component.mjs +687 -682
  104. app-ng-runtime/components/data/list/fesm2022/index.mjs +690 -684
  105. app-ng-runtime/components/data/list/fesm2022/index.mjs.map +1 -1
  106. app-ng-runtime/components/data/list/list.component.d.ts +53 -53
  107. app-ng-runtime/components/data/live-table/bundles/index.umd.js +1 -1
  108. app-ng-runtime/components/data/live-table/esm2022/live-table.component.mjs +2 -2
  109. app-ng-runtime/components/data/live-table/fesm2022/index.mjs +1 -1
  110. app-ng-runtime/components/data/live-table/fesm2022/index.mjs.map +1 -1
  111. app-ng-runtime/components/data/pagination/bundles/index.umd.js +14 -14
  112. app-ng-runtime/components/data/pagination/esm2022/pagination.component.mjs +12 -11
  113. app-ng-runtime/components/data/pagination/fesm2022/index.mjs +11 -10
  114. app-ng-runtime/components/data/pagination/fesm2022/index.mjs.map +1 -1
  115. app-ng-runtime/components/data/table/bundles/index.umd.js +175 -172
  116. app-ng-runtime/components/data/table/esm2022/table-action/table-action.directive.mjs +3 -2
  117. app-ng-runtime/components/data/table/esm2022/table-column/table-column.directive.mjs +19 -18
  118. app-ng-runtime/components/data/table/esm2022/table-cud.directive.mjs +7 -6
  119. app-ng-runtime/components/data/table/esm2022/table-filter.directive.mjs +53 -55
  120. app-ng-runtime/components/data/table/esm2022/table-row-action/table-row-action.directive.mjs +3 -2
  121. app-ng-runtime/components/data/table/esm2022/table.component.mjs +98 -91
  122. app-ng-runtime/components/data/table/fesm2022/index.mjs +172 -168
  123. app-ng-runtime/components/data/table/fesm2022/index.mjs.map +1 -1
  124. app-ng-runtime/components/data/table/table-column/table-column.directive.d.ts +6 -6
  125. app-ng-runtime/components/data/table/table.component.d.ts +2 -2
  126. app-ng-runtime/components/dialogs/default/bundles/index.umd.js +2 -2
  127. app-ng-runtime/components/dialogs/default/esm2022/base-dialog.mjs +3 -3
  128. app-ng-runtime/components/dialogs/default/esm2022/dialog-body/dialog-body.directive.mjs +1 -1
  129. app-ng-runtime/components/dialogs/default/fesm2022/index.mjs +1 -1
  130. app-ng-runtime/components/dialogs/default/fesm2022/index.mjs.map +1 -1
  131. app-ng-runtime/components/input/calendar/bundles/index.umd.js +33 -31
  132. app-ng-runtime/components/input/calendar/esm2022/calendar.component.mjs +31 -28
  133. app-ng-runtime/components/input/calendar/fesm2022/index.mjs +30 -27
  134. app-ng-runtime/components/input/calendar/fesm2022/index.mjs.map +1 -1
  135. app-ng-runtime/components/input/chips/bundles/index.umd.js +29 -28
  136. app-ng-runtime/components/input/chips/chips.component.d.ts +1 -1
  137. app-ng-runtime/components/input/chips/esm2022/chips.component.mjs +27 -25
  138. app-ng-runtime/components/input/chips/fesm2022/index.mjs +26 -24
  139. app-ng-runtime/components/input/chips/fesm2022/index.mjs.map +1 -1
  140. app-ng-runtime/components/input/default/base-form.component.d.ts +3 -3
  141. app-ng-runtime/components/input/default/bundles/index.umd.js +75 -62
  142. app-ng-runtime/components/input/default/checkbox/checkbox.component.d.ts +1 -0
  143. app-ng-runtime/components/input/default/dataset-aware-form.component.d.ts +4 -4
  144. app-ng-runtime/components/input/default/esm2022/base-form.component.mjs +14 -8
  145. app-ng-runtime/components/input/default/esm2022/caption-position.directive.mjs +3 -2
  146. app-ng-runtime/components/input/default/esm2022/checkbox/checkbox.component.mjs +2 -2
  147. app-ng-runtime/components/input/default/esm2022/checkboxset/checkboxset.component.mjs +6 -4
  148. app-ng-runtime/components/input/default/esm2022/dataset-aware-form.component.mjs +29 -23
  149. app-ng-runtime/components/input/default/esm2022/radioset/radioset.component.mjs +4 -3
  150. app-ng-runtime/components/input/default/esm2022/select/select.component.mjs +4 -3
  151. app-ng-runtime/components/input/default/esm2022/switch/switch.component.mjs +6 -5
  152. app-ng-runtime/components/input/default/esm2022/text/base/base-input.mjs +4 -3
  153. app-ng-runtime/components/input/default/esm2022/text/locale/number-locale.mjs +20 -18
  154. app-ng-runtime/components/input/default/esm2022/text/text/input-text.component.mjs +2 -2
  155. app-ng-runtime/components/input/default/fesm2022/index.mjs +75 -62
  156. app-ng-runtime/components/input/default/fesm2022/index.mjs.map +1 -1
  157. app-ng-runtime/components/input/epoch/base-date-time.component.d.ts +1 -1
  158. app-ng-runtime/components/input/epoch/bundles/index.umd.js +53 -51
  159. app-ng-runtime/components/input/epoch/esm2022/base-date-time.component.mjs +34 -31
  160. app-ng-runtime/components/input/epoch/esm2022/date/date.component.mjs +5 -4
  161. app-ng-runtime/components/input/epoch/esm2022/date-time/date-time-picker.component.mjs +5 -4
  162. app-ng-runtime/components/input/epoch/esm2022/date-time/date-time.component.mjs +7 -6
  163. app-ng-runtime/components/input/epoch/esm2022/picker/picker.component.mjs +1 -1
  164. app-ng-runtime/components/input/epoch/esm2022/time/time.component.mjs +6 -5
  165. app-ng-runtime/components/input/epoch/fesm2022/index.mjs +48 -45
  166. app-ng-runtime/components/input/epoch/fesm2022/index.mjs.map +1 -1
  167. app-ng-runtime/components/input/file-upload/bundles/index.umd.js +15 -15
  168. app-ng-runtime/components/input/file-upload/esm2022/file-upload.component.mjs +13 -12
  169. app-ng-runtime/components/input/file-upload/fesm2022/index.mjs +12 -11
  170. app-ng-runtime/components/input/file-upload/fesm2022/index.mjs.map +1 -1
  171. app-ng-runtime/components/input/rating/bundles/index.umd.js +12 -12
  172. app-ng-runtime/components/input/rating/esm2022/rating.component.mjs +10 -9
  173. app-ng-runtime/components/input/rating/fesm2022/index.mjs +9 -8
  174. app-ng-runtime/components/input/rating/fesm2022/index.mjs.map +1 -1
  175. app-ng-runtime/components/navigation/breadcrumb/bundles/index.umd.js +1 -1
  176. app-ng-runtime/components/navigation/breadcrumb/esm2022/breadcrumb.component.mjs +2 -2
  177. app-ng-runtime/components/navigation/breadcrumb/fesm2022/index.mjs +1 -1
  178. app-ng-runtime/components/navigation/breadcrumb/fesm2022/index.mjs.map +1 -1
  179. app-ng-runtime/components/navigation/menu/bundles/index.umd.js +23 -22
  180. app-ng-runtime/components/navigation/menu/esm2022/menu-adapator.component.mjs +3 -2
  181. app-ng-runtime/components/navigation/menu/esm2022/menu-dropdown-item/menu-dropdown-item.component.mjs +6 -5
  182. app-ng-runtime/components/navigation/menu/esm2022/menu.component.mjs +8 -7
  183. app-ng-runtime/components/navigation/menu/esm2022/nav/nav.component.mjs +10 -8
  184. app-ng-runtime/components/navigation/menu/fesm2022/index.mjs +20 -18
  185. app-ng-runtime/components/navigation/menu/fesm2022/index.mjs.map +1 -1
  186. app-ng-runtime/components/navigation/menu/menu-dropdown-item/menu-dropdown-item.component.d.ts +12 -1
  187. app-ng-runtime/components/navigation/popover/esm2022/popover.component.mjs +1 -1
  188. app-ng-runtime/components/navigation/popover/fesm2022/index.mjs.map +1 -1
  189. app-ng-runtime/components/prefab/bundles/index.umd.js +6 -6
  190. app-ng-runtime/components/prefab/esm2022/prefab-container/prefab-container.directive.mjs +3 -2
  191. app-ng-runtime/components/prefab/esm2022/prefab.directive.mjs +3 -2
  192. app-ng-runtime/components/prefab/fesm2022/index.mjs +3 -2
  193. app-ng-runtime/components/prefab/fesm2022/index.mjs.map +1 -1
  194. app-ng-runtime/core/bundles/index.umd.js +119 -130
  195. app-ng-runtime/core/esm2022/public_api.mjs +2 -2
  196. app-ng-runtime/core/esm2022/services/field-type.service.mjs +3 -2
  197. app-ng-runtime/core/esm2022/services/field-widget.service.mjs +3 -2
  198. app-ng-runtime/core/esm2022/services/pagination.service.mjs +7 -6
  199. app-ng-runtime/core/esm2022/services/state-persistence.service.mjs +17 -16
  200. app-ng-runtime/core/esm2022/services/utils.service.mjs +3 -2
  201. app-ng-runtime/core/esm2022/services/viewport.service.mjs +3 -2
  202. app-ng-runtime/core/esm2022/utils/build-utils.mjs +5 -4
  203. app-ng-runtime/core/esm2022/utils/expression-parser.mjs +5 -4
  204. app-ng-runtime/core/esm2022/utils/lru-cache.mjs +3 -2
  205. app-ng-runtime/core/esm2022/utils/utils.mjs +79 -82
  206. app-ng-runtime/core/esm2022/utils/watcher.mjs +9 -7
  207. app-ng-runtime/core/fesm2022/index.mjs +117 -123
  208. app-ng-runtime/core/fesm2022/index.mjs.map +1 -1
  209. app-ng-runtime/core/public_api.d.ts +1 -1
  210. app-ng-runtime/core/services/pagination.service.d.ts +1 -1
  211. app-ng-runtime/core/utils/utils.d.ts +5 -9
  212. app-ng-runtime/http/bundles/index.umd.js +7 -7
  213. app-ng-runtime/http/esm2022/http.service.mjs +5 -4
  214. app-ng-runtime/http/esm2022/wm-http-request.mjs +1 -1
  215. app-ng-runtime/http/esm2022/wm-http-response.mjs +1 -1
  216. app-ng-runtime/http/fesm2022/index.mjs +4 -3
  217. app-ng-runtime/http/fesm2022/index.mjs.map +1 -1
  218. app-ng-runtime/mobile/components/basic/default/bundles/index.umd.js +24 -20
  219. app-ng-runtime/mobile/components/basic/default/esm2022/anchor/anchor.directive.mjs +5 -4
  220. app-ng-runtime/mobile/components/basic/default/esm2022/file-browser/file-browser.component.mjs +12 -8
  221. app-ng-runtime/mobile/components/basic/default/esm2022/file-browser/file-selector.service.mjs +5 -3
  222. app-ng-runtime/mobile/components/basic/default/esm2022/image-cache/image-cache.directive.mjs +3 -2
  223. app-ng-runtime/mobile/components/basic/default/esm2022/process-manager/process-manager.component.mjs +5 -4
  224. app-ng-runtime/mobile/components/basic/default/fesm2022/index.mjs +21 -16
  225. app-ng-runtime/mobile/components/basic/default/fesm2022/index.mjs.map +1 -1
  226. app-ng-runtime/mobile/components/containers/segmented-control/bundles/index.umd.js +7 -7
  227. app-ng-runtime/mobile/components/containers/segmented-control/esm2022/segment-content/segment-content.component.mjs +2 -2
  228. app-ng-runtime/mobile/components/containers/segmented-control/esm2022/segmented-control.component.mjs +4 -3
  229. app-ng-runtime/mobile/components/containers/segmented-control/fesm2022/index.mjs +4 -3
  230. app-ng-runtime/mobile/components/containers/segmented-control/fesm2022/index.mjs.map +1 -1
  231. app-ng-runtime/mobile/components/data/media-list/bundles/index.umd.js +8 -8
  232. app-ng-runtime/mobile/components/data/media-list/esm2022/media-list.component.mjs +4 -3
  233. app-ng-runtime/mobile/components/data/media-list/fesm2022/index.mjs +3 -2
  234. app-ng-runtime/mobile/components/data/media-list/fesm2022/index.mjs.map +1 -1
  235. app-ng-runtime/mobile/components/page/default/bundles/index.umd.js +5 -5
  236. app-ng-runtime/mobile/components/page/default/esm2022/page.directive.mjs +3 -2
  237. app-ng-runtime/mobile/components/page/default/fesm2022/index.mjs +2 -1
  238. app-ng-runtime/mobile/components/page/default/fesm2022/index.mjs.map +1 -1
  239. app-ng-runtime/mobile/components/page/tab-bar/bundles/index.umd.js +9 -9
  240. app-ng-runtime/mobile/components/page/tab-bar/esm2022/tabbar.component.mjs +7 -6
  241. app-ng-runtime/mobile/components/page/tab-bar/fesm2022/index.mjs +6 -5
  242. app-ng-runtime/mobile/components/page/tab-bar/fesm2022/index.mjs.map +1 -1
  243. app-ng-runtime/mobile/core/bundles/index.umd.js +25 -25
  244. app-ng-runtime/mobile/core/esm2022/services/device-file-download.service.mjs +5 -4
  245. app-ng-runtime/mobile/core/esm2022/services/device-file-opener.service.mjs +3 -2
  246. app-ng-runtime/mobile/core/esm2022/services/device-file-upload.service.mjs +4 -3
  247. app-ng-runtime/mobile/core/esm2022/services/device-file.service.mjs +6 -5
  248. app-ng-runtime/mobile/core/esm2022/services/device.service.mjs +3 -2
  249. app-ng-runtime/mobile/core/esm2022/services/ext-app-message.service.mjs +5 -4
  250. app-ng-runtime/mobile/core/esm2022/services/network.service.mjs +9 -8
  251. app-ng-runtime/mobile/core/fesm2022/index.mjs +22 -21
  252. app-ng-runtime/mobile/core/fesm2022/index.mjs.map +1 -1
  253. app-ng-runtime/mobile/core/services/ext-app-message.service.d.ts +1 -1
  254. app-ng-runtime/mobile/core/services/network.service.d.ts +7 -1
  255. app-ng-runtime/mobile/offline/bundles/index.umd.js +161 -144
  256. app-ng-runtime/mobile/offline/esm2022/models/local-db-store.mjs +23 -21
  257. app-ng-runtime/mobile/offline/esm2022/services/change-log.service.mjs +7 -6
  258. app-ng-runtime/mobile/offline/esm2022/services/local-db-data-pull.service.mjs +37 -35
  259. app-ng-runtime/mobile/offline/esm2022/services/local-db-management.service.mjs +54 -45
  260. app-ng-runtime/mobile/offline/esm2022/services/local-db.service.mjs +5 -4
  261. app-ng-runtime/mobile/offline/esm2022/services/workers/error-blocker.mjs +4 -3
  262. app-ng-runtime/mobile/offline/esm2022/services/workers/file-handler.mjs +18 -13
  263. app-ng-runtime/mobile/offline/esm2022/services/workers/multi-part-param-transformer.mjs +9 -5
  264. app-ng-runtime/mobile/offline/esm2022/utils/live-variable.utils.mjs +12 -11
  265. app-ng-runtime/mobile/offline/esm2022/utils/query-executor.utils.mjs +5 -4
  266. app-ng-runtime/mobile/offline/esm2022/utils/security.utils.mjs +3 -2
  267. app-ng-runtime/mobile/offline/fesm2022/index.mjs +156 -138
  268. app-ng-runtime/mobile/offline/fesm2022/index.mjs.map +1 -1
  269. app-ng-runtime/mobile/runtime/bundles/index.umd.js +11 -8
  270. app-ng-runtime/mobile/runtime/esm2022/mobile-runtime.module.mjs +3 -2
  271. app-ng-runtime/mobile/runtime/esm2022/services/cookie.service.mjs +6 -2
  272. app-ng-runtime/mobile/runtime/esm2022/services/http-interceptor.service.mjs +4 -3
  273. app-ng-runtime/mobile/runtime/fesm2022/index.mjs +8 -4
  274. app-ng-runtime/mobile/runtime/fesm2022/index.mjs.map +1 -1
  275. app-ng-runtime/mobile/runtime-dynamic/bundles/index.umd.js +2 -2
  276. app-ng-runtime/mobile/runtime-dynamic/esm2022/services/live-sync.service.mjs +3 -3
  277. app-ng-runtime/mobile/runtime-dynamic/fesm2022/index.mjs +2 -2
  278. app-ng-runtime/mobile/runtime-dynamic/fesm2022/index.mjs.map +1 -1
  279. app-ng-runtime/mobile/variables/bundles/index.umd.js +23 -16
  280. app-ng-runtime/mobile/variables/esm2022/services/camera-service.mjs +2 -2
  281. app-ng-runtime/mobile/variables/esm2022/services/datasync-service.mjs +10 -9
  282. app-ng-runtime/mobile/variables/esm2022/services/file-service.mjs +11 -3
  283. app-ng-runtime/mobile/variables/fesm2022/index.mjs +19 -11
  284. app-ng-runtime/mobile/variables/fesm2022/index.mjs.map +1 -1
  285. app-ng-runtime/oAuth/bundles/index.umd.js +12 -12
  286. app-ng-runtime/oAuth/esm2022/oAuth.service.mjs +4 -3
  287. app-ng-runtime/oAuth/esm2022/oAuth.utils.mjs +8 -7
  288. app-ng-runtime/oAuth/fesm2022/index.mjs +9 -8
  289. app-ng-runtime/oAuth/fesm2022/index.mjs.map +1 -1
  290. app-ng-runtime/package.json +1 -1
  291. app-ng-runtime/runtime/base/bundles/index.umd.js +121 -120
  292. app-ng-runtime/runtime/base/esm2022/components/base-layout.component.mjs +4 -3
  293. app-ng-runtime/runtime/base/esm2022/components/base-page.component.mjs +14 -13
  294. app-ng-runtime/runtime/base/esm2022/components/base-partial.component.mjs +13 -12
  295. app-ng-runtime/runtime/base/esm2022/components/base-prefab.component.mjs +15 -14
  296. app-ng-runtime/runtime/base/esm2022/components/base-spa-page.component.mjs +14 -13
  297. app-ng-runtime/runtime/base/esm2022/components/custom-toaster.component.mjs +6 -5
  298. app-ng-runtime/runtime/base/esm2022/directives/accessroles.directive.mjs +11 -10
  299. app-ng-runtime/runtime/base/esm2022/guards/page-not-found.guard.mjs +1 -1
  300. app-ng-runtime/runtime/base/esm2022/guards/role.guard.mjs +3 -2
  301. app-ng-runtime/runtime/base/esm2022/services/app-defaults.service.mjs +1 -1
  302. app-ng-runtime/runtime/base/esm2022/services/app.manager.service.mjs +17 -14
  303. app-ng-runtime/runtime/base/esm2022/services/app.service.mjs +7 -6
  304. app-ng-runtime/runtime/base/esm2022/services/dynamic-component-ref-provider.service.mjs +3 -2
  305. app-ng-runtime/runtime/base/esm2022/services/http-interceptor.services.mjs +4 -3
  306. app-ng-runtime/runtime/base/esm2022/services/i18n.service.mjs +12 -10
  307. app-ng-runtime/runtime/base/esm2022/services/navigation.service.mjs +8 -7
  308. app-ng-runtime/runtime/base/esm2022/services/prefab-manager.service.mjs +3 -2
  309. app-ng-runtime/runtime/base/esm2022/services/spinner.service.mjs +7 -6
  310. app-ng-runtime/runtime/base/esm2022/services/toaster.service.mjs +6 -5
  311. app-ng-runtime/runtime/base/esm2022/util/wm-route-reuse-strategy.mjs +6 -7
  312. app-ng-runtime/runtime/base/fesm2022/index.mjs +119 -117
  313. app-ng-runtime/runtime/base/fesm2022/index.mjs.map +1 -1
  314. app-ng-runtime/runtime/base/services/i18n.service.d.ts +1 -1
  315. app-ng-runtime/runtime/dynamic/bundles/index.umd.js +7 -7
  316. app-ng-runtime/runtime/dynamic/esm2022/app/services/component-ref-provider.service.mjs +4 -3
  317. app-ng-runtime/runtime/dynamic/esm2022/main.mjs +3 -2
  318. app-ng-runtime/runtime/dynamic/fesm2022/index.mjs +4 -3
  319. app-ng-runtime/runtime/dynamic/fesm2022/index.mjs.map +1 -1
  320. app-ng-runtime/scripts/jquery-ui/ui/widgets/droppable.js +7 -7
  321. app-ng-runtime/scripts/jquery-ui/ui/widgets/resizable.js +13 -10
  322. app-ng-runtime/scripts/jquery-ui/ui/widgets/sortable.js +7 -7
  323. app-ng-runtime/security/bundles/index.umd.js +14 -14
  324. app-ng-runtime/security/esm2022/security.service.mjs +12 -11
  325. app-ng-runtime/security/fesm2022/index.mjs +11 -10
  326. app-ng-runtime/security/fesm2022/index.mjs.map +1 -1
  327. app-ng-runtime/security/security.service.d.ts +1 -1
  328. app-ng-runtime/swipey/esm2022/swipe.animation.mjs +1 -1
  329. app-ng-runtime/swipey/fesm2022/index.mjs.map +1 -1
  330. app-ng-runtime/transpiler/bundles/index.umd.js +10 -9
  331. app-ng-runtime/transpiler/esm2022/build.mjs +8 -6
  332. app-ng-runtime/transpiler/fesm2022/index.mjs +7 -5
  333. app-ng-runtime/transpiler/fesm2022/index.mjs.map +1 -1
  334. app-ng-runtime/variables/bundles/index.umd.js +155 -145
  335. app-ng-runtime/variables/esm2022/manager/action/login-action.manager.mjs +15 -14
  336. app-ng-runtime/variables/esm2022/manager/action/notification-action.manager.mjs +9 -8
  337. app-ng-runtime/variables/esm2022/manager/variable/base-variable.manager.mjs +3 -2
  338. app-ng-runtime/variables/esm2022/manager/variable/web-socket-variable.manager.mjs +11 -10
  339. app-ng-runtime/variables/esm2022/service/variables.service.mjs +7 -6
  340. app-ng-runtime/variables/esm2022/util/action/navigation-action.utils.mjs +4 -4
  341. app-ng-runtime/variables/esm2022/util/variable/pagination.utils.mjs +30 -23
  342. app-ng-runtime/variables/esm2022/util/variable/service-variable.utils.mjs +29 -28
  343. app-ng-runtime/variables/esm2022/util/variable/variables.utils.mjs +75 -70
  344. app-ng-runtime/variables/fesm2022/index.mjs +169 -158
  345. app-ng-runtime/variables/fesm2022/index.mjs.map +1 -1
  346. app-ng-runtime/variables/util/variable/service-variable.utils.d.ts +1 -1
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@wm/components/base'), require('@wm/components/data/pagination'), require('@wm/core'), require('@wm/components/input'), require('rxjs'), require('@swipey')) :
3
- typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/common', '@wm/components/base', '@wm/components/data/pagination', '@wm/core', '@wm/components/input', 'rxjs', '@swipey'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.wm = global.wm || {}, global.wm.components = global.wm.components || {}, global.wm.components.data = global.wm.components.data || {}, global.wm.components.data.list = {}), global.ng.core, global.ng.common, global.wm.components.base, global.wm.components.data.pagination, global.wm.core, global.wm.components.input, global.rxjs, global.swipey));
5
- })(this, (function (exports, i0, i1$1, i1, i2$1, i2, input, rxjs, _swipey) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@wm/components/base'), require('@wm/components/data/pagination'), require('@wm/core'), require('@wm/components/input'), require('rxjs'), require('@swipey'), require('lodash-es')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/common', '@wm/components/base', '@wm/components/data/pagination', '@wm/core', '@wm/components/input', 'rxjs', '@swipey', 'lodash-es'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.wm = global.wm || {}, global.wm.components = global.wm.components || {}, global.wm.components.data = global.wm.components.data || {}, global.wm.components.data.list = {}), global.ng.core, global.ng.common, global.wm.components.base, global.wm.components.data.pagination, global.wm.core, global.wm.components.input, global.rxjs, global.swipey, global._));
5
+ })(this, (function (exports, i0, i1$1, i1, i2$1, i2, input, rxjs, _swipey, lodashEs) { 'use strict';
6
6
 
7
7
  function _interopNamespaceDefault(e) {
8
8
  var n = Object.create(null);
@@ -233,7 +233,7 @@
233
233
  }
234
234
  // Returns the total width occupied by all the children inside the element
235
235
  computeTotalChildrenWidth($ele) {
236
- return _.reduce($ele.children(), (totalWidth, el) => {
236
+ return lodashEs.reduce($ele.children(), (totalWidth, el) => {
237
237
  return totalWidth + $(el).outerWidth();
238
238
  }, 0);
239
239
  }
@@ -242,7 +242,8 @@
242
242
  const totalWidth = this.computeTotalChildrenWidth($ele);
243
243
  const reverse = this.position === 'right';
244
244
  let d = 0;
245
- return _.map($ele.children(), e => {
245
+ // @ts-ignore
246
+ return lodashEs.map($ele.children(), e => {
246
247
  const f = (totalWidth - d) / totalWidth;
247
248
  d += $(e).outerWidth();
248
249
  return reverse ? f : (d / totalWidth);
@@ -655,70 +656,6 @@
655
656
  const WIDGET_CONFIG = { widgetType: 'wm-list', hostClass: DEFAULT_CLS };
656
657
  class ListComponent extends i1.StylableComponent {
657
658
  static { this.initializeProps = registerProps(); }
658
- get selecteditem() {
659
- if (this.multiselect) {
660
- return i2.getClonedObject(this._items);
661
- }
662
- if (_.isEmpty(this._items)) {
663
- return {};
664
- }
665
- return i2.getClonedObject(this._items[0]);
666
- }
667
- /**
668
- * Returns list of widgets present on list item by considering name and index of the widget.
669
- * If we did'nt pass index, it returns array of all the widgets which are matching to widget name
670
- * @param widgteName: Name of the widget
671
- * @param index: Index of the widget
672
- */
673
- getWidgets(widgteName, index) {
674
- let $target;
675
- const retVal = [];
676
- if (!widgteName) {
677
- return;
678
- }
679
- if (!i2.isDefined(index)) {
680
- _.forEach(this.listItems.toArray(), (el) => {
681
- $target = _.get(el.currentItemWidgets, widgteName);
682
- if ($target) {
683
- retVal.push($target);
684
- }
685
- });
686
- return retVal;
687
- }
688
- index = +index || 0;
689
- $target = _.get(this.listItems.toArray(), index);
690
- if ($target) {
691
- return [_.get($target.currentItemWidgets, widgteName)];
692
- }
693
- }
694
- // returns listitem reference by index value. This refers to the same method getListItemByIndex.
695
- getItem(index) {
696
- return this.getListItemByIndex(index);
697
- }
698
- /**
699
- * Returns index of listItem(listItemDirective / listItemObject)
700
- * If item is a directive, index is fetched from listItems
701
- * If item is an object, index is fetched from fieldDefs
702
- */
703
- getIndex(item) {
704
- if (item instanceof ListItemDirective) {
705
- return this.getListItemIndex(item);
706
- }
707
- else if (item) {
708
- return this.fieldDefs.findIndex((obj) => _.isEqual(obj, item));
709
- }
710
- }
711
- set selecteditem(items) {
712
- this._items.length = 0;
713
- this.deselectListItems();
714
- if (_.isArray(items)) {
715
- items.forEach(item => this.selectItem(item));
716
- }
717
- else {
718
- this.selectItem(items);
719
- }
720
- i2.$appDigest();
721
- }
722
659
  constructor(inj, cdRef, datePipe, app, appDefaults, ngZone, binditemclass, binddisableitem, binddataset, binddatasource, mouseEnterCB, mouseLeaveCB, statePersistence, paginationService, explicitContext) {
723
660
  let resolveFn = i2.noop;
724
661
  const propsInitPromise = new Promise(res => resolveFn = res);
@@ -746,12 +683,12 @@
746
683
  // Updates pagination, filter, sort etc options for service and crud variables
747
684
  this._listenerDestroyers = [
748
685
  this.app.subscribe('check-state-persistence-options', options => {
749
- let dataSourceName = _.get(this.datasource, 'name');
686
+ let dataSourceName = lodashEs.get(this.datasource, 'name');
750
687
  // in Prefabs, this.datasource is not resolved at the time of variable invocation, so additional check is required.
751
688
  if (!dataSourceName) {
752
689
  dataSourceName = i1.extractDataSourceName(this.binddatasource);
753
690
  }
754
- if (_.get(options, 'variable.name') !== dataSourceName) {
691
+ if (lodashEs.get(options, 'variable.name') !== dataSourceName) {
755
692
  return;
756
693
  }
757
694
  this.handleStateParams(options);
@@ -766,31 +703,69 @@
766
703
  })
767
704
  ];
768
705
  }
769
- getConfiguredState() {
770
- const mode = this.statePersistence.computeMode(this.statehandler);
771
- return mode && mode.toLowerCase();
706
+ get selecteditem() {
707
+ if (this.multiselect) {
708
+ return i2.getClonedObject(this._items);
709
+ }
710
+ if (lodashEs.isEmpty(this._items)) {
711
+ return {};
712
+ }
713
+ return i2.getClonedObject(this._items[0]);
772
714
  }
773
- handleStateParams(options) {
774
- if (this._pageLoad && this.getConfiguredState() !== 'none') {
775
- this._pageLoad = false;
776
- const widgetState = this.statePersistence.getWidgetState(this);
777
- if (_.get(widgetState, 'pagination')) {
778
- options.options = options.options || {};
779
- options.options.page = widgetState.pagination;
780
- }
781
- if (_.get(widgetState, 'selectedItem')) {
782
- this._selectedItemsExist = true;
783
- }
715
+ set selecteditem(items) {
716
+ this._items.length = 0;
717
+ this.deselectListItems();
718
+ if (lodashEs.isArray(items)) {
719
+ items.forEach(item => this.selectItem(item));
720
+ }
721
+ else {
722
+ this.selectItem(items);
784
723
  }
724
+ i2.$appDigest();
785
725
  }
786
- triggerWMEvent(eventName, item) {
787
- i2.$invokeWatchers(true);
788
- // If we have multiselect for the livelist(List with form template), in run mode deleting a record is getting failed. Becuase the selecteditem will be array of objects. So consider the last object.
789
- let row = this.multiselect ? _.last(this.selecteditem) : this.selecteditem;
790
- if (item) {
791
- row = item;
726
+ /**
727
+ * Returns list of widgets present on list item by considering name and index of the widget.
728
+ * If we did'nt pass index, it returns array of all the widgets which are matching to widget name
729
+ * @param widgteName: Name of the widget
730
+ * @param index: Index of the widget
731
+ */
732
+ getWidgets(widgteName, index) {
733
+ let $target;
734
+ const retVal = [];
735
+ if (!widgteName) {
736
+ return;
737
+ }
738
+ if (!i2.isDefined(index)) {
739
+ lodashEs.forEach(this.listItems.toArray(), (el) => {
740
+ $target = lodashEs.get(el.currentItemWidgets, widgteName);
741
+ if ($target) {
742
+ retVal.push($target);
743
+ }
744
+ });
745
+ return retVal;
746
+ }
747
+ index = +index || 0;
748
+ $target = lodashEs.get(this.listItems.toArray(), index);
749
+ if ($target) {
750
+ return [lodashEs.get($target.currentItemWidgets, widgteName)];
751
+ }
752
+ }
753
+ // returns listitem reference by index value. This refers to the same method getListItemByIndex.
754
+ getItem(index) {
755
+ return this.getListItemByIndex(index);
756
+ }
757
+ /**
758
+ * Returns index of listItem(listItemDirective / listItemObject)
759
+ * If item is a directive, index is fetched from listItems
760
+ * If item is an object, index is fetched from fieldDefs
761
+ */
762
+ getIndex(item) {
763
+ if (item instanceof ListItemDirective) {
764
+ return this.getListItemIndex(item);
765
+ }
766
+ else if (item) {
767
+ return this.fieldDefs.findIndex((obj) => lodashEs.isEqual(obj, item));
792
768
  }
793
- this.app.notify('wm-event', { eventName, widgetName: this.name, row: row });
794
769
  }
795
770
  create() {
796
771
  if (this._isDependent) {
@@ -829,140 +804,532 @@
829
804
  this.variableInflight = data.active;
830
805
  // Fix for [WMS-23772] Update nodatafound flag once the response is recieved from the server
831
806
  const totalEle = data.data?.pagination?.totalElements;
832
- if (!_.isUndefined(totalEle)) {
807
+ if (!lodashEs.isUndefined(totalEle)) {
833
808
  this.noDataFound = totalEle === 0 ? true : false;
834
809
  }
835
810
  else { // totalelements is undefined
836
- this.noDataFound = _.isEmpty(data.data?.data);
811
+ this.noDataFound = lodashEs.isEmpty(data.data?.data);
837
812
  }
838
813
  });
839
814
  }
840
815
  }
841
- resetNavigation() {
842
- this.showNavigation = false;
843
- this.navControls = undefined;
844
- this.infScroll = false;
845
- this.onDemandLoad = false;
846
- }
847
- enableBasicNavigation() {
848
- this.navControls = i1.NAVIGATION_TYPE.BASIC;
849
- this.showNavigation = true;
850
- }
851
- enableInlineNavigation() {
852
- this.navControls = i1.NAVIGATION_TYPE.INLINE;
853
- }
854
- enableClassicNavigation() {
855
- this.navControls = i1.NAVIGATION_TYPE.CLASSIC;
856
- this.showNavigation = true;
857
- }
858
- enablePagerNavigation() {
859
- this.navControls = i1.NAVIGATION_TYPE.PAGER;
860
- this.showNavigation = true;
861
- }
862
- setNavigationTypeNone() {
863
- this.navControls = i1.NAVIGATION_TYPE.NONE;
864
- this.showNavigation = false;
865
- }
866
- enableInfiniteScroll() {
867
- this.infScroll = true;
868
- }
869
- enableOnDemandLoad() {
870
- this.onDemandLoad = true;
871
- this.showNavigation = true;
872
- }
873
- /**
874
- * Sets Navigation type for the list.
875
- * @param type
876
- */
877
- onNavigationTypeChange(type) {
878
- this.resetNavigation();
879
- switch (type) {
880
- case i1.NAVIGATION_TYPE.BASIC:
881
- this.enableBasicNavigation();
882
- break;
883
- case i1.NAVIGATION_TYPE.INLINE:
884
- this.enableInlineNavigation();
885
- break;
886
- case i1.NAVIGATION_TYPE.ADVANCED:
887
- case i1.NAVIGATION_TYPE.CLASSIC:
888
- this.enableClassicNavigation();
889
- break;
890
- case i1.NAVIGATION_TYPE.PAGER:
891
- this.enablePagerNavigation();
892
- break;
893
- case i1.NAVIGATION_TYPE.NONE:
894
- this.setNavigationTypeNone();
895
- break;
896
- case i1.NAVIGATION_TYPE.SCROLL:
897
- this.enableInfiniteScroll();
898
- break;
899
- case i1.NAVIGATION_TYPE.ONDEMAND:
900
- this.enableOnDemandLoad();
901
- break;
816
+ triggerListItemSelection($el, $event) {
817
+ if ($el && $el[0]) {
818
+ const listItemContext = $el.data('listItemContext');
819
+ // Trigger click event only if the list item is from the corresponding list.
820
+ if (listItemContext.listComponent === this) {
821
+ this.onItemClick($event, listItemContext);
822
+ }
902
823
  }
903
824
  }
904
- /**
905
- * Update fieldDefs property, fieldDefs is the model of the List Component.
906
- * fieldDefs is an Array type.
907
- * @param newVal
908
- */
909
- updateFieldDefs(newVal) {
910
- if (this.infScroll || this.onDemandLoad) {
911
- [this.fieldDefs, this.currentPage] = this.paginationService.updateFieldsOnPagination(this, newVal);
912
- }
913
- else {
914
- this.fieldDefs = newVal;
915
- }
916
- if (this.orderby) {
917
- this.fieldDefs = i1.getOrderedDataset(this.fieldDefs, this.orderby);
918
- }
919
- if (this.groupby) {
920
- this.groupedData = i1.groupData(this, this.fieldDefs, this.groupby, this.match, this.orderby, this.dateformat, this.datePipe, undefined, this.appDefaults);
921
- }
922
- if (!this.fieldDefs.length) {
923
- this.noDataFound = true;
924
- this.selecteditem = undefined;
825
+ // this method is called form other data widgets like table.
826
+ execute(operation, options) {
827
+ if ([i2.DataSource.Operation.IS_API_AWARE, i2.DataSource.Operation.IS_PAGEABLE, i2.DataSource.Operation.SUPPORTS_SERVER_FILTER].includes(operation)) {
828
+ return false;
925
829
  }
926
- i2.$appDigest();
927
- this.listItems.setDirty();
830
+ return this.datasource.execute(operation, options);
928
831
  }
929
- onDataChange(newVal) {
930
- // Check for newVal is not empty
931
- if (!_.isEmpty(newVal)) {
932
- this.noDataFound = false;
933
- this.isDataChanged = true;
934
- if (this.datasource && this.datasource.execute(i2.DataSource.Operation.IS_API_AWARE)) {
935
- // clone the the data in case of live and service variables to prevent the two-way binding for these variables.
936
- newVal = _.cloneDeep(newVal);
937
- }
938
- if (i2.isObject(newVal) && !_.isArray(newVal)) {
939
- newVal = _.isEmpty(newVal) ? [] : [newVal];
940
- }
941
- if (_.isString(newVal)) {
942
- newVal = newVal.split(',');
943
- }
944
- // if the page number is greater than 1 on initial load then we render the first page.
945
- if (this.datasource && this.datasource.owner === 'App' && (this.infScroll || this.onDemandLoad) && !this.currentPage && this.datasource.execute(i2.DataSource.Operation.GET_PAGING_OPTIONS).number > 0) {
946
- newVal = this.datasource.execute(i2.DataSource.Operation.LIST_RECORDS, {
947
- 'page': 1
948
- });
949
- }
950
- if (_.isArray(newVal)) {
951
- if (newVal.length) {
952
- this.invokeEventCallback('beforedatarender', { $data: newVal });
953
- }
954
- this.updateFieldDefs(newVal);
955
- }
956
- }
957
- else {
958
- this.updateFieldDefs([]);
832
+ handleKeyDown($event, action) {
833
+ $event.stopPropagation();
834
+ if ($event.keyCode !== 13 && $event.keyCode !== 9 && !(($event.target.classList.contains('form-control') || $event.target.classList.contains('note-editable')) && $event.keyCode === 32)) {
835
+ $event.preventDefault();
959
836
  }
960
- }
961
- // Updates the dataSource when pagination is enabled for the Component.
962
- setupDataSource() {
963
- const dataNavigator = this.dataNavigator;
964
- dataNavigator.options = {
965
- maxResults: this.pagesize || 20
837
+ const listItems = this.listItems;
838
+ let presentIndex = this.getListItemIndex(this.lastSelectedItem);
839
+ if (this.multiselect) {
840
+ const firstIndex = this.getListItemIndex(this.firstSelectedItem);
841
+ const selectCount = lodashEs.isArray(this.selecteditem) ? this.selecteditem.length : (i2.isObject(this.selecteditem) ? 1 : 0);
842
+ if (action === 'selectPrev') {
843
+ if (presentIndex > 0) {
844
+ if ((presentIndex <= firstIndex) && this.checkSelectionLimit(selectCount)) {
845
+ this.lastSelectedItem = this.getListItemByIndex(presentIndex - 1);
846
+ this.toggleListItemSelection(this.lastSelectedItem);
847
+ }
848
+ else if (presentIndex > firstIndex) {
849
+ this.toggleListItemSelection(this.getListItemByIndex(presentIndex));
850
+ this.lastSelectedItem = this.getListItemByIndex(presentIndex - 1);
851
+ }
852
+ else {
853
+ this.invokeEventCallback('selectionlimitexceed', { $event });
854
+ }
855
+ }
856
+ }
857
+ else if (action === 'selectNext') {
858
+ if (presentIndex < listItems.length - 1) {
859
+ if ((presentIndex >= firstIndex) && this.checkSelectionLimit(selectCount)) {
860
+ this.lastSelectedItem = this.getListItemByIndex(presentIndex + 1);
861
+ this.toggleListItemSelection(this.lastSelectedItem);
862
+ }
863
+ else if (presentIndex < firstIndex) {
864
+ this.toggleListItemSelection(this.getListItemByIndex(presentIndex));
865
+ this.lastSelectedItem = this.getListItemByIndex(presentIndex + 1);
866
+ }
867
+ else {
868
+ this.invokeEventCallback('selectionlimitexceed', { $event });
869
+ }
870
+ }
871
+ }
872
+ }
873
+ if (action === 'focusPrev') {
874
+ if (this.isListElementMovable) {
875
+ presentIndex = presentIndex <= 0 ? 0 : (presentIndex);
876
+ if (presentIndex === 0) {
877
+ return;
878
+ }
879
+ this.lastSelectedItem = this.getListItemByIndex(presentIndex);
880
+ const prevElt = this.getListItemByIndex(presentIndex - 1);
881
+ prevElt.nativeElement.before(this.lastSelectedItem.nativeElement);
882
+ this.lastSelectedItem.nativeElement.focus();
883
+ this.statePersistence.removeWidgetState(this, 'selectedItem');
884
+ const arr = this.listItems.toArray();
885
+ [arr[presentIndex - 1], arr[presentIndex]] = [arr[presentIndex], arr[presentIndex - 1]];
886
+ this.listItems.reset(arr);
887
+ this.currentIndex = presentIndex;
888
+ this.ariaText = "selected ";
889
+ }
890
+ else {
891
+ presentIndex = presentIndex <= 0 ? 0 : (presentIndex - 1);
892
+ this.lastSelectedItem = this.getListItemByIndex(presentIndex);
893
+ this.lastSelectedItem.nativeElement.focus();
894
+ this.currentIndex = presentIndex + 1;
895
+ this.ariaText = "selected ";
896
+ }
897
+ }
898
+ else if (action === 'focusNext') {
899
+ if (this.isListElementMovable) {
900
+ presentIndex = presentIndex < (listItems.length - 1) ? (presentIndex) : (listItems.length - 1);
901
+ if (presentIndex === this.listItems.length - 1) {
902
+ return;
903
+ }
904
+ this.lastSelectedItem = this.getListItemByIndex(presentIndex);
905
+ const nextElt = this.getListItemByIndex(presentIndex + 1);
906
+ nextElt.nativeElement.after(this.lastSelectedItem.nativeElement);
907
+ this.lastSelectedItem.nativeElement.focus();
908
+ this.statePersistence.removeWidgetState(this, 'selectedItem');
909
+ const arr = this.listItems.toArray();
910
+ [arr[presentIndex], arr[presentIndex + 1]] = [arr[presentIndex + 1], arr[presentIndex]];
911
+ this.listItems.reset(arr);
912
+ this.currentIndex = presentIndex + 2;
913
+ this.ariaText = "selected ";
914
+ }
915
+ else {
916
+ presentIndex = presentIndex < (listItems.length - 1) ? (presentIndex + 1) : (listItems.length - 1);
917
+ this.lastSelectedItem = this.getListItemByIndex(presentIndex);
918
+ this.lastSelectedItem.nativeElement.focus();
919
+ this.currentIndex = presentIndex + 1;
920
+ this.ariaText = "selected ";
921
+ }
922
+ }
923
+ else if (action === 'select') {
924
+ // if the enter click is pressed on the item which is not the last selected item, the find the item from which the event is originated.
925
+ if (presentIndex === -1 || !$($event.target).closest(this.lastSelectedItem.nativeElement)) {
926
+ const $li = $($event.target).closest('li.app-list-item');
927
+ const $ul = $li.closest('ul.app-livelist-container');
928
+ presentIndex = $ul.find('li.app-list-item').index($li);
929
+ }
930
+ this.onItemClick($event, this.getListItemByIndex(presentIndex));
931
+ }
932
+ else if (action === 'space') {
933
+ if (!this.enablereorder) {
934
+ return;
935
+ }
936
+ this.isListElementMovable = !this.isListElementMovable;
937
+ this.onItemClick($event, this.getListItemByIndex(presentIndex));
938
+ this.currentIndex = presentIndex + 1;
939
+ if (this.isListElementMovable) {
940
+ this.ariaText = `Item ${this.currentIndex} grabbed, current position `;
941
+ this.$ulEle.data('oldIndex', presentIndex);
942
+ }
943
+ else {
944
+ this.ariaText = `Item ${this.currentIndex} dropped, final position `;
945
+ this.onUpdate($event, undefined, presentIndex);
946
+ }
947
+ }
948
+ }
949
+ onPropertyChange(key, nv, ov) {
950
+ if (key === 'dataset') {
951
+ if (!nv && this.binddatasource && !this.datasource) {
952
+ return;
953
+ }
954
+ this.onDataSetChange(nv);
955
+ }
956
+ else if (key === 'datasource') {
957
+ if (this.dataset) {
958
+ this.onDataSetChange(this.dataset);
959
+ }
960
+ }
961
+ else if (key === 'navigation') {
962
+ // Support for older projects where navigation type was advanced instead of classic
963
+ if (nv === 'Advanced') {
964
+ this.navigation = 'Classic';
965
+ return;
966
+ }
967
+ i2.switchClass(this.nativeElement, nv, ov);
968
+ this.onNavigationTypeChange(nv);
969
+ if (this.dataNavigator) {
970
+ this.dataNavigator.navigationClass = this.paginationclass;
971
+ }
972
+ }
973
+ else if (key === 'itemsperrow') {
974
+ i2.setListClass(this);
975
+ }
976
+ else if (key === 'tabindex') {
977
+ return;
978
+ }
979
+ else if (key === 'pulltorefresh' && nv) {
980
+ this.app.notify('pullToRefresh:enable');
981
+ this.subscribeToPullToRefresh();
982
+ }
983
+ else if (key === 'paginationclass') {
984
+ if (this.dataNavigator) {
985
+ // Adding setTimeout because in pagination component updateNavSize method is overriding navigationclass
986
+ setTimeout(() => this.dataNavigator.navigationClass = nv);
987
+ }
988
+ }
989
+ else if (key === 'pagesize') {
990
+ this.dataNavigator.options = {
991
+ maxResults: nv
992
+ };
993
+ this.dataNavigator.widget.maxResults = nv;
994
+ this.dataNavigator.maxResults = nv;
995
+ }
996
+ else if (key === 'enablereorder') {
997
+ if (nv && this.$ulEle) {
998
+ this.$ulEle.attr('aria-describedby', this.titleId);
999
+ this.configureDnD();
1000
+ this.$ulEle.sortable('enable');
1001
+ }
1002
+ else if (this.$ulEle && !nv) {
1003
+ this.$ulEle.removeAttr('aria-describedby');
1004
+ this.$ulEle.sortable('disable');
1005
+ }
1006
+ }
1007
+ else {
1008
+ super.onPropertyChange(key, nv, ov);
1009
+ }
1010
+ }
1011
+ onItemClick(evt, $listItem) {
1012
+ let selectCount;
1013
+ if (!$listItem.disableItem) {
1014
+ this.firstSelectedItem = this.firstSelectedItem || $listItem;
1015
+ // Setting selectCount value based number of items selected.
1016
+ selectCount = lodashEs.isArray(this.selecteditem) ? this.selecteditem.length : (i2.isObject(this.selecteditem) ? 1 : 0);
1017
+ // Handling multiselect for mobile device
1018
+ if (this.multiselect && i2.isMobile()) {
1019
+ if (this.checkSelectionLimit(selectCount) || $listItem.isActive) {
1020
+ this.toggleListItemSelection($listItem);
1021
+ }
1022
+ else {
1023
+ this.invokeEventCallback('selectionlimitexceed', { $event: evt });
1024
+ }
1025
+ }
1026
+ else if ((evt.ctrlKey || evt.metaKey) && this.multiselect) {
1027
+ if (this.checkSelectionLimit(selectCount) || $listItem.isActive) {
1028
+ this.firstSelectedItem = this.lastSelectedItem = $listItem;
1029
+ this.toggleListItemSelection($listItem);
1030
+ }
1031
+ else {
1032
+ this.invokeEventCallback('selectionlimitexceed', { $event: evt });
1033
+ }
1034
+ }
1035
+ else if (evt.shiftKey && this.multiselect) {
1036
+ let first = $listItem.context.index;
1037
+ let last = this.firstSelectedItem.context.index;
1038
+ // if first is greater than last, then swap values
1039
+ if (first > last) {
1040
+ last = [first, first = last][0];
1041
+ }
1042
+ if (this.checkSelectionLimit(last - first)) {
1043
+ this.clearSelectedItems();
1044
+ this.listItems.forEach(($liItem) => {
1045
+ const index = $liItem.context.index;
1046
+ if (index >= first && index <= last) {
1047
+ this.toggleListItemSelection($liItem);
1048
+ }
1049
+ });
1050
+ this.lastSelectedItem = $listItem;
1051
+ }
1052
+ else {
1053
+ this.invokeEventCallback('selectionlimitexceed', { $event: evt });
1054
+ }
1055
+ }
1056
+ else {
1057
+ if (!$listItem.isActive || selectCount > 1) {
1058
+ this.clearSelectedItems();
1059
+ this.toggleListItemSelection($listItem);
1060
+ this.firstSelectedItem = this.lastSelectedItem = $listItem;
1061
+ }
1062
+ }
1063
+ i2.$appDigest();
1064
+ }
1065
+ }
1066
+ // Empty the list content on clear
1067
+ clear() {
1068
+ this.updateFieldDefs([]);
1069
+ }
1070
+ /**
1071
+ * deselects item in the list.
1072
+ * @param val: index | model of the list item.
1073
+ */
1074
+ deselectItem(val) {
1075
+ const listItem = this.getItemRefByIndexOrModel(val);
1076
+ if (listItem && listItem.isActive) {
1077
+ this.toggleListItemSelection(listItem);
1078
+ }
1079
+ }
1080
+ /**
1081
+ * selects item in the list.
1082
+ * @param val: index | model of the list item.
1083
+ */
1084
+ selectItem(val, statePersistenceTriggered) {
1085
+ const listItem = this.getItemRefByIndexOrModel(val);
1086
+ if (!listItem) {
1087
+ return;
1088
+ }
1089
+ if (!listItem.isActive) {
1090
+ this.toggleListItemSelection(listItem, statePersistenceTriggered);
1091
+ }
1092
+ // focus the element.
1093
+ listItem.nativeElement.focus();
1094
+ }
1095
+ ngOnInit() {
1096
+ super.ngOnInit();
1097
+ this.handleHeaderClick = i2.noop;
1098
+ setTimeout(() => {
1099
+ this.debouncedFetchNextDatasetOnScroll = this.paginationService.debouncedFetchNextDatasetOnScroll(this.dataNavigator, i1.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME, this);
1100
+ }, 0);
1101
+ this._items = [];
1102
+ this.fieldDefs = [];
1103
+ this.reorderProps = {
1104
+ minIndex: null,
1105
+ maxIndex: null
1106
+ };
1107
+ }
1108
+ ngAfterViewInit() {
1109
+ this.promiseResolverFn();
1110
+ this.propsInitPromise.then(() => {
1111
+ super.ngAfterViewInit();
1112
+ this.setUpCUDHandlers();
1113
+ this.selectedItemWidgets = this.multiselect ? [] : {};
1114
+ var ele = $(this.nativeElement).find('.app-livelist-container');
1115
+ if (this.enablereorder && !this.groupby) {
1116
+ if (ele) {
1117
+ ele.attr('aria-describedby', this.titleId);
1118
+ }
1119
+ this.configureDnD();
1120
+ }
1121
+ if (!this.enablereorder) {
1122
+ if (ele) {
1123
+ ele.removeAttr('aria-describedby');
1124
+ }
1125
+ }
1126
+ if (this.groupby && this.collapsible) {
1127
+ this.handleHeaderClick = i1.handleHeaderClick;
1128
+ this.toggleAllHeaders = i1.toggleAllHeaders.bind(undefined, this);
1129
+ }
1130
+ i2.setListClass(this);
1131
+ });
1132
+ this.setupHandlers();
1133
+ const $ul = this.nativeElement.querySelector('ul.app-livelist-container');
1134
+ i1.styler($ul, this, i1.APPLY_STYLES_TYPE.SCROLLABLE_CONTAINER);
1135
+ if (this.enablereorder) {
1136
+ if ($ul) {
1137
+ $ul.setAttribute('aria-describedby', this.titleId);
1138
+ }
1139
+ }
1140
+ if (!this.enablereorder) {
1141
+ if ($ul) {
1142
+ $ul.removeAttribute('aria-describedby');
1143
+ }
1144
+ }
1145
+ if (i2.isMobileApp() && $ul.querySelector('.app-list-item-action-panel')) {
1146
+ this._listAnimator = new ListAnimator(this);
1147
+ }
1148
+ }
1149
+ ngOnDestroy() {
1150
+ if (this._listAnimator && this._listAnimator.$btnSubscription) {
1151
+ this._listAnimator.$btnSubscription.unsubscribe();
1152
+ }
1153
+ this._listenerDestroyers.forEach(d => d && d());
1154
+ super.ngOnDestroy();
1155
+ }
1156
+ ngOnDetach() {
1157
+ super.ngOnDetach();
1158
+ this._pageLoad = true;
1159
+ }
1160
+ handleEvent(node, eventName, eventCallback, locals) {
1161
+ // tap and doubleTap events are not getting propagated.So, using mouse events instead.
1162
+ const touchToMouse = {
1163
+ tap: 'click',
1164
+ doubletap: 'dblclick'
1165
+ };
1166
+ if (lodashEs.includes(['click', 'tap', 'dblclick', 'doubletap'], eventName)) {
1167
+ this.eventManager.addEventListener(this.nativeElement, touchToMouse[eventName] || eventName, (evt) => {
1168
+ const target = $(evt.target).closest('.app-list-item');
1169
+ if (target.length) {
1170
+ const listItemContext = target.data('listItemContext');
1171
+ if (!listItemContext.disableItem) {
1172
+ this.invokeEventCallback(eventName, {
1173
+ widget: listItemContext,
1174
+ $event: evt,
1175
+ item: listItemContext.item
1176
+ });
1177
+ }
1178
+ }
1179
+ });
1180
+ }
1181
+ }
1182
+ getConfiguredState() {
1183
+ const mode = this.statePersistence.computeMode(this.statehandler);
1184
+ return mode && mode.toLowerCase();
1185
+ }
1186
+ handleStateParams(options) {
1187
+ if (this._pageLoad && this.getConfiguredState() !== 'none') {
1188
+ this._pageLoad = false;
1189
+ const widgetState = this.statePersistence.getWidgetState(this);
1190
+ if (lodashEs.get(widgetState, 'pagination')) {
1191
+ options.options = options.options || {};
1192
+ options.options.page = widgetState.pagination;
1193
+ }
1194
+ if (lodashEs.get(widgetState, 'selectedItem')) {
1195
+ this._selectedItemsExist = true;
1196
+ }
1197
+ }
1198
+ }
1199
+ triggerWMEvent(eventName, item) {
1200
+ i2.$invokeWatchers(true);
1201
+ // If we have multiselect for the livelist(List with form template), in run mode deleting a record is getting failed. Becuase the selecteditem will be array of objects. So consider the last object.
1202
+ let row = this.multiselect ? lodashEs.last(this.selecteditem) : this.selecteditem;
1203
+ if (item) {
1204
+ row = item;
1205
+ }
1206
+ this.app.notify('wm-event', { eventName, widgetName: this.name, row: row });
1207
+ }
1208
+ resetNavigation() {
1209
+ this.showNavigation = false;
1210
+ this.navControls = undefined;
1211
+ this.infScroll = false;
1212
+ this.onDemandLoad = false;
1213
+ }
1214
+ enableBasicNavigation() {
1215
+ this.navControls = i1.NAVIGATION_TYPE.BASIC;
1216
+ this.showNavigation = true;
1217
+ }
1218
+ enableInlineNavigation() {
1219
+ this.navControls = i1.NAVIGATION_TYPE.INLINE;
1220
+ }
1221
+ enableClassicNavigation() {
1222
+ this.navControls = i1.NAVIGATION_TYPE.CLASSIC;
1223
+ this.showNavigation = true;
1224
+ }
1225
+ enablePagerNavigation() {
1226
+ this.navControls = i1.NAVIGATION_TYPE.PAGER;
1227
+ this.showNavigation = true;
1228
+ }
1229
+ setNavigationTypeNone() {
1230
+ this.navControls = i1.NAVIGATION_TYPE.NONE;
1231
+ this.showNavigation = false;
1232
+ }
1233
+ enableInfiniteScroll() {
1234
+ this.infScroll = true;
1235
+ }
1236
+ enableOnDemandLoad() {
1237
+ this.onDemandLoad = true;
1238
+ this.showNavigation = true;
1239
+ }
1240
+ /**
1241
+ * Sets Navigation type for the list.
1242
+ * @param type
1243
+ */
1244
+ onNavigationTypeChange(type) {
1245
+ this.resetNavigation();
1246
+ switch (type) {
1247
+ case i1.NAVIGATION_TYPE.BASIC:
1248
+ this.enableBasicNavigation();
1249
+ break;
1250
+ case i1.NAVIGATION_TYPE.INLINE:
1251
+ this.enableInlineNavigation();
1252
+ break;
1253
+ case i1.NAVIGATION_TYPE.ADVANCED:
1254
+ case i1.NAVIGATION_TYPE.CLASSIC:
1255
+ this.enableClassicNavigation();
1256
+ break;
1257
+ case i1.NAVIGATION_TYPE.PAGER:
1258
+ this.enablePagerNavigation();
1259
+ break;
1260
+ case i1.NAVIGATION_TYPE.NONE:
1261
+ this.setNavigationTypeNone();
1262
+ break;
1263
+ case i1.NAVIGATION_TYPE.SCROLL:
1264
+ this.enableInfiniteScroll();
1265
+ break;
1266
+ case i1.NAVIGATION_TYPE.ONDEMAND:
1267
+ this.enableOnDemandLoad();
1268
+ break;
1269
+ }
1270
+ }
1271
+ /**
1272
+ * Update fieldDefs property, fieldDefs is the model of the List Component.
1273
+ * fieldDefs is an Array type.
1274
+ * @param newVal
1275
+ */
1276
+ updateFieldDefs(newVal) {
1277
+ if (this.infScroll || this.onDemandLoad) {
1278
+ [this.fieldDefs, this.currentPage] = this.paginationService.updateFieldsOnPagination(this, newVal);
1279
+ }
1280
+ else {
1281
+ this.fieldDefs = newVal;
1282
+ }
1283
+ if (this.orderby) {
1284
+ this.fieldDefs = i1.getOrderedDataset(this.fieldDefs, this.orderby);
1285
+ }
1286
+ if (this.groupby) {
1287
+ this.groupedData = i1.groupData(this, this.fieldDefs, this.groupby, this.match, this.orderby, this.dateformat, this.datePipe, undefined, this.appDefaults);
1288
+ }
1289
+ if (!this.fieldDefs.length) {
1290
+ this.noDataFound = true;
1291
+ this.selecteditem = undefined;
1292
+ }
1293
+ i2.$appDigest();
1294
+ this.listItems.setDirty();
1295
+ }
1296
+ onDataChange(newVal) {
1297
+ // Check for newVal is not empty
1298
+ if (!lodashEs.isEmpty(newVal)) {
1299
+ this.noDataFound = false;
1300
+ this.isDataChanged = true;
1301
+ if (this.datasource && this.datasource.execute(i2.DataSource.Operation.IS_API_AWARE)) {
1302
+ // clone the the data in case of live and service variables to prevent the two-way binding for these variables.
1303
+ newVal = lodashEs.cloneDeep(newVal);
1304
+ }
1305
+ if (i2.isObject(newVal) && !lodashEs.isArray(newVal)) {
1306
+ newVal = lodashEs.isEmpty(newVal) ? [] : [newVal];
1307
+ }
1308
+ if (lodashEs.isString(newVal)) {
1309
+ newVal = newVal.split(',');
1310
+ }
1311
+ // if the page number is greater than 1 on initial load then we render the first page.
1312
+ if (this.datasource && this.datasource.owner === 'App' && (this.infScroll || this.onDemandLoad) && !this.currentPage && this.datasource.execute(i2.DataSource.Operation.GET_PAGING_OPTIONS).number > 0) {
1313
+ newVal = this.datasource.execute(i2.DataSource.Operation.LIST_RECORDS, {
1314
+ 'page': 1
1315
+ });
1316
+ }
1317
+ if (lodashEs.isArray(newVal)) {
1318
+ if (newVal.length) {
1319
+ this.invokeEventCallback('beforedatarender', { $data: newVal });
1320
+ }
1321
+ this.updateFieldDefs(newVal);
1322
+ }
1323
+ }
1324
+ else {
1325
+ this.updateFieldDefs([]);
1326
+ }
1327
+ }
1328
+ // Updates the dataSource when pagination is enabled for the Component.
1329
+ setupDataSource() {
1330
+ const dataNavigator = this.dataNavigator;
1331
+ dataNavigator.options = {
1332
+ maxResults: this.pagesize || 20
966
1333
  };
967
1334
  this.dataNavigatorWatched = true;
968
1335
  if (this.navigatorResultWatch) {
@@ -988,13 +1355,13 @@
988
1355
  this.dataNavigator.setBindDataSet(this.binddataset, this.viewParent, datasetBoundExpr ? this.context : this.datasource, this.dataset, this.binddatasource, datasetBoundExpr, this.statehandler);
989
1356
  }
990
1357
  onDataSetChange(newVal) {
991
- if (_.get(this.datasource, 'category') === 'wm.Variable' && this.getConfiguredState() !== 'none' && this._pageLoad) {
1358
+ if (lodashEs.get(this.datasource, 'category') === 'wm.Variable' && this.getConfiguredState() !== 'none' && this._pageLoad) {
992
1359
  const widgetState = this.statePersistence.getWidgetState(this);
993
1360
  this._pageLoad = false;
994
- if (_.get(widgetState, 'pagination')) {
1361
+ if (lodashEs.get(widgetState, 'pagination')) {
995
1362
  this.dataNavigator.pageChanged({ page: widgetState.pagination }, true);
996
1363
  }
997
- if (_.get(widgetState, 'selectedItem')) {
1364
+ if (lodashEs.get(widgetState, 'selectedItem')) {
998
1365
  this._selectedItemsExist = true;
999
1366
  }
1000
1367
  }
@@ -1029,29 +1396,29 @@
1029
1396
  getListItemByModel(listModel) {
1030
1397
  return this.listItems.find((listItem) => {
1031
1398
  let itemObj = listItem.item;
1032
- if (this.groupby && !_.has(listModel, '_groupIndex')) {
1399
+ if (this.groupby && !lodashEs.has(listModel, '_groupIndex')) {
1033
1400
  // If groupby is enabled, item contains _groupIndex property which should be excluded while comparing model.
1034
- itemObj = _.clone(itemObj);
1401
+ itemObj = lodashEs.clone(itemObj);
1035
1402
  delete itemObj._groupIndex;
1036
1403
  }
1037
- if (_.isEqual(itemObj, listModel)) {
1404
+ if (lodashEs.isEqual(itemObj, listModel)) {
1038
1405
  return true;
1039
1406
  }
1040
1407
  }) || null;
1041
1408
  }
1042
1409
  updateSelectedItemsWidgets(statePersistenceTriggered) {
1043
1410
  let obj = {}, widgetState;
1044
- const pageNum = _.get(this.dataNavigator, 'dn.currentPage') || 1;
1411
+ const pageNum = lodashEs.get(this.dataNavigator, 'dn.currentPage') || 1;
1045
1412
  if (this.getConfiguredState() !== 'none') {
1046
1413
  // remove previously configured selected items for current page and construct new ones later below.
1047
1414
  widgetState = this.statePersistence.getWidgetState(this) || {};
1048
- if (_.get(widgetState, 'selectedItem')) {
1415
+ if (lodashEs.get(widgetState, 'selectedItem')) {
1049
1416
  // when multiselect is on and an item is selected without pressing CTRL, previously selected items in state should be empty.
1050
1417
  if (this.multiselect && this.selecteditem.length === 1) {
1051
1418
  widgetState.selectedItem = [];
1052
1419
  }
1053
1420
  else {
1054
- _.remove(widgetState.selectedItem, function (selectedItem) {
1421
+ lodashEs.remove(widgetState.selectedItem, function (selectedItem) {
1055
1422
  return selectedItem.page === pageNum;
1056
1423
  });
1057
1424
  }
@@ -1069,8 +1436,8 @@
1069
1436
  this.selectedItemWidgets = item.currentItemWidgets;
1070
1437
  }
1071
1438
  obj = { page: pageNum, index: index };
1072
- if (_.get(widgetState, 'selectedItem') && this.multiselect) {
1073
- if (!_.some(widgetState.selectedItem, obj)) {
1439
+ if (lodashEs.get(widgetState, 'selectedItem') && this.multiselect) {
1440
+ if (!lodashEs.some(widgetState.selectedItem, obj)) {
1074
1441
  widgetState.selectedItem.push(obj);
1075
1442
  }
1076
1443
  }
@@ -1098,13 +1465,13 @@
1098
1465
  // item is not allowed to get selected if it is disabled.
1099
1466
  if ($listItem && !$listItem.disableItem) {
1100
1467
  let item = $listItem.item;
1101
- if (this.groupby && _.has(item, '_groupIndex')) {
1468
+ if (this.groupby && lodashEs.has(item, '_groupIndex')) {
1102
1469
  // If groupby is enabled, item contains _groupIndex property which should be excluded from selecteditem.
1103
- item = _.clone(item);
1470
+ item = lodashEs.clone(item);
1104
1471
  delete item._groupIndex;
1105
1472
  }
1106
1473
  if ($listItem.isActive) {
1107
- this._items = _.pullAllWith(this._items, [item], _.isEqual);
1474
+ this._items = lodashEs.pullAllWith(this._items, [item], lodashEs.isEqual);
1108
1475
  $listItem.isActive = false;
1109
1476
  }
1110
1477
  else {
@@ -1132,10 +1499,10 @@
1132
1499
  }
1133
1500
  if (this.isDataChanged && this.getConfiguredState() !== 'none' && listItems.length && this._selectedItemsExist) {
1134
1501
  const widgetState = this.statePersistence.getWidgetState(this);
1135
- if (_.get(widgetState, 'selectedItem')) {
1502
+ if (lodashEs.get(widgetState, 'selectedItem')) {
1136
1503
  this._selectedItemsExist = false;
1137
- const selectedItemsLength = _.isArray(this.selecteditem) ? this.selecteditem.length : _.toNumber(!_.isEmpty(this.selecteditem));
1138
- const currentPage = _.get(this.dataNavigator, 'dn.currentPage') || 1;
1504
+ const selectedItemsLength = lodashEs.isArray(this.selecteditem) ? this.selecteditem.length : lodashEs.toNumber(!lodashEs.isEmpty(this.selecteditem));
1505
+ const currentPage = lodashEs.get(this.dataNavigator, 'dn.currentPage') || 1;
1139
1506
  widgetState.pagination = widgetState.pagination || 1;
1140
1507
  // to prevent item selection from being triggered more than once
1141
1508
  if (selectedItemsLength !== widgetState.selectedItem.length && widgetState.pagination === currentPage) {
@@ -1147,7 +1514,7 @@
1147
1514
  }
1148
1515
  }
1149
1516
  }
1150
- const selectedItems = _.isArray(this.selecteditem) ? this.selecteditem : [this.selecteditem];
1517
+ const selectedItems = lodashEs.isArray(this.selecteditem) ? this.selecteditem : [this.selecteditem];
1151
1518
  this.firstSelectedItem = this.lastSelectedItem = null;
1152
1519
  // don't select first item if multi-select is enabled and at least item is already selected in the list.
1153
1520
  // don't select first item if state information has selected items
@@ -1186,24 +1553,15 @@
1186
1553
  else {
1187
1554
  // In case of mobile app when modal exists, and list items height is greater than the modal content provide ccontainer a scrollable height
1188
1555
  const modalBody = this.$element.closest('.modal-body');
1189
- const listHt = this.$element.find('ul').height();
1190
- const modalHt = window.innerHeight - 140;
1191
- if (i2.isMobile() && modalBody.length && listHt > modalHt) {
1192
- this.$element.css('height', modalHt + 'px');
1193
- }
1194
- this.paginationService.bindScrollEvt(this, '> ul', i1.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME);
1195
- }
1196
- }
1197
- this.isDataChanged = false;
1198
- }
1199
- triggerListItemSelection($el, $event) {
1200
- if ($el && $el[0]) {
1201
- const listItemContext = $el.data('listItemContext');
1202
- // Trigger click event only if the list item is from the corresponding list.
1203
- if (listItemContext.listComponent === this) {
1204
- this.onItemClick($event, listItemContext);
1556
+ const listHt = this.$element.find('ul').height();
1557
+ const modalHt = window.innerHeight - 140;
1558
+ if (i2.isMobile() && modalBody.length && listHt > modalHt) {
1559
+ this.$element.css('height', modalHt + 'px');
1560
+ }
1561
+ this.paginationService.bindScrollEvt(this, '> ul', i1.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME);
1205
1562
  }
1206
1563
  }
1564
+ this.isDataChanged = false;
1207
1565
  }
1208
1566
  setupHandlers() {
1209
1567
  this.listItems.changes.subscribe(listItems => {
@@ -1243,344 +1601,99 @@
1243
1601
  // If ui is not present then it is called from drag and drop using keyboard
1244
1602
  const newIndex = ui === undefined ? presentIndex : ui.item.index();
1245
1603
  const oldIndex = this.$ulEle.data('oldIndex');
1246
- const minIndex = _.min([newIndex, oldIndex]);
1247
- const maxIndex = _.max([newIndex, oldIndex]);
1248
- const draggedItem = _.pullAt(data, oldIndex)[0];
1604
+ const minIndex = lodashEs.min([newIndex, oldIndex]);
1605
+ const maxIndex = lodashEs.max([newIndex, oldIndex]);
1606
+ const draggedItem = lodashEs.pullAt(data, oldIndex)[0];
1249
1607
  // Modify the data list only if we find a draggedItem
1250
- if (draggedItem) {
1251
- if (this.getConfiguredState() !== 'none') {
1252
- this.statePersistence.removeWidgetState(this, 'selectedItem');
1253
- }
1254
- this.reorderProps.minIndex = _.min([minIndex, this.reorderProps.minIndex]);
1255
- this.reorderProps.maxIndex = _.max([maxIndex, this.reorderProps.maxIndex]);
1256
- data.splice(newIndex, 0, draggedItem);
1257
- this.cdRef.markForCheck();
1258
- this.cdRef.detectChanges();
1259
- const $changedItem = {
1260
- oldIndex: oldIndex,
1261
- newIndex: newIndex,
1262
- item: data[newIndex]
1263
- };
1264
- this.invokeEventCallback('reorder', { $event: evt, $data: data, $changedItem });
1265
- this.$ulEle.removeData('oldIndex');
1266
- }
1267
- }
1268
- // configures reordering the list items.
1269
- configureDnD() {
1270
- let appendTo;
1271
- const modalEl = $(document).find('.modal');
1272
- if (this.getAttr('height')) { // when height is applied to the list, append should be the ul's parent as scroll is applied to the parent
1273
- appendTo = 'parent';
1274
- }
1275
- else if (modalEl.length) { // In case of dialog, appendTo should be the modal ele
1276
- appendTo = modalEl[modalEl.length - 1];
1277
- }
1278
- else { // As default append to should be body
1279
- appendTo = 'body';
1280
- }
1281
- const options = i2.isMobileApp() ? {} : {
1282
- appendTo: appendTo,
1283
- };
1284
- const $el = $(this.nativeElement);
1285
- this.$ulEle = $el.find('.app-livelist-container');
1286
- i1.configureDnD(this.$ulEle, options, this.onReorderStart.bind(this), this.onUpdate.bind(this), this.onSort.bind(this));
1287
- this.$ulEle.droppable({ 'accept': '.app-list-item' });
1288
- if (i2.isMobileApp()) {
1289
- this.$ulEle.sortable('disable');
1290
- this.$ulEle.on('touchstart', function (event) {
1291
- let self = this;
1292
- if (!self.touching) {
1293
- if (self.touched) {
1294
- clearTimeout(self.touched);
1295
- }
1296
- setTimeout(() => {
1297
- //Prevent context menu on mobile (IOS/ANDROID)
1298
- if (event.cancelable) {
1299
- event.preventDefault();
1300
- }
1301
- }, 50);
1302
- self.touched = setTimeout(() => {
1303
- $(event.currentTarget).addClass('no-selection');
1304
- //Enable draggable
1305
- $(event.currentTarget).sortable('enable');
1306
- //Set internal flag
1307
- self.touching = true;
1308
- //trigger touchstart again to enable draggable through touch punch
1309
- $(self).trigger(event);
1310
- //Choose preferred duration for taphold
1311
- }, 350);
1312
- }
1313
- }).on('touchend', function (event) {
1314
- this.touching = false;
1315
- $(event.currentTarget).removeClass('no-selection');
1316
- //Disable draggable to enable default behaviour
1317
- $(event.currentTarget).sortable('disable');
1318
- clearTimeout(this.touched);
1319
- }).on('touchmove', function () {
1320
- clearTimeout(this.touched);
1321
- });
1322
- }
1323
- }
1324
- // returns true if the selection limit is reached.
1325
- checkSelectionLimit(count) {
1326
- return (!this.selectionlimit || count < this.selectionlimit);
1327
- }
1328
- // returns listitem reference by index value.
1329
- getListItemByIndex(index) {
1330
- return this.listItems.toArray()[index];
1331
- }
1332
- /**
1333
- * return index of an (listItemDirective) in the listItem
1334
- * @param {ListItemDirective} item
1335
- * @returns {number}
1336
- */
1337
- getListItemIndex(item) {
1338
- return this.listItems.toArray().indexOf(item);
1339
- }
1340
- // this method is called form other data widgets like table.
1341
- execute(operation, options) {
1342
- if ([i2.DataSource.Operation.IS_API_AWARE, i2.DataSource.Operation.IS_PAGEABLE, i2.DataSource.Operation.SUPPORTS_SERVER_FILTER].includes(operation)) {
1343
- return false;
1344
- }
1345
- return this.datasource.execute(operation, options);
1346
- }
1347
- handleKeyDown($event, action) {
1348
- $event.stopPropagation();
1349
- if ($event.keyCode !== 13 && $event.keyCode !== 9 && !(($event.target.classList.contains('form-control') || $event.target.classList.contains('note-editable')) && $event.keyCode === 32)) {
1350
- $event.preventDefault();
1351
- }
1352
- const listItems = this.listItems;
1353
- let presentIndex = this.getListItemIndex(this.lastSelectedItem);
1354
- if (this.multiselect) {
1355
- const firstIndex = this.getListItemIndex(this.firstSelectedItem);
1356
- const selectCount = _.isArray(this.selecteditem) ? this.selecteditem.length : (_.isObject(this.selecteditem) ? 1 : 0);
1357
- if (action === 'selectPrev') {
1358
- if (presentIndex > 0) {
1359
- if ((presentIndex <= firstIndex) && this.checkSelectionLimit(selectCount)) {
1360
- this.lastSelectedItem = this.getListItemByIndex(presentIndex - 1);
1361
- this.toggleListItemSelection(this.lastSelectedItem);
1362
- }
1363
- else if (presentIndex > firstIndex) {
1364
- this.toggleListItemSelection(this.getListItemByIndex(presentIndex));
1365
- this.lastSelectedItem = this.getListItemByIndex(presentIndex - 1);
1366
- }
1367
- else {
1368
- this.invokeEventCallback('selectionlimitexceed', { $event });
1369
- }
1370
- }
1371
- }
1372
- else if (action === 'selectNext') {
1373
- if (presentIndex < listItems.length - 1) {
1374
- if ((presentIndex >= firstIndex) && this.checkSelectionLimit(selectCount)) {
1375
- this.lastSelectedItem = this.getListItemByIndex(presentIndex + 1);
1376
- this.toggleListItemSelection(this.lastSelectedItem);
1377
- }
1378
- else if (presentIndex < firstIndex) {
1379
- this.toggleListItemSelection(this.getListItemByIndex(presentIndex));
1380
- this.lastSelectedItem = this.getListItemByIndex(presentIndex + 1);
1381
- }
1382
- else {
1383
- this.invokeEventCallback('selectionlimitexceed', { $event });
1384
- }
1385
- }
1386
- }
1387
- }
1388
- if (action === 'focusPrev') {
1389
- if (this.isListElementMovable) {
1390
- presentIndex = presentIndex <= 0 ? 0 : (presentIndex);
1391
- if (presentIndex === 0) {
1392
- return;
1393
- }
1394
- this.lastSelectedItem = this.getListItemByIndex(presentIndex);
1395
- const prevElt = this.getListItemByIndex(presentIndex - 1);
1396
- prevElt.nativeElement.before(this.lastSelectedItem.nativeElement);
1397
- this.lastSelectedItem.nativeElement.focus();
1398
- this.statePersistence.removeWidgetState(this, 'selectedItem');
1399
- const arr = this.listItems.toArray();
1400
- [arr[presentIndex - 1], arr[presentIndex]] = [arr[presentIndex], arr[presentIndex - 1]];
1401
- this.listItems.reset(arr);
1402
- this.currentIndex = presentIndex;
1403
- this.ariaText = "selected ";
1404
- }
1405
- else {
1406
- presentIndex = presentIndex <= 0 ? 0 : (presentIndex - 1);
1407
- this.lastSelectedItem = this.getListItemByIndex(presentIndex);
1408
- this.lastSelectedItem.nativeElement.focus();
1409
- this.currentIndex = presentIndex + 1;
1410
- this.ariaText = "selected ";
1411
- }
1412
- }
1413
- else if (action === 'focusNext') {
1414
- if (this.isListElementMovable) {
1415
- presentIndex = presentIndex < (listItems.length - 1) ? (presentIndex) : (listItems.length - 1);
1416
- if (presentIndex === this.listItems.length - 1) {
1417
- return;
1418
- }
1419
- this.lastSelectedItem = this.getListItemByIndex(presentIndex);
1420
- const nextElt = this.getListItemByIndex(presentIndex + 1);
1421
- nextElt.nativeElement.after(this.lastSelectedItem.nativeElement);
1422
- this.lastSelectedItem.nativeElement.focus();
1423
- this.statePersistence.removeWidgetState(this, 'selectedItem');
1424
- const arr = this.listItems.toArray();
1425
- [arr[presentIndex], arr[presentIndex + 1]] = [arr[presentIndex + 1], arr[presentIndex]];
1426
- this.listItems.reset(arr);
1427
- this.currentIndex = presentIndex + 2;
1428
- this.ariaText = "selected ";
1429
- }
1430
- else {
1431
- presentIndex = presentIndex < (listItems.length - 1) ? (presentIndex + 1) : (listItems.length - 1);
1432
- this.lastSelectedItem = this.getListItemByIndex(presentIndex);
1433
- this.lastSelectedItem.nativeElement.focus();
1434
- this.currentIndex = presentIndex + 1;
1435
- this.ariaText = "selected ";
1436
- }
1437
- }
1438
- else if (action === 'select') {
1439
- // if the enter click is pressed on the item which is not the last selected item, the find the item from which the event is originated.
1440
- if (presentIndex === -1 || !$($event.target).closest(this.lastSelectedItem.nativeElement)) {
1441
- const $li = $($event.target).closest('li.app-list-item');
1442
- const $ul = $li.closest('ul.app-livelist-container');
1443
- presentIndex = $ul.find('li.app-list-item').index($li);
1444
- }
1445
- this.onItemClick($event, this.getListItemByIndex(presentIndex));
1446
- }
1447
- else if (action === 'space') {
1448
- if (!this.enablereorder) {
1449
- return;
1450
- }
1451
- this.isListElementMovable = !this.isListElementMovable;
1452
- this.onItemClick($event, this.getListItemByIndex(presentIndex));
1453
- this.currentIndex = presentIndex + 1;
1454
- if (this.isListElementMovable) {
1455
- this.ariaText = `Item ${this.currentIndex} grabbed, current position `;
1456
- this.$ulEle.data('oldIndex', presentIndex);
1457
- }
1458
- else {
1459
- this.ariaText = `Item ${this.currentIndex} dropped, final position `;
1460
- this.onUpdate($event, undefined, presentIndex);
1461
- }
1462
- }
1463
- }
1464
- onPropertyChange(key, nv, ov) {
1465
- if (key === 'dataset') {
1466
- if (!nv && this.binddatasource && !this.datasource) {
1467
- return;
1468
- }
1469
- this.onDataSetChange(nv);
1470
- }
1471
- else if (key === 'datasource') {
1472
- if (this.dataset) {
1473
- this.onDataSetChange(this.dataset);
1474
- }
1475
- }
1476
- else if (key === 'navigation') {
1477
- // Support for older projects where navigation type was advanced instead of classic
1478
- if (nv === 'Advanced') {
1479
- this.navigation = 'Classic';
1480
- return;
1481
- }
1482
- i2.switchClass(this.nativeElement, nv, ov);
1483
- this.onNavigationTypeChange(nv);
1484
- if (this.dataNavigator) {
1485
- this.dataNavigator.navigationClass = this.paginationclass;
1486
- }
1487
- }
1488
- else if (key === 'itemsperrow') {
1489
- i2.setListClass(this);
1490
- }
1491
- else if (key === 'tabindex') {
1492
- return;
1493
- }
1494
- else if (key === 'pulltorefresh' && nv) {
1495
- this.app.notify('pullToRefresh:enable');
1496
- this.subscribeToPullToRefresh();
1497
- }
1498
- else if (key === 'paginationclass') {
1499
- if (this.dataNavigator) {
1500
- // Adding setTimeout because in pagination component updateNavSize method is overriding navigationclass
1501
- setTimeout(() => this.dataNavigator.navigationClass = nv);
1608
+ if (draggedItem) {
1609
+ if (this.getConfiguredState() !== 'none') {
1610
+ this.statePersistence.removeWidgetState(this, 'selectedItem');
1502
1611
  }
1503
- }
1504
- else if (key === 'pagesize') {
1505
- this.dataNavigator.options = {
1506
- maxResults: nv
1612
+ this.reorderProps.minIndex = lodashEs.min([minIndex, this.reorderProps.minIndex]);
1613
+ this.reorderProps.maxIndex = lodashEs.max([maxIndex, this.reorderProps.maxIndex]);
1614
+ data.splice(newIndex, 0, draggedItem);
1615
+ this.cdRef.markForCheck();
1616
+ this.cdRef.detectChanges();
1617
+ const $changedItem = {
1618
+ oldIndex: oldIndex,
1619
+ newIndex: newIndex,
1620
+ item: data[newIndex]
1507
1621
  };
1508
- this.dataNavigator.widget.maxResults = nv;
1509
- this.dataNavigator.maxResults = nv;
1622
+ this.invokeEventCallback('reorder', { $event: evt, $data: data, $changedItem });
1623
+ this.$ulEle.removeData('oldIndex');
1510
1624
  }
1511
- else if (key === 'enablereorder') {
1512
- if (nv && this.$ulEle) {
1513
- this.$ulEle.attr('aria-describedby', this.titleId);
1514
- this.configureDnD();
1515
- this.$ulEle.sortable('enable');
1516
- }
1517
- else if (this.$ulEle && !nv) {
1518
- this.$ulEle.removeAttr('aria-describedby');
1519
- this.$ulEle.sortable('disable');
1520
- }
1625
+ }
1626
+ // configures reordering the list items.
1627
+ configureDnD() {
1628
+ let appendTo;
1629
+ const modalEl = $(document).find('.modal');
1630
+ if (this.getAttr('height')) { // when height is applied to the list, append should be the ul's parent as scroll is applied to the parent
1631
+ appendTo = 'parent';
1521
1632
  }
1522
- else {
1523
- super.onPropertyChange(key, nv, ov);
1633
+ else if (modalEl.length) { // In case of dialog, appendTo should be the modal ele
1634
+ appendTo = modalEl[modalEl.length - 1];
1524
1635
  }
1525
- }
1526
- onItemClick(evt, $listItem) {
1527
- let selectCount;
1528
- if (!$listItem.disableItem) {
1529
- this.firstSelectedItem = this.firstSelectedItem || $listItem;
1530
- // Setting selectCount value based number of items selected.
1531
- selectCount = _.isArray(this.selecteditem) ? this.selecteditem.length : (_.isObject(this.selecteditem) ? 1 : 0);
1532
- // Handling multiselect for mobile device
1533
- if (this.multiselect && i2.isMobile()) {
1534
- if (this.checkSelectionLimit(selectCount) || $listItem.isActive) {
1535
- this.toggleListItemSelection($listItem);
1536
- }
1537
- else {
1538
- this.invokeEventCallback('selectionlimitexceed', { $event: evt });
1539
- }
1540
- }
1541
- else if ((evt.ctrlKey || evt.metaKey) && this.multiselect) {
1542
- if (this.checkSelectionLimit(selectCount) || $listItem.isActive) {
1543
- this.firstSelectedItem = this.lastSelectedItem = $listItem;
1544
- this.toggleListItemSelection($listItem);
1545
- }
1546
- else {
1547
- this.invokeEventCallback('selectionlimitexceed', { $event: evt });
1548
- }
1549
- }
1550
- else if (evt.shiftKey && this.multiselect) {
1551
- let first = $listItem.context.index;
1552
- let last = this.firstSelectedItem.context.index;
1553
- // if first is greater than last, then swap values
1554
- if (first > last) {
1555
- last = [first, first = last][0];
1556
- }
1557
- if (this.checkSelectionLimit(last - first)) {
1558
- this.clearSelectedItems();
1559
- this.listItems.forEach(($liItem) => {
1560
- const index = $liItem.context.index;
1561
- if (index >= first && index <= last) {
1562
- this.toggleListItemSelection($liItem);
1636
+ else { // As default append to should be body
1637
+ appendTo = 'body';
1638
+ }
1639
+ const options = i2.isMobileApp() ? {} : {
1640
+ appendTo: appendTo,
1641
+ };
1642
+ const $el = $(this.nativeElement);
1643
+ this.$ulEle = $el.find('.app-livelist-container');
1644
+ i1.configureDnD(this.$ulEle, options, this.onReorderStart.bind(this), this.onUpdate.bind(this), this.onSort.bind(this));
1645
+ this.$ulEle.droppable({ 'accept': '.app-list-item' });
1646
+ if (i2.isMobileApp()) {
1647
+ this.$ulEle.sortable('disable');
1648
+ this.$ulEle.on('touchstart', function (event) {
1649
+ let self = this;
1650
+ if (!self.touching) {
1651
+ if (self.touched) {
1652
+ clearTimeout(self.touched);
1653
+ }
1654
+ setTimeout(() => {
1655
+ //Prevent context menu on mobile (IOS/ANDROID)
1656
+ if (event.cancelable) {
1657
+ event.preventDefault();
1563
1658
  }
1564
- });
1565
- this.lastSelectedItem = $listItem;
1566
- }
1567
- else {
1568
- this.invokeEventCallback('selectionlimitexceed', { $event: evt });
1569
- }
1570
- }
1571
- else {
1572
- if (!$listItem.isActive || selectCount > 1) {
1573
- this.clearSelectedItems();
1574
- this.toggleListItemSelection($listItem);
1575
- this.firstSelectedItem = this.lastSelectedItem = $listItem;
1659
+ }, 50);
1660
+ self.touched = setTimeout(() => {
1661
+ $(event.currentTarget).addClass('no-selection');
1662
+ //Enable draggable
1663
+ $(event.currentTarget).sortable('enable');
1664
+ //Set internal flag
1665
+ self.touching = true;
1666
+ //trigger touchstart again to enable draggable through touch punch
1667
+ $(self).trigger(event);
1668
+ //Choose preferred duration for taphold
1669
+ }, 350);
1576
1670
  }
1577
- }
1578
- i2.$appDigest();
1671
+ }).on('touchend', function (event) {
1672
+ this.touching = false;
1673
+ $(event.currentTarget).removeClass('no-selection');
1674
+ //Disable draggable to enable default behaviour
1675
+ $(event.currentTarget).sortable('disable');
1676
+ clearTimeout(this.touched);
1677
+ }).on('touchmove', function () {
1678
+ clearTimeout(this.touched);
1679
+ });
1579
1680
  }
1580
1681
  }
1581
- // Empty the list content on clear
1582
- clear() {
1583
- this.updateFieldDefs([]);
1682
+ // returns true if the selection limit is reached.
1683
+ checkSelectionLimit(count) {
1684
+ return (!this.selectionlimit || count < this.selectionlimit);
1685
+ }
1686
+ // returns listitem reference by index value.
1687
+ getListItemByIndex(index) {
1688
+ return this.listItems.toArray()[index];
1689
+ }
1690
+ /**
1691
+ * return index of an (listItemDirective) in the listItem
1692
+ * @param {ListItemDirective} item
1693
+ * @returns {number}
1694
+ */
1695
+ getListItemIndex(item) {
1696
+ return this.listItems.toArray().indexOf(item);
1584
1697
  }
1585
1698
  /**
1586
1699
  * Returns ListItem Reference based on the input provided.
@@ -1589,7 +1702,7 @@
1589
1702
  */
1590
1703
  getItemRefByIndexOrModel(val) {
1591
1704
  let listItem;
1592
- if (i2.isNumber(val)) {
1705
+ if (lodashEs.isNumber(val)) {
1593
1706
  listItem = this.getListItemByIndex(val);
1594
1707
  }
1595
1708
  else {
@@ -1597,52 +1710,9 @@
1597
1710
  }
1598
1711
  return listItem;
1599
1712
  }
1600
- /**
1601
- * deselects item in the list.
1602
- * @param val: index | model of the list item.
1603
- */
1604
- deselectItem(val) {
1605
- const listItem = this.getItemRefByIndexOrModel(val);
1606
- if (listItem && listItem.isActive) {
1607
- this.toggleListItemSelection(listItem);
1608
- }
1609
- }
1610
- /**
1611
- * selects item in the list.
1612
- * @param val: index | model of the list item.
1613
- */
1614
- selectItem(val, statePersistenceTriggered) {
1615
- const listItem = this.getItemRefByIndexOrModel(val);
1616
- if (!listItem) {
1617
- return;
1618
- }
1619
- if (!listItem.isActive) {
1620
- this.toggleListItemSelection(listItem, statePersistenceTriggered);
1621
- }
1622
- // focus the element.
1623
- listItem.nativeElement.focus();
1624
- }
1625
1713
  beforePaginationChange($event, $index) {
1626
1714
  this.invokeEventCallback('paginationchange', { $event, $index });
1627
1715
  }
1628
- handleEvent(node, eventName, eventCallback, locals) {
1629
- // tap and doubleTap events are not getting propagated.So, using mouse events instead.
1630
- const touchToMouse = {
1631
- tap: 'click',
1632
- doubletap: 'dblclick'
1633
- };
1634
- if (_.includes(['click', 'tap', 'dblclick', 'doubletap'], eventName)) {
1635
- this.eventManager.addEventListener(this.nativeElement, touchToMouse[eventName] || eventName, (evt) => {
1636
- const target = $(evt.target).closest('.app-list-item');
1637
- if (target.length) {
1638
- const listItemContext = target.data('listItemContext');
1639
- if (!listItemContext.disableItem) {
1640
- this.invokeEventCallback(eventName, { widget: listItemContext, $event: evt, item: listItemContext.item });
1641
- }
1642
- }
1643
- });
1644
- }
1645
- }
1646
1716
  // Invoke the datasource variable by default when pulltorefresh event is not specified.
1647
1717
  subscribeToPullToRefresh() {
1648
1718
  this._listenerDestroyers.push(this.app.subscribe('pulltorefresh', () => {
@@ -1651,19 +1721,6 @@
1651
1721
  }
1652
1722
  }));
1653
1723
  }
1654
- ngOnInit() {
1655
- super.ngOnInit();
1656
- this.handleHeaderClick = i2.noop;
1657
- setTimeout(() => {
1658
- this.debouncedFetchNextDatasetOnScroll = this.paginationService.debouncedFetchNextDatasetOnScroll(this.dataNavigator, i1.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME, this);
1659
- }, 0);
1660
- this._items = [];
1661
- this.fieldDefs = [];
1662
- this.reorderProps = {
1663
- minIndex: null,
1664
- maxIndex: null
1665
- };
1666
- }
1667
1724
  setUpCUDHandlers() {
1668
1725
  const $addItem = document.getElementsByClassName("add-list-item")[0];
1669
1726
  if ($addItem) {
@@ -1673,58 +1730,6 @@
1673
1730
  });
1674
1731
  }
1675
1732
  }
1676
- ngAfterViewInit() {
1677
- this.promiseResolverFn();
1678
- this.propsInitPromise.then(() => {
1679
- super.ngAfterViewInit();
1680
- this.setUpCUDHandlers();
1681
- this.selectedItemWidgets = this.multiselect ? [] : {};
1682
- var ele = $(this.nativeElement).find('.app-livelist-container');
1683
- if (this.enablereorder && !this.groupby) {
1684
- if (ele) {
1685
- ele.attr('aria-describedby', this.titleId);
1686
- }
1687
- this.configureDnD();
1688
- }
1689
- if (!this.enablereorder) {
1690
- if (ele) {
1691
- ele.removeAttr('aria-describedby');
1692
- }
1693
- }
1694
- if (this.groupby && this.collapsible) {
1695
- this.handleHeaderClick = i1.handleHeaderClick;
1696
- this.toggleAllHeaders = i1.toggleAllHeaders.bind(undefined, this);
1697
- }
1698
- i2.setListClass(this);
1699
- });
1700
- this.setupHandlers();
1701
- const $ul = this.nativeElement.querySelector('ul.app-livelist-container');
1702
- i1.styler($ul, this, i1.APPLY_STYLES_TYPE.SCROLLABLE_CONTAINER);
1703
- if (this.enablereorder) {
1704
- if ($ul) {
1705
- $ul.setAttribute('aria-describedby', this.titleId);
1706
- }
1707
- }
1708
- if (!this.enablereorder) {
1709
- if ($ul) {
1710
- $ul.removeAttribute('aria-describedby');
1711
- }
1712
- }
1713
- if (i2.isMobileApp() && $ul.querySelector('.app-list-item-action-panel')) {
1714
- this._listAnimator = new ListAnimator(this);
1715
- }
1716
- }
1717
- ngOnDestroy() {
1718
- if (this._listAnimator && this._listAnimator.$btnSubscription) {
1719
- this._listAnimator.$btnSubscription.unsubscribe();
1720
- }
1721
- this._listenerDestroyers.forEach(d => d && d());
1722
- super.ngOnDestroy();
1723
- }
1724
- ngOnDetach() {
1725
- super.ngOnDetach();
1726
- this._pageLoad = true;
1727
- }
1728
1733
  static { this.ɵfac = function ListComponent_Factory(t) { return new (t || ListComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.Injector), i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef), i0__namespace.ɵɵdirectiveInject(i1__namespace.ToDatePipe), i0__namespace.ɵɵdirectiveInject(i2__namespace.App), i0__namespace.ɵɵdirectiveInject(i2__namespace.AppDefaults), i0__namespace.ɵɵdirectiveInject(i0__namespace.NgZone), i0__namespace.ɵɵinjectAttribute('itemclass.bind'), i0__namespace.ɵɵinjectAttribute('disableitem.bind'), i0__namespace.ɵɵinjectAttribute('dataset.bind'), i0__namespace.ɵɵinjectAttribute('datasource.bind'), i0__namespace.ɵɵinjectAttribute('mouseenter.event'), i0__namespace.ɵɵinjectAttribute('mouseleave.event'), i0__namespace.ɵɵdirectiveInject(i2__namespace.StatePersistence), i0__namespace.ɵɵdirectiveInject(i2__namespace.PaginationService), i0__namespace.ɵɵdirectiveInject('EXPLICIT_CONTEXT', 8)); }; }
1729
1734
  static { this.ɵcmp = /*@__PURE__*/ i0__namespace.ɵɵdefineComponent({ type: ListComponent, selectors: [["div", "wmList", ""]], contentQueries: function ListComponent_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
1730
1735
  i0__namespace.ɵɵcontentQuery(dirIndex, _c0, 5);
@@ -1836,7 +1841,7 @@
1836
1841
  type: i0.ViewChildren,
1837
1842
  args: [ListItemDirective]
1838
1843
  }] }); })();
1839
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassDebugInfo(ListComponent, { className: "ListComponent", filePath: "list.component.ts", lineNumber: 63 }); })();
1844
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassDebugInfo(ListComponent, { className: "ListComponent", filePath: "list.component.ts", lineNumber: 91 }); })();
1840
1845
 
1841
1846
  const components = [
1842
1847
  ListComponent,