appproject-components 1.0.45 → 1.0.47

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 (153) hide show
  1. package/karma.conf.js +44 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +15 -26
  4. package/src/lib/appproject-components.component.spec.ts +23 -0
  5. package/src/lib/appproject-components.component.ts +20 -0
  6. package/src/lib/appproject-components.module.ts +106 -0
  7. package/src/lib/appproject-components.service.spec.ts +16 -0
  8. package/src/lib/appproject-components.service.ts +9 -0
  9. package/src/lib/baseComponent.scss +162 -0
  10. package/src/lib/baseInputComponent.ts +35 -0
  11. package/src/lib/buttons/baseBtnComponent.ts +38 -0
  12. package/src/lib/buttons/btn-action/btn-action.component.html +11 -0
  13. package/src/lib/buttons/btn-action/btn-action.component.scss +7 -0
  14. package/src/lib/buttons/btn-action/btn-action.component.spec.ts +24 -0
  15. package/src/lib/buttons/btn-action/btn-action.component.ts +31 -0
  16. package/src/lib/buttons/btn-cancelar/btn-cancelar.component.html +14 -0
  17. package/src/lib/buttons/btn-cancelar/btn-cancelar.component.scss +5 -0
  18. package/src/lib/buttons/btn-cancelar/btn-cancelar.component.spec.ts +24 -0
  19. package/src/lib/buttons/btn-cancelar/btn-cancelar.component.ts +19 -0
  20. package/src/lib/buttons/btn-excluir/btn-excluir.component.html +6 -0
  21. package/src/lib/buttons/btn-excluir/btn-excluir.component.scss +5 -0
  22. package/src/lib/buttons/btn-excluir/btn-excluir.component.spec.ts +24 -0
  23. package/src/lib/buttons/btn-excluir/btn-excluir.component.ts +18 -0
  24. package/src/lib/buttons/btn-novo/btn-novo.component.html +14 -0
  25. package/src/lib/buttons/btn-novo/btn-novo.component.scss +8 -0
  26. package/src/lib/buttons/btn-novo/btn-novo.component.spec.ts +24 -0
  27. package/src/lib/buttons/btn-novo/btn-novo.component.ts +20 -0
  28. package/src/lib/buttons/btn-salvar/btn-salvar.component.html +8 -0
  29. package/src/lib/buttons/btn-salvar/btn-salvar.component.scss +5 -0
  30. package/src/lib/buttons/btn-salvar/btn-salvar.component.spec.ts +24 -0
  31. package/src/lib/buttons/btn-salvar/btn-salvar.component.ts +16 -0
  32. package/src/lib/entity-edit/entity-edit.component.html +143 -0
  33. package/src/lib/entity-edit/entity-edit.component.scss +4 -0
  34. package/src/lib/entity-edit/entity-edit.component.spec.ts +23 -0
  35. package/src/lib/entity-edit/entity-edit.component.ts +43 -0
  36. package/src/lib/grid-view/grid-view.component.html +116 -0
  37. package/src/lib/grid-view/grid-view.component.scss +47 -0
  38. package/src/lib/grid-view/grid-view.component.spec.ts +23 -0
  39. package/src/lib/grid-view/grid-view.component.ts +292 -0
  40. package/src/lib/input-area/input-area.component.html +30 -0
  41. package/src/lib/input-area/input-area.component.scss +68 -0
  42. package/src/lib/input-area/input-area.component.spec.ts +23 -0
  43. package/src/lib/input-area/input-area.component.ts +69 -0
  44. package/src/lib/input-arquivo/input-arquivo.component.html +11 -0
  45. package/src/lib/input-arquivo/input-arquivo.component.scss +0 -0
  46. package/src/lib/input-arquivo/input-arquivo.component.spec.ts +23 -0
  47. package/src/lib/input-arquivo/input-arquivo.component.ts +140 -0
  48. package/src/lib/input-cep/input-cep.component.html +38 -0
  49. package/src/lib/input-cep/input-cep.component.scss +0 -0
  50. package/src/lib/input-cep/input-cep.component.spec.ts +23 -0
  51. package/src/lib/input-cep/input-cep.component.ts +186 -0
  52. package/src/lib/input-checkbox/input-checkbox.component.html +12 -0
  53. package/src/lib/input-checkbox/input-checkbox.component.scss +11 -0
  54. package/src/lib/input-checkbox/input-checkbox.component.spec.ts +23 -0
  55. package/src/lib/input-checkbox/input-checkbox.component.ts +48 -0
  56. package/src/lib/input-format/input-format.component.html +32 -0
  57. package/src/lib/input-format/input-format.component.scss +47 -0
  58. package/src/lib/input-format/input-format.component.spec.ts +23 -0
  59. package/src/lib/input-format/input-format.component.ts +139 -0
  60. package/src/lib/input-pesquisa/input-pesquisa.component.html +77 -0
  61. package/src/lib/input-pesquisa/input-pesquisa.component.scss +127 -0
  62. package/src/lib/input-pesquisa/input-pesquisa.component.spec.ts +23 -0
  63. package/src/lib/input-pesquisa/input-pesquisa.component.ts +558 -0
  64. package/src/lib/input-radio/input-radio.component.html +21 -0
  65. package/src/lib/input-radio/input-radio.component.scss +3 -0
  66. package/src/lib/input-radio/input-radio.component.spec.ts +23 -0
  67. package/src/lib/input-radio/input-radio.component.ts +49 -0
  68. package/src/lib/input-select/input-select.component.html +29 -0
  69. package/src/lib/input-select/input-select.component.scss +62 -0
  70. package/src/lib/input-select/input-select.component.spec.ts +23 -0
  71. package/src/lib/input-select/input-select.component.ts +96 -0
  72. package/src/lib/input-text/input-text.component.html +48 -0
  73. package/src/lib/input-text/input-text.component.scss +63 -0
  74. package/src/lib/input-text/input-text.component.spec.ts +23 -0
  75. package/src/lib/input-text/input-text.component.ts +78 -0
  76. package/src/lib/input-valor/input-valor.component.html +32 -0
  77. package/src/lib/input-valor/input-valor.component.scss +47 -0
  78. package/src/lib/input-valor/input-valor.component.spec.ts +23 -0
  79. package/src/lib/input-valor/input-valor.component.ts +164 -0
  80. package/{lib/lib-config.d.ts → src/lib/lib-config.ts} +4 -3
  81. package/src/lib/model-treeview/model-treeview.component.html +20 -0
  82. package/src/lib/model-treeview/model-treeview.component.scss +0 -0
  83. package/src/lib/model-treeview/model-treeview.component.spec.ts +23 -0
  84. package/src/lib/model-treeview/model-treeview.component.ts +152 -0
  85. package/src/lib/tree-view/tree-view.component.html +96 -0
  86. package/src/lib/tree-view/tree-view.component.scss +50 -0
  87. package/src/lib/tree-view/tree-view.component.spec.ts +23 -0
  88. package/src/lib/tree-view/tree-view.component.ts +92 -0
  89. package/src/lib/tree-view-nivel/tree-view-nivel.component.html +17 -0
  90. package/src/lib/tree-view-nivel/tree-view-nivel.component.scss +8 -0
  91. package/src/lib/tree-view-nivel/tree-view-nivel.component.spec.ts +23 -0
  92. package/src/lib/tree-view-nivel/tree-view-nivel.component.ts +43 -0
  93. package/{public-api.d.ts → src/public-api.ts} +30 -24
  94. package/src/test.ts +15 -0
  95. package/tsconfig.lib.json +15 -0
  96. package/tsconfig.lib.prod.json +10 -0
  97. package/tsconfig.spec.json +17 -0
  98. package/esm2022/appproject-components.mjs +0 -5
  99. package/esm2022/lib/appproject-components.component.mjs +0 -22
  100. package/esm2022/lib/appproject-components.module.mjs +0 -159
  101. package/esm2022/lib/appproject-components.service.mjs +0 -14
  102. package/esm2022/lib/baseInputComponent.mjs +0 -69
  103. package/esm2022/lib/buttons/baseBtnComponent.mjs +0 -63
  104. package/esm2022/lib/buttons/btn-action/btn-action.component.mjs +0 -55
  105. package/esm2022/lib/buttons/btn-cancelar/btn-cancelar.component.mjs +0 -25
  106. package/esm2022/lib/buttons/btn-excluir/btn-excluir.component.mjs +0 -29
  107. package/esm2022/lib/buttons/btn-novo/btn-novo.component.mjs +0 -33
  108. package/esm2022/lib/buttons/btn-salvar/btn-salvar.component.mjs +0 -19
  109. package/esm2022/lib/entity-edit/entity-edit.component.mjs +0 -53
  110. package/esm2022/lib/grid-view/grid-view.component.mjs +0 -275
  111. package/esm2022/lib/input-area/input-area.component.mjs +0 -72
  112. package/esm2022/lib/input-arquivo/input-arquivo.component.mjs +0 -154
  113. package/esm2022/lib/input-cep/input-cep.component.mjs +0 -180
  114. package/esm2022/lib/input-checkbox/input-checkbox.component.mjs +0 -51
  115. package/esm2022/lib/input-format/input-format.component.mjs +0 -138
  116. package/esm2022/lib/input-pesquisa/input-pesquisa.component.mjs +0 -557
  117. package/esm2022/lib/input-radio/input-radio.component.mjs +0 -58
  118. package/esm2022/lib/input-select/input-select.component.mjs +0 -110
  119. package/esm2022/lib/input-text/input-text.component.mjs +0 -88
  120. package/esm2022/lib/input-valor/input-valor.component.mjs +0 -161
  121. package/esm2022/lib/lib-config.mjs +0 -2
  122. package/esm2022/lib/model-treeview/model-treeview.component.mjs +0 -126
  123. package/esm2022/lib/tree-view/tree-view.component.mjs +0 -104
  124. package/esm2022/lib/tree-view-nivel/tree-view-nivel.component.mjs +0 -50
  125. package/esm2022/public-api.mjs +0 -30
  126. package/fesm2022/appproject-components.mjs +0 -2531
  127. package/fesm2022/appproject-components.mjs.map +0 -1
  128. package/index.d.ts +0 -5
  129. package/lib/appproject-components.component.d.ts +0 -8
  130. package/lib/appproject-components.module.d.ts +0 -36
  131. package/lib/appproject-components.service.d.ts +0 -6
  132. package/lib/baseInputComponent.d.ts +0 -28
  133. package/lib/buttons/baseBtnComponent.d.ts +0 -19
  134. package/lib/buttons/btn-action/btn-action.component.d.ts +0 -21
  135. package/lib/buttons/btn-cancelar/btn-cancelar.component.d.ts +0 -10
  136. package/lib/buttons/btn-excluir/btn-excluir.component.d.ts +0 -12
  137. package/lib/buttons/btn-novo/btn-novo.component.d.ts +0 -13
  138. package/lib/buttons/btn-salvar/btn-salvar.component.d.ts +0 -9
  139. package/lib/entity-edit/entity-edit.component.d.ts +0 -22
  140. package/lib/grid-view/grid-view.component.d.ts +0 -52
  141. package/lib/input-area/input-area.component.d.ts +0 -24
  142. package/lib/input-arquivo/input-arquivo.component.d.ts +0 -43
  143. package/lib/input-cep/input-cep.component.d.ts +0 -29
  144. package/lib/input-checkbox/input-checkbox.component.d.ts +0 -21
  145. package/lib/input-format/input-format.component.d.ts +0 -27
  146. package/lib/input-pesquisa/input-pesquisa.component.d.ts +0 -69
  147. package/lib/input-radio/input-radio.component.d.ts +0 -23
  148. package/lib/input-select/input-select.component.d.ts +0 -32
  149. package/lib/input-text/input-text.component.d.ts +0 -33
  150. package/lib/input-valor/input-valor.component.d.ts +0 -29
  151. package/lib/model-treeview/model-treeview.component.d.ts +0 -39
  152. package/lib/tree-view/tree-view.component.d.ts +0 -23
  153. package/lib/tree-view-nivel/tree-view-nivel.component.d.ts +0 -17
