tin-spa 2.6.13 → 2.6.14

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 (39) hide show
  1. package/esm2020/lib/classes/Classes.mjs +3 -1
  2. package/esm2020/lib/classes/TinCore.mjs +27 -4
  3. package/esm2020/lib/components/form/form.component.mjs +32 -24
  4. package/esm2020/lib/components/select/select.component.mjs +27 -15
  5. package/esm2020/lib/components/select-common/select-common.component.mjs +2 -2
  6. package/esm2020/lib/components/select-internal/select-internal.component.mjs +27 -15
  7. package/esm2020/lib/components/table/detailsDialog.component.mjs +23 -21
  8. package/esm2020/lib/components/table/table.component.mjs +24 -19
  9. package/esm2020/lib/components/table-action/table-action.component.mjs +2 -2
  10. package/esm2020/lib/components/table-header/table-header.component.mjs +2 -2
  11. package/esm2020/lib/components/table-internal/detailsDialog-internal.component.mjs +23 -21
  12. package/esm2020/lib/components/table-internal/table-internal.component.mjs +24 -19
  13. package/esm2020/lib/components/table-lite/detailsDialog-lite.component.mjs +20 -18
  14. package/esm2020/lib/components/table-lite/table-lite.component.mjs +24 -19
  15. package/esm2020/lib/components/table-row/table-row.component.mjs +3 -3
  16. package/esm2020/lib/pages/departments/departments.component.mjs +1 -3
  17. package/esm2020/lib/pages/employees/employees.component.mjs +1 -2
  18. package/esm2020/lib/pages/login/login.component.mjs +2 -1
  19. package/esm2020/lib/pages/positions/positions.component.mjs +2 -2
  20. package/esm2020/lib/services/button.service.mjs +27 -6
  21. package/esm2020/lib/services/datalib.service.mjs +63 -60
  22. package/fesm2015/tin-spa.mjs +251 -153
  23. package/fesm2015/tin-spa.mjs.map +1 -1
  24. package/fesm2020/tin-spa.mjs +245 -159
  25. package/fesm2020/tin-spa.mjs.map +1 -1
  26. package/lib/classes/Classes.d.ts +6 -0
  27. package/lib/classes/TinCore.d.ts +5 -3
  28. package/lib/components/form/form.component.d.ts +4 -1
  29. package/lib/components/select/select.component.d.ts +4 -1
  30. package/lib/components/select-internal/select-internal.component.d.ts +4 -1
  31. package/lib/components/table/detailsDialog.component.d.ts +3 -1
  32. package/lib/components/table/table.component.d.ts +4 -2
  33. package/lib/components/table-internal/detailsDialog-internal.component.d.ts +3 -1
  34. package/lib/components/table-internal/table-internal.component.d.ts +4 -2
  35. package/lib/components/table-lite/detailsDialog-lite.component.d.ts +3 -1
  36. package/lib/components/table-lite/table-lite.component.d.ts +4 -2
  37. package/lib/services/button.service.d.ts +4 -1
  38. package/lib/services/datalib.service.d.ts +8 -6
  39. package/package.json +1 -1
@@ -65,6 +65,10 @@ export declare class AlertMessage {
65
65
  content: string;
66
66
  hiddenCondition?: (value: any) => boolean;
67
67
  }
