@wavemaker-ai/app-ng-runtime 12.0.2-rc.647771 → 12.1.0-rc.647821

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 (473) hide show
  1. package/build-task/bundles/index.umd.js +2489 -2963
  2. package/build-task/fesm2022/index.mjs +2307 -2786
  3. package/build-task/fesm2022/index.mjs.map +1 -1
  4. package/build-task/types/index.d.ts +401 -844
  5. package/components/advanced/carousel/bundles/index.umd.js +387 -344
  6. package/components/advanced/carousel/fesm2022/index.mjs +363 -325
  7. package/components/advanced/carousel/fesm2022/index.mjs.map +1 -1
  8. package/components/advanced/carousel/types/index.d.ts +85 -86
  9. package/components/advanced/custom/bundles/index.umd.js +298 -249
  10. package/components/advanced/custom/fesm2022/index.mjs +280 -236
  11. package/components/advanced/custom/fesm2022/index.mjs.map +1 -1
  12. package/components/advanced/custom/types/index.d.ts +49 -49
  13. package/components/advanced/login/bundles/index.umd.js +177 -127
  14. package/components/advanced/login/fesm2022/index.mjs +162 -117
  15. package/components/advanced/login/fesm2022/index.mjs.map +1 -1
  16. package/components/advanced/login/types/index.d.ts +33 -34
  17. package/components/advanced/marquee/bundles/index.umd.js +93 -63
  18. package/components/advanced/marquee/fesm2022/index.mjs +73 -48
  19. package/components/advanced/marquee/fesm2022/index.mjs.map +1 -1
  20. package/components/advanced/marquee/types/index.d.ts +11 -12
  21. package/components/base/bundles/index.umd.js +5515 -6359
  22. package/components/base/fesm2022/index.mjs +5169 -6027
  23. package/components/base/fesm2022/index.mjs.map +1 -1
  24. package/components/base/types/index.d.ts +1198 -1154
  25. package/components/basic/anchor/bundles/index.umd.js +273 -195
  26. package/components/basic/anchor/fesm2022/index.mjs +251 -178
  27. package/components/basic/anchor/fesm2022/index.mjs.map +1 -1
  28. package/components/basic/anchor/types/index.d.ts +40 -41
  29. package/components/basic/audio/bundles/index.umd.js +124 -75
  30. package/components/basic/audio/fesm2022/index.mjs +104 -60
  31. package/components/basic/audio/fesm2022/index.mjs.map +1 -1
  32. package/components/basic/audio/types/index.d.ts +22 -23
  33. package/components/basic/html/bundles/index.umd.js +144 -113
  34. package/components/basic/html/fesm2022/index.mjs +125 -99
  35. package/components/basic/html/fesm2022/index.mjs.map +1 -1
  36. package/components/basic/html/types/index.d.ts +20 -17
  37. package/components/basic/icon/bundles/index.umd.js +144 -72
  38. package/components/basic/icon/fesm2022/index.mjs +124 -57
  39. package/components/basic/icon/fesm2022/index.mjs.map +1 -1
  40. package/components/basic/icon/types/index.d.ts +18 -19
  41. package/components/basic/iframe/bundles/index.umd.js +143 -93
  42. package/components/basic/iframe/fesm2022/index.mjs +124 -79
  43. package/components/basic/iframe/fesm2022/index.mjs.map +1 -1
  44. package/components/basic/iframe/types/index.d.ts +28 -29
  45. package/components/basic/label/bundles/index.umd.js +136 -120
  46. package/components/basic/label/fesm2022/index.mjs +118 -107
  47. package/components/basic/label/fesm2022/index.mjs.map +1 -1
  48. package/components/basic/label/types/index.d.ts +14 -15
  49. package/components/basic/picture/bundles/index.umd.js +171 -130
  50. package/components/basic/picture/fesm2022/index.mjs +152 -116
  51. package/components/basic/picture/fesm2022/index.mjs.map +1 -1
  52. package/components/basic/picture/types/index.d.ts +21 -22
  53. package/components/basic/progress/progress-bar/bundles/index.umd.js +211 -160
  54. package/components/basic/progress/progress-bar/fesm2022/index.mjs +193 -147
  55. package/components/basic/progress/progress-bar/fesm2022/index.mjs.map +1 -1
  56. package/components/basic/progress/progress-bar/types/index.d.ts +45 -41
  57. package/components/basic/progress/progress-circle/bundles/index.umd.js +294 -165
  58. package/components/basic/progress/progress-circle/fesm2022/index.mjs +274 -150
  59. package/components/basic/progress/progress-circle/fesm2022/index.mjs.map +1 -1
  60. package/components/basic/progress/progress-circle/types/index.d.ts +41 -42
  61. package/components/basic/progress/progress-utils/bundles/index.umd.js +27 -29
  62. package/components/basic/progress/progress-utils/fesm2022/index.mjs +18 -25
  63. package/components/basic/progress/progress-utils/fesm2022/index.mjs.map +1 -1
  64. package/components/basic/progress/progress-utils/types/index.d.ts +3 -5
  65. package/components/basic/rich-text-editor/bundles/index.umd.js +294 -228
  66. package/components/basic/rich-text-editor/fesm2022/index.mjs +275 -214
  67. package/components/basic/rich-text-editor/fesm2022/index.mjs.map +1 -1
  68. package/components/basic/rich-text-editor/types/index.d.ts +55 -56
  69. package/components/basic/search/bundles/index.umd.js +1129 -1090
  70. package/components/basic/search/fesm2022/index.mjs +1117 -1083
  71. package/components/basic/search/fesm2022/index.mjs.map +1 -1
  72. package/components/basic/search/types/index.d.ts +132 -130
  73. package/components/basic/spinner/bundles/index.umd.js +216 -120
  74. package/components/basic/spinner/fesm2022/index.mjs +201 -110
  75. package/components/basic/spinner/fesm2022/index.mjs.map +1 -1
  76. package/components/basic/spinner/types/index.d.ts +30 -31
  77. package/components/basic/tree/bundles/index.umd.js +756 -756
  78. package/components/basic/tree/fesm2022/index.mjs +740 -745
  79. package/components/basic/tree/fesm2022/index.mjs.map +1 -1
  80. package/components/basic/tree/types/index.d.ts +106 -97
  81. package/components/basic/video/bundles/index.umd.js +164 -108
  82. package/components/basic/video/fesm2022/index.mjs +145 -94
  83. package/components/basic/video/fesm2022/index.mjs.map +1 -1
  84. package/components/basic/video/types/index.d.ts +29 -30
  85. package/components/chart/bundles/index.umd.js +1768 -1737
  86. package/components/chart/fesm2022/index.mjs +1713 -1728
  87. package/components/chart/fesm2022/index.mjs.map +1 -1
  88. package/components/chart/types/index.d.ts +102 -104
  89. package/components/containers/accordion/bundles/index.umd.js +522 -494
  90. package/components/containers/accordion/fesm2022/index.mjs +502 -479
  91. package/components/containers/accordion/fesm2022/index.mjs.map +1 -1
  92. package/components/containers/accordion/types/index.d.ts +116 -116
  93. package/components/containers/layout-grid/bundles/index.umd.js +260 -164
  94. package/components/containers/layout-grid/fesm2022/index.mjs +231 -140
  95. package/components/containers/layout-grid/fesm2022/index.mjs.map +1 -1
  96. package/components/containers/layout-grid/types/index.d.ts +30 -27
  97. package/components/containers/linear-layout/bundles/index.umd.js +220 -178
  98. package/components/containers/linear-layout/fesm2022/index.mjs +193 -156
  99. package/components/containers/linear-layout/fesm2022/index.mjs.map +1 -1
  100. package/components/containers/linear-layout/types/index.d.ts +26 -26
  101. package/components/containers/panel/bundles/index.umd.js +343 -215
  102. package/components/containers/panel/fesm2022/index.mjs +330 -207
  103. package/components/containers/panel/fesm2022/index.mjs.map +1 -1
  104. package/components/containers/panel/types/index.d.ts +48 -49
  105. package/components/containers/tabs/bundles/index.umd.js +832 -779
  106. package/components/containers/tabs/fesm2022/index.mjs +811 -763
  107. package/components/containers/tabs/fesm2022/index.mjs.map +1 -1
  108. package/components/containers/tabs/types/index.d.ts +134 -126
  109. package/components/containers/tile/bundles/index.umd.js +93 -60
  110. package/components/containers/tile/fesm2022/index.mjs +75 -47
  111. package/components/containers/tile/fesm2022/index.mjs.map +1 -1
  112. package/components/containers/tile/types/index.d.ts +11 -12
  113. package/components/containers/wizard/bundles/index.umd.js +1096 -1078
  114. package/components/containers/wizard/fesm2022/index.mjs +1069 -1056
  115. package/components/containers/wizard/fesm2022/index.mjs.map +1 -1
  116. package/components/containers/wizard/types/index.d.ts +258 -252
  117. package/components/data/card/bundles/index.umd.js +439 -229
  118. package/components/data/card/fesm2022/index.mjs +408 -203
  119. package/components/data/card/fesm2022/index.mjs.map +1 -1
  120. package/components/data/card/types/index.d.ts +50 -48
  121. package/components/data/form/bundles/index.umd.js +3392 -3339
  122. package/components/data/form/fesm2022/index.mjs +3350 -3304
  123. package/components/data/form/fesm2022/index.mjs.map +1 -1
  124. package/components/data/form/types/index.d.ts +561 -482
  125. package/components/data/list/bundles/index.umd.js +1523 -1601
  126. package/components/data/list/fesm2022/index.mjs +1507 -1590
  127. package/components/data/list/fesm2022/index.mjs.map +1 -1
  128. package/components/data/list/types/index.d.ts +300 -283
  129. package/components/data/live-table/bundles/index.umd.js +299 -280
  130. package/components/data/live-table/fesm2022/index.mjs +284 -270
  131. package/components/data/live-table/fesm2022/index.mjs.map +1 -1
  132. package/components/data/live-table/types/index.d.ts +42 -39
  133. package/components/data/pagination/bundles/index.umd.js +848 -881
  134. package/components/data/pagination/fesm2022/index.mjs +835 -879
  135. package/components/data/pagination/fesm2022/index.mjs.map +1 -1
  136. package/components/data/pagination/types/index.d.ts +110 -106
  137. package/components/data/table/bundles/index.umd.js +4977 -5042
  138. package/components/data/table/fesm2022/index.mjs +4937 -5007
  139. package/components/data/table/fesm2022/index.mjs.map +1 -1
  140. package/components/data/table/types/index.d.ts +770 -736
  141. package/components/dialogs/alert-dialog/bundles/index.umd.js +259 -118
  142. package/components/dialogs/alert-dialog/fesm2022/index.mjs +243 -109
  143. package/components/dialogs/alert-dialog/fesm2022/index.mjs.map +1 -1
  144. package/components/dialogs/alert-dialog/types/index.d.ts +31 -26
  145. package/components/dialogs/confirm-dialog/bundles/index.umd.js +250 -121
  146. package/components/dialogs/confirm-dialog/fesm2022/index.mjs +236 -114
  147. package/components/dialogs/confirm-dialog/fesm2022/index.mjs.map +1 -1
  148. package/components/dialogs/confirm-dialog/types/index.d.ts +34 -29
  149. package/components/dialogs/default/bundles/index.umd.js +509 -373
  150. package/components/dialogs/default/fesm2022/index.mjs +485 -354
  151. package/components/dialogs/default/fesm2022/index.mjs.map +1 -1
  152. package/components/dialogs/default/types/index.d.ts +129 -86
  153. package/components/dialogs/design-dialog/bundles/index.umd.js +320 -142
  154. package/components/dialogs/design-dialog/fesm2022/index.mjs +305 -132
  155. package/components/dialogs/design-dialog/fesm2022/index.mjs.map +1 -1
  156. package/components/dialogs/design-dialog/types/index.d.ts +31 -20
  157. package/components/dialogs/iframe-dialog/bundles/index.umd.js +258 -111
  158. package/components/dialogs/iframe-dialog/fesm2022/index.mjs +245 -105
  159. package/components/dialogs/iframe-dialog/fesm2022/index.mjs.map +1 -1
  160. package/components/dialogs/iframe-dialog/types/index.d.ts +27 -22
  161. package/components/dialogs/login-dialog/bundles/index.umd.js +139 -106
  162. package/components/dialogs/login-dialog/fesm2022/index.mjs +125 -97
  163. package/components/dialogs/login-dialog/fesm2022/index.mjs.map +1 -1
  164. package/components/dialogs/login-dialog/types/index.d.ts +27 -26
  165. package/components/dialogs/partial-dialog/bundles/index.umd.js +302 -149
  166. package/components/dialogs/partial-dialog/fesm2022/index.mjs +289 -143
  167. package/components/dialogs/partial-dialog/fesm2022/index.mjs.map +1 -1
  168. package/components/dialogs/partial-dialog/types/index.d.ts +37 -32
  169. package/components/input/base-form/bundles/index.umd.js +143 -139
  170. package/components/input/base-form/fesm2022/index.mjs +129 -130
  171. package/components/input/base-form/fesm2022/index.mjs.map +1 -1
  172. package/components/input/base-form/types/index.d.ts +28 -29
  173. package/components/input/base-form-custom/bundles/index.umd.js +107 -121
  174. package/components/input/base-form-custom/fesm2022/index.mjs +88 -107
  175. package/components/input/base-form-custom/fesm2022/index.mjs.map +1 -1
  176. package/components/input/base-form-custom/types/index.d.ts +23 -26
  177. package/components/input/button/bundles/index.umd.js +177 -89
  178. package/components/input/button/fesm2022/index.mjs +158 -75
  179. package/components/input/button/fesm2022/index.mjs.map +1 -1
  180. package/components/input/button/types/index.d.ts +24 -25
  181. package/components/input/button-group/bundles/index.umd.js +110 -72
  182. package/components/input/button-group/fesm2022/index.mjs +90 -57
  183. package/components/input/button-group/fesm2022/index.mjs.map +1 -1
  184. package/components/input/button-group/types/index.d.ts +13 -14
  185. package/components/input/calendar/bundles/index.umd.js +615 -647
  186. package/components/input/calendar/fesm2022/index.mjs +596 -649
  187. package/components/input/calendar/fesm2022/index.mjs.map +1 -1
  188. package/components/input/calendar/types/index.d.ts +130 -131
  189. package/components/input/caption-position/bundles/index.umd.js +175 -188
  190. package/components/input/caption-position/fesm2022/index.mjs +159 -177
  191. package/components/input/caption-position/fesm2022/index.mjs.map +1 -1
  192. package/components/input/caption-position/types/index.d.ts +31 -34
  193. package/components/input/checkbox/bundles/index.umd.js +339 -200
  194. package/components/input/checkbox/fesm2022/index.mjs +319 -185
  195. package/components/input/checkbox/fesm2022/index.mjs.map +1 -1
  196. package/components/input/checkbox/types/index.d.ts +46 -41
  197. package/components/input/checkboxset/bundles/index.umd.js +256 -170
  198. package/components/input/checkboxset/fesm2022/index.mjs +242 -161
  199. package/components/input/checkboxset/fesm2022/index.mjs.map +1 -1
  200. package/components/input/checkboxset/types/index.d.ts +26 -27
  201. package/components/input/chips/bundles/index.umd.js +721 -733
  202. package/components/input/chips/fesm2022/index.mjs +706 -723
  203. package/components/input/chips/fesm2022/index.mjs.map +1 -1
  204. package/components/input/chips/types/index.d.ts +101 -90
  205. package/components/input/color-picker/bundles/index.umd.js +312 -137
  206. package/components/input/color-picker/fesm2022/index.mjs +296 -126
  207. package/components/input/color-picker/fesm2022/index.mjs.map +1 -1
  208. package/components/input/color-picker/types/index.d.ts +35 -36
  209. package/components/input/composite/bundles/index.umd.js +127 -112
  210. package/components/input/composite/fesm2022/index.mjs +106 -96
  211. package/components/input/composite/fesm2022/index.mjs.map +1 -1
  212. package/components/input/composite/types/index.d.ts +26 -27
  213. package/components/input/currency/bundles/index.umd.js +237 -104
  214. package/components/input/currency/fesm2022/index.mjs +219 -91
  215. package/components/input/currency/fesm2022/index.mjs.map +1 -1
  216. package/components/input/currency/types/index.d.ts +30 -31
  217. package/components/input/dataset-aware-form/bundles/index.umd.js +298 -346
  218. package/components/input/dataset-aware-form/fesm2022/index.mjs +286 -339
  219. package/components/input/dataset-aware-form/fesm2022/index.mjs.map +1 -1
  220. package/components/input/dataset-aware-form/types/index.d.ts +80 -80
  221. package/components/input/epoch/base-date-time/bundles/index.umd.js +809 -1081
  222. package/components/input/epoch/base-date-time/fesm2022/index.mjs +796 -1073
  223. package/components/input/epoch/base-date-time/fesm2022/index.mjs.map +1 -1
  224. package/components/input/epoch/base-date-time/types/index.d.ts +244 -247
  225. package/components/input/epoch/date/bundles/index.umd.js +619 -513
  226. package/components/input/epoch/date/fesm2022/index.mjs +604 -503
  227. package/components/input/epoch/date/fesm2022/index.mjs.map +1 -1
  228. package/components/input/epoch/date/types/index.d.ts +63 -64
  229. package/components/input/epoch/date-time/bundles/index.umd.js +682 -511
  230. package/components/input/epoch/date-time/fesm2022/index.mjs +672 -506
  231. package/components/input/epoch/date-time/fesm2022/index.mjs.map +1 -1
  232. package/components/input/epoch/date-time/types/index.d.ts +111 -112
  233. package/components/input/epoch/date-time-picker/bundles/index.umd.js +417 -321
  234. package/components/input/epoch/date-time-picker/fesm2022/index.mjs +405 -314
  235. package/components/input/epoch/date-time-picker/fesm2022/index.mjs.map +1 -1
  236. package/components/input/epoch/date-time-picker/types/index.d.ts +135 -80
  237. package/components/input/epoch/picker/bundles/index.umd.js +201 -148
  238. package/components/input/epoch/picker/fesm2022/index.mjs +183 -135
  239. package/components/input/epoch/picker/fesm2022/index.mjs.map +1 -1
  240. package/components/input/epoch/picker/types/index.d.ts +46 -38
  241. package/components/input/epoch/time/bundles/index.umd.js +534 -392
  242. package/components/input/epoch/time/fesm2022/index.mjs +523 -386
  243. package/components/input/epoch/time/fesm2022/index.mjs.map +1 -1
  244. package/components/input/epoch/time/types/index.d.ts +107 -108
  245. package/components/input/file-upload/bundles/index.umd.js +500 -477
  246. package/components/input/file-upload/fesm2022/index.mjs +484 -466
  247. package/components/input/file-upload/fesm2022/index.mjs.map +1 -1
  248. package/components/input/file-upload/types/index.d.ts +110 -109
  249. package/components/input/number/bundles/index.umd.js +241 -101
  250. package/components/input/number/fesm2022/index.mjs +224 -89
  251. package/components/input/number/fesm2022/index.mjs.map +1 -1
  252. package/components/input/number/types/index.d.ts +28 -29
  253. package/components/input/radioset/bundles/index.umd.js +240 -156
  254. package/components/input/radioset/fesm2022/index.mjs +226 -147
  255. package/components/input/radioset/fesm2022/index.mjs.map +1 -1
  256. package/components/input/radioset/types/index.d.ts +25 -26
  257. package/components/input/rating/bundles/index.umd.js +353 -266
  258. package/components/input/rating/fesm2022/index.mjs +337 -255
  259. package/components/input/rating/fesm2022/index.mjs.map +1 -1
  260. package/components/input/rating/types/index.d.ts +52 -53
  261. package/components/input/select/bundles/index.umd.js +295 -217
  262. package/components/input/select/fesm2022/index.mjs +280 -207
  263. package/components/input/select/fesm2022/index.mjs.map +1 -1
  264. package/components/input/select/types/index.d.ts +38 -39
  265. package/components/input/slider/bundles/index.umd.js +316 -197
  266. package/components/input/slider/fesm2022/index.mjs +297 -183
  267. package/components/input/slider/fesm2022/index.mjs.map +1 -1
  268. package/components/input/slider/types/index.d.ts +43 -44
  269. package/components/input/switch/bundles/index.umd.js +257 -219
  270. package/components/input/switch/fesm2022/index.mjs +243 -210
  271. package/components/input/switch/fesm2022/index.mjs.map +1 -1
  272. package/components/input/switch/types/index.d.ts +34 -35
  273. package/components/input/text/bundles/index.umd.js +1585 -1120
  274. package/components/input/text/fesm2022/index.mjs +1542 -1082
  275. package/components/input/text/fesm2022/index.mjs.map +1 -1
  276. package/components/input/text/types/index.d.ts +313 -310
  277. package/components/input/textarea/bundles/index.umd.js +224 -100
  278. package/components/input/textarea/fesm2022/index.mjs +207 -88
  279. package/components/input/textarea/fesm2022/index.mjs.map +1 -1
  280. package/components/input/textarea/types/index.d.ts +32 -33
  281. package/components/navigation/breadcrumb/bundles/index.umd.js +205 -131
  282. package/components/navigation/breadcrumb/fesm2022/index.mjs +188 -118
  283. package/components/navigation/breadcrumb/fesm2022/index.mjs.map +1 -1
  284. package/components/navigation/breadcrumb/types/index.d.ts +29 -28
  285. package/components/navigation/menu/bundles/index.umd.js +1461 -950
  286. package/components/navigation/menu/fesm2022/index.mjs +1416 -910
  287. package/components/navigation/menu/fesm2022/index.mjs.map +1 -1
  288. package/components/navigation/menu/types/index.d.ts +220 -193
  289. package/components/navigation/navbar/bundles/index.umd.js +172 -79
  290. package/components/navigation/navbar/fesm2022/index.mjs +155 -67
  291. package/components/navigation/navbar/fesm2022/index.mjs.map +1 -1
  292. package/components/navigation/navbar/types/index.d.ts +19 -20
  293. package/components/navigation/popover/bundles/index.umd.js +543 -519
  294. package/components/navigation/popover/fesm2022/index.mjs +524 -505
  295. package/components/navigation/popover/fesm2022/index.mjs.map +1 -1
  296. package/components/navigation/popover/types/index.d.ts +86 -86
  297. package/components/page/default/bundles/index.umd.js +634 -451
  298. package/components/page/default/fesm2022/index.mjs +600 -422
  299. package/components/page/default/fesm2022/index.mjs.map +1 -1
  300. package/components/page/default/types/index.d.ts +123 -119
  301. package/components/page/footer/bundles/index.umd.js +91 -63
  302. package/components/page/footer/fesm2022/index.mjs +71 -48
  303. package/components/page/footer/fesm2022/index.mjs.map +1 -1
  304. package/components/page/footer/types/index.d.ts +11 -12
  305. package/components/page/header/bundles/index.umd.js +96 -59
  306. package/components/page/header/fesm2022/index.mjs +76 -44
  307. package/components/page/header/fesm2022/index.mjs.map +1 -1
  308. package/components/page/header/types/index.d.ts +12 -13
  309. package/components/page/left-panel/bundles/index.umd.js +405 -407
  310. package/components/page/left-panel/fesm2022/index.mjs +386 -393
  311. package/components/page/left-panel/fesm2022/index.mjs.map +1 -1
  312. package/components/page/left-panel/types/index.d.ts +47 -40
  313. package/components/page/right-panel/bundles/index.umd.js +115 -78
  314. package/components/page/right-panel/fesm2022/index.mjs +96 -64
  315. package/components/page/right-panel/fesm2022/index.mjs.map +1 -1
  316. package/components/page/right-panel/types/index.d.ts +14 -13
  317. package/components/page/top-nav/bundles/index.umd.js +91 -60
  318. package/components/page/top-nav/fesm2022/index.mjs +73 -47
  319. package/components/page/top-nav/fesm2022/index.mjs.map +1 -1
  320. package/components/page/top-nav/types/index.d.ts +11 -12
  321. package/components/prefab/bundles/index.umd.js +253 -173
  322. package/components/prefab/fesm2022/index.mjs +233 -158
  323. package/components/prefab/fesm2022/index.mjs.map +1 -1
  324. package/components/prefab/types/index.d.ts +35 -33
  325. package/core/bundles/index.umd.js +4466 -5642
  326. package/core/fesm2022/index.mjs +3997 -5202
  327. package/core/fesm2022/index.mjs.map +1 -1
  328. package/core/types/index.d.ts +1785 -1808
  329. package/http/bundles/index.umd.js +339 -413
  330. package/http/fesm2022/index.mjs +323 -402
  331. package/http/fesm2022/index.mjs.map +1 -1
  332. package/http/types/index.d.ts +107 -112
  333. package/locales/moment/am-et.js +73 -0
  334. package/locales/moment/bm.js +2 -0
  335. package/locales/moment/ca.js +1 -1
  336. package/locales/moment/de-at.js +29 -1
  337. package/locales/moment/de-ch.js +29 -1
  338. package/locales/moment/de.js +29 -1
  339. package/locales/moment/hu.js +3 -3
  340. package/locales/moment/id.js +12 -1
  341. package/locales/moment/ka.js +1 -1
  342. package/locales/moment/mk.js +0 -1
  343. package/locales/moment/nl-be.js +1 -1
  344. package/locales/moment/pl.js +1 -1
  345. package/locales/moment/ps.js +188 -0
  346. package/locales/moment/pt-br.js +14 -6
  347. package/locales/moment/sv.js +1 -1
  348. package/locales/moment/sw.js +56 -14
  349. package/locales/moment/uk.js +5 -4
  350. package/locales/moment/uz-latn.js +1 -1
  351. package/locales/moment/uz.js +1 -1
  352. package/npm-shrinkwrap.json +2 -2
  353. package/oAuth/bundles/index.umd.js +326 -483
  354. package/oAuth/fesm2022/index.mjs +267 -429
  355. package/oAuth/fesm2022/index.mjs.map +1 -1
  356. package/oAuth/types/index.d.ts +22 -26
  357. package/package-lock.json +2 -2
  358. package/package.json +1 -1
  359. package/runtime/base/bundles/index.umd.js +6380 -6093
  360. package/runtime/base/fesm2022/index.mjs +6368 -6107
  361. package/runtime/base/fesm2022/index.mjs.map +1 -1
  362. package/runtime/base/types/index.d.ts +1336 -1359
  363. package/runtime/dynamic/bundles/index.umd.js +1215 -851
  364. package/runtime/dynamic/fesm2022/index.mjs +1253 -898
  365. package/runtime/dynamic/fesm2022/index.mjs.map +1 -1
  366. package/runtime/dynamic/types/index.d.ts +140 -128
  367. package/scripts/datatable/datatable.js +20 -30
  368. package/security/bundles/index.umd.js +297 -438
  369. package/security/fesm2022/index.mjs +282 -443
  370. package/security/fesm2022/index.mjs.map +1 -1
  371. package/security/types/index.d.ts +127 -130
  372. package/swipey/bundles/index.umd.js +57 -48
  373. package/swipey/fesm2022/index.mjs +55 -50
  374. package/swipey/fesm2022/index.mjs.map +1 -1
  375. package/swipey/types/index.d.ts +19 -21
  376. package/transpiler/bundles/index.umd.js +1174 -811
  377. package/transpiler/fesm2022/index.mjs +1109 -757
  378. package/transpiler/fesm2022/index.mjs.map +1 -1
  379. package/transpiler/types/index.d.ts +32 -36
  380. package/variables/bundles/index.umd.js +2226 -3245
  381. package/variables/fesm2022/index.mjs +2117 -3237
  382. package/variables/fesm2022/index.mjs.map +1 -1
  383. package/variables/types/index.d.ts +410 -393
  384. package/build-task/.npmignore +0 -2
  385. package/components/advanced/carousel/.npmignore +0 -2
  386. package/components/advanced/custom/.npmignore +0 -2
  387. package/components/advanced/login/.npmignore +0 -2
  388. package/components/advanced/marquee/.npmignore +0 -2
  389. package/components/base/.npmignore +0 -2
  390. package/components/basic/anchor/.npmignore +0 -2
  391. package/components/basic/audio/.npmignore +0 -2
  392. package/components/basic/html/.npmignore +0 -2
  393. package/components/basic/icon/.npmignore +0 -2
  394. package/components/basic/iframe/.npmignore +0 -2
  395. package/components/basic/label/.npmignore +0 -2
  396. package/components/basic/picture/.npmignore +0 -2
  397. package/components/basic/progress/progress-bar/.npmignore +0 -2
  398. package/components/basic/progress/progress-circle/.npmignore +0 -2
  399. package/components/basic/progress/progress-utils/.npmignore +0 -2
  400. package/components/basic/rich-text-editor/.npmignore +0 -2
  401. package/components/basic/search/.npmignore +0 -2
  402. package/components/basic/spinner/.npmignore +0 -2
  403. package/components/basic/tree/.npmignore +0 -2
  404. package/components/basic/video/.npmignore +0 -2
  405. package/components/chart/.npmignore +0 -2
  406. package/components/containers/accordion/.npmignore +0 -2
  407. package/components/containers/layout-grid/.npmignore +0 -2
  408. package/components/containers/linear-layout/.npmignore +0 -2
  409. package/components/containers/panel/.npmignore +0 -2
  410. package/components/containers/tabs/.npmignore +0 -2
  411. package/components/containers/tile/.npmignore +0 -2
  412. package/components/containers/wizard/.npmignore +0 -2
  413. package/components/data/card/.npmignore +0 -2
  414. package/components/data/form/.npmignore +0 -2
  415. package/components/data/list/.npmignore +0 -2
  416. package/components/data/live-table/.npmignore +0 -2
  417. package/components/data/pagination/.npmignore +0 -2
  418. package/components/data/table/.npmignore +0 -2
  419. package/components/dialogs/alert-dialog/.npmignore +0 -2
  420. package/components/dialogs/confirm-dialog/.npmignore +0 -2
  421. package/components/dialogs/default/.npmignore +0 -2
  422. package/components/dialogs/design-dialog/.npmignore +0 -2
  423. package/components/dialogs/iframe-dialog/.npmignore +0 -2
  424. package/components/dialogs/login-dialog/.npmignore +0 -2
  425. package/components/dialogs/partial-dialog/.npmignore +0 -2
  426. package/components/input/base-form/.npmignore +0 -2
  427. package/components/input/base-form-custom/.npmignore +0 -2
  428. package/components/input/button/.npmignore +0 -2
  429. package/components/input/button-group/.npmignore +0 -2
  430. package/components/input/calendar/.npmignore +0 -2
  431. package/components/input/caption-position/.npmignore +0 -2
  432. package/components/input/checkbox/.npmignore +0 -2
  433. package/components/input/checkboxset/.npmignore +0 -2
  434. package/components/input/chips/.npmignore +0 -2
  435. package/components/input/color-picker/.npmignore +0 -2
  436. package/components/input/composite/.npmignore +0 -2
  437. package/components/input/currency/.npmignore +0 -2
  438. package/components/input/dataset-aware-form/.npmignore +0 -2
  439. package/components/input/epoch/base-date-time/.npmignore +0 -2
  440. package/components/input/epoch/date/.npmignore +0 -2
  441. package/components/input/epoch/date-time/.npmignore +0 -2
  442. package/components/input/epoch/date-time-picker/.npmignore +0 -2
  443. package/components/input/epoch/picker/.npmignore +0 -2
  444. package/components/input/epoch/time/.npmignore +0 -2
  445. package/components/input/file-upload/.npmignore +0 -2
  446. package/components/input/number/.npmignore +0 -2
  447. package/components/input/radioset/.npmignore +0 -2
  448. package/components/input/rating/.npmignore +0 -2
  449. package/components/input/select/.npmignore +0 -2
  450. package/components/input/slider/.npmignore +0 -2
  451. package/components/input/switch/.npmignore +0 -2
  452. package/components/input/text/.npmignore +0 -2
  453. package/components/input/textarea/.npmignore +0 -2
  454. package/components/navigation/breadcrumb/.npmignore +0 -2
  455. package/components/navigation/menu/.npmignore +0 -2
  456. package/components/navigation/navbar/.npmignore +0 -2
  457. package/components/navigation/popover/.npmignore +0 -2
  458. package/components/page/default/.npmignore +0 -2
  459. package/components/page/footer/.npmignore +0 -2
  460. package/components/page/header/.npmignore +0 -2
  461. package/components/page/left-panel/.npmignore +0 -2
  462. package/components/page/right-panel/.npmignore +0 -2
  463. package/components/page/top-nav/.npmignore +0 -2
  464. package/components/prefab/.npmignore +0 -2
  465. package/core/.npmignore +0 -2
  466. package/http/.npmignore +0 -2
  467. package/oAuth/.npmignore +0 -2
  468. package/runtime/base/.npmignore +0 -2
  469. package/runtime/dynamic/.npmignore +0 -2
  470. package/security/.npmignore +0 -2
  471. package/swipey/.npmignore +0 -2
  472. package/transpiler/.npmignore +0 -2
  473. package/variables/.npmignore +0 -2
