appproject-components 1.0.48 → 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 (154) hide show
  1. package/README.md +24 -24
  2. package/karma.conf.js +44 -0
  3. package/ng-package.json +7 -0
  4. package/package.json +15 -26
  5. package/src/lib/appproject-components.component.spec.ts +23 -0
  6. package/src/lib/appproject-components.component.ts +20 -0
  7. package/src/lib/appproject-components.module.ts +106 -0
  8. package/src/lib/appproject-components.service.spec.ts +16 -0
  9. package/src/lib/appproject-components.service.ts +9 -0
  10. package/src/lib/baseComponent.scss +162 -0
  11. package/src/lib/baseInputComponent.ts +35 -0
  12. package/src/lib/buttons/baseBtnComponent.ts +38 -0
  13. package/src/lib/buttons/btn-action/btn-action.component.html +11 -0
  14. package/src/lib/buttons/btn-action/btn-action.component.scss +7 -0
  15. package/src/lib/buttons/btn-action/btn-action.component.spec.ts +24 -0
  16. package/src/lib/buttons/btn-action/btn-action.component.ts +31 -0
  17. package/src/lib/buttons/btn-cancelar/btn-cancelar.component.html +14 -0
  18. package/src/lib/buttons/btn-cancelar/btn-cancelar.component.scss +5 -0
  19. package/src/lib/buttons/btn-cancelar/btn-cancelar.component.spec.ts +24 -0
  20. package/src/lib/buttons/btn-cancelar/btn-cancelar.component.ts +19 -0
  21. package/src/lib/buttons/btn-excluir/btn-excluir.component.html +6 -0
  22. package/src/lib/buttons/btn-excluir/btn-excluir.component.scss +5 -0
  23. package/src/lib/buttons/btn-excluir/btn-excluir.component.spec.ts +24 -0
  24. package/src/lib/buttons/btn-excluir/btn-excluir.component.ts +18 -0
  25. package/src/lib/buttons/btn-novo/btn-novo.component.html +14 -0
  26. package/src/lib/buttons/btn-novo/btn-novo.component.scss +8 -0
  27. package/src/lib/buttons/btn-novo/btn-novo.component.spec.ts +24 -0
  28. package/src/lib/buttons/btn-novo/btn-novo.component.ts +20 -0
  29. package/src/lib/buttons/btn-salvar/btn-salvar.component.html +8 -0
  30. package/src/lib/buttons/btn-salvar/btn-salvar.component.scss +5 -0
  31. package/src/lib/buttons/btn-salvar/btn-salvar.component.spec.ts +24 -0
  32. package/src/lib/buttons/btn-salvar/btn-salvar.component.ts +16 -0
  33. package/src/lib/entity-edit/entity-edit.component.html +143 -0
  34. package/src/lib/entity-edit/entity-edit.component.scss +4 -0
  35. package/src/lib/entity-edit/entity-edit.component.spec.ts +23 -0
  36. package/src/lib/entity-edit/entity-edit.component.ts +43 -0
  37. package/src/lib/grid-view/grid-view.component.html +116 -0
  38. package/src/lib/grid-view/grid-view.component.scss +47 -0
  39. package/src/lib/grid-view/grid-view.component.spec.ts +23 -0
  40. package/src/lib/grid-view/grid-view.component.ts +292 -0
  41. package/src/lib/input-area/input-area.component.html +30 -0
  42. package/src/lib/input-area/input-area.component.scss +68 -0
  43. package/src/lib/input-area/input-area.component.spec.ts +23 -0
  44. package/src/lib/input-area/input-area.component.ts +69 -0
  45. package/src/lib/input-arquivo/input-arquivo.component.html +11 -0
  46. package/src/lib/input-arquivo/input-arquivo.component.scss +0 -0
  47. package/src/lib/input-arquivo/input-arquivo.component.spec.ts +23 -0
  48. package/src/lib/input-arquivo/input-arquivo.component.ts +140 -0
  49. package/src/lib/input-cep/input-cep.component.html +38 -0
  50. package/src/lib/input-cep/input-cep.component.scss +0 -0
  51. package/src/lib/input-cep/input-cep.component.spec.ts +23 -0
  52. package/src/lib/input-cep/input-cep.component.ts +186 -0
  53. package/src/lib/input-checkbox/input-checkbox.component.html +12 -0
  54. package/src/lib/input-checkbox/input-checkbox.component.scss +11 -0
  55. package/src/lib/input-checkbox/input-checkbox.component.spec.ts +23 -0
  56. package/src/lib/input-checkbox/input-checkbox.component.ts +48 -0
  57. package/src/lib/input-format/input-format.component.html +32 -0
  58. package/src/lib/input-format/input-format.component.scss +47 -0
  59. package/src/lib/input-format/input-format.component.spec.ts +23 -0
  60. package/src/lib/input-format/input-format.component.ts +139 -0
  61. package/src/lib/input-pesquisa/input-pesquisa.component.html +77 -0
  62. package/src/lib/input-pesquisa/input-pesquisa.component.scss +127 -0
  63. package/src/lib/input-pesquisa/input-pesquisa.component.spec.ts +23 -0
  64. package/src/lib/input-pesquisa/input-pesquisa.component.ts +558 -0
  65. package/src/lib/input-radio/input-radio.component.html +21 -0
  66. package/src/lib/input-radio/input-radio.component.scss +3 -0
  67. package/src/lib/input-radio/input-radio.component.spec.ts +23 -0
  68. package/src/lib/input-radio/input-radio.component.ts +49 -0
  69. package/src/lib/input-select/input-select.component.html +29 -0
  70. package/src/lib/input-select/input-select.component.scss +62 -0
  71. package/src/lib/input-select/input-select.component.spec.ts +23 -0
  72. package/src/lib/input-select/input-select.component.ts +96 -0
  73. package/src/lib/input-text/input-text.component.html +48 -0
  74. package/src/lib/input-text/input-text.component.scss +63 -0
  75. package/src/lib/input-text/input-text.component.spec.ts +23 -0
  76. package/src/lib/input-text/input-text.component.ts +78 -0
  77. package/src/lib/input-valor/input-valor.component.html +32 -0
  78. package/src/lib/input-valor/input-valor.component.scss +47 -0
  79. package/src/lib/input-valor/input-valor.component.spec.ts +23 -0
  80. package/src/lib/input-valor/input-valor.component.ts +164 -0
  81. package/{lib/lib-config.d.ts → src/lib/lib-config.ts} +4 -3
  82. package/src/lib/model-treeview/model-treeview.component.html +20 -0
  83. package/src/lib/model-treeview/model-treeview.component.scss +0 -0
  84. package/src/lib/model-treeview/model-treeview.component.spec.ts +23 -0
  85. package/src/lib/model-treeview/model-treeview.component.ts +152 -0
  86. package/src/lib/tree-view/tree-view.component.html +96 -0
  87. package/src/lib/tree-view/tree-view.component.scss +50 -0
  88. package/src/lib/tree-view/tree-view.component.spec.ts +23 -0
  89. package/src/lib/tree-view/tree-view.component.ts +92 -0
  90. package/src/lib/tree-view-nivel/tree-view-nivel.component.html +17 -0
  91. package/src/lib/tree-view-nivel/tree-view-nivel.component.scss +8 -0
  92. package/src/lib/tree-view-nivel/tree-view-nivel.component.spec.ts +23 -0
  93. package/src/lib/tree-view-nivel/tree-view-nivel.component.ts +43 -0
  94. package/{public-api.d.ts → src/public-api.ts} +30 -24
  95. package/src/test.ts +15 -0
  96. package/tsconfig.lib.json +15 -0
  97. package/tsconfig.lib.prod.json +10 -0
  98. package/tsconfig.spec.json +17 -0
  99. package/esm2022/appproject-components.mjs +0 -5
  100. package/esm2022/lib/appproject-components.component.mjs +0 -22
  101. package/esm2022/lib/appproject-components.module.mjs +0 -159
  102. package/esm2022/lib/appproject-components.service.mjs +0 -14
  103. package/esm2022/lib/baseInputComponent.mjs +0 -69
  104. package/esm2022/lib/buttons/baseBtnComponent.mjs +0 -63
  105. package/esm2022/lib/buttons/btn-action/btn-action.component.mjs +0 -55
  106. package/esm2022/lib/buttons/btn-cancelar/btn-cancelar.component.mjs +0 -25
  107. package/esm2022/lib/buttons/btn-excluir/btn-excluir.component.mjs +0 -29
  108. package/esm2022/lib/buttons/btn-novo/btn-novo.component.mjs +0 -33
  109. package/esm2022/lib/buttons/btn-salvar/btn-salvar.component.mjs +0 -19
  110. package/esm2022/lib/entity-edit/entity-edit.component.mjs +0 -53
  111. package/esm2022/lib/grid-view/grid-view.component.mjs +0 -275
  112. package/esm2022/lib/input-area/input-area.component.mjs +0 -72
  113. package/esm2022/lib/input-arquivo/input-arquivo.component.mjs +0 -154
  114. package/esm2022/lib/input-cep/input-cep.component.mjs +0 -180
  115. package/esm2022/lib/input-checkbox/input-checkbox.component.mjs +0 -51
  116. package/esm2022/lib/input-format/input-format.component.mjs +0 -138
  117. package/esm2022/lib/input-pesquisa/input-pesquisa.component.mjs +0 -557
  118. package/esm2022/lib/input-radio/input-radio.component.mjs +0 -58
  119. package/esm2022/lib/input-select/input-select.component.mjs +0 -110
  120. package/esm2022/lib/input-text/input-text.component.mjs +0 -88
  121. package/esm2022/lib/input-valor/input-valor.component.mjs +0 -161
  122. package/esm2022/lib/lib-config.mjs +0 -2
  123. package/esm2022/lib/model-treeview/model-treeview.component.mjs +0 -126
  124. package/esm2022/lib/tree-view/tree-view.component.mjs +0 -104
  125. package/esm2022/lib/tree-view-nivel/tree-view-nivel.component.mjs +0 -50
  126. package/esm2022/public-api.mjs +0 -30
  127. package/fesm2022/appproject-components.mjs +0 -2531
  128. package/fesm2022/appproject-components.mjs.map +0 -1
  129. package/index.d.ts +0 -5
  130. package/lib/appproject-components.component.d.ts +0 -8
  131. package/lib/appproject-components.module.d.ts +0 -36
  132. package/lib/appproject-components.service.d.ts +0 -6
  133. package/lib/baseInputComponent.d.ts +0 -28
  134. package/lib/buttons/baseBtnComponent.d.ts +0 -19
  135. package/lib/buttons/btn-action/btn-action.component.d.ts +0 -21
  136. package/lib/buttons/btn-cancelar/btn-cancelar.component.d.ts +0 -10
  137. package/lib/buttons/btn-excluir/btn-excluir.component.d.ts +0 -12
  138. package/lib/buttons/btn-novo/btn-novo.component.d.ts +0 -13
  139. package/lib/buttons/btn-salvar/btn-salvar.component.d.ts +0 -9
  140. package/lib/entity-edit/entity-edit.component.d.ts +0 -22
  141. package/lib/grid-view/grid-view.component.d.ts +0 -52
  142. package/lib/input-area/input-area.component.d.ts +0 -24
  143. package/lib/input-arquivo/input-arquivo.component.d.ts +0 -43
  144. package/lib/input-cep/input-cep.component.d.ts +0 -29
  145. package/lib/input-checkbox/input-checkbox.component.d.ts +0 -21
  146. package/lib/input-format/input-format.component.d.ts +0 -27
  147. package/lib/input-pesquisa/input-pesquisa.component.d.ts +0 -69
  148. package/lib/input-radio/input-radio.component.d.ts +0 -23
  149. package/lib/input-select/input-select.component.d.ts +0 -32
  150. package/lib/input-text/input-text.component.d.ts +0 -33
  151. package/lib/input-valor/input-valor.component.d.ts +0 -29
  152. package/lib/model-treeview/model-treeview.component.d.ts +0 -39
  153. package/lib/tree-view/tree-view.component.d.ts +0 -23
  154. package/lib/tree-view-nivel/tree-view-nivel.component.d.ts +0 -17
