@rosoftlab/core 1.0.4-alpha-11 → 1.0.21-alpha-1

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.
Files changed (58) hide show
  1. package/fesm2022/rosoftlab-core.mjs +433 -373
  2. package/fesm2022/rosoftlab-core.mjs.map +1 -1
  3. package/package.json +9 -9
  4. package/types/rosoftlab-core.d.ts +460 -0
  5. package/index.d.ts +0 -5
  6. package/lib/auth/auth.service.d.ts +0 -29
  7. package/lib/auth/index.d.ts +0 -4
  8. package/lib/auth/provide-auth.d.ts +0 -3
  9. package/lib/auth/tokens.d.ts +0 -5
  10. package/lib/auth/user-manager.factory.d.ts +0 -5
  11. package/lib/base-components/base-form-edit.component.d.ts +0 -56
  12. package/lib/base-components/field-error-display/field-error-display.component.d.ts +0 -7
  13. package/lib/base-components/index.d.ts +0 -3
  14. package/lib/base-components/page-not-found/page-not-found.component.d.ts +0 -8
  15. package/lib/base-components/under-construction/under-construction.component.d.ts +0 -6
  16. package/lib/configurations.d.ts +0 -6
  17. package/lib/constants/symbols.d.ts +0 -1
  18. package/lib/converters/date/date.converter.d.ts +0 -5
  19. package/lib/core.d.ts +0 -10
  20. package/lib/decorators/attribute.decorator.d.ts +0 -2
  21. package/lib/decorators/base-datastore-config.decorator.d.ts +0 -1
  22. package/lib/decorators/base-model-config.decorator.d.ts +0 -1
  23. package/lib/decorators/custom.type.decorator.d.ts +0 -1
  24. package/lib/grid-layout-format.enum.d.ts +0 -12
  25. package/lib/index.d.ts +0 -26
  26. package/lib/interceptors/cache.interceptor.d.ts +0 -13
  27. package/lib/interceptors/index.d.ts +0 -1
  28. package/lib/interfaces/attribute-decorator-options.interface.d.ts +0 -8
  29. package/lib/interfaces/datastore-config.interface.d.ts +0 -8
  30. package/lib/interfaces/model-config.interface.d.ts +0 -10
  31. package/lib/interfaces/overrides.interface.d.ts +0 -5
  32. package/lib/interfaces/property-converter.interface.d.ts +0 -4
  33. package/lib/models/base-meta.model.d.ts +0 -5
  34. package/lib/models/base-query-data.d.ts +0 -7
  35. package/lib/models/base.model.d.ts +0 -31
  36. package/lib/models/error-response.model.d.ts +0 -17
  37. package/lib/models/filter-request.d.ts +0 -8
  38. package/lib/models/metadata-storage.d.ts +0 -5
  39. package/lib/models/rule.d.ts +0 -5
  40. package/lib/pipes/Nl2brPipe.pipe.d.ts +0 -7
  41. package/lib/pipes/input-error.pipe.d.ts +0 -10
  42. package/lib/providers.d.ts +0 -2
  43. package/lib/resolvers/dynamically-class-resolver.d.ts +0 -3
  44. package/lib/resolvers/dynamically-service-resolver.d.ts +0 -3
  45. package/lib/resolvers/index.d.ts +0 -2
  46. package/lib/rsl-base-module.d.ts +0 -13
  47. package/lib/services/base-datastore.service.d.ts +0 -47
  48. package/lib/services/base.service.d.ts +0 -27
  49. package/lib/services/cache.service.d.ts +0 -11
  50. package/lib/services/datastore.service.d.ts +0 -12
  51. package/lib/services/dialog.service.d.ts +0 -7
  52. package/lib/services/index.d.ts +0 -8
  53. package/lib/services/local-file.service.d.ts +0 -11
  54. package/lib/services/route-history.service.d.ts +0 -12
  55. package/lib/services/translate-loader.service.d.ts +0 -14
  56. package/lib/utils.d.ts +0 -2
  57. package/lib/validators/pattern-validator.d.ts +0 -4
  58. package/public-api.d.ts +0 -1
@@ -1,18 +1,18 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, InjectionToken, inject, Input, Component, Inject, Pipe, NgModule } from '@angular/core';
2
+ import { Injectable, InjectionToken, inject, Input, Component, Inject, NgModule } from '@angular/core';
3
3
  import * as i1 from 'oidc-client-ts';
4
4
  import { UserManager } from 'oidc-client-ts';
5
- import { BehaviorSubject, Observable, throwError, of, ReplaySubject } from 'rxjs';
5
+ import { BehaviorSubject, Observable, throwError, ReplaySubject } from 'rxjs';
6
6
  import * as i5 from '@angular/common';
7
7
  import { DatePipe, DecimalPipe, PercentPipe, CommonModule } from '@angular/common';
8
8
  import * as i1$2 from '@angular/forms';
9
- import { UntypedFormGroup, UntypedFormControl, Validators, ReactiveFormsModule } from '@angular/forms';
9
+ import { UntypedFormGroup, UntypedFormControl, ReactiveFormsModule, Validators } from '@angular/forms';
10
10
  import * as i2 from '@angular/router';
11
11
  import { NavigationEnd } from '@angular/router';
12
- import * as i1$3 from '@ngx-translate/core';
12
+ import * as i4 from '@ngx-translate/core';
13
13
  import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
14
14
  import * as i1$1 from '@angular/common/http';
15
- import { HttpHeaders, HttpParams, HttpResponse, HttpClient, HttpClientModule } from '@angular/common/http';
15
+ import { HttpHeaders, HttpParams, HttpClient } from '@angular/common/http';
16
16
  import { compare } from 'fast-json-patch';
17
17
  import queryString from 'query-string';
18
18
  import { map, catchError, tap, filter } from 'rxjs/operators';
@@ -93,10 +93,10 @@ class AuthService {
93
93
  async signout() {
94
94
  await this.manager.signoutRedirect();
95
95
  }
96
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AuthService, deps: [{ token: i1.UserManager }], target: i0.ɵɵFactoryTarget.Injectable }); }
97
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AuthService, providedIn: 'root' }); }
96
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AuthService, deps: [{ token: i1.UserManager }], target: i0.ɵɵFactoryTarget.Injectable }); }
97
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AuthService, providedIn: 'root' }); }
98
98
  }
99
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AuthService, decorators: [{
99
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AuthService, decorators: [{
100
100
  type: Injectable,
101
101
  args: [{ providedIn: 'root' }]
102
102
  }], ctorParameters: () => [{ type: i1.UserManager }] });
@@ -121,12 +121,12 @@ function provideAuth(settings) {
121
121
  }
122
122
 
123
123
  class FieldErrorDisplayComponent {
124
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: FieldErrorDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
125
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.8", type: FieldErrorDisplayComponent, isStandalone: false, selector: "rsl-field-error-display", inputs: { errorMsg: "errorMsg", displayError: "displayError" }, ngImport: i0, template: "<div *ngIf=\"displayError\" >\n <!-- <span class=\"glyphicon glyphicon-remove form-control-feedback fix-error-icon\"></span> -->\n <span class=\"sr-only\">(error)</span>\n <div class=\"error-msg\">\n {{ errorMsg }}\n </div>\n</div>\n", styles: [".error-msg{color:red}.fix-error-icon{top:27px}\n"] }); }
124
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: FieldErrorDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
125
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: FieldErrorDisplayComponent, isStandalone: false, selector: "rsl-field-error-display", inputs: { errorMsg: "errorMsg", displayError: "displayError" }, ngImport: i0, template: "@if (displayError) {\r\n <div >\r\n <!-- <span class=\"glyphicon glyphicon-remove form-control-feedback fix-error-icon\"></span> -->\r\n <span class=\"sr-only\">(error)</span>\r\n <div class=\"error-msg\">\r\n {{ errorMsg }}\r\n </div>\r\n </div>\r\n}\r\n", styles: [".error-msg{color:red}.fix-error-icon{top:27px}\n"] }); }
126
126
  }
