appproject-components 1.0.49 → 1.0.51

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/esm2022/appproject-components.mjs +5 -0
  2. package/esm2022/lib/appproject-components.component.mjs +22 -0
  3. package/esm2022/lib/appproject-components.module.mjs +159 -0
  4. package/esm2022/lib/appproject-components.service.mjs +14 -0
  5. package/esm2022/lib/baseInputComponent.mjs +69 -0
  6. package/esm2022/lib/buttons/baseBtnComponent.mjs +63 -0
  7. package/esm2022/lib/buttons/btn-action/btn-action.component.mjs +55 -0
  8. package/esm2022/lib/buttons/btn-cancelar/btn-cancelar.component.mjs +25 -0
  9. package/esm2022/lib/buttons/btn-excluir/btn-excluir.component.mjs +29 -0
  10. package/esm2022/lib/buttons/btn-novo/btn-novo.component.mjs +33 -0
  11. package/esm2022/lib/buttons/btn-salvar/btn-salvar.component.mjs +19 -0
  12. package/esm2022/lib/entity-edit/entity-edit.component.mjs +53 -0
  13. package/esm2022/lib/grid-view/grid-view.component.mjs +275 -0
  14. package/esm2022/lib/input-area/input-area.component.mjs +72 -0
  15. package/esm2022/lib/input-arquivo/input-arquivo.component.mjs +154 -0
  16. package/esm2022/lib/input-cep/input-cep.component.mjs +180 -0
  17. package/esm2022/lib/input-checkbox/input-checkbox.component.mjs +51 -0
  18. package/esm2022/lib/input-format/input-format.component.mjs +138 -0
  19. package/esm2022/lib/input-pesquisa/input-pesquisa.component.mjs +557 -0
  20. package/esm2022/lib/input-radio/input-radio.component.mjs +58 -0
  21. package/esm2022/lib/input-select/input-select.component.mjs +110 -0
  22. package/esm2022/lib/input-text/input-text.component.mjs +88 -0
  23. package/esm2022/lib/input-valor/input-valor.component.mjs +161 -0
  24. package/esm2022/lib/lib-config.mjs +2 -0
  25. package/esm2022/lib/model-treeview/model-treeview.component.mjs +126 -0
  26. package/esm2022/lib/tree-view/tree-view.component.mjs +104 -0
  27. package/esm2022/lib/tree-view-nivel/tree-view-nivel.component.mjs +50 -0
  28. package/esm2022/public-api.mjs +30 -0
  29. package/fesm2022/appproject-components.mjs +2531 -0
  30. package/fesm2022/appproject-components.mjs.map +1 -0
  31. package/index.d.ts +5 -0
  32. package/lib/appproject-components.component.d.ts +8 -0
  33. package/lib/appproject-components.module.d.ts +36 -0
  34. package/lib/appproject-components.service.d.ts +6 -0
  35. package/lib/baseInputComponent.d.ts +28 -0
  36. package/lib/buttons/baseBtnComponent.d.ts +19 -0
  37. package/lib/buttons/btn-action/btn-action.component.d.ts +21 -0
  38. package/lib/buttons/btn-cancelar/btn-cancelar.component.d.ts +10 -0
  39. package/lib/buttons/btn-excluir/btn-excluir.component.d.ts +12 -0
  40. package/lib/buttons/btn-novo/btn-novo.component.d.ts +13 -0
  41. package/lib/buttons/btn-salvar/btn-salvar.component.d.ts +9 -0
  42. package/lib/entity-edit/entity-edit.component.d.ts +22 -0
  43. package/lib/grid-view/grid-view.component.d.ts +52 -0
  44. package/lib/input-area/input-area.component.d.ts +24 -0
  45. package/lib/input-arquivo/input-arquivo.component.d.ts +43 -0
  46. package/lib/input-cep/input-cep.component.d.ts +29 -0
  47. package/lib/input-checkbox/input-checkbox.component.d.ts +21 -0
  48. package/lib/input-format/input-format.component.d.ts +27 -0
  49. package/lib/input-pesquisa/input-pesquisa.component.d.ts +69 -0
  50. package/lib/input-radio/input-radio.component.d.ts +23 -0
  51. package/lib/input-select/input-select.component.d.ts +32 -0
  52. package/lib/input-text/input-text.component.d.ts +33 -0
  53. package/lib/input-valor/input-valor.component.d.ts +29 -0
  54. package/{src/lib/lib-config.ts → lib/lib-config.d.ts} +3 -4
  55. package/lib/model-treeview/model-treeview.component.d.ts +39 -0
  56. package/lib/tree-view/tree-view.component.d.ts +23 -0
  57. package/lib/tree-view-nivel/tree-view-nivel.component.d.ts +17 -0
  58. package/package.json +26 -15
  59. package/{src/public-api.ts → public-api.d.ts} +24 -30
  60. package/karma.conf.js +0 -44
  61. package/ng-package.json +0 -7
  62. package/src/lib/appproject-components.component.spec.ts +0 -23
  63. package/src/lib/appproject-components.component.ts +0 -20
  64. package/src/lib/appproject-components.module.ts +0 -106
  65. package/src/lib/appproject-components.service.spec.ts +0 -16
  66. package/src/lib/appproject-components.service.ts +0 -9
  67. package/src/lib/baseComponent.scss +0 -162
  68. package/src/lib/baseInputComponent.ts +0 -35
  69. package/src/lib/buttons/baseBtnComponent.ts +0 -38
  70. package/src/lib/buttons/btn-action/btn-action.component.html +0 -11
  71. package/src/lib/buttons/btn-action/btn-action.component.scss +0 -7
  72. package/src/lib/buttons/btn-action/btn-action.component.spec.ts +0 -24
  73. package/src/lib/buttons/btn-action/btn-action.component.ts +0 -31
  74. package/src/lib/buttons/btn-cancelar/btn-cancelar.component.html +0 -14
  75. package/src/lib/buttons/btn-cancelar/btn-cancelar.component.scss +0 -5
  76. package/src/lib/buttons/btn-cancelar/btn-cancelar.component.spec.ts +0 -24
  77. package/src/lib/buttons/btn-cancelar/btn-cancelar.component.ts +0 -19
  78. package/src/lib/buttons/btn-excluir/btn-excluir.component.html +0 -6
  79. package/src/lib/buttons/btn-excluir/btn-excluir.component.scss +0 -5
  80. package/src/lib/buttons/btn-excluir/btn-excluir.component.spec.ts +0 -24
  81. package/src/lib/buttons/btn-excluir/btn-excluir.component.ts +0 -18
  82. package/src/lib/buttons/btn-novo/btn-novo.component.html +0 -14
  83. package/src/lib/buttons/btn-novo/btn-novo.component.scss +0 -8
  84. package/src/lib/buttons/btn-novo/btn-novo.component.spec.ts +0 -24
  85. package/src/lib/buttons/btn-novo/btn-novo.component.ts +0 -20
  86. package/src/lib/buttons/btn-salvar/btn-salvar.component.html +0 -8
  87. package/src/lib/buttons/btn-salvar/btn-salvar.component.scss +0 -5
  88. package/src/lib/buttons/btn-salvar/btn-salvar.component.spec.ts +0 -24
  89. package/src/lib/buttons/btn-salvar/btn-salvar.component.ts +0 -16
  90. package/src/lib/entity-edit/entity-edit.component.html +0 -143
  91. package/src/lib/entity-edit/entity-edit.component.scss +0 -4
  92. package/src/lib/entity-edit/entity-edit.component.spec.ts +0 -23
  93. package/src/lib/entity-edit/entity-edit.component.ts +0 -43
  94. package/src/lib/grid-view/grid-view.component.html +0 -116
  95. package/src/lib/grid-view/grid-view.component.scss +0 -47
  96. package/src/lib/grid-view/grid-view.component.spec.ts +0 -23
  97. package/src/lib/grid-view/grid-view.component.ts +0 -292
  98. package/src/lib/input-area/input-area.component.html +0 -30
  99. package/src/lib/input-area/input-area.component.scss +0 -68
  100. package/src/lib/input-area/input-area.component.spec.ts +0 -23
  101. package/src/lib/input-area/input-area.component.ts +0 -69
  102. package/src/lib/input-arquivo/input-arquivo.component.html +0 -11
  103. package/src/lib/input-arquivo/input-arquivo.component.scss +0 -0
  104. package/src/lib/input-arquivo/input-arquivo.component.spec.ts +0 -23
  105. package/src/lib/input-arquivo/input-arquivo.component.ts +0 -140
  106. package/src/lib/input-cep/input-cep.component.html +0 -38
  107. package/src/lib/input-cep/input-cep.component.scss +0 -0
  108. package/src/lib/input-cep/input-cep.component.spec.ts +0 -23
  109. package/src/lib/input-cep/input-cep.component.ts +0 -186
  110. package/src/lib/input-checkbox/input-checkbox.component.html +0 -12
  111. package/src/lib/input-checkbox/input-checkbox.component.scss +0 -11
  112. package/src/lib/input-checkbox/input-checkbox.component.spec.ts +0 -23
  113. package/src/lib/input-checkbox/input-checkbox.component.ts +0 -48
  114. package/src/lib/input-format/input-format.component.html +0 -32
  115. package/src/lib/input-format/input-format.component.scss +0 -47
  116. package/src/lib/input-format/input-format.component.spec.ts +0 -23
  117. package/src/lib/input-format/input-format.component.ts +0 -139
  118. package/src/lib/input-pesquisa/input-pesquisa.component.html +0 -77
  119. package/src/lib/input-pesquisa/input-pesquisa.component.scss +0 -127
  120. package/src/lib/input-pesquisa/input-pesquisa.component.spec.ts +0 -23
  121. package/src/lib/input-pesquisa/input-pesquisa.component.ts +0 -558
  122. package/src/lib/input-radio/input-radio.component.html +0 -21
  123. package/src/lib/input-radio/input-radio.component.scss +0 -3
  124. package/src/lib/input-radio/input-radio.component.spec.ts +0 -23
  125. package/src/lib/input-radio/input-radio.component.ts +0 -49
  126. package/src/lib/input-select/input-select.component.html +0 -29
  127. package/src/lib/input-select/input-select.component.scss +0 -62
  128. package/src/lib/input-select/input-select.component.spec.ts +0 -23
  129. package/src/lib/input-select/input-select.component.ts +0 -96
  130. package/src/lib/input-text/input-text.component.html +0 -48
  131. package/src/lib/input-text/input-text.component.scss +0 -63
  132. package/src/lib/input-text/input-text.component.spec.ts +0 -23
  133. package/src/lib/input-text/input-text.component.ts +0 -78
  134. package/src/lib/input-valor/input-valor.component.html +0 -32
  135. package/src/lib/input-valor/input-valor.component.scss +0 -47
  136. package/src/lib/input-valor/input-valor.component.spec.ts +0 -23
  137. package/src/lib/input-valor/input-valor.component.ts +0 -164
  138. package/src/lib/model-treeview/model-treeview.component.html +0 -20
  139. package/src/lib/model-treeview/model-treeview.component.scss +0 -0
  140. package/src/lib/model-treeview/model-treeview.component.spec.ts +0 -23
  141. package/src/lib/model-treeview/model-treeview.component.ts +0 -152
  142. package/src/lib/tree-view/tree-view.component.html +0 -96
  143. package/src/lib/tree-view/tree-view.component.scss +0 -50
  144. package/src/lib/tree-view/tree-view.component.spec.ts +0 -23
  145. package/src/lib/tree-view/tree-view.component.ts +0 -92
  146. package/src/lib/tree-view-nivel/tree-view-nivel.component.html +0 -17
  147. package/src/lib/tree-view-nivel/tree-view-nivel.component.scss +0 -8
  148. package/src/lib/tree-view-nivel/tree-view-nivel.component.spec.ts +0 -23
  149. package/src/lib/tree-view-nivel/tree-view-nivel.component.ts +0 -43
  150. package/src/test.ts +0 -15
  151. package/tsconfig.lib.json +0 -15
  152. package/tsconfig.lib.prod.json +0 -10
  153. package/tsconfig.spec.json +0 -17
