select-box.d.ts 20 KB

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