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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (473) hide show
  1. package/build-task/bundles/index.umd.js +2489 -2963
  2. package/build-task/fesm2022/index.mjs +2307 -2786
  3. package/build-task/fesm2022/index.mjs.map +1 -1
  4. package/build-task/types/index.d.ts +401 -844
  5. package/components/advanced/carousel/bundles/index.umd.js +387 -344
  6. package/components/advanced/carousel/fesm2022/index.mjs +363 -325
  7. package/components/advanced/carousel/fesm2022/index.mjs.map +1 -1
  8. package/components/advanced/carousel/types/index.d.ts +85 -86
  9. package/components/advanced/custom/bundles/index.umd.js +298 -249
  10. package/components/advanced/custom/fesm2022/index.mjs +280 -236
  11. package/components/advanced/custom/fesm2022/index.mjs.map +1 -1
  12. package/components/advanced/custom/types/index.d.ts +49 -49
  13. package/components/advanced/login/bundles/index.umd.js +177 -127
  14. package/components/advanced/login/fesm2022/index.mjs +162 -117
  15. package/components/advanced/login/fesm2022/index.mjs.map +1 -1
  16. package/components/advanced/login/types/index.d.ts +33 -34
  17. package/components/advanced/marquee/bundles/index.umd.js +93 -63
  18. package/components/advanced/marquee/fesm2022/index.mjs +73 -48
  19. package/components/advanced/marquee/fesm2022/index.mjs.map +1 -1
  20. package/components/advanced/marquee/types/index.d.ts +11 -12
  21. package/components/base/bundles/index.umd.js +5515 -6359
  22. package/components/base/fesm2022/index.mjs +5169 -6027
  23. package/components/base/fesm2022/index.mjs.map +1 -1
  24. package/components/base/types/index.d.ts +1198 -1154
  25. package/components/basic/anchor/bundles/index.umd.js +273 -195
  26. package/components/basic/anchor/fesm2022/index.mjs +251 -178
  27. package/components/basic/anchor/fesm2022/index.mjs.map +1 -1
  28. package/components/basic/anchor/types/index.d.ts +40 -41
  29. package/components/basic/audio/bundles/index.umd.js +124 -75
  30. package/components/basic/audio/fesm2022/index.mjs +104 -60
  31. package/components/basic/audio/fesm2022/index.mjs.map +1 -1
  32. package/components/basic/audio/types/index.d.ts +22 -23
  33. package/components/basic/html/bundles/index.umd.js +144 -113
  34. package/components/basic/html/fesm2022/index.mjs +125 -99
  35. package/components/basic/html/fesm2022/index.mjs.map +1 -1
  36. package/components/basic/html/types/index.d.ts +20 -17
  37. package/components/basic/icon/bundles/index.umd.js +144 -72
  38. package/components/basic/icon/fesm2022/index.mjs +124 -57
  39. package/components/basic/icon/fesm2022/index.mjs.map +1 -1
  40. package/components/basic/icon/types/index.d.ts +18 -19
  41. package/components/basic/iframe/bundles/index.umd.js +143 -93
  42. package/components/basic/iframe/fesm2022/index.mjs +124 -79
  43. package/components/basic/iframe/fesm2022/index.mjs.map +1 -1
  44. package/components/basic/iframe/types/index.d.ts +28 -29
  45. package/components/basic/label/bundles/index.umd.js +136 -120
  46. package/components/basic/label/fesm2022/index.mjs +118 -107
  47. package/components/basic/label/fesm2022/index.mjs.map +1 -1
  48. package/components/basic/label/types/index.d.ts +14 -15
  49. package/components/basic/picture/bundles/index.umd.js +171 -130
  50. package/components/basic/picture/fesm2022/index.mjs +152 -116
  51. package/components/basic/picture/fesm2022/index.mjs.map +1 -1
  52. package/components/basic/picture/types/index.d.ts +21 -22
  53. package/components/basic/progress/progress-bar/bundles/index.umd.js +211 -160
  54. package/components/basic/progress/progress-bar/fesm2022/index.mjs +193 -147
  55. package/components/basic/progress/progress-bar/fesm2022/index.mjs.map +1 -1
  56. package/components/basic/progress/progress-bar/types/index.d.ts +45 -41
  57. package/components/basic/progress/progress-circle/bundles/index.umd.js +294 -165
  58. package/components/basic/progress/progress-circle/fesm2022/index.mjs +274 -150
  59. package/components/basic/progress/progress-circle/fesm2022/index.mjs.map +1 -1
  60. package/components/basic/progress/progress-circle/types/index.d.ts +41 -42
  61. package/components/basic/progress/progress-utils/bundles/index.umd.js +27 -29
  62. package/components/basic/progress/progress-utils/fesm2022/index.mjs +18 -25
  63. package/components/basic/progress/progress-utils/fesm2022/index.mjs.map +1 -1
  64. package/components/basic/progress/progress-utils/types/index.d.ts +3 -5
  65. package/components/basic/rich-text-editor/bundles/index.umd.js +294 -228
  66. package/components/basic/rich-text-editor/fesm2022/index.mjs +275 -214
  67. package/components/basic/rich-text-editor/fesm2022/index.mjs.map +1 -1
  68. package/components/basic/rich-text-editor/types/index.d.ts +55 -56
  69. package/components/basic/search/bundles/index.umd.js +1129 -1090
  70. package/components/basic/search/fesm2022/index.mjs +1117 -1083
  71. package/components/basic/search/fesm2022/index.mjs.map +1 -1
  72. package/components/basic/search/types/index.d.ts +132 -130
  73. package/components/basic/spinner/bundles/index.umd.js +216 -120
  74. package/components/basic/spinner/fesm2022/index.mjs +201 -110
  75. package/components/basic/spinner/fesm2022/index.mjs.map +1 -1
  76. package/components/basic/spinner/types/index.d.ts +30 -31
  77. package/components/basic/tree/bundles/index.umd.js +756 -756
  78. package/components/basic/tree/fesm2022/index.mjs +740 -745
  79. package/components/basic/tree/fesm2022/index.mjs.map +1 -1
  80. package/components/basic/tree/types/index.d.ts +106 -97
  81. package/components/basic/video/bundles/index.umd.js +164 -108
  82. package/components/basic/video/fesm2022/index.mjs +145 -94
  83. package/components/basic/video/fesm2022/index.mjs.map +1 -1
  84. package/components/basic/video/types/index.d.ts +29 -30
  85. package/components/chart/bundles/index.umd.js +1768 -1737
  86. package/components/chart/fesm2022/index.mjs +1713 -1728
  87. package/components/chart/fesm2022/index.mjs.map +1 -1
  88. package/components/chart/types/index.d.ts +102 -104
  89. package/components/containers/accordion/bundles/index.umd.js +522 -494
  90. package/components/containers/accordion/fesm2022/index.mjs +502 -479
  91. package/components/containers/accordion/fesm2022/index.mjs.map +1 -1
  92. package/components/containers/accordion/types/index.d.ts +116 -116
  93. package/components/containers/layout-grid/bundles/index.umd.js +260 -164
  94. package/components/containers/layout-grid/fesm2022/index.mjs +231 -140
  95. package/components/containers/layout-grid/fesm2022/index.mjs.map +1 -1
  96. package/components/containers/layout-grid/types/index.d.ts +30 -27
  97. package/components/containers/linear-layout/bundles/index.umd.js +220 -178
  98. package/components/containers/linear-layout/fesm2022/index.mjs +193 -156
  99. package/components/containers/linear-layout/fesm2022/index.mjs.map +1 -1
  100. package/components/containers/linear-layout/types/index.d.ts +26 -26
  101. package/components/containers/panel/bundles/index.umd.js +343 -215
  102. package/components/containers/panel/fesm2022/index.mjs +330 -207
  103. package/components/containers/panel/fesm2022/index.mjs.map +1 -1
  104. package/components/containers/panel/types/index.d.ts +48 -49
  105. package/components/containers/tabs/bundles/index.umd.js +832 -779
  106. package/components/containers/tabs/fesm2022/index.mjs +811 -763
  107. package/components/containers/tabs/fesm2022/index.mjs.map +1 -1
  108. package/components/containers/tabs/types/index.d.ts +134 -126
  109. package/components/containers/tile/bundles/index.umd.js +93 -60
  110. package/components/containers/tile/fesm2022/index.mjs +75 -47
  111. package/components/containers/tile/fesm2022/index.mjs.map +1 -1
  112. package/components/containers/tile/types/index.d.ts +11 -12
  113. package/components/containers/wizard/bundles/index.umd.js +1096 -1078
  114. package/components/containers/wizard/fesm2022/index.mjs +1069 -1056
  115. package/components/containers/wizard/fesm2022/index.mjs.map +1 -1
  116. package/components/containers/wizard/types/index.d.ts +258 -252
  117. package/components/data/card/bundles/index.umd.js +439 -229
  118. package/components/data/card/fesm2022/index.mjs +408 -203
  119. package/components/data/card/fesm2022/index.mjs.map +1 -1
  120. package/components/data/card/types/index.d.ts +50 -48
  121. package/components/data/form/bundles/index.umd.js +3392 -3339
  122. package/components/data/form/fesm2022/index.mjs +3350 -3304
  123. package/components/data/form/fesm2022/index.mjs.map +1 -1
  124. package/components/data/form/types/index.d.ts +561 -482
  125. package/components/data/list/bundles/index.umd.js +1523 -1601
  126. package/components/data/list/fesm2022/index.mjs +1507 -1590
  127. package/components/data/list/fesm2022/index.mjs.map +1 -1
  128. package/components/data/list/types/index.d.ts +300 -283
  129. package/components/data/live-table/bundles/index.umd.js +299 -280
  130. package/components/data/live-table/fesm2022/index.mjs +284 -270
  131. package/components/data/live-table/fesm2022/index.mjs.map +1 -1
  132. package/components/data/live-table/types/index.d.ts +42 -39
  133. package/components/data/pagination/bundles/index.umd.js +848 -881
  134. package/components/data/pagination/fesm2022/index.mjs +835 -879
  135. package/components/data/pagination/fesm2022/index.mjs.map +1 -1
  136. package/components/data/pagination/types/index.d.ts +110 -106
  137. package/components/data/table/bundles/index.umd.js +4977 -5042
  138. package/components/data/table/fesm2022/index.mjs +4937 -5007
  139. package/components/data/table/fesm2022/index.mjs.map +1 -1
  140. package/components/data/table/types/index.d.ts +770 -736
  141. package/components/dialogs/alert-dialog/bundles/index.umd.js +259 -118
  142. package/components/dialogs/alert-dialog/fesm2022/index.mjs +243 -109
  143. package/components/dialogs/alert-dialog/fesm2022/index.mjs.map +1 -1
  144. package/components/dialogs/alert-dialog/types/index.d.ts +31 -26
  145. package/components/dialogs/confirm-dialog/bundles/index.umd.js +250 -121
  146. package/components/dialogs/confirm-dialog/fesm2022/index.mjs +236 -114
  147. package/components/dialogs/confirm-dialog/fesm2022/index.mjs.map +1 -1
  148. package/components/dialogs/confirm-dialog/types/index.d.ts +34 -29
  149. package/components/dialogs/default/bundles/index.umd.js +509 -373
  150. package/components/dialogs/default/fesm2022/index.mjs +485 -354
  151. package/components/dialogs/default/fesm2022/index.mjs.map +1 -1
  152. package/components/dialogs/default/types/index.d.ts +129 -86
  153. package/components/dialogs/design-dialog/bundles/index.umd.js +320 -142
  154. package/components/dialogs/design-dialog/fesm2022/index.mjs +305 -132
  155. package/components/dialogs/design-dialog/fesm2022/index.mjs.map +1 -1
  156. package/components/dialogs/design-dialog/types/index.d.ts +31 -20
  157. package/components/dialogs/iframe-dialog/bundles/index.umd.js +258 -111
  158. package/components/dialogs/iframe-dialog/fesm2022/index.mjs +245 -105
  159. package/components/dialogs/iframe-dialog/fesm2022/index.mjs.map +1 -1
  160. package/components/dialogs/iframe-dialog/types/index.d.ts +27 -22
  161. package/components/dialogs/login-dialog/bundles/index.umd.js +139 -106
  162. package/components/dialogs/login-dialog/fesm2022/index.mjs +125 -97
  163. package/components/dialogs/login-dialog/fesm2022/index.mjs.map +1 -1
  164. package/components/dialogs/login-dialog/types/index.d.ts +27 -26
  165. package/components/dialogs/partial-dialog/bundles/index.umd.js +302 -149
  166. package/components/dialogs/partial-dialog/fesm2022/index.mjs +289 -143
  167. package/components/dialogs/partial-dialog/fesm2022/index.mjs.map +1 -1
  168. package/components/dialogs/partial-dialog/types/index.d.ts +37 -32
  169. package/components/input/base-form/bundles/index.umd.js +143 -139
  170. package/components/input/base-form/fesm2022/index.mjs +129 -130
  171. package/components/input/base-form/fesm2022/index.mjs.map +1 -1
  172. package/components/input/base-form/types/index.d.ts +28 -29
  173. package/components/input/base-form-custom/bundles/index.umd.js +107 -121
  174. package/components/input/base-form-custom/fesm2022/index.mjs +88 -107
  175. package/components/input/base-form-custom/fesm2022/index.mjs.map +1 -1
  176. package/components/input/base-form-custom/types/index.d.ts +23 -26
  177. package/components/input/button/bundles/index.umd.js +177 -89
  178. package/components/input/button/fesm2022/index.mjs +158 -75
  179. package/components/input/button/fesm2022/index.mjs.map +1 -1
  180. package/components/input/button/types/index.d.ts +24 -25
  181. package/components/input/button-group/bundles/index.umd.js +110 -72
  182. package/components/input/button-group/fesm2022/index.mjs +90 -57
  183. package/components/input/button-group/fesm2022/index.mjs.map +1 -1
  184. package/components/input/button-group/types/index.d.ts +13 -14
  185. package/components/input/calendar/bundles/index.umd.js +615 -647
  186. package/components/input/calendar/fesm2022/index.mjs +596 -649
  187. package/components/input/calendar/fesm2022/index.mjs.map +1 -1
  188. package/components/input/calendar/types/index.d.ts +130 -131
  189. package/components/input/caption-position/bundles/index.umd.js +175 -188
  190. package/components/input/caption-position/fesm2022/index.mjs +159 -177
  191. package/components/input/caption-position/fesm2022/index.mjs.map +1 -1
  192. package/components/input/caption-position/types/index.d.ts +31 -34
  193. package/components/input/checkbox/bundles/index.umd.js +339 -200
  194. package/components/input/checkbox/fesm2022/index.mjs +319 -185
  195. package/components/input/checkbox/fesm2022/index.mjs.map +1 -1
  196. package/components/input/checkbox/types/index.d.ts +46 -41
  197. package/components/input/checkboxset/bundles/index.umd.js +256 -170
  198. package/components/input/checkboxset/fesm2022/index.mjs +242 -161
  199. package/components/input/checkboxset/fesm2022/index.mjs.map +1 -1
  200. package/components/input/checkboxset/types/index.d.ts +26 -27
  201. package/components/input/chips/bundles/index.umd.js +721 -733
  202. package/components/input/chips/fesm2022/index.mjs +706 -723
  203. package/components/input/chips/fesm2022/index.mjs.map +1 -1
  204. package/components/input/chips/types/index.d.ts +101 -90
  205. package/components/input/color-picker/bundles/index.umd.js +312 -137
  206. package/components/input/color-picker/fesm2022/index.mjs +296 -126
  207. package/components/input/color-picker/fesm2022/index.mjs.map +1 -1
  208. package/components/input/color-picker/types/index.d.ts +35 -36
  209. package/components/input/composite/bundles/index.umd.js +127 -112
  210. package/components/input/composite/fesm2022/index.mjs +106 -96
  211. package/components/input/composite/fesm2022/index.mjs.map +1 -1
  212. package/components/input/composite/types/index.d.ts +26 -27
  213. package/components/input/currency/bundles/index.umd.js +237 -104
  214. package/components/input/currency/fesm2022/index.mjs +219 -91
  215. package/components/input/currency/fesm2022/index.mjs.map +1 -1
  216. package/components/input/currency/types/index.d.ts +30 -31
  217. package/components/input/dataset-aware-form/bundles/index.umd.js +298 -346
  218. package/components/input/dataset-aware-form/fesm2022/index.mjs +286 -339
  219. package/components/input/dataset-aware-form/fesm2022/index.mjs.map +1 -1
  220. package/components/input/dataset-aware-form/types/index.d.ts +80 -80
  221. package/components/input/epoch/base-date-time/bundles/index.umd.js +809 -1081
  222. package/components/input/epoch/base-date-time/fesm2022/index.mjs +796 -1073
  223. package/components/input/epoch/base-date-time/fesm2022/index.mjs.map +1 -1
  224. package/components/input/epoch/base-date-time/types/index.d.ts +244 -247
  225. package/components/input/epoch/date/bundles/index.umd.js +619 -513
  226. package/components/input/epoch/date/fesm2022/index.mjs +604 -503
  227. package/components/input/epoch/date/fesm2022/index.mjs.map +1 -1
  228. package/components/input/epoch/date/types/index.d.ts +63 -64
  229. package/components/input/epoch/date-time/bundles/index.umd.js +682 -511
  230. package/components/input/epoch/date-time/fesm2022/index.mjs +672 -506
  231. package/components/input/epoch/date-time/fesm2022/index.mjs.map +1 -1
  232. package/components/input/epoch/date-time/types/index.d.ts +111 -112
  233. package/components/input/epoch/date-time-picker/bundles/index.umd.js +417 -321
  234. package/components/input/epoch/date-time-picker/fesm2022/index.mjs +405 -314
  235. package/components/input/epoch/date-time-picker/fesm2022/index.mjs.map +1 -1
  236. package/components/input/epoch/date-time-picker/types/index.d.ts +135 -80
  237. package/components/input/epoch/picker/bundles/index.umd.js +201 -148
  238. package/components/input/epoch/picker/fesm2022/index.mjs +183 -135
  239. package/components/input/epoch/picker/fesm2022/index.mjs.map +1 -1
  240. package/components/input/epoch/picker/types/index.d.ts +46 -38
  241. package/components/input/epoch/time/bundles/index.umd.js +534 -392
  242. package/components/input/epoch/time/fesm2022/index.mjs +523 -386
  243. package/components/input/epoch/time/fesm2022/index.mjs.map +1 -1
  244. package/components/input/epoch/time/types/index.d.ts +107 -108
  245. package/components/input/file-upload/bundles/index.umd.js +500 -477
  246. package/components/input/file-upload/fesm2022/index.mjs +484 -466
  247. package/components/input/file-upload/fesm2022/index.mjs.map +1 -1
  248. package/components/input/file-upload/types/index.d.ts +110 -109
  249. package/components/input/number/bundles/index.umd.js +241 -101
  250. package/components/input/number/fesm2022/index.mjs +224 -89
  251. package/components/input/number/fesm2022/index.mjs.map +1 -1
  252. package/components/input/number/types/index.d.ts +28 -29
  253. package/components/input/radioset/bundles/index.umd.js +240 -156
  254. package/components/input/radioset/fesm2022/index.mjs +226 -147
  255. package/components/input/radioset/fesm2022/index.mjs.map +1 -1
  256. package/components/input/radioset/types/index.d.ts +25 -26
  257. package/components/input/rating/bundles/index.umd.js +353 -266
  258. package/components/input/rating/fesm2022/index.mjs +337 -255
  259. package/components/input/rating/fesm2022/index.mjs.map +1 -1
  260. package/components/input/rating/types/index.d.ts +52 -53
  261. package/components/input/select/bundles/index.umd.js +295 -217
  262. package/components/input/select/fesm2022/index.mjs +280 -207
  263. package/components/input/select/fesm2022/index.mjs.map +1 -1
  264. package/components/input/select/types/index.d.ts +38 -39
  265. package/components/input/slider/bundles/index.umd.js +316 -197
  266. package/components/input/slider/fesm2022/index.mjs +297 -183
  267. package/components/input/slider/fesm2022/index.mjs.map +1 -1
  268. package/components/input/slider/types/index.d.ts +43 -44
  269. package/components/input/switch/bundles/index.umd.js +257 -219
  270. package/components/input/switch/fesm2022/index.mjs +243 -210
  271. package/components/input/switch/fesm2022/index.mjs.map +1 -1
  272. package/components/input/switch/types/index.d.ts +34 -35
  273. package/components/input/text/bundles/index.umd.js +1585 -1120
  274. package/components/input/text/fesm2022/index.mjs +1542 -1082
  275. package/components/input/text/fesm2022/index.mjs.map +1 -1
  276. package/components/input/text/types/index.d.ts +313 -310
  277. package/components/input/textarea/bundles/index.umd.js +224 -100
  278. package/components/input/textarea/fesm2022/index.mjs +207 -88
  279. package/components/input/textarea/fesm2022/index.mjs.map +1 -1
  280. package/components/input/textarea/types/index.d.ts +32 -33
  281. package/components/navigation/breadcrumb/bundles/index.umd.js +205 -131
  282. package/components/navigation/breadcrumb/fesm2022/index.mjs +188 -118
  283. package/components/navigation/breadcrumb/fesm2022/index.mjs.map +1 -1
  284. package/components/navigation/breadcrumb/types/index.d.ts +29 -28
  285. package/components/navigation/menu/bundles/index.umd.js +1461 -950
  286. package/components/navigation/menu/fesm2022/index.mjs +1416 -910
  287. package/components/navigation/menu/fesm2022/index.mjs.map +1 -1
  288. package/components/navigation/menu/types/index.d.ts +220 -193
  289. package/components/navigation/navbar/bundles/index.umd.js +172 -79
  290. package/components/navigation/navbar/fesm2022/index.mjs +155 -67
  291. package/components/navigation/navbar/fesm2022/index.mjs.map +1 -1
  292. package/components/navigation/navbar/types/index.d.ts +19 -20
  293. package/components/navigation/popover/bundles/index.umd.js +543 -519
  294. package/components/navigation/popover/fesm2022/index.mjs +524 -505
  295. package/components/navigation/popover/fesm2022/index.mjs.map +1 -1
  296. package/components/navigation/popover/types/index.d.ts +86 -86
  297. package/components/page/default/bundles/index.umd.js +634 -451
  298. package/components/page/default/fesm2022/index.mjs +600 -422
  299. package/components/page/default/fesm2022/index.mjs.map +1 -1
  300. package/components/page/default/types/index.d.ts +123 -119
  301. package/components/page/footer/bundles/index.umd.js +91 -63
  302. package/components/page/footer/fesm2022/index.mjs +71 -48
  303. package/components/page/footer/fesm2022/index.mjs.map +1 -1
  304. package/components/page/footer/types/index.d.ts +11 -12
  305. package/components/page/header/bundles/index.umd.js +96 -59
  306. package/components/page/header/fesm2022/index.mjs +76 -44
  307. package/components/page/header/fesm2022/index.mjs.map +1 -1
  308. package/components/page/header/types/index.d.ts +12 -13
  309. package/components/page/left-panel/bundles/index.umd.js +405 -407
  310. package/components/page/left-panel/fesm2022/index.mjs +386 -393
  311. package/components/page/left-panel/fesm2022/index.mjs.map +1 -1
  312. package/components/page/left-panel/types/index.d.ts +47 -40
  313. package/components/page/right-panel/bundles/index.umd.js +115 -78
  314. package/components/page/right-panel/fesm2022/index.mjs +96 -64
  315. package/components/page/right-panel/fesm2022/index.mjs.map +1 -1
  316. package/components/page/right-panel/types/index.d.ts +14 -13
  317. package/components/page/top-nav/bundles/index.umd.js +91 -60
  318. package/components/page/top-nav/fesm2022/index.mjs +73 -47
  319. package/components/page/top-nav/fesm2022/index.mjs.map +1 -1
  320. package/components/page/top-nav/types/index.d.ts +11 -12
  321. package/components/prefab/bundles/index.umd.js +253 -173
  322. package/components/prefab/fesm2022/index.mjs +233 -158
  323. package/components/prefab/fesm2022/index.mjs.map +1 -1
  324. package/components/prefab/types/index.d.ts +35 -33
  325. package/core/bundles/index.umd.js +4466 -5642
  326. package/core/fesm2022/index.mjs +3997 -5202
  327. package/core/fesm2022/index.mjs.map +1 -1
  328. package/core/types/index.d.ts +1785 -1808
  329. package/http/bundles/index.umd.js +339 -413
  330. package/http/fesm2022/index.mjs +323 -402
  331. package/http/fesm2022/index.mjs.map +1 -1
  332. package/http/types/index.d.ts +107 -112
  333. package/locales/moment/am-et.js +73 -0
  334. package/locales/moment/bm.js +2 -0
  335. package/locales/moment/ca.js +1 -1
  336. package/locales/moment/de-at.js +29 -1
  337. package/locales/moment/de-ch.js +29 -1
  338. package/locales/moment/de.js +29 -1
  339. package/locales/moment/hu.js +3 -3
  340. package/locales/moment/id.js +12 -1
  341. package/locales/moment/ka.js +1 -1
  342. package/locales/moment/mk.js +0 -1
  343. package/locales/moment/nl-be.js +1 -1
  344. package/locales/moment/pl.js +1 -1
  345. package/locales/moment/ps.js +188 -0
  346. package/locales/moment/pt-br.js +14 -6
  347. package/locales/moment/sv.js +1 -1
  348. package/locales/moment/sw.js +56 -14
  349. package/locales/moment/uk.js +5 -4
  350. package/locales/moment/uz-latn.js +1 -1
  351. package/locales/moment/uz.js +1 -1
  352. package/npm-shrinkwrap.json +2 -2
  353. package/oAuth/bundles/index.umd.js +326 -483
  354. package/oAuth/fesm2022/index.mjs +267 -429
  355. package/oAuth/fesm2022/index.mjs.map +1 -1
  356. package/oAuth/types/index.d.ts +22 -26
  357. package/package-lock.json +2 -2
  358. package/package.json +1 -1
  359. package/runtime/base/bundles/index.umd.js +6380 -6093
  360. package/runtime/base/fesm2022/index.mjs +6368 -6107
  361. package/runtime/base/fesm2022/index.mjs.map +1 -1
  362. package/runtime/base/types/index.d.ts +1336 -1359
  363. package/runtime/dynamic/bundles/index.umd.js +1215 -851
  364. package/runtime/dynamic/fesm2022/index.mjs +1253 -898
  365. package/runtime/dynamic/fesm2022/index.mjs.map +1 -1
  366. package/runtime/dynamic/types/index.d.ts +140 -128
  367. package/scripts/datatable/datatable.js +20 -30
  368. package/security/bundles/index.umd.js +297 -438
  369. package/security/fesm2022/index.mjs +282 -443
  370. package/security/fesm2022/index.mjs.map +1 -1
  371. package/security/types/index.d.ts +127 -130
  372. package/swipey/bundles/index.umd.js +57 -48
  373. package/swipey/fesm2022/index.mjs +55 -50
  374. package/swipey/fesm2022/index.mjs.map +1 -1
  375. package/swipey/types/index.d.ts +19 -21
  376. package/transpiler/bundles/index.umd.js +1174 -811
  377. package/transpiler/fesm2022/index.mjs +1109 -757
  378. package/transpiler/fesm2022/index.mjs.map +1 -1
  379. package/transpiler/types/index.d.ts +32 -36
  380. package/variables/bundles/index.umd.js +2226 -3245
  381. package/variables/fesm2022/index.mjs +2117 -3237
  382. package/variables/fesm2022/index.mjs.map +1 -1
  383. package/variables/types/index.d.ts +410 -393
  384. package/build-task/.npmignore +0 -2
  385. package/components/advanced/carousel/.npmignore +0 -2
  386. package/components/advanced/custom/.npmignore +0 -2
  387. package/components/advanced/login/.npmignore +0 -2
  388. package/components/advanced/marquee/.npmignore +0 -2
  389. package/components/base/.npmignore +0 -2
  390. package/components/basic/anchor/.npmignore +0 -2
  391. package/components/basic/audio/.npmignore +0 -2
  392. package/components/basic/html/.npmignore +0 -2
  393. package/components/basic/icon/.npmignore +0 -2
  394. package/components/basic/iframe/.npmignore +0 -2
  395. package/components/basic/label/.npmignore +0 -2
  396. package/components/basic/picture/.npmignore +0 -2
  397. package/components/basic/progress/progress-bar/.npmignore +0 -2
  398. package/components/basic/progress/progress-circle/.npmignore +0 -2
  399. package/components/basic/progress/progress-utils/.npmignore +0 -2
  400. package/components/basic/rich-text-editor/.npmignore +0 -2
  401. package/components/basic/search/.npmignore +0 -2
  402. package/components/basic/spinner/.npmignore +0 -2
  403. package/components/basic/tree/.npmignore +0 -2
  404. package/components/basic/video/.npmignore +0 -2
  405. package/components/chart/.npmignore +0 -2
  406. package/components/containers/accordion/.npmignore +0 -2
  407. package/components/containers/layout-grid/.npmignore +0 -2
  408. package/components/containers/linear-layout/.npmignore +0 -2
  409. package/components/containers/panel/.npmignore +0 -2
  410. package/components/containers/tabs/.npmignore +0 -2
  411. package/components/containers/tile/.npmignore +0 -2
  412. package/components/containers/wizard/.npmignore +0 -2
  413. package/components/data/card/.npmignore +0 -2
  414. package/components/data/form/.npmignore +0 -2
  415. package/components/data/list/.npmignore +0 -2
  416. package/components/data/live-table/.npmignore +0 -2
  417. package/components/data/pagination/.npmignore +0 -2
  418. package/components/data/table/.npmignore +0 -2
  419. package/components/dialogs/alert-dialog/.npmignore +0 -2
  420. package/components/dialogs/confirm-dialog/.npmignore +0 -2
  421. package/components/dialogs/default/.npmignore +0 -2
  422. package/components/dialogs/design-dialog/.npmignore +0 -2
  423. package/components/dialogs/iframe-dialog/.npmignore +0 -2
  424. package/components/dialogs/login-dialog/.npmignore +0 -2
  425. package/components/dialogs/partial-dialog/.npmignore +0 -2
  426. package/components/input/base-form/.npmignore +0 -2
  427. package/components/input/base-form-custom/.npmignore +0 -2
  428. package/components/input/button/.npmignore +0 -2
  429. package/components/input/button-group/.npmignore +0 -2
  430. package/components/input/calendar/.npmignore +0 -2
  431. package/components/input/caption-position/.npmignore +0 -2
  432. package/components/input/checkbox/.npmignore +0 -2
  433. package/components/input/checkboxset/.npmignore +0 -2
  434. package/components/input/chips/.npmignore +0 -2
  435. package/components/input/color-picker/.npmignore +0 -2
  436. package/components/input/composite/.npmignore +0 -2
  437. package/components/input/currency/.npmignore +0 -2
  438. package/components/input/dataset-aware-form/.npmignore +0 -2
  439. package/components/input/epoch/base-date-time/.npmignore +0 -2
  440. package/components/input/epoch/date/.npmignore +0 -2
  441. package/components/input/epoch/date-time/.npmignore +0 -2
  442. package/components/input/epoch/date-time-picker/.npmignore +0 -2
  443. package/components/input/epoch/picker/.npmignore +0 -2
  444. package/components/input/epoch/time/.npmignore +0 -2
  445. package/components/input/file-upload/.npmignore +0 -2
  446. package/components/input/number/.npmignore +0 -2
  447. package/components/input/radioset/.npmignore +0 -2
  448. package/components/input/rating/.npmignore +0 -2
  449. package/components/input/select/.npmignore +0 -2
  450. package/components/input/slider/.npmignore +0 -2
  451. package/components/input/switch/.npmignore +0 -2
  452. package/components/input/text/.npmignore +0 -2
  453. package/components/input/textarea/.npmignore +0 -2
  454. package/components/navigation/breadcrumb/.npmignore +0 -2
  455. package/components/navigation/menu/.npmignore +0 -2
  456. package/components/navigation/navbar/.npmignore +0 -2
  457. package/components/navigation/popover/.npmignore +0 -2
  458. package/components/page/default/.npmignore +0 -2
  459. package/components/page/footer/.npmignore +0 -2
  460. package/components/page/header/.npmignore +0 -2
  461. package/components/page/left-panel/.npmignore +0 -2
  462. package/components/page/right-panel/.npmignore +0 -2
  463. package/components/page/top-nav/.npmignore +0 -2
  464. package/components/prefab/.npmignore +0 -2
  465. package/core/.npmignore +0 -2
  466. package/http/.npmignore +0 -2
  467. package/oAuth/.npmignore +0 -2
  468. package/runtime/base/.npmignore +0 -2
  469. package/runtime/dynamic/.npmignore +0 -2
  470. package/security/.npmignore +0 -2
  471. package/swipey/.npmignore +0 -2
  472. package/transpiler/.npmignore +0 -2
  473. package/variables/.npmignore +0 -2
