@syncfusion/ej2-dropdowns 20.2.40 → 20.2.43-3197

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 (378) hide show
  1. package/.eslintrc.json +16 -1
  2. package/CHANGELOG.md +116 -3
  3. package/{README.md → ReadMe.md} +1 -1
  4. package/dist/ej2-dropdowns.min.js +1 -0
  5. package/dist/ej2-dropdowns.umd.min.js +1 -10
  6. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es2015.js +2232 -468
  8. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  9. package/dist/es6/ej2-dropdowns.es5.js +2273 -480
  10. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  11. package/dist/global/ej2-dropdowns.min.js +1 -10
  12. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  13. package/dist/global/index.d.ts +0 -9
  14. package/mention.d.ts +4 -0
  15. package/mention.js +4 -0
  16. package/package.json +76 -76
  17. package/src/auto-complete/auto-complete-model.d.ts +12 -11
  18. package/src/auto-complete/auto-complete.d.ts +20 -18
  19. package/src/auto-complete/auto-complete.js +67 -37
  20. package/src/combo-box/combo-box-model.d.ts +17 -17
  21. package/src/combo-box/combo-box.d.ts +33 -33
  22. package/src/combo-box/combo-box.js +33 -29
  23. package/src/common/incremental-search.d.ts +3 -4
  24. package/src/common/incremental-search.js +22 -7
  25. package/src/drop-down-base/drop-down-base-model.d.ts +13 -31
  26. package/src/drop-down-base/drop-down-base.d.ts +22 -41
  27. package/src/drop-down-base/drop-down-base.js +75 -59
  28. package/src/drop-down-list/drop-down-list-model.d.ts +19 -1
  29. package/src/drop-down-list/drop-down-list.d.ts +35 -11
  30. package/src/drop-down-list/drop-down-list.js +194 -109
  31. package/src/drop-down-tree/drop-down-tree-model.d.ts +16 -2
  32. package/src/drop-down-tree/drop-down-tree.d.ts +15 -1
  33. package/src/drop-down-tree/drop-down-tree.js +49 -14
  34. package/src/index.d.ts +1 -0
  35. package/src/index.js +1 -0
  36. package/src/list-box/list-box-model.d.ts +18 -0
  37. package/src/list-box/list-box.d.ts +23 -1
  38. package/src/list-box/list-box.js +78 -35
  39. package/src/mention/index.d.ts +5 -0
  40. package/src/mention/index.js +4 -0
  41. package/src/mention/mention-model.d.ts +285 -0
  42. package/src/mention/mention.d.ts +457 -0
  43. package/src/mention/mention.js +1465 -0
  44. package/src/multi-select/checkbox-selection.js +11 -12
  45. package/src/multi-select/float-label.js +4 -2
  46. package/src/multi-select/multi-select-model.d.ts +1 -1
  47. package/src/multi-select/multi-select.d.ts +9 -5
  48. package/src/multi-select/multi-select.js +295 -188
  49. package/styles/auto-complete/_all.scss +1 -1
  50. package/styles/auto-complete/_bootstrap-dark-definition.scss +1 -1
  51. package/styles/auto-complete/_bootstrap-definition.scss +1 -1
  52. package/styles/auto-complete/_bootstrap4-definition.scss +2 -2
  53. package/styles/auto-complete/_bootstrap5-definition.scss +1 -1
  54. package/styles/auto-complete/_fabric-dark-definition.scss +1 -1
  55. package/styles/auto-complete/_fabric-definition.scss +1 -1
  56. package/styles/auto-complete/_fluent-definition.scss +1 -1
  57. package/styles/auto-complete/_fusionnew-definition.scss +1 -1
  58. package/styles/auto-complete/_highcontrast-definition.scss +1 -1
  59. package/styles/auto-complete/_highcontrast-light-definition.scss +1 -1
  60. package/styles/auto-complete/_material-dark-definition.scss +1 -1
  61. package/styles/auto-complete/_material-definition.scss +1 -1
  62. package/styles/auto-complete/_material3-definition.scss +1 -1
  63. package/styles/auto-complete/_tailwind-definition.scss +1 -1
  64. package/styles/auto-complete/bootstrap-dark.css +3 -1
  65. package/styles/auto-complete/bootstrap.css +3 -1
  66. package/styles/auto-complete/bootstrap4.css +3 -1
  67. package/styles/auto-complete/bootstrap5-dark.css +3 -1
  68. package/styles/auto-complete/bootstrap5.css +3 -1
  69. package/styles/auto-complete/fabric-dark.css +3 -1
  70. package/styles/auto-complete/fabric.css +3 -1
  71. package/styles/auto-complete/fluent-dark.css +3 -1
  72. package/styles/auto-complete/fluent.css +3 -1
  73. package/styles/auto-complete/highcontrast-light.css +3 -1
  74. package/styles/auto-complete/highcontrast.css +3 -1
  75. package/styles/auto-complete/material-dark.css +3 -1
  76. package/styles/auto-complete/material.css +3 -1
  77. package/styles/auto-complete/tailwind-dark.css +3 -1
  78. package/styles/auto-complete/tailwind.css +3 -1
  79. package/styles/bootstrap-dark.css +121 -44
  80. package/styles/bootstrap-dark.scss +1 -0
  81. package/styles/bootstrap.css +121 -44
  82. package/styles/bootstrap.scss +1 -0
  83. package/styles/bootstrap4.css +134 -55
  84. package/styles/bootstrap4.scss +1 -0
  85. package/styles/bootstrap5-dark.css +135 -50
  86. package/styles/bootstrap5-dark.scss +1 -0
  87. package/styles/bootstrap5.css +135 -50
  88. package/styles/bootstrap5.scss +1 -0
  89. package/styles/combo-box/_all.scss +1 -1
  90. package/styles/combo-box/_bootstrap-dark-definition.scss +1 -1
  91. package/styles/combo-box/_bootstrap-definition.scss +1 -1
  92. package/styles/combo-box/_bootstrap4-definition.scss +2 -2
  93. package/styles/combo-box/_bootstrap5-definition.scss +1 -1
  94. package/styles/combo-box/_fabric-dark-definition.scss +1 -1
  95. package/styles/combo-box/_fabric-definition.scss +1 -1
  96. package/styles/combo-box/_fluent-definition.scss +1 -1
  97. package/styles/combo-box/_fusionnew-definition.scss +1 -1
  98. package/styles/combo-box/_highcontrast-definition.scss +1 -1
  99. package/styles/combo-box/_highcontrast-light-definition.scss +1 -1
  100. package/styles/combo-box/_material-dark-definition.scss +1 -1
  101. package/styles/combo-box/_material-definition.scss +1 -1
  102. package/styles/combo-box/_material3-definition.scss +1 -1
  103. package/styles/combo-box/_tailwind-definition.scss +1 -1
  104. package/styles/combo-box/bootstrap-dark.css +3 -1
  105. package/styles/combo-box/bootstrap.css +3 -1
  106. package/styles/combo-box/bootstrap4.css +3 -1
  107. package/styles/combo-box/bootstrap5-dark.css +3 -1
  108. package/styles/combo-box/bootstrap5.css +3 -1
  109. package/styles/combo-box/fabric-dark.css +3 -1
  110. package/styles/combo-box/fabric.css +3 -1
  111. package/styles/combo-box/fluent-dark.css +3 -1
  112. package/styles/combo-box/fluent.css +3 -1
  113. package/styles/combo-box/highcontrast-light.css +3 -1
  114. package/styles/combo-box/highcontrast.css +3 -1
  115. package/styles/combo-box/material-dark.css +3 -1
  116. package/styles/combo-box/material.css +3 -1
  117. package/styles/combo-box/tailwind-dark.css +3 -1
  118. package/styles/combo-box/tailwind.css +3 -1
  119. package/styles/drop-down-base/_all.scss +1 -1
  120. package/styles/drop-down-base/_bootstrap-dark-definition.scss +9 -2
  121. package/styles/drop-down-base/_bootstrap-definition.scss +7 -1
  122. package/styles/drop-down-base/_bootstrap4-definition.scss +7 -1
  123. package/styles/drop-down-base/_bootstrap5-definition.scss +9 -3
  124. package/styles/drop-down-base/_fabric-dark-definition.scss +7 -1
  125. package/styles/drop-down-base/_fabric-definition.scss +7 -1
  126. package/styles/drop-down-base/_fluent-definition.scss +9 -2
  127. package/styles/drop-down-base/_fusionnew-definition.scss +9 -3
  128. package/styles/drop-down-base/_highcontrast-definition.scss +17 -6
  129. package/styles/drop-down-base/_highcontrast-light-definition.scss +19 -7
  130. package/styles/drop-down-base/_layout.scss +44 -3
  131. package/styles/drop-down-base/_material-dark-definition.scss +8 -1
  132. package/styles/drop-down-base/_material-definition.scss +7 -0
  133. package/styles/drop-down-base/_material3-definition.scss +9 -3
  134. package/styles/drop-down-base/_tailwind-definition.scss +9 -3
  135. package/styles/drop-down-base/_theme.scss +4 -4
  136. package/styles/drop-down-base/bootstrap-dark.css +42 -1
  137. package/styles/drop-down-base/bootstrap.css +42 -1
  138. package/styles/drop-down-base/bootstrap4.css +42 -1
  139. package/styles/drop-down-base/bootstrap5-dark.css +42 -1
  140. package/styles/drop-down-base/bootstrap5.css +42 -1
  141. package/styles/drop-down-base/fabric-dark.css +42 -1
  142. package/styles/drop-down-base/fabric.css +42 -1
  143. package/styles/drop-down-base/fluent-dark.css +42 -1
  144. package/styles/drop-down-base/fluent.css +42 -1
  145. package/styles/drop-down-base/highcontrast-light.css +42 -1
  146. package/styles/drop-down-base/highcontrast.css +42 -1
  147. package/styles/drop-down-base/material-dark.css +42 -1
  148. package/styles/drop-down-base/material.css +42 -1
  149. package/styles/drop-down-base/tailwind-dark.css +42 -1
  150. package/styles/drop-down-base/tailwind.css +42 -1
  151. package/styles/drop-down-list/_all.scss +2 -1
  152. package/styles/drop-down-list/_bootstrap-dark-definition.scss +2 -1
  153. package/styles/drop-down-list/_bootstrap-definition.scss +2 -1
  154. package/styles/drop-down-list/_bootstrap4-definition.scss +3 -1
  155. package/styles/drop-down-list/_bootstrap5-definition.scss +3 -3
  156. package/styles/drop-down-list/_fabric-dark-definition.scss +2 -1
  157. package/styles/drop-down-list/_fabric-definition.scss +2 -0
  158. package/styles/drop-down-list/_fluent-definition.scss +2 -1
  159. package/styles/drop-down-list/_fusionnew-definition.scss +3 -3
  160. package/styles/drop-down-list/_highcontrast-definition.scss +21 -10
  161. package/styles/drop-down-list/_highcontrast-light-definition.scss +22 -11
  162. package/styles/drop-down-list/_layout.scss +11 -9
  163. package/styles/drop-down-list/_material-dark-definition.scss +2 -2
  164. package/styles/drop-down-list/_material-definition.scss +1 -0
  165. package/styles/drop-down-list/_material3-definition.scss +3 -3
  166. package/styles/drop-down-list/_tailwind-definition.scss +1 -0
  167. package/styles/drop-down-list/_theme.scss +3 -3
  168. package/styles/drop-down-list/bootstrap-dark.css +8 -0
  169. package/styles/drop-down-list/bootstrap.css +8 -0
  170. package/styles/drop-down-list/bootstrap4.css +8 -0
  171. package/styles/drop-down-list/bootstrap5-dark.css +9 -0
  172. package/styles/drop-down-list/bootstrap5.css +9 -0
  173. package/styles/drop-down-list/fabric-dark.css +8 -0
  174. package/styles/drop-down-list/fabric.css +8 -0
  175. package/styles/drop-down-list/fluent-dark.css +9 -0
  176. package/styles/drop-down-list/fluent.css +9 -0
  177. package/styles/drop-down-list/highcontrast-light.css +8 -0
  178. package/styles/drop-down-list/highcontrast.css +8 -0
  179. package/styles/drop-down-list/icons/_bootstrap.scss +0 -1
  180. package/styles/drop-down-list/icons/_fabric.scss +0 -1
  181. package/styles/drop-down-list/icons/_material.scss +0 -1
  182. package/styles/drop-down-list/material-dark.css +8 -0
  183. package/styles/drop-down-list/material.css +8 -0
  184. package/styles/drop-down-list/tailwind-dark.css +9 -0
  185. package/styles/drop-down-list/tailwind.css +9 -0
  186. package/styles/drop-down-tree/_all.scss +1 -1
  187. package/styles/drop-down-tree/_bootstrap-dark-definition.scss +1 -1
  188. package/styles/drop-down-tree/_bootstrap-definition.scss +1 -1
  189. package/styles/drop-down-tree/_bootstrap4-definition.scss +1 -1
  190. package/styles/drop-down-tree/_bootstrap5-definition.scss +2 -2
  191. package/styles/drop-down-tree/_fabric-dark-definition.scss +1 -1
  192. package/styles/drop-down-tree/_fabric-definition.scss +2 -2
  193. package/styles/drop-down-tree/_fluent-definition.scss +2 -2
  194. package/styles/drop-down-tree/_fusionnew-definition.scss +2 -2
  195. package/styles/drop-down-tree/_highcontrast-definition.scss +1 -1
  196. package/styles/drop-down-tree/_highcontrast-light-definition.scss +1 -1
  197. package/styles/drop-down-tree/_layout.scss +10 -3
  198. package/styles/drop-down-tree/_material-dark-definition.scss +2 -2
  199. package/styles/drop-down-tree/_material-definition.scss +2 -2
  200. package/styles/drop-down-tree/_material3-definition.scss +2 -2
  201. package/styles/drop-down-tree/_tailwind-definition.scss +2 -2
  202. package/styles/drop-down-tree/bootstrap-dark.css +4 -0
  203. package/styles/drop-down-tree/bootstrap.css +4 -0
  204. package/styles/drop-down-tree/bootstrap4.css +4 -0
  205. package/styles/drop-down-tree/bootstrap5-dark.css +9 -1
  206. package/styles/drop-down-tree/bootstrap5.css +9 -1
  207. package/styles/drop-down-tree/fabric-dark.css +4 -0
  208. package/styles/drop-down-tree/fabric.css +4 -0
  209. package/styles/drop-down-tree/fluent-dark.css +5 -0
  210. package/styles/drop-down-tree/fluent.css +5 -0
  211. package/styles/drop-down-tree/highcontrast-light.css +4 -0
  212. package/styles/drop-down-tree/highcontrast.css +4 -0
  213. package/styles/drop-down-tree/icons/_bootstrap.scss +0 -1
  214. package/styles/drop-down-tree/icons/_bootstrap4.scss +0 -1
  215. package/styles/drop-down-tree/icons/_fabric.scss +0 -1
  216. package/styles/drop-down-tree/icons/_highcontrast-light.scss +0 -1
  217. package/styles/drop-down-tree/icons/_highcontrast.scss +0 -1
  218. package/styles/drop-down-tree/icons/_material-dark.scss +0 -1
  219. package/styles/drop-down-tree/icons/_material.scss +0 -1
  220. package/styles/drop-down-tree/material-dark.css +4 -0
  221. package/styles/drop-down-tree/material.css +4 -0
  222. package/styles/drop-down-tree/tailwind-dark.css +5 -0
  223. package/styles/drop-down-tree/tailwind.css +5 -0
  224. package/styles/fabric-dark.css +129 -52
  225. package/styles/fabric-dark.scss +1 -0
  226. package/styles/fabric.css +129 -52
  227. package/styles/fabric.scss +1 -0
  228. package/styles/fluent-dark.css +129 -47
  229. package/styles/fluent-dark.scss +1 -0
  230. package/styles/fluent.css +129 -47
  231. package/styles/fluent.scss +1 -0
  232. package/styles/highcontrast-light.css +124 -44
  233. package/styles/highcontrast-light.scss +1 -0
  234. package/styles/highcontrast.css +133 -53
  235. package/styles/highcontrast.scss +1 -0
  236. package/styles/list-box/_all.scss +1 -1
  237. package/styles/list-box/_bootstrap-dark-definition.scss +2 -0
  238. package/styles/list-box/_bootstrap-definition.scss +1 -0
  239. package/styles/list-box/_bootstrap4-definition.scss +1 -0
  240. package/styles/list-box/_bootstrap5-definition.scss +3 -0
  241. package/styles/list-box/_fabric-dark-definition.scss +3 -1
  242. package/styles/list-box/_fabric-definition.scss +1 -0
  243. package/styles/list-box/_fluent-definition.scss +3 -0
  244. package/styles/list-box/_fusionnew-definition.scss +1 -0
  245. package/styles/list-box/_highcontrast-definition.scss +1 -0
  246. package/styles/list-box/_highcontrast-light-definition.scss +3 -1
  247. package/styles/list-box/_layout.scss +8 -17
  248. package/styles/list-box/_material-dark-definition.scss +2 -0
  249. package/styles/list-box/_material-definition.scss +1 -0
  250. package/styles/list-box/_material3-definition.scss +1 -0
  251. package/styles/list-box/_tailwind-definition.scss +3 -0
  252. package/styles/list-box/_theme.scss +11 -25
  253. package/styles/list-box/bootstrap-dark.css +12 -33
  254. package/styles/list-box/bootstrap.css +14 -35
  255. package/styles/list-box/bootstrap4.css +14 -35
  256. package/styles/list-box/bootstrap5-dark.css +15 -36
  257. package/styles/list-box/bootstrap5.css +15 -36
  258. package/styles/list-box/fabric-dark.css +12 -33
  259. package/styles/list-box/fabric.css +14 -35
  260. package/styles/list-box/fluent-dark.css +15 -36
  261. package/styles/list-box/fluent.css +15 -36
  262. package/styles/list-box/highcontrast-light.css +12 -33
  263. package/styles/list-box/highcontrast.css +14 -35
  264. package/styles/list-box/icons/_bootstrap-dark.scss +2 -2
  265. package/styles/list-box/icons/_bootstrap.scss +1 -1
  266. package/styles/list-box/icons/_bootstrap4.scss +1 -1
  267. package/styles/list-box/icons/_bootstrap5.scss +1 -1
  268. package/styles/list-box/icons/_fabric-dark.scss +1 -1
  269. package/styles/list-box/icons/_fabric.scss +1 -1
  270. package/styles/list-box/icons/_fluent.scss +1 -1
  271. package/styles/list-box/icons/_fusionnew.scss +1 -1
  272. package/styles/list-box/icons/_highcontrast-light.scss +1 -1
  273. package/styles/list-box/icons/_highcontrast.scss +1 -1
  274. package/styles/list-box/icons/_material-dark.scss +1 -1
  275. package/styles/list-box/icons/_material.scss +2 -2
  276. package/styles/list-box/icons/_material3.scss +1 -1
  277. package/styles/list-box/icons/_tailwind-dark.scss +1 -1
  278. package/styles/list-box/icons/_tailwind.scss +1 -1
  279. package/styles/list-box/material-dark.css +12 -33
  280. package/styles/list-box/material.css +14 -35
  281. package/styles/list-box/tailwind-dark.css +15 -36
  282. package/styles/list-box/tailwind.css +15 -36
  283. package/styles/material-dark.css +120 -43
  284. package/styles/material-dark.scss +1 -0
  285. package/styles/material.css +120 -43
  286. package/styles/material.scss +1 -0
  287. package/styles/mention/_all.scss +1 -0
  288. package/styles/mention/_bootstrap-dark-definition.scss +3 -0
  289. package/styles/mention/_bootstrap-definition.scss +3 -0
  290. package/styles/mention/_bootstrap4-definition.scss +3 -0
  291. package/styles/mention/_bootstrap5-dark-definition.scss +1 -0
  292. package/styles/mention/_bootstrap5-definition.scss +1 -0
  293. package/styles/mention/_fabric-dark-definition.scss +2 -0
  294. package/styles/mention/_fabric-definition.scss +3 -0
  295. package/styles/mention/_fluent-dark-definition.scss +1 -0
  296. package/styles/mention/_fluent-definition.scss +1 -0
  297. package/styles/mention/_fusionnew-definition.scss +1 -0
  298. package/styles/mention/_highcontrast-definition.scss +3 -0
  299. package/styles/mention/_highcontrast-light-definition.scss +3 -0
  300. package/styles/mention/_layout.scss +6 -0
  301. package/styles/mention/_material-dark-definition.scss +3 -0
  302. package/styles/mention/_material-definition.scss +3 -0
  303. package/styles/mention/_material3-definition.scss +1 -0
  304. package/styles/mention/_tailwind-dark-definition.scss +1 -0
  305. package/styles/mention/_tailwind-definition.scss +1 -0
  306. package/styles/mention/bootstrap-dark.css +29 -0
  307. package/styles/mention/bootstrap-dark.scss +6 -0
  308. package/styles/mention/bootstrap.css +29 -0
  309. package/styles/mention/bootstrap.scss +6 -0
  310. package/styles/mention/bootstrap4.css +47 -0
  311. package/styles/mention/bootstrap4.scss +6 -0
  312. package/styles/mention/bootstrap5-dark.css +58 -0
  313. package/styles/mention/bootstrap5-dark.scss +6 -0
  314. package/styles/mention/bootstrap5.css +58 -0
  315. package/styles/mention/bootstrap5.scss +6 -0
  316. package/styles/mention/fabric-dark.css +29 -0
  317. package/styles/mention/fabric-dark.scss +6 -0
  318. package/styles/mention/fabric.css +29 -0
  319. package/styles/mention/fabric.scss +6 -0
  320. package/styles/mention/fluent-dark.css +58 -0
  321. package/styles/mention/fluent-dark.scss +6 -0
  322. package/styles/mention/fluent.css +58 -0
  323. package/styles/mention/fluent.scss +6 -0
  324. package/styles/mention/highcontrast-light.css +43 -0
  325. package/styles/mention/highcontrast-light.scss +6 -0
  326. package/styles/mention/highcontrast.css +43 -0
  327. package/styles/mention/highcontrast.scss +6 -0
  328. package/styles/mention/material-dark.css +29 -0
  329. package/styles/mention/material-dark.scss +6 -0
  330. package/styles/mention/material.css +29 -0
  331. package/styles/mention/material.scss +6 -0
  332. package/styles/mention/tailwind-dark.css +68 -0
  333. package/styles/mention/tailwind-dark.scss +6 -0
  334. package/styles/mention/tailwind.css +68 -0
  335. package/styles/mention/tailwind.scss +6 -0
  336. package/styles/multi-select/_all.scss +1 -1
  337. package/styles/multi-select/_bootstrap-dark-definition.scss +11 -1
  338. package/styles/multi-select/_bootstrap-definition.scss +9 -0
  339. package/styles/multi-select/_bootstrap4-definition.scss +20 -9
  340. package/styles/multi-select/_bootstrap5-definition.scss +11 -3
  341. package/styles/multi-select/_fabric-dark-definition.scss +16 -7
  342. package/styles/multi-select/_fabric-definition.scss +15 -6
  343. package/styles/multi-select/_fluent-definition.scss +11 -2
  344. package/styles/multi-select/_fusionnew-definition.scss +10 -2
  345. package/styles/multi-select/_highcontrast-definition.scss +59 -29
  346. package/styles/multi-select/_highcontrast-light-definition.scss +55 -25
  347. package/styles/multi-select/_layout.scss +91 -78
  348. package/styles/multi-select/_material-dark-definition.scss +10 -1
  349. package/styles/multi-select/_material-definition.scss +8 -0
  350. package/styles/multi-select/_material3-definition.scss +9 -2
  351. package/styles/multi-select/_tailwind-definition.scss +11 -4
  352. package/styles/multi-select/_theme.scss +20 -21
  353. package/styles/multi-select/bootstrap-dark.css +34 -8
  354. package/styles/multi-select/bootstrap.css +34 -8
  355. package/styles/multi-select/bootstrap4.css +46 -19
  356. package/styles/multi-select/bootstrap5-dark.css +38 -11
  357. package/styles/multi-select/bootstrap5.css +38 -11
  358. package/styles/multi-select/fabric-dark.css +42 -16
  359. package/styles/multi-select/fabric.css +42 -16
  360. package/styles/multi-select/fluent-dark.css +36 -9
  361. package/styles/multi-select/fluent.css +36 -9
  362. package/styles/multi-select/highcontrast-light.css +37 -8
  363. package/styles/multi-select/highcontrast.css +46 -17
  364. package/styles/multi-select/icons/_bootstrap5.scss +0 -1
  365. package/styles/multi-select/icons/_fluent.scss +0 -1
  366. package/styles/multi-select/icons/_fusionnew.scss +0 -1
  367. package/styles/multi-select/icons/_material-dark.scss +53 -54
  368. package/styles/multi-select/icons/_material.scss +53 -54
  369. package/styles/multi-select/icons/_material3.scss +0 -1
  370. package/styles/multi-select/icons/_tailwind.scss +0 -1
  371. package/styles/multi-select/material-dark.css +33 -7
  372. package/styles/multi-select/material.css +33 -7
  373. package/styles/multi-select/tailwind-dark.css +38 -9
  374. package/styles/multi-select/tailwind.css +38 -9
  375. package/styles/tailwind-dark.css +132 -47
  376. package/styles/tailwind-dark.scss +1 -0
  377. package/styles/tailwind.css +132 -47
  378. package/styles/tailwind.scss +1 -0
@@ -6,9 +6,6 @@ import { Input, TextBox } from '@syncfusion/ej2-inputs';
6
6
  import { Button, createCheckBox } from '@syncfusion/ej2-buttons';
7
7
  import { TreeView } from '@syncfusion/ej2-navigations';
8
8
 
9
- /**
10
- * IncrementalSearch module file
11
- */
12
9
  var queryString = '';
13
10
  var prevString = '';
14
11
  var matches$1 = [];
@@ -81,7 +78,7 @@ function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, elementId)
81
78
  * @param {boolean} ignoreCase - Specifies the case sensitive option for search operation.
82
79
  * @returns {Element | number} Returns the search matched items.
83
80
  */
