@ert78gb/ngx-select-ex
Version:
Angular based replacement for select boxes
3 lines (2 loc) • 26.5 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("escape-string-regexp"),require("@angular/core"),require("@angular/forms"),require("@angular/platform-browser"),require("rxjs/Subject"),require("rxjs/Observable"),require("rxjs/BehaviorSubject"),require("rxjs/add/observable/empty"),require("rxjs/add/observable/from"),require("rxjs/add/observable/of"),require("rxjs/add/operator/distinctUntilChanged"),require("rxjs/add/operator/combineLatest"),require("rxjs/add/operator/mergeMap"),require("rxjs/add/operator/toArray"),require("rxjs/add/operator/filter"),require("rxjs/add/operator/share"),require("rxjs/add/operator/merge"),require("rxjs/add/operator/map"),require("rxjs/add/operator/do"),require("lodash"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","escape-string-regexp","@angular/core","@angular/forms","@angular/platform-browser","rxjs/Subject","rxjs/Observable","rxjs/BehaviorSubject","rxjs/add/observable/empty","rxjs/add/observable/from","rxjs/add/observable/of","rxjs/add/operator/distinctUntilChanged","rxjs/add/operator/combineLatest","rxjs/add/operator/mergeMap","rxjs/add/operator/toArray","rxjs/add/operator/filter","rxjs/add/operator/share","rxjs/add/operator/merge","rxjs/add/operator/map","rxjs/add/operator/do","lodash","@angular/common"],t):t((e.ert78gb=e.ert78gb||{},e.ert78gb["ngx-select-ex"]={}),e.escapeString,e.ng.core,e.ng.forms,e.ng.platformBrowser,e.Rx,e.Rx,e.Rx,e.Rx.Observable,e.Rx.Observable,e.Rx.Observable,e.Rx.Observable.prototype,e.Rx.Observable.prototype,e.Rx.Observable.prototype,e.Rx.Observable.prototype,e.Rx.Observable.prototype,e.Rx.Observable.prototype,e.Rx.Observable.prototype,e.Rx.Observable.prototype,e.Rx.Observable.prototype,e._,e.ng.common)}(this,function(e,t,n,i,o,s,r,l,a,p,c,u,d,h,f,g,x,b,m,v,y,O){"use strict";var _=t,C=function(){function e(e,t,n,i,o){void 0===o&&(o=null),this.value=e,this.text=t,this.disabled=n,this.data=i,this._parent=o,this.type="option",this.cacheRenderedText=null}return Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),e.prototype.renderText=function(e,t){return this.cacheHighlightText===t&&null!==this.cacheRenderedText||(this.cacheHighlightText=t,this.cacheHighlightText?this.cacheRenderedText=e.bypassSecurityTrustHtml((this.text+"").replace(new RegExp(_(this.cacheHighlightText),"gi"),"<strong>$&</strong>")):this.cacheRenderedText=e.bypassSecurityTrustHtml(this.text)),this.cacheRenderedText},e}(),S=function(){function e(e,t){void 0===t&&(t=[]),this.label=e,this.options=t,this.type="optgroup",this.filter(function(){return!0})}return e.prototype.filter=function(e){this.optionsFiltered=this.options.filter(function(t){return e(t)})},e}(),T=function(){return function(e){this.template=e}}();T.decorators=[{type:n.Directive,args:[{selector:"[ngx-select-option]"}]}],T.ctorParameters=function(){return[{type:n.TemplateRef}]};var k=function(){return function(e){this.template=e}}();k.decorators=[{type:n.Directive,args:[{selector:"[ngx-select-option-selected]"}]}],k.ctorParameters=function(){return[{type:n.TemplateRef}]};var j=function(){return function(e){this.template=e}}();j.decorators=[{type:n.Directive,args:[{selector:"[ngx-select-option-not-found]"}]}],j.ctorParameters=function(){return[{type:n.TemplateRef}]};var w=y,E=t,F=new n.InjectionToken("NGX_SELECT_OPTIONS"),R={first:0,previous:1,next:2,last:3,firstSelected:4,firstIfOptionActiveInvisible:5};function I(e,t){return t in e}R[R.first]="first",R[R.previous]="previous",R[R.next]="next",R[R.last]="last",R[R.firstSelected]="firstSelected",R[R.firstIfOptionActiveInvisible]="firstIfOptionActiveInvisible";var A=function(){function e(e,t,i,o){var a,p=this;this.sanitizer=t,this.cd=i,this.optionValueField="id",this.optionTextField="text",this.optGroupLabelField="label",this.optGroupOptionsField="options",this.multiple=!1,this.allowClear=!1,this.placeholder="",this.noAutoComplete=!1,this.disabled=!1,this.defaultValue=[],this.autoSelectSingleOption=!1,this.autoClearSearch=!1,this.noResultsFound="No results found",this.size="default",this.autoActiveOnMouseEnter=!0,this.keyCodeToRemoveSelected="Delete",this.keyCodeToOptionsOpen="Enter",this.keyCodeToOptionsClose="Escape",this.keyCodeToOptionsSelect="Enter",this.keyCodeToNavigateFirst="ArrowLeft",this.keyCodeToNavigatePrevious="ArrowUp",this.keyCodeToNavigateNext="ArrowDown",this.keyCodeToNavigateLast="ArrowRight",this.typed=new n.EventEmitter,this.focus=new n.EventEmitter,this.blur=new n.EventEmitter,this.open=new n.EventEmitter,this.close=new n.EventEmitter,this.select=new n.EventEmitter,this.remove=new n.EventEmitter,this.navigated=new n.EventEmitter,this.selectionChanges=new n.EventEmitter,this.optionsOpened=!1,this.actualValue=[],this.subjOptions=new l.BehaviorSubject([]),this.subjSearchText=new l.BehaviorSubject(""),this.subjOptionsSelected=new l.BehaviorSubject([]),this.subjExternalValue=new l.BehaviorSubject([]),this.subjDefaultValue=new l.BehaviorSubject([]),this.subjRegisterOnChange=new s.Subject,this._focusToInput=!1,this.isFocused=!1,this.onChange=function(e){return e},this.onTouched=function(){return null},Object.assign(this,o),this.itemsDiffer=e.find([]).create(null),this.defaultValueDiffer=e.find([]).create(null),this.typed.subscribe(function(e){return p.subjSearchText.next(e)}),this.subjOptionsSelected.subscribe(function(e){return p.selectionChanges.emit(e)});var c=this.subjExternalValue.map(function(e){return a=null===e?[]:[].concat(e)}).merge(this.subjOptionsSelected.map(function(e){return e.map(function(e){return e.value})})).combineLatest(this.subjDefaultValue,function(e,t){var n=w.isEqual(e,t)?[]:e;return n.length?n:t}).distinctUntilChanged(function(e,t){return w.isEqual(e,t)}).share();c.combineLatest(this.subjRegisterOnChange,function(e){return e}).subscribe(function(e){p.actualValue=e,w.isEqual(e,a)||(a=e,p.multiple?p.onChange(e):p.onChange(e.length?e[0]:null))}),this.subjOptions.flatMap(function(e){return r.Observable.from(e).flatMap(function(e){return e instanceof C?r.Observable.of(e):e instanceof S?r.Observable.from(e.options):r.Observable.empty()}).toArray()}).combineLatest(c,function(e,t){var n,i,o=[];try{for(var s=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(e),r=s.next();!r.done;r=s.next()){var l=r.value;t.indexOf(l.value)>-1&&o.push(l)}}catch(a){n={error:a}}finally{try{r&&!r.done&&(i=s["return"])&&i.call(s)}finally{if(n)throw n.error}}w.isEqual(o,p.subjOptionsSelected.value)||(p.subjOptionsSelected.next(o),p.cd.markForCheck())}).subscribe(),this.subjOptions.combineLatest(this.subjOptionsSelected,this.subjSearchText,function(e,t,n){return p.optionsFiltered=p.filterOptions(n,e,t).map(function(e){return e instanceof C?e.highlightedText=p.highlightOption(e):e instanceof S&&e.options.map(function(e){return e.highlightedText=p.highlightOption(e),e}),e}),p.cacheOptionsFilteredFlat=null,p.navigateOption(R.firstIfOptionActiveInvisible),p.cd.markForCheck(),t}).flatMap(function(e){return p.optionsFilteredFlat().filter(function(t){return p.autoSelectSingleOption&&1===t.length&&!e.length})}).subscribe(function(e){p.subjOptionsSelected.next(e),p.cd.markForCheck()})}return e.prototype.setFormControlSize=function(e,t){void 0===e&&(e={}),void 0===t&&(t=!0);var n=t?{"form-control-sm input-sm":"small"===this.size,"form-control-lg input-lg":"large"===this.size}:{};return Object.assign(n,e)},e.prototype.setBtnSize=function(){return{"btn-sm":"small"===this.size,"btn-lg":"large"===this.size}},Object.defineProperty(e.prototype,"optionsSelected",{get:function(){return this.subjOptionsSelected.value},enumerable:!0,configurable:!0}),e.prototype.mainClicked=function(e){e.clickedSelectComponent=this,this.isFocused||(this.isFocused=!0,this.focus.emit())},e.prototype.documentClick=function(e){e.clickedSelectComponent!==this&&(this.optionsOpened&&(this.optionsClose(),this.cd.detectChanges()),this.isFocused&&(this.isFocused=!1,this.blur.emit()))},e.prototype.optionsFilteredFlat=function(){var e=this;return this.cacheOptionsFilteredFlat?r.Observable.of(this.cacheOptionsFilteredFlat):r.Observable.from(this.optionsFiltered).flatMap(function(e){return e instanceof C?r.Observable.of(e):e instanceof S?r.Observable.from(e.optionsFiltered):r.Observable.empty()}).filter(function(e){return!e.disabled}).toArray()["do"](function(t){return e.cacheOptionsFilteredFlat=t})},e.prototype.navigateOption=function(e){var t=this;this.optionsFilteredFlat().map(function(n){var i,o={index:-1,activeOption:null,filteredOptionList:n};switch(e){case R.first:o.index=0;break;case R.previous:i=n.indexOf(t.optionActive)-1,o.index=i>=0?i:n.length-1;break;case R.next:i=n.indexOf(t.optionActive)+1,o.index=i<n.length?i:0;break;case R.last:o.index=n.length-1;break;case R.firstSelected:t.subjOptionsSelected.value.length&&(o.index=n.indexOf(t.subjOptionsSelected.value[0]));break;case R.firstIfOptionActiveInvisible:var s=n.indexOf(t.optionActive);o.index=s>0?s:0}return o.activeOption=n[o.index],o}).subscribe(function(e){return t.optionActivate(e)})},e.prototype.ngDoCheck=function(){this.itemsDiffer.diff(this.items)&&this.subjOptions.next(this.buildOptions(this.items));var e=this.defaultValue?[].concat(this.defaultValue):[];this.defaultValueDiffer.diff(e)&&this.subjDefaultValue.next(e)},e.prototype.ngAfterContentChecked=function(){if(this._focusToInput&&this.checkInputVisibility()&&this.inputElRef&&this.inputElRef.nativeElement!==document.activeElement&&(this._focusToInput=!1,this.inputElRef.nativeElement.focus()),this.choiceMenuElRef){var e=this.choiceMenuElRef.nativeElement.querySelector("a.ngx-select__item_active.active");e&&e.offsetHeight>0&&this.ensureVisibleElement(e)}},e.prototype.canClearNotMultiple=function(){return this.allowClear&&!!this.subjOptionsSelected.value.length&&(!this.subjDefaultValue.value.length||this.subjDefaultValue.value[0]!==this.actualValue[0])},e.prototype.focusToInput=function(){this._focusToInput=!0},e.prototype.inputKeyDown=function(e){var t=[this.keyCodeToOptionsSelect,this.keyCodeToNavigateFirst,this.keyCodeToNavigatePrevious,this.keyCodeToNavigateNext,this.keyCodeToNavigateLast],n=[this.keyCodeToOptionsOpen,this.keyCodeToRemoveSelected];if(this.optionsOpened&&-1!==t.indexOf(e.code))switch(e.preventDefault(),e.stopPropagation(),e.code){case this.keyCodeToOptionsSelect:this.optionSelect(this.optionActive),this.navigateOption(R.next);break;case this.keyCodeToNavigateFirst:this.navigateOption(R.first);break;case this.keyCodeToNavigatePrevious:this.navigateOption(R.previous);break;case this.keyCodeToNavigateLast:this.navigateOption(R.last);break;case this.keyCodeToNavigateNext:this.navigateOption(R.next)}else if(!this.optionsOpened&&-1!==n.indexOf(e.code))switch(e.preventDefault(),e.stopPropagation(),e.code){case this.keyCodeToOptionsOpen:this.optionsOpen();break;case this.keyCodeToRemoveSelected:this.optionRemove(this.subjOptionsSelected.value[this.subjOptionsSelected.value.length-1],e)}},e.prototype.trackByOption=function(e,t){return t instanceof C?t.value:t instanceof S?t.label:t},e.prototype.checkInputVisibility=function(){return!0===this.multiple||this.optionsOpened&&!this.noAutoComplete},e.prototype.inputKeyUp=function(e,t){void 0===e&&(e=""),this.optionsOpened?this.typed.emit(e):!this.optionsOpened&&e?this.optionsOpen(e):t.code===this.keyCodeToOptionsClose&&this.optionsClose()},e.prototype.inputClick=function(e){void 0===e&&(e=""),this.optionsOpened||this.optionsOpen(e)},e.prototype.sanitize=function(e){return e?this.sanitizer.bypassSecurityTrustHtml(e):null},e.prototype.highlightOption=function(e){return this.inputElRef?e.renderText(this.sanitizer,this.inputElRef.nativeElement.value):e.renderText(this.sanitizer,"")},e.prototype.optionSelect=function(e,t){void 0===t&&(t=null),t&&(t.preventDefault(),t.stopPropagation()),e&&!e.disabled&&(this.subjOptionsSelected.next((this.multiple?this.subjOptionsSelected.value:[]).concat([e])),this.select.emit(e.value),this.optionsClose(),this.onTouched())},e.prototype.optionRemove=function(e,t){!this.disabled&&e&&(t.stopPropagation(),this.subjOptionsSelected.next((this.multiple?this.subjOptionsSelected.value:[]).filter(function(t){return t!==e})),this.remove.emit(e.value))},e.prototype.optionActivate=function(e){this.optionActive===e.activeOption||e.activeOption&&e.activeOption.disabled||(this.optionActive&&(this.optionActive.active=!1),this.optionActive=e.activeOption,this.optionActive&&(this.optionActive.active=!0),this.navigated.emit(e),this.cd.detectChanges())},e.prototype.onMouseEnter=function(e){this.autoActiveOnMouseEnter&&this.optionActivate(e)},e.prototype.filterOptions=function(e,t,n){var i=this,o=new RegExp(E(e),"i"),s=function(t){return i.searchCallback?i.searchCallback(e,t):(!e||o.test(t.text))&&(!i.multiple||-1===n.indexOf(t))};return t.filter(function(e){if(e instanceof C)return s(e);if(e instanceof S){var t=e;return t.filter(function(e){return s(e)}),t.optionsFiltered.length}})},e.prototype.ensureVisibleElement=function(e){var t=this;setTimeout(function(){if(t.choiceMenuElRef&&t.cacheElementOffsetTop!==e.offsetTop){t.cacheElementOffsetTop=e.offsetTop;var n=t.choiceMenuElRef.nativeElement;t.cacheElementOffsetTop<n.scrollTop?n.scrollTop=t.cacheElementOffsetTop:t.cacheElementOffsetTop+e.offsetHeight>n.scrollTop+n.clientHeight&&(n.scrollTop=t.cacheElementOffsetTop+e.offsetHeight-n.clientHeight)}})},e.prototype.optionsOpen=function(e){void 0===e&&(e=""),this.disabled||(this.optionsOpened=!0,this.subjSearchText.next(e),!this.multiple&&this.subjOptionsSelected.value.length?this.navigateOption(R.firstSelected):this.navigateOption(R.first),this.focusToInput(),this.open.emit(),this.cd.markForCheck())},e.prototype.optionsClose=function(){this.optionsOpened=!1,this.close.emit(),this.autoClearSearch&&this.multiple&&this.inputElRef&&(this.inputElRef.nativeElement.value=null)},e.prototype.buildOptions=function(e){var t,n=this,i=[];Array.isArray(e)&&e.forEach(function(e){if("object"==typeof e&&null!==e&&I(e,n.optGroupLabelField)&&I(e,n.optGroupOptionsField)&&Array.isArray(e[n.optGroupOptionsField])){var o=new S(e[n.optGroupLabelField]);e[n.optGroupOptionsField].forEach(function(e){(t=n.buildOption(e,o))&&o.options.push(t)}),i.push(o)}else(t=n.buildOption(e,null))&&i.push(t)});return i},e.prototype.buildOption=function(e,t){var n,i,o;if("string"==typeof e||"number"==typeof e)n=i=e,o=!1;else{if("object"!=typeof e||null===e||!I(e,this.optionValueField)&&!I(e,this.optionTextField))return null;n=I(e,this.optionValueField)?e[this.optionValueField]:e[this.optionTextField],i=I(e,this.optionTextField)?e[this.optionTextField]:e[this.optionValueField],o=!!I(e,"disabled")&&e.disabled}return new C(n,i,o,e,t)},e.prototype.writeValue=function(e){this.subjExternalValue.next(e)},e.prototype.registerOnChange=function(e){this.onChange=e,this.subjRegisterOnChange.next()},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this.disabled=e},e}();A.decorators=[{type:n.Component,args:[{selector:"ngx-select",template:'<div #main [tabindex]="disabled? -1: 0" class="ngx-select dropdown"\n [ngClass]="setFormControlSize({\n \'ngx-select_multiple form-control\': multiple === true,\n \'open show\': optionsOpened && optionsFiltered.length\n }, multiple === true)"\n (click)="mainClicked($event)" (focusin)="mainClicked($event)"\n (focus)="focusToInput()" (keydown)="inputKeyDown($event)">\n <div [ngClass]="{ \'ngx-select__disabled\': disabled}"></div>\n \x3c!-- single selected item --\x3e\n <div class="ngx-select__selected"\n *ngIf="(multiple === false) && (!optionsOpened || noAutoComplete)">\n <div class="ngx-select__toggle btn form-control" [ngClass]="setFormControlSize(setBtnSize())"\n (click)="optionsOpen()">\n <span *ngIf="!optionsSelected.length" class="ngx-select__placeholder text-muted">\n <span [innerHtml]="placeholder"></span>\n </span>\n <span *ngIf="optionsSelected.length"\n class="ngx-select__selected-single pull-left float-left"\n [ngClass]="{\'ngx-select__allow-clear\': allowClear}">\n <ng-container [ngTemplateOutlet]="templateSelectedOption || defaultTemplateOption"\n [ngTemplateOutletContext]="{$implicit: optionsSelected[0], index: 0,\n text: sanitize(optionsSelected[0].text)}">\n </ng-container>\n </span>\n <span class="ngx-select__toggle-buttons">\n <a class="ngx-select__clear btn btn-sm btn-link" *ngIf="canClearNotMultiple()"\n [ngClass]="setBtnSize()"\n (click)="optionRemove(optionsSelected[0], $event)">\n <i class="ngx-select__clear-icon"></i>\n </a>\n <i class="dropdown-toggle"></i>\n <i class="ngx-select__toggle-caret caret"></i>\n </span>\n </div>\n </div>\n \x3c!-- multiple selected items --\x3e\n <div class="ngx-select__selected" *ngIf="multiple === true">\n <span *ngFor="let option of optionsSelected; trackBy: trackByOption; let idx = index">\n <span tabindex="-1" [ngClass]="setBtnSize()"\n class="ngx-select__selected-plural btn btn-default btn-secondary btn-xs">\n <ng-container [ngTemplateOutlet]="templateSelectedOption || defaultTemplateOption"\n [ngTemplateOutletContext]="{$implicit: option, index: idx, text: sanitize(option.text)}">\n </ng-container>\n <a class="ngx-select__clear btn btn-sm btn-link pull-right float-right" [ngClass]="setBtnSize()"\n (click)="optionRemove(option, $event)">\n <i class="ngx-select__clear-icon"></i>\n </a>\n </span>\n </span>\n </div>\n \x3c!-- live search an item from the list --\x3e\n <input #input type="text" class="ngx-select__search form-control" [ngClass]="setFormControlSize()"\n *ngIf="checkInputVisibility()"\n [tabindex]="multiple === false? -1: 0"\n (keyup)="inputKeyUp(input.value, $event)"\n [disabled]="disabled"\n [placeholder]="optionsSelected.length? \'\': placeholder"\n (click)="inputClick(input.value)"\n autocomplete="off"\n autocorrect="off"\n autocapitalize="off"\n spellcheck="false"\n role="combobox">\n \x3c!-- options template --\x3e\n <ul #choiceMenu role="menu" *ngIf="isFocused" class="ngx-select__choices dropdown-menu"\n [class.show]="optionsOpened">\n <li class="ngx-select__item-group" role="menuitem"\n *ngFor="let opt of optionsFiltered; trackBy: trackByOption; let idxGroup=index">\n <div class="divider dropdown-divider" *ngIf="opt.type === \'optgroup\' && (idxGroup > 0)"></div>\n <div class="dropdown-header" *ngIf="opt.type === \'optgroup\'">{{opt.label}}</div>\n <a href="#" #choiceItem class="ngx-select__item dropdown-item"\n *ngFor="let option of (opt.optionsFiltered || [opt]); trackBy: trackByOption; let idxOption = index"\n [ngClass]="{\n \'ngx-select__item_active active\': option.active,\n \'ngx-select__item_disabled disabled\': option.disabled\n }"\n (mouseenter)="onMouseEnter({\n activeOption: option,\n filteredOptionList: optionsFiltered,\n index: idxOption\n })"\n (click)="optionSelect(option, $event)">\n <ng-container [ngTemplateOutlet]="templateOption || defaultTemplateOption"\n [ngTemplateOutletContext]="{$implicit: option, text: option.highlightedText,\n index: idxGroup, subIndex: idxOption}"></ng-container>\n </a>\n </li>\n <li class="ngx-select__item ngx-select__item_no-found dropdown-header" *ngIf="!optionsFiltered.length">\n <ng-container [ngTemplateOutlet]="templateOptionNotFound || defaultTemplateOptionNotFound"></ng-container>\n </li>\n </ul>\n \x3c!--Default templates--\x3e\n <ng-template #defaultTemplateOption let-text="text">\n <span [innerHtml]="text"></span>\n </ng-template>\n <ng-template #defaultTemplateOptionNotFound>\n {{noResultsFound}}\n </ng-template>\n</div>\n',styles:[".ngx-select{ }\n .ngx-select_multiple{\n height:auto;\n padding:3px 3px 0 3px; }\n .ngx-select_multiple .ngx-select__search{\n background-color:transparent !important;\n border:none;\n outline:none;\n -webkit-box-shadow:none;\n box-shadow:none;\n height:1.6666em;\n padding:0;\n margin-bottom:3px; }\n .ngx-select__disabled{\n background-color:#eceeef;\n border-radius:4px;\n position:absolute;\n width:100%;\n height:100%;\n z-index:5;\n opacity:0.6;\n top:0;\n left:0;\n cursor:not-allowed; }\n .ngx-select__toggle{\n outline:0;\n position:relative;\n text-align:left !important;\n color:#333;\n background-color:#fff;\n border-color:#ccc;\n display:-webkit-inline-box;\n display:-ms-inline-flexbox;\n display:inline-flex;\n -webkit-box-align:stretch;\n -ms-flex-align:stretch;\n align-items:stretch;\n -webkit-box-pack:justify;\n -ms-flex-pack:justify;\n justify-content:space-between; }\n .ngx-select__toggle:hover{\n color:#333;\n background-color:#e6e6e6;\n border-color:#adadad; }\n .ngx-select__toggle-buttons{\n -ms-flex-negative:0;\n flex-shrink:0;\n display:-webkit-box;\n display:-ms-flexbox;\n display:flex;\n -webkit-box-align:center;\n -ms-flex-align:center;\n align-items:center; }\n .ngx-select__toggle-caret{\n position:absolute;\n height:10px;\n top:50%;\n right:10px;\n margin-top:-2px; }\n .ngx-select__placeholder{\n float:left; }\n .ngx-select__clear{\n margin-right:10px;\n padding:0;\n border:none; }\n .ngx-select_multiple .ngx-select__clear{\n line-height:initial;\n margin-left:5px;\n margin-right:0;\n color:#000;\n opacity:.5; }\n .ngx-select__clear-icon{\n display:inline-block;\n font-size:inherit;\n cursor:pointer;\n position:relative;\n width:1em;\n height:.75em;\n padding:0; }\n .ngx-select__clear-icon:before, .ngx-select__clear-icon:after{\n content:'';\n position:absolute;\n border-top:3px solid;\n width:100%;\n top:50%;\n left:0;\n margin-top:-1px; }\n .ngx-select__clear-icon:before{\n -webkit-transform:rotate(45deg);\n transform:rotate(45deg); }\n .ngx-select__clear-icon:after{\n -webkit-transform:rotate(-45deg);\n transform:rotate(-45deg); }\n .ngx-select__choices{\n width:100%;\n height:auto;\n max-height:200px;\n overflow-x:hidden;\n margin-top:0;\n position:absolute; }\n .ngx-select_multiple .ngx-select__choices{\n margin-top:1px; }\n .ngx-select__item{\n display:block;\n padding:3px 20px;\n clear:both;\n font-weight:400;\n line-height:1.42857143;\n white-space:nowrap;\n cursor:pointer;\n text-decoration:none; }\n .ngx-select__item_disabled, .ngx-select__item_no-found{\n cursor:default; }\n .ngx-select__item_active{\n color:#fff;\n outline:0;\n background-color:#428bca; }\n .ngx-select__selected-single, .ngx-select__selected-plural{\n display:-webkit-inline-box;\n display:-ms-inline-flexbox;\n display:inline-flex;\n -webkit-box-align:center;\n -ms-flex-align:center;\n align-items:center;\n overflow:hidden; }\n .ngx-select__selected-single span, .ngx-select__selected-plural span{\n overflow:hidden;\n text-overflow:ellipsis; }\n .ngx-select__selected-plural{\n outline:0;\n margin:0 3px 3px 0; }\n.input-group > .dropdown{\n position:static; }\n"],changeDetection:n.ChangeDetectionStrategy.OnPush,providers:[{provide:i.NG_VALUE_ACCESSOR,useExisting:n.forwardRef(function(){return A}),multi:!0}]}]}],A.ctorParameters=function(){return[{type:n.IterableDiffers},{type:o.DomSanitizer},{type:n.ChangeDetectorRef},{type:undefined,decorators:[{type:n.Inject,args:[F]},{type:n.Optional}]}]},A.propDecorators={items:[{type:n.Input}],optionValueField:[{type:n.Input}],optionTextField:[{type:n.Input}],optGroupLabelField:[{type:n.Input}],optGroupOptionsField:[{type:n.Input}],multiple:[{type:n.Input}],allowClear:[{type:n.Input}],placeholder:[{type:n.Input}],noAutoComplete:[{type:n.Input}],disabled:[{type:n.Input}],defaultValue:[{type:n.Input}],autoSelectSingleOption:[{type:n.Input}],autoClearSearch:[{type:n.Input}],noResultsFound:[{type:n.Input}],size:[{type:n.Input}],searchCallback:[{type:n.Input}],autoActiveOnMouseEnter:[{type:n.Input}],typed:[{type:n.Output}],focus:[{type:n.Output}],blur:[{type:n.Output}],open:[{type:n.Output}],close:[{type:n.Output}],select:[{type:n.Output}],remove:[{type:n.Output}],navigated:[{type:n.Output}],selectionChanges:[{type:n.Output}],mainElRef:[{type:n.ViewChild,args:["main"]}],inputElRef:[{type:n.ViewChild,args:["input"]}],choiceMenuElRef:[{type:n.ViewChild,args:["choiceMenu"]}],templateOption:[{type:n.ContentChild,args:[T,{read:n.TemplateRef}]}],templateSelectedOption:[{type:n.ContentChild,args:[k,{read:n.TemplateRef}]}],templateOptionNotFound:[{type:n.ContentChild,args:[j,{read:n.TemplateRef}]}],documentClick:[{type:n.HostListener,args:["document:focusin",["$event"]]},{type:n.HostListener,args:["document:click",["$event"]]}]};var N=function(){function e(){}return e.forRoot=function(t){return{ngModule:e,providers:[{provide:F,useValue:t}]}},e}();N.decorators=[{type:n.NgModule,args:[{imports:[O.CommonModule],declarations:[A,T,k,j],exports:[A,T,k,j]}]}],N.ctorParameters=function(){return[]},e.NgxSelectModule=N,e.NGX_SELECT_OPTIONS=F,e.NgxSelectComponent=A,e.NgxSelectOption=C,e.NgxSelectOptGroup=S,e.NgxSelectOptionDirective=T,e.NgxSelectOptionSelectedDirective=k,e.NgxSelectOptionNotFoundDirective=j,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=ert78gb-ngx-select-ex.umd.min.js.map