ngx-opalbytes-components 1.17.0 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i1 from '@angular/common';
|
|
2
2
|
import { CommonModule, isPlatformBrowser, NgTemplateOutlet, NgOptimizedImage } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { EventEmitter, Input, Output, Component, ViewChild, inject, ElementRef, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, NgModule, ContentChildren, Directive, TemplateRef, ContentChild, signal, PLATFORM_ID, ViewChildren, HostBinding, Injectable } from '@angular/core';
|
|
4
|
+
import { EventEmitter, Input, Output, Component, ViewChild, inject, ElementRef, ChangeDetectorRef, Renderer2, ViewContainerRef, forwardRef, HostListener, ChangeDetectionStrategy, ViewEncapsulation, NgModule, ContentChildren, Directive, TemplateRef, ContentChild, signal, PLATFORM_ID, ViewChildren, HostBinding, Injectable } from '@angular/core';
|
|
5
5
|
import * as i3 from '@angular/material/tooltip';
|
|
6
6
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
7
7
|
import { LucideDynamicIcon } from '@lucide/angular';
|
|
@@ -12,20 +12,22 @@ import * as i2$1 from '@angular/material/datepicker';
|
|
|
12
12
|
import { MatDatepickerModule, MatDateRangeInput } from '@angular/material/datepicker';
|
|
13
13
|
import * as i1$1 from '@angular/material/form-field';
|
|
14
14
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
15
|
-
import * as
|
|
15
|
+
import * as i3$1 from '@angular/material/input';
|
|
16
16
|
import { MatInputModule } from '@angular/material/input';
|
|
17
|
-
import * as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import * as
|
|
17
|
+
import * as i1$4 from '@angular/cdk/overlay';
|
|
18
|
+
import { Overlay, OverlayModule } from '@angular/cdk/overlay';
|
|
19
|
+
import { TemplatePortal, ComponentPortal } from '@angular/cdk/portal';
|
|
20
|
+
import * as i2$2 from '@angular/cdk/scrolling';
|
|
21
|
+
import { ScrollDispatcher, CdkScrollable } from '@angular/cdk/scrolling';
|
|
22
|
+
import { BehaviorSubject, Subscription, combineLatest, startWith, map, Subject } from 'rxjs';
|
|
23
|
+
import * as i4 from '@angular/material/icon';
|
|
21
24
|
import { MatIconModule } from '@angular/material/icon';
|
|
22
25
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import * as i2$2 from '@angular/material/button';
|
|
26
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
27
|
+
import * as i2$3 from '@angular/material/button';
|
|
26
28
|
import { MatButtonModule } from '@angular/material/button';
|
|
27
29
|
import { MatCardModule } from '@angular/material/card';
|
|
28
|
-
import * as i3$
|
|
30
|
+
import * as i3$2 from '@angular/material/checkbox';
|
|
29
31
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
30
32
|
import { MatChipsModule } from '@angular/material/chips';
|
|
31
33
|
import * as i1$3 from '@angular/material/core';
|
|
@@ -34,7 +36,7 @@ import { MatDialogModule } from '@angular/material/dialog';
|
|
|
34
36
|
import { MatDividerModule } from '@angular/material/divider';
|
|
35
37
|
import { MatExpansionModule } from '@angular/material/expansion';
|
|
36
38
|
import { MatListModule } from '@angular/material/list';
|
|
37
|
-
import * as i5
|
|
39
|
+
import * as i5 from '@angular/material/menu';
|
|
38
40
|
import { MatMenuModule } from '@angular/material/menu';
|
|
39
41
|
import * as i1$2 from '@angular/material/paginator';
|
|
40
42
|
import { MatPaginatorModule, MatPaginatorIntl, MatPaginator } from '@angular/material/paginator';
|
|
@@ -51,11 +53,10 @@ import { MatSortModule, MatSort } from '@angular/material/sort';
|
|
|
51
53
|
import * as i8 from '@angular/material/table';
|
|
52
54
|
import { MatTableModule, MatTableDataSource } from '@angular/material/table';
|
|
53
55
|
import { MatTabsModule } from '@angular/material/tabs';
|
|
54
|
-
import * as i4$
|
|
56
|
+
import * as i4$1 from '@angular/material/timepicker';
|
|
55
57
|
import { MatTimepickerModule } from '@angular/material/timepicker';
|
|
56
58
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
57
59
|
import { MatTreeModule } from '@angular/material/tree';
|
|
58
|
-
import { ComponentPortal } from '@angular/cdk/portal';
|
|
59
60
|
import { LiveAnnouncer } from '@angular/cdk/a11y';
|
|
60
61
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
61
62
|
|
|
@@ -73,11 +74,12 @@ class CaoBaseButtonComponent {
|
|
|
73
74
|
dataCy;
|
|
74
75
|
iconColor;
|
|
75
76
|
strokeWidthIcon = 1;
|
|
77
|
+
minTextToTooltip = 20;
|
|
76
78
|
ngOnInit() {
|
|
77
79
|
if (!this.dataCy) {
|
|
78
80
|
this.dataCy = `btn-${this.buttonText.replace(/\s+/g, '-').toLowerCase()}`;
|
|
79
81
|
}
|
|
80
|
-
if (!this.tooltip && this.buttonText.length >=
|
|
82
|
+
if (!this.tooltip && this.buttonText.length >= this.minTextToTooltip) {
|
|
81
83
|
this.tooltip = this.buttonText;
|
|
82
84
|
}
|
|
83
85
|
}
|
|
@@ -87,7 +89,7 @@ class CaoBaseButtonComponent {
|
|
|
87
89
|
}
|
|
88
90
|
}
|
|
89
91
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoBaseButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
90
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: CaoBaseButtonComponent, isStandalone: true, selector: "cao-button", inputs: { buttonText: "buttonText", isDarkMode: "isDarkMode", isDisabled: "isDisabled", isLoading: "isLoading", btnClass: "btnClass", tooltip: "tooltip", trailingIcon: "trailingIcon", leadingIcon: "leadingIcon", isLucideIcon: "isLucideIcon", dataCy: "dataCy", iconColor: "iconColor", strokeWidthIcon: "strokeWidthIcon" }, outputs: { buttonClick: "buttonClick" }, ngImport: i0, template: "<button\n type=\"button\"\n class=\"base-button\"\n matTooltipPosition=\"below\"\n matTooltipClass=\"custom-arrow-tooltip\"\n [matTooltip]=\"tooltip\"\n [matTooltipDisabled]=\"!tooltip\"\n [class.dark-mode]=\"isDarkMode\"\n [class.disabled]=\"isDisabled\"\n [class.loading]=\"isLoading\"\n [disabled]=\"isDisabled || isLoading\"\n [attr.data-cy]=\"dataCy\"\n (click)=\"onClick()\">\n @if (leadingIcon) {\n <span class=\"leading-icon\">\n @if (isLucideIcon) {\n <svg [lucideIcon]=\"leadingIcon\" [style.color]=\"iconColor\" [strokeWidth]=\"strokeWidthIcon\"></svg>\n } @else {\n <img alt=\"icon\" [src]=\"leadingIcon\" />\n }\n </span>\n } {{ buttonText }} @if (trailingIcon) {\n <span class=\"trailing-icon\">\n @if (isLucideIcon) {\n <svg [lucideIcon]=\"trailingIcon\" [style.color]=\"iconColor\" [strokeWidth]=\"strokeWidthIcon\"></svg>\n } @else {\n <img alt=\"icon\" [src]=\"trailingIcon\" />\n }\n </span>\n } @if (isLoading) {\n <span class=\"loader\"></span>\n }\n</button>\n", styles: [".base-button{display:flex;gap:5px;width:100%;align-items:center;justify-content:center;cursor:pointer}.base-button.disabled{cursor:not-allowed}.base-button.loading{cursor:progress}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: LucideDynamicIcon, selector: "svg[lucideIcon]", inputs: ["lucideIcon"] }] });
|
|
92
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: CaoBaseButtonComponent, isStandalone: true, selector: "cao-button", inputs: { buttonText: "buttonText", isDarkMode: "isDarkMode", isDisabled: "isDisabled", isLoading: "isLoading", btnClass: "btnClass", tooltip: "tooltip", trailingIcon: "trailingIcon", leadingIcon: "leadingIcon", isLucideIcon: "isLucideIcon", dataCy: "dataCy", iconColor: "iconColor", strokeWidthIcon: "strokeWidthIcon", minTextToTooltip: "minTextToTooltip" }, outputs: { buttonClick: "buttonClick" }, ngImport: i0, template: "<button\n type=\"button\"\n class=\"base-button\"\n matTooltipPosition=\"below\"\n matTooltipClass=\"custom-arrow-tooltip\"\n [matTooltip]=\"tooltip\"\n [matTooltipDisabled]=\"!tooltip\"\n [class.dark-mode]=\"isDarkMode\"\n [class.disabled]=\"isDisabled\"\n [class.loading]=\"isLoading\"\n [disabled]=\"isDisabled || isLoading\"\n [attr.data-cy]=\"dataCy\"\n (click)=\"onClick()\">\n @if (leadingIcon) {\n <span class=\"leading-icon\">\n @if (isLucideIcon) {\n <svg [lucideIcon]=\"leadingIcon\" [style.color]=\"iconColor\" [strokeWidth]=\"strokeWidthIcon\"></svg>\n } @else {\n <img alt=\"icon\" [src]=\"leadingIcon\" />\n }\n </span>\n } {{ buttonText }} @if (trailingIcon) {\n <span class=\"trailing-icon\">\n @if (isLucideIcon) {\n <svg [lucideIcon]=\"trailingIcon\" [style.color]=\"iconColor\" [strokeWidth]=\"strokeWidthIcon\"></svg>\n } @else {\n <img alt=\"icon\" [src]=\"trailingIcon\" />\n }\n </span>\n } @if (isLoading) {\n <span class=\"loader\"></span>\n }\n</button>\n", styles: [".base-button{display:flex;gap:5px;width:100%;align-items:center;justify-content:center;cursor:pointer}.base-button.disabled{cursor:not-allowed}.base-button.loading{cursor:progress}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: LucideDynamicIcon, selector: "svg[lucideIcon]", inputs: ["lucideIcon"] }] });
|
|
91
93
|
}
|
|
92
94
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoBaseButtonComponent, decorators: [{
|
|
93
95
|
type: Component,
|
|
@@ -118,6 +120,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
118
120
|
type: Input
|
|
119
121
|
}], strokeWidthIcon: [{
|
|
120
122
|
type: Input
|
|
123
|
+
}], minTextToTooltip: [{
|
|
124
|
+
type: Input
|
|
121
125
|
}] } });
|
|
122
126
|
|
|
123
127
|
class CaoBaseInput {
|
|
@@ -368,103 +372,293 @@ class CaoAutocompleteComponent {
|
|
|
368
372
|
autocompleteBgColor = 'white';
|
|
369
373
|
strokeWidthIcon = 1;
|
|
370
374
|
isDisabled = false;
|
|
375
|
+
inputHeigth = '50px';
|
|
376
|
+
checkIcon = '✓';
|
|
377
|
+
showCheckIcon = true;
|
|
378
|
+
isLucideCheckIcon = false;
|
|
371
379
|
itemSelected = new EventEmitter();
|
|
372
380
|
blurEvent = new EventEmitter();
|
|
373
381
|
focusEvent = new EventEmitter();
|
|
374
382
|
leadingIconClick = new EventEmitter();
|
|
375
383
|
trailingIconClick = new EventEmitter();
|
|
376
|
-
|
|
384
|
+
inputEl;
|
|
385
|
+
wrapperEl;
|
|
386
|
+
// CORREÇÃO: ViewChild para o ng-template
|
|
387
|
+
panelTemplate;
|
|
388
|
+
/** controla apenas o texto digitado / exibido no input */
|
|
377
389
|
internalControl = new FormControl("");
|
|
378
390
|
filteredOptions$;
|
|
391
|
+
filteredOptionsList = [];
|
|
379
392
|
isFocused = false;
|
|
380
|
-
|
|
393
|
+
isPanelOpen = false;
|
|
394
|
+
activeIndex = -1;
|
|
395
|
+
static uidSeq = 0;
|
|
396
|
+
listboxId = `cao-autocomplete-listbox-${CaoAutocompleteComponent.uidSeq++}`;
|
|
381
397
|
selectedOption = null;
|
|
382
398
|
options$ = new BehaviorSubject([]);
|
|
383
|
-
|
|
399
|
+
/** indica se o valor atual do internalControl foi digitado pelo usuário (e não escrito programaticamente) */
|
|
400
|
+
isUserTyping = false;
|
|
401
|
+
el = inject((ElementRef));
|
|
402
|
+
cdr = inject(ChangeDetectorRef);
|
|
403
|
+
renderer = inject(Renderer2);
|
|
404
|
+
// Injeções do CDK Overlay
|
|
405
|
+
overlay = inject(Overlay);
|
|
406
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
407
|
+
scrollDispatcher = inject(ScrollDispatcher);
|
|
408
|
+
sub = new Subscription();
|
|
409
|
+
overlayRef = null;
|
|
410
|
+
portal = null;
|
|
384
411
|
onChange = () => { };
|
|
385
412
|
onTouched = () => { };
|
|
386
413
|
ngOnInit() {
|
|
414
|
+
this.setInputHeight();
|
|
387
415
|
this.filteredOptions$ = combineLatest([
|
|
388
416
|
this.internalControl.valueChanges.pipe(startWith("")),
|
|
389
417
|
this.options$,
|
|
390
418
|
]).pipe(map(([value]) => this.filter(value || "")));
|
|
391
|
-
this.
|
|
392
|
-
|
|
393
|
-
this.
|
|
419
|
+
this.sub.add(this.filteredOptions$.subscribe((list) => {
|
|
420
|
+
this.filteredOptionsList = list;
|
|
421
|
+
this.activeIndex = list.length ? 0 : -1;
|
|
422
|
+
// Atualiza o overlay se estiver aberto e anexado
|
|
423
|
+
if (this.isPanelOpen && this.portal && this.overlayRef?.hasAttached()) {
|
|
424
|
+
this.overlayRef?.updatePosition();
|
|
425
|
+
}
|
|
426
|
+
}));
|
|
427
|
+
this.sub.add(this.control.valueChanges.subscribe((value) => {
|
|
428
|
+
this.writeDisplayValue(value);
|
|
394
429
|
this.selectedOption = value && typeof value === "object" ? value : null;
|
|
395
|
-
});
|
|
430
|
+
}));
|
|
396
431
|
this.setStyle();
|
|
432
|
+
this.setupOverlay();
|
|
397
433
|
}
|
|
398
|
-
|
|
399
|
-
|
|
434
|
+
ngAfterViewInit() {
|
|
435
|
+
// CORREÇÃO: Usando o TemplateRef obtido do ViewChild
|
|
436
|
+
this.portal = new TemplatePortal(this.panelTemplate, this.viewContainerRef);
|
|
400
437
|
}
|
|
401
438
|
ngOnChanges(changes) {
|
|
402
439
|
if (changes['options']) {
|
|
403
440
|
this.options$.next(changes['options'].currentValue ?? []);
|
|
404
441
|
}
|
|
405
442
|
}
|
|
443
|
+
ngOnDestroy() {
|
|
444
|
+
this.sub.unsubscribe();
|
|
445
|
+
this.closeOverlay();
|
|
446
|
+
if (this.overlayRef) {
|
|
447
|
+
this.overlayRef.dispose();
|
|
448
|
+
this.overlayRef = null;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
setupOverlay() {
|
|
452
|
+
const scrollStrategy = this.overlay.scrollStrategies.reposition();
|
|
453
|
+
this.overlayRef = this.overlay.create({
|
|
454
|
+
positionStrategy: this.overlay.position()
|
|
455
|
+
.flexibleConnectedTo(this.wrapperEl)
|
|
456
|
+
.withPositions([
|
|
457
|
+
{
|
|
458
|
+
originX: 'start',
|
|
459
|
+
originY: 'bottom',
|
|
460
|
+
overlayX: 'start',
|
|
461
|
+
overlayY: 'top',
|
|
462
|
+
offsetY: 4,
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
originX: 'start',
|
|
466
|
+
originY: 'top',
|
|
467
|
+
overlayX: 'start',
|
|
468
|
+
overlayY: 'bottom',
|
|
469
|
+
offsetY: -4,
|
|
470
|
+
}
|
|
471
|
+
])
|
|
472
|
+
.withDefaultOffsetX(0)
|
|
473
|
+
.withFlexibleDimensions(false)
|
|
474
|
+
.withViewportMargin(8),
|
|
475
|
+
scrollStrategy: scrollStrategy,
|
|
476
|
+
hasBackdrop: false,
|
|
477
|
+
backdropClass: '',
|
|
478
|
+
minWidth: 200,
|
|
479
|
+
maxHeight: 260,
|
|
480
|
+
});
|
|
481
|
+
// Fecha o overlay quando houver scroll fora do elemento
|
|
482
|
+
this.scrollDispatcher.scrolled().subscribe((scrollable) => {
|
|
483
|
+
if (this.isPanelOpen) {
|
|
484
|
+
const overlayEl = this.overlayRef?.overlayElement;
|
|
485
|
+
if (scrollable instanceof CdkScrollable) {
|
|
486
|
+
const scrollableEl = scrollable.getElementRef().nativeElement;
|
|
487
|
+
if (overlayEl?.contains(scrollableEl)) {
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
this.closePanel();
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
closeOverlay() {
|
|
496
|
+
if (this.overlayRef?.hasAttached()) {
|
|
497
|
+
this.overlayRef.detach();
|
|
498
|
+
}
|
|
499
|
+
this.isPanelOpen = false;
|
|
500
|
+
}
|
|
501
|
+
openOverlay() {
|
|
502
|
+
if (!this.overlayRef || !this.portal) {
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
this.overlayRef.updateSize({
|
|
506
|
+
width: this.wrapperEl.nativeElement.offsetWidth,
|
|
507
|
+
});
|
|
508
|
+
if (!this.overlayRef.hasAttached()) {
|
|
509
|
+
this.overlayRef.attach(this.portal);
|
|
510
|
+
}
|
|
511
|
+
this.overlayRef.updatePosition();
|
|
512
|
+
this.isPanelOpen = true;
|
|
513
|
+
this.cdr.markForCheck();
|
|
514
|
+
}
|
|
515
|
+
setStyle() {
|
|
516
|
+
this.renderer.setStyle(this.el.nativeElement, '--autocomplete-bg-color', this.autocompleteBgColor);
|
|
517
|
+
}
|
|
518
|
+
// ---------- Painel ----------
|
|
519
|
+
openPanel() {
|
|
520
|
+
if (this.isDisabled || this.isPanelOpen) {
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
if (this.selectedOption && !this.isUserTyping) {
|
|
524
|
+
// Ao reabrir com uma opção já selecionada (e sem edição manual do usuário),
|
|
525
|
+
// exibe todas as opções, com a selecionada no topo.
|
|
526
|
+
this.filteredOptionsList = this.filter("");
|
|
527
|
+
const idx = this.filteredOptionsList.findIndex(o => o.id === this.selectedOption?.id);
|
|
528
|
+
this.activeIndex = idx >= 0 ? idx : (this.filteredOptionsList.length ? 0 : -1);
|
|
529
|
+
}
|
|
530
|
+
this.openOverlay();
|
|
531
|
+
}
|
|
532
|
+
closePanel() {
|
|
533
|
+
if (!this.isPanelOpen) {
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
this.closeOverlay();
|
|
537
|
+
this.cdr.markForCheck();
|
|
538
|
+
}
|
|
539
|
+
onDocumentClick(event) {
|
|
540
|
+
if (!this.isPanelOpen) {
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
const target = event.target;
|
|
544
|
+
const clickedInsideHost = this.el.nativeElement.contains(target);
|
|
545
|
+
const clickedInsideOverlay = this.overlayRef?.overlayElement?.contains(target);
|
|
546
|
+
if (!clickedInsideHost && !clickedInsideOverlay) {
|
|
547
|
+
this.closePanel();
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
// ---------- Eventos do input ----------
|
|
406
551
|
onFocus() {
|
|
407
552
|
this.isFocused = true;
|
|
408
553
|
this.focusEvent.emit();
|
|
409
554
|
this.onTouched();
|
|
410
|
-
|
|
411
|
-
this.internalControl.setValue("", { emitEvent: true });
|
|
412
|
-
if (currentDisplay) {
|
|
413
|
-
this.internalControl.setValue(currentDisplay, { emitEvent: false });
|
|
414
|
-
}
|
|
415
|
-
setTimeout(() => {
|
|
416
|
-
this.autocompleteTrigger?.openPanel();
|
|
417
|
-
}, 0);
|
|
555
|
+
this.openPanel();
|
|
418
556
|
}
|
|
419
557
|
onBlur() {
|
|
420
558
|
this.isFocused = false;
|
|
421
559
|
this.blurEvent.emit();
|
|
422
560
|
this.onTouched();
|
|
423
|
-
|
|
424
|
-
|
|
561
|
+
// Não fecha o overlay imediatamente no blur para permitir seleção
|
|
562
|
+
setTimeout(() => {
|
|
563
|
+
if (!this.isPanelOpen) {
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
const activeElement = document.activeElement;
|
|
567
|
+
const isOverlayElement = this.overlayRef?.overlayElement?.contains(activeElement);
|
|
568
|
+
const isInputElement = this.inputEl?.nativeElement === activeElement;
|
|
569
|
+
if (!isOverlayElement && !isInputElement) {
|
|
570
|
+
this.closePanel();
|
|
571
|
+
}
|
|
572
|
+
}, 150);
|
|
573
|
+
}
|
|
574
|
+
onInputKeydown(event) {
|
|
575
|
+
switch (event.key) {
|
|
576
|
+
case 'ArrowDown':
|
|
577
|
+
event.preventDefault();
|
|
578
|
+
if (!this.isPanelOpen) {
|
|
579
|
+
this.openPanel();
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
this.moveActiveIndex(1);
|
|
583
|
+
break;
|
|
584
|
+
case 'ArrowUp':
|
|
585
|
+
event.preventDefault();
|
|
586
|
+
if (!this.isPanelOpen) {
|
|
587
|
+
this.openPanel();
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
this.moveActiveIndex(-1);
|
|
591
|
+
break;
|
|
592
|
+
case 'Enter':
|
|
593
|
+
if (this.isPanelOpen && this.activeIndex >= 0) {
|
|
594
|
+
event.preventDefault();
|
|
595
|
+
const option = this.filteredOptionsList[this.activeIndex];
|
|
596
|
+
if (option) {
|
|
597
|
+
this.selectItem(option);
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
break;
|
|
601
|
+
case 'Escape':
|
|
602
|
+
if (this.isPanelOpen) {
|
|
603
|
+
event.preventDefault();
|
|
604
|
+
this.closePanel();
|
|
605
|
+
}
|
|
606
|
+
else {
|
|
607
|
+
this.clearSelection();
|
|
608
|
+
}
|
|
609
|
+
break;
|
|
610
|
+
case 'Tab':
|
|
611
|
+
this.closePanel();
|
|
612
|
+
break;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
moveActiveIndex(step) {
|
|
616
|
+
if (!this.filteredOptionsList.length) {
|
|
617
|
+
return;
|
|
425
618
|
}
|
|
619
|
+
const total = this.filteredOptionsList.length;
|
|
620
|
+
this.activeIndex = (this.activeIndex + step + total) % total;
|
|
621
|
+
this.cdr.markForCheck();
|
|
426
622
|
}
|
|
623
|
+
// ---------- Seleção ----------
|
|
427
624
|
selectItem(option) {
|
|
428
625
|
this.selectedOption = option;
|
|
429
|
-
this.
|
|
626
|
+
this.writeDisplayValue(option, { emitEvent: false });
|
|
627
|
+
this.control.setValue(option, { emitEvent: false });
|
|
430
628
|
this.onChange(option);
|
|
431
629
|
this.itemSelected.emit(option);
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
this.selectItem(event.option.value);
|
|
435
|
-
this.onTouched();
|
|
630
|
+
// Reordena a lista filtrada para que a opção selecionada fique no topo
|
|
631
|
+
this.filteredOptionsList = this.moveSelectedToTop(this.filteredOptionsList, option);
|
|
436
632
|
this.closePanel();
|
|
633
|
+
// Remove o foco do input após a seleção
|
|
634
|
+
this.inputEl?.nativeElement.blur();
|
|
635
|
+
this.isFocused = false;
|
|
636
|
+
this.cdr.markForCheck();
|
|
437
637
|
}
|
|
438
638
|
selectOption(option) {
|
|
439
639
|
this.selectItem(option);
|
|
440
|
-
this.closePanel();
|
|
441
|
-
}
|
|
442
|
-
closePanel() {
|
|
443
|
-
setTimeout(() => {
|
|
444
|
-
this.autocompleteTrigger?.closePanel();
|
|
445
|
-
this.el.nativeElement.querySelector('input')?.blur();
|
|
446
|
-
}, 10);
|
|
447
640
|
}
|
|
448
641
|
clearSelection() {
|
|
449
642
|
this.selectedOption = null;
|
|
450
|
-
this.
|
|
643
|
+
this.writeDisplayValue("", { emitEvent: false });
|
|
451
644
|
this.control.setValue(null, { emitEvent: true });
|
|
452
645
|
this.onChange(null);
|
|
453
646
|
this.onTouched();
|
|
454
|
-
|
|
455
|
-
this.autocompleteTrigger?.closePanel();
|
|
456
|
-
}, 0);
|
|
647
|
+
this.closePanel();
|
|
457
648
|
}
|
|
458
649
|
onLeadingIconClick(event) {
|
|
459
650
|
event.stopPropagation();
|
|
651
|
+
this.onFocus();
|
|
460
652
|
this.leadingIconClick.emit(event);
|
|
461
653
|
}
|
|
462
654
|
onTrailingIconClick(event) {
|
|
463
655
|
event.stopPropagation();
|
|
656
|
+
this.onFocus();
|
|
464
657
|
this.trailingIconClick.emit(event);
|
|
465
658
|
}
|
|
659
|
+
// ---------- Filtro / display ----------
|
|
466
660
|
filter(value) {
|
|
467
|
-
const filterValue = (
|
|
661
|
+
const filterValue = (value || "").toLowerCase();
|
|
468
662
|
const currentOptions = this.options$.getValue();
|
|
469
663
|
if (!currentOptions?.length) {
|
|
470
664
|
return [];
|
|
@@ -474,19 +668,48 @@ class CaoAutocompleteComponent {
|
|
|
474
668
|
const idMatch = option.id?.toString().toLowerCase().includes(filterValue);
|
|
475
669
|
return nomeMatch || idMatch;
|
|
476
670
|
});
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
671
|
+
return this.selectedOption ? this.moveSelectedToTop(matched, this.selectedOption) : matched;
|
|
672
|
+
}
|
|
673
|
+
/** Move a opção selecionada para o início da lista, mantendo a ordem das demais */
|
|
674
|
+
moveSelectedToTop(list, selected) {
|
|
675
|
+
const selectedIndex = list.findIndex((o) => o.id === selected.id);
|
|
676
|
+
if (selectedIndex <= 0) {
|
|
677
|
+
return list;
|
|
484
678
|
}
|
|
485
|
-
|
|
679
|
+
const reordered = [...list];
|
|
680
|
+
const [selectedItem] = reordered.splice(selectedIndex, 1);
|
|
681
|
+
reordered.unshift(selectedItem);
|
|
682
|
+
return reordered;
|
|
683
|
+
}
|
|
684
|
+
writeDisplayValue(value, options = { emitEvent: false }) {
|
|
685
|
+
const text = value && typeof value === "object" ? this.displayFn(value) : (value ?? "");
|
|
686
|
+
this.isUserTyping = false;
|
|
687
|
+
this.internalControl.setValue(text, options);
|
|
688
|
+
}
|
|
689
|
+
/** Marca que o usuário está digitando manualmente no campo (ativa o filtro por texto) */
|
|
690
|
+
onUserInput() {
|
|
691
|
+
this.isUserTyping = true;
|
|
486
692
|
}
|
|
487
693
|
displayFn(option) {
|
|
488
694
|
return option && option.nome ? option.nome : "";
|
|
489
695
|
}
|
|
696
|
+
isOptionSelected(option) {
|
|
697
|
+
return this.selectedOption?.id !== undefined && this.selectedOption?.id === option.id;
|
|
698
|
+
}
|
|
699
|
+
trackByOptionId(_, option) {
|
|
700
|
+
return option.id ?? option.nome;
|
|
701
|
+
}
|
|
702
|
+
optionId(option) {
|
|
703
|
+
const key = (option.id ?? option.nome).toString().replace(/[^a-zA-Z0-9_-]/g, '-');
|
|
704
|
+
return `${this.listboxId}-opt-${key}`;
|
|
705
|
+
}
|
|
706
|
+
get activeOptionId() {
|
|
707
|
+
if (!this.isPanelOpen || this.activeIndex < 0) {
|
|
708
|
+
return null;
|
|
709
|
+
}
|
|
710
|
+
const option = this.filteredOptionsList[this.activeIndex];
|
|
711
|
+
return option ? this.optionId(option) : null;
|
|
712
|
+
}
|
|
490
713
|
get errorText() {
|
|
491
714
|
if (!this.control) {
|
|
492
715
|
return null;
|
|
@@ -528,8 +751,7 @@ class CaoAutocompleteComponent {
|
|
|
528
751
|
return this.controlName;
|
|
529
752
|
}
|
|
530
753
|
writeValue(value) {
|
|
531
|
-
|
|
532
|
-
this.internalControl.setValue(displayValue, { emitEvent: false });
|
|
754
|
+
this.writeDisplayValue(value, { emitEvent: false });
|
|
533
755
|
this.selectedOption = value && typeof value === "object" ? value : null;
|
|
534
756
|
}
|
|
535
757
|
registerOnChange(fn) {
|
|
@@ -538,34 +760,37 @@ class CaoAutocompleteComponent {
|
|
|
538
760
|
registerOnTouched(fn) {
|
|
539
761
|
this.onTouched = fn;
|
|
540
762
|
}
|
|
541
|
-
|
|
542
|
-
this.
|
|
763
|
+
setDisabledState(isDisabled) {
|
|
764
|
+
this.isDisabled = isDisabled;
|
|
765
|
+
this.cdr.markForCheck();
|
|
766
|
+
}
|
|
767
|
+
setInputHeight() {
|
|
768
|
+
this.renderer.setStyle(this.el.nativeElement, "--form-field-height", this.inputHeigth);
|
|
543
769
|
}
|
|
544
770
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoAutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
545
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: CaoAutocompleteComponent, isStandalone: true, selector: "cao-autocomplete", inputs: { label: "label", placeholder: "placeholder", options: "options", control: "control", dataCy: "dataCy", controlName: "controlName", isLucideIcon: "isLucideIcon", iconColor: "iconColor", _leadingIcon: "_leadingIcon", _trailingIcon: "_trailingIcon", optionIcon: "optionIcon", optionIConColor: "optionIConColor", isLucideOptionIcon: "isLucideOptionIcon", autocompleteBgColor: "autocompleteBgColor", strokeWidthIcon: "strokeWidthIcon", isDisabled: "isDisabled" }, outputs: { itemSelected: "itemSelected", blurEvent: "blurEvent", focusEvent: "focusEvent", leadingIconClick: "leadingIconClick", trailingIconClick: "trailingIconClick" }, providers: [
|
|
771
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: CaoAutocompleteComponent, isStandalone: true, selector: "cao-autocomplete", inputs: { label: "label", placeholder: "placeholder", options: "options", control: "control", dataCy: "dataCy", controlName: "controlName", isLucideIcon: "isLucideIcon", iconColor: "iconColor", _leadingIcon: "_leadingIcon", _trailingIcon: "_trailingIcon", optionIcon: "optionIcon", optionIConColor: "optionIConColor", isLucideOptionIcon: "isLucideOptionIcon", autocompleteBgColor: "autocompleteBgColor", strokeWidthIcon: "strokeWidthIcon", isDisabled: "isDisabled", inputHeigth: "inputHeigth", checkIcon: "checkIcon", showCheckIcon: "showCheckIcon", isLucideCheckIcon: "isLucideCheckIcon" }, outputs: { itemSelected: "itemSelected", blurEvent: "blurEvent", focusEvent: "focusEvent", leadingIconClick: "leadingIconClick", trailingIconClick: "trailingIconClick" }, host: { listeners: { "document:click": "onDocumentClick($event)" } }, providers: [
|
|
546
772
|
{
|
|
547
773
|
provide: NG_VALUE_ACCESSOR,
|
|
548
774
|
useExisting: forwardRef(() => CaoAutocompleteComponent),
|
|
549
775
|
multi: true,
|
|
550
776
|
},
|
|
551
|
-
], viewQueries: [{ propertyName: "
|
|
777
|
+
], viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true }, { propertyName: "wrapperEl", first: true, predicate: ["wrapper"], descendants: true, static: true }, { propertyName: "panelTemplate", first: true, predicate: ["panel"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"form-field\">\n @if (label) {\n <label [for]=\"dataCy\">{{ label }}</label>\n }\n\n <div class=\"rnv-autocomplete-field autocomplete\">\n <div\n #wrapper\n class=\"input-wrapper\"\n [class.has-leading-icon]=\"_leadingIcon\"\n [class.has-trailing-icon]=\"_trailingIcon\"\n [class.focused]=\"isFocused\"\n [class.invalid]=\"control?.touched && control?.invalid\"\n [class.valid]=\"control?.touched && control?.valid && control?.value\">\n\n @if (_leadingIcon) {\n @if (isLucideIcon) {\n <div class=\"icon\"\n tabindex=\"0\"\n (click)=\"onLeadingIconClick($event)\"\n (keydown.enter)=\"onLeadingIconClick($event)\">\n <svg [strokeWidth]=\"strokeWidthIcon\" [lucideIcon]=\"_leadingIcon\" [style.color]=\"iconColor\"></svg>\n </div>\n } @else {\n <div class=\"icon\"\n tabindex=\"0\"\n (click)=\"onLeadingIconClick($event)\"\n (keydown.enter)=\"onLeadingIconClick($event)\">\n <img alt=\"\u00EDcone de in\u00EDcio\" [src]=\"_leadingIcon\" />\n </div>\n }\n }\n\n <input\n #inputEl\n type=\"text\"\n autocomplete=\"off\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"isPanelOpen\"\n [attr.aria-controls]=\"isPanelOpen ? listboxId : null\"\n [attr.aria-activedescendant]=\"activeOptionId\"\n [placeholder]=\"placeholder\"\n [disabled]=\"isDisabled\"\n [formControl]=\"internalControl\"\n [attr.data-cy]=\"dataCy\"\n [id]=\"dataCy\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (input)=\"onUserInput()\"\n (keydown)=\"onInputKeydown($event)\" />\n\n @if (_trailingIcon) {\n @if (isLucideIcon) {\n <div\n tabindex=\"0\"\n class=\"icon trailing-icon\"\n (click)=\"onTrailingIconClick($event)\"\n (keydown.enter)=\"onTrailingIconClick($event)\">\n <svg [strokeWidth]=\"strokeWidthIcon\" [lucideIcon]=\"_trailingIcon\" [style.color]=\"iconColor\"></svg>\n </div>\n } @else {\n <div\n tabindex=\"0\"\n class=\"icon trailing-icon\"\n (click)=\"onTrailingIconClick($event)\"\n (keydown.enter)=\"onTrailingIconClick($event)\">\n <img alt=\"\u00EDcone de fim\" [src]=\"_trailingIcon\" />\n </div>\n }\n }\n </div>\n\n @if (errorText) {\n <span class=\"error-text\">{{ errorText }}</span>\n }\n </div>\n</div>\n\n<ng-template #panel>\n <div\n class=\"autocomplete-panel\"\n cdkScrollable\n role=\"listbox\"\n [id]=\"listboxId\"\n [style.width]=\"'100%'\"\n [style.max-height]=\"'260px'\"\n [style.background]=\"autocompleteBgColor\">\n \n @if (!filteredOptionsList.length) {\n <div class=\"empty-state\">Nenhum resultado encontrado</div>\n }\n\n @for (option of filteredOptionsList; track trackByOptionId($index, option)) {\n <div\n class=\"option-item\"\n role=\"option\"\n [id]=\"optionId(option)\"\n [class.active]=\"$index === activeIndex\"\n [class.selected]=\"isOptionSelected(option)\"\n [attr.aria-selected]=\"$index === activeIndex\"\n (mousedown)=\"$event.preventDefault(); selectOption(option)\"\n (mouseenter)=\"activeIndex = $index\">\n <span>{{ option.nome }}</span>\n\n <div class=\"option-item-icons\">\n @if (showCheckIcon && isOptionSelected(option)) {\n @if (isLucideCheckIcon) {\n <svg class=\"check-icon\" [strokeWidth]=\"strokeWidthIcon\" [lucideIcon]=\"checkIcon\" [style.color]=\"iconColor\"></svg>\n } @else {\n <span class=\"check-icon\">{{ checkIcon }}</span>\n }\n }\n\n @if (optionIcon) {\n @if (isLucideOptionIcon) {\n <svg [strokeWidth]=\"strokeWidthIcon\" [lucideIcon]=\"optionIcon\" [style.color]=\"optionIConColor || iconColor\"></svg>\n } @else {\n <img alt=\"\" [src]=\"optionIcon\" />\n }\n }\n </div>\n </div>\n }\n </div>\n</ng-template>", styles: [":host{display:block;position:relative;--autocomplete-bg-color: white}.form-field{display:flex;flex-direction:column;width:100%;height:100%}label{font-size:12px;font-weight:700;text-transform:uppercase;white-space:nowrap;flex-shrink:0}.rnv-autocomplete-field{width:100%;flex:1;min-height:0;display:flex;flex-direction:column}.input-wrapper{position:relative;width:100%;height:var(--form-field-height, 44px);display:flex;align-items:center;background-color:var(--autocomplete-bg-color, white);border:1px solid transparent;border-radius:4px;box-sizing:border-box}.input-wrapper.invalid{border-color:#d32f2f}.input-wrapper.valid{border-color:#2e7d32}input{width:100%;height:100%;border:none;outline:none;background:transparent;padding:12px;font-size:1rem;box-sizing:border-box}input:disabled{opacity:.5;cursor:not-allowed}.input-wrapper.has-leading-icon input{padding-left:36px}.input-wrapper.has-trailing-icon input{padding-right:28px}.icon{position:absolute;top:50%;left:6px;transform:translateY(-50%);width:auto;height:auto;z-index:1;cursor:pointer}.trailing-icon{left:auto;right:6px}.error-text{color:#d32f2f;font-size:11px;margin-top:2px}.autocomplete-panel{background:var(--autocomplete-bg-color, white);border-radius:8px;padding:6px;box-shadow:0 2px 10px #00000026;max-height:260px;overflow-y:auto;box-sizing:border-box}.empty-state{padding:8px 12px;font-size:.9rem;color:#00000080}.option-item{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;font-size:1rem;text-transform:uppercase;border-radius:4px;cursor:pointer;position:relative}.option-item:hover,.option-item.active{background-color:#0000000f}.option-item.selected{background-color:#1976d21f;font-weight:600}.option-item.selected.active{background-color:#1976d233}.option-item-icons{display:flex;align-items:center;gap:6px;flex-shrink:0}.check-icon{font-weight:700;font-size:.95rem;line-height:1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: LucideDynamicIcon, selector: "svg[lucideIcon]", inputs: ["lucideIcon"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i2$2.CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
552
778
|
}
|
|
553
779
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoAutocompleteComponent, decorators: [{
|
|
554
780
|
type: Component,
|
|
555
781
|
args: [{ selector: "cao-autocomplete", standalone: true, imports: [
|
|
556
782
|
CommonModule,
|
|
557
783
|
ReactiveFormsModule,
|
|
558
|
-
MatFormFieldModule,
|
|
559
|
-
MatInputModule,
|
|
560
|
-
MatAutocompleteModule,
|
|
561
784
|
LucideDynamicIcon,
|
|
785
|
+
OverlayModule,
|
|
786
|
+
CdkScrollable
|
|
562
787
|
], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
563
788
|
{
|
|
564
789
|
provide: NG_VALUE_ACCESSOR,
|
|
565
790
|
useExisting: forwardRef(() => CaoAutocompleteComponent),
|
|
566
791
|
multi: true,
|
|
567
792
|
},
|
|
568
|
-
], template: "<div class=\"form-field\">\n @if (label) {\n <label [for]=\"
|
|
793
|
+
], template: "<div class=\"form-field\">\n @if (label) {\n <label [for]=\"dataCy\">{{ label }}</label>\n }\n\n <div class=\"rnv-autocomplete-field autocomplete\">\n <div\n #wrapper\n class=\"input-wrapper\"\n [class.has-leading-icon]=\"_leadingIcon\"\n [class.has-trailing-icon]=\"_trailingIcon\"\n [class.focused]=\"isFocused\"\n [class.invalid]=\"control?.touched && control?.invalid\"\n [class.valid]=\"control?.touched && control?.valid && control?.value\">\n\n @if (_leadingIcon) {\n @if (isLucideIcon) {\n <div class=\"icon\"\n tabindex=\"0\"\n (click)=\"onLeadingIconClick($event)\"\n (keydown.enter)=\"onLeadingIconClick($event)\">\n <svg [strokeWidth]=\"strokeWidthIcon\" [lucideIcon]=\"_leadingIcon\" [style.color]=\"iconColor\"></svg>\n </div>\n } @else {\n <div class=\"icon\"\n tabindex=\"0\"\n (click)=\"onLeadingIconClick($event)\"\n (keydown.enter)=\"onLeadingIconClick($event)\">\n <img alt=\"\u00EDcone de in\u00EDcio\" [src]=\"_leadingIcon\" />\n </div>\n }\n }\n\n <input\n #inputEl\n type=\"text\"\n autocomplete=\"off\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"isPanelOpen\"\n [attr.aria-controls]=\"isPanelOpen ? listboxId : null\"\n [attr.aria-activedescendant]=\"activeOptionId\"\n [placeholder]=\"placeholder\"\n [disabled]=\"isDisabled\"\n [formControl]=\"internalControl\"\n [attr.data-cy]=\"dataCy\"\n [id]=\"dataCy\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (input)=\"onUserInput()\"\n (keydown)=\"onInputKeydown($event)\" />\n\n @if (_trailingIcon) {\n @if (isLucideIcon) {\n <div\n tabindex=\"0\"\n class=\"icon trailing-icon\"\n (click)=\"onTrailingIconClick($event)\"\n (keydown.enter)=\"onTrailingIconClick($event)\">\n <svg [strokeWidth]=\"strokeWidthIcon\" [lucideIcon]=\"_trailingIcon\" [style.color]=\"iconColor\"></svg>\n </div>\n } @else {\n <div\n tabindex=\"0\"\n class=\"icon trailing-icon\"\n (click)=\"onTrailingIconClick($event)\"\n (keydown.enter)=\"onTrailingIconClick($event)\">\n <img alt=\"\u00EDcone de fim\" [src]=\"_trailingIcon\" />\n </div>\n }\n }\n </div>\n\n @if (errorText) {\n <span class=\"error-text\">{{ errorText }}</span>\n }\n </div>\n</div>\n\n<ng-template #panel>\n <div\n class=\"autocomplete-panel\"\n cdkScrollable\n role=\"listbox\"\n [id]=\"listboxId\"\n [style.width]=\"'100%'\"\n [style.max-height]=\"'260px'\"\n [style.background]=\"autocompleteBgColor\">\n \n @if (!filteredOptionsList.length) {\n <div class=\"empty-state\">Nenhum resultado encontrado</div>\n }\n\n @for (option of filteredOptionsList; track trackByOptionId($index, option)) {\n <div\n class=\"option-item\"\n role=\"option\"\n [id]=\"optionId(option)\"\n [class.active]=\"$index === activeIndex\"\n [class.selected]=\"isOptionSelected(option)\"\n [attr.aria-selected]=\"$index === activeIndex\"\n (mousedown)=\"$event.preventDefault(); selectOption(option)\"\n (mouseenter)=\"activeIndex = $index\">\n <span>{{ option.nome }}</span>\n\n <div class=\"option-item-icons\">\n @if (showCheckIcon && isOptionSelected(option)) {\n @if (isLucideCheckIcon) {\n <svg class=\"check-icon\" [strokeWidth]=\"strokeWidthIcon\" [lucideIcon]=\"checkIcon\" [style.color]=\"iconColor\"></svg>\n } @else {\n <span class=\"check-icon\">{{ checkIcon }}</span>\n }\n }\n\n @if (optionIcon) {\n @if (isLucideOptionIcon) {\n <svg [strokeWidth]=\"strokeWidthIcon\" [lucideIcon]=\"optionIcon\" [style.color]=\"optionIConColor || iconColor\"></svg>\n } @else {\n <img alt=\"\" [src]=\"optionIcon\" />\n }\n }\n </div>\n </div>\n }\n </div>\n</ng-template>", styles: [":host{display:block;position:relative;--autocomplete-bg-color: white}.form-field{display:flex;flex-direction:column;width:100%;height:100%}label{font-size:12px;font-weight:700;text-transform:uppercase;white-space:nowrap;flex-shrink:0}.rnv-autocomplete-field{width:100%;flex:1;min-height:0;display:flex;flex-direction:column}.input-wrapper{position:relative;width:100%;height:var(--form-field-height, 44px);display:flex;align-items:center;background-color:var(--autocomplete-bg-color, white);border:1px solid transparent;border-radius:4px;box-sizing:border-box}.input-wrapper.invalid{border-color:#d32f2f}.input-wrapper.valid{border-color:#2e7d32}input{width:100%;height:100%;border:none;outline:none;background:transparent;padding:12px;font-size:1rem;box-sizing:border-box}input:disabled{opacity:.5;cursor:not-allowed}.input-wrapper.has-leading-icon input{padding-left:36px}.input-wrapper.has-trailing-icon input{padding-right:28px}.icon{position:absolute;top:50%;left:6px;transform:translateY(-50%);width:auto;height:auto;z-index:1;cursor:pointer}.trailing-icon{left:auto;right:6px}.error-text{color:#d32f2f;font-size:11px;margin-top:2px}.autocomplete-panel{background:var(--autocomplete-bg-color, white);border-radius:8px;padding:6px;box-shadow:0 2px 10px #00000026;max-height:260px;overflow-y:auto;box-sizing:border-box}.empty-state{padding:8px 12px;font-size:.9rem;color:#00000080}.option-item{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;font-size:1rem;text-transform:uppercase;border-radius:4px;cursor:pointer;position:relative}.option-item:hover,.option-item.active{background-color:#0000000f}.option-item.selected{background-color:#1976d21f;font-weight:600}.option-item.selected.active{background-color:#1976d233}.option-item-icons{display:flex;align-items:center;gap:6px;flex-shrink:0}.check-icon{font-weight:700;font-size:.95rem;line-height:1}\n"] }]
|
|
569
794
|
}], propDecorators: { label: [{
|
|
570
795
|
type: Input
|
|
571
796
|
}], placeholder: [{
|
|
@@ -598,6 +823,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
598
823
|
type: Input
|
|
599
824
|
}], isDisabled: [{
|
|
600
825
|
type: Input
|
|
826
|
+
}], inputHeigth: [{
|
|
827
|
+
type: Input
|
|
828
|
+
}], checkIcon: [{
|
|
829
|
+
type: Input
|
|
830
|
+
}], showCheckIcon: [{
|
|
831
|
+
type: Input
|
|
832
|
+
}], isLucideCheckIcon: [{
|
|
833
|
+
type: Input
|
|
601
834
|
}], itemSelected: [{
|
|
602
835
|
type: Output
|
|
603
836
|
}], blurEvent: [{
|
|
@@ -608,9 +841,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
608
841
|
type: Output
|
|
609
842
|
}], trailingIconClick: [{
|
|
610
843
|
type: Output
|
|
611
|
-
}],
|
|
844
|
+
}], inputEl: [{
|
|
845
|
+
type: ViewChild,
|
|
846
|
+
args: ['inputEl']
|
|
847
|
+
}], wrapperEl: [{
|
|
848
|
+
type: ViewChild,
|
|
849
|
+
args: ['wrapper', { static: true }]
|
|
850
|
+
}], panelTemplate: [{
|
|
612
851
|
type: ViewChild,
|
|
613
|
-
args: [
|
|
852
|
+
args: ['panel', { static: true }]
|
|
853
|
+
}], onDocumentClick: [{
|
|
854
|
+
type: HostListener,
|
|
855
|
+
args: ['document:click', ['$event']]
|
|
614
856
|
}] } });
|
|
615
857
|
|
|
616
858
|
class CaoDropDownComponent {
|
|
@@ -877,7 +1119,7 @@ class CaoDropDownComponent {
|
|
|
877
1119
|
useExisting: forwardRef(() => CaoDropDownComponent),
|
|
878
1120
|
multi: true,
|
|
879
1121
|
},
|
|
880
|
-
], ngImport: i0, template: "<div\n class=\"dropdown-container\"\n role=\"combobox\"\n [ngClass]=\"[\n dropDownClass,\n isDisabled ? 'disabled' : '',\n control?.touched && control?.invalid ? 'invalid' : '',\n (control?.touched && control?.valid && selectedItem && isFocused && !removeValidBorder) ? 'valid' : ''\n ]\"\n [ngStyle]=\"styleDropDown\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-controls]=\"isOpen ? ('dropdown-list-' + dataCy) : null\"\n [attr.aria-labelledby]=\"ariaLabelledBy || null\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-disabled]=\"isDisabled\"\n [attr.aria-activedescendant]=\"activeDescendant\"\n [attr.data-cy]=\"dataCy\">\n \n <div\n class=\"dropdown-header\"\n matTooltipPosition=\"below\"\n matTooltipClass=\"custom-arrow-tooltip\"\n tabindex=\"0\"\n role=\"button\"\n [matTooltip]=\"tooltip\"\n [attr.aria-disabled]=\"isDisabled\"\n (click)=\"!isDisabled && toggleDropdown()\"\n (keydown.enter)=\"!isDisabled && toggleDropdown()\"\n (keydown.space)=\"!isDisabled && toggleDropdown(); $event.preventDefault()\"\n (keydown.arrowdown)=\"!isDisabled && onArrowDown($event)\"\n (keydown.arrowup)=\"!isDisabled && onArrowUp($event)\"\n (keydown.escape)=\"!isDisabled && closeDropdown()\">\n <span id=\"dropdown-label-{{dataCy}}\">{{ selectedItem?.nome ?? textHeader }}</span>\n <mat-icon aria-hidden=\"true\">{{ isOpen ? 'expand_less' : 'expand_more' }}</mat-icon>\n </div>\n\n @if (isOpen) {\n <ul \n class=\"dropdown-list\" \n role=\"listbox\"\n [id]=\"'dropdown-list-' + dataCy\"\n [ngClass]=\"{ 'drop-up': dropDirection === 'up', 'dropdown-secundary': dropDownClass === 'dropdown-secundary' }\"\n [attr.aria-label]=\"listAriaLabel || 'Op\u00E7\u00F5es'\"\n [attr.aria-labelledby]=\"'dropdown-label-' + dataCy\">\n \n\n <li class=\"dropdown-search\" role=\"none\">\n <input \n type=\"text\" \n placeholder=\"Buscar por c\u00F3digo ou nome...\" \n role=\"searchbox\"\n aria-label=\"Buscar op\u00E7\u00F5es\"\n [formControl]=\"searchControl\"\n (keydown.arrowdown)=\"onArrowDown($event)\"\n (keydown.arrowup)=\"onArrowUp($event)\"\n (keydown.enter)=\"onSearchEnter($event)\"\n (keydown.escape)=\"closeDropdown()\" />\n </li>\n \n\n @for (item of filteredOptions; track $index) { \n @if(item && item.nome) {\n <li\n class=\"dropdown-item\"\n role=\"option\"\n [ngClass]=\"{\n 'icon-right': item.iconPosition === 'right',\n 'selected': item === selectedItem,\n 'focused': $index === focusedIndex\n }\"\n [attr.id]=\"'option-' + dataCy + '-' + $index\"\n [attr.aria-selected]=\"item === selectedItem\"\n [attr.tabindex]=\"$index === focusedIndex ? 0 : -1\"\n [attr.data-cy]=\"item.dataCy\"\n (click)=\"selectItem(item)\"\n (keydown.enter)=\"selectItem(item)\"\n (keydown.space)=\"selectItem(item); $event.preventDefault()\"\n (mouseenter)=\"focusedIndex = $index\">\n @if (item.icon && item.iconPosition !== 'right') {\n <mat-icon class=\"dropdown-icon\" aria-hidden=\"true\">{{ item.icon }}</mat-icon>\n } \n <span>{{ item.nome }}</span>\n @if (item.icon && item.iconPosition === 'right') {\n <mat-icon class=\"dropdown-icon\" aria-hidden=\"true\">{{ item.icon }}</mat-icon>\n }\n </li>\n } \n }\n </ul>\n }\n \n @if (control?.touched && control?.invalid && errorText) {\n <div class=\"message-error\">{{ errorText }}</div>\n }\n</div>", styles: [".dropdown-header:focus{outline:2px solid var(--primary);outline-offset:2px}.dropdown-header:focus:not(:focus-visible){outline:none}.dropdown-search input:focus{outline:2px solid var(--primary);outline-offset:2px}.dropdown-item:focus{outline:2px solid var(--primary);outline-offset:-2px}.dropdown-item.focused{background-color:var(--hover-drop-down);font-weight:700}.dropdown-container.disabled{opacity:.6}.dropdown-list::-webkit-scrollbar{width:8px}.dropdown-list::-webkit-scrollbar-track{background:#0000000d;border-radius:4px}.dropdown-list::-webkit-scrollbar-thumb{background:#0003;border-radius:4px}.dropdown-list::-webkit-scrollbar-thumb:hover{background:#0000004d}@media screen and (max-width:768px){.dropdown-list{max-height:180px}.dropdown-list.drop-up{bottom:45px}}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4
|
|
1122
|
+
], ngImport: i0, template: "<div\n class=\"dropdown-container\"\n role=\"combobox\"\n [ngClass]=\"[\n dropDownClass,\n isDisabled ? 'disabled' : '',\n control?.touched && control?.invalid ? 'invalid' : '',\n (control?.touched && control?.valid && selectedItem && isFocused && !removeValidBorder) ? 'valid' : ''\n ]\"\n [ngStyle]=\"styleDropDown\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-haspopup]=\"'listbox'\"\n [attr.aria-controls]=\"isOpen ? ('dropdown-list-' + dataCy) : null\"\n [attr.aria-labelledby]=\"ariaLabelledBy || null\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-disabled]=\"isDisabled\"\n [attr.aria-activedescendant]=\"activeDescendant\"\n [attr.data-cy]=\"dataCy\">\n \n <div\n class=\"dropdown-header\"\n matTooltipPosition=\"below\"\n matTooltipClass=\"custom-arrow-tooltip\"\n tabindex=\"0\"\n role=\"button\"\n [matTooltip]=\"tooltip\"\n [attr.aria-disabled]=\"isDisabled\"\n (click)=\"!isDisabled && toggleDropdown()\"\n (keydown.enter)=\"!isDisabled && toggleDropdown()\"\n (keydown.space)=\"!isDisabled && toggleDropdown(); $event.preventDefault()\"\n (keydown.arrowdown)=\"!isDisabled && onArrowDown($event)\"\n (keydown.arrowup)=\"!isDisabled && onArrowUp($event)\"\n (keydown.escape)=\"!isDisabled && closeDropdown()\">\n <span id=\"dropdown-label-{{dataCy}}\">{{ selectedItem?.nome ?? textHeader }}</span>\n <mat-icon aria-hidden=\"true\">{{ isOpen ? 'expand_less' : 'expand_more' }}</mat-icon>\n </div>\n\n @if (isOpen) {\n <ul \n class=\"dropdown-list\" \n role=\"listbox\"\n [id]=\"'dropdown-list-' + dataCy\"\n [ngClass]=\"{ 'drop-up': dropDirection === 'up', 'dropdown-secundary': dropDownClass === 'dropdown-secundary' }\"\n [attr.aria-label]=\"listAriaLabel || 'Op\u00E7\u00F5es'\"\n [attr.aria-labelledby]=\"'dropdown-label-' + dataCy\">\n \n\n <li class=\"dropdown-search\" role=\"none\">\n <input \n type=\"text\" \n placeholder=\"Buscar por c\u00F3digo ou nome...\" \n role=\"searchbox\"\n aria-label=\"Buscar op\u00E7\u00F5es\"\n [formControl]=\"searchControl\"\n (keydown.arrowdown)=\"onArrowDown($event)\"\n (keydown.arrowup)=\"onArrowUp($event)\"\n (keydown.enter)=\"onSearchEnter($event)\"\n (keydown.escape)=\"closeDropdown()\" />\n </li>\n \n\n @for (item of filteredOptions; track $index) { \n @if(item && item.nome) {\n <li\n class=\"dropdown-item\"\n role=\"option\"\n [ngClass]=\"{\n 'icon-right': item.iconPosition === 'right',\n 'selected': item === selectedItem,\n 'focused': $index === focusedIndex\n }\"\n [attr.id]=\"'option-' + dataCy + '-' + $index\"\n [attr.aria-selected]=\"item === selectedItem\"\n [attr.tabindex]=\"$index === focusedIndex ? 0 : -1\"\n [attr.data-cy]=\"item.dataCy\"\n (click)=\"selectItem(item)\"\n (keydown.enter)=\"selectItem(item)\"\n (keydown.space)=\"selectItem(item); $event.preventDefault()\"\n (mouseenter)=\"focusedIndex = $index\">\n @if (item.icon && item.iconPosition !== 'right') {\n <mat-icon class=\"dropdown-icon\" aria-hidden=\"true\">{{ item.icon }}</mat-icon>\n } \n <span>{{ item.nome }}</span>\n @if (item.icon && item.iconPosition === 'right') {\n <mat-icon class=\"dropdown-icon\" aria-hidden=\"true\">{{ item.icon }}</mat-icon>\n }\n </li>\n } \n }\n </ul>\n }\n \n @if (control?.touched && control?.invalid && errorText) {\n <div class=\"message-error\">{{ errorText }}</div>\n }\n</div>", styles: [".dropdown-header:focus{outline:2px solid var(--primary);outline-offset:2px}.dropdown-header:focus:not(:focus-visible){outline:none}.dropdown-search input:focus{outline:2px solid var(--primary);outline-offset:2px}.dropdown-item:focus{outline:2px solid var(--primary);outline-offset:-2px}.dropdown-item.focused{background-color:var(--hover-drop-down);font-weight:700}.dropdown-container.disabled{opacity:.6}.dropdown-list::-webkit-scrollbar{width:8px}.dropdown-list::-webkit-scrollbar-track{background:#0000000d;border-radius:4px}.dropdown-list::-webkit-scrollbar-thumb{background:#0003;border-radius:4px}.dropdown-list::-webkit-scrollbar-thumb:hover{background:#0000004d}@media screen and (max-width:768px){.dropdown-list{max-height:180px}.dropdown-list.drop-up{bottom:45px}}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
881
1123
|
}
|
|
882
1124
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoDropDownComponent, decorators: [{
|
|
883
1125
|
type: Component,
|
|
@@ -1214,7 +1456,7 @@ class TimePicker {
|
|
|
1214
1456
|
this.isDisabled = isDisabled;
|
|
1215
1457
|
}
|
|
1216
1458
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TimePicker, deps: [{ token: i1$3.DateAdapter }], target: i0.ɵɵFactoryTarget.Component });
|
|
1217
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: TimePicker, isStandalone: true, selector: "cao-time-picker", inputs: { control: "control", isDisabled: "isDisabled", dataCy: "dataCy", min: "min", max: "max" }, outputs: { timeChange: "timeChange" }, ngImport: i0, template: "<div class=\"time-picker-wrapper\">\n <mat-form-field\n class=\"custom-timepicker\"\n [ngClass]=\"{\n 'invalid': control?.touched && control?.invalid,\n 'valid': control?.touched && control?.valid\n }\">\n <input\n matInput\n placeholder=\"00:00\"\n [formControl]=\"control\"\n [matTimepicker]=\"picker\"\n [min]=\"min\"\n [max]=\"max\"\n [disabled]=\"isDisabled\"\n [attr.data-cy]=\"dataCy\"\n (blur)=\"control?.markAsTouched()\" />\n <mat-timepicker-toggle matSuffix [for]=\"picker\" />\n <mat-timepicker #picker [options]=\"customOptions\" (selected)=\"timeChange.emit($event.value)\" />\n </mat-form-field>\n</div>\n", styles: [".time-picker-wrapper{width:130px;display:flex;flex-direction:column;position:relative}.custom-timepicker{width:100%}.custom-timepicker .mat-mdc-text-field-wrapper{border:1px solid transparent;border-radius:8px;padding:0;height:43px;display:flex;align-items:center;background-color:var(--input-background);box-shadow:0 1px 3px #0000001a;transition:border-color .2s ease-in-out}.custom-timepicker.invalid .mat-mdc-text-field-wrapper{border-color:var(--error)}.custom-timepicker.valid.mat-focused .mat-mdc-text-field-wrapper{border-color:var(--success)}.custom-timepicker.valid:not(.mat-focused) .mat-mdc-text-field-wrapper{border-color:transparent}.custom-timepicker .mdc-line-ripple{display:none}.custom-timepicker .mat-mdc-input-element{font-size:16px;padding-left:16px;caret-color:transparent;background:transparent}.custom-timepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0;border-left:1px solid var(--line-color);border-radius:0;margin:0;display:flex;align-items:center;justify-content:center}.custom-timepicker .mat-timepicker-toggle-default-icon{color:var(--primary)}.custom-timepicker .mat-mdc-form-field-flex{background-color:var(--input-background)}.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-floating-label.mdc-floating-label{display:none}.mat-mdc-form-field-subscript-wrapper,.mat-mdc-form-field-bottom-align:before{display:none}.custom-timepicker .mat-mdc-form-field-infix{padding:18px 0!important}.custom-timepicker.mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick{box-shadow:none!important}\n"], dependencies: [{ kind: "ngmodule", type: MaterialModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type:
|
|
1459
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: TimePicker, isStandalone: true, selector: "cao-time-picker", inputs: { control: "control", isDisabled: "isDisabled", dataCy: "dataCy", min: "min", max: "max" }, outputs: { timeChange: "timeChange" }, ngImport: i0, template: "<div class=\"time-picker-wrapper\">\n <mat-form-field\n class=\"custom-timepicker\"\n [ngClass]=\"{\n 'invalid': control?.touched && control?.invalid,\n 'valid': control?.touched && control?.valid\n }\">\n <input\n matInput\n placeholder=\"00:00\"\n [formControl]=\"control\"\n [matTimepicker]=\"picker\"\n [min]=\"min\"\n [max]=\"max\"\n [disabled]=\"isDisabled\"\n [attr.data-cy]=\"dataCy\"\n (blur)=\"control?.markAsTouched()\" />\n <mat-timepicker-toggle matSuffix [for]=\"picker\" />\n <mat-timepicker #picker [options]=\"customOptions\" (selected)=\"timeChange.emit($event.value)\" />\n </mat-form-field>\n</div>\n", styles: [".time-picker-wrapper{width:130px;display:flex;flex-direction:column;position:relative}.custom-timepicker{width:100%}.custom-timepicker .mat-mdc-text-field-wrapper{border:1px solid transparent;border-radius:8px;padding:0;height:43px;display:flex;align-items:center;background-color:var(--input-background);box-shadow:0 1px 3px #0000001a;transition:border-color .2s ease-in-out}.custom-timepicker.invalid .mat-mdc-text-field-wrapper{border-color:var(--error)}.custom-timepicker.valid.mat-focused .mat-mdc-text-field-wrapper{border-color:var(--success)}.custom-timepicker.valid:not(.mat-focused) .mat-mdc-text-field-wrapper{border-color:transparent}.custom-timepicker .mdc-line-ripple{display:none}.custom-timepicker .mat-mdc-input-element{font-size:16px;padding-left:16px;caret-color:transparent;background:transparent}.custom-timepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0;border-left:1px solid var(--line-color);border-radius:0;margin:0;display:flex;align-items:center;justify-content:center}.custom-timepicker .mat-timepicker-toggle-default-icon{color:var(--primary)}.custom-timepicker .mat-mdc-form-field-flex{background-color:var(--input-background)}.mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-floating-label.mdc-floating-label{display:none}.mat-mdc-form-field-subscript-wrapper,.mat-mdc-form-field-bottom-align:before{display:none}.custom-timepicker .mat-mdc-form-field-infix{padding:18px 0!important}.custom-timepicker.mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick{box-shadow:none!important}\n"], dependencies: [{ kind: "ngmodule", type: MaterialModule }, { kind: "component", type: i1$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$1.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i3$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i4$1.MatTimepicker, selector: "mat-timepicker", inputs: ["interval", "options", "disableRipple", "aria-label", "aria-labelledby"], outputs: ["selected", "opened", "closed"], exportAs: ["matTimepicker"] }, { kind: "directive", type: i4$1.MatTimepickerInput, selector: "input[matTimepicker]", inputs: ["value", "matTimepicker", "matTimepickerMin", "matTimepickerMax", "matTimepickerOpenOnClick", "disabled"], outputs: ["valueChange"], exportAs: ["matTimepickerInput"] }, { kind: "component", type: i4$1.MatTimepickerToggle, selector: "mat-timepicker-toggle", inputs: ["for", "aria-label", "aria-labelledby", "disabled", "tabIndex", "disableRipple"], exportAs: ["matTimepickerToggle"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.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: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1218
1460
|
}
|
|
1219
1461
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TimePicker, decorators: [{
|
|
1220
1462
|
type: Component,
|
|
@@ -2189,7 +2431,7 @@ class BaseTable {
|
|
|
2189
2431
|
this.totalItems = this.dataSource.data.length;
|
|
2190
2432
|
}
|
|
2191
2433
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseTable, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2192
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: BaseTable, isStandalone: true, selector: "cao-table", inputs: { customClass: "customClass", pageSizeOptions: "pageSizeOptions", showFirstLastButtons: "showFirstLastButtons", isPaginatedByServer: "isPaginatedByServer" }, outputs: { pageChanged: "pageChanged", pageSizeChanged: "pageSizeChanged", firstPageClicked: "firstPageClicked", lastPageClicked: "lastPageClicked", selectionChanged: "selectionChanged", pageEvent: "pageEvent" }, providers: [{ provide: MatPaginatorIntl, useValue: getPtBrPaginatorIntlBaseTable() }], viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }], ngImport: i0, template: "<div class=\"table-container\" [ngClass]=\"customClass\">\n @if (tableConfig) {\n <div class=\"table-controls\">\n <mat-menu #menuColunas=\"matMenu\">\n @for (column of allColumns; track column) {\n <button\n mat-menu-item\n [type]=\"'button'\" (click)=\"toggleColumnVisibility(column)\">\n <mat-checkbox\n [attr.data-cy]=\"'checkbox-toggle-column-' + column\"\n [checked]=\"isColumnVisible(column)\">\n {{ getColumnHeader(column) }}\n </mat-checkbox>\n </button>\n }\n </mat-menu>\n </div>\n\n <table\n mat-table\n matSort\n class=\"mat-elevation-z8\"\n [dataSource]=\"dataSource\"\n (matSortChange)=\"announceSortChange($event)\">\n <ng-container matColumnDef=\"select\">\n <th *matHeaderCellDef mat-header-cell>\n <mat-checkbox\n data-cy=\"checkbox-select-all\"\n [checked]=\"selection.hasValue() && isAllSelected()\"\n [indeterminate]=\"selection.hasValue() && !isAllSelected()\"\n (change)=\"$event ? toggleAllRows() : null\" />\n </th>\n <td *matCellDef=\"let row\" mat-cell>\n <mat-checkbox\n [attr.data-cy]=\"'checkbox-select-row-' + row.id\"\n [checked]=\"selection.isSelected(row)\"\n (click)=\"$event.stopPropagation()\"\n (change)=\"$event ? selection.toggle(row) : null\" />\n </td>\n </ng-container>\n\n @for (column of displayedColumns; track column) {\n <ng-container [matColumnDef]=\"column\">\n <th *matHeaderCellDef mat-header-cell [mat-sort-header]=\"column\">\n <span>{{ getColumnHeader(column) }}</span>\n <img\n alt=\"icone\"\n [ngSrc]=\"'.src/assets/svg/arrow-left-double.svg'\"\n [fill]=\"true\"\n [matMenuTriggerFor]=\"menuColunas\" />\n <mat-menu #menuColunas=\"matMenu\">\n @for (column of allColumns; track column) {\n <button\n mat-menu-item\n [type]=\"'button'\" (click)=\"toggleColumnVisibility(column)\">\n <mat-checkbox\n [attr.data-cy]=\"'checkbox-toggle-column-' + column\"\n [checked]=\"isColumnVisible(column)\">\n {{ getColumnHeader(column) }}\n </mat-checkbox>\n </button>\n }\n </mat-menu>\n </th>\n <td *matCellDef=\"let element\" mat-cell>\n @switch (getColumnType(column)) { @case ('STRING') {\n <span>{{ element[getColumnElement(column)] }}</span>\n } @case ('BOOLEAN') {\n <mat-checkbox\n disabled\n [attr.data-cy]=\"'checkbox-value-' + column + '-' + element.id\"\n [checked]=\"element[getColumnElement(column)]\" />\n } @case ('DATE') {\n <span>{{ element[getColumnElement(column)] | date:'mediumDate' }}</span>\n } @case ('NUMBER') {\n <span>{{ element[getColumnElement(column)] | number:'1.2-2' }}</span>\n } @case ('SINGLE_BUTTON') {\n <div>\n @for (btn of getColumnButtons(column); track btn) {\n <button\n mat-icon-button\n [type]=\"'button'\" [matTooltip]=\"btn.tooltip\" (click)=\"btn.onClick(element)\">\n <mat-icon>{{ btn.icon }}</mat-icon>\n </button>\n }\n </div>\n } @default {\n <span>{{ element[getColumnElement(column)] }}</span>\n } }\n </td>\n </ng-container>\n }\n\n <ng-container matColumnDef=\"footer\">\n <td *matFooterCellDef mat-footer-cell [attr.colspan]=\"displayedColumns.length + 1\">\n Total de Registros: {{ dataSource.data.length }}\n </td>\n </ng-container>\n\n <tr *matHeaderRowDef=\"getAllColumns()\" mat-header-row></tr>\n <tr\n *matRowDef=\"let row; columns: getAllColumns();\"\n mat-row\n (click)=\"selection.toggle(row)\"></tr>\n <tr *matFooterRowDef=\"['footer']\" mat-footer-row></tr>\n </table>\n }\n</div>\n\n<mat-paginator\n #paginator\n aria-label=\"Select page\"\n [length]=\"totalItems\"\n [pageSize]=\"pageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n [pageIndex]=\"currentPage - 1\"\n [hidePageSize]=\"false\"\n [showFirstLastButtons]=\"showFirstLastButtons\"\n (page)=\"onPageEvent($event)\" />\n\n@if (!tableConfig || tableConfig.data.length === 0) {\n<div class=\"no-data-container\">\n <h2 class=\"no-data-title\">{{ tableConfig?.result?.noData || 'N\u00E3o h\u00E1 dados dispon\u00EDveis' }}</h2>\n <p class=\"no-data-message\"\n >{{ tableConfig?.result?.defaultMessage || 'Adicione alguns dados' }}</p\n >\n</div>\n}\n", styles: [".table-container{border-radius:8px;box-shadow:0 4px 6px #0000001a;max-width:100%;overflow:auto hidden}.table-container .table-controls{display:flex;align-items:center;padding:20px}.table-container .table-controls .filter-field{display:flex;align-items:center;justify-content:space-between;padding:10px;flex-direction:row;border:none;border-radius:10px;background-color:var(--input-disabled-bg);width:50%;height:55px}.table-container .table-controls .filter-field input:focus{outline:none!important;box-shadow:none!important;border-color:transparent!important}.table-container .table-controls .filter-field .input-filter{width:100%;box-sizing:border-box;background-color:transparent;border:none;transition:none}.table-container .table-controls .filter-field i{color:var(--icon-collor);margin-left:8px}.table-container .mat-mdc-table{width:max-content;min-width:100%;background-color:var(--table-body-color)}.table-container .mat-mdc-table .mat-mdc-header-cell:first-child,.table-container .mat-mdc-table .mat-mdc-cell:first-child{border-right:none!important}.table-container .mat-mdc-table .mat-mdc-header-cell:not(:first-child),.table-container .mat-mdc-table .mat-mdc-cell:not(:first-child){border-right:1px solid var(--primary)}.table-container .mat-mdc-table .mat-mdc-header-cell:first-child,.table-container .mat-mdc-table .mat-mdc-cell:first-child{width:60px;max-width:60px;min-width:60px;border-right:none}.table-container .mat-mdc-table .mat-mdc-header-row{background-color:var(--table-header)}.table-container .mat-mdc-table .mat-mdc-header-row .mat-mdc-header-cell{border-right:1px solid var(--white);font-weight:600;color:var(--white);border-bottom:1px solid var(--input-background);text-transform:uppercase;font-size:.875rem}.table-container .mat-mdc-table .mat-mdc-header-row .mat-mdc-header-cell:last-child{border-right:none}.table-container .mat-mdc-table .mat-mdc-row{transition:background-color .2s ease}.table-container .mat-mdc-table .mat-mdc-row .mat-mdc-cell{border-right:1px solid var(--primary);color:var(--gray-dark);border-bottom:1px solid var(--input-background)}.table-container .mat-mdc-table .mat-mdc-row .mat-mdc-cell:last-child{border-right:none}.table-container .mat-mdc-table .mat-mdc-row:hover{background-color:#0000000a}.table-container .mat-mdc-table .mat-mdc-row.selected{background-color:#3f51b51a}.table-container .mat-mdc-table .mat-mdc-checkbox{margin-right:12px}.table-container .mat-mdc-table .mat-mdc-checkbox .mdc-checkbox{--mdc-checkbox-unselected-icon-color: var(--gray-dark);--mdc-checkbox-selected-icon-color: var(--info)}.table-container .mat-mdc-table .mat-mdc-footer-row{background-color:var(--table-background);font-weight:600;color:var(--input-disabled-bg)}.table-container .mat-mdc-table .mat-mdc-footer-row .mat-mdc-footer-cell{padding:12px;text-align:left;color:var(--gray-dark)}.table-container span,.table-container img{margin-right:10px}.table-container[_ngcontent-ng-c1530403114] .mat-mdc-table[_ngcontent-ng-c1530403114] .mat-mdc-footer-row[_ngcontent-ng-c1530403114]{display:none}.no-data-container{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:15px;font-size:1.1rem}.no-data-container .no-data-title{color:var(--table-header);margin-bottom:12px}.no-data-container .no-data-message{color:var(--table-header)}@media(max-width:768px){.table-container .table-controls{flex-direction:column;align-items:stretch}.table-container .table-controls .filter-field{margin-right:0;margin-bottom:12px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MaterialModule }, { kind: "component", type: i2$2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: i4$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5$1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i5$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: i1$2.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "directive", type: i7.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i7.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: i8.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i8.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i8.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i8.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i8.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i8.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i8.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i8.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i8.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i8.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i8.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i8.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i8.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i8.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "decoding", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "placeholder", "placeholderConfig", "src", "srcset"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
|
|
2434
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: BaseTable, isStandalone: true, selector: "cao-table", inputs: { customClass: "customClass", pageSizeOptions: "pageSizeOptions", showFirstLastButtons: "showFirstLastButtons", isPaginatedByServer: "isPaginatedByServer" }, outputs: { pageChanged: "pageChanged", pageSizeChanged: "pageSizeChanged", firstPageClicked: "firstPageClicked", lastPageClicked: "lastPageClicked", selectionChanged: "selectionChanged", pageEvent: "pageEvent" }, providers: [{ provide: MatPaginatorIntl, useValue: getPtBrPaginatorIntlBaseTable() }], viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }], ngImport: i0, template: "<div class=\"table-container\" [ngClass]=\"customClass\">\n @if (tableConfig) {\n <div class=\"table-controls\">\n <mat-menu #menuColunas=\"matMenu\">\n @for (column of allColumns; track column) {\n <button\n mat-menu-item\n [type]=\"'button'\" (click)=\"toggleColumnVisibility(column)\">\n <mat-checkbox\n [attr.data-cy]=\"'checkbox-toggle-column-' + column\"\n [checked]=\"isColumnVisible(column)\">\n {{ getColumnHeader(column) }}\n </mat-checkbox>\n </button>\n }\n </mat-menu>\n </div>\n\n <table\n mat-table\n matSort\n class=\"mat-elevation-z8\"\n [dataSource]=\"dataSource\"\n (matSortChange)=\"announceSortChange($event)\">\n <ng-container matColumnDef=\"select\">\n <th *matHeaderCellDef mat-header-cell>\n <mat-checkbox\n data-cy=\"checkbox-select-all\"\n [checked]=\"selection.hasValue() && isAllSelected()\"\n [indeterminate]=\"selection.hasValue() && !isAllSelected()\"\n (change)=\"$event ? toggleAllRows() : null\" />\n </th>\n <td *matCellDef=\"let row\" mat-cell>\n <mat-checkbox\n [attr.data-cy]=\"'checkbox-select-row-' + row.id\"\n [checked]=\"selection.isSelected(row)\"\n (click)=\"$event.stopPropagation()\"\n (change)=\"$event ? selection.toggle(row) : null\" />\n </td>\n </ng-container>\n\n @for (column of displayedColumns; track column) {\n <ng-container [matColumnDef]=\"column\">\n <th *matHeaderCellDef mat-header-cell [mat-sort-header]=\"column\">\n <span>{{ getColumnHeader(column) }}</span>\n <img\n alt=\"icone\"\n [ngSrc]=\"'.src/assets/svg/arrow-left-double.svg'\"\n [fill]=\"true\"\n [matMenuTriggerFor]=\"menuColunas\" />\n <mat-menu #menuColunas=\"matMenu\">\n @for (column of allColumns; track column) {\n <button\n mat-menu-item\n [type]=\"'button'\" (click)=\"toggleColumnVisibility(column)\">\n <mat-checkbox\n [attr.data-cy]=\"'checkbox-toggle-column-' + column\"\n [checked]=\"isColumnVisible(column)\">\n {{ getColumnHeader(column) }}\n </mat-checkbox>\n </button>\n }\n </mat-menu>\n </th>\n <td *matCellDef=\"let element\" mat-cell>\n @switch (getColumnType(column)) { @case ('STRING') {\n <span>{{ element[getColumnElement(column)] }}</span>\n } @case ('BOOLEAN') {\n <mat-checkbox\n disabled\n [attr.data-cy]=\"'checkbox-value-' + column + '-' + element.id\"\n [checked]=\"element[getColumnElement(column)]\" />\n } @case ('DATE') {\n <span>{{ element[getColumnElement(column)] | date:'mediumDate' }}</span>\n } @case ('NUMBER') {\n <span>{{ element[getColumnElement(column)] | number:'1.2-2' }}</span>\n } @case ('SINGLE_BUTTON') {\n <div>\n @for (btn of getColumnButtons(column); track btn) {\n <button\n mat-icon-button\n [type]=\"'button'\" [matTooltip]=\"btn.tooltip\" (click)=\"btn.onClick(element)\">\n <mat-icon>{{ btn.icon }}</mat-icon>\n </button>\n }\n </div>\n } @default {\n <span>{{ element[getColumnElement(column)] }}</span>\n } }\n </td>\n </ng-container>\n }\n\n <ng-container matColumnDef=\"footer\">\n <td *matFooterCellDef mat-footer-cell [attr.colspan]=\"displayedColumns.length + 1\">\n Total de Registros: {{ dataSource.data.length }}\n </td>\n </ng-container>\n\n <tr *matHeaderRowDef=\"getAllColumns()\" mat-header-row></tr>\n <tr\n *matRowDef=\"let row; columns: getAllColumns();\"\n mat-row\n (click)=\"selection.toggle(row)\"></tr>\n <tr *matFooterRowDef=\"['footer']\" mat-footer-row></tr>\n </table>\n }\n</div>\n\n<mat-paginator\n #paginator\n aria-label=\"Select page\"\n [length]=\"totalItems\"\n [pageSize]=\"pageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n [pageIndex]=\"currentPage - 1\"\n [hidePageSize]=\"false\"\n [showFirstLastButtons]=\"showFirstLastButtons\"\n (page)=\"onPageEvent($event)\" />\n\n@if (!tableConfig || tableConfig.data.length === 0) {\n<div class=\"no-data-container\">\n <h2 class=\"no-data-title\">{{ tableConfig?.result?.noData || 'N\u00E3o h\u00E1 dados dispon\u00EDveis' }}</h2>\n <p class=\"no-data-message\"\n >{{ tableConfig?.result?.defaultMessage || 'Adicione alguns dados' }}</p\n >\n</div>\n}\n", styles: [".table-container{border-radius:8px;box-shadow:0 4px 6px #0000001a;max-width:100%;overflow:auto hidden}.table-container .table-controls{display:flex;align-items:center;padding:20px}.table-container .table-controls .filter-field{display:flex;align-items:center;justify-content:space-between;padding:10px;flex-direction:row;border:none;border-radius:10px;background-color:var(--input-disabled-bg);width:50%;height:55px}.table-container .table-controls .filter-field input:focus{outline:none!important;box-shadow:none!important;border-color:transparent!important}.table-container .table-controls .filter-field .input-filter{width:100%;box-sizing:border-box;background-color:transparent;border:none;transition:none}.table-container .table-controls .filter-field i{color:var(--icon-collor);margin-left:8px}.table-container .mat-mdc-table{width:max-content;min-width:100%;background-color:var(--table-body-color)}.table-container .mat-mdc-table .mat-mdc-header-cell:first-child,.table-container .mat-mdc-table .mat-mdc-cell:first-child{border-right:none!important}.table-container .mat-mdc-table .mat-mdc-header-cell:not(:first-child),.table-container .mat-mdc-table .mat-mdc-cell:not(:first-child){border-right:1px solid var(--primary)}.table-container .mat-mdc-table .mat-mdc-header-cell:first-child,.table-container .mat-mdc-table .mat-mdc-cell:first-child{width:60px;max-width:60px;min-width:60px;border-right:none}.table-container .mat-mdc-table .mat-mdc-header-row{background-color:var(--table-header)}.table-container .mat-mdc-table .mat-mdc-header-row .mat-mdc-header-cell{border-right:1px solid var(--white);font-weight:600;color:var(--white);border-bottom:1px solid var(--input-background);text-transform:uppercase;font-size:.875rem}.table-container .mat-mdc-table .mat-mdc-header-row .mat-mdc-header-cell:last-child{border-right:none}.table-container .mat-mdc-table .mat-mdc-row{transition:background-color .2s ease}.table-container .mat-mdc-table .mat-mdc-row .mat-mdc-cell{border-right:1px solid var(--primary);color:var(--gray-dark);border-bottom:1px solid var(--input-background)}.table-container .mat-mdc-table .mat-mdc-row .mat-mdc-cell:last-child{border-right:none}.table-container .mat-mdc-table .mat-mdc-row:hover{background-color:#0000000a}.table-container .mat-mdc-table .mat-mdc-row.selected{background-color:#3f51b51a}.table-container .mat-mdc-table .mat-mdc-checkbox{margin-right:12px}.table-container .mat-mdc-table .mat-mdc-checkbox .mdc-checkbox{--mdc-checkbox-unselected-icon-color: var(--gray-dark);--mdc-checkbox-selected-icon-color: var(--info)}.table-container .mat-mdc-table .mat-mdc-footer-row{background-color:var(--table-background);font-weight:600;color:var(--input-disabled-bg)}.table-container .mat-mdc-table .mat-mdc-footer-row .mat-mdc-footer-cell{padding:12px;text-align:left;color:var(--gray-dark)}.table-container span,.table-container img{margin-right:10px}.table-container[_ngcontent-ng-c1530403114] .mat-mdc-table[_ngcontent-ng-c1530403114] .mat-mdc-footer-row[_ngcontent-ng-c1530403114]{display:none}.no-data-container{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:15px;font-size:1.1rem}.no-data-container .no-data-title{color:var(--table-header);margin-bottom:12px}.no-data-container .no-data-message{color:var(--table-header)}@media(max-width:768px){.table-container .table-controls{flex-direction:column;align-items:stretch}.table-container .table-controls .filter-field{margin-right:0;margin-bottom:12px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MaterialModule }, { kind: "component", type: i2$3.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3$2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i5.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i5.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: i1$2.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "directive", type: i7.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i7.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: i8.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i8.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i8.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i8.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i8.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i8.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i8.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i8.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i8.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i8.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i8.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i8.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i8.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i8.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "decoding", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "placeholder", "placeholderConfig", "src", "srcset"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
|
|
2193
2435
|
}
|
|
2194
2436
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseTable, decorators: [{
|
|
2195
2437
|
type: Component,
|
|
@@ -2652,7 +2894,7 @@ class BaseTablePaginated {
|
|
|
2652
2894
|
return this.tableConfig.columnData[column].buttons || [];
|
|
2653
2895
|
}
|
|
2654
2896
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseTablePaginated, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2655
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: BaseTablePaginated, isStandalone: true, selector: "cao-table-paginated", inputs: { getColumnCssClass: "getColumnCssClass", customClass: "customClass", pageSizeOptions: "pageSizeOptions", showFirstLastButtons: "showFirstLastButtons" }, outputs: { pageChanged: "pageChanged", pageSizeChanged: "pageSizeChanged", firstPageClicked: "firstPageClicked", lastPageClicked: "lastPageClicked", selectionChanged: "selectionChanged", pageEvent: "pageEvent", rowClicked: "rowClicked" }, providers: [{ provide: MatPaginatorIntl, useValue: getPtBrPaginatorIntlBasePaginated() }], viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }], ngImport: i0, template: "<div class=\"table-container\" [ngClass]=\"customClass\">\n @if (tableConfig) {\n <table mat-table matSort [dataSource]=\"dataSource\" (matSortChange)=\"announceSortChange($event)\">\n @for (column of displayedColumns; track column) {\n <ng-container [matColumnDef]=\"column\">\n <th *matHeaderCellDef mat-header-cell mat-sort-header class=\"table-header\">\n {{ getColumnHeader(column) }}\n </th>\n <td *matCellDef=\"let element\" mat-cell class=\"table-cell\">\n @switch (getColumnType(column)) { @case ('STRING') { @if (getColumnCssClass &&\n getColumnCssClass(column, element[getColumnElement(column)])) {\n <span [class]=\"getColumnCssClass(column, element[getColumnElement(column)])\">\n {{ element[getColumnElement(column)] }}\n </span>\n } @else {\n <span>{{ element[getColumnElement(column)] }}</span>\n } } @case ('BOOLEAN') {\n <mat-checkbox disabled [checked]=\"element[getColumnElement(column)]\" />\n } @case ('DATE') {\n <span>{{ element[getColumnElement(column)] | date:'mediumDate' }}</span>\n } @case ('NUMBER') {\n <span>{{ element[getColumnElement(column)] | number:'1.2-2' }}</span>\n } @case ('SINGLE_BUTTON') {\n <div>\n @for (btn of getColumnButtons(column); track btn) {\n <button type=\"button\" mat-icon-button [matTooltip]=\"btn.tooltip\" (click)=\"btn.onClick(element)\">\n <mat-icon>{{ btn.icon }}</mat-icon>\n </button>\n }\n </div>\n } }\n </td>\n </ng-container>\n }\n\n <ng-container matColumnDef=\"footer\">\n <td\n *matFooterCellDef\n mat-footer-cell\n class=\"table-cell\"\n [attr.colspan]=\"displayedColumns.length\">\n Total de Registros: {{ totalItems }}\n </td>\n </ng-container>\n\n <tr *matHeaderRowDef=\"displayedColumns\" mat-header-row></tr>\n <tr *matRowDef=\"let row; columns: displayedColumns;\" mat-row (click)=\"onRowClick(row)\"></tr>\n <tr *matFooterRowDef=\"['footer']\" mat-footer-row class=\"mat-row-footer\"></tr>\n </table>\n @if(totalItems > 0){\n\n <mat-paginator\n #paginator\n aria-label=\"Select page\"\n [length]=\"totalItems\"\n [pageSize]=\"pageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n [pageIndex]=\"currentPage - 1\"\n [hidePageSize]=\"false\"\n [showFirstLastButtons]=\"showFirstLastButtons\"\n (page)=\"onPageEvent($event)\" />\n } @else {\n <div class=\"no-data-container\">\n <h2>{{ tableConfig?.result?.noData ?? 'N\u00E3o h\u00E1 dados dispon\u00EDveis' }}</h2>\n <p>{{ tableConfig?.result?.defaultMessage ?? 'Adicione alguns dados' }}</p>\n </div>\n } }\n</div>\n", styles: [".table-container{border-radius:8px;box-shadow:0 4px 6px #0000001a;overflow:hidden}.table-container .table-controls{display:flex;align-items:center;padding:20px;justify-content:center}.table-container .table-controls .filter-field{display:flex;align-items:center;justify-content:space-between;padding:10px;flex-direction:row;border:none;border-radius:10px;background-color:var(--input-disabled-bg);width:50%;height:55px;margin:0 auto}.table-container .table-controls .filter-field input:focus{outline:none!important;box-shadow:none!important;border-color:transparent!important}.table-container .table-controls .filter-field .input-filter{width:100%;box-sizing:border-box;background-color:transparent;border:none;transition:none;text-align:center}.table-container .table-controls .filter-field i{color:var(--icon-collor);margin-left:8px}.table-container .mat-mdc-table{width:100%}.table-container .mat-mdc-table .mat-mdc-header-row .mat-mdc-header-cell{border-right:1px solid var(--data-bg);font-weight:600;color:var(--message-color);border-bottom:1px solid var(--input-background);text-transform:uppercase;font-size:.875rem;text-align:center;padding:12px;vertical-align:middle}.table-container .mat-mdc-table .mat-mdc-header-row .mat-mdc-header-cell:last-child{border-right:none}.table-container .mat-mdc-table .mat-mdc-header-row .mat-mdc-header-cell .mat-sort-header-container{justify-content:center}.table-container .mat-mdc-table .mat-mdc-row{transition:background-color .2s ease;background-color:transparent}.table-container .mat-mdc-table .mat-mdc-row:nth-child(2n){background-color:transparent}.table-container .mat-mdc-table .mat-mdc-row:nth-child(odd){background-color:var(--input-background)}.table-container .mat-mdc-table .mat-mdc-row .mat-mdc-cell{border-right:1px solid var(--border-table-ligth);color:var(--gray-dark);border-bottom:1px solid var(--input-background);text-align:center;padding:12px;vertical-align:middle}.table-container .mat-mdc-table .mat-mdc-row .mat-mdc-cell:last-child{border-right:none}.table-container .mat-mdc-table .mat-mdc-row:hover{background-color:#0000000a}.table-container .mat-mdc-table .mat-mdc-row.selected{background-color:#3f51b51a}.table-container .mat-mdc-table .mat-mdc-checkbox{margin:0 auto;display:block}.table-container .mat-mdc-table .mat-mdc-checkbox .mdc-checkbox{--mdc-checkbox-unselected-icon-color: var(--gray-dark);--mdc-checkbox-selected-icon-color: var(--info)}.table-container .mat-mdc-table .mat-mdc-footer-row{background-color:var(--table-background);font-weight:600;color:var(--text-color)}.table-container .mat-mdc-table .mat-mdc-footer-row .mat-mdc-footer-cell{padding:12px;text-align:center}.table-container .no-data-container{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;text-align:center;background-color:var(--table-background)}.table-container .no-data-container h2{color:var(--input-disabled-bg);margin-bottom:12px}.table-container .no-data-container p{color:var(--input-disabled-bg)}@media(width<=768px){.table-container .table-controls{flex-direction:column;align-items:center}.table-container .table-controls .filter-field{width:80%;margin-right:0;margin-bottom:12px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MaterialModule }, { kind: "component", type: i2$2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: i4$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i1$2.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "directive", type: i7.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i7.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: i8.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i8.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i8.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i8.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i8.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i8.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i8.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i8.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i8.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i8.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i8.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i8.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i8.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i8.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1.DatePipe, name: "date" }], encapsulation: i0.ViewEncapsulation.None });
|
|
2897
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: BaseTablePaginated, isStandalone: true, selector: "cao-table-paginated", inputs: { getColumnCssClass: "getColumnCssClass", customClass: "customClass", pageSizeOptions: "pageSizeOptions", showFirstLastButtons: "showFirstLastButtons" }, outputs: { pageChanged: "pageChanged", pageSizeChanged: "pageSizeChanged", firstPageClicked: "firstPageClicked", lastPageClicked: "lastPageClicked", selectionChanged: "selectionChanged", pageEvent: "pageEvent", rowClicked: "rowClicked" }, providers: [{ provide: MatPaginatorIntl, useValue: getPtBrPaginatorIntlBasePaginated() }], viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }], ngImport: i0, template: "<div class=\"table-container\" [ngClass]=\"customClass\">\n @if (tableConfig) {\n <table mat-table matSort [dataSource]=\"dataSource\" (matSortChange)=\"announceSortChange($event)\">\n @for (column of displayedColumns; track column) {\n <ng-container [matColumnDef]=\"column\">\n <th *matHeaderCellDef mat-header-cell mat-sort-header class=\"table-header\">\n {{ getColumnHeader(column) }}\n </th>\n <td *matCellDef=\"let element\" mat-cell class=\"table-cell\">\n @switch (getColumnType(column)) { @case ('STRING') { @if (getColumnCssClass &&\n getColumnCssClass(column, element[getColumnElement(column)])) {\n <span [class]=\"getColumnCssClass(column, element[getColumnElement(column)])\">\n {{ element[getColumnElement(column)] }}\n </span>\n } @else {\n <span>{{ element[getColumnElement(column)] }}</span>\n } } @case ('BOOLEAN') {\n <mat-checkbox disabled [checked]=\"element[getColumnElement(column)]\" />\n } @case ('DATE') {\n <span>{{ element[getColumnElement(column)] | date:'mediumDate' }}</span>\n } @case ('NUMBER') {\n <span>{{ element[getColumnElement(column)] | number:'1.2-2' }}</span>\n } @case ('SINGLE_BUTTON') {\n <div>\n @for (btn of getColumnButtons(column); track btn) {\n <button type=\"button\" mat-icon-button [matTooltip]=\"btn.tooltip\" (click)=\"btn.onClick(element)\">\n <mat-icon>{{ btn.icon }}</mat-icon>\n </button>\n }\n </div>\n } }\n </td>\n </ng-container>\n }\n\n <ng-container matColumnDef=\"footer\">\n <td\n *matFooterCellDef\n mat-footer-cell\n class=\"table-cell\"\n [attr.colspan]=\"displayedColumns.length\">\n Total de Registros: {{ totalItems }}\n </td>\n </ng-container>\n\n <tr *matHeaderRowDef=\"displayedColumns\" mat-header-row></tr>\n <tr *matRowDef=\"let row; columns: displayedColumns;\" mat-row (click)=\"onRowClick(row)\"></tr>\n <tr *matFooterRowDef=\"['footer']\" mat-footer-row class=\"mat-row-footer\"></tr>\n </table>\n @if(totalItems > 0){\n\n <mat-paginator\n #paginator\n aria-label=\"Select page\"\n [length]=\"totalItems\"\n [pageSize]=\"pageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n [pageIndex]=\"currentPage - 1\"\n [hidePageSize]=\"false\"\n [showFirstLastButtons]=\"showFirstLastButtons\"\n (page)=\"onPageEvent($event)\" />\n } @else {\n <div class=\"no-data-container\">\n <h2>{{ tableConfig?.result?.noData ?? 'N\u00E3o h\u00E1 dados dispon\u00EDveis' }}</h2>\n <p>{{ tableConfig?.result?.defaultMessage ?? 'Adicione alguns dados' }}</p>\n </div>\n } }\n</div>\n", styles: [".table-container{border-radius:8px;box-shadow:0 4px 6px #0000001a;overflow:hidden}.table-container .table-controls{display:flex;align-items:center;padding:20px;justify-content:center}.table-container .table-controls .filter-field{display:flex;align-items:center;justify-content:space-between;padding:10px;flex-direction:row;border:none;border-radius:10px;background-color:var(--input-disabled-bg);width:50%;height:55px;margin:0 auto}.table-container .table-controls .filter-field input:focus{outline:none!important;box-shadow:none!important;border-color:transparent!important}.table-container .table-controls .filter-field .input-filter{width:100%;box-sizing:border-box;background-color:transparent;border:none;transition:none;text-align:center}.table-container .table-controls .filter-field i{color:var(--icon-collor);margin-left:8px}.table-container .mat-mdc-table{width:100%}.table-container .mat-mdc-table .mat-mdc-header-row .mat-mdc-header-cell{border-right:1px solid var(--data-bg);font-weight:600;color:var(--message-color);border-bottom:1px solid var(--input-background);text-transform:uppercase;font-size:.875rem;text-align:center;padding:12px;vertical-align:middle}.table-container .mat-mdc-table .mat-mdc-header-row .mat-mdc-header-cell:last-child{border-right:none}.table-container .mat-mdc-table .mat-mdc-header-row .mat-mdc-header-cell .mat-sort-header-container{justify-content:center}.table-container .mat-mdc-table .mat-mdc-row{transition:background-color .2s ease;background-color:transparent}.table-container .mat-mdc-table .mat-mdc-row:nth-child(2n){background-color:transparent}.table-container .mat-mdc-table .mat-mdc-row:nth-child(odd){background-color:var(--input-background)}.table-container .mat-mdc-table .mat-mdc-row .mat-mdc-cell{border-right:1px solid var(--border-table-ligth);color:var(--gray-dark);border-bottom:1px solid var(--input-background);text-align:center;padding:12px;vertical-align:middle}.table-container .mat-mdc-table .mat-mdc-row .mat-mdc-cell:last-child{border-right:none}.table-container .mat-mdc-table .mat-mdc-row:hover{background-color:#0000000a}.table-container .mat-mdc-table .mat-mdc-row.selected{background-color:#3f51b51a}.table-container .mat-mdc-table .mat-mdc-checkbox{margin:0 auto;display:block}.table-container .mat-mdc-table .mat-mdc-checkbox .mdc-checkbox{--mdc-checkbox-unselected-icon-color: var(--gray-dark);--mdc-checkbox-selected-icon-color: var(--info)}.table-container .mat-mdc-table .mat-mdc-footer-row{background-color:var(--table-background);font-weight:600;color:var(--text-color)}.table-container .mat-mdc-table .mat-mdc-footer-row .mat-mdc-footer-cell{padding:12px;text-align:center}.table-container .no-data-container{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;text-align:center;background-color:var(--table-background)}.table-container .no-data-container h2{color:var(--input-disabled-bg);margin-bottom:12px}.table-container .no-data-container p{color:var(--input-disabled-bg)}@media(width<=768px){.table-container .table-controls{flex-direction:column;align-items:center}.table-container .table-controls .filter-field{width:80%;margin-right:0;margin-bottom:12px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MaterialModule }, { kind: "component", type: i2$3.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3$2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i1$2.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "directive", type: i7.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i7.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: i8.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i8.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i8.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i8.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i8.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i8.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i8.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i8.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i8.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i8.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i8.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i8.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i8.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i8.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "directive", type: i3.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1.DatePipe, name: "date" }], encapsulation: i0.ViewEncapsulation.None });
|
|
2656
2898
|
}
|
|
2657
2899
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseTablePaginated, decorators: [{
|
|
2658
2900
|
type: Component,
|