84
- function Search(inputVal, items, searchType, ignoreCase) {
81
+ function Search(inputVal, items, searchType, ignoreCase, dataSource, fields, type) {
85
82
  var listItems = items;
86
83
  ignoreCase = ignoreCase !== undefined && ignoreCase !== null ? ignoreCase : true;
87
84
  var itemData = { item: null, index: null };
@@ -89,14 +86,32 @@ function Search(inputVal, items, searchType, ignoreCase) {
89
86
  var strLength = inputVal.length;
90
87
  var queryStr = ignoreCase ? inputVal.toLocaleLowerCase() : inputVal;
91
88
  queryStr = escapeCharRegExp(queryStr);
92
- for (var i = 0, itemsData = listItems; i < itemsData.length; i++) {
89
+ var _loop_1 = function (i, itemsData) {
93
90
  var item = itemsData[i];
94
- var text = (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
91
+ var text = void 0;
92
+ var filterValue;
93
+ if (items && dataSource) {
94
+ var checkField_1 = item;
95
+ var fieldValue_1 = fields.text.split('.');
96
+ dataSource.filter(function (data) {
97
+ Array.prototype.slice.call(fieldValue_1).forEach(function (value) {
98
+ if (type === 'object' && checkField_1.textContent.toString().indexOf(data[value]) !== -1 && checkField_1.getAttribute('data-value') === data[fields.value] || type === 'string' && checkField_1.textContent.toString().indexOf(data) !== -1) {
99
+ filterValue = type === 'object' ? data[value] : data;
100
+ }
101
+ });
102
+ });
103
+ }
104
+ text = dataSource && filterValue ? (ignoreCase ? filterValue.toLocaleLowerCase() : filterValue).replace(/^\s+|\s+$/g, '') : (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
95
105
  if ((searchType === 'Equal' && text === queryStr) || (searchType === 'StartsWith' && text.substr(0, strLength) === queryStr) || (searchType === 'EndsWith' && text.substr(text.length - queryStr.length) === queryStr) || (searchType === 'Contains' && new RegExp(queryStr, "g").test(text))) {
96
106
  itemData.item = item;
97
107
  itemData.index = i;
98
- return { item: item, index: i };
108
+ return { value: { item: item, index: i } };
99
109
  }
110
+ };
111
+ for (var i = 0, itemsData = listItems; i < itemsData.length; i++) {
112
+ var state_1 = _loop_1(i, itemsData);
113
+ if (typeof state_1 === "object")
114
+ return state_1.value;
100
115
  }
101
116
  return itemData;
102
117
  }
@@ -232,6 +247,8 @@ var dropDownBaseClasses = {
232
247
  grouping: 'e-dd-group'
233
248
  };
234
249
  var ITEMTEMPLATE_PROPERTY = 'ItemTemplate';
250
+ var DISPLAYTEMPLATE_PROPERTY = 'DisplayTemplate';
251
+ var SPINNERTEMPLATE_PROPERTY = 'SpinnerTemplate';
235
252
  var VALUETEMPLATE_PROPERTY = 'ValueTemplate';
236
253
  var GROUPTEMPLATE_PROPERTY = 'GroupTemplate';
237
254
  var HEADERTEMPLATE_PROPERTY = 'HeaderTemplate';
@@ -257,6 +274,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
257
274
  _this.isAngular = false;
258
275
  _this.isPreventChange = false;
259
276
  _this.isDynamicDataChange = false;
277
+ _this.addedNewItem = false;
260
278
  return _this;
261
279
  }
262
280
  DropDownBase.prototype.getPropObject = function (prop, newProp, oldProp) {
@@ -428,7 +446,8 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
428
446
  this.l10n = componentLocale;
429
447
  }
430
448
  else {
431
- this.l10n = new L10n(this.getModuleName() === 'listbox' ? 'listbox' : 'dropdowns', l10nLocale, this.locale);
449
+ this.l10n = new L10n(this.getModuleName() === 'listbox' ? 'listbox' :
450
+ this.getModuleName() === 'mention' ? 'mention' : 'dropdowns', l10nLocale, this.locale);
432
451
  }
433
452
  var content = actionFailure ?
434
453
  this.l10n.getConstant('actionFailureTemplate') : this.l10n.getConstant('noRecordsTemplate');
@@ -437,9 +456,12 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
437
456
  liElem.textContent = content;
438
457
  ele.appendChild(liElem);
439
458
  liElem.classList.add('e-list-nrt');
459
+ liElem.setAttribute('role', 'option');
440
460
  }
441
461
  else {
442
- ele.innerHTML = content;
462
+ if (!isNullOrUndefined(ele)) {
463
+ ele.innerHTML = content;
464
+ }
443
465
  }
444
466
  }
445
467
  };
@@ -470,14 +492,16 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
470
492
  * @returns {void}
471
493
  */
472
494
  DropDownBase.prototype.setEnableRtl = function () {
473
- if (this.list) {
474
- this.enableRtlElements.push(this.list);
475
- }
476
- if (this.enableRtl) {
477
- addClass(this.enableRtlElements, dropDownBaseClasses.rtl);
478
- }
479
- else {
480
- removeClass(this.enableRtlElements, dropDownBaseClasses.rtl);
495
+ if (!isNullOrUndefined(this.enableRtlElements)) {
496
+ if (this.list) {
497
+ this.enableRtlElements.push(this.list);
498
+ }
499
+ if (this.enableRtl) {
500
+ addClass(this.enableRtlElements, dropDownBaseClasses.rtl);
501
+ }
502
+ else {
503
+ removeClass(this.enableRtlElements, dropDownBaseClasses.rtl);
504
+ }
481
505
  }
482
506
  };
483
507
  /**
@@ -485,7 +509,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
485
509
  *
486
510
  * @returns {void}
487
511
  */
488
- DropDownBase.prototype.initialize = function () {
512
+ DropDownBase.prototype.initialize = function (e) {
489
513
  this.bindEvent = true;
490
514
  this.actionFailureTemplateId = "" + this.element.id + ACTIONFAILURETEMPLATE_PROPERTY;
491
515
  if (this.element.tagName === 'UL') {
@@ -504,7 +528,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
504
528
  }
505
529
  }
506
530
  else {
507
- this.setListData(this.dataSource, this.fields, this.query);
531
+ this.setListData(this.dataSource, this.fields, this.query, e);
508
532
  }
509
533
  };
510
534
  /**
@@ -515,14 +539,6 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
515
539
  DropDownBase.prototype.getPersistData = function () {
516
540
  return this.addOnPersist([]);
517
541
  };
518
- /**
519
- * Sets the enabled state to DropDownBase.
520
- *
521
- * @returns {void}
522
- */
523
- DropDownBase.prototype.setEnabled = function () {
524
- this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
525
- };
526
542
  /**
527
543
  * Sets the enabled state to DropDownBase.
528
544
  *
@@ -530,7 +546,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
530
546
  * @returns {void}
531
547
  */
532
548
  DropDownBase.prototype.updateDataAttribute = function (value) {
533
- var invalidAttr = ['class', 'style', 'id', 'type'];
549
+ var invalidAttr = ['class', 'style', 'id', 'type', 'aria-expanded', 'aria-autocomplete', 'aria-readonly'];
534
550
  var attr = {};
535
551
  for (var a = 0; a < this.element.attributes.length; a++) {
536
552
  if (invalidAttr.indexOf(this.element.attributes[a].name) === -1 &&
@@ -598,6 +614,8 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
598
614
  this.isRequested = false;
599
615
  this.isDataFetched = false;
600
616
  this.itemTemplateId = "" + this.element.id + ITEMTEMPLATE_PROPERTY;
617
+ this.displayTemplateId = "" + this.element.id + DISPLAYTEMPLATE_PROPERTY;
618
+ this.spinnerTemplateId = "" + this.element.id + SPINNERTEMPLATE_PROPERTY;
601
619
  this.valueTemplateId = "" + this.element.id + VALUETEMPLATE_PROPERTY;
602
620
  this.groupTemplateId = "" + this.element.id + GROUPTEMPLATE_PROPERTY;
603
621
  this.headerTemplateId = "" + this.element.id + HEADERTEMPLATE_PROPERTY;
@@ -612,7 +630,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
612
630
  * @param {Query} query - Accepts the external Query that execute along with data processing.
613
631
  * @returns {void}
614
632
  */
615
- DropDownBase.prototype.setListData = function (dataSource, fields, query) {
633
+ DropDownBase.prototype.setListData = function (dataSource, fields, query, event) {
616
634
  var _this = this;
617
635
  fields = fields ? fields : this.fields;
618
636
  var ulElement;
@@ -637,10 +655,10 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
637
655
  _this.isDataFetched = true;
638
656
  }
639
657
  ulElement = _this.renderItems(listItems, fields);
658
+ _this.onActionComplete(ulElement, listItems, e);
640
659
  if (_this.groupTemplate) {
641
660
  _this.renderGroupTemplate(ulElement);
642
661
  }
643
- _this.onActionComplete(ulElement, listItems, e);
644
662
  _this.isRequested = false;
645
663
  _this.bindChildItems(listItems, ulElement, fields, e);
646
664
  }
@@ -659,7 +677,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
659
677
  _this.trigger('actionComplete', localDataArgs, function (localDataArgs) {
660
678
  if (!localDataArgs.cancel) {
661
679
  ulElement = _this.renderItems(localDataArgs.result, fields);
662
- _this.onActionComplete(ulElement, localDataArgs.result);
680
+ _this.onActionComplete(ulElement, localDataArgs.result, event);
663
681
  if (_this.groupTemplate) {
664
682
  _this.renderGroupTemplate(ulElement);
665
683
  }
@@ -742,7 +760,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
742
760
  this.liCollections = [];
743
761
  this.trigger('actionFailure', e);
744
762
  this.l10nUpdate(true);
745
- addClass([this.list], dropDownBaseClasses.noData);
763
+ if (!isNullOrUndefined(this.list)) {
764
+ addClass([this.list], dropDownBaseClasses.noData);
765
+ }
746
766
  };
747
767
  /* eslint-disable @typescript-eslint/no-unused-vars */
748
768
  DropDownBase.prototype.onActionComplete = function (ulElement, list, e) {
@@ -869,18 +889,22 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
869
889
  return extend({}, options, fields, true);
870
890
  };
871
891
  DropDownBase.prototype.setFloatingHeader = function (e) {
872
- if (isNullOrUndefined(this.fixedHeaderElement)) {
873
- this.fixedHeaderElement = this.createElement('div', { className: dropDownBaseClasses.fixedHead });
874
- if (!this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
875
- this.fixedHeaderElement.style.display = 'none';
892
+ if (!isNullOrUndefined(this.list) && !this.list.classList.contains(dropDownBaseClasses.noData)) {
893
+ if (isNullOrUndefined(this.fixedHeaderElement)) {
894
+ this.fixedHeaderElement = this.createElement('div', { className: dropDownBaseClasses.fixedHead });
895
+ if (!isNullOrUndefined(this.list) && !this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
896
+ this.fixedHeaderElement.style.display = 'none';
897
+ }
898
+ if (!isNullOrUndefined(this.fixedHeaderElement) && !isNullOrUndefined(this.list)) {
899
+ prepend([this.fixedHeaderElement], this.list);
900
+ }
901
+ this.setFixedHeader();
876
902
  }
877
- prepend([this.fixedHeaderElement], this.list);
878
- this.setFixedHeader();
879
- }
880
- if (!isNullOrUndefined(this.fixedHeaderElement) && this.fixedHeaderElement.style.zIndex === '0') {
881
- this.setFixedHeader();
903
+ if (!isNullOrUndefined(this.fixedHeaderElement) && this.fixedHeaderElement.style.zIndex === '0') {
904
+ this.setFixedHeader();
905
+ }
906
+ this.scrollStop(e);
882
907
  }
883
- this.scrollStop(e);
884
908
  };
885
909
  DropDownBase.prototype.scrollStop = function (e) {
886
910
  var target = !isNullOrUndefined(e) ? e.target : this.list;
@@ -964,7 +988,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
964
988
  return item;
965
989
  };
966
990
  DropDownBase.prototype.setFixedHeader = function () {
967
- this.list.parentElement.style.display = 'block';
991
+ if (!isNullOrUndefined(this.list)) {
992
+ this.list.parentElement.style.display = 'block';
993
+ }
968
994
  var borderWidth = 0;
969
995
  if (this.list && this.list.parentElement) {
970
996
  borderWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-width'), 10);
@@ -979,8 +1005,10 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
979
1005
  borderWidth = (borderTopWidth + borderBottomWidth + borderLeftWidth + borderRightWidth);
980
1006
  }
981
1007
  }
982
- var liWidth = this.getValidLi().offsetWidth - borderWidth;
983
- this.fixedHeaderElement.style.width = liWidth.toString() + 'px';
1008
+ if (!isNullOrUndefined(this.liCollections)) {
1009
+ var liWidth = this.getValidLi().offsetWidth - borderWidth;
1010
+ this.fixedHeaderElement.style.width = liWidth.toString() + 'px';
1011
+ }
984
1012
  setStyleAttribute(this.fixedHeaderElement, { zIndex: 10 });
985
1013
  var firstLi = this.ulElement.querySelector('.' + dropDownBaseClasses.group + ':not(.e-hide-listitem)');
986
1014
  this.fixedHeaderElement.innerHTML = firstLi.innerHTML;
@@ -1049,7 +1077,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1049
1077
  * @param {Query} query - Accepts the external Query that execute along with data processing.
1050
1078
  * @returns {void}
1051
1079
  */
1052
- DropDownBase.prototype.resetList = function (dataSource, fields, query) {
1080
+ DropDownBase.prototype.resetList = function (dataSource, fields, query, e) {
1053
1081
  if (this.list) {
1054
1082
  if ((this.element.tagName === 'SELECT' && this.element.options.length > 0)
1055
1083
  || (this.element.tagName === 'UL' && this.element.childNodes.length > 0)) {
@@ -1059,8 +1087,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1059
1087
  dataSource = this.selectData;
1060
1088
  }
1061
1089
  }
1062
- dataSource = this.getModuleName() === 'combobox' && this.selectData && dataSource instanceof Array && dataSource.length < this.selectData.length ? this.selectData : dataSource;
1063
- this.setListData(dataSource, fields, query);
1090
+ dataSource = this.getModuleName() === 'combobox' && this.selectData && dataSource instanceof Array && dataSource.length < this.selectData.length && this.addedNewItem ? this.selectData : dataSource;
1091
+ this.addedNewItem = false;
1092
+ this.setListData(dataSource, fields, query, e);
1064
1093
  }
1065
1094
  };
1066
1095
  DropDownBase.prototype.updateSelectElementData = function (isFiltering) {
@@ -1123,9 +1152,6 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1123
1152
  case 'enableRtl':
1124
1153
  this.setEnableRtl();
1125
1154
  break;
1126
- case 'enabled':
1127
- this.setEnabled();
1128
- break;
1129
1155
  case 'groupTemplate':
1130
1156
  this.renderGroupTemplate(this.list);
1131
1157
  if (this.ulElement && this.fixedHeaderElement) {
@@ -1152,7 +1178,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1152
1178
  * @private
1153
1179
  * @returns {void}
1154
1180
  */
1155
- DropDownBase.prototype.render = function (isEmptyData) {
1181
+ DropDownBase.prototype.render = function (e, isEmptyData) {
1156
1182
  this.list = this.createElement('div', { className: dropDownBaseClasses.content, attrs: { 'tabindex': '0' } });
1157
1183
  this.list.classList.add(dropDownBaseClasses.root);
1158
1184
  this.setFields();
@@ -1174,9 +1200,8 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1174
1200
  wrapperElement.appendChild(this.list);
1175
1201
  }
1176
1202
  this.setEnableRtl();
1177
- this.setEnabled();
1178
1203
  if (!isEmptyData) {
1179
- this.initialize();
1204
+ this.initialize(e);
1180
1205
  }
1181
1206
  };
1182
1207
  /**
@@ -1202,7 +1227,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1202
1227
  * Adds a new item to the popup list. By default, new item appends to the list as the last item,
1203
1228
  * but you can insert based on the index parameter.
1204
1229
  *
1205
- * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
1230
+ * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
1206
1231
  * @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
1207
1232
  * @returns {void}
1208
1233
  * @deprecated
@@ -1266,11 +1291,17 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1266
1291
  this.trigger('beforeItemRender', { element: li, item: item });
1267
1292
  }
1268
1293
  if (itemsCount === 0 && isNullOrUndefined(this.list.querySelector('ul'))) {
1269
- this.list.innerHTML = '';
1270
- this.list.classList.remove(dropDownBaseClasses.noData);
1271
- this.list.appendChild(this.ulElement);
1294
+ if (!isNullOrUndefined(this.list)) {
1295
+ this.list.innerHTML = '';
1296
+ this.list.classList.remove(dropDownBaseClasses.noData);
1297
+ if (!isNullOrUndefined(this.ulElement)) {
1298
+ this.list.appendChild(this.ulElement);
1299
+ }
1300
+ }
1272
1301
  this.liCollections = liCollections;
1273
- append(liCollections, this.ulElement);
1302
+ if (!isNullOrUndefined(liCollections) && !isNullOrUndefined(this.ulElement)) {
1303
+ append(liCollections, this.ulElement);
1304
+ }
1274
1305
  this.updateAddItemList(this.list, itemsCount);
1275
1306
  }
1276
1307
  else {
@@ -1317,6 +1348,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1317
1348
  if (selectedItemValue || itemIndex === 0) {
1318
1349
  this.updateSelection();
1319
1350
  }
1351
+ this.addedNewItem = true;
1320
1352
  };
1321
1353
  DropDownBase.prototype.validationAttribute = function (target, hidden) {
1322
1354
  var name = target.getAttribute('name') ? target.getAttribute('name') : target.getAttribute('id');
@@ -1390,14 +1422,16 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1390
1422
  }
1391
1423
  detach(this.list);
1392
1424
  }
1425
+ this.liCollections = null;
1426
+ this.ulElement = null;
1427
+ this.list = null;
1428
+ this.enableRtlElements = null;
1429
+ this.rippleFun = null;
1393
1430
  _super.prototype.destroy.call(this);
1394
1431
  };
1395
1432
  __decorate([
1396
1433
  Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
1397
1434
  ], DropDownBase.prototype, "fields", void 0);
1398
- __decorate([
1399
- Property(false)
1400
- ], DropDownBase.prototype, "enablePersistence", void 0);
1401
1435
  __decorate([
1402
1436
  Property(null)
1403
1437
  ], DropDownBase.prototype, "itemTemplate", void 0);
@@ -1413,9 +1447,6 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1413
1447
  __decorate([
1414
1448
  Property('None')
1415
1449
  ], DropDownBase.prototype, "sortOrder", void 0);
1416
- __decorate([
1417
- Property(true)
1418
- ], DropDownBase.prototype, "enabled", void 0);
1419
1450
  __decorate([
1420
1451
  Property([])
1421
1452
  ], DropDownBase.prototype, "dataSource", void 0);
@@ -1611,8 +1642,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1611
1642
  this.popupObj.setProperties({ 'zIndex': this.zIndex });
1612
1643
  }
1613
1644
  };
1614
- DropDownList.prototype.renderList = function (isEmptyData) {
1615
- _super.prototype.render.call(this, isEmptyData);
1645
+ DropDownList.prototype.renderList = function (e, isEmptyData) {
1646
+ _super.prototype.render.call(this, e, isEmptyData);
1616
1647
  this.unWireListEvents();
1617
1648
  this.wireListEvents();
1618
1649
  };
@@ -1644,6 +1675,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1644
1675
  }
1645
1676
  };
1646
1677
  DropDownList.prototype.clearAll = function (e, properties) {
1678
+ this.previousItemData = (!isNullOrUndefined(this.itemData)) ? this.itemData : null;
1647
1679
  if (isNullOrUndefined(properties) || (!isNullOrUndefined(properties) &&
1648
1680
  (isNullOrUndefined(properties.dataSource) ||
1649
1681
  (!(properties.dataSource instanceof DataManager) && properties.dataSource.length === 0)))) {
@@ -1669,14 +1701,18 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1669
1701
  }
1670
1702
  else {
1671
1703
  if (this.allowFiltering && this.getModuleName() !== 'autocomplete'
1672
- && !isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list)) {
1704
+ && !isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list) && this.actionCompleteData.list.length > 0) {
1673
1705
  this.onActionComplete(this.actionCompleteData.ulElement.cloneNode(true), this.actionCompleteData.list);
1674
1706
  }
1675
1707
  this.resetFocusElement();
1676
1708
  }
1677
1709
  }
1678
- this.hiddenElement.innerHTML = '';
1679
- this.inputElement.value = '';
1710
+ if (!isNullOrUndefined(this.hiddenElement)) {
1711
+ this.hiddenElement.innerHTML = '';
1712
+ }
1713
+ if (!isNullOrUndefined(this.inputElement)) {
1714
+ this.inputElement.value = '';
1715
+ }
1680
1716
  this.value = null;
1681
1717
  this.itemData = null;
1682
1718
  this.text = null;
@@ -1699,42 +1735,42 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1699
1735
  for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
1700
1736
  var htmlAttr = _a[_i];
1701
1737
  if (htmlAttr === 'class') {
1702
- var updatedClassValue = (this.htmlAttributes[htmlAttr].replace(/\s+/g, ' ')).trim();
1738
+ var updatedClassValue = (this.htmlAttributes["" + htmlAttr].replace(/\s+/g, ' ')).trim();
1703
1739
  if (updatedClassValue !== '') {
1704
1740
  addClass([this.inputWrapper.container], updatedClassValue.split(' '));
1705
1741
  }
1706
1742
  }
1707
- else if (htmlAttr === 'disabled' && this.htmlAttributes[htmlAttr] === 'disabled') {
1743
+ else if (htmlAttr === 'disabled' && this.htmlAttributes["" + htmlAttr] === 'disabled') {
1708
1744
  this.enabled = false;
1709
1745
  this.setEnable();
1710
1746
  }
1711
- else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes[htmlAttr])) {
1747
+ else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes["" + htmlAttr])) {
1712
1748
  this.readonly = true;
1713
1749
  this.dataBind();
1714
1750
  }
1715
1751
  else if (htmlAttr === 'style') {
1716
- this.inputWrapper.container.setAttribute('style', this.htmlAttributes[htmlAttr]);
1752
+ this.inputWrapper.container.setAttribute('style', this.htmlAttributes["" + htmlAttr]);
1717
1753
  }
1718
1754
  else {
1719
- var defaultAttr = ['title', 'id', 'placeholder', 'aria-placeholder',
1720
- 'role', 'autocorrect', 'autocomplete', 'autocapitalize', 'spellcheck', 'minlength', 'maxlength'];
1755
+ var defaultAttr = ['title', 'id', 'placeholder',
1756
+ 'role', 'autocomplete', 'autocapitalize', 'spellcheck', 'minlength', 'maxlength'];
1721
1757
  var validateAttr = ['name', 'required'];
1722
1758
  if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
1723
1759
  defaultAttr.push('tabindex');
1724
1760
  }
1725
1761
  if (validateAttr.indexOf(htmlAttr) > -1 || htmlAttr.indexOf('data') === 0) {
1726
- this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
1762
+ this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
1727
1763
  }
1728
1764
  else if (defaultAttr.indexOf(htmlAttr) > -1) {
1729
1765
  if (htmlAttr === 'placeholder') {
1730
- Input.setPlaceholder(this.htmlAttributes[htmlAttr], this.inputElement);
1766
+ Input.setPlaceholder(this.htmlAttributes["" + htmlAttr], this.inputElement);
1731
1767
  }
1732
1768
  else {
1733
- this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
1769
+ this.inputElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
1734
1770
  }
1735
1771
  }
1736
1772
  else {
1737
- this.inputWrapper.container.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
1773
+ this.inputWrapper.container.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
1738
1774
  }
1739
1775
  }
1740
1776
  }
@@ -1746,11 +1782,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1746
1782
  DropDownList.prototype.getAriaAttributes = function () {
1747
1783
  return {
1748
1784
  'aria-disabled': 'false',
1749
- 'aria-owns': this.element.id + '_options',
1750
1785
  'role': 'combobox',
1751
- 'aria-haspopup': 'true',
1752
1786
  'aria-expanded': 'false',
1753
- 'aria-activedescendant': 'null',
1754
1787
  'aria-live': 'polite',
1755
1788
  'aria-labelledby': this.hiddenElement.id
1756
1789
  };
@@ -1793,7 +1826,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1793
1826
  }
1794
1827
  };
1795
1828
  DropDownList.prototype.targetElement = function () {
1796
- return this.inputWrapper.container;
1829
+ return !isNullOrUndefined(this.inputWrapper) ? this.inputWrapper.container : null;
1797
1830
  };
1798
1831
  DropDownList.prototype.getNgDirective = function () {
1799
1832
  return 'EJS-DROPDOWNLIST';
@@ -1952,7 +1985,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1952
1985
  }
1953
1986
  };
1954
1987
  DropDownList.prototype.unBindCommonEvent = function () {
1955
- if (this.targetElement()) {
1988
+ if (!isNullOrUndefined(this.inputWrapper) && this.targetElement()) {
1956
1989
  EventHandler.remove(this.targetElement(), 'blur', this.onBlurHandler);
1957
1990
  }
1958
1991
  var formElement = this.inputElement && closest(this.inputElement, 'form');
@@ -1982,9 +2015,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1982
2015
  * @returns {void}
1983
2016
  */
1984
2017
  DropDownList.prototype.wireListEvents = function () {
1985
- EventHandler.add(this.list, 'click', this.onMouseClick, this);
1986
- EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
1987
- EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
2018
+ if (!isNullOrUndefined(this.list)) {
2019
+ EventHandler.add(this.list, 'click', this.onMouseClick, this);
2020
+ EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
2021
+ EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
2022
+ }
1988
2023
  };
1989
2024
  DropDownList.prototype.onSearch = function (e) {
1990
2025
  if (e.charCode !== 32 && e.charCode !== 13) {
@@ -2097,7 +2132,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2097
2132
  var isTabAction = e.action === 'tab' || e.action === 'close';
2098
2133
  if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape') {
2099
2134
  this.searchKeyEvent = e;
2100
- this.renderList();
2135
+ this.renderList(e);
2101
2136
  }
2102
2137
  if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
2103
2138
  isNavigation && this.liCollections.length === 0) || this.isRequested) {
@@ -2136,7 +2171,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2136
2171
  }
2137
2172
  break;
2138
2173
  case 'open':
2139
- this.showPopup();
2174
+ this.showPopup(e);
2140
2175
  break;
2141
2176
  case 'hide':
2142
2177
  this.preventAltUp = this.isPopupOpen;
@@ -2262,9 +2297,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2262
2297
  this.setSelection(previousItem, event);
2263
2298
  };
2264
2299
  DropDownList.prototype.unWireEvent = function () {
2265
- EventHandler.remove(this.inputWrapper.container, 'mousedown', this.dropDownClick);
2266
- EventHandler.remove(this.inputWrapper.container, 'keypress', this.onSearch);
2267
- EventHandler.remove(this.inputWrapper.container, 'focus', this.focusIn);
2300
+ if (!isNullOrUndefined(this.inputWrapper)) {
2301
+ EventHandler.remove(this.inputWrapper.container, 'mousedown', this.dropDownClick);
2302
+ EventHandler.remove(this.inputWrapper.container, 'keypress', this.onSearch);
2303
+ EventHandler.remove(this.inputWrapper.container, 'focus', this.focusIn);
2304
+ }
2268
2305
  this.unBindCommonEvent();
2269
2306
  };
2270
2307
  /**
@@ -2273,9 +2310,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2273
2310
  * @returns {void}
2274
2311
  */
2275
2312
  DropDownList.prototype.unWireListEvents = function () {
2276
- EventHandler.remove(this.list, 'click', this.onMouseClick);
2277
- EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
2278
- EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
2313
+ if (this.list) {
2314
+ EventHandler.remove(this.list, 'click', this.onMouseClick);
2315
+ EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
2316
+ EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
2317
+ }
2279
2318
  };
2280
2319
  DropDownList.prototype.checkSelector = function (id) {
2281
2320
  return '[id="' + id.replace(/(:|\.|\[|\]|,|=|@|\\|\/|#)/g, '\\$1') + '"]';
@@ -2283,7 +2322,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2283
2322
  DropDownList.prototype.onDocumentClick = function (e) {
2284
2323
  var target = e.target;
2285
2324
  if (!(!isNullOrUndefined(this.popupObj) && closest(target, this.checkSelector(this.popupObj.element.id))) &&
2286
- !this.inputWrapper.container.contains(e.target)) {
2325
+ !isNullOrUndefined(this.inputWrapper) && !this.inputWrapper.container.contains(e.target)) {
2287
2326
  if (this.inputWrapper.container.classList.contains(dropDownListClasses.inputFocus) || this.isPopupOpen) {
2288
2327
  this.isDocumentClick = true;
2289
2328
  var isActive = this.isRequested;
@@ -2328,7 +2367,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2328
2367
  }
2329
2368
  if (!this.readonly) {
2330
2369
  if (this.isPopupOpen) {
2331
- this.hidePopup();
2370
+ this.hidePopup(e);
2332
2371
  if (this.isFilterLayout()) {
2333
2372
  this.focusDropDown(e);
2334
2373
  }
@@ -2338,7 +2377,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2338
2377
  this.floatLabelChange();
2339
2378
  this.queryString = this.inputElement.value.trim() === '' ? null : this.inputElement.value;
2340
2379
  this.isDropDownClick = true;
2341
- this.showPopup();
2380
+ this.showPopup(e);
2342
2381
  }
2343
2382
  // eslint-disable-next-line @typescript-eslint/no-this-alias
2344
2383
  var proxy_1 = this;
@@ -2402,6 +2441,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2402
2441
  };
2403
2442
  DropDownList.prototype.selectEventCallback = function (li, e, preventSelect, selectedData, value) {
2404
2443
  this.previousItemData = (!isNullOrUndefined(this.itemData)) ? this.itemData : null;
2444
+ if (this.itemData != selectedData) {
2445
+ this.previousValue = (!isNullOrUndefined(this.itemData)) ? typeof this.itemData == "object" ? this.checkFieldValue(this.itemData, this.fields.value.split('.')) : this.itemData : null;
2446
+ }
2405
2447
  this.item = li;
2406
2448
  this.itemData = selectedData;
2407
2449
  var focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
@@ -2472,10 +2514,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2472
2514
  if (this.setValue(e)) {
2473
2515
  return;
2474
2516
  }
2475
- attributes(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
2476
- if (this.isFilterLayout() && this.filterInput) {
2477
- attributes(this.filterInput, { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
2478
- }
2479
2517
  if ((!this.isPopupOpen && !isNullOrUndefined(li)) || (this.isPopupOpen && !isNullOrUndefined(e) &&
2480
2518
  (e.type !== 'keydown' || e.type === 'keydown' && e.action === 'enter'))) {
2481
2519
  this.isSelectCustom = false;
@@ -2485,9 +2523,17 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2485
2523
  this.setScrollPosition(e);
2486
2524
  }
2487
2525
  if (Browser.info.name !== 'mozilla') {
2488
- attributes(this.inputElement, { 'aria-label': this.inputElement.value });
2489
- attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id });
2490
- this.targetElement().removeAttribute('aria-live');
2526
+ if (this.targetElement()) {
2527
+ attributes(this.targetElement(), { 'aria-label': this.inputElement.value });
2528
+ attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
2529
+ this.targetElement().removeAttribute('aria-live');
2530
+ }
2531
+ }
2532
+ if (this.isPopupOpen && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
2533
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
2534
+ }
2535
+ else if (this.isPopupOpen && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
2536
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
2491
2537
  }
2492
2538
  };
2493
2539
  DropDownList.prototype.dropdownCompiler = function (dropdownTemplate) {
@@ -2652,9 +2698,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2652
2698
  selectedElement.setAttribute('value', this.value.toString());
2653
2699
  }
2654
2700
  else {
2655
- this.hiddenElement.innerHTML = '<option selected>' + this.text + '</option>';
2656
- var selectedElement = this.hiddenElement.querySelector('option');
2657
- selectedElement.setAttribute('value', this.value.toString());
2701
+ if (!isNullOrUndefined(this.hiddenElement)) {
2702
+ this.hiddenElement.innerHTML = '<option selected>' + this.text + '</option>';
2703
+ var selectedElement = this.hiddenElement.querySelector('option');
2704
+ selectedElement.setAttribute('value', this.value.toString());
2705
+ }
2658
2706
  }
2659
2707
  }
2660
2708
  else {
@@ -2681,6 +2729,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2681
2729
  this.preventAutoFill = false;
2682
2730
  }
2683
2731
  this.preventAltUp = false;
2732
+ if (this.getModuleName() === 'autocomplete' && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
2733
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
2734
+ }
2684
2735
  e.preventDefault();
2685
2736
  break;
2686
2737
  case 46: //delete
@@ -2803,9 +2854,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2803
2854
  /**
2804
2855
  * To filter the data from given data source by using query
2805
2856
  *
2806
- * @param {Object[] | DataManager } dataSource - Set the data source to filter.
2807
- * @param {Query} query - Specify the query to filter the data.
2808
- * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
2857
+ * @param {Object[] | DataManager } dataSource - Set the data source to filter.
2858
+ * @param {Query} query - Specify the query to filter the data.
2859
+ * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
2809
2860
  * @returns {void}
2810
2861
  * @deprecated
2811
2862
  */
@@ -2871,11 +2922,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2871
2922
  prepend([parentElement], popupElement);
2872
2923
  attributes(this.filterInput, {
2873
2924
  'aria-disabled': 'false',
2874
- 'aria-owns': this.element.id + '_options',
2875
- 'role': 'listbox',
2876
- 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null,
2925
+ 'role': 'combobox',
2877
2926
  'autocomplete': 'off',
2878
- 'autocorrect': 'off',
2879
2927
  'autocapitalize': 'off',
2880
2928
  'spellcheck': 'false'
2881
2929
  });
@@ -2961,7 +3009,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2961
3009
  this.initRemoteRender = false;
2962
3010
  if (this.value && this.dataSource instanceof DataManager) {
2963
3011
  var checkField_1 = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
2964
- var checkVal = list.some(function (x) { return x[checkField_1] === _this.value; });
3012
+ var fieldValue_1 = this.fields.value.split('.');
3013
+ var checkVal = list.some(function (x) { return isNullOrUndefined(x[checkField_1]) && fieldValue_1.length > 1 ? _this.checkFieldValue(x, fieldValue_1) === _this.value : x[checkField_1] === _this.value; });
2965
3014
  if (!checkVal) {
2966
3015
  this.dataSource.executeQuery(this.getQuery(this.query).where(new Predicate(checkField_1, 'equal', this.value)))
2967
3016
  .then(function (e) {
@@ -2983,26 +3032,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2983
3032
  }
2984
3033
  this.initial = false;
2985
3034
  }
2986
- else if (this.getModuleName() === 'autocomplete' && this.value && this.typedString === '' && !(this.dataSource instanceof DataManager)) {
2987
- var checkFields_1 = this.typeOfData(this.dataSource).typeof === 'string' ? '' : this.fields.value;
2988
- var checkValue = list.some(function (x) { return x[checkFields_1] === _this.value; });
2989
- var query = new Query();
2990
- if (!checkValue) {
2991
- new DataManager(this.dataSource).executeQuery(query.where(new Predicate(checkFields_1, 'equal', this.value)))
2992
- .then(function (e) {
2993
- if (e.result.length > 0) {
2994
- _this.value = checkFields_1 !== '' ? e.result[0][_this.fields.value].toString() : e.result[0].toString();
2995
- _this.addItem(e.result, list.length);
2996
- _this.updateValues();
2997
- }
2998
- else {
2999
- _this.updateValues();
3000
- }
3001
- });
3002
- }
3003
- else {
3004
- this.updateValues();
3005
- }
3035
+ else if (this.getModuleName() === 'autocomplete' && this.value) {
3036
+ this.setInputValue();
3006
3037
  }
3007
3038
  if (this.getModuleName() !== 'autocomplete' && this.isFiltering() && !this.isTyped) {
3008
3039
  if (!this.actionCompleteData.isUpdated || ((!this.isCustomFilter
@@ -3025,10 +3056,17 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3025
3056
  }
3026
3057
  }
3027
3058
  if (this.beforePopupOpen) {
3028
- this.renderPopup();
3059
+ this.renderPopup(e);
3029
3060
  }
3030
3061
  }
3031
3062
  };
3063
+ DropDownList.prototype.checkFieldValue = function (list, fieldValue) {
3064
+ var checkField = list;
3065
+ fieldValue.forEach(function (value) {
3066
+ checkField = checkField[value];
3067
+ });
3068
+ return checkField;
3069
+ };
3032
3070
  DropDownList.prototype.updateActionCompleteDataValues = function (ulElement, list) {
3033
3071
  this.actionCompleteData = { ulElement: ulElement.cloneNode(true), list: list, isUpdated: true };
3034
3072
  if (this.actionData.list !== this.actionCompleteData.list && this.actionCompleteData.ulElement && this.actionCompleteData.list) {
@@ -3097,7 +3135,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3097
3135
  removeClass(highlightedItem, dropDownListClasses.focus);
3098
3136
  }
3099
3137
  };
3100
- DropDownList.prototype.renderPopup = function () {
3138
+ DropDownList.prototype.renderPopup = function (e) {
3101
3139
  var _this = this;
3102
3140
  if (this.popupObj && document.body.contains(this.popupObj.element)) {
3103
3141
  this.refreshPopup();
@@ -3154,9 +3192,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3154
3192
  (_this.isDropDownClick && _this.getModuleName() === 'combobox')))) {
3155
3193
  offsetValue = _this.getOffsetValue(popupEle);
3156
3194
  var firstItem = _this.isEmptyList() ? _this.list : _this.liCollections[0];
3157
- left = -(parseInt(getComputedStyle(firstItem).textIndent, 10) -
3158
- parseInt(getComputedStyle(_this.inputElement).paddingLeft, 10) +
3159
- parseInt(getComputedStyle(_this.inputElement.parentElement).borderLeftWidth, 10));
3195
+ if (!isNullOrUndefined(_this.inputElement)) {
3196
+ left = -(parseInt(getComputedStyle(firstItem).textIndent, 10) -
3197
+ parseInt(getComputedStyle(_this.inputElement).paddingLeft, 10) +
3198
+ parseInt(getComputedStyle(_this.inputElement.parentElement).borderLeftWidth, 10));
3199
+ }
3160
3200
  }
3161
3201
  _this.getFocusElement();
3162
3202
  _this.createPopup(popupEle, offsetValue, left);
@@ -3187,25 +3227,28 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3187
3227
  var element = scrollParentElements_1[_i];
3188
3228
  EventHandler.add(element, 'scroll', _this.scrollHandler, _this);
3189
3229
  }
3190
- if (Browser.isDevice && _this.isFilterLayout()) {
3191
- EventHandler.add(_this.list, 'scroll', _this.listScroll, _this);
3192
- }
3193
3230
  if (!isNullOrUndefined(_this.list)) {
3194
3231
  _this.unWireListEvents();
3195
3232
  _this.wireListEvents();
3196
3233
  }
3197
- attributes(_this.targetElement(), { 'aria-expanded': 'true' });
3234
+ _this.selectedElementID = _this.selectedLI ? _this.selectedLI.id : null;
3235
+ attributes(_this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': _this.inputElement.id + '_options' });
3236
+ _this.inputElement.setAttribute('aria-expanded', 'true');
3198
3237
  var inputParent = _this.isFiltering() ? _this.filterInput.parentElement : _this.inputWrapper.container;
3199
3238
  addClass([inputParent], [dropDownListClasses.inputFocus]);
3200
3239
  var animModel = { name: 'FadeIn', duration: 100 };
3201
3240
  _this.beforePopupOpen = true;
3202
3241
  var popupInstance = _this.popupObj;
3203
- var eventArgs = { popup: popupInstance, cancel: false, animation: animModel };
3242
+ var eventArgs = { popup: popupInstance, event: e, cancel: false, animation: animModel };
3204
3243
  _this.trigger('open', eventArgs, function (eventArgs) {
3205
3244
  if (!eventArgs.cancel) {
3206
- addClass([_this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
3245
+ if (!isNullOrUndefined(_this.inputWrapper)) {
3246
+ addClass([_this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
3247
+ }
3207
3248
  _this.renderReactTemplates();
3208
- _this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.element : null);
3249
+ if (!isNullOrUndefined(_this.popupObj)) {
3250
+ _this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.element : null);
3251
+ }
3209
3252
  }
3210
3253
  else {
3211
3254
  _this.beforePopupOpen = false;
@@ -3263,6 +3306,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3263
3306
  var actionList = _this.actionCompleteData && _this.actionCompleteData.ulElement &&
3264
3307
  _this.actionCompleteData.ulElement.querySelector('li');
3265
3308
  var ulElement = _this.list.querySelector('ul li');
3309
+ if (!isNullOrUndefined(_this.ulElement) && !isNullOrUndefined(_this.ulElement.getElementsByClassName('e-item-focus')[0])) {
3310
+ attributes(_this.targetElement(), { 'aria-activedescendant': _this.ulElement.getElementsByClassName('e-item-focus')[0].id });
3311
+ }
3312
+ else if (!isNullOrUndefined(_this.ulElement) && !isNullOrUndefined(_this.ulElement.getElementsByClassName('e-active')[0])) {
3313
+ attributes(_this.targetElement(), { 'aria-activedescendant': _this.ulElement.getElementsByClassName('e-active')[0].id });
3314
+ }
3266
3315
  if (_this.isFiltering() && _this.itemTemplate && (_this.element.tagName === _this.getNgDirective()) &&
3267
3316
  (actionList && ulElement && actionList.textContent !== ulElement.textContent) &&
3268
3317
  _this.element.tagName !== 'EJS-COMBOBOX') {
@@ -3418,9 +3467,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3418
3467
  this.filterInput.value = this.typedString = '';
3419
3468
  this.searchLists(null);
3420
3469
  };
3421
- DropDownList.prototype.listScroll = function () {
3422
- this.filterInput.blur();
3423
- };
3424
3470
  DropDownList.prototype.setEleWidth = function (width) {
3425
3471
  if (!isNullOrUndefined(width)) {
3426
3472
  if (typeof width === 'number') {
@@ -3449,7 +3495,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3449
3495
  }
3450
3496
  if (Browser.isDevice && this.isFilterLayout()) {
3451
3497
  removeClass([document.body, this.popupObj.element], dropDownListClasses.popupFullScreen);
3452
- EventHandler.remove(this.list, 'scroll', this.listScroll);
3453
3498
  }
3454
3499
  if (this.isFilterLayout()) {
3455
3500
  if (!Browser.isDevice) {
@@ -3462,14 +3507,19 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3462
3507
  EventHandler.remove(this.backIconElement, 'click', this.clickOnBackIcon);
3463
3508
  EventHandler.remove(this.clearIconElement, 'click', this.clearText);
3464
3509
  }
3465
- EventHandler.remove(this.filterInput, 'input', this.onInput);
3466
- EventHandler.remove(this.filterInput, 'keyup', this.onFilterUp);
3467
- EventHandler.remove(this.filterInput, 'keydown', this.onFilterDown);
3468
- EventHandler.remove(this.filterInput, 'blur', this.onBlurHandler);
3469
- EventHandler.remove(this.filterInput, 'paste', this.pasteHandler);
3510
+ if (!isNullOrUndefined(this.filterInput)) {
3511
+ EventHandler.remove(this.filterInput, 'input', this.onInput);
3512
+ EventHandler.remove(this.filterInput, 'keyup', this.onFilterUp);
3513
+ EventHandler.remove(this.filterInput, 'keydown', this.onFilterDown);
3514
+ EventHandler.remove(this.filterInput, 'blur', this.onBlurHandler);
3515
+ EventHandler.remove(this.filterInput, 'paste', this.pasteHandler);
3516
+ }
3470
3517
  this.filterInput = null;
3471
3518
  }
3472
3519
  attributes(this.targetElement(), { 'aria-expanded': 'false' });
3520
+ this.inputElement.setAttribute('aria-expanded', 'false');
3521
+ this.targetElement().removeAttribute('aria-owns');
3522
+ this.targetElement().removeAttribute('aria-activedescendant');
3473
3523
  this.inputWrapper.container.classList.remove(dropDownListClasses.iconAnimation);
3474
3524
  if (this.isFiltering()) {
3475
3525
  this.actionCompleteData.isUpdated = false;
@@ -3522,14 +3572,15 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3522
3572
  if (this.element.tagName === 'INPUT') {
3523
3573
  this.inputElement = this.element;
3524
3574
  if (isNullOrUndefined(this.inputElement.getAttribute('role'))) {
3525
- this.inputElement.setAttribute('role', 'textbox');
3575
+ this.inputElement.setAttribute('role', 'combobox');
3526
3576
  }
3527
3577
  if (isNullOrUndefined(this.inputElement.getAttribute('type'))) {
3528
3578
  this.inputElement.setAttribute('type', 'text');
3529
3579
  }
3580
+ this.inputElement.setAttribute('aria-expanded', 'false');
3530
3581
  }
3531
3582
  else {
3532
- this.inputElement = this.createElement('input', { attrs: { role: 'textbox', type: 'text' } });
3583
+ this.inputElement = this.createElement('input', { attrs: { role: 'combobox', type: 'text' } });
3533
3584
  if (this.element.tagName !== this.getNgDirective()) {
3534
3585
  this.element.style.display = 'none';
3535
3586
  }
@@ -3540,6 +3591,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3540
3591
  if (!isNullOrUndefined(this.cssClass) && this.cssClass !== '') {
3541
3592
  updatedCssClassValues = (this.cssClass.replace(/\s+/g, ' ')).trim();
3542
3593
  }
3594
+ if (!isNullOrUndefined(closest(this.element, "fieldset")) && closest(this.element, "fieldset").disabled) {
3595
+ this.enabled = false;
3596
+ }
3543
3597
  this.inputWrapper = Input.createInput({
3544
3598
  element: this.inputElement,
3545
3599
  buttons: this.isPopupButton() ? [dropDownListClasses.icon] : null,
@@ -3568,6 +3622,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3568
3622
  this.setFields();
3569
3623
  this.inputWrapper.container.style.width = formatUnit(this.width);
3570
3624
  this.inputWrapper.container.classList.add('e-ddl');
3625
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
3626
+ if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && this.inputWrapper.container.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never') {
3627
+ this.inputWrapper.container.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
3628
+ }
3571
3629
  this.wireEvent();
3572
3630
  this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
3573
3631
  this.element.removeAttribute('tabindex');
@@ -3578,6 +3636,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3578
3636
  attributes(this.targetElement(), this.getAriaAttributes());
3579
3637
  this.updateDataAttribute(this.htmlAttributes);
3580
3638
  this.setHTMLAttributes();
3639
+ if (this.targetElement() === this.inputElement) {
3640
+ this.inputElement.removeAttribute('aria-labelledby');
3641
+ }
3581
3642
  if (this.value !== null || this.activeIndex !== null || this.text !== null) {
3582
3643
  this.initValue();
3583
3644
  }
@@ -3587,6 +3648,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3587
3648
  this.text = isNullOrUndefined(this.value) ? null : selectElement.options[selectElement.selectedIndex].textContent;
3588
3649
  this.initValue();
3589
3650
  }
3651
+ this.setEnabled();
3590
3652
  this.preventTabIndex(this.element);
3591
3653
  if (!this.enabled) {
3592
3654
  this.targetElement().tabIndex = -1;
@@ -3608,12 +3670,22 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3608
3670
  if (this.element.hasAttribute('data-val')) {
3609
3671
  this.element.setAttribute('data-val', 'false');
3610
3672
  }
3673
+ var floatLabelElement = this.inputWrapper.container.getElementsByClassName('e-float-text')[0];
3674
+ if (!isNullOrUndefined(this.element.id) && this.element.id !== '' && !isNullOrUndefined(floatLabelElement)) {
3675
+ floatLabelElement.id = 'label_' + this.element.id.replace(/ /g, '_');
3676
+ attributes(this.inputElement, { 'aria-labelledby': floatLabelElement.id });
3677
+ }
3611
3678
  this.renderComplete();
3612
3679
  };
3613
3680
  DropDownList.prototype.setFooterTemplate = function (popupEle) {
3614
3681
  var compiledString;
3615
3682
  if (this.footer) {
3616
- this.footer.innerHTML = '';
3683
+ if (this.isReact) {
3684
+ this.clearTemplate(['footerTemplate']);
3685
+ }
3686
+ else {
3687
+ this.footer.innerHTML = '';
3688
+ }
3617
3689
  }
3618
3690
  else {
3619
3691
  this.footer = this.createElement('div');
@@ -3661,6 +3733,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3661
3733
  var contentEle = popupEle.querySelector('div.e-content');
3662
3734
  popupEle.insertBefore(this.header, contentEle);
3663
3735
  };
3736
+ /**
3737
+ * Sets the enabled state to DropDownBase.
3738
+ *
3739
+ * @returns {void}
3740
+ */
3741
+ DropDownList.prototype.setEnabled = function () {
3742
+ this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
3743
+ };
3664
3744
  DropDownList.prototype.setOldText = function (text) {
3665
3745
  this.text = text;
3666
3746
  };
@@ -3748,6 +3828,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3748
3828
  break;
3749
3829
  case 'width':
3750
3830
  this_1.setEleWidth(newProp.width);
3831
+ Input.calculateWidth(this_1.inputElement, this_1.inputWrapper.container);
3751
3832
  break;
3752
3833
  case 'placeholder':
3753
3834
  Input.setPlaceholder(newProp.placeholder, this_1.inputElement);
@@ -3765,6 +3846,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3765
3846
  break;
3766
3847
  case 'cssClass':
3767
3848
  this_1.setCssClass(newProp.cssClass, oldProp.cssClass);
3849
+ Input.calculateWidth(this_1.inputElement, this_1.inputWrapper.container);
3768
3850
  break;
3769
3851
  case 'enableRtl':
3770
3852
  this_1.setEnableRtl();
@@ -3805,6 +3887,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3805
3887
  }
3806
3888
  });
3807
3889
  }
3890
+ else if (this_1.getModuleName() === 'autocomplete') {
3891
+ this_1.setInputValue(newProp, oldProp);
3892
+ }
3808
3893
  else {
3809
3894
  this_1.setOldText(oldProp.text);
3810
3895
  }
@@ -3846,6 +3931,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3846
3931
  }
3847
3932
  });
3848
3933
  }
3934
+ else if (this_1.getModuleName() === 'autocomplete') {
3935
+ this_1.setInputValue(newProp, oldProp);
3936
+ }
3849
3937
  else {
3850
3938
  this_1.setOldValue(oldProp.value);
3851
3939
  }
@@ -3905,6 +3993,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3905
3993
  case 'floatLabelType':
3906
3994
  Input.removeFloating(this_1.inputWrapper);
3907
3995
  Input.addFloating(this_1.inputElement, newProp.floatLabelType, this_1.placeholder, this_1.createElement);
3996
+ if (!isNullOrUndefined(this_1.inputWrapper.buttons[0]) && this_1.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0] && this_1.floatLabelType !== 'Never') {
3997
+ this_1.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0].classList.add('e-icon');
3998
+ }
3908
3999
  break;
3909
4000
  case 'showClearButton':
3910
4001
  Input.setClearButton(newProp.showClearButton, this_1.inputElement, this_1.inputWrapper, null, this_1.createElement);
@@ -3964,6 +4055,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3964
4055
  removeClass([this.inputWrapper.container], ['e-readonly']);
3965
4056
  }
3966
4057
  };
4058
+ DropDownList.prototype.setInputValue = function (newProp, oldProp) {
4059
+ };
3967
4060
  DropDownList.prototype.setCssClass = function (newClass, oldClass) {
3968
4061
  if (!isNullOrUndefined(oldClass)) {
3969
4062
  oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
@@ -3990,7 +4083,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3990
4083
  *
3991
4084
  * @returns {void}
3992
4085
  */
3993
- DropDownList.prototype.showPopup = function () {
4086
+ DropDownList.prototype.showPopup = function (e) {
3994
4087
  if (!this.enabled) {
3995
4088
  return;
3996
4089
  }
@@ -4010,11 +4103,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4010
4103
  }
4011
4104
  else if (isNullOrUndefined(this.list) || !isUndefined(this.list) && (this.list.classList.contains(dropDownBaseClasses.noData) ||
4012
4105
  this.list.querySelectorAll('.' + dropDownBaseClasses.li).length <= 0)) {
4013
- this.renderList();
4106
+ this.renderList(e);
4014
4107
  }
4015
- this.invokeRenderPopup();
4108
+ this.invokeRenderPopup(e);
4016
4109
  };
4017
- DropDownList.prototype.invokeRenderPopup = function () {
4110
+ DropDownList.prototype.invokeRenderPopup = function (e) {
4018
4111
  if (Browser.isDevice && this.isFilterLayout()) {
4019
4112
  // eslint-disable-next-line @typescript-eslint/no-this-alias
4020
4113
  var proxy_2 = this;
@@ -4023,10 +4116,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4023
4116
  };
4024
4117
  history.pushState({}, '');
4025
4118
  }
4026
- if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {
4027
- this.renderPopup();
4119
+ if (!isNullOrUndefined(this.list) && (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData))) {
4120
+ this.renderPopup(e);
4028
4121
  }
4029
- attributes(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
4030
4122
  };
4031
4123
  DropDownList.prototype.renderHightSearch = function () {
4032
4124
  // update high light search
@@ -4040,7 +4132,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4040
4132
  DropDownList.prototype.hidePopup = function (e) {
4041
4133
  /* eslint-enable valid-jsdoc, jsdoc/require-param */
4042
4134
  if (this.isEscapeKey && this.getModuleName() === 'dropdownlist') {
4043
- Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
4135
+ if (!isNullOrUndefined(this.inputElement)) {
4136
+ Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
4137
+ }
4044
4138
  this.isEscapeKey = false;
4045
4139
  if (!isNullOrUndefined(this.index)) {
4046
4140
  var element = this.findListElement(this.ulElement, 'li', 'data-value', this.value);
@@ -4090,6 +4184,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4090
4184
  }
4091
4185
  addClass([this.inputWrapper.container], [dropDownListClasses.inputFocus]);
4092
4186
  this.onFocus(e);
4187
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
4093
4188
  };
4094
4189
  /**
4095
4190
  * Moves the focus from the component if the component is already focused.
@@ -4107,6 +4202,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4107
4202
  this.targetElement().blur();
4108
4203
  }
4109
4204
  removeClass([this.inputWrapper.container], [dropDownListClasses.inputFocus]);
4205
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
4110
4206
  };
4111
4207
  /**
4112
4208
  * Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
@@ -4130,10 +4226,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4130
4226
  return;
4131
4227
  }
4132
4228
  if (this.inputElement) {
4133
- var attrArray = ['readonly', 'aria-disabled', 'aria-placeholder',
4134
- 'placeholder', 'aria-owns', 'aria-labelledby', 'aria-haspopup', 'aria-expanded',
4135
- 'aria-activedescendant', 'autocomplete', 'aria-readonly', 'autocorrect',
4136
- 'autocapitalize', 'spellcheck', 'aria-autocomplete', 'aria-live', 'aria-describedby', 'aria-label'];
4229
+ var attrArray = ['readonly', 'aria-disabled', 'placeholder', 'aria-labelledby',
4230
+ 'aria-expanded', 'autocomplete', 'aria-readonly', 'autocapitalize',
4231
+ 'spellcheck', 'aria-autocomplete', 'aria-live', 'aria-describedby', 'aria-label'];
4137
4232
  for (var i = 0; i < attrArray.length; i++) {
4138
4233
  this.inputElement.removeAttribute(attrArray[i]);
4139
4234
  }
@@ -4149,6 +4244,21 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4149
4244
  this.inputWrapper.container.parentElement.insertBefore(this.element, this.inputWrapper.container);
4150
4245
  detach(this.inputWrapper.container);
4151
4246
  }
4247
+ this.hiddenElement = null;
4248
+ this.inputWrapper = null;
4249
+ this.keyboardModule = null;
4250
+ this.ulElement = null;
4251
+ this.list = null;
4252
+ this.popupObj = null;
4253
+ this.rippleFun = null;
4254
+ this.selectedLI = null;
4255
+ this.liCollections = null;
4256
+ this.item = null;
4257
+ this.inputWrapper = null;
4258
+ this.footer = null;
4259
+ this.header = null;
4260
+ this.previousSelectedLI = null;
4261
+ this.valueTempElement = null;
4152
4262
  _super.prototype.destroy.call(this);
4153
4263
  };
4154
4264
  /* eslint-disable valid-jsdoc, jsdoc/require-returns-description */
@@ -4190,6 +4300,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4190
4300
  __decorate$1([
4191
4301
  Property('100%')
4192
4302
  ], DropDownList.prototype, "width", void 0);
4303
+ __decorate$1([
4304
+ Property(true)
4305
+ ], DropDownList.prototype, "enabled", void 0);
4306
+ __decorate$1([
4307
+ Property(false)
4308
+ ], DropDownList.prototype, "enablePersistence", void 0);
4193
4309
  __decorate$1([
4194
4310
  Property('300px')
4195
4311
  ], DropDownList.prototype, "popupHeight", void 0);
@@ -4369,6 +4485,9 @@ var Fields = /** @__PURE__ @class */ (function (_super) {
4369
4485
  __decorate$2([
4370
4486
  Property(null)
4371
4487
  ], Fields.prototype, "query", void 0);
4488
+ __decorate$2([
4489
+ Property('selectable')
4490
+ ], Fields.prototype, "selectable", void 0);
4372
4491
  __decorate$2([
4373
4492
  Property('selected')
4374
4493
  ], Fields.prototype, "selected", void 0);
@@ -4425,6 +4544,8 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
4425
4544
  _this.selectedData = [];
4426
4545
  _this.filterDelayTime = 300;
4427
4546
  _this.isClicked = false;
4547
+ // Specifies if the checkAll method has been called
4548
+ _this.isCheckAllCalled = false;
4428
4549
  return _this;
4429
4550
  }
4430
4551
  /**
@@ -4553,7 +4674,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
4553
4674
  this.updateDataAttribute();
4554
4675
  this.setHTMLAttributes();
4555
4676
  this.setAttributes();
4556
- this.popupDiv = this.createElement('div', { className: CONTENT, attrs: { 'tabindex': '0' } });
4677
+ this.popupDiv = this.createElement('div', { className: CONTENT });
4557
4678
  this.popupDiv.classList.add(DROPDOWN);
4558
4679
  this.tree = this.createElement('div', { id: this.element.id + '_tree' });
4559
4680
  this.popupDiv.appendChild(this.tree);
@@ -5178,7 +5299,12 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5178
5299
  temp = this.getOverflowVal(index);
5179
5300
  data += temp;
5180
5301
  temp = this.overFlowWrapper.innerHTML;
5181
- this.overFlowWrapper.innerHTML = data;
5302
+ if (this.enableHtmlSanitizer) {
5303
+ this.overFlowWrapper.innerText = data;
5304
+ }
5305
+ else {
5306
+ this.overFlowWrapper.innerHTML = data;
5307
+ }
5182
5308
  wrapperleng = this.overFlowWrapper.offsetWidth;
5183
5309
  overAllContainer = this.inputWrapper.offsetWidth;
5184
5310
  if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
@@ -5348,7 +5474,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5348
5474
  if (isValid && this.value !== null && (this.value && this.value.length !== 0)) {
5349
5475
  addClass([this.inputEle], CHIP_INPUT);
5350
5476
  }
5351
- else if (this.value === null || (this.value && this.value.length === 0)) {
5477
+ else if (this.value === null || (this.value && this.value.length === 0) || this.chipWrapper) {
5352
5478
  addClass([this.chipWrapper], HIDEICON);
5353
5479
  }
5354
5480
  }
@@ -5403,6 +5529,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5403
5529
  frameSpan.classList.add(CHECK);
5404
5530
  ariaState = 'true';
5405
5531
  if (!this.isReverseUpdate) {
5532
+ this.isCheckAllCalled = true;
5406
5533
  this.treeObj.checkAll();
5407
5534
  if (!this.changeOnBlur) {
5408
5535
  this.triggerChangeEvent(e);
@@ -5706,10 +5833,12 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5706
5833
  nodeSelected: this.onNodeSelected.bind(this),
5707
5834
  nodeChecked: this.onNodeChecked.bind(this),
5708
5835
  nodeChecking: this.beforeCheck.bind(this),
5836
+ nodeExpanded: this.onNodeExpanded.bind(this),
5709
5837
  actionFailure: this.onActionFailure.bind(this),
5710
5838
  nodeClicked: this.onNodeClicked.bind(this),
5711
5839
  dataBound: this.OnDataBound.bind(this),
5712
5840
  allowMultiSelection: this.allowMultiSelection,
5841
+ enableHtmlSanitizer: this.enableHtmlSanitizer,
5713
5842
  showCheckBox: this.showCheckBox,
5714
5843
  autoCheck: this.treeSettings.autoCheck,
5715
5844
  sortOrder: this.sortOrder,
@@ -5812,7 +5941,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5812
5941
  var height = Math.round(this.header.getBoundingClientRect().height);
5813
5942
  popupHeight = formatUnit(parseInt(popupHeight, 10) - height + 'px');
5814
5943
  }
5815
- if (this.showCheckBox && this.showSelectAll) {
5944
+ if (this.showCheckBox && this.showSelectAll && (!this.popupDiv.classList.contains(NODATA))) {
5816
5945
  var height = Math.round(this.checkAllParent.getBoundingClientRect().height);
5817
5946
  popupHeight = formatUnit(parseInt(popupHeight, 10) - height + 'px');
5818
5947
  }
@@ -5895,14 +6024,14 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5895
6024
  var isFooter = closest(target, '.' + FOOTER);
5896
6025
  var isScroller = target.classList.contains(DROPDOWN) ? true :
5897
6026
  (matches(target, '.e-ddt .e-popup') || matches(target, '.e-ddt .e-treeview'));
5898
- if ((this.isPopupOpen && (this.inputWrapper.contains(target) || isTree || isFilter || isScroller || isHeader || isFooter)) ||
6027
+ if ((this.isPopupOpen && (this.inputWrapper.contains(target) || isTree || isScroller || isHeader || isFooter)) ||
5899
6028
  ((this.allowMultiSelection || this.showCheckBox) && (this.isPopupOpen && target.classList.contains(CHIP_CLOSE) ||
5900
6029
  (this.isPopupOpen && (target.classList.contains(CHECKALLPARENT) || target.classList.contains(ALLTEXT)
5901
6030
  || target.classList.contains(CHECKBOXFRAME)))))) {
5902
6031
  this.isDocumentClick = false;
5903
6032
  e.preventDefault();
5904
6033
  }
5905
- else if (!this.inputWrapper.contains(target) && this.inputFocus) {
6034
+ else if (!this.inputWrapper.contains(target) && this.inputFocus && !isFilter) {
5906
6035
  this.focusOut(e);
5907
6036
  }
5908
6037
  };
@@ -5935,6 +6064,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
5935
6064
  }
5936
6065
  var eventArgs = { data: args.data };
5937
6066
  this.trigger('dataBound', eventArgs);
6067
+ if (this.filterObj === null) {
6068
+ this.isFilteredData = false;
6069
+ }
5938
6070
  if (this.isFilteredData) {
5939
6071
  this.treeObj.expandAll();
5940
6072
  }
@@ -6002,7 +6134,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6002
6134
  dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
6003
6135
  child: this.cloneChildField(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
6004
6136
  iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes, query: fields.query,
6005
- selected: fields.selected, tableName: fields.tableName, tooltip: fields.tooltip
6137
+ selected: fields.selected, selectable: fields.selectable, tableName: fields.tableName, tooltip: fields.tooltip
6006
6138
  };
6007
6139
  return clonedField;
6008
6140
  };
@@ -6015,7 +6147,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6015
6147
  dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
6016
6148
  child: (fields.child ? this.cloneChildField(fields.child) : null), hasChildren: fields.hasChildren,
6017
6149
  expanded: fields.expanded, iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes,
6018
- query: fields.query, selected: fields.selected, tableName: fields.tableName, tooltip: fields.tooltip
6150
+ query: fields.query, selected: fields.selected, selectable: fields.selectable, tableName: fields.tableName, tooltip: fields.tooltip
6019
6151
  };
6020
6152
  return clonedField;
6021
6153
  }
@@ -6025,7 +6157,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6025
6157
  dataSource: fields.dataSource, id: fields.value, text: fields.text, parentID: fields.parentValue,
6026
6158
  child: this.getTreeChildren(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
6027
6159
  iconCss: fields.iconCss, imageUrl: fields.imageUrl, isChecked: fields.selected,
6028
- htmlAttributes: fields.htmlAttributes, query: fields.query, selected: fields.selected,
6160
+ htmlAttributes: fields.htmlAttributes, query: fields.query, selectable: fields.selectable, selected: fields.selected,
6029
6161
  tableName: fields.tableName, tooltip: fields.tooltip
6030
6162
  };
6031
6163
  return treeFields;
@@ -6203,13 +6335,14 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6203
6335
  var nodes = this.treeObj.element.querySelectorAll('li');
6204
6336
  var checkedNodes = this.treeObj.element.querySelectorAll('li .e-checkbox-wrapper[aria-checked=true]');
6205
6337
  var wrap = closest(this.checkBoxElement, '.' + CHECKBOXWRAP);
6206
- if (wrap && args.action === 'uncheck') {
6338
+ if (wrap && args.action === 'uncheck' && (args.isInteracted || checkedNodes.length === 0)) {
6207
6339
  this.isReverseUpdate = true;
6208
6340
  this.changeState(wrap, 'uncheck');
6209
6341
  this.isReverseUpdate = false;
6210
6342
  }
6211
- else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length) {
6343
+ else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length && this.isCheckAllCalled) {
6212
6344
  this.isReverseUpdate = true;
6345
+ this.isCheckAllCalled = false;
6213
6346
  this.changeState(wrap, 'check');
6214
6347
  this.isReverseUpdate = false;
6215
6348
  }
@@ -6220,6 +6353,13 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6220
6353
  this.oldValue = this.value ? this.value.slice() : this.value;
6221
6354
  }
6222
6355
  };
6356
+ DropDownTree.prototype.onNodeExpanded = function (args) {
6357
+ if (this.hasTemplate && this.portals) {
6358
+ this.portals = [].concat(this.treeObj.portals);
6359
+ /* eslint-enable */
6360
+ this.renderReactTemplates();
6361
+ }
6362
+ };
6223
6363
  DropDownTree.prototype.updateClearButton = function (state) {
6224
6364
  if (state) {
6225
6365
  if (!this.inputWrapper.contains(this.overAllClear)) {
@@ -6520,7 +6660,12 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6520
6660
  });
6521
6661
  var chipContent = this.createElement('span', { className: CHIP_CONTENT });
6522
6662
  var chipClose = this.createElement('span', { className: CHIP_CLOSE + ' ' + ICONS });
6523
- chipContent.innerHTML = text;
6663
+ if (this.enableHtmlSanitizer) {
6664
+ chipContent.innerText = text;
6665
+ }
6666
+ else {
6667
+ chipContent.innerHTML = text;
6668
+ }
6524
6669
  chip.appendChild(chipContent);
6525
6670
  this.chipCollection.appendChild(chip);
6526
6671
  if (this.showClearButton) {
@@ -6716,6 +6861,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6716
6861
  DropDownTree.prototype.selectAllItems = function (state) {
6717
6862
  if (this.showCheckBox) {
6718
6863
  if (state) {
6864
+ this.isCheckAllCalled = true;
6719
6865
  this.treeObj.checkAll();
6720
6866
  }
6721
6867
  else {
@@ -6810,8 +6956,6 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6810
6956
  }
6811
6957
  else {
6812
6958
  this.noRecord = this.createElement('div');
6813
- addClass([this.noRecord], NODATACONTAINER);
6814
- prepend([this.noRecord], this.popupDiv);
6815
6959
  }
6816
6960
  if (this.noRecordsTemplate !== 'No Records Found' || this.actionFailureTemplate !== 'The Request Failed') {
6817
6961
  var template = actionFailure ? this.actionFailureTemplate : this.noRecordsTemplate;
@@ -6823,6 +6967,8 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6823
6967
  if (tempArr) {
6824
6968
  tempArr = Array.prototype.slice.call(tempArr);
6825
6969
  append(tempArr, this.noRecord);
6970
+ addClass([this.noRecord], NODATACONTAINER);
6971
+ prepend([this.noRecord], this.popupDiv);
6826
6972
  }
6827
6973
  }
6828
6974
  else {
@@ -6831,6 +6977,8 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6831
6977
  this.l10n = new L10n(this.getLocaleName(), l10nLocale, this.locale);
6832
6978
  this.noRecord.innerHTML = actionFailure ?
6833
6979
  this.l10n.getConstant('actionFailureTemplate') : this.l10n.getConstant('noRecordsTemplate');
6980
+ addClass([this.noRecord], NODATACONTAINER);
6981
+ prepend([this.noRecord], this.popupDiv);
6834
6982
  }
6835
6983
  };
6836
6984
  DropDownTree.prototype.updateRecordTemplate = function (action) {
@@ -7342,6 +7490,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
7342
7490
  __decorate$2([
7343
7491
  Property(false)
7344
7492
  ], DropDownTree.prototype, "showCheckBox", void 0);
7493
+ __decorate$2([
7494
+ Property(false)
7495
+ ], DropDownTree.prototype, "enableHtmlSanitizer", void 0);
7345
7496
  __decorate$2([
7346
7497
  Property(true)
7347
7498
  ], DropDownTree.prototype, "showClearButton", void 0);
@@ -7595,15 +7746,12 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
7595
7746
  };
7596
7747
  ComboBox.prototype.getAriaAttributes = function () {
7597
7748
  var ariaAttributes = {
7598
- 'aria-owns': this.element.id + '_options',
7599
7749
  'role': 'combobox',
7600
7750
  'aria-autocomplete': 'both',
7601
7751
  'aria-labelledby': this.hiddenElement.id,
7602
- 'aria-hasPopup': 'true',
7603
7752
  'aria-expanded': 'false',
7604
7753
  'aria-readonly': this.readonly.toString(),
7605
7754
  'autocomplete': 'off',
7606
- 'autocorrect': 'off',
7607
7755
  'autocapitalize': 'off',
7608
7756
  'spellcheck': 'false'
7609
7757
  };
@@ -7646,7 +7794,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
7646
7794
  };
7647
7795
  ComboBox.prototype.getFocusElement = function () {
7648
7796
  var dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
7649
- var selected = this.list.querySelector('.' + dropDownListClasses.selected);
7797
+ var selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : this.list;
7650
7798
  var isSelected = dataItem.text === this.inputElement.value && !isNullOrUndefined(selected);
7651
7799
  if (isSelected) {
7652
7800
  return selected;
@@ -7654,7 +7802,9 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
7654
7802
  if ((Browser.isDevice && !this.isDropDownClick || !Browser.isDevice) &&
7655
7803
  !isNullOrUndefined(this.liCollections) && this.liCollections.length > 0) {
7656
7804
  var inputValue = this.inputElement.value;
7657
- var activeItem = Search(inputValue, this.liCollections, this.filterType, true);
7805
+ var dataSource = this.sortedData;
7806
+ var type = this.typeOfData(dataSource).typeof;
7807
+ var activeItem = Search(inputValue, this.liCollections, this.filterType, true, dataSource, this.fields, type);
7658
7808
  var activeElement = activeItem.item;
7659
7809
  if (!isNullOrUndefined(activeElement)) {
7660
7810
  var count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
@@ -7695,7 +7845,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
7695
7845
  this.itemData = this.getDataByValue(this.value);
7696
7846
  var dataItem = this.getItemData();
7697
7847
  if (!(this.allowCustom && isNullOrUndefined(dataItem.value) && isNullOrUndefined(dataItem.text))) {
7698
- this.setProperties({ 'value': dataItem.value, 'text': dataItem.text }, !this.allowCustom);
7848
+ this.setProperties({ 'value': dataItem.value }, !this.allowCustom);
7699
7849
  }
7700
7850
  };
7701
7851
  /**
@@ -7804,9 +7954,11 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
7804
7954
  }
7805
7955
  else if (this.inputElement.value === '') {
7806
7956
  this.activeIndex = null;
7807
- this.list.scrollTop = 0;
7808
- var focusItem = this.list.querySelector('.' + dropDownListClasses.li);
7809
- this.setHoverList(focusItem);
7957
+ if (!isNullOrUndefined(this.list)) {
7958
+ this.list.scrollTop = 0;
7959
+ var focusItem = this.list.querySelector('.' + dropDownListClasses.li);
7960
+ this.setHoverList(focusItem);
7961
+ }
7810
7962
  }
7811
7963
  else {
7812
7964
  this.activeIndex = null;
@@ -7817,7 +7969,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
7817
7969
  }
7818
7970
  };
7819
7971
  ComboBox.prototype.incrementalSearch = function (e) {
7820
- this.showPopup();
7972
+ this.showPopup(e);
7821
7973
  if (!isNullOrUndefined(this.listData)) {
7822
7974
  this.inlineSearch(e);
7823
7975
  e.preventDefault();
@@ -7903,6 +8055,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
7903
8055
  this.preventFocus = false;
7904
8056
  }
7905
8057
  this.onFocus(e);
8058
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
7906
8059
  };
7907
8060
  ComboBox.prototype.dropDownClick = function (e) {
7908
8061
  e.preventDefault();
@@ -8054,7 +8207,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
8054
8207
  * Adds a new item to the combobox popup list. By default, new item appends to the list as the last item,
8055
8208
  * but you can insert based on the index parameter.
8056
8209
  *
8057
- * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
8210
+ * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
8058
8211
  * @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
8059
8212
  * @returns {void}
8060
8213
  * @deprecated
@@ -8065,9 +8218,9 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
8065
8218
  /**
8066
8219
  * To filter the data from given data source by using query
8067
8220
  *
8068
- * @param {Object[] | DataManager } dataSource - Set the data source to filter.
8069
- * @param {Query} query - Specify the query to filter the data.
8070
- * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
8221
+ * @param {Object[] | DataManager } dataSource - Set the data source to filter.
8222
+ * @param {Query} query - Specify the query to filter the data.
8223
+ * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
8071
8224
  * @returns {void}
8072
8225
  * @deprecated
8073
8226
  */
@@ -8080,8 +8233,8 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
8080
8233
  * @returns {void}
8081
8234
  * @deprecated
8082
8235
  */
8083
- ComboBox.prototype.showPopup = function () {
8084
- _super.prototype.showPopup.call(this);
8236
+ ComboBox.prototype.showPopup = function (e) {
8237
+ _super.prototype.showPopup.call(this, e);
8085
8238
  };
8086
8239
  /* eslint-disable valid-jsdoc, jsdoc/require-param */
8087
8240
  /**
@@ -8104,7 +8257,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
8104
8257
  this.removeFillSelection();
8105
8258
  }
8106
8259
  var dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
8107
- var selected = this.list.querySelector('.' + dropDownListClasses.selected);
8260
+ var selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : null;
8108
8261
  if (this.inputElement && dataItem.text === this.inputElement.value && !isNullOrUndefined(selected)) {
8109
8262
  if (this.isSelected) {
8110
8263
  this.onChangeEvent(e);
@@ -8114,10 +8267,12 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
8114
8267
  return;
8115
8268
  }
8116
8269
  if (this.getModuleName() === 'combobox' && this.inputElement.value.trim() !== '') {
8117
- var searchItem = Search(this.inputElement.value, this.liCollections, 'Equal', true);
8270
+ var dataSource = this.sortedData;
8271
+ var type = this.typeOfData(dataSource).typeof;
8272
+ var searchItem = Search(this.inputElement.value, this.liCollections, 'Equal', true, dataSource, this.fields, type);
8118
8273
  this.selectedLI = searchItem.item;
8119
8274
  if (isNullOrUndefined(searchItem.index)) {
8120
- searchItem.index = Search(this.inputElement.value, this.liCollections, 'StartsWith', true).index;
8275
+ searchItem.index = Search(this.inputElement.value, this.liCollections, 'StartsWith', true, dataSource, this.fields, type).index;
8121
8276
  }
8122
8277
  this.activeIndex = searchItem.index;
8123
8278
  if (!isNullOrUndefined(this.selectedLI)) {
@@ -8318,10 +8473,10 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8318
8473
  * @private
8319
8474
  */
8320
8475
  function AutoComplete(options, element) {
8321
- var _this = _super.call(this, options, element) || this;
8322
- _this.isFiltered = false;
8323
- _this.searchList = false;
8324
- return _this;
8476
+ var _this_1 = _super.call(this, options, element) || this;
8477
+ _this_1.isFiltered = false;
8478
+ _this_1.searchList = false;
8479
+ return _this_1;
8325
8480
  }
8326
8481
  /**
8327
8482
  * Initialize the event handler
@@ -8369,17 +8524,17 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8369
8524
  return filterQuery;
8370
8525
  };
8371
8526
  AutoComplete.prototype.searchLists = function (e) {
8372
- var _this = this;
8527
+ var _this_1 = this;
8373
8528
  this.isTyped = true;
8374
8529
  this.isDataFetched = this.isSelectCustom = false;
8375
8530
  if (isNullOrUndefined(this.list)) {
8376
- _super.prototype.renderList.call(this, true);
8531
+ _super.prototype.renderList.call(this, e, true);
8377
8532
  }
8378
8533
  this.queryString = this.filterInput.value;
8379
8534
  if (e.type !== 'mousedown' && (e.keyCode === 40 || e.keyCode === 38)) {
8380
8535
  this.queryString = this.queryString === '' ? null : this.queryString;
8381
8536
  this.beforePopupOpen = true;
8382
- this.resetList(this.dataSource, this.fields);
8537
+ this.resetList(this.dataSource, this.fields, null, e);
8383
8538
  return;
8384
8539
  }
8385
8540
  this.isSelected = false;
@@ -8391,24 +8546,24 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8391
8546
  if (eventArgs.cancel) {
8392
8547
  return;
8393
8548
  }
8394
- _this.isFiltered = true;
8395
- _this.filterAction(dataSource, query, fields);
8549
+ _this_1.isFiltered = true;
8550
+ _this_1.filterAction(dataSource, query, fields);
8396
8551
  },
8397
8552
  cancel: false
8398
8553
  };
8399
8554
  this.trigger('filtering', eventArgs, function (eventArgs) {
8400
- if (!eventArgs.cancel && !_this.isFiltered && !eventArgs.preventDefaultAction) {
8401
- _this.searchList = true;
8402
- _this.filterAction(_this.dataSource, null, _this.fields);
8555
+ if (!eventArgs.cancel && !_this_1.isFiltered && !eventArgs.preventDefaultAction) {
8556
+ _this_1.searchList = true;
8557
+ _this_1.filterAction(_this_1.dataSource, null, _this_1.fields, e);
8403
8558
  }
8404
8559
  });
8405
8560
  };
8406
8561
  /**
8407
8562
  * To filter the data from given data source by using query
8408
8563
  *
8409
- * @param {Object[] | DataManager } dataSource - Set the data source to filter.
8410
- * @param {Query} query - Specify the query to filter the data.
8411
- * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
8564
+ * @param {Object[] | DataManager } dataSource - Set the data source to filter.
8565
+ * @param {Query} query - Specify the query to filter the data.
8566
+ * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
8412
8567
  * @returns {void}
8413
8568
  * @deprecated
8414
8569
  */
@@ -8416,13 +8571,13 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8416
8571
  this.isFiltered = true;
8417
8572
  this.filterAction(dataSource, query, fields);
8418
8573
  };
8419
- AutoComplete.prototype.filterAction = function (dataSource, query, fields) {
8574
+ AutoComplete.prototype.filterAction = function (dataSource, query, fields, e) {
8420
8575
  this.beforePopupOpen = true;
8421
8576
  if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
8422
- this.resetList(dataSource, fields, query);
8577
+ this.resetList(dataSource, fields, query, e);
8423
8578
  }
8424
8579
  else {
8425
- this.hidePopup();
8580
+ this.hidePopup(e);
8426
8581
  this.beforePopupOpen = false;
8427
8582
  }
8428
8583
  this.renderReactTemplates();
@@ -8448,7 +8603,9 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8448
8603
  AutoComplete.prototype.postBackAction = function () {
8449
8604
  if (this.autofill && !isNullOrUndefined(this.liCollections[0]) && this.searchList) {
8450
8605
  var items = [this.liCollections[0]];
8451
- var searchItem = Search(this.inputElement.value, items, 'StartsWith', this.ignoreCase);
8606
+ var dataSource = this.listData;
8607
+ var type = this.typeOfData(dataSource).typeof;
8608
+ var searchItem = Search(this.inputElement.value, items, 'StartsWith', this.ignoreCase, dataSource, this.fields, type);
8452
8609
  this.searchList = false;
8453
8610
  if (!isNullOrUndefined(searchItem.item)) {
8454
8611
  _super.prototype.setAutoFill.call(this, this.liCollections[0], true);
@@ -8457,6 +8614,7 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8457
8614
  };
8458
8615
  AutoComplete.prototype.setSelection = function (li, e) {
8459
8616
  if (!this.isValidLI(li)) {
8617
+ this.selectedLI = li;
8460
8618
  return;
8461
8619
  }
8462
8620
  if (!isNullOrUndefined(e) && e.type === 'keydown' && e.action !== 'enter'
@@ -8472,25 +8630,24 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8472
8630
  e.action === 'home' || e.action === 'end' || e.action === 'pageUp' || e.action === 'pageDown');
8473
8631
  _super.prototype.setAutoFill.call(this, li, isKeyNavigate);
8474
8632
  }
8475
- attributes(this.inputElement, { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
8476
8633
  }
8477
8634
  else {
8478
8635
  _super.prototype.setSelection.call(this, li, e);
8479
8636
  }
8480
8637
  };
8481
8638
  AutoComplete.prototype.listOption = function (dataSource, fieldsSettings) {
8482
- var _this = this;
8639
+ var _this_1 = this;
8483
8640
  var fields = _super.prototype.listOption.call(this, dataSource, fieldsSettings);
8484
8641
  if (isNullOrUndefined(fields.itemCreated)) {
8485
8642
  fields.itemCreated = function (e) {
8486
- if (_this.highlight) {
8487
- if (_this.element.tagName === _this.getNgDirective() && _this.itemTemplate) {
8643
+ if (_this_1.highlight) {
8644
+ if (_this_1.element.tagName === _this_1.getNgDirective() && _this_1.itemTemplate) {
8488
8645
  setTimeout(function () {
8489
- highlightSearch(e.item, _this.queryString, _this.ignoreCase, _this.filterType);
8646
+ highlightSearch(e.item, _this_1.queryString, _this_1.ignoreCase, _this_1.filterType);
8490
8647
  }, 0);
8491
8648
  }
8492
8649
  else {
8493
- highlightSearch(e.item, _this.queryString, _this.ignoreCase, _this.filterType);
8650
+ highlightSearch(e.item, _this_1.queryString, _this_1.ignoreCase, _this_1.filterType);
8494
8651
  }
8495
8652
  }
8496
8653
  };
@@ -8498,10 +8655,10 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8498
8655
  else {
8499
8656
  var itemCreated_1 = fields.itemCreated;
8500
8657
  fields.itemCreated = function (e) {
8501
- if (_this.highlight) {
8502
- highlightSearch(e.item, _this.queryString, _this.ignoreCase, _this.filterType);
8658
+ if (_this_1.highlight) {
8659
+ highlightSearch(e.item, _this_1.queryString, _this_1.ignoreCase, _this_1.filterType);
8503
8660
  }
8504
- itemCreated_1.apply(_this, [e]);
8661
+ itemCreated_1.apply(_this_1, [e]);
8505
8662
  };
8506
8663
  }
8507
8664
  return fields;
@@ -8509,9 +8666,9 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8509
8666
  AutoComplete.prototype.isFiltering = function () {
8510
8667
  return true;
8511
8668
  };
8512
- AutoComplete.prototype.renderPopup = function () {
8669
+ AutoComplete.prototype.renderPopup = function (e) {
8513
8670
  this.list.scrollTop = 0;
8514
- _super.prototype.renderPopup.call(this);
8671
+ _super.prototype.renderPopup.call(this, e);
8515
8672
  };
8516
8673
  AutoComplete.prototype.isEditTextBox = function () {
8517
8674
  return true && this.inputElement.value.trim() !== '';
@@ -8523,13 +8680,37 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8523
8680
  AutoComplete.prototype.isSelectFocusItem = function (element) {
8524
8681
  return false;
8525
8682
  };
8683
+ AutoComplete.prototype.setInputValue = function (newProp, oldProp) {
8684
+ var oldValue = oldProp && oldProp.text ? oldProp.text : oldProp ? oldProp.value : oldProp;
8685
+ var value = newProp && newProp.text ? newProp.text : newProp && newProp.value ? newProp.value : this.value;
8686
+ if (value && this.typedString === '' && !this.allowCustom && !(this.dataSource instanceof DataManager)) {
8687
+ var checkFields_1_1 = this.typeOfData(this.dataSource).typeof === 'string' ? '' : this.fields.value;
8688
+ var listLength_1 = this.getItems().length;
8689
+ var query = new Query();
8690
+ var _this_2 = this;
8691
+ new DataManager(this.dataSource).executeQuery(query.where(new Predicate(checkFields_1_1, 'equal', value)))
8692
+ .then(function (e) {
8693
+ if (e.result.length > 0) {
8694
+ _this_2.value = checkFields_1_1 !== '' ? e.result[0][_this_2.fields.value].toString() : e.result[0].toString();
8695
+ _this_2.addItem(e.result, listLength_1);
8696
+ _this_2.updateValues();
8697
+ }
8698
+ else {
8699
+ newProp && newProp.text ? _this_2.setOldText(oldValue) : newProp && newProp.value ? _this_2.setOldValue(oldValue) : _this_2.updateValues();
8700
+ }
8701
+ });
8702
+ }
8703
+ else if (newProp) {
8704
+ newProp.text ? this.setOldText(oldValue) : this.setOldValue(oldValue);
8705
+ }
8706
+ };
8526
8707
  /**
8527
8708
  * Search the entered text and show it in the suggestion list if available.
8528
8709
  *
8529
8710
  * @returns {void}
8530
8711
  * @deprecated
8531
8712
  */
8532
- AutoComplete.prototype.showPopup = function () {
8713
+ AutoComplete.prototype.showPopup = function (e) {
8533
8714
  if (!this.enabled) {
8534
8715
  return;
8535
8716
  }
@@ -8540,10 +8721,10 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8540
8721
  this.beforePopupOpen = true;
8541
8722
  this.preventAutoFill = true;
8542
8723
  if (isNullOrUndefined(this.list)) {
8543
- this.renderList();
8724
+ this.renderList(e);
8544
8725
  }
8545
8726
  else {
8546
- this.resetList(this.dataSource, this.fields);
8727
+ this.resetList(this.dataSource, this.fields, null, e);
8547
8728
  }
8548
8729
  };
8549
8730
  /**
@@ -8574,6 +8755,10 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8574
8755
  if (this.showPopupButton) {
8575
8756
  var button = Input.appendSpan(dropDownListClasses.icon, this.inputWrapper.container, this.createElement);
8576
8757
  this.inputWrapper.buttons[0] = button;
8758
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
8759
+ if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && !isNullOrUndefined(this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0]) && this.floatLabelType !== 'Never') {
8760
+ this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0].classList.add('e-icon');
8761
+ }
8577
8762
  if (this.inputWrapper && this.inputWrapper.buttons && this.inputWrapper.buttons[0]) {
8578
8763
  EventHandler.add(this.inputWrapper.buttons[0], 'click', this.dropDownClick, this);
8579
8764
  }
@@ -8702,9 +8887,11 @@ var LABELBOTTOM = 'e-label-bottom';
8702
8887
  function createFloatLabel(overAllWrapper, searchWrapper, element, inputElement, value, floatLabelType, placeholder) {
8703
8888
  var floatLinelement = createElement('span', { className: FLOATLINE });
8704
8889
  var floatLabelElement = createElement('label', { className: FLOATTEXT });
8890
+ var id = element.getAttribute('id') ? element.getAttribute('id') : getUniqueID('ej2_multiselect');
8891
+ element.id = id;
8705
8892
  if (!isNullOrUndefined(element.id) && element.id !== '') {
8706
8893
  floatLabelElement.id = 'label_' + element.id.replace(/ /g, '_');
8707
- attributes(element, { 'aria-labelledby': floatLabelElement.id });
8894
+ attributes(inputElement, { 'aria-labelledby': floatLabelElement.id });
8708
8895
  }
8709
8896
  if (!isNullOrUndefined(inputElement.placeholder) && inputElement.placeholder !== '') {
8710
8897
  floatLabelElement.innerText = encodePlaceholder(inputElement.placeholder);
@@ -8922,6 +9109,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
8922
9109
  _this.isValidKey = false;
8923
9110
  _this.selectAllEventData = [];
8924
9111
  _this.selectAllEventEle = [];
9112
+ _this.resetMainList = null;
9113
+ _this.resetFilteredData = false;
8925
9114
  _this.scrollFocusStatus = false;
8926
9115
  _this.keyDownStatus = false;
8927
9116
  return _this;
@@ -8964,7 +9153,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
8964
9153
  var htmlAttr = _a[_i];
8965
9154
  switch (htmlAttr) {
8966
9155
  case 'class': {
8967
- var updatedClassValue = (this.htmlAttributes[htmlAttr].replace(/\s+/g, ' ')).trim();
9156
+ var updatedClassValue = (this.htmlAttributes["" + htmlAttr].replace(/\s+/g, ' ')).trim();
8968
9157
  if (updatedClassValue !== '') {
8969
9158
  addClass([this.overAllWrapper], updatedClassValue.split(' '));
8970
9159
  addClass([this.popupWrapper], updatedClassValue.split(' '));
@@ -8976,7 +9165,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
8976
9165
  break;
8977
9166
  case 'placeholder':
8978
9167
  if (!this.placeholder) {
8979
- this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
9168
+ this.inputElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
8980
9169
  this.setProperties({ placeholder: this.inputElement.placeholder }, true);
8981
9170
  this.refreshPlaceHolder();
8982
9171
  }
@@ -8986,16 +9175,16 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
8986
9175
  var validateAttr = ['name', 'required', 'aria-required', 'form'];
8987
9176
  var containerAttr = ['title', 'role', 'style', 'class'];
8988
9177
  if (defaultAttr.indexOf(htmlAttr) > -1) {
8989
- this.element.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
9178
+ this.element.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
8990
9179
  }
8991
9180
  else if (htmlAttr.indexOf('data') === 0 || validateAttr.indexOf(htmlAttr) > -1) {
8992
- this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
9181
+ this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
8993
9182
  }
8994
9183
  else if (containerAttr.indexOf(htmlAttr) > -1) {
8995
- this.overAllWrapper.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
9184
+ this.overAllWrapper.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
8996
9185
  }
8997
- else if (htmlAttr !== 'size') {
8998
- this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
9186
+ else if (htmlAttr !== 'size' && !isNullOrUndefined(this.inputElement)) {
9187
+ this.inputElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
8999
9188
  }
9000
9189
  break;
9001
9190
  }
@@ -9004,11 +9193,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9004
9193
  }
9005
9194
  };
9006
9195
  MultiSelect.prototype.updateReadonly = function (state) {
9007
- if (state || this.mode === 'CheckBox') {
9008
- this.inputElement.setAttribute('readonly', 'true');
9009
- }
9010
- else {
9011
- this.inputElement.removeAttribute('readonly');
9196
+ if (!isNullOrUndefined(this.inputElement)) {
9197
+ if (state || this.mode === 'CheckBox') {
9198
+ this.inputElement.setAttribute('readonly', 'true');
9199
+ }
9200
+ else {
9201
+ this.inputElement.removeAttribute('readonly');
9202
+ }
9012
9203
  }
9013
9204
  };
9014
9205
  MultiSelect.prototype.updateClearButton = function (state) {
@@ -9045,7 +9236,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9045
9236
  }
9046
9237
  }
9047
9238
  };
9048
- MultiSelect.prototype.onPopupShown = function () {
9239
+ MultiSelect.prototype.onPopupShown = function (e) {
9049
9240
  var _this = this;
9050
9241
  if (Browser.isDevice && (this.mode === 'CheckBox' && this.allowFiltering)) {
9051
9242
  // eslint-disable-next-line @typescript-eslint/no-this-alias
@@ -9057,7 +9248,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9057
9248
  history.pushState({}, '');
9058
9249
  }
9059
9250
  var animModel = { name: 'FadeIn', duration: 100 };
9060
- var eventArgs = { popup: this.popupObj, cancel: false, animation: animModel };
9251
+ var eventArgs = { popup: this.popupObj, event: e, cancel: false, animation: animModel };
9061
9252
  this.trigger('open', eventArgs, function (eventArgs) {
9062
9253
  if (!eventArgs.cancel) {
9063
9254
  _this.focusAtFirstListItem();
@@ -9071,7 +9262,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9071
9262
  _this.refreshPopup();
9072
9263
  _this.renderReactTemplates();
9073
9264
  _this.popupObj.show(eventArgs.animation, (_this.zIndex === 1000) ? _this.element : null);
9074
- attributes(_this.inputElement, { 'aria-expanded': 'true' });
9265
+ attributes(_this.inputElement, { 'aria-expanded': 'true', 'aria-owns': _this.inputElement.id + '_options' });
9266
+ _this.updateAriaActiveDescendant();
9075
9267
  if (_this.isFirstClick) {
9076
9268
  _this.loadTemplate();
9077
9269
  }
@@ -9141,11 +9333,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9141
9333
  MultiSelect.prototype.getAriaAttributes = function () {
9142
9334
  var ariaAttributes = {
9143
9335
  'aria-disabled': 'false',
9144
- 'aria-owns': this.element.id + '_options',
9145
- 'role': 'listbox',
9146
- 'aria-multiselectable': 'true',
9147
- 'aria-activedescendant': 'null',
9148
- 'aria-haspopup': 'true',
9336
+ 'role': 'combobox',
9149
9337
  'aria-expanded': 'false'
9150
9338
  };
9151
9339
  return ariaAttributes;
@@ -9154,8 +9342,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9154
9342
  if (!isNullOrUndefined(this.ulElement)) {
9155
9343
  attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
9156
9344
  }
9157
- var disableStatus = (this.inputElement.disabled) ? true : false;
9158
- attributes(this.inputElement, this.getAriaAttributes());
9345
+ var disableStatus = !isNullOrUndefined(this.inputElement) && (this.inputElement.disabled) ? true : false;
9346
+ if (!this.isPopupOpen() && !isNullOrUndefined(this.inputElement)) {
9347
+ attributes(this.inputElement, this.getAriaAttributes());
9348
+ }
9159
9349
  if (disableStatus) {
9160
9350
  attributes(this.inputElement, { 'aria-disabled': 'true' });
9161
9351
  }
@@ -9223,13 +9413,23 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9223
9413
  if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
9224
9414
  for (var i = 0; i < this.value.length; i++) {
9225
9415
  var checkEle = this.findListElement(((this.allowFiltering && !isNullOrUndefined(this.mainList)) ? this.mainList : ulElement), 'li', 'data-value', proxy.value[i]);
9226
- if (!checkEle) {
9416
+ if (!checkEle && !(this.dataSource instanceof DataManager)) {
9227
9417
  this.value.splice(i, 1);
9228
9418
  i -= 1;
9229
9419
  }
9230
9420
  }
9231
9421
  }
9232
- this.updateActionList(ulElement, list, e);
9422
+ var valuecheck = [];
9423
+ if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
9424
+ valuecheck = this.presentItemValue(this.ulElement);
9425
+ }
9426
+ if (valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
9427
+ && this.listData != null) {
9428
+ this.addNonPresentItems(valuecheck, this.ulElement, this.listData);
9429
+ }
9430
+ else {
9431
+ this.updateActionList(ulElement, list, e);
9432
+ }
9233
9433
  if (this.dataSource instanceof DataManager && this.mode === 'CheckBox' && this.allowFiltering) {
9234
9434
  this.removeFocus();
9235
9435
  }
@@ -9253,7 +9453,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9253
9453
  this.checkForCustomValue(this.tempQuery, this.fields);
9254
9454
  return;
9255
9455
  }
9256
- if (this.value && this.value.length && ((this.mode !== 'CheckBox' && this.inputElement.value.trim() !== '') ||
9456
+ if (this.value && this.value.length && ((this.mode !== 'CheckBox' && !isNullOrUndefined(this.inputElement) && this.inputElement.value.trim() !== '') ||
9257
9457
  this.mode === 'CheckBox' || ((this.keyCode === 8 || this.keyCode === 46) && this.allowFiltering &&
9258
9458
  this.allowCustomValue && this.dataSource instanceof DataManager && this.inputElement.value === ''))) {
9259
9459
  this.refreshSelection();
@@ -9281,7 +9481,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9281
9481
  this.renderPopup();
9282
9482
  if (this.beforePopupOpen) {
9283
9483
  this.beforePopupOpen = false;
9284
- this.onPopupShown();
9484
+ this.onPopupShown(e);
9285
9485
  }
9286
9486
  };
9287
9487
  MultiSelect.prototype.refreshSelection = function () {
@@ -9311,6 +9511,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9311
9511
  dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')');
9312
9512
  if (listEle.length > 0) {
9313
9513
  addClass([listEle[0]], dropDownBaseClasses.focus);
9514
+ this.updateAriaActiveDescendant();
9314
9515
  }
9315
9516
  else {
9316
9517
  //EJ2-57588 - for this task, we prevent the ul element cloning ( this.ulElement = this.ulElement.cloneNode ? <HTMLElement>this.ulElement.cloneNode(true) : this.ulElement;)
@@ -9322,8 +9523,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9322
9523
  }
9323
9524
  element.setAttribute('aria-selected', 'true');
9324
9525
  if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
9325
- var ariaValue = element.firstElementChild.getAttribute('aria-checked');
9326
- if (isNullOrUndefined(ariaValue) || ariaValue === 'false') {
9526
+ var ariaValue = element.getElementsByClassName('e-check').length;
9527
+ if (ariaValue === 0) {
9327
9528
  var args = {
9328
9529
  module: 'CheckBoxSelection',
9329
9530
  enable: this.mode === 'CheckBox',
@@ -9447,9 +9648,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9447
9648
  /**
9448
9649
  * To filter the multiselect data from given data source by using query
9449
9650
  *
9450
- * @param {Object[] | DataManager } dataSource - Set the data source to filter.
9451
- * @param {Query} query - Specify the query to filter the data.
9452
- * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
9651
+ * @param {Object[] | DataManager } dataSource - Set the data source to filter.
9652
+ * @param {Query} query - Specify the query to filter the data.
9653
+ * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
9453
9654
  * @returns {void}
9454
9655
  */
9455
9656
  MultiSelect.prototype.filter = function (dataSource, query, fields) {
@@ -9537,7 +9738,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9537
9738
  this.resetList(tempData, field, query);
9538
9739
  }
9539
9740
  else {
9540
- var tempData = [this.inputElement.value];
9741
+ var tempData = JSON.parse(JSON.stringify(this.listData));
9742
+ tempData.splice(0, 0, this.inputElement.value);
9541
9743
  tempData[0] = (typeof customData === 'number' && !isNaN(parseFloat(tempData[0]))) ?
9542
9744
  parseFloat(tempData[0]) : tempData[0];
9543
9745
  tempData[0] = (typeof customData === 'boolean') ?
@@ -9573,7 +9775,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9573
9775
  }
9574
9776
  if (!this.isPopupOpen() &&
9575
9777
  (this.openOnClick || (this.showDropDownIcon && e.target && e.target.className === dropdownIcon))) {
9576
- this.showPopup();
9778
+ this.showPopup(e);
9577
9779
  }
9578
9780
  else {
9579
9781
  this.hidePopup(e);
@@ -9655,6 +9857,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9655
9857
  }
9656
9858
  }
9657
9859
  this.updateDataList();
9860
+ if (this.resetMainList) {
9861
+ this.mainList = this.resetMainList;
9862
+ this.resetMainList = null;
9863
+ }
9658
9864
  this.refreshListItems(null);
9659
9865
  if (this.mode !== 'Box' && this.mode !== 'CheckBox') {
9660
9866
  this.updateDelimView();
@@ -9682,6 +9888,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9682
9888
  this.ulElement = this.mainList;
9683
9889
  }
9684
9890
  this.checkPlaceholderSize();
9891
+ Input.createSpanElement(this.overAllWrapper, this.createElement);
9892
+ Input.calculateWidth(this.inputElement, this.overAllWrapper);
9893
+ if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
9894
+ this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
9895
+ }
9685
9896
  };
9686
9897
  MultiSelect.prototype.checkPlaceholderSize = function () {
9687
9898
  if (this.showDropDownIcon) {
@@ -9710,11 +9921,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9710
9921
  }
9711
9922
  };
9712
9923
  MultiSelect.prototype.refreshInputHight = function () {
9713
- if ((!this.value || !this.value.length) && (isNullOrUndefined(this.text) || this.text === '')) {
9714
- this.searchWrapper.classList.remove(ZERO_SIZE);
9715
- }
9716
- else {
9717
- this.searchWrapper.classList.add(ZERO_SIZE);
9924
+ if (!isNullOrUndefined(this.searchWrapper)) {
9925
+ if ((!this.value || !this.value.length) && (isNullOrUndefined(this.text) || this.text === '')) {
9926
+ this.searchWrapper.classList.remove(ZERO_SIZE);
9927
+ }
9928
+ else {
9929
+ this.searchWrapper.classList.add(ZERO_SIZE);
9930
+ }
9718
9931
  }
9719
9932
  };
9720
9933
  MultiSelect.prototype.validateValues = function (newValue, oldValue) {
@@ -9752,6 +9965,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9752
9965
  this.tempValues = this.value.slice();
9753
9966
  }
9754
9967
  };
9968
+ MultiSelect.prototype.updateAriaActiveDescendant = function () {
9969
+ if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
9970
+ attributes(this.inputElement, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
9971
+ }
9972
+ };
9755
9973
  MultiSelect.prototype.getPagingCount = function () {
9756
9974
  var height = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
9757
9975
  getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
@@ -9812,6 +10030,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9812
10030
  if (this.isPopupOpen()) {
9813
10031
  this.refreshPopup();
9814
10032
  }
10033
+ Input.calculateWidth(this.inputElement, this.overAllWrapper);
9815
10034
  return true;
9816
10035
  }
9817
10036
  else {
@@ -9867,7 +10086,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9867
10086
  break;
9868
10087
  case 40:
9869
10088
  if (!this.isPopupOpen()) {
9870
- this.showPopup();
10089
+ this.showPopup(e);
9871
10090
  e.preventDefault();
9872
10091
  }
9873
10092
  break;
@@ -9894,6 +10113,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9894
10113
  var element = scrollEle[(isHome) ? 0 : (scrollEle.length - 1)];
9895
10114
  element.classList.add(dropDownBaseClasses.focus);
9896
10115
  this.scrollBottom(element);
10116
+ this.updateAriaActiveDescendant();
9897
10117
  }
9898
10118
  };
9899
10119
  MultiSelect.prototype.onKeyDown = function (e) {
@@ -10395,7 +10615,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10395
10615
  };
10396
10616
  MultiSelect.prototype.invokeCheckboxSelection = function (element, eve, isClearAll) {
10397
10617
  this.notify('updatelist', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: eve });
10398
- attributes(this.inputElement, { 'aria-activedescendant': element.id });
10618
+ this.updateAriaActiveDescendant();
10399
10619
  if ((this.value && this.value.length !== this.mainData.length)
10400
10620
  && (this.mode === 'CheckBox' && this.showSelectAll && !(this.isSelectAll || isClearAll))) {
10401
10621
  this.notify('checkSelectAll', {
@@ -10508,7 +10728,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10508
10728
  HIDE_LIST :
10509
10729
  dropDownBaseClasses.selected);
10510
10730
  if (this.mode === 'CheckBox') {
10511
- element2.firstElementChild.setAttribute('aria-checked', 'false');
10512
10731
  removeClass([element2.firstElementChild.lastElementChild], 'e-check');
10513
10732
  }
10514
10733
  }
@@ -10518,7 +10737,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10518
10737
  HIDE_LIST :
10519
10738
  dropDownBaseClasses.selected);
10520
10739
  if (this.mode === 'CheckBox') {
10521
- element2.firstElementChild.setAttribute('aria-checked', 'true');
10522
10740
  addClass([element2.firstElementChild.lastElementChild], 'e-check');
10523
10741
  }
10524
10742
  }
@@ -10779,109 +10997,111 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10779
10997
  _super.prototype.render.call(this);
10780
10998
  }
10781
10999
  if (!this.popupObj) {
10782
- document.body.appendChild(this.popupWrapper);
10783
- var checkboxFilter = this.popupWrapper.querySelector('.' + FILTERPARENT);
10784
- if (this.mode === 'CheckBox' && !this.allowFiltering && checkboxFilter && this.filterParent) {
10785
- checkboxFilter.remove();
10786
- this.filterParent = null;
10787
- }
10788
- var overAllHeight = parseInt(this.popupHeight, 10);
10789
- this.popupWrapper.style.visibility = 'hidden';
10790
- if (this.headerTemplate) {
10791
- this.setHeaderTemplate();
10792
- overAllHeight -= this.header.offsetHeight;
10793
- }
10794
- append([this.list], this.popupWrapper);
10795
- if (this.footerTemplate) {
10796
- this.setFooterTemplate();
10797
- overAllHeight -= this.footer.offsetHeight;
10798
- }
10799
- if (this.mode === 'CheckBox' && this.showSelectAll) {
10800
- this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10801
- overAllHeight -= this.selectAllHeight;
10802
- }
10803
- else if (this.mode === 'CheckBox' && !this.showSelectAll && (!this.headerTemplate && !this.footerTemplate)) {
10804
- this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10805
- overAllHeight = parseInt(this.popupHeight, 10);
10806
- }
10807
- else if (this.mode === 'CheckBox' && !this.showSelectAll) {
10808
- this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10809
- overAllHeight = parseInt(this.popupHeight, 10);
10810
- if (this.headerTemplate && this.header) {
11000
+ if (!isNullOrUndefined(this.popupWrapper)) {
11001
+ document.body.appendChild(this.popupWrapper);
11002
+ var checkboxFilter = this.popupWrapper.querySelector('.' + FILTERPARENT);
11003
+ if (this.mode === 'CheckBox' && !this.allowFiltering && checkboxFilter && this.filterParent) {
11004
+ checkboxFilter.remove();
11005
+ this.filterParent = null;
11006
+ }
11007
+ var overAllHeight = parseInt(this.popupHeight, 10);
11008
+ this.popupWrapper.style.visibility = 'hidden';
11009
+ if (this.headerTemplate) {
11010
+ this.setHeaderTemplate();
10811
11011
  overAllHeight -= this.header.offsetHeight;
10812
11012
  }
10813
- if (this.footerTemplate && this.footer) {
11013
+ append([this.list], this.popupWrapper);
11014
+ if (this.footerTemplate) {
11015
+ this.setFooterTemplate();
10814
11016
  overAllHeight -= this.footer.offsetHeight;
10815
11017
  }
10816
- }
10817
- if (this.mode === 'CheckBox') {
10818
- var args = {
10819
- module: 'CheckBoxSelection',
10820
- enable: this.mode === 'CheckBox',
10821
- popupElement: this.popupWrapper
10822
- };
10823
- if (this.allowFiltering) {
10824
- this.notify('searchBox', args);
10825
- overAllHeight -= this.searchBoxHeight;
11018
+ if (this.mode === 'CheckBox' && this.showSelectAll) {
11019
+ this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
11020
+ overAllHeight -= this.selectAllHeight;
10826
11021
  }
10827
- addClass([this.popupWrapper], 'e-checkbox');
10828
- }
10829
- if (this.popupHeight !== 'auto') {
10830
- this.list.style.maxHeight = formatUnit(overAllHeight);
10831
- this.popupWrapper.style.maxHeight = formatUnit(this.popupHeight);
10832
- }
10833
- else {
10834
- this.list.style.maxHeight = formatUnit(this.popupHeight);
10835
- }
10836
- this.popupObj = new Popup(this.popupWrapper, {
10837
- width: this.calcPopupWidth(), targetType: 'relative', position: { X: 'left', Y: 'bottom' },
10838
- relateTo: this.overAllWrapper, collision: { X: 'flip', Y: 'flip' }, offsetY: 1,
10839
- enableRtl: this.enableRtl, zIndex: this.zIndex,
10840
- close: function () {
10841
- if (_this.popupObj.element.parentElement) {
10842
- _this.popupObj.unwireScrollEvents();
10843
- // For restrict the page scrolling in safari browser
10844
- var checkboxFilterInput = _this.popupWrapper.querySelector('.' + FILTERINPUT);
10845
- if (_this.mode === 'CheckBox' && checkboxFilterInput && document.activeElement === checkboxFilterInput) {
10846
- checkboxFilterInput.blur();
10847
- }
10848
- detach(_this.popupObj.element);
10849
- }
10850
- },
10851
- open: function () {
10852
- _this.popupObj.resolveCollision();
10853
- if (!_this.isFirstClick) {
10854
- var ulElement = _this.list.querySelector('ul');
10855
- if (ulElement) {
10856
- if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&
10857
- _this.targetElement().trim() !== '')) {
10858
- _this.mainList = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;
10859
- }
10860
- }
10861
- _this.isFirstClick = true;
11022
+ else if (this.mode === 'CheckBox' && !this.showSelectAll && (!this.headerTemplate && !this.footerTemplate)) {
11023
+ this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
11024
+ overAllHeight = parseInt(this.popupHeight, 10);
11025
+ }
11026
+ else if (this.mode === 'CheckBox' && !this.showSelectAll) {
11027
+ this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
11028
+ overAllHeight = parseInt(this.popupHeight, 10);
11029
+ if (this.headerTemplate && this.header) {
11030
+ overAllHeight -= this.header.offsetHeight;
10862
11031
  }
10863
- _this.popupObj.wireScrollEvents();
10864
- if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&
10865
- _this.targetElement().trim() !== '')) {
10866
- _this.loadTemplate();
11032
+ if (this.footerTemplate && this.footer) {
11033
+ overAllHeight -= this.footer.offsetHeight;
10867
11034
  }
10868
- _this.setScrollPosition();
10869
- if (_this.allowFiltering) {
10870
- _this.notify('inputFocus', {
10871
- module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox', value: 'focus'
10872
- });
11035
+ }
11036
+ if (this.mode === 'CheckBox') {
11037
+ var args = {
11038
+ module: 'CheckBoxSelection',
11039
+ enable: this.mode === 'CheckBox',
11040
+ popupElement: this.popupWrapper
11041
+ };
11042
+ if (this.allowFiltering) {
11043
+ this.notify('searchBox', args);
11044
+ overAllHeight -= this.searchBoxHeight;
10873
11045
  }
10874
- }, targetExitViewport: function () {
10875
- if (!Browser.isDevice) {
10876
- _this.hidePopup();
11046
+ addClass([this.popupWrapper], 'e-checkbox');
11047
+ }
11048
+ if (this.popupHeight !== 'auto') {
11049
+ this.list.style.maxHeight = formatUnit(overAllHeight);
11050
+ this.popupWrapper.style.maxHeight = formatUnit(this.popupHeight);
11051
+ }
11052
+ else {
11053
+ this.list.style.maxHeight = formatUnit(this.popupHeight);
11054
+ }
11055
+ this.popupObj = new Popup(this.popupWrapper, {
11056
+ width: this.calcPopupWidth(), targetType: 'relative', position: { X: 'left', Y: 'bottom' },
11057
+ relateTo: this.overAllWrapper, collision: { X: 'flip', Y: 'flip' }, offsetY: 1,
11058
+ enableRtl: this.enableRtl, zIndex: this.zIndex,
11059
+ close: function () {
11060
+ if (_this.popupObj.element.parentElement) {
11061
+ _this.popupObj.unwireScrollEvents();
11062
+ // For restrict the page scrolling in safari browser
11063
+ var checkboxFilterInput = _this.popupWrapper.querySelector('.' + FILTERINPUT);
11064
+ if (_this.mode === 'CheckBox' && checkboxFilterInput && document.activeElement === checkboxFilterInput) {
11065
+ checkboxFilterInput.blur();
11066
+ }
11067
+ detach(_this.popupObj.element);
11068
+ }
11069
+ },
11070
+ open: function () {
11071
+ _this.popupObj.resolveCollision();
11072
+ if (!_this.isFirstClick) {
11073
+ var ulElement = _this.list.querySelector('ul');
11074
+ if (ulElement) {
11075
+ if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&
11076
+ _this.targetElement().trim() !== '')) {
11077
+ _this.mainList = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;
11078
+ }
11079
+ }
11080
+ _this.isFirstClick = true;
11081
+ }
11082
+ _this.popupObj.wireScrollEvents();
11083
+ if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&
11084
+ _this.targetElement().trim() !== '')) {
11085
+ _this.loadTemplate();
11086
+ }
11087
+ _this.setScrollPosition();
11088
+ if (_this.allowFiltering) {
11089
+ _this.notify('inputFocus', {
11090
+ module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox', value: 'focus'
11091
+ });
11092
+ }
11093
+ }, targetExitViewport: function () {
11094
+ if (!Browser.isDevice) {
11095
+ _this.hidePopup();
11096
+ }
10877
11097
  }
11098
+ });
11099
+ if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {
11100
+ this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10878
11101
  }
10879
- });
10880
- if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {
10881
- this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
11102
+ this.popupObj.close();
11103
+ this.popupWrapper.style.visibility = '';
10882
11104
  }
10883
- this.popupObj.close();
10884
- this.popupWrapper.style.visibility = '';
10885
11105
  }
10886
11106
  };
10887
11107
  MultiSelect.prototype.setHeaderTemplate = function () {
@@ -10951,6 +11171,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10951
11171
  this.removeValue(temp, e, null, true);
10952
11172
  }
10953
11173
  }
11174
+ this.selectedElementID = null;
11175
+ this.inputElement.removeAttribute('aria-activedescendant');
10954
11176
  }
10955
11177
  else {
10956
11178
  this.clearAllCallback(e);
@@ -11054,11 +11276,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11054
11276
  };
11055
11277
  MultiSelect.prototype.search = function (e) {
11056
11278
  var _this = this;
11279
+ this.resetFilteredData = true;
11057
11280
  if (!isNullOrUndefined(e)) {
11058
11281
  this.keyCode = e.keyCode;
11059
11282
  }
11060
11283
  if (!this.isPopupOpen() && this.openOnClick) {
11061
- this.showPopup();
11284
+ this.showPopup(e);
11062
11285
  }
11063
11286
  this.openClick(e);
11064
11287
  if (this.checkTextLength() && !this.allowFiltering && !isNullOrUndefined(e) && (e.keyCode !== 8)) {
@@ -11142,7 +11365,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11142
11365
  var temp;
11143
11366
  var tempData = this.listData;
11144
11367
  this.listData = this.mainData;
11145
- this.hiddenElement.innerHTML = '';
11368
+ if (!isNullOrUndefined(this.hiddenElement)) {
11369
+ this.hiddenElement.innerHTML = '';
11370
+ }
11146
11371
  if (!isNullOrUndefined(this.value)) {
11147
11372
  for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {
11148
11373
  var listValue = this.findListElement(((!isNullOrUndefined(this.mainList)) ? this.mainList : this.ulElement), 'li', 'data-value', this.value[index]);
@@ -11160,7 +11385,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11160
11385
  data += temp + delimiterChar + ' ';
11161
11386
  text.push(temp);
11162
11387
  }
11163
- this.hiddenElement.innerHTML += '<option selected value ="' + this.value[index] + '">' + index + '</option>';
11388
+ if (!isNullOrUndefined(this.hiddenElement)) {
11389
+ this.hiddenElement.innerHTML += '<option selected value ="' + this.value[index] + '">' + index + '</option>';
11390
+ }
11164
11391
  }
11165
11392
  }
11166
11393
  this.setProperties({ text: text.toString() }, true);
@@ -11205,7 +11432,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11205
11432
  || this.list.querySelector('.e-ul') && this.list.querySelector('.e-ul').childElementCount === 0)) {
11206
11433
  isEmptyData = true;
11207
11434
  }
11208
- _super.prototype.render.call(this, isEmptyData);
11435
+ _super.prototype.render.call(this, null, isEmptyData);
11209
11436
  this.unwireListEvents();
11210
11437
  this.wireListEvents();
11211
11438
  };
@@ -11372,10 +11599,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11372
11599
  selectItems[temp1 - 1].setAttribute('aria-selected', 'false');
11373
11600
  if (this.mode === 'CheckBox') {
11374
11601
  if (selectedItems && (selectedItems.length > (temp1 - 1))) {
11375
- selectedItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');
11376
11602
  removeClass([selectedItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');
11377
11603
  }
11378
- selectItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');
11379
11604
  removeClass([selectItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');
11380
11605
  }
11381
11606
  temp1--;
@@ -11416,10 +11641,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11416
11641
  if (this.enabled && this.isValidLI(element)) {
11417
11642
  this.removeFocus();
11418
11643
  addClass([element], dropDownBaseClasses.focus);
11644
+ this.updateAriaActiveDescendant();
11419
11645
  }
11420
11646
  else {
11421
11647
  if (this.enableGroupCheckBox && this.mode === 'CheckBox' && !isNullOrUndefined(this.fields.groupBy)) {
11422
11648
  addClass([element], dropDownBaseClasses.focus);
11649
+ this.updateAriaActiveDescendant();
11423
11650
  }
11424
11651
  }
11425
11652
  };
@@ -11431,9 +11658,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11431
11658
  addClass([element], className);
11432
11659
  this.updateMainList(false, element.getAttribute('data-value'), mainElement);
11433
11660
  element.setAttribute('aria-selected', 'true');
11434
- if (this.mode === 'CheckBox') {
11435
- var ariaCheck = element.firstElementChild.getAttribute('aria-checked');
11436
- if (ariaCheck === 'false' || isNullOrUndefined(ariaCheck)) {
11661
+ if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
11662
+ var ariaCheck = element.getElementsByClassName('e-check').length;
11663
+ if (ariaCheck === 0) {
11437
11664
  this.notify('updatelist', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: this });
11438
11665
  }
11439
11666
  }
@@ -11441,7 +11668,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11441
11668
  if (this.chipCollectionWrapper) {
11442
11669
  this.removeChipSelection();
11443
11670
  }
11444
- attributes(this.inputElement, { 'aria-activedescendant': element.id });
11671
+ this.selectedElementID = element.id;
11445
11672
  }
11446
11673
  };
11447
11674
  MultiSelect.prototype.updateDelimeter = function (delimChar, e) {
@@ -11752,9 +11979,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11752
11979
  if (this.chipCollectionWrapper) {
11753
11980
  this.chipCollectionWrapper.style.display = 'none';
11754
11981
  }
11755
- this.viewWrapper.style.display = '';
11756
- this.viewWrapper.style.width = '';
11757
- this.viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER$1);
11982
+ if (!isNullOrUndefined(this.viewWrapper)) {
11983
+ this.viewWrapper.style.display = '';
11984
+ this.viewWrapper.style.width = '';
11985
+ this.viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER$1);
11986
+ }
11758
11987
  if (this.value && this.value.length) {
11759
11988
  var data = '';
11760
11989
  var temp = void 0;
@@ -11805,7 +12034,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11805
12034
  overAllContainer = this.componentWrapper.offsetWidth -
11806
12035
  parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft, 10) -
11807
12036
  parseInt(window.getComputedStyle(this.componentWrapper).paddingRight, 10);
11808
- if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
12037
+ if ((wrapperleng + downIconWidth + this.clearIconWidth) >= overAllContainer) {
11809
12038
  if (tempData !== undefined && tempData !== '') {
11810
12039
  temp = tempData;
11811
12040
  index = tempIndex + 1;
@@ -11814,7 +12043,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11814
12043
  remaining = this.value.length - index;
11815
12044
  wrapperleng = this.viewWrapper.offsetWidth +
11816
12045
  parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);
11817
- while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) > overAllContainer) && wrapperleng !== 0
12046
+ while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) >= overAllContainer) && wrapperleng !== 0
11818
12047
  && this.viewWrapper.innerHTML !== '') {
11819
12048
  var textArr = [];
11820
12049
  this.viewWrapper.innerHTML = textArr.join(this.delimiterChar);
@@ -11824,7 +12053,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11824
12053
  }
11825
12054
  break;
11826
12055
  }
11827
- else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) <= overAllContainer) {
12056
+ else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) < overAllContainer) {
11828
12057
  tempData = data;
11829
12058
  tempIndex = index;
11830
12059
  }
@@ -11842,8 +12071,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11842
12071
  }
11843
12072
  }
11844
12073
  else {
11845
- this.viewWrapper.innerHTML = '';
11846
- this.viewWrapper.style.display = 'none';
12074
+ if (!isNullOrUndefined(this.viewWrapper)) {
12075
+ this.viewWrapper.innerHTML = '';
12076
+ this.viewWrapper.style.display = 'none';
12077
+ }
11847
12078
  }
11848
12079
  };
11849
12080
  MultiSelect.prototype.checkClearIconWidth = function () {
@@ -11916,29 +12147,41 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11916
12147
  return temp;
11917
12148
  };
11918
12149
  MultiSelect.prototype.unWireEvent = function () {
11919
- EventHandler.remove(this.componentWrapper, 'mousedown', this.wrapperClick);
12150
+ if (!isNullOrUndefined(this.componentWrapper)) {
12151
+ EventHandler.remove(this.componentWrapper, 'mousedown', this.wrapperClick);
12152
+ }
11920
12153
  EventHandler.remove(window, 'resize', this.windowResize);
11921
- EventHandler.remove(this.inputElement, 'focus', this.focusInHandler);
11922
- EventHandler.remove(this.inputElement, 'keydown', this.onKeyDown);
11923
- if (this.mode !== 'CheckBox') {
11924
- EventHandler.remove(this.inputElement, 'input', this.onInput);
12154
+ if (!isNullOrUndefined(this.inputElement)) {
12155
+ EventHandler.remove(this.inputElement, 'focus', this.focusInHandler);
12156
+ EventHandler.remove(this.inputElement, 'keydown', this.onKeyDown);
12157
+ if (this.mode !== 'CheckBox') {
12158
+ EventHandler.remove(this.inputElement, 'input', this.onInput);
12159
+ }
12160
+ EventHandler.remove(this.inputElement, 'keyup', this.keyUp);
12161
+ var formElement = closest(this.inputElement, 'form');
12162
+ if (formElement) {
12163
+ EventHandler.remove(formElement, 'reset', this.resetValueHandler);
12164
+ }
12165
+ EventHandler.remove(this.inputElement, 'blur', this.onBlurHandler);
11925
12166
  }
11926
- EventHandler.remove(this.inputElement, 'keyup', this.keyUp);
11927
- var formElement = closest(this.inputElement, 'form');
11928
- if (formElement) {
11929
- EventHandler.remove(formElement, 'reset', this.resetValueHandler);
12167
+ if (!isNullOrUndefined(this.componentWrapper)) {
12168
+ EventHandler.remove(this.componentWrapper, 'mouseover', this.mouseIn);
12169
+ EventHandler.remove(this.componentWrapper, 'mouseout', this.mouseOut);
12170
+ }
12171
+ if (!isNullOrUndefined(this.overAllClear)) {
12172
+ EventHandler.remove(this.overAllClear, 'mousedown', this.clearAll);
12173
+ }
12174
+ if (!isNullOrUndefined(this.inputElement)) {
12175
+ EventHandler.remove(this.inputElement, 'paste', this.pasteHandler);
11930
12176
  }
11931
- EventHandler.remove(this.inputElement, 'blur', this.onBlurHandler);
11932
- EventHandler.remove(this.componentWrapper, 'mouseover', this.mouseIn);
11933
- EventHandler.remove(this.componentWrapper, 'mouseout', this.mouseOut);
11934
- EventHandler.remove(this.overAllClear, 'mousedown', this.clearAll);
11935
- EventHandler.remove(this.inputElement, 'paste', this.pasteHandler);
11936
12177
  };
11937
12178
  MultiSelect.prototype.selectAllItem = function (state, event, list) {
11938
12179
  var li;
11939
- li = this.list.querySelectorAll(state ?
11940
- 'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
11941
- 'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
12180
+ if (!isNullOrUndefined(this.list)) {
12181
+ li = this.list.querySelectorAll(state ?
12182
+ 'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
12183
+ 'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
12184
+ }
11942
12185
  if (this.value && this.value.length && event && event.target
11943
12186
  && closest(event.target, '.e-close-hooker') && this.allowFiltering) {
11944
12187
  li = this.mainList.querySelectorAll(state ?
@@ -11988,6 +12231,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11988
12231
  target.classList.remove('e-active');
11989
12232
  }
11990
12233
  target.classList.add('e-item-focus');
12234
+ this.updateAriaActiveDescendant();
11991
12235
  }
11992
12236
  this.textboxValueUpdate();
11993
12237
  this.checkPlaceholderSize();
@@ -12002,6 +12246,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12002
12246
  else {
12003
12247
  this.updateValue(event, li, state);
12004
12248
  }
12249
+ this.addValidInputClass();
12005
12250
  };
12006
12251
  MultiSelect.prototype.updateValue = function (event, li, state) {
12007
12252
  var _this = this;
@@ -12227,6 +12472,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12227
12472
  MultiSelect.prototype.onPropertyChanged = function (newProp, oldProp) {
12228
12473
  if (newProp.dataSource && !isNullOrUndefined(Object.keys(newProp.dataSource))
12229
12474
  || newProp.query && !isNullOrUndefined(Object.keys(newProp.query))) {
12475
+ if (this.resetFilteredData) {
12476
+ // The filtered data is not being reset in the component after the user focuses out.
12477
+ this.resetMainList = !this.resetMainList ? this.mainList : this.resetMainList;
12478
+ this.resetFilteredData = false;
12479
+ }
12230
12480
  this.mainList = null;
12231
12481
  this.mainData = null;
12232
12482
  this.isFirstClick = false;
@@ -12287,6 +12537,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12287
12537
  case 'cssClass':
12288
12538
  this.updateOldPropCssClass(oldProp.cssClass);
12289
12539
  this.updateCssClass();
12540
+ Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
12290
12541
  break;
12291
12542
  case 'enableRtl':
12292
12543
  this.enableRTL(newProp.enableRtl);
@@ -12313,6 +12564,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12313
12564
  case 'floatLabelType':
12314
12565
  this.setFloatLabelType();
12315
12566
  this.addValidInputClass();
12567
+ Input.createSpanElement(this.overAllWrapper, this.createElement);
12568
+ Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
12569
+ if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
12570
+ this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
12571
+ }
12316
12572
  break;
12317
12573
  case 'enableSelectionOrder':
12318
12574
  break;
@@ -12372,7 +12628,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12372
12628
  MultiSelect.prototype.addNonPresentItems = function (valuecheck, ulElement, list, event) {
12373
12629
  var _this = this;
12374
12630
  this.dataSource.executeQuery(this.getForQuery(valuecheck)).then(function (e) {
12375
- _this.addItem(e.result, list.length);
12631
+ if (e.result.length > 0) {
12632
+ _this.addItem(e.result, list.length);
12633
+ }
12376
12634
  _this.updateActionList(ulElement, list, event);
12377
12635
  });
12378
12636
  };
@@ -12431,7 +12689,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12431
12689
  * Adds a new item to the multiselect popup list. By default, new item appends to the list as the last item,
12432
12690
  * but you can insert based on the index parameter.
12433
12691
  *
12434
- * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
12692
+ * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
12435
12693
  * @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
12436
12694
  * @returns {void}
12437
12695
  */
@@ -12463,6 +12721,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12463
12721
  _this.overAllWrapper.classList.remove(iconAnimation);
12464
12722
  _this.popupObj.hide(new Animation(eventArgs.animation));
12465
12723
  attributes(_this.inputElement, { 'aria-expanded': 'false' });
12724
+ _this.inputElement.removeAttribute('aria-owns');
12725
+ _this.inputElement.removeAttribute('aria-activedescendant');
12466
12726
  if (_this.allowFiltering) {
12467
12727
  _this.notify('inputFocus', { module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox', value: 'clear' });
12468
12728
  }
@@ -12478,7 +12738,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12478
12738
  *
12479
12739
  * @returns {void}
12480
12740
  */
12481
- MultiSelect.prototype.showPopup = function () {
12741
+ MultiSelect.prototype.showPopup = function (e) {
12482
12742
  var _this = this;
12483
12743
  if (!this.enabled) {
12484
12744
  return;
@@ -12488,7 +12748,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12488
12748
  if (!args.cancel) {
12489
12749
  if (!_this.ulElement) {
12490
12750
  _this.beforePopupOpen = true;
12491
- _super.prototype.render.call(_this);
12751
+ _super.prototype.render.call(_this, e);
12492
12752
  if (_this.mode === 'CheckBox' && Browser.isDevice && _this.allowFiltering) {
12493
12753
  _this.notify('popupFullScreen', { module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox' });
12494
12754
  }
@@ -12504,7 +12764,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12504
12764
  _this.beforePopupOpen = false;
12505
12765
  return;
12506
12766
  }
12507
- _this.onPopupShown();
12767
+ _this.onPopupShown(e);
12508
12768
  }
12509
12769
  });
12510
12770
  };
@@ -12606,12 +12866,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12606
12866
  spellcheck: 'false',
12607
12867
  type: 'text',
12608
12868
  autocomplete: 'off',
12609
- tabindex: '0'
12869
+ tabindex: '0',
12870
+ role: 'combobox'
12610
12871
  }
12611
12872
  });
12612
12873
  if (this.mode === 'Default' || this.mode === 'Box') {
12613
12874
  this.inputElement.setAttribute('aria-describedby', this.chipCollectionWrapper.id);
12614
- this.inputElement.setAttribute('aria-labelledby', this.chipCollectionWrapper.id);
12615
12875
  }
12616
12876
  if (this.element.tagName !== this.getNgDirective()) {
12617
12877
  this.element.style.display = 'none';
@@ -12644,6 +12904,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12644
12904
  if (this.mode !== 'CheckBox') {
12645
12905
  this.hideOverAllClear();
12646
12906
  }
12907
+ if (!isNullOrUndefined(closest(this.element, "fieldset")) && closest(this.element, "fieldset").disabled) {
12908
+ this.enabled = false;
12909
+ }
12647
12910
  this.wireEvent();
12648
12911
  this.enable(this.enabled);
12649
12912
  this.enableRTL(this.enableRtl);
@@ -12651,6 +12914,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12651
12914
  if (this.element.hasAttribute('data-val')) {
12652
12915
  this.element.setAttribute('data-val', 'false');
12653
12916
  }
12917
+ Input.createSpanElement(this.overAllWrapper, this.createElement);
12918
+ Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
12919
+ if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
12920
+ this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
12921
+ }
12654
12922
  this.renderComplete();
12655
12923
  };
12656
12924
  MultiSelect.prototype.checkInitialValue = function () {
@@ -12732,11 +13000,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12732
13000
  }
12733
13001
  };
12734
13002
  MultiSelect.prototype.addValidInputClass = function () {
12735
- if ((!isNullOrUndefined(this.value) && this.value.length) || this.floatLabelType === 'Always') {
12736
- addClass([this.overAllWrapper], 'e-valid-input');
12737
- }
12738
- else {
12739
- removeClass([this.overAllWrapper], 'e-valid-input');
13003
+ if (!isNullOrUndefined(this.overAllWrapper)) {
13004
+ if ((!isNullOrUndefined(this.value) && this.value.length) || this.floatLabelType === 'Always') {
13005
+ addClass([this.overAllWrapper], 'e-valid-input');
13006
+ }
13007
+ else {
13008
+ removeClass([this.overAllWrapper], 'e-valid-input');
13009
+ }
12740
13010
  }
12741
13011
  };
12742
13012
  MultiSelect.prototype.dropDownIcon = function () {
@@ -12787,15 +13057,19 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12787
13057
  this.ulElement = null;
12788
13058
  this.mainListCollection = null;
12789
13059
  _super.prototype.destroy.call(this);
12790
- var temp = ['readonly', 'aria-disabled', 'aria-placeholder', 'placeholder'];
13060
+ var temp = ['readonly', 'aria-disabled', 'placeholder'];
12791
13061
  var length = temp.length;
12792
- while (length > 0) {
12793
- this.inputElement.removeAttribute(temp[length - 1]);
12794
- length--;
13062
+ if (!isNullOrUndefined(this.inputElement)) {
13063
+ while (length > 0) {
13064
+ this.inputElement.removeAttribute(temp[length - 1]);
13065
+ length--;
13066
+ }
12795
13067
  }
12796
- this.element.removeAttribute('data-initial-value');
12797
- this.element.style.display = 'block';
12798
- if (this.overAllWrapper.parentElement) {
13068
+ if (!isNullOrUndefined(this.element)) {
13069
+ this.element.removeAttribute('data-initial-value');
13070
+ this.element.style.display = 'block';
13071
+ }
13072
+ if (this.overAllWrapper && this.overAllWrapper.parentElement) {
12799
13073
  if (this.overAllWrapper.parentElement.tagName === this.getNgDirective()) {
12800
13074
  remove(this.overAllWrapper);
12801
13075
  }
@@ -12804,6 +13078,25 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12804
13078
  remove(this.overAllWrapper);
12805
13079
  }
12806
13080
  }
13081
+ this.componentWrapper = null;
13082
+ this.overAllClear = null;
13083
+ this.overAllWrapper = null;
13084
+ this.hiddenElement = null;
13085
+ this.searchWrapper = null;
13086
+ this.viewWrapper = null;
13087
+ this.chipCollectionWrapper = null;
13088
+ this.targetInputElement = null;
13089
+ this.popupWrapper = null;
13090
+ this.inputElement = null;
13091
+ this.delimiterWrapper = null;
13092
+ this.popupObj = null;
13093
+ this.popupWrapper = null;
13094
+ this.liCollections = null;
13095
+ this.header = null;
13096
+ this.mainList = null;
13097
+ this.mainListCollection = null;
13098
+ this.footer = null;
13099
+ this.selectAllEventEle = null;
12807
13100
  };
12808
13101
  __decorate$5([
12809
13102
  Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
@@ -13155,6 +13448,12 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
13155
13448
  CheckBoxSelection.prototype.destroy = function () {
13156
13449
  this.removeEventListener();
13157
13450
  EventHandler.remove(document, 'mousedown', this.onDocumentClick);
13451
+ this.checkAllParent = null;
13452
+ this.clearIconElement = null;
13453
+ this.filterInput = null;
13454
+ this.filterInputObj = null;
13455
+ this.checkWrapper = null;
13456
+ this.selectAllSpan = null;
13158
13457
  };
13159
13458
  CheckBoxSelection.prototype.listSelection = function (args) {
13160
13459
  var target;
@@ -13203,12 +13502,10 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
13203
13502
  e.preventDefault();
13204
13503
  };
13205
13504
  CheckBoxSelection.prototype.changeState = function (wrapper, state, e, isPrevent, selectAll$$1) {
13206
- var ariaState;
13207
13505
  var frameSpan = wrapper.getElementsByClassName(CHECKBOXFRAME$1)[0];
13208
13506
  if (state === 'check' && !frameSpan.classList.contains(CHECK$1)) {
13209
13507
  frameSpan.classList.remove(INDETERMINATE);
13210
13508
  frameSpan.classList.add(CHECK$1);
13211
- ariaState = 'true';
13212
13509
  if (selectAll$$1) {
13213
13510
  this.parent.selectAllItems(true, e);
13214
13511
  this.setLocale(true);
@@ -13216,7 +13513,6 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
13216
13513
  }
13217
13514
  else if (state === 'uncheck' && (frameSpan.classList.contains(CHECK$1) || frameSpan.classList.contains(INDETERMINATE))) {
13218
13515
  removeClass([frameSpan], [CHECK$1, INDETERMINATE]);
13219
- ariaState = 'false';
13220
13516
  if (selectAll$$1) {
13221
13517
  this.parent.selectAllItems(false, e);
13222
13518
  this.setLocale();
@@ -13225,16 +13521,11 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
13225
13521
  else if (state === 'indeterminate' && !(frameSpan.classList.contains(INDETERMINATE))) {
13226
13522
  removeClass([frameSpan], [CHECK$1]);
13227
13523
  frameSpan.classList.add(INDETERMINATE);
13228
- ariaState = 'false';
13229
13524
  if (selectAll$$1) {
13230
13525
  this.parent.selectAllItems(false, e);
13231
13526
  this.setLocale();
13232
13527
  }
13233
13528
  }
13234
- ariaState = state === 'check' ? 'true' : state === 'uncheck' ? 'false' : ariaState;
13235
- if (!isNullOrUndefined(ariaState)) {
13236
- wrapper.setAttribute('aria-checked', ariaState);
13237
- }
13238
13529
  };
13239
13530
  CheckBoxSelection.prototype.setSearchBox = function (args) {
13240
13531
  if (isNullOrUndefined(this.parent.filterParent)) {
@@ -13268,11 +13559,8 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
13268
13559
  prepend([this.parent.filterParent], args.popupElement);
13269
13560
  attributes(this.filterInput, {
13270
13561
  'aria-disabled': 'false',
13271
- 'aria-owns': this.parent.element.id + '_options',
13272
- 'role': 'listbox',
13273
- 'aria-activedescendant': null,
13562
+ 'role': 'combobox',
13274
13563
  'autocomplete': 'off',
13275
- 'autocorrect': 'off',
13276
13564
  'autocapitalize': 'off',
13277
13565
  'spellcheck': 'false'
13278
13566
  });
@@ -13398,8 +13686,8 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
13398
13686
  e.preventDefault();
13399
13687
  }
13400
13688
  }
13401
- if (!(!isNullOrUndefined(this.parent.popupObj) && closest(target, '[id="' + this.parent.popupObj.element.id + '"]')) &&
13402
- !this.parent.overAllWrapper.contains(e.target)) {
13689
+ if (!(!isNullOrUndefined(this.parent.popupObj) && closest(target, '[id="' + this.parent.popupObj.element.id + '"]'))
13690
+ && !isNullOrUndefined(this.parent.overAllWrapper) && !this.parent.overAllWrapper.contains(e.target)) {
13403
13691
  if (this.parent.overAllWrapper.classList.contains(dropDownBaseClasses.focus) || this.parent.isPopupOpen()) {
13404
13692
  this.parent.inputFocus = false;
13405
13693
  this.parent.scrollFocusStatus = false;
@@ -13412,7 +13700,7 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
13412
13700
  this.parent.scrollFocusStatus = (Browser.isIE || Browser.info.name === 'edge') &&
13413
13701
  (document.activeElement === this.filterInput);
13414
13702
  }
13415
- if (!this.parent.overAllWrapper.contains(e.target) && this.parent.overAllWrapper.classList.contains('e-input-focus') &&
13703
+ if (!isNullOrUndefined(this.parent.overAllWrapper) && !this.parent.overAllWrapper.contains(e.target) && this.parent.overAllWrapper.classList.contains('e-input-focus') &&
13416
13704
  !this.parent.isPopupOpen()) {
13417
13705
  if (Browser.isIE) {
13418
13706
  this.parent.onBlurHandler();
@@ -13443,7 +13731,7 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
13443
13731
  }
13444
13732
  };
13445
13733
  CheckBoxSelection.prototype.checkSelectAll = function (e) {
13446
- if (e.value === 'check' && this.checkAllParent.getAttribute('aria-checked') !== 'true') {
13734
+ if (e.value === 'check') {
13447
13735
  this.changeState(this.checkAllParent, e.value, null, null, false);
13448
13736
  this.setLocale(true);
13449
13737
  }
@@ -13627,6 +13915,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
13627
13915
  this.isCustomFiltering = false;
13628
13916
  this.initialSelectedOptions = this.value;
13629
13917
  _super.prototype.render.call(this);
13918
+ this.setEnabled();
13630
13919
  this.renderComplete();
13631
13920
  };
13632
13921
  ListBox.prototype.initWrapper = function () {
@@ -13661,7 +13950,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
13661
13950
  removeClass([this.list], [dropDownBaseClasses.content, dropDownBaseClasses.root]);
13662
13951
  this.validationAttribute(this.element, hiddenSelect);
13663
13952
  this.list.setAttribute('role', 'listbox');
13664
- attributes(this.list, { 'role': 'listbox', 'aria-multiselectable': this.selectionSettings.mode === 'Multiple' ? 'true' : 'false' });
13953
+ attributes(this.list, { 'role': 'listbox', 'aria-label': 'listbox', 'aria-multiselectable': this.selectionSettings.mode === 'Multiple' ? 'true' : 'false' });
13665
13954
  this.updateSelectionSettings();
13666
13955
  };
13667
13956
  ListBox.prototype.updateSelectionSettings = function () {
@@ -13707,8 +13996,8 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
13707
13996
  });
13708
13997
  }
13709
13998
  };
13710
- ListBox.prototype.updateActionCompleteData = function (li, item) {
13711
- this.jsonData.push(item);
13999
+ ListBox.prototype.updateActionCompleteData = function (li, item, index) {
14000
+ this.jsonData.splice(index, 0, item);
13712
14001
  };
13713
14002
  ListBox.prototype.initToolbar = function () {
13714
14003
  var pos = this.toolbarSettings.position;
@@ -13924,10 +14213,10 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
13924
14213
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13925
14214
  var event = args.event;
13926
14215
  var wrapper;
13927
- if (args.target && (args.target.classList.contains("e-listbox-wrapper") || args.target.classList.contains("e-list-item")
13928
- || args.target.classList.contains("e-filter-parent") || args.target.classList.contains("e-input-group"))) {
13929
- if (args.target.classList.contains("e-list-item") || args.target.classList.contains("e-filter-parent")
13930
- || args.target.classList.contains("e-input-group")) {
14216
+ if (args.target && (args.target.classList.contains('e-listbox-wrapper') || args.target.classList.contains('e-list-item')
14217
+ || args.target.classList.contains('e-filter-parent') || args.target.classList.contains('e-input-group'))) {
14218
+ if (args.target.classList.contains('e-list-item') || args.target.classList.contains('e-filter-parent')
14219
+ || args.target.classList.contains('e-input-group')) {
13931
14220
  wrapper = args.target.closest('.e-listbox-wrapper');
13932
14221
  }
13933
14222
  else {
@@ -13982,7 +14271,8 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
13982
14271
  var getArgs = this.getDragArgs({ target: args.droppedElement }, true);
13983
14272
  var sourceArgs = { previousData: this.dataSource };
13984
14273
  var destArgs = { previousData: listObj.dataSource };
13985
- var dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource }, previousIndex: args.previousIndex, currentIndex: args.currentIndex });
14274
+ var dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
14275
+ previousIndex: args.previousIndex, currentIndex: args.currentIndex });
13986
14276
  if (listObj !== this) {
13987
14277
  var sourceArgs1 = extend(sourceArgs, { currentData: this.listData });
13988
14278
  dragArgs = extend(dragArgs, { source: sourceArgs1, destination: destArgs });
@@ -14057,10 +14347,10 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14057
14347
  sortedData.splice(destIdx, 0, droppedData);
14058
14348
  liColl.splice(destIdx, 0, fLiColl_1.splice(srcIdx, 1)[0]);
14059
14349
  if (!value) {
14060
- var liCollElem = _this.getItems();
14061
- for (var i = 0; i < liCollElem.length; i++) {
14062
- if (liCollElem[i].getAttribute('data-value') === null && liCollElem[i].classList.contains('e-list-item')) {
14063
- li_1 = liCollElem[i];
14350
+ var liCollElem_1 = _this.getItems();
14351
+ for (var i = 0; i < liCollElem_1.length; i++) {
14352
+ if (liCollElem_1[i].getAttribute('data-value') === null && liCollElem_1[i].classList.contains('e-list-item')) {
14353
+ li_1 = liCollElem_1[i];
14064
14354
  break;
14065
14355
  }
14066
14356
  }
@@ -14110,10 +14400,17 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14110
14400
  dragArgs = extend(dragArgs, { destination: dragArgs1 });
14111
14401
  }
14112
14402
  this.trigger('drop', dragArgs);
14403
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14404
+ var liCollElem = dragArgs.elements;
14405
+ if (liCollElem.length) {
14406
+ for (var i = 0; i < liCollElem.length; i++) {
14407
+ liCollElem[i].classList.remove('e-grabbed');
14408
+ }
14409
+ }
14113
14410
  };
14114
14411
  ListBox.prototype.updateListItems = function (sourceElem, destElem) {
14115
14412
  var i = 0;
14116
- destElem.innerHTML = "";
14413
+ destElem.innerHTML = '';
14117
14414
  while (i < sourceElem.childNodes.length) {
14118
14415
  destElem.appendChild(sourceElem.childNodes[i]);
14119
14416
  }
@@ -14142,6 +14439,14 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14142
14439
  }
14143
14440
  return listObj;
14144
14441
  };
14442
+ /**
14443
+ * Sets the enabled state to DropDownBase.
14444
+ *
14445
+ * @returns {void}
14446
+ */
14447
+ ListBox.prototype.setEnabled = function () {
14448
+ this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
14449
+ };
14145
14450
  ListBox.prototype.listOption = function (dataSource, fields) {
14146
14451
  this.listCurrentOptions = _super.prototype.listOption.call(this, dataSource, fields);
14147
14452
  this.listCurrentOptions = extend({}, this.listCurrentOptions, { itemCreated: this.triggerBeforeItemRender.bind(this) }, true);
@@ -14253,7 +14558,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14253
14558
  var objValue = void 0;
14254
14559
  var dupData = [];
14255
14560
  var itemIdx = void 0;
14256
- extend(dupData, [], this.listData);
14561
+ extend(dupData, [], this.jsonData);
14257
14562
  var removeIdxes = [];
14258
14563
  var removeLiIdxes = [];
14259
14564
  for (var j = 0; j < items.length; j++) {
@@ -14302,7 +14607,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14302
14607
  if (this.listData.length === 0) {
14303
14608
  this.l10nUpdate();
14304
14609
  }
14305
- this.value = null;
14610
+ this.value = [];
14306
14611
  this.updateToolBarState();
14307
14612
  };
14308
14613
  /**
@@ -14591,9 +14896,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14591
14896
  prepend([this.filterParent], this.list);
14592
14897
  attributes(this.filterInput, {
14593
14898
  'aria-disabled': 'false',
14594
- 'aria-owns': this.element.id + '_options',
14595
- 'role': 'listbox',
14596
- 'aria-activedescendant': null,
14899
+ 'aria-label': 'search list item',
14597
14900
  'autocomplete': 'off',
14598
14901
  'autocorrect': 'off',
14599
14902
  'autocapitalize': 'off',
@@ -14630,12 +14933,12 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14630
14933
  if (li && li.parentElement) {
14631
14934
  currSelIdx = [].slice.call(li.parentElement.children).indexOf(li);
14632
14935
  if (!this.selectionSettings.showCheckbox) {
14633
- if ((e.ctrlKey || Browser.isDevice) && this.isSelected(li)) {
14936
+ if ((e.ctrlKey || e.metaKey || Browser.isDevice) && this.isSelected(li)) {
14634
14937
  li.classList.remove(cssClass.selected);
14635
14938
  li.removeAttribute('aria-selected');
14636
14939
  isSelect = false;
14637
14940
  }
14638
- else if (!(this.selectionSettings.mode === 'Multiple' && (e.ctrlKey || Browser.isDevice))) {
14941
+ else if (!(this.selectionSettings.mode === 'Multiple' && (e.ctrlKey || e.metaKey || Browser.isDevice))) {
14639
14942
  this.getSelectedItems().forEach(function (ele) {
14640
14943
  ele.removeAttribute('aria-selected');
14641
14944
  });
@@ -14995,7 +15298,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14995
15298
  var isRefresh = tListBox.sortOrder !== 'None' || (tListBox.selectionSettings.showCheckbox !==
14996
15299
  fListBox.selectionSettings.showCheckbox) || tListBox.fields.groupBy || tListBox.itemTemplate || fListBox.itemTemplate;
14997
15300
  this.removeSelected(fListBox, fListBox.getSelectedItems());
14998
- var tempItems = [].slice.call(fListBox.jsonData);
15301
+ var tempItems = [].slice.call(fListBox.listData);
14999
15302
  var localDataArgs = { cancel: false, items: tempItems, eventName: this.toolbarAction };
15000
15303
  fListBox.trigger('actionBegin', localDataArgs);
15001
15304
  if (localDataArgs.cancel) {
@@ -15040,12 +15343,18 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15040
15343
  fListBox.value = [];
15041
15344
  listData = listData
15042
15345
  .filter(function (data) { return data.isHeader !== true; });
15346
+ var sortedData = listData.filter(function (val) {
15347
+ return tListBox.jsonData.indexOf(val) === -1;
15348
+ });
15349
+ for (var i = 0; i < sortedData.length; i++) {
15350
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15351
+ tListBox.jsonData.splice(index + i, 0, sortedData[i]);
15352
+ }
15043
15353
  tListBox.listData = listData;
15044
- tListBox.jsonData = jsonData;
15045
- if (this.listData.length == this.jsonData.length) {
15354
+ if (fListBox.listData.length === fListBox.jsonData.length) {
15046
15355
  fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
15047
15356
  }
15048
- else if (this.allowFiltering) {
15357
+ else if (fListBox.allowFiltering) {
15049
15358
  for (var i = 0; i < fListBox.listData.length; i++) {
15050
15359
  for (var j = 0; j < fListBox.jsonData.length; j++) {
15051
15360
  if (fListBox.listData[i] === fListBox.jsonData[j]) {
@@ -15108,21 +15417,35 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15108
15417
  }
15109
15418
  return listObj;
15110
15419
  };
15111
- ListBox.prototype.getGrabbedItems = function () {
15420
+ ListBox.prototype.getGrabbedItems = function (args) {
15421
+ var grabbItems = false;
15112
15422
  for (var i = 0; i < this.value.length; i++) {
15113
- if (this.value[i] === this.dragValue) {
15423
+ if (this.value[i] === this.getFormattedValue(args.target.getAttribute('data-value'))) {
15424
+ grabbItems = true;
15425
+ break;
15426
+ }
15427
+ }
15428
+ if (grabbItems) {
15429
+ for (var i = 0; i < this.value.length; i++) {
15114
15430
  var liColl = this.list.querySelectorAll('[aria-selected="true"]');
15115
- for (var i_1 = 0; i_1 < liColl.length; i_1++) {
15116
- liColl[i_1].classList.add('e-grabbed');
15431
+ for (var j = 0; j < liColl.length; j++) {
15432
+ if (this.value[i] === this.getFormattedValue(liColl[j].getAttribute('data-value'))) {
15433
+ liColl[j].classList.add('e-grabbed');
15434
+ }
15117
15435
  }
15118
- break;
15119
15436
  }
15120
15437
  }
15121
- var elems = Array.prototype.slice.call(this.element.querySelectorAll('.e-grabbed'));
15438
+ var elems;
15439
+ if (this.isAngular) {
15440
+ elems = Array.prototype.slice.call(this.element.getElementsByClassName('e-list-parent')[0].querySelectorAll('.e-grabbed'));
15441
+ }
15442
+ else {
15443
+ elems = Array.prototype.slice.call(this.element.nextElementSibling.querySelectorAll('.e-grabbed'));
15444
+ }
15122
15445
  return elems;
15123
15446
  };
15124
15447
  ListBox.prototype.getDragArgs = function (args, isDragEnd) {
15125
- var elems = this.getGrabbedItems();
15448
+ var elems = this.getGrabbedItems(args);
15126
15449
  if (elems.length) {
15127
15450
  if (isDragEnd) {
15128
15451
  elems.push(args.target);
@@ -15174,7 +15497,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15174
15497
  }
15175
15498
  }
15176
15499
  }
15177
- else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== "KeyA") {
15500
+ else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== 'KeyA') {
15178
15501
  this.upDownKeyHandler(e);
15179
15502
  }
15180
15503
  }
@@ -15218,8 +15541,8 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15218
15541
  }
15219
15542
  if (this.selectionSettings.showCheckbox && e.ctrlKey && e.shiftKey && (e.keyCode === 36 || e.keyCode === 35)) {
15220
15543
  var selectedidx = Array.prototype.indexOf.call(ul.children, fli);
15221
- var sidx = e.code === "Home" ? 0 : selectedidx;
15222
- var eidx = e.code === "Home" ? selectedidx : ul.children.length - 1;
15544
+ var sidx = e.code === 'Home' ? 0 : selectedidx;
15545
+ var eidx = e.code === 'Home' ? selectedidx : ul.children.length - 1;
15223
15546
  for (var i = sidx; i <= eidx; i++) {
15224
15547
  var item = ul.children[i];
15225
15548
  this.notify('updatelist', { li: item, e: {
@@ -15377,7 +15700,6 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15377
15700
  dvalue_1 = _this.getFormattedValue(li.getAttribute('data-value'));
15378
15701
  if (values.indexOf(dvalue_1) < 0) {
15379
15702
  li.getElementsByClassName('e-check')[0].classList.remove('e-check');
15380
- li.getElementsByClassName('e-checkbox-wrapper')[0].removeAttribute('aria-checked');
15381
15703
  li.removeAttribute('aria-selected');
15382
15704
  }
15383
15705
  });
@@ -15399,6 +15721,9 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15399
15721
  else {
15400
15722
  text = value;
15401
15723
  }
15724
+ if (typeof (text) === 'string') {
15725
+ text = text.split("\\").join("\\\\");
15726
+ }
15402
15727
  li = _this.list.querySelector('[data-value="' + text + '"]');
15403
15728
  if (li) {
15404
15729
  if (_this.selectionSettings.showCheckbox) {
@@ -15729,6 +16054,12 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15729
16054
  __decorate$6([
15730
16055
  Property('')
15731
16056
  ], ListBox.prototype, "height", void 0);
16057
+ __decorate$6([
16058
+ Property(true)
16059
+ ], ListBox.prototype, "enabled", void 0);
16060
+ __decorate$6([
16061
+ Property(false)
16062
+ ], ListBox.prototype, "enablePersistence", void 0);
15732
16063
  __decorate$6([
15733
16064
  Property(false)
15734
16065
  ], ListBox.prototype, "allowDragAndDrop", void 0);
@@ -15805,6 +16136,1468 @@ var listBoxClasses = {
15805
16136
  clearIcon: 'e-clear-icon'
15806
16137
  };
15807
16138
 
16139
+ /**
16140
+ * export all modules from current location
16141
+ */
16142
+
16143
+ var __extends$7 = (undefined && undefined.__extends) || (function () {
16144
+ var extendStatics = function (d, b) {
16145
+ extendStatics = Object.setPrototypeOf ||
16146
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
16147
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
16148
+ return extendStatics(d, b);
16149
+ };
16150
+ return function (d, b) {
16151
+ extendStatics(d, b);
16152
+ function __() { this.constructor = d; }
16153
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
16154
+ };
16155
+ })();
16156
+ var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
16157
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16158
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
16159
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
16160
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
16161
+ };
16162
+ /**
16163
+ * The Mention component is used to list someone or something based on user input in textarea, input,
16164
+ * or any other editable element from which the user can select.
16165
+ */
16166
+ var Mention = /** @__PURE__ @class */ (function (_super) {
16167
+ __extends$7(Mention, _super);
16168
+ /**
16169
+ * * Constructor for creating the widget
16170
+ *
16171
+ * @param {MentionModel} options - Specifies the MentionComponent model.
16172
+ * @param {string | HTMLElement} element - Specifies the element to render as component.
16173
+ * @private
16174
+ */
16175
+ function Mention(options, element) {
16176
+ return _super.call(this, options, element) || this;
16177
+ }
16178
+ /**
16179
+ * When property value changes happened, then onPropertyChanged method will execute the respective changes in this component.
16180
+ *
16181
+ * @param {MentionModel} newProp - Returns the dynamic property value of the component.
16182
+ * @param {MentionModel} oldProp - Returns the previous property value of the component.
16183
+ * @private
16184
+ * @returns {void}
16185
+ */
16186
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
16187
+ Mention.prototype.onPropertyChanged = function (newProp, oldProp) {
16188
+ for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
16189
+ var prop = _a[_i];
16190
+ switch (prop) {
16191
+ case 'minLength':
16192
+ this.minLength = newProp.minLength;
16193
+ break;
16194
+ case 'suffixText':
16195
+ this.suffixText = newProp.suffixText;
16196
+ break;
16197
+ case 'allowSpaces':
16198
+ this.allowSpaces = newProp.allowSpaces;
16199
+ break;
16200
+ case 'mentionChar':
16201
+ this.mentionChar = newProp.mentionChar;
16202
+ break;
16203
+ case 'showMentionChar':
16204
+ this.showMentionChar = newProp.showMentionChar;
16205
+ break;
16206
+ case 'cssClass':
16207
+ this.updateCssClass(newProp.cssClass, oldProp.cssClass);
16208
+ break;
16209
+ }
16210
+ }
16211
+ };
16212
+ Mention.prototype.updateCssClass = function (newClass, oldClass) {
16213
+ if (!isNullOrUndefined(oldClass)) {
16214
+ oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
16215
+ }
16216
+ if (!isNullOrUndefined(newClass)) {
16217
+ newClass = (newClass.replace(/\s+/g, ' ')).trim();
16218
+ }
16219
+ this.setCssClass(newClass, [this.inputElement], oldClass);
16220
+ if (this.popupObj) {
16221
+ this.setCssClass(newClass, [this.popupObj.element], oldClass);
16222
+ }
16223
+ };
16224
+ Mention.prototype.setCssClass = function (cssClass$$1, elements, oldClass) {
16225
+ if (!isNullOrUndefined(oldClass) && oldClass !== '') {
16226
+ removeClass(elements, oldClass.split(' '));
16227
+ }
16228
+ if (!isNullOrUndefined(cssClass$$1) && cssClass$$1 !== '') {
16229
+ addClass(elements, cssClass$$1.split(' '));
16230
+ }
16231
+ };
16232
+ Mention.prototype.initializeData = function () {
16233
+ this.isSelected = false;
16234
+ this.isFiltered = false;
16235
+ this.beforePopupOpen = false;
16236
+ this.initRemoteRender = false;
16237
+ this.isListResetted = false;
16238
+ this.isPopupOpen = false;
16239
+ this.isCollided = false;
16240
+ this.lineBreak = false;
16241
+ this.keyConfigure = {
16242
+ tab: 'tab',
16243
+ enter: '13',
16244
+ escape: '27',
16245
+ end: '35',
16246
+ home: '36',
16247
+ down: '40',
16248
+ up: '38',
16249
+ pageUp: '33',
16250
+ pageDown: '34',
16251
+ open: 'alt+40',
16252
+ close: 'shift+tab',
16253
+ hide: 'alt+38',
16254
+ space: '32'
16255
+ };
16256
+ };
16257
+ /**
16258
+ * Execute before render the list items
16259
+ *
16260
+ * @private
16261
+ * @returns {void}
16262
+ */
16263
+ Mention.prototype.preRender = function () {
16264
+ this.initializeData();
16265
+ _super.prototype.preRender.call(this);
16266
+ };
16267
+ /**
16268
+ * To Initialize the control rendering
16269
+ *
16270
+ * @private
16271
+ * @returns {void}
16272
+ */
16273
+ Mention.prototype.render = function () {
16274
+ this.inputElement = !isNullOrUndefined(this.target) ? ((typeof this.target) === 'string') ?
16275
+ document.querySelector(this.target) : this.target : this.element;
16276
+ if (this.isContentEditable(this.inputElement)) {
16277
+ this.inputElement.setAttribute('contenteditable', 'true');
16278
+ addClass([this.inputElement], ['e-mention']);
16279
+ if (isNullOrUndefined(this.target)) {
16280
+ addClass([this.inputElement], ['e-editable-element']);
16281
+ }
16282
+ }
16283
+ this.queryString = this.elementValue();
16284
+ this.wireEvent();
16285
+ };
16286
+ Mention.prototype.wireEvent = function () {
16287
+ EventHandler.add(this.inputElement, 'keyup', this.onKeyUp, this);
16288
+ this.bindCommonEvent();
16289
+ };
16290
+ Mention.prototype.unWireEvent = function () {
16291
+ EventHandler.remove(this.inputElement, 'keyup', this.onKeyUp);
16292
+ this.unBindCommonEvent();
16293
+ };
16294
+ Mention.prototype.bindCommonEvent = function () {
16295
+ if (!Browser.isDevice) {
16296
+ this.keyboardModule = new KeyboardEvents(this.inputElement, {
16297
+ keyAction: this.keyActionHandler.bind(this), keyConfigs: this.keyConfigure, eventName: 'keydown'
16298
+ });
16299
+ }
16300
+ };
16301
+ /**
16302
+ * Hides the spinner loader.
16303
+ *
16304
+ * @private
16305
+ * @returns {void}
16306
+ */
16307
+ Mention.prototype.hideSpinner = function () {
16308
+ this.hideWaitingSpinner();
16309
+ };
16310
+ Mention.prototype.hideWaitingSpinner = function () {
16311
+ if (!isNullOrUndefined(this.spinnerElement)) {
16312
+ hideSpinner(this.spinnerElement);
16313
+ }
16314
+ if (!isNullOrUndefined(this.spinnerTemplate) && !isNullOrUndefined(this.spinnerTemplateElement)) {
16315
+ detach(this.spinnerTemplateElement);
16316
+ }
16317
+ };
16318
+ /**
16319
+ * Shows the spinner loader.
16320
+ *
16321
+ * @returns {void}
16322
+ */
16323
+ Mention.prototype.showWaitingSpinner = function () {
16324
+ if (!isNullOrUndefined(this.popupObj)) {
16325
+ if (isNullOrUndefined(this.spinnerTemplate) && isNullOrUndefined(this.spinnerElement)) {
16326
+ this.spinnerElement = this.popupObj.element;
16327
+ createSpinner({
16328
+ target: this.spinnerElement,
16329
+ width: Browser.isDevice ? '16px' : '14px'
16330
+ }, this.createElement);
16331
+ showSpinner(this.spinnerElement);
16332
+ }
16333
+ if (!isNullOrUndefined(this.spinnerTemplate)) {
16334
+ this.setSpinnerTemplate();
16335
+ }
16336
+ }
16337
+ };
16338
+ Mention.prototype.keyActionHandler = function (e) {
16339
+ var isNavigation = (e.action === 'down' || e.action === 'up' || e.action === 'pageUp' || e.action === 'pageDown'
16340
+ || e.action === 'home' || e.action === 'end');
16341
+ var isTabAction = e.action === 'tab' || e.action === 'close';
16342
+ if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape' && e.action !== 'space') {
16343
+ this.renderList();
16344
+ }
16345
+ if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
16346
+ isNavigation && this.liCollections.length === 0) || this.isRequested) {
16347
+ return;
16348
+ }
16349
+ if (e.action === 'escape') {
16350
+ e.preventDefault();
16351
+ }
16352
+ this.isSelected = e.action === 'escape' ? false : this.isSelected;
16353
+ switch (e.action) {
16354
+ case 'down':
16355
+ case 'up':
16356
+ this.updateUpDownAction(e);
16357
+ break;
16358
+ case 'tab':
16359
+ if (this.isPopupOpen) {
16360
+ e.preventDefault();
16361
+ var li = this.list.querySelector('.' + dropDownBaseClasses.selected);
16362
+ if (li) {
16363
+ this.setSelection(li, e);
16364
+ }
16365
+ if (this.isPopupOpen) {
16366
+ this.hidePopup(e);
16367
+ }
16368
+ }
16369
+ break;
16370
+ case 'enter':
16371
+ if (this.isPopupOpen) {
16372
+ e.preventDefault();
16373
+ if (this.popupObj && this.popupObj.element.contains(this.selectedLI)) {
16374
+ this.setValue(e);
16375
+ }
16376
+ }
16377
+ break;
16378
+ case 'escape':
16379
+ if (this.isPopupOpen) {
16380
+ this.hidePopup(e);
16381
+ }
16382
+ break;
16383
+ }
16384
+ };
16385
+ Mention.prototype.updateUpDownAction = function (e) {
16386
+ var focusEle = this.list.querySelector('.' + dropDownBaseClasses.focus);
16387
+ if (this.isSelectFocusItem(focusEle)) {
16388
+ this.setSelection(focusEle, e);
16389
+ }
16390
+ else if (!isNullOrUndefined(this.liCollections)) {
16391
+ var li = this.list.querySelector('.' + dropDownBaseClasses.selected);
16392
+ if (!isNullOrUndefined(li)) {
16393
+ var value = this.getFormattedValue(li.getAttribute('data-value'));
16394
+ this.activeIndex = this.getIndexByValue(value);
16395
+ }
16396
+ var index = e.action === 'down' ? this.activeIndex + 1 : this.activeIndex - 1;
16397
+ var startIndex = 0;
16398
+ startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
16399
+ index = index < 0 ? this.liCollections.length - 1 : index === this.liCollections.length ? 0 : index;
16400
+ var nextItem = isNullOrUndefined(this.activeIndex) ?
16401
+ this.liCollections[startIndex] : this.liCollections[index];
16402
+ if (!isNullOrUndefined(nextItem)) {
16403
+ this.setSelection(nextItem, e);
16404
+ }
16405
+ }
16406
+ if (this.isPopupOpen) {
16407
+ e.preventDefault();
16408
+ }
16409
+ };
16410
+ Mention.prototype.isSelectFocusItem = function (element) {
16411
+ return !isNullOrUndefined(element);
16412
+ };
16413
+ Mention.prototype.unBindCommonEvent = function () {
16414
+ if (!Browser.isDevice) {
16415
+ this.keyboardModule.destroy();
16416
+ }
16417
+ };
16418
+ Mention.prototype.onKeyUp = function (e) {
16419
+ var rangetextContent;
16420
+ if (this.isContentEditable(this.inputElement)) {
16421
+ this.range = this.getCurrentRange();
16422
+ rangetextContent = this.range.startContainer.textContent.split('');
16423
+ }
16424
+ var currentRange = this.getTextRange();
16425
+ var lastWordRange = this.getLastLetter(currentRange);
16426
+ // eslint-disable-next-line security/detect-non-literal-regexp
16427
+ var Regex = new RegExp(this.mentionChar, 'g');
16428
+ var charRegex = new RegExp('[a-zA-Z]', 'g');
16429
+ if (e.key === 'Shift' || e.keyCode === 37 || e.keyCode === 39) {
16430
+ if ((e.keyCode === 37 || e.keyCode === 39) && !isNullOrUndefined(currentRange) &&
16431
+ currentRange.indexOf(this.mentionChar) === -1 && this.isPopupOpen) {
16432
+ this.hidePopup();
16433
+ }
16434
+ return;
16435
+ }
16436
+ if ((!currentRange || !lastWordRange) || e.code === 'Enter' || e.keyCode === 27 ||
16437
+ (lastWordRange.match(Regex) && lastWordRange.match(Regex).length > 1) ||
16438
+ (this.isContentEditable(this.inputElement) && this.range.startContainer &&
16439
+ this.range.startContainer.previousElementSibling && this.range.startContainer.textContent.split('').length > 0 &&
16440
+ (rangetextContent.length === 1 || rangetextContent[rangetextContent.length - 2].indexOf('') === -1 ||
16441
+ this.range.startContainer.nodeType === 1))) {
16442
+ if (this.allowSpaces && currentRange && currentRange.trim() !== '' && charRegex.test(currentRange) && currentRange.indexOf(this.mentionChar) !== -1
16443
+ && !this.isMatchedText() && (currentRange.length > 1 && currentRange.replace(/\u00A0/g, ' ').charAt(currentRange.length - 2) !== ' ') &&
16444
+ (this.list && this.list.querySelectorAll('ul').length > 0)) {
16445
+ this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
16446
+ this.searchLists(e);
16447
+ }
16448
+ else if (this.isPopupOpen && (!this.allowSpaces || !lastWordRange)) {
16449
+ this.hidePopup();
16450
+ this.lineBreak = true;
16451
+ }
16452
+ return;
16453
+ }
16454
+ this.queryString = lastWordRange.replace(this.mentionChar, '');
16455
+ if (this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0) &&
16456
+ this.queryString !== '' && e.keyCode !== 38 && e.keyCode !== 40 && !this.lineBreak) {
16457
+ this.searchLists(e);
16458
+ if (!this.isPopupOpen && this.queryString.length >= this.minLength) {
16459
+ if (!this.isContentEditable(this.inputElement)) {
16460
+ this.showPopup();
16461
+ }
16462
+ else if (this.isContentEditable(this.inputElement) && this.range && this.range.startContainer !== this.inputElement && e.keyCode !== 9) {
16463
+ this.showPopup();
16464
+ }
16465
+ }
16466
+ }
16467
+ else if (lastWordRange.indexOf(this.mentionChar) === 0 && !this.isPopupOpen && e.keyCode !== 8 && (!this.popupObj ||
16468
+ (isNullOrUndefined(this.target) && !document.body.contains(this.popupObj.element) ||
16469
+ !isNullOrUndefined(this.target) && document.body.contains(this.popupObj.element)))) {
16470
+ if (this.initRemoteRender && this.list && this.list.classList.contains('e-nodata')) {
16471
+ this.searchLists(e);
16472
+ }
16473
+ this.resetList(this.dataSource, this.fields);
16474
+ if (isNullOrUndefined(this.list)) {
16475
+ this.initValue();
16476
+ }
16477
+ if (!this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40) {
16478
+ this.showPopup();
16479
+ if (this.initRemoteRender && this.list.querySelectorAll('li').length === 0) {
16480
+ this.showWaitingSpinner();
16481
+ }
16482
+ this.lineBreak = false;
16483
+ }
16484
+ }
16485
+ else if (this.allowSpaces && this.queryString !== '' && currentRange && currentRange.trim() !== '' && currentRange.replace('\u00a0', ' ').lastIndexOf(' ') < currentRange.length - 1 &&
16486
+ e.keyCode !== 38 && e.keyCode !== 40 && e.keyCode !== 8 && this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0)) {
16487
+ this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
16488
+ this.searchLists(e);
16489
+ }
16490
+ else if (this.queryString === '' && this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40 && this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0)) {
16491
+ this.searchLists(e);
16492
+ if (!this.isListResetted) {
16493
+ this.resetList(this.dataSource, this.fields);
16494
+ }
16495
+ }
16496
+ this.isListResetted = false;
16497
+ };
16498
+ Mention.prototype.isMatchedText = function () {
16499
+ var isMatched = false;
16500
+ for (var i = 0; i < (this.liCollections && this.liCollections.length); i++) {
16501
+ if (this.getTextRange() &&
16502
+ this.getTextRange().substring(this.getTextRange().lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ').trim() === this.liCollections[i].getAttribute('data-value').toLowerCase()) {
16503
+ isMatched = true;
16504
+ }
16505
+ }
16506
+ return isMatched;
16507
+ };
16508
+ Mention.prototype.getCurrentRange = function () {
16509
+ this.range = this.inputElement.ownerDocument.getSelection().getRangeAt(0);
16510
+ return this.range;
16511
+ };
16512
+ Mention.prototype.searchLists = function (e) {
16513
+ var _this = this;
16514
+ this.isDataFetched = false;
16515
+ if (isNullOrUndefined(this.list)) {
16516
+ _super.prototype.render.call(this);
16517
+ this.unWireListEvents();
16518
+ this.wireListEvents();
16519
+ }
16520
+ if (e.type !== 'mousedown' && (e.keyCode === 40 || e.keyCode === 38)) {
16521
+ this.queryString = this.queryString === '' ? null : this.queryString;
16522
+ this.beforePopupOpen = true;
16523
+ this.resetList(this.dataSource, this.fields);
16524
+ return;
16525
+ }
16526
+ this.isSelected = false;
16527
+ this.activeIndex = null;
16528
+ var eventArgs = {
16529
+ preventDefaultAction: false,
16530
+ text: this.queryString,
16531
+ updateData: function (dataSource, query, fields) {
16532
+ if (eventArgs.cancel) {
16533
+ return;
16534
+ }
16535
+ _this.isFiltered = true;
16536
+ _this.filterAction(dataSource, query, fields);
16537
+ },
16538
+ cancel: false
16539
+ };
16540
+ this.trigger('filtering', eventArgs, function (eventArgs) {
16541
+ if (!eventArgs.cancel && !_this.isFiltered && !eventArgs.preventDefaultAction) {
16542
+ _this.filterAction(_this.dataSource, null, _this.fields);
16543
+ }
16544
+ });
16545
+ };
16546
+ Mention.prototype.filterAction = function (dataSource, query, fields) {
16547
+ this.beforePopupOpen = true;
16548
+ if (this.queryString.length >= this.minLength) {
16549
+ this.resetList(dataSource, fields, query);
16550
+ this.isListResetted = true;
16551
+ }
16552
+ else {
16553
+ if (this.isPopupOpen) {
16554
+ this.hidePopup();
16555
+ }
16556
+ this.beforePopupOpen = false;
16557
+ }
16558
+ this.setDataIndex();
16559
+ this.renderReactTemplates();
16560
+ };
16561
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
16562
+ Mention.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
16563
+ _super.prototype.onActionComplete.call(this, ulElement, list, e);
16564
+ if (this.isActive) {
16565
+ if (!isNullOrUndefined(ulElement)) {
16566
+ attributes(ulElement, { 'id': this.inputElement.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
16567
+ }
16568
+ var focusItem = ulElement.querySelector('.' + dropDownBaseClasses.li);
16569
+ if (focusItem) {
16570
+ focusItem.classList.add(dropDownBaseClasses.selected);
16571
+ this.selectedLI = focusItem;
16572
+ var value = this.getFormattedValue(focusItem.getAttribute('data-value'));
16573
+ this.selectEventCallback(focusItem, this.getDataByValue(value), value, true);
16574
+ }
16575
+ }
16576
+ };
16577
+ Mention.prototype.setDataIndex = function () {
16578
+ for (var i = 0; this.liCollections && i < this.liCollections.length; i++) {
16579
+ this.liCollections[i].setAttribute('data-index', i.toString());
16580
+ }
16581
+ };
16582
+ Mention.prototype.listOption = function (dataSource, fieldsSettings) {
16583
+ var _this = this;
16584
+ var fields = _super.prototype.listOption.call(this, dataSource, fieldsSettings);
16585
+ if (isNullOrUndefined(fields.itemCreated)) {
16586
+ fields.itemCreated = function (e) {
16587
+ if (_this.highlight) {
16588
+ if (_this.inputElement.tagName === _this.getNgDirective() && _this.itemTemplate) {
16589
+ setTimeout(function () {
16590
+ highlightSearch(e.item, _this.queryString, _this.ignoreCase, _this.filterType);
16591
+ }, 0);
16592
+ }
16593
+ else {
16594
+ highlightSearch(e.item, _this.queryString, _this.ignoreCase, _this.filterType);
16595
+ }
16596
+ }
16597
+ };
16598
+ }
16599
+ else {
16600
+ var itemCreated_1 = fields.itemCreated;
16601
+ fields.itemCreated = function (e) {
16602
+ if (_this.highlight) {
16603
+ highlightSearch(e.item, _this.queryString, _this.ignoreCase, _this.filterType);
16604
+ }
16605
+ itemCreated_1.apply(_this, [e]);
16606
+ };
16607
+ }
16608
+ return fields;
16609
+ };
16610
+ Mention.prototype.elementValue = function () {
16611
+ if (!this.isContentEditable(this.inputElement)) {
16612
+ return this.inputElement.value.replace(this.mentionChar, '');
16613
+ }
16614
+ else {
16615
+ return this.inputElement.textContent.replace(this.mentionChar, '');
16616
+ }
16617
+ };
16618
+ Mention.prototype.getQuery = function (query) {
16619
+ var filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
16620
+ var filterType = (this.queryString === '' && !isNullOrUndefined(this.elementValue())) ? 'equal' : this.filterType;
16621
+ var queryString = (this.queryString === '' && !isNullOrUndefined(this.elementValue())) ?
16622
+ this.elementValue() : this.queryString;
16623
+ if (this.isFiltered) {
16624
+ return filterQuery;
16625
+ }
16626
+ if (this.queryString !== null && this.queryString !== '') {
16627
+ var dataType = this.typeOfData(this.dataSource).typeof;
16628
+ if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
16629
+ filterQuery.where('', filterType, queryString, this.ignoreCase, this.ignoreAccent);
16630
+ }
16631
+ else {
16632
+ var mapping = !isNullOrUndefined(this.fields.text) ? this.fields.text : '';
16633
+ filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
16634
+ }
16635
+ }
16636
+ if (!isNullOrUndefined(this.suggestionCount)) {
16637
+ // Since defualt value of suggestioncount is 25, checked the condition
16638
+ if (this.suggestionCount !== 25) {
16639
+ for (var queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
16640
+ if (filterQuery.queries[queryElements].fn === 'onTake') {
16641
+ filterQuery.queries.splice(queryElements, 1);
16642
+ }
16643
+ }
16644
+ }
16645
+ filterQuery.take(this.suggestionCount);
16646
+ }
16647
+ return filterQuery;
16648
+ };
16649
+ Mention.prototype.renderHightSearch = function () {
16650
+ if (this.highlight) {
16651
+ for (var i = 0; i < this.liCollections.length; i++) {
16652
+ var isHighlight = this.ulElement.querySelector('.e-active');
16653
+ if (!isHighlight) {
16654
+ revertHighlightSearch(this.liCollections[i]);
16655
+ highlightSearch(this.liCollections[i], this.queryString, this.ignoreCase, this.filterType);
16656
+ }
16657
+ }
16658
+ }
16659
+ };
16660
+ Mention.prototype.getTextRange = function () {
16661
+ var text;
16662
+ if (!this.isContentEditable(this.inputElement)) {
16663
+ var component = this.inputElement;
16664
+ if (!isNullOrUndefined(component)) {
16665
+ var startPos = component.selectionStart;
16666
+ if (component.value && startPos >= 0) {
16667
+ text = component.value.substring(0, startPos);
16668
+ }
16669
+ }
16670
+ }
16671
+ else {
16672
+ if (this.range) {
16673
+ var selectedElem = this.range.startContainer;
16674
+ if (!isNullOrUndefined(selectedElem)) {
16675
+ var workingNodeContent = selectedElem.textContent;
16676
+ var selectStartOffset = this.range.startOffset;
16677
+ if (workingNodeContent && selectStartOffset >= 0) {
16678
+ text = workingNodeContent.substring(0, selectStartOffset);
16679
+ }
16680
+ }
16681
+ }
16682
+ }
16683
+ return text;
16684
+ };
16685
+ Mention.prototype.getLastLetter = function (text) {
16686
+ if (isNullOrUndefined(text)) {
16687
+ return '';
16688
+ }
16689
+ var textValue = text.replace(/\u00A0/g, ' ');
16690
+ var words = textValue.split(/\s+/);
16691
+ var wordCnt = words.length - 1;
16692
+ return words[wordCnt].trim();
16693
+ };
16694
+ Mention.prototype.isContentEditable = function (element) {
16695
+ return element && element.nodeName !== 'INPUT' && element.nodeName !== 'TEXTAREA';
16696
+ };
16697
+ /**
16698
+ * Opens the popup that displays the list of items.
16699
+ *
16700
+ * @returns {void}
16701
+ */
16702
+ Mention.prototype.showPopup = function () {
16703
+ this.beforePopupOpen = true;
16704
+ if (isNullOrUndefined(this.list)) {
16705
+ this.initValue();
16706
+ }
16707
+ this.renderPopup();
16708
+ attributes(this.inputElement, { 'aria-activedescendant': this.selectedElementID });
16709
+ if (this.selectedElementID == null) {
16710
+ this.inputElement.removeAttribute('aria-activedescendant');
16711
+ }
16712
+ };
16713
+ /* eslint-disable valid-jsdoc, jsdoc/require-param */
16714
+ /**
16715
+ * Hides the popup if it is in an open state.
16716
+ *
16717
+ * @returns {void}
16718
+ */
16719
+ Mention.prototype.hidePopup = function (e) {
16720
+ this.removeSelection();
16721
+ this.closePopup(0, e);
16722
+ };
16723
+ Mention.prototype.closePopup = function (delay, e) {
16724
+ var _this = this;
16725
+ if (!(this.popupObj && document.body.contains(this.popupObj.element) && this.beforePopupOpen)) {
16726
+ return;
16727
+ }
16728
+ EventHandler.remove(document, 'mousedown', this.onDocumentClick);
16729
+ this.inputElement.removeAttribute('aria-owns');
16730
+ this.inputElement.removeAttribute('aria-activedescendant');
16731
+ this.beforePopupOpen = false;
16732
+ var animModel = {
16733
+ name: 'FadeOut',
16734
+ duration: 100,
16735
+ delay: delay ? delay : 0
16736
+ };
16737
+ var popupInstance = this.popupObj;
16738
+ var eventArgs = { popup: popupInstance, cancel: false, animation: animModel, event: e || null };
16739
+ this.trigger('closed', eventArgs, function (eventArgs) {
16740
+ if (!eventArgs.cancel && _this.popupObj) {
16741
+ if (_this.isPopupOpen) {
16742
+ _this.popupObj.hide(new Animation(eventArgs.animation));
16743
+ }
16744
+ else {
16745
+ _this.destroyPopup();
16746
+ }
16747
+ }
16748
+ });
16749
+ };
16750
+ Mention.prototype.renderPopup = function () {
16751
+ var _this = this;
16752
+ var args = { cancel: false };
16753
+ this.trigger('beforeOpen', args, function (args) {
16754
+ if (!args.cancel) {
16755
+ var popupEle_1;
16756
+ if (isNullOrUndefined(_this.target)) {
16757
+ popupEle_1 = _this.createElement('div', {
16758
+ id: _this.inputElement.id + '_popup', className: 'e-mention e-popup ' + (_this.cssClass != null ? _this.cssClass : '')
16759
+ });
16760
+ }
16761
+ else {
16762
+ popupEle_1 = _this.element;
16763
+ if (_this.cssClass != null) {
16764
+ addClass([popupEle_1], _this.cssClass.split(' '));
16765
+ }
16766
+ }
16767
+ if (!isNullOrUndefined(_this.target)) {
16768
+ popupEle_1.id = _this.inputElement.id + '_popup';
16769
+ addClass([popupEle_1], ['e-mention', 'e-popup', 'e-popup-close']);
16770
+ }
16771
+ _this.listHeight = formatUnit(_this.popupHeight);
16772
+ if (!isNullOrUndefined(_this.list.querySelector('li')) && !_this.initRemoteRender) {
16773
+ var li = _this.list.querySelector('.' + dropDownBaseClasses.focus);
16774
+ if (!isNullOrUndefined(li)) {
16775
+ _this.selectedLI = li;
16776
+ var value = _this.getFormattedValue(li.getAttribute('data-value'));
16777
+ _this.selectEventCallback(li, _this.getDataByValue(value), value, true);
16778
+ }
16779
+ }
16780
+ append([_this.list], popupEle_1);
16781
+ if ((!_this.popupObj || !document.body.contains(_this.popupObj.element)) ||
16782
+ !document.contains(popupEle_1) && isNullOrUndefined(_this.target)) {
16783
+ document.body.appendChild(popupEle_1);
16784
+ }
16785
+ var coordinates_1;
16786
+ popupEle_1.style.visibility = 'hidden';
16787
+ _this.setHeight(popupEle_1);
16788
+ var offsetValue = 0;
16789
+ var left = 0;
16790
+ _this.initializePopup(popupEle_1, offsetValue, left);
16791
+ _this.checkCollision(popupEle_1);
16792
+ popupEle_1.style.visibility = 'visible';
16793
+ if (!isNullOrUndefined(_this.list)) {
16794
+ _this.unWireListEvents();
16795
+ _this.wireListEvents();
16796
+ }
16797
+ _this.selectedElementID = _this.selectedLI ? _this.selectedLI.id : null;
16798
+ attributes(_this.inputElement, { 'aria-owns': _this.inputElement.id + '_options', 'aria-activedescendant': _this.selectedElementID });
16799
+ if (_this.selectedElementID == null) {
16800
+ _this.inputElement.removeAttribute('aria-activedescendant');
16801
+ }
16802
+ var animModel = { name: 'FadeIn', duration: 100 };
16803
+ _this.beforePopupOpen = true;
16804
+ var popupInstance = _this.popupObj;
16805
+ var eventArgs = { popup: popupInstance, cancel: false, animation: animModel };
16806
+ _this.trigger('opened', eventArgs, function (eventArgs) {
16807
+ if (!eventArgs.cancel) {
16808
+ _this.renderReactTemplates();
16809
+ _this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.inputElement : null);
16810
+ if (isNullOrUndefined(_this.getTriggerCharPosition())) {
16811
+ return;
16812
+ }
16813
+ coordinates_1 = _this.getCoordinates(_this.inputElement, _this.getTriggerCharPosition());
16814
+ if (!_this.isCollided) {
16815
+ popupEle_1.style.cssText = 'top: '.concat(coordinates_1.top.toString(), 'px;\n left: ').concat(coordinates_1.left.toString(), 'px;\nposition: absolute;\n display: block;');
16816
+ }
16817
+ else {
16818
+ popupEle_1.style.left = formatUnit(coordinates_1.left);
16819
+ _this.isCollided = false;
16820
+ }
16821
+ popupEle_1.style.width = _this.popupWidth !== '100%' && !isNullOrUndefined(_this.popupWidth) ? formatUnit(_this.popupWidth) : 'auto';
16822
+ _this.setHeight(popupEle_1);
16823
+ popupEle_1.style.zIndex = _this.zIndex === 1000 ? getZindexPartial(popupEle_1).toString() : _this.zIndex.toString();
16824
+ }
16825
+ else {
16826
+ _this.beforePopupOpen = false;
16827
+ _this.destroyPopup();
16828
+ }
16829
+ });
16830
+ }
16831
+ else {
16832
+ _this.beforePopupOpen = false;
16833
+ }
16834
+ });
16835
+ };
16836
+ Mention.prototype.setHeight = function (popupEle) {
16837
+ if (this.popupHeight !== 'auto') {
16838
+ this.list.style.maxHeight = (parseInt(this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
16839
+ popupEle.style.maxHeight = formatUnit(this.popupHeight);
16840
+ }
16841
+ else {
16842
+ popupEle.style.height = 'auto';
16843
+ }
16844
+ };
16845
+ Mention.prototype.checkCollision = function (popupEle) {
16846
+ if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
16847
+ var collision = isCollide(popupEle);
16848
+ if (collision.length > 0) {
16849
+ popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
16850
+ this.isCollided = true;
16851
+ }
16852
+ this.popupObj.resolveCollision();
16853
+ }
16854
+ };
16855
+ Mention.prototype.getTriggerCharPosition = function () {
16856
+ var mostRecentTriggerCharPos;
16857
+ var currentRange = this.getTextRange();
16858
+ if (currentRange !== undefined && currentRange !== null) {
16859
+ mostRecentTriggerCharPos = 0;
16860
+ var idx = currentRange.lastIndexOf(this.mentionChar);
16861
+ if (idx >= mostRecentTriggerCharPos) {
16862
+ mostRecentTriggerCharPos = idx;
16863
+ }
16864
+ }
16865
+ return mostRecentTriggerCharPos;
16866
+ };
16867
+ Mention.prototype.initializePopup = function (element, offsetValue, left) {
16868
+ var _this = this;
16869
+ this.popupObj = new Popup(element, {
16870
+ width: this.setWidth(), targetType: 'relative',
16871
+ relateTo: this.inputElement, collision: { X: 'flip', Y: 'flip' }, offsetY: offsetValue,
16872
+ enableRtl: this.enableRtl, offsetX: left, position: { X: 'top', Y: 'left' }, actionOnScroll: 'hide',
16873
+ zIndex: this.zIndex,
16874
+ close: function () {
16875
+ _this.destroyPopup();
16876
+ },
16877
+ open: function () {
16878
+ EventHandler.add(document, 'mousedown', _this.onDocumentClick, _this);
16879
+ _this.isPopupOpen = true;
16880
+ _this.setDataIndex();
16881
+ }
16882
+ });
16883
+ };
16884
+ Mention.prototype.setWidth = function () {
16885
+ var width = formatUnit(this.popupWidth);
16886
+ if (width.indexOf('%') > -1) {
16887
+ var inputWidth = this.inputElement.offsetWidth * parseFloat(width) / 100;
16888
+ width = inputWidth.toString() + 'px';
16889
+ }
16890
+ return width;
16891
+ };
16892
+ Mention.prototype.destroyPopup = function () {
16893
+ this.isPopupOpen = false;
16894
+ this.popupObj.destroy();
16895
+ if (isNullOrUndefined(this.target)) {
16896
+ detach(this.popupObj.element);
16897
+ }
16898
+ else {
16899
+ this.popupObj.element.innerHTML = '';
16900
+ this.popupObj.element.removeAttribute('style');
16901
+ this.popupObj.element.removeAttribute('aria-disabled');
16902
+ }
16903
+ };
16904
+ Mention.prototype.onDocumentClick = function (e) {
16905
+ var target = e.target;
16906
+ if (!(!isNullOrUndefined(this.popupObj) && closest(target, '#' + this.popupObj.element.id))) {
16907
+ this.hidePopup(e);
16908
+ }
16909
+ };
16910
+ Mention.prototype.getCoordinates = function (element, position) {
16911
+ var properties = ['direction', 'boxSizing', 'width', 'height', 'overflowX', 'overflowY', 'borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'fontStyle', 'fontVariant', 'fontWeight', 'fontStretch', 'fontSize', 'fontSizeAdjust', 'lineHeight', 'fontFamily', 'textAlign', 'textTransform', 'textIndent', 'textDecoration', 'letterSpacing', 'wordSpacing'];
16912
+ var div;
16913
+ var span;
16914
+ var range;
16915
+ var globalRange;
16916
+ var coordinates;
16917
+ var computed;
16918
+ var rect;
16919
+ if (!this.isContentEditable(this.inputElement)) {
16920
+ div = this.createElement('div', { className: 'e-form-mirror-div' });
16921
+ document.body.appendChild(div);
16922
+ computed = getComputedStyle(element);
16923
+ div.style.position = 'absolute';
16924
+ div.style.visibility = 'hidden';
16925
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16926
+ properties.forEach(function (prop) {
16927
+ // eslint-disable-next-line security/detect-object-injection
16928
+ div.style[prop] = computed[prop];
16929
+ });
16930
+ div.textContent = element.value.substring(0, position);
16931
+ if (this.inputElement.nodeName === 'INPUT') {
16932
+ div.textContent = div.textContent.replace(/\s/g, '\u00a0');
16933
+ }
16934
+ span = this.createElement('span');
16935
+ span.textContent = element.value.substring(position) || '.';
16936
+ div.appendChild(span);
16937
+ rect = element.getBoundingClientRect();
16938
+ }
16939
+ else {
16940
+ var selectedNodePosition = this.getTriggerCharPosition();
16941
+ globalRange = this.range;
16942
+ range = document.createRange();
16943
+ range.setStart(globalRange.startContainer, selectedNodePosition);
16944
+ range.setEnd(globalRange.startContainer, selectedNodePosition);
16945
+ range.collapse(false);
16946
+ rect = range.getBoundingClientRect();
16947
+ }
16948
+ var doc = document.documentElement;
16949
+ var windowLeft = (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);
16950
+ var windowTop = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
16951
+ if (!this.isContentEditable(this.inputElement)) {
16952
+ coordinates = {
16953
+ top: rect.top + windowTop + span.offsetTop + parseInt(computed.borderTopWidth, 10) +
16954
+ parseInt(computed.fontSize, 10) + 3 - element.scrollTop,
16955
+ left: rect.left + windowLeft + span.offsetLeft + parseInt(computed.borderLeftWidth, 10)
16956
+ };
16957
+ document.body.removeChild(div);
16958
+ }
16959
+ else {
16960
+ coordinates = {
16961
+ top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10),
16962
+ left: rect.left + windowLeft
16963
+ };
16964
+ }
16965
+ return coordinates;
16966
+ };
16967
+ Mention.prototype.initValue = function () {
16968
+ this.renderList();
16969
+ if (this.dataSource instanceof DataManager) {
16970
+ this.initRemoteRender = true;
16971
+ }
16972
+ else {
16973
+ this.updateValues();
16974
+ }
16975
+ };
16976
+ Mention.prototype.updateValues = function () {
16977
+ var li = this.list.querySelector('.' + dropDownBaseClasses.focus);
16978
+ if (!isNullOrUndefined(li)) {
16979
+ this.setSelection(li, null);
16980
+ }
16981
+ };
16982
+ Mention.prototype.renderList = function () {
16983
+ _super.prototype.render.call(this);
16984
+ this.unWireListEvents();
16985
+ this.wireListEvents();
16986
+ };
16987
+ /**
16988
+ * Event binding for list
16989
+ *
16990
+ * @returns {void}
16991
+ */
16992
+ Mention.prototype.wireListEvents = function () {
16993
+ EventHandler.add(this.list, 'click', this.onMouseClick, this);
16994
+ EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
16995
+ EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
16996
+ };
16997
+ /**
16998
+ * Event un binding for list items.
16999
+ *
17000
+ * @returns {void}
17001
+ */
17002
+ Mention.prototype.unWireListEvents = function () {
17003
+ EventHandler.remove(this.list, 'click', this.onMouseClick);
17004
+ EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
17005
+ EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
17006
+ };
17007
+ Mention.prototype.onMouseClick = function (e) {
17008
+ var target = e.target;
17009
+ var li = closest(target, '.' + dropDownBaseClasses.li);
17010
+ if (!this.isValidLI(li)) {
17011
+ return;
17012
+ }
17013
+ this.setSelection(li, e);
17014
+ var delay = 100;
17015
+ this.closePopup(delay, e);
17016
+ this.inputElement.focus();
17017
+ };
17018
+ Mention.prototype.updateSelectedItem = function (li, e, preventSelect, isSelection) {
17019
+ var _this = this;
17020
+ this.removeSelection();
17021
+ li.classList.add(dropDownBaseClasses.selected);
17022
+ this.removeHover();
17023
+ var value = this.getFormattedValue(li.getAttribute('data-value'));
17024
+ var selectedData = this.getDataByValue(value);
17025
+ if (!preventSelect && !isNullOrUndefined(e)) {
17026
+ var items = this.detachChanges(selectedData);
17027
+ this.isSelected = true;
17028
+ var eventArgs = {
17029
+ e: e,
17030
+ item: li,
17031
+ itemData: items,
17032
+ isInteracted: e ? true : false,
17033
+ cancel: false
17034
+ };
17035
+ this.trigger('select', eventArgs, function (eventArgs) {
17036
+ if (eventArgs.cancel) {
17037
+ li.classList.remove(dropDownBaseClasses.selected);
17038
+ }
17039
+ else {
17040
+ _this.selectEventCallback(li, selectedData, value);
17041
+ if (isSelection) {
17042
+ _this.setSelectOptions(li, e);
17043
+ }
17044
+ }
17045
+ });
17046
+ }
17047
+ else {
17048
+ this.selectEventCallback(li, selectedData, value);
17049
+ if (isSelection) {
17050
+ this.setSelectOptions(li, e);
17051
+ }
17052
+ }
17053
+ };
17054
+ Mention.prototype.setSelection = function (li, e) {
17055
+ if (this.isValidLI(li) && (!li.classList.contains(dropDownBaseClasses.selected) || (this.isPopupOpen && this.isSelected
17056
+ && li.classList.contains(dropDownBaseClasses.selected)))) {
17057
+ this.updateSelectedItem(li, e, false, true);
17058
+ }
17059
+ else {
17060
+ this.setSelectOptions(li, e);
17061
+ }
17062
+ };
17063
+ Mention.prototype.setSelectOptions = function (li, e) {
17064
+ if (this.list) {
17065
+ this.removeHover();
17066
+ }
17067
+ this.previousSelectedLI = (!isNullOrUndefined(this.selectedLI)) ? this.selectedLI : null;
17068
+ this.selectedLI = li;
17069
+ if (this.isPopupOpen && !isNullOrUndefined(this.selectedLI)) {
17070
+ this.setScrollPosition(e);
17071
+ }
17072
+ if (e && (e.keyCode === 38 || e.keyCode === 40)) {
17073
+ return;
17074
+ }
17075
+ if (isNullOrUndefined(e) || this.setValue(e)) {
17076
+ return;
17077
+ }
17078
+ };
17079
+ Mention.prototype.setScrollPosition = function (e) {
17080
+ if (!isNullOrUndefined(e)) {
17081
+ switch (e.action) {
17082
+ case 'pageDown':
17083
+ case 'down':
17084
+ case 'end':
17085
+ this.scrollBottom();
17086
+ break;
17087
+ default:
17088
+ this.scrollTop();
17089
+ break;
17090
+ }
17091
+ }
17092
+ else {
17093
+ this.scrollBottom(true);
17094
+ }
17095
+ };
17096
+ Mention.prototype.scrollBottom = function (isInitial) {
17097
+ if (!isNullOrUndefined(this.selectedLI)) {
17098
+ var currentOffset = this.list.offsetHeight;
17099
+ var nextBottom = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
17100
+ var nextOffset = this.list.scrollTop + nextBottom - currentOffset;
17101
+ nextOffset = isInitial ? nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10) * 2 : nextOffset;
17102
+ var boxRange = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
17103
+ if (this.activeIndex === 0) {
17104
+ this.list.scrollTop = 0;
17105
+ }
17106
+ else if (nextBottom > currentOffset || !(boxRange > 0 && this.list.offsetHeight > boxRange)) {
17107
+ this.list.scrollTop = nextOffset;
17108
+ }
17109
+ }
17110
+ };
17111
+ Mention.prototype.scrollTop = function () {
17112
+ if (!isNullOrUndefined(this.selectedLI)) {
17113
+ var nextOffset = this.selectedLI.offsetTop - this.list.scrollTop;
17114
+ nextOffset = this.fields.groupBy && nextOffset;
17115
+ var boxRange = (this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop);
17116
+ if (this.activeIndex === 0) {
17117
+ this.list.scrollTop = 0;
17118
+ }
17119
+ else if (nextOffset < 0) {
17120
+ this.list.scrollTop = this.list.scrollTop + nextOffset;
17121
+ }
17122
+ else if (!(boxRange > 0 && this.list.offsetHeight > boxRange)) {
17123
+ this.list.scrollTop = this.selectedLI.offsetTop;
17124
+ }
17125
+ }
17126
+ };
17127
+ Mention.prototype.selectEventCallback = function (li, selectedData, value, selectLi) {
17128
+ this.previousItemData = (!isNullOrUndefined(this.itemData)) ? this.itemData : null;
17129
+ this.item = li;
17130
+ this.itemData = selectedData;
17131
+ var focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
17132
+ if (focusedItem) {
17133
+ removeClass([focusedItem], dropDownBaseClasses.focus);
17134
+ }
17135
+ if (selectLi) {
17136
+ addClass([li], dropDownBaseClasses.selected);
17137
+ }
17138
+ li.setAttribute('aria-selected', 'true');
17139
+ this.activeIndex = this.getIndexByValue(value);
17140
+ };
17141
+ Mention.prototype.detachChanges = function (value) {
17142
+ var items;
17143
+ if (typeof value === 'string' ||
17144
+ typeof value === 'boolean' ||
17145
+ typeof value === 'number') {
17146
+ items = Object.defineProperties({}, {
17147
+ value: {
17148
+ value: value,
17149
+ enumerable: true
17150
+ },
17151
+ text: {
17152
+ value: value,
17153
+ enumerable: true
17154
+ }
17155
+ });
17156
+ }
17157
+ else {
17158
+ items = value;
17159
+ }
17160
+ return items;
17161
+ };
17162
+ Mention.prototype.setValue = function (e) {
17163
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17164
+ if (!this.isReact) {
17165
+ if (!isNullOrUndefined(this.displayTemplate)) {
17166
+ this.setDisplayTemplate();
17167
+ }
17168
+ this.updateMentionValue(e);
17169
+ return true;
17170
+ }
17171
+ else {
17172
+ if (!isNullOrUndefined(this.displayTemplate)) {
17173
+ this.setDisplayTemplate(e);
17174
+ }
17175
+ else {
17176
+ this.updateMentionValue(e);
17177
+ }
17178
+ return true;
17179
+ }
17180
+ };
17181
+ Mention.prototype.updateMentionValue = function (e) {
17182
+ var dataItem = this.getItemData();
17183
+ var textSuffix;
17184
+ var value;
17185
+ var endPos;
17186
+ var range;
17187
+ var globalRange;
17188
+ var selection = this.inputElement.ownerDocument.getSelection();
17189
+ var startPos = this.getTriggerCharPosition();
17190
+ textSuffix = typeof this.suffixText === 'string' ? this.suffixText : '';
17191
+ if (dataItem.text !== null) {
17192
+ value = this.mentionVal(dataItem.text);
17193
+ }
17194
+ if (!this.isContentEditable(this.inputElement)) {
17195
+ var myField = this.inputElement;
17196
+ var currentTriggerSnippet = this.getTextRange().substring(startPos + this.mentionChar.length, this.getTextRange().length);
17197
+ value += textSuffix;
17198
+ endPos = startPos + this.mentionChar.length;
17199
+ endPos += currentTriggerSnippet.length;
17200
+ myField.value = myField.value.substring(0, startPos) + value + myField.value.substring(endPos, myField.value.length);
17201
+ myField.selectionStart = startPos + value.length;
17202
+ myField.selectionEnd = startPos + value.length;
17203
+ if (this.isPopupOpen) {
17204
+ this.hidePopup();
17205
+ }
17206
+ this.onChangeEvent(e);
17207
+ }
17208
+ else {
17209
+ endPos = this.getTriggerCharPosition() + this.mentionChar.length;
17210
+ if (this.range && (this.range.startContainer.textContent.trim() !== this.mentionChar)) {
17211
+ endPos = this.range.endOffset;
17212
+ }
17213
+ globalRange = this.range;
17214
+ range = document.createRange();
17215
+ range.setStart(globalRange.startContainer, startPos);
17216
+ range.setEnd(globalRange.startContainer, endPos);
17217
+ range.deleteContents();
17218
+ var element = this.createElement('div');
17219
+ element.innerHTML = value;
17220
+ var frag = document.createDocumentFragment();
17221
+ var node = void 0;
17222
+ var lastNode = void 0;
17223
+ // eslint-disable-next-line no-cond-assign
17224
+ while (node = element.firstChild) {
17225
+ lastNode = frag.appendChild(node);
17226
+ }
17227
+ range.insertNode(frag);
17228
+ if (lastNode) {
17229
+ range = range.cloneRange();
17230
+ range.setStartAfter(lastNode);
17231
+ range.collapse(true);
17232
+ selection.removeAllRanges();
17233
+ selection.addRange(range);
17234
+ }
17235
+ if (this.isPopupOpen) {
17236
+ this.hidePopup();
17237
+ }
17238
+ this.onChangeEvent(e);
17239
+ }
17240
+ };
17241
+ Mention.prototype.mentionVal = function (value) {
17242
+ var showChar = this.showMentionChar ? this.mentionChar : '';
17243
+ if (!isNullOrUndefined(this.displayTemplate) && !isNullOrUndefined(this.displayTempElement)) {
17244
+ value = this.displayTempElement.innerHTML;
17245
+ }
17246
+ if (this.isContentEditable(this.inputElement)) {
17247
+ return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
17248
+ }
17249
+ else {
17250
+ return showChar + value;
17251
+ }
17252
+ };
17253
+ Mention.prototype.setDisplayTemplate = function (e) {
17254
+ var _this = this;
17255
+ var compiledString;
17256
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17257
+ if (this.isReact) {
17258
+ this.clearTemplate(['displayTemplate']);
17259
+ if (this.displayTempElement) {
17260
+ detach(this.displayTempElement);
17261
+ this.displayTempElement = null;
17262
+ }
17263
+ }
17264
+ if (!this.displayTempElement) {
17265
+ this.displayTempElement = this.createElement('div');
17266
+ }
17267
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17268
+ if (!this.isReact) {
17269
+ this.displayTempElement.innerHTML = '';
17270
+ }
17271
+ compiledString = compile(this.displayTemplate);
17272
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17273
+ var displayCompTemp = compiledString(this.itemData, this, 'displayTemplate', this.displayTemplateId, this.isStringTemplate, null, this.displayTempElement);
17274
+ if (displayCompTemp && displayCompTemp.length > 0) {
17275
+ for (var i = 0; i < displayCompTemp.length; i++) {
17276
+ this.displayTempElement.appendChild(displayCompTemp[i]);
17277
+ }
17278
+ }
17279
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17280
+ if (!this.isReact) {
17281
+ this.renderTemplates();
17282
+ }
17283
+ else {
17284
+ this.renderTemplates(function () {
17285
+ _this.updateMentionValue(e);
17286
+ });
17287
+ }
17288
+ };
17289
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17290
+ Mention.prototype.renderTemplates = function (callBack) {
17291
+ this.renderReactTemplates(callBack);
17292
+ };
17293
+ Mention.prototype.setSpinnerTemplate = function () {
17294
+ var _this = this;
17295
+ var compiledString;
17296
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17297
+ if (this.isReact) {
17298
+ this.clearTemplate(['spinnerTemplate']);
17299
+ if (this.spinnerTemplateElement) {
17300
+ detach(this.spinnerTemplateElement);
17301
+ this.spinnerTemplateElement = null;
17302
+ }
17303
+ }
17304
+ if (!this.spinnerTemplateElement) {
17305
+ this.spinnerTemplateElement = this.createElement('div');
17306
+ }
17307
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17308
+ if (!this.isReact) {
17309
+ this.spinnerTemplateElement.innerHTML = '';
17310
+ }
17311
+ compiledString = compile(this.spinnerTemplate);
17312
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17313
+ var spinnerCompTemp = compiledString(null, this, 'spinnerTemplate', this.spinnerTemplateId, this.isStringTemplate, null, this.spinnerTemplateElement);
17314
+ if (spinnerCompTemp && spinnerCompTemp.length > 0) {
17315
+ for (var i = 0; i < spinnerCompTemp.length; i++) {
17316
+ this.spinnerTemplateElement.appendChild(spinnerCompTemp[i]);
17317
+ }
17318
+ }
17319
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17320
+ if (!this.isReact) {
17321
+ this.renderTemplates();
17322
+ this.popupObj.element.appendChild(this.spinnerTemplateElement);
17323
+ }
17324
+ else {
17325
+ this.renderTemplates(function () {
17326
+ _this.popupObj.element.appendChild(_this.spinnerTemplateElement);
17327
+ });
17328
+ }
17329
+ };
17330
+ Mention.prototype.onChangeEvent = function (eve) {
17331
+ this.isSelected = false;
17332
+ var items = this.detachMentionChanges(this.itemData);
17333
+ var preItems;
17334
+ if (typeof this.previousItemData === 'string' ||
17335
+ typeof this.previousItemData === 'boolean' ||
17336
+ typeof this.previousItemData === 'number') {
17337
+ preItems = Object.defineProperties({}, {
17338
+ value: {
17339
+ value: this.previousItemData,
17340
+ enumerable: true
17341
+ },
17342
+ text: {
17343
+ value: this.previousItemData,
17344
+ enumerable: true
17345
+ }
17346
+ });
17347
+ }
17348
+ else {
17349
+ preItems = this.previousItemData;
17350
+ }
17351
+ var eventArgs = {
17352
+ e: eve,
17353
+ item: this.item,
17354
+ itemData: items,
17355
+ previousItem: this.previousSelectedLI,
17356
+ previousItemData: preItems,
17357
+ isInteracted: eve ? true : false,
17358
+ value: this.item.innerHTML,
17359
+ element: this.inputElement
17360
+ };
17361
+ this.trigger('change', eventArgs);
17362
+ };
17363
+ Mention.prototype.detachMentionChanges = function (value) {
17364
+ var items;
17365
+ if (typeof value === 'string' ||
17366
+ typeof value === 'boolean' ||
17367
+ typeof value === 'number') {
17368
+ items = Object.defineProperties({}, {
17369
+ value: {
17370
+ value: value,
17371
+ enumerable: true
17372
+ },
17373
+ text: {
17374
+ value: value,
17375
+ enumerable: true
17376
+ }
17377
+ });
17378
+ }
17379
+ else {
17380
+ items = value;
17381
+ }
17382
+ return items;
17383
+ };
17384
+ Mention.prototype.getItemData = function () {
17385
+ var fields = this.fields;
17386
+ var dataItem = null;
17387
+ dataItem = this.itemData;
17388
+ var dataValue;
17389
+ var dataText;
17390
+ if (!isNullOrUndefined(dataItem)) {
17391
+ dataValue = getValue(fields.value, dataItem);
17392
+ dataText = getValue(fields.text, dataItem);
17393
+ }
17394
+ var value = (!isNullOrUndefined(dataItem) &&
17395
+ !isUndefined(dataValue) ? dataValue : dataItem);
17396
+ var text = (!isNullOrUndefined(dataItem) &&
17397
+ !isUndefined(dataValue) ? dataText : dataItem);
17398
+ return { value: value, text: text };
17399
+ };
17400
+ Mention.prototype.removeSelection = function () {
17401
+ if (this.list) {
17402
+ var selectedItems = this.list.querySelectorAll('.' + dropDownBaseClasses.selected);
17403
+ if (selectedItems.length) {
17404
+ removeClass(selectedItems, dropDownBaseClasses.selected);
17405
+ selectedItems[0].removeAttribute('aria-selected');
17406
+ }
17407
+ }
17408
+ };
17409
+ Mention.prototype.onMouseOver = function (e) {
17410
+ var currentLi = closest(e.target, '.' + dropDownBaseClasses.li);
17411
+ this.setHover(currentLi);
17412
+ };
17413
+ Mention.prototype.setHover = function (li) {
17414
+ if (this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.hover)) {
17415
+ this.removeHover();
17416
+ addClass([li], dropDownBaseClasses.hover);
17417
+ }
17418
+ };
17419
+ Mention.prototype.removeHover = function () {
17420
+ if (this.list) {
17421
+ var hoveredItem = this.list.querySelectorAll('.' + dropDownBaseClasses.hover);
17422
+ if (hoveredItem && hoveredItem.length) {
17423
+ removeClass(hoveredItem, dropDownBaseClasses.hover);
17424
+ }
17425
+ }
17426
+ };
17427
+ Mention.prototype.isValidLI = function (li) {
17428
+ return (li && li.hasAttribute('role') && li.getAttribute('role') === 'option');
17429
+ };
17430
+ Mention.prototype.onMouseLeave = function () {
17431
+ this.removeHover();
17432
+ };
17433
+ /**
17434
+ * Search the entered text and show it in the suggestion list if available.
17435
+ *
17436
+ * @returns {void}
17437
+ */
17438
+ Mention.prototype.search = function (text, positionX, positionY) {
17439
+ if (this.isContentEditable(this.inputElement)) {
17440
+ this.range = this.getCurrentRange();
17441
+ }
17442
+ var currentRange = this.getTextRange();
17443
+ var lastWordRange = this.getLastLetter(currentRange);
17444
+ if ((this.ignoreCase && (text === lastWordRange || text === lastWordRange.toLowerCase()))
17445
+ || !this.ignoreCase && text === lastWordRange) {
17446
+ this.resetList(this.dataSource, this.fields);
17447
+ }
17448
+ else {
17449
+ if (this.isPopupOpen) {
17450
+ this.hidePopup();
17451
+ }
17452
+ return;
17453
+ }
17454
+ if (isNullOrUndefined(this.list)) {
17455
+ this.renderList();
17456
+ this.renderPopup();
17457
+ }
17458
+ else {
17459
+ this.showPopup();
17460
+ }
17461
+ this.popupObj.element.style.left = formatUnit(positionX);
17462
+ this.popupObj.element.style.top = formatUnit(positionY);
17463
+ };
17464
+ /**
17465
+ * Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
17466
+ *
17467
+ * @method destroy
17468
+ * @returns {void}
17469
+ */
17470
+ Mention.prototype.destroy = function () {
17471
+ this.hidePopup();
17472
+ this.unWireEvent();
17473
+ if (this.list) {
17474
+ this.unWireListEvents();
17475
+ }
17476
+ if (this.inputElement && !this.inputElement.classList.contains('e-' + this.getModuleName())) {
17477
+ return;
17478
+ }
17479
+ _super.prototype.destroy.call(this);
17480
+ };
17481
+ Mention.prototype.getLocaleName = function () {
17482
+ return 'mention';
17483
+ };
17484
+ Mention.prototype.getNgDirective = function () {
17485
+ return 'EJS-MENTION';
17486
+ };
17487
+ /**
17488
+ * Return the module name of this component.
17489
+ *
17490
+ * @private
17491
+ * @returns {string} Return the module name of this component.
17492
+ */
17493
+ Mention.prototype.getModuleName = function () {
17494
+ return 'mention';
17495
+ };
17496
+ __decorate$7([
17497
+ Property(null)
17498
+ ], Mention.prototype, "cssClass", void 0);
17499
+ __decorate$7([
17500
+ Property('@')
17501
+ ], Mention.prototype, "mentionChar", void 0);
17502
+ __decorate$7([
17503
+ Property(false)
17504
+ ], Mention.prototype, "showMentionChar", void 0);
17505
+ __decorate$7([
17506
+ Property(false)
17507
+ ], Mention.prototype, "allowSpaces", void 0);
17508
+ __decorate$7([
17509
+ Property(null)
17510
+ ], Mention.prototype, "suffixText", void 0);
17511
+ __decorate$7([
17512
+ Property(25)
17513
+ ], Mention.prototype, "suggestionCount", void 0);
17514
+ __decorate$7([
17515
+ Property(0)
17516
+ ], Mention.prototype, "minLength", void 0);
17517
+ __decorate$7([
17518
+ Property('None')
17519
+ ], Mention.prototype, "sortOrder", void 0);
17520
+ __decorate$7([
17521
+ Property(true)
17522
+ ], Mention.prototype, "ignoreCase", void 0);
17523
+ __decorate$7([
17524
+ Property(false)
17525
+ ], Mention.prototype, "highlight", void 0);
17526
+ __decorate$7([
17527
+ Property()
17528
+ ], Mention.prototype, "locale", void 0);
17529
+ __decorate$7([
17530
+ Property('auto')
17531
+ ], Mention.prototype, "popupWidth", void 0);
17532
+ __decorate$7([
17533
+ Property('300px')
17534
+ ], Mention.prototype, "popupHeight", void 0);
17535
+ __decorate$7([
17536
+ Property(null)
17537
+ ], Mention.prototype, "displayTemplate", void 0);
17538
+ __decorate$7([
17539
+ Property(null)
17540
+ ], Mention.prototype, "itemTemplate", void 0);
17541
+ __decorate$7([
17542
+ Property('No records found')
17543
+ ], Mention.prototype, "noRecordsTemplate", void 0);
17544
+ __decorate$7([
17545
+ Property(null)
17546
+ ], Mention.prototype, "spinnerTemplate", void 0);
17547
+ __decorate$7([
17548
+ Property()
17549
+ ], Mention.prototype, "target", void 0);
17550
+ __decorate$7([
17551
+ Property([])
17552
+ ], Mention.prototype, "dataSource", void 0);
17553
+ __decorate$7([
17554
+ Property(null)
17555
+ ], Mention.prototype, "query", void 0);
17556
+ __decorate$7([
17557
+ Property('Contains')
17558
+ ], Mention.prototype, "filterType", void 0);
17559
+ __decorate$7([
17560
+ Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
17561
+ ], Mention.prototype, "fields", void 0);
17562
+ __decorate$7([
17563
+ Event()
17564
+ ], Mention.prototype, "actionBegin", void 0);
17565
+ __decorate$7([
17566
+ Event()
17567
+ ], Mention.prototype, "actionComplete", void 0);
17568
+ __decorate$7([
17569
+ Event()
17570
+ ], Mention.prototype, "actionFailure", void 0);
17571
+ __decorate$7([
17572
+ Event()
17573
+ ], Mention.prototype, "change", void 0);
17574
+ __decorate$7([
17575
+ Event()
17576
+ ], Mention.prototype, "beforeOpen", void 0);
17577
+ __decorate$7([
17578
+ Event()
17579
+ ], Mention.prototype, "opened", void 0);
17580
+ __decorate$7([
17581
+ Event()
17582
+ ], Mention.prototype, "closed", void 0);
17583
+ __decorate$7([
17584
+ Event()
17585
+ ], Mention.prototype, "select", void 0);
17586
+ __decorate$7([
17587
+ Event()
17588
+ ], Mention.prototype, "filtering", void 0);
17589
+ __decorate$7([
17590
+ Event()
17591
+ ], Mention.prototype, "created", void 0);
17592
+ __decorate$7([
17593
+ Event()
17594
+ ], Mention.prototype, "destroyed", void 0);
17595
+ Mention = __decorate$7([
17596
+ NotifyPropertyChanges
17597
+ ], Mention);
17598
+ return Mention;
17599
+ }(DropDownBase));
17600
+
15808
17601
  /**
15809
17602
  * export all modules from current location
15810
17603
  */
@@ -15813,5 +17606,5 @@ var listBoxClasses = {
15813
17606
  * export all modules from current location
15814
17607
  */
15815
17608
 
15816
- export { incrementalSearch, Search, escapeCharRegExp, resetIncrementalSearchValues, highlightSearch, revertHighlightSearch, FieldSettings, dropDownBaseClasses, DropDownBase, dropDownListClasses, DropDownList, Fields, TreeSettings, DropDownTree, ComboBox, AutoComplete, MultiSelect, CheckBoxSelection, createFloatLabel, updateFloatLabelState, removeFloating, setPlaceHolder, floatLabelFocus, floatLabelBlur, encodePlaceholder, SelectionSettings, ToolbarSettings, ListBox };
17609
+ export { incrementalSearch, Search, escapeCharRegExp, resetIncrementalSearchValues, highlightSearch, revertHighlightSearch, FieldSettings, dropDownBaseClasses, DropDownBase, dropDownListClasses, DropDownList, Fields, TreeSettings, DropDownTree, ComboBox, AutoComplete, MultiSelect, CheckBoxSelection, createFloatLabel, updateFloatLabelState, removeFloating, setPlaceHolder, floatLabelFocus, floatLabelBlur, encodePlaceholder, SelectionSettings, ToolbarSettings, ListBox, Mention };
15817
17610
  //# sourceMappingURL=ej2-dropdowns.es5.js.map