@wavemaker-ai/app-ng-runtime 12.0.0-rc.335 → 12.0.1-rc.338

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 (351) hide show
  1. package/build-task/bundles/index.umd.js +15 -16
  2. package/build-task/fesm2022/index.mjs +15 -16
  3. package/build-task/fesm2022/index.mjs.map +1 -1
  4. package/components/advanced/carousel/bundles/index.umd.js +9 -9
  5. package/components/advanced/carousel/fesm2022/index.mjs +9 -9
  6. package/components/advanced/carousel/fesm2022/index.mjs.map +1 -1
  7. package/components/advanced/carousel/types/index.d.ts +7 -7
  8. package/components/advanced/custom/bundles/index.umd.js +9 -10
  9. package/components/advanced/custom/fesm2022/index.mjs +9 -10
  10. package/components/advanced/custom/fesm2022/index.mjs.map +1 -1
  11. package/components/advanced/custom/types/index.d.ts +3 -3
  12. package/components/advanced/login/bundles/index.umd.js +3 -3
  13. package/components/advanced/login/fesm2022/index.mjs +3 -3
  14. package/components/advanced/login/fesm2022/index.mjs.map +1 -1
  15. package/components/advanced/login/types/index.d.ts +1 -1
  16. package/components/advanced/marquee/bundles/index.umd.js +3 -3
  17. package/components/advanced/marquee/fesm2022/index.mjs +3 -3
  18. package/components/advanced/marquee/fesm2022/index.mjs.map +1 -1
  19. package/components/advanced/marquee/types/index.d.ts +1 -1
  20. package/components/base/bundles/index.umd.js +40 -46
  21. package/components/base/fesm2022/index.mjs +40 -46
  22. package/components/base/fesm2022/index.mjs.map +1 -1
  23. package/components/base/types/index.d.ts +47 -46
  24. package/components/basic/anchor/bundles/index.umd.js +3 -3
  25. package/components/basic/anchor/fesm2022/index.mjs +3 -3
  26. package/components/basic/anchor/fesm2022/index.mjs.map +1 -1
  27. package/components/basic/anchor/types/index.d.ts +3 -3
  28. package/components/basic/audio/bundles/index.umd.js +3 -3
  29. package/components/basic/audio/fesm2022/index.mjs +3 -3
  30. package/components/basic/audio/fesm2022/index.mjs.map +1 -1
  31. package/components/basic/audio/types/index.d.ts +1 -1
  32. package/components/basic/html/bundles/index.umd.js +10 -11
  33. package/components/basic/html/fesm2022/index.mjs +10 -11
  34. package/components/basic/html/fesm2022/index.mjs.map +1 -1
  35. package/components/basic/html/types/index.d.ts +3 -3
  36. package/components/basic/icon/bundles/index.umd.js +3 -3
  37. package/components/basic/icon/fesm2022/index.mjs +3 -3
  38. package/components/basic/icon/fesm2022/index.mjs.map +1 -1
  39. package/components/basic/icon/types/index.d.ts +1 -1
  40. package/components/basic/iframe/bundles/index.umd.js +5 -5
  41. package/components/basic/iframe/fesm2022/index.mjs +5 -5
  42. package/components/basic/iframe/fesm2022/index.mjs.map +1 -1
  43. package/components/basic/iframe/types/index.d.ts +3 -3
  44. package/components/basic/label/bundles/index.umd.js +10 -11
  45. package/components/basic/label/fesm2022/index.mjs +10 -11
  46. package/components/basic/label/fesm2022/index.mjs.map +1 -1
  47. package/components/basic/label/types/index.d.ts +1 -1
  48. package/components/basic/picture/bundles/index.umd.js +3 -3
  49. package/components/basic/picture/fesm2022/index.mjs +3 -3
  50. package/components/basic/picture/fesm2022/index.mjs.map +1 -1
  51. package/components/basic/picture/types/index.d.ts +2 -2
  52. package/components/basic/progress/progress-bar/bundles/index.umd.js +8 -10
  53. package/components/basic/progress/progress-bar/fesm2022/index.mjs +8 -10
  54. package/components/basic/progress/progress-bar/fesm2022/index.mjs.map +1 -1
  55. package/components/basic/progress/progress-bar/types/index.d.ts +2 -2
  56. package/components/basic/progress/progress-circle/bundles/index.umd.js +3 -3
  57. package/components/basic/progress/progress-circle/fesm2022/index.mjs +3 -3
  58. package/components/basic/progress/progress-circle/fesm2022/index.mjs.map +1 -1
  59. package/components/basic/progress/progress-circle/types/index.d.ts +2 -2
  60. package/components/basic/rich-text-editor/bundles/index.umd.js +3 -3
  61. package/components/basic/rich-text-editor/fesm2022/index.mjs +3 -3
  62. package/components/basic/rich-text-editor/fesm2022/index.mjs.map +1 -1
  63. package/components/basic/rich-text-editor/types/index.d.ts +3 -3
  64. package/components/basic/search/bundles/index.umd.js +40 -42
  65. package/components/basic/search/fesm2022/index.mjs +40 -42
  66. package/components/basic/search/fesm2022/index.mjs.map +1 -1
  67. package/components/basic/search/types/index.d.ts +13 -13
  68. package/components/basic/spinner/bundles/index.umd.js +3 -3
  69. package/components/basic/spinner/fesm2022/index.mjs +3 -3
  70. package/components/basic/spinner/fesm2022/index.mjs.map +1 -1
  71. package/components/basic/spinner/types/index.d.ts +3 -3
  72. package/components/basic/tree/bundles/index.umd.js +9 -9
  73. package/components/basic/tree/fesm2022/index.mjs +9 -9
  74. package/components/basic/tree/fesm2022/index.mjs.map +1 -1
  75. package/components/basic/tree/types/index.d.ts +7 -7
  76. package/components/basic/video/bundles/index.umd.js +3 -3
  77. package/components/basic/video/fesm2022/index.mjs +3 -3
  78. package/components/basic/video/fesm2022/index.mjs.map +1 -1
  79. package/components/basic/video/types/index.d.ts +2 -2
  80. package/components/chart/bundles/index.umd.js +19 -22
  81. package/components/chart/fesm2022/index.mjs +20 -23
  82. package/components/chart/fesm2022/index.mjs.map +1 -1
  83. package/components/chart/types/index.d.ts +9 -9
  84. package/components/containers/accordion/bundles/index.umd.js +10 -12
  85. package/components/containers/accordion/fesm2022/index.mjs +10 -12
  86. package/components/containers/accordion/fesm2022/index.mjs.map +1 -1
  87. package/components/containers/accordion/types/index.d.ts +9 -9
  88. package/components/containers/layout-grid/bundles/index.umd.js +9 -9
  89. package/components/containers/layout-grid/fesm2022/index.mjs +9 -9
  90. package/components/containers/layout-grid/fesm2022/index.mjs.map +1 -1
  91. package/components/containers/layout-grid/types/index.d.ts +4 -4
  92. package/components/containers/linear-layout/bundles/index.umd.js +6 -6
  93. package/components/containers/linear-layout/fesm2022/index.mjs +6 -6
  94. package/components/containers/linear-layout/fesm2022/index.mjs.map +1 -1
  95. package/components/containers/linear-layout/types/index.d.ts +2 -2
  96. package/components/containers/panel/bundles/index.umd.js +3 -3
  97. package/components/containers/panel/fesm2022/index.mjs +3 -3
  98. package/components/containers/panel/fesm2022/index.mjs.map +1 -1
  99. package/components/containers/panel/types/index.d.ts +3 -3
  100. package/components/containers/tabs/bundles/index.umd.js +9 -9
  101. package/components/containers/tabs/fesm2022/index.mjs +9 -9
  102. package/components/containers/tabs/fesm2022/index.mjs.map +1 -1
  103. package/components/containers/tabs/types/index.d.ts +8 -8
  104. package/components/containers/tile/bundles/index.umd.js +3 -3
  105. package/components/containers/tile/fesm2022/index.mjs +3 -3
  106. package/components/containers/tile/fesm2022/index.mjs.map +1 -1
  107. package/components/containers/tile/types/index.d.ts +1 -1
  108. package/components/containers/wizard/bundles/index.umd.js +18 -18
  109. package/components/containers/wizard/fesm2022/index.mjs +18 -18
  110. package/components/containers/wizard/fesm2022/index.mjs.map +1 -1
  111. package/components/containers/wizard/types/index.d.ts +8 -8
  112. package/components/data/card/bundles/index.umd.js +12 -12
  113. package/components/data/card/fesm2022/index.mjs +12 -12
  114. package/components/data/card/fesm2022/index.mjs.map +1 -1
  115. package/components/data/card/types/index.d.ts +6 -6
  116. package/components/data/form/bundles/index.umd.js +72 -75
  117. package/components/data/form/fesm2022/index.mjs +72 -77
  118. package/components/data/form/fesm2022/index.mjs.map +1 -1
  119. package/components/data/form/types/index.d.ts +29 -29
  120. package/components/data/list/bundles/index.umd.js +22 -27
  121. package/components/data/list/fesm2022/index.mjs +22 -27
  122. package/components/data/list/fesm2022/index.mjs.map +1 -1
  123. package/components/data/list/types/index.d.ts +23 -23
  124. package/components/data/live-table/bundles/index.umd.js +3 -3
  125. package/components/data/live-table/fesm2022/index.mjs +3 -3
  126. package/components/data/live-table/fesm2022/index.mjs.map +1 -1
  127. package/components/data/live-table/types/index.d.ts +5 -5
  128. package/components/data/pagination/bundles/index.umd.js +27 -28
  129. package/components/data/pagination/fesm2022/index.mjs +27 -28
  130. package/components/data/pagination/fesm2022/index.mjs.map +1 -1
  131. package/components/data/pagination/types/index.d.ts +1 -1
  132. package/components/data/table/bundles/index.umd.js +131 -142
  133. package/components/data/table/fesm2022/index.mjs +131 -143
  134. package/components/data/table/fesm2022/index.mjs.map +1 -1
  135. package/components/data/table/types/index.d.ts +20 -20
  136. package/components/dialogs/alert-dialog/bundles/index.umd.js +3 -3
  137. package/components/dialogs/alert-dialog/fesm2022/index.mjs +3 -3
  138. package/components/dialogs/alert-dialog/fesm2022/index.mjs.map +1 -1
  139. package/components/dialogs/alert-dialog/types/index.d.ts +1 -1
  140. package/components/dialogs/confirm-dialog/bundles/index.umd.js +3 -3
  141. package/components/dialogs/confirm-dialog/fesm2022/index.mjs +3 -3
  142. package/components/dialogs/confirm-dialog/fesm2022/index.mjs.map +1 -1
  143. package/components/dialogs/confirm-dialog/types/index.d.ts +1 -1
  144. package/components/dialogs/default/bundles/index.umd.js +12 -12
  145. package/components/dialogs/default/fesm2022/index.mjs +12 -12
  146. package/components/dialogs/default/fesm2022/index.mjs.map +1 -1
  147. package/components/dialogs/default/types/index.d.ts +3 -3
  148. package/components/dialogs/design-dialog/bundles/index.umd.js +3 -3
  149. package/components/dialogs/design-dialog/fesm2022/index.mjs +3 -3
  150. package/components/dialogs/design-dialog/fesm2022/index.mjs.map +1 -1
  151. package/components/dialogs/design-dialog/types/index.d.ts +1 -1
  152. package/components/dialogs/iframe-dialog/bundles/index.umd.js +3 -3
  153. package/components/dialogs/iframe-dialog/fesm2022/index.mjs +3 -3
  154. package/components/dialogs/iframe-dialog/fesm2022/index.mjs.map +1 -1
  155. package/components/dialogs/iframe-dialog/types/index.d.ts +1 -1
  156. package/components/dialogs/login-dialog/bundles/index.umd.js +3 -3
  157. package/components/dialogs/login-dialog/fesm2022/index.mjs +3 -3
  158. package/components/dialogs/login-dialog/fesm2022/index.mjs.map +1 -1
  159. package/components/dialogs/login-dialog/types/index.d.ts +2 -2
  160. package/components/dialogs/partial-dialog/bundles/index.umd.js +3 -3
  161. package/components/dialogs/partial-dialog/fesm2022/index.mjs +3 -3
  162. package/components/dialogs/partial-dialog/fesm2022/index.mjs.map +1 -1
  163. package/components/dialogs/partial-dialog/types/index.d.ts +1 -1
  164. package/components/input/base-form/bundles/index.umd.js +4 -4
  165. package/components/input/base-form/fesm2022/index.mjs +4 -4
  166. package/components/input/base-form/fesm2022/index.mjs.map +1 -1
  167. package/components/input/base-form-custom/bundles/index.umd.js +3 -3
  168. package/components/input/base-form-custom/fesm2022/index.mjs +3 -3
  169. package/components/input/button/bundles/index.umd.js +3 -3
  170. package/components/input/button/fesm2022/index.mjs +3 -3
  171. package/components/input/button/fesm2022/index.mjs.map +1 -1
  172. package/components/input/button/types/index.d.ts +1 -1
  173. package/components/input/button-group/bundles/index.umd.js +3 -3
  174. package/components/input/button-group/fesm2022/index.mjs +3 -3
  175. package/components/input/button-group/fesm2022/index.mjs.map +1 -1
  176. package/components/input/button-group/types/index.d.ts +1 -1
  177. package/components/input/calendar/bundles/index.umd.js +4 -4
  178. package/components/input/calendar/fesm2022/index.mjs +4 -5
  179. package/components/input/calendar/fesm2022/index.mjs.map +1 -1
  180. package/components/input/calendar/types/index.d.ts +9 -9
  181. package/components/input/caption-position/bundles/index.umd.js +5 -5
  182. package/components/input/caption-position/fesm2022/index.mjs +5 -5
  183. package/components/input/caption-position/fesm2022/index.mjs.map +1 -1
  184. package/components/input/caption-position/types/index.d.ts +4 -4
  185. package/components/input/checkbox/bundles/index.umd.js +3 -3
  186. package/components/input/checkbox/fesm2022/index.mjs +3 -3
  187. package/components/input/checkbox/fesm2022/index.mjs.map +1 -1
  188. package/components/input/checkbox/types/index.d.ts +2 -2
  189. package/components/input/checkboxset/bundles/index.umd.js +4 -4
  190. package/components/input/checkboxset/fesm2022/index.mjs +4 -4
  191. package/components/input/checkboxset/fesm2022/index.mjs.map +1 -1
  192. package/components/input/checkboxset/types/index.d.ts +2 -2
  193. package/components/input/chips/bundles/index.umd.js +5 -5
  194. package/components/input/chips/fesm2022/index.mjs +5 -5
  195. package/components/input/chips/fesm2022/index.mjs.map +1 -1
  196. package/components/input/chips/types/index.d.ts +14 -14
  197. package/components/input/color-picker/bundles/index.umd.js +3 -3
  198. package/components/input/color-picker/fesm2022/index.mjs +3 -3
  199. package/components/input/color-picker/fesm2022/index.mjs.map +1 -1
  200. package/components/input/color-picker/types/index.d.ts +2 -2
  201. package/components/input/composite/bundles/index.umd.js +3 -3
  202. package/components/input/composite/fesm2022/index.mjs +3 -3
  203. package/components/input/composite/fesm2022/index.mjs.map +1 -1
  204. package/components/input/composite/types/index.d.ts +1 -1
  205. package/components/input/currency/bundles/index.umd.js +3 -3
  206. package/components/input/currency/fesm2022/index.mjs +3 -3
  207. package/components/input/currency/fesm2022/index.mjs.map +1 -1
  208. package/components/input/currency/types/index.d.ts +3 -3
  209. package/components/input/dataset-aware-form/bundles/index.umd.js +7 -7
  210. package/components/input/dataset-aware-form/fesm2022/index.mjs +7 -7
  211. package/components/input/dataset-aware-form/fesm2022/index.mjs.map +1 -1
  212. package/components/input/dataset-aware-form/types/index.d.ts +1 -1
  213. package/components/input/epoch/base-date-time/bundles/index.umd.js +10 -15
  214. package/components/input/epoch/base-date-time/fesm2022/index.mjs +10 -15
  215. package/components/input/epoch/base-date-time/fesm2022/index.mjs.map +1 -1
  216. package/components/input/epoch/base-date-time/types/index.d.ts +2 -2
  217. package/components/input/epoch/date/bundles/index.umd.js +5 -5
  218. package/components/input/epoch/date/fesm2022/index.mjs +5 -5
  219. package/components/input/epoch/date/fesm2022/index.mjs.map +1 -1
  220. package/components/input/epoch/date/types/index.d.ts +4 -4
  221. package/components/input/epoch/date-time/bundles/index.umd.js +3 -3
  222. package/components/input/epoch/date-time/fesm2022/index.mjs +3 -3
  223. package/components/input/epoch/date-time/fesm2022/index.mjs.map +1 -1
  224. package/components/input/epoch/date-time/types/index.d.ts +8 -8
  225. package/components/input/epoch/date-time-picker/bundles/index.umd.js +8 -8
  226. package/components/input/epoch/date-time-picker/fesm2022/index.mjs +8 -8
  227. package/components/input/epoch/date-time-picker/fesm2022/index.mjs.map +1 -1
  228. package/components/input/epoch/date-time-picker/types/index.d.ts +6 -7
  229. package/components/input/epoch/picker/bundles/index.umd.js +6 -6
  230. package/components/input/epoch/picker/fesm2022/index.mjs +6 -6
  231. package/components/input/epoch/picker/fesm2022/index.mjs.map +1 -1
  232. package/components/input/epoch/time/bundles/index.umd.js +4 -5
  233. package/components/input/epoch/time/fesm2022/index.mjs +5 -6
  234. package/components/input/epoch/time/fesm2022/index.mjs.map +1 -1
  235. package/components/input/epoch/time/types/index.d.ts +4 -4
  236. package/components/input/file-upload/bundles/index.umd.js +4 -4
  237. package/components/input/file-upload/fesm2022/index.mjs +4 -4
  238. package/components/input/file-upload/fesm2022/index.mjs.map +1 -1
  239. package/components/input/file-upload/types/index.d.ts +5 -5
  240. package/components/input/number/bundles/index.umd.js +3 -3
  241. package/components/input/number/fesm2022/index.mjs +3 -3
  242. package/components/input/number/fesm2022/index.mjs.map +1 -1
  243. package/components/input/number/types/index.d.ts +1 -1
  244. package/components/input/radioset/bundles/index.umd.js +4 -4
  245. package/components/input/radioset/fesm2022/index.mjs +4 -4
  246. package/components/input/radioset/fesm2022/index.mjs.map +1 -1
  247. package/components/input/radioset/types/index.d.ts +2 -2
  248. package/components/input/rating/bundles/index.umd.js +9 -11
  249. package/components/input/rating/fesm2022/index.mjs +9 -11
  250. package/components/input/rating/fesm2022/index.mjs.map +1 -1
  251. package/components/input/rating/types/index.d.ts +2 -2
  252. package/components/input/select/bundles/index.umd.js +4 -4
  253. package/components/input/select/fesm2022/index.mjs +4 -4
  254. package/components/input/select/fesm2022/index.mjs.map +1 -1
  255. package/components/input/select/types/index.d.ts +1 -1
  256. package/components/input/slider/bundles/index.umd.js +3 -3
  257. package/components/input/slider/fesm2022/index.mjs +3 -3
  258. package/components/input/slider/fesm2022/index.mjs.map +1 -1
  259. package/components/input/slider/types/index.d.ts +1 -1
  260. package/components/input/switch/bundles/index.umd.js +3 -3
  261. package/components/input/switch/fesm2022/index.mjs +3 -3
  262. package/components/input/switch/fesm2022/index.mjs.map +1 -1
  263. package/components/input/switch/types/index.d.ts +1 -1
  264. package/components/input/text/bundles/index.umd.js +31 -35
  265. package/components/input/text/fesm2022/index.mjs +31 -35
  266. package/components/input/text/fesm2022/index.mjs.map +1 -1
  267. package/components/input/text/types/index.d.ts +12 -12
  268. package/components/input/textarea/bundles/index.umd.js +3 -3
  269. package/components/input/textarea/fesm2022/index.mjs +3 -3
  270. package/components/input/textarea/fesm2022/index.mjs.map +1 -1
  271. package/components/input/textarea/types/index.d.ts +2 -2
  272. package/components/navigation/breadcrumb/bundles/index.umd.js +3 -3
  273. package/components/navigation/breadcrumb/fesm2022/index.mjs +3 -3
  274. package/components/navigation/breadcrumb/fesm2022/index.mjs.map +1 -1
  275. package/components/navigation/breadcrumb/types/index.d.ts +4 -4
  276. package/components/navigation/menu/bundles/index.umd.js +25 -33
  277. package/components/navigation/menu/fesm2022/index.mjs +25 -33
  278. package/components/navigation/menu/fesm2022/index.mjs.map +1 -1
  279. package/components/navigation/menu/types/index.d.ts +21 -21
  280. package/components/navigation/navbar/bundles/index.umd.js +3 -3
  281. package/components/navigation/navbar/fesm2022/index.mjs +3 -3
  282. package/components/navigation/navbar/fesm2022/index.mjs.map +1 -1
  283. package/components/navigation/navbar/types/index.d.ts +1 -1
  284. package/components/navigation/popover/bundles/index.umd.js +4 -4
  285. package/components/navigation/popover/fesm2022/index.mjs +4 -4
  286. package/components/navigation/popover/fesm2022/index.mjs.map +1 -1
  287. package/components/navigation/popover/types/index.d.ts +4 -4
  288. package/components/page/default/bundles/index.umd.js +23 -23
  289. package/components/page/default/fesm2022/index.mjs +23 -23
  290. package/components/page/default/fesm2022/index.mjs.map +1 -1
  291. package/components/page/default/types/index.d.ts +14 -14
  292. package/components/page/footer/bundles/index.umd.js +3 -3
  293. package/components/page/footer/fesm2022/index.mjs +3 -3
  294. package/components/page/footer/fesm2022/index.mjs.map +1 -1
  295. package/components/page/footer/types/index.d.ts +1 -1
  296. package/components/page/header/bundles/index.umd.js +3 -3
  297. package/components/page/header/fesm2022/index.mjs +3 -3
  298. package/components/page/header/fesm2022/index.mjs.map +1 -1
  299. package/components/page/header/types/index.d.ts +1 -1
  300. package/components/page/left-panel/bundles/index.umd.js +5 -5
  301. package/components/page/left-panel/fesm2022/index.mjs +5 -5
  302. package/components/page/left-panel/fesm2022/index.mjs.map +1 -1
  303. package/components/page/left-panel/types/index.d.ts +3 -3
  304. package/components/page/right-panel/bundles/index.umd.js +3 -3
  305. package/components/page/right-panel/fesm2022/index.mjs +3 -3
  306. package/components/page/right-panel/fesm2022/index.mjs.map +1 -1
  307. package/components/page/right-panel/types/index.d.ts +1 -1
  308. package/components/page/top-nav/bundles/index.umd.js +3 -3
  309. package/components/page/top-nav/fesm2022/index.mjs +3 -3
  310. package/components/page/top-nav/fesm2022/index.mjs.map +1 -1
  311. package/components/page/top-nav/types/index.d.ts +1 -1
  312. package/components/prefab/bundles/index.umd.js +7 -7
  313. package/components/prefab/fesm2022/index.mjs +7 -7
  314. package/components/prefab/fesm2022/index.mjs.map +1 -1
  315. package/components/prefab/types/index.d.ts +3 -3
  316. package/core/bundles/index.umd.js +84 -89
  317. package/core/fesm2022/index.mjs +84 -89
  318. package/core/fesm2022/index.mjs.map +1 -1
  319. package/core/types/index.d.ts +11 -11
  320. package/http/bundles/index.umd.js +6 -6
  321. package/http/fesm2022/index.mjs +6 -6
  322. package/http/fesm2022/index.mjs.map +1 -1
  323. package/http/types/index.d.ts +1 -1
  324. package/npm-shrinkwrap.json +2 -2
  325. package/oAuth/bundles/index.umd.js +17 -21
  326. package/oAuth/fesm2022/index.mjs +17 -21
  327. package/oAuth/fesm2022/index.mjs.map +1 -1
  328. package/oAuth/types/index.d.ts +1 -1
  329. package/package-lock.json +2 -2
  330. package/package.json +1 -1
  331. package/runtime/base/bundles/index.umd.js +253 -275
  332. package/runtime/base/fesm2022/index.mjs +253 -275
  333. package/runtime/base/fesm2022/index.mjs.map +1 -1
  334. package/runtime/base/types/index.d.ts +90 -96
  335. package/runtime/dynamic/bundles/index.umd.js +28 -28
  336. package/runtime/dynamic/fesm2022/index.mjs +28 -28
  337. package/runtime/dynamic/fesm2022/index.mjs.map +1 -1
  338. package/runtime/dynamic/types/index.d.ts +22 -22
  339. package/scripts/datatable/datatable.js +293 -271
  340. package/scripts/tree-keyboard-navigation/keyboard-navigation.js +68 -56
  341. package/security/bundles/index.umd.js +6 -6
  342. package/security/fesm2022/index.mjs +6 -6
  343. package/security/fesm2022/index.mjs.map +1 -1
  344. package/security/types/index.d.ts +5 -5
  345. package/transpiler/bundles/index.umd.js +3 -5
  346. package/transpiler/fesm2022/index.mjs +3 -5
  347. package/transpiler/fesm2022/index.mjs.map +1 -1
  348. package/variables/bundles/index.umd.js +69 -71
  349. package/variables/fesm2022/index.mjs +69 -72
  350. package/variables/fesm2022/index.mjs.map +1 -1
  351. package/variables/types/index.d.ts +9 -9
