@syncfusion/ej2-dropdowns 23.1.39 → 23.1.40-85814

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 (276) hide show
  1. package/CHANGELOG.md +2042 -2036
  2. package/{README.md → ReadMe.md} +217 -217
  3. package/dist/ej2-dropdowns.umd.min.js +0 -9
  4. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-dropdowns.es2015.js +56 -56
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +198 -198
  8. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  9. package/dist/global/ej2-dropdowns.min.js +0 -9
  10. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  11. package/dist/global/index.d.ts +0 -9
  12. package/dist/ts/auto-complete/auto-complete.ts +615 -0
  13. package/dist/ts/combo-box/combo-box.ts +1028 -0
  14. package/dist/ts/common/highlight-search.ts +57 -0
  15. package/dist/ts/common/incremental-search.ts +131 -0
  16. package/dist/ts/common/interface.ts +72 -0
  17. package/dist/ts/common/virtual-scroll.ts +354 -0
  18. package/dist/ts/drop-down-base/drop-down-base.ts +1838 -0
  19. package/dist/ts/drop-down-list/drop-down-list.ts +3889 -0
  20. package/dist/ts/drop-down-tree/drop-down-tree.ts +3750 -0
  21. package/dist/ts/list-box/list-box.ts +2736 -0
  22. package/dist/ts/mention/mention.ts +1828 -0
  23. package/dist/ts/multi-select/checkbox-selection.ts +547 -0
  24. package/dist/ts/multi-select/float-label.ts +176 -0
  25. package/dist/ts/multi-select/interface.ts +70 -0
  26. package/dist/ts/multi-select/multi-select.ts +4874 -0
  27. package/helpers/e2e/autocomplete.js +13 -13
  28. package/helpers/e2e/combobox.js +13 -13
  29. package/helpers/e2e/dropdownlist.js +13 -13
  30. package/helpers/e2e/index.js +3 -3
  31. package/helpers/e2e/listboxHelper.js +13 -13
  32. package/helpers/e2e/multiselect.js +13 -13
  33. package/license +2 -2
  34. package/package.json +79 -79
  35. package/src/auto-complete/auto-complete-model.d.ts +188 -188
  36. package/src/auto-complete/auto-complete.d.ts +12 -12
  37. package/src/auto-complete/auto-complete.js +21 -21
  38. package/src/combo-box/combo-box-model.d.ts +224 -224
  39. package/src/combo-box/combo-box.d.ts +27 -27
  40. package/src/combo-box/combo-box.js +29 -29
  41. package/src/common/virtual-scroll.js +46 -46
  42. package/src/drop-down-base/drop-down-base-model.d.ts +200 -200
  43. package/src/drop-down-base/drop-down-base.d.ts +15 -15
  44. package/src/drop-down-base/drop-down-base.js +20 -20
  45. package/src/drop-down-list/drop-down-list-model.d.ts +202 -202
  46. package/src/drop-down-list/drop-down-list.d.ts +4 -4
  47. package/src/drop-down-list/drop-down-list.js +20 -20
  48. package/src/drop-down-tree/drop-down-tree-model.d.ts +468 -468
  49. package/src/drop-down-tree/drop-down-tree.js +19 -19
  50. package/src/list-box/list-box-model.d.ts +193 -193
  51. package/src/list-box/list-box.d.ts +2 -2
  52. package/src/list-box/list-box.js +19 -19
  53. package/src/mention/mention-model.d.ts +261 -261
  54. package/src/mention/mention.js +19 -19
  55. package/src/multi-select/multi-select-model.d.ts +512 -512
  56. package/src/multi-select/multi-select.js +19 -19
  57. package/styles/auto-complete/_all.scss +1 -1
  58. package/styles/auto-complete/_bootstrap-dark-definition.scss +3 -3
  59. package/styles/auto-complete/_bootstrap-definition.scss +2 -2
  60. package/styles/auto-complete/_bootstrap4-definition.scss +11 -11
  61. package/styles/auto-complete/_bootstrap5-definition.scss +2 -2
  62. package/styles/auto-complete/_fabric-dark-definition.scss +2 -2
  63. package/styles/auto-complete/_fabric-definition.scss +2 -2
  64. package/styles/auto-complete/_fluent-definition.scss +2 -2
  65. package/styles/auto-complete/_fusionnew-definition.scss +2 -2
  66. package/styles/auto-complete/_highcontrast-definition.scss +2 -2
  67. package/styles/auto-complete/_highcontrast-light-definition.scss +2 -2
  68. package/styles/auto-complete/_material-dark-definition.scss +2 -2
  69. package/styles/auto-complete/_material-definition.scss +2 -2
  70. package/styles/auto-complete/_material3-definition.scss +2 -2
  71. package/styles/auto-complete/_tailwind-definition.scss +2 -2
  72. package/styles/auto-complete/bootstrap4.css +13 -2
  73. package/styles/auto-complete/material3-dark.scss +1 -1
  74. package/styles/auto-complete/material3.scss +1 -1
  75. package/styles/bootstrap4.css +32 -2
  76. package/styles/combo-box/_all.scss +1 -1
  77. package/styles/combo-box/_bootstrap-dark-definition.scss +2 -2
  78. package/styles/combo-box/_bootstrap-definition.scss +2 -2
  79. package/styles/combo-box/_bootstrap4-definition.scss +11 -11
  80. package/styles/combo-box/_bootstrap5-definition.scss +2 -2
  81. package/styles/combo-box/_fabric-dark-definition.scss +2 -2
  82. package/styles/combo-box/_fabric-definition.scss +2 -2
  83. package/styles/combo-box/_fluent-definition.scss +2 -2
  84. package/styles/combo-box/_fusionnew-definition.scss +2 -2
  85. package/styles/combo-box/_highcontrast-definition.scss +2 -2
  86. package/styles/combo-box/_highcontrast-light-definition.scss +3 -3
  87. package/styles/combo-box/_material-dark-definition.scss +2 -2
  88. package/styles/combo-box/_material-definition.scss +2 -2
  89. package/styles/combo-box/_material3-definition.scss +2 -2
  90. package/styles/combo-box/_tailwind-definition.scss +2 -2
  91. package/styles/combo-box/bootstrap4.css +13 -2
  92. package/styles/combo-box/material3-dark.scss +1 -1
  93. package/styles/combo-box/material3.scss +1 -1
  94. package/styles/drop-down-base/_all.scss +2 -2
  95. package/styles/drop-down-base/_bootstrap-dark-definition.scss +83 -83
  96. package/styles/drop-down-base/_bootstrap-definition.scss +83 -83
  97. package/styles/drop-down-base/_bootstrap4-definition.scss +90 -90
  98. package/styles/drop-down-base/_bootstrap5-definition.scss +117 -117
  99. package/styles/drop-down-base/_definition.scss +23 -23
  100. package/styles/drop-down-base/_fabric-dark-definition.scss +86 -86
  101. package/styles/drop-down-base/_fabric-definition.scss +84 -84
  102. package/styles/drop-down-base/_fluent-definition.scss +121 -121
  103. package/styles/drop-down-base/_fusionnew-definition.scss +117 -117
  104. package/styles/drop-down-base/_highcontrast-definition.scss +105 -105
  105. package/styles/drop-down-base/_highcontrast-light-definition.scss +105 -105
  106. package/styles/drop-down-base/_layout.scss +195 -195
  107. package/styles/drop-down-base/_material-dark-definition.scss +86 -86
  108. package/styles/drop-down-base/_material-definition.scss +85 -85
  109. package/styles/drop-down-base/_material3-definition.scss +87 -87
  110. package/styles/drop-down-base/_tailwind-definition.scss +129 -129
  111. package/styles/drop-down-base/_theme.scss +391 -391
  112. package/styles/drop-down-base/material3-dark.scss +1 -1
  113. package/styles/drop-down-base/material3.scss +1 -1
  114. package/styles/drop-down-list/_all.scss +3 -3
  115. package/styles/drop-down-list/_bootstrap-dark-definition.scss +157 -157
  116. package/styles/drop-down-list/_bootstrap-definition.scss +156 -156
  117. package/styles/drop-down-list/_bootstrap4-definition.scss +202 -191
  118. package/styles/drop-down-list/_bootstrap5-definition.scss +201 -201
  119. package/styles/drop-down-list/_fabric-dark-definition.scss +128 -128
  120. package/styles/drop-down-list/_fabric-definition.scss +124 -124
  121. package/styles/drop-down-list/_fluent-definition.scss +185 -185
  122. package/styles/drop-down-list/_fusionnew-definition.scss +201 -201
  123. package/styles/drop-down-list/_highcontrast-definition.scss +142 -142
  124. package/styles/drop-down-list/_highcontrast-light-definition.scss +144 -144
  125. package/styles/drop-down-list/_layout.scss +310 -310
  126. package/styles/drop-down-list/_material-dark-definition.scss +143 -143
  127. package/styles/drop-down-list/_material-definition.scss +167 -167
  128. package/styles/drop-down-list/_material3-definition.scss +180 -180
  129. package/styles/drop-down-list/_tailwind-definition.scss +134 -134
  130. package/styles/drop-down-list/_theme.scss +10 -10
  131. package/styles/drop-down-list/bootstrap4.css +13 -2
  132. package/styles/drop-down-list/icons/_bootstrap-dark.scss +14 -14
  133. package/styles/drop-down-list/icons/_bootstrap.scss +14 -14
  134. package/styles/drop-down-list/icons/_bootstrap4.scss +14 -14
  135. package/styles/drop-down-list/icons/_bootstrap5.scss +14 -14
  136. package/styles/drop-down-list/icons/_fabric-dark.scss +14 -14
  137. package/styles/drop-down-list/icons/_fabric.scss +14 -14
  138. package/styles/drop-down-list/icons/_fluent.scss +14 -14
  139. package/styles/drop-down-list/icons/_fusionnew.scss +14 -14
  140. package/styles/drop-down-list/icons/_highcontrast-light.scss +14 -14
  141. package/styles/drop-down-list/icons/_highcontrast.scss +14 -14
  142. package/styles/drop-down-list/icons/_material-dark.scss +14 -14
  143. package/styles/drop-down-list/icons/_material.scss +14 -14
  144. package/styles/drop-down-list/icons/_material3.scss +14 -14
  145. package/styles/drop-down-list/icons/_tailwind.scss +14 -14
  146. package/styles/drop-down-list/material3-dark.scss +1 -1
  147. package/styles/drop-down-list/material3.scss +1 -1
  148. package/styles/drop-down-tree/_all.scss +2 -2
  149. package/styles/drop-down-tree/_bootstrap-dark-definition.scss +71 -71
  150. package/styles/drop-down-tree/_bootstrap-definition.scss +70 -70
  151. package/styles/drop-down-tree/_bootstrap4-definition.scss +71 -71
  152. package/styles/drop-down-tree/_bootstrap5-definition.scss +59 -59
  153. package/styles/drop-down-tree/_fabric-dark-definition.scss +71 -71
  154. package/styles/drop-down-tree/_fabric-definition.scss +71 -71
  155. package/styles/drop-down-tree/_fluent-definition.scss +65 -65
  156. package/styles/drop-down-tree/_fusionnew-definition.scss +59 -59
  157. package/styles/drop-down-tree/_highcontrast-definition.scss +71 -71
  158. package/styles/drop-down-tree/_highcontrast-light-definition.scss +71 -71
  159. package/styles/drop-down-tree/_layout.scss +1418 -1412
  160. package/styles/drop-down-tree/_material-dark-definition.scss +72 -72
  161. package/styles/drop-down-tree/_material-definition.scss +72 -72
  162. package/styles/drop-down-tree/_material3-definition.scss +76 -76
  163. package/styles/drop-down-tree/_tailwind-definition.scss +61 -61
  164. package/styles/drop-down-tree/_theme.scss +132 -132
  165. package/styles/drop-down-tree/fluent-dark.css +2 -0
  166. package/styles/drop-down-tree/fluent.css +2 -0
  167. package/styles/drop-down-tree/icons/_bootstrap-dark.scss +11 -11
  168. package/styles/drop-down-tree/icons/_bootstrap.scss +11 -11
  169. package/styles/drop-down-tree/icons/_bootstrap4.scss +11 -11
  170. package/styles/drop-down-tree/icons/_bootstrap5.scss +11 -11
  171. package/styles/drop-down-tree/icons/_fabric-dark.scss +11 -11
  172. package/styles/drop-down-tree/icons/_fabric.scss +11 -11
  173. package/styles/drop-down-tree/icons/_fluent.scss +11 -11
  174. package/styles/drop-down-tree/icons/_fusionnew.scss +11 -11
  175. package/styles/drop-down-tree/icons/_highcontrast-light.scss +11 -11
  176. package/styles/drop-down-tree/icons/_highcontrast.scss +11 -11
  177. package/styles/drop-down-tree/icons/_material-dark.scss +11 -11
  178. package/styles/drop-down-tree/icons/_material.scss +11 -11
  179. package/styles/drop-down-tree/icons/_material3.scss +11 -11
  180. package/styles/drop-down-tree/icons/_tailwind-dark.scss +11 -11
  181. package/styles/drop-down-tree/icons/_tailwind.scss +11 -11
  182. package/styles/drop-down-tree/material3-dark.scss +1 -1
  183. package/styles/drop-down-tree/material3.scss +1 -1
  184. package/styles/fluent-dark.css +2 -0
  185. package/styles/fluent.css +2 -0
  186. package/styles/list-box/_all.scss +2 -2
  187. package/styles/list-box/_bootstrap-dark-definition.scss +126 -126
  188. package/styles/list-box/_bootstrap-definition.scss +119 -119
  189. package/styles/list-box/_bootstrap4-definition.scss +124 -124
  190. package/styles/list-box/_bootstrap5-definition.scss +120 -120
  191. package/styles/list-box/_fabric-dark-definition.scss +126 -126
  192. package/styles/list-box/_fabric-definition.scss +119 -119
  193. package/styles/list-box/_fluent-definition.scss +120 -120
  194. package/styles/list-box/_fusionnew-definition.scss +111 -111
  195. package/styles/list-box/_highcontrast-definition.scss +119 -119
  196. package/styles/list-box/_highcontrast-light-definition.scss +126 -126
  197. package/styles/list-box/_layout.scss +542 -542
  198. package/styles/list-box/_material-dark-definition.scss +126 -126
  199. package/styles/list-box/_material-definition.scss +119 -119
  200. package/styles/list-box/_material3-definition.scss +119 -119
  201. package/styles/list-box/_tailwind-definition.scss +119 -119
  202. package/styles/list-box/_theme.scss +382 -382
  203. package/styles/list-box/icons/_bootstrap-dark.scss +25 -25
  204. package/styles/list-box/icons/_bootstrap.scss +25 -25
  205. package/styles/list-box/icons/_bootstrap4.scss +25 -25
  206. package/styles/list-box/icons/_bootstrap5.scss +25 -25
  207. package/styles/list-box/icons/_fabric-dark.scss +25 -25
  208. package/styles/list-box/icons/_fabric.scss +25 -25
  209. package/styles/list-box/icons/_fluent.scss +25 -25
  210. package/styles/list-box/icons/_fusionnew.scss +25 -25
  211. package/styles/list-box/icons/_highcontrast-light.scss +25 -25
  212. package/styles/list-box/icons/_highcontrast.scss +25 -25
  213. package/styles/list-box/icons/_material-dark.scss +25 -25
  214. package/styles/list-box/icons/_material.scss +25 -25
  215. package/styles/list-box/icons/_material3.scss +25 -25
  216. package/styles/list-box/icons/_tailwind-dark.scss +25 -25
  217. package/styles/list-box/icons/_tailwind.scss +25 -25
  218. package/styles/list-box/material3-dark.scss +1 -1
  219. package/styles/list-box/material3.scss +1 -1
  220. package/styles/material3-dark.scss +1 -1
  221. package/styles/material3.scss +1 -1
  222. package/styles/mention/_all.scss +1 -1
  223. package/styles/mention/_bootstrap-dark-definition.scss +3 -3
  224. package/styles/mention/_bootstrap-definition.scss +3 -3
  225. package/styles/mention/_bootstrap4-definition.scss +3 -3
  226. package/styles/mention/_bootstrap5-definition.scss +1 -1
  227. package/styles/mention/_fabric-dark-definition.scss +2 -2
  228. package/styles/mention/_fabric-definition.scss +3 -3
  229. package/styles/mention/_fluent-definition.scss +1 -1
  230. package/styles/mention/_fusionnew-definition.scss +1 -1
  231. package/styles/mention/_highcontrast-definition.scss +3 -3
  232. package/styles/mention/_highcontrast-light-definition.scss +3 -3
  233. package/styles/mention/_layout.scss +6 -6
  234. package/styles/mention/_material-dark-definition.scss +3 -3
  235. package/styles/mention/_material-definition.scss +3 -3
  236. package/styles/mention/_material3-definition.scss +1 -1
  237. package/styles/mention/_tailwind-definition.scss +1 -1
  238. package/styles/mention/material3-dark.scss +1 -1
  239. package/styles/mention/material3.scss +1 -1
  240. package/styles/multi-select/_all.scss +2 -2
  241. package/styles/multi-select/_bootstrap-dark-definition.scss +198 -198
  242. package/styles/multi-select/_bootstrap-definition.scss +192 -192
  243. package/styles/multi-select/_bootstrap4-definition.scss +278 -259
  244. package/styles/multi-select/_bootstrap5-definition.scss +229 -229
  245. package/styles/multi-select/_fabric-dark-definition.scss +187 -187
  246. package/styles/multi-select/_fabric-definition.scss +183 -183
  247. package/styles/multi-select/_fluent-definition.scss +240 -240
  248. package/styles/multi-select/_fusionnew-definition.scss +227 -227
  249. package/styles/multi-select/_highcontrast-definition.scss +298 -298
  250. package/styles/multi-select/_highcontrast-light-definition.scss +297 -297
  251. package/styles/multi-select/_layout.scss +2199 -2199
  252. package/styles/multi-select/_material-dark-definition.scss +230 -230
  253. package/styles/multi-select/_material-definition.scss +223 -223
  254. package/styles/multi-select/_material3-definition.scss +246 -246
  255. package/styles/multi-select/_tailwind-definition.scss +234 -234
  256. package/styles/multi-select/_theme.scss +586 -586
  257. package/styles/multi-select/bootstrap4.css +19 -0
  258. package/styles/multi-select/icons/_bootstrap-dark.scss +26 -26
  259. package/styles/multi-select/icons/_bootstrap.scss +26 -26
  260. package/styles/multi-select/icons/_bootstrap4.scss +37 -37
  261. package/styles/multi-select/icons/_bootstrap5.scss +26 -26
  262. package/styles/multi-select/icons/_fabric-dark.scss +26 -26
  263. package/styles/multi-select/icons/_fabric.scss +26 -26
  264. package/styles/multi-select/icons/_fluent.scss +55 -55
  265. package/styles/multi-select/icons/_fusionnew.scss +26 -26
  266. package/styles/multi-select/icons/_highcontrast-light.scss +26 -26
  267. package/styles/multi-select/icons/_highcontrast.scss +26 -26
  268. package/styles/multi-select/icons/_material-dark.scss +693 -693
  269. package/styles/multi-select/icons/_material.scss +693 -693
  270. package/styles/multi-select/icons/_material3.scss +692 -692
  271. package/styles/multi-select/icons/_tailwind.scss +26 -26
  272. package/styles/multi-select/material3-dark.scss +1 -1
  273. package/styles/multi-select/material3.scss +1 -1
  274. package/.eslintrc.json +0 -260
  275. package/dist/ej2-dropdowns.min.js +0 -10
  276. package/tslint.json +0 -111