127
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: FieldErrorDisplayComponent, decorators: [{
127
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: FieldErrorDisplayComponent, decorators: [{
128
128
  type: Component,
129
- args: [{ selector: 'rsl-field-error-display', standalone: false, template: "<div *ngIf=\"displayError\" >\n <!-- <span class=\"glyphicon glyphicon-remove form-control-feedback fix-error-icon\"></span> -->\n <span class=\"sr-only\">(error)</span>\n <div class=\"error-msg\">\n {{ errorMsg }}\n </div>\n</div>\n", styles: [".error-msg{color:red}.fix-error-icon{top:27px}\n"] }]
129
+ args: [{ selector: 'rsl-field-error-display', standalone: false, template: "@if (displayError) {\r\n <div >\r\n <!-- <span class=\"glyphicon glyphicon-remove form-control-feedback fix-error-icon\"></span> -->\r\n <span class=\"sr-only\">(error)</span>\r\n <div class=\"error-msg\">\r\n {{ errorMsg }}\r\n </div>\r\n </div>\r\n}\r\n", styles: [".error-msg{color:red}.fix-error-icon{top:27px}\n"] }]
130
130
  }], propDecorators: { errorMsg: [{
131
131
  type: Input
132
132
  }], displayError: [{
@@ -138,20 +138,20 @@ class PageNotFoundComponent {
138
138
  }
139
139
  ngOnInit() {
140
140
  }
141
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: PageNotFoundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
142
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.8", type: PageNotFoundComponent, isStandalone: false, selector: "rsl-page-not-found", ngImport: i0, template: "<div class=\"forms-view-container\">\n <div class=\"under-construction-view-container\">\n Page not found\n </div>\n</div>", styles: [".under-construction-view-container{height:calc(100vh - 250px);margin:60px 0 0;padding:0;display:flex;justify-content:center;align-items:center;box-sizing:border-box;font-size:1.8em;line-height:1.3em;font-weight:300;color:#58585b;text-align:center}\n"] }); }
141
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: PageNotFoundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
142
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: PageNotFoundComponent, isStandalone: false, selector: "rsl-page-not-found", ngImport: i0, template: "<div class=\"forms-view-container\">\n <div class=\"under-construction-view-container\">\n Page not found\n </div>\n</div>", styles: [".under-construction-view-container{height:calc(100vh - 250px);margin:60px 0 0;padding:0;display:flex;justify-content:center;align-items:center;box-sizing:border-box;font-size:1.8em;line-height:1.3em;font-weight:300;color:#58585b;text-align:center}\n"] }); }
143
143
  }
144
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: PageNotFoundComponent, decorators: [{
144
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: PageNotFoundComponent, decorators: [{
145
145
  type: Component,
146
146
  args: [{ selector: 'rsl-page-not-found', standalone: false, template: "<div class=\"forms-view-container\">\n <div class=\"under-construction-view-container\">\n Page not found\n </div>\n</div>", styles: [".under-construction-view-container{height:calc(100vh - 250px);margin:60px 0 0;padding:0;display:flex;justify-content:center;align-items:center;box-sizing:border-box;font-size:1.8em;line-height:1.3em;font-weight:300;color:#58585b;text-align:center}\n"] }]
147
147
  }], ctorParameters: () => [] });
148
148
 
149
149
  class UnderConstructionComponent {
150
150
  constructor() { }
151
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: UnderConstructionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
152
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.8", type: UnderConstructionComponent, isStandalone: false, selector: "rsl-under-construction", ngImport: i0, template: "<div class=\"forms-view-container\">\n <div class=\"under-construction-view-container\">\n Page under construction\n </div>\n</div>", styles: [".under-construction-view-container{height:calc(100vh - 250px);margin:60px 0 0;padding:0;display:flex;justify-content:center;align-items:center;box-sizing:border-box;font-size:1.8em;line-height:1.3em;font-weight:300;color:#58585b;text-align:center}\n"] }); }
151
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UnderConstructionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
152
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: UnderConstructionComponent, isStandalone: false, selector: "rsl-under-construction", ngImport: i0, template: "<div class=\"forms-view-container\">\n <div class=\"under-construction-view-container\">\n Page under construction\n </div>\n</div>", styles: [".under-construction-view-container{height:calc(100vh - 250px);margin:60px 0 0;padding:0;display:flex;justify-content:center;align-items:center;box-sizing:border-box;font-size:1.8em;line-height:1.3em;font-weight:300;color:#58585b;text-align:center}\n"] }); }
153
153
  }
154
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: UnderConstructionComponent, decorators: [{
154
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UnderConstructionComponent, decorators: [{
155
155
  type: Component,
156
156
  args: [{ selector: 'rsl-under-construction', standalone: false, template: "<div class=\"forms-view-container\">\n <div class=\"under-construction-view-container\">\n Page under construction\n </div>\n</div>", styles: [".under-construction-view-container{height:calc(100vh - 250px);margin:60px 0 0;padding:0;display:flex;justify-content:center;align-items:center;box-sizing:border-box;font-size:1.8em;line-height:1.3em;font-weight:300;color:#58585b;text-align:center}\n"] }]
157
157
  }], ctorParameters: () => [] });
@@ -213,10 +213,10 @@ class CacheService {
213
213
  const keysToDelete = Object.keys(this.cache).filter(key => key.includes(keyword));
214
214
  keysToDelete.forEach(key => this.delete(key));
215
215
  }
216
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: CacheService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
217
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: CacheService, providedIn: 'root' }); }
216
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CacheService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
217
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CacheService, providedIn: 'root' }); }
218
218
  }
