@syncfusion/ej2-dropdowns 20.2.39 → 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 +123 -2
  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 +2243 -445
  8. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  9. package/dist/es6/ej2-dropdowns.es5.js +2285 -458
  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 +195 -89
  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 +51 -15
  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 +22 -0
  38. package/src/list-box/list-box.js +86 -31
  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 +296 -189
  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
  let queryString = '';
13
10
  let prevString = '';
14
11
  let 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
  const listItems = items;
86
83
  ignoreCase = ignoreCase !== undefined && ignoreCase !== null ? ignoreCase : true;
87
84
  const itemData = { item: null, index: null };
@@ -91,7 +88,20 @@ function Search(inputVal, items, searchType, ignoreCase) {
91
88
  queryStr = escapeCharRegExp(queryStr);
92
89
  for (let i = 0, itemsData = listItems; i < itemsData.length; i++) {
93
90
  const item = itemsData[i];
94
- const text = (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
91
+ let text;
92
+ let filterValue;
93
+ if (items && dataSource) {
94
+ let checkField = item;
95
+ let fieldValue = fields.text.split('.');
96
+ dataSource.filter(function (data) {
97
+ Array.prototype.slice.call(fieldValue).forEach(function (value) {
98
+ if (type === 'object' && checkField.textContent.toString().indexOf(data[value]) !== -1 && checkField.getAttribute('data-value') === data[fields.value] || type === 'string' && checkField.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;
@@ -214,6 +224,8 @@ const dropDownBaseClasses = {
214
224
  grouping: 'e-dd-group'
215
225
  };
216
226
  const ITEMTEMPLATE_PROPERTY = 'ItemTemplate';
227
+ const DISPLAYTEMPLATE_PROPERTY = 'DisplayTemplate';
228
+ const SPINNERTEMPLATE_PROPERTY = 'SpinnerTemplate';
217
229
  const VALUETEMPLATE_PROPERTY = 'ValueTemplate';
218
230
  const GROUPTEMPLATE_PROPERTY = 'GroupTemplate';
219
231
  const HEADERTEMPLATE_PROPERTY = 'HeaderTemplate';
@@ -238,6 +250,7 @@ let DropDownBase = class DropDownBase extends Component {
238
250
  this.isAngular = false;
239
251
  this.isPreventChange = false;
240
252
  this.isDynamicDataChange = false;
253
+ this.addedNewItem = false;
241
254
  }
242
255
  getPropObject(prop, newProp, oldProp) {
243
256
  const newProperty = new Object();
@@ -406,7 +419,8 @@ let DropDownBase = class DropDownBase extends Component {
406
419
  this.l10n = componentLocale;
407
420
  }
408
421
  else {
409
- this.l10n = new L10n(this.getModuleName() === 'listbox' ? 'listbox' : 'dropdowns', l10nLocale, this.locale);
422
+ this.l10n = new L10n(this.getModuleName() === 'listbox' ? 'listbox' :
423
+ this.getModuleName() === 'mention' ? 'mention' : 'dropdowns', l10nLocale, this.locale);
410
424
  }
411
425
  const content = actionFailure ?
412
426
  this.l10n.getConstant('actionFailureTemplate') : this.l10n.getConstant('noRecordsTemplate');
@@ -415,9 +429,12 @@ let DropDownBase = class DropDownBase extends Component {
415
429
  liElem.textContent = content;
416
430
  ele.appendChild(liElem);
417
431
  liElem.classList.add('e-list-nrt');
432
+ liElem.setAttribute('role', 'option');
418
433
  }
419
434
  else {
420
- ele.innerHTML = content;
435
+ if (!isNullOrUndefined(ele)) {
436
+ ele.innerHTML = content;
437
+ }
421
438
  }
422
439
  }
423
440
  }
@@ -448,14 +465,16 @@ let DropDownBase = class DropDownBase extends Component {
448
465
  * @returns {void}
449
466
  */
450
467
  setEnableRtl() {
451
- if (this.list) {
452
- this.enableRtlElements.push(this.list);
453
- }
454
- if (this.enableRtl) {
455
- addClass(this.enableRtlElements, dropDownBaseClasses.rtl);
456
- }
457
- else {
458
- removeClass(this.enableRtlElements, dropDownBaseClasses.rtl);
468
+ if (!isNullOrUndefined(this.enableRtlElements)) {
469
+ if (this.list) {
470
+ this.enableRtlElements.push(this.list);
471
+ }
472
+ if (this.enableRtl) {
473
+ addClass(this.enableRtlElements, dropDownBaseClasses.rtl);
474
+ }
475
+ else {
476
+ removeClass(this.enableRtlElements, dropDownBaseClasses.rtl);
477
+ }
459
478
  }
460
479
  }
461
480
  /**
@@ -463,7 +482,7 @@ let DropDownBase = class DropDownBase extends Component {
463
482
  *
464
483
  * @returns {void}
465
484
  */
466
- initialize() {
485
+ initialize(e) {
467
486
  this.bindEvent = true;
468
487
  this.actionFailureTemplateId = `${this.element.id}${ACTIONFAILURETEMPLATE_PROPERTY}`;
469
488
  if (this.element.tagName === 'UL') {
@@ -482,7 +501,7 @@ let DropDownBase = class DropDownBase extends Component {
482
501
  }
483
502
  }
484
503
  else {
485
- this.setListData(this.dataSource, this.fields, this.query);
504
+ this.setListData(this.dataSource, this.fields, this.query, e);
486
505
  }
487
506
  }
488
507
  /**
@@ -493,14 +512,6 @@ let DropDownBase = class DropDownBase extends Component {
493
512
  getPersistData() {
494
513
  return this.addOnPersist([]);
495
514
  }
496
- /**
497
- * Sets the enabled state to DropDownBase.
498
- *
499
- * @returns {void}
500
- */
501
- setEnabled() {
502
- this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
503
- }
504
515
  /**
505
516
  * Sets the enabled state to DropDownBase.
506
517
  *
@@ -508,7 +519,7 @@ let DropDownBase = class DropDownBase extends Component {
508
519
  * @returns {void}
509
520
  */
510
521
  updateDataAttribute(value) {
511
- const invalidAttr = ['class', 'style', 'id', 'type'];
522
+ const invalidAttr = ['class', 'style', 'id', 'type', 'aria-expanded', 'aria-autocomplete', 'aria-readonly'];
512
523
  const attr = {};
513
524
  for (let a = 0; a < this.element.attributes.length; a++) {
514
525
  if (invalidAttr.indexOf(this.element.attributes[a].name) === -1 &&
@@ -575,6 +586,8 @@ let DropDownBase = class DropDownBase extends Component {
575
586
  this.isRequested = false;
576
587
  this.isDataFetched = false;
577
588
  this.itemTemplateId = `${this.element.id}${ITEMTEMPLATE_PROPERTY}`;
589
+ this.displayTemplateId = `${this.element.id}${DISPLAYTEMPLATE_PROPERTY}`;
590
+ this.spinnerTemplateId = `${this.element.id}${SPINNERTEMPLATE_PROPERTY}`;
578
591
  this.valueTemplateId = `${this.element.id}${VALUETEMPLATE_PROPERTY}`;
579
592
  this.groupTemplateId = `${this.element.id}${GROUPTEMPLATE_PROPERTY}`;
580
593
  this.headerTemplateId = `${this.element.id}${HEADERTEMPLATE_PROPERTY}`;
@@ -589,7 +602,7 @@ let DropDownBase = class DropDownBase extends Component {
589
602
  * @param {Query} query - Accepts the external Query that execute along with data processing.
590
603
  * @returns {void}
591
604
  */
592
- setListData(dataSource, fields, query) {
605
+ setListData(dataSource, fields, query, event) {
593
606
  fields = fields ? fields : this.fields;
594
607
  let ulElement;
595
608
  this.isActive = true;
@@ -613,10 +626,10 @@ let DropDownBase = class DropDownBase extends Component {
613
626
  this.isDataFetched = true;
614
627
  }
615
628
  ulElement = this.renderItems(listItems, fields);
629
+ this.onActionComplete(ulElement, listItems, e);
616
630
  if (this.groupTemplate) {
617
631
  this.renderGroupTemplate(ulElement);
618
632
  }
619
- this.onActionComplete(ulElement, listItems, e);
620
633
  this.isRequested = false;
621
634
  this.bindChildItems(listItems, ulElement, fields, e);
622
635
  }
@@ -635,7 +648,7 @@ let DropDownBase = class DropDownBase extends Component {
635
648
  this.trigger('actionComplete', localDataArgs, (localDataArgs) => {
636
649
  if (!localDataArgs.cancel) {
637
650
  ulElement = this.renderItems(localDataArgs.result, fields);
638
- this.onActionComplete(ulElement, localDataArgs.result);
651
+ this.onActionComplete(ulElement, localDataArgs.result, event);
639
652
  if (this.groupTemplate) {
640
653
  this.renderGroupTemplate(ulElement);
641
654
  }
@@ -717,7 +730,9 @@ let DropDownBase = class DropDownBase extends Component {
717
730
  this.liCollections = [];
718
731
  this.trigger('actionFailure', e);
719
732
  this.l10nUpdate(true);
720
- addClass([this.list], dropDownBaseClasses.noData);
733
+ if (!isNullOrUndefined(this.list)) {
734
+ addClass([this.list], dropDownBaseClasses.noData);
735
+ }
721
736
  }
722
737
  /* eslint-disable @typescript-eslint/no-unused-vars */
723
738
  onActionComplete(ulElement, list, e) {
@@ -844,18 +859,22 @@ let DropDownBase = class DropDownBase extends Component {
844
859
  return extend({}, options, fields, true);
845
860
  }
846
861
  setFloatingHeader(e) {
847
- if (isNullOrUndefined(this.fixedHeaderElement)) {
848
- this.fixedHeaderElement = this.createElement('div', { className: dropDownBaseClasses.fixedHead });
849
- if (!this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
850
- this.fixedHeaderElement.style.display = 'none';
862
+ if (!isNullOrUndefined(this.list) && !this.list.classList.contains(dropDownBaseClasses.noData)) {
863
+ if (isNullOrUndefined(this.fixedHeaderElement)) {
864
+ this.fixedHeaderElement = this.createElement('div', { className: dropDownBaseClasses.fixedHead });
865
+ if (!isNullOrUndefined(this.list) && !this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
866
+ this.fixedHeaderElement.style.display = 'none';
867
+ }
868
+ if (!isNullOrUndefined(this.fixedHeaderElement) && !isNullOrUndefined(this.list)) {
869
+ prepend([this.fixedHeaderElement], this.list);
870
+ }
871
+ this.setFixedHeader();
851
872
  }
852
- prepend([this.fixedHeaderElement], this.list);
853
- this.setFixedHeader();
854
- }
855
- if (!isNullOrUndefined(this.fixedHeaderElement) && this.fixedHeaderElement.style.zIndex === '0') {
856
- this.setFixedHeader();
873
+ if (!isNullOrUndefined(this.fixedHeaderElement) && this.fixedHeaderElement.style.zIndex === '0') {
874
+ this.setFixedHeader();
875
+ }
876
+ this.scrollStop(e);
857
877
  }
858
- this.scrollStop(e);
859
878
  }
860
879
  scrollStop(e) {
861
880
  let target = !isNullOrUndefined(e) ? e.target : this.list;
@@ -939,7 +958,9 @@ let DropDownBase = class DropDownBase extends Component {
939
958
  return item;
940
959
  }
941
960
  setFixedHeader() {
942
- this.list.parentElement.style.display = 'block';
961
+ if (!isNullOrUndefined(this.list)) {
962
+ this.list.parentElement.style.display = 'block';
963
+ }
943
964
  let borderWidth = 0;
944
965
  if (this.list && this.list.parentElement) {
945
966
  borderWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-width'), 10);
@@ -954,8 +975,10 @@ let DropDownBase = class DropDownBase extends Component {
954
975
  borderWidth = (borderTopWidth + borderBottomWidth + borderLeftWidth + borderRightWidth);
955
976
  }
956
977
  }
957
- const liWidth = this.getValidLi().offsetWidth - borderWidth;
958
- this.fixedHeaderElement.style.width = liWidth.toString() + 'px';
978
+ if (!isNullOrUndefined(this.liCollections)) {
979
+ const liWidth = this.getValidLi().offsetWidth - borderWidth;
980
+ this.fixedHeaderElement.style.width = liWidth.toString() + 'px';
981
+ }
959
982
  setStyleAttribute(this.fixedHeaderElement, { zIndex: 10 });
960
983
  const firstLi = this.ulElement.querySelector('.' + dropDownBaseClasses.group + ':not(.e-hide-listitem)');
961
984
  this.fixedHeaderElement.innerHTML = firstLi.innerHTML;
@@ -1024,7 +1047,7 @@ let DropDownBase = class DropDownBase extends Component {
1024
1047
  * @param {Query} query - Accepts the external Query that execute along with data processing.
1025
1048
  * @returns {void}
1026
1049
  */
1027
- resetList(dataSource, fields, query) {
1050
+ resetList(dataSource, fields, query, e) {
1028
1051
  if (this.list) {
1029
1052
  if ((this.element.tagName === 'SELECT' && this.element.options.length > 0)
1030
1053
  || (this.element.tagName === 'UL' && this.element.childNodes.length > 0)) {
@@ -1034,8 +1057,9 @@ let DropDownBase = class DropDownBase extends Component {
1034
1057
  dataSource = this.selectData;
1035
1058
  }
1036
1059
  }
1037
- dataSource = this.getModuleName() === 'combobox' && this.selectData && dataSource instanceof Array && dataSource.length < this.selectData.length ? this.selectData : dataSource;
1038
- this.setListData(dataSource, fields, query);
1060
+ dataSource = this.getModuleName() === 'combobox' && this.selectData && dataSource instanceof Array && dataSource.length < this.selectData.length && this.addedNewItem ? this.selectData : dataSource;
1061
+ this.addedNewItem = false;
1062
+ this.setListData(dataSource, fields, query, e);
1039
1063
  }
1040
1064
  }
1041
1065
  updateSelectElementData(isFiltering) {
@@ -1097,9 +1121,6 @@ let DropDownBase = class DropDownBase extends Component {
1097
1121
  case 'enableRtl':
1098
1122
  this.setEnableRtl();
1099
1123
  break;
1100
- case 'enabled':
1101
- this.setEnabled();
1102
- break;
1103
1124
  case 'groupTemplate':
1104
1125
  this.renderGroupTemplate(this.list);
1105
1126
  if (this.ulElement && this.fixedHeaderElement) {
@@ -1126,7 +1147,7 @@ let DropDownBase = class DropDownBase extends Component {
1126
1147
  * @private
1127
1148
  * @returns {void}
1128
1149
  */
1129
- render(isEmptyData) {
1150
+ render(e, isEmptyData) {
1130
1151
  this.list = this.createElement('div', { className: dropDownBaseClasses.content, attrs: { 'tabindex': '0' } });
1131
1152
  this.list.classList.add(dropDownBaseClasses.root);
1132
1153
  this.setFields();
@@ -1148,9 +1169,8 @@ let DropDownBase = class DropDownBase extends Component {
1148
1169
  wrapperElement.appendChild(this.list);
1149
1170
  }
1150
1171
  this.setEnableRtl();
1151
- this.setEnabled();
1152
1172
  if (!isEmptyData) {
1153
- this.initialize();
1173
+ this.initialize(e);
1154
1174
  }
1155
1175
  }
1156
1176
  /**
@@ -1176,7 +1196,7 @@ let DropDownBase = class DropDownBase extends Component {
1176
1196
  * Adds a new item to the popup list. By default, new item appends to the list as the last item,
1177
1197
  * but you can insert based on the index parameter.
1178
1198
  *
1179
- * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
1199
+ * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
1180
1200
  * @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
1181
1201
  * @returns {void}
1182
1202
  * @deprecated
@@ -1240,11 +1260,17 @@ let DropDownBase = class DropDownBase extends Component {
1240
1260
  this.trigger('beforeItemRender', { element: li, item: item });
1241
1261
  }
1242
1262
  if (itemsCount === 0 && isNullOrUndefined(this.list.querySelector('ul'))) {
1243
- this.list.innerHTML = '';
1244
- this.list.classList.remove(dropDownBaseClasses.noData);
1245
- this.list.appendChild(this.ulElement);
1263
+ if (!isNullOrUndefined(this.list)) {
1264
+ this.list.innerHTML = '';
1265
+ this.list.classList.remove(dropDownBaseClasses.noData);
1266
+ if (!isNullOrUndefined(this.ulElement)) {
1267
+ this.list.appendChild(this.ulElement);
1268
+ }
1269
+ }
1246
1270
  this.liCollections = liCollections;
1247
- append(liCollections, this.ulElement);
1271
+ if (!isNullOrUndefined(liCollections) && !isNullOrUndefined(this.ulElement)) {
1272
+ append(liCollections, this.ulElement);
1273
+ }
1248
1274
  this.updateAddItemList(this.list, itemsCount);
1249
1275
  }
1250
1276
  else {
@@ -1291,6 +1317,7 @@ let DropDownBase = class DropDownBase extends Component {
1291
1317
  if (selectedItemValue || itemIndex === 0) {
1292
1318
  this.updateSelection();
1293
1319
  }
1320
+ this.addedNewItem = true;
1294
1321
  }
1295
1322
  validationAttribute(target, hidden) {
1296
1323
  const name = target.getAttribute('name') ? target.getAttribute('name') : target.getAttribute('id');
@@ -1362,15 +1389,17 @@ let DropDownBase = class DropDownBase extends Component {
1362
1389
  }
1363
1390
  detach(this.list);
1364
1391
  }
1392
+ this.liCollections = null;
1393
+ this.ulElement = null;
1394
+ this.list = null;
1395
+ this.enableRtlElements = null;
1396
+ this.rippleFun = null;
1365
1397
  super.destroy();
1366
1398
  }
1367
1399
  };
1368
1400
  __decorate([
1369
1401
  Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
1370
1402
  ], DropDownBase.prototype, "fields", void 0);
1371
- __decorate([
1372
- Property(false)
1373
- ], DropDownBase.prototype, "enablePersistence", void 0);
1374
1403
  __decorate([
1375
1404
  Property(null)
1376
1405
  ], DropDownBase.prototype, "itemTemplate", void 0);
@@ -1386,9 +1415,6 @@ __decorate([
1386
1415
  __decorate([
1387
1416
  Property('None')
1388
1417
  ], DropDownBase.prototype, "sortOrder", void 0);
1389
- __decorate([
1390
- Property(true)
1391
- ], DropDownBase.prototype, "enabled", void 0);
1392
1418
  __decorate([
1393
1419
  Property([])
1394
1420
  ], DropDownBase.prototype, "dataSource", void 0);
@@ -1567,8 +1593,8 @@ let DropDownList = class DropDownList extends DropDownBase {
1567
1593
  this.popupObj.setProperties({ 'zIndex': this.zIndex });
1568
1594
  }
1569
1595
  }
1570
- renderList(isEmptyData) {
1571
- super.render(isEmptyData);
1596
+ renderList(e, isEmptyData) {
1597
+ super.render(e, isEmptyData);
1572
1598
  this.unWireListEvents();
1573
1599
  this.wireListEvents();
1574
1600
  }
@@ -1600,6 +1626,7 @@ let DropDownList = class DropDownList extends DropDownBase {
1600
1626
  }
1601
1627
  }
1602
1628
  clearAll(e, properties) {
1629
+ this.previousItemData = (!isNullOrUndefined(this.itemData)) ? this.itemData : null;
1603
1630
  if (isNullOrUndefined(properties) || (!isNullOrUndefined(properties) &&
1604
1631
  (isNullOrUndefined(properties.dataSource) ||
1605
1632
  (!(properties.dataSource instanceof DataManager) && properties.dataSource.length === 0)))) {
@@ -1625,14 +1652,18 @@ let DropDownList = class DropDownList extends DropDownBase {
1625
1652
  }
1626
1653
  else {
1627
1654
  if (this.allowFiltering && this.getModuleName() !== 'autocomplete'
1628
- && !isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list)) {
1655
+ && !isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list) && this.actionCompleteData.list.length > 0) {
1629
1656
  this.onActionComplete(this.actionCompleteData.ulElement.cloneNode(true), this.actionCompleteData.list);
1630
1657
  }
1631
1658
  this.resetFocusElement();
1632
1659
  }
1633
1660
  }
1634
- this.hiddenElement.innerHTML = '';
1635
- this.inputElement.value = '';
1661
+ if (!isNullOrUndefined(this.hiddenElement)) {
1662
+ this.hiddenElement.innerHTML = '';
1663
+ }
1664
+ if (!isNullOrUndefined(this.inputElement)) {
1665
+ this.inputElement.value = '';
1666
+ }
1636
1667
  this.value = null;
1637
1668
  this.itemData = null;
1638
1669
  this.text = null;
@@ -1654,42 +1685,42 @@ let DropDownList = class DropDownList extends DropDownBase {
1654
1685
  if (Object.keys(this.htmlAttributes).length) {
1655
1686
  for (const htmlAttr of Object.keys(this.htmlAttributes)) {
1656
1687
  if (htmlAttr === 'class') {
1657
- const updatedClassValue = (this.htmlAttributes[htmlAttr].replace(/\s+/g, ' ')).trim();
1688
+ const updatedClassValue = (this.htmlAttributes[`${htmlAttr}`].replace(/\s+/g, ' ')).trim();
1658
1689
  if (updatedClassValue !== '') {
1659
1690
  addClass([this.inputWrapper.container], updatedClassValue.split(' '));
1660
1691
  }
1661
1692
  }
1662
- else if (htmlAttr === 'disabled' && this.htmlAttributes[htmlAttr] === 'disabled') {
1693
+ else if (htmlAttr === 'disabled' && this.htmlAttributes[`${htmlAttr}`] === 'disabled') {
1663
1694
  this.enabled = false;
1664
1695
  this.setEnable();
1665
1696
  }
1666
- else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes[htmlAttr])) {
1697
+ else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes[`${htmlAttr}`])) {
1667
1698
  this.readonly = true;
1668
1699
  this.dataBind();
1669
1700
  }
1670
1701
  else if (htmlAttr === 'style') {
1671
- this.inputWrapper.container.setAttribute('style', this.htmlAttributes[htmlAttr]);
1702
+ this.inputWrapper.container.setAttribute('style', this.htmlAttributes[`${htmlAttr}`]);
1672
1703
  }
1673
1704
  else {
1674
- const defaultAttr = ['title', 'id', 'placeholder', 'aria-placeholder',
1675
- 'role', 'autocorrect', 'autocomplete', 'autocapitalize', 'spellcheck', 'minlength', 'maxlength'];
1705
+ const defaultAttr = ['title', 'id', 'placeholder',
1706
+ 'role', 'autocomplete', 'autocapitalize', 'spellcheck', 'minlength', 'maxlength'];
1676
1707
  const validateAttr = ['name', 'required'];
1677
1708
  if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
1678
1709
  defaultAttr.push('tabindex');
1679
1710
  }
1680
1711
  if (validateAttr.indexOf(htmlAttr) > -1 || htmlAttr.indexOf('data') === 0) {
1681
- this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
1712
+ this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
1682
1713
  }
1683
1714
  else if (defaultAttr.indexOf(htmlAttr) > -1) {
1684
1715
  if (htmlAttr === 'placeholder') {
1685
- Input.setPlaceholder(this.htmlAttributes[htmlAttr], this.inputElement);
1716
+ Input.setPlaceholder(this.htmlAttributes[`${htmlAttr}`], this.inputElement);
1686
1717
  }
1687
1718
  else {
1688
- this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
1719
+ this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
1689
1720
  }
1690
1721
  }
1691
1722
  else {
1692
- this.inputWrapper.container.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
1723
+ this.inputWrapper.container.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
1693
1724
  }
1694
1725
  }
1695
1726
  }
@@ -1701,11 +1732,8 @@ let DropDownList = class DropDownList extends DropDownBase {
1701
1732
  getAriaAttributes() {
1702
1733
  return {
1703
1734
  'aria-disabled': 'false',
1704
- 'aria-owns': this.element.id + '_options',
1705
1735
  'role': 'combobox',
1706
- 'aria-haspopup': 'true',
1707
1736
  'aria-expanded': 'false',
1708
- 'aria-activedescendant': 'null',
1709
1737
  'aria-live': 'polite',
1710
1738
  'aria-labelledby': this.hiddenElement.id
1711
1739
  };
@@ -1748,7 +1776,7 @@ let DropDownList = class DropDownList extends DropDownBase {
1748
1776
  }
1749
1777
  }
1750
1778
  targetElement() {
1751
- return this.inputWrapper.container;
1779
+ return !isNullOrUndefined(this.inputWrapper) ? this.inputWrapper.container : null;
1752
1780
  }
1753
1781
  getNgDirective() {
1754
1782
  return 'EJS-DROPDOWNLIST';
@@ -1906,7 +1934,7 @@ let DropDownList = class DropDownList extends DropDownBase {
1906
1934
  }
1907
1935
  }
1908
1936
  unBindCommonEvent() {
1909
- if (this.targetElement()) {
1937
+ if (!isNullOrUndefined(this.inputWrapper) && this.targetElement()) {
1910
1938
  EventHandler.remove(this.targetElement(), 'blur', this.onBlurHandler);
1911
1939
  }
1912
1940
  const formElement = this.inputElement && closest(this.inputElement, 'form');
@@ -1936,9 +1964,11 @@ let DropDownList = class DropDownList extends DropDownBase {
1936
1964
  * @returns {void}
1937
1965
  */
1938
1966
  wireListEvents() {
1939
- EventHandler.add(this.list, 'click', this.onMouseClick, this);
1940
- EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
1941
- EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
1967
+ if (!isNullOrUndefined(this.list)) {
1968
+ EventHandler.add(this.list, 'click', this.onMouseClick, this);
1969
+ EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
1970
+ EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
1971
+ }
1942
1972
  }
1943
1973
  onSearch(e) {
1944
1974
  if (e.charCode !== 32 && e.charCode !== 13) {
@@ -2051,7 +2081,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2051
2081
  const isTabAction = e.action === 'tab' || e.action === 'close';
2052
2082
  if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape') {
2053
2083
  this.searchKeyEvent = e;
2054
- this.renderList();
2084
+ this.renderList(e);
2055
2085
  }
2056
2086
  if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
2057
2087
  isNavigation && this.liCollections.length === 0) || this.isRequested) {
@@ -2090,7 +2120,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2090
2120
  }
2091
2121
  break;
2092
2122
  case 'open':
2093
- this.showPopup();
2123
+ this.showPopup(e);
2094
2124
  break;
2095
2125
  case 'hide':
2096
2126
  this.preventAltUp = this.isPopupOpen;
@@ -2216,9 +2246,11 @@ let DropDownList = class DropDownList extends DropDownBase {
2216
2246
  this.setSelection(previousItem, event);
2217
2247
  }
2218
2248
  unWireEvent() {
2219
- EventHandler.remove(this.inputWrapper.container, 'mousedown', this.dropDownClick);
2220
- EventHandler.remove(this.inputWrapper.container, 'keypress', this.onSearch);
2221
- EventHandler.remove(this.inputWrapper.container, 'focus', this.focusIn);
2249
+ if (!isNullOrUndefined(this.inputWrapper)) {
2250
+ EventHandler.remove(this.inputWrapper.container, 'mousedown', this.dropDownClick);
2251
+ EventHandler.remove(this.inputWrapper.container, 'keypress', this.onSearch);
2252
+ EventHandler.remove(this.inputWrapper.container, 'focus', this.focusIn);
2253
+ }
2222
2254
  this.unBindCommonEvent();
2223
2255
  }
2224
2256
  /**
@@ -2227,9 +2259,11 @@ let DropDownList = class DropDownList extends DropDownBase {
2227
2259
  * @returns {void}
2228
2260
  */
2229
2261
  unWireListEvents() {
2230
- EventHandler.remove(this.list, 'click', this.onMouseClick);
2231
- EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
2232
- EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
2262
+ if (this.list) {
2263
+ EventHandler.remove(this.list, 'click', this.onMouseClick);
2264
+ EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
2265
+ EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
2266
+ }
2233
2267
  }
2234
2268
  checkSelector(id) {
2235
2269
  return '[id="' + id.replace(/(:|\.|\[|\]|,|=|@|\\|\/|#)/g, '\\$1') + '"]';
@@ -2237,7 +2271,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2237
2271
  onDocumentClick(e) {
2238
2272
  const target = e.target;
2239
2273
  if (!(!isNullOrUndefined(this.popupObj) && closest(target, this.checkSelector(this.popupObj.element.id))) &&
2240
- !this.inputWrapper.container.contains(e.target)) {
2274
+ !isNullOrUndefined(this.inputWrapper) && !this.inputWrapper.container.contains(e.target)) {
2241
2275
  if (this.inputWrapper.container.classList.contains(dropDownListClasses.inputFocus) || this.isPopupOpen) {
2242
2276
  this.isDocumentClick = true;
2243
2277
  const isActive = this.isRequested;
@@ -2282,7 +2316,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2282
2316
  }
2283
2317
  if (!this.readonly) {
2284
2318
  if (this.isPopupOpen) {
2285
- this.hidePopup();
2319
+ this.hidePopup(e);
2286
2320
  if (this.isFilterLayout()) {
2287
2321
  this.focusDropDown(e);
2288
2322
  }
@@ -2292,7 +2326,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2292
2326
  this.floatLabelChange();
2293
2327
  this.queryString = this.inputElement.value.trim() === '' ? null : this.inputElement.value;
2294
2328
  this.isDropDownClick = true;
2295
- this.showPopup();
2329
+ this.showPopup(e);
2296
2330
  }
2297
2331
  // eslint-disable-next-line @typescript-eslint/no-this-alias
2298
2332
  const proxy = this;
@@ -2355,6 +2389,9 @@ let DropDownList = class DropDownList extends DropDownBase {
2355
2389
  }
2356
2390
  selectEventCallback(li, e, preventSelect, selectedData, value) {
2357
2391
  this.previousItemData = (!isNullOrUndefined(this.itemData)) ? this.itemData : null;
2392
+ if (this.itemData != selectedData) {
2393
+ this.previousValue = (!isNullOrUndefined(this.itemData)) ? typeof this.itemData == "object" ? this.checkFieldValue(this.itemData, this.fields.value.split('.')) : this.itemData : null;
2394
+ }
2358
2395
  this.item = li;
2359
2396
  this.itemData = selectedData;
2360
2397
  const focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
@@ -2425,10 +2462,6 @@ let DropDownList = class DropDownList extends DropDownBase {
2425
2462
  if (this.setValue(e)) {
2426
2463
  return;
2427
2464
  }
2428
- attributes(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
2429
- if (this.isFilterLayout() && this.filterInput) {
2430
- attributes(this.filterInput, { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
2431
- }
2432
2465
  if ((!this.isPopupOpen && !isNullOrUndefined(li)) || (this.isPopupOpen && !isNullOrUndefined(e) &&
2433
2466
  (e.type !== 'keydown' || e.type === 'keydown' && e.action === 'enter'))) {
2434
2467
  this.isSelectCustom = false;
@@ -2438,9 +2471,17 @@ let DropDownList = class DropDownList extends DropDownBase {
2438
2471
  this.setScrollPosition(e);
2439
2472
  }
2440
2473
  if (Browser.info.name !== 'mozilla') {
2441
- attributes(this.inputElement, { 'aria-label': this.inputElement.value });
2442
- attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id });
2443
- this.targetElement().removeAttribute('aria-live');
2474
+ if (this.targetElement()) {
2475
+ attributes(this.targetElement(), { 'aria-label': this.inputElement.value });
2476
+ attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
2477
+ this.targetElement().removeAttribute('aria-live');
2478
+ }
2479
+ }
2480
+ if (this.isPopupOpen && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
2481
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
2482
+ }
2483
+ else if (this.isPopupOpen && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
2484
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
2444
2485
  }
2445
2486
  }
2446
2487
  dropdownCompiler(dropdownTemplate) {
@@ -2605,9 +2646,11 @@ let DropDownList = class DropDownList extends DropDownBase {
2605
2646
  selectedElement.setAttribute('value', this.value.toString());
2606
2647
  }
2607
2648
  else {
2608
- this.hiddenElement.innerHTML = '<option selected>' + this.text + '</option>';
2609
- const selectedElement = this.hiddenElement.querySelector('option');
2610
- selectedElement.setAttribute('value', this.value.toString());
2649
+ if (!isNullOrUndefined(this.hiddenElement)) {
2650
+ this.hiddenElement.innerHTML = '<option selected>' + this.text + '</option>';
2651
+ const selectedElement = this.hiddenElement.querySelector('option');
2652
+ selectedElement.setAttribute('value', this.value.toString());
2653
+ }
2611
2654
  }
2612
2655
  }
2613
2656
  else {
@@ -2634,6 +2677,9 @@ let DropDownList = class DropDownList extends DropDownBase {
2634
2677
  this.preventAutoFill = false;
2635
2678
  }
2636
2679
  this.preventAltUp = false;
2680
+ if (this.getModuleName() === 'autocomplete' && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
2681
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
2682
+ }
2637
2683
  e.preventDefault();
2638
2684
  break;
2639
2685
  case 46: //delete
@@ -2755,9 +2801,9 @@ let DropDownList = class DropDownList extends DropDownBase {
2755
2801
  /**
2756
2802
  * To filter the data from given data source by using query
2757
2803
  *
2758
- * @param {Object[] | DataManager } dataSource - Set the data source to filter.
2759
- * @param {Query} query - Specify the query to filter the data.
2760
- * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
2804
+ * @param {Object[] | DataManager } dataSource - Set the data source to filter.
2805
+ * @param {Query} query - Specify the query to filter the data.
2806
+ * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
2761
2807
  * @returns {void}
2762
2808
  * @deprecated
2763
2809
  */
@@ -2823,11 +2869,8 @@ let DropDownList = class DropDownList extends DropDownBase {
2823
2869
  prepend([parentElement], popupElement);
2824
2870
  attributes(this.filterInput, {
2825
2871
  'aria-disabled': 'false',
2826
- 'aria-owns': this.element.id + '_options',
2827
- 'role': 'listbox',
2828
- 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null,
2872
+ 'role': 'combobox',
2829
2873
  'autocomplete': 'off',
2830
- 'autocorrect': 'off',
2831
2874
  'autocapitalize': 'off',
2832
2875
  'spellcheck': 'false'
2833
2876
  });
@@ -2911,7 +2954,8 @@ let DropDownList = class DropDownList extends DropDownBase {
2911
2954
  this.initRemoteRender = false;
2912
2955
  if (this.value && this.dataSource instanceof DataManager) {
2913
2956
  const checkField = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
2914
- const checkVal = list.some((x) => x[checkField] === this.value);
2957
+ const fieldValue = this.fields.value.split('.');
2958
+ const checkVal = list.some((x) => isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ? this.checkFieldValue(x, fieldValue) === this.value : x[checkField] === this.value);
2915
2959
  if (!checkVal) {
2916
2960
  this.dataSource.executeQuery(this.getQuery(this.query).where(new Predicate(checkField, 'equal', this.value)))
2917
2961
  .then((e) => {
@@ -2933,6 +2977,9 @@ let DropDownList = class DropDownList extends DropDownBase {
2933
2977
  }
2934
2978
  this.initial = false;
2935
2979
  }
2980
+ else if (this.getModuleName() === 'autocomplete' && this.value) {
2981
+ this.setInputValue();
2982
+ }
2936
2983
  if (this.getModuleName() !== 'autocomplete' && this.isFiltering() && !this.isTyped) {
2937
2984
  if (!this.actionCompleteData.isUpdated || ((!this.isCustomFilter
2938
2985
  && !this.isFilterFocus) || (isNullOrUndefined(this.itemData) && this.allowFiltering)
@@ -2954,10 +3001,17 @@ let DropDownList = class DropDownList extends DropDownBase {
2954
3001
  }
2955
3002
  }
2956
3003
  if (this.beforePopupOpen) {
2957
- this.renderPopup();
3004
+ this.renderPopup(e);
2958
3005
  }
2959
3006
  }
2960
3007
  }
3008
+ checkFieldValue(list, fieldValue) {
3009
+ let checkField = list;
3010
+ fieldValue.forEach((value) => {
3011
+ checkField = checkField[value];
3012
+ });
3013
+ return checkField;
3014
+ }
2961
3015
  updateActionCompleteDataValues(ulElement, list) {
2962
3016
  this.actionCompleteData = { ulElement: ulElement.cloneNode(true), list: list, isUpdated: true };
2963
3017
  if (this.actionData.list !== this.actionCompleteData.list && this.actionCompleteData.ulElement && this.actionCompleteData.list) {
@@ -3024,7 +3078,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3024
3078
  removeClass(highlightedItem, dropDownListClasses.focus);
3025
3079
  }
3026
3080
  }
3027
- renderPopup() {
3081
+ renderPopup(e) {
3028
3082
  if (this.popupObj && document.body.contains(this.popupObj.element)) {
3029
3083
  this.refreshPopup();
3030
3084
  return;
@@ -3080,9 +3134,11 @@ let DropDownList = class DropDownList extends DropDownBase {
3080
3134
  (this.isDropDownClick && this.getModuleName() === 'combobox')))) {
3081
3135
  offsetValue = this.getOffsetValue(popupEle);
3082
3136
  const firstItem = this.isEmptyList() ? this.list : this.liCollections[0];
3083
- left = -(parseInt(getComputedStyle(firstItem).textIndent, 10) -
3084
- parseInt(getComputedStyle(this.inputElement).paddingLeft, 10) +
3085
- parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth, 10));
3137
+ if (!isNullOrUndefined(this.inputElement)) {
3138
+ left = -(parseInt(getComputedStyle(firstItem).textIndent, 10) -
3139
+ parseInt(getComputedStyle(this.inputElement).paddingLeft, 10) +
3140
+ parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth, 10));
3141
+ }
3086
3142
  }
3087
3143
  this.getFocusElement();
3088
3144
  this.createPopup(popupEle, offsetValue, left);
@@ -3112,25 +3168,28 @@ let DropDownList = class DropDownList extends DropDownBase {
3112
3168
  for (const element of scrollParentElements) {
3113
3169
  EventHandler.add(element, 'scroll', this.scrollHandler, this);
3114
3170
  }
3115
- if (Browser.isDevice && this.isFilterLayout()) {
3116
- EventHandler.add(this.list, 'scroll', this.listScroll, this);
3117
- }
3118
3171
  if (!isNullOrUndefined(this.list)) {
3119
3172
  this.unWireListEvents();
3120
3173
  this.wireListEvents();
3121
3174
  }
3122
- attributes(this.targetElement(), { 'aria-expanded': 'true' });
3175
+ this.selectedElementID = this.selectedLI ? this.selectedLI.id : null;
3176
+ attributes(this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': this.inputElement.id + '_options' });
3177
+ this.inputElement.setAttribute('aria-expanded', 'true');
3123
3178
  const inputParent = this.isFiltering() ? this.filterInput.parentElement : this.inputWrapper.container;
3124
3179
  addClass([inputParent], [dropDownListClasses.inputFocus]);
3125
3180
  const animModel = { name: 'FadeIn', duration: 100 };
3126
3181
  this.beforePopupOpen = true;
3127
3182
  const popupInstance = this.popupObj;
3128
- const eventArgs = { popup: popupInstance, cancel: false, animation: animModel };
3183
+ const eventArgs = { popup: popupInstance, event: e, cancel: false, animation: animModel };
3129
3184
  this.trigger('open', eventArgs, (eventArgs) => {
3130
3185
  if (!eventArgs.cancel) {
3131
- addClass([this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
3186
+ if (!isNullOrUndefined(this.inputWrapper)) {
3187
+ addClass([this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
3188
+ }
3132
3189
  this.renderReactTemplates();
3133
- this.popupObj.show(new Animation(eventArgs.animation), (this.zIndex === 1000) ? this.element : null);
3190
+ if (!isNullOrUndefined(this.popupObj)) {
3191
+ this.popupObj.show(new Animation(eventArgs.animation), (this.zIndex === 1000) ? this.element : null);
3192
+ }
3134
3193
  }
3135
3194
  else {
3136
3195
  this.beforePopupOpen = false;
@@ -3187,6 +3246,12 @@ let DropDownList = class DropDownList extends DropDownBase {
3187
3246
  const actionList = this.actionCompleteData && this.actionCompleteData.ulElement &&
3188
3247
  this.actionCompleteData.ulElement.querySelector('li');
3189
3248
  const ulElement = this.list.querySelector('ul li');
3249
+ if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
3250
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
3251
+ }
3252
+ else if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
3253
+ attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
3254
+ }
3190
3255
  if (this.isFiltering() && this.itemTemplate && (this.element.tagName === this.getNgDirective()) &&
3191
3256
  (actionList && ulElement && actionList.textContent !== ulElement.textContent) &&
3192
3257
  this.element.tagName !== 'EJS-COMBOBOX') {
@@ -3342,9 +3407,6 @@ let DropDownList = class DropDownList extends DropDownBase {
3342
3407
  this.filterInput.value = this.typedString = '';
3343
3408
  this.searchLists(null);
3344
3409
  }
3345
- listScroll() {
3346
- this.filterInput.blur();
3347
- }
3348
3410
  setEleWidth(width) {
3349
3411
  if (!isNullOrUndefined(width)) {
3350
3412
  if (typeof width === 'number') {
@@ -3371,7 +3433,6 @@ let DropDownList = class DropDownList extends DropDownBase {
3371
3433
  }
3372
3434
  if (Browser.isDevice && this.isFilterLayout()) {
3373
3435
  removeClass([document.body, this.popupObj.element], dropDownListClasses.popupFullScreen);
3374
- EventHandler.remove(this.list, 'scroll', this.listScroll);
3375
3436
  }
3376
3437
  if (this.isFilterLayout()) {
3377
3438
  if (!Browser.isDevice) {
@@ -3384,14 +3445,19 @@ let DropDownList = class DropDownList extends DropDownBase {
3384
3445
  EventHandler.remove(this.backIconElement, 'click', this.clickOnBackIcon);
3385
3446
  EventHandler.remove(this.clearIconElement, 'click', this.clearText);
3386
3447
  }
3387
- EventHandler.remove(this.filterInput, 'input', this.onInput);
3388
- EventHandler.remove(this.filterInput, 'keyup', this.onFilterUp);
3389
- EventHandler.remove(this.filterInput, 'keydown', this.onFilterDown);
3390
- EventHandler.remove(this.filterInput, 'blur', this.onBlurHandler);
3391
- EventHandler.remove(this.filterInput, 'paste', this.pasteHandler);
3448
+ if (!isNullOrUndefined(this.filterInput)) {
3449
+ EventHandler.remove(this.filterInput, 'input', this.onInput);
3450
+ EventHandler.remove(this.filterInput, 'keyup', this.onFilterUp);
3451
+ EventHandler.remove(this.filterInput, 'keydown', this.onFilterDown);
3452
+ EventHandler.remove(this.filterInput, 'blur', this.onBlurHandler);
3453
+ EventHandler.remove(this.filterInput, 'paste', this.pasteHandler);
3454
+ }
3392
3455
  this.filterInput = null;
3393
3456
  }
3394
3457
  attributes(this.targetElement(), { 'aria-expanded': 'false' });
3458
+ this.inputElement.setAttribute('aria-expanded', 'false');
3459
+ this.targetElement().removeAttribute('aria-owns');
3460
+ this.targetElement().removeAttribute('aria-activedescendant');
3395
3461
  this.inputWrapper.container.classList.remove(dropDownListClasses.iconAnimation);
3396
3462
  if (this.isFiltering()) {
3397
3463
  this.actionCompleteData.isUpdated = false;
@@ -3444,14 +3510,15 @@ let DropDownList = class DropDownList extends DropDownBase {
3444
3510
  if (this.element.tagName === 'INPUT') {
3445
3511
  this.inputElement = this.element;
3446
3512
  if (isNullOrUndefined(this.inputElement.getAttribute('role'))) {
3447
- this.inputElement.setAttribute('role', 'textbox');
3513
+ this.inputElement.setAttribute('role', 'combobox');
3448
3514
  }
3449
3515
  if (isNullOrUndefined(this.inputElement.getAttribute('type'))) {
3450
3516
  this.inputElement.setAttribute('type', 'text');
3451
3517
  }
3518
+ this.inputElement.setAttribute('aria-expanded', 'false');
3452
3519
  }
3453
3520
  else {
3454
- this.inputElement = this.createElement('input', { attrs: { role: 'textbox', type: 'text' } });
3521
+ this.inputElement = this.createElement('input', { attrs: { role: 'combobox', type: 'text' } });
3455
3522
  if (this.element.tagName !== this.getNgDirective()) {
3456
3523
  this.element.style.display = 'none';
3457
3524
  }
@@ -3462,6 +3529,9 @@ let DropDownList = class DropDownList extends DropDownBase {
3462
3529
  if (!isNullOrUndefined(this.cssClass) && this.cssClass !== '') {
3463
3530
  updatedCssClassValues = (this.cssClass.replace(/\s+/g, ' ')).trim();
3464
3531
  }
3532
+ if (!isNullOrUndefined(closest(this.element, "fieldset")) && closest(this.element, "fieldset").disabled) {
3533
+ this.enabled = false;
3534
+ }
3465
3535
  this.inputWrapper = Input.createInput({
3466
3536
  element: this.inputElement,
3467
3537
  buttons: this.isPopupButton() ? [dropDownListClasses.icon] : null,
@@ -3490,6 +3560,10 @@ let DropDownList = class DropDownList extends DropDownBase {
3490
3560
  this.setFields();
3491
3561
  this.inputWrapper.container.style.width = formatUnit(this.width);
3492
3562
  this.inputWrapper.container.classList.add('e-ddl');
3563
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
3564
+ if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && this.inputWrapper.container.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never') {
3565
+ this.inputWrapper.container.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
3566
+ }
3493
3567
  this.wireEvent();
3494
3568
  this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
3495
3569
  this.element.removeAttribute('tabindex');
@@ -3500,6 +3574,9 @@ let DropDownList = class DropDownList extends DropDownBase {
3500
3574
  attributes(this.targetElement(), this.getAriaAttributes());
3501
3575
  this.updateDataAttribute(this.htmlAttributes);
3502
3576
  this.setHTMLAttributes();
3577
+ if (this.targetElement() === this.inputElement) {
3578
+ this.inputElement.removeAttribute('aria-labelledby');
3579
+ }
3503
3580
  if (this.value !== null || this.activeIndex !== null || this.text !== null) {
3504
3581
  this.initValue();
3505
3582
  }
@@ -3509,6 +3586,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3509
3586
  this.text = isNullOrUndefined(this.value) ? null : selectElement.options[selectElement.selectedIndex].textContent;
3510
3587
  this.initValue();
3511
3588
  }
3589
+ this.setEnabled();
3512
3590
  this.preventTabIndex(this.element);
3513
3591
  if (!this.enabled) {
3514
3592
  this.targetElement().tabIndex = -1;
@@ -3530,12 +3608,22 @@ let DropDownList = class DropDownList extends DropDownBase {
3530
3608
  if (this.element.hasAttribute('data-val')) {
3531
3609
  this.element.setAttribute('data-val', 'false');
3532
3610
  }
3611
+ const floatLabelElement = this.inputWrapper.container.getElementsByClassName('e-float-text')[0];
3612
+ if (!isNullOrUndefined(this.element.id) && this.element.id !== '' && !isNullOrUndefined(floatLabelElement)) {
3613
+ floatLabelElement.id = 'label_' + this.element.id.replace(/ /g, '_');
3614
+ attributes(this.inputElement, { 'aria-labelledby': floatLabelElement.id });
3615
+ }
3533
3616
  this.renderComplete();
3534
3617
  }
3535
3618
  setFooterTemplate(popupEle) {
3536
3619
  let compiledString;
3537
3620
  if (this.footer) {
3538
- this.footer.innerHTML = '';
3621
+ if (this.isReact) {
3622
+ this.clearTemplate(['footerTemplate']);
3623
+ }
3624
+ else {
3625
+ this.footer.innerHTML = '';
3626
+ }
3539
3627
  }
3540
3628
  else {
3541
3629
  this.footer = this.createElement('div');
@@ -3583,6 +3671,14 @@ let DropDownList = class DropDownList extends DropDownBase {
3583
3671
  const contentEle = popupEle.querySelector('div.e-content');
3584
3672
  popupEle.insertBefore(this.header, contentEle);
3585
3673
  }
3674
+ /**
3675
+ * Sets the enabled state to DropDownBase.
3676
+ *
3677
+ * @returns {void}
3678
+ */
3679
+ setEnabled() {
3680
+ this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
3681
+ }
3586
3682
  setOldText(text) {
3587
3683
  this.text = text;
3588
3684
  }
@@ -3669,6 +3765,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3669
3765
  break;
3670
3766
  case 'width':
3671
3767
  this.setEleWidth(newProp.width);
3768
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
3672
3769
  break;
3673
3770
  case 'placeholder':
3674
3771
  Input.setPlaceholder(newProp.placeholder, this.inputElement);
@@ -3686,6 +3783,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3686
3783
  break;
3687
3784
  case 'cssClass':
3688
3785
  this.setCssClass(newProp.cssClass, oldProp.cssClass);
3786
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
3689
3787
  break;
3690
3788
  case 'enableRtl':
3691
3789
  this.setEnableRtl();
@@ -3726,6 +3824,9 @@ let DropDownList = class DropDownList extends DropDownBase {
3726
3824
  }
3727
3825
  });
3728
3826
  }
3827
+ else if (this.getModuleName() === 'autocomplete') {
3828
+ this.setInputValue(newProp, oldProp);
3829
+ }
3729
3830
  else {
3730
3831
  this.setOldText(oldProp.text);
3731
3832
  }
@@ -3767,6 +3868,9 @@ let DropDownList = class DropDownList extends DropDownBase {
3767
3868
  }
3768
3869
  });
3769
3870
  }
3871
+ else if (this.getModuleName() === 'autocomplete') {
3872
+ this.setInputValue(newProp, oldProp);
3873
+ }
3770
3874
  else {
3771
3875
  this.setOldValue(oldProp.value);
3772
3876
  }
@@ -3826,6 +3930,9 @@ let DropDownList = class DropDownList extends DropDownBase {
3826
3930
  case 'floatLabelType':
3827
3931
  Input.removeFloating(this.inputWrapper);
3828
3932
  Input.addFloating(this.inputElement, newProp.floatLabelType, this.placeholder, this.createElement);
3933
+ if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0] && this.floatLabelType !== 'Never') {
3934
+ this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0].classList.add('e-icon');
3935
+ }
3829
3936
  break;
3830
3937
  case 'showClearButton':
3831
3938
  Input.setClearButton(newProp.showClearButton, this.inputElement, this.inputWrapper, null, this.createElement);
@@ -3879,6 +3986,8 @@ let DropDownList = class DropDownList extends DropDownBase {
3879
3986
  removeClass([this.inputWrapper.container], ['e-readonly']);
3880
3987
  }
3881
3988
  }
3989
+ setInputValue(newProp, oldProp) {
3990
+ }
3882
3991
  setCssClass(newClass, oldClass) {
3883
3992
  if (!isNullOrUndefined(oldClass)) {
3884
3993
  oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
@@ -3905,7 +4014,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3905
4014
  *
3906
4015
  * @returns {void}
3907
4016
  */
3908
- showPopup() {
4017
+ showPopup(e) {
3909
4018
  if (!this.enabled) {
3910
4019
  return;
3911
4020
  }
@@ -3925,11 +4034,11 @@ let DropDownList = class DropDownList extends DropDownBase {
3925
4034
  }
3926
4035
  else if (isNullOrUndefined(this.list) || !isUndefined(this.list) && (this.list.classList.contains(dropDownBaseClasses.noData) ||
3927
4036
  this.list.querySelectorAll('.' + dropDownBaseClasses.li).length <= 0)) {
3928
- this.renderList();
4037
+ this.renderList(e);
3929
4038
  }
3930
- this.invokeRenderPopup();
4039
+ this.invokeRenderPopup(e);
3931
4040
  }
3932
- invokeRenderPopup() {
4041
+ invokeRenderPopup(e) {
3933
4042
  if (Browser.isDevice && this.isFilterLayout()) {
3934
4043
  // eslint-disable-next-line @typescript-eslint/no-this-alias
3935
4044
  const proxy = this;
@@ -3938,10 +4047,9 @@ let DropDownList = class DropDownList extends DropDownBase {
3938
4047
  };
3939
4048
  history.pushState({}, '');
3940
4049
  }
3941
- if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {
3942
- this.renderPopup();
4050
+ if (!isNullOrUndefined(this.list) && (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData))) {
4051
+ this.renderPopup(e);
3943
4052
  }
3944
- attributes(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
3945
4053
  }
3946
4054
  renderHightSearch() {
3947
4055
  // update high light search
@@ -3955,7 +4063,9 @@ let DropDownList = class DropDownList extends DropDownBase {
3955
4063
  hidePopup(e) {
3956
4064
  /* eslint-enable valid-jsdoc, jsdoc/require-param */
3957
4065
  if (this.isEscapeKey && this.getModuleName() === 'dropdownlist') {
3958
- Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
4066
+ if (!isNullOrUndefined(this.inputElement)) {
4067
+ Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
4068
+ }
3959
4069
  this.isEscapeKey = false;
3960
4070
  if (!isNullOrUndefined(this.index)) {
3961
4071
  const element = this.findListElement(this.ulElement, 'li', 'data-value', this.value);
@@ -4005,6 +4115,7 @@ let DropDownList = class DropDownList extends DropDownBase {
4005
4115
  }
4006
4116
  addClass([this.inputWrapper.container], [dropDownListClasses.inputFocus]);
4007
4117
  this.onFocus(e);
4118
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
4008
4119
  }
4009
4120
  /**
4010
4121
  * Moves the focus from the component if the component is already focused.
@@ -4022,6 +4133,7 @@ let DropDownList = class DropDownList extends DropDownBase {
4022
4133
  this.targetElement().blur();
4023
4134
  }
4024
4135
  removeClass([this.inputWrapper.container], [dropDownListClasses.inputFocus]);
4136
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
4025
4137
  }
4026
4138
  /**
4027
4139
  * Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
@@ -4045,10 +4157,9 @@ let DropDownList = class DropDownList extends DropDownBase {
4045
4157
  return;
4046
4158
  }
4047
4159
  if (this.inputElement) {
4048
- const attrArray = ['readonly', 'aria-disabled', 'aria-placeholder',
4049
- 'placeholder', 'aria-owns', 'aria-labelledby', 'aria-haspopup', 'aria-expanded',
4050
- 'aria-activedescendant', 'autocomplete', 'aria-readonly', 'autocorrect',
4051
- 'autocapitalize', 'spellcheck', 'aria-autocomplete', 'aria-live', 'aria-describedby', 'aria-label'];
4160
+ const attrArray = ['readonly', 'aria-disabled', 'placeholder', 'aria-labelledby',
4161
+ 'aria-expanded', 'autocomplete', 'aria-readonly', 'autocapitalize',
4162
+ 'spellcheck', 'aria-autocomplete', 'aria-live', 'aria-describedby', 'aria-label'];
4052
4163
  for (let i = 0; i < attrArray.length; i++) {
4053
4164
  this.inputElement.removeAttribute(attrArray[i]);
4054
4165
  }
@@ -4064,6 +4175,21 @@ let DropDownList = class DropDownList extends DropDownBase {
4064
4175
  this.inputWrapper.container.parentElement.insertBefore(this.element, this.inputWrapper.container);
4065
4176
  detach(this.inputWrapper.container);
4066
4177
  }
4178
+ this.hiddenElement = null;
4179
+ this.inputWrapper = null;
4180
+ this.keyboardModule = null;
4181
+ this.ulElement = null;
4182
+ this.list = null;
4183
+ this.popupObj = null;
4184
+ this.rippleFun = null;
4185
+ this.selectedLI = null;
4186
+ this.liCollections = null;
4187
+ this.item = null;
4188
+ this.inputWrapper = null;
4189
+ this.footer = null;
4190
+ this.header = null;
4191
+ this.previousSelectedLI = null;
4192
+ this.valueTempElement = null;
4067
4193
  super.destroy();
4068
4194
  }
4069
4195
  /* eslint-disable valid-jsdoc, jsdoc/require-returns-description */
@@ -4106,6 +4232,12 @@ __decorate$1([
4106
4232
  __decorate$1([
4107
4233
  Property('100%')
4108
4234
  ], DropDownList.prototype, "width", void 0);
4235
+ __decorate$1([
4236
+ Property(true)
4237
+ ], DropDownList.prototype, "enabled", void 0);
4238
+ __decorate$1([
4239
+ Property(false)
4240
+ ], DropDownList.prototype, "enablePersistence", void 0);
4109
4241
  __decorate$1([
4110
4242
  Property('300px')
4111
4243
  ], DropDownList.prototype, "popupHeight", void 0);
@@ -4267,6 +4399,9 @@ __decorate$2([
4267
4399
  __decorate$2([
4268
4400
  Property(null)
4269
4401
  ], Fields.prototype, "query", void 0);
4402
+ __decorate$2([
4403
+ Property('selectable')
4404
+ ], Fields.prototype, "selectable", void 0);
4270
4405
  __decorate$2([
4271
4406
  Property('selected')
4272
4407
  ], Fields.prototype, "selected", void 0);
@@ -4315,6 +4450,8 @@ let DropDownTree = class DropDownTree extends Component {
4315
4450
  this.selectedData = [];
4316
4451
  this.filterDelayTime = 300;
4317
4452
  this.isClicked = false;
4453
+ // Specifies if the checkAll method has been called
4454
+ this.isCheckAllCalled = false;
4318
4455
  }
4319
4456
  /**
4320
4457
  * Get the properties to be maintained in the persisted state.
@@ -4442,7 +4579,7 @@ let DropDownTree = class DropDownTree extends Component {
4442
4579
  this.updateDataAttribute();
4443
4580
  this.setHTMLAttributes();
4444
4581
  this.setAttributes();
4445
- this.popupDiv = this.createElement('div', { className: CONTENT, attrs: { 'tabindex': '0' } });
4582
+ this.popupDiv = this.createElement('div', { className: CONTENT });
4446
4583
  this.popupDiv.classList.add(DROPDOWN);
4447
4584
  this.tree = this.createElement('div', { id: this.element.id + '_tree' });
4448
4585
  this.popupDiv.appendChild(this.tree);
@@ -5062,7 +5199,12 @@ let DropDownTree = class DropDownTree extends Component {
5062
5199
  temp = this.getOverflowVal(index);
5063
5200
  data += temp;
5064
5201
  temp = this.overFlowWrapper.innerHTML;
5065
- this.overFlowWrapper.innerHTML = data;
5202
+ if (this.enableHtmlSanitizer) {
5203
+ this.overFlowWrapper.innerText = data;
5204
+ }
5205
+ else {
5206
+ this.overFlowWrapper.innerHTML = data;
5207
+ }
5066
5208
  wrapperleng = this.overFlowWrapper.offsetWidth;
5067
5209
  overAllContainer = this.inputWrapper.offsetWidth;
5068
5210
  if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
@@ -5232,7 +5374,7 @@ let DropDownTree = class DropDownTree extends Component {
5232
5374
  if (isValid && this.value !== null && (this.value && this.value.length !== 0)) {
5233
5375
  addClass([this.inputEle], CHIP_INPUT);
5234
5376
  }
5235
- else if (this.value === null || (this.value && this.value.length === 0)) {
5377
+ else if (this.value === null || (this.value && this.value.length === 0) || this.chipWrapper) {
5236
5378
  addClass([this.chipWrapper], HIDEICON);
5237
5379
  }
5238
5380
  }
@@ -5287,6 +5429,7 @@ let DropDownTree = class DropDownTree extends Component {
5287
5429
  frameSpan.classList.add(CHECK);
5288
5430
  ariaState = 'true';
5289
5431
  if (!this.isReverseUpdate) {
5432
+ this.isCheckAllCalled = true;
5290
5433
  this.treeObj.checkAll();
5291
5434
  if (!this.changeOnBlur) {
5292
5435
  this.triggerChangeEvent(e);
@@ -5587,10 +5730,12 @@ let DropDownTree = class DropDownTree extends Component {
5587
5730
  nodeSelected: this.onNodeSelected.bind(this),
5588
5731
  nodeChecked: this.onNodeChecked.bind(this),
5589
5732
  nodeChecking: this.beforeCheck.bind(this),
5733
+ nodeExpanded: this.onNodeExpanded.bind(this),
5590
5734
  actionFailure: this.onActionFailure.bind(this),
5591
5735
  nodeClicked: this.onNodeClicked.bind(this),
5592
5736
  dataBound: this.OnDataBound.bind(this),
5593
5737
  allowMultiSelection: this.allowMultiSelection,
5738
+ enableHtmlSanitizer: this.enableHtmlSanitizer,
5594
5739
  showCheckBox: this.showCheckBox,
5595
5740
  autoCheck: this.treeSettings.autoCheck,
5596
5741
  sortOrder: this.sortOrder,
@@ -5692,7 +5837,7 @@ let DropDownTree = class DropDownTree extends Component {
5692
5837
  const height = Math.round(this.header.getBoundingClientRect().height);
5693
5838
  popupHeight = formatUnit(parseInt(popupHeight, 10) - height + 'px');
5694
5839
  }
5695
- if (this.showCheckBox && this.showSelectAll) {
5840
+ if (this.showCheckBox && this.showSelectAll && (!this.popupDiv.classList.contains(NODATA))) {
5696
5841
  const height = Math.round(this.checkAllParent.getBoundingClientRect().height);
5697
5842
  popupHeight = formatUnit(parseInt(popupHeight, 10) - height + 'px');
5698
5843
  }
@@ -5774,14 +5919,14 @@ let DropDownTree = class DropDownTree extends Component {
5774
5919
  const isFooter = closest(target, '.' + FOOTER);
5775
5920
  const isScroller = target.classList.contains(DROPDOWN) ? true :
5776
5921
  (matches(target, '.e-ddt .e-popup') || matches(target, '.e-ddt .e-treeview'));
5777
- if ((this.isPopupOpen && (this.inputWrapper.contains(target) || isTree || isFilter || isScroller || isHeader || isFooter)) ||
5922
+ if ((this.isPopupOpen && (this.inputWrapper.contains(target) || isTree || isScroller || isHeader || isFooter)) ||
5778
5923
  ((this.allowMultiSelection || this.showCheckBox) && (this.isPopupOpen && target.classList.contains(CHIP_CLOSE) ||
5779
5924
  (this.isPopupOpen && (target.classList.contains(CHECKALLPARENT) || target.classList.contains(ALLTEXT)
5780
5925
  || target.classList.contains(CHECKBOXFRAME)))))) {
5781
5926
  this.isDocumentClick = false;
5782
5927
  e.preventDefault();
5783
5928
  }
5784
- else if (!this.inputWrapper.contains(target) && this.inputFocus) {
5929
+ else if (!this.inputWrapper.contains(target) && this.inputFocus && !isFilter) {
5785
5930
  this.focusOut(e);
5786
5931
  }
5787
5932
  }
@@ -5814,6 +5959,9 @@ let DropDownTree = class DropDownTree extends Component {
5814
5959
  }
5815
5960
  const eventArgs = { data: args.data };
5816
5961
  this.trigger('dataBound', eventArgs);
5962
+ if (this.filterObj === null) {
5963
+ this.isFilteredData = false;
5964
+ }
5817
5965
  if (this.isFilteredData) {
5818
5966
  this.treeObj.expandAll();
5819
5967
  }
@@ -5881,7 +6029,7 @@ let DropDownTree = class DropDownTree extends Component {
5881
6029
  dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
5882
6030
  child: this.cloneChildField(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
5883
6031
  iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes, query: fields.query,
5884
- selected: fields.selected, tableName: fields.tableName, tooltip: fields.tooltip
6032
+ selected: fields.selected, selectable: fields.selectable, tableName: fields.tableName, tooltip: fields.tooltip
5885
6033
  };
5886
6034
  return clonedField;
5887
6035
  }
@@ -5894,7 +6042,7 @@ let DropDownTree = class DropDownTree extends Component {
5894
6042
  dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
5895
6043
  child: (fields.child ? this.cloneChildField(fields.child) : null), hasChildren: fields.hasChildren,
5896
6044
  expanded: fields.expanded, iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes,
5897
- query: fields.query, selected: fields.selected, tableName: fields.tableName, tooltip: fields.tooltip
6045
+ query: fields.query, selected: fields.selected, selectable: fields.selectable, tableName: fields.tableName, tooltip: fields.tooltip
5898
6046
  };
5899
6047
  return clonedField;
5900
6048
  }
@@ -5904,7 +6052,7 @@ let DropDownTree = class DropDownTree extends Component {
5904
6052
  dataSource: fields.dataSource, id: fields.value, text: fields.text, parentID: fields.parentValue,
5905
6053
  child: this.getTreeChildren(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
5906
6054
  iconCss: fields.iconCss, imageUrl: fields.imageUrl, isChecked: fields.selected,
5907
- htmlAttributes: fields.htmlAttributes, query: fields.query, selected: fields.selected,
6055
+ htmlAttributes: fields.htmlAttributes, query: fields.query, selectable: fields.selectable, selected: fields.selected,
5908
6056
  tableName: fields.tableName, tooltip: fields.tooltip
5909
6057
  };
5910
6058
  return treeFields;
@@ -5942,7 +6090,8 @@ let DropDownTree = class DropDownTree extends Component {
5942
6090
  }
5943
6091
  return 2;
5944
6092
  }
5945
- this.fields.dataSource = isNullOrUndefined(this.fields.dataSource) ? [] : this.fields.dataSource;
6093
+ if (isNullOrUndefined(this.fields.dataSource))
6094
+ this.fields.dataSource = [];
5946
6095
  for (let i = 0, len = this.fields.dataSource.length; i < len; i++) {
5947
6096
  if ((typeof field.child === 'string') && !isNullOrUndefined(getValue(field.child, this.fields.dataSource[i]))) {
5948
6097
  return 2;
@@ -6081,13 +6230,14 @@ let DropDownTree = class DropDownTree extends Component {
6081
6230
  const nodes = this.treeObj.element.querySelectorAll('li');
6082
6231
  const checkedNodes = this.treeObj.element.querySelectorAll('li .e-checkbox-wrapper[aria-checked=true]');
6083
6232
  const wrap = closest(this.checkBoxElement, '.' + CHECKBOXWRAP);
6084
- if (wrap && args.action === 'uncheck') {
6233
+ if (wrap && args.action === 'uncheck' && (args.isInteracted || checkedNodes.length === 0)) {
6085
6234
  this.isReverseUpdate = true;
6086
6235
  this.changeState(wrap, 'uncheck');
6087
6236
  this.isReverseUpdate = false;
6088
6237
  }
6089
- else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length) {
6238
+ else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length && this.isCheckAllCalled) {
6090
6239
  this.isReverseUpdate = true;
6240
+ this.isCheckAllCalled = false;
6091
6241
  this.changeState(wrap, 'check');
6092
6242
  this.isReverseUpdate = false;
6093
6243
  }
@@ -6098,6 +6248,13 @@ let DropDownTree = class DropDownTree extends Component {
6098
6248
  this.oldValue = this.value ? this.value.slice() : this.value;
6099
6249
  }
6100
6250
  }
6251
+ onNodeExpanded(args) {
6252
+ if (this.hasTemplate && this.portals) {
6253
+ this.portals = [].concat(this.treeObj.portals);
6254
+ /* eslint-enable */
6255
+ this.renderReactTemplates();
6256
+ }
6257
+ }
6101
6258
  updateClearButton(state) {
6102
6259
  if (state) {
6103
6260
  if (!this.inputWrapper.contains(this.overAllClear)) {
@@ -6398,7 +6555,12 @@ let DropDownTree = class DropDownTree extends Component {
6398
6555
  });
6399
6556
  const chipContent = this.createElement('span', { className: CHIP_CONTENT });
6400
6557
  const chipClose = this.createElement('span', { className: CHIP_CLOSE + ' ' + ICONS });
6401
- chipContent.innerHTML = text;
6558
+ if (this.enableHtmlSanitizer) {
6559
+ chipContent.innerText = text;
6560
+ }
6561
+ else {
6562
+ chipContent.innerHTML = text;
6563
+ }
6402
6564
  chip.appendChild(chipContent);
6403
6565
  this.chipCollection.appendChild(chip);
6404
6566
  if (this.showClearButton) {
@@ -6594,6 +6756,7 @@ let DropDownTree = class DropDownTree extends Component {
6594
6756
  selectAllItems(state) {
6595
6757
  if (this.showCheckBox) {
6596
6758
  if (state) {
6759
+ this.isCheckAllCalled = true;
6597
6760
  this.treeObj.checkAll();
6598
6761
  }
6599
6762
  else {
@@ -6688,8 +6851,6 @@ let DropDownTree = class DropDownTree extends Component {
6688
6851
  }
6689
6852
  else {
6690
6853
  this.noRecord = this.createElement('div');
6691
- addClass([this.noRecord], NODATACONTAINER);
6692
- prepend([this.noRecord], this.popupDiv);
6693
6854
  }
6694
6855
  if (this.noRecordsTemplate !== 'No Records Found' || this.actionFailureTemplate !== 'The Request Failed') {
6695
6856
  const template = actionFailure ? this.actionFailureTemplate : this.noRecordsTemplate;
@@ -6701,6 +6862,8 @@ let DropDownTree = class DropDownTree extends Component {
6701
6862
  if (tempArr) {
6702
6863
  tempArr = Array.prototype.slice.call(tempArr);
6703
6864
  append(tempArr, this.noRecord);
6865
+ addClass([this.noRecord], NODATACONTAINER);
6866
+ prepend([this.noRecord], this.popupDiv);
6704
6867
  }
6705
6868
  }
6706
6869
  else {
@@ -6709,6 +6872,8 @@ let DropDownTree = class DropDownTree extends Component {
6709
6872
  this.l10n = new L10n(this.getLocaleName(), l10nLocale, this.locale);
6710
6873
  this.noRecord.innerHTML = actionFailure ?
6711
6874
  this.l10n.getConstant('actionFailureTemplate') : this.l10n.getConstant('noRecordsTemplate');
6875
+ addClass([this.noRecord], NODATACONTAINER);
6876
+ prepend([this.noRecord], this.popupDiv);
6712
6877
  }
6713
6878
  }
6714
6879
  updateRecordTemplate(action) {
@@ -7220,6 +7385,9 @@ __decorate$2([
7220
7385
  __decorate$2([
7221
7386
  Property(false)
7222
7387
  ], DropDownTree.prototype, "showCheckBox", void 0);
7388
+ __decorate$2([
7389
+ Property(false)
7390
+ ], DropDownTree.prototype, "enableHtmlSanitizer", void 0);
7223
7391
  __decorate$2([
7224
7392
  Property(true)
7225
7393
  ], DropDownTree.prototype, "showClearButton", void 0);
@@ -7457,15 +7625,12 @@ let ComboBox = class ComboBox extends DropDownList {
7457
7625
  }
7458
7626
  getAriaAttributes() {
7459
7627
  const ariaAttributes = {
7460
- 'aria-owns': this.element.id + '_options',
7461
7628
  'role': 'combobox',
7462
7629
  'aria-autocomplete': 'both',
7463
7630
  'aria-labelledby': this.hiddenElement.id,
7464
- 'aria-hasPopup': 'true',
7465
7631
  'aria-expanded': 'false',
7466
7632
  'aria-readonly': this.readonly.toString(),
7467
7633
  'autocomplete': 'off',
7468
- 'autocorrect': 'off',
7469
7634
  'autocapitalize': 'off',
7470
7635
  'spellcheck': 'false'
7471
7636
  };
@@ -7507,7 +7672,7 @@ let ComboBox = class ComboBox extends DropDownList {
7507
7672
  }
7508
7673
  getFocusElement() {
7509
7674
  const dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
7510
- const selected = this.list.querySelector('.' + dropDownListClasses.selected);
7675
+ const selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : this.list;
7511
7676
  const isSelected = dataItem.text === this.inputElement.value && !isNullOrUndefined(selected);
7512
7677
  if (isSelected) {
7513
7678
  return selected;
@@ -7515,8 +7680,10 @@ let ComboBox = class ComboBox extends DropDownList {
7515
7680
  if ((Browser.isDevice && !this.isDropDownClick || !Browser.isDevice) &&
7516
7681
  !isNullOrUndefined(this.liCollections) && this.liCollections.length > 0) {
7517
7682
  const inputValue = this.inputElement.value;
7518
- const activeItem = Search(inputValue, this.liCollections, this.filterType, true);
7519
- const activeElement = activeItem.item;
7683
+ const dataSource = this.sortedData;
7684
+ const type = this.typeOfData(dataSource).typeof;
7685
+ const activeItem = Search(inputValue, this.liCollections, this.filterType, true, dataSource, this.fields, type);
7686
+ var activeElement = activeItem.item;
7520
7687
  if (!isNullOrUndefined(activeElement)) {
7521
7688
  const count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
7522
7689
  const height = parseInt(getComputedStyle(this.liCollections[0], null).getPropertyValue('height'), 10);
@@ -7556,7 +7723,7 @@ let ComboBox = class ComboBox extends DropDownList {
7556
7723
  this.itemData = this.getDataByValue(this.value);
7557
7724
  const dataItem = this.getItemData();
7558
7725
  if (!(this.allowCustom && isNullOrUndefined(dataItem.value) && isNullOrUndefined(dataItem.text))) {
7559
- this.setProperties({ 'value': dataItem.value, 'text': dataItem.text }, !this.allowCustom);
7726
+ this.setProperties({ 'value': dataItem.value }, !this.allowCustom);
7560
7727
  }
7561
7728
  }
7562
7729
  /**
@@ -7665,9 +7832,11 @@ let ComboBox = class ComboBox extends DropDownList {
7665
7832
  }
7666
7833
  else if (this.inputElement.value === '') {
7667
7834
  this.activeIndex = null;
7668
- this.list.scrollTop = 0;
7669
- const focusItem = this.list.querySelector('.' + dropDownListClasses.li);
7670
- this.setHoverList(focusItem);
7835
+ if (!isNullOrUndefined(this.list)) {
7836
+ this.list.scrollTop = 0;
7837
+ const focusItem = this.list.querySelector('.' + dropDownListClasses.li);
7838
+ this.setHoverList(focusItem);
7839
+ }
7671
7840
  }
7672
7841
  else {
7673
7842
  this.activeIndex = null;
@@ -7678,7 +7847,7 @@ let ComboBox = class ComboBox extends DropDownList {
7678
7847
  }
7679
7848
  }
7680
7849
  incrementalSearch(e) {
7681
- this.showPopup();
7850
+ this.showPopup(e);
7682
7851
  if (!isNullOrUndefined(this.listData)) {
7683
7852
  this.inlineSearch(e);
7684
7853
  e.preventDefault();
@@ -7763,6 +7932,7 @@ let ComboBox = class ComboBox extends DropDownList {
7763
7932
  this.preventFocus = false;
7764
7933
  }
7765
7934
  this.onFocus(e);
7935
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
7766
7936
  }
7767
7937
  dropDownClick(e) {
7768
7938
  e.preventDefault();
@@ -7912,7 +8082,7 @@ let ComboBox = class ComboBox extends DropDownList {
7912
8082
  * Adds a new item to the combobox popup list. By default, new item appends to the list as the last item,
7913
8083
  * but you can insert based on the index parameter.
7914
8084
  *
7915
- * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
8085
+ * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
7916
8086
  * @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
7917
8087
  * @returns {void}
7918
8088
  * @deprecated
@@ -7923,9 +8093,9 @@ let ComboBox = class ComboBox extends DropDownList {
7923
8093
  /**
7924
8094
  * To filter the data from given data source by using query
7925
8095
  *
7926
- * @param {Object[] | DataManager } dataSource - Set the data source to filter.
7927
- * @param {Query} query - Specify the query to filter the data.
7928
- * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
8096
+ * @param {Object[] | DataManager } dataSource - Set the data source to filter.
8097
+ * @param {Query} query - Specify the query to filter the data.
8098
+ * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
7929
8099
  * @returns {void}
7930
8100
  * @deprecated
7931
8101
  */
@@ -7938,8 +8108,8 @@ let ComboBox = class ComboBox extends DropDownList {
7938
8108
  * @returns {void}
7939
8109
  * @deprecated
7940
8110
  */
7941
- showPopup() {
7942
- super.showPopup();
8111
+ showPopup(e) {
8112
+ super.showPopup(e);
7943
8113
  }
7944
8114
  /* eslint-disable valid-jsdoc, jsdoc/require-param */
7945
8115
  /**
@@ -7962,7 +8132,7 @@ let ComboBox = class ComboBox extends DropDownList {
7962
8132
  this.removeFillSelection();
7963
8133
  }
7964
8134
  const dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
7965
- const selected = this.list.querySelector('.' + dropDownListClasses.selected);
8135
+ const selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : null;
7966
8136
  if (this.inputElement && dataItem.text === this.inputElement.value && !isNullOrUndefined(selected)) {
7967
8137
  if (this.isSelected) {
7968
8138
  this.onChangeEvent(e);
@@ -7972,10 +8142,12 @@ let ComboBox = class ComboBox extends DropDownList {
7972
8142
  return;
7973
8143
  }
7974
8144
  if (this.getModuleName() === 'combobox' && this.inputElement.value.trim() !== '') {
7975
- const searchItem = Search(this.inputElement.value, this.liCollections, 'Equal', true);
8145
+ const dataSource = this.sortedData;
8146
+ const type = this.typeOfData(dataSource).typeof;
8147
+ const searchItem = Search(this.inputElement.value, this.liCollections, 'Equal', true, dataSource, this.fields, type);
7976
8148
  this.selectedLI = searchItem.item;
7977
8149
  if (isNullOrUndefined(searchItem.index)) {
7978
- searchItem.index = Search(this.inputElement.value, this.liCollections, 'StartsWith', true).index;
8150
+ searchItem.index = Search(this.inputElement.value, this.liCollections, 'StartsWith', true, dataSource, this.fields, type).index;
7979
8151
  }
7980
8152
  this.activeIndex = searchItem.index;
7981
8153
  if (!isNullOrUndefined(this.selectedLI)) {
@@ -8214,13 +8386,13 @@ let AutoComplete = class AutoComplete extends ComboBox {
8214
8386
  this.isTyped = true;
8215
8387
  this.isDataFetched = this.isSelectCustom = false;
8216
8388
  if (isNullOrUndefined(this.list)) {
8217
- super.renderList(true);
8389
+ super.renderList(e, true);
8218
8390
  }
8219
8391
  this.queryString = this.filterInput.value;
8220
8392
  if (e.type !== 'mousedown' && (e.keyCode === 40 || e.keyCode === 38)) {
8221
8393
  this.queryString = this.queryString === '' ? null : this.queryString;
8222
8394
  this.beforePopupOpen = true;
8223
- this.resetList(this.dataSource, this.fields);
8395
+ this.resetList(this.dataSource, this.fields, null, e);
8224
8396
  return;
8225
8397
  }
8226
8398
  this.isSelected = false;
@@ -8240,16 +8412,16 @@ let AutoComplete = class AutoComplete extends ComboBox {
8240
8412
  this.trigger('filtering', eventArgs, (eventArgs) => {
8241
8413
  if (!eventArgs.cancel && !this.isFiltered && !eventArgs.preventDefaultAction) {
8242
8414
  this.searchList = true;
8243
- this.filterAction(this.dataSource, null, this.fields);
8415
+ this.filterAction(this.dataSource, null, this.fields, e);
8244
8416
  }
8245
8417
  });
8246
8418
  }
8247
8419
  /**
8248
8420
  * To filter the data from given data source by using query
8249
8421
  *
8250
- * @param {Object[] | DataManager } dataSource - Set the data source to filter.
8251
- * @param {Query} query - Specify the query to filter the data.
8252
- * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
8422
+ * @param {Object[] | DataManager } dataSource - Set the data source to filter.
8423
+ * @param {Query} query - Specify the query to filter the data.
8424
+ * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
8253
8425
  * @returns {void}
8254
8426
  * @deprecated
8255
8427
  */
@@ -8257,13 +8429,13 @@ let AutoComplete = class AutoComplete extends ComboBox {
8257
8429
  this.isFiltered = true;
8258
8430
  this.filterAction(dataSource, query, fields);
8259
8431
  }
8260
- filterAction(dataSource, query, fields) {
8432
+ filterAction(dataSource, query, fields, e) {
8261
8433
  this.beforePopupOpen = true;
8262
8434
  if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
8263
- this.resetList(dataSource, fields, query);
8435
+ this.resetList(dataSource, fields, query, e);
8264
8436
  }
8265
8437
  else {
8266
- this.hidePopup();
8438
+ this.hidePopup(e);
8267
8439
  this.beforePopupOpen = false;
8268
8440
  }
8269
8441
  this.renderReactTemplates();
@@ -8289,7 +8461,9 @@ let AutoComplete = class AutoComplete extends ComboBox {
8289
8461
  postBackAction() {
8290
8462
  if (this.autofill && !isNullOrUndefined(this.liCollections[0]) && this.searchList) {
8291
8463
  const items = [this.liCollections[0]];
8292
- const searchItem = Search(this.inputElement.value, items, 'StartsWith', this.ignoreCase);
8464
+ const dataSource = this.listData;
8465
+ const type = this.typeOfData(dataSource).typeof;
8466
+ const searchItem = Search(this.inputElement.value, items, 'StartsWith', this.ignoreCase, dataSource, this.fields, type);
8293
8467
  this.searchList = false;
8294
8468
  if (!isNullOrUndefined(searchItem.item)) {
8295
8469
  super.setAutoFill(this.liCollections[0], true);
@@ -8298,6 +8472,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
8298
8472
  }
8299
8473
  setSelection(li, e) {
8300
8474
  if (!this.isValidLI(li)) {
8475
+ this.selectedLI = li;
8301
8476
  return;
8302
8477
  }
8303
8478
  if (!isNullOrUndefined(e) && e.type === 'keydown' && e.action !== 'enter'
@@ -8313,7 +8488,6 @@ let AutoComplete = class AutoComplete extends ComboBox {
8313
8488
  e.action === 'home' || e.action === 'end' || e.action === 'pageUp' || e.action === 'pageDown');
8314
8489
  super.setAutoFill(li, isKeyNavigate);
8315
8490
  }
8316
- attributes(this.inputElement, { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
8317
8491
  }
8318
8492
  else {
8319
8493
  super.setSelection(li, e);
@@ -8349,9 +8523,9 @@ let AutoComplete = class AutoComplete extends ComboBox {
8349
8523
  isFiltering() {
8350
8524
  return true;
8351
8525
  }
8352
- renderPopup() {
8526
+ renderPopup(e) {
8353
8527
  this.list.scrollTop = 0;
8354
- super.renderPopup();
8528
+ super.renderPopup(e);
8355
8529
  }
8356
8530
  isEditTextBox() {
8357
8531
  return true && this.inputElement.value.trim() !== '';
@@ -8363,13 +8537,37 @@ let AutoComplete = class AutoComplete extends ComboBox {
8363
8537
  isSelectFocusItem(element) {
8364
8538
  return false;
8365
8539
  }
8540
+ setInputValue(newProp, oldProp) {
8541
+ let oldValue = oldProp && oldProp.text ? oldProp.text : oldProp ? oldProp.value : oldProp;
8542
+ let value = newProp && newProp.text ? newProp.text : newProp && newProp.value ? newProp.value : this.value;
8543
+ if (value && this.typedString === '' && !this.allowCustom && !(this.dataSource instanceof DataManager)) {
8544
+ let checkFields_1 = this.typeOfData(this.dataSource).typeof === 'string' ? '' : this.fields.value;
8545
+ const listLength = this.getItems().length;
8546
+ let query = new Query();
8547
+ let _this = this;
8548
+ new DataManager(this.dataSource).executeQuery(query.where(new Predicate(checkFields_1, 'equal', value)))
8549
+ .then(function (e) {
8550
+ if (e.result.length > 0) {
8551
+ _this.value = checkFields_1 !== '' ? e.result[0][_this.fields.value].toString() : e.result[0].toString();
8552
+ _this.addItem(e.result, listLength);
8553
+ _this.updateValues();
8554
+ }
8555
+ else {
8556
+ newProp && newProp.text ? _this.setOldText(oldValue) : newProp && newProp.value ? _this.setOldValue(oldValue) : _this.updateValues();
8557
+ }
8558
+ });
8559
+ }
8560
+ else if (newProp) {
8561
+ newProp.text ? this.setOldText(oldValue) : this.setOldValue(oldValue);
8562
+ }
8563
+ }
8366
8564
  /**
8367
8565
  * Search the entered text and show it in the suggestion list if available.
8368
8566
  *
8369
8567
  * @returns {void}
8370
8568
  * @deprecated
8371
8569
  */
8372
- showPopup() {
8570
+ showPopup(e) {
8373
8571
  if (!this.enabled) {
8374
8572
  return;
8375
8573
  }
@@ -8380,10 +8578,10 @@ let AutoComplete = class AutoComplete extends ComboBox {
8380
8578
  this.beforePopupOpen = true;
8381
8579
  this.preventAutoFill = true;
8382
8580
  if (isNullOrUndefined(this.list)) {
8383
- this.renderList();
8581
+ this.renderList(e);
8384
8582
  }
8385
8583
  else {
8386
- this.resetList(this.dataSource, this.fields);
8584
+ this.resetList(this.dataSource, this.fields, null, e);
8387
8585
  }
8388
8586
  }
8389
8587
  /**
@@ -8413,6 +8611,10 @@ let AutoComplete = class AutoComplete extends ComboBox {
8413
8611
  if (this.showPopupButton) {
8414
8612
  const button = Input.appendSpan(dropDownListClasses.icon, this.inputWrapper.container, this.createElement);
8415
8613
  this.inputWrapper.buttons[0] = button;
8614
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
8615
+ if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && !isNullOrUndefined(this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0]) && this.floatLabelType !== 'Never') {
8616
+ this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0].classList.add('e-icon');
8617
+ }
8416
8618
  if (this.inputWrapper && this.inputWrapper.buttons && this.inputWrapper.buttons[0]) {
8417
8619
  EventHandler.add(this.inputWrapper.buttons[0], 'click', this.dropDownClick, this);
8418
8620
  }
@@ -8540,9 +8742,11 @@ const LABELBOTTOM = 'e-label-bottom';
8540
8742
  function createFloatLabel(overAllWrapper, searchWrapper, element, inputElement, value, floatLabelType, placeholder) {
8541
8743
  const floatLinelement = createElement('span', { className: FLOATLINE });
8542
8744
  const floatLabelElement = createElement('label', { className: FLOATTEXT });
8745
+ const id = element.getAttribute('id') ? element.getAttribute('id') : getUniqueID('ej2_multiselect');
8746
+ element.id = id;
8543
8747
  if (!isNullOrUndefined(element.id) && element.id !== '') {
8544
8748
  floatLabelElement.id = 'label_' + element.id.replace(/ /g, '_');
8545
- attributes(element, { 'aria-labelledby': floatLabelElement.id });
8749
+ attributes(inputElement, { 'aria-labelledby': floatLabelElement.id });
8546
8750
  }
8547
8751
  if (!isNullOrUndefined(inputElement.placeholder) && inputElement.placeholder !== '') {
8548
8752
  floatLabelElement.innerText = encodePlaceholder(inputElement.placeholder);
@@ -8746,6 +8950,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
8746
8950
  this.isValidKey = false;
8747
8951
  this.selectAllEventData = [];
8748
8952
  this.selectAllEventEle = [];
8953
+ this.resetMainList = null;
8954
+ this.resetFilteredData = false;
8749
8955
  this.scrollFocusStatus = false;
8750
8956
  this.keyDownStatus = false;
8751
8957
  }
@@ -8786,7 +8992,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
8786
8992
  for (const htmlAttr of Object.keys(this.htmlAttributes)) {
8787
8993
  switch (htmlAttr) {
8788
8994
  case 'class': {
8789
- const updatedClassValue = (this.htmlAttributes[htmlAttr].replace(/\s+/g, ' ')).trim();
8995
+ const updatedClassValue = (this.htmlAttributes[`${htmlAttr}`].replace(/\s+/g, ' ')).trim();
8790
8996
  if (updatedClassValue !== '') {
8791
8997
  addClass([this.overAllWrapper], updatedClassValue.split(' '));
8792
8998
  addClass([this.popupWrapper], updatedClassValue.split(' '));
@@ -8798,7 +9004,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
8798
9004
  break;
8799
9005
  case 'placeholder':
8800
9006
  if (!this.placeholder) {
8801
- this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
9007
+ this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
8802
9008
  this.setProperties({ placeholder: this.inputElement.placeholder }, true);
8803
9009
  this.refreshPlaceHolder();
8804
9010
  }
@@ -8808,16 +9014,16 @@ let MultiSelect = class MultiSelect extends DropDownBase {
8808
9014
  const validateAttr = ['name', 'required', 'aria-required', 'form'];
8809
9015
  const containerAttr = ['title', 'role', 'style', 'class'];
8810
9016
  if (defaultAttr.indexOf(htmlAttr) > -1) {
8811
- this.element.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
9017
+ this.element.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
8812
9018
  }
8813
9019
  else if (htmlAttr.indexOf('data') === 0 || validateAttr.indexOf(htmlAttr) > -1) {
8814
- this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
9020
+ this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
8815
9021
  }
8816
9022
  else if (containerAttr.indexOf(htmlAttr) > -1) {
8817
- this.overAllWrapper.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
9023
+ this.overAllWrapper.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
8818
9024
  }
8819
- else if (htmlAttr !== 'size') {
8820
- this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
9025
+ else if (htmlAttr !== 'size' && !isNullOrUndefined(this.inputElement)) {
9026
+ this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
8821
9027
  }
8822
9028
  break;
8823
9029
  }
@@ -8826,11 +9032,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
8826
9032
  }
8827
9033
  }
8828
9034
  updateReadonly(state) {
8829
- if (state || this.mode === 'CheckBox') {
8830
- this.inputElement.setAttribute('readonly', 'true');
8831
- }
8832
- else {
8833
- this.inputElement.removeAttribute('readonly');
9035
+ if (!isNullOrUndefined(this.inputElement)) {
9036
+ if (state || this.mode === 'CheckBox') {
9037
+ this.inputElement.setAttribute('readonly', 'true');
9038
+ }
9039
+ else {
9040
+ this.inputElement.removeAttribute('readonly');
9041
+ }
8834
9042
  }
8835
9043
  }
8836
9044
  updateClearButton(state) {
@@ -8867,7 +9075,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
8867
9075
  }
8868
9076
  }
8869
9077
  }
8870
- onPopupShown() {
9078
+ onPopupShown(e) {
8871
9079
  if (Browser.isDevice && (this.mode === 'CheckBox' && this.allowFiltering)) {
8872
9080
  // eslint-disable-next-line @typescript-eslint/no-this-alias
8873
9081
  const proxy = this;
@@ -8878,7 +9086,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
8878
9086
  history.pushState({}, '');
8879
9087
  }
8880
9088
  const animModel = { name: 'FadeIn', duration: 100 };
8881
- const eventArgs = { popup: this.popupObj, cancel: false, animation: animModel };
9089
+ const eventArgs = { popup: this.popupObj, event: e, cancel: false, animation: animModel };
8882
9090
  this.trigger('open', eventArgs, (eventArgs) => {
8883
9091
  if (!eventArgs.cancel) {
8884
9092
  this.focusAtFirstListItem();
@@ -8892,7 +9100,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
8892
9100
  this.refreshPopup();
8893
9101
  this.renderReactTemplates();
8894
9102
  this.popupObj.show(eventArgs.animation, (this.zIndex === 1000) ? this.element : null);
8895
- attributes(this.inputElement, { 'aria-expanded': 'true' });
9103
+ attributes(this.inputElement, { 'aria-expanded': 'true', 'aria-owns': this.inputElement.id + '_options' });
9104
+ this.updateAriaActiveDescendant();
8896
9105
  if (this.isFirstClick) {
8897
9106
  this.loadTemplate();
8898
9107
  }
@@ -8962,11 +9171,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
8962
9171
  getAriaAttributes() {
8963
9172
  const ariaAttributes = {
8964
9173
  'aria-disabled': 'false',
8965
- 'aria-owns': this.element.id + '_options',
8966
- 'role': 'listbox',
8967
- 'aria-multiselectable': 'true',
8968
- 'aria-activedescendant': 'null',
8969
- 'aria-haspopup': 'true',
9174
+ 'role': 'combobox',
8970
9175
  'aria-expanded': 'false'
8971
9176
  };
8972
9177
  return ariaAttributes;
@@ -8975,8 +9180,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
8975
9180
  if (!isNullOrUndefined(this.ulElement)) {
8976
9181
  attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
8977
9182
  }
8978
- const disableStatus = (this.inputElement.disabled) ? true : false;
8979
- attributes(this.inputElement, this.getAriaAttributes());
9183
+ const disableStatus = !isNullOrUndefined(this.inputElement) && (this.inputElement.disabled) ? true : false;
9184
+ if (!this.isPopupOpen() && !isNullOrUndefined(this.inputElement)) {
9185
+ attributes(this.inputElement, this.getAriaAttributes());
9186
+ }
8980
9187
  if (disableStatus) {
8981
9188
  attributes(this.inputElement, { 'aria-disabled': 'true' });
8982
9189
  }
@@ -9044,13 +9251,23 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9044
9251
  if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
9045
9252
  for (let i = 0; i < this.value.length; i++) {
9046
9253
  const checkEle = this.findListElement(((this.allowFiltering && !isNullOrUndefined(this.mainList)) ? this.mainList : ulElement), 'li', 'data-value', proxy.value[i]);
9047
- if (!checkEle) {
9254
+ if (!checkEle && !(this.dataSource instanceof DataManager)) {
9048
9255
  this.value.splice(i, 1);
9049
9256
  i -= 1;
9050
9257
  }
9051
9258
  }
9052
9259
  }
9053
- this.updateActionList(ulElement, list, e);
9260
+ let valuecheck = [];
9261
+ if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
9262
+ valuecheck = this.presentItemValue(this.ulElement);
9263
+ }
9264
+ if (valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
9265
+ && this.listData != null) {
9266
+ this.addNonPresentItems(valuecheck, this.ulElement, this.listData);
9267
+ }
9268
+ else {
9269
+ this.updateActionList(ulElement, list, e);
9270
+ }
9054
9271
  if (this.dataSource instanceof DataManager && this.mode === 'CheckBox' && this.allowFiltering) {
9055
9272
  this.removeFocus();
9056
9273
  }
@@ -9074,7 +9291,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9074
9291
  this.checkForCustomValue(this.tempQuery, this.fields);
9075
9292
  return;
9076
9293
  }
9077
- if (this.value && this.value.length && ((this.mode !== 'CheckBox' && this.inputElement.value.trim() !== '') ||
9294
+ if (this.value && this.value.length && ((this.mode !== 'CheckBox' && !isNullOrUndefined(this.inputElement) && this.inputElement.value.trim() !== '') ||
9078
9295
  this.mode === 'CheckBox' || ((this.keyCode === 8 || this.keyCode === 46) && this.allowFiltering &&
9079
9296
  this.allowCustomValue && this.dataSource instanceof DataManager && this.inputElement.value === ''))) {
9080
9297
  this.refreshSelection();
@@ -9102,7 +9319,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9102
9319
  this.renderPopup();
9103
9320
  if (this.beforePopupOpen) {
9104
9321
  this.beforePopupOpen = false;
9105
- this.onPopupShown();
9322
+ this.onPopupShown(e);
9106
9323
  }
9107
9324
  }
9108
9325
  refreshSelection() {
@@ -9132,6 +9349,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9132
9349
  dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')');
9133
9350
  if (listEle.length > 0) {
9134
9351
  addClass([listEle[0]], dropDownBaseClasses.focus);
9352
+ this.updateAriaActiveDescendant();
9135
9353
  }
9136
9354
  else {
9137
9355
  //EJ2-57588 - for this task, we prevent the ul element cloning ( this.ulElement = this.ulElement.cloneNode ? <HTMLElement>this.ulElement.cloneNode(true) : this.ulElement;)
@@ -9143,8 +9361,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9143
9361
  }
9144
9362
  element.setAttribute('aria-selected', 'true');
9145
9363
  if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
9146
- const ariaValue = element.firstElementChild.getAttribute('aria-checked');
9147
- if (isNullOrUndefined(ariaValue) || ariaValue === 'false') {
9364
+ const ariaValue = element.getElementsByClassName('e-check').length;
9365
+ if (ariaValue === 0) {
9148
9366
  const args = {
9149
9367
  module: 'CheckBoxSelection',
9150
9368
  enable: this.mode === 'CheckBox',
@@ -9268,9 +9486,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9268
9486
  /**
9269
9487
  * To filter the multiselect data from given data source by using query
9270
9488
  *
9271
- * @param {Object[] | DataManager } dataSource - Set the data source to filter.
9272
- * @param {Query} query - Specify the query to filter the data.
9273
- * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
9489
+ * @param {Object[] | DataManager } dataSource - Set the data source to filter.
9490
+ * @param {Query} query - Specify the query to filter the data.
9491
+ * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
9274
9492
  * @returns {void}
9275
9493
  */
9276
9494
  filter(dataSource, query, fields) {
@@ -9358,7 +9576,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9358
9576
  this.resetList(tempData, field, query);
9359
9577
  }
9360
9578
  else {
9361
- const tempData = [this.inputElement.value];
9579
+ const tempData = JSON.parse(JSON.stringify(this.listData));
9580
+ tempData.splice(0, 0, this.inputElement.value);
9362
9581
  tempData[0] = (typeof customData === 'number' && !isNaN(parseFloat(tempData[0]))) ?
9363
9582
  parseFloat(tempData[0]) : tempData[0];
9364
9583
  tempData[0] = (typeof customData === 'boolean') ?
@@ -9394,7 +9613,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9394
9613
  }
9395
9614
  if (!this.isPopupOpen() &&
9396
9615
  (this.openOnClick || (this.showDropDownIcon && e.target && e.target.className === dropdownIcon))) {
9397
- this.showPopup();
9616
+ this.showPopup(e);
9398
9617
  }
9399
9618
  else {
9400
9619
  this.hidePopup(e);
@@ -9476,6 +9695,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9476
9695
  }
9477
9696
  }
9478
9697
  this.updateDataList();
9698
+ if (this.resetMainList) {
9699
+ this.mainList = this.resetMainList;
9700
+ this.resetMainList = null;
9701
+ }
9479
9702
  this.refreshListItems(null);
9480
9703
  if (this.mode !== 'Box' && this.mode !== 'CheckBox') {
9481
9704
  this.updateDelimView();
@@ -9503,6 +9726,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9503
9726
  this.ulElement = this.mainList;
9504
9727
  }
9505
9728
  this.checkPlaceholderSize();
9729
+ Input.createSpanElement(this.overAllWrapper, this.createElement);
9730
+ Input.calculateWidth(this.inputElement, this.overAllWrapper);
9731
+ if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
9732
+ this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
9733
+ }
9506
9734
  }
9507
9735
  checkPlaceholderSize() {
9508
9736
  if (this.showDropDownIcon) {
@@ -9531,11 +9759,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9531
9759
  }
9532
9760
  }
9533
9761
  refreshInputHight() {
9534
- if ((!this.value || !this.value.length) && (isNullOrUndefined(this.text) || this.text === '')) {
9535
- this.searchWrapper.classList.remove(ZERO_SIZE);
9536
- }
9537
- else {
9538
- this.searchWrapper.classList.add(ZERO_SIZE);
9762
+ if (!isNullOrUndefined(this.searchWrapper)) {
9763
+ if ((!this.value || !this.value.length) && (isNullOrUndefined(this.text) || this.text === '')) {
9764
+ this.searchWrapper.classList.remove(ZERO_SIZE);
9765
+ }
9766
+ else {
9767
+ this.searchWrapper.classList.add(ZERO_SIZE);
9768
+ }
9539
9769
  }
9540
9770
  }
9541
9771
  validateValues(newValue, oldValue) {
@@ -9573,6 +9803,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9573
9803
  this.tempValues = this.value.slice();
9574
9804
  }
9575
9805
  }
9806
+ updateAriaActiveDescendant() {
9807
+ if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
9808
+ attributes(this.inputElement, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
9809
+ }
9810
+ }
9576
9811
  getPagingCount() {
9577
9812
  const height = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
9578
9813
  getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
@@ -9633,6 +9868,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9633
9868
  if (this.isPopupOpen()) {
9634
9869
  this.refreshPopup();
9635
9870
  }
9871
+ Input.calculateWidth(this.inputElement, this.overAllWrapper);
9636
9872
  return true;
9637
9873
  }
9638
9874
  else {
@@ -9688,7 +9924,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9688
9924
  break;
9689
9925
  case 40:
9690
9926
  if (!this.isPopupOpen()) {
9691
- this.showPopup();
9927
+ this.showPopup(e);
9692
9928
  e.preventDefault();
9693
9929
  }
9694
9930
  break;
@@ -9715,6 +9951,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9715
9951
  const element = scrollEle[(isHome) ? 0 : (scrollEle.length - 1)];
9716
9952
  element.classList.add(dropDownBaseClasses.focus);
9717
9953
  this.scrollBottom(element);
9954
+ this.updateAriaActiveDescendant();
9718
9955
  }
9719
9956
  }
9720
9957
  onKeyDown(e) {
@@ -10216,7 +10453,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10216
10453
  }
10217
10454
  invokeCheckboxSelection(element, eve, isClearAll) {
10218
10455
  this.notify('updatelist', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: eve });
10219
- attributes(this.inputElement, { 'aria-activedescendant': element.id });
10456
+ this.updateAriaActiveDescendant();
10220
10457
  if ((this.value && this.value.length !== this.mainData.length)
10221
10458
  && (this.mode === 'CheckBox' && this.showSelectAll && !(this.isSelectAll || isClearAll))) {
10222
10459
  this.notify('checkSelectAll', {
@@ -10328,7 +10565,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10328
10565
  HIDE_LIST :
10329
10566
  dropDownBaseClasses.selected);
10330
10567
  if (this.mode === 'CheckBox') {
10331
- element2.firstElementChild.setAttribute('aria-checked', 'false');
10332
10568
  removeClass([element2.firstElementChild.lastElementChild], 'e-check');
10333
10569
  }
10334
10570
  }
@@ -10338,7 +10574,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10338
10574
  HIDE_LIST :
10339
10575
  dropDownBaseClasses.selected);
10340
10576
  if (this.mode === 'CheckBox') {
10341
- element2.firstElementChild.setAttribute('aria-checked', 'true');
10342
10577
  addClass([element2.firstElementChild.lastElementChild], 'e-check');
10343
10578
  }
10344
10579
  }
@@ -10596,109 +10831,111 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10596
10831
  super.render();
10597
10832
  }
10598
10833
  if (!this.popupObj) {
10599
- document.body.appendChild(this.popupWrapper);
10600
- const checkboxFilter = this.popupWrapper.querySelector('.' + FILTERPARENT);
10601
- if (this.mode === 'CheckBox' && !this.allowFiltering && checkboxFilter && this.filterParent) {
10602
- checkboxFilter.remove();
10603
- this.filterParent = null;
10604
- }
10605
- let overAllHeight = parseInt(this.popupHeight, 10);
10606
- this.popupWrapper.style.visibility = 'hidden';
10607
- if (this.headerTemplate) {
10608
- this.setHeaderTemplate();
10609
- overAllHeight -= this.header.offsetHeight;
10610
- }
10611
- append([this.list], this.popupWrapper);
10612
- if (this.footerTemplate) {
10613
- this.setFooterTemplate();
10614
- overAllHeight -= this.footer.offsetHeight;
10615
- }
10616
- if (this.mode === 'CheckBox' && this.showSelectAll) {
10617
- this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10618
- overAllHeight -= this.selectAllHeight;
10619
- }
10620
- else if (this.mode === 'CheckBox' && !this.showSelectAll && (!this.headerTemplate && !this.footerTemplate)) {
10621
- this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10622
- overAllHeight = parseInt(this.popupHeight, 10);
10623
- }
10624
- else if (this.mode === 'CheckBox' && !this.showSelectAll) {
10625
- this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10626
- overAllHeight = parseInt(this.popupHeight, 10);
10627
- if (this.headerTemplate && this.header) {
10834
+ if (!isNullOrUndefined(this.popupWrapper)) {
10835
+ document.body.appendChild(this.popupWrapper);
10836
+ const checkboxFilter = this.popupWrapper.querySelector('.' + FILTERPARENT);
10837
+ if (this.mode === 'CheckBox' && !this.allowFiltering && checkboxFilter && this.filterParent) {
10838
+ checkboxFilter.remove();
10839
+ this.filterParent = null;
10840
+ }
10841
+ let overAllHeight = parseInt(this.popupHeight, 10);
10842
+ this.popupWrapper.style.visibility = 'hidden';
10843
+ if (this.headerTemplate) {
10844
+ this.setHeaderTemplate();
10628
10845
  overAllHeight -= this.header.offsetHeight;
10629
10846
  }
10630
- if (this.footerTemplate && this.footer) {
10847
+ append([this.list], this.popupWrapper);
10848
+ if (this.footerTemplate) {
10849
+ this.setFooterTemplate();
10631
10850
  overAllHeight -= this.footer.offsetHeight;
10632
10851
  }
10633
- }
10634
- if (this.mode === 'CheckBox') {
10635
- const args = {
10636
- module: 'CheckBoxSelection',
10637
- enable: this.mode === 'CheckBox',
10638
- popupElement: this.popupWrapper
10639
- };
10640
- if (this.allowFiltering) {
10641
- this.notify('searchBox', args);
10642
- overAllHeight -= this.searchBoxHeight;
10643
- }
10644
- addClass([this.popupWrapper], 'e-checkbox');
10645
- }
10646
- if (this.popupHeight !== 'auto') {
10647
- this.list.style.maxHeight = formatUnit(overAllHeight);
10648
- this.popupWrapper.style.maxHeight = formatUnit(this.popupHeight);
10649
- }
10650
- else {
10651
- this.list.style.maxHeight = formatUnit(this.popupHeight);
10652
- }
10653
- this.popupObj = new Popup(this.popupWrapper, {
10654
- width: this.calcPopupWidth(), targetType: 'relative', position: { X: 'left', Y: 'bottom' },
10655
- relateTo: this.overAllWrapper, collision: { X: 'flip', Y: 'flip' }, offsetY: 1,
10656
- enableRtl: this.enableRtl, zIndex: this.zIndex,
10657
- close: () => {
10658
- if (this.popupObj.element.parentElement) {
10659
- this.popupObj.unwireScrollEvents();
10660
- // For restrict the page scrolling in safari browser
10661
- const checkboxFilterInput = this.popupWrapper.querySelector('.' + FILTERINPUT);
10662
- if (this.mode === 'CheckBox' && checkboxFilterInput && document.activeElement === checkboxFilterInput) {
10663
- checkboxFilterInput.blur();
10664
- }
10665
- detach(this.popupObj.element);
10666
- }
10667
- },
10668
- open: () => {
10669
- this.popupObj.resolveCollision();
10670
- if (!this.isFirstClick) {
10671
- const ulElement = this.list.querySelector('ul');
10672
- if (ulElement) {
10673
- if (!(this.mode !== 'CheckBox' && (this.allowFiltering || this.allowCustomValue) &&
10674
- this.targetElement().trim() !== '')) {
10675
- this.mainList = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;
10676
- }
10677
- }
10678
- this.isFirstClick = true;
10852
+ if (this.mode === 'CheckBox' && this.showSelectAll) {
10853
+ this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10854
+ overAllHeight -= this.selectAllHeight;
10855
+ }
10856
+ else if (this.mode === 'CheckBox' && !this.showSelectAll && (!this.headerTemplate && !this.footerTemplate)) {
10857
+ this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10858
+ overAllHeight = parseInt(this.popupHeight, 10);
10859
+ }
10860
+ else if (this.mode === 'CheckBox' && !this.showSelectAll) {
10861
+ this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10862
+ overAllHeight = parseInt(this.popupHeight, 10);
10863
+ if (this.headerTemplate && this.header) {
10864
+ overAllHeight -= this.header.offsetHeight;
10679
10865
  }
10680
- this.popupObj.wireScrollEvents();
10681
- if (!(this.mode !== 'CheckBox' && (this.allowFiltering || this.allowCustomValue) &&
10682
- this.targetElement().trim() !== '')) {
10683
- this.loadTemplate();
10866
+ if (this.footerTemplate && this.footer) {
10867
+ overAllHeight -= this.footer.offsetHeight;
10684
10868
  }
10685
- this.setScrollPosition();
10869
+ }
10870
+ if (this.mode === 'CheckBox') {
10871
+ const args = {
10872
+ module: 'CheckBoxSelection',
10873
+ enable: this.mode === 'CheckBox',
10874
+ popupElement: this.popupWrapper
10875
+ };
10686
10876
  if (this.allowFiltering) {
10687
- this.notify('inputFocus', {
10688
- module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'focus'
10689
- });
10877
+ this.notify('searchBox', args);
10878
+ overAllHeight -= this.searchBoxHeight;
10690
10879
  }
10691
- }, targetExitViewport: () => {
10692
- if (!Browser.isDevice) {
10693
- this.hidePopup();
10880
+ addClass([this.popupWrapper], 'e-checkbox');
10881
+ }
10882
+ if (this.popupHeight !== 'auto') {
10883
+ this.list.style.maxHeight = formatUnit(overAllHeight);
10884
+ this.popupWrapper.style.maxHeight = formatUnit(this.popupHeight);
10885
+ }
10886
+ else {
10887
+ this.list.style.maxHeight = formatUnit(this.popupHeight);
10888
+ }
10889
+ this.popupObj = new Popup(this.popupWrapper, {
10890
+ width: this.calcPopupWidth(), targetType: 'relative', position: { X: 'left', Y: 'bottom' },
10891
+ relateTo: this.overAllWrapper, collision: { X: 'flip', Y: 'flip' }, offsetY: 1,
10892
+ enableRtl: this.enableRtl, zIndex: this.zIndex,
10893
+ close: () => {
10894
+ if (this.popupObj.element.parentElement) {
10895
+ this.popupObj.unwireScrollEvents();
10896
+ // For restrict the page scrolling in safari browser
10897
+ const checkboxFilterInput = this.popupWrapper.querySelector('.' + FILTERINPUT);
10898
+ if (this.mode === 'CheckBox' && checkboxFilterInput && document.activeElement === checkboxFilterInput) {
10899
+ checkboxFilterInput.blur();
10900
+ }
10901
+ detach(this.popupObj.element);
10902
+ }
10903
+ },
10904
+ open: () => {
10905
+ this.popupObj.resolveCollision();
10906
+ if (!this.isFirstClick) {
10907
+ const ulElement = this.list.querySelector('ul');
10908
+ if (ulElement) {
10909
+ if (!(this.mode !== 'CheckBox' && (this.allowFiltering || this.allowCustomValue) &&
10910
+ this.targetElement().trim() !== '')) {
10911
+ this.mainList = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;
10912
+ }
10913
+ }
10914
+ this.isFirstClick = true;
10915
+ }
10916
+ this.popupObj.wireScrollEvents();
10917
+ if (!(this.mode !== 'CheckBox' && (this.allowFiltering || this.allowCustomValue) &&
10918
+ this.targetElement().trim() !== '')) {
10919
+ this.loadTemplate();
10920
+ }
10921
+ this.setScrollPosition();
10922
+ if (this.allowFiltering) {
10923
+ this.notify('inputFocus', {
10924
+ module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'focus'
10925
+ });
10926
+ }
10927
+ }, targetExitViewport: () => {
10928
+ if (!Browser.isDevice) {
10929
+ this.hidePopup();
10930
+ }
10694
10931
  }
10932
+ });
10933
+ if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {
10934
+ this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10695
10935
  }
10696
- });
10697
- if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {
10698
- this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
10936
+ this.popupObj.close();
10937
+ this.popupWrapper.style.visibility = '';
10699
10938
  }
10700
- this.popupObj.close();
10701
- this.popupWrapper.style.visibility = '';
10702
10939
  }
10703
10940
  }
10704
10941
  setHeaderTemplate() {
@@ -10768,6 +11005,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10768
11005
  this.removeValue(temp, e, null, true);
10769
11006
  }
10770
11007
  }
11008
+ this.selectedElementID = null;
11009
+ this.inputElement.removeAttribute('aria-activedescendant');
10771
11010
  }
10772
11011
  else {
10773
11012
  this.clearAllCallback(e);
@@ -10869,11 +11108,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10869
11108
  });
10870
11109
  }
10871
11110
  search(e) {
11111
+ this.resetFilteredData = true;
10872
11112
  if (!isNullOrUndefined(e)) {
10873
11113
  this.keyCode = e.keyCode;
10874
11114
  }
10875
11115
  if (!this.isPopupOpen() && this.openOnClick) {
10876
- this.showPopup();
11116
+ this.showPopup(e);
10877
11117
  }
10878
11118
  this.openClick(e);
10879
11119
  if (this.checkTextLength() && !this.allowFiltering && !isNullOrUndefined(e) && (e.keyCode !== 8)) {
@@ -10957,7 +11197,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10957
11197
  let temp;
10958
11198
  const tempData = this.listData;
10959
11199
  this.listData = this.mainData;
10960
- this.hiddenElement.innerHTML = '';
11200
+ if (!isNullOrUndefined(this.hiddenElement)) {
11201
+ this.hiddenElement.innerHTML = '';
11202
+ }
10961
11203
  if (!isNullOrUndefined(this.value)) {
10962
11204
  for (let index = 0; !isNullOrUndefined(this.value[index]); index++) {
10963
11205
  const listValue = this.findListElement(((!isNullOrUndefined(this.mainList)) ? this.mainList : this.ulElement), 'li', 'data-value', this.value[index]);
@@ -10975,7 +11217,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10975
11217
  data += temp + delimiterChar + ' ';
10976
11218
  text.push(temp);
10977
11219
  }
10978
- this.hiddenElement.innerHTML += '<option selected value ="' + this.value[index] + '">' + index + '</option>';
11220
+ if (!isNullOrUndefined(this.hiddenElement)) {
11221
+ this.hiddenElement.innerHTML += '<option selected value ="' + this.value[index] + '">' + index + '</option>';
11222
+ }
10979
11223
  }
10980
11224
  }
10981
11225
  this.setProperties({ text: text.toString() }, true);
@@ -11020,7 +11264,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11020
11264
  || this.list.querySelector('.e-ul') && this.list.querySelector('.e-ul').childElementCount === 0)) {
11021
11265
  isEmptyData = true;
11022
11266
  }
11023
- super.render(isEmptyData);
11267
+ super.render(null, isEmptyData);
11024
11268
  this.unwireListEvents();
11025
11269
  this.wireListEvents();
11026
11270
  }
@@ -11108,7 +11352,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11108
11352
  }
11109
11353
  }
11110
11354
  updateDataList() {
11111
- if (this.mainList && this.ulElement && !(this.isFiltered || this.filterAction)) {
11355
+ if (this.mainList && this.ulElement && !(this.isFiltered || this.filterAction || this.targetElement().trim())) {
11112
11356
  let isDynamicGroupItemUpdate = this.mainList.childElementCount < this.ulElement.childElementCount;
11113
11357
  let isReactTemplateUpdate = ((this.ulElement.childElementCount > 0 && this.ulElement.children[0].childElementCount > 0) && (this.mainList.children[0].childElementCount < this.ulElement.children[0].childElementCount));
11114
11358
  let isAngularTemplateUpdate = this.itemTemplate && this.ulElement.childElementCount > 0 && !(this.ulElement.childElementCount < this.mainList.childElementCount) && (this.ulElement.children[0].childElementCount > 0 || (this.fields.groupBy && this.ulElement.children[1] && this.ulElement.children[1].childElementCount > 0));
@@ -11186,10 +11430,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11186
11430
  selectItems[temp1 - 1].setAttribute('aria-selected', 'false');
11187
11431
  if (this.mode === 'CheckBox') {
11188
11432
  if (selectedItems && (selectedItems.length > (temp1 - 1))) {
11189
- selectedItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');
11190
11433
  removeClass([selectedItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');
11191
11434
  }
11192
- selectItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');
11193
11435
  removeClass([selectItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');
11194
11436
  }
11195
11437
  temp1--;
@@ -11230,10 +11472,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11230
11472
  if (this.enabled && this.isValidLI(element)) {
11231
11473
  this.removeFocus();
11232
11474
  addClass([element], dropDownBaseClasses.focus);
11475
+ this.updateAriaActiveDescendant();
11233
11476
  }
11234
11477
  else {
11235
11478
  if (this.enableGroupCheckBox && this.mode === 'CheckBox' && !isNullOrUndefined(this.fields.groupBy)) {
11236
11479
  addClass([element], dropDownBaseClasses.focus);
11480
+ this.updateAriaActiveDescendant();
11237
11481
  }
11238
11482
  }
11239
11483
  }
@@ -11245,9 +11489,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11245
11489
  addClass([element], className);
11246
11490
  this.updateMainList(false, element.getAttribute('data-value'), mainElement);
11247
11491
  element.setAttribute('aria-selected', 'true');
11248
- if (this.mode === 'CheckBox') {
11249
- const ariaCheck = element.firstElementChild.getAttribute('aria-checked');
11250
- if (ariaCheck === 'false' || isNullOrUndefined(ariaCheck)) {
11492
+ if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
11493
+ const ariaCheck = element.getElementsByClassName('e-check').length;
11494
+ if (ariaCheck === 0) {
11251
11495
  this.notify('updatelist', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: this });
11252
11496
  }
11253
11497
  }
@@ -11255,7 +11499,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11255
11499
  if (this.chipCollectionWrapper) {
11256
11500
  this.removeChipSelection();
11257
11501
  }
11258
- attributes(this.inputElement, { 'aria-activedescendant': element.id });
11502
+ this.selectedElementID = element.id;
11259
11503
  }
11260
11504
  }
11261
11505
  updateDelimeter(delimChar, e) {
@@ -11565,9 +11809,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11565
11809
  if (this.chipCollectionWrapper) {
11566
11810
  this.chipCollectionWrapper.style.display = 'none';
11567
11811
  }
11568
- this.viewWrapper.style.display = '';
11569
- this.viewWrapper.style.width = '';
11570
- this.viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER$1);
11812
+ if (!isNullOrUndefined(this.viewWrapper)) {
11813
+ this.viewWrapper.style.display = '';
11814
+ this.viewWrapper.style.width = '';
11815
+ this.viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER$1);
11816
+ }
11571
11817
  if (this.value && this.value.length) {
11572
11818
  let data = '';
11573
11819
  let temp;
@@ -11618,7 +11864,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11618
11864
  overAllContainer = this.componentWrapper.offsetWidth -
11619
11865
  parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft, 10) -
11620
11866
  parseInt(window.getComputedStyle(this.componentWrapper).paddingRight, 10);
11621
- if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
11867
+ if ((wrapperleng + downIconWidth + this.clearIconWidth) >= overAllContainer) {
11622
11868
  if (tempData !== undefined && tempData !== '') {
11623
11869
  temp = tempData;
11624
11870
  index = tempIndex + 1;
@@ -11627,7 +11873,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11627
11873
  remaining = this.value.length - index;
11628
11874
  wrapperleng = this.viewWrapper.offsetWidth +
11629
11875
  parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);
11630
- while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) > overAllContainer) && wrapperleng !== 0
11876
+ while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) >= overAllContainer) && wrapperleng !== 0
11631
11877
  && this.viewWrapper.innerHTML !== '') {
11632
11878
  const textArr = [];
11633
11879
  this.viewWrapper.innerHTML = textArr.join(this.delimiterChar);
@@ -11637,7 +11883,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11637
11883
  }
11638
11884
  break;
11639
11885
  }
11640
- else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) <= overAllContainer) {
11886
+ else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) < overAllContainer) {
11641
11887
  tempData = data;
11642
11888
  tempIndex = index;
11643
11889
  }
@@ -11655,8 +11901,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11655
11901
  }
11656
11902
  }
11657
11903
  else {
11658
- this.viewWrapper.innerHTML = '';
11659
- this.viewWrapper.style.display = 'none';
11904
+ if (!isNullOrUndefined(this.viewWrapper)) {
11905
+ this.viewWrapper.innerHTML = '';
11906
+ this.viewWrapper.style.display = 'none';
11907
+ }
11660
11908
  }
11661
11909
  }
11662
11910
  checkClearIconWidth() {
@@ -11729,29 +11977,41 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11729
11977
  return temp;
11730
11978
  }
11731
11979
  unWireEvent() {
11732
- EventHandler.remove(this.componentWrapper, 'mousedown', this.wrapperClick);
11980
+ if (!isNullOrUndefined(this.componentWrapper)) {
11981
+ EventHandler.remove(this.componentWrapper, 'mousedown', this.wrapperClick);
11982
+ }
11733
11983
  EventHandler.remove(window, 'resize', this.windowResize);
11734
- EventHandler.remove(this.inputElement, 'focus', this.focusInHandler);
11735
- EventHandler.remove(this.inputElement, 'keydown', this.onKeyDown);
11736
- if (this.mode !== 'CheckBox') {
11737
- EventHandler.remove(this.inputElement, 'input', this.onInput);
11984
+ if (!isNullOrUndefined(this.inputElement)) {
11985
+ EventHandler.remove(this.inputElement, 'focus', this.focusInHandler);
11986
+ EventHandler.remove(this.inputElement, 'keydown', this.onKeyDown);
11987
+ if (this.mode !== 'CheckBox') {
11988
+ EventHandler.remove(this.inputElement, 'input', this.onInput);
11989
+ }
11990
+ EventHandler.remove(this.inputElement, 'keyup', this.keyUp);
11991
+ const formElement = closest(this.inputElement, 'form');
11992
+ if (formElement) {
11993
+ EventHandler.remove(formElement, 'reset', this.resetValueHandler);
11994
+ }
11995
+ EventHandler.remove(this.inputElement, 'blur', this.onBlurHandler);
11738
11996
  }
11739
- EventHandler.remove(this.inputElement, 'keyup', this.keyUp);
11740
- const formElement = closest(this.inputElement, 'form');
11741
- if (formElement) {
11742
- EventHandler.remove(formElement, 'reset', this.resetValueHandler);
11997
+ if (!isNullOrUndefined(this.componentWrapper)) {
11998
+ EventHandler.remove(this.componentWrapper, 'mouseover', this.mouseIn);
11999
+ EventHandler.remove(this.componentWrapper, 'mouseout', this.mouseOut);
12000
+ }
12001
+ if (!isNullOrUndefined(this.overAllClear)) {
12002
+ EventHandler.remove(this.overAllClear, 'mousedown', this.clearAll);
12003
+ }
12004
+ if (!isNullOrUndefined(this.inputElement)) {
12005
+ EventHandler.remove(this.inputElement, 'paste', this.pasteHandler);
11743
12006
  }
11744
- EventHandler.remove(this.inputElement, 'blur', this.onBlurHandler);
11745
- EventHandler.remove(this.componentWrapper, 'mouseover', this.mouseIn);
11746
- EventHandler.remove(this.componentWrapper, 'mouseout', this.mouseOut);
11747
- EventHandler.remove(this.overAllClear, 'mousedown', this.clearAll);
11748
- EventHandler.remove(this.inputElement, 'paste', this.pasteHandler);
11749
12007
  }
11750
12008
  selectAllItem(state, event, list) {
11751
12009
  let li;
11752
- li = this.list.querySelectorAll(state ?
11753
- 'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
11754
- 'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
12010
+ if (!isNullOrUndefined(this.list)) {
12011
+ li = this.list.querySelectorAll(state ?
12012
+ 'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
12013
+ 'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
12014
+ }
11755
12015
  if (this.value && this.value.length && event && event.target
11756
12016
  && closest(event.target, '.e-close-hooker') && this.allowFiltering) {
11757
12017
  li = this.mainList.querySelectorAll(state ?
@@ -11801,6 +12061,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11801
12061
  target.classList.remove('e-active');
11802
12062
  }
11803
12063
  target.classList.add('e-item-focus');
12064
+ this.updateAriaActiveDescendant();
11804
12065
  }
11805
12066
  this.textboxValueUpdate();
11806
12067
  this.checkPlaceholderSize();
@@ -11815,6 +12076,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11815
12076
  else {
11816
12077
  this.updateValue(event, li, state);
11817
12078
  }
12079
+ this.addValidInputClass();
11818
12080
  }
11819
12081
  updateValue(event, li, state) {
11820
12082
  const length = li.length;
@@ -12037,6 +12299,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12037
12299
  onPropertyChanged(newProp, oldProp) {
12038
12300
  if (newProp.dataSource && !isNullOrUndefined(Object.keys(newProp.dataSource))
12039
12301
  || newProp.query && !isNullOrUndefined(Object.keys(newProp.query))) {
12302
+ if (this.resetFilteredData) {
12303
+ // The filtered data is not being reset in the component after the user focuses out.
12304
+ this.resetMainList = !this.resetMainList ? this.mainList : this.resetMainList;
12305
+ this.resetFilteredData = false;
12306
+ }
12040
12307
  this.mainList = null;
12041
12308
  this.mainData = null;
12042
12309
  this.isFirstClick = false;
@@ -12096,6 +12363,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12096
12363
  case 'cssClass':
12097
12364
  this.updateOldPropCssClass(oldProp.cssClass);
12098
12365
  this.updateCssClass();
12366
+ Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
12099
12367
  break;
12100
12368
  case 'enableRtl':
12101
12369
  this.enableRTL(newProp.enableRtl);
@@ -12122,6 +12390,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12122
12390
  case 'floatLabelType':
12123
12391
  this.setFloatLabelType();
12124
12392
  this.addValidInputClass();
12393
+ Input.createSpanElement(this.overAllWrapper, this.createElement);
12394
+ Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
12395
+ if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
12396
+ this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
12397
+ }
12125
12398
  break;
12126
12399
  case 'enableSelectionOrder':
12127
12400
  break;
@@ -12180,7 +12453,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12180
12453
  ;
12181
12454
  addNonPresentItems(valuecheck, ulElement, list, event) {
12182
12455
  this.dataSource.executeQuery(this.getForQuery(valuecheck)).then((e) => {
12183
- this.addItem(e.result, list.length);
12456
+ if (e.result.length > 0) {
12457
+ this.addItem(e.result, list.length);
12458
+ }
12184
12459
  this.updateActionList(ulElement, list, event);
12185
12460
  });
12186
12461
  }
@@ -12239,7 +12514,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12239
12514
  * Adds a new item to the multiselect popup list. By default, new item appends to the list as the last item,
12240
12515
  * but you can insert based on the index parameter.
12241
12516
  *
12242
- * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
12517
+ * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
12243
12518
  * @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
12244
12519
  * @returns {void}
12245
12520
  */
@@ -12270,6 +12545,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12270
12545
  this.overAllWrapper.classList.remove(iconAnimation);
12271
12546
  this.popupObj.hide(new Animation(eventArgs.animation));
12272
12547
  attributes(this.inputElement, { 'aria-expanded': 'false' });
12548
+ this.inputElement.removeAttribute('aria-owns');
12549
+ this.inputElement.removeAttribute('aria-activedescendant');
12273
12550
  if (this.allowFiltering) {
12274
12551
  this.notify('inputFocus', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'clear' });
12275
12552
  }
@@ -12285,7 +12562,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12285
12562
  *
12286
12563
  * @returns {void}
12287
12564
  */
12288
- showPopup() {
12565
+ showPopup(e) {
12289
12566
  if (!this.enabled) {
12290
12567
  return;
12291
12568
  }
@@ -12294,7 +12571,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12294
12571
  if (!args.cancel) {
12295
12572
  if (!this.ulElement) {
12296
12573
  this.beforePopupOpen = true;
12297
- super.render();
12574
+ super.render(e);
12298
12575
  if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {
12299
12576
  this.notify('popupFullScreen', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
12300
12577
  }
@@ -12310,7 +12587,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12310
12587
  this.beforePopupOpen = false;
12311
12588
  return;
12312
12589
  }
12313
- this.onPopupShown();
12590
+ this.onPopupShown(e);
12314
12591
  }
12315
12592
  });
12316
12593
  }
@@ -12411,12 +12688,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12411
12688
  spellcheck: 'false',
12412
12689
  type: 'text',
12413
12690
  autocomplete: 'off',
12414
- tabindex: '0'
12691
+ tabindex: '0',
12692
+ role: 'combobox'
12415
12693
  }
12416
12694
  });
12417
12695
  if (this.mode === 'Default' || this.mode === 'Box') {
12418
12696
  this.inputElement.setAttribute('aria-describedby', this.chipCollectionWrapper.id);
12419
- this.inputElement.setAttribute('aria-labelledby', this.chipCollectionWrapper.id);
12420
12697
  }
12421
12698
  if (this.element.tagName !== this.getNgDirective()) {
12422
12699
  this.element.style.display = 'none';
@@ -12449,6 +12726,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12449
12726
  if (this.mode !== 'CheckBox') {
12450
12727
  this.hideOverAllClear();
12451
12728
  }
12729
+ if (!isNullOrUndefined(closest(this.element, "fieldset")) && closest(this.element, "fieldset").disabled) {
12730
+ this.enabled = false;
12731
+ }
12452
12732
  this.wireEvent();
12453
12733
  this.enable(this.enabled);
12454
12734
  this.enableRTL(this.enableRtl);
@@ -12456,6 +12736,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12456
12736
  if (this.element.hasAttribute('data-val')) {
12457
12737
  this.element.setAttribute('data-val', 'false');
12458
12738
  }
12739
+ Input.createSpanElement(this.overAllWrapper, this.createElement);
12740
+ Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
12741
+ if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
12742
+ this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
12743
+ }
12459
12744
  this.renderComplete();
12460
12745
  }
12461
12746
  checkInitialValue() {
@@ -12536,11 +12821,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12536
12821
  }
12537
12822
  }
12538
12823
  addValidInputClass() {
12539
- if ((!isNullOrUndefined(this.value) && this.value.length) || this.floatLabelType === 'Always') {
12540
- addClass([this.overAllWrapper], 'e-valid-input');
12541
- }
12542
- else {
12543
- removeClass([this.overAllWrapper], 'e-valid-input');
12824
+ if (!isNullOrUndefined(this.overAllWrapper)) {
12825
+ if ((!isNullOrUndefined(this.value) && this.value.length) || this.floatLabelType === 'Always') {
12826
+ addClass([this.overAllWrapper], 'e-valid-input');
12827
+ }
12828
+ else {
12829
+ removeClass([this.overAllWrapper], 'e-valid-input');
12830
+ }
12544
12831
  }
12545
12832
  }
12546
12833
  dropDownIcon() {
@@ -12591,15 +12878,19 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12591
12878
  this.ulElement = null;
12592
12879
  this.mainListCollection = null;
12593
12880
  super.destroy();
12594
- const temp = ['readonly', 'aria-disabled', 'aria-placeholder', 'placeholder'];
12881
+ const temp = ['readonly', 'aria-disabled', 'placeholder'];
12595
12882
  let length = temp.length;
12596
- while (length > 0) {
12597
- this.inputElement.removeAttribute(temp[length - 1]);
12598
- length--;
12883
+ if (!isNullOrUndefined(this.inputElement)) {
12884
+ while (length > 0) {
12885
+ this.inputElement.removeAttribute(temp[length - 1]);
12886
+ length--;
12887
+ }
12599
12888
  }
12600
- this.element.removeAttribute('data-initial-value');
12601
- this.element.style.display = 'block';
12602
- if (this.overAllWrapper.parentElement) {
12889
+ if (!isNullOrUndefined(this.element)) {
12890
+ this.element.removeAttribute('data-initial-value');
12891
+ this.element.style.display = 'block';
12892
+ }
12893
+ if (this.overAllWrapper && this.overAllWrapper.parentElement) {
12603
12894
  if (this.overAllWrapper.parentElement.tagName === this.getNgDirective()) {
12604
12895
  remove(this.overAllWrapper);
12605
12896
  }
@@ -12608,6 +12899,25 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12608
12899
  remove(this.overAllWrapper);
12609
12900
  }
12610
12901
  }
12902
+ this.componentWrapper = null;
12903
+ this.overAllClear = null;
12904
+ this.overAllWrapper = null;
12905
+ this.hiddenElement = null;
12906
+ this.searchWrapper = null;
12907
+ this.viewWrapper = null;
12908
+ this.chipCollectionWrapper = null;
12909
+ this.targetInputElement = null;
12910
+ this.popupWrapper = null;
12911
+ this.inputElement = null;
12912
+ this.delimiterWrapper = null;
12913
+ this.popupObj = null;
12914
+ this.popupWrapper = null;
12915
+ this.liCollections = null;
12916
+ this.header = null;
12917
+ this.mainList = null;
12918
+ this.mainListCollection = null;
12919
+ this.footer = null;
12920
+ this.selectAllEventEle = null;
12611
12921
  }
12612
12922
  };
12613
12923
  __decorate$5([
@@ -12957,6 +13267,12 @@ class CheckBoxSelection {
12957
13267
  destroy() {
12958
13268
  this.removeEventListener();
12959
13269
  EventHandler.remove(document, 'mousedown', this.onDocumentClick);
13270
+ this.checkAllParent = null;
13271
+ this.clearIconElement = null;
13272
+ this.filterInput = null;
13273
+ this.filterInputObj = null;
13274
+ this.checkWrapper = null;
13275
+ this.selectAllSpan = null;
12960
13276
  }
12961
13277
  listSelection(args) {
12962
13278
  let target;
@@ -13005,12 +13321,10 @@ class CheckBoxSelection {
13005
13321
  e.preventDefault();
13006
13322
  }
13007
13323
  changeState(wrapper, state, e, isPrevent, selectAll$$1) {
13008
- let ariaState;
13009
13324
  const frameSpan = wrapper.getElementsByClassName(CHECKBOXFRAME$1)[0];
13010
13325
  if (state === 'check' && !frameSpan.classList.contains(CHECK$1)) {
13011
13326
  frameSpan.classList.remove(INDETERMINATE);
13012
13327
  frameSpan.classList.add(CHECK$1);
13013
- ariaState = 'true';
13014
13328
  if (selectAll$$1) {
13015
13329
  this.parent.selectAllItems(true, e);
13016
13330
  this.setLocale(true);
@@ -13018,7 +13332,6 @@ class CheckBoxSelection {
13018
13332
  }
13019
13333
  else if (state === 'uncheck' && (frameSpan.classList.contains(CHECK$1) || frameSpan.classList.contains(INDETERMINATE))) {
13020
13334
  removeClass([frameSpan], [CHECK$1, INDETERMINATE]);
13021
- ariaState = 'false';
13022
13335
  if (selectAll$$1) {
13023
13336
  this.parent.selectAllItems(false, e);
13024
13337
  this.setLocale();
@@ -13027,16 +13340,11 @@ class CheckBoxSelection {
13027
13340
  else if (state === 'indeterminate' && !(frameSpan.classList.contains(INDETERMINATE))) {
13028
13341
  removeClass([frameSpan], [CHECK$1]);
13029
13342
  frameSpan.classList.add(INDETERMINATE);
13030
- ariaState = 'false';
13031
13343
  if (selectAll$$1) {
13032
13344
  this.parent.selectAllItems(false, e);
13033
13345
  this.setLocale();
13034
13346
  }
13035
13347
  }
13036
- ariaState = state === 'check' ? 'true' : state === 'uncheck' ? 'false' : ariaState;
13037
- if (!isNullOrUndefined(ariaState)) {
13038
- wrapper.setAttribute('aria-checked', ariaState);
13039
- }
13040
13348
  }
13041
13349
  setSearchBox(args) {
13042
13350
  if (isNullOrUndefined(this.parent.filterParent)) {
@@ -13070,11 +13378,8 @@ class CheckBoxSelection {
13070
13378
  prepend([this.parent.filterParent], args.popupElement);
13071
13379
  attributes(this.filterInput, {
13072
13380
  'aria-disabled': 'false',
13073
- 'aria-owns': this.parent.element.id + '_options',
13074
- 'role': 'listbox',
13075
- 'aria-activedescendant': null,
13381
+ 'role': 'combobox',
13076
13382
  'autocomplete': 'off',
13077
- 'autocorrect': 'off',
13078
13383
  'autocapitalize': 'off',
13079
13384
  'spellcheck': 'false'
13080
13385
  });
@@ -13200,8 +13505,8 @@ class CheckBoxSelection {
13200
13505
  e.preventDefault();
13201
13506
  }
13202
13507
  }
13203
- if (!(!isNullOrUndefined(this.parent.popupObj) && closest(target, '[id="' + this.parent.popupObj.element.id + '"]')) &&
13204
- !this.parent.overAllWrapper.contains(e.target)) {
13508
+ if (!(!isNullOrUndefined(this.parent.popupObj) && closest(target, '[id="' + this.parent.popupObj.element.id + '"]'))
13509
+ && !isNullOrUndefined(this.parent.overAllWrapper) && !this.parent.overAllWrapper.contains(e.target)) {
13205
13510
  if (this.parent.overAllWrapper.classList.contains(dropDownBaseClasses.focus) || this.parent.isPopupOpen()) {
13206
13511
  this.parent.inputFocus = false;
13207
13512
  this.parent.scrollFocusStatus = false;
@@ -13214,7 +13519,7 @@ class CheckBoxSelection {
13214
13519
  this.parent.scrollFocusStatus = (Browser.isIE || Browser.info.name === 'edge') &&
13215
13520
  (document.activeElement === this.filterInput);
13216
13521
  }
13217
- if (!this.parent.overAllWrapper.contains(e.target) && this.parent.overAllWrapper.classList.contains('e-input-focus') &&
13522
+ if (!isNullOrUndefined(this.parent.overAllWrapper) && !this.parent.overAllWrapper.contains(e.target) && this.parent.overAllWrapper.classList.contains('e-input-focus') &&
13218
13523
  !this.parent.isPopupOpen()) {
13219
13524
  if (Browser.isIE) {
13220
13525
  this.parent.onBlurHandler();
@@ -13245,7 +13550,7 @@ class CheckBoxSelection {
13245
13550
  }
13246
13551
  }
13247
13552
  checkSelectAll(e) {
13248
- if (e.value === 'check' && this.checkAllParent.getAttribute('aria-checked') !== 'true') {
13553
+ if (e.value === 'check') {
13249
13554
  this.changeState(this.checkAllParent, e.value, null, null, false);
13250
13555
  this.setLocale(true);
13251
13556
  }
@@ -13402,6 +13707,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13402
13707
  this.isCustomFiltering = false;
13403
13708
  this.initialSelectedOptions = this.value;
13404
13709
  super.render();
13710
+ this.setEnabled();
13405
13711
  this.renderComplete();
13406
13712
  }
13407
13713
  initWrapper() {
@@ -13436,7 +13742,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13436
13742
  removeClass([this.list], [dropDownBaseClasses.content, dropDownBaseClasses.root]);
13437
13743
  this.validationAttribute(this.element, hiddenSelect);
13438
13744
  this.list.setAttribute('role', 'listbox');
13439
- attributes(this.list, { 'role': 'listbox', 'aria-multiselectable': this.selectionSettings.mode === 'Multiple' ? 'true' : 'false' });
13745
+ attributes(this.list, { 'role': 'listbox', 'aria-label': 'listbox', 'aria-multiselectable': this.selectionSettings.mode === 'Multiple' ? 'true' : 'false' });
13440
13746
  this.updateSelectionSettings();
13441
13747
  }
13442
13748
  updateSelectionSettings() {
@@ -13692,14 +13998,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13692
13998
  triggerDrag(args) {
13693
13999
  let scrollParent;
13694
14000
  let boundRect;
13695
- let scrollMoved = 36;
14001
+ const scrollMoved = 36;
13696
14002
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13697
- let event = args.event;
14003
+ const event = args.event;
13698
14004
  let wrapper;
13699
- if (args.target && (args.target.classList.contains("e-listbox-wrapper") || args.target.classList.contains("e-list-item")
13700
- || args.target.classList.contains("e-filter-parent") || args.target.classList.contains("e-input-group"))) {
13701
- if (args.target.classList.contains("e-list-item") || args.target.classList.contains("e-filter-parent")
13702
- || args.target.classList.contains("e-input-group")) {
14005
+ if (args.target && (args.target.classList.contains('e-listbox-wrapper') || args.target.classList.contains('e-list-item')
14006
+ || args.target.classList.contains('e-filter-parent') || args.target.classList.contains('e-input-group'))) {
14007
+ if (args.target.classList.contains('e-list-item') || args.target.classList.contains('e-filter-parent')
14008
+ || args.target.classList.contains('e-input-group')) {
13703
14009
  wrapper = args.target.closest('.e-listbox-wrapper');
13704
14010
  }
13705
14011
  else {
@@ -13753,7 +14059,8 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13753
14059
  const getArgs = this.getDragArgs({ target: args.droppedElement }, true);
13754
14060
  const sourceArgs = { previousData: this.dataSource };
13755
14061
  const destArgs = { previousData: listObj.dataSource };
13756
- let dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource }, previousIndex: args.previousIndex, currentIndex: args.currentIndex });
14062
+ let dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
14063
+ previousIndex: args.previousIndex, currentIndex: args.currentIndex });
13757
14064
  if (listObj !== this) {
13758
14065
  const sourceArgs1 = extend(sourceArgs, { currentData: this.listData });
13759
14066
  dragArgs = extend(dragArgs, { source: sourceArgs1, destination: destArgs });
@@ -13847,14 +14154,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13847
14154
  currIdx++;
13848
14155
  });
13849
14156
  if (this.fields.groupBy) {
13850
- let sourceElem = this.renderItems(this.listData, this.fields);
14157
+ const sourceElem = this.renderItems(this.listData, this.fields);
13851
14158
  this.updateListItems(sourceElem, this.ulElement);
13852
14159
  this.setSelection();
13853
14160
  }
13854
14161
  if (listObj.sortOrder !== 'None' || this.selectionSettings.showCheckbox
13855
14162
  !== listObj.selectionSettings.showCheckbox || listObj.fields.groupBy || listObj.itemTemplate || this.itemTemplate) {
13856
14163
  const sortable = getComponent(ul, 'sortable');
13857
- let sourceElem = listObj.renderItems(listData, listObj.fields);
14164
+ const sourceElem = listObj.renderItems(listData, listObj.fields);
13858
14165
  listObj.updateListItems(sourceElem, ul);
13859
14166
  this.setSelection();
13860
14167
  if (sortable.placeHolderElement) {
@@ -13881,10 +14188,17 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13881
14188
  dragArgs = extend(dragArgs, { destination: dragArgs1 });
13882
14189
  }
13883
14190
  this.trigger('drop', dragArgs);
14191
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14192
+ const liCollElem = dragArgs.elements;
14193
+ if (liCollElem.length) {
14194
+ for (let i = 0; i < liCollElem.length; i++) {
14195
+ liCollElem[i].classList.remove('e-grabbed');
14196
+ }
14197
+ }
13884
14198
  }
13885
14199
  updateListItems(sourceElem, destElem) {
13886
14200
  const i = 0;
13887
- destElem.innerHTML = "";
14201
+ destElem.innerHTML = '';
13888
14202
  while (i < sourceElem.childNodes.length) {
13889
14203
  destElem.appendChild(sourceElem.childNodes[i]);
13890
14204
  }
@@ -13913,6 +14227,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13913
14227
  }
13914
14228
  return listObj;
13915
14229
  }
14230
+ /**
14231
+ * Sets the enabled state to DropDownBase.
14232
+ *
14233
+ * @returns {void}
14234
+ */
14235
+ setEnabled() {
14236
+ this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
14237
+ }
13916
14238
  listOption(dataSource, fields) {
13917
14239
  this.listCurrentOptions = super.listOption(dataSource, fields);
13918
14240
  this.listCurrentOptions = extend({}, this.listCurrentOptions, { itemCreated: this.triggerBeforeItemRender.bind(this) }, true);
@@ -13944,7 +14266,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13944
14266
  enableItems(items, enable = true, isValue) {
13945
14267
  let li;
13946
14268
  items.forEach((item) => {
13947
- let text = item;
14269
+ const text = item;
13948
14270
  li = this.findListElement(this.list, 'li', 'data-value', isValue ? text : this.getValueByText(text));
13949
14271
  if (!li) {
13950
14272
  return;
@@ -14069,7 +14391,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14069
14391
  if (this.listData.length === 0) {
14070
14392
  this.l10nUpdate();
14071
14393
  }
14072
- this.value = null;
14394
+ this.value = [];
14073
14395
  this.updateToolBarState();
14074
14396
  }
14075
14397
  /**
@@ -14349,9 +14671,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14349
14671
  prepend([this.filterParent], this.list);
14350
14672
  attributes(this.filterInput, {
14351
14673
  'aria-disabled': 'false',
14352
- 'aria-owns': this.element.id + '_options',
14353
- 'role': 'listbox',
14354
- 'aria-activedescendant': null,
14674
+ 'aria-label': 'search list item',
14355
14675
  'autocomplete': 'off',
14356
14676
  'autocorrect': 'off',
14357
14677
  'autocapitalize': 'off',
@@ -14388,12 +14708,12 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14388
14708
  if (li && li.parentElement) {
14389
14709
  currSelIdx = [].slice.call(li.parentElement.children).indexOf(li);
14390
14710
  if (!this.selectionSettings.showCheckbox) {
14391
- if ((e.ctrlKey || Browser.isDevice) && this.isSelected(li)) {
14711
+ if ((e.ctrlKey || e.metaKey || Browser.isDevice) && this.isSelected(li)) {
14392
14712
  li.classList.remove(cssClass.selected);
14393
14713
  li.removeAttribute('aria-selected');
14394
14714
  isSelect = false;
14395
14715
  }
14396
- else if (!(this.selectionSettings.mode === 'Multiple' && (e.ctrlKey || Browser.isDevice))) {
14716
+ else if (!(this.selectionSettings.mode === 'Multiple' && (e.ctrlKey || e.metaKey || Browser.isDevice))) {
14397
14717
  this.getSelectedItems().forEach((ele) => {
14398
14718
  ele.removeAttribute('aria-selected');
14399
14719
  });
@@ -14675,7 +14995,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14675
14995
  });
14676
14996
  if (isRefresh) {
14677
14997
  if (fListBox.fields.groupBy) {
14678
- let sourceElem = fListBox.renderItems(listData, fListBox.fields);
14998
+ const sourceElem = fListBox.renderItems(listData, fListBox.fields);
14679
14999
  fListBox.updateListItems(sourceElem, fListBox.ulElement);
14680
15000
  }
14681
15001
  else {
@@ -14708,7 +15028,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14708
15028
  tListBox.jsonData = tJsonData;
14709
15029
  tListBox.sortedData = tSortData;
14710
15030
  if (isRefresh) {
14711
- let sourceElem = tListBox.renderItems(tListData, tListBox.fields);
15031
+ const sourceElem = tListBox.renderItems(tListData, tListBox.fields);
14712
15032
  tListBox.updateListItems(sourceElem, tListBox.ulElement);
14713
15033
  tListBox.setSelection();
14714
15034
  fListBox.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
@@ -14748,7 +15068,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14748
15068
  const isRefresh = tListBox.sortOrder !== 'None' || (tListBox.selectionSettings.showCheckbox !==
14749
15069
  fListBox.selectionSettings.showCheckbox) || tListBox.fields.groupBy || tListBox.itemTemplate || fListBox.itemTemplate;
14750
15070
  this.removeSelected(fListBox, fListBox.getSelectedItems());
14751
- const tempItems = [].slice.call(fListBox.jsonData);
15071
+ const tempItems = [].slice.call(fListBox.listData);
14752
15072
  const localDataArgs = { cancel: false, items: tempItems, eventName: this.toolbarAction };
14753
15073
  fListBox.trigger('actionBegin', localDataArgs);
14754
15074
  if (localDataArgs.cancel) {
@@ -14793,11 +15113,29 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14793
15113
  fListBox.value = [];
14794
15114
  listData = listData
14795
15115
  .filter((data) => data.isHeader !== true);
15116
+ const sortedData = listData.filter(function (val) {
15117
+ return tListBox.jsonData.indexOf(val) === -1;
15118
+ });
15119
+ for (let i = 0; i < sortedData.length; i++) {
15120
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15121
+ tListBox.jsonData.splice(index + i, 0, sortedData[i]);
15122
+ }
14796
15123
  tListBox.listData = listData;
14797
- tListBox.jsonData = jsonData;
14798
- fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
15124
+ if (fListBox.listData.length === fListBox.jsonData.length) {
15125
+ fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
15126
+ }
15127
+ else if (fListBox.allowFiltering) {
15128
+ for (let i = 0; i < fListBox.listData.length; i++) {
15129
+ for (let j = 0; j < fListBox.jsonData.length; j++) {
15130
+ if (fListBox.listData[i] === fListBox.jsonData[j]) {
15131
+ fListBox.jsonData.splice(j, 1);
15132
+ }
15133
+ }
15134
+ }
15135
+ fListBox.listData = fListBox.sortedData = [];
15136
+ }
14799
15137
  if (isRefresh) {
14800
- let sourceElem = tListBox.renderItems(listData, tListBox.fields);
15138
+ const sourceElem = tListBox.renderItems(listData, tListBox.fields);
14801
15139
  tListBox.updateListItems(sourceElem, tListBox.ulElement);
14802
15140
  this.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
14803
15141
  }
@@ -14848,21 +15186,35 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14848
15186
  }
14849
15187
  return listObj;
14850
15188
  }
14851
- getGrabbedItems() {
15189
+ getGrabbedItems(args) {
15190
+ let grabbItems = false;
14852
15191
  for (let i = 0; i < this.value.length; i++) {
14853
- if (this.value[i] === this.dragValue) {
15192
+ if (this.value[i] === this.getFormattedValue(args.target.getAttribute('data-value'))) {
15193
+ grabbItems = true;
15194
+ break;
15195
+ }
15196
+ }
15197
+ if (grabbItems) {
15198
+ for (let i = 0; i < this.value.length; i++) {
14854
15199
  const liColl = this.list.querySelectorAll('[aria-selected="true"]');
14855
- for (let i = 0; i < liColl.length; i++) {
14856
- liColl[i].classList.add('e-grabbed');
15200
+ for (let j = 0; j < liColl.length; j++) {
15201
+ if (this.value[i] === this.getFormattedValue(liColl[j].getAttribute('data-value'))) {
15202
+ liColl[j].classList.add('e-grabbed');
15203
+ }
14857
15204
  }
14858
- break;
14859
15205
  }
14860
15206
  }
14861
- const elems = Array.prototype.slice.call(this.element.querySelectorAll('.e-grabbed'));
15207
+ let elems;
15208
+ if (this.isAngular) {
15209
+ elems = Array.prototype.slice.call(this.element.getElementsByClassName('e-list-parent')[0].querySelectorAll('.e-grabbed'));
15210
+ }
15211
+ else {
15212
+ elems = Array.prototype.slice.call(this.element.nextElementSibling.querySelectorAll('.e-grabbed'));
15213
+ }
14862
15214
  return elems;
14863
15215
  }
14864
15216
  getDragArgs(args, isDragEnd) {
14865
- let elems = this.getGrabbedItems();
15217
+ let elems = this.getGrabbedItems(args);
14866
15218
  if (elems.length) {
14867
15219
  if (isDragEnd) {
14868
15220
  elems.push(args.target);
@@ -14914,7 +15266,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14914
15266
  }
14915
15267
  }
14916
15268
  }
14917
- else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== "KeyA") {
15269
+ else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== 'KeyA') {
14918
15270
  this.upDownKeyHandler(e);
14919
15271
  }
14920
15272
  }
@@ -14957,9 +15309,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14957
15309
  this.selectHandler({ target: ul.children[fliIdx], ctrlKey: e.ctrlKey, shiftKey: e.shiftKey }, true);
14958
15310
  }
14959
15311
  if (this.selectionSettings.showCheckbox && e.ctrlKey && e.shiftKey && (e.keyCode === 36 || e.keyCode === 35)) {
14960
- let selectedidx = Array.prototype.indexOf.call(ul.children, fli);
14961
- let sidx = e.code === "Home" ? 0 : selectedidx;
14962
- let eidx = e.code === "Home" ? selectedidx : ul.children.length - 1;
15312
+ const selectedidx = Array.prototype.indexOf.call(ul.children, fli);
15313
+ const sidx = e.code === 'Home' ? 0 : selectedidx;
15314
+ const eidx = e.code === 'Home' ? selectedidx : ul.children.length - 1;
14963
15315
  for (let i = sidx; i <= eidx; i++) {
14964
15316
  const item = ul.children[i];
14965
15317
  this.notify('updatelist', { li: item, e: {
@@ -15113,7 +15465,6 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
15113
15465
  dvalue = this.getFormattedValue(li.getAttribute('data-value'));
15114
15466
  if (values.indexOf(dvalue) < 0) {
15115
15467
  li.getElementsByClassName('e-check')[0].classList.remove('e-check');
15116
- li.getElementsByClassName('e-checkbox-wrapper')[0].removeAttribute('aria-checked');
15117
15468
  li.removeAttribute('aria-selected');
15118
15469
  }
15119
15470
  });
@@ -15131,6 +15482,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
15131
15482
  else {
15132
15483
  text = value;
15133
15484
  }
15485
+ if (typeof (text) === 'string') {
15486
+ text = text.split("\\").join("\\\\");
15487
+ }
15134
15488
  li = this.list.querySelector('[data-value="' + text + '"]');
15135
15489
  if (li) {
15136
15490
  if (this.selectionSettings.showCheckbox) {
@@ -15459,6 +15813,12 @@ __decorate$6([
15459
15813
  __decorate$6([
15460
15814
  Property('')
15461
15815
  ], ListBox.prototype, "height", void 0);
15816
+ __decorate$6([
15817
+ Property(true)
15818
+ ], ListBox.prototype, "enabled", void 0);
15819
+ __decorate$6([
15820
+ Property(false)
15821
+ ], ListBox.prototype, "enablePersistence", void 0);
15462
15822
  __decorate$6([
15463
15823
  Property(false)
15464
15824
  ], ListBox.prototype, "allowDragAndDrop", void 0);
@@ -15533,6 +15893,1444 @@ const listBoxClasses = {
15533
15893
  clearIcon: 'e-clear-icon'
15534
15894
  };
15535
15895
 
15896
+ /**
15897
+ * export all modules from current location
15898
+ */
15899
+
15900
+ var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
15901
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15902
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
15903
+ 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;
15904
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
15905
+ };
15906
+ /**
15907
+ * The Mention component is used to list someone or something based on user input in textarea, input,
15908
+ * or any other editable element from which the user can select.
15909
+ */
15910
+ let Mention = class Mention extends DropDownBase {
15911
+ /**
15912
+ * * Constructor for creating the widget
15913
+ *
15914
+ * @param {MentionModel} options - Specifies the MentionComponent model.
15915
+ * @param {string | HTMLElement} element - Specifies the element to render as component.
15916
+ * @private
15917
+ */
15918
+ constructor(options, element) {
15919
+ super(options, element);
15920
+ }
15921
+ /**
15922
+ * When property value changes happened, then onPropertyChanged method will execute the respective changes in this component.
15923
+ *
15924
+ * @param {MentionModel} newProp - Returns the dynamic property value of the component.
15925
+ * @param {MentionModel} oldProp - Returns the previous property value of the component.
15926
+ * @private
15927
+ * @returns {void}
15928
+ */
15929
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
15930
+ onPropertyChanged(newProp, oldProp) {
15931
+ for (const prop of Object.keys(newProp)) {
15932
+ switch (prop) {
15933
+ case 'minLength':
15934
+ this.minLength = newProp.minLength;
15935
+ break;
15936
+ case 'suffixText':
15937
+ this.suffixText = newProp.suffixText;
15938
+ break;
15939
+ case 'allowSpaces':
15940
+ this.allowSpaces = newProp.allowSpaces;
15941
+ break;
15942
+ case 'mentionChar':
15943
+ this.mentionChar = newProp.mentionChar;
15944
+ break;
15945
+ case 'showMentionChar':
15946
+ this.showMentionChar = newProp.showMentionChar;
15947
+ break;
15948
+ case 'cssClass':
15949
+ this.updateCssClass(newProp.cssClass, oldProp.cssClass);
15950
+ break;
15951
+ }
15952
+ }
15953
+ }
15954
+ updateCssClass(newClass, oldClass) {
15955
+ if (!isNullOrUndefined(oldClass)) {
15956
+ oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
15957
+ }
15958
+ if (!isNullOrUndefined(newClass)) {
15959
+ newClass = (newClass.replace(/\s+/g, ' ')).trim();
15960
+ }
15961
+ this.setCssClass(newClass, [this.inputElement], oldClass);
15962
+ if (this.popupObj) {
15963
+ this.setCssClass(newClass, [this.popupObj.element], oldClass);
15964
+ }
15965
+ }
15966
+ setCssClass(cssClass$$1, elements, oldClass) {
15967
+ if (!isNullOrUndefined(oldClass) && oldClass !== '') {
15968
+ removeClass(elements, oldClass.split(' '));
15969
+ }
15970
+ if (!isNullOrUndefined(cssClass$$1) && cssClass$$1 !== '') {
15971
+ addClass(elements, cssClass$$1.split(' '));
15972
+ }
15973
+ }
15974
+ initializeData() {
15975
+ this.isSelected = false;
15976
+ this.isFiltered = false;
15977
+ this.beforePopupOpen = false;
15978
+ this.initRemoteRender = false;
15979
+ this.isListResetted = false;
15980
+ this.isPopupOpen = false;
15981
+ this.isCollided = false;
15982
+ this.lineBreak = false;
15983
+ this.keyConfigure = {
15984
+ tab: 'tab',
15985
+ enter: '13',
15986
+ escape: '27',
15987
+ end: '35',
15988
+ home: '36',
15989
+ down: '40',
15990
+ up: '38',
15991
+ pageUp: '33',
15992
+ pageDown: '34',
15993
+ open: 'alt+40',
15994
+ close: 'shift+tab',
15995
+ hide: 'alt+38',
15996
+ space: '32'
15997
+ };
15998
+ }
15999
+ /**
16000
+ * Execute before render the list items
16001
+ *
16002
+ * @private
16003
+ * @returns {void}
16004
+ */
16005
+ preRender() {
16006
+ this.initializeData();
16007
+ super.preRender();
16008
+ }
16009
+ /**
16010
+ * To Initialize the control rendering
16011
+ *
16012
+ * @private
16013
+ * @returns {void}
16014
+ */
16015
+ render() {
16016
+ this.inputElement = !isNullOrUndefined(this.target) ? ((typeof this.target) === 'string') ?
16017
+ document.querySelector(this.target) : this.target : this.element;
16018
+ if (this.isContentEditable(this.inputElement)) {
16019
+ this.inputElement.setAttribute('contenteditable', 'true');
16020
+ addClass([this.inputElement], ['e-mention']);
16021
+ if (isNullOrUndefined(this.target)) {
16022
+ addClass([this.inputElement], ['e-editable-element']);
16023
+ }
16024
+ }
16025
+ this.queryString = this.elementValue();
16026
+ this.wireEvent();
16027
+ }
16028
+ wireEvent() {
16029
+ EventHandler.add(this.inputElement, 'keyup', this.onKeyUp, this);
16030
+ this.bindCommonEvent();
16031
+ }
16032
+ unWireEvent() {
16033
+ EventHandler.remove(this.inputElement, 'keyup', this.onKeyUp);
16034
+ this.unBindCommonEvent();
16035
+ }
16036
+ bindCommonEvent() {
16037
+ if (!Browser.isDevice) {
16038
+ this.keyboardModule = new KeyboardEvents(this.inputElement, {
16039
+ keyAction: this.keyActionHandler.bind(this), keyConfigs: this.keyConfigure, eventName: 'keydown'
16040
+ });
16041
+ }
16042
+ }
16043
+ /**
16044
+ * Hides the spinner loader.
16045
+ *
16046
+ * @private
16047
+ * @returns {void}
16048
+ */
16049
+ hideSpinner() {
16050
+ this.hideWaitingSpinner();
16051
+ }
16052
+ hideWaitingSpinner() {
16053
+ if (!isNullOrUndefined(this.spinnerElement)) {
16054
+ hideSpinner(this.spinnerElement);
16055
+ }
16056
+ if (!isNullOrUndefined(this.spinnerTemplate) && !isNullOrUndefined(this.spinnerTemplateElement)) {
16057
+ detach(this.spinnerTemplateElement);
16058
+ }
16059
+ }
16060
+ /**
16061
+ * Shows the spinner loader.
16062
+ *
16063
+ * @returns {void}
16064
+ */
16065
+ showWaitingSpinner() {
16066
+ if (!isNullOrUndefined(this.popupObj)) {
16067
+ if (isNullOrUndefined(this.spinnerTemplate) && isNullOrUndefined(this.spinnerElement)) {
16068
+ this.spinnerElement = this.popupObj.element;
16069
+ createSpinner({
16070
+ target: this.spinnerElement,
16071
+ width: Browser.isDevice ? '16px' : '14px'
16072
+ }, this.createElement);
16073
+ showSpinner(this.spinnerElement);
16074
+ }
16075
+ if (!isNullOrUndefined(this.spinnerTemplate)) {
16076
+ this.setSpinnerTemplate();
16077
+ }
16078
+ }
16079
+ }
16080
+ keyActionHandler(e) {
16081
+ const isNavigation = (e.action === 'down' || e.action === 'up' || e.action === 'pageUp' || e.action === 'pageDown'
16082
+ || e.action === 'home' || e.action === 'end');
16083
+ const isTabAction = e.action === 'tab' || e.action === 'close';
16084
+ if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape' && e.action !== 'space') {
16085
+ this.renderList();
16086
+ }
16087
+ if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
16088
+ isNavigation && this.liCollections.length === 0) || this.isRequested) {
16089
+ return;
16090
+ }
16091
+ if (e.action === 'escape') {
16092
+ e.preventDefault();
16093
+ }
16094
+ this.isSelected = e.action === 'escape' ? false : this.isSelected;
16095
+ switch (e.action) {
16096
+ case 'down':
16097
+ case 'up':
16098
+ this.updateUpDownAction(e);
16099
+ break;
16100
+ case 'tab':
16101
+ if (this.isPopupOpen) {
16102
+ e.preventDefault();
16103
+ const li = this.list.querySelector('.' + dropDownBaseClasses.selected);
16104
+ if (li) {
16105
+ this.setSelection(li, e);
16106
+ }
16107
+ if (this.isPopupOpen) {
16108
+ this.hidePopup(e);
16109
+ }
16110
+ }
16111
+ break;
16112
+ case 'enter':
16113
+ if (this.isPopupOpen) {
16114
+ e.preventDefault();
16115
+ if (this.popupObj && this.popupObj.element.contains(this.selectedLI)) {
16116
+ this.setValue(e);
16117
+ }
16118
+ }
16119
+ break;
16120
+ case 'escape':
16121
+ if (this.isPopupOpen) {
16122
+ this.hidePopup(e);
16123
+ }
16124
+ break;
16125
+ }
16126
+ }
16127
+ updateUpDownAction(e) {
16128
+ const focusEle = this.list.querySelector('.' + dropDownBaseClasses.focus);
16129
+ if (this.isSelectFocusItem(focusEle)) {
16130
+ this.setSelection(focusEle, e);
16131
+ }
16132
+ else if (!isNullOrUndefined(this.liCollections)) {
16133
+ const li = this.list.querySelector('.' + dropDownBaseClasses.selected);
16134
+ if (!isNullOrUndefined(li)) {
16135
+ const value = this.getFormattedValue(li.getAttribute('data-value'));
16136
+ this.activeIndex = this.getIndexByValue(value);
16137
+ }
16138
+ let index = e.action === 'down' ? this.activeIndex + 1 : this.activeIndex - 1;
16139
+ let startIndex = 0;
16140
+ startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
16141
+ index = index < 0 ? this.liCollections.length - 1 : index === this.liCollections.length ? 0 : index;
16142
+ const nextItem = isNullOrUndefined(this.activeIndex) ?
16143
+ this.liCollections[startIndex] : this.liCollections[index];
16144
+ if (!isNullOrUndefined(nextItem)) {
16145
+ this.setSelection(nextItem, e);
16146
+ }
16147
+ }
16148
+ if (this.isPopupOpen) {
16149
+ e.preventDefault();
16150
+ }
16151
+ }
16152
+ isSelectFocusItem(element) {
16153
+ return !isNullOrUndefined(element);
16154
+ }
16155
+ unBindCommonEvent() {
16156
+ if (!Browser.isDevice) {
16157
+ this.keyboardModule.destroy();
16158
+ }
16159
+ }
16160
+ onKeyUp(e) {
16161
+ let rangetextContent;
16162
+ if (this.isContentEditable(this.inputElement)) {
16163
+ this.range = this.getCurrentRange();
16164
+ rangetextContent = this.range.startContainer.textContent.split('');
16165
+ }
16166
+ let currentRange = this.getTextRange();
16167
+ const lastWordRange = this.getLastLetter(currentRange);
16168
+ // eslint-disable-next-line security/detect-non-literal-regexp
16169
+ const Regex = new RegExp(this.mentionChar, 'g');
16170
+ const charRegex = new RegExp('[a-zA-Z]', 'g');
16171
+ if (e.key === 'Shift' || e.keyCode === 37 || e.keyCode === 39) {
16172
+ if ((e.keyCode === 37 || e.keyCode === 39) && !isNullOrUndefined(currentRange) &&
16173
+ currentRange.indexOf(this.mentionChar) === -1 && this.isPopupOpen) {
16174
+ this.hidePopup();
16175
+ }
16176
+ return;
16177
+ }
16178
+ if ((!currentRange || !lastWordRange) || e.code === 'Enter' || e.keyCode === 27 ||
16179
+ (lastWordRange.match(Regex) && lastWordRange.match(Regex).length > 1) ||
16180
+ (this.isContentEditable(this.inputElement) && this.range.startContainer &&
16181
+ this.range.startContainer.previousElementSibling && this.range.startContainer.textContent.split('').length > 0 &&
16182
+ (rangetextContent.length === 1 || rangetextContent[rangetextContent.length - 2].indexOf('') === -1 ||
16183
+ this.range.startContainer.nodeType === 1))) {
16184
+ if (this.allowSpaces && currentRange && currentRange.trim() !== '' && charRegex.test(currentRange) && currentRange.indexOf(this.mentionChar) !== -1
16185
+ && !this.isMatchedText() && (currentRange.length > 1 && currentRange.replace(/\u00A0/g, ' ').charAt(currentRange.length - 2) !== ' ') &&
16186
+ (this.list && this.list.querySelectorAll('ul').length > 0)) {
16187
+ this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
16188
+ this.searchLists(e);
16189
+ }
16190
+ else if (this.isPopupOpen && (!this.allowSpaces || !lastWordRange)) {
16191
+ this.hidePopup();
16192
+ this.lineBreak = true;
16193
+ }
16194
+ return;
16195
+ }
16196
+ this.queryString = lastWordRange.replace(this.mentionChar, '');
16197
+ if (this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0) &&
16198
+ this.queryString !== '' && e.keyCode !== 38 && e.keyCode !== 40 && !this.lineBreak) {
16199
+ this.searchLists(e);
16200
+ if (!this.isPopupOpen && this.queryString.length >= this.minLength) {
16201
+ if (!this.isContentEditable(this.inputElement)) {
16202
+ this.showPopup();
16203
+ }
16204
+ else if (this.isContentEditable(this.inputElement) && this.range && this.range.startContainer !== this.inputElement && e.keyCode !== 9) {
16205
+ this.showPopup();
16206
+ }
16207
+ }
16208
+ }
16209
+ else if (lastWordRange.indexOf(this.mentionChar) === 0 && !this.isPopupOpen && e.keyCode !== 8 && (!this.popupObj ||
16210
+ (isNullOrUndefined(this.target) && !document.body.contains(this.popupObj.element) ||
16211
+ !isNullOrUndefined(this.target) && document.body.contains(this.popupObj.element)))) {
16212
+ if (this.initRemoteRender && this.list && this.list.classList.contains('e-nodata')) {
16213
+ this.searchLists(e);
16214
+ }
16215
+ this.resetList(this.dataSource, this.fields);
16216
+ if (isNullOrUndefined(this.list)) {
16217
+ this.initValue();
16218
+ }
16219
+ if (!this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40) {
16220
+ this.showPopup();
16221
+ if (this.initRemoteRender && this.list.querySelectorAll('li').length === 0) {
16222
+ this.showWaitingSpinner();
16223
+ }
16224
+ this.lineBreak = false;
16225
+ }
16226
+ }
16227
+ else if (this.allowSpaces && this.queryString !== '' && currentRange && currentRange.trim() !== '' && currentRange.replace('\u00a0', ' ').lastIndexOf(' ') < currentRange.length - 1 &&
16228
+ e.keyCode !== 38 && e.keyCode !== 40 && e.keyCode !== 8 && this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0)) {
16229
+ this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
16230
+ this.searchLists(e);
16231
+ }
16232
+ else if (this.queryString === '' && this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40 && this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0)) {
16233
+ this.searchLists(e);
16234
+ if (!this.isListResetted) {
16235
+ this.resetList(this.dataSource, this.fields);
16236
+ }
16237
+ }
16238
+ this.isListResetted = false;
16239
+ }
16240
+ isMatchedText() {
16241
+ let isMatched = false;
16242
+ for (let i = 0; i < (this.liCollections && this.liCollections.length); i++) {
16243
+ if (this.getTextRange() &&
16244
+ this.getTextRange().substring(this.getTextRange().lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ').trim() === this.liCollections[i].getAttribute('data-value').toLowerCase()) {
16245
+ isMatched = true;
16246
+ }
16247
+ }
16248
+ return isMatched;
16249
+ }
16250
+ getCurrentRange() {
16251
+ this.range = this.inputElement.ownerDocument.getSelection().getRangeAt(0);
16252
+ return this.range;
16253
+ }
16254
+ searchLists(e) {
16255
+ this.isDataFetched = false;
16256
+ if (isNullOrUndefined(this.list)) {
16257
+ super.render();
16258
+ this.unWireListEvents();
16259
+ this.wireListEvents();
16260
+ }
16261
+ if (e.type !== 'mousedown' && (e.keyCode === 40 || e.keyCode === 38)) {
16262
+ this.queryString = this.queryString === '' ? null : this.queryString;
16263
+ this.beforePopupOpen = true;
16264
+ this.resetList(this.dataSource, this.fields);
16265
+ return;
16266
+ }
16267
+ this.isSelected = false;
16268
+ this.activeIndex = null;
16269
+ const eventArgs = {
16270
+ preventDefaultAction: false,
16271
+ text: this.queryString,
16272
+ updateData: (dataSource, query, fields) => {
16273
+ if (eventArgs.cancel) {
16274
+ return;
16275
+ }
16276
+ this.isFiltered = true;
16277
+ this.filterAction(dataSource, query, fields);
16278
+ },
16279
+ cancel: false
16280
+ };
16281
+ this.trigger('filtering', eventArgs, (eventArgs) => {
16282
+ if (!eventArgs.cancel && !this.isFiltered && !eventArgs.preventDefaultAction) {
16283
+ this.filterAction(this.dataSource, null, this.fields);
16284
+ }
16285
+ });
16286
+ }
16287
+ filterAction(dataSource, query, fields) {
16288
+ this.beforePopupOpen = true;
16289
+ if (this.queryString.length >= this.minLength) {
16290
+ this.resetList(dataSource, fields, query);
16291
+ this.isListResetted = true;
16292
+ }
16293
+ else {
16294
+ if (this.isPopupOpen) {
16295
+ this.hidePopup();
16296
+ }
16297
+ this.beforePopupOpen = false;
16298
+ }
16299
+ this.setDataIndex();
16300
+ this.renderReactTemplates();
16301
+ }
16302
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
16303
+ onActionComplete(ulElement, list, e, isUpdated) {
16304
+ super.onActionComplete(ulElement, list, e);
16305
+ if (this.isActive) {
16306
+ if (!isNullOrUndefined(ulElement)) {
16307
+ attributes(ulElement, { 'id': this.inputElement.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
16308
+ }
16309
+ let focusItem = ulElement.querySelector('.' + dropDownBaseClasses.li);
16310
+ if (focusItem) {
16311
+ focusItem.classList.add(dropDownBaseClasses.selected);
16312
+ this.selectedLI = focusItem;
16313
+ const value = this.getFormattedValue(focusItem.getAttribute('data-value'));
16314
+ this.selectEventCallback(focusItem, this.getDataByValue(value), value, true);
16315
+ }
16316
+ }
16317
+ }
16318
+ setDataIndex() {
16319
+ for (let i = 0; this.liCollections && i < this.liCollections.length; i++) {
16320
+ this.liCollections[i].setAttribute('data-index', i.toString());
16321
+ }
16322
+ }
16323
+ listOption(dataSource, fieldsSettings) {
16324
+ const fields = super.listOption(dataSource, fieldsSettings);
16325
+ if (isNullOrUndefined(fields.itemCreated)) {
16326
+ fields.itemCreated = (e) => {
16327
+ if (this.highlight) {
16328
+ if (this.inputElement.tagName === this.getNgDirective() && this.itemTemplate) {
16329
+ setTimeout(() => {
16330
+ highlightSearch(e.item, this.queryString, this.ignoreCase, this.filterType);
16331
+ }, 0);
16332
+ }
16333
+ else {
16334
+ highlightSearch(e.item, this.queryString, this.ignoreCase, this.filterType);
16335
+ }
16336
+ }
16337
+ };
16338
+ }
16339
+ else {
16340
+ const itemCreated = fields.itemCreated;
16341
+ fields.itemCreated = (e) => {
16342
+ if (this.highlight) {
16343
+ highlightSearch(e.item, this.queryString, this.ignoreCase, this.filterType);
16344
+ }
16345
+ itemCreated.apply(this, [e]);
16346
+ };
16347
+ }
16348
+ return fields;
16349
+ }
16350
+ elementValue() {
16351
+ if (!this.isContentEditable(this.inputElement)) {
16352
+ return this.inputElement.value.replace(this.mentionChar, '');
16353
+ }
16354
+ else {
16355
+ return this.inputElement.textContent.replace(this.mentionChar, '');
16356
+ }
16357
+ }
16358
+ getQuery(query) {
16359
+ const filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
16360
+ const filterType = (this.queryString === '' && !isNullOrUndefined(this.elementValue())) ? 'equal' : this.filterType;
16361
+ const queryString = (this.queryString === '' && !isNullOrUndefined(this.elementValue())) ?
16362
+ this.elementValue() : this.queryString;
16363
+ if (this.isFiltered) {
16364
+ return filterQuery;
16365
+ }
16366
+ if (this.queryString !== null && this.queryString !== '') {
16367
+ const dataType = this.typeOfData(this.dataSource).typeof;
16368
+ if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
16369
+ filterQuery.where('', filterType, queryString, this.ignoreCase, this.ignoreAccent);
16370
+ }
16371
+ else {
16372
+ const mapping = !isNullOrUndefined(this.fields.text) ? this.fields.text : '';
16373
+ filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
16374
+ }
16375
+ }
16376
+ if (!isNullOrUndefined(this.suggestionCount)) {
16377
+ // Since defualt value of suggestioncount is 25, checked the condition
16378
+ if (this.suggestionCount !== 25) {
16379
+ for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
16380
+ if (filterQuery.queries[queryElements].fn === 'onTake') {
16381
+ filterQuery.queries.splice(queryElements, 1);
16382
+ }
16383
+ }
16384
+ }
16385
+ filterQuery.take(this.suggestionCount);
16386
+ }
16387
+ return filterQuery;
16388
+ }
16389
+ renderHightSearch() {
16390
+ if (this.highlight) {
16391
+ for (let i = 0; i < this.liCollections.length; i++) {
16392
+ const isHighlight = this.ulElement.querySelector('.e-active');
16393
+ if (!isHighlight) {
16394
+ revertHighlightSearch(this.liCollections[i]);
16395
+ highlightSearch(this.liCollections[i], this.queryString, this.ignoreCase, this.filterType);
16396
+ }
16397
+ }
16398
+ }
16399
+ }
16400
+ getTextRange() {
16401
+ let text;
16402
+ if (!this.isContentEditable(this.inputElement)) {
16403
+ const component = this.inputElement;
16404
+ if (!isNullOrUndefined(component)) {
16405
+ const startPos = component.selectionStart;
16406
+ if (component.value && startPos >= 0) {
16407
+ text = component.value.substring(0, startPos);
16408
+ }
16409
+ }
16410
+ }
16411
+ else {
16412
+ if (this.range) {
16413
+ const selectedElem = this.range.startContainer;
16414
+ if (!isNullOrUndefined(selectedElem)) {
16415
+ const workingNodeContent = selectedElem.textContent;
16416
+ const selectStartOffset = this.range.startOffset;
16417
+ if (workingNodeContent && selectStartOffset >= 0) {
16418
+ text = workingNodeContent.substring(0, selectStartOffset);
16419
+ }
16420
+ }
16421
+ }
16422
+ }
16423
+ return text;
16424
+ }
16425
+ getLastLetter(text) {
16426
+ if (isNullOrUndefined(text)) {
16427
+ return '';
16428
+ }
16429
+ const textValue = text.replace(/\u00A0/g, ' ');
16430
+ const words = textValue.split(/\s+/);
16431
+ const wordCnt = words.length - 1;
16432
+ return words[wordCnt].trim();
16433
+ }
16434
+ isContentEditable(element) {
16435
+ return element && element.nodeName !== 'INPUT' && element.nodeName !== 'TEXTAREA';
16436
+ }
16437
+ /**
16438
+ * Opens the popup that displays the list of items.
16439
+ *
16440
+ * @returns {void}
16441
+ */
16442
+ showPopup() {
16443
+ this.beforePopupOpen = true;
16444
+ if (isNullOrUndefined(this.list)) {
16445
+ this.initValue();
16446
+ }
16447
+ this.renderPopup();
16448
+ attributes(this.inputElement, { 'aria-activedescendant': this.selectedElementID });
16449
+ if (this.selectedElementID == null) {
16450
+ this.inputElement.removeAttribute('aria-activedescendant');
16451
+ }
16452
+ }
16453
+ /* eslint-disable valid-jsdoc, jsdoc/require-param */
16454
+ /**
16455
+ * Hides the popup if it is in an open state.
16456
+ *
16457
+ * @returns {void}
16458
+ */
16459
+ hidePopup(e) {
16460
+ this.removeSelection();
16461
+ this.closePopup(0, e);
16462
+ }
16463
+ closePopup(delay, e) {
16464
+ if (!(this.popupObj && document.body.contains(this.popupObj.element) && this.beforePopupOpen)) {
16465
+ return;
16466
+ }
16467
+ EventHandler.remove(document, 'mousedown', this.onDocumentClick);
16468
+ this.inputElement.removeAttribute('aria-owns');
16469
+ this.inputElement.removeAttribute('aria-activedescendant');
16470
+ this.beforePopupOpen = false;
16471
+ const animModel = {
16472
+ name: 'FadeOut',
16473
+ duration: 100,
16474
+ delay: delay ? delay : 0
16475
+ };
16476
+ const popupInstance = this.popupObj;
16477
+ const eventArgs = { popup: popupInstance, cancel: false, animation: animModel, event: e || null };
16478
+ this.trigger('closed', eventArgs, (eventArgs) => {
16479
+ if (!eventArgs.cancel && this.popupObj) {
16480
+ if (this.isPopupOpen) {
16481
+ this.popupObj.hide(new Animation(eventArgs.animation));
16482
+ }
16483
+ else {
16484
+ this.destroyPopup();
16485
+ }
16486
+ }
16487
+ });
16488
+ }
16489
+ renderPopup() {
16490
+ const args = { cancel: false };
16491
+ this.trigger('beforeOpen', args, (args) => {
16492
+ if (!args.cancel) {
16493
+ let popupEle;
16494
+ if (isNullOrUndefined(this.target)) {
16495
+ popupEle = this.createElement('div', {
16496
+ id: this.inputElement.id + '_popup', className: 'e-mention e-popup ' + (this.cssClass != null ? this.cssClass : '')
16497
+ });
16498
+ }
16499
+ else {
16500
+ popupEle = this.element;
16501
+ if (this.cssClass != null) {
16502
+ addClass([popupEle], this.cssClass.split(' '));
16503
+ }
16504
+ }
16505
+ if (!isNullOrUndefined(this.target)) {
16506
+ popupEle.id = this.inputElement.id + '_popup';
16507
+ addClass([popupEle], ['e-mention', 'e-popup', 'e-popup-close']);
16508
+ }
16509
+ this.listHeight = formatUnit(this.popupHeight);
16510
+ if (!isNullOrUndefined(this.list.querySelector('li')) && !this.initRemoteRender) {
16511
+ const li = this.list.querySelector('.' + dropDownBaseClasses.focus);
16512
+ if (!isNullOrUndefined(li)) {
16513
+ this.selectedLI = li;
16514
+ const value = this.getFormattedValue(li.getAttribute('data-value'));
16515
+ this.selectEventCallback(li, this.getDataByValue(value), value, true);
16516
+ }
16517
+ }
16518
+ append([this.list], popupEle);
16519
+ if ((!this.popupObj || !document.body.contains(this.popupObj.element)) ||
16520
+ !document.contains(popupEle) && isNullOrUndefined(this.target)) {
16521
+ document.body.appendChild(popupEle);
16522
+ }
16523
+ let coordinates;
16524
+ popupEle.style.visibility = 'hidden';
16525
+ this.setHeight(popupEle);
16526
+ const offsetValue = 0;
16527
+ const left = 0;
16528
+ this.initializePopup(popupEle, offsetValue, left);
16529
+ this.checkCollision(popupEle);
16530
+ popupEle.style.visibility = 'visible';
16531
+ if (!isNullOrUndefined(this.list)) {
16532
+ this.unWireListEvents();
16533
+ this.wireListEvents();
16534
+ }
16535
+ this.selectedElementID = this.selectedLI ? this.selectedLI.id : null;
16536
+ attributes(this.inputElement, { 'aria-owns': this.inputElement.id + '_options', 'aria-activedescendant': this.selectedElementID });
16537
+ if (this.selectedElementID == null) {
16538
+ this.inputElement.removeAttribute('aria-activedescendant');
16539
+ }
16540
+ const animModel = { name: 'FadeIn', duration: 100 };
16541
+ this.beforePopupOpen = true;
16542
+ const popupInstance = this.popupObj;
16543
+ const eventArgs = { popup: popupInstance, cancel: false, animation: animModel };
16544
+ this.trigger('opened', eventArgs, (eventArgs) => {
16545
+ if (!eventArgs.cancel) {
16546
+ this.renderReactTemplates();
16547
+ this.popupObj.show(new Animation(eventArgs.animation), (this.zIndex === 1000) ? this.inputElement : null);
16548
+ if (isNullOrUndefined(this.getTriggerCharPosition())) {
16549
+ return;
16550
+ }
16551
+ coordinates = this.getCoordinates(this.inputElement, this.getTriggerCharPosition());
16552
+ if (!this.isCollided) {
16553
+ popupEle.style.cssText = 'top: '.concat(coordinates.top.toString(), 'px;\n left: ').concat(coordinates.left.toString(), 'px;\nposition: absolute;\n display: block;');
16554
+ }
16555
+ else {
16556
+ popupEle.style.left = formatUnit(coordinates.left);
16557
+ this.isCollided = false;
16558
+ }
16559
+ popupEle.style.width = this.popupWidth !== '100%' && !isNullOrUndefined(this.popupWidth) ? formatUnit(this.popupWidth) : 'auto';
16560
+ this.setHeight(popupEle);
16561
+ popupEle.style.zIndex = this.zIndex === 1000 ? getZindexPartial(popupEle).toString() : this.zIndex.toString();
16562
+ }
16563
+ else {
16564
+ this.beforePopupOpen = false;
16565
+ this.destroyPopup();
16566
+ }
16567
+ });
16568
+ }
16569
+ else {
16570
+ this.beforePopupOpen = false;
16571
+ }
16572
+ });
16573
+ }
16574
+ setHeight(popupEle) {
16575
+ if (this.popupHeight !== 'auto') {
16576
+ this.list.style.maxHeight = (parseInt(this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
16577
+ popupEle.style.maxHeight = formatUnit(this.popupHeight);
16578
+ }
16579
+ else {
16580
+ popupEle.style.height = 'auto';
16581
+ }
16582
+ }
16583
+ checkCollision(popupEle) {
16584
+ if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
16585
+ const collision = isCollide(popupEle);
16586
+ if (collision.length > 0) {
16587
+ popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
16588
+ this.isCollided = true;
16589
+ }
16590
+ this.popupObj.resolveCollision();
16591
+ }
16592
+ }
16593
+ getTriggerCharPosition() {
16594
+ let mostRecentTriggerCharPos;
16595
+ const currentRange = this.getTextRange();
16596
+ if (currentRange !== undefined && currentRange !== null) {
16597
+ mostRecentTriggerCharPos = 0;
16598
+ const idx = currentRange.lastIndexOf(this.mentionChar);
16599
+ if (idx >= mostRecentTriggerCharPos) {
16600
+ mostRecentTriggerCharPos = idx;
16601
+ }
16602
+ }
16603
+ return mostRecentTriggerCharPos;
16604
+ }
16605
+ initializePopup(element, offsetValue, left) {
16606
+ this.popupObj = new Popup(element, {
16607
+ width: this.setWidth(), targetType: 'relative',
16608
+ relateTo: this.inputElement, collision: { X: 'flip', Y: 'flip' }, offsetY: offsetValue,
16609
+ enableRtl: this.enableRtl, offsetX: left, position: { X: 'top', Y: 'left' }, actionOnScroll: 'hide',
16610
+ zIndex: this.zIndex,
16611
+ close: () => {
16612
+ this.destroyPopup();
16613
+ },
16614
+ open: () => {
16615
+ EventHandler.add(document, 'mousedown', this.onDocumentClick, this);
16616
+ this.isPopupOpen = true;
16617
+ this.setDataIndex();
16618
+ }
16619
+ });
16620
+ }
16621
+ setWidth() {
16622
+ let width = formatUnit(this.popupWidth);
16623
+ if (width.indexOf('%') > -1) {
16624
+ const inputWidth = this.inputElement.offsetWidth * parseFloat(width) / 100;
16625
+ width = inputWidth.toString() + 'px';
16626
+ }
16627
+ return width;
16628
+ }
16629
+ destroyPopup() {
16630
+ this.isPopupOpen = false;
16631
+ this.popupObj.destroy();
16632
+ if (isNullOrUndefined(this.target)) {
16633
+ detach(this.popupObj.element);
16634
+ }
16635
+ else {
16636
+ this.popupObj.element.innerHTML = '';
16637
+ this.popupObj.element.removeAttribute('style');
16638
+ this.popupObj.element.removeAttribute('aria-disabled');
16639
+ }
16640
+ }
16641
+ onDocumentClick(e) {
16642
+ const target = e.target;
16643
+ if (!(!isNullOrUndefined(this.popupObj) && closest(target, '#' + this.popupObj.element.id))) {
16644
+ this.hidePopup(e);
16645
+ }
16646
+ }
16647
+ getCoordinates(element, position) {
16648
+ const 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'];
16649
+ let div;
16650
+ let span;
16651
+ let range;
16652
+ let globalRange;
16653
+ let coordinates;
16654
+ let computed;
16655
+ let rect;
16656
+ if (!this.isContentEditable(this.inputElement)) {
16657
+ div = this.createElement('div', { className: 'e-form-mirror-div' });
16658
+ document.body.appendChild(div);
16659
+ computed = getComputedStyle(element);
16660
+ div.style.position = 'absolute';
16661
+ div.style.visibility = 'hidden';
16662
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16663
+ properties.forEach((prop) => {
16664
+ // eslint-disable-next-line security/detect-object-injection
16665
+ div.style[prop] = computed[prop];
16666
+ });
16667
+ div.textContent = element.value.substring(0, position);
16668
+ if (this.inputElement.nodeName === 'INPUT') {
16669
+ div.textContent = div.textContent.replace(/\s/g, '\u00a0');
16670
+ }
16671
+ span = this.createElement('span');
16672
+ span.textContent = element.value.substring(position) || '.';
16673
+ div.appendChild(span);
16674
+ rect = element.getBoundingClientRect();
16675
+ }
16676
+ else {
16677
+ const selectedNodePosition = this.getTriggerCharPosition();
16678
+ globalRange = this.range;
16679
+ range = document.createRange();
16680
+ range.setStart(globalRange.startContainer, selectedNodePosition);
16681
+ range.setEnd(globalRange.startContainer, selectedNodePosition);
16682
+ range.collapse(false);
16683
+ rect = range.getBoundingClientRect();
16684
+ }
16685
+ const doc = document.documentElement;
16686
+ const windowLeft = (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);
16687
+ const windowTop = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
16688
+ if (!this.isContentEditable(this.inputElement)) {
16689
+ coordinates = {
16690
+ top: rect.top + windowTop + span.offsetTop + parseInt(computed.borderTopWidth, 10) +
16691
+ parseInt(computed.fontSize, 10) + 3 - element.scrollTop,
16692
+ left: rect.left + windowLeft + span.offsetLeft + parseInt(computed.borderLeftWidth, 10)
16693
+ };
16694
+ document.body.removeChild(div);
16695
+ }
16696
+ else {
16697
+ coordinates = {
16698
+ top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10),
16699
+ left: rect.left + windowLeft
16700
+ };
16701
+ }
16702
+ return coordinates;
16703
+ }
16704
+ initValue() {
16705
+ this.renderList();
16706
+ if (this.dataSource instanceof DataManager) {
16707
+ this.initRemoteRender = true;
16708
+ }
16709
+ else {
16710
+ this.updateValues();
16711
+ }
16712
+ }
16713
+ updateValues() {
16714
+ const li = this.list.querySelector('.' + dropDownBaseClasses.focus);
16715
+ if (!isNullOrUndefined(li)) {
16716
+ this.setSelection(li, null);
16717
+ }
16718
+ }
16719
+ renderList() {
16720
+ super.render();
16721
+ this.unWireListEvents();
16722
+ this.wireListEvents();
16723
+ }
16724
+ /**
16725
+ * Event binding for list
16726
+ *
16727
+ * @returns {void}
16728
+ */
16729
+ wireListEvents() {
16730
+ EventHandler.add(this.list, 'click', this.onMouseClick, this);
16731
+ EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
16732
+ EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
16733
+ }
16734
+ /**
16735
+ * Event un binding for list items.
16736
+ *
16737
+ * @returns {void}
16738
+ */
16739
+ unWireListEvents() {
16740
+ EventHandler.remove(this.list, 'click', this.onMouseClick);
16741
+ EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
16742
+ EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
16743
+ }
16744
+ onMouseClick(e) {
16745
+ const target = e.target;
16746
+ const li = closest(target, '.' + dropDownBaseClasses.li);
16747
+ if (!this.isValidLI(li)) {
16748
+ return;
16749
+ }
16750
+ this.setSelection(li, e);
16751
+ const delay = 100;
16752
+ this.closePopup(delay, e);
16753
+ this.inputElement.focus();
16754
+ }
16755
+ updateSelectedItem(li, e, preventSelect, isSelection) {
16756
+ this.removeSelection();
16757
+ li.classList.add(dropDownBaseClasses.selected);
16758
+ this.removeHover();
16759
+ const value = this.getFormattedValue(li.getAttribute('data-value'));
16760
+ const selectedData = this.getDataByValue(value);
16761
+ if (!preventSelect && !isNullOrUndefined(e)) {
16762
+ const items = this.detachChanges(selectedData);
16763
+ this.isSelected = true;
16764
+ const eventArgs = {
16765
+ e: e,
16766
+ item: li,
16767
+ itemData: items,
16768
+ isInteracted: e ? true : false,
16769
+ cancel: false
16770
+ };
16771
+ this.trigger('select', eventArgs, (eventArgs) => {
16772
+ if (eventArgs.cancel) {
16773
+ li.classList.remove(dropDownBaseClasses.selected);
16774
+ }
16775
+ else {
16776
+ this.selectEventCallback(li, selectedData, value);
16777
+ if (isSelection) {
16778
+ this.setSelectOptions(li, e);
16779
+ }
16780
+ }
16781
+ });
16782
+ }
16783
+ else {
16784
+ this.selectEventCallback(li, selectedData, value);
16785
+ if (isSelection) {
16786
+ this.setSelectOptions(li, e);
16787
+ }
16788
+ }
16789
+ }
16790
+ setSelection(li, e) {
16791
+ if (this.isValidLI(li) && (!li.classList.contains(dropDownBaseClasses.selected) || (this.isPopupOpen && this.isSelected
16792
+ && li.classList.contains(dropDownBaseClasses.selected)))) {
16793
+ this.updateSelectedItem(li, e, false, true);
16794
+ }
16795
+ else {
16796
+ this.setSelectOptions(li, e);
16797
+ }
16798
+ }
16799
+ setSelectOptions(li, e) {
16800
+ if (this.list) {
16801
+ this.removeHover();
16802
+ }
16803
+ this.previousSelectedLI = (!isNullOrUndefined(this.selectedLI)) ? this.selectedLI : null;
16804
+ this.selectedLI = li;
16805
+ if (this.isPopupOpen && !isNullOrUndefined(this.selectedLI)) {
16806
+ this.setScrollPosition(e);
16807
+ }
16808
+ if (e && (e.keyCode === 38 || e.keyCode === 40)) {
16809
+ return;
16810
+ }
16811
+ if (isNullOrUndefined(e) || this.setValue(e)) {
16812
+ return;
16813
+ }
16814
+ }
16815
+ setScrollPosition(e) {
16816
+ if (!isNullOrUndefined(e)) {
16817
+ switch (e.action) {
16818
+ case 'pageDown':
16819
+ case 'down':
16820
+ case 'end':
16821
+ this.scrollBottom();
16822
+ break;
16823
+ default:
16824
+ this.scrollTop();
16825
+ break;
16826
+ }
16827
+ }
16828
+ else {
16829
+ this.scrollBottom(true);
16830
+ }
16831
+ }
16832
+ scrollBottom(isInitial) {
16833
+ if (!isNullOrUndefined(this.selectedLI)) {
16834
+ const currentOffset = this.list.offsetHeight;
16835
+ const nextBottom = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
16836
+ let nextOffset = this.list.scrollTop + nextBottom - currentOffset;
16837
+ nextOffset = isInitial ? nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10) * 2 : nextOffset;
16838
+ const boxRange = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
16839
+ if (this.activeIndex === 0) {
16840
+ this.list.scrollTop = 0;
16841
+ }
16842
+ else if (nextBottom > currentOffset || !(boxRange > 0 && this.list.offsetHeight > boxRange)) {
16843
+ this.list.scrollTop = nextOffset;
16844
+ }
16845
+ }
16846
+ }
16847
+ scrollTop() {
16848
+ if (!isNullOrUndefined(this.selectedLI)) {
16849
+ let nextOffset = this.selectedLI.offsetTop - this.list.scrollTop;
16850
+ nextOffset = this.fields.groupBy && nextOffset;
16851
+ const boxRange = (this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop);
16852
+ if (this.activeIndex === 0) {
16853
+ this.list.scrollTop = 0;
16854
+ }
16855
+ else if (nextOffset < 0) {
16856
+ this.list.scrollTop = this.list.scrollTop + nextOffset;
16857
+ }
16858
+ else if (!(boxRange > 0 && this.list.offsetHeight > boxRange)) {
16859
+ this.list.scrollTop = this.selectedLI.offsetTop;
16860
+ }
16861
+ }
16862
+ }
16863
+ selectEventCallback(li, selectedData, value, selectLi) {
16864
+ this.previousItemData = (!isNullOrUndefined(this.itemData)) ? this.itemData : null;
16865
+ this.item = li;
16866
+ this.itemData = selectedData;
16867
+ const focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
16868
+ if (focusedItem) {
16869
+ removeClass([focusedItem], dropDownBaseClasses.focus);
16870
+ }
16871
+ if (selectLi) {
16872
+ addClass([li], dropDownBaseClasses.selected);
16873
+ }
16874
+ li.setAttribute('aria-selected', 'true');
16875
+ this.activeIndex = this.getIndexByValue(value);
16876
+ }
16877
+ detachChanges(value) {
16878
+ let items;
16879
+ if (typeof value === 'string' ||
16880
+ typeof value === 'boolean' ||
16881
+ typeof value === 'number') {
16882
+ items = Object.defineProperties({}, {
16883
+ value: {
16884
+ value: value,
16885
+ enumerable: true
16886
+ },
16887
+ text: {
16888
+ value: value,
16889
+ enumerable: true
16890
+ }
16891
+ });
16892
+ }
16893
+ else {
16894
+ items = value;
16895
+ }
16896
+ return items;
16897
+ }
16898
+ setValue(e) {
16899
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16900
+ if (!this.isReact) {
16901
+ if (!isNullOrUndefined(this.displayTemplate)) {
16902
+ this.setDisplayTemplate();
16903
+ }
16904
+ this.updateMentionValue(e);
16905
+ return true;
16906
+ }
16907
+ else {
16908
+ if (!isNullOrUndefined(this.displayTemplate)) {
16909
+ this.setDisplayTemplate(e);
16910
+ }
16911
+ else {
16912
+ this.updateMentionValue(e);
16913
+ }
16914
+ return true;
16915
+ }
16916
+ }
16917
+ updateMentionValue(e) {
16918
+ const dataItem = this.getItemData();
16919
+ let textSuffix;
16920
+ let value;
16921
+ let endPos;
16922
+ let range;
16923
+ let globalRange;
16924
+ const selection = this.inputElement.ownerDocument.getSelection();
16925
+ const startPos = this.getTriggerCharPosition();
16926
+ textSuffix = typeof this.suffixText === 'string' ? this.suffixText : '';
16927
+ if (dataItem.text !== null) {
16928
+ value = this.mentionVal(dataItem.text);
16929
+ }
16930
+ if (!this.isContentEditable(this.inputElement)) {
16931
+ const myField = this.inputElement;
16932
+ const currentTriggerSnippet = this.getTextRange().substring(startPos + this.mentionChar.length, this.getTextRange().length);
16933
+ value += textSuffix;
16934
+ endPos = startPos + this.mentionChar.length;
16935
+ endPos += currentTriggerSnippet.length;
16936
+ myField.value = myField.value.substring(0, startPos) + value + myField.value.substring(endPos, myField.value.length);
16937
+ myField.selectionStart = startPos + value.length;
16938
+ myField.selectionEnd = startPos + value.length;
16939
+ if (this.isPopupOpen) {
16940
+ this.hidePopup();
16941
+ }
16942
+ this.onChangeEvent(e);
16943
+ }
16944
+ else {
16945
+ endPos = this.getTriggerCharPosition() + this.mentionChar.length;
16946
+ if (this.range && (this.range.startContainer.textContent.trim() !== this.mentionChar)) {
16947
+ endPos = this.range.endOffset;
16948
+ }
16949
+ globalRange = this.range;
16950
+ range = document.createRange();
16951
+ range.setStart(globalRange.startContainer, startPos);
16952
+ range.setEnd(globalRange.startContainer, endPos);
16953
+ range.deleteContents();
16954
+ const element = this.createElement('div');
16955
+ element.innerHTML = value;
16956
+ const frag = document.createDocumentFragment();
16957
+ let node;
16958
+ let lastNode;
16959
+ // eslint-disable-next-line no-cond-assign
16960
+ while (node = element.firstChild) {
16961
+ lastNode = frag.appendChild(node);
16962
+ }
16963
+ range.insertNode(frag);
16964
+ if (lastNode) {
16965
+ range = range.cloneRange();
16966
+ range.setStartAfter(lastNode);
16967
+ range.collapse(true);
16968
+ selection.removeAllRanges();
16969
+ selection.addRange(range);
16970
+ }
16971
+ if (this.isPopupOpen) {
16972
+ this.hidePopup();
16973
+ }
16974
+ this.onChangeEvent(e);
16975
+ }
16976
+ }
16977
+ mentionVal(value) {
16978
+ const showChar = this.showMentionChar ? this.mentionChar : '';
16979
+ if (!isNullOrUndefined(this.displayTemplate) && !isNullOrUndefined(this.displayTempElement)) {
16980
+ value = this.displayTempElement.innerHTML;
16981
+ }
16982
+ if (this.isContentEditable(this.inputElement)) {
16983
+ return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
16984
+ }
16985
+ else {
16986
+ return showChar + value;
16987
+ }
16988
+ }
16989
+ setDisplayTemplate(e) {
16990
+ let compiledString;
16991
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16992
+ if (this.isReact) {
16993
+ this.clearTemplate(['displayTemplate']);
16994
+ if (this.displayTempElement) {
16995
+ detach(this.displayTempElement);
16996
+ this.displayTempElement = null;
16997
+ }
16998
+ }
16999
+ if (!this.displayTempElement) {
17000
+ this.displayTempElement = this.createElement('div');
17001
+ }
17002
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17003
+ if (!this.isReact) {
17004
+ this.displayTempElement.innerHTML = '';
17005
+ }
17006
+ compiledString = compile(this.displayTemplate);
17007
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17008
+ const displayCompTemp = compiledString(this.itemData, this, 'displayTemplate', this.displayTemplateId, this.isStringTemplate, null, this.displayTempElement);
17009
+ if (displayCompTemp && displayCompTemp.length > 0) {
17010
+ for (let i = 0; i < displayCompTemp.length; i++) {
17011
+ this.displayTempElement.appendChild(displayCompTemp[i]);
17012
+ }
17013
+ }
17014
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17015
+ if (!this.isReact) {
17016
+ this.renderTemplates();
17017
+ }
17018
+ else {
17019
+ this.renderTemplates(() => {
17020
+ this.updateMentionValue(e);
17021
+ });
17022
+ }
17023
+ }
17024
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17025
+ renderTemplates(callBack) {
17026
+ this.renderReactTemplates(callBack);
17027
+ }
17028
+ setSpinnerTemplate() {
17029
+ let compiledString;
17030
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17031
+ if (this.isReact) {
17032
+ this.clearTemplate(['spinnerTemplate']);
17033
+ if (this.spinnerTemplateElement) {
17034
+ detach(this.spinnerTemplateElement);
17035
+ this.spinnerTemplateElement = null;
17036
+ }
17037
+ }
17038
+ if (!this.spinnerTemplateElement) {
17039
+ this.spinnerTemplateElement = this.createElement('div');
17040
+ }
17041
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17042
+ if (!this.isReact) {
17043
+ this.spinnerTemplateElement.innerHTML = '';
17044
+ }
17045
+ compiledString = compile(this.spinnerTemplate);
17046
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17047
+ const spinnerCompTemp = compiledString(null, this, 'spinnerTemplate', this.spinnerTemplateId, this.isStringTemplate, null, this.spinnerTemplateElement);
17048
+ if (spinnerCompTemp && spinnerCompTemp.length > 0) {
17049
+ for (let i = 0; i < spinnerCompTemp.length; i++) {
17050
+ this.spinnerTemplateElement.appendChild(spinnerCompTemp[i]);
17051
+ }
17052
+ }
17053
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17054
+ if (!this.isReact) {
17055
+ this.renderTemplates();
17056
+ this.popupObj.element.appendChild(this.spinnerTemplateElement);
17057
+ }
17058
+ else {
17059
+ this.renderTemplates(() => {
17060
+ this.popupObj.element.appendChild(this.spinnerTemplateElement);
17061
+ });
17062
+ }
17063
+ }
17064
+ onChangeEvent(eve) {
17065
+ this.isSelected = false;
17066
+ const items = this.detachMentionChanges(this.itemData);
17067
+ let preItems;
17068
+ if (typeof this.previousItemData === 'string' ||
17069
+ typeof this.previousItemData === 'boolean' ||
17070
+ typeof this.previousItemData === 'number') {
17071
+ preItems = Object.defineProperties({}, {
17072
+ value: {
17073
+ value: this.previousItemData,
17074
+ enumerable: true
17075
+ },
17076
+ text: {
17077
+ value: this.previousItemData,
17078
+ enumerable: true
17079
+ }
17080
+ });
17081
+ }
17082
+ else {
17083
+ preItems = this.previousItemData;
17084
+ }
17085
+ const eventArgs = {
17086
+ e: eve,
17087
+ item: this.item,
17088
+ itemData: items,
17089
+ previousItem: this.previousSelectedLI,
17090
+ previousItemData: preItems,
17091
+ isInteracted: eve ? true : false,
17092
+ value: this.item.innerHTML,
17093
+ element: this.inputElement
17094
+ };
17095
+ this.trigger('change', eventArgs);
17096
+ }
17097
+ detachMentionChanges(value) {
17098
+ let items;
17099
+ if (typeof value === 'string' ||
17100
+ typeof value === 'boolean' ||
17101
+ typeof value === 'number') {
17102
+ items = Object.defineProperties({}, {
17103
+ value: {
17104
+ value: value,
17105
+ enumerable: true
17106
+ },
17107
+ text: {
17108
+ value: value,
17109
+ enumerable: true
17110
+ }
17111
+ });
17112
+ }
17113
+ else {
17114
+ items = value;
17115
+ }
17116
+ return items;
17117
+ }
17118
+ getItemData() {
17119
+ const fields = this.fields;
17120
+ let dataItem = null;
17121
+ dataItem = this.itemData;
17122
+ let dataValue;
17123
+ let dataText;
17124
+ if (!isNullOrUndefined(dataItem)) {
17125
+ dataValue = getValue(fields.value, dataItem);
17126
+ dataText = getValue(fields.text, dataItem);
17127
+ }
17128
+ const value = (!isNullOrUndefined(dataItem) &&
17129
+ !isUndefined(dataValue) ? dataValue : dataItem);
17130
+ const text = (!isNullOrUndefined(dataItem) &&
17131
+ !isUndefined(dataValue) ? dataText : dataItem);
17132
+ return { value: value, text: text };
17133
+ }
17134
+ removeSelection() {
17135
+ if (this.list) {
17136
+ const selectedItems = this.list.querySelectorAll('.' + dropDownBaseClasses.selected);
17137
+ if (selectedItems.length) {
17138
+ removeClass(selectedItems, dropDownBaseClasses.selected);
17139
+ selectedItems[0].removeAttribute('aria-selected');
17140
+ }
17141
+ }
17142
+ }
17143
+ onMouseOver(e) {
17144
+ const currentLi = closest(e.target, '.' + dropDownBaseClasses.li);
17145
+ this.setHover(currentLi);
17146
+ }
17147
+ setHover(li) {
17148
+ if (this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.hover)) {
17149
+ this.removeHover();
17150
+ addClass([li], dropDownBaseClasses.hover);
17151
+ }
17152
+ }
17153
+ removeHover() {
17154
+ if (this.list) {
17155
+ const hoveredItem = this.list.querySelectorAll('.' + dropDownBaseClasses.hover);
17156
+ if (hoveredItem && hoveredItem.length) {
17157
+ removeClass(hoveredItem, dropDownBaseClasses.hover);
17158
+ }
17159
+ }
17160
+ }
17161
+ isValidLI(li) {
17162
+ return (li && li.hasAttribute('role') && li.getAttribute('role') === 'option');
17163
+ }
17164
+ onMouseLeave() {
17165
+ this.removeHover();
17166
+ }
17167
+ /**
17168
+ * Search the entered text and show it in the suggestion list if available.
17169
+ *
17170
+ * @returns {void}
17171
+ */
17172
+ search(text, positionX, positionY) {
17173
+ if (this.isContentEditable(this.inputElement)) {
17174
+ this.range = this.getCurrentRange();
17175
+ }
17176
+ const currentRange = this.getTextRange();
17177
+ const lastWordRange = this.getLastLetter(currentRange);
17178
+ if ((this.ignoreCase && (text === lastWordRange || text === lastWordRange.toLowerCase()))
17179
+ || !this.ignoreCase && text === lastWordRange) {
17180
+ this.resetList(this.dataSource, this.fields);
17181
+ }
17182
+ else {
17183
+ if (this.isPopupOpen) {
17184
+ this.hidePopup();
17185
+ }
17186
+ return;
17187
+ }
17188
+ if (isNullOrUndefined(this.list)) {
17189
+ this.renderList();
17190
+ this.renderPopup();
17191
+ }
17192
+ else {
17193
+ this.showPopup();
17194
+ }
17195
+ this.popupObj.element.style.left = formatUnit(positionX);
17196
+ this.popupObj.element.style.top = formatUnit(positionY);
17197
+ }
17198
+ /**
17199
+ * Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
17200
+ *
17201
+ * @method destroy
17202
+ * @returns {void}
17203
+ */
17204
+ destroy() {
17205
+ this.hidePopup();
17206
+ this.unWireEvent();
17207
+ if (this.list) {
17208
+ this.unWireListEvents();
17209
+ }
17210
+ if (this.inputElement && !this.inputElement.classList.contains('e-' + this.getModuleName())) {
17211
+ return;
17212
+ }
17213
+ super.destroy();
17214
+ }
17215
+ getLocaleName() {
17216
+ return 'mention';
17217
+ }
17218
+ getNgDirective() {
17219
+ return 'EJS-MENTION';
17220
+ }
17221
+ /**
17222
+ * Return the module name of this component.
17223
+ *
17224
+ * @private
17225
+ * @returns {string} Return the module name of this component.
17226
+ */
17227
+ getModuleName() {
17228
+ return 'mention';
17229
+ }
17230
+ };
17231
+ __decorate$7([
17232
+ Property(null)
17233
+ ], Mention.prototype, "cssClass", void 0);
17234
+ __decorate$7([
17235
+ Property('@')
17236
+ ], Mention.prototype, "mentionChar", void 0);
17237
+ __decorate$7([
17238
+ Property(false)
17239
+ ], Mention.prototype, "showMentionChar", void 0);
17240
+ __decorate$7([
17241
+ Property(false)
17242
+ ], Mention.prototype, "allowSpaces", void 0);
17243
+ __decorate$7([
17244
+ Property(null)
17245
+ ], Mention.prototype, "suffixText", void 0);
17246
+ __decorate$7([
17247
+ Property(25)
17248
+ ], Mention.prototype, "suggestionCount", void 0);
17249
+ __decorate$7([
17250
+ Property(0)
17251
+ ], Mention.prototype, "minLength", void 0);
17252
+ __decorate$7([
17253
+ Property('None')
17254
+ ], Mention.prototype, "sortOrder", void 0);
17255
+ __decorate$7([
17256
+ Property(true)
17257
+ ], Mention.prototype, "ignoreCase", void 0);
17258
+ __decorate$7([
17259
+ Property(false)
17260
+ ], Mention.prototype, "highlight", void 0);
17261
+ __decorate$7([
17262
+ Property()
17263
+ ], Mention.prototype, "locale", void 0);
17264
+ __decorate$7([
17265
+ Property('auto')
17266
+ ], Mention.prototype, "popupWidth", void 0);
17267
+ __decorate$7([
17268
+ Property('300px')
17269
+ ], Mention.prototype, "popupHeight", void 0);
17270
+ __decorate$7([
17271
+ Property(null)
17272
+ ], Mention.prototype, "displayTemplate", void 0);
17273
+ __decorate$7([
17274
+ Property(null)
17275
+ ], Mention.prototype, "itemTemplate", void 0);
17276
+ __decorate$7([
17277
+ Property('No records found')
17278
+ ], Mention.prototype, "noRecordsTemplate", void 0);
17279
+ __decorate$7([
17280
+ Property(null)
17281
+ ], Mention.prototype, "spinnerTemplate", void 0);
17282
+ __decorate$7([
17283
+ Property()
17284
+ ], Mention.prototype, "target", void 0);
17285
+ __decorate$7([
17286
+ Property([])
17287
+ ], Mention.prototype, "dataSource", void 0);
17288
+ __decorate$7([
17289
+ Property(null)
17290
+ ], Mention.prototype, "query", void 0);
17291
+ __decorate$7([
17292
+ Property('Contains')
17293
+ ], Mention.prototype, "filterType", void 0);
17294
+ __decorate$7([
17295
+ Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
17296
+ ], Mention.prototype, "fields", void 0);
17297
+ __decorate$7([
17298
+ Event()
17299
+ ], Mention.prototype, "actionBegin", void 0);
17300
+ __decorate$7([
17301
+ Event()
17302
+ ], Mention.prototype, "actionComplete", void 0);
17303
+ __decorate$7([
17304
+ Event()
17305
+ ], Mention.prototype, "actionFailure", void 0);
17306
+ __decorate$7([
17307
+ Event()
17308
+ ], Mention.prototype, "change", void 0);
17309
+ __decorate$7([
17310
+ Event()
17311
+ ], Mention.prototype, "beforeOpen", void 0);
17312
+ __decorate$7([
17313
+ Event()
17314
+ ], Mention.prototype, "opened", void 0);
17315
+ __decorate$7([
17316
+ Event()
17317
+ ], Mention.prototype, "closed", void 0);
17318
+ __decorate$7([
17319
+ Event()
17320
+ ], Mention.prototype, "select", void 0);
17321
+ __decorate$7([
17322
+ Event()
17323
+ ], Mention.prototype, "filtering", void 0);
17324
+ __decorate$7([
17325
+ Event()
17326
+ ], Mention.prototype, "created", void 0);
17327
+ __decorate$7([
17328
+ Event()
17329
+ ], Mention.prototype, "destroyed", void 0);
17330
+ Mention = __decorate$7([
17331
+ NotifyPropertyChanges
17332
+ ], Mention);
17333
+
15536
17334
  /**
15537
17335
  * export all modules from current location
15538
17336
  */
@@ -15541,5 +17339,5 @@ const listBoxClasses = {
15541
17339
  * export all modules from current location
15542
17340
  */
15543
17341
 
15544
- 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 };
17342
+ 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 };
15545
17343
  //# sourceMappingURL=ej2-dropdowns.es2015.js.map