UNPKG

@schoolbelle/common

Version:

Demo library to showcase Angular packaging format

2 lines 4.77 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("ngx-bootstrap/modal/bs-modal-ref.service"),require("ngx-bootstrap/modal"),require("rxjs/add/operator/take"),require("@angular/common")):"function"==typeof define&&define.amd?define("@schoolbelle/common/services/dialog",["exports","@angular/core","ngx-bootstrap/modal/bs-modal-ref.service","ngx-bootstrap/modal","rxjs/add/operator/take","@angular/common"],e):e((t.schoolbelle=t.schoolbelle||{},t.schoolbelle.common=t.schoolbelle.common||{},t.schoolbelle.common.services=t.schoolbelle.common.services||{},t.schoolbelle.common.services.dialog={}),t.ng.core,null,null,t.rxjs["add/operator/take"],t.ng.common)}(this,function(t,o,e,n,i,r){"use strict";var c=function(t,e){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)};function s(t,e){function o(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}var a=function(){function t(t){this.modalRef=t,this.action=new o.EventEmitter}return t.prototype.ok=function(t){void 0===t&&(t=!0),this.modalRef.hide(),this.action.emit(t)},t.prototype.cancel=function(){this.modalRef.hide(),this.action.emit(!1)},t.decorators=[{type:o.Component,args:[{template:""}]}],t.ctorParameters=function(){return[{type:e.BsModalRef}]},t.propDecorators={title:[{type:o.Input}],message:[{type:o.Input}]},t}(),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.decorators=[{type:o.Component,args:[{selector:"dialog-confirm",template:'<div *ngIf="title" class="card-header" [innerHTML]="title"></div>\n<div *ngIf="message" class="card-body" [innerHTML]="message"></div>\n<div class="modal-footer">\n <button type="button" class="btn btn-outline-danger" (click)="modalRef.hide(); action.emit(false)" i18n>Cancel</button>\n <button type="button" class="btn btn-outline-primary" (click)="modalRef.hide(); action.emit(true)" i18n>Confirm</button>\n</div>\n'}]}],e}(a),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.decorators=[{type:o.Component,args:[{selector:"dialog-alert",template:'<div class="card">\n <div *ngIf="title" class="card-header" [innerHTML]="title"></div>\n <div *ngIf="message" class="card-body" [innerHTML]="message"></div>\n <div class="card-footer text-right">\n <button type="button" class="btn btn-outline-danger" (click)="modalRef.hide(); action.emit(true)" i18n>Close</button>\n </div>\n</div> \n'}]}],e}(a),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.selections=[],t}return s(t,e),t.prototype.select=function(t){this.modalRef.hide(),this.action.emit(t)},t.decorators=[{type:o.Component,args:[{selector:"dialog-select",template:'<div *ngIf="title" class="card-header" [innerHTML]="title"></div>\n<div class="card-body">\n <button class="btn btn-block btn-outline-dark" *ngFor="let selection of selections; index as i" (click)="select(i)" [innerHTML]="selection.html" [ngClass]="selection.class"></button>\n <button type="button" class="btn btn-block btn-outline-danger" (click)="cancel()" i18n>Cancel</button>\n</div>\n'}]}],t.propDecorators={selections:[{type:o.Input}]},t}(a),p=function(){function t(t){this.modalService=t}return t.prototype.confirm=function(n,i,r){var c=this;return void 0===n&&(n=""),void 0===i&&(i=""),void 0===r&&(r={}),new Promise(function(e,o){var t=c.modalService.show(l,Object.assign({},r,{backdrop:"static"}));t.content.title=n,t.content.message=i,t.content.action.take(1).subscribe(function(t){!1!==t?e(t):o(t)})})},t.prototype.alert=function(n,i,r){var c=this;return void 0===n&&(n=""),void 0===i&&(i=""),void 0===r&&(r={}),new Promise(function(e,o){var t=c.modalService.show(d,Object.assign({},r,{backdrop:"static"}));t.content.title=n,t.content.message=i,t.content.action.take(1).subscribe(function(t){!1!==t?e(t):o(t)})})},t.prototype.select=function(n,i,r){var c=this;return void 0===n&&(n=""),void 0===r&&(r={}),new Promise(function(e,o){var t=c.modalService.show(u,Object.assign({},r,{backdrop:"static"}));t.content.title=n,t.content.selections=i,t.content.action.take(1).subscribe(function(t){!1!==t?e(t):o(t)})})},t.decorators=[{type:o.Injectable}],t.ctorParameters=function(){return[{type:n.BsModalService}]},t}(),m=function(){function t(){}return t.decorators=[{type:o.NgModule,args:[{imports:[r.CommonModule,n.ModalModule.forRoot()],entryComponents:[l,d,u],declarations:[a,l,d,u],providers:[p]}]}],t}();t.DialogModule=m,t.DialogService=p,t.ɵb=a,t.ɵc=d,t.ɵa=l,t.ɵd=u,Object.defineProperty(t,"__esModule",{value:!0})}); //# sourceMappingURL=schoolbelle-common-services-dialog.umd.min.js.map