219
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: CacheService, decorators: [{
219
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CacheService, decorators: [{
220
220
  type: Injectable,
221
221
  args: [{
222
222
  providedIn: 'root'
@@ -226,8 +226,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
226
226
  class BaseDatastore {
227
227
  // tslint:enable:max-line-length
228
228
  get getDirtyAttributes() {
229
- if (this.datastoreConfig.overrides
230
- && this.datastoreConfig.overrides.getDirtyAttributes) {
229
+ if (this.datastoreConfig.overrides && this.datastoreConfig.overrides.getDirtyAttributes) {
231
230
  return this.datastoreConfig.overrides.getDirtyAttributes;
232
231
  }
233
232
  else {
@@ -235,8 +234,7 @@ class BaseDatastore {
235
234
  }
236
235
  }
237
236
  get getAllAttributes() {
238
- if (this.datastoreConfig.overrides
239
- && this.datastoreConfig.overrides.getAllAttributes) {
237
+ if (this.datastoreConfig.overrides && this.datastoreConfig.overrides.getAllAttributes) {
240
238
  return this.datastoreConfig.overrides.getAllAttributes;
241
239
  }
242
240
  else {
@@ -275,16 +273,15 @@ class BaseDatastore {
275
273
  this._store = {};
276
274
  // tslint:enable:max-line-length
277
275
  // tslint:disable-next-line:ban-types
278
- this.toQueryString = this.datastoreConfig.overrides
279
- && this.datastoreConfig.overrides.toQueryString ?
280
- this.datastoreConfig.overrides.toQueryString : this._toQueryString;
276
+ this.toQueryString = this.datastoreConfig.overrides && this.datastoreConfig.overrides.toQueryString
277
+ ? this.datastoreConfig.overrides.toQueryString
278
+ : this._toQueryString;
281
279
  }
282
280
  findAll(modelType, params, headers, customUrl) {
283
281
  const customHeadhers = this.buildHeaders(headers);
284
282
  const htmlParams = this.buildParams(modelType, params);
285
283
  const url = this.buildUrl(modelType, customUrl);
286
- const response = this.httpClient.get(url, { headers: customHeadhers, params: htmlParams, withCredentials: true })
287
- .pipe(map(res => this.extractQueryData(res, modelType)), catchError(this.handleError));
284
+ const response = this.httpClient.get(url, { headers: customHeadhers, params: htmlParams, withCredentials: true }).pipe(map((res) => this.extractQueryData(res, modelType)), catchError(this.handleError));
288
285
  return response;
289
286
  }
290
287
  findRecord(modelType, id, params, headers, customUrl) {
@@ -294,8 +291,7 @@ class BaseDatastore {
294
291
  url += '/' + id;
295
292
  }
296
293
  const htmlParams = this.buildParams(modelType, params);
297
- const response = this.httpClient.get(url, { headers: customHeadhers, params: htmlParams, withCredentials: true })
298
- .pipe(map(res => this.entityToModel(res, modelType, undefined)), catchError(this.handleError));
294
+ const response = this.httpClient.get(url, { headers: customHeadhers, params: htmlParams, withCredentials: true }).pipe(map((res) => this.entityToModel(res, modelType, undefined)), catchError(this.handleError));
299
295
  return response;
300
296
  }
301
297
  getCustom(modelType, params, headers, customUrl, customResponseType) {
@@ -304,7 +300,12 @@ class BaseDatastore {
304
300
  const htmlParams = this.buildParams(modelType, params);
305
301
  if (!customResponseType)
306
302
  customResponseType = 'json';
307
- return this.httpClient.get(url, { headers: customHeadhers, params: htmlParams, withCredentials: true, responseType: customResponseType });
303
+ return this.httpClient.get(url, {
304
+ headers: customHeadhers,
305
+ params: htmlParams,
306
+ withCredentials: true,
307
+ responseType: customResponseType
308
+ });
308
309
  }
309
310
  postCustom(modelType, body, params, headers, customUrl) {
310
311
  const customHeadhers = this.buildHeaders(headers);
@@ -336,8 +337,7 @@ class BaseDatastore {
336
337
  else {
337
338
  httpCall = this.httpClient.post(url, body, { headers: customHeadhers, params: htmlParams, withCredentials: true });
338
339
  }
339
- return httpCall
340
- .pipe(map(res => {
340
+ return httpCall.pipe(map((res) => {
341
341
  this.cacheService.clearCacheContainingKeyword(url);
342
342
  const data = this.resetMetadataAttributes(res, attributesMetadata, modelType);
343
343
  return this.entityToModel(data, modelType);
@@ -358,8 +358,7 @@ class BaseDatastore {
358
358
  const patch = compare(origData, newData);
359
359
  if (patch.length > 0) {
360
360
  httpCall = this.httpClient.patch(url + '/' + model.id, patch, { headers: customHeadhers, params: htmlParams, withCredentials: true });
361
- return httpCall
362
- .pipe(map(res => {
361
+ return httpCall.pipe(map((res) => {
363
362
  this.cacheService.clearCacheContainingKeyword(url);
364
363
  const data = this.resetMetadataAttributes(res, attributesMetadata, modelType);
365
364
  return this.entityToModel(data, modelType);
@@ -390,8 +389,7 @@ class BaseDatastore {
390
389
  else {
391
390
  httpCall = this.httpClient.post(url, body, { headers: customHeadhers, params: htmlParams, withCredentials: true });
392
391
  }
393
- return httpCall
394
- .pipe(map(res => {
392
+ return httpCall.pipe(map((res) => {
395
393
  this.cacheService.clearCacheContainingKeyword(url);
396
394
  const data = this.resetMetadataAttributes(res, attributesMetadata, modelType);
397
395
  return this.entityToModel(data, modelType);
@@ -404,8 +402,7 @@ class BaseDatastore {
404
402
  url = url + '/' + id;
405
403
  }
406
404
  // const idParam = new HttpParams().set('id', id);
407
- return this.httpClient.delete(url, { headers: customHeadhers, withCredentials: true })
408
- .pipe(map(res => {
405
+ return this.httpClient.delete(url, { headers: customHeadhers, withCredentials: true }).pipe(map((res) => {
409
406
  this.cacheService.clearCacheContainingKeyword(url);
410
407
  return res;
411
408
  }), catchError(this.handleError));
@@ -495,7 +492,7 @@ class BaseDatastore {
495
492
  };
496
493
  if (customHeaders && customHeaders.keys().length) {
497
494
  // tslint:disable-next-line:variable-name
498
- Object.assign({}, headers, customHeaders.keys().map(header_name => {
495
+ Object.assign({}, headers, customHeaders.keys().map((header_name) => {
499
496
  headers['' + header_name] = customHeaders.get(header_name);
500
497
  }));
501
498
  }
@@ -505,13 +502,11 @@ class BaseDatastore {
505
502
  let httpParams = new HttpParams();
506
503
  if (params) {
507
504
  Object.keys(params)
508
- .filter(key => {
505
+ .filter((key) => {
509
506
  const v = params[key];
510
- return (Array.isArray(v) || typeof v === 'string') ?
511
- (v.length > 0) :
512
- (v !== null && v !== undefined);
507
+ return Array.isArray(v) || typeof v === 'string' ? v.length > 0 : v !== null && v !== undefined;
513
508
  })
514
- .forEach(key => {
509
+ .forEach((key) => {
515
510
  httpParams = httpParams.set(key, params[key]);
516
511
  });
517
512
  }
@@ -547,10 +542,10 @@ class BaseDatastore {
547
542
  _toQueryString(params) {
548
543
  return queryString.stringify(params, { arrayFormat: 'bracket' });
549
544
  }
550
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BaseDatastore, deps: [{ token: i1$1.HttpClient }, { token: CacheService }], target: i0.ɵɵFactoryTarget.Injectable }); }
551
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BaseDatastore }); }
545
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseDatastore, deps: [{ token: i1$1.HttpClient }, { token: CacheService }], target: i0.ɵɵFactoryTarget.Injectable }); }
546
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseDatastore }); }
552
547
  }
553
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BaseDatastore, decorators: [{
548
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseDatastore, decorators: [{
554
549
  type: Injectable
555
550
  }], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: CacheService }] });
556
551
 
@@ -638,10 +633,10 @@ class BaseService {
638
633
  getSelectValues(property) {
639
634
  return null;
640
635
  }
641
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BaseService, deps: [{ token: BaseDatastore }], target: i0.ɵɵFactoryTarget.Injectable }); }
642
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BaseService, providedIn: 'root' }); }
636
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseService, deps: [{ token: BaseDatastore }], target: i0.ɵɵFactoryTarget.Injectable }); }
637
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseService, providedIn: 'root' }); }
643
638
  }
644
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BaseService, decorators: [{
639
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseService, decorators: [{
645
640
  type: Injectable,
646
641
  args: [{
647
642
  providedIn: 'root'
@@ -862,10 +857,10 @@ class BaseFormEditComponent {
862
857
  }
863
858
  return rvalue;
864
859
  }
865
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BaseFormEditComponent, deps: [{ token: i1$2.UntypedFormBuilder }, { token: i2.Router }, { token: i2.ActivatedRoute }, { token: BaseService }, { token: DialogSERVICE }, { token: i1$3.TranslateService }, { token: i5.Location }], target: i0.ɵɵFactoryTarget.Component }); }
866
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.8", type: BaseFormEditComponent, isStandalone: false, selector: "app-base.form.edit", ngImport: i0, template: '', isInline: true }); }
860
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseFormEditComponent, deps: [{ token: i1$2.UntypedFormBuilder }, { token: i2.Router }, { token: i2.ActivatedRoute }, { token: BaseService }, { token: DialogSERVICE }, { token: i4.TranslateService }, { token: i5.Location }], target: i0.ɵɵFactoryTarget.Component }); }
861
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: BaseFormEditComponent, isStandalone: false, selector: "app-base.form.edit", ngImport: i0, template: '', isInline: true }); }
867
862
  }
868
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BaseFormEditComponent, decorators: [{
863
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseFormEditComponent, decorators: [{
869
864
  type: Component,
870
865
  args: [{
871
866
  selector: 'app-base.form.edit',
@@ -875,15 +870,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImpor
875
870
  }], ctorParameters: () => [{ type: i1$2.UntypedFormBuilder }, { type: i2.Router }, { type: i2.ActivatedRoute }, { type: BaseService }, { type: undefined, decorators: [{
876
871
  type: Inject,
877
872
  args: [DialogSERVICE]
878
- }] }, { type: i1$3.TranslateService }, { type: i5.Location }] });
879
-
880
- class Configurations {
881
- constructor() {
882
- this.baseUrl = '';
883
- this.authUrl = '';
884
- this.apiVersion = 'api/v1';
885
- }
886
- }
873
+ }] }, { type: i4.TranslateService }, { type: i5.Location }] });
887
874
 
888
875
  var GridLayoutFormat;
889
876
  (function (GridLayoutFormat) {
@@ -1012,6 +999,138 @@ function BaseDatastoreConfig(config = {}) {
1012
999
  };
1013
1000
  }
1014
1001
 
1002
+ class Configurations {
1003
+ constructor() {
1004
+ this.baseUrl = '';
1005
+ this.authUrl = '';
1006
+ this.apiVersion = 'api/v1';
1007
+ }
1008
+ }
1009
+
1010
+ let DatastoreCore = class DatastoreCore extends BaseDatastore {
1011
+ constructor(http, cacheService, configExt) {
1012
+ super(http, cacheService);
1013
+ this.configExt = configExt;
1014
+ this.customConfig = {
1015
+ apiVersion: this.configExt.apiVersion,
1016
+ baseUrl: this.configExt.baseUrl
1017
+ };
1018
+ this.config = this.customConfig;
1019
+ }
1020
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DatastoreCore, deps: [{ token: i1$1.HttpClient }, { token: CacheService }, { token: Configurations }], target: i0.ɵɵFactoryTarget.Injectable }); }
1021
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DatastoreCore }); }
1022
+ };
1023
+ DatastoreCore = __decorate([
1024
+ BaseDatastoreConfig({ apiVersion: '', baseUrl: '' }),
1025
+ __metadata("design:paramtypes", [HttpClient, CacheService, Configurations])
1026
+ ], DatastoreCore);
1027
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DatastoreCore, decorators: [{
1028
+ type: Injectable
1029
+ }], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: CacheService }, { type: Configurations }] });
1030
+
1031
+ class TranslateloaderService {
1032
+ constructor(httpClient, config) {
1033
+ this.httpClient = httpClient;
1034
+ this._apiUrl = '';
1035
+ this.headers = new HttpHeaders({
1036
+ Accept: 'application/json',
1037
+ 'Content-Type': 'application/json'
1038
+ });
1039
+ console.log(config);
1040
+ if (config) {
1041
+ this._apiUrl = config.baseUrl;
1042
+ }
1043
+ }
1044
+ getTranslation(lang) {
1045
+ const url = this._apiUrl + '/api/v1/language/' + lang + '/translationlist';
1046
+ return this.httpClient.get(url, { headers: this.headers });
1047
+ }
1048
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TranslateloaderService, deps: [{ token: i1$1.HttpClient }, { token: Configurations }], target: i0.ɵɵFactoryTarget.Injectable }); }
1049
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TranslateloaderService, providedIn: 'root' }); }
1050
+ }
1051
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TranslateloaderService, decorators: [{
1052
+ type: Injectable,
1053
+ args: [{
1054
+ providedIn: 'root'
1055
+ }]
1056
+ }], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: Configurations }] });
1057
+
1058
+ const PROVIDERS = [
1059
+ BaseDatastore,
1060
+ DatastoreCore,
1061
+ DatePipe,
1062
+ DecimalPipe,
1063
+ PercentPipe
1064
+ ];
1065
+ class RslBaseModule {
1066
+ static forRoot(config) {
1067
+ return {
1068
+ ngModule: RslBaseModule,
1069
+ providers: [PROVIDERS, { provide: Configurations, useValue: config }]
1070
+ };
1071
+ }
1072
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: RslBaseModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1073
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.6", ngImport: i0, type: RslBaseModule, imports: [CommonModule, i4.TranslateModule, ReactiveFormsModule], exports: [TranslateModule] }); }
1074
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: RslBaseModule, providers: [PROVIDERS], imports: [CommonModule,
1075
+ TranslateModule.forRoot({
1076
+ loader: {
1077
+ provide: TranslateLoader,
1078
+ useClass: TranslateloaderService,
1079
+ deps: [HttpClient]
1080
+ },
1081
+ // missingTranslationHandler: { provide: MissingTranslationHandler, useClass: MyMissingTranslationHandler },
1082
+ useDefaultLang: false
1083
+ }),
1084
+ ReactiveFormsModule, TranslateModule] }); }
1085
+ }
1086
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: RslBaseModule, decorators: [{
1087
+ type: NgModule,
1088
+ args: [{
1089
+ imports: [
1090
+ CommonModule,
1091
+ TranslateModule.forRoot({
1092
+ loader: {
1093
+ provide: TranslateLoader,
1094
+ useClass: TranslateloaderService,
1095
+ deps: [HttpClient]
1096
+ },
1097
+ // missingTranslationHandler: { provide: MissingTranslationHandler, useClass: MyMissingTranslationHandler },
1098
+ useDefaultLang: false
1099
+ }),
1100
+ ReactiveFormsModule
1101
+ ],
1102
+ providers: [PROVIDERS],
1103
+ exports: [TranslateModule]
1104
+ }]
1105
+ }] });
1106
+
1107
+ function readFileAsync(file) {
1108
+ return new Promise((resolve, reject) => {
1109
+ const reader = new FileReader();
1110
+ reader.onload = (event) => {
1111
+ resolve(event.target.result);
1112
+ };
1113
+ reader.onerror = (event) => {
1114
+ reject(event.target.error);
1115
+ };
1116
+ reader.readAsArrayBuffer(file);
1117
+ });
1118
+ }
1119
+ function getValueFromJsonData(jsonData, key) {
1120
+ // Convert the key and all JSON keys to lowercase
1121
+ const lowercaseKey = key.toLowerCase();
1122
+ const lowercaseKeys = Object.keys(jsonData).map(k => k.toLowerCase());
1123
+ // Find the lowercase key in the lowercase keys array
1124
+ const index = lowercaseKeys.indexOf(lowercaseKey);
1125
+ // If found, use the original (proper case) key to access the value
1126
+ if (index !== -1) {
1127
+ const originalKey = Object.keys(jsonData)[index];
1128
+ return jsonData[originalKey];
1129
+ }
1130
+ // Key not found
1131
+ return undefined;
1132
+ }
1133
+
1015
1134
  class BaseMetaModel {
1016
1135
  constructor(response) {
1017
1136
  this.links = response.links || [];
@@ -1028,62 +1147,6 @@ function BaseModelConfig(config = {}) {
1028
1147
  };
1029
1148
  }
1030
1149
 
1031
- function CustomType(config = {}) {
1032
- return (target, propertyName) => {
1033
- const annotations = MetadataStorage.getMetadata('CustomType', target) || [];
1034
- annotations.push({
1035
- propertyName,
1036
- relationship: config.key || propertyName
1037
- });
1038
- MetadataStorage.setMetadata('CustomType', annotations, target);
1039
- };
1040
- }
1041
-
1042
- class CacheInterceptor {
1043
- constructor(expirationTime, cacheService) {
1044
- this.expirationTime = expirationTime;
1045
- this.cacheService = cacheService;
1046
- this.cache = new Map();
1047
- }
1048
- intercept(request, next) {
1049
- const bypassCache = request.params.get('bypassCache') || false;
1050
- if (bypassCache || request.method !== 'GET') {
1051
- return next.handle(request);
1052
- }
1053
- if (!bypassCache) {
1054
- const cachedResponse = this.cacheService.get(request.urlWithParams);
1055
- if (cachedResponse) {
1056
- return of(cachedResponse.clone());
1057
- //return cachedResponse;
1058
- }
1059
- }
1060
- return next.handle(request).pipe(tap((event) => {
1061
- if (event instanceof HttpResponse) {
1062
- this.cacheService.set(request.urlWithParams, event.clone(), this.expirationTime);
1063
- }
1064
- }));
1065
- // const cachedItem = this.cache.get(request.url);
1066
- // if (cachedItem && cachedItem.expiration > Date.now()) {
1067
- // return of(cachedItem.response.clone());
1068
- // }
1069
- // return next.handle(request).pipe(
1070
- // tap(event => {
1071
- // if (event instanceof HttpResponse) {
1072
- // this.cache.set(request.url, { response: event.clone(), expiration: Date.now() + this.expirationTime });
1073
- // }
1074
- // })
1075
- // );
1076
- }
1077
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: CacheInterceptor, deps: [{ token: 'CACHE_EXPIRATION_TIME' }, { token: CacheService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1078
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: CacheInterceptor }); }
1079
- }
1080
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: CacheInterceptor, decorators: [{
1081
- type: Injectable
1082
- }], ctorParameters: () => [{ type: undefined, decorators: [{
1083
- type: Inject,
1084
- args: ['CACHE_EXPIRATION_TIME']
1085
- }] }, { type: CacheService }] });
1086
-
1087
1150
  class BaseModel {
1088
1151
  // tslint:disable-next-line:variable-name
1089
1152
  constructor(_datastore, data) {
@@ -1183,7 +1246,7 @@ class BaseModel {
1183
1246
  const controlsConfig = {};
1184
1247
  const that = this;
1185
1248
  if (props) {
1186
- props.forEach(property => {
1249
+ props.forEach((property) => {
1187
1250
  const value = that[property] !== undefined ? that[property] : defaultValues[property];
1188
1251
  const formSubGroup = formSubGroupsValues[property] ?? null;
1189
1252
  if (requiredProps[property]) {
@@ -1216,7 +1279,7 @@ class BaseModel {
1216
1279
  }
1217
1280
  const that = this;
1218
1281
  if (props) {
1219
- props.forEach(property => {
1282
+ props.forEach((property) => {
1220
1283
  const formSubGroup = formSubGroupsValues[property] ?? null;
1221
1284
  if (!formSubGroup)
1222
1285
  data[property] = formGroup.controls[property].value ?? null;
@@ -1240,14 +1303,175 @@ class BaseModel {
1240
1303
  }
1241
1304
  }
1242
1305
 
1243
- class ErrorResponse {
1244
- constructor(errors) {
1245
- this.errors = [];
1246
- if (errors) {
1247
- this.errors = errors;
1248
- }
1249
- }
1250
- }
1306
+ let Employee = class Employee extends BaseModel {
1307
+ };
1308
+ __decorate([
1309
+ Attribute({ serializedName: 'id' }),
1310
+ __metadata("design:type", String)
1311
+ ], Employee.prototype, "id", void 0);
1312
+ __decorate([
1313
+ Attribute({ serializedName: 'userName', required: true }),
1314
+ __metadata("design:type", String)
1315
+ ], Employee.prototype, "userName", void 0);
1316
+ __decorate([
1317
+ Attribute({ serializedName: 'firstName', required: true }),
1318
+ __metadata("design:type", String)
1319
+ ], Employee.prototype, "firstName", void 0);
1320
+ __decorate([
1321
+ Attribute({ serializedName: 'lastName', required: true }),
1322
+ __metadata("design:type", String)
1323
+ ], Employee.prototype, "lastName", void 0);
1324
+ __decorate([
1325
+ Attribute({ serializedName: 'email', required: true }),
1326
+ __metadata("design:type", String)
1327
+ ], Employee.prototype, "email", void 0);
1328
+ __decorate([
1329
+ Attribute({ serializedName: 'role', required: true }),
1330
+ __metadata("design:type", Object)
1331
+ ], Employee.prototype, "role", void 0);
1332
+ __decorate([
1333
+ Attribute({ serializedName: 'password' }),
1334
+ __metadata("design:type", String)
1335
+ ], Employee.prototype, "password", void 0);
1336
+ __decorate([
1337
+ Attribute({ serializedName: 'confirmPassword' }),
1338
+ __metadata("design:type", String)
1339
+ ], Employee.prototype, "confirmPassword", void 0);
1340
+ __decorate([
1341
+ Attribute({ serializedName: 'extraData' }),
1342
+ __metadata("design:type", String)
1343
+ ], Employee.prototype, "extraData", void 0);
1344
+ Employee = __decorate([
1345
+ BaseModelConfig({
1346
+ type: 'employee'
1347
+ })
1348
+ ], Employee);
1349
+
1350
+ let Menu = class Menu extends BaseModel {
1351
+ };
1352
+ __decorate([
1353
+ Attribute({ serializedName: 'id' }),
1354
+ __metadata("design:type", String)
1355
+ ], Menu.prototype, "id", void 0);
1356
+ __decorate([
1357
+ Attribute({ serializedName: 'header' }),
1358
+ __metadata("design:type", String)
1359
+ ], Menu.prototype, "header", void 0);
1360
+ __decorate([
1361
+ Attribute({ serializedName: 'icon' }),
1362
+ __metadata("design:type", String)
1363
+ ], Menu.prototype, "icon", void 0);
1364
+ __decorate([
1365
+ Attribute({ serializedName: 'link' }),
1366
+ __metadata("design:type", String)
1367
+ ], Menu.prototype, "link", void 0);
1368
+ __decorate([
1369
+ Attribute({ serializedName: 'title' }),
1370
+ __metadata("design:type", String)
1371
+ ], Menu.prototype, "title", void 0);
1372
+ __decorate([
1373
+ Attribute({ serializedName: 'sublinks' }),
1374
+ __metadata("design:type", Array)
1375
+ ], Menu.prototype, "sublinks", void 0);
1376
+ __decorate([
1377
+ Attribute({ serializedName: 'target' }),
1378
+ __metadata("design:type", String)
1379
+ ], Menu.prototype, "target", void 0);
1380
+ __decorate([
1381
+ Attribute({ serializedName: 'external' }),
1382
+ __metadata("design:type", Boolean)
1383
+ ], Menu.prototype, "external", void 0);
1384
+ __decorate([
1385
+ Attribute({ serializedName: 'description' }),
1386
+ __metadata("design:type", String)
1387
+ ], Menu.prototype, "description", void 0);
1388
+ __decorate([
1389
+ Attribute({ serializedName: 'order' }),
1390
+ __metadata("design:type", Number)
1391
+ ], Menu.prototype, "order", void 0);
1392
+ __decorate([
1393
+ Attribute({ serializedName: 'translationKey' }),
1394
+ __metadata("design:type", String)
1395
+ ], Menu.prototype, "translationKey", void 0);
1396
+ __decorate([
1397
+ Attribute({ serializedName: 'color' }),
1398
+ __metadata("design:type", String)
1399
+ ], Menu.prototype, "color", void 0);
1400
+ Menu = __decorate([
1401
+ BaseModelConfig({
1402
+ type: 'user',
1403
+ modelEndpointUrl: 'user/menus'
1404
+ })
1405
+ ], Menu);
1406
+
1407
+ let Right = class Right extends BaseModel {
1408
+ };
1409
+ __decorate([
1410
+ Attribute({ serializedName: 'id' }),
1411
+ __metadata("design:type", String)
1412
+ ], Right.prototype, "id", void 0);
1413
+ __decorate([
1414
+ Attribute({ serializedName: 'name' }),
1415
+ __metadata("design:type", String)
1416
+ ], Right.prototype, "name", void 0);
1417
+ __decorate([
1418
+ Attribute({ serializedName: 'rightKey' }),
1419
+ __metadata("design:type", String)
1420
+ ], Right.prototype, "rightKey", void 0);
1421
+ __decorate([
1422
+ Attribute({ serializedName: 'pagePath' }),
1423
+ __metadata("design:type", String)
1424
+ ], Right.prototype, "pagePath", void 0);
1425
+ __decorate([
1426
+ Attribute({ serializedName: 'order' }),
1427
+ __metadata("design:type", Number)
1428
+ ], Right.prototype, "order", void 0);
1429
+ __decorate([
1430
+ Attribute({ serializedName: 'isMenu' }),
1431
+ __metadata("design:type", Boolean)
1432
+ ], Right.prototype, "isMenu", void 0);
1433
+ __decorate([
1434
+ Attribute({ serializedName: 'resourceName' }),
1435
+ __metadata("design:type", String)
1436
+ ], Right.prototype, "resourceName", void 0);
1437
+ __decorate([
1438
+ Attribute({ serializedName: 'parentId' }),
1439
+ __metadata("design:type", String)
1440
+ ], Right.prototype, "parentId", void 0);
1441
+ __decorate([
1442
+ Attribute({ serializedName: 'color' }),
1443
+ __metadata("design:type", String)
1444
+ ], Right.prototype, "color", void 0);
1445
+ __decorate([
1446
+ Attribute({ serializedName: 'defaultRoles' }),
1447
+ __metadata("design:type", String)
1448
+ ], Right.prototype, "defaultRoles", void 0);
1449
+ __decorate([
1450
+ Attribute({ serializedName: 'icon' }),
1451
+ __metadata("design:type", String)
1452
+ ], Right.prototype, "icon", void 0);
1453
+ Right = __decorate([
1454
+ BaseModelConfig({
1455
+ type: 'right',
1456
+ modelEndpointUrl: 'user/rights'
1457
+ })
1458
+ ], Right);
1459
+
1460
+ let Role = class Role extends BaseModel {
1461
+ };
1462
+ __decorate([
1463
+ Attribute({ serializedName: 'id' }),
1464
+ __metadata("design:type", String)
1465
+ ], Role.prototype, "id", void 0);
1466
+ __decorate([
1467
+ Attribute({ serializedName: 'name' }),
1468
+ __metadata("design:type", String)
1469
+ ], Role.prototype, "name", void 0);
1470
+ Role = __decorate([
1471
+ BaseModelConfig({
1472
+ type: 'role'
1473
+ })
1474
+ ], Role);
1251
1475
 
1252
1476
  class Rule {
1253
1477
  constructor() {
@@ -1255,81 +1479,47 @@ class Rule {
1255
1479
  }
1256
1480
  }
1257
1481
 
1258
- class InputErrorPipe {
1259
- constructor(translate) {
1260
- this.translate = translate;
1261
- }
1262
- transform(value, filedTranslationKey) {
1263
- let rvalue = '';
1264
- if (value !== null) {
1265
- if (value['invalid'] === true) {
1266
- rvalue = 'ERROR.INVALID';
1267
- }
1268
- if (value['mustMatch'] === true) {
1269
- rvalue = 'Account.Password.MustMach';
1270
- }
1271
- if (value['required'] === true) {
1272
- const field = this.translate.instant(filedTranslationKey.field);
1273
- rvalue = this.translate.instant('General.Field.Required', { field });
1274
- }
1275
- if (value['minlength']) {
1276
- const field = this.translate.instant(filedTranslationKey.field);
1277
- rvalue = this.translate.instant('General.Field.MinLength', { field, requiredLength: value.minlength.requiredLength });
1278
- }
1279
- }
1280
- return rvalue;
1482
+ let User = class User extends BaseModel {
1483
+ get fullName() {
1484
+ return this.firstName + ' ' + this.lastName;
1281
1485
  }
1282
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: InputErrorPipe, deps: [{ token: i1$3.TranslateService }], target: i0.ɵɵFactoryTarget.Pipe }); }
1283
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.8", ngImport: i0, type: InputErrorPipe, isStandalone: false, name: "inputError" }); }
1284
- }
1285
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: InputErrorPipe, decorators: [{
1286
- type: Pipe,
1287
- args: [{
1288
- name: 'inputError',
1289
- standalone: false
1290
- }]
1291
- }], ctorParameters: () => [{ type: i1$3.TranslateService }] });
1486
+ };
1487
+ __decorate([
1488
+ Attribute({ serializedName: 'id' }),
1489
+ __metadata("design:type", String)
1490
+ ], User.prototype, "id", void 0);
1491
+ __decorate([
1492
+ Attribute({ serializedName: 'firstName' }),
1493
+ __metadata("design:type", String)
1494
+ ], User.prototype, "firstName", void 0);
1495
+ __decorate([
1496
+ Attribute({ serializedName: 'lastName' }),
1497
+ __metadata("design:type", String)
1498
+ ], User.prototype, "lastName", void 0);
1499
+ __decorate([
1500
+ Attribute({ serializedName: 'email' }),
1501
+ __metadata("design:type", String)
1502
+ ], User.prototype, "email", void 0);
1503
+ User = __decorate([
1504
+ BaseModelConfig({
1505
+ type: 'user'
1506
+ })
1507
+ ], User);
1292
1508
 
1293
- class Nl2brPipe {
1294
- transform(value, args) {
1295
- // return value.replace(/\n/g, '<br />');
1296
- if (value) {
1297
- value = value.replace(/(?:\r\n\r\n|\r\r|\n\n)/g, '</p><p>');
1298
- return '<p>' + value.replace(/(?:\r\n|\r|\n)/g, '<br>') + '</p>';
1299
- }
1300
- return value;
1509
+ class EmployeeService extends BaseService {
1510
+ constructor(datastore) {
1511
+ super(datastore);
1512
+ this.setModelType(Employee);
1301
1513
  }
1302
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: Nl2brPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1303
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.8", ngImport: i0, type: Nl2brPipe, isStandalone: false, name: "nl2br" }); }
1514
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: EmployeeService, deps: [{ token: DatastoreCore }], target: i0.ɵɵFactoryTarget.Injectable }); }
1515
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: EmployeeService, providedIn: 'root' }); }
1304
1516
  }
1305
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: Nl2brPipe, decorators: [{
1306
- type: Pipe,
1517
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: EmployeeService, decorators: [{
1518
+ type: Injectable,
1307
1519
  args: [{
1308
- name: 'nl2br',
1309
- standalone: false
1520
+ providedIn: 'root'
1310
1521
  }]
1311
- }] });
1312
-
1313
- let DatastoreCore = class DatastoreCore extends BaseDatastore {
1314
- constructor(http, cacheService, configExt) {
1315
- super(http, cacheService);
1316
- this.configExt = configExt;
1317
- this.customConfig = {
1318
- apiVersion: this.configExt.apiVersion,
1319
- baseUrl: this.configExt.baseUrl
1320
- };
1321
- this.config = this.customConfig;
1322
- }
1323
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: DatastoreCore, deps: [{ token: i1$1.HttpClient }, { token: CacheService }, { token: Configurations }], target: i0.ɵɵFactoryTarget.Injectable }); }
1324
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: DatastoreCore }); }
1325
- };
1326
- DatastoreCore = __decorate([
1327
- BaseDatastoreConfig({ apiVersion: '', baseUrl: '' }),
1328
- __metadata("design:paramtypes", [HttpClient, CacheService, Configurations])
1329
- ], DatastoreCore);
1330
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: DatastoreCore, decorators: [{
1331
- type: Injectable
1332
- }], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: CacheService }, { type: Configurations }] });
1522
+ }], ctorParameters: () => [{ type: DatastoreCore }] });
1333
1523
 
