Comparing version 0.1.1 to 0.1.2
@@ -384,3 +384,3 @@ (function (global, factory) { | ||
this.changed.emit(this.newSelected); | ||
this.idsChanged.emit(selected.map(function (i) { return +i.id; })); | ||
this.idsChanged.emit(this.newSelected.map(function (i) { return +i.id; })); | ||
} | ||
@@ -391,5 +391,5 @@ else { | ||
} | ||
if (selected) { | ||
this.selection.emit(selected); | ||
this.idsSelection.emit(selected.map(function (i) { return +i.id; })); | ||
if (this.selected) { | ||
this.selection.emit(this.selected); | ||
this.idsSelection.emit(this.selected.map(function (i) { return +i.id; })); | ||
} | ||
@@ -418,2 +418,13 @@ else { | ||
}); | ||
if (item.checked) { | ||
this.newSelected.push(item); | ||
} | ||
else { | ||
this.newSelected = this.newSelected.filter(function (i) { return i.id !== item.id; }); | ||
} | ||
this.newSelected = this.newSelected.filter(function (thing, index) { | ||
return index === _this.newSelected.findIndex(function (obj) { | ||
return JSON.stringify(obj) === JSON.stringify(thing); | ||
}); | ||
}); | ||
}; | ||
@@ -420,0 +431,0 @@ __decorate([ |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("cm-select",["exports","@angular/core","@angular/common","@angular/forms","rxjs","rxjs/operators"],e):e((t=t||self)["cm-select"]={},t.ng.core,t.ng.common,t.ng.forms,t.rxjs,t.rxjs.operators)}(this,function(t,e,n,i,o,p){"use strict";function r(t,e,n,i){var o,p=arguments.length,r=p<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(p<3?o(r):p>3?o(e,n,r):o(e,n))||r);return p>3&&r&&Object.defineProperty(e,n,r),r}function a(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function d(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 c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,o,p=n.call(t),r=[];try{for(;(void 0===e||e-- >0)&&!(i=p.next()).done;)r.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=p["return"])&&n.call(p)}finally{if(o)throw o.error}}return r}function s(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(c(arguments[e]));return t}var l=function(){function t(){}return t.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t=r([e.Injectable({providedIn:"root"}),a("design:paramtypes",[])],t)}(),m=function(t){this.filter=!!t&&t.filter,this.image=!!t&&t.image,this.imageUrlKey=t?t.imageUrl:null,this.single=!!t&&t.single,this.top=t?t.top:32,this.loadingText=t?t.loadingText||"Loading ...":"Loading..."},g=function(){function t(){this.bindLabel="name",this.bindValue="id",this.items=[],this.selected=[],this.selectedIds=[],this.loading=!1,this.search=new e.EventEmitter,this.changed=new e.EventEmitter,this.idsChanged=new e.EventEmitter,this.selection=new e.EventEmitter,this.idsSelection=new e.EventEmitter}return t.prototype.ngOnInit=function(){this.options=new m(this.options)},t.prototype.onChange=function(t){this.changed.emit(t)},t.prototype.onIdsChanged=function(t){this.idsChanged.emit(t)},t.prototype.onSearch=function(t){this.search.emit(t)},t.prototype.onSelection=function(t){this.selection.emit(t)},t.prototype.onSelectionChanged=function(t){this.idsSelection.emit(t)},r([e.Input(),a("design:type",m)],t.prototype,"options",void 0),r([e.Input(),a("design:type",Object)],t.prototype,"bindLabel",void 0),r([e.Input(),a("design:type",Object)],t.prototype,"bindValue",void 0),r([e.Input(),a("design:type",Array)],t.prototype,"items",void 0),r([e.Input(),a("design:type",Array)],t.prototype,"selected",void 0),r([e.Input(),a("design:type",Array)],t.prototype,"selectedIds",void 0),r([e.Input(),a("design:type",Object)],t.prototype,"loading",void 0),r([e.Output(),a("design:type",e.EventEmitter)],t.prototype,"search",void 0),r([e.Output(),a("design:type",e.EventEmitter)],t.prototype,"changed",void 0),r([e.Output(),a("design:type",e.EventEmitter)],t.prototype,"idsChanged",void 0),r([e.Output(),a("design:type",e.EventEmitter)],t.prototype,"selection",void 0),r([e.Output(),a("design:type",e.EventEmitter)],t.prototype,"idsSelection",void 0),t=r([e.Component({selector:"cm-select",template:'<cm-select-checkbox [items]="items" [bindLabel]="bindLabel" [bindValue]="bindValue" [options]="options"\n [selected]="selected" [selectedIds]="selectedIds" [loading]="loading" (search)="onSearch($event)"\n (changed)="onChange($event)" (idsChanged)="onIdsChanged($event)" (selection)="onSelection($event)" (idsSelection)="onSelectionChanged($event)">\n</cm-select-checkbox>\n'}),a("design:paramtypes",[])],t)}(),h=function(t){if(!t)return t;var e=[];return t.forEach(function(t){Array.isArray(t)?e.push(h(t)):"object"==typeof t?e.push(u(t)):e.push(t)}),e},u=function(t){var e,n;if(!t)return t;var i=Object.keys(t);if(!i.length)return t;var o={};try{for(var p=d(i),r=p.next();!r.done;r=p.next()){var a=r.value;Array.isArray(t[a])?o[a]=h(t[a]):"object"==typeof t[a]?o[a]=u(t[a]):o[a]=t[a]}}catch(c){e={error:c}}finally{try{r&&!r.done&&(n=p["return"])&&n.call(p)}finally{if(e)throw e.error}}return o},f=function(){function t(){this.bindLabel="name",this.bindValue="id",this.items=[],this.loading=!1,this.selected=[],this.selectedIds=[],this.search=new e.EventEmitter,this.changed=new e.EventEmitter,this.idsChanged=new e.EventEmitter,this.selection=new e.EventEmitter,this.idsSelection=new e.EventEmitter,this.q="",this.tempSelected=[],this.newSelected=[]}return t.prototype.clickedOutside=function(t){if(this.options.single)this.checkedItem=null;else{var e=this.tempSelected.map(function(t){return t.id});this.items.forEach(function(t){e.includes(t.id)?t.checked=!0:"checked"in t&&(t.checked=!1)}),this.selected=s(this.tempSelected)}},t.prototype.ngOnInit=function(){this.newSelected=[],this.options=new m(this.options),this.items=h(this.items),this.setSelectedItems(),this.tempSelected=s(this.selected)},t.prototype.ngOnChanges=function(t){t.items&&this.setSelectedItems(),t.selected&&this.selected&&this.selected.length>1&&(this.tempSelected=s(this.selected))},t.prototype.setSelectedItems=function(){var t=this;this.items=h(this.items),this.selected&&this.selected.length?(this.selected.forEach(function(e){var n,i;try{for(var o=d(t.items),p=o.next();!p.done;p=o.next()){var r=p.value;if(r.id===e.id){r.checked=!0;break}}}catch(a){n={error:a}}finally{try{p&&!p.done&&(i=o["return"])&&i.call(o)}finally{if(n)throw n.error}}}),this.newSelected=this.selected):this.selectedIds&&this.selectedIds.length&&this.selectedIds.forEach(function(e){var n,i;try{for(var o=d(t.items),p=o.next();!p.done;p=o.next()){var r=p.value;if(r.id===e){r.checked=!0;break}}}catch(a){n={error:a}}finally{try{p&&!p.done&&(i=o["return"])&&i.call(o)}finally{if(n)throw n.error}}}),this.selected=this.newSelected},t.prototype.clearSelections=function(){this.tempSelected=[],this.items.forEach(function(t){return t.checked=!1}),this.selected=[],this.emitChange()},t.prototype.applySelections=function(){this.options.single&&(this.selected=this.checkedItem),this.emitChange(this.selected)},t.prototype.emitChange=function(t){this.options.single?(t?(this.changed.emit(this.selected),this.idsChanged.emit(t.id)):(this.changed.emit(null),this.idsChanged.emit(null)),this.selected?(this.selection.emit(this.selected),this.idsSelection.emit(this.selected.map(function(t){return+t.id}))):(this.selection.emit(null),this.idsSelection.emit(null))):(this.newSelected?(this.changed.emit(this.newSelected),this.idsChanged.emit(t.map(function(t){return+t.id}))):(this.changed.emit([]),this.idsChanged.emit([])),t?(this.selection.emit(t),this.idsSelection.emit(t.map(function(t){return+t.id}))):(this.selection.emit([]),this.idsSelection.emit([])))},t.prototype.onSearch=function(t){this.search.emit(t)},t.prototype.onItemChange=function(t){var e=this;t.checked?this.selected.push(t):this.selected=this.selected.filter(function(e){return e.id!==t.id}),this.selected=this.selected.filter(function(t,n){return n===e.selected.findIndex(function(e){return JSON.stringify(e)===JSON.stringify(t)})})},r([e.Input(),a("design:type",m)],t.prototype,"options",void 0),r([e.Input(),a("design:type",Object)],t.prototype,"bindLabel",void 0),r([e.Input(),a("design:type",Object)],t.prototype,"bindValue",void 0),r([e.Input(),a("design:type",Array)],t.prototype,"items",void 0),r([e.Input(),a("design:type",Object)],t.prototype,"loading",void 0),r([e.Input(),a("design:type",Array)],t.prototype,"selected",void 0),r([e.Input(),a("design:type",Array)],t.prototype,"selectedIds",void 0),r([e.Output(),a("design:type",e.EventEmitter)],t.prototype,"search",void 0),r([e.Output(),a("design:type",e.EventEmitter)],t.prototype,"changed",void 0),r([e.Output(),a("design:type",e.EventEmitter)],t.prototype,"idsChanged",void 0),r([e.Output(),a("design:type",e.EventEmitter)],t.prototype,"selection",void 0),r([e.Output(),a("design:type",e.EventEmitter)],t.prototype,"idsSelection",void 0),r([e.HostListener("document:click",["$event"]),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",void 0)],t.prototype,"clickedOutside",null),t=r([e.Component({selector:"cm-select-checkbox",template:'<div class="checkbox-container select-container" [style.top.px]="options.top" (click)="$event.stopPropagation();">\n <div class="select-container__header" *ngIf="options.filter">\n <input libSearchInput class="search-input" type="text" [(ngModel)]="q" placeholder="Search" [text]="q" (inputChanged)="onSearch($event)">\n </div>\n <div class="select-container__body">\n <ng-container *ngIf="!loading">\n <ng-container *ngFor="let item of items | filter: {field: bindLabel, value: q}; let i = index;">\n <div class="checkbox-option">\n <ng-container *ngIf="options.single">\n <input class="app-radio-checkbox mr10" type="radio" [id]="item.id" [(ngModel)]="checkedItem" [value]="item">\n </ng-container>\n <ng-container *ngIf="!options.single">\n <input class="app-checkbox mr10" type="checkbox" [id]="item.id" [(ngModel)]="item.checked" (ngModelChange)="onItemChange(item)">\n </ng-container>\n <img class="checkbox-image" [src]="item[options.imageUrlKey]" [alt]="item[bindLabel] + \' image\'" *ngIf="options.image">\n <label class="checbox-label" [for]="item.id">{{ item[bindLabel] }}</label>\n </div>\n </ng-container>\n </ng-container>\n <ng-container *ngIf="loading">\n {{ options.loadingText }}\n </ng-container>\n </div>\n <div class="select-container__footer">\n <button class="app-btn transparent" (click)="clearSelections()">Clear</button>\n <button class="app-btn primary" (click)="applySelections()">Apply</button>\n </div>\n</div>\n ',styles:['@charset "UTF-8";.app-btn{border:none;outline:0;cursor:pointer;font-size:14px;font-weight:700;border-radius:24px;padding:5px 16px;text-align:center;transition-duration:.2s}.app-btn.primary{background-color:teal;color:#fff}.app-btn.primary:hover{background-color:#006767}.app-btn.secondary{background-color:#de851d;color:#fff}.app-btn.secondary:hover{background-color:#c7771a}.app-btn.outline{background-color:#fff;border:1px solid #caccd1;color:#1d2129}.app-btn.outline:hover{background-color:#f2f2f2}.app-btn.transparent{background-color:transparent;border:none;color:#1d2129}.app-btn.transparent:hover{background-color:#f2f2f2}.app-btn:active,.app-btn:focus{outline:0}.app-btn:disabled{pointer-events:none;cursor:not-allowed;background-color:rgba(29,33,41,.2);color:#fff}input.app-checkbox[type=checkbox]{-webkit-font-smoothing:antialiased;text-rendering:optimizeSpeed;width:16px;height:16px;display:block;position:relative;margin-top:2px;margin-left:0}input.app-checkbox[type=checkbox]:after{content:"";vertical-align:middle;text-align:center;position:absolute;cursor:pointer;height:16px;width:16px;font-size:7px;background:#fff;border:1px solid #caccd1;border-radius:2px;line-height:16px}input.app-checkbox[type=checkbox]:checked:after{background:#1d2129;content:"✓";color:#fff;border:none;font-size:14px}input.app-radio-checkbox[type=radio]{-webkit-font-smoothing:antialiased;text-rendering:optimizeSpeed;width:16px;height:16px;display:block;position:relative;margin-top:2px}input.app-radio-checkbox[type=radio]:after{content:"";vertical-align:middle;text-align:center;position:absolute;cursor:pointer;height:16px;width:16px;font-size:7px;background:#fff;border:1px solid #caccd1;border-radius:2px;line-height:16px;left:-1px;top:1px}input.app-radio-checkbox[type=radio]:checked:after{background:#1d2129;content:"✓";color:#fff;border:none;font-size:14px}.select-container{width:325px;background:#fff;border-radius:4px;box-shadow:0 1px 8px 0 rgba(29,33,41,.3);z-index:999;position:absolute;color:#1d2129;left:0}.select-container__header{padding:0 24px}.select-container__body{height:200px;overflow-y:auto;padding:0 24px}.select-container__footer{background:#f3f4f7;color:#1d2129;height:50px;display:flex;align-items:center;justify-content:flex-end;bottom:0;padding:0 24px}.p0{padding:0!important}.p10{padding:10px!important}.p15{padding:15px!important}.p20{padding:20px!important}.p30{padding:30px!important}.p40{padding:40px!important}.p50{padding:50px!important}.p60{padding:60px!important}.p70{padding:70px!important}.p80{padding:80px!important}.p90{padding:90px!important}.p100{padding:100px!important}.p110{padding:110px!important}.p120{padding:120px!important}.p130{padding:130px!important}.p140{padding:140px!important}.pt10{padding-top:10px!important}.pt15{padding-top:15px!important}.pt20{padding-top:20px!important}.pt30{padding-top:30px!important}.pt40{padding-top:40px!important}.pt50{padding-top:50px!important}.pt60{padding-top:60px!important}.pt70{padding-top:70px!important}.pt80{padding-top:80px!important}.pt90{padding-top:90px!important}.pt100{padding-top:100px!important}.pt110{padding-top:110px!important}.pt120{padding-top:120px!important}.pt130{padding-top:130px!important}.pt140{padding-top:140px!important}.pb0{padding-bottom:0!important}.pb10{padding-bottom:10px!important}.pb15{padding-bottom:15px!important}.pb20{padding-bottom:20px!important}.pb30{padding-bottom:30px!important}.pb40{padding-bottom:40px!important}.pb50{padding-bottom:50px!important}.pb60{padding-bottom:60px!important}.pb70{padding-bottom:70px!important}.pb80{padding-bottom:80px!important}.pb90{padding-bottom:90px!important}.pb100{padding-bottom:100px!important}.pb110{padding-bottom:110px!important}.pb120{padding-bottom:120px!important}.pb130{padding-bottom:130px!important}.pb140{padding-bottom:140px!important}.pl0{padding-left:0!important}.pl3{padding-left:3px!important}.pl5{padding-left:5px!important}.pl10{padding-left:10px!important}.pl20{padding-left:20px!important}.pl30{padding-left:30px}.pl40{padding-left:40px}.pl50{padding-left:50px}.pl60{padding-left:60px}.pl70{padding-left:70px}.pl80{padding-left:80px}.pl90{padding-left:90px}.pl100{padding-left:100px}.pr0{padding-right:0!important}.pr5{padding-right:5px!important}.pr10{padding-right:10px!important}.pr20{padding-right:20px!important}.pr30{padding-right:30px!important}.pr40{padding-right:40px}.pr50{padding-right:50px}.pr60{padding-right:60px}.pr70{padding-right:70px}.pr80{padding-right:80px}.pr90{padding-right:90px}.pr100{padding-right:100px}.pr110{padding-right:110px}.pr120{padding-right:120px}@media (min-width:1200px){.pl-lg-50{padding-left:50px}.pl-lg-80{padding-left:80px}}@media (min-width:992px){.pt-md-50{padding-top:50px}}.mr-auto{margin:auto;float:none}.mt0{margin-top:0!important}.mt5{margin-top:5px!important}.mt10{margin-top:10px!important}.mt20{margin-top:20px!important}.mt30{margin-top:30px!important}.mt40{margin-top:40px!important}.mt50{margin-top:50px!important}.mt60{margin-top:60px!important}.mt70{margin-top:70px!important}.mt80{margin-top:80px!important}.mt90{margin-top:90px!important}.mt100{margin-top:100px!important}.mt110{margin-top:110px!important}.mt120{margin-top:120px!important}.mb0{margin-bottom:0!important}.mb5{margin-bottom:5px!important}.mb10{margin-bottom:10px!important}.mb15{margin-bottom:15px!important}.mb20{margin-bottom:20px!important}.mb30{margin-bottom:30px!important}.mb40{margin-bottom:40px!important}.mb50{margin-bottom:50px}.mb60{margin-bottom:60px}.mb70{margin-bottom:70px}.mb80{margin-bottom:80px}.mb90{margin-bottom:90px}.mb100{margin-bottom:100px}.mb110{margin-bottom:110px}.mb120{margin-bottom:120px}.ml0{margin-left:0!important}.ml15{margin-left:5px}.ml10{margin-left:10px}.ml20{margin-left:20px}.ml30{margin-left:30px}.ml40{margin-left:40px}.ml50{margin-left:50px}.ml60{margin-left:60px}.ml70{margin-left:70px}.ml80{margin-left:80px}.ml90{margin-left:90px}.ml100{margin-left:100px}.ml110{margin-left:110px}.mr0{margin-right:0!important}.mr5{margin-left:5px!important}.mr10{margin-right:10px!important}.mr15{margin-right:15px!important}.mr20{margin-right:20px!important}.mr30{margin-right:30px!important}.mr40{margin-right:40px!important}.mr50{margin-right:50px!important}.mr60{margin-right:60px!important}.mr70{margin-right:70px!important}.mr80{margin-right:80px!important}.mr90{margin-right:90px!important}.mr100{margin-right:100px}.mr110{margin-right:110px}.checkbox-container .select-container__header{display:flex;background-color:#f3f4f7;padding:10px 24px}.checkbox-container .select-container__header .search-input{border:none;width:100%;background-color:transparent}.checkbox-container .select-container__header .search-input:focus{outline:0}.checkbox-container .select-container__body .checkbox-option{text-align:left;font-size:14px;display:flex;align-items:center;margin:8px 0}']}),a("design:paramtypes",[])],t)}(),x=function(){function t(){}return t.prototype.transform=function(t,e){if(!t||!e||!e.value)return t;if(e.field)try{return t.filter(function(t){return t[e.field].toLowerCase().includes(e.value.toLowerCase())})}catch(n){return null}else try{return t.filter(function(t){return t.toLowerCase().includes(e.value.toLowerCase())})}catch(n){return null}},t=r([e.Pipe({name:"filter"})],t)}(),b=function(){function t(){}return t=r([e.NgModule({declarations:[x],exports:[x]})],t)}(),y=function(){function t(t,n){this.searchInputUpdated=new o.Subject,this.inputChanged=new e.EventEmitter,this.subscribeToSearchInput()}return Object.defineProperty(t.prototype,"text",{get:function(){return this.q},set:function(t){this.q=t,this.searchInputUpdated.next(this.q)},enumerable:!0,configurable:!0}),t.prototype.subscribeToSearchInput=function(){var t=this;this.searchChangeEmitter=this.searchInputUpdated.asObservable().pipe(p.debounceTime(300),p.distinctUntilChanged()),this.searchChangeEmitter.subscribe(function(e){t.inputChanged.emit(e)})},r([e.Input(),a("design:type",String),a("design:paramtypes",[String])],t.prototype,"text",null),r([e.Output(),a("design:type",Object)],t.prototype,"inputChanged",void 0),t=r([e.Directive({selector:"[libSearchInput]"}),a("design:paramtypes",[e.ElementRef,e.Renderer2])],t)}(),v=function(){function t(){}return t=r([e.NgModule({declarations:[f,y],imports:[n.CommonModule,i.FormsModule,b],exports:[f]})],t)}(),k=function(){function t(){}return t=r([e.NgModule({declarations:[g],imports:[v],providers:[l],exports:[g]})],t)}();t.CmSelectComponent=g,t.CmSelectModule=k,t.CmSelectService=l,t.ɵa=v,t.ɵb=f,t.ɵc=y,t.ɵd=x,t.ɵe=b,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("cm-select",["exports","@angular/core","@angular/common","@angular/forms","rxjs","rxjs/operators"],e):e((t=t||self)["cm-select"]={},t.ng.core,t.ng.common,t.ng.forms,t.rxjs,t.rxjs.operators)}(this,function(t,e,n,i,o,p){"use strict";function r(t,e,n,i){var o,p=arguments.length,r=p<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(p<3?o(r):p>3?o(e,n,r):o(e,n))||r);return p>3&&r&&Object.defineProperty(e,n,r),r}function a(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function d(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 c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,o,p=n.call(t),r=[];try{for(;(void 0===e||e-- >0)&&!(i=p.next()).done;)r.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=p["return"])&&n.call(p)}finally{if(o)throw o.error}}return r}function s(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(c(arguments[e]));return t}var l=function(){function t(){}return t.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t=r([e.Injectable({providedIn:"root"}),a("design:paramtypes",[])],t)}(),m=function(t){this.filter=!!t&&t.filter,this.image=!!t&&t.image,this.imageUrlKey=t?t.imageUrl:null,this.single=!!t&&t.single,this.top=t?t.top:32,this.loadingText=t?t.loadingText||"Loading ...":"Loading..."},g=function(){function t(){this.bindLabel="name",this.bindValue="id",this.items=[],this.selected=[],this.selectedIds=[],this.loading=!1,this.search=new e.EventEmitter,this.changed=new e.EventEmitter,this.idsChanged=new e.EventEmitter,this.selection=new e.EventEmitter,this.idsSelection=new e.EventEmitter}return t.prototype.ngOnInit=function(){this.options=new m(this.options)},t.prototype.onChange=function(t){this.changed.emit(t)},t.prototype.onIdsChanged=function(t){this.idsChanged.emit(t)},t.prototype.onSearch=function(t){this.search.emit(t)},t.prototype.onSelection=function(t){this.selection.emit(t)},t.prototype.onSelectionChanged=function(t){this.idsSelection.emit(t)},r([e.Input(),a("design:type",m)],t.prototype,"options",void 0),r([e.Input(),a("design:type",Object)],t.prototype,"bindLabel",void 0),r([e.Input(),a("design:type",Object)],t.prototype,"bindValue",void 0),r([e.Input(),a("design:type",Array)],t.prototype,"items",void 0),r([e.Input(),a("design:type",Array)],t.prototype,"selected",void 0),r([e.Input(),a("design:type",Array)],t.prototype,"selectedIds",void 0),r([e.Input(),a("design:type",Object)],t.prototype,"loading",void 0),r([e.Output(),a("design:type",e.EventEmitter)],t.prototype,"search",void 0),r([e.Output(),a("design:type",e.EventEmitter)],t.prototype,"changed",void 0),r([e.Output(),a("design:type",e.EventEmitter)],t.prototype,"idsChanged",void 0),r([e.Output(),a("design:type",e.EventEmitter)],t.prototype,"selection",void 0),r([e.Output(),a("design:type",e.EventEmitter)],t.prototype,"idsSelection",void 0),t=r([e.Component({selector:"cm-select",template:'<cm-select-checkbox [items]="items" [bindLabel]="bindLabel" [bindValue]="bindValue" [options]="options"\n [selected]="selected" [selectedIds]="selectedIds" [loading]="loading" (search)="onSearch($event)"\n (changed)="onChange($event)" (idsChanged)="onIdsChanged($event)" (selection)="onSelection($event)" (idsSelection)="onSelectionChanged($event)">\n</cm-select-checkbox>\n'}),a("design:paramtypes",[])],t)}(),h=function(t){if(!t)return t;var e=[];return t.forEach(function(t){Array.isArray(t)?e.push(h(t)):"object"==typeof t?e.push(u(t)):e.push(t)}),e},u=function(t){var e,n;if(!t)return t;var i=Object.keys(t);if(!i.length)return t;var o={};try{for(var p=d(i),r=p.next();!r.done;r=p.next()){var a=r.value;Array.isArray(t[a])?o[a]=h(t[a]):"object"==typeof t[a]?o[a]=u(t[a]):o[a]=t[a]}}catch(c){e={error:c}}finally{try{r&&!r.done&&(n=p["return"])&&n.call(p)}finally{if(e)throw e.error}}return o},f=function(){function t(){this.bindLabel="name",this.bindValue="id",this.items=[],this.loading=!1,this.selected=[],this.selectedIds=[],this.search=new e.EventEmitter,this.changed=new e.EventEmitter,this.idsChanged=new e.EventEmitter,this.selection=new e.EventEmitter,this.idsSelection=new e.EventEmitter,this.q="",this.tempSelected=[],this.newSelected=[]}return t.prototype.clickedOutside=function(t){if(this.options.single)this.checkedItem=null;else{var e=this.tempSelected.map(function(t){return t.id});this.items.forEach(function(t){e.includes(t.id)?t.checked=!0:"checked"in t&&(t.checked=!1)}),this.selected=s(this.tempSelected)}},t.prototype.ngOnInit=function(){this.newSelected=[],this.options=new m(this.options),this.items=h(this.items),this.setSelectedItems(),this.tempSelected=s(this.selected)},t.prototype.ngOnChanges=function(t){t.items&&this.setSelectedItems(),t.selected&&this.selected&&this.selected.length>1&&(this.tempSelected=s(this.selected))},t.prototype.setSelectedItems=function(){var t=this;this.items=h(this.items),this.selected&&this.selected.length?(this.selected.forEach(function(e){var n,i;try{for(var o=d(t.items),p=o.next();!p.done;p=o.next()){var r=p.value;if(r.id===e.id){r.checked=!0;break}}}catch(a){n={error:a}}finally{try{p&&!p.done&&(i=o["return"])&&i.call(o)}finally{if(n)throw n.error}}}),this.newSelected=this.selected):this.selectedIds&&this.selectedIds.length&&this.selectedIds.forEach(function(e){var n,i;try{for(var o=d(t.items),p=o.next();!p.done;p=o.next()){var r=p.value;if(r.id===e){r.checked=!0;break}}}catch(a){n={error:a}}finally{try{p&&!p.done&&(i=o["return"])&&i.call(o)}finally{if(n)throw n.error}}}),this.selected=this.newSelected},t.prototype.clearSelections=function(){this.tempSelected=[],this.items.forEach(function(t){return t.checked=!1}),this.selected=[],this.emitChange()},t.prototype.applySelections=function(){this.options.single&&(this.selected=this.checkedItem),this.emitChange(this.selected)},t.prototype.emitChange=function(t){this.options.single?(t?(this.changed.emit(this.selected),this.idsChanged.emit(t.id)):(this.changed.emit(null),this.idsChanged.emit(null)),this.selected?(this.selection.emit(this.selected),this.idsSelection.emit(this.selected.map(function(t){return+t.id}))):(this.selection.emit(null),this.idsSelection.emit(null))):(this.newSelected?(this.changed.emit(this.newSelected),this.idsChanged.emit(this.newSelected.map(function(t){return+t.id}))):(this.changed.emit([]),this.idsChanged.emit([])),this.selected?(this.selection.emit(this.selected),this.idsSelection.emit(this.selected.map(function(t){return+t.id}))):(this.selection.emit([]),this.idsSelection.emit([])))},t.prototype.onSearch=function(t){this.search.emit(t)},t.prototype.onItemChange=function(t){var e=this;t.checked?this.selected.push(t):this.selected=this.selected.filter(function(e){return e.id!==t.id}),this.selected=this.selected.filter(function(t,n){return n===e.selected.findIndex(function(e){return JSON.stringify(e)===JSON.stringify(t)})}),t.checked?this.newSelected.push(t):this.newSelected=this.newSelected.filter(function(e){return e.id!==t.id}),this.newSelected=this.newSelected.filter(function(t,n){return n===e.newSelected.findIndex(function(e){return JSON.stringify(e)===JSON.stringify(t)})})},r([e.Input(),a("design:type",m)],t.prototype,"options",void 0),r([e.Input(),a("design:type",Object)],t.prototype,"bindLabel",void 0),r([e.Input(),a("design:type",Object)],t.prototype,"bindValue",void 0),r([e.Input(),a("design:type",Array)],t.prototype,"items",void 0),r([e.Input(),a("design:type",Object)],t.prototype,"loading",void 0),r([e.Input(),a("design:type",Array)],t.prototype,"selected",void 0),r([e.Input(),a("design:type",Array)],t.prototype,"selectedIds",void 0),r([e.Output(),a("design:type",e.EventEmitter)],t.prototype,"search",void 0),r([e.Output(),a("design:type",e.EventEmitter)],t.prototype,"changed",void 0),r([e.Output(),a("design:type",e.EventEmitter)],t.prototype,"idsChanged",void 0),r([e.Output(),a("design:type",e.EventEmitter)],t.prototype,"selection",void 0),r([e.Output(),a("design:type",e.EventEmitter)],t.prototype,"idsSelection",void 0),r([e.HostListener("document:click",["$event"]),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",void 0)],t.prototype,"clickedOutside",null),t=r([e.Component({selector:"cm-select-checkbox",template:'<div class="checkbox-container select-container" [style.top.px]="options.top" (click)="$event.stopPropagation();">\n <div class="select-container__header" *ngIf="options.filter">\n <input libSearchInput class="search-input" type="text" [(ngModel)]="q" placeholder="Search" [text]="q" (inputChanged)="onSearch($event)">\n </div>\n <div class="select-container__body">\n <ng-container *ngIf="!loading">\n <ng-container *ngFor="let item of items | filter: {field: bindLabel, value: q}; let i = index;">\n <div class="checkbox-option">\n <ng-container *ngIf="options.single">\n <input class="app-radio-checkbox mr10" type="radio" [id]="item.id" [(ngModel)]="checkedItem" [value]="item">\n </ng-container>\n <ng-container *ngIf="!options.single">\n <input class="app-checkbox mr10" type="checkbox" [id]="item.id" [(ngModel)]="item.checked" (ngModelChange)="onItemChange(item)">\n </ng-container>\n <img class="checkbox-image" [src]="item[options.imageUrlKey]" [alt]="item[bindLabel] + \' image\'" *ngIf="options.image">\n <label class="checbox-label" [for]="item.id">{{ item[bindLabel] }}</label>\n </div>\n </ng-container>\n </ng-container>\n <ng-container *ngIf="loading">\n {{ options.loadingText }}\n </ng-container>\n </div>\n <div class="select-container__footer">\n <button class="app-btn transparent" (click)="clearSelections()">Clear</button>\n <button class="app-btn primary" (click)="applySelections()">Apply</button>\n </div>\n</div>\n ',styles:['@charset "UTF-8";.app-btn{border:none;outline:0;cursor:pointer;font-size:14px;font-weight:700;border-radius:24px;padding:5px 16px;text-align:center;transition-duration:.2s}.app-btn.primary{background-color:teal;color:#fff}.app-btn.primary:hover{background-color:#006767}.app-btn.secondary{background-color:#de851d;color:#fff}.app-btn.secondary:hover{background-color:#c7771a}.app-btn.outline{background-color:#fff;border:1px solid #caccd1;color:#1d2129}.app-btn.outline:hover{background-color:#f2f2f2}.app-btn.transparent{background-color:transparent;border:none;color:#1d2129}.app-btn.transparent:hover{background-color:#f2f2f2}.app-btn:active,.app-btn:focus{outline:0}.app-btn:disabled{pointer-events:none;cursor:not-allowed;background-color:rgba(29,33,41,.2);color:#fff}input.app-checkbox[type=checkbox]{-webkit-font-smoothing:antialiased;text-rendering:optimizeSpeed;width:16px;height:16px;display:block;position:relative;margin-top:2px;margin-left:0}input.app-checkbox[type=checkbox]:after{content:"";vertical-align:middle;text-align:center;position:absolute;cursor:pointer;height:16px;width:16px;font-size:7px;background:#fff;border:1px solid #caccd1;border-radius:2px;line-height:16px}input.app-checkbox[type=checkbox]:checked:after{background:#1d2129;content:"✓";color:#fff;border:none;font-size:14px}input.app-radio-checkbox[type=radio]{-webkit-font-smoothing:antialiased;text-rendering:optimizeSpeed;width:16px;height:16px;display:block;position:relative;margin-top:2px}input.app-radio-checkbox[type=radio]:after{content:"";vertical-align:middle;text-align:center;position:absolute;cursor:pointer;height:16px;width:16px;font-size:7px;background:#fff;border:1px solid #caccd1;border-radius:2px;line-height:16px;left:-1px;top:1px}input.app-radio-checkbox[type=radio]:checked:after{background:#1d2129;content:"✓";color:#fff;border:none;font-size:14px}.select-container{width:325px;background:#fff;border-radius:4px;box-shadow:0 1px 8px 0 rgba(29,33,41,.3);z-index:999;position:absolute;color:#1d2129;left:0}.select-container__header{padding:0 24px}.select-container__body{height:200px;overflow-y:auto;padding:0 24px}.select-container__footer{background:#f3f4f7;color:#1d2129;height:50px;display:flex;align-items:center;justify-content:flex-end;bottom:0;padding:0 24px}.p0{padding:0!important}.p10{padding:10px!important}.p15{padding:15px!important}.p20{padding:20px!important}.p30{padding:30px!important}.p40{padding:40px!important}.p50{padding:50px!important}.p60{padding:60px!important}.p70{padding:70px!important}.p80{padding:80px!important}.p90{padding:90px!important}.p100{padding:100px!important}.p110{padding:110px!important}.p120{padding:120px!important}.p130{padding:130px!important}.p140{padding:140px!important}.pt10{padding-top:10px!important}.pt15{padding-top:15px!important}.pt20{padding-top:20px!important}.pt30{padding-top:30px!important}.pt40{padding-top:40px!important}.pt50{padding-top:50px!important}.pt60{padding-top:60px!important}.pt70{padding-top:70px!important}.pt80{padding-top:80px!important}.pt90{padding-top:90px!important}.pt100{padding-top:100px!important}.pt110{padding-top:110px!important}.pt120{padding-top:120px!important}.pt130{padding-top:130px!important}.pt140{padding-top:140px!important}.pb0{padding-bottom:0!important}.pb10{padding-bottom:10px!important}.pb15{padding-bottom:15px!important}.pb20{padding-bottom:20px!important}.pb30{padding-bottom:30px!important}.pb40{padding-bottom:40px!important}.pb50{padding-bottom:50px!important}.pb60{padding-bottom:60px!important}.pb70{padding-bottom:70px!important}.pb80{padding-bottom:80px!important}.pb90{padding-bottom:90px!important}.pb100{padding-bottom:100px!important}.pb110{padding-bottom:110px!important}.pb120{padding-bottom:120px!important}.pb130{padding-bottom:130px!important}.pb140{padding-bottom:140px!important}.pl0{padding-left:0!important}.pl3{padding-left:3px!important}.pl5{padding-left:5px!important}.pl10{padding-left:10px!important}.pl20{padding-left:20px!important}.pl30{padding-left:30px}.pl40{padding-left:40px}.pl50{padding-left:50px}.pl60{padding-left:60px}.pl70{padding-left:70px}.pl80{padding-left:80px}.pl90{padding-left:90px}.pl100{padding-left:100px}.pr0{padding-right:0!important}.pr5{padding-right:5px!important}.pr10{padding-right:10px!important}.pr20{padding-right:20px!important}.pr30{padding-right:30px!important}.pr40{padding-right:40px}.pr50{padding-right:50px}.pr60{padding-right:60px}.pr70{padding-right:70px}.pr80{padding-right:80px}.pr90{padding-right:90px}.pr100{padding-right:100px}.pr110{padding-right:110px}.pr120{padding-right:120px}@media (min-width:1200px){.pl-lg-50{padding-left:50px}.pl-lg-80{padding-left:80px}}@media (min-width:992px){.pt-md-50{padding-top:50px}}.mr-auto{margin:auto;float:none}.mt0{margin-top:0!important}.mt5{margin-top:5px!important}.mt10{margin-top:10px!important}.mt20{margin-top:20px!important}.mt30{margin-top:30px!important}.mt40{margin-top:40px!important}.mt50{margin-top:50px!important}.mt60{margin-top:60px!important}.mt70{margin-top:70px!important}.mt80{margin-top:80px!important}.mt90{margin-top:90px!important}.mt100{margin-top:100px!important}.mt110{margin-top:110px!important}.mt120{margin-top:120px!important}.mb0{margin-bottom:0!important}.mb5{margin-bottom:5px!important}.mb10{margin-bottom:10px!important}.mb15{margin-bottom:15px!important}.mb20{margin-bottom:20px!important}.mb30{margin-bottom:30px!important}.mb40{margin-bottom:40px!important}.mb50{margin-bottom:50px}.mb60{margin-bottom:60px}.mb70{margin-bottom:70px}.mb80{margin-bottom:80px}.mb90{margin-bottom:90px}.mb100{margin-bottom:100px}.mb110{margin-bottom:110px}.mb120{margin-bottom:120px}.ml0{margin-left:0!important}.ml15{margin-left:5px}.ml10{margin-left:10px}.ml20{margin-left:20px}.ml30{margin-left:30px}.ml40{margin-left:40px}.ml50{margin-left:50px}.ml60{margin-left:60px}.ml70{margin-left:70px}.ml80{margin-left:80px}.ml90{margin-left:90px}.ml100{margin-left:100px}.ml110{margin-left:110px}.mr0{margin-right:0!important}.mr5{margin-left:5px!important}.mr10{margin-right:10px!important}.mr15{margin-right:15px!important}.mr20{margin-right:20px!important}.mr30{margin-right:30px!important}.mr40{margin-right:40px!important}.mr50{margin-right:50px!important}.mr60{margin-right:60px!important}.mr70{margin-right:70px!important}.mr80{margin-right:80px!important}.mr90{margin-right:90px!important}.mr100{margin-right:100px}.mr110{margin-right:110px}.checkbox-container .select-container__header{display:flex;background-color:#f3f4f7;padding:10px 24px}.checkbox-container .select-container__header .search-input{border:none;width:100%;background-color:transparent}.checkbox-container .select-container__header .search-input:focus{outline:0}.checkbox-container .select-container__body .checkbox-option{text-align:left;font-size:14px;display:flex;align-items:center;margin:8px 0}']}),a("design:paramtypes",[])],t)}(),x=function(){function t(){}return t.prototype.transform=function(t,e){if(!t||!e||!e.value)return t;if(e.field)try{return t.filter(function(t){return t[e.field].toLowerCase().includes(e.value.toLowerCase())})}catch(n){return null}else try{return t.filter(function(t){return t.toLowerCase().includes(e.value.toLowerCase())})}catch(n){return null}},t=r([e.Pipe({name:"filter"})],t)}(),b=function(){function t(){}return t=r([e.NgModule({declarations:[x],exports:[x]})],t)}(),y=function(){function t(t,n){this.searchInputUpdated=new o.Subject,this.inputChanged=new e.EventEmitter,this.subscribeToSearchInput()}return Object.defineProperty(t.prototype,"text",{get:function(){return this.q},set:function(t){this.q=t,this.searchInputUpdated.next(this.q)},enumerable:!0,configurable:!0}),t.prototype.subscribeToSearchInput=function(){var t=this;this.searchChangeEmitter=this.searchInputUpdated.asObservable().pipe(p.debounceTime(300),p.distinctUntilChanged()),this.searchChangeEmitter.subscribe(function(e){t.inputChanged.emit(e)})},r([e.Input(),a("design:type",String),a("design:paramtypes",[String])],t.prototype,"text",null),r([e.Output(),a("design:type",Object)],t.prototype,"inputChanged",void 0),t=r([e.Directive({selector:"[libSearchInput]"}),a("design:paramtypes",[e.ElementRef,e.Renderer2])],t)}(),v=function(){function t(){}return t=r([e.NgModule({declarations:[f,y],imports:[n.CommonModule,i.FormsModule,b],exports:[f]})],t)}(),k=function(){function t(){}return t=r([e.NgModule({declarations:[g],imports:[v],providers:[l],exports:[g]})],t)}();t.CmSelectComponent=g,t.CmSelectModule=k,t.CmSelectService=l,t.ɵa=v,t.ɵb=f,t.ɵc=y,t.ɵd=x,t.ɵe=b,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=cm-select.umd.min.js.map |
@@ -128,3 +128,3 @@ import * as tslib_1 from "tslib"; | ||
this.changed.emit(this.newSelected); | ||
this.idsChanged.emit(selected.map(i => +i.id)); | ||
this.idsChanged.emit(this.newSelected.map(i => +i.id)); | ||
} | ||
@@ -135,5 +135,5 @@ else { | ||
} | ||
if (selected) { | ||
this.selection.emit(selected); | ||
this.idsSelection.emit(selected.map(i => +i.id)); | ||
if (this.selected) { | ||
this.selection.emit(this.selected); | ||
this.idsSelection.emit(this.selected.map(i => +i.id)); | ||
} | ||
@@ -161,2 +161,13 @@ else { | ||
}); | ||
if (item.checked) { | ||
this.newSelected.push(item); | ||
} | ||
else { | ||
this.newSelected = this.newSelected.filter(i => i.id !== item.id); | ||
} | ||
this.newSelected = this.newSelected.filter((thing, index) => { | ||
return index === this.newSelected.findIndex(obj => { | ||
return JSON.stringify(obj) === JSON.stringify(thing); | ||
}); | ||
}); | ||
} | ||
@@ -227,2 +238,2 @@ }; | ||
export { CheckboxComponent }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hlY2tib3guY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vY20tc2VsZWN0LyIsInNvdXJjZXMiOlsibGliL2NoZWNrYm94L2NoZWNrYm94LmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLFNBQVMsRUFBVSxLQUFLLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBNEIsWUFBWSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRXZILE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUM1QyxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFPakQsSUFBYSxpQkFBaUIsR0FBOUIsTUFBYSxpQkFBaUI7SUF3QzVCO1FBckNTLGNBQVMsR0FBRyxNQUFNLENBQUM7UUFDbkIsY0FBUyxHQUFHLElBQUksQ0FBQztRQUNqQixVQUFLLEdBQWUsRUFBRSxDQUFDO1FBQ3ZCLFlBQU8sR0FBRyxLQUFLLENBQUM7UUFDaEIsYUFBUSxHQUFnQixFQUFFLENBQUM7UUFDM0IsZ0JBQVcsR0FBYSxFQUFFLENBQUM7UUFDMUIsV0FBTSxHQUF5QixJQUFJLFlBQVksRUFBRSxDQUFDO1FBQ2xELFlBQU8sR0FBNkIsSUFBSSxZQUFZLEVBQUUsQ0FBQztRQUN2RCxlQUFVLEdBQTJCLElBQUksWUFBWSxFQUFFLENBQUM7UUFDeEQsY0FBUyx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7XG4gICAgICB0aGlzLm5ld1NlbGVjdGVkLnB1c2goaXRlbSk7XG4gICAgfSBlbHNlIHtcbiAgICAgIHRoaXMubmV3U2VsZWN0ZWQgPSB0aGlzLm5ld1NlbGVjdGVkLmZpbHRlcihpID0+IGkuaWQgIT09IGl0ZW0uaWQpO1xuICAgIH1cbiAgICB0aGlzLm5ld1NlbGVjdGVkID0gdGhpcy5uZXdTZWxlY3RlZC5maWx0ZXIoKHRoaW5nLCBpbmRleCkgPT4ge1xuICAgICAgcmV0dXJuIGluZGV4ID09PSB0aGlzLm5ld1NlbGVjdGVkLmZpbmRJbmRleChvYmogPT4ge1xuICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkob2JqKSA9PT0gSlNPTi5zdHJpbmdpZnkodGhpbmcpO1xuICAgICAgfSk7XG4gICAgfSk7XG4gIH1cblxufVxuIl19 |
@@ -151,3 +151,3 @@ import * as tslib_1 from "tslib"; | ||
this.changed.emit(this.newSelected); | ||
this.idsChanged.emit(selected.map(function (i) { return +i.id; })); | ||
this.idsChanged.emit(this.newSelected.map(function (i) { return +i.id; })); | ||
} | ||
@@ -158,5 +158,5 @@ else { | ||
} | ||
if (selected) { | ||
this.selection.emit(selected); | ||
this.idsSelection.emit(selected.map(function (i) { return +i.id; })); | ||
if (this.selected) { | ||
this.selection.emit(this.selected); | ||
this.idsSelection.emit(this.selected.map(function (i) { return +i.id; })); | ||
} | ||
@@ -185,2 +185,13 @@ else { | ||
}); | ||
if (item.checked) { | ||
this.newSelected.push(item); | ||
} | ||
else { | ||
this.newSelected = this.newSelected.filter(function (i) { return i.id !== item.id; }); | ||
} | ||
this.newSelected = this.newSelected.filter(function (thing, index) { | ||
return index === _this.newSelected.findIndex(function (obj) { | ||
return JSON.stringify(obj) === JSON.stringify(thing); | ||
}); | ||
}); | ||
}; | ||
@@ -252,2 +263,2 @@ tslib_1.__decorate([ | ||
export { CheckboxComponent }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW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zLnNlbGVjdGVkLmZpbHRlcigodGhpbmcsIGluZGV4KSA9PiB7XG4gICAgICByZXR1cm4gaW5kZXggPT09IHRoaXMuc2VsZWN0ZWQuZmluZEluZGV4KG9iaiA9PiB7XG4gICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShvYmopID09PSBKU09OLnN0cmluZ2lmeSh0aGluZyk7XG4gICAgICB9KTtcbiAgICB9KTtcbiAgICBpZiAoaXRlbS5jaGVja2VkKSB7XG4gICAgICB0aGlzLm5ld1NlbGVjdGVkLnB1c2goaXRlbSk7XG4gICAgfSBlbHNlIHtcbiAgICAgIHRoaXMubmV3U2VsZWN0ZWQgPSB0aGlzLm5ld1NlbGVjdGVkLmZpbHRlcihpID0+IGkuaWQgIT09IGl0ZW0uaWQpO1xuICAgIH1cbiAgICB0aGlzLm5ld1NlbGVjdGVkID0gdGhpcy5uZXdTZWxlY3RlZC5maWx0ZXIoKHRoaW5nLCBpbmRleCkgPT4ge1xuICAgICAgcmV0dXJuIGluZGV4ID09PSB0aGlzLm5ld1NlbGVjdGVkLmZpbmRJbmRleChvYmogPT4ge1xuICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkob2JqKSA9PT0gSlNPTi5zdHJpbmdpZnkodGhpbmcpO1xuICAgICAgfSk7XG4gICAgfSk7XG4gIH1cblxufVxuIl19 |
@@ -287,3 +287,3 @@ import { __decorate, __metadata } from 'tslib'; | ||
this.changed.emit(this.newSelected); | ||
this.idsChanged.emit(selected.map(i => +i.id)); | ||
this.idsChanged.emit(this.newSelected.map(i => +i.id)); | ||
} | ||
@@ -294,5 +294,5 @@ else { | ||
} | ||
if (selected) { | ||
this.selection.emit(selected); | ||
this.idsSelection.emit(selected.map(i => +i.id)); | ||
if (this.selected) { | ||
this.selection.emit(this.selected); | ||
this.idsSelection.emit(this.selected.map(i => +i.id)); | ||
} | ||
@@ -320,2 +320,13 @@ else { | ||
}); | ||
if (item.checked) { | ||
this.newSelected.push(item); | ||
} | ||
else { | ||
this.newSelected = this.newSelected.filter(i => i.id !== item.id); | ||
} | ||
this.newSelected = this.newSelected.filter((thing, index) => { | ||
return index === this.newSelected.findIndex(obj => { | ||
return JSON.stringify(obj) === JSON.stringify(thing); | ||
}); | ||
}); | ||
} | ||
@@ -322,0 +333,0 @@ }; |
@@ -325,3 +325,3 @@ import { __decorate, __metadata, __values, __spread } from 'tslib'; | ||
this.changed.emit(this.newSelected); | ||
this.idsChanged.emit(selected.map(function (i) { return +i.id; })); | ||
this.idsChanged.emit(this.newSelected.map(function (i) { return +i.id; })); | ||
} | ||
@@ -332,5 +332,5 @@ else { | ||
} | ||
if (selected) { | ||
this.selection.emit(selected); | ||
this.idsSelection.emit(selected.map(function (i) { return +i.id; })); | ||
if (this.selected) { | ||
this.selection.emit(this.selected); | ||
this.idsSelection.emit(this.selected.map(function (i) { return +i.id; })); | ||
} | ||
@@ -359,2 +359,13 @@ else { | ||
}); | ||
if (item.checked) { | ||
this.newSelected.push(item); | ||
} | ||
else { | ||
this.newSelected = this.newSelected.filter(function (i) { return i.id !== item.id; }); | ||
} | ||
this.newSelected = this.newSelected.filter(function (thing, index) { | ||
return index === _this.newSelected.findIndex(function (obj) { | ||
return JSON.stringify(obj) === JSON.stringify(thing); | ||
}); | ||
}); | ||
}; | ||
@@ -361,0 +372,0 @@ __decorate([ |
{ | ||
"name": "cm-select", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"peerDependencies": { | ||
@@ -5,0 +5,0 @@ "@angular/common": "^8.1.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
370848
3163