@syncfusion/ej2-dropdowns 20.2.50 → 20.3.48

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 (361) hide show
  1. package/CHANGELOG.md +18 -24
  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 +1424 -51
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +1450 -55
  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 +2 -2
  16. package/src/combo-box/combo-box.js +0 -3
  17. package/src/drop-down-base/drop-down-base.d.ts +2 -0
  18. package/src/drop-down-base/drop-down-base.js +8 -2
  19. package/src/drop-down-list/drop-down-list.d.ts +1 -0
  20. package/src/drop-down-list/drop-down-list.js +23 -22
  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 +452 -0
  28. package/src/mention/mention.js +1383 -0
  29. package/src/multi-select/checkbox-selection.js +1 -4
  30. package/src/multi-select/multi-select.d.ts +1 -0
  31. package/src/multi-select/multi-select.js +20 -11
  32. package/styles/auto-complete/_all.scss +1 -1
  33. package/styles/auto-complete/_bootstrap-dark-definition.scss +1 -1
  34. package/styles/auto-complete/_bootstrap-definition.scss +1 -1
  35. package/styles/auto-complete/_bootstrap4-definition.scss +2 -2
  36. package/styles/auto-complete/_bootstrap5-definition.scss +1 -1
  37. package/styles/auto-complete/_fabric-dark-definition.scss +1 -1
  38. package/styles/auto-complete/_fabric-definition.scss +1 -1
  39. package/styles/auto-complete/_fluent-definition.scss +1 -1
  40. package/styles/auto-complete/_fusionnew-definition.scss +1 -1
  41. package/styles/auto-complete/_highcontrast-definition.scss +1 -1
  42. package/styles/auto-complete/_highcontrast-light-definition.scss +1 -1
  43. package/styles/auto-complete/_material-dark-definition.scss +1 -1
  44. package/styles/auto-complete/_material-definition.scss +1 -1
  45. package/styles/auto-complete/_material3-definition.scss +1 -1
  46. package/styles/auto-complete/_tailwind-definition.scss +1 -1
  47. package/styles/auto-complete/bootstrap-dark.css +3 -1
  48. package/styles/auto-complete/bootstrap.css +3 -1
  49. package/styles/auto-complete/bootstrap4.css +3 -1
  50. package/styles/auto-complete/bootstrap5-dark.css +3 -1
  51. package/styles/auto-complete/bootstrap5.css +3 -1
  52. package/styles/auto-complete/fabric-dark.css +3 -1
  53. package/styles/auto-complete/fabric.css +3 -1
  54. package/styles/auto-complete/fluent-dark.css +3 -1
  55. package/styles/auto-complete/fluent.css +3 -1
  56. package/styles/auto-complete/highcontrast-light.css +3 -1
  57. package/styles/auto-complete/highcontrast.css +3 -1
  58. package/styles/auto-complete/material-dark.css +3 -1
  59. package/styles/auto-complete/material.css +3 -1
  60. package/styles/auto-complete/tailwind-dark.css +3 -1
  61. package/styles/auto-complete/tailwind.css +3 -1
  62. package/styles/bootstrap-dark.css +94 -42
  63. package/styles/bootstrap-dark.scss +1 -0
  64. package/styles/bootstrap.css +94 -42
  65. package/styles/bootstrap.scss +1 -0
  66. package/styles/bootstrap4.css +95 -42
  67. package/styles/bootstrap4.scss +1 -0
  68. package/styles/bootstrap5-dark.css +101 -44
  69. package/styles/bootstrap5-dark.scss +1 -0
  70. package/styles/bootstrap5.css +101 -44
  71. package/styles/bootstrap5.scss +1 -0
  72. package/styles/combo-box/_all.scss +1 -1
  73. package/styles/combo-box/_bootstrap-dark-definition.scss +1 -1
  74. package/styles/combo-box/_bootstrap-definition.scss +1 -1
  75. package/styles/combo-box/_bootstrap4-definition.scss +2 -2
  76. package/styles/combo-box/_bootstrap5-definition.scss +1 -1
  77. package/styles/combo-box/_fabric-dark-definition.scss +1 -1
  78. package/styles/combo-box/_fabric-definition.scss +1 -1
  79. package/styles/combo-box/_fluent-definition.scss +1 -1
  80. package/styles/combo-box/_fusionnew-definition.scss +1 -1
  81. package/styles/combo-box/_highcontrast-definition.scss +1 -1
  82. package/styles/combo-box/_highcontrast-light-definition.scss +1 -1
  83. package/styles/combo-box/_material-dark-definition.scss +1 -1
  84. package/styles/combo-box/_material-definition.scss +1 -1
  85. package/styles/combo-box/_material3-definition.scss +1 -1
  86. package/styles/combo-box/_tailwind-definition.scss +1 -1
  87. package/styles/combo-box/bootstrap-dark.css +3 -1
  88. package/styles/combo-box/bootstrap.css +3 -1
  89. package/styles/combo-box/bootstrap4.css +3 -1
  90. package/styles/combo-box/bootstrap5-dark.css +3 -1
  91. package/styles/combo-box/bootstrap5.css +3 -1
  92. package/styles/combo-box/fabric-dark.css +3 -1
  93. package/styles/combo-box/fabric.css +3 -1
  94. package/styles/combo-box/fluent-dark.css +3 -1
  95. package/styles/combo-box/fluent.css +3 -1
  96. package/styles/combo-box/highcontrast-light.css +3 -1
  97. package/styles/combo-box/highcontrast.css +3 -1
  98. package/styles/combo-box/material-dark.css +3 -1
  99. package/styles/combo-box/material.css +3 -1
  100. package/styles/combo-box/tailwind-dark.css +3 -1
  101. package/styles/combo-box/tailwind.css +3 -1
  102. package/styles/drop-down-base/_all.scss +1 -1
  103. package/styles/drop-down-base/_bootstrap-dark-definition.scss +8 -2
  104. package/styles/drop-down-base/_bootstrap-definition.scss +6 -1
  105. package/styles/drop-down-base/_bootstrap4-definition.scss +6 -1
  106. package/styles/drop-down-base/_bootstrap5-definition.scss +8 -3
  107. package/styles/drop-down-base/_fabric-dark-definition.scss +6 -1
  108. package/styles/drop-down-base/_fabric-definition.scss +6 -1
  109. package/styles/drop-down-base/_fluent-definition.scss +8 -2
  110. package/styles/drop-down-base/_fusionnew-definition.scss +8 -3
  111. package/styles/drop-down-base/_highcontrast-definition.scss +16 -6
  112. package/styles/drop-down-base/_highcontrast-light-definition.scss +18 -7
  113. package/styles/drop-down-base/_layout.scss +44 -3
  114. package/styles/drop-down-base/_material-dark-definition.scss +7 -1
  115. package/styles/drop-down-base/_material-definition.scss +6 -0
  116. package/styles/drop-down-base/_material3-definition.scss +8 -3
  117. package/styles/drop-down-base/_tailwind-definition.scss +8 -3
  118. package/styles/drop-down-base/_theme.scss +4 -4
  119. package/styles/drop-down-base/bootstrap-dark.css +42 -1
  120. package/styles/drop-down-base/bootstrap.css +42 -1
  121. package/styles/drop-down-base/bootstrap4.css +42 -1
  122. package/styles/drop-down-base/bootstrap5-dark.css +42 -1
  123. package/styles/drop-down-base/bootstrap5.css +42 -1
  124. package/styles/drop-down-base/fabric-dark.css +42 -1
  125. package/styles/drop-down-base/fabric.css +42 -1
  126. package/styles/drop-down-base/fluent-dark.css +42 -1
  127. package/styles/drop-down-base/fluent.css +42 -1
  128. package/styles/drop-down-base/highcontrast-light.css +42 -1
  129. package/styles/drop-down-base/highcontrast.css +42 -1
  130. package/styles/drop-down-base/material-dark.css +42 -1
  131. package/styles/drop-down-base/material.css +42 -1
  132. package/styles/drop-down-base/tailwind-dark.css +42 -1
  133. package/styles/drop-down-base/tailwind.css +42 -1
  134. package/styles/drop-down-list/_all.scss +2 -1
  135. package/styles/drop-down-list/_bootstrap-dark-definition.scss +2 -1
  136. package/styles/drop-down-list/_bootstrap-definition.scss +2 -1
  137. package/styles/drop-down-list/_bootstrap4-definition.scss +3 -1
  138. package/styles/drop-down-list/_bootstrap5-definition.scss +3 -3
  139. package/styles/drop-down-list/_fabric-dark-definition.scss +2 -1
  140. package/styles/drop-down-list/_fabric-definition.scss +2 -0
  141. package/styles/drop-down-list/_fluent-definition.scss +2 -1
  142. package/styles/drop-down-list/_fusionnew-definition.scss +3 -3
  143. package/styles/drop-down-list/_highcontrast-definition.scss +21 -10
  144. package/styles/drop-down-list/_highcontrast-light-definition.scss +22 -11
  145. package/styles/drop-down-list/_layout.scss +8 -9
  146. package/styles/drop-down-list/_material-dark-definition.scss +2 -2
  147. package/styles/drop-down-list/_material-definition.scss +1 -0
  148. package/styles/drop-down-list/_material3-definition.scss +3 -3
  149. package/styles/drop-down-list/_tailwind-definition.scss +1 -0
  150. package/styles/drop-down-list/_theme.scss +3 -3
  151. package/styles/drop-down-list/bootstrap-dark.css +5 -0
  152. package/styles/drop-down-list/bootstrap.css +5 -0
  153. package/styles/drop-down-list/bootstrap4.css +5 -0
  154. package/styles/drop-down-list/bootstrap5-dark.css +6 -0
  155. package/styles/drop-down-list/bootstrap5.css +6 -0
  156. package/styles/drop-down-list/fabric-dark.css +5 -0
  157. package/styles/drop-down-list/fabric.css +5 -0
  158. package/styles/drop-down-list/fluent-dark.css +6 -0
  159. package/styles/drop-down-list/fluent.css +6 -0
  160. package/styles/drop-down-list/highcontrast-light.css +5 -0
  161. package/styles/drop-down-list/highcontrast.css +5 -0
  162. package/styles/drop-down-list/icons/_bootstrap.scss +0 -1
  163. package/styles/drop-down-list/icons/_fabric.scss +0 -1
  164. package/styles/drop-down-list/icons/_material.scss +0 -1
  165. package/styles/drop-down-list/material-dark.css +5 -0
  166. package/styles/drop-down-list/material.css +5 -0
  167. package/styles/drop-down-list/tailwind-dark.css +6 -0
  168. package/styles/drop-down-list/tailwind.css +6 -0
  169. package/styles/drop-down-tree/_all.scss +1 -1
  170. package/styles/drop-down-tree/_bootstrap-dark-definition.scss +1 -1
  171. package/styles/drop-down-tree/_bootstrap-definition.scss +1 -1
  172. package/styles/drop-down-tree/_bootstrap4-definition.scss +1 -1
  173. package/styles/drop-down-tree/_bootstrap5-definition.scss +2 -2
  174. package/styles/drop-down-tree/_fabric-dark-definition.scss +1 -1
  175. package/styles/drop-down-tree/_fabric-definition.scss +2 -2
  176. package/styles/drop-down-tree/_fluent-definition.scss +2 -2
  177. package/styles/drop-down-tree/_fusionnew-definition.scss +2 -2
  178. package/styles/drop-down-tree/_highcontrast-definition.scss +1 -1
  179. package/styles/drop-down-tree/_highcontrast-light-definition.scss +1 -1
  180. package/styles/drop-down-tree/_layout.scss +1 -2
  181. package/styles/drop-down-tree/_material-dark-definition.scss +2 -2
  182. package/styles/drop-down-tree/_material-definition.scss +2 -2
  183. package/styles/drop-down-tree/_material3-definition.scss +2 -2
  184. package/styles/drop-down-tree/_tailwind-definition.scss +2 -2
  185. package/styles/drop-down-tree/bootstrap-dark.css +4 -0
  186. package/styles/drop-down-tree/bootstrap.css +4 -0
  187. package/styles/drop-down-tree/bootstrap4.css +4 -0
  188. package/styles/drop-down-tree/bootstrap5-dark.css +5 -0
  189. package/styles/drop-down-tree/bootstrap5.css +5 -0
  190. package/styles/drop-down-tree/fabric-dark.css +4 -0
  191. package/styles/drop-down-tree/fabric.css +4 -0
  192. package/styles/drop-down-tree/fluent-dark.css +5 -0
  193. package/styles/drop-down-tree/fluent.css +5 -0
  194. package/styles/drop-down-tree/highcontrast-light.css +4 -0
  195. package/styles/drop-down-tree/highcontrast.css +4 -0
  196. package/styles/drop-down-tree/icons/_bootstrap.scss +0 -1
  197. package/styles/drop-down-tree/icons/_bootstrap4.scss +0 -1
  198. package/styles/drop-down-tree/icons/_fabric.scss +0 -1
  199. package/styles/drop-down-tree/icons/_highcontrast-light.scss +0 -1
  200. package/styles/drop-down-tree/icons/_highcontrast.scss +0 -1
  201. package/styles/drop-down-tree/icons/_material-dark.scss +0 -1
  202. package/styles/drop-down-tree/icons/_material.scss +0 -1
  203. package/styles/drop-down-tree/material-dark.css +4 -0
  204. package/styles/drop-down-tree/material.css +4 -0
  205. package/styles/drop-down-tree/tailwind-dark.css +5 -0
  206. package/styles/drop-down-tree/tailwind.css +5 -0
  207. package/styles/fabric-dark.css +94 -42
  208. package/styles/fabric-dark.scss +1 -0
  209. package/styles/fabric.css +94 -42
  210. package/styles/fabric.scss +1 -0
  211. package/styles/fluent-dark.css +101 -44
  212. package/styles/fluent-dark.scss +1 -0
  213. package/styles/fluent.css +101 -44
  214. package/styles/fluent.scss +1 -0
  215. package/styles/highcontrast-light.css +97 -42
  216. package/styles/highcontrast-light.scss +1 -0
  217. package/styles/highcontrast.css +97 -42
  218. package/styles/highcontrast.scss +1 -0
  219. package/styles/list-box/_all.scss +1 -1
  220. package/styles/list-box/_bootstrap-dark-definition.scss +2 -0
  221. package/styles/list-box/_bootstrap-definition.scss +1 -0
  222. package/styles/list-box/_bootstrap4-definition.scss +1 -0
  223. package/styles/list-box/_bootstrap5-definition.scss +3 -0
  224. package/styles/list-box/_fabric-dark-definition.scss +3 -1
  225. package/styles/list-box/_fabric-definition.scss +1 -0
  226. package/styles/list-box/_fluent-definition.scss +3 -0
  227. package/styles/list-box/_fusionnew-definition.scss +1 -0
  228. package/styles/list-box/_highcontrast-definition.scss +1 -0
  229. package/styles/list-box/_highcontrast-light-definition.scss +3 -1
  230. package/styles/list-box/_layout.scss +8 -17
  231. package/styles/list-box/_material-dark-definition.scss +2 -0
  232. package/styles/list-box/_material-definition.scss +1 -0
  233. package/styles/list-box/_material3-definition.scss +1 -0
  234. package/styles/list-box/_tailwind-definition.scss +3 -0
  235. package/styles/list-box/_theme.scss +11 -25
  236. package/styles/list-box/bootstrap-dark.css +12 -33
  237. package/styles/list-box/bootstrap.css +14 -35
  238. package/styles/list-box/bootstrap4.css +14 -35
  239. package/styles/list-box/bootstrap5-dark.css +15 -36
  240. package/styles/list-box/bootstrap5.css +15 -36
  241. package/styles/list-box/fabric-dark.css +12 -33
  242. package/styles/list-box/fabric.css +14 -35
  243. package/styles/list-box/fluent-dark.css +15 -36
  244. package/styles/list-box/fluent.css +15 -36
  245. package/styles/list-box/highcontrast-light.css +12 -33
  246. package/styles/list-box/highcontrast.css +14 -35
  247. package/styles/list-box/icons/_bootstrap-dark.scss +2 -2
  248. package/styles/list-box/icons/_bootstrap.scss +1 -1
  249. package/styles/list-box/icons/_bootstrap4.scss +1 -1
  250. package/styles/list-box/icons/_bootstrap5.scss +1 -1
  251. package/styles/list-box/icons/_fabric-dark.scss +1 -1
  252. package/styles/list-box/icons/_fabric.scss +1 -1
  253. package/styles/list-box/icons/_fluent.scss +1 -1
  254. package/styles/list-box/icons/_fusionnew.scss +1 -1
  255. package/styles/list-box/icons/_highcontrast-light.scss +1 -1
  256. package/styles/list-box/icons/_highcontrast.scss +1 -1
  257. package/styles/list-box/icons/_material-dark.scss +1 -1
  258. package/styles/list-box/icons/_material.scss +2 -2
  259. package/styles/list-box/icons/_material3.scss +1 -1
  260. package/styles/list-box/icons/_tailwind-dark.scss +1 -1
  261. package/styles/list-box/icons/_tailwind.scss +1 -1
  262. package/styles/list-box/material-dark.css +12 -33
  263. package/styles/list-box/material.css +14 -35
  264. package/styles/list-box/tailwind-dark.css +15 -36
  265. package/styles/list-box/tailwind.css +15 -36
  266. package/styles/material-dark.css +94 -42
  267. package/styles/material-dark.scss +1 -0
  268. package/styles/material.css +94 -42
  269. package/styles/material.scss +1 -0
  270. package/styles/mention/_all.scss +1 -0
  271. package/styles/mention/_bootstrap-dark-definition.scss +3 -0
  272. package/styles/mention/_bootstrap-definition.scss +3 -0
  273. package/styles/mention/_bootstrap4-definition.scss +3 -0
  274. package/styles/mention/_bootstrap5-dark-definition.scss +1 -0
  275. package/styles/mention/_bootstrap5-definition.scss +1 -0
  276. package/styles/mention/_fabric-dark-definition.scss +2 -0
  277. package/styles/mention/_fabric-definition.scss +3 -0
  278. package/styles/mention/_fluent-dark-definition.scss +1 -0
  279. package/styles/mention/_fluent-definition.scss +1 -0
  280. package/styles/mention/_fusionnew-definition.scss +1 -0
  281. package/styles/mention/_highcontrast-definition.scss +3 -0
  282. package/styles/mention/_highcontrast-light-definition.scss +3 -0
  283. package/styles/mention/_layout.scss +6 -0
  284. package/styles/mention/_material-dark-definition.scss +3 -0
  285. package/styles/mention/_material-definition.scss +3 -0
  286. package/styles/mention/_material3-definition.scss +1 -0
  287. package/styles/mention/_tailwind-dark-definition.scss +1 -0
  288. package/styles/mention/_tailwind-definition.scss +1 -0
  289. package/styles/mention/bootstrap-dark.css +29 -0
  290. package/styles/mention/bootstrap-dark.scss +6 -0
  291. package/styles/mention/bootstrap.css +29 -0
  292. package/styles/mention/bootstrap.scss +6 -0
  293. package/styles/mention/bootstrap4.css +47 -0
  294. package/styles/mention/bootstrap4.scss +6 -0
  295. package/styles/mention/bootstrap5-dark.css +58 -0
  296. package/styles/mention/bootstrap5-dark.scss +6 -0
  297. package/styles/mention/bootstrap5.css +58 -0
  298. package/styles/mention/bootstrap5.scss +6 -0
  299. package/styles/mention/fabric-dark.css +29 -0
  300. package/styles/mention/fabric-dark.scss +6 -0
  301. package/styles/mention/fabric.css +29 -0
  302. package/styles/mention/fabric.scss +6 -0
  303. package/styles/mention/fluent-dark.css +58 -0
  304. package/styles/mention/fluent-dark.scss +6 -0
  305. package/styles/mention/fluent.css +58 -0
  306. package/styles/mention/fluent.scss +6 -0
  307. package/styles/mention/highcontrast-light.css +43 -0
  308. package/styles/mention/highcontrast-light.scss +6 -0
  309. package/styles/mention/highcontrast.css +43 -0
  310. package/styles/mention/highcontrast.scss +6 -0
  311. package/styles/mention/material-dark.css +29 -0
  312. package/styles/mention/material-dark.scss +6 -0
  313. package/styles/mention/material.css +29 -0
  314. package/styles/mention/material.scss +6 -0
  315. package/styles/mention/tailwind-dark.css +68 -0
  316. package/styles/mention/tailwind-dark.scss +6 -0
  317. package/styles/mention/tailwind.css +68 -0
  318. package/styles/mention/tailwind.scss +6 -0
  319. package/styles/multi-select/_all.scss +1 -1
  320. package/styles/multi-select/_bootstrap-dark-definition.scss +4 -1
  321. package/styles/multi-select/_bootstrap-definition.scss +2 -0
  322. package/styles/multi-select/_bootstrap4-definition.scss +5 -2
  323. package/styles/multi-select/_bootstrap5-definition.scss +2 -2
  324. package/styles/multi-select/_fabric-dark-definition.scss +5 -3
  325. package/styles/multi-select/_fabric-definition.scss +4 -2
  326. package/styles/multi-select/_fluent-definition.scss +2 -1
  327. package/styles/multi-select/_fusionnew-definition.scss +2 -2
  328. package/styles/multi-select/_highcontrast-definition.scss +47 -24
  329. package/styles/multi-select/_highcontrast-light-definition.scss +48 -25
  330. package/styles/multi-select/_layout.scss +59 -71
  331. package/styles/multi-select/_material-dark-definition.scss +3 -1
  332. package/styles/multi-select/_material-definition.scss +1 -0
  333. package/styles/multi-select/_material3-definition.scss +2 -2
  334. package/styles/multi-select/_tailwind-definition.scss +2 -3
  335. package/styles/multi-select/_theme.scss +16 -21
  336. package/styles/multi-select/bootstrap-dark.css +10 -6
  337. package/styles/multi-select/bootstrap.css +10 -6
  338. package/styles/multi-select/bootstrap4.css +10 -6
  339. package/styles/multi-select/bootstrap5-dark.css +11 -6
  340. package/styles/multi-select/bootstrap5.css +11 -6
  341. package/styles/multi-select/fabric-dark.css +10 -6
  342. package/styles/multi-select/fabric.css +10 -6
  343. package/styles/multi-select/fluent-dark.css +11 -6
  344. package/styles/multi-select/fluent.css +11 -6
  345. package/styles/multi-select/highcontrast-light.css +13 -6
  346. package/styles/multi-select/highcontrast.css +13 -6
  347. package/styles/multi-select/icons/_bootstrap5.scss +0 -1
  348. package/styles/multi-select/icons/_fluent.scss +0 -1
  349. package/styles/multi-select/icons/_fusionnew.scss +0 -1
  350. package/styles/multi-select/icons/_material-dark.scss +53 -54
  351. package/styles/multi-select/icons/_material.scss +53 -54
  352. package/styles/multi-select/icons/_material3.scss +0 -1
  353. package/styles/multi-select/icons/_tailwind.scss +0 -1
  354. package/styles/multi-select/material-dark.css +10 -6
  355. package/styles/multi-select/material.css +10 -6
  356. package/styles/multi-select/tailwind-dark.css +11 -6
  357. package/styles/multi-select/tailwind.css +11 -6
  358. package/styles/tailwind-dark.css +102 -44
  359. package/styles/tailwind-dark.scss +1 -0
  360. package/styles/tailwind.css +102 -44
  361. package/styles/tailwind.scss +1 -0
