tin-spa 2.1.0 → 2.1.2

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 (29) hide show
  1. package/esm2020/lib/classes/Classes.mjs +1 -1
  2. package/esm2020/lib/classes/TinCore.mjs +80 -1
  3. package/esm2020/lib/components/date/date.component.mjs +35 -17
  4. package/esm2020/lib/components/form/form.component.mjs +88 -44
  5. package/esm2020/lib/components/money/money.component.mjs +60 -16
  6. package/esm2020/lib/components/number/number.component.mjs +22 -6
  7. package/esm2020/lib/components/roles/roles.component.mjs +3 -3
  8. package/esm2020/lib/components/table/detailsDialog.component.mjs +20 -32
  9. package/esm2020/lib/components/table/table.component.mjs +21 -12
  10. package/esm2020/lib/components/text/text.component.mjs +7 -4
  11. package/esm2020/lib/modules/spa-admin.module.mjs +5 -7
  12. package/esm2020/lib/modules/spa-index.module.mjs +5 -7
  13. package/esm2020/lib/modules/spa-user.module.mjs +5 -7
  14. package/fesm2015/tin-spa.mjs +325 -134
  15. package/fesm2015/tin-spa.mjs.map +1 -1
  16. package/fesm2020/tin-spa.mjs +324 -134
  17. package/fesm2020/tin-spa.mjs.map +1 -1
  18. package/lib/classes/Classes.d.ts +14 -2
  19. package/lib/classes/TinCore.d.ts +6 -0
  20. package/lib/components/date/date.component.d.ts +9 -5
  21. package/lib/components/form/form.component.d.ts +16 -9
  22. package/lib/components/money/money.component.d.ts +15 -7
  23. package/lib/components/number/number.component.d.ts +3 -1
  24. package/lib/components/table/detailsDialog.component.d.ts +0 -2
  25. package/lib/components/text/text.component.d.ts +1 -1
  26. package/lib/modules/spa-admin.module.d.ts +1 -1
  27. package/lib/modules/spa-index.module.d.ts +1 -1
  28. package/lib/modules/spa-user.module.d.ts +1 -1
  29. package/package.json +1 -1
@@ -8,6 +8,8 @@ export declare class FormConfig {
8
8
  fields: Field[];
9
9
  mode?: string;
10
10
  button?: Button;
11
+ multiColumn?: boolean;
12
+ reset?: boolean;
11
13
  }