1334
1524
  class LocalFileService {
1335
1525
  constructor(http) {
@@ -1349,16 +1539,31 @@ class LocalFileService {
1349
1539
  });
1350
1540
  return dataSubject.asObservable(); // Return observable
1351
1541
  }
1352
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: LocalFileService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
1353
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: LocalFileService, providedIn: 'root' }); }
1542
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LocalFileService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
1543
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LocalFileService, providedIn: 'root' }); }
1354
1544
  }
1355
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: LocalFileService, decorators: [{
1545
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: LocalFileService, decorators: [{
1356
1546
  type: Injectable,
1357
1547
  args: [{
1358
1548
  providedIn: 'root'
1359
1549
  }]
1360
1550
  }], ctorParameters: () => [{ type: i1$1.HttpClient }] });
1361
1551
 
1552
+ class RoleService extends BaseService {
1553
+ constructor(datastore) {
1554
+ super(datastore);
1555
+ this.setModelType(Role);
1556
+ }
1557
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: RoleService, deps: [{ token: DatastoreCore }], target: i0.ɵɵFactoryTarget.Injectable }); }
1558
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: RoleService, providedIn: 'root' }); }
1559
+ }
1560
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: RoleService, decorators: [{
1561
+ type: Injectable,
1562
+ args: [{
1563
+ providedIn: 'root'
1564
+ }]
1565
+ }], ctorParameters: () => [{ type: DatastoreCore }] });
1566
+
1362
1567
  class RouteHistoryService {
1363
1568
  constructor(router) {
1364
1569
  this.router = router;
@@ -1381,190 +1586,45 @@ class RouteHistoryService {
1381
1586
  getCurrentUrl() {
1382
1587
  return this.currentUrl;
1383
1588
  }
1384
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: RouteHistoryService, deps: [{ token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
1385
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: RouteHistoryService, providedIn: 'root' }); }
1589
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: RouteHistoryService, deps: [{ token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
1590
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: RouteHistoryService, providedIn: 'root' }); }
1386
1591
  }
