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