@@ -1,62 +0,0 @@
1
-
2
- /*
3
- ion-label {
4
- margin-bottom: 4px !important;
5
- }
6
- */
7
-
8
- select {
9
- padding: var(--select-padding, 4px);
10
- border: 1px solid darkgray;
11
- border-radius: 4px;
12
- width: 100%;
13
- margin-top: 2px;
14
- height: var(--select-height, 29px);
15
- margin-left: 0px;
16
- margin-bottom: 2px;
17
- background-color: white !important;
18
- }
19
-
20
- .no-padding {
21
- --inner-padding-end: 0px; --padding-start: 0px;
22
- --padding-bottom: 0px;
23
- --inner-padding-bottom: 0px;
24
- height: 42px !important;
25
- }
26
-
27
-
28
- select:focus {
29
- outline: none !important;
30
- border: 1px solid lightblue !important;
31
- ion-label{
32
- color: var(--ion-color-label-focus, blue) !important;
33
- }
34
- /*
35
- .focus-label {
36
- color: var(--ion-color-label-focus, blue) !important;
37
- }
38
- */
39
- }
40
-
41
-
42
-
43
- .item-has-focus {
44
- ion-label {
45
- color: var(--ion-color-label-focus, blue) !important;
46
- }
47
- }
48
-
49
-
50
- /*
51
- .no-padding-no-height {
52
- --inner-padding-end: 0px; --padding-start: 0px;
53
- --padding-bottom: 0px;
54
- --inner-padding-bottom: 0px;
55
- }
56
- */
57
-
58
- /*
59
- .padding-top {
60
- --padding-top: 0px;
61
- }
62
- */
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { InputSelectComponent } from './input-select.component';
4
-
5
- describe('InputSelectComponent', () => {
6
- let component: InputSelectComponent;
7
- let fixture: ComponentFixture<InputSelectComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- declarations: [ InputSelectComponent ]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(InputSelectComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,96 +0,0 @@
1
- import { Component, ElementRef, EventEmitter, Input, OnInit, Output, Renderer2, ViewChild } from '@angular/core';
2
- import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
3
- import { BaseInputComponent } from '../baseInputComponent';
4
-
5
- @Component({
6
- selector: 'kb-input-select',
7
- templateUrl: './input-select.component.html',
8
- styleUrls: ['./input-select.component.scss', './../baseComponent.scss'],
9
- providers: [{
10
- provide: NG_VALUE_ACCESSOR,
11
- useExisting: InputSelectComponent,
12
- multi: true
13
- }]
14
- })
15
- export class InputSelectComponent extends BaseInputComponent implements OnInit, ControlValueAccessor {
16
- @Output() selectChange = new EventEmitter();
17
- @Output() selectChangeEntity = new EventEmitter();
18
- @Input() itens: any[] = [];
19
- @Input() itemId: string = "Id";
20
- @Input() itemNome: string = "Nome";
21
- @Input() showNovo: boolean = false;
22
- @Input() itemNull: boolean = true;
23
- @Input() opcaoDefault: string = 'Selecionar';
24
-
25
- //para 'injeção' de estilo no foco
26
- @ViewChild("itemSelect", {read: ElementRef}) itemSelect: any;
27
-
28
- //control value acessor
29
- public data: string | any;
30
- private onChange: Function = (data: string) => {};
31
- private onTouch: Function = () => {};
32
- private disabled: boolean = false;
33
- public console = console;
34
-
35
- writeValue(value: string | any): void {
36
- //console.log('write value select', value);
37
- this.onChange(value);
38
- this.data = value;
39
- }
40
- registerOnChange(fn: any): void {
41
- this.onChange = fn;
42
- }
43
- registerOnTouched(fn: any): void {
44
- this.onTouch = fn;
45
- }
46
- setDisabledState?(isDisabled: boolean): void {
47
- this.disabled = this.disabled;
48
- }
49
-
50
- constructor(private renderer: Renderer2) {
51
- super();
52
- }
53
-
54
- override ngOnInit() {
55
- if (this.readonly === true) {
56
- //console.log("disabled");
57
- setTimeout(() => {
58
- //this.renderer.addClass(document.getElementById("item-select"), "item-has-focus");
59
- this.renderer.addClass(this.itemSelect.nativeElement, "item-interactive-disabled");
60
- //console.log('select focused', document.getElementById("item-select"));
61
- }, 100);
62
- }
63
- }
64
-
65
- onSelectChange(value: any) {
66
- this.writeValue(value == '' ? null : value);
67
- if (this.selectChange != null) {
68
- //console.log('emit', value);
69
- this.selectChange.emit(value);
70
- }
71
- if (this.selectChangeEntity != null) {
72
- const existe = this.itens.find(i => i[this.itemId] == value);
73
- this.selectChangeEntity.emit(existe);
74
- }
75
- }
76
-
77
- onBlur() {
78
- //console.log('input select blur')
79
- setTimeout(() => {
80
- this.renderer.removeClass(this.itemSelect.nativeElement, "item-has-focus");
81
- }, 200);
82
-
83
- if (this.form) {
84
- this.form.get(this.formControlName)?.markAsTouched();
85
- }
86
- }
87
-
88
- onEnter() {
89
- //adicionar classe ao ion-item
90
- setTimeout(() => {
91
- this.renderer.addClass(this.itemSelect.nativeElement, "item-has-focus");
92
- //console.log('select focused', document.getElementById("item-select"));
93
- }, 200);
94
- }
95
-
96
- }
@@ -1,48 +0,0 @@
1
- <!--
2
- <div [formGroup]="form">
3
- [style.opacity]="readonly ? '0.8' : '1'"
4
- -->
5
- <div>
6
- <ion-item lines="none" style="--background: inherited; --background-focused: transparent; padding-right: 0px;" [class]="itemClass"
7
- [ngClass]="form?.get(formControlName)?.errors && (form?.get(formControlName)?.dirty || form?.get(formControlName)?.touched) ? 'error-shake' : '' "
8
- >
9
- <ion-label position="{{ labelPosition }}">{{ label }}&nbsp;</ion-label>
10
- <!-- formControlName="{{ campo }}" -->
11
- <ion-input #inputText
12
- type="{{type}}"
13
- [placeholder]="placeholder"
14
- maxlength="{{ max }}"
15
- (ionBlur)="onBlur()"
16
- [value]="data"
17
- (input)="writeValue(inputText.value)"
18
- autocomplete="new-password"
19
- [style.--background]="inputBackgroungColor"
20
- [disabled]="readonly"
21
- [clearInput]="botaoLimpar">
22
- <ion-icon *ngIf="iconInput" name="{{ iconInput }}"></ion-icon>
23
- </ion-input>
24
-
25
- <ion-button size="small" slot="end" *ngIf="showSeePassword" style="margin-top: 27px; margin-inline-start: 4px !important;" fill="clear" color="dark" (click)="changeTypeOfInput()">
26
- <!-- (click)="limparClick()" -->
27
- <ion-icon [name]="type == 'password' ? 'eye-outline' : 'eye-off-outline' "></ion-icon>
28
- </ion-button>
29
-
30
- <ion-button size="small" slot="end" *ngIf="showCustomAction" style="margin-top: var(--input-text-custom-btn-margin-top, 27px); margin-inline-start: 4px !important;" fill="clear" color="dark" (click)="customClick()">
31
- <!-- (click)="limparClick()" -->
32
- <ion-icon slot="icon-only" [name]="customActionIcon"></ion-icon>
33
- </ion-button>
34
-
35
- <span *ngIf="inputSpanAfter" slot="end" class="inputSpanAfter-item">&nbsp;{{ inputSpanAfter }}</span>
36
- </ion-item>
37
-
38
- <div class="validation-errors" *ngIf="form">
39
-
40
- <ng-container *ngFor="let validation of validation_messages">
41
- <div class="error-message"
42
- *ngIf="form.get(formControlName)?.hasError(validation.type) && (form.get(formControlName)?.dirty || form.get(formControlName)?.touched)">
43
- &#8226; {{ validation.message }}
44
- </div>
45
- </ng-container>
46
-
47
- </div>
48
- </div>
@@ -1,63 +0,0 @@
1
- /*
2
- ion-label {
3
- margin-bottom: 4px !important;
4
- opacity: 1 !important;
5
- }
6
- */
7
- .no-padding-end {
8
- --inner-padding-end: 0;
9
- }
10
-
11
- ion-input {
12
- ion-icon {
13
- padding-right: 6px;
14
- font-size: 18px;
15
- }
16
- }
17
-
18
- /*
19
- ion-input {
20
- padding: 2px;
21
- border: 1px solid darkgray;
22
- border-radius: 4px;
23
- width: 100%;
24
- margin-top: 2px;
25
- max-height: 29px;
26
- transition: .2s ease;
27
- }
28
- */
29
-
30
- /*
31
- .padding {
32
- //--inner-padding-end: auto; --padding-start: auto;
33
- padding: auto;
34
- padding-left: 0px;
35
- }
36
- */
37
-
38
- /*
39
- .no-padding {
40
- --inner-padding-end: 0px; --padding-start: 0px;
41
- --padding-bottom: 0px;
42
- --inner-padding-bottom: 0px;
43
- height: 39px !important;
44
- }
45
- */
46
-
47
- /*
48
- .no-padding-no-height {
49
- --inner-padding-end: 0px; --padding-start: 0px;
50
- --padding-bottom: 0px;
51
- --inner-padding-bottom: 0px;
52
- }
53
- */
54
-
55
- /*
56
- .padding-top {
57
- --padding-top: 0px;
58
- }
59
- */
60
-
61
- .input-login {
62
- height: 36px;
63
- }
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { InputTextComponent } from './input-text.component';
4
-
5
- describe('InputTextComponent', () => {
6
- let component: InputTextComponent;
7
- let fixture: ComponentFixture<InputTextComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- declarations: [ InputTextComponent ]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(InputTextComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,78 +0,0 @@
1
- import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
2
- import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
3
- import { BaseInputComponent } from '../baseInputComponent';
4
-
5
- @Component({
6
- selector: 'kb-input-text',
7
- templateUrl: './input-text.component.html',
8
- styleUrls: ['./input-text.component.scss', './../baseComponent.scss'],
9
- providers: [{
10
- provide: NG_VALUE_ACCESSOR,
11
- useExisting: InputTextComponent,
12
- multi: true
13
- }]
14
- })
15
- export class InputTextComponent extends BaseInputComponent implements OnInit, ControlValueAccessor {
16
- @Input() iconInput?: string;
17
- @Input() inputSpanAfter: string = null;
18
- @ViewChild('inputText', { read: ElementRef, static: true}) inputTextEdit;
19
- @Input() campoFoco: string;
20
- showSeePassword!: boolean;
21
- @Input() showCustomAction: boolean = false;
22
- @Input() customActionIcon: string = "search-outline";
23
- @Output() customActionClick = new EventEmitter();
24
- //control value acessor
25
- public data!: string | undefined;
26
- private onChange: Function = (data: string) => {};
27
- private onTouch: Function = () => {};
28
- private disabled: boolean = false;
29
- public console = console;
30
-
31
- writeValue(value?: any): void {
32
- //console.log('write value', value);
33
- this.onChange(value);
34
- this.data = value;
35
- }
36
- registerOnChange(fn: any): void {
37
- this.onChange = fn;
38
- }
39
- registerOnTouched(fn: any): void {
40
- this.onTouch = fn;
41
- }
42
- setDisabledState?(isDisabled: boolean): void {
43
- this.disabled = this.disabled;
44
- }
45
- constructor() {
46
- super();
47
- }
48
-
49
- override ngOnInit(): void {
50
- }
51
-
52
- onBlur() {
53
- console.log('control name', this.formControlName);
54
- if (this.form) {
55
- this.form.get(this.formControlName)?.markAsTouched();
56
- }
57
- }
58
-
59
- limparClick() {
60
- this.writeValue(undefined);
61
- }
62
-
63
- isReadonly() {
64
- return this.leitura;
65
- }
66
- changeTypeOfInput() {
67
- this.type =
68
- this.type == 'password' ?
69
- 'text' : 'password';
70
- }
71
- setFocus() {
72
- this.inputTextEdit.nativeElement.setFocus();
73
- }
74
-
75
- customClick() {
76
- this.customActionClick.emit();
77
- }
78
- }
@@ -1,32 +0,0 @@
1
- <!--
2
- <div [formGroup]="form">
3
- -->
4
- <div>
5
- <ion-item lines="none" style="--background-focused: transparent;" [class]="itemClass"
6
- [ngClass]="form?.get(formControlName)?.errors && (form?.get(formControlName)?.dirty || form?.get(formControlName)?.touched) ? 'error-shake' : '' "
7
- >
8
- <ion-label position="{{ labelPosition }}">{{ label }}</ion-label>
9
- <!-- formControlName="{{ formControlName }}" -->
10
- <ion-input #inputValor
11
- type="text"
12
- [placeholder]="placeholder"
13
- maxlength="{{ max }}"
14
- (ionBlur)="onBlur()"
15
- [value]="data"
16
- (input)="writeValue(inputValor.value)"
17
- (keypress)="digitarValor($event)"
18
- [clearInput]="botaoLimpar"
19
- [disabled]="readonly"></ion-input>
20
- </ion-item>
21
-
22
- <div class="validation-errors" *ngIf="form">
23
-
24
- <ng-container *ngFor="let validation of validation_messages">
25
- <div class="error-message"
26
- *ngIf="form.get(formControlName)?.hasError(validation.type) && (form.get(formControlName)?.dirty || form.get(formControlName)?.touched)">
27
- &#8226; {{ validation.message }}
28
- </div>
29
- </ng-container>
30
-
31
- </div>
32
- </div>
@@ -1,47 +0,0 @@
1
- /*
2
- ion-label {
3
- margin-bottom: 4px !important;
4
- opacity: 1 !important;
5
- overflow: initial !important;
6
- }
7
- */
8
-
9
- /*
10
- ion-input {
11
- padding: 4px;
12
- border: 1px solid darkgray;
13
- border-radius: 4px;
14
- width: 100%;
15
- max-height: 27px;
16
- text-align: right;
17
- }
18
- */
19
-
20
- .item-inner {
21
- padding-right: 0px !important;
22
- }
23
-
24
- /*
25
- .no-padding {
26
- --inner-padding-end: 0px; --padding-start: 0px;
27
- --padding-bottom: 0px;
28
- --inner-padding-bottom: 0px;
29
- height: 39px !important;
30
- }
31
- */
32
-
33
- .label-right {
34
- ion-label{
35
- transform-origin: right top;
36
- align-self: flex-end;
37
- //margin-bottom: 4% !important;
38
- }
39
- }
40
-
41
- .align-to-right {
42
- ion-label {
43
- position: relative;
44
- left: 25%;
45
- text-align: end;
46
- }
47
- }
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { InputValorComponent } from './input-valor.component';
4
-
5
- describe('InputValorComponent', () => {
6
- let component: InputValorComponent;
7
- let fixture: ComponentFixture<InputValorComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- declarations: [ InputValorComponent ]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(InputValorComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,164 +0,0 @@
1
- import { Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core';
2
- import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
3
- import { BaseInputComponent } from '../baseInputComponent';
4
-
5
- @Component({
6
- selector: 'kb-input-valor',
7
- templateUrl: './input-valor.component.html',
8
- styleUrls: ['./input-valor.component.scss', './../baseComponent.scss'],
9
- providers: [{
10
- provide: NG_VALUE_ACCESSOR,
11
- useExisting: InputValorComponent,
12
- multi: true
13
- }]
14
- })
15
- export class InputValorComponent extends BaseInputComponent implements OnInit, ControlValueAccessor {
16
- @Input() maxValor: number = null;
17
- @ViewChild('inputValor', { read: ElementRef, static: true}) inputValorEdit;
18
- //control value acessor
19
- public data: string | any;
20
- private onChange: Function = (data: string) => { };
21
- private onTouch: Function = () => { };
22
- private disabled: boolean = false;
23
- public console = console;
24
-
25
- writeValue(value: string | any): void {
26
- //console.log('write value', value);
27
- this.onChange(value);
28
- this.data = value;
29
- }
30
- registerOnChange(fn: any): void {
31
- this.onChange = fn;
32
- }
33
- registerOnTouched(fn: any): void {
34
- this.onTouch = fn;
35
- }
36
- setDisabledState?(isDisabled: boolean): void {
37
- this.disabled = this.disabled;
38
- }
39
-
40
- constructor() {
41
- super();
42
- }
43
-
44
- override ngOnInit() { }
45
-
46
- onBlur() {
47
- if (this.form) {
48
- this.form.get(this.formControlName)?.markAsTouched();
49
- }
50
- //verificar o valor
51
- if (this.maxValor) {
52
- if (this.form) {
53
- //console.log(this.form.get(this.formControlName).value);
54
- let valor = this.strToFloatZero(this.form.get(this.formControlName).value);
55
- if (valor > this.maxValor) {
56
- this.form.patchValue({
57
- [this.formControlName]: this.converterValorDecimalMil((this.maxValor * 100).toString())
58
- });
59
- }
60
- } else {
61
- let valor = this.strToFloatZero(this.data);
62
- if (valor > this.maxValor) {
63
- this.data = this.converterValorDecimalMil((this.maxValor * 100).toString());
64
- this.writeValue(this.data);
65
- }
66
- }
67
- }
68
- if (this.blur) {
69
- this.blur.emit(this.blurArgs);
70
- }
71
- }
72
-
73
- digitarValor(event: any) {
74
- //this.item.vendaunitario = this.utils.converterValorDecimal(this.item.vendaunitario);
75
- setTimeout(() => {
76
- if (this.form) {
77
- this.form.patchValue({
78
- [this.formControlName]: this.converterValorDecimalMil(this.form.get(this.formControlName)?.value)
79
- });
80
- } else {
81
- this.data = this.converterValorDecimalMil(this.data);
82
- this.writeValue(this.data);
83
- }
84
- }, 100);
85
-
86
- return true;
87
- }
88
-
89
- isEmpty(str: string | any): boolean {
90
- return str == null || str == undefined || str == '';
91
- }
92
-
93
- converterValorDecimalMil(campo: string, casas: number = 2): string {
94
- if (!this.isEmpty(campo)) {
95
- //console.log('converterValorDecimal');
96
- //console.log('campo:', campo, ' replaced: ', campo.replace(',', '').replace('.', ''));
97
- if (campo == '-') {
98
- return campo;
99
- }
100
-
101
- let valor = parseFloat(campo.replace(',', '').replace('.', '').replace('.', '').replace('.', ''));
102
-
103
- if (isNaN(valor)) {
104
- return '';
105
- }
106
-
107
- let valordiv = parseInt("1" + this.stringOfChar("0", casas));
108
- //valor /= 100;
109
- console.log(valor, '/', valordiv);
110
- valor /= valordiv;
111
- console.log('=', valor);
112
- return this.decimalToStringMil(valor);
113
- /*
114
- var str = valor.toString().replace('.', ',');
115
- var aStr = str.split(',');
116
- if (aStr.length == 1) {
117
- //str += ',00';
118
- str += ',' + this.stringOfChar('0', casas);
119
- }
120
- else {
121
- //str += this.stringOfChar('0', 2 - aStr[1].length);
122
- str += this.stringOfChar('0', casas - aStr[1].length);
123
- }
124
- return str;
125
- */
126
- }
127
- else
128
- return campo;
129
- }
130
-
131
- decimalToStringMil(number?: any) {
132
- if (number != null) {
133
- if (number == 0 || number == '0') {
134
- return '0,00';
135
- }
136
- //console.log(number);
137
- let numero = number.toFixed(2).split('.');
138
- numero[0] = numero[0].split(/(?=(?:...)*$)/).join('.');
139
- return numero.join(',').replace('-.', '-');
140
- } else
141
- return '';
142
- }
143
-
144
- stringOfChar(str: string, tam: number): string {
145
- var res = '';
146
- for (var i = 0; i < tam; i++) {
147
- res += str;
148
- }
149
- return res;
150
- }
151
-
152
- strToFloatZero(str): number {
153
- if (Number.isFinite(str))
154
- return str;
155
- if (this.isEmpty(str))
156
- return 0;
157
- else
158
- return parseFloat(str.replace('.', '').replace(',', '.'));
159
- }
160
-
161
- setFocus() {
162
- this.inputValorEdit.nativeElement.setFocus();
163
- }
164
- }
@@ -1,20 +0,0 @@
1
- <ion-header>
2
- <ion-toolbar color="secondary">
3
- <ion-title>{{ titulo }}</ion-title>
4
- <ion-buttons slot="end">
5
- <ion-button (click)="atualizaArvoreEntidade(tipo)">
6
- <ion-icon slot="icon-only" name="refresh"></ion-icon>
7
- </ion-button>
8
- <ion-button (click)="modalCtrl.dismiss()">Fechar</ion-button>
9
- </ion-buttons>
10
- </ion-toolbar>
11
- </ion-header>
12
-
13
- <ion-content>
14
- <ion-item>
15
- <ion-button style="box-shadow: #4c8dff 0px 2px 2px 0.05px;" fill="outline" (click)="expandir()">
16
- <ion-icon name="expand-outline"></ion-icon>
17
- </ion-button>
18
- </ion-item>
19
- <kb-tree-view #treeViewComp [campoId]="campoId" [campoPai]="campoPai" [campoLabel]="'LabelTree'" (selecionarRegistro)="clickRegistro($event)"></kb-tree-view>
20
- </ion-content>