@@ -0,0 +1,24 @@
1
+ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
2
+ import { IonicModule } from '@ionic/angular';
3
+
4
+ import { BtnExcluirComponent } from './btn-excluir.component';
5
+
6
+ describe('BtnExcluirComponent', () => {
7
+ let component: BtnExcluirComponent;
8
+ let fixture: ComponentFixture<BtnExcluirComponent>;
9
+
10
+ beforeEach(waitForAsync(() => {
11
+ TestBed.configureTestingModule({
12
+ declarations: [ BtnExcluirComponent ],
13
+ imports: [IonicModule.forRoot()]
14
+ }).compileComponents();
15
+
16
+ fixture = TestBed.createComponent(BtnExcluirComponent);
17
+ component = fixture.componentInstance;
18
+ fixture.detectChanges();
19
+ }));
20
+
21
+ it('should create', () => {
22
+ expect(component).toBeTruthy();
23
+ });
24
+ });
@@ -0,0 +1,18 @@
1
+ import { Component, Input, OnInit } from '@angular/core';
2
+ import { BaseBtnComponent } from '../baseBtnComponent';
3
+
4
+ @Component({
5
+ selector: 'kb-btn-excluir',
6
+ templateUrl: './btn-excluir.component.html',
7
+ styleUrls: ['./btn-excluir.component.scss'],
8
+ })
9
+ export class BtnExcluirComponent extends BaseBtnComponent implements OnInit {
10
+ @Input() override type: string = 'button';
11
+ @Input() override expand: string = 'inline';
12
+ @Input() override icon: string = 'trash';
13
+ @Input() override title: string = 'Excluir';
14
+ constructor() {
15
+ super();
16
+ }
17
+
18
+ }
@@ -0,0 +1,14 @@
1
+ <ion-button color="primary" [type]="type" [disabled]="disabled" [fill]="fill" [expand]="expand"
2
+ [size]="size"
3
+ (click)="onClick()"
4
+ >
5
+ <ion-icon *ngIf="icon || iconSrc" [slot]="title ? 'start' : 'icon-only'" [name]="icon" [src]="iconSrc"></ion-icon>
6
+ {{ title }}
7
+ <img *ngIf="imgSrc" [src]="imgSrc" [slot]="title ? 'start' : 'icon-only'"/>
8
+ </ion-button>
9
+ <!--
10
+ <ion-button (click)="novoContato()" fill="outline" style="box-shadow: #4c8dff 0px 3px 3px 0.05px">
11
+ <ion-icon slot="start" name="person-add"></ion-icon>
12
+ Novo
13
+ </ion-button>
14
+ -->
@@ -0,0 +1,8 @@
1
+ ion-button {
2
+ //width: 100%;
3
+ box-shadow: #4c8dff 0px 3px 3px 0.05px;
4
+ }
5
+
6
+ img {
7
+ width: 24px;margin-right: 6px;
8
+ }
@@ -0,0 +1,24 @@
1
+ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
2
+ import { IonicModule } from '@ionic/angular';
3
+
4
+ import { BtnNovoComponent } from './btn-novo.component';
5
+
6
+ describe('BtnNovoComponent', () => {
7
+ let component: BtnNovoComponent;
8
+ let fixture: ComponentFixture<BtnNovoComponent>;
9
+
10
+ beforeEach(waitForAsync(() => {
11
+ TestBed.configureTestingModule({
12
+ declarations: [ BtnNovoComponent ],
13
+ imports: [IonicModule.forRoot()]
14
+ }).compileComponents();
15
+
16
+ fixture = TestBed.createComponent(BtnNovoComponent);
17
+ component = fixture.componentInstance;
18
+ fixture.detectChanges();
19
+ }));
20
+
21
+ it('should create', () => {
22
+ expect(component).toBeTruthy();
23
+ });
24
+ });
@@ -0,0 +1,20 @@
1
+ import { Component, Input, OnInit } from '@angular/core';
2
+ import { BaseBtnComponent } from '../baseBtnComponent';
3
+
4
+ @Component({
5
+ selector: 'kb-btn-novo',
6
+ templateUrl: './btn-novo.component.html',
7
+ styleUrls: ['./btn-novo.component.scss'],
8
+ })
9
+ export class BtnNovoComponent extends BaseBtnComponent implements OnInit {
10
+ @Input() override title: string = 'Novo';
11
+ @Input() override icon: string = 'person-add';
12
+ @Input() override iconSrc: string = '';
13
+ @Input() override expand: string = 'block';
14
+ @Input() imgSrc: string = '';
15
+ constructor() {
16
+ super();
17
+ this.type = 'button';
18
+ }
19
+
20
+ }
@@ -0,0 +1,8 @@
1
+ <ion-button color="success" [type]="type" [disabled]="disabled" [fill]="fill" [expand]="expand"
2
+ [size]="size"
3
+ (click)="onClick()"
4
+ [style.margin]="btnMargin"
5
+ >
6
+ <ion-icon [slot]="title ? 'start' : 'icon-only'" [name]="icon"></ion-icon>
7
+ {{ title }}
8
+ </ion-button>
@@ -0,0 +1,5 @@
1
+ ion-button {
2
+ //width: 100%;
3
+ //margin: 4px;
4
+ box-shadow: #42d77d 0px 3px 3px 0.05px
5
+ }
@@ -0,0 +1,24 @@
1
+ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
2
+ import { IonicModule } from '@ionic/angular';
3
+
4
+ import { BtnSalvarComponent } from './btn-salvar.component';
5
+
6
+ describe('BtnSalvarComponent', () => {
7
+ let component: BtnSalvarComponent;
8
+ let fixture: ComponentFixture<BtnSalvarComponent>;
9
+
10
+ beforeEach(waitForAsync(() => {
11
+ TestBed.configureTestingModule({
12
+ declarations: [ BtnSalvarComponent ],
13
+ imports: [IonicModule.forRoot()]
14
+ }).compileComponents();
15
+
16
+ fixture = TestBed.createComponent(BtnSalvarComponent);
17
+ component = fixture.componentInstance;
18
+ fixture.detectChanges();
19
+ }));
20
+
21
+ it('should create', () => {
22
+ expect(component).toBeTruthy();
23
+ });
24
+ });
@@ -0,0 +1,16 @@
1
+ import { Component, Input, OnInit, Output } from '@angular/core';
2
+ import { EventEmitter } from '@angular/core';
3
+ import { BaseBtnComponent } from '../baseBtnComponent';
4
+
5
+ @Component({
6
+ selector: 'kb-btn-salvar',
7
+ templateUrl: './btn-salvar.component.html',
8
+ styleUrls: ['./btn-salvar.component.scss'],
9
+ })
10
+ export class BtnSalvarComponent extends BaseBtnComponent implements OnInit {
11
+ @Input() btnMargin: string = '4px';
12
+ constructor() {
13
+ super();
14
+ }
15
+
16
+ }
@@ -0,0 +1,143 @@
1
+ <form *ngIf="campos && campos.length" [formGroup]="entidadeForm" style="width: 100%;">
2
+
3
+
4
+ <ion-row *ngFor="let linha of campos" [class]="rowClass">
5
+ <ng-container *ngFor="let campo of linha.Linha">
6
+ <!-- {{ campo.Nome }} {{ campo.Tipo }} -->
7
+
8
+ <ion-col [sizeMd]="campo.Size" *ngIf="campo.Tipo == 'input-text'">
9
+ <kb-input-text label="{{campo.Label ?? campo.Nome}}" [placeholder]="campo.PlaceHolderVisivel ? (campo.Label ?? campo.Nome + '...') : ''"
10
+ [form]="entidadeForm" [max]="campo.Tamanho ?? '50'" [validation_messages]="validation_messages[campo.Nome]"
11
+ [formControlName]="campo.Nome" [campoFoco]="campo.CampoFoco" [readonly]="campo.ReadOnly"
12
+ [type]="campo.TipoInput ?? 'text'"
13
+ [showSeePassword]="campo.TipoInput == 'password'"
14
+ [showCustomAction]="campo.InputAction"
15
+ [customActionIcon]="campo.InputActionIcon ?? 'search-outline'"
16
+ (customActionClick)="campo.click ? campo.click($event) : emptyHandler()"
17
+
18
+ [itemClass]="itemClass">
19
+ </kb-input-text>
20
+ </ion-col>
21
+
22
+ <ion-col [sizeMd]="campo.Size" *ngIf="campo.Tipo == 'input-area'">
23
+ <kb-input-area label="{{campo.Label ?? campo.Nome}}" [placeholder]="campo.PlaceHolderVisivel ? (campo.Label ?? campo.Nome + '...') : ''"
24
+ [form]="entidadeForm" [max]="campo.Tamanho ?? '50'" [validation_messages]="validation_messages[campo.Nome]"
25
+ [formControlName]="campo.Nome" [campoFoco]="campo.CampoFoco" [readonly]="campo.ReadOnly" [linhas]="campo.Linhas ?? 5"
26
+ [itemClass]="itemClass">
27
+ </kb-input-area>
28
+ </ion-col>
29
+
30
+ <ion-col [sizeMd]="campo.Size" *ngIf="campo.Tipo == 'input-cep'">
31
+ <kb-input-cep label="{{campo.Label ?? campo.Nome}}" [form]="entidadeForm"
32
+ [validation_messages]="validation_messages[campo.Nome]" [formControlName]="campo.Nome"
33
+ [campoFoco]="campo.CampoFoco" [readonly]="campo.ReadOnly"
34
+ [itemClass]="itemClass"
35
+ (getResultados)="campo.change ? campo.change($event) : emptyHandler()"
36
+ >
37
+ </kb-input-cep>
38
+ </ion-col>
39
+
40
+ <ion-col [sizeMd]="campo.Size" *ngIf="campo.Tipo == 'input-valor'">
41
+ <kb-input-valor label="{{campo.Label ?? campo.Nome}}" [form]="entidadeForm" [max]="campo.Tamanho ?? '50'"
42
+ [validation_messages]="validation_messages[campo.Nome]" [formControlName]="campo.Nome"
43
+ [campoFoco]="campo.CampoFoco" [readonly]="campo.ReadOnly"
44
+ [itemClass]="itemClass">
45
+ </kb-input-valor>
46
+ </ion-col>
47
+
48
+ <ion-col [sizeMd]="campo.Size" *ngIf="campo.Tipo == 'input-format'">
49
+ <kb-input-format label="{{campo.Label ?? campo.Nome}}" [form]="entidadeForm" [max]="campo.Tamanho ?? '50'"
50
+ [validation_messages]="validation_messages[campo.Nome]" [formControlName]="campo.Nome"
51
+ [campoFoco]="campo.CampoFoco" [readonly]="campo.ReadOnly" [formato]="campo.Formato ?? ''"
52
+ [itemClass]="itemClass">
53
+ </kb-input-format>
54
+ </ion-col>
55
+
56
+ <ion-col [sizeMd]="campo.Size" *ngIf="campo.Tipo == 'input-checkbox'">
57
+ <kb-input-checkbox label="{{ campo.Label }}" [form]="entidadeForm"
58
+ [validation_messages]="validation_messages[campo.Nome]" [formControlName]="campo.Nome"
59
+ [campoFoco]="campo.CampoFoco" [readonly]="campo.ReadOnly"
60
+ [itemClass]="itemClass"
61
+ [labelColor]="campo.BtnColor">
62
+
63
+ </kb-input-checkbox>
64
+ </ion-col>
65
+
66
+ <ion-col [sizeMd]="campo.Size" *ngIf="campo.Tipo == 'input-select'">
67
+ <kb-input-select [label]="campo.Label ?? campo.Nome" [placeholder]="'Selecionar...'"
68
+ [formControlName]="campo.Nome" [form]="entidadeForm" [itens]="campo.Itens" [itemId]="campo.ItemId ?? 'Id'"
69
+ [itemNome]="campo.ItemNome ?? 'Nome'" [validation_messages]="validation_messages[campo.Nome]"
70
+ (selectChangeEntity)="campo.change ? campo.change($event) : emptyHandler()" [readonly]="campo.ReadOnly"
71
+ [itemClass]="itemClass">
72
+ </kb-input-select>
73
+ </ion-col>
74
+
75
+ <ion-col [sizeMd]="campo.Size" *ngIf="campo.Tipo == 'input-radio'">
76
+ <kb-input-radio [label]="campo.Label ?? campo.Nome" [formControlName]="campo.Nome" [form]="entidadeForm"
77
+ [itens]="campo.Itens" [itemId]="campo.ItemId" [itemNome]="campo.ItemNome" [readonly]="campo.ReadOnly"
78
+ [itemClass]="itemClass">
79
+ </kb-input-radio>
80
+ </ion-col>
81
+
82
+ <ion-col [sizeMd]="campo.Size" *ngIf="campo.Tipo == 'input-pesquisa'">
83
+ <kb-input-pesquisa #pesquisaCentroCustoPai
84
+ [label]="campo.Label ?? campo.Nome"
85
+ [campoId]="campo.ItemId"
86
+ [focusField]="campo.focusField"
87
+ [formControlName]="campo.Nome"
88
+ placeholder="Pesquisar..."
89
+ [campoDisplay]="campo.ItemNome ?? 'Nome'"
90
+ [form]="entidadeForm"
91
+ [tipo]="campo.TipoPesquisa"
92
+ [urlItem]="campo.UrlItem"
93
+ [max]="campo.Tamanho ?? '50'"
94
+ [url]="campo.UrlPesquisa"
95
+ [readonly]="campo.ReadOnly"
96
+ (pesquisaChange)="campo.change ? campo.change($event) : emptyHandler()"
97
+ [itemClass]="itemClass">
98
+ </kb-input-pesquisa>
99
+ </ion-col>
100
+
101
+ <ion-col [sizeMd]="campo.Size" *ngIf="campo.Tipo == 'input-button'">
102
+ <!--
103
+ <kb-btn-action [title]="campo.Label" [icon]="campo.Icon" [iconSrc]="campo.IconSrc" [color]="campo.BtnColor ?? 'light'"
104
+ [expand]="campo.BtnExpand ?? 'block'" style="margin-top: var(--btn-action-margin-top, auto);">
105
+ </kb-btn-action>
106
+ -->
107
+ <ion-button [expand]="campo.BtnExpand ?? 'block'" [color]="campo.BtnColor ?? 'light'"
108
+ (click)="campo.click ? campo.click($event) : emptyHandler()" [size]="campo.BtnSize ?? 'default'"
109
+ [disabled]="campo.ReadOnly">
110
+ <ion-icon *ngIf="campo.Icon || campo.IconSrc" [name]="campo.Icon" [src]="campo.IconSrc"></ion-icon>
111
+ {{ campo.Label }}
112
+ </ion-button>
113
+ </ion-col>
114
+
115
+ <ion-col *ngIf="campo.Tipo == 'col'" size-md="1" size-xs="0">
116
+
117
+ </ion-col>
118
+
119
+ <ion-col *ngIf="campo.Tipo == 'sub-titulo'" size="12">
120
+ <ion-list lines="none" class="ion-no-padding">
121
+ <ion-list-header color="primary" [style]="campo.CampoStyle ?? ''">
122
+ <ion-label [style]="campo.LabelStyle ?? ''">{{ campo.Label }}</ion-label>
123
+ </ion-list-header>
124
+ </ion-list>
125
+ </ion-col>
126
+ </ng-container>
127
+ </ion-row>
128
+
129
+ <!--
130
+ <ion-col class="select ion-no-margin ion-no-padding">
131
+ <ion-item lines="none">
132
+ <ion-label>Totalizador</ion-label>
133
+ <ion-checkbox slot="start" formControlName="Totalizador"></ion-checkbox>
134
+ </ion-item>
135
+ </ion-col>
136
+ <ion-col class="select ion-no-margin ion-no-padding">
137
+ <ion-item lines="none">
138
+ <ion-label>Inativo</ion-label>
139
+ <ion-checkbox slot="start" formControlName="Inativo"></ion-checkbox>
140
+ </ion-item>
141
+ </ion-col>
142
+ -->
143
+ </form>
@@ -0,0 +1,4 @@
1
+ ion-list-header {
2
+ text-align: center;
3
+ font-size: large;
4
+ }
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { EntityEditComponent } from './entity-edit.component';
4
+
5
+ describe('EntityEditComponent', () => {
6
+ let component: EntityEditComponent;
7
+ let fixture: ComponentFixture<EntityEditComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [EntityEditComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(EntityEditComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,43 @@
1
+ import { Component, Input, NgZone, OnInit } from '@angular/core';
2
+ import { FormGroup } from '@angular/forms';
3
+ import { BaseModel, HtmlRow } from 'appproject-lib';
4
+
5
+ @Component({
6
+ selector: 'kb-entity-edit',
7
+ //standalone: true,
8
+ templateUrl: './entity-edit.component.html',
9
+ styleUrl: './entity-edit.component.scss'
10
+ })
11
+ export class EntityEditComponent<T extends BaseModel> implements OnInit {
12
+ @Input() entidade: T | null;
13
+ //entidade: any;
14
+ /**
15
+ * Vai receber montado do base cadastro
16
+ */
17
+ @Input() campos: HtmlRow[];
18
+ @Input() entidadeForm: FormGroup;
19
+ @Input() validation_messages: any;
20
+ @Input() itemClass: string = "";
21
+ @Input() rowClass: string = "";
22
+ constructor(private ngZone: NgZone) {
23
+
24
+ }
25
+
26
+ ngOnInit() {
27
+ //this.getEntidadeCampos();
28
+ }
29
+
30
+ getEntidadeCampos() {
31
+ //this.entidade = new this.entidadeTipo();
32
+
33
+ // console.log(this.entidade);
34
+ // this.ngZone.run(() =>
35
+ // this.campos = this.entidade.getHtmlForm()
36
+ // );
37
+ // console.log(this.campos);
38
+ }
39
+
40
+ emptyHandler() {
41
+
42
+ }
43
+ }
@@ -0,0 +1,116 @@
1
+ <div style="font-size: 14px;">
2
+ <div id="painelExportacao">
3
+ <ion-row *ngIf="inMemoryPagination">
4
+ <!--
5
+ <ion-col size="2">
6
+ <ion-button *ngIf="tabelaCampos.Selecionar === true" size="small" fill="outline" color="medium"
7
+ (click)="selecionarTodos()">Selecionar Todos</ion-button>
8
+ </ion-col>
9
+ -->
10
+ <ion-col size="3">
11
+ <ion-button *ngIf="inMemoryPagination === true" size="small" fill="outline" color="bluetool"
12
+ (click)="anterior()">
13
+ <ion-icon name="chevron-back-outline" slot="start"></ion-icon>
14
+ Anterior
15
+ </ion-button>
16
+ <ion-button *ngIf="inMemoryPagination === true" size="small" fill="outline" color="bluetool"
17
+ (click)="proximo()">
18
+ Próximo
19
+ <ion-icon name="chevron-forward-outline" slot="end"></ion-icon>
20
+ </ion-button>
21
+ </ion-col>
22
+ <ion-col size="2">
23
+ <span style="display: block; margin-top: 10px;" *ngIf="inMemoryPagination && totalRec > 0">Exibindo {{ start + 1 }} - {{ (start + pageOffset) < totalRec ? (start + pageOffset) : totalRec }} total de {{ totalRec }}
24
+ </span>
25
+ </ion-col>
26
+ </ion-row>
27
+ </div>
28
+ <div style="width: 100%;" [style.min-height]="minHeight">
29
+ <table class="grid">
30
+ <thead>
31
+ <tr style="background-color: var(--ion-color-bluetool); color: white;">
32
+ <td *ngIf="tabelaCampos.Selecionar === true" style="width: 3%; text-align: center;">
33
+ <input type="checkbox" [(ngModel)]="todosSelecionados" (change)="selecionarTodos()">
34
+ </td>
35
+ <td *ngFor="let col of tabelaCampos.Colunas" [style.width]="col.Tamanho">
36
+ <div style="position: relative;">
37
+ <div style="display: flex; justify-content: space-between; align-items: end;">
38
+ <strong>{{ col.Titulo }}</strong>
39
+ <div>
40
+ <ion-icon *ngIf="col.Ordem" slot="end" (click)="ordenar(col)" style="cursor: pointer;"
41
+ [name]="col.OrdemStatus == 0 ? 'swap-vertical' : (col.OrdemStatus == 1 ? 'arrow-up': 'arrow-down')"></ion-icon>
42
+
43
+ <ion-icon *ngIf="col.Filtrar" name="funnel" (click)="setFiltroOpen(col)" slot="end"></ion-icon>
44
+ </div>
45
+ </div>
46
+
47
+
48
+ <div class="caixaGrande" [hidden]="!col.FiltroVisivel" tabindex="-1"
49
+ style="color: black; display: block; position: absolute; z-index: 800; width: 210px; right: 0px; opacity: 0.9;">
50
+ Filtrar:
51
+ <div>
52
+ <div style="display: flex; justify-content: space-between; align-items: start;">
53
+ <select style="width: 80px;" [(ngModel)]="col.FiltroOperador">
54
+ <option>=</option>
55
+ <option>&gt;=</option>
56
+ <option>&lt;=</option>
57
+ <option>tem</option>
58
+ </select>
59
+ <input style="width: 100px;" type="text" [(ngModel)]="col.FiltroValor">
60
+ </div>
61
+ <ion-button size="small" color="medium" expand="block" (click)="filtrar(col)">Filtrar</ion-button>
62
+ <ion-button size="small" color="light" expand="block" (click)="limpar()">Limpar</ion-button>
63
+ </div>
64
+ <div *ngIf="col.Valores" class="scroll-container" style="height: 200px; overflow-y: scroll;">
65
+ <div *ngFor="let valor of col.Valores">
66
+ <input type="checkbox" [(ngModel)]="valor.Selecionado">
67
+ <span>{{ valor.Valor }}</span>
68
+ </div>
69
+ </div>
70
+ </div>
71
+
72
+ </div>
73
+ </td>
74
+ <td *ngIf="tabelaCampos.Excluir === true">
75
+
76
+ </td>
77
+ </tr>
78
+ </thead>
79
+ <tbody>
80
+ <tr *ngFor="let item of pageDataSet" [class]="item == selectedItem ? 'item-selecionado' : '' ">
81
+ <td *ngIf="tabelaCampos.Selecionar === true" style="text-align: center; cursor: auto;">
82
+ <input type="checkbox" [(ngModel)]="item[tabelaCampos.CampoSelecionar]" (change)="selecionadoChecked()">
83
+ </td>
84
+ <td class="col" *ngFor="let col of tabelaCampos.Colunas" [style.width]="col.Tamanho"
85
+ [style.text-align]="col.Tipo == 'number' ? 'right' : (col.Alinhamento ?? 'left')"
86
+ (click)="col.ClickFunction ? col.ClickFunction(item) : selecionarLinha(item)">
87
+ <span *ngIf="col.Pipe == 'date'">{{ item[col.Campo] | date: 'dd/MM/yyyy' }}</span>
88
+ <span *ngIf="col.Pipe == 'valor'">{{ item[col.Campo] | valorFormat }}</span>
89
+ <span *ngIf="col.RenderFunction" [innerHtml]="col.RenderFunction(item) | safeHtml"></span>
90
+ <span *ngIf="!col.Pipe && !col.RenderFunction">{{ item[col.Campo] ?? col.Default }}</span>
91
+ </td>
92
+ <td *ngIf="tabelaCampos.Excluir === true" style="padding: 0px; text-align: center;">
93
+ <ion-button size="small" color="danger" fill="outline" style="transform: scale(0.85);" (click)="excluirLinha(item)">
94
+ <ion-icon name="trash"></ion-icon>
95
+ </ion-button>
96
+ </td>
97
+ </tr>
98
+ </tbody>
99
+ </table>
100
+ </div>
101
+
102
+ <ion-modal [isOpen]="isFiltroOpen" (didDismiss)="isFiltroOpen = false;">
103
+ <ng-template>
104
+ <ion-content class="ion-padding">
105
+ <div class="caixaGrande">
106
+ Filtrar:
107
+ <div *ngIf="selectedColuna.Valores">
108
+ <div *ngFor="let valor of selectedColuna.Valores">
109
+ <span>{{ valor }}</span>
110
+ </div>
111
+ </div>
112
+ </div>
113
+ </ion-content>
114
+ </ng-template>
115
+ </ion-modal>
116
+ </div>
@@ -0,0 +1,47 @@
1
+ .grid {
2
+ width: 100%;
3
+
4
+ thead {
5
+ td {
6
+ border: 1px solid gray;
7
+ padding: 4px 4px;
8
+ color: black !important;
9
+ }
10
+ }
11
+
12
+ tbody {
13
+ td {
14
+ border: 1px solid gray;
15
+ padding: 2px 4px;
16
+ }
17
+
18
+ tr {
19
+ cursor: pointer;
20
+
21
+ &:hover {
22
+ background-color: rgb(105, 156, 204, 0.5);
23
+ transition-duration: .5s;
24
+ }
25
+ }
26
+
27
+ tr.item-selecionado {
28
+ background-color: rgb(105, 156, 204, 0.2);
29
+ }
30
+ }
31
+ }
32
+
33
+ [hidden] {
34
+ display: none !important;
35
+ }
36
+
37
+ /*
38
+ td {
39
+ border: 1px solid, lightgray;
40
+ padding: 2px;
41
+ }
42
+
43
+ .col {
44
+ border: 1px solid gray;
45
+ padding: 2px;
46
+ }
47
+ */
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { GridViewComponent } from './grid-view.component';
4
+
5
+ describe('GridViewComponent', () => {
6
+ let component: GridViewComponent;
7
+ let fixture: ComponentFixture<GridViewComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [GridViewComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(GridViewComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });