@datorama/core 22.9.8-rc → 22.9.9-rc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -236,7 +236,7 @@ function hi(){return'\n <div class="dato-checkbox"><label><p class="dato-si
236
236
  *
237
237
  * Use of this source code is governed by an Apache License 2.0 license that can be
238
238
  * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
239
- */var Ti={provide:o.NG_VALUE_ACCESSOR,useExisting:e.forwardRef((function(){return Ei})),multi:!0},Ei=function(a){function s(n,i,r,s,l,c,p){var d=a.call(this)||this;return d.cdr=n,d.translate=i,d.host=r,d.datoOverlay=s,d._naked=l,d.size=c,d.width=p,d.idKey="id",d.labelKey="label",d.placeholder="core.select",d.searchPlaceholder="core.search",d.isCombo=!0,d.isGroup=!1,d.internalSearch=!0,d.debounceTime=300,d.isLoading=!1,d.allowSelectAll=!1,d.selectAllChipTxt="",d.type=t.SelectType.SINGLE,d.searchStrategy=li,d.placement="bottom-start",d.infiniteScrollLoading=!1,d.limitTo=10,d.isSortable=!1,d.searchGroupLabels=!0,d.showEmptyResultsText=!0,d.keepFocus=!1,d.search=new e.EventEmitter,d.save=new e.EventEmitter,d.fetch=new e.EventEmitter,d.blur=new e.EventEmitter,d.searchControl=new o.FormControl,d.searchTerm="",d._noItemsLabel=d.translate.transform("core.no-items"),d._data=[],d._dataIsDirty=!1,d._focus=!1,d._model=[],d._open=!1,d._hasResults=!0,d._initialOpen=!0,d._withActions=!1,d._withInfiniteScroll=!1,d._clickOutside=!1,d.initialRun=!0,d.size=c||"md",d._dropdownClass=["dato-select-"+d.size],d}return ft(s,a),Object.defineProperty(s.prototype,"noItemsLabel",{set:function(t){this._noItemsLabel=this.translate.transform(t)},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"limitSelected",{set:function(t){this.limitSelectedTo=t,this.options&&this.updateDisabledState()},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"dataSet",{set:function(t){var e=this;this.initialRun?this._data=t:this._data=wi(t,this.labelKey,this.groupBy),this._dataIsDirty&&Promise.resolve().then((function(){e.subscribeToOptionClick(e.options),e.markAsActive(e._model)})),this._dataIsDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"containsGroups",{get:function(){return this.groups&&this.groups.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"data",{get:function(){return this._data},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"open",{get:function(){return this._open},set:function(t){this._open=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"hasResults",{get:function(){return this._hasResults},set:function(t){this._hasResults=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"hasValue",{get:function(){return this._model.length},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"isSingle",{get:function(){return this.type===t.SelectType.SINGLE},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"isMulti",{get:function(){return this.type===t.SelectType.MULTI},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"_showEmptyResults",{get:function(){return this.showEmptyResultsText&&this._data&&(!this.hasResults||!this._data.length)&&!this.isGroup},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"_count",{get:function(){var t=this.getVisibleOptions(!1).length;return"("+this._model.length+"/"+t+")"},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"_isAllChecked",{get:function(){var t=this;return this.getVisibleOptions().every((function(e){return t._model.indexOf(e)>-1}))},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"showSelectAllChip",{get:function(){return this.options.length&&this._model.length===this.options.length},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"_isIndeterminatelyChecked",{get:function(){var t,e,n,o=!1;try{for(var i=wt(this.getVisibleOptions()),r=i.next();!r.done;r=i.next()){var a=r.value;if(this._model.indexOf(a)>-1?n=!0:o=!0,n&&o)return!0}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return!1},enumerable:!0,configurable:!0}),s.prototype.ngOnInit=function(){this.datoSelectClass&&this._dropdownClass.push(this.datoSelectClass),this._withActions=1===this.save.observers.length,this._withInfiniteScroll=1===this.fetch.observers.length,this.listenToSearch(),this._data=wi(this._data,this.labelKey,this.groupBy),this.initialRun=!1,oe(this.width,null,this.host.nativeElement)},s.prototype.markTouched=function(){var t=this;Promise.resolve().then((function(){return t.onTouched()}))},s.prototype.close=function(){this.keyManager.setActiveItem(-1),this.searchControl.patchValue(""),this.datoOverlay.detach(),this.toggle(),this._focus=!1,this._clickOutside=!0,this.infiniteSubscription&&this.infiniteSubscription.unsubscribe(),this.scrollEventSubscription&&this.scrollEventSubscription.unsubscribe(),this.blur.emit()},s.prototype.toggle=function(){this.open=!this.open,this.open&&(this.isMulti||this.isCombo)&&(this._focus=!0,this._clickOutside=!1),this.cdr.markForCheck()},s.prototype.setDisabledState=function(t){this._disabled=t,this.cdr.markForCheck()},s.prototype.writeValue=function(t){if(this._model=t?Z.coerceArray(t):[],this.options){var e=this.limitSelectedTo&&this.isMulti&&this._model.length>=this.limitSelectedTo;this.markAsActive(this._model,{deselectAll:!0}),e&&this.updateDisabledState()}this.cdr.markForCheck()},s.prototype.openDropdown=function(t){var e=this;if(this.open&&!this.isCombo&&this.isSingle)this.close();else if(this.open&&(this.isMulti||this.isCombo))t&&"INPUT"!==t.target.nodeName&&this.close();else{this.datoOverlay.created||this.createOverlay(),this.datoOverlay.backDropClick$.pipe(r.take(1)).subscribe((function(){e._clickOutside=!0,e.open&&e.close()})),this.datoOverlay.attach({placement:this.placement},this._dropdownClass),this.toggle(),this.hasValue&&(this._initialOpen&&(this.markAsActive(this._model),this._initialOpen=!1),this.limitSelectedTo&&this._model.length===this.limitSelectedTo&&this.updateDisabledState()),this._withInfiniteScroll&&this.activateInfiniteScroll(),Vt(Ft(".dato-overlay"),"zIndex",Mn());var o=Ft(".dato-select__dropdown-container");if(Vt(o,"width",this.host.nativeElement.getBoundingClientRect().width+"px"),Ii())this.scrollEventSubscription=new n.Subscription;else{var a=Ye()?"touchmove":"scroll",s=n.fromEvent(window,a);Ye()&&(s=s.pipe(r.filter((function(t){return!o.contains(t.target)})))),this.scrollEventSubscription=s.pipe(i.untilDestroyed(this)).subscribe((function(t){return e.close()}))}this.handlePerfectScrollBar()}},s.prototype.ngAfterContentInit=function(){this.subscribeToOptionClick(this.options),this.keyManager=new pt.ActiveDescendantKeyManager(this.options).withWrap()},s.prototype.checkAll=function(t){var e,n,o,i,r=t;this._isIndeterminatelyChecked&&(r=!1);try{for(var a=wt(this.options.toArray()),s=a.next();!s.done;s=a.next()){var l=s.value;l.disabled||(l.active=r)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}var c=this.getVisibleOptions();if(c.length===this.options.length)this._model=r?c:[];else if(r){var p=[];try{for(var d=wt(c),u=d.next();!u.done;u=d.next()){var h=u.value;-1===this._model.indexOf(h)&&p.push(h)}}catch(t){o={error:t}}finally{try{u&&!u.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}this._model=xt(this._model,p)}else this._model=this._model.filter((function(t){return-1===c.indexOf(t)}));this.onChange(this._model),this.cdr.markForCheck(),this.asyncUpdateDropdownPosition()},s.prototype.reorderOptions=function(t){this._model=t,this.onChange(this._model)},s.prototype.removeOption=function(t){var e=this,n=this.limitSelectedTo&&this._model.length===this.limitSelectedTo;this._model=this._model.filter((function(n){return n[e.idKey]!==t[e.idKey]}));var o=this.options.find((function(n){return n.option&&n.option[e.idKey]===t[e.idKey]}));o&&(o.active=!1),n&&this.updateDisabledState(),this.onChange(this._model),this.cdr.markForCheck(),this.asyncUpdateDropdownPosition()},s.prototype.preventBodyScroll=function(t){Si(t)&&(t.stopPropagation(),t.preventDefault())},s.prototype.createOverlay=function(){var t,e=new Pn(this.dropdown);t=Mt(this.appendTo)?ee(this.host.nativeElement,this.appendTo):this.appendTo,this.datoOverlay.create(this.host.nativeElement,e,t)},s.prototype.handlePerfectScrollBar=function(){var t=this,e=ee(this.host.nativeElement,".ps");e&&n.fromEvent(e,"scroll").pipe(r.throttleTime(10),i.untilDestroyed(this)).subscribe((function(){t.datoOverlay.scheduleUpdate()}))},s.prototype.getVisibleOptions=function(t){void 0===t&&(t=!0);var e=this.options.filter((function(t){return!t.disabled}));return t?e.map((function(t){return t.option})):e},s.prototype.markAsActive=function(t,e){var n,o,i=this;void 0===e&&(e={deselectAll:!1});var r=this.options.toArray();e.deselectAll&&this.resetAll();var a=function(t){if(!t)return"continue";var e=r.find((function(e){return e.option&&e.option[i.idKey]===t[i.idKey]}));e&&(e.active=!0)};try{for(var s=wt(t),l=s.next();!l.done;l=s.next()){a(l.value)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}},s.prototype.showAll=function(){var t,e,n,o,i=this.isAccordionGroup(),r=this.getGroupComponentsArray();try{for(var a=wt(r),s=a.next();!s.done;s=a.next()){var l=s.value;if(l._hidden=!1,i){var c=l;if(c.__expended){c.__expended=!1;var p=c;p.content.disableAnimation=!1,p.expand(!1)}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}try{for(var d=wt(this.options.toArray()),u=d.next();!u.done;u=d.next()){u.value.hideAndDisabled(!1)}}catch(t){n={error:t}}finally{try{u&&!u.done&&(o=d.return)&&o.call(d)}finally{if(n)throw n.error}}},s.prototype.searchOptions=function(t){var e=this.getGroupComponentsArray();return e.length?this.searchInGroups(e,t):this.searchInOptions(t)},s.prototype.searchInGroups=function(t,e){for(var n=this,o=this.isAccordionGroup(),i=this._data.length,r=!1,a=function(i){var a=s._data[i],l=s.getGroupKey(a),c=s.searchGroupLabels&&s.searchStrategy(a,e,s.labelKey),p=a.children.map((function(t){return t[n.idKey]})),d=s.searchInOptions(e,p,c);d&&!r&&(r=!0);var u=t.find((function(t){return t.__key===l}))||t[i];if(u&&(u._hidden=!d,u.__key=l,o&&d)){var h=u;h.expanded||(h.content.disableAnimation=!0,h.expand(!0),u.__expended=!0)}},s=this,l=0;l<i;l++)a(l);return r},s.prototype.searchInOptions=function(t,e,n){var o,i;void 0===e&&(e=[]),void 0===n&&(n=!1);var r=!1;try{for(var a=wt(this.options.toArray()),s=a.next();!s.done;s=a.next()){var l=s.value,c=-1!==e.indexOf(l.option&&l.option[this.idKey]);if(n&&c)l.hideAndDisabled(!1),r=!0;else if(!ye(e)||c){this.searchStrategy(l,t,this.labelKey)?(l.hideAndDisabled(!1),r=!0):l.hideAndDisabled(!0)}}}catch(t){o={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}return r},s.prototype.getGroupKey=function(t){return t&&(t[this.idKey]||t[this.labelKey])},s.prototype.isEmpty=function(t){return""===t},s.prototype.listenToSearch=function(){var t=this;this.searchSubscription=this.isCombo&&this.searchControl.valueChanges.pipe(r.debounceTime(this.debounceTime)).subscribe((function(e){t.internalSearch?t.isEmpty(e)?(t.showAll(),t.hasResults=!0):t.hasResults=t.searchOptions(e):t.search.emit(e),t.searchTerm=e,t.keyManager.setActiveItem(-1),t.cdr.markForCheck(),t.asyncUpdateDropdownPosition()}))},s.prototype.subscribeToOptionClick=function(t){var e=this;this.clicksSubscription&&this.clicksSubscription.unsubscribe();var o=t.map((function(t){return t.click$.pipe(r.map((function(e){return{event:e,option:t}})))}));this.clicksSubscription=n.merge.apply(void 0,xt(o)).subscribe((function(t){var n=t.option,o=t.event;n.disabled||(o.preventDefault(),e.isSingle?e.handleSingleClick(n):e.handleMultiClick(n))}))},s.prototype.onDocumentKeydown=function(t){Oi(t)&&this.open&&(this._clickOutside=!0,this.close())},s.prototype.keyup=function(t){if(xi(t)){var e=this.keyManager.activeItemIndex,n=this.options.toArray()[e];this.isSingle?this.handleSingleClick(n):this.handleMultiClick(n)}if(Si(t)){this.keyManager.onKeydown(t);var o=document.querySelector(".dato-select__dropdown");Ci({size:this.size,panel:o,activeItemIndex:this.keyManager.activeItemIndex,groups:this.groups,options:this.options})}Oi(t)&&this.close()},s.prototype.resetAll=function(){var t,e;try{for(var n=wt(this.options.toArray()),o=n.next();!o.done;o=n.next()){o.value.active=!1}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},s.prototype.handleSingleClick=function(t){if(t)if(t.active)this.close();else{this.resetAll(),t.active=!0;var e=t.option;this._model=[e],this.onChange(e),this.close()}},s.prototype.handleMultiClick=function(t){var e=this;if(t){var n=this._model.length,o=this.limitSelectedTo&&(n===this.limitSelectedTo||n===this.limitSelectedTo-1&&!t.active);t.active=!t.active;var i=t.option;t.active?this._model=this._model.concat(i):this._model=this._model.filter((function(t){return t[e.idKey]!==i[e.idKey]})),o&&this.updateDisabledState(),this.onChange(this._model),this.cdr.markForCheck(),this.asyncUpdateDropdownPosition()}},s.prototype.activateInfiniteScroll=function(){var t=this;this.infiniteSubscription=n.fromEvent(document.querySelector(".dato-select__dropdown"),"scroll").pipe(r.debounceTime(50)).subscribe((function(e){var n=document.querySelector(".dato-select__dropdown"),o=n.scrollHeight-n.scrollTop,i=n.offsetHeight-o;0!==i&&1!==i||t.fetch.emit(!0)}))},s.prototype.ngOnDestroy=function(){this.searchSubscription&&this.searchSubscription.unsubscribe(),this.clicksSubscription&&this.clicksSubscription.unsubscribe(),this.infiniteSubscription&&this.infiniteSubscription.unsubscribe(),this.datoOverlay.attached&&this.datoOverlay.destroy()},s.prototype.isAccordionGroup=function(){return this.accordion&&this.accordion.length},s.prototype.getGroupComponentsArray=function(){return this.isAccordionGroup()?this.accordion.first.groups.toArray():this.groups&&this.groups.toArray()},s.prototype.updateDisabledState=function(){var t,e,n=this._model.length===this.limitSelectedTo;try{for(var o=wt(this.options.toArray()),i=o.next();!i.done;i=o.next()){var r=i.value;r.active||(r.disabled=n)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}},s.prototype.asyncUpdateDropdownPosition=function(){var t=this;this.datoOverlay&&this.datoOverlay.attached&&setTimeout((function(){return t.datoOverlay.scheduleUpdate()}),0)},s.ctorParameters=function(){return[{type:e.ChangeDetectorRef},{type:_n},{type:e.ElementRef},{type:Rn},{type:void 0,decorators:[{type:e.Attribute,args:["naked"]}]},{type:void 0,decorators:[{type:e.Attribute,args:["datoSize"]}]},{type:String,decorators:[{type:e.Attribute,args:["width"]}]}]},vt([e.ViewChild("dropdown"),Ct("design:type",e.TemplateRef)],s.prototype,"dropdown",void 0),vt([e.ViewChild("overlayOrigin"),Ct("design:type",e.ElementRef)],s.prototype,"origin",void 0),vt([e.ContentChildren(yi,{descendants:!0}),Ct("design:type",e.QueryList)],s.prototype,"options",void 0),vt([e.ContentChildren(e.forwardRef((function(){return pi})),{descendants:!0}),Ct("design:type",e.QueryList)],s.prototype,"accordion",void 0),vt([e.ContentChildren(mi),Ct("design:type",e.QueryList)],s.prototype,"groups",void 0),vt([e.ContentChild(vi),Ct("design:type",vi)],s.prototype,"active",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"idKey",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"labelKey",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"placeholder",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"searchPlaceholder",void 0),vt([e.Input(),Ct("design:type",String),Ct("design:paramtypes",[String])],s.prototype,"noItemsLabel",null),vt([e.Input(),Ct("design:type",String)],s.prototype,"groupBy",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"isCombo",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"isGroup",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"internalSearch",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"debounceTime",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"isLoading",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"allowSelectAll",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"selectAllChipTxt",void 0),vt([e.Input(),Ct("design:type",String)],s.prototype,"type",void 0),vt([e.Input(),Ct("design:type",Function)],s.prototype,"searchStrategy",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"placement",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"infiniteScrollLoading",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"limitTo",void 0),vt([e.Input("limitSelectedTo"),Ct("design:type",Number),Ct("design:paramtypes",[Number])],s.prototype,"limitSelected",null),vt([e.Input(),Ct("design:type",Object)],s.prototype,"isSortable",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"appendTo",void 0),vt([e.Input(),Ct("design:type",Array),Ct("design:paramtypes",[Array])],s.prototype,"dataSet",null),vt([e.Input(),Ct("design:type",Object)],s.prototype,"searchGroupLabels",void 0),vt([e.Input(),Ct("design:type",String)],s.prototype,"datoSelectClass",void 0),vt([e.Input(),Ct("design:type",e.TemplateRef)],s.prototype,"loadingTemplate",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"showEmptyResultsText",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"keepFocus",void 0),vt([e.Output(),Ct("design:type",Object)],s.prototype,"search",void 0),vt([e.Output(),Ct("design:type",Object)],s.prototype,"save",void 0),vt([e.Output(),Ct("design:type",Object)],s.prototype,"fetch",void 0),vt([e.Output(),Ct("design:type",Object)],s.prototype,"blur",void 0),vt([e.HostListener("focusout"),Ct("design:type",Function),Ct("design:paramtypes",[]),Ct("design:returntype",void 0)],s.prototype,"markTouched",null),vt([e.HostListener("document:keydown",["$event"]),Ct("design:type",Function),Ct("design:paramtypes",[KeyboardEvent]),Ct("design:returntype",void 0)],s.prototype,"onDocumentKeydown",null),s=vt([e.Component({selector:"dato-select",template:'<section class="dato-select__trigger" [class.dato-select--naked]="_naked" [class.dato-select--disabled]="_disabled">\n\n <div class="dato-select__single" *ngIf="isSingle" [ngClass]="_dropdownClass">\n <dato-input [class.force-hide]="(!open && isCombo) || !isCombo" [placeholder]="searchPlaceholder | translate"\n (keyup)="keyup($event)" [isFocused]="_focus" [isLoading]="isLoading" [formControl]="searchControl" type="search">\n </dato-input>\n\n <dato-trigger-single [loadingTemplate]="loadingTemplate" [active]="active" datoErrorValidationBorderAnchor tabindex="0" [labelKey]="labelKey"\n [context]="_model[0]" [class.force-hide]="open && isCombo" [placeholder]="placeholder | translate"\n class="ontop-overlay" (keydown)="preventBodyScroll($event)" (keyup)="keyup($event)" (click)="openDropdown()">\n </dato-trigger-single>\n </div>\n\n <dato-trigger-multi [loadingTemplate]="loadingTemplate" [options]="_model" datoErrorValidationBorderAnchor [control]="searchControl"\n [placeholder]="placeholder | translate" [labelKey]="labelKey" [idKey]="idKey" (keyup)="keyup($event)"\n [isLoading]="isLoading" [keepFocus]="keepFocus" [limitTo]="limitTo" [clickOutside]="_clickOutside" [isSortable]="isSortable"\n [selectAllChipTxt]="selectAllChipTxt"\n [showSelectAllChip]="selectAllChipTxt && showSelectAllChip"\n (unselectAll)="checkAll(false)"\n (removeOption)="removeOption($event)" (reorderOptions)="reorderOptions($event)" *ngIf="isMulti"\n (click)="openDropdown($event)"></dato-trigger-multi>\n\n</section>\n\n<ng-template #dropdown>\n <section class="dato-select__dropdown-container" tabindex="0" (keyup)="keyup($event)">\n\n \x3c!-- HEADER --\x3e\n\n <header class="dato-select__header dato-select__option dato-select__option--simple" data-is-floating\n *ngIf="isMulti && allowSelectAll" [class.force-hide]="_showEmptyResults" [class.ml-10]="containsGroups">\n <dato-checkbox [checked]="_isAllChecked" (check)="checkAll($event)"\n [indeterminatelyChecked]="_isIndeterminatelyChecked">\n {{\'core.select-all\' | translate}}<span class="primary-300-color note-italic ml-5">{{_count}}</span>\n </dato-checkbox>\n </header>\n\n \x3c!-- END HEADER --\x3e\n\n \x3c!-- DROPDOWN --\x3e\n\n <div class="dato-select__dropdown">\n\n <ng-content></ng-content>\n\n <dato-select-empty [show]="_showEmptyResults">{{_noItemsLabel}}</dato-select-empty>\n <div class="dato-select__option dato-select-infinite-spinner" data-is-floating *ngIf="infiniteScrollLoading">\n <span class="dato-input__spinner"></span>\n </div>\n\n </div>\n\n \x3c!-- END DROPDOWN --\x3e\n\n\n \x3c!-- FOOTER --\x3e\n\n <footer class="dato-select__footer d-flex" [class.with-actions]="_withActions">\n\n <ng-content select="[datoSelectFooter]"></ng-content>\n\n <ng-container *ngIf="_withActions">\n <dato-link class="mr-20" datoType="secondary" (click)="close()">Cancel</dato-link>\n <dato-button datoSize="sm" (click)="save.emit(); close();">Save</dato-button>\n </ng-container>\n\n </footer>\n\n \x3c!-- END FOOTER --\x3e\n\n </section>\n\n</ng-template>\n',preserveWhitespaces:!1,providers:[Ti,Rn],encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush,exportAs:"datoSelect"}),bt(4,e.Attribute("naked")),bt(5,e.Attribute("datoSize")),bt(6,e.Attribute("width")),Ct("design:paramtypes",[e.ChangeDetectorRef,_n,e.ElementRef,Rn,Object,Object,String])],s)}(Dt),Ai=function(){function t(t){this.cdr=t,this._placeholder=""}return Object.defineProperty(t.prototype,"placeholder",{set:function(t){this._placeholder=t,this.cdr.detectChanges()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"context",{set:function(t){this._model={$implicit:t},this.cdr.detectChanges()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hidePlaceholder",{get:function(){return!this._model||!this._model.$implicit},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){this.cdr.detach()},Object.defineProperty(t.prototype,"getLabel",{get:function(){return this._model&&this._model.$implicit&&this._model.$implicit[this.labelKey]},enumerable:!0,configurable:!0}),t.ctorParameters=function(){return[{type:e.ChangeDetectorRef}]},vt([e.Input(),Ct("design:type",e.TemplateRef)],t.prototype,"loadingTemplate",void 0),vt([e.Input(),Ct("design:type",vi)],t.prototype,"active",void 0),vt([e.Input(),Ct("design:type",Object),Ct("design:paramtypes",[Object])],t.prototype,"placeholder",null),vt([e.Input(),Ct("design:type",String)],t.prototype,"labelKey",void 0),vt([e.Input(),Ct("design:type",Object),Ct("design:paramtypes",[Object])],t.prototype,"context",null),t=vt([e.Component({selector:"dato-trigger-single",template:'<ng-template *ngIf="loadingTemplate" [ngTemplateOutlet]="loadingTemplate"></ng-template>\n<ng-container\n *ngIf="active && !hidePlaceholder"\n [ngTemplateOutlet]="active.tpl"\n [ngTemplateOutletContext]="_model">\n</ng-container>\n<ng-container *ngIf="!active">{{getLabel | translate}}</ng-container>\n<span class="dato-select__placeholder" *ngIf="hidePlaceholder">{{_placeholder}}</span>\n<dato-icon datoIcon="arrow-down" datoSize="sm" class="dato-select__single__arrow"></dato-icon>\n',changeDetection:e.ChangeDetectionStrategy.OnPush,styles:[":host{display:block;position:relative;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host dato-icon{position:absolute;top:50%;transform:translateY(-50%);right:10px}"]}),Ct("design:paramtypes",[e.ChangeDetectorRef])],t)}(),Ri={provide:o.NG_VALUE_ACCESSOR,useExisting:e.forwardRef((function(){return Pi})),multi:!0},Pi=function(t){function o(n,o,i,r,a){var s=t.call(this)||this;return s.renderer=n,s.cdr=o,s.host=i,s.trueValue=r,s.falseValue=a,s._checked=!1,s._indeterminatelyChecked=!1,s.check=new e.EventEmitter,s.trueValue=!!Lt(s.trueValue)||s.trueValue,s.falseValue=!Lt(s.falseValue)&&s.falseValue,s}return ft(o,t),Object.defineProperty(o.prototype,"indeterminatelyChecked",{get:function(){return this._indeterminatelyChecked},set:function(t){this._indeterminatelyChecked=t,this.inputElement.indeterminate=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"checked",{get:function(){return this._checked},set:function(t){this._checked=t,this.setInputValue(t)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"disabled",{set:function(t){this.setDisabledState(t)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"inputElement",{get:function(){return this.host.nativeElement.querySelector("input")},enumerable:!0,configurable:!0}),o.prototype.ngOnInit=function(){var t=this;n.fromEvent(this.inputElement,"change").pipe(r.pluck("target","checked"),i.untilDestroyed(this)).subscribe((function(e){e&&t.indeterminatelyChecked?(t.indeterminatelyChecked=!1,t.checked=!1):t._checked=!t._checked;var n=t._checked?t.trueValue:t.falseValue;t.cdr.markForCheck(),t.onChange(n),t.check.emit(n)}))},o.prototype.toggle=function(){this.writeValue(!this.checked)},o.prototype.writeValue=function(t){if(null==t||t!==this.trueValue&&t!==this.falseValue)throw new To("Invalid checkbox value: "+t);var e=t===this.trueValue;this.checked=e,this.setInputValue(e)},o.prototype.setDisabledState=function(t){this.renderer.setProperty(this.inputElement,"disabled",t)},o.prototype.ngOnDestroy=function(){},o.prototype.setInputValue=function(t){this.renderer.setProperty(this.inputElement,"checked",t)},o.ctorParameters=function(){return[{type:e.Renderer2},{type:e.ChangeDetectorRef},{type:e.ElementRef},{type:void 0,decorators:[{type:e.Attribute,args:["trueValue"]}]},{type:void 0,decorators:[{type:e.Attribute,args:["falseValue"]}]}]},vt([e.Input(),Ct("design:type",Boolean),Ct("design:paramtypes",[Boolean])],o.prototype,"indeterminatelyChecked",null),vt([e.Input(),Ct("design:type",Boolean),Ct("design:paramtypes",[Boolean])],o.prototype,"checked",null),vt([e.Input(),Ct("design:type",Boolean),Ct("design:paramtypes",[Boolean])],o.prototype,"disabled",null),vt([e.Output(),Ct("design:type",Object)],o.prototype,"check",void 0),o=vt([e.Component({selector:"dato-checkbox",template:'<label>\n <span><ng-content></ng-content></span>\n <input type="checkbox">\n <span class="checkmark" [class.checked]="checked" [class.indeterminately-checked]="indeterminatelyChecked"></span>\n</label>',encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush,exportAs:"datoCheckbox",providers:[Ri]}),bt(3,e.Attribute("trueValue")),bt(4,e.Attribute("falseValue")),Ct("design:paramtypes",[e.Renderer2,e.ChangeDetectorRef,e.ElementRef,Object,Object])],o)}(Dt),ki=function(){function t(){}return t=vt([e.NgModule({imports:[s.CommonModule,xo],declarations:[Pi],exports:[Pi]})],t)}(),_i=function(){function t(t,n){this.host=t,this.cdr=n,this._restCount=0,this._isFocused=!1,this.isLoading=!1,this.isSortable=!1,this.showSelectAllChip=!1,this.selectAllChipTxt="",this.keepFocus=!1,this._options=[],this._limitTo=10,this._disabled=!1,this.removeOption=new e.EventEmitter,this.unselectAll=new e.EventEmitter,this.reorderOptions=new e.EventEmitter,this.showClear=!1}return Object.defineProperty(t.prototype,"isFocused",{get:function(){return this._isFocused},set:function(t){this._isFocused=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this._options},set:function(t){this._options=t,this.setRestCount(),this.keepFocus&&this.input&&this.input.nativeElement.focus()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showRest",{get:function(){return this.options.length>this.limitTo},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"limitTo",{get:function(){return this._limitTo},set:function(t){this._limitTo=t,this.setRestCount()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clickOutside",{set:function(t){t&&(this.isFocused=!1,this.showClear=!1,this.input.nativeElement.blur())},enumerable:!0,configurable:!0}),t.prototype.onClick=function(){var t=this;this.isFocused=!0,Promise.resolve().then((function(){return t.input.nativeElement.focus()}))},t.prototype.ngOnInit=function(){var t=this;this.searchSubscription=this.control.valueChanges.subscribe((function(e){t.showClear=!!e}))},t.prototype.updateOrder=function(){this.reorderOptions.emit(this.options)},t.prototype.remove=function(t){this.removeOption.emit(t)},t.prototype.removeFocus=function(t){t.stopPropagation(),this.isFocused=!1},t.prototype.ngOnDestroy=function(){this.searchSubscription.unsubscribe()},t.prototype.clearSearch=function(){this.control.setValue(""),this.input.nativeElement.focus()},t.prototype.onKeyDown=function(t){var e=8===t.keyCode,n=46===t.keyCode,o=this.options.length>=1,i=!this.input.nativeElement.value;if((e||n)&&o&&i){var r=pe(this.options);this.removeOption.emit(r)}},t.prototype.ngAfterViewInit=function(){var t=this;requestAnimationFrame((function(){t.maxActiveElementWidth=t.host.nativeElement.getBoundingClientRect().width-100+"px",t.cdr.detectChanges()}))},t.prototype.setRestCount=function(){this._restCount=Math.abs(this.limitTo-this.options.length)},t.prototype.calcInputWidth=function(t){return Math.min(13*this.placeholder.length,t.clientWidth)},t.ctorParameters=function(){return[{type:e.ElementRef},{type:e.ChangeDetectorRef}]},vt([e.ViewChild("input"),Ct("design:type",e.ElementRef)],t.prototype,"input",void 0),vt([e.HostBinding("class.dato-trigger-multi--focused"),Ct("design:type",Boolean),Ct("design:paramtypes",[Boolean])],t.prototype,"isFocused",null),vt([e.Input(),Ct("design:type",e.TemplateRef)],t.prototype,"loadingTemplate",void 0),vt([e.Input(),Ct("design:type",o.FormControl)],t.prototype,"control",void 0),vt([e.Input(),Ct("design:type",String)],t.prototype,"placeholder",void 0),vt([e.Input(),Ct("design:type",Object)],t.prototype,"isLoading",void 0),vt([e.Input(),Ct("design:type",Object)],t.prototype,"isSortable",void 0),vt([e.Input(),Ct("design:type",Object)],t.prototype,"showSelectAllChip",void 0),vt([e.Input(),Ct("design:type",Object)],t.prototype,"selectAllChipTxt",void 0),vt([e.Input(),Ct("design:type",Object)],t.prototype,"keepFocus",void 0),vt([e.Input(),Ct("design:type",Array),Ct("design:paramtypes",[Array])],t.prototype,"options",null),vt([e.Input(),Ct("design:type",Number),Ct("design:paramtypes",[Number])],t.prototype,"limitTo",null),vt([e.Input(),Ct("design:type",Boolean),Ct("design:paramtypes",[Boolean])],t.prototype,"disabled",null),vt([e.Input(),Ct("design:type",Object)],t.prototype,"labelKey",void 0),vt([e.Input(),Ct("design:type",Object)],t.prototype,"idKey",void 0),vt([e.Input(),Ct("design:type",Boolean),Ct("design:paramtypes",[Boolean])],t.prototype,"clickOutside",null),vt([e.Output(),Ct("design:type",Object)],t.prototype,"removeOption",void 0),vt([e.Output(),Ct("design:type",Object)],t.prototype,"unselectAll",void 0),vt([e.Output(),Ct("design:type",Object)],t.prototype,"reorderOptions",void 0),vt([e.HostListener("click"),Ct("design:type",Function),Ct("design:paramtypes",[]),Ct("design:returntype",void 0)],t.prototype,"onClick",null),t=vt([e.Component({selector:"dato-trigger-multi",template:'<section class="d-flex d-flex-wrap flex-1 width-100" #container>\n <dato-sortable *ngIf="isSortable; else selectedValues" containerClass="d-flex d-flex-wrap"\n [datoOptions]="{filter: \'input\', hasStaticItems: true}" [datoList]="options" (orderUpdated)="updateOrder()">\n <ng-container [ngTemplateOutlet]="selectedValues"></ng-container>\n <ng-container [ngTemplateOutlet]="search"></ng-container>\n </dato-sortable>\n\n <ng-template #selectedValues>\n <ng-template [ngTemplateOutlet]="showSelectAllChip ? allSelectedChip : null"></ng-template>\n\n <ng-template [ngIf]="!showSelectAllChip">\n <div class="dato-trigger-multi__active d-flex justify-between"\n *ngFor="let option of options | slice: 0: limitTo; trackBy: (idKey | trackByProp)"\n (click)="removeFocus($event)" datoSortableHandle>\n <span [ngStyle]="{maxWidth: maxActiveElementWidth}" [datoTooltip]="option[labelKey]"\n datoTooltipPosition="bottom" [datoTooltipOnTextOverflow]="true">{{option[labelKey] | translate}}</span>\n <dato-icon class="d-flex-no-shrink" datoIcon="close"\n (click)="remove(option); removeFocus($event)"></dato-icon>\n </div>\n </ng-template>\n\n </ng-template>\n\n <ng-container *ngIf="!isSortable">\n <ng-container [ngTemplateOutlet]="search"></ng-container>\n </ng-container>\n\n <ng-template #allSelectedChip>\n <div class="dato-trigger-multi__active d-flex justify-between">\n <span [ngStyle]="{maxWidth: maxActiveElementWidth}">{{ selectAllChipTxt | translate}}</span>\n <dato-icon class="d-flex-no-shrink" datoIcon="close"\n (click)="unselectAll.emit(); removeFocus($event)"></dato-icon>\n </div>\n </ng-template>\n\n <ng-template #search>\n <div class="dato-sortable-static-item dato-trigger-multi__active d-flex justify-between dato-trigger-multi__rest" *ngIf="showRest && !showSelectAllChip">\n +{{_restCount}}\n </div>\n <input type="search" class="dato-sortable-static-item dato-multi-search flex-1 ellipsis"\n [placeholder]="placeholder"\n (keydown)="onKeyDown($event)"\n [style.minWidth.px]="calcInputWidth(container)"\n [formControl]="control"\n #input>\n </ng-template>\n</section>\n\n<dato-icon datoIcon="close" *ngIf="showClear && !isLoading" (click)="clearSearch()"\n data-auto-id=\'clear-input\'\n class="dato-trigger-multi__clear"></dato-icon>\n\n<dato-icon datoIcon="arrow-down" datoSize="sm" *ngIf="!showClear"></dato-icon>\n<ng-template [ngTemplateOutlet]="loadingTemplate ? loadingTemplate : defaultLoading"></ng-template>\n\n<ng-template #defaultLoading> \n <span class="dato-input__spinner" *ngIf="isLoading"></span>\n</ng-template>\n',changeDetection:e.ChangeDetectionStrategy.OnPush}),Ct("design:paramtypes",[e.ElementRef,e.ChangeDetectorRef])],t)}(),ji=function(t){function n(e,n,o){var i=t.call(this,e,n,o)||this;return i.cdr=e,i.host=n,i.group=o,i}var o;return ft(n,t),o=n,n.ctorParameters=function(){return[{type:e.ChangeDetectorRef},{type:e.ElementRef},{type:mi,decorators:[{type:e.Optional}]}]},n=o=vt([e.Component({selector:"dato-option[multi]",changeDetection:e.ChangeDetectionStrategy.OnPush,providers:[{provide:yi,useExisting:o}],template:gi(!0)}),bt(2,e.Optional()),Ct("design:paramtypes",[e.ChangeDetectorRef,e.ElementRef,mi])],n)}(yi),Mi=function(){function t(t){this.cdr=t,this._show=!1}return Object.defineProperty(t.prototype,"show",{set:function(t){this._show=t,this.cdr.detectChanges()},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){this.cdr.detach()},t.ctorParameters=function(){return[{type:e.ChangeDetectorRef}]},vt([e.Input(),Ct("design:type",Object),Ct("design:paramtypes",[Object])],t.prototype,"show",null),t=vt([e.Component({selector:"dato-select-empty, dato-option-empty",changeDetection:e.ChangeDetectionStrategy.OnPush,template:'\n <div class="dato-select__option dato-select__not-found primary-300-color" *ngIf="_show">\n <ng-content></ng-content>\n </div>\n '}),Ct("design:paramtypes",[e.ChangeDetectorRef])],t)}(),Li=function(){function t(t,e){this.cdr=t,this.host=e,this._disabled=!1,this._checked=!1,this._hidden=!1}return Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){t!==this._disabled&&(this._disabled=t,Kt(this.host.nativeElement,"dato-option--disabled",this._disabled),this.cdr.detectChanges())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"checked",{get:function(){return this._checked},set:function(t){t!==this.checked&&(this._checked=t,this.cdr.detectChanges())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hidden",{get:function(){return this._hidden},set:function(t){t!==this._hidden&&(this._hidden=t,Kt(this.host.nativeElement,"force-hide",this._hidden))},enumerable:!0,configurable:!0}),t.prototype.setActiveStyles=function(){this.host.nativeElement.classList.add("dato-option--keyboard-active")},t.prototype.setInactiveStyles=function(){this.host.nativeElement.classList.remove("dato-option--keyboard-active")},t.ctorParameters=function(){return[{type:e.ChangeDetectorRef},{type:e.ElementRef}]},vt([e.Input(),Ct("design:type",Object)],t.prototype,"option",void 0),vt([e.Input(),Ct("design:type",Boolean),Ct("design:paramtypes",[Boolean])],t.prototype,"disabled",null),vt([e.Input(),Ct("design:type",Boolean),Ct("design:paramtypes",[Boolean])],t.prototype,"checked",null),vt([e.Input(),Ct("design:type",Boolean),Ct("design:paramtypes",[Boolean])],t.prototype,"hidden",null),t=vt([e.Component({selector:"dato-option-v2:not([multi])",changeDetection:e.ChangeDetectionStrategy.OnPush,template:Fi()}),Ct("design:paramtypes",[e.ChangeDetectorRef,e.ElementRef])],t)}(),Ni=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.indeterminatelyChecked=!1,n.check=new e.EventEmitter,n}var o;return ft(n,t),o=n,n.prototype.onCheck=function(t){this.allowAction(t.target)&&this.check.emit(this.checked)},n.prototype.toggleChecked=function(t){this.checked=t},n.prototype.allowAction=function(t){for(var e=t;"DATO-OPTION-V2"!==e.tagName;){if(null!==e.getAttribute("data-list-item-ignore"))return!1;e=e.parentElement}return!0},vt([e.Input(),Ct("design:type",Object)],n.prototype,"indeterminatelyChecked",void 0),vt([e.HostListener("mouseup",["$event"]),Ct("design:type",Function),Ct("design:paramtypes",[Object]),Ct("design:returntype",void 0)],n.prototype,"onCheck",null),vt([e.Output(),Ct("design:type",Object)],n.prototype,"check",void 0),n=o=vt([e.Component({selector:"dato-option-v2[multi]",changeDetection:e.ChangeDetectionStrategy.OnPush,providers:[{provide:Li,useExisting:o}],template:Fi(!0)})],n)}(Li);function Fi(t){return void 0===t&&(t=!1),'\n <div data-is-floating class="dato-select__option \n dato-select__option--simple\n ellipsis \n dato-select__option--hover"\n >\n '+(t?'\n <dato-checkbox [checked]="checked" [disabled]="disabled" (check)="toggleChecked($event)" [indeterminatelyChecked]="indeterminatelyChecked">\n <ng-content></ng-content>\n </dato-checkbox>\n ':"<ng-content></ng-content>")+" \n </div>\n "}var Gi=[yi,mi,ji,Mi,Li,Ni],Vi=function(){function t(){}return t=vt([e.NgModule({imports:[s.CommonModule,vo,Ne,o.ReactiveFormsModule,ki,se,Co,xo],declarations:[Gi],exports:[Gi],entryComponents:[Gi]})],t)}(),zi=function(){function t(t,e){this.renderer=t,this.host=e,t.addClass(e.nativeElement,"dato-sortable-handler")}return t.ctorParameters=function(){return[{type:e.Renderer2},{type:e.ElementRef}]},t=vt([e.Directive({selector:"[datoSortableHandle]"}),Ct("design:paramtypes",[e.Renderer2,e.ElementRef])],t)}(),Bi=[ci,zi],Hi=function(){function t(){}return t=vt([e.NgModule({imports:[s.CommonModule,dt.SortablejsModule],declarations:[Bi],exports:[Bi]})],t)}(),Ui=[Ei,Ai,_i],Ki=[vi],Wi=function(){function t(){}return t=vt([e.NgModule({imports:[yo,s.CommonModule,vo,Ne,o.ReactiveFormsModule,ki,se,Co,xo,Vi,Xn,Hi],declarations:[Ui,Ki],exports:[Ui,Ki,Vi],entryComponents:[Ui]})],t)}();
239
+ */var Ti={provide:o.NG_VALUE_ACCESSOR,useExisting:e.forwardRef((function(){return Ei})),multi:!0},Ei=function(a){function s(n,i,r,s,l,c,p){var d=a.call(this)||this;return d.cdr=n,d.translate=i,d.host=r,d.datoOverlay=s,d._naked=l,d.size=c,d.width=p,d.idKey="id",d.labelKey="label",d.placeholder="core.select",d.searchPlaceholder="core.search",d.isCombo=!0,d.isGroup=!1,d.internalSearch=!0,d.debounceTime=300,d.isLoading=!1,d.allowSelectAll=!1,d.selectAllChipTxt="",d.type=t.SelectType.SINGLE,d.searchStrategy=li,d.placement="bottom-start",d.infiniteScrollLoading=!1,d.limitTo=10,d.isSortable=!1,d.searchGroupLabels=!0,d.showEmptyResultsText=!0,d.keepFocus=!1,d.search=new e.EventEmitter,d.save=new e.EventEmitter,d.fetch=new e.EventEmitter,d.blur=new e.EventEmitter,d.searchControl=new o.FormControl,d.searchTerm="",d._noItemsLabel=d.translate.transform("core.no-items"),d._data=[],d._dataIsDirty=!1,d._focus=!1,d._model=[],d._open=!1,d._hasResults=!0,d._initialOpen=!0,d._withActions=!1,d._withInfiniteScroll=!1,d._clickOutside=!1,d.initialRun=!0,d.size=c||"md",d._dropdownClass=["dato-select-"+d.size],d}return ft(s,a),Object.defineProperty(s.prototype,"noItemsLabel",{set:function(t){this._noItemsLabel=this.translate.transform(t)},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"limitSelected",{set:function(t){this.limitSelectedTo=t,this.options&&this.updateDisabledState()},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"dataSet",{set:function(t){var e=this;this.initialRun?this._data=t:this._data=wi(t,this.labelKey,this.groupBy),this._dataIsDirty&&Promise.resolve().then((function(){e.subscribeToOptionClick(e.options),e.markAsActive(e._model)})),this._dataIsDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"containsGroups",{get:function(){return this.groups&&this.groups.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"data",{get:function(){return this._data},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"open",{get:function(){return this._open},set:function(t){this._open=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"hasResults",{get:function(){return this._hasResults},set:function(t){this._hasResults=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"hasValue",{get:function(){return this._model.length},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"isSingle",{get:function(){return this.type===t.SelectType.SINGLE},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"isMulti",{get:function(){return this.type===t.SelectType.MULTI},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"_showEmptyResults",{get:function(){return this.showEmptyResultsText&&this._data&&(!this.hasResults||!this._data.length)&&!this.isGroup},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"_count",{get:function(){var t=this.getVisibleOptions(!1).length;return"("+this._model.length+"/"+t+")"},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"_isAllChecked",{get:function(){var t=this;return this.getVisibleOptions().every((function(e){return t._model.indexOf(e)>-1}))},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"showSelectAllChip",{get:function(){return this.options.length&&this._model.length===this.options.length},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"_isIndeterminatelyChecked",{get:function(){var t,e,n,o=!1;try{for(var i=wt(this.getVisibleOptions()),r=i.next();!r.done;r=i.next()){var a=r.value;if(this._model.indexOf(a)>-1?n=!0:o=!0,n&&o)return!0}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return!1},enumerable:!0,configurable:!0}),s.prototype.ngOnInit=function(){this.datoSelectClass&&this._dropdownClass.push(this.datoSelectClass),this._withActions=1===this.save.observers.length,this._withInfiniteScroll=1===this.fetch.observers.length,this.listenToSearch(),this._data=wi(this._data,this.labelKey,this.groupBy),this.initialRun=!1,oe(this.width,null,this.host.nativeElement)},s.prototype.markTouched=function(){var t=this;Promise.resolve().then((function(){return t.onTouched()}))},s.prototype.close=function(){this.keyManager.setActiveItem(-1),this.searchControl.patchValue(""),this.datoOverlay.detach(),this.toggle(),this._focus=!1,this._clickOutside=!0,this.infiniteSubscription&&this.infiniteSubscription.unsubscribe(),this.scrollEventSubscription&&this.scrollEventSubscription.unsubscribe(),this.blur.emit()},s.prototype.toggle=function(){this.open=!this.open,this.open&&(this.isMulti||this.isCombo)&&(this._focus=!0,this._clickOutside=!1),this.cdr.markForCheck()},s.prototype.setDisabledState=function(t){this._disabled=t,this.cdr.markForCheck()},s.prototype.writeValue=function(t){if(this._model=t?Z.coerceArray(t):[],this.options){var e=this.limitSelectedTo&&this.isMulti&&this._model.length>=this.limitSelectedTo;this.markAsActive(this._model,{deselectAll:!0}),e&&this.updateDisabledState()}this.cdr.markForCheck()},s.prototype.openDropdown=function(t){var e=this;if(this.open&&!this.isCombo&&this.isSingle)this.close();else if(this.open&&(this.isMulti||this.isCombo))t&&"INPUT"!==t.target.nodeName&&this.close();else{this.datoOverlay.created||this.createOverlay(),this.datoOverlay.backDropClick$.pipe(r.take(1)).subscribe((function(){e._clickOutside=!0,e.open&&e.close()})),this.datoOverlay.attach({placement:this.placement},this._dropdownClass),this.toggle(),this.hasValue&&(this._initialOpen&&(this.markAsActive(this._model),this._initialOpen=!1),this.limitSelectedTo&&this._model.length===this.limitSelectedTo&&this.updateDisabledState()),this._withInfiniteScroll&&this.activateInfiniteScroll(),Vt(Ft(".dato-overlay"),"zIndex",Mn());var o=Ft(".dato-select__dropdown-container");if(Vt(o,"width",this.host.nativeElement.getBoundingClientRect().width+"px"),Ii())this.scrollEventSubscription=new n.Subscription;else{var a=Ye()?"touchmove":"scroll",s=n.fromEvent(window,a);Ye()&&(s=s.pipe(r.filter((function(t){return!o.contains(t.target)})))),this.scrollEventSubscription=s.pipe(i.untilDestroyed(this)).subscribe((function(t){return e.close()}))}this.handlePerfectScrollBar()}},s.prototype.ngAfterContentInit=function(){this.subscribeToOptionClick(this.options),this.keyManager=new pt.ActiveDescendantKeyManager(this.options).withWrap()},s.prototype.checkAll=function(t){var e,n,o,i,r=t;this._isIndeterminatelyChecked&&(r=!1);try{for(var a=wt(this.options.toArray()),s=a.next();!s.done;s=a.next()){var l=s.value;l.disabled||(l.active=r)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}var c=this.getVisibleOptions();if(c.length===this.options.length)this._model=r?c:[];else if(r){var p=[];try{for(var d=wt(c),u=d.next();!u.done;u=d.next()){var h=u.value;-1===this._model.indexOf(h)&&p.push(h)}}catch(t){o={error:t}}finally{try{u&&!u.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}this._model=xt(this._model,p)}else this._model=this._model.filter((function(t){return-1===c.indexOf(t)}));this.onChange(this._model),this.cdr.markForCheck(),this.asyncUpdateDropdownPosition()},s.prototype.reorderOptions=function(t){this._model=t,this.onChange(this._model)},s.prototype.removeOption=function(t){var e=this,n=this.limitSelectedTo&&this._model.length===this.limitSelectedTo;this._model=this._model.filter((function(n){return n[e.idKey]!==t[e.idKey]}));var o=this.options.find((function(n){return n.option&&n.option[e.idKey]===t[e.idKey]}));o&&(o.active=!1),n&&this.updateDisabledState(),this.onChange(this._model),this.cdr.markForCheck(),this.asyncUpdateDropdownPosition()},s.prototype.preventBodyScroll=function(t){Si(t)&&(t.stopPropagation(),t.preventDefault())},s.prototype.createOverlay=function(){var t,e=new Pn(this.dropdown);t=Mt(this.appendTo)?ee(this.host.nativeElement,this.appendTo):this.appendTo,this.datoOverlay.create(this.host.nativeElement,e,t)},s.prototype.handlePerfectScrollBar=function(){var t=this,e=ee(this.host.nativeElement,".ps");e&&n.fromEvent(e,"scroll").pipe(r.throttleTime(10),i.untilDestroyed(this)).subscribe((function(){t.datoOverlay.scheduleUpdate()}))},s.prototype.getVisibleOptions=function(t){void 0===t&&(t=!0);var e=this.options.filter((function(t){return!t.disabled}));return t?e.map((function(t){return t.option})):e},s.prototype.markAsActive=function(t,e){var n,o,i=this;void 0===e&&(e={deselectAll:!1});var r=this.options.toArray();e.deselectAll&&this.resetAll();var a=function(t){if(!t)return"continue";var e=r.find((function(e){return e.option&&e.option[i.idKey]===t[i.idKey]}));e&&(e.active=!0)};try{for(var s=wt(t),l=s.next();!l.done;l=s.next()){a(l.value)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}},s.prototype.showAll=function(){var t,e,n,o,i=this.isAccordionGroup(),r=this.getGroupComponentsArray();try{for(var a=wt(r),s=a.next();!s.done;s=a.next()){var l=s.value;if(l._hidden=!1,i){var c=l;if(c.__expended){c.__expended=!1;var p=c;p.content.disableAnimation=!1,p.expand(!1)}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}try{for(var d=wt(this.options.toArray()),u=d.next();!u.done;u=d.next()){u.value.hideAndDisabled(!1)}}catch(t){n={error:t}}finally{try{u&&!u.done&&(o=d.return)&&o.call(d)}finally{if(n)throw n.error}}},s.prototype.searchOptions=function(t){var e=this.getGroupComponentsArray();return e.length?this.searchInGroups(e,t):this.searchInOptions(t)},s.prototype.searchInGroups=function(t,e){for(var n=this,o=this.isAccordionGroup(),i=this._data.length,r=!1,a=function(i){var a=s._data[i],l=s.getGroupKey(a),c=s.searchGroupLabels&&s.searchStrategy(a,e,s.labelKey),p=a.children.map((function(t){return t[n.idKey]})),d=s.searchInOptions(e,p,c);d&&!r&&(r=!0);var u=t.find((function(t){return t.__key===l}))||t[i];if(u&&(u._hidden=!d,u.__key=l,o&&d)){var h=u;h.expanded||(h.content.disableAnimation=!0,h.expand(!0),u.__expended=!0)}},s=this,l=0;l<i;l++)a(l);return r},s.prototype.searchInOptions=function(t,e,n){var o,i;void 0===e&&(e=[]),void 0===n&&(n=!1);var r=!1;try{for(var a=wt(this.options.toArray()),s=a.next();!s.done;s=a.next()){var l=s.value,c=-1!==e.indexOf(l.option&&l.option[this.idKey]);if(n&&c)l.hideAndDisabled(!1),r=!0;else if(!ye(e)||c){this.searchStrategy(l,t,this.labelKey)?(l.hideAndDisabled(!1),r=!0):l.hideAndDisabled(!0)}}}catch(t){o={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}return r},s.prototype.getGroupKey=function(t){return t&&(t[this.idKey]||t[this.labelKey])},s.prototype.isEmpty=function(t){return""===t},s.prototype.listenToSearch=function(){var t=this;this.searchSubscription=this.isCombo&&this.searchControl.valueChanges.pipe(r.debounceTime(this.debounceTime)).subscribe((function(e){t.internalSearch?t.isEmpty(e)?(t.showAll(),t.hasResults=!0):t.hasResults=t.searchOptions(e):t.search.emit(e),t.searchTerm=e,t.keyManager.setActiveItem(-1),t.cdr.markForCheck(),t.asyncUpdateDropdownPosition()}))},s.prototype.subscribeToOptionClick=function(t){var e=this;this.clicksSubscription&&this.clicksSubscription.unsubscribe();var o=t.map((function(t){return t.click$.pipe(r.map((function(e){return{event:e,option:t}})))}));this.clicksSubscription=n.merge.apply(void 0,xt(o)).subscribe((function(t){var n=t.option,o=t.event;n.disabled||(o.preventDefault(),e.isSingle?e.handleSingleClick(n):e.handleMultiClick(n))}))},s.prototype.onDocumentKeydown=function(t){Oi(t)&&this.open&&(this._clickOutside=!0,this.close())},s.prototype.keyup=function(t){if(xi(t)){var e=this.keyManager.activeItemIndex,n=this.options.toArray()[e];this.isSingle?this.handleSingleClick(n):this.handleMultiClick(n)}if(Si(t)){this.keyManager.onKeydown(t);var o=document.querySelector(".dato-select__dropdown");Ci({size:this.size,panel:o,activeItemIndex:this.keyManager.activeItemIndex,groups:this.groups,options:this.options})}Oi(t)&&this.close()},s.prototype.resetAll=function(){var t,e;try{for(var n=wt(this.options.toArray()),o=n.next();!o.done;o=n.next()){o.value.active=!1}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},s.prototype.handleSingleClick=function(t){if(t)if(t.active)this.close();else{this.resetAll(),t.active=!0;var e=t.option;this._model=[e],this.onChange(e),this.close()}},s.prototype.handleMultiClick=function(t){var e=this;if(t){var n=this._model.length,o=this.limitSelectedTo&&(n===this.limitSelectedTo||n===this.limitSelectedTo-1&&!t.active);t.active=!t.active;var i=t.option;t.active?this._model=this._model.concat(i):this._model=this._model.filter((function(t){return t[e.idKey]!==i[e.idKey]})),o&&this.updateDisabledState(),this.onChange(this._model),this.cdr.markForCheck(),this.asyncUpdateDropdownPosition()}},s.prototype.activateInfiniteScroll=function(){var t=this;this.infiniteSubscription=n.fromEvent(document.querySelector(".dato-select__dropdown"),"scroll").pipe(r.debounceTime(50)).subscribe((function(e){var n=document.querySelector(".dato-select__dropdown"),o=n.scrollHeight-n.scrollTop,i=n.offsetHeight-o;0!==i&&1!==i||t.fetch.emit(!0)}))},s.prototype.ngOnDestroy=function(){this.searchSubscription&&this.searchSubscription.unsubscribe(),this.clicksSubscription&&this.clicksSubscription.unsubscribe(),this.infiniteSubscription&&this.infiniteSubscription.unsubscribe(),this.datoOverlay.attached&&this.datoOverlay.destroy()},s.prototype.isAccordionGroup=function(){return this.accordion&&this.accordion.length},s.prototype.getGroupComponentsArray=function(){return this.isAccordionGroup()?this.accordion.first.groups.toArray():this.groups&&this.groups.toArray()},s.prototype.updateDisabledState=function(){var t,e,n=this._model.length===this.limitSelectedTo;try{for(var o=wt(this.options.toArray()),i=o.next();!i.done;i=o.next()){var r=i.value;r.active||(r.disabled=n)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}},s.prototype.asyncUpdateDropdownPosition=function(){var t=this;this.datoOverlay&&this.datoOverlay.attached&&setTimeout((function(){return t.datoOverlay.scheduleUpdate()}),0)},s.ctorParameters=function(){return[{type:e.ChangeDetectorRef},{type:_n},{type:e.ElementRef},{type:Rn},{type:void 0,decorators:[{type:e.Attribute,args:["naked"]}]},{type:void 0,decorators:[{type:e.Attribute,args:["datoSize"]}]},{type:String,decorators:[{type:e.Attribute,args:["width"]}]}]},vt([e.ViewChild("dropdown"),Ct("design:type",e.TemplateRef)],s.prototype,"dropdown",void 0),vt([e.ViewChild("overlayOrigin"),Ct("design:type",e.ElementRef)],s.prototype,"origin",void 0),vt([e.ContentChildren(yi,{descendants:!0}),Ct("design:type",e.QueryList)],s.prototype,"options",void 0),vt([e.ContentChildren(e.forwardRef((function(){return pi})),{descendants:!0}),Ct("design:type",e.QueryList)],s.prototype,"accordion",void 0),vt([e.ContentChildren(mi),Ct("design:type",e.QueryList)],s.prototype,"groups",void 0),vt([e.ContentChild(vi),Ct("design:type",vi)],s.prototype,"active",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"idKey",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"labelKey",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"placeholder",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"searchPlaceholder",void 0),vt([e.Input(),Ct("design:type",String),Ct("design:paramtypes",[String])],s.prototype,"noItemsLabel",null),vt([e.Input(),Ct("design:type",String)],s.prototype,"groupBy",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"isCombo",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"isGroup",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"internalSearch",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"debounceTime",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"isLoading",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"allowSelectAll",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"selectAllChipTxt",void 0),vt([e.Input(),Ct("design:type",String)],s.prototype,"type",void 0),vt([e.Input(),Ct("design:type",Function)],s.prototype,"searchStrategy",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"placement",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"infiniteScrollLoading",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"limitTo",void 0),vt([e.Input("limitSelectedTo"),Ct("design:type",Number),Ct("design:paramtypes",[Number])],s.prototype,"limitSelected",null),vt([e.Input(),Ct("design:type",Object)],s.prototype,"isSortable",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"appendTo",void 0),vt([e.Input(),Ct("design:type",Array),Ct("design:paramtypes",[Array])],s.prototype,"dataSet",null),vt([e.Input(),Ct("design:type",Object)],s.prototype,"searchGroupLabels",void 0),vt([e.Input(),Ct("design:type",String)],s.prototype,"datoSelectClass",void 0),vt([e.Input(),Ct("design:type",e.TemplateRef)],s.prototype,"loadingTemplate",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"showEmptyResultsText",void 0),vt([e.Input(),Ct("design:type",Object)],s.prototype,"keepFocus",void 0),vt([e.Output(),Ct("design:type",Object)],s.prototype,"search",void 0),vt([e.Output(),Ct("design:type",Object)],s.prototype,"save",void 0),vt([e.Output(),Ct("design:type",Object)],s.prototype,"fetch",void 0),vt([e.Output(),Ct("design:type",Object)],s.prototype,"blur",void 0),vt([e.HostListener("focusout"),Ct("design:type",Function),Ct("design:paramtypes",[]),Ct("design:returntype",void 0)],s.prototype,"markTouched",null),vt([e.HostListener("document:keydown",["$event"]),Ct("design:type",Function),Ct("design:paramtypes",[KeyboardEvent]),Ct("design:returntype",void 0)],s.prototype,"onDocumentKeydown",null),s=vt([e.Component({selector:"dato-select",template:'<section class="dato-select__trigger" [class.dato-select--naked]="_naked" [class.dato-select--disabled]="_disabled">\n\n <div class="dato-select__single" *ngIf="isSingle" [ngClass]="_dropdownClass">\n <dato-input [class.force-hide]="(!open && isCombo) || !isCombo" [placeholder]="searchPlaceholder | translate"\n (keyup)="keyup($event)" [isFocused]="_focus" [isLoading]="isLoading" [formControl]="searchControl" type="search">\n </dato-input>\n\n <dato-trigger-single [isLoading]="isLoading" [loadingTemplate]="loadingTemplate" [active]="active" datoErrorValidationBorderAnchor tabindex="0" [labelKey]="labelKey"\n [context]="_model[0]" [class.force-hide]="open && isCombo" [placeholder]="placeholder | translate"\n class="ontop-overlay" (keydown)="preventBodyScroll($event)" (keyup)="keyup($event)" (click)="openDropdown()">\n </dato-trigger-single>\n </div>\n\n <dato-trigger-multi [loadingTemplate]="loadingTemplate" [options]="_model" datoErrorValidationBorderAnchor [control]="searchControl"\n [placeholder]="placeholder | translate" [labelKey]="labelKey" [idKey]="idKey" (keyup)="keyup($event)"\n [isLoading]="isLoading" [keepFocus]="keepFocus" [limitTo]="limitTo" [clickOutside]="_clickOutside" [isSortable]="isSortable"\n [selectAllChipTxt]="selectAllChipTxt"\n [showSelectAllChip]="selectAllChipTxt && showSelectAllChip"\n (unselectAll)="checkAll(false)"\n (removeOption)="removeOption($event)" (reorderOptions)="reorderOptions($event)" *ngIf="isMulti"\n (click)="openDropdown($event)"></dato-trigger-multi>\n\n</section>\n\n<ng-template #dropdown>\n <section class="dato-select__dropdown-container" tabindex="0" (keyup)="keyup($event)">\n\n \x3c!-- HEADER --\x3e\n\n <header class="dato-select__header dato-select__option dato-select__option--simple" data-is-floating\n *ngIf="isMulti && allowSelectAll" [class.force-hide]="_showEmptyResults" [class.ml-10]="containsGroups">\n <dato-checkbox [checked]="_isAllChecked" (check)="checkAll($event)"\n [indeterminatelyChecked]="_isIndeterminatelyChecked">\n {{\'core.select-all\' | translate}}<span class="primary-300-color note-italic ml-5">{{_count}}</span>\n </dato-checkbox>\n </header>\n\n \x3c!-- END HEADER --\x3e\n\n \x3c!-- DROPDOWN --\x3e\n\n <div class="dato-select__dropdown">\n\n <ng-content></ng-content>\n\n <dato-select-empty [show]="_showEmptyResults">{{_noItemsLabel}}</dato-select-empty>\n <div class="dato-select__option dato-select-infinite-spinner" data-is-floating *ngIf="infiniteScrollLoading">\n <span class="dato-input__spinner"></span>\n </div>\n\n </div>\n\n \x3c!-- END DROPDOWN --\x3e\n\n\n \x3c!-- FOOTER --\x3e\n\n <footer class="dato-select__footer d-flex" [class.with-actions]="_withActions">\n\n <ng-content select="[datoSelectFooter]"></ng-content>\n\n <ng-container *ngIf="_withActions">\n <dato-link class="mr-20" datoType="secondary" (click)="close()">Cancel</dato-link>\n <dato-button datoSize="sm" (click)="save.emit(); close();">Save</dato-button>\n </ng-container>\n\n </footer>\n\n \x3c!-- END FOOTER --\x3e\n\n </section>\n\n</ng-template>\n',preserveWhitespaces:!1,providers:[Ti,Rn],encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush,exportAs:"datoSelect"}),bt(4,e.Attribute("naked")),bt(5,e.Attribute("datoSize")),bt(6,e.Attribute("width")),Ct("design:paramtypes",[e.ChangeDetectorRef,_n,e.ElementRef,Rn,Object,Object,String])],s)}(Dt),Ai=function(){function t(t){this.cdr=t,this.isLoading=!1,this._placeholder=""}return Object.defineProperty(t.prototype,"placeholder",{set:function(t){this._placeholder=t,this.cdr.detectChanges()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"context",{set:function(t){this._model={$implicit:t},this.cdr.detectChanges()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hidePlaceholder",{get:function(){return!this._model||!this._model.$implicit},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){this.cdr.detach()},Object.defineProperty(t.prototype,"getLabel",{get:function(){return this._model&&this._model.$implicit&&this._model.$implicit[this.labelKey]},enumerable:!0,configurable:!0}),t.ctorParameters=function(){return[{type:e.ChangeDetectorRef}]},vt([e.Input(),Ct("design:type",Object)],t.prototype,"isLoading",void 0),vt([e.Input(),Ct("design:type",e.TemplateRef)],t.prototype,"loadingTemplate",void 0),vt([e.Input(),Ct("design:type",vi)],t.prototype,"active",void 0),vt([e.Input(),Ct("design:type",Object),Ct("design:paramtypes",[Object])],t.prototype,"placeholder",null),vt([e.Input(),Ct("design:type",String)],t.prototype,"labelKey",void 0),vt([e.Input(),Ct("design:type",Object),Ct("design:paramtypes",[Object])],t.prototype,"context",null),t=vt([e.Component({selector:"dato-trigger-single",template:'<ng-template *ngIf="isLoading" [ngTemplateOutlet]="loadingTemplate"></ng-template>\n<ng-container\n *ngIf="active && !hidePlaceholder"\n [ngTemplateOutlet]="active.tpl"\n [ngTemplateOutletContext]="_model">\n</ng-container>\n<ng-container *ngIf="!active">{{getLabel | translate}}</ng-container>\n<span class="dato-select__placeholder" *ngIf="hidePlaceholder">{{_placeholder}}</span>\n<dato-icon datoIcon="arrow-down" datoSize="sm" class="dato-select__single__arrow"></dato-icon>\n',changeDetection:e.ChangeDetectionStrategy.OnPush,styles:[":host{display:block;position:relative;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host dato-icon{position:absolute;top:50%;transform:translateY(-50%);right:10px}"]}),Ct("design:paramtypes",[e.ChangeDetectorRef])],t)}(),Ri={provide:o.NG_VALUE_ACCESSOR,useExisting:e.forwardRef((function(){return Pi})),multi:!0},Pi=function(t){function o(n,o,i,r,a){var s=t.call(this)||this;return s.renderer=n,s.cdr=o,s.host=i,s.trueValue=r,s.falseValue=a,s._checked=!1,s._indeterminatelyChecked=!1,s.check=new e.EventEmitter,s.trueValue=!!Lt(s.trueValue)||s.trueValue,s.falseValue=!Lt(s.falseValue)&&s.falseValue,s}return ft(o,t),Object.defineProperty(o.prototype,"indeterminatelyChecked",{get:function(){return this._indeterminatelyChecked},set:function(t){this._indeterminatelyChecked=t,this.inputElement.indeterminate=t},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"checked",{get:function(){return this._checked},set:function(t){this._checked=t,this.setInputValue(t)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"disabled",{set:function(t){this.setDisabledState(t)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"inputElement",{get:function(){return this.host.nativeElement.querySelector("input")},enumerable:!0,configurable:!0}),o.prototype.ngOnInit=function(){var t=this;n.fromEvent(this.inputElement,"change").pipe(r.pluck("target","checked"),i.untilDestroyed(this)).subscribe((function(e){e&&t.indeterminatelyChecked?(t.indeterminatelyChecked=!1,t.checked=!1):t._checked=!t._checked;var n=t._checked?t.trueValue:t.falseValue;t.cdr.markForCheck(),t.onChange(n),t.check.emit(n)}))},o.prototype.toggle=function(){this.writeValue(!this.checked)},o.prototype.writeValue=function(t){if(null==t||t!==this.trueValue&&t!==this.falseValue)throw new To("Invalid checkbox value: "+t);var e=t===this.trueValue;this.checked=e,this.setInputValue(e)},o.prototype.setDisabledState=function(t){this.renderer.setProperty(this.inputElement,"disabled",t)},o.prototype.ngOnDestroy=function(){},o.prototype.setInputValue=function(t){this.renderer.setProperty(this.inputElement,"checked",t)},o.ctorParameters=function(){return[{type:e.Renderer2},{type:e.ChangeDetectorRef},{type:e.ElementRef},{type:void 0,decorators:[{type:e.Attribute,args:["trueValue"]}]},{type:void 0,decorators:[{type:e.Attribute,args:["falseValue"]}]}]},vt([e.Input(),Ct("design:type",Boolean),Ct("design:paramtypes",[Boolean])],o.prototype,"indeterminatelyChecked",null),vt([e.Input(),Ct("design:type",Boolean),Ct("design:paramtypes",[Boolean])],o.prototype,"checked",null),vt([e.Input(),Ct("design:type",Boolean),Ct("design:paramtypes",[Boolean])],o.prototype,"disabled",null),vt([e.Output(),Ct("design:type",Object)],o.prototype,"check",void 0),o=vt([e.Component({selector:"dato-checkbox",template:'<label>\n <span><ng-content></ng-content></span>\n <input type="checkbox">\n <span class="checkmark" [class.checked]="checked" [class.indeterminately-checked]="indeterminatelyChecked"></span>\n</label>',encapsulation:e.ViewEncapsulation.None,changeDetection:e.ChangeDetectionStrategy.OnPush,exportAs:"datoCheckbox",providers:[Ri]}),bt(3,e.Attribute("trueValue")),bt(4,e.Attribute("falseValue")),Ct("design:paramtypes",[e.Renderer2,e.ChangeDetectorRef,e.ElementRef,Object,Object])],o)}(Dt),ki=function(){function t(){}return t=vt([e.NgModule({imports:[s.CommonModule,xo],declarations:[Pi],exports:[Pi]})],t)}(),_i=function(){function t(t,n){this.host=t,this.cdr=n,this._restCount=0,this._isFocused=!1,this.isLoading=!1,this.isSortable=!1,this.showSelectAllChip=!1,this.selectAllChipTxt="",this.keepFocus=!1,this._options=[],this._limitTo=10,this._disabled=!1,this.removeOption=new e.EventEmitter,this.unselectAll=new e.EventEmitter,this.reorderOptions=new e.EventEmitter,this.showClear=!1}return Object.defineProperty(t.prototype,"isFocused",{get:function(){return this._isFocused},set:function(t){this._isFocused=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this._options},set:function(t){this._options=t,this.setRestCount(),this.keepFocus&&this.input&&this.input.nativeElement.focus()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showRest",{get:function(){return this.options.length>this.limitTo},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"limitTo",{get:function(){return this._limitTo},set:function(t){this._limitTo=t,this.setRestCount()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clickOutside",{set:function(t){t&&(this.isFocused=!1,this.showClear=!1,this.input.nativeElement.blur())},enumerable:!0,configurable:!0}),t.prototype.onClick=function(){var t=this;this.isFocused=!0,Promise.resolve().then((function(){return t.input.nativeElement.focus()}))},t.prototype.ngOnInit=function(){var t=this;this.searchSubscription=this.control.valueChanges.subscribe((function(e){t.showClear=!!e}))},t.prototype.updateOrder=function(){this.reorderOptions.emit(this.options)},t.prototype.remove=function(t){this.removeOption.emit(t)},t.prototype.removeFocus=function(t){t.stopPropagation(),this.isFocused=!1},t.prototype.ngOnDestroy=function(){this.searchSubscription.unsubscribe()},t.prototype.clearSearch=function(){this.control.setValue(""),this.input.nativeElement.focus()},t.prototype.onKeyDown=function(t){var e=8===t.keyCode,n=46===t.keyCode,o=this.options.length>=1,i=!this.input.nativeElement.value;if((e||n)&&o&&i){var r=pe(this.options);this.removeOption.emit(r)}},t.prototype.ngAfterViewInit=function(){var t=this;requestAnimationFrame((function(){t.maxActiveElementWidth=t.host.nativeElement.getBoundingClientRect().width-100+"px",t.cdr.detectChanges()}))},t.prototype.setRestCount=function(){this._restCount=Math.abs(this.limitTo-this.options.length)},t.prototype.calcInputWidth=function(t){return Math.min(13*this.placeholder.length,t.clientWidth)},t.ctorParameters=function(){return[{type:e.ElementRef},{type:e.ChangeDetectorRef}]},vt([e.ViewChild("input"),Ct("design:type",e.ElementRef)],t.prototype,"input",void 0),vt([e.HostBinding("class.dato-trigger-multi--focused"),Ct("design:type",Boolean),Ct("design:paramtypes",[Boolean])],t.prototype,"isFocused",null),vt([e.Input(),Ct("design:type",e.TemplateRef)],t.prototype,"loadingTemplate",void 0),vt([e.Input(),Ct("design:type",o.FormControl)],t.prototype,"control",void 0),vt([e.Input(),Ct("design:type",String)],t.prototype,"placeholder",void 0),vt([e.Input(),Ct("design:type",Object)],t.prototype,"isLoading",void 0),vt([e.Input(),Ct("design:type",Object)],t.prototype,"isSortable",void 0),vt([e.Input(),Ct("design:type",Object)],t.prototype,"showSelectAllChip",void 0),vt([e.Input(),Ct("design:type",Object)],t.prototype,"selectAllChipTxt",void 0),vt([e.Input(),Ct("design:type",Object)],t.prototype,"keepFocus",void 0),vt([e.Input(),Ct("design:type",Array),Ct("design:paramtypes",[Array])],t.prototype,"options",null),vt([e.Input(),Ct("design:type",Number),Ct("design:paramtypes",[Number])],t.prototype,"limitTo",null),vt([e.Input(),Ct("design:type",Boolean),Ct("design:paramtypes",[Boolean])],t.prototype,"disabled",null),vt([e.Input(),Ct("design:type",Object)],t.prototype,"labelKey",void 0),vt([e.Input(),Ct("design:type",Object)],t.prototype,"idKey",void 0),vt([e.Input(),Ct("design:type",Boolean),Ct("design:paramtypes",[Boolean])],t.prototype,"clickOutside",null),vt([e.Output(),Ct("design:type",Object)],t.prototype,"removeOption",void 0),vt([e.Output(),Ct("design:type",Object)],t.prototype,"unselectAll",void 0),vt([e.Output(),Ct("design:type",Object)],t.prototype,"reorderOptions",void 0),vt([e.HostListener("click"),Ct("design:type",Function),Ct("design:paramtypes",[]),Ct("design:returntype",void 0)],t.prototype,"onClick",null),t=vt([e.Component({selector:"dato-trigger-multi",template:'<section class="d-flex d-flex-wrap flex-1 width-100" #container>\n <dato-sortable *ngIf="isSortable; else selectedValues" containerClass="d-flex d-flex-wrap"\n [datoOptions]="{filter: \'input\', hasStaticItems: true}" [datoList]="options" (orderUpdated)="updateOrder()">\n <ng-container [ngTemplateOutlet]="selectedValues"></ng-container>\n <ng-container [ngTemplateOutlet]="search"></ng-container>\n </dato-sortable>\n\n <ng-template #selectedValues>\n <ng-template [ngTemplateOutlet]="showSelectAllChip ? allSelectedChip : null"></ng-template>\n\n <ng-template [ngIf]="!showSelectAllChip">\n <div class="dato-trigger-multi__active d-flex justify-between"\n *ngFor="let option of options | slice: 0: limitTo; trackBy: (idKey | trackByProp)"\n (click)="removeFocus($event)" datoSortableHandle>\n <span [ngStyle]="{maxWidth: maxActiveElementWidth}" [datoTooltip]="option[labelKey]"\n datoTooltipPosition="bottom" [datoTooltipOnTextOverflow]="true">{{option[labelKey] | translate}}</span>\n <dato-icon class="d-flex-no-shrink" datoIcon="close"\n (click)="remove(option); removeFocus($event)"></dato-icon>\n </div>\n </ng-template>\n\n </ng-template>\n\n <ng-container *ngIf="!isSortable">\n <ng-container [ngTemplateOutlet]="search"></ng-container>\n </ng-container>\n\n <ng-template #allSelectedChip>\n <div class="dato-trigger-multi__active d-flex justify-between">\n <span [ngStyle]="{maxWidth: maxActiveElementWidth}">{{ selectAllChipTxt | translate}}</span>\n <dato-icon class="d-flex-no-shrink" datoIcon="close"\n (click)="unselectAll.emit(); removeFocus($event)"></dato-icon>\n </div>\n </ng-template>\n\n <ng-template #search>\n <div class="dato-sortable-static-item dato-trigger-multi__active d-flex justify-between dato-trigger-multi__rest" *ngIf="showRest && !showSelectAllChip">\n +{{_restCount}}\n </div>\n <input type="search" class="dato-sortable-static-item dato-multi-search flex-1 ellipsis"\n [placeholder]="placeholder"\n (keydown)="onKeyDown($event)"\n [style.minWidth.px]="calcInputWidth(container)"\n [formControl]="control"\n #input>\n </ng-template>\n</section>\n\n<dato-icon datoIcon="close" *ngIf="showClear && !isLoading" (click)="clearSearch()"\n data-auto-id=\'clear-input\'\n class="dato-trigger-multi__clear"></dato-icon>\n\n<dato-icon datoIcon="arrow-down" datoSize="sm" *ngIf="!showClear"></dato-icon>\n<ng-template [ngTemplateOutlet]="loadingTemplate ? loadingTemplate : defaultLoading"></ng-template>\n\n<ng-template #defaultLoading> \n <span class="dato-input__spinner" *ngIf="isLoading"></span>\n</ng-template>\n',changeDetection:e.ChangeDetectionStrategy.OnPush}),Ct("design:paramtypes",[e.ElementRef,e.ChangeDetectorRef])],t)}(),ji=function(t){function n(e,n,o){var i=t.call(this,e,n,o)||this;return i.cdr=e,i.host=n,i.group=o,i}var o;return ft(n,t),o=n,n.ctorParameters=function(){return[{type:e.ChangeDetectorRef},{type:e.ElementRef},{type:mi,decorators:[{type:e.Optional}]}]},n=o=vt([e.Component({selector:"dato-option[multi]",changeDetection:e.ChangeDetectionStrategy.OnPush,providers:[{provide:yi,useExisting:o}],template:gi(!0)}),bt(2,e.Optional()),Ct("design:paramtypes",[e.ChangeDetectorRef,e.ElementRef,mi])],n)}(yi),Mi=function(){function t(t){this.cdr=t,this._show=!1}return Object.defineProperty(t.prototype,"show",{set:function(t){this._show=t,this.cdr.detectChanges()},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){this.cdr.detach()},t.ctorParameters=function(){return[{type:e.ChangeDetectorRef}]},vt([e.Input(),Ct("design:type",Object),Ct("design:paramtypes",[Object])],t.prototype,"show",null),t=vt([e.Component({selector:"dato-select-empty, dato-option-empty",changeDetection:e.ChangeDetectionStrategy.OnPush,template:'\n <div class="dato-select__option dato-select__not-found primary-300-color" *ngIf="_show">\n <ng-content></ng-content>\n </div>\n '}),Ct("design:paramtypes",[e.ChangeDetectorRef])],t)}(),Li=function(){function t(t,e){this.cdr=t,this.host=e,this._disabled=!1,this._checked=!1,this._hidden=!1}return Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){t!==this._disabled&&(this._disabled=t,Kt(this.host.nativeElement,"dato-option--disabled",this._disabled),this.cdr.detectChanges())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"checked",{get:function(){return this._checked},set:function(t){t!==this.checked&&(this._checked=t,this.cdr.detectChanges())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hidden",{get:function(){return this._hidden},set:function(t){t!==this._hidden&&(this._hidden=t,Kt(this.host.nativeElement,"force-hide",this._hidden))},enumerable:!0,configurable:!0}),t.prototype.setActiveStyles=function(){this.host.nativeElement.classList.add("dato-option--keyboard-active")},t.prototype.setInactiveStyles=function(){this.host.nativeElement.classList.remove("dato-option--keyboard-active")},t.ctorParameters=function(){return[{type:e.ChangeDetectorRef},{type:e.ElementRef}]},vt([e.Input(),Ct("design:type",Object)],t.prototype,"option",void 0),vt([e.Input(),Ct("design:type",Boolean),Ct("design:paramtypes",[Boolean])],t.prototype,"disabled",null),vt([e.Input(),Ct("design:type",Boolean),Ct("design:paramtypes",[Boolean])],t.prototype,"checked",null),vt([e.Input(),Ct("design:type",Boolean),Ct("design:paramtypes",[Boolean])],t.prototype,"hidden",null),t=vt([e.Component({selector:"dato-option-v2:not([multi])",changeDetection:e.ChangeDetectionStrategy.OnPush,template:Fi()}),Ct("design:paramtypes",[e.ChangeDetectorRef,e.ElementRef])],t)}(),Ni=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.indeterminatelyChecked=!1,n.check=new e.EventEmitter,n}var o;return ft(n,t),o=n,n.prototype.onCheck=function(t){this.allowAction(t.target)&&this.check.emit(this.checked)},n.prototype.toggleChecked=function(t){this.checked=t},n.prototype.allowAction=function(t){for(var e=t;"DATO-OPTION-V2"!==e.tagName;){if(null!==e.getAttribute("data-list-item-ignore"))return!1;e=e.parentElement}return!0},vt([e.Input(),Ct("design:type",Object)],n.prototype,"indeterminatelyChecked",void 0),vt([e.HostListener("mouseup",["$event"]),Ct("design:type",Function),Ct("design:paramtypes",[Object]),Ct("design:returntype",void 0)],n.prototype,"onCheck",null),vt([e.Output(),Ct("design:type",Object)],n.prototype,"check",void 0),n=o=vt([e.Component({selector:"dato-option-v2[multi]",changeDetection:e.ChangeDetectionStrategy.OnPush,providers:[{provide:Li,useExisting:o}],template:Fi(!0)})],n)}(Li);function Fi(t){return void 0===t&&(t=!1),'\n <div data-is-floating class="dato-select__option \n dato-select__option--simple\n ellipsis \n dato-select__option--hover"\n >\n '+(t?'\n <dato-checkbox [checked]="checked" [disabled]="disabled" (check)="toggleChecked($event)" [indeterminatelyChecked]="indeterminatelyChecked">\n <ng-content></ng-content>\n </dato-checkbox>\n ':"<ng-content></ng-content>")+" \n </div>\n "}var Gi=[yi,mi,ji,Mi,Li,Ni],Vi=function(){function t(){}return t=vt([e.NgModule({imports:[s.CommonModule,vo,Ne,o.ReactiveFormsModule,ki,se,Co,xo],declarations:[Gi],exports:[Gi],entryComponents:[Gi]})],t)}(),zi=function(){function t(t,e){this.renderer=t,this.host=e,t.addClass(e.nativeElement,"dato-sortable-handler")}return t.ctorParameters=function(){return[{type:e.Renderer2},{type:e.ElementRef}]},t=vt([e.Directive({selector:"[datoSortableHandle]"}),Ct("design:paramtypes",[e.Renderer2,e.ElementRef])],t)}(),Bi=[ci,zi],Hi=function(){function t(){}return t=vt([e.NgModule({imports:[s.CommonModule,dt.SortablejsModule],declarations:[Bi],exports:[Bi]})],t)}(),Ui=[Ei,Ai,_i],Ki=[vi],Wi=function(){function t(){}return t=vt([e.NgModule({imports:[yo,s.CommonModule,vo,Ne,o.ReactiveFormsModule,ki,se,Co,xo,Vi,Xn,Hi],declarations:[Ui,Ki],exports:[Ui,Ki,Vi],entryComponents:[Ui]})],t)}();
240
240
  /**
241
241
  * @license
242
242
  * Copyright Datorama. All Rights Reserved.