lib-portal-angular 0.0.66 → 0.0.68

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,19 +1,19 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, EventEmitter, forwardRef, Component, ChangeDetectionStrategy, Input, Output, HostListener, ViewChild, Directive, NgModule, createComponent } from '@angular/core';
2
+ import { Injectable, EventEmitter, Component, Input, Output, ChangeDetectionStrategy, HostListener, forwardRef, ViewChild, Directive, NgModule, createComponent } from '@angular/core';
3
+ import * as i1 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import * as i1$1 from 'lucide-angular';
6
+ import { LucideAngularModule, icons } from 'lucide-angular';
3
7
  import * as i4 from '@angular/forms';
4
8
  import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
- import { of, Subject, Subscription, Observable } from 'rxjs';
9
+ import hljs from 'highlight.js';
10
+ import * as i1$2 from '@ng-bootstrap/ng-bootstrap';
11
+ import { Subject, of, Subscription, Observable } from 'rxjs';
6
12
  import { debounceTime, startWith, switchMap, map, catchError, takeUntil } from 'rxjs/operators';
7
13
  import * as i2 from '@angular/common/http';
8
14
  import { HttpParams } from '@angular/common/http';
9
- import * as i2$1 from '@angular/common';
10
- import { CommonModule } from '@angular/common';
11
15
  import * as i5 from '@ng-select/ng-select';
12
16
  import { NgSelectModule } from '@ng-select/ng-select';
13
- import hljs from 'highlight.js';
14
- import * as i1 from '@ng-bootstrap/ng-bootstrap';
15
- import * as i1$1 from 'lucide-angular';
16
- import { LucideAngularModule, icons } from 'lucide-angular';
17
17
  import * as CryptoJS from 'crypto-js';
18
18
 
19
19
  class AuthService {
@@ -48,188 +48,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
48
48
  }]
49
49
  }], ctorParameters: function () { return []; } });
50
50
 
51
- class MultiSelectComponent {
52
- constructor(authService, http) {
51
+ class AccordionArgentaComponent {
52
+ constructor(authService) {
53
53
  this.authService = authService;
54
- this.http = http;
55
- this.label = 'Multi Select';
56
- this.data = []; // Accepts an array of generic objects
57
- this.placeholder = 'Select items';
58
- this.id = 'multiSelectId';
59
- this.bindLabel = ''; // Generic dynamic label
60
- this.bindValue = ''; // Generic dynamic value
61
- this.closeOnSelect = false; // New property to control dropdown close behavior
62
- this.searchUrl = ''; // URL for backend search
63
- this.multiple = true; // New property to control single or multiple selection
64
- this.searchParams = {}; // Parâmetros de busca dinâmicos
65
- this.keyupEvent = new EventEmitter();
66
- this.backupData = []; // Backup of the initial data
67
- this.allItems = []; // Store the combined list
68
- this.items = of([]); // Initialization of the property
69
- this.filteredItems = of([]); // Filtered items
70
- this.searchTerms = new Subject(); // For search debounce
71
- this.onChangeCallback = () => { };
72
- this.onTouchedCallback = () => { };
73
- this.isCourseEntered = false;
74
- this.compareFn = (item1, item2) => {
75
- return item1 && item2 ? item1[this.bindValue] === item2[this.bindValue] : item1 === item2;
76
- };
54
+ this.title = 'Accordion Title'; // Título do accordion
55
+ this.isOpen = false; // Estado inicial do accordion
56
+ this.permissions = []; // Permissões necessárias para exibir o accordion
57
+ this.toggleEvent = new EventEmitter(); // Evento emitido ao abrir/fechar o accordion
77
58
  }
78
59
  ngOnInit() {
79
- this.backupData = [...this.data]; // Backup initial data
80
- this.allItems = [...this.data]; // Initialize allItems with the initial data
81
- this.items = of(this.allItems);
82
- this.fetchInitialData().subscribe(data => {
83
- this.updateData(data);
84
- this.filteredItems = this.searchTerms.pipe(debounceTime(700), startWith(''), // Start with an empty search to load the original list
85
- switchMap(term => this.search(term)));
86
- // Adicionar itens selecionados à lista após buscar dados iniciais
87
- this.addSelectedItemsToData();
88
- });
60
+ this.validatePermissions();
89
61
  }
90
62
  ngOnChanges(changes) {
91
- if (changes['selected'] && !changes['selected'].isFirstChange()) {
92
- this.addSelectedItemsToData();
93
- }
94
- }
95
- fetchInitialData() {
96
- return this.http.get(this.searchUrl).pipe(map((response) => {
97
- if (response && response.length > 0) {
98
- return response.map((item) => ({
99
- [this.bindValue]: item[this.bindValue],
100
- [this.bindLabel]: item[this.bindLabel]
101
- }));
102
- }
103
- return [];
104
- }), catchError((error) => {
105
- console.error('Error fetching initial data from backend:', error);
106
- return of([]);
107
- }));
108
- }
109
- updateData(newData) {
110
- newData.forEach((item) => {
111
- const existsInList = this.allItems.some(listItem => this.compareFn(listItem, item));
112
- if (!existsInList) {
113
- this.allItems.push(item);
114
- }
115
- });
116
- this.items = of(this.allItems);
117
- }
118
- addSelectedItemsToData() {
119
- if (this.selected) {
120
- const selectedItems = this.multiple ? this.selected : [this.selected];
121
- selectedItems.forEach((item) => {
122
- const existsInList = this.allItems.some(listItem => this.compareFn(listItem, item));
123
- if (!existsInList) {
124
- const newItem = {
125
- [this.bindValue]: item[this.bindValue] || item,
126
- [this.bindLabel]: item[this.bindLabel] || item
127
- };
128
- this.data.push(newItem);
129
- this.allItems.push(newItem);
130
- }
131
- });
132
- this.items = of(this.allItems);
133
- }
134
- }
135
- onFocus() {
136
- this.isCourseEntered = true;
137
- }
138
- onBlur() {
139
- this.isCourseEntered = false;
140
- }
141
- onKeyUp(event) {
142
- this.keyupEvent.emit(event);
143
- }
144
- onSelectedChange(event) {
145
- const previousSelected = this.selected;
146
- if (this.multiple) {
147
- this.selected = event;
148
- }
149
- else {
150
- this.selected = event ? event : null;
151
- }
152
- this.onChangeCallback(this.selected);
153
- // Verificar se um item foi removido
154
- if (previousSelected && Array.isArray(previousSelected) && previousSelected.length > event.length) {
155
- const removedItems = previousSelected.filter(item => !event.includes(item));
156
- removedItems.forEach(item => {
157
- const existsInData = this.data.some(dataItem => this.compareFn(dataItem, item));
158
- if (!existsInData) {
159
- this.data.push(item);
160
- this.allItems.push(item); // Adicionar de volta aos itens disponíveis
161
- }
162
- });
163
- }
164
- }
165
- onInputChange(event) {
166
- const input = event.target.value;
167
- this.searchTerms.next(input);
168
- }
169
- search(term) {
170
- if (!term.trim()) {
171
- // Se o termo de busca estiver vazio, retorna a lista completa
172
- return of(this.allItems);
173
- }
174
- // Filtra os itens localmente
175
- const filtered = this.allItems.filter((item) => item[this.bindLabel].toLowerCase().includes(term.toLowerCase()));
176
- if (filtered.length > 0) {
177
- console.log('Items filtered locally.');
178
- return of(filtered);
179
- }
180
- else if (this.searchUrl) {
181
- // Construir os parâmetros de busca dinamicamente
182
- const params = new URLSearchParams(this.searchParams);
183
- params.append('term', term);
184
- return this.http.get(`${this.searchUrl}?${params.toString()}`).pipe(map((response) => {
185
- if (response && response.length > 0) {
186
- // Transforma os itens do backend para o formato esperado pelo componente
187
- const transformedItems = response.map((item) => ({
188
- [this.bindValue]: item[this.bindValue],
189
- [this.bindLabel]: item[this.bindLabel]
190
- }));
191
- // Atualiza os dados com os novos itens buscados
192
- this.updateData(transformedItems);
193
- return this.allItems;
194
- }
195
- else {
196
- console.log('No items found in the backend search.');
197
- return this.allItems;
198
- }
199
- }), catchError((error) => {
200
- console.error('Error fetching from backend:', error);
201
- return of(this.allItems);
202
- }));
203
- }
204
- else {
205
- console.log('No search URL provided and no items found locally.');
206
- return of(this.allItems);
207
- }
208
- }
209
- writeValue(value) {
210
- if (this.multiple) {
211
- this.selected = value || [];
212
- }
213
- else {
214
- this.selected = value || null;
63
+ if (changes['permissions']) {
64
+ this.validatePermissions();
215
65
  }
216
- this.addSelectedItemsToData();
217
- }
218
- registerOnChange(fn) {
219
- this.onChangeCallback = fn;
220
- }
221
- registerOnTouched(fn) {
222
- this.onTouchedCallback = fn;
223
- }
224
- setDisabledState(isDisabled) {
225
- // No implementation needed for this example
226
66
  }
227
67
  hasPermission() {
228
68
  if (!this.permissions || this.permissions.length === 0) {
229
- return true;
69
+ return true; // Se não forem passadas permissões, o accordion será exibido por padrão
230
70
  }
231
71
  try {
232
- return this.authService.hasPermission(this.permissions);
72
+ return this.authService.hasPermission(this.permissions); // Verifica se o usuário tem as permissões
233
73
  }
234
74
  catch (error) {
235
75
  if (error instanceof Error) {
@@ -238,93 +78,34 @@ class MultiSelectComponent {
238
78
  else {
239
79
  console.error('Unknown error occurred during permission check');
240
80
  }
241
- return true;
81
+ return false; // Se ocorrer um erro ou as permissões não forem válidas, o accordion não será exibido
242
82
  }
243
83
  }
244
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MultiSelectComponent, deps: [{ token: AuthService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Component }); }
245
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MultiSelectComponent, selector: "argenta-custom-multi-select", inputs: { label: "label", data: "data", placeholder: "placeholder", selected: "selected", id: "id", bindLabel: "bindLabel", bindValue: "bindValue", permissions: "permissions", closeOnSelect: "closeOnSelect", searchUrl: "searchUrl", multiple: "multiple", searchParams: "searchParams" }, outputs: { keyupEvent: "keyupEvent" }, providers: [
246
- {
247
- provide: NG_VALUE_ACCESSOR,
248
- useExisting: forwardRef(() => MultiSelectComponent),
249
- multi: true
250
- }
251
- ], usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"hasPermission()\" class=\"form-group\">\n <label [for]=\"id\" class=\"form-label\" style=\"margin-top: 1rem;\">{{ label }}</label>\n <ng-select\n [class.course-entry]=\"isCourseEntered\"\n class=\"ng-select custom-ng-select\"\n [items]=\"filteredItems | async\"\n [multiple]=\"multiple\"\n [closeOnSelect]=\"closeOnSelect\"\n [hideSelected]=\"true\"\n [bindLabel]=\"bindLabel\"\n [bindValue]=\"bindValue\"\n [(ngModel)]=\"selected\"\n [compareWith]=\"compareFn\"\n (change)=\"onSelectedChange($event)\"\n (keyup)=\"onKeyUp($event)\"\n (input)=\"onInputChange($event)\"\n [id]=\"id\"\n [placeholder]=\"selected && (multiple ? selected.length === 0 : !selected) ? placeholder : ''\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\">\n <ng-template ng-option-tmp let-item=\"item\">\n {{ item[bindLabel] }}\n </ng-template>\n </ng-select>\n</div>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.form-group{font-family:Inter,Arial,sans-serif;font-size:1rem}.form-check-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem}.form-check-label{width:623px;height:19px;top:1608px;left:133px;gap:0px;opacity:0px;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left}.custom-select{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem;font-weight:400;border:1px solid #ccc;border-radius:4px;appearance:none;-webkit-appearance:none;-moz-appearance:none;padding-right:2rem;background-image:none;background-repeat:no-repeat;background-position:right .5rem center;height:46px}.custom-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem;height:46px}.custom-input::placeholder{font-size:14px;color:#d3d3d3}.form-label{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem}.label-styles{font-weight:400;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.2rem}.select-container{position:relative;display:inline-block;width:100%}.select-container lucide-icon{position:absolute;right:.75rem;top:50%;transform:translateY(-50%);pointer-events:none;color:#5e6366}.ng-select{display:block;width:100%;font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem}.ng-select .ng-select-container{display:flex;align-items:center;border:1px solid #ccc;border-radius:4px;padding:.5rem;background-color:#fff;color:#333}.ng-select .ng-select-container .ng-value-container{display:flex;align-items:center;flex-grow:1}.ng-select .ng-select-container .ng-clear{display:none}.ng-select .ng-select-container .ng-input{flex-grow:1;border:none;outline:none}.custom-ng-select.ng-select .ng-select-container .ng-input>input{box-sizing:border-box;background:none transparent;border:0 none;box-shadow:none;outline:none;padding:.5rem!important;cursor:default;width:100%}.ng-select .ng-dropdown-panel{border:1px solid #ccc;border-radius:4px;background-color:#fff;color:#333;box-shadow:0 2px 4px #0000001a}.ng-select .ng-dropdown-panel .ng-option{padding:8px;cursor:pointer}.ng-select .ng-dropdown-panel .ng-option:hover{background-color:#f1f1f1}.ng-select .ng-dropdown-panel .ng-option.selected{background-color:#007bff;color:#fff}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i5.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i5.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
84
+ toggle() {
85
+ this.isOpen = !this.isOpen;
86
+ this.toggleEvent.emit(this.isOpen); // Emite o estado atual (aberto ou fechado)
87
+ }
88
+ validatePermissions() {
89
+ if (!Array.isArray(this.permissions)) {
90
+ throw new Error(`Invalid permissions: ${this.permissions}. It should be an array of strings.`);
91
+ }
92
+ }
93
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AccordionArgentaComponent, deps: [{ token: AuthService }], target: i0.ɵɵFactoryTarget.Component }); }
94
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AccordionArgentaComponent, selector: "argenta-accordion", inputs: { title: "title", isOpen: "isOpen", permissions: "permissions" }, outputs: { toggleEvent: "toggleEvent" }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"hasPermission()\">\n <div class=\"accordion\">\n <div class=\"accordion-header\" (click)=\"toggle()\" [class.open]=\"isOpen\">\n <h3>{{ title }}</h3>\n <!-- \u00CDcone da seta -->\n <span class=\"accordion-icon\">\u25BC</span>\n </div>\n <div class=\"accordion-content\" [class.open]=\"isOpen\">\n <ng-content></ng-content> <!-- Conte\u00FAdo do accordion -->\n </div>\n </div>\n</ng-container>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.accordion{border:1px solid #ccc;border-radius:8px;margin-bottom:15px;font-family:Inter,Arial,sans-serif;transition:max-height .4s ease;overflow:hidden}.accordion .accordion-header{background-color:#00444c;color:#fff;cursor:pointer;padding:10px;display:flex;justify-content:space-between;align-items:center;font-size:1.2rem}.accordion .accordion-header h3{margin:0;font-size:1rem;font-weight:700}.accordion .accordion-header .accordion-icon{font-size:1.2rem;transition:transform .4s ease;transform:rotate(0)}.accordion .accordion-header.open .accordion-icon{transform:rotate(180deg)}.accordion .accordion-content{max-height:0;overflow:hidden;padding:0 10px;background-color:#fff;font-size:.9rem;transition:max-height .4s ease,padding .4s ease}.accordion .accordion-content.open{max-height:500px;padding:10px;border-bottom-left-radius:8px;border-bottom-right-radius:8px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
252
95
  }
253
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MultiSelectComponent, decorators: [{
96
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AccordionArgentaComponent, decorators: [{
254
97
  type: Component,
255
- args: [{ selector: 'argenta-custom-multi-select', providers: [
256
- {
257
- provide: NG_VALUE_ACCESSOR,
258
- useExisting: forwardRef(() => MultiSelectComponent),
259
- multi: true
260
- }
261
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"hasPermission()\" class=\"form-group\">\n <label [for]=\"id\" class=\"form-label\" style=\"margin-top: 1rem;\">{{ label }}</label>\n <ng-select\n [class.course-entry]=\"isCourseEntered\"\n class=\"ng-select custom-ng-select\"\n [items]=\"filteredItems | async\"\n [multiple]=\"multiple\"\n [closeOnSelect]=\"closeOnSelect\"\n [hideSelected]=\"true\"\n [bindLabel]=\"bindLabel\"\n [bindValue]=\"bindValue\"\n [(ngModel)]=\"selected\"\n [compareWith]=\"compareFn\"\n (change)=\"onSelectedChange($event)\"\n (keyup)=\"onKeyUp($event)\"\n (input)=\"onInputChange($event)\"\n [id]=\"id\"\n [placeholder]=\"selected && (multiple ? selected.length === 0 : !selected) ? placeholder : ''\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\">\n <ng-template ng-option-tmp let-item=\"item\">\n {{ item[bindLabel] }}\n </ng-template>\n </ng-select>\n</div>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.form-group{font-family:Inter,Arial,sans-serif;font-size:1rem}.form-check-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem}.form-check-label{width:623px;height:19px;top:1608px;left:133px;gap:0px;opacity:0px;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left}.custom-select{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem;font-weight:400;border:1px solid #ccc;border-radius:4px;appearance:none;-webkit-appearance:none;-moz-appearance:none;padding-right:2rem;background-image:none;background-repeat:no-repeat;background-position:right .5rem center;height:46px}.custom-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem;height:46px}.custom-input::placeholder{font-size:14px;color:#d3d3d3}.form-label{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem}.label-styles{font-weight:400;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.2rem}.select-container{position:relative;display:inline-block;width:100%}.select-container lucide-icon{position:absolute;right:.75rem;top:50%;transform:translateY(-50%);pointer-events:none;color:#5e6366}.ng-select{display:block;width:100%;font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem}.ng-select .ng-select-container{display:flex;align-items:center;border:1px solid #ccc;border-radius:4px;padding:.5rem;background-color:#fff;color:#333}.ng-select .ng-select-container .ng-value-container{display:flex;align-items:center;flex-grow:1}.ng-select .ng-select-container .ng-clear{display:none}.ng-select .ng-select-container .ng-input{flex-grow:1;border:none;outline:none}.custom-ng-select.ng-select .ng-select-container .ng-input>input{box-sizing:border-box;background:none transparent;border:0 none;box-shadow:none;outline:none;padding:.5rem!important;cursor:default;width:100%}.ng-select .ng-dropdown-panel{border:1px solid #ccc;border-radius:4px;background-color:#fff;color:#333;box-shadow:0 2px 4px #0000001a}.ng-select .ng-dropdown-panel .ng-option{padding:8px;cursor:pointer}.ng-select .ng-dropdown-panel .ng-option:hover{background-color:#f1f1f1}.ng-select .ng-dropdown-panel .ng-option.selected{background-color:#007bff;color:#fff}\n"] }]
262
- }], ctorParameters: function () { return [{ type: AuthService }, { type: i2.HttpClient }]; }, propDecorators: { label: [{
263
- type: Input
264
- }], data: [{
265
- type: Input
266
- }], placeholder: [{
267
- type: Input
268
- }], selected: [{
269
- type: Input
270
- }], id: [{
271
- type: Input
272
- }], bindLabel: [{
98
+ args: [{ selector: 'argenta-accordion', template: "<ng-container *ngIf=\"hasPermission()\">\n <div class=\"accordion\">\n <div class=\"accordion-header\" (click)=\"toggle()\" [class.open]=\"isOpen\">\n <h3>{{ title }}</h3>\n <!-- \u00CDcone da seta -->\n <span class=\"accordion-icon\">\u25BC</span>\n </div>\n <div class=\"accordion-content\" [class.open]=\"isOpen\">\n <ng-content></ng-content> <!-- Conte\u00FAdo do accordion -->\n </div>\n </div>\n</ng-container>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.accordion{border:1px solid #ccc;border-radius:8px;margin-bottom:15px;font-family:Inter,Arial,sans-serif;transition:max-height .4s ease;overflow:hidden}.accordion .accordion-header{background-color:#00444c;color:#fff;cursor:pointer;padding:10px;display:flex;justify-content:space-between;align-items:center;font-size:1.2rem}.accordion .accordion-header h3{margin:0;font-size:1rem;font-weight:700}.accordion .accordion-header .accordion-icon{font-size:1.2rem;transition:transform .4s ease;transform:rotate(0)}.accordion .accordion-header.open .accordion-icon{transform:rotate(180deg)}.accordion .accordion-content{max-height:0;overflow:hidden;padding:0 10px;background-color:#fff;font-size:.9rem;transition:max-height .4s ease,padding .4s ease}.accordion .accordion-content.open{max-height:500px;padding:10px;border-bottom-left-radius:8px;border-bottom-right-radius:8px}\n"] }]
99
+ }], ctorParameters: function () { return [{ type: AuthService }]; }, propDecorators: { title: [{
273
100
  type: Input
274
- }], bindValue: [{
101
+ }], isOpen: [{
275
102
  type: Input
276
103
  }], permissions: [{
277
104
  type: Input
278
- }], closeOnSelect: [{
279
- type: Input
280
- }], searchUrl: [{
281
- type: Input
282
- }], multiple: [{
283
- type: Input
284
- }], searchParams: [{
285
- type: Input
286
- }], keyupEvent: [{
105
+ }], toggleEvent: [{
287
106
  type: Output
288
107
  }] } });
289
108
 
290
- class MultiSelectCategoryComponent {
291
- constructor() {
292
- // Inputs para receber dados dinâmicos de diferentes categorias
293
- this.unidadesOrganizacionais = [];
294
- this.clientes = [];
295
- this.empresas = [];
296
- this.usuarios = [];
297
- // Inputs para permissões específicas de cada categoria
298
- this.permissoesUnidades = [];
299
- this.permissoesClientes = [];
300
- this.permissoesEmpresas = [];
301
- this.permissoesUsuarios = [];
302
- }
303
- ngOnInit() { }
304
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MultiSelectCategoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
305
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MultiSelectCategoryComponent, selector: "argenta-multi-select-category", inputs: { unidadesOrganizacionais: "unidadesOrganizacionais", clientes: "clientes", empresas: "empresas", usuarios: "usuarios", permissoesUnidades: "permissoesUnidades", permissoesClientes: "permissoesClientes", permissoesEmpresas: "permissoesEmpresas", permissoesUsuarios: "permissoesUsuarios" }, ngImport: i0, template: "<div class=\"multi-select-category\">\n <div class=\"row\">\n <!-- Primeira linha: Usu\u00E1rio e Cliente -->\n <div class=\"col\">\n <argenta-custom-multi-select\n label=\"Usu\u00E1rios\"\n [data]=\"usuarios\"\n bindLabel=\"nome\"\n bindValue=\"id\"\n [permissions]=\"permissoesUsuarios\"\n placeholder=\"Selecione Usu\u00E1rios\">\n </argenta-custom-multi-select>\n </div>\n\n <div class=\"col\">\n <argenta-custom-multi-select\n label=\"Clientes\"\n [data]=\"clientes\"\n bindLabel=\"nome\"\n bindValue=\"id\"\n [permissions]=\"permissoesClientes\"\n placeholder=\"Selecione Clientes\">\n </argenta-custom-multi-select>\n </div>\n </div>\n\n <div class=\"row\">\n <!-- Segunda linha: Empresa e Unidade Organizacional -->\n <div class=\"col\">\n <argenta-custom-multi-select\n label=\"Empresas\"\n [data]=\"empresas\"\n bindLabel=\"nome\"\n bindValue=\"id\"\n [permissions]=\"permissoesEmpresas\"\n placeholder=\"Selecione Empresas\">\n </argenta-custom-multi-select>\n </div>\n\n <div class=\"col\">\n <argenta-custom-multi-select\n label=\"Unidades Organizacionais\"\n [data]=\"unidadesOrganizacionais\"\n bindLabel=\"nome\"\n bindValue=\"id\"\n [permissions]=\"permissoesUnidades\"\n placeholder=\"Selecione Unidades Organizacionais\">\n </argenta-custom-multi-select>\n </div>\n </div>\n</div>\n", styles: [".multi-select-category{display:flex;flex-direction:column;gap:1rem}.multi-select-category .row{display:flex;gap:1rem}.multi-select-category .col{flex:1}\n"], dependencies: [{ kind: "component", type: MultiSelectComponent, selector: "argenta-custom-multi-select", inputs: ["label", "data", "placeholder", "selected", "id", "bindLabel", "bindValue", "permissions", "closeOnSelect", "searchUrl", "multiple", "searchParams"], outputs: ["keyupEvent"] }] }); }
306
- }
307
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MultiSelectCategoryComponent, decorators: [{
308
- type: Component,
309
- args: [{ selector: 'argenta-multi-select-category', template: "<div class=\"multi-select-category\">\n <div class=\"row\">\n <!-- Primeira linha: Usu\u00E1rio e Cliente -->\n <div class=\"col\">\n <argenta-custom-multi-select\n label=\"Usu\u00E1rios\"\n [data]=\"usuarios\"\n bindLabel=\"nome\"\n bindValue=\"id\"\n [permissions]=\"permissoesUsuarios\"\n placeholder=\"Selecione Usu\u00E1rios\">\n </argenta-custom-multi-select>\n </div>\n\n <div class=\"col\">\n <argenta-custom-multi-select\n label=\"Clientes\"\n [data]=\"clientes\"\n bindLabel=\"nome\"\n bindValue=\"id\"\n [permissions]=\"permissoesClientes\"\n placeholder=\"Selecione Clientes\">\n </argenta-custom-multi-select>\n </div>\n </div>\n\n <div class=\"row\">\n <!-- Segunda linha: Empresa e Unidade Organizacional -->\n <div class=\"col\">\n <argenta-custom-multi-select\n label=\"Empresas\"\n [data]=\"empresas\"\n bindLabel=\"nome\"\n bindValue=\"id\"\n [permissions]=\"permissoesEmpresas\"\n placeholder=\"Selecione Empresas\">\n </argenta-custom-multi-select>\n </div>\n\n <div class=\"col\">\n <argenta-custom-multi-select\n label=\"Unidades Organizacionais\"\n [data]=\"unidadesOrganizacionais\"\n bindLabel=\"nome\"\n bindValue=\"id\"\n [permissions]=\"permissoesUnidades\"\n placeholder=\"Selecione Unidades Organizacionais\">\n </argenta-custom-multi-select>\n </div>\n </div>\n</div>\n", styles: [".multi-select-category{display:flex;flex-direction:column;gap:1rem}.multi-select-category .row{display:flex;gap:1rem}.multi-select-category .col{flex:1}\n"] }]
310
- }], ctorParameters: function () { return []; }, propDecorators: { unidadesOrganizacionais: [{
311
- type: Input
312
- }], clientes: [{
313
- type: Input
314
- }], empresas: [{
315
- type: Input
316
- }], usuarios: [{
317
- type: Input
318
- }], permissoesUnidades: [{
319
- type: Input
320
- }], permissoesClientes: [{
321
- type: Input
322
- }], permissoesEmpresas: [{
323
- type: Input
324
- }], permissoesUsuarios: [{
325
- type: Input
326
- }] } });
327
-
328
109
  class AlertComponent {
329
110
  constructor() {
330
111
  this.alerts = [];
@@ -396,7 +177,7 @@ class AlertComponent {
396
177
  }, 2000); // Fechar após 2 segundos
397
178
  }
