appproject-components 1.0.47 → 1.0.49

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 (42) hide show
  1. package/README.md +24 -24
  2. package/karma.conf.js +44 -44
  3. package/ng-package.json +6 -6
  4. package/package.json +1 -1
  5. package/src/lib/appproject-components.component.spec.ts +23 -23
  6. package/src/lib/appproject-components.component.ts +20 -20
  7. package/src/lib/appproject-components.service.spec.ts +16 -16
  8. package/src/lib/appproject-components.service.ts +9 -9
  9. package/src/lib/entity-edit/entity-edit.component.html +142 -142
  10. package/src/lib/entity-edit/entity-edit.component.spec.ts +23 -23
  11. package/src/lib/entity-edit/entity-edit.component.ts +43 -43
  12. package/src/lib/grid-view/grid-view.component.html +115 -115
  13. package/src/lib/grid-view/grid-view.component.spec.ts +23 -23
  14. package/src/lib/grid-view/grid-view.component.ts +292 -292
  15. package/src/lib/input-area/input-area.component.spec.ts +23 -23
  16. package/src/lib/input-area/input-area.component.ts +69 -69
  17. package/src/lib/input-cep/input-cep.component.spec.ts +23 -23
  18. package/src/lib/input-cep/input-cep.component.ts +186 -186
  19. package/src/lib/input-checkbox/input-checkbox.component.html +11 -11
  20. package/src/lib/input-checkbox/input-checkbox.component.spec.ts +23 -23
  21. package/src/lib/input-checkbox/input-checkbox.component.ts +48 -48
  22. package/src/lib/input-format/input-format.component.spec.ts +23 -23
  23. package/src/lib/input-pesquisa/input-pesquisa.component.spec.ts +23 -23
  24. package/src/lib/input-pesquisa/input-pesquisa.component.ts +2 -2
  25. package/src/lib/input-radio/input-radio.component.html +20 -20
  26. package/src/lib/input-radio/input-radio.component.spec.ts +23 -23
  27. package/src/lib/input-radio/input-radio.component.ts +49 -49
  28. package/src/lib/input-select/input-select.component.spec.ts +23 -23
  29. package/src/lib/input-text/input-text.component.spec.ts +23 -23
  30. package/src/lib/input-valor/input-valor.component.spec.ts +23 -23
  31. package/src/lib/model-treeview/model-treeview.component.html +19 -19
  32. package/src/lib/model-treeview/model-treeview.component.spec.ts +23 -23
  33. package/src/lib/model-treeview/model-treeview.component.ts +152 -152
  34. package/src/lib/tree-view/tree-view.component.html +95 -95
  35. package/src/lib/tree-view/tree-view.component.spec.ts +23 -23
  36. package/src/lib/tree-view/tree-view.component.ts +92 -92
  37. package/src/lib/tree-view-nivel/tree-view-nivel.component.html +17 -17
  38. package/src/lib/tree-view-nivel/tree-view-nivel.component.spec.ts +23 -23
  39. package/src/lib/tree-view-nivel/tree-view-nivel.component.ts +43 -43
  40. package/tsconfig.lib.json +15 -15
  41. package/tsconfig.lib.prod.json +10 -10
  42. package/tsconfig.spec.json +17 -17