68
+ export declare class FormSecurity {
69
+ allow?: CapItem[];
70
+ deny?: CapItem[];
71
+ }
68
72
  export declare class FormConfig {
69
73
  title?: string;
70
74
  fixedTitle?: boolean;
@@ -77,6 +81,7 @@ export declare class FormConfig {
77
81
  loadAction?: Action;
78
82
  heroField?: any;
79
83
  heroValue?: any;
84
+ security?: FormSecurity;
80
85
  }
81
86
  export interface Button {
82
87
  name: string;
@@ -106,6 +111,7 @@ export declare class PageConfig {
106
111
  searchTableConfig?: TableConfig;
107
112
  }
108
113
  export interface Field {
114
+ security?: FormSecurity;
109
115
  name: string;
110
116
  type: 'text' | 'multi-text' | 'password' | 'date' | 'datetime' | 'datetimesec' | 'checkbox' | 'select' | 'multi-select' | 'money' | 'number' | 'section' | 'blank' | 'chip' | 'file' | 'file-view' | 'icon' | 'spinner' | 'button' | 'label' | 'email' | 'composite' | 'string';
111
117
  alias?: string;
@@ -1,13 +1,15 @@
1
- import { DetailsDialogConfig, Field, FormConfig } from "./Classes";
1
+ import { DetailsDialogConfig, Field, FormConfig, FormSecurity } from "./Classes";
2
2
  export declare class Core {
3
3
  static deepClone(obj: any): any;
4
4
  static deepClone2(obj: any): any;
5
5
  static camelToWords(value: string): string;
6
6
  static generateObject(fields: Field[]): {};
7
7
  static resetObject(fields: Field[], data: any): void;
8
- static testVisible(config: FormConfig, data: any, f: Field): boolean;
8
+ static checkSecurity(security: FormSecurity, currentRole: any): boolean;
9
+ static checkFormAccess(config: FormConfig, currentRole: any): boolean;
10
+ static testVisible(config: FormConfig, data: any, f: Field, currentRole: any): boolean;
9
11
  static testVisibleHeaderButton(data: any, btn: any): boolean;
10
- static getVisibleSubfields(config: FormConfig, data: any, field: Field): Field[];
12
+ static getVisibleSubfields(config: FormConfig, data: any, field: Field, currentRole: any): Field[];
11
13
  static validateObject(fields: Field[], data: any): string;
12
14
  static getInitialValue(field: Field): any;
13
15
  static getClone(x: any): any;
@@ -2,17 +2,20 @@ import { EventEmitter, OnInit, TemplateRef } from '@angular/core';
2
2
  import { FormConfig, Field, Button } from '../../classes/Classes';
3
3
  import { MessageService } from '../../services/message.service';
4
4
  import { DataServiceLib } from '../../services/datalib.service';
5
+ import { AuthService } from '../../services/auth.service';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class FormComponent implements OnInit {
7
8
  private messageService;
8
9
  private dataService;
9
- constructor(messageService: MessageService, dataService: DataServiceLib);
10
+ private authService;
11
+ constructor(messageService: MessageService, dataService: DataServiceLib, authService: AuthService);
10
12
  ngOnInit(): void;
11
13
  initializeCompositeFields(): void;
12
14
  getVisibleSubfields(field: Field): Field[];
13
15
  getVisibleFields(): Field[];
14
16
  testReadOnly(f: Field): boolean;
15
17
  dynamicSelectTemplate: TemplateRef<any>;
18
+ hasAccess: boolean;
16
19
  fileNames: any;
17
20
  fileField: Field;
18
21
  fileViewField: Field;
@@ -3,15 +3,18 @@ import { MessageService } from '../../services/message.service';
3
3
  import { DialogService } from '../../services/dialog.service';
4
4
  import { SelectCommonComponent } from '../select-common/select-common.component';
5
5
  import { DataServiceLib } from '../../services/datalib.service';
6
+ import { ButtonService } from '../../services/button.service';
6
7
  import * as i0 from "@angular/core";
7
8
  export declare class SelectComponent extends SelectCommonComponent {
8
9
  protected messageService: MessageService;
9
10
  protected dataService: DataServiceLib;
10
11
  private dialogService;
11
- constructor(messageService: MessageService, dataService: DataServiceLib, dialogService: DialogService);
12
+ private buttonService;
13
+ constructor(messageService: MessageService, dataService: DataServiceLib, dialogService: DialogService, buttonService: ButtonService);
12
14
  detailsConfig: DetailsDialogConfig;
13
15
  onHoverChange(isHovered: boolean): void;
14
16
  canCreate(): boolean;
17
+ canView(): boolean;
15
18
  onPeekClick(event: MouseEvent, mode: 'create' | 'view'): void;
16
19
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectComponent, never>;
17
20
  static ɵcmp: i0.ɵɵComponentDeclaration<SelectComponent, "spa-select", never, { "detailsConfig": "detailsConfig"; }, {}, never, never, false>;
@@ -3,15 +3,18 @@ import { MessageService } from '../../services/message.service';
3
3
  import { DialogService } from '../../services/dialog.service';
4
4
  import { SelectCommonComponent } from '../select-common/select-common.component';
5
5
  import { DataServiceLib } from '../../services/datalib.service';
6
+ import { ButtonService } from '../../services/button.service';
6
7
  import * as i0 from "@angular/core";
7
8
  export declare class SelectInternalComponent extends SelectCommonComponent {
8
9
  protected messageService: MessageService;
9
10
  protected dataService: DataServiceLib;
10
11
  private dialogService;
11
- constructor(messageService: MessageService, dataService: DataServiceLib, dialogService: DialogService);
12
+ private buttonService;
13
+ constructor(messageService: MessageService, dataService: DataServiceLib, dialogService: DialogService, buttonService: ButtonService);
12
14
  detailsConfig: DetailsDialogConfig;
13
15
  onHoverChange(isHovered: boolean): void;
14
16
  canCreate(): boolean;
17
+ canView(): boolean;
15
18
  onPeekClick(event: MouseEvent, mode: 'create' | 'view'): void;
16
19
  static ɵfac: i0.ɵɵFactoryDeclaration<SelectInternalComponent, never>;
17
20
  static ɵcmp: i0.ɵɵComponentDeclaration<SelectInternalComponent, "spa-select-internal", never, { "detailsConfig": "detailsConfig"; }, {}, never, never, false>;
@@ -8,6 +8,7 @@ import { BreakpointObserver } from '@angular/cdk/layout';
8
8
  import { Subject } from 'rxjs';
9
9
  import { ButtonService } from '../../services/button.service';
10
10
  import { DialogService } from '../../services/dialog.service';
11
+ import { AuthService } from '../../services/auth.service';
11
12
  import * as i0 from "@angular/core";
12
13
  export declare class DetailsDialog implements OnInit {
13
14
  private breakpointObserver;
@@ -18,7 +19,8 @@ export declare class DetailsDialog implements OnInit {
18
19
  detailsConfig: DetailsDialogConfig;
19
20
  private buttonService;
20
21
  private dialogService;
21
- constructor(breakpointObserver: BreakpointObserver, loaderService: LoaderService, dataService: DataServiceLib, messageService: MessageService, dialogRef: MatDialogRef<DetailsDialog>, detailsConfig: DetailsDialogConfig, buttonService: ButtonService, dialogService: DialogService);
22
+ private authService;
23
+ constructor(breakpointObserver: BreakpointObserver, loaderService: LoaderService, dataService: DataServiceLib, messageService: MessageService, dialogRef: MatDialogRef<DetailsDialog>, detailsConfig: DetailsDialogConfig, buttonService: ButtonService, dialogService: DialogService, authService: AuthService);
22
24
  ngOnInit(): void;
23
25
  titleAction: string;
24
26
  loadByAction: boolean;
@@ -10,6 +10,7 @@ import { ButtonService } from '../../services/button.service';
10
10
  import { DialogService } from '../../services/dialog.service';
11
11
  import { TableConfigService } from '../../services/table-config.service';
12
12
  import { ConditionService } from '../../services/condition.service';
13
+ import { AuthService } from '../../services/auth.service';
13
14
  import * as i0 from "@angular/core";
14
15
  export declare class TableComponent implements OnInit {
15
16
  private dataService;
@@ -20,7 +21,8 @@ export declare class TableComponent implements OnInit {
20
21
  private dialogService;
21
22
  private tableConfigService;
22
23
  private conditionService;
23
- constructor(dataService: DataServiceLib, messageService: MessageService, breakpointObserver: BreakpointObserver, dialog: MatDialog, buttonService: ButtonService, dialogService: DialogService, tableConfigService: TableConfigService, conditionService: ConditionService);
24
+ private authService;
25
+ constructor(dataService: DataServiceLib, messageService: MessageService, breakpointObserver: BreakpointObserver, dialog: MatDialog, buttonService: ButtonService, dialogService: DialogService, tableConfigService: TableConfigService, conditionService: ConditionService, authService: AuthService);
24
26
  ngOnInit(): void;
25
27
  ngOnChanges(): void;
26
28
  elevation: string;
@@ -28,6 +30,7 @@ export declare class TableComponent implements OnInit {
28
30
  showFilterButton: boolean;
29
31
  tileReload: Subject<boolean>;
30
32
  smallScreen: boolean;
33
+ hasFormAccess: boolean;
31
34
  tableDataSource: any;
32
35
  dataSource: any[];
33
36
  displayedColumns: any[];
@@ -62,7 +65,6 @@ export declare class TableComponent implements OnInit {
62
65
  testColorCondition(row: any, color: Color): boolean;
63
66
  showBanner(message: string): void;
64
67
  testDisabled(row: any, buttonName: string): boolean;
65
- testVisible(row: any, buttonName: string): boolean;
66
68
  lastSearch: any;
67
69
  searchClicked(x: any): void;
68
70
  tileClicked(tile: any): void;
@@ -8,6 +8,7 @@ import { BreakpointObserver } from '@angular/cdk/layout';
8
8
  import { DialogService } from '../../services/dialog.service';
9
9
  import { ButtonService } from '../../services/button.service';
10
10
  import { Subject } from 'rxjs';
11
+ import { AuthService } from '../../services/auth.service';
11
12
  import * as i0 from "@angular/core";
12
13
  export declare class DetailsDialogInternal implements OnInit {
13
14
  private breakpointObserver;
@@ -18,7 +19,8 @@ export declare class DetailsDialogInternal implements OnInit {
18
19
  detailsConfig: DetailsDialogConfig;
19
20
  private buttonService;
20
21
  private dialogService;
21
- constructor(breakpointObserver: BreakpointObserver, loaderService: LoaderService, dataService: DataServiceLib, messageService: MessageService, dialogRef: MatDialogRef<DetailsDialogInternal>, detailsConfig: DetailsDialogConfig, buttonService: ButtonService, dialogService: DialogService);
22
+ private authService;
23
+ constructor(breakpointObserver: BreakpointObserver, loaderService: LoaderService, dataService: DataServiceLib, messageService: MessageService, dialogRef: MatDialogRef<DetailsDialogInternal>, detailsConfig: DetailsDialogConfig, buttonService: ButtonService, dialogService: DialogService, authService: AuthService);
22
24
  ngOnInit(): void;
23
25
  titleAction: string;
24
26
  loadByAction: boolean;
@@ -10,6 +10,7 @@ import { ButtonService } from '../../services/button.service';
10
10
  import { DialogService } from '../../services/dialog.service';
11
11
  import { TableConfigService } from '../../services/table-config.service';
12
12
  import { ConditionService } from '../../services/condition.service';
13
+ import { AuthService } from '../../services/auth.service';
13
14
  import * as i0 from "@angular/core";
14
15
  export declare class TableInternalComponent implements OnInit {
15
16
  private dataService;
@@ -20,7 +21,8 @@ export declare class TableInternalComponent implements OnInit {
20
21
  private dialogService;
21
22
  private tableConfigService;
22
23
  private conditionService;
23
- constructor(dataService: DataServiceLib, messageService: MessageService, breakpointObserver: BreakpointObserver, dialog: MatDialog, buttonService: ButtonService, dialogService: DialogService, tableConfigService: TableConfigService, conditionService: ConditionService);
24
+ private authService;
25
+ constructor(dataService: DataServiceLib, messageService: MessageService, breakpointObserver: BreakpointObserver, dialog: MatDialog, buttonService: ButtonService, dialogService: DialogService, tableConfigService: TableConfigService, conditionService: ConditionService, authService: AuthService);
24
26
  ngOnInit(): void;
25
27
  ngOnChanges(): void;
26
28
  elevation: string;
@@ -28,6 +30,7 @@ export declare class TableInternalComponent implements OnInit {
28
30
  showFilterButton: boolean;
29
31
  tileReload: Subject<boolean>;
30
32
  smallScreen: boolean;
33
+ hasFormAccess: boolean;
31
34
  tableDataSource: any;
32
35
  dataSource: any[];
33
36
  displayedColumns: any[];
@@ -62,7 +65,6 @@ export declare class TableInternalComponent implements OnInit {
62
65
  testColorCondition(row: any, color: Color): boolean;
63
66
  showBanner(message: string): void;
64
67
  testDisabled(row: any, buttonName: string): boolean;
65
- testVisible(row: any, buttonName: string): boolean;
66
68
  lastSearch: any;
67
69
  searchClicked(x: any): void;
68
70
  tileClicked(tile: any): void;
@@ -8,6 +8,7 @@ import { BreakpointObserver } from '@angular/cdk/layout';
8
8
  import { DialogService } from '../../services/dialog.service';
9
9
  import { ButtonService } from '../../services/button.service';
10
10
  import { Subject } from 'rxjs';
11
+ import { AuthService } from '../../services/auth.service';
11
12
  import * as i0 from "@angular/core";
12
13
  export declare class DetailsDialogLite implements OnInit {
13
14
  private breakpointObserver;
@@ -18,7 +19,8 @@ export declare class DetailsDialogLite implements OnInit {
18
19
  detailsConfig: DetailsDialogConfig;
19
20
  private buttonService;
20
21
  private dialogService;
21
- constructor(breakpointObserver: BreakpointObserver, loaderService: LoaderService, dataService: DataServiceLib, messageService: MessageService, dialogRef: MatDialogRef<DetailsDialogLite>, detailsConfig: DetailsDialogConfig, buttonService: ButtonService, dialogService: DialogService);
22
+ private authService;
23
+ constructor(breakpointObserver: BreakpointObserver, loaderService: LoaderService, dataService: DataServiceLib, messageService: MessageService, dialogRef: MatDialogRef<DetailsDialogLite>, detailsConfig: DetailsDialogConfig, buttonService: ButtonService, dialogService: DialogService, authService: AuthService);
22
24
  ngOnInit(): void;
23
25
  titleAction: string;
24
26
  loadByAction: boolean;
@@ -10,6 +10,7 @@ import { ButtonService } from '../../services/button.service';
10
10
  import { DialogService } from '../../services/dialog.service';
11
11
  import { TableConfigService } from '../../services/table-config.service';
12
12
  import { ConditionService } from '../../services/condition.service';
13
+ import { AuthService } from '../../services/auth.service';
13
14
  import * as i0 from "@angular/core";
14
15
  export declare class TableLiteComponent implements OnInit {
15
16
  private dataService;
@@ -20,7 +21,8 @@ export declare class TableLiteComponent implements OnInit {
20
21
  private dialogService;
21
22
  private tableConfigService;
22
23
  private conditionService;
23
- constructor(dataService: DataServiceLib, messageService: MessageService, breakpointObserver: BreakpointObserver, dialog: MatDialog, buttonService: ButtonService, dialogService: DialogService, tableConfigService: TableConfigService, conditionService: ConditionService);
24
+ private authService;
25
+ constructor(dataService: DataServiceLib, messageService: MessageService, breakpointObserver: BreakpointObserver, dialog: MatDialog, buttonService: ButtonService, dialogService: DialogService, tableConfigService: TableConfigService, conditionService: ConditionService, authService: AuthService);
24
26
  ngOnInit(): void;
25
27
  ngOnChanges(): void;
26
28
  elevation: string;
@@ -28,6 +30,7 @@ export declare class TableLiteComponent implements OnInit {
28
30
  showFilterButton: boolean;
29
31
  tileReload: Subject<boolean>;
30
32
  smallScreen: boolean;
33
+ hasFormAccess: boolean;
31
34
  tableDataSource: any;
32
35
  dataSource: any[];
33
36
  displayedColumns: any[];
@@ -62,7 +65,6 @@ export declare class TableLiteComponent implements OnInit {
62
65
  testColorCondition(row: any, color: Color): boolean;
63
66
  showBanner(message: string): void;
64
67
  testDisabled(row: any, buttonName: string): boolean;
65
- testVisible(row: any, buttonName: string): boolean;
66
68
  lastSearch: any;
67
69
  searchClicked(x: any): void;
68
70
  tileClicked(tile: any): void;
@@ -1,6 +1,9 @@
1
1
  import { Button, TableConfig } from '../classes/Classes';
2
+ import { AuthService } from './auth.service';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class ButtonService {
5
+ private authService;
6
+ constructor(authService: AuthService);
4
7
  getButton(buttons: Button[], name: string): Button | null;
5
8
  getButtonProperties(button: Button, row: any, config: TableConfig): {
6
9
  color: string;
@@ -15,7 +18,7 @@ export declare class ButtonService {
15
18
  isTabVisible(tableConfig: TableConfig): boolean;
16
19
  getIcon(button: Button, config: TableConfig): string;
17
20
  testDisabled(button: Button, row: any): boolean;
18
- testVisible(button: Button, row: any): boolean;
21
+ testVisible(button: Button, row: any, config?: TableConfig): boolean;
19
22
  private getDefaultColor;
20
23
  private getDefaultIcon;
21
24
  getCreateButton(buttons: Button[]): Button | undefined;
@@ -38,23 +38,24 @@ export declare class DataServiceLib {
38
38
  capApprovalsConfig: CapItem;
39
39
  tmpProfileuserName: string;
40
40
  isProcessing: boolean;
41
- loadEmployeesMeta(): void;
41
+ departmentFormConfig: FormConfig;
42
+ editDepartmentButton: Button;
43
+ departmentDetailsConfig: DetailsDialogConfig;
44
+ positionFormConfig: FormConfig;
45
+ editPositionButton: Button;
46
+ positionDetailsConfig: DetailsDialogConfig;
42
47
  genders: {
43
48
  name: string;
44
49
  value: number;
45
50
  }[];
46
51
  employeeFormConfig: FormConfig;
47
52
  employeeTableConfig: TableConfig;
48
- loadPositionMeta(): void;
49
- positionFormConfig: FormConfig;
50
- editPositionButton: Button;
51
53
  positionsTableConfig: TableConfig;
52
- departmentFormConfig: FormConfig;
53
- editDepartmentButton: Button;
54
54
  departmentTableConfig: TableConfig;
55
55
  contactPersonFormConfig: FormConfig;
56
56
  contactPersonTableConfig: TableConfig;
57
57
  customerFormConfig: FormConfig;
58
+ customerEditButton: Button;
58
59
  customerDetailsConfig: DetailsDialogConfig;
59
60
  customersTableConfig: TableConfig;
60
61
  supplierFormConfig: FormConfig;
@@ -66,6 +67,7 @@ export declare class DataServiceLib {
66
67
  CallApi(action: Action, data?: any): Observable<any>;
67
68
  private handleListCall;
68
69
  invalidateListCache(entityUrl: string): void;
70
+ ClearCache(): void;
69
71
  CheckWelcomed(path?: string): void;
70
72
  Navigate(path: string): void;
71
73
  NavigateWithValue(path: string, value: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tin-spa",
3
- "version": "2.6.13",
3
+ "version": "2.6.14",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^14.2.0",
6
6
  "@angular/core": "^14.2.0"