@@ -1,1087 +1,1121 @@
1
- import * as i2 from '@angular/common';
2
- import { CommonModule } from '@angular/common';
3
- import * as i3 from '@angular/forms';
4
- import { FormsModule, NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
5
- import * as i0 from '@angular/core';
6
- import { inject, ElementRef, Directive, ViewChildren, ViewChild, Attribute, Inject, Optional, Component } from '@angular/core';
7
- import { Observable, of, from } from 'rxjs';
8
- import { filter as filter$1, mergeMap } from 'rxjs/operators';
9
- import * as i4 from 'ngx-bootstrap/typeahead';
10
- import { TypeaheadModule, TypeaheadDirective } from 'ngx-bootstrap/typeahead';
11
- import * as i1 from '@wm/core';
12
- import { FormWidgetType, DataSource, getClonedObject, AppConstants, findValueOf, isDefined, addClass, isMobile, adjustContainerPosition, toBoolean } from '@wm/core';
13
- import { PROP_BOOLEAN, PROP_STRING, PROP_ANY, PROP_NUMBER, register, registerFormWidget, interpolateBindExpressions, ALLFIELDS, extractDataAsArray, convertDataToObject, transformFormData, getUniqObjsByDataField, styler, getContainerTargetClass, TextContentDirective, ItemTemplateDirective, PartialParamHandlerDirective, PartialContainerDirective, WmAppIconComponent, provideAs, provideAsWidgetRef } from '@wm/components/base';
14
- import { DatasetAwareFormComponent } from '@wm/components/input/dataset-aware-form';
15
- import { isNumber, includes, startsWith, endsWith, isEqual, split, filter, get, toLower, toString, isArray, isObject, values, assign, set, isEmpty, slice, indexOf, trim, debounce, isUndefined, find, map } from 'lodash-es';
16
-
17
- class ScrollableDirective {
18
- constructor(inj) {
19
- this.searchRef = inject(SearchComponent);
20
- this.elementRef = inj.get(ElementRef);
21
- }
22
- ngAfterContentInit() {
23
- // MEMORY LEAK FIX: Store bound function reference for proper removal
24
- this.boundNotifyParent = this.notifyParent.bind(this);
25
- // add the scroll event listener on the ul element.
26
- this.elementRef.nativeElement.addEventListener('scroll', this.boundNotifyParent);
27
- this.searchRef.dropdownEl = $(this.elementRef.nativeElement);
28
- this.searchRef.onDropdownOpen();
29
- }
30
- ngAfterViewInit() {
31
- if (!this.searchRef.isMobileAutoComplete()) {
32
- // assigning width for the dropdown.
33
- const typeAheadInput = this.searchRef.$element.find('input').first();
34
- this.searchRef.dropdownEl.width(typeAheadInput.outerWidth());
35
- }
36
- }
37
- notifyParent(evt) {
38
- this.searchRef.onScroll(this.elementRef.nativeElement, evt);
39
- }
40
- ngOnDestroy() {
41
- // MEMORY LEAK FIX: Remove scroll event listener using stored bound function reference
42
- if (this.elementRef?.nativeElement && this.boundNotifyParent) {
43
- this.elementRef.nativeElement.removeEventListener('scroll', this.boundNotifyParent);
44
- this.boundNotifyParent = null;
45
- }
46
- }
47
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0, type: ScrollableDirective, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive }); }
48
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.21", type: ScrollableDirective, isStandalone: true, selector: "[scrollableHandler]", ngImport: i0 }); }
49
- }
50
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0, type: ScrollableDirective, decorators: [{
51
- type: Directive,
52
- args: [{
53
- standalone: true,
54
- selector: '[scrollableHandler]'
55
- }]
56
- }], ctorParameters: () => [{ type: i0.Injector }] });
57
-
58
- const searchProps = new Map([
59
- ['casesensitive', { value: false, ...PROP_BOOLEAN }],
60
- ['class', PROP_STRING],
61
- ['datacompletemsg', { value: 'No more data to load', ...PROP_STRING }],
62
- ['datafield', { value: 'All Fields', ...PROP_STRING }],
63
- ['dataoptions', PROP_ANY],
64
- ['dataset', PROP_ANY],
65
- ['datasource', PROP_ANY],
66
- ['datavalue', PROP_STRING],
67
- ['datavaluesource', PROP_ANY],
68
- ['dateformat', PROP_STRING],
69
- ['disabled', PROP_BOOLEAN],
70
- ['displayimagesrc', PROP_STRING],
71
- ['displaylabel', PROP_STRING],
72
- ['displayexpression', PROP_STRING],
73
- ['dropup', PROP_BOOLEAN],
74
- ['groupby', PROP_STRING],
75
- ['hint', PROP_STRING],
76
- ['arialabel', PROP_STRING],
77
- ['imagewidth', { value: '16px', ...PROP_STRING }],
78
- ['limit', PROP_NUMBER],
79
- ['loadingdatamsg', { value: 'Loading items...', ...PROP_STRING }],
80
- ['match', PROP_STRING],
81
- ['matchmode', PROP_STRING],
82
- ['minchars', PROP_NUMBER],
83
- ['name', PROP_STRING],
84
- ['navsearchbar', { value: false, ...PROP_BOOLEAN }],
85
- ['orderby', PROP_STRING],
86
- ['placeholder', { value: 'Search', ...PROP_STRING }],
87
- ['position', PROP_STRING],
88
- ['query', PROP_STRING],
89
- ['readonly', PROP_BOOLEAN],
90
- ['required', PROP_BOOLEAN],
91
- ['searchkey', PROP_STRING],
92
- ['searchon', { value: 'typing', ...PROP_STRING }],
93
- ['shortcutkey', PROP_STRING],
94
- ['show', { value: true, ...PROP_BOOLEAN }],
95
- ['showclear', { value: false, ...PROP_BOOLEAN }],
96
- ['showsearchicon', PROP_BOOLEAN],
97
- ['tabindex', { value: 0, ...PROP_NUMBER }],
98
- ['type', { value: 'search', ...PROP_STRING }],
99
- ['debouncetime', { value: 250, ...PROP_NUMBER }],
100
- ['width', PROP_STRING],
101
- ['clearsearchiconclass', { value: 'wi wi-close', ...PROP_STRING }],
102
- ['backsearchiconclass', { value: 'wi wi-arrow-left', ...PROP_STRING }],
103
- ['searchiconclass', { value: 'wm-sl-l sl-search', ...PROP_STRING }],
104
- ['clearsearchiconurl', PROP_STRING],
105
- ['backsearchiconurl', PROP_STRING],
106
- ['searchiconurl', PROP_STRING],
1
+ import * as i2 from "@angular/common";
2
+ import { CommonModule } from "@angular/common";
3
+ import * as i3 from "@angular/forms";
4
+ import { FormsModule, NG_VALIDATORS, NG_VALUE_ACCESSOR } from "@angular/forms";
5
+ import * as i0 from "@angular/core";
6
+ import { Attribute, ChangeDetectionStrategy, Component, Directive, ElementRef, Inject, Optional, ViewChild, ViewChildren, inject } from "@angular/core";
7
+ import { Observable, from, of } from "rxjs";
8
+ import { filter, mergeMap } from "rxjs/operators";
9
+ import * as i4 from "ngx-bootstrap/typeahead";
10
+ import { TypeaheadDirective, TypeaheadModule } from "ngx-bootstrap/typeahead";
11
+ import * as i1 from "@wm/core";
12
+ import { AppConstants, DataSource, FormWidgetType, addClass, adjustContainerPosition, findValueOf, getClonedObject, isDefined, isMobile, toBoolean } from "@wm/core";
13
+ import { ALLFIELDS, ItemTemplateDirective, PROP_ANY, PROP_BOOLEAN, PROP_NUMBER, PROP_STRING, PartialContainerDirective, PartialParamHandlerDirective, TextContentDirective, WmAppIconComponent, convertDataToObject, extractDataAsArray, getContainerTargetClass, getUniqObjsByDataField, interpolateBindExpressions, provideAs, provideAsWidgetRef, register, registerFormWidget, styler, transformFormData } from "@wm/components/base";
14
+ import { DatasetAwareFormComponent } from "@wm/components/input/dataset-aware-form";
15
+ import { assign, debounce, endsWith, filter as filter$1, find, get, includes, indexOf, isArray, isEmpty, isEqual, isNumber, isObject, isUndefined, map, set, slice, split, startsWith, toLower, toString, trim, values } from "lodash-es";
16
+ var ScrollableDirective = class ScrollableDirective {
17
+ constructor(inj) {
18
+ this.searchRef = inject(SearchComponent);
19
+ this.elementRef = inj.get(ElementRef);
20
+ }
21
+ ngAfterContentInit() {
22
+ this.boundNotifyParent = this.notifyParent.bind(this);
23
+ this.elementRef.nativeElement.addEventListener("scroll", this.boundNotifyParent);
24
+ this.searchRef.dropdownEl = $(this.elementRef.nativeElement);
25
+ this.searchRef.onDropdownOpen();
26
+ }
27
+ ngAfterViewInit() {
28
+ if (!this.searchRef.isMobileAutoComplete()) {
29
+ const typeAheadInput = this.searchRef.$element.find("input").first();
30
+ this.searchRef.dropdownEl.width(typeAheadInput.outerWidth());
31
+ }
32
+ }
33
+ notifyParent(evt) {
34
+ this.searchRef.onScroll(this.elementRef.nativeElement, evt);
35
+ }
36
+ ngOnDestroy() {
37
+ if (this.elementRef?.nativeElement && this.boundNotifyParent) {
38
+ this.elementRef.nativeElement.removeEventListener("scroll", this.boundNotifyParent);
39
+ this.boundNotifyParent = null;
40
+ }
41
+ }
42
+ static {
43
+ this.ɵfac = i0.ɵɵngDeclareFactory({
44
+ minVersion: "12.0.0",
45
+ version: "22.2.1",
46
+ ngImport: i0,
47
+ type: ScrollableDirective,
48
+ deps: [{ token: i0.Injector }],
49
+ target: i0.ɵɵFactoryTarget.Directive
50
+ });
51
+ }
52
+ static {
53
+ this.ɵdir = i0.ɵɵngDeclareDirective({
54
+ minVersion: "14.0.0",
55
+ version: "22.2.1",
56
+ type: ScrollableDirective,
57
+ isStandalone: true,
58
+ selector: "[scrollableHandler]",
59
+ ngImport: i0
60
+ });
61
+ }
62
+ };
63
+ i0.ɵɵngDeclareClassMetadata({
64
+ minVersion: "12.0.0",
65
+ version: "22.2.1",
66
+ ngImport: i0,
67
+ type: ScrollableDirective,
68
+ decorators: [{
69
+ type: Directive,
70
+ args: [{
71
+ standalone: true,
72
+ selector: "[scrollableHandler]"
73
+ }]
74
+ }],
75
+ ctorParameters: () => [{ type: i0.Injector }]
76
+ });
77
+ const searchProps = /* @__PURE__ */ new Map([
78
+ ["casesensitive", {
79
+ value: false,
80
+ ...PROP_BOOLEAN
81
+ }],
82
+ ["class", PROP_STRING],
83
+ ["datacompletemsg", {
84
+ value: "No more data to load",
85
+ ...PROP_STRING
86
+ }],
87
+ ["datafield", {
88
+ value: "All Fields",
89
+ ...PROP_STRING
90
+ }],
91
+ ["dataoptions", PROP_ANY],
92
+ ["dataset", PROP_ANY],
93
+ ["datasource", PROP_ANY],
94
+ ["datavalue", PROP_STRING],
95
+ ["datavaluesource", PROP_ANY],
96
+ ["dateformat", PROP_STRING],
97
+ ["disabled", PROP_BOOLEAN],
98
+ ["displayimagesrc", PROP_STRING],
99
+ ["displaylabel", PROP_STRING],
100
+ ["displayexpression", PROP_STRING],
101
+ ["dropup", PROP_BOOLEAN],
102
+ ["groupby", PROP_STRING],
103
+ ["hint", PROP_STRING],
104
+ ["arialabel", PROP_STRING],
105
+ ["imagewidth", {
106
+ value: "16px",
107
+ ...PROP_STRING
108
+ }],
109
+ ["limit", PROP_NUMBER],
110
+ ["loadingdatamsg", {
111
+ value: "Loading items...",
112
+ ...PROP_STRING
113
+ }],
114
+ ["match", PROP_STRING],
115
+ ["matchmode", PROP_STRING],
116
+ ["minchars", PROP_NUMBER],
117
+ ["name", PROP_STRING],
118
+ ["navsearchbar", {
119
+ value: false,
120
+ ...PROP_BOOLEAN
121
+ }],
122
+ ["orderby", PROP_STRING],
123
+ ["placeholder", {
124
+ value: "Search",
125
+ ...PROP_STRING
126
+ }],
127
+ ["position", PROP_STRING],
128
+ ["query", PROP_STRING],
129
+ ["readonly", PROP_BOOLEAN],
130
+ ["required", PROP_BOOLEAN],
131
+ ["searchkey", PROP_STRING],
132
+ ["searchon", {
133
+ value: "typing",
134
+ ...PROP_STRING
135
+ }],
136
+ ["shortcutkey", PROP_STRING],
137
+ ["show", {
138
+ value: true,
139
+ ...PROP_BOOLEAN
140
+ }],
141
+ ["showclear", {
142
+ value: false,
143
+ ...PROP_BOOLEAN
144
+ }],
145
+ ["showsearchicon", PROP_BOOLEAN],
146
+ ["tabindex", {
147
+ value: 0,
148
+ ...PROP_NUMBER
149
+ }],
150
+ ["type", {
151
+ value: "search",
152
+ ...PROP_STRING
153
+ }],
154
+ ["debouncetime", {
155
+ value: 250,
156
+ ...PROP_NUMBER
157
+ }],
158
+ ["width", PROP_STRING],
159
+ ["clearsearchiconclass", {
160
+ value: "wi wi-close",
161
+ ...PROP_STRING
162
+ }],
163
+ ["backsearchiconclass", {
164
+ value: "wi wi-arrow-left",
165
+ ...PROP_STRING
166
+ }],
167
+ ["searchiconclass", {
168
+ value: "wm-sl-l sl-search",
169
+ ...PROP_STRING
170
+ }],
171
+ ["clearsearchiconurl", PROP_STRING],
172
+ ["backsearchiconurl", PROP_STRING],
173
+ ["searchiconurl", PROP_STRING]
107
174
  ]);
108
175
  const registerProps = () => {
109
- register('wm-search', searchProps);
110
- registerFormWidget(FormWidgetType.AUTOCOMPLETE, new Map(searchProps));
111
- registerFormWidget(FormWidgetType.TYPEAHEAD, new Map(searchProps));
176
+ register("wm-search", searchProps);
177
+ registerFormWidget(FormWidgetType.AUTOCOMPLETE, new Map(searchProps));
178
+ registerFormWidget(FormWidgetType.TYPEAHEAD, new Map(searchProps));
112
179
  };
113
-
114
- class LocalDataProvider {
115
- applyFilter(entry, queryText, filtername) {
116
- entry = isNumber(entry) ? entry.toString() : entry;
117
- if (includes(filtername, 'start')) {
118
- return startsWith(entry, queryText);
119
- }
120
- else if (includes(filtername, 'end')) {
121
- return endsWith(entry, queryText);
122
- }
123
- else if (includes(filtername, 'exact')) {
124
- return isEqual(entry, queryText);
125
- }
126
- return includes(entry, queryText);
127
- }
128
- // LocalData filtering is done based on the searchkey.
129
- filter(config) {
130
- const entries = config.dataset;
131
- let casesensitive = config.casesensitive;
132
- const matchMode = config.matchMode;
133
- // for supporting existing projects
134
- if (matchMode && !includes(matchMode, 'ignorecase')) {
135
- casesensitive = true;
136
- }
137
- let queryText = config.query, filteredData;
138
- return new Promise((resolve, reject) => {
139
- /**
140
- * If searchKey is defined, then check for match string against each item in the dataset with item's field name as the searchKey
141
- * return the filtered data containing the matching string.
142
- */
143
- if (config.searchKey) {
144
- const keys = split(config.searchKey, ',');
145
- filteredData = filter(config.dataset, (item) => {
146
- return keys.some(key => {
147
- let a = get(item, key), b = queryText;
148
- if (!casesensitive) {
149
- a = toLower(toString(a));
150
- b = toLower(toString(b));
151
- }
152
- return this.applyFilter(a, b, matchMode);
153
- });
154
- });
155
- }
156
- else
157
- // local search on data with array of objects.
158
- // Iterate over each item and return the filtered data containing the matching string.
159
- if (isArray(entries) && isObject(entries[0])) {
160
- filteredData = filter(entries, entry => {
161
- let a = values(entry).join(' ');
162
- if (!casesensitive) {
163
- a = toLower(a);
164
- // @ts-ignore
165
- queryText = toLower(queryText);
166
- }
167
- return this.applyFilter(a, queryText);
168
- });
169
- }
170
- else {
171
- filteredData = filter(entries, entry => {
172
- if (!casesensitive) {
173
- entry = toLower(entry);
174
- // @ts-ignore
175
- queryText = toLower(queryText);
176
- }
177
- return this.applyFilter(entry, queryText, matchMode);
178
- });
179
- }
180
- resolve({
181
- data: filteredData,
182
- hasMoreData: false,
183
- isLastPage: true
184
- });
185
- });
186
- }
187
- }
188
-
189
- class RemoteDataProvider {
190
- filter(config) {
191
- return this.filterData(config).then(response => this.onFilterSuccess(config, response), () => this.onFilterFailure());
192
- }
193
- filterData(config) {
194
- if (config.dataoptions) {
195
- const dataoptions = config.dataoptions;
196
- const requestParams = config.datasource.execute(DataSource.Operation.GET_REQUEST_PARAMS, config);
197
- // If options are specified, make specifics calls to fetch the results
198
- // Fetch the related field data
199
- if (dataoptions.relatedField) {
200
- return new Promise((resolve, reject) => {
201
- interpolateBindExpressions(config.viewParent, dataoptions.filterExpr, (filterexpressions) => {
202
- requestParams.filterExpr = dataoptions.filterExpr = filterexpressions;
203
- dataoptions.filterExpr = filterexpressions;
204
- config.datasource.execute(DataSource.Operation.GET_RELATED_TABLE_DATA, assign({ relatedField: dataoptions.relatedField }, requestParams)).then(resolve, reject);
205
- });
206
- });
207
- }
208
- // Fetch the distinct data
209
- if (dataoptions.distinctField) {
210
- return config.datasource.execute(DataSource.Operation.GET_DISTINCT_DATA_BY_FIELDS, {
211
- pagesize: config.limit || config.pagesize,
212
- page: config.page,
213
- fields: dataoptions.distinctField,
214
- entityName: dataoptions.tableName,
215
- filterFields: assign(dataoptions.filterFields, requestParams.filterFields),
216
- filterExpr: getClonedObject(dataoptions.filterExpr || {})
217
- });
218
- }
219
- }
220
- // search records using the searchkey
221
- return config.datasource.execute(DataSource.Operation.SEARCH_RECORDS, config);
222
- }
223
- // Check if the page retrieved currently is the last page. If last page, don't send any more request
224
- isLast(page, dataSize, maxResults, currentResults) {
225
- // if last page info is not returned by backend and current results is less than max results, this is the last page
226
- if (dataSize === AppConstants.INT_MAX_VALUE) {
227
- return currentResults !== 0 && currentResults < maxResults;
228
- }
229
- const pageCount = ((dataSize > maxResults) ? (Math.ceil(dataSize / maxResults)) : (dataSize < 0 ? 0 : 1));
230
- return page === pageCount;
231
- }
232
- // this function transform the response data in case it is not an array
233
- getTransformedData(variable, data) {
234
- const operationResult = variable.operation + 'Result'; // when output is only string it is available as oprationNameResult
235
- const tempResponse = data[operationResult];
236
- // in case data received is value as string then add that string value to object and convert object into array
237
- if (tempResponse) {
238
- const tempObj = {};
239
- set(tempObj, operationResult, tempResponse);
240
- data = [tempObj]; // convert data into an array having tempObj
241
- }
242
- else {
243
- // in case data received is already an object then convert it into an array
244
- data = [data];
245
- }
246
- return data;
247
- }
248
- onFilterFailure() {
249
- return [];
250
- }
251
- isLastPageForDistinctApi(data, page, totalElements, _isLastPage) {
252
- return page > 1 && !_isLastPage && isEmpty(data) && totalElements === AppConstants.INT_MAX_VALUE;
253
- }
254
- // this function processes the response depending on pageOptions, isPageable and prepares the formattedDataset.
255
- onFilterSuccess(config, response) {
256
- let data = response.data;
257
- let formattedData;
258
- let _isLastPage;
259
- let page;
260
- let isPaginatedData;
261
- const expressionArray = split(config.binddataset, '.');
262
- const dataExpression = slice(expressionArray, indexOf(expressionArray, 'dataSet') + 1).join('.');
263
- const $I = '[$i]';
264
- return new Promise((resolve, reject) => {
265
- const pageOptions = response.pagination;
266
- if (config.datasource.execute(DataSource.Operation.IS_PAGEABLE)) {
267
- page = pageOptions.number + 1;
268
- _isLastPage = this.isLast(page, (config.limit > 0 && config.limit) || pageOptions.totalElements, pageOptions.size, pageOptions.numberOfElements);
269
- isPaginatedData = true;
270
- if (this.isLastPageForDistinctApi(data, page, pageOptions.totalElements, _isLastPage)) {
271
- _isLastPage = true;
272
- resolve({
273
- data: [],
274
- isLastPage: _isLastPage,
275
- hasMoreData: page > 1,
276
- isPaginatedData,
277
- page
278
- });
279
- return;
280
- }
281
- }
282
- // if data expression exists, extract the data from the expression path
283
- if (dataExpression) {
284
- if (isArray(data)) {
285
- const index = dataExpression.lastIndexOf($I);
286
- if (index > -1) {
287
- const restExpr = dataExpression.substr(index + 5);
288
- formattedData = data.map(datum => findValueOf(datum, restExpr));
289
- }
290
- }
291
- else if (isObject(data)) {
292
- formattedData = get(data, dataExpression);
293
- }
294
- data = formattedData || data;
295
- }
296
- if (!isArray(data)) {
297
- data = this.getTransformedData(config.datasource, data);
298
- }
299
- // in case of no data received, resolve the promise with empty array
300
- if (!data.length) {
301
- resolve({ data: [], isLastPage: _isLastPage, hasMoreData: page > 1, isPaginatedData, page });
302
- }
303
- else {
304
- resolve({ data: data, isLastPage: _isLastPage, hasMoreData: page > 1, isPaginatedData, page });
305
- }
306
- });
307
- }
308
- }
309
-
310
- class DataProvider {
311
- static { this.remoteDataProvider = new RemoteDataProvider(); }
312
- static { this.localDataProvider = new LocalDataProvider(); }
313
- filter(config) {
314
- let promise;
315
- /**
316
- * Make call to remoteDataProvider when searchkey is available and data is not from local / model variable.
317
- * Otherwise use localDataProvider
318
- * If datasource is a serviceVariable with no input params, then perform local search.
319
- * when there is no dataset on the datasource when first time make a remote call to set the dataset for service variable.
320
- */
321
- const hasNoVariableDataset = config.datasource?.execute(DataSource.Operation.IS_UPDATE_REQUIRED, config.hasData);
322
- if (!config.isLocalFilter && (config.dataoptions || ((config.datasource?.execute(DataSource.Operation.IS_API_AWARE))
323
- && config.searchKey
324
- && hasNoVariableDataset))) {
325
- promise = DataProvider.remoteDataProvider.filter(config);
326
- }
327
- else {
328
- promise = DataProvider.localDataProvider.filter(config);
329
- }
330
- return promise.then(response => {
331
- this.updateDataset = config.datasource && !config.datasource.execute(DataSource.Operation.SUPPORTS_CRUD) && hasNoVariableDataset;
332
- this.hasMoreData = response.hasMoreData;
333
- this.isLastPage = response.isLastPage;
334
- this.page = response.page;
335
- this.isPaginatedData = response.isPaginatedData;
336
- return response;
337
- });
338
- }
339
- }
340
-
341
- const WIDGET_CONFIG = { widgetType: 'wm-search', hostClass: 'input-group' };
342
- class SearchComponent extends DatasetAwareFormComponent {
343
- static { this.initializeProps = registerProps(); }
344
- get typeaheadOptionsLimit() {
345
- return isDefined(this.limit) ? this.limit : this._dynamicTypeaheadOptionsLimit;
346
- }
347
- // getter setter is added to pass the datasource to searchcomponent.
348
- get datasource() {
349
- return this._datasource;
350
- }
351
- set datasource(nv) {
352
- this._datasource = nv;
353
- const data = this.datavalue || this.toBeProcessedDatavalue;
354
- this.updateByDatavalue(data);
355
- }
356
- constructor(inj, app, binddatavalue, binddataset, explicitContext) {
357
- super(inj, WIDGET_CONFIG, explicitContext);
358
- this.binddatavalue = binddatavalue;
359
- this.binddataset = binddataset;
360
- this.query = '';
361
- this.page = 1;
362
- // this flag will not allow the empty datafield values.
363
- this.allowempty = false;
364
- this.app = app;
365
- addClass(this.nativeElement, 'app-search', true);
366
- /**
367
- * Listens for the change in the ngModel on every search and retrieves the data as observable.
368
- * This observable data is passed to the typeahead.
369
- * @type {Observable<any>}
370
- */
371
- this.typeaheadDataSource = Observable
372
- .create((observer) => {
373
- // Runs on every search
374
- if (this.listenQuery) {
375
- this._defaultQueryInvoked = false;
376
- this._loadingItems = true;
377
- observer.next(this.query);
378
- }
379
- // on keydown, while scrolling the dropdown items, when last item is reached next call is triggered
380
- // unless the call is resolved, we are able to scroll next to first item and soon
381
- // This shows flickering from first item to next new items appended.
382
- // By setting container to undefined, key events changes will be stopped while loading items
383
- if (this.lastSelectedIndex) {
384
- this.typeahead._container = undefined;
385
- }
386
- }).pipe(filter$1(() => {
387
- this._loadingItems = false;
388
- return (this.minchars === 0 || (this.query && this.query.length >= this.minchars));
389
- }), mergeMap((token) => this.getDataSourceAsObservable(token)));
390
- this.dataProvider = new DataProvider();
391
- /**
392
- * When default datavalue is not found within the dataset, a filter call is made to get the record using fetchDefaultModel.
393
- * after getting the response, set the queryModel and query.
394
- */
395
- const datavalueSubscription = this.datavalue$.subscribe((val) => {
396
- const query = (isArray(val) ? val[0] : val);
397
- if (query === null || query === '') {
398
- this._modelByValue = '';
399
- // reset the query.
400
- this.query = this.queryModel = '';
401
- // on clear or reset filter, empty the lastResults to fetch new records.
402
- this._lastResult = undefined;
403
- return;
404
- }
405
- if (!this._unsubscribeDv) {
406
- this._defaultQueryInvoked = false;
407
- // if prev datavalue is not equal to current datavalue then clear the modelByKey and queryModel
408
- if (!isObject(val) && this.prevDatavalue !== val) {
409
- this._modelByKey = undefined;
410
- this.query = this.queryModel = '';
411
- }
412
- // if the datafield is ALLFILEDS do not fetch the records
413
- // update the query model with the values we have
414
- this.updateByDatavalue(val);
415
- }
416
- // turn on showCloseBtn when a default value is given
417
- this.showClosebtn = (this.query !== '');
418
- });
419
- this.registerDestroyListener(() => datavalueSubscription.unsubscribe());
420
- const datasetSubscription = this.dataset$.subscribe(() => {
421
- // set the next item index.
422
- this.startIndex = this.datasetItems.length;
423
- this._lastResult = undefined;
424
- const defaultValue = this.datavalue || this.toBeProcessedDatavalue;
425
- // invoking updateByDataset only when datavalue is present, as entered value i.e. query is setting back to ''
426
- if (isDefined(defaultValue)) {
427
- this.updateByDataset(defaultValue);
428
- }
429
- });
430
- this.registerDestroyListener(() => datasetSubscription.unsubscribe());
431
- }
432
- // on clear, trigger search with page size 1
433
- clearSearch($event, loadOnClear) {
434
- this.query = '';
435
- this.onInputChange($event);
436
- if (this.dataProvider) {
437
- this.dataProvider.isLastPage = false;
438
- }
439
- this.listenQuery = false;
440
- if (loadOnClear) {
441
- this.listenQuery = true;
442
- this._unsubscribeDv = false;
443
- this.loadMoreData();
444
- }
445
- this.invokeEventCallback('clearsearch');
446
- this._loadingItems = false;
447
- // when search input is cleared, focus on the input field
448
- if ($event) {
449
- this.$element.find('.app-search-input').focus();
450
- }
451
- }
452
- // function to clear the input value
453
- clearText() {
454
- this.query = '';
455
- this.showClosebtn = false;
456
- }
457
- // Close the full screen mode in mobile view of auto complete
458
- closeSearch() {
459
- this._loadingItems = false;
460
- this.page = 1;
461
- // after closing the search, insert the element at its previous position (elIndex)
462
- this.insertAtIndex(this.elIndex);
463
- this.elIndex = undefined;
464
- this.parentEl = undefined;
465
- this.$element.removeClass('full-screen');
466
- if (this._domUpdated) {
467
- this._domUpdated = false;
468
- }
469
- this.listenQuery = false;
470
- this._unsubscribeDv = true;
471
- this.typeahead.hide();
472
- }
473
- renderMobileAutoComplete() {
474
- // Get the parent element of the search element which can be next or prev element, if both are empty then get the parent of element.
475
- if (!isDefined(this.elIndex)) {
476
- this.parentEl = this.$element.parent();
477
- this.elIndex = this.parentEl.children().index(this.$element);
478
- }
479
- if (!this.$element.hasClass('full-screen')) {
480
- // this flag is set to notify that the typeahead-container dom has changed its position
481
- this._domUpdated = true;
482
- // Add full screen class on focus of the input element.
483
- this.$element.addClass('full-screen');
484
- // Add position to set the height to auto
485
- if (this.position === 'inline') {
486
- this.$element.addClass(this.position);
487
- }
488
- }
489
- // focus is lost when element is changed to full-screen, keydown to select next items will not work
490
- // Hence explicitly focusing the input
491
- if (this.$element.hasClass('full-screen')) {
492
- this.$element.find('.app-search-input').focus();
493
- }
494
- }
495
- getDataSourceAsObservable(query) {
496
- // show dropdown only when there is change in query. This should not apply when dataoptions with filterFields are updated.
497
- // when lastResult is not available i.e. still the first call is pending and second query is invoked then do not return.
498
- if (this._lastQuery === query && !get(this.dataoptions, 'filterFields') && isDefined(this._lastResult)) {
499
- this._loadingItems = false;
500
- return of(this._lastResult);
501
- }
502
- /*
503
- WMS-19177: On focus of input field for autocomplete type, do not trigger api call when
504
- a) searchkey and displayexpression are different
505
- b) binddisplaylabel contains multiple values
506
- c) binddisplaylabel contains single value which does not match with searchkey
507
- */
508
- if (this.type === 'autocomplete' && this.searchkey && this.query && this.datavalue) {
509
- let bindDisplayLabelArray = [];
510
- const searchKeyArray = split(this.searchkey, ',');
511
- let displaylabel;
512
- if (this.binddisplaylabel) {
513
- bindDisplayLabelArray = split(this.binddisplaylabel, '+');
514
- if (bindDisplayLabelArray.length === 1) {
515
- if (!includes(bindDisplayLabelArray[0], '|')) {
516
- const regex = /\[(.*?)\]/;
517
- displaylabel = regex.exec(bindDisplayLabelArray[0])[1];
518
- }
519
- else {
520
- displaylabel = true;
521
- }
522
- }
523
- }
524
- if ((bindDisplayLabelArray.length > 1 || (displaylabel && !includes(searchKeyArray, displaylabel))
525
- || (this.displayexpression && !includes(searchKeyArray, this.displayexpression)))) {
526
- this._loadingItems = false;
527
- return of([]);
528
- }
529
- }
530
- this._lastQuery = this.query;
531
- return from(this.getDataSource(query));
532
- }
533
- handleEvent(node, eventName, eventCallback, locals) {
534
- if (!includes(['blur', 'focus', 'select', 'submit', 'change'], eventName)) {
535
- super.handleEvent(node, eventName, eventCallback, locals);
536
- }
537
- }
538
- // highlight the characters in the dropdown matching the query.
539
- highlight(match, query) {
540
- if (this.typeaheadContainer) {
541
- // highlight of chars will work only when label are strings.
542
- match.value = match.item.label.toString();
543
- return this.typeaheadContainer.highlight(match, query);
544
- }
545
- }
546
- // inserts the element at the index position
547
- insertAtIndex(i) {
548
- if (i === 0) {
549
- this.parentEl.prepend(this.$element);
550
- }
551
- else {
552
- const $elAtIndex = this.parentEl.children().eq(i);
553
- if ($elAtIndex.length) {
554
- this.$element.insertBefore(this.parentEl.children().eq(i));
555
- }
556
- else {
557
- this.$element.insertAfter(this.parentEl.children().eq(i - 1));
558
- }
559
- }
560
- }
561
- // Check if the widget is of type autocomplete in mobile view/ app
562
- isMobileAutoComplete() {
563
- return this.type === 'autocomplete' && isMobile();
564
- }
565
- // Check if the query is entered in the input and the view is not mobile
566
- isQueryEntered() {
567
- return this.showclear && this.showClosebtn;
568
- }
569
- loadMoreData(incrementPage) {
570
- if (!this.dataProvider || this.dataProvider.isLastPage) {
571
- return;
572
- }
573
- // Increase the page number and trigger force query update
574
- this.page = incrementPage ? this.page + 1 : this.page;
575
- this.isScrolled = true;
576
- this._loadingItems = true;
577
- // when invoking new set of results, reset the lastQuery.
578
- if (incrementPage) {
579
- this._lastQuery = undefined;
580
- }
581
- // trigger the typeahead change manually to fetch the next set of results.
582
- this.typeahead.onInput({
583
- target: {
584
- value: trim(this.query) || '0' // dummy data to notify the observables
585
- }
586
- });
587
- }
588
- // on focusout, subscribe to the datavalue changes again
589
- onFocusOut() {
590
- this._unsubscribeDv = false;
591
- this._loadingItems = false;
592
- // reset the page value on focusout.
593
- this.page = 1;
594
- // if domUpdated is true then do not hide the dropdown in the fullscreen
595
- if (!this._domUpdated && this._isOpen) {
596
- this.listenQuery = false;
597
- }
598
- this._isOpen = false;
599
- // on outside click, typeahead is hidden. To avoid this, when fullscreen is set, overridding isFocused flag on the typeahead container
600
- if (this._domUpdated && this.typeahead && this.typeahead._container) {
601
- this.typeahead._container.isFocused = true;
602
- }
603
- }
604
- onInputChange($event) {
605
- // reset all the previous page details in order to fetch new set of result.
606
- this.result = [];
607
- this.page = 1;
608
- this.listenQuery = this.isUpdateOnKeyPress();
609
- this._modelByValue = undefined;
610
- // when input is cleared, reset the datavalue
611
- if (this.query === '') {
612
- this.queryModel = '';
613
- this._modelByValue = '';
614
- this.updatePrevDatavalue(this._lastQuery);
615
- this.invokeOnChange(this._modelByValue, {}, true);
616
- this.invokeEventCallback('clear', { $event });
617
- // trigger onSubmit only when the search input is cleared off and do not trigger when tab is pressed.
618
- if ($event && $event.which !== 9) {
619
- this.invokeEventCallback('submit', { $event });
620
- }
621
- }
622
- else {
623
- // invoking change event on every input value change.
624
- this.invokeEventCallback('change', {
625
- $event: $event,
626
- newVal: this._modelByValue || this.query,
627
- oldVal: this.prevDatavalue
628
- });
629
- }
630
- this.showClosebtn = (this.query !== '');
631
- }
632
- // Triggered for enter event
633
- handleEnterEvent($event) {
634
- // submit event triggered when there is no search results
635
- if (!get(this.typeahead, 'matches.length')) {
636
- this.onSearchSelect($event);
637
- }
638
- }
639
- // Triggerred when typeahead option is selected.
640
- onSearchSelect($event) {
641
- let item;
642
- // WMS-22533: Before adding active typeahead el, check if the entered query matches with the active el or not
643
- const isQueryMatch = this.typeaheadContainer?.active?.value === this.query;
644
- if (this.typeaheadContainer?.active && isQueryMatch) {
645
- item = this.typeaheadContainer.active.item;
646
- }
647
- $event = this.eventData($event, item || {});
648
- // searchOn is set as onBtnClick, then invoke the search api call manually.
649
- if (!this.isUpdateOnKeyPress()) {
650
- this.listenQuery = true;
651
- // trigger the typeahead change manually to fetch the next set of results.
652
- this.typeahead.onInput({
653
- target: {
654
- value: this.query // dummy data to notify the observables
655
- }
656
- });
657
- return;
658
- }
659
- // when matches are available.
660
- if (this.typeaheadContainer && this.liElements.length && isQueryMatch) {
661
- this.typeaheadContainer.selectActiveMatch();
662
- }
663
- else {
664
- this.queryModel = this.query;
665
- this.invokeEventCallback('submit', { $event });
666
- }
667
- }
668
- invokeOnBeforeServiceCall(inputData) {
669
- this.invokeEventCallback('beforeservicecall', { inputData });
670
- }
671
- onDropdownOpen() {
672
- if (this.clearData) {
673
- this.typeahead.hide();
674
- }
675
- // setting the ulElements, liElement on typeaheadContainer.
676
- // as we are using customOption template, liElements are not available on typeaheadContainer so append them explicitly.
677
- const fn = debounce(() => {
678
- this._isOpen = true;
679
- this.typeaheadContainer = this.typeahead._container || this.typeahead._typeahead.instance;
680
- this.typeaheadContainer.liElements = this.liElements;
681
- this.typeaheadContainer.ulElement = this.ulElement;
682
- adjustContainerPosition($('typeahead-container'), this.nativeElement, this.typeahead._typeahead, $('typeahead-container .dropdown-menu'));
683
- });
684
- fn();
685
- // open full-screen search view
686
- if (this.isMobileAutoComplete()) {
687
- if (!this.$element.hasClass('full-screen')) {
688
- this.renderMobileAutoComplete();
689
- }
690
- const dropdownEl = this.dropdownEl.closest('typeahead-container');
691
- dropdownEl.insertAfter(this.$element.find('input').first());
692
- const screenHeight = this.$element.closest('.app-content').height();
693
- dropdownEl.css({ position: 'relative', top: 0, height: screenHeight + 'px' });
694
- this.showClosebtn = this.query && this.query !== '';
695
- if (this.dataProvider && !isUndefined(this.dataProvider.isLastPage) && !this.dataProvider.isLastPage) {
696
- this.triggerSearch();
697
- }
698
- }
699
- }
700
- selectNext() {
701
- const matches = this.typeaheadContainer.matches;
702
- if (!matches) {
703
- return;
704
- }
705
- const index = matches.indexOf(this.typeaheadContainer.active);
706
- // on keydown, if scroll is at the bottom and next page records are available, fetch next page items.
707
- if (!this._loadingItems && this.dataProvider && !this.dataProvider.isLastPage && index + 1 > matches.length - 1) {
708
- // index is saved in order to select the lastSelected item in the dropdown after fetching next page items.
709
- this.lastSelectedIndex = index;
710
- this.loadMoreData(true);
711
- }
712
- }
713
- setLastActiveMatchAsSelected() {
714
- if (this.lastSelectedIndex) {
715
- this.typeaheadContainer._active = this.typeaheadContainer.matches[this.lastSelectedIndex];
716
- this.typeaheadContainer.nextActiveMatch();
717
- this.lastSelectedIndex = undefined;
718
- }
719
- }
720
- triggerSearch() {
721
- if (!this.dataProvider || this.dataProvider.isLastPage || !this.$element.hasClass('full-screen')) {
722
- return;
723
- }
724
- const typeAheadDropDown = this.dropdownEl;
725
- const $lastItem = typeAheadDropDown.find('li').last();
726
- // Check if last item is not below the full screen
727
- if ($lastItem.length && typeAheadDropDown.length && (typeAheadDropDown.height() + typeAheadDropDown.position().top > $lastItem.height() + $lastItem.position().top)) {
728
- this.loadMoreData(true);
729
- }
730
- }
731
- isUpdateOnKeyPress() {
732
- return this.searchon === 'typing';
733
- }
734
- debounceDefaultQuery(data) {
735
- this._defaultQueryInvoked = true;
736
- this.getDataSource(data, true).then((response) => {
737
- if (response.length) {
738
- this.queryModel = response;
739
- this._lastQuery = this.query = this.queryModel[0].label || '';
740
- this._modelByValue = this.queryModel[0].value;
741
- this._modelByKey = this.queryModel[0].key;
742
- this.showClosebtn = (this.query !== '');
743
- }
744
- else {
745
- this._modelByValue = undefined;
746
- this.queryModel = undefined;
747
- this.query = '';
748
- }
749
- if (this.clearData) {
750
- if (get(this.typeahead, '_typeahead.isShown')) {
751
- this.typeahead.hide();
752
- }
753
- }
754
- });
755
- }
756
- updateByDatavalue(data) {
757
- this.updateByDataset(data);
758
- this.updateByDataSource(data);
759
- }
760
- updateByDataSource(data) {
761
- // value is present but the corresponding key is not found then fetch next set
762
- // modelByKey will be set only when datavalue is available inside the localData otherwise make a N/w call.
763
- if (isDefined(data) && !isObject(data) && this.datasource && !isDefined(this._modelByKey) && this.datafield !== ALLFIELDS) {
764
- // Avoid making default query if queryModel already exists.
765
- if (isDefined(this.queryModel) && !isEmpty(this.queryModel)) {
766
- this.updateDatavalueFromQueryModel();
767
- return;
768
- }
769
- // Make default query call only when datasource supports CRUD (live variable).
770
- if (!this._defaultQueryInvoked && this.datasource.execute(DataSource.Operation.SUPPORTS_CRUD)) {
771
- this.debounceDefaultQuery(data);
772
- }
773
- }
774
- }
775
- // updates the model value using queryModel
776
- updateDatavalueFromQueryModel() {
777
- if (isDefined(this.queryModel)) {
778
- this._modelByValue = isArray(this.queryModel) ? this.queryModel[0].value : this.queryModel;
779
- this._modelByKey = isArray(this.queryModel) ? this.queryModel[0].key : this.queryModel;
780
- this.toBeProcessedDatavalue = undefined;
781
- }
782
- }
783
- updateByDataset(data) {
784
- // default query is already invoked then do not make other default query call.
785
- // For local search i.e. searchkey is undefined, do not return, verify the datavalue against the datasetItems .
786
- if (this._defaultQueryInvoked && this.searchkey) {
787
- return;
788
- }
789
- const selectedItem = find(this.datasetItems, (item) => {
790
- return (isObject(item.value) ? isEqual(item.value, data) : (toString(item.value)).toLowerCase() === (toString(data)).toLowerCase());
791
- });
792
- // set the default only when it is available in dataset.
793
- if (selectedItem) {
794
- this.queryModel = [selectedItem];
795
- }
796
- else if (this.datafield === ALLFIELDS && isObject(data)) {
797
- this.queryModel = this.getTransformedData(extractDataAsArray(data));
798
- }
799
- else
800
- // resetting the queryModel only when prevDatavalue is equal to data
801
- if (this.prevDatavalue !== data) {
802
- this.queryModel = undefined;
803
- this.query = '';
804
- return;
805
- }
806
- this.updateDatavalueFromQueryModel();
807
- // Show the label value on input.
808
- this._lastQuery = this.query = isDefined(this.queryModel) && this.queryModel.length ? get(this.queryModel[0], 'label') : '';
809
- this.showClosebtn = (this.query !== '');
810
- }
811
- // If we have last search results then open dropdown on focus
812
- handleFocus($event) {
813
- if (this.type === 'search' && this.query === this._lastQuery && this._lastResult) {
814
- this.typeahead.keyUpEventEmitter.emit(this.query);
815
- }
816
- }
817
- notifySubscriber() {
818
- const parentEl = $(this.nativeElement).closest('.app-composite-widget.caption-floating');
819
- if (parentEl.length > 0) {
820
- this.app.notify('captionPositionAnimate', { displayVal: true, nativeEl: parentEl });
821
- }
822
- }
823
- // This method returns a promise that provides the filtered data from the datasource.
824
- getDataSource(query, searchOnDataField, nextItemIndex) {
825
- // For default query, searchOnDataField is set to true, then do not make a n/w call when datafield is ALLFIELDS
826
- if (searchOnDataField && this.datafield === ALLFIELDS) {
827
- this._loadingItems = false;
828
- return Promise.resolve([]);
829
- }
830
- // For default datavalue, search key as to be on datafield to get the default data from the filter call.
831
- const dataConfig = {
832
- dataset: this.dataset ? convertDataToObject(this.dataset) : undefined,
833
- binddataset: this.binddataset,
834
- datasource: this.datasource,
835
- datafield: this.datafield,
836
- hasData: this.dataset?.length,
837
- query: query,
838
- isLocalFilter: !this.searchkey,
839
- searchKey: searchOnDataField ? this.datafield : this.searchkey,
840
- // default search call match mode should be startignorecase
841
- matchMode: searchOnDataField ? 'startignorecase' : this.matchmode,
842
- casesensitive: this.casesensitive,
843
- isformfield: this.isformfield,
844
- orderby: this.orderby,
845
- limit: this.limit,
846
- pagesize: this.pagesize,
847
- page: this.page,
848
- onBeforeservicecall: this.invokeOnBeforeServiceCall.bind(this)
849
- };
850
- if (this.dataoptions) {
851
- dataConfig.dataoptions = this.dataoptions;
852
- dataConfig.viewParent = this.viewParent;
853
- }
854
- this._loadingItems = true;
855
- return this.dataProvider.filter(dataConfig)
856
- .then((response) => {
857
- // response from dataProvider returns always data object.
858
- response = response.data || response;
859
- // for service variable, updating the dataset only if it is not defined or empty
860
- if (this.dataProvider && (!isDefined(this.dataset) || !this.dataset.length) && this.dataProvider.updateDataset) {
861
- this.dataset = response;
862
- }
863
- if (this.dataProvider?.hasMoreData) {
864
- this.formattedDataset = this.formattedDataset.concat(response);
865
- }
866
- else {
867
- this.formattedDataset = response;
868
- }
869
- // ngx-bootstrap 21: typeaheadOptionsLimit is an InputSignal — update bound value instead of assigning on directive.
870
- if (this.formattedDataset.length > 20 && !isDefined(this.limit)) {
871
- this._dynamicTypeaheadOptionsLimit = this.formattedDataset.length;
872
- }
873
- else {
874
- this._dynamicTypeaheadOptionsLimit = undefined;
875
- }
876
- // In mobile, trigger the search by default until the results have height upto page height. Other results can be fetched by scrolling
877
- if (this.dataProvider && this._isOpen && this.isMobileAutoComplete() && !isUndefined(this.dataProvider.isLastPage) && !this.dataProvider.isLastPage) {
878
- this.triggerSearch();
879
- }
880
- const transformedData = this.getTransformedData(this.formattedDataset, nextItemIndex);
881
- // result contains the datafield values.
882
- this.result = map(transformedData, 'value');
883
- return transformedData;
884
- }, (error) => {
885
- this._loadingItems = false;
886
- return [];
887
- }).then(result => {
888
- if (this.isScrolled) {
889
- (debounce(() => {
890
- this.setLastActiveMatchAsSelected();
891
- }, 30))();
892
- this.isScrolled = false;
893
- }
894
- // When no result is found, set the datavalue to undefined.
895
- if (!result.length) {
896
- this._modelByValue = undefined;
897
- this.queryModel = query;
898
- }
899
- // on focusout i.e. on other widget focus, if n/w is pending loading icon is shown, when data is available then dropdown is shown again.
900
- // on unsubscribing do not show the results.
901
- if (this._unsubscribeDv) {
902
- result = [];
903
- }
904
- this._loadingItems = false;
905
- this._lastResult = result;
906
- return result;
907
- });
908
- }
909
- // this method returns the parent context i.e. Page context and not parent component's context.
910
- getContext(context) {
911
- if (context && get(context, 'widget')) {
912
- return this.getContext(context.viewParent);
913
- }
914
- return context;
915
- }
916
- getTransformedData(data, itemIndex, iscustom) {
917
- if (isDefined(itemIndex)) {
918
- itemIndex++;
919
- }
920
- const transformedData = transformFormData(this.getContext(this.viewParent), data, this.datafield, {
921
- displayField: this.displaylabel || this.displayfield,
922
- displayExpr: iscustom ? '' : this.displayexpression,
923
- bindDisplayExpr: iscustom ? '' : this.binddisplaylabel,
924
- bindDisplayImgSrc: this.binddisplayimagesrc,
925
- displayImgSrc: this.displayimagesrc
926
- }, itemIndex, this);
927
- return getUniqObjsByDataField(transformedData, this.datafield, this.displayfield || this.displaylabel, toBoolean(this.allowempty));
928
- }
929
- // OptionsListTemplate listens to the scroll event and triggers this function.
930
- onScroll($scrollEl, evt) {
931
- const totalHeight = $scrollEl.scrollHeight, clientHeight = $scrollEl.clientHeight;
932
- // If scroll is at the bottom and no request is in progress and next page records are available, fetch next page items.
933
- if (!this._loadingItems && this.dataProvider && !this.dataProvider.isLastPage && ($scrollEl.scrollTop + clientHeight >= totalHeight)) {
934
- this.loadMoreData(true);
935
- }
936
- }
937
- ngOnInit() {
938
- super.ngOnInit();
939
- if (!isDefined(this.minchars)) {
940
- // for autocomplete set the minchars to 0
941
- if (this.type === 'autocomplete') {
942
- this.minchars = 0;
943
- }
944
- else {
945
- this.minchars = 1;
946
- }
947
- }
948
- this.listenQuery = this.isUpdateOnKeyPress();
949
- // by default for autocomplete do not show the search icon
950
- // by default show the searchicon for type = search
951
- this.showsearchicon = isDefined(this.showsearchicon) ? this.showsearchicon : (this.type === 'search');
952
- }
953
- ngAfterViewInit() {
954
- super.ngAfterViewInit();
955
- styler(this.nativeElement, this);
956
- this.containerTarget = getContainerTargetClass(this.nativeElement);
957
- }
958
- ngAfterViewChecked() {
959
- const searchInputEl = $('.app-search-input');
960
- if (searchInputEl) {
961
- searchInputEl.removeAttr('aria-expanded');
962
- }
963
- }
964
- eventData($event, item) {
965
- if ($event) {
966
- $event['data'] = {
967
- item: item.dataObject,
968
- model: item.value,
969
- label: item.label,
970
- query: this.query
971
- };
972
- }
973
- return $event;
974
- }
975
- // triggered on select on option from the list. Set the queryModel, query and modelByKey from the matched item.
976
- typeaheadOnSelect(match, $event) {
977
- const item = match.item;
978
- this.queryModel = item;
979
- item.selected = true;
980
- this.query = item.label;
981
- this.showClosebtn = (this.query !== '');
982
- $event = $event || this.$typeaheadEvent;
983
- // As item.key can vary from key in the datasetItems
984
- this._modelByKey = item.key;
985
- this._modelByValue = item.value;
986
- $event = this.eventData($event, item);
987
- this.invokeOnTouched();
988
- this.invokeOnChange(this.datavalue, $event || {});
989
- // updating the variable bound to default value as invokeOnChange is not updating the variable.
990
- if (this.datavalue !== this.prevDatavalue) {
991
- this.updateBoundVariable(this.datavalue);
992
- }
993
- if (this.$element.hasClass('full-screen')) {
994
- this.closeSearch();
995
- }
996
- this.invokeEventCallback('select', { $event, selectedValue: this.datavalue });
997
- this.invokeEventCallback('submit', { $event });
998
- this.updatePrevDatavalue(this.datavalue);
999
- }
1000
- onPropertyChange(key, nv, ov) {
1001
- if (key === 'tabindex') {
1002
- return;
1003
- }
1004
- // Backward compatability from 10.3.1 to 10.3.2
1005
- // 10.3.1 we had displaylabel as modal value
1006
- // From 10.3.2 onwords we will be having displayexpresion as modal value
1007
- if (this.type === 'autocomplete' && key === 'displaylabel' && this.displaylabel && (!this.displayexpression || (this.displayexpression && !this.datasource))) {
1008
- this.displayexpression = this.displaylabel;
1009
- this.displaylabel = undefined;
1010
- }
1011
- // when dataoptions are provided and there is no displaylabel given then displaylabel is set as the relatedfield
1012
- if (key === 'displaylabel' && this.dataoptions && this.binddisplaylabel === null) {
1013
- this.query = get(this._modelByValue, nv) || this._modelByValue;
1014
- }
1015
- // when search is disabled, do not load any more data or just clear the data that is already in process or loaded.
1016
- if (key === 'disabled') {
1017
- if (nv === false) {
1018
- this.clearData = false;
1019
- }
1020
- else {
1021
- this.clearData = true;
1022
- if (get(this.typeahead, '_typeahead.isShown')) {
1023
- this.typeahead.hide();
1024
- }
1025
- }
1026
- }
1027
- super.onPropertyChange(key, nv, ov);
1028
- }
1029
- ngOnDestroy() {
1030
- // MEMORY LEAK FIX: Clear QueryList reference
1031
- this.liElements = null;
1032
- // MEMORY LEAK FIX: Clear data provider
1033
- if (this.dataProvider) {
1034
- this.dataProvider = null;
1035
- }
1036
- // MEMORY LEAK FIX: Clear typeahead reference
1037
- if (this.typeahead) {
1038
- this.typeahead = null;
1039
- }
1040
- // MEMORY LEAK FIX: Clear query model
1041
- this.queryModel = null;
1042
- this.query = '';
1043
- // Call parent ngOnDestroy (DatasetAwareFormComponent has cleanup)
1044
- super.ngOnDestroy();
1045
- }
1046
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0, type: SearchComponent, deps: [{ token: i0.Injector }, { token: i1.App }, { token: 'datavalue.bind', attribute: true }, { token: 'dataset.bind', attribute: true }, { token: 'EXPLICIT_CONTEXT', optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
1047
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.21", type: SearchComponent, isStandalone: true, selector: "[wmSearch]", providers: [
1048
- provideAs(SearchComponent, NG_VALUE_ACCESSOR, true),
1049
- provideAs(SearchComponent, NG_VALIDATORS, true),
1050
- provideAsWidgetRef(SearchComponent)
1051
- ], viewQueries: [{ propertyName: "typeahead", first: true, predicate: TypeaheadDirective, descendants: true }, { propertyName: "ulElement", first: true, predicate: ["ulElement"], descendants: true }, { propertyName: "liElements", predicate: ["liElements"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #customItemTemplate let-model=\"item\" let-index=\"index\" let-query=\"query\" let-match=\"match\">\n <!-- Default item template -->\n @if (!content) {\n <a>\n @if (model.imgSrc) {\n <img [src]=\"model.imgSrc\" alt=\"Search\" [style.width]=\"imagewidth\">\n }\n <span [title]=\"model.label\" [innerHtml]=\"highlight(match, query) || model.label\"></span>\n </a>\n }\n <!-- Custom partial template -->\n @if (content) {\n <a [ngClass]=\"{customTemplate: content}\" partialContainer [wmItemTemplate]=\"content\" [userComponentParams]=\"match.item\">\n <div partial-container-target></div>\n </a>\n }\n</ng-template>\n\n<ng-template #customListTemplate let-matches=\"matches\" let-itemTemplate=\"itemTemplate\" let-query=\"query\">\n <ul #ulElement class=\"app-search dropdown-menu\" scrollableHandler>\n @for (match of matches; track match; let i = $index) {\n <li #liElements [ngClass]=\"{active: typeaheadContainer && typeaheadContainer.isActive(match), 'list-group-header': match && match.isHeader()}\"\n (mouseenter)=\"typeaheadContainer.selectActive(match);\"\n (click)=\"match && !match.isHeader() && typeaheadContainer.selectMatch(match, $event); $typeaheadEvent = $event; notifySubscriber();\">\n <!-- itemTemplate comes from the <input> -->\n @if (match.isHeader()) {\n <h4 class=\"group-title\">{{match.value}}</h4>\n }\n @if (!match.isHeader()) {\n <ng-container [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{item: match.item, index: i, match: match, query: query}\">\n </ng-container>\n }\n </li>\n }\n <div class=\"status\" [hidden]=\"_loadingItems || !(datacompletemsg && dataProvider?.isLastPage)\">\n <span [textContent]=\"datacompletemsg\"></span>\n </div>\n <div class=\"status\" [hidden]=\"!_loadingItems\">\n <i class=\"fa fa-circle-o-notch fa-spin\"></i>\n <span [textContent]=\"loadingdatamsg\"></span>\n </div>\n </ul>\n</ng-template>\n\n<!--This template is for search inside mobile navbar.-->\n@if (navsearchbar) {\n <input [title]=\"query || ''\" type=\"text\" class=\"app-textbox form-control list-of-objs app-search-input\" [placeholder]=\"placeholder || ''\"\n focus-target\n container=\"body\"\n [disabled]=\"disabled\"\n [attr.accesskey]=\"shortcutkey\"\n autocomplete=\"off\"\n [(ngModel)]=\"query\"\n [ngModelOptions]=\"{standalone: true}\"\n [readonly]=\"readonly\"\n [typeahead]=\"typeaheadDataSource\"\n [typeaheadWaitMs]=\"debouncetime\"\n [typeaheadItemTemplate]=\"customItemTemplate\"\n [optionsListTemplate]=\"customListTemplate\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"listenQuery = true\"\n (keydown.enter)=\"$typeaheadEvent = $event;handleEnterEvent($event)\"\n (keydown.arrowdown)=\"selectNext($event)\"\n (blur)=\"invokeOnTouched($event)\"\n (click)=\"handleFocus($event);\"\n (focus)=\"_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event);\"\n (focusout)=\"onFocusOut()\"\n [typeaheadMinLength]=\"minchars\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit\"\n (typeaheadLoading)=\"_loadingItems\"\n (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n typeaheadOptionField=\"label\"\n [typeaheadGroupField]=\"groupby ? 'groupby' : null\"\n [typeaheadAsync]=\"true\"\n [typeaheadScrollable]=\"true\"\n [adaptivePosition]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionslimitinscrollableview\"\n [dropup]=\"dropup\"\n [tabindex]=\"tabindex\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel || 'Search field'\"/>\n <i class=\"btn-close wi wi-cancel\" [hidden]=\"!showClosebtn\" (click)=\"clearSearch($event);\"></i>\n} @else {\n <button type=\"button\" class=\"btn btn-icon form-control-feedback back-btn\" aria-hidden=\"true\" (click)=\"closeSearch()\">\n <wm-app-icon [iconclass]=\"backsearchiconclass\" [iconurl]=\"backsearchiconurl\" alt=\"Back\"></wm-app-icon>\n </button>\n <span class=\"sr-only\">Back button</span>\n <input [title]=\"query || ''\" type=\"text\" class=\"app-textbox form-control list-of-objs app-search-input\" [placeholder]=\"placeholder || ''\"\n focus-target\n [container]=\"containerTarget || '.wm-app'\"\n [disabled]=\"disabled\"\n [attr.accesskey]=\"shortcutkey\"\n autocomplete=\"off\"\n [(ngModel)]=\"query\"\n [ngModelOptions]=\"{standalone: true}\"\n [readonly]=\"readonly\"\n [typeahead]=\"typeaheadDataSource\"\n [typeaheadWaitMs]=\"debouncetime\"\n [typeaheadItemTemplate]=\"customItemTemplate\"\n [optionsListTemplate]=\"customListTemplate\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"listenQuery = true\"\n (keydown.enter)=\"$typeaheadEvent = $event;handleEnterEvent($event)\"\n (keydown.arrowdown)=\"selectNext($event)\"\n (blur)=\"invokeOnTouched($event); onFocusOut()\"\n (click)=\"handleFocus($event);\"\n (focus)=\"_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event)\"\n [typeaheadMinLength]=\"minchars\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit\"\n (typeaheadLoading)=\"_loadingItems\"\n (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n typeaheadOptionField=\"label\"\n [typeaheadGroupField]=\"groupby ? 'groupby' : null\"\n [typeaheadAsync]=\"true\"\n [typeaheadScrollable]=\"true\"\n [adaptivePosition]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionslimitinscrollableview\"\n [tabindex]=\"tabindex\"\n [dropup]=\"dropup\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel || 'Search field'\">\n <input class=\"model-holder\" ng-model=\"proxyModel\" ng-required=\"required\" tabindex=\"-1\" aria-hidden=\"true\">\n @if (_loadingItems) {\n <span aria-hidden=\"true\" class=\"fa fa-circle-o-notch fa-spin form-control-feedback\"></span>\n }\n <button type=\"button\" class=\"btn btn-icon form-control-feedback clear-btn\" [ngClass]=\"{'show-btn': isQueryEntered()}\" (click)=\"clearSearch($event, true)\">\n <wm-app-icon [iconclass]=\"clearsearchiconclass\" [iconurl]=\"clearsearchiconurl\" alt=\"Clear\"></wm-app-icon>\n </button>\n <span class=\"sr-only\">Clear button</span>\n @if (showsearchicon) {\n <span [ngClass]=\"{'disabled': disabled}\" class=\"input-group-addon\">\n <form>\n <button title=\"Search\" [disabled]=\"disabled\" class=\"app-search-button btn btn-icon\" type=\"submit\"\n (click)=\"onSearchSelect($event)\">\n <wm-app-icon [iconclass]=\"searchiconclass\" [iconurl]=\"searchiconurl\" alt=\"Search\"></wm-app-icon>\n </button>\n </form>\n </span>\n }\n }\n <!--This template is for both web and fullscreen mode in mobile.-->\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: ScrollableDirective, selector: "[scrollableHandler]" }, { kind: "ngmodule", type: TypeaheadModule }, { kind: "directive", type: i4.TypeaheadDirective, selector: "[typeahead]", inputs: ["typeahead", "typeaheadMinLength", "adaptivePosition", "isAnimated", "typeaheadWaitMs", "typeaheadOptionsLimit", "typeaheadOptionField", "typeaheadGroupField", "typeaheadOrderBy", "typeaheadAsync", "typeaheadLatinize", "typeaheadSingleWords", "typeaheadWordDelimiters", "typeaheadMultipleSearch", "typeaheadMultipleSearchDelimiters", "typeaheadPhraseDelimiters", "typeaheadItemTemplate", "optionsListTemplate", "typeaheadScrollable", "typeaheadOptionsInScrollableView", "typeaheadHideResultsOnBlur", "typeaheadSelectFirstItem", "typeaheadIsFirstItemActive", "container", "dropup"], outputs: ["typeaheadLoading", "typeaheadNoResults", "typeaheadOnSelect", "typeaheadOnPreview", "typeaheadOnBlur"], exportAs: ["bs-typeahead"] }, { kind: "directive", type: TextContentDirective, selector: "[textContent]", inputs: ["textContent"] }, { kind: "directive", type: ItemTemplateDirective, selector: "[wmItemTemplate]", inputs: ["userComponentParams", "wmItemTemplate"], exportAs: ["itemTemplateRef"] }, { kind: "directive", type: PartialParamHandlerDirective, selector: "[partialContainer]" }, { kind: "directive", type: PartialContainerDirective, selector: "[partialContainer]" }, { kind: "component", type: WmAppIconComponent, selector: "wm-app-icon", inputs: ["icon", "iconclass", "iconurl", "defaultIconClass", "defaultClasses", "iconStyle", "alt"] }] }); }
1052
- }
1053
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0, type: SearchComponent, decorators: [{
1054
- type: Component,
1055
- args: [{ standalone: true, imports: [CommonModule, FormsModule, ScrollableDirective, TypeaheadModule, TextContentDirective, ItemTemplateDirective, PartialParamHandlerDirective, PartialContainerDirective, WmAppIconComponent], selector: '[wmSearch]', providers: [
1056
- provideAs(SearchComponent, NG_VALUE_ACCESSOR, true),
1057
- provideAs(SearchComponent, NG_VALIDATORS, true),
1058
- provideAsWidgetRef(SearchComponent)
1059
- ], template: "<ng-template #customItemTemplate let-model=\"item\" let-index=\"index\" let-query=\"query\" let-match=\"match\">\n <!-- Default item template -->\n @if (!content) {\n <a>\n @if (model.imgSrc) {\n <img [src]=\"model.imgSrc\" alt=\"Search\" [style.width]=\"imagewidth\">\n }\n <span [title]=\"model.label\" [innerHtml]=\"highlight(match, query) || model.label\"></span>\n </a>\n }\n <!-- Custom partial template -->\n @if (content) {\n <a [ngClass]=\"{customTemplate: content}\" partialContainer [wmItemTemplate]=\"content\" [userComponentParams]=\"match.item\">\n <div partial-container-target></div>\n </a>\n }\n</ng-template>\n\n<ng-template #customListTemplate let-matches=\"matches\" let-itemTemplate=\"itemTemplate\" let-query=\"query\">\n <ul #ulElement class=\"app-search dropdown-menu\" scrollableHandler>\n @for (match of matches; track match; let i = $index) {\n <li #liElements [ngClass]=\"{active: typeaheadContainer && typeaheadContainer.isActive(match), 'list-group-header': match && match.isHeader()}\"\n (mouseenter)=\"typeaheadContainer.selectActive(match);\"\n (click)=\"match && !match.isHeader() && typeaheadContainer.selectMatch(match, $event); $typeaheadEvent = $event; notifySubscriber();\">\n <!-- itemTemplate comes from the <input> -->\n @if (match.isHeader()) {\n <h4 class=\"group-title\">{{match.value}}</h4>\n }\n @if (!match.isHeader()) {\n <ng-container [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{item: match.item, index: i, match: match, query: query}\">\n </ng-container>\n }\n </li>\n }\n <div class=\"status\" [hidden]=\"_loadingItems || !(datacompletemsg && dataProvider?.isLastPage)\">\n <span [textContent]=\"datacompletemsg\"></span>\n </div>\n <div class=\"status\" [hidden]=\"!_loadingItems\">\n <i class=\"fa fa-circle-o-notch fa-spin\"></i>\n <span [textContent]=\"loadingdatamsg\"></span>\n </div>\n </ul>\n</ng-template>\n\n<!--This template is for search inside mobile navbar.-->\n@if (navsearchbar) {\n <input [title]=\"query || ''\" type=\"text\" class=\"app-textbox form-control list-of-objs app-search-input\" [placeholder]=\"placeholder || ''\"\n focus-target\n container=\"body\"\n [disabled]=\"disabled\"\n [attr.accesskey]=\"shortcutkey\"\n autocomplete=\"off\"\n [(ngModel)]=\"query\"\n [ngModelOptions]=\"{standalone: true}\"\n [readonly]=\"readonly\"\n [typeahead]=\"typeaheadDataSource\"\n [typeaheadWaitMs]=\"debouncetime\"\n [typeaheadItemTemplate]=\"customItemTemplate\"\n [optionsListTemplate]=\"customListTemplate\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"listenQuery = true\"\n (keydown.enter)=\"$typeaheadEvent = $event;handleEnterEvent($event)\"\n (keydown.arrowdown)=\"selectNext($event)\"\n (blur)=\"invokeOnTouched($event)\"\n (click)=\"handleFocus($event);\"\n (focus)=\"_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event);\"\n (focusout)=\"onFocusOut()\"\n [typeaheadMinLength]=\"minchars\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit\"\n (typeaheadLoading)=\"_loadingItems\"\n (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n typeaheadOptionField=\"label\"\n [typeaheadGroupField]=\"groupby ? 'groupby' : null\"\n [typeaheadAsync]=\"true\"\n [typeaheadScrollable]=\"true\"\n [adaptivePosition]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionslimitinscrollableview\"\n [dropup]=\"dropup\"\n [tabindex]=\"tabindex\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel || 'Search field'\"/>\n <i class=\"btn-close wi wi-cancel\" [hidden]=\"!showClosebtn\" (click)=\"clearSearch($event);\"></i>\n} @else {\n <button type=\"button\" class=\"btn btn-icon form-control-feedback back-btn\" aria-hidden=\"true\" (click)=\"closeSearch()\">\n <wm-app-icon [iconclass]=\"backsearchiconclass\" [iconurl]=\"backsearchiconurl\" alt=\"Back\"></wm-app-icon>\n </button>\n <span class=\"sr-only\">Back button</span>\n <input [title]=\"query || ''\" type=\"text\" class=\"app-textbox form-control list-of-objs app-search-input\" [placeholder]=\"placeholder || ''\"\n focus-target\n [container]=\"containerTarget || '.wm-app'\"\n [disabled]=\"disabled\"\n [attr.accesskey]=\"shortcutkey\"\n autocomplete=\"off\"\n [(ngModel)]=\"query\"\n [ngModelOptions]=\"{standalone: true}\"\n [readonly]=\"readonly\"\n [typeahead]=\"typeaheadDataSource\"\n [typeaheadWaitMs]=\"debouncetime\"\n [typeaheadItemTemplate]=\"customItemTemplate\"\n [optionsListTemplate]=\"customListTemplate\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"listenQuery = true\"\n (keydown.enter)=\"$typeaheadEvent = $event;handleEnterEvent($event)\"\n (keydown.arrowdown)=\"selectNext($event)\"\n (blur)=\"invokeOnTouched($event); onFocusOut()\"\n (click)=\"handleFocus($event);\"\n (focus)=\"_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event)\"\n [typeaheadMinLength]=\"minchars\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit\"\n (typeaheadLoading)=\"_loadingItems\"\n (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n typeaheadOptionField=\"label\"\n [typeaheadGroupField]=\"groupby ? 'groupby' : null\"\n [typeaheadAsync]=\"true\"\n [typeaheadScrollable]=\"true\"\n [adaptivePosition]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionslimitinscrollableview\"\n [tabindex]=\"tabindex\"\n [dropup]=\"dropup\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel || 'Search field'\">\n <input class=\"model-holder\" ng-model=\"proxyModel\" ng-required=\"required\" tabindex=\"-1\" aria-hidden=\"true\">\n @if (_loadingItems) {\n <span aria-hidden=\"true\" class=\"fa fa-circle-o-notch fa-spin form-control-feedback\"></span>\n }\n <button type=\"button\" class=\"btn btn-icon form-control-feedback clear-btn\" [ngClass]=\"{'show-btn': isQueryEntered()}\" (click)=\"clearSearch($event, true)\">\n <wm-app-icon [iconclass]=\"clearsearchiconclass\" [iconurl]=\"clearsearchiconurl\" alt=\"Clear\"></wm-app-icon>\n </button>\n <span class=\"sr-only\">Clear button</span>\n @if (showsearchicon) {\n <span [ngClass]=\"{'disabled': disabled}\" class=\"input-group-addon\">\n <form>\n <button title=\"Search\" [disabled]=\"disabled\" class=\"app-search-button btn btn-icon\" type=\"submit\"\n (click)=\"onSearchSelect($event)\">\n <wm-app-icon [iconclass]=\"searchiconclass\" [iconurl]=\"searchiconurl\" alt=\"Search\"></wm-app-icon>\n </button>\n </form>\n </span>\n }\n }\n <!--This template is for both web and fullscreen mode in mobile.-->\n" }]
1060
- }], ctorParameters: () => [{ type: i0.Injector }, { type: i1.App }, { type: undefined, decorators: [{
1061
- type: Attribute,
1062
- args: ['datavalue.bind']
1063
- }] }, { type: undefined, decorators: [{
1064
- type: Attribute,
1065
- args: ['dataset.bind']
1066
- }] }, { type: undefined, decorators: [{
1067
- type: Inject,
1068
- args: ['EXPLICIT_CONTEXT']
1069
- }, {
1070
- type: Optional
1071
- }] }], propDecorators: { typeahead: [{
1072
- type: ViewChild,
1073
- args: [TypeaheadDirective]
1074
- }], ulElement: [{
1075
- type: ViewChild,
1076
- args: ['ulElement']
1077
- }], liElements: [{
1078
- type: ViewChildren,
1079
- args: ['liElements']
1080
- }] } });
1081
-
1082
- /**
1083
- * Generated bundle index. Do not edit.
1084
- */
1085
-
180
+ var LocalDataProvider = class {
181
+ applyFilter(entry, queryText, filtername) {
182
+ entry = isNumber(entry) ? entry.toString() : entry;
183
+ if (includes(filtername, "start")) return startsWith(entry, queryText);
184
+ else if (includes(filtername, "end")) return endsWith(entry, queryText);
185
+ else if (includes(filtername, "exact")) return isEqual(entry, queryText);
186
+ return includes(entry, queryText);
187
+ }
188
+ filter(config) {
189
+ const entries = config.dataset;
190
+ let casesensitive = config.casesensitive;
191
+ const matchMode = config.matchMode;
192
+ if (matchMode && !includes(matchMode, "ignorecase")) casesensitive = true;
193
+ let queryText = config.query, filteredData;
194
+ return new Promise((resolve, reject) => {
195
+ if (config.searchKey) {
196
+ const keys = split(config.searchKey, ",");
197
+ filteredData = filter$1(config.dataset, (item) => {
198
+ return keys.some((key) => {
199
+ let a = get(item, key), b = queryText;
200
+ if (!casesensitive) {
201
+ a = toLower(toString(a));
202
+ b = toLower(toString(b));
203
+ }
204
+ return this.applyFilter(a, b, matchMode);
205
+ });
206
+ });
207
+ } else if (isArray(entries) && isObject(entries[0])) filteredData = filter$1(entries, (entry) => {
208
+ let a = values(entry).join(" ");
209
+ if (!casesensitive) {
210
+ a = toLower(a);
211
+ queryText = toLower(queryText);
212
+ }
213
+ return this.applyFilter(a, queryText);
214
+ });
215
+ else filteredData = filter$1(entries, (entry) => {
216
+ if (!casesensitive) {
217
+ entry = toLower(entry);
218
+ queryText = toLower(queryText);
219
+ }
220
+ return this.applyFilter(entry, queryText, matchMode);
221
+ });
222
+ resolve({
223
+ data: filteredData,
224
+ hasMoreData: false,
225
+ isLastPage: true
226
+ });
227
+ });
228
+ }
229
+ };
230
+ var RemoteDataProvider = class {
231
+ filter(config) {
232
+ return this.filterData(config).then((response) => this.onFilterSuccess(config, response), () => this.onFilterFailure());
233
+ }
234
+ filterData(config) {
235
+ if (config.dataoptions) {
236
+ const dataoptions = config.dataoptions;
237
+ const requestParams = config.datasource.execute(DataSource.Operation.GET_REQUEST_PARAMS, config);
238
+ if (dataoptions.relatedField) return new Promise((resolve, reject) => {
239
+ interpolateBindExpressions(config.viewParent, dataoptions.filterExpr, (filterexpressions) => {
240
+ requestParams.filterExpr = dataoptions.filterExpr = filterexpressions;
241
+ dataoptions.filterExpr = filterexpressions;
242
+ config.datasource.execute(DataSource.Operation.GET_RELATED_TABLE_DATA, assign({ relatedField: dataoptions.relatedField }, requestParams)).then(resolve, reject);
243
+ });
244
+ });
245
+ if (dataoptions.distinctField) return config.datasource.execute(DataSource.Operation.GET_DISTINCT_DATA_BY_FIELDS, {
246
+ pagesize: config.limit || config.pagesize,
247
+ page: config.page,
248
+ fields: dataoptions.distinctField,
249
+ entityName: dataoptions.tableName,
250
+ filterFields: assign(dataoptions.filterFields, requestParams.filterFields),
251
+ filterExpr: getClonedObject(dataoptions.filterExpr || {})
252
+ });
253
+ }
254
+ return config.datasource.execute(DataSource.Operation.SEARCH_RECORDS, config);
255
+ }
256
+ isLast(page, dataSize, maxResults, currentResults) {
257
+ if (dataSize === AppConstants.INT_MAX_VALUE) return currentResults !== 0 && currentResults < maxResults;
258
+ return page === (dataSize > maxResults ? Math.ceil(dataSize / maxResults) : dataSize < 0 ? 0 : 1);
259
+ }
260
+ getTransformedData(variable, data) {
261
+ const operationResult = variable.operation + "Result";
262
+ const tempResponse = data[operationResult];
263
+ if (tempResponse) {
264
+ const tempObj = {};
265
+ set(tempObj, operationResult, tempResponse);
266
+ data = [tempObj];
267
+ } else data = [data];
268
+ return data;
269
+ }
270
+ onFilterFailure() {
271
+ return [];
272
+ }
273
+ isLastPageForDistinctApi(data, page, totalElements, _isLastPage) {
274
+ return page > 1 && !_isLastPage && isEmpty(data) && totalElements === AppConstants.INT_MAX_VALUE;
275
+ }
276
+ onFilterSuccess(config, response) {
277
+ let data = response.data;
278
+ let formattedData;
279
+ let _isLastPage;
280
+ let page;
281
+ let isPaginatedData;
282
+ const expressionArray = split(config.binddataset, ".");
283
+ const dataExpression = slice(expressionArray, indexOf(expressionArray, "dataSet") + 1).join(".");
284
+ const $I = "[$i]";
285
+ return new Promise((resolve, reject) => {
286
+ const pageOptions = response.pagination;
287
+ if (config.datasource.execute(DataSource.Operation.IS_PAGEABLE)) {
288
+ page = pageOptions.number + 1;
289
+ _isLastPage = this.isLast(page, config.limit > 0 && config.limit || pageOptions.totalElements, pageOptions.size, pageOptions.numberOfElements);
290
+ isPaginatedData = true;
291
+ if (this.isLastPageForDistinctApi(data, page, pageOptions.totalElements, _isLastPage)) {
292
+ _isLastPage = true;
293
+ resolve({
294
+ data: [],
295
+ isLastPage: _isLastPage,
296
+ hasMoreData: page > 1,
297
+ isPaginatedData,
298
+ page
299
+ });
300
+ return;
301
+ }
302
+ }
303
+ if (dataExpression) {
304
+ if (isArray(data)) {
305
+ const index = dataExpression.lastIndexOf($I);
306
+ if (index > -1) {
307
+ const restExpr = dataExpression.substr(index + 5);
308
+ formattedData = data.map((datum) => findValueOf(datum, restExpr));
309
+ }
310
+ } else if (isObject(data)) formattedData = get(data, dataExpression);
311
+ data = formattedData || data;
312
+ }
313
+ if (!isArray(data)) data = this.getTransformedData(config.datasource, data);
314
+ if (!data.length) resolve({
315
+ data: [],
316
+ isLastPage: _isLastPage,
317
+ hasMoreData: page > 1,
318
+ isPaginatedData,
319
+ page
320
+ });
321
+ else resolve({
322
+ data,
323
+ isLastPage: _isLastPage,
324
+ hasMoreData: page > 1,
325
+ isPaginatedData,
326
+ page
327
+ });
328
+ });
329
+ }
330
+ };
331
+ var DataProvider = class DataProvider {
332
+ static {
333
+ this.remoteDataProvider = new RemoteDataProvider();
334
+ }
335
+ static {
336
+ this.localDataProvider = new LocalDataProvider();
337
+ }
338
+ filter(config) {
339
+ let promise;
340
+ const hasNoVariableDataset = config.datasource?.execute(DataSource.Operation.IS_UPDATE_REQUIRED, config.hasData);
341
+ if (!config.isLocalFilter && (config.dataoptions || config.datasource?.execute(DataSource.Operation.IS_API_AWARE) && config.searchKey && hasNoVariableDataset)) promise = DataProvider.remoteDataProvider.filter(config);
342
+ else promise = DataProvider.localDataProvider.filter(config);
343
+ return promise.then((response) => {
344
+ this.updateDataset = config.datasource && !config.datasource.execute(DataSource.Operation.SUPPORTS_CRUD) && hasNoVariableDataset;
345
+ this.hasMoreData = response.hasMoreData;
346
+ this.isLastPage = response.isLastPage;
347
+ this.page = response.page;
348
+ this.isPaginatedData = response.isPaginatedData;
349
+ return response;
350
+ });
351
+ }
352
+ };
353
+ const WIDGET_CONFIG = {
354
+ widgetType: "wm-search",
355
+ hostClass: "input-group"
356
+ };
357
+ var SearchComponent = class SearchComponent extends DatasetAwareFormComponent {
358
+ static {
359
+ this.initializeProps = registerProps();
360
+ }
361
+ get typeaheadOptionsLimit() {
362
+ return isDefined(this.limit) ? this.limit : this._dynamicTypeaheadOptionsLimit;
363
+ }
364
+ get datasource() {
365
+ return this._datasource;
366
+ }
367
+ set datasource(nv) {
368
+ this._datasource = nv;
369
+ const data = this.datavalue || this.toBeProcessedDatavalue;
370
+ this.updateByDatavalue(data);
371
+ }
372
+ constructor(inj, app, binddatavalue, binddataset, explicitContext) {
373
+ super(inj, WIDGET_CONFIG, explicitContext);
374
+ this.binddatavalue = binddatavalue;
375
+ this.binddataset = binddataset;
376
+ this.query = "";
377
+ this.page = 1;
378
+ this.allowempty = false;
379
+ this.app = app;
380
+ addClass(this.nativeElement, "app-search", true);
381
+ this.typeaheadDataSource = Observable.create((observer) => {
382
+ if (this.listenQuery) {
383
+ this._defaultQueryInvoked = false;
384
+ this._loadingItems = true;
385
+ observer.next(this.query);
386
+ }
387
+ if (this.lastSelectedIndex) this.typeahead._container = void 0;
388
+ }).pipe(filter(() => {
389
+ this._loadingItems = false;
390
+ return this.minchars === 0 || this.query && this.query.length >= this.minchars;
391
+ }), mergeMap((token) => this.getDataSourceAsObservable(token)));
392
+ this.dataProvider = new DataProvider();
393
+ const datavalueSubscription = this.datavalue$.subscribe((val) => {
394
+ const query = isArray(val) ? val[0] : val;
395
+ if (query === null || query === "") {
396
+ this._modelByValue = "";
397
+ this.query = this.queryModel = "";
398
+ this._lastResult = void 0;
399
+ return;
400
+ }
401
+ if (!this._unsubscribeDv) {
402
+ this._defaultQueryInvoked = false;
403
+ if (!isObject(val) && this.prevDatavalue !== val) {
404
+ this._modelByKey = void 0;
405
+ this.query = this.queryModel = "";
406
+ }
407
+ this.updateByDatavalue(val);
408
+ }
409
+ this.showClosebtn = this.query !== "";
410
+ });
411
+ this.registerDestroyListener(() => datavalueSubscription.unsubscribe());
412
+ const datasetSubscription = this.dataset$.subscribe(() => {
413
+ this.startIndex = this.datasetItems.length;
414
+ this._lastResult = void 0;
415
+ const defaultValue = this.datavalue || this.toBeProcessedDatavalue;
416
+ if (isDefined(defaultValue)) this.updateByDataset(defaultValue);
417
+ });
418
+ this.registerDestroyListener(() => datasetSubscription.unsubscribe());
419
+ }
420
+ clearSearch($event, loadOnClear) {
421
+ this.query = "";
422
+ this.onInputChange($event);
423
+ if (this.dataProvider) this.dataProvider.isLastPage = false;
424
+ this.listenQuery = false;
425
+ if (loadOnClear) {
426
+ this.listenQuery = true;
427
+ this._unsubscribeDv = false;
428
+ this.loadMoreData();
429
+ }
430
+ this.invokeEventCallback("clearsearch");
431
+ this._loadingItems = false;
432
+ if ($event) this.$element.find(".app-search-input").focus();
433
+ }
434
+ clearText() {
435
+ this.query = "";
436
+ this.showClosebtn = false;
437
+ }
438
+ closeSearch() {
439
+ this._loadingItems = false;
440
+ this.page = 1;
441
+ this.insertAtIndex(this.elIndex);
442
+ this.elIndex = void 0;
443
+ this.parentEl = void 0;
444
+ this.$element.removeClass("full-screen");
445
+ if (this._domUpdated) this._domUpdated = false;
446
+ this.listenQuery = false;
447
+ this._unsubscribeDv = true;
448
+ this.typeahead.hide();
449
+ }
450
+ renderMobileAutoComplete() {
451
+ if (!isDefined(this.elIndex)) {
452
+ this.parentEl = this.$element.parent();
453
+ this.elIndex = this.parentEl.children().index(this.$element);
454
+ }
455
+ if (!this.$element.hasClass("full-screen")) {
456
+ this._domUpdated = true;
457
+ this.$element.addClass("full-screen");
458
+ if (this.position === "inline") this.$element.addClass(this.position);
459
+ }
460
+ if (this.$element.hasClass("full-screen")) this.$element.find(".app-search-input").focus();
461
+ }
462
+ getDataSourceAsObservable(query) {
463
+ if (this._lastQuery === query && !get(this.dataoptions, "filterFields") && isDefined(this._lastResult)) {
464
+ this._loadingItems = false;
465
+ return of(this._lastResult);
466
+ }
467
+ if (this.type === "autocomplete" && this.searchkey && this.query && this.datavalue) {
468
+ let bindDisplayLabelArray = [];
469
+ const searchKeyArray = split(this.searchkey, ",");
470
+ let displaylabel;
471
+ if (this.binddisplaylabel) {
472
+ bindDisplayLabelArray = split(this.binddisplaylabel, "+");
473
+ if (bindDisplayLabelArray.length === 1) {
474
+ if (!includes(bindDisplayLabelArray[0], "|")) displaylabel = /\[(.*?)\]/.exec(bindDisplayLabelArray[0])[1];
475
+ else displaylabel = true;
476
+ }
477
+ }
478
+ if (bindDisplayLabelArray.length > 1 || displaylabel && !includes(searchKeyArray, displaylabel) || this.displayexpression && !includes(searchKeyArray, this.displayexpression)) {
479
+ this._loadingItems = false;
480
+ return of([]);
481
+ }
482
+ }
483
+ this._lastQuery = this.query;
484
+ return from(this.getDataSource(query));
485
+ }
486
+ handleEvent(node, eventName, eventCallback, locals) {
487
+ if (!includes([
488
+ "blur",
489
+ "focus",
490
+ "select",
491
+ "submit",
492
+ "change"
493
+ ], eventName)) super.handleEvent(node, eventName, eventCallback, locals);
494
+ }
495
+ highlight(match, query) {
496
+ if (this.typeaheadContainer) {
497
+ match.value = match.item.label.toString();
498
+ return this.typeaheadContainer.highlight(match, query);
499
+ }
500
+ }
501
+ insertAtIndex(i) {
502
+ if (i === 0) this.parentEl.prepend(this.$element);
503
+ else if (this.parentEl.children().eq(i).length) this.$element.insertBefore(this.parentEl.children().eq(i));
504
+ else this.$element.insertAfter(this.parentEl.children().eq(i - 1));
505
+ }
506
+ isMobileAutoComplete() {
507
+ return this.type === "autocomplete" && isMobile();
508
+ }
509
+ isQueryEntered() {
510
+ return this.showclear && this.showClosebtn;
511
+ }
512
+ loadMoreData(incrementPage) {
513
+ if (!this.dataProvider || this.dataProvider.isLastPage) return;
514
+ this.page = incrementPage ? this.page + 1 : this.page;
515
+ this.isScrolled = true;
516
+ this._loadingItems = true;
517
+ if (incrementPage) this._lastQuery = void 0;
518
+ this.typeahead.onInput({ target: { value: trim(this.query) || "0" } });
519
+ }
520
+ onFocusOut() {
521
+ this._unsubscribeDv = false;
522
+ this._loadingItems = false;
523
+ this.page = 1;
524
+ if (!this._domUpdated && this._isOpen) this.listenQuery = false;
525
+ this._isOpen = false;
526
+ if (this._domUpdated && this.typeahead && this.typeahead._container) this.typeahead._container.isFocused = true;
527
+ }
528
+ onInputChange($event) {
529
+ this.result = [];
530
+ this.page = 1;
531
+ this.listenQuery = this.isUpdateOnKeyPress();
532
+ this._modelByValue = void 0;
533
+ if (this.query === "") {
534
+ this.queryModel = "";
535
+ this._modelByValue = "";
536
+ this.updatePrevDatavalue(this._lastQuery);
537
+ this.invokeOnChange(this._modelByValue, {}, true);
538
+ this.invokeEventCallback("clear", { $event });
539
+ if ($event && $event.which !== 9) this.invokeEventCallback("submit", { $event });
540
+ } else this.invokeEventCallback("change", {
541
+ $event,
542
+ newVal: this._modelByValue || this.query,
543
+ oldVal: this.prevDatavalue
544
+ });
545
+ this.showClosebtn = this.query !== "";
546
+ }
547
+ handleEnterEvent($event) {
548
+ if (!get(this.typeahead, "matches.length")) this.onSearchSelect($event);
549
+ }
550
+ onSearchSelect($event) {
551
+ let item;
552
+ const isQueryMatch = this.typeaheadContainer?.active?.value === this.query;
553
+ if (this.typeaheadContainer?.active && isQueryMatch) item = this.typeaheadContainer.active.item;
554
+ $event = this.eventData($event, item || {});
555
+ if (!this.isUpdateOnKeyPress()) {
556
+ this.listenQuery = true;
557
+ this.typeahead.onInput({ target: { value: this.query } });
558
+ return;
559
+ }
560
+ if (this.typeaheadContainer && this.liElements.length && isQueryMatch) this.typeaheadContainer.selectActiveMatch();
561
+ else {
562
+ this.queryModel = this.query;
563
+ this.invokeEventCallback("submit", { $event });
564
+ }
565
+ }
566
+ invokeOnBeforeServiceCall(inputData) {
567
+ this.invokeEventCallback("beforeservicecall", { inputData });
568
+ }
569
+ onDropdownOpen() {
570
+ if (this.clearData) this.typeahead.hide();
571
+ debounce(() => {
572
+ this._isOpen = true;
573
+ this.typeaheadContainer = this.typeahead._container || this.typeahead._typeahead.instance;
574
+ this.typeaheadContainer.liElements = this.liElements;
575
+ this.typeaheadContainer.ulElement = this.ulElement;
576
+ adjustContainerPosition($("typeahead-container"), this.nativeElement, this.typeahead._typeahead, $("typeahead-container .dropdown-menu"));
577
+ })();
578
+ if (this.isMobileAutoComplete()) {
579
+ if (!this.$element.hasClass("full-screen")) this.renderMobileAutoComplete();
580
+ const dropdownEl = this.dropdownEl.closest("typeahead-container");
581
+ dropdownEl.insertAfter(this.$element.find("input").first());
582
+ const screenHeight = this.$element.closest(".app-content").height();
583
+ dropdownEl.css({
584
+ position: "relative",
585
+ top: 0,
586
+ height: screenHeight + "px"
587
+ });
588
+ this.showClosebtn = this.query && this.query !== "";
589
+ if (this.dataProvider && !isUndefined(this.dataProvider.isLastPage) && !this.dataProvider.isLastPage) this.triggerSearch();
590
+ }
591
+ }
592
+ selectNext() {
593
+ const matches = this.typeaheadContainer.matches;
594
+ if (!matches) return;
595
+ const index = matches.indexOf(this.typeaheadContainer.active);
596
+ if (!this._loadingItems && this.dataProvider && !this.dataProvider.isLastPage && index + 1 > matches.length - 1) {
597
+ this.lastSelectedIndex = index;
598
+ this.loadMoreData(true);
599
+ }
600
+ }
601
+ setLastActiveMatchAsSelected() {
602
+ if (this.lastSelectedIndex) {
603
+ this.typeaheadContainer._active = this.typeaheadContainer.matches[this.lastSelectedIndex];
604
+ this.typeaheadContainer.nextActiveMatch();
605
+ this.lastSelectedIndex = void 0;
606
+ }
607
+ }
608
+ triggerSearch() {
609
+ if (!this.dataProvider || this.dataProvider.isLastPage || !this.$element.hasClass("full-screen")) return;
610
+ const typeAheadDropDown = this.dropdownEl;
611
+ const $lastItem = typeAheadDropDown.find("li").last();
612
+ if ($lastItem.length && typeAheadDropDown.length && typeAheadDropDown.height() + typeAheadDropDown.position().top > $lastItem.height() + $lastItem.position().top) this.loadMoreData(true);
613
+ }
614
+ isUpdateOnKeyPress() {
615
+ return this.searchon === "typing";
616
+ }
617
+ debounceDefaultQuery(data) {
618
+ this._defaultQueryInvoked = true;
619
+ this.getDataSource(data, true).then((response) => {
620
+ if (response.length) {
621
+ this.queryModel = response;
622
+ this._lastQuery = this.query = this.queryModel[0].label || "";
623
+ this._modelByValue = this.queryModel[0].value;
624
+ this._modelByKey = this.queryModel[0].key;
625
+ this.showClosebtn = this.query !== "";
626
+ } else {
627
+ this._modelByValue = void 0;
628
+ this.queryModel = void 0;
629
+ this.query = "";
630
+ }
631
+ if (this.clearData) {
632
+ if (get(this.typeahead, "_typeahead.isShown")) this.typeahead.hide();
633
+ }
634
+ });
635
+ }
636
+ updateByDatavalue(data) {
637
+ this.updateByDataset(data);
638
+ this.updateByDataSource(data);
639
+ }
640
+ updateByDataSource(data) {
641
+ if (isDefined(data) && !isObject(data) && this.datasource && !isDefined(this._modelByKey) && this.datafield !== ALLFIELDS) {
642
+ if (isDefined(this.queryModel) && !isEmpty(this.queryModel)) {
643
+ this.updateDatavalueFromQueryModel();
644
+ return;
645
+ }
646
+ if (!this._defaultQueryInvoked && this.datasource.execute(DataSource.Operation.SUPPORTS_CRUD)) this.debounceDefaultQuery(data);
647
+ }
648
+ }
649
+ updateDatavalueFromQueryModel() {
650
+ if (isDefined(this.queryModel)) {
651
+ this._modelByValue = isArray(this.queryModel) ? this.queryModel[0].value : this.queryModel;
652
+ this._modelByKey = isArray(this.queryModel) ? this.queryModel[0].key : this.queryModel;
653
+ this.toBeProcessedDatavalue = void 0;
654
+ }
655
+ }
656
+ updateByDataset(data) {
657
+ if (this._defaultQueryInvoked && this.searchkey) return;
658
+ const selectedItem = find(this.datasetItems, (item) => {
659
+ return isObject(item.value) ? isEqual(item.value, data) : toString(item.value).toLowerCase() === toString(data).toLowerCase();
660
+ });
661
+ if (selectedItem) this.queryModel = [selectedItem];
662
+ else if (this.datafield === ALLFIELDS && isObject(data)) this.queryModel = this.getTransformedData(extractDataAsArray(data));
663
+ else if (this.prevDatavalue !== data) {
664
+ this.queryModel = void 0;
665
+ this.query = "";
666
+ return;
667
+ }
668
+ this.updateDatavalueFromQueryModel();
669
+ this._lastQuery = this.query = isDefined(this.queryModel) && this.queryModel.length ? get(this.queryModel[0], "label") : "";
670
+ this.showClosebtn = this.query !== "";
671
+ }
672
+ handleFocus($event) {
673
+ if (this.type === "search" && this.query === this._lastQuery && this._lastResult) this.typeahead.keyUpEventEmitter.emit(this.query);
674
+ }
675
+ notifySubscriber() {
676
+ const parentEl = $(this.nativeElement).closest(".app-composite-widget.caption-floating");
677
+ if (parentEl.length > 0) this.app.notify("captionPositionAnimate", {
678
+ displayVal: true,
679
+ nativeEl: parentEl
680
+ });
681
+ }
682
+ getDataSource(query, searchOnDataField, nextItemIndex) {
683
+ if (searchOnDataField && this.datafield === ALLFIELDS) {
684
+ this._loadingItems = false;
685
+ return Promise.resolve([]);
686
+ }
687
+ const dataConfig = {
688
+ dataset: this.dataset ? convertDataToObject(this.dataset) : void 0,
689
+ binddataset: this.binddataset,
690
+ datasource: this.datasource,
691
+ datafield: this.datafield,
692
+ hasData: this.dataset?.length,
693
+ query,
694
+ isLocalFilter: !this.searchkey,
695
+ searchKey: searchOnDataField ? this.datafield : this.searchkey,
696
+ matchMode: searchOnDataField ? "startignorecase" : this.matchmode,
697
+ casesensitive: this.casesensitive,
698
+ isformfield: this.isformfield,
699
+ orderby: this.orderby,
700
+ limit: this.limit,
701
+ pagesize: this.pagesize,
702
+ page: this.page,
703
+ onBeforeservicecall: this.invokeOnBeforeServiceCall.bind(this)
704
+ };
705
+ if (this.dataoptions) {
706
+ dataConfig.dataoptions = this.dataoptions;
707
+ dataConfig.viewParent = this.viewParent;
708
+ }
709
+ this._loadingItems = true;
710
+ return this.dataProvider.filter(dataConfig).then((response) => {
711
+ response = response.data || response;
712
+ if (this.dataProvider && (!isDefined(this.dataset) || !this.dataset.length) && this.dataProvider.updateDataset) this.dataset = response;
713
+ if (this.dataProvider?.hasMoreData) this.formattedDataset = this.formattedDataset.concat(response);
714
+ else this.formattedDataset = response;
715
+ if (this.formattedDataset.length > 20 && !isDefined(this.limit)) this._dynamicTypeaheadOptionsLimit = this.formattedDataset.length;
716
+ else this._dynamicTypeaheadOptionsLimit = void 0;
717
+ if (this.dataProvider && this._isOpen && this.isMobileAutoComplete() && !isUndefined(this.dataProvider.isLastPage) && !this.dataProvider.isLastPage) this.triggerSearch();
718
+ const transformedData = this.getTransformedData(this.formattedDataset, nextItemIndex);
719
+ this.result = map(transformedData, "value");
720
+ return transformedData;
721
+ }, (error) => {
722
+ this._loadingItems = false;
723
+ return [];
724
+ }).then((result) => {
725
+ if (this.isScrolled) {
726
+ debounce(() => {
727
+ this.setLastActiveMatchAsSelected();
728
+ }, 30)();
729
+ this.isScrolled = false;
730
+ }
731
+ if (!result.length) {
732
+ this._modelByValue = void 0;
733
+ this.queryModel = query;
734
+ }
735
+ if (this._unsubscribeDv) result = [];
736
+ this._loadingItems = false;
737
+ this._lastResult = result;
738
+ return result;
739
+ });
740
+ }
741
+ getContext(context) {
742
+ if (context && get(context, "widget")) return this.getContext(context.viewParent);
743
+ return context;
744
+ }
745
+ getTransformedData(data, itemIndex, iscustom) {
746
+ if (isDefined(itemIndex)) itemIndex++;
747
+ const transformedData = transformFormData(this.getContext(this.viewParent), data, this.datafield, {
748
+ displayField: this.displaylabel || this.displayfield,
749
+ displayExpr: iscustom ? "" : this.displayexpression,
750
+ bindDisplayExpr: iscustom ? "" : this.binddisplaylabel,
751
+ bindDisplayImgSrc: this.binddisplayimagesrc,
752
+ displayImgSrc: this.displayimagesrc
753
+ }, itemIndex, this);
754
+ return getUniqObjsByDataField(transformedData, this.datafield, this.displayfield || this.displaylabel, toBoolean(this.allowempty));
755
+ }
756
+ onScroll($scrollEl, evt) {
757
+ const totalHeight = $scrollEl.scrollHeight, clientHeight = $scrollEl.clientHeight;
758
+ if (!this._loadingItems && this.dataProvider && !this.dataProvider.isLastPage && $scrollEl.scrollTop + clientHeight >= totalHeight) this.loadMoreData(true);
759
+ }
760
+ ngOnInit() {
761
+ super.ngOnInit();
762
+ if (!isDefined(this.minchars)) {
763
+ if (this.type === "autocomplete") this.minchars = 0;
764
+ else this.minchars = 1;
765
+ }
766
+ this.listenQuery = this.isUpdateOnKeyPress();
767
+ this.showsearchicon = isDefined(this.showsearchicon) ? this.showsearchicon : this.type === "search";
768
+ }
769
+ ngAfterViewInit() {
770
+ super.ngAfterViewInit();
771
+ styler(this.nativeElement, this);
772
+ this.containerTarget = getContainerTargetClass(this.nativeElement);
773
+ }
774
+ ngAfterViewChecked() {
775
+ const searchInputEl = $(".app-search-input");
776
+ if (searchInputEl) searchInputEl.removeAttr("aria-expanded");
777
+ }
778
+ eventData($event, item) {
779
+ if ($event) $event["data"] = {
780
+ item: item.dataObject,
781
+ model: item.value,
782
+ label: item.label,
783
+ query: this.query
784
+ };
785
+ return $event;
786
+ }
787
+ typeaheadOnSelect(match, $event) {
788
+ const item = match.item;
789
+ this.queryModel = item;
790
+ item.selected = true;
791
+ this.query = item.label;
792
+ this.showClosebtn = this.query !== "";
793
+ $event = $event || this.$typeaheadEvent;
794
+ this._modelByKey = item.key;
795
+ this._modelByValue = item.value;
796
+ $event = this.eventData($event, item);
797
+ this.invokeOnTouched();
798
+ this.invokeOnChange(this.datavalue, $event || {});
799
+ if (this.datavalue !== this.prevDatavalue) this.updateBoundVariable(this.datavalue);
800
+ if (this.$element.hasClass("full-screen")) this.closeSearch();
801
+ this.invokeEventCallback("select", {
802
+ $event,
803
+ selectedValue: this.datavalue
804
+ });
805
+ this.invokeEventCallback("submit", { $event });
806
+ this.updatePrevDatavalue(this.datavalue);
807
+ }
808
+ onPropertyChange(key, nv, ov) {
809
+ if (key === "tabindex") return;
810
+ if (this.type === "autocomplete" && key === "displaylabel" && this.displaylabel && (!this.displayexpression || this.displayexpression && !this.datasource)) {
811
+ this.displayexpression = this.displaylabel;
812
+ this.displaylabel = void 0;
813
+ }
814
+ if (key === "displaylabel" && this.dataoptions && this.binddisplaylabel === null) this.query = get(this._modelByValue, nv) || this._modelByValue;
815
+ if (key === "disabled") {
816
+ if (nv === false) this.clearData = false;
817
+ else {
818
+ this.clearData = true;
819
+ if (get(this.typeahead, "_typeahead.isShown")) this.typeahead.hide();
820
+ }
821
+ }
822
+ if (key === "minchars" && this.typeahead && isDefined(nv)) this.typeahead._typeaheadMinLengthValue = nv;
823
+ super.onPropertyChange(key, nv, ov);
824
+ }
825
+ ngOnDestroy() {
826
+ this.liElements = null;
827
+ if (this.dataProvider) this.dataProvider = null;
828
+ if (this.typeahead) this.typeahead = null;
829
+ this.queryModel = null;
830
+ this.query = "";
831
+ super.ngOnDestroy();
832
+ }
833
+ static {
834
+ this.ɵfac = i0.ɵɵngDeclareFactory({
835
+ minVersion: "12.0.0",
836
+ version: "22.2.1",
837
+ ngImport: i0,
838
+ type: SearchComponent,
839
+ deps: [
840
+ { token: i0.Injector },
841
+ { token: i1.App },
842
+ {
843
+ token: "datavalue.bind",
844
+ attribute: true
845
+ },
846
+ {
847
+ token: "dataset.bind",
848
+ attribute: true
849
+ },
850
+ {
851
+ token: "EXPLICIT_CONTEXT",
852
+ optional: true
853
+ }
854
+ ],
855
+ target: i0.ɵɵFactoryTarget.Component
856
+ });
857
+ }
858
+ static {
859
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
860
+ minVersion: "17.0.0",
861
+ version: "22.2.1",
862
+ type: SearchComponent,
863
+ isStandalone: true,
864
+ selector: "[wmSearch]",
865
+ providers: [
866
+ provideAs(SearchComponent, NG_VALUE_ACCESSOR, true),
867
+ provideAs(SearchComponent, NG_VALIDATORS, true),
868
+ provideAsWidgetRef(SearchComponent)
869
+ ],
870
+ viewQueries: [
871
+ {
872
+ propertyName: "typeahead",
873
+ first: true,
874
+ predicate: TypeaheadDirective,
875
+ descendants: true
876
+ },
877
+ {
878
+ propertyName: "ulElement",
879
+ first: true,
880
+ predicate: ["ulElement"],
881
+ descendants: true
882
+ },
883
+ {
884
+ propertyName: "liElements",
885
+ predicate: ["liElements"],
886
+ descendants: true
887
+ }
888
+ ],
889
+ usesInheritance: true,
890
+ ngImport: i0,
891
+ template: "<ng-template #customItemTemplate let-model=\"item\" let-index=\"index\" let-query=\"query\" let-match=\"match\">\n <!-- Default item template -->\n @if (!content) {\n <a>\n @if (model.imgSrc) {\n <img [src]=\"model.imgSrc\" alt=\"Search\" [style.width]=\"imagewidth\">\n }\n <span [title]=\"model.label\" [innerHtml]=\"highlight(match, query) || model.label\"></span>\n </a>\n }\n <!-- Custom partial template -->\n @if (content) {\n <a [ngClass]=\"{customTemplate: content}\" partialContainer [wmItemTemplate]=\"content\" [userComponentParams]=\"match.item\">\n <div partial-container-target></div>\n </a>\n }\n</ng-template>\n\n<ng-template #customListTemplate let-matches=\"matches\" let-itemTemplate=\"itemTemplate\" let-query=\"query\">\n <ul #ulElement class=\"app-search dropdown-menu\" scrollableHandler>\n @for (match of matches; track match; let i = $index) {\n <li #liElements [ngClass]=\"{active: typeaheadContainer && typeaheadContainer.isActive(match), 'list-group-header': match && match.isHeader()}\"\n (mouseenter)=\"typeaheadContainer.selectActive(match);\"\n (click)=\"match && !match.isHeader() && typeaheadContainer.selectMatch(match, $event); $typeaheadEvent = $event; notifySubscriber();\">\n <!-- itemTemplate comes from the <input> -->\n @if (match.isHeader()) {\n <h4 class=\"group-title\">{{match.value}}</h4>\n }\n @if (!match.isHeader()) {\n <ng-container [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{item: match.item, index: i, match: match, query: query}\">\n </ng-container>\n }\n </li>\n }\n <div class=\"status\" [hidden]=\"_loadingItems || !(datacompletemsg && dataProvider?.isLastPage)\">\n <span [textContent]=\"datacompletemsg\"></span>\n </div>\n <div class=\"status\" [hidden]=\"!_loadingItems\">\n <i class=\"fa fa-circle-o-notch fa-spin\"></i>\n <span [textContent]=\"loadingdatamsg\"></span>\n </div>\n </ul>\n</ng-template>\n\n<!--This template is for search inside mobile navbar.-->\n@if (navsearchbar) {\n <input [title]=\"query || ''\" type=\"text\" class=\"app-textbox form-control list-of-objs app-search-input\" [placeholder]=\"placeholder || ''\"\n focus-target\n container=\"body\"\n [disabled]=\"disabled\"\n [attr.accesskey]=\"shortcutkey\"\n autocomplete=\"off\"\n [(ngModel)]=\"query\"\n [ngModelOptions]=\"{standalone: true}\"\n [readonly]=\"readonly\"\n [typeahead]=\"typeaheadDataSource\"\n [typeaheadWaitMs]=\"debouncetime\"\n [typeaheadItemTemplate]=\"customItemTemplate\"\n [optionsListTemplate]=\"customListTemplate\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"listenQuery = true\"\n (keydown.enter)=\"$typeaheadEvent = $event;handleEnterEvent($event)\"\n (keydown.arrowdown)=\"selectNext($event)\"\n (blur)=\"invokeOnTouched($event)\"\n (click)=\"handleFocus($event);\"\n (focus)=\"_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event);\"\n (focusout)=\"onFocusOut()\"\n [typeaheadMinLength]=\"minchars\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit\"\n (typeaheadLoading)=\"_loadingItems\"\n (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n typeaheadOptionField=\"label\"\n [typeaheadGroupField]=\"groupby ? 'groupby' : null\"\n [typeaheadAsync]=\"true\"\n [typeaheadScrollable]=\"true\"\n [adaptivePosition]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionslimitinscrollableview\"\n [dropup]=\"dropup\"\n [tabindex]=\"tabindex\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel || 'Search field'\"/>\n <i class=\"btn-close wi wi-cancel\" [hidden]=\"!showClosebtn\" (click)=\"clearSearch($event);\"></i>\n} @else {\n <button type=\"button\" class=\"btn btn-icon form-control-feedback back-btn\" aria-hidden=\"true\" aria-label=\"Back\" (click)=\"closeSearch()\">\n <wm-app-icon [iconclass]=\"backsearchiconclass\" [iconurl]=\"backsearchiconurl\" alt=\"Back\"></wm-app-icon>\n </button>\n <span class=\"sr-only\">Back button</span>\n <input [title]=\"query || ''\" type=\"text\" class=\"app-textbox form-control list-of-objs app-search-input\" [placeholder]=\"placeholder || ''\"\n focus-target\n [container]=\"containerTarget || '.wm-app'\"\n [disabled]=\"disabled\"\n [attr.accesskey]=\"shortcutkey\"\n autocomplete=\"off\"\n [(ngModel)]=\"query\"\n [ngModelOptions]=\"{standalone: true}\"\n [readonly]=\"readonly\"\n [typeahead]=\"typeaheadDataSource\"\n [typeaheadWaitMs]=\"debouncetime\"\n [typeaheadItemTemplate]=\"customItemTemplate\"\n [optionsListTemplate]=\"customListTemplate\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"listenQuery = true\"\n (keydown.enter)=\"$typeaheadEvent = $event;handleEnterEvent($event)\"\n (keydown.arrowdown)=\"selectNext($event)\"\n (blur)=\"invokeOnTouched($event); onFocusOut()\"\n (click)=\"handleFocus($event);\"\n (focus)=\"_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event)\"\n [typeaheadMinLength]=\"minchars\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit\"\n (typeaheadLoading)=\"_loadingItems\"\n (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n typeaheadOptionField=\"label\"\n [typeaheadGroupField]=\"groupby ? 'groupby' : null\"\n [typeaheadAsync]=\"true\"\n [typeaheadScrollable]=\"true\"\n [adaptivePosition]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionslimitinscrollableview\"\n [tabindex]=\"tabindex\"\n [dropup]=\"dropup\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel || 'Search field'\">\n <input aria-label=\"Search value\" class=\"model-holder\" ng-model=\"proxyModel\" ng-required=\"required\" tabindex=\"-1\" aria-hidden=\"true\">\n @if (_loadingItems) {\n <span aria-hidden=\"true\" class=\"fa fa-circle-o-notch fa-spin form-control-feedback\"></span>\n }\n <button type=\"button\" class=\"btn btn-icon form-control-feedback clear-btn\" aria-label=\"Clear\" [ngClass]=\"{'show-btn': isQueryEntered()}\" (click)=\"clearSearch($event, true)\">\n <wm-app-icon [iconclass]=\"clearsearchiconclass\" [iconurl]=\"clearsearchiconurl\" alt=\"Clear\"></wm-app-icon>\n </button>\n <span class=\"sr-only\">Clear button</span>\n @if (showsearchicon) {\n <span [ngClass]=\"{'disabled': disabled}\" class=\"input-group-addon\">\n <form>\n <button title=\"Search\" [disabled]=\"disabled\" class=\"app-search-button btn btn-icon\" type=\"submit\"\n (click)=\"onSearchSelect($event)\">\n <wm-app-icon [iconclass]=\"searchiconclass\" [iconurl]=\"searchiconurl\" alt=\"Search\"></wm-app-icon>\n </button>\n </form>\n </span>\n }\n }\n <!--This template is for both web and fullscreen mode in mobile.-->\n",
892
+ dependencies: [
893
+ {
894
+ kind: "ngmodule",
895
+ type: CommonModule
896
+ },
897
+ {
898
+ kind: "directive",
899
+ type: i2.NgClass,
900
+ selector: "[ngClass]",
901
+ inputs: ["class", "ngClass"]
902
+ },
903
+ {
904
+ kind: "directive",
905
+ type: i2.NgTemplateOutlet,
906
+ selector: "[ngTemplateOutlet]",
907
+ inputs: [
908
+ "ngTemplateOutletContext",
909
+ "ngTemplateOutlet",
910
+ "ngTemplateOutletInjector"
911
+ ]
912
+ },
913
+ {
914
+ kind: "ngmodule",
915
+ type: FormsModule
916
+ },
917
+ {
918
+ kind: "directive",
919
+ type: i3.ɵNgNoValidate,
920
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
921
+ },
922
+ {
923
+ kind: "directive",
924
+ type: i3.DefaultValueAccessor,
925
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
926
+ },
927
+ {
928
+ kind: "directive",
929
+ type: i3.NgControlStatus,
930
+ selector: "[formControlName],[ngModel],[formControl]"
931
+ },
932
+ {
933
+ kind: "directive",
934
+ type: i3.NgControlStatusGroup,
935
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
936
+ },
937
+ {
938
+ kind: "directive",
939
+ type: i3.NgModel,
940
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
941
+ inputs: [
942
+ "name",
943
+ "disabled",
944
+ "ngModel",
945
+ "ngModelOptions"
946
+ ],
947
+ outputs: ["ngModelChange"],
948
+ exportAs: ["ngModel"]
949
+ },
950
+ {
951
+ kind: "directive",
952
+ type: i3.NgForm,
953
+ selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]",
954
+ inputs: ["ngFormOptions"],
955
+ outputs: ["ngSubmit"],
956
+ exportAs: ["ngForm"]
957
+ },
958
+ {
959
+ kind: "directive",
960
+ type: ScrollableDirective,
961
+ selector: "[scrollableHandler]"
962
+ },
963
+ {
964
+ kind: "ngmodule",
965
+ type: TypeaheadModule
966
+ },
967
+ {
968
+ kind: "directive",
969
+ type: i4.TypeaheadDirective,
970
+ selector: "[typeahead]",
971
+ inputs: [
972
+ "typeahead",
973
+ "typeaheadMinLength",
974
+ "adaptivePosition",
975
+ "isAnimated",
976
+ "typeaheadWaitMs",
977
+ "typeaheadOptionsLimit",
978
+ "typeaheadOptionField",
979
+ "typeaheadGroupField",
980
+ "typeaheadOrderBy",
981
+ "typeaheadAsync",
982
+ "typeaheadLatinize",
983
+ "typeaheadSingleWords",
984
+ "typeaheadWordDelimiters",
985
+ "typeaheadMultipleSearch",
986
+ "typeaheadMultipleSearchDelimiters",
987
+ "typeaheadPhraseDelimiters",
988
+ "typeaheadItemTemplate",
989
+ "optionsListTemplate",
990
+ "typeaheadScrollable",
991
+ "typeaheadOptionsInScrollableView",
992
+ "typeaheadHideResultsOnBlur",
993
+ "typeaheadSelectFirstItem",
994
+ "typeaheadIsFirstItemActive",
995
+ "container",
996
+ "dropup"
997
+ ],
998
+ outputs: [
999
+ "typeaheadLoading",
1000
+ "typeaheadNoResults",
1001
+ "typeaheadOnSelect",
1002
+ "typeaheadOnPreview",
1003
+ "typeaheadOnBlur"
1004
+ ],
1005
+ exportAs: ["bs-typeahead"]
1006
+ },
1007
+ {
1008
+ kind: "directive",
1009
+ type: TextContentDirective,
1010
+ selector: "[textContent]",
1011
+ inputs: ["textContent"]
1012
+ },
1013
+ {
1014
+ kind: "directive",
1015
+ type: ItemTemplateDirective,
1016
+ selector: "[wmItemTemplate]",
1017
+ inputs: ["userComponentParams", "wmItemTemplate"],
1018
+ exportAs: ["itemTemplateRef"]
1019
+ },
1020
+ {
1021
+ kind: "directive",
1022
+ type: PartialParamHandlerDirective,
1023
+ selector: "[partialContainer]"
1024
+ },
1025
+ {
1026
+ kind: "directive",
1027
+ type: PartialContainerDirective,
1028
+ selector: "[partialContainer]"
1029
+ },
1030
+ {
1031
+ kind: "component",
1032
+ type: WmAppIconComponent,
1033
+ selector: "wm-app-icon",
1034
+ inputs: [
1035
+ "icon",
1036
+ "iconclass",
1037
+ "iconurl",
1038
+ "defaultIconClass",
1039
+ "defaultClasses",
1040
+ "iconStyle",
1041
+ "alt"
1042
+ ]
1043
+ }
1044
+ ],
1045
+ changeDetection: i0.ChangeDetectionStrategy.Eager
1046
+ });
1047
+ }
1048
+ };
1049
+ i0.ɵɵngDeclareClassMetadata({
1050
+ minVersion: "12.0.0",
1051
+ version: "22.2.1",
1052
+ ngImport: i0,
1053
+ type: SearchComponent,
1054
+ decorators: [{
1055
+ type: Component,
1056
+ args: [{
1057
+ changeDetection: ChangeDetectionStrategy.Eager,
1058
+ standalone: true,
1059
+ imports: [
1060
+ CommonModule,
1061
+ FormsModule,
1062
+ ScrollableDirective,
1063
+ TypeaheadModule,
1064
+ TextContentDirective,
1065
+ ItemTemplateDirective,
1066
+ PartialParamHandlerDirective,
1067
+ PartialContainerDirective,
1068
+ WmAppIconComponent
1069
+ ],
1070
+ selector: "[wmSearch]",
1071
+ providers: [
1072
+ provideAs(SearchComponent, NG_VALUE_ACCESSOR, true),
1073
+ provideAs(SearchComponent, NG_VALIDATORS, true),
1074
+ provideAsWidgetRef(SearchComponent)
1075
+ ],
1076
+ template: "<ng-template #customItemTemplate let-model=\"item\" let-index=\"index\" let-query=\"query\" let-match=\"match\">\n <!-- Default item template -->\n @if (!content) {\n <a>\n @if (model.imgSrc) {\n <img [src]=\"model.imgSrc\" alt=\"Search\" [style.width]=\"imagewidth\">\n }\n <span [title]=\"model.label\" [innerHtml]=\"highlight(match, query) || model.label\"></span>\n </a>\n }\n <!-- Custom partial template -->\n @if (content) {\n <a [ngClass]=\"{customTemplate: content}\" partialContainer [wmItemTemplate]=\"content\" [userComponentParams]=\"match.item\">\n <div partial-container-target></div>\n </a>\n }\n</ng-template>\n\n<ng-template #customListTemplate let-matches=\"matches\" let-itemTemplate=\"itemTemplate\" let-query=\"query\">\n <ul #ulElement class=\"app-search dropdown-menu\" scrollableHandler>\n @for (match of matches; track match; let i = $index) {\n <li #liElements [ngClass]=\"{active: typeaheadContainer && typeaheadContainer.isActive(match), 'list-group-header': match && match.isHeader()}\"\n (mouseenter)=\"typeaheadContainer.selectActive(match);\"\n (click)=\"match && !match.isHeader() && typeaheadContainer.selectMatch(match, $event); $typeaheadEvent = $event; notifySubscriber();\">\n <!-- itemTemplate comes from the <input> -->\n @if (match.isHeader()) {\n <h4 class=\"group-title\">{{match.value}}</h4>\n }\n @if (!match.isHeader()) {\n <ng-container [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{item: match.item, index: i, match: match, query: query}\">\n </ng-container>\n }\n </li>\n }\n <div class=\"status\" [hidden]=\"_loadingItems || !(datacompletemsg && dataProvider?.isLastPage)\">\n <span [textContent]=\"datacompletemsg\"></span>\n </div>\n <div class=\"status\" [hidden]=\"!_loadingItems\">\n <i class=\"fa fa-circle-o-notch fa-spin\"></i>\n <span [textContent]=\"loadingdatamsg\"></span>\n </div>\n </ul>\n</ng-template>\n\n<!--This template is for search inside mobile navbar.-->\n@if (navsearchbar) {\n <input [title]=\"query || ''\" type=\"text\" class=\"app-textbox form-control list-of-objs app-search-input\" [placeholder]=\"placeholder || ''\"\n focus-target\n container=\"body\"\n [disabled]=\"disabled\"\n [attr.accesskey]=\"shortcutkey\"\n autocomplete=\"off\"\n [(ngModel)]=\"query\"\n [ngModelOptions]=\"{standalone: true}\"\n [readonly]=\"readonly\"\n [typeahead]=\"typeaheadDataSource\"\n [typeaheadWaitMs]=\"debouncetime\"\n [typeaheadItemTemplate]=\"customItemTemplate\"\n [optionsListTemplate]=\"customListTemplate\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"listenQuery = true\"\n (keydown.enter)=\"$typeaheadEvent = $event;handleEnterEvent($event)\"\n (keydown.arrowdown)=\"selectNext($event)\"\n (blur)=\"invokeOnTouched($event)\"\n (click)=\"handleFocus($event);\"\n (focus)=\"_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event);\"\n (focusout)=\"onFocusOut()\"\n [typeaheadMinLength]=\"minchars\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit\"\n (typeaheadLoading)=\"_loadingItems\"\n (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n typeaheadOptionField=\"label\"\n [typeaheadGroupField]=\"groupby ? 'groupby' : null\"\n [typeaheadAsync]=\"true\"\n [typeaheadScrollable]=\"true\"\n [adaptivePosition]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionslimitinscrollableview\"\n [dropup]=\"dropup\"\n [tabindex]=\"tabindex\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel || 'Search field'\"/>\n <i class=\"btn-close wi wi-cancel\" [hidden]=\"!showClosebtn\" (click)=\"clearSearch($event);\"></i>\n} @else {\n <button type=\"button\" class=\"btn btn-icon form-control-feedback back-btn\" aria-hidden=\"true\" aria-label=\"Back\" (click)=\"closeSearch()\">\n <wm-app-icon [iconclass]=\"backsearchiconclass\" [iconurl]=\"backsearchiconurl\" alt=\"Back\"></wm-app-icon>\n </button>\n <span class=\"sr-only\">Back button</span>\n <input [title]=\"query || ''\" type=\"text\" class=\"app-textbox form-control list-of-objs app-search-input\" [placeholder]=\"placeholder || ''\"\n focus-target\n [container]=\"containerTarget || '.wm-app'\"\n [disabled]=\"disabled\"\n [attr.accesskey]=\"shortcutkey\"\n autocomplete=\"off\"\n [(ngModel)]=\"query\"\n [ngModelOptions]=\"{standalone: true}\"\n [readonly]=\"readonly\"\n [typeahead]=\"typeaheadDataSource\"\n [typeaheadWaitMs]=\"debouncetime\"\n [typeaheadItemTemplate]=\"customItemTemplate\"\n [optionsListTemplate]=\"customListTemplate\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"listenQuery = true\"\n (keydown.enter)=\"$typeaheadEvent = $event;handleEnterEvent($event)\"\n (keydown.arrowdown)=\"selectNext($event)\"\n (blur)=\"invokeOnTouched($event); onFocusOut()\"\n (click)=\"handleFocus($event);\"\n (focus)=\"_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event)\"\n [typeaheadMinLength]=\"minchars\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit\"\n (typeaheadLoading)=\"_loadingItems\"\n (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n typeaheadOptionField=\"label\"\n [typeaheadGroupField]=\"groupby ? 'groupby' : null\"\n [typeaheadAsync]=\"true\"\n [typeaheadScrollable]=\"true\"\n [adaptivePosition]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionslimitinscrollableview\"\n [tabindex]=\"tabindex\"\n [dropup]=\"dropup\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel || 'Search field'\">\n <input aria-label=\"Search value\" class=\"model-holder\" ng-model=\"proxyModel\" ng-required=\"required\" tabindex=\"-1\" aria-hidden=\"true\">\n @if (_loadingItems) {\n <span aria-hidden=\"true\" class=\"fa fa-circle-o-notch fa-spin form-control-feedback\"></span>\n }\n <button type=\"button\" class=\"btn btn-icon form-control-feedback clear-btn\" aria-label=\"Clear\" [ngClass]=\"{'show-btn': isQueryEntered()}\" (click)=\"clearSearch($event, true)\">\n <wm-app-icon [iconclass]=\"clearsearchiconclass\" [iconurl]=\"clearsearchiconurl\" alt=\"Clear\"></wm-app-icon>\n </button>\n <span class=\"sr-only\">Clear button</span>\n @if (showsearchicon) {\n <span [ngClass]=\"{'disabled': disabled}\" class=\"input-group-addon\">\n <form>\n <button title=\"Search\" [disabled]=\"disabled\" class=\"app-search-button btn btn-icon\" type=\"submit\"\n (click)=\"onSearchSelect($event)\">\n <wm-app-icon [iconclass]=\"searchiconclass\" [iconurl]=\"searchiconurl\" alt=\"Search\"></wm-app-icon>\n </button>\n </form>\n </span>\n }\n }\n <!--This template is for both web and fullscreen mode in mobile.-->\n"
1077
+ }]
1078
+ }],
1079
+ ctorParameters: () => [
1080
+ { type: i0.Injector },
1081
+ { type: i1.App },
1082
+ {
1083
+ type: void 0,
1084
+ decorators: [{
1085
+ type: Attribute,
1086
+ args: ["datavalue.bind"]
1087
+ }]
1088
+ },
1089
+ {
1090
+ type: void 0,
1091
+ decorators: [{
1092
+ type: Attribute,
1093
+ args: ["dataset.bind"]
1094
+ }]
1095
+ },
1096
+ {
1097
+ type: void 0,
1098
+ decorators: [{
1099
+ type: Inject,
1100
+ args: ["EXPLICIT_CONTEXT"]
1101
+ }, { type: Optional }]
1102
+ }
1103
+ ],
1104
+ propDecorators: {
1105
+ typeahead: [{
1106
+ type: ViewChild,
1107
+ args: [TypeaheadDirective]
1108
+ }],
1109
+ ulElement: [{
1110
+ type: ViewChild,
1111
+ args: ["ulElement"]
1112
+ }],
1113
+ liElements: [{
1114
+ type: ViewChildren,
1115
+ args: ["liElements"]
1116
+ }]
1117
+ }
1118
+ });
1086
1119
  export { ScrollableDirective, SearchComponent };
1087
- //# sourceMappingURL=index.mjs.map
1120
+
1121
+ //# sourceMappingURL=index.mjs.map