@wavemaker-ai/app-ng-runtime 12.0.2-rc.344 → 12.1.0-rc.347

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,729 +1,712 @@
1
- import * as i1 from '@angular/common';
2
- import { CommonModule } from '@angular/common';
3
- import * as i0 from '@angular/core';
4
- import { ViewChild, Attribute, Inject, Optional, Component } from '@angular/core';
5
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
6
- import { FormWidgetType, isDefined, debounce, $unwatch, $watch, $appDigest, toBoolean, isAppleProduct } from '@wm/core';
7
- import { PROP_BOOLEAN, PROP_STRING, PROP_ANY, PROP_NUMBER, register, registerFormWidget, styler, getConditionalClasses, getUniqObjsByDataField, ALLFIELDS, configureDnD, TextContentDirective, provideAs, provideAsWidgetRef } from '@wm/components/base';
8
- import { DatasetAwareFormComponent } from '@wm/components/input/dataset-aware-form';
9
- import { SearchComponent } from '@wm/components/basic/search';
10
- import { forEach, clone, slice, find, isObject, isEqual, toString, trim, findIndex, filter, isArray, max, reduce, pullAt } from 'lodash-es';
11
-
12
- const chipsProps = new Map([
13
- ['allowonlyselect', PROP_BOOLEAN],
14
- ['autofocus', PROP_BOOLEAN],
15
- ['chipclass', PROP_STRING],
16
- ['class', PROP_STRING],
17
- ['compareby', PROP_STRING],
18
- ['datafield', PROP_STRING],
19
- ['dataoptions', PROP_ANY],
20
- ['dataset', { value: 'Option 1, Option 2, Option 3', ...PROP_ANY }],
21
- ['datasource', PROP_ANY],
22
- ['datavalue', PROP_ANY],
23
- ['datavaluesource', PROP_ANY],
24
- ['dateformat', PROP_STRING],
25
- ['disabled', PROP_BOOLEAN],
26
- ['displayexpression', PROP_STRING],
27
- ['displayfield', PROP_STRING],
28
- ['displayimagesrc', PROP_STRING],
29
- ['enablereorder', PROP_BOOLEAN],
30
- ['groupby', PROP_STRING],
31
- ['inputposition', { value: 'last', ...PROP_STRING }],
32
- ['inputwidth', { value: 'default', ...PROP_STRING }],
33
- ['limit', PROP_NUMBER],
34
- ['loadingdatamsg', { value: 'Loading items...', ...PROP_STRING }],
35
- ['match', PROP_STRING],
36
- ['matchmode', PROP_STRING],
37
- ['maxsize', PROP_NUMBER],
38
- ['minchars', { value: 1, ...PROP_NUMBER }],
39
- ['name', PROP_STRING],
40
- ['navsearchbar', { value: false, ...PROP_BOOLEAN }],
41
- ['orderby', PROP_STRING],
42
- ['placeholder', { value: 'Type here..', ...PROP_STRING }],
43
- ['query', PROP_STRING],
44
- ['readonly', PROP_BOOLEAN],
45
- ['searchkey', PROP_STRING],
46
- ['shortcutkey', PROP_STRING],
47
- ['show', { value: true, ...PROP_BOOLEAN }],
48
- ['showsearchicon', PROP_BOOLEAN],
49
- ['tabindex', { value: 0, ...PROP_NUMBER }],
50
- ['type', { value: 'search', ...PROP_STRING }],
51
- ['debouncetime', { value: 250, ...PROP_NUMBER }],
52
- ['datacompletemsg', { value: 'No more data to load', ...PROP_STRING }],
1
+ import * as i1 from "@angular/common";
2
+ import { CommonModule } from "@angular/common";
3
+ import * as i0 from "@angular/core";
4
+ import { Attribute, ChangeDetectionStrategy, Component, Inject, Optional, ViewChild } from "@angular/core";
5
+ import { NG_VALUE_ACCESSOR } from "@angular/forms";
6
+ import { $appDigest, $unwatch, $watch, FormWidgetType, debounce, isAppleProduct, isDefined, toBoolean } from "@wm/core";
7
+ import { ALLFIELDS, PROP_ANY, PROP_BOOLEAN, PROP_NUMBER, PROP_STRING, TextContentDirective, configureDnD, getConditionalClasses, getUniqObjsByDataField, provideAs, provideAsWidgetRef, register, registerFormWidget, styler } from "@wm/components/base";
8
+ import { DatasetAwareFormComponent } from "@wm/components/input/dataset-aware-form";
9
+ import { SearchComponent } from "@wm/components/basic/search";
10
+ import { clone, filter, find, findIndex, forEach, isArray, isEqual, isObject, max, pullAt, reduce, slice, toString, trim } from "lodash-es";
11
+ const chipsProps = /* @__PURE__ */ new Map([
12
+ ["allowonlyselect", PROP_BOOLEAN],
13
+ ["autofocus", PROP_BOOLEAN],
14
+ ["chipclass", PROP_STRING],
15
+ ["class", PROP_STRING],
16
+ ["compareby", PROP_STRING],
17
+ ["datafield", PROP_STRING],
18
+ ["dataoptions", PROP_ANY],
19
+ ["dataset", {
20
+ value: "Option 1, Option 2, Option 3",
21
+ ...PROP_ANY
22
+ }],
23
+ ["datasource", PROP_ANY],
24
+ ["datavalue", PROP_ANY],
25
+ ["datavaluesource", PROP_ANY],
26
+ ["dateformat", PROP_STRING],
27
+ ["disabled", PROP_BOOLEAN],
28
+ ["displayexpression", PROP_STRING],
29
+ ["displayfield", PROP_STRING],
30
+ ["displayimagesrc", PROP_STRING],
31
+ ["enablereorder", PROP_BOOLEAN],
32
+ ["groupby", PROP_STRING],
33
+ ["inputposition", {
34
+ value: "last",
35
+ ...PROP_STRING
36
+ }],
37
+ ["inputwidth", {
38
+ value: "default",
39
+ ...PROP_STRING
40
+ }],
41
+ ["limit", PROP_NUMBER],
42
+ ["loadingdatamsg", {
43
+ value: "Loading items...",
44
+ ...PROP_STRING
45
+ }],
46
+ ["match", PROP_STRING],
47
+ ["matchmode", PROP_STRING],
48
+ ["maxsize", PROP_NUMBER],
49
+ ["minchars", {
50
+ value: 1,
51
+ ...PROP_NUMBER
52
+ }],
53
+ ["name", PROP_STRING],
54
+ ["navsearchbar", {
55
+ value: false,
56
+ ...PROP_BOOLEAN
57
+ }],
58
+ ["orderby", PROP_STRING],
59
+ ["placeholder", {
60
+ value: "Type here..",
61
+ ...PROP_STRING
62
+ }],
63
+ ["query", PROP_STRING],
64
+ ["readonly", PROP_BOOLEAN],
65
+ ["searchkey", PROP_STRING],
66
+ ["shortcutkey", PROP_STRING],
67
+ ["show", {
68
+ value: true,
69
+ ...PROP_BOOLEAN
70
+ }],
71
+ ["showsearchicon", PROP_BOOLEAN],
72
+ ["tabindex", {
73
+ value: 0,
74
+ ...PROP_NUMBER
75
+ }],
76
+ ["type", {
77
+ value: "search",
78
+ ...PROP_STRING
79
+ }],
80
+ ["debouncetime", {
81
+ value: 250,
82
+ ...PROP_NUMBER
83
+ }],
84
+ ["datacompletemsg", {
85
+ value: "No more data to load",
86
+ ...PROP_STRING
87
+ }]
53
88
  ]);
54
89
  const registerProps = () => {
55
- register('wm-chips', chipsProps);
56
- registerFormWidget(FormWidgetType.CHIPS, new Map(chipsProps));
90
+ register("wm-chips", chipsProps);
91
+ registerFormWidget(FormWidgetType.CHIPS, new Map(chipsProps));
57
92
  };
58
-
59
93
  const WIDGET_CONFIG = {
60
- widgetType: 'wm-chips',
61
- hostClass: 'app-chips nav nav-pills list-inline'
94
+ widgetType: "wm-chips",
95
+ hostClass: "app-chips nav nav-pills list-inline"
62
96
  };
63
- class ChipsComponent extends DatasetAwareFormComponent {
64
- static { this.initializeProps = registerProps(); }
65
- // getter setter is added to pass the datasource to searchcomponent.
66
- get datasource() {
67
- return this._datasource;
68
- }
69
- set datasource(nv) {
70
- this._datasource = nv;
71
- this.searchComponent.datasource = nv;
72
- if (this._debounceUpdateQueryModel) {
73
- this._debounceUpdateQueryModel(this.datavalue || this.toBeProcessedDatavalue);
74
- }
75
- }
76
- constructor(inj, bindDisplayField, bindDisplayExpr, bindDisplayImgSrc, bindDataField, bindDataSet, bindChipclass, explicitContext) {
77
- super(inj, WIDGET_CONFIG, explicitContext);
78
- this.bindDisplayField = bindDisplayField;
79
- this.bindDisplayExpr = bindDisplayExpr;
80
- this.bindDisplayImgSrc = bindDisplayImgSrc;
81
- this.bindDataField = bindDataField;
82
- this.bindDataSet = bindDataSet;
83
- this.bindChipclass = bindChipclass;
84
- this.chipsList = [];
85
- this.maxSizeReached = 'Max size reached';
86
- this._unsubscribeDv = false;
87
- this._debounceUpdateQueryModel = null;
88
- styler(this.nativeElement, this);
89
- // set the showsearchicon as false by default.
90
- if (!isDefined(this.showsearchicon)) {
91
- this.showsearchicon = false;
92
- }
93
- this.multiple = true;
94
- this.nextItemIndex = 0; // default chip index
95
- this._debounceUpdateQueryModel = debounce((val) => {
96
- this.updateQueryModel(val).then(() => {
97
- if (this.bindChipclass) {
98
- forEach(this.chipsList, (item, index) => {
99
- this.registerChipItemClass(item, index);
100
- });
101
- }
102
- });
103
- }, 150);
104
- const datasetSubscription = this.dataset$.subscribe(() => {
105
- this.searchComponent.dataset = this.dataset;
106
- // clearing the last results when dataset is reassigned
107
- this.searchComponent._lastResult = undefined;
108
- this.nextItemIndex = this.datasetItems.length;
109
- if (this._debounceUpdateQueryModel) {
110
- this._debounceUpdateQueryModel(this.datavalue || this.toBeProcessedDatavalue);
111
- }
112
- });
113
- this.registerDestroyListener(() => datasetSubscription.unsubscribe());
114
- const datavalueSubscription = this.datavalue$.subscribe((val) => {
115
- // update queryModel only when parentRef is available.
116
- if (!this._unsubscribeDv) {
117
- this.chipsList = [];
118
- // if the datafield is ALLFILEDS do not fetch the records
119
- // update the query model with the values we have
120
- if (this._debounceUpdateQueryModel) {
121
- this._debounceUpdateQueryModel(val);
122
- }
123
- }
124
- });
125
- this.registerDestroyListener(() => datavalueSubscription.unsubscribe());
126
- }
127
- ngOnInit() {
128
- super.ngOnInit();
129
- this.searchComponent.multiple = true;
130
- this.searchComponent.binddisplayimagesrc = this.bindDisplayImgSrc;
131
- this.searchComponent.displayimagesrc = this.displayimagesrc;
132
- this.searchComponent.binddisplaylabel = this.bindDisplayExpr;
133
- this.searchComponent.displaylabel = this.displayfield;
134
- this.searchComponent.datafield = this.bindDataField || this.datafield;
135
- this.searchComponent.binddataset = this.bindDataSet;
136
- this.searchComponent.dataset = this.dataset;
137
- this.searchComponent.searchkey = this.searchkey;
138
- this.searchComponent.limit = this.limit;
139
- this.searchComponent.debouncetime = this.debouncetime;
140
- this.searchComponent.matchmode = this.matchmode;
141
- this.getTransformedData = (val, isCustom) => {
142
- return this.searchComponent.getTransformedData([val], this.nextItemIndex++, isCustom);
143
- };
144
- }
145
- ngAfterViewInit() {
146
- super.ngAfterViewInit();
147
- if (this.enablereorder) {
148
- this.configureDnD();
149
- }
150
- }
151
- /**
152
- * This method returns the evaluated class expression.
153
- * @param $index index of the chip
154
- * @param item chip object containing the key, value, label
155
- * @returns {any} evaluated class expression value
156
- */
157
- registerChipItemClass(item, $index) {
158
- if (this.bindChipclass) {
159
- const watchName = `${this.widgetId}_chipItemClass_${$index}`;
160
- $unwatch(watchName);
161
- //[Todo-CSP]: same as list item class
162
- this.registerDestroyListener($watch(this.bindChipclass, this.viewParent, { item, $index }, (nv, ov) => {
163
- this.applyItemClass(getConditionalClasses(nv, ov), $index);
164
- }, watchName));
165
- }
166
- }
167
- applyItemClass(val, index) {
168
- const chipItems = this.nativeElement.querySelectorAll('.chip-item');
169
- const chipItem = chipItems.item(index);
170
- if (chipItem) {
171
- $(chipItem).removeClass(val.toRemove).addClass(val.toAdd);
172
- return;
173
- }
174
- setTimeout(() => {
175
- const retryChip = this.nativeElement.querySelectorAll('.chip-item').item(index);
176
- if (retryChip) {
177
- $(retryChip).removeClass(val.toRemove).addClass(val.toAdd);
178
- }
179
- }, 50);
180
- }
181
- removeDuplicates() {
182
- this.chipsList = getUniqObjsByDataField(this.chipsList, this.datafield, this.displayfield || this.displaylabel);
183
- }
184
- // This method updates the queryModel.
185
- // default call to get the default data can be done only when defaultQuery is true.
186
- updateQueryModel(data) {
187
- const promises = [];
188
- if (!data) {
189
- this.chipsList = [];
190
- return Promise.resolve();
191
- }
192
- // clone the data as the updations on data will change the datavalue.
193
- let dataValue = clone(data);
194
- const prevChipsList = this.chipsList;
195
- this.chipsList = [];
196
- // update the model when model has items more than maxsize
197
- if (this.maxsize && dataValue.length > this.maxsize) {
198
- this._modelByValue = dataValue = slice(dataValue, 0, this.maxsize);
199
- data = dataValue;
200
- }
201
- const searchQuery = [];
202
- /**
203
- * For each value in datavalue,
204
- * 1. check whether value is in datasetItems, if item is found, addd to the chipsList.
205
- * 2. else make a default query to the filter and get the record.
206
- * 3. In step 2, if datavalue is not ALLFIELDS, then make a query. Extract the chipsList from the query response.
207
- * 4. If there is no response for the value and allowonlyselect is true, remove the value from the datavalue. So that datavalue just contains the valid values.
208
- * 5. In step 2, if datavalue is ALLFIELDS and value is object, then just prepare the datasetItem from the value.
209
- * 6. If value is not object and allowonlyselect is false, then create a customModel and replace this value with customModel and prepare datasetItem from this value
210
- */
211
- dataValue.forEach((val, i) => {
212
- const itemFound = find(this.datasetItems, item => {
213
- return isObject(item.value) ? isEqual(item.value, val) : toString(item.value) === toString(val);
214
- });
215
- if (itemFound) {
216
- this.chipsList.push(itemFound);
217
- }
218
- else if (this.datafield !== ALLFIELDS) {
219
- searchQuery.push(val);
220
- }
221
- else if (this.datafield === ALLFIELDS) {
222
- let dataObj, isCustom = false;
223
- if (!isObject(val)) {
224
- dataObj = this.createCustomDataModel(val);
225
- isCustom = true;
226
- if (dataObj) {
227
- data.splice(i, 1, dataObj);
228
- }
229
- }
230
- else {
231
- // if custom chips is already generated, val will be object as {'dataField_val': 'entered_val'}
232
- // Hence check this val in previous chipList and assign the iscustom flag
233
- const prevChipObj = prevChipsList.find(obj => {
234
- return isEqual(obj.value, val);
235
- });
236
- if (prevChipObj) {
237
- isCustom = prevChipObj.iscustom;
238
- }
239
- }
240
- dataObj = dataObj || val;
241
- const transformedData = this.getTransformedData(dataObj, isCustom);
242
- const chipObj = transformedData[0];
243
- if (isCustom) {
244
- chipObj.iscustom = isCustom;
245
- }
246
- this.chipsList.push(chipObj);
247
- }
248
- });
249
- // make default query with all the values and if response for the value is not in datavalue then add a custom chip object.
250
- if (searchQuery.length) {
251
- promises.push(this.getDefaultModel(searchQuery, this.nextItemIndex)
252
- .then(response => {
253
- this.chipsList = this.chipsList.concat(response || []);
254
- dataValue.forEach((val, i) => {
255
- const isExists = find(this.chipsList, (obj) => {
256
- return obj.value.toString() === val.toString();
257
- });
258
- if (!isExists) {
259
- if (this.allowonlyselect) {
260
- const index = data.indexOf(val);
261
- if (index > -1) {
262
- data.splice(index, 1);
263
- }
264
- return;
265
- }
266
- const transformedData = this.getTransformedData(val, true);
267
- const chipObj = transformedData[0];
268
- chipObj.iscustom = true;
269
- this.chipsList.push(chipObj);
270
- }
271
- });
272
- }));
273
- }
274
- // default chip data is adding focus on to the search input. Hence this flag helps not to focus.
275
- this.resetSearchModel(true);
276
- return Promise.all(promises).then(() => {
277
- this._modelByValue = data;
278
- this.removeDuplicates();
279
- this.updateMaxSize();
280
- $appDigest();
281
- });
282
- }
283
- resetSearchModel(defaultQuery) {
284
- this._unsubscribeDv = true;
285
- // clear search will empty the query model and gets the data when minchars is 0 (i.e. autocomplete) on focus
286
- // defaultQuery flag is set when widget is not active. This will only load the autocomplete dropup with minchars as 0 when widget is focused/active
287
- this.searchComponent.clearSearch(undefined, !this.minchars && !defaultQuery);
288
- this._unsubscribeDv = false;
289
- }
290
- // Add the newItem to the list
291
- addItem($event, widget) {
292
- const searchComponent = widget;
293
- let allowAdd;
294
- let chipObj;
295
- if (searchComponent && isDefined(searchComponent.datavalue) && searchComponent.queryModel !== '') {
296
- if (!searchComponent.query || !trim(searchComponent.query)) {
297
- return;
298
- }
299
- chipObj = searchComponent.queryModel;
300
- }
301
- else {
302
- if (this.allowonlyselect) {
303
- return;
304
- }
305
- let dataObj;
306
- if (this.datafield === ALLFIELDS) {
307
- if (!isObject(this.searchComponent.query) && trim(this.searchComponent.query)) {
308
- dataObj = this.createCustomDataModel(this.searchComponent.query);
309
- // return if the custom chip is empty
310
- if (!dataObj) {
311
- this.resetSearchModel();
312
- return;
313
- }
314
- }
315
- }
316
- const data = dataObj || trim(this.searchComponent.query);
317
- if (data) {
318
- const transformedData = this.getTransformedData(data, true);
319
- chipObj = transformedData[0];
320
- chipObj.iscustom = true;
321
- }
322
- }
323
- if (!isDefined(chipObj) || chipObj === '') {
324
- return;
325
- }
326
- allowAdd = this.invokeEventCallback('beforeadd', { $event, newItem: chipObj });
327
- if (isDefined(allowAdd) && !toBoolean(allowAdd)) {
328
- return;
329
- }
330
- if (this.isDuplicate(chipObj)) {
331
- this.resetSearchModel();
332
- return;
333
- }
334
- this.registerChipItemClass(chipObj, this.chipsList.length);
335
- this.chipsList.push(chipObj);
336
- if (!this.datavalue) {
337
- this._modelByValue = [chipObj.value];
338
- }
339
- else {
340
- this._modelByValue = [...this._modelByValue, chipObj.value];
341
- }
342
- this._unsubscribeDv = true;
343
- this.invokeOnTouched();
344
- this.invokeOnChange(this._modelByValue, $event || {}, true);
345
- this.invokeEventCallback('add', { $event, $item: chipObj });
346
- this.updateMaxSize();
347
- // reset input box when item is added.
348
- this.resetSearchModel();
349
- // stop the event to not to call the submit event on enter press.
350
- if ($event && ($event.key === 'Enter' || $event.keyCode === 13)) {
351
- this.stopEvent($event);
352
- }
353
- }
354
- // Prepare datavalue object from a string(junk) value when datafield is allFields.
355
- createCustomDataModel(val) {
356
- const key = this.displayfield || (this.datafield !== ALLFIELDS ? this.datafield : undefined);
357
- if (key) {
358
- const customObj = {};
359
- customObj[key] = val;
360
- return customObj;
361
- }
362
- }
363
- // Check if newItem already exists
364
- isDuplicate(item) {
365
- if (this.datafield === ALLFIELDS) {
366
- return findIndex(this.chipsList, { value: item.value }) > -1;
367
- }
368
- return findIndex(this.chipsList, { key: item.key }) > -1;
369
- }
370
- // Check if max size is reached
371
- updateMaxSize() {
372
- this.saturate = this.maxsize > 0 && this.chipsList.length === this.maxsize;
373
- }
374
- // Makes call to searchComponent to filter the dataSource based on the query.
375
- getDefaultModel(query, index) {
376
- this.nextItemIndex++;
377
- return this.searchComponent.getDataSource(query, true, index)
378
- .then((response) => {
379
- // @ts-ignore
380
- return filter(query, queryVal => {
381
- find(response, { value: queryVal });
382
- });
383
- });
384
- }
385
- handleChipClick($event, chip) {
386
- if (this.readonly) {
387
- return;
388
- }
389
- $event.currentTarget.focus();
390
- this.invokeEventCallback('chipclick', { $event, $item: chip });
391
- }
392
- handleChipFocus($event, chip) {
393
- if (this.readonly) {
394
- return;
395
- }
396
- chip.active = true;
397
- this.invokeEventCallback('chipselect', { $event, $item: chip });
398
- }
399
- // To avoid form submit on pressing enter key
400
- stopEvent($event) {
401
- const inputValue = $event.target?.value ?? '';
402
- if (inputValue.trim()) {
403
- $event.stopPropagation();
404
- $event.preventDefault();
405
- }
406
- }
407
- onTextDelete($event) {
408
- if (isAppleProduct) {
409
- this.onInputClear($event);
410
- }
411
- }
412
- onInputClear($event) {
413
- if (!this.chipsList?.length || this.searchComponent.query) {
414
- return;
415
- }
416
- this.$element.find('li.chip-item > a.app-chip').last().focus();
417
- this.stopEvent($event);
418
- }
419
- onBackspace($event, $item, $index) {
420
- if (this.readonly) {
421
- return;
422
- }
423
- this.removeItem($event, $item, $index, true);
424
- }
425
- onDelete($event, $item, $index) {
426
- if (this.readonly) {
427
- return;
428
- }
429
- this.removeItem($event, $item, $index);
430
- }
431
- onArrowLeft($item, $index) {
432
- if (this.readonly) {
433
- return;
434
- }
435
- // On left arrow click when search input query is empty.
436
- if (!this.searchComponent.query && !isDefined($index) && !isDefined($item)) {
437
- this.$element.find('li.chip-item > a.app-chip').last().focus();
438
- return;
439
- }
440
- if ($index > 0) {
441
- this.$element.find('li.chip-item > a.app-chip').get($index - 1).focus();
442
- }
443
- else {
444
- this.focusSearchBox();
445
- }
446
- }
447
- onArrowRight($item, $index) {
448
- if (this.readonly) {
449
- return;
450
- }
451
- // On right arrow click when search input query is empty.
452
- if (!this.searchComponent.query && !isDefined($index) && !isDefined($item)) {
453
- this.$element.find('li.chip-item > a.app-chip').first().focus();
454
- return;
455
- }
456
- if ($index < (this.chipsList.length - 1)) {
457
- this.$element.find('li.chip-item > a.app-chip').get($index + 1).focus();
458
- }
459
- else {
460
- this.focusSearchBox();
461
- }
462
- }
463
- // focus search box.
464
- focusSearchBox() {
465
- this.$element.find('.app-chip-input > input.app-textbox').focus();
466
- }
467
- // Remove the item from list
468
- removeItem($event, item, index, canFocus) {
469
- $event.stopPropagation();
470
- const indexes = isArray(index) ? index : [index];
471
- const focusIndex = max(indexes);
472
- const items = reduce(indexes, (result, i) => {
473
- result.push(this.chipsList[i]);
474
- return result;
475
- }, []);
476
- // prevent deletion if the before-remove event callback returns false
477
- const allowRemove = this.invokeEventCallback('beforeremove', { $event, $item: items.length === 1 ? items[0] : items });
478
- if (isDefined(allowRemove) && !toBoolean(allowRemove)) {
479
- return;
480
- }
481
- const prevDatavalue = clone(this.datavalue);
482
- // focus next chip after deletion.
483
- // if there are no chips in the list focus search box
484
- setTimeout(() => {
485
- const chipsLength = this.chipsList.length;
486
- const $chipsList = this.$element.find('li.chip-item > a.app-chip');
487
- if (!chipsLength || !canFocus) {
488
- this.focusSearchBox();
489
- }
490
- else if ((chipsLength - 1) < focusIndex) {
491
- // if focus index is greater than chips length select last chip
492
- $chipsList.get(chipsLength - 1).focus();
493
- }
494
- else {
495
- // manually set the succeeding chip as active if there is a chip next to the current chip.
496
- this.chipsList[focusIndex].active = true;
497
- $chipsList.get(focusIndex).focus();
498
- }
499
- });
500
- const pulledItems = pullAt(this.chipsList, indexes);
501
- pulledItems.forEach(datasetItem => {
502
- this._modelByValue = filter(this._modelByValue, val => {
503
- return !(isObject(val) ? isEqual(val, datasetItem.value) : toString(val) === toString(datasetItem.value));
504
- });
505
- });
506
- this._unsubscribeDv = false;
507
- this.invokeOnChange(this._modelByValue, $event, true);
508
- this.invokeEventCallback('change', { $event, newVal: this.datavalue, oldVal: prevDatavalue });
509
- this.updateMaxSize();
510
- this.invokeEventCallback('remove', { $event, $item: items.length === 1 ? items[0] : items });
511
- }
512
- /**
513
- * Swaps items in an array if provided with indexes.
514
- * @param data :- array to be swapped
515
- * @param newIndex :- new index for the element to be placed
516
- * @param currentIndex :- the current index of the element.
517
- */
518
- swapElementsInArray(data, newIndex, currentIndex) {
519
- const draggedItem = pullAt(data, currentIndex)[0];
520
- data.splice(newIndex, 0, draggedItem);
521
- }
522
- /**
523
- * Cancels the reorder by reseting the elements to the original position.
524
- */
525
- resetReorder() {
526
- this.$element.removeData('oldIndex');
527
- }
528
- invokeOnBeforeServiceCall(inputData) {
529
- this.invokeEventCallback('beforeservicecall', { inputData });
530
- }
531
- handleEvent(node, eventName, eventCallback, locals) {
532
- if (eventName === 'remove' || eventName === 'beforeremove' || eventName === 'chipselect'
533
- || eventName === 'chipclick' || eventName === 'add' || eventName === 'reorder' || eventName === 'change') {
534
- return;
535
- }
536
- super.handleEvent(node, eventName, eventCallback, locals);
537
- }
538
- // Configures the reordable feature in chips widgets.
539
- configureDnD() {
540
- const options = {
541
- items: '> li:not(.app-chip-search)',
542
- placeholder: 'chip-placeholder'
543
- };
544
- configureDnD(this.$element, options, this.onReorderStart.bind(this), this.update.bind(this));
545
- }
546
- // Triggered on drag start while reordering.
547
- onReorderStart(evt, ui) {
548
- const helper = ui.helper;
549
- // increasing the width of the dragged item by 1
550
- helper.width(helper.width() + 1);
551
- this.$element.data('oldIndex', ui.item.index() - (this.inputposition === 'first' ? 1 : 0));
552
- }
553
- // updates the chipsList and datavalue on reorder.
554
- update($event, ui) {
555
- let changedItem, newIndex, oldIndex;
556
- // Get the index of the item at position before drag and after the reorder.
557
- newIndex = ui.item.index() - (this.inputposition === 'first' ? 1 : 0);
558
- oldIndex = this.$element.data('oldIndex');
559
- newIndex = this.chipsList.length === newIndex ? newIndex - 1 : newIndex;
560
- changedItem = {
561
- oldIndex: oldIndex,
562
- newIndex: newIndex,
563
- item: this.chipsList[oldIndex]
564
- };
565
- if (newIndex === oldIndex) {
566
- this.resetReorder();
567
- return;
568
- }
569
- changedItem.item = this.chipsList[oldIndex];
570
- const allowReorder = this.invokeEventCallback('beforereorder', { $event, $data: this.chipsList, $changedItem: changedItem });
571
- if (isDefined(allowReorder) && toBoolean(allowReorder) === false) {
572
- this.resetReorder();
573
- return;
574
- }
575
- // modify the chipsList and datavalue after the reorder.
576
- this.swapElementsInArray(this.chipsList, newIndex, oldIndex);
577
- this.swapElementsInArray(this._modelByValue, newIndex, oldIndex);
578
- changedItem.item = this.chipsList[newIndex];
579
- this.chipsList = [...this.chipsList];
580
- this.resetReorder();
581
- this.invokeEventCallback('reorder', { $event, $data: this.chipsList, $changedItem: changedItem });
582
- }
583
- onPropertyChange(key, nv, ov) {
584
- if (key === 'tabindex') {
585
- return;
586
- }
587
- if (key === 'dataoptions') {
588
- this.searchComponent.dataoptions = nv;
589
- }
590
- if (key === 'datafield') {
591
- this.searchComponent.datafield = this.datafield;
592
- }
593
- if (key === 'displayfield') {
594
- this.searchComponent.displaylabel = this.displayfield;
595
- }
596
- if (key === 'displayexpression') {
597
- this.searchComponent.binddisplaylabel = this.binddisplayexpression ? this.binddisplayexpression : this.displayexpression;
598
- }
599
- if (key === 'displayimagesrc') {
600
- this.searchComponent.binddisplayimagesrc = this.binddisplayimagesrc ? this.binddisplayimagesrc : this.displayimagesrc;
601
- }
602
- if (key === 'limit') {
603
- this.searchComponent.limit = this.limit;
604
- }
605
- if (key === 'matchmode') {
606
- this.searchComponent.matchmode = this.matchmode;
607
- }
608
- if (key === 'groupby') {
609
- this.searchComponent.groupby = this.groupby;
610
- }
611
- if (key === 'enablereorder') {
612
- if (this.$element.hasClass('ui-sortable')) {
613
- this.$element.sortable('option', 'disabled', !nv);
614
- }
615
- else if (nv) {
616
- this.configureDnD();
617
- }
618
- // Add this block to handle drag prevention
619
- const chipElements = this.$element.find('.chip-item a.app-chip');
620
- if (!nv) {
621
- chipElements.addClass('no-drag');
622
- // Prevent default drag behavior
623
- chipElements.on('dragstart', (e) => {
624
- e.preventDefault();
625
- return false;
626
- });
627
- }
628
- else {
629
- chipElements.removeClass('no-drag');
630
- chipElements.off('dragstart');
631
- }
632
- }
633
- if (key === 'readonly') {
634
- if (nv) {
635
- this.$element.addClass('readonly');
636
- }
637
- else {
638
- this.$element.removeClass('readonly');
639
- }
640
- }
641
- if (key === 'inputposition') {
642
- const $inputEl = this.$element.find('li.app-chip-search');
643
- if (nv === 'first') {
644
- this.$element.prepend($inputEl);
645
- }
646
- else {
647
- this.$element.append($inputEl);
648
- }
649
- }
650
- if (key === 'autofocus' && nv) {
651
- // setting the autofocus on the input once after dom is updated
652
- setTimeout(() => {
653
- const $chipsList = this.$element.find('.app-chip-input > input.app-textbox');
654
- if ($chipsList?.length) {
655
- this.focusSearchBox();
656
- }
657
- });
658
- }
659
- super.onPropertyChange(key, nv, ov);
660
- }
661
- ngOnDestroy() {
662
- // MEMORY LEAK FIX: Clear chips list array
663
- this.chipsList = [];
664
- // MEMORY LEAK FIX: Nullify debounced function closure
665
- this._debounceUpdateQueryModel = null;
666
- // MEMORY LEAK FIX: Clear search component reference
667
- this.searchComponent = null;
668
- // MEMORY LEAK FIX: Destroy jQuery sortable if enabled
669
- if (this.enablereorder && this.$element) {
670
- try {
671
- this.$element.sortable('destroy');
672
- }
673
- catch (e) {
674
- // Ignore errors during destroy
675
- }
676
- }
677
- // MEMORY LEAK FIX: Clear transform function reference
678
- this.getTransformedData = null;
679
- // MEMORY LEAK FIX: Clear class expression
680
- this._classExpr = null;
681
- // Call parent ngOnDestroy (DatasetAwareFormComponent has cleanup)
682
- super.ngOnDestroy();
683
- }
684
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0, type: ChipsComponent, deps: [{ token: i0.Injector }, { token: 'displayfield.bind', attribute: true }, { token: 'displayexpression.bind', attribute: true }, { token: 'displayimagesrc.bind', attribute: true }, { token: 'datafield.bind', attribute: true }, { token: 'dataset.bind', attribute: true }, { token: 'chipclass.bind', attribute: true }, { token: 'EXPLICIT_CONTEXT', optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
685
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.21", type: ChipsComponent, isStandalone: true, selector: "[wmChips]", providers: [
686
- provideAs(ChipsComponent, NG_VALUE_ACCESSOR, true),
687
- provideAsWidgetRef(ChipsComponent)
688
- ], viewQueries: [{ propertyName: "searchComponent", first: true, predicate: SearchComponent, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "@for (item of chipsList; track item) {\n <li class=\"chip-item {{chipclass && !bindChipclass ? chipclass : ''}}\"\n [ngClass]=\"{'active': item.active, 'disabled': disabled}\">\n <a href=\"javascript:void(0)\" class=\"app-chip\"\n (click)=\"handleChipClick($event, item)\"\n (keydown.delete)=\"onDelete($event, item, $index)\"\n (keydown.backspace)=\"onBackspace($event, item, $index)\"\n (keydown.arrowleft)=\"onArrowLeft(item, $index)\"\n (keydown.arrowright)=\"onArrowRight(item, $index)\"\n (focus)=\"handleChipFocus($event, item)\"\n (blur)=\"readonly ? 0 : item.active = false\"\n [ngClass]=\"{'no-drag': !enablereorder,'chip-duplicate bg-danger': item.isDuplicate, 'chip-picture': item.imgSrc}\">\n @if (item.imgSrc) {\n <img data-identifier=\"img\" alt=\"Chip Image\" class=\"button-image-icon\" [src]=\"item.imgSrc\"/>\n }\n <span class=\"app-chip-title\" [textContent]=\"item.label\" [title]=\"item.label\"></span>\n @if (!readonly) {\n <button type=\"button\" [attr.aria-label]=\"'Clear ' + item.label\" class=\"btn btn-transparent\"\n (click)=\"removeItem($event, item, $index);\">\n <i class=\"app-icon wi wi-close\"></i>\n </button>\n }\n </a>\n </li>\n}\n<li class=\"app-chip-search\" [ngClass]=\"{'full-width': inputwidth === 'full'}\">\n <div #search wmSearch class=\"app-chip-input\"\n name=\"app-chip-search\"\n submit.event=\"addItem($event, widget)\"\n beforeservicecall.event=\"invokeOnBeforeServiceCall(inputData)\"\n disabled.bind=\"disabled || readonly || saturate\"\n datafield.bind=\"datafield\"\n allowonlyselect.bind=\"allowonlyselect\"\n searchkey.bind=\"searchkey\"\n orderby.bind=\"orderby\"\n placeholder.bind=\"saturate ? maxSizeReached : placeholder\"\n showsearchicon.bind=\"showsearchicon\"\n tabindex.bind=\"tabindex\"\n minchars.bind=\"minchars\"\n debouncetime.bind=\"debouncetime\"\n matchmode.bind=\"matchmode\"\n datacompletemsg.bind = \"datacompletemsg\"\n groupby.bind=\"groupby\"\n match.bind=\"match\"\n dateformat.bind=\"dateformat\"\n (keydown.enter)=\"stopEvent($event)\"\n (keydown.delete)=\"onTextDelete($event)\"\n (keydown.backspace)=\"onInputClear($event)\"\n (keydown.arrowleft)=\"onArrowLeft()\"\n (keydown.arrowright)=\"onArrowRight()\">\n </div>\n</li>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: TextContentDirective, selector: "[textContent]", inputs: ["textContent"] }, { kind: "component", type: SearchComponent, selector: "[wmSearch]" }] }); }
689
- }
690
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0, type: ChipsComponent, decorators: [{
691
- type: Component,
692
- args: [{ standalone: true, imports: [CommonModule, TextContentDirective, SearchComponent], selector: '[wmChips]', providers: [
693
- provideAs(ChipsComponent, NG_VALUE_ACCESSOR, true),
694
- provideAsWidgetRef(ChipsComponent)
695
- ], template: "@for (item of chipsList; track item) {\n <li class=\"chip-item {{chipclass && !bindChipclass ? chipclass : ''}}\"\n [ngClass]=\"{'active': item.active, 'disabled': disabled}\">\n <a href=\"javascript:void(0)\" class=\"app-chip\"\n (click)=\"handleChipClick($event, item)\"\n (keydown.delete)=\"onDelete($event, item, $index)\"\n (keydown.backspace)=\"onBackspace($event, item, $index)\"\n (keydown.arrowleft)=\"onArrowLeft(item, $index)\"\n (keydown.arrowright)=\"onArrowRight(item, $index)\"\n (focus)=\"handleChipFocus($event, item)\"\n (blur)=\"readonly ? 0 : item.active = false\"\n [ngClass]=\"{'no-drag': !enablereorder,'chip-duplicate bg-danger': item.isDuplicate, 'chip-picture': item.imgSrc}\">\n @if (item.imgSrc) {\n <img data-identifier=\"img\" alt=\"Chip Image\" class=\"button-image-icon\" [src]=\"item.imgSrc\"/>\n }\n <span class=\"app-chip-title\" [textContent]=\"item.label\" [title]=\"item.label\"></span>\n @if (!readonly) {\n <button type=\"button\" [attr.aria-label]=\"'Clear ' + item.label\" class=\"btn btn-transparent\"\n (click)=\"removeItem($event, item, $index);\">\n <i class=\"app-icon wi wi-close\"></i>\n </button>\n }\n </a>\n </li>\n}\n<li class=\"app-chip-search\" [ngClass]=\"{'full-width': inputwidth === 'full'}\">\n <div #search wmSearch class=\"app-chip-input\"\n name=\"app-chip-search\"\n submit.event=\"addItem($event, widget)\"\n beforeservicecall.event=\"invokeOnBeforeServiceCall(inputData)\"\n disabled.bind=\"disabled || readonly || saturate\"\n datafield.bind=\"datafield\"\n allowonlyselect.bind=\"allowonlyselect\"\n searchkey.bind=\"searchkey\"\n orderby.bind=\"orderby\"\n placeholder.bind=\"saturate ? maxSizeReached : placeholder\"\n showsearchicon.bind=\"showsearchicon\"\n tabindex.bind=\"tabindex\"\n minchars.bind=\"minchars\"\n debouncetime.bind=\"debouncetime\"\n matchmode.bind=\"matchmode\"\n datacompletemsg.bind = \"datacompletemsg\"\n groupby.bind=\"groupby\"\n match.bind=\"match\"\n dateformat.bind=\"dateformat\"\n (keydown.enter)=\"stopEvent($event)\"\n (keydown.delete)=\"onTextDelete($event)\"\n (keydown.backspace)=\"onInputClear($event)\"\n (keydown.arrowleft)=\"onArrowLeft()\"\n (keydown.arrowright)=\"onArrowRight()\">\n </div>\n</li>\n" }]
696
- }], ctorParameters: () => [{ type: i0.Injector }, { type: undefined, decorators: [{
697
- type: Attribute,
698
- args: ['displayfield.bind']
699
- }] }, { type: undefined, decorators: [{
700
- type: Attribute,
701
- args: ['displayexpression.bind']
702
- }] }, { type: undefined, decorators: [{
703
- type: Attribute,
704
- args: ['displayimagesrc.bind']
705
- }] }, { type: undefined, decorators: [{
706
- type: Attribute,
707
- args: ['datafield.bind']
708
- }] }, { type: undefined, decorators: [{
709
- type: Attribute,
710
- args: ['dataset.bind']
711
- }] }, { type: undefined, decorators: [{
712
- type: Attribute,
713
- args: ['chipclass.bind']
714
- }] }, { type: undefined, decorators: [{
715
- type: Inject,
716
- args: ['EXPLICIT_CONTEXT']
717
- }, {
718
- type: Optional
719
- }] }], propDecorators: { searchComponent: [{
720
- type: ViewChild,
721
- args: [SearchComponent, /* TODO: add static flag */ { static: true }]
722
- }] } });
723
-
724
- /**
725
- * Generated bundle index. Do not edit.
726
- */
727
-
97
+ var ChipsComponent = class ChipsComponent extends DatasetAwareFormComponent {
98
+ static {
99
+ this.initializeProps = registerProps();
100
+ }
101
+ get datasource() {
102
+ return this._datasource;
103
+ }
104
+ set datasource(nv) {
105
+ this._datasource = nv;
106
+ this.searchComponent.datasource = nv;
107
+ if (this._debounceUpdateQueryModel) this._debounceUpdateQueryModel(this.datavalue || this.toBeProcessedDatavalue);
108
+ }
109
+ constructor(inj, bindDisplayField, bindDisplayExpr, bindDisplayImgSrc, bindDataField, bindDataSet, bindChipclass, explicitContext) {
110
+ super(inj, WIDGET_CONFIG, explicitContext);
111
+ this.bindDisplayField = bindDisplayField;
112
+ this.bindDisplayExpr = bindDisplayExpr;
113
+ this.bindDisplayImgSrc = bindDisplayImgSrc;
114
+ this.bindDataField = bindDataField;
115
+ this.bindDataSet = bindDataSet;
116
+ this.bindChipclass = bindChipclass;
117
+ this.chipsList = [];
118
+ this.maxSizeReached = "Max size reached";
119
+ this._unsubscribeDv = false;
120
+ this._debounceUpdateQueryModel = null;
121
+ styler(this.nativeElement, this);
122
+ if (!isDefined(this.showsearchicon)) this.showsearchicon = false;
123
+ this.multiple = true;
124
+ this.nextItemIndex = 0;
125
+ this._debounceUpdateQueryModel = debounce((val) => {
126
+ this.updateQueryModel(val).then(() => {
127
+ if (this.bindChipclass) forEach(this.chipsList, (item, index) => {
128
+ this.registerChipItemClass(item, index);
129
+ });
130
+ });
131
+ }, 150);
132
+ const datasetSubscription = this.dataset$.subscribe(() => {
133
+ this.searchComponent.dataset = this.dataset;
134
+ this.searchComponent._lastResult = void 0;
135
+ this.nextItemIndex = this.datasetItems.length;
136
+ if (this._debounceUpdateQueryModel) this._debounceUpdateQueryModel(this.datavalue || this.toBeProcessedDatavalue);
137
+ });
138
+ this.registerDestroyListener(() => datasetSubscription.unsubscribe());
139
+ const datavalueSubscription = this.datavalue$.subscribe((val) => {
140
+ if (!this._unsubscribeDv) {
141
+ this.chipsList = [];
142
+ if (this._debounceUpdateQueryModel) this._debounceUpdateQueryModel(val);
143
+ }
144
+ });
145
+ this.registerDestroyListener(() => datavalueSubscription.unsubscribe());
146
+ }
147
+ ngOnInit() {
148
+ super.ngOnInit();
149
+ this.searchComponent.multiple = true;
150
+ this.searchComponent.binddisplayimagesrc = this.bindDisplayImgSrc;
151
+ this.searchComponent.displayimagesrc = this.displayimagesrc;
152
+ this.searchComponent.binddisplaylabel = this.bindDisplayExpr;
153
+ this.searchComponent.displaylabel = this.displayfield;
154
+ this.searchComponent.datafield = this.bindDataField || this.datafield;
155
+ this.searchComponent.binddataset = this.bindDataSet;
156
+ this.searchComponent.dataset = this.dataset;
157
+ this.searchComponent.searchkey = this.searchkey;
158
+ this.searchComponent.limit = this.limit;
159
+ this.searchComponent.debouncetime = this.debouncetime;
160
+ this.searchComponent.matchmode = this.matchmode;
161
+ this.getTransformedData = (val, isCustom) => {
162
+ return this.searchComponent.getTransformedData([val], this.nextItemIndex++, isCustom);
163
+ };
164
+ }
165
+ ngAfterViewInit() {
166
+ super.ngAfterViewInit();
167
+ if (this.enablereorder) this.configureDnD();
168
+ }
169
+ registerChipItemClass(item, $index) {
170
+ if (this.bindChipclass) {
171
+ const watchName = `${this.widgetId}_chipItemClass_${$index}`;
172
+ $unwatch(watchName);
173
+ this.registerDestroyListener($watch(this.bindChipclass, this.viewParent, {
174
+ item,
175
+ $index
176
+ }, (nv, ov) => {
177
+ this.applyItemClass(getConditionalClasses(nv, ov), $index);
178
+ }, watchName));
179
+ }
180
+ }
181
+ applyItemClass(val, index) {
182
+ const chipItem = this.nativeElement.querySelectorAll(".chip-item").item(index);
183
+ if (chipItem) {
184
+ $(chipItem).removeClass(val.toRemove).addClass(val.toAdd);
185
+ return;
186
+ }
187
+ setTimeout(() => {
188
+ const retryChip = this.nativeElement.querySelectorAll(".chip-item").item(index);
189
+ if (retryChip) $(retryChip).removeClass(val.toRemove).addClass(val.toAdd);
190
+ }, 50);
191
+ }
192
+ removeDuplicates() {
193
+ this.chipsList = getUniqObjsByDataField(this.chipsList, this.datafield, this.displayfield || this.displaylabel);
194
+ }
195
+ updateQueryModel(data) {
196
+ const promises = [];
197
+ if (!data) {
198
+ this.chipsList = [];
199
+ return Promise.resolve();
200
+ }
201
+ let dataValue = clone(data);
202
+ const prevChipsList = this.chipsList;
203
+ this.chipsList = [];
204
+ if (this.maxsize && dataValue.length > this.maxsize) {
205
+ this._modelByValue = dataValue = slice(dataValue, 0, this.maxsize);
206
+ data = dataValue;
207
+ }
208
+ const searchQuery = [];
209
+ dataValue.forEach((val, i) => {
210
+ const itemFound = find(this.datasetItems, (item) => {
211
+ return isObject(item.value) ? isEqual(item.value, val) : toString(item.value) === toString(val);
212
+ });
213
+ if (itemFound) this.chipsList.push(itemFound);
214
+ else if (this.datafield !== ALLFIELDS) searchQuery.push(val);
215
+ else {
216
+ let dataObj, isCustom = false;
217
+ if (!isObject(val)) {
218
+ dataObj = this.createCustomDataModel(val);
219
+ isCustom = true;
220
+ if (dataObj) data.splice(i, 1, dataObj);
221
+ } else {
222
+ const prevChipObj = prevChipsList.find((obj) => {
223
+ return isEqual(obj.value, val);
224
+ });
225
+ if (prevChipObj) isCustom = prevChipObj.iscustom;
226
+ }
227
+ dataObj = dataObj || val;
228
+ const chipObj = this.getTransformedData(dataObj, isCustom)[0];
229
+ if (isCustom) chipObj.iscustom = isCustom;
230
+ this.chipsList.push(chipObj);
231
+ }
232
+ });
233
+ if (searchQuery.length) promises.push(this.getDefaultModel(searchQuery, this.nextItemIndex).then((response) => {
234
+ this.chipsList = this.chipsList.concat(response || []);
235
+ dataValue.forEach((val, i) => {
236
+ if (!find(this.chipsList, (obj) => {
237
+ return obj.value.toString() === val.toString();
238
+ })) {
239
+ if (this.allowonlyselect) {
240
+ const index = data.indexOf(val);
241
+ if (index > -1) data.splice(index, 1);
242
+ return;
243
+ }
244
+ const chipObj = this.getTransformedData(val, true)[0];
245
+ chipObj.iscustom = true;
246
+ this.chipsList.push(chipObj);
247
+ }
248
+ });
249
+ }));
250
+ this.resetSearchModel(true);
251
+ return Promise.all(promises).then(() => {
252
+ this._modelByValue = data;
253
+ this.removeDuplicates();
254
+ this.updateMaxSize();
255
+ $appDigest();
256
+ });
257
+ }
258
+ resetSearchModel(defaultQuery) {
259
+ this._unsubscribeDv = true;
260
+ this.searchComponent.clearSearch(void 0, !this.minchars && !defaultQuery);
261
+ this._unsubscribeDv = false;
262
+ }
263
+ addItem($event, widget) {
264
+ const searchComponent = widget;
265
+ let allowAdd;
266
+ let chipObj;
267
+ if (searchComponent && isDefined(searchComponent.datavalue) && searchComponent.queryModel !== "") {
268
+ if (!searchComponent.query || !trim(searchComponent.query)) return;
269
+ chipObj = searchComponent.queryModel;
270
+ } else {
271
+ if (this.allowonlyselect) return;
272
+ let dataObj;
273
+ if (this.datafield === ALLFIELDS) {
274
+ if (!isObject(this.searchComponent.query) && trim(this.searchComponent.query)) {
275
+ dataObj = this.createCustomDataModel(this.searchComponent.query);
276
+ if (!dataObj) {
277
+ this.resetSearchModel();
278
+ return;
279
+ }
280
+ }
281
+ }
282
+ const data = dataObj || trim(this.searchComponent.query);
283
+ if (data) {
284
+ chipObj = this.getTransformedData(data, true)[0];
285
+ chipObj.iscustom = true;
286
+ }
287
+ }
288
+ if (!isDefined(chipObj) || chipObj === "") return;
289
+ allowAdd = this.invokeEventCallback("beforeadd", {
290
+ $event,
291
+ newItem: chipObj
292
+ });
293
+ if (isDefined(allowAdd) && !toBoolean(allowAdd)) return;
294
+ if (this.isDuplicate(chipObj)) {
295
+ this.resetSearchModel();
296
+ return;
297
+ }
298
+ this.registerChipItemClass(chipObj, this.chipsList.length);
299
+ this.chipsList.push(chipObj);
300
+ if (!this.datavalue) this._modelByValue = [chipObj.value];
301
+ else this._modelByValue = [...this._modelByValue, chipObj.value];
302
+ this._unsubscribeDv = true;
303
+ this.invokeOnTouched();
304
+ this.invokeOnChange(this._modelByValue, $event || {}, true);
305
+ this.invokeEventCallback("add", {
306
+ $event,
307
+ $item: chipObj
308
+ });
309
+ this.updateMaxSize();
310
+ this.resetSearchModel();
311
+ if ($event && ($event.key === "Enter" || $event.keyCode === 13)) this.stopEvent($event);
312
+ }
313
+ createCustomDataModel(val) {
314
+ const key = this.displayfield || (this.datafield !== ALLFIELDS ? this.datafield : void 0);
315
+ if (key) {
316
+ const customObj = {};
317
+ customObj[key] = val;
318
+ return customObj;
319
+ }
320
+ }
321
+ isDuplicate(item) {
322
+ if (this.datafield === ALLFIELDS) return findIndex(this.chipsList, { value: item.value }) > -1;
323
+ return findIndex(this.chipsList, { key: item.key }) > -1;
324
+ }
325
+ updateMaxSize() {
326
+ this.saturate = this.maxsize > 0 && this.chipsList.length === this.maxsize;
327
+ }
328
+ getDefaultModel(query, index) {
329
+ this.nextItemIndex++;
330
+ return this.searchComponent.getDataSource(query, true, index).then((response) => {
331
+ return filter(query, (queryVal) => {
332
+ find(response, { value: queryVal });
333
+ });
334
+ });
335
+ }
336
+ handleChipClick($event, chip) {
337
+ if (this.readonly) return;
338
+ $event.currentTarget.focus();
339
+ this.invokeEventCallback("chipclick", {
340
+ $event,
341
+ $item: chip
342
+ });
343
+ }
344
+ handleChipFocus($event, chip) {
345
+ if (this.readonly) return;
346
+ chip.active = true;
347
+ this.invokeEventCallback("chipselect", {
348
+ $event,
349
+ $item: chip
350
+ });
351
+ }
352
+ stopEvent($event) {
353
+ if (($event.target?.value ?? "").trim()) {
354
+ $event.stopPropagation();
355
+ $event.preventDefault();
356
+ }
357
+ }
358
+ onTextDelete($event) {
359
+ if (isAppleProduct) this.onInputClear($event);
360
+ }
361
+ onInputClear($event) {
362
+ if (!this.chipsList?.length || this.searchComponent.query) return;
363
+ this.$element.find("li.chip-item > a.app-chip").last().focus();
364
+ this.stopEvent($event);
365
+ }
366
+ onBackspace($event, $item, $index) {
367
+ if (this.readonly) return;
368
+ this.removeItem($event, $item, $index, true);
369
+ }
370
+ onDelete($event, $item, $index) {
371
+ if (this.readonly) return;
372
+ this.removeItem($event, $item, $index);
373
+ }
374
+ onArrowLeft($item, $index) {
375
+ if (this.readonly) return;
376
+ if (!this.searchComponent.query && !isDefined($index) && !isDefined($item)) {
377
+ this.$element.find("li.chip-item > a.app-chip").last().focus();
378
+ return;
379
+ }
380
+ if ($index > 0) this.$element.find("li.chip-item > a.app-chip").get($index - 1).focus();
381
+ else this.focusSearchBox();
382
+ }
383
+ onArrowRight($item, $index) {
384
+ if (this.readonly) return;
385
+ if (!this.searchComponent.query && !isDefined($index) && !isDefined($item)) {
386
+ this.$element.find("li.chip-item > a.app-chip").first().focus();
387
+ return;
388
+ }
389
+ if ($index < this.chipsList.length - 1) this.$element.find("li.chip-item > a.app-chip").get($index + 1).focus();
390
+ else this.focusSearchBox();
391
+ }
392
+ focusSearchBox() {
393
+ this.$element.find(".app-chip-input > input.app-textbox").focus();
394
+ }
395
+ removeItem($event, item, index, canFocus) {
396
+ $event.stopPropagation();
397
+ const indexes = isArray(index) ? index : [index];
398
+ const focusIndex = max(indexes);
399
+ const items = reduce(indexes, (result, i) => {
400
+ result.push(this.chipsList[i]);
401
+ return result;
402
+ }, []);
403
+ const allowRemove = this.invokeEventCallback("beforeremove", {
404
+ $event,
405
+ $item: items.length === 1 ? items[0] : items
406
+ });
407
+ if (isDefined(allowRemove) && !toBoolean(allowRemove)) return;
408
+ const prevDatavalue = clone(this.datavalue);
409
+ setTimeout(() => {
410
+ const chipsLength = this.chipsList.length;
411
+ const $chipsList = this.$element.find("li.chip-item > a.app-chip");
412
+ if (!chipsLength || !canFocus) this.focusSearchBox();
413
+ else if (chipsLength - 1 < focusIndex) $chipsList.get(chipsLength - 1).focus();
414
+ else {
415
+ this.chipsList[focusIndex].active = true;
416
+ $chipsList.get(focusIndex).focus();
417
+ }
418
+ });
419
+ pullAt(this.chipsList, indexes).forEach((datasetItem) => {
420
+ this._modelByValue = filter(this._modelByValue, (val) => {
421
+ return !(isObject(val) ? isEqual(val, datasetItem.value) : toString(val) === toString(datasetItem.value));
422
+ });
423
+ });
424
+ this._unsubscribeDv = false;
425
+ this.invokeOnChange(this._modelByValue, $event, true);
426
+ this.invokeEventCallback("change", {
427
+ $event,
428
+ newVal: this.datavalue,
429
+ oldVal: prevDatavalue
430
+ });
431
+ this.updateMaxSize();
432
+ this.invokeEventCallback("remove", {
433
+ $event,
434
+ $item: items.length === 1 ? items[0] : items
435
+ });
436
+ }
437
+ swapElementsInArray(data, newIndex, currentIndex) {
438
+ const draggedItem = pullAt(data, currentIndex)[0];
439
+ data.splice(newIndex, 0, draggedItem);
440
+ }
441
+ resetReorder() {
442
+ this.$element.removeData("oldIndex");
443
+ }
444
+ invokeOnBeforeServiceCall(inputData) {
445
+ this.invokeEventCallback("beforeservicecall", { inputData });
446
+ }
447
+ handleEvent(node, eventName, eventCallback, locals) {
448
+ if (eventName === "remove" || eventName === "beforeremove" || eventName === "chipselect" || eventName === "chipclick" || eventName === "add" || eventName === "reorder" || eventName === "change") return;
449
+ super.handleEvent(node, eventName, eventCallback, locals);
450
+ }
451
+ configureDnD() {
452
+ configureDnD(this.$element, {
453
+ items: "> li:not(.app-chip-search)",
454
+ placeholder: "chip-placeholder",
455
+ cancel: ".app-chips.readonly"
456
+ }, this.onReorderStart.bind(this), this.update.bind(this));
457
+ }
458
+ onReorderStart(evt, ui) {
459
+ const helper = ui.helper;
460
+ helper.width(helper.width() + 1);
461
+ this.$element.data("oldIndex", ui.item.index() - (this.inputposition === "first" ? 1 : 0));
462
+ }
463
+ update($event, ui) {
464
+ let changedItem, newIndex, oldIndex;
465
+ newIndex = ui.item.index() - (this.inputposition === "first" ? 1 : 0);
466
+ oldIndex = this.$element.data("oldIndex");
467
+ newIndex = this.chipsList.length === newIndex ? newIndex - 1 : newIndex;
468
+ changedItem = {
469
+ oldIndex,
470
+ newIndex,
471
+ item: this.chipsList[oldIndex]
472
+ };
473
+ if (newIndex === oldIndex) {
474
+ this.resetReorder();
475
+ return;
476
+ }
477
+ changedItem.item = this.chipsList[oldIndex];
478
+ const allowReorder = this.invokeEventCallback("beforereorder", {
479
+ $event,
480
+ $data: this.chipsList,
481
+ $changedItem: changedItem
482
+ });
483
+ if (isDefined(allowReorder) && toBoolean(allowReorder) === false) {
484
+ this.resetReorder();
485
+ return;
486
+ }
487
+ this.swapElementsInArray(this.chipsList, newIndex, oldIndex);
488
+ this.swapElementsInArray(this._modelByValue, newIndex, oldIndex);
489
+ changedItem.item = this.chipsList[newIndex];
490
+ this.chipsList = [...this.chipsList];
491
+ this.resetReorder();
492
+ this.invokeEventCallback("reorder", {
493
+ $event,
494
+ $data: this.chipsList,
495
+ $changedItem: changedItem
496
+ });
497
+ }
498
+ onPropertyChange(key, nv, ov) {
499
+ if (key === "tabindex") return;
500
+ if (key === "dataoptions") this.searchComponent.dataoptions = nv;
501
+ if (key === "datafield") this.searchComponent.datafield = this.datafield;
502
+ if (key === "displayfield") this.searchComponent.displaylabel = this.displayfield;
503
+ if (key === "displayexpression") this.searchComponent.binddisplaylabel = this.binddisplayexpression ? this.binddisplayexpression : this.displayexpression;
504
+ if (key === "displayimagesrc") this.searchComponent.binddisplayimagesrc = this.binddisplayimagesrc ? this.binddisplayimagesrc : this.displayimagesrc;
505
+ if (key === "limit") this.searchComponent.limit = this.limit;
506
+ if (key === "matchmode") this.searchComponent.matchmode = this.matchmode;
507
+ if (key === "groupby") this.searchComponent.groupby = this.groupby;
508
+ if (key === "enablereorder") {
509
+ if (this.$element.hasClass("ui-sortable")) this.$element.sortable("option", "disabled", !nv);
510
+ else if (nv) this.configureDnD();
511
+ const chipElements = this.$element.find(".chip-item a.app-chip");
512
+ if (!nv) {
513
+ chipElements.addClass("no-drag");
514
+ chipElements.on("dragstart", (e) => {
515
+ e.preventDefault();
516
+ return false;
517
+ });
518
+ } else {
519
+ chipElements.removeClass("no-drag");
520
+ chipElements.off("dragstart");
521
+ }
522
+ }
523
+ if (key === "readonly") {
524
+ if (nv) this.$element.addClass("readonly");
525
+ else this.$element.removeClass("readonly");
526
+ }
527
+ if (key === "inputposition") {
528
+ const $inputEl = this.$element.find("li.app-chip-search");
529
+ if (nv === "first") this.$element.prepend($inputEl);
530
+ else this.$element.append($inputEl);
531
+ }
532
+ if (key === "autofocus" && nv) setTimeout(() => {
533
+ if (this.$element.find(".app-chip-input > input.app-textbox")?.length) this.focusSearchBox();
534
+ });
535
+ super.onPropertyChange(key, nv, ov);
536
+ }
537
+ ngOnDestroy() {
538
+ this.chipsList = [];
539
+ this._debounceUpdateQueryModel = null;
540
+ this.searchComponent = null;
541
+ if (this.enablereorder && this.$element) try {
542
+ this.$element.sortable("destroy");
543
+ } catch (e) {}
544
+ this.getTransformedData = null;
545
+ this._classExpr = null;
546
+ super.ngOnDestroy();
547
+ }
548
+ static {
549
+ this.ɵfac = i0.ɵɵngDeclareFactory({
550
+ minVersion: "12.0.0",
551
+ version: "22.2.1",
552
+ ngImport: i0,
553
+ type: ChipsComponent,
554
+ deps: [
555
+ { token: i0.Injector },
556
+ {
557
+ token: "displayfield.bind",
558
+ attribute: true
559
+ },
560
+ {
561
+ token: "displayexpression.bind",
562
+ attribute: true
563
+ },
564
+ {
565
+ token: "displayimagesrc.bind",
566
+ attribute: true
567
+ },
568
+ {
569
+ token: "datafield.bind",
570
+ attribute: true
571
+ },
572
+ {
573
+ token: "dataset.bind",
574
+ attribute: true
575
+ },
576
+ {
577
+ token: "chipclass.bind",
578
+ attribute: true
579
+ },
580
+ {
581
+ token: "EXPLICIT_CONTEXT",
582
+ optional: true
583
+ }
584
+ ],
585
+ target: i0.ɵɵFactoryTarget.Component
586
+ });
587
+ }
588
+ static {
589
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
590
+ minVersion: "17.0.0",
591
+ version: "22.2.1",
592
+ type: ChipsComponent,
593
+ isStandalone: true,
594
+ selector: "[wmChips]",
595
+ providers: [provideAs(ChipsComponent, NG_VALUE_ACCESSOR, true), provideAsWidgetRef(ChipsComponent)],
596
+ viewQueries: [{
597
+ propertyName: "searchComponent",
598
+ first: true,
599
+ predicate: SearchComponent,
600
+ descendants: true,
601
+ static: true
602
+ }],
603
+ usesInheritance: true,
604
+ ngImport: i0,
605
+ template: "@for (item of chipsList; track item) {\n <li class=\"chip-item {{chipclass && !bindChipclass ? chipclass : ''}}\"\n [ngClass]=\"{'active': item.active, 'disabled': disabled}\">\n <a href=\"javascript:void(0)\" class=\"app-chip\"\n (click)=\"handleChipClick($event, item)\"\n (keydown.delete)=\"onDelete($event, item, $index)\"\n (keydown.backspace)=\"onBackspace($event, item, $index)\"\n (keydown.arrowleft)=\"onArrowLeft(item, $index)\"\n (keydown.arrowright)=\"onArrowRight(item, $index)\"\n (focus)=\"handleChipFocus($event, item)\"\n (blur)=\"readonly ? 0 : item.active = false\"\n [ngClass]=\"{'no-drag': !enablereorder,'chip-duplicate bg-danger': item.isDuplicate, 'chip-picture': item.imgSrc}\">\n @if (item.imgSrc) {\n <img data-identifier=\"img\" alt=\"Chip Image\" class=\"button-image-icon\" [src]=\"item.imgSrc\"/>\n }\n <span class=\"app-chip-title\" [textContent]=\"item.label\" [title]=\"item.label\"></span>\n @if (!readonly) {\n <button type=\"button\" [attr.aria-label]=\"'Clear ' + item.label\" class=\"btn btn-transparent\"\n (click)=\"removeItem($event, item, $index);\">\n <i class=\"app-icon wi wi-close\"></i>\n </button>\n }\n </a>\n </li>\n}\n<li class=\"app-chip-search\" [ngClass]=\"{'full-width': inputwidth === 'full'}\">\n <div #search wmSearch class=\"app-chip-input\"\n name=\"app-chip-search\"\n submit.event=\"addItem($event, widget)\"\n beforeservicecall.event=\"invokeOnBeforeServiceCall(inputData)\"\n disabled.bind=\"disabled || readonly || saturate\"\n datafield.bind=\"datafield\"\n allowonlyselect.bind=\"allowonlyselect\"\n searchkey.bind=\"searchkey\"\n orderby.bind=\"orderby\"\n placeholder.bind=\"saturate ? maxSizeReached : placeholder\"\n showsearchicon.bind=\"showsearchicon\"\n tabindex.bind=\"tabindex\"\n minchars.bind=\"minchars\"\n debouncetime.bind=\"debouncetime\"\n matchmode.bind=\"matchmode\"\n datacompletemsg.bind = \"datacompletemsg\"\n groupby.bind=\"groupby\"\n match.bind=\"match\"\n dateformat.bind=\"dateformat\"\n (keydown.enter)=\"stopEvent($event)\"\n (keydown.delete)=\"onTextDelete($event)\"\n (keydown.backspace)=\"onInputClear($event)\"\n (keydown.arrowleft)=\"onArrowLeft()\"\n (keydown.arrowright)=\"onArrowRight()\">\n </div>\n</li>\n",
606
+ dependencies: [
607
+ {
608
+ kind: "ngmodule",
609
+ type: CommonModule
610
+ },
611
+ {
612
+ kind: "directive",
613
+ type: i1.NgClass,
614
+ selector: "[ngClass]",
615
+ inputs: ["class", "ngClass"]
616
+ },
617
+ {
618
+ kind: "directive",
619
+ type: TextContentDirective,
620
+ selector: "[textContent]",
621
+ inputs: ["textContent"]
622
+ },
623
+ {
624
+ kind: "component",
625
+ type: SearchComponent,
626
+ selector: "[wmSearch]"
627
+ }
628
+ ],
629
+ changeDetection: i0.ChangeDetectionStrategy.Eager
630
+ });
631
+ }
632
+ };
633
+ i0.ɵɵngDeclareClassMetadata({
634
+ minVersion: "12.0.0",
635
+ version: "22.2.1",
636
+ ngImport: i0,
637
+ type: ChipsComponent,
638
+ decorators: [{
639
+ type: Component,
640
+ args: [{
641
+ changeDetection: ChangeDetectionStrategy.Eager,
642
+ standalone: true,
643
+ imports: [
644
+ CommonModule,
645
+ TextContentDirective,
646
+ SearchComponent
647
+ ],
648
+ selector: "[wmChips]",
649
+ providers: [provideAs(ChipsComponent, NG_VALUE_ACCESSOR, true), provideAsWidgetRef(ChipsComponent)],
650
+ template: "@for (item of chipsList; track item) {\n <li class=\"chip-item {{chipclass && !bindChipclass ? chipclass : ''}}\"\n [ngClass]=\"{'active': item.active, 'disabled': disabled}\">\n <a href=\"javascript:void(0)\" class=\"app-chip\"\n (click)=\"handleChipClick($event, item)\"\n (keydown.delete)=\"onDelete($event, item, $index)\"\n (keydown.backspace)=\"onBackspace($event, item, $index)\"\n (keydown.arrowleft)=\"onArrowLeft(item, $index)\"\n (keydown.arrowright)=\"onArrowRight(item, $index)\"\n (focus)=\"handleChipFocus($event, item)\"\n (blur)=\"readonly ? 0 : item.active = false\"\n [ngClass]=\"{'no-drag': !enablereorder,'chip-duplicate bg-danger': item.isDuplicate, 'chip-picture': item.imgSrc}\">\n @if (item.imgSrc) {\n <img data-identifier=\"img\" alt=\"Chip Image\" class=\"button-image-icon\" [src]=\"item.imgSrc\"/>\n }\n <span class=\"app-chip-title\" [textContent]=\"item.label\" [title]=\"item.label\"></span>\n @if (!readonly) {\n <button type=\"button\" [attr.aria-label]=\"'Clear ' + item.label\" class=\"btn btn-transparent\"\n (click)=\"removeItem($event, item, $index);\">\n <i class=\"app-icon wi wi-close\"></i>\n </button>\n }\n </a>\n </li>\n}\n<li class=\"app-chip-search\" [ngClass]=\"{'full-width': inputwidth === 'full'}\">\n <div #search wmSearch class=\"app-chip-input\"\n name=\"app-chip-search\"\n submit.event=\"addItem($event, widget)\"\n beforeservicecall.event=\"invokeOnBeforeServiceCall(inputData)\"\n disabled.bind=\"disabled || readonly || saturate\"\n datafield.bind=\"datafield\"\n allowonlyselect.bind=\"allowonlyselect\"\n searchkey.bind=\"searchkey\"\n orderby.bind=\"orderby\"\n placeholder.bind=\"saturate ? maxSizeReached : placeholder\"\n showsearchicon.bind=\"showsearchicon\"\n tabindex.bind=\"tabindex\"\n minchars.bind=\"minchars\"\n debouncetime.bind=\"debouncetime\"\n matchmode.bind=\"matchmode\"\n datacompletemsg.bind = \"datacompletemsg\"\n groupby.bind=\"groupby\"\n match.bind=\"match\"\n dateformat.bind=\"dateformat\"\n (keydown.enter)=\"stopEvent($event)\"\n (keydown.delete)=\"onTextDelete($event)\"\n (keydown.backspace)=\"onInputClear($event)\"\n (keydown.arrowleft)=\"onArrowLeft()\"\n (keydown.arrowright)=\"onArrowRight()\">\n </div>\n</li>\n"
651
+ }]
652
+ }],
653
+ ctorParameters: () => [
654
+ { type: i0.Injector },
655
+ {
656
+ type: void 0,
657
+ decorators: [{
658
+ type: Attribute,
659
+ args: ["displayfield.bind"]
660
+ }]
661
+ },
662
+ {
663
+ type: void 0,
664
+ decorators: [{
665
+ type: Attribute,
666
+ args: ["displayexpression.bind"]
667
+ }]
668
+ },
669
+ {
670
+ type: void 0,
671
+ decorators: [{
672
+ type: Attribute,
673
+ args: ["displayimagesrc.bind"]
674
+ }]
675
+ },
676
+ {
677
+ type: void 0,
678
+ decorators: [{
679
+ type: Attribute,
680
+ args: ["datafield.bind"]
681
+ }]
682
+ },
683
+ {
684
+ type: void 0,
685
+ decorators: [{
686
+ type: Attribute,
687
+ args: ["dataset.bind"]
688
+ }]
689
+ },
690
+ {
691
+ type: void 0,
692
+ decorators: [{
693
+ type: Attribute,
694
+ args: ["chipclass.bind"]
695
+ }]
696
+ },
697
+ {
698
+ type: void 0,
699
+ decorators: [{
700
+ type: Inject,
701
+ args: ["EXPLICIT_CONTEXT"]
702
+ }, { type: Optional }]
703
+ }
704
+ ],
705
+ propDecorators: { searchComponent: [{
706
+ type: ViewChild,
707
+ args: [SearchComponent, { static: true }]
708
+ }] }
709
+ });
728
710
  export { ChipsComponent };
729
- //# sourceMappingURL=index.mjs.map
711
+
712
+ //# sourceMappingURL=index.mjs.map