@@ -168,7 +168,7 @@ $.widget('wm.datatable', {
168
168
  return value !== null && typeof value === 'object';
169
169
  },
170
170
  getObjectIndex: function (data, obj) {
171
- var matchIndex = -1;
171
+ let matchIndex = -1;
172
172
  if (!Array.isArray(data)) {
173
173
  return -1;
174
174
  }
@@ -181,12 +181,12 @@ $.widget('wm.datatable', {
181
181
  return matchIndex;
182
182
  },
183
183
  generateGuid: function () {
184
- var random = this.random;
184
+ const random = this.random;
185
185
  return random() + random() + '-' + random() + '-' + random() + '-' +
186
186
  random() + '-' + random() + random() + random();
187
187
  },
188
188
  isValidHtml: function (htm) {
189
- var validHtmlRegex = /<[a-z][\s\S]*>/i;
189
+ const validHtmlRegex = /<[a-z][\s\S]*>/i;
190
190
  return validHtmlRegex.test(htm);
191
191
  },
192
192
  isMac: function () {
@@ -209,10 +209,10 @@ $.widget('wm.datatable', {
209
209
  if (!styleString) {
210
210
  return;
211
211
  }
212
- var styles = styleString.split(';');
212
+ const styles = styleString.split(';');
213
213
  styles.forEach(function (styleBit) {
214
- var parts = styleBit.split(':');
215
- var property, value;
214
+ const parts = styleBit.split(':');
215
+ let property, value;
216
216
  if (parts.length === 2) {
217
217
  property = parts[0].trim();
218
218
  value = parts[1].trim();
@@ -223,7 +223,7 @@ $.widget('wm.datatable', {
223
223
  },
224
224
 
225
225
  _getColumnSortDirection: function (field) {
226
- var sortInfo = this.options.sortInfo;
226
+ const sortInfo = this.options.sortInfo;
227
227
  return field === sortInfo.field ? sortInfo.direction : '';
228
228
  },
229
229
  /*Based on the spacing property, add or remove classes*/
@@ -249,10 +249,10 @@ $.widget('wm.datatable', {
249
249
  },
250
250
  //Method to calculate and get the column span of the header cells
251
251
  _getColSpan: function (cols) {
252
- var colSpan = 0,
252
+ let colSpan = 0,
253
253
  self = this;
254
254
  _.forEach(cols, function (col) {
255
- var colDef;
255
+ let colDef;
256
256
  if (col.isGroup) {
257
257
  colSpan += self._getColSpan(col.columns);
258
258
  } else {
@@ -265,7 +265,7 @@ $.widget('wm.datatable', {
265
265
  },
266
266
  //Method to set the column span of the header cells in the config
267
267
  _setColSpan: function (config) {
268
- var self = this;
268
+ const self = this;
269
269
  _.forEach(config, function (col) {
270
270
  if (col.isGroup) {
271
271
  col.colspan = self._getColSpan(col.columns);
@@ -277,7 +277,7 @@ $.widget('wm.datatable', {
277
277
  /* Returns the table header template. */
278
278
  _getHeaderTemplate: function () {
279
279
 
280
- var $colgroup = $('<colgroup></colgroup>'),
280
+ let $colgroup = $('<colgroup></colgroup>'),
281
281
  $htm = this.gridHeaderElement.empty(),
282
282
  isDefined = this.Utils.isDefined,
283
283
  sortInfo = this.options.sortInfo,
@@ -289,7 +289,7 @@ $.widget('wm.datatable', {
289
289
  $row;
290
290
 
291
291
  function generateHeaderCell(value, index) {
292
- var id = index,
292
+ let id = index,
293
293
  field = value.field,
294
294
  headerLabel = self.Utils.isDefined(value.displayName) ? value.displayName : (field || ''),
295
295
  titleLabel = headerLabel,
@@ -363,9 +363,9 @@ $.widget('wm.datatable', {
363
363
 
364
364
  //Method to generate the header row based on the column group config
365
365
  function generateRow(cols, i) {
366
- var $thList = [];
366
+ const $thList = [];
367
367
  _.forEach(cols, function (col) {
368
- var index,
368
+ let index,
369
369
  value,
370
370
  classes,
371
371
  styles,
@@ -411,7 +411,7 @@ $.widget('wm.datatable', {
411
411
  rowTemplates.forEach(function($thList, index) {
412
412
  $row = $('<tr role="row" tabindex="0"></tr>');
413
413
  // To fix ADA issue "Tables headers in datatable must refer to data cells"
414
- var rowSpan = rowTemplates.length - index;
414
+ const rowSpan = rowTemplates.length - index;
415
415
  //append all t-heads to the tr
416
416
  $thList.forEach(function($th) {
417
417
  // if rowspan > 1, apply it to all non-group t-heads
@@ -429,7 +429,7 @@ $.widget('wm.datatable', {
429
429
 
430
430
  /* Returns the seachbox template. */
431
431
  _getSearchEl: function () {
432
- var htm,
432
+ let htm,
433
433
  sel = '<select name="wm-datatable" data-element="dgFilterValue" ' +
434
434
  'class="form-control app-select">' +
435
435
  '<option value="" selected class="placeholder">' + this.options.messages.selectField + '</option>',
@@ -454,21 +454,21 @@ $.widget('wm.datatable', {
454
454
  '</button></span>' +
455
455
  '</div>' +
456
456
  '</div></form>';
457
- var $htm = $(htm);
457
+ const $htm = $(htm);
458
458
  this._setStyles($htm.find('[data-element="dgSearchText"]'), "display: inline-block;");
459
459
  return $htm;
460
460
  },
461
461
  _appendRowExpansionButtons: function ($htm) {
462
- var self = this;
462
+ const self = this;
463
463
  $htm.find("[data-identifier='rowExpansionButtons']").each(function (index) {
464
- var _rowData, $row, rowId, rowIndex = index;
464
+ let _rowData, $row, rowId, rowIndex = index;
465
465
  $row = $(this).closest('tr.app-datagrid-row');
466
466
  rowId = parseInt($row.attr('data-row-id'), 10);
467
467
  _rowData = _.clone(self.options.data[rowId]);
468
468
  _rowData.$index = rowIndex + 1;
469
469
  self.options.generateRowExpansionCell(_rowData, rowIndex);
470
470
  $(this).empty().append(self.options.getRowExpansionAction(rowIndex));
471
- var expandtitleExpr = $(this).children()[0].getAttribute('expandtitle.bind'),
471
+ const expandtitleExpr = $(this).children()[0].getAttribute('expandtitle.bind'),
472
472
  collapsetitleExpr = $(this).children()[0].getAttribute('collapsetitle.bind');
473
473
 
474
474
  if(expandtitleExpr) {
@@ -494,7 +494,7 @@ $.widget('wm.datatable', {
494
494
 
495
495
  /* Returns the tbody markup. */
496
496
  _getSummaryRowTemplate: function () {
497
- var self = this,
497
+ const self = this,
498
498
  $tfoot = $('<tfoot class="' + this.options.cssClassNames.gridFooter + '"></tfoot>');
499
499
  this._setStyles($tfoot, "border-top: 3px solid #eee;");
500
500
 
@@ -510,9 +510,9 @@ $.widget('wm.datatable', {
510
510
  /* function to get start index of the current active page */
511
511
  getPageStartIndex: function() {
512
512
  // Guard against undefined getCurrentPage or getPageSize functions
513
- var getCurrentPageFn = this.options.getCurrentPage;
514
- var getPageSizeFn = this.options.getPageSize;
515
- var currentPage, pagesize;
513
+ const getCurrentPageFn = this.options.getCurrentPage;
514
+ const getPageSizeFn = this.options.getPageSize;
515
+ let currentPage, pagesize;
516
516
  if (!getCurrentPageFn || typeof getCurrentPageFn !== 'function') {
517
517
  // Default to page 1 if getCurrentPage is not available
518
518
  currentPage = 1;
@@ -525,8 +525,8 @@ $.widget('wm.datatable', {
525
525
  } else {
526
526
  pagesize = getPageSizeFn();
527
527
  }
528
- var isPrevPageUpdated = this.options.actionRowPage < currentPage;
529
- var pageIndex = isPrevPageUpdated ? this.options.actionRowPage : currentPage;
528
+ const isPrevPageUpdated = this.options.actionRowPage < currentPage;
529
+ const pageIndex = isPrevPageUpdated ? this.options.actionRowPage : currentPage;
530
530
  return ((pageIndex - 1) * pagesize);
531
531
  },
532
532
 
@@ -535,7 +535,7 @@ $.widget('wm.datatable', {
535
535
  */
536
536
  _getPreparedDataForInfiniteScroll : function ($tbody, preparedData) {
537
537
  preparedData = preparedData.filter(function(row, index) {
538
- var isExists = $tbody.find('tr.app-datagrid-row[data-row-id=' + row.$$pk + ']');
538
+ const isExists = $tbody.find('tr.app-datagrid-row[data-row-id=' + row.$$pk + ']');
539
539
  if (!isExists.length) { return row;}
540
540
  })
541
541
  return preparedData;
@@ -543,11 +543,11 @@ $.widget('wm.datatable', {
543
543
 
544
544
  // when the edit action is performed, update the tr with the new data
545
545
  _updateTrData : function ($tbody) {
546
- var editedRow,updatedRowData, self = this;
546
+ let editedRow,updatedRowData, self = this;
547
547
  editedRow = $tbody.find('tr.app-datagrid-row[data-row-id=' + self.options.actionRowIndex + ']');
548
548
  updatedRowData = self.preparedData[self.options.actionRowIndex];
549
549
  self.options.generateCustomExpressions(updatedRowData, self.options.actionRowIndex);
550
- var rowTemplate = self._getRowTemplate(updatedRowData, self.options.actionRowIndex);
550
+ const rowTemplate = self._getRowTemplate(updatedRowData, self.options.actionRowIndex);
551
551
  editedRow.replaceWith(rowTemplate[0]);
552
552
  },
553
553
 
@@ -557,7 +557,7 @@ $.widget('wm.datatable', {
557
557
  -> when the edit is performed update the tr with newly updated data
558
558
  */
559
559
  _handleCRUDForInfiniteScroll : function ($tbody) {
560
- var self = this;
560
+ const self = this;
561
561
 
562
562
  //When search or sort applied or dataset is updated, clear the tbody and render with filtered data
563
563
  // Fix for [WMS-23263] 'isDataUpdatedByUser' flag is true when dataset is updated from script
@@ -582,11 +582,11 @@ $.widget('wm.datatable', {
582
582
  /* Returns the tbody markup. */
583
583
  _getGridTemplate: function () {
584
584
 
585
- var self = this, preparedData,$tbody,pageStartIndex = self.getPageStartIndex(),
585
+ let self = this, preparedData,$tbody,pageStartIndex = self.getPageStartIndex(),
586
586
  startRowIndex = self.options.startRowIndex,
587
587
  isScrollorOnDemand = self.options.isNavTypeScrollOrOndemand();
588
- var $activeRow = self.gridElement.find('tr.row-editing:not(.always-new-row)').first();
589
- var index = $activeRow.index();
588
+ const $activeRow = self.gridElement.find('tr.row-editing:not(.always-new-row)').first();
589
+ const index = $activeRow.index();
590
590
  if(isScrollorOnDemand) {
591
591
  $tbody = this.gridElement;
592
592
  if(this.renderTableOnViewLess) {
@@ -614,16 +614,16 @@ $.widget('wm.datatable', {
614
614
  preparedData = this.preparedData;
615
615
  }
616
616
  _.forEach(preparedData, function (row, index) {
617
- var _row = _.clone(row), rowIndex = (isScrollorOnDemand) ? startRowIndex + index - 1 : index, rowTemplate;
617
+ let _row = _.clone(row), rowIndex = (isScrollorOnDemand) ? startRowIndex + index - 1 : index, rowTemplate;
618
618
  _row.$index = rowIndex + 1;
619
619
  self.options.generateCustomExpressions(_row, rowIndex);
620
620
  self.options.registerRowNgClassWatcher(_row, rowIndex);
621
621
  rowTemplate = self._getRowTemplate(row, rowIndex);
622
622
  $tbody.append(rowTemplate);
623
623
  if (self.options.rowExpansionEnabled) {
624
- var rowHeight = self.options.rowDef.height;
625
- var colSpanLength = _.filter(self.preparedHeaderData, function(c) {return c.show}).length;
626
- var $tr = $('<tr class="app-datagrid-detail-row" tabindex="0" role="row" data-row-id="' + row.$$pk + '"><td colspan="' + colSpanLength + '" class="app-datagrid-row-details-cell">' +
624
+ const rowHeight = self.options.rowDef.height;
625
+ const colSpanLength = _.filter(self.preparedHeaderData, function(c) {return c.show}).length;
626
+ const $tr = $('<tr class="app-datagrid-detail-row" tabindex="0" role="row" data-row-id="' + row.$$pk + '"><td colspan="' + colSpanLength + '" class="app-datagrid-row-details-cell">' +
627
627
  '<div class="row-overlay"><div class="row-status"><i class="' + self.options.loadingicon + '"></i></div></div><div class="details-section"></div>' +
628
628
  '</td></tr>');
629
629
  if (rowHeight) {
@@ -657,7 +657,7 @@ $.widget('wm.datatable', {
657
657
 
658
658
  /* Returns the table row template. */
659
659
  _getRowTemplate: function (row, rowIndex, summaryRow) {
660
- var $htm,
660
+ let $htm,
661
661
  self = this,
662
662
  gridOptions = self.options;
663
663
 
@@ -669,7 +669,7 @@ $.widget('wm.datatable', {
669
669
  },
670
670
 
671
671
  _getRowActionsColumnDefIndex: function () {
672
- var i, len = this.preparedHeaderData.length;
672
+ let i, len = this.preparedHeaderData.length;
673
673
  for (i = 0; i < len; i += 1) {
674
674
  if (this.preparedHeaderData[i].field === 'rowOperations') {
675
675
  return i;
@@ -679,7 +679,7 @@ $.widget('wm.datatable', {
679
679
  },
680
680
 
681
681
  _getRowActionsColumnDef: function () {
682
- var index = this._getRowActionsColumnDefIndex();
682
+ const index = this._getRowActionsColumnDefIndex();
683
683
  if (index !== -1) {
684
684
  return this.preparedHeaderData[index];
685
685
  }
@@ -688,7 +688,7 @@ $.widget('wm.datatable', {
688
688
 
689
689
  /* Returns the checkbox template. */
690
690
  _getCheckboxTemplate: function (row, isMultiSelectCol) {
691
- var checked = row._checked === true ? ' checked' : '',
691
+ const checked = row._checked === true ? ' checked' : '',
692
692
  disabled = row.disabed ? ' disabled' : '',
693
693
  chkBoxName = isMultiSelectCol ? 'gridMultiSelect' : '',
694
694
  labelClass = row._checked === true ? '' : 'unchecked';
@@ -716,7 +716,7 @@ $.widget('wm.datatable', {
716
716
  },
717
717
  /* Returns the radio template. */
718
718
  _getRadioTemplate: function (row) {
719
- var checked = row._checked === true ? ' checked' : '',
719
+ const checked = row._checked === true ? ' checked' : '',
720
720
  disabled = row.disabed ? ' disabled' : '';
721
721
  return `<div class="radio app-radio">
722
722
  <label>
@@ -728,7 +728,7 @@ $.widget('wm.datatable', {
728
728
 
729
729
  /* Returns the table cell template. */
730
730
  _getColumnTemplate: function (row, colId, colDef, rowIndex, summaryRow) {
731
- var $htm,
731
+ let $htm,
732
732
  columnValue,
733
733
  columnValueObject,
734
734
  cellPreloader = '<div class="overlay"><span aria-hidden="true" class="form-field-spinner fa fa-circle-o-notch fa-spin form-control-feedback"></span></div>',
@@ -824,7 +824,7 @@ $.widget('wm.datatable', {
824
824
  },
825
825
  //Get event related template for editable widget
826
826
  _getEventTemplate: function (colDef) {
827
- var events = _.filter(_.keys(colDef), function (key) {
827
+ let events = _.filter(_.keys(colDef), function (key) {
828
828
  return _.startsWith(key, 'on');
829
829
  }),
830
830
  changeEvt,
@@ -842,7 +842,7 @@ $.widget('wm.datatable', {
842
842
  return template;
843
843
  },
844
844
  _insertFieldInHeaderConfig: function (headerConfig, fieldName, position) {
845
- var index = _.findIndex(headerConfig, {field: position}),
845
+ const index = _.findIndex(headerConfig, {field: position}),
846
846
  self = this;
847
847
  if (index === -1) {
848
848
  _.forEach(headerConfig, function (config) {
@@ -858,7 +858,7 @@ $.widget('wm.datatable', {
858
858
  if (_.isEmpty(this.options.headerConfig)) {
859
859
  return;
860
860
  }
861
- var fieldName = this.customColumnDefs[name].field;
861
+ const fieldName = this.customColumnDefs[name].field;
862
862
  _.remove(this.options.headerConfig, {'field': fieldName});
863
863
  if (position === '0') {
864
864
  this.options.headerConfig.unshift({'field': fieldName, 'isPredefined': true});
@@ -873,7 +873,7 @@ $.widget('wm.datatable', {
873
873
  if (_.isEmpty(this.preparedHeaderData)) {
874
874
  return;
875
875
  }
876
- var rowExpandPosition,
876
+ let rowExpandPosition,
877
877
  rowExpandCol;
878
878
  if (this.options.rowExpansionEnabled) {
879
879
  rowExpandPosition = this.options.rowDef.position;
@@ -885,7 +885,7 @@ $.widget('wm.datatable', {
885
885
  } else if (rowExpandPosition === '0') {
886
886
  this.preparedHeaderData.unshift(rowExpandCol);
887
887
  } else {
888
- var index = _.findIndex(this.preparedHeaderData, {field: rowExpandPosition});
888
+ const index = _.findIndex(this.preparedHeaderData, {field: rowExpandPosition});
889
889
  this.preparedHeaderData.splice(index + 1, 0, rowExpandCol);
890
890
  }
891
891
  }
@@ -920,12 +920,12 @@ $.widget('wm.datatable', {
920
920
 
921
921
  /* Generates default column definitions from given data. */
922
922
  _generateCustomColDefs: function () {
923
- var colDefs = [],
923
+ const colDefs = [],
924
924
  generatedColDefs = {};
925
925
 
926
926
  function generateColumnDef(key) {
927
927
  if (!generatedColDefs[key]) {
928
- var colDef = {
928
+ const colDef = {
929
929
  'type': 'string',
930
930
  'field': key
931
931
  };
@@ -944,7 +944,7 @@ $.widget('wm.datatable', {
944
944
 
945
945
  /* Prepares the grid data by adding a primary key to each row's data. */
946
946
  _prepareData: function () {
947
- var data = [],
947
+ let data = [],
948
948
  colDefs = this.options.colDefs,
949
949
  self = this,
950
950
  gridData = [],
@@ -956,12 +956,12 @@ $.widget('wm.datatable', {
956
956
  }
957
957
  gridData = this.options.isNavTypeScrollOrOndemand() ? this.options.data.slice(pageStartIndex) : this.options.data;
958
958
  gridData.forEach(function (item, i) {
959
- var rowData = $.extend(true, {}, item);
959
+ const rowData = $.extend(true, {}, item);
960
960
  colDefs.forEach(function (colDef) {
961
961
  if (!colDef.field) {
962
962
  return;
963
963
  }
964
- var fields = colDef.field.split('.'),
964
+ let fields = colDef.field.split('.'),
965
965
  text = item,
966
966
  j,
967
967
  len = fields.length,
@@ -1009,7 +1009,7 @@ $.widget('wm.datatable', {
1009
1009
  // else update the existing data (if any edit action is performed) or push data (if the data is not present) to preparedData list.
1010
1010
  else if (self.preparedData.length) {
1011
1011
  data.forEach(function (rowData, index) {
1012
- var rowId = pageStartIndex + index;
1012
+ const rowId = pageStartIndex + index;
1013
1013
  // assigning updated value to prepareData list
1014
1014
  if (self.preparedData[rowId] && rowData.$$index === self.preparedData[rowId].$$index) {
1015
1015
  self.preparedData[rowId] = rowData;
@@ -1029,7 +1029,7 @@ $.widget('wm.datatable', {
1029
1029
 
1030
1030
  /* Select previously selected columns after refreshing grid data. */
1031
1031
  _reselectColumns: function () {
1032
- var selectedColumns = [],
1032
+ let selectedColumns = [],
1033
1033
  self = this;
1034
1034
  //If enableColumnSelection is set to true, reselect the columns on data refresh
1035
1035
  if (this.gridHeaderElement && this.options.enableColumnSelection) {
@@ -1112,7 +1112,7 @@ $.widget('wm.datatable', {
1112
1112
  * */
1113
1113
  callRenderGridForInfiniteScroll: function() {
1114
1114
  this.gridFooter.remove();
1115
- var $alwaysNewRow = this.gridElement.find('> tr.app-datagrid-row.always-new-row');
1115
+ const $alwaysNewRow = this.gridElement.find('> tr.app-datagrid-row.always-new-row');
1116
1116
  if ($alwaysNewRow.length) {
1117
1117
  $alwaysNewRow.remove();
1118
1118
  }
@@ -1141,7 +1141,7 @@ $.widget('wm.datatable', {
1141
1141
  },
1142
1142
  /* Inserts a new blank row in the table. */
1143
1143
  addNewRow: function (skipFocus, alwaysNewRow) {
1144
- var rowId = this.gridElement.find('> tr.app-datagrid-row:visible').length || 99999, //Dummy value if rows are not there
1144
+ let rowId = this.gridElement.find('> tr.app-datagrid-row:visible').length || 99999, //Dummy value if rows are not there
1145
1145
  self = this,
1146
1146
  rowData = {},
1147
1147
  $row,
@@ -1159,9 +1159,9 @@ $.widget('wm.datatable', {
1159
1159
  this.setFocusOnElement(undefined, $alwaysNewRow);
1160
1160
  // QUICK EDIT MODE | On Add Click on new row, trigger save action
1161
1161
  if(this.options.editmode===this.CONSTANTS.QUICK_EDIT){
1162
- var $qTarget = $alwaysNewRow.find("input").length>0?$($alwaysNewRow.find("input")[0]):null;
1162
+ const $qTarget = $alwaysNewRow.find("input").length>0?$($alwaysNewRow.find("input")[0]):null;
1163
1163
  if($qTarget!==null){
1164
- var event = $.Event("keydown");
1164
+ const event = $.Event("keydown");
1165
1165
  event.which = 13;
1166
1166
  $qTarget.trigger(event);
1167
1167
  }
@@ -1217,10 +1217,10 @@ $.widget('wm.datatable', {
1217
1217
  /* Inserts a load more button at the end of the table when the pagination selected is on demand */
1218
1218
  addLoadMoreBtn : function (onDemandMsg, loadingdatamsg, cb, infScroll) {
1219
1219
  // Show Load more button only if it not the last page
1220
- var $btnEl;
1220
+ let $btnEl;
1221
1221
  if (!this.options.isLastPage || infScroll) {
1222
- var self = this;
1223
- var $parenEl = $('<div class="on-demand-datagrid"><a class="app-button btn btn-block on-demand-load-btn"></a></div>');
1222
+ const self = this;
1223
+ const $parenEl = $('<div class="on-demand-datagrid"><a class="app-button btn btn-block on-demand-load-btn"></a></div>');
1224
1224
  $btnEl = $parenEl.find('a');
1225
1225
  $btnEl.append(onDemandMsg);
1226
1226
  // Adding load more button in case of on demand pagination
@@ -1234,7 +1234,7 @@ $.widget('wm.datatable', {
1234
1234
  // Adding click event to the button
1235
1235
  $btnEl.on('click', function (e) {
1236
1236
  // when the button is clicked, hide the button and show loading indicator
1237
- var lastPage = (self.options.getCurrentPage() == self.options.getPageCount());
1237
+ const lastPage = (self.options.getCurrentPage() == self.options.getPageCount());
1238
1238
  if(!lastPage) {
1239
1239
  self.showLoadingIndicator(loadingdatamsg, false);
1240
1240
  }
@@ -1265,8 +1265,8 @@ $.widget('wm.datatable', {
1265
1265
 
1266
1266
  /* Shows loading indicator when clicked on load more button or in case of infinite scroll event is triggered */
1267
1267
  showLoadingIndicator: function (loadingdatamsg, infScroll) {
1268
- var hasLoadingEl = this.element.find('.loading-data-msg');
1269
- var $dataGrid = this.element.find('.on-demand-datagrid');
1268
+ const hasLoadingEl = this.element.find('.loading-data-msg');
1269
+ const $dataGrid = this.element.find('.on-demand-datagrid');
1270
1270
  if (hasLoadingEl.length && !infScroll) {
1271
1271
  // in case of on demand pagination, show the loading ele which was hidden
1272
1272
  hasLoadingEl.show();
@@ -1276,13 +1276,13 @@ $.widget('wm.datatable', {
1276
1276
  } else {
1277
1277
  // if the loading indicator ele is not created, create it and append it to grid ele if it is already present.
1278
1278
  // If not create grid ele and then append the loading indicator to grid ele
1279
- var $loadingEl = $('<div class="loading-data-msg spin-icon-in-center"><span><i class="app-icon panel-icon fa-spin ' + this.options.loadingicon + '"></i>' +
1279
+ const $loadingEl = $('<div class="loading-data-msg spin-icon-in-center"><span><i class="app-icon panel-icon fa-spin ' + this.options.loadingicon + '"></i>' +
1280
1280
  '<span class="sr-only">Loading</span><span class="loading-text"></span></span></div>');
1281
1281
  $loadingEl.find('.loading-text').html(loadingdatamsg);
1282
1282
  if ($dataGrid.length) {
1283
1283
  $dataGrid.append($loadingEl);
1284
1284
  } else {
1285
- var gridEl = $('<div class="on-demand-datagrid">' + $loadingEl[0].outerHTML + '</div>');
1285
+ const gridEl = $('<div class="on-demand-datagrid">' + $loadingEl[0].outerHTML + '</div>');
1286
1286
  this.element.find('.app-grid-header-inner').append(gridEl);
1287
1287
  }
1288
1288
  }
@@ -1314,7 +1314,7 @@ $.widget('wm.datatable', {
1314
1314
  /* Returns the selected rows in the table. */
1315
1315
  getSelectedRows: function () {
1316
1316
  this.getSelectedColumns();
1317
- var selectedRowsData = [],
1317
+ const selectedRowsData = [],
1318
1318
  self = this;
1319
1319
 
1320
1320
  this.preparedData.forEach(function (data, i) {
@@ -1326,8 +1326,8 @@ $.widget('wm.datatable', {
1326
1326
  },
1327
1327
  /* Sets the selected rows in the table. */
1328
1328
  selectRows: function (rows) {
1329
- var self = this;
1330
- var _rows = _.isArray(rows) ? rows.slice() : [rows];
1329
+ const self = this;
1330
+ const _rows = _.isArray(rows) ? rows.slice() : [rows];
1331
1331
  /*Deselect all the previous selected rows in the table*/
1332
1332
  self.gridElement.find('tr.app-datagrid-row').each(function (index) {
1333
1333
  if (self.preparedData[index] && self.preparedData[index]._selected === true) {
@@ -1360,8 +1360,8 @@ $.widget('wm.datatable', {
1360
1360
  },
1361
1361
  /*Set the default widths for the colgroup*/
1362
1362
  setColGroupWidths: function () {
1363
- var self = this,
1364
- headerCols = this.options.isMobile ? this.tableContainer.find('col') : this.tableContainer.find('col'),
1363
+ const self = this,
1364
+ headerCols = this.tableContainer.find('col'),
1365
1365
  bodyCols = this.tableContainer.find('col'),
1366
1366
  headerCells = this.options.showHeader ? this.gridContainer.find('th.app-datagrid-header-cell') : this.gridElement.find('tr.app-datagrid-row').first().find('td'),
1367
1367
  colLength = this.preparedHeaderData.length,
@@ -1375,10 +1375,10 @@ $.widget('wm.datatable', {
1375
1375
  this.toggleRowFilter();
1376
1376
 
1377
1377
  // Find if cols of colgroup has any width defined, if yes remove those columns from colsLen
1378
- var definedColWidth = 0;
1379
- var colsLen = headerCols.length;
1378
+ let definedColWidth = 0;
1379
+ let colsLen = headerCols.length;
1380
1380
  headerCols.each(function () {
1381
- var eachColWidth = $(this).width();
1381
+ const eachColWidth = $(this).width();
1382
1382
  if (eachColWidth) {
1383
1383
  definedColWidth = definedColWidth + eachColWidth;
1384
1384
  colsLen = colsLen - 1;
@@ -1388,7 +1388,7 @@ $.widget('wm.datatable', {
1388
1388
 
1389
1389
  //First Hide or show the column based on the show property so that width is calculated correctly
1390
1390
  headerCells.each(function () {
1391
- var id = Number($(this).attr('data-col-id')),
1391
+ let id = Number($(this).attr('data-col-id')),
1392
1392
  colDef = self.preparedHeaderData[id],
1393
1393
  $headerCell = self.gridContainer.find('th[data-col-id="' + id + '"]'),
1394
1394
  $tdCell = self.gridElement.find('td.app-datagrid-cell[data-col-id="' + id + '"]'),
@@ -1424,7 +1424,7 @@ $.widget('wm.datatable', {
1424
1424
  });
1425
1425
  //setting the header col width based on the content width
1426
1426
  headerCells.each(function () {
1427
- var $header = $(this),
1427
+ let $header = $(this),
1428
1428
  id = Number($header.attr('data-col-id')),
1429
1429
  colDef = self.preparedHeaderData[id],
1430
1430
  definedWidth,
@@ -1453,9 +1453,9 @@ $.widget('wm.datatable', {
1453
1453
  * In such cases, calculating the width of column cells against the closest parent whose width is available
1454
1454
  */
1455
1455
  if (width <= 0) {
1456
- var currentNode = $header;
1457
- var elemWidth = width;
1458
- var padding = 0;
1456
+ let currentNode = $header;
1457
+ let elemWidth = width;
1458
+ let padding = 0;
1459
1459
  while (elemWidth <= 0) {
1460
1460
  currentNode = currentNode.parent();
1461
1461
  elemWidth = currentNode.width();
@@ -1472,14 +1472,14 @@ $.widget('wm.datatable', {
1472
1472
 
1473
1473
  // If the width is provided in % for inactive panes, convert % to pixel
1474
1474
  if (_.includes(tempWidth, '%')) {
1475
- var widthPercent = parseInt(tempWidth);
1476
- var pixelWidth = (elemWidth)*(widthPercent/100);
1475
+ const widthPercent = parseInt(tempWidth);
1476
+ const pixelWidth = (elemWidth)*(widthPercent/100);
1477
1477
  width = pixelWidth;
1478
1478
  } else { // Else divide the parent width by the number of columns available
1479
1479
  // If any columns have defined width, remove that width from parent elem width
1480
- var parentWidth = (definedColWidth && definedColWidth > 0) ? elemWidth - definedColWidth : elemWidth;
1480
+ const parentWidth = (definedColWidth && definedColWidth > 0) ? elemWidth - definedColWidth : elemWidth;
1481
1481
  // ColsLen has length of columns whose width is undefined
1482
- var totalCols = colsLen ? colsLen : headerCols.length;
1482
+ const totalCols = colsLen ? colsLen : headerCols.length;
1483
1483
  width = parentWidth / totalCols;
1484
1484
  width = width > 90 ? ((colLength === id + 1) ? width - 17 : width) : 90; //columnSanity check to prevent width being too small and Last column, adjust for the scroll width
1485
1485
  }
@@ -1508,7 +1508,7 @@ $.widget('wm.datatable', {
1508
1508
 
1509
1509
  /* Returns the selected columns in the table. */
1510
1510
  getSelectedColumns: function () {
1511
- var selectedColsData = {},
1511
+ let selectedColsData = {},
1512
1512
  headerData = [],
1513
1513
  self = this,
1514
1514
  multiSelectColIndex,
@@ -1544,7 +1544,7 @@ $.widget('wm.datatable', {
1544
1544
  }
1545
1545
 
1546
1546
  headerData.forEach(function (colDef) {
1547
- var field = colDef.field;
1547
+ const field = colDef.field;
1548
1548
  if (colDef.selected) {
1549
1549
  selectedColsData[field] = {
1550
1550
  'colDef': colDef,
@@ -1629,8 +1629,8 @@ $.widget('wm.datatable', {
1629
1629
  case 'showRowIndex':
1630
1630
  this.refreshGrid();
1631
1631
  break;
1632
- case 'cssClassNames':
1633
- var gridClass = this.options.cssClassNames.gridDefault + ' ' + this.options.cssClassNames.grid;
1632
+ case 'cssClassNames': {
1633
+ let gridClass = this.options.cssClassNames.gridDefault + ' ' + this.options.cssClassNames.grid;
1634
1634
  if (this.options.rowExpansionEnabled) {
1635
1635
  gridClass = gridClass + ' ' + this.options.cssClassNames.gridRowExpansionClass;
1636
1636
  }
@@ -1640,6 +1640,7 @@ $.widget('wm.datatable', {
1640
1640
  this._toggleSpacingClasses('condensed');
1641
1641
  }
1642
1642
  break;
1643
+ }
1643
1644
  case 'spacing':
1644
1645
  this._toggleSpacingClasses(value);
1645
1646
  break;
@@ -1694,7 +1695,7 @@ $.widget('wm.datatable', {
1694
1695
  },
1695
1696
  /* Marks the first row as selected. */
1696
1697
  selectFirstRow: function (value, visible) {
1697
- var $row,
1698
+ let $row,
1698
1699
  id;
1699
1700
  //If visible flag is true, select the first visible row item (Do not select the always new row)
1700
1701
  if (visible && this.gridElement.find('tr').is(':visible')) {
@@ -1714,7 +1715,7 @@ $.widget('wm.datatable', {
1714
1715
 
1715
1716
  /* Selects a row. */
1716
1717
  selectRow: function (row, value,index) {
1717
- var rowIndex =index?index:( _.isNumber(row) ? row : this.Utils.getObjectIndex(this.options.data, row)),
1718
+ let rowIndex =index?index:( _.isNumber(row) ? row : this.Utils.getObjectIndex(this.options.data, row)),
1718
1719
  selector,
1719
1720
  $row;
1720
1721
  if (rowIndex !== -1) {
@@ -1744,7 +1745,7 @@ $.widget('wm.datatable', {
1744
1745
  return;
1745
1746
  }
1746
1747
 
1747
- var rowId = $row.attr('data-row-id'),
1748
+ let rowId = $row.attr('data-row-id'),
1748
1749
  $checkbox,
1749
1750
  $radio;
1750
1751
  if (!this.preparedData[rowId]) {
@@ -1785,7 +1786,7 @@ $.widget('wm.datatable', {
1785
1786
  }
1786
1787
  //As rows visibility is checked, remove loading icon
1787
1788
  this.__setStatus();
1788
- var $headerCheckbox = this.gridHeaderElement.find('th.app-datagrid-header-cell input:checkbox'),
1789
+ const $headerCheckbox = this.gridHeaderElement.find('th.app-datagrid-header-cell input:checkbox'),
1789
1790
  $tbody = this.gridElement,
1790
1791
  checkedItemsLength = $tbody.find('tr.app-datagrid-row:visible input[name="gridMultiSelect"]:checkbox:checked').length,
1791
1792
  visibleRowsLength = $tbody.find('tr.app-datagrid-row:visible').length;
@@ -1817,12 +1818,12 @@ $.widget('wm.datatable', {
1817
1818
  }
1818
1819
  }
1819
1820
  $row = $row || $(e.target).closest('tr.app-datagrid-row');
1820
- var gridRow = this.gridElement.find($row);
1821
+ const gridRow = this.gridElement.find($row);
1821
1822
  // WMS-21139 trigger selectedItems change when the captured click is on the current table but not on child table
1822
1823
  if (gridRow.length && gridRow.closest('tbody').attr('id') === this.gridElement.attr('id')) {
1823
- var rowId = $row.attr('data-row-id');
1824
- var rowData = this.preparedData[rowId];
1825
- var data = this.options.data[rowId];
1824
+ const rowId = $row.attr('data-row-id');
1825
+ const rowData = this.preparedData[rowId];
1826
+ const data = this.options.data[rowId];
1826
1827
  this.options.assignSelectedItems(data, e, {'rowId': rowId, '_selected': rowData?._selected});
1827
1828
  }
1828
1829
  },
@@ -1842,7 +1843,7 @@ $.widget('wm.datatable', {
1842
1843
  }
1843
1844
  }
1844
1845
  options = options || {};
1845
- var rowId,
1846
+ let rowId,
1846
1847
  rowData,
1847
1848
  data,
1848
1849
  selected,
@@ -1896,7 +1897,7 @@ $.widget('wm.datatable', {
1896
1897
  rowDblClickHandler: function (e, $row) {
1897
1898
  e.stopPropagation();
1898
1899
  $row = $row || $(e.target).closest('tr.app-datagrid-row');
1899
- var rowData, rowId = $row.attr('data-row-id');
1900
+ let rowData, rowId = $row.attr('data-row-id');
1900
1901
  rowData = this.preparedData[rowId];
1901
1902
  if (!rowData) {
1902
1903
  return;
@@ -1918,7 +1919,7 @@ $.widget('wm.datatable', {
1918
1919
  });
1919
1920
  },
1920
1921
  headerClickHandler: function (e) {
1921
- var $th = $(e.target).closest('th.app-datagrid-header-cell'),
1922
+ const $th = $(e.target).closest('th.app-datagrid-header-cell'),
1922
1923
  id = $th.attr('data-col-id');
1923
1924
  //Closing the popovers if any present when clicked on header or while sorting
1924
1925
  this.closePopover();
@@ -1929,7 +1930,7 @@ $.widget('wm.datatable', {
1929
1930
  if (e) {
1930
1931
  e.stopImmediatePropagation();
1931
1932
  }
1932
- var $th = e ? $(e.target).closest('th.app-datagrid-header-cell') : $headerCell,
1933
+ let $th = e ? $(e.target).closest('th.app-datagrid-header-cell') : $headerCell,
1933
1934
  id = $th.attr('data-col-id'),
1934
1935
  colDef = this.preparedHeaderData[id],
1935
1936
  field = colDef.field,
@@ -1969,7 +1970,7 @@ $.widget('wm.datatable', {
1969
1970
  return _.get(document.forms, [$el.find('form').attr('name'), fieldName, 'files', 0]);
1970
1971
  },
1971
1972
  isDataModified: function ($editableElements, rowData, alwaysNewRow) {
1972
- var isDataChanged = false,
1973
+ let isDataChanged = false,
1973
1974
  self = this;
1974
1975
 
1975
1976
  function getEpoch(val) {
@@ -1977,7 +1978,7 @@ $.widget('wm.datatable', {
1977
1978
  }
1978
1979
 
1979
1980
  $editableElements.each(function () {
1980
- var $el = $(this),
1981
+ const $el = $(this),
1981
1982
  colId = $el.attr('data-col-id'),
1982
1983
  colDef = self.preparedHeaderData[colId],
1983
1984
  text = self.getTextValue(colDef.field, alwaysNewRow),
@@ -2009,12 +2010,12 @@ $.widget('wm.datatable', {
2009
2010
  this.gridElement.find('tr.app-datagrid-row.active').focus();
2010
2011
  },
2011
2012
  focusNewRow: function () {
2012
- var newRow = this.gridElement.find('tr.always-new-row');
2013
- var newRowInputs = newRow && newRow.find("input") || [];
2013
+ const newRow = this.gridElement.find('tr.always-new-row');
2014
+ const newRowInputs = newRow && newRow.find("input") || [];
2014
2015
  newRowInputs.length && newRowInputs[0].focus();
2015
2016
  },
2016
2017
  disableActions: function (val) {
2017
- var $deleteBtns = this.gridElement.find('.delete-row-button'),
2018
+ const $deleteBtns = this.gridElement.find('.delete-row-button'),
2018
2019
  $editBtns = this.gridElement.find('.edit-row-button');
2019
2020
  if (val) {
2020
2021
  //Disable edit and delete actions while editing a row
@@ -2027,7 +2028,7 @@ $.widget('wm.datatable', {
2027
2028
  },
2028
2029
  //Function to the first input element in a row
2029
2030
  setFocusOnElement: function (e, $el, skipDelay) {
2030
- var $firstEl,
2031
+ let $firstEl,
2031
2032
  $target = e && $(e.target),
2032
2033
  $focusEl;
2033
2034
  //If focused directly on the cell, focus the input in the cell
@@ -2090,10 +2091,9 @@ $.widget('wm.datatable', {
2090
2091
  },
2091
2092
  //Method to make row editable with widgets
2092
2093
  makeRowEditable: function ($row, rowData, alwaysNewRow) {
2093
- var self = this,
2094
+ const self = this,
2094
2095
  $originalElements = $row.find('td.app-datagrid-cell'),
2095
2096
  rowId = parseInt($row.attr('data-row-id'), 10),
2096
- $editableElements,
2097
2097
  _rowData = _.clone(rowData);
2098
2098
 
2099
2099
  _rowData.$index = rowId + 1;
@@ -2102,7 +2102,7 @@ $.widget('wm.datatable', {
2102
2102
  this.options.generateInlineEditRow(_rowData, alwaysNewRow);
2103
2103
 
2104
2104
  $originalElements.each(function () {
2105
- var $el = $(this),
2105
+ let $el = $(this),
2106
2106
  cellText = $el.text(),
2107
2107
  id = $el.attr('data-col-id'),
2108
2108
  colDef = self.preparedHeaderData[id],
@@ -2142,7 +2142,6 @@ $.widget('wm.datatable', {
2142
2142
  }
2143
2143
  });
2144
2144
 
2145
- $editableElements = $row.find('td.cell-editing');
2146
2145
  // PERFORMANCE FIX: Use event delegation on row instead of individual cell listeners
2147
2146
  $row.on('click.cellEdit', 'td.cell-editing', function (e) {
2148
2147
  e.stopPropagation();
@@ -2156,7 +2155,7 @@ $.widget('wm.datatable', {
2156
2155
  },
2157
2156
  // WMS-18568 changes added Save and Cancel buttons for Inline Data Table with no actions
2158
2157
  toggleNewRowActions: function (saveInd) {
2159
- var self = this,
2158
+ const self = this,
2160
2159
  $gridActions = $(this.element).siblings('div.panel-footer, div.panel-heading').find('div.app-datagrid-actions'),
2161
2160
  $newRow = this.gridElement.find('tr.app-datagrid-row.row-editing'),
2162
2161
  $newRowButton = $gridActions.find('i.wi-plus').closest('.app-button');
@@ -2186,11 +2185,11 @@ $.widget('wm.datatable', {
2186
2185
  }
2187
2186
  },
2188
2187
  _isNewRow: function ($row) {
2189
- var rowId = parseInt($row.attr('data-row-id'), 10);
2188
+ const rowId = parseInt($row.attr('data-row-id'), 10);
2190
2189
  return rowId >= this.preparedData.length || $row.hasClass('always-new-row');
2191
2190
  },
2192
2191
  _getWmVariableRowLocator: function (rowId) {
2193
- var liveRow = this.options.data[parseInt(rowId, 10)];
2192
+ const liveRow = this.options.data[parseInt(rowId, 10)];
2194
2193
  return (liveRow && liveRow.$$wmSourceListIndex != null) ? liveRow.$$wmSourceListIndex : parseInt(rowId, 10);
2195
2194
  },
2196
2195
  /* Toggles the edit state of a row. */
@@ -2205,7 +2204,7 @@ $.widget('wm.datatable', {
2205
2204
  }
2206
2205
  //Closing the popovers if clicked on any row for Quick edit
2207
2206
  this.closePopover();
2208
- var $row = options.$row || $(e.target).closest('tr.app-datagrid-row'),
2207
+ let $row = options.$row || $(e.target).closest('tr.app-datagrid-row'),
2209
2208
  $editButton = $row.find('.edit-row-button'),
2210
2209
  $cancelButton = $row.find('.cancel-edit-row-button'),
2211
2210
  $saveButton = $row.find('.save-edit-row-button'),
@@ -2312,7 +2311,7 @@ $.widget('wm.datatable', {
2312
2311
 
2313
2312
  if (isDataChanged) {
2314
2313
  $editableElements.each(function () {
2315
- var $el = $(this),
2314
+ let $el = $(this),
2316
2315
  colId = $el.attr('data-col-id'),
2317
2316
  colDef = self.preparedHeaderData[colId],
2318
2317
  fields = _.split(colDef.field, '.'),
@@ -2354,7 +2353,7 @@ $.widget('wm.datatable', {
2354
2353
  //If required fields are present and value is not filled, return here
2355
2354
  if ($requiredEls.length > 0) {
2356
2355
  $requiredEls.each(function (index) {
2357
- var $invalidTd = $(this).closest('td.app-datagrid-cell');
2356
+ const $invalidTd = $(this).closest('td.app-datagrid-cell');
2358
2357
  if (index === 0) {
2359
2358
  $invalidTd.find('[focus-target]').focus();
2360
2359
  }
@@ -2398,7 +2397,7 @@ $.widget('wm.datatable', {
2398
2397
  return;
2399
2398
  }
2400
2399
  }
2401
- var ds = this.options.getDataSource && this.options.getDataSource();
2400
+ const ds = this.options.getDataSource && this.options.getDataSource();
2402
2401
  if (ds && ds.category === 'wm.Variable') {
2403
2402
  editOptions.rowindex = self._getWmVariableRowLocator(rowindex);
2404
2403
  }
@@ -2427,7 +2426,7 @@ $.widget('wm.datatable', {
2427
2426
  this.addOrRemoveScroll();
2428
2427
  },
2429
2428
  cancelEdit: function ($row) {
2430
- var self = this,
2429
+ const self = this,
2431
2430
  $editableElements = $row.find('td.cell-editing'),
2432
2431
  $cancelButton = $row.find('.cancel-edit-row-button'),
2433
2432
  $saveButton = $row.find('.save-edit-row-button'),
@@ -2442,7 +2441,7 @@ $.widget('wm.datatable', {
2442
2441
  $row.off('.cellEdit');
2443
2442
  $editableElements.off('click');
2444
2443
  $editableElements.each(function () {
2445
- var $el = $(this),
2444
+ const $el = $(this),
2446
2445
  value = $el.data('originalValue');
2447
2446
  // Fix for [WMS-27289]: Reassigning `tabindex` and `title` attributes to the `<td>` element when the cancel button is clicked in Edit mode.
2448
2447
  $el.attr('tabindex', 0);
@@ -2462,7 +2461,7 @@ $.widget('wm.datatable', {
2462
2461
  },
2463
2462
  //Function to close the current editing row
2464
2463
  closeEditedRow: function () {
2465
- var $row = this.gridElement.find('tr.app-datagrid-row.row-editing');
2464
+ const $row = this.gridElement.find('tr.app-datagrid-row.row-editing');
2466
2465
  if ($row.length) {
2467
2466
  //If new row, remove the row. Else, cancel the row edit
2468
2467
  if (this._isNewRow($row)) {
@@ -2482,7 +2481,7 @@ $.widget('wm.datatable', {
2482
2481
  this.resetNewRow($row);
2483
2482
  return;
2484
2483
  }
2485
- var $editableElements = $row.find('td.cell-editing'),
2484
+ const $editableElements = $row.find('td.cell-editing'),
2486
2485
  $editButton = $row.find('.edit-row-button'),
2487
2486
  $cancelButton = $row.find('.cancel-edit-row-button'),
2488
2487
  $saveButton = $row.find('.save-edit-row-button'),
@@ -2494,7 +2493,7 @@ $.widget('wm.datatable', {
2494
2493
  this.disableActions(false);
2495
2494
  this._setGridEditMode(false);
2496
2495
  $editableElements.each(function () {
2497
- var $el = $(this),
2496
+ let $el = $(this),
2498
2497
  value = $el.data('originalValue'),
2499
2498
  text,
2500
2499
  colDef;
@@ -2518,7 +2517,7 @@ $.widget('wm.datatable', {
2518
2517
  /* Deletes a row. */
2519
2518
  deleteRow: function (e) {
2520
2519
  e.stopPropagation();
2521
- var $row = $(e.target).closest('tr.app-datagrid-row'),
2520
+ let $row = $(e.target).closest('tr.app-datagrid-row'),
2522
2521
  rowId = $row.attr('data-row-id'),
2523
2522
  rowData = this.options.data[rowId],
2524
2523
  isNewRow = this._isNewRow($row),
@@ -2553,7 +2552,7 @@ $.widget('wm.datatable', {
2553
2552
  return;
2554
2553
  }
2555
2554
  }
2556
- var deleteDs = this.options.getDataSource && this.options.getDataSource();
2555
+ const deleteDs = this.options.getDataSource && this.options.getDataSource();
2557
2556
  if (deleteDs && deleteDs.category === 'wm.Variable') {
2558
2557
  options.rowindex = this._getWmVariableRowLocator(rowId);
2559
2558
  }
@@ -2572,9 +2571,9 @@ $.widget('wm.datatable', {
2572
2571
  self.addOrRemoveScroll();
2573
2572
  }, e, function (skipFocus, error) {
2574
2573
  if (self.options.isNavTypeScrollOrOndemand()) {
2575
- var rowId = +$(e.target).closest("tr.app-datagrid-row").attr("data-row-id");
2574
+ let rowId = +$(e.target).closest("tr.app-datagrid-row").attr("data-row-id");
2576
2575
  // remove existing row from tbody
2577
- var $row = self.gridElement.find('tr.app-datagrid-row[data-row-id="' + rowId + '"]');
2576
+ const $row = self.gridElement.find('tr.app-datagrid-row[data-row-id="' + rowId + '"]');
2578
2577
  self.options.setDeletedRowIndex(rowId);
2579
2578
  // remove data
2580
2579
  self.preparedData.splice(rowId,1);
@@ -2600,7 +2599,7 @@ $.widget('wm.datatable', {
2600
2599
  }
2601
2600
  //Call set status, so that the rows are visible for fom operations
2602
2601
  self.__setStatus();
2603
- var rowID,
2602
+ let rowID,
2604
2603
  $nextRow;
2605
2604
  if (error) {
2606
2605
  return;
@@ -2624,11 +2623,11 @@ $.widget('wm.datatable', {
2624
2623
 
2625
2624
  /* Keeps a track of the currently selected row, and deselects the previous row, if multiselect is false. */
2626
2625
  _deselectPreviousSelection: function ($row, e) {
2627
- var selectedRows = this.gridElement.find('tr.app-datagrid-row.active'),
2626
+ const selectedRows = this.gridElement.find('tr.app-datagrid-row.active'),
2628
2627
  rowId = $row.attr('data-row-id'),
2629
2628
  self = this;
2630
2629
  selectedRows.each(function () {
2631
- var id = $(this).attr('data-row-id'),
2630
+ const id = $(this).attr('data-row-id'),
2632
2631
  preparedData = self.preparedData[id];
2633
2632
  if (id !== rowId && preparedData) {
2634
2633
  $(this).find('input[rowSelectInput]:radio').prop('checked', false);
@@ -2641,7 +2640,7 @@ $.widget('wm.datatable', {
2641
2640
  //Method to remove sort icons from the column header cells
2642
2641
  resetSortIcons: function ($el) {
2643
2642
  this.isResetSortIconsDone = true;
2644
- var $sortContainer;
2643
+ let $sortContainer;
2645
2644
  //If sort icon is not passed, find out the sort icon from the active class
2646
2645
  if (!$el && this.gridHeaderElement) {
2647
2646
  $sortContainer = this.gridHeaderElement.find('.sort-buttons-container.active');
@@ -2675,7 +2674,7 @@ $.widget('wm.datatable', {
2675
2674
  this.columnSelectionHandler(e);
2676
2675
  this.headerClickHandler(e);
2677
2676
  }
2678
- var $e = $(e.target),
2677
+ let $e = $(e.target),
2679
2678
  $th = $e.closest('th.app-datagrid-header-cell'),
2680
2679
  id = $th.attr('data-col-id'),
2681
2680
  $sortContainer = $th.find('.sort-buttons-container'),
@@ -2722,8 +2721,8 @@ $.widget('wm.datatable', {
2722
2721
  },
2723
2722
  //Method to handle up and next key presses
2724
2723
  processUpDownKeys: function (event, $row, direction) {
2725
- var self = this;
2726
- var rowData = $row.find('input').val();
2724
+ const self = this;
2725
+ const rowData = $row.find('input').val();
2727
2726
  if ($row.hasClass('row-editing') && self.options.editmode === self.CONSTANTS.QUICK_EDIT && rowData) {
2728
2727
  self.toggleEditRow(event, {
2729
2728
  'action': 'save',
@@ -2742,7 +2741,7 @@ $.widget('wm.datatable', {
2742
2741
  },
2743
2742
  //Reset new row data
2744
2743
  resetNewRow: function ($row) {
2745
- var rowData = {},
2744
+ const rowData = {},
2746
2745
  self = this;
2747
2746
 
2748
2747
  this.options.clearForm(true);
@@ -2751,7 +2750,7 @@ $.widget('wm.datatable', {
2751
2750
 
2752
2751
  //Set the default values for widgets in the row
2753
2752
  $row.find('[data-field-name]').each(function () {
2754
- var $input = $(this),
2753
+ const $input = $(this),
2755
2754
  fieldName = $input.attr('data-field-name') + '_new';
2756
2755
  self.options.setFieldValue(fieldName, rowData[$input.attr('data-field-name')] || '')
2757
2756
  });
@@ -2759,7 +2758,7 @@ $.widget('wm.datatable', {
2759
2758
  self.setFocusOnElement(undefined, $row, true);
2760
2759
  },
2761
2760
  _onEnter: function ($target, $row, quickEdit, event) {
2762
- var self = this;
2761
+ const self = this;
2763
2762
  if($target.is('button')){
2764
2763
  return;
2765
2764
  }
@@ -2782,11 +2781,11 @@ $.widget('wm.datatable', {
2782
2781
  }
2783
2782
  self.options.timeoutCall(function () {
2784
2783
  if(quickEdit){
2785
- var rowId = $editingRow[0]?.getAttribute('data-row-id');
2784
+ let rowId = $editingRow[0]?.getAttribute('data-row-id');
2786
2785
  if($editingRow.hasClass("always-new-row")){
2787
2786
  rowId= self.gridElement[0].querySelector("tr.always-new-row")?.getAttribute('data-row-id')-1;
2788
2787
  }
2789
- var matchingRow = self.gridElement[0].querySelector("tr[data-row-id='" + rowId + "']");
2788
+ const matchingRow = self.gridElement[0].querySelector("tr[data-row-id='" + rowId + "']");
2790
2789
  if($(matchingRow).hasClass('always-new-row')){return;}
2791
2790
  if (matchingRow) {
2792
2791
  if (!self.options.multiselect) {
@@ -2816,7 +2815,7 @@ $.widget('wm.datatable', {
2816
2815
  },
2817
2816
  // Handles keydown event on row items.
2818
2817
  onKeyDown: function (event) {
2819
- var $target = $(event.target),
2818
+ let $target = $(event.target),
2820
2819
  $row = $target.closest('tr.app-datagrid-row'),
2821
2820
  self = this,
2822
2821
  quickEdit = this.options.editmode === this.CONSTANTS.QUICK_EDIT,
@@ -2868,7 +2867,7 @@ $.widget('wm.datatable', {
2868
2867
  }
2869
2868
  },
2870
2869
  editSuccessHandler: function (skipFocus, error, e, $row, isSameRow, direction) {
2871
- var self = this,
2870
+ let self = this,
2872
2871
  rowID,
2873
2872
  $nextRow;
2874
2873
  //Call set status, so that the rows are visible for fom operations
@@ -2913,7 +2912,7 @@ $.widget('wm.datatable', {
2913
2912
  },
2914
2913
  //Method to check if the docus is on last column
2915
2914
  isLastColumn: function ($target) {
2916
- var $cell = $target.closest('td.app-datagrid-cell'),
2915
+ let $cell = $target.closest('td.app-datagrid-cell'),
2917
2916
  $editCells;
2918
2917
 
2919
2918
  if ($cell.is(':last-child') || $cell.nextAll('td.app-datagrid-cell:visible').length === 0) {
@@ -2928,8 +2927,8 @@ $.widget('wm.datatable', {
2928
2927
  return false;
2929
2928
  },
2930
2929
  getColInfo: function(event) {
2931
- var column = $(event.target).closest('td.app-datagrid-cell');
2932
- var colId = column.attr('data-col-id');
2930
+ const column = $(event.target).closest('td.app-datagrid-cell');
2931
+ const colId = column.attr('data-col-id');
2933
2932
  return colId;
2934
2933
  },
2935
2934
  keydownHandler: function(event) {
@@ -2939,7 +2938,7 @@ $.widget('wm.datatable', {
2939
2938
  },
2940
2939
  /* Attaches all event handlers for the table. */
2941
2940
  attachEventHandlers: function ($htm) {
2942
- var self = this;
2941
+ const self = this;
2943
2942
 
2944
2943
  if (this.options.enableRowSelection) {
2945
2944
  $htm[0].removeEventListener('click', this.rowClickHandlerOnCapture.bind(this));
@@ -2971,7 +2970,7 @@ $.widget('wm.datatable', {
2971
2970
  }
2972
2971
  if (self.options.editmode === self.CONSTANTS.QUICK_EDIT) {
2973
2972
  $htm.on('focus', 'tr.app-datagrid-row', function (e) {
2974
- var $row = $(e.currentTarget);
2973
+ const $row = $(e.currentTarget);
2975
2974
  if (!$row.hasClass('row-editing')) {
2976
2975
  if(e.target===e.currentTarget && (e.which===0||!e.which)) {
2977
2976
  return;
@@ -2981,7 +2980,7 @@ $.widget('wm.datatable', {
2981
2980
  });
2982
2981
  //On tab out of a row, save the current row and make next row editable
2983
2982
  $htm.on('focusout', 'tr.app-datagrid-row','thead.table-header', function (e) {
2984
- var $target = $(e.target),
2983
+ const $target = $(e.target),
2985
2984
  $row = $target.closest('tr.app-datagrid-row'),
2986
2985
  $relatedTarget = $(e.relatedTarget),
2987
2986
  isLastColumn = self.isLastColumn($target, $relatedTarget),
@@ -3048,7 +3047,7 @@ $.widget('wm.datatable', {
3048
3047
  // row selection
3049
3048
  $htm.find('[data-identifier="rowExpansionButtons"]').off("click");
3050
3049
  $htm.find('[data-identifier="rowExpansionButtons"]').on('click', function (e) {
3051
- var $row = $(e.target).closest('tr.app-datagrid-row');
3050
+ const $row = $(e.target).closest('tr.app-datagrid-row');
3052
3051
  if ($(this).find('.app-button').attr('disabled')) {
3053
3052
  return;
3054
3053
  }
@@ -3060,7 +3059,7 @@ $.widget('wm.datatable', {
3060
3059
  * Needed when table header is rebuilt (e.g. showHeader toggle) without a full _renderGrid
3061
3060
  */
3062
3061
  _attachHeaderEventHandlers: function () {
3063
- var $header = this.gridHeaderElement;
3062
+ const $header = this.gridHeaderElement;
3064
3063
  if (!$header || !$header.length) {
3065
3064
  return;
3066
3065
  }
@@ -3101,7 +3100,7 @@ $.widget('wm.datatable', {
3101
3100
  return classNames && classNames.every(cls => element.hasClass(cls));
3102
3101
  },
3103
3102
  _collapseRow: function(e, rowData, rowId, $nextDetailRow, $icon) {
3104
- var self = this,
3103
+ const self = this,
3105
3104
  $tbody = self.gridElement,
3106
3105
  $row = $($tbody.find('> tr.app-datagrid-row[data-row-id="'+ rowId +'"]'));
3107
3106
  $row.removeClass(self.options.cssClassNames.expandedRowClass);
@@ -3116,7 +3115,7 @@ $.widget('wm.datatable', {
3116
3115
  this.options.onRowCollapse(e, rowData)
3117
3116
  },
3118
3117
  toggleExpandRow: function(rowId, isExpand, e) {
3119
- var self = this,
3118
+ const self = this,
3120
3119
  $tbody = self.gridElement,
3121
3120
  $row = $($tbody.find('> tr.app-datagrid-row[data-row-id="'+ rowId +'"]')),
3122
3121
  rowData = _.clone(self.options.data[rowId]),
@@ -3143,7 +3142,7 @@ $.widget('wm.datatable', {
3143
3142
  }
3144
3143
  if (self.options.rowDef.closeothers) {
3145
3144
  $tbody.find('> tr.app-datagrid-detail-row:visible').each(function() {
3146
- var $otherDetailRow = $(this),
3145
+ const $otherDetailRow = $(this),
3147
3146
  $otherIcon = $otherDetailRow.prev('tr.app-datagrid-row').find('[data-identifier="rowExpansionButtons"] i.app-icon'),
3148
3147
  otherRowId = +$otherDetailRow.attr('data-row-id'),
3149
3148
  otherRowData = self.options.data[otherRowId];
@@ -3171,11 +3170,11 @@ $.widget('wm.datatable', {
3171
3170
  if (!this.gridElement) {
3172
3171
  return;
3173
3172
  }
3174
- var $compiledCells = this.gridElement.find('td[data-compiled-template]'),
3173
+ const $compiledCells = this.gridElement.find('td[data-compiled-template]'),
3175
3174
  self = this;
3176
3175
 
3177
3176
  $compiledCells.each(function () {
3178
- var $cell = $(this),
3177
+ const $cell = $(this),
3179
3178
  id = $cell.attr('data-compiled-template');
3180
3179
 
3181
3180
  $cell.replaceWith(self.compiledCellTemplates[id]);
@@ -3184,13 +3183,13 @@ $.widget('wm.datatable', {
3184
3183
 
3185
3184
  /* Renders the search box. */
3186
3185
  _renderSearch: function () {
3187
- var $htm = $(this._getSearchEl()),
3186
+ let $htm = $(this._getSearchEl()),
3188
3187
  self = this,
3189
3188
  $searchBox;
3190
3189
 
3191
3190
  function search(e) {
3192
3191
  e.stopPropagation();
3193
- var searchText = $htm.find('[data-element="dgSearchText"]')[0].value,
3192
+ const searchText = $htm.find('[data-element="dgSearchText"]')[0].value,
3194
3193
  $filterField = $htm.find('[data-element="dgFilterValue"]'),
3195
3194
  field = $filterField[0].value,
3196
3195
  colDefIndex = $htm.find('option:selected').attr('data-coldef-index'),
@@ -3239,13 +3238,13 @@ $.widget('wm.datatable', {
3239
3238
  },
3240
3239
  //Generate the row level filter
3241
3240
  _renderRowFilter: function () {
3242
- var $row = $('<tr class="filter-row"></tr>'),
3241
+ const $row = $('<tr class="filter-row"></tr>'),
3243
3242
  self = this,
3244
3243
  $headerElement = (this.options.isMobile && !this.options.showHeader) ? this.gridElement : this.gridHeaderElement;
3245
3244
  $headerElement.find('.filter-row').remove();
3246
3245
  this.options.generateFilterRow();
3247
3246
  this.preparedHeaderData.forEach(function (field, index) {
3248
- var fieldName = field.field,
3247
+ const fieldName = field.field,
3249
3248
  $th = $('<th data-col-id="' + index + '"></th>');
3250
3249
  if (!field.searchable) {
3251
3250
  $row.append($th);
@@ -3257,17 +3256,13 @@ $.widget('wm.datatable', {
3257
3256
  if (this.options.showHeader) {
3258
3257
  this.gridHeaderElement.append($row);
3259
3258
  } else {
3260
- if (this.options.isMobile) {
3261
- $headerElement.empty().append($row);
3262
- } else {
3263
- $headerElement.empty().append($row);
3264
- }
3259
+ $headerElement.empty().append($row);
3265
3260
  }
3266
3261
  this.gridSearch = $headerElement.find('.filter-row');
3267
3262
  },
3268
3263
  /* Renders the table header. */
3269
3264
  _renderHeader: function () {
3270
- var headerTemplate = this._getHeaderTemplate(),
3265
+ let headerTemplate = this._getHeaderTemplate(),
3271
3266
  $colgroup = headerTemplate.colgroup,
3272
3267
  self = this,
3273
3268
  $header;
@@ -3279,7 +3274,6 @@ $.widget('wm.datatable', {
3279
3274
  this.tableContainer.find('colgroup').remove(); // Remove the colgroup from the table container when showHeader is false
3280
3275
  this.tableContainer.append($colgroup);
3281
3276
  this.gridHeaderElement.hide();
3282
- //this.gridElement.prepend($colgroup.clone());
3283
3277
  return;
3284
3278
  } else {
3285
3279
  /* _toggleHeader() removes thead from the DOM when toggling showHeader; gridHeaderElement
@@ -3294,13 +3288,13 @@ $.widget('wm.datatable', {
3294
3288
  $header = headerTemplate.header;
3295
3289
 
3296
3290
  function toggleSelectAll(e) {
3297
- var $checkboxes = $('tr.app-datagrid-row:not(.always-new-row):visible td input[name="gridMultiSelect"]:checkbox', self.gridElement),
3291
+ const $checkboxes = $('tr.app-datagrid-row:not(.always-new-row):visible td input[name="gridMultiSelect"]:checkbox', self.gridElement),
3298
3292
  checked = this.checked,
3299
3293
  $headerCheckbox = self.gridHeaderElement.find("th.app-datagrid-header-cell input:checkbox");
3300
3294
  $headerCheckbox.siblings('span.sr-only').text(checked ? 'All Rows Selected' : 'All Rows Deselected');
3301
3295
  $checkboxes.prop('checked', checked);
3302
3296
  $checkboxes.each(function () {
3303
- var $row = $(this).closest('tr.app-datagrid-row'),
3297
+ const $row = $(this).closest('tr.app-datagrid-row'),
3304
3298
  rowId = $row.attr('data-row-id'),
3305
3299
  rowData = self.options.data[rowId];
3306
3300
  self.toggleRowSelection($row, checked, e, true);
@@ -3322,10 +3316,10 @@ $.widget('wm.datatable', {
3322
3316
  }
3323
3317
 
3324
3318
  // WMS-17629: Hiding the table header column when show property is set to false
3325
- var headerCells = $header.find("th.app-datagrid-header-cell");
3326
- var headerCols = $colgroup.find('col');
3319
+ const headerCells = $header.find("th.app-datagrid-header-cell");
3320
+ const headerCols = $colgroup.find('col');
3327
3321
  headerCells.each(function () {
3328
- var id = Number($(this).attr('data-col-id')),
3322
+ const id = Number($(this).attr('data-col-id')),
3329
3323
  colDef = self.preparedHeaderData[id],
3330
3324
  $headerCol = $(headerCols[id]);
3331
3325
  if (!colDef) {
@@ -3339,14 +3333,9 @@ $.widget('wm.datatable', {
3339
3333
  });
3340
3334
  this.tableContainer.find('colgroup').remove(); // Remove the colgroup from the table container when showHeader is false
3341
3335
  /*For mobile view, append header to the main table only*/
3342
- if (this.options.isMobile) {
3343
- this.tableContainer.append($colgroup);
3344
- } else {
3345
- /**Append the colgroup to the header and the body.
3346
- * Colgroup is used to maintain the consistent widths between the header table and body table**/
3347
- this.tableContainer.append($colgroup);
3348
- /**As jquery references the colgroup, clone the colgroup and add it to the table body**/
3349
- }
3336
+ /**Append the colgroup to the header and the body.
3337
+ * Colgroup is used to maintain the consistent widths between the header table and body table**/
3338
+ this.tableContainer.append($colgroup);
3350
3339
  /**Add event handler, to the select all checkbox on the header**/
3351
3340
  $header.on('click', '.app-datagrid-header-cell input:checkbox', toggleSelectAll);
3352
3341
  $header.on('keydown', '.app-datagrid-header-cell input:checkbox', function(event) {
@@ -3363,7 +3352,7 @@ $.widget('wm.datatable', {
3363
3352
  this.gridHeaderElement.find('th.app-datagrid-header-cell').on('click', this.headerClickHandler.bind(this));
3364
3353
  this.gridHeaderElement.find('th.app-datagrid-header-cell').on('keydown', function (e) {
3365
3354
  if (e.key === 'Enter' || e.keyCode === 13) {
3366
- var $target = $(e.target);
3355
+ const $target = $(e.target);
3367
3356
  // Only run if on the checkbox column
3368
3357
  if ($target.attr('data-col-field') === 'checkbox') {
3369
3358
  e.preventDefault();
@@ -3382,7 +3371,7 @@ $.widget('wm.datatable', {
3382
3371
  /* This is needed because if width is initially set on col from coldefs,
3383
3372
  * then that column was not getting resized.*/
3384
3373
  resize: function (evt, ui) {
3385
- var $colElement,
3374
+ let $colElement,
3386
3375
  $colHeaderElement,
3387
3376
  $cellElements,
3388
3377
  colIndex = +ui.helper.attr('data-col-id') + 1,
@@ -3416,7 +3405,7 @@ $.widget('wm.datatable', {
3416
3405
  }
3417
3406
  },
3418
3407
  addOrRemoveScroll: function () {
3419
- var gridContent = this.gridContainer.find('tbody'),
3408
+ const gridContent = this.gridContainer.find('tbody'),
3420
3409
  gridHeader = this.gridContainer.find('.table-header');
3421
3410
  /*If scroll bar is present on the grid content, add padding to the header*/
3422
3411
  if ((gridContent.scrollHeight > gridContent.clientHeight) && !this.Utils.isMac()) {
@@ -3433,7 +3422,7 @@ $.widget('wm.datatable', {
3433
3422
 
3434
3423
  //Generates markup for row operations
3435
3424
  _setActionsEnabled: function () {
3436
- var self = this;
3425
+ const self = this;
3437
3426
  _.forEach(this.options.rowActions, function (def) {
3438
3427
  if (_.includes(def.action, 'editRow(')) {
3439
3428
  self.options.actionsEnabled.edit = true;
@@ -3445,13 +3434,13 @@ $.widget('wm.datatable', {
3445
3434
 
3446
3435
  //Appends row operations markup to grid template
3447
3436
  _appendRowActions: function ($htm, isNewRow, rowData) {
3448
- var self,
3437
+ let self,
3449
3438
  rowOperationsCol = this._getRowActionsColumnDef();
3450
3439
  if (this.options.rowActions.length || rowOperationsCol) {
3451
3440
  this._setActionsEnabled();
3452
3441
  self = this;
3453
3442
  $htm.find("[data-identifier='actionButtons']").each(function (index) {
3454
- var _rowData, $row, rowId, rowIndex = index;
3443
+ let _rowData, $row, rowId, rowIndex = index;
3455
3444
  if (isNewRow) {
3456
3445
  _rowData = rowData;
3457
3446
  } else {
@@ -3465,36 +3454,42 @@ $.widget('wm.datatable', {
3465
3454
  });
3466
3455
  }
3467
3456
  },
3468
- /* Renders the table body. */
3469
- _renderGrid: function (isCreated) {
3470
- var $htm, isScrollorOnDemand = this.options.isNavTypeScrollOrOndemand(), pageStartIndex = this.getPageStartIndex();
3471
- $('table.table-bordered').parents('.app-grid-header-inner').addClass('table_border');
3472
- if(isScrollorOnDemand) {
3473
- var $tbody = this.gridElement;
3457
+ /* Builds the grid body markup for the current navigation mode. */
3458
+ _buildGridMarkup: function (isScrollorOnDemand) {
3459
+ let $htm;
3460
+ if (isScrollorOnDemand) {
3461
+ const $tbody = this.gridElement;
3474
3462
  // get markup for new rows and append it to tbod
3475
- var template = this._getGridTemplate();
3463
+ const template = this._getGridTemplate();
3476
3464
  $htm = $(template);
3477
3465
  if (template && !$tbody.length) {
3478
3466
  // initally append tbody to gridElement
3479
3467
  this.gridElement.append($htm);
3480
3468
  }
3481
-
3482
3469
  } else {
3483
- var templates = this._getGridTemplate();
3470
+ const templates = this._getGridTemplate();
3484
3471
  $htm = $(templates);
3485
- if(templates) {
3472
+ if (templates) {
3486
3473
  this.gridElement.append($htm);
3487
3474
  }
3488
3475
  }
3476
+ return $htm;
3477
+ },
3489
3478
 
3490
- if (this.options.summaryRow) {
3491
- var $summaryRowHtm = $(this._getSummaryRowTemplate());
3492
- this.tableContainer.find('tfoot').remove();
3493
- if (this.options.data.length){
3494
- this.tableContainer.append($summaryRowHtm);
3495
- }
3479
+ /* Renders the summary row (tfoot) when the summaryRow option is enabled. */
3480
+ _renderSummaryRowIfNeeded: function () {
3481
+ if (!this.options.summaryRow) {
3482
+ return;
3496
3483
  }
3497
- // Set proper data status messages after the grid is rendered.
3484
+ const $summaryRowHtm = $(this._getSummaryRowTemplate());
3485
+ this.tableContainer.find('tfoot').remove();
3486
+ if (this.options.data.length) {
3487
+ this.tableContainer.append($summaryRowHtm);
3488
+ }
3489
+ },
3490
+
3491
+ /* Sets the proper data status messages after the grid is rendered. */
3492
+ _updateStatusAfterRender: function (isCreated) {
3498
3493
  if (!this.options.data.length && this.dataStatus.state === 'nodata') {
3499
3494
  this.setStatus('nodata');
3500
3495
  } else {
@@ -3502,6 +3497,29 @@ $.widget('wm.datatable', {
3502
3497
  this.dataStatus.message = this.dataStatus.message || this.options.dataStates.loading;
3503
3498
  this.setStatus(this.dataStatus.state, this.dataStatus.message, isCreated);
3504
3499
  }
3500
+ },
3501
+
3502
+ /* Selects the first row after render, when selectFirstRow is enabled. */
3503
+ _selectFirstRowAfterRender: function () {
3504
+ if (this.options.multiselect) {
3505
+ //Set selectFirstRow to false, to prevent first item being selected in next page
3506
+ this.options.selectFirstRow = false;
3507
+ }
3508
+ if (this.gridElement.find('tr.app-datagrid-row.active').length <= 0) {
3509
+ this.selectFirstRow(true, true);
3510
+ }
3511
+ },
3512
+
3513
+ /* Renders the table body. */
3514
+ _renderGrid: function (isCreated) {
3515
+ const isScrollorOnDemand = this.options.isNavTypeScrollOrOndemand();
3516
+ $('table.table-bordered').parents('.app-grid-header-inner').addClass('table_border');
3517
+ const $htm = this._buildGridMarkup(isScrollorOnDemand);
3518
+
3519
+ this._renderSummaryRowIfNeeded();
3520
+ // Set proper data status messages after the grid is rendered.
3521
+ this._updateStatusAfterRender(isCreated);
3522
+
3505
3523
  this.gridBody = this.gridElement.find('tbody');
3506
3524
  this.gridFooter = this.tableContainer.find('tfoot');
3507
3525
  this._findAndReplaceCompiledTemplates();
@@ -3522,13 +3540,7 @@ $.widget('wm.datatable', {
3522
3540
  this.options.onDataRender();
3523
3541
  }
3524
3542
  if (!isCreated && this.options.selectFirstRow) {
3525
- if (this.options.multiselect) {
3526
- //Set selectFirstRow to false, to prevent first item being selected in next page
3527
- this.options.selectFirstRow = false;
3528
- }
3529
- if (this.gridElement.find('tr.app-datagrid-row.active').length <= 0) {
3530
- this.selectFirstRow(true, true);
3531
- }
3543
+ this._selectFirstRowAfterRender();
3532
3544
  }
3533
3545
  },
3534
3546
 
@@ -3537,8 +3549,7 @@ $.widget('wm.datatable', {
3537
3549
  if (!this.tableId) {
3538
3550
  this.tableId = this.Utils.generateGuid();
3539
3551
  }
3540
- var overflow = (this.options.isNavTypeScrollOrOndemand() && (this.options.height === '100%' || this.options.height === 'auto')) ? 'hidden' : 'auto';
3541
- var statusContainer =
3552
+ const statusContainer =
3542
3553
  '<div class="overlay">' +
3543
3554
  '<div class="status"><i class="' + this.options.loadingicon + '"></i><span class="message"></span></div>' +
3544
3555
  '</div>',
@@ -3607,22 +3618,14 @@ $.widget('wm.datatable', {
3607
3618
  }
3608
3619
  }
3609
3620
  },
3610
- __setStatus: function (isCreated) {
3611
- var loadingIndicator = this.dataStatusContainer.find('i'),
3612
- state = this.dataStatus.state,
3613
- isScrollOrOndemand = this.options.isNavTypeScrollOrOndemand();
3614
- this.dataStatusContainer.find('.message').text(this.dataStatus.message);
3615
- if (state === 'loading') {
3616
- loadingIndicator.removeClass('hidden');
3617
- } else {
3618
- loadingIndicator.addClass('hidden');
3619
- }
3621
+ /* Shows/hides the data status container and the on-demand "load more" link for the given state. */
3622
+ _updateDataStatusContainerVisibility: function (state) {
3620
3623
  if (state === 'ready') {
3621
3624
  this.dataStatusContainer.hide();
3622
3625
  } else {
3623
3626
  // [WMS-23839] always show load more btn if show view less btn is true
3624
- if (this.options.isNavTypeScrollOrOndemand() &&
3625
- (state === 'nodata' ||
3627
+ if (this.options.isNavTypeScrollOrOndemand() &&
3628
+ (state === 'nodata' ||
3626
3629
  (this.options.getCurrentPage && typeof this.options.getCurrentPage === 'function' &&
3627
3630
  this.options.getPageCount && typeof this.options.getPageCount === 'function' &&
3628
3631
  (this.options.getCurrentPage() == this.options.getPageCount()) && !this.options.showviewlessbutton))) {
@@ -3630,45 +3633,73 @@ $.widget('wm.datatable', {
3630
3633
  }
3631
3634
  this.dataStatusContainer.show();
3632
3635
  }
3633
- if (state === 'nodata' || state === 'loading' || state === 'error') {
3634
- if (this.options.height === '100%' || this.options.height === 'auto') { //If height is auto or 100%, Set the loading overlay height as present grid content height
3635
- if (state === 'nodata') {
3636
- this.dataStatusContainer.css('height', 'auto');
3637
- this.dataStatus.contentHeight = 0;
3638
- } else if (this.options.isNavTypeScrollOrOndemand() &&
3639
- this.options.getCurrentPage && typeof this.options.getCurrentPage === 'function' &&
3640
- this.options.getCurrentPage() > 1){
3641
- // showing the loading icon only for the first page
3642
- // from second page there is another loader which is being shown instead of LoadMore btn
3643
- this.dataStatusContainer.hide();
3644
- } else {
3645
- this.dataStatus.height = this.dataStatus.height || this.dataStatusContainer.outerHeight();
3646
- this.dataStatus.contentHeight = this.gridElement.outerHeight() || this.dataStatus.contentHeight;
3647
- this.dataStatusContainer.css('height', this.dataStatus.height > this.dataStatus.contentHeight ? 'auto' : this.dataStatus.contentHeight);
3648
- }
3636
+ },
3637
+
3638
+ /* Adjusts the status container height for the nodata/loading/error states, when applicable. */
3639
+ _updateStatusContainerHeightIfNeeded: function (state) {
3640
+ if (this.options.height === '100%' || this.options.height === 'auto') { //If height is auto or 100%, Set the loading overlay height as present grid content height
3641
+ if (state === 'nodata') {
3642
+ this.dataStatusContainer.css('height', 'auto');
3643
+ this.dataStatus.contentHeight = 0;
3644
+ } else if (this.options.isNavTypeScrollOrOndemand() &&
3645
+ this.options.getCurrentPage && typeof this.options.getCurrentPage === 'function' &&
3646
+ this.options.getCurrentPage() > 1){
3647
+ // showing the loading icon only for the first page
3648
+ // from second page there is another loader which is being shown instead of LoadMore btn
3649
+ this.dataStatusContainer.hide();
3650
+ } else {
3651
+ this.dataStatus.height = this.dataStatus.height || this.dataStatusContainer.outerHeight();
3652
+ this.dataStatus.contentHeight = this.gridElement.outerHeight() || this.dataStatus.contentHeight;
3653
+ this.dataStatusContainer.css('height', this.dataStatus.height > this.dataStatus.contentHeight ? 'auto' : this.dataStatus.contentHeight);
3649
3654
  }
3650
- if (!isScrollOrOndemand || (isScrollOrOndemand &&
3651
- this.options.getCurrentPage && typeof this.options.getCurrentPage === 'function' &&
3652
- this.options.getCurrentPage() === 1)) {
3653
- this.gridContainer.addClass("show-msg");
3655
+ }
3656
+ },
3654
3657
 
3655
- if (state === 'loading' && !isScrollOrOndemand &&
3656
- this.options.lastActionPerformed !== this.options.ACTIONS.EDIT &&
3657
- this.options.lastActionPerformed !== this.options.ACTIONS.DELETE) {
3658
- this.gridElement.addClass('hidden');
3659
- }
3658
+ /* Toggles the "show-msg"/"hidden" classes on the grid for the nodata/loading/error states. */
3659
+ _toggleGridContentVisibilityForStatus: function (state, isScrollOrOndemand) {
3660
+ if (!isScrollOrOndemand || (isScrollOrOndemand &&
3661
+ this.options.getCurrentPage && typeof this.options.getCurrentPage === 'function' &&
3662
+ this.options.getCurrentPage() === 1)) {
3663
+ this.gridContainer.addClass("show-msg");
3664
+
3665
+ if (state === 'loading' && !isScrollOrOndemand &&
3666
+ this.options.lastActionPerformed !== this.options.ACTIONS.EDIT &&
3667
+ this.options.lastActionPerformed !== this.options.ACTIONS.DELETE) {
3668
+ this.gridElement.addClass('hidden');
3660
3669
  }
3661
- } else {
3662
- this.gridContainer.removeClass('show-msg');
3663
- this.gridElement.removeClass('hidden');
3670
+ }
3671
+ },
3664
3672
 
3665
- // In case of quickeditmode, if active row is found, focus the row and bind the event listeners to the row
3666
- if (this.options.editmode === this.CONSTANTS.QUICK_EDIT) {
3667
- if (this.options.activeRow) {
3668
- this.attachHandlersToActiveRow(this.options.activeRow);
3669
- }
3670
- this.options.activeRow = undefined;
3673
+ /* Restores normal grid display once the status leaves nodata/loading/error. */
3674
+ _clearStatusStateForReadyGrid: function () {
3675
+ this.gridContainer.removeClass('show-msg');
3676
+ this.gridElement.removeClass('hidden');
3677
+
3678
+ // In case of quickeditmode, if active row is found, focus the row and bind the event listeners to the row
3679
+ if (this.options.editmode === this.CONSTANTS.QUICK_EDIT) {
3680
+ if (this.options.activeRow) {
3681
+ this.attachHandlersToActiveRow(this.options.activeRow);
3671
3682
  }
3683
+ this.options.activeRow = undefined;
3684
+ }
3685
+ },
3686
+
3687
+ __setStatus: function (isCreated) {
3688
+ const loadingIndicator = this.dataStatusContainer.find('i'),
3689
+ state = this.dataStatus.state,
3690
+ isScrollOrOndemand = this.options.isNavTypeScrollOrOndemand();
3691
+ this.dataStatusContainer.find('.message').text(this.dataStatus.message);
3692
+ if (state === 'loading') {
3693
+ loadingIndicator.removeClass('hidden');
3694
+ } else {
3695
+ loadingIndicator.addClass('hidden');
3696
+ }
3697
+ this._updateDataStatusContainerVisibility(state);
3698
+ if (state === 'nodata' || state === 'loading' || state === 'error') {
3699
+ this._updateStatusContainerHeightIfNeeded(state);
3700
+ this._toggleGridContentVisibilityForStatus(state, isScrollOrOndemand);
3701
+ } else {
3702
+ this._clearStatusStateForReadyGrid();
3672
3703
  }
3673
3704
  if (!isCreated) {
3674
3705
  this.setColGroupWidths();
@@ -3682,8 +3713,8 @@ $.widget('wm.datatable', {
3682
3713
  * If object is recieved, node extraction will be done and if found operations on the row are performed
3683
3714
  */
3684
3715
  attachHandlersToActiveRow(rowObj) {
3685
- var rowIndex = this.Utils.getObjectIndex(this.options.data, rowObj);
3686
- var row = this.gridElement.find('tr.app-datagrid-row[data-row-id=' + rowIndex + ']');
3716
+ const rowIndex = this.Utils.getObjectIndex(this.options.data, rowObj);
3717
+ const row = this.gridElement.find('tr.app-datagrid-row[data-row-id=' + rowIndex + ']');
3687
3718
  if (!row.length) {
3688
3719
  return;
3689
3720
  } else if (!row.hasClass('active')) {
@@ -3698,7 +3729,7 @@ $.widget('wm.datatable', {
3698
3729
  },
3699
3730
  //This method is used to show or hide data loading/ no data found overlay
3700
3731
  setStatus: function (state, message, isCreated) {
3701
- var $newRow;
3732
+ let $newRow;
3702
3733
  //If state is nodata and always new row is present, change state to ready
3703
3734
  if (state === 'nodata') {
3704
3735
  $newRow = this.gridElement && this.gridElement.find('tr.app-datagrid-row.always-new-row');
@@ -3723,16 +3754,7 @@ $.widget('wm.datatable', {
3723
3754
  }
3724
3755
  this.options[key] = value;
3725
3756
  if (key === 'height') {
3726
- // if(this.dataStatus.state != 'loading') {
3727
- var elements = this.gridHeaderElement.find('th');
3728
- // this._setStyles(this.tableContainer, 'border-collapse: separate;');
3729
-
3730
- // for (var i = 0; i < elements.length; i += 1) {
3731
- // this._setStyles($(elements[i]), 'border: 1px solid #eee');
3732
- // }
3733
- //}
3734
3757
  this.gridContainer.find('.app-grid-header-inner').css(key, value);
3735
- // this.gridContainer.find('.app-grid-header-inner').css('border', '1px solid #eee');
3736
3758
  if (this.options.isNavTypeScrollOrOndemand() && (this.options.height != '100%' && this.options.height != 'auto')) {
3737
3759
  this.gridContainer.find('.app-grid-header-inner').css('overflow', 'auto');
3738
3760
  }
@@ -3742,7 +3764,7 @@ $.widget('wm.datatable', {
3742
3764
  },
3743
3765
  /*Change the column header title. function will be called if display name changes in runmode*/
3744
3766
  setColumnProp: function (fieldName, property, val, isGroup) {
3745
- var $col;
3767
+ let $col;
3746
3768
  if (property === 'displayName') {
3747
3769
  if (isGroup) {
3748
3770
  $col = this.gridHeaderElement.find('th[data-col-group="' + fieldName + '"]');
@@ -3760,14 +3782,14 @@ $.widget('wm.datatable', {
3760
3782
  },
3761
3783
 
3762
3784
  applyRowNgClass: function (val, index) {
3763
- var $row = this.gridElement.find('tr.app-datagrid-row[data-row-id="' + index + '"]');
3785
+ const $row = this.gridElement.find('tr.app-datagrid-row[data-row-id="' + index + '"]');
3764
3786
  $row.removeClass(val.toRemove);
3765
3787
  $row.addClass(val.toAdd);
3766
3788
  },
3767
3789
 
3768
3790
  applyColNgClass: function (val, rowIndex, colIndex) {
3769
- var $cell = this.gridElement.find('tr.app-datagrid-row[data-row-id="' + rowIndex + '"] td.app-datagrid-cell[data-col-id="' + colIndex + '"]');
3770
- var $head = this.tableContainer.find('thead tr th.app-datagrid-header-cell[data-col-id="' + colIndex + '"]');
3791
+ const $cell = this.gridElement.find('tr.app-datagrid-row[data-row-id="' + rowIndex + '"] td.app-datagrid-cell[data-col-id="' + colIndex + '"]');
3792
+ const $head = this.tableContainer.find('thead tr th.app-datagrid-header-cell[data-col-id="' + colIndex + '"]');
3771
3793
  $cell.removeClass(val.toRemove);
3772
3794
  $cell.addClass(val.toAdd);
3773
3795
  $head.removeClass(val.toRemove);