1387
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: RouteHistoryService, decorators: [{
1592
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: RouteHistoryService, decorators: [{
1388
1593
  type: Injectable,
1389
1594
  args: [{
1390
1595
  providedIn: 'root'
1391
1596
  }]
1392
1597
  }], ctorParameters: () => [{ type: i2.Router }] });
1393
1598
 
1394
- class TranslateloaderService {
1395
- constructor(httpClient, config) {
1396
- this.httpClient = httpClient;
1397
- this._apiUrl = '';
1398
- this.headers = new HttpHeaders({
1399
- Accept: 'application/json',
1400
- 'Content-Type': 'application/json'
1401
- });
1402
- console.log(config);
1403
- if (config) {
1404
- this._apiUrl = config.baseUrl;
1599
+ class UserService extends BaseService {
1600
+ constructor(datastore) {
1601
+ super(datastore);
1602
+ this.setModelType(User);
1603
+ }
1604
+ getRights() {
1605
+ const response = this.datastore.findAll(Right);
1606
+ return response;
1607
+ }
1608
+ hasRightForLink(link) {
1609
+ if (this.userRights && link) {
1610
+ const right = this.userRights.find((f) => link.indexOf(f.pagePath) >= 0);
1611
+ return true;
1405
1612
  }
1613
+ return false;
1406
1614
  }
1407
- getTranslation(lang) {
1408
- const url = this._apiUrl + '/api/v1/language/' + lang + '/translationlist';
1409
- return this.httpClient.get(url, { headers: this.headers });
1615
+ getMenus() {
1616
+ const response = this.datastore.findAll(Menu);
1617
+ return response;
1410
1618
  }
1411
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: TranslateloaderService, deps: [{ token: i1$1.HttpClient }, { token: Configurations }], target: i0.ɵɵFactoryTarget.Injectable }); }
1412
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: TranslateloaderService, providedIn: 'root' }); }
1619
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UserService, deps: [{ token: DatastoreCore }], target: i0.ɵɵFactoryTarget.Injectable }); }
1620
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UserService, providedIn: 'root' }); }
1413
1621
  }