398
179
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
399
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AlertComponent, selector: "lib-alert", inputs: { alerts: "alerts" }, ngImport: i0, template: "<div *ngFor=\"let alert of alerts\" \n [ngClass]=\"getAlertClass(alert)\" \n role=\"alert\" \n [id]=\"'alert-' + alert.message\"\n (mouseenter)=\"onMouseEnter(alert)\" \n (mouseleave)=\"onMouseLeave(alert)\">\n <button type=\"button\" class=\"close\" (click)=\"closeAlert(alert)\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n <div class=\"alert-header\">\n <span [ngClass]=\"getAlertIconClass(alert)\" class=\"alert-icon\"></span>\n <strong>{{ alert.title }}</strong>\n </div>\n <div class=\"alert-body\">\n {{ alert.message }}\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";.alert-container{position:fixed;top:20px;right:20px;max-width:400px;margin:10px auto;padding:15px;border-radius:4px;background-color:#f8d7da;color:#721c24;word-wrap:break-word;opacity:0;transform:translateY(-20px);transition:opacity .5s ease,transform .5s ease;display:flex;flex-direction:column;align-items:flex-start;z-index:9999}.alert-container.show{opacity:1;transform:translateY(0)}.alert-container .close{position:absolute;top:10px;right:10px;background:none;border:none;font-size:20px;color:#000;opacity:.5;cursor:pointer;outline:none}.alert-container .close:hover{opacity:1}.alert-container .alert-header{display:flex;align-items:center;margin-bottom:5px}.alert-container .alert-icon{margin-right:10px;font-size:20px}.alert-container .alert-body{margin-left:30px}.alert-container .alert-icon.success-icon:before{content:\"\\2714\\fe0f\"}.alert-container .alert-icon.info-icon:before{content:\"\\2139\\fe0f\"}.alert-container .alert-icon.warning-icon:before{content:\"\\26a0\\fe0f\"}.alert-container .alert-icon.danger-icon:before{content:\"\\274c\"}.alert-success{background-color:#d4edda;color:#155724}.alert-info{background-color:#d8f4f7;color:#0c5460}.alert-warning{background-color:#fff3cd;color:#856404}.alert-danger{background-color:#fdd9d7;color:#721c24}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] }); }
180
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: AlertComponent, selector: "lib-alert", inputs: { alerts: "alerts" }, ngImport: i0, template: "<div *ngFor=\"let alert of alerts\" \n [ngClass]=\"getAlertClass(alert)\" \n role=\"alert\" \n [id]=\"'alert-' + alert.message\"\n (mouseenter)=\"onMouseEnter(alert)\" \n (mouseleave)=\"onMouseLeave(alert)\">\n <button type=\"button\" class=\"close\" (click)=\"closeAlert(alert)\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n <div class=\"alert-header\">\n <span [ngClass]=\"getAlertIconClass(alert)\" class=\"alert-icon\"></span>\n <strong>{{ alert.title }}</strong>\n </div>\n <div class=\"alert-body\">\n {{ alert.message }}\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";.alert-container{position:fixed;top:20px;right:20px;max-width:400px;margin:10px auto;padding:15px;border-radius:4px;background-color:#f8d7da;color:#721c24;word-wrap:break-word;opacity:0;transform:translateY(-20px);transition:opacity .5s ease,transform .5s ease;display:flex;flex-direction:column;align-items:flex-start;z-index:9999}.alert-container.show{opacity:1;transform:translateY(0)}.alert-container .close{position:absolute;top:10px;right:10px;background:none;border:none;font-size:20px;color:#000;opacity:.5;cursor:pointer;outline:none}.alert-container .close:hover{opacity:1}.alert-container .alert-header{display:flex;align-items:center;margin-bottom:5px}.alert-container .alert-icon{margin-right:10px;font-size:20px}.alert-container .alert-body{margin-left:30px}.alert-container .alert-icon.success-icon:before{content:\"\\2714\\fe0f\"}.alert-container .alert-icon.info-icon:before{content:\"\\2139\\fe0f\"}.alert-container .alert-icon.warning-icon:before{content:\"\\26a0\\fe0f\"}.alert-container .alert-icon.danger-icon:before{content:\"\\274c\"}.alert-success{background-color:#d4edda;color:#155724}.alert-info{background-color:#d8f4f7;color:#0c5460}.alert-warning{background-color:#fff3cd;color:#856404}.alert-danger{background-color:#fdd9d7;color:#721c24}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] }); }
400
181
  }
401
182
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AlertComponent, decorators: [{
402
183
  type: Component,
@@ -541,7 +322,7 @@ class BadgeComponent {
541
322
  {{ label }}
542
323
  <span class="badge">{{ badgeContent }}</span>
543
324
  </button>
544
- `, isInline: true, styles: [".notification-button{position:relative;display:inline-block;width:155px;height:58px;padding:14px 29px 14px 36px;border-radius:6px;border:none;font-size:16px;font-weight:700;text-align:center;transition:opacity .3s}.badge{position:absolute;width:52px;height:32px;top:-15px;right:-20px;background-color:#dc3545;color:#fff;border-radius:16px;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:14px;font-family:Inter,sans-serif}.notification-button.hovered{opacity:.8}.notification-button.clicked{opacity:.6}\n"], dependencies: [{ kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
325
+ `, isInline: true, styles: [".notification-button{position:relative;display:inline-block;width:155px;height:58px;padding:14px 29px 14px 36px;border-radius:6px;border:none;font-size:16px;font-weight:700;text-align:center;transition:opacity .3s}.badge{position:absolute;width:52px;height:32px;top:-15px;right:-20px;background-color:#dc3545;color:#fff;border-radius:16px;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:14px;font-family:Inter,sans-serif}.notification-button.hovered{opacity:.8}.notification-button.clicked{opacity:.6}\n"], dependencies: [{ kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
545
326
  }
546
327
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BadgeComponent, decorators: [{
547
328
  type: Component,
@@ -741,7 +522,7 @@ class ButtonComponent {
741
522
  {{ label }}
742
523
  </button>
743
524
  </ng-container>
744
- `, isInline: true, styles: [".btn{padding:.5rem 1rem;border-radius:.25rem;transition:background-color .3s,border-color .3s,filter .3s;font-family:Inter,sans-serif;font-size:16px;font-weight:600;line-height:24px;letter-spacing:.005em;text-align:left}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
525
+ `, isInline: true, styles: [".btn{padding:.5rem 1rem;border-radius:.25rem;transition:background-color .3s,border-color .3s,filter .3s;font-family:Inter,sans-serif;font-size:16px;font-weight:600;line-height:24px;letter-spacing:.005em;text-align:left}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
745
526
  }
746
527
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ButtonComponent, decorators: [{
747
528
  type: Component,
@@ -815,42 +596,364 @@ class BasicRegistrationComponent {
815
596
  if (!permissions || permissions.length === 0) {
816
597
  return true;
817
598
  }
818
- try {
819
- return this.authService.hasPermission(permissions);
599
+ try {
600
+ return this.authService.hasPermission(permissions);
601
+ }
602
+ catch (error) {
603
+ if (error instanceof Error) {
604
+ console.error('Permission error:', error.message);
605
+ }
606
+ else {
607
+ console.error('Unknown error occurred during permission check');
608
+ }
609
+ return true;
610
+ }
611
+ }
612
+ handleCancel(event) {
613
+ this.cancelClick.emit(event);
614
+ }
615
+ handleSave(event) {
616
+ this.saveClick.emit(event);
617
+ }
618
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BasicRegistrationComponent, deps: [{ token: AuthService }], target: i0.ɵɵFactoryTarget.Component }); }
619
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: BasicRegistrationComponent, selector: "argenta-basic-registration", inputs: { cancelLabel: "cancelLabel", saveLabel: "saveLabel", cancelPermissions: "cancelPermissions", savePermissions: "savePermissions" }, outputs: { cancelClick: "cancelClick", saveClick: "saveClick" }, ngImport: i0, template: "<div class=\"row row-car\">\n <div class=\"card\">\n <div class=\"card-content\" style=\"margin-top: 2.5rem;\">\n <ng-content></ng-content> <!-- Permite a inclus\u00E3o de conte\u00FAdo din\u00E2mico -->\n </div>\n <div class=\"card-footer\">\n <div class=\"button-group\">\n <argenta-custom-button\n *ngIf=\"hasPermission(cancelPermissions)\"\n [type]=\"'button'\"\n [label]=\"cancelLabel\"\n [btnClass]=\"ButtonClasses.Light\"\n (onButtonClick)=\"handleCancel($event)\"\n class=\"argenta-custom-button\">\n </argenta-custom-button>\n <argenta-custom-button\n *ngIf=\"hasPermission(savePermissions)\"\n [type]=\"'submit'\"\n [label]=\"saveLabel\"\n [btnClass]=\"ButtonClasses.Primary\"\n (onButtonClick)=\"handleSave($event)\"\n class=\"argenta-custom-button\">\n </argenta-custom-button>\n </div>\n </div>\n </div> \n</div>\n", styles: ["@charset \"UTF-8\";.card{border-radius:10px;padding:1rem;background-color:#fff;border:none}.card-footer{display:flex;justify-content:flex-end;margin-top:1rem;padding-top:1rem;border-radius:.25rem}.button-group{display:flex;gap:1rem;height:3rem}.argenta-custom-button{height:100%}.row-car{margin-left:-.8rem;margin-right:-.8rem}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ButtonComponent, selector: "argenta-custom-button", inputs: ["type", "label", "btnClass", "fontSize", "disabled", "autofocus", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "permissions"], outputs: ["onButtonClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
620
+ }
621
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BasicRegistrationComponent, decorators: [{
622
+ type: Component,
623
+ args: [{ selector: 'argenta-basic-registration', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"row row-car\">\n <div class=\"card\">\n <div class=\"card-content\" style=\"margin-top: 2.5rem;\">\n <ng-content></ng-content> <!-- Permite a inclus\u00E3o de conte\u00FAdo din\u00E2mico -->\n </div>\n <div class=\"card-footer\">\n <div class=\"button-group\">\n <argenta-custom-button\n *ngIf=\"hasPermission(cancelPermissions)\"\n [type]=\"'button'\"\n [label]=\"cancelLabel\"\n [btnClass]=\"ButtonClasses.Light\"\n (onButtonClick)=\"handleCancel($event)\"\n class=\"argenta-custom-button\">\n </argenta-custom-button>\n <argenta-custom-button\n *ngIf=\"hasPermission(savePermissions)\"\n [type]=\"'submit'\"\n [label]=\"saveLabel\"\n [btnClass]=\"ButtonClasses.Primary\"\n (onButtonClick)=\"handleSave($event)\"\n class=\"argenta-custom-button\">\n </argenta-custom-button>\n </div>\n </div>\n </div> \n</div>\n", styles: ["@charset \"UTF-8\";.card{border-radius:10px;padding:1rem;background-color:#fff;border:none}.card-footer{display:flex;justify-content:flex-end;margin-top:1rem;padding-top:1rem;border-radius:.25rem}.button-group{display:flex;gap:1rem;height:3rem}.argenta-custom-button{height:100%}.row-car{margin-left:-.8rem;margin-right:-.8rem}\n"] }]
624
+ }], ctorParameters: function () { return [{ type: AuthService }]; }, propDecorators: { cancelLabel: [{
625
+ type: Input
626
+ }], saveLabel: [{
627
+ type: Input
628
+ }], cancelPermissions: [{
629
+ type: Input
630
+ }], savePermissions: [{
631
+ type: Input
632
+ }], cancelClick: [{
633
+ type: Output
634
+ }], saveClick: [{
635
+ type: Output
636
+ }] } });
637
+
638
+ class CalendarArgentaComponent {
639
+ constructor() {
640
+ this.id = 'argenta-calendar';
641
+ this.placeholder = 'Select a date';
642
+ this.label = 'Select a date';
643
+ this.minDate = null;
644
+ this.maxDate = null;
645
+ this.locale = 'pt'; // Suporte para diferentes idiomas
646
+ this.useTime = false; // Propriedade para definir se inclui hora
647
+ this.initialDate = null; // Propriedade para receber a data inicial
648
+ this.dateChange = new EventEmitter();
649
+ this.currentYear = new Date().getFullYear();
650
+ this.currentMonth = new Date().getMonth();
651
+ this.selectedDate = null;
652
+ this.isCalendarVisible = false;
653
+ this.inputDate = '';
654
+ this.invalidDate = false;
655
+ this.locales = {
656
+ en: {
657
+ months: [
658
+ 'January', 'February', 'March', 'April', 'May', 'June', 'July',
659
+ 'August', 'September', 'October', 'November', 'December'
660
+ ],
661
+ daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
662
+ invalidDateMessage: 'Invalid date. Please enter a date in the format dd/MM/yyyy'
663
+ },
664
+ pt: {
665
+ months: [
666
+ 'Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho',
667
+ 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'
668
+ ],
669
+ daysOfWeek: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'],
670
+ invalidDateMessage: 'Data inválida. Por favor, insira uma data no formato dd/MM/yyyy'
671
+ },
672
+ es: {
673
+ months: [
674
+ 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio',
675
+ 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'
676
+ ],
677
+ daysOfWeek: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sá'],
678
+ invalidDateMessage: 'Fecha inválida. Por favor, ingrese una fecha en el formato dd/MM/yyyy'
679
+ }
680
+ };
681
+ }
682
+ ngOnInit() {
683
+ if (this.initialDate) {
684
+ // Se a initialDate for fornecida, usamos ela
685
+ this.updateCalendar(this.initialDate);
686
+ }
687
+ else {
688
+ // Caso contrário, usamos a data atual
689
+ const today = new Date();
690
+ this.selectedDate = today;
691
+ this.inputDate = this.formatDateForDisplay(today);
692
+ this.dateChange.emit(this.inputDate); // Emite a data inicial
693
+ }
694
+ }
695
+ ngOnChanges(changes) {
696
+ if (changes['initialDate'] && changes['initialDate'].currentValue) {
697
+ this.updateCalendar(changes['initialDate'].currentValue);
698
+ }
699
+ }
700
+ // Método para atualizar o calendário com a data passada
701
+ updateCalendar(dateString) {
702
+ const parsedDate = this.parseDate(dateString);
703
+ // Verifica se a data é válida
704
+ if (parsedDate !== null && this.validateDate(dateString)) {
705
+ this.selectedDate = parsedDate;
706
+ this.currentYear = parsedDate.getFullYear();
707
+ this.currentMonth = parsedDate.getMonth();
708
+ this.inputDate = this.formatDateForDisplay(parsedDate);
709
+ this.dateChange.emit(this.inputDate); // Emite a nova data
710
+ this.invalidDate = false; // Remove o status de data inválida
711
+ }
712
+ else {
713
+ this.invalidDate = true; // Marca a data como inválida
714
+ this.dateChange.emit('Data ou hora inválida'); // Emite mensagem de erro
715
+ console.log('Data ou hora inválida passada para o componente');
716
+ }
717
+ }
718
+ onInputChange(event) {
719
+ const inputValue = event.target.value;
720
+ this.inputDate = this.applyDateMask(inputValue);
721
+ // Validação para obrigar a hora quando useTime for verdadeiro
722
+ if (this.useTime) {
723
+ // Se a entrada não tiver o comprimento correto para data + hora
724
+ if (this.inputDate.length < 16) {
725
+ this.invalidDate = true;
726
+ this.dateChange.emit('Data ou hora inválida');
727
+ return;
728
+ }
729
+ }
730
+ // Somente validar a hora se o campo useTime estiver ativo e o formato estiver correto
731
+ if (this.useTime && this.inputDate.length >= 14) {
732
+ const [datePart, timePart] = this.inputDate.split(' ');
733
+ if (timePart) {
734
+ const [hourStr, minuteStr] = timePart.split(':');
735
+ const hour = Number(hourStr);
736
+ const minute = Number(minuteStr);
737
+ // Corrige somente se a hora/minuto forem inválidos
738
+ if (hour < 0 || hour > 23 || isNaN(hour)) {
739
+ this.invalidDate = true;
740
+ this.dateChange.emit('Hora inválida');
741
+ return;
742
+ }
743
+ else if (minute < 0 || minute > 59 || isNaN(minute)) {
744
+ this.invalidDate = true;
745
+ this.dateChange.emit('Hora inválida');
746
+ return;
747
+ }
748
+ else {
749
+ this.invalidDate = false;
750
+ }
751
+ }
752
+ }
753
+ // Emitir a data quando for válida
754
+ if ((this.useTime && this.inputDate.length === 16) || (!this.useTime && this.inputDate.length === 10)) {
755
+ if (this.validateDate(this.inputDate)) {
756
+ this.invalidDate = false;
757
+ const parsedDate = this.parseDate(this.inputDate);
758
+ // Verificar se parsedDate não é nulo antes de acessar suas propriedades
759
+ if (parsedDate !== null) {
760
+ this.currentYear = parsedDate.getFullYear();
761
+ this.currentMonth = parsedDate.getMonth();
762
+ this.selectedDate = parsedDate;
763
+ // Formatar a data para dd/MM/yyyy - HH:mm
764
+ const formattedDate = this.formatDateForEmit(parsedDate);
765
+ this.dateChange.emit(formattedDate); // Emite a data válida com o hífen
766
+ }
767
+ else {
768
+ console.log('Data inválida passada para o componente.');
769
+ this.dateChange.emit('Data inválida');
770
+ }
771
+ }
772
+ else {
773
+ this.invalidDate = true;
774
+ this.dateChange.emit('Data inválida'); // Emite o evento com mensagem de erro
775
+ }
776
+ }
777
+ }
778
+ // Formatar a data e hora com hífen
779
+ formatDateForEmit(date) {
780
+ const day = date.getDate().toString().padStart(2, '0');
781
+ const month = (date.getMonth() + 1).toString().padStart(2, '0');
782
+ const year = date.getFullYear();
783
+ let formattedDate = `${day}/${month}/${year}`;
784
+ if (this.useTime) {
785
+ const hours = date.getHours().toString().padStart(2, '0');
786
+ const minutes = date.getMinutes().toString().padStart(2, '0');
787
+ // Adiciona o hífen entre a data e a hora
788
+ formattedDate += ` - ${hours}:${minutes}`;
789
+ }
790
+ return formattedDate;
791
+ }
792
+ applyDateMask(inputValue) {
793
+ let digitsOnly = inputValue.replace(/\D/g, '');
794
+ // Limita os dígitos com base no uso de hora
795
+ const maxLength = this.useTime ? 12 : 8;
796
+ if (digitsOnly.length > maxLength) {
797
+ digitsOnly = digitsOnly.substring(0, maxLength);
798
+ }
799
+ let day = digitsOnly.substring(0, 2);
800
+ let month = digitsOnly.substring(2, 4);
801
+ let year = digitsOnly.substring(4, 8);
802
+ let hour = digitsOnly.substring(8, 10);
803
+ let minute = digitsOnly.substring(10, 12);
804
+ let maskedDate = `${day}/${month}/${year}`;
805
+ if (this.useTime && hour && minute) {
806
+ maskedDate += ` ${hour}:${minute}`;
807
+ }
808
+ return maskedDate;
809
+ }
810
+ validateDate(inputValue) {
811
+ const [datePart, timePart] = inputValue.split(' ');
812
+ const [dayStr, monthStr, yearStr] = datePart.split('/');
813
+ const day = Number(dayStr);
814
+ const month = Number(monthStr);
815
+ const year = Number(yearStr);
816
+ // Validação de data
817
+ if (month < 1 || month > 12 || yearStr.length !== 4 || isNaN(year)) {
818
+ return false;
819
+ }
820
+ const lastDayOfMonth = new Date(year, month, 0).getDate();
821
+ if (day < 1 || day > lastDayOfMonth) {
822
+ return false;
823
+ }
824
+ // Validação de hora
825
+ if (this.useTime && timePart) {
826
+ const [hourStr, minuteStr] = timePart.split(':');
827
+ const hour = Number(hourStr);
828
+ const minute = Number(minuteStr);
829
+ if (hour < 0 || hour > 23 || minute < 0 || minute > 59 || isNaN(hour) || isNaN(minute)) {
830
+ return false; // Hora ou minuto inválidos
831
+ }
832
+ }
833
+ return true;
834
+ }
835
+ parseDate(dateStr) {
836
+ const [datePart, timePart] = dateStr.split(' ');
837
+ const [day, month, year] = datePart.split('/').map(Number);
838
+ if (!day || !month || !year) {
839
+ return null;
840
+ }
841
+ const date = new Date(year, month - 1, day);
842
+ if (this.useTime && timePart) {
843
+ const [hour, minute] = timePart.split(':').map(Number);
844
+ date.setHours(hour || 0, minute || 0);
845
+ }
846
+ return date;
847
+ }
848
+ formatDateForDisplay(date) {
849
+ const day = date.getDate().toString().padStart(2, '0');
850
+ const month = (date.getMonth() + 1).toString().padStart(2, '0');
851
+ const year = date.getFullYear();
852
+ let formattedDate = `${day}/${month}/${year}`;
853
+ if (this.useTime) {
854
+ const hours = date.getHours().toString().padStart(2, '0');
855
+ const minutes = date.getMinutes().toString().padStart(2, '0');
856
+ formattedDate += ` ${hours}:${minutes}`;
857
+ }
858
+ return formattedDate;
859
+ }
860
+ toggleCalendar() {
861
+ this.isCalendarVisible = !this.isCalendarVisible;
862
+ }
863
+ selectDate(day) {
864
+ const date = new Date(this.currentYear, this.currentMonth, day);
865
+ this.inputDate = this.formatDateForDisplay(date);
866
+ this.selectedDate = date; // Armazena a data selecionada
867
+ this.dateChange.emit(this.inputDate); // Emite a data selecionada ao clicar no calendário
868
+ this.isCalendarVisible = false; // Fecha o calendário após a seleção
869
+ }
870
+ handleKeyPress(event) {
871
+ const charCode = event.key.charCodeAt(0);
872
+ if (charCode < 48 || charCode > 57) {
873
+ event.preventDefault();
874
+ }
875
+ if (this.inputDate.replace(/\D/g, '').length >= (this.useTime ? 12 : 8)) {
876
+ event.preventDefault();
877
+ }
878
+ }
879
+ get daysInMonth() {
880
+ const firstDayOfMonth = new Date(this.currentYear, this.currentMonth, 1).getDay(); // Dia da semana do primeiro dia do mês
881
+ const totalDaysInMonth = new Date(this.currentYear, this.currentMonth + 1, 0).getDate(); // Total de dias no mês
882
+ const daysArray = Array.from({ length: totalDaysInMonth }, (_, i) => i + 1); // Array com todos os dias do mês
883
+ const leadingEmptyDays = Array(firstDayOfMonth).fill(null); // Dias vazios antes do primeiro dia do mês
884
+ return [...leadingEmptyDays, ...daysArray]; // Retorna os dias vazios seguidos pelos dias do mês
885
+ }
886
+ get months() {
887
+ return this.locales[this.locale]?.months || this.locales['en'].months;
888
+ }
889
+ get daysOfWeek() {
890
+ return this.locales[this.locale]?.daysOfWeek || this.locales['en'].daysOfWeek;
891
+ }
892
+ prevMonth() {
893
+ if (this.currentMonth === 0) {
894
+ this.currentMonth = 11;
895
+ this.currentYear--;
820
896
  }
821
- catch (error) {
822
- if (error instanceof Error) {
823
- console.error('Permission error:', error.message);
824
- }
825
- else {
826
- console.error('Unknown error occurred during permission check');
827
- }
828
- return true;
897
+ else {
898
+ this.currentMonth--;
829
899
  }
830
900
  }
831
- handleCancel(event) {
832
- this.cancelClick.emit(event);
901
+ nextMonth() {
902
+ if (this.currentMonth === 11) {
903
+ this.currentMonth = 0;
904
+ this.currentYear++;
905
+ }
906
+ else {
907
+ this.currentMonth++;
908
+ }
833
909
  }
834
- handleSave(event) {
835
- this.saveClick.emit(event);
910
+ isSelected(day) {
911
+ if (!this.selectedDate)
912
+ return false;
913
+ const selectedDay = this.selectedDate.getDate();
914
+ const selectedMonth = this.selectedDate.getMonth();
915
+ const selectedYear = this.selectedDate.getFullYear();
916
+ return (selectedDay === day &&
917
+ selectedMonth === this.currentMonth &&
918
+ selectedYear === this.currentYear);
919
+ }
920
+ isToday(day) {
921
+ const today = new Date();
922
+ return (today.getFullYear() === this.currentYear &&
923
+ today.getMonth() === this.currentMonth &&
924
+ today.getDate() === day);
925
+ }
926
+ isDateDisabled(day) {
927
+ const date = new Date(this.currentYear, this.currentMonth, day);
928
+ if (this.minDate && date < this.minDate)
929
+ return true;
930
+ if (this.maxDate && date > this.maxDate)
931
+ return true;
932
+ return false;
836
933
  }
837
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BasicRegistrationComponent, deps: [{ token: AuthService }], target: i0.ɵɵFactoryTarget.Component }); }
838
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: BasicRegistrationComponent, selector: "argenta-basic-registration", inputs: { cancelLabel: "cancelLabel", saveLabel: "saveLabel", cancelPermissions: "cancelPermissions", savePermissions: "savePermissions" }, outputs: { cancelClick: "cancelClick", saveClick: "saveClick" }, ngImport: i0, template: "<div class=\"row row-car\">\n <div class=\"card\">\n <div class=\"card-content\" style=\"margin-top: 2.5rem;\">\n <ng-content></ng-content> <!-- Permite a inclus\u00E3o de conte\u00FAdo din\u00E2mico -->\n </div>\n <div class=\"card-footer\">\n <div class=\"button-group\">\n <argenta-custom-button\n *ngIf=\"hasPermission(cancelPermissions)\"\n [type]=\"'button'\"\n [label]=\"cancelLabel\"\n [btnClass]=\"ButtonClasses.Light\"\n (onButtonClick)=\"handleCancel($event)\"\n class=\"argenta-custom-button\">\n </argenta-custom-button>\n <argenta-custom-button\n *ngIf=\"hasPermission(savePermissions)\"\n [type]=\"'submit'\"\n [label]=\"saveLabel\"\n [btnClass]=\"ButtonClasses.Primary\"\n (onButtonClick)=\"handleSave($event)\"\n class=\"argenta-custom-button\">\n </argenta-custom-button>\n </div>\n </div>\n </div> \n</div>\n", styles: ["@charset \"UTF-8\";.card{border-radius:10px;padding:1rem;background-color:#fff;border:none}.card-footer{display:flex;justify-content:flex-end;margin-top:1rem;padding-top:1rem;border-radius:.25rem}.button-group{display:flex;gap:1rem;height:3rem}.argenta-custom-button{height:100%}.row-car{margin-left:-.8rem;margin-right:-.8rem}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ButtonComponent, selector: "argenta-custom-button", inputs: ["type", "label", "btnClass", "fontSize", "disabled", "autofocus", "form", "formaction", "formenctype", "formmethod", "formnovalidate", "formtarget", "name", "value", "permissions"], outputs: ["onButtonClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
934
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CalendarArgentaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
935
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CalendarArgentaComponent, selector: "argenta-calendar", inputs: { id: "id", placeholder: "placeholder", label: "label", minDate: "minDate", maxDate: "maxDate", locale: "locale", useTime: "useTime", initialDate: "initialDate" }, outputs: { dateChange: "dateChange" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"form-group\">\n <label [for]=\"id\" [ngClass]=\"'label-styles'\">{{ label }}</label>\n <div class=\"input-wrapper\">\n <input\n id=\"{{ id }}\"\n type=\"text\"\n class=\"custom-input\"\n [attr.placeholder]=\"useTime ? 'dd/MM/yyyy HH:mm' : 'dd/MM/yyyy'\"\n [value]=\"inputDate\"\n (input)=\"onInputChange($event)\"\n (keypress)=\"handleKeyPress($event)\"\n (click)=\"toggleCalendar()\"\n />\n <!-- \u00CDcone de calend\u00E1rio dentro do input -->\n <lucide-icon name=\"calendar\" class=\"calendar-icon\"></lucide-icon>\n </div>\n\n <!-- Mensagem de erro estilo bal\u00E3ozinho -->\n <div *ngIf=\"invalidDate\" class=\"error-message\">\n {{ locales[locale].invalidDateMessage }}\n <!-- Mostra a parte de 'HH:mm' apenas se useTime for verdadeiro -->\n <span *ngIf=\"useTime\"> HH:mm.</span>\n </div>\n\n <div class=\"calendar-wrapper\">\n <div class=\"calendar-container\" [ngClass]=\"{ open: isCalendarVisible }\">\n <div class=\"calendar\">\n <div class=\"calendar-header\">\n <button (click)=\"prevMonth()\">&#8249;</button>\n <span>{{ months[currentMonth] }} {{ currentYear }}</span>\n <button (click)=\"nextMonth()\">&#8250;</button>\n </div>\n\n <div class=\"calendar-body\">\n <div class=\"calendar-day-names\">\n <span *ngFor=\"let day of daysOfWeek\">{{ day }}</span>\n </div>\n\n <div class=\"calendar-days\">\n <span\n *ngFor=\"let day of daysInMonth; let i = index\"\n [class.today]=\"isToday(day)\"\n [class.selected]=\"isSelected(day)\"\n [class.disabled]=\"isDateDisabled(day)\"\n (click)=\"day ? selectDate(day) : null\"\n >\n <!-- Somente permite clique em dias v\u00E1lidos -->\n {{ day ? day : \"\" }}\n <!-- Exibe o dia se for v\u00E1lido, sen\u00E3o exibe vazio -->\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.calendar-container{overflow:hidden;max-height:0;transition:max-height .4s ease}.calendar-container.open{max-height:500px}.calendar{display:inline-block;border:1px solid #ccc;border-radius:8px;padding:10px;width:450px;font-family:Inter,Arial,sans-serif;transition:max-height .4s ease}.calendar .calendar-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;font-weight:700}.calendar .calendar-header button{background-color:#00444c;color:#fff;border:none;padding:8px 12px;cursor:pointer;border-radius:8px;font-size:1.2rem;transition:background-color .2s}.calendar .calendar-header button:hover{background-color:#2ca58d}.calendar .calendar-header span{font-size:1.4rem;color:#00444c;text-align:center;flex-grow:1}.calendar .calendar-body{display:grid;grid-template-columns:repeat(7,1fr);gap:7px}.calendar .calendar-body .calendar-day-names{display:contents}.calendar .calendar-body .calendar-day-names span{text-align:center;font-weight:700;margin-bottom:5px;font-size:.9rem}.calendar .calendar-body .calendar-day-names span:nth-child(1){color:#ff8080}.calendar .calendar-body .calendar-day-names span:nth-child(7){color:#555}.calendar .calendar-body .calendar-days{display:contents}.calendar .calendar-body .calendar-days span{display:flex;justify-content:center;align-items:center;margin:1px;padding:10px;height:45px;width:45px;cursor:pointer;border-radius:50%;transition:background-color .2s,color .2s ease}.calendar .calendar-body .calendar-days span.today{background-color:#2ca58d;color:#fff}.calendar .calendar-body .calendar-days span.selected{background-color:#00444c;color:#fff}.calendar .calendar-body .calendar-days span.disabled{background-color:#e9ecef;color:#999;cursor:not-allowed}.calendar .calendar-body .calendar-days span:hover:not(.disabled){background-color:#2ca58d;color:#fff}.custom-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem;height:46px;padding:.5rem .75rem;border:1px solid #ccc;border-radius:4px;width:100%;box-sizing:border-box}.custom-input::placeholder{font-size:14px;color:#d3d3d3}.label-styles{font-weight:400;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.5rem}.error-message{position:relative;background-color:#ff8080;color:#fff;padding:10px;border-radius:8px;font-size:.9rem;max-width:250px;margin-top:5px}.error-message:after{content:\"\";position:absolute;top:100%;left:20px;border-width:10px;border-style:solid;border-color:#ff8080 transparent transparent transparent}.input-wrapper{position:relative;display:inline-block;width:100%}.input-wrapper .custom-input{width:100%;padding-right:40px;box-sizing:border-box}.input-wrapper .calendar-icon{position:absolute;top:50%;right:10px;transform:translateY(-50%);pointer-events:none;color:#b8b8b8}\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: i1$1.LucideAngularComponent, selector: "lucide-angular, lucide-icon, i-lucide, span-lucide", inputs: ["class", "name", "img", "color", "absoluteStrokeWidth", "size", "strokeWidth"] }] }); }
839
936
  }
840
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: BasicRegistrationComponent, decorators: [{
937
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CalendarArgentaComponent, decorators: [{
841
938
  type: Component,
842
- args: [{ selector: 'argenta-basic-registration', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"row row-car\">\n <div class=\"card\">\n <div class=\"card-content\" style=\"margin-top: 2.5rem;\">\n <ng-content></ng-content> <!-- Permite a inclus\u00E3o de conte\u00FAdo din\u00E2mico -->\n </div>\n <div class=\"card-footer\">\n <div class=\"button-group\">\n <argenta-custom-button\n *ngIf=\"hasPermission(cancelPermissions)\"\n [type]=\"'button'\"\n [label]=\"cancelLabel\"\n [btnClass]=\"ButtonClasses.Light\"\n (onButtonClick)=\"handleCancel($event)\"\n class=\"argenta-custom-button\">\n </argenta-custom-button>\n <argenta-custom-button\n *ngIf=\"hasPermission(savePermissions)\"\n [type]=\"'submit'\"\n [label]=\"saveLabel\"\n [btnClass]=\"ButtonClasses.Primary\"\n (onButtonClick)=\"handleSave($event)\"\n class=\"argenta-custom-button\">\n </argenta-custom-button>\n </div>\n </div>\n </div> \n</div>\n", styles: ["@charset \"UTF-8\";.card{border-radius:10px;padding:1rem;background-color:#fff;border:none}.card-footer{display:flex;justify-content:flex-end;margin-top:1rem;padding-top:1rem;border-radius:.25rem}.button-group{display:flex;gap:1rem;height:3rem}.argenta-custom-button{height:100%}.row-car{margin-left:-.8rem;margin-right:-.8rem}\n"] }]
843
- }], ctorParameters: function () { return [{ type: AuthService }]; }, propDecorators: { cancelLabel: [{
939
+ args: [{ selector: 'argenta-calendar', template: "<div class=\"form-group\">\n <label [for]=\"id\" [ngClass]=\"'label-styles'\">{{ label }}</label>\n <div class=\"input-wrapper\">\n <input\n id=\"{{ id }}\"\n type=\"text\"\n class=\"custom-input\"\n [attr.placeholder]=\"useTime ? 'dd/MM/yyyy HH:mm' : 'dd/MM/yyyy'\"\n [value]=\"inputDate\"\n (input)=\"onInputChange($event)\"\n (keypress)=\"handleKeyPress($event)\"\n (click)=\"toggleCalendar()\"\n />\n <!-- \u00CDcone de calend\u00E1rio dentro do input -->\n <lucide-icon name=\"calendar\" class=\"calendar-icon\"></lucide-icon>\n </div>\n\n <!-- Mensagem de erro estilo bal\u00E3ozinho -->\n <div *ngIf=\"invalidDate\" class=\"error-message\">\n {{ locales[locale].invalidDateMessage }}\n <!-- Mostra a parte de 'HH:mm' apenas se useTime for verdadeiro -->\n <span *ngIf=\"useTime\"> HH:mm.</span>\n </div>\n\n <div class=\"calendar-wrapper\">\n <div class=\"calendar-container\" [ngClass]=\"{ open: isCalendarVisible }\">\n <div class=\"calendar\">\n <div class=\"calendar-header\">\n <button (click)=\"prevMonth()\">&#8249;</button>\n <span>{{ months[currentMonth] }} {{ currentYear }}</span>\n <button (click)=\"nextMonth()\">&#8250;</button>\n </div>\n\n <div class=\"calendar-body\">\n <div class=\"calendar-day-names\">\n <span *ngFor=\"let day of daysOfWeek\">{{ day }}</span>\n </div>\n\n <div class=\"calendar-days\">\n <span\n *ngFor=\"let day of daysInMonth; let i = index\"\n [class.today]=\"isToday(day)\"\n [class.selected]=\"isSelected(day)\"\n [class.disabled]=\"isDateDisabled(day)\"\n (click)=\"day ? selectDate(day) : null\"\n >\n <!-- Somente permite clique em dias v\u00E1lidos -->\n {{ day ? day : \"\" }}\n <!-- Exibe o dia se for v\u00E1lido, sen\u00E3o exibe vazio -->\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.calendar-container{overflow:hidden;max-height:0;transition:max-height .4s ease}.calendar-container.open{max-height:500px}.calendar{display:inline-block;border:1px solid #ccc;border-radius:8px;padding:10px;width:450px;font-family:Inter,Arial,sans-serif;transition:max-height .4s ease}.calendar .calendar-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;font-weight:700}.calendar .calendar-header button{background-color:#00444c;color:#fff;border:none;padding:8px 12px;cursor:pointer;border-radius:8px;font-size:1.2rem;transition:background-color .2s}.calendar .calendar-header button:hover{background-color:#2ca58d}.calendar .calendar-header span{font-size:1.4rem;color:#00444c;text-align:center;flex-grow:1}.calendar .calendar-body{display:grid;grid-template-columns:repeat(7,1fr);gap:7px}.calendar .calendar-body .calendar-day-names{display:contents}.calendar .calendar-body .calendar-day-names span{text-align:center;font-weight:700;margin-bottom:5px;font-size:.9rem}.calendar .calendar-body .calendar-day-names span:nth-child(1){color:#ff8080}.calendar .calendar-body .calendar-day-names span:nth-child(7){color:#555}.calendar .calendar-body .calendar-days{display:contents}.calendar .calendar-body .calendar-days span{display:flex;justify-content:center;align-items:center;margin:1px;padding:10px;height:45px;width:45px;cursor:pointer;border-radius:50%;transition:background-color .2s,color .2s ease}.calendar .calendar-body .calendar-days span.today{background-color:#2ca58d;color:#fff}.calendar .calendar-body .calendar-days span.selected{background-color:#00444c;color:#fff}.calendar .calendar-body .calendar-days span.disabled{background-color:#e9ecef;color:#999;cursor:not-allowed}.calendar .calendar-body .calendar-days span:hover:not(.disabled){background-color:#2ca58d;color:#fff}.custom-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem;height:46px;padding:.5rem .75rem;border:1px solid #ccc;border-radius:4px;width:100%;box-sizing:border-box}.custom-input::placeholder{font-size:14px;color:#d3d3d3}.label-styles{font-weight:400;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.5rem}.error-message{position:relative;background-color:#ff8080;color:#fff;padding:10px;border-radius:8px;font-size:.9rem;max-width:250px;margin-top:5px}.error-message:after{content:\"\";position:absolute;top:100%;left:20px;border-width:10px;border-style:solid;border-color:#ff8080 transparent transparent transparent}.input-wrapper{position:relative;display:inline-block;width:100%}.input-wrapper .custom-input{width:100%;padding-right:40px;box-sizing:border-box}.input-wrapper .calendar-icon{position:absolute;top:50%;right:10px;transform:translateY(-50%);pointer-events:none;color:#b8b8b8}\n"] }]
940
+ }], propDecorators: { id: [{
844
941
  type: Input
845
- }], saveLabel: [{
942
+ }], placeholder: [{
846
943
  type: Input
847
- }], cancelPermissions: [{
944
+ }], label: [{
848
945
  type: Input
849
- }], savePermissions: [{
946
+ }], minDate: [{
850
947
  type: Input
851
- }], cancelClick: [{
852
- type: Output
853
- }], saveClick: [{
948
+ }], maxDate: [{
949
+ type: Input
950
+ }], locale: [{
951
+ type: Input
952
+ }], useTime: [{
953
+ type: Input
954
+ }], initialDate: [{
955
+ type: Input
956
+ }], dateChange: [{
854
957
  type: Output
855
958
  }] } });
856
959
 
@@ -947,7 +1050,7 @@ class CheckboxComponent {
947
1050
  />
948
1051
  <label class="form-check-label" [for]="id">{{ label }}</label>
949
1052
  </div>
950
- `, isInline: true, styles: [".form-check-input{font-family:Arial,sans-serif;color:#333;font-size:1rem}.form-check-label{font-family:Arial,sans-serif;color:#333;font-size:1rem;font-weight:700}\n"], dependencies: [{ kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1053
+ `, isInline: true, styles: [".form-check-input{font-family:Arial,sans-serif;color:#333;font-size:1rem}.form-check-label{font-family:Arial,sans-serif;color:#333;font-size:1rem;font-weight:700}\n"], dependencies: [{ kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
951
1054
  }
952
1055
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CheckboxComponent, decorators: [{
953
1056
  type: Component,
@@ -1079,13 +1182,13 @@ class ConfirmationComponent {
1079
1182
  ngOnDestroy() {
1080
1183
  // Clear any subscriptions if there were any
1081
1184
  }
1082
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ConfirmationComponent, deps: [{ token: i1.NgbActiveModal }], target: i0.ɵɵFactoryTarget.Component }); }
1185
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ConfirmationComponent, deps: [{ token: i1$2.NgbActiveModal }], target: i0.ɵɵFactoryTarget.Component }); }
1083
1186
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ConfirmationComponent, selector: "app-confirmation", inputs: { title: "title", message: "message", confirmButtonText: "confirmButtonText", cancelButtonText: "cancelButtonText" }, ngImport: i0, template: "<div class=\"modal-header\">\n <h5 class=\"modal-title\" id=\"confirmationModalLabel\">{{ title }}</h5>\n</div>\n<div class=\"modal-body\">\n <p>{{ message }}</p>\n</div>\n<div class=\"modal-footer d-flex justify-content-end\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"cancel()\">{{ cancelButtonText }}</button>\n <button type=\"button\" class=\"btn btn-primary ms-2\" (click)=\"confirm()\" appAutofocus>{{ confirmButtonText }}</button>\n</div>\n", styles: ["@charset \"UTF-8\";.modal-header{border-bottom:none}.modal-footer{border-top:none;padding-top:0;padding-bottom:15px;display:flex;justify-content:flex-end}.modal-title{font-family:Inter,sans-serif;color:#151920;font-size:19px}.modal-body{text-align:left}.modal-body p{color:#15192080;font-family:Inter,sans-serif;font-size:14px}.btn-primary{font-family:Inter,sans-serif;background-color:#00444c;border:1px solid #00444C;border-radius:8px;width:130px;height:42px;color:#fff;transition:opacity .3s,transform .1s}.btn-primary:hover{opacity:.8}.btn-primary:active{transform:scale(.98);background-color:#00444c;border:1px solid #00444C}.btn-secondary{font-family:Inter,sans-serif;background-color:transparent;border-radius:8px;width:96px;height:42px;border:1px solid rgba(21,25,32,.5019607843);color:#15192080;transition:opacity .3s,transform .1s;margin-right:8px}.btn-secondary:hover{opacity:.8}.btn-secondary:active{transform:scale(.98)}.ms-2{margin-left:8px}\n"], dependencies: [{ kind: "directive", type: AutofocusDirective, selector: "[appAutofocus]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1084
1187
  }
1085
1188
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ConfirmationComponent, decorators: [{
1086
1189
  type: Component,
1087
1190
  args: [{ selector: 'app-confirmation', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"modal-header\">\n <h5 class=\"modal-title\" id=\"confirmationModalLabel\">{{ title }}</h5>\n</div>\n<div class=\"modal-body\">\n <p>{{ message }}</p>\n</div>\n<div class=\"modal-footer d-flex justify-content-end\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"cancel()\">{{ cancelButtonText }}</button>\n <button type=\"button\" class=\"btn btn-primary ms-2\" (click)=\"confirm()\" appAutofocus>{{ confirmButtonText }}</button>\n</div>\n", styles: ["@charset \"UTF-8\";.modal-header{border-bottom:none}.modal-footer{border-top:none;padding-top:0;padding-bottom:15px;display:flex;justify-content:flex-end}.modal-title{font-family:Inter,sans-serif;color:#151920;font-size:19px}.modal-body{text-align:left}.modal-body p{color:#15192080;font-family:Inter,sans-serif;font-size:14px}.btn-primary{font-family:Inter,sans-serif;background-color:#00444c;border:1px solid #00444C;border-radius:8px;width:130px;height:42px;color:#fff;transition:opacity .3s,transform .1s}.btn-primary:hover{opacity:.8}.btn-primary:active{transform:scale(.98);background-color:#00444c;border:1px solid #00444C}.btn-secondary{font-family:Inter,sans-serif;background-color:transparent;border-radius:8px;width:96px;height:42px;border:1px solid rgba(21,25,32,.5019607843);color:#15192080;transition:opacity .3s,transform .1s;margin-right:8px}.btn-secondary:hover{opacity:.8}.btn-secondary:active{transform:scale(.98)}.ms-2{margin-left:8px}\n"] }]
1088
- }], ctorParameters: function () { return [{ type: i1.NgbActiveModal }]; }, propDecorators: { title: [{
1191
+ }], ctorParameters: function () { return [{ type: i1$2.NgbActiveModal }]; }, propDecorators: { title: [{
1089
1192
  type: Input
1090
1193
  }], message: [{
1091
1194
  type: Input
@@ -1133,7 +1236,7 @@ class CustomPaginationComponent {
1133
1236
  this.destroy$.complete();
1134
1237
  }
1135
1238
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CustomPaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1136
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CustomPaginationComponent, selector: "custom-pagination", inputs: { totalItems: "totalItems", itemsPerPage: "itemsPerPage", currentPage: "currentPage", showPageInfo: "showPageInfo" }, outputs: { pageChange: "pageChange" }, ngImport: i0, template: "<nav *ngIf=\"totalPages > 0\">\n <ul class=\"pagination\">\n <li class=\"page-item\" [class.disabled]=\"currentPage === 1\">\n <a class=\"page-link\" (click)=\"changePage(1)\">&laquo;&laquo;</a>\n </li>\n <li class=\"page-item\" [class.disabled]=\"currentPage === 1\">\n <a class=\"page-link\" (click)=\"changePage(currentPage - 1)\">&laquo;</a>\n </li>\n <li class=\"page-item\" *ngFor=\"let page of pages\" [class.active]=\"page === currentPage\">\n <a class=\"page-link\" (click)=\"changePage(page)\">{{ page }}</a>\n </li>\n <li class=\"page-item\" [class.disabled]=\"currentPage === totalPages\">\n <a class=\"page-link\" (click)=\"changePage(currentPage + 1)\">&raquo;</a>\n </li>\n <li class=\"page-item\" [class.disabled]=\"currentPage === totalPages\">\n <a class=\"page-link\" (click)=\"changePage(totalPages)\">&raquo;&raquo;</a>\n </li>\n </ul>\n</nav>\n", styles: ["@charset \"UTF-8\";.pagination{display:flex;list-style:none;padding:0;margin:1rem 0;justify-content:center;align-items:center}.page-item{margin:0 .25rem}.page-item.disabled .page-link{cursor:not-allowed;opacity:.5}.page-item.active .page-link{background-color:#00444c;color:#fff}.page-item .page-link{padding:.5rem .75rem;border:1px solid #dee2e6;border-radius:.25rem;text-decoration:none;color:#00444c;cursor:pointer;transition:background-color .2s}.page-item .page-link:hover{background-color:#e5e5e5}.page-info{margin-left:1rem;font-size:1rem;color:#00444c;font-weight:700}\n"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
1239
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CustomPaginationComponent, selector: "custom-pagination", inputs: { totalItems: "totalItems", itemsPerPage: "itemsPerPage", currentPage: "currentPage", showPageInfo: "showPageInfo" }, outputs: { pageChange: "pageChange" }, ngImport: i0, template: "<nav *ngIf=\"totalPages > 0\">\n <ul class=\"pagination\">\n <li class=\"page-item\" [class.disabled]=\"currentPage === 1\">\n <a class=\"page-link\" (click)=\"changePage(1)\">&laquo;&laquo;</a>\n </li>\n <li class=\"page-item\" [class.disabled]=\"currentPage === 1\">\n <a class=\"page-link\" (click)=\"changePage(currentPage - 1)\">&laquo;</a>\n </li>\n <li class=\"page-item\" *ngFor=\"let page of pages\" [class.active]=\"page === currentPage\">\n <a class=\"page-link\" (click)=\"changePage(page)\">{{ page }}</a>\n </li>\n <li class=\"page-item\" [class.disabled]=\"currentPage === totalPages\">\n <a class=\"page-link\" (click)=\"changePage(currentPage + 1)\">&raquo;</a>\n </li>\n <li class=\"page-item\" [class.disabled]=\"currentPage === totalPages\">\n <a class=\"page-link\" (click)=\"changePage(totalPages)\">&raquo;&raquo;</a>\n </li>\n </ul>\n</nav>\n", styles: ["@charset \"UTF-8\";.pagination{display:flex;list-style:none;padding:0;margin:1rem 0;justify-content:center;align-items:center}.page-item{margin:0 .25rem}.page-item.disabled .page-link{cursor:not-allowed;opacity:.5}.page-item.active .page-link{background-color:#00444c;color:#fff}.page-item .page-link{padding:.5rem .75rem;border:1px solid #dee2e6;border-radius:.25rem;text-decoration:none;color:#00444c;cursor:pointer;transition:background-color .2s}.page-item .page-link:hover{background-color:#e5e5e5}.page-info{margin-left:1rem;font-size:1rem;color:#00444c;font-weight:700}\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"] }] }); }
1137
1240
  }
1138
1241
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CustomPaginationComponent, decorators: [{
1139
1242
  type: Component,
@@ -1180,7 +1283,7 @@ class CustomSwitchComponent {
1180
1283
  }
1181
1284
  }
1182
1285
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CustomSwitchComponent, deps: [{ token: AuthService }], target: i0.ɵɵFactoryTarget.Component }); }
1183
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CustomSwitchComponent, selector: "argenta-custom-switch", inputs: { checked: "checked", label: "label", permissions: "permissions" }, outputs: { switchChange: "switchChange" }, ngImport: i0, template: "<ng-container *ngIf=\"hasPermission()\">\n <div class=\"form-check form-switch\">\n <input \n class=\"form-check-input\" \n type=\"checkbox\" \n [checked]=\"checked\" \n (change)=\"toggleSwitch()\" \n id=\"flexSwitchCheckDefault\" \n />\n <label class=\"form-check-label\" for=\"flexSwitchCheckDefault\">\n {{ label }}\n </label>\n </div>\n</ng-container>\n", styles: ["@charset \"UTF-8\";.form-check{display:flex;align-items:center}.form-check-input{width:60px;height:34px;margin-right:10px;cursor:pointer;position:relative;appearance:none;background-color:#e5e5e5;border:2px solid #00444C;border-radius:34px;outline:none;transition:background-color .3s,border-color .3s}.form-check-input:focus{outline:none;box-shadow:none}.form-check-input:checked{background-color:#00444c;border-color:#00444c}.form-check-input:before{content:\"\";position:absolute;width:26px;height:26px;background-color:#00444c;border-radius:50%;top:3px;left:3px;transition:transform .3s,background-color .3s}.form-check-input:checked:before{transform:translate(26px);background-color:#fff}.form-check-label{color:#00444c;font-family:Inter,sans-serif;font-size:16px;font-weight:600;height:24px;line-height:24px}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1286
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CustomSwitchComponent, selector: "argenta-custom-switch", inputs: { checked: "checked", label: "label", permissions: "permissions" }, outputs: { switchChange: "switchChange" }, ngImport: i0, template: "<ng-container *ngIf=\"hasPermission()\">\n <div class=\"form-check form-switch\">\n <input \n class=\"form-check-input\" \n type=\"checkbox\" \n [checked]=\"checked\" \n (change)=\"toggleSwitch()\" \n id=\"flexSwitchCheckDefault\" \n />\n <label class=\"form-check-label\" for=\"flexSwitchCheckDefault\">\n {{ label }}\n </label>\n </div>\n</ng-container>\n", styles: ["@charset \"UTF-8\";.form-check{display:flex;align-items:center}.form-check-input{width:60px;height:34px;margin-right:10px;cursor:pointer;position:relative;appearance:none;background-color:#e5e5e5;border:2px solid #00444C;border-radius:34px;outline:none;transition:background-color .3s,border-color .3s}.form-check-input:focus{outline:none;box-shadow:none}.form-check-input:checked{background-color:#00444c;border-color:#00444c}.form-check-input:before{content:\"\";position:absolute;width:26px;height:26px;background-color:#00444c;border-radius:50%;top:3px;left:3px;transition:transform .3s,background-color .3s}.form-check-input:checked:before{transform:translate(26px);background-color:#fff}.form-check-label{color:#00444c;font-family:Inter,sans-serif;font-size:16px;font-weight:600;height:24px;line-height:24px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1184
1287
  }
1185
1288
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CustomSwitchComponent, decorators: [{
1186
1289
  type: Component,
@@ -1242,7 +1345,7 @@ class FileUploadComponent {
1242
1345
  this.destroy$.complete();
1243
1346
  }
1244
1347
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileUploadComponent, deps: [{ token: AuthService }], target: i0.ɵɵFactoryTarget.Component }); }
1245
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FileUploadComponent, selector: "argenta-file-upload", inputs: { accept: "accept", multiple: "multiple", maxFileSize: "maxFileSize", labelText: "labelText", permissions: "permissions" }, outputs: { fileUploaded: "fileUploaded" }, ngImport: i0, template: "<div *ngIf=\"hasPermission()\" class=\"file-upload-container\">\n <label for=\"fileUpload\" class=\"form-label\">{{ labelText }}</label> \n <input\n type=\"file\"\n id=\"fileUpload\"\n class=\"form-control\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"onFileChange($event)\" \n />\n</div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.file-upload-container{margin-top:10px;font-family:Inter,Arial,sans-serif}.file-upload-container .form-label{font-weight:400;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.5rem;color:#333}.file-upload-container .form-control[type=file]{padding:10px;border-radius:5px;border:1px solid #ced4da;font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem}.file-upload-container .form-control[type=file]::file-selector-button{padding:.5rem 1rem;margin-right:10px;border:1px solid #ced4da;border-radius:5px;background-color:#f8f9fa;color:#000;cursor:pointer;transition:background-color .2s}.file-upload-container .form-control[type=file]::file-selector-button:hover{background-color:#e2e6ea}.file-upload-container .form-text{color:#6c757d;font-size:.875rem}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1348
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FileUploadComponent, selector: "argenta-file-upload", inputs: { accept: "accept", multiple: "multiple", maxFileSize: "maxFileSize", labelText: "labelText", permissions: "permissions" }, outputs: { fileUploaded: "fileUploaded" }, ngImport: i0, template: "<div *ngIf=\"hasPermission()\" class=\"file-upload-container\">\n <label for=\"fileUpload\" class=\"form-label\">{{ labelText }}</label> \n <input\n type=\"file\"\n id=\"fileUpload\"\n class=\"form-control\"\n [accept]=\"accept\"\n [multiple]=\"multiple\"\n (change)=\"onFileChange($event)\" \n />\n</div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.file-upload-container{margin-top:10px;font-family:Inter,Arial,sans-serif}.file-upload-container .form-label{font-weight:400;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.5rem;color:#333}.file-upload-container .form-control[type=file]{padding:10px;border-radius:5px;border:1px solid #ced4da;font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem}.file-upload-container .form-control[type=file]::file-selector-button{padding:.5rem 1rem;margin-right:10px;border:1px solid #ced4da;border-radius:5px;background-color:#f8f9fa;color:#000;cursor:pointer;transition:background-color .2s}.file-upload-container .form-control[type=file]::file-selector-button:hover{background-color:#e2e6ea}.file-upload-container .form-text{color:#6c757d;font-size:.875rem}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1246
1349
  }
1247
1350
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FileUploadComponent, decorators: [{
1248
1351
  type: Component,
@@ -1544,55 +1647,327 @@ class InputComponent {
1544
1647
  remainder = 0;
1545
1648
  return remainder === parseInt(cpf.substring(10, 11));
1546
1649
  }
1547
- validateCnpj(cnpj) {
1548
- if (cnpj.length !== 14)
1549
- return false;
1550
- let length = cnpj.length - 2;
1551
- let numbers = cnpj.substring(0, length);
1552
- let digits = cnpj.substring(length);
1553
- let sum = 0, pos = length - 7;
1554
- for (let i = length; i >= 1; i--) {
1555
- sum += parseInt(numbers.charAt(length - i)) * pos--;
1556
- if (pos < 2)
1557
- pos = 9;
1558
- }
1559
- let result = sum % 11 < 2 ? 0 : 11 - sum % 11;
1560
- if (result !== parseInt(digits.charAt(0)))
1561
- return false;
1562
- length = length + 1;
1563
- numbers = cnpj.substring(0, length);
1564
- sum = 0;
1565
- pos = length - 7;
1566
- for (let i = length; i >= 1; i--) {
1567
- sum += parseInt(numbers.charAt(length - i)) * pos--;
1568
- if (pos < 2)
1569
- pos = 9;
1650
+ validateCnpj(cnpj) {
1651
+ if (cnpj.length !== 14)
1652
+ return false;
1653
+ let length = cnpj.length - 2;
1654
+ let numbers = cnpj.substring(0, length);
1655
+ let digits = cnpj.substring(length);
1656
+ let sum = 0, pos = length - 7;
1657
+ for (let i = length; i >= 1; i--) {
1658
+ sum += parseInt(numbers.charAt(length - i)) * pos--;
1659
+ if (pos < 2)
1660
+ pos = 9;
1661
+ }
1662
+ let result = sum % 11 < 2 ? 0 : 11 - sum % 11;
1663
+ if (result !== parseInt(digits.charAt(0)))
1664
+ return false;
1665
+ length = length + 1;
1666
+ numbers = cnpj.substring(0, length);
1667
+ sum = 0;
1668
+ pos = length - 7;
1669
+ for (let i = length; i >= 1; i--) {
1670
+ sum += parseInt(numbers.charAt(length - i)) * pos--;
1671
+ if (pos < 2)
1672
+ pos = 9;
1673
+ }
1674
+ result = sum % 11 < 2 ? 0 : 11 - sum % 11;
1675
+ return result === parseInt(digits.charAt(1));
1676
+ }
1677
+ validateCep(cep) {
1678
+ return /^\d{8}$/.test(cep); // Valida apenas números, sem considerar a máscara
1679
+ }
1680
+ clearAndShowValidationError(message) {
1681
+ this.value = ''; // Limpa o valor do ngModel
1682
+ this.onChangeCallback(this.value); // Atualiza o ngModel com o valor limpo
1683
+ this.errorMessage = message;
1684
+ this.showErrorModal = true;
1685
+ }
1686
+ closeModal() {
1687
+ this.showErrorModal = false;
1688
+ this.errorMessage = '';
1689
+ }
1690
+ onFocus(event) {
1691
+ this.focusEvent.emit(event);
1692
+ }
1693
+ onBlur(event) {
1694
+ this.onTouchedCallback();
1695
+ this.blurEvent.emit(event);
1696
+ }
1697
+ writeValue(value) {
1698
+ this.value = value;
1699
+ }
1700
+ registerOnChange(fn) {
1701
+ this.onChangeCallback = fn;
1702
+ }
1703
+ registerOnTouched(fn) {
1704
+ this.onTouchedCallback = fn;
1705
+ }
1706
+ setDisabledState(isDisabled) {
1707
+ this.disabled = isDisabled;
1708
+ }
1709
+ hasPermission() {
1710
+ if (!this.permissions || this.permissions.length === 0) {
1711
+ return true;
1712
+ }
1713
+ try {
1714
+ return this.authService.hasPermission(this.permissions);
1715
+ }
1716
+ catch (error) {
1717
+ if (error instanceof Error) {
1718
+ console.error('Permission error:', error.message);
1719
+ }
1720
+ else {
1721
+ console.error('Unknown error occurred during permission check');
1722
+ }
1723
+ return true;
1724
+ }
1725
+ }
1726
+ ngOnDestroy() {
1727
+ this.subscriptions.forEach(sub => sub.unsubscribe());
1728
+ }
1729
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InputComponent, deps: [{ token: AuthService }], target: i0.ɵɵFactoryTarget.Component }); }
1730
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: InputComponent, selector: "argenta-custom-input", inputs: { label: "label", placeholder: "placeholder", id: "id", type: "type", disabled: "disabled", readonly: "readonly", maxlength: "maxlength", minlength: "minlength", required: "required", pattern: "pattern", autofocus: "autofocus", useCpfMask: "useCpfMask", useCnpjMask: "useCnpjMask", useCepMask: "useCepMask", onlyNumbers: "onlyNumbers", validateInput: "validateInput", labelFontWeight: "labelFontWeight", permissions: "permissions", useMoneyMask: "useMoneyMask", currencyCode: "currencyCode", displayCurrencySymbol: "displayCurrencySymbol" }, outputs: { inputEvent: "inputEvent", changeEvent: "changeEvent", focusEvent: "focusEvent", blurEvent: "blurEvent", keyupEvent: "keyupEvent", keydownEvent: "keydownEvent", keypressEvent: "keypressEvent" }, providers: [
1731
+ {
1732
+ provide: NG_VALUE_ACCESSOR,
1733
+ useExisting: forwardRef(() => InputComponent),
1734
+ multi: true
1735
+ }
1736
+ ], ngImport: i0, template: "<div *ngIf=\"hasPermission()\" class=\"form-group\">\n <label [for]=\"id\" [ngClass]=\"'label-styles'\">{{ label }}</label>\n <input [type]=\"getInputType()\"\n class=\"form-control custom-input\"\n [id]=\"id\"\n [placeholder]=\"placeholder\"\n [(ngModel)]=\"value\"\n (input)=\"onInput($event)\"\n (change)=\"onChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n (keyup)=\"keyupEvent.emit($event)\"\n (keydown)=\"onKeyDown($event)\"\n (keypress)=\"keypressEvent.emit($event)\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [attr.maxlength]=\"maxlength\"\n [attr.minlength]=\"minlength\"\n [required]=\"required\"\n [attr.pattern]=\"pattern\"\n [autofocus]=\"autofocus\"\n [cpfMask]=\"useCpfMask\" \n [cnpjMask]=\"useCnpjMask\" \n [cepMask]=\"useCepMask\">\n\n <!-- Modal para exibir mensagens de erro -->\n <div class=\"modal-overlay\" *ngIf=\"showErrorModal\">\n <div class=\"modal-content\">\n <span class=\"close\" (click)=\"closeModal()\">&times;</span>\n <p>{{ errorMessage }}</p>\n <button class=\"btn-ok\" (click)=\"closeModal()\">OK</button>\n </div>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.form-group{font-family:Inter,Arial,sans-serif;font-size:1rem;font-weight:700}.form-check-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem}.form-check-label{width:623px;height:19px;top:1608px;left:133px;gap:0px;opacity:0px;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left}.custom-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem;height:46px}.custom-input::placeholder{font-size:14px;color:#d3d3d3}.form-label{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem;font-weight:700}.label-styles{font-weight:400;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.5rem}.modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:#0009;display:flex;align-items:center;justify-content:center;z-index:1000}.modal-content{background:#fff;padding:25px 30px;border-radius:8px;width:360px;text-align:center;position:relative;box-shadow:0 4px 12px #0003}.close{position:absolute;top:10px;right:15px;cursor:pointer;font-size:20px;color:#555;transition:color .3s}.close:hover{color:#f44336}.btn-ok{margin-top:20px;padding:8px 20px;border:none;background-color:#00444c;color:#fff;border-radius:4px;cursor:pointer;font-size:14px;transition:background-color .3s,transform .2s}.btn-ok:hover{background-color:#00363d;transform:scale(1.05)}.btn-ok:active{transform:scale(.98)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: CepMaskDirective, selector: "[cepMask]", inputs: ["cepMask"] }, { kind: "directive", type: CnpjMaskDirective, selector: "[cnpjMask]", inputs: ["cnpjMask"] }, { kind: "directive", type: CpfMaskDirective, selector: "[cpfMask]", inputs: ["cpfMask"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1737
+ }
1738
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InputComponent, decorators: [{
1739
+ type: Component,
1740
+ args: [{ selector: 'argenta-custom-input', providers: [
1741
+ {
1742
+ provide: NG_VALUE_ACCESSOR,
1743
+ useExisting: forwardRef(() => InputComponent),
1744
+ multi: true
1745
+ }
1746
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"hasPermission()\" class=\"form-group\">\n <label [for]=\"id\" [ngClass]=\"'label-styles'\">{{ label }}</label>\n <input [type]=\"getInputType()\"\n class=\"form-control custom-input\"\n [id]=\"id\"\n [placeholder]=\"placeholder\"\n [(ngModel)]=\"value\"\n (input)=\"onInput($event)\"\n (change)=\"onChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n (keyup)=\"keyupEvent.emit($event)\"\n (keydown)=\"onKeyDown($event)\"\n (keypress)=\"keypressEvent.emit($event)\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [attr.maxlength]=\"maxlength\"\n [attr.minlength]=\"minlength\"\n [required]=\"required\"\n [attr.pattern]=\"pattern\"\n [autofocus]=\"autofocus\"\n [cpfMask]=\"useCpfMask\" \n [cnpjMask]=\"useCnpjMask\" \n [cepMask]=\"useCepMask\">\n\n <!-- Modal para exibir mensagens de erro -->\n <div class=\"modal-overlay\" *ngIf=\"showErrorModal\">\n <div class=\"modal-content\">\n <span class=\"close\" (click)=\"closeModal()\">&times;</span>\n <p>{{ errorMessage }}</p>\n <button class=\"btn-ok\" (click)=\"closeModal()\">OK</button>\n </div>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.form-group{font-family:Inter,Arial,sans-serif;font-size:1rem;font-weight:700}.form-check-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem}.form-check-label{width:623px;height:19px;top:1608px;left:133px;gap:0px;opacity:0px;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left}.custom-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem;height:46px}.custom-input::placeholder{font-size:14px;color:#d3d3d3}.form-label{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem;font-weight:700}.label-styles{font-weight:400;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.5rem}.modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:#0009;display:flex;align-items:center;justify-content:center;z-index:1000}.modal-content{background:#fff;padding:25px 30px;border-radius:8px;width:360px;text-align:center;position:relative;box-shadow:0 4px 12px #0003}.close{position:absolute;top:10px;right:15px;cursor:pointer;font-size:20px;color:#555;transition:color .3s}.close:hover{color:#f44336}.btn-ok{margin-top:20px;padding:8px 20px;border:none;background-color:#00444c;color:#fff;border-radius:4px;cursor:pointer;font-size:14px;transition:background-color .3s,transform .2s}.btn-ok:hover{background-color:#00363d;transform:scale(1.05)}.btn-ok:active{transform:scale(.98)}\n"] }]
1747
+ }], ctorParameters: function () { return [{ type: AuthService }]; }, propDecorators: { label: [{
1748
+ type: Input
1749
+ }], placeholder: [{
1750
+ type: Input
1751
+ }], id: [{
1752
+ type: Input
1753
+ }], type: [{
1754
+ type: Input
1755
+ }], disabled: [{
1756
+ type: Input
1757
+ }], readonly: [{
1758
+ type: Input
1759
+ }], maxlength: [{
1760
+ type: Input
1761
+ }], minlength: [{
1762
+ type: Input
1763
+ }], required: [{
1764
+ type: Input
1765
+ }], pattern: [{
1766
+ type: Input
1767
+ }], autofocus: [{
1768
+ type: Input
1769
+ }], useCpfMask: [{
1770
+ type: Input
1771
+ }], useCnpjMask: [{
1772
+ type: Input
1773
+ }], useCepMask: [{
1774
+ type: Input
1775
+ }], onlyNumbers: [{
1776
+ type: Input
1777
+ }], validateInput: [{
1778
+ type: Input
1779
+ }], labelFontWeight: [{
1780
+ type: Input
1781
+ }], permissions: [{
1782
+ type: Input
1783
+ }], useMoneyMask: [{
1784
+ type: Input
1785
+ }], currencyCode: [{
1786
+ type: Input
1787
+ }], displayCurrencySymbol: [{
1788
+ type: Input
1789
+ }], inputEvent: [{
1790
+ type: Output
1791
+ }], changeEvent: [{
1792
+ type: Output
1793
+ }], focusEvent: [{
1794
+ type: Output
1795
+ }], blurEvent: [{
1796
+ type: Output
1797
+ }], keyupEvent: [{
1798
+ type: Output
1799
+ }], keydownEvent: [{
1800
+ type: Output
1801
+ }], keypressEvent: [{
1802
+ type: Output
1803
+ }] } });
1804
+
1805
+ class MultiSelectComponent {
1806
+ constructor(authService, http) {
1807
+ this.authService = authService;
1808
+ this.http = http;
1809
+ this.label = 'Multi Select';
1810
+ this.data = []; // Accepts an array of generic objects
1811
+ this.placeholder = 'Select items';
1812
+ this.id = 'multiSelectId';
1813
+ this.bindLabel = ''; // Generic dynamic label
1814
+ this.bindValue = ''; // Generic dynamic value
1815
+ this.closeOnSelect = false; // New property to control dropdown close behavior
1816
+ this.searchUrl = ''; // URL for backend search
1817
+ this.multiple = true; // New property to control single or multiple selection
1818
+ this.searchParams = {}; // Parâmetros de busca dinâmicos
1819
+ this.keyupEvent = new EventEmitter();
1820
+ this.backupData = []; // Backup of the initial data
1821
+ this.allItems = []; // Store the combined list
1822
+ this.items = of([]); // Initialization of the property
1823
+ this.filteredItems = of([]); // Filtered items
1824
+ this.searchTerms = new Subject(); // For search debounce
1825
+ this.onChangeCallback = () => { };
1826
+ this.onTouchedCallback = () => { };
1827
+ this.isCourseEntered = false;
1828
+ this.compareFn = (item1, item2) => {
1829
+ return item1 && item2 ? item1[this.bindValue] === item2[this.bindValue] : item1 === item2;
1830
+ };
1831
+ }
1832
+ ngOnInit() {
1833
+ this.backupData = [...this.data]; // Backup initial data
1834
+ this.allItems = [...this.data]; // Initialize allItems with the initial data
1835
+ this.items = of(this.allItems);
1836
+ this.fetchInitialData().subscribe(data => {
1837
+ this.updateData(data);
1838
+ this.filteredItems = this.searchTerms.pipe(debounceTime(700), startWith(''), // Start with an empty search to load the original list
1839
+ switchMap(term => this.search(term)));
1840
+ // Adicionar itens selecionados à lista após buscar dados iniciais
1841
+ this.addSelectedItemsToData();
1842
+ });
1843
+ }
1844
+ ngOnChanges(changes) {
1845
+ if (changes['selected'] && !changes['selected'].isFirstChange()) {
1846
+ this.addSelectedItemsToData();
1847
+ }
1848
+ }
1849
+ fetchInitialData() {
1850
+ return this.http.get(this.searchUrl).pipe(map((response) => {
1851
+ if (response && response.length > 0) {
1852
+ return response.map((item) => ({
1853
+ [this.bindValue]: item[this.bindValue],
1854
+ [this.bindLabel]: item[this.bindLabel]
1855
+ }));
1856
+ }
1857
+ return [];
1858
+ }), catchError((error) => {
1859
+ console.error('Error fetching initial data from backend:', error);
1860
+ return of([]);
1861
+ }));
1862
+ }
1863
+ updateData(newData) {
1864
+ newData.forEach((item) => {
1865
+ const existsInList = this.allItems.some(listItem => this.compareFn(listItem, item));
1866
+ if (!existsInList) {
1867
+ this.allItems.push(item);
1868
+ }
1869
+ });
1870
+ this.items = of(this.allItems);
1871
+ }
1872
+ addSelectedItemsToData() {
1873
+ if (this.selected) {
1874
+ const selectedItems = this.multiple ? this.selected : [this.selected];
1875
+ selectedItems.forEach((item) => {
1876
+ const existsInList = this.allItems.some(listItem => this.compareFn(listItem, item));
1877
+ if (!existsInList) {
1878
+ const newItem = {
1879
+ [this.bindValue]: item[this.bindValue] || item,
1880
+ [this.bindLabel]: item[this.bindLabel] || item
1881
+ };
1882
+ this.data.push(newItem);
1883
+ this.allItems.push(newItem);
1884
+ }
1885
+ });
1886
+ this.items = of(this.allItems);
1570
1887
  }
1571
- result = sum % 11 < 2 ? 0 : 11 - sum % 11;
1572
- return result === parseInt(digits.charAt(1));
1573
1888
  }
1574
- validateCep(cep) {
1575
- return /^\d{8}$/.test(cep); // Valida apenas números, sem considerar a máscara
1889
+ onFocus() {
1890
+ this.isCourseEntered = true;
1576
1891
  }
1577
- clearAndShowValidationError(message) {
1578
- this.value = ''; // Limpa o valor do ngModel
1579
- this.onChangeCallback(this.value); // Atualiza o ngModel com o valor limpo
1580
- this.errorMessage = message;
1581
- this.showErrorModal = true;
1892
+ onBlur() {
1893
+ this.isCourseEntered = false;
1582
1894
  }
1583
- closeModal() {
1584
- this.showErrorModal = false;
1585
- this.errorMessage = '';
1895
+ onKeyUp(event) {
1896
+ this.keyupEvent.emit(event);
1586
1897
  }
1587
- onFocus(event) {
1588
- this.focusEvent.emit(event);
1898
+ onSelectedChange(event) {
1899
+ const previousSelected = this.selected;
1900
+ if (this.multiple) {
1901
+ this.selected = event;
1902
+ }
1903
+ else {
1904
+ this.selected = event ? event : null;
1905
+ }
1906
+ this.onChangeCallback(this.selected);
1907
+ // Verificar se um item foi removido
1908
+ if (previousSelected && Array.isArray(previousSelected) && previousSelected.length > event.length) {
1909
+ const removedItems = previousSelected.filter(item => !event.includes(item));
1910
+ removedItems.forEach(item => {
1911
+ const existsInData = this.data.some(dataItem => this.compareFn(dataItem, item));
1912
+ if (!existsInData) {
1913
+ this.data.push(item);
1914
+ this.allItems.push(item); // Adicionar de volta aos itens disponíveis
1915
+ }
1916
+ });
1917
+ }
1589
1918
  }
1590
- onBlur(event) {
1591
- this.onTouchedCallback();
1592
- this.blurEvent.emit(event);
1919
+ onInputChange(event) {
1920
+ const input = event.target.value;
1921
+ this.searchTerms.next(input);
1922
+ }
1923
+ search(term) {
1924
+ if (!term.trim()) {
1925
+ // Se o termo de busca estiver vazio, retorna a lista completa
1926
+ return of(this.allItems);
1927
+ }
1928
+ // Filtra os itens localmente
1929
+ const filtered = this.allItems.filter((item) => item[this.bindLabel].toLowerCase().includes(term.toLowerCase()));
1930
+ if (filtered.length > 0) {
1931
+ console.log('Items filtered locally.');
1932
+ return of(filtered);
1933
+ }
1934
+ else if (this.searchUrl) {
1935
+ // Construir os parâmetros de busca dinamicamente
1936
+ const params = new URLSearchParams(this.searchParams);
1937
+ params.append('term', term);
1938
+ return this.http.get(`${this.searchUrl}?${params.toString()}`).pipe(map((response) => {
1939
+ if (response && response.length > 0) {
1940
+ // Transforma os itens do backend para o formato esperado pelo componente
1941
+ const transformedItems = response.map((item) => ({
1942
+ [this.bindValue]: item[this.bindValue],
1943
+ [this.bindLabel]: item[this.bindLabel]
1944
+ }));
1945
+ // Atualiza os dados com os novos itens buscados
1946
+ this.updateData(transformedItems);
1947
+ return this.allItems;
1948
+ }
1949
+ else {
1950
+ console.log('No items found in the backend search.');
1951
+ return this.allItems;
1952
+ }
1953
+ }), catchError((error) => {
1954
+ console.error('Error fetching from backend:', error);
1955
+ return of(this.allItems);
1956
+ }));
1957
+ }
1958
+ else {
1959
+ console.log('No search URL provided and no items found locally.');
1960
+ return of(this.allItems);
1961
+ }
1593
1962
  }
1594
1963
  writeValue(value) {
1595
- this.value = value;
1964
+ if (this.multiple) {
1965
+ this.selected = value || [];
1966
+ }
1967
+ else {
1968
+ this.selected = value || null;
1969
+ }
1970
+ this.addSelectedItemsToData();
1596
1971
  }
1597
1972
  registerOnChange(fn) {
1598
1973
  this.onChangeCallback = fn;
@@ -1601,7 +1976,7 @@ class InputComponent {
1601
1976
  this.onTouchedCallback = fn;
1602
1977
  }
1603
1978
  setDisabledState(isDisabled) {
1604
- this.disabled = isDisabled;
1979
+ // No implementation needed for this example
1605
1980
  }
1606
1981
  hasPermission() {
1607
1982
  if (!this.permissions || this.permissions.length === 0) {
@@ -1620,83 +1995,88 @@ class InputComponent {
1620
1995
  return true;
1621
1996
  }
1622
1997
  }
1623
- ngOnDestroy() {
1624
- this.subscriptions.forEach(sub => sub.unsubscribe());
1625
- }
1626
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InputComponent, deps: [{ token: AuthService }], target: i0.ɵɵFactoryTarget.Component }); }
1627
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: InputComponent, selector: "argenta-custom-input", inputs: { label: "label", placeholder: "placeholder", id: "id", type: "type", disabled: "disabled", readonly: "readonly", maxlength: "maxlength", minlength: "minlength", required: "required", pattern: "pattern", autofocus: "autofocus", useCpfMask: "useCpfMask", useCnpjMask: "useCnpjMask", useCepMask: "useCepMask", onlyNumbers: "onlyNumbers", validateInput: "validateInput", labelFontWeight: "labelFontWeight", permissions: "permissions", useMoneyMask: "useMoneyMask", currencyCode: "currencyCode", displayCurrencySymbol: "displayCurrencySymbol" }, outputs: { inputEvent: "inputEvent", changeEvent: "changeEvent", focusEvent: "focusEvent", blurEvent: "blurEvent", keyupEvent: "keyupEvent", keydownEvent: "keydownEvent", keypressEvent: "keypressEvent" }, providers: [
1998
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MultiSelectComponent, deps: [{ token: AuthService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Component }); }
1999
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MultiSelectComponent, selector: "argenta-custom-multi-select", inputs: { label: "label", data: "data", placeholder: "placeholder", selected: "selected", id: "id", bindLabel: "bindLabel", bindValue: "bindValue", permissions: "permissions", closeOnSelect: "closeOnSelect", searchUrl: "searchUrl", multiple: "multiple", searchParams: "searchParams" }, outputs: { keyupEvent: "keyupEvent" }, providers: [
1628
2000
  {
1629
2001
  provide: NG_VALUE_ACCESSOR,
1630
- useExisting: forwardRef(() => InputComponent),
2002
+ useExisting: forwardRef(() => MultiSelectComponent),
1631
2003
  multi: true
1632
2004
  }
1633
- ], ngImport: i0, template: "<div *ngIf=\"hasPermission()\" class=\"form-group\">\n <label [for]=\"id\" [ngClass]=\"'label-styles'\">{{ label }}</label>\n <input [type]=\"getInputType()\"\n class=\"form-control custom-input\"\n [id]=\"id\"\n [placeholder]=\"placeholder\"\n [(ngModel)]=\"value\"\n (input)=\"onInput($event)\"\n (change)=\"onChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n (keyup)=\"keyupEvent.emit($event)\"\n (keydown)=\"onKeyDown($event)\"\n (keypress)=\"keypressEvent.emit($event)\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [attr.maxlength]=\"maxlength\"\n [attr.minlength]=\"minlength\"\n [required]=\"required\"\n [attr.pattern]=\"pattern\"\n [autofocus]=\"autofocus\"\n [cpfMask]=\"useCpfMask\" \n [cnpjMask]=\"useCnpjMask\" \n [cepMask]=\"useCepMask\">\n\n <!-- Modal para exibir mensagens de erro -->\n <div class=\"modal-overlay\" *ngIf=\"showErrorModal\">\n <div class=\"modal-content\">\n <span class=\"close\" (click)=\"closeModal()\">&times;</span>\n <p>{{ errorMessage }}</p>\n <button class=\"btn-ok\" (click)=\"closeModal()\">OK</button>\n </div>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.form-group{font-family:Inter,Arial,sans-serif;font-size:1rem;font-weight:700}.form-check-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem}.form-check-label{width:623px;height:19px;top:1608px;left:133px;gap:0px;opacity:0px;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left}.custom-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem;height:46px}.custom-input::placeholder{font-size:14px;color:#d3d3d3}.form-label{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem;font-weight:700}.label-styles{font-weight:400;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.5rem}.modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:#0009;display:flex;align-items:center;justify-content:center;z-index:1000}.modal-content{background:#fff;padding:25px 30px;border-radius:8px;width:360px;text-align:center;position:relative;box-shadow:0 4px 12px #0003}.close{position:absolute;top:10px;right:15px;cursor:pointer;font-size:20px;color:#555;transition:color .3s}.close:hover{color:#f44336}.btn-ok{margin-top:20px;padding:8px 20px;border:none;background-color:#00444c;color:#fff;border-radius:4px;cursor:pointer;font-size:14px;transition:background-color .3s,transform .2s}.btn-ok:hover{background-color:#00363d;transform:scale(1.05)}.btn-ok:active{transform:scale(.98)}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: CepMaskDirective, selector: "[cepMask]", inputs: ["cepMask"] }, { kind: "directive", type: CnpjMaskDirective, selector: "[cnpjMask]", inputs: ["cnpjMask"] }, { kind: "directive", type: CpfMaskDirective, selector: "[cpfMask]", inputs: ["cpfMask"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2005
+ ], usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"hasPermission()\" class=\"form-group\">\n <label [for]=\"id\" class=\"form-label\" style=\"margin-top: 1rem;\">{{ label }}</label>\n <ng-select\n [class.course-entry]=\"isCourseEntered\"\n class=\"ng-select custom-ng-select\"\n [items]=\"filteredItems | async\"\n [multiple]=\"multiple\"\n [closeOnSelect]=\"closeOnSelect\"\n [hideSelected]=\"true\"\n [bindLabel]=\"bindLabel\"\n [bindValue]=\"bindValue\"\n [(ngModel)]=\"selected\"\n [compareWith]=\"compareFn\"\n (change)=\"onSelectedChange($event)\"\n (keyup)=\"onKeyUp($event)\"\n (input)=\"onInputChange($event)\"\n [id]=\"id\"\n [placeholder]=\"selected && (multiple ? selected.length === 0 : !selected) ? placeholder : ''\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\">\n <ng-template ng-option-tmp let-item=\"item\">\n {{ item[bindLabel] }}\n </ng-template>\n </ng-select>\n</div>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.form-group{font-family:Inter,Arial,sans-serif;font-size:1rem}.form-check-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem}.form-check-label{width:623px;height:19px;top:1608px;left:133px;gap:0px;opacity:0px;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left}.custom-select{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem;font-weight:400;border:1px solid #ccc;border-radius:4px;appearance:none;-webkit-appearance:none;-moz-appearance:none;padding-right:2rem;background-image:none;background-repeat:no-repeat;background-position:right .5rem center;height:46px}.custom-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem;height:46px}.custom-input::placeholder{font-size:14px;color:#d3d3d3}.form-label{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem}.label-styles{font-weight:400;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.2rem}.select-container{position:relative;display:inline-block;width:100%}.select-container lucide-icon{position:absolute;right:.75rem;top:50%;transform:translateY(-50%);pointer-events:none;color:#5e6366}.ng-select{display:block;width:100%;font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem}.ng-select .ng-select-container{display:flex;align-items:center;border:1px solid #ccc;border-radius:4px;padding:.5rem;background-color:#fff;color:#333}.ng-select .ng-select-container .ng-value-container{display:flex;align-items:center;flex-grow:1}.ng-select .ng-select-container .ng-clear{display:none}.ng-select .ng-select-container .ng-input{flex-grow:1;border:none;outline:none}.custom-ng-select.ng-select .ng-select-container .ng-input>input{box-sizing:border-box;background:none transparent;border:0 none;box-shadow:none;outline:none;padding:.5rem!important;cursor:default;width:100%}.ng-select .ng-dropdown-panel{border:1px solid #ccc;border-radius:4px;background-color:#fff;color:#333;box-shadow:0 2px 4px #0000001a}.ng-select .ng-dropdown-panel .ng-option{padding:8px;cursor:pointer}.ng-select .ng-dropdown-panel .ng-option:hover{background-color:#f1f1f1}.ng-select .ng-dropdown-panel .ng-option.selected{background-color:#007bff;color:#fff}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i5.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i5.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1634
2006
  }
1635
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: InputComponent, decorators: [{
2007
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MultiSelectComponent, decorators: [{
1636
2008
  type: Component,
1637
- args: [{ selector: 'argenta-custom-input', providers: [
2009
+ args: [{ selector: 'argenta-custom-multi-select', providers: [
1638
2010
  {
1639
2011
  provide: NG_VALUE_ACCESSOR,
1640
- useExisting: forwardRef(() => InputComponent),
2012
+ useExisting: forwardRef(() => MultiSelectComponent),
1641
2013
  multi: true
1642
2014
  }
1643
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"hasPermission()\" class=\"form-group\">\n <label [for]=\"id\" [ngClass]=\"'label-styles'\">{{ label }}</label>\n <input [type]=\"getInputType()\"\n class=\"form-control custom-input\"\n [id]=\"id\"\n [placeholder]=\"placeholder\"\n [(ngModel)]=\"value\"\n (input)=\"onInput($event)\"\n (change)=\"onChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n (keyup)=\"keyupEvent.emit($event)\"\n (keydown)=\"onKeyDown($event)\"\n (keypress)=\"keypressEvent.emit($event)\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [attr.maxlength]=\"maxlength\"\n [attr.minlength]=\"minlength\"\n [required]=\"required\"\n [attr.pattern]=\"pattern\"\n [autofocus]=\"autofocus\"\n [cpfMask]=\"useCpfMask\" \n [cnpjMask]=\"useCnpjMask\" \n [cepMask]=\"useCepMask\">\n\n <!-- Modal para exibir mensagens de erro -->\n <div class=\"modal-overlay\" *ngIf=\"showErrorModal\">\n <div class=\"modal-content\">\n <span class=\"close\" (click)=\"closeModal()\">&times;</span>\n <p>{{ errorMessage }}</p>\n <button class=\"btn-ok\" (click)=\"closeModal()\">OK</button>\n </div>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.form-group{font-family:Inter,Arial,sans-serif;font-size:1rem;font-weight:700}.form-check-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem}.form-check-label{width:623px;height:19px;top:1608px;left:133px;gap:0px;opacity:0px;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left}.custom-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem;height:46px}.custom-input::placeholder{font-size:14px;color:#d3d3d3}.form-label{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem;font-weight:700}.label-styles{font-weight:400;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.5rem}.modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:#0009;display:flex;align-items:center;justify-content:center;z-index:1000}.modal-content{background:#fff;padding:25px 30px;border-radius:8px;width:360px;text-align:center;position:relative;box-shadow:0 4px 12px #0003}.close{position:absolute;top:10px;right:15px;cursor:pointer;font-size:20px;color:#555;transition:color .3s}.close:hover{color:#f44336}.btn-ok{margin-top:20px;padding:8px 20px;border:none;background-color:#00444c;color:#fff;border-radius:4px;cursor:pointer;font-size:14px;transition:background-color .3s,transform .2s}.btn-ok:hover{background-color:#00363d;transform:scale(1.05)}.btn-ok:active{transform:scale(.98)}\n"] }]
1644
- }], ctorParameters: function () { return [{ type: AuthService }]; }, propDecorators: { label: [{
1645
- type: Input
1646
- }], placeholder: [{
2015
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"hasPermission()\" class=\"form-group\">\n <label [for]=\"id\" class=\"form-label\" style=\"margin-top: 1rem;\">{{ label }}</label>\n <ng-select\n [class.course-entry]=\"isCourseEntered\"\n class=\"ng-select custom-ng-select\"\n [items]=\"filteredItems | async\"\n [multiple]=\"multiple\"\n [closeOnSelect]=\"closeOnSelect\"\n [hideSelected]=\"true\"\n [bindLabel]=\"bindLabel\"\n [bindValue]=\"bindValue\"\n [(ngModel)]=\"selected\"\n [compareWith]=\"compareFn\"\n (change)=\"onSelectedChange($event)\"\n (keyup)=\"onKeyUp($event)\"\n (input)=\"onInputChange($event)\"\n [id]=\"id\"\n [placeholder]=\"selected && (multiple ? selected.length === 0 : !selected) ? placeholder : ''\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\">\n <ng-template ng-option-tmp let-item=\"item\">\n {{ item[bindLabel] }}\n </ng-template>\n </ng-select>\n</div>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.form-group{font-family:Inter,Arial,sans-serif;font-size:1rem}.form-check-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem}.form-check-label{width:623px;height:19px;top:1608px;left:133px;gap:0px;opacity:0px;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left}.custom-select{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem;font-weight:400;border:1px solid #ccc;border-radius:4px;appearance:none;-webkit-appearance:none;-moz-appearance:none;padding-right:2rem;background-image:none;background-repeat:no-repeat;background-position:right .5rem center;height:46px}.custom-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem;height:46px}.custom-input::placeholder{font-size:14px;color:#d3d3d3}.form-label{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem}.label-styles{font-weight:400;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.2rem}.select-container{position:relative;display:inline-block;width:100%}.select-container lucide-icon{position:absolute;right:.75rem;top:50%;transform:translateY(-50%);pointer-events:none;color:#5e6366}.ng-select{display:block;width:100%;font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem}.ng-select .ng-select-container{display:flex;align-items:center;border:1px solid #ccc;border-radius:4px;padding:.5rem;background-color:#fff;color:#333}.ng-select .ng-select-container .ng-value-container{display:flex;align-items:center;flex-grow:1}.ng-select .ng-select-container .ng-clear{display:none}.ng-select .ng-select-container .ng-input{flex-grow:1;border:none;outline:none}.custom-ng-select.ng-select .ng-select-container .ng-input>input{box-sizing:border-box;background:none transparent;border:0 none;box-shadow:none;outline:none;padding:.5rem!important;cursor:default;width:100%}.ng-select .ng-dropdown-panel{border:1px solid #ccc;border-radius:4px;background-color:#fff;color:#333;box-shadow:0 2px 4px #0000001a}.ng-select .ng-dropdown-panel .ng-option{padding:8px;cursor:pointer}.ng-select .ng-dropdown-panel .ng-option:hover{background-color:#f1f1f1}.ng-select .ng-dropdown-panel .ng-option.selected{background-color:#007bff;color:#fff}\n"] }]
2016
+ }], ctorParameters: function () { return [{ type: AuthService }, { type: i2.HttpClient }]; }, propDecorators: { label: [{
1647
2017
  type: Input
1648
- }], id: [{
2018
+ }], data: [{
1649
2019
  type: Input
1650
- }], type: [{
2020
+ }], placeholder: [{
1651
2021
  type: Input
1652
- }], disabled: [{
2022
+ }], selected: [{
1653
2023
  type: Input
1654
- }], readonly: [{
2024
+ }], id: [{
1655
2025
  type: Input
1656
- }], maxlength: [{
2026
+ }], bindLabel: [{
1657
2027
  type: Input
1658
- }], minlength: [{
2028
+ }], bindValue: [{
1659
2029
  type: Input
1660
- }], required: [{
2030
+ }], permissions: [{
1661
2031
  type: Input
1662
- }], pattern: [{
2032
+ }], closeOnSelect: [{
1663
2033
  type: Input
1664
- }], autofocus: [{
2034
+ }], searchUrl: [{
1665
2035
  type: Input
1666
- }], useCpfMask: [{
2036
+ }], multiple: [{
1667
2037
  type: Input
1668
- }], useCnpjMask: [{
2038
+ }], searchParams: [{
1669
2039
  type: Input
1670
- }], useCepMask: [{
2040
+ }], keyupEvent: [{
2041
+ type: Output
2042
+ }] } });
2043
+
2044
+ class MultiSelectCategoryComponent {
2045
+ constructor() {
2046
+ // Inputs para receber dados dinâmicos de diferentes categorias
2047
+ this.unidadesOrganizacionais = [];
2048
+ this.clientes = [];
2049
+ this.empresas = [];
2050
+ this.usuarios = [];
2051
+ // Inputs para permissões específicas de cada categoria
2052
+ this.permissoesUnidades = [];
2053
+ this.permissoesClientes = [];
2054
+ this.permissoesEmpresas = [];
2055
+ this.permissoesUsuarios = [];
2056
+ }
2057
+ ngOnInit() { }
2058
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MultiSelectCategoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2059
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MultiSelectCategoryComponent, selector: "argenta-multi-select-category", inputs: { unidadesOrganizacionais: "unidadesOrganizacionais", clientes: "clientes", empresas: "empresas", usuarios: "usuarios", permissoesUnidades: "permissoesUnidades", permissoesClientes: "permissoesClientes", permissoesEmpresas: "permissoesEmpresas", permissoesUsuarios: "permissoesUsuarios" }, ngImport: i0, template: "<div class=\"multi-select-category\">\n <div class=\"row\">\n <!-- Primeira linha: Usu\u00E1rio e Cliente -->\n <div class=\"col\">\n <argenta-custom-multi-select\n label=\"Usu\u00E1rios\"\n [data]=\"usuarios\"\n bindLabel=\"nome\"\n bindValue=\"id\"\n [permissions]=\"permissoesUsuarios\"\n placeholder=\"Selecione Usu\u00E1rios\">\n </argenta-custom-multi-select>\n </div>\n\n <div class=\"col\">\n <argenta-custom-multi-select\n label=\"Clientes\"\n [data]=\"clientes\"\n bindLabel=\"nome\"\n bindValue=\"id\"\n [permissions]=\"permissoesClientes\"\n placeholder=\"Selecione Clientes\">\n </argenta-custom-multi-select>\n </div>\n </div>\n\n <div class=\"row\">\n <!-- Segunda linha: Empresa e Unidade Organizacional -->\n <div class=\"col\">\n <argenta-custom-multi-select\n label=\"Empresas\"\n [data]=\"empresas\"\n bindLabel=\"nome\"\n bindValue=\"id\"\n [permissions]=\"permissoesEmpresas\"\n placeholder=\"Selecione Empresas\">\n </argenta-custom-multi-select>\n </div>\n\n <div class=\"col\">\n <argenta-custom-multi-select\n label=\"Unidades Organizacionais\"\n [data]=\"unidadesOrganizacionais\"\n bindLabel=\"nome\"\n bindValue=\"id\"\n [permissions]=\"permissoesUnidades\"\n placeholder=\"Selecione Unidades Organizacionais\">\n </argenta-custom-multi-select>\n </div>\n </div>\n</div>\n", styles: [".multi-select-category{display:flex;flex-direction:column;gap:1rem}.multi-select-category .row{display:flex;gap:1rem}.multi-select-category .col{flex:1}\n"], dependencies: [{ kind: "component", type: MultiSelectComponent, selector: "argenta-custom-multi-select", inputs: ["label", "data", "placeholder", "selected", "id", "bindLabel", "bindValue", "permissions", "closeOnSelect", "searchUrl", "multiple", "searchParams"], outputs: ["keyupEvent"] }] }); }
2060
+ }
2061
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MultiSelectCategoryComponent, decorators: [{
2062
+ type: Component,
2063
+ args: [{ selector: 'argenta-multi-select-category', template: "<div class=\"multi-select-category\">\n <div class=\"row\">\n <!-- Primeira linha: Usu\u00E1rio e Cliente -->\n <div class=\"col\">\n <argenta-custom-multi-select\n label=\"Usu\u00E1rios\"\n [data]=\"usuarios\"\n bindLabel=\"nome\"\n bindValue=\"id\"\n [permissions]=\"permissoesUsuarios\"\n placeholder=\"Selecione Usu\u00E1rios\">\n </argenta-custom-multi-select>\n </div>\n\n <div class=\"col\">\n <argenta-custom-multi-select\n label=\"Clientes\"\n [data]=\"clientes\"\n bindLabel=\"nome\"\n bindValue=\"id\"\n [permissions]=\"permissoesClientes\"\n placeholder=\"Selecione Clientes\">\n </argenta-custom-multi-select>\n </div>\n </div>\n\n <div class=\"row\">\n <!-- Segunda linha: Empresa e Unidade Organizacional -->\n <div class=\"col\">\n <argenta-custom-multi-select\n label=\"Empresas\"\n [data]=\"empresas\"\n bindLabel=\"nome\"\n bindValue=\"id\"\n [permissions]=\"permissoesEmpresas\"\n placeholder=\"Selecione Empresas\">\n </argenta-custom-multi-select>\n </div>\n\n <div class=\"col\">\n <argenta-custom-multi-select\n label=\"Unidades Organizacionais\"\n [data]=\"unidadesOrganizacionais\"\n bindLabel=\"nome\"\n bindValue=\"id\"\n [permissions]=\"permissoesUnidades\"\n placeholder=\"Selecione Unidades Organizacionais\">\n </argenta-custom-multi-select>\n </div>\n </div>\n</div>\n", styles: [".multi-select-category{display:flex;flex-direction:column;gap:1rem}.multi-select-category .row{display:flex;gap:1rem}.multi-select-category .col{flex:1}\n"] }]
2064
+ }], ctorParameters: function () { return []; }, propDecorators: { unidadesOrganizacionais: [{
1671
2065
  type: Input
1672
- }], onlyNumbers: [{
2066
+ }], clientes: [{
1673
2067
  type: Input
1674
- }], validateInput: [{
2068
+ }], empresas: [{
1675
2069
  type: Input
1676
- }], labelFontWeight: [{
2070
+ }], usuarios: [{
1677
2071
  type: Input
1678
- }], permissions: [{
2072
+ }], permissoesUnidades: [{
1679
2073
  type: Input
1680
- }], useMoneyMask: [{
2074
+ }], permissoesClientes: [{
1681
2075
  type: Input
1682
- }], currencyCode: [{
2076
+ }], permissoesEmpresas: [{
1683
2077
  type: Input
1684
- }], displayCurrencySymbol: [{
2078
+ }], permissoesUsuarios: [{
1685
2079
  type: Input
1686
- }], inputEvent: [{
1687
- type: Output
1688
- }], changeEvent: [{
1689
- type: Output
1690
- }], focusEvent: [{
1691
- type: Output
1692
- }], blurEvent: [{
1693
- type: Output
1694
- }], keyupEvent: [{
1695
- type: Output
1696
- }], keydownEvent: [{
1697
- type: Output
1698
- }], keypressEvent: [{
1699
- type: Output
1700
2080
  }] } });
1701
2081
 
1702
2082
  class RadioComponent {
@@ -1757,7 +2137,7 @@ class RadioComponent {
1757
2137
  [disabled]="disabled">
1758
2138
  <label class="form-check-label" [for]="id">{{ label }}</label>
1759
2139
  </div>
1760
- `, isInline: true, styles: [".form-check{font-family:Arial,sans-serif;font-size:1rem}.form-check-input{font-family:Arial,sans-serif;color:#333;font-size:1rem;margin-right:.5rem}.form-check-label{font-family:Arial,sans-serif;color:#333;font-size:1rem;font-weight:700}\n"], dependencies: [{ kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2140
+ `, isInline: true, styles: [".form-check{font-family:Arial,sans-serif;font-size:1rem}.form-check-input{font-family:Arial,sans-serif;color:#333;font-size:1rem;margin-right:.5rem}.form-check-label{font-family:Arial,sans-serif;color:#333;font-size:1rem;font-weight:700}\n"], dependencies: [{ kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1761
2141
  }
1762
2142
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RadioComponent, decorators: [{
1763
2143
  type: Component,
@@ -1934,7 +2314,7 @@ class SearchInputComponent {
1934
2314
  useExisting: forwardRef(() => SearchInputComponent),
1935
2315
  multi: true
1936
2316
  }
1937
- ], ngImport: i0, template: "<div class=\"form-group\">\n <label [for]=\"id\" [ngStyle]=\"getLabelStyles()\">{{ label }}</label>\n <input [type]=\"type\"\n class=\"form-control custom-input\"\n [id]=\"id\"\n [placeholder]=\"placeholder\"\n [(ngModel)]=\"value\"\n (input)=\"onInput($event)\"\n (change)=\"onChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n (keyup)=\"onKeyup($event)\"\n (keydown)=\"onKeydown($event)\"\n (keypress)=\"onKeypress($event)\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [attr.maxlength]=\"maxlength\"\n [attr.minlength]=\"minlength\"\n [required]=\"required\"\n [attr.pattern]=\"pattern\"\n [autofocus]=\"autofocus\">\n</div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.form-group{font-family:Inter,Arial,sans-serif;font-size:1rem;font-weight:700}.custom-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem;width:227px;height:46px}.custom-input::placeholder{font-size:14px;color:#d3d3d3}label{font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left}\n"], dependencies: [{ kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
2317
+ ], ngImport: i0, template: "<div class=\"form-group\">\n <label [for]=\"id\" [ngStyle]=\"getLabelStyles()\">{{ label }}</label>\n <input [type]=\"type\"\n class=\"form-control custom-input\"\n [id]=\"id\"\n [placeholder]=\"placeholder\"\n [(ngModel)]=\"value\"\n (input)=\"onInput($event)\"\n (change)=\"onChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n (keyup)=\"onKeyup($event)\"\n (keydown)=\"onKeydown($event)\"\n (keypress)=\"onKeypress($event)\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [attr.maxlength]=\"maxlength\"\n [attr.minlength]=\"minlength\"\n [required]=\"required\"\n [attr.pattern]=\"pattern\"\n [autofocus]=\"autofocus\">\n</div>\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.form-group{font-family:Inter,Arial,sans-serif;font-size:1rem;font-weight:700}.custom-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem;width:227px;height:46px}.custom-input::placeholder{font-size:14px;color:#d3d3d3}label{font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left}\n"], dependencies: [{ kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
1938
2318
  }
1939
2319
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SearchInputComponent, decorators: [{
1940
2320
  type: Component,
@@ -2069,7 +2449,7 @@ class SelectComponent {
2069
2449
  <lucide-icon name="chevron-down" [size]="16" color="#5E6366" [strokeWidth]="1.75"></lucide-icon>
2070
2450
  </div>
2071
2451
  </div>
2072
- `, isInline: true, styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.form-group{font-family:Inter,Arial,sans-serif;font-size:1rem;font-weight:700}.form-check-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem}.form-check-label{width:623px;height:19px;top:1608px;left:133px;gap:0px;opacity:0px;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left}.custom-select{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem;font-weight:400;border:1px solid #ccc;border-radius:4px;padding:.5rem 2rem .5rem .5rem;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:none;background-repeat:no-repeat;background-position:right .5rem center}.custom-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem;font-weight:400;border:1px solid #ccc;border-radius:4px;padding:.5rem}.form-label{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem;font-weight:700}.label-styles{font-weight:400;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.5rem}.select-container{position:relative;display:inline-block;width:100%}.select-container lucide-icon{position:absolute;right:.75rem;top:50%;transform:translateY(-50%);pointer-events:none;color:#5e6366}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "component", type: i1$1.LucideAngularComponent, selector: "lucide-angular, lucide-icon, i-lucide, span-lucide", inputs: ["class", "name", "img", "color", "absoluteStrokeWidth", "size", "strokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2452
+ `, isInline: true, styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.form-group{font-family:Inter,Arial,sans-serif;font-size:1rem;font-weight:700}.form-check-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem}.form-check-label{width:623px;height:19px;top:1608px;left:133px;gap:0px;opacity:0px;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left}.custom-select{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem;font-weight:400;border:1px solid #ccc;border-radius:4px;padding:.5rem 2rem .5rem .5rem;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:none;background-repeat:no-repeat;background-position:right .5rem center}.custom-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem;font-weight:400;border:1px solid #ccc;border-radius:4px;padding:.5rem}.form-label{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem;font-weight:700}.label-styles{font-weight:400;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.5rem}.select-container{position:relative;display:inline-block;width:100%}.select-container lucide-icon{position:absolute;right:.75rem;top:50%;transform:translateY(-50%);pointer-events:none;color:#5e6366}\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: "directive", type: i4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "component", type: i1$1.LucideAngularComponent, selector: "lucide-angular, lucide-icon, i-lucide, span-lucide", inputs: ["class", "name", "img", "color", "absoluteStrokeWidth", "size", "strokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2073
2453
  }
2074
2454
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SelectComponent, decorators: [{
2075
2455
  type: Component,
@@ -2154,7 +2534,7 @@ class TabComponent {
2154
2534
  }
2155
2535
  }
2156
2536
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabComponent, deps: [{ token: AuthService }], target: i0.ɵɵFactoryTarget.Component }); }
2157
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TabComponent, selector: "argenta-tab", inputs: { tabs: "tabs", activeTabIndex: "activeTabIndex", componentPermissions: "componentPermissions" }, outputs: { tabChanged: "tabChanged" }, ngImport: i0, template: "<ng-container *ngIf=\"hasComponentPermission()\">\n <ul class=\"nav nav-tabs\">\n <ng-container *ngFor=\"let tab of tabs; let i = index\">\n <li class=\"nav-item\" *ngIf=\"hasPermission(tab.permissions)\">\n <a\n class=\"nav-link\"\n [class.active]=\"i === activeTabIndex\"\n (click)=\"selectTab(i, $event)\"\n href=\"#\"\n >{{ tab.label }}</a\n >\n </li>\n </ng-container>\n </ul>\n <div class=\"tab-content\">\n <div\n *ngFor=\"let tab of tabs; let i = index\"\n class=\"tab-pane fade\"\n [ngClass]=\"{ 'show active': i === activeTabIndex }\"\n >\n <ng-container *ngTemplateOutlet=\"tab.content\"></ng-container>\n </div>\n </div>\n</ng-container>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.nav-tabs .nav-item .nav-link{cursor:pointer;font-family:Inter,Arial,sans-serif;border-top-left-radius:.3rem;border-top-right-radius:.3rem;font-size:14px;color:#00444c;border:1px solid #ddd;transition:background-color .3s ease,color .3s ease}.nav-tabs .nav-item .nav-link.active{background-color:#00444c;color:#fff;border-color:transparent}.nav-tabs .nav-item .nav-link:hover{background-color:#2ca58d;color:#fff}.tab-content .tab-pane{padding:1rem;border:1px solid #ddd;border-top:none}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2537
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TabComponent, selector: "argenta-tab", inputs: { tabs: "tabs", activeTabIndex: "activeTabIndex", componentPermissions: "componentPermissions" }, outputs: { tabChanged: "tabChanged" }, ngImport: i0, template: "<ng-container *ngIf=\"hasComponentPermission()\">\n <ul class=\"nav nav-tabs\">\n <ng-container *ngFor=\"let tab of tabs; let i = index\">\n <li class=\"nav-item\" *ngIf=\"hasPermission(tab.permissions)\">\n <a\n class=\"nav-link\"\n [class.active]=\"i === activeTabIndex\"\n (click)=\"selectTab(i, $event)\"\n href=\"#\"\n >{{ tab.label }}</a\n >\n </li>\n </ng-container>\n </ul>\n <div class=\"tab-content\">\n <div\n *ngFor=\"let tab of tabs; let i = index\"\n class=\"tab-pane fade\"\n [ngClass]=\"{ 'show active': i === activeTabIndex }\"\n >\n <ng-container *ngTemplateOutlet=\"tab.content\"></ng-container>\n </div>\n </div>\n</ng-container>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.nav-tabs .nav-item .nav-link{cursor:pointer;font-family:Inter,Arial,sans-serif;border-top-left-radius:.3rem;border-top-right-radius:.3rem;font-size:14px;color:#00444c;border:1px solid #ddd;transition:background-color .3s ease,color .3s ease}.nav-tabs .nav-item .nav-link.active{background-color:#00444c;color:#fff;border-color:transparent}.nav-tabs .nav-item .nav-link:hover{background-color:#2ca58d;color:#fff}.tab-content .tab-pane{padding:1rem;border:1px solid #ddd;border-top:none}\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: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2158
2538
  }
2159
2539
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TabComponent, decorators: [{
2160
2540
  type: Component,
@@ -2211,7 +2591,7 @@ class DataTableComponent {
2211
2591
  this.pageText = 'Page';
2212
2592
  this.ofText = 'of';
2213
2593
  this.filterDescription = '';
2214
- this.buttonLabel = 'Novo perfil'; // Adicionando o Input para o label do botão
2594
+ this.buttonLabel = ''; // Adicionando o Input para o label do botão
2215
2595
  this.sortChange = new EventEmitter();
2216
2596
  this.pageChange = new EventEmitter();
2217
2597
  this.itemsPerPageChange = new EventEmitter();
@@ -2348,11 +2728,11 @@ class DataTableComponent {
2348
2728
  this.onButtonClick.emit(); // Emitindo o evento
2349
2729
  }
2350
2730
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataTableComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: AuthService }, { token: RefreshService }], target: i0.ɵɵFactoryTarget.Component }); }
2351
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DataTableComponent, selector: "argenta-list-data-table", inputs: { columns: "columns", hiddenColumns: "hiddenColumns", defaultItemsPerPage: "defaultItemsPerPage", itemsPerPageLabel: "itemsPerPageLabel", showActionColumn: "showActionColumn", actionColumnLabel: "actionColumnLabel", totalItems: "totalItems", fetchDataFunction: "fetchDataFunction", editPermissions: "editPermissions", deletePermissions: "deletePermissions", viewPermissions: "viewPermissions", showPageInfo: "showPageInfo", pageText: "pageText", ofText: "ofText", filterDescription: "filterDescription", buttonLabel: "buttonLabel" }, outputs: { sortChange: "sortChange", pageChange: "pageChange", itemsPerPageChange: "itemsPerPageChange", onEditTable: "onEditTable", onDeleteTable: "onDeleteTable", onViewTable: "onViewTable", onButtonClick: "onButtonClick" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"data-table-header\" style=\"margin-top: 2.5rem;\">\n <div class=\"left-section\">\n <div class=\"form-group\">\n <label for=\"itemsPerPageSelect\" class=\"items-per-page-label\">{{ itemsPerPageLabel }}</label>\n <select\n id=\"itemsPerPageSelect\"\n class=\"form-control form-control-sm d-inline-block w-auto custom-select\"\n [(ngModel)]=\"defaultItemsPerPage\"\n (ngModelChange)=\"onItemsPerPageChange()\">\n <option *ngFor=\"let option of itemsPerPageOptions\" [value]=\"option\">{{ option }}</option>\n </select>\n </div>\n </div>\n <div class=\"right-section\">\n <button class=\"custom-button\" (click)=\"onNewButtonClick()\">\n <lucide-icon name=\"plus\" [size]=\"28\" [strokeWidth]=\"1.75\"></lucide-icon>\n {{ buttonLabel }}\n </button>\n </div>\n</div>\n\n<div class=\"search-input-container\">\n <argenta-search-input id=\"search\" label=\"\" placeholder=\"Buscar\" [(ngModel)]=\"filterDescription\" (search)=\"onSearch($event)\"></argenta-search-input>\n</div>\n\n<div class=\"table-responsive\" style=\"margin-top: 1rem;\">\n <table class=\"table table-hover\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let column of columns\">\n <th *ngIf=\"!isColumnHidden(column.prop)\" (click)=\"onSort(column.prop)\">\n {{ column.label }}\n </th>\n </ng-container>\n <th *ngIf=\"showActionColumn\" class=\"text-end\" style=\"padding-right: 6.3rem;\">{{ actionColumnLabel }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let item of pagedData; let i = index\">\n <ng-container *ngFor=\"let column of columns\">\n <td *ngIf=\"!isColumnHidden(column.prop)\">\n {{ getNestedProperty(item, column.prop) }}\n </td>\n </ng-container>\n <td *ngIf=\"showActionColumn\" class=\"text-end\">\n <div class=\"d-flex justify-content-end\">\n <div *ngIf=\"hasPermission(editPermissions) && onEditTable.observers.length > 0\" (click)=\"handleAction('edit', item, i)\" class=\"clickable-icon\" style=\"margin-right: 1.5rem;\">\n <lucide-icon name=\"square-pen\" [size]=\"20\" color=\"#2CA58D\" [strokeWidth]=\"1.75\"></lucide-icon>\n </div>\n <div *ngIf=\"hasPermission(viewPermissions) && onViewTable.observers.length > 0\" (click)=\"handleAction('view', item, i)\" class=\"clickable-icon\" style=\"margin-right: 1.5rem;\">\n <lucide-icon name=\"user-round\" [size]=\"20\" color=\"#2CA58D\" [strokeWidth]=\"1.75\"></lucide-icon>\n </div>\n <div *ngIf=\"hasPermission(deletePermissions) && onDeleteTable.observers.length > 0\" (click)=\"handleAction('delete', item, i)\" class=\"clickable-icon\" style=\"margin-right: 1.5rem;\">\n <i-lucide name=\"trash-2\" [size]=\"20\" color=\"#F26E6E\" [strokeWidth]=\"1.75\"></i-lucide>\n </div>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<div class=\"text-center pagination-controls\">\n <custom-pagination\n [totalItems]=\"totalItems\"\n [itemsPerPage]=\"defaultItemsPerPage\"\n [currentPage]=\"currentPage\"\n [showPageInfo]=\"showPageInfo\"\n (pageChange)=\"onPageChange($event)\">\n </custom-pagination>\n</div>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.clickable-icon{cursor:pointer}:host{font-family:Inter,Arial,sans-serif}.data-table-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:-.2rem}.left-section,.right-section{display:flex;align-items:center}.search-input-container{display:flex;justify-content:flex-start}.left-section .form-group{display:flex;align-items:center}.items-per-page-label{font-family:Inter,Arial,sans-serif;font-size:14px;color:#666;margin-right:.2rem}.custom-select{font-family:Inter,Arial,sans-serif;font-size:14px;color:#666;background:#fff url('data:image/svg+xml;charset=US-ASCII,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 4 5\"><path fill=\"#666\" d=\"M2 0L0 2h4L2 0zM2 5l2-2H0l2 2z\"/></svg>') no-repeat right .75rem center/8px 10px;border:1px solid #ccc;border-radius:.25rem;padding:.375rem 1.75rem .375rem .75rem;appearance:none;-webkit-appearance:none;-moz-appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem #007bff40}.table{font-family:Inter,Arial,sans-serif;font-size:var(--table-font-size, 14px);color:var(--table-font-color, #737B7B);border-collapse:separate;border-spacing:0;border-radius:8px;overflow:hidden}.table thead tr{height:60px}.table thead th{background-color:#00444c;color:#fff;font-family:Inter,Arial,sans-serif;font-size:13px;font-weight:600;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center;line-height:2.5}.table thead th:first-child{text-align:left;padding-left:1.4rem}.table tbody td{font-family:Inter,Arial,sans-serif;font-size:14px;color:#737b7b;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center}.table tbody td:first-child{text-align:left;padding-left:1.4rem}.table tbody tr:last-child td{border-bottom:.1rem solid #dcdcdc}.table tbody td{border-right:none;border-left:none}.table thead th:first-child{border-top-left-radius:0}.table thead th:last-child{border-top-right-radius:0}.table tbody tr:last-child td:first-child{border-bottom-left-radius:0}.table tbody tr:last-child td:last-child{border-bottom-right-radius:0}.btn-icon{width:24px;height:24px;background-size:cover;display:inline-block;cursor:pointer;margin-right:16px}.pagination-controls{display:flex;justify-content:center;align-items:center;margin-top:1rem}.custom-button{display:flex;align-items:center;padding:.5rem 1rem .5rem .5rem;border-radius:.25rem;transition:background-color .3s,border-color .3s,filter .3s;font-family:Inter,sans-serif;font-size:16px;font-weight:600;height:40px;letter-spacing:.005em;text-align:left;color:#fff;background-color:#2ca58d;border:none;cursor:pointer}.custom-button lucide-icon{margin-right:.5rem}.custom-button:hover{background-color:#217d6b}.custom-button:active{background-color:#3acaae}.custom-button:focus{outline:none;box-shadow:0 0 0 .2rem #2ca58d40}\n"], dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i1$1.LucideAngularComponent, selector: "lucide-angular, lucide-icon, i-lucide, span-lucide", inputs: ["class", "name", "img", "color", "absoluteStrokeWidth", "size", "strokeWidth"] }, { kind: "component", type: CustomPaginationComponent, selector: "custom-pagination", inputs: ["totalItems", "itemsPerPage", "currentPage", "showPageInfo"], outputs: ["pageChange"] }, { kind: "component", type: SearchInputComponent, selector: "argenta-search-input", inputs: ["id", "label", "type", "placeholder", "value", "disabled", "readonly", "autofocus", "maxlength", "minlength", "required", "pattern", "debounceTime"], outputs: ["search", "inputChange", "change", "focus", "blur", "keyup", "keydown", "keypress"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2731
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DataTableComponent, selector: "argenta-list-data-table", inputs: { columns: "columns", hiddenColumns: "hiddenColumns", defaultItemsPerPage: "defaultItemsPerPage", itemsPerPageLabel: "itemsPerPageLabel", showActionColumn: "showActionColumn", actionColumnLabel: "actionColumnLabel", totalItems: "totalItems", fetchDataFunction: "fetchDataFunction", editPermissions: "editPermissions", deletePermissions: "deletePermissions", viewPermissions: "viewPermissions", showPageInfo: "showPageInfo", pageText: "pageText", ofText: "ofText", filterDescription: "filterDescription", buttonLabel: "buttonLabel" }, outputs: { sortChange: "sortChange", pageChange: "pageChange", itemsPerPageChange: "itemsPerPageChange", onEditTable: "onEditTable", onDeleteTable: "onDeleteTable", onViewTable: "onViewTable", onButtonClick: "onButtonClick" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"data-table-header\" style=\"margin-top: 2.5rem;\">\n <div class=\"left-section\">\n <div class=\"form-group\">\n <label for=\"itemsPerPageSelect\" class=\"items-per-page-label\">{{ itemsPerPageLabel }}</label>\n <select\n id=\"itemsPerPageSelect\"\n class=\"form-control form-control-sm d-inline-block w-auto custom-select\"\n [(ngModel)]=\"defaultItemsPerPage\"\n (ngModelChange)=\"onItemsPerPageChange()\">\n <option *ngFor=\"let option of itemsPerPageOptions\" [value]=\"option\">{{ option }}</option>\n </select>\n </div>\n </div>\n <div *ngIf=\"buttonLabel && buttonLabel.length > 0\" class=\"right-section\">\n <button class=\"custom-button\" (click)=\"onNewButtonClick()\">\n <lucide-icon name=\"plus\" [size]=\"28\" [strokeWidth]=\"1.75\"></lucide-icon>\n {{ buttonLabel }}\n </button>\n </div>\n</div>\n\n<div class=\"search-input-container\">\n <argenta-search-input id=\"search\" label=\"\" placeholder=\"Buscar\" [(ngModel)]=\"filterDescription\" (search)=\"onSearch($event)\"></argenta-search-input>\n</div>\n\n<div class=\"table-responsive\" style=\"margin-top: 1rem;\">\n <table class=\"table table-hover\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let column of columns\">\n <th *ngIf=\"!isColumnHidden(column.prop)\" (click)=\"onSort(column.prop)\">\n {{ column.label }}\n </th>\n </ng-container>\n <th *ngIf=\"showActionColumn\" class=\"text-end\" style=\"padding-right: 6.3rem;\">{{ actionColumnLabel }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let item of pagedData; let i = index\">\n <ng-container *ngFor=\"let column of columns\">\n <td *ngIf=\"!isColumnHidden(column.prop)\">\n {{ getNestedProperty(item, column.prop) }}\n </td>\n </ng-container>\n <td *ngIf=\"showActionColumn\" class=\"text-end\">\n <div class=\"d-flex justify-content-end\">\n <div *ngIf=\"hasPermission(editPermissions) && onEditTable.observers.length > 0\" (click)=\"handleAction('edit', item, i)\" class=\"clickable-icon\" style=\"margin-right: 1.5rem;\">\n <lucide-icon name=\"square-pen\" [size]=\"20\" color=\"#2CA58D\" [strokeWidth]=\"1.75\"></lucide-icon>\n </div>\n <div *ngIf=\"hasPermission(viewPermissions) && onViewTable.observers.length > 0\" (click)=\"handleAction('view', item, i)\" class=\"clickable-icon\" style=\"margin-right: 1.5rem;\">\n <lucide-icon name=\"user-round\" [size]=\"20\" color=\"#2CA58D\" [strokeWidth]=\"1.75\"></lucide-icon>\n </div>\n <div *ngIf=\"hasPermission(deletePermissions) && onDeleteTable.observers.length > 0\" (click)=\"handleAction('delete', item, i)\" class=\"clickable-icon\" style=\"margin-right: 1.5rem;\">\n <i-lucide name=\"trash-2\" [size]=\"20\" color=\"#F26E6E\" [strokeWidth]=\"1.75\"></i-lucide>\n </div>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<div class=\"text-center pagination-controls\">\n <custom-pagination\n [totalItems]=\"totalItems\"\n [itemsPerPage]=\"defaultItemsPerPage\"\n [currentPage]=\"currentPage\"\n [showPageInfo]=\"showPageInfo\"\n (pageChange)=\"onPageChange($event)\">\n </custom-pagination>\n</div>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.clickable-icon{cursor:pointer}:host{font-family:Inter,Arial,sans-serif}.data-table-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:-.2rem}.left-section,.right-section{display:flex;align-items:center}.search-input-container{display:flex;justify-content:flex-start}.left-section .form-group{display:flex;align-items:center}.items-per-page-label{font-family:Inter,Arial,sans-serif;font-size:14px;color:#666;margin-right:.2rem}.custom-select{font-family:Inter,Arial,sans-serif;font-size:14px;color:#666;background:#fff url('data:image/svg+xml;charset=US-ASCII,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 4 5\"><path fill=\"#666\" d=\"M2 0L0 2h4L2 0zM2 5l2-2H0l2 2z\"/></svg>') no-repeat right .75rem center/8px 10px;border:1px solid #ccc;border-radius:.25rem;padding:.375rem 1.75rem .375rem .75rem;appearance:none;-webkit-appearance:none;-moz-appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem #007bff40}.table{font-family:Inter,Arial,sans-serif;font-size:var(--table-font-size, 14px);color:var(--table-font-color, #737B7B);border-collapse:separate;border-spacing:0;border-radius:8px;overflow:hidden}.table thead tr{height:60px}.table thead th{background-color:#00444c;color:#fff;font-family:Inter,Arial,sans-serif;font-size:13px;font-weight:600;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center;line-height:2.5}.table thead th:first-child{text-align:left;padding-left:1.4rem}.table tbody td{font-family:Inter,Arial,sans-serif;font-size:14px;color:#737b7b;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center}.table tbody td:first-child{text-align:left;padding-left:1.4rem}.table tbody tr:last-child td{border-bottom:.1rem solid #dcdcdc}.table tbody td{border-right:none;border-left:none}.table thead th:first-child{border-top-left-radius:0}.table thead th:last-child{border-top-right-radius:0}.table tbody tr:last-child td:first-child{border-bottom-left-radius:0}.table tbody tr:last-child td:last-child{border-bottom-right-radius:0}.btn-icon{width:24px;height:24px;background-size:cover;display:inline-block;cursor:pointer;margin-right:16px}.pagination-controls{display:flex;justify-content:center;align-items:center;margin-top:1rem}.custom-button{display:flex;align-items:center;padding:.5rem 1rem .5rem .5rem;border-radius:.25rem;transition:background-color .3s,border-color .3s,filter .3s;font-family:Inter,sans-serif;font-size:16px;font-weight:600;height:40px;letter-spacing:.005em;text-align:left;color:#fff;background-color:#2ca58d;border:none;cursor:pointer}.custom-button lucide-icon{margin-right:.5rem}.custom-button:hover{background-color:#217d6b}.custom-button:active{background-color:#3acaae}.custom-button:focus{outline:none;box-shadow:0 0 0 .2rem #2ca58d40}\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: "directive", type: i4.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i4.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i1$1.LucideAngularComponent, selector: "lucide-angular, lucide-icon, i-lucide, span-lucide", inputs: ["class", "name", "img", "color", "absoluteStrokeWidth", "size", "strokeWidth"] }, { kind: "component", type: CustomPaginationComponent, selector: "custom-pagination", inputs: ["totalItems", "itemsPerPage", "currentPage", "showPageInfo"], outputs: ["pageChange"] }, { kind: "component", type: SearchInputComponent, selector: "argenta-search-input", inputs: ["id", "label", "type", "placeholder", "value", "disabled", "readonly", "autofocus", "maxlength", "minlength", "required", "pattern", "debounceTime"], outputs: ["search", "inputChange", "change", "focus", "blur", "keyup", "keydown", "keypress"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2352
2732
  }
2353
2733
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DataTableComponent, decorators: [{
2354
2734
  type: Component,
2355
- args: [{ selector: 'argenta-list-data-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"data-table-header\" style=\"margin-top: 2.5rem;\">\n <div class=\"left-section\">\n <div class=\"form-group\">\n <label for=\"itemsPerPageSelect\" class=\"items-per-page-label\">{{ itemsPerPageLabel }}</label>\n <select\n id=\"itemsPerPageSelect\"\n class=\"form-control form-control-sm d-inline-block w-auto custom-select\"\n [(ngModel)]=\"defaultItemsPerPage\"\n (ngModelChange)=\"onItemsPerPageChange()\">\n <option *ngFor=\"let option of itemsPerPageOptions\" [value]=\"option\">{{ option }}</option>\n </select>\n </div>\n </div>\n <div class=\"right-section\">\n <button class=\"custom-button\" (click)=\"onNewButtonClick()\">\n <lucide-icon name=\"plus\" [size]=\"28\" [strokeWidth]=\"1.75\"></lucide-icon>\n {{ buttonLabel }}\n </button>\n </div>\n</div>\n\n<div class=\"search-input-container\">\n <argenta-search-input id=\"search\" label=\"\" placeholder=\"Buscar\" [(ngModel)]=\"filterDescription\" (search)=\"onSearch($event)\"></argenta-search-input>\n</div>\n\n<div class=\"table-responsive\" style=\"margin-top: 1rem;\">\n <table class=\"table table-hover\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let column of columns\">\n <th *ngIf=\"!isColumnHidden(column.prop)\" (click)=\"onSort(column.prop)\">\n {{ column.label }}\n </th>\n </ng-container>\n <th *ngIf=\"showActionColumn\" class=\"text-end\" style=\"padding-right: 6.3rem;\">{{ actionColumnLabel }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let item of pagedData; let i = index\">\n <ng-container *ngFor=\"let column of columns\">\n <td *ngIf=\"!isColumnHidden(column.prop)\">\n {{ getNestedProperty(item, column.prop) }}\n </td>\n </ng-container>\n <td *ngIf=\"showActionColumn\" class=\"text-end\">\n <div class=\"d-flex justify-content-end\">\n <div *ngIf=\"hasPermission(editPermissions) && onEditTable.observers.length > 0\" (click)=\"handleAction('edit', item, i)\" class=\"clickable-icon\" style=\"margin-right: 1.5rem;\">\n <lucide-icon name=\"square-pen\" [size]=\"20\" color=\"#2CA58D\" [strokeWidth]=\"1.75\"></lucide-icon>\n </div>\n <div *ngIf=\"hasPermission(viewPermissions) && onViewTable.observers.length > 0\" (click)=\"handleAction('view', item, i)\" class=\"clickable-icon\" style=\"margin-right: 1.5rem;\">\n <lucide-icon name=\"user-round\" [size]=\"20\" color=\"#2CA58D\" [strokeWidth]=\"1.75\"></lucide-icon>\n </div>\n <div *ngIf=\"hasPermission(deletePermissions) && onDeleteTable.observers.length > 0\" (click)=\"handleAction('delete', item, i)\" class=\"clickable-icon\" style=\"margin-right: 1.5rem;\">\n <i-lucide name=\"trash-2\" [size]=\"20\" color=\"#F26E6E\" [strokeWidth]=\"1.75\"></i-lucide>\n </div>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<div class=\"text-center pagination-controls\">\n <custom-pagination\n [totalItems]=\"totalItems\"\n [itemsPerPage]=\"defaultItemsPerPage\"\n [currentPage]=\"currentPage\"\n [showPageInfo]=\"showPageInfo\"\n (pageChange)=\"onPageChange($event)\">\n </custom-pagination>\n</div>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.clickable-icon{cursor:pointer}:host{font-family:Inter,Arial,sans-serif}.data-table-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:-.2rem}.left-section,.right-section{display:flex;align-items:center}.search-input-container{display:flex;justify-content:flex-start}.left-section .form-group{display:flex;align-items:center}.items-per-page-label{font-family:Inter,Arial,sans-serif;font-size:14px;color:#666;margin-right:.2rem}.custom-select{font-family:Inter,Arial,sans-serif;font-size:14px;color:#666;background:#fff url('data:image/svg+xml;charset=US-ASCII,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 4 5\"><path fill=\"#666\" d=\"M2 0L0 2h4L2 0zM2 5l2-2H0l2 2z\"/></svg>') no-repeat right .75rem center/8px 10px;border:1px solid #ccc;border-radius:.25rem;padding:.375rem 1.75rem .375rem .75rem;appearance:none;-webkit-appearance:none;-moz-appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem #007bff40}.table{font-family:Inter,Arial,sans-serif;font-size:var(--table-font-size, 14px);color:var(--table-font-color, #737B7B);border-collapse:separate;border-spacing:0;border-radius:8px;overflow:hidden}.table thead tr{height:60px}.table thead th{background-color:#00444c;color:#fff;font-family:Inter,Arial,sans-serif;font-size:13px;font-weight:600;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center;line-height:2.5}.table thead th:first-child{text-align:left;padding-left:1.4rem}.table tbody td{font-family:Inter,Arial,sans-serif;font-size:14px;color:#737b7b;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center}.table tbody td:first-child{text-align:left;padding-left:1.4rem}.table tbody tr:last-child td{border-bottom:.1rem solid #dcdcdc}.table tbody td{border-right:none;border-left:none}.table thead th:first-child{border-top-left-radius:0}.table thead th:last-child{border-top-right-radius:0}.table tbody tr:last-child td:first-child{border-bottom-left-radius:0}.table tbody tr:last-child td:last-child{border-bottom-right-radius:0}.btn-icon{width:24px;height:24px;background-size:cover;display:inline-block;cursor:pointer;margin-right:16px}.pagination-controls{display:flex;justify-content:center;align-items:center;margin-top:1rem}.custom-button{display:flex;align-items:center;padding:.5rem 1rem .5rem .5rem;border-radius:.25rem;transition:background-color .3s,border-color .3s,filter .3s;font-family:Inter,sans-serif;font-size:16px;font-weight:600;height:40px;letter-spacing:.005em;text-align:left;color:#fff;background-color:#2ca58d;border:none;cursor:pointer}.custom-button lucide-icon{margin-right:.5rem}.custom-button:hover{background-color:#217d6b}.custom-button:active{background-color:#3acaae}.custom-button:focus{outline:none;box-shadow:0 0 0 .2rem #2ca58d40}\n"] }]
2735
+ args: [{ selector: 'argenta-list-data-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"data-table-header\" style=\"margin-top: 2.5rem;\">\n <div class=\"left-section\">\n <div class=\"form-group\">\n <label for=\"itemsPerPageSelect\" class=\"items-per-page-label\">{{ itemsPerPageLabel }}</label>\n <select\n id=\"itemsPerPageSelect\"\n class=\"form-control form-control-sm d-inline-block w-auto custom-select\"\n [(ngModel)]=\"defaultItemsPerPage\"\n (ngModelChange)=\"onItemsPerPageChange()\">\n <option *ngFor=\"let option of itemsPerPageOptions\" [value]=\"option\">{{ option }}</option>\n </select>\n </div>\n </div>\n <div *ngIf=\"buttonLabel && buttonLabel.length > 0\" class=\"right-section\">\n <button class=\"custom-button\" (click)=\"onNewButtonClick()\">\n <lucide-icon name=\"plus\" [size]=\"28\" [strokeWidth]=\"1.75\"></lucide-icon>\n {{ buttonLabel }}\n </button>\n </div>\n</div>\n\n<div class=\"search-input-container\">\n <argenta-search-input id=\"search\" label=\"\" placeholder=\"Buscar\" [(ngModel)]=\"filterDescription\" (search)=\"onSearch($event)\"></argenta-search-input>\n</div>\n\n<div class=\"table-responsive\" style=\"margin-top: 1rem;\">\n <table class=\"table table-hover\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let column of columns\">\n <th *ngIf=\"!isColumnHidden(column.prop)\" (click)=\"onSort(column.prop)\">\n {{ column.label }}\n </th>\n </ng-container>\n <th *ngIf=\"showActionColumn\" class=\"text-end\" style=\"padding-right: 6.3rem;\">{{ actionColumnLabel }}</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let item of pagedData; let i = index\">\n <ng-container *ngFor=\"let column of columns\">\n <td *ngIf=\"!isColumnHidden(column.prop)\">\n {{ getNestedProperty(item, column.prop) }}\n </td>\n </ng-container>\n <td *ngIf=\"showActionColumn\" class=\"text-end\">\n <div class=\"d-flex justify-content-end\">\n <div *ngIf=\"hasPermission(editPermissions) && onEditTable.observers.length > 0\" (click)=\"handleAction('edit', item, i)\" class=\"clickable-icon\" style=\"margin-right: 1.5rem;\">\n <lucide-icon name=\"square-pen\" [size]=\"20\" color=\"#2CA58D\" [strokeWidth]=\"1.75\"></lucide-icon>\n </div>\n <div *ngIf=\"hasPermission(viewPermissions) && onViewTable.observers.length > 0\" (click)=\"handleAction('view', item, i)\" class=\"clickable-icon\" style=\"margin-right: 1.5rem;\">\n <lucide-icon name=\"user-round\" [size]=\"20\" color=\"#2CA58D\" [strokeWidth]=\"1.75\"></lucide-icon>\n </div>\n <div *ngIf=\"hasPermission(deletePermissions) && onDeleteTable.observers.length > 0\" (click)=\"handleAction('delete', item, i)\" class=\"clickable-icon\" style=\"margin-right: 1.5rem;\">\n <i-lucide name=\"trash-2\" [size]=\"20\" color=\"#F26E6E\" [strokeWidth]=\"1.75\"></i-lucide>\n </div>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n\n<div class=\"text-center pagination-controls\">\n <custom-pagination\n [totalItems]=\"totalItems\"\n [itemsPerPage]=\"defaultItemsPerPage\"\n [currentPage]=\"currentPage\"\n [showPageInfo]=\"showPageInfo\"\n (pageChange)=\"onPageChange($event)\">\n </custom-pagination>\n</div>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.clickable-icon{cursor:pointer}:host{font-family:Inter,Arial,sans-serif}.data-table-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:-.2rem}.left-section,.right-section{display:flex;align-items:center}.search-input-container{display:flex;justify-content:flex-start}.left-section .form-group{display:flex;align-items:center}.items-per-page-label{font-family:Inter,Arial,sans-serif;font-size:14px;color:#666;margin-right:.2rem}.custom-select{font-family:Inter,Arial,sans-serif;font-size:14px;color:#666;background:#fff url('data:image/svg+xml;charset=US-ASCII,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 4 5\"><path fill=\"#666\" d=\"M2 0L0 2h4L2 0zM2 5l2-2H0l2 2z\"/></svg>') no-repeat right .75rem center/8px 10px;border:1px solid #ccc;border-radius:.25rem;padding:.375rem 1.75rem .375rem .75rem;appearance:none;-webkit-appearance:none;-moz-appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem #007bff40}.table{font-family:Inter,Arial,sans-serif;font-size:var(--table-font-size, 14px);color:var(--table-font-color, #737B7B);border-collapse:separate;border-spacing:0;border-radius:8px;overflow:hidden}.table thead tr{height:60px}.table thead th{background-color:#00444c;color:#fff;font-family:Inter,Arial,sans-serif;font-size:13px;font-weight:600;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center;line-height:2.5}.table thead th:first-child{text-align:left;padding-left:1.4rem}.table tbody td{font-family:Inter,Arial,sans-serif;font-size:14px;color:#737b7b;padding:10px;border-bottom:.1rem solid #dcdcdc;text-align:center}.table tbody td:first-child{text-align:left;padding-left:1.4rem}.table tbody tr:last-child td{border-bottom:.1rem solid #dcdcdc}.table tbody td{border-right:none;border-left:none}.table thead th:first-child{border-top-left-radius:0}.table thead th:last-child{border-top-right-radius:0}.table tbody tr:last-child td:first-child{border-bottom-left-radius:0}.table tbody tr:last-child td:last-child{border-bottom-right-radius:0}.btn-icon{width:24px;height:24px;background-size:cover;display:inline-block;cursor:pointer;margin-right:16px}.pagination-controls{display:flex;justify-content:center;align-items:center;margin-top:1rem}.custom-button{display:flex;align-items:center;padding:.5rem 1rem .5rem .5rem;border-radius:.25rem;transition:background-color .3s,border-color .3s,filter .3s;font-family:Inter,sans-serif;font-size:16px;font-weight:600;height:40px;letter-spacing:.005em;text-align:left;color:#fff;background-color:#2ca58d;border:none;cursor:pointer}.custom-button lucide-icon{margin-right:.5rem}.custom-button:hover{background-color:#217d6b}.custom-button:active{background-color:#3acaae}.custom-button:focus{outline:none;box-shadow:0 0 0 .2rem #2ca58d40}\n"] }]
2356
2736
  }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: AuthService }, { type: RefreshService }]; }, propDecorators: { columns: [{
2357
2737
  type: Input
2358
2738
  }], hiddenColumns: [{
@@ -2499,7 +2879,7 @@ class TextareaComponent {
2499
2879
  [readonly]="readonly"
2500
2880
  [autofocus]="autofocus"></textarea>
2501
2881
  </div>
2502
- `, isInline: true, styles: [".form-group{margin-bottom:1rem}.form-label{font-family:Arial,sans-serif;color:#333;font-size:1rem;font-weight:700}\n"], dependencies: [{ kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2882
+ `, isInline: true, styles: [".form-group{margin-bottom:1rem}.form-label{font-family:Arial,sans-serif;color:#333;font-size:1rem;font-weight:700}\n"], dependencies: [{ kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2503
2883
  }
2504
2884
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TextareaComponent, decorators: [{
2505
2885
  type: Component,
@@ -2629,7 +3009,7 @@ class TreeNodeComponent {
2629
3009
  node.collapsed = !node.collapsed;
2630
3010
  }
2631
3011
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TreeNodeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2632
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TreeNodeComponent, selector: "argenta-custom-tree-node", inputs: { title: "title", nodes: "nodes", isRoot: "isRoot" }, outputs: { nodeSelected: "nodeSelected" }, ngImport: i0, template: "<div *ngIf=\"isRoot\" class=\"tree-title\">{{ title || 'Tree Node' }}</div>\n<ul class=\"tree\">\n <li *ngFor=\"let node of nodes\">\n <div class=\"node-content\">\n <!-- Exibir a seta apenas se o n\u00F3 tiver filhos n\u00E3o vazios -->\n <span *ngIf=\"node.children && node.children.length > 0\" class=\"toggle-icon\" (click)=\"toggleCollapse(node)\"\n [ngClass]=\"{'collapsed-icon': node.collapsed, 'expanded-icon': !node.collapsed}\">\n {{ node.collapsed ? '\u25B6' : '\u25BC' }}\n </span>\n <!-- Exibir a bolinha cinza se o n\u00F3 n\u00E3o tiver filhos -->\n <span *ngIf=\"!node.children || node.children.length === 0\" class=\"dot\"></span>\n <label class=\"custom-checkbox\">\n <input type=\"checkbox\" [checked]=\"node.selected\" (change)=\"onNodeSelected(node, $event)\" />\n <span class=\"checkmark\"></span>\n </label>\n <label class=\"node-label\">{{ node.name }}</label>\n </div>\n <!-- Renderizar recursivamente apenas se o n\u00F3 tiver filhos n\u00E3o vazios e n\u00E3o estiver colapsado -->\n <argenta-custom-tree-node *ngIf=\"node.children && node.children.length > 0 && !node.collapsed\" [nodes]=\"node.children\" [isRoot]=\"false\" (nodeSelected)=\"onChildNodeSelected(node)\"></argenta-custom-tree-node>\n </li>\n</ul>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap\";.tree{list-style-type:none;margin:0;padding:0;position:relative;font-family:Inter,sans-serif}.tree li{margin:0;padding:0 0 0 2em;line-height:2em;position:relative;font-size:14px;transition:all .3s ease}.tree li:before{content:\"\";position:absolute;top:0;left:0;border-left:1px solid #ccc;bottom:.75em;transition:border-color .3s ease}.tree li:after{content:\"\";position:absolute;top:1em;left:0;border-top:1px solid #ccc;width:1em;transition:border-color .3s ease}.tree li:last-child:before{height:1em}.node-content{display:flex;align-items:center;color:#333;transition:color .3s ease}.node-content:hover .node-label{color:#00444c;box-shadow:0 4px 8px #0000001a}.toggle-icon{cursor:pointer;margin-right:.5em;font-size:1em;transition:transform .3s ease,color .3s ease}.collapsed-icon{color:orange}.expanded-icon{color:green}.node-content input[type=checkbox]{display:none}.custom-checkbox{position:relative;display:inline-flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none}.checkmark{position:relative;height:14px;width:14px;background-color:#fff;border:2px solid #00444C;border-radius:3px;transition:background-color .3s ease,border-color .3s ease}.custom-checkbox input:checked+.checkmark{background-color:#00444c;border-color:#00444c;transition:background-color .3s ease,border-color .3s ease}.custom-checkbox .checkmark:after{content:\"\";position:absolute;display:none;left:4px;top:1px;width:3px;height:8px;border:solid white;border-width:0 2px 2px 0;transform:rotate(45deg);transition:transform .3s ease}.custom-checkbox input:checked+.checkmark:after{display:block}.node-label{margin-left:.5em;transition:color .3s ease,box-shadow .3s ease}.node-content input{margin-right:.5em;transition:transform .3s ease}.tree-title{font-weight:600;margin-bottom:10px;font-size:18px;color:#00444c;transition:color .3s ease}.dot{width:8px;height:8px;background-color:#828282;border-radius:50%;margin-right:8px;opacity:1}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TreeNodeComponent, selector: "argenta-custom-tree-node", inputs: ["title", "nodes", "isRoot"], outputs: ["nodeSelected"] }] }); }
3012
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TreeNodeComponent, selector: "argenta-custom-tree-node", inputs: { title: "title", nodes: "nodes", isRoot: "isRoot" }, outputs: { nodeSelected: "nodeSelected" }, ngImport: i0, template: "<div *ngIf=\"isRoot\" class=\"tree-title\">{{ title || 'Tree Node' }}</div>\n<ul class=\"tree\">\n <li *ngFor=\"let node of nodes\">\n <div class=\"node-content\">\n <!-- Exibir a seta apenas se o n\u00F3 tiver filhos n\u00E3o vazios -->\n <span *ngIf=\"node.children && node.children.length > 0\" class=\"toggle-icon\" (click)=\"toggleCollapse(node)\"\n [ngClass]=\"{'collapsed-icon': node.collapsed, 'expanded-icon': !node.collapsed}\">\n {{ node.collapsed ? '\u25B6' : '\u25BC' }}\n </span>\n <!-- Exibir a bolinha cinza se o n\u00F3 n\u00E3o tiver filhos -->\n <span *ngIf=\"!node.children || node.children.length === 0\" class=\"dot\"></span>\n <label class=\"custom-checkbox\">\n <input type=\"checkbox\" [checked]=\"node.selected\" (change)=\"onNodeSelected(node, $event)\" />\n <span class=\"checkmark\"></span>\n </label>\n <label class=\"node-label\">{{ node.name }}</label>\n </div>\n <!-- Renderizar recursivamente apenas se o n\u00F3 tiver filhos n\u00E3o vazios e n\u00E3o estiver colapsado -->\n <argenta-custom-tree-node *ngIf=\"node.children && node.children.length > 0 && !node.collapsed\" [nodes]=\"node.children\" [isRoot]=\"false\" (nodeSelected)=\"onChildNodeSelected(node)\"></argenta-custom-tree-node>\n </li>\n</ul>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap\";.tree{list-style-type:none;margin:0;padding:0;position:relative;font-family:Inter,sans-serif}.tree li{margin:0;padding:0 0 0 2em;line-height:2em;position:relative;font-size:14px;transition:all .3s ease}.tree li:before{content:\"\";position:absolute;top:0;left:0;border-left:1px solid #ccc;bottom:.75em;transition:border-color .3s ease}.tree li:after{content:\"\";position:absolute;top:1em;left:0;border-top:1px solid #ccc;width:1em;transition:border-color .3s ease}.tree li:last-child:before{height:1em}.node-content{display:flex;align-items:center;color:#333;transition:color .3s ease}.node-content:hover .node-label{color:#00444c;box-shadow:0 4px 8px #0000001a}.toggle-icon{cursor:pointer;margin-right:.5em;font-size:1em;transition:transform .3s ease,color .3s ease}.collapsed-icon{color:orange}.expanded-icon{color:green}.node-content input[type=checkbox]{display:none}.custom-checkbox{position:relative;display:inline-flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none}.checkmark{position:relative;height:14px;width:14px;background-color:#fff;border:2px solid #00444C;border-radius:3px;transition:background-color .3s ease,border-color .3s ease}.custom-checkbox input:checked+.checkmark{background-color:#00444c;border-color:#00444c;transition:background-color .3s ease,border-color .3s ease}.custom-checkbox .checkmark:after{content:\"\";position:absolute;display:none;left:4px;top:1px;width:3px;height:8px;border:solid white;border-width:0 2px 2px 0;transform:rotate(45deg);transition:transform .3s ease}.custom-checkbox input:checked+.checkmark:after{display:block}.node-label{margin-left:.5em;transition:color .3s ease,box-shadow .3s ease}.node-content input{margin-right:.5em;transition:transform .3s ease}.tree-title{font-weight:600;margin-bottom:10px;font-size:18px;color:#00444c;transition:color .3s ease}.dot{width:8px;height:8px;background-color:#828282;border-radius:50%;margin-right:8px;opacity:1}\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: TreeNodeComponent, selector: "argenta-custom-tree-node", inputs: ["title", "nodes", "isRoot"], outputs: ["nodeSelected"] }] }); }
2633
3013
  }
2634
3014
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TreeNodeComponent, decorators: [{
2635
3015
  type: Component,
@@ -2644,6 +3024,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
2644
3024
  type: Output
2645
3025
  }] } });
2646
3026
 
3027
+ class JsonViewerComponent {
3028
+ constructor() {
3029
+ this.isRoot = true;
3030
+ this.allExpanded = true;
3031
+ this.expandedMap = new Map();
3032
+ }
3033
+ toggleAll() {
3034
+ this.allExpanded = !this.allExpanded;
3035
+ this.expandedMap.clear();
3036
+ }
3037
+ toggleExpand(key) {
3038
+ const currentState = this.isExpanded(key);
3039
+ this.expandedMap.set(key, !currentState);
3040
+ }
3041
+ isObject(val) {
3042
+ return val !== null && typeof val === 'object';
3043
+ }
3044
+ objectKeys(obj) {
3045
+ return Object.keys(obj);
3046
+ }
3047
+ isExpanded(key) {
3048
+ return this.expandedMap.has(key) ? this.expandedMap.get(key) : this.allExpanded;
3049
+ }
3050
+ copyJson() {
3051
+ const jsonString = JSON.stringify(this.jsonData, null, 2);
3052
+ navigator.clipboard.writeText(jsonString).then(() => {
3053
+ alert('JSON copiado com sucesso!');
3054
+ }).catch(err => {
3055
+ console.error('Error copying JSON to clipboard:', err);
3056
+ });
3057
+ }
3058
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: JsonViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3059
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: JsonViewerComponent, selector: "argenta-json-viewer", inputs: { jsonData: "jsonData", isRoot: "isRoot" }, ngImport: i0, template: "<div class=\"json-viewer-box\">\n <div class=\"toolbar\">\n <button *ngIf=\"isRoot\" class=\"action-button copy-button\" (click)=\"copyJson()\">Copiar</button>\n <button *ngIf=\"isRoot\" class=\"action-button toggle-button\" (click)=\"toggleAll()\">\n {{ allExpanded ? '\u25BC Ocultar Tudo' : '\u25BA Exibir Tudo' }}\n </button>\n </div>\n \n <div class=\"json-content\">\n <div *ngIf=\"isObject(jsonData)\">\n <div class=\"json-pair\" *ngFor=\"let key of objectKeys(jsonData)\">\n <span class=\"key\">\n {{ key }}:\n <button class=\"minimal-toggle-button\" (click)=\"toggleExpand(key)\">\n {{ isExpanded(key) ? '\u25BC' : '\u25BA' }}\n </button>\n </span>\n \n <div class=\"nested-json\" *ngIf=\"isExpanded(key)\">\n <argenta-json-viewer [jsonData]=\"jsonData[key]\" [isRoot]=\"false\"></argenta-json-viewer>\n </div>\n <span *ngIf=\"!isExpanded(key) && isObject(jsonData[key])\">[...]</span>\n </div>\n </div>\n <span *ngIf=\"!isObject(jsonData)\">\n {{ jsonData }}\n </span>\n </div>\n </div>\n ", styles: [".json-viewer-box{border:1px solid #ccc;padding:10px;border-radius:8px;font-family:Arial,sans-serif;background-color:#f9f9f9}.json-viewer-box .toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;padding-bottom:5px;border-bottom:1px solid #ddd}.json-viewer-box .action-button{background-color:#4caf50;color:#fff;border:none;padding:8px 16px;font-size:14px;border-radius:4px;cursor:pointer;transition:background-color .3s ease}.json-viewer-box .action-button:hover{background-color:#45a049}.json-viewer-box .minimal-toggle-button{background:none;border:none;color:#007bff;cursor:pointer;font-size:12px;margin-left:5px;padding:0;line-height:1}.json-viewer-box .minimal-toggle-button:hover{color:#0056b3}.json-viewer-box .json-content{margin-top:10px}.json-viewer-box .json-content .json-pair{margin-bottom:5px}.json-viewer-box .json-content .json-pair .key{font-weight:700;margin-right:5px;display:flex;align-items:center}\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: JsonViewerComponent, selector: "argenta-json-viewer", inputs: ["jsonData", "isRoot"] }] }); }
3060
+ }
3061
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: JsonViewerComponent, decorators: [{
3062
+ type: Component,
3063
+ args: [{ selector: 'argenta-json-viewer', template: "<div class=\"json-viewer-box\">\n <div class=\"toolbar\">\n <button *ngIf=\"isRoot\" class=\"action-button copy-button\" (click)=\"copyJson()\">Copiar</button>\n <button *ngIf=\"isRoot\" class=\"action-button toggle-button\" (click)=\"toggleAll()\">\n {{ allExpanded ? '\u25BC Ocultar Tudo' : '\u25BA Exibir Tudo' }}\n </button>\n </div>\n \n <div class=\"json-content\">\n <div *ngIf=\"isObject(jsonData)\">\n <div class=\"json-pair\" *ngFor=\"let key of objectKeys(jsonData)\">\n <span class=\"key\">\n {{ key }}:\n <button class=\"minimal-toggle-button\" (click)=\"toggleExpand(key)\">\n {{ isExpanded(key) ? '\u25BC' : '\u25BA' }}\n </button>\n </span>\n \n <div class=\"nested-json\" *ngIf=\"isExpanded(key)\">\n <argenta-json-viewer [jsonData]=\"jsonData[key]\" [isRoot]=\"false\"></argenta-json-viewer>\n </div>\n <span *ngIf=\"!isExpanded(key) && isObject(jsonData[key])\">[...]</span>\n </div>\n </div>\n <span *ngIf=\"!isObject(jsonData)\">\n {{ jsonData }}\n </span>\n </div>\n </div>\n ", styles: [".json-viewer-box{border:1px solid #ccc;padding:10px;border-radius:8px;font-family:Arial,sans-serif;background-color:#f9f9f9}.json-viewer-box .toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;padding-bottom:5px;border-bottom:1px solid #ddd}.json-viewer-box .action-button{background-color:#4caf50;color:#fff;border:none;padding:8px 16px;font-size:14px;border-radius:4px;cursor:pointer;transition:background-color .3s ease}.json-viewer-box .action-button:hover{background-color:#45a049}.json-viewer-box .minimal-toggle-button{background:none;border:none;color:#007bff;cursor:pointer;font-size:12px;margin-left:5px;padding:0;line-height:1}.json-viewer-box .minimal-toggle-button:hover{color:#0056b3}.json-viewer-box .json-content{margin-top:10px}.json-viewer-box .json-content .json-pair{margin-bottom:5px}.json-viewer-box .json-content .json-pair .key{font-weight:700;margin-right:5px;display:flex;align-items:center}\n"] }]
3064
+ }], propDecorators: { jsonData: [{
3065
+ type: Input
3066
+ }], isRoot: [{
3067
+ type: Input
3068
+ }] } });
3069
+
2647
3070
  // Select some icons (use an object, not an array)
2648
3071
  class LucideIconsModule {
2649
3072
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LucideIconsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
@@ -2686,7 +3109,10 @@ class ComponentsModule {
2686
3109
  SearchCustomerComponent,
2687
3110
  TabComponent,
2688
3111
  FileUploadComponent,
2689
- MultiSelectCategoryComponent], imports: [CommonModule,
3112
+ MultiSelectCategoryComponent,
3113
+ CalendarArgentaComponent,
3114
+ AccordionArgentaComponent,
3115
+ JsonViewerComponent], imports: [CommonModule,
2690
3116
  FormsModule,
2691
3117
  ReactiveFormsModule,
2692
3118
  NgSelectModule,
@@ -2720,7 +3146,10 @@ class ComponentsModule {
2720
3146
  SearchCustomerComponent,
2721
3147
  TabComponent,
2722
3148
  FileUploadComponent,
2723
- MultiSelectCategoryComponent] }); }
3149
+ MultiSelectCategoryComponent,
3150
+ CalendarArgentaComponent,
3151
+ AccordionArgentaComponent,
3152
+ JsonViewerComponent] }); }
2724
3153
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ComponentsModule, imports: [CommonModule,
2725
3154
  FormsModule,
2726
3155
  ReactiveFormsModule,
@@ -2761,6 +3190,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
2761
3190
  TabComponent,
2762
3191
  FileUploadComponent,
2763
3192
  MultiSelectCategoryComponent,
3193
+ CalendarArgentaComponent,
3194
+ AccordionArgentaComponent,
3195
+ JsonViewerComponent,
2764
3196
  ],