@@ -232,6 +232,8 @@ var dropDownBaseClasses = {
232
232
  grouping: 'e-dd-group'
233
233
  };
234
234
  var ITEMTEMPLATE_PROPERTY = 'ItemTemplate';
235
+ var DISPLAYTEMPLATE_PROPERTY = 'DisplayTemplate';
236
+ var SPINNERTEMPLATE_PROPERTY = 'SpinnerTemplate';
235
237
  var VALUETEMPLATE_PROPERTY = 'ValueTemplate';
236
238
  var GROUPTEMPLATE_PROPERTY = 'GroupTemplate';
237
239
  var HEADERTEMPLATE_PROPERTY = 'HeaderTemplate';
@@ -429,7 +431,8 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
429
431
  this.l10n = componentLocale;
430
432
  }
431
433
  else {
432
- this.l10n = new L10n(this.getModuleName() === 'listbox' ? 'listbox' : 'dropdowns', l10nLocale, this.locale);
434
+ this.l10n = new L10n(this.getModuleName() === 'listbox' ? 'listbox' :
435
+ this.getModuleName() === 'mention' ? 'mention' : 'dropdowns', l10nLocale, this.locale);
433
436
  }
434
437
  var content = actionFailure ?
435
438
  this.l10n.getConstant('actionFailureTemplate') : this.l10n.getConstant('noRecordsTemplate');
@@ -438,6 +441,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
438
441
  liElem.textContent = content;
439
442
  ele.appendChild(liElem);
440
443
  liElem.classList.add('e-list-nrt');
444
+ liElem.setAttribute('role', 'option');
441
445
  }