@@ -1,12 +1,3 @@
1
- /*!
2
- * filename: index.d.ts
3
- * version : 23.1.39
4
- * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
- * Use of this code is subject to the terms of our license.
6
- * A copy of the current license can be obtained at any time by e-mailing
7
- * licensing@syncfusion.com. Any infringement will be prosecuted under
8
- * applicable laws.
9
- */
10
1
  import * as _dropdowns from '@syncfusion/ej2-dropdowns';
11
2
 
12
3
  export declare namespace ej {
@@ -0,0 +1,615 @@
1
+ // eslint-disable-next-line @typescript-eslint/triple-slash-reference
2
+ /// <reference path='../combo-box/combo-box-model.d.ts'/>
3
+ import { Property, EventHandler, KeyboardEventArgs, isNullOrUndefined, detach } from '@syncfusion/ej2-base';
4
+ import { Event, EmitType, Complex } from '@syncfusion/ej2-base';
5
+ import { removeClass, attributes, NotifyPropertyChanges } from '@syncfusion/ej2-base';
6
+ import { dropDownListClasses } from '../drop-down-list/drop-down-list';
7
+ import { ComboBox } from '../combo-box/combo-box';
8
+ import { AutoCompleteModel } from '../auto-complete/auto-complete-model';
9
+ import { highlightSearch, revertHighlightSearch } from '../common/highlight-search';
10
+ import { Search } from '../common/incremental-search';
11
+ import { FieldSettingsModel } from '../drop-down-base/drop-down-base-model';
12
+ import { FieldSettings, FilteringEventArgs, FilterType, ResultData } from '../drop-down-base/drop-down-base';
13
+ import { FloatLabelType, Input } from '@syncfusion/ej2-inputs';
14
+ import { DataManager, Predicate, Query } from '@syncfusion/ej2-data';
15
+
16
+ dropDownListClasses.root = 'e-autocomplete';
17
+ dropDownListClasses.icon = 'e-input-group-icon e-ddl-icon e-search-icon';
18
+
19
+ /**
20
+ * The AutoComplete component provides the matched suggestion list when type into the input,
21
+ * from which the user can select one.
22
+ * ```html
23
+ * <input id="list" type="text"/>
24
+ * ```
25
+ * ```typescript
26
+ * let atcObj:AutoComplete = new AutoComplete();
27
+ * atcObj.appendTo("#list");
28
+ * ```
29
+ */
30
+ @NotifyPropertyChanges
31
+ export class AutoComplete extends ComboBox {
32
+ private isFiltered: boolean = false;
33
+ private searchList: boolean = false;
34
+ /**
35
+ * The `fields` property maps the columns of the data table and binds the data to the component.
36
+ * * text - Maps the text column from data table for each list item
37
+ * * value - Maps the value column from data table for each list item
38
+ * * iconCss - Maps the icon class column from data table for each list item
39
+ * * groupBy - Group the list items with it's related items by mapping groupBy field
40
+ *
41
+ * {% codeBlock src='autocomplete/fields/index.md' %}{% endcodeBlock %}
42
+ *
43
+ * > For more details about the field mapping refer to [`Data binding`](../../auto-complete/data-binding) documentation.
44
+ *
45
+ * @default { value: null, iconCss: null, groupBy: null}
46
+ * @deprecated
47
+ */
48
+ @Complex<FieldSettingsModel>({ value: null, iconCss: null, groupBy: null }, FieldSettings)
49
+ public fields: FieldSettingsModel;
50
+ /**
51
+ * When set to ‘false’, consider the [`case-sensitive`](../../auto-complete/filtering/#case-sensitive-filtering)
52
+ * on performing the search to find suggestions.
53
+ * By default consider the casing.
54
+ *
55
+ * @default true
56
+ * @deprecated
57
+ */
58
+ @Property(true)
59
+ public ignoreCase: boolean;
60
+ /**
61
+ * Allows you to either show or hide the popup button on the component.
62
+ *
63
+ * @default false
64
+ */
65
+ @Property(false)
66
+ public showPopupButton: boolean;
67
+ /**
68
+ * When set to ‘true’, highlight the searched characters on suggested list items.
69
+ * > For more details about the highlight refer to [`Custom highlight search`](../../auto-complete/how-to/custom-search) documentation.
70
+ *
71
+ * @default false
72
+ */
73
+ @Property(false)
74
+ public highlight: boolean;
75
+ /**
76
+ * Supports the [`specified number`](../../auto-complete/filtering#filter-item-count)
77
+ * of list items on the suggestion popup.
78
+ *
79
+ * @default 20
80
+ */
81
+ @Property(20)
82
+ public suggestionCount: number;
83
+ /**
84
+ * Allows additional HTML attributes such as title, name, etc., and
85
+ * accepts n number of attributes in a key-value pair format.
86
+ *
87
+ * {% codeBlock src='autocomplete/htmlAttributes/index.md' %}{% endcodeBlock %}
88
+ *
89
+ * @default {}
90
+ * @deprecated
91
+ */
92
+ @Property({})
93
+ public htmlAttributes: { [key: string]: string };
94
+ /**
95
+ * Accepts the external `query`
96
+ * that execute along with data processing.
97
+ *
98
+ * {% codeBlock src='autocomplete/query/index.md' %}{% endcodeBlock %}
99
+ *
100
+ * @default null
101
+ * @deprecated
102
+ */
103
+ @Property(null)
104
+ public query: Query;
105
+ /**
106
+ * Allows you to set [`the minimum search character length']
107
+ * (../../auto-complete/filtering#limit-the-minimum-filter-character),
108
+ * the search action will perform after typed minimum characters.
109
+ *
110
+ * @default 1
111
+ */
112
+ @Property(1)
113
+ public minLength: number;
114
+ /**
115
+ * Determines on which filter type, the component needs to be considered on search action.
116
+ * The available [`FilterType`](../../auto-complete/filtering/#change-the-filter-type)
117
+ * and its supported data types are
118
+ *
119
+ * <table>
120
+ * <tr>
121
+ * <td colSpan=1 rowSpan=1>
122
+ * FilterType<br/></td><td colSpan=1 rowSpan=1>
123
+ * Description<br/></td><td colSpan=1 rowSpan=1>
124
+ * Supported Types<br/></td></tr>
125
+ * <tr>
126
+ * <td colSpan=1 rowSpan=1>
127
+ * StartsWith<br/></td><td colSpan=1 rowSpan=1>
128
+ * Checks whether a value begins with the specified value.<br/></td><td colSpan=1 rowSpan=1>
129
+ * String<br/></td></tr>
130
+ * <tr>
131
+ * <td colSpan=1 rowSpan=1>
132
+ * EndsWith<br/></td><td colSpan=1 rowSpan=1>
133
+ * Checks whether a value ends with specified value.<br/><br/></td><td colSpan=1 rowSpan=1>
134
+ * <br/>String<br/></td></tr>
135
+ * <tr>
136
+ * <td colSpan=1 rowSpan=1>
137
+ * Contains<br/></td><td colSpan=1 rowSpan=1>
138
+ * Checks whether a value contains with specified value.<br/><br/></td><td colSpan=1 rowSpan=1>
139
+ * <br/>String<br/></td></tr>
140
+ * </table>
141
+ *
142
+ * {% codeBlock src="autocomplete/filter-type-api/index.ts" %}{% endcodeBlock %}
143
+ *
144
+ * {% codeBlock src="autocomplete/filter-type-api/index.html" %}{% endcodeBlock %}
145
+ *
146
+ * The default value set to `Contains`, all the suggestion items which contain typed characters to listed in the suggestion popup.
147
+ *
148
+ * @default 'Contains'
149
+ */
150
+ @Property('Contains')
151
+ public filterType: FilterType;
152
+ /**
153
+ * Triggers on typing a character in the component.
154
+ *
155
+ * @event filtering
156
+ */
157
+ @Event()
158
+ public filtering: EmitType<FilteringEventArgs>;
159
+ /**
160
+ * Not applicable to this component.
161
+ *
162
+ * @default null
163
+ * @private
164
+ * @deprecated
165
+ */
166
+ @Property(null)
167
+ public index: number;
168
+ /**
169
+ * Specifies whether to display the floating label above the input element.
170
+ * Possible values are:
171
+ * * Never: The label will never float in the input when the placeholder is available.
172
+ * * Always: The floating label will always float above the input.
173
+ * * Auto: The floating label will float above the input after focusing or entering a value in the input.
174
+ *
175
+ * {% codeBlock src="autocomplete/float-label-type-api/index.ts" %}{% endcodeBlock %}
176
+ *
177
+ * {% codeBlock src="autocomplete/float-label-type-api/index.html" %}{% endcodeBlock %}
178
+ *
179
+ * @default Syncfusion.EJ2.Inputs.FloatLabelType.Never
180
+ * @aspType Syncfusion.EJ2.Inputs.FloatLabelType
181
+ * @isEnumeration true
182
+ * @deprecated
183
+ */
184
+ @Property('Never')
185
+ public floatLabelType: FloatLabelType;
186
+ /**
187
+ * Not applicable to this component.
188
+ *
189
+ * @default null
190
+ * @aspType string
191
+ * @private
192
+ * @deprecated
193
+ */
194
+ @Property(null)
195
+ public valueTemplate: string | Function;
196
+ /**
197
+ * Not applicable to this component.
198
+ *
199
+ * @default null
200
+ * @private
201
+ * @deprecated
202
+ */
203
+ @Property(null)
204
+ public filterBarPlaceholder: string;
205
+ /**
206
+ * Not applicable to this component.
207
+ *
208
+ * @default false
209
+ * @private
210
+ * @deprecated
211
+ */
212
+ @Property(false)
213
+ public allowFiltering: boolean;
214
+ /**
215
+ * Not applicable to this component.
216
+ *
217
+ * @default null
218
+ * @private
219
+ * @deprecated
220
+ */
221
+ @Property(null)
222
+ public text: string;
223
+ /**
224
+ * * Constructor for creating the widget
225
+ *
226
+ * @param {AutoCompleteModel} options - Specifies the AutoComplete model.
227
+ * @param {string | HTMLElement} element - Specifies the element to render as component.
228
+ * @private
229
+ */
230
+ public constructor(options?: AutoCompleteModel, element?: string | HTMLElement) {
231
+ super(options, element);
232
+ }
233
+ /**
234
+ * Initialize the event handler
235
+ *
236
+ * @private
237
+ * @returns {void}
238
+ */
239
+ protected preRender(): void {
240
+ super.preRender();
241
+ }
242
+
243
+ protected getLocaleName(): string {
244
+ return 'auto-complete';
245
+ }
246
+
247
+ protected getNgDirective(): string {
248
+ return 'EJS-AUTOCOMPLETE';
249
+ }
250
+
251
+ protected getQuery(query: Query): Query {
252
+ const filterQuery: Query = query ? query.clone() : this.query ? this.query.clone() : new Query();
253
+ const filterType: string = (this.queryString === '' && !isNullOrUndefined(this.value)) ? 'equal' : this.filterType;
254
+ const queryString: string = (this.queryString === '' && !isNullOrUndefined(this.value)) ? this.value as string : this.queryString;
255
+ if (this.isFiltered) {
256
+ return filterQuery;
257
+ }
258
+ if (this.queryString !== null && this.queryString !== '') {
259
+ const dataType: string = <string>this.typeOfData(this.dataSource as { [key: string]: Object }[]).typeof;
260
+ if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
261
+ filterQuery.where('', filterType, queryString, this.ignoreCase, this.ignoreAccent);
262
+ } else {
263
+ const mapping: string = !isNullOrUndefined(this.fields.value) ? this.fields.value : '';
264
+ filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
265
+ }
266
+ }
267
+ if (!isNullOrUndefined(this.suggestionCount) && !this.enableVirtualization) {
268
+ // Since defualt value of suggestioncount is 20, checked the condition
269
+ if (this.suggestionCount !== 20) {
270
+ for (let queryElements: number = 0; queryElements < filterQuery.queries.length; queryElements++) {
271
+ if (filterQuery.queries[queryElements as number].fn === 'onTake') {
272
+ filterQuery.queries.splice(queryElements, 1);
273
+ }
274
+ }
275
+ }
276
+ filterQuery.take(this.suggestionCount);
277
+ }
278
+ if (this.enableVirtualization)
279
+ {
280
+ var takeValue = this.getTakeValue();
281
+ filterQuery.skip(this.virtualItemStartIndex);
282
+ filterQuery.take(takeValue);
283
+ filterQuery.requiresCount();
284
+ }
285
+ return filterQuery;
286
+ }
287
+ protected searchLists(e: KeyboardEventArgs | MouseEvent): void {
288
+ this.isTyped = true;
289
+ this.isDataFetched = this.isSelectCustom = false;
290
+ this.checkAndResetCache();
291
+ if (isNullOrUndefined(this.list)) {
292
+ super.renderList(e, true);
293
+ }
294
+ this.queryString = this.filterInput.value;
295
+ if (e.type !== 'mousedown' && ((<KeyboardEventArgs>e).keyCode === 40 || (<KeyboardEventArgs>e).keyCode === 38)) {
296
+ this.queryString = this.queryString === '' ? null : this.queryString;
297
+ this.beforePopupOpen = true;
298
+ this.resetList(this.dataSource, this.fields, null, e);
299
+ return;
300
+ }
301
+ this.isSelected = false;
302
+ this.activeIndex = null;
303
+ const eventArgs: { [key: string]: Object } = {
304
+ preventDefaultAction: false,
305
+ text: this.filterInput.value,
306
+ updateData: (
307
+ dataSource: { [key: string]: Object }[] | DataManager | string[] | number[], query?: Query,
308
+ fields?: FieldSettingsModel) => {
309
+ if (eventArgs.cancel) {
310
+ return;
311
+ }
312
+ this.isFiltered = true;
313
+ this.filterAction(dataSource, query, fields);
314
+ },
315
+ cancel: false
316
+ };
317
+ this.trigger('filtering', eventArgs, (eventArgs: FilteringEventArgs) => {
318
+ if (!eventArgs.cancel && !this.isFiltered && !eventArgs.preventDefaultAction) {
319
+ this.searchList = true;
320
+ this.filterAction(this.dataSource, null, this.fields, e);
321
+ }
322
+ });
323
+ }
324
+
325
+ /**
326
+ * To filter the data from given data source by using query
327
+ *
328
+ * @param {Object[] | DataManager } dataSource - Set the data source to filter.
329
+ * @param {Query} query - Specify the query to filter the data.
330
+ * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
331
+ * @returns {void}
332
+ * @deprecated
333
+ */
334
+ public filter(
335
+ dataSource: { [key: string]: Object }[] | DataManager | string[] | number[] | boolean[],
336
+ query?: Query, fields?: FieldSettingsModel): void {
337
+ this.isFiltered = true;
338
+ this.filterAction(dataSource, query, fields);
339
+ }
340
+
341
+ private filterAction(
342
+ dataSource: { [key: string]: Object }[] | DataManager | string[] | number[] | boolean[],
343
+ query?: Query, fields?: FieldSettingsModel, e?: MouseEvent | KeyboardEventArgs | TouchEvent): void {
344
+ this.beforePopupOpen = true;
345
+ let isNoDataElement = this.list.classList.contains('e-nodata');
346
+ if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
347
+ if(this.enableVirtualization && this.isFiltering() && this.isTyped) {
348
+ this.isPreventScrollAction = true;
349
+ this.list.scrollTop = 0;
350
+ this.previousStartIndex = 0;
351
+ this.virtualListInfo = null;
352
+ }
353
+ this.resetList(dataSource, fields, query, e);
354
+ if(this.enableVirtualization && isNoDataElement && !this.list.classList.contains('e-nodata')) {
355
+ if (!this.list.querySelector('.e-virtual-ddl-content')) {
356
+ this.list.appendChild(this.createElement('div', {
357
+ className: 'e-virtual-ddl-content',
358
+ styles: this.getTransformValues()
359
+ })).appendChild(this.list.querySelector('.e-list-parent'));
360
+ }
361
+ if(!this.list.querySelector('.e-virtual-ddl')){
362
+ var virualElement = this.createElement('div', {
363
+ id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()});
364
+ document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
365
+ }
366
+ }
367
+ if (this.enableVirtualization) {
368
+ this.getFilteringSkeletonCount();
369
+ }
370
+ } else {
371
+ this.hidePopup(e);
372
+ this.beforePopupOpen = false;
373
+ }
374
+ this.renderReactTemplates();
375
+ }
376
+
377
+ protected clearAll(e?: MouseEvent, property?: AutoCompleteModel): void {
378
+ if (isNullOrUndefined(property) || (!isNullOrUndefined(property) && isNullOrUndefined(property.dataSource))) {
379
+ super.clearAll(e);
380
+ this.checkAndResetCache();
381
+ }
382
+ if (this.beforePopupOpen) {
383
+ this.hidePopup();
384
+ }
385
+ }
386
+
387
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
388
+ protected onActionComplete(ulElement: HTMLElement, list: { [key: string]: Object }[], e?: Object, isUpdated?: boolean): void {
389
+ this.fixedHeaderElement = null;
390
+ super.onActionComplete(ulElement, list, e);
391
+ const item: Element = this.list.querySelector('.' + dropDownListClasses.li);
392
+ if (!isNullOrUndefined(item)) {
393
+ removeClass([item], dropDownListClasses.focus);
394
+ }
395
+ this.postBackAction();
396
+ }
397
+
398
+ private postBackAction(): void {
399
+ if (this.autofill && !isNullOrUndefined(this.liCollections[0]) && this.searchList) {
400
+ const items: HTMLElement[] = [this.liCollections[0]];
401
+ const dataSource: { [key: string]: Object }[] = this.listData as { [key: string]: Object }[];
402
+ const type: string = this.typeOfData(dataSource).typeof as string;
403
+ const searchItem: { [key: string]: number | Element } = Search(this.inputElement.value, items, 'StartsWith', this.ignoreCase, dataSource, this.fields, type);
404
+ this.searchList = false;
405
+ if (!isNullOrUndefined(searchItem.item)) {
406
+ super.setAutoFill(this.liCollections[0], true);
407
+ }
408
+ }
409
+ }
410
+
411
+ protected setSelection(li: Element, e: MouseEvent | KeyboardEventArgs | TouchEvent): void {
412
+ if (!this.isValidLI(li)) {
413
+ this.selectedLI = <HTMLElement>li;
414
+ return;
415
+ }
416
+ if (!isNullOrUndefined(e) && e.type === 'keydown' && (e as KeyboardEventArgs).action !== 'enter'
417
+ && (e as KeyboardEventArgs).action !== 'tab' && this.isValidLI(li)) {
418
+ const value: string | number | boolean = this.getFormattedValue(li.getAttribute('data-value'));
419
+ this.activeIndex = this.getIndexByValue(value);
420
+ this.setHoverList(li);
421
+ this.selectedLI = <HTMLElement>li;
422
+ this.setScrollPosition(e as KeyboardEventArgs);
423
+ if (this.autofill && this.isPopupOpen) {
424
+ this.preventAutoFill = false;
425
+ const isKeyNavigate: boolean = (e && (e as KeyboardEventArgs).action === 'down' || (e as KeyboardEventArgs).action === 'up' ||
426
+ (e as KeyboardEventArgs).action === 'home' || (e as KeyboardEventArgs).action === 'end' || (e as KeyboardEventArgs).action === 'pageUp' || (e as KeyboardEventArgs).action === 'pageDown');
427
+ super.setAutoFill(li, isKeyNavigate);
428
+ }
429
+ } else {
430
+ super.setSelection(li, e);
431
+ }
432
+ }
433
+
434
+ protected listOption(dataSource: { [key: string]: Object }[], fieldsSettings: FieldSettingsModel): FieldSettingsModel {
435
+ const fields: { [key: string]: Object } = <{ [key: string]: Object }>super.listOption(dataSource, fieldsSettings);
436
+ if (isNullOrUndefined(fields.itemCreated)) {
437
+ fields.itemCreated = (e: { [key: string]: HTMLElement }) => {
438
+ if (this.highlight) {
439
+ if (this.element.tagName === this.getNgDirective() && this.itemTemplate) {
440
+ setTimeout((): void => {
441
+ highlightSearch(e.item, this.queryString, this.ignoreCase, this.filterType);
442
+ }, 0);
443
+ } else {
444
+ highlightSearch(e.item, this.queryString, this.ignoreCase, this.filterType);
445
+ }
446
+ }
447
+ };
448
+ } else {
449
+ const itemCreated: Function = <Function>fields.itemCreated;
450
+ fields.itemCreated = (e: { [key: string]: HTMLElement }) => {
451
+ if (this.highlight) {
452
+ highlightSearch(e.item, this.queryString, this.ignoreCase, this.filterType);
453
+ }
454
+ itemCreated.apply(this, [e]);
455
+ };
456
+ }
457
+ return fields;
458
+ }
459
+
460
+ protected isFiltering(): boolean {
461
+ return true;
462
+ }
463
+
464
+ protected renderPopup(e?: MouseEvent | KeyboardEventArgs | TouchEvent): void {
465
+ if(!this.enableVirtualization){
466
+ this.list.scrollTop = 0;
467
+ }
468
+ super.renderPopup(e);
469
+ }
470
+
471
+ protected isEditTextBox(): boolean {
472
+ return true && this.inputElement.value.trim() !== '';
473
+ }
474
+
475
+ protected isPopupButton(): boolean {
476
+ return this.showPopupButton;
477
+ }
478
+
479
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
480
+ protected isSelectFocusItem(element: Element): boolean {
481
+ return false;
482
+ }
483
+
484
+ protected setInputValue(newProp?: any, oldProp?: any): void {
485
+ let oldValue = oldProp && oldProp.text ? oldProp.text : oldProp ? oldProp.value : oldProp;
486
+ let value = newProp && newProp.text ? newProp.text : newProp && newProp.value ? newProp.value : this.value;
487
+ if (value && this.typedString === '' && !this.allowCustom && !(this.dataSource instanceof DataManager)) {
488
+ let checkFields_1: string = this.typeOfData(this.dataSource).typeof === 'string' ? '' : this.fields.value;
489
+ const listLength: number = this.getItems().length;
490
+ let query: Query = new Query();
491
+ let _this = this;
492
+ new DataManager(this.dataSource).executeQuery(query.where(new Predicate(checkFields_1, 'equal', value)))
493
+ .then(function (e: Object) {
494
+ if ((e as ResultData).result.length > 0) {
495
+ _this.value = checkFields_1 !== '' ? (e as ResultData).result[0][_this.fields.value].toString() : (e as ResultData).result[0].toString();
496
+ _this.addItem((e as ResultData).result, listLength);
497
+ _this.updateValues();
498
+ }
499
+ else {
500
+ newProp && newProp.text ? _this.setOldText(oldValue) : newProp && newProp.value ? _this.setOldValue(oldValue) : _this.updateValues();
501
+ }
502
+ });
503
+ }
504
+ else if (newProp) {
505
+ newProp.text ? this.setOldText(oldValue) : this.setOldValue(oldValue);
506
+ }
507
+ }
508
+
509
+ /**
510
+ * Search the entered text and show it in the suggestion list if available.
511
+ *
512
+ * @returns {void}
513
+ * @deprecated
514
+ */
515
+ public showPopup(e?: MouseEvent | KeyboardEventArgs | TouchEvent): void {
516
+ if (!this.enabled) {
517
+ return;
518
+ }
519
+ if (this.beforePopupOpen) {
520
+ this.refreshPopup();
521
+ return;
522
+ }
523
+ this.beforePopupOpen = true;
524
+ this.preventAutoFill = true;
525
+ if (isNullOrUndefined(this.list)) {
526
+ this.renderList(e);
527
+ } else {
528
+ this.resetList(this.dataSource, this.fields, null, e);
529
+ }
530
+ }
531
+ /**
532
+ * Hides the popup if it is in open state.
533
+ *
534
+ * @returns {void}
535
+ */
536
+ public hidePopup(e?: MouseEvent | KeyboardEventArgs | TouchEvent): void {
537
+ super.hidePopup(e);
538
+ this.activeIndex = null;
539
+ this.virtualListInfo = this.viewPortInfo;
540
+ this.previousStartIndex = this.viewPortInfo.startIndex;
541
+ this.startIndex = this.viewPortInfo.startIndex;
542
+ this.previousEndIndex = this.viewPortInfo.endIndex;
543
+ }
544
+ /**
545
+ * Dynamically change the value of properties.
546
+ *
547
+ * @param {AutoCompleteModel} newProp - Returns the dynamic property value of the component.
548
+ * @param {AutoCompleteModel} oldProp - Returns the previous property value of the component.
549
+ * @private
550
+ * @returns {void}
551
+ */
552
+ public onPropertyChanged(newProp: AutoCompleteModel, oldProp: AutoCompleteModel): void {
553
+ if (this.getModuleName() === 'autocomplete') {
554
+ this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp as { [key: string]: string });
555
+ }
556
+ for (const prop of Object.keys(newProp)) {
557
+ switch (prop) {
558
+ case 'showPopupButton':
559
+ if (this.showPopupButton) {
560
+ const button: HTMLElement = Input.appendSpan(
561
+ dropDownListClasses.icon,
562
+ this.inputWrapper.container,
563
+ this.createElement);
564
+ this.inputWrapper.buttons[0] = button;
565
+ Input.calculateWidth(this.inputElement, this.inputWrapper.container);
566
+ if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && !isNullOrUndefined(this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0]) && this.floatLabelType !== 'Never') {
567
+ this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0].classList.add('e-icon');
568
+ }
569
+ if (this.inputWrapper && this.inputWrapper.buttons && this.inputWrapper.buttons[0]) {
570
+ EventHandler.add(this.inputWrapper.buttons[0], 'click', this.dropDownClick, this);
571
+ }
572
+ } else {
573
+ detach(this.inputWrapper.buttons[0]);
574
+ this.inputWrapper.buttons[0] = null;
575
+ }
576
+ break;
577
+ default: {
578
+ // eslint-disable-next-line max-len
579
+ const atcProps: { [key: string]: Object } = this.getPropObject(prop, <{ [key: string]: string }>newProp, <{ [key: string]: string }>oldProp);
580
+ super.onPropertyChanged(atcProps.newProperty, atcProps.oldProperty);
581
+ break;
582
+ }
583
+ }
584
+ }
585
+ }
586
+ protected renderHightSearch(): void {
587
+ if (this.highlight) {
588
+ for (let i: number = 0; i < this.liCollections.length; i++) {
589
+ const isHighlight: HTMLElement = this.ulElement.querySelector('.e-active');
590
+ if (!isHighlight) {
591
+ revertHighlightSearch(this.liCollections[i as number]);
592
+ highlightSearch(this.liCollections[i as number], this.queryString, this.ignoreCase, this.filterType);
593
+ }
594
+ }
595
+ }
596
+ }
597
+ /**
598
+ * Return the module name of this component.
599
+ *
600
+ * @private
601
+ * @returns {string} Return the module name of this component.
602
+ */
603
+ public getModuleName(): string {
604
+ return 'autocomplete';
605
+ }
606
+ /**
607
+ * To initialize the control rendering
608
+ *
609
+ * @private
610
+ * @returns {void}
611
+ */
612
+ public render(): void {
613
+ super.render();
614
+ }
615
+ }