@rosoftlab/core 0.0.100

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. package/README.md +6 -0
  2. package/esm2020/lib/base-components/base-form-edit.component.mjs +242 -0
  3. package/esm2020/lib/base-components/field-error-display/field-error-display.component.mjs +15 -0
  4. package/esm2020/lib/base-components/generic-table/generic-table.component.mjs +431 -0
  5. package/esm2020/lib/base-components/index.mjs +5 -0
  6. package/esm2020/lib/base-components/page-not-found/page-not-found.component.mjs +15 -0
  7. package/esm2020/lib/base-components/searchable-dropdown/searchable-dropdown.component.mjs +231 -0
  8. package/esm2020/lib/base-components/under-construction/under-construction.component.mjs +12 -0
  9. package/esm2020/lib/constants/symbols.mjs +3 -0
  10. package/esm2020/lib/converters/date/date.converter.mjs +12 -0
  11. package/esm2020/lib/decorators/attribute.decorator.mjs +85 -0
  12. package/esm2020/lib/decorators/base-datastore-config.decorator.mjs +7 -0
  13. package/esm2020/lib/decorators/base-model-config.decorator.mjs +10 -0
  14. package/esm2020/lib/decorators/custom.type.decorator.mjs +11 -0
  15. package/esm2020/lib/decorators/grid-layout.decorator.mjs +23 -0
  16. package/esm2020/lib/directives/translated-content.directive.mjs +96 -0
  17. package/esm2020/lib/directives/translated-element.directive.mjs +20 -0
  18. package/esm2020/lib/index.mjs +29 -0
  19. package/esm2020/lib/interfaces/attribute-decorator-options.interface.mjs +2 -0
  20. package/esm2020/lib/interfaces/datastore-config.interface.mjs +2 -0
  21. package/esm2020/lib/interfaces/model-config.interface.mjs +2 -0
  22. package/esm2020/lib/interfaces/overrides.interface.mjs +2 -0
  23. package/esm2020/lib/interfaces/property-converter.interface.mjs +2 -0
  24. package/esm2020/lib/material.mjs +94 -0
  25. package/esm2020/lib/models/base-meta.model.mjs +7 -0
  26. package/esm2020/lib/models/base-query-data.mjs +13 -0
  27. package/esm2020/lib/models/base.model.mjs +171 -0
  28. package/esm2020/lib/models/error-response.model.mjs +9 -0
  29. package/esm2020/lib/models/grid-layout-format.enum.mjs +15 -0
  30. package/esm2020/lib/models/grid-layout.mjs +18 -0
  31. package/esm2020/lib/models/rule.mjs +6 -0
  32. package/esm2020/lib/module.mjs +55 -0
  33. package/esm2020/lib/pipes/Nl2brPipe.pipe.mjs +21 -0
  34. package/esm2020/lib/pipes/input-error.pipe.mjs +37 -0
  35. package/esm2020/lib/providers.mjs +10 -0
  36. package/esm2020/lib/services/base-datastore.service.mjs +333 -0
  37. package/esm2020/lib/services/base.service.mjs +95 -0
  38. package/esm2020/lib/services/dialog.service.mjs +150 -0
  39. package/esm2020/lib/services/grid-layout.service.mjs +21 -0
  40. package/esm2020/lib/services/index.mjs +5 -0
  41. package/esm2020/lib/validators/pattern-validator.mjs +15 -0
  42. package/esm2020/public-api.mjs +12 -0
  43. package/esm2020/rosoftlab-core.mjs +5 -0
  44. package/fesm2015/rosoftlab-core.mjs +2217 -0
  45. package/fesm2015/rosoftlab-core.mjs.map +1 -0
  46. package/fesm2020/rosoftlab-core.mjs +2210 -0
  47. package/fesm2020/rosoftlab-core.mjs.map +1 -0
  48. package/lib/base-components/base-form-edit.component.d.ts +58 -0
  49. package/lib/base-components/field-error-display/field-error-display.component.d.ts +7 -0
  50. package/lib/base-components/generic-table/generic-table.component.d.ts +93 -0
  51. package/lib/base-components/index.d.ts +4 -0
  52. package/lib/base-components/page-not-found/page-not-found.component.d.ts +8 -0
  53. package/lib/base-components/searchable-dropdown/searchable-dropdown.component.d.ts +62 -0
  54. package/lib/base-components/under-construction/under-construction.component.d.ts +6 -0
  55. package/lib/constants/symbols.d.ts +1 -0
  56. package/lib/converters/date/date.converter.d.ts +5 -0
  57. package/lib/decorators/attribute.decorator.d.ts +2 -0
  58. package/lib/decorators/base-datastore-config.decorator.d.ts +1 -0
  59. package/lib/decorators/base-model-config.decorator.d.ts +1 -0
  60. package/lib/decorators/custom.type.decorator.d.ts +1 -0
  61. package/lib/decorators/grid-layout.decorator.d.ts +2 -0
  62. package/lib/directives/translated-content.directive.d.ts +21 -0
  63. package/lib/directives/translated-element.directive.d.ts +10 -0
  64. package/lib/index.d.ts +27 -0
  65. package/lib/interfaces/attribute-decorator-options.interface.d.ts +8 -0
  66. package/lib/interfaces/datastore-config.interface.d.ts +8 -0
  67. package/lib/interfaces/model-config.interface.d.ts +8 -0
  68. package/lib/interfaces/overrides.interface.d.ts +5 -0
  69. package/lib/interfaces/property-converter.interface.d.ts +4 -0
  70. package/lib/material.d.ts +42 -0
  71. package/lib/models/base-meta.model.d.ts +5 -0
  72. package/lib/models/base-query-data.d.ts +7 -0
  73. package/lib/models/base.model.d.ts +33 -0
  74. package/lib/models/error-response.model.d.ts +17 -0
  75. package/lib/models/grid-layout-format.enum.d.ts +12 -0
  76. package/lib/models/grid-layout.d.ts +13 -0
  77. package/lib/models/rule.d.ts +5 -0
  78. package/lib/module.d.ts +14 -0
  79. package/lib/pipes/Nl2brPipe.pipe.d.ts +7 -0
  80. package/lib/pipes/input-error.pipe.d.ts +10 -0
  81. package/lib/providers.d.ts +2 -0
  82. package/lib/services/base-datastore.service.d.ts +45 -0
  83. package/lib/services/base.service.d.ts +26 -0
  84. package/lib/services/dialog.service.d.ts +21 -0
  85. package/lib/services/grid-layout.service.d.ts +9 -0
  86. package/lib/services/index.d.ts +4 -0
  87. package/lib/validators/pattern-validator.d.ts +4 -0
  88. package/package.json +53 -0
  89. package/public-api.d.ts +7 -0
  90. package/rosoftlab-core.d.ts +5 -0
