@rosoftlab/core 1.0.5-alpha-1 → 1.0.5-alpha-3
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.
- package/fesm2022/rosoftlab-core.mjs +393 -88
- package/fesm2022/rosoftlab-core.mjs.map +1 -1
- package/index.d.ts +5 -0
- package/lib/auth/auth.service.d.ts +29 -0
- package/lib/auth/index.d.ts +4 -0
- package/lib/auth/provide-auth.d.ts +3 -0
- package/lib/auth/tokens.d.ts +5 -0
- package/lib/auth/user-manager.factory.d.ts +5 -0
- package/lib/base-components/base-crud-implementation.d.ts +44 -0
- package/lib/base-components/base-form-edit.component.d.ts +56 -0
- package/lib/base-components/base-table-implementation.d.ts +56 -0
- package/lib/base-components/field-error-display/field-error-display.component.d.ts +7 -0
- package/lib/base-components/index.d.ts +3 -0
- package/lib/base-components/page-not-found/page-not-found.component.d.ts +8 -0
- package/lib/base-components/under-construction/under-construction.component.d.ts +6 -0
- package/lib/configurations.d.ts +6 -0
- package/lib/constants/symbols.d.ts +1 -0
- package/lib/converters/date/date.converter.d.ts +5 -0
- package/lib/core.d.ts +16 -0
- package/lib/decorators/attribute.decorator.d.ts +2 -0
- package/lib/decorators/base-datastore-config.decorator.d.ts +1 -0
- package/lib/decorators/base-model-config.decorator.d.ts +1 -0
- package/lib/decorators/custom.type.decorator.d.ts +1 -0
- package/lib/grid-layout-format.enum.d.ts +12 -0
- package/lib/index.d.ts +26 -0
- package/lib/interceptors/cache.interceptor.d.ts +13 -0
- package/lib/interceptors/index.d.ts +1 -0
- package/lib/interfaces/attribute-decorator-options.interface.d.ts +8 -0
- package/lib/interfaces/datastore-config.interface.d.ts +8 -0
- package/lib/interfaces/dialog.interface.d.ts +9 -0
- package/lib/interfaces/model-config.interface.d.ts +10 -0
- package/lib/interfaces/overrides.interface.d.ts +5 -0
- package/lib/interfaces/property-converter.interface.d.ts +4 -0
- package/lib/models/base-meta.model.d.ts +5 -0
- package/lib/models/base-query-data.d.ts +7 -0
- package/lib/models/base.model.d.ts +31 -0
- package/lib/models/employee.d.ts +12 -0
- package/lib/models/error-response.model.d.ts +17 -0
- package/lib/models/filter-request.d.ts +8 -0
- package/lib/models/index.d.ts +5 -0
- package/lib/models/menu.d.ts +15 -0
- package/lib/models/metadata-storage.d.ts +5 -0
- package/lib/models/right.d.ts +14 -0
- package/lib/models/role.d.ts +6 -0
- package/lib/models/rule.d.ts +5 -0
- package/lib/models/user.d.ts +8 -0
- package/lib/pipes/Nl2brPipe.pipe.d.ts +7 -0
- package/lib/pipes/input-error.pipe.d.ts +10 -0
- package/lib/providers.d.ts +2 -0
- package/lib/resolvers/dynamically-class-resolver.d.ts +3 -0
- package/lib/resolvers/dynamically-service-resolver.d.ts +3 -0
- package/lib/resolvers/index.d.ts +2 -0
- package/lib/rsl-base-module.d.ts +13 -0
- package/lib/services/base-datastore.service.d.ts +47 -0
- package/lib/services/base.service.d.ts +27 -0
- package/lib/services/cache.service.d.ts +11 -0
- package/lib/services/datastore.service.d.ts +12 -0
- package/lib/services/dialog.service.d.ts +7 -0
- package/lib/services/employee.service.d.ts +9 -0
- package/lib/services/index.d.ts +11 -0
- package/lib/services/local-file.service.d.ts +11 -0
- package/lib/services/right.service.d.ts +8 -0
- package/lib/services/role.service.d.ts +11 -0
- package/lib/services/route-history.service.d.ts +12 -0
- package/lib/services/translate-loader.service.d.ts +14 -0
- package/lib/services/user.service.d.ts +12 -0
- package/lib/tokens/table-tokens.d.ts +7 -0
- package/lib/utils.d.ts +2 -0
- package/lib/validators/pattern-validator.d.ts +4 -0
- package/package.json +9 -9
- package/public-api.d.ts +1 -0
- package/types/rosoftlab-core.d.ts +0 -507
|
@@ -1,16 +1,16 @@
|
|
|
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, HostBinding, Directive, Inject, Pipe, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from 'oidc-client-ts';
|
|
4
4
|
import { UserManager } from 'oidc-client-ts';
|
|
5
5
|
import { BehaviorSubject, Observable, throwError, of, ReplaySubject } from 'rxjs';
|
|
6
6
|
import * as i5 from '@angular/common';
|
|
7
|
-
import { DatePipe, DecimalPipe, PercentPipe, CommonModule } from '@angular/common';
|
|
7
|
+
import { Location, 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 { FormGroup, FormControl, UntypedFormGroup, UntypedFormControl, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
10
10
|
import * as i2 from '@angular/router';
|
|
11
|
-
import { NavigationEnd } from '@angular/router';
|
|
11
|
+
import { Router, ActivatedRoute, UrlSegment, NavigationEnd } from '@angular/router';
|
|
12
12
|
import * as i1$3 from '@ngx-translate/core';
|
|
13
|
-
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
|
|
13
|
+
import { TranslateService, TranslateModule, TranslateLoader } from '@ngx-translate/core';
|
|
14
14
|
import * as i1$1 from '@angular/common/http';
|
|
15
15
|
import { HttpHeaders, HttpParams, HttpResponse, HttpClient, HttpClientModule } from '@angular/common/http';
|
|
16
16
|
import { compare } from 'fast-json-patch';
|
|
@@ -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: "
|
|
97
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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' }); }
|
|
98
98
|
}
|
|
99
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
99
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", 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: "
|
|
125
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
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\" >\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", styles: [".error-msg{color:red}.fix-error-icon{top:27px}\n"] }); }
|
|
126
126
|
}
|
|
127
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
127
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: FieldErrorDisplayComponent, decorators: [{
|
|
128
128
|
type: Component,
|
|
129
|
-
args: [{ selector: 'rsl-field-error-display', standalone: false, template: "
|
|
129
|
+
args: [{ selector: 'rsl-field-error-display', standalone: false, template: "<div *ngIf=\"displayError\" >\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", styles: [".error-msg{color:red}.fix-error-icon{top:27px}\n"] }]
|
|
130
130
|
}], propDecorators: { errorMsg: [{
|
|
131
131
|
type: Input
|
|
132
132
|
}], displayError: [{
|
|
@@ -138,24 +138,161 @@ class PageNotFoundComponent {
|
|
|
138
138
|
}
|
|
139
139
|
ngOnInit() {
|
|
140
140
|
}
|
|
141
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
142
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
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"] }); }
|
|
143
143
|
}
|
|
144
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
144
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", 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: "
|
|
152
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
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"] }); }
|
|
153
153
|
}
|
|
154
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
154
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", 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: () => [] });
|
|
158
158
|
|
|
159
|
+
// projects/rosoftlab/core/src/lib/interfaces/dialog.interface.ts
|
|
160
|
+
const DIALOG_SERVICE_TOKEN = new InjectionToken('DIALOG_SERVICE_TOKEN');
|
|
161
|
+
|
|
162
|
+
const MODEL_SERVICE = new InjectionToken('MODEL_SERVICE');
|
|
163
|
+
const MODEL_TOKEN = new InjectionToken('MODEL_TOKEN');
|
|
164
|
+
// This token will store a map of string keys to Component Classes
|
|
165
|
+
const TABLE_IMPLEMENTATIONS_TOKEN = new InjectionToken('TABLE_IMPLEMENTATIONS_TOKEN');
|
|
166
|
+
const CRUD_IMPLEMENTATIONS_TOKEN = new InjectionToken('CRUD_IMPLEMENTATIONS_TOKEN');
|
|
167
|
+
|
|
168
|
+
class BaseCrudImplementation {
|
|
169
|
+
constructor() {
|
|
170
|
+
// Access the Router without a constructor
|
|
171
|
+
this.router = inject(Router);
|
|
172
|
+
this.route = inject(ActivatedRoute);
|
|
173
|
+
this.translate = inject(TranslateService);
|
|
174
|
+
this.location = inject(Location);
|
|
175
|
+
// Common Dependency Injection
|
|
176
|
+
this.modelService = inject(MODEL_SERVICE, { optional: true });
|
|
177
|
+
this.modelToken = inject(MODEL_TOKEN, { optional: true });
|
|
178
|
+
this.dialogService = inject(DIALOG_SERVICE_TOKEN, { optional: true });
|
|
179
|
+
this.model = null;
|
|
180
|
+
this.modelName = null;
|
|
181
|
+
this.dictPath = null; //rdict
|
|
182
|
+
this.fileLayout = ''; //rdict
|
|
183
|
+
this.idProperty = 'id';
|
|
184
|
+
this.customInclude = null;
|
|
185
|
+
this.changeUrlRoute = true;
|
|
186
|
+
this.hostClass = '';
|
|
187
|
+
this.basePath = '';
|
|
188
|
+
this.title = '';
|
|
189
|
+
this.baseForm = new FormGroup({});
|
|
190
|
+
this.isLoading = true;
|
|
191
|
+
}
|
|
192
|
+
ngOnInit() { }
|
|
193
|
+
get hostClasses() {
|
|
194
|
+
return this.hostClass;
|
|
195
|
+
}
|
|
196
|
+
afterSave(model) {
|
|
197
|
+
return new Observable((observer) => {
|
|
198
|
+
observer.next(model);
|
|
199
|
+
observer.complete();
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
beforeSave(model) {
|
|
203
|
+
return new Observable((observer) => {
|
|
204
|
+
observer.next(model);
|
|
205
|
+
observer.complete();
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
getFromGroup(formGroup = null) {
|
|
209
|
+
if (!formGroup)
|
|
210
|
+
return this.baseForm;
|
|
211
|
+
if (formGroup instanceof FormGroup)
|
|
212
|
+
return formGroup;
|
|
213
|
+
return this.baseForm.controls[formGroup];
|
|
214
|
+
}
|
|
215
|
+
validateAllFormFields(formGroup = null) {
|
|
216
|
+
const fg = this.getFromGroup(formGroup);
|
|
217
|
+
Object.keys(fg.controls).forEach((field) => {
|
|
218
|
+
// console.log(field);
|
|
219
|
+
const control = fg.get(field);
|
|
220
|
+
if (control instanceof FormControl) {
|
|
221
|
+
control.markAsTouched({ onlySelf: true });
|
|
222
|
+
}
|
|
223
|
+
else if (control instanceof FormGroup) {
|
|
224
|
+
this.validateAllFormFields(control);
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
canDeactivate() {
|
|
229
|
+
// Allow synchronous navigation (`true`) if no crisis or the crisis is unchanged
|
|
230
|
+
if (!this.baseForm.dirty) {
|
|
231
|
+
return true;
|
|
232
|
+
}
|
|
233
|
+
// Otherwise ask the user with the dialog service and return its
|
|
234
|
+
// observable which resolves to true or false when the user decides
|
|
235
|
+
return this.dialogService.confirm(this.translate.instant('General.DiscardChanges'), null, 'Discard');
|
|
236
|
+
}
|
|
237
|
+
getFiledName(filedTranslationKey) {
|
|
238
|
+
return { field: this.translate.instant(filedTranslationKey) };
|
|
239
|
+
}
|
|
240
|
+
serverErrors(err) {
|
|
241
|
+
if (err.error) {
|
|
242
|
+
if (err.error.errors) {
|
|
243
|
+
const validationErrors = err.error.errors;
|
|
244
|
+
if (Array.isArray(validationErrors)) {
|
|
245
|
+
validationErrors.forEach((prop) => {
|
|
246
|
+
const formControl = this.baseForm.get(prop);
|
|
247
|
+
if (formControl) {
|
|
248
|
+
// activate the error message
|
|
249
|
+
formControl.setErrors({
|
|
250
|
+
serverError: validationErrors[prop].join('\n')
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
const keys = Object.keys(validationErrors);
|
|
257
|
+
keys.forEach((prop) => {
|
|
258
|
+
const formControl = this.baseForm.get(prop);
|
|
259
|
+
if (formControl) {
|
|
260
|
+
// activate the error message
|
|
261
|
+
formControl.setErrors({
|
|
262
|
+
serverError: validationErrors[prop].join('\n')
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BaseCrudImplementation, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
271
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: BaseCrudImplementation, isStandalone: true, inputs: { model: "model", modelName: "modelName", dictPath: "dictPath", fileLayout: "fileLayout", idProperty: "idProperty", customInclude: "customInclude", changeUrlRoute: "changeUrlRoute", hostClass: "hostClass" }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0 }); }
|
|
272
|
+
}
|
|
273
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BaseCrudImplementation, decorators: [{
|
|
274
|
+
type: Directive
|
|
275
|
+
}], propDecorators: { model: [{
|
|
276
|
+
type: Input
|
|
277
|
+
}], modelName: [{
|
|
278
|
+
type: Input
|
|
279
|
+
}], dictPath: [{
|
|
280
|
+
type: Input
|
|
281
|
+
}], fileLayout: [{
|
|
282
|
+
type: Input
|
|
283
|
+
}], idProperty: [{
|
|
284
|
+
type: Input
|
|
285
|
+
}], customInclude: [{
|
|
286
|
+
type: Input
|
|
287
|
+
}], changeUrlRoute: [{
|
|
288
|
+
type: Input
|
|
289
|
+
}], hostClass: [{
|
|
290
|
+
type: Input
|
|
291
|
+
}], hostClasses: [{
|
|
292
|
+
type: HostBinding,
|
|
293
|
+
args: ['class']
|
|
294
|
+
}] } });
|
|
295
|
+
|
|
159
296
|
class BaseQueryData {
|
|
160
297
|
constructor(jsonApiModels, metaData) {
|
|
161
298
|
this.jsonApiModels = jsonApiModels;
|
|
@@ -213,10 +350,10 @@ class CacheService {
|
|
|
213
350
|
const keysToDelete = Object.keys(this.cache).filter(key => key.includes(keyword));
|
|
214
351
|
keysToDelete.forEach(key => this.delete(key));
|
|
215
352
|
}
|
|
216
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
217
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
353
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: CacheService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
354
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: CacheService, providedIn: 'root' }); }
|
|
218
355
|
}
|
|
219
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
356
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: CacheService, decorators: [{
|
|
220
357
|
type: Injectable,
|
|
221
358
|
args: [{
|
|
222
359
|
providedIn: 'root'
|
|
@@ -547,10 +684,10 @@ class BaseDatastore {
|
|
|
547
684
|
_toQueryString(params) {
|
|
548
685
|
return queryString.stringify(params, { arrayFormat: 'bracket' });
|
|
549
686
|
}
|
|
550
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
551
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
687
|
+
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 }); }
|
|
688
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BaseDatastore }); }
|
|
552
689
|
}
|
|
553
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
690
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BaseDatastore, decorators: [{
|
|
554
691
|
type: Injectable
|
|
555
692
|
}], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: CacheService }] });
|
|
556
693
|
|
|
@@ -638,10 +775,10 @@ class BaseService {
|
|
|
638
775
|
getSelectValues(property) {
|
|
639
776
|
return null;
|
|
640
777
|
}
|
|
641
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
642
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
778
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BaseService, deps: [{ token: BaseDatastore }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
779
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BaseService, providedIn: 'root' }); }
|
|
643
780
|
}
|
|
644
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
781
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BaseService, decorators: [{
|
|
645
782
|
type: Injectable,
|
|
646
783
|
args: [{
|
|
647
784
|
providedIn: 'root'
|
|
@@ -862,10 +999,10 @@ class BaseFormEditComponent {
|
|
|
862
999
|
}
|
|
863
1000
|
return rvalue;
|
|
864
1001
|
}
|
|
865
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
866
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
1002
|
+
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 }); }
|
|
1003
|
+
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 }); }
|
|
867
1004
|
}
|
|
868
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1005
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BaseFormEditComponent, decorators: [{
|
|
869
1006
|
type: Component,
|
|
870
1007
|
args: [{
|
|
871
1008
|
selector: 'app-base.form.edit',
|
|
@@ -877,6 +1014,145 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
877
1014
|
args: [DialogSERVICE]
|
|
878
1015
|
}] }, { type: i1$3.TranslateService }, { type: i5.Location }] });
|
|
879
1016
|
|
|
1017
|
+
class BaseTableImplementation {
|
|
1018
|
+
constructor() {
|
|
1019
|
+
// Access the Router without a constructor
|
|
1020
|
+
this.router = inject(Router);
|
|
1021
|
+
this.translate = inject(TranslateService);
|
|
1022
|
+
// Common Dependency Injection
|
|
1023
|
+
this.dataService = inject(MODEL_SERVICE, { optional: true });
|
|
1024
|
+
this.modelToken = inject(MODEL_TOKEN, { optional: true });
|
|
1025
|
+
this.dialogService = inject(DIALOG_SERVICE_TOKEN, { optional: true });
|
|
1026
|
+
this.basePath = '';
|
|
1027
|
+
this.title = '';
|
|
1028
|
+
// --- Configuration Inputs (Your previous snapshot keys) ---
|
|
1029
|
+
this.model = null;
|
|
1030
|
+
this.dictPath = null; //rdict
|
|
1031
|
+
this.fileLayout = ''; //rdict
|
|
1032
|
+
this.idProperty = 'id';
|
|
1033
|
+
// Visibility & UI
|
|
1034
|
+
this.showHeader = true;
|
|
1035
|
+
this.showSearch = false;
|
|
1036
|
+
this.searchFields = null;
|
|
1037
|
+
// Data & Pagination
|
|
1038
|
+
this.pageable = false;
|
|
1039
|
+
this.pageSizes = [10, 20, 30, 50, 100];
|
|
1040
|
+
this.defaultSort = null;
|
|
1041
|
+
this.defaultSortDirection = null;
|
|
1042
|
+
this.defaultFilter = null;
|
|
1043
|
+
this.customInclude = null;
|
|
1044
|
+
// Actions & Rules
|
|
1045
|
+
this.hasAdd = true;
|
|
1046
|
+
this.canDelete = true;
|
|
1047
|
+
this.canEdit = true;
|
|
1048
|
+
this.deletePropertyName = 'name';
|
|
1049
|
+
// Edit Behavior
|
|
1050
|
+
this.editOnClick = false;
|
|
1051
|
+
this.editOnDblClick = false;
|
|
1052
|
+
this.editColumn = null;
|
|
1053
|
+
this.useView = false; //rdict
|
|
1054
|
+
this.hostClass = '';
|
|
1055
|
+
}
|
|
1056
|
+
ngOnInit() {
|
|
1057
|
+
const urlTree = this.router.url.split('?')[0];
|
|
1058
|
+
const currentUrlSegments = urlTree
|
|
1059
|
+
.split('/')
|
|
1060
|
+
.filter((segment) => segment !== '')
|
|
1061
|
+
.map((segment) => new UrlSegment(segment, {}));
|
|
1062
|
+
this.basePath = currentUrlSegments.map((segment) => segment.path).join('/');
|
|
1063
|
+
}
|
|
1064
|
+
get hostClasses() {
|
|
1065
|
+
return this.hostClass;
|
|
1066
|
+
}
|
|
1067
|
+
addHandler() {
|
|
1068
|
+
this.router.navigate([`${this.basePath}/add`]);
|
|
1069
|
+
}
|
|
1070
|
+
edit(dataItem, column) {
|
|
1071
|
+
// 1. Resolve the dynamic ID value from the object
|
|
1072
|
+
const idValue = dataItem[this.idProperty];
|
|
1073
|
+
if (idValue) {
|
|
1074
|
+
// 2. Navigate using the resolved value
|
|
1075
|
+
this.router.navigate([`${this.basePath}/edit/${idValue}`]);
|
|
1076
|
+
}
|
|
1077
|
+
else {
|
|
1078
|
+
console.warn(`Property "${this.idProperty}" not found on data item:`, dataItem);
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* Shared delete logic that can be called by any implementation
|
|
1083
|
+
*/
|
|
1084
|
+
delete(dataItem) {
|
|
1085
|
+
const idValue = Reflect.get(dataItem, this.idProperty);
|
|
1086
|
+
const modelName = Reflect.get(dataItem, this.deletePropertyName);
|
|
1087
|
+
const message = this.translate.instant('Are you sure you want to delete this {{modelName}}?', { modelName });
|
|
1088
|
+
if (this.dialogService) {
|
|
1089
|
+
// Use the generic confirm method
|
|
1090
|
+
this.dialogService.confirmDelete().subscribe((confirmed) => {
|
|
1091
|
+
if (confirmed)
|
|
1092
|
+
this.performDelete(idValue);
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1095
|
+
else if (confirm(message)) {
|
|
1096
|
+
// Fallback to browser confirm if no service is provided
|
|
1097
|
+
this.performDelete(idValue);
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BaseTableImplementation, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1101
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: BaseTableImplementation, isStandalone: true, inputs: { model: "model", dictPath: "dictPath", fileLayout: "fileLayout", idProperty: "idProperty", showHeader: "showHeader", showSearch: "showSearch", searchFields: "searchFields", pageable: "pageable", pageSizes: "pageSizes", defaultSort: "defaultSort", defaultSortDirection: "defaultSortDirection", defaultFilter: "defaultFilter", customInclude: "customInclude", hasAdd: "hasAdd", canDelete: "canDelete", canEdit: "canEdit", deletePropertyName: "deletePropertyName", deleteDisableRule: "deleteDisableRule", editOnClick: "editOnClick", editOnDblClick: "editOnDblClick", editColumn: "editColumn", useView: "useView", hostClass: "hostClass" }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0 }); }
|
|
1102
|
+
}
|
|
1103
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BaseTableImplementation, decorators: [{
|
|
1104
|
+
type: Directive
|
|
1105
|
+
}], propDecorators: { model: [{
|
|
1106
|
+
type: Input
|
|
1107
|
+
}], dictPath: [{
|
|
1108
|
+
type: Input
|
|
1109
|
+
}], fileLayout: [{
|
|
1110
|
+
type: Input
|
|
1111
|
+
}], idProperty: [{
|
|
1112
|
+
type: Input
|
|
1113
|
+
}], showHeader: [{
|
|
1114
|
+
type: Input
|
|
1115
|
+
}], showSearch: [{
|
|
1116
|
+
type: Input
|
|
1117
|
+
}], searchFields: [{
|
|
1118
|
+
type: Input
|
|
1119
|
+
}], pageable: [{
|
|
1120
|
+
type: Input
|
|
1121
|
+
}], pageSizes: [{
|
|
1122
|
+
type: Input
|
|
1123
|
+
}], defaultSort: [{
|
|
1124
|
+
type: Input
|
|
1125
|
+
}], defaultSortDirection: [{
|
|
1126
|
+
type: Input
|
|
1127
|
+
}], defaultFilter: [{
|
|
1128
|
+
type: Input
|
|
1129
|
+
}], customInclude: [{
|
|
1130
|
+
type: Input
|
|
1131
|
+
}], hasAdd: [{
|
|
1132
|
+
type: Input
|
|
1133
|
+
}], canDelete: [{
|
|
1134
|
+
type: Input
|
|
1135
|
+
}], canEdit: [{
|
|
1136
|
+
type: Input
|
|
1137
|
+
}], deletePropertyName: [{
|
|
1138
|
+
type: Input
|
|
1139
|
+
}], deleteDisableRule: [{
|
|
1140
|
+
type: Input
|
|
1141
|
+
}], editOnClick: [{
|
|
1142
|
+
type: Input
|
|
1143
|
+
}], editOnDblClick: [{
|
|
1144
|
+
type: Input
|
|
1145
|
+
}], editColumn: [{
|
|
1146
|
+
type: Input
|
|
1147
|
+
}], useView: [{
|
|
1148
|
+
type: Input
|
|
1149
|
+
}], hostClass: [{
|
|
1150
|
+
type: Input
|
|
1151
|
+
}], hostClasses: [{
|
|
1152
|
+
type: HostBinding,
|
|
1153
|
+
args: ['class']
|
|
1154
|
+
}] } });
|
|
1155
|
+
|
|
880
1156
|
class Configurations {
|
|
881
1157
|
constructor() {
|
|
882
1158
|
this.baseUrl = '';
|
|
@@ -1074,10 +1350,10 @@ class CacheInterceptor {
|
|
|
1074
1350
|
// })
|
|
1075
1351
|
// );
|
|
1076
1352
|
}
|
|
1077
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1078
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1353
|
+
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 }); }
|
|
1354
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: CacheInterceptor }); }
|
|
1079
1355
|
}
|
|
1080
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1356
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: CacheInterceptor, decorators: [{
|
|
1081
1357
|
type: Injectable
|
|
1082
1358
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1083
1359
|
type: Inject,
|
|
@@ -1183,7 +1459,7 @@ class BaseModel {
|
|
|
1183
1459
|
const controlsConfig = {};
|
|
1184
1460
|
const that = this;
|
|
1185
1461
|
if (props) {
|
|
1186
|
-
props.forEach(property => {
|
|
1462
|
+
props.forEach((property) => {
|
|
1187
1463
|
const value = that[property] !== undefined ? that[property] : defaultValues[property];
|
|
1188
1464
|
const formSubGroup = formSubGroupsValues[property] ?? null;
|
|
1189
1465
|
if (requiredProps[property]) {
|
|
@@ -1208,27 +1484,32 @@ class BaseModel {
|
|
|
1208
1484
|
return controlsConfig[subGroup];
|
|
1209
1485
|
}
|
|
1210
1486
|
getModelFromFormGroup(formGroup, id) {
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
data.id = id;
|
|
1216
|
-
}
|
|
1217
|
-
const that = this;
|
|
1218
|
-
if (props) {
|
|
1219
|
-
props.forEach(property => {
|
|
1220
|
-
const formSubGroup = formSubGroupsValues[property] ?? null;
|
|
1221
|
-
if (!formSubGroup)
|
|
1222
|
-
data[property] = formGroup.controls[property].value ?? null;
|
|
1223
|
-
else
|
|
1224
|
-
data[property] = formGroup.controls[formSubGroup].controls[property].value ?? null;
|
|
1225
|
-
});
|
|
1226
|
-
}
|
|
1227
|
-
if (data) {
|
|
1487
|
+
try {
|
|
1488
|
+
const props = Object.keys(this.getModelPropertyNames(this));
|
|
1489
|
+
const formSubGroupsValues = this.getModelSubGroupPropertyNames(this);
|
|
1490
|
+
const data = {};
|
|
1228
1491
|
if (id) {
|
|
1229
|
-
|
|
1492
|
+
data.id = id;
|
|
1493
|
+
}
|
|
1494
|
+
const that = this;
|
|
1495
|
+
if (props) {
|
|
1496
|
+
props.forEach((property) => {
|
|
1497
|
+
const formSubGroup = formSubGroupsValues[property] ?? null;
|
|
1498
|
+
if (!formSubGroup)
|
|
1499
|
+
data[property] = formGroup.controls[property].value ?? null;
|
|
1500
|
+
else
|
|
1501
|
+
data[property] = formGroup.controls[formSubGroup].controls[property].value ?? null;
|
|
1502
|
+
});
|
|
1503
|
+
}
|
|
1504
|
+
if (data) {
|
|
1505
|
+
if (id) {
|
|
1506
|
+
this.id = id;
|
|
1507
|
+
}
|
|
1508
|
+
Object.assign(this, data);
|
|
1230
1509
|
}
|
|
1231
|
-
|
|
1510
|
+
}
|
|
1511
|
+
catch (error) {
|
|
1512
|
+
Object.assign(this, formGroup.value);
|
|
1232
1513
|
}
|
|
1233
1514
|
}
|
|
1234
1515
|
getSerializedModel() {
|
|
@@ -1279,10 +1560,10 @@ class InputErrorPipe {
|
|
|
1279
1560
|
}
|
|
1280
1561
|
return rvalue;
|
|
1281
1562
|
}
|
|
1282
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1283
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
1563
|
+
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 }); }
|
|
1564
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.8", ngImport: i0, type: InputErrorPipe, isStandalone: false, name: "inputError" }); }
|
|
1284
1565
|
}
|
|
1285
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1566
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: InputErrorPipe, decorators: [{
|
|
1286
1567
|
type: Pipe,
|
|
1287
1568
|
args: [{
|
|
1288
1569
|
name: 'inputError',
|
|
@@ -1299,10 +1580,10 @@ class Nl2brPipe {
|
|
|
1299
1580
|
}
|
|
1300
1581
|
return value;
|
|
1301
1582
|
}
|
|
1302
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1303
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
1583
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: Nl2brPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1584
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.8", ngImport: i0, type: Nl2brPipe, isStandalone: false, name: "nl2br" }); }
|
|
1304
1585
|
}
|
|
1305
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1586
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: Nl2brPipe, decorators: [{
|
|
1306
1587
|
type: Pipe,
|
|
1307
1588
|
args: [{
|
|
1308
1589
|
name: 'nl2br',
|
|
@@ -1320,14 +1601,14 @@ let DatastoreCore = class DatastoreCore extends BaseDatastore {
|
|
|
1320
1601
|
};
|
|
1321
1602
|
this.config = this.customConfig;
|
|
1322
1603
|
}
|
|
1323
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1324
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1604
|
+
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 }); }
|
|
1605
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: DatastoreCore }); }
|
|
1325
1606
|
};
|
|
1326
1607
|
DatastoreCore = __decorate([
|
|
1327
1608
|
BaseDatastoreConfig({ apiVersion: '', baseUrl: '' }),
|
|
1328
1609
|
__metadata("design:paramtypes", [HttpClient, CacheService, Configurations])
|
|
1329
1610
|
], DatastoreCore);
|
|
1330
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1611
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: DatastoreCore, decorators: [{
|
|
1331
1612
|
type: Injectable
|
|
1332
1613
|
}], ctorParameters: () => [{ type: i1$1.HttpClient }, { type: CacheService }, { type: Configurations }] });
|
|
1333
1614
|
|
|
@@ -1481,7 +1762,7 @@ __decorate([
|
|
|
1481
1762
|
Right = __decorate([
|
|
1482
1763
|
BaseModelConfig({
|
|
1483
1764
|
type: 'right',
|
|
1484
|
-
modelEndpointUrl: '
|
|
1765
|
+
modelEndpointUrl: 'right'
|
|
1485
1766
|
})
|
|
1486
1767
|
], Right);
|
|
1487
1768
|
|
|
@@ -1495,6 +1776,10 @@ __decorate([
|
|
|
1495
1776
|
Attribute({ serializedName: 'name' }),
|
|
1496
1777
|
__metadata("design:type", String)
|
|
1497
1778
|
], Role.prototype, "name", void 0);
|
|
1779
|
+
__decorate([
|
|
1780
|
+
Attribute({ serializedName: 'roleDetail' }),
|
|
1781
|
+
__metadata("design:type", Object)
|
|
1782
|
+
], Role.prototype, "roleDetail", void 0);
|
|
1498
1783
|
Role = __decorate([
|
|
1499
1784
|
BaseModelConfig({
|
|
1500
1785
|
type: 'role'
|
|
@@ -1533,10 +1818,10 @@ class EmployeeService extends BaseService {
|
|
|
1533
1818
|
super(datastore);
|
|
1534
1819
|
this.setModelType(Employee);
|
|
1535
1820
|
}
|
|
1536
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1537
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1821
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: EmployeeService, deps: [{ token: DatastoreCore }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1822
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: EmployeeService, providedIn: 'root' }); }
|
|
1538
1823
|
}
|
|
1539
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1824
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: EmployeeService, decorators: [{
|
|
1540
1825
|
type: Injectable,
|
|
1541
1826
|
args: [{
|
|
1542
1827
|
providedIn: 'root'
|
|
@@ -1561,10 +1846,10 @@ class LocalFileService {
|
|
|
1561
1846
|
});
|
|
1562
1847
|
return dataSubject.asObservable(); // Return observable
|
|
1563
1848
|
}
|
|
1564
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1565
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1849
|
+
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 }); }
|
|
1850
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: LocalFileService, providedIn: 'root' }); }
|
|
1566
1851
|
}
|
|
1567
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1852
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: LocalFileService, decorators: [{
|
|
1568
1853
|
type: Injectable,
|
|
1569
1854
|
args: [{
|
|
1570
1855
|
providedIn: 'root'
|
|
@@ -1576,10 +1861,14 @@ class RoleService extends BaseService {
|
|
|
1576
1861
|
super(datastore);
|
|
1577
1862
|
this.setModelType(Role);
|
|
1578
1863
|
}
|
|
1579
|
-
|
|
1580
|
-
|
|
1864
|
+
getRoleRights(roleId) {
|
|
1865
|
+
const url = `${this.datastore.buildUrl(Role)}/${roleId}/rights`;
|
|
1866
|
+
return this.getCustom(null, null, url);
|
|
1867
|
+
}
|
|
1868
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: RoleService, deps: [{ token: DatastoreCore }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1869
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: RoleService, providedIn: 'root' }); }
|
|
1581
1870
|
}
|
|
1582
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1871
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: RoleService, decorators: [{
|
|
1583
1872
|
type: Injectable,
|
|
1584
1873
|
args: [{
|
|
1585
1874
|
providedIn: 'root'
|
|
@@ -1608,10 +1897,10 @@ class RouteHistoryService {
|
|
|
1608
1897
|
getCurrentUrl() {
|
|
1609
1898
|
return this.currentUrl;
|
|
1610
1899
|
}
|
|
1611
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1612
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1900
|
+
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 }); }
|
|
1901
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: RouteHistoryService, providedIn: 'root' }); }
|
|
1613
1902
|
}
|
|
1614
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1903
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: RouteHistoryService, decorators: [{
|
|
1615
1904
|
type: Injectable,
|
|
1616
1905
|
args: [{
|
|
1617
1906
|
providedIn: 'root'
|
|
@@ -1635,10 +1924,10 @@ class TranslateloaderService {
|
|
|
1635
1924
|
const url = this._apiUrl + '/api/v1/language/' + lang + '/translationlist';
|
|
1636
1925
|
return this.httpClient.get(url, { headers: this.headers });
|
|
1637
1926
|
}
|
|
1638
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1639
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1927
|
+
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 }); }
|
|
1928
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: TranslateloaderService, providedIn: 'root' }); }
|
|
1640
1929
|
}
|
|
1641
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1930
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: TranslateloaderService, decorators: [{
|
|
1642
1931
|
type: Injectable,
|
|
1643
1932
|
args: [{
|
|
1644
1933
|
providedIn: 'root'
|
|
@@ -1651,12 +1940,13 @@ class UserService extends BaseService {
|
|
|
1651
1940
|
this.setModelType(User);
|
|
1652
1941
|
}
|
|
1653
1942
|
getRights() {
|
|
1654
|
-
const
|
|
1943
|
+
const url = `${this.datastore.buildUrl(User)}/rights`;
|
|
1944
|
+
const response = this.datastore.findAll(Right, null, null, url);
|
|
1655
1945
|
return response;
|
|
1656
1946
|
}
|
|
1657
1947
|
hasRightForLink(link) {
|
|
1658
1948
|
if (this.userRights && link) {
|
|
1659
|
-
const right = this.userRights.find(f => link.indexOf(f.pagePath) >= 0);
|
|
1949
|
+
const right = this.userRights.find((f) => link.indexOf(f.pagePath) >= 0);
|
|
1660
1950
|
return true;
|
|
1661
1951
|
}
|
|
1662
1952
|
return false;
|
|
@@ -1665,10 +1955,10 @@ class UserService extends BaseService {
|
|
|
1665
1955
|
const response = this.datastore.findAll(Menu);
|
|
1666
1956
|
return response;
|
|
1667
1957
|
}
|
|
1668
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1669
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1958
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: UserService, deps: [{ token: DatastoreCore }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1959
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: UserService, providedIn: 'root' }); }
|
|
1670
1960
|
}
|
|
1671
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1961
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: UserService, decorators: [{
|
|
1672
1962
|
type: Injectable,
|
|
1673
1963
|
args: [{
|
|
1674
1964
|
providedIn: 'root'
|
|
@@ -1737,10 +2027,10 @@ class RslBaseModule {
|
|
|
1737
2027
|
]
|
|
1738
2028
|
};
|
|
1739
2029
|
}
|
|
1740
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1741
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
2030
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: RslBaseModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2031
|
+
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,
|
|
1742
2032
|
TranslateModule] }); }
|
|
1743
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
2033
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: RslBaseModule, providers: [
|
|
1744
2034
|
PROVIDERS
|
|
1745
2035
|
], imports: [CommonModule,
|
|
1746
2036
|
TranslateModule.forRoot({
|
|
@@ -1755,7 +2045,7 @@ class RslBaseModule {
|
|
|
1755
2045
|
ReactiveFormsModule, HttpClientModule,
|
|
1756
2046
|
TranslateModule] }); }
|
|
1757
2047
|
}
|
|
1758
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2048
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: RslBaseModule, decorators: [{
|
|
1759
2049
|
type: NgModule,
|
|
1760
2050
|
args: [{
|
|
1761
2051
|
imports: [
|
|
@@ -1796,6 +2086,21 @@ class CustomValidators {
|
|
|
1796
2086
|
}
|
|
1797
2087
|
}
|
|
1798
2088
|
|
|
2089
|
+
class RightService extends BaseService {
|
|
2090
|
+
constructor(datastore) {
|
|
2091
|
+
super(datastore);
|
|
2092
|
+
this.setModelType(Right);
|
|
2093
|
+
}
|
|
2094
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: RightService, deps: [{ token: DatastoreCore }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2095
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: RightService, providedIn: 'root' }); }
|
|
2096
|
+
}
|
|
2097
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: RightService, decorators: [{
|
|
2098
|
+
type: Injectable,
|
|
2099
|
+
args: [{
|
|
2100
|
+
providedIn: 'root'
|
|
2101
|
+
}]
|
|
2102
|
+
}], ctorParameters: () => [{ type: DatastoreCore }] });
|
|
2103
|
+
|
|
1799
2104
|
function readFileAsync(file) {
|
|
1800
2105
|
return new Promise((resolve, reject) => {
|
|
1801
2106
|
const reader = new FileReader();
|
|
@@ -1831,5 +2136,5 @@ function getValueFromJsonData(jsonData, key) {
|
|
|
1831
2136
|
* Generated bundle index. Do not edit.
|
|
1832
2137
|
*/
|
|
1833
2138
|
|
|
1834
|
-
export { Attribute, AuthService, BaseDatastore, BaseDatastoreConfig, BaseFormEditComponent, BaseMetaModel, BaseModel, BaseModelConfig, BaseQueryData, BaseService, CacheInterceptor, CacheService, CellTextAlign, Configurations, CustomType, CustomValidators, DatastoreCore, DynamicallyModelResolver, DynamicallyServiceResolver, Employee, EmployeeService, ErrorResponse, FieldErrorDisplayComponent, GridLayoutFormat, InputErrorPipe, LocalFileService, Menu, MetadataStorage, Nl2brPipe, OIDC_CLIENT_SETTINGS, PROVIDERS, PageNotFoundComponent, Right, Role, RoleService, RouteHistoryService, RslBaseModule, Rule, Tokens, TranslateloaderService, UnderConstructionComponent, User, UserService, getValueFromJsonData, provideAuth, provideOidcUserManager, readFileAsync };
|
|
2139
|
+
export { Attribute, AuthService, BaseCrudImplementation, BaseDatastore, BaseDatastoreConfig, BaseFormEditComponent, BaseMetaModel, BaseModel, BaseModelConfig, BaseQueryData, BaseService, BaseTableImplementation, CRUD_IMPLEMENTATIONS_TOKEN, CacheInterceptor, CacheService, CellTextAlign, Configurations, CustomType, CustomValidators, DIALOG_SERVICE_TOKEN, DatastoreCore, DynamicallyModelResolver, DynamicallyServiceResolver, Employee, EmployeeService, ErrorResponse, FieldErrorDisplayComponent, GridLayoutFormat, InputErrorPipe, LocalFileService, MODEL_SERVICE, MODEL_TOKEN, Menu, MetadataStorage, Nl2brPipe, OIDC_CLIENT_SETTINGS, PROVIDERS, PageNotFoundComponent, Right, RightService, Role, RoleService, RouteHistoryService, RslBaseModule, Rule, TABLE_IMPLEMENTATIONS_TOKEN, Tokens, TranslateloaderService, UnderConstructionComponent, User, UserService, getValueFromJsonData, provideAuth, provideOidcUserManager, readFileAsync };
|
|
1835
2140
|
//# sourceMappingURL=rosoftlab-core.mjs.map
|