1414
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: TranslateloaderService, decorators: [{
1622
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: UserService, decorators: [{
1415
1623
  type: Injectable,
1416
1624
  args: [{
1417
1625
  providedIn: 'root'
1418
1626
  }]
1419
- }], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: Configurations }] });
1420
-
1421
- const PROVIDERS = [
1422
- BaseDatastore,
1423
- DatastoreCore,
1424
- DatePipe,
1425
- DecimalPipe,
1426
- PercentPipe
1427
- ];
1428
-
1429
- function DynamicallyModelResolver(modelsImport, className = undefined) {
1430
- return (route, state) => {
1431
- if (className == undefined)
1432
- className = route.paramMap.get('className');
1433
- const instance = getInstance$1(className, modelsImport);
1434
- if (!instance) {
1435
- throw new Error(`Invalid className: ${className}`);
1436
- }
1437
- return instance;
1438
- };
1439
- }
1440
- function getInstance$1(className, modelsImport) {
1441
- return modelsImport.then((module) => module[toProperCase$1(className)]);
1442
- // return modelsImport.then((module) => ({ modelInstance: module[toProperCase(className)] })
1443
- // );
1444
- }
1445
- function toProperCase$1(str) {
1446
- return str.replace(/\w\S*/g, (txt) => {
1447
- return txt.charAt(0).toUpperCase() + txt.substring(1).toLowerCase();
1448
- });
1449
- }
1450
-
1451
- function DynamicallyServiceResolver(serviceImport, serviceName) {
1452
- return (route, state) => {
1453
- const instance = getInstance(serviceName, serviceImport);
1454
- if (!instance) {
1455
- throw new Error(`Invalid className: ${serviceName}`);
1456
- }
1457
- return instance;
1458
- };
1459
- }
1460
- function getInstance(serviceName, serviceImport) {
1461
- return serviceImport.then((module) => module[toProperCase(serviceName)]); // return Promise.all([serviceImport]).then(
1462
- // (module) => ({
1463
- // serviceInstance: module[toProperCase(serviceName)],
1464
- // })
1465
- // );
1466
- }
1467
- function toProperCase(str) {
1468
- return str.replace(/\w\S*/g, (txt) => {
1469
- return txt.charAt(0).toUpperCase() + txt.substring(1).toLowerCase();
1470
- });
1471
- }
1472
-
1473
- class RslBaseModule {
1474
- static forRoot(config) {
1475
- return {
1476
- ngModule: RslBaseModule,
1477
- providers: [
1478
- PROVIDERS,
1479
- { provide: Configurations, useValue: config }
1480
- ]
1481
- };
1482
- }
1483
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: RslBaseModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1484
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.8", ngImport: i0, type: RslBaseModule, imports: [CommonModule, i1$3.TranslateModule, ReactiveFormsModule], exports: [HttpClientModule,
1485
- TranslateModule] }); }
1486
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: RslBaseModule, providers: [
1487
- PROVIDERS
1488
- ], imports: [CommonModule,
1489
- TranslateModule.forRoot({
1490
- loader: {
1491
- provide: TranslateLoader,
1492
- useClass: TranslateloaderService,
1493
- deps: [HttpClient]
1494
- },
1495
- // missingTranslationHandler: { provide: MissingTranslationHandler, useClass: MyMissingTranslationHandler },
1496
- useDefaultLang: false,
1497
- }),
1498
- ReactiveFormsModule, HttpClientModule,
1499
- TranslateModule] }); }
1500
- }
1501
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: RslBaseModule, decorators: [{
1502
- type: NgModule,
1503
- args: [{
1504
- imports: [
1505
- CommonModule,
1506
- TranslateModule.forRoot({
1507
- loader: {
1508
- provide: TranslateLoader,
1509
- useClass: TranslateloaderService,
1510
- deps: [HttpClient]
1511
- },
1512
- // missingTranslationHandler: { provide: MissingTranslationHandler, useClass: MyMissingTranslationHandler },
1513
- useDefaultLang: false,
1514
- }),
1515
- ReactiveFormsModule
1516
- ],
1517
- providers: [
1518
- PROVIDERS
1519
- ],
1520
- exports: [
1521
- HttpClientModule,
1522
- TranslateModule,
1523
- ]
1524
- }]
1525
- }] });
1526
-
1527
- class CustomValidators {
1528
- static patternValidator(regex, error) {
1529
- return (control) => {
1530
- if (!control.value) {
1531
- // if control is empty return no error
1532
- return null;
1533
- }
1534
- // test the value of the control against the regexp supplied
1535
- const valid = regex.test(control.value);
1536
- // if true, return no error (no error), else return error passed in the second parameter
1537
- return valid ? null : error;
1538
- };
1539
- }
1540
- }
1541
-
1542
- function readFileAsync(file) {
1543
- return new Promise((resolve, reject) => {
1544
- const reader = new FileReader();
1545
- reader.onload = (event) => {
1546
- resolve(event.target.result);
1547
- };
1548
- reader.onerror = (event) => {
1549
- reject(event.target.error);
1550
- };
1551
- reader.readAsArrayBuffer(file);
1552
- });
1553
- }
1554
- function getValueFromJsonData(jsonData, key) {
1555
- // Convert the key and all JSON keys to lowercase
1556
- const lowercaseKey = key.toLowerCase();
1557
- const lowercaseKeys = Object.keys(jsonData).map(k => k.toLowerCase());
1558
- // Find the lowercase key in the lowercase keys array
1559
- const index = lowercaseKeys.indexOf(lowercaseKey);
1560
- // If found, use the original (proper case) key to access the value
1561
- if (index !== -1) {
1562
- const originalKey = Object.keys(jsonData)[index];
1563
- return jsonData[originalKey];
1564
- }
1565
- // Key not found
1566
- return undefined;
1567
- }
1627
+ }], ctorParameters: () => [{ type: DatastoreCore }] });
1568
1628
 
