@hxui/angular
Version:
This README includes the steps that are necessary to import the HxUi-angular into a project or to contribute with development.
1 lines • 107 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/forms"),require("@angular/common"),require("rxjs/operators"),require("@angular/cdk/a11y"),require("lodash"),require("array-sort-by"),require("rxjs"),require("@angular/cdk/portal"),require("@angular/cdk/overlay"),require("@angular/cdk/bidi"),require("@angular/platform-browser"),require("@angular/common/http"),require("@angular/router")):"function"==typeof define&&define.amd?define("@hxui/angular",["exports","@angular/core","@angular/forms","@angular/common","rxjs/operators","@angular/cdk/a11y","lodash","array-sort-by","rxjs","@angular/cdk/portal","@angular/cdk/overlay","@angular/cdk/bidi","@angular/platform-browser","@angular/common/http","@angular/router"],e):e((t.hxui=t.hxui||{},t.hxui.angular={}),t.ng.core,t.ng.forms,t.ng.common,t.rxjs.operators,t.ng.cdk.a11y,null,null,t.rxjs,t.ng.cdk.portal,t.ng.cdk.overlay,t.ng.cdk.bidi,t.ng.platformBrowser,t.ng.common.http,t.ng.router)}(this,function(t,a,e,n,i,o,r,s,c,l,p,h,u,d,f){"use strict";s=s&&s.hasOwnProperty("default")?s["default"]:s;var g=function(){function t(){}return t.prototype.position=function(t,e){var n;void 0===e&&(e=!0);var i={width:0,height:0,top:0,bottom:0,left:0,right:0};if("fixed"===this.getStyle(t,"position"))n=t.getBoundingClientRect();else{var o=this.offsetParent(t);n=this.offset(t,!1),o!==document.documentElement&&(i=this.offset(o,!1)),i.top+=o.clientTop,i.left+=o.clientLeft}return n.top-=i.top,n.bottom-=i.top,n.left-=i.left,n.right-=i.left,e&&(n.top=Math.round(n.top),n.bottom=Math.round(n.bottom),n.left=Math.round(n.left),n.right=Math.round(n.right)),n},t.prototype.offset=function(t,e){void 0===e&&(e=!0);var n=t.getBoundingClientRect(),i=window.pageYOffset-document.documentElement.clientTop,o=window.pageXOffset-document.documentElement.clientLeft,r={height:n.height||t.offsetHeight,width:n.width||t.offsetWidth,top:n.top+i,bottom:n.bottom+i,left:n.left+o,right:n.right+o};return e&&(r.height=Math.round(r.height),r.width=Math.round(r.width),r.top=Math.round(r.top),r.bottom=Math.round(r.bottom),r.left=Math.round(r.left),r.right=Math.round(r.right)),r},t.prototype.positionElements=function(t,e,n,i){var o=i?this.offset(t,!1):this.position(t,!1),r={left:o.left,center:o.left+o.width/2-e.offsetWidth/2,right:o.left+o.width},s={top:o.top,center:o.top+o.height/2-e.offsetHeight/2,bottom:o.top+o.height},a=e.getBoundingClientRect(),c=n.split(" ")[0]||"top",l=n.split(" ")[1]||"center",p={height:a.height||e.offsetHeight,width:a.width||e.offsetWidth,top:0,bottom:a.height||e.offsetHeight,left:0,right:a.width||e.offsetWidth};switch(c){case"top":p.top=o.top-e.offsetHeight,p.bottom+=o.top-e.offsetHeight,p.left=r[l],p.right+=r[l];break;case"bottom":p.top=s[c],p.bottom+=s[c],p.left=r[l],p.right+=r[l];break;case"left":p.top=s[l],p.bottom+=s[l],p.left=o.left-e.offsetWidth,p.right+=o.left-e.offsetWidth;break;case"right":p.top=s[l],p.bottom+=s[l],p.left=r[c],p.right+=r[c]}return p.top=Math.round(p.top),p.bottom=Math.round(p.bottom),p.left=Math.round(p.left),p.right=Math.round(p.right),p},t.prototype.getStyle=function(t,e){return window.getComputedStyle(t)[e]},t.prototype.isStaticPositioned=function(t){return"static"===(this.getStyle(t,"position")||"static")},t.prototype.offsetParent=function(t){for(var e=t.offsetParent||document.documentElement;e&&e!==document.documentElement&&this.isStaticPositioned(e);)e=e.offsetParent;return e||document.documentElement},t}(),y=new g;function m(t,e,n,i){var o=y.positionElements(t,e,n,i);e.style.top=o.top+"px",e.style.left=o.left+"px"}var v=function(){function t(){}return t.prototype.position=function(t){var e=t.element,n=t.target,i=t.attachment,o=t.appendToBody;m(this._getHtmlElement(n),this._getHtmlElement(e),i,o)},t.prototype.isElementBelowTheFold=function(t){var e=t.getBoundingClientRect();return e.top+e.height>document.body.clientHeight},t.prototype._getHtmlElement=function(t){return"string"==typeof t?document.querySelector(t):t instanceof a.ElementRef?t.nativeElement:t},t.decorators=[{type:a.Injectable}],t}(),b=function(){},x=function(){function t(t){this.element=t}return t.prototype.onInput=function(){this.resize()},t.prototype.ngAfterViewInit=function(){var t=this.element.nativeElement.style;t.overflow="hidden",t.height="auto"},t.prototype.resize=function(){var t=this.element.nativeElement;t.style.height!==t.scrollHeight+"px"&&(t.style.overflow="hidden",t.style.height="auto",t.style.height=t.scrollHeight+"px")},t.decorators=[{type:a.Directive,args:[{selector:"textarea[autogrow]"}]}],t.ctorParameters=function(){return[{type:a.ElementRef}]},t.propDecorators={onInput:[{type:a.HostListener,args:["input",["$event.target"]]}]},t}(),w=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[]}},t.decorators=[{type:a.NgModule,args:[{declarations:[x],exports:[x]}]}],t}(),_=function(){function t(t,e){this.hostElement=t,this.positioningService=e,this.onDateSelected=new a.EventEmitter,this.days=new Array,this.week=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],this.cellCount=41}return t.prototype.renderCalendar=function(){for(var t=0;t<=this.cellCount;t++){var e=new Date(this.viewDate.getFullYear(),this.viewDate.getMonth()),n=0===e.getDay()?7:e.getDay();this.days[t]=new Date(e.setDate(2-n+t))}},t.prototype.positionCalendar=function(){var t=this.hostElement.nativeElement.getBoundingClientRect();this.positioningService.isElementBelowTheFold(this.hostElement.nativeElement)&&(this.hostElement.nativeElement.style.top=t.top-(t.top+t.height+10)+"px")},t.prototype.previousMonth=function(){this.viewDate=new Date(this.viewDate.getFullYear(),this.viewDate.getMonth()-1),this.renderCalendar()},t.prototype.nextMonth=function(){this.viewDate=new Date(this.viewDate.getFullYear(),this.viewDate.getMonth()+1),this.renderCalendar()},t.prototype.isCurrentMonth=function(t){return t.getMonth()===this.viewDate.getMonth()},t.prototype.isCurrentDay=function(t){return t.getTime()===this.presentDate.getTime()},t.prototype.isSelectedDay=function(t){return!!this.selectedDate&&t.getTime()===this.selectedDate.getTime()},t.prototype.isInvalidDay=function(e){return this.validators.map(function(t){return t(e)}).reduce(function(t,e){return t||e},!1)},t.prototype.setSelectedDate=function(t){this.isInvalidDay(t)||(this.selectedDate=t,this.onDateSelected.emit(t))},t.prototype.ngOnChanges=function(t){t.selectedDate.currentValue&&(this.viewDate=new Date(this.selectedDate.getFullYear(),this.selectedDate.getMonth()))},t.prototype.ngOnInit=function(){var t=new Date;this.presentDate=new Date(t.getFullYear(),t.getMonth(),t.getDate()),this.viewDate=this.viewDate||new Date(t.getFullYear(),t.getMonth()),this.renderCalendar(),this.positionCalendar()},t.decorators=[{type:a.Component,args:[{selector:"hxa-datepicker",template:'<div class="hxui-reset">\n <div class="hx-card hxa-datepicker-container">\n <div class="hx-card-header hxa-datepicker-header">\n <div class="hxa-datepicker-month">\n <div class="hxa-datepicker-icon" title="Previous Month" (click)="previousMonth()">\n <a class="hx-button is-transparent"><i class="hx-icon icon-angle-left"></i></a>\n </div>\n <div class="hxa-datepicker-month-title">\n <span>{{viewDate.toLocaleString("en-au", { month: "long", year: "numeric" })}}</span></div>\n <div class="hxa-datepicker-icon" title="Next Month" (click)="nextMonth()">\n <a class="hx-button is-transparent"><i class="hx-icon icon-angle-right"></i></a>\n </div>\n </div>\n <div class="hxa-datepicker-week">\n <div class="hxa-datepicker-weekday" *ngFor="let weekday of week">\n {{weekday | slice:0:3}}\n </div>\n </div>\n </div>\n <div class="hxa-datepicker-contents">\n <div class="hxa-datepicker-day" *ngFor="let day of days" \n [ngClass]="{\'hxa-datepicker-day-siblingmonth\': !isCurrentMonth(day), \n \'hxa-datepicker-day-currentday\': isCurrentDay(day),\n \'hxa-datepicker-day-selectedday\': isSelectedDay(day),\n \'hxa-datepicker-day-invalidday\': isInvalidDay(day)}"\n (click)="setSelectedDate(day)">\n <a class="hx-button is-transparent">{{day.getDate()}}</a>\n </div>\n </div>\n </div>\n</div>',styles:[".hxa-datepicker-container{max-width:21em;width:21em;height:24em;display:flex;flex-direction:column;font-size:1rem}.hxa-datepicker-header{padding:1rem 1rem 0;flex-direction:column;align-items:initial;justify-content:space-around;font-weight:100}.hxa-datepicker-icon{cursor:pointer;display:flex;flex:1;flex-direction:column;justify-content:center;align-items:center}.hxa-datepicker-icon .hx-button{position:initial!important;top:initial!important}.hxa-datepicker-icon .hx-button.is-transparent:hover{color:#000}.hxa-datepicker-icon .hx-icon{font-size:2.3em;position:initial!important;top:initial!important;color:#0d4d78}.hxa-datepicker-month{display:flex;text-align:center;margin-bottom:1rem}.hxa-datepicker-month-title{font-size:1.5em;flex:3;display:flex;justify-content:center;align-items:center;color:#0d4d78}.hxa-datepicker-week{display:flex;width:100%;text-align:center}.hxa-datepicker-weekday{flex:1;color:#0d4d78}.hxa-datepicker-contents{padding:1rem;background-color:rgba(246,246,249,.5);display:flex;flex-flow:row wrap;flex:1;justify-content:space-around;align-content:space-around}.hxa-datepicker-day{flex:1 1 14%;height:16.666%;display:flex;justify-content:center;align-items:center}.hxa-datepicker-day .hx-button{position:initial;top:initial;flex:1;font-weight:400;height:100%;padding:0;color:#41b987}.hxa-datepicker-day-siblingmonth .hx-button{color:#3b3b3b;font-weight:100}.hxa-datepicker-day-selectedday .hx-button{color:#fff;background:#41b987}.hxa-datepicker-day-invalidday .hx-button{color:#e0e0e1!important;pointer-events:none}.hxa-datepicker-day-currentday .hx-button{border:2px solid #41b987}"]}]}],t.ctorParameters=function(){return[{type:a.ElementRef},{type:v}]},t.propDecorators={selectedDate:[{type:a.Input}],validators:[{type:a.Input}],onDateSelected:[{type:a.Output}]},t}(),C=function(){function t(t){this.element=t,this.disabled=!1,this.readonly=!1,this.required=!1,this.defaultToPresentDate=!0,this.allowPreviousDates=!0,this.allowFutureDates=!0,this.dateFormat="dd/MM/y",this.placeholder="Date",this.align="bottom",this.from="",this.to="",this.onDateChange=new a.EventEmitter,this.visible=!1,this.dateValidators=new Array,this.onChanged=new Array,this.onTouched=new Array}return t.prototype.ngOnInit=function(){var t=this,e=new Date;this.presentDate=new Date(e.getFullYear(),e.getMonth(),e.getDate()),this.defaultToPresentDate&&setTimeout(function(){t.setDate(t.presentDate)});var n=this.parseDate(this.from)||new Date(-863e13),i=this.parseDate(this.to)||new Date(863e13);(this.from||this.to)&&(this.validateDateRange=this.createDateRangeValidator(n,i),this.dateValidators.push(this.validateDateRange.bind(this))),this.allowPreviousDates||this.dateValidators.push(this.validateIsNotBeforeDate.bind(this)),this.allowFutureDates||this.dateValidators.push(this.validateIsNotAfterDate.bind(this))},t.prototype.setDate=function(t){this.date=t,this.onDateChange.emit(t),this.propogateChange(t)},t.prototype.setVisible=function(){this.visible=!0},t.prototype.unsetVisible=function(){this.visible=!1},t.prototype.onClickOutsideComponent=function(t){this.element.nativeElement.firstChild.contains(t)||this.unsetVisible()},t.prototype.onDateSelectEvent=function(t){this.unsetVisible(),this.setDate(t)},t.prototype.onChange=function(t){var e=this.parseDate(t);""==t?this.setDate(null):e?this.setDate(e):this.propogateChange(t)},t.prototype.onFocus=function(){this.setVisible(),this.propogateTouched()},t.prototype.onTab=function(t){this.onChange(t),this.unsetVisible(),this.propogateTouched()},t.prototype.parseDate=function(t){var e=t.split(/[.,\/ -]/);if(3==e.length&&0!=e[2].length){var n=e.shift();e.splice(1,0,n);var i=Date.parse(e.join("/"));if(!isNaN(i))return new Date(i)}return null},t.prototype.validateIsNotBeforeDate=function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()<this.presentDate.getTime()},t.prototype.validateIsNotAfterDate=function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()>this.presentDate.getTime()},t.prototype.createDateRangeValidator=function(t,e){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),i=new Date(e.getFullYear(),e.getMonth(),e.getDate());return function(t){var e=new Date(t.getFullYear(),t.getMonth(),t.getDate());return!(n.getTime()<=e.getTime()&&e.getTime()<=i.getTime())}},t.prototype.writeValue=function(t){this.setDate(t)},t.prototype.registerOnChange=function(t){this.onChanged.push(t)},t.prototype.registerOnTouched=function(t){this.onTouched.push(t)},t.prototype.propogateTouched=function(){this.onTouched.forEach(function(t){return t()})},t.prototype.propogateChange=function(e){this.onChanged.forEach(function(t){return t(e)})},t.prototype.validate=function(t){var e=Date.parse(t.value);return this.required||null!==t.value&&t.value!==undefined?isNaN(e)?{dateParseError:{valid:this.isValid=!1}}:!this.allowPreviousDates&&this.validateIsNotBeforeDate(this.date)?{previousDateError:{valid:this.isValid=!1}}:!this.allowFutureDates&&this.validateIsNotAfterDate(this.date)?{futureDateError:{valid:this.isValid=!1}}:this.validateDateRange&&this.validateDateRange(this.date)?{dateRangeError:{valid:this.isValid=!1}}:this.required&&!this.date?{dateRequiredError:{valid:this.isValid=!1}}:(this.isValid=!0,null):(this.isValid=!0,null)},t.decorators=[{type:a.Component,args:[{selector:"hxa-datepicker-input, hxa-datepicker-form",template:'<div class="hx-input-group hxa-datepicker-form">\n <div class="hx-input-control" [ngClass]="{\'is-danger\': !isValid && datePickerForm.touched}">\n <input class="hx-input" type="text" #datePickerForm="ngModel"\n [required]="required ? true : null"\n [disabled]="disabled"\n [readonly]="readonly ? true : null"\n [ngModel]="date | date:dateFormat"\n (change)="onChange(datePickerForm.value)"\n (focus)="onFocus()"\n (keydown.Tab)="onTab(datePickerForm.value)">\n <label class="hx-label" *ngIf="placeholder">{{placeholder}} <sup *ngIf="required">*</sup></label>\n <div class="hx-help"></div>\n <div class="hxa-datepicker-help">Please select a date</div>\n </div>\n <i class="hx-icon icon-calendar"></i>\n <hxa-datepicker class="hxa-datepicker-calendar" *ngIf="visible" \n [selectedDate]="date"\n [validators]="dateValidators"\n (onDateSelected)="onDateSelectEvent($event)"\n [ngClass]="{\'hxa-datepicker-calendar-top\': align == \'top\', \'hxa-datepicker-calendar-bottom\': align == \'bottom\'}"></hxa-datepicker>\n</div>\n',styles:[".hxa-datepicker-form{position:relative;max-width:21rem}.hxa-datepicker-calendar{position:absolute;z-index:99;left:0}.hxa-datepicker-calendar-top{bottom:100%}.hxa-datepicker-calendar-bottom{top:70%}.hxa-datepicker-help{font-size:.75rem;margin-top:.25rem;color:#63605f}.hxa-datepicker-form input[readonly]~.hx-label{top:-.5rem;font-size:.75rem;color:#41b987}"],providers:[{provide:e.NG_VALUE_ACCESSOR,useExisting:a.forwardRef(function(){return t}),multi:!0},{provide:e.NG_VALIDATORS,useExisting:a.forwardRef(function(){return t}),multi:!0}]}]}],t.ctorParameters=function(){return[{type:a.ElementRef}]},t.propDecorators={disabled:[{type:a.Input}],readonly:[{type:a.Input}],required:[{type:a.Input}],defaultToPresentDate:[{type:a.Input}],allowPreviousDates:[{type:a.Input}],allowFutureDates:[{type:a.Input}],dateFormat:[{type:a.Input}],placeholder:[{type:a.Input}],align:[{type:a.Input}],from:[{type:a.Input}],to:[{type:a.Input}],onDateChange:[{type:a.Output}],onClickOutsideComponent:[{type:a.HostListener,args:["document:click",["$event.target"]]}]},t}(),P=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[]}},t.decorators=[{type:a.NgModule,args:[{imports:[n.CommonModule,e.FormsModule],declarations:[_,C],exports:[_,C]}]}],t}(),k=function(){function t(){this.autoClose=!0}return t.decorators=[{type:a.Injectable}],t}(),D=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};function I(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function T(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,o,r=n.call(t),s=[];try{for(;(void 0===e||0<e--)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(o)throw o.error}}return s}var O=function(t,e,n){this.nodes=t,this.viewRef=e,this.componentRef=n},R=function(){function t(t,e){this.open=t,this.close=e||t}return t.prototype.isManual=function(){return"manual"===this.open||"manual"===this.close},t}(),E={hover:["mouseenter","mouseleave"],focus:["focusin","focusout"]};function S(t,n){void 0===n&&(n=E);var e=(t||"").trim();if(0===e.length)return[];var i=e.split(/\s+/).map(function(t){return t.split(":")}).map(function(t){var e=n[t[0]]||t;return new R(e[0],e[1])}),o=i.filter(function(t){return t.isManual()});if(1<o.length)throw new Error("Triggers parse error: only one manual trigger is allowed");if(1===o.length&&1<i.length)throw new Error("Triggers parse error: manual trigger can't be mixed with other triggers");return i}function z(e,n,t,i,o,r){var s=S(t),a=[];return 1===s.length&&s[0].isManual()?Function.prototype:(s.forEach(function(t){t.open!==t.close?a.push(e.listen(n,t.open,i),e.listen(n,t.close,o)):a.push(e.listen(n,t.open,r))}),function(){a.forEach(function(t){return t()})})}var M=function(){function t(t,e,n,i,o,r,s){this.onBeforeShow=new a.EventEmitter,this.onShown=new a.EventEmitter,this.onBeforeHide=new a.EventEmitter,this.onHidden=new a.EventEmitter,this._providers=[],this._ngZone=r,this._injector=i,this._renderer=e,this._elementRef=n,this._posService=s,this._viewContainerRef=t,this._componentFactoryResolver=o}return Object.defineProperty(t.prototype,"isShown",{get:function(){return!!this._componentRef},enumerable:!0,configurable:!0}),t.prototype.attach=function(t){return this._componentFactory=this._componentFactoryResolver.resolveComponentFactory(t),this},t.prototype.to=function(t){return this.container=t||this.container,this},t.prototype.position=function(t){return this.attachment=t.attachment||this.attachment,this._elementRef=t.target||this._elementRef,this},t.prototype.provide=function(t){return this._providers.push(t),this},t.prototype.show=function(t){if(void 0===t&&(t={}),this._subscribePositioning(),!this._componentRef){this.onBeforeShow.emit(),this._contentRef=this._getContentRef(t.content);var e=a.ReflectiveInjector.resolveAndCreate(this._providers,this._injector);this._componentRef=this._viewContainerRef.createComponent(this._componentFactory,0,e,this._contentRef.nodes),this.instance=this._componentRef.instance,Object.assign(this._componentRef.instance,t),"body"===this.container&&"undefined"!=typeof document&&document.querySelector(this.container).appendChild(this._componentRef.location.nativeElement),this._componentRef.changeDetectorRef.markForCheck(),this.onShown.emit(this._componentRef.instance)}return this._componentRef},t.prototype.hide=function(){return this._componentRef&&(this.onBeforeHide.emit(this._componentRef.instance),this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._componentRef.hostView)),this._componentRef=null,this._contentRef.viewRef&&(this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._contentRef.viewRef)),this._contentRef=null),this._componentRef=null,this.onHidden.emit()),this},t.prototype.toggle=function(){this.isShown?this.hide():this.show()},t.prototype.dispose=function(){this.isShown&&this.hide(),this._unsubscribePositioning(),this._unregisterListenersFn&&this._unregisterListenersFn()},t.prototype.listen=function(t){var e=this;return this.triggers=t.triggers||this.triggers,t.target=t.target||this._elementRef,t.show=t.show||function(){return e.show()},t.hide=t.hide||function(){return e.hide()},t.toggle=t.toggle||function(){return e.isShown?t.hide():t.show()},this._unregisterListenersFn=z(this._renderer,t.target.nativeElement,this.triggers,t.show,t.hide,t.toggle),this},t.prototype._subscribePositioning=function(){var t=this;!this._zoneSubscription&&this.attachment&&(this._zoneSubscription=this._ngZone.onStable.subscribe(function(){t._componentRef&&t._posService.position({element:t._componentRef.location,target:t._elementRef,attachment:t.attachment,appendToBody:"body"===t.container})}))},t.prototype._unsubscribePositioning=function(){this._zoneSubscription&&(this._zoneSubscription.unsubscribe(),this._zoneSubscription=null)},t.prototype._getContentRef=function(t){if(!t)return new O([]);if(t instanceof a.TemplateRef){var e=this._viewContainerRef.createEmbeddedView(t);return new O([e.rootNodes],e)}return new O([[this._renderer.createText(""+t)]])},t}(),A=function(){function t(t,e,n,i){this._ngZone=e,this._injector=n,this._posService=i,this._componentFactoryResolver=t}return t.prototype.createLoader=function(t,e,n){return new M(e,n,t,this._injector,this._componentFactoryResolver,this._ngZone,this._posService)},t.decorators=[{type:a.Injectable}],t.ctorParameters=function(){return[{type:a.ComponentFactoryResolver},{type:a.NgZone},{type:a.Injector},{type:v}]},t}(),L=function(){function t(){var e=this;this.direction="down",this.isOpenChange=new a.EventEmitter,this.isDisabledChange=new a.EventEmitter,this.toggleClick=new a.EventEmitter,this.dropdownMenu=new Promise(function(t){e.resolveDropdownMenu=t}),this.isOpenChange.subscribe(function(t){e.isOpen=t})}return t.decorators=[{type:a.Injectable}],t.ctorParameters=function(){return[]},t}(),j=function(){function t(t){var e=this;this._state=t,this.isOpen=!1,this._subscription=t.isOpenChange.subscribe(function(t){e.isOpen=t})}return Object.defineProperty(t.prototype,"direction",{get:function(){return this._state.direction},enumerable:!0,configurable:!0}),t.prototype.ngOnDestroy=function(){this._subscription.unsubscribe()},t.decorators=[{type:a.Component,args:[{selector:"hx-dropdown-container",host:{style:"display:block;position: absolute;"},template:'\n <div [class.is-dropup]="direction === \'up\'"\n [class.is-dropdown]="direction === \'down\'"\n [class.is-open]="isOpen"><ng-content></ng-content></div>\n '}]}],t.ctorParameters=function(){return[{type:L}]},t}(),F=function(){function t(t,e,n,i,o,r){this._elementRef=t,this._renderer=e,this._viewContainerRef=n,this._cis=i,this._config=o,this._state=r,this._isInlineOpen=!1,this._isInlineRight=!1,this._subscriptions=[],this._isInited=!1,this._dropdown=this._cis.createLoader(this._elementRef,this._viewContainerRef,this._renderer).provide({provide:L,useValue:this._state}),this.onShown=this._dropdown.onShown,this.onHidden=this._dropdown.onHidden,this.isOpenChange=this._state.isOpenChange,this._state.autoClose=this._config.autoClose}return Object.defineProperty(t.prototype,"autoClose",{get:function(){return this._state.autoClose},set:function(t){"boolean"==typeof t&&(this._state.autoClose=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisabled",{get:function(){return this._isDisabled},set:function(t){this._isDisabled=t,this._state.isDisabledChange.emit(t),t&&this.hide()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRight",{get:function(){return this._isInlineRight},set:function(t){this._isInlineRight=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isOpen",{get:function(){return this._showInline?this._isInlineOpen:this._dropdown.isShown},set:function(t){t?this.show():this.hide()},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){var e=this;this._isInited||(this._isInited=!0,this._showInline=!this.container,this._dropdown.listen({triggers:this.triggers,show:function(){return e.show()}}),this._subscriptions.push(this._state.toggleClick.subscribe(function(t){return e.toggle(t)})),this._subscriptions.push(this._state.isDisabledChange.pipe(i.filter(function(t){return!0===t})).subscribe(function(t){return e.hide()})),this._showInline&&this._state.dropdownMenu.then(function(t){e._inlinedMenu=t.viewContainer.createEmbeddedView(t.templateRef)}))},t.prototype.show=function(){var i=this;if(!this.isOpen&&!this.isDisabled)return this._showInline?(this._isInlineOpen=!0,this.onShown.emit(!0),void this._state.isOpenChange.emit(!0)):void this._state.dropdownMenu.then(function(t){var e=!0===i.dropup||"undefined"!=typeof i.dropup&&!1!==i.dropup;i._state.direction=e?"up":"down";var n=i.placement||(e?"top left":"bottom left");i._dropdown.attach(j).to(i.container).position({attachment:n}).show({content:t.templateRef,placement:n}),i._state.isOpenChange.emit(!0)})},t.prototype.hide=function(){this.isOpen&&(this._showInline?(this._isInlineOpen=!1,this.onHidden.emit(!0)):this._dropdown.hide(),this._state.isOpenChange.emit(!1))},t.prototype.toggle=function(t){return this.isOpen||!1===t?this.hide():this.show()},t.prototype.ngOnDestroy=function(){try{for(var t=I(this._subscriptions),e=t.next();!e.done;e=t.next()){e.value.unsubscribe()}}catch(o){n={error:o}}finally{try{e&&!e.done&&(i=t["return"])&&i.call(t)}finally{if(n)throw n.error}}var n,i;this._dropdown.dispose()},t.decorators=[{type:a.Directive,args:[{selector:"[hxDropdown],[dropdown]",exportAs:"hx-dropdown",providers:[L],host:{"[class.is-dropup]":"dropup","[class.is-open]":"isOpen","[class.is-right]":"isRight"}}]}],t.ctorParameters=function(){return[{type:a.ElementRef},{type:a.Renderer2},{type:a.ViewContainerRef},{type:A},{type:k},{type:L}]},t.propDecorators={placement:[{type:a.Input}],triggers:[{type:a.Input}],container:[{type:a.Input}],dropup:[{type:a.Input}],autoClose:[{type:a.Input}],isDisabled:[{type:a.Input}],isRight:[{type:a.Input}],isOpen:[{type:a.Input}],isOpenChange:[{type:a.Output}],onShown:[{type:a.Output}],onHidden:[{type:a.Output}]},t}(),B=function(){function t(t,e,n){t.resolveDropdownMenu({templateRef:n,viewContainer:e})}return t.decorators=[{type:a.Directive,args:[{selector:"[hxDropdownMenu],[dropdownMenu]",exportAs:"hx-dropdown-menu"}]}],t.ctorParameters=function(){return[{type:L},{type:a.ViewContainerRef},{type:a.TemplateRef}]},t}(),N=function(){function t(t,e,n){var i=this;this._state=t,this._element=e,this._renderer=n,this._subscriptions=[],this._subscriptions.push(this._state.isOpenChange.subscribe(function(t){return i.isOpen=t})),this._subscriptions.push(this._state.isDisabledChange.subscribe(function(t){return i.isDisabled=t||!1}))}return t.prototype.onClick=function(t){this.isDisabled||(this._state.isOpen?this._state.toggleClick.emit(!1):this._state.toggleClick.emit(!0))},t.prototype.onDocumentClick=function(t){this._state.autoClose&&2!==t.button&&!this._element.nativeElement.contains(t.target)?this._state.toggleClick.emit(!1):this._element.nativeElement.parentNode.contains(t.target)||this._state.toggleClick.emit(!1)},t.prototype.onEsc=function(){this._state.autoClose&&this._state.toggleClick.emit(!1)},t.prototype.ngOnDestroy=function(){try{for(var t=I(this._subscriptions),e=t.next();!e.done;e=t.next()){e.value.unsubscribe()}}catch(o){n={error:o}}finally{try{e&&!e.done&&(i=t["return"])&&i.call(t)}finally{if(n)throw n.error}}var n,i},t.decorators=[{type:a.Directive,args:[{selector:"[hxDropdownToggle],[dropdownToggle]",exportAs:"hx-dropdown-toggle"}]}],t.ctorParameters=function(){return[{type:L},{type:a.ElementRef},{type:a.Renderer2}]},t.propDecorators={isDisabled:[{type:a.HostBinding,args:["attr.disabled"]}],isOpen:[{type:a.HostBinding,args:["class.is-active"]},{type:a.HostBinding,args:["attr.aria-expanded"]}],onClick:[{type:a.HostListener,args:["click",["$event"]]}],onDocumentClick:[{type:a.HostListener,args:["document:click",["$event"]]}],onEsc:[{type:a.HostListener,args:["keyup.esc"]}]},t}(),H=function(){function e(){}return e.forRoot=function(t){return{ngModule:e,providers:[v,L,{provide:k,useValue:t||{autoClose:!0}}]}},e.decorators=[{type:a.NgModule,args:[{declarations:[B,N,j,F],exports:[B,N,F],entryComponents:[j]}]}],e}(),V={None:0,Success:1,Warning:2,Danger:3,Info:4};V[V.None]="None",V[V.Success]="Success",V[V.Warning]="Warning",V[V.Danger]="Danger",V[V.Info]="Info";var U={Default:0,Small:1,Large:2};U[U.Default]="Default",U[U.Small]="Small",U[U.Large]="Large";var W={Hidden:0,Visible:1};W[W.Hidden]="Hidden",W[W.Visible]="Visible";var Y=function(){function t(){this.size=U.Default}return t.decorators=[{type:a.Injectable}],t}(),q=function(){function t(t){this.config=t,this.actions=[]}return t.prototype.ngOnInit=function(){},t.prototype.executeCallback=function(t,e){if(e.length)if(1===e.length)e[0]();else{for(var n=[],i=1;i<e.length;i++)n.push(e[i]);e[0].apply(this,n)}return!1},t.decorators=[{type:a.Component,args:[{selector:"hxa-empty-state",template:'<div class="hxui-reset emptyState">\n <i class="hx-icon is-lightest emptyState__icon" [ngClass]="icon"></i>\n <div class="emptySate__msg is-lighter">{{msg}}</div>\n <div class="emptyState__actions hx-flex">\n <button *ngFor="let action of actions"\n class="hx-button is-small"\n [attr.id]="action.id"\n [ngClass]="action.css"\n (click)=\'executeCallback($event,action.callback)\'>{{action.label}}</button>\n </div>\n</div>\n',styles:[":host { min-height: 12rem; width:100%; display:flex; flex-direction: column; flex:1;}",":host .emptyState { display:flex; justify-content: center; align-items: center; flex:1; margin: 1rem 0; }",":host .emptyState__icon { height:3.5rem; width:3.5rem; font-size:64px; margin: 1rem; }",":host .emptyState__msg { margin: 1rem; }",":host .emptyState__actions{ margin: 1.5rem 1rem ; }",":host .emptyState__actions button { margin: 0 .5rem; }"]}]}],t.ctorParameters=function(){return[{type:Y}]},t.propDecorators={icon:[{type:a.Input}],msg:[{type:a.Input}],actions:[{type:a.Input}]},t}(),G=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[Y]}},t.decorators=[{type:a.NgModule,args:[{imports:[n.CommonModule],declarations:[q],exports:[q]}]}],t}(),Z=function(){function t(){}return t.prototype.close=function(){this.destroy()},t}();function K(){return function(t){Object.assign(t.prototype,Z.prototype)}}var X=function(){function t(){}return t.prototype.dismiss=function(){this.close(),this.destroy()},t.decorators=[{type:a.Component,args:[{selector:"hx-modal-backdrop",template:'<div class="hx-modal-backdrop fade in" (click)="dismiss()"></div>'}]}],t=function(t,e,n,i){var o,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;0<=a;a--)(o=t[a])&&(s=(r<3?o(s):3<r?o(e,n,s):o(e,n))||s);return 3<r&&s&&Object.defineProperty(e,n,s),s}([K()],t)}(),J=function(){function t(t,e,n){this.componentFactoryResolver=t,this.focusTrapFactory=e,this.document=n,this.elementFocusedBeforeDialogWasOpened=null}return t.prototype.registerViewContainerRef=function(t){this.vcRef=t},t.prototype.registerInjector=function(t){this.injector=t},t.prototype.create=function(t,e){return this.backdropRef=this.dynamicComponentLoader(X),this.componentRef=this.dynamicComponentLoader(t,e),this.componentNativeElement=this.componentRef.location.nativeElement,this.trapFocus(),this.componentRef},t.prototype.close=function(){this.componentRef&&this.componentRef.destroy()},t.prototype.dynamicComponentLoader=function(t,e){var n=this,i=this.componentFactoryResolver.resolveComponentFactory(t),o=a.ReflectiveInjector.resolveAndCreate([],this.injector),r=this.vcRef.createComponent(i,0,o);return Object.assign(r.instance,e),r.instance.destroy=function(){n.backdropRef.destroy(),r.destroy(),n.restoreFocus()},r},t.prototype.trapFocus=function(){this.focusTrap=this.focusTrapFactory.create(this.componentNativeElement),this.savePreviouslyFocusedElement(),this.focusTrap.focusInitialElementWhenReady()},t.prototype.restoreFocus=function(){var t=this.elementFocusedBeforeDialogWasOpened;t&&"function"==typeof t.focus&&t.focus(),this.focusTrap&&this.focusTrap.destroy()},t.prototype.savePreviouslyFocusedElement=function(){this.document&&(this.elementFocusedBeforeDialogWasOpened=this.document.activeElement)},t.decorators=[{type:a.Injectable}],t.ctorParameters=function(){return[{type:a.ComponentFactoryResolver},{type:o.FocusTrapFactory},{type:undefined,decorators:[{type:a.Optional},{type:a.Inject,args:[n.DOCUMENT]}]}]},t}(),Q=function(){function t(t,e){this.modalService=t,this.injector=e}return t.prototype.ngOnInit=function(){this.modalService.registerViewContainerRef(this.viewContainerRef),this.modalService.registerInjector(this.injector)},t.decorators=[{type:a.Component,args:[{selector:"hx-modal-placeholder",template:"<div #modalPlaceholder></div>"}]}],t.ctorParameters=function(){return[{type:J},{type:a.Injector}]},t.propDecorators={viewContainerRef:[{type:a.ViewChild,args:["modalPlaceholder",{read:a.ViewContainerRef}]}]},t}(),tt=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[J]}},t.decorators=[{type:a.NgModule,args:[{declarations:[Q,X],exports:[Q],entryComponents:[X]}]}],t}(),et=function(){function t(){this.main={maxSize:void 0,itemsPerPage:10,boundaryLinks:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",pageBtnClass:"",rotate:!0,sticky:!1},this.pager={itemsPerPage:15,previousText:"Previous",nextText:"Next",pageBtnClass:"",align:!0}}return t.decorators=[{type:a.Injectable}],t}(),nt={provide:e.NG_VALUE_ACCESSOR,useExisting:a.forwardRef(function(){return it}),multi:!0},it=function(){function t(t,e,n){this.numPages=new a.EventEmitter,this.pageChanged=new a.EventEmitter,this.onChange=Function.prototype,this.onTouched=Function.prototype,this.inited=!1,this._page=1,this.renderer=t,this.elementRef=e,this.config||this.configureOptions(Object.assign({},n.main,n.pager))}return Object.defineProperty(t.prototype,"itemsPerPage",{get:function(){return this._itemsPerPage},set:function(t){this._itemsPerPage=t,this.totalPages=this.calculateTotalPages()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"totalItems",{get:function(){return this._totalItems},set:function(t){this._totalItems=t,this.totalPages=this.calculateTotalPages()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"totalPages",{get:function(){return this._totalPages},set:function(t){this._totalPages=t,this.numPages.emit(t),this.inited&&this.selectPage(this.page)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"page",{get:function(){return this._page},set:function(t){var e=this._page;this._page=t>this.totalPages?this.totalPages:t||1,e!==this._page&&void 0!==e&&this.pageChanged.emit({page:this._page,itemsPerPage:this.itemsPerPage})},enumerable:!0,configurable:!0}),t.prototype.configureOptions=function(t){this.config=Object.assign({},t)},t.prototype.ngOnInit=function(){this.classMap=this.elementRef.nativeElement.getAttribute("class")||"",this.maxSize="undefined"!=typeof this.maxSize?this.maxSize:this.config.maxSize,this.rotate="undefined"!=typeof this.rotate?this.rotate:this.config.rotate,this.boundaryLinks="undefined"!=typeof this.boundaryLinks?this.boundaryLinks:this.config.boundaryLinks,this.directionLinks="undefined"!=typeof this.directionLinks?this.directionLinks:this.config.directionLinks,this.pageBtnClass="undefined"!=typeof this.pageBtnClass?this.pageBtnClass:this.config.pageBtnClass,this.itemsPerPage="undefined"!=typeof this.itemsPerPage?this.itemsPerPage:this.config.itemsPerPage,this.totalPages=this.calculateTotalPages(),this.pages=this.getPages(this.page,this.totalPages),this.inited=!0},t.prototype.writeValue=function(t){this.page=t,this.pages=this.getPages(this.page,this.totalPages)},t.prototype.getText=function(t){return this[t+"Text"]||this.config[t+"Text"]},t.prototype.noPrevious=function(){return 1===this.page},t.prototype.noNext=function(){return this.page===this.totalPages},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.selectPage=function(t,e){if(e&&e.preventDefault(),!this.disabled){if(e&&e.target)e.target.blur();this.writeValue(t),this.onChange(this.page)}},t.prototype.makePage=function(t,e,n){return{text:e,number:t,active:n}},t.prototype.getPages=function(t,e){var n=[],i=1,o=e,r="undefined"!=typeof this.maxSize&&this.maxSize<e;r&&(this.rotate?e<(o=(i=Math.max(t-Math.floor(this.maxSize/2),1))+this.maxSize-1)&&(i=(o=e)-this.maxSize+1):(i=(Math.ceil(t/this.maxSize)-1)*this.maxSize+1,o=Math.min(i+this.maxSize-1,e)));for(var s=i;s<=o;s++){var a=this.makePage(s,s.toString(),s===t);n.push(a)}if(r&&!this.rotate){if(1<i){var c=this.makePage(i-1,"...",!1);n.unshift(c)}if(o<e){var l=this.makePage(o+1,"...",!1);n.push(l)}}return n},t.prototype.calculateTotalPages=function(){var t=this.itemsPerPage<1?1:Math.ceil(this.totalItems/this.itemsPerPage);return Math.max(t||0,1)},t.decorators=[{type:a.Component,args:[{selector:"hx-pager",template:'\n <ul class="hx-flex hx-flex-justify-between">\n <li [class.is-disabled]="noPrevious()" [class.is-previous]="align" class="{{ pageBtnClass }}">\n <a href (click)="selectPage(page - 1, $event)">{{getText(\'previous\')}}</a>\n </li>\n <li [class.is-disabled]="noNext()" [class.is-next]="align" class="{{ pageBtnClass }}">\n <a href (click)="selectPage(page + 1, $event)">{{getText(\'next\')}}</a>\n </li>\n </ul>\n',providers:[nt]}]}],t.ctorParameters=function(){return[{type:a.Renderer2},{type:a.ElementRef},{type:et}]},t.propDecorators={align:[{type:a.Input}],maxSize:[{type:a.Input}],boundaryLinks:[{type:a.Input}],directionLinks:[{type:a.Input}],firstText:[{type:a.Input}],previousText:[{type:a.Input}],nextText:[{type:a.Input}],lastText:[{type:a.Input}],rotate:[{type:a.Input}],pageBtnClass:[{type:a.Input}],disabled:[{type:a.Input}],numPages:[{type:a.Output}],pageChanged:[{type:a.Output}],itemsPerPage:[{type:a.Input}],totalItems:[{type:a.Input}]},t}(),ot={provide:e.NG_VALUE_ACCESSOR,useExisting:a.forwardRef(function(){return rt}),multi:!0},rt=function(){function t(t,e,n){this.numPages=new a.EventEmitter,this.pageChanged=new a.EventEmitter,this.onChange=Function.prototype,this.onTouched=Function.prototype,this.inited=!1,this._page=1,this.renderer=t,this.elementRef=e,this.config||this.configureOptions(n.main)}return Object.defineProperty(t.prototype,"itemsPerPage",{get:function(){return this._itemsPerPage},set:function(t){this._itemsPerPage=t,this.totalPages=this.calculateTotalPages()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"totalItems",{get:function(){return this._totalItems},set:function(t){this._totalItems=t,this.totalPages=this.calculateTotalPages()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"totalPages",{get:function(){return this._totalPages},set:function(t){this._totalPages=t,this.numPages.emit(t),this.inited&&this.selectPage(this.page)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"page",{get:function(){return this._page},set:function(t){var e=this._page;this._page=t>this.totalPages?this.totalPages:t||1,e!==this._page&&void 0!==e&&this.pageChanged.emit({page:this._page,itemsPerPage:this.itemsPerPage})},enumerable:!0,configurable:!0}),t.prototype.configureOptions=function(t){this.config=Object.assign({},t)},t.prototype.ngOnInit=function(){this.classMap=this.elementRef.nativeElement.getAttribute("class")||"",this.maxSize="undefined"!=typeof this.maxSize?this.maxSize:this.config.maxSize,this.rotate="undefined"!=typeof this.rotate?this.rotate:this.config.rotate,this.boundaryLinks="undefined"!=typeof this.boundaryLinks?this.boundaryLinks:this.config.boundaryLinks,this.directionLinks="undefined"!=typeof this.directionLinks?this.directionLinks:this.config.directionLinks,this.pageBtnClass="undefined"!=typeof this.pageBtnClass?this.pageBtnClass:this.config.pageBtnClass,this.itemsPerPage="undefined"!=typeof this.itemsPerPage?this.itemsPerPage:this.config.itemsPerPage,this.totalPages=this.calculateTotalPages(),this.pages=this.getPages(this.page,this.totalPages),this.inited=!0},t.prototype.writeValue=function(t){this.page=t,this.pages=this.getPages(this.page,this.totalPages)},t.prototype.getText=function(t){return this[t+"Text"]||this.config[t+"Text"]},t.prototype.noPrevious=function(){return 1===this.page},t.prototype.noNext=function(){return this.page===this.totalPages},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.selectPage=function(t,e){if(e&&e.preventDefault(),!this.disabled){if(e&&e.target)e.target.blur();this.writeValue(t),this.onChange(this.page)}},t.prototype.makePage=function(t,e,n){return{text:e,number:t,active:n}},t.prototype.getPages=function(t,e){var n=[],i=1,o=e,r="undefined"!=typeof this.maxSize&&this.maxSize<e;r&&(this.rotate?e<(o=(i=Math.max(t-Math.floor(this.maxSize/2),1))+this.maxSize-1)&&(i=(o=e)-this.maxSize+1):(i=(Math.ceil(t/this.maxSize)-1)*this.maxSize+1,o=Math.min(i+this.maxSize-1,e)));for(var s=i;s<=o;s++){var a=this.makePage(s,s.toString(),s===t);n.push(a)}if(r&&!this.rotate){if(1<i){var c=this.makePage(i-1,"...",!1);n.unshift(c)}if(o<e){var l=this.makePage(o+1,"...",!1);n.push(l)}}return n},t.prototype.calculateTotalPages=function(){var t=this.itemsPerPage<1?1:Math.ceil(this.totalItems/this.itemsPerPage);return Math.max(t||0,1)},t.decorators=[{type:a.Component,args:[{selector:"hx-pagination",template:'\n <ul class="hx-pagination" [ngClass]="classMap" [class.is-sticky]="sticky">\n <li class="is-first"\n *ngIf="boundaryLinks"\n [class.is-disabled]="noPrevious()||disabled">\n <a href (click)="selectPage(1, $event)" [innerHTML]="getText(\'first\')"></a>\n </li>\n\n <li class="is-prev"\n *ngIf="directionLinks"\n [class.is-disabled]="noPrevious()||disabled">\n <a href (click)="selectPage(page - 1, $event)" [innerHTML]="getText(\'previous\')"></a>\n </li>\n\n <li *ngFor="let pg of pages"\n [class.is-current]="pg.active"\n [class.is-disabled]="disabled&&!pg.active">\n <a href (click)="selectPage(pg.number, $event)" [innerHTML]="pg.text"></a>\n </li>\n\n <li class="is-next"\n *ngIf="directionLinks"\n [class.is-disabled]="noNext()||disabled">\n <a class="page-link" href (click)="selectPage(page + 1, $event)" [innerHTML]="getText(\'next\')"></a></li>\n\n <li class="is-last"\n *ngIf="boundaryLinks"\n [class.is-disabled]="noNext()||disabled">\n <a href (click)="selectPage(totalPages, $event)" [innerHTML]="getText(\'last\')"></a></li>\n </ul>\n ',providers:[ot]}]}],t.ctorParameters=function(){return[{type:a.Renderer2},{type:a.ElementRef},{type:et}]},t.propDecorators={align:[{type:a.Input}],maxSize:[{type:a.Input}],boundaryLinks:[{type:a.Input}],directionLinks:[{type:a.Input}],firstText:[{type:a.Input}],previousText:[{type:a.Input}],nextText:[{type:a.Input}],lastText:[{type:a.Input}],rotate:[{type:a.Input}],sticky:[{type:a.Input}],pageBtnClass:[{type:a.Input}],disabled:[{type:a.Input}],numPages:[{type:a.Output}],pageChanged:[{type:a.Output}],itemsPerPage:[{type:a.Input}],totalItems:[{type:a.Input}]},t}(),st=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[et]}},t.decorators=[{type:a.NgModule,args:[{imports:[n.CommonModule],declarations:[it,rt],exports:[it,rt]}]}],t}(),at={provide:e.NG_VALUE_ACCESSOR,useExisting:a.forwardRef(function(){return ct}),multi:!0},ct=function(){function t(t,e){this._differs=t,this.renderer=e,this.enabled=!0,this.onBlur=new a.EventEmitter(!1),this.onKeydown=function(t){console.log(t);9===t.keyCode&&(t.preventDefault(),t.stopImmediatePropagation(),t.stopPropagation())}}return t.prototype.ngOnInit=function(){this.id&&0<this.id.length&&this.renderer.setAttribute(this.selectizeInput.nativeElement,"id",this.id),this.reset()},t.prototype.reset=function(){this.selectize=$(this.selectizeInput.nativeElement).selectize(this.config)[0].selectize,this.selectize.on("change",this.onSelectizeValueChange.bind(this)),this.selectize.on("blur",this.onBlurEvent.bind(this)),this.selectize.on("type",this.onSelectizeType.bind(this)),this.selectize.on("item_add",this.onSelectizeItemSelected.bind(this)),this.updatePlaceholder(),this.onEnabledStatusChange()},t.prototype.ngOnDestroy=function(){this.selectize.off("change"),this.selectize.off("blur"),this.selectize.off("type")},t.prototype.ngOnChanges=function(t){this.selectize&&((t.hasOwnProperty("placeholder")||t.hasOwnProperty("hasOptionsPlaceholder")||t.hasOwnProperty("noOptionsPlaceholder"))&&this.updatePlaceholder(),t.hasOwnProperty("enabled")&&this.onEnabledStatusChange())},t.prototype.ngDoCheck=function(){var t;this._options_differ&&((t=this._options_differ.diff(this._options))&&this._applyOptionsChanges(t));this._optgroups_differ&&((t=this._optgroups_differ.diff(this._optgroups))&&this._applyOptionGroupChanges(t))},t.prototype._applyOptionsChanges=function(t){var e=this;t.forEachAddedItem(function(t){e.onSelectizeOptionAdd(t.item)}),t.forEachRemovedItem(function(t){e.onSelectizeOptionRemove(t.item)}),this.updatePlaceholder(),this.evalHasError()},t.prototype._applyOptionGroupChanges=function(t){var e=this;t.forEachAddedItem(function(t){e.onSelectizeOptGroupAdd(t.item)}),t.forEachRemovedItem(function(t){e.onSelectizeOptGroupRemove(t.item)}),this.updatePlaceholder(),this.evalHasError()},t.prototype.clearhighlight=function(){this.selectize.$dropdown_content.removeHighlight()},t.prototype.onBlurEvent=function(){this.formControl&&this.formControl.markAsTouched(),this.onBlur.emit(),this.evalHasError()},t.prototype.onSelectizeOptGroupAdd=function(t){this.selectize.addOptionGroup(t[this.getOptgroupField()],t)},t.prototype.onSelectizeOptGroupRemove=function(t){this.selectize.removeOptionGroup(t[this.getOptgroupField()])},t.prototype.onSelectizeOptionAdd=function(e){this.selectize.addOption(r.cloneDeep(e));var n=this.config.valueField;if(this.value){var t="string"==typeof this.value||"number"==typeof this.value?[this.value]:this.value;t&&t instanceof Array&&t.find(function(t){return t===e[n]})&&this.selectize.addItem(e[n],!0)}},t.prototype.onSelectizeOptionRemove=function(t){this.selectize.removeOption(t[this.config.valueField])},t.prototype.evalHasError=function(){var t=$(this.selectize.$control).parent();this.formControl&&(this.formControl.touched&&this.formControl.invalid?t.addClass(this.errorClass||"has-error"):t.hasClass("has-error")&&t.removeClass(this.errorClass||"has-error"))},t.prototype.updatePlaceholder=function(){0===this.selectize.items.length&&this.selectize.settings.placeholder!==this.getPlaceholder()&&(this.selectize.settings.placeholder=this.getPlaceholder(),this.selectize.updatePlaceholder(),this.selectize.showInput())},t.prototype.onEnabledStatusChange=function(){this.enabled?this.selectize.enable():this.selectize.disable()},t.prototype.onSelectizeValueChange=function(t){var e=this;if(this.onChangeCallback){var n=this.selectize.items.map(function(t){return e.selectize.options[t]});this.onChangeCallback(n)}},t.prototype.onSelectizeType=function(t){0===t.length&&(this.clearhighlight(),this.selectize.close())},t.prototype.onSelectizeItemSelected=function(t){this.clearhighlight(),this.config.closeAfterSelect&&this.selectize.close()},t.prototype.getPlaceholder=function(){return this.hasOptionsPlaceholder&&this.options&&0<this.options.length?this.hasOptionsPlaceholder:!this.noOptionsPlaceholder||this.options&&0!==this.options.length?this.placeholder:this.noOptionsPlaceholder},t.prototype.writeValue=function(t){var n=this;if(t!==this.value)if((this.value=t)&&0!==t.length){var e=t.map(function(e){return Object.keys(n.selectize.options).some(function(t){return t===e.value})||n.selectize.addOption(e),e.value});this.selectize.setValue(e)}else this.selectize.setValue("")},t.prototype.registerOnChange=function(t){this.onChangeCallback=t},t.prototype.registerOnTouched=function(t){this.onTouchedCallback=t},t.prototype.getOptgroupField=function(){return this.config.optgroupField?this.config.optgroupField:"optgroup"},Object.defineProperty(t.prototype,"options",{get:function(){return this._options},set:function(t){this._options=t,!this._options_differ&&t&&(this._options_differ=this._differs.find(t).create())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"optgroups",{get:function(){return this._optgroups},set:function(t){this._optgroups=t,!this._optgroups_differ&&t&&(this._optgroups_differ=this._differs.find(t).create())},enumerable:!0,configurable:!0}),t.decorators=[{type:a.Component,args:[{selector:"hxa-selectize",template:"<select #selectizeInput></select>",providers:[at],encapsulation:a.ViewEncapsulation.None,styles:[".selectize-control{position:relative}.selectize-dropdown,.selectize-input,.selectize-input input{color:#2a2c2d;font-family:inherit;font-size:.92rem;line-height:1.5;-webkit-font-smoothing:inherit}.selectize-control.single .selectize-input.input-active,.selectize-input{background:0 0;cursor:text;display:inline-block}.selectize-input{border:1px solid rgba(0,0,0,.2);padding:8px;display:inline-block;width:100%;overflow:hidden;position:relative;z-index:1;box-sizing:border-box;box-shadow:none;border-radius:0;border-width:0 0 1px}.selectize-control.multi .selectize-input.has-items{padding:6px 8px 3px}.selectize-input.full{background-color:transparent}.selectize-input.disabled,.selectize-input.disabled *{cursor:default!important}.selectize-input.focus{box-shadow:none}.selectize-input.dropdown-active{border-radius:0}.selectize-input>*{vertical-align:baseline;display:inline-block;zoom:1}.selectize-control.multi .selectize-input>div{cursor:pointer;margin:4px;padding:2px 6px;background:rgba(0,0,0,.05);color:#2a2c2d;border:0 solid transparent;border-radius:290486px;font-size:.75r