"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@angular/core");
var common_1 = require("@angular/common");
var inputtext_1 = require("../inputtext/inputtext");
var button_1 = require("../button/button");
var shared_1 = require("../common/shared");
var domhandler_1 = require("../dom/domhandler");
var objectutils_1 = require("../utils/objectutils");
var forms_1 = require("@angular/forms");
exports.AUTOCOMPLETE_VALUE_ACCESSOR = {
    provide: forms_1.NG_VALUE_ACCESSOR,
    useExisting: core_1.forwardRef(function () { return AutoComplete; }),
    multi: true
};
var AutoComplete = /** @class */ (function () {
    function AutoComplete(el, domHandler, renderer, objectUtils, cd, differs, zone) {
        this.el = el;
        this.domHandler = domHandler;
        this.renderer = renderer;
        this.objectUtils = objectUtils;
        this.cd = cd;
        this.differs = differs;
        this.zone = zone;
        this.minLength = 1;
        this.delay = 300;
        this.selectedItemsLabel = '{0} items selected';
        this.type = 'text';
        this.completeMethod = new core_1.EventEmitter();
        this.onReset = new core_1.EventEmitter();
        this.onSelect = new core_1.EventEmitter();
        this.onUnselect = new core_1.EventEmitter();
        this.onFocus = new core_1.EventEmitter();
        this.onBlur = new core_1.EventEmitter();
        this.onKeyUp = new core_1.EventEmitter();
        this.scrollHeight = '200px';
        this.dropdown = true;
        this.emptyMessage = "No data";
        this.immutable = true;
        this.resetFilterTitle = 'Reset filter';
        this.onModelChange = function () {
        };
        this.onModelTouched = function () {
        };
        this.panelVisible = false;
        this.focus = false;
        this.selectedHidden = true;
        this.inputFieldValue = null;
        this.savedInputValue = null;
        //for lazy scrolling
        this.rows = 15;
        this.lazy = false;
        this.buffer = 0.9;
        this.first = 0;
        this.page = 0;
        this.searching = false;
        this.differ = differs.find([]).create(null);
    }
    Object.defineProperty(AutoComplete.prototype, "suggestions", {
        get: function () {
            return this._suggestions;
        },
        set: function (val) {
            this._suggestions = val;
            if (this.immutable) {
                this.handleSuggestionsChange();
            }
        },
        enumerable: true,
        configurable: true
    });
    AutoComplete.prototype.ngDoCheck = function () {
        if (!this.immutable) {
            var changes = this.differ.diff(this.suggestions);
            if (changes) {
                this.handleSuggestionsChange();
            }
        }
    };
    AutoComplete.prototype.showResetButton = function () {
        return (!this.multiple && (this.value && this.value.length) || (this.inputEL && this.inputEL.nativeElement.value.length));
    };
    AutoComplete.prototype.handleSuggestionsChange = function () {
        this.searching = false;
        if (this._suggestions != null) {
            if (this.panelEL && this.panelEL.nativeElement) {
                this.highlightOption = null;
                if (this._suggestions && this._suggestions.length) {
                    this.noResults = false;
                    this.show();
                    this.suggestionsUpdated = true;
                    if (this.autoHighlight) {
                        this.highlightOption = this._suggestions[0];
                    }
                }
                else {
                    this.noResults = true;
                    if (this.emptyMessage) {
                        this.show();
                        this.suggestionsUpdated = true;
                    }
                    else {
                        this.hide();
                    }
                }
            }
        }
    };
    AutoComplete.prototype.ngAfterContentInit = function () {
        var _this = this;
        this.templates.forEach(function (item) {
            switch (item.getType()) {
                case 'item':
                    _this.itemTemplate = item.template;
                    break;
                case 'selectedItem':
                    _this.selectedItemTemplate = item.template;
                    break;
                default:
                    _this.itemTemplate = item.template;
                    break;
            }
        });
    };
    AutoComplete.prototype.ngAfterViewInit = function () {
        if (this.appendTo) {
            if (this.appendTo === 'body')
                document.body.appendChild(this.panelEL.nativeElement);
            else
                this.domHandler.appendChild(this.panelEL.nativeElement, this.appendTo);
        }
        this.bindScrollListener();
    };
    AutoComplete.prototype.ngAfterViewChecked = function () {
        var _this = this;
        //Use timeouts as since Angular 4.2, AfterViewChecked is broken and not called after panel is updated
        if (this.suggestionsUpdated && this.panelEL.nativeElement && this.panelEL.nativeElement.offsetParent) {
            setTimeout(function () { return _this.align(); }, 1);
            this.suggestionsUpdated = false;
        }
        if (this.highlightOptionChanged) {
            setTimeout(function () {
                var listItem = _this.domHandler.findSingle(_this.panelEL.nativeElement, 'li.ui-state-highlight');
                if (listItem) {
                    _this.domHandler.scrollInView(_this.panelEL.nativeElement, listItem);
                }
            }, 1);
            this.highlightOptionChanged = false;
        }
    };
    AutoComplete.prototype.writeValue = function (value) {
        this.value = value;
        this.filled = this.value && this.value != '';
        this.updateInputField();
    };
    AutoComplete.prototype.registerOnChange = function (fn) {
        this.onModelChange = fn;
    };
    AutoComplete.prototype.registerOnTouched = function (fn) {
        this.onModelTouched = fn;
    };
    AutoComplete.prototype.setDisabledState = function (val) {
        this.disabled = val;
    };
    AutoComplete.prototype.onInput = function (event) {
        var _this = this;
        if (!this.inputKeyDown) {
            return;
        }
        if (!this.multiple && this.value && this.inputEL.nativeElement.value != this.value.label)
            this.value = null;
        if (this.timeout) {
            clearTimeout(this.timeout);
        }
        var value = event.target.value;
        if (!this.multiple && !this.forceSelection) {
            this.onModelChange(value);
        }
        if ((value.length >= this.minLength) || (value.length === 0)) {
            this.page = 0;
            this.timeout = setTimeout(function () {
                _this.search(event, value);
            }, this.delay);
        }
        else {
            this.hide();
        }
        this.updateFilledState();
        this.inputKeyDown = false;
    };
    AutoComplete.prototype.searchOnClick = function (event) {
        var queryValue = this.multiple ? this.multiInputEL.nativeElement.value : this.inputEL.nativeElement.value;
        this.search(event, queryValue);
        this.bindDocumentClickListener();
    };
    AutoComplete.prototype.onInputClick = function (event) {
        this.inputClick = true;
        if (this.multiple)
            this.multiInputEL.nativeElement.value = this.savedInputValue;
        this.searchOnClick(event);
    };
    AutoComplete.prototype.onMultiContainerClick = function (event) {
        if (!this.inputClick) {
            this.multiConteinerClick = true;
            this.multiInputEL.nativeElement.value = this.savedInputValue;
            this.searchOnClick(event);
        }
    };
    AutoComplete.prototype.resetFilter = function () {
        if (this.multiple) {
            this.multiInputEL.nativeElement.value = this.savedInputValue = '';
            this.value = [];
        }
        else {
            this.inputEL.nativeElement.value = null;
            this.value = null;
        }
        this.onModelChange(this.value);
        this.onReset.emit();
    };
    AutoComplete.prototype.getPlaceHolder = function () {
        if (this.value && this.value.length && this.selectedHidden) {
            var pattern = /{(.*?)}/;
            if (pattern.test(this.selectedItemsLabel))
                return this.selectedItemsLabel.replace(this.selectedItemsLabel.match(pattern)[0], this.value.length + '');
            return;
        }
        else if (this.value && this.value.length && !this.selectedHidden)
            return;
        else if (!this.value || !this.value.length)
            return this.placeholder;
    };
    AutoComplete.prototype.getTitle = function () {
        if (this.value && this.value.length) {
            var selectedLabels = [];
            for (var _i = 0, _a = this.value; _i < _a.length; _i++) {
                var val = _a[_i];
                selectedLabels.push(val.label);
            }
            return selectedLabels.join();
        }
        return;
    };
    AutoComplete.prototype.search = function (event, query) {
        //allow empty string but not undefined or null
        if (query === undefined || query === null) {
            return;
        }
        if ((event.type == 'click') && this.page > 0) {
            this.show();
            return;
        }
        if (!this.searching) {
            this.searching = true;
            this.completeMethod.emit({
                first: this.page * this.rows,
                rows: this.rows,
                query: (!this.multiple && this.value) ? "" : query
            });
            this.page = this.page + 1;
        }
    };
    AutoComplete.prototype.selectItem = function (option, focus) {
        if (focus === void 0) { focus = true; }
        this.itemSelect = true;
        if (this.multiple) {
            this.value = this.value || [];
            if (!this.isSelected(option)) {
                this.value = this.value.concat([option]);
                this.onModelChange(this.value);
            }
        }
        else {
            this.inputEL.nativeElement.value = this.field ? this.objectUtils.resolveFieldData(option, this.field) || '' : option;
            this.value = option;
            this.onModelChange(this.value);
        }
        this.onSelect.emit(option);
        this.updateFilledState();
        if (focus) {
            this.focusInput();
        }
    };
    AutoComplete.prototype.show = function () {
        if (this.multiInputEL || this.inputEL) {
            var el = (this.multiple) ? (document.activeElement == this.multiInputEL.nativeElement) : (document.activeElement == this.inputEL.nativeElement);
            var hasFocus = el || this.inputClick || this.multiConteinerClick;
            if (!this.panelVisible && hasFocus && !(!this.multiple && this.itemSelect && !this.inputClick && !this.multiConteinerClick)) {
                this.panelVisible = true;
                if (this.appendTo) {
                    this.panelEL.nativeElement.style.minWidth = this.domHandler.getWidth(this.el.nativeElement.children[0]) + 'px';
                }
                this.panelEL.nativeElement.style.zIndex = ++domhandler_1.DomHandler.zindex;
                this.domHandler.fadeIn(this.panelEL.nativeElement, 200);
                this.bindDocumentClickListener();
            }
        }
    };
    AutoComplete.prototype.align = function () {
        if (this.appendTo)
            this.domHandler.absolutePosition(this.panelEL.nativeElement, (this.multiple ? this.multiContainerEL.nativeElement : this.inputEL.nativeElement));
        else
            this.domHandler.relativePosition(this.panelEL.nativeElement, (this.multiple ? this.multiContainerEL.nativeElement : this.inputEL.nativeElement));
    };
    AutoComplete.prototype.hide = function () {
        this.panelVisible = false;
        this.unbindDocumentClickListener();
    };
    AutoComplete.prototype.focusInput = function () {
        if (this.multiple)
            this.multiInputEL.nativeElement.focus();
        else
            this.inputEL.nativeElement.focus();
    };
    AutoComplete.prototype.removeItem = function (item) {
        var itemIndex = this.domHandler.index(item);
        var removedValue = this.value[itemIndex];
        this.value = this.value.filter(function (val, i) { return i != itemIndex; });
        this.onModelChange(this.value);
        this.updateFilledState();
        this.onUnselect.emit(removedValue);
    };
    AutoComplete.prototype.onKeydown = function (event) {
        if (this.panelVisible) {
            var highlightItemIndex = this.findOptionIndex(this.highlightOption);
            switch (event.which) {
                //down
                case 40:
                    if (highlightItemIndex != -1) {
                        var nextItemIndex = highlightItemIndex + 1;
                        if (nextItemIndex != (this.suggestions.length)) {
                            this.highlightOption = this.suggestions[nextItemIndex];
                            this.highlightOptionChanged = true;
                        }
                    }
                    else {
                        this.highlightOption = this.suggestions[0];
                    }
                    event.preventDefault();
                    break;
                //up
                case 38:
                    if (highlightItemIndex > 0) {
                        var prevItemIndex = highlightItemIndex - 1;
                        this.highlightOption = this.suggestions[prevItemIndex];
                        this.highlightOptionChanged = true;
                    }
                    event.preventDefault();
                    break;
                //enter
                case 13:
                    if (this.highlightOption) {
                        this.selectItem(this.highlightOption);
                        this.hide();
                    }
                    event.preventDefault();
                    break;
                //escape
                case 27:
                    this.hide();
                    event.preventDefault();
                    break;
                //tab
                case 9:
                    if (this.highlightOption) {
                        this.selectItem(this.highlightOption);
                    }
                    this.hide();
                    break;
            }
        }
        else {
            if (event.which === 40 && this.suggestions) {
                this.search(event, event.target.value);
            }
        }
        if (this.multiple) {
            switch (event.which) {
                //backspace
                case 8:
                    if (this.value && this.value.length && !this.multiInputEL.nativeElement.value) {
                        this.value = this.value.slice();
                        var removedValue = this.value.pop();
                        this.onModelChange(this.value);
                        this.updateFilledState();
                        this.onUnselect.emit(removedValue);
                    }
                    break;
            }
        }
        this.inputKeyDown = true;
    };
    AutoComplete.prototype.onKeyup = function (event) {
        this.onKeyUp.emit(event);
    };
    AutoComplete.prototype.onInputFocus = function (event) {
        this.focus = true;
        this.onFocus.emit(event);
    };
    AutoComplete.prototype.onInputBlur = function (event) {
        this.focus = false;
        this.onModelTouched();
        this.onBlur.emit(event);
    };
    AutoComplete.prototype.onInputChange = function (event) {
        if (this.forceSelection && this.suggestions) {
            var valid = false;
            var inputValue = event.target.value.trim();
            if (this.suggestions) {
                for (var _i = 0, _a = this.suggestions; _i < _a.length; _i++) {
                    var suggestion = _a[_i];
                    var itemValue = this.field ? this.objectUtils.resolveFieldData(suggestion, this.field) : suggestion;
                    if (itemValue && inputValue === itemValue.trim()) {
                        valid = true;
                        this.selectItem(suggestion, false);
                        break;
                    }
                }
            }
            if (!valid) {
                if (this.multiple) {
                    this.multiInputEL.nativeElement.value = '';
                }
                else {
                    this.value = null;
                    this.inputEL.nativeElement.value = '';
                }
                this.onModelChange(this.value);
            }
        }
    };
    AutoComplete.prototype.isSelected = function (val) {
        var selected = false;
        if (this.value && this.value.length) {
            for (var i = 0; i < this.value.length; i++) {
                if (this.objectUtils.equals(this.value[i], val, this.dataKey)) {
                    selected = true;
                    break;
                }
            }
        }
        return selected;
    };
    AutoComplete.prototype.findOptionIndex = function (option) {
        var index = -1;
        if (this.suggestions) {
            for (var i = 0; i < this.suggestions.length; i++) {
                if (this.objectUtils.equals(option, this.suggestions[i])) {
                    index = i;
                    break;
                }
            }
        }
        return index;
    };
    AutoComplete.prototype.updateFilledState = function () {
        if (this.multiple)
            this.filled = (this.value && this.value.length) || (this.multiInputEL && this.multiInputEL.nativeElement && this.multiInputEL.nativeElement.value != '');
        else
            this.filled = (this.inputFieldValue && this.inputFieldValue != '') || (this.inputEL && this.inputEL.nativeElement && this.inputEL.nativeElement.value != '');
        ;
    };
    AutoComplete.prototype.updateInputField = function () {
        var formattedValue = this.value ? (this.field ? this.objectUtils.resolveFieldData(this.value, this.field) || '' : this.value) : '';
        this.inputFieldValue = formattedValue;
        if (this.inputEL && this.inputEL.nativeElement) {
            this.inputEL.nativeElement.value = formattedValue;
        }
        this.updateFilledState();
    };
    AutoComplete.prototype.bindDocumentClickListener = function () {
        var _this = this;
        this.selectedHidden = false;
        if (!this.documentClickListener) {
            this.documentClickListener = this.renderer.listen('document', 'click', function (event) {
                if (event.which === 3) {
                    return;
                }
                if (!_this.inputClick && !_this.itemSelect && !_this.multiConteinerClick) {
                    _this.hide();
                    if (_this.multiple) {
                        _this.savedInputValue = _this.multiInputEL.nativeElement.value;
                        _this.multiInputEL.nativeElement.value = '';
                    }
                    if (_this.value && _this.value.length)
                        _this.selectedHidden = true;
                }
                _this.inputClick = false;
                _this.itemSelect = false;
                _this.multiConteinerClick = false;
                _this.cd.markForCheck();
            });
        }
    };
    AutoComplete.prototype.unbindDocumentClickListener = function () {
        if (this.documentClickListener) {
            this.documentClickListener();
            this.documentClickListener = null;
        }
    };
    AutoComplete.prototype.bindScrollListener = function () {
        var _this = this;
        this.zone.runOutsideAngular(function () {
            _this.inlineScrollListener = _this.onInlineScroll.bind(_this);
            _this.panelEL.nativeElement.addEventListener('scroll', _this.inlineScrollListener);
        });
    };
    AutoComplete.prototype.unbindScrollListener = function () {
        this.panelEL.nativeElement.removeEventListener('scroll', this.inlineScrollListener);
    };
    AutoComplete.prototype.onInlineScroll = function (event) {
        var _this = this;
        var scrollTop = this.panelEL.nativeElement.scrollTop;
        var scrollHeight = this.panelEL.nativeElement.scrollHeight;
        var viewportHeight = this.panelEL.nativeElement.clientHeight;
        var queryValue = this.multiple ? this.multiInputEL.nativeElement.value : this.inputEL.nativeElement.value;
        if ((scrollTop >= ((scrollHeight * this.buffer) - (viewportHeight)))) {
            if (this.shouldLoad()) {
                this.zone.run(function () {
                    _this.search(event, queryValue);
                });
            }
        }
    };
    AutoComplete.prototype.shouldLoad = function () {
        if (this.lazy)
            return ((this.rows * this.page < this.totalRecords) && !this.searching);
        else
            return this.suggestions && this.suggestions.length && (this.rows * this.page < this.suggestions.length);
    };
    AutoComplete.prototype.ngOnDestroy = function () {
        this.unbindDocumentClickListener();
        if (this.appendTo) {
            this.el.nativeElement.appendChild(this.panelEL.nativeElement);
        }
        this.unbindScrollListener();
    };
    AutoComplete.decorators = [
        { type: core_1.Component, args: [{
                    selector: 'p-autoComplete',
                    template: "\n        <span\n            [ngClass]=\"{'ui-autocomplete ui-widget':true,'ui-autocomplete-dd':dropdown,'ui-autocomplete-multiple':multiple}\"\n            [ngStyle]=\"style\" [class]=\"styleClass\">\n            <input *ngIf=\"!multiple\" #in [attr.type]=\"type\" [attr.id]=\"inputId\" [ngStyle]=\"inputStyle\"\n                   [class]=\"inputStyleClass\" autocomplete=\"off\" [attr.required]=\"required\"\n                   [ngClass]=\"'ui-inputtext ui-widget ui-state-default ui-corner-all ui-autocomplete-input'\"\n                   [value]=\"inputFieldValue\"\n                   (click)=\"onInputClick($event)\" (input)=\"onInput($event)\" (keydown)=\"onKeydown($event)\"\n                   (keyup)=\"onKeyup($event)\" (focus)=\"onInputFocus($event)\" (blur)=\"onInputBlur($event)\"\n                   (change)=\"onInputChange($event)\"\n                   [attr.placeholder]=\"placeholder\" [attr.size]=\"size\" [attr.maxlength]=\"maxlength\"\n                   [attr.tabindex]=\"tabindex\" [readonly]=\"readonly\" [disabled]=\"disabled\"\n            ><span *ngIf=\"!multiple\" (click)=\"onInputClick($event)\" class=\"dropdown-triangle\" [style.top]=\"'15px'\" ></span>\n            <span class=\"reset-cross\" *ngIf=\"showResetButton()\" (click)=\"resetFilter()\" [title]=\"resetFilterTitle\">x</span>\n            <ul *ngIf=\"multiple\" #multiContainer (click)=\"onMultiContainerClick($event)\"\n                 class=\"ui-autocomplete-multiple-container ui-widget ui-inputtext ui-state-default ui-corner-all\"\n                 [ngClass]=\"{'ui-state-disabled':disabled,'ui-state-focus':focus}\" (click)=\"multiIn.focus()\">\n                <ng-container *ngIf=\"!selectedHidden\"><li #token *ngFor=\"let val of value\" class=\"ui-autocomplete-token ui-state-highlight ui-corner-all\">\n                    <span class=\"ui-autocomplete-token-icon pi pi-fw pi-times\" (click)=\"removeItem(token)\"\n                          *ngIf=\"!disabled\"></span>\n                    <span *ngIf=\"!selectedItemTemplate\"\n                          class=\"ui-autocomplete-token-label\">{{field ? objectUtils.resolveFieldData(val, field) : val}}</span>\n                    <ng-container *ngTemplateOutlet=\"selectedItemTemplate; context: {$implicit: val}\"></ng-container>\n                </li></ng-container>\n                <li class=\"ui-autocomplete-input-token\">\n                    <input #multiIn [attr.type]=\"type\" [attr.id]=\"inputId\" [disabled]=\"disabled\" [attr.title]=\"getTitle()\"\n                           [attr.placeholder]=\"getPlaceHolder()\" [attr.tabindex]=\"tabindex\"\n                           (input)=\"onInput($event)\" (click)=\"onInputClick($event)\"\n                           (keydown)=\"onKeydown($event)\" [readonly]=\"readonly\" (keyup)=\"onKeyup($event)\"\n                           (focus)=\"onInputFocus($event)\" (blur)=\"onInputBlur($event)\" (change)=\"onInputChange($event)\"\n                           autocomplete=\"off\" [ngStyle]=\"inputStyle\" [class]=\"inputStyleClass\"><span (click)=\"onInputClick($event)\" class=\"dropdown-triangle\" [style.top]=\"'50%'\"></span>\n                    <span class=\"reset-cross\" *ngIf=\"value && value.length && selectedHidden && this.multiple\" (click)=\"resetFilter()\" [title]=\"resetFilterTitle\">x</span>\n                </li>\n            </ul>\n            <div #panel class=\"ui-autocomplete-panel ui-widget-content ui-corner-all ui-shadow\"\n                 [style.display]=\"panelVisible ? 'block' : 'none'\" [style.width]=\"appendTo ? 'auto' : '100%'\"\n                 [style.max-height]=\"scrollHeight\">\n                <ul class=\"ui-autocomplete-items ui-autocomplete-list ui-widget-content ui-widget ui-corner-all ui-helper-reset\"\n                    *ngIf=\"panelVisible\">\n                    <li *ngFor=\"let option of suggestions | slice:first:(first + (page * rows)); let idx = index\"\n                        [ngClass]=\"{'ui-autocomplete-list-item ui-corner-all':true,'ui-state-highlight':(highlightOption==option)}\"\n                        (mouseenter)=\"highlightOption=option\" (mouseleave)=\"highlightOption=null\"\n                        (click)=\"selectItem(option)\">\n                        <span\n                            *ngIf=\"!itemTemplate\">{{field ? objectUtils.resolveFieldData(option, field) : option}}</span>\n                        <ng-container\n                            *ngTemplateOutlet=\"itemTemplate; context: {$implicit: option, index: idx}\"></ng-container>\n                    </li>\n                    <li *ngIf=\"noResults && emptyMessage\" class=\"ui-autocomplete-list-item ui-corner-all\">{{emptyMessage}}</li>\n                </ul>\n            </div>\n        </span>\n    ",
                    host: {
                        '[class.ui-inputwrapper-filled]': 'filled',
                        '[class.ui-inputwrapper-focus]': 'focus && !disabled'
                    },
                    providers: [domhandler_1.DomHandler, objectutils_1.ObjectUtils, exports.AUTOCOMPLETE_VALUE_ACCESSOR]
                },] },
    ];
    /** @nocollapse */
    AutoComplete.ctorParameters = function () { return [
        { type: core_1.ElementRef },
        { type: domhandler_1.DomHandler },
        { type: core_1.Renderer2 },
        { type: objectutils_1.ObjectUtils },
        { type: core_1.ChangeDetectorRef },
        { type: core_1.IterableDiffers },
        { type: core_1.NgZone }
    ]; };
    AutoComplete.propDecorators = {
        minLength: [{ type: core_1.Input }],
        delay: [{ type: core_1.Input }],
        selectedItemsLabel: [{ type: core_1.Input }],
        style: [{ type: core_1.Input }],
        styleClass: [{ type: core_1.Input }],
        inputStyle: [{ type: core_1.Input }],
        inputId: [{ type: core_1.Input }],
        inputStyleClass: [{ type: core_1.Input }],
        placeholder: [{ type: core_1.Input }],
        readonly: [{ type: core_1.Input }],
        disabled: [{ type: core_1.Input }],
        maxlength: [{ type: core_1.Input }],
        required: [{ type: core_1.Input }],
        size: [{ type: core_1.Input }],
        appendTo: [{ type: core_1.Input }],
        autoHighlight: [{ type: core_1.Input }],
        forceSelection: [{ type: core_1.Input }],
        type: [{ type: core_1.Input }],
        completeMethod: [{ type: core_1.Output }],
        onReset: [{ type: core_1.Output }],
        onSelect: [{ type: core_1.Output }],
        onUnselect: [{ type: core_1.Output }],
        onFocus: [{ type: core_1.Output }],
        onBlur: [{ type: core_1.Output }],
        onKeyUp: [{ type: core_1.Output }],
        field: [{ type: core_1.Input }],
        scrollHeight: [{ type: core_1.Input }],
        dropdown: [{ type: core_1.Input }],
        multiple: [{ type: core_1.Input }],
        tabindex: [{ type: core_1.Input }],
        dataKey: [{ type: core_1.Input }],
        emptyMessage: [{ type: core_1.Input }],
        immutable: [{ type: core_1.Input }],
        inputEL: [{ type: core_1.ViewChild, args: ['in',] }],
        multiInputEL: [{ type: core_1.ViewChild, args: ['multiIn',] }],
        panelEL: [{ type: core_1.ViewChild, args: ['panel',] }],
        multiContainerEL: [{ type: core_1.ViewChild, args: ['multiContainer',] }],
        dropdownButton: [{ type: core_1.ViewChild, args: ['ddBtn',] }],
        templates: [{ type: core_1.ContentChildren, args: [shared_1.PrimeTemplate,] }],
        resetFilterTitle: [{ type: core_1.Input }],
        optionsName: [{ type: core_1.Input }],
        rows: [{ type: core_1.Input }],
        lazy: [{ type: core_1.Input }],
        buffer: [{ type: core_1.Input }],
        totalRecords: [{ type: core_1.Input }],
        suggestions: [{ type: core_1.Input }]
    };
    return AutoComplete;
}());
exports.AutoComplete = AutoComplete;
var AutoCompleteModule = /** @class */ (function () {
    function AutoCompleteModule() {
    }
    AutoCompleteModule.decorators = [
        { type: core_1.NgModule, args: [{
                    imports: [common_1.CommonModule, inputtext_1.InputTextModule, button_1.ButtonModule, shared_1.SharedModule],
                    exports: [AutoComplete, shared_1.SharedModule],
                    declarations: [AutoComplete]
                },] },
    ];
    return AutoCompleteModule;
}());
exports.AutoCompleteModule = AutoCompleteModule;
//# sourceMappingURL=autocomplete.js.map