12
14
  export interface Button {
13
15
  name: 'create' | 'view' | 'edit' | 'delete' | 'custom1' | 'custom2' | 'custom3';
@@ -19,16 +21,26 @@ export interface Button {
19
21
  tip?: string;
20
22
  dialog?: boolean;
21
23
  action?: Action;
24
+ confirm?: Confirm;
25
+ }
26
+ export interface Confirm {
27
+ message: string;
22
28
  }
23
29
  export interface Condition {
24
30
  condition?: (value: any) => boolean;
25
31
  }
26
32
  export interface Field {
27
33
  name: string;
28
- type: 'text' | 'date' | 'checkbox' | 'select' | 'money' | 'number';
34
+ type: 'text' | 'date' | 'checkbox' | 'select' | 'multi-select' | 'money' | 'number' | 'section' | 'blank';
29
35
  options?: any[];
30
36
  optionDisplay?: string;
31
37
  optionValue?: string;
38
+ defaultValue?: any;
39
+ required?: boolean;
40
+ min?: any;
41
+ max?: any;
42
+ rows?: number;
43
+ span?: boolean;
32
44
  }
33
45
  export declare class TableConfig {
34
46
  columns?: Column[];
@@ -40,7 +52,7 @@ export declare class TableConfig {
40
52
  }
41
53
  export interface Column {
42
54
  name: string;
43
- type?: 'text' | 'date' | 'checkbox' | 'select' | 'money' | 'number';
55
+ type?: 'text' | 'date' | 'checkbox' | 'select' | 'multi-select' | 'money' | 'number';
44
56
  alias?: string;
45
57
  icon?: Icon;
46
58
  }
@@ -1,4 +1,10 @@
1
+ import { Field } from "./Classes";
1
2
  export declare class Core {
3
+ static camelToWords(value: string): string;
4
+ static generateObject(fields: Field[]): {};
5
+ static resetObject(fields: Field[], data: any): void;
6
+ static validateObject(fields: Field[], data: any): string;
7
+ private static getInitialValue;
2
8
  static getClone(x: any): any;
3
9
  static getNumber(value: string): string | 0;
4
10
  static getFirstDayOfMonth(): Date;
@@ -5,17 +5,21 @@ export declare class DateComponent implements OnInit {
5
5
  constructor();
6
6
  ngOnInit(): void;
7
7
  ngOnChanges(): void;
8
- date: FormControl<Date>;
8
+ required: boolean;
9
+ min: string;
10
+ max: string;
9
11
  minDate: any;
10
12
  maxDate: any;
13
+ readonly: boolean;
14
+ hint: string;
11
15
  value: string;
12
16
  display: string;
13
- readonly: boolean;
17
+ placeholder: string;
14
18
  width: string;
15
- min: string;
16
- max: string;
17
19
  valueChange: EventEmitter<any>;
18
20
  onChangeEvent(): void;
21
+ control: FormControl<Date>;
22
+ validate(control: FormControl): string;
19
23
  static ɵfac: i0.ɵɵFactoryDeclaration<DateComponent, never>;
20
- static ɵcmp: i0.ɵɵComponentDeclaration<DateComponent, "spa-date", never, { "value": "value"; "display": "display"; "readonly": "readonly"; "width": "width"; "min": "min"; "max": "max"; }, { "valueChange": "valueChange"; }, never, never, false>;
24
+ static ɵcmp: i0.ɵɵComponentDeclaration<DateComponent, "spa-date", never, { "required": "required"; "min": "min"; "max": "max"; "readonly": "readonly"; "hint": "hint"; "value": "value"; "display": "display"; "placeholder": "placeholder"; "width": "width"; }, { "valueChange": "valueChange"; }, never, never, false>;
21
25
  }
@@ -1,16 +1,23 @@
1
- import { OnInit } from '@angular/core';
2
- import { FormConfig, Field } from '../../classes/Classes';
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
+ import { FormConfig, Field, Button } from '../../classes/Classes';
3
+ import { MessageService } from '../../services/message.service';
4
+ import { DataServiceLib } from '../../services/data.service';
3
5
  import * as i0 from "@angular/core";
4
6
  export declare class FormComponent implements OnInit {
7
+ private messageService;
8
+ private dataService;
9
+ constructor(messageService: MessageService, dataService: DataServiceLib);
10
+ ngOnInit(): void;
11
+ ngOnChanges(): void;
5
12
  fields: Field[];
13
+ buttonDisplay: string;
14
+ isProcessing: boolean;
15
+ multiColumn: boolean;
6
16
  data: any;
7
17
  config: FormConfig;
8
- constructor();
9
- ngOnInit(): void;
10
- ngOnChanges(): void;
11
- generateObject(): void;
12
- private getInitialValue;
13
- createClicked(): void;
18
+ buttonClick: EventEmitter<any>;
19
+ buttonClicked(): void;
20
+ processCall(button: Button): void;
14
21
  static ɵfac: i0.ɵɵFactoryDeclaration<FormComponent, never>;
15
- static ɵcmp: i0.ɵɵComponentDeclaration<FormComponent, "spa-form", never, { "data": "data"; "config": "config"; }, {}, never, never, false>;
22
+ static ɵcmp: i0.ɵɵComponentDeclaration<FormComponent, "spa-form", never, { "data": "data"; "config": "config"; }, { "buttonClick": "buttonClick"; }, never, never, false>;
16
23
  }
@@ -1,22 +1,30 @@
1
1
  import { EventEmitter, OnInit } from '@angular/core';
2
+ import { FormControl } from '@angular/forms';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class MoneyComponent implements OnInit {
4
5
  constructor();
5
6
  ngOnInit(): void;
6
7
  ngOnChanges(): void;
8
+ ngAfterViewInit(): void;
9
+ initControl(control: FormControl): void;
7
10
  readonly: boolean;
11
+ hint: string;
8
12
  display: string;
9
- value: string;
10
13
  placeholder: string;
11
- valueChange: EventEmitter<any>;
12
- enterPress: EventEmitter<any>;
13
- leave: EventEmitter<any>;
14
+ value: string;
14
15
  width: string;
15
- hint: string;
16
16
  currency: string;
17
+ valueChange: EventEmitter<any>;
18
+ leave: EventEmitter<any>;
19
+ enterPress: EventEmitter<any>;
20
+ required: boolean;
21
+ min: number;
22
+ max: number;
17
23
  changed(x: any): void;
18
- enterPressed(): void;
19
24
  leaved(): void;
25
+ enterPressed(): void;
26
+ control: FormControl<string>;
27
+ validate(control: FormControl): string;
20
28
  static ɵfac: i0.ɵɵFactoryDeclaration<MoneyComponent, never>;
21
- static ɵcmp: i0.ɵɵComponentDeclaration<MoneyComponent, "spa-money", never, { "readonly": "readonly"; "display": "display"; "value": "value"; "placeholder": "placeholder"; "width": "width"; "hint": "hint"; "currency": "currency"; }, { "valueChange": "valueChange"; "enterPress": "enterPress"; "leave": "leave"; }, never, never, false>;
29
+ static ɵcmp: i0.ɵɵComponentDeclaration<MoneyComponent, "spa-money", never, { "readonly": "readonly"; "hint": "hint"; "display": "display"; "placeholder": "placeholder"; "value": "value"; "width": "width"; "currency": "currency"; "required": "required"; "min": "min"; "max": "max"; }, { "valueChange": "valueChange"; "leave": "leave"; "enterPress": "enterPress"; }, never, never, false>;
22
30
  }
@@ -4,6 +4,8 @@ import * as i0 from "@angular/core";
4
4
  export declare class NumberComponent implements OnInit {
5
5
  constructor();
6
6
  ngOnInit(): void;
7
+ ngAfterViewInit(): void;
8
+ initControl(control: FormControl): void;
7
9
  hideRequiredControl: FormControl<boolean>;
8
10
  hide: boolean;
9
11
  readonly: boolean;
@@ -11,10 +13,10 @@ export declare class NumberComponent implements OnInit {
11
13
  display: string;
12
14
  placeholder: string;
13
15
  value: number;
16
+ width: string;
14
17
  valueChange: EventEmitter<any>;
15
18
  leave: EventEmitter<any>;
16
19
  enterPress: EventEmitter<any>;
17
- width: string;
18
20
  required: boolean;
19
21
  min: number;
20
22
  max: number;
@@ -17,9 +17,7 @@ export declare class detailsDialog implements OnInit {
17
17
  smallScreen: boolean;
18
18
  isLoadComplete: boolean;
19
19
  isProcessing: boolean;
20
- generateObject(): {};
21
20
  setMode(newMode: string): void;
22
- private getInitialValue;
23
21
  create(): void;
24
22
  edit(): void;
25
23
  delete(): void;
@@ -20,7 +20,7 @@ export declare class TextComponent implements OnInit {
20
20
  type: string;
21
21
  leave: EventEmitter<any>;
22
22
  enterPress: EventEmitter<any>;
23
- rows: string;
23
+ rows: number;
24
24
  width: string;
25
25
  options: any;
26
26
  optionValue: string;
@@ -10,6 +10,6 @@ import * as i8 from "@angular/common";
10
10
  import * as i9 from "../tin-spa.module";
11
11
  export declare class SpaAdminModule {
12
12
  static ɵfac: i0.ɵɵFactoryDeclaration<SpaAdminModule, never>;
13
- static ɵmod: i0.ɵɵNgModuleDeclaration<SpaAdminModule, [typeof i1.UsersComponent, typeof i2.RolesComponent, typeof i3.addRoleDialog, typeof i4.CreateAccountComponent, typeof i5.LogsComponent, typeof i6.SettingsComponent], [typeof i7.ReactiveFormsModule, typeof i8.CommonModule, typeof i7.FormsModule, typeof i7.ReactiveFormsModule, typeof i9.TinSpaModule], [typeof i8.CommonModule, typeof i7.FormsModule, typeof i1.UsersComponent, typeof i2.RolesComponent, typeof i3.addRoleDialog, typeof i4.CreateAccountComponent, typeof i5.LogsComponent, typeof i6.SettingsComponent]>;
13
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SpaAdminModule, [typeof i1.UsersComponent, typeof i2.RolesComponent, typeof i3.addRoleDialog, typeof i4.CreateAccountComponent, typeof i5.LogsComponent, typeof i6.SettingsComponent], [typeof i7.ReactiveFormsModule, typeof i8.CommonModule, typeof i7.FormsModule, typeof i7.ReactiveFormsModule, typeof i9.TinSpaModule], [typeof i8.CommonModule, typeof i7.FormsModule, typeof i9.TinSpaModule, typeof i1.UsersComponent, typeof i2.RolesComponent, typeof i3.addRoleDialog, typeof i4.CreateAccountComponent, typeof i5.LogsComponent, typeof i6.SettingsComponent]>;
14
14
  static ɵinj: i0.ɵɵInjectorDeclaration<SpaAdminModule>;
15
15
  }
@@ -7,6 +7,6 @@ import * as i5 from "@angular/common";
7
7
  import * as i6 from "../tin-spa.module";
8
8
  export declare class SpaIndexModule {
9
9
  static ɵfac: i0.ɵɵFactoryDeclaration<SpaIndexModule, never>;
10
- static ɵmod: i0.ɵɵNgModuleDeclaration<SpaIndexModule, [typeof i1.LoginComponent, typeof i2.SignupComponent, typeof i3.RecoverAccountComponent], [typeof i4.ReactiveFormsModule, typeof i5.CommonModule, typeof i4.FormsModule, typeof i4.ReactiveFormsModule, typeof i6.TinSpaModule], [typeof i5.CommonModule, typeof i4.FormsModule, typeof i1.LoginComponent, typeof i2.SignupComponent, typeof i3.RecoverAccountComponent]>;
10
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SpaIndexModule, [typeof i1.LoginComponent, typeof i2.SignupComponent, typeof i3.RecoverAccountComponent], [typeof i4.ReactiveFormsModule, typeof i5.CommonModule, typeof i4.FormsModule, typeof i4.ReactiveFormsModule, typeof i6.TinSpaModule], [typeof i5.CommonModule, typeof i4.FormsModule, typeof i6.TinSpaModule, typeof i1.LoginComponent, typeof i2.SignupComponent, typeof i3.RecoverAccountComponent]>;
11
11
  static ɵinj: i0.ɵɵInjectorDeclaration<SpaIndexModule>;
12
12
  }
@@ -6,6 +6,6 @@ import * as i4 from "@angular/common";
6
6
  import * as i5 from "../tin-spa.module";
7
7
  export declare class SpaUserModule {
8
8
  static ɵfac: i0.ɵɵFactoryDeclaration<SpaUserModule, never>;
9
- static ɵmod: i0.ɵɵNgModuleDeclaration<SpaUserModule, [typeof i1.ChangePasswordComponent, typeof i2.ProfileComponent], [typeof i3.ReactiveFormsModule, typeof i4.CommonModule, typeof i3.FormsModule, typeof i3.ReactiveFormsModule, typeof i5.TinSpaModule], [typeof i4.CommonModule, typeof i3.FormsModule, typeof i1.ChangePasswordComponent, typeof i2.ProfileComponent]>;
9
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SpaUserModule, [typeof i1.ChangePasswordComponent, typeof i2.ProfileComponent], [typeof i3.ReactiveFormsModule, typeof i4.CommonModule, typeof i3.FormsModule, typeof i3.ReactiveFormsModule, typeof i5.TinSpaModule], [typeof i4.CommonModule, typeof i3.FormsModule, typeof i5.TinSpaModule, typeof i1.ChangePasswordComponent, typeof i2.ProfileComponent]>;
10
10
  static ɵinj: i0.ɵɵInjectorDeclaration<SpaUserModule>;
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tin-spa",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^14.2.0",
6
6
  "@angular/core": "^14.2.0"