@syncfusion/ej2-dropdowns 20.2.48 → 20.3.47

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 (362) hide show
  1. package/CHANGELOG.md +14 -28
  2. package/dist/ej2-dropdowns.min.js +10 -0
  3. package/dist/ej2-dropdowns.umd.min.js +2 -2
  4. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-dropdowns.es2015.js +1437 -47
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +1463 -51
  8. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  9. package/dist/global/ej2-dropdowns.min.js +2 -2
  10. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/mention.d.ts +4 -0
  13. package/mention.js +4 -0
  14. package/package.json +12 -12
  15. package/src/auto-complete/auto-complete.js +6 -2
  16. package/src/combo-box/combo-box.js +1 -3
  17. package/src/drop-down-base/drop-down-base.d.ts +2 -0
  18. package/src/drop-down-base/drop-down-base.js +6 -1
  19. package/src/drop-down-list/drop-down-list.d.ts +1 -0
  20. package/src/drop-down-list/drop-down-list.js +33 -21
  21. package/src/index.d.ts +1 -0
  22. package/src/index.js +1 -0
  23. package/src/list-box/list-box.js +16 -11
  24. package/src/mention/index.d.ts +5 -0
  25. package/src/mention/index.js +4 -0
  26. package/src/mention/mention-model.d.ts +285 -0
  27. package/src/mention/mention.d.ts +451 -0
  28. package/src/mention/mention.js +1369 -0
  29. package/src/multi-select/checkbox-selection.js +1 -4
  30. package/src/multi-select/multi-select-model.d.ts +1 -1
  31. package/src/multi-select/multi-select.d.ts +1 -0
  32. package/src/multi-select/multi-select.js +35 -9
  33. package/styles/auto-complete/_all.scss +1 -1
  34. package/styles/auto-complete/_bootstrap-dark-definition.scss +1 -1
  35. package/styles/auto-complete/_bootstrap-definition.scss +1 -1
  36. package/styles/auto-complete/_bootstrap4-definition.scss +2 -2
  37. package/styles/auto-complete/_bootstrap5-definition.scss +1 -1
  38. package/styles/auto-complete/_fabric-dark-definition.scss +1 -1
  39. package/styles/auto-complete/_fabric-definition.scss +1 -1
  40. package/styles/auto-complete/_fluent-definition.scss +1 -1
  41. package/styles/auto-complete/_fusionnew-definition.scss +1 -1
  42. package/styles/auto-complete/_highcontrast-definition.scss +1 -1
  43. package/styles/auto-complete/_highcontrast-light-definition.scss +1 -1
  44. package/styles/auto-complete/_material-dark-definition.scss +1 -1
  45. package/styles/auto-complete/_material-definition.scss +1 -1
  46. package/styles/auto-complete/_material3-definition.scss +1 -1
  47. package/styles/auto-complete/_tailwind-definition.scss +1 -1
  48. package/styles/auto-complete/bootstrap-dark.css +3 -1
  49. package/styles/auto-complete/bootstrap.css +3 -1
  50. package/styles/auto-complete/bootstrap4.css +3 -1
  51. package/styles/auto-complete/bootstrap5-dark.css +3 -1
  52. package/styles/auto-complete/bootstrap5.css +3 -1
  53. package/styles/auto-complete/fabric-dark.css +3 -1
  54. package/styles/auto-complete/fabric.css +3 -1
  55. package/styles/auto-complete/fluent-dark.css +3 -1
  56. package/styles/auto-complete/fluent.css +3 -1
  57. package/styles/auto-complete/highcontrast-light.css +3 -1
  58. package/styles/auto-complete/highcontrast.css +3 -1
  59. package/styles/auto-complete/material-dark.css +3 -1
  60. package/styles/auto-complete/material.css +3 -1
  61. package/styles/auto-complete/tailwind-dark.css +3 -1
  62. package/styles/auto-complete/tailwind.css +3 -1
  63. package/styles/bootstrap-dark.css +94 -42
  64. package/styles/bootstrap-dark.scss +1 -0
  65. package/styles/bootstrap.css +94 -42
  66. package/styles/bootstrap.scss +1 -0
  67. package/styles/bootstrap4.css +95 -42
  68. package/styles/bootstrap4.scss +1 -0
  69. package/styles/bootstrap5-dark.css +101 -44
  70. package/styles/bootstrap5-dark.scss +1 -0
  71. package/styles/bootstrap5.css +101 -44
  72. package/styles/bootstrap5.scss +1 -0
  73. package/styles/combo-box/_all.scss +1 -1
  74. package/styles/combo-box/_bootstrap-dark-definition.scss +1 -1
  75. package/styles/combo-box/_bootstrap-definition.scss +1 -1
  76. package/styles/combo-box/_bootstrap4-definition.scss +2 -2
  77. package/styles/combo-box/_bootstrap5-definition.scss +1 -1
  78. package/styles/combo-box/_fabric-dark-definition.scss +1 -1
  79. package/styles/combo-box/_fabric-definition.scss +1 -1
  80. package/styles/combo-box/_fluent-definition.scss +1 -1
  81. package/styles/combo-box/_fusionnew-definition.scss +1 -1
  82. package/styles/combo-box/_highcontrast-definition.scss +1 -1
  83. package/styles/combo-box/_highcontrast-light-definition.scss +1 -1
  84. package/styles/combo-box/_material-dark-definition.scss +1 -1
  85. package/styles/combo-box/_material-definition.scss +1 -1
  86. package/styles/combo-box/_material3-definition.scss +1 -1
  87. package/styles/combo-box/_tailwind-definition.scss +1 -1
  88. package/styles/combo-box/bootstrap-dark.css +3 -1
  89. package/styles/combo-box/bootstrap.css +3 -1
  90. package/styles/combo-box/bootstrap4.css +3 -1
  91. package/styles/combo-box/bootstrap5-dark.css +3 -1
  92. package/styles/combo-box/bootstrap5.css +3 -1
  93. package/styles/combo-box/fabric-dark.css +3 -1
  94. package/styles/combo-box/fabric.css +3 -1
  95. package/styles/combo-box/fluent-dark.css +3 -1
  96. package/styles/combo-box/fluent.css +3 -1
  97. package/styles/combo-box/highcontrast-light.css +3 -1
  98. package/styles/combo-box/highcontrast.css +3 -1
  99. package/styles/combo-box/material-dark.css +3 -1
  100. package/styles/combo-box/material.css +3 -1
  101. package/styles/combo-box/tailwind-dark.css +3 -1
  102. package/styles/combo-box/tailwind.css +3 -1
  103. package/styles/drop-down-base/_all.scss +1 -1
  104. package/styles/drop-down-base/_bootstrap-dark-definition.scss +8 -2
  105. package/styles/drop-down-base/_bootstrap-definition.scss +6 -1
  106. package/styles/drop-down-base/_bootstrap4-definition.scss +6 -1
  107. package/styles/drop-down-base/_bootstrap5-definition.scss +8 -3
  108. package/styles/drop-down-base/_fabric-dark-definition.scss +6 -1
  109. package/styles/drop-down-base/_fabric-definition.scss +6 -1
  110. package/styles/drop-down-base/_fluent-definition.scss +8 -2
  111. package/styles/drop-down-base/_fusionnew-definition.scss +8 -3
  112. package/styles/drop-down-base/_highcontrast-definition.scss +16 -6
  113. package/styles/drop-down-base/_highcontrast-light-definition.scss +18 -7
  114. package/styles/drop-down-base/_layout.scss +44 -3
  115. package/styles/drop-down-base/_material-dark-definition.scss +7 -1
  116. package/styles/drop-down-base/_material-definition.scss +6 -0
  117. package/styles/drop-down-base/_material3-definition.scss +8 -3
  118. package/styles/drop-down-base/_tailwind-definition.scss +8 -3
  119. package/styles/drop-down-base/_theme.scss +4 -4
  120. package/styles/drop-down-base/bootstrap-dark.css +42 -1
  121. package/styles/drop-down-base/bootstrap.css +42 -1
  122. package/styles/drop-down-base/bootstrap4.css +42 -1
  123. package/styles/drop-down-base/bootstrap5-dark.css +42 -1
  124. package/styles/drop-down-base/bootstrap5.css +42 -1
  125. package/styles/drop-down-base/fabric-dark.css +42 -1
  126. package/styles/drop-down-base/fabric.css +42 -1
  127. package/styles/drop-down-base/fluent-dark.css +42 -1
  128. package/styles/drop-down-base/fluent.css +42 -1
  129. package/styles/drop-down-base/highcontrast-light.css +42 -1
  130. package/styles/drop-down-base/highcontrast.css +42 -1
  131. package/styles/drop-down-base/material-dark.css +42 -1
  132. package/styles/drop-down-base/material.css +42 -1
  133. package/styles/drop-down-base/tailwind-dark.css +42 -1
  134. package/styles/drop-down-base/tailwind.css +42 -1
  135. package/styles/drop-down-list/_all.scss +2 -1
  136. package/styles/drop-down-list/_bootstrap-dark-definition.scss +2 -1
  137. package/styles/drop-down-list/_bootstrap-definition.scss +2 -1
  138. package/styles/drop-down-list/_bootstrap4-definition.scss +3 -1
  139. package/styles/drop-down-list/_bootstrap5-definition.scss +3 -3
  140. package/styles/drop-down-list/_fabric-dark-definition.scss +2 -1
  141. package/styles/drop-down-list/_fabric-definition.scss +2 -0
  142. package/styles/drop-down-list/_fluent-definition.scss +2 -1
  143. package/styles/drop-down-list/_fusionnew-definition.scss +3 -3
  144. package/styles/drop-down-list/_highcontrast-definition.scss +21 -10
  145. package/styles/drop-down-list/_highcontrast-light-definition.scss +22 -11
  146. package/styles/drop-down-list/_layout.scss +8 -9
  147. package/styles/drop-down-list/_material-dark-definition.scss +2 -2
  148. package/styles/drop-down-list/_material-definition.scss +1 -0
  149. package/styles/drop-down-list/_material3-definition.scss +3 -3
  150. package/styles/drop-down-list/_tailwind-definition.scss +1 -0
  151. package/styles/drop-down-list/_theme.scss +3 -3
  152. package/styles/drop-down-list/bootstrap-dark.css +5 -0
  153. package/styles/drop-down-list/bootstrap.css +5 -0
  154. package/styles/drop-down-list/bootstrap4.css +5 -0
  155. package/styles/drop-down-list/bootstrap5-dark.css +6 -0
  156. package/styles/drop-down-list/bootstrap5.css +6 -0
  157. package/styles/drop-down-list/fabric-dark.css +5 -0
  158. package/styles/drop-down-list/fabric.css +5 -0
  159. package/styles/drop-down-list/fluent-dark.css +6 -0
  160. package/styles/drop-down-list/fluent.css +6 -0
  161. package/styles/drop-down-list/highcontrast-light.css +5 -0
  162. package/styles/drop-down-list/highcontrast.css +5 -0
  163. package/styles/drop-down-list/icons/_bootstrap.scss +0 -1
  164. package/styles/drop-down-list/icons/_fabric.scss +0 -1
  165. package/styles/drop-down-list/icons/_material.scss +0 -1
  166. package/styles/drop-down-list/material-dark.css +5 -0
  167. package/styles/drop-down-list/material.css +5 -0
  168. package/styles/drop-down-list/tailwind-dark.css +6 -0
  169. package/styles/drop-down-list/tailwind.css +6 -0
  170. package/styles/drop-down-tree/_all.scss +1 -1
  171. package/styles/drop-down-tree/_bootstrap-dark-definition.scss +1 -1
  172. package/styles/drop-down-tree/_bootstrap-definition.scss +1 -1
  173. package/styles/drop-down-tree/_bootstrap4-definition.scss +1 -1
  174. package/styles/drop-down-tree/_bootstrap5-definition.scss +2 -2
  175. package/styles/drop-down-tree/_fabric-dark-definition.scss +1 -1
  176. package/styles/drop-down-tree/_fabric-definition.scss +2 -2
  177. package/styles/drop-down-tree/_fluent-definition.scss +2 -2
  178. package/styles/drop-down-tree/_fusionnew-definition.scss +2 -2
  179. package/styles/drop-down-tree/_highcontrast-definition.scss +1 -1
  180. package/styles/drop-down-tree/_highcontrast-light-definition.scss +1 -1
  181. package/styles/drop-down-tree/_layout.scss +1 -2
  182. package/styles/drop-down-tree/_material-dark-definition.scss +2 -2
  183. package/styles/drop-down-tree/_material-definition.scss +2 -2
  184. package/styles/drop-down-tree/_material3-definition.scss +2 -2
  185. package/styles/drop-down-tree/_tailwind-definition.scss +2 -2
  186. package/styles/drop-down-tree/bootstrap-dark.css +4 -0
  187. package/styles/drop-down-tree/bootstrap.css +4 -0
  188. package/styles/drop-down-tree/bootstrap4.css +4 -0
  189. package/styles/drop-down-tree/bootstrap5-dark.css +5 -0
  190. package/styles/drop-down-tree/bootstrap5.css +5 -0
  191. package/styles/drop-down-tree/fabric-dark.css +4 -0
  192. package/styles/drop-down-tree/fabric.css +4 -0
  193. package/styles/drop-down-tree/fluent-dark.css +5 -0
  194. package/styles/drop-down-tree/fluent.css +5 -0
  195. package/styles/drop-down-tree/highcontrast-light.css +4 -0
  196. package/styles/drop-down-tree/highcontrast.css +4 -0
  197. package/styles/drop-down-tree/icons/_bootstrap.scss +0 -1
  198. package/styles/drop-down-tree/icons/_bootstrap4.scss +0 -1
  199. package/styles/drop-down-tree/icons/_fabric.scss +0 -1
  200. package/styles/drop-down-tree/icons/_highcontrast-light.scss +0 -1
  201. package/styles/drop-down-tree/icons/_highcontrast.scss +0 -1
  202. package/styles/drop-down-tree/icons/_material-dark.scss +0 -1
  203. package/styles/drop-down-tree/icons/_material.scss +0 -1
  204. package/styles/drop-down-tree/material-dark.css +4 -0
  205. package/styles/drop-down-tree/material.css +4 -0
  206. package/styles/drop-down-tree/tailwind-dark.css +5 -0
  207. package/styles/drop-down-tree/tailwind.css +5 -0
  208. package/styles/fabric-dark.css +94 -42
  209. package/styles/fabric-dark.scss +1 -0
  210. package/styles/fabric.css +94 -42
  211. package/styles/fabric.scss +1 -0
  212. package/styles/fluent-dark.css +101 -44
  213. package/styles/fluent-dark.scss +1 -0
  214. package/styles/fluent.css +101 -44
  215. package/styles/fluent.scss +1 -0
  216. package/styles/highcontrast-light.css +97 -42
  217. package/styles/highcontrast-light.scss +1 -0
  218. package/styles/highcontrast.css +97 -42
  219. package/styles/highcontrast.scss +1 -0
  220. package/styles/list-box/_all.scss +1 -1
  221. package/styles/list-box/_bootstrap-dark-definition.scss +2 -0
  222. package/styles/list-box/_bootstrap-definition.scss +1 -0
  223. package/styles/list-box/_bootstrap4-definition.scss +1 -0
  224. package/styles/list-box/_bootstrap5-definition.scss +3 -0
  225. package/styles/list-box/_fabric-dark-definition.scss +3 -1
  226. package/styles/list-box/_fabric-definition.scss +1 -0
  227. package/styles/list-box/_fluent-definition.scss +3 -0
  228. package/styles/list-box/_fusionnew-definition.scss +1 -0
  229. package/styles/list-box/_highcontrast-definition.scss +1 -0
  230. package/styles/list-box/_highcontrast-light-definition.scss +3 -1
  231. package/styles/list-box/_layout.scss +8 -17
  232. package/styles/list-box/_material-dark-definition.scss +2 -0
  233. package/styles/list-box/_material-definition.scss +1 -0
  234. package/styles/list-box/_material3-definition.scss +1 -0
  235. package/styles/list-box/_tailwind-definition.scss +3 -0
  236. package/styles/list-box/_theme.scss +11 -25
  237. package/styles/list-box/bootstrap-dark.css +12 -33
  238. package/styles/list-box/bootstrap.css +14 -35
  239. package/styles/list-box/bootstrap4.css +14 -35
  240. package/styles/list-box/bootstrap5-dark.css +15 -36
  241. package/styles/list-box/bootstrap5.css +15 -36
  242. package/styles/list-box/fabric-dark.css +12 -33
  243. package/styles/list-box/fabric.css +14 -35
  244. package/styles/list-box/fluent-dark.css +15 -36
  245. package/styles/list-box/fluent.css +15 -36
  246. package/styles/list-box/highcontrast-light.css +12 -33
  247. package/styles/list-box/highcontrast.css +14 -35
  248. package/styles/list-box/icons/_bootstrap-dark.scss +2 -2
  249. package/styles/list-box/icons/_bootstrap.scss +1 -1
  250. package/styles/list-box/icons/_bootstrap4.scss +1 -1
  251. package/styles/list-box/icons/_bootstrap5.scss +1 -1
  252. package/styles/list-box/icons/_fabric-dark.scss +1 -1
  253. package/styles/list-box/icons/_fabric.scss +1 -1
  254. package/styles/list-box/icons/_fluent.scss +1 -1
  255. package/styles/list-box/icons/_fusionnew.scss +1 -1
  256. package/styles/list-box/icons/_highcontrast-light.scss +1 -1
  257. package/styles/list-box/icons/_highcontrast.scss +1 -1
  258. package/styles/list-box/icons/_material-dark.scss +1 -1
  259. package/styles/list-box/icons/_material.scss +2 -2
  260. package/styles/list-box/icons/_material3.scss +1 -1
  261. package/styles/list-box/icons/_tailwind-dark.scss +1 -1
  262. package/styles/list-box/icons/_tailwind.scss +1 -1
  263. package/styles/list-box/material-dark.css +12 -33
  264. package/styles/list-box/material.css +14 -35
  265. package/styles/list-box/tailwind-dark.css +15 -36
  266. package/styles/list-box/tailwind.css +15 -36
  267. package/styles/material-dark.css +94 -42
  268. package/styles/material-dark.scss +1 -0
  269. package/styles/material.css +94 -42
  270. package/styles/material.scss +1 -0
  271. package/styles/mention/_all.scss +1 -0
  272. package/styles/mention/_bootstrap-dark-definition.scss +3 -0
  273. package/styles/mention/_bootstrap-definition.scss +3 -0
  274. package/styles/mention/_bootstrap4-definition.scss +3 -0
  275. package/styles/mention/_bootstrap5-dark-definition.scss +1 -0
  276. package/styles/mention/_bootstrap5-definition.scss +1 -0
  277. package/styles/mention/_fabric-dark-definition.scss +2 -0
  278. package/styles/mention/_fabric-definition.scss +3 -0
  279. package/styles/mention/_fluent-dark-definition.scss +1 -0
  280. package/styles/mention/_fluent-definition.scss +1 -0
  281. package/styles/mention/_fusionnew-definition.scss +1 -0
  282. package/styles/mention/_highcontrast-definition.scss +3 -0
  283. package/styles/mention/_highcontrast-light-definition.scss +3 -0
  284. package/styles/mention/_layout.scss +6 -0
  285. package/styles/mention/_material-dark-definition.scss +3 -0
  286. package/styles/mention/_material-definition.scss +3 -0
  287. package/styles/mention/_material3-definition.scss +1 -0
  288. package/styles/mention/_tailwind-dark-definition.scss +1 -0
  289. package/styles/mention/_tailwind-definition.scss +1 -0
  290. package/styles/mention/bootstrap-dark.css +29 -0
  291. package/styles/mention/bootstrap-dark.scss +6 -0
  292. package/styles/mention/bootstrap.css +29 -0
  293. package/styles/mention/bootstrap.scss +6 -0
  294. package/styles/mention/bootstrap4.css +47 -0
  295. package/styles/mention/bootstrap4.scss +6 -0
  296. package/styles/mention/bootstrap5-dark.css +58 -0
  297. package/styles/mention/bootstrap5-dark.scss +6 -0
  298. package/styles/mention/bootstrap5.css +58 -0
  299. package/styles/mention/bootstrap5.scss +6 -0
  300. package/styles/mention/fabric-dark.css +29 -0
  301. package/styles/mention/fabric-dark.scss +6 -0
  302. package/styles/mention/fabric.css +29 -0
  303. package/styles/mention/fabric.scss +6 -0
  304. package/styles/mention/fluent-dark.css +58 -0
  305. package/styles/mention/fluent-dark.scss +6 -0
  306. package/styles/mention/fluent.css +58 -0
  307. package/styles/mention/fluent.scss +6 -0
  308. package/styles/mention/highcontrast-light.css +43 -0
  309. package/styles/mention/highcontrast-light.scss +6 -0
  310. package/styles/mention/highcontrast.css +43 -0
  311. package/styles/mention/highcontrast.scss +6 -0
  312. package/styles/mention/material-dark.css +29 -0
  313. package/styles/mention/material-dark.scss +6 -0
  314. package/styles/mention/material.css +29 -0
  315. package/styles/mention/material.scss +6 -0
  316. package/styles/mention/tailwind-dark.css +68 -0
  317. package/styles/mention/tailwind-dark.scss +6 -0
  318. package/styles/mention/tailwind.css +68 -0
  319. package/styles/mention/tailwind.scss +6 -0
  320. package/styles/multi-select/_all.scss +1 -1
  321. package/styles/multi-select/_bootstrap-dark-definition.scss +4 -1
  322. package/styles/multi-select/_bootstrap-definition.scss +2 -0
  323. package/styles/multi-select/_bootstrap4-definition.scss +5 -2
  324. package/styles/multi-select/_bootstrap5-definition.scss +2 -2
  325. package/styles/multi-select/_fabric-dark-definition.scss +5 -3
  326. package/styles/multi-select/_fabric-definition.scss +4 -2
  327. package/styles/multi-select/_fluent-definition.scss +2 -1
  328. package/styles/multi-select/_fusionnew-definition.scss +2 -2
  329. package/styles/multi-select/_highcontrast-definition.scss +47 -24
  330. package/styles/multi-select/_highcontrast-light-definition.scss +48 -25
  331. package/styles/multi-select/_layout.scss +59 -71
  332. package/styles/multi-select/_material-dark-definition.scss +3 -1
  333. package/styles/multi-select/_material-definition.scss +1 -0
  334. package/styles/multi-select/_material3-definition.scss +2 -2
  335. package/styles/multi-select/_tailwind-definition.scss +2 -3
  336. package/styles/multi-select/_theme.scss +16 -21
  337. package/styles/multi-select/bootstrap-dark.css +10 -6
  338. package/styles/multi-select/bootstrap.css +10 -6
  339. package/styles/multi-select/bootstrap4.css +10 -6
  340. package/styles/multi-select/bootstrap5-dark.css +11 -6
  341. package/styles/multi-select/bootstrap5.css +11 -6
  342. package/styles/multi-select/fabric-dark.css +10 -6
  343. package/styles/multi-select/fabric.css +10 -6
  344. package/styles/multi-select/fluent-dark.css +11 -6
  345. package/styles/multi-select/fluent.css +11 -6
  346. package/styles/multi-select/highcontrast-light.css +13 -6
  347. package/styles/multi-select/highcontrast.css +13 -6
  348. package/styles/multi-select/icons/_bootstrap5.scss +0 -1
  349. package/styles/multi-select/icons/_fluent.scss +0 -1
  350. package/styles/multi-select/icons/_fusionnew.scss +0 -1
  351. package/styles/multi-select/icons/_material-dark.scss +53 -54
  352. package/styles/multi-select/icons/_material.scss +53 -54
  353. package/styles/multi-select/icons/_material3.scss +0 -1
  354. package/styles/multi-select/icons/_tailwind.scss +0 -1
  355. package/styles/multi-select/material-dark.css +10 -6
  356. package/styles/multi-select/material.css +10 -6
  357. package/styles/multi-select/tailwind-dark.css +11 -6
  358. package/styles/multi-select/tailwind.css +11 -6
  359. package/styles/tailwind-dark.css +102 -44
  360. package/styles/tailwind-dark.scss +1 -0
  361. package/styles/tailwind.css +102 -44
  362. package/styles/tailwind.scss +1 -0