@@ -1,92 +1,92 @@
1
- import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
2
- import { Tree } from 'appproject-lib';
3
-
4
- @Component({
5
- selector: 'kb-tree-view',
6
- templateUrl: './tree-view.component.html',
7
- styleUrl: './tree-view.component.scss'
8
- })
9
- export class TreeViewComponent implements OnInit{
10
- @Input() itens: any[] = [];
11
- @Input() campoId: string;
12
- @Input() campoPai: string;
13
- @Input() campoLabel: string;
14
- @Input() cadastro: string;
15
- //sera o nome da chamada put, ex: [endpoint: CentroCustoPai]/id/pai
16
- @Input() endpoint: string;
17
- @Input() caixaClass: string = 'caixa';
18
- @Output() beforeUpdate = new EventEmitter();
19
- @Input() currentSearch: string;
20
- @Output() selecionarRegistro = new EventEmitter();
21
-
22
- arvore: Tree[] = [];
23
-
24
- ngOnInit(): void {
25
- //throw new Error('Method not implemented.');
26
- }
27
-
28
- montaArvore(pai: number, arvore: Tree[]): number {
29
- if (arvore && arvore.length > 0) {
30
- //procurar os filhos de cada no
31
- arvore.forEach(f => {
32
- //console.log('no atual:', f, );
33
- let filhos = this.itens.filter(i => i[this.campoPai] == f.Id);
34
- //console.log('filhos atual:', filhos);
35
- f.Filhos = [];
36
- filhos.forEach(fi => {
37
- f.Filhos.push({ Id: fi[this.campoId], Pai: f.Id, Label: fi[this.campoLabel], Filhos: [], Expandido: false, Clicable: (fi['ClicableTree'] == null || fi['ClicableTree'] === true) });
38
- });
39
- return this.montaArvore(0, f.Filhos);
40
- });
41
- return 0;
42
- } else {
43
- //console.log('sem filhos');
44
- return 0;
45
- }
46
- }
47
-
48
- arvoreClick(before: boolean = true) {
49
- if (this.beforeUpdate && before) {
50
- this.beforeUpdate.emit();
51
- return;
52
- }
53
- this.arvore = [];
54
- //console.log('tree itens', this.itens);
55
- if (this.itens && this.itens.length > 0) {
56
- //montar arvore pais
57
- this.itens.forEach(it => {
58
- if (it[this.campoPai] == null) {
59
- //é pai
60
- this.arvore.push({ Id: it[this.campoId], Pai: null, Label: it[this.campoLabel], Filhos: [], Expandido: false, Clicable: (it['ClicableTree'] == null || it['ClicableTree'] === true) });
61
-
62
- }
63
- })
64
- this.montaArvore(0, this.arvore);
65
-
66
- console.log('arvore', this.arvore);
67
- }
68
- }
69
-
70
- expandir(arvore: Tree[] = null): number {
71
- if (arvore == null) {
72
- arvore = this.arvore;
73
- }
74
- if (arvore && arvore.length > 0) {
75
- //procurar os filhos de cada no
76
- arvore.forEach(f => {
77
- //expandir
78
- f.Expandido = true;
79
- return this.expandir(f.Filhos);
80
- });
81
- return 0;
82
- } else {
83
- //console.log('sem filhos');
84
- return 0;
85
- }
86
- }
87
-
88
- carregarRegistro(node: Tree) {
89
- console.log('carrega registro', node);
90
- this.selecionarRegistro.next({ Cadastro: this.cadastro, Id: node.Id });
91
- }
92
- }
1
+ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
2
+ import { Tree } from 'appproject-lib';
3
+
4
+ @Component({
5
+ selector: 'kb-tree-view',
6
+ templateUrl: './tree-view.component.html',
7
+ styleUrl: './tree-view.component.scss'
8
+ })
9
+ export class TreeViewComponent implements OnInit{
10
+ @Input() itens: any[] = [];
11
+ @Input() campoId: string;
12
+ @Input() campoPai: string;
13
+ @Input() campoLabel: string;
14
+ @Input() cadastro: string;
15
+ //sera o nome da chamada put, ex: [endpoint: CentroCustoPai]/id/pai
16
+ @Input() endpoint: string;
17
+ @Input() caixaClass: string = 'caixa';
18
+ @Output() beforeUpdate = new EventEmitter();
19
+ @Input() currentSearch: string;
20
+ @Output() selecionarRegistro = new EventEmitter();
21
+
22
+ arvore: Tree[] = [];
23
+
24
+ ngOnInit(): void {
25
+ //throw new Error('Method not implemented.');
26
+ }
27
+
28
+ montaArvore(pai: number, arvore: Tree[]): number {
29
+ if (arvore && arvore.length > 0) {
30
+ //procurar os filhos de cada no
31
+ arvore.forEach(f => {
32
+ //console.log('no atual:', f, );
33
+ let filhos = this.itens.filter(i => i[this.campoPai] == f.Id);
34
+ //console.log('filhos atual:', filhos);
35
+ f.Filhos = [];
36
+ filhos.forEach(fi => {
37
+ f.Filhos.push({ Id: fi[this.campoId], Pai: f.Id, Label: fi[this.campoLabel], Filhos: [], Expandido: false, Clicable: (fi['ClicableTree'] == null || fi['ClicableTree'] === true) });
38
+ });
39
+ return this.montaArvore(0, f.Filhos);
40
+ });
41
+ return 0;
42
+ } else {
43
+ //console.log('sem filhos');
44
+ return 0;
45
+ }
46
+ }
47
+
48
+ arvoreClick(before: boolean = true) {
49
+ if (this.beforeUpdate && before) {
50
+ this.beforeUpdate.emit();
51
+ return;
52
+ }
53
+ this.arvore = [];
54
+ //console.log('tree itens', this.itens);
55
+ if (this.itens && this.itens.length > 0) {
56
+ //montar arvore pais
57
+ this.itens.forEach(it => {
58
+ if (it[this.campoPai] == null) {
59
+ //é pai
60
+ this.arvore.push({ Id: it[this.campoId], Pai: null, Label: it[this.campoLabel], Filhos: [], Expandido: false, Clicable: (it['ClicableTree'] == null || it['ClicableTree'] === true) });
61
+
62
+ }
63
+ })
64
+ this.montaArvore(0, this.arvore);
65
+
66
+ console.log('arvore', this.arvore);
67
+ }
68
+ }
69
+
70
+ expandir(arvore: Tree[] = null): number {
71
+ if (arvore == null) {
72
+ arvore = this.arvore;
73
+ }
74
+ if (arvore && arvore.length > 0) {
75
+ //procurar os filhos de cada no
76
+ arvore.forEach(f => {
77
+ //expandir
78
+ f.Expandido = true;
79
+ return this.expandir(f.Filhos);
80
+ });
81
+ return 0;
82
+ } else {
83
+ //console.log('sem filhos');
84
+ return 0;
85
+ }
86
+ }
87
+
88
+ carregarRegistro(node: Tree) {
89
+ console.log('carrega registro', node);
90
+ this.selecionarRegistro.next({ Cadastro: this.cadastro, Id: node.Id });
91
+ }
92
+ }
@@ -1,17 +1,17 @@
1
- <span [innerHtml]="identacao" class="node-link"></span>
2
- <!-- mostrar a seta se tiver filhos ou se for raiz (nivel = 0)-->
3
- <span class="node-link" *ngIf="!node.Expandido && (node.Filhos.length > 0 || nivel == 0)" (click)="node.Expandido = !node.Expandido"
4
- class="boxSeta">
5
- <ion-icon name="chevron-forward-outline"></ion-icon>
6
- </span>
7
- <span class="node-link" *ngIf="node.Expandido" (click)="node.Expandido = !node.Expandido" class="boxSeta">
8
- <ion-icon name="chevron-down-outline"></ion-icon>
9
- </span>
10
- <!--
11
- <span *ngIf="!node.Expandido">&nbsp;&nbsp;&nbsp;</span>
12
- -->
13
-
14
- <!--
15
- <span [class]="{ 'node-link' : node.Clicable === true, 'node-disabled': node.Clicable === false }" (click)="nodeClick()" title="{{ node.Label }}"> {{ node.Label }}</span>
16
- -->
17
- <span [class]="{ 'node-link' : node.Clicable === true, 'node-disabled': node.Clicable === false }" (click)="nodeClick()" title="{{ node.Label }}" [innerHTML]="highlight(node.Label)"></span>
1
+ <span [innerHtml]="identacao" class="node-link"></span>
2
+ <!-- mostrar a seta se tiver filhos ou se for raiz (nivel = 0)-->
3
+ <span class="node-link" *ngIf="!node.Expandido && (node.Filhos.length > 0 || nivel == 0)" (click)="node.Expandido = !node.Expandido"
4
+ class="boxSeta">
5
+ <ion-icon name="chevron-forward-outline"></ion-icon>
6
+ </span>
7
+ <span class="node-link" *ngIf="node.Expandido" (click)="node.Expandido = !node.Expandido" class="boxSeta">
8
+ <ion-icon name="chevron-down-outline"></ion-icon>
9
+ </span>
10
+ <!--
11
+ <span *ngIf="!node.Expandido">&nbsp;&nbsp;&nbsp;</span>
12
+ -->
13
+
14
+ <!--
15
+ <span [class]="{ 'node-link' : node.Clicable === true, 'node-disabled': node.Clicable === false }" (click)="nodeClick()" title="{{ node.Label }}"> {{ node.Label }}</span>
16
+ -->
17
+ <span [class]="{ 'node-link' : node.Clicable === true, 'node-disabled': node.Clicable === false }" (click)="nodeClick()" title="{{ node.Label }}" [innerHTML]="highlight(node.Label)"></span>
@@ -1,23 +1,23 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { TreeViewNivelComponent } from './tree-view-nivel.component';
4
-
5
- describe('TreeViewNivelComponent', () => {
6
- let component: TreeViewNivelComponent;
7
- let fixture: ComponentFixture<TreeViewNivelComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [TreeViewNivelComponent]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(TreeViewNivelComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { TreeViewNivelComponent } from './tree-view-nivel.component';
4
+
5
+ describe('TreeViewNivelComponent', () => {
6
+ let component: TreeViewNivelComponent;
7
+ let fixture: ComponentFixture<TreeViewNivelComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [TreeViewNivelComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(TreeViewNivelComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -1,43 +1,43 @@
1
- import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
2
- import { DomSanitizer } from '@angular/platform-browser';
3
-
4
- @Component({
5
- selector: 'kb-tree-view-nivel',
6
- templateUrl: './tree-view-nivel.component.html',
7
- styleUrl: './tree-view-nivel.component.scss'
8
- })
9
- export class TreeViewNivelComponent implements OnInit {
10
- @Output() nivelClick = new EventEmitter();
11
- @Input() node: any;
12
- @Input() nivel: number;
13
- @Input() currentSearch: string;
14
-
15
- identacao: string = '';
16
-
17
- constructor(private sanitizer: DomSanitizer) { }
18
-
19
- ngOnInit() {
20
- for (let i=0; i<this.nivel;i++) {
21
- this.identacao += '<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>';
22
- }
23
- //console.log('IDENT', this.identacao)
24
- }
25
-
26
- nodeClick() {
27
- if (this.nivelClick) {
28
- this.nivelClick.emit(this.node);
29
- }
30
- }
31
-
32
- highlight(texto: string): any {
33
- if (!this.currentSearch)
34
- return texto;
35
- let index = texto.toLowerCase().indexOf(this.currentSearch.toLowerCase());
36
- //console.log(index);
37
- if (index >= 0) {
38
- return this.sanitizer.bypassSecurityTrustHtml(texto.substring(0, index) + '<strong style="background-color: yellow !important;">' + texto.substring(index, index + this.currentSearch.length) + '</strong>' + texto.substring(index + this.currentSearch.length)); //texto.replace(this.textoPesquisa, `<strong>${this.textoPesquisa}</strong>`);
39
- } else {
40
- return texto;
41
- }
42
- }
43
- }
1
+ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
2
+ import { DomSanitizer } from '@angular/platform-browser';
3
+
4
+ @Component({
5
+ selector: 'kb-tree-view-nivel',
6
+ templateUrl: './tree-view-nivel.component.html',
7
+ styleUrl: './tree-view-nivel.component.scss'
8
+ })
9
+ export class TreeViewNivelComponent implements OnInit {
10
+ @Output() nivelClick = new EventEmitter();
11
+ @Input() node: any;
12
+ @Input() nivel: number;
13
+ @Input() currentSearch: string;
14
+
15
+ identacao: string = '';
16
+
17
+ constructor(private sanitizer: DomSanitizer) { }
18
+
19
+ ngOnInit() {
20
+ for (let i=0; i<this.nivel;i++) {
21
+ this.identacao += '<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>';
22
+ }
23
+ //console.log('IDENT', this.identacao)
24
+ }
25
+
26
+ nodeClick() {
27
+ if (this.nivelClick) {
28
+ this.nivelClick.emit(this.node);
29
+ }
30
+ }
31
+
32
+ highlight(texto: string): any {
33
+ if (!this.currentSearch)
34
+ return texto;
35
+ let index = texto.toLowerCase().indexOf(this.currentSearch.toLowerCase());
36
+ //console.log(index);
37
+ if (index >= 0) {
38
+ return this.sanitizer.bypassSecurityTrustHtml(texto.substring(0, index) + '<strong style="background-color: yellow !important;">' + texto.substring(index, index + this.currentSearch.length) + '</strong>' + texto.substring(index + this.currentSearch.length)); //texto.replace(this.textoPesquisa, `<strong>${this.textoPesquisa}</strong>`);
39
+ } else {
40
+ return texto;
41
+ }
42
+ }
43
+ }
package/tsconfig.lib.json CHANGED
@@ -1,15 +1,15 @@
1
- /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
- {
3
- "extends": "../../tsconfig.json",
4
- "compilerOptions": {
5
- "outDir": "../../out-tsc/lib",
6
- "declaration": true,
7
- "declarationMap": true,
8
- "inlineSources": true,
9
- "types": []
10
- },
11
- "exclude": [
12
- "src/test.ts",
13
- "**/*.spec.ts"
14
- ]
15
- }
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "../../tsconfig.json",
4
+ "compilerOptions": {
5
+ "outDir": "../../out-tsc/lib",
6
+ "declaration": true,
7
+ "declarationMap": true,
8
+ "inlineSources": true,
9
+ "types": []
10
+ },
11
+ "exclude": [
12
+ "src/test.ts",
13
+ "**/*.spec.ts"
14
+ ]
15
+ }
@@ -1,10 +1,10 @@
1
- /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
- {
3
- "extends": "./tsconfig.lib.json",
4
- "compilerOptions": {
5
- "declarationMap": false
6
- },
7
- "angularCompilerOptions": {
8
- "compilationMode": "partial"
9
- }
10
- }
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "./tsconfig.lib.json",
4
+ "compilerOptions": {
5
+ "declarationMap": false
6
+ },
7
+ "angularCompilerOptions": {
8
+ "compilationMode": "partial"
9
+ }
10
+ }
@@ -1,17 +1,17 @@
1
- /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
- {
3
- "extends": "../../tsconfig.json",
4
- "compilerOptions": {
5
- "outDir": "../../out-tsc/spec",
6
- "types": [
7
- "jasmine"
8
- ]
9
- },
10
- "files": [
11
- "src/test.ts"
12
- ],
13
- "include": [
14
- "**/*.spec.ts",
15
- "**/*.d.ts"
16
- ]
17
- }
1
+ /* To learn more about this file see: https://angular.io/config/tsconfig. */
2
+ {
3
+ "extends": "../../tsconfig.json",
4
+ "compilerOptions": {
5
+ "outDir": "../../out-tsc/spec",
6
+ "types": [
7
+ "jasmine"
8
+ ]
9
+ },
10
+ "files": [
11
+ "src/test.ts"
12
+ ],
13
+ "include": [
14
+ "**/*.spec.ts",
15
+ "**/*.d.ts"
16
+ ]
17
+ }