442
446
  else {
443
447
  ele.innerHTML = content;
@@ -531,7 +535,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
531
535
  * @returns {void}
532
536
  */
533
537
  DropDownBase.prototype.updateDataAttribute = function (value) {
534
- var invalidAttr = ['class', 'style', 'id', 'type'];
538
+ var invalidAttr = ['class', 'style', 'id', 'type', 'aria-expanded', 'aria-autocomplete', 'aria-readonly'];
535
539
  var attr = {};
536
540
  for (var a = 0; a < this.element.attributes.length; a++) {
537
541
  if (invalidAttr.indexOf(this.element.attributes[a].name) === -1 &&
@@ -599,6 +603,8 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
599
603
  this.isRequested = false;
600
604
  this.isDataFetched = false;
601
605
  this.itemTemplateId = "" + this.element.id + ITEMTEMPLATE_PROPERTY;
606
+ this.displayTemplateId = "" + this.element.id + DISPLAYTEMPLATE_PROPERTY;
607
+ this.spinnerTemplateId = "" + this.element.id + SPINNERTEMPLATE_PROPERTY;
602
608
  this.valueTemplateId = "" + this.element.id + VALUETEMPLATE_PROPERTY;
603
609
  this.groupTemplateId = "" + this.element.id + GROUPTEMPLATE_PROPERTY;
604
610
  this.headerTemplateId = "" + this.element.id + HEADERTEMPLATE_PROPERTY;
@@ -1719,8 +1725,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1719
1725
  this.inputWrapper.container.setAttribute('style', this.htmlAttributes[htmlAttr]);
1720
1726
  }
1721
1727
  else {
1722
- var defaultAttr = ['title', 'id', 'placeholder', 'aria-placeholder',
1723
- 'role', 'autocorrect', 'autocomplete', 'autocapitalize', 'spellcheck', 'minlength', 'maxlength'];
1728
+ var defaultAttr = ['title', 'id', 'placeholder',
1729
+ 'role', 'autocomplete', 'autocapitalize', 'spellcheck', 'minlength', 'maxlength'];
1724
1730
  var validateAttr = ['name', 'required'];
1725
1731
  if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
1726
1732
  defaultAttr.push('tabindex');
@@ -1749,11 +1755,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1749
1755
  DropDownList.prototype.getAriaAttributes = function () {
1750
1756
  return {
1751
1757
  'aria-disabled': 'false',
1752
- 'aria-owns': this.element.id + '_options',
1753
1758
  'role': 'combobox',
1754
- 'aria-haspopup': 'true',
1755
1759
  'aria-expanded': 'false',
1756
- 'aria-activedescendant': 'null',
1757
1760
  'aria-live': 'polite',
1758
1761
  'aria-labelledby': this.hiddenElement.id
1759
1762
  };
@@ -2475,10 +2478,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2475
2478
  if (this.setValue(e)) {
2476
2479
  return;
2477
2480
  }
2478
- attributes(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
2479
- if (this.isFilterLayout() && this.filterInput) {
2480
- attributes(this.filterInput, { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
2481
- }
2482
2481
  if ((!this.isPopupOpen && !isNullOrUndefined(li)) || (this.isPopupOpen && !isNullOrUndefined(e) &&
2483
2482
  (e.type !== 'keydown' || e.type === 'keydown' && e.action === 'enter'))) {
2484
2483
  this.isSelectCustom = false;
@@ -2489,7 +2488,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2489
2488
  }
2490
2489
  if (Browser.info.name !== 'mozilla') {
2491
2490
  attributes(this.inputElement, { 'aria-label': this.inputElement.value });
2492
- attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id });
2491
+ attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
2493
2492
  this.targetElement().removeAttribute('aria-live');
2494
2493
  }
2495
2494
  };
@@ -2874,11 +2873,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2874
2873
  prepend([parentElement], popupElement);
2875
2874
  attributes(this.filterInput, {
2876
2875
  'aria-disabled': 'false',
2877
- 'aria-owns': this.element.id + '_options',
2878
- 'role': 'listbox',
2879
- 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null,
2876
+ 'role': 'combobox',
2880
2877
  'autocomplete': 'off',
2881
- 'autocorrect': 'off',
2882
2878
  'autocapitalize': 'off',
2883
2879
  'spellcheck': 'false'
2884
2880
  });
@@ -3179,7 +3175,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3179
3175
  _this.unWireListEvents();
3180
3176
  _this.wireListEvents();
3181
3177
  }
3182
- attributes(_this.targetElement(), { 'aria-expanded': 'true' });
3178
+ _this.selectedElementID = _this.selectedLI ? _this.selectedLI.id : null;
3179
+ attributes(_this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': _this.inputElement.id + '_options', 'aria-activedescendant': _this.selectedElementID });
3180
+ _this.inputElement.setAttribute('aria-expanded', 'true');
3181
+ if (_this.selectedElementID == null) {
3182
+ _this.targetElement().removeAttribute('aria-activedescendant');
3183
+ }
3183
3184
  var inputParent = _this.isFiltering() ? _this.filterInput.parentElement : _this.inputWrapper.container;
3184
3185
  addClass([inputParent], [dropDownListClasses.inputFocus]);
3185
3186
  var animModel = { name: 'FadeIn', duration: 100 };
@@ -3455,6 +3456,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3455
3456
  this.filterInput = null;
3456
3457
  }
3457
3458
  attributes(this.targetElement(), { 'aria-expanded': 'false' });
3459
+ this.inputElement.setAttribute('aria-expanded', 'false');
3460
+ this.targetElement().removeAttribute('aria-owns');
3461
+ this.targetElement().removeAttribute('aria-activedescendant');
3458
3462
  this.inputWrapper.container.classList.remove(dropDownListClasses.iconAnimation);
3459
3463
  if (this.isFiltering()) {
3460
3464
  this.actionCompleteData.isUpdated = false;
@@ -3512,6 +3516,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3512
3516
  if (isNullOrUndefined(this.inputElement.getAttribute('type'))) {
3513
3517
  this.inputElement.setAttribute('type', 'text');
3514
3518
  }
3519
+ this.inputElement.setAttribute('aria-expanded', 'false');
3515
3520
  }
3516
3521
  else {
3517
3522
  this.inputElement = this.createElement('input', { attrs: { role: 'combobox', type: 'text' } });
@@ -3554,8 +3559,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3554
3559
  this.inputWrapper.container.style.width = formatUnit(this.width);
3555
3560
  this.inputWrapper.container.classList.add('e-ddl');
3556
3561
  Input.calculateWidth(this.inputElement, this.inputWrapper.container);
3557
- if (!isNullOrUndefined(this.inputWrapper) && !isNullOrUndefined(this.inputWrapper.buttons[0]) && this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0] && this.floatLabelType !== 'Never') {
3558
- this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0].classList.add('e-icon');
3562
+ if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && this.inputWrapper.container.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never') {
3563
+ this.inputWrapper.container.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
3559
3564
  }
3560
3565
  this.wireEvent();
3561
3566
  this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
@@ -4041,7 +4046,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4041
4046
  if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {
4042
4047
  this.renderPopup(e);
4043
4048
  }
4044
- attributes(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
4049
+ attributes(this.targetElement(), { 'aria-activedescendant': this.selectedElementID });
4050
+ if (this.selectedElementID == null) {
4051
+ this.targetElement().removeAttribute('aria-activedescendant');
4052
+ }
4045
4053
  };
4046
4054
  DropDownList.prototype.renderHightSearch = function () {
4047
4055
  // update high light search
@@ -4147,10 +4155,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4147
4155
  return;
4148
4156
  }
4149
4157
  if (this.inputElement) {
4150
- var attrArray = ['readonly', 'aria-disabled', 'aria-placeholder',
4151
- 'placeholder', 'aria-owns', 'aria-labelledby', 'aria-haspopup', 'aria-expanded',
4152
- 'aria-activedescendant', 'autocomplete', 'aria-readonly', 'autocorrect',
4153
- 'autocapitalize', 'spellcheck', 'aria-autocomplete', 'aria-live', 'aria-describedby', 'aria-label'];
4158
+ var attrArray = ['readonly', 'aria-disabled', 'placeholder', 'aria-labelledby',
4159
+ 'aria-expanded', 'autocomplete', 'aria-readonly', 'autocapitalize',
4160
+ 'spellcheck', 'aria-autocomplete', 'aria-live', 'aria-describedby', 'aria-label'];
4154
4161
  for (var i = 0; i < attrArray.length; i++) {
4155
4162
  this.inputElement.removeAttribute(attrArray[i]);
4156
4163
  }
@@ -7612,15 +7619,12 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
7612
7619
  };
7613
7620
  ComboBox.prototype.getAriaAttributes = function () {
7614
7621
  var ariaAttributes = {
7615
- 'aria-owns': this.element.id + '_options',
7616
7622
  'role': 'combobox',
7617
7623
  'aria-autocomplete': 'both',
7618
7624
  'aria-labelledby': this.hiddenElement.id,
7619
- 'aria-hasPopup': 'true',
7620
7625
  'aria-expanded': 'false',
7621
7626
  'aria-readonly': this.readonly.toString(),
7622
7627
  'autocomplete': 'off',
7623
- 'autocorrect': 'off',
7624
7628
  'autocapitalize': 'off',
7625
7629
  'spellcheck': 'false'
7626
7630
  };
@@ -8475,6 +8479,7 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8475
8479
  };
8476
8480
  AutoComplete.prototype.setSelection = function (li, e) {
8477
8481
  if (!this.isValidLI(li)) {
8482
+ this.selectedLI = li;
8478
8483
  return;
8479
8484
  }
8480
8485
  if (!isNullOrUndefined(e) && e.type === 'keydown' && e.action !== 'enter'
@@ -8490,7 +8495,6 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8490
8495
  e.action === 'home' || e.action === 'end' || e.action === 'pageUp' || e.action === 'pageDown');
8491
8496
  _super.prototype.setAutoFill.call(this, li, isKeyNavigate);
8492
8497
  }
8493
- attributes(this.inputElement, { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
8494
8498
  }
8495
8499
  else {
8496
8500
  _super.prototype.setSelection.call(this, li, e);
@@ -9119,7 +9123,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9119
9123
  _this.refreshPopup();
9120
9124
  _this.renderReactTemplates();
9121
9125
  _this.popupObj.show(eventArgs.animation, (_this.zIndex === 1000) ? _this.element : null);
9122
- attributes(_this.inputElement, { 'aria-expanded': 'true' });
9126
+ attributes(_this.inputElement, { 'aria-expanded': 'true', 'aria-owns': _this.inputElement.id + '_options' });
9127
+ if (_this.selectedElementID == null) {
9128
+ _this.inputElement.removeAttribute('aria-activedescendant');
9129
+ }
9130
+ else {
9131
+ attributes(_this.inputElement, { 'aria-activedescendant': _this.selectedElementID });
9132
+ }
9123
9133
  if (_this.isFirstClick) {
9124
9134
  _this.loadTemplate();
9125
9135
  }
@@ -9189,11 +9199,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9189
9199
  MultiSelect.prototype.getAriaAttributes = function () {
9190
9200
  var ariaAttributes = {
9191
9201
  'aria-disabled': 'false',
9192
- 'aria-owns': this.element.id + '_options',
9193
- 'role': 'listbox',
9194
- 'aria-multiselectable': 'true',
9195
- 'aria-activedescendant': 'null',
9196
- 'aria-haspopup': 'true',
9202
+ 'role': 'combobox',
9197
9203
  'aria-expanded': 'false'
9198
9204
  };
9199
9205
  return ariaAttributes;
@@ -9203,7 +9209,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9203
9209
  attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
9204
9210
  }
9205
9211
  var disableStatus = (this.inputElement.disabled) ? true : false;
9206
- attributes(this.inputElement, this.getAriaAttributes());
9212
+ if (!this.isPopupOpen()) {
9213
+ attributes(this.inputElement, this.getAriaAttributes());
9214
+ }
9207
9215
  if (disableStatus) {
9208
9216
  attributes(this.inputElement, { 'aria-disabled': 'true' });
9209
9217
  }
@@ -9585,7 +9593,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9585
9593
  this.resetList(tempData, field, query);
9586
9594
  }
9587
9595
  else {
9588
- var tempData = [this.inputElement.value];
9596
+ var tempData = JSON.parse(JSON.stringify(this.listData));
9597
+ tempData.splice(0, 0, this.inputElement.value);
9589
9598
  tempData[0] = (typeof customData === 'number' && !isNaN(parseFloat(tempData[0]))) ?
9590
9599
  parseFloat(tempData[0]) : tempData[0];
9591
9600
  tempData[0] = (typeof customData === 'boolean') ?
@@ -11005,6 +11014,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11005
11014
  this.removeValue(temp, e, null, true);
11006
11015
  }
11007
11016
  }
11017
+ this.selectedElementID = null;
11018
+ this.inputElement.removeAttribute('aria-activedescendant');
11008
11019
  }
11009
11020
  else {
11010
11021
  this.clearAllCallback(e);
@@ -11495,7 +11506,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11495
11506
  if (this.chipCollectionWrapper) {
11496
11507
  this.removeChipSelection();
11497
11508
  }
11498
- attributes(this.inputElement, { 'aria-activedescendant': element.id });
11509
+ this.selectedElementID = element.id;
11499
11510
  }
11500
11511
  };
11501
11512
  MultiSelect.prototype.updateDelimeter = function (delimChar, e) {
@@ -12523,6 +12534,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12523
12534
  _this.overAllWrapper.classList.remove(iconAnimation);
12524
12535
  _this.popupObj.hide(new Animation(eventArgs.animation));
12525
12536
  attributes(_this.inputElement, { 'aria-expanded': 'false' });
12537
+ _this.inputElement.removeAttribute('aria-owns');
12538
+ _this.inputElement.removeAttribute('aria-activedescendant');
12526
12539
  if (_this.allowFiltering) {
12527
12540
  _this.notify('inputFocus', { module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox', value: 'clear' });
12528
12541
  }
@@ -12711,7 +12724,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12711
12724
  this.element.setAttribute('data-val', 'false');
12712
12725
  }
12713
12726
  Input.createSpanElement(this.overAllWrapper, this.createElement);
12714
- Input.calculateWidth(this.inputElement, this.overAllWrapper);
12727
+ Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
12715
12728
  if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
12716
12729
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
12717
12730
  }
@@ -12851,7 +12864,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12851
12864
  this.ulElement = null;
12852
12865
  this.mainListCollection = null;
12853
12866
  _super.prototype.destroy.call(this);
12854
- var temp = ['readonly', 'aria-disabled', 'aria-placeholder', 'placeholder'];
12867
+ var temp = ['readonly', 'aria-disabled', 'placeholder'];
12855
12868
  var length = temp.length;
12856
12869
  while (length > 0) {
12857
12870
  this.inputElement.removeAttribute(temp[length - 1]);
@@ -13332,11 +13345,8 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
13332
13345
  prepend([this.parent.filterParent], args.popupElement);
13333
13346
  attributes(this.filterInput, {
13334
13347
  'aria-disabled': 'false',
13335
- 'aria-owns': this.parent.element.id + '_options',
13336
- 'role': 'listbox',
13337
- 'aria-activedescendant': null,
13348
+ 'role': 'combobox',
13338
13349
  'autocomplete': 'off',
13339
- 'autocorrect': 'off',
13340
13350
  'autocapitalize': 'off',
13341
13351
  'spellcheck': 'false'
13342
13352
  });
@@ -13725,7 +13735,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
13725
13735
  removeClass([this.list], [dropDownBaseClasses.content, dropDownBaseClasses.root]);
13726
13736
  this.validationAttribute(this.element, hiddenSelect);
13727
13737
  this.list.setAttribute('role', 'listbox');
13728
- attributes(this.list, { 'role': 'listbox', 'aria-multiselectable': this.selectionSettings.mode === 'Multiple' ? 'true' : 'false' });
13738
+ attributes(this.list, { 'role': 'listbox', 'aria-label': 'listbox', 'aria-multiselectable': this.selectionSettings.mode === 'Multiple' ? 'true' : 'false' });
13729
13739
  this.updateSelectionSettings();
13730
13740
  };
13731
13741
  ListBox.prototype.updateSelectionSettings = function () {
@@ -14121,10 +14131,10 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14121
14131
  sortedData.splice(destIdx, 0, droppedData);
14122
14132
  liColl.splice(destIdx, 0, fLiColl_1.splice(srcIdx, 1)[0]);
14123
14133
  if (!value) {
14124
- var liCollElem = _this.getItems();
14125
- for (var i = 0; i < liCollElem.length; i++) {
14126
- if (liCollElem[i].getAttribute('data-value') === null && liCollElem[i].classList.contains('e-list-item')) {
14127
- li_1 = liCollElem[i];
14134
+ var liCollElem_1 = _this.getItems();
14135
+ for (var i = 0; i < liCollElem_1.length; i++) {
14136
+ if (liCollElem_1[i].getAttribute('data-value') === null && liCollElem_1[i].classList.contains('e-list-item')) {
14137
+ li_1 = liCollElem_1[i];
14128
14138
  break;
14129
14139
  }
14130
14140
  }
@@ -14174,6 +14184,12 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14174
14184
  dragArgs = extend(dragArgs, { destination: dragArgs1 });
14175
14185
  }
14176
14186
  this.trigger('drop', dragArgs);
14187
+ var liCollElem = dragArgs.elements;
14188
+ if (liCollElem.length) {
14189
+ for (var i = 0; i < liCollElem.length; i++) {
14190
+ liCollElem[i].classList.remove('e-grabbed');
14191
+ }
14192
+ }
14177
14193
  };
14178
14194
  ListBox.prototype.updateListItems = function (sourceElem, destElem) {
14179
14195
  var i = 0;
@@ -15173,15 +15189,14 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15173
15189
  };
15174
15190
  ListBox.prototype.getGrabbedItems = function () {
15175
15191
  for (var i = 0; i < this.value.length; i++) {
15176
- if (this.value[i] === this.dragValue) {
15177
- var liColl = this.list.querySelectorAll('[aria-selected="true"]');
15178
- for (var i_1 = 0; i_1 < liColl.length; i_1++) {
15179
- liColl[i_1].classList.add('e-grabbed');
15192
+ var liColl = this.list.querySelectorAll('[aria-selected="true"]');
15193
+ for (var j = 0; j < liColl.length; j++) {
15194
+ if (this.value[i] === liColl[j].textContent) {
15195
+ liColl[j].classList.add('e-grabbed');
15180
15196
  }
15181
- break;
15182
15197
  }
15183
15198
  }
15184
- var elems = Array.prototype.slice.call(this.element.querySelectorAll('.e-grabbed'));
15199
+ var elems = Array.prototype.slice.call(this.element.nextElementSibling.querySelectorAll('.e-grabbed'));
15185
15200
  return elems;
15186
15201
  };
15187
15202
  ListBox.prototype.getDragArgs = function (args, isDragEnd) {
@@ -15868,6 +15883,1386 @@ var listBoxClasses = {
15868
15883
  clearIcon: 'e-clear-icon'
15869
15884
  };
15870
15885
 
15886
+ /**
15887
+ * export all modules from current location
15888
+ */
15889
+
15890
+ var __extends$7 = (undefined && undefined.__extends) || (function () {
15891
+ var extendStatics = function (d, b) {
15892
+ extendStatics = Object.setPrototypeOf ||
15893
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
15894
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
15895
+ return extendStatics(d, b);
15896
+ };
15897
+ return function (d, b) {
15898
+ extendStatics(d, b);
15899
+ function __() { this.constructor = d; }
15900
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15901
+ };
15902
+ })();
15903
+ var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
15904
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15905
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
15906
+ 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;
15907
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
15908
+ };
15909
+ /**
15910
+ * The Mention component is used to list someone or something based on user input in textarea, input,
15911
+ * or any other editable element from which the user can select.
15912
+ */
15913
+ var Mention = /** @__PURE__ @class */ (function (_super) {
15914
+ __extends$7(Mention, _super);
15915
+ /**
15916
+ * * Constructor for creating the widget
15917
+ *
15918
+ * @param {MentionModel} options - Specifies the MentionComponent model.
15919
+ * @param {string | HTMLElement} element - Specifies the element to render as component.
15920
+ * @private
15921
+ */
15922
+ function Mention(options, element) {
15923
+ return _super.call(this, options, element) || this;
15924
+ }
15925
+ /**
15926
+ * When property value changes happened, then onPropertyChanged method will execute the respective changes in this component.
15927
+ *
15928
+ * @param {MentionModel} newProp - Returns the dynamic property value of the component.
15929
+ * @param {MentionModel} oldProp - Returns the previous property value of the component.
15930
+ * @private
15931
+ * @returns {void}
15932
+ */
15933
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
15934
+ Mention.prototype.onPropertyChanged = function (newProp, oldProp) {
15935
+ for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
15936
+ var prop = _a[_i];
15937
+ switch (prop) {
15938
+ case 'minLength':
15939
+ this.minLength = newProp.minLength;
15940
+ break;
15941
+ case 'suffixText':
15942
+ this.suffixText = newProp.suffixText;
15943
+ break;
15944
+ case 'allowSpaces':
15945
+ this.allowSpaces = newProp.allowSpaces;
15946
+ break;
15947
+ case 'mentionChar':
15948
+ this.mentionChar = newProp.mentionChar;
15949
+ break;
15950
+ case 'showMentionChar':
15951
+ this.showMentionChar = newProp.showMentionChar;
15952
+ break;
15953
+ case 'cssClass':
15954
+ this.updateCssClass(newProp.cssClass, oldProp.cssClass);
15955
+ break;
15956
+ }
15957
+ }
15958
+ };
15959
+ Mention.prototype.updateCssClass = function (newClass, oldClass) {
15960
+ if (!isNullOrUndefined(oldClass)) {
15961
+ oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
15962
+ }
15963
+ if (!isNullOrUndefined(newClass)) {
15964
+ newClass = (newClass.replace(/\s+/g, ' ')).trim();
15965
+ }
15966
+ this.setCssClass(newClass, [this.inputElement], oldClass);
15967
+ if (this.popupObj) {
15968
+ this.setCssClass(newClass, [this.popupObj.element], oldClass);
15969
+ }
15970
+ };
15971
+ Mention.prototype.setCssClass = function (cssClass$$1, elements, oldClass) {
15972
+ if (!isNullOrUndefined(oldClass) && oldClass !== '') {
15973
+ removeClass(elements, oldClass.split(' '));
15974
+ }
15975
+ if (!isNullOrUndefined(cssClass$$1) && cssClass$$1 !== '') {
15976
+ addClass(elements, cssClass$$1.split(' '));
15977
+ }
15978
+ };
15979
+ Mention.prototype.initializeData = function () {
15980
+ this.isSelected = false;
15981
+ this.isFiltered = false;
15982
+ this.beforePopupOpen = false;
15983
+ this.initRemoteRender = false;
15984
+ this.isPopupOpen = false;
15985
+ this.isCollided = false;
15986
+ this.lineBreak = false;
15987
+ this.keyConfigure = {
15988
+ tab: 'tab',
15989
+ enter: '13',
15990
+ escape: '27',
15991
+ end: '35',
15992
+ home: '36',
15993
+ down: '40',
15994
+ up: '38',
15995
+ pageUp: '33',
15996
+ pageDown: '34',
15997
+ open: 'alt+40',
15998
+ close: 'shift+tab',
15999
+ hide: 'alt+38',
16000
+ space: '32'
16001
+ };
16002
+ };
16003
+ /**
16004
+ * Execute before render the list items
16005
+ *
16006
+ * @private
16007
+ * @returns {void}
16008
+ */
16009
+ Mention.prototype.preRender = function () {
16010
+ this.initializeData();
16011
+ _super.prototype.preRender.call(this);
16012
+ };
16013
+ /**
16014
+ * To Initialize the control rendering
16015
+ *
16016
+ * @private
16017
+ * @returns {void}
16018
+ */
16019
+ Mention.prototype.render = function () {
16020
+ this.inputElement = !isNullOrUndefined(this.target) ? ((typeof this.target) === 'string') ?
16021
+ document.querySelector(this.target) : this.target : this.element;
16022
+ if (this.isContentEditable(this.inputElement)) {
16023
+ this.inputElement.setAttribute('contenteditable', 'true');
16024
+ addClass([this.inputElement], ['e-mention']);
16025
+ if (isNullOrUndefined(this.target)) {
16026
+ addClass([this.inputElement], ['e-editable-element']);
16027
+ }
16028
+ }
16029
+ this.queryString = this.elementValue();
16030
+ this.wireEvent();
16031
+ };
16032
+ Mention.prototype.wireEvent = function () {
16033
+ EventHandler.add(this.inputElement, 'keyup', this.onKeyUp, this);
16034
+ this.bindCommonEvent();
16035
+ };
16036
+ Mention.prototype.unWireEvent = function () {
16037
+ EventHandler.remove(this.inputElement, 'keyup', this.onKeyUp);
16038
+ this.unBindCommonEvent();
16039
+ };
16040
+ Mention.prototype.bindCommonEvent = function () {
16041
+ if (!Browser.isDevice) {
16042
+ this.keyboardModule = new KeyboardEvents(this.inputElement, {
16043
+ keyAction: this.keyActionHandler.bind(this), keyConfigs: this.keyConfigure, eventName: 'keydown'
16044
+ });
16045
+ }
16046
+ };
16047
+ /**
16048
+ * Hides the spinner loader.
16049
+ *
16050
+ * @returns {void}
16051
+ */
16052
+ Mention.prototype.hideSpinner = function () {
16053
+ this.hideWaitingSpinner();
16054
+ };
16055
+ Mention.prototype.hideWaitingSpinner = function () {
16056
+ if (!isNullOrUndefined(this.spinnerElement)) {
16057
+ hideSpinner(this.spinnerElement);
16058
+ }
16059
+ if (!isNullOrUndefined(this.spinnerTemplate)) {
16060
+ detach(this.spinnerTemplateElement);
16061
+ }
16062
+ };
16063
+ /**
16064
+ * Shows the spinner loader.
16065
+ *
16066
+ * @returns {void}
16067
+ */
16068
+ Mention.prototype.showWaitingSpinner = function () {
16069
+ if (!isNullOrUndefined(this.popupObj)) {
16070
+ if (isNullOrUndefined(this.spinnerTemplate) && isNullOrUndefined(this.spinnerElement)) {
16071
+ this.spinnerElement = this.popupObj.element;
16072
+ createSpinner({
16073
+ target: this.spinnerElement,
16074
+ width: Browser.isDevice ? '16px' : '14px'
16075
+ }, this.createElement);
16076
+ showSpinner(this.spinnerElement);
16077
+ }
16078
+ if (!isNullOrUndefined(this.spinnerTemplate)) {
16079
+ this.setSpinnerTemplate();
16080
+ this.popupObj.element.appendChild(this.spinnerTemplateElement);
16081
+ }
16082
+ }
16083
+ };
16084
+ Mention.prototype.keyActionHandler = function (e) {
16085
+ var isNavigation = (e.action === 'down' || e.action === 'up' || e.action === 'pageUp' || e.action === 'pageDown'
16086
+ || e.action === 'home' || e.action === 'end');
16087
+ var isTabAction = e.action === 'tab' || e.action === 'close';
16088
+ if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape') {
16089
+ this.renderList();
16090
+ }
16091
+ if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
16092
+ isNavigation && this.liCollections.length === 0) || this.isRequested) {
16093
+ return;
16094
+ }
16095
+ if (e.action === 'escape') {
16096
+ e.preventDefault();
16097
+ }
16098
+ this.isSelected = e.action === 'escape' ? false : this.isSelected;
16099
+ switch (e.action) {
16100
+ case 'down':
16101
+ case 'up':
16102
+ this.updateUpDownAction(e);
16103
+ break;
16104
+ case 'tab':
16105
+ if (this.isPopupOpen) {
16106
+ var li = this.list.querySelector('.' + dropDownBaseClasses.selected);
16107
+ if (li) {
16108
+ this.setSelection(li, e);
16109
+ }
16110
+ if (this.isPopupOpen) {
16111
+ this.hidePopup(e);
16112
+ }
16113
+ }
16114
+ break;
16115
+ case 'enter':
16116
+ if (this.isPopupOpen) {
16117
+ e.preventDefault();
16118
+ if (this.popupObj && this.popupObj.element.contains(this.selectedLI)) {
16119
+ this.setValue(e);
16120
+ }
16121
+ }
16122
+ break;
16123
+ case 'escape':
16124
+ if (this.isPopupOpen) {
16125
+ this.hidePopup(e);
16126
+ }
16127
+ break;
16128
+ }
16129
+ };
16130
+ Mention.prototype.updateUpDownAction = function (e) {
16131
+ var focusEle = this.list.querySelector('.' + dropDownBaseClasses.focus);
16132
+ if (this.isSelectFocusItem(focusEle)) {
16133
+ this.setSelection(focusEle, e);
16134
+ }
16135
+ else if (!isNullOrUndefined(this.liCollections)) {
16136
+ var li = this.list.querySelector('.' + dropDownBaseClasses.selected);
16137
+ if (!isNullOrUndefined(li)) {
16138
+ var value = this.getFormattedValue(li.getAttribute('data-value'));
16139
+ this.activeIndex = this.getIndexByValue(value);
16140
+ }
16141
+ var index = e.action === 'down' ? this.activeIndex + 1 : this.activeIndex - 1;
16142
+ var startIndex = 0;
16143
+ startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
16144
+ index = index < 0 ? this.liCollections.length - 1 : index === this.liCollections.length ? 0 : index;
16145
+ var nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex] : this.liCollections[index];
16146
+ if (!isNullOrUndefined(nextItem)) {
16147
+ this.setSelection(nextItem, e);
16148
+ }
16149
+ }
16150
+ if (this.isPopupOpen) {
16151
+ e.preventDefault();
16152
+ }
16153
+ };
16154
+ Mention.prototype.isSelectFocusItem = function (element) {
16155
+ return !isNullOrUndefined(element);
16156
+ };
16157
+ Mention.prototype.unBindCommonEvent = function () {
16158
+ if (!Browser.isDevice) {
16159
+ this.keyboardModule.destroy();
16160
+ }
16161
+ };
16162
+ Mention.prototype.onKeyUp = function (e) {
16163
+ var rangetextContent;
16164
+ if (this.isContentEditable(this.inputElement)) {
16165
+ this.range = this.getCurrentRange();
16166
+ rangetextContent = this.range.startContainer.textContent.split('');
16167
+ }
16168
+ var currentRange = this.getTextRange();
16169
+ var lastWordRange = this.getLastLetter(currentRange);
16170
+ var Regex = new RegExp(this.mentionChar, 'g');
16171
+ var charRegex = new RegExp('[a-zA-Z]', 'g');
16172
+ if (e.key === 'Shift' || e.keyCode === 37 || e.keyCode === 39) {
16173
+ return;
16174
+ }
16175
+ if ((!currentRange || !lastWordRange) || e.code === 'Enter' || e.keyCode === 27 ||
16176
+ (lastWordRange.match(Regex) && lastWordRange.match(Regex).length > 1) ||
16177
+ (this.isContentEditable(this.inputElement) && this.range.startContainer &&
16178
+ this.range.startContainer.previousElementSibling && this.range.startContainer.textContent.split('').length > 0 &&
16179
+ (rangetextContent.length === 1 || rangetextContent[rangetextContent.length - 2].indexOf('') === -1 ||
16180
+ this.range.startContainer.nodeType === 1))) {
16181
+ if (this.allowSpaces && currentRange && currentRange.trim() !== '' && charRegex.test(currentRange) && currentRange.indexOf(this.mentionChar) !== -1
16182
+ && !this.isMatchedText() && (currentRange.length > 1 && currentRange.replace(/\u00A0/g, ' ').charAt(currentRange.length - 2) !== ' ') &&
16183
+ (this.list && this.list.querySelectorAll('ul').length > 0)) {
16184
+ this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
16185
+ this.searchLists(e);
16186
+ }
16187
+ else if (this.isPopupOpen && (!this.allowSpaces || !lastWordRange)) {
16188
+ this.hidePopup();
16189
+ this.lineBreak = true;
16190
+ }
16191
+ return;
16192
+ }
16193
+ this.queryString = lastWordRange.replace(this.mentionChar, '');
16194
+ if (this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0) &&
16195
+ this.queryString !== '' && e.keyCode !== 38 && e.keyCode !== 40 && !this.lineBreak) {
16196
+ this.searchLists(e);
16197
+ if (!this.isPopupOpen && this.queryString.length >= this.minLength) {
16198
+ if (!this.isContentEditable(this.inputElement)) {
16199
+ this.showPopup();
16200
+ }
16201
+ else if (this.isContentEditable(this.inputElement) && this.range && this.range.startContainer !== this.inputElement) {
16202
+ this.showPopup();
16203
+ }
16204
+ }
16205
+ }
16206
+ else if (lastWordRange.indexOf(this.mentionChar) === 0 && !this.isPopupOpen && e.keyCode !== 8 && (!this.popupObj ||
16207
+ (isNullOrUndefined(this.target) && !document.body.contains(this.popupObj.element) ||
16208
+ !isNullOrUndefined(this.target) && document.body.contains(this.popupObj.element)))) {
16209
+ if (this.initRemoteRender && this.list && this.list.classList.contains('e-nodata')) {
16210
+ this.searchLists(e);
16211
+ }
16212
+ this.resetList(this.dataSource, this.fields);
16213
+ if (isNullOrUndefined(this.list)) {
16214
+ this.initValue();
16215
+ }
16216
+ if (!this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40) {
16217
+ this.showPopup();
16218
+ if (this.initRemoteRender && this.list.querySelectorAll('li').length === 0) {
16219
+ this.showWaitingSpinner();
16220
+ }
16221
+ this.lineBreak = false;
16222
+ }
16223
+ }
16224
+ else if (this.allowSpaces && this.queryString !== '' && currentRange && currentRange.trim() !== '' && currentRange.replace('\u00a0', ' ').lastIndexOf(' ') < currentRange.length - 1 &&
16225
+ e.keyCode !== 38 && e.keyCode !== 40 && e.keyCode !== 8) {
16226
+ this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
16227
+ this.searchLists(e);
16228
+ }
16229
+ else if (this.queryString === '' && this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40) {
16230
+ this.resetList(this.dataSource, this.fields);
16231
+ }
16232
+ };
16233
+ Mention.prototype.isMatchedText = function () {
16234
+ var isMatched = false;
16235
+ for (var i = 0; i < (this.liCollections && this.liCollections.length); i++) {
16236
+ if (this.getTextRange() &&
16237
+ this.getTextRange().substring(this.getTextRange().lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ').trim() === this.liCollections[i].getAttribute('data-value').toLowerCase()) {
16238
+ isMatched = true;
16239
+ }
16240
+ }
16241
+ return isMatched;
16242
+ };
16243
+ Mention.prototype.getCurrentRange = function () {
16244
+ this.range = this.inputElement.ownerDocument.getSelection().getRangeAt(0);
16245
+ return this.range;
16246
+ };
16247
+ Mention.prototype.searchLists = function (e) {
16248
+ var _this = this;
16249
+ this.isDataFetched = false;
16250
+ if (isNullOrUndefined(this.list)) {
16251
+ _super.prototype.render.call(this);
16252
+ this.unWireListEvents();
16253
+ this.wireListEvents();
16254
+ }
16255
+ if (e.type !== 'mousedown' && (e.keyCode === 40 || e.keyCode === 38)) {
16256
+ this.queryString = this.queryString === '' ? null : this.queryString;
16257
+ this.beforePopupOpen = true;
16258
+ this.resetList(this.dataSource, this.fields);
16259
+ return;
16260
+ }
16261
+ this.isSelected = false;
16262
+ this.activeIndex = null;
16263
+ var eventArgs = {
16264
+ preventDefaultAction: false,
16265
+ text: this.elementValue(),
16266
+ updateData: function (dataSource, query, fields) {
16267
+ if (eventArgs.cancel) {
16268
+ return;
16269
+ }
16270
+ _this.isFiltered = true;
16271
+ _this.filterAction(dataSource, query, fields);
16272
+ },
16273
+ cancel: false
16274
+ };
16275
+ this.trigger('filtering', eventArgs, function (eventArgs) {
16276
+ if (!eventArgs.cancel && !_this.isFiltered && !eventArgs.preventDefaultAction) {
16277
+ _this.filterAction(_this.dataSource, null, _this.fields);
16278
+ }
16279
+ });
16280
+ };
16281
+ Mention.prototype.filterAction = function (dataSource, query, fields) {
16282
+ this.beforePopupOpen = true;
16283
+ if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
16284
+ this.resetList(dataSource, fields, query);
16285
+ }
16286
+ else {
16287
+ if (this.isPopupOpen) {
16288
+ this.hidePopup();
16289
+ }
16290
+ this.beforePopupOpen = false;
16291
+ }
16292
+ this.setDataIndex();
16293
+ this.renderReactTemplates();
16294
+ };
16295
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
16296
+ Mention.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
16297
+ _super.prototype.onActionComplete.call(this, ulElement, list, e);
16298
+ if (this.isActive) {
16299
+ if (!isNullOrUndefined(ulElement)) {
16300
+ attributes(ulElement, { 'id': this.inputElement.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
16301
+ }
16302
+ var focusItem = ulElement.querySelector('.' + dropDownBaseClasses.li);
16303
+ if (focusItem) {
16304
+ focusItem.classList.add(dropDownBaseClasses.selected);
16305
+ this.selectedLI = focusItem;
16306
+ var value = this.getFormattedValue(focusItem.getAttribute('data-value'));
16307
+ this.selectEventCallback(focusItem, this.getDataByValue(value), value, true);
16308
+ }
16309
+ }
16310
+ };
16311
+ Mention.prototype.setDataIndex = function () {
16312
+ for (var i = 0; this.liCollections && i < this.liCollections.length; i++) {
16313
+ this.liCollections[i].setAttribute('data-index', i.toString());
16314
+ }
16315
+ };
16316
+ Mention.prototype.listOption = function (dataSource, fieldsSettings) {
16317
+ var _this = this;
16318
+ var fields = _super.prototype.listOption.call(this, dataSource, fieldsSettings);
16319
+ if (isNullOrUndefined(fields.itemCreated)) {
16320
+ fields.itemCreated = function (e) {
16321
+ if (_this.highlight) {
16322
+ if (_this.inputElement.tagName === _this.getNgDirective() && _this.itemTemplate) {
16323
+ setTimeout(function () {
16324
+ highlightSearch(e.item, _this.queryString, _this.ignoreCase, _this.filterType);
16325
+ }, 0);
16326
+ }
16327
+ else {
16328
+ highlightSearch(e.item, _this.queryString, _this.ignoreCase, _this.filterType);
16329
+ }
16330
+ }
16331
+ };
16332
+ }
16333
+ else {
16334
+ var itemCreated_1 = fields.itemCreated;
16335
+ fields.itemCreated = function (e) {
16336
+ if (_this.highlight) {
16337
+ highlightSearch(e.item, _this.queryString, _this.ignoreCase, _this.filterType);
16338
+ }
16339
+ itemCreated_1.apply(_this, [e]);
16340
+ };
16341
+ }
16342
+ return fields;
16343
+ };
16344
+ Mention.prototype.elementValue = function () {
16345
+ if (!this.isContentEditable(this.inputElement)) {
16346
+ return this.inputElement.value.replace(this.mentionChar, '');
16347
+ }
16348
+ else {
16349
+ return this.inputElement.textContent.replace(this.mentionChar, '');
16350
+ }
16351
+ };
16352
+ Mention.prototype.getQuery = function (query) {
16353
+ var filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
16354
+ var filterType = (this.queryString === '' && !isNullOrUndefined(this.elementValue())) ? 'equal' : this.filterType;
16355
+ var queryString = (this.queryString === '' && !isNullOrUndefined(this.elementValue())) ?
16356
+ this.elementValue() : this.queryString;
16357
+ if (this.isFiltered) {
16358
+ return filterQuery;
16359
+ }
16360
+ if (this.queryString !== null && this.queryString !== '') {
16361
+ var dataType = this.typeOfData(this.dataSource).typeof;
16362
+ if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
16363
+ filterQuery.where('', filterType, queryString, this.ignoreCase, this.ignoreAccent);
16364
+ }
16365
+ else {
16366
+ var mapping = !isNullOrUndefined(this.fields.text) ? this.fields.text : '';
16367
+ filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
16368
+ }
16369
+ }
16370
+ if (!isNullOrUndefined(this.suggestionCount)) {
16371
+ // Since defualt value of suggestioncount is 25, checked the condition
16372
+ if (this.suggestionCount !== 25) {
16373
+ for (var queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
16374
+ if (filterQuery.queries[queryElements].fn === 'onTake') {
16375
+ filterQuery.queries.splice(queryElements, 1);
16376
+ }
16377
+ }
16378
+ }
16379
+ filterQuery.take(this.suggestionCount);
16380
+ }
16381
+ return filterQuery;
16382
+ };
16383
+ Mention.prototype.renderHightSearch = function () {
16384
+ if (this.highlight) {
16385
+ for (var i = 0; i < this.liCollections.length; i++) {
16386
+ var isHighlight = this.ulElement.querySelector('.e-active');
16387
+ if (!isHighlight) {
16388
+ revertHighlightSearch(this.liCollections[i]);
16389
+ highlightSearch(this.liCollections[i], this.queryString, this.ignoreCase, this.filterType);
16390
+ }
16391
+ }
16392
+ }
16393
+ };
16394
+ Mention.prototype.getTextRange = function () {
16395
+ var text;
16396
+ if (!this.isContentEditable(this.inputElement)) {
16397
+ var component = this.inputElement;
16398
+ if (!isNullOrUndefined(component)) {
16399
+ var startPos = component.selectionStart;
16400
+ if (component.value && startPos >= 0) {
16401
+ text = component.value.substring(0, startPos);
16402
+ }
16403
+ }
16404
+ }
16405
+ else {
16406
+ var selectedElem = this.range.startContainer;
16407
+ if (!isNullOrUndefined(selectedElem)) {
16408
+ var workingNodeContent = selectedElem.textContent;
16409
+ var selectStartOffset = this.range.startOffset;
16410
+ if (workingNodeContent && selectStartOffset >= 0) {
16411
+ text = workingNodeContent.substring(0, selectStartOffset);
16412
+ }
16413
+ }
16414
+ }
16415
+ return text;
16416
+ };
16417
+ Mention.prototype.getLastLetter = function (text) {
16418
+ if (isNullOrUndefined(text)) {
16419
+ return '';
16420
+ }
16421
+ var textValue = text.replace(/\u00A0/g, ' ');
16422
+ var words = textValue.split(/\s+/);
16423
+ var wordCnt = words.length - 1;
16424
+ return words[wordCnt].trim();
16425
+ };
16426
+ Mention.prototype.isContentEditable = function (element) {
16427
+ return element && element.nodeName !== 'INPUT' && element.nodeName !== 'TEXTAREA';
16428
+ };
16429
+ /**
16430
+ * Opens the popup that displays the list of items.
16431
+ *
16432
+ * @returns {void}
16433
+ */
16434
+ Mention.prototype.showPopup = function () {
16435
+ this.renderPopup();
16436
+ attributes(this.inputElement, { 'aria-activedescendant': this.selectedElementID });
16437
+ if (this.selectedElementID == null) {
16438
+ this.inputElement.removeAttribute('aria-activedescendant');
16439
+ }
16440
+ };
16441
+ /* eslint-disable valid-jsdoc, jsdoc/require-param */
16442
+ /**
16443
+ * Hides the popup if it is in an open state.
16444
+ *
16445
+ * @returns {void}
16446
+ */
16447
+ Mention.prototype.hidePopup = function (e) {
16448
+ this.removeSelection();
16449
+ this.closePopup(0, e);
16450
+ };
16451
+ Mention.prototype.closePopup = function (delay, e) {
16452
+ var _this = this;
16453
+ if (!(this.popupObj && document.body.contains(this.popupObj.element) && this.beforePopupOpen)) {
16454
+ return;
16455
+ }
16456
+ EventHandler.remove(document, 'mousedown', this.onDocumentClick);
16457
+ this.inputElement.removeAttribute('aria-owns');
16458
+ this.inputElement.removeAttribute('aria-activedescendant');
16459
+ this.beforePopupOpen = false;
16460
+ var animModel = {
16461
+ name: 'FadeOut',
16462
+ duration: 100,
16463
+ delay: delay ? delay : 0
16464
+ };
16465
+ var popupInstance = this.popupObj;
16466
+ var eventArgs = { popup: popupInstance, cancel: false, animation: animModel, event: e || null };
16467
+ this.trigger('closed', eventArgs, function (eventArgs) {
16468
+ if (!eventArgs.cancel && _this.popupObj) {
16469
+ if (_this.isPopupOpen) {
16470
+ _this.popupObj.hide(new Animation(eventArgs.animation));
16471
+ }
16472
+ else {
16473
+ _this.destroyPopup();
16474
+ }
16475
+ }
16476
+ });
16477
+ };
16478
+ Mention.prototype.renderPopup = function () {
16479
+ var _this = this;
16480
+ var args = { cancel: false };
16481
+ this.trigger('beforeOpen', args, function (args) {
16482
+ if (!args.cancel) {
16483
+ var popupEle_1 = isNullOrUndefined(_this.target) ? _this.createElement('div', {
16484
+ id: _this.inputElement.id + '_popup', className: 'e-mention e-popup ' + (_this.cssClass != null ? _this.cssClass : '')
16485
+ }) : _this.element;
16486
+ if (!isNullOrUndefined(_this.target)) {
16487
+ popupEle_1.id = _this.inputElement.id + '_popup';
16488
+ addClass([popupEle_1], ['e-mention', 'e-popup', 'e-popup-close']);
16489
+ }
16490
+ _this.listHeight = formatUnit(_this.popupHeight);
16491
+ if (!isNullOrUndefined(_this.list.querySelector('li')) && !_this.initRemoteRender) {
16492
+ var li = _this.list.querySelector('.' + dropDownBaseClasses.focus);
16493
+ if (!isNullOrUndefined(li)) {
16494
+ _this.selectedLI = li;
16495
+ var value = _this.getFormattedValue(li.getAttribute('data-value'));
16496
+ _this.selectEventCallback(li, _this.getDataByValue(value), value, true);
16497
+ }
16498
+ }
16499
+ append([_this.list], popupEle_1);
16500
+ if ((!_this.popupObj || !document.body.contains(_this.popupObj.element)) || !document.contains(popupEle_1) && isNullOrUndefined(_this.target)) {
16501
+ document.body.appendChild(popupEle_1);
16502
+ }
16503
+ var coordinates_1;
16504
+ popupEle_1.style.visibility = 'hidden';
16505
+ if (_this.popupHeight !== 'auto') {
16506
+ _this.list.style.maxHeight = (parseInt(_this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
16507
+ popupEle_1.style.maxHeight = formatUnit(_this.popupHeight);
16508
+ }
16509
+ else {
16510
+ popupEle_1.style.height = 'auto';
16511
+ }
16512
+ var offsetValue = 0;
16513
+ var left = 0;
16514
+ _this.initializePopup(popupEle_1, offsetValue, left);
16515
+ _this.checkCollision(popupEle_1);
16516
+ popupEle_1.style.visibility = 'visible';
16517
+ if (!isNullOrUndefined(_this.list)) {
16518
+ _this.unWireListEvents();
16519
+ _this.wireListEvents();
16520
+ }
16521
+ _this.selectedElementID = _this.selectedLI ? _this.selectedLI.id : null;
16522
+ attributes(_this.inputElement, { 'aria-owns': _this.inputElement.id + '_options', 'aria-activedescendant': _this.selectedElementID });
16523
+ if (_this.selectedElementID == null) {
16524
+ _this.inputElement.removeAttribute('aria-activedescendant');
16525
+ }
16526
+ var animModel = { name: 'FadeIn', duration: 100 };
16527
+ _this.beforePopupOpen = true;
16528
+ var popupInstance = _this.popupObj;
16529
+ var eventArgs = { popup: popupInstance, cancel: false, animation: animModel };
16530
+ _this.trigger('opened', eventArgs, function (eventArgs) {
16531
+ if (!eventArgs.cancel) {
16532
+ _this.renderReactTemplates();
16533
+ _this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.inputElement : null);
16534
+ coordinates_1 = _this.getCoordinates(_this.inputElement, _this.getTriggerCharPosition());
16535
+ if (!_this.isCollided) {
16536
+ popupEle_1.style.cssText = 'top: '.concat(coordinates_1.top.toString(), 'px;\n left: ').concat(coordinates_1.left.toString(), 'px;\nposition: absolute;\n display: block;');
16537
+ }
16538
+ else {
16539
+ popupEle_1.style.left = formatUnit(coordinates_1.left);
16540
+ _this.isCollided = false;
16541
+ }
16542
+ popupEle_1.style.width = _this.popupWidth !== '100%' && !isNullOrUndefined(_this.popupWidth) ? formatUnit(_this.popupWidth) : 'auto';
16543
+ }
16544
+ else {
16545
+ _this.beforePopupOpen = false;
16546
+ _this.destroyPopup();
16547
+ }
16548
+ });
16549
+ }
16550
+ else {
16551
+ _this.beforePopupOpen = false;
16552
+ }
16553
+ });
16554
+ };
16555
+ Mention.prototype.checkCollision = function (popupEle) {
16556
+ if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
16557
+ var collision = isCollide(popupEle);
16558
+ if (collision.length > 0) {
16559
+ popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
16560
+ this.isCollided = true;
16561
+ }
16562
+ this.popupObj.resolveCollision();
16563
+ }
16564
+ };
16565
+ Mention.prototype.getTriggerCharPosition = function () {
16566
+ var mostRecentTriggerCharPos;
16567
+ var currentRange = this.getTextRange();
16568
+ if (currentRange !== undefined && currentRange !== null) {
16569
+ mostRecentTriggerCharPos = 0;
16570
+ var idx = currentRange.lastIndexOf(this.mentionChar);
16571
+ if (idx >= mostRecentTriggerCharPos) {
16572
+ mostRecentTriggerCharPos = idx;
16573
+ }
16574
+ }
16575
+ return mostRecentTriggerCharPos;
16576
+ };
16577
+ Mention.prototype.initializePopup = function (element, offsetValue, left) {
16578
+ var _this = this;
16579
+ this.popupObj = new Popup(element, {
16580
+ width: this.setWidth(), targetType: 'relative',
16581
+ relateTo: this.inputElement, collision: { X: 'flip', Y: 'flip' }, offsetY: offsetValue,
16582
+ enableRtl: this.enableRtl, offsetX: left, position: { X: 'top', Y: 'left' }, actionOnScroll: 'hide',
16583
+ zIndex: this.zIndex,
16584
+ close: function () {
16585
+ _this.destroyPopup();
16586
+ },
16587
+ open: function () {
16588
+ EventHandler.add(document, 'mousedown', _this.onDocumentClick, _this);
16589
+ _this.isPopupOpen = true;
16590
+ _this.setDataIndex();
16591
+ }
16592
+ });
16593
+ };
16594
+ Mention.prototype.setWidth = function () {
16595
+ var width = formatUnit(this.popupWidth);
16596
+ if (width.indexOf('%') > -1) {
16597
+ var inputWidth = this.inputElement.offsetWidth * parseFloat(width) / 100;
16598
+ width = inputWidth.toString() + 'px';
16599
+ }
16600
+ return width;
16601
+ };
16602
+ Mention.prototype.destroyPopup = function () {
16603
+ this.isPopupOpen = false;
16604
+ this.popupObj.destroy();
16605
+ if (isNullOrUndefined(this.target)) {
16606
+ detach(this.popupObj.element);
16607
+ }
16608
+ else {
16609
+ this.popupObj.element.innerHTML = '';
16610
+ this.popupObj.element.removeAttribute('style');
16611
+ this.popupObj.element.removeAttribute('aria-disabled');
16612
+ }
16613
+ };
16614
+ Mention.prototype.onDocumentClick = function (e) {
16615
+ var target = e.target;
16616
+ if (!(!isNullOrUndefined(this.popupObj) && closest(target, '#' + this.popupObj.element.id))) {
16617
+ this.hidePopup(e);
16618
+ }
16619
+ };
16620
+ Mention.prototype.getCoordinates = function (element, position) {
16621
+ var properties = ['direction', 'boxSizing', 'width', 'height', 'overflowX', 'overflowY', 'borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'fontStyle', 'fontVariant', 'fontWeight', 'fontStretch', 'fontSize', 'fontSizeAdjust', 'lineHeight', 'fontFamily', 'textAlign', 'textTransform', 'textIndent', 'textDecoration', 'letterSpacing', 'wordSpacing'];
16622
+ var div;
16623
+ var span;
16624
+ var range;
16625
+ var globalRange;
16626
+ var coordinates;
16627
+ var computed;
16628
+ var rect;
16629
+ if (!this.isContentEditable(this.inputElement)) {
16630
+ div = this.createElement('div', { className: 'e-form-mirror-div' });
16631
+ document.body.appendChild(div);
16632
+ computed = getComputedStyle(element);
16633
+ div.style.position = 'absolute';
16634
+ div.style.visibility = 'hidden';
16635
+ properties.forEach(function (prop) {
16636
+ div.style[prop] = computed[prop];
16637
+ });
16638
+ div.textContent = element.value.substring(0, position);
16639
+ if (this.inputElement.nodeName === 'INPUT') {
16640
+ div.textContent = div.textContent.replace(/\s/g, '\u00a0');
16641
+ }
16642
+ span = this.createElement('span');
16643
+ span.textContent = element.value.substring(position) || '.';
16644
+ div.appendChild(span);
16645
+ rect = element.getBoundingClientRect();
16646
+ }
16647
+ else {
16648
+ var selectedNodePosition = this.getTriggerCharPosition();
16649
+ globalRange = this.range;
16650
+ range = document.createRange();
16651
+ range.setStart(globalRange.startContainer, selectedNodePosition);
16652
+ range.setEnd(globalRange.startContainer, selectedNodePosition);
16653
+ range.collapse(false);
16654
+ rect = range.getBoundingClientRect();
16655
+ }
16656
+ var doc = document.documentElement;
16657
+ var windowLeft = (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);
16658
+ var windowTop = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
16659
+ if (!this.isContentEditable(this.inputElement)) {
16660
+ coordinates = {
16661
+ top: rect.top + windowTop + span.offsetTop + parseInt(computed.borderTopWidth, 10) +
16662
+ parseInt(computed.fontSize, 10) + 3 - element.scrollTop,
16663
+ left: rect.left + windowLeft + span.offsetLeft + parseInt(computed.borderLeftWidth, 10)
16664
+ };
16665
+ document.body.removeChild(div);
16666
+ }
16667
+ else {
16668
+ coordinates = {
16669
+ top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize),
16670
+ left: rect.left + windowLeft
16671
+ };
16672
+ }
16673
+ return coordinates;
16674
+ };
16675
+
16676
+ Mention.prototype.initValue = function () {
16677
+ this.renderList();
16678
+ if (this.dataSource instanceof DataManager) {
16679
+ this.initRemoteRender = true;
16680
+ }
16681
+ else {
16682
+ this.updateValues();
16683
+ }
16684
+ };
16685
+ Mention.prototype.updateValues = function () {
16686
+ var li = this.list.querySelector('.' + dropDownBaseClasses.focus);
16687
+ if (!isNullOrUndefined(li)) {
16688
+ this.setSelection(li, null);
16689
+ }
16690
+ };
16691
+ Mention.prototype.renderList = function () {
16692
+ _super.prototype.render.call(this);
16693
+ this.unWireListEvents();
16694
+ this.wireListEvents();
16695
+ };
16696
+ /**
16697
+ * Event binding for list
16698
+ *
16699
+ * @returns {void}
16700
+ */
16701
+ Mention.prototype.wireListEvents = function () {
16702
+ EventHandler.add(this.list, 'click', this.onMouseClick, this);
16703
+ EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
16704
+ EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
16705
+ };
16706
+ /**
16707
+ * Event un binding for list items.
16708
+ *
16709
+ * @returns {void}
16710
+ */
16711
+ Mention.prototype.unWireListEvents = function () {
16712
+ EventHandler.remove(this.list, 'click', this.onMouseClick);
16713
+ EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
16714
+ EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
16715
+ };
16716
+ Mention.prototype.onMouseClick = function (e) {
16717
+ var target = e.target;
16718
+ var li = closest(target, '.' + dropDownBaseClasses.li);
16719
+ if (!this.isValidLI(li)) {
16720
+ return;
16721
+ }
16722
+ this.setSelection(li, e);
16723
+ var delay = 100;
16724
+ this.closePopup(delay, e);
16725
+ this.inputElement.focus();
16726
+ };
16727
+ Mention.prototype.updateSelectedItem = function (li, e, preventSelect, isSelection) {
16728
+ var _this = this;
16729
+ this.removeSelection();
16730
+ li.classList.add(dropDownBaseClasses.selected);
16731
+ this.removeHover();
16732
+ var value = this.getFormattedValue(li.getAttribute('data-value'));
16733
+ var selectedData = this.getDataByValue(value);
16734
+ if (!preventSelect && !isNullOrUndefined(e)) {
16735
+ var items = this.detachChanges(selectedData);
16736
+ this.isSelected = true;
16737
+ var eventArgs = {
16738
+ e: e,
16739
+ item: li,
16740
+ itemData: items,
16741
+ isInteracted: e ? true : false,
16742
+ cancel: false
16743
+ };
16744
+ this.trigger('select', eventArgs, function (eventArgs) {
16745
+ if (eventArgs.cancel) {
16746
+ li.classList.remove(dropDownBaseClasses.selected);
16747
+ }
16748
+ else {
16749
+ _this.selectEventCallback(li, selectedData, value);
16750
+ if (isSelection) {
16751
+ _this.setSelectOptions(li, e);
16752
+ }
16753
+ }
16754
+ });
16755
+ }
16756
+ else {
16757
+ this.selectEventCallback(li, selectedData, value);
16758
+ if (isSelection) {
16759
+ this.setSelectOptions(li, e);
16760
+ }
16761
+ }
16762
+ };
16763
+ Mention.prototype.setSelection = function (li, e) {
16764
+ if (this.isValidLI(li) && (!li.classList.contains(dropDownBaseClasses.selected) || (this.isPopupOpen && this.isSelected
16765
+ && li.classList.contains(dropDownBaseClasses.selected)))) {
16766
+ this.updateSelectedItem(li, e, false, true);
16767
+ }
16768
+ else {
16769
+ this.setSelectOptions(li, e);
16770
+ }
16771
+ };
16772
+ Mention.prototype.setSelectOptions = function (li, e) {
16773
+ if (this.list) {
16774
+ this.removeHover();
16775
+ }
16776
+ this.previousSelectedLI = (!isNullOrUndefined(this.selectedLI)) ? this.selectedLI : null;
16777
+ this.selectedLI = li;
16778
+ if (this.isPopupOpen && !isNullOrUndefined(this.selectedLI)) {
16779
+ this.setScrollPosition(e);
16780
+ }
16781
+ if (e && (e.keyCode === 38 || e.keyCode === 40)) {
16782
+ return;
16783
+ }
16784
+ if (isNullOrUndefined(e) || this.setValue(e)) {
16785
+ return;
16786
+ }
16787
+ };
16788
+ Mention.prototype.setScrollPosition = function (e) {
16789
+ if (!isNullOrUndefined(e)) {
16790
+ switch (e.action) {
16791
+ case 'pageDown':
16792
+ case 'down':
16793
+ case 'end':
16794
+ this.scrollBottom();
16795
+ break;
16796
+ default:
16797
+ this.scrollTop();
16798
+ break;
16799
+ }
16800
+ }
16801
+ else {
16802
+ this.scrollBottom(true);
16803
+ }
16804
+ };
16805
+ Mention.prototype.scrollBottom = function (isInitial) {
16806
+ if (!isNullOrUndefined(this.selectedLI)) {
16807
+ var currentOffset = this.list.offsetHeight;
16808
+ var nextBottom = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
16809
+ var nextOffset = this.list.scrollTop + nextBottom - currentOffset;
16810
+ nextOffset = isInitial ? nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10) * 2 : nextOffset;
16811
+ var boxRange = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
16812
+ if (this.activeIndex === 0) {
16813
+ this.list.scrollTop = 0;
16814
+ }
16815
+ else if (nextBottom > currentOffset || !(boxRange > 0 && this.list.offsetHeight > boxRange)) {
16816
+ this.list.scrollTop = nextOffset;
16817
+ }
16818
+ }
16819
+ };
16820
+ Mention.prototype.scrollTop = function () {
16821
+ if (!isNullOrUndefined(this.selectedLI)) {
16822
+ var nextOffset = this.selectedLI.offsetTop - this.list.scrollTop;
16823
+ nextOffset = this.fields.groupBy && nextOffset;
16824
+ var boxRange = (this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop);
16825
+ if (this.activeIndex === 0) {
16826
+ this.list.scrollTop = 0;
16827
+ }
16828
+ else if (nextOffset < 0) {
16829
+ this.list.scrollTop = this.list.scrollTop + nextOffset;
16830
+ }
16831
+ else if (!(boxRange > 0 && this.list.offsetHeight > boxRange)) {
16832
+ this.list.scrollTop = this.selectedLI.offsetTop;
16833
+ }
16834
+ }
16835
+ };
16836
+ Mention.prototype.selectEventCallback = function (li, selectedData, value, selectLi) {
16837
+ this.previousItemData = (!isNullOrUndefined(this.itemData)) ? this.itemData : null;
16838
+ this.item = li;
16839
+ this.itemData = selectedData;
16840
+ var focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
16841
+ if (focusedItem) {
16842
+ removeClass([focusedItem], dropDownBaseClasses.focus);
16843
+ }
16844
+ if (selectLi) {
16845
+ addClass([li], dropDownBaseClasses.selected);
16846
+ }
16847
+ li.setAttribute('aria-selected', 'true');
16848
+ this.activeIndex = this.getIndexByValue(value);
16849
+ };
16850
+ Mention.prototype.detachChanges = function (value) {
16851
+ var items;
16852
+ if (typeof value === 'string' ||
16853
+ typeof value === 'boolean' ||
16854
+ typeof value === 'number') {
16855
+ items = Object.defineProperties({}, {
16856
+ value: {
16857
+ value: value,
16858
+ enumerable: true
16859
+ },
16860
+ text: {
16861
+ value: value,
16862
+ enumerable: true
16863
+ }
16864
+ });
16865
+ }
16866
+ else {
16867
+ items = value;
16868
+ }
16869
+ return items;
16870
+ };
16871
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
16872
+ Mention.prototype.setValue = function (e) {
16873
+ var dataItem = this.getItemData();
16874
+ var textSuffix;
16875
+ var value;
16876
+ var endPos;
16877
+ var range;
16878
+ var globalRange;
16879
+ var selection = this.inputElement.ownerDocument.getSelection();
16880
+ var startPos = this.getTriggerCharPosition();
16881
+ textSuffix = typeof this.suffixText === 'string' ? this.suffixText : '';
16882
+ if (dataItem.value !== null) {
16883
+ value = this.mentionVal(dataItem.text);
16884
+ }
16885
+ if (!this.isContentEditable(this.inputElement)) {
16886
+ var myField = this.inputElement;
16887
+ var currentTriggerSnippet = this.getTextRange().substring(startPos + this.mentionChar.length, this.getTextRange().length);
16888
+ value += textSuffix;
16889
+ endPos = startPos + this.mentionChar.length;
16890
+ endPos += currentTriggerSnippet.length;
16891
+ myField.value = myField.value.substring(0, startPos) + value + myField.value.substring(endPos, myField.value.length);
16892
+ myField.selectionStart = startPos + value.length;
16893
+ myField.selectionEnd = startPos + value.length;
16894
+ if (this.isPopupOpen) {
16895
+ this.hidePopup();
16896
+ }
16897
+ this.onChangeEvent(e);
16898
+ return true;
16899
+ }
16900
+ else {
16901
+ endPos = this.getTriggerCharPosition() + this.mentionChar.length;
16902
+ if (this.range && (this.range.startContainer.textContent.trim() !== this.mentionChar)) {
16903
+ endPos = this.range.endOffset;
16904
+ }
16905
+ globalRange = this.range;
16906
+ range = document.createRange();
16907
+ range.setStart(globalRange.startContainer, startPos);
16908
+ range.setEnd(globalRange.startContainer, endPos);
16909
+ range.deleteContents();
16910
+ var element = this.createElement('div');
16911
+ element.innerHTML = value;
16912
+ var frag = document.createDocumentFragment();
16913
+ var node = void 0;
16914
+ var lastNode = void 0;
16915
+ while (node = element.firstChild) {
16916
+ lastNode = frag.appendChild(node);
16917
+ }
16918
+ range.insertNode(frag);
16919
+ if (lastNode) {
16920
+ range = range.cloneRange();
16921
+ range.setStartAfter(lastNode);
16922
+ range.collapse(true);
16923
+ selection.removeAllRanges();
16924
+ selection.addRange(range);
16925
+ }
16926
+ if (this.isPopupOpen) {
16927
+ this.hidePopup();
16928
+ }
16929
+ this.onChangeEvent(e);
16930
+ return true;
16931
+ }
16932
+ };
16933
+ Mention.prototype.mentionVal = function (value) {
16934
+ var showChar = this.showMentionChar ? this.mentionChar : '';
16935
+ if (!isNullOrUndefined(this.displayTemplate)) {
16936
+ value = this.setDisplayTemplate();
16937
+ }
16938
+ if (this.isContentEditable(this.inputElement)) {
16939
+ return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
16940
+ }
16941
+ else {
16942
+ return showChar + value;
16943
+ }
16944
+ };
16945
+ Mention.prototype.setDisplayTemplate = function () {
16946
+ var compiledString;
16947
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16948
+ if (this.isReact) {
16949
+ this.clearTemplate(['displayTemplate']);
16950
+ if (this.displayTempElement) {
16951
+ detach(this.displayTempElement);
16952
+ this.displayTempElement = null;
16953
+ }
16954
+ }
16955
+ if (!this.displayTempElement) {
16956
+ this.displayTempElement = this.createElement('div');
16957
+ }
16958
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16959
+ if (!this.isReact) {
16960
+ this.displayTempElement.innerHTML = '';
16961
+ }
16962
+ compiledString = compile(this.displayTemplate);
16963
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16964
+ var displayCompTemp = compiledString(this.itemData, this, 'displayTemplate', this.displayTemplateId, this.isStringTemplate, null, this.displayTempElement);
16965
+ if (displayCompTemp && displayCompTemp.length > 0) {
16966
+ for (var i = 0; i < displayCompTemp.length; i++) {
16967
+ this.displayTempElement.appendChild(displayCompTemp[i]);
16968
+ }
16969
+ }
16970
+ this.renderReactTemplates();
16971
+ return this.displayTempElement.innerHTML;
16972
+ };
16973
+ Mention.prototype.setSpinnerTemplate = function () {
16974
+ var compiledString;
16975
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16976
+ if (this.isReact) {
16977
+ this.clearTemplate(['spinnerTemplate']);
16978
+ if (this.spinnerTemplateElement) {
16979
+ detach(this.spinnerTemplateElement);
16980
+ this.spinnerTemplateElement = null;
16981
+ }
16982
+ }
16983
+ if (!this.spinnerTemplateElement) {
16984
+ this.spinnerTemplateElement = this.createElement('div');
16985
+ }
16986
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16987
+ if (!this.isReact) {
16988
+ this.spinnerTemplateElement.innerHTML = '';
16989
+ }
16990
+ compiledString = compile(this.spinnerTemplate);
16991
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16992
+ var spinnerCompTemp = compiledString(null, this, 'spinnerTemplate', this.spinnerTemplateId, this.isStringTemplate, null, this.spinnerTemplateElement);
16993
+ if (spinnerCompTemp && spinnerCompTemp.length > 0) {
16994
+ for (var i = 0; i < spinnerCompTemp.length; i++) {
16995
+ this.spinnerTemplateElement.appendChild(spinnerCompTemp[i]);
16996
+ }
16997
+ }
16998
+ this.renderReactTemplates();
16999
+ };
17000
+ Mention.prototype.onChangeEvent = function (eve) {
17001
+ this.isSelected = false;
17002
+ var items = this.detachMentionChanges(this.itemData);
17003
+ var preItems;
17004
+ if (typeof this.previousItemData === 'string' ||
17005
+ typeof this.previousItemData === 'boolean' ||
17006
+ typeof this.previousItemData === 'number') {
17007
+ preItems = Object.defineProperties({}, {
17008
+ value: {
17009
+ value: this.previousItemData,
17010
+ enumerable: true
17011
+ },
17012
+ text: {
17013
+ value: this.previousItemData,
17014
+ enumerable: true
17015
+ }
17016
+ });
17017
+ }
17018
+ else {
17019
+ preItems = this.previousItemData;
17020
+ }
17021
+ var eventArgs = {
17022
+ e: eve,
17023
+ item: this.item,
17024
+ itemData: items,
17025
+ previousItem: this.previousSelectedLI,
17026
+ previousItemData: preItems,
17027
+ isInteracted: eve ? true : false,
17028
+ value: this.item.innerHTML,
17029
+ element: this.inputElement
17030
+ };
17031
+ this.trigger('change', eventArgs);
17032
+ };
17033
+ Mention.prototype.detachMentionChanges = function (value) {
17034
+ var items;
17035
+ if (typeof value === 'string' ||
17036
+ typeof value === 'boolean' ||
17037
+ typeof value === 'number') {
17038
+ items = Object.defineProperties({}, {
17039
+ value: {
17040
+ value: value,
17041
+ enumerable: true
17042
+ },
17043
+ text: {
17044
+ value: value,
17045
+ enumerable: true
17046
+ }
17047
+ });
17048
+ }
17049
+ else {
17050
+ items = value;
17051
+ }
17052
+ return items;
17053
+ };
17054
+ Mention.prototype.getItemData = function () {
17055
+ var fields = this.fields;
17056
+ var dataItem = null;
17057
+ dataItem = this.itemData;
17058
+ var dataValue;
17059
+ var dataText;
17060
+ if (!isNullOrUndefined(dataItem)) {
17061
+ dataValue = getValue(fields.value, dataItem);
17062
+ dataText = getValue(fields.text, dataItem);
17063
+ }
17064
+ var value = (!isNullOrUndefined(dataItem) &&
17065
+ !isUndefined(dataValue) ? dataValue : dataItem);
17066
+ var text = (!isNullOrUndefined(dataItem) &&
17067
+ !isUndefined(dataValue) ? dataText : dataItem);
17068
+ return { value: value, text: text };
17069
+ };
17070
+ Mention.prototype.removeSelection = function () {
17071
+ if (this.list) {
17072
+ var selectedItems = this.list.querySelectorAll('.' + dropDownBaseClasses.selected);
17073
+ if (selectedItems.length) {
17074
+ removeClass(selectedItems, dropDownBaseClasses.selected);
17075
+ selectedItems[0].removeAttribute('aria-selected');
17076
+ }
17077
+ }
17078
+ };
17079
+ Mention.prototype.onMouseOver = function (e) {
17080
+ var currentLi = closest(e.target, '.' + dropDownBaseClasses.li);
17081
+ this.setHover(currentLi);
17082
+ };
17083
+ Mention.prototype.setHover = function (li) {
17084
+ if (this.enabled && this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.hover)) {
17085
+ this.removeHover();
17086
+ addClass([li], dropDownBaseClasses.hover);
17087
+ }
17088
+ };
17089
+ Mention.prototype.removeHover = function () {
17090
+ if (this.list) {
17091
+ var hoveredItem = this.list.querySelectorAll('.' + dropDownBaseClasses.hover);
17092
+ if (hoveredItem && hoveredItem.length) {
17093
+ removeClass(hoveredItem, dropDownBaseClasses.hover);
17094
+ }
17095
+ }
17096
+ };
17097
+ Mention.prototype.isValidLI = function (li) {
17098
+ return (li && li.hasAttribute('role') && li.getAttribute('role') === 'option');
17099
+ };
17100
+ Mention.prototype.onMouseLeave = function () {
17101
+ this.removeHover();
17102
+ };
17103
+ /**
17104
+ * Search the entered text and show it in the suggestion list if available.
17105
+ *
17106
+ * @returns {void}
17107
+ */
17108
+ Mention.prototype.search = function (text, positionX, positionY) {
17109
+ if ((this.ignoreCase && (text === this.elementValue() || text === this.elementValue().toLowerCase()))
17110
+ || !this.ignoreCase && text === this.elementValue()) {
17111
+ this.resetList(this.dataSource, this.fields);
17112
+ }
17113
+ else {
17114
+ if (this.isPopupOpen) {
17115
+ this.hidePopup();
17116
+ }
17117
+ return;
17118
+ }
17119
+ if (isNullOrUndefined(this.list)) {
17120
+ this.renderList();
17121
+ this.renderPopup();
17122
+ }
17123
+ else {
17124
+ this.showPopup();
17125
+ }
17126
+ this.popupObj.element.style.left = formatUnit(positionX);
17127
+ this.popupObj.element.style.top = formatUnit(positionY);
17128
+ };
17129
+ /**
17130
+ * Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
17131
+ *
17132
+ * @method destroy
17133
+ * @returns {void}
17134
+ */
17135
+ Mention.prototype.destroy = function () {
17136
+ this.hidePopup();
17137
+ this.unWireEvent();
17138
+ if (this.list) {
17139
+ this.unWireListEvents();
17140
+ }
17141
+ if (this.inputElement && !this.inputElement.classList.contains('e-' + this.getModuleName())) {
17142
+ return;
17143
+ }
17144
+ _super.prototype.destroy.call(this);
17145
+ };
17146
+ Mention.prototype.getLocaleName = function () {
17147
+ return 'mention';
17148
+ };
17149
+ Mention.prototype.getNgDirective = function () {
17150
+ return 'EJS-MENTION';
17151
+ };
17152
+ /**
17153
+ * Return the module name of this component.
17154
+ *
17155
+ * @private
17156
+ * @returns {string} Return the module name of this component.
17157
+ */
17158
+ Mention.prototype.getModuleName = function () {
17159
+ return 'mention';
17160
+ };
17161
+ __decorate$7([
17162
+ Property(null)
17163
+ ], Mention.prototype, "cssClass", void 0);
17164
+ __decorate$7([
17165
+ Property('@')
17166
+ ], Mention.prototype, "mentionChar", void 0);
17167
+ __decorate$7([
17168
+ Property(false)
17169
+ ], Mention.prototype, "showMentionChar", void 0);
17170
+ __decorate$7([
17171
+ Property(false)
17172
+ ], Mention.prototype, "allowSpaces", void 0);
17173
+ __decorate$7([
17174
+ Property(null)
17175
+ ], Mention.prototype, "suffixText", void 0);
17176
+ __decorate$7([
17177
+ Property(25)
17178
+ ], Mention.prototype, "suggestionCount", void 0);
17179
+ __decorate$7([
17180
+ Property(0)
17181
+ ], Mention.prototype, "minLength", void 0);
17182
+ __decorate$7([
17183
+ Property('None')
17184
+ ], Mention.prototype, "sortOrder", void 0);
17185
+ __decorate$7([
17186
+ Property(true)
17187
+ ], Mention.prototype, "ignoreCase", void 0);
17188
+ __decorate$7([
17189
+ Property(false)
17190
+ ], Mention.prototype, "highlight", void 0);
17191
+ __decorate$7([
17192
+ Property()
17193
+ ], Mention.prototype, "locale", void 0);
17194
+ __decorate$7([
17195
+ Property('auto')
17196
+ ], Mention.prototype, "popupWidth", void 0);
17197
+ __decorate$7([
17198
+ Property('300px')
17199
+ ], Mention.prototype, "popupHeight", void 0);
17200
+ __decorate$7([
17201
+ Property(null)
17202
+ ], Mention.prototype, "displayTemplate", void 0);
17203
+ __decorate$7([
17204
+ Property(null)
17205
+ ], Mention.prototype, "itemTemplate", void 0);
17206
+ __decorate$7([
17207
+ Property('No records found')
17208
+ ], Mention.prototype, "noRecordsTemplate", void 0);
17209
+ __decorate$7([
17210
+ Property(null)
17211
+ ], Mention.prototype, "spinnerTemplate", void 0);
17212
+ __decorate$7([
17213
+ Property()
17214
+ ], Mention.prototype, "target", void 0);
17215
+ __decorate$7([
17216
+ Property([])
17217
+ ], Mention.prototype, "dataSource", void 0);
17218
+ __decorate$7([
17219
+ Property(null)
17220
+ ], Mention.prototype, "query", void 0);
17221
+ __decorate$7([
17222
+ Property('Contains')
17223
+ ], Mention.prototype, "filterType", void 0);
17224
+ __decorate$7([
17225
+ Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
17226
+ ], Mention.prototype, "fields", void 0);
17227
+ __decorate$7([
17228
+ Event()
17229
+ ], Mention.prototype, "actionBegin", void 0);
17230
+ __decorate$7([
17231
+ Event()
17232
+ ], Mention.prototype, "actionComplete", void 0);
17233
+ __decorate$7([
17234
+ Event()
17235
+ ], Mention.prototype, "actionFailure", void 0);
17236
+ __decorate$7([
17237
+ Event()
17238
+ ], Mention.prototype, "change", void 0);
17239
+ __decorate$7([
17240
+ Event()
17241
+ ], Mention.prototype, "beforeOpen", void 0);
17242
+ __decorate$7([
17243
+ Event()
17244
+ ], Mention.prototype, "opened", void 0);
17245
+ __decorate$7([
17246
+ Event()
17247
+ ], Mention.prototype, "closed", void 0);
17248
+ __decorate$7([
17249
+ Event()
17250
+ ], Mention.prototype, "select", void 0);
17251
+ __decorate$7([
17252
+ Event()
17253
+ ], Mention.prototype, "filtering", void 0);
17254
+ __decorate$7([
17255
+ Event()
17256
+ ], Mention.prototype, "created", void 0);
17257
+ __decorate$7([
17258
+ Event()
17259
+ ], Mention.prototype, "destroyed", void 0);
17260
+ Mention = __decorate$7([
17261
+ NotifyPropertyChanges
17262
+ ], Mention);
17263
+ return Mention;
17264
+ }(DropDownBase));
17265
+
15871
17266
  /**
15872
17267
  * export all modules from current location
15873
17268
  */
@@ -15876,5 +17271,5 @@ var listBoxClasses = {
15876
17271
  * export all modules from current location
15877
17272
  */
15878
17273
 
15879
- 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 };
17274
+ 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 };
15880
17275
  //# sourceMappingURL=ej2-dropdowns.es5.js.map