@@ -1,2531 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, Component, EventEmitter, Input, Output, ElementRef, ViewChild, Inject, InjectionToken, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
3
- import * as i3 from '@angular/forms';
4
- import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
- import * as i1 from '@angular/common';
6
- import { CommonModule } from '@angular/common';
7
- import * as i2 from '@ionic/angular';
8
- import { IonicModule } from '@ionic/angular';
9
- import * as i2$1 from '@angular/common/http';
10
- import { HttpClientModule } from '@angular/common/http';
11
- import { Subject, of, Observable } from 'rxjs';
12
- import { debounceTime, switchMap } from 'rxjs/operators';
13
- import * as i1$1 from '@angular/platform-browser';
14
- import * as i4 from 'appproject-lib';
15
- import { GridTabela, LibService, ValorFormatPipe, SafeHtmlPipe } from 'appproject-lib';
16
-
17
- class AppprojectComponentsService {
18
- constructor() { }
19
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: AppprojectComponentsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
20
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: AppprojectComponentsService, providedIn: 'root' }); }
21
- }
22
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: AppprojectComponentsService, decorators: [{
23
- type: Injectable,
24
- args: [{
25
- providedIn: 'root'
26
- }]
27
- }], ctorParameters: () => [] });
28
-
29
- class AppprojectComponentsComponent {
30
- constructor() { }
31
- ngOnInit() {
32
- }
33
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: AppprojectComponentsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
34
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: AppprojectComponentsComponent, selector: "kb-appproject-components", ngImport: i0, template: `
35
- <p>
36
- appproject-components works!
37
- </p>
38
- `, isInline: true }); }
39
- }
40
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: AppprojectComponentsComponent, decorators: [{
41
- type: Component,
42
- args: [{ selector: 'kb-appproject-components', template: `
43
- <p>
44
- appproject-components works!
45
- </p>
46
- ` }]
47
- }], ctorParameters: () => [] });
48
-
49
- class BaseInputComponent {
50
- constructor() {
51
- this.labelPosition = 'stacked';
52
- this.placeholder = '';
53
- this.max = '10';
54
- this.type = "text";
55
- this.readonly = false;
56
- this.leitura = false;
57
- this.itemClass = "padding";
58
- this.blur = new EventEmitter();
59
- this.botaoLimpar = false;
60
- this.labelColor = 'dark';
61
- this.inputBackgroungColor = 'auto';
62
- this.focusField = false;
63
- }
64
- ngOnInit() {
65
- throw new Error('Method not implemented.');
66
- }
67
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: BaseInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
68
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: BaseInputComponent, selector: "ng-component", inputs: { label: "label", labelPosition: "labelPosition", nome: "nome", placeholder: "placeholder", form: "form", campo: "campo", formControlName: "formControlName", max: "max", validation_messages: "validation_messages", type: "type", readonly: "readonly", leitura: "leitura", itemClass: "itemClass", botaoLimpar: "botaoLimpar", labelColor: "labelColor", inputBackgroungColor: "inputBackgroungColor", focusField: "focusField", blurArgs: "blurArgs" }, outputs: { blur: "blur" }, ngImport: i0, template: '', isInline: true }); }
69
- }
70
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: BaseInputComponent, decorators: [{
71
- type: Component,
72
- args: [{
73
- template: ''
74
- }]
75
- }], ctorParameters: () => [], propDecorators: { label: [{
76
- type: Input
77
- }], labelPosition: [{
78
- type: Input
79
- }], nome: [{
80
- type: Input
81
- }], placeholder: [{
82
- type: Input
83
- }], form: [{
84
- type: Input
85
- }], campo: [{
86
- type: Input
87
- }], formControlName: [{
88
- type: Input,
89
- args: ['formControlName']
90
- }], max: [{
91
- type: Input
92
- }], validation_messages: [{
93
- type: Input
94
- }], type: [{
95
- type: Input
96
- }], readonly: [{
97
- type: Input
98
- }], leitura: [{
99
- type: Input
100
- }], itemClass: [{
101
- type: Input
102
- }], blur: [{
103
- type: Output
104
- }], botaoLimpar: [{
105
- type: Input
106
- }], labelColor: [{
107
- type: Input
108
- }], inputBackgroungColor: [{
109
- type: Input
110
- }], focusField: [{
111
- type: Input
112
- }], blurArgs: [{
113
- type: Input
114
- }] } });
115
-
116
- class InputTextComponent extends BaseInputComponent {
117
- writeValue(value) {
118
- //console.log('write value', value);
119
- this.onChange(value);
120
- this.data = value;
121
- }
122
- registerOnChange(fn) {
123
- this.onChange = fn;
124
- }
125
- registerOnTouched(fn) {
126
- this.onTouch = fn;
127
- }
128
- setDisabledState(isDisabled) {
129
- this.disabled = this.disabled;
130
- }
131
- constructor() {
132
- super();
133
- this.inputSpanAfter = null;
134
- this.showCustomAction = false;
135
- this.customActionIcon = "search-outline";
136
- this.customActionClick = new EventEmitter();
137
- this.onChange = (data) => { };
138
- this.onTouch = () => { };
139
- this.disabled = false;
140
- this.console = console;
141
- }
142
- ngOnInit() {
143
- }
144
- onBlur() {
145
- console.log('control name', this.formControlName);
146
- if (this.form) {
147
- this.form.get(this.formControlName)?.markAsTouched();
148
- }
149
- }
150
- limparClick() {
151
- this.writeValue(undefined);
152
- }
153
- isReadonly() {
154
- return this.leitura;
155
- }
156
- changeTypeOfInput() {
157
- this.type =
158
- this.type == 'password' ?
159
- 'text' : 'password';
160
- }
161
- setFocus() {
162
- this.inputTextEdit.nativeElement.setFocus();
163
- }
164
- customClick() {
165
- this.customActionClick.emit();
166
- }
167
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: InputTextComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
168
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: InputTextComponent, selector: "kb-input-text", inputs: { iconInput: "iconInput", inputSpanAfter: "inputSpanAfter", campoFoco: "campoFoco", showCustomAction: "showCustomAction", customActionIcon: "customActionIcon" }, outputs: { customActionClick: "customActionClick" }, providers: [{
169
- provide: NG_VALUE_ACCESSOR,
170
- useExisting: InputTextComponent,
171
- multi: true
172
- }], viewQueries: [{ propertyName: "inputTextEdit", first: true, predicate: ["inputText"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<!--\r\n<div [formGroup]=\"form\">\r\n [style.opacity]=\"readonly ? '0.8' : '1'\"\r\n-->\r\n<div>\r\n <ion-item lines=\"none\" style=\"--background: inherited; --background-focused: transparent; padding-right: 0px;\" [class]=\"itemClass\" \r\n [ngClass]=\"form?.get(formControlName)?.errors && (form?.get(formControlName)?.dirty || form?.get(formControlName)?.touched) ? 'error-shake' : '' \"\r\n >\r\n <ion-label position=\"{{ labelPosition }}\">{{ label }}&nbsp;</ion-label>\r\n <!-- formControlName=\"{{ campo }}\" -->\r\n <ion-input #inputText\r\n type=\"{{type}}\" \r\n [placeholder]=\"placeholder\" \r\n maxlength=\"{{ max }}\"\r\n (ionBlur)=\"onBlur()\"\r\n [value]=\"data\"\r\n (input)=\"writeValue(inputText.value)\" \r\n autocomplete=\"new-password\"\r\n [style.--background]=\"inputBackgroungColor\"\r\n [disabled]=\"readonly\"\r\n [clearInput]=\"botaoLimpar\">\r\n <ion-icon *ngIf=\"iconInput\" name=\"{{ iconInput }}\"></ion-icon>\r\n </ion-input>\r\n \r\n <ion-button size=\"small\" slot=\"end\" *ngIf=\"showSeePassword\" style=\"margin-top: 27px; margin-inline-start: 4px !important;\" fill=\"clear\" color=\"dark\" (click)=\"changeTypeOfInput()\">\r\n <!-- (click)=\"limparClick()\" -->\r\n <ion-icon [name]=\"type == 'password' ? 'eye-outline' : 'eye-off-outline' \"></ion-icon>\r\n </ion-button>\r\n\r\n <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()\">\r\n <!-- (click)=\"limparClick()\" -->\r\n <ion-icon slot=\"icon-only\" [name]=\"customActionIcon\"></ion-icon>\r\n </ion-button>\r\n\r\n <span *ngIf=\"inputSpanAfter\" slot=\"end\" class=\"inputSpanAfter-item\">&nbsp;{{ inputSpanAfter }}</span>\r\n </ion-item>\r\n \r\n <div class=\"validation-errors\" *ngIf=\"form\">\r\n \r\n <ng-container *ngFor=\"let validation of validation_messages\">\r\n <div class=\"error-message\"\r\n *ngIf=\"form.get(formControlName)?.hasError(validation.type) && (form.get(formControlName)?.dirty || form.get(formControlName)?.touched)\">\r\n &#8226; {{ validation.message }}\r\n </div>\r\n </ng-container>\r\n \r\n </div>\r\n </div>", styles: [".no-padding-end{--inner-padding-end: 0}ion-input ion-icon{padding-right:6px;font-size:18px}.input-login{height:36px}\n", "@charset \"UTF-8\";ion-label{margin-bottom:4px!important;--color: var(--ion-color-label, auto) !important}ion-item ion-label{overflow:initial!important}ion-input{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;max-height:var(--input-max-height, 29px);transition:.2s ease}.has-focus{border:1px solid var(--ion-color-bluetool, #1f477d)}input:focus{border:1px solid lightblue!important}input:focus ion-input,input:focus ion-textarea{border:1px solid lightblue!important}input:focus ion-label{--color: var(--ion-color-label-focus, blue) !important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-input,.item-has-focus ion-textarea{border:1px solid lightblue!important}.native-input[disabled]{opacity:var(--item-disabled-opacity, .6)!important;background-color:transparent}.item-interactive-disabled ion-label{opacity:var(--item-disabled-opacity, .6)}.error-message{font-size:small;color:var(--error-text-color, red);margin-left:15px}.padding{padding:auto}.no-padding{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px;height:55px!important}.no-padding-end{--inner-padding-end: 0px}.no-padding-start{--padding-start: 0px !important}.no-padding-no-height{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px}.padding-top{--padding-top: 0px}.item-inner{padding-right:0!important}.label-right ion-label{transform-origin:right top;align-self:flex-end;margin-bottom:4%!important}.align-to-right ion-label{position:relative;left:25%;text-align:end}.error-input ion-input,.error-shake ion-input{animation:shake .4s 1 linear;border:1px solid var(--error-text-color, red)!important}@keyframes shake{0%{transform:translate(20px)}20%{transform:translate(-20px)}40%{transform:translate(10px)}60%{transform:translate(-10px)}80%{transform:translate(4px)}to{transform:translate(0)}}.error-input ion-label,.error-shake ion-label{color:var(--error-text-color, red)!important}.error-input ion-input,.error-shake ion-input{border:1px solid red!important}.error-shake ion-input{animation:shake .4s 1 linear}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i2.IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "legacy", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "shape", "size", "spellcheck", "step", "type", "value"] }, { kind: "component", type: i2.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "counterFormatter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { kind: "component", type: i2.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "directive", type: i2.TextValueAccessor, selector: "ion-input:not([type=number]),ion-textarea,ion-searchbar" }] }); }
173
- }
174
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: InputTextComponent, decorators: [{
175
- type: Component,
176
- args: [{ selector: 'kb-input-text', providers: [{
177
- provide: NG_VALUE_ACCESSOR,
178
- useExisting: InputTextComponent,
179
- multi: true
180
- }], template: "<!--\r\n<div [formGroup]=\"form\">\r\n [style.opacity]=\"readonly ? '0.8' : '1'\"\r\n-->\r\n<div>\r\n <ion-item lines=\"none\" style=\"--background: inherited; --background-focused: transparent; padding-right: 0px;\" [class]=\"itemClass\" \r\n [ngClass]=\"form?.get(formControlName)?.errors && (form?.get(formControlName)?.dirty || form?.get(formControlName)?.touched) ? 'error-shake' : '' \"\r\n >\r\n <ion-label position=\"{{ labelPosition }}\">{{ label }}&nbsp;</ion-label>\r\n <!-- formControlName=\"{{ campo }}\" -->\r\n <ion-input #inputText\r\n type=\"{{type}}\" \r\n [placeholder]=\"placeholder\" \r\n maxlength=\"{{ max }}\"\r\n (ionBlur)=\"onBlur()\"\r\n [value]=\"data\"\r\n (input)=\"writeValue(inputText.value)\" \r\n autocomplete=\"new-password\"\r\n [style.--background]=\"inputBackgroungColor\"\r\n [disabled]=\"readonly\"\r\n [clearInput]=\"botaoLimpar\">\r\n <ion-icon *ngIf=\"iconInput\" name=\"{{ iconInput }}\"></ion-icon>\r\n </ion-input>\r\n \r\n <ion-button size=\"small\" slot=\"end\" *ngIf=\"showSeePassword\" style=\"margin-top: 27px; margin-inline-start: 4px !important;\" fill=\"clear\" color=\"dark\" (click)=\"changeTypeOfInput()\">\r\n <!-- (click)=\"limparClick()\" -->\r\n <ion-icon [name]=\"type == 'password' ? 'eye-outline' : 'eye-off-outline' \"></ion-icon>\r\n </ion-button>\r\n\r\n <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()\">\r\n <!-- (click)=\"limparClick()\" -->\r\n <ion-icon slot=\"icon-only\" [name]=\"customActionIcon\"></ion-icon>\r\n </ion-button>\r\n\r\n <span *ngIf=\"inputSpanAfter\" slot=\"end\" class=\"inputSpanAfter-item\">&nbsp;{{ inputSpanAfter }}</span>\r\n </ion-item>\r\n \r\n <div class=\"validation-errors\" *ngIf=\"form\">\r\n \r\n <ng-container *ngFor=\"let validation of validation_messages\">\r\n <div class=\"error-message\"\r\n *ngIf=\"form.get(formControlName)?.hasError(validation.type) && (form.get(formControlName)?.dirty || form.get(formControlName)?.touched)\">\r\n &#8226; {{ validation.message }}\r\n </div>\r\n </ng-container>\r\n \r\n </div>\r\n </div>", styles: [".no-padding-end{--inner-padding-end: 0}ion-input ion-icon{padding-right:6px;font-size:18px}.input-login{height:36px}\n", "@charset \"UTF-8\";ion-label{margin-bottom:4px!important;--color: var(--ion-color-label, auto) !important}ion-item ion-label{overflow:initial!important}ion-input{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;max-height:var(--input-max-height, 29px);transition:.2s ease}.has-focus{border:1px solid var(--ion-color-bluetool, #1f477d)}input:focus{border:1px solid lightblue!important}input:focus ion-input,input:focus ion-textarea{border:1px solid lightblue!important}input:focus ion-label{--color: var(--ion-color-label-focus, blue) !important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-input,.item-has-focus ion-textarea{border:1px solid lightblue!important}.native-input[disabled]{opacity:var(--item-disabled-opacity, .6)!important;background-color:transparent}.item-interactive-disabled ion-label{opacity:var(--item-disabled-opacity, .6)}.error-message{font-size:small;color:var(--error-text-color, red);margin-left:15px}.padding{padding:auto}.no-padding{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px;height:55px!important}.no-padding-end{--inner-padding-end: 0px}.no-padding-start{--padding-start: 0px !important}.no-padding-no-height{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px}.padding-top{--padding-top: 0px}.item-inner{padding-right:0!important}.label-right ion-label{transform-origin:right top;align-self:flex-end;margin-bottom:4%!important}.align-to-right ion-label{position:relative;left:25%;text-align:end}.error-input ion-input,.error-shake ion-input{animation:shake .4s 1 linear;border:1px solid var(--error-text-color, red)!important}@keyframes shake{0%{transform:translate(20px)}20%{transform:translate(-20px)}40%{transform:translate(10px)}60%{transform:translate(-10px)}80%{transform:translate(4px)}to{transform:translate(0)}}.error-input ion-label,.error-shake ion-label{color:var(--error-text-color, red)!important}.error-input ion-input,.error-shake ion-input{border:1px solid red!important}.error-shake ion-input{animation:shake .4s 1 linear}\n"] }]
181
- }], ctorParameters: () => [], propDecorators: { iconInput: [{
182
- type: Input
183
- }], inputSpanAfter: [{
184
- type: Input
185
- }], inputTextEdit: [{
186
- type: ViewChild,
187
- args: ['inputText', { read: ElementRef, static: true }]
188
- }], campoFoco: [{
189
- type: Input
190
- }], showCustomAction: [{
191
- type: Input
192
- }], customActionIcon: [{
193
- type: Input
194
- }], customActionClick: [{
195
- type: Output
196
- }] } });
197
-
198
- class InputFormatComponent extends BaseInputComponent {
199
- writeValue(value) {
200
- //console.log('write value', value);
201
- this.onChange(value);
202
- this.data = value;
203
- }
204
- registerOnChange(fn) {
205
- this.onChange = fn;
206
- }
207
- registerOnTouched(fn) {
208
- this.onTouch = fn;
209
- }
210
- setDisabledState(isDisabled) {
211
- this.disabled = this.disabled;
212
- }
213
- constructor() {
214
- super();
215
- this.formato = null;
216
- this.keyEnter = new EventEmitter();
217
- //control value acessor
218
- this.data = null;
219
- this.onChange = (data) => { };
220
- this.onTouch = () => { };
221
- this.disabled = false;
222
- this.console = console;
223
- }
224
- ngOnInit() { }
225
- digitarFormatado(event) {
226
- //console.log(event);
227
- const index = event.target.selectionStart >= 1 ? (event.target.selectionStart - 1) : 0;
228
- const keyAt = event.target.value.charCodeAt(index);
229
- if ((event.keyCode >= 48 && event.keyCode <= 57)
230
- || (keyAt >= 48 && keyAt <= 57)
231
- || (event.keyCode >= 96 && event.keyCode <= 105)
232
- || (event.keyCode == 8)
233
- || (event.keyCode == 9)
234
- || (event.keyCode == 39)
235
- || (event.keyCode == 37)
236
- || (event.keyCode == 46)) {
237
- //console.log(this.formControlName, this.form.get(this.formControlName).value);
238
- setTimeout(() => {
239
- if (this.form) {
240
- this.form.patchValue({
241
- [this.formControlName]: this.formataCampoValor(this.form.get(this.formControlName)?.value, this.formato ?? '', event)
242
- });
243
- }
244
- else {
245
- this.data = this.formataCampoValor(this.data ?? '', this.formato ?? '', event);
246
- this.writeValue(this.data);
247
- }
248
- }, 100);
249
- return true;
250
- }
251
- else {
252
- return false;
253
- }
254
- }
255
- onKeyEnter() {
256
- if (this.keyEnter != null) {
257
- this.keyEnter.emit();
258
- }
259
- }
260
- onBlur() {
261
- if (this.form) {
262
- this.form.get(this.formControlName)?.markAsTouched();
263
- }
264
- if (this.blur) {
265
- this.blur.emit(this.blurArgs);
266
- }
267
- }
268
- setFocus() {
269
- this.inputFormatEdit.nativeElement.setFocus();
270
- }
271
- formataCampoValor(valor, Mascara, evento) {
272
- console.log(valor);
273
- if (!valor)
274
- return null;
275
- //console.log(evento);
276
- //if (!this.keypressInteiro(evento))
277
- // return;
278
- var boleanoMascara;
279
- var Digitato = evento != null ? evento.keyCode : 0;
280
- let exp = /\-|\.|\/|\(|\)| /g;
281
- let campoSoNumeros = valor.replace(exp, "");
282
- var posicaoCampo = 0;
283
- var NovoValorCampo = "";
284
- var TamanhoMascara = campoSoNumeros.length;
285
- ;
286
- if (Digitato != 8) { // backspace
287
- for (let i = 0; i <= TamanhoMascara; i++) {
288
- boleanoMascara = ((Mascara.charAt(i) == "-") || (Mascara.charAt(i) == ".")
289
- || (Mascara.charAt(i) == "/"));
290
- boleanoMascara = boleanoMascara || ((Mascara.charAt(i) == "(")
291
- || (Mascara.charAt(i) == ")") || (Mascara.charAt(i) == " "));
292
- if (boleanoMascara) {
293
- NovoValorCampo += Mascara.charAt(i);
294
- TamanhoMascara++;
295
- }
296
- else {
297
- NovoValorCampo += campoSoNumeros.charAt(posicaoCampo);
298
- posicaoCampo++;
299
- }
300
- }
301
- return NovoValorCampo;
302
- }
303
- else {
304
- return valor;
305
- }
306
- }
307
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: InputFormatComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
308
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: InputFormatComponent, selector: "kb-input-format", inputs: { formato: "formato", keyEnter: "keyEnter" }, providers: [{
309
- provide: NG_VALUE_ACCESSOR,
310
- useExisting: InputFormatComponent,
311
- multi: true
312
- }], viewQueries: [{ propertyName: "inputFormatEdit", first: true, predicate: ["inputFormat"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<!--\r\n<div [formGroup]=\"form\">\r\n-->\r\n<!--comando --inner-padding-end: utilizado pra remover padding desnecess\u00E1rios-->\r\n<div>\r\n <ion-item lines=\"none\" style=\"--background: inherited;--background-focused: transparent;--inner-padding-end: 0px;\" [class]=\"itemClass\"\r\n [ngClass]=\"form?.get(formControlName)?.errors && (form?.get(formControlName)?.dirty || form?.get(formControlName)?.touched) ? 'error-shake' : '' \"\r\n >\r\n <ion-label [position]=\"labelPosition\">{{ label }}</ion-label>\r\n <!-- formControlName={{formControlName}} -->\r\n <ion-input #inputFormat\r\n type=\"tel\" \r\n [placeholder]=\"placeholder\"\r\n maxlength=\"{{ max }}\" \r\n (keydown)=\"digitarFormatado($event)\" \r\n (keyup.enter)=\"onKeyEnter()\"\r\n (ionBlur)=\"onBlur()\"\r\n [value]=\"data\"\r\n (input)=\"writeValue(inputFormat.value)\"\r\n [disabled]=\"readonly\"></ion-input>\r\n \r\n </ion-item>\r\n \r\n <div class=\"validation-errors\" *ngIf=\"form\">\r\n <ng-container *ngFor=\"let validation of validation_messages\">\r\n <div class=\"error-message\"\r\n *ngIf=\"form && form.get(formControlName)?.hasError(validation.type) && (form.get(formControlName)?.dirty || form.get(formControlName)?.touched)\">\r\n &#8226; {{ validation.message }}\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>", styles: [".item-inner{padding-right:0!important}\n", "@charset \"UTF-8\";ion-label{margin-bottom:4px!important;--color: var(--ion-color-label, auto) !important}ion-item ion-label{overflow:initial!important}ion-input{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;max-height:var(--input-max-height, 29px);transition:.2s ease}.has-focus{border:1px solid var(--ion-color-bluetool, #1f477d)}input:focus{border:1px solid lightblue!important}input:focus ion-input,input:focus ion-textarea{border:1px solid lightblue!important}input:focus ion-label{--color: var(--ion-color-label-focus, blue) !important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-input,.item-has-focus ion-textarea{border:1px solid lightblue!important}.native-input[disabled]{opacity:var(--item-disabled-opacity, .6)!important;background-color:transparent}.item-interactive-disabled ion-label{opacity:var(--item-disabled-opacity, .6)}.error-message{font-size:small;color:var(--error-text-color, red);margin-left:15px}.padding{padding:auto}.no-padding{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px;height:55px!important}.no-padding-end{--inner-padding-end: 0px}.no-padding-start{--padding-start: 0px !important}.no-padding-no-height{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px}.padding-top{--padding-top: 0px}.item-inner{padding-right:0!important}.label-right ion-label{transform-origin:right top;align-self:flex-end;margin-bottom:4%!important}.align-to-right ion-label{position:relative;left:25%;text-align:end}.error-input ion-input,.error-shake ion-input{animation:shake .4s 1 linear;border:1px solid var(--error-text-color, red)!important}@keyframes shake{0%{transform:translate(20px)}20%{transform:translate(-20px)}40%{transform:translate(10px)}60%{transform:translate(-10px)}80%{transform:translate(4px)}to{transform:translate(0)}}.error-input ion-label,.error-shake ion-label{color:var(--error-text-color, red)!important}.error-input ion-input,.error-shake ion-input{border:1px solid red!important}.error-shake ion-input{animation:shake .4s 1 linear}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "legacy", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "shape", "size", "spellcheck", "step", "type", "value"] }, { kind: "component", type: i2.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "counterFormatter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { kind: "component", type: i2.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "directive", type: i2.TextValueAccessor, selector: "ion-input:not([type=number]),ion-textarea,ion-searchbar" }] }); }
313
- }
314
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: InputFormatComponent, decorators: [{
315
- type: Component,
316
- args: [{ selector: 'kb-input-format', providers: [{
317
- provide: NG_VALUE_ACCESSOR,
318
- useExisting: InputFormatComponent,
319
- multi: true
320
- }], template: "<!--\r\n<div [formGroup]=\"form\">\r\n-->\r\n<!--comando --inner-padding-end: utilizado pra remover padding desnecess\u00E1rios-->\r\n<div>\r\n <ion-item lines=\"none\" style=\"--background: inherited;--background-focused: transparent;--inner-padding-end: 0px;\" [class]=\"itemClass\"\r\n [ngClass]=\"form?.get(formControlName)?.errors && (form?.get(formControlName)?.dirty || form?.get(formControlName)?.touched) ? 'error-shake' : '' \"\r\n >\r\n <ion-label [position]=\"labelPosition\">{{ label }}</ion-label>\r\n <!-- formControlName={{formControlName}} -->\r\n <ion-input #inputFormat\r\n type=\"tel\" \r\n [placeholder]=\"placeholder\"\r\n maxlength=\"{{ max }}\" \r\n (keydown)=\"digitarFormatado($event)\" \r\n (keyup.enter)=\"onKeyEnter()\"\r\n (ionBlur)=\"onBlur()\"\r\n [value]=\"data\"\r\n (input)=\"writeValue(inputFormat.value)\"\r\n [disabled]=\"readonly\"></ion-input>\r\n \r\n </ion-item>\r\n \r\n <div class=\"validation-errors\" *ngIf=\"form\">\r\n <ng-container *ngFor=\"let validation of validation_messages\">\r\n <div class=\"error-message\"\r\n *ngIf=\"form && form.get(formControlName)?.hasError(validation.type) && (form.get(formControlName)?.dirty || form.get(formControlName)?.touched)\">\r\n &#8226; {{ validation.message }}\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>", styles: [".item-inner{padding-right:0!important}\n", "@charset \"UTF-8\";ion-label{margin-bottom:4px!important;--color: var(--ion-color-label, auto) !important}ion-item ion-label{overflow:initial!important}ion-input{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;max-height:var(--input-max-height, 29px);transition:.2s ease}.has-focus{border:1px solid var(--ion-color-bluetool, #1f477d)}input:focus{border:1px solid lightblue!important}input:focus ion-input,input:focus ion-textarea{border:1px solid lightblue!important}input:focus ion-label{--color: var(--ion-color-label-focus, blue) !important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-input,.item-has-focus ion-textarea{border:1px solid lightblue!important}.native-input[disabled]{opacity:var(--item-disabled-opacity, .6)!important;background-color:transparent}.item-interactive-disabled ion-label{opacity:var(--item-disabled-opacity, .6)}.error-message{font-size:small;color:var(--error-text-color, red);margin-left:15px}.padding{padding:auto}.no-padding{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px;height:55px!important}.no-padding-end{--inner-padding-end: 0px}.no-padding-start{--padding-start: 0px !important}.no-padding-no-height{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px}.padding-top{--padding-top: 0px}.item-inner{padding-right:0!important}.label-right ion-label{transform-origin:right top;align-self:flex-end;margin-bottom:4%!important}.align-to-right ion-label{position:relative;left:25%;text-align:end}.error-input ion-input,.error-shake ion-input{animation:shake .4s 1 linear;border:1px solid var(--error-text-color, red)!important}@keyframes shake{0%{transform:translate(20px)}20%{transform:translate(-20px)}40%{transform:translate(10px)}60%{transform:translate(-10px)}80%{transform:translate(4px)}to{transform:translate(0)}}.error-input ion-label,.error-shake ion-label{color:var(--error-text-color, red)!important}.error-input ion-input,.error-shake ion-input{border:1px solid red!important}.error-shake ion-input{animation:shake .4s 1 linear}\n"] }]
321
- }], ctorParameters: () => [], propDecorators: { formato: [{
322
- type: Input
323
- }], keyEnter: [{
324
- type: Input
325
- }], inputFormatEdit: [{
326
- type: ViewChild,
327
- args: ['inputFormat', { read: ElementRef, static: true }]
328
- }] } });
329
-
330
- class InputSelectComponent extends BaseInputComponent {
331
- writeValue(value) {
332
- //console.log('write value select', value);
333
- this.onChange(value);
334
- this.data = value;
335
- }
336
- registerOnChange(fn) {
337
- this.onChange = fn;
338
- }
339
- registerOnTouched(fn) {
340
- this.onTouch = fn;
341
- }
342
- setDisabledState(isDisabled) {
343
- this.disabled = this.disabled;
344
- }
345
- constructor(renderer) {
346
- super();
347
- this.renderer = renderer;
348
- this.selectChange = new EventEmitter();
349
- this.selectChangeEntity = new EventEmitter();
350
- this.itens = [];
351
- this.itemId = "Id";
352
- this.itemNome = "Nome";
353
- this.showNovo = false;
354
- this.itemNull = true;
355
- this.opcaoDefault = 'Selecionar';
356
- this.onChange = (data) => { };
357
- this.onTouch = () => { };
358
- this.disabled = false;
359
- this.console = console;
360
- }
361
- ngOnInit() {
362
- if (this.readonly === true) {
363
- //console.log("disabled");
364
- setTimeout(() => {
365
- //this.renderer.addClass(document.getElementById("item-select"), "item-has-focus");
366
- this.renderer.addClass(this.itemSelect.nativeElement, "item-interactive-disabled");
367
- //console.log('select focused', document.getElementById("item-select"));
368
- }, 100);
369
- }
370
- }
371
- onSelectChange(value) {
372
- this.writeValue(value == '' ? null : value);
373
- if (this.selectChange != null) {
374
- //console.log('emit', value);
375
- this.selectChange.emit(value);
376
- }
377
- if (this.selectChangeEntity != null) {
378
- const existe = this.itens.find(i => i[this.itemId] == value);
379
- this.selectChangeEntity.emit(existe);
380
- }
381
- }
382
- onBlur() {
383
- //console.log('input select blur')
384
- setTimeout(() => {
385
- this.renderer.removeClass(this.itemSelect.nativeElement, "item-has-focus");
386
- }, 200);
387
- if (this.form) {
388
- this.form.get(this.formControlName)?.markAsTouched();
389
- }
390
- }
391
- onEnter() {
392
- //adicionar classe ao ion-item
393
- setTimeout(() => {
394
- this.renderer.addClass(this.itemSelect.nativeElement, "item-has-focus");
395
- //console.log('select focused', document.getElementById("item-select"));
396
- }, 200);
397
- }
398
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: InputSelectComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
399
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: InputSelectComponent, selector: "kb-input-select", inputs: { itens: "itens", itemId: "itemId", itemNome: "itemNome", showNovo: "showNovo", itemNull: "itemNull", opcaoDefault: "opcaoDefault" }, outputs: { selectChange: "selectChange", selectChangeEntity: "selectChangeEntity" }, providers: [{
400
- provide: NG_VALUE_ACCESSOR,
401
- useExisting: InputSelectComponent,
402
- multi: true
403
- }], viewQueries: [{ propertyName: "itemSelect", first: true, predicate: ["itemSelect"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: "<!--\r\n<div [formGroup]=\"form\">\r\n-->\r\n<div>\r\n <ion-item lines=\"none\" style=\"--background: inherited; --background-focused: transparent;\" [class]=\"itemClass\" #itemSelect\r\n [ngClass]=\"form?.get(formControlName)?.errors && (form?.get(formControlName)?.dirty || form?.get(formControlName)?.touched) ? 'error-shake' : '' \"\r\n >\r\n <ion-label *ngIf=\"label\" [position]=\"labelPosition\" class=\"focus-label\">{{ label }}</ion-label>\r\n <!-- formControlName=\"{{ formControlName }}\" -->\r\n <select #inputSelect\r\n style=\"width: 100%;\" (change)=\"onSelectChange(inputSelect.value)\"\r\n (blur)=\"onBlur()\" (focus)=\"onEnter()\" [disabled]=\"readonly\">\r\n <option *ngIf=\"itemNull\" [value]=\"''\" selected>{{ opcaoDefault }}</option>\r\n <option *ngFor=\"let item of itens\" [value]=\"item[itemId]\" [selected]=\"item[itemId] == data\">{{ item[itemNome] }}\r\n </option>\r\n </select> \r\n </ion-item>\r\n \r\n \r\n <div class=\"validation-errors\" *ngIf=\"form\">\r\n <ng-container *ngFor=\"let validation of validation_messages\">\r\n <div class=\"error-message\"\r\n *ngIf=\"form && form.get(formControlName)?.hasError(validation.type) && (form.get(formControlName)?.touched)\">\r\n &#8226; {{ validation.message }}\r\n </div>\r\n </ng-container>\r\n </div>\r\n \r\n </div>", styles: ["select{padding:var(--select-padding, 4px);border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;height:var(--select-height, 29px);margin-left:0;margin-bottom:2px;background-color:#fff!important}.no-padding{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px;height:42px!important}select:focus{outline:none!important;border:1px solid lightblue!important}select:focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}\n", "@charset \"UTF-8\";ion-label{margin-bottom:4px!important;--color: var(--ion-color-label, auto) !important}ion-item ion-label{overflow:initial!important}ion-input{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;max-height:var(--input-max-height, 29px);transition:.2s ease}.has-focus{border:1px solid var(--ion-color-bluetool, #1f477d)}input:focus{border:1px solid lightblue!important}input:focus ion-input,input:focus ion-textarea{border:1px solid lightblue!important}input:focus ion-label{--color: var(--ion-color-label-focus, blue) !important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-input,.item-has-focus ion-textarea{border:1px solid lightblue!important}.native-input[disabled]{opacity:var(--item-disabled-opacity, .6)!important;background-color:transparent}.item-interactive-disabled ion-label{opacity:var(--item-disabled-opacity, .6)}.error-message{font-size:small;color:var(--error-text-color, red);margin-left:15px}.padding{padding:auto}.no-padding{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px;height:55px!important}.no-padding-end{--inner-padding-end: 0px}.no-padding-start{--padding-start: 0px !important}.no-padding-no-height{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px}.padding-top{--padding-top: 0px}.item-inner{padding-right:0!important}.label-right ion-label{transform-origin:right top;align-self:flex-end;margin-bottom:4%!important}.align-to-right ion-label{position:relative;left:25%;text-align:end}.error-input ion-input,.error-shake ion-input{animation:shake .4s 1 linear;border:1px solid var(--error-text-color, red)!important}@keyframes shake{0%{transform:translate(20px)}20%{transform:translate(-20px)}40%{transform:translate(10px)}60%{transform:translate(-10px)}80%{transform:translate(4px)}to{transform:translate(0)}}.error-input ion-label,.error-shake ion-label{color:var(--error-text-color, red)!important}.error-input ion-input,.error-shake ion-input{border:1px solid red!important}.error-shake ion-input{animation:shake .4s 1 linear}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "counterFormatter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { kind: "component", type: i2.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }] }); }
404
- }
405
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: InputSelectComponent, decorators: [{
406
- type: Component,
407
- args: [{ selector: 'kb-input-select', providers: [{
408
- provide: NG_VALUE_ACCESSOR,
409
- useExisting: InputSelectComponent,
410
- multi: true
411
- }], template: "<!--\r\n<div [formGroup]=\"form\">\r\n-->\r\n<div>\r\n <ion-item lines=\"none\" style=\"--background: inherited; --background-focused: transparent;\" [class]=\"itemClass\" #itemSelect\r\n [ngClass]=\"form?.get(formControlName)?.errors && (form?.get(formControlName)?.dirty || form?.get(formControlName)?.touched) ? 'error-shake' : '' \"\r\n >\r\n <ion-label *ngIf=\"label\" [position]=\"labelPosition\" class=\"focus-label\">{{ label }}</ion-label>\r\n <!-- formControlName=\"{{ formControlName }}\" -->\r\n <select #inputSelect\r\n style=\"width: 100%;\" (change)=\"onSelectChange(inputSelect.value)\"\r\n (blur)=\"onBlur()\" (focus)=\"onEnter()\" [disabled]=\"readonly\">\r\n <option *ngIf=\"itemNull\" [value]=\"''\" selected>{{ opcaoDefault }}</option>\r\n <option *ngFor=\"let item of itens\" [value]=\"item[itemId]\" [selected]=\"item[itemId] == data\">{{ item[itemNome] }}\r\n </option>\r\n </select> \r\n </ion-item>\r\n \r\n \r\n <div class=\"validation-errors\" *ngIf=\"form\">\r\n <ng-container *ngFor=\"let validation of validation_messages\">\r\n <div class=\"error-message\"\r\n *ngIf=\"form && form.get(formControlName)?.hasError(validation.type) && (form.get(formControlName)?.touched)\">\r\n &#8226; {{ validation.message }}\r\n </div>\r\n </ng-container>\r\n </div>\r\n \r\n </div>", styles: ["select{padding:var(--select-padding, 4px);border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;height:var(--select-height, 29px);margin-left:0;margin-bottom:2px;background-color:#fff!important}.no-padding{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px;height:42px!important}select:focus{outline:none!important;border:1px solid lightblue!important}select:focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}\n", "@charset \"UTF-8\";ion-label{margin-bottom:4px!important;--color: var(--ion-color-label, auto) !important}ion-item ion-label{overflow:initial!important}ion-input{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;max-height:var(--input-max-height, 29px);transition:.2s ease}.has-focus{border:1px solid var(--ion-color-bluetool, #1f477d)}input:focus{border:1px solid lightblue!important}input:focus ion-input,input:focus ion-textarea{border:1px solid lightblue!important}input:focus ion-label{--color: var(--ion-color-label-focus, blue) !important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-input,.item-has-focus ion-textarea{border:1px solid lightblue!important}.native-input[disabled]{opacity:var(--item-disabled-opacity, .6)!important;background-color:transparent}.item-interactive-disabled ion-label{opacity:var(--item-disabled-opacity, .6)}.error-message{font-size:small;color:var(--error-text-color, red);margin-left:15px}.padding{padding:auto}.no-padding{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px;height:55px!important}.no-padding-end{--inner-padding-end: 0px}.no-padding-start{--padding-start: 0px !important}.no-padding-no-height{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px}.padding-top{--padding-top: 0px}.item-inner{padding-right:0!important}.label-right ion-label{transform-origin:right top;align-self:flex-end;margin-bottom:4%!important}.align-to-right ion-label{position:relative;left:25%;text-align:end}.error-input ion-input,.error-shake ion-input{animation:shake .4s 1 linear;border:1px solid var(--error-text-color, red)!important}@keyframes shake{0%{transform:translate(20px)}20%{transform:translate(-20px)}40%{transform:translate(10px)}60%{transform:translate(-10px)}80%{transform:translate(4px)}to{transform:translate(0)}}.error-input ion-label,.error-shake ion-label{color:var(--error-text-color, red)!important}.error-input ion-input,.error-shake ion-input{border:1px solid red!important}.error-shake ion-input{animation:shake .4s 1 linear}\n"] }]
412
- }], ctorParameters: () => [{ type: i0.Renderer2 }], propDecorators: { selectChange: [{
413
- type: Output
414
- }], selectChangeEntity: [{
415
- type: Output
416
- }], itens: [{
417
- type: Input
418
- }], itemId: [{
419
- type: Input
420
- }], itemNome: [{
421
- type: Input
422
- }], showNovo: [{
423
- type: Input
424
- }], itemNull: [{
425
- type: Input
426
- }], opcaoDefault: [{
427
- type: Input
428
- }], itemSelect: [{
429
- type: ViewChild,
430
- args: ["itemSelect", { read: ElementRef }]
431
- }] } });
432
-
433
- class TreeViewNivelComponent {
434
- constructor(sanitizer) {
435
- this.sanitizer = sanitizer;
436
- this.nivelClick = new EventEmitter();
437
- this.identacao = '';
438
- }
439
- ngOnInit() {
440
- for (let i = 0; i < this.nivel; i++) {
441
- this.identacao += '<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>';
442
- }
443
- //console.log('IDENT', this.identacao)
444
- }
445
- nodeClick() {
446
- if (this.nivelClick) {
447
- this.nivelClick.emit(this.node);
448
- }
449
- }
450
- highlight(texto) {
451
- if (!this.currentSearch)
452
- return texto;
453
- let index = texto.toLowerCase().indexOf(this.currentSearch.toLowerCase());
454
- //console.log(index);
455
- if (index >= 0) {
456
- 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>`);
457
- }
458
- else {
459
- return texto;
460
- }
461
- }
462
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: TreeViewNivelComponent, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
463
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: TreeViewNivelComponent, selector: "kb-tree-view-nivel", inputs: { node: "node", nivel: "nivel", currentSearch: "currentSearch" }, outputs: { nivelClick: "nivelClick" }, ngImport: i0, template: "<span [innerHtml]=\"identacao\" class=\"node-link\"></span>\n<!-- mostrar a seta se tiver filhos ou se for raiz (nivel = 0)-->\n<span class=\"node-link\" *ngIf=\"!node.Expandido && (node.Filhos.length > 0 || nivel == 0)\" (click)=\"node.Expandido = !node.Expandido\"\n class=\"boxSeta\">\n <ion-icon name=\"chevron-forward-outline\"></ion-icon>\n</span>\n<span class=\"node-link\" *ngIf=\"node.Expandido\" (click)=\"node.Expandido = !node.Expandido\" class=\"boxSeta\">\n <ion-icon name=\"chevron-down-outline\"></ion-icon>\n</span>\n<!--\n<span *ngIf=\"!node.Expandido\">&nbsp;&nbsp;&nbsp;</span>\n-->\n\n<!-- \n<span [class]=\"{ 'node-link' : node.Clicable === true, 'node-disabled': node.Clicable === false }\" (click)=\"nodeClick()\" title=\"{{ node.Label }}\"> {{ node.Label }}</span>\n-->\n<span [class]=\"{ 'node-link' : node.Clicable === true, 'node-disabled': node.Clicable === false }\" (click)=\"nodeClick()\" title=\"{{ node.Label }}\" [innerHTML]=\"highlight(node.Label)\"></span>\n", styles: [".node-link{cursor:pointer}.node-disabled{cursor:auto;color:#a9a9a9}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }] }); }
464
- }
465
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: TreeViewNivelComponent, decorators: [{
466
- type: Component,
467
- args: [{ selector: 'kb-tree-view-nivel', template: "<span [innerHtml]=\"identacao\" class=\"node-link\"></span>\n<!-- mostrar a seta se tiver filhos ou se for raiz (nivel = 0)-->\n<span class=\"node-link\" *ngIf=\"!node.Expandido && (node.Filhos.length > 0 || nivel == 0)\" (click)=\"node.Expandido = !node.Expandido\"\n class=\"boxSeta\">\n <ion-icon name=\"chevron-forward-outline\"></ion-icon>\n</span>\n<span class=\"node-link\" *ngIf=\"node.Expandido\" (click)=\"node.Expandido = !node.Expandido\" class=\"boxSeta\">\n <ion-icon name=\"chevron-down-outline\"></ion-icon>\n</span>\n<!--\n<span *ngIf=\"!node.Expandido\">&nbsp;&nbsp;&nbsp;</span>\n-->\n\n<!-- \n<span [class]=\"{ 'node-link' : node.Clicable === true, 'node-disabled': node.Clicable === false }\" (click)=\"nodeClick()\" title=\"{{ node.Label }}\"> {{ node.Label }}</span>\n-->\n<span [class]=\"{ 'node-link' : node.Clicable === true, 'node-disabled': node.Clicable === false }\" (click)=\"nodeClick()\" title=\"{{ node.Label }}\" [innerHTML]=\"highlight(node.Label)\"></span>\n", styles: [".node-link{cursor:pointer}.node-disabled{cursor:auto;color:#a9a9a9}\n"] }]
468
- }], ctorParameters: () => [{ type: i1$1.DomSanitizer }], propDecorators: { nivelClick: [{
469
- type: Output
470
- }], node: [{
471
- type: Input
472
- }], nivel: [{
473
- type: Input
474
- }], currentSearch: [{
475
- type: Input
476
- }] } });
477
-
478
- class TreeViewComponent {
479
- constructor() {
480
- this.itens = [];
481
- this.caixaClass = 'caixa';
482
- this.beforeUpdate = new EventEmitter();
483
- this.selecionarRegistro = new EventEmitter();
484
- this.arvore = [];
485
- }
486
- ngOnInit() {
487
- //throw new Error('Method not implemented.');
488
- }
489
- montaArvore(pai, arvore) {
490
- if (arvore && arvore.length > 0) {
491
- //procurar os filhos de cada no
492
- arvore.forEach(f => {
493
- //console.log('no atual:', f, );
494
- let filhos = this.itens.filter(i => i[this.campoPai] == f.Id);
495
- //console.log('filhos atual:', filhos);
496
- f.Filhos = [];
497
- filhos.forEach(fi => {
498
- f.Filhos.push({ Id: fi[this.campoId], Pai: f.Id, Label: fi[this.campoLabel], Filhos: [], Expandido: false, Clicable: (fi['ClicableTree'] == null || fi['ClicableTree'] === true) });
499
- });
500
- return this.montaArvore(0, f.Filhos);
501
- });
502
- return 0;
503
- }
504
- else {
505
- //console.log('sem filhos');
506
- return 0;
507
- }
508
- }
509
- arvoreClick(before = true) {
510
- if (this.beforeUpdate && before) {
511
- this.beforeUpdate.emit();
512
- return;
513
- }
514
- this.arvore = [];
515
- //console.log('tree itens', this.itens);
516
- if (this.itens && this.itens.length > 0) {
517
- //montar arvore pais
518
- this.itens.forEach(it => {
519
- if (it[this.campoPai] == null) {
520
- //é pai
521
- this.arvore.push({ Id: it[this.campoId], Pai: null, Label: it[this.campoLabel], Filhos: [], Expandido: false, Clicable: (it['ClicableTree'] == null || it['ClicableTree'] === true) });
522
- }
523
- });
524
- this.montaArvore(0, this.arvore);
525
- console.log('arvore', this.arvore);
526
- }
527
- }
528
- expandir(arvore = null) {
529
- if (arvore == null) {
530
- arvore = this.arvore;
531
- }
532
- if (arvore && arvore.length > 0) {
533
- //procurar os filhos de cada no
534
- arvore.forEach(f => {
535
- //expandir
536
- f.Expandido = true;
537
- return this.expandir(f.Filhos);
538
- });
539
- return 0;
540
- }
541
- else {
542
- //console.log('sem filhos');
543
- return 0;
544
- }
545
- }
546
- carregarRegistro(node) {
547
- console.log('carrega registro', node);
548
- this.selecionarRegistro.next({ Cadastro: this.cadastro, Id: node.Id });
549
- }
550
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: TreeViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
551
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: TreeViewComponent, selector: "kb-tree-view", inputs: { itens: "itens", campoId: "campoId", campoPai: "campoPai", campoLabel: "campoLabel", cadastro: "cadastro", endpoint: "endpoint", caixaClass: "caixaClass", currentSearch: "currentSearch" }, outputs: { beforeUpdate: "beforeUpdate", selecionarRegistro: "selecionarRegistro" }, ngImport: i0, template: "<div style=\"position: relative; height: auto; padding-left: 2%; background-color: white;\">\n \n <div *ngIf=\"arvore\" [class]=\"caixaClass\" style=\"padding-left: 6px; font-size: 12px;\">\n <!-- raiz -->\n <div *ngFor=\"let raiz of arvore\" class=\"coluna\">\n <kb-tree-view-nivel [nivel]=\"0\" [node]=\"raiz\" [currentSearch]=\"currentSearch\" (nivelClick)=\"raiz.Clicable === true ? carregarRegistro(raiz) : null\">\n </kb-tree-view-nivel> \n \n <div *ngIf=\"raiz.Expandido\" class=\"filho\">\n <div *ngFor=\"let nivel1 of raiz.Filhos\" draggable=\"true\">\n <kb-tree-view-nivel [nivel]=\"1\" [node]=\"nivel1\" [currentSearch]=\"currentSearch\" (nivelClick)=\"nivel1.Clicable === true ? carregarRegistro(nivel1): null\">\n </kb-tree-view-nivel> \n \n <div *ngIf=\"nivel1 && nivel1.Expandido\" class=\"filho\">\n <div *ngFor=\"let nivel2 of nivel1.Filhos\">\n <kb-tree-view-nivel [nivel]=\"2\" [node]=\"nivel2\" [currentSearch]=\"currentSearch\" (nivelClick)=\"nivel2.Clicable === true ? carregarRegistro(nivel2): null\">\n </kb-tree-view-nivel> \n \n <div *ngIf=\"nivel2 && nivel2.Expandido\" class=\"filho\">\n <div *ngFor=\"let nivel3 of nivel2.Filhos\">\n <kb-tree-view-nivel [nivel]=\"3\" [node]=\"nivel3\" [currentSearch]=\"currentSearch\" (nivelClick)=\"nivel3.Clicable === true ? carregarRegistro(nivel3): null\">\n </kb-tree-view-nivel>\n \n <div *ngIf=\"nivel3 && nivel3.Expandido\" class=\"filho\">\n <div *ngFor=\"let nivel4 of nivel3.Filhos\">\n <kb-tree-view-nivel [nivel]=\"4\" [node]=\"nivel4\" [currentSearch]=\"currentSearch\" (nivelClick)=\"nivel4.Clicable === true ? carregarRegistro(nivel4): null\">\n </kb-tree-view-nivel>\n \n <div *ngIf=\"nivel4 && nivel4.Expandido\" class=\"filho\">\n <div *ngFor=\"let nivel5 of nivel4.Filhos\">\n <kb-tree-view-nivel [nivel]=\"5\" [node]=\"nivel5\" [currentSearch]=\"currentSearch\"\n (nivelClick)=\"nivel5.Clicable === true ? carregarRegistro(nivel5): null\"></kb-tree-view-nivel>\n \n <div *ngIf=\"nivel5 && nivel5.Expandido\" class=\"filho\">\n <div *ngFor=\"let nivel6 of nivel5.Filhos\">\n <kb-tree-view-nivel [nivel]=\"6\" [node]=\"nivel6\" [currentSearch]=\"currentSearch\"\n (nivelClick)=\"nivel6.Clicable === true ? carregarRegistro(nivel6): null\"></kb-tree-view-nivel>\n \n <div *ngIf=\"nivel6 && nivel6.Expandido\" class=\"filho\">\n <div *ngFor=\"let nivel7 of nivel6.Filhos\">\n <kb-tree-view-nivel [nivel]=\"7\" [node]=\"nivel7\" [currentSearch]=\"currentSearch\"\n (nivelClick)=\"nivel7.Clicable === true ? carregarRegistro(nivel7): null\"></kb-tree-view-nivel>\n \n <div *ngIf=\"nivel7 && nivel7.Expandido\" class=\"filho\">\n <div *ngFor=\"let nivel8 of nivel7.Filhos\">\n <kb-tree-view-nivel [nivel]=\"8\" [node]=\"nivel8\"\n (nivelClick)=\"nivel8.Clicable === true ? carregarRegistro(nivel8): null\"></kb-tree-view-nivel>\n \n <div *ngIf=\"nivel8 && nivel8.Expandido\" class=\"filho\">\n <div *ngFor=\"let nivel9 of nivel8.Filhos\">\n <kb-tree-view-nivel [nivel]=\"9\" [node]=\"nivel9\" [currentSearch]=\"currentSearch\"\n (nivelClick)=\"nivel9.Clicable === true ? carregarRegistro(nivel9): null\"></kb-tree-view-nivel>\n \n <div *ngIf=\"nivel9 && nivel9.Expandido\" class=\"filho\">\n <div *ngFor=\"let nivel10 of nivel9.Filhos\">\n <kb-tree-view-nivel [nivel]=\"10\" [node]=\"nivel10\" [currentSearch]=\"currentSearch\"\n (nivelClick)=\"nivel10.Clicable === true ? carregarRegistro(nivel10): null\"></kb-tree-view-nivel>\n \n </div>\n \n </div>\n </div>\n \n </div>\n \n \n </div>\n \n </div>\n </div>\n \n </div>\n </div>\n \n </div>\n </div>\n \n </div>\n </div>\n \n </div>\n </div>\n \n </div>\n \n \n \n </div>\n \n </div>\n \n </div>\n \n </div>\n </div>\n </div>", styles: [".boxSeta{margin:2px;font-size:large;color:#09459e;cursor:pointer}.caixa{border:2px transparent solid;padding:3px;width:100%;position:relative;overflow-y:auto;background-color:#fff;border-radius:5px;height:100%}.coluna{padding-bottom:10px}.filho{padding-top:6px}.node-link{cursor:pointer}.caixa-agrupado{border:2px transparent solid;padding:3px;height:701px;width:100%;position:relative;overflow-y:auto;border-radius:5px;background-color:#fff}.caixa-empresa{border:2px transparent solid;padding:3px;height:340px;width:100%;position:relative;overflow-y:auto;border-radius:5px;background-color:#fff}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TreeViewNivelComponent, selector: "kb-tree-view-nivel", inputs: ["node", "nivel", "currentSearch"], outputs: ["nivelClick"] }] }); }
552
- }
553
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: TreeViewComponent, decorators: [{
554
- type: Component,
555
- args: [{ selector: 'kb-tree-view', template: "<div style=\"position: relative; height: auto; padding-left: 2%; background-color: white;\">\n \n <div *ngIf=\"arvore\" [class]=\"caixaClass\" style=\"padding-left: 6px; font-size: 12px;\">\n <!-- raiz -->\n <div *ngFor=\"let raiz of arvore\" class=\"coluna\">\n <kb-tree-view-nivel [nivel]=\"0\" [node]=\"raiz\" [currentSearch]=\"currentSearch\" (nivelClick)=\"raiz.Clicable === true ? carregarRegistro(raiz) : null\">\n </kb-tree-view-nivel> \n \n <div *ngIf=\"raiz.Expandido\" class=\"filho\">\n <div *ngFor=\"let nivel1 of raiz.Filhos\" draggable=\"true\">\n <kb-tree-view-nivel [nivel]=\"1\" [node]=\"nivel1\" [currentSearch]=\"currentSearch\" (nivelClick)=\"nivel1.Clicable === true ? carregarRegistro(nivel1): null\">\n </kb-tree-view-nivel> \n \n <div *ngIf=\"nivel1 && nivel1.Expandido\" class=\"filho\">\n <div *ngFor=\"let nivel2 of nivel1.Filhos\">\n <kb-tree-view-nivel [nivel]=\"2\" [node]=\"nivel2\" [currentSearch]=\"currentSearch\" (nivelClick)=\"nivel2.Clicable === true ? carregarRegistro(nivel2): null\">\n </kb-tree-view-nivel> \n \n <div *ngIf=\"nivel2 && nivel2.Expandido\" class=\"filho\">\n <div *ngFor=\"let nivel3 of nivel2.Filhos\">\n <kb-tree-view-nivel [nivel]=\"3\" [node]=\"nivel3\" [currentSearch]=\"currentSearch\" (nivelClick)=\"nivel3.Clicable === true ? carregarRegistro(nivel3): null\">\n </kb-tree-view-nivel>\n \n <div *ngIf=\"nivel3 && nivel3.Expandido\" class=\"filho\">\n <div *ngFor=\"let nivel4 of nivel3.Filhos\">\n <kb-tree-view-nivel [nivel]=\"4\" [node]=\"nivel4\" [currentSearch]=\"currentSearch\" (nivelClick)=\"nivel4.Clicable === true ? carregarRegistro(nivel4): null\">\n </kb-tree-view-nivel>\n \n <div *ngIf=\"nivel4 && nivel4.Expandido\" class=\"filho\">\n <div *ngFor=\"let nivel5 of nivel4.Filhos\">\n <kb-tree-view-nivel [nivel]=\"5\" [node]=\"nivel5\" [currentSearch]=\"currentSearch\"\n (nivelClick)=\"nivel5.Clicable === true ? carregarRegistro(nivel5): null\"></kb-tree-view-nivel>\n \n <div *ngIf=\"nivel5 && nivel5.Expandido\" class=\"filho\">\n <div *ngFor=\"let nivel6 of nivel5.Filhos\">\n <kb-tree-view-nivel [nivel]=\"6\" [node]=\"nivel6\" [currentSearch]=\"currentSearch\"\n (nivelClick)=\"nivel6.Clicable === true ? carregarRegistro(nivel6): null\"></kb-tree-view-nivel>\n \n <div *ngIf=\"nivel6 && nivel6.Expandido\" class=\"filho\">\n <div *ngFor=\"let nivel7 of nivel6.Filhos\">\n <kb-tree-view-nivel [nivel]=\"7\" [node]=\"nivel7\" [currentSearch]=\"currentSearch\"\n (nivelClick)=\"nivel7.Clicable === true ? carregarRegistro(nivel7): null\"></kb-tree-view-nivel>\n \n <div *ngIf=\"nivel7 && nivel7.Expandido\" class=\"filho\">\n <div *ngFor=\"let nivel8 of nivel7.Filhos\">\n <kb-tree-view-nivel [nivel]=\"8\" [node]=\"nivel8\"\n (nivelClick)=\"nivel8.Clicable === true ? carregarRegistro(nivel8): null\"></kb-tree-view-nivel>\n \n <div *ngIf=\"nivel8 && nivel8.Expandido\" class=\"filho\">\n <div *ngFor=\"let nivel9 of nivel8.Filhos\">\n <kb-tree-view-nivel [nivel]=\"9\" [node]=\"nivel9\" [currentSearch]=\"currentSearch\"\n (nivelClick)=\"nivel9.Clicable === true ? carregarRegistro(nivel9): null\"></kb-tree-view-nivel>\n \n <div *ngIf=\"nivel9 && nivel9.Expandido\" class=\"filho\">\n <div *ngFor=\"let nivel10 of nivel9.Filhos\">\n <kb-tree-view-nivel [nivel]=\"10\" [node]=\"nivel10\" [currentSearch]=\"currentSearch\"\n (nivelClick)=\"nivel10.Clicable === true ? carregarRegistro(nivel10): null\"></kb-tree-view-nivel>\n \n </div>\n \n </div>\n </div>\n \n </div>\n \n \n </div>\n \n </div>\n </div>\n \n </div>\n </div>\n \n </div>\n </div>\n \n </div>\n </div>\n \n </div>\n </div>\n \n </div>\n \n \n \n </div>\n \n </div>\n \n </div>\n \n </div>\n </div>\n </div>", styles: [".boxSeta{margin:2px;font-size:large;color:#09459e;cursor:pointer}.caixa{border:2px transparent solid;padding:3px;width:100%;position:relative;overflow-y:auto;background-color:#fff;border-radius:5px;height:100%}.coluna{padding-bottom:10px}.filho{padding-top:6px}.node-link{cursor:pointer}.caixa-agrupado{border:2px transparent solid;padding:3px;height:701px;width:100%;position:relative;overflow-y:auto;border-radius:5px;background-color:#fff}.caixa-empresa{border:2px transparent solid;padding:3px;height:340px;width:100%;position:relative;overflow-y:auto;border-radius:5px;background-color:#fff}\n"] }]
556
- }], propDecorators: { itens: [{
557
- type: Input
558
- }], campoId: [{
559
- type: Input
560
- }], campoPai: [{
561
- type: Input
562
- }], campoLabel: [{
563
- type: Input
564
- }], cadastro: [{
565
- type: Input
566
- }], endpoint: [{
567
- type: Input
568
- }], caixaClass: [{
569
- type: Input
570
- }], beforeUpdate: [{
571
- type: Output
572
- }], currentSearch: [{
573
- type: Input
574
- }], selecionarRegistro: [{
575
- type: Output
576
- }] } });
577
-
578
- class ModelTreeviewComponent {
579
- constructor(config, modalCtrl, httpClient, loadingCtrl) {
580
- this.config = config;
581
- this.modalCtrl = modalCtrl;
582
- this.httpClient = httpClient;
583
- this.loadingCtrl = loadingCtrl;
584
- this.titulo = "Selecionar";
585
- this.textoPesquisa = "";
586
- this.maximizar = false;
587
- this.BASE_API = this.config.apiUrl;
588
- }
589
- ngOnInit() {
590
- }
591
- ionViewDidEnter() {
592
- this.atualizaArvoreEntidade(this.tipo);
593
- }
594
- async atualizaArvoreEntidade(tipo) {
595
- let subscriptionC;
596
- this.treeView.cadastro = this.subscribeId;
597
- let loading = await this.showLoading("Pesquisando...", true);
598
- loading.onDidDismiss().then(() => {
599
- subscriptionC?.unsubscribe();
600
- });
601
- this.url = this.url.startsWith('http') ? this.url : `${this.BASE_API}/${this.url}`;
602
- var url = this.url.replace('<<EMPRESA>>', this.empresaSelecionadaId.toString());
603
- var url = this.url.replace('<<FILTRO>>', '');
604
- // if (this.textoPesquisa) {
605
- // url += `?filtro=${this.textoPesquisa}`;
606
- // }
607
- subscriptionC = this.httpClient.get(url).subscribe({
608
- next: (result) => {
609
- /*
610
- empresaContato.forEach((ec) => {
611
- ec.LabelTree = ec.Nome;
612
- ec.EmpresaContatoPaiId = null; //campo ficticio para montar arvore
613
- ec.ClicableTree = true;
614
- });
615
-
616
- this.treeView.campoId = "EmpresaContatoId";
617
- this.treeView.campoPai = "EmpresaContatoPaiId";
618
- this.treeView.campoLabel = "LabelTree";
619
- this.treeView.itens = empresaContato;
620
- this.treeView.arvoreClick(false);
621
- */
622
- if (!this.campoPai) {
623
- this.campoPai = `${this.campoId}Pai`;
624
- }
625
- result.forEach((cc) => {
626
- cc.LabelTree = cc[this.campoLabel];
627
- if (!cc[this.campoPai]) {
628
- cc[this.campoPai] = null;
629
- }
630
- if (this.filterFunction != null) {
631
- const clicable = [{ ...cc }].find(this.filterFunction);
632
- if (clicable != null && cc.ClicableTree == null) {
633
- cc.ClicableTree = true;
634
- }
635
- else {
636
- cc.ClicableTree = false;
637
- }
638
- }
639
- else {
640
- cc.ClicableTree = true;
641
- }
642
- });
643
- console.log('tree result', result);
644
- this.treeView.campoId = this.campoId;
645
- this.treeView.campoPai = this.campoPai;
646
- this.treeView.campoLabel = this.campoLabel;
647
- this.treeView.itens = result;
648
- this.treeView.arvoreClick(false);
649
- loading.dismiss();
650
- },
651
- error: (error) => {
652
- loading.dismiss();
653
- console.log("Erro ao carregar os registros.<br>Tente mais tarde.");
654
- }
655
- });
656
- }
657
- clickRegistro(evento) {
658
- if (evento.Id > 0) {
659
- this.modalCtrl.dismiss({ Id: evento.Id });
660
- }
661
- }
662
- expandir() {
663
- this.treeView.expandir();
664
- }
665
- //utils
666
- async showLoading(msg, cancelable = false) {
667
- const loading = await this.loadingCtrl.create({
668
- message: msg,
669
- backdropDismiss: cancelable
670
- //duration: 2000
671
- });
672
- /*
673
- loading.onDidDismiss().then(() => {
674
- console.log('loading dissmissed', request);
675
- if (request.subscription) {
676
- request.subscription.unsubscribe();
677
- }
678
- });
679
- */
680
- await loading.present();
681
- return loading;
682
- }
683
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: ModelTreeviewComponent, deps: [{ token: 'LibConfigService' }, { token: i2.ModalController }, { token: i2$1.HttpClient }, { token: i2.LoadingController }], target: i0.ɵɵFactoryTarget.Component }); }
684
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: ModelTreeviewComponent, selector: "kb-model-treeview", inputs: { textoPesquisa: "textoPesquisa" }, viewQueries: [{ propertyName: "treeView", first: true, predicate: ["treeViewComp"], descendants: true }], ngImport: i0, template: "<ion-header>\n <ion-toolbar color=\"secondary\">\n <ion-title>{{ titulo }}</ion-title>\n <ion-buttons slot=\"end\">\n <ion-button (click)=\"atualizaArvoreEntidade(tipo)\">\n <ion-icon slot=\"icon-only\" name=\"refresh\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"modalCtrl.dismiss()\">Fechar</ion-button>\n </ion-buttons>\n </ion-toolbar>\n </ion-header>\n \n <ion-content>\n <ion-item>\n <ion-button style=\"box-shadow: #4c8dff 0px 2px 2px 0.05px;\" fill=\"outline\" (click)=\"expandir()\">\n <ion-icon name=\"expand-outline\"></ion-icon>\n </ion-button> \n </ion-item>\n <kb-tree-view #treeViewComp [campoId]=\"campoId\" [campoPai]=\"campoPai\" [campoLabel]=\"'LabelTree'\" (selecionarRegistro)=\"clickRegistro($event)\"></kb-tree-view>\n </ion-content>", styles: [""], dependencies: [{ kind: "component", type: i2.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i2.IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: i2.IonContent, selector: "ion-content", inputs: ["color", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: i2.IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: i2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i2.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "counterFormatter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { kind: "component", type: i2.IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "component", type: i2.IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: TreeViewComponent, selector: "kb-tree-view", inputs: ["itens", "campoId", "campoPai", "campoLabel", "cadastro", "endpoint", "caixaClass", "currentSearch"], outputs: ["beforeUpdate", "selecionarRegistro"] }] }); }
685
- }
686
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: ModelTreeviewComponent, decorators: [{
687
- type: Component,
688
- args: [{ selector: 'kb-model-treeview', template: "<ion-header>\n <ion-toolbar color=\"secondary\">\n <ion-title>{{ titulo }}</ion-title>\n <ion-buttons slot=\"end\">\n <ion-button (click)=\"atualizaArvoreEntidade(tipo)\">\n <ion-icon slot=\"icon-only\" name=\"refresh\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"modalCtrl.dismiss()\">Fechar</ion-button>\n </ion-buttons>\n </ion-toolbar>\n </ion-header>\n \n <ion-content>\n <ion-item>\n <ion-button style=\"box-shadow: #4c8dff 0px 2px 2px 0.05px;\" fill=\"outline\" (click)=\"expandir()\">\n <ion-icon name=\"expand-outline\"></ion-icon>\n </ion-button> \n </ion-item>\n <kb-tree-view #treeViewComp [campoId]=\"campoId\" [campoPai]=\"campoPai\" [campoLabel]=\"'LabelTree'\" (selecionarRegistro)=\"clickRegistro($event)\"></kb-tree-view>\n </ion-content>" }]
689
- }], ctorParameters: () => [{ type: undefined, decorators: [{
690
- type: Inject,
691
- args: ['LibConfigService']
692
- }] }, { type: i2.ModalController }, { type: i2$1.HttpClient }, { type: i2.LoadingController }], propDecorators: { textoPesquisa: [{
693
- type: Input
694
- }], treeView: [{
695
- type: ViewChild,
696
- args: ["treeViewComp"]
697
- }] } });
698
-
699
- //import { LibConfig, LibConfigService } from '../appproject-components.module';
700
- class InputPesquisaComponent extends BaseInputComponent {
701
- writeValue(value) {
702
- //console.log('write value', value);
703
- this.onChange(value);
704
- this.data = value;
705
- if (value == null || value == 0) {
706
- this.writePesquisa('');
707
- this.selectedItem = null;
708
- }
709
- else {
710
- if (this.loadInit == true) {
711
- this.loadInit = false;
712
- this.modelChanged.next(value);
713
- //this.carregaItemIdParaLista(value);
714
- }
715
- else {
716
- //console.log(this.selectedItem);
717
- if (!this.selectedItem || (this.selectedItem && this.selectedItem[this.campoId] != value)) {
718
- console.log('Id diferente');
719
- this.modelChanged.next(value);
720
- //this.carregaItemIdParaLista(value);
721
- }
722
- }
723
- }
724
- }
725
- registerOnChange(fn) {
726
- this.onChange = fn;
727
- }
728
- registerOnTouched(fn) {
729
- this.onTouch = fn;
730
- }
731
- setDisabledState(isDisabled) {
732
- this.disabled = this.disabled;
733
- }
734
- constructor(config, httpClient, modalCtrl) {
735
- super();
736
- this.config = config;
737
- this.httpClient = httpClient;
738
- this.modalCtrl = modalCtrl;
739
- this.podePesquisar = true;
740
- this.textoPesquisa = '';
741
- this.selectElementVisivel = false;
742
- this.listaPesquisa = [];
743
- this.max = '30';
744
- this.pesquisaSubject = new Subject();
745
- this.filterFunction = null;
746
- this.selectId = 'selectElement';
747
- this.campoId = 'Id';
748
- this.campoPaiId = 'PaiId';
749
- this.campoDisplay = 'Descricao';
750
- this.tipo = '';
751
- //@ViewChild('selectElement', { read: ElementRef, static: true }) selectElement;
752
- this.selectElement = null;
753
- this.pesquisaChange = new EventEmitter();
754
- //parametros para chamada API
755
- //endpoint para pesquisa por digitação
756
- this.url = '';
757
- this.urlItem = '';
758
- //endpoint para montar a arvore, se estiver vazia será usado o campo 'url'
759
- this.urlTree = '';
760
- this.empresa = 0;
761
- this.loadInit = false;
762
- this.onChange = (data) => { };
763
- this.onTouch = () => { };
764
- this.disabled = false;
765
- this.console = console;
766
- this.modelChanged = new Subject();
767
- this.BASE_API = this.config.apiUrl;
768
- this.modelChangeSubscription = this.modelChanged
769
- .pipe(debounceTime(500))
770
- .subscribe(data => {
771
- this.carregaItemIdParaLista(data);
772
- });
773
- }
774
- onBlur(event) {
775
- console.log('blur', event);
776
- //console.log(event.detail.relatedTarget);
777
- if (event.detail.relatedTarget == null || event.detail.relatedTarget.id.indexOf(this.selectId + 'IonItem') == -1) {
778
- //console.log("true", event.detail.relatedTarget.id);
779
- //pesquisar item na lista
780
- if (!this.existeNaListaTexto(this.textoPesquisa, true)) {
781
- this.limparClick();
782
- }
783
- this.dropDownPesquisa(0);
784
- if (this.form) {
785
- this.form.get(this.formControlName)?.markAsTouched();
786
- }
787
- }
788
- }
789
- ngOnInit() {
790
- //tratar urls
791
- this.url = this.url.startsWith('http') ? this.url : `${this.BASE_API}/${this.url}`;
792
- this.urlItem = this.urlItem.startsWith('http') ? this.urlItem : `${this.BASE_API}/${this.urlItem}`;
793
- this.pesquisaSubject.pipe(switchMap((url) => {
794
- //this.console.log('subject url:', url);
795
- if (!this.isEmpty(url)) {
796
- return this.httpClient.get(url);
797
- //return of(url);
798
- }
799
- else
800
- return of([]);
801
- }))
802
- .subscribe({
803
- next: (result) => {
804
- //this.listaPesquisa = result;
805
- this.console.log('subject subscribe result:', result);
806
- this.listaPesquisa = [];
807
- if (result && result.length > 0) {
808
- if (this.filterFunction) {
809
- result = result.filter(this.filterFunction);
810
- }
811
- result.forEach((ent, index) => {
812
- this.listaPesquisa.push({ ...ent, Index: index, Selected: false });
813
- });
814
- }
815
- this.podePesquisar = true;
816
- if (this.listaPesquisa.length > 0) {
817
- this.dropDownPesquisa(this.listaPesquisa.length);
818
- }
819
- },
820
- error: (error) => {
821
- this.podePesquisar = true;
822
- console.log('erro pesquisa', error);
823
- }
824
- });
825
- }
826
- writePesquisa(value) {
827
- //console.log('write pesquisa', value);
828
- this.textoPesquisa = value;
829
- }
830
- showPesquisa(e) {
831
- //console.log('show pesquisa', e.keyCode);
832
- var self = this;
833
- const index = e.target.selectionStart >= 1 ? (e.target.selectionStart - 1) : 0;
834
- //console.log(index, 'valor ', event.target.value, 'char ', event.target.value.charCodeAt(index));
835
- const keyAt = e.target.value.charCodeAt(index);
836
- /*
837
- if ((e.keyCode >= 48 && e.keyCode <= 57) ||
838
- (keyAt >= 48 && keyAt <= 57) ||
839
- (e.keyCode >= 65 && e.keyCode <= 90) ||
840
- (e.keyCode >= 96 && e.keyCode <= 105) ||
841
- (e.keyCode == 8)) {
842
- */
843
- if (e.keyCode != 40 && e.keyCode != 38) {
844
- if (!self.podePesquisar) {
845
- return;
846
- }
847
- let filtro = self.textoPesquisa;
848
- if (filtro != null && filtro != '' && filtro.length >= 2) {
849
- self.pesquisarEntidade(filtro);
850
- }
851
- else {
852
- if (e.keyCode == 8 && !filtro) {
853
- this.limparClick();
854
- }
855
- }
856
- }
857
- else {
858
- if (e.keyCode == 40 || e.keyCode == 38) {
859
- self.dropDownPesquisa(self.listaPesquisa.length);
860
- if (self.selectElementVisivel == true) {
861
- //let select = self.selectElement; //document.getElementById(self.TemplateSelect1Id());
862
- //ion-list
863
- //selecionado
864
- //console.log(self.listaPesquisa);
865
- let inc = e.keyCode == 40 ? 1 : -1;
866
- let selected = self.listaPesquisa.find(s => s['Selected'] === true);
867
- let cur = 0;
868
- if (selected != null) {
869
- cur = selected['Index'];
870
- //desmarcar o atual
871
- selected['Selected'] = false;
872
- cur = cur + inc;
873
- }
874
- else {
875
- cur = 0;
876
- }
877
- if (cur < 0) {
878
- cur = self.listaPesquisa.length - 1;
879
- }
880
- else if (cur >= self.listaPesquisa.length) {
881
- cur = 0;
882
- }
883
- let novoSelected = self.listaPesquisa.find(n => n['Index'] === cur);
884
- if (novoSelected != null) {
885
- novoSelected['Selected'] = true;
886
- self.selectedItem = novoSelected;
887
- self.textoPesquisa = novoSelected[self.campoDisplay];
888
- }
889
- /*
890
- let select = document.getElementById(this.selectId) as any;
891
- console.log('select Element', select)
892
- if (select != null) {
893
- let inc = e.keyCode == 40 ? 1 : -1;
894
- let cur = select.selectedIndex;
895
- if (cur == NaN) cur = -1;
896
- select.selectedIndex = cur + inc;
897
- if (select.selectedIndex >= 0 && select.selectedIndex < self.listaPesquisa.length) {
898
- self.selectedItem = self.listaPesquisa[select.selectedIndex];
899
- if (self.selectedItem != null) {
900
- self.textoPesquisa = self.selectedItem[self.campoDisplay];
901
- }
902
- }
903
- }
904
- */
905
- }
906
- }
907
- else if (e.keyCode == 13) {
908
- console.log('enter key', e);
909
- //self.selecionarComboClick(e);
910
- self.selecionarComboClick(null);
911
- //return false;
912
- }
913
- else if (e.keyCode == 27) {
914
- //ESC
915
- self.dropDownPesquisa(0);
916
- }
917
- }
918
- }
919
- highlight(texto) {
920
- let index = texto.toLowerCase().indexOf(this.textoPesquisa.toLowerCase());
921
- //console.log(index);
922
- if (index >= 0) {
923
- return texto.substring(0, index) + '<strong>' + texto.substring(index, index + this.textoPesquisa.length) + '</strong>' + texto.substring(index + this.textoPesquisa.length); //texto.replace(this.textoPesquisa, `<strong>${this.textoPesquisa}</strong>`);
924
- }
925
- else {
926
- return texto;
927
- }
928
- }
929
- selecionarComboClick(item) {
930
- // console.log(item);
931
- var self = this;
932
- // console.log('combo click', self);
933
- /*
934
- let select = document.getElementById(this.selectId) as any;
935
- if (select.selectedIndex >= 0) {
936
- self.selectedItem = self.listaPesquisa[select.selectedIndex];
937
- }
938
- console.log('selected', this.selectedItem);
939
- //self.selectedItem = this.listaPesquisa.find(i => i[this.campoId] == e);
940
- if (self.selectedItem != null) {
941
- self.textoPesquisa = self.selectedItem[self.campoDisplay];
942
- self.writeValue(self.selectedItem[self.campoId]);
943
- if (e != null) {
944
- self.selectElementVisivel = false;
945
- if (self.action != null) {
946
- self.action(self.selectedItem(), e);
947
- }
948
- }
949
- }
950
- else {
951
- self.selectElementVisivel = false;
952
- }
953
- */
954
- // pesquisar selecionado
955
- // console.log(this.listaPesquisa);
956
- let selected = this.listaPesquisa.find(s => s['Selected'] === true);
957
- // if (!selected) {
958
- // console.log(this.campoId, item);
959
- // selected = this.listaPesquisa.filter( s => s[this.campoId] == item[this.campoId]);
960
- // }
961
- //se o item form passado como parametro (click no ion-item)
962
- if (item != null) {
963
- if (selected != null) {
964
- selected['Selected'] = false;
965
- }
966
- item['Selected'] = true;
967
- selected = item;
968
- }
969
- if (selected != null) {
970
- self.selectedItem = selected;
971
- self.textoPesquisa = selected[self.campoDisplay];
972
- self.writeValue(selected[self.campoId]);
973
- self.selectElementVisivel = false;
974
- //console.log('action', self.change);
975
- if (self.pesquisaChange != null) {
976
- self.pesquisaChange.emit(self.selectedItem);
977
- }
978
- }
979
- else {
980
- self.selectElementVisivel = false;
981
- }
982
- // this.listaPesquisa.forEach( pesquisa => {
983
- // console.log(pesquisa, self.data);
984
- // } );
985
- // console.log(this.textoPesquisa);
986
- }
987
- selecionarComboChange(e) {
988
- var self = this;
989
- console.log('combo change', e);
990
- self.selectedItem = this.listaPesquisa.find(i => i[this.campoId] == e);
991
- if (self.selectedItem != null) {
992
- self.writeValue(e);
993
- self.textoPesquisa = self.selectedItem[self.campoDisplay];
994
- if (e != null) {
995
- self.selectElementVisivel = false;
996
- if (self.pesquisaChange != null) {
997
- self.pesquisaChange.emit(self.selectedItem);
998
- }
999
- }
1000
- }
1001
- else {
1002
- self.selectElementVisivel = false;
1003
- }
1004
- }
1005
- dropDownPesquisa(length) {
1006
- var self = this;
1007
- if (self.listaPesquisa != null && self.listaPesquisa.length > 0) {
1008
- if (length == -1) {
1009
- length = self.listaPesquisa.length;
1010
- }
1011
- self.selectElementVisivel = length == 0 ? false : true;
1012
- //console.log(this.selectElement);
1013
- //this.selectElement.open();
1014
- /*
1015
- //let element = this.selectElement;
1016
- let element = document.getElementById(this.selectId);
1017
- console.log('dropDown', element);
1018
- (element as any).size = length + 1;
1019
- if (length == 0) {
1020
- self.selectElementVisivel = false;
1021
- } else {
1022
- self.selectElementVisivel = true;
1023
- }
1024
- */
1025
- }
1026
- }
1027
- pesquisarEntidade(filtro) {
1028
- let url = this.url.replace('<<FILTRO>>', filtro).replace('<<EMPRESA>>', this.empresa.toString());
1029
- console.log('pesquisarEntidade url', url);
1030
- this.podePesquisar = false;
1031
- this.pesquisaSubject.next(url);
1032
- }
1033
- pesquisarEntidadeOld(filtro) {
1034
- let url = this.url.replace('<<FILTRO>>', filtro).replace('<<EMPRESA>>', this.empresa.toString());
1035
- console.log('pesquisarEntidade url', url);
1036
- this.podePesquisar = false;
1037
- this.httpClient.get(url)
1038
- .subscribe({ next: (result) => {
1039
- //this.listaPesquisa = result;
1040
- if (this.filterFunction) {
1041
- result = result.filter(this.filterFunction);
1042
- }
1043
- this.listaPesquisa = [];
1044
- result.forEach((ent, index) => {
1045
- this.listaPesquisa.push({ ...ent, Index: index, Selected: false });
1046
- });
1047
- this.podePesquisar = true;
1048
- if (this.listaPesquisa.length > 0) {
1049
- this.dropDownPesquisa(this.listaPesquisa.length);
1050
- }
1051
- }, error: error => {
1052
- console.log('erro pesquisa', error);
1053
- this.podePesquisar = true;
1054
- } });
1055
- }
1056
- existeNaLista(id, setRegistro = false) {
1057
- if (this.listaPesquisa && this.listaPesquisa.length > 0) {
1058
- let existe = this.listaPesquisa.find(l => l[this.campoId] === id);
1059
- if (existe) {
1060
- if (setRegistro) {
1061
- this.selectedItem = existe;
1062
- this.selecionarComboClick(this.selectedItem);
1063
- }
1064
- return true;
1065
- }
1066
- else {
1067
- return false;
1068
- }
1069
- }
1070
- else {
1071
- return false;
1072
- }
1073
- }
1074
- existeNaListaTexto(texto, setRegistro = false) {
1075
- console.log("existe texto:", texto, this.campoDisplay, this.listaPesquisa);
1076
- if (this.listaPesquisa && this.listaPesquisa.length > 0) {
1077
- let existe = this.listaPesquisa.find(l => l[this.campoDisplay].toUpperCase() === texto.toUpperCase());
1078
- if (existe) {
1079
- if (setRegistro) {
1080
- this.selectedItem = existe;
1081
- this.selecionarComboClick(this.selectedItem);
1082
- }
1083
- return true;
1084
- }
1085
- else {
1086
- return false;
1087
- }
1088
- }
1089
- else {
1090
- return false;
1091
- }
1092
- }
1093
- validarItemSelecionado(setarRegistro = false) {
1094
- console.log('validar selecionado');
1095
- //passar pela função de filtro
1096
- let valido = false;
1097
- if (this.selectedItem) {
1098
- if (this.filterFunction) {
1099
- let existe = [{ ...this.selectedItem }].filter(this.filterFunction);
1100
- if (existe != null && existe.length > 0) {
1101
- valido = true;
1102
- }
1103
- }
1104
- else {
1105
- valido = true;
1106
- }
1107
- if (valido && setarRegistro) {
1108
- this.selecionarComboClick(this.selectedItem);
1109
- }
1110
- return valido;
1111
- }
1112
- else {
1113
- return false;
1114
- }
1115
- }
1116
- carregaItemIdParaLista(id) {
1117
- let url = this.urlItem.replace('<<ID>>', id.toString());
1118
- console.log(this.urlItem);
1119
- console.log('pesquisar ID url', url);
1120
- this.podePesquisar = false;
1121
- this.httpClient.get(url)
1122
- .subscribe({ next: (result) => {
1123
- this.listaPesquisa = [];
1124
- this.listaPesquisa.push({ ...result, Index: 0, Selected: true });
1125
- this.podePesquisar = true;
1126
- if (this.listaPesquisa.length > 0) {
1127
- this.selectedItem = this.listaPesquisa[0];
1128
- this.selecionarComboClick(this.selectedItem);
1129
- }
1130
- }, error: error => {
1131
- console.log('erro pesquisa', error);
1132
- this.podePesquisar = true;
1133
- } });
1134
- }
1135
- limparClick() {
1136
- this.writeValue(null);
1137
- this.writePesquisa(null);
1138
- this.listaPesquisa = [];
1139
- this.dropDownPesquisa(0);
1140
- //this.podePesquisar = true;
1141
- this.pesquisaSubject.next('');
1142
- if (this.limpar) {
1143
- this.limpar();
1144
- }
1145
- }
1146
- verificarPesquisa() {
1147
- //TODO: verificar se o texto corresponde com um item da lista
1148
- this.selecionarComboClick(null);
1149
- }
1150
- async pesquisarClick() {
1151
- /*
1152
- if (this.pesquisaAction != null) {
1153
- this.pesquisaAction();
1154
- }
1155
- */
1156
- //pesquisaCategoria
1157
- console.log(this.filterFunction, this.url, this.urlTree);
1158
- const modal = await this.modalCtrl.create({
1159
- component: ModelTreeviewComponent,
1160
- componentProps: {
1161
- //campoId: this.campoId,
1162
- //campoPai: this.campoPaiId,
1163
- //campoLabel: this.campoDisplay,
1164
- textoPesquisa: this.textoPesquisa,
1165
- filterFunction: this.filterFunction,
1166
- empresaSelecionadaId: this.empresa,
1167
- tipo: this.tipo,
1168
- //especifico
1169
- //planoContas: this.planoContas,
1170
- url: this.isEmpty(this.urlTree) ? this.url : this.urlTree,
1171
- titulo: this.treeTitulo,
1172
- campoLabel: this.campoDisplay,
1173
- campoId: this.campoId,
1174
- campoPai: this.campoPaiId
1175
- },
1176
- cssClass: 'my-custom-modal-pesquisa'
1177
- });
1178
- modal.onDidDismiss().then(data => {
1179
- let result = data['data'];
1180
- console.log(result);
1181
- if (result != null && result.Id > 0) {
1182
- this.carregaItemIdParaLista(result.Id);
1183
- }
1184
- });
1185
- modal.present();
1186
- }
1187
- isEmpty(valor) {
1188
- return valor == null || valor == undefined || valor == '';
1189
- }
1190
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: InputPesquisaComponent, deps: [{ token: 'LibConfigService' }, { token: i2$1.HttpClient }, { token: i2.ModalController }], target: i0.ɵɵFactoryTarget.Component }); }
1191
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: InputPesquisaComponent, selector: "kb-input-pesquisa", inputs: { textoPesquisa: "textoPesquisa", max: "max", filterFunction: "filterFunction", selectId: "selectId", campoId: "campoId", campoPaiId: "campoPaiId", campoDisplay: "campoDisplay", tipo: "tipo", pesquisaChange: "pesquisaChange", pesquisaAction: "pesquisaAction", limpar: "limpar", url: "url", urlItem: "urlItem", urlTree: "urlTree", empresa: "empresa", loadInit: "loadInit", treeTitulo: "treeTitulo" }, providers: [{
1192
- provide: NG_VALUE_ACCESSOR,
1193
- useExisting: InputPesquisaComponent,
1194
- multi: true
1195
- }], viewQueries: [{ propertyName: "selectElement", first: true, predicate: ["selectElement"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div style=\"padding-inline-end: 0px;\">\r\n <ion-item lines=\"none\" style=\"--background: inherited; --background-focused: transparent; margin-top: 2px;\" [class]=\"itemClass\">\r\n <ion-label position=\"{{ labelPosition }}\">{{ label }}</ion-label>\r\n <!-- formControlName=\"{{ campo }}\" -->\r\n <ion-spinner *ngIf=\"!podePesquisar\"\r\n style=\"--min-height: 0px !important; margin-inline-end: 5px !important; margin-top: 16px;\" \r\n slot=\"start\" name=\"lines\"></ion-spinner>\r\n <!-- (ionBlur)=\"verificarPesquisa()\" -->\r\n <!-- conflito com click da lista -->\r\n <ion-input #inputPesquisa\r\n [legacy]=\"true\"\r\n type=\"{{type}}\" \r\n [placeholder]=\"placeholder\" \r\n maxlength=\"{{ max }}\" \r\n (ionBlur)=\"onBlur($event)\"\r\n [value]=\"textoPesquisa\" (input)=\"writePesquisa(inputPesquisa.value)\" \r\n (keyup)=\"showPesquisa($event)\"\r\n autocomplete=\"off\" [style.--background]=\"inputBackgroungColor\"\r\n (click)=\"dropDownPesquisa(-1)\"\r\n [disabled]=\"readonly\" debounce=\"500\"></ion-input>\r\n <ion-button size=\"small\" slot=\"end\" tabindex=\"-1\"\r\n class=\"botao-limpar\" fill=\"clear\" color=\"medium\"\r\n (click)=\"limparClick()\">\r\n <ion-icon name=\"close-outline\"></ion-icon>\r\n </ion-button>\r\n \r\n \r\n <ion-button size=\"small\" slot=\"end\" tabindex=\"-1\"\r\n class=\"botao-limpar\" fill=\"clear\" color=\"medium\"\r\n (click)=\"pesquisarClick()\">\r\n <ion-icon color=\"primary\" name=\"search\"></ion-icon>\r\n </ion-button>\r\n \r\n \r\n </ion-item>\r\n \r\n <ion-list tabindex=\"-1\" [hidden]=\"!selectElementVisivel || !listaPesquisa || listaPesquisa.length == 0\" class=\"pesquisa-list\" style=\"max-height: 250px; overflow-y: auto;\">\r\n \r\n <ion-item tabindex=\"-1\" button *ngFor=\"let item of listaPesquisa\" \r\n (click)=\"selecionarComboClick(item)\" [id]=\"selectId + 'IonItem' + item['Index']\"\r\n class=\"pesquisa-item\">\r\n <!-- {{ item | json}} -->\r\n <span [class]=\"{'selected-item': item['Selected'] === true}\" [innerHTML]=\"highlight(item[campoDisplay])\"></span>\r\n </ion-item>\r\n \r\n </ion-list>\r\n \r\n <!--\r\n <ion-select interface=\"popover\" #selectElement tabindex=\"-1\" [hidden]=\"!selectElementVisivel\"\r\n (ionChange)=\"selecionarComboChange($event.target.value)\">\r\n <ion-select-option *ngFor=\"let item of listaPesquisa\" [value]=\"item[campoId]\" (click)=\"selecionarComboClick(item[campoId])\">\r\n {{ item[campoDisplay] }}\r\n </ion-select-option>\r\n </ion-select>\r\n -->\r\n \r\n <!--\r\n <select [id]=\"selectId\" #selectElement tabindex=\"-1\" [hidden]=\"!selectElementVisivel\"\r\n (change)=\"selecionarComboChange($event.target.value)\" class=\"pesquisa-select\">\r\n <option *ngFor=\"let item of listaPesquisa\" [value]=\"item[campoId]\" (click)=\"selecionarComboClick(item[campoId])\">\r\n {{ item[campoDisplay] }}\r\n </option>\r\n \r\n </select>\r\n -->\r\n \r\n <div class=\"validation-errors\" *ngIf=\"form\">\r\n \r\n <ng-container *ngFor=\"let validation of validation_messages\">\r\n <div class=\"error-message\"\r\n *ngIf=\"form.get(formControlName)?.hasError(validation.type) && (form.get(formControlName)?.dirty || form.get(formControlName)?.touched)\">\r\n &#8226; {{ validation.message }}\r\n </div>\r\n </ng-container>\r\n \r\n </div>\r\n </div>", styles: [".pesquisa-select{display:block;position:absolute;top:58px;left:20px;width:100%;z-index:800;font-size:16px;font-family:Roboto,Helvetica Neue,sans-serif;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.pesquisa-select option{overflow-y:hidden}.pesquisa-select option:hover,.pesquisa-select option:checked{background-color:#add8e6}.pesquisa-list{display:block;position:absolute;margin-left:20px;margin-top:-4px;width:calc(100% - 50px);z-index:800;border:1px lightgrey solid;border-bottom-left-radius:5px;border-bottom-right-radius:5px;padding:0}.pesquisa-item{--inner-padding-top: 0px;--inner-padding-bottom: 0px;--padding-top: 0px;--padding-bottom: 0px;--min-height: 30px !important;font-size:12px}.pesquisa-item button{padding:0}.selected-item{background-color:#add8e6}.botao-limpar{margin-top:var(--margin-botao-limpar, 25px);margin-inline-start:4px!important;--padding-start:2px;--padding-end: 2px;margin-bottom:2px!important}[hidden]{display:none!important}\n", "@charset \"UTF-8\";ion-label{margin-bottom:4px!important;--color: var(--ion-color-label, auto) !important}ion-item ion-label{overflow:initial!important}ion-input{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;max-height:var(--input-max-height, 29px);transition:.2s ease}.has-focus{border:1px solid var(--ion-color-bluetool, #1f477d)}input:focus{border:1px solid lightblue!important}input:focus ion-input,input:focus ion-textarea{border:1px solid lightblue!important}input:focus ion-label{--color: var(--ion-color-label-focus, blue) !important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-input,.item-has-focus ion-textarea{border:1px solid lightblue!important}.native-input[disabled]{opacity:var(--item-disabled-opacity, .6)!important;background-color:transparent}.item-interactive-disabled ion-label{opacity:var(--item-disabled-opacity, .6)}.error-message{font-size:small;color:var(--error-text-color, red);margin-left:15px}.padding{padding:auto}.no-padding{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px;height:55px!important}.no-padding-end{--inner-padding-end: 0px}.no-padding-start{--padding-start: 0px !important}.no-padding-no-height{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px}.padding-top{--padding-top: 0px}.item-inner{padding-right:0!important}.label-right ion-label{transform-origin:right top;align-self:flex-end;margin-bottom:4%!important}.align-to-right ion-label{position:relative;left:25%;text-align:end}.error-input ion-input,.error-shake ion-input{animation:shake .4s 1 linear;border:1px solid var(--error-text-color, red)!important}@keyframes shake{0%{transform:translate(20px)}20%{transform:translate(-20px)}40%{transform:translate(10px)}60%{transform:translate(-10px)}80%{transform:translate(4px)}to{transform:translate(0)}}.error-input ion-label,.error-shake ion-label{color:var(--error-text-color, red)!important}.error-input ion-input,.error-shake ion-input{border:1px solid red!important}.error-shake ion-input{animation:shake .4s 1 linear}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i2.IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "legacy", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "shape", "size", "spellcheck", "step", "type", "value"] }, { kind: "component", type: i2.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "counterFormatter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { kind: "component", type: i2.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: i2.IonList, selector: "ion-list", inputs: ["inset", "lines", "mode"] }, { kind: "component", type: i2.IonSpinner, selector: "ion-spinner", inputs: ["color", "duration", "name", "paused"] }, { kind: "directive", type: i2.TextValueAccessor, selector: "ion-input:not([type=number]),ion-textarea,ion-searchbar" }] }); }
1196
- }
1197
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: InputPesquisaComponent, decorators: [{
1198
- type: Component,
1199
- args: [{ selector: 'kb-input-pesquisa', providers: [{
1200
- provide: NG_VALUE_ACCESSOR,
1201
- useExisting: InputPesquisaComponent,
1202
- multi: true
1203
- }], template: "<div style=\"padding-inline-end: 0px;\">\r\n <ion-item lines=\"none\" style=\"--background: inherited; --background-focused: transparent; margin-top: 2px;\" [class]=\"itemClass\">\r\n <ion-label position=\"{{ labelPosition }}\">{{ label }}</ion-label>\r\n <!-- formControlName=\"{{ campo }}\" -->\r\n <ion-spinner *ngIf=\"!podePesquisar\"\r\n style=\"--min-height: 0px !important; margin-inline-end: 5px !important; margin-top: 16px;\" \r\n slot=\"start\" name=\"lines\"></ion-spinner>\r\n <!-- (ionBlur)=\"verificarPesquisa()\" -->\r\n <!-- conflito com click da lista -->\r\n <ion-input #inputPesquisa\r\n [legacy]=\"true\"\r\n type=\"{{type}}\" \r\n [placeholder]=\"placeholder\" \r\n maxlength=\"{{ max }}\" \r\n (ionBlur)=\"onBlur($event)\"\r\n [value]=\"textoPesquisa\" (input)=\"writePesquisa(inputPesquisa.value)\" \r\n (keyup)=\"showPesquisa($event)\"\r\n autocomplete=\"off\" [style.--background]=\"inputBackgroungColor\"\r\n (click)=\"dropDownPesquisa(-1)\"\r\n [disabled]=\"readonly\" debounce=\"500\"></ion-input>\r\n <ion-button size=\"small\" slot=\"end\" tabindex=\"-1\"\r\n class=\"botao-limpar\" fill=\"clear\" color=\"medium\"\r\n (click)=\"limparClick()\">\r\n <ion-icon name=\"close-outline\"></ion-icon>\r\n </ion-button>\r\n \r\n \r\n <ion-button size=\"small\" slot=\"end\" tabindex=\"-1\"\r\n class=\"botao-limpar\" fill=\"clear\" color=\"medium\"\r\n (click)=\"pesquisarClick()\">\r\n <ion-icon color=\"primary\" name=\"search\"></ion-icon>\r\n </ion-button>\r\n \r\n \r\n </ion-item>\r\n \r\n <ion-list tabindex=\"-1\" [hidden]=\"!selectElementVisivel || !listaPesquisa || listaPesquisa.length == 0\" class=\"pesquisa-list\" style=\"max-height: 250px; overflow-y: auto;\">\r\n \r\n <ion-item tabindex=\"-1\" button *ngFor=\"let item of listaPesquisa\" \r\n (click)=\"selecionarComboClick(item)\" [id]=\"selectId + 'IonItem' + item['Index']\"\r\n class=\"pesquisa-item\">\r\n <!-- {{ item | json}} -->\r\n <span [class]=\"{'selected-item': item['Selected'] === true}\" [innerHTML]=\"highlight(item[campoDisplay])\"></span>\r\n </ion-item>\r\n \r\n </ion-list>\r\n \r\n <!--\r\n <ion-select interface=\"popover\" #selectElement tabindex=\"-1\" [hidden]=\"!selectElementVisivel\"\r\n (ionChange)=\"selecionarComboChange($event.target.value)\">\r\n <ion-select-option *ngFor=\"let item of listaPesquisa\" [value]=\"item[campoId]\" (click)=\"selecionarComboClick(item[campoId])\">\r\n {{ item[campoDisplay] }}\r\n </ion-select-option>\r\n </ion-select>\r\n -->\r\n \r\n <!--\r\n <select [id]=\"selectId\" #selectElement tabindex=\"-1\" [hidden]=\"!selectElementVisivel\"\r\n (change)=\"selecionarComboChange($event.target.value)\" class=\"pesquisa-select\">\r\n <option *ngFor=\"let item of listaPesquisa\" [value]=\"item[campoId]\" (click)=\"selecionarComboClick(item[campoId])\">\r\n {{ item[campoDisplay] }}\r\n </option>\r\n \r\n </select>\r\n -->\r\n \r\n <div class=\"validation-errors\" *ngIf=\"form\">\r\n \r\n <ng-container *ngFor=\"let validation of validation_messages\">\r\n <div class=\"error-message\"\r\n *ngIf=\"form.get(formControlName)?.hasError(validation.type) && (form.get(formControlName)?.dirty || form.get(formControlName)?.touched)\">\r\n &#8226; {{ validation.message }}\r\n </div>\r\n </ng-container>\r\n \r\n </div>\r\n </div>", styles: [".pesquisa-select{display:block;position:absolute;top:58px;left:20px;width:100%;z-index:800;font-size:16px;font-family:Roboto,Helvetica Neue,sans-serif;border-bottom-left-radius:5px;border-bottom-right-radius:5px}.pesquisa-select option{overflow-y:hidden}.pesquisa-select option:hover,.pesquisa-select option:checked{background-color:#add8e6}.pesquisa-list{display:block;position:absolute;margin-left:20px;margin-top:-4px;width:calc(100% - 50px);z-index:800;border:1px lightgrey solid;border-bottom-left-radius:5px;border-bottom-right-radius:5px;padding:0}.pesquisa-item{--inner-padding-top: 0px;--inner-padding-bottom: 0px;--padding-top: 0px;--padding-bottom: 0px;--min-height: 30px !important;font-size:12px}.pesquisa-item button{padding:0}.selected-item{background-color:#add8e6}.botao-limpar{margin-top:var(--margin-botao-limpar, 25px);margin-inline-start:4px!important;--padding-start:2px;--padding-end: 2px;margin-bottom:2px!important}[hidden]{display:none!important}\n", "@charset \"UTF-8\";ion-label{margin-bottom:4px!important;--color: var(--ion-color-label, auto) !important}ion-item ion-label{overflow:initial!important}ion-input{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;max-height:var(--input-max-height, 29px);transition:.2s ease}.has-focus{border:1px solid var(--ion-color-bluetool, #1f477d)}input:focus{border:1px solid lightblue!important}input:focus ion-input,input:focus ion-textarea{border:1px solid lightblue!important}input:focus ion-label{--color: var(--ion-color-label-focus, blue) !important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-input,.item-has-focus ion-textarea{border:1px solid lightblue!important}.native-input[disabled]{opacity:var(--item-disabled-opacity, .6)!important;background-color:transparent}.item-interactive-disabled ion-label{opacity:var(--item-disabled-opacity, .6)}.error-message{font-size:small;color:var(--error-text-color, red);margin-left:15px}.padding{padding:auto}.no-padding{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px;height:55px!important}.no-padding-end{--inner-padding-end: 0px}.no-padding-start{--padding-start: 0px !important}.no-padding-no-height{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px}.padding-top{--padding-top: 0px}.item-inner{padding-right:0!important}.label-right ion-label{transform-origin:right top;align-self:flex-end;margin-bottom:4%!important}.align-to-right ion-label{position:relative;left:25%;text-align:end}.error-input ion-input,.error-shake ion-input{animation:shake .4s 1 linear;border:1px solid var(--error-text-color, red)!important}@keyframes shake{0%{transform:translate(20px)}20%{transform:translate(-20px)}40%{transform:translate(10px)}60%{transform:translate(-10px)}80%{transform:translate(4px)}to{transform:translate(0)}}.error-input ion-label,.error-shake ion-label{color:var(--error-text-color, red)!important}.error-input ion-input,.error-shake ion-input{border:1px solid red!important}.error-shake ion-input{animation:shake .4s 1 linear}\n"] }]
1204
- }], ctorParameters: () => [{ type: undefined, decorators: [{
1205
- type: Inject,
1206
- args: ['LibConfigService']
1207
- }] }, { type: i2$1.HttpClient }, { type: i2.ModalController }], propDecorators: { textoPesquisa: [{
1208
- type: Input
1209
- }], max: [{
1210
- type: Input
1211
- }], filterFunction: [{
1212
- type: Input
1213
- }], selectId: [{
1214
- type: Input
1215
- }], campoId: [{
1216
- type: Input
1217
- }], campoPaiId: [{
1218
- type: Input
1219
- }], campoDisplay: [{
1220
- type: Input
1221
- }], tipo: [{
1222
- type: Input
1223
- }], selectElement: [{
1224
- type: ViewChild,
1225
- args: ['selectElement', { static: false }]
1226
- }], pesquisaChange: [{
1227
- type: Input
1228
- }], pesquisaAction: [{
1229
- type: Input
1230
- }], limpar: [{
1231
- type: Input
1232
- }], url: [{
1233
- type: Input
1234
- }], urlItem: [{
1235
- type: Input
1236
- }], urlTree: [{
1237
- type: Input
1238
- }], empresa: [{
1239
- type: Input
1240
- }], loadInit: [{
1241
- type: Input
1242
- }], treeTitulo: [{
1243
- type: Input
1244
- }] } });
1245
-
1246
- class InputValorComponent extends BaseInputComponent {
1247
- writeValue(value) {
1248
- //console.log('write value', value);
1249
- this.onChange(value);
1250
- this.data = value;
1251
- }
1252
- registerOnChange(fn) {
1253
- this.onChange = fn;
1254
- }
1255
- registerOnTouched(fn) {
1256
- this.onTouch = fn;
1257
- }
1258
- setDisabledState(isDisabled) {
1259
- this.disabled = this.disabled;
1260
- }
1261
- constructor() {
1262
- super();
1263
- this.maxValor = null;
1264
- this.onChange = (data) => { };
1265
- this.onTouch = () => { };
1266
- this.disabled = false;
1267
- this.console = console;
1268
- }
1269
- ngOnInit() { }
1270
- onBlur() {
1271
- if (this.form) {
1272
- this.form.get(this.formControlName)?.markAsTouched();
1273
- }
1274
- //verificar o valor
1275
- if (this.maxValor) {
1276
- if (this.form) {
1277
- //console.log(this.form.get(this.formControlName).value);
1278
- let valor = this.strToFloatZero(this.form.get(this.formControlName).value);
1279
- if (valor > this.maxValor) {
1280
- this.form.patchValue({
1281
- [this.formControlName]: this.converterValorDecimalMil((this.maxValor * 100).toString())
1282
- });
1283
- }
1284
- }
1285
- else {
1286
- let valor = this.strToFloatZero(this.data);
1287
- if (valor > this.maxValor) {
1288
- this.data = this.converterValorDecimalMil((this.maxValor * 100).toString());
1289
- this.writeValue(this.data);
1290
- }
1291
- }
1292
- }
1293
- if (this.blur) {
1294
- this.blur.emit(this.blurArgs);
1295
- }
1296
- }
1297
- digitarValor(event) {
1298
- //this.item.vendaunitario = this.utils.converterValorDecimal(this.item.vendaunitario);
1299
- setTimeout(() => {
1300
- if (this.form) {
1301
- this.form.patchValue({
1302
- [this.formControlName]: this.converterValorDecimalMil(this.form.get(this.formControlName)?.value)
1303
- });
1304
- }
1305
- else {
1306
- this.data = this.converterValorDecimalMil(this.data);
1307
- this.writeValue(this.data);
1308
- }
1309
- }, 100);
1310
- return true;
1311
- }
1312
- isEmpty(str) {
1313
- return str == null || str == undefined || str == '';
1314
- }
1315
- converterValorDecimalMil(campo, casas = 2) {
1316
- if (!this.isEmpty(campo)) {
1317
- //console.log('converterValorDecimal');
1318
- //console.log('campo:', campo, ' replaced: ', campo.replace(',', '').replace('.', ''));
1319
- if (campo == '-') {
1320
- return campo;
1321
- }
1322
- let valor = parseFloat(campo.replace(',', '').replace('.', '').replace('.', '').replace('.', ''));
1323
- if (isNaN(valor)) {
1324
- return '';
1325
- }
1326
- let valordiv = parseInt("1" + this.stringOfChar("0", casas));
1327
- //valor /= 100;
1328
- console.log(valor, '/', valordiv);
1329
- valor /= valordiv;
1330
- console.log('=', valor);
1331
- return this.decimalToStringMil(valor);
1332
- /*
1333
- var str = valor.toString().replace('.', ',');
1334
- var aStr = str.split(',');
1335
- if (aStr.length == 1) {
1336
- //str += ',00';
1337
- str += ',' + this.stringOfChar('0', casas);
1338
- }
1339
- else {
1340
- //str += this.stringOfChar('0', 2 - aStr[1].length);
1341
- str += this.stringOfChar('0', casas - aStr[1].length);
1342
- }
1343
- return str;
1344
- */
1345
- }
1346
- else
1347
- return campo;
1348
- }
1349
- decimalToStringMil(number) {
1350
- if (number != null) {
1351
- if (number == 0 || number == '0') {
1352
- return '0,00';
1353
- }
1354
- //console.log(number);
1355
- let numero = number.toFixed(2).split('.');
1356
- numero[0] = numero[0].split(/(?=(?:...)*$)/).join('.');
1357
- return numero.join(',').replace('-.', '-');
1358
- }
1359
- else
1360
- return '';
1361
- }
1362
- stringOfChar(str, tam) {
1363
- var res = '';
1364
- for (var i = 0; i < tam; i++) {
1365
- res += str;
1366
- }
1367
- return res;
1368
- }
1369
- strToFloatZero(str) {
1370
- if (Number.isFinite(str))
1371
- return str;
1372
- if (this.isEmpty(str))
1373
- return 0;
1374
- else
1375
- return parseFloat(str.replace('.', '').replace(',', '.'));
1376
- }
1377
- setFocus() {
1378
- this.inputValorEdit.nativeElement.setFocus();
1379
- }
1380
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: InputValorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1381
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: InputValorComponent, selector: "kb-input-valor", inputs: { maxValor: "maxValor" }, providers: [{
1382
- provide: NG_VALUE_ACCESSOR,
1383
- useExisting: InputValorComponent,
1384
- multi: true
1385
- }], viewQueries: [{ propertyName: "inputValorEdit", first: true, predicate: ["inputValor"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, ngImport: i0, template: "<!--\r\n<div [formGroup]=\"form\">\r\n-->\r\n<div>\r\n <ion-item lines=\"none\" style=\"--background-focused: transparent;\" [class]=\"itemClass\"\r\n [ngClass]=\"form?.get(formControlName)?.errors && (form?.get(formControlName)?.dirty || form?.get(formControlName)?.touched) ? 'error-shake' : '' \"\r\n >\r\n <ion-label position=\"{{ labelPosition }}\">{{ label }}</ion-label>\r\n <!-- formControlName=\"{{ formControlName }}\" -->\r\n <ion-input #inputValor\r\n type=\"text\" \r\n [placeholder]=\"placeholder\" \r\n maxlength=\"{{ max }}\"\r\n (ionBlur)=\"onBlur()\"\r\n [value]=\"data\"\r\n (input)=\"writeValue(inputValor.value)\" \r\n (keypress)=\"digitarValor($event)\"\r\n [clearInput]=\"botaoLimpar\"\r\n [disabled]=\"readonly\"></ion-input>\r\n </ion-item>\r\n \r\n <div class=\"validation-errors\" *ngIf=\"form\">\r\n \r\n <ng-container *ngFor=\"let validation of validation_messages\">\r\n <div class=\"error-message\"\r\n *ngIf=\"form.get(formControlName)?.hasError(validation.type) && (form.get(formControlName)?.dirty || form.get(formControlName)?.touched)\">\r\n &#8226; {{ validation.message }}\r\n </div>\r\n </ng-container>\r\n \r\n </div>\r\n </div>", styles: [".item-inner{padding-right:0!important}.label-right ion-label{transform-origin:right top;align-self:flex-end}.align-to-right ion-label{position:relative;left:25%;text-align:end}\n", "@charset \"UTF-8\";ion-label{margin-bottom:4px!important;--color: var(--ion-color-label, auto) !important}ion-item ion-label{overflow:initial!important}ion-input{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;max-height:var(--input-max-height, 29px);transition:.2s ease}.has-focus{border:1px solid var(--ion-color-bluetool, #1f477d)}input:focus{border:1px solid lightblue!important}input:focus ion-input,input:focus ion-textarea{border:1px solid lightblue!important}input:focus ion-label{--color: var(--ion-color-label-focus, blue) !important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-input,.item-has-focus ion-textarea{border:1px solid lightblue!important}.native-input[disabled]{opacity:var(--item-disabled-opacity, .6)!important;background-color:transparent}.item-interactive-disabled ion-label{opacity:var(--item-disabled-opacity, .6)}.error-message{font-size:small;color:var(--error-text-color, red);margin-left:15px}.padding{padding:auto}.no-padding{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px;height:55px!important}.no-padding-end{--inner-padding-end: 0px}.no-padding-start{--padding-start: 0px !important}.no-padding-no-height{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px}.padding-top{--padding-top: 0px}.item-inner{padding-right:0!important}.label-right ion-label{transform-origin:right top;align-self:flex-end;margin-bottom:4%!important}.align-to-right ion-label{position:relative;left:25%;text-align:end}.error-input ion-input,.error-shake ion-input{animation:shake .4s 1 linear;border:1px solid var(--error-text-color, red)!important}@keyframes shake{0%{transform:translate(20px)}20%{transform:translate(-20px)}40%{transform:translate(10px)}60%{transform:translate(-10px)}80%{transform:translate(4px)}to{transform:translate(0)}}.error-input ion-label,.error-shake ion-label{color:var(--error-text-color, red)!important}.error-input ion-input,.error-shake ion-input{border:1px solid red!important}.error-shake ion-input{animation:shake .4s 1 linear}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "legacy", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "shape", "size", "spellcheck", "step", "type", "value"] }, { kind: "component", type: i2.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "counterFormatter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { kind: "component", type: i2.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "directive", type: i2.TextValueAccessor, selector: "ion-input:not([type=number]),ion-textarea,ion-searchbar" }] }); }
1386
- }
1387
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: InputValorComponent, decorators: [{
1388
- type: Component,
1389
- args: [{ selector: 'kb-input-valor', providers: [{
1390
- provide: NG_VALUE_ACCESSOR,
1391
- useExisting: InputValorComponent,
1392
- multi: true
1393
- }], template: "<!--\r\n<div [formGroup]=\"form\">\r\n-->\r\n<div>\r\n <ion-item lines=\"none\" style=\"--background-focused: transparent;\" [class]=\"itemClass\"\r\n [ngClass]=\"form?.get(formControlName)?.errors && (form?.get(formControlName)?.dirty || form?.get(formControlName)?.touched) ? 'error-shake' : '' \"\r\n >\r\n <ion-label position=\"{{ labelPosition }}\">{{ label }}</ion-label>\r\n <!-- formControlName=\"{{ formControlName }}\" -->\r\n <ion-input #inputValor\r\n type=\"text\" \r\n [placeholder]=\"placeholder\" \r\n maxlength=\"{{ max }}\"\r\n (ionBlur)=\"onBlur()\"\r\n [value]=\"data\"\r\n (input)=\"writeValue(inputValor.value)\" \r\n (keypress)=\"digitarValor($event)\"\r\n [clearInput]=\"botaoLimpar\"\r\n [disabled]=\"readonly\"></ion-input>\r\n </ion-item>\r\n \r\n <div class=\"validation-errors\" *ngIf=\"form\">\r\n \r\n <ng-container *ngFor=\"let validation of validation_messages\">\r\n <div class=\"error-message\"\r\n *ngIf=\"form.get(formControlName)?.hasError(validation.type) && (form.get(formControlName)?.dirty || form.get(formControlName)?.touched)\">\r\n &#8226; {{ validation.message }}\r\n </div>\r\n </ng-container>\r\n \r\n </div>\r\n </div>", styles: [".item-inner{padding-right:0!important}.label-right ion-label{transform-origin:right top;align-self:flex-end}.align-to-right ion-label{position:relative;left:25%;text-align:end}\n", "@charset \"UTF-8\";ion-label{margin-bottom:4px!important;--color: var(--ion-color-label, auto) !important}ion-item ion-label{overflow:initial!important}ion-input{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;max-height:var(--input-max-height, 29px);transition:.2s ease}.has-focus{border:1px solid var(--ion-color-bluetool, #1f477d)}input:focus{border:1px solid lightblue!important}input:focus ion-input,input:focus ion-textarea{border:1px solid lightblue!important}input:focus ion-label{--color: var(--ion-color-label-focus, blue) !important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-input,.item-has-focus ion-textarea{border:1px solid lightblue!important}.native-input[disabled]{opacity:var(--item-disabled-opacity, .6)!important;background-color:transparent}.item-interactive-disabled ion-label{opacity:var(--item-disabled-opacity, .6)}.error-message{font-size:small;color:var(--error-text-color, red);margin-left:15px}.padding{padding:auto}.no-padding{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px;height:55px!important}.no-padding-end{--inner-padding-end: 0px}.no-padding-start{--padding-start: 0px !important}.no-padding-no-height{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px}.padding-top{--padding-top: 0px}.item-inner{padding-right:0!important}.label-right ion-label{transform-origin:right top;align-self:flex-end;margin-bottom:4%!important}.align-to-right ion-label{position:relative;left:25%;text-align:end}.error-input ion-input,.error-shake ion-input{animation:shake .4s 1 linear;border:1px solid var(--error-text-color, red)!important}@keyframes shake{0%{transform:translate(20px)}20%{transform:translate(-20px)}40%{transform:translate(10px)}60%{transform:translate(-10px)}80%{transform:translate(4px)}to{transform:translate(0)}}.error-input ion-label,.error-shake ion-label{color:var(--error-text-color, red)!important}.error-input ion-input,.error-shake ion-input{border:1px solid red!important}.error-shake ion-input{animation:shake .4s 1 linear}\n"] }]
1394
- }], ctorParameters: () => [], propDecorators: { maxValor: [{
1395
- type: Input
1396
- }], inputValorEdit: [{
1397
- type: ViewChild,
1398
- args: ['inputValor', { read: ElementRef, static: true }]
1399
- }] } });
1400
-
1401
- class InputAreaComponent extends BaseInputComponent {
1402
- writeValue(value) {
1403
- //console.log('write value', value);
1404
- this.onChange(value);
1405
- this.data = value;
1406
- }
1407
- registerOnChange(fn) {
1408
- this.onChange = fn;
1409
- }
1410
- registerOnTouched(fn) {
1411
- this.onTouch = fn;
1412
- }
1413
- setDisabledState(isDisabled) {
1414
- this.disabled = this.disabled;
1415
- }
1416
- constructor(renderer) {
1417
- super();
1418
- this.renderer = renderer;
1419
- this.linhas = 5;
1420
- this.onChange = (data) => { };
1421
- this.onTouch = () => { };
1422
- this.disabled = false;
1423
- this.console = console;
1424
- }
1425
- ngOnInit() { }
1426
- onBlur() {
1427
- //remover classe do ion-item
1428
- setTimeout(() => {
1429
- //this.renderer.addClass(document.getElementById("item-select"), "item-has-focus");
1430
- this.renderer.removeClass(this.itemArea.nativeElement, "item-has-focus");
1431
- //console.log('select focused', document.getElementById("item-select"));
1432
- }, 200);
1433
- if (this.form) {
1434
- this.form.get(this.formControlName)?.markAsTouched();
1435
- }
1436
- }
1437
- entered() {
1438
- //adicionar classe ao ion-item
1439
- // console.log('select focused');
1440
- setTimeout(() => {
1441
- //this.renderer.addClass(document.getElementById("item-select"), "item-has-focus");
1442
- this.renderer.addClass(this.itemArea.nativeElement, "item-has-focus");
1443
- //console.log('select focused', document.getElementById("item-select"));
1444
- }, 200);
1445
- }
1446
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: InputAreaComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
1447
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: InputAreaComponent, selector: "kb-input-area", inputs: { linhas: "linhas" }, providers: [{
1448
- provide: NG_VALUE_ACCESSOR,
1449
- useExisting: InputAreaComponent,
1450
- multi: true
1451
- }], viewQueries: [{ propertyName: "itemArea", first: true, predicate: ["itemArea"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: "<!-- \r\n maxlength=\"{{ max }}\"\r\n-->\r\n<div>\r\n <ion-item lines=\"none\" style=\"--background-focused: transparent;\" [class]=\"itemClass\" #itemArea>\r\n <ion-label position=\"{{ labelPosition }}\">{{ label }}</ion-label>\r\n <!-- formControlName=\"{{ formControlName }}\" -->\r\n <textarea #inputArea \r\n [placeholder]=\"placeholder\" \r\n [maxLength]=\"max\"\r\n (ionBlur)=\"onBlur()\"\r\n [value]=\"data\"\r\n [rows]=\"linhas\" \r\n (input)=\"writeValue(inputArea.value)\"\r\n [disabled]=\"readonly\"\r\n (focus)=\"entered()\"\r\n ></textarea>\r\n </ion-item>\r\n \r\n <div class=\"validation-errors\" *ngIf=\"form\">\r\n \r\n <ng-container *ngFor=\"let validation of validation_messages\">\r\n <div class=\"error-message\"\r\n *ngIf=\"form.get(formControlName)?.hasError(validation.type) && (form.get(formControlName)?.dirty || form.get(formControlName)?.touched)\">\r\n &#8226; {{ validation.message }}\r\n </div>\r\n </ng-container>\r\n \r\n </div>\r\n </div>", styles: ["@charset \"UTF-8\";ion-label{margin-bottom:4px!important}ion-textarea{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px}textarea{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;resize:none;background-color:#fff}textarea::-webkit-scrollbar{width:10px;height:10px}textarea::-webkit-scrollbar-track{background:#f1f1f1}textarea::-webkit-scrollbar-thumb{border-radius:12px;background:var(--scroll-color-thumb, #808080)}textarea::-webkit-scrollbar-thumb:hover{background:var(--scroll-color-hover, #5c5c5c)}textarea:focus{outline:none!important;border:1px solid lightblue!important}textarea:focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}\n", "@charset \"UTF-8\";ion-label{margin-bottom:4px!important;--color: var(--ion-color-label, auto) !important}ion-item ion-label{overflow:initial!important}ion-input{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;max-height:var(--input-max-height, 29px);transition:.2s ease}.has-focus{border:1px solid var(--ion-color-bluetool, #1f477d)}input:focus{border:1px solid lightblue!important}input:focus ion-input,input:focus ion-textarea{border:1px solid lightblue!important}input:focus ion-label{--color: var(--ion-color-label-focus, blue) !important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-input,.item-has-focus ion-textarea{border:1px solid lightblue!important}.native-input[disabled]{opacity:var(--item-disabled-opacity, .6)!important;background-color:transparent}.item-interactive-disabled ion-label{opacity:var(--item-disabled-opacity, .6)}.error-message{font-size:small;color:var(--error-text-color, red);margin-left:15px}.padding{padding:auto}.no-padding{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px;height:55px!important}.no-padding-end{--inner-padding-end: 0px}.no-padding-start{--padding-start: 0px !important}.no-padding-no-height{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px}.padding-top{--padding-top: 0px}.item-inner{padding-right:0!important}.label-right ion-label{transform-origin:right top;align-self:flex-end;margin-bottom:4%!important}.align-to-right ion-label{position:relative;left:25%;text-align:end}.error-input ion-input,.error-shake ion-input{animation:shake .4s 1 linear;border:1px solid var(--error-text-color, red)!important}@keyframes shake{0%{transform:translate(20px)}20%{transform:translate(-20px)}40%{transform:translate(10px)}60%{transform:translate(-10px)}80%{transform:translate(4px)}to{transform:translate(0)}}.error-input ion-label,.error-shake ion-label{color:var(--error-text-color, red)!important}.error-input ion-input,.error-shake ion-input{border:1px solid red!important}.error-shake ion-input{animation:shake .4s 1 linear}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "counterFormatter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { kind: "component", type: i2.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }] }); }
1452
- }
1453
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: InputAreaComponent, decorators: [{
1454
- type: Component,
1455
- args: [{ selector: 'kb-input-area', providers: [{
1456
- provide: NG_VALUE_ACCESSOR,
1457
- useExisting: InputAreaComponent,
1458
- multi: true
1459
- }], template: "<!-- \r\n maxlength=\"{{ max }}\"\r\n-->\r\n<div>\r\n <ion-item lines=\"none\" style=\"--background-focused: transparent;\" [class]=\"itemClass\" #itemArea>\r\n <ion-label position=\"{{ labelPosition }}\">{{ label }}</ion-label>\r\n <!-- formControlName=\"{{ formControlName }}\" -->\r\n <textarea #inputArea \r\n [placeholder]=\"placeholder\" \r\n [maxLength]=\"max\"\r\n (ionBlur)=\"onBlur()\"\r\n [value]=\"data\"\r\n [rows]=\"linhas\" \r\n (input)=\"writeValue(inputArea.value)\"\r\n [disabled]=\"readonly\"\r\n (focus)=\"entered()\"\r\n ></textarea>\r\n </ion-item>\r\n \r\n <div class=\"validation-errors\" *ngIf=\"form\">\r\n \r\n <ng-container *ngFor=\"let validation of validation_messages\">\r\n <div class=\"error-message\"\r\n *ngIf=\"form.get(formControlName)?.hasError(validation.type) && (form.get(formControlName)?.dirty || form.get(formControlName)?.touched)\">\r\n &#8226; {{ validation.message }}\r\n </div>\r\n </ng-container>\r\n \r\n </div>\r\n </div>", styles: ["@charset \"UTF-8\";ion-label{margin-bottom:4px!important}ion-textarea{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px}textarea{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;resize:none;background-color:#fff}textarea::-webkit-scrollbar{width:10px;height:10px}textarea::-webkit-scrollbar-track{background:#f1f1f1}textarea::-webkit-scrollbar-thumb{border-radius:12px;background:var(--scroll-color-thumb, #808080)}textarea::-webkit-scrollbar-thumb:hover{background:var(--scroll-color-hover, #5c5c5c)}textarea:focus{outline:none!important;border:1px solid lightblue!important}textarea:focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}\n", "@charset \"UTF-8\";ion-label{margin-bottom:4px!important;--color: var(--ion-color-label, auto) !important}ion-item ion-label{overflow:initial!important}ion-input{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;max-height:var(--input-max-height, 29px);transition:.2s ease}.has-focus{border:1px solid var(--ion-color-bluetool, #1f477d)}input:focus{border:1px solid lightblue!important}input:focus ion-input,input:focus ion-textarea{border:1px solid lightblue!important}input:focus ion-label{--color: var(--ion-color-label-focus, blue) !important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-input,.item-has-focus ion-textarea{border:1px solid lightblue!important}.native-input[disabled]{opacity:var(--item-disabled-opacity, .6)!important;background-color:transparent}.item-interactive-disabled ion-label{opacity:var(--item-disabled-opacity, .6)}.error-message{font-size:small;color:var(--error-text-color, red);margin-left:15px}.padding{padding:auto}.no-padding{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px;height:55px!important}.no-padding-end{--inner-padding-end: 0px}.no-padding-start{--padding-start: 0px !important}.no-padding-no-height{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px}.padding-top{--padding-top: 0px}.item-inner{padding-right:0!important}.label-right ion-label{transform-origin:right top;align-self:flex-end;margin-bottom:4%!important}.align-to-right ion-label{position:relative;left:25%;text-align:end}.error-input ion-input,.error-shake ion-input{animation:shake .4s 1 linear;border:1px solid var(--error-text-color, red)!important}@keyframes shake{0%{transform:translate(20px)}20%{transform:translate(-20px)}40%{transform:translate(10px)}60%{transform:translate(-10px)}80%{transform:translate(4px)}to{transform:translate(0)}}.error-input ion-label,.error-shake ion-label{color:var(--error-text-color, red)!important}.error-input ion-input,.error-shake ion-input{border:1px solid red!important}.error-shake ion-input{animation:shake .4s 1 linear}\n"] }]
1460
- }], ctorParameters: () => [{ type: i0.Renderer2 }], propDecorators: { linhas: [{
1461
- type: Input
1462
- }], itemArea: [{
1463
- type: ViewChild,
1464
- args: ["itemArea", { read: ElementRef }]
1465
- }] } });
1466
-
1467
- class InputCepComponent extends BaseInputComponent {
1468
- constructor() {
1469
- super();
1470
- this.formato = '00000-000';
1471
- this.keyEnter = null;
1472
- this.getResultados = new EventEmitter();
1473
- //control value acessor
1474
- this.data = null;
1475
- this.onChange = (data) => { };
1476
- this.onTouch = () => { };
1477
- this.disabled = false;
1478
- }
1479
- writeValue(value) {
1480
- //console.log('write value', value);
1481
- this.onChange(value);
1482
- this.data = value;
1483
- }
1484
- registerOnChange(fn) {
1485
- this.onChange = fn;
1486
- }
1487
- registerOnTouched(fn) {
1488
- this.onTouch = fn;
1489
- }
1490
- setDisabledState(isDisabled) {
1491
- this.disabled = this.disabled;
1492
- }
1493
- ngOnInit() {
1494
- }
1495
- digitarFormatado(event) {
1496
- //console.log(event);
1497
- if ((event.keyCode >= 48 && event.keyCode <= 57)
1498
- || (event.keyCode >= 96 && event.keyCode <= 105)
1499
- || (event.keyCode == 8)
1500
- || (event.keyCode == 9)
1501
- || (event.keyCode == 39)
1502
- || (event.keyCode == 37)
1503
- || (event.keyCode == 46)) {
1504
- //console.log(this.formControlName, this.form.get(this.formControlName).value);
1505
- setTimeout(() => {
1506
- if (this.form) {
1507
- this.form.patchValue({
1508
- [this.formControlName]: this.formataCampoValor(this.form.get(this.formControlName)?.value, this.formato ?? '', event)
1509
- });
1510
- }
1511
- else {
1512
- this.data = this.formataCampoValor(this.data ?? '', this.formato ?? '', event);
1513
- this.writeValue(this.data);
1514
- }
1515
- }, 100);
1516
- return true;
1517
- }
1518
- else {
1519
- return false;
1520
- }
1521
- }
1522
- onKeyEnter() {
1523
- if (this.keyEnter != null) {
1524
- this.keyEnter();
1525
- }
1526
- else {
1527
- if (this.getResultados != null) {
1528
- this.pesquisarClick();
1529
- }
1530
- }
1531
- }
1532
- onBlur() {
1533
- if (this.form) {
1534
- this.form.get(this.formControlName)?.markAsTouched();
1535
- }
1536
- if (this.blur) {
1537
- this.blur.emit(this.blurArgs);
1538
- }
1539
- }
1540
- formataCampoValor(valor, Mascara, evento) {
1541
- //console.log(valor);
1542
- if (!valor)
1543
- return null;
1544
- //console.log(evento);
1545
- //if (!this.keypressInteiro(evento))
1546
- // return;
1547
- var boleanoMascara;
1548
- var Digitato = evento != null ? evento.keyCode : 0;
1549
- let exp = /\-|\.|\/|\(|\)| /g;
1550
- let campoSoNumeros = valor.replace(exp, "");
1551
- var posicaoCampo = 0;
1552
- var NovoValorCampo = "";
1553
- var TamanhoMascara = campoSoNumeros.length;
1554
- ;
1555
- if (Digitato != 8) { // backspace
1556
- for (let i = 0; i <= TamanhoMascara; i++) {
1557
- boleanoMascara = ((Mascara.charAt(i) == "-") || (Mascara.charAt(i) == ".")
1558
- || (Mascara.charAt(i) == "/"));
1559
- boleanoMascara = boleanoMascara || ((Mascara.charAt(i) == "(")
1560
- || (Mascara.charAt(i) == ")") || (Mascara.charAt(i) == " "));
1561
- if (boleanoMascara) {
1562
- NovoValorCampo += Mascara.charAt(i);
1563
- TamanhoMascara++;
1564
- }
1565
- else {
1566
- NovoValorCampo += campoSoNumeros.charAt(posicaoCampo);
1567
- posicaoCampo++;
1568
- }
1569
- }
1570
- return NovoValorCampo;
1571
- }
1572
- else {
1573
- return valor;
1574
- }
1575
- }
1576
- pesquisarClick() {
1577
- const cep = this.data;
1578
- //se não estiver informado o cep, não fazer a pesquisa
1579
- if (cep == null || cep == "") {
1580
- return;
1581
- }
1582
- this.getEnderecoPeloCep(cep).subscribe({
1583
- next: (result) => {
1584
- //console.log('result CEP', result);
1585
- let cidadePesquisa = result.localidade;
1586
- cidadePesquisa = this.converteCaracteresEspeciais(cidadePesquisa.toUpperCase());
1587
- if (this.getResultados) {
1588
- this.getResultados.emit(result);
1589
- }
1590
- }, error: (error) => {
1591
- }
1592
- });
1593
- }
1594
- //substituição de caracteres
1595
- converteCaracteresEspeciais(nome) {
1596
- var res = nome.replace(/Ã/g, "A");
1597
- res = res.replace(/Á/g, "A");
1598
- res = res.replace(/Ç/g, "C");
1599
- res = res.replace(/É/g, "E");
1600
- res = res.replace(/Â/g, "A");
1601
- res = res.replace(/Ô/g, "O");
1602
- res = res.replace(/Ó/g, "O");
1603
- res = res.replace(/Ú/g, "U");
1604
- res = res.replace(/Í/g, "I");
1605
- return res;
1606
- }
1607
- getEnderecoPeloCep(cep) {
1608
- return new Observable((x) => {
1609
- var request = new XMLHttpRequest();
1610
- request.open('get', `https://viacep.com.br/ws/${cep}/json/`, true);
1611
- request.send();
1612
- request.onload = function () {
1613
- var data = JSON.parse(this.response);
1614
- x.next(data);
1615
- };
1616
- });
1617
- }
1618
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: InputCepComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1619
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: InputCepComponent, selector: "kb-input-cep", inputs: { formato: "formato", keyEnter: "keyEnter" }, outputs: { getResultados: "getResultados" }, providers: [{
1620
- provide: NG_VALUE_ACCESSOR,
1621
- useExisting: InputCepComponent,
1622
- multi: true
1623
- }], usesInheritance: true, ngImport: i0, template: "<!--\r\n<div [formGroup]=\"form\">\r\n-->\r\n<!--comando --inner-padding-end: utilizado pra remover padding desnecess\u00E1rios-->\r\n<div>\r\n <ion-item lines=\"none\" style=\"--background: inherited;--background-focused: transparent;--inner-padding-end: 0px;\" [class]=\"itemClass\"\r\n [ngClass]=\"form?.get(formControlName)?.errors && (form?.get(formControlName)?.dirty || form?.get(formControlName)?.touched) ? 'error-shake' : '' \"\r\n >\r\n <ion-label [position]=\"labelPosition\">{{ label }}</ion-label>\r\n <!-- formControlName={{formControlName}} -->\r\n <ion-input #inputCep\r\n type=\"tel\" \r\n [placeholder]=\"placeholder\"\r\n maxlength=\"{{ max }}\" \r\n (keydown)=\"digitarFormatado($event)\" \r\n (keyup.enter)=\"onKeyEnter()\"\r\n (ionBlur)=\"onBlur()\"\r\n [value]=\"data\"\r\n (input)=\"writeValue(inputCep.value)\"\r\n [disabled]=\"readonly\"></ion-input>\r\n\r\n <ion-button size=\"small\" slot=\"end\" tabindex=\"-1\"\r\n style=\"margin-top: 25px; margin-inline-start: 4px !important; --padding-start:2px; --padding-end: 2px;\" fill=\"clear\" color=\"medium\"\r\n (click)=\"pesquisarClick()\">\r\n <ion-icon color=\"primary\" name=\"search\"></ion-icon>\r\n </ion-button>\r\n \r\n </ion-item>\r\n \r\n <div class=\"validation-errors\" *ngIf=\"form\">\r\n <ng-container *ngFor=\"let validation of validation_messages\">\r\n <div class=\"error-message\"\r\n *ngIf=\"form && form.get(formControlName)?.hasError(validation.type) && (form.get(formControlName)?.dirty || form.get(formControlName)?.touched)\">\r\n &#8226; {{ validation.message }}\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>", styles: ["", "@charset \"UTF-8\";ion-label{margin-bottom:4px!important;--color: var(--ion-color-label, auto) !important}ion-item ion-label{overflow:initial!important}ion-input{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;max-height:var(--input-max-height, 29px);transition:.2s ease}.has-focus{border:1px solid var(--ion-color-bluetool, #1f477d)}input:focus{border:1px solid lightblue!important}input:focus ion-input,input:focus ion-textarea{border:1px solid lightblue!important}input:focus ion-label{--color: var(--ion-color-label-focus, blue) !important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-input,.item-has-focus ion-textarea{border:1px solid lightblue!important}.native-input[disabled]{opacity:var(--item-disabled-opacity, .6)!important;background-color:transparent}.item-interactive-disabled ion-label{opacity:var(--item-disabled-opacity, .6)}.error-message{font-size:small;color:var(--error-text-color, red);margin-left:15px}.padding{padding:auto}.no-padding{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px;height:55px!important}.no-padding-end{--inner-padding-end: 0px}.no-padding-start{--padding-start: 0px !important}.no-padding-no-height{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px}.padding-top{--padding-top: 0px}.item-inner{padding-right:0!important}.label-right ion-label{transform-origin:right top;align-self:flex-end;margin-bottom:4%!important}.align-to-right ion-label{position:relative;left:25%;text-align:end}.error-input ion-input,.error-shake ion-input{animation:shake .4s 1 linear;border:1px solid var(--error-text-color, red)!important}@keyframes shake{0%{transform:translate(20px)}20%{transform:translate(-20px)}40%{transform:translate(10px)}60%{transform:translate(-10px)}80%{transform:translate(4px)}to{transform:translate(0)}}.error-input ion-label,.error-shake ion-label{color:var(--error-text-color, red)!important}.error-input ion-input,.error-shake ion-input{border:1px solid red!important}.error-shake ion-input{animation:shake .4s 1 linear}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i2.IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "legacy", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "shape", "size", "spellcheck", "step", "type", "value"] }, { kind: "component", type: i2.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "counterFormatter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { kind: "component", type: i2.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "directive", type: i2.TextValueAccessor, selector: "ion-input:not([type=number]),ion-textarea,ion-searchbar" }] }); }
1624
- }
1625
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: InputCepComponent, decorators: [{
1626
- type: Component,
1627
- args: [{ selector: 'kb-input-cep', providers: [{
1628
- provide: NG_VALUE_ACCESSOR,
1629
- useExisting: InputCepComponent,
1630
- multi: true
1631
- }], template: "<!--\r\n<div [formGroup]=\"form\">\r\n-->\r\n<!--comando --inner-padding-end: utilizado pra remover padding desnecess\u00E1rios-->\r\n<div>\r\n <ion-item lines=\"none\" style=\"--background: inherited;--background-focused: transparent;--inner-padding-end: 0px;\" [class]=\"itemClass\"\r\n [ngClass]=\"form?.get(formControlName)?.errors && (form?.get(formControlName)?.dirty || form?.get(formControlName)?.touched) ? 'error-shake' : '' \"\r\n >\r\n <ion-label [position]=\"labelPosition\">{{ label }}</ion-label>\r\n <!-- formControlName={{formControlName}} -->\r\n <ion-input #inputCep\r\n type=\"tel\" \r\n [placeholder]=\"placeholder\"\r\n maxlength=\"{{ max }}\" \r\n (keydown)=\"digitarFormatado($event)\" \r\n (keyup.enter)=\"onKeyEnter()\"\r\n (ionBlur)=\"onBlur()\"\r\n [value]=\"data\"\r\n (input)=\"writeValue(inputCep.value)\"\r\n [disabled]=\"readonly\"></ion-input>\r\n\r\n <ion-button size=\"small\" slot=\"end\" tabindex=\"-1\"\r\n style=\"margin-top: 25px; margin-inline-start: 4px !important; --padding-start:2px; --padding-end: 2px;\" fill=\"clear\" color=\"medium\"\r\n (click)=\"pesquisarClick()\">\r\n <ion-icon color=\"primary\" name=\"search\"></ion-icon>\r\n </ion-button>\r\n \r\n </ion-item>\r\n \r\n <div class=\"validation-errors\" *ngIf=\"form\">\r\n <ng-container *ngFor=\"let validation of validation_messages\">\r\n <div class=\"error-message\"\r\n *ngIf=\"form && form.get(formControlName)?.hasError(validation.type) && (form.get(formControlName)?.dirty || form.get(formControlName)?.touched)\">\r\n &#8226; {{ validation.message }}\r\n </div>\r\n </ng-container>\r\n </div>\r\n </div>", styles: ["@charset \"UTF-8\";ion-label{margin-bottom:4px!important;--color: var(--ion-color-label, auto) !important}ion-item ion-label{overflow:initial!important}ion-input{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;max-height:var(--input-max-height, 29px);transition:.2s ease}.has-focus{border:1px solid var(--ion-color-bluetool, #1f477d)}input:focus{border:1px solid lightblue!important}input:focus ion-input,input:focus ion-textarea{border:1px solid lightblue!important}input:focus ion-label{--color: var(--ion-color-label-focus, blue) !important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-input,.item-has-focus ion-textarea{border:1px solid lightblue!important}.native-input[disabled]{opacity:var(--item-disabled-opacity, .6)!important;background-color:transparent}.item-interactive-disabled ion-label{opacity:var(--item-disabled-opacity, .6)}.error-message{font-size:small;color:var(--error-text-color, red);margin-left:15px}.padding{padding:auto}.no-padding{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px;height:55px!important}.no-padding-end{--inner-padding-end: 0px}.no-padding-start{--padding-start: 0px !important}.no-padding-no-height{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px}.padding-top{--padding-top: 0px}.item-inner{padding-right:0!important}.label-right ion-label{transform-origin:right top;align-self:flex-end;margin-bottom:4%!important}.align-to-right ion-label{position:relative;left:25%;text-align:end}.error-input ion-input,.error-shake ion-input{animation:shake .4s 1 linear;border:1px solid var(--error-text-color, red)!important}@keyframes shake{0%{transform:translate(20px)}20%{transform:translate(-20px)}40%{transform:translate(10px)}60%{transform:translate(-10px)}80%{transform:translate(4px)}to{transform:translate(0)}}.error-input ion-label,.error-shake ion-label{color:var(--error-text-color, red)!important}.error-input ion-input,.error-shake ion-input{border:1px solid red!important}.error-shake ion-input{animation:shake .4s 1 linear}\n"] }]
1632
- }], ctorParameters: () => [], propDecorators: { formato: [{
1633
- type: Input
1634
- }], keyEnter: [{
1635
- type: Input
1636
- }], getResultados: [{
1637
- type: Output
1638
- }] } });
1639
-
1640
- class InputArquivoComponent {
1641
- showImageBrowser() {
1642
- this.myInput.nativeElement.click();
1643
- }
1644
- writeValue(value) {
1645
- this.onChange(value);
1646
- this.data = value;
1647
- if (this.callback)
1648
- this.callback.emit(this.filename);
1649
- }
1650
- registerOnChange(fn) {
1651
- this.onChange = fn;
1652
- }
1653
- registerOnTouched(fn) {
1654
- this.onTouch = fn;
1655
- }
1656
- setDisabledState(isDisabled) {
1657
- this.disabled = this.disabled;
1658
- }
1659
- constructor() {
1660
- this.subir = false;
1661
- this.callback = new EventEmitter();
1662
- this.tipoArquivo = "image/*";
1663
- this.fileSelected = new EventEmitter();
1664
- this.form = false;
1665
- this.showIcon = false;
1666
- this.btnExpand = "block";
1667
- this.btnColor = "primary";
1668
- this.btnFill = "outline";
1669
- this.iconSlot = "start";
1670
- this.arquivoTipos = "image/*";
1671
- this.readOnly = false;
1672
- this.sucessoEvent = new Subject();
1673
- this.onChange = (selectedColor) => { };
1674
- this.onTouch = () => { };
1675
- this.disabled = false;
1676
- }
1677
- ngOnInit() {
1678
- }
1679
- loadImagem() {
1680
- //console.log(this.myInput);
1681
- this.formFile = this.myInput.nativeElement.files[0];
1682
- if (this.fileSelected) {
1683
- this.fileSelected.emit({ content: this.formFile, name: this.myInput.nativeElement.files[0].name });
1684
- }
1685
- if (this.form) {
1686
- //this.formFile = this.myInput.nativeElement.files[0];
1687
- this.sucessoEvent.next(true);
1688
- }
1689
- else {
1690
- //this.formFile = this.myInput.nativeElement.files[0];
1691
- this.getBase64FromFile(this.myInput.nativeElement.files[0])
1692
- .then(result => {
1693
- //console.log('file: ', result.toString());
1694
- //console.log('nome do arquivo: ', this.nomeArquivo.toLowerCase());
1695
- let searchstr = result.toString().substring(0, result.toString().indexOf('base64,')) + 'base64,';
1696
- console.log('searchstring', searchstr);
1697
- if (this.subir) {
1698
- this.captureDataUrl = result.toString().replace(searchstr, '');
1699
- }
1700
- else {
1701
- this.captureDataUrl = result.toString();
1702
- }
1703
- //this.utils.showToast('Imagem carregada em memória.');
1704
- this.sucessoEvent.next(true);
1705
- console.log('file', this.myInput.nativeElement.files[0]);
1706
- this.filename = this.myInput.nativeElement.files[0].name;
1707
- this.writeValue(this.captureDataUrl);
1708
- // if (this.nomeArquivo && this.subir) {
1709
- // this.arquivoService.setImagem({ Nome: this.nomeArquivo, Conteudo: this.captureDataUrl, Status: 0, Pasta: this.pasta })
1710
- // .subscribe(result => {
1711
- // console.log('result set imagem', result);
1712
- // if (result.Status == 200) {
1713
- // this.utils.showToast('Sucesso!');
1714
- // } else {
1715
- // this.utils.showAlert('Erro. Tente mais tarde.' + result.Conteudo);
1716
- // }
1717
- // }, error => {
1718
- // this.utils.showAlert('Erro. Tente mais tarde.');
1719
- // })
1720
- // }
1721
- }).catch(error => {
1722
- this.sucessoEvent.next(false);
1723
- });
1724
- }
1725
- }
1726
- //util
1727
- getBase64FromFile(file) {
1728
- return new Promise((resolve, reject) => {
1729
- const reader = new FileReader();
1730
- reader.readAsDataURL(file);
1731
- reader.onload = () => resolve(reader.result);
1732
- reader.onerror = error => reject(error);
1733
- });
1734
- }
1735
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: InputArquivoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1736
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: InputArquivoComponent, selector: "kb-input-arquivo", inputs: { nomeArquivo: "nomeArquivo", caption: "caption", pasta: "pasta", subir: "subir", callback: "callback", tipoArquivo: "tipoArquivo", form: "form", showIcon: "showIcon", icon: "icon", iconSrc: "iconSrc", btnExpand: "btnExpand", btnColor: "btnColor", btnFill: "btnFill", iconSlot: "iconSlot", arquivoTipos: "arquivoTipos", readOnly: "readOnly" }, outputs: { fileSelected: "fileSelected" }, providers: [{
1737
- provide: NG_VALUE_ACCESSOR,
1738
- useExisting: InputArquivoComponent,
1739
- multi: true
1740
- }], viewQueries: [{ propertyName: "myInput", first: true, predicate: ["inputNome"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<!-- style=\"box-shadow: #4c8dff 0px 3px 3px 0.05px\" -->\r\n<div style=\"text-align:center;\">\r\n <ion-button [fill]=\"btnFill\" size=\"normal\" [color]=\"btnColor\" \r\n (click)=\"showImageBrowser()\" [expand]=\"btnExpand\" [disabled]=\"readOnly\">\r\n <ion-icon *ngIf=\"showIcon\" class=\"ion-padding-end\" [slot]=\"iconSlot\" [src]=\"iconSrc\" [name]=\"icon\"></ion-icon>\r\n {{ caption }}\r\n </ion-button>\r\n <input type=\"file\" id=\"upimgfile\" name=\"uploadfile\" #inputNome [accept]=\"arquivoTipos\" (change)=\"loadImagem()\"\r\n style=\"display: none;\" />\r\n </div>\r\n ", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }] }); }
1741
- }
1742
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: InputArquivoComponent, decorators: [{
1743
- type: Component,
1744
- args: [{ selector: 'kb-input-arquivo', providers: [{
1745
- provide: NG_VALUE_ACCESSOR,
1746
- useExisting: InputArquivoComponent,
1747
- multi: true
1748
- }], template: "<!-- style=\"box-shadow: #4c8dff 0px 3px 3px 0.05px\" -->\r\n<div style=\"text-align:center;\">\r\n <ion-button [fill]=\"btnFill\" size=\"normal\" [color]=\"btnColor\" \r\n (click)=\"showImageBrowser()\" [expand]=\"btnExpand\" [disabled]=\"readOnly\">\r\n <ion-icon *ngIf=\"showIcon\" class=\"ion-padding-end\" [slot]=\"iconSlot\" [src]=\"iconSrc\" [name]=\"icon\"></ion-icon>\r\n {{ caption }}\r\n </ion-button>\r\n <input type=\"file\" id=\"upimgfile\" name=\"uploadfile\" #inputNome [accept]=\"arquivoTipos\" (change)=\"loadImagem()\"\r\n style=\"display: none;\" />\r\n </div>\r\n " }]
1749
- }], ctorParameters: () => [], propDecorators: { nomeArquivo: [{
1750
- type: Input
1751
- }], caption: [{
1752
- type: Input
1753
- }], pasta: [{
1754
- type: Input
1755
- }], subir: [{
1756
- type: Input
1757
- }], callback: [{
1758
- type: Input
1759
- }], tipoArquivo: [{
1760
- type: Input
1761
- }], fileSelected: [{
1762
- type: Output
1763
- }], form: [{
1764
- type: Input
1765
- }], showIcon: [{
1766
- type: Input
1767
- }], icon: [{
1768
- type: Input
1769
- }], iconSrc: [{
1770
- type: Input
1771
- }], btnExpand: [{
1772
- type: Input
1773
- }], btnColor: [{
1774
- type: Input
1775
- }], btnFill: [{
1776
- type: Input
1777
- }], iconSlot: [{
1778
- type: Input
1779
- }], arquivoTipos: [{
1780
- type: Input
1781
- }], readOnly: [{
1782
- type: Input
1783
- }], myInput: [{
1784
- type: ViewChild,
1785
- args: ['inputNome', { read: ElementRef, static: true }]
1786
- }] } });
1787
-
1788
- class BaseBtnComponent {
1789
- constructor() {
1790
- this.disabled = false;
1791
- this.type = 'submit';
1792
- this.icon = 'checkmark-outline';
1793
- this.iconSrc = '';
1794
- this.title = 'Salvar';
1795
- this.fill = 'outline';
1796
- this.expand = 'block';
1797
- this.btnClick = new EventEmitter();
1798
- this.size = 'default';
1799
- this.iconSlot = 'start';
1800
- }
1801
- ngOnInit() {
1802
- return;
1803
- }
1804
- onClick() {
1805
- if (this.btnClick)
1806
- this.btnClick.emit();
1807
- }
1808
- resolveTheme(theme) {
1809
- //console.log('resolve theme', theme);
1810
- // if (theme == 'default') {
1811
- // this.fill = 'outline';
1812
- // } else {
1813
- // this.fill = 'solid';
1814
- // }
1815
- if (theme == 'windows-theme') {
1816
- this.fill = 'solid';
1817
- }
1818
- }
1819
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: BaseBtnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1820
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: BaseBtnComponent, selector: "ng-component", inputs: { disabled: "disabled", type: "type", icon: "icon", iconSrc: "iconSrc", title: "title", fill: "fill", expand: "expand", size: "size", iconSlot: "iconSlot" }, outputs: { btnClick: "btnClick" }, ngImport: i0, template: '', isInline: true }); }
1821
- }
1822
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: BaseBtnComponent, decorators: [{
1823
- type: Component,
1824
- args: [{
1825
- template: ''
1826
- }]
1827
- }], propDecorators: { disabled: [{
1828
- type: Input
1829
- }], type: [{
1830
- type: Input
1831
- }], icon: [{
1832
- type: Input
1833
- }], iconSrc: [{
1834
- type: Input
1835
- }], title: [{
1836
- type: Input
1837
- }], fill: [{
1838
- type: Input
1839
- }], expand: [{
1840
- type: Input
1841
- }], btnClick: [{
1842
- type: Output
1843
- }], size: [{
1844
- type: Input
1845
- }], iconSlot: [{
1846
- type: Input
1847
- }] } });
1848
-
1849
- class BtnActionComponent extends BaseBtnComponent {
1850
- constructor() {
1851
- super();
1852
- this.title = 'Abrir';
1853
- this.color = 'primary';
1854
- this.hidden = false;
1855
- this.icon = '';
1856
- this.iconSrc = '';
1857
- this.imgSrc = '';
1858
- this.boxColor = '#4c8dff';
1859
- this.btnMargin = '4px';
1860
- this.expand = 'block';
1861
- this.iconStyle = '';
1862
- this.titleStyle = '';
1863
- this.buttonStyle = '';
1864
- this.type = 'button';
1865
- }
1866
- ngOnInit() {
1867
- this.buttonStyle = '';
1868
- }
1869
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: BtnActionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1870
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: BtnActionComponent, selector: "kb-btn-action", inputs: { title: "title", color: "color", hidden: "hidden", icon: "icon", iconSrc: "iconSrc", imgSrc: "imgSrc", boxColor: "boxColor", btnMargin: "btnMargin", expand: "expand", iconStyle: "iconStyle", titleStyle: "titleStyle" }, usesInheritance: true, ngImport: i0, template: "<ion-button [color]=\"color\" [type]=\"type\" [disabled]=\"disabled\" [fill]=\"fill\" [expand]=\"expand\"\r\n [size]=\"size\"\r\n [hidden]=\"hidden\" \r\n (click)=\"onClick()\"\r\n > \r\n <ion-icon *ngIf=\"icon || iconSrc\" [slot]=\"title ? iconSlot : 'icon-only'\" [name]=\"icon\" [src]=\"iconSrc\" [style]=\"iconStyle\"></ion-icon>\r\n <span [style]=\"titleStyle\">{{ title }}</span>\r\n <img *ngIf=\"imgSrc\" [src]=\"imgSrc\" [slot]=\"title ? iconSlot : 'icon-only'\"/>\r\n</ion-button>\r\n\r\n\r\n", styles: ["img{width:24px;margin-right:6px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }] }); }
1871
- }
1872
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: BtnActionComponent, decorators: [{
1873
- type: Component,
1874
- args: [{ selector: 'kb-btn-action', template: "<ion-button [color]=\"color\" [type]=\"type\" [disabled]=\"disabled\" [fill]=\"fill\" [expand]=\"expand\"\r\n [size]=\"size\"\r\n [hidden]=\"hidden\" \r\n (click)=\"onClick()\"\r\n > \r\n <ion-icon *ngIf=\"icon || iconSrc\" [slot]=\"title ? iconSlot : 'icon-only'\" [name]=\"icon\" [src]=\"iconSrc\" [style]=\"iconStyle\"></ion-icon>\r\n <span [style]=\"titleStyle\">{{ title }}</span>\r\n <img *ngIf=\"imgSrc\" [src]=\"imgSrc\" [slot]=\"title ? iconSlot : 'icon-only'\"/>\r\n</ion-button>\r\n\r\n\r\n", styles: ["img{width:24px;margin-right:6px}\n"] }]
1875
- }], ctorParameters: () => [], propDecorators: { title: [{
1876
- type: Input
1877
- }], color: [{
1878
- type: Input
1879
- }], hidden: [{
1880
- type: Input
1881
- }], icon: [{
1882
- type: Input
1883
- }], iconSrc: [{
1884
- type: Input
1885
- }], imgSrc: [{
1886
- type: Input
1887
- }], boxColor: [{
1888
- type: Input
1889
- }], btnMargin: [{
1890
- type: Input
1891
- }], expand: [{
1892
- type: Input
1893
- }], iconStyle: [{
1894
- type: Input
1895
- }], titleStyle: [{
1896
- type: Input
1897
- }] } });
1898
-
1899
- class BtnCancelarComponent extends BaseBtnComponent {
1900
- //@Input() override icon: string = '';
1901
- constructor() {
1902
- super();
1903
- //@Input() override iconSrc = "/assets/icon/limpar_purple_24dp.svg";
1904
- this.icon = "close-outline";
1905
- this.title = 'Cancelar';
1906
- this.type = 'button';
1907
- }
1908
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: BtnCancelarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1909
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: BtnCancelarComponent, selector: "kb-btn-cancelar", inputs: { icon: "icon", title: "title" }, usesInheritance: true, ngImport: i0, template: "<ion-button color=\"tertiary\" [type]=\"type\" [disabled]=\"disabled\" [fill]=\"fill\" [expand]=\"expand\" \r\n [size]=\"size\"\r\n (click)=\"onClick()\"\r\n > \r\n <ion-icon [slot]=\"title ? 'start' : 'icon-only'\" [src]=\"iconSrc\" [name]=\"icon\"></ion-icon>\r\n {{ title }}\r\n</ion-button> \r\n<!-- \r\n<ion-button color=\"tertiary\" fill=\"outline\" (click)=\"cancelarContato()\" style=\"box-shadow: #6370ff 0px 3px 3px 0.05px\"\r\n [disabled]=\"!selectedContato\">\r\n <ion-icon src=\"/assets/icon/limpar_purple_24dp.svg\"></ion-icon>\r\n Cancelar\r\n</ion-button>\r\n-->", styles: ["ion-button{margin:4px;box-shadow:#6370ff 0 3px 3px .05px}\n"], dependencies: [{ kind: "component", type: i2.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }] }); }
1910
- }
1911
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: BtnCancelarComponent, decorators: [{
1912
- type: Component,
1913
- args: [{ selector: 'kb-btn-cancelar', template: "<ion-button color=\"tertiary\" [type]=\"type\" [disabled]=\"disabled\" [fill]=\"fill\" [expand]=\"expand\" \r\n [size]=\"size\"\r\n (click)=\"onClick()\"\r\n > \r\n <ion-icon [slot]=\"title ? 'start' : 'icon-only'\" [src]=\"iconSrc\" [name]=\"icon\"></ion-icon>\r\n {{ title }}\r\n</ion-button> \r\n<!-- \r\n<ion-button color=\"tertiary\" fill=\"outline\" (click)=\"cancelarContato()\" style=\"box-shadow: #6370ff 0px 3px 3px 0.05px\"\r\n [disabled]=\"!selectedContato\">\r\n <ion-icon src=\"/assets/icon/limpar_purple_24dp.svg\"></ion-icon>\r\n Cancelar\r\n</ion-button>\r\n-->", styles: ["ion-button{margin:4px;box-shadow:#6370ff 0 3px 3px .05px}\n"] }]
1914
- }], ctorParameters: () => [], propDecorators: { icon: [{
1915
- type: Input
1916
- }], title: [{
1917
- type: Input
1918
- }] } });
1919
-
1920
- class BtnExcluirComponent extends BaseBtnComponent {
1921
- constructor() {
1922
- super();
1923
- this.type = 'button';
1924
- this.expand = 'inline';
1925
- this.icon = 'trash';
1926
- this.title = 'Excluir';
1927
- }
1928
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: BtnExcluirComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1929
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: BtnExcluirComponent, selector: "kb-btn-excluir", inputs: { type: "type", expand: "expand", icon: "icon", title: "title" }, usesInheritance: true, ngImport: i0, template: "<ion-button color=\"danger\" [type]=\"type\" [disabled]=\"disabled\" [fill]=\"fill\" [expand]=\"expand\" [size]=\"size\"\r\n (click)=\"onClick()\"\r\n > \r\n <ion-icon *ngIf=\"icon\" [slot]=\"title ? 'start' : 'icon-only'\" [name]=\"icon\"></ion-icon>\r\n {{ title }}\r\n</ion-button> \r\n", styles: ["ion-button{margin:4px;box-shadow:#ed576b 0 3px 3px .05px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }] }); }
1930
- }
1931
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: BtnExcluirComponent, decorators: [{
1932
- type: Component,
1933
- args: [{ selector: 'kb-btn-excluir', template: "<ion-button color=\"danger\" [type]=\"type\" [disabled]=\"disabled\" [fill]=\"fill\" [expand]=\"expand\" [size]=\"size\"\r\n (click)=\"onClick()\"\r\n > \r\n <ion-icon *ngIf=\"icon\" [slot]=\"title ? 'start' : 'icon-only'\" [name]=\"icon\"></ion-icon>\r\n {{ title }}\r\n</ion-button> \r\n", styles: ["ion-button{margin:4px;box-shadow:#ed576b 0 3px 3px .05px}\n"] }]
1934
- }], ctorParameters: () => [], propDecorators: { type: [{
1935
- type: Input
1936
- }], expand: [{
1937
- type: Input
1938
- }], icon: [{
1939
- type: Input
1940
- }], title: [{
1941
- type: Input
1942
- }] } });
1943
-
1944
- class BtnNovoComponent extends BaseBtnComponent {
1945
- constructor() {
1946
- super();
1947
- this.title = 'Novo';
1948
- this.icon = 'person-add';
1949
- this.iconSrc = '';
1950
- this.expand = 'block';
1951
- this.imgSrc = '';
1952
- this.type = 'button';
1953
- }
1954
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: BtnNovoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1955
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: BtnNovoComponent, selector: "kb-btn-novo", inputs: { title: "title", icon: "icon", iconSrc: "iconSrc", expand: "expand", imgSrc: "imgSrc" }, usesInheritance: true, ngImport: i0, template: "<ion-button color=\"primary\" [type]=\"type\" [disabled]=\"disabled\" [fill]=\"fill\" [expand]=\"expand\" \r\n [size]=\"size\"\r\n (click)=\"onClick()\"\r\n > \r\n <ion-icon *ngIf=\"icon || iconSrc\" [slot]=\"title ? 'start' : 'icon-only'\" [name]=\"icon\" [src]=\"iconSrc\"></ion-icon>\r\n {{ title }}\r\n <img *ngIf=\"imgSrc\" [src]=\"imgSrc\" [slot]=\"title ? 'start' : 'icon-only'\"/>\r\n</ion-button> \r\n<!-- \r\n<ion-button (click)=\"novoContato()\" fill=\"outline\" style=\"box-shadow: #4c8dff 0px 3px 3px 0.05px\">\r\n <ion-icon slot=\"start\" name=\"person-add\"></ion-icon>\r\n Novo\r\n</ion-button>\r\n-->", styles: ["ion-button{box-shadow:#4c8dff 0 3px 3px .05px}img{width:24px;margin-right:6px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }] }); }
1956
- }
1957
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: BtnNovoComponent, decorators: [{
1958
- type: Component,
1959
- args: [{ selector: 'kb-btn-novo', template: "<ion-button color=\"primary\" [type]=\"type\" [disabled]=\"disabled\" [fill]=\"fill\" [expand]=\"expand\" \r\n [size]=\"size\"\r\n (click)=\"onClick()\"\r\n > \r\n <ion-icon *ngIf=\"icon || iconSrc\" [slot]=\"title ? 'start' : 'icon-only'\" [name]=\"icon\" [src]=\"iconSrc\"></ion-icon>\r\n {{ title }}\r\n <img *ngIf=\"imgSrc\" [src]=\"imgSrc\" [slot]=\"title ? 'start' : 'icon-only'\"/>\r\n</ion-button> \r\n<!-- \r\n<ion-button (click)=\"novoContato()\" fill=\"outline\" style=\"box-shadow: #4c8dff 0px 3px 3px 0.05px\">\r\n <ion-icon slot=\"start\" name=\"person-add\"></ion-icon>\r\n Novo\r\n</ion-button>\r\n-->", styles: ["ion-button{box-shadow:#4c8dff 0 3px 3px .05px}img{width:24px;margin-right:6px}\n"] }]
1960
- }], ctorParameters: () => [], propDecorators: { title: [{
1961
- type: Input
1962
- }], icon: [{
1963
- type: Input
1964
- }], iconSrc: [{
1965
- type: Input
1966
- }], expand: [{
1967
- type: Input
1968
- }], imgSrc: [{
1969
- type: Input
1970
- }] } });
1971
-
1972
- class BtnSalvarComponent extends BaseBtnComponent {
1973
- constructor() {
1974
- super();
1975
- this.btnMargin = '4px';
1976
- }
1977
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: BtnSalvarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1978
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: BtnSalvarComponent, selector: "kb-btn-salvar", inputs: { btnMargin: "btnMargin" }, usesInheritance: true, ngImport: i0, template: "<ion-button color=\"success\" [type]=\"type\" [disabled]=\"disabled\" [fill]=\"fill\" [expand]=\"expand\" \r\n [size]=\"size\"\r\n (click)=\"onClick()\"\r\n [style.margin]=\"btnMargin\"\r\n > \r\n <ion-icon [slot]=\"title ? 'start' : 'icon-only'\" [name]=\"icon\"></ion-icon>\r\n {{ title }}\r\n</ion-button>", styles: ["ion-button{box-shadow:#42d77d 0 3px 3px .05px}\n"], dependencies: [{ kind: "component", type: i2.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }] }); }
1979
- }
1980
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: BtnSalvarComponent, decorators: [{
1981
- type: Component,
1982
- args: [{ selector: 'kb-btn-salvar', template: "<ion-button color=\"success\" [type]=\"type\" [disabled]=\"disabled\" [fill]=\"fill\" [expand]=\"expand\" \r\n [size]=\"size\"\r\n (click)=\"onClick()\"\r\n [style.margin]=\"btnMargin\"\r\n > \r\n <ion-icon [slot]=\"title ? 'start' : 'icon-only'\" [name]=\"icon\"></ion-icon>\r\n {{ title }}\r\n</ion-button>", styles: ["ion-button{box-shadow:#42d77d 0 3px 3px .05px}\n"] }]
1983
- }], ctorParameters: () => [], propDecorators: { btnMargin: [{
1984
- type: Input
1985
- }] } });
1986
-
1987
- class InputCheckboxComponent extends BaseInputComponent {
1988
- writeValue(value) {
1989
- console.log('write value', value);
1990
- this.onChange(value);
1991
- this.data = value;
1992
- }
1993
- registerOnChange(fn) {
1994
- this.onChange = fn;
1995
- }
1996
- registerOnTouched(fn) {
1997
- this.onTouch = fn;
1998
- }
1999
- setDisabledState(isDisabled) {
2000
- this.disabled = this.disabled;
2001
- }
2002
- constructor() {
2003
- super();
2004
- this.justify = "start";
2005
- this.labelPlacement = "end";
2006
- this.onChange = (data) => { };
2007
- this.onTouch = () => { };
2008
- this.disabled = false;
2009
- this.console = console;
2010
- }
2011
- ngOnInit() {
2012
- }
2013
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: InputCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2014
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: InputCheckboxComponent, selector: "kb-input-checkbox", inputs: { justify: "justify", labelPlacement: "labelPlacement" }, providers: [{
2015
- provide: NG_VALUE_ACCESSOR,
2016
- useExisting: InputCheckboxComponent,
2017
- multi: true
2018
- }], usesInheritance: true, ngImport: i0, template: "<div>\n <ion-item lines=\"none\" style=\"--background: inherited; --background-focused: transparent; padding-right: 0px;\" [class]=\"itemClass\">\n <ion-checkbox #inputCheck\n [labelPlacement]=\"labelPlacement\" [justify]=\"justify\" \n [disabled]=\"readonly\"\n [checked]=\"data\"\n [color]=\"labelColor ?? 'primary'\" \n (ionChange)=\"writeValue(inputCheck.checked)\">\n <span [style.color]=\"labelColor ?? 'auto'\">{{ label }}</span> \n </ion-checkbox>\n </ion-item>\n</div>", styles: ["ion-item{--min-height: var(--checkbox-min-height, 48px) !important}ion-checkbox.checkbox-disabled{opacity:var(--item-disabled-opacity, .6)!important}span{color:var(--checkbox-text-color, \"inherit\")!important}\n", "@charset \"UTF-8\";ion-label{margin-bottom:4px!important;--color: var(--ion-color-label, auto) !important}ion-item ion-label{overflow:initial!important}ion-input{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;max-height:var(--input-max-height, 29px);transition:.2s ease}.has-focus{border:1px solid var(--ion-color-bluetool, #1f477d)}input:focus{border:1px solid lightblue!important}input:focus ion-input,input:focus ion-textarea{border:1px solid lightblue!important}input:focus ion-label{--color: var(--ion-color-label-focus, blue) !important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-input,.item-has-focus ion-textarea{border:1px solid lightblue!important}.native-input[disabled]{opacity:var(--item-disabled-opacity, .6)!important;background-color:transparent}.item-interactive-disabled ion-label{opacity:var(--item-disabled-opacity, .6)}.error-message{font-size:small;color:var(--error-text-color, red);margin-left:15px}.padding{padding:auto}.no-padding{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px;height:55px!important}.no-padding-end{--inner-padding-end: 0px}.no-padding-start{--padding-start: 0px !important}.no-padding-no-height{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px}.padding-top{--padding-top: 0px}.item-inner{padding-right:0!important}.label-right ion-label{transform-origin:right top;align-self:flex-end;margin-bottom:4%!important}.align-to-right ion-label{position:relative;left:25%;text-align:end}.error-input ion-input,.error-shake ion-input{animation:shake .4s 1 linear;border:1px solid var(--error-text-color, red)!important}@keyframes shake{0%{transform:translate(20px)}20%{transform:translate(-20px)}40%{transform:translate(10px)}60%{transform:translate(-10px)}80%{transform:translate(4px)}to{transform:translate(0)}}.error-input ion-label,.error-shake ion-label{color:var(--error-text-color, red)!important}.error-input ion-input,.error-shake ion-input{border:1px solid red!important}.error-shake ion-input{animation:shake .4s 1 linear}\n"], dependencies: [{ kind: "component", type: i2.IonCheckbox, selector: "ion-checkbox", inputs: ["checked", "color", "disabled", "indeterminate", "justify", "labelPlacement", "legacy", "mode", "name", "value"] }, { kind: "component", type: i2.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "counterFormatter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { kind: "directive", type: i2.BooleanValueAccessor, selector: "ion-checkbox,ion-toggle" }] }); }
2019
- }
2020
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: InputCheckboxComponent, decorators: [{
2021
- type: Component,
2022
- args: [{ selector: 'kb-input-checkbox', providers: [{
2023
- provide: NG_VALUE_ACCESSOR,
2024
- useExisting: InputCheckboxComponent,
2025
- multi: true
2026
- }], template: "<div>\n <ion-item lines=\"none\" style=\"--background: inherited; --background-focused: transparent; padding-right: 0px;\" [class]=\"itemClass\">\n <ion-checkbox #inputCheck\n [labelPlacement]=\"labelPlacement\" [justify]=\"justify\" \n [disabled]=\"readonly\"\n [checked]=\"data\"\n [color]=\"labelColor ?? 'primary'\" \n (ionChange)=\"writeValue(inputCheck.checked)\">\n <span [style.color]=\"labelColor ?? 'auto'\">{{ label }}</span> \n </ion-checkbox>\n </ion-item>\n</div>", styles: ["ion-item{--min-height: var(--checkbox-min-height, 48px) !important}ion-checkbox.checkbox-disabled{opacity:var(--item-disabled-opacity, .6)!important}span{color:var(--checkbox-text-color, \"inherit\")!important}\n", "@charset \"UTF-8\";ion-label{margin-bottom:4px!important;--color: var(--ion-color-label, auto) !important}ion-item ion-label{overflow:initial!important}ion-input{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;max-height:var(--input-max-height, 29px);transition:.2s ease}.has-focus{border:1px solid var(--ion-color-bluetool, #1f477d)}input:focus{border:1px solid lightblue!important}input:focus ion-input,input:focus ion-textarea{border:1px solid lightblue!important}input:focus ion-label{--color: var(--ion-color-label-focus, blue) !important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-input,.item-has-focus ion-textarea{border:1px solid lightblue!important}.native-input[disabled]{opacity:var(--item-disabled-opacity, .6)!important;background-color:transparent}.item-interactive-disabled ion-label{opacity:var(--item-disabled-opacity, .6)}.error-message{font-size:small;color:var(--error-text-color, red);margin-left:15px}.padding{padding:auto}.no-padding{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px;height:55px!important}.no-padding-end{--inner-padding-end: 0px}.no-padding-start{--padding-start: 0px !important}.no-padding-no-height{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px}.padding-top{--padding-top: 0px}.item-inner{padding-right:0!important}.label-right ion-label{transform-origin:right top;align-self:flex-end;margin-bottom:4%!important}.align-to-right ion-label{position:relative;left:25%;text-align:end}.error-input ion-input,.error-shake ion-input{animation:shake .4s 1 linear;border:1px solid var(--error-text-color, red)!important}@keyframes shake{0%{transform:translate(20px)}20%{transform:translate(-20px)}40%{transform:translate(10px)}60%{transform:translate(-10px)}80%{transform:translate(4px)}to{transform:translate(0)}}.error-input ion-label,.error-shake ion-label{color:var(--error-text-color, red)!important}.error-input ion-input,.error-shake ion-input{border:1px solid red!important}.error-shake ion-input{animation:shake .4s 1 linear}\n"] }]
2027
- }], ctorParameters: () => [], propDecorators: { justify: [{
2028
- type: Input
2029
- }], labelPlacement: [{
2030
- type: Input
2031
- }] } });
2032
-
2033
- class InputRadioComponent extends BaseInputComponent {
2034
- writeValue(value) {
2035
- //console.log('write value', value);
2036
- this.onChange(value);
2037
- this.data = value;
2038
- }
2039
- registerOnChange(fn) {
2040
- this.onChange = fn;
2041
- }
2042
- registerOnTouched(fn) {
2043
- this.onTouch = fn;
2044
- }
2045
- setDisabledState(isDisabled) {
2046
- this.disabled = this.disabled;
2047
- }
2048
- constructor() {
2049
- super();
2050
- this.itens = [];
2051
- this.itemId = "Id";
2052
- this.itemNome = "Nome";
2053
- this.color = "primary";
2054
- this.onChange = (data) => { };
2055
- this.onTouch = () => { };
2056
- this.disabled = false;
2057
- this.console = console;
2058
- }
2059
- ngOnInit() {
2060
- }
2061
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: InputRadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2062
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: InputRadioComponent, selector: "kb-input-radio", inputs: { itens: "itens", itemId: "itemId", itemNome: "itemNome", color: "color" }, providers: [{
2063
- provide: NG_VALUE_ACCESSOR,
2064
- useExisting: InputRadioComponent,
2065
- multi: true
2066
- }], usesInheritance: true, ngImport: i0, template: "<div>\n <ion-item lines=\"none\" style=\"--background: inherited; --background-focused: transparent; padding-right: 0px;\" [class]=\"itemClass\"\n [style.opacity]=\"readonly ? '0.5' : '1'\">\n <ion-radio-group [disabled]=\"readonly\" #inputRadio \n [value]=\"data\"\n (ionChange)=\"writeValue(inputRadio.value)\">\n <span style=\"font-size: 13px\">\n {{ label }}\n </span>\n <ion-row>\n <ion-col *ngFor=\"let item of itens\">\n <ion-radio style=\"margin-right: 12px;\" [color]=\"color\" \n labelPlacement=\"end\" \n justify=\"start\"\n [value]=\"item[itemId]\">\n {{ item[itemNome] }}</ion-radio><br />\n </ion-col>\n </ion-row>\n </ion-radio-group>\n </ion-item>\n</div>", styles: ["ion-item{--min-height: var(--checkbox-min-height, 48px) !important}\n", "@charset \"UTF-8\";ion-label{margin-bottom:4px!important;--color: var(--ion-color-label, auto) !important}ion-item ion-label{overflow:initial!important}ion-input{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;max-height:var(--input-max-height, 29px);transition:.2s ease}.has-focus{border:1px solid var(--ion-color-bluetool, #1f477d)}input:focus{border:1px solid lightblue!important}input:focus ion-input,input:focus ion-textarea{border:1px solid lightblue!important}input:focus ion-label{--color: var(--ion-color-label-focus, blue) !important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-input,.item-has-focus ion-textarea{border:1px solid lightblue!important}.native-input[disabled]{opacity:var(--item-disabled-opacity, .6)!important;background-color:transparent}.item-interactive-disabled ion-label{opacity:var(--item-disabled-opacity, .6)}.error-message{font-size:small;color:var(--error-text-color, red);margin-left:15px}.padding{padding:auto}.no-padding{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px;height:55px!important}.no-padding-end{--inner-padding-end: 0px}.no-padding-start{--padding-start: 0px !important}.no-padding-no-height{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px}.padding-top{--padding-top: 0px}.item-inner{padding-right:0!important}.label-right ion-label{transform-origin:right top;align-self:flex-end;margin-bottom:4%!important}.align-to-right ion-label{position:relative;left:25%;text-align:end}.error-input ion-input,.error-shake ion-input{animation:shake .4s 1 linear;border:1px solid var(--error-text-color, red)!important}@keyframes shake{0%{transform:translate(20px)}20%{transform:translate(-20px)}40%{transform:translate(10px)}60%{transform:translate(-10px)}80%{transform:translate(4px)}to{transform:translate(0)}}.error-input ion-label,.error-shake ion-label{color:var(--error-text-color, red)!important}.error-input ion-input,.error-shake ion-input{border:1px solid red!important}.error-shake ion-input{animation:shake .4s 1 linear}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i2.IonCol, selector: "ion-col", inputs: ["offset", "offsetLg", "offsetMd", "offsetSm", "offsetXl", "offsetXs", "pull", "pullLg", "pullMd", "pullSm", "pullXl", "pullXs", "push", "pushLg", "pushMd", "pushSm", "pushXl", "pushXs", "size", "sizeLg", "sizeMd", "sizeSm", "sizeXl", "sizeXs"] }, { kind: "component", type: i2.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "counterFormatter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { kind: "component", type: i2.IonRadio, selector: "ion-radio", inputs: ["color", "disabled", "justify", "labelPlacement", "legacy", "mode", "name", "value"] }, { kind: "component", type: i2.IonRadioGroup, selector: "ion-radio-group", inputs: ["allowEmptySelection", "name", "value"] }, { kind: "component", type: i2.IonRow, selector: "ion-row" }, { kind: "directive", type: i2.RadioValueAccessor, selector: "ion-radio" }, { kind: "directive", type: i2.SelectValueAccessor, selector: "ion-range, ion-select, ion-radio-group, ion-segment, ion-datetime" }] }); }
2067
- }
2068
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: InputRadioComponent, decorators: [{
2069
- type: Component,
2070
- args: [{ selector: 'kb-input-radio', providers: [{
2071
- provide: NG_VALUE_ACCESSOR,
2072
- useExisting: InputRadioComponent,
2073
- multi: true
2074
- }], template: "<div>\n <ion-item lines=\"none\" style=\"--background: inherited; --background-focused: transparent; padding-right: 0px;\" [class]=\"itemClass\"\n [style.opacity]=\"readonly ? '0.5' : '1'\">\n <ion-radio-group [disabled]=\"readonly\" #inputRadio \n [value]=\"data\"\n (ionChange)=\"writeValue(inputRadio.value)\">\n <span style=\"font-size: 13px\">\n {{ label }}\n </span>\n <ion-row>\n <ion-col *ngFor=\"let item of itens\">\n <ion-radio style=\"margin-right: 12px;\" [color]=\"color\" \n labelPlacement=\"end\" \n justify=\"start\"\n [value]=\"item[itemId]\">\n {{ item[itemNome] }}</ion-radio><br />\n </ion-col>\n </ion-row>\n </ion-radio-group>\n </ion-item>\n</div>", styles: ["ion-item{--min-height: var(--checkbox-min-height, 48px) !important}\n", "@charset \"UTF-8\";ion-label{margin-bottom:4px!important;--color: var(--ion-color-label, auto) !important}ion-item ion-label{overflow:initial!important}ion-input{padding:var(--input-padding, 8px)!important;border:1px solid darkgray;border-radius:4px;width:100%;margin-top:2px;max-height:var(--input-max-height, 29px);transition:.2s ease}.has-focus{border:1px solid var(--ion-color-bluetool, #1f477d)}input:focus{border:1px solid lightblue!important}input:focus ion-input,input:focus ion-textarea{border:1px solid lightblue!important}input:focus ion-label{--color: var(--ion-color-label-focus, blue) !important}.item-has-focus ion-label{color:var(--ion-color-label-focus, blue)!important}.item-has-focus ion-input,.item-has-focus ion-textarea{border:1px solid lightblue!important}.native-input[disabled]{opacity:var(--item-disabled-opacity, .6)!important;background-color:transparent}.item-interactive-disabled ion-label{opacity:var(--item-disabled-opacity, .6)}.error-message{font-size:small;color:var(--error-text-color, red);margin-left:15px}.padding{padding:auto}.no-padding{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px;height:55px!important}.no-padding-end{--inner-padding-end: 0px}.no-padding-start{--padding-start: 0px !important}.no-padding-no-height{--inner-padding-end: 0px;--padding-start: 0px;--padding-bottom: 0px;--inner-padding-bottom: 0px}.padding-top{--padding-top: 0px}.item-inner{padding-right:0!important}.label-right ion-label{transform-origin:right top;align-self:flex-end;margin-bottom:4%!important}.align-to-right ion-label{position:relative;left:25%;text-align:end}.error-input ion-input,.error-shake ion-input{animation:shake .4s 1 linear;border:1px solid var(--error-text-color, red)!important}@keyframes shake{0%{transform:translate(20px)}20%{transform:translate(-20px)}40%{transform:translate(10px)}60%{transform:translate(-10px)}80%{transform:translate(4px)}to{transform:translate(0)}}.error-input ion-label,.error-shake ion-label{color:var(--error-text-color, red)!important}.error-input ion-input,.error-shake ion-input{border:1px solid red!important}.error-shake ion-input{animation:shake .4s 1 linear}\n"] }]
2075
- }], ctorParameters: () => [], propDecorators: { itens: [{
2076
- type: Input
2077
- }], itemId: [{
2078
- type: Input
2079
- }], itemNome: [{
2080
- type: Input
2081
- }], color: [{
2082
- type: Input
2083
- }] } });
2084
-
2085
- class EntityEditComponent {
2086
- constructor(ngZone) {
2087
- this.ngZone = ngZone;
2088
- this.itemClass = "";
2089
- this.rowClass = "";
2090
- }
2091
- ngOnInit() {
2092
- //this.getEntidadeCampos();
2093
- }
2094
- getEntidadeCampos() {
2095
- //this.entidade = new this.entidadeTipo();
2096
- // console.log(this.entidade);
2097
- // this.ngZone.run(() =>
2098
- // this.campos = this.entidade.getHtmlForm()
2099
- // );
2100
- // console.log(this.campos);
2101
- }
2102
- emptyHandler() {
2103
- }
2104
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: EntityEditComponent, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
2105
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: EntityEditComponent, selector: "kb-entity-edit", inputs: { entidade: "entidade", campos: "campos", entidadeForm: "entidadeForm", validation_messages: "validation_messages", itemClass: "itemClass", rowClass: "rowClass" }, ngImport: i0, template: "<form *ngIf=\"campos && campos.length\" [formGroup]=\"entidadeForm\" style=\"width: 100%;\">\n\n\n <ion-row *ngFor=\"let linha of campos\" [class]=\"rowClass\">\n <ng-container *ngFor=\"let campo of linha.Linha\">\n <!-- {{ campo.Nome }} {{ campo.Tipo }} -->\n\n <ion-col [sizeMd]=\"campo.Size\" *ngIf=\"campo.Tipo == 'input-text'\">\n <kb-input-text label=\"{{campo.Label ?? campo.Nome}}\" [placeholder]=\"campo.PlaceHolderVisivel ? (campo.Label ?? campo.Nome + '...') : ''\"\n [form]=\"entidadeForm\" [max]=\"campo.Tamanho ?? '50'\" [validation_messages]=\"validation_messages[campo.Nome]\"\n [formControlName]=\"campo.Nome\" [campoFoco]=\"campo.CampoFoco\" [readonly]=\"campo.ReadOnly\" \n [type]=\"campo.TipoInput ?? 'text'\" \n [showSeePassword]=\"campo.TipoInput == 'password'\"\n [showCustomAction]=\"campo.InputAction\"\n [customActionIcon]=\"campo.InputActionIcon ?? 'search-outline'\"\n (customActionClick)=\"campo.click ? campo.click($event) : emptyHandler()\"\n\n [itemClass]=\"itemClass\">\n </kb-input-text>\n </ion-col>\n\n <ion-col [sizeMd]=\"campo.Size\" *ngIf=\"campo.Tipo == 'input-area'\">\n <kb-input-area label=\"{{campo.Label ?? campo.Nome}}\" [placeholder]=\"campo.PlaceHolderVisivel ? (campo.Label ?? campo.Nome + '...') : ''\"\n [form]=\"entidadeForm\" [max]=\"campo.Tamanho ?? '50'\" [validation_messages]=\"validation_messages[campo.Nome]\"\n [formControlName]=\"campo.Nome\" [campoFoco]=\"campo.CampoFoco\" [readonly]=\"campo.ReadOnly\" [linhas]=\"campo.Linhas ?? 5\"\n [itemClass]=\"itemClass\">\n </kb-input-area>\n </ion-col>\n\n <ion-col [sizeMd]=\"campo.Size\" *ngIf=\"campo.Tipo == 'input-cep'\">\n <kb-input-cep label=\"{{campo.Label ?? campo.Nome}}\" [form]=\"entidadeForm\"\n [validation_messages]=\"validation_messages[campo.Nome]\" [formControlName]=\"campo.Nome\"\n [campoFoco]=\"campo.CampoFoco\" [readonly]=\"campo.ReadOnly\"\n [itemClass]=\"itemClass\"\n (getResultados)=\"campo.change ? campo.change($event) : emptyHandler()\"\n >\n </kb-input-cep>\n </ion-col>\n\n <ion-col [sizeMd]=\"campo.Size\" *ngIf=\"campo.Tipo == 'input-valor'\">\n <kb-input-valor label=\"{{campo.Label ?? campo.Nome}}\" [form]=\"entidadeForm\" [max]=\"campo.Tamanho ?? '50'\"\n [validation_messages]=\"validation_messages[campo.Nome]\" [formControlName]=\"campo.Nome\"\n [campoFoco]=\"campo.CampoFoco\" [readonly]=\"campo.ReadOnly\"\n [itemClass]=\"itemClass\">\n </kb-input-valor>\n </ion-col>\n\n <ion-col [sizeMd]=\"campo.Size\" *ngIf=\"campo.Tipo == 'input-format'\">\n <kb-input-format label=\"{{campo.Label ?? campo.Nome}}\" [form]=\"entidadeForm\" [max]=\"campo.Tamanho ?? '50'\"\n [validation_messages]=\"validation_messages[campo.Nome]\" [formControlName]=\"campo.Nome\"\n [campoFoco]=\"campo.CampoFoco\" [readonly]=\"campo.ReadOnly\" [formato]=\"campo.Formato ?? ''\"\n [itemClass]=\"itemClass\">\n </kb-input-format>\n </ion-col>\n\n <ion-col [sizeMd]=\"campo.Size\" *ngIf=\"campo.Tipo == 'input-checkbox'\">\n <kb-input-checkbox label=\"{{ campo.Label }}\" [form]=\"entidadeForm\"\n [validation_messages]=\"validation_messages[campo.Nome]\" [formControlName]=\"campo.Nome\"\n [campoFoco]=\"campo.CampoFoco\" [readonly]=\"campo.ReadOnly\" \n [itemClass]=\"itemClass\"\n [labelColor]=\"campo.BtnColor\">\n\n </kb-input-checkbox>\n </ion-col>\n\n <ion-col [sizeMd]=\"campo.Size\" *ngIf=\"campo.Tipo == 'input-select'\">\n <kb-input-select [label]=\"campo.Label ?? campo.Nome\" [placeholder]=\"'Selecionar...'\"\n [formControlName]=\"campo.Nome\" [form]=\"entidadeForm\" [itens]=\"campo.Itens\" [itemId]=\"campo.ItemId ?? 'Id'\"\n [itemNome]=\"campo.ItemNome ?? 'Nome'\" [validation_messages]=\"validation_messages[campo.Nome]\"\n (selectChangeEntity)=\"campo.change ? campo.change($event) : emptyHandler()\" [readonly]=\"campo.ReadOnly\"\n [itemClass]=\"itemClass\">\n </kb-input-select>\n </ion-col>\n\n <ion-col [sizeMd]=\"campo.Size\" *ngIf=\"campo.Tipo == 'input-radio'\">\n <kb-input-radio [label]=\"campo.Label ?? campo.Nome\" [formControlName]=\"campo.Nome\" [form]=\"entidadeForm\"\n [itens]=\"campo.Itens\" [itemId]=\"campo.ItemId\" [itemNome]=\"campo.ItemNome\" [readonly]=\"campo.ReadOnly\"\n [itemClass]=\"itemClass\">\n </kb-input-radio>\n </ion-col>\n\n <ion-col [sizeMd]=\"campo.Size\" *ngIf=\"campo.Tipo == 'input-pesquisa'\">\n <kb-input-pesquisa #pesquisaCentroCustoPai \n [label]=\"campo.Label ?? campo.Nome\" \n [campoId]=\"campo.ItemId\"\n [focusField]=\"campo.focusField\"\n [formControlName]=\"campo.Nome\" \n placeholder=\"Pesquisar...\" \n [campoDisplay]=\"campo.ItemNome ?? 'Nome'\" \n [form]=\"entidadeForm\"\n [tipo]=\"campo.TipoPesquisa\" \n [urlItem]=\"campo.UrlItem\" \n [max]=\"campo.Tamanho ?? '50'\" \n [url]=\"campo.UrlPesquisa\" \n [readonly]=\"campo.ReadOnly\"\n (pesquisaChange)=\"campo.change ? campo.change($event) : emptyHandler()\"\n [itemClass]=\"itemClass\">\n </kb-input-pesquisa>\n </ion-col>\n\n <ion-col [sizeMd]=\"campo.Size\" *ngIf=\"campo.Tipo == 'input-button'\">\n <!-- \n <kb-btn-action [title]=\"campo.Label\" [icon]=\"campo.Icon\" [iconSrc]=\"campo.IconSrc\" [color]=\"campo.BtnColor ?? 'light'\" \n [expand]=\"campo.BtnExpand ?? 'block'\" style=\"margin-top: var(--btn-action-margin-top, auto);\">\n </kb-btn-action>\n -->\n <ion-button [expand]=\"campo.BtnExpand ?? 'block'\" [color]=\"campo.BtnColor ?? 'light'\"\n (click)=\"campo.click ? campo.click($event) : emptyHandler()\" [size]=\"campo.BtnSize ?? 'default'\"\n [disabled]=\"campo.ReadOnly\">\n <ion-icon *ngIf=\"campo.Icon || campo.IconSrc\" [name]=\"campo.Icon\" [src]=\"campo.IconSrc\"></ion-icon>\n {{ campo.Label }}\n </ion-button>\n </ion-col>\n\n <ion-col *ngIf=\"campo.Tipo == 'col'\" size-md=\"1\" size-xs=\"0\">\n\n </ion-col>\n\n <ion-col *ngIf=\"campo.Tipo == 'sub-titulo'\" size=\"12\">\n <ion-list lines=\"none\" class=\"ion-no-padding\">\n <ion-list-header color=\"primary\" [style]=\"campo.CampoStyle ?? ''\"> \n <ion-label [style]=\"campo.LabelStyle ?? ''\">{{ campo.Label }}</ion-label>\n </ion-list-header>\n </ion-list>\n </ion-col>\n </ng-container>\n </ion-row>\n\n <!--\n <ion-col class=\"select ion-no-margin ion-no-padding\">\n <ion-item lines=\"none\">\n <ion-label>Totalizador</ion-label>\n <ion-checkbox slot=\"start\" formControlName=\"Totalizador\"></ion-checkbox>\n </ion-item>\n </ion-col>\n <ion-col class=\"select ion-no-margin ion-no-padding\">\n <ion-item lines=\"none\">\n <ion-label>Inativo</ion-label>\n <ion-checkbox slot=\"start\" formControlName=\"Inativo\"></ion-checkbox>\n </ion-item>\n </ion-col>\n -->\n</form>", styles: ["ion-list-header{text-align:center;font-size:large}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i2.IonCol, selector: "ion-col", inputs: ["offset", "offsetLg", "offsetMd", "offsetSm", "offsetXl", "offsetXs", "pull", "pullLg", "pullMd", "pullSm", "pullXl", "pullXs", "push", "pushLg", "pushMd", "pushSm", "pushXl", "pushXs", "size", "sizeLg", "sizeMd", "sizeSm", "sizeXl", "sizeXs"] }, { kind: "component", type: i2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i2.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: i2.IonList, selector: "ion-list", inputs: ["inset", "lines", "mode"] }, { kind: "component", type: i2.IonListHeader, selector: "ion-list-header", inputs: ["color", "lines", "mode"] }, { kind: "component", type: i2.IonRow, selector: "ion-row" }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: InputTextComponent, selector: "kb-input-text", inputs: ["iconInput", "inputSpanAfter", "campoFoco", "showCustomAction", "customActionIcon"], outputs: ["customActionClick"] }, { kind: "component", type: InputFormatComponent, selector: "kb-input-format", inputs: ["formato", "keyEnter"] }, { kind: "component", type: InputSelectComponent, selector: "kb-input-select", inputs: ["itens", "itemId", "itemNome", "showNovo", "itemNull", "opcaoDefault"], outputs: ["selectChange", "selectChangeEntity"] }, { kind: "component", type: InputPesquisaComponent, selector: "kb-input-pesquisa", inputs: ["textoPesquisa", "max", "filterFunction", "selectId", "campoId", "campoPaiId", "campoDisplay", "tipo", "pesquisaChange", "pesquisaAction", "limpar", "url", "urlItem", "urlTree", "empresa", "loadInit", "treeTitulo"] }, { kind: "component", type: InputValorComponent, selector: "kb-input-valor", inputs: ["maxValor"] }, { kind: "component", type: InputAreaComponent, selector: "kb-input-area", inputs: ["linhas"] }, { kind: "component", type: InputCepComponent, selector: "kb-input-cep", inputs: ["formato", "keyEnter"], outputs: ["getResultados"] }, { kind: "component", type: InputCheckboxComponent, selector: "kb-input-checkbox", inputs: ["justify", "labelPlacement"] }, { kind: "component", type: InputRadioComponent, selector: "kb-input-radio", inputs: ["itens", "itemId", "itemNome", "color"] }] }); }
2106
- }
2107
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: EntityEditComponent, decorators: [{
2108
- type: Component,
2109
- args: [{ selector: 'kb-entity-edit', template: "<form *ngIf=\"campos && campos.length\" [formGroup]=\"entidadeForm\" style=\"width: 100%;\">\n\n\n <ion-row *ngFor=\"let linha of campos\" [class]=\"rowClass\">\n <ng-container *ngFor=\"let campo of linha.Linha\">\n <!-- {{ campo.Nome }} {{ campo.Tipo }} -->\n\n <ion-col [sizeMd]=\"campo.Size\" *ngIf=\"campo.Tipo == 'input-text'\">\n <kb-input-text label=\"{{campo.Label ?? campo.Nome}}\" [placeholder]=\"campo.PlaceHolderVisivel ? (campo.Label ?? campo.Nome + '...') : ''\"\n [form]=\"entidadeForm\" [max]=\"campo.Tamanho ?? '50'\" [validation_messages]=\"validation_messages[campo.Nome]\"\n [formControlName]=\"campo.Nome\" [campoFoco]=\"campo.CampoFoco\" [readonly]=\"campo.ReadOnly\" \n [type]=\"campo.TipoInput ?? 'text'\" \n [showSeePassword]=\"campo.TipoInput == 'password'\"\n [showCustomAction]=\"campo.InputAction\"\n [customActionIcon]=\"campo.InputActionIcon ?? 'search-outline'\"\n (customActionClick)=\"campo.click ? campo.click($event) : emptyHandler()\"\n\n [itemClass]=\"itemClass\">\n </kb-input-text>\n </ion-col>\n\n <ion-col [sizeMd]=\"campo.Size\" *ngIf=\"campo.Tipo == 'input-area'\">\n <kb-input-area label=\"{{campo.Label ?? campo.Nome}}\" [placeholder]=\"campo.PlaceHolderVisivel ? (campo.Label ?? campo.Nome + '...') : ''\"\n [form]=\"entidadeForm\" [max]=\"campo.Tamanho ?? '50'\" [validation_messages]=\"validation_messages[campo.Nome]\"\n [formControlName]=\"campo.Nome\" [campoFoco]=\"campo.CampoFoco\" [readonly]=\"campo.ReadOnly\" [linhas]=\"campo.Linhas ?? 5\"\n [itemClass]=\"itemClass\">\n </kb-input-area>\n </ion-col>\n\n <ion-col [sizeMd]=\"campo.Size\" *ngIf=\"campo.Tipo == 'input-cep'\">\n <kb-input-cep label=\"{{campo.Label ?? campo.Nome}}\" [form]=\"entidadeForm\"\n [validation_messages]=\"validation_messages[campo.Nome]\" [formControlName]=\"campo.Nome\"\n [campoFoco]=\"campo.CampoFoco\" [readonly]=\"campo.ReadOnly\"\n [itemClass]=\"itemClass\"\n (getResultados)=\"campo.change ? campo.change($event) : emptyHandler()\"\n >\n </kb-input-cep>\n </ion-col>\n\n <ion-col [sizeMd]=\"campo.Size\" *ngIf=\"campo.Tipo == 'input-valor'\">\n <kb-input-valor label=\"{{campo.Label ?? campo.Nome}}\" [form]=\"entidadeForm\" [max]=\"campo.Tamanho ?? '50'\"\n [validation_messages]=\"validation_messages[campo.Nome]\" [formControlName]=\"campo.Nome\"\n [campoFoco]=\"campo.CampoFoco\" [readonly]=\"campo.ReadOnly\"\n [itemClass]=\"itemClass\">\n </kb-input-valor>\n </ion-col>\n\n <ion-col [sizeMd]=\"campo.Size\" *ngIf=\"campo.Tipo == 'input-format'\">\n <kb-input-format label=\"{{campo.Label ?? campo.Nome}}\" [form]=\"entidadeForm\" [max]=\"campo.Tamanho ?? '50'\"\n [validation_messages]=\"validation_messages[campo.Nome]\" [formControlName]=\"campo.Nome\"\n [campoFoco]=\"campo.CampoFoco\" [readonly]=\"campo.ReadOnly\" [formato]=\"campo.Formato ?? ''\"\n [itemClass]=\"itemClass\">\n </kb-input-format>\n </ion-col>\n\n <ion-col [sizeMd]=\"campo.Size\" *ngIf=\"campo.Tipo == 'input-checkbox'\">\n <kb-input-checkbox label=\"{{ campo.Label }}\" [form]=\"entidadeForm\"\n [validation_messages]=\"validation_messages[campo.Nome]\" [formControlName]=\"campo.Nome\"\n [campoFoco]=\"campo.CampoFoco\" [readonly]=\"campo.ReadOnly\" \n [itemClass]=\"itemClass\"\n [labelColor]=\"campo.BtnColor\">\n\n </kb-input-checkbox>\n </ion-col>\n\n <ion-col [sizeMd]=\"campo.Size\" *ngIf=\"campo.Tipo == 'input-select'\">\n <kb-input-select [label]=\"campo.Label ?? campo.Nome\" [placeholder]=\"'Selecionar...'\"\n [formControlName]=\"campo.Nome\" [form]=\"entidadeForm\" [itens]=\"campo.Itens\" [itemId]=\"campo.ItemId ?? 'Id'\"\n [itemNome]=\"campo.ItemNome ?? 'Nome'\" [validation_messages]=\"validation_messages[campo.Nome]\"\n (selectChangeEntity)=\"campo.change ? campo.change($event) : emptyHandler()\" [readonly]=\"campo.ReadOnly\"\n [itemClass]=\"itemClass\">\n </kb-input-select>\n </ion-col>\n\n <ion-col [sizeMd]=\"campo.Size\" *ngIf=\"campo.Tipo == 'input-radio'\">\n <kb-input-radio [label]=\"campo.Label ?? campo.Nome\" [formControlName]=\"campo.Nome\" [form]=\"entidadeForm\"\n [itens]=\"campo.Itens\" [itemId]=\"campo.ItemId\" [itemNome]=\"campo.ItemNome\" [readonly]=\"campo.ReadOnly\"\n [itemClass]=\"itemClass\">\n </kb-input-radio>\n </ion-col>\n\n <ion-col [sizeMd]=\"campo.Size\" *ngIf=\"campo.Tipo == 'input-pesquisa'\">\n <kb-input-pesquisa #pesquisaCentroCustoPai \n [label]=\"campo.Label ?? campo.Nome\" \n [campoId]=\"campo.ItemId\"\n [focusField]=\"campo.focusField\"\n [formControlName]=\"campo.Nome\" \n placeholder=\"Pesquisar...\" \n [campoDisplay]=\"campo.ItemNome ?? 'Nome'\" \n [form]=\"entidadeForm\"\n [tipo]=\"campo.TipoPesquisa\" \n [urlItem]=\"campo.UrlItem\" \n [max]=\"campo.Tamanho ?? '50'\" \n [url]=\"campo.UrlPesquisa\" \n [readonly]=\"campo.ReadOnly\"\n (pesquisaChange)=\"campo.change ? campo.change($event) : emptyHandler()\"\n [itemClass]=\"itemClass\">\n </kb-input-pesquisa>\n </ion-col>\n\n <ion-col [sizeMd]=\"campo.Size\" *ngIf=\"campo.Tipo == 'input-button'\">\n <!-- \n <kb-btn-action [title]=\"campo.Label\" [icon]=\"campo.Icon\" [iconSrc]=\"campo.IconSrc\" [color]=\"campo.BtnColor ?? 'light'\" \n [expand]=\"campo.BtnExpand ?? 'block'\" style=\"margin-top: var(--btn-action-margin-top, auto);\">\n </kb-btn-action>\n -->\n <ion-button [expand]=\"campo.BtnExpand ?? 'block'\" [color]=\"campo.BtnColor ?? 'light'\"\n (click)=\"campo.click ? campo.click($event) : emptyHandler()\" [size]=\"campo.BtnSize ?? 'default'\"\n [disabled]=\"campo.ReadOnly\">\n <ion-icon *ngIf=\"campo.Icon || campo.IconSrc\" [name]=\"campo.Icon\" [src]=\"campo.IconSrc\"></ion-icon>\n {{ campo.Label }}\n </ion-button>\n </ion-col>\n\n <ion-col *ngIf=\"campo.Tipo == 'col'\" size-md=\"1\" size-xs=\"0\">\n\n </ion-col>\n\n <ion-col *ngIf=\"campo.Tipo == 'sub-titulo'\" size=\"12\">\n <ion-list lines=\"none\" class=\"ion-no-padding\">\n <ion-list-header color=\"primary\" [style]=\"campo.CampoStyle ?? ''\"> \n <ion-label [style]=\"campo.LabelStyle ?? ''\">{{ campo.Label }}</ion-label>\n </ion-list-header>\n </ion-list>\n </ion-col>\n </ng-container>\n </ion-row>\n\n <!--\n <ion-col class=\"select ion-no-margin ion-no-padding\">\n <ion-item lines=\"none\">\n <ion-label>Totalizador</ion-label>\n <ion-checkbox slot=\"start\" formControlName=\"Totalizador\"></ion-checkbox>\n </ion-item>\n </ion-col>\n <ion-col class=\"select ion-no-margin ion-no-padding\">\n <ion-item lines=\"none\">\n <ion-label>Inativo</ion-label>\n <ion-checkbox slot=\"start\" formControlName=\"Inativo\"></ion-checkbox>\n </ion-item>\n </ion-col>\n -->\n</form>", styles: ["ion-list-header{text-align:center;font-size:large}\n"] }]
2110
- }], ctorParameters: () => [{ type: i0.NgZone }], propDecorators: { entidade: [{
2111
- type: Input
2112
- }], campos: [{
2113
- type: Input
2114
- }], entidadeForm: [{
2115
- type: Input
2116
- }], validation_messages: [{
2117
- type: Input
2118
- }], itemClass: [{
2119
- type: Input
2120
- }], rowClass: [{
2121
- type: Input
2122
- }] } });
2123
-
2124
- class GridViewComponent {
2125
- constructor() {
2126
- this.minHeight = '400px';
2127
- this.inMemoryPagination = false;
2128
- this.selecionarItem = new EventEmitter();
2129
- this.excluirItem = new EventEmitter();
2130
- this.selecionarChecked = new EventEmitter();
2131
- //inputs = inject(new InjectionToken<any>('title inputs'));
2132
- this.grupos = [{ Coluna: '', Tabela: null, Dados: null, Nivel: 0 }];
2133
- // tabelaCampos = {
2134
- // Selecionar: false,
2135
- // Exportar: true,
2136
- // Colunas: [
2137
- // { Campo: 'Id', Titulo: 'Id', Tamanho: '10%', Ordem: true, Grupo: false, Filtrar: true, OrdemStatus: 0, Tipo: 'number', Valores: [], FiltroOperador: '=', FiltroValor: '', FiltroVisivel: false },
2138
- // { Campo: 'Marca', Titulo: 'Marca', Tamanho: '25%', Ordem: true, Grupo: true, Filtrar: true, OrdemStatus: 0, Tipo: 'string', Valores: [], FiltroOperador: '=', FiltroValor: '', FiltroVisivel: false },
2139
- // { Campo: 'Descricao', Titulo: 'Descrição', Tamanho: '25%', Ordem: true, Grupo: true, Filtrar: true, OrdemStatus: 0, Tipo: 'string', Valores: [], FiltroOperador: '=', FiltroValor: '', FiltroVisivel: false },
2140
- // { Campo: 'Data', Titulo: 'Data', Tamanho: '20%', Ordem: true, Grupo: true, Filtrar: true, OrdemStatus: 0, Tipo: 'date', Valores: [], FiltroOperador: '=', FiltroValor: '', FiltroVisivel: false },
2141
- // { Campo: 'Valor', Titulo: 'Valor', Tamanho: '20%', Ordem: true, Grupo: false, Filtrar: true, OrdemStatus: 0, Tipo: 'number', Valores: [], FiltroOperador: '=', FiltroValor: '', FiltroVisivel: false },
2142
- // ]
2143
- // }
2144
- // dataSet: Array<any> = [
2145
- // { Id: 1, Marca: 'Apple', Descricao: 'IPhone 14', Data: '2023-05-01', Valor: 7899.99 },
2146
- // { Id: 2, Marca: 'Apple', Descricao: 'MacBook Pro', Data: '2023-06-01', Valor: 17999.99 },
2147
- // { Id: 3, Marca: 'Samsung', Descricao: 'Galaxy S23', Data: '2023-05-01', Valor: 6899.99 },
2148
- // { Id: 4, Marca: 'Sony', Descricao: 'PS 5', Data: '2023-06-01', Valor: 4899.99 },
2149
- // { Id: 5, Marca: 'Samsung', Descricao: 'Watch 23', Data: '2023-05-01', Valor: 1899.99 },
2150
- // ]
2151
- this.groups = [];
2152
- this.filteredDataSet = [];
2153
- this.pageDataSet = [];
2154
- //array com os campos filtrados para display
2155
- this.camposDisplay = [];
2156
- //filtro
2157
- this.isFiltroOpen = false;
2158
- this.todosSelecionados = false;
2159
- //pagination
2160
- //página atual
2161
- this.page = 1;
2162
- //registros por página
2163
- this.pageOffset = 20;
2164
- }
2165
- valoresFiltro() {
2166
- this.tabelaCampos.Colunas.forEach(c => {
2167
- if (c.Filtrar) {
2168
- //projetar a coluna
2169
- let initial = [];
2170
- let valores = this.dataSet.map(d => d[c.Campo]);
2171
- c.Valores = valores.filter((value, index, self) => {
2172
- return self.indexOf(value) === index;
2173
- }).map(v => { return { Selecionado: false, Valor: v }; });
2174
- // console.log(c.Campo, valores);
2175
- // console.log(c.Valores)
2176
- }
2177
- });
2178
- }
2179
- ngOnInit() {
2180
- //this.inicializaGrupo();
2181
- //this.agrupar('Marca');
2182
- //console.log('inputs', this.inputs);
2183
- //console.log('Input empresa', this.empresaId);
2184
- GridTabela.init(this.tabelaCampos);
2185
- this.valoresFiltro();
2186
- this.filteredDataSet = this.dataSet;
2187
- console.log('Init Tabela campos', this.tabelaCampos);
2188
- }
2189
- ngOnChanges(changes) {
2190
- console.log('On changes Tabela campos', this.tabelaCampos);
2191
- //evento chamado quando o dataset for atualizado
2192
- //inicializar vars de paginação
2193
- this.initPage();
2194
- this.todosSelecionados = false;
2195
- }
2196
- initPage() {
2197
- this.page = 1;
2198
- this.totalRec = this.filteredDataSet.length;
2199
- this.totalPages = Math.ceil(this.totalRec / this.pageOffset);
2200
- if (this.inMemoryPagination === true) {
2201
- this.getRegistrosPage();
2202
- }
2203
- else {
2204
- this.pageDataSet = this.filteredDataSet;
2205
- }
2206
- }
2207
- getRegistrosPage() {
2208
- this.start = (this.page - 1) * this.pageOffset;
2209
- console.log('dataset', this.filteredDataSet);
2210
- console.log('start', this.start);
2211
- console.log('offset', this.pageOffset);
2212
- this.pageDataSet = this.filteredDataSet.slice(this.start, (this.start + this.pageOffset));
2213
- console.log('page dataset', this.pageDataSet);
2214
- }
2215
- proximo() {
2216
- if (this.page < this.totalPages) {
2217
- this.page++;
2218
- this.getRegistrosPage();
2219
- this.gerarArrayPags();
2220
- }
2221
- }
2222
- anterior() {
2223
- if (this.page > 1) {
2224
- this.page--;
2225
- this.getRegistrosPage();
2226
- this.gerarArrayPags();
2227
- }
2228
- }
2229
- gerarArrayPags() {
2230
- }
2231
- inicializaGrupo() {
2232
- //inicializar o primeiro grupo 'default'
2233
- this.camposDisplay = this.tabelaCampos.Colunas;
2234
- this.grupos[0].Tabela = this.camposDisplay;
2235
- this.grupos[0].Dados = this.dataSet;
2236
- }
2237
- agrupar(campo) {
2238
- this.groups.push(campo);
2239
- let level = 0;
2240
- for (let g in this.groups) {
2241
- console.log(g);
2242
- //filtrar os dados
2243
- let result = this.dataSet.reduce((group, data) => {
2244
- const { g } = data;
2245
- group[g] = group[campo] ?? [];
2246
- group[g].push(data);
2247
- return group;
2248
- }, {});
2249
- console.log(result);
2250
- }
2251
- }
2252
- filtrarCampos(coluna = '') {
2253
- if (coluna != '') {
2254
- }
2255
- else {
2256
- }
2257
- }
2258
- filtrar(col) {
2259
- //console.log('filtrar', col);
2260
- if (col.Valores && col.Valores.find(v => v.Selecionado) != null) {
2261
- const valores = col.Valores.filter(v => v.Selecionado).map(v => v.Valor);
2262
- //filtrar por valores selecionados
2263
- this.filteredDataSet = this.dataSet.filter(d => valores.indexOf(d[col.Campo]) > -1);
2264
- }
2265
- else if (col.FiltroOperador && col.FiltroValor) {
2266
- //console.log(col.FiltroOperador, col.FiltroValor)
2267
- try {
2268
- this.filteredDataSet = this.dataSet.filter(d => {
2269
- switch (col.FiltroOperador) {
2270
- case "=":
2271
- return d[col.Campo] == col.FiltroValor;
2272
- case ">=":
2273
- if (col.Tipo == 'number') {
2274
- return LibService.stringToDecimal(d[col.Campo], true) >= LibService.stringToDecimal(col.FiltroValor, true);
2275
- }
2276
- else if (col.Tipo == 'data') {
2277
- return new Date(this.dataToString(d[col.Campo])) >= new Date(this.dataToString(col.FiltroValor));
2278
- }
2279
- else
2280
- return d[col.Campo] >= col.FiltroValor;
2281
- case "<=":
2282
- if (col.Tipo == 'number') {
2283
- return LibService.stringToDecimal(d[col.Campo], true) <= LibService.stringToDecimal(col.FiltroValor, true);
2284
- }
2285
- else
2286
- return d[col.Campo] <= col.FiltroValor;
2287
- case "tem":
2288
- return d[col.Campo].toString().toLowerCase().indexOf(col.FiltroValor.toLowerCase()) > -1;
2289
- default:
2290
- return true;
2291
- }
2292
- });
2293
- }
2294
- catch (ex) {
2295
- console.log(ex);
2296
- this.filteredDataSet = this.dataSet;
2297
- }
2298
- }
2299
- col.FiltroVisivel = false;
2300
- this.initPage();
2301
- }
2302
- getPage() {
2303
- }
2304
- limpar() {
2305
- this.filteredDataSet = this.dataSet;
2306
- }
2307
- dataToString(data) {
2308
- if (data) {
2309
- return data.split('/').reverse().join('-');
2310
- }
2311
- else {
2312
- return "";
2313
- }
2314
- }
2315
- ordenar(col) {
2316
- if (col.OrdemStatus == 0 || col.OrdemStatus == -1) {
2317
- if (col.Tipo == 'data') {
2318
- this.filteredDataSet.sort((a, b) => this.dataToString(a[col.Campo]) > this.dataToString(b[col.Campo]) ? 1 : (this.dataToString(a[col.Campo]) < this.dataToString(b[col.Campo]) ? -1 : 0));
2319
- }
2320
- else if (col.Tipo == 'number') {
2321
- this.filteredDataSet.sort((a, b) => LibService.stringToDecimal(a[col.Campo]) > LibService.stringToDecimal(b[col.Campo]) ? 1 : (LibService.stringToDecimal(a[col.Campo]) < LibService.stringToDecimal(b[col.Campo]) ? -1 : 0));
2322
- }
2323
- else
2324
- this.filteredDataSet.sort((a, b) => a[col.Campo] > b[col.Campo] ? 1 : (a[col.Campo] < b[col.Campo] ? -1 : 0));
2325
- col.OrdemStatus = 1; //asc
2326
- }
2327
- else {
2328
- if (col.Tipo == 'data') {
2329
- this.filteredDataSet.sort((a, b) => this.dataToString(a[col.Campo]) < this.dataToString(b[col.Campo]) ? 1 : (this.dataToString(a[col.Campo]) > this.dataToString(b[col.Campo]) ? -1 : 0));
2330
- }
2331
- else if (col.Tipo == 'number') {
2332
- this.filteredDataSet.sort((a, b) => LibService.stringToDecimal(a[col.Campo], true) < LibService.stringToDecimal(b[col.Campo], true) ? 1 : (LibService.stringToDecimal(a[col.Campo], true) > LibService.stringToDecimal(b[col.Campo], true) ? -1 : 0));
2333
- }
2334
- else
2335
- this.filteredDataSet.sort((a, b) => a[col.Campo] < b[col.Campo] ? 1 : (a[col.Campo] > b[col.Campo] ? -1 : 0));
2336
- col.OrdemStatus = -1; //desc
2337
- }
2338
- }
2339
- setFiltroOpen(col) {
2340
- col.FiltroVisivel = !col.FiltroVisivel;
2341
- if (col.FiltroVisivel) {
2342
- this.selectedColuna = col;
2343
- //console.log(this.selectedColuna);
2344
- }
2345
- }
2346
- selecionarTodos() {
2347
- //this.todosSelecionados = !this.todosSelecionados;
2348
- this.filteredDataSet.forEach(item => {
2349
- item[this.tabelaCampos.CampoSelecionar] = this.todosSelecionados;
2350
- });
2351
- this.selecionarChecked.emit();
2352
- }
2353
- selecionarLinha(item) {
2354
- this.selecionarItem.emit(item);
2355
- this.selectedItem = item;
2356
- }
2357
- excluirLinha(item) {
2358
- this.excluirItem.emit(item);
2359
- }
2360
- //check
2361
- selecionadoChecked() {
2362
- this.selecionarChecked.emit();
2363
- }
2364
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: GridViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2365
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.7", type: GridViewComponent, selector: "kb-grid-view", inputs: { empresaId: "empresaId", tabelaCampos: "tabelaCampos", dataSet: "dataSet", minHeight: "minHeight", inMemoryPagination: "inMemoryPagination", filteredDataSet: "filteredDataSet", pageOffset: "pageOffset" }, outputs: { selecionarItem: "selecionarItem", excluirItem: "excluirItem", selecionarChecked: "selecionarChecked" }, usesOnChanges: true, ngImport: i0, template: "<div style=\"font-size: 14px;\">\n <div id=\"painelExportacao\">\n <ion-row *ngIf=\"inMemoryPagination\">\n <!--\n <ion-col size=\"2\">\n <ion-button *ngIf=\"tabelaCampos.Selecionar === true\" size=\"small\" fill=\"outline\" color=\"medium\"\n (click)=\"selecionarTodos()\">Selecionar Todos</ion-button>\n </ion-col>\n -->\n <ion-col size=\"3\">\n <ion-button *ngIf=\"inMemoryPagination === true\" size=\"small\" fill=\"outline\" color=\"bluetool\"\n (click)=\"anterior()\">\n <ion-icon name=\"chevron-back-outline\" slot=\"start\"></ion-icon>\n Anterior\n </ion-button>\n <ion-button *ngIf=\"inMemoryPagination === true\" size=\"small\" fill=\"outline\" color=\"bluetool\"\n (click)=\"proximo()\">\n Pr\u00F3ximo\n <ion-icon name=\"chevron-forward-outline\" slot=\"end\"></ion-icon>\n </ion-button> \n </ion-col>\n <ion-col size=\"2\">\n <span style=\"display: block; margin-top: 10px;\" *ngIf=\"inMemoryPagination && totalRec > 0\">Exibindo {{ start + 1 }} - {{ (start + pageOffset) < totalRec ? (start + pageOffset) : totalRec }} total de {{ totalRec }} \n </span> \n </ion-col>\n </ion-row>\n </div>\n <div style=\"width: 100%;\" [style.min-height]=\"minHeight\">\n <table class=\"grid\">\n <thead>\n <tr style=\"background-color: var(--ion-color-bluetool); color: white;\">\n <td *ngIf=\"tabelaCampos.Selecionar === true\" style=\"width: 3%; text-align: center;\">\n <input type=\"checkbox\" [(ngModel)]=\"todosSelecionados\" (change)=\"selecionarTodos()\">\n </td>\n <td *ngFor=\"let col of tabelaCampos.Colunas\" [style.width]=\"col.Tamanho\">\n <div style=\"position: relative;\">\n <div style=\"display: flex; justify-content: space-between; align-items: end;\">\n <strong>{{ col.Titulo }}</strong>\n <div>\n <ion-icon *ngIf=\"col.Ordem\" slot=\"end\" (click)=\"ordenar(col)\" style=\"cursor: pointer;\"\n [name]=\"col.OrdemStatus == 0 ? 'swap-vertical' : (col.OrdemStatus == 1 ? 'arrow-up': 'arrow-down')\"></ion-icon>\n \n <ion-icon *ngIf=\"col.Filtrar\" name=\"funnel\" (click)=\"setFiltroOpen(col)\" slot=\"end\"></ion-icon>\n </div>\n </div>\n \n \n <div class=\"caixaGrande\" [hidden]=\"!col.FiltroVisivel\" tabindex=\"-1\"\n style=\"color: black; display: block; position: absolute; z-index: 800; width: 210px; right: 0px; opacity: 0.9;\">\n Filtrar:\n <div>\n <div style=\"display: flex; justify-content: space-between; align-items: start;\">\n <select style=\"width: 80px;\" [(ngModel)]=\"col.FiltroOperador\">\n <option>=</option>\n <option>&gt;=</option>\n <option>&lt;=</option>\n <option>tem</option>\n </select>\n <input style=\"width: 100px;\" type=\"text\" [(ngModel)]=\"col.FiltroValor\">\n </div>\n <ion-button size=\"small\" color=\"medium\" expand=\"block\" (click)=\"filtrar(col)\">Filtrar</ion-button>\n <ion-button size=\"small\" color=\"light\" expand=\"block\" (click)=\"limpar()\">Limpar</ion-button>\n </div>\n <div *ngIf=\"col.Valores\" class=\"scroll-container\" style=\"height: 200px; overflow-y: scroll;\">\n <div *ngFor=\"let valor of col.Valores\">\n <input type=\"checkbox\" [(ngModel)]=\"valor.Selecionado\">\n <span>{{ valor.Valor }}</span>\n </div>\n </div>\n </div>\n \n </div>\n </td>\n <td *ngIf=\"tabelaCampos.Excluir === true\">\n \n </td>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let item of pageDataSet\" [class]=\"item == selectedItem ? 'item-selecionado' : '' \">\n <td *ngIf=\"tabelaCampos.Selecionar === true\" style=\"text-align: center; cursor: auto;\">\n <input type=\"checkbox\" [(ngModel)]=\"item[tabelaCampos.CampoSelecionar]\" (change)=\"selecionadoChecked()\">\n </td>\n <td class=\"col\" *ngFor=\"let col of tabelaCampos.Colunas\" [style.width]=\"col.Tamanho\"\n [style.text-align]=\"col.Tipo == 'number' ? 'right' : (col.Alinhamento ?? 'left')\"\n (click)=\"col.ClickFunction ? col.ClickFunction(item) : selecionarLinha(item)\">\n <span *ngIf=\"col.Pipe == 'date'\">{{ item[col.Campo] | date: 'dd/MM/yyyy' }}</span> \n <span *ngIf=\"col.Pipe == 'valor'\">{{ item[col.Campo] | valorFormat }}</span>\n <span *ngIf=\"col.RenderFunction\" [innerHtml]=\"col.RenderFunction(item) | safeHtml\"></span>\n <span *ngIf=\"!col.Pipe && !col.RenderFunction\">{{ item[col.Campo] ?? col.Default }}</span>\n </td>\n <td *ngIf=\"tabelaCampos.Excluir === true\" style=\"padding: 0px; text-align: center;\">\n <ion-button size=\"small\" color=\"danger\" fill=\"outline\" style=\"transform: scale(0.85);\" (click)=\"excluirLinha(item)\">\n <ion-icon name=\"trash\"></ion-icon>\n </ion-button>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n \n <ion-modal [isOpen]=\"isFiltroOpen\" (didDismiss)=\"isFiltroOpen = false;\">\n <ng-template>\n <ion-content class=\"ion-padding\">\n <div class=\"caixaGrande\">\n Filtrar:\n <div *ngIf=\"selectedColuna.Valores\">\n <div *ngFor=\"let valor of selectedColuna.Valores\">\n <span>{{ valor }}</span>\n </div>\n </div>\n </div>\n </ion-content>\n </ng-template>\n </ion-modal>\n </div>", styles: [".grid{width:100%}.grid thead td{border:1px solid gray;padding:4px;color:#000!important}.grid tbody td{border:1px solid gray;padding:2px 4px}.grid tbody tr{cursor:pointer}.grid tbody tr:hover{background-color:#699ccc80;transition-duration:.5s}.grid tbody tr.item-selecionado{background-color:#699ccc33}[hidden]{display:none!important}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i2.IonCol, selector: "ion-col", inputs: ["offset", "offsetLg", "offsetMd", "offsetSm", "offsetXl", "offsetXs", "pull", "pullLg", "pullMd", "pullSm", "pullXl", "pullXs", "push", "pushLg", "pushMd", "pushSm", "pushXl", "pushXs", "size", "sizeLg", "sizeMd", "sizeSm", "sizeXl", "sizeXs"] }, { kind: "component", type: i2.IonContent, selector: "ion-content", inputs: ["color", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: i2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i2.IonRow, selector: "ion-row" }, { kind: "component", type: i2.IonModal, selector: "ion-modal", inputs: ["animated", "keepContentsMounted", "backdropBreakpoint", "backdropDismiss", "breakpoints", "canDismiss", "cssClass", "enterAnimation", "event", "handle", "handleBehavior", "initialBreakpoint", "isOpen", "keyboardClose", "leaveAnimation", "mode", "presentingElement", "showBackdrop", "translucent", "trigger"] }, { kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }, { kind: "pipe", type: i4.ValorFormatPipe, name: "valorFormat" }, { kind: "pipe", type: i4.SafeHtmlPipe, name: "safeHtml" }] }); }
2366
- }
2367
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: GridViewComponent, decorators: [{
2368
- type: Component,
2369
- args: [{ selector: 'kb-grid-view', template: "<div style=\"font-size: 14px;\">\n <div id=\"painelExportacao\">\n <ion-row *ngIf=\"inMemoryPagination\">\n <!--\n <ion-col size=\"2\">\n <ion-button *ngIf=\"tabelaCampos.Selecionar === true\" size=\"small\" fill=\"outline\" color=\"medium\"\n (click)=\"selecionarTodos()\">Selecionar Todos</ion-button>\n </ion-col>\n -->\n <ion-col size=\"3\">\n <ion-button *ngIf=\"inMemoryPagination === true\" size=\"small\" fill=\"outline\" color=\"bluetool\"\n (click)=\"anterior()\">\n <ion-icon name=\"chevron-back-outline\" slot=\"start\"></ion-icon>\n Anterior\n </ion-button>\n <ion-button *ngIf=\"inMemoryPagination === true\" size=\"small\" fill=\"outline\" color=\"bluetool\"\n (click)=\"proximo()\">\n Pr\u00F3ximo\n <ion-icon name=\"chevron-forward-outline\" slot=\"end\"></ion-icon>\n </ion-button> \n </ion-col>\n <ion-col size=\"2\">\n <span style=\"display: block; margin-top: 10px;\" *ngIf=\"inMemoryPagination && totalRec > 0\">Exibindo {{ start + 1 }} - {{ (start + pageOffset) < totalRec ? (start + pageOffset) : totalRec }} total de {{ totalRec }} \n </span> \n </ion-col>\n </ion-row>\n </div>\n <div style=\"width: 100%;\" [style.min-height]=\"minHeight\">\n <table class=\"grid\">\n <thead>\n <tr style=\"background-color: var(--ion-color-bluetool); color: white;\">\n <td *ngIf=\"tabelaCampos.Selecionar === true\" style=\"width: 3%; text-align: center;\">\n <input type=\"checkbox\" [(ngModel)]=\"todosSelecionados\" (change)=\"selecionarTodos()\">\n </td>\n <td *ngFor=\"let col of tabelaCampos.Colunas\" [style.width]=\"col.Tamanho\">\n <div style=\"position: relative;\">\n <div style=\"display: flex; justify-content: space-between; align-items: end;\">\n <strong>{{ col.Titulo }}</strong>\n <div>\n <ion-icon *ngIf=\"col.Ordem\" slot=\"end\" (click)=\"ordenar(col)\" style=\"cursor: pointer;\"\n [name]=\"col.OrdemStatus == 0 ? 'swap-vertical' : (col.OrdemStatus == 1 ? 'arrow-up': 'arrow-down')\"></ion-icon>\n \n <ion-icon *ngIf=\"col.Filtrar\" name=\"funnel\" (click)=\"setFiltroOpen(col)\" slot=\"end\"></ion-icon>\n </div>\n </div>\n \n \n <div class=\"caixaGrande\" [hidden]=\"!col.FiltroVisivel\" tabindex=\"-1\"\n style=\"color: black; display: block; position: absolute; z-index: 800; width: 210px; right: 0px; opacity: 0.9;\">\n Filtrar:\n <div>\n <div style=\"display: flex; justify-content: space-between; align-items: start;\">\n <select style=\"width: 80px;\" [(ngModel)]=\"col.FiltroOperador\">\n <option>=</option>\n <option>&gt;=</option>\n <option>&lt;=</option>\n <option>tem</option>\n </select>\n <input style=\"width: 100px;\" type=\"text\" [(ngModel)]=\"col.FiltroValor\">\n </div>\n <ion-button size=\"small\" color=\"medium\" expand=\"block\" (click)=\"filtrar(col)\">Filtrar</ion-button>\n <ion-button size=\"small\" color=\"light\" expand=\"block\" (click)=\"limpar()\">Limpar</ion-button>\n </div>\n <div *ngIf=\"col.Valores\" class=\"scroll-container\" style=\"height: 200px; overflow-y: scroll;\">\n <div *ngFor=\"let valor of col.Valores\">\n <input type=\"checkbox\" [(ngModel)]=\"valor.Selecionado\">\n <span>{{ valor.Valor }}</span>\n </div>\n </div>\n </div>\n \n </div>\n </td>\n <td *ngIf=\"tabelaCampos.Excluir === true\">\n \n </td>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let item of pageDataSet\" [class]=\"item == selectedItem ? 'item-selecionado' : '' \">\n <td *ngIf=\"tabelaCampos.Selecionar === true\" style=\"text-align: center; cursor: auto;\">\n <input type=\"checkbox\" [(ngModel)]=\"item[tabelaCampos.CampoSelecionar]\" (change)=\"selecionadoChecked()\">\n </td>\n <td class=\"col\" *ngFor=\"let col of tabelaCampos.Colunas\" [style.width]=\"col.Tamanho\"\n [style.text-align]=\"col.Tipo == 'number' ? 'right' : (col.Alinhamento ?? 'left')\"\n (click)=\"col.ClickFunction ? col.ClickFunction(item) : selecionarLinha(item)\">\n <span *ngIf=\"col.Pipe == 'date'\">{{ item[col.Campo] | date: 'dd/MM/yyyy' }}</span> \n <span *ngIf=\"col.Pipe == 'valor'\">{{ item[col.Campo] | valorFormat }}</span>\n <span *ngIf=\"col.RenderFunction\" [innerHtml]=\"col.RenderFunction(item) | safeHtml\"></span>\n <span *ngIf=\"!col.Pipe && !col.RenderFunction\">{{ item[col.Campo] ?? col.Default }}</span>\n </td>\n <td *ngIf=\"tabelaCampos.Excluir === true\" style=\"padding: 0px; text-align: center;\">\n <ion-button size=\"small\" color=\"danger\" fill=\"outline\" style=\"transform: scale(0.85);\" (click)=\"excluirLinha(item)\">\n <ion-icon name=\"trash\"></ion-icon>\n </ion-button>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n \n <ion-modal [isOpen]=\"isFiltroOpen\" (didDismiss)=\"isFiltroOpen = false;\">\n <ng-template>\n <ion-content class=\"ion-padding\">\n <div class=\"caixaGrande\">\n Filtrar:\n <div *ngIf=\"selectedColuna.Valores\">\n <div *ngFor=\"let valor of selectedColuna.Valores\">\n <span>{{ valor }}</span>\n </div>\n </div>\n </div>\n </ion-content>\n </ng-template>\n </ion-modal>\n </div>", styles: [".grid{width:100%}.grid thead td{border:1px solid gray;padding:4px;color:#000!important}.grid tbody td{border:1px solid gray;padding:2px 4px}.grid tbody tr{cursor:pointer}.grid tbody tr:hover{background-color:#699ccc80;transition-duration:.5s}.grid tbody tr.item-selecionado{background-color:#699ccc33}[hidden]{display:none!important}\n"] }]
2370
- }], ctorParameters: () => [], propDecorators: { empresaId: [{
2371
- type: Input
2372
- }], tabelaCampos: [{
2373
- type: Input
2374
- }], dataSet: [{
2375
- type: Input
2376
- }], minHeight: [{
2377
- type: Input
2378
- }], inMemoryPagination: [{
2379
- type: Input
2380
- }], selecionarItem: [{
2381
- type: Output
2382
- }], excluirItem: [{
2383
- type: Output
2384
- }], selecionarChecked: [{
2385
- type: Output
2386
- }], filteredDataSet: [{
2387
- type: Input
2388
- }], pageOffset: [{
2389
- type: Input
2390
- }] } });
2391
-
2392
- const LibConfigService = new InjectionToken('LibConfig');
2393
- class AppprojectComponentsModule {
2394
- static forRoot(config) {
2395
- return {
2396
- ngModule: AppprojectComponentsModule,
2397
- providers: [
2398
- AppprojectComponentsService,
2399
- {
2400
- provide: 'LibConfigService',
2401
- useValue: config
2402
- }
2403
- ]
2404
- };
2405
- }
2406
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: AppprojectComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2407
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.7", ngImport: i0, type: AppprojectComponentsModule, declarations: [AppprojectComponentsComponent,
2408
- InputTextComponent,
2409
- InputFormatComponent,
2410
- InputSelectComponent,
2411
- InputPesquisaComponent,
2412
- ModelTreeviewComponent,
2413
- InputValorComponent,
2414
- InputAreaComponent,
2415
- InputCepComponent,
2416
- InputArquivoComponent,
2417
- BtnActionComponent,
2418
- BtnCancelarComponent,
2419
- BtnExcluirComponent,
2420
- BtnNovoComponent,
2421
- BtnSalvarComponent,
2422
- EntityEditComponent,
2423
- InputCheckboxComponent,
2424
- InputRadioComponent,
2425
- TreeViewComponent,
2426
- TreeViewNivelComponent,
2427
- GridViewComponent], imports: [CommonModule,
2428
- HttpClientModule,
2429
- IonicModule,
2430
- FormsModule,
2431
- ReactiveFormsModule,
2432
- ValorFormatPipe,
2433
- SafeHtmlPipe], exports: [AppprojectComponentsComponent,
2434
- InputTextComponent,
2435
- InputFormatComponent,
2436
- InputSelectComponent,
2437
- InputPesquisaComponent,
2438
- ModelTreeviewComponent,
2439
- InputValorComponent,
2440
- InputAreaComponent,
2441
- InputCepComponent,
2442
- InputArquivoComponent,
2443
- BtnActionComponent,
2444
- BtnCancelarComponent,
2445
- BtnExcluirComponent,
2446
- BtnNovoComponent,
2447
- BtnSalvarComponent,
2448
- EntityEditComponent,
2449
- InputCheckboxComponent,
2450
- InputRadioComponent,
2451
- TreeViewComponent,
2452
- TreeViewNivelComponent,
2453
- GridViewComponent] }); }
2454
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: AppprojectComponentsModule, imports: [CommonModule,
2455
- HttpClientModule,
2456
- IonicModule,
2457
- FormsModule,
2458
- ReactiveFormsModule] }); }
2459
- }
2460
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.7", ngImport: i0, type: AppprojectComponentsModule, decorators: [{
2461
- type: NgModule,
2462
- args: [{
2463
- declarations: [
2464
- AppprojectComponentsComponent,
2465
- InputTextComponent,
2466
- InputFormatComponent,
2467
- InputSelectComponent,
2468
- InputPesquisaComponent,
2469
- ModelTreeviewComponent,
2470
- InputValorComponent,
2471
- InputAreaComponent,
2472
- InputCepComponent,
2473
- InputArquivoComponent,
2474
- BtnActionComponent,
2475
- BtnCancelarComponent,
2476
- BtnExcluirComponent,
2477
- BtnNovoComponent,
2478
- BtnSalvarComponent,
2479
- EntityEditComponent,
2480
- InputCheckboxComponent,
2481
- InputRadioComponent,
2482
- TreeViewComponent,
2483
- TreeViewNivelComponent,
2484
- GridViewComponent
2485
- ],
2486
- imports: [
2487
- CommonModule,
2488
- HttpClientModule,
2489
- IonicModule,
2490
- FormsModule,
2491
- ReactiveFormsModule,
2492
- ValorFormatPipe,
2493
- SafeHtmlPipe
2494
- ],
2495
- exports: [
2496
- AppprojectComponentsComponent,
2497
- InputTextComponent,
2498
- InputFormatComponent,
2499
- InputSelectComponent,
2500
- InputPesquisaComponent,
2501
- ModelTreeviewComponent,
2502
- InputValorComponent,
2503
- InputAreaComponent,
2504
- InputCepComponent,
2505
- InputArquivoComponent,
2506
- BtnActionComponent,
2507
- BtnCancelarComponent,
2508
- BtnExcluirComponent,
2509
- BtnNovoComponent,
2510
- BtnSalvarComponent,
2511
- EntityEditComponent,
2512
- InputCheckboxComponent,
2513
- InputRadioComponent,
2514
- TreeViewComponent,
2515
- TreeViewNivelComponent,
2516
- GridViewComponent
2517
- ],
2518
- schemas: [CUSTOM_ELEMENTS_SCHEMA]
2519
- }]
2520
- }] });
2521
-
2522
- /*
2523
- * Public API Surface of appproject-components
2524
- */
2525
-
2526
- /**
2527
- * Generated bundle index. Do not edit.
2528
- */
2529
-
2530
- export { AppprojectComponentsComponent, AppprojectComponentsModule, AppprojectComponentsService, BaseInputComponent, BtnActionComponent, BtnCancelarComponent, BtnExcluirComponent, BtnNovoComponent, BtnSalvarComponent, EntityEditComponent, GridViewComponent, InputAreaComponent, InputArquivoComponent, InputCepComponent, InputCheckboxComponent, InputFormatComponent, InputPesquisaComponent, InputRadioComponent, InputSelectComponent, InputTextComponent, InputValorComponent, LibConfigService, ModelTreeviewComponent, TreeViewComponent, TreeViewNivelComponent };
2531
- //# sourceMappingURL=appproject-components.mjs.map