1569
1629
  /*
1570
1630
  * Public API Surface of core
@@ -1574,5 +1634,5 @@ function getValueFromJsonData(jsonData, key) {
1574
1634
  * Generated bundle index. Do not edit.
1575
1635
  */
1576
1636
 
1577
- export { Attribute, AuthService, BaseDatastore, BaseDatastoreConfig, BaseFormEditComponent, BaseMetaModel, BaseModel, BaseModelConfig, BaseQueryData, BaseService, CacheInterceptor, CacheService, CellTextAlign, Configurations, CustomType, CustomValidators, DatastoreCore, DynamicallyModelResolver, DynamicallyServiceResolver, ErrorResponse, FieldErrorDisplayComponent, GridLayoutFormat, InputErrorPipe, LocalFileService, MetadataStorage, Nl2brPipe, OIDC_CLIENT_SETTINGS, PROVIDERS, PageNotFoundComponent, RouteHistoryService, RslBaseModule, Rule, Tokens, TranslateloaderService, UnderConstructionComponent, getValueFromJsonData, provideAuth, provideOidcUserManager, readFileAsync };
1637
+ export { Attribute, AuthService, BaseDatastore, BaseDatastoreConfig, BaseFormEditComponent, BaseModel, BaseModelConfig, BaseQueryData, BaseService, CacheService, CellTextAlign, Configurations, DatastoreCore, Employee, EmployeeService, FieldErrorDisplayComponent, GridLayoutFormat, LocalFileService, Menu, MetadataStorage, OIDC_CLIENT_SETTINGS, PROVIDERS, PageNotFoundComponent, Right, Role, RoleService, RouteHistoryService, RslBaseModule, Rule, Tokens, TranslateloaderService, UnderConstructionComponent, User, UserService, getValueFromJsonData, provideAuth, provideOidcUserManager, readFileAsync };
1578
1638
  //# sourceMappingURL=rosoftlab-core.mjs.map