2765
3197
  imports: [
2766
3198
  CommonModule,
@@ -2801,6 +3233,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
2801
3233
  TabComponent,
2802
3234
  FileUploadComponent,
2803
3235
  MultiSelectCategoryComponent,
3236
+ CalendarArgentaComponent,
3237
+ AccordionArgentaComponent,
3238
+ JsonViewerComponent,
2804
3239
  ],
2805
3240
  }]
2806
3241
  }] });
@@ -2857,7 +3292,7 @@ class ConfirmationService {
2857
3292
  this.modalRef = null;
2858
3293
  }
2859
3294
  }
2860
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ConfirmationService, deps: [{ token: i1.NgbModal }], target: i0.ɵɵFactoryTarget.Injectable }); }
3295
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ConfirmationService, deps: [{ token: i1$2.NgbModal }], target: i0.ɵɵFactoryTarget.Injectable }); }
2861
3296
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ConfirmationService, providedIn: 'root' }); }
2862
3297
  }
2863
3298
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ConfirmationService, decorators: [{
@@ -2865,7 +3300,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
2865
3300
  args: [{
2866
3301
  providedIn: 'root'
2867
3302
  }]
2868
- }], ctorParameters: function () { return [{ type: i1.NgbModal }]; } });
3303
+ }], ctorParameters: function () { return [{ type: i1$2.NgbModal }]; } });
2869
3304
 