@@ -1,1607 +1,1529 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib'), require('@angular/common'), require('@wm/components/base'), require('@angular/core'), require('@wm/core'), require('@wm/components/data/pagination'), require('@wm/components/input/button'), require('rxjs'), require('@wm/components/input/base-form'), require('lodash-es')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'tslib', '@angular/common', '@wm/components/base', '@angular/core', '@wm/core', '@wm/components/data/pagination', '@wm/components/input/button', 'rxjs', '@wm/components/input/base-form', '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.tslib, global.ng.common, global.wm.components.base, global.ng.core, global.wm.core, global.wm.components.data.pagination, global.wm.components.input.button, global.rxjs, global.wm.components.input.baseForm, global._));
5
- })(this, (function (exports, tslib, i3, i1, i0, i2, pagination, button, rxjs, baseForm, lodashEs) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib'), require('@angular/common'), require('@wm/components/base'), require('@angular/core'), require('@wm/core'), require('@wm/components/data/pagination'), require('@wm/components/input/button'), require('rxjs'), require('@wm/components/input/base-form'), require('lodash-es')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'tslib', '@angular/common', '@wm/components/base', '@angular/core', '@wm/core', '@wm/components/data/pagination', '@wm/components/input/button', 'rxjs', '@wm/components/input/base-form', '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.tslib, global.ng.common, global.wm.components.base, global.ng.core, global.wm.core, global.wm.components.data.pagination, global.wm.components.input.button, global.rxjs, global.wm.components.input.baseForm, global._));
5
+ })(this, (function (exports, tslib, i3, i1, i0, i1$1, pagination, button, rxjs, baseForm, lodashEs) { 'use strict';
6
6
 
7
- function _interopNamespaceDefault(e) {
8
- var n = Object.create(null);
9
- if (e) {
10
- Object.keys(e).forEach(function (k) {
11
- if (k !== 'default') {
12
- var d = Object.getOwnPropertyDescriptor(e, k);
13
- Object.defineProperty(n, k, d.get ? d : {
14
- enumerable: true,
15
- get: function () { return e[k]; }
16
- });
17
- }
18
- });
19
- }
20
- n.default = e;
21
- return Object.freeze(n);
22
- }
7
+ function _interopNamespaceDefault(e) {
8
+ var n = Object.create(null);
9
+ if (e) {
10
+ Object.keys(e).forEach(function (k) {
11
+ if (k !== 'default') {
12
+ var d = Object.getOwnPropertyDescriptor(e, k);
13
+ Object.defineProperty(n, k, d.get ? d : {
14
+ enumerable: true,
15
+ get: function () { return e[k]; }
16
+ });
17
+ }
18
+ });
19
+ }
20
+ n.default = e;
21
+ return Object.freeze(n);
22
+ }
23
23
 
24
- var i3__namespace = /*#__PURE__*/_interopNamespaceDefault(i3);
25
- var i1__namespace = /*#__PURE__*/_interopNamespaceDefault(i1);
26
- var i0__namespace = /*#__PURE__*/_interopNamespaceDefault(i0);
27
- var i2__namespace = /*#__PURE__*/_interopNamespaceDefault(i2);
24
+ var i3__namespace = /*#__PURE__*/_interopNamespaceDefault(i3);
25
+ var i1__namespace = /*#__PURE__*/_interopNamespaceDefault(i1);
26
+ var i0__namespace = /*#__PURE__*/_interopNamespaceDefault(i0);
27
+ var i1$1__namespace = /*#__PURE__*/_interopNamespaceDefault(i1$1);
28
28
 
29
- const registerProps$1 = () => {
30
- i1.register('wm-list', new Map([
31
- ['boundarylinks', { value: false, ...i1.PROP_BOOLEAN }],
32
- ['class', i1.PROP_STRING],
33
- ['collapsible', i1.PROP_BOOLEAN],
34
- ['dateformat', i1.PROP_STRING],
35
- ['dataset', i1.PROP_ANY],
36
- ['datasource', i1.PROP_ANY],
37
- ['direction', { value: 'vertical', ...i1.PROP_STRING }],
38
- ['directionlinks', { value: true, ...i1.PROP_BOOLEAN }],
39
- ['disableitem', i1.PROP_BOOLEAN],
40
- ['enablereorder', i1.PROP_BOOLEAN],
41
- ['forceellipses', { value: true, ...i1.PROP_BOOLEAN }],
42
- ['groupby', i1.PROP_STRING],
43
- ['iconclass', i1.PROP_STRING],
44
- ['iconurl', i1.PROP_STRING],
45
- ['itemclass', { value: '', ...i1.PROP_STRING }],
46
- ['itemsperrow', i1.PROP_STRING],
47
- ['listclass', { value: 'list-group', ...i1.PROP_STRING }],
48
- ['multiselect', i1.PROP_BOOLEAN],
49
- ['loadingdatamsg', { value: 'Loading...', ...i1.PROP_STRING }],
50
- ['loadingicon', { value: 'fa fa-circle-o-notch', ...i1.PROP_STRING }],
51
- ['loadingiconurl', i1.PROP_STRING],
52
- ['match', i1.PROP_STRING],
53
- ['maxsize', { value: 5, ...i1.PROP_NUMBER }],
54
- ['name', i1.PROP_STRING],
55
- ['navigation', i1.PROP_STRING],
56
- ['navigationalign', { value: 'left', ...i1.PROP_STRING }],
57
- ['nodatamessage', { value: 'No data found', ...i1.PROP_STRING }],
58
- ['ondemandmessage', { value: 'Load More', ...i1.PROP_STRING }],
59
- ['orderby', i1.PROP_STRING],
60
- ['paginationclass', i1.PROP_STRING],
61
- ['pagesize', i1.PROP_NUMBER],
62
- ['pulltorefresh', { value: false, ...i1.PROP_BOOLEAN }],
63
- ['selectfirstitem', i1.PROP_BOOLEAN],
64
- ['selectionlimit', i1.PROP_NUMBER],
65
- ['show', { value: true, ...i1.PROP_BOOLEAN }],
66
- ['showcount', i1.PROP_BOOLEAN],
67
- ['showrecordcount', i1.PROP_BOOLEAN],
68
- ['statehandler', { value: 'none', ...i1.PROP_STRING }],
69
- ['subheading', i1.PROP_STRING],
70
- ['tabindex', { value: 0, ...i1.PROP_NUMBER }],
71
- ['title', i1.PROP_STRING],
72
- ['allowpagesizechange', { value: false, ...i1.PROP_BOOLEAN }],
73
- ['pagesizeoptions', { value: '5,10,20,50,100', ...i1.PROP_STRING }],
74
- ...i1.AUTO_LAYOUT_PROPS
75
- ]));
76
- };
77
-
78
- const registerProps = () => {
79
- i1.register('wm-listtemplate', new Map([
80
- ...i1.AUTO_LAYOUT_PROPS
81
- ]));
82
- };
83
-
84
- /********* Will come to this later for listtemplate = container variant **********/
85
- // const DEFAULT_CLS = 'app-container';
86
- // const WIDGET_CONFIG = { widgetType: 'wm-listtemplate', hostClass: DEFAULT_CLS};
87
- const WIDGET_CONFIG$1 = { widgetType: 'wm-listtemplate' };
88
- exports.ListItemDirective = class ListItemDirective extends i1.StylableComponent {
89
- static { this.initializeProps = registerProps(); }
90
- onFocus() {
91
- // maintains which element is focused/selected most recently.
92
- this.listComponent.lastSelectedItem = this;
93
- }
94
- get $index() {
95
- return this.context.$index;
96
- }
97
- get $even() {
98
- return this.context.even;
99
- }
100
- get $odd() {
101
- return this.context.odd;
102
- }
103
- get $first() {
104
- return this.context.first;
105
- }
106
- get $last() {
107
- return this.context.last;
108
- }
109
- get currentItemWidgets() {
110
- const componentElements = Array.from(this.nativeElement.querySelectorAll('[widget-id]'));
111
- return Object.assign(this._currentItemWidgets, componentElements.reduce((result, comp) => {
112
- result[comp.widget.name] = comp.widget;
113
- return result;
114
- }, {}));
115
- }
116
- set wmListItem(val) {
117
- this.item = val;
118
- }
119
- constructor(inj, elRef, app, renderer, explicitContext) {
120
- super(inj, WIDGET_CONFIG$1, explicitContext);
121
- this.app = app;
122
- this.renderer = renderer;
123
- this.destroySub = new rxjs.Subject();
124
- this.destroy$ = this.destroySub.asObservable();
125
- this.itemClass = '';
126
- this._currentItemWidgets = {};
127
- /**
128
- * To avoid re-rendering of widget, passing unique id as contextKey to createCustomInjector
129
- */
130
- this.trackId = i1.widgetIdGenerator.nextUid();
131
- this.isActive = false;
132
- this.disableItem = false;
133
- this._viewParent = i0.inject(exports.ListComponent, { optional: true });
134
- // addClass(this.nativeElement, DEFAULT_CLS); // Will come to this later for listtemplate = container variant
135
- i1.styler(this.nativeElement, this, i1.APPLY_STYLES_TYPE.CONTAINER);
136
- this.viewContainerRef = inj.get(i0.ViewContainerRef);
137
- this.nativeElement = elRef.nativeElement;
138
- this.listComponent = this._viewParent;
139
- // this.context = (<NgForOfContext<ListItemDirective>>(<any>inj).view.context);
140
- this.context = this.inj._lView[8];
141
- //this.context = (this.viewContainerRef as any)._hostLView.find(t => t && !!t.$implicit);
142
- this.itemClassWatcher(this.listComponent);
143
- this.disableItemWatcher(this.listComponent);
144
- this.itemAttrsHandler();
145
- $(this.nativeElement).data('listItemContext', this);
146
- }
147
- /**
148
- * Applies all the list item attributes and adds a watch on postion attribute
149
- */
150
- itemAttrsHandler() {
151
- const attrsMap = this.listComponent.itemAttrsMap;
152
- if (!attrsMap) {
153
- return;
154
- }
155
- Object.keys(attrsMap).forEach(key => {
156
- const value = attrsMap[key];
157
- this.setProperty(key, value);
158
- });
159
- }
160
- registerWatch(expression, callback) {
161
- // Removing ngFor context as the same properties are availble on listitem scope.
162
- // passing viewparent context for accessing varibales and widgets.
163
- //[CSP]: expression will be generated in the component as e.g. 'item.className'
164
- this.destroy$.subscribe(i2.$watch(expression, this.listComponent.viewParent, this, callback));
165
- }
166
- itemClassWatcher(listComponent) {
167
- if (listComponent.binditemclass) {
168
- this.registerWatch(listComponent.binditemclass, nv => this.itemClass = nv || '');
169
- }
170
- else {
171
- this.itemClass = listComponent.itemclass;
172
- }
173
- }
174
- disableItemWatcher($list) {
175
- if ($list.binddisableitem) {
176
- this.registerWatch($list.binddisableitem, nv => this.disableItem = nv || false);
177
- }
178
- else {
179
- this.disableItem = $list.disableitem || false;
180
- }
181
- }
182
- setUpCUDHandlers() {
183
- const $editItem = this.nativeElement.querySelector('.edit-list-item');
184
- const $deleteItem = this.nativeElement.querySelector('.delete-list-item');
185
- if ($editItem) {
186
- // MEMORY LEAK FIX: Store bound handler for cleanup
187
- this.boundEditHandler = (evt) => {
188
- this.listComponent.update();
189
- };
190
- // Triggered on click of edit action
191
- $editItem.addEventListener('click', this.boundEditHandler);
192
- }
193
- if ($deleteItem) {
194
- // MEMORY LEAK FIX: Store bound handler for cleanup
195
- this.boundDeleteHandler = (evt) => {
196
- this.listComponent.delete();
197
- };
198
- // Triggered on click of delete action
199
- $deleteItem.addEventListener('click', this.boundDeleteHandler);
200
- }
201
- }
202
- ngOnInit() {
203
- super.ngOnInit();
204
- if (this.listComponent.mouseEnterCB) {
205
- // MEMORY LEAK FIX: Store bound handler for cleanup
206
- this.boundMouseEnterHandler = ($event) => {
207
- this.listComponent.invokeEventCallback('mouseenter', { widget: this, $event });
208
- };
209
- this.nativeElement.addEventListener('mouseenter', this.boundMouseEnterHandler);
210
- }
211
- if (this.listComponent.mouseLeaveCB) {
212
- // MEMORY LEAK FIX: Store bound handler for cleanup
213
- this.boundMouseLeaveHandler = ($event) => {
214
- this.listComponent.invokeEventCallback('mouseleave', { widget: this, $event });
215
- };
216
- this.nativeElement.addEventListener('mouseleave', this.boundMouseLeaveHandler);
217
- }
218
- // adding item attribute on every list item
219
- $(this.nativeElement).attr('listitemindex', this.$index);
220
- }
221
- ngAfterViewInit() {
222
- super.ngAfterViewInit();
223
- this.setUpCUDHandlers();
224
- const componentElements = Array.from(this.nativeElement.querySelectorAll('[widget-id]'));
225
- componentElements.forEach((component) => {
226
- if (component.widget instanceof baseForm.BaseFormComponent) {
227
- if (!component.widget.$attrs.get('datavaluesource.bind')) {
228
- component.widget.datavaluesource = this.listComponent['datasource'];
229
- }
230
- }
231
- });
232
- }
233
- ngOnDestroy() {
234
- // MEMORY LEAK FIX: Remove event listeners
235
- if (this.boundMouseEnterHandler && this.nativeElement) {
236
- try {
237
- this.nativeElement.removeEventListener('mouseenter', this.boundMouseEnterHandler);
238
- }
239
- catch (e) {
240
- // Silently handle cleanup errors
241
- }
242
- this.boundMouseEnterHandler = null;
243
- }
244
- if (this.boundMouseLeaveHandler && this.nativeElement) {
245
- try {
246
- this.nativeElement.removeEventListener('mouseleave', this.boundMouseLeaveHandler);
247
- }
248
- catch (e) {
249
- // Silently handle cleanup errors
250
- }
251
- this.boundMouseLeaveHandler = null;
252
- }
253
- if (this.nativeElement) {
254
- const $editItem = this.nativeElement.querySelector('.edit-list-item');
255
- if ($editItem && this.boundEditHandler) {
256
- try {
257
- $editItem.removeEventListener('click', this.boundEditHandler);
258
- }
259
- catch (e) {
260
- // Silently handle cleanup errors
261
- }
262
- this.boundEditHandler = null;
263
- }
264
- const $deleteItem = this.nativeElement.querySelector('.delete-list-item');
265
- if ($deleteItem && this.boundDeleteHandler) {
266
- try {
267
- $deleteItem.removeEventListener('click', this.boundDeleteHandler);
268
- }
269
- catch (e) {
270
- // Silently handle cleanup errors
271
- }
272
- this.boundDeleteHandler = null;
273
- }
274
- }
275
- // MEMORY LEAK FIX: Clear context to release references
276
- if (this.context) {
277
- Object.keys(this.context).forEach(key => {
278
- delete this.context[key];
279
- });
280
- this.context = null;
281
- }
282
- // MEMORY LEAK FIX: Clear ViewContainerRef reference
283
- if (this.viewContainerRef) {
284
- this.viewContainerRef = null;
285
- }
286
- // MEMORY LEAK FIX: Complete the destroy subject
287
- if (this.destroySub) {
288
- try {
289
- if (!this.destroySub.closed) {
290
- this.destroySub.next(null);
291
- this.destroySub.complete();
292
- }
293
- }
294
- catch (e) {
295
- // Silently handle cleanup errors
296
- }
297
- this.destroySub = null;
298
- }
299
- super.ngOnDestroy();
300
- }
301
- static { this.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0__namespace, type: ListItemDirective, deps: [{ token: i0__namespace.Injector }, { token: i0__namespace.ElementRef }, { token: i2__namespace.App }, { token: i0__namespace.Renderer2 }, { token: 'EXPLICIT_CONTEXT', optional: true }], target: i0__namespace.ɵɵFactoryTarget.Directive }); }
302
- static { this.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.21", type: ListItemDirective, isStandalone: true, selector: "[wmListItem]", inputs: { wmListItem: "wmListItem" }, host: { listeners: { "focus": "onFocus()" }, properties: { "class.active": "this.isActive", "class.disable-item": "this.disableItem" } }, exportAs: ["listItemRef"], usesInheritance: true, ngImport: i0__namespace }); }
303
- };
304
- exports.ListItemDirective = tslib.__decorate([
305
- i1.AutoLayout({ bindParent: 'listComponent.viewParent' }),
306
- tslib.__metadata("design:paramtypes", [i0.Injector, i0.ElementRef, i2.App, i0.Renderer2, Object])
307
- ], exports.ListItemDirective);
308
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0__namespace, type: exports.ListItemDirective, decorators: [{
309
- type: i0.Directive,
310
- args: [{
311
- standalone: true,
312
- selector: '[wmListItem]',
313
- exportAs: 'listItemRef'
314
- }]
315
- }], ctorParameters: () => [{ type: i0__namespace.Injector }, { type: i0__namespace.ElementRef }, { type: i2__namespace.App }, { type: i0__namespace.Renderer2 }, { type: undefined, decorators: [{
316
- type: i0.Inject,
317
- args: ['EXPLICIT_CONTEXT']
318
- }, {
319
- type: i0.Optional
320
- }] }], propDecorators: { isActive: [{
321
- type: i0.HostBinding,
322
- args: ['class.active']
323
- }], disableItem: [{
324
- type: i0.HostBinding,
325
- args: ['class.disable-item']
326
- }], onFocus: [{
327
- type: i0.HostListener,
328
- args: ['focus']
329
- }], wmListItem: [{
330
- type: i0.Input
331
- }] } });
332
-
333
- const DEFAULT_CLS = 'app-livelist app-panel';
334
- const WIDGET_CONFIG = { widgetType: 'wm-list', hostClass: DEFAULT_CLS };
335
- exports.ListComponent = class ListComponent extends i1.StylableComponent {
336
- static { this.initializeProps = registerProps$1(); }
337
- constructor(inj, cdRef, datePipe, app, appDefaults, ngZone, binditemclass, binddisableitem, binddataset, binddatasource, mouseEnterCB, mouseLeaveCB, statePersistence, paginationService, explicitContext) {
338
- let resolveFn = i2.noop;
339
- const propsInitPromise = new Promise(res => resolveFn = res);
340
- super(inj, WIDGET_CONFIG, explicitContext, propsInitPromise);
341
- this.allowpagesizechange = false;
342
- this.itemAttrsMap = {};
343
- this.hasAutolayout = false;
344
- this.propsInitPromise = propsInitPromise;
345
- this.promiseResolverFn = resolveFn;
346
- i1.styler(this.nativeElement, this, i1.APPLY_STYLES_TYPE.SHELL);
347
- this.cdRef = cdRef;
348
- this.ngZone = ngZone;
349
- this.datePipe = datePipe;
350
- this.statePersistence = statePersistence;
351
- this.paginationService = paginationService;
352
- this._pageLoad = true;
353
- this.binditemclass = binditemclass;
354
- this.binddisableitem = binddisableitem;
355
- this.binddataset = binddataset;
356
- this.mouseEnterCB = mouseEnterCB;
357
- this.mouseLeaveCB = mouseLeaveCB;
358
- this.binddatasource = binddatasource;
359
- this.app = app;
360
- this.appDefaults = appDefaults;
361
- this.variableInflight = false;
362
- this.noDataFound = !binddataset;
363
- this.titleId = 'wmlist-' + i2.generateGUId();
364
- // Updates pagination, filter, sort etc options for service and crud variables
365
- this._listenerDestroyers = [
366
- this.app.subscribe('check-state-persistence-options', options => {
367
- let dataSourceName = lodashEs.get(this.datasource, 'name');
368
- // in Prefabs, this.datasource is not resolved at the time of variable invocation, so additional check is required.
369
- if (!dataSourceName) {
370
- dataSourceName = i1.extractDataSourceName(this.binddatasource);
371
- }
372
- if (lodashEs.get(options, 'variable.name') !== dataSourceName) {
373
- return;
374
- }
375
- this.handleStateParams(options);
376
- }),
377
- // Show loading status based on the variable life cycle
378
- this.app.subscribe('toggle-variable-state', this.handleLoading.bind(this)),
379
- this.app.subscribe('setup-cud-listener', param => {
380
- if (this.nativeElement.getAttribute('name') !== param) {
381
- return;
382
- }
383
- this._isDependent = true;
384
- })
385
- ];
386
- }
387
- get selecteditem() {
388
- if (this.multiselect) {
389
- return i2.getClonedObject(this._items);
390
- }
391
- if (lodashEs.isEmpty(this._items)) {
392
- return {};
393
- }
394
- return i2.getClonedObject(this._items[0]);
395
- }
396
- set selecteditem(items) {
397
- this._items.length = 0;
398
- this.deselectListItems();
399
- if (lodashEs.isArray(items)) {
400
- items.forEach(item => this.selectItem(item));
401
- }
402
- else {
403
- this.selectItem(items);
404
- }
405
- i2.$appDigest();
406
- }
407
- /**
408
- * Returns list of widgets present on list item by considering name and index of the widget.
409
- * If we did'nt pass index, it returns array of all the widgets which are matching to widget name
410
- * @param widgteName: Name of the widget
411
- * @param index: Index of the widget
412
- */
413
- getWidgets(widgteName, index) {
414
- let $target;
415
- const retVal = [];
416
- if (!widgteName) {
417
- return;
418
- }
419
- if (!i2.isDefined(index)) {
420
- lodashEs.forEach(this.listItems.toArray(), (el) => {
421
- $target = lodashEs.get(el.currentItemWidgets, widgteName);
422
- if ($target) {
423
- retVal.push($target);
424
- }
425
- });
426
- return retVal;
427
- }
428
- index = +index || 0;
429
- $target = lodashEs.get(this.listItems.toArray(), index);
430
- if ($target) {
431
- return [lodashEs.get($target.currentItemWidgets, widgteName)];
432
- }
433
- }
434
- // returns listitem reference by index value. This refers to the same method getListItemByIndex.
435
- getItem(index) {
436
- return this.getListItemByIndex(index);
437
- }
438
- /**
439
- * Returns index of listItem(listItemDirective / listItemObject)
440
- * If item is a directive, index is fetched from listItems
441
- * If item is an object, index is fetched from fieldDefs
442
- */
443
- getIndex(item) {
444
- if (item instanceof exports.ListItemDirective) {
445
- return this.getListItemIndex(item);
446
- }
447
- else if (item) {
448
- return this.fieldDefs.findIndex((obj) => lodashEs.isEqual(obj, item));
449
- }
450
- }
451
- getUpdatedPageSize() {
452
- return this.updatedPageSize;
453
- }
454
- create() {
455
- if (this._isDependent) {
456
- this.triggerWMEvent('insert');
457
- }
458
- }
459
- editRow(item) {
460
- if (this._isDependent) {
461
- let listItem;
462
- if (item) {
463
- listItem = this.getItemRefByIndexOrModel(item).item;
464
- }
465
- this.triggerWMEvent('update', listItem);
466
- }
467
- }
468
- update(item) {
469
- this.editRow(item);
470
- }
471
- deleteRow(item) {
472
- if (this._isDependent) {
473
- let listItem;
474
- if (item) {
475
- listItem = this.getItemRefByIndexOrModel(item).item;
476
- }
477
- this.triggerWMEvent('delete', listItem);
478
- }
479
- }
480
- delete(item) {
481
- this.deleteRow(item);
482
- }
483
- handleLoading(data) {
484
- const dataSource = this.datasource;
485
- if (dataSource?.execute(i2.DataSource.Operation.IS_API_AWARE) && i2.isDataSourceEqual(data.variable, dataSource)) {
486
- this.ngZone.run(() => {
487
- this.handleStateParams(data);
488
- this.variableInflight = data.active;
489
- // Fix for [WMS-23772] Update nodatafound flag once the response is recieved from the server
490
- const totalEle = data.data?.pagination?.totalElements;
491
- if (!lodashEs.isUndefined(totalEle)) {
492
- this.noDataFound = totalEle === 0 ? true : false;
493
- }
494
- else { // totalelements is undefined
495
- this.noDataFound = lodashEs.isEmpty(data.data?.data);
496
- }
497
- });
498
- }
499
- }
500
- triggerListItemSelection($el, $event) {
501
- if ($el?.[0]) {
502
- const listItemContext = $el.data('listItemContext');
503
- // Trigger click event only if the list item is from the corresponding list.
504
- if (listItemContext.listComponent === this) {
505
- this.onItemClick($event, listItemContext);
506
- }
507
- }
508
- }
509
- // this method is called form other data widgets like table.
510
- execute(operation, options) {
511
- if ([i2.DataSource.Operation.IS_API_AWARE, i2.DataSource.Operation.IS_PAGEABLE, i2.DataSource.Operation.SUPPORTS_SERVER_FILTER].includes(operation)) {
512
- return false;
513
- }
514
- return this.datasource.execute(operation, options);
515
- }
516
- handleKeyDown($event, action) {
517
- $event.stopPropagation();
518
- if ($event.keyCode !== 13 && $event.keyCode !== 9 && !(($event.target.classList.contains('form-control') || $event.target.classList.contains('note-editable')) && $event.keyCode === 32)) {
519
- $event.preventDefault();
520
- }
521
- const listItems = this.listItems;
522
- let presentIndex = this.getListItemIndex(this.lastSelectedItem);
523
- if (this.multiselect) {
524
- const firstIndex = this.getListItemIndex(this.firstSelectedItem);
525
- const selectCount = lodashEs.isArray(this.selecteditem) ? this.selecteditem.length : (i2.isObject(this.selecteditem) ? 1 : 0);
526
- if (action === 'selectPrev') {
527
- if (presentIndex > 0) {
528
- if ((presentIndex <= firstIndex) && this.checkSelectionLimit(selectCount)) {
529
- this.lastSelectedItem = this.getListItemByIndex(presentIndex - 1);
530
- this.toggleListItemSelection(this.lastSelectedItem);
531
- }
532
- else if (presentIndex > firstIndex) {
533
- this.toggleListItemSelection(this.getListItemByIndex(presentIndex));
534
- this.lastSelectedItem = this.getListItemByIndex(presentIndex - 1);
535
- }
536
- else {
537
- this.invokeEventCallback('selectionlimitexceed', { $event });
538
- }
539
- }
540
- }
541
- else if (action === 'selectNext') {
542
- if (presentIndex < listItems.length - 1) {
543
- if ((presentIndex >= firstIndex) && this.checkSelectionLimit(selectCount)) {
544
- this.lastSelectedItem = this.getListItemByIndex(presentIndex + 1);
545
- this.toggleListItemSelection(this.lastSelectedItem);
546
- }
547
- else if (presentIndex < firstIndex) {
548
- this.toggleListItemSelection(this.getListItemByIndex(presentIndex));
549
- this.lastSelectedItem = this.getListItemByIndex(presentIndex + 1);
550
- }
551
- else {
552
- this.invokeEventCallback('selectionlimitexceed', { $event });
553
- }
554
- }
555
- }
556
- }
557
- if (action === 'focusPrev') {
558
- if (this.isListElementMovable) {
559
- presentIndex = presentIndex <= 0 ? 0 : (presentIndex);
560
- if (presentIndex === 0) {
561
- return;
562
- }
563
- this.lastSelectedItem = this.getListItemByIndex(presentIndex);
564
- const prevElt = this.getListItemByIndex(presentIndex - 1);
565
- prevElt.nativeElement.before(this.lastSelectedItem.nativeElement);
566
- this.lastSelectedItem.nativeElement.focus();
567
- this.statePersistence.removeWidgetState(this, 'selectedItem');
568
- const arr = this.listItems.toArray();
569
- [arr[presentIndex - 1], arr[presentIndex]] = [arr[presentIndex], arr[presentIndex - 1]];
570
- this.listItems.reset(arr);
571
- this.currentIndex = presentIndex;
572
- this.ariaText = "selected ";
573
- }
574
- else {
575
- presentIndex = presentIndex <= 0 ? 0 : (presentIndex - 1);
576
- this.lastSelectedItem = this.getListItemByIndex(presentIndex);
577
- this.lastSelectedItem.nativeElement.focus();
578
- this.currentIndex = presentIndex + 1;
579
- this.ariaText = "selected ";
580
- }
581
- }
582
- else if (action === 'focusNext') {
583
- if (this.isListElementMovable) {
584
- presentIndex = presentIndex < (listItems.length - 1) ? (presentIndex) : (listItems.length - 1);
585
- if (presentIndex === this.listItems.length - 1) {
586
- return;
587
- }
588
- this.lastSelectedItem = this.getListItemByIndex(presentIndex);
589
- const nextElt = this.getListItemByIndex(presentIndex + 1);
590
- nextElt.nativeElement.after(this.lastSelectedItem.nativeElement);
591
- this.lastSelectedItem.nativeElement.focus();
592
- this.statePersistence.removeWidgetState(this, 'selectedItem');
593
- const arr = this.listItems.toArray();
594
- [arr[presentIndex], arr[presentIndex + 1]] = [arr[presentIndex + 1], arr[presentIndex]];
595
- this.listItems.reset(arr);
596
- this.currentIndex = presentIndex + 2;
597
- this.ariaText = "selected ";
598
- }
599
- else {
600
- presentIndex = presentIndex < (listItems.length - 1) ? (presentIndex + 1) : (listItems.length - 1);
601
- this.lastSelectedItem = this.getListItemByIndex(presentIndex);
602
- this.lastSelectedItem.nativeElement.focus();
603
- this.currentIndex = presentIndex + 1;
604
- this.ariaText = "selected ";
605
- }
606
- }
607
- else if (action === 'select') {
608
- // 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.
609
- if (presentIndex === -1 || !$($event.target).closest(this.lastSelectedItem.nativeElement)) {
610
- const $li = $($event.target).closest('li.app-list-item');
611
- const $ul = $li.closest('ul.app-livelist-container');
612
- presentIndex = $ul.find('li.app-list-item').index($li);
613
- }
614
- this.onItemClick($event, this.getListItemByIndex(presentIndex));
615
- }
616
- else if (action === 'space') {
617
- if (!this.enablereorder) {
618
- return;
619
- }
620
- this.isListElementMovable = !this.isListElementMovable;
621
- this.onItemClick($event, this.getListItemByIndex(presentIndex));
622
- this.currentIndex = presentIndex + 1;
623
- if (this.isListElementMovable) {
624
- this.ariaText = `Item ${this.currentIndex} grabbed, current position `;
625
- this.$ulEle.data('oldIndex', presentIndex);
626
- }
627
- else {
628
- this.ariaText = `Item ${this.currentIndex} dropped, final position `;
629
- this.onUpdate($event, undefined, presentIndex);
630
- }
631
- }
632
- }
633
- getActualPageSize() {
634
- return this.actualPageSize || 20;
635
- }
636
- onPropertyChange(key, nv, ov) {
637
- if (key === 'dataset') {
638
- if (!nv && this.binddatasource && !this.datasource) {
639
- return;
640
- }
641
- this.onDataSetChange(nv);
642
- }
643
- else if (key === 'datasource') {
644
- if (this.allowpagesizechange) {
645
- this.datasource.maxResults = this.pagesize || this.datasource.maxResults;
646
- }
647
- if (this.dataset) {
648
- this.onDataSetChange(this.dataset);
649
- }
650
- }
651
- else if (key === 'navigation') {
652
- // Support for older projects where navigation type was advanced instead of classic
653
- if (nv === 'Advanced') {
654
- this.navigation = 'Classic';
655
- return;
656
- }
657
- i2.switchClass(this.nativeElement, nv, ov);
658
- this.onNavigationTypeChange(nv);
659
- if (this.dataNavigator) {
660
- this.dataNavigator.navigationClass = this.paginationclass;
661
- }
662
- }
663
- else if (key === 'itemsperrow') {
664
- i2.setListClass(this);
665
- }
666
- else if (key === 'tabindex') {
667
- return;
668
- }
669
- else if (key === 'pulltorefresh' && nv) {
670
- this.app.notify('pullToRefresh:enable');
671
- this.subscribeToPullToRefresh();
672
- }
673
- else if (key === 'paginationclass') {
674
- if (this.dataNavigator) {
675
- // Adding setTimeout because in pagination component updateNavSize method is overriding navigationclass
676
- setTimeout(() => this.dataNavigator.navigationClass = nv);
677
- }
678
- }
679
- else if (key === 'pagesize') {
680
- this.actualPageSize = nv; // maintain default page size to calculate pagesize options
681
- this.setDefaultPageSize(nv);
682
- }
683
- else if (key === 'enablereorder') {
684
- if (nv && this.$ulEle) {
685
- this.$ulEle.attr('aria-describedby', this.titleId);
686
- this.configureDnD();
687
- this.$ulEle.sortable('enable');
688
- }
689
- else if (this.$ulEle && !nv) {
690
- this.$ulEle.removeAttr('aria-describedby');
691
- this.$ulEle.sortable('disable');
692
- }
693
- }
694
- else if (key === 'multiselect') {
695
- // multiselect binding is evaluated after ngAfterViewInit, so initial value may be incorrect.
696
- // Reassigning here to ensure selectedItemWidgets matches the updated multiselect value.
697
- this.selectedItemWidgets = nv ? [] : {};
698
- }
699
- else if (key === 'allowpagesizechange') {
700
- this.allowpagesizechange = nv;
701
- this.dataNavigator.allowpagesizechange = nv;
702
- }
703
- else if (key === 'pagesizeoptions') {
704
- this.prevPagesizeoptions = this.sanitizeCommaSeparatedIntegers(ov);
705
- this.pagesizeoptions = this.sanitizeCommaSeparatedIntegers(nv);
706
- if (this.allowpagesizechange)
707
- this.setDefaultPageSize(nv);
708
- }
709
- else {
710
- super.onPropertyChange(key, nv, ov);
711
- }
712
- }
713
- setDefaultPageSize(nv) {
714
- if (this.allowpagesizechange) {
715
- const widgetState = this.statePersistence.getWidgetState(this);
716
- if (lodashEs.get(widgetState, 'pagesize')) {
717
- nv = lodashEs.get(widgetState, 'pagesize');
718
- this.pagesize = nv; // updating the default pagesize to user selected pagesize
719
- }
720
- else if (this.pagesizeoptions) {
721
- nv = this.pagesizeoptions?.split(',').map(Number).sort((a, b) => a - b)[0];
722
- this.pagesize = nv;
723
- }
724
- if (this.isPageSizeOptionsChanged()) {
725
- this.dataNavigator.defaultPageSizeOptions = this.pagesizeoptions?.split(',').map(Number).sort((a, b) => a - b) || [];
726
- this.dataNavigator.pageSizeOptions = [...this.dataNavigator.defaultPageSizeOptions];
727
- }
728
- }
729
- this.updatedPageSize = nv;
730
- this.dataNavigator.updatedPageSize = nv;
731
- this.dataNavigator.options = {
732
- maxResults: nv
733
- };
734
- this.dataNavigator.widget.maxResults = nv;
735
- this.dataNavigator.maxResults = nv;
736
- if (this.datasource) {
737
- this.datasource.maxResults = this.pagesize || this.datasource.maxResults;
738
- }
739
- }
740
- isPageSizeOptionsChanged() {
741
- return !lodashEs.isEqual(this.prevPagesizeoptions, this.pagesizeoptions);
742
- }
743
- selectPageSize(pagesize) {
744
- if (!this.allowpagesizechange && !pagesize)
745
- return;
746
- if (pagesize < this.dataNavigator.pageSizeOptions[0] || pagesize > this.dataNavigator.pageSizeOptions[this.dataNavigator.pageSizeOptions.length - 1]
747
- || !this.dataNavigator.pageSizeOptions.includes(Number(pagesize))) {
748
- pagesize = this.dataNavigator.pageSizeOptions[0];
749
- }
750
- this.dataNavigator.onPageSizeChange(undefined, pagesize);
751
- }
752
- sanitizeCommaSeparatedIntegers(input) {
753
- if (!input)
754
- return "";
755
- const uniqueNumbers = Array.from(new Set(input
756
- .split(",")
757
- .map(v => v.trim())
758
- .filter(v => /^-?\d+$/.test(v))
759
- .map(v => Math.abs(parseInt(v, 10)))));
760
- return uniqueNumbers.join(",");
761
- }
762
- onItemClick(evt, $listItem) {
763
- let selectCount;
764
- if (!$listItem.disableItem) {
765
- this.firstSelectedItem = this.firstSelectedItem || $listItem;
766
- // Setting selectCount value based number of items selected.
767
- selectCount = lodashEs.isArray(this.selecteditem) ? this.selecteditem.length : (i2.isObject(this.selecteditem) ? 1 : 0);
768
- // Handling multiselect for mobile device
769
- if (this.multiselect && i2.isMobile()) {
770
- if (this.checkSelectionLimit(selectCount) || $listItem.isActive) {
771
- this.toggleListItemSelection($listItem);
772
- }
773
- else {
774
- this.invokeEventCallback('selectionlimitexceed', { $event: evt });
775
- }
776
- }
777
- else if ((evt.ctrlKey || evt.metaKey) && this.multiselect) {
778
- if (this.checkSelectionLimit(selectCount) || $listItem.isActive) {
779
- this.firstSelectedItem = this.lastSelectedItem = $listItem;
780
- this.toggleListItemSelection($listItem);
781
- }
782
- else {
783
- this.invokeEventCallback('selectionlimitexceed', { $event: evt });
784
- }
785
- }
786
- else if (evt.shiftKey && this.multiselect) {
787
- let first = $listItem.context.index;
788
- let last = this.firstSelectedItem.context.index;
789
- // if first is greater than last, then swap values
790
- if (first > last) {
791
- last = [first, first = last][0];
792
- }
793
- if (this.checkSelectionLimit(last - first)) {
794
- this.clearSelectedItems();
795
- this.listItems.forEach(($liItem) => {
796
- const index = $liItem.context.index;
797
- if (index >= first && index <= last) {
798
- this.toggleListItemSelection($liItem);
799
- }
800
- });
801
- this.lastSelectedItem = $listItem;
802
- }
803
- else {
804
- this.invokeEventCallback('selectionlimitexceed', { $event: evt });
805
- }
806
- }
807
- else if (!$listItem.isActive || selectCount > 1) {
808
- this.clearSelectedItems();
809
- this.toggleListItemSelection($listItem);
810
- this.firstSelectedItem = this.lastSelectedItem = $listItem;
811
- }
812
- i2.$appDigest();
813
- }
814
- }
815
- // Empty the list content on clear
816
- clear() {
817
- this.updateFieldDefs([]);
818
- }
819
- /**
820
- * deselects item in the list.
821
- * @param val: index | model of the list item.
822
- */
823
- deselectItem(val) {
824
- const listItem = this.getItemRefByIndexOrModel(val);
825
- if (listItem?.isActive) {
826
- this.toggleListItemSelection(listItem);
827
- }
828
- }
829
- /**
830
- * selects item in the list.
831
- * @param val: index | model of the list item.
832
- */
833
- selectItem(val, statePersistenceTriggered) {
834
- const listItem = this.getItemRefByIndexOrModel(val);
835
- if (!listItem) {
836
- return;
837
- }
838
- if (!listItem.isActive) {
839
- this.toggleListItemSelection(listItem, statePersistenceTriggered);
840
- }
841
- // focus the element.
842
- listItem.nativeElement.focus();
843
- }
844
- ngOnInit() {
845
- super.ngOnInit();
846
- this.handleHeaderClick = i2.noop;
847
- setTimeout(() => {
848
- this.debouncedFetchNextDatasetOnScroll = this.paginationService.debouncedFetchNextDatasetOnScroll(this.dataNavigator, i1.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME, this);
849
- }, 0);
850
- this._items = [];
851
- this.fieldDefs = [];
852
- this.reorderProps = {
853
- minIndex: null,
854
- maxIndex: null
855
- };
856
- // Check if the host element has any of these autolayout attributes
857
- const autoLayoutAttrs = ['wrap', 'alignment', 'gap', 'columngap'];
858
- const directionValue = this.nativeElement.getAttribute('direction');
859
- const hasAutoLayoutDirection = directionValue === 'row' || directionValue === 'column';
860
- this.hasAutolayout = hasAutoLayoutDirection || autoLayoutAttrs.some(attr => this.nativeElement.hasAttribute(attr));
861
- }
862
- ngAfterViewInit() {
863
- this.promiseResolverFn();
864
- this.propsInitPromise.then(() => {
865
- super.ngAfterViewInit();
866
- this.setUpCUDHandlers();
867
- this.selectedItemWidgets = this.multiselect ? [] : {};
868
- const ele = $(this.nativeElement).find('.app-livelist-container');
869
- if (this.enablereorder && !this.groupby) {
870
- if (ele) {
871
- ele.attr('aria-describedby', this.titleId);
872
- }
873
- this.configureDnD();
874
- }
875
- if (!this.enablereorder) {
876
- if (ele) {
877
- ele.removeAttr('aria-describedby');
878
- }
879
- }
880
- if (this.groupby && this.collapsible) {
881
- this.handleHeaderClick = i1.handleHeaderClick;
882
- this.toggleAllHeaders = i1.toggleAllHeaders.bind(undefined, this);
883
- }
884
- i2.setListClass(this);
885
- });
886
- this.setupHandlers();
887
- const $ul = this.nativeElement.querySelector('ul.app-livelist-container');
888
- i1.styler($ul, this, i1.APPLY_STYLES_TYPE.CONTAINER);
889
- if (this.enablereorder) {
890
- if ($ul) {
891
- $ul.setAttribute('aria-describedby', this.titleId);
892
- }
893
- }
894
- if (!this.enablereorder) {
895
- if ($ul) {
896
- $ul.removeAttribute('aria-describedby');
897
- }
898
- }
899
- this._readItemAttrsFromHost();
900
- }
901
- ngOnDestroy() {
902
- if (this._listAnimator?.$btnSubscription) {
903
- this._listAnimator.$btnSubscription.unsubscribe();
904
- this._listAnimator = null;
905
- }
906
- // MEMORY LEAK FIX: Unsubscribe from all app subscriptions
907
- if (this._listenerDestroyers) {
908
- this._listenerDestroyers.forEach(d => d?.());
909
- this._listenerDestroyers = [];
910
- }
911
- // MEMORY LEAK FIX: Unsubscribe from navigator watches
912
- if (this.navigatorResultWatch) {
913
- this.navigatorResultWatch.unsubscribe();
914
- this.navigatorResultWatch = null;
915
- }
916
- if (this.navigatorMaxResultWatch) {
917
- this.navigatorMaxResultWatch.unsubscribe();
918
- this.navigatorMaxResultWatch = null;
919
- }
920
- // MEMORY LEAK FIX: Unsubscribe from listItems changes
921
- if (this.listItemsChangesSubscription) {
922
- this.listItemsChangesSubscription.unsubscribe();
923
- this.listItemsChangesSubscription = null;
924
- }
925
- // MEMORY LEAK FIX: Remove native event listener
926
- const ulElement = this.nativeElement?.querySelector('ul.app-livelist-container');
927
- if (ulElement && this.boundClickHandler) {
928
- try {
929
- ulElement.removeEventListener('click', this.boundClickHandler, true);
930
- }
931
- catch (e) {
932
- // Silently handle cleanup errors
933
- }
934
- this.boundClickHandler = null;
935
- }
936
- // MEMORY LEAK FIX: Destroy jQuery sortable widget
937
- if (this.$ulEle?.sortable) {
938
- try {
939
- this.$ulEle.sortable('destroy');
940
- }
941
- catch (e) {
942
- // Ignore errors during destroy
943
- }
944
- this.$ulEle = null;
945
- }
946
- // MEMORY LEAK FIX: Clear QueryList references
947
- if (this.listItems) {
948
- this.listItems = null;
949
- }
950
- if (this.btnComponents) {
951
- this.btnComponents = null;
952
- }
953
- // MEMORY LEAK FIX: Clear ViewChild and ContentChild references
954
- this.dataNavigator = null;
955
- this.listTemplate = null;
956
- this.listLeftActionTemplate = null;
957
- this.listRightActionTemplate = null;
958
- // MEMORY LEAK FIX: Clear all data arrays and objects
959
- this.fieldDefs = [];
960
- this._items = [];
961
- this.groupedData = null;
962
- if (Array.isArray(this.selectedItemWidgets)) {
963
- this.selectedItemWidgets = [];
964
- }
965
- else {
966
- this.selectedItemWidgets = {};
967
- }
968
- // MEMORY LEAK FIX: Remove add item event listener
969
- const $addItem = document.getElementsByClassName("add-list-item")[0];
970
- if ($addItem && this.boundAddItemHandler) {
971
- $addItem.removeEventListener('click', this.boundAddItemHandler);
972
- this.boundAddItemHandler = null;
973
- }
974
- // MEMORY LEAK FIX: Nullify closures and references
975
- this.debouncedFetchNextDatasetOnScroll = null;
976
- this.firstSelectedItem = null;
977
- this.lastSelectedItem = null;
978
- this.reorderProps = null;
979
- super.ngOnDestroy();
980
- }
981
- ngOnDetach() {
982
- super.ngOnDetach();
983
- this._pageLoad = true;
984
- }
985
- handleEvent(node, eventName, eventCallback, locals) {
986
- // tap and doubleTap events are not getting propagated.So, using mouse events instead.
987
- const touchToMouse = {
988
- tap: 'click',
989
- doubletap: 'dblclick'
990
- };
991
- if (lodashEs.includes(['click', 'tap', 'dblclick', 'doubletap'], eventName)) {
992
- this.eventManager.addEventListener(this.nativeElement, touchToMouse[eventName] || eventName, (evt) => {
993
- const target = $(evt.target).closest('.app-list-item');
994
- if (target.length) {
995
- const listItemContext = target.data('listItemContext');
996
- if (!listItemContext.disableItem) {
997
- this.invokeEventCallback(eventName, {
998
- widget: listItemContext,
999
- $event: evt,
1000
- item: listItemContext.item
1001
- });
1002
- }
1003
- }
1004
- });
1005
- }
1006
- }
1007
- getConfiguredState() {
1008
- const mode = this.statePersistence.computeMode(this.statehandler);
1009
- return mode?.toLowerCase();
1010
- }
1011
- handleStateParams(options) {
1012
- if (this._pageLoad && this.getConfiguredState() !== 'none') {
1013
- this._pageLoad = false;
1014
- const widgetState = this.statePersistence.getWidgetState(this);
1015
- if (lodashEs.get(widgetState, 'pagination')) {
1016
- options.options = options.options || {};
1017
- options.options.page = widgetState.pagination;
1018
- }
1019
- if (lodashEs.get(widgetState, 'selectedItem')) {
1020
- this._selectedItemsExist = true;
1021
- }
1022
- }
1023
- }
1024
- triggerWMEvent(eventName, item) {
1025
- i2.$invokeWatchers(true);
1026
- // 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.
1027
- let row = this.multiselect ? lodashEs.last(this.selecteditem) : this.selecteditem;
1028
- if (item) {
1029
- row = item;
1030
- }
1031
- this.app.notify('wm-event', { eventName, widgetName: this.name, row: row });
1032
- }
1033
- resetNavigation() {
1034
- this.showNavigation = false;
1035
- this.navControls = undefined;
1036
- this.infScroll = false;
1037
- this.onDemandLoad = false;
1038
- }
1039
- enableBasicNavigation() {
1040
- this.navControls = i1.NAVIGATION_TYPE.BASIC;
1041
- this.showNavigation = true;
1042
- }
1043
- enableInlineNavigation() {
1044
- this.navControls = i1.NAVIGATION_TYPE.INLINE;
1045
- }
1046
- enableClassicNavigation() {
1047
- this.navControls = i1.NAVIGATION_TYPE.CLASSIC;
1048
- this.showNavigation = true;
1049
- }
1050
- enablePagerNavigation() {
1051
- this.navControls = i1.NAVIGATION_TYPE.PAGER;
1052
- this.showNavigation = true;
1053
- }
1054
- setNavigationTypeNone() {
1055
- this.navControls = i1.NAVIGATION_TYPE.NONE;
1056
- this.showNavigation = false;
1057
- }
1058
- enableInfiniteScroll() {
1059
- this.infScroll = true;
1060
- }
1061
- enableOnDemandLoad() {
1062
- this.onDemandLoad = true;
1063
- this.showNavigation = true;
1064
- }
1065
- /**
1066
- * Sets Navigation type for the list.
1067
- * @param type
1068
- */
1069
- onNavigationTypeChange(type) {
1070
- this.resetNavigation();
1071
- switch (type) {
1072
- case i1.NAVIGATION_TYPE.BASIC:
1073
- this.enableBasicNavigation();
1074
- break;
1075
- case i1.NAVIGATION_TYPE.INLINE:
1076
- this.enableInlineNavigation();
1077
- break;
1078
- case i1.NAVIGATION_TYPE.ADVANCED:
1079
- case i1.NAVIGATION_TYPE.CLASSIC:
1080
- this.enableClassicNavigation();
1081
- break;
1082
- case i1.NAVIGATION_TYPE.PAGER:
1083
- this.enablePagerNavigation();
1084
- break;
1085
- case i1.NAVIGATION_TYPE.NONE:
1086
- this.setNavigationTypeNone();
1087
- break;
1088
- case i1.NAVIGATION_TYPE.SCROLL:
1089
- this.enableInfiniteScroll();
1090
- break;
1091
- case i1.NAVIGATION_TYPE.ONDEMAND:
1092
- this.enableOnDemandLoad();
1093
- break;
1094
- }
1095
- }
1096
- /**
1097
- * Update fieldDefs property, fieldDefs is the model of the List Component.
1098
- * fieldDefs is an Array type.
1099
- * @param newVal
1100
- */
1101
- updateFieldDefs(newVal) {
1102
- if (this.infScroll || this.onDemandLoad) {
1103
- [this.fieldDefs, this.currentPage] = this.paginationService.updateFieldsOnPagination(this, newVal);
1104
- }
1105
- else {
1106
- this.fieldDefs = newVal;
1107
- }
1108
- if (this.orderby) {
1109
- this.fieldDefs = i1.getOrderedDataset(this.fieldDefs, this.orderby);
1110
- }
1111
- if (this.groupby) {
1112
- this.groupedData = i1.groupData(this, this.fieldDefs, this.groupby, this.match, this.orderby, this.dateformat, this.datePipe, undefined, this.appDefaults);
1113
- }
1114
- if (!this.fieldDefs.length) {
1115
- this.noDataFound = true;
1116
- this.selecteditem = undefined;
1117
- }
1118
- i2.$appDigest();
1119
- this.listItems.setDirty();
1120
- }
1121
- onDataChange(newVal) {
1122
- // Check for newVal is not empty
1123
- if (!lodashEs.isEmpty(newVal)) {
1124
- this.noDataFound = false;
1125
- this.isDataChanged = true;
1126
- if (this.datasource?.execute(i2.DataSource.Operation.IS_API_AWARE)) {
1127
- // clone the the data in case of live and service variables to prevent the two-way binding for these variables.
1128
- newVal = lodashEs.cloneDeep(newVal);
1129
- }
1130
- if (i2.isObject(newVal) && !lodashEs.isArray(newVal)) {
1131
- newVal = lodashEs.isEmpty(newVal) ? [] : [newVal];
1132
- }
1133
- if (lodashEs.isString(newVal)) {
1134
- newVal = newVal.split(',');
1135
- }
1136
- // if the page number is greater than 1 on initial load then we render the first page.
1137
- if (this.datasource && this.datasource.owner === 'App' && (this.infScroll || this.onDemandLoad) && !this.currentPage && this.datasource.execute(i2.DataSource.Operation.GET_PAGING_OPTIONS).number > 0) {
1138
- newVal = this.datasource.execute(i2.DataSource.Operation.LIST_RECORDS, {
1139
- 'page': 1
1140
- });
1141
- }
1142
- if (lodashEs.isArray(newVal)) {
1143
- if (newVal.length) {
1144
- this.invokeEventCallback('beforedatarender', { $data: newVal });
1145
- }
1146
- this.updateFieldDefs(newVal);
1147
- }
1148
- }
1149
- else {
1150
- this.updateFieldDefs([]);
1151
- }
1152
- }
1153
- // Updates the dataSource when pagination is enabled for the Component.
1154
- setupDataSource() {
1155
- const dataNavigator = this.dataNavigator;
1156
- dataNavigator.options = {
1157
- maxResults: this.pagesize || 20
1158
- };
1159
- this.dataNavigatorWatched = true;
1160
- if (this.navigatorResultWatch) {
1161
- this.navigatorResultWatch.unsubscribe();
1162
- }
1163
- /*Register a watch on the "result" property of the "dataNavigator" so that the paginated data is displayed in the live-list.*/
1164
- this.navigatorResultWatch = dataNavigator.resultEmitter.subscribe((newVal) => {
1165
- this.onDataChange(newVal);
1166
- }, true);
1167
- /*De-register the watch if it is exists */
1168
- if (this.navigatorMaxResultWatch) {
1169
- this.navigatorMaxResultWatch.unsubscribe();
1170
- }
1171
- /*Register a watch on the "maxResults" property of the "dataNavigator" so that the "pageSize" is displayed in the live-list.*/
1172
- this.navigatorMaxResultWatch = dataNavigator.maxResultsEmitter.subscribe((val) => {
1173
- this.pagesize = val;
1174
- });
1175
- dataNavigator.maxResults = this.pagesize || 20;
1176
- this.removePropertyBinding('dataset');
1177
- // when list having "datasetboundexpr" attr indicates that list is bound to item context
1178
- // when dataset is bound to "item.FIELD" then item context is passed as the datasource.
1179
- const datasetBoundExpr = this.getAttr('datasetboundexpr');
1180
- this.dataNavigator.setBindDataSet(this.binddataset, this.viewParent, datasetBoundExpr ? this.context : this.datasource, this.dataset, this.binddatasource, datasetBoundExpr, this.statehandler);
1181
- }
1182
- onDataSetChange(newVal) {
1183
- if (lodashEs.get(this.datasource, 'category') === 'wm.Variable' && this.getConfiguredState() !== 'none' && this._pageLoad) {
1184
- const widgetState = this.statePersistence.getWidgetState(this);
1185
- this._pageLoad = false;
1186
- if (this.allowpagesizechange) { // maintain updated page size in the statePersistence
1187
- if (lodashEs.get(widgetState, 'pagination') || lodashEs.get(widgetState, 'pagesize')) {
1188
- this.dataNavigator.pageChanged({ page: widgetState.pagination || 1, pagesize: widgetState.pagesize }, true);
1189
- }
1190
- }
1191
- else if (lodashEs.get(widgetState, 'pagination')) {
1192
- this.dataNavigator.pageChanged({ page: widgetState.pagination }, true);
1193
- }
1194
- if (lodashEs.get(widgetState, 'selectedItem')) {
1195
- this._selectedItemsExist = true;
1196
- }
1197
- }
1198
- if (!this.dataNavigatorWatched) {
1199
- if (this.navigation && this.navigation !== i1.NAVIGATION_TYPE.NONE) {
1200
- this.setupDataSource();
1201
- }
1202
- else {
1203
- this.onDataChange(newVal);
1204
- }
1205
- }
1206
- else if (this.navigation && this.navigation !== i1.NAVIGATION_TYPE.NONE) {
1207
- // If navigation is already setup and datasource is changed, update the datasource on navigation
1208
- this.dataNavigator.setDataSource(this.datasource);
1209
- }
1210
- }
1211
- // All the ListItem's Active state is set to false.
1212
- deselectListItems() {
1213
- this.listItems.forEach(item => item.isActive = false);
1214
- }
1215
- // Deselect all the ListItems and clear the selecteditem(InOutBound Property model)
1216
- clearSelectedItems() {
1217
- this.deselectListItems();
1218
- this._items.length = 0;
1219
- i2.$appDigest();
1220
- }
1221
- /**
1222
- * return the ListItemDirective instance by checking the equality of the model.
1223
- * @param listModel: model to be searched for
1224
- * @returns ListItem if the model is matched else return null.
1225
- */
1226
- getListItemByModel(listModel) {
1227
- return this.listItems.find((listItem) => {
1228
- let itemObj = listItem.item;
1229
- if (this.groupby && !lodashEs.has(listModel, '_groupIndex')) {
1230
- // If groupby is enabled, item contains _groupIndex property which should be excluded while comparing model.
1231
- itemObj = lodashEs.clone(itemObj);
1232
- delete itemObj._groupIndex;
1233
- }
1234
- if (lodashEs.isEqual(itemObj, listModel)) {
1235
- return true;
1236
- }
1237
- }) || null;
1238
- }
1239
- updateSelectedItemsWidgets(statePersistenceTriggered) {
1240
- let obj = {}, widgetState;
1241
- const pageNum = lodashEs.get(this.dataNavigator, 'dn.currentPage') || 1;
1242
- if (this.getConfiguredState() !== 'none') {
1243
- // remove previously configured selected items for current page and construct new ones later below.
1244
- widgetState = this.statePersistence.getWidgetState(this) || {};
1245
- if (lodashEs.get(widgetState, 'selectedItem')) {
1246
- // when multiselect is on and an item is selected without pressing CTRL, previously selected items in state should be empty.
1247
- if (this.multiselect && this.selecteditem.length === 1) {
1248
- widgetState.selectedItem = [];
1249
- }
1250
- else {
1251
- lodashEs.remove(widgetState.selectedItem, function (selectedItem) {
1252
- return selectedItem.page === pageNum;
1253
- });
1254
- }
1255
- }
1256
- }
1257
- if (this.multiselect) {
1258
- this.selectedItemWidgets.length = 0;
1259
- }
1260
- this.listItems.forEach((item, index) => {
1261
- if (item.isActive) {
1262
- if (this.multiselect) {
1263
- this.selectedItemWidgets.push(item.currentItemWidgets);
1264
- }
1265
- else {
1266
- this.selectedItemWidgets = item.currentItemWidgets;
1267
- }
1268
- obj = { page: pageNum, index: index };
1269
- if (lodashEs.get(widgetState, 'selectedItem') && this.multiselect) {
1270
- if (!lodashEs.some(widgetState.selectedItem, obj)) {
1271
- widgetState.selectedItem.push(obj);
1272
- }
1273
- }
1274
- else {
1275
- widgetState.selectedItem = [obj];
1276
- }
1277
- }
1278
- });
1279
- if (this.getConfiguredState() !== 'none' && !statePersistenceTriggered) {
1280
- if (i1.unsupportedStatePersistenceTypes.indexOf(this.navigation) < 0) {
1281
- this.statePersistence.removeWidgetState(this, 'selectedItem');
1282
- this.statePersistence.setWidgetState(this, { 'selectedItem': widgetState.selectedItem });
1283
- }
1284
- else {
1285
- console.warn('Retain State handling on Widget ' + this.name + ' is not supported for current pagination type.');
1286
- }
1287
- }
1288
- }
1289
- /**
1290
- * Selects the listItem and updates selecteditem property.
1291
- * If the listItem is already a selected item then deselects the item.
1292
- * @param {ListItemDirective} $listItem: Item to be selected of deselected.
1293
- */
1294
- toggleListItemSelection($listItem, statePersistenceTriggered) {
1295
- // item is not allowed to get selected if it is disabled.
1296
- if ($listItem && !$listItem.disableItem) {
1297
- let item = $listItem.item;
1298
- if (this.groupby && lodashEs.has(item, '_groupIndex')) {
1299
- // If groupby is enabled, item contains _groupIndex property which should be excluded from selecteditem.
1300
- item = lodashEs.clone(item);
1301
- delete item._groupIndex;
1302
- }
1303
- if ($listItem.isActive) {
1304
- this._items = lodashEs.pullAllWith(this._items, [item], lodashEs.isEqual);
1305
- $listItem.isActive = false;
1306
- }
1307
- else {
1308
- // if multiselect is false, clear the selectItem list before adding an item to the selectItem list.
1309
- if (!this.multiselect) {
1310
- this.clearSelectedItems();
1311
- }
1312
- this._items.push(item);
1313
- this.invokeEventCallback('select', { widget: $listItem, $data: item });
1314
- $listItem.isActive = true;
1315
- }
1316
- this.updateSelectedItemsWidgets(statePersistenceTriggered);
1317
- }
1318
- }
1319
- /**
1320
- * Method is Invoked when the model for the List Widget is changed.
1321
- * @param {QueryList<ListItemDirective>} listItems
1322
- */
1323
- onListRender(listItems) {
1324
- // Added render callback event. This method(onListRender) is calling multiple times so checking isDatachanged flag because this falg is changed whenever new data is rendered.
1325
- if (this.isDataChanged) {
1326
- // Whenever dataset is changed, trigger watchers to evaluate listitem bind expressions.
1327
- i2.$invokeWatchers(true);
1328
- this.invokeEventCallback('render', { $data: this.fieldDefs });
1329
- }
1330
- if (this.isDataChanged && this.getConfiguredState() !== 'none' && listItems.length && this._selectedItemsExist) {
1331
- const widgetState = this.statePersistence.getWidgetState(this);
1332
- if (lodashEs.get(widgetState, 'selectedItem')) {
1333
- this._selectedItemsExist = false;
1334
- const selectedItemsLength = lodashEs.isArray(this.selecteditem) ? this.selecteditem.length : lodashEs.toNumber(!lodashEs.isEmpty(this.selecteditem));
1335
- const currentPage = lodashEs.get(this.dataNavigator, 'dn.currentPage') || 1;
1336
- widgetState.pagination = widgetState.pagination || 1;
1337
- // to prevent item selection from being triggered more than once
1338
- if (selectedItemsLength !== widgetState.selectedItem.length && widgetState.pagination === currentPage) {
1339
- widgetState.selectedItem.forEach((item) => {
1340
- if (item.page === currentPage) {
1341
- this.selectItem(item.index, true);
1342
- }
1343
- });
1344
- }
1345
- }
1346
- }
1347
- const selectedItems = lodashEs.isArray(this.selecteditem) ? this.selecteditem : [this.selecteditem];
1348
- this.firstSelectedItem = this.lastSelectedItem = null;
1349
- // don't select first item if multi-select is enabled and at least item is already selected in the list.
1350
- // don't select first item if state information has selected items
1351
- if (listItems.length && this.selectfirstitem && !(this._items.length && this.multiselect) && this._selectedItemsExist !== false) {
1352
- const $firstItem = listItems.first;
1353
- if (!$firstItem.disableItem &&
1354
- this.isDataChanged &&
1355
- // "infinite scroll" or "load on demand" is enabled and at least one item is selected then dont alter the selected list items.
1356
- !((this.infScroll || this.onDemandLoad) &&
1357
- this._items.length)) {
1358
- this.clearSelectedItems();
1359
- this.firstSelectedItem = this.lastSelectedItem = $firstItem;
1360
- // selecting the first record
1361
- this.selectItem(0);
1362
- }
1363
- }
1364
- else {
1365
- this.deselectListItems();
1366
- selectedItems.forEach(selecteditem => {
1367
- const listItem = this.getListItemByModel(selecteditem);
1368
- if (listItem) {
1369
- listItem.isActive = true;
1370
- this.lastSelectedItem = listItem;
1371
- // focus the active element
1372
- listItem.nativeElement.focus();
1373
- }
1374
- });
1375
- }
1376
- if (this.fieldDefs.length && this.infScroll) {
1377
- // In case of mobile app when modal exists, and list items height is greater than the modal content provide ccontainer a scrollable height
1378
- const modalBody = this.$element.closest('.modal-body');
1379
- const listHt = this.$element.find('ul').height();
1380
- const modalHt = window.innerHeight - 140;
1381
- if (i2.isMobile() && modalBody.length && listHt > modalHt) {
1382
- this.$element.css('height', modalHt + 'px');
1383
- }
1384
- setTimeout(() => this.paginationService.bindScrollEvt(this, '> ul', i1.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME), 500);
1385
- // this.paginationService.bindScrollEvt(this, '> ul', DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME);
1386
- }
1387
- this.isDataChanged = false;
1388
- }
1389
- setupHandlers() {
1390
- this.listItemsChangesSubscription = this.listItems.changes.subscribe(listItems => {
1391
- this.onListRender(listItems);
1392
- this.cdRef.detectChanges();
1393
- });
1394
- // handle click event in capturing phase.
1395
- this.boundClickHandler = ($event) => {
1396
- let target = $($event.target).closest('.app-list-item');
1397
- // Recursively find the current list item
1398
- while (target.get(0) && (target.closest('ul.app-livelist-container').get(0) !== $event.currentTarget)) {
1399
- target = target.parent().closest('.app-list-item');
1400
- }
1401
- this.triggerListItemSelection(target, $event);
1402
- };
1403
- const ulElement = this.nativeElement.querySelector('ul.app-livelist-container');
1404
- if (ulElement) {
1405
- ulElement.addEventListener('click', this.boundClickHandler, true);
1406
- }
1407
- }
1408
- // Triggers on drag start while reordering.
1409
- onReorderStart(evt, ui) {
1410
- ui.placeholder.height(ui.item.height());
1411
- this.$ulEle.data('oldIndex', ui.item.index());
1412
- }
1413
- // Triggers during sorting
1414
- onSort(evt, ui) {
1415
- // In case of infinite scroll, when the element doesn't have scroll enabled
1416
- // on dragging the element to last item's position manually trigger loading of next items
1417
- if (this.infScroll) {
1418
- const lastItemOffset = this.$ulEle.find(`[listitemindex=${this.fieldDefs.length - 1}]`).offset();
1419
- if (lastItemOffset && lastItemOffset.top < ui.offset.top) {
1420
- this.paginationService.bindScrollEvt(this, '> ul', i1.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME);
1421
- this.debouncedFetchNextDatasetOnScroll();
1422
- }
1423
- }
1424
- }
1425
- // Triggers after the sorting.
1426
- onUpdate(evt, ui, presentIndex) {
1427
- const data = this.fieldDefs;
1428
- // If ui is not present then it is called from drag and drop using keyboard
1429
- const newIndex = ui === undefined ? presentIndex : ui.item.index();
1430
- const oldIndex = this.$ulEle.data('oldIndex');
1431
- const minIndex = lodashEs.min([newIndex, oldIndex]);
1432
- const maxIndex = lodashEs.max([newIndex, oldIndex]);
1433
- const draggedItem = lodashEs.pullAt(data, oldIndex)[0];
1434
- // Modify the data list only if we find a draggedItem
1435
- if (draggedItem) {
1436
- if (this.getConfiguredState() !== 'none') {
1437
- this.statePersistence.removeWidgetState(this, 'selectedItem');
1438
- }
1439
- this.reorderProps.minIndex = lodashEs.min([minIndex, this.reorderProps.minIndex]);
1440
- this.reorderProps.maxIndex = lodashEs.max([maxIndex, this.reorderProps.maxIndex]);
1441
- data.splice(newIndex, 0, draggedItem);
1442
- this.cdRef.markForCheck();
1443
- this.cdRef.detectChanges();
1444
- const $changedItem = {
1445
- oldIndex: oldIndex,
1446
- newIndex: newIndex,
1447
- item: data[newIndex]
1448
- };
1449
- this.invokeEventCallback('reorder', { $event: evt, $data: data, $changedItem });
1450
- this.$ulEle.removeData('oldIndex');
1451
- }
1452
- }
1453
- // configures reordering the list items.
1454
- configureDnD() {
1455
- let appendTo;
1456
- const modalEl = $(document).find('.modal');
1457
- 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
1458
- appendTo = 'parent';
1459
- }
1460
- else if (modalEl.length) { // In case of dialog, appendTo should be the modal ele
1461
- appendTo = modalEl[modalEl.length - 1];
1462
- }
1463
- else { // As default append to should be body
1464
- appendTo = 'body';
1465
- }
1466
- const options = {
1467
- appendTo: appendTo,
1468
- };
1469
- const $el = $(this.nativeElement);
1470
- this.$ulEle = $el.find('.app-livelist-container');
1471
- i1.configureDnD(this.$ulEle, options, this.onReorderStart.bind(this), this.onUpdate.bind(this), this.onSort.bind(this));
1472
- this.$ulEle.droppable({ 'accept': '.app-list-item' });
1473
- }
1474
- // returns true if the selection limit is reached.
1475
- checkSelectionLimit(count) {
1476
- return (!this.selectionlimit || count < this.selectionlimit);
1477
- }
1478
- // returns listitem reference by index value.
1479
- getListItemByIndex(index) {
1480
- return this.listItems.toArray()[index];
1481
- }
1482
- /**
1483
- * return index of an (listItemDirective) in the listItem
1484
- * @param {ListItemDirective} item
1485
- * @returns {number}
1486
- */
1487
- getListItemIndex(item) {
1488
- return this.listItems.toArray().indexOf(item);
1489
- }
1490
- /**
1491
- * Returns ListItem Reference based on the input provided.
1492
- * @param val: index | model of the list item.
1493
- * @returns {ListItemDirective}
1494
- */
1495
- getItemRefByIndexOrModel(val) {
1496
- let listItem;
1497
- if (lodashEs.isNumber(val)) {
1498
- listItem = this.getListItemByIndex(val);
1499
- }
1500
- else {
1501
- listItem = this.getListItemByModel(val);
1502
- }
1503
- return listItem;
1504
- }
1505
- beforePaginationChange($event, $index) {
1506
- this.invokeEventCallback('paginationchange', { $event, $index });
1507
- }
1508
- trackByFn($index) {
1509
- return $index; // Return a unique identifier for each item
1510
- }
1511
- // Invoke the datasource variable by default when pulltorefresh event is not specified.
1512
- subscribeToPullToRefresh() {
1513
- this._listenerDestroyers.push(this.app.subscribe('pulltorefresh', () => {
1514
- if (this.datasource?.listRecords) {
1515
- this.datasource.listRecords();
1516
- }
1517
- }));
1518
- }
1519
- setUpCUDHandlers() {
1520
- const $addItem = document.getElementsByClassName("add-list-item")[0];
1521
- if ($addItem) {
1522
- // MEMORY LEAK FIX: Store bound handler for cleanup
1523
- this.boundAddItemHandler = (evt) => {
1524
- this.create();
1525
- };
1526
- // Triggered on click of add action
1527
- $addItem.addEventListener('click', this.boundAddItemHandler);
1528
- }
1529
- }
1530
- _readItemAttrsFromHost() {
1531
- const raw = this.nativeElement.getAttribute("itemattrs");
1532
- if (!raw) {
1533
- this.itemAttrsMap = {};
1534
- return;
1535
- }
1536
- try {
1537
- this.itemAttrsMap = JSON.parse(raw);
1538
- }
1539
- catch (e) {
1540
- console.warn("list.component: failed to parse itemattrs JSON", e, raw);
1541
- this.itemAttrsMap = {};
1542
- }
1543
- }
1544
- static { this.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0__namespace, type: ListComponent, deps: [{ token: i0__namespace.Injector }, { token: i0__namespace.ChangeDetectorRef }, { token: i1__namespace.ToDatePipe }, { token: i2__namespace.App }, { token: i2__namespace.AppDefaults }, { token: i0__namespace.NgZone }, { token: 'itemclass.bind', attribute: true }, { token: 'disableitem.bind', attribute: true }, { token: 'dataset.bind', attribute: true }, { token: 'datasource.bind', attribute: true }, { token: 'mouseenter.event', attribute: true }, { token: 'mouseleave.event', attribute: true }, { token: i2__namespace.StatePersistence }, { token: i2__namespace.PaginationService }, { token: 'EXPLICIT_CONTEXT', optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component }); }
1545
- static { this.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.21", type: ListComponent, isStandalone: true, selector: "div[wmList]", providers: [
1546
- i1.provideAsWidgetRef(ListComponent)
1547
- ], queries: [{ propertyName: "listTemplate", first: true, predicate: ["listTemplate"], descendants: true }, { propertyName: "listLeftActionTemplate", first: true, predicate: ["listLeftActionTemplate"], descendants: true }, { propertyName: "listRightActionTemplate", first: true, predicate: ["listRightActionTemplate"], descendants: true }, { propertyName: "btnComponents", predicate: button.ButtonComponent }], viewQueries: [{ propertyName: "dataNavigator", first: true, predicate: pagination.PaginationComponent, descendants: true }, { propertyName: "listItems", predicate: exports.ListItemDirective, descendants: true }], usesInheritance: true, ngImport: i0__namespace, template: "@if (title || subheading || iconclass || iconurl) {\n <div class=\"panel-heading\">\n <h3 class=\"panel-title\">\n <div class=\"pull-left\">\n <wm-app-icon [iconclass]=\"iconclass\" [iconurl]=\"iconurl\" [defaultClasses]=\"'panel-icon'\" alt=\"List icon\"></wm-app-icon>\n </div>\n <div class=\"pull-left\">\n <div class=\"heading\" [innerHTML]=\"title\"></div>\n <div class=\"description\" [innerHTML]=\"subheading\"></div>\n </div>\n </h3>\n </div>\n}\n\n@if (navigation === 'Inline' && !noDataFound) {\n <div class=\"app-datanavigator\" [attr.aria-disabled]=\"dataNavigator.isDisablePrevious\" aria-label=\"Page navigation\">\n <ul class=\"pager\">\n <li class=\"previous\" [ngClass]=\"{'disabled': (dataNavigator ? dataNavigator.isDisablePrevious : true)}\">\n <a href=\"javascript:void(0);\" (click)=\"dataNavigator.navigatePage('prev', $event)\"\n [attr.aria-disabled]=\"dataNavigator.isDisablePrevious\">\n <i class=\"wi wi-chevron-left\" aria-hidden=\"true\"></i>\n <span class=\"sr-only\">Go to Previous page {{dataNavigator.isDisablePrevious ? ', Disabled' : ''}}</span>\n </a>\n </li>\n </ul>\n </div>\n}\n@if (navigation === 'Inline' && !noDataFound) {\n <div aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\"> {{'Page ' + dataNavigator.dn.currentPage + ' of ' + dataNavigator.pageCount }}</div>\n}\n\n<div>\n @if (enablereorder) {\n <div id={{titleId}} class=\"sr-only\">\n Press space bar to toggle drag drop mode, use arrow keys to move selected elements.\n </div>\n }\n\n @if (listItems && enablereorder && currentIndex) {\n <div aria-live=\"assertive\" class=\"sr-only\" >\n {{ariaText + currentIndex + ' of ' + listItems.length}}\n </div>\n }\n</div>\n\n<ul [attr.tabindex]=\"tabindex\" class=\"list-group app-livelist-container clearfix {{direction === 'horizontal' ? 'app-horizontal-list': ''}} {{listclass}}\" role=\"list\"\n [class.list-group-autolayout]=\"hasAutolayout\"\n (keydown.enter)=\"handleKeyDown($event, 'select')\"\n\n (keydown.space)=\"handleKeyDown($event, 'space')\"\n\n (keydown.arrowup)=\"handleKeyDown($event, 'focusPrev')\"\n (keydown.arrowdown)=\"handleKeyDown($event, 'focusNext')\"\n (keydown.arrowleft)=\"handleKeyDown($event, 'focusPrev')\"\n (keydown.arrowright)=\"handleKeyDown($event, 'focusNext')\"\n\n (keydown.shift.arrowup)=\"handleKeyDown($event, 'selectPrev')\"\n (keydown.shift.arrowdown)=\"handleKeyDown($event, 'selectNext')\"\n (keydown.shift.arrowleft)=\"handleKeyDown($event, 'selectPrev')\"\n (keydown.shift.arrowright)=\"handleKeyDown($event, 'selectNext')\"\n [hidden]=\"noDataFound && !variableInflight\"\n >\n @if (!groupby) {\n @for (item of fieldDefs; track item) {\n <li class=\"app-list-item {{direction === 'horizontal' ? '' : itemsPerRowClass}}\" [ngClass]=\"listItemRef.itemClass\"\n [wmListItem]=\"item\"\n #listItemRef=\"listItemRef\"\n [attr.tabindex]=\"tabindex\"\n role=\"listitem\">\n <ng-container [ngTemplateOutlet]=\"listTemplate\"\n [ngTemplateOutletInjector]=\"createCustomInjector('falt_' + listItemRef.trackId, {item: item, row: item, $index: $index, itemRef: listItemRef, $first: $first, $last: $last, currentItemWidgets: listItemRef.currentItemWidgets})\"\n [ngTemplateOutletContext]=\"{item: item, row: item, $index: $index, itemRef: listItemRef, $first: $first, $last: $last, currentItemWidgets: listItemRef.currentItemWidgets}\"></ng-container>\n </li>\n }\n } @else {\n @for (groupObj of groupedData; track groupObj; let groupIndex = $index) {\n <li class=\"app-list-item-group clearfix\">\n <ul [attr.tabindex]=\"tabindex\" class=\"list-group item-group\" [ngClass]=\"listclass\" [class.list-group-autolayout]=\"hasAutolayout\">\n <li class=\"app-list-item-header list-item list-group-header\" (click)=\"handleHeaderClick($event)\" [ngClass]=\"{'collapsible-content': collapsible}\">\n <h4>{{groupObj.key}}\n <div class=\"header-action\">\n @if (collapsible) {\n <i class=\"app-icon wi action wi-chevron-up\"></i>\n }\n @if (showcount) {\n <span class=\"label label-default\">{{groupObj.data.length}}</span>\n }\n </div>\n </h4>\n </li>\n <li class=\"list-group-container\">\n <ul class=\"list-group clearfix {{direction === 'horizontal' ? 'app-horizontal-list': ''}}\" [class.list-group-autolayout]=\"hasAutolayout\">\n @for (item of groupObj.data; track trackByFn($index, item)) {\n <li [attr.tabindex]=\"tabindex\"\n class=\"app-list-item group-list-item {{itemsPerRowClass}}\"\n [ngClass]=\"listItemRef.itemClass\"\n [wmListItem]=\"item\" #listItemRef=\"listItemRef\">\n <ng-container [ngTemplateOutlet]=\"listTemplate\"\n [ngTemplateOutletInjector]=\"createCustomInjector('group_' + listItemRef.trackId, {item: item, row: item, $index: $index, itemRef: listItemRef, $first: $first, $last: $last, currentItemWidgets: listItemRef.currentItemWidgets})\"\n [ngTemplateOutletContext]=\"{item: item, row: item, $index: $index, itemRef: listItemRef, $first: $first, $last: $last, currentItemWidgets: listItemRef.currentItemWidgets}\"></ng-container>\n </li>\n }\n </ul>\n </li>\n </ul>\n </li>\n }\n }\n <ng-container [ngTemplateOutlet]=\"listLeftActionTemplate\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"listRightActionTemplate\"></ng-container>\n</ul>\n\n@if (noDataFound && !variableInflight) {\n <div class=\"no-data-msg\" [textContent]=\"nodatamessage\"></div>\n}\n\n@if (variableInflight && !pulltorefresh) {\n <div class=\"loading-data-msg\">\n <span>\n <wm-app-icon [iconclass]=\"loadingicon\" [iconurl]=\"loadingiconurl\" [defaultClasses]=\"'panel-icon'\" alt=\"loading icon\"></wm-app-icon>\n <span class=\"sr-only\">Loading</span>\n <span class=\"loading-text\" [textContent]=\"loadingdatamsg\"></span>\n </span>\n </div>\n}\n\n@if (navigation === 'Inline' && !noDataFound) {\n <div class=\"app-datanavigator\" [attr.aria-disabled]=\"dataNavigator.isDisableNext\">\n <ul class=\"pager\">\n <li class=\"next\" [ngClass]=\"{'disabled': (dataNavigator ? dataNavigator.isDisableNext : true)}\">\n <a href=\"javascript:void(0);\" (click)=\"dataNavigator.navigatePage('next', $event)\"\n [attr.aria-disabled]=\"dataNavigator.isDisableNext\">\n <i class=\"wi wi-chevron-right\" aria-hidden=\"true\"></i>\n <span class=\"sr-only\">Go to Next page {{dataNavigator.isDisableNext ? ', Disabled' : ''}}</span>\n </a>\n </li>\n </ul>\n </div>\n}\n\n@if (navigation !== 'None') {\n <div class=\"panel-footer\" [hidden]=\"!showNavigation || (onDemandLoad && dataNavigator.isDisableNext) || (dataNavigator?.dataSize <= pagesize && !allowpagesizechange) || (!dataNavigator.dataSize && !dataNavigator.datasource?.pagination?.next)\">\n <nav wmPagination\n navigationalign.bind=\"navigationalign\"\n navigation.bind=\"navControls\"\n showrecordcount.bind=\"showrecordcount\"\n maxsize.bind=\"maxsize\"\n boundarylinks.bind=\"boundarylinks\"\n forceellipses.bind=\"forceellipses\"\n directionlinks.bind=\"directionlinks\"\n show.bind=\"!onDemandLoad\"\n paginationchange.event=\"beforePaginationChange($event, $index)\"\n ></nav>\n @if (onDemandLoad) {\n <a href=\"javascript:void(0);\"\n (click)=\"dataNavigator.navigatePage('next', $event)\"\n class=\"app-button btn btn-block\"\n [ngClass]=\"paginationclass\"\n [textContent]=\"ondemandmessage\"\n ></a>\n }\n </div>\n}\n\n<!--This template will be displayed when groupby is specified-->\n", dependencies: [{ kind: "ngmodule", type: i3.CommonModule }, { kind: "directive", type: i3__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.TextContentDirective, selector: "[textContent]", inputs: ["textContent"] }, { kind: "component", type: pagination.PaginationComponent, selector: "[wmPagination]", outputs: ["resultEmitter", "maxResultsEmitter"] }, { kind: "directive", type: exports.ListItemDirective, selector: "[wmListItem]", inputs: ["wmListItem"], exportAs: ["listItemRef"] }, { kind: "component", type: i1.WmAppIconComponent, selector: "wm-app-icon", inputs: ["icon", "iconclass", "iconurl", "defaultIconClass", "defaultClasses", "iconStyle", "alt"] }] }); }
1548
- };
1549
- exports.ListComponent = tslib.__decorate([
1550
- i1.AutoLayout({ targetSelector: 'ul' }),
1551
- tslib.__metadata("design:paramtypes", [i0.Injector,
1552
- i0.ChangeDetectorRef,
1553
- i1.ToDatePipe,
1554
- i2.App,
1555
- i2.AppDefaults,
1556
- i0.NgZone, String, String, String, String, String, String, i2.StatePersistence,
1557
- i2.PaginationService, Object])
1558
- ], exports.ListComponent);
1559
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0__namespace, type: exports.ListComponent, decorators: [{
1560
- type: i0.Component,
1561
- args: [{ standalone: true, imports: [i3.CommonModule, i1.TextContentDirective, pagination.PaginationComponent, exports.ListItemDirective, i1.WmAppIconComponent], selector: 'div[wmList]', providers: [
1562
- i1.provideAsWidgetRef(exports.ListComponent)
1563
- ], template: "@if (title || subheading || iconclass || iconurl) {\n <div class=\"panel-heading\">\n <h3 class=\"panel-title\">\n <div class=\"pull-left\">\n <wm-app-icon [iconclass]=\"iconclass\" [iconurl]=\"iconurl\" [defaultClasses]=\"'panel-icon'\" alt=\"List icon\"></wm-app-icon>\n </div>\n <div class=\"pull-left\">\n <div class=\"heading\" [innerHTML]=\"title\"></div>\n <div class=\"description\" [innerHTML]=\"subheading\"></div>\n </div>\n </h3>\n </div>\n}\n\n@if (navigation === 'Inline' && !noDataFound) {\n <div class=\"app-datanavigator\" [attr.aria-disabled]=\"dataNavigator.isDisablePrevious\" aria-label=\"Page navigation\">\n <ul class=\"pager\">\n <li class=\"previous\" [ngClass]=\"{'disabled': (dataNavigator ? dataNavigator.isDisablePrevious : true)}\">\n <a href=\"javascript:void(0);\" (click)=\"dataNavigator.navigatePage('prev', $event)\"\n [attr.aria-disabled]=\"dataNavigator.isDisablePrevious\">\n <i class=\"wi wi-chevron-left\" aria-hidden=\"true\"></i>\n <span class=\"sr-only\">Go to Previous page {{dataNavigator.isDisablePrevious ? ', Disabled' : ''}}</span>\n </a>\n </li>\n </ul>\n </div>\n}\n@if (navigation === 'Inline' && !noDataFound) {\n <div aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\"> {{'Page ' + dataNavigator.dn.currentPage + ' of ' + dataNavigator.pageCount }}</div>\n}\n\n<div>\n @if (enablereorder) {\n <div id={{titleId}} class=\"sr-only\">\n Press space bar to toggle drag drop mode, use arrow keys to move selected elements.\n </div>\n }\n\n @if (listItems && enablereorder && currentIndex) {\n <div aria-live=\"assertive\" class=\"sr-only\" >\n {{ariaText + currentIndex + ' of ' + listItems.length}}\n </div>\n }\n</div>\n\n<ul [attr.tabindex]=\"tabindex\" class=\"list-group app-livelist-container clearfix {{direction === 'horizontal' ? 'app-horizontal-list': ''}} {{listclass}}\" role=\"list\"\n [class.list-group-autolayout]=\"hasAutolayout\"\n (keydown.enter)=\"handleKeyDown($event, 'select')\"\n\n (keydown.space)=\"handleKeyDown($event, 'space')\"\n\n (keydown.arrowup)=\"handleKeyDown($event, 'focusPrev')\"\n (keydown.arrowdown)=\"handleKeyDown($event, 'focusNext')\"\n (keydown.arrowleft)=\"handleKeyDown($event, 'focusPrev')\"\n (keydown.arrowright)=\"handleKeyDown($event, 'focusNext')\"\n\n (keydown.shift.arrowup)=\"handleKeyDown($event, 'selectPrev')\"\n (keydown.shift.arrowdown)=\"handleKeyDown($event, 'selectNext')\"\n (keydown.shift.arrowleft)=\"handleKeyDown($event, 'selectPrev')\"\n (keydown.shift.arrowright)=\"handleKeyDown($event, 'selectNext')\"\n [hidden]=\"noDataFound && !variableInflight\"\n >\n @if (!groupby) {\n @for (item of fieldDefs; track item) {\n <li class=\"app-list-item {{direction === 'horizontal' ? '' : itemsPerRowClass}}\" [ngClass]=\"listItemRef.itemClass\"\n [wmListItem]=\"item\"\n #listItemRef=\"listItemRef\"\n [attr.tabindex]=\"tabindex\"\n role=\"listitem\">\n <ng-container [ngTemplateOutlet]=\"listTemplate\"\n [ngTemplateOutletInjector]=\"createCustomInjector('falt_' + listItemRef.trackId, {item: item, row: item, $index: $index, itemRef: listItemRef, $first: $first, $last: $last, currentItemWidgets: listItemRef.currentItemWidgets})\"\n [ngTemplateOutletContext]=\"{item: item, row: item, $index: $index, itemRef: listItemRef, $first: $first, $last: $last, currentItemWidgets: listItemRef.currentItemWidgets}\"></ng-container>\n </li>\n }\n } @else {\n @for (groupObj of groupedData; track groupObj; let groupIndex = $index) {\n <li class=\"app-list-item-group clearfix\">\n <ul [attr.tabindex]=\"tabindex\" class=\"list-group item-group\" [ngClass]=\"listclass\" [class.list-group-autolayout]=\"hasAutolayout\">\n <li class=\"app-list-item-header list-item list-group-header\" (click)=\"handleHeaderClick($event)\" [ngClass]=\"{'collapsible-content': collapsible}\">\n <h4>{{groupObj.key}}\n <div class=\"header-action\">\n @if (collapsible) {\n <i class=\"app-icon wi action wi-chevron-up\"></i>\n }\n @if (showcount) {\n <span class=\"label label-default\">{{groupObj.data.length}}</span>\n }\n </div>\n </h4>\n </li>\n <li class=\"list-group-container\">\n <ul class=\"list-group clearfix {{direction === 'horizontal' ? 'app-horizontal-list': ''}}\" [class.list-group-autolayout]=\"hasAutolayout\">\n @for (item of groupObj.data; track trackByFn($index, item)) {\n <li [attr.tabindex]=\"tabindex\"\n class=\"app-list-item group-list-item {{itemsPerRowClass}}\"\n [ngClass]=\"listItemRef.itemClass\"\n [wmListItem]=\"item\" #listItemRef=\"listItemRef\">\n <ng-container [ngTemplateOutlet]=\"listTemplate\"\n [ngTemplateOutletInjector]=\"createCustomInjector('group_' + listItemRef.trackId, {item: item, row: item, $index: $index, itemRef: listItemRef, $first: $first, $last: $last, currentItemWidgets: listItemRef.currentItemWidgets})\"\n [ngTemplateOutletContext]=\"{item: item, row: item, $index: $index, itemRef: listItemRef, $first: $first, $last: $last, currentItemWidgets: listItemRef.currentItemWidgets}\"></ng-container>\n </li>\n }\n </ul>\n </li>\n </ul>\n </li>\n }\n }\n <ng-container [ngTemplateOutlet]=\"listLeftActionTemplate\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"listRightActionTemplate\"></ng-container>\n</ul>\n\n@if (noDataFound && !variableInflight) {\n <div class=\"no-data-msg\" [textContent]=\"nodatamessage\"></div>\n}\n\n@if (variableInflight && !pulltorefresh) {\n <div class=\"loading-data-msg\">\n <span>\n <wm-app-icon [iconclass]=\"loadingicon\" [iconurl]=\"loadingiconurl\" [defaultClasses]=\"'panel-icon'\" alt=\"loading icon\"></wm-app-icon>\n <span class=\"sr-only\">Loading</span>\n <span class=\"loading-text\" [textContent]=\"loadingdatamsg\"></span>\n </span>\n </div>\n}\n\n@if (navigation === 'Inline' && !noDataFound) {\n <div class=\"app-datanavigator\" [attr.aria-disabled]=\"dataNavigator.isDisableNext\">\n <ul class=\"pager\">\n <li class=\"next\" [ngClass]=\"{'disabled': (dataNavigator ? dataNavigator.isDisableNext : true)}\">\n <a href=\"javascript:void(0);\" (click)=\"dataNavigator.navigatePage('next', $event)\"\n [attr.aria-disabled]=\"dataNavigator.isDisableNext\">\n <i class=\"wi wi-chevron-right\" aria-hidden=\"true\"></i>\n <span class=\"sr-only\">Go to Next page {{dataNavigator.isDisableNext ? ', Disabled' : ''}}</span>\n </a>\n </li>\n </ul>\n </div>\n}\n\n@if (navigation !== 'None') {\n <div class=\"panel-footer\" [hidden]=\"!showNavigation || (onDemandLoad && dataNavigator.isDisableNext) || (dataNavigator?.dataSize <= pagesize && !allowpagesizechange) || (!dataNavigator.dataSize && !dataNavigator.datasource?.pagination?.next)\">\n <nav wmPagination\n navigationalign.bind=\"navigationalign\"\n navigation.bind=\"navControls\"\n showrecordcount.bind=\"showrecordcount\"\n maxsize.bind=\"maxsize\"\n boundarylinks.bind=\"boundarylinks\"\n forceellipses.bind=\"forceellipses\"\n directionlinks.bind=\"directionlinks\"\n show.bind=\"!onDemandLoad\"\n paginationchange.event=\"beforePaginationChange($event, $index)\"\n ></nav>\n @if (onDemandLoad) {\n <a href=\"javascript:void(0);\"\n (click)=\"dataNavigator.navigatePage('next', $event)\"\n class=\"app-button btn btn-block\"\n [ngClass]=\"paginationclass\"\n [textContent]=\"ondemandmessage\"\n ></a>\n }\n </div>\n}\n\n<!--This template will be displayed when groupby is specified-->\n" }]
1564
- }], ctorParameters: () => [{ type: i0__namespace.Injector }, { type: i0__namespace.ChangeDetectorRef }, { type: i1__namespace.ToDatePipe }, { type: i2__namespace.App }, { type: i2__namespace.AppDefaults }, { type: i0__namespace.NgZone }, { type: undefined, decorators: [{
1565
- type: i0.Attribute,
1566
- args: ['itemclass.bind']
1567
- }] }, { type: undefined, decorators: [{
1568
- type: i0.Attribute,
1569
- args: ['disableitem.bind']
1570
- }] }, { type: undefined, decorators: [{
1571
- type: i0.Attribute,
1572
- args: ['dataset.bind']
1573
- }] }, { type: undefined, decorators: [{
1574
- type: i0.Attribute,
1575
- args: ['datasource.bind']
1576
- }] }, { type: undefined, decorators: [{
1577
- type: i0.Attribute,
1578
- args: ['mouseenter.event']
1579
- }] }, { type: undefined, decorators: [{
1580
- type: i0.Attribute,
1581
- args: ['mouseleave.event']
1582
- }] }, { type: i2__namespace.StatePersistence }, { type: i2__namespace.PaginationService }, { type: undefined, decorators: [{
1583
- type: i0.Inject,
1584
- args: ['EXPLICIT_CONTEXT']
1585
- }, {
1586
- type: i0.Optional
1587
- }] }], propDecorators: { listTemplate: [{
1588
- type: i0.ContentChild,
1589
- args: ['listTemplate']
1590
- }], listLeftActionTemplate: [{
1591
- type: i0.ContentChild,
1592
- args: ['listLeftActionTemplate']
1593
- }], listRightActionTemplate: [{
1594
- type: i0.ContentChild,
1595
- args: ['listRightActionTemplate']
1596
- }], btnComponents: [{
1597
- type: i0.ContentChildren,
1598
- args: [button.ButtonComponent]
1599
- }], dataNavigator: [{
1600
- type: i0.ViewChild,
1601
- args: [pagination.PaginationComponent]
1602
- }], listItems: [{
1603
- type: i0.ViewChildren,
1604
- args: [exports.ListItemDirective]
1605
- }] } });
29
+ const registerProps$1 = () => {
30
+ i1.register("wm-list", new Map([
31
+ ["boundarylinks", {
32
+ value: false,
33
+ ...i1.PROP_BOOLEAN
34
+ }],
35
+ ["class", i1.PROP_STRING],
36
+ ["collapsible", i1.PROP_BOOLEAN],
37
+ ["dateformat", i1.PROP_STRING],
38
+ ["dataset", i1.PROP_ANY],
39
+ ["datasource", i1.PROP_ANY],
40
+ ["direction", {
41
+ value: "vertical",
42
+ ...i1.PROP_STRING
43
+ }],
44
+ ["directionlinks", {
45
+ value: true,
46
+ ...i1.PROP_BOOLEAN
47
+ }],
48
+ ["disableitem", i1.PROP_BOOLEAN],
49
+ ["enablereorder", i1.PROP_BOOLEAN],
50
+ ["forceellipses", {
51
+ value: true,
52
+ ...i1.PROP_BOOLEAN
53
+ }],
54
+ ["groupby", i1.PROP_STRING],
55
+ ["iconclass", i1.PROP_STRING],
56
+ ["iconurl", i1.PROP_STRING],
57
+ ["itemclass", {
58
+ value: "",
59
+ ...i1.PROP_STRING
60
+ }],
61
+ ["itemsperrow", i1.PROP_STRING],
62
+ ["listclass", {
63
+ value: "list-group",
64
+ ...i1.PROP_STRING
65
+ }],
66
+ ["multiselect", i1.PROP_BOOLEAN],
67
+ ["loadingdatamsg", {
68
+ value: "Loading...",
69
+ ...i1.PROP_STRING
70
+ }],
71
+ ["loadingicon", {
72
+ value: "fa fa-circle-o-notch",
73
+ ...i1.PROP_STRING
74
+ }],
75
+ ["loadingiconurl", i1.PROP_STRING],
76
+ ["match", i1.PROP_STRING],
77
+ ["maxsize", {
78
+ value: 5,
79
+ ...i1.PROP_NUMBER
80
+ }],
81
+ ["name", i1.PROP_STRING],
82
+ ["navigation", i1.PROP_STRING],
83
+ ["navigationalign", {
84
+ value: "left",
85
+ ...i1.PROP_STRING
86
+ }],
87
+ ["nodatamessage", {
88
+ value: "No data found",
89
+ ...i1.PROP_STRING
90
+ }],
91
+ ["ondemandmessage", {
92
+ value: "Load More",
93
+ ...i1.PROP_STRING
94
+ }],
95
+ ["orderby", i1.PROP_STRING],
96
+ ["paginationclass", i1.PROP_STRING],
97
+ ["pagesize", i1.PROP_NUMBER],
98
+ ["pulltorefresh", {
99
+ value: false,
100
+ ...i1.PROP_BOOLEAN
101
+ }],
102
+ ["selectfirstitem", i1.PROP_BOOLEAN],
103
+ ["selectionlimit", i1.PROP_NUMBER],
104
+ ["show", {
105
+ value: true,
106
+ ...i1.PROP_BOOLEAN
107
+ }],
108
+ ["showcount", i1.PROP_BOOLEAN],
109
+ ["showrecordcount", i1.PROP_BOOLEAN],
110
+ ["statehandler", {
111
+ value: "none",
112
+ ...i1.PROP_STRING
113
+ }],
114
+ ["subheading", i1.PROP_STRING],
115
+ ["tabindex", {
116
+ value: 0,
117
+ ...i1.PROP_NUMBER
118
+ }],
119
+ ["title", i1.PROP_STRING],
120
+ ["allowpagesizechange", {
121
+ value: false,
122
+ ...i1.PROP_BOOLEAN
123
+ }],
124
+ ["pagesizeoptions", {
125
+ value: "5,10,20,50,100",
126
+ ...i1.PROP_STRING
127
+ }],
128
+ ...i1.AUTO_LAYOUT_PROPS
129
+ ]));
130
+ };
131
+ const registerProps = () => {
132
+ i1.register("wm-listtemplate", new Map([...i1.AUTO_LAYOUT_PROPS]));
133
+ };
134
+ const WIDGET_CONFIG$1 = { widgetType: "wm-listtemplate" };
135
+ exports.ListItemDirective = class ListItemDirective extends i1.StylableComponent {
136
+ static {
137
+ this.initializeProps = registerProps();
138
+ }
139
+ onFocus() {
140
+ this.listComponent.lastSelectedItem = this;
141
+ }
142
+ get $index() {
143
+ return this.context.$index;
144
+ }
145
+ get $even() {
146
+ return this.context.even;
147
+ }
148
+ get $odd() {
149
+ return this.context.odd;
150
+ }
151
+ get $first() {
152
+ return this.context.first;
153
+ }
154
+ get $last() {
155
+ return this.context.last;
156
+ }
157
+ get currentItemWidgets() {
158
+ const componentElements = Array.from(this.nativeElement.querySelectorAll("[widget-id]"));
159
+ return Object.assign(this._currentItemWidgets, componentElements.reduce((result, comp) => {
160
+ result[comp.widget.name] = comp.widget;
161
+ return result;
162
+ }, {}));
163
+ }
164
+ set wmListItem(val) {
165
+ this.item = val;
166
+ }
167
+ constructor(inj, elRef, app, renderer, explicitContext) {
168
+ super(inj, WIDGET_CONFIG$1, explicitContext);
169
+ this.app = app;
170
+ this.renderer = renderer;
171
+ this.destroySub = new rxjs.Subject();
172
+ this.destroy$ = this.destroySub.asObservable();
173
+ this.itemClass = "";
174
+ this._currentItemWidgets = {};
175
+ this.trackId = i1.widgetIdGenerator.nextUid();
176
+ this.isActive = false;
177
+ this.disableItem = false;
178
+ this._viewParent = i0.inject(exports.ListComponent, { optional: true });
179
+ i1.styler(this.nativeElement, this, i1.APPLY_STYLES_TYPE.CONTAINER);
180
+ this.viewContainerRef = inj.get(i0.ViewContainerRef);
181
+ this.nativeElement = elRef.nativeElement;
182
+ this.listComponent = this._viewParent;
183
+ this.context = this.inj._lView[8];
184
+ this.itemClassWatcher(this.listComponent);
185
+ this.disableItemWatcher(this.listComponent);
186
+ this.itemAttrsHandler();
187
+ $(this.nativeElement).data("listItemContext", this);
188
+ }
189
+ itemAttrsHandler() {
190
+ const attrsMap = this.listComponent.itemAttrsMap;
191
+ if (!attrsMap) return;
192
+ Object.keys(attrsMap).forEach((key) => {
193
+ const value = attrsMap[key];
194
+ this.setProperty(key, value);
195
+ });
196
+ }
197
+ registerWatch(expression, callback) {
198
+ this.destroy$.subscribe(i1$1.$watch(expression, this.listComponent.viewParent, this, callback));
199
+ }
200
+ itemClassWatcher(listComponent) {
201
+ if (listComponent.binditemclass) this.registerWatch(listComponent.binditemclass, (nv) => this.itemClass = nv || "");
202
+ else this.itemClass = listComponent.itemclass;
203
+ }
204
+ disableItemWatcher($list) {
205
+ if ($list.binddisableitem) this.registerWatch($list.binddisableitem, (nv) => this.disableItem = nv || false);
206
+ else this.disableItem = $list.disableitem || false;
207
+ }
208
+ setUpCUDHandlers() {
209
+ const $editItem = this.nativeElement.querySelector(".edit-list-item");
210
+ const $deleteItem = this.nativeElement.querySelector(".delete-list-item");
211
+ if ($editItem) {
212
+ this.boundEditHandler = (evt) => {
213
+ this.listComponent.update();
214
+ };
215
+ $editItem.addEventListener("click", this.boundEditHandler);
216
+ }
217
+ if ($deleteItem) {
218
+ this.boundDeleteHandler = (evt) => {
219
+ this.listComponent.delete();
220
+ };
221
+ $deleteItem.addEventListener("click", this.boundDeleteHandler);
222
+ }
223
+ }
224
+ ngOnInit() {
225
+ super.ngOnInit();
226
+ if (this.listComponent.mouseEnterCB) {
227
+ this.boundMouseEnterHandler = ($event) => {
228
+ this.listComponent.invokeEventCallback("mouseenter", {
229
+ widget: this,
230
+ $event
231
+ });
232
+ };
233
+ this.nativeElement.addEventListener("mouseenter", this.boundMouseEnterHandler);
234
+ }
235
+ if (this.listComponent.mouseLeaveCB) {
236
+ this.boundMouseLeaveHandler = ($event) => {
237
+ this.listComponent.invokeEventCallback("mouseleave", {
238
+ widget: this,
239
+ $event
240
+ });
241
+ };
242
+ this.nativeElement.addEventListener("mouseleave", this.boundMouseLeaveHandler);
243
+ }
244
+ $(this.nativeElement).attr("listitemindex", this.$index);
245
+ }
246
+ ngAfterViewInit() {
247
+ super.ngAfterViewInit();
248
+ this.setUpCUDHandlers();
249
+ Array.from(this.nativeElement.querySelectorAll("[widget-id]")).forEach((component) => {
250
+ if (component.widget instanceof baseForm.BaseFormComponent) {
251
+ if (!component.widget.$attrs.get("datavaluesource.bind")) component.widget.datavaluesource = this.listComponent["datasource"];
252
+ }
253
+ });
254
+ }
255
+ ngOnDestroy() {
256
+ if (this.boundMouseEnterHandler && this.nativeElement) {
257
+ try {
258
+ this.nativeElement.removeEventListener("mouseenter", this.boundMouseEnterHandler);
259
+ } catch (e) {}
260
+ this.boundMouseEnterHandler = null;
261
+ }
262
+ if (this.boundMouseLeaveHandler && this.nativeElement) {
263
+ try {
264
+ this.nativeElement.removeEventListener("mouseleave", this.boundMouseLeaveHandler);
265
+ } catch (e) {}
266
+ this.boundMouseLeaveHandler = null;
267
+ }
268
+ if (this.nativeElement) {
269
+ const $editItem = this.nativeElement.querySelector(".edit-list-item");
270
+ if ($editItem && this.boundEditHandler) {
271
+ try {
272
+ $editItem.removeEventListener("click", this.boundEditHandler);
273
+ } catch (e) {}
274
+ this.boundEditHandler = null;
275
+ }
276
+ const $deleteItem = this.nativeElement.querySelector(".delete-list-item");
277
+ if ($deleteItem && this.boundDeleteHandler) {
278
+ try {
279
+ $deleteItem.removeEventListener("click", this.boundDeleteHandler);
280
+ } catch (e) {}
281
+ this.boundDeleteHandler = null;
282
+ }
283
+ }
284
+ if (this.context) {
285
+ Object.keys(this.context).forEach((key) => {
286
+ delete this.context[key];
287
+ });
288
+ this.context = null;
289
+ }
290
+ if (this.viewContainerRef) this.viewContainerRef = null;
291
+ if (this.destroySub) {
292
+ try {
293
+ if (!this.destroySub.closed) {
294
+ this.destroySub.next(null);
295
+ this.destroySub.complete();
296
+ }
297
+ } catch (e) {}
298
+ this.destroySub = null;
299
+ }
300
+ super.ngOnDestroy();
301
+ }
302
+ static {
303
+ this.ɵfac = i0__namespace.ɵɵngDeclareFactory({
304
+ minVersion: "12.0.0",
305
+ version: "22.2.1",
306
+ ngImport: i0__namespace,
307
+ type: ListItemDirective,
308
+ deps: [
309
+ { token: i0__namespace.Injector },
310
+ { token: i0__namespace.ElementRef },
311
+ { token: i1$1__namespace.App },
312
+ { token: i0__namespace.Renderer2 },
313
+ {
314
+ token: "EXPLICIT_CONTEXT",
315
+ optional: true
316
+ }
317
+ ],
318
+ target: i0__namespace.ɵɵFactoryTarget.Directive
319
+ });
320
+ }
321
+ static {
322
+ this.ɵdir = i0__namespace.ɵɵngDeclareDirective({
323
+ minVersion: "14.0.0",
324
+ version: "22.2.1",
325
+ type: ListItemDirective,
326
+ isStandalone: true,
327
+ selector: "[wmListItem]",
328
+ inputs: { wmListItem: "wmListItem" },
329
+ host: {
330
+ listeners: { "focus": "onFocus()" },
331
+ properties: {
332
+ "class.active": "this.isActive",
333
+ "class.disable-item": "this.disableItem"
334
+ }
335
+ },
336
+ exportAs: ["listItemRef"],
337
+ usesInheritance: true,
338
+ ngImport: i0__namespace
339
+ });
340
+ }
341
+ };
342
+ exports.ListItemDirective = tslib.__decorate([i1.AutoLayout({ bindParent: "listComponent.viewParent" }), tslib.__metadata("design:paramtypes", [
343
+ i0.Injector,
344
+ i0.ElementRef,
345
+ i1$1.App,
346
+ i0.Renderer2,
347
+ Object
348
+ ])], exports.ListItemDirective);
349
+ i0__namespace.ɵɵngDeclareClassMetadata({
350
+ minVersion: "12.0.0",
351
+ version: "22.2.1",
352
+ ngImport: i0__namespace,
353
+ type: exports.ListItemDirective,
354
+ decorators: [{
355
+ type: i0.Directive,
356
+ args: [{
357
+ standalone: true,
358
+ selector: "[wmListItem]",
359
+ exportAs: "listItemRef"
360
+ }]
361
+ }],
362
+ ctorParameters: () => [
363
+ { type: i0__namespace.Injector },
364
+ { type: i0__namespace.ElementRef },
365
+ { type: i1$1__namespace.App },
366
+ { type: i0__namespace.Renderer2 },
367
+ {
368
+ type: void 0,
369
+ decorators: [{
370
+ type: i0.Inject,
371
+ args: ["EXPLICIT_CONTEXT"]
372
+ }, { type: i0.Optional }]
373
+ }
374
+ ],
375
+ propDecorators: {
376
+ isActive: [{
377
+ type: i0.HostBinding,
378
+ args: ["class.active"]
379
+ }],
380
+ disableItem: [{
381
+ type: i0.HostBinding,
382
+ args: ["class.disable-item"]
383
+ }],
384
+ onFocus: [{
385
+ type: i0.HostListener,
386
+ args: ["focus"]
387
+ }],
388
+ wmListItem: [{ type: i0.Input }]
389
+ }
390
+ });
391
+ const WIDGET_CONFIG = {
392
+ widgetType: "wm-list",
393
+ hostClass: "app-livelist app-panel"
394
+ };
395
+ exports.ListComponent = class ListComponent extends i1.StylableComponent {
396
+ static {
397
+ this.initializeProps = registerProps$1();
398
+ }
399
+ constructor(inj, cdRef, datePipe, app, appDefaults, ngZone, binditemclass, binddisableitem, binddataset, binddatasource, mouseEnterCB, mouseLeaveCB, statePersistence, paginationService, explicitContext) {
400
+ let resolveFn = i1$1.noop;
401
+ const propsInitPromise = new Promise((res) => resolveFn = res);
402
+ super(inj, WIDGET_CONFIG, explicitContext, propsInitPromise);
403
+ this.allowpagesizechange = false;
404
+ this.itemAttrsMap = {};
405
+ this.hasAutolayout = false;
406
+ this.propsInitPromise = propsInitPromise;
407
+ this.promiseResolverFn = resolveFn;
408
+ i1.styler(this.nativeElement, this, i1.APPLY_STYLES_TYPE.SHELL);
409
+ this.cdRef = cdRef;
410
+ this.ngZone = ngZone;
411
+ this.datePipe = datePipe;
412
+ this.statePersistence = statePersistence;
413
+ this.paginationService = paginationService;
414
+ this._pageLoad = true;
415
+ this.binditemclass = binditemclass;
416
+ this.binddisableitem = binddisableitem;
417
+ this.binddataset = binddataset;
418
+ this.mouseEnterCB = mouseEnterCB;
419
+ this.mouseLeaveCB = mouseLeaveCB;
420
+ this.binddatasource = binddatasource;
421
+ this.app = app;
422
+ this.appDefaults = appDefaults;
423
+ this.variableInflight = false;
424
+ this.noDataFound = !binddataset;
425
+ this.titleId = "wmlist-" + i1$1.generateGUId();
426
+ this._listenerDestroyers = [
427
+ this.app.subscribe("check-state-persistence-options", (options) => {
428
+ let dataSourceName = lodashEs.get(this.datasource, "name");
429
+ if (!dataSourceName) dataSourceName = i1.extractDataSourceName(this.binddatasource);
430
+ if (lodashEs.get(options, "variable.name") !== dataSourceName) return;
431
+ this.handleStateParams(options);
432
+ }),
433
+ this.app.subscribe("toggle-variable-state", this.handleLoading.bind(this)),
434
+ this.app.subscribe("setup-cud-listener", (param) => {
435
+ if (this.nativeElement.getAttribute("name") !== param) return;
436
+ this._isDependent = true;
437
+ })
438
+ ];
439
+ }
440
+ get selecteditem() {
441
+ if (this.multiselect) return i1$1.getClonedObject(this._items);
442
+ if (lodashEs.isEmpty(this._items)) return {};
443
+ return i1$1.getClonedObject(this._items[0]);
444
+ }
445
+ set selecteditem(items) {
446
+ this._items.length = 0;
447
+ this.deselectListItems();
448
+ if (lodashEs.isArray(items)) items.forEach((item) => this.selectItem(item));
449
+ else this.selectItem(items);
450
+ i1$1.$appDigest();
451
+ }
452
+ getWidgets(widgteName, index) {
453
+ let $target;
454
+ const retVal = [];
455
+ if (!widgteName) return;
456
+ if (!i1$1.isDefined(index)) {
457
+ lodashEs.forEach(this.listItems.toArray(), (el) => {
458
+ $target = lodashEs.get(el.currentItemWidgets, widgteName);
459
+ if ($target) retVal.push($target);
460
+ });
461
+ return retVal;
462
+ }
463
+ index = +index || 0;
464
+ $target = lodashEs.get(this.listItems.toArray(), index);
465
+ if ($target) return [lodashEs.get($target.currentItemWidgets, widgteName)];
466
+ }
467
+ getItem(index) {
468
+ return this.getListItemByIndex(index);
469
+ }
470
+ getIndex(item) {
471
+ if (item instanceof exports.ListItemDirective) return this.getListItemIndex(item);
472
+ else if (item) return this.fieldDefs.findIndex((obj) => lodashEs.isEqual(obj, item));
473
+ }
474
+ getUpdatedPageSize() {
475
+ return this.updatedPageSize;
476
+ }
477
+ create() {
478
+ if (this._isDependent) this.triggerWMEvent("insert");
479
+ }
480
+ editRow(item) {
481
+ if (this._isDependent) {
482
+ let listItem;
483
+ if (item) listItem = this.getItemRefByIndexOrModel(item).item;
484
+ this.triggerWMEvent("update", listItem);
485
+ }
486
+ }
487
+ update(item) {
488
+ this.editRow(item);
489
+ }
490
+ deleteRow(item) {
491
+ if (this._isDependent) {
492
+ let listItem;
493
+ if (item) listItem = this.getItemRefByIndexOrModel(item).item;
494
+ this.triggerWMEvent("delete", listItem);
495
+ }
496
+ }
497
+ delete(item) {
498
+ this.deleteRow(item);
499
+ }
500
+ handleLoading(data) {
501
+ const dataSource = this.datasource;
502
+ if (dataSource?.execute(i1$1.DataSource.Operation.IS_API_AWARE) && i1$1.isDataSourceEqual(data.variable, dataSource)) this.ngZone.run(() => {
503
+ this.handleStateParams(data);
504
+ this.variableInflight = data.active;
505
+ const totalEle = data.data?.pagination?.totalElements;
506
+ if (!lodashEs.isUndefined(totalEle)) this.noDataFound = totalEle === 0 ? true : false;
507
+ else this.noDataFound = lodashEs.isEmpty(data.data?.data);
508
+ });
509
+ }
510
+ triggerListItemSelection($el, $event) {
511
+ if ($el?.[0]) {
512
+ const listItemContext = $el.data("listItemContext");
513
+ if (listItemContext.listComponent === this) this.onItemClick($event, listItemContext);
514
+ }
515
+ }
516
+ execute(operation, options) {
517
+ if ([
518
+ i1$1.DataSource.Operation.IS_API_AWARE,
519
+ i1$1.DataSource.Operation.IS_PAGEABLE,
520
+ i1$1.DataSource.Operation.SUPPORTS_SERVER_FILTER
521
+ ].includes(operation)) return false;
522
+ return this.datasource.execute(operation, options);
523
+ }
524
+ handleKeyDown($event, action) {
525
+ $event.stopPropagation();
526
+ if ($event.keyCode !== 13 && $event.keyCode !== 9 && !(($event.target.classList.contains("form-control") || $event.target.classList.contains("note-editable")) && $event.keyCode === 32)) $event.preventDefault();
527
+ const listItems = this.listItems;
528
+ let presentIndex = this.getListItemIndex(this.lastSelectedItem);
529
+ if (this.multiselect) {
530
+ const firstIndex = this.getListItemIndex(this.firstSelectedItem);
531
+ const selectCount = lodashEs.isArray(this.selecteditem) ? this.selecteditem.length : i1$1.isObject(this.selecteditem) ? 1 : 0;
532
+ if (action === "selectPrev") {
533
+ if (presentIndex > 0) {
534
+ if (presentIndex <= firstIndex && this.checkSelectionLimit(selectCount)) {
535
+ this.lastSelectedItem = this.getListItemByIndex(presentIndex - 1);
536
+ this.toggleListItemSelection(this.lastSelectedItem);
537
+ } else if (presentIndex > firstIndex) {
538
+ this.toggleListItemSelection(this.getListItemByIndex(presentIndex));
539
+ this.lastSelectedItem = this.getListItemByIndex(presentIndex - 1);
540
+ } else this.invokeEventCallback("selectionlimitexceed", { $event });
541
+ }
542
+ } else if (action === "selectNext") {
543
+ if (presentIndex < listItems.length - 1) {
544
+ if (presentIndex >= firstIndex && this.checkSelectionLimit(selectCount)) {
545
+ this.lastSelectedItem = this.getListItemByIndex(presentIndex + 1);
546
+ this.toggleListItemSelection(this.lastSelectedItem);
547
+ } else if (presentIndex < firstIndex) {
548
+ this.toggleListItemSelection(this.getListItemByIndex(presentIndex));
549
+ this.lastSelectedItem = this.getListItemByIndex(presentIndex + 1);
550
+ } else this.invokeEventCallback("selectionlimitexceed", { $event });
551
+ }
552
+ }
553
+ }
554
+ if (action === "focusPrev") {
555
+ if (this.isListElementMovable) {
556
+ presentIndex = presentIndex <= 0 ? 0 : presentIndex;
557
+ if (presentIndex === 0) return;
558
+ this.lastSelectedItem = this.getListItemByIndex(presentIndex);
559
+ this.getListItemByIndex(presentIndex - 1).nativeElement.before(this.lastSelectedItem.nativeElement);
560
+ this.lastSelectedItem.nativeElement.focus();
561
+ this.statePersistence.removeWidgetState(this, "selectedItem");
562
+ const arr = this.listItems.toArray();
563
+ [arr[presentIndex - 1], arr[presentIndex]] = [arr[presentIndex], arr[presentIndex - 1]];
564
+ this.listItems.reset(arr);
565
+ this.currentIndex = presentIndex;
566
+ this.ariaText = "selected ";
567
+ } else {
568
+ presentIndex = presentIndex <= 0 ? 0 : presentIndex - 1;
569
+ this.lastSelectedItem = this.getListItemByIndex(presentIndex);
570
+ this.lastSelectedItem.nativeElement.focus();
571
+ this.currentIndex = presentIndex + 1;
572
+ this.ariaText = "selected ";
573
+ }
574
+ } else if (action === "focusNext") {
575
+ if (this.isListElementMovable) {
576
+ presentIndex = presentIndex < listItems.length - 1 ? presentIndex : listItems.length - 1;
577
+ if (presentIndex === this.listItems.length - 1) return;
578
+ this.lastSelectedItem = this.getListItemByIndex(presentIndex);
579
+ this.getListItemByIndex(presentIndex + 1).nativeElement.after(this.lastSelectedItem.nativeElement);
580
+ this.lastSelectedItem.nativeElement.focus();
581
+ this.statePersistence.removeWidgetState(this, "selectedItem");
582
+ const arr = this.listItems.toArray();
583
+ [arr[presentIndex], arr[presentIndex + 1]] = [arr[presentIndex + 1], arr[presentIndex]];
584
+ this.listItems.reset(arr);
585
+ this.currentIndex = presentIndex + 2;
586
+ this.ariaText = "selected ";
587
+ } else {
588
+ presentIndex = presentIndex < listItems.length - 1 ? presentIndex + 1 : listItems.length - 1;
589
+ this.lastSelectedItem = this.getListItemByIndex(presentIndex);
590
+ this.lastSelectedItem.nativeElement.focus();
591
+ this.currentIndex = presentIndex + 1;
592
+ this.ariaText = "selected ";
593
+ }
594
+ } else if (action === "select") {
595
+ if (presentIndex === -1 || !$($event.target).closest(this.lastSelectedItem.nativeElement)) {
596
+ const $li = $($event.target).closest("li.app-list-item");
597
+ presentIndex = $li.closest("ul.app-livelist-container").find("li.app-list-item").index($li);
598
+ }
599
+ this.onItemClick($event, this.getListItemByIndex(presentIndex));
600
+ } else if (action === "space") {
601
+ if (!this.enablereorder) return;
602
+ this.isListElementMovable = !this.isListElementMovable;
603
+ this.onItemClick($event, this.getListItemByIndex(presentIndex));
604
+ this.currentIndex = presentIndex + 1;
605
+ if (this.isListElementMovable) {
606
+ this.ariaText = `Item ${this.currentIndex} grabbed, current position `;
607
+ this.$ulEle.data("oldIndex", presentIndex);
608
+ } else {
609
+ this.ariaText = `Item ${this.currentIndex} dropped, final position `;
610
+ this.onUpdate($event, void 0, presentIndex);
611
+ }
612
+ }
613
+ }
614
+ getActualPageSize() {
615
+ return this.actualPageSize || 20;
616
+ }
617
+ onPropertyChange(key, nv, ov) {
618
+ if (key === "dataset") {
619
+ if (!nv && this.binddatasource && !this.datasource) return;
620
+ this.onDataSetChange(nv);
621
+ } else if (key === "datasource") {
622
+ if (this.allowpagesizechange) this.datasource.maxResults = this.pagesize || this.datasource.maxResults;
623
+ if (this.dataset) this.onDataSetChange(this.dataset);
624
+ } else if (key === "navigation") {
625
+ if (nv === "Advanced") {
626
+ this.navigation = "Classic";
627
+ return;
628
+ }
629
+ i1$1.switchClass(this.nativeElement, nv, ov);
630
+ this.onNavigationTypeChange(nv);
631
+ if (this.dataNavigator) this.dataNavigator.navigationClass = this.paginationclass;
632
+ } else if (key === "itemsperrow") i1$1.setListClass(this);
633
+ else if (key === "tabindex") return;
634
+ else if (key === "pulltorefresh" && nv) {
635
+ this.app.notify("pullToRefresh:enable");
636
+ this.subscribeToPullToRefresh();
637
+ } else if (key === "paginationclass") {
638
+ if (this.dataNavigator) setTimeout(() => this.dataNavigator.navigationClass = nv);
639
+ } else if (key === "pagesize") {
640
+ this.actualPageSize = nv;
641
+ this.setDefaultPageSize(nv);
642
+ } else if (key === "enablereorder") {
643
+ if (nv && this.$ulEle) {
644
+ this.$ulEle.attr("aria-describedby", this.titleId);
645
+ this.configureDnD();
646
+ this.$ulEle.sortable("enable");
647
+ } else if (this.$ulEle && !nv) {
648
+ this.$ulEle.removeAttr("aria-describedby");
649
+ this.$ulEle.sortable("disable");
650
+ }
651
+ } else if (key === "multiselect") this.selectedItemWidgets = nv ? [] : {};
652
+ else if (key === "allowpagesizechange") {
653
+ this.allowpagesizechange = nv;
654
+ this.dataNavigator.allowpagesizechange = nv;
655
+ } else if (key === "pagesizeoptions") {
656
+ this.prevPagesizeoptions = this.sanitizeCommaSeparatedIntegers(ov);
657
+ this.pagesizeoptions = this.sanitizeCommaSeparatedIntegers(nv);
658
+ if (this.allowpagesizechange) this.setDefaultPageSize(nv);
659
+ } else super.onPropertyChange(key, nv, ov);
660
+ }
661
+ setDefaultPageSize(nv) {
662
+ if (this.allowpagesizechange) {
663
+ const widgetState = this.statePersistence.getWidgetState(this);
664
+ if (lodashEs.get(widgetState, "pagesize")) {
665
+ nv = lodashEs.get(widgetState, "pagesize");
666
+ this.pagesize = nv;
667
+ } else if (this.pagesizeoptions) {
668
+ nv = this.pagesizeoptions?.split(",").map(Number).sort((a, b) => a - b)[0];
669
+ this.pagesize = nv;
670
+ }
671
+ if (this.isPageSizeOptionsChanged()) {
672
+ this.dataNavigator.defaultPageSizeOptions = this.pagesizeoptions?.split(",").map(Number).sort((a, b) => a - b) || [];
673
+ this.dataNavigator.pageSizeOptions = [...this.dataNavigator.defaultPageSizeOptions];
674
+ }
675
+ }
676
+ this.updatedPageSize = nv;
677
+ this.dataNavigator.updatedPageSize = nv;
678
+ this.dataNavigator.options = { maxResults: nv };
679
+ this.dataNavigator.widget.maxResults = nv;
680
+ this.dataNavigator.maxResults = nv;
681
+ if (this.datasource) this.datasource.maxResults = this.pagesize || this.datasource.maxResults;
682
+ }
683
+ isPageSizeOptionsChanged() {
684
+ return !lodashEs.isEqual(this.prevPagesizeoptions, this.pagesizeoptions);
685
+ }
686
+ selectPageSize(pagesize) {
687
+ if (!this.allowpagesizechange && !pagesize) return;
688
+ if (pagesize < this.dataNavigator.pageSizeOptions[0] || pagesize > this.dataNavigator.pageSizeOptions[this.dataNavigator.pageSizeOptions.length - 1] || !this.dataNavigator.pageSizeOptions.includes(Number(pagesize))) pagesize = this.dataNavigator.pageSizeOptions[0];
689
+ this.dataNavigator.onPageSizeChange(void 0, pagesize);
690
+ }
691
+ sanitizeCommaSeparatedIntegers(input) {
692
+ if (!input) return "";
693
+ return Array.from(new Set(input.split(",").map((v) => v.trim()).filter((v) => /^-?\d+$/.test(v)).map((v) => Math.abs(parseInt(v, 10))))).join(",");
694
+ }
695
+ onItemClick(evt, $listItem) {
696
+ let selectCount;
697
+ if (!$listItem.disableItem) {
698
+ this.firstSelectedItem = this.firstSelectedItem || $listItem;
699
+ selectCount = lodashEs.isArray(this.selecteditem) ? this.selecteditem.length : i1$1.isObject(this.selecteditem) ? 1 : 0;
700
+ if (this.multiselect && i1$1.isMobile()) {
701
+ if (this.checkSelectionLimit(selectCount) || $listItem.isActive) this.toggleListItemSelection($listItem);
702
+ else this.invokeEventCallback("selectionlimitexceed", { $event: evt });
703
+ } else if ((evt.ctrlKey || evt.metaKey) && this.multiselect) {
704
+ if (this.checkSelectionLimit(selectCount) || $listItem.isActive) {
705
+ this.firstSelectedItem = this.lastSelectedItem = $listItem;
706
+ this.toggleListItemSelection($listItem);
707
+ } else this.invokeEventCallback("selectionlimitexceed", { $event: evt });
708
+ } else if (evt.shiftKey && this.multiselect) {
709
+ let first = $listItem.context.index;
710
+ let last = this.firstSelectedItem.context.index;
711
+ if (first > last) last = [first, first = last][0];
712
+ if (this.checkSelectionLimit(last - first)) {
713
+ this.clearSelectedItems();
714
+ this.listItems.forEach(($liItem) => {
715
+ const index = $liItem.context.index;
716
+ if (index >= first && index <= last) this.toggleListItemSelection($liItem);
717
+ });
718
+ this.lastSelectedItem = $listItem;
719
+ } else this.invokeEventCallback("selectionlimitexceed", { $event: evt });
720
+ } else if (!$listItem.isActive || selectCount > 1) {
721
+ this.clearSelectedItems();
722
+ this.toggleListItemSelection($listItem);
723
+ this.firstSelectedItem = this.lastSelectedItem = $listItem;
724
+ }
725
+ i1$1.$appDigest();
726
+ }
727
+ }
728
+ clear() {
729
+ this.updateFieldDefs([]);
730
+ }
731
+ deselectItem(val) {
732
+ const listItem = this.getItemRefByIndexOrModel(val);
733
+ if (listItem?.isActive) this.toggleListItemSelection(listItem);
734
+ }
735
+ selectItem(val, statePersistenceTriggered) {
736
+ const listItem = this.getItemRefByIndexOrModel(val);
737
+ if (!listItem) return;
738
+ if (!listItem.isActive) this.toggleListItemSelection(listItem, statePersistenceTriggered);
739
+ listItem.nativeElement.focus();
740
+ }
741
+ ngOnInit() {
742
+ super.ngOnInit();
743
+ this.handleHeaderClick = i1$1.noop;
744
+ setTimeout(() => {
745
+ this.debouncedFetchNextDatasetOnScroll = this.paginationService.debouncedFetchNextDatasetOnScroll(this.dataNavigator, i1.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME, this);
746
+ }, 0);
747
+ this._items = [];
748
+ this.fieldDefs = [];
749
+ this.reorderProps = {
750
+ minIndex: null,
751
+ maxIndex: null
752
+ };
753
+ const autoLayoutAttrs = [
754
+ "wrap",
755
+ "alignment",
756
+ "gap",
757
+ "columngap"
758
+ ];
759
+ const directionValue = this.nativeElement.getAttribute("direction");
760
+ const hasAutoLayoutDirection = directionValue === "row" || directionValue === "column";
761
+ this.hasAutolayout = hasAutoLayoutDirection || autoLayoutAttrs.some((attr) => this.nativeElement.hasAttribute(attr));
762
+ }
763
+ ngAfterViewInit() {
764
+ this.promiseResolverFn();
765
+ this.propsInitPromise.then(() => {
766
+ super.ngAfterViewInit();
767
+ this.setUpCUDHandlers();
768
+ this.selectedItemWidgets = this.multiselect ? [] : {};
769
+ const ele = $(this.nativeElement).find(".app-livelist-container");
770
+ if (this.enablereorder && !this.groupby) {
771
+ if (ele) ele.attr("aria-describedby", this.titleId);
772
+ this.configureDnD();
773
+ }
774
+ if (!this.enablereorder) {
775
+ if (ele) ele.removeAttr("aria-describedby");
776
+ }
777
+ if (this.groupby && this.collapsible) {
778
+ this.handleHeaderClick = i1.handleHeaderClick;
779
+ this.toggleAllHeaders = i1.toggleAllHeaders.bind(void 0, this);
780
+ }
781
+ i1$1.setListClass(this);
782
+ });
783
+ this.setupHandlers();
784
+ const $ul = this.nativeElement.querySelector("ul.app-livelist-container");
785
+ i1.styler($ul, this, i1.APPLY_STYLES_TYPE.CONTAINER);
786
+ if (this.enablereorder) {
787
+ if ($ul) $ul.setAttribute("aria-describedby", this.titleId);
788
+ }
789
+ if (!this.enablereorder) {
790
+ if ($ul) $ul.removeAttribute("aria-describedby");
791
+ }
792
+ this._readItemAttrsFromHost();
793
+ }
794
+ ngOnDestroy() {
795
+ if (this._listAnimator?.$btnSubscription) {
796
+ this._listAnimator.$btnSubscription.unsubscribe();
797
+ this._listAnimator = null;
798
+ }
799
+ if (this._listenerDestroyers) {
800
+ this._listenerDestroyers.forEach((d) => d?.());
801
+ this._listenerDestroyers = [];
802
+ }
803
+ if (this.navigatorResultWatch) {
804
+ this.navigatorResultWatch.unsubscribe();
805
+ this.navigatorResultWatch = null;
806
+ }
807
+ if (this.navigatorMaxResultWatch) {
808
+ this.navigatorMaxResultWatch.unsubscribe();
809
+ this.navigatorMaxResultWatch = null;
810
+ }
811
+ if (this.listItemsChangesSubscription) {
812
+ this.listItemsChangesSubscription.unsubscribe();
813
+ this.listItemsChangesSubscription = null;
814
+ }
815
+ const ulElement = this.nativeElement?.querySelector("ul.app-livelist-container");
816
+ if (ulElement && this.boundClickHandler) {
817
+ try {
818
+ ulElement.removeEventListener("click", this.boundClickHandler, true);
819
+ } catch (e) {}
820
+ this.boundClickHandler = null;
821
+ }
822
+ if (this.$ulEle?.sortable) {
823
+ try {
824
+ this.$ulEle.sortable("destroy");
825
+ } catch (e) {}
826
+ this.$ulEle = null;
827
+ }
828
+ if (this.listItems) this.listItems = null;
829
+ if (this.btnComponents) this.btnComponents = null;
830
+ this.dataNavigator = null;
831
+ this.listTemplate = null;
832
+ this.listLeftActionTemplate = null;
833
+ this.listRightActionTemplate = null;
834
+ this.fieldDefs = [];
835
+ this._items = [];
836
+ this.groupedData = null;
837
+ if (Array.isArray(this.selectedItemWidgets)) this.selectedItemWidgets = [];
838
+ else this.selectedItemWidgets = {};
839
+ const $addItem = document.getElementsByClassName("add-list-item")[0];
840
+ if ($addItem && this.boundAddItemHandler) {
841
+ $addItem.removeEventListener("click", this.boundAddItemHandler);
842
+ this.boundAddItemHandler = null;
843
+ }
844
+ this.debouncedFetchNextDatasetOnScroll = null;
845
+ this.firstSelectedItem = null;
846
+ this.lastSelectedItem = null;
847
+ this.reorderProps = null;
848
+ super.ngOnDestroy();
849
+ }
850
+ ngOnDetach() {
851
+ super.ngOnDetach();
852
+ this._pageLoad = true;
853
+ }
854
+ handleEvent(node, eventName, eventCallback, locals) {
855
+ const touchToMouse = {
856
+ tap: "click",
857
+ doubletap: "dblclick"
858
+ };
859
+ if (lodashEs.includes([
860
+ "click",
861
+ "tap",
862
+ "dblclick",
863
+ "doubletap"
864
+ ], eventName)) this.eventManager.addEventListener(this.nativeElement, touchToMouse[eventName] || eventName, (evt) => {
865
+ const target = $(evt.target).closest(".app-list-item");
866
+ if (target.length) {
867
+ const listItemContext = target.data("listItemContext");
868
+ if (!listItemContext.disableItem) this.invokeEventCallback(eventName, {
869
+ widget: listItemContext,
870
+ $event: evt,
871
+ item: listItemContext.item
872
+ });
873
+ }
874
+ });
875
+ }
876
+ getConfiguredState() {
877
+ return this.statePersistence.computeMode(this.statehandler)?.toLowerCase();
878
+ }
879
+ handleStateParams(options) {
880
+ if (this._pageLoad && this.getConfiguredState() !== "none") {
881
+ this._pageLoad = false;
882
+ const widgetState = this.statePersistence.getWidgetState(this);
883
+ if (lodashEs.get(widgetState, "pagination")) {
884
+ options.options = options.options || {};
885
+ options.options.page = widgetState.pagination;
886
+ }
887
+ if (lodashEs.get(widgetState, "selectedItem")) this._selectedItemsExist = true;
888
+ }
889
+ }
890
+ triggerWMEvent(eventName, item) {
891
+ i1$1.$invokeWatchers(true);
892
+ let row = this.multiselect ? lodashEs.last(this.selecteditem) : this.selecteditem;
893
+ if (item) row = item;
894
+ this.app.notify("wm-event", {
895
+ eventName,
896
+ widgetName: this.name,
897
+ row
898
+ });
899
+ }
900
+ resetNavigation() {
901
+ this.showNavigation = false;
902
+ this.navControls = void 0;
903
+ this.infScroll = false;
904
+ this.onDemandLoad = false;
905
+ }
906
+ enableBasicNavigation() {
907
+ this.navControls = i1.NAVIGATION_TYPE.BASIC;
908
+ this.showNavigation = true;
909
+ }
910
+ enableInlineNavigation() {
911
+ this.navControls = i1.NAVIGATION_TYPE.INLINE;
912
+ }
913
+ enableClassicNavigation() {
914
+ this.navControls = i1.NAVIGATION_TYPE.CLASSIC;
915
+ this.showNavigation = true;
916
+ }
917
+ enablePagerNavigation() {
918
+ this.navControls = i1.NAVIGATION_TYPE.PAGER;
919
+ this.showNavigation = true;
920
+ }
921
+ setNavigationTypeNone() {
922
+ this.navControls = i1.NAVIGATION_TYPE.NONE;
923
+ this.showNavigation = false;
924
+ }
925
+ enableInfiniteScroll() {
926
+ this.infScroll = true;
927
+ }
928
+ enableOnDemandLoad() {
929
+ this.onDemandLoad = true;
930
+ this.showNavigation = true;
931
+ }
932
+ onNavigationTypeChange(type) {
933
+ this.resetNavigation();
934
+ switch (type) {
935
+ case i1.NAVIGATION_TYPE.BASIC:
936
+ this.enableBasicNavigation();
937
+ break;
938
+ case i1.NAVIGATION_TYPE.INLINE:
939
+ this.enableInlineNavigation();
940
+ break;
941
+ case i1.NAVIGATION_TYPE.ADVANCED:
942
+ case i1.NAVIGATION_TYPE.CLASSIC:
943
+ this.enableClassicNavigation();
944
+ break;
945
+ case i1.NAVIGATION_TYPE.PAGER:
946
+ this.enablePagerNavigation();
947
+ break;
948
+ case i1.NAVIGATION_TYPE.NONE:
949
+ this.setNavigationTypeNone();
950
+ break;
951
+ case i1.NAVIGATION_TYPE.SCROLL:
952
+ this.enableInfiniteScroll();
953
+ break;
954
+ case i1.NAVIGATION_TYPE.ONDEMAND: this.enableOnDemandLoad();
955
+ }
956
+ }
957
+ updateFieldDefs(newVal) {
958
+ if (this.infScroll || this.onDemandLoad) [this.fieldDefs, this.currentPage] = this.paginationService.updateFieldsOnPagination(this, newVal);
959
+ else this.fieldDefs = newVal;
960
+ if (this.orderby) this.fieldDefs = i1.getOrderedDataset(this.fieldDefs, this.orderby);
961
+ if (this.groupby) this.groupedData = i1.groupData(this, this.fieldDefs, this.groupby, this.match, this.orderby, this.dateformat, this.datePipe, void 0, this.appDefaults);
962
+ if (!this.fieldDefs.length) {
963
+ this.noDataFound = true;
964
+ this.selecteditem = void 0;
965
+ }
966
+ i1$1.$appDigest();
967
+ this.listItems.setDirty();
968
+ }
969
+ onDataChange(newVal) {
970
+ if (!lodashEs.isEmpty(newVal)) {
971
+ this.noDataFound = false;
972
+ this.isDataChanged = true;
973
+ if (this.datasource?.execute(i1$1.DataSource.Operation.IS_API_AWARE)) newVal = lodashEs.cloneDeep(newVal);
974
+ if (i1$1.isObject(newVal) && !lodashEs.isArray(newVal)) newVal = lodashEs.isEmpty(newVal) ? [] : [newVal];
975
+ if (lodashEs.isString(newVal)) newVal = newVal.split(",");
976
+ if (this.datasource && this.datasource.owner === "App" && (this.infScroll || this.onDemandLoad) && !this.currentPage && this.datasource.execute(i1$1.DataSource.Operation.GET_PAGING_OPTIONS).number > 0) newVal = this.datasource.execute(i1$1.DataSource.Operation.LIST_RECORDS, { "page": 1 });
977
+ if (lodashEs.isArray(newVal)) {
978
+ if (newVal.length) this.invokeEventCallback("beforedatarender", { $data: newVal });
979
+ this.updateFieldDefs(newVal);
980
+ }
981
+ } else this.updateFieldDefs([]);
982
+ }
983
+ setupDataSource() {
984
+ const dataNavigator = this.dataNavigator;
985
+ dataNavigator.options = { maxResults: this.pagesize || 20 };
986
+ this.dataNavigatorWatched = true;
987
+ if (this.navigatorResultWatch) this.navigatorResultWatch.unsubscribe();
988
+ this.navigatorResultWatch = dataNavigator.resultEmitter.subscribe((newVal) => {
989
+ this.onDataChange(newVal);
990
+ }, true);
991
+ if (this.navigatorMaxResultWatch) this.navigatorMaxResultWatch.unsubscribe();
992
+ this.navigatorMaxResultWatch = dataNavigator.maxResultsEmitter.subscribe((val) => {
993
+ this.pagesize = val;
994
+ });
995
+ dataNavigator.maxResults = this.pagesize || 20;
996
+ this.removePropertyBinding("dataset");
997
+ const datasetBoundExpr = this.getAttr("datasetboundexpr");
998
+ this.dataNavigator.setBindDataSet(this.binddataset, this.viewParent, datasetBoundExpr ? this.context : this.datasource, this.dataset, this.binddatasource, datasetBoundExpr, this.statehandler);
999
+ }
1000
+ onDataSetChange(newVal) {
1001
+ if (lodashEs.get(this.datasource, "category") === "wm.Variable" && this.getConfiguredState() !== "none" && this._pageLoad) {
1002
+ const widgetState = this.statePersistence.getWidgetState(this);
1003
+ this._pageLoad = false;
1004
+ if (this.allowpagesizechange) {
1005
+ if (lodashEs.get(widgetState, "pagination") || lodashEs.get(widgetState, "pagesize")) this.dataNavigator.pageChanged({
1006
+ page: widgetState.pagination || 1,
1007
+ pagesize: widgetState.pagesize
1008
+ }, true);
1009
+ } else if (lodashEs.get(widgetState, "pagination")) this.dataNavigator.pageChanged({ page: widgetState.pagination }, true);
1010
+ if (lodashEs.get(widgetState, "selectedItem")) this._selectedItemsExist = true;
1011
+ }
1012
+ if (!this.dataNavigatorWatched) {
1013
+ if (this.navigation && this.navigation !== i1.NAVIGATION_TYPE.NONE) this.setupDataSource();
1014
+ else this.onDataChange(newVal);
1015
+ } else if (this.navigation && this.navigation !== i1.NAVIGATION_TYPE.NONE) this.dataNavigator.setDataSource(this.datasource);
1016
+ }
1017
+ deselectListItems() {
1018
+ this.listItems.forEach((item) => item.isActive = false);
1019
+ }
1020
+ clearSelectedItems() {
1021
+ this.deselectListItems();
1022
+ this._items.length = 0;
1023
+ i1$1.$appDigest();
1024
+ }
1025
+ getListItemByModel(listModel) {
1026
+ return this.listItems.find((listItem) => {
1027
+ let itemObj = listItem.item;
1028
+ if (this.groupby && !lodashEs.has(listModel, "_groupIndex")) {
1029
+ itemObj = lodashEs.clone(itemObj);
1030
+ delete itemObj._groupIndex;
1031
+ }
1032
+ if (lodashEs.isEqual(itemObj, listModel)) return true;
1033
+ }) || null;
1034
+ }
1035
+ updateSelectedItemsWidgets(statePersistenceTriggered) {
1036
+ let obj = {}, widgetState;
1037
+ const pageNum = lodashEs.get(this.dataNavigator, "dn.currentPage") || 1;
1038
+ if (this.getConfiguredState() !== "none") {
1039
+ widgetState = this.statePersistence.getWidgetState(this) || {};
1040
+ if (lodashEs.get(widgetState, "selectedItem")) {
1041
+ if (this.multiselect && this.selecteditem.length === 1) widgetState.selectedItem = [];
1042
+ else lodashEs.remove(widgetState.selectedItem, function(selectedItem) {
1043
+ return selectedItem.page === pageNum;
1044
+ });
1045
+ }
1046
+ }
1047
+ if (this.multiselect) this.selectedItemWidgets.length = 0;
1048
+ this.listItems.forEach((item, index) => {
1049
+ if (item.isActive) {
1050
+ if (this.multiselect) this.selectedItemWidgets.push(item.currentItemWidgets);
1051
+ else this.selectedItemWidgets = item.currentItemWidgets;
1052
+ obj = {
1053
+ page: pageNum,
1054
+ index
1055
+ };
1056
+ if (lodashEs.get(widgetState, "selectedItem") && this.multiselect) {
1057
+ if (!lodashEs.some(widgetState.selectedItem, obj)) widgetState.selectedItem.push(obj);
1058
+ } else widgetState.selectedItem = [obj];
1059
+ }
1060
+ });
1061
+ if (this.getConfiguredState() !== "none" && !statePersistenceTriggered) {
1062
+ if (i1.unsupportedStatePersistenceTypes.indexOf(this.navigation) < 0) {
1063
+ this.statePersistence.removeWidgetState(this, "selectedItem");
1064
+ this.statePersistence.setWidgetState(this, { "selectedItem": widgetState.selectedItem });
1065
+ } else console.warn("Retain State handling on Widget " + this.name + " is not supported for current pagination type.");
1066
+ }
1067
+ }
1068
+ toggleListItemSelection($listItem, statePersistenceTriggered) {
1069
+ if ($listItem && !$listItem.disableItem) {
1070
+ let item = $listItem.item;
1071
+ if (this.groupby && lodashEs.has(item, "_groupIndex")) {
1072
+ item = lodashEs.clone(item);
1073
+ delete item._groupIndex;
1074
+ }
1075
+ if ($listItem.isActive) {
1076
+ this._items = lodashEs.pullAllWith(this._items, [item], lodashEs.isEqual);
1077
+ $listItem.isActive = false;
1078
+ } else {
1079
+ if (!this.multiselect) this.clearSelectedItems();
1080
+ this._items.push(item);
1081
+ this.invokeEventCallback("select", {
1082
+ widget: $listItem,
1083
+ $data: item
1084
+ });
1085
+ $listItem.isActive = true;
1086
+ }
1087
+ this.updateSelectedItemsWidgets(statePersistenceTriggered);
1088
+ }
1089
+ }
1090
+ onListRender(listItems) {
1091
+ if (this.isDataChanged) {
1092
+ i1$1.$invokeWatchers(true);
1093
+ this.invokeEventCallback("render", { $data: this.fieldDefs });
1094
+ }
1095
+ if (this.isDataChanged && this.getConfiguredState() !== "none" && listItems.length && this._selectedItemsExist) {
1096
+ const widgetState = this.statePersistence.getWidgetState(this);
1097
+ if (lodashEs.get(widgetState, "selectedItem")) {
1098
+ this._selectedItemsExist = false;
1099
+ const selectedItemsLength = lodashEs.isArray(this.selecteditem) ? this.selecteditem.length : lodashEs.toNumber(!lodashEs.isEmpty(this.selecteditem));
1100
+ const currentPage = lodashEs.get(this.dataNavigator, "dn.currentPage") || 1;
1101
+ widgetState.pagination = widgetState.pagination || 1;
1102
+ if (selectedItemsLength !== widgetState.selectedItem.length && widgetState.pagination === currentPage) widgetState.selectedItem.forEach((item) => {
1103
+ if (item.page === currentPage) this.selectItem(item.index, true);
1104
+ });
1105
+ }
1106
+ }
1107
+ const selectedItems = lodashEs.isArray(this.selecteditem) ? this.selecteditem : [this.selecteditem];
1108
+ this.firstSelectedItem = this.lastSelectedItem = null;
1109
+ if (listItems.length && this.selectfirstitem && !(this._items.length && this.multiselect) && this._selectedItemsExist !== false) {
1110
+ const $firstItem = listItems.first;
1111
+ if (!$firstItem.disableItem && this.isDataChanged && !((this.infScroll || this.onDemandLoad) && this._items.length)) {
1112
+ this.clearSelectedItems();
1113
+ this.firstSelectedItem = this.lastSelectedItem = $firstItem;
1114
+ this.selectItem(0);
1115
+ }
1116
+ } else {
1117
+ this.deselectListItems();
1118
+ selectedItems.forEach((selecteditem) => {
1119
+ const listItem = this.getListItemByModel(selecteditem);
1120
+ if (listItem) {
1121
+ listItem.isActive = true;
1122
+ this.lastSelectedItem = listItem;
1123
+ listItem.nativeElement.focus();
1124
+ }
1125
+ });
1126
+ }
1127
+ if (this.fieldDefs.length && this.infScroll) {
1128
+ const modalBody = this.$element.closest(".modal-body");
1129
+ const listHt = this.$element.find("ul").height();
1130
+ const modalHt = window.innerHeight - 140;
1131
+ if (i1$1.isMobile() && modalBody.length && listHt > modalHt) this.$element.css("height", modalHt + "px");
1132
+ setTimeout(() => this.paginationService.bindScrollEvt(this, "> ul", i1.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME), 500);
1133
+ }
1134
+ this.isDataChanged = false;
1135
+ }
1136
+ setupHandlers() {
1137
+ this.listItemsChangesSubscription = this.listItems.changes.subscribe((listItems) => {
1138
+ this.onListRender(listItems);
1139
+ this.cdRef.detectChanges();
1140
+ });
1141
+ this.boundClickHandler = ($event) => {
1142
+ let target = $($event.target).closest(".app-list-item");
1143
+ while (target.get(0) && target.closest("ul.app-livelist-container").get(0) !== $event.currentTarget) target = target.parent().closest(".app-list-item");
1144
+ this.triggerListItemSelection(target, $event);
1145
+ };
1146
+ const ulElement = this.nativeElement.querySelector("ul.app-livelist-container");
1147
+ if (ulElement) ulElement.addEventListener("click", this.boundClickHandler, true);
1148
+ }
1149
+ onReorderStart(evt, ui) {
1150
+ ui.placeholder.height(ui.item.height());
1151
+ this.$ulEle.data("oldIndex", ui.item.index());
1152
+ }
1153
+ onSort(evt, ui) {
1154
+ if (this.infScroll) {
1155
+ const lastItemOffset = this.$ulEle.find(`[listitemindex=${this.fieldDefs.length - 1}]`).offset();
1156
+ if (lastItemOffset && lastItemOffset.top < ui.offset.top) {
1157
+ this.paginationService.bindScrollEvt(this, "> ul", i1.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME);
1158
+ this.debouncedFetchNextDatasetOnScroll();
1159
+ }
1160
+ }
1161
+ }
1162
+ onUpdate(evt, ui, presentIndex) {
1163
+ const data = this.fieldDefs;
1164
+ const newIndex = ui === void 0 ? presentIndex : ui.item.index();
1165
+ const oldIndex = this.$ulEle.data("oldIndex");
1166
+ const minIndex = lodashEs.min([newIndex, oldIndex]);
1167
+ const maxIndex = lodashEs.max([newIndex, oldIndex]);
1168
+ const draggedItem = lodashEs.pullAt(data, oldIndex)[0];
1169
+ if (draggedItem) {
1170
+ if (this.getConfiguredState() !== "none") this.statePersistence.removeWidgetState(this, "selectedItem");
1171
+ this.reorderProps.minIndex = lodashEs.min([minIndex, this.reorderProps.minIndex]);
1172
+ this.reorderProps.maxIndex = lodashEs.max([maxIndex, this.reorderProps.maxIndex]);
1173
+ data.splice(newIndex, 0, draggedItem);
1174
+ this.cdRef.markForCheck();
1175
+ this.cdRef.detectChanges();
1176
+ const $changedItem = {
1177
+ oldIndex,
1178
+ newIndex,
1179
+ item: data[newIndex]
1180
+ };
1181
+ this.invokeEventCallback("reorder", {
1182
+ $event: evt,
1183
+ $data: data,
1184
+ $changedItem
1185
+ });
1186
+ this.$ulEle.removeData("oldIndex");
1187
+ }
1188
+ }
1189
+ configureDnD() {
1190
+ let appendTo;
1191
+ const modalEl = $(document).find(".modal");
1192
+ if (this.getAttr("height")) appendTo = "parent";
1193
+ else if (modalEl.length) appendTo = modalEl[modalEl.length - 1];
1194
+ else appendTo = "body";
1195
+ const options = { appendTo };
1196
+ const $el = $(this.nativeElement);
1197
+ this.$ulEle = $el.find(".app-livelist-container");
1198
+ i1.configureDnD(this.$ulEle, options, this.onReorderStart.bind(this), this.onUpdate.bind(this), this.onSort.bind(this));
1199
+ this.$ulEle.droppable({ "accept": ".app-list-item" });
1200
+ }
1201
+ checkSelectionLimit(count) {
1202
+ return !this.selectionlimit || count < this.selectionlimit;
1203
+ }
1204
+ getListItemByIndex(index) {
1205
+ return this.listItems.toArray()[index];
1206
+ }
1207
+ getListItemIndex(item) {
1208
+ return this.listItems.toArray().indexOf(item);
1209
+ }
1210
+ getItemRefByIndexOrModel(val) {
1211
+ let listItem;
1212
+ if (lodashEs.isNumber(val)) listItem = this.getListItemByIndex(val);
1213
+ else listItem = this.getListItemByModel(val);
1214
+ return listItem;
1215
+ }
1216
+ beforePaginationChange($event, $index) {
1217
+ this.invokeEventCallback("paginationchange", {
1218
+ $event,
1219
+ $index
1220
+ });
1221
+ }
1222
+ trackByFn($index) {
1223
+ return $index;
1224
+ }
1225
+ subscribeToPullToRefresh() {
1226
+ this._listenerDestroyers.push(this.app.subscribe("pulltorefresh", () => {
1227
+ if (this.datasource?.listRecords) this.datasource.listRecords();
1228
+ }));
1229
+ }
1230
+ setUpCUDHandlers() {
1231
+ const $addItem = document.getElementsByClassName("add-list-item")[0];
1232
+ if ($addItem) {
1233
+ this.boundAddItemHandler = (evt) => {
1234
+ this.create();
1235
+ };
1236
+ $addItem.addEventListener("click", this.boundAddItemHandler);
1237
+ }
1238
+ }
1239
+ _readItemAttrsFromHost() {
1240
+ const raw = this.nativeElement.getAttribute("itemattrs");
1241
+ if (!raw) {
1242
+ this.itemAttrsMap = {};
1243
+ return;
1244
+ }
1245
+ try {
1246
+ this.itemAttrsMap = JSON.parse(raw);
1247
+ } catch (e) {
1248
+ console.warn("list.component: failed to parse itemattrs JSON", e, raw);
1249
+ this.itemAttrsMap = {};
1250
+ }
1251
+ }
1252
+ static {
1253
+ this.ɵfac = i0__namespace.ɵɵngDeclareFactory({
1254
+ minVersion: "12.0.0",
1255
+ version: "22.2.1",
1256
+ ngImport: i0__namespace,
1257
+ type: ListComponent,
1258
+ deps: [
1259
+ { token: i0__namespace.Injector },
1260
+ { token: i0__namespace.ChangeDetectorRef },
1261
+ { token: i1__namespace.ToDatePipe },
1262
+ { token: i1$1__namespace.App },
1263
+ { token: i1$1__namespace.AppDefaults },
1264
+ { token: i0__namespace.NgZone },
1265
+ {
1266
+ token: "itemclass.bind",
1267
+ attribute: true
1268
+ },
1269
+ {
1270
+ token: "disableitem.bind",
1271
+ attribute: true
1272
+ },
1273
+ {
1274
+ token: "dataset.bind",
1275
+ attribute: true
1276
+ },
1277
+ {
1278
+ token: "datasource.bind",
1279
+ attribute: true
1280
+ },
1281
+ {
1282
+ token: "mouseenter.event",
1283
+ attribute: true
1284
+ },
1285
+ {
1286
+ token: "mouseleave.event",
1287
+ attribute: true
1288
+ },
1289
+ { token: i1$1__namespace.StatePersistence },
1290
+ { token: i1$1__namespace.PaginationService },
1291
+ {
1292
+ token: "EXPLICIT_CONTEXT",
1293
+ optional: true
1294
+ }
1295
+ ],
1296
+ target: i0__namespace.ɵɵFactoryTarget.Component
1297
+ });
1298
+ }
1299
+ static {
1300
+ this.ɵcmp = i0__namespace.ɵɵngDeclareComponent({
1301
+ minVersion: "17.0.0",
1302
+ version: "22.2.1",
1303
+ type: ListComponent,
1304
+ isStandalone: true,
1305
+ selector: "div[wmList]",
1306
+ providers: [i1.provideAsWidgetRef(ListComponent)],
1307
+ queries: [
1308
+ {
1309
+ propertyName: "listTemplate",
1310
+ first: true,
1311
+ predicate: ["listTemplate"],
1312
+ descendants: true
1313
+ },
1314
+ {
1315
+ propertyName: "listLeftActionTemplate",
1316
+ first: true,
1317
+ predicate: ["listLeftActionTemplate"],
1318
+ descendants: true
1319
+ },
1320
+ {
1321
+ propertyName: "listRightActionTemplate",
1322
+ first: true,
1323
+ predicate: ["listRightActionTemplate"],
1324
+ descendants: true
1325
+ },
1326
+ {
1327
+ propertyName: "btnComponents",
1328
+ predicate: button.ButtonComponent
1329
+ }
1330
+ ],
1331
+ viewQueries: [{
1332
+ propertyName: "dataNavigator",
1333
+ first: true,
1334
+ predicate: pagination.PaginationComponent,
1335
+ descendants: true
1336
+ }, {
1337
+ propertyName: "listItems",
1338
+ predicate: exports.ListItemDirective,
1339
+ descendants: true
1340
+ }],
1341
+ usesInheritance: true,
1342
+ ngImport: i0__namespace,
1343
+ template: "@if (title || subheading || iconclass || iconurl) {\n <div class=\"panel-heading\">\n <h3 class=\"panel-title\">\n <div class=\"pull-left\">\n <wm-app-icon [iconclass]=\"iconclass\" [iconurl]=\"iconurl\" [defaultClasses]=\"'panel-icon'\" alt=\"List icon\"></wm-app-icon>\n </div>\n <div class=\"pull-left\">\n <div class=\"heading\" [innerHTML]=\"title\"></div>\n <div class=\"description\" [innerHTML]=\"subheading\"></div>\n </div>\n </h3>\n </div>\n}\n\n@if (navigation === 'Inline' && !noDataFound) {\n <div class=\"app-datanavigator\" [attr.aria-disabled]=\"dataNavigator.isDisablePrevious\" aria-label=\"Page navigation\">\n <ul class=\"pager\">\n <li class=\"previous\" [ngClass]=\"{'disabled': (dataNavigator ? dataNavigator.isDisablePrevious : true)}\">\n <a href=\"javascript:void(0);\" (click)=\"dataNavigator.navigatePage('prev', $event)\"\n [attr.aria-disabled]=\"dataNavigator.isDisablePrevious\">\n <i class=\"wi wi-chevron-left\" aria-hidden=\"true\"></i>\n <span class=\"sr-only\">Go to Previous page {{dataNavigator.isDisablePrevious ? ', Disabled' : ''}}</span>\n </a>\n </li>\n </ul>\n </div>\n}\n@if (navigation === 'Inline' && !noDataFound) {\n <div aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\"> {{'Page ' + dataNavigator.dn.currentPage + ' of ' + dataNavigator.pageCount }}</div>\n}\n\n<div>\n @if (enablereorder) {\n <div id={{titleId}} class=\"sr-only\">\n Press space bar to toggle drag drop mode, use arrow keys to move selected elements.\n </div>\n }\n\n @if (listItems && enablereorder && currentIndex) {\n <div aria-live=\"assertive\" class=\"sr-only\" >\n {{ariaText + currentIndex + ' of ' + listItems.length}}\n </div>\n }\n</div>\n\n<ul [attr.tabindex]=\"tabindex\" class=\"list-group app-livelist-container clearfix {{direction === 'horizontal' ? 'app-horizontal-list': ''}} {{listclass}}\" role=\"list\"\n [class.list-group-autolayout]=\"hasAutolayout\"\n (keydown.enter)=\"handleKeyDown($event, 'select')\"\n\n (keydown.space)=\"handleKeyDown($event, 'space')\"\n\n (keydown.arrowup)=\"handleKeyDown($event, 'focusPrev')\"\n (keydown.arrowdown)=\"handleKeyDown($event, 'focusNext')\"\n (keydown.arrowleft)=\"handleKeyDown($event, 'focusPrev')\"\n (keydown.arrowright)=\"handleKeyDown($event, 'focusNext')\"\n\n (keydown.shift.arrowup)=\"handleKeyDown($event, 'selectPrev')\"\n (keydown.shift.arrowdown)=\"handleKeyDown($event, 'selectNext')\"\n (keydown.shift.arrowleft)=\"handleKeyDown($event, 'selectPrev')\"\n (keydown.shift.arrowright)=\"handleKeyDown($event, 'selectNext')\"\n [hidden]=\"noDataFound && !variableInflight\"\n >\n @if (!groupby) {\n @for (item of fieldDefs; track item) {\n <li class=\"app-list-item {{direction === 'horizontal' ? '' : itemsPerRowClass}}\" [ngClass]=\"listItemRef.itemClass\"\n [wmListItem]=\"item\"\n #listItemRef=\"listItemRef\"\n [attr.tabindex]=\"tabindex\"\n role=\"listitem\">\n <ng-container [ngTemplateOutlet]=\"listTemplate\"\n [ngTemplateOutletInjector]=\"createCustomInjector('falt_' + listItemRef.trackId, {item: item, row: item, $index: $index, itemRef: listItemRef, $first: $first, $last: $last, currentItemWidgets: listItemRef.currentItemWidgets})\"\n [ngTemplateOutletContext]=\"{item: item, row: item, $index: $index, itemRef: listItemRef, $first: $first, $last: $last, currentItemWidgets: listItemRef.currentItemWidgets}\"></ng-container>\n </li>\n }\n } @else {\n @for (groupObj of groupedData; track groupObj; let groupIndex = $index) {\n <li class=\"app-list-item-group clearfix\">\n <ul [attr.tabindex]=\"tabindex\" class=\"list-group item-group\" [ngClass]=\"listclass\" [class.list-group-autolayout]=\"hasAutolayout\">\n <li class=\"app-list-item-header list-item list-group-header\" (click)=\"handleHeaderClick($event)\" [ngClass]=\"{'collapsible-content': collapsible}\">\n <h4>{{groupObj.key}}\n <div class=\"header-action\">\n @if (collapsible) {\n <i class=\"app-icon wi action wi-chevron-up\"></i>\n }\n @if (showcount) {\n <span class=\"label label-default\">{{groupObj.data.length}}</span>\n }\n </div>\n </h4>\n </li>\n <li class=\"list-group-container\">\n <ul class=\"list-group clearfix {{direction === 'horizontal' ? 'app-horizontal-list': ''}}\" [class.list-group-autolayout]=\"hasAutolayout\">\n @for (item of groupObj.data; track trackByFn($index, item)) {\n <li [attr.tabindex]=\"tabindex\"\n class=\"app-list-item group-list-item {{itemsPerRowClass}}\"\n [ngClass]=\"listItemRef.itemClass\"\n [wmListItem]=\"item\" #listItemRef=\"listItemRef\">\n <ng-container [ngTemplateOutlet]=\"listTemplate\"\n [ngTemplateOutletInjector]=\"createCustomInjector('group_' + listItemRef.trackId, {item: item, row: item, $index: $index, itemRef: listItemRef, $first: $first, $last: $last, currentItemWidgets: listItemRef.currentItemWidgets})\"\n [ngTemplateOutletContext]=\"{item: item, row: item, $index: $index, itemRef: listItemRef, $first: $first, $last: $last, currentItemWidgets: listItemRef.currentItemWidgets}\"></ng-container>\n </li>\n }\n </ul>\n </li>\n </ul>\n </li>\n }\n }\n <ng-container [ngTemplateOutlet]=\"listLeftActionTemplate\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"listRightActionTemplate\"></ng-container>\n</ul>\n\n@if (noDataFound && !variableInflight) {\n <div class=\"no-data-msg\" [textContent]=\"nodatamessage\"></div>\n}\n\n@if (variableInflight && !pulltorefresh) {\n <div class=\"loading-data-msg\">\n <span>\n <wm-app-icon [iconclass]=\"loadingicon\" [iconurl]=\"loadingiconurl\" [defaultClasses]=\"'panel-icon'\" alt=\"loading icon\"></wm-app-icon>\n <span class=\"sr-only\">Loading</span>\n <span class=\"loading-text\" [textContent]=\"loadingdatamsg\"></span>\n </span>\n </div>\n}\n\n@if (navigation === 'Inline' && !noDataFound) {\n <div class=\"app-datanavigator\" [attr.aria-disabled]=\"dataNavigator.isDisableNext\">\n <ul class=\"pager\">\n <li class=\"next\" [ngClass]=\"{'disabled': (dataNavigator ? dataNavigator.isDisableNext : true)}\">\n <a href=\"javascript:void(0);\" (click)=\"dataNavigator.navigatePage('next', $event)\"\n [attr.aria-disabled]=\"dataNavigator.isDisableNext\">\n <i class=\"wi wi-chevron-right\" aria-hidden=\"true\"></i>\n <span class=\"sr-only\">Go to Next page {{dataNavigator.isDisableNext ? ', Disabled' : ''}}</span>\n </a>\n </li>\n </ul>\n </div>\n}\n\n@if (navigation !== 'None') {\n <div class=\"panel-footer\" [hidden]=\"!showNavigation || (onDemandLoad && dataNavigator.isDisableNext) || (dataNavigator?.dataSize <= pagesize && !allowpagesizechange) || (!dataNavigator.dataSize && !dataNavigator.datasource?.pagination?.next)\">\n <nav wmPagination\n navigationalign.bind=\"navigationalign\"\n navigation.bind=\"navControls\"\n showrecordcount.bind=\"showrecordcount\"\n maxsize.bind=\"maxsize\"\n boundarylinks.bind=\"boundarylinks\"\n forceellipses.bind=\"forceellipses\"\n directionlinks.bind=\"directionlinks\"\n show.bind=\"!onDemandLoad\"\n paginationchange.event=\"beforePaginationChange($event, $index)\"\n ></nav>\n @if (onDemandLoad) {\n <a href=\"javascript:void(0);\"\n (click)=\"dataNavigator.navigatePage('next', $event)\"\n class=\"app-button btn btn-block\"\n [ngClass]=\"paginationclass\"\n [textContent]=\"ondemandmessage\"\n ></a>\n }\n </div>\n}\n\n<!--This template will be displayed when groupby is specified-->\n",
1344
+ dependencies: [
1345
+ {
1346
+ kind: "ngmodule",
1347
+ type: i3.CommonModule
1348
+ },
1349
+ {
1350
+ kind: "directive",
1351
+ type: i3__namespace.NgClass,
1352
+ selector: "[ngClass]",
1353
+ inputs: ["class", "ngClass"]
1354
+ },
1355
+ {
1356
+ kind: "directive",
1357
+ type: i3__namespace.NgTemplateOutlet,
1358
+ selector: "[ngTemplateOutlet]",
1359
+ inputs: [
1360
+ "ngTemplateOutletContext",
1361
+ "ngTemplateOutlet",
1362
+ "ngTemplateOutletInjector"
1363
+ ]
1364
+ },
1365
+ {
1366
+ kind: "directive",
1367
+ type: i1.TextContentDirective,
1368
+ selector: "[textContent]",
1369
+ inputs: ["textContent"]
1370
+ },
1371
+ {
1372
+ kind: "component",
1373
+ type: pagination.PaginationComponent,
1374
+ selector: "[wmPagination]",
1375
+ outputs: ["resultEmitter", "maxResultsEmitter"]
1376
+ },
1377
+ {
1378
+ kind: "directive",
1379
+ type: exports.ListItemDirective,
1380
+ selector: "[wmListItem]",
1381
+ inputs: ["wmListItem"],
1382
+ exportAs: ["listItemRef"]
1383
+ },
1384
+ {
1385
+ kind: "component",
1386
+ type: i1.WmAppIconComponent,
1387
+ selector: "wm-app-icon",
1388
+ inputs: [
1389
+ "icon",
1390
+ "iconclass",
1391
+ "iconurl",
1392
+ "defaultIconClass",
1393
+ "defaultClasses",
1394
+ "iconStyle",
1395
+ "alt"
1396
+ ]
1397
+ }
1398
+ ],
1399
+ changeDetection: i0__namespace.ChangeDetectionStrategy.Eager
1400
+ });
1401
+ }
1402
+ };
1403
+ exports.ListComponent = tslib.__decorate([i1.AutoLayout({ targetSelector: "ul" }), tslib.__metadata("design:paramtypes", [
1404
+ i0.Injector,
1405
+ i0.ChangeDetectorRef,
1406
+ i1.ToDatePipe,
1407
+ i1$1.App,
1408
+ i1$1.AppDefaults,
1409
+ i0.NgZone,
1410
+ String,
1411
+ String,
1412
+ String,
1413
+ String,
1414
+ String,
1415
+ String,
1416
+ i1$1.StatePersistence,
1417
+ i1$1.PaginationService,
1418
+ Object
1419
+ ])], exports.ListComponent);
1420
+ i0__namespace.ɵɵngDeclareClassMetadata({
1421
+ minVersion: "12.0.0",
1422
+ version: "22.2.1",
1423
+ ngImport: i0__namespace,
1424
+ type: exports.ListComponent,
1425
+ decorators: [{
1426
+ type: i0.Component,
1427
+ args: [{
1428
+ changeDetection: i0.ChangeDetectionStrategy.Eager,
1429
+ standalone: true,
1430
+ imports: [
1431
+ i3.CommonModule,
1432
+ i1.TextContentDirective,
1433
+ pagination.PaginationComponent,
1434
+ exports.ListItemDirective,
1435
+ i1.WmAppIconComponent
1436
+ ],
1437
+ selector: "div[wmList]",
1438
+ providers: [i1.provideAsWidgetRef(exports.ListComponent)],
1439
+ template: "@if (title || subheading || iconclass || iconurl) {\n <div class=\"panel-heading\">\n <h3 class=\"panel-title\">\n <div class=\"pull-left\">\n <wm-app-icon [iconclass]=\"iconclass\" [iconurl]=\"iconurl\" [defaultClasses]=\"'panel-icon'\" alt=\"List icon\"></wm-app-icon>\n </div>\n <div class=\"pull-left\">\n <div class=\"heading\" [innerHTML]=\"title\"></div>\n <div class=\"description\" [innerHTML]=\"subheading\"></div>\n </div>\n </h3>\n </div>\n}\n\n@if (navigation === 'Inline' && !noDataFound) {\n <div class=\"app-datanavigator\" [attr.aria-disabled]=\"dataNavigator.isDisablePrevious\" aria-label=\"Page navigation\">\n <ul class=\"pager\">\n <li class=\"previous\" [ngClass]=\"{'disabled': (dataNavigator ? dataNavigator.isDisablePrevious : true)}\">\n <a href=\"javascript:void(0);\" (click)=\"dataNavigator.navigatePage('prev', $event)\"\n [attr.aria-disabled]=\"dataNavigator.isDisablePrevious\">\n <i class=\"wi wi-chevron-left\" aria-hidden=\"true\"></i>\n <span class=\"sr-only\">Go to Previous page {{dataNavigator.isDisablePrevious ? ', Disabled' : ''}}</span>\n </a>\n </li>\n </ul>\n </div>\n}\n@if (navigation === 'Inline' && !noDataFound) {\n <div aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\"> {{'Page ' + dataNavigator.dn.currentPage + ' of ' + dataNavigator.pageCount }}</div>\n}\n\n<div>\n @if (enablereorder) {\n <div id={{titleId}} class=\"sr-only\">\n Press space bar to toggle drag drop mode, use arrow keys to move selected elements.\n </div>\n }\n\n @if (listItems && enablereorder && currentIndex) {\n <div aria-live=\"assertive\" class=\"sr-only\" >\n {{ariaText + currentIndex + ' of ' + listItems.length}}\n </div>\n }\n</div>\n\n<ul [attr.tabindex]=\"tabindex\" class=\"list-group app-livelist-container clearfix {{direction === 'horizontal' ? 'app-horizontal-list': ''}} {{listclass}}\" role=\"list\"\n [class.list-group-autolayout]=\"hasAutolayout\"\n (keydown.enter)=\"handleKeyDown($event, 'select')\"\n\n (keydown.space)=\"handleKeyDown($event, 'space')\"\n\n (keydown.arrowup)=\"handleKeyDown($event, 'focusPrev')\"\n (keydown.arrowdown)=\"handleKeyDown($event, 'focusNext')\"\n (keydown.arrowleft)=\"handleKeyDown($event, 'focusPrev')\"\n (keydown.arrowright)=\"handleKeyDown($event, 'focusNext')\"\n\n (keydown.shift.arrowup)=\"handleKeyDown($event, 'selectPrev')\"\n (keydown.shift.arrowdown)=\"handleKeyDown($event, 'selectNext')\"\n (keydown.shift.arrowleft)=\"handleKeyDown($event, 'selectPrev')\"\n (keydown.shift.arrowright)=\"handleKeyDown($event, 'selectNext')\"\n [hidden]=\"noDataFound && !variableInflight\"\n >\n @if (!groupby) {\n @for (item of fieldDefs; track item) {\n <li class=\"app-list-item {{direction === 'horizontal' ? '' : itemsPerRowClass}}\" [ngClass]=\"listItemRef.itemClass\"\n [wmListItem]=\"item\"\n #listItemRef=\"listItemRef\"\n [attr.tabindex]=\"tabindex\"\n role=\"listitem\">\n <ng-container [ngTemplateOutlet]=\"listTemplate\"\n [ngTemplateOutletInjector]=\"createCustomInjector('falt_' + listItemRef.trackId, {item: item, row: item, $index: $index, itemRef: listItemRef, $first: $first, $last: $last, currentItemWidgets: listItemRef.currentItemWidgets})\"\n [ngTemplateOutletContext]=\"{item: item, row: item, $index: $index, itemRef: listItemRef, $first: $first, $last: $last, currentItemWidgets: listItemRef.currentItemWidgets}\"></ng-container>\n </li>\n }\n } @else {\n @for (groupObj of groupedData; track groupObj; let groupIndex = $index) {\n <li class=\"app-list-item-group clearfix\">\n <ul [attr.tabindex]=\"tabindex\" class=\"list-group item-group\" [ngClass]=\"listclass\" [class.list-group-autolayout]=\"hasAutolayout\">\n <li class=\"app-list-item-header list-item list-group-header\" (click)=\"handleHeaderClick($event)\" [ngClass]=\"{'collapsible-content': collapsible}\">\n <h4>{{groupObj.key}}\n <div class=\"header-action\">\n @if (collapsible) {\n <i class=\"app-icon wi action wi-chevron-up\"></i>\n }\n @if (showcount) {\n <span class=\"label label-default\">{{groupObj.data.length}}</span>\n }\n </div>\n </h4>\n </li>\n <li class=\"list-group-container\">\n <ul class=\"list-group clearfix {{direction === 'horizontal' ? 'app-horizontal-list': ''}}\" [class.list-group-autolayout]=\"hasAutolayout\">\n @for (item of groupObj.data; track trackByFn($index, item)) {\n <li [attr.tabindex]=\"tabindex\"\n class=\"app-list-item group-list-item {{itemsPerRowClass}}\"\n [ngClass]=\"listItemRef.itemClass\"\n [wmListItem]=\"item\" #listItemRef=\"listItemRef\">\n <ng-container [ngTemplateOutlet]=\"listTemplate\"\n [ngTemplateOutletInjector]=\"createCustomInjector('group_' + listItemRef.trackId, {item: item, row: item, $index: $index, itemRef: listItemRef, $first: $first, $last: $last, currentItemWidgets: listItemRef.currentItemWidgets})\"\n [ngTemplateOutletContext]=\"{item: item, row: item, $index: $index, itemRef: listItemRef, $first: $first, $last: $last, currentItemWidgets: listItemRef.currentItemWidgets}\"></ng-container>\n </li>\n }\n </ul>\n </li>\n </ul>\n </li>\n }\n }\n <ng-container [ngTemplateOutlet]=\"listLeftActionTemplate\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"listRightActionTemplate\"></ng-container>\n</ul>\n\n@if (noDataFound && !variableInflight) {\n <div class=\"no-data-msg\" [textContent]=\"nodatamessage\"></div>\n}\n\n@if (variableInflight && !pulltorefresh) {\n <div class=\"loading-data-msg\">\n <span>\n <wm-app-icon [iconclass]=\"loadingicon\" [iconurl]=\"loadingiconurl\" [defaultClasses]=\"'panel-icon'\" alt=\"loading icon\"></wm-app-icon>\n <span class=\"sr-only\">Loading</span>\n <span class=\"loading-text\" [textContent]=\"loadingdatamsg\"></span>\n </span>\n </div>\n}\n\n@if (navigation === 'Inline' && !noDataFound) {\n <div class=\"app-datanavigator\" [attr.aria-disabled]=\"dataNavigator.isDisableNext\">\n <ul class=\"pager\">\n <li class=\"next\" [ngClass]=\"{'disabled': (dataNavigator ? dataNavigator.isDisableNext : true)}\">\n <a href=\"javascript:void(0);\" (click)=\"dataNavigator.navigatePage('next', $event)\"\n [attr.aria-disabled]=\"dataNavigator.isDisableNext\">\n <i class=\"wi wi-chevron-right\" aria-hidden=\"true\"></i>\n <span class=\"sr-only\">Go to Next page {{dataNavigator.isDisableNext ? ', Disabled' : ''}}</span>\n </a>\n </li>\n </ul>\n </div>\n}\n\n@if (navigation !== 'None') {\n <div class=\"panel-footer\" [hidden]=\"!showNavigation || (onDemandLoad && dataNavigator.isDisableNext) || (dataNavigator?.dataSize <= pagesize && !allowpagesizechange) || (!dataNavigator.dataSize && !dataNavigator.datasource?.pagination?.next)\">\n <nav wmPagination\n navigationalign.bind=\"navigationalign\"\n navigation.bind=\"navControls\"\n showrecordcount.bind=\"showrecordcount\"\n maxsize.bind=\"maxsize\"\n boundarylinks.bind=\"boundarylinks\"\n forceellipses.bind=\"forceellipses\"\n directionlinks.bind=\"directionlinks\"\n show.bind=\"!onDemandLoad\"\n paginationchange.event=\"beforePaginationChange($event, $index)\"\n ></nav>\n @if (onDemandLoad) {\n <a href=\"javascript:void(0);\"\n (click)=\"dataNavigator.navigatePage('next', $event)\"\n class=\"app-button btn btn-block\"\n [ngClass]=\"paginationclass\"\n [textContent]=\"ondemandmessage\"\n ></a>\n }\n </div>\n}\n\n<!--This template will be displayed when groupby is specified-->\n"
1440
+ }]
1441
+ }],
1442
+ ctorParameters: () => [
1443
+ { type: i0__namespace.Injector },
1444
+ { type: i0__namespace.ChangeDetectorRef },
1445
+ { type: i1__namespace.ToDatePipe },
1446
+ { type: i1$1__namespace.App },
1447
+ { type: i1$1__namespace.AppDefaults },
1448
+ { type: i0__namespace.NgZone },
1449
+ {
1450
+ type: void 0,
1451
+ decorators: [{
1452
+ type: i0.Attribute,
1453
+ args: ["itemclass.bind"]
1454
+ }]
1455
+ },
1456
+ {
1457
+ type: void 0,
1458
+ decorators: [{
1459
+ type: i0.Attribute,
1460
+ args: ["disableitem.bind"]
1461
+ }]
1462
+ },
1463
+ {
1464
+ type: void 0,
1465
+ decorators: [{
1466
+ type: i0.Attribute,
1467
+ args: ["dataset.bind"]
1468
+ }]
1469
+ },
1470
+ {
1471
+ type: void 0,
1472
+ decorators: [{
1473
+ type: i0.Attribute,
1474
+ args: ["datasource.bind"]
1475
+ }]
1476
+ },
1477
+ {
1478
+ type: void 0,
1479
+ decorators: [{
1480
+ type: i0.Attribute,
1481
+ args: ["mouseenter.event"]
1482
+ }]
1483
+ },
1484
+ {
1485
+ type: void 0,
1486
+ decorators: [{
1487
+ type: i0.Attribute,
1488
+ args: ["mouseleave.event"]
1489
+ }]
1490
+ },
1491
+ { type: i1$1__namespace.StatePersistence },
1492
+ { type: i1$1__namespace.PaginationService },
1493
+ {
1494
+ type: void 0,
1495
+ decorators: [{
1496
+ type: i0.Inject,
1497
+ args: ["EXPLICIT_CONTEXT"]
1498
+ }, { type: i0.Optional }]
1499
+ }
1500
+ ],
1501
+ propDecorators: {
1502
+ listTemplate: [{
1503
+ type: i0.ContentChild,
1504
+ args: ["listTemplate"]
1505
+ }],
1506
+ listLeftActionTemplate: [{
1507
+ type: i0.ContentChild,
1508
+ args: ["listLeftActionTemplate"]
1509
+ }],
1510
+ listRightActionTemplate: [{
1511
+ type: i0.ContentChild,
1512
+ args: ["listRightActionTemplate"]
1513
+ }],
1514
+ btnComponents: [{
1515
+ type: i0.ContentChildren,
1516
+ args: [button.ButtonComponent]
1517
+ }],
1518
+ dataNavigator: [{
1519
+ type: i0.ViewChild,
1520
+ args: [pagination.PaginationComponent]
1521
+ }],
1522
+ listItems: [{
1523
+ type: i0.ViewChildren,
1524
+ args: [exports.ListItemDirective]
1525
+ }]
1526
+ }
1527
+ });
1606
1528
 
1607
1529
  }));