@@ -214,6 +214,8 @@ const dropDownBaseClasses = {
214
214
  grouping: 'e-dd-group'
215
215
  };
216
216
  const ITEMTEMPLATE_PROPERTY = 'ItemTemplate';
217
+ const DISPLAYTEMPLATE_PROPERTY = 'DisplayTemplate';
218
+ const SPINNERTEMPLATE_PROPERTY = 'SpinnerTemplate';
217
219
  const VALUETEMPLATE_PROPERTY = 'ValueTemplate';
218
220
  const GROUPTEMPLATE_PROPERTY = 'GroupTemplate';
219
221
  const HEADERTEMPLATE_PROPERTY = 'HeaderTemplate';
@@ -416,6 +418,7 @@ let DropDownBase = class DropDownBase extends Component {
416
418
  liElem.textContent = content;
417
419
  ele.appendChild(liElem);
418
420
  liElem.classList.add('e-list-nrt');
421
+ liElem.setAttribute('role', 'option');
419
422
  }
420
423
  else {
421
424
  ele.innerHTML = content;
@@ -509,7 +512,7 @@ let DropDownBase = class DropDownBase extends Component {
509
512
  * @returns {void}
510
513
  */
511
514
  updateDataAttribute(value) {
512
- const invalidAttr = ['class', 'style', 'id', 'type'];
515
+ const invalidAttr = ['class', 'style', 'id', 'type', 'aria-expanded', 'aria-autocomplete', 'aria-readonly'];
513
516
  const attr = {};
514
517
  for (let a = 0; a < this.element.attributes.length; a++) {
515
518
  if (invalidAttr.indexOf(this.element.attributes[a].name) === -1 &&
@@ -576,6 +579,8 @@ let DropDownBase = class DropDownBase extends Component {
576
579
  this.isRequested = false;
577
580
  this.isDataFetched = false;
578
581
  this.itemTemplateId = `${this.element.id}${ITEMTEMPLATE_PROPERTY}`;
582
+ this.displayTemplateId = `${this.element.id}${DISPLAYTEMPLATE_PROPERTY}`;
583
+ this.spinnerTemplateId = `${this.element.id}${SPINNERTEMPLATE_PROPERTY}`;
579
584
  this.valueTemplateId = `${this.element.id}${VALUETEMPLATE_PROPERTY}`;
580
585
  this.groupTemplateId = `${this.element.id}${GROUPTEMPLATE_PROPERTY}`;
581
586
  this.headerTemplateId = `${this.element.id}${HEADERTEMPLATE_PROPERTY}`;
@@ -1674,8 +1679,8 @@ let DropDownList = class DropDownList extends DropDownBase {
1674
1679
  this.inputWrapper.container.setAttribute('style', this.htmlAttributes[htmlAttr]);
1675
1680
  }
1676
1681
  else {
1677
- const defaultAttr = ['title', 'id', 'placeholder', 'aria-placeholder',
1678
- 'role', 'autocorrect', 'autocomplete', 'autocapitalize', 'spellcheck', 'minlength', 'maxlength'];
1682
+ const defaultAttr = ['title', 'id', 'placeholder',
1683
+ 'role', 'autocomplete', 'autocapitalize', 'spellcheck', 'minlength', 'maxlength'];
1679
1684
  const validateAttr = ['name', 'required'];
1680
1685
  if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
1681
1686
  defaultAttr.push('tabindex');
@@ -1704,11 +1709,8 @@ let DropDownList = class DropDownList extends DropDownBase {
1704
1709
  getAriaAttributes() {
1705
1710
  return {
1706
1711
  'aria-disabled': 'false',
1707
- 'aria-owns': this.element.id + '_options',
1708
1712
  'role': 'combobox',
1709
- 'aria-haspopup': 'true',
1710
1713
  'aria-expanded': 'false',
1711
- 'aria-activedescendant': 'null',
1712
1714
  'aria-live': 'polite',
1713
1715
  'aria-labelledby': this.hiddenElement.id
1714
1716
  };
@@ -2428,10 +2430,6 @@ let DropDownList = class DropDownList extends DropDownBase {
2428
2430
  if (this.setValue(e)) {
2429
2431
  return;
2430
2432
  }
2431
- attributes(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
2432
- if (this.isFilterLayout() && this.filterInput) {
2433
- attributes(this.filterInput, { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
2434
- }
2435
2433
  if ((!this.isPopupOpen && !isNullOrUndefined(li)) || (this.isPopupOpen && !isNullOrUndefined(e) &&
2436
2434
  (e.type !== 'keydown' || e.type === 'keydown' && e.action === 'enter'))) {
2437
2435
  this.isSelectCustom = false;
@@ -2442,7 +2440,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2442
2440
  }
2443
2441
  if (Browser.info.name !== 'mozilla') {
2444
2442
  attributes(this.inputElement, { 'aria-label': this.inputElement.value });
2445
- attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id });
2443
+ attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
2446
2444
  this.targetElement().removeAttribute('aria-live');
2447
2445
  }
2448
2446
  }
@@ -2826,11 +2824,8 @@ let DropDownList = class DropDownList extends DropDownBase {
2826
2824
  prepend([parentElement], popupElement);
2827
2825
  attributes(this.filterInput, {
2828
2826
  'aria-disabled': 'false',
2829
- 'aria-owns': this.element.id + '_options',
2830
- 'role': 'listbox',
2831
- 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null,
2827
+ 'role': 'combobox',
2832
2828
  'autocomplete': 'off',
2833
- 'autocorrect': 'off',
2834
2829
  'autocapitalize': 'off',
2835
2830
  'spellcheck': 'false'
2836
2831
  });
@@ -2945,7 +2940,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2945
2940
  && ((this.dataSource instanceof DataManager)
2946
2941
  || (!isNullOrUndefined(this.dataSource) && !isNullOrUndefined(this.dataSource.length) &&
2947
2942
  this.dataSource.length !== 0)))) {
2948
- if (this.itemTemplate && this.element.tagName === 'EJS-COMBOBOX' && this.allowFiltering) {
2943
+ if (this.itemTemplate && (this.element.tagName === 'EJS-COMBOBOX' || this.element.tagName === 'EJS-DROPDOWNLIST') && this.allowFiltering) {
2949
2944
  setTimeout(() => {
2950
2945
  this.updateActionCompleteDataValues(ulElement, list);
2951
2946
  }, 0);
@@ -3125,7 +3120,12 @@ let DropDownList = class DropDownList extends DropDownBase {
3125
3120
  this.unWireListEvents();
3126
3121
  this.wireListEvents();
3127
3122
  }
3128
- attributes(this.targetElement(), { 'aria-expanded': 'true' });
3123
+ this.selectedElementID = this.selectedLI ? this.selectedLI.id : null;
3124
+ attributes(this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': this.inputElement.id + '_options', 'aria-activedescendant': this.selectedElementID });
3125
+ this.inputElement.setAttribute('aria-expanded', 'true');
3126
+ if (this.selectedElementID == null) {
3127
+ this.targetElement().removeAttribute('aria-activedescendant');
3128
+ }
3129
3129
  const inputParent = this.isFiltering() ? this.filterInput.parentElement : this.inputWrapper.container;
3130
3130
  addClass([inputParent], [dropDownListClasses.inputFocus]);
3131
3131
  const animModel = { name: 'FadeIn', duration: 100 };
@@ -3398,6 +3398,9 @@ let DropDownList = class DropDownList extends DropDownBase {
3398
3398
  this.filterInput = null;
3399
3399
  }
3400
3400
  attributes(this.targetElement(), { 'aria-expanded': 'false' });
3401
+ this.inputElement.setAttribute('aria-expanded', 'false');
3402
+ this.targetElement().removeAttribute('aria-owns');
3403
+ this.targetElement().removeAttribute('aria-activedescendant');
3401
3404
  this.inputWrapper.container.classList.remove(dropDownListClasses.iconAnimation);
3402
3405
  if (this.isFiltering()) {
3403
3406
  this.actionCompleteData.isUpdated = false;
@@ -3455,6 +3458,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3455
3458
  if (isNullOrUndefined(this.inputElement.getAttribute('type'))) {
3456
3459
  this.inputElement.setAttribute('type', 'text');
3457
3460
  }
3461
+ this.inputElement.setAttribute('aria-expanded', 'false');
3458
3462
  }
3459
3463
  else {
3460
3464
  this.inputElement = this.createElement('input', { attrs: { role: 'combobox', type: 'text' } });
@@ -3496,6 +3500,10 @@ let DropDownList = class DropDownList extends DropDownBase {
3496
3500
  this.setFields();
3497
3501
  this.inputWrapper.container.style.width = formatUnit(this.width);
3498
3502
  this.inputWrapper.container.classList.add('e-ddl');
3503
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
3504
+ if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && this.inputWrapper.container.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never') {
3505
+ this.inputWrapper.container.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
3506
+ }
3499
3507
  this.wireEvent();
3500
3508
  this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
3501
3509
  this.element.removeAttribute('tabindex');
@@ -3688,6 +3696,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3688
3696
  break;
3689
3697
  case 'width':
3690
3698
  this.setEleWidth(newProp.width);
3699
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
3691
3700
  break;
3692
3701
  case 'placeholder':
3693
3702
  Input.setPlaceholder(newProp.placeholder, this.inputElement);
@@ -3705,6 +3714,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3705
3714
  break;
3706
3715
  case 'cssClass':
3707
3716
  this.setCssClass(newProp.cssClass, oldProp.cssClass);
3717
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
3708
3718
  break;
3709
3719
  case 'enableRtl':
3710
3720
  this.setEnableRtl();
@@ -3851,6 +3861,9 @@ let DropDownList = class DropDownList extends DropDownBase {
3851
3861
  case 'floatLabelType':
3852
3862
  Input.removeFloating(this.inputWrapper);
3853
3863
  Input.addFloating(this.inputElement, newProp.floatLabelType, this.placeholder, this.createElement);
3864
+ if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0] && this.floatLabelType !== 'Never') {
3865
+ this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0].classList.add('e-icon');
3866
+ }
3854
3867
  break;
3855
3868
  case 'showClearButton':
3856
3869
  Input.setClearButton(newProp.showClearButton, this.inputElement, this.inputWrapper, null, this.createElement);
@@ -3968,7 +3981,10 @@ let DropDownList = class DropDownList extends DropDownBase {
3968
3981
  if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {
3969
3982
  this.renderPopup(e);
3970
3983
  }
3971
- attributes(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
3984
+ attributes(this.targetElement(), { 'aria-activedescendant': this.selectedElementID });
3985
+ if (this.selectedElementID == null) {
3986
+ this.targetElement().removeAttribute('aria-activedescendant');
3987
+ }
3972
3988
  }
3973
3989
  renderHightSearch() {
3974
3990
  // update high light search
@@ -4032,6 +4048,7 @@ let DropDownList = class DropDownList extends DropDownBase {
4032
4048
  }
4033
4049
  addClass([this.inputWrapper.container], [dropDownListClasses.inputFocus]);
4034
4050
  this.onFocus(e);
4051
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
4035
4052
  }
4036
4053
  /**
4037
4054
  * Moves the focus from the component if the component is already focused.
@@ -4049,6 +4066,7 @@ let DropDownList = class DropDownList extends DropDownBase {
4049
4066
  this.targetElement().blur();
4050
4067
  }
4051
4068
  removeClass([this.inputWrapper.container], [dropDownListClasses.inputFocus]);
4069
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
4052
4070
  }
4053
4071
  /**
4054
4072
  * Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
@@ -4072,10 +4090,9 @@ let DropDownList = class DropDownList extends DropDownBase {
4072
4090
  return;
4073
4091
  }
4074
4092
  if (this.inputElement) {
4075
- const attrArray = ['readonly', 'aria-disabled', 'aria-placeholder',
4076
- 'placeholder', 'aria-owns', 'aria-labelledby', 'aria-haspopup', 'aria-expanded',
4077
- 'aria-activedescendant', 'autocomplete', 'aria-readonly', 'autocorrect',
4078
- 'autocapitalize', 'spellcheck', 'aria-autocomplete', 'aria-live', 'aria-describedby', 'aria-label'];
4093
+ const attrArray = ['readonly', 'aria-disabled', 'placeholder', 'aria-labelledby',
4094
+ 'aria-expanded', 'autocomplete', 'aria-readonly', 'autocapitalize',
4095
+ 'spellcheck', 'aria-autocomplete', 'aria-live', 'aria-describedby', 'aria-label'];
4079
4096
  for (let i = 0; i < attrArray.length; i++) {
4080
4097
  this.inputElement.removeAttribute(attrArray[i]);
4081
4098
  }
@@ -7485,15 +7502,12 @@ let ComboBox = class ComboBox extends DropDownList {
7485
7502
  }
7486
7503
  getAriaAttributes() {
7487
7504
  const ariaAttributes = {
7488
- 'aria-owns': this.element.id + '_options',
7489
7505
  'role': 'combobox',
7490
7506
  'aria-autocomplete': 'both',
7491
7507
  'aria-labelledby': this.hiddenElement.id,
7492
- 'aria-hasPopup': 'true',
7493
7508
  'aria-expanded': 'false',
7494
7509
  'aria-readonly': this.readonly.toString(),
7495
7510
  'autocomplete': 'off',
7496
- 'autocorrect': 'off',
7497
7511
  'autocapitalize': 'off',
7498
7512
  'spellcheck': 'false'
7499
7513
  };
@@ -7791,6 +7805,7 @@ let ComboBox = class ComboBox extends DropDownList {
7791
7805
  this.preventFocus = false;
7792
7806
  }
7793
7807
  this.onFocus(e);
7808
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
7794
7809
  }
7795
7810
  dropDownClick(e) {
7796
7811
  e.preventDefault();
@@ -8326,6 +8341,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
8326
8341
  }
8327
8342
  setSelection(li, e) {
8328
8343
  if (!this.isValidLI(li)) {
8344
+ this.selectedLI = li;
8329
8345
  return;
8330
8346
  }
8331
8347
  if (!isNullOrUndefined(e) && e.type === 'keydown' && e.action !== 'enter'
@@ -8341,7 +8357,6 @@ let AutoComplete = class AutoComplete extends ComboBox {
8341
8357
  e.action === 'home' || e.action === 'end' || e.action === 'pageUp' || e.action === 'pageDown');
8342
8358
  super.setAutoFill(li, isKeyNavigate);
8343
8359
  }
8344
- attributes(this.inputElement, { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
8345
8360
  }
8346
8361
  else {
8347
8362
  super.setSelection(li, e);
@@ -8465,6 +8480,10 @@ let AutoComplete = class AutoComplete extends ComboBox {
8465
8480
  if (this.showPopupButton) {
8466
8481
  const button = Input.appendSpan(dropDownListClasses.icon, this.inputWrapper.container, this.createElement);
8467
8482
  this.inputWrapper.buttons[0] = button;
8483
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
8484
+ if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && !isNullOrUndefined(this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0]) && this.floatLabelType !== 'Never') {
8485
+ this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0].classList.add('e-icon');
8486
+ }
8468
8487
  if (this.inputWrapper && this.inputWrapper.buttons && this.inputWrapper.buttons[0]) {
8469
8488
  EventHandler.add(this.inputWrapper.buttons[0], 'click', this.dropDownClick, this);
8470
8489
  }
@@ -8946,7 +8965,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
8946
8965
  this.refreshPopup();
8947
8966
  this.renderReactTemplates();
8948
8967
  this.popupObj.show(eventArgs.animation, (this.zIndex === 1000) ? this.element : null);
8949
- attributes(this.inputElement, { 'aria-expanded': 'true' });
8968
+ attributes(this.inputElement, { 'aria-expanded': 'true', 'aria-owns': this.inputElement.id + '_options' });
8969
+ if (this.selectedElementID == null) {
8970
+ this.inputElement.removeAttribute('aria-activedescendant');
8971
+ }
8972
+ else {
8973
+ attributes(this.inputElement, { 'aria-activedescendant': this.selectedElementID });
8974
+ }
8950
8975
  if (this.isFirstClick) {
8951
8976
  this.loadTemplate();
8952
8977
  }
@@ -9016,11 +9041,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9016
9041
  getAriaAttributes() {
9017
9042
  const ariaAttributes = {
9018
9043
  'aria-disabled': 'false',
9019
- 'aria-owns': this.element.id + '_options',
9020
- 'role': 'listbox',
9021
- 'aria-multiselectable': 'true',
9022
- 'aria-activedescendant': 'null',
9023
- 'aria-haspopup': 'true',
9044
+ 'role': 'combobox',
9024
9045
  'aria-expanded': 'false'
9025
9046
  };
9026
9047
  return ariaAttributes;
@@ -9030,7 +9051,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9030
9051
  attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
9031
9052
  }
9032
9053
  const disableStatus = (this.inputElement.disabled) ? true : false;
9033
- attributes(this.inputElement, this.getAriaAttributes());
9054
+ if (!this.isPopupOpen()) {
9055
+ attributes(this.inputElement, this.getAriaAttributes());
9056
+ }
9034
9057
  if (disableStatus) {
9035
9058
  attributes(this.inputElement, { 'aria-disabled': 'true' });
9036
9059
  }
@@ -9557,6 +9580,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9557
9580
  this.ulElement = this.mainList;
9558
9581
  }
9559
9582
  this.checkPlaceholderSize();
9583
+ Input.createSpanElement(this.overAllWrapper, this.createElement);
9584
+ Input.calculateWidth(this.inputElement, this.overAllWrapper);
9585
+ if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
9586
+ this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
9587
+ }
9560
9588
  }
9561
9589
  checkPlaceholderSize() {
9562
9590
  if (this.showDropDownIcon) {
@@ -9687,6 +9715,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9687
9715
  if (this.isPopupOpen()) {
9688
9716
  this.refreshPopup();
9689
9717
  }
9718
+ Input.calculateWidth(this.inputElement, this.overAllWrapper);
9690
9719
  return true;
9691
9720
  }
9692
9721
  else {
@@ -10822,6 +10851,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10822
10851
  this.removeValue(temp, e, null, true);
10823
10852
  }
10824
10853
  }
10854
+ this.selectedElementID = null;
10855
+ this.inputElement.removeAttribute('aria-activedescendant');
10825
10856
  }
10826
10857
  else {
10827
10858
  this.clearAllCallback(e);
@@ -11309,7 +11340,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11309
11340
  if (this.chipCollectionWrapper) {
11310
11341
  this.removeChipSelection();
11311
11342
  }
11312
- attributes(this.inputElement, { 'aria-activedescendant': element.id });
11343
+ this.selectedElementID = element.id;
11313
11344
  }
11314
11345
  }
11315
11346
  updateDelimeter(delimChar, e) {
@@ -12150,6 +12181,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12150
12181
  case 'cssClass':
12151
12182
  this.updateOldPropCssClass(oldProp.cssClass);
12152
12183
  this.updateCssClass();
12184
+ Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
12153
12185
  break;
12154
12186
  case 'enableRtl':
12155
12187
  this.enableRTL(newProp.enableRtl);
@@ -12176,6 +12208,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12176
12208
  case 'floatLabelType':
12177
12209
  this.setFloatLabelType();
12178
12210
  this.addValidInputClass();
12211
+ Input.createSpanElement(this.overAllWrapper, this.createElement);
12212
+ Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
12213
+ if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
12214
+ this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
12215
+ }
12179
12216
  break;
12180
12217
  case 'enableSelectionOrder':
12181
12218
  break;
@@ -12324,6 +12361,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12324
12361
  this.overAllWrapper.classList.remove(iconAnimation);
12325
12362
  this.popupObj.hide(new Animation(eventArgs.animation));
12326
12363
  attributes(this.inputElement, { 'aria-expanded': 'false' });
12364
+ this.inputElement.removeAttribute('aria-owns');
12365
+ this.inputElement.removeAttribute('aria-activedescendant');
12327
12366
  if (this.allowFiltering) {
12328
12367
  this.notify('inputFocus', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'clear' });
12329
12368
  }
@@ -12509,6 +12548,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12509
12548
  if (this.element.hasAttribute('data-val')) {
12510
12549
  this.element.setAttribute('data-val', 'false');
12511
12550
  }
12551
+ Input.createSpanElement(this.overAllWrapper, this.createElement);
12552
+ Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
12553
+ if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
12554
+ this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
12555
+ }
12512
12556
  this.renderComplete();
12513
12557
  }
12514
12558
  checkInitialValue() {
@@ -12644,7 +12688,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12644
12688
  this.ulElement = null;
12645
12689
  this.mainListCollection = null;
12646
12690
  super.destroy();
12647
- const temp = ['readonly', 'aria-disabled', 'aria-placeholder', 'placeholder'];
12691
+ const temp = ['readonly', 'aria-disabled', 'placeholder'];
12648
12692
  let length = temp.length;
12649
12693
  while (length > 0) {
12650
12694
  this.inputElement.removeAttribute(temp[length - 1]);
@@ -13123,11 +13167,8 @@ class CheckBoxSelection {
13123
13167
  prepend([this.parent.filterParent], args.popupElement);
13124
13168
  attributes(this.filterInput, {
13125
13169
  'aria-disabled': 'false',
13126
- 'aria-owns': this.parent.element.id + '_options',
13127
- 'role': 'listbox',
13128
- 'aria-activedescendant': null,
13170
+ 'role': 'combobox',
13129
13171
  'autocomplete': 'off',
13130
- 'autocorrect': 'off',
13131
13172
  'autocapitalize': 'off',
13132
13173
  'spellcheck': 'false'
13133
13174
  });
@@ -13489,7 +13530,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13489
13530
  removeClass([this.list], [dropDownBaseClasses.content, dropDownBaseClasses.root]);
13490
13531
  this.validationAttribute(this.element, hiddenSelect);
13491
13532
  this.list.setAttribute('role', 'listbox');
13492
- attributes(this.list, { 'role': 'listbox', 'aria-multiselectable': this.selectionSettings.mode === 'Multiple' ? 'true' : 'false' });
13533
+ attributes(this.list, { 'role': 'listbox', 'aria-label': 'listbox', 'aria-multiselectable': this.selectionSettings.mode === 'Multiple' ? 'true' : 'false' });
13493
13534
  this.updateSelectionSettings();
13494
13535
  }
13495
13536
  updateSelectionSettings() {
@@ -13934,6 +13975,12 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13934
13975
  dragArgs = extend(dragArgs, { destination: dragArgs1 });
13935
13976
  }
13936
13977
  this.trigger('drop', dragArgs);
13978
+ let liCollElem = dragArgs.elements;
13979
+ if (liCollElem.length) {
13980
+ for (let i = 0; i < liCollElem.length; i++) {
13981
+ liCollElem[i].classList.remove('e-grabbed');
13982
+ }
13983
+ }
13937
13984
  }
13938
13985
  updateListItems(sourceElem, destElem) {
13939
13986
  const i = 0;
@@ -14914,15 +14961,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14914
14961
  }
14915
14962
  getGrabbedItems() {
14916
14963
  for (let i = 0; i < this.value.length; i++) {
14917
- if (this.value[i] === this.dragValue) {
14918
- const liColl = this.list.querySelectorAll('[aria-selected="true"]');
14919
- for (let i = 0; i < liColl.length; i++) {
14920
- liColl[i].classList.add('e-grabbed');
14964
+ const liColl = this.list.querySelectorAll('[aria-selected="true"]');
14965
+ for (let j = 0; j < liColl.length; j++) {
14966
+ if (this.value[i] === liColl[j].textContent) {
14967
+ liColl[j].classList.add('e-grabbed');
14921
14968
  }
14922
- break;
14923
14969
  }
14924
14970
  }
14925
- const elems = Array.prototype.slice.call(this.element.querySelectorAll('.e-grabbed'));
14971
+ const elems = Array.prototype.slice.call(this.element.nextElementSibling.querySelectorAll('.e-grabbed'));
14926
14972
  return elems;
14927
14973
  }
14928
14974
  getDragArgs(args, isDragEnd) {
@@ -15597,6 +15643,1350 @@ const listBoxClasses = {
15597
15643
  clearIcon: 'e-clear-icon'
15598
15644
  };
15599
15645
 
15646
+ /**
15647
+ * export all modules from current location
15648
+ */
15649
+
15650
+ var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
15651
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15652
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
15653
+ 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;
15654
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
15655
+ };
15656
+ /**
15657
+ * The Mention component is used to list someone or something based on user input in textarea, input,
15658
+ * or any other editable element from which the user can select.
15659
+ */
15660
+ let Mention = class Mention extends DropDownBase {
15661
+ /**
15662
+ * * Constructor for creating the widget
15663
+ *
15664
+ * @param {MentionModel} options - Specifies the MentionComponent model.
15665
+ * @param {string | HTMLElement} element - Specifies the element to render as component.
15666
+ * @private
15667
+ */
15668
+ constructor(options, element) {
15669
+ super(options, element);
15670
+ }
15671
+ /**
15672
+ * When property value changes happened, then onPropertyChanged method will execute the respective changes in this component.
15673
+ *
15674
+ * @param {MentionModel} newProp - Returns the dynamic property value of the component.
15675
+ * @param {MentionModel} oldProp - Returns the previous property value of the component.
15676
+ * @private
15677
+ * @returns {void}
15678
+ */
15679
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
15680
+ onPropertyChanged(newProp, oldProp) {
15681
+ for (const prop of Object.keys(newProp)) {
15682
+ switch (prop) {
15683
+ case 'minLength':
15684
+ this.minLength = newProp.minLength;
15685
+ break;
15686
+ case 'suffixText':
15687
+ this.suffixText = newProp.suffixText;
15688
+ break;
15689
+ case 'allowSpaces':
15690
+ this.allowSpaces = newProp.allowSpaces;
15691
+ break;
15692
+ case 'mentionChar':
15693
+ this.mentionChar = newProp.mentionChar;
15694
+ break;
15695
+ case 'showMentionChar':
15696
+ this.showMentionChar = newProp.showMentionChar;
15697
+ break;
15698
+ case 'cssClass':
15699
+ this.updateCssClass(newProp.cssClass, oldProp.cssClass);
15700
+ break;
15701
+ }
15702
+ }
15703
+ }
15704
+ updateCssClass(newClass, oldClass) {
15705
+ if (!isNullOrUndefined(oldClass)) {
15706
+ oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
15707
+ }
15708
+ if (!isNullOrUndefined(newClass)) {
15709
+ newClass = (newClass.replace(/\s+/g, ' ')).trim();
15710
+ }
15711
+ this.setCssClass(newClass, [this.inputElement], oldClass);
15712
+ if (this.popupObj) {
15713
+ this.setCssClass(newClass, [this.popupObj.element], oldClass);
15714
+ }
15715
+ }
15716
+ setCssClass(cssClass$$1, elements, oldClass) {
15717
+ if (!isNullOrUndefined(oldClass) && oldClass !== '') {
15718
+ removeClass(elements, oldClass.split(' '));
15719
+ }
15720
+ if (!isNullOrUndefined(cssClass$$1) && cssClass$$1 !== '') {
15721
+ addClass(elements, cssClass$$1.split(' '));
15722
+ }
15723
+ }
15724
+ initializeData() {
15725
+ this.isSelected = false;
15726
+ this.isFiltered = false;
15727
+ this.beforePopupOpen = false;
15728
+ this.initRemoteRender = false;
15729
+ this.isPopupOpen = false;
15730
+ this.isCollided = false;
15731
+ this.lineBreak = false;
15732
+ this.keyConfigure = {
15733
+ tab: 'tab',
15734
+ enter: '13',
15735
+ escape: '27',
15736
+ end: '35',
15737
+ home: '36',
15738
+ down: '40',
15739
+ up: '38',
15740
+ pageUp: '33',
15741
+ pageDown: '34',
15742
+ open: 'alt+40',
15743
+ close: 'shift+tab',
15744
+ hide: 'alt+38',
15745
+ space: '32'
15746
+ };
15747
+ }
15748
+ /**
15749
+ * Execute before render the list items
15750
+ *
15751
+ * @private
15752
+ * @returns {void}
15753
+ */
15754
+ preRender() {
15755
+ this.initializeData();
15756
+ super.preRender();
15757
+ }
15758
+ /**
15759
+ * To Initialize the control rendering
15760
+ *
15761
+ * @private
15762
+ * @returns {void}
15763
+ */
15764
+ render() {
15765
+ this.inputElement = !isNullOrUndefined(this.target) ? ((typeof this.target) === 'string') ?
15766
+ document.querySelector(this.target) : this.target : this.element;
15767
+ if (this.isContentEditable(this.inputElement)) {
15768
+ this.inputElement.setAttribute('contenteditable', 'true');
15769
+ addClass([this.inputElement], ['e-mention']);
15770
+ if (isNullOrUndefined(this.target)) {
15771
+ addClass([this.inputElement], ['e-editable-element']);
15772
+ }
15773
+ }
15774
+ this.queryString = this.elementValue();
15775
+ this.wireEvent();
15776
+ }
15777
+ wireEvent() {
15778
+ EventHandler.add(this.inputElement, 'keyup', this.onKeyUp, this);
15779
+ this.bindCommonEvent();
15780
+ }
15781
+ unWireEvent() {
15782
+ EventHandler.remove(this.inputElement, 'keyup', this.onKeyUp);
15783
+ this.unBindCommonEvent();
15784
+ }
15785
+ bindCommonEvent() {
15786
+ if (!Browser.isDevice) {
15787
+ this.keyboardModule = new KeyboardEvents(this.inputElement, {
15788
+ keyAction: this.keyActionHandler.bind(this), keyConfigs: this.keyConfigure, eventName: 'keydown'
15789
+ });
15790
+ }
15791
+ }
15792
+ /**
15793
+ * Hides the spinner loader.
15794
+ *
15795
+ * @returns {void}
15796
+ */
15797
+ hideSpinner() {
15798
+ this.hideWaitingSpinner();
15799
+ }
15800
+ hideWaitingSpinner() {
15801
+ if (!isNullOrUndefined(this.spinnerElement)) {
15802
+ hideSpinner(this.spinnerElement);
15803
+ }
15804
+ if (!isNullOrUndefined(this.spinnerTemplate)) {
15805
+ detach(this.spinnerTemplateElement);
15806
+ }
15807
+ }
15808
+ /**
15809
+ * Shows the spinner loader.
15810
+ *
15811
+ * @returns {void}
15812
+ */
15813
+ showWaitingSpinner() {
15814
+ if (!isNullOrUndefined(this.popupObj)) {
15815
+ if (isNullOrUndefined(this.spinnerTemplate) && isNullOrUndefined(this.spinnerElement)) {
15816
+ this.spinnerElement = this.popupObj.element;
15817
+ createSpinner({
15818
+ target: this.spinnerElement,
15819
+ width: Browser.isDevice ? '16px' : '14px'
15820
+ }, this.createElement);
15821
+ showSpinner(this.spinnerElement);
15822
+ }
15823
+ if (!isNullOrUndefined(this.spinnerTemplate)) {
15824
+ this.setSpinnerTemplate();
15825
+ this.popupObj.element.appendChild(this.spinnerTemplateElement);
15826
+ }
15827
+ }
15828
+ }
15829
+ keyActionHandler(e) {
15830
+ const isNavigation = (e.action === 'down' || e.action === 'up' || e.action === 'pageUp' || e.action === 'pageDown'
15831
+ || e.action === 'home' || e.action === 'end');
15832
+ const isTabAction = e.action === 'tab' || e.action === 'close';
15833
+ if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape') {
15834
+ this.renderList();
15835
+ }
15836
+ if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
15837
+ isNavigation && this.liCollections.length === 0) || this.isRequested) {
15838
+ return;
15839
+ }
15840
+ if (e.action === 'escape') {
15841
+ e.preventDefault();
15842
+ }
15843
+ this.isSelected = e.action === 'escape' ? false : this.isSelected;
15844
+ switch (e.action) {
15845
+ case 'down':
15846
+ case 'up':
15847
+ this.updateUpDownAction(e);
15848
+ break;
15849
+ case 'tab':
15850
+ if (this.isPopupOpen) {
15851
+ const li = this.list.querySelector('.' + dropDownBaseClasses.selected);
15852
+ if (li) {
15853
+ this.setSelection(li, e);
15854
+ }
15855
+ if (this.isPopupOpen) {
15856
+ this.hidePopup(e);
15857
+ }
15858
+ }
15859
+ break;
15860
+ case 'enter':
15861
+ if (this.isPopupOpen) {
15862
+ e.preventDefault();
15863
+ if (this.popupObj && this.popupObj.element.contains(this.selectedLI)) {
15864
+ this.setValue(e);
15865
+ }
15866
+ }
15867
+ break;
15868
+ case 'escape':
15869
+ if (this.isPopupOpen) {
15870
+ this.hidePopup(e);
15871
+ }
15872
+ break;
15873
+ }
15874
+ }
15875
+ updateUpDownAction(e) {
15876
+ const focusEle = this.list.querySelector('.' + dropDownBaseClasses.focus);
15877
+ if (this.isSelectFocusItem(focusEle)) {
15878
+ this.setSelection(focusEle, e);
15879
+ }
15880
+ else if (!isNullOrUndefined(this.liCollections)) {
15881
+ const li = this.list.querySelector('.' + dropDownBaseClasses.selected);
15882
+ if (!isNullOrUndefined(li)) {
15883
+ const value = this.getFormattedValue(li.getAttribute('data-value'));
15884
+ this.activeIndex = this.getIndexByValue(value);
15885
+ }
15886
+ let index = e.action === 'down' ? this.activeIndex + 1 : this.activeIndex - 1;
15887
+ let startIndex = 0;
15888
+ startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
15889
+ index = index < 0 ? this.liCollections.length - 1 : index === this.liCollections.length ? 0 : index;
15890
+ const nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex] : this.liCollections[index];
15891
+ if (!isNullOrUndefined(nextItem)) {
15892
+ this.setSelection(nextItem, e);
15893
+ }
15894
+ }
15895
+ if (this.isPopupOpen) {
15896
+ e.preventDefault();
15897
+ }
15898
+ }
15899
+ isSelectFocusItem(element) {
15900
+ return !isNullOrUndefined(element);
15901
+ }
15902
+ unBindCommonEvent() {
15903
+ if (!Browser.isDevice) {
15904
+ this.keyboardModule.destroy();
15905
+ }
15906
+ }
15907
+ onKeyUp(e) {
15908
+ let rangetextContent;
15909
+ if (this.isContentEditable(this.inputElement)) {
15910
+ this.range = this.getCurrentRange();
15911
+ rangetextContent = this.range.startContainer.textContent.split('');
15912
+ }
15913
+ let currentRange = this.getTextRange();
15914
+ const lastWordRange = this.getLastLetter(currentRange);
15915
+ const Regex = new RegExp(this.mentionChar, 'g');
15916
+ const charRegex = new RegExp('[a-zA-Z]', 'g');
15917
+ if (e.key === 'Shift' || e.keyCode === 37 || e.keyCode === 39) {
15918
+ return;
15919
+ }
15920
+ if ((!currentRange || !lastWordRange) || e.code === 'Enter' || e.keyCode === 27 ||
15921
+ (lastWordRange.match(Regex) && lastWordRange.match(Regex).length > 1) ||
15922
+ (this.isContentEditable(this.inputElement) && this.range.startContainer &&
15923
+ this.range.startContainer.previousElementSibling && this.range.startContainer.textContent.split('').length > 0 &&
15924
+ (rangetextContent.length === 1 || rangetextContent[rangetextContent.length - 2].indexOf('') === -1 ||
15925
+ this.range.startContainer.nodeType === 1))) {
15926
+ if (this.allowSpaces && currentRange && currentRange.trim() !== '' && charRegex.test(currentRange) && currentRange.indexOf(this.mentionChar) !== -1
15927
+ && !this.isMatchedText() && (currentRange.length > 1 && currentRange.replace(/\u00A0/g, ' ').charAt(currentRange.length - 2) !== ' ') &&
15928
+ (this.list && this.list.querySelectorAll('ul').length > 0)) {
15929
+ this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
15930
+ this.searchLists(e);
15931
+ }
15932
+ else if (this.isPopupOpen && (!this.allowSpaces || !lastWordRange)) {
15933
+ this.hidePopup();
15934
+ this.lineBreak = true;
15935
+ }
15936
+ return;
15937
+ }
15938
+ this.queryString = lastWordRange.replace(this.mentionChar, '');
15939
+ if (this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0) &&
15940
+ this.queryString !== '' && e.keyCode !== 38 && e.keyCode !== 40 && !this.lineBreak) {
15941
+ this.searchLists(e);
15942
+ if (!this.isPopupOpen && this.queryString.length >= this.minLength) {
15943
+ if (!this.isContentEditable(this.inputElement)) {
15944
+ this.showPopup();
15945
+ }
15946
+ else if (this.isContentEditable(this.inputElement) && this.range && this.range.startContainer !== this.inputElement) {
15947
+ this.showPopup();
15948
+ }
15949
+ }
15950
+ }
15951
+ else if (lastWordRange.indexOf(this.mentionChar) === 0 && !this.isPopupOpen && e.keyCode !== 8 && (!this.popupObj ||
15952
+ (isNullOrUndefined(this.target) && !document.body.contains(this.popupObj.element) ||
15953
+ !isNullOrUndefined(this.target) && document.body.contains(this.popupObj.element)))) {
15954
+ if (this.initRemoteRender && this.list && this.list.classList.contains('e-nodata')) {
15955
+ this.searchLists(e);
15956
+ }
15957
+ this.resetList(this.dataSource, this.fields);
15958
+ if (isNullOrUndefined(this.list)) {
15959
+ this.initValue();
15960
+ }
15961
+ if (!this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40) {
15962
+ this.showPopup();
15963
+ if (this.initRemoteRender && this.list.querySelectorAll('li').length === 0) {
15964
+ this.showWaitingSpinner();
15965
+ }
15966
+ this.lineBreak = false;
15967
+ }
15968
+ }
15969
+ else if (this.allowSpaces && this.queryString !== '' && currentRange && currentRange.trim() !== '' && currentRange.replace('\u00a0', ' ').lastIndexOf(' ') < currentRange.length - 1 &&
15970
+ e.keyCode !== 38 && e.keyCode !== 40 && e.keyCode !== 8) {
15971
+ this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
15972
+ this.searchLists(e);
15973
+ }
15974
+ else if (this.queryString === '' && this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40) {
15975
+ this.resetList(this.dataSource, this.fields);
15976
+ }
15977
+ }
15978
+ isMatchedText() {
15979
+ let isMatched = false;
15980
+ for (let i = 0; i < (this.liCollections && this.liCollections.length); i++) {
15981
+ if (this.getTextRange() &&
15982
+ this.getTextRange().substring(this.getTextRange().lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ').trim() === this.liCollections[i].getAttribute('data-value').toLowerCase()) {
15983
+ isMatched = true;
15984
+ }
15985
+ }
15986
+ return isMatched;
15987
+ }
15988
+ getCurrentRange() {
15989
+ this.range = this.inputElement.ownerDocument.getSelection().getRangeAt(0);
15990
+ return this.range;
15991
+ }
15992
+ searchLists(e) {
15993
+ this.isDataFetched = false;
15994
+ if (isNullOrUndefined(this.list)) {
15995
+ super.render();
15996
+ this.unWireListEvents();
15997
+ this.wireListEvents();
15998
+ }
15999
+ if (e.type !== 'mousedown' && (e.keyCode === 40 || e.keyCode === 38)) {
16000
+ this.queryString = this.queryString === '' ? null : this.queryString;
16001
+ this.beforePopupOpen = true;
16002
+ this.resetList(this.dataSource, this.fields);
16003
+ return;
16004
+ }
16005
+ this.isSelected = false;
16006
+ this.activeIndex = null;
16007
+ const eventArgs = {
16008
+ preventDefaultAction: false,
16009
+ text: this.elementValue(),
16010
+ updateData: (dataSource, query, fields) => {
16011
+ if (eventArgs.cancel) {
16012
+ return;
16013
+ }
16014
+ this.isFiltered = true;
16015
+ this.filterAction(dataSource, query, fields);
16016
+ },
16017
+ cancel: false
16018
+ };
16019
+ this.trigger('filtering', eventArgs, (eventArgs) => {
16020
+ if (!eventArgs.cancel && !this.isFiltered && !eventArgs.preventDefaultAction) {
16021
+ this.filterAction(this.dataSource, null, this.fields);
16022
+ }
16023
+ });
16024
+ }
16025
+ filterAction(dataSource, query, fields) {
16026
+ this.beforePopupOpen = true;
16027
+ if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
16028
+ this.resetList(dataSource, fields, query);
16029
+ }
16030
+ else {
16031
+ if (this.isPopupOpen) {
16032
+ this.hidePopup();
16033
+ }
16034
+ this.beforePopupOpen = false;
16035
+ }
16036
+ this.setDataIndex();
16037
+ this.renderReactTemplates();
16038
+ }
16039
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
16040
+ onActionComplete(ulElement, list, e, isUpdated) {
16041
+ super.onActionComplete(ulElement, list, e);
16042
+ if (this.isActive) {
16043
+ let focusItem = ulElement.querySelector('.' + dropDownBaseClasses.li);
16044
+ if (focusItem) {
16045
+ focusItem.classList.add(dropDownBaseClasses.selected);
16046
+ this.selectedLI = focusItem;
16047
+ const value = this.getFormattedValue(focusItem.getAttribute('data-value'));
16048
+ this.selectEventCallback(focusItem, this.getDataByValue(value), value, true);
16049
+ }
16050
+ }
16051
+ }
16052
+ setDataIndex() {
16053
+ for (let i = 0; this.liCollections && i < this.liCollections.length; i++) {
16054
+ this.liCollections[i].setAttribute('data-index', i.toString());
16055
+ }
16056
+ }
16057
+ listOption(dataSource, fieldsSettings) {
16058
+ const fields = super.listOption(dataSource, fieldsSettings);
16059
+ if (isNullOrUndefined(fields.itemCreated)) {
16060
+ fields.itemCreated = (e) => {
16061
+ if (this.highlight) {
16062
+ if (this.inputElement.tagName === this.getNgDirective() && this.itemTemplate) {
16063
+ setTimeout(() => {
16064
+ highlightSearch(e.item, this.queryString, this.ignoreCase, this.filterType);
16065
+ }, 0);
16066
+ }
16067
+ else {
16068
+ highlightSearch(e.item, this.queryString, this.ignoreCase, this.filterType);
16069
+ }
16070
+ }
16071
+ };
16072
+ }
16073
+ else {
16074
+ const itemCreated = fields.itemCreated;
16075
+ fields.itemCreated = (e) => {
16076
+ if (this.highlight) {
16077
+ highlightSearch(e.item, this.queryString, this.ignoreCase, this.filterType);
16078
+ }
16079
+ itemCreated.apply(this, [e]);
16080
+ };
16081
+ }
16082
+ return fields;
16083
+ }
16084
+ elementValue() {
16085
+ if (!this.isContentEditable(this.inputElement)) {
16086
+ return this.inputElement.value.replace(this.mentionChar, '');
16087
+ }
16088
+ else {
16089
+ return this.inputElement.textContent.replace(this.mentionChar, '');
16090
+ }
16091
+ }
16092
+ getQuery(query) {
16093
+ const filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
16094
+ const filterType = (this.queryString === '' && !isNullOrUndefined(this.elementValue())) ? 'equal' : this.filterType;
16095
+ const queryString = (this.queryString === '' && !isNullOrUndefined(this.elementValue())) ?
16096
+ this.elementValue() : this.queryString;
16097
+ if (this.isFiltered) {
16098
+ return filterQuery;
16099
+ }
16100
+ if (this.queryString !== null && this.queryString !== '') {
16101
+ const dataType = this.typeOfData(this.dataSource).typeof;
16102
+ if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
16103
+ filterQuery.where('', filterType, queryString, this.ignoreCase, this.ignoreAccent);
16104
+ }
16105
+ else {
16106
+ const mapping = !isNullOrUndefined(this.fields.text) ? this.fields.text : '';
16107
+ filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
16108
+ }
16109
+ }
16110
+ if (!isNullOrUndefined(this.suggestionCount)) {
16111
+ // Since defualt value of suggestioncount is 25, checked the condition
16112
+ if (this.suggestionCount !== 25) {
16113
+ for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
16114
+ if (filterQuery.queries[queryElements].fn === 'onTake') {
16115
+ filterQuery.queries.splice(queryElements, 1);
16116
+ }
16117
+ }
16118
+ }
16119
+ filterQuery.take(this.suggestionCount);
16120
+ }
16121
+ return filterQuery;
16122
+ }
16123
+ renderHightSearch() {
16124
+ if (this.highlight) {
16125
+ for (let i = 0; i < this.liCollections.length; i++) {
16126
+ const isHighlight = this.ulElement.querySelector('.e-active');
16127
+ if (!isHighlight) {
16128
+ revertHighlightSearch(this.liCollections[i]);
16129
+ highlightSearch(this.liCollections[i], this.queryString, this.ignoreCase, this.filterType);
16130
+ }
16131
+ }
16132
+ }
16133
+ }
16134
+ getTextRange() {
16135
+ let text;
16136
+ if (!this.isContentEditable(this.inputElement)) {
16137
+ const component = this.inputElement;
16138
+ if (!isNullOrUndefined(component)) {
16139
+ const startPos = component.selectionStart;
16140
+ if (component.value && startPos >= 0) {
16141
+ text = component.value.substring(0, startPos);
16142
+ }
16143
+ }
16144
+ }
16145
+ else {
16146
+ const selectedElem = this.range.startContainer;
16147
+ if (!isNullOrUndefined(selectedElem)) {
16148
+ const workingNodeContent = selectedElem.textContent;
16149
+ let selectStartOffset = this.range.startOffset;
16150
+ if (workingNodeContent && selectStartOffset >= 0) {
16151
+ text = workingNodeContent.substring(0, selectStartOffset);
16152
+ }
16153
+ }
16154
+ }
16155
+ return text;
16156
+ }
16157
+ getLastLetter(text) {
16158
+ if (isNullOrUndefined(text)) {
16159
+ return '';
16160
+ }
16161
+ const textValue = text.replace(/\u00A0/g, ' ');
16162
+ const words = textValue.split(/\s+/);
16163
+ let wordCnt = words.length - 1;
16164
+ return words[wordCnt].trim();
16165
+ }
16166
+ isContentEditable(element) {
16167
+ return element && element.nodeName !== 'INPUT' && element.nodeName !== 'TEXTAREA';
16168
+ }
16169
+ /**
16170
+ * Opens the popup that displays the list of items.
16171
+ *
16172
+ * @returns {void}
16173
+ */
16174
+ showPopup() {
16175
+ this.renderPopup();
16176
+ }
16177
+ /* eslint-disable valid-jsdoc, jsdoc/require-param */
16178
+ /**
16179
+ * Hides the popup if it is in an open state.
16180
+ *
16181
+ * @returns {void}
16182
+ */
16183
+ hidePopup(e) {
16184
+ this.removeSelection();
16185
+ this.closePopup(0, e);
16186
+ }
16187
+ closePopup(delay, e) {
16188
+ if (!(this.popupObj && document.body.contains(this.popupObj.element) && this.beforePopupOpen)) {
16189
+ return;
16190
+ }
16191
+ EventHandler.remove(document, 'mousedown', this.onDocumentClick);
16192
+ this.beforePopupOpen = false;
16193
+ const animModel = {
16194
+ name: 'FadeOut',
16195
+ duration: 100,
16196
+ delay: delay ? delay : 0
16197
+ };
16198
+ const popupInstance = this.popupObj;
16199
+ const eventArgs = { popup: popupInstance, cancel: false, animation: animModel, event: e || null };
16200
+ this.trigger('closed', eventArgs, (eventArgs) => {
16201
+ if (!eventArgs.cancel && this.popupObj) {
16202
+ if (this.isPopupOpen) {
16203
+ this.popupObj.hide(new Animation(eventArgs.animation));
16204
+ }
16205
+ else {
16206
+ this.destroyPopup();
16207
+ }
16208
+ }
16209
+ });
16210
+ }
16211
+ renderPopup() {
16212
+ const args = { cancel: false };
16213
+ this.trigger('beforeOpen', args, (args) => {
16214
+ if (!args.cancel) {
16215
+ const popupEle = isNullOrUndefined(this.target) ? this.createElement('div', {
16216
+ id: this.inputElement.id + '_popup', className: 'e-mention e-popup ' + (this.cssClass != null ? this.cssClass : '')
16217
+ }) : this.element;
16218
+ if (!isNullOrUndefined(this.target)) {
16219
+ popupEle.id = this.inputElement.id + '_popup';
16220
+ addClass([popupEle], ['e-mention', 'e-popup', 'e-popup-close']);
16221
+ }
16222
+ this.listHeight = formatUnit(this.popupHeight);
16223
+ if (!isNullOrUndefined(this.list.querySelector('li')) && !this.initRemoteRender) {
16224
+ const li = this.list.querySelector('.' + dropDownBaseClasses.focus);
16225
+ if (!isNullOrUndefined(li)) {
16226
+ this.selectedLI = li;
16227
+ const value = this.getFormattedValue(li.getAttribute('data-value'));
16228
+ this.selectEventCallback(li, this.getDataByValue(value), value, true);
16229
+ }
16230
+ }
16231
+ append([this.list], popupEle);
16232
+ if ((!this.popupObj || !document.body.contains(this.popupObj.element)) || !document.contains(popupEle) && isNullOrUndefined(this.target)) {
16233
+ document.body.appendChild(popupEle);
16234
+ }
16235
+ let coordinates;
16236
+ popupEle.style.visibility = 'hidden';
16237
+ if (this.popupHeight !== 'auto') {
16238
+ this.list.style.maxHeight = (parseInt(this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
16239
+ popupEle.style.maxHeight = formatUnit(this.popupHeight);
16240
+ }
16241
+ else {
16242
+ popupEle.style.height = 'auto';
16243
+ }
16244
+ const offsetValue = 0;
16245
+ const left = 0;
16246
+ this.initializePopup(popupEle, offsetValue, left);
16247
+ this.checkCollision(popupEle);
16248
+ popupEle.style.visibility = 'visible';
16249
+ if (!isNullOrUndefined(this.list)) {
16250
+ this.unWireListEvents();
16251
+ this.wireListEvents();
16252
+ }
16253
+ const animModel = { name: 'FadeIn', duration: 100 };
16254
+ this.beforePopupOpen = true;
16255
+ const popupInstance = this.popupObj;
16256
+ const eventArgs = { popup: popupInstance, cancel: false, animation: animModel };
16257
+ this.trigger('opened', eventArgs, (eventArgs) => {
16258
+ if (!eventArgs.cancel) {
16259
+ this.renderReactTemplates();
16260
+ this.popupObj.show(new Animation(eventArgs.animation), (this.zIndex === 1000) ? this.inputElement : null);
16261
+ coordinates = this.getCoordinates(this.inputElement, this.getTriggerCharPosition());
16262
+ if (!this.isCollided) {
16263
+ popupEle.style.cssText = 'top: '.concat(coordinates.top.toString(), 'px;\n left: ').concat(coordinates.left.toString(), 'px;\nposition: absolute;\n display: block;');
16264
+ }
16265
+ else {
16266
+ popupEle.style.left = formatUnit(coordinates.left);
16267
+ this.isCollided = false;
16268
+ }
16269
+ popupEle.style.width = this.popupWidth !== '100%' && !isNullOrUndefined(this.popupWidth) ? formatUnit(this.popupWidth) : 'auto';
16270
+ }
16271
+ else {
16272
+ this.beforePopupOpen = false;
16273
+ this.destroyPopup();
16274
+ }
16275
+ });
16276
+ }
16277
+ else {
16278
+ this.beforePopupOpen = false;
16279
+ }
16280
+ });
16281
+ }
16282
+ checkCollision(popupEle) {
16283
+ if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
16284
+ const collision = isCollide(popupEle);
16285
+ if (collision.length > 0) {
16286
+ popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
16287
+ this.isCollided = true;
16288
+ }
16289
+ this.popupObj.resolveCollision();
16290
+ }
16291
+ }
16292
+ getTriggerCharPosition() {
16293
+ let mostRecentTriggerCharPos;
16294
+ const currentRange = this.getTextRange();
16295
+ if (currentRange !== undefined && currentRange !== null) {
16296
+ mostRecentTriggerCharPos = 0;
16297
+ const idx = currentRange.lastIndexOf(this.mentionChar);
16298
+ if (idx >= mostRecentTriggerCharPos) {
16299
+ mostRecentTriggerCharPos = idx;
16300
+ }
16301
+ }
16302
+ return mostRecentTriggerCharPos;
16303
+ }
16304
+ initializePopup(element, offsetValue, left) {
16305
+ this.popupObj = new Popup(element, {
16306
+ width: this.setWidth(), targetType: 'relative',
16307
+ relateTo: this.inputElement, collision: { X: 'flip', Y: 'flip' }, offsetY: offsetValue,
16308
+ enableRtl: this.enableRtl, offsetX: left, position: { X: 'top', Y: 'left' }, actionOnScroll: 'hide',
16309
+ zIndex: this.zIndex,
16310
+ close: () => {
16311
+ this.destroyPopup();
16312
+ },
16313
+ open: () => {
16314
+ EventHandler.add(document, 'mousedown', this.onDocumentClick, this);
16315
+ this.isPopupOpen = true;
16316
+ this.setDataIndex();
16317
+ }
16318
+ });
16319
+ }
16320
+ setWidth() {
16321
+ let width = formatUnit(this.popupWidth);
16322
+ if (width.indexOf('%') > -1) {
16323
+ const inputWidth = this.inputElement.offsetWidth * parseFloat(width) / 100;
16324
+ width = inputWidth.toString() + 'px';
16325
+ }
16326
+ return width;
16327
+ }
16328
+ destroyPopup() {
16329
+ this.isPopupOpen = false;
16330
+ this.popupObj.destroy();
16331
+ if (isNullOrUndefined(this.target)) {
16332
+ detach(this.popupObj.element);
16333
+ }
16334
+ else {
16335
+ this.popupObj.element.innerHTML = '';
16336
+ this.popupObj.element.removeAttribute('style');
16337
+ this.popupObj.element.removeAttribute('aria-disabled');
16338
+ }
16339
+ }
16340
+ onDocumentClick(e) {
16341
+ const target = e.target;
16342
+ if (!(!isNullOrUndefined(this.popupObj) && closest(target, '#' + this.popupObj.element.id))) {
16343
+ this.hidePopup(e);
16344
+ }
16345
+ }
16346
+ getCoordinates(element, position) {
16347
+ 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'];
16348
+ let div;
16349
+ let span;
16350
+ let range;
16351
+ let globalRange;
16352
+ let coordinates;
16353
+ let computed;
16354
+ let rect;
16355
+ if (!this.isContentEditable(this.inputElement)) {
16356
+ div = this.createElement('div', { className: 'e-form-mirror-div' });
16357
+ document.body.appendChild(div);
16358
+ computed = getComputedStyle(element);
16359
+ div.style.position = 'absolute';
16360
+ div.style.visibility = 'hidden';
16361
+ properties.forEach((prop) => {
16362
+ div.style[prop] = computed[prop];
16363
+ });
16364
+ div.textContent = element.value.substring(0, position);
16365
+ if (this.inputElement.nodeName === 'INPUT') {
16366
+ div.textContent = div.textContent.replace(/\s/g, '\u00a0');
16367
+ }
16368
+ span = this.createElement('span');
16369
+ span.textContent = element.value.substring(position) || '.';
16370
+ div.appendChild(span);
16371
+ rect = element.getBoundingClientRect();
16372
+ }
16373
+ else {
16374
+ const selectedNodePosition = this.getTriggerCharPosition();
16375
+ globalRange = this.range;
16376
+ range = document.createRange();
16377
+ range.setStart(globalRange.startContainer, selectedNodePosition);
16378
+ range.setEnd(globalRange.startContainer, selectedNodePosition);
16379
+ range.collapse(false);
16380
+ rect = range.getBoundingClientRect();
16381
+ }
16382
+ const doc = document.documentElement;
16383
+ const windowLeft = (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);
16384
+ const windowTop = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
16385
+ if (!this.isContentEditable(this.inputElement)) {
16386
+ coordinates = {
16387
+ top: rect.top + windowTop + span.offsetTop + parseInt(computed.borderTopWidth, 10) +
16388
+ parseInt(computed.fontSize, 10) + 3 - element.scrollTop,
16389
+ left: rect.left + windowLeft + span.offsetLeft + parseInt(computed.borderLeftWidth, 10)
16390
+ };
16391
+ document.body.removeChild(div);
16392
+ }
16393
+ else {
16394
+ coordinates = {
16395
+ top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize),
16396
+ left: rect.left + windowLeft
16397
+ };
16398
+ }
16399
+ return coordinates;
16400
+ }
16401
+ ;
16402
+ initValue() {
16403
+ this.renderList();
16404
+ if (this.dataSource instanceof DataManager) {
16405
+ this.initRemoteRender = true;
16406
+ }
16407
+ else {
16408
+ this.updateValues();
16409
+ }
16410
+ }
16411
+ updateValues() {
16412
+ const li = this.list.querySelector('.' + dropDownBaseClasses.focus);
16413
+ if (!isNullOrUndefined(li)) {
16414
+ this.setSelection(li, null);
16415
+ }
16416
+ }
16417
+ renderList() {
16418
+ super.render();
16419
+ this.unWireListEvents();
16420
+ this.wireListEvents();
16421
+ }
16422
+ /**
16423
+ * Event binding for list
16424
+ *
16425
+ * @returns {void}
16426
+ */
16427
+ wireListEvents() {
16428
+ EventHandler.add(this.list, 'click', this.onMouseClick, this);
16429
+ EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
16430
+ EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
16431
+ }
16432
+ /**
16433
+ * Event un binding for list items.
16434
+ *
16435
+ * @returns {void}
16436
+ */
16437
+ unWireListEvents() {
16438
+ EventHandler.remove(this.list, 'click', this.onMouseClick);
16439
+ EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
16440
+ EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
16441
+ }
16442
+ onMouseClick(e) {
16443
+ const target = e.target;
16444
+ const li = closest(target, '.' + dropDownBaseClasses.li);
16445
+ if (!this.isValidLI(li)) {
16446
+ return;
16447
+ }
16448
+ this.setSelection(li, e);
16449
+ const delay = 100;
16450
+ this.closePopup(delay, e);
16451
+ this.inputElement.focus();
16452
+ }
16453
+ updateSelectedItem(li, e, preventSelect, isSelection) {
16454
+ this.removeSelection();
16455
+ li.classList.add(dropDownBaseClasses.selected);
16456
+ this.removeHover();
16457
+ const value = this.getFormattedValue(li.getAttribute('data-value'));
16458
+ const selectedData = this.getDataByValue(value);
16459
+ if (!preventSelect && !isNullOrUndefined(e)) {
16460
+ const items = this.detachChanges(selectedData);
16461
+ this.isSelected = true;
16462
+ const eventArgs = {
16463
+ e: e,
16464
+ item: li,
16465
+ itemData: items,
16466
+ isInteracted: e ? true : false,
16467
+ cancel: false
16468
+ };
16469
+ this.trigger('select', eventArgs, (eventArgs) => {
16470
+ if (eventArgs.cancel) {
16471
+ li.classList.remove(dropDownBaseClasses.selected);
16472
+ }
16473
+ else {
16474
+ this.selectEventCallback(li, selectedData, value);
16475
+ if (isSelection) {
16476
+ this.setSelectOptions(li, e);
16477
+ }
16478
+ }
16479
+ });
16480
+ }
16481
+ else {
16482
+ this.selectEventCallback(li, selectedData, value);
16483
+ if (isSelection) {
16484
+ this.setSelectOptions(li, e);
16485
+ }
16486
+ }
16487
+ }
16488
+ setSelection(li, e) {
16489
+ if (this.isValidLI(li) && (!li.classList.contains(dropDownBaseClasses.selected) || (this.isPopupOpen && this.isSelected
16490
+ && li.classList.contains(dropDownBaseClasses.selected)))) {
16491
+ this.updateSelectedItem(li, e, false, true);
16492
+ }
16493
+ else {
16494
+ this.setSelectOptions(li, e);
16495
+ }
16496
+ }
16497
+ setSelectOptions(li, e) {
16498
+ if (this.list) {
16499
+ this.removeHover();
16500
+ }
16501
+ this.previousSelectedLI = (!isNullOrUndefined(this.selectedLI)) ? this.selectedLI : null;
16502
+ this.selectedLI = li;
16503
+ if (this.isPopupOpen && !isNullOrUndefined(this.selectedLI)) {
16504
+ this.setScrollPosition(e);
16505
+ }
16506
+ if (e && (e.keyCode === 38 || e.keyCode === 40)) {
16507
+ return;
16508
+ }
16509
+ if (isNullOrUndefined(e) || this.setValue(e)) {
16510
+ return;
16511
+ }
16512
+ }
16513
+ setScrollPosition(e) {
16514
+ if (!isNullOrUndefined(e)) {
16515
+ switch (e.action) {
16516
+ case 'pageDown':
16517
+ case 'down':
16518
+ case 'end':
16519
+ this.scrollBottom();
16520
+ break;
16521
+ default:
16522
+ this.scrollTop();
16523
+ break;
16524
+ }
16525
+ }
16526
+ else {
16527
+ this.scrollBottom(true);
16528
+ }
16529
+ }
16530
+ scrollBottom(isInitial) {
16531
+ if (!isNullOrUndefined(this.selectedLI)) {
16532
+ const currentOffset = this.list.offsetHeight;
16533
+ const nextBottom = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
16534
+ let nextOffset = this.list.scrollTop + nextBottom - currentOffset;
16535
+ nextOffset = isInitial ? nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10) * 2 : nextOffset;
16536
+ let boxRange = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
16537
+ if (this.activeIndex === 0) {
16538
+ this.list.scrollTop = 0;
16539
+ }
16540
+ else if (nextBottom > currentOffset || !(boxRange > 0 && this.list.offsetHeight > boxRange)) {
16541
+ this.list.scrollTop = nextOffset;
16542
+ }
16543
+ }
16544
+ }
16545
+ scrollTop() {
16546
+ if (!isNullOrUndefined(this.selectedLI)) {
16547
+ let nextOffset = this.selectedLI.offsetTop - this.list.scrollTop;
16548
+ nextOffset = this.fields.groupBy && nextOffset;
16549
+ const boxRange = (this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop);
16550
+ if (this.activeIndex === 0) {
16551
+ this.list.scrollTop = 0;
16552
+ }
16553
+ else if (nextOffset < 0) {
16554
+ this.list.scrollTop = this.list.scrollTop + nextOffset;
16555
+ }
16556
+ else if (!(boxRange > 0 && this.list.offsetHeight > boxRange)) {
16557
+ this.list.scrollTop = this.selectedLI.offsetTop;
16558
+ }
16559
+ }
16560
+ }
16561
+ selectEventCallback(li, selectedData, value, selectLi) {
16562
+ this.previousItemData = (!isNullOrUndefined(this.itemData)) ? this.itemData : null;
16563
+ this.item = li;
16564
+ this.itemData = selectedData;
16565
+ const focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
16566
+ if (focusedItem) {
16567
+ removeClass([focusedItem], dropDownBaseClasses.focus);
16568
+ }
16569
+ if (selectLi) {
16570
+ addClass([li], dropDownBaseClasses.selected);
16571
+ }
16572
+ li.setAttribute('aria-selected', 'true');
16573
+ this.activeIndex = this.getIndexByValue(value);
16574
+ }
16575
+ detachChanges(value) {
16576
+ let items;
16577
+ if (typeof value === 'string' ||
16578
+ typeof value === 'boolean' ||
16579
+ typeof value === 'number') {
16580
+ items = Object.defineProperties({}, {
16581
+ value: {
16582
+ value: value,
16583
+ enumerable: true
16584
+ },
16585
+ text: {
16586
+ value: value,
16587
+ enumerable: true
16588
+ }
16589
+ });
16590
+ }
16591
+ else {
16592
+ items = value;
16593
+ }
16594
+ return items;
16595
+ }
16596
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
16597
+ setValue(e) {
16598
+ const dataItem = this.getItemData();
16599
+ let textSuffix;
16600
+ let value;
16601
+ let endPos;
16602
+ let range;
16603
+ let globalRange;
16604
+ const selection = this.inputElement.ownerDocument.getSelection();
16605
+ const startPos = this.getTriggerCharPosition();
16606
+ textSuffix = typeof this.suffixText === 'string' ? this.suffixText : '';
16607
+ if (dataItem.value !== null) {
16608
+ value = this.mentionVal(dataItem.text);
16609
+ }
16610
+ if (!this.isContentEditable(this.inputElement)) {
16611
+ const myField = this.inputElement;
16612
+ let currentTriggerSnippet = this.getTextRange().substring(startPos + this.mentionChar.length, this.getTextRange().length);
16613
+ value += textSuffix;
16614
+ endPos = startPos + this.mentionChar.length;
16615
+ endPos += currentTriggerSnippet.length;
16616
+ myField.value = myField.value.substring(0, startPos) + value + myField.value.substring(endPos, myField.value.length);
16617
+ myField.selectionStart = startPos + value.length;
16618
+ myField.selectionEnd = startPos + value.length;
16619
+ if (this.isPopupOpen) {
16620
+ this.hidePopup();
16621
+ }
16622
+ this.onChangeEvent(e);
16623
+ return true;
16624
+ }
16625
+ else {
16626
+ endPos = this.getTriggerCharPosition() + this.mentionChar.length;
16627
+ if (this.range && (this.range.startContainer.textContent.trim() !== this.mentionChar)) {
16628
+ endPos = this.range.endOffset;
16629
+ }
16630
+ globalRange = this.range;
16631
+ range = document.createRange();
16632
+ range.setStart(globalRange.startContainer, startPos);
16633
+ range.setEnd(globalRange.startContainer, endPos);
16634
+ range.deleteContents();
16635
+ const element = this.createElement('div');
16636
+ element.innerHTML = value;
16637
+ const frag = document.createDocumentFragment();
16638
+ let node;
16639
+ let lastNode;
16640
+ while (node = element.firstChild) {
16641
+ lastNode = frag.appendChild(node);
16642
+ }
16643
+ range.insertNode(frag);
16644
+ if (lastNode) {
16645
+ range = range.cloneRange();
16646
+ range.setStartAfter(lastNode);
16647
+ range.collapse(true);
16648
+ selection.removeAllRanges();
16649
+ selection.addRange(range);
16650
+ }
16651
+ if (this.isPopupOpen) {
16652
+ this.hidePopup();
16653
+ }
16654
+ this.onChangeEvent(e);
16655
+ return true;
16656
+ }
16657
+ }
16658
+ mentionVal(value) {
16659
+ let showChar = this.showMentionChar ? this.mentionChar : '';
16660
+ if (!isNullOrUndefined(this.displayTemplate)) {
16661
+ value = this.setDisplayTemplate();
16662
+ }
16663
+ if (this.isContentEditable(this.inputElement)) {
16664
+ return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
16665
+ }
16666
+ else {
16667
+ return showChar + value;
16668
+ }
16669
+ }
16670
+ setDisplayTemplate() {
16671
+ let compiledString;
16672
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16673
+ if (this.isReact) {
16674
+ this.clearTemplate(['displayTemplate']);
16675
+ if (this.displayTempElement) {
16676
+ detach(this.displayTempElement);
16677
+ this.displayTempElement = null;
16678
+ }
16679
+ }
16680
+ if (!this.displayTempElement) {
16681
+ this.displayTempElement = this.createElement('div');
16682
+ }
16683
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16684
+ if (!this.isReact) {
16685
+ this.displayTempElement.innerHTML = '';
16686
+ }
16687
+ compiledString = compile(this.displayTemplate);
16688
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16689
+ const displayCompTemp = compiledString(this.itemData, this, 'displayTemplate', this.displayTemplateId, this.isStringTemplate, null, this.displayTempElement);
16690
+ if (displayCompTemp && displayCompTemp.length > 0) {
16691
+ for (let i = 0; i < displayCompTemp.length; i++) {
16692
+ this.displayTempElement.appendChild(displayCompTemp[i]);
16693
+ }
16694
+ }
16695
+ this.renderReactTemplates();
16696
+ return this.displayTempElement.innerHTML;
16697
+ }
16698
+ setSpinnerTemplate() {
16699
+ let compiledString;
16700
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16701
+ if (this.isReact) {
16702
+ this.clearTemplate(['spinnerTemplate']);
16703
+ if (this.spinnerTemplateElement) {
16704
+ detach(this.spinnerTemplateElement);
16705
+ this.spinnerTemplateElement = null;
16706
+ }
16707
+ }
16708
+ if (!this.spinnerTemplateElement) {
16709
+ this.spinnerTemplateElement = this.createElement('div');
16710
+ }
16711
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16712
+ if (!this.isReact) {
16713
+ this.spinnerTemplateElement.innerHTML = '';
16714
+ }
16715
+ compiledString = compile(this.spinnerTemplate);
16716
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16717
+ const spinnerCompTemp = compiledString(null, this, 'spinnerTemplate', this.spinnerTemplateId, this.isStringTemplate, null, this.spinnerTemplateElement);
16718
+ if (spinnerCompTemp && spinnerCompTemp.length > 0) {
16719
+ for (let i = 0; i < spinnerCompTemp.length; i++) {
16720
+ this.spinnerTemplateElement.appendChild(spinnerCompTemp[i]);
16721
+ }
16722
+ }
16723
+ this.renderReactTemplates();
16724
+ }
16725
+ onChangeEvent(eve) {
16726
+ this.isSelected = false;
16727
+ const items = this.detachMentionChanges(this.itemData);
16728
+ let preItems;
16729
+ if (typeof this.previousItemData === 'string' ||
16730
+ typeof this.previousItemData === 'boolean' ||
16731
+ typeof this.previousItemData === 'number') {
16732
+ preItems = Object.defineProperties({}, {
16733
+ value: {
16734
+ value: this.previousItemData,
16735
+ enumerable: true
16736
+ },
16737
+ text: {
16738
+ value: this.previousItemData,
16739
+ enumerable: true
16740
+ }
16741
+ });
16742
+ }
16743
+ else {
16744
+ preItems = this.previousItemData;
16745
+ }
16746
+ const eventArgs = {
16747
+ e: eve,
16748
+ item: this.item,
16749
+ itemData: items,
16750
+ previousItem: this.previousSelectedLI,
16751
+ previousItemData: preItems,
16752
+ isInteracted: eve ? true : false,
16753
+ value: this.item.innerHTML,
16754
+ element: this.inputElement
16755
+ };
16756
+ this.trigger('change', eventArgs);
16757
+ }
16758
+ detachMentionChanges(value) {
16759
+ let items;
16760
+ if (typeof value === 'string' ||
16761
+ typeof value === 'boolean' ||
16762
+ typeof value === 'number') {
16763
+ items = Object.defineProperties({}, {
16764
+ value: {
16765
+ value: value,
16766
+ enumerable: true
16767
+ },
16768
+ text: {
16769
+ value: value,
16770
+ enumerable: true
16771
+ }
16772
+ });
16773
+ }
16774
+ else {
16775
+ items = value;
16776
+ }
16777
+ return items;
16778
+ }
16779
+ getItemData() {
16780
+ const fields = this.fields;
16781
+ let dataItem = null;
16782
+ dataItem = this.itemData;
16783
+ let dataValue;
16784
+ let dataText;
16785
+ if (!isNullOrUndefined(dataItem)) {
16786
+ dataValue = getValue(fields.value, dataItem);
16787
+ dataText = getValue(fields.text, dataItem);
16788
+ }
16789
+ const value = (!isNullOrUndefined(dataItem) &&
16790
+ !isUndefined(dataValue) ? dataValue : dataItem);
16791
+ const text = (!isNullOrUndefined(dataItem) &&
16792
+ !isUndefined(dataValue) ? dataText : dataItem);
16793
+ return { value: value, text: text };
16794
+ }
16795
+ removeSelection() {
16796
+ if (this.list) {
16797
+ const selectedItems = this.list.querySelectorAll('.' + dropDownBaseClasses.selected);
16798
+ if (selectedItems.length) {
16799
+ removeClass(selectedItems, dropDownBaseClasses.selected);
16800
+ selectedItems[0].removeAttribute('aria-selected');
16801
+ }
16802
+ }
16803
+ }
16804
+ onMouseOver(e) {
16805
+ const currentLi = closest(e.target, '.' + dropDownBaseClasses.li);
16806
+ this.setHover(currentLi);
16807
+ }
16808
+ setHover(li) {
16809
+ if (this.enabled && this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.hover)) {
16810
+ this.removeHover();
16811
+ addClass([li], dropDownBaseClasses.hover);
16812
+ }
16813
+ }
16814
+ removeHover() {
16815
+ if (this.list) {
16816
+ const hoveredItem = this.list.querySelectorAll('.' + dropDownBaseClasses.hover);
16817
+ if (hoveredItem && hoveredItem.length) {
16818
+ removeClass(hoveredItem, dropDownBaseClasses.hover);
16819
+ }
16820
+ }
16821
+ }
16822
+ isValidLI(li) {
16823
+ return (li && li.hasAttribute('role') && li.getAttribute('role') === 'option');
16824
+ }
16825
+ onMouseLeave() {
16826
+ this.removeHover();
16827
+ }
16828
+ /**
16829
+ * Search the entered text and show it in the suggestion list if available.
16830
+ *
16831
+ * @returns {void}
16832
+ */
16833
+ search(text, positionX, positionY) {
16834
+ if ((this.ignoreCase && (text === this.elementValue() || text === this.elementValue().toLowerCase()))
16835
+ || !this.ignoreCase && text === this.elementValue()) {
16836
+ this.resetList(this.dataSource, this.fields);
16837
+ }
16838
+ else {
16839
+ if (this.isPopupOpen) {
16840
+ this.hidePopup();
16841
+ }
16842
+ return;
16843
+ }
16844
+ if (isNullOrUndefined(this.list)) {
16845
+ this.renderList();
16846
+ this.renderPopup();
16847
+ }
16848
+ else {
16849
+ this.showPopup();
16850
+ }
16851
+ this.popupObj.element.style.left = formatUnit(positionX);
16852
+ this.popupObj.element.style.top = formatUnit(positionY);
16853
+ }
16854
+ /**
16855
+ * Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
16856
+ *
16857
+ * @method destroy
16858
+ * @returns {void}
16859
+ */
16860
+ destroy() {
16861
+ this.hidePopup();
16862
+ this.unWireEvent();
16863
+ if (this.list) {
16864
+ this.unWireListEvents();
16865
+ }
16866
+ if (this.inputElement && !this.inputElement.classList.contains('e-' + this.getModuleName())) {
16867
+ return;
16868
+ }
16869
+ super.destroy();
16870
+ }
16871
+ getLocaleName() {
16872
+ return 'mention';
16873
+ }
16874
+ getNgDirective() {
16875
+ return 'EJS-MENTION';
16876
+ }
16877
+ /**
16878
+ * Return the module name of this component.
16879
+ *
16880
+ * @private
16881
+ * @returns {string} Return the module name of this component.
16882
+ */
16883
+ getModuleName() {
16884
+ return 'mention';
16885
+ }
16886
+ };
16887
+ __decorate$7([
16888
+ Property(null)
16889
+ ], Mention.prototype, "cssClass", void 0);
16890
+ __decorate$7([
16891
+ Property('@')
16892
+ ], Mention.prototype, "mentionChar", void 0);
16893
+ __decorate$7([
16894
+ Property(false)
16895
+ ], Mention.prototype, "showMentionChar", void 0);
16896
+ __decorate$7([
16897
+ Property(false)
16898
+ ], Mention.prototype, "allowSpaces", void 0);
16899
+ __decorate$7([
16900
+ Property(null)
16901
+ ], Mention.prototype, "suffixText", void 0);
16902
+ __decorate$7([
16903
+ Property(25)
16904
+ ], Mention.prototype, "suggestionCount", void 0);
16905
+ __decorate$7([
16906
+ Property(0)
16907
+ ], Mention.prototype, "minLength", void 0);
16908
+ __decorate$7([
16909
+ Property('None')
16910
+ ], Mention.prototype, "sortOrder", void 0);
16911
+ __decorate$7([
16912
+ Property(true)
16913
+ ], Mention.prototype, "ignoreCase", void 0);
16914
+ __decorate$7([
16915
+ Property(false)
16916
+ ], Mention.prototype, "highlight", void 0);
16917
+ __decorate$7([
16918
+ Property()
16919
+ ], Mention.prototype, "locale", void 0);
16920
+ __decorate$7([
16921
+ Property('auto')
16922
+ ], Mention.prototype, "popupWidth", void 0);
16923
+ __decorate$7([
16924
+ Property('300px')
16925
+ ], Mention.prototype, "popupHeight", void 0);
16926
+ __decorate$7([
16927
+ Property(null)
16928
+ ], Mention.prototype, "displayTemplate", void 0);
16929
+ __decorate$7([
16930
+ Property(null)
16931
+ ], Mention.prototype, "itemTemplate", void 0);
16932
+ __decorate$7([
16933
+ Property('No records found')
16934
+ ], Mention.prototype, "noRecordsTemplate", void 0);
16935
+ __decorate$7([
16936
+ Property(null)
16937
+ ], Mention.prototype, "spinnerTemplate", void 0);
16938
+ __decorate$7([
16939
+ Property()
16940
+ ], Mention.prototype, "target", void 0);
16941
+ __decorate$7([
16942
+ Property([])
16943
+ ], Mention.prototype, "dataSource", void 0);
16944
+ __decorate$7([
16945
+ Property(null)
16946
+ ], Mention.prototype, "query", void 0);
16947
+ __decorate$7([
16948
+ Property('Contains')
16949
+ ], Mention.prototype, "filterType", void 0);
16950
+ __decorate$7([
16951
+ Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
16952
+ ], Mention.prototype, "fields", void 0);
16953
+ __decorate$7([
16954
+ Event()
16955
+ ], Mention.prototype, "actionBegin", void 0);
16956
+ __decorate$7([
16957
+ Event()
16958
+ ], Mention.prototype, "actionComplete", void 0);
16959
+ __decorate$7([
16960
+ Event()
16961
+ ], Mention.prototype, "actionFailure", void 0);
16962
+ __decorate$7([
16963
+ Event()
16964
+ ], Mention.prototype, "change", void 0);
16965
+ __decorate$7([
16966
+ Event()
16967
+ ], Mention.prototype, "beforeOpen", void 0);
16968
+ __decorate$7([
16969
+ Event()
16970
+ ], Mention.prototype, "opened", void 0);
16971
+ __decorate$7([
16972
+ Event()
16973
+ ], Mention.prototype, "closed", void 0);
16974
+ __decorate$7([
16975
+ Event()
16976
+ ], Mention.prototype, "select", void 0);
16977
+ __decorate$7([
16978
+ Event()
16979
+ ], Mention.prototype, "filtering", void 0);
16980
+ __decorate$7([
16981
+ Event()
16982
+ ], Mention.prototype, "created", void 0);
16983
+ __decorate$7([
16984
+ Event()
16985
+ ], Mention.prototype, "destroyed", void 0);
16986
+ Mention = __decorate$7([
16987
+ NotifyPropertyChanges
16988
+ ], Mention);
16989
+
15600
16990
  /**
15601
16991
  * export all modules from current location
15602
16992
  */
@@ -15605,5 +16995,5 @@ const listBoxClasses = {
15605
16995
  * export all modules from current location
15606
16996
  */
15607
16997
 
15608
- 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 };
16998
+ 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 };
15609
16999
  //# sourceMappingURL=ej2-dropdowns.es2015.js.map