autocomplete.d.ts 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. /*!
  2. * devextreme-angular
  3. * Version: 19.1.16
  4. * Build date: Tue Oct 18 2022
  5. *
  6. * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
  7. *
  8. * This software may be modified and distributed under the terms
  9. * of the MIT license. See the LICENSE file in the root of the project for details.
  10. *
  11. * https://github.com/DevExpress/devextreme-angular
  12. */
  13. import { TransferState } from '@angular/platform-browser';
  14. import { ElementRef, NgZone, OnDestroy, EventEmitter, OnChanges, DoCheck, SimpleChanges, QueryList } from '@angular/core';
  15. import DevExpress from 'devextreme/bundles/dx.all';
  16. import DxAutocomplete from 'devextreme/ui/autocomplete';
  17. import { ControlValueAccessor } from '@angular/forms';
  18. import { DxComponent } from '../core/component';
  19. import { DxTemplateHost } from '../core/template-host';
  20. import { NestedOptionHost } from '../core/nested-option';
  21. import { WatcherHelper } from '../core/watcher-helper';
  22. import { IterableDifferHelper } from '../core/iterable-differ-helper';
  23. import { DxiButtonComponent } from './nested/button-dxi';
  24. import { DxiItemComponent } from './nested/item-dxi';
  25. /**
  26. * The Autocomplete widget is a textbox that provides suggestions while a user types into it.
  27. */
  28. export declare class DxAutocompleteComponent extends DxComponent implements OnDestroy, ControlValueAccessor, OnChanges, DoCheck {
  29. private _watcherHelper;
  30. private _idh;
  31. instance: DxAutocomplete;
  32. /**
  33. * Specifies the shortcut key that sets focus on the widget.
  34. */
  35. accessKey: string;
  36. /**
  37. * Specifies whether or not the widget changes its state when interacting with a user.
  38. */
  39. activeStateEnabled: boolean;
  40. /**
  41. * Allows you to add custom buttons to the input text field.
  42. */
  43. buttons: Array<string | DevExpress.ui.dxTextEditorButton>;
  44. /**
  45. * Binds the widget to data.
  46. */
  47. dataSource: DevExpress.data.DataSource | DevExpress.data.DataSourceOptions | string | Array<DevExpress.ui.CollectionWidgetItem | any>;
  48. /**
  49. * Specifies whether to render the drop-down field's content when it is displayed. If false, the content is rendered immediately.
  50. */
  51. deferRendering: boolean;
  52. /**
  53. * Specifies whether the widget responds to user interaction.
  54. */
  55. disabled: boolean;
  56. /**
  57. * Returns the value currently displayed by the widget.
  58. */
  59. displayValue: string;
  60. /**
  61. * Specifies a custom template for the drop-down button.
  62. */
  63. dropDownButtonTemplate: any;
  64. /**
  65. * Specifies the attributes to be attached to the widget's root element.
  66. */
  67. elementAttr: any;
  68. /**
  69. * Specifies whether the widget can be focused using keyboard navigation.
  70. */
  71. focusStateEnabled: boolean;
  72. /**
  73. * Specifies whether data items should be grouped.
  74. */
  75. grouped: boolean;
  76. /**
  77. * Specifies a custom template for group captions.
  78. */
  79. groupTemplate: any;
  80. /**
  81. * Specifies the widget's height.
  82. */
  83. height: number | Function | string;
  84. /**
  85. * Specifies text for a hint that appears when a user pauses on the widget.
  86. */
  87. hint: string;
  88. /**
  89. * Specifies whether the widget changes its state when a user pauses on it.
  90. */
  91. hoverStateEnabled: boolean;
  92. /**
  93. * Specifies the attributes to be passed on to the underlying HTML element.
  94. */
  95. inputAttr: any;
  96. /**
  97. * Specifies whether the editor's value is valid.
  98. */
  99. isValid: boolean;
  100. /**
  101. * An array of items displayed by the widget.
  102. */
  103. items: Array<any | {
  104. disabled?: boolean;
  105. html?: string;
  106. template?: any;
  107. text?: string;
  108. visible?: boolean;
  109. }>;
  110. /**
  111. * Specifies a custom template for items.
  112. */
  113. itemTemplate: any;
  114. /**
  115. * Specifies the maximum count of items displayed by the widget.
  116. */
  117. maxItemCount: number;
  118. /**
  119. * Specifies the maximum number of characters you can enter into the textbox.
  120. */
  121. maxLength: number | string;
  122. /**
  123. * The minimum number of characters that must be entered into the text box to begin a search.
  124. */
  125. minSearchLength: number;
  126. /**
  127. * The value to be assigned to the `name` attribute of the underlying HTML element.
  128. */
  129. name: string;
  130. /**
  131. * Specifies whether or not the drop-down editor is displayed.
  132. */
  133. opened: boolean;
  134. /**
  135. * Specifies whether a user can open the drop-down list by clicking a text field.
  136. */
  137. openOnFieldClick: boolean;
  138. /**
  139. * The text displayed by the widget when the widget value is empty.
  140. */
  141. placeholder: string;
  142. /**
  143. * Specifies whether the editor is read-only.
  144. */
  145. readOnly: boolean;
  146. /**
  147. * Switches the widget to a right-to-left representation.
  148. */
  149. rtlEnabled: boolean;
  150. /**
  151. * Specifies the name of a data source item field or an expression whose value is compared to the search criterion.
  152. */
  153. searchExpr: Function | Array<Function>;
  154. /**
  155. * Specifies a comparison operation used to search widget items.
  156. */
  157. searchMode: string;
  158. /**
  159. * Specifies the time delay, in milliseconds, after the last character has been typed in, before a search is executed.
  160. */
  161. searchTimeout: number;
  162. /**
  163. * Gets the currently selected item.
  164. */
  165. selectedItem: any;
  166. /**
  167. * Specifies whether to display the Clear button in the widget.
  168. */
  169. showClearButton: boolean;
  170. /**
  171. * Specifies whether the drop-down button is visible.
  172. */
  173. showDropDownButton: boolean;
  174. /**
  175. * Specifies whether or not the widget checks the inner text for spelling mistakes.
  176. */
  177. spellcheck: boolean;
  178. /**
  179. * Specifies how the widget's text field is styled.
  180. */
  181. stylingMode: string;
  182. /**
  183. * Specifies the number of the element when the Tab key is used for navigating.
  184. */
  185. tabIndex: number;
  186. /**
  187. * The read-only option that holds the text displayed by the widget input element.
  188. */
  189. text: string;
  190. /**
  191. * Specifies information on the validation error when using a custom validation engine. Should be changed at runtime along with the isValid option.
  192. */
  193. validationError: any;
  194. /**
  195. * Specifies how the message about the validation rules that are not satisfied by this editor's value is displayed.
  196. */
  197. validationMessageMode: string;
  198. /**
  199. * Specifies the current value displayed by the widget.
  200. */
  201. value: string;
  202. /**
  203. * Specifies the DOM events after which the widget's value should be updated.
  204. */
  205. valueChangeEvent: string;
  206. /**
  207. * Specifies which data field provides unique values to the widget's value.
  208. */
  209. valueExpr: Function | string;
  210. /**
  211. * Specifies whether the widget is visible.
  212. */
  213. visible: boolean;
  214. /**
  215. * Specifies the widget's width.
  216. */
  217. width: number | Function | string;
  218. /**
  219. * A function that is executed when the widget loses focus after the text field's content was changed using the keyboard.
  220. */
  221. onChange: EventEmitter<any>;
  222. /**
  223. * A function that is executed once the drop-down editor is closed.
  224. */
  225. onClosed: EventEmitter<any>;
  226. /**
  227. * A function that is executed when the widget's content is ready and each time the content is changed.
  228. */
  229. onContentReady: EventEmitter<any>;
  230. /**
  231. * A function that is executed when the widget's input has been copied.
  232. */
  233. onCopy: EventEmitter<any>;
  234. /**
  235. * A function that is executed when the widget's input has been cut.
  236. */
  237. onCut: EventEmitter<any>;
  238. /**
  239. * A function that is executed before the widget is disposed of.
  240. */
  241. onDisposing: EventEmitter<any>;
  242. /**
  243. * A function that is executed when the Enter key has been pressed while the widget is focused.
  244. */
  245. onEnterKey: EventEmitter<any>;
  246. /**
  247. * A function that is executed when the widget gets focus.
  248. */
  249. onFocusIn: EventEmitter<any>;
  250. /**
  251. * A function that is executed when the widget loses focus.
  252. */
  253. onFocusOut: EventEmitter<any>;
  254. /**
  255. * A function used in JavaScript frameworks to save the widget instance.
  256. */
  257. onInitialized: EventEmitter<any>;
  258. /**
  259. * A function that is executed each time the widget's input is changed while the widget is focused.
  260. */
  261. onInput: EventEmitter<any>;
  262. /**
  263. * A function that is executed when a list item is clicked or tapped.
  264. */
  265. onItemClick: EventEmitter<any>;
  266. /**
  267. * A function that is executed when a user is pressing a key on the keyboard.
  268. */
  269. onKeyDown: EventEmitter<any>;
  270. /**
  271. * A function that is executed when a user presses a key on the keyboard.
  272. */
  273. onKeyPress: EventEmitter<any>;
  274. /**
  275. * A function that is executed when a user releases a key on the keyboard.
  276. */
  277. onKeyUp: EventEmitter<any>;
  278. /**
  279. * A function that is executed once the drop-down editor is opened.
  280. */
  281. onOpened: EventEmitter<any>;
  282. /**
  283. * A function that is executed after a widget option is changed.
  284. */
  285. onOptionChanged: EventEmitter<any>;
  286. /**
  287. * A function that is executed when the widget's input has been pasted.
  288. */
  289. onPaste: EventEmitter<any>;
  290. /**
  291. * A function that is executed when a list item is selected or selection is canceled.
  292. */
  293. onSelectionChanged: EventEmitter<any>;
  294. /**
  295. * A function that is executed after the widget's value is changed.
  296. */
  297. onValueChanged: EventEmitter<any>;
  298. /**
  299. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  300. */
  301. accessKeyChange: EventEmitter<string>;
  302. /**
  303. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  304. */
  305. activeStateEnabledChange: EventEmitter<boolean>;
  306. /**
  307. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  308. */
  309. buttonsChange: EventEmitter<Array<string | DevExpress.ui.dxTextEditorButton>>;
  310. /**
  311. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  312. */
  313. dataSourceChange: EventEmitter<DevExpress.data.DataSource | DevExpress.data.DataSourceOptions | string | Array<DevExpress.ui.CollectionWidgetItem | any>>;
  314. /**
  315. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  316. */
  317. deferRenderingChange: EventEmitter<boolean>;
  318. /**
  319. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  320. */
  321. disabledChange: EventEmitter<boolean>;
  322. /**
  323. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  324. */
  325. displayValueChange: EventEmitter<string>;
  326. /**
  327. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  328. */
  329. dropDownButtonTemplateChange: EventEmitter<any>;
  330. /**
  331. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  332. */
  333. elementAttrChange: EventEmitter<any>;
  334. /**
  335. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  336. */
  337. focusStateEnabledChange: EventEmitter<boolean>;
  338. /**
  339. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  340. */
  341. groupedChange: EventEmitter<boolean>;
  342. /**
  343. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  344. */
  345. groupTemplateChange: EventEmitter<any>;
  346. /**
  347. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  348. */
  349. heightChange: EventEmitter<number | Function | string>;
  350. /**
  351. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  352. */
  353. hintChange: EventEmitter<string>;
  354. /**
  355. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  356. */
  357. hoverStateEnabledChange: EventEmitter<boolean>;
  358. /**
  359. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  360. */
  361. inputAttrChange: EventEmitter<any>;
  362. /**
  363. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  364. */
  365. isValidChange: EventEmitter<boolean>;
  366. /**
  367. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  368. */
  369. itemsChange: EventEmitter<Array<any | {
  370. disabled?: boolean;
  371. html?: string;
  372. template?: any;
  373. text?: string;
  374. visible?: boolean;
  375. }>>;
  376. /**
  377. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  378. */
  379. itemTemplateChange: EventEmitter<any>;
  380. /**
  381. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  382. */
  383. maxItemCountChange: EventEmitter<number>;
  384. /**
  385. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  386. */
  387. maxLengthChange: EventEmitter<number | string>;
  388. /**
  389. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  390. */
  391. minSearchLengthChange: EventEmitter<number>;
  392. /**
  393. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  394. */
  395. nameChange: EventEmitter<string>;
  396. /**
  397. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  398. */
  399. openedChange: EventEmitter<boolean>;
  400. /**
  401. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  402. */
  403. openOnFieldClickChange: EventEmitter<boolean>;
  404. /**
  405. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  406. */
  407. placeholderChange: EventEmitter<string>;
  408. /**
  409. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  410. */
  411. readOnlyChange: EventEmitter<boolean>;
  412. /**
  413. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  414. */
  415. rtlEnabledChange: EventEmitter<boolean>;
  416. /**
  417. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  418. */
  419. searchExprChange: EventEmitter<Function | Array<Function>>;
  420. /**
  421. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  422. */
  423. searchModeChange: EventEmitter<string>;
  424. /**
  425. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  426. */
  427. searchTimeoutChange: EventEmitter<number>;
  428. /**
  429. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  430. */
  431. selectedItemChange: EventEmitter<any>;
  432. /**
  433. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  434. */
  435. showClearButtonChange: EventEmitter<boolean>;
  436. /**
  437. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  438. */
  439. showDropDownButtonChange: EventEmitter<boolean>;
  440. /**
  441. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  442. */
  443. spellcheckChange: EventEmitter<boolean>;
  444. /**
  445. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  446. */
  447. stylingModeChange: EventEmitter<string>;
  448. /**
  449. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  450. */
  451. tabIndexChange: EventEmitter<number>;
  452. /**
  453. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  454. */
  455. textChange: EventEmitter<string>;
  456. /**
  457. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  458. */
  459. validationErrorChange: EventEmitter<any>;
  460. /**
  461. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  462. */
  463. validationMessageModeChange: EventEmitter<string>;
  464. /**
  465. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  466. */
  467. valueChange: EventEmitter<string>;
  468. /**
  469. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  470. */
  471. valueChangeEventChange: EventEmitter<string>;
  472. /**
  473. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  474. */
  475. valueExprChange: EventEmitter<Function | string>;
  476. /**
  477. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  478. */
  479. visibleChange: EventEmitter<boolean>;
  480. /**
  481. * This member supports the internal infrastructure and is not intended to be used directly from your code.
  482. */
  483. widthChange: EventEmitter<number | Function | string>;
  484. onBlur: EventEmitter<any>;
  485. change(_: any): void;
  486. touched: (_: any) => void;
  487. buttonsChildren: QueryList<DxiButtonComponent>;
  488. itemsChildren: QueryList<DxiItemComponent>;
  489. constructor(elementRef: ElementRef, ngZone: NgZone, templateHost: DxTemplateHost, _watcherHelper: WatcherHelper, _idh: IterableDifferHelper, optionHost: NestedOptionHost, transferState: TransferState, platformId: any);
  490. protected _createInstance(element: any, options: any): DxAutocomplete;
  491. writeValue(value: any): void;
  492. setDisabledState(isDisabled: boolean): void;
  493. registerOnChange(fn: (_: any) => void): void;
  494. registerOnTouched(fn: () => void): void;
  495. _createWidget(element: any): void;
  496. ngOnDestroy(): void;
  497. ngOnChanges(changes: SimpleChanges): void;
  498. setupChanges(prop: string, changes: SimpleChanges): void;
  499. ngDoCheck(): void;
  500. _setOption(name: string, value: any): void;
  501. }
  502. export declare class DxAutocompleteModule {
  503. }