/*! * devextreme-angular-test * Version: 17.2.8 * Build date: Mon Feb 05 2018 * * Copyright (c) 2012 - 2018 Developer Express Inc. ALL RIGHTS RESERVED * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file in the root of the project for details. * * https://github.com/DevExpress/devextreme-angular */ import { Component, NgModule, ElementRef, NgZone, Input, Output, OnDestroy, Injector, EventEmitter, OnInit, AfterViewInit, ContentChild, forwardRef, HostListener, OnChanges, DoCheck, SimpleChanges, ContentChildren, QueryList } from '@angular/core'; import DevExpress from 'devextreme/bundles/dx.all'; import DxLookup from 'devextreme/ui/lookup'; import { DxValidatorComponent } from './validator'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { DxComponent } from '../core/component'; import { DxTemplateHost } from '../core/template-host'; import { DxTemplateModule } from '../core/template'; import { EventsRegistrator } from '../core/events-strategy'; import { NestedOptionHost } from '../core/nested-option'; import { WatcherHelper } from '../core/watcher-helper'; import { IterableDifferHelper } from '../core/iterable-differ-helper'; import { DxoAnimationModule } from './nested/animation'; import { DxoHideModule } from './nested/hide'; import { DxoShowModule } from './nested/show'; import { DxiItemModule } from './nested/item-dxi'; import { DxoPositionModule } from './nested/position'; import { DxoAtModule } from './nested/at'; import { DxoBoundaryOffsetModule } from './nested/boundary-offset'; import { DxoCollisionModule } from './nested/collision'; import { DxoMyModule } from './nested/my'; import { DxoOffsetModule } from './nested/offset'; import { DxiItemComponent } from './nested/item-dxi'; const CUSTOM_VALUE_ACCESSOR_PROVIDER = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DxLookupComponent), multi: true }; /** * The Lookup is a widget that allows an end user to search for an item in a collection shown in a drop-down menu. */ @Component({ selector: 'dx-lookup', template: '', providers: [ DxTemplateHost, WatcherHelper, CUSTOM_VALUE_ACCESSOR_PROVIDER, NestedOptionHost, IterableDifferHelper ] }) export class DxLookupComponent extends DxComponent implements OnDestroy, OnInit, AfterViewInit, ControlValueAccessor, OnChanges, DoCheck { instance: DxLookup; @ContentChild(DxValidatorComponent) validator: DxValidatorComponent; /** * Specifies the shortcut key that sets focus on the widget. */ @Input() get accessKey(): string { return this._getOption('accessKey'); } set accessKey(value: string) { this._setOption('accessKey', value); } /** * Specifies whether or not the widget changes its state when interacting with a user. */ @Input() get activeStateEnabled(): boolean { return this._getOption('activeStateEnabled'); } set activeStateEnabled(value: boolean) { this._setOption('activeStateEnabled', value); } /** * Configures widget visibility animations. This object contains two fields: show and hide. */ @Input() get animation(): any { return this._getOption('animation'); } set animation(value: any) { this._setOption('animation', value); } /** * The text displayed on the Apply button. */ @Input() get applyButtonText(): string { return this._getOption('applyButtonText'); } set applyButtonText(value: string) { this._setOption('applyButtonText', value); } /** * Specifies the way an end-user applies the selected value. */ @Input() get applyValueMode(): string { return this._getOption('applyValueMode'); } set applyValueMode(value: string) { this._setOption('applyValueMode', value); } @Input() get attr(): any { return this._getOption('attr'); } set attr(value: any) { this._setOption('attr', value); } /** * The text displayed on the Cancel button. */ @Input() get cancelButtonText(): string { return this._getOption('cancelButtonText'); } set cancelButtonText(value: string) { this._setOption('cancelButtonText', value); } /** * Specifies whether or not the widget cleans the search box when the popup window is displayed. */ @Input() get cleanSearchOnOpening(): boolean { return this._getOption('cleanSearchOnOpening'); } set cleanSearchOnOpening(value: boolean) { this._setOption('cleanSearchOnOpening', value); } /** * The text displayed on the Clear button. */ @Input() get clearButtonText(): string { return this._getOption('clearButtonText'); } set clearButtonText(value: string) { this._setOption('clearButtonText', value); } /** * A Boolean value specifying whether or not a widget is closed if a user clicks outside of the overlaying window. */ @Input() get closeOnOutsideClick(): boolean| Function { return this._getOption('closeOnOutsideClick'); } set closeOnOutsideClick(value: boolean| Function) { this._setOption('closeOnOutsideClick', value); } /** * A data source used to fetch data to be displayed by the widget. */ @Input() get dataSource(): DevExpress.data.DataSource| DevExpress.data.DataSourceOptions| string| Array { return this._getOption('dataSource'); } set dataSource(value: DevExpress.data.DataSource| DevExpress.data.DataSourceOptions| string| Array) { this._setOption('dataSource', value); } /** * Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ @Input() get deferRendering(): boolean { return this._getOption('deferRendering'); } set deferRendering(value: boolean) { this._setOption('deferRendering', value); } /** * Specifies whether the widget responds to user interaction. */ @Input() get disabled(): boolean { return this._getOption('disabled'); } set disabled(value: boolean) { this._setOption('disabled', value); } /** * Specifies the name of the data source item field whose value is displayed by the widget. */ @Input() get displayExpr(): Function| string { return this._getOption('displayExpr'); } set displayExpr(value: Function| string) { this._setOption('displayExpr', value); } /** * Returns the value currently displayed by the widget. */ @Input() get displayValue(): string { return this._getOption('displayValue'); } set displayValue(value: string) { this._setOption('displayValue', value); } /** * Specifies a custom template for the drop-down button. */ @Input() get dropDownButtonTemplate(): any { return this._getOption('dropDownButtonTemplate'); } set dropDownButtonTemplate(value: any) { this._setOption('dropDownButtonTemplate', value); } /** * Specifies the attributes to be attached to the widget's root element. */ @Input() get elementAttr(): any { return this._getOption('elementAttr'); } set elementAttr(value: any) { this._setOption('elementAttr', value); } /** * This option is deprecated, because the functionality controlled by it was not supposed to belong to the Lookup widget. Instead, we suggest that you use the SelectBox widget with the acceptCustomValue option set to true. */ @Input() get fieldEditEnabled(): any { return this._getOption('fieldEditEnabled'); } set fieldEditEnabled(value: any) { this._setOption('fieldEditEnabled', value); } /** * The template to be used for rendering the widget text field. */ @Input() get fieldTemplate(): any { return this._getOption('fieldTemplate'); } set fieldTemplate(value: any) { this._setOption('fieldTemplate', value); } /** * Specifies whether the widget can be focused using keyboard navigation. */ @Input() get focusStateEnabled(): boolean { return this._getOption('focusStateEnabled'); } set focusStateEnabled(value: boolean) { this._setOption('focusStateEnabled', value); } /** * A Boolean value specifying whether or not to display the lookup in full-screen mode. */ @Input() get fullScreen(): boolean { return this._getOption('fullScreen'); } set fullScreen(value: boolean) { this._setOption('fullScreen', value); } /** * A Boolean value specifying whether or not to group widget items. */ @Input() get grouped(): boolean { return this._getOption('grouped'); } set grouped(value: boolean) { this._setOption('grouped', value); } /** * Specifies a custom template for a group caption. */ @Input() get groupTemplate(): any { return this._getOption('groupTemplate'); } set groupTemplate(value: any) { this._setOption('groupTemplate', value); } /** * Specifies the widget's height. */ @Input() get height(): number| Function| string { return this._getOption('height'); } set height(value: number| Function| string) { this._setOption('height', value); } /** * Specifies text for a hint that appears when a user pauses on the widget. */ @Input() get hint(): string { return this._getOption('hint'); } set hint(value: string) { this._setOption('hint', value); } /** * Specifies whether the widget changes its state when a user pauses on it. */ @Input() get hoverStateEnabled(): boolean { return this._getOption('hoverStateEnabled'); } set hoverStateEnabled(value: boolean) { this._setOption('hoverStateEnabled', value); } /** * Specifies the attributes to be passed on to the underlying HTML element. */ @Input() get inputAttr(): any { return this._getOption('inputAttr'); } set inputAttr(value: any) { this._setOption('inputAttr', value); } /** * Specifies whether the editor's value is valid. */ @Input() get isValid(): boolean { return this._getOption('isValid'); } set isValid(value: boolean) { this._setOption('isValid', value); } /** * An array of items displayed by the widget. */ @Input() get items(): Array { return this._getOption('items'); } set items(value: Array) { this._setOption('items', value); } /** * Specifies a custom template for an item. */ @Input() get itemTemplate(): any { return this._getOption('itemTemplate'); } set itemTemplate(value: any) { this._setOption('itemTemplate', value); } /** * The minimum number of characters that must be entered into the text box to begin a search. Applies only if searchEnabled is true. */ @Input() get minSearchLength(): number { return this._getOption('minSearchLength'); } set minSearchLength(value: number) { this._setOption('minSearchLength', value); } /** * The value to be assigned to the `name` attribute of the underlying HTML element. */ @Input() get name(): string { return this._getOption('name'); } set name(value: string) { this._setOption('name', value); } /** * The text displayed on the button used to load the next page from the data source. */ @Input() get nextButtonText(): string { return this._getOption('nextButtonText'); } set nextButtonText(value: string) { this._setOption('nextButtonText', value); } /** * The text or HTML markup displayed by the widget if the item collection is empty. */ @Input() get noDataText(): string { return this._getOption('noDataText'); } set noDataText(value: string) { this._setOption('noDataText', value); } /** * Specifies whether or not the drop-down editor is displayed. */ @Input() get opened(): boolean { return this._getOption('opened'); } set opened(value: boolean) { this._setOption('opened', value); } /** * Specifies the text shown in the pullDown panel, which is displayed when the widget is scrolled to the bottom. */ @Input() get pageLoadingText(): string { return this._getOption('pageLoadingText'); } set pageLoadingText(value: string) { this._setOption('pageLoadingText', value); } /** * Specifies whether the next page is loaded when a user scrolls the widget to the bottom or when the "next" button is clicked. */ @Input() get pageLoadMode(): string { return this._getOption('pageLoadMode'); } set pageLoadMode(value: string) { this._setOption('pageLoadMode', value); } /** * Use the DataSource paging opportunities instead. */ @Input() get pagingEnabled(): boolean { return this._getOption('pagingEnabled'); } set pagingEnabled(value: boolean) { this._setOption('pagingEnabled', value); } /** * The text displayed by the widget when nothing is selected. */ @Input() get placeholder(): string { return this._getOption('placeholder'); } set placeholder(value: string) { this._setOption('placeholder', value); } /** * The height of the widget popup element. */ @Input() get popupHeight(): number| Function| string { return this._getOption('popupHeight'); } set popupHeight(value: number| Function| string) { this._setOption('popupHeight', value); } /** * The width of the widget popup element. */ @Input() get popupWidth(): number| Function| string { return this._getOption('popupWidth'); } set popupWidth(value: number| Function| string) { this._setOption('popupWidth', value); } /** * An object defining widget positioning options. */ @Input() get position(): DevExpress.positionConfig { return this._getOption('position'); } set position(value: DevExpress.positionConfig) { this._setOption('position', value); } /** * Specifies the text displayed in the pullDown panel when the widget is pulled below the refresh threshold. */ @Input() get pulledDownText(): string { return this._getOption('pulledDownText'); } set pulledDownText(value: string) { this._setOption('pulledDownText', value); } /** * Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ @Input() get pullingDownText(): string { return this._getOption('pullingDownText'); } set pullingDownText(value: string) { this._setOption('pullingDownText', value); } /** * A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ @Input() get pullRefreshEnabled(): boolean { return this._getOption('pullRefreshEnabled'); } set pullRefreshEnabled(value: boolean) { this._setOption('pullRefreshEnabled', value); } /** * Specifies the text displayed in the pullDown panel while the widget is being refreshed. */ @Input() get refreshingText(): string { return this._getOption('refreshingText'); } set refreshingText(value: string) { this._setOption('refreshingText', value); } /** * Switches the widget to a right-to-left representation. */ @Input() get rtlEnabled(): boolean { return this._getOption('rtlEnabled'); } set rtlEnabled(value: boolean) { this._setOption('rtlEnabled', value); } /** * Specifies whether the search box is visible. */ @Input() get searchEnabled(): boolean { return this._getOption('searchEnabled'); } set searchEnabled(value: boolean) { this._setOption('searchEnabled', value); } /** * Specifies the name of a data source item field or an expression whose value is compared to the search criterion. */ @Input() get searchExpr(): Function| Array { return this._getOption('searchExpr'); } set searchExpr(value: Function| Array) { this._setOption('searchExpr', value); } /** * Specifies the binary operation used to filter data. */ @Input() get searchMode(): string { return this._getOption('searchMode'); } set searchMode(value: string) { this._setOption('searchMode', value); } /** * The text that is provided as a hint in the lookup's search bar. */ @Input() get searchPlaceholder(): string { return this._getOption('searchPlaceholder'); } set searchPlaceholder(value: string) { this._setOption('searchPlaceholder', value); } /** * Specifies the time delay, in milliseconds, after the last character has been typed in, before a search is executed. */ @Input() get searchTimeout(): number { return this._getOption('searchTimeout'); } set searchTimeout(value: number) { this._setOption('searchTimeout', value); } /** * Gets the currently selected item. */ @Input() get selectedItem(): any { return this._getOption('selectedItem'); } set selectedItem(value: any) { this._setOption('selectedItem', value); } /** * A Boolean value specifying whether or not the main screen is inactive while the lookup is active. */ @Input() get shading(): boolean { return this._getOption('shading'); } set shading(value: boolean) { this._setOption('shading', value); } /** * Specifies whether to display the Cancel button in the lookup window. */ @Input() get showCancelButton(): boolean { return this._getOption('showCancelButton'); } set showCancelButton(value: boolean) { this._setOption('showCancelButton', value); } /** * Specifies whether or not to display the Clear button in the lookup window. */ @Input() get showClearButton(): boolean { return this._getOption('showClearButton'); } set showClearButton(value: boolean) { this._setOption('showClearButton', value); } /** * Specifies whether or not the widget displays unfiltered values until a user types a number of characters exceeding the minSearchLength option value. */ @Input() get showDataBeforeSearch(): boolean { return this._getOption('showDataBeforeSearch'); } set showDataBeforeSearch(value: boolean) { this._setOption('showDataBeforeSearch', value); } /** * Use the pageLoadMode option instead. */ @Input() get showNextButton(): boolean { return this._getOption('showNextButton'); } set showNextButton(value: boolean) { this._setOption('showNextButton', value); } /** * A Boolean value specifying whether or not to display the title in the popup window. */ @Input() get showPopupTitle(): boolean { return this._getOption('showPopupTitle'); } set showPopupTitle(value: boolean) { this._setOption('showPopupTitle', value); } /** * Specifies the number of the element when the Tab key is used for navigating. */ @Input() get tabIndex(): number { return this._getOption('tabIndex'); } set tabIndex(value: number) { this._setOption('tabIndex', value); } /** * The read-only option that holds the text displayed by the widget input element. */ @Input() get text(): string { return this._getOption('text'); } set text(value: string) { this._setOption('text', value); } /** * The title of the lookup window. */ @Input() get title(): string { return this._getOption('title'); } set title(value: string) { this._setOption('title', value); } /** * A template to be used for rendering the widget title. */ @Input() get titleTemplate(): any { return this._getOption('titleTemplate'); } set titleTemplate(value: any) { this._setOption('titleTemplate', value); } /** * Specifies whether or not the widget uses native scrolling. */ @Input() get useNativeScrolling(): boolean { return this._getOption('useNativeScrolling'); } set useNativeScrolling(value: boolean) { this._setOption('useNativeScrolling', value); } /** * Specifies whether or not to show lookup contents in a Popover widget. */ @Input() get usePopover(): boolean { return this._getOption('usePopover'); } set usePopover(value: boolean) { this._setOption('usePopover', value); } /** * Specifies information on the validation error when using a custom validation engine. Should be changed at runtime along with the isValid option. */ @Input() get validationError(): any { return this._getOption('validationError'); } set validationError(value: any) { this._setOption('validationError', value); } /** * Specifies how the message about the validation rules that are not satisfied by this editor's value is displayed. */ @Input() get validationMessageMode(): string { return this._getOption('validationMessageMode'); } set validationMessageMode(value: string) { this._setOption('validationMessageMode', value); } /** * Specifies the currently selected value. May be an object if dataSource contains objects and valueExpr is not set. */ @Input() get value(): any { return this._getOption('value'); } set value(value: any) { this._setOption('value', value); } /** * Specifies DOM event names that update a widget's value. */ @Input() get valueChangeEvent(): string { return this._getOption('valueChangeEvent'); } set valueChangeEvent(value: string) { this._setOption('valueChangeEvent', value); } /** * Specifies which data field provides the widget's value. When this option is not set, the value is the entire data object. */ @Input() get valueExpr(): Function| string { return this._getOption('valueExpr'); } set valueExpr(value: Function| string) { this._setOption('valueExpr', value); } /** * Specifies whether the widget is visible. */ @Input() get visible(): boolean { return this._getOption('visible'); } set visible(value: boolean) { this._setOption('visible', value); } /** * Specifies the widget's width. */ @Input() get width(): number| Function| string { return this._getOption('width'); } set width(value: number| Function| string) { this._setOption('width', value); } /** * A handler for the closed event. */ @Output() onClosed: EventEmitter; /** * A handler for the contentReady event. Executed when the widget's content is ready. This handler may be executed multiple times during the widget's lifetime depending on the number of times its content changes. */ @Output() onContentReady: EventEmitter; /** * A handler for the disposing event. Executed when the widget is removed from the DOM using the remove(), empty(), or html() jQuery methods only. */ @Output() onDisposing: EventEmitter; /** * A handler for the initialized event. Executed only once, after the widget is initialized. */ @Output() onInitialized: EventEmitter; /** * A handler for the itemClick event. */ @Output() onItemClick: EventEmitter; /** * A handler for the opened event. */ @Output() onOpened: EventEmitter; /** * A handler for the optionChanged event. Executed after an option of the widget is changed. */ @Output() onOptionChanged: EventEmitter; /** * A handler for the pageLoading event. */ @Output() onPageLoading: EventEmitter; /** * A handler for the pullRefresh event. */ @Output() onPullRefresh: EventEmitter; /** * A handler for the scroll event. */ @Output() onScroll: EventEmitter; /** * A handler for the selectionChanged event. */ @Output() onSelectionChanged: EventEmitter; /** * A handler for the titleRendered event. */ @Output() onTitleRendered: EventEmitter; /** * A handler for the valueChanged event. */ @Output() onValueChanged: EventEmitter; /** * A handler for the accessKeyChange event. */ @Output() accessKeyChange: EventEmitter; /** * A handler for the activeStateEnabledChange event. */ @Output() activeStateEnabledChange: EventEmitter; /** * A handler for the animationChange event. */ @Output() animationChange: EventEmitter; /** * A handler for the applyButtonTextChange event. */ @Output() applyButtonTextChange: EventEmitter; /** * A handler for the applyValueModeChange event. */ @Output() applyValueModeChange: EventEmitter; /** * A handler for the attrChange event. */ @Output() attrChange: EventEmitter; /** * A handler for the cancelButtonTextChange event. */ @Output() cancelButtonTextChange: EventEmitter; /** * A handler for the cleanSearchOnOpeningChange event. */ @Output() cleanSearchOnOpeningChange: EventEmitter; /** * A handler for the clearButtonTextChange event. */ @Output() clearButtonTextChange: EventEmitter; /** * A handler for the closeOnOutsideClickChange event. */ @Output() closeOnOutsideClickChange: EventEmitter; /** * A handler for the dataSourceChange event. */ @Output() dataSourceChange: EventEmitter>; /** * A handler for the deferRenderingChange event. */ @Output() deferRenderingChange: EventEmitter; /** * A handler for the disabledChange event. */ @Output() disabledChange: EventEmitter; /** * A handler for the displayExprChange event. */ @Output() displayExprChange: EventEmitter; /** * A handler for the displayValueChange event. */ @Output() displayValueChange: EventEmitter; /** * A handler for the dropDownButtonTemplateChange event. */ @Output() dropDownButtonTemplateChange: EventEmitter; /** * A handler for the elementAttrChange event. */ @Output() elementAttrChange: EventEmitter; /** * A handler for the fieldEditEnabledChange event. */ @Output() fieldEditEnabledChange: EventEmitter; /** * A handler for the fieldTemplateChange event. */ @Output() fieldTemplateChange: EventEmitter; /** * A handler for the focusStateEnabledChange event. */ @Output() focusStateEnabledChange: EventEmitter; /** * A handler for the fullScreenChange event. */ @Output() fullScreenChange: EventEmitter; /** * A handler for the groupedChange event. */ @Output() groupedChange: EventEmitter; /** * A handler for the groupTemplateChange event. */ @Output() groupTemplateChange: EventEmitter; /** * A handler for the heightChange event. */ @Output() heightChange: EventEmitter; /** * A handler for the hintChange event. */ @Output() hintChange: EventEmitter; /** * A handler for the hoverStateEnabledChange event. */ @Output() hoverStateEnabledChange: EventEmitter; /** * A handler for the inputAttrChange event. */ @Output() inputAttrChange: EventEmitter; /** * A handler for the isValidChange event. */ @Output() isValidChange: EventEmitter; /** * A handler for the itemsChange event. */ @Output() itemsChange: EventEmitter>; /** * A handler for the itemTemplateChange event. */ @Output() itemTemplateChange: EventEmitter; /** * A handler for the minSearchLengthChange event. */ @Output() minSearchLengthChange: EventEmitter; /** * A handler for the nameChange event. */ @Output() nameChange: EventEmitter; /** * A handler for the nextButtonTextChange event. */ @Output() nextButtonTextChange: EventEmitter; /** * A handler for the noDataTextChange event. */ @Output() noDataTextChange: EventEmitter; /** * A handler for the openedChange event. */ @Output() openedChange: EventEmitter; /** * A handler for the pageLoadingTextChange event. */ @Output() pageLoadingTextChange: EventEmitter; /** * A handler for the pageLoadModeChange event. */ @Output() pageLoadModeChange: EventEmitter; /** * A handler for the pagingEnabledChange event. */ @Output() pagingEnabledChange: EventEmitter; /** * A handler for the placeholderChange event. */ @Output() placeholderChange: EventEmitter; /** * A handler for the popupHeightChange event. */ @Output() popupHeightChange: EventEmitter; /** * A handler for the popupWidthChange event. */ @Output() popupWidthChange: EventEmitter; /** * A handler for the positionChange event. */ @Output() positionChange: EventEmitter; /** * A handler for the pulledDownTextChange event. */ @Output() pulledDownTextChange: EventEmitter; /** * A handler for the pullingDownTextChange event. */ @Output() pullingDownTextChange: EventEmitter; /** * A handler for the pullRefreshEnabledChange event. */ @Output() pullRefreshEnabledChange: EventEmitter; /** * A handler for the refreshingTextChange event. */ @Output() refreshingTextChange: EventEmitter; /** * A handler for the rtlEnabledChange event. */ @Output() rtlEnabledChange: EventEmitter; /** * A handler for the searchEnabledChange event. */ @Output() searchEnabledChange: EventEmitter; /** * A handler for the searchExprChange event. */ @Output() searchExprChange: EventEmitter>; /** * A handler for the searchModeChange event. */ @Output() searchModeChange: EventEmitter; /** * A handler for the searchPlaceholderChange event. */ @Output() searchPlaceholderChange: EventEmitter; /** * A handler for the searchTimeoutChange event. */ @Output() searchTimeoutChange: EventEmitter; /** * A handler for the selectedItemChange event. */ @Output() selectedItemChange: EventEmitter; /** * A handler for the shadingChange event. */ @Output() shadingChange: EventEmitter; /** * A handler for the showCancelButtonChange event. */ @Output() showCancelButtonChange: EventEmitter; /** * A handler for the showClearButtonChange event. */ @Output() showClearButtonChange: EventEmitter; /** * A handler for the showDataBeforeSearchChange event. */ @Output() showDataBeforeSearchChange: EventEmitter; /** * A handler for the showNextButtonChange event. */ @Output() showNextButtonChange: EventEmitter; /** * A handler for the showPopupTitleChange event. */ @Output() showPopupTitleChange: EventEmitter; /** * A handler for the tabIndexChange event. */ @Output() tabIndexChange: EventEmitter; /** * A handler for the textChange event. */ @Output() textChange: EventEmitter; /** * A handler for the titleChange event. */ @Output() titleChange: EventEmitter; /** * A handler for the titleTemplateChange event. */ @Output() titleTemplateChange: EventEmitter; /** * A handler for the useNativeScrollingChange event. */ @Output() useNativeScrollingChange: EventEmitter; /** * A handler for the usePopoverChange event. */ @Output() usePopoverChange: EventEmitter; /** * A handler for the validationErrorChange event. */ @Output() validationErrorChange: EventEmitter; /** * A handler for the validationMessageModeChange event. */ @Output() validationMessageModeChange: EventEmitter; /** * A handler for the valueChange event. */ @Output() valueChange: EventEmitter; /** * A handler for the valueChangeEventChange event. */ @Output() valueChangeEventChange: EventEmitter; /** * A handler for the valueExprChange event. */ @Output() valueExprChange: EventEmitter; /** * A handler for the visibleChange event. */ @Output() visibleChange: EventEmitter; /** * A handler for the widthChange event. */ @Output() widthChange: EventEmitter; @Output() onBlur: EventEmitter; @HostListener('valueChange', ['$event']) change(_) { } @HostListener('onBlur', ['$event']) touched = () => {}; @ContentChildren(DxiItemComponent) get itemsChildren(): QueryList { return this._getOption('items'); } set itemsChildren(value) { this.setChildren('items', value); } constructor(elementRef: ElementRef, ngZone: NgZone, templateHost: DxTemplateHost, injector: Injector, private _watcherHelper: WatcherHelper, private _idh: IterableDifferHelper, optionHost: NestedOptionHost) { super(elementRef, ngZone, templateHost, _watcherHelper); injector.get(EventsRegistrator); this._createEventEmitters([ { subscribe: 'closed', emit: 'onClosed' }, { subscribe: 'contentReady', emit: 'onContentReady' }, { subscribe: 'disposing', emit: 'onDisposing' }, { subscribe: 'initialized', emit: 'onInitialized' }, { subscribe: 'itemClick', emit: 'onItemClick' }, { subscribe: 'opened', emit: 'onOpened' }, { subscribe: 'optionChanged', emit: 'onOptionChanged' }, { subscribe: 'pageLoading', emit: 'onPageLoading' }, { subscribe: 'pullRefresh', emit: 'onPullRefresh' }, { subscribe: 'scroll', emit: 'onScroll' }, { subscribe: 'selectionChanged', emit: 'onSelectionChanged' }, { subscribe: 'titleRendered', emit: 'onTitleRendered' }, { subscribe: 'valueChanged', emit: 'onValueChanged' }, { emit: 'accessKeyChange' }, { emit: 'activeStateEnabledChange' }, { emit: 'animationChange' }, { emit: 'applyButtonTextChange' }, { emit: 'applyValueModeChange' }, { emit: 'attrChange' }, { emit: 'cancelButtonTextChange' }, { emit: 'cleanSearchOnOpeningChange' }, { emit: 'clearButtonTextChange' }, { emit: 'closeOnOutsideClickChange' }, { emit: 'dataSourceChange' }, { emit: 'deferRenderingChange' }, { emit: 'disabledChange' }, { emit: 'displayExprChange' }, { emit: 'displayValueChange' }, { emit: 'dropDownButtonTemplateChange' }, { emit: 'elementAttrChange' }, { emit: 'fieldEditEnabledChange' }, { emit: 'fieldTemplateChange' }, { emit: 'focusStateEnabledChange' }, { emit: 'fullScreenChange' }, { emit: 'groupedChange' }, { emit: 'groupTemplateChange' }, { emit: 'heightChange' }, { emit: 'hintChange' }, { emit: 'hoverStateEnabledChange' }, { emit: 'inputAttrChange' }, { emit: 'isValidChange' }, { emit: 'itemsChange' }, { emit: 'itemTemplateChange' }, { emit: 'minSearchLengthChange' }, { emit: 'nameChange' }, { emit: 'nextButtonTextChange' }, { emit: 'noDataTextChange' }, { emit: 'openedChange' }, { emit: 'pageLoadingTextChange' }, { emit: 'pageLoadModeChange' }, { emit: 'pagingEnabledChange' }, { emit: 'placeholderChange' }, { emit: 'popupHeightChange' }, { emit: 'popupWidthChange' }, { emit: 'positionChange' }, { emit: 'pulledDownTextChange' }, { emit: 'pullingDownTextChange' }, { emit: 'pullRefreshEnabledChange' }, { emit: 'refreshingTextChange' }, { emit: 'rtlEnabledChange' }, { emit: 'searchEnabledChange' }, { emit: 'searchExprChange' }, { emit: 'searchModeChange' }, { emit: 'searchPlaceholderChange' }, { emit: 'searchTimeoutChange' }, { emit: 'selectedItemChange' }, { emit: 'shadingChange' }, { emit: 'showCancelButtonChange' }, { emit: 'showClearButtonChange' }, { emit: 'showDataBeforeSearchChange' }, { emit: 'showNextButtonChange' }, { emit: 'showPopupTitleChange' }, { emit: 'tabIndexChange' }, { emit: 'textChange' }, { emit: 'titleChange' }, { emit: 'titleTemplateChange' }, { emit: 'useNativeScrollingChange' }, { emit: 'usePopoverChange' }, { emit: 'validationErrorChange' }, { emit: 'validationMessageModeChange' }, { emit: 'valueChange' }, { emit: 'valueChangeEventChange' }, { emit: 'valueExprChange' }, { emit: 'visibleChange' }, { emit: 'widthChange' }, { emit: 'onBlur' } ]); this._idh.setHost(this); optionHost.setHost(this); } protected _createInstance(element, options) { return new DxLookup(element, options); } writeValue(value: any): void { this.value = value; } setDisabledState(isDisabled: boolean): void { this.disabled = isDisabled; } registerOnChange(fn: (_: any) => void): void { this.change = fn; } registerOnTouched(fn: () => void): void { this.touched = fn; } _createWidget(element: any) { super._createWidget(element); this.instance.on('focusOut', (e) => { this.eventHelper.fireNgEvent('onBlur', [e]); }); } ngOnDestroy() { this._destroyWidget(); } ngOnChanges(changes: SimpleChanges) { super.ngOnChanges(changes); this.setupChanges('dataSource', changes); this.setupChanges('items', changes); this.setupChanges('searchExpr', changes); } setupChanges(prop: string, changes: SimpleChanges) { if (!(prop in this._optionsToUpdate)) { this._idh.setup(prop, changes); } } ngDoCheck() { this._idh.doCheck('dataSource'); this._idh.doCheck('items'); this._idh.doCheck('searchExpr'); this._watcherHelper.checkWatchers(); super.ngDoCheck(); } _setOption(name: string, value: any) { let isSetup = this._idh.setupSingle(name, value); let isChanged = this._idh.getChanges(name, value) !== null; if (isSetup || isChanged) { super._setOption(name, value); } } ngOnInit() { super.ngOnInit(); if (this.validator) { this.validator.createInstanceOnInit = false; } } ngAfterViewInit() { super.ngAfterViewInit(); if (this.validator) { this.validator.createInstance(this.element.nativeElement); } } } @NgModule({ imports: [ DxoAnimationModule, DxoHideModule, DxoShowModule, DxiItemModule, DxoPositionModule, DxoAtModule, DxoBoundaryOffsetModule, DxoCollisionModule, DxoMyModule, DxoOffsetModule, DxTemplateModule ], declarations: [ DxLookupComponent ], exports: [ DxLookupComponent, DxoAnimationModule, DxoHideModule, DxoShowModule, DxiItemModule, DxoPositionModule, DxoAtModule, DxoBoundaryOffsetModule, DxoCollisionModule, DxoMyModule, DxoOffsetModule, DxTemplateModule ], providers: [EventsRegistrator] }) export class DxLookupModule { }