2870
3305
  class DataPaginateService {
2871
3306
  constructor(http) {
@@ -2962,5 +3397,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
2962
3397
  * Generated bundle index. Do not edit.
2963
3398
  */
2964
3399
 
2965
- export { AlertComponent, AppBackgroundComponent, AutofocusDirective, BadgeComponent, BasicRegistrationComponent, ButtonClasses, ButtonComponent, CardComponent, CepMaskDirective, CheckboxComponent, CnpjMaskDirective, CodeHighlightComponent, ComponentsModule, ConfirmationComponent, ConfirmationService, CpfMaskDirective, CustomPaginationComponent, CustomSwitchComponent, DataPaginateService, DataTableComponent, FileUploadComponent, InputComponent, LibPortalAngularModule, LucideIconsModule, MultiSelectCategoryComponent, MultiSelectComponent, NotificationService, RadioComponent, RefreshService, RouterParameterService, SearchCustomerComponent, SearchInputComponent, SelectComponent, TabComponent, TextareaComponent, TreeNodeComponent };
3400
+ export { AccordionArgentaComponent, AlertComponent, AppBackgroundComponent, AutofocusDirective, BadgeComponent, BasicRegistrationComponent, ButtonClasses, ButtonComponent, CalendarArgentaComponent, CardComponent, CepMaskDirective, CheckboxComponent, CnpjMaskDirective, CodeHighlightComponent, ComponentsModule, ConfirmationComponent, ConfirmationService, CpfMaskDirective, CustomPaginationComponent, CustomSwitchComponent, DataPaginateService, DataTableComponent, FileUploadComponent, InputComponent, JsonViewerComponent, LibPortalAngularModule, LucideIconsModule, MultiSelectCategoryComponent, MultiSelectComponent, NotificationService, RadioComponent, RefreshService, RouterParameterService, SearchCustomerComponent, SearchInputComponent, SelectComponent, TabComponent, TextareaComponent, TreeNodeComponent };
2966
3401
  //# sourceMappingURL=lib-portal-angular.mjs.map