vibe-sharedui
Version:
EuroMonitor EMI vibe models
2 lines • 5.47 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("@angular/material"),require("@angular/flex-layout"),require("@angular/router"),require("@angular/material/core"),require("@angular/material/datepicker"),require("@angular/material/dialog"),require("@angular/common/http"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("vibe-sharedui",["exports","@angular/core","@angular/common","@angular/forms","@angular/material","@angular/flex-layout","@angular/router","@angular/material/core","@angular/material/datepicker","@angular/material/dialog","@angular/common/http","rxjs","rxjs/operators"],e):e((t=t||self)["vibe-sharedui"]={},t.ng.core,t.ng.common,t.ng.forms,t.ng.material,t.ng["flex-layout"],t.ng.router,t.ng.material.core,t.ng.material.datepicker,t.ng.material.dialog,t.ng.common.http,t.rxjs,t.rxjs.operators)}(this,function(t,e,r,o,a,n,i,u,l,s,d,c,p){"use strict";var M=[a.MatAutocompleteModule,a.MatButtonModule,a.MatBadgeModule,a.MatButtonToggleModule,a.MatCheckboxModule,a.MatToolbarModule,a.MatTooltipModule,a.MatCardModule,a.MatChipsModule,a.MatDatepickerModule,a.MatExpansionModule,a.MatFormFieldModule,a.MatGridListModule,a.MatIconModule,a.MatListModule,a.MatMenuModule,a.MatNativeDateModule,a.MatPaginatorModule,a.MatProgressBarModule,a.MatProgressSpinnerModule,a.MatRadioModule,a.MatRippleModule,a.MatSelectModule,a.MatSidenavModule,a.MatInputModule,a.MatSliderModule,a.MatSlideToggleModule,a.MatSnackBarModule,a.MatSortModule,a.MatTableModule,a.MatTabsModule,a.MatStepperModule,a.MatTreeModule],h=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:M,exports:M}]}],t}(),g=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[n.FlexLayoutModule.withConfig({useColumnBasisZero:!1})],exports:[n.FlexLayoutModule]}]}],t}(),f=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[r.CommonModule],exports:[r.CommonModule,i.RouterModule,h,o.ReactiveFormsModule,o.FormsModule,g]}]}],t}(),m=[l.MatDatepickerModule,u.MatNativeDateModule],y={parse:{dateInput:"LL"},display:{dateInput:"LL",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},b=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{exports:m,providers:[{provide:u.MAT_DATE_FORMATS,useValue:y},{provide:u.MAT_DATE_LOCALE,useValue:"en-GB"}]}]}],t}(),S=function(){function t(t,e){this.data=t,this.dialogRef=e,this.title=t.title,this.entity=t.payload}return t.prototype.ngOnInit=function(){this.buildForm(this.entity)},t.prototype.submit=function(){this.dialogRef.close(this.entityForm.value)},t.ctorParameters=function(){return[{type:undefined,decorators:[{type:e.Inject,args:[s.MAT_DIALOG_DATA]}]},{type:s.MatDialogRef}]},t}(),x=function(){function t(t,e){this.httpClient=t,this.loadingSubject=new c.BehaviorSubject(!1),this.loading$=this.loadingSubject.asObservable(),this.baseUrl=e.API_BASE_URL}return t.prototype.getById=function(t){return this.httpClient.get(this.baseUrl+"/"+this.entityPath+"/"+t).pipe(p.catchError(this.handleError))},t.prototype.findAll=function(t,e,r,o){var a=this;return void 0===e&&(e="DESC"),void 0===r&&(r=0),void 0===o&&(o=100),this.loadingSubject.next(!0),this.httpClient.get(this.baseUrl+"/"+this.entityPath,{params:(new d.HttpParams).set("filter","filter TODO").set("order",e).set("skip",r.toString()).set("take",o.toString())}).pipe(p.retry(3),p.catchError(this.handleError),p.finalize(function(){return a.loadingSubject.next(!1)}))},t.prototype.getAll=function(){var t=this;return this.loadingSubject.next(!0),this.httpClient.get(this.baseUrl+"/"+this.entityPath).pipe(p.retry(3),p.catchError(this.handleError),p.finalize(function(){return t.loadingSubject.next(!1)}))},t.prototype["delete"]=function(t){var e=this;return this.loadingSubject.next(!0),this.httpClient["delete"](this.baseUrl+"/"+this.entityPath+"/"+t).pipe(p.catchError(this.handleError),p.finalize(function(){return e.loadingSubject.next(!1)}))},t.prototype.post=function(t){var e=this;return this.loadingSubject.next(!0),this.httpClient.post(this.baseUrl+"/"+this.entityPath,t).pipe(p.catchError(this.handleError),p.finalize(function(){return e.loadingSubject.next(!1)}))},t.prototype.put=function(t,e){var r=this;return console.log(e),this.loadingSubject.next(!0),this.httpClient.put(this.baseUrl+"/"+this.entityPath+"/"+t,e).pipe(p.catchError(this.handleError),p.finalize(function(){return r.loadingSubject.next(!1)}))},t.prototype.handleError=function(t){var e;return e="string"==typeof t?t:t.error instanceof ErrorEvent?"An error occurred: "+t.error.message:"Backend returned code "+t.status+", with body "+t.message,console.error(t),c.throwError(e)},t.prototype.convertToJson=function(t){return t},t.ctorParameters=function(){return[{type:d.HttpClient},{type:undefined,decorators:[{type:e.Inject,args:["environment"]}]}]},t}(),v=function(){return function(t){Object.assign(this,t)}}(),E=function(){return function(t){var e=this;this.header=this.property,this.visible=!0,this.displayFn=function(t){return t[e.property]},Object.assign(this,t)}}();t.Entity=v,t.EntityColumnDef=E,t.EntityFormComponent=S,t.EntityService=x,t.SFGSharedMaterialModule=h,t.SharedFlexLayoutModule=g,t.SharedMaterialDateModule=b,t.SharedModule=f,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=vibe-sharedui.umd.min.js.map