@@ -0,0 +1,62 @@
1
+ import { FocusMonitor } from '@angular/cdk/a11y';
2
+ import { ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
3
+ import { AbstractControl, ControlValueAccessor, NgControl } from '@angular/forms';
4
+ import { Subject } from 'rxjs';
5
+ import { BaseModel } from '../../models/base.model';
6
+ import { BaseService } from '../../services/base.service';
7
+ import * as i0 from "@angular/core";
8
+ export declare class SearchableDropdownComponent<T extends BaseModel> implements OnInit, OnDestroy, ControlValueAccessor {
9
+ private _focusMonitor;
10
+ private _elementRef;
11
+ ngControl: NgControl;
12
+ static nextId: number;
13
+ onChange: (_: any) => void;
14
+ onTouched: () => void;
15
+ stateChanges: Subject<void>;
16
+ focused: boolean;
17
+ errorState: boolean;
18
+ id: string;
19
+ label: string;
20
+ fControlName: string;
21
+ serviceRef: BaseService<T>;
22
+ searchFields: string;
23
+ displayFields: string;
24
+ sortFields: string;
25
+ valueField: string;
26
+ minLengthTerm: number;
27
+ preloadElementsCount: number;
28
+ modelSelected: EventEmitter<BaseModel>;
29
+ get empty(): boolean;
30
+ get required(): boolean;
31
+ set required(value: boolean);
32
+ private _required;
33
+ get disabled(): boolean;
34
+ set disabled(value: boolean);
35
+ private _disabled;
36
+ get value(): any | null;
37
+ set value(value: any | null);
38
+ private _value;
39
+ searchControl: AbstractControl;
40
+ showSerach: boolean;
41
+ isLoading: boolean;
42
+ options: any[];
43
+ filteredOptions: any[];
44
+ /** Subject that emits when the component has been destroyed. */
45
+ protected _onDestroy: Subject<void>;
46
+ constructor(_focusMonitor: FocusMonitor, _elementRef: ElementRef<HTMLElement>, ngControl: NgControl);
47
+ ngOnInit(): void;
48
+ onSelected($event: any): void;
49
+ setControlValue(value: any): void;
50
+ displayWith(value: any): string;
51
+ clearSelection(): void;
52
+ getConcatedFields(option: any): string;
53
+ ngOnDestroy(): void;
54
+ getSearchText(): string;
55
+ writeValue(model: T | null): void;
56
+ registerOnChange(fn: any): void;
57
+ registerOnTouched(fn: any): void;
58
+ setDisabledState(isDisabled: boolean): void;
59
+ private loadModel;
60
+ static ɵfac: i0.ɵɵFactoryDeclaration<SearchableDropdownComponent<any>, [null, null, { optional: true; self: true; }]>;
61
+ static ɵcmp: i0.ɵɵComponentDeclaration<SearchableDropdownComponent<any>, "rsl-searchable-dropdown", never, { "label": "label"; "fControlName": "fControlName"; "serviceRef": "serviceRef"; "searchFields": "searchFields"; "displayFields": "displayFields"; "sortFields": "sortFields"; "valueField": "valueField"; "minLengthTerm": "minLengthTerm"; "preloadElementsCount": "preloadElementsCount"; "required": "required"; "disabled": "disabled"; "value": "value"; }, { "modelSelected": "modelSelected"; }, never, never>;
62
+ }
@@ -0,0 +1,6 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class UnderConstructionComponent {
3
+ constructor();
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<UnderConstructionComponent, never>;
5
+ static ɵcmp: i0.ɵɵComponentDeclaration<UnderConstructionComponent, "rsl-under-construction", never, {}, {}, never, never>;
6
+ }
@@ -0,0 +1 @@
1
+ export declare const AttributeMetadata: any;
@@ -0,0 +1,5 @@
1
+ import { PropertyConverter } from '../../interfaces/property-converter.interface';
2
+ export declare class DateConverter implements PropertyConverter {
3
+ mask(value: any): Date;
4
+ unmask(value: any): any;
5
+ }
@@ -0,0 +1,2 @@
1
+ import { AttributeDecoratorOptions } from '../interfaces/attribute-decorator-options.interface';
2
+ export declare function Attribute(options?: AttributeDecoratorOptions): PropertyDecorator;
@@ -0,0 +1 @@
1
+ export declare function BaseDatastoreConfig(config?: any): (target: any) => void;
@@ -0,0 +1 @@
1
+ export declare function BaseModelConfig(config?: any): (target: any) => void;
@@ -0,0 +1 @@
1
+ export declare function CustomType(config?: any): (target: any, propertyName: string | symbol) => void;
@@ -0,0 +1,2 @@
1
+ import { CellTextAlign, GridLayoutFormat } from '../models/grid-layout-format.enum';
2
+ export declare function GridLayout(translateKey: string, width?: number | null, grow?: 0 | 1, shrink?: 0 | 1, subProperty?: string | null, formating?: GridLayoutFormat, format?: string, order?: number, textAlign?: CellTextAlign): (target: any, propertyName: string | symbol) => void;
@@ -0,0 +1,21 @@
1
+ import { AfterContentInit, ChangeDetectorRef, OnDestroy, OnInit, Renderer2, ViewContainerRef } from '@angular/core';
2
+ import { TranslateService } from '@ngx-translate/core';
3
+ import * as i0 from "@angular/core";
4
+ export declare class TranslatedContentDirective implements OnInit, OnDestroy, AfterContentInit {
5
+ private viewRef;
6
+ private renderer;
7
+ private translateService;
8
+ private changeDetectorRef;
9
+ translationKey: string;
10
+ private elements;
11
+ private subs;
12
+ private rawTranslation;
13
+ private translationData;
14
+ constructor(viewRef: ViewContainerRef, renderer: Renderer2, translateService: TranslateService, changeDetectorRef: ChangeDetectorRef);
15
+ ngOnInit(): void;
16
+ ngAfterContentInit(): void;
17
+ private render;
18
+ ngOnDestroy(): void;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<TranslatedContentDirective, never>;
20
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TranslatedContentDirective, "[appTranslatedContent]", never, { "translationKey": "appTranslatedContent"; }, {}, ["elements"]>;
21
+ }
@@ -0,0 +1,10 @@
1
+ import { TemplateRef, ViewContainerRef } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class TranslatedElementDirective {
4
+ readonly viewRef: ViewContainerRef;
5
+ readonly templateRef: TemplateRef<any>;
6
+ elementKey: string;
7
+ constructor(viewRef: ViewContainerRef, templateRef: TemplateRef<any>);
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<TranslatedElementDirective, never>;
9
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TranslatedElementDirective, "[translatedElement]", never, { "elementKey": "translatedElement"; }, {}, never>;
10
+ }
package/lib/index.d.ts ADDED
@@ -0,0 +1,27 @@
1
+ export * from './base-components';
2
+ export * from './decorators/attribute.decorator';
3
+ export * from './decorators/base-datastore-config.decorator';
4
+ export * from './decorators/base-model-config.decorator';
5
+ export * from './decorators/custom.type.decorator';
6
+ export * from './decorators/grid-layout.decorator';
7
+ export * from './directives/translated-content.directive';
8
+ export * from './directives/translated-element.directive';
9
+ export * from './interfaces/attribute-decorator-options.interface';
10
+ export * from './interfaces/datastore-config.interface';
11
+ export * from './interfaces/model-config.interface';
12
+ export * from './interfaces/overrides.interface';
13
+ export * from './interfaces/property-converter.interface';
14
+ export * from './models/base-meta.model';
15
+ export * from './models/base-query-data';
16
+ export * from './models/base.model';
17
+ export * from './models/error-response.model';
18
+ export * from './models/grid-layout';
19
+ export * from './models/grid-layout-format.enum';
20
+ export * from './models/rule';
21
+ export * from './module';
22
+ export * from './pipes/input-error.pipe';
23
+ export * from './pipes/Nl2brPipe.pipe';
24
+ export * from './providers';
25
+ export * from './services/base.service';
26
+ export * from './services/grid-layout.service';
27
+ export * from './validators/pattern-validator';
@@ -0,0 +1,8 @@
1
+ import { PropertyConverter } from './property-converter.interface';
2
+ export interface AttributeDecoratorOptions {
3
+ serializedName?: string;
4
+ converter?: PropertyConverter;
5
+ required?: boolean;
6
+ defaultValue?: any;
7
+ formSubGroup?: string;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { Overrides } from './overrides.interface';
2
+ export interface DatastoreConfig {
3
+ apiVersion?: string;
4
+ baseUrl?: string;
5
+ models?: object;
6
+ overrides?: Overrides;
7
+ mock?: boolean;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { BaseMetaModel } from '../models/base-meta.model';
2
+ export interface ModelConfig {
3
+ type: string;
4
+ apiVersion?: string;
5
+ baseUrl?: string;
6
+ modelEndpointUrl?: string;
7
+ meta?: BaseMetaModel;
8
+ }
@@ -0,0 +1,5 @@
1
+ export interface Overrides {
2
+ getDirtyAttributes?: (attributedMetadata: any, model?: any) => object;
3
+ getAllAttributes?: (attributedMetadata: any, model?: any) => object;
4
+ toQueryString?: (params: any) => string;
5
+ }
@@ -0,0 +1,4 @@
1
+ export interface PropertyConverter {
2
+ mask(value: any): any;
3
+ unmask(value: any): any;
4
+ }
@@ -0,0 +1,42 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@angular/material/autocomplete";
3
+ import * as i2 from "@angular/material/button";
4
+ import * as i3 from "@angular/material/button-toggle";
5
+ import * as i4 from "@angular/material/card";
6
+ import * as i5 from "@angular/material/checkbox";
7
+ import * as i6 from "@angular/material/chips";
8
+ import * as i7 from "@angular/material/datepicker";
9
+ import * as i8 from "@angular/material/dialog";
10
+ import * as i9 from "@angular/material/expansion";
11
+ import * as i10 from "@angular/material/grid-list";
12
+ import * as i11 from "@angular/material/icon";
13
+ import * as i12 from "@angular/material/input";
14
+ import * as i13 from "@angular/material/list";
15
+ import * as i14 from "@angular/material/menu";
16
+ import * as i15 from "@angular/material/core";
17
+ import * as i16 from "@angular/material/paginator";
18
+ import * as i17 from "@angular/material/progress-bar";
19
+ import * as i18 from "@angular/material/progress-spinner";
20
+ import * as i19 from "@angular/material/radio";
21
+ import * as i20 from "@angular/material/select";
22
+ import * as i21 from "@angular/material/sidenav";
23
+ import * as i22 from "@angular/material/slider";
24
+ import * as i23 from "@angular/material/slide-toggle";
25
+ import * as i24 from "@angular/material/snack-bar";
26
+ import * as i25 from "@angular/material/sort";
27
+ import * as i26 from "@angular/material/table";
28
+ import * as i27 from "@angular/material/tabs";
29
+ import * as i28 from "@angular/material/toolbar";
30
+ import * as i29 from "@angular/material/tooltip";
31
+ import * as i30 from "@angular/cdk/drag-drop";
32
+ import * as i31 from "@angular/material/divider";
33
+ import * as i32 from "@angular/cdk/portal";
34
+ import * as i33 from "@angular/material/tree";
35
+ import * as i34 from "@angular/material/badge";
36
+ import * as i35 from "@angular/material/stepper";
37
+ import * as i36 from "@angular/cdk/stepper";
38
+ export declare class MaterialModule {
39
+ static ɵfac: i0.ɵɵFactoryDeclaration<MaterialModule, never>;
40
+ static ɵmod: i0.ɵɵNgModuleDeclaration<MaterialModule, never, [typeof i1.MatAutocompleteModule, typeof i2.MatButtonModule, typeof i3.MatButtonToggleModule, typeof i4.MatCardModule, typeof i5.MatCheckboxModule, typeof i6.MatChipsModule, typeof i7.MatDatepickerModule, typeof i8.MatDialogModule, typeof i9.MatExpansionModule, typeof i10.MatGridListModule, typeof i11.MatIconModule, typeof i12.MatInputModule, typeof i13.MatListModule, typeof i14.MatMenuModule, typeof i15.MatNativeDateModule, typeof i16.MatPaginatorModule, typeof i17.MatProgressBarModule, typeof i18.MatProgressSpinnerModule, typeof i19.MatRadioModule, typeof i15.MatRippleModule, typeof i20.MatSelectModule, typeof i21.MatSidenavModule, typeof i22.MatSliderModule, typeof i23.MatSlideToggleModule, typeof i24.MatSnackBarModule, typeof i25.MatSortModule, typeof i26.MatTableModule, typeof i27.MatTabsModule, typeof i28.MatToolbarModule, typeof i29.MatTooltipModule, typeof i15.MatOptionModule, typeof i30.DragDropModule, typeof i31.MatDividerModule, typeof i32.PortalModule, typeof i33.MatTreeModule, typeof i34.MatBadgeModule, typeof i35.MatStepperModule, typeof i36.CdkStepperModule], [typeof i1.MatAutocompleteModule, typeof i2.MatButtonModule, typeof i3.MatButtonToggleModule, typeof i4.MatCardModule, typeof i5.MatCheckboxModule, typeof i6.MatChipsModule, typeof i7.MatDatepickerModule, typeof i8.MatDialogModule, typeof i9.MatExpansionModule, typeof i10.MatGridListModule, typeof i11.MatIconModule, typeof i12.MatInputModule, typeof i13.MatListModule, typeof i14.MatMenuModule, typeof i15.MatNativeDateModule, typeof i16.MatPaginatorModule, typeof i17.MatProgressBarModule, typeof i18.MatProgressSpinnerModule, typeof i19.MatRadioModule, typeof i15.MatRippleModule, typeof i20.MatSelectModule, typeof i21.MatSidenavModule, typeof i22.MatSliderModule, typeof i23.MatSlideToggleModule, typeof i24.MatSnackBarModule, typeof i25.MatSortModule, typeof i26.MatTableModule, typeof i27.MatTabsModule, typeof i28.MatToolbarModule, typeof i29.MatTooltipModule, typeof i15.MatOptionModule, typeof i30.DragDropModule, typeof i31.MatDividerModule, typeof i32.PortalModule, typeof i33.MatTreeModule, typeof i34.MatBadgeModule, typeof i35.MatStepperModule, typeof i36.CdkStepperModule]>;
41
+ static ɵinj: i0.ɵɵInjectorDeclaration<MaterialModule>;
42
+ }
@@ -0,0 +1,5 @@
1
+ export declare class BaseMetaModel {
2
+ links: Array<any>;
3
+ meta: any;
4
+ constructor(response: any);
5
+ }
@@ -0,0 +1,7 @@
1
+ export declare class BaseQueryData<T> {
2
+ protected jsonApiModels: Array<T>;
3
+ protected metaData?: any;
4
+ constructor(jsonApiModels: Array<T>, metaData?: any);
5
+ getModels(): T[];
6
+ getMeta(): any;
7
+ }
@@ -0,0 +1,33 @@
1
+ import { HttpHeaders } from '@angular/common/http';
2
+ import { FormBuilder, FormGroup } from '@angular/forms';
3
+ import { Observable } from 'rxjs';
4
+ import { ModelConfig } from '../interfaces/model-config.interface';
5
+ import { BaseDatastore, ModelType } from '../services/base-datastore.service';
6
+ import { GridLayoutModel } from './grid-layout';
7
+ export declare class BaseModel {
8
+ protected _datastore: BaseDatastore;
9
+ highlighted: boolean;
10
+ id: any;
11
+ [key: string]: any;
12
+ constructor(_datastore: BaseDatastore, data?: any);
13
+ save(params?: any, headers?: HttpHeaders, customUrl?: string, customBody?: any): Observable<this>;
14
+ patch(origModel: this, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<this>;
15
+ replace(params?: any, headers?: HttpHeaders, customUrl?: string, customBody?: any): Observable<this>;
16
+ get attributeMetadata(): any;
17
+ set attributeMetadata(val: any);
18
+ get hasDirtyAttributes(): boolean;
19
+ rollbackAttributes(): void;
20
+ get modelConfig(): ModelConfig;
21
+ protected deserializeModel<T extends BaseModel>(modelType: ModelType<T>, data: any): T;
22
+ protected transformSerializedNamesToPropertyNames<T extends BaseModel>(modelType: ModelType<T>, attributes: any): any;
23
+ getModelPropertyNames(model: BaseModel): any;
24
+ getModelRequiredPropertyNames(model: BaseModel): any;
25
+ getModelDefaultPropertyValues(model: BaseModel): any;
26
+ getModelSubGroupPropertyNames(model: BaseModel): any;
27
+ getFromGroup(fb: FormBuilder): FormGroup;
28
+ private getSubFromGroup;
29
+ getModelFromFormGroup(formGroup: FormGroup, id?: any): void;
30
+ getGridLayout(): GridLayoutModel[];
31
+ getSerializedModel(): any;
32
+ getCellClass(property: string): string;
33
+ }
@@ -0,0 +1,17 @@
1
+ export interface JsonBaseError {
2
+ id?: string;
3
+ links?: Array<any>;
4
+ status?: string;
5
+ code?: string;
6
+ title?: string;
7
+ detail?: string;
8
+ source?: {
9
+ pointer?: string;
10
+ parameter?: string;
11
+ };
12
+ meta?: any;
13
+ }
14
+ export declare class ErrorResponse {
15
+ errors?: JsonBaseError[];
16
+ constructor(errors?: JsonBaseError[]);
17
+ }
@@ -0,0 +1,12 @@
1
+ export declare enum GridLayoutFormat {
2
+ none = 0,
3
+ date = 1,
4
+ number = 2,
5
+ percent = 3,
6
+ picture = 4
7
+ }
8
+ export declare enum CellTextAlign {
9
+ left = "left",
10
+ center = "center",
11
+ right = "right"
12
+ }
@@ -0,0 +1,13 @@
1
+ import { CellTextAlign, GridLayoutFormat } from './grid-layout-format.enum';
2
+ export declare class GridLayoutModel {
3
+ constructor(propertyName: string, translateKey?: any, width?: any, grow?: 0 | 1, shrink?: 0 | 1, formating?: GridLayoutFormat, format?: string, order?: number, textAlign?: CellTextAlign);
4
+ propertyName: string;
5
+ translateKey: string;
6
+ width: number;
7
+ grow: 0 | 1;
8
+ shrink: 0 | 1;
9
+ formating: GridLayoutFormat;
10
+ format: string;
11
+ order: number;
12
+ textAlign: CellTextAlign;
13
+ }
@@ -0,0 +1,5 @@
1
+ export declare class Rule {
2
+ rule: any;
3
+ order: number;
4
+ parameters: string[];
5
+ }
@@ -0,0 +1,14 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./base-components/generic-table/generic-table.component";
3
+ import * as i2 from "./base-components/searchable-dropdown/searchable-dropdown.component";
4
+ import * as i3 from "@angular/common";
5
+ import * as i4 from "@ngx-translate/core";
6
+ import * as i5 from "./material";
7
+ import * as i6 from "@angular/forms";
8
+ import * as i7 from "ng-block-ui";
9
+ import * as i8 from "@angular/common/http";
10
+ export declare class RslBaseModule {
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<RslBaseModule, never>;
12
+ static ɵmod: i0.ɵɵNgModuleDeclaration<RslBaseModule, [typeof i1.GenericTableComponent, typeof i2.SearchableDropdownComponent], [typeof i3.CommonModule, typeof i4.TranslateModule, typeof i5.MaterialModule, typeof i6.ReactiveFormsModule, typeof i7.BlockUIModule], [typeof i8.HttpClientModule, typeof i1.GenericTableComponent, typeof i2.SearchableDropdownComponent]>;
13
+ static ɵinj: i0.ɵɵInjectorDeclaration<RslBaseModule>;
14
+ }
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class Nl2brPipe implements PipeTransform {
4
+ transform(value: any, args?: any): any;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<Nl2brPipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<Nl2brPipe, "nl2br">;
7
+ }
@@ -0,0 +1,10 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { TranslateService } from '@ngx-translate/core';
3
+ import * as i0 from "@angular/core";
4
+ export declare class InputErrorPipe implements PipeTransform {
5
+ protected translate: TranslateService;
6
+ constructor(translate: TranslateService);
7
+ transform(value: any, filedTranslationKey: any): string;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<InputErrorPipe, never>;
9
+ static ɵpipe: i0.ɵɵPipeDeclaration<InputErrorPipe, "inputError">;
10
+ }
@@ -0,0 +1,2 @@
1
+ export * from './services';
2
+ export declare const PROVIDERS: any[];
@@ -0,0 +1,45 @@
1
+ import { HttpClient, HttpErrorResponse, HttpHeaders, HttpParams } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ import { DatastoreConfig } from '../interfaces/datastore-config.interface';
4
+ import { BaseQueryData } from '../models/base-query-data';
5
+ import { BaseModel } from '../models/base.model';
6
+ import * as i0 from "@angular/core";
7
+ export declare type ModelType<T extends BaseModel> = new (datastore: BaseDatastore, data: any) => T;
8
+ export declare class BaseDatastore {
9
+ protected httpClient: HttpClient;
10
+ protected config: DatastoreConfig;
11
+ private _store;
12
+ private toQueryString;
13
+ private get getDirtyAttributes();
14
+ get getAllAttributes(): (attributedMetadata: any, model?: any) => object;
15
+ private static getDirtyAttributes;
16
+ private static getAllAttributes;
17
+ constructor(httpClient: HttpClient);
18
+ findAll<T extends BaseModel>(modelType: ModelType<T>, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<BaseQueryData<T>>;
19
+ findRecord<T extends BaseModel>(modelType: ModelType<T>, id?: string, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<T>;
20
+ getCustom<U, T extends BaseModel>(modelType: ModelType<T>, params?: any, headers?: HttpHeaders, customUrl?: string, customResponseType?: any): Observable<U>;
21
+ postCustom<U, T extends BaseModel>(modelType: ModelType<T>, body: any, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<U>;
22
+ patchCustom<U, T extends BaseModel>(modelType: ModelType<T>, body: any, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<U>;
23
+ createRecord<T extends BaseModel>(modelType: ModelType<T>, data?: any): T;
24
+ saveRecord<T extends BaseModel>(attributesMetadata: any, model: T, params?: any, headers?: HttpHeaders, customUrl?: string, customBody?: any): Observable<T>;
25
+ patchRecord<T extends BaseModel>(attributesMetadata: any, model: T, origModel: T, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<T>;
26
+ replaceRecord<T extends BaseModel>(attributesMetadata: any, model: T, params?: any, headers?: HttpHeaders, customUrl?: string, customBody?: any): Observable<T>;
27
+ deleteRecord<T extends BaseModel>(modelType: ModelType<T>, id: string, headers?: HttpHeaders, customUrl?: string): Observable<{}>;
28
+ buildUrl<T extends BaseModel>(modelType: ModelType<T>, customUrl?: string): string;
29
+ protected extractQueryData<T extends BaseModel>(res: any, modelType: ModelType<T>): BaseQueryData<T>;
30
+ protected deserializeModel<T extends BaseModel>(modelType: ModelType<T>, data: any): T;
31
+ protected handleError(error: HttpErrorResponse): Observable<never>;
32
+ protected parseMeta(body: any, modelType: ModelType<BaseModel>): any;
33
+ protected resetMetadataAttributes<T extends BaseModel>(res: T, attributesMetadata: any, modelType: ModelType<T>): T;
34
+ get datastoreConfig(): DatastoreConfig;
35
+ protected transformSerializedNamesToPropertyNames<T extends BaseModel>(modelType: ModelType<T>, attributes: any): any;
36
+ protected getModelPropertyNames(model: BaseModel): any;
37
+ buildHeaders(customHeaders?: HttpHeaders): HttpHeaders;
38
+ buildParams(params: any, id?: string): HttpParams;
39
+ protected entityToModel<T extends BaseModel>(res: any, modelType: ModelType<T>, model?: T): T;
40
+ private extractRecordDataJson;
41
+ modelToEntity<T extends BaseModel>(model: T, attributesMetadata: any, allAttributes?: boolean): any;
42
+ private _toQueryString;
43
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaseDatastore, never>;
44
+ static ɵprov: i0.ɵɵInjectableDeclaration<BaseDatastore>;
45
+ }
@@ -0,0 +1,26 @@
1
+ import { HttpHeaders } from '@angular/common/http';
2
+ import { FormBuilder, FormGroup } from '@angular/forms';
3
+ import { Observable } from 'rxjs';
4
+ import { BaseQueryData } from '../models/base-query-data';
5
+ import { BaseModel } from '../models/base.model';
6
+ import { BaseDatastore, ModelType } from './base-datastore.service';
7
+ import * as i0 from "@angular/core";
8
+ export declare abstract class BaseService<T extends BaseModel> {
9
+ datastore: BaseDatastore;
10
+ modelType: ModelType<T>;
11
+ constructor(datastore: BaseDatastore);
12
+ setModelType(modelType: ModelType<T>): void;
13
+ get(id?: any, customInclude?: string): Observable<T>;
14
+ getAll(page: number, pageSize: number, sort?: string, filters?: string, customInclude?: string): Observable<BaseQueryData<T>>;
15
+ delete(id: any): Observable<{}>;
16
+ getCustom<U>(params?: any, headers?: HttpHeaders, customUrl?: string, customResponseType?: any): Observable<U>;
17
+ postCustom<U>(body: any, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<U>;
18
+ patchCustom<U>(body: any, params?: any, headers?: HttpHeaders, customUrl?: string): Observable<U>;
19
+ save(docTypeOrFormGroup: T | FormGroup, id?: any, origModel?: T): Observable<T>;
20
+ patch(docTypeOrFormGroup: T | FormGroup, origModel: T, id?: any): Observable<T>;
21
+ newModel(data?: any): T;
22
+ toFormGroup(fb: FormBuilder, fromModel?: T): FormGroup;
23
+ fromFormGroup(formGroup: FormGroup, id?: any): T;
24
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaseService<any>, never>;
25
+ static ɵprov: i0.ɵɵInjectableDeclaration<BaseService<any>>;
26
+ }
@@ -0,0 +1,21 @@
1
+ import { Observable } from 'rxjs';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Async modal dialog service
5
+ * DialogService makes this app easier to test by faking this service.
6
+ * TODO: better modal implementation that doesn't use window.confirm
7
+ */
8
+ export declare class DialogService {
9
+ /**
10
+ * Ask user to confirm an action. `message` explains the action and choices.
11
+ * Returns observable resolving to `true`=confirm or `false`=cancel
12
+ */
13
+ constructor();
14
+ confirm(message?: string, text?: string, confirmButtonText?: string, cancelButtonText?: string): Observable<boolean>;
15
+ showSaveMessage(message?: string, title?: string): Observable<boolean>;
16
+ showRegisteredMessage(message?: string, title?: string): Observable<boolean>;
17
+ showErrorMessage(e: any, message?: string): Observable<boolean>;
18
+ getTextTranslation(translationKey: string): string;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<DialogService, never>;
20
+ static ɵprov: i0.ɵɵInjectableDeclaration<DialogService>;
21
+ }
@@ -0,0 +1,9 @@
1
+ import { BaseModel, BaseService, GridLayoutModel } from '..';
2
+ import * as i0 from "@angular/core";
3
+ export declare class GridLayoutService<T extends BaseModel> {
4
+ protected baseService: BaseService<T>;
5
+ constructor(baseService: BaseService<T>);
6
+ getGridLayout(): GridLayoutModel[];
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<GridLayoutService<any>, never>;
8
+ static ɵprov: i0.ɵɵInjectableDeclaration<GridLayoutService<any>>;
9
+ }
@@ -0,0 +1,4 @@
1
+ export * from './base-datastore.service';
2
+ export * from './base.service';
3
+ export * from './dialog.service';
4
+ export * from './grid-layout.service';
@@ -0,0 +1,4 @@
1
+ import { ValidationErrors, ValidatorFn } from '@angular/forms';
2
+ export declare class CustomValidators {
3
+ static patternValidator(regex: RegExp, error: ValidationErrors): ValidatorFn;
4
+ }
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@rosoftlab/core",
3
+ "version": "0.0.100",
4
+ "peerDependencies": {
5
+ "@angular/common": "^15.0.0",
6
+ "@angular/core": "^15.0.0",
7
+ "fast-json-patch": "^3.1.0",
8
+ "date-fns": "^2.28.0",
9
+ "@types/qs": "^6.9.7",
10
+ "@tinymce/tinymce-angular": "^5.0.1",
11
+ "@ngx-translate/core": "^14.0.0",
12
+ "tinymce": "^6.0.0",
13
+ "@angular/material": "^13.3.0",
14
+ "json-logic-js": "^2.0.2",
15
+ "@sweetalert2/theme-material-ui": "^5.0.10",
16
+ "sweetalert2": "^11.4.5",
17
+ "@angular/cdk": "^13.3.0",
18
+ "ng-block-ui": "^3.0.2"
19
+ },
20
+ "dependencies": {
21
+ "tslib": "^2.3.1"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/rosoftlab/rsl-workspace.git"
26
+ },
27
+ "author": "rosoftlab",
28
+ "license": "ISC",
29
+ "bugs": {
30
+ "url": "https://github.com/rosoftlab/rsl-workspace/issues"
31
+ },
32
+ "homepage": "https://github.com/rosoftlab/rsl-workspace#readme",
33
+ "module": "fesm2015/rosoftlab-core.mjs",
34
+ "es2020": "fesm2020/rosoftlab-core.mjs",
35
+ "esm2020": "esm2020/rosoftlab-core.mjs",
36
+ "fesm2020": "fesm2020/rosoftlab-core.mjs",
37
+ "fesm2015": "fesm2015/rosoftlab-core.mjs",
38
+ "typings": "rosoftlab-core.d.ts",
39
+ "exports": {
40
+ "./package.json": {
41
+ "default": "./package.json"
42
+ },
43
+ ".": {
44
+ "types": "./rosoftlab-core.d.ts",
45
+ "esm2020": "./esm2020/rosoftlab-core.mjs",
46
+ "es2020": "./fesm2020/rosoftlab-core.mjs",
47
+ "es2015": "./fesm2015/rosoftlab-core.mjs",
48
+ "node": "./fesm2015/rosoftlab-core.mjs",
49
+ "default": "./fesm2020/rosoftlab-core.mjs"
50
+ }
51
+ },
52
+ "sideEffects": false
53
+ }
@@ -0,0 +1,7 @@
1
+ export * from './lib/base-components';
2
+ export * from './lib/base-components/base-form-edit.component';
3
+ export * from './lib/base-components/generic-table/generic-table.component';
4
+ export * from './lib/index';
5
+ export * from './lib/material';
6
+ export * from './lib/module';
7
+ export * from './lib/providers';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@rosoftlab/core" />
5
+ export * from './public-api';