ngx-opalbytes-components 1.21.0 → 1.23.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.
- package/README.md +173 -0
- package/fesm2022/ngx-opalbytes-components.mjs +464 -20
- package/fesm2022/ngx-opalbytes-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/shared/components/error/error.css +10 -0
- package/src/lib/shared/components/error/error.html +5 -0
- package/src/lib/shared/components/error/error.spec.ts +76 -0
- package/src/lib/shared/components/error/error.stories.ts +61 -0
- package/src/lib/shared/components/error/error.ts +33 -0
- package/src/lib/shared/components/form-field/error-state-matcher.ts +41 -0
- package/src/lib/shared/components/form-field/form-field-control.ts +10 -0
- package/src/lib/shared/components/form-field/form-field.css +154 -0
- package/src/lib/shared/components/form-field/form-field.html +51 -0
- package/src/lib/shared/components/form-field/form-field.spec.ts +114 -0
- package/src/lib/shared/components/form-field/form-field.stories.ts +177 -0
- package/src/lib/shared/components/form-field/form-field.ts +118 -0
- package/src/lib/shared/components/hint/hint.css +10 -0
- package/src/lib/shared/components/hint/hint.html +1 -0
- package/src/lib/shared/components/hint/hint.spec.ts +22 -0
- package/src/lib/shared/components/hint/hint.stories.ts +53 -0
- package/src/lib/shared/components/hint/hint.ts +9 -0
- package/src/lib/shared/components/index.ts +12 -1
- package/src/lib/shared/components/skeleton/skeleton.css +92 -0
- package/src/lib/shared/components/skeleton/skeleton.html +3 -0
- package/src/lib/shared/components/skeleton/skeleton.spec.ts +22 -0
- package/src/lib/shared/components/skeleton/skeleton.stories.ts +131 -0
- package/src/lib/shared/components/skeleton/skeleton.ts +46 -0
- package/types/ngx-opalbytes-components.d.ts +178 -2
|
@@ -1,12 +1,12 @@
|
|
|
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, ChangeDetectorRef, Renderer2, ViewContainerRef, forwardRef, HostListener, ChangeDetectionStrategy, ViewEncapsulation, NgModule, ContentChildren, Directive, TemplateRef, ContentChild, signal, PLATFORM_ID, ViewChildren, HostBinding, input, 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, input, computed, Injectable } from '@angular/core';
|
|
5
5
|
import * as i3 from '@angular/material/tooltip';
|
|
6
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
6
|
+
import { MatTooltipModule, MatTooltip } from '@angular/material/tooltip';
|
|
7
7
|
import { LucideDynamicIcon } from '@lucide/angular';
|
|
8
8
|
import * as i2 from '@angular/forms';
|
|
9
|
-
import { FormsModule, NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
9
|
+
import { FormsModule, NG_VALUE_ACCESSOR, FormControl, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
10
10
|
import { NgxMaskDirective, provideNgxMask } from 'ngx-mask';
|
|
11
11
|
import * as i2$1 from '@angular/material/datepicker';
|
|
12
12
|
import { MatDatepickerModule, MatDateRangeInput } from '@angular/material/datepicker';
|
|
@@ -14,13 +14,13 @@ import * as i1$1 from '@angular/material/form-field';
|
|
|
14
14
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
15
15
|
import * as i3$1 from '@angular/material/input';
|
|
16
16
|
import { MatInputModule } from '@angular/material/input';
|
|
17
|
-
import * as i1$
|
|
17
|
+
import * as i1$5 from '@angular/cdk/overlay';
|
|
18
18
|
import { Overlay, OverlayModule } from '@angular/cdk/overlay';
|
|
19
19
|
import { TemplatePortal, ComponentPortal } from '@angular/cdk/portal';
|
|
20
20
|
import * as i2$2 from '@angular/cdk/scrolling';
|
|
21
21
|
import { ScrollDispatcher, CdkScrollable } from '@angular/cdk/scrolling';
|
|
22
22
|
import { BehaviorSubject, Subscription, combineLatest, startWith, map, Subject } from 'rxjs';
|
|
23
|
-
import * as
|
|
23
|
+
import * as i1$2 from '@angular/material/icon';
|
|
24
24
|
import { MatIconModule } from '@angular/material/icon';
|
|
25
25
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
26
26
|
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
@@ -30,7 +30,7 @@ import { MatCardModule } from '@angular/material/card';
|
|
|
30
30
|
import * as i3$2 from '@angular/material/checkbox';
|
|
31
31
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
32
32
|
import { MatChipsModule } from '@angular/material/chips';
|
|
33
|
-
import * as i1$
|
|
33
|
+
import * as i1$4 from '@angular/material/core';
|
|
34
34
|
import { MatNativeDateModule, MAT_DATE_LOCALE } from '@angular/material/core';
|
|
35
35
|
import { MatDialogModule } from '@angular/material/dialog';
|
|
36
36
|
import { MatDividerModule } from '@angular/material/divider';
|
|
@@ -38,7 +38,7 @@ import { MatExpansionModule } from '@angular/material/expansion';
|
|
|
38
38
|
import { MatListModule } from '@angular/material/list';
|
|
39
39
|
import * as i5 from '@angular/material/menu';
|
|
40
40
|
import { MatMenuModule } from '@angular/material/menu';
|
|
41
|
-
import * as i1$
|
|
41
|
+
import * as i1$3 from '@angular/material/paginator';
|
|
42
42
|
import { MatPaginatorModule, MatPaginatorIntl, MatPaginator } from '@angular/material/paginator';
|
|
43
43
|
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
44
44
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
@@ -53,7 +53,7 @@ import { MatSortModule, MatSort } from '@angular/material/sort';
|
|
|
53
53
|
import * as i8 from '@angular/material/table';
|
|
54
54
|
import { MatTableModule, MatTableDataSource } from '@angular/material/table';
|
|
55
55
|
import { MatTabsModule } from '@angular/material/tabs';
|
|
56
|
-
import * as i4
|
|
56
|
+
import * as i4 from '@angular/material/timepicker';
|
|
57
57
|
import { MatTimepickerModule } from '@angular/material/timepicker';
|
|
58
58
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
59
59
|
import { MatTreeModule } from '@angular/material/tree';
|
|
@@ -1125,7 +1125,7 @@ class CaoDropDownComponent {
|
|
|
1125
1125
|
useExisting: forwardRef(() => CaoDropDownComponent),
|
|
1126
1126
|
multi: true,
|
|
1127
1127
|
},
|
|
1128
|
-
], 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:
|
|
1128
|
+
], 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: i1$2.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 });
|
|
1129
1129
|
}
|
|
1130
1130
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoDropDownComponent, decorators: [{
|
|
1131
1131
|
type: Component,
|
|
@@ -1374,7 +1374,7 @@ class Paginator {
|
|
|
1374
1374
|
this.pageEvent.emit(event);
|
|
1375
1375
|
}
|
|
1376
1376
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: Paginator, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1377
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: Paginator, isStandalone: true, selector: "cao-paginator", inputs: { totalItems: "totalItems", pageSize: "pageSize", currentPage: "currentPage", pageSizeOptions: "pageSizeOptions", customClass: "customClass", showFirstLastButtons: "showFirstLastButtons" }, outputs: { pageEvent: "pageEvent" }, ngImport: i0, template: "<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)\" />", styles: [""], dependencies: [{ kind: "ngmodule", type: MaterialModule }, { kind: "component", type: i1$
|
|
1377
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: Paginator, isStandalone: true, selector: "cao-paginator", inputs: { totalItems: "totalItems", pageSize: "pageSize", currentPage: "currentPage", pageSizeOptions: "pageSizeOptions", customClass: "customClass", showFirstLastButtons: "showFirstLastButtons" }, outputs: { pageEvent: "pageEvent" }, ngImport: i0, template: "<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)\" />", styles: [""], dependencies: [{ kind: "ngmodule", type: MaterialModule }, { kind: "component", type: i1$3.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }] });
|
|
1378
1378
|
}
|
|
1379
1379
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: Paginator, decorators: [{
|
|
1380
1380
|
type: Component,
|
|
@@ -1461,13 +1461,13 @@ class TimePicker {
|
|
|
1461
1461
|
setDisabledState(isDisabled) {
|
|
1462
1462
|
this.isDisabled = isDisabled;
|
|
1463
1463
|
}
|
|
1464
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TimePicker, deps: [{ token: i1$
|
|
1465
|
-
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
|
|
1464
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TimePicker, deps: [{ token: i1$4.DateAdapter }], target: i0.ɵɵFactoryTarget.Component });
|
|
1465
|
+
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.MatTimepicker, selector: "mat-timepicker", inputs: ["interval", "options", "disableRipple", "aria-label", "aria-labelledby"], outputs: ["selected", "opened", "closed"], exportAs: ["matTimepicker"] }, { kind: "directive", type: i4.MatTimepickerInput, selector: "input[matTimepicker]", inputs: ["value", "matTimepicker", "matTimepickerMin", "matTimepickerMax", "matTimepickerOpenOnClick", "disabled"], outputs: ["valueChange"], exportAs: ["matTimepickerInput"] }, { kind: "component", type: i4.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 });
|
|
1466
1466
|
}
|
|
1467
1467
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TimePicker, decorators: [{
|
|
1468
1468
|
type: Component,
|
|
1469
1469
|
args: [{ selector: 'cao-time-picker', imports: [MaterialModule, CommonModule, ReactiveFormsModule,], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, 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"] }]
|
|
1470
|
-
}], ctorParameters: () => [{ type: i1$
|
|
1470
|
+
}], ctorParameters: () => [{ type: i1$4.DateAdapter }], propDecorators: { control: [{
|
|
1471
1471
|
type: Input
|
|
1472
1472
|
}], isDisabled: [{
|
|
1473
1473
|
type: Input
|
|
@@ -1878,6 +1878,450 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
1878
1878
|
args: [{ selector: "cao-kpi", imports: [CommonModule], standalone: true, template: "<div\n class=\"flex flex-col py-2 pt-2.25 px-3.75 rounded-card border-b w-46.25 bg-(--color-white)\"\n [style.border-color]=\"kpiData().borderColor\">\n <div class=\"flex w-full justify-end\">\n <img class=\"w-6 h-6 mr-2\" [src]=\"kpiData().icon.src\" [alt]=\"kpiData().icon.alt\" />\n </div>\n <div class=\"flex flex-col pl-1.5\">\n <p class=\"text-2xl\" [style.color]=\"kpiData().textColor\">{{ kpiData().value }}</p>\n <h3 class=\"text-base\" [style.color]=\"kpiData().textColor\">{{ kpiData().title }}</h3>\n </div>\n</div>\n" }]
|
|
1879
1879
|
}], propDecorators: { kpiData: [{ type: i0.Input, args: [{ isSignal: true, alias: "kpiData", required: true }] }] } });
|
|
1880
1880
|
|
|
1881
|
+
class CaoSkeletonComponent {
|
|
1882
|
+
borderRadius = input('14px', ...(ngDevMode ? [{ debugName: "borderRadius" }] : []));
|
|
1883
|
+
width = input('100%', ...(ngDevMode ? [{ debugName: "width" }] : []));
|
|
1884
|
+
height = input('100%', ...(ngDevMode ? [{ debugName: "height" }] : []));
|
|
1885
|
+
bgColor = input("#e2e8f0", ...(ngDevMode ? [{ debugName: "bgColor" }] : []));
|
|
1886
|
+
shine = input("#f8fafc", ...(ngDevMode ? [{ debugName: "shine" }] : []));
|
|
1887
|
+
variant = input('rect', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
1888
|
+
speed = input('2s', ...(ngDevMode ? [{ debugName: "speed" }] : []));
|
|
1889
|
+
size = input(...(ngDevMode ? [undefined, { debugName: "size" }] : []));
|
|
1890
|
+
animationDeg = input('90deg', ...(ngDevMode ? [{ debugName: "animationDeg" }] : []));
|
|
1891
|
+
skeletonStyles = computed(() => {
|
|
1892
|
+
const styles = {
|
|
1893
|
+
'--skeleton-width': this.size() || this.width(),
|
|
1894
|
+
'--skeleton-height': this.size() || this.height(),
|
|
1895
|
+
'--skeleton-speed': this.speed(),
|
|
1896
|
+
'--skeleton-animation-deg': this.animationDeg(),
|
|
1897
|
+
};
|
|
1898
|
+
if (this.bgColor()) {
|
|
1899
|
+
styles['--skeleton-bg'] = this.bgColor();
|
|
1900
|
+
}
|
|
1901
|
+
if (this.shine()) {
|
|
1902
|
+
styles['--skeleton-shine'] = this.shine();
|
|
1903
|
+
}
|
|
1904
|
+
if (this.variant() !== 'circle') {
|
|
1905
|
+
styles['--skeleton-radius'] = this.borderRadius();
|
|
1906
|
+
}
|
|
1907
|
+
return styles;
|
|
1908
|
+
}, ...(ngDevMode ? [{ debugName: "skeletonStyles" }] : []));
|
|
1909
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoSkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1910
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: CaoSkeletonComponent, isStandalone: true, selector: "cao-skeleton", inputs: { borderRadius: { classPropertyName: "borderRadius", publicName: "borderRadius", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, bgColor: { classPropertyName: "bgColor", publicName: "bgColor", isSignal: true, isRequired: false, transformFunction: null }, shine: { classPropertyName: "shine", publicName: "shine", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, speed: { classPropertyName: "speed", publicName: "speed", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, animationDeg: { classPropertyName: "animationDeg", publicName: "animationDeg", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<span class=\"cao-skeleton\" [ngClass]=\"'cao-skeleton--' + variant()\" [style]=\"skeletonStyles()\">\n <span class=\"cao-skeleton__shimmer\"></span>\n</span>", styles: [":host{--skeleton-width: 100%;--skeleton-height: 100%;--skeleton-bg: #e2e8f0;--skeleton-shine: #f8fafc;--skeleton-radius: 14px;--skeleton-speed: 2s;--skeleton-animation-deg: 90deg;display:contents}.cao-skeleton{position:relative;display:block;overflow:hidden;width:var(--skeleton-width);height:var(--skeleton-height);background-color:var(--skeleton-bg);border-radius:var(--skeleton-radius);color:transparent;-webkit-user-select:none;user-select:none;pointer-events:none}@media(prefers-reduced-motion:no-preference){.cao-skeleton{will-change:transform}}.cao-skeleton--circle{--skeleton-radius: 50%;aspect-ratio:1 / 1}.cao-skeleton--text{--skeleton-radius: 4px;height:1em;width:var(--skeleton-width)}.cao-skeleton__shimmer{position:absolute;inset:0;background:linear-gradient(var(--skeleton-animation-deg),transparent 30%,var(--skeleton-shine) 50%,transparent 70%);background-size:200% 100%}@media(prefers-reduced-motion:no-preference){.cao-skeleton__shimmer{animation:skeleton-shimmer var(--skeleton-speed) ease-in-out infinite}}@keyframes skeleton-shimmer{0%{background-position:200% center}to{background-position:-200% center}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1911
|
+
}
|
|
1912
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoSkeletonComponent, decorators: [{
|
|
1913
|
+
type: Component,
|
|
1914
|
+
args: [{ selector: 'cao-skeleton', imports: [CommonModule], template: "<span class=\"cao-skeleton\" [ngClass]=\"'cao-skeleton--' + variant()\" [style]=\"skeletonStyles()\">\n <span class=\"cao-skeleton__shimmer\"></span>\n</span>", styles: [":host{--skeleton-width: 100%;--skeleton-height: 100%;--skeleton-bg: #e2e8f0;--skeleton-shine: #f8fafc;--skeleton-radius: 14px;--skeleton-speed: 2s;--skeleton-animation-deg: 90deg;display:contents}.cao-skeleton{position:relative;display:block;overflow:hidden;width:var(--skeleton-width);height:var(--skeleton-height);background-color:var(--skeleton-bg);border-radius:var(--skeleton-radius);color:transparent;-webkit-user-select:none;user-select:none;pointer-events:none}@media(prefers-reduced-motion:no-preference){.cao-skeleton{will-change:transform}}.cao-skeleton--circle{--skeleton-radius: 50%;aspect-ratio:1 / 1}.cao-skeleton--text{--skeleton-radius: 4px;height:1em;width:var(--skeleton-width)}.cao-skeleton__shimmer{position:absolute;inset:0;background:linear-gradient(var(--skeleton-animation-deg),transparent 30%,var(--skeleton-shine) 50%,transparent 70%);background-size:200% 100%}@media(prefers-reduced-motion:no-preference){.cao-skeleton__shimmer{animation:skeleton-shimmer var(--skeleton-speed) ease-in-out infinite}}@keyframes skeleton-shimmer{0%{background-position:200% center}to{background-position:-200% center}}\n"] }]
|
|
1915
|
+
}], propDecorators: { borderRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderRadius", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], bgColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "bgColor", required: false }] }], shine: [{ type: i0.Input, args: [{ isSignal: true, alias: "shine", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], speed: [{ type: i0.Input, args: [{ isSignal: true, alias: "speed", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], animationDeg: [{ type: i0.Input, args: [{ isSignal: true, alias: "animationDeg", required: false }] }] } });
|
|
1916
|
+
|
|
1917
|
+
class CaoFormField extends CaoBaseIcon {
|
|
1918
|
+
inputBackground = input(...(ngDevMode ? [undefined, { debugName: "inputBackground" }] : []));
|
|
1919
|
+
borderColor = input(...(ngDevMode ? [undefined, { debugName: "borderColor" }] : []));
|
|
1920
|
+
borderWidth = input(...(ngDevMode ? [undefined, { debugName: "borderWidth" }] : []));
|
|
1921
|
+
borderRadius = input(...(ngDevMode ? [undefined, { debugName: "borderRadius" }] : []));
|
|
1922
|
+
errorColor = input(...(ngDevMode ? [undefined, { debugName: "errorColor" }] : []));
|
|
1923
|
+
labelColor = input(...(ngDevMode ? [undefined, { debugName: "labelColor" }] : []));
|
|
1924
|
+
hintColor = input(...(ngDevMode ? [undefined, { debugName: "hintColor" }] : []));
|
|
1925
|
+
textColor = input(...(ngDevMode ? [undefined, { debugName: "textColor" }] : []));
|
|
1926
|
+
focusBorderColor = input(...(ngDevMode ? [undefined, { debugName: "focusBorderColor" }] : []));
|
|
1927
|
+
successBorderColor = input(...(ngDevMode ? [undefined, { debugName: "successBorderColor" }] : []));
|
|
1928
|
+
formFieldStyles = computed(() => {
|
|
1929
|
+
const styles = {};
|
|
1930
|
+
if (this.inputBackground()) {
|
|
1931
|
+
styles['--cao-form-field-bg-background'] = this.inputBackground();
|
|
1932
|
+
}
|
|
1933
|
+
if (this.borderColor()) {
|
|
1934
|
+
styles['--cao-form-field-border-color'] = this.borderColor();
|
|
1935
|
+
}
|
|
1936
|
+
if (this.borderWidth()) {
|
|
1937
|
+
styles['--cao-form-field-border-width'] = this.borderWidth();
|
|
1938
|
+
}
|
|
1939
|
+
if (this.borderRadius()) {
|
|
1940
|
+
styles['--cao-form-field-border-radius'] = this.borderRadius();
|
|
1941
|
+
}
|
|
1942
|
+
if (this.errorColor()) {
|
|
1943
|
+
styles['--cao-form-field-color-error'] = this.errorColor();
|
|
1944
|
+
}
|
|
1945
|
+
if (this.labelColor()) {
|
|
1946
|
+
styles['--cao-form-field-color-label'] = this.labelColor();
|
|
1947
|
+
}
|
|
1948
|
+
if (this.hintColor()) {
|
|
1949
|
+
styles['--cao-form-field-color-hint'] = this.hintColor();
|
|
1950
|
+
}
|
|
1951
|
+
if (this.textColor()) {
|
|
1952
|
+
styles['--cao-form-field-color-text'] = this.textColor();
|
|
1953
|
+
}
|
|
1954
|
+
if (this.focusBorderColor()) {
|
|
1955
|
+
styles['--cao-form-field-focus-border'] = this.focusBorderColor();
|
|
1956
|
+
}
|
|
1957
|
+
if (this.successBorderColor()) {
|
|
1958
|
+
styles['--cao-form-field-success-border'] = this.successBorderColor();
|
|
1959
|
+
}
|
|
1960
|
+
return styles;
|
|
1961
|
+
}, ...(ngDevMode ? [{ debugName: "formFieldStyles" }] : []));
|
|
1962
|
+
label = '';
|
|
1963
|
+
labelInside = false;
|
|
1964
|
+
hintLabel = '';
|
|
1965
|
+
control = null;
|
|
1966
|
+
forId = '';
|
|
1967
|
+
errorStateMatcher;
|
|
1968
|
+
leadingIcon;
|
|
1969
|
+
trailingIcon;
|
|
1970
|
+
_isSubmitted = false;
|
|
1971
|
+
_focused = false;
|
|
1972
|
+
get id() {
|
|
1973
|
+
return this.forId;
|
|
1974
|
+
}
|
|
1975
|
+
get disabled() {
|
|
1976
|
+
return !!this.control?.disabled;
|
|
1977
|
+
}
|
|
1978
|
+
get required() {
|
|
1979
|
+
if (!this.control) {
|
|
1980
|
+
return false;
|
|
1981
|
+
}
|
|
1982
|
+
const hasValidator = typeof this.control.hasValidator === 'function'
|
|
1983
|
+
? this.control.hasValidator(Validators.required)
|
|
1984
|
+
: false;
|
|
1985
|
+
return hasValidator;
|
|
1986
|
+
}
|
|
1987
|
+
get floating() {
|
|
1988
|
+
return this._focused || !!this.control?.value;
|
|
1989
|
+
}
|
|
1990
|
+
get errorStateActive() {
|
|
1991
|
+
const control = this.control;
|
|
1992
|
+
if (!control) {
|
|
1993
|
+
return false;
|
|
1994
|
+
}
|
|
1995
|
+
const matcher = this.errorStateMatcher;
|
|
1996
|
+
return matcher
|
|
1997
|
+
? matcher.isErrorState(control, this)
|
|
1998
|
+
: !!(control.invalid && (control.touched || control.dirty || this._isSubmitted));
|
|
1999
|
+
}
|
|
2000
|
+
onFocusIn() {
|
|
2001
|
+
this._focused = true;
|
|
2002
|
+
if (this.control && !this._isSubmitted) {
|
|
2003
|
+
this.control.markAsTouched();
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
onFocusOut() {
|
|
2007
|
+
this._focused = false;
|
|
2008
|
+
}
|
|
2009
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoFormField, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2010
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: CaoFormField, isStandalone: true, selector: "cao-form-field", inputs: { inputBackground: { classPropertyName: "inputBackground", publicName: "inputBackground", isSignal: true, isRequired: false, transformFunction: null }, borderColor: { classPropertyName: "borderColor", publicName: "borderColor", isSignal: true, isRequired: false, transformFunction: null }, borderWidth: { classPropertyName: "borderWidth", publicName: "borderWidth", isSignal: true, isRequired: false, transformFunction: null }, borderRadius: { classPropertyName: "borderRadius", publicName: "borderRadius", isSignal: true, isRequired: false, transformFunction: null }, errorColor: { classPropertyName: "errorColor", publicName: "errorColor", isSignal: true, isRequired: false, transformFunction: null }, labelColor: { classPropertyName: "labelColor", publicName: "labelColor", isSignal: true, isRequired: false, transformFunction: null }, hintColor: { classPropertyName: "hintColor", publicName: "hintColor", isSignal: true, isRequired: false, transformFunction: null }, textColor: { classPropertyName: "textColor", publicName: "textColor", isSignal: true, isRequired: false, transformFunction: null }, focusBorderColor: { classPropertyName: "focusBorderColor", publicName: "focusBorderColor", isSignal: true, isRequired: false, transformFunction: null }, successBorderColor: { classPropertyName: "successBorderColor", publicName: "successBorderColor", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, labelInside: { classPropertyName: "labelInside", publicName: "labelInside", isSignal: false, isRequired: false, transformFunction: null }, hintLabel: { classPropertyName: "hintLabel", publicName: "hintLabel", isSignal: false, isRequired: false, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: false, isRequired: false, transformFunction: null }, forId: { classPropertyName: "forId", publicName: "forId", isSignal: false, isRequired: false, transformFunction: null }, errorStateMatcher: { classPropertyName: "errorStateMatcher", publicName: "errorStateMatcher", isSignal: false, isRequired: false, transformFunction: null }, leadingIcon: { classPropertyName: "leadingIcon", publicName: "leadingIcon", isSignal: false, isRequired: false, transformFunction: null }, trailingIcon: { classPropertyName: "trailingIcon", publicName: "trailingIcon", isSignal: false, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0, template: "<div\n class=\"cao-form-field\"\n [class.label-inside]=\"labelInside\"\n [class.error-state]=\"errorStateActive\"\n [class.disabled]=\"disabled\"\n [class.required]=\"required\"\n [style]=\"formFieldStyles()\">\n @if (label && !labelInside) {\n <label class=\"cao-form-field__label\" [for]=\"forId\">{{ label }}</label>\n }\n <div class=\"input-field\" (focusin)=\"onFocusIn()\" (focusout)=\"onFocusOut()\">\n @if (leadingIcon) {\n <cao-base-icon\n [isLucideIcon]=\"isLucideIcon\"\n [strokeWidthIcon]=\"strokeWidthIcon\"\n [imgSource]=\"leadingIcon\"\n [iconColor]=\"iconColor\"\n [size]=\"size\" />\n }\n <div class=\"input-slot\">\n @if (label && labelInside) {\n <label\n class=\"cao-form-field__label cao-form-field__label--float\"\n [class.cao-form-field__label--floated]=\"floating\"\n [for]=\"forId\">{{ label }}</label>\n }\n <ng-content select=\"[caoInput]\" />\n <ng-content select=\"cao-input\" />\n <ng-content select=\"input\" />\n <ng-content select=\"select\" />\n <ng-content select=\"textarea\" />\n <ng-content select=\"h2\" />\n <ng-content />\n </div>\n @if (trailingIcon) {\n <cao-base-icon\n [isLucideIcon]=\"isLucideIcon\"\n [iconColor]=\"iconColor\"\n [size]=\"size\"\n [imgSource]=\"trailingIcon\"\n [strokeWidthIcon]=\"strokeWidthIcon\" />\n }\n </div>\n <div class=\"subscript-wrapper\">\n @if (hintLabel) {\n <small class=\"cao-form-field__hint\">{{ hintLabel }}</small>\n }\n <ng-content select=\"cao-hint\" />\n <ng-content select=\"cao-error\" />\n </div>\n</div>", styles: [":host{--cao-form-field-bg-background: var(--input-background, #ffffff);--cao-form-field-border-color: var(--line-color, #e5e7eb);--cao-form-field-border-width: 1px;--cao-form-field-border-radius: 8px;--cao-form-field-color-error: var(--error, #dc2626);--cao-form-field-color-label: var(--primary, #111827);--cao-form-field-color-hint: var(--input-text, #9ca3af);--cao-form-field-color-text: var(--text-color-input, #111827);--cao-form-field-focus-border: var(--primary, #111827);--cao-form-field-success-border: var(--success, #16a34a);display:block;width:100%}.cao-form-field{display:flex;flex-direction:column;gap:4px;width:100%;font-family:inherit}.cao-form-field__label{display:block;font-size:.75rem;font-weight:700;line-height:1.25rem;color:var(--cao-form-field-color-label);text-transform:uppercase;letter-spacing:.02em;white-space:nowrap}.cao-form-field__label--float{position:absolute;top:50%;left:12px;transform:translateY(-50%);font-weight:500;text-transform:none;letter-spacing:0;color:var(--cao-form-field-color-hint);pointer-events:none;transition:transform .15s cubic-bezier(.4,0,.2,1),font-size .15s cubic-bezier(.4,0,.2,1),color .15s cubic-bezier(.4,0,.2,1);max-width:calc(100% - 24px);overflow:hidden;text-overflow:ellipsis}.cao-form-field__label--floated{transform:translateY(calc(-50% - 14px)) scale(.75);transform-origin:left top;color:var(--cao-form-field-color-label);font-weight:700}.input-field{position:relative;display:flex;align-items:center;width:100%;min-height:44px;background-color:var(--cao-form-field-bg-background);border:var(--cao-form-field-border-width) solid var(--cao-form-field-border-color);border-radius:var(--cao-form-field-border-radius);transition:border-color .15s cubic-bezier(.4,0,.2,1),background-color .15s cubic-bezier(.4,0,.2,1)}.input-field:focus-within{border-color:var(--cao-form-field-focus-border)}.cao-form-field.error-state .input-field{border-color:var(--cao-form-field-color-error)}.cao-form-field.disabled .input-field{opacity:.7}.input-slot{position:relative;flex:1;display:flex;align-items:center;width:100%;height:100%}.input-slot ::ng-deep input,.input-slot ::ng-deep textarea,.input-slot ::ng-deep select{width:100%;min-height:40px;border:none;outline:none;background:transparent;color:var(--cao-form-field-color-text);font-family:inherit;font-size:.875rem;padding:6px 12px;box-sizing:border-box}.input-slot ::ng-deep cao-input,.input-slot ::ng-deep .cao-input{width:100%}.input-slot ::ng-deep cao-input .input-component,.input-slot ::ng-deep cao-input .input-wrapper{width:100%;background:transparent}.input-slot ::ng-deep cao-input input,.input-slot ::ng-deep cao-input textarea{background:transparent;border:none;color:var(--cao-form-field-color-text)}.label-inside .input-slot ::ng-deep input,.label-inside .input-slot ::ng-deep textarea,.label-inside .input-slot ::ng-deep select{padding-top:16px;padding-bottom:8px}.subscript-wrapper{display:flex;flex-direction:column;gap:2px}.cao-form-field__hint{font-size:.75rem;line-height:1.25rem;color:var(--cao-form-field-color-hint)}.cao-form-field__hint+.subscript-wrapper{margin-top:0}.cao-form-field.required .cao-form-field__label:after{content:\" *\";color:var(--cao-form-field-color-error)}\n"], dependencies: [{ kind: "component", type: CaoBaseIcon, selector: "cao-base-icon", inputs: ["imgSource", "isLucideIcon", "strokeWidthIcon", "iconColor", "size"] }] });
|
|
2011
|
+
}
|
|
2012
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoFormField, decorators: [{
|
|
2013
|
+
type: Component,
|
|
2014
|
+
args: [{ selector: 'cao-form-field', imports: [CaoBaseIcon], template: "<div\n class=\"cao-form-field\"\n [class.label-inside]=\"labelInside\"\n [class.error-state]=\"errorStateActive\"\n [class.disabled]=\"disabled\"\n [class.required]=\"required\"\n [style]=\"formFieldStyles()\">\n @if (label && !labelInside) {\n <label class=\"cao-form-field__label\" [for]=\"forId\">{{ label }}</label>\n }\n <div class=\"input-field\" (focusin)=\"onFocusIn()\" (focusout)=\"onFocusOut()\">\n @if (leadingIcon) {\n <cao-base-icon\n [isLucideIcon]=\"isLucideIcon\"\n [strokeWidthIcon]=\"strokeWidthIcon\"\n [imgSource]=\"leadingIcon\"\n [iconColor]=\"iconColor\"\n [size]=\"size\" />\n }\n <div class=\"input-slot\">\n @if (label && labelInside) {\n <label\n class=\"cao-form-field__label cao-form-field__label--float\"\n [class.cao-form-field__label--floated]=\"floating\"\n [for]=\"forId\">{{ label }}</label>\n }\n <ng-content select=\"[caoInput]\" />\n <ng-content select=\"cao-input\" />\n <ng-content select=\"input\" />\n <ng-content select=\"select\" />\n <ng-content select=\"textarea\" />\n <ng-content select=\"h2\" />\n <ng-content />\n </div>\n @if (trailingIcon) {\n <cao-base-icon\n [isLucideIcon]=\"isLucideIcon\"\n [iconColor]=\"iconColor\"\n [size]=\"size\"\n [imgSource]=\"trailingIcon\"\n [strokeWidthIcon]=\"strokeWidthIcon\" />\n }\n </div>\n <div class=\"subscript-wrapper\">\n @if (hintLabel) {\n <small class=\"cao-form-field__hint\">{{ hintLabel }}</small>\n }\n <ng-content select=\"cao-hint\" />\n <ng-content select=\"cao-error\" />\n </div>\n</div>", styles: [":host{--cao-form-field-bg-background: var(--input-background, #ffffff);--cao-form-field-border-color: var(--line-color, #e5e7eb);--cao-form-field-border-width: 1px;--cao-form-field-border-radius: 8px;--cao-form-field-color-error: var(--error, #dc2626);--cao-form-field-color-label: var(--primary, #111827);--cao-form-field-color-hint: var(--input-text, #9ca3af);--cao-form-field-color-text: var(--text-color-input, #111827);--cao-form-field-focus-border: var(--primary, #111827);--cao-form-field-success-border: var(--success, #16a34a);display:block;width:100%}.cao-form-field{display:flex;flex-direction:column;gap:4px;width:100%;font-family:inherit}.cao-form-field__label{display:block;font-size:.75rem;font-weight:700;line-height:1.25rem;color:var(--cao-form-field-color-label);text-transform:uppercase;letter-spacing:.02em;white-space:nowrap}.cao-form-field__label--float{position:absolute;top:50%;left:12px;transform:translateY(-50%);font-weight:500;text-transform:none;letter-spacing:0;color:var(--cao-form-field-color-hint);pointer-events:none;transition:transform .15s cubic-bezier(.4,0,.2,1),font-size .15s cubic-bezier(.4,0,.2,1),color .15s cubic-bezier(.4,0,.2,1);max-width:calc(100% - 24px);overflow:hidden;text-overflow:ellipsis}.cao-form-field__label--floated{transform:translateY(calc(-50% - 14px)) scale(.75);transform-origin:left top;color:var(--cao-form-field-color-label);font-weight:700}.input-field{position:relative;display:flex;align-items:center;width:100%;min-height:44px;background-color:var(--cao-form-field-bg-background);border:var(--cao-form-field-border-width) solid var(--cao-form-field-border-color);border-radius:var(--cao-form-field-border-radius);transition:border-color .15s cubic-bezier(.4,0,.2,1),background-color .15s cubic-bezier(.4,0,.2,1)}.input-field:focus-within{border-color:var(--cao-form-field-focus-border)}.cao-form-field.error-state .input-field{border-color:var(--cao-form-field-color-error)}.cao-form-field.disabled .input-field{opacity:.7}.input-slot{position:relative;flex:1;display:flex;align-items:center;width:100%;height:100%}.input-slot ::ng-deep input,.input-slot ::ng-deep textarea,.input-slot ::ng-deep select{width:100%;min-height:40px;border:none;outline:none;background:transparent;color:var(--cao-form-field-color-text);font-family:inherit;font-size:.875rem;padding:6px 12px;box-sizing:border-box}.input-slot ::ng-deep cao-input,.input-slot ::ng-deep .cao-input{width:100%}.input-slot ::ng-deep cao-input .input-component,.input-slot ::ng-deep cao-input .input-wrapper{width:100%;background:transparent}.input-slot ::ng-deep cao-input input,.input-slot ::ng-deep cao-input textarea{background:transparent;border:none;color:var(--cao-form-field-color-text)}.label-inside .input-slot ::ng-deep input,.label-inside .input-slot ::ng-deep textarea,.label-inside .input-slot ::ng-deep select{padding-top:16px;padding-bottom:8px}.subscript-wrapper{display:flex;flex-direction:column;gap:2px}.cao-form-field__hint{font-size:.75rem;line-height:1.25rem;color:var(--cao-form-field-color-hint)}.cao-form-field__hint+.subscript-wrapper{margin-top:0}.cao-form-field.required .cao-form-field__label:after{content:\" *\";color:var(--cao-form-field-color-error)}\n"] }]
|
|
2015
|
+
}], propDecorators: { inputBackground: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputBackground", required: false }] }], borderColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderColor", required: false }] }], borderWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderWidth", required: false }] }], borderRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderRadius", required: false }] }], errorColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorColor", required: false }] }], labelColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelColor", required: false }] }], hintColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "hintColor", required: false }] }], textColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "textColor", required: false }] }], focusBorderColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusBorderColor", required: false }] }], successBorderColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "successBorderColor", required: false }] }], label: [{
|
|
2016
|
+
type: Input
|
|
2017
|
+
}], labelInside: [{
|
|
2018
|
+
type: Input
|
|
2019
|
+
}], hintLabel: [{
|
|
2020
|
+
type: Input
|
|
2021
|
+
}], control: [{
|
|
2022
|
+
type: Input
|
|
2023
|
+
}], forId: [{
|
|
2024
|
+
type: Input
|
|
2025
|
+
}], errorStateMatcher: [{
|
|
2026
|
+
type: Input
|
|
2027
|
+
}], leadingIcon: [{
|
|
2028
|
+
type: Input
|
|
2029
|
+
}], trailingIcon: [{
|
|
2030
|
+
type: Input
|
|
2031
|
+
}] } });
|
|
2032
|
+
|
|
2033
|
+
class ErrorStateMatcher {
|
|
2034
|
+
isErrorState(control, formFieldControl) {
|
|
2035
|
+
if (!control) {
|
|
2036
|
+
return false;
|
|
2037
|
+
}
|
|
2038
|
+
const isSubmitted = formFieldControl && formFieldControl._isSubmitted;
|
|
2039
|
+
return !!(control.invalid &&
|
|
2040
|
+
(control.touched || control.dirty || isSubmitted));
|
|
2041
|
+
}
|
|
2042
|
+
}
|
|
2043
|
+
class ShowOnDirtyErrorStateMatcher {
|
|
2044
|
+
isErrorState(control, formFieldControl) {
|
|
2045
|
+
if (!control) {
|
|
2046
|
+
return false;
|
|
2047
|
+
}
|
|
2048
|
+
const isSubmitted = formFieldControl && formFieldControl._isSubmitted;
|
|
2049
|
+
return !!(control.invalid && (control.dirty || isSubmitted));
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
const DEFAULT_ERROR_STATE_MATCHER = new ErrorStateMatcher();
|
|
2053
|
+
|
|
2054
|
+
class CaoHint {
|
|
2055
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoHint, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2056
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: CaoHint, isStandalone: true, selector: "cao-hint", ngImport: i0, template: "<span class=\"cao-hint\"><ng-content /></span>\n", styles: [":host{display:block;font-size:.75rem;line-height:1.25rem;color:var(--cao-form-field-color-hint, var(--input-text, #9ca3af))}.cao-hint{display:block}\n"] });
|
|
2057
|
+
}
|
|
2058
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoHint, decorators: [{
|
|
2059
|
+
type: Component,
|
|
2060
|
+
args: [{ selector: 'cao-hint', imports: [], template: "<span class=\"cao-hint\"><ng-content /></span>\n", styles: [":host{display:block;font-size:.75rem;line-height:1.25rem;color:var(--cao-form-field-color-hint, var(--input-text, #9ca3af))}.cao-hint{display:block}\n"] }]
|
|
2061
|
+
}] });
|
|
2062
|
+
|
|
2063
|
+
class CaoError {
|
|
2064
|
+
errorStateMatcher;
|
|
2065
|
+
formField = inject(CaoFormField, { optional: true });
|
|
2066
|
+
get control() {
|
|
2067
|
+
return this.formField?.control ?? null;
|
|
2068
|
+
}
|
|
2069
|
+
get hasErrorState() {
|
|
2070
|
+
const control = this.control;
|
|
2071
|
+
if (!control) {
|
|
2072
|
+
return false;
|
|
2073
|
+
}
|
|
2074
|
+
const matcher = this.errorStateMatcher ?? this.formField?.errorStateMatcher;
|
|
2075
|
+
return matcher
|
|
2076
|
+
? matcher.isErrorState(control, this.formField)
|
|
2077
|
+
: !!(control.invalid && (control.touched || control.dirty));
|
|
2078
|
+
}
|
|
2079
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoError, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2080
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: CaoError, isStandalone: true, selector: "cao-error", inputs: { errorStateMatcher: "errorStateMatcher" }, ngImport: i0, template: "@if (hasErrorState) {\n <div class=\"cao-error\" role=\"alert\">\n <ng-content />\n </div>\n}", styles: [":host{display:block;font-size:.75rem;line-height:1.25rem;color:var(--cao-form-field-color-error, var(--error, #dc2626))}.cao-error{display:block}\n"] });
|
|
2081
|
+
}
|
|
2082
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoError, decorators: [{
|
|
2083
|
+
type: Component,
|
|
2084
|
+
args: [{ selector: 'cao-error', imports: [], template: "@if (hasErrorState) {\n <div class=\"cao-error\" role=\"alert\">\n <ng-content />\n </div>\n}", styles: [":host{display:block;font-size:.75rem;line-height:1.25rem;color:var(--cao-form-field-color-error, var(--error, #dc2626))}.cao-error{display:block}\n"] }]
|
|
2085
|
+
}], propDecorators: { errorStateMatcher: [{
|
|
2086
|
+
type: Input
|
|
2087
|
+
}] } });
|
|
2088
|
+
|
|
2089
|
+
class CaoCardComponent {
|
|
2090
|
+
variant = "horizontal";
|
|
2091
|
+
title;
|
|
2092
|
+
subtitle;
|
|
2093
|
+
detail;
|
|
2094
|
+
detailColor;
|
|
2095
|
+
icon;
|
|
2096
|
+
avatar;
|
|
2097
|
+
meta;
|
|
2098
|
+
badge;
|
|
2099
|
+
selected = false;
|
|
2100
|
+
clickable = false;
|
|
2101
|
+
bgColor = "bg-white";
|
|
2102
|
+
borderColor = "border-gray-200";
|
|
2103
|
+
cardClick = new EventEmitter();
|
|
2104
|
+
get avatarBg() {
|
|
2105
|
+
return this.avatar?.color ?? "bg-orange-400";
|
|
2106
|
+
}
|
|
2107
|
+
handleClick() {
|
|
2108
|
+
if (this.clickable) {
|
|
2109
|
+
this.cardClick.emit();
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
handleKeydown(event) {
|
|
2113
|
+
if (this.clickable && (event.key === "Enter" || event.key === " ")) {
|
|
2114
|
+
event.preventDefault();
|
|
2115
|
+
this.cardClick.emit();
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2119
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: CaoCardComponent, isStandalone: true, selector: "cao-card", inputs: { variant: "variant", title: "title", subtitle: "subtitle", detail: "detail", detailColor: "detailColor", icon: "icon", avatar: "avatar", meta: "meta", badge: "badge", selected: "selected", clickable: "clickable", bgColor: "bgColor", borderColor: "borderColor" }, outputs: { cardClick: "cardClick" }, ngImport: i0, template: "@switch (variant) {\n @case ('horizontal') {\n <div\n class=\"card card-horizontal\"\n [class.card-clickable]=\"clickable\"\n [class.card-hover-shadow]=\"clickable\"\n [class.card-selected]=\"selected\"\n [ngClass]=\"[bgColor, borderColor]\"\n [attr.role]=\"clickable ? 'button' : null\"\n [attr.tabindex]=\"clickable ? 0 : null\"\n (click)=\"handleClick()\"\n (keydown)=\"handleKeydown($event)\">\n \n @if (avatar) {\n <div class=\"card-avatar-container\" [ngClass]=\"avatarBg\">\n @if (avatar.src) {\n <img \n class=\"card-avatar-img\" \n [src]=\"avatar.src\" \n [alt]=\"title\" />\n } @else { \n {{ avatar.initials }} \n }\n </div>\n } @else if (icon) {\n <div class=\"card-icon-container\">\n <img \n class=\"card-icon-img\" \n [src]=\"icon\" \n [alt]=\"title\" />\n </div>\n }\n\n <div class=\"card-content\">\n @if (title) {\n <span class=\"card-title\">{{ title }}</span>\n }\n @if (subtitle) {\n <span class=\"card-subtitle\">{{ subtitle }}</span>\n }\n @if (detail) {\n <span class=\"card-detail\" [ngClass]=\"detailColor ?? ''\">\n {{ detail }}\n </span>\n }\n <ng-content />\n </div>\n\n @if (badge || (meta && meta.length)) {\n <div class=\"card-badge-wrapper\">\n @if (badge) {\n <div \n class=\"card-badge\"\n [ngClass]=\"[badge.color ?? '', badge.borderColor ?? '']\"\n [style.background-color]=\"badge.bg\">\n {{ badge.label }}\n </div>\n }\n @if (meta && meta.length) {\n <div class=\"card-meta-list\">\n @for (m of meta; track m.label) {\n <div class=\"card-meta-item\">\n <img \n class=\"card-meta-icon\" \n [src]=\"m.icon\" \n [alt]=\"m.label\" />\n <span>{{ m.label }}</span>\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n\n @case ('square') {\n <div\n class=\"card card-square\"\n [class.card-clickable]=\"clickable\"\n [class.card-hover-bg]=\"clickable\"\n [class.card-hover-bold]=\"clickable\"\n [class.card-selected]=\"selected\"\n [class.card-selected-border-2]=\"selected\"\n [attr.role]=\"clickable ? 'button' : null\"\n [attr.tabindex]=\"clickable ? 0 : null\"\n [matTooltip]=\"title\"\n (click)=\"handleClick()\"\n (keydown)=\"handleKeydown($event)\">\n \n <div class=\"card-square-content\">\n <span class=\"card-square-title\">{{ title }}</span>\n \n @if (icon) {\n <img \n class=\"card-square-icon\" \n [src]=\"icon\" \n [alt]=\"title\" />\n }\n </div>\n </div>\n }\n}", styles: [":host{--radius-card: .5rem;--color-bg-main: #ffffff;--color-bg-gray: #f3f4f6;--color-border-gray: #d1d5db;--color-border-orange: #fb923c;--color-text-gray-400: #9ca3af;--color-text-gray-500: #6b7280;--color-text-gray-600: #4b5563;--color-text-gray-700: #374151;--color-text-gray-900: #111827;--color-white: #ffffff}.card{display:flex;position:relative;width:100%;height:100%;transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.card-horizontal{border:1px solid var(--color-border-gray);border-radius:var(--radius-card);padding:1rem 1.25rem;align-items:center;gap:1rem}.card-square{background-color:var(--color-bg-main);border-radius:var(--radius-card);padding:1rem 5rem;flex-direction:column;align-items:center;justify-content:center;transition:all .3s cubic-bezier(.4,0,.2,1)}.card-clickable{cursor:pointer}.card-hover-shadow:hover{box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a}.card-hover-bg:hover{background-color:var(--color-bg-gray)}.card-hover-bold:hover{font-weight:700}.card-selected{border-color:var(--color-border-orange)}.card-selected-border-2{border-width:2px}.card-avatar-container{width:3rem;height:3rem;border-radius:9999px;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--color-white);font-size:1.25rem;font-weight:700}.card-avatar-img{width:100%;height:100%;border-radius:9999px;object-fit:cover}.card-icon-container{width:3rem;height:3rem;border-radius:9999px;background-color:#e5e7eb;display:flex;align-items:center;justify-content:center;flex-shrink:0}.card-icon-img{width:1.5rem;height:1.5rem;opacity:.6}.card-content{flex:1 1 0%;min-width:0;display:flex;flex-direction:column;gap:.125rem;height:100%}.card-title{font-size:.875rem;font-weight:600;color:var(--color-text-gray-900);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.card-subtitle{font-size:.875rem;color:var(--color-text-gray-500);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.card-detail{font-size:.875rem;font-weight:500;color:var(--color-text-gray-700)}.card-badge-wrapper{display:flex;flex-direction:column;align-items:flex-end;gap:2rem;flex-shrink:0}.card-badge{padding:.5rem .75rem;border-radius:9999px;border:1px solid var(--color-border-gray);font-size:.875rem;font-weight:500;color:var(--color-text-gray-600)}.card-meta-list{display:flex;flex-wrap:wrap;align-items:center;gap:1.25rem}.card-meta-item{display:flex;align-items:center;gap:.375rem;font-size:.875rem;color:var(--color-text-gray-400)}.card-meta-icon{width:1rem;height:1rem;opacity:.6}.card-square-content{width:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;transition:all .15s cubic-bezier(.4,0,.2,1)}.card-square-title{font-size:1rem;color:var(--color-text-gray-900);text-align:center}.card-square-icon{width:3rem;height:3rem}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-center{text-align:center}@media(max-width:640px){.card-horizontal{padding:.75rem 1rem;gap:.75rem}.card-square{padding:1rem 2rem}.card-square-content{width:80%}.card-badge-wrapper{gap:1rem}.card-meta-list{gap:.75rem}}@media(max-width:480px){.card-horizontal{flex-wrap:wrap;justify-content:center;text-align:center}.card-content,.card-badge-wrapper{width:100%;align-items:center}.card-meta-list{justify-content:center}.card-square{padding:1rem}.card-square-content{width:100%}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }] });
|
|
2120
|
+
}
|
|
2121
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoCardComponent, decorators: [{
|
|
2122
|
+
type: Component,
|
|
2123
|
+
args: [{ selector: "cao-card", imports: [CommonModule, MatTooltip], template: "@switch (variant) {\n @case ('horizontal') {\n <div\n class=\"card card-horizontal\"\n [class.card-clickable]=\"clickable\"\n [class.card-hover-shadow]=\"clickable\"\n [class.card-selected]=\"selected\"\n [ngClass]=\"[bgColor, borderColor]\"\n [attr.role]=\"clickable ? 'button' : null\"\n [attr.tabindex]=\"clickable ? 0 : null\"\n (click)=\"handleClick()\"\n (keydown)=\"handleKeydown($event)\">\n \n @if (avatar) {\n <div class=\"card-avatar-container\" [ngClass]=\"avatarBg\">\n @if (avatar.src) {\n <img \n class=\"card-avatar-img\" \n [src]=\"avatar.src\" \n [alt]=\"title\" />\n } @else { \n {{ avatar.initials }} \n }\n </div>\n } @else if (icon) {\n <div class=\"card-icon-container\">\n <img \n class=\"card-icon-img\" \n [src]=\"icon\" \n [alt]=\"title\" />\n </div>\n }\n\n <div class=\"card-content\">\n @if (title) {\n <span class=\"card-title\">{{ title }}</span>\n }\n @if (subtitle) {\n <span class=\"card-subtitle\">{{ subtitle }}</span>\n }\n @if (detail) {\n <span class=\"card-detail\" [ngClass]=\"detailColor ?? ''\">\n {{ detail }}\n </span>\n }\n <ng-content />\n </div>\n\n @if (badge || (meta && meta.length)) {\n <div class=\"card-badge-wrapper\">\n @if (badge) {\n <div \n class=\"card-badge\"\n [ngClass]=\"[badge.color ?? '', badge.borderColor ?? '']\"\n [style.background-color]=\"badge.bg\">\n {{ badge.label }}\n </div>\n }\n @if (meta && meta.length) {\n <div class=\"card-meta-list\">\n @for (m of meta; track m.label) {\n <div class=\"card-meta-item\">\n <img \n class=\"card-meta-icon\" \n [src]=\"m.icon\" \n [alt]=\"m.label\" />\n <span>{{ m.label }}</span>\n </div>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n\n @case ('square') {\n <div\n class=\"card card-square\"\n [class.card-clickable]=\"clickable\"\n [class.card-hover-bg]=\"clickable\"\n [class.card-hover-bold]=\"clickable\"\n [class.card-selected]=\"selected\"\n [class.card-selected-border-2]=\"selected\"\n [attr.role]=\"clickable ? 'button' : null\"\n [attr.tabindex]=\"clickable ? 0 : null\"\n [matTooltip]=\"title\"\n (click)=\"handleClick()\"\n (keydown)=\"handleKeydown($event)\">\n \n <div class=\"card-square-content\">\n <span class=\"card-square-title\">{{ title }}</span>\n \n @if (icon) {\n <img \n class=\"card-square-icon\" \n [src]=\"icon\" \n [alt]=\"title\" />\n }\n </div>\n </div>\n }\n}", styles: [":host{--radius-card: .5rem;--color-bg-main: #ffffff;--color-bg-gray: #f3f4f6;--color-border-gray: #d1d5db;--color-border-orange: #fb923c;--color-text-gray-400: #9ca3af;--color-text-gray-500: #6b7280;--color-text-gray-600: #4b5563;--color-text-gray-700: #374151;--color-text-gray-900: #111827;--color-white: #ffffff}.card{display:flex;position:relative;width:100%;height:100%;transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.card-horizontal{border:1px solid var(--color-border-gray);border-radius:var(--radius-card);padding:1rem 1.25rem;align-items:center;gap:1rem}.card-square{background-color:var(--color-bg-main);border-radius:var(--radius-card);padding:1rem 5rem;flex-direction:column;align-items:center;justify-content:center;transition:all .3s cubic-bezier(.4,0,.2,1)}.card-clickable{cursor:pointer}.card-hover-shadow:hover{box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a}.card-hover-bg:hover{background-color:var(--color-bg-gray)}.card-hover-bold:hover{font-weight:700}.card-selected{border-color:var(--color-border-orange)}.card-selected-border-2{border-width:2px}.card-avatar-container{width:3rem;height:3rem;border-radius:9999px;display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--color-white);font-size:1.25rem;font-weight:700}.card-avatar-img{width:100%;height:100%;border-radius:9999px;object-fit:cover}.card-icon-container{width:3rem;height:3rem;border-radius:9999px;background-color:#e5e7eb;display:flex;align-items:center;justify-content:center;flex-shrink:0}.card-icon-img{width:1.5rem;height:1.5rem;opacity:.6}.card-content{flex:1 1 0%;min-width:0;display:flex;flex-direction:column;gap:.125rem;height:100%}.card-title{font-size:.875rem;font-weight:600;color:var(--color-text-gray-900);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.card-subtitle{font-size:.875rem;color:var(--color-text-gray-500);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.card-detail{font-size:.875rem;font-weight:500;color:var(--color-text-gray-700)}.card-badge-wrapper{display:flex;flex-direction:column;align-items:flex-end;gap:2rem;flex-shrink:0}.card-badge{padding:.5rem .75rem;border-radius:9999px;border:1px solid var(--color-border-gray);font-size:.875rem;font-weight:500;color:var(--color-text-gray-600)}.card-meta-list{display:flex;flex-wrap:wrap;align-items:center;gap:1.25rem}.card-meta-item{display:flex;align-items:center;gap:.375rem;font-size:.875rem;color:var(--color-text-gray-400)}.card-meta-icon{width:1rem;height:1rem;opacity:.6}.card-square-content{width:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;transition:all .15s cubic-bezier(.4,0,.2,1)}.card-square-title{font-size:1rem;color:var(--color-text-gray-900);text-align:center}.card-square-icon{width:3rem;height:3rem}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-center{text-align:center}@media(max-width:640px){.card-horizontal{padding:.75rem 1rem;gap:.75rem}.card-square{padding:1rem 2rem}.card-square-content{width:80%}.card-badge-wrapper{gap:1rem}.card-meta-list{gap:.75rem}}@media(max-width:480px){.card-horizontal{flex-wrap:wrap;justify-content:center;text-align:center}.card-content,.card-badge-wrapper{width:100%;align-items:center}.card-meta-list{justify-content:center}.card-square{padding:1rem}.card-square-content{width:100%}}\n"] }]
|
|
2124
|
+
}], propDecorators: { variant: [{
|
|
2125
|
+
type: Input
|
|
2126
|
+
}], title: [{
|
|
2127
|
+
type: Input
|
|
2128
|
+
}], subtitle: [{
|
|
2129
|
+
type: Input
|
|
2130
|
+
}], detail: [{
|
|
2131
|
+
type: Input
|
|
2132
|
+
}], detailColor: [{
|
|
2133
|
+
type: Input
|
|
2134
|
+
}], icon: [{
|
|
2135
|
+
type: Input
|
|
2136
|
+
}], avatar: [{
|
|
2137
|
+
type: Input
|
|
2138
|
+
}], meta: [{
|
|
2139
|
+
type: Input
|
|
2140
|
+
}], badge: [{
|
|
2141
|
+
type: Input
|
|
2142
|
+
}], selected: [{
|
|
2143
|
+
type: Input
|
|
2144
|
+
}], clickable: [{
|
|
2145
|
+
type: Input
|
|
2146
|
+
}], bgColor: [{
|
|
2147
|
+
type: Input
|
|
2148
|
+
}], borderColor: [{
|
|
2149
|
+
type: Input
|
|
2150
|
+
}], cardClick: [{
|
|
2151
|
+
type: Output
|
|
2152
|
+
}] } });
|
|
2153
|
+
|
|
2154
|
+
class CaoBaseToggleComponent {
|
|
2155
|
+
type = "text";
|
|
2156
|
+
placeholder = "";
|
|
2157
|
+
inputClass = "";
|
|
2158
|
+
value = "";
|
|
2159
|
+
errorMessage = "";
|
|
2160
|
+
isDisabled = false;
|
|
2161
|
+
maxLength;
|
|
2162
|
+
searchMode = false;
|
|
2163
|
+
showBorder = false;
|
|
2164
|
+
isLucideIcon = false;
|
|
2165
|
+
iconColor = "";
|
|
2166
|
+
mask;
|
|
2167
|
+
control;
|
|
2168
|
+
tooltip = "";
|
|
2169
|
+
dataCy = "";
|
|
2170
|
+
textareaRows = "";
|
|
2171
|
+
decimalMarker = ",";
|
|
2172
|
+
thousandSeparator = ".";
|
|
2173
|
+
allowNegativeNumbers = false;
|
|
2174
|
+
separatorLimit = "";
|
|
2175
|
+
set leadingIcon(value) {
|
|
2176
|
+
this._leadingIcon = value;
|
|
2177
|
+
this.icon = true;
|
|
2178
|
+
}
|
|
2179
|
+
set trailingIcon(value) {
|
|
2180
|
+
this._trailingIcon = value;
|
|
2181
|
+
this.icon = true;
|
|
2182
|
+
}
|
|
2183
|
+
valueChange = new EventEmitter();
|
|
2184
|
+
searchClick = new EventEmitter();
|
|
2185
|
+
inputChange = new EventEmitter();
|
|
2186
|
+
isFocused = false;
|
|
2187
|
+
icon = false;
|
|
2188
|
+
_leadingIcon;
|
|
2189
|
+
_trailingIcon;
|
|
2190
|
+
onChange = () => { };
|
|
2191
|
+
onTouched = () => { };
|
|
2192
|
+
get hasError() {
|
|
2193
|
+
return !!this.errorMessage;
|
|
2194
|
+
}
|
|
2195
|
+
controlName = "";
|
|
2196
|
+
get controlNameValue() {
|
|
2197
|
+
return this.controlName;
|
|
2198
|
+
}
|
|
2199
|
+
onInput(event) {
|
|
2200
|
+
const newValue = event.target.value;
|
|
2201
|
+
this.value = newValue;
|
|
2202
|
+
this.onChange(newValue);
|
|
2203
|
+
this.valueChange.emit(newValue);
|
|
2204
|
+
}
|
|
2205
|
+
onInputChange(event) {
|
|
2206
|
+
const newValue = event.target.value;
|
|
2207
|
+
this.value = newValue;
|
|
2208
|
+
this.inputChange.emit(newValue);
|
|
2209
|
+
}
|
|
2210
|
+
onFocus() {
|
|
2211
|
+
this.isFocused = true;
|
|
2212
|
+
this.onTouched();
|
|
2213
|
+
}
|
|
2214
|
+
onBlur() {
|
|
2215
|
+
this.isFocused = false;
|
|
2216
|
+
this.onTouched();
|
|
2217
|
+
if (this.control?.touched && this.control?.valid && this.control?.value) {
|
|
2218
|
+
setTimeout(() => {
|
|
2219
|
+
const active = document.activeElement;
|
|
2220
|
+
const current = document.querySelector(`[formcontrolname="${this.controlNameValue}"]`);
|
|
2221
|
+
if (!current || !active || !current.contains(active)) {
|
|
2222
|
+
this.control?.markAsUntouched();
|
|
2223
|
+
}
|
|
2224
|
+
});
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
2227
|
+
onSearchClick() {
|
|
2228
|
+
this.searchClick.emit();
|
|
2229
|
+
}
|
|
2230
|
+
writeValue(value) {
|
|
2231
|
+
this.value = value || "";
|
|
2232
|
+
}
|
|
2233
|
+
registerOnChange(fn) {
|
|
2234
|
+
this.onChange = fn;
|
|
2235
|
+
}
|
|
2236
|
+
registerOnTouched(fn) {
|
|
2237
|
+
this.onTouched = fn;
|
|
2238
|
+
}
|
|
2239
|
+
setDisabledState(isDisabled) {
|
|
2240
|
+
this.isDisabled = isDisabled;
|
|
2241
|
+
}
|
|
2242
|
+
isChecked = false;
|
|
2243
|
+
checkedTextPlaceholder = "";
|
|
2244
|
+
uncheckedTextPlaceholder = "";
|
|
2245
|
+
statusChanged = new EventEmitter();
|
|
2246
|
+
checkboxInput;
|
|
2247
|
+
onToggleCheckbox() {
|
|
2248
|
+
if (this.isDisabled) {
|
|
2249
|
+
return;
|
|
2250
|
+
}
|
|
2251
|
+
this.isChecked = !this.isChecked;
|
|
2252
|
+
this.statusChanged.emit(this);
|
|
2253
|
+
}
|
|
2254
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoBaseToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2255
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: CaoBaseToggleComponent, isStandalone: true, selector: "cao-base-toggle", inputs: { type: "type", placeholder: "placeholder", inputClass: "inputClass", value: "value", errorMessage: "errorMessage", isDisabled: "isDisabled", maxLength: "maxLength", searchMode: "searchMode", showBorder: "showBorder", isLucideIcon: "isLucideIcon", iconColor: "iconColor", mask: "mask", control: "control", tooltip: "tooltip", dataCy: "dataCy", textareaRows: "textareaRows", decimalMarker: "decimalMarker", thousandSeparator: "thousandSeparator", allowNegativeNumbers: "allowNegativeNumbers", separatorLimit: "separatorLimit", leadingIcon: "leadingIcon", trailingIcon: "trailingIcon", controlName: "controlName", isChecked: "isChecked", checkedTextPlaceholder: "checkedTextPlaceholder", uncheckedTextPlaceholder: "uncheckedTextPlaceholder" }, outputs: { valueChange: "valueChange", searchClick: "searchClick", inputChange: "inputChange", statusChanged: "statusChanged" }, viewQueries: [{ propertyName: "checkboxInput", first: true, predicate: ["checkbox"], descendants: true }], ngImport: i0, template: "<div class=\"d-flex col aic jcc base-toggle\">\n <input #checkbox type=\"checkbox\" class=\"checkbox\" [checked]=\"isChecked\" [disabled]=\"isDisabled\" />\n <div\n class=\"d-flex checkbox-element aic jcsb\"\n tabindex=\"0\"\n role=\"button\"\n [class.activated-toggle]=\"isChecked\"\n (click)=\"onToggleCheckbox()\"\n (keydown.enter)=\"onToggleCheckbox()\"\n (keydown.space)=\"onToggleCheckbox(); $event.preventDefault()\">\n @if (isChecked) {\n <mat-icon class=\"eye-icon\" />\n <div class=\"check-text\"> Ativada </div>\n <div class=\"line\"></div>\n <p class=\"unchecked\">Desativar</p>\n }@else {\n <mat-icon class=\"fa-circle\" />\n <div class=\"check-text\"> N\u00E3o ativada </div>\n <div class=\"line\"></div>\n <p>Ativar</p>\n }\n </div>\n @if(isChecked){\n <span>{{ checkedTextPlaceholder }} ativada com sucesso</span>\n } @else{\n <span>Clique para ativar {{ uncheckedTextPlaceholder }}</span>\n }\n</div>\n", styles: [".base-toggle input{display:none;visibility:hidden}.base-toggle .checkbox-element{border-radius:24px;cursor:pointer;gap:10px;padding:10px 20px;display:flex;align-items:center;justify-content:center;border:2px solid var(--border-toggle);background-color:transparent}.base-toggle .checkbox-element .check-text{font-weight:700}.base-toggle .checkbox-element .line{height:24px;width:1px;background-color:var(--data-bg)}.base-toggle .checkbox-element.activated-toggle{border:2px solid var(--border-toggle-checked);background-color:var(--bg-toggle-checked)}.base-toggle .checkbox-element.activated-toggle .check-text{color:var(--text-toggle-checked)}.base-toggle .checkbox-element.activated-toggle .unchecked{color:var(--text-unselected-toggle-checked)}.base-toggle .checkbox-element p{margin:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MaterialModule }, { kind: "component", type: i1$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
2256
|
+
}
|
|
2257
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CaoBaseToggleComponent, decorators: [{
|
|
2258
|
+
type: Component,
|
|
2259
|
+
args: [{ selector: "cao-base-toggle", standalone: true, imports: [CommonModule, MaterialModule], template: "<div class=\"d-flex col aic jcc base-toggle\">\n <input #checkbox type=\"checkbox\" class=\"checkbox\" [checked]=\"isChecked\" [disabled]=\"isDisabled\" />\n <div\n class=\"d-flex checkbox-element aic jcsb\"\n tabindex=\"0\"\n role=\"button\"\n [class.activated-toggle]=\"isChecked\"\n (click)=\"onToggleCheckbox()\"\n (keydown.enter)=\"onToggleCheckbox()\"\n (keydown.space)=\"onToggleCheckbox(); $event.preventDefault()\">\n @if (isChecked) {\n <mat-icon class=\"eye-icon\" />\n <div class=\"check-text\"> Ativada </div>\n <div class=\"line\"></div>\n <p class=\"unchecked\">Desativar</p>\n }@else {\n <mat-icon class=\"fa-circle\" />\n <div class=\"check-text\"> N\u00E3o ativada </div>\n <div class=\"line\"></div>\n <p>Ativar</p>\n }\n </div>\n @if(isChecked){\n <span>{{ checkedTextPlaceholder }} ativada com sucesso</span>\n } @else{\n <span>Clique para ativar {{ uncheckedTextPlaceholder }}</span>\n }\n</div>\n", styles: [".base-toggle input{display:none;visibility:hidden}.base-toggle .checkbox-element{border-radius:24px;cursor:pointer;gap:10px;padding:10px 20px;display:flex;align-items:center;justify-content:center;border:2px solid var(--border-toggle);background-color:transparent}.base-toggle .checkbox-element .check-text{font-weight:700}.base-toggle .checkbox-element .line{height:24px;width:1px;background-color:var(--data-bg)}.base-toggle .checkbox-element.activated-toggle{border:2px solid var(--border-toggle-checked);background-color:var(--bg-toggle-checked)}.base-toggle .checkbox-element.activated-toggle .check-text{color:var(--text-toggle-checked)}.base-toggle .checkbox-element.activated-toggle .unchecked{color:var(--text-unselected-toggle-checked)}.base-toggle .checkbox-element p{margin:0}\n"] }]
|
|
2260
|
+
}], propDecorators: { type: [{
|
|
2261
|
+
type: Input
|
|
2262
|
+
}], placeholder: [{
|
|
2263
|
+
type: Input
|
|
2264
|
+
}], inputClass: [{
|
|
2265
|
+
type: Input
|
|
2266
|
+
}], value: [{
|
|
2267
|
+
type: Input
|
|
2268
|
+
}], errorMessage: [{
|
|
2269
|
+
type: Input
|
|
2270
|
+
}], isDisabled: [{
|
|
2271
|
+
type: Input
|
|
2272
|
+
}], maxLength: [{
|
|
2273
|
+
type: Input
|
|
2274
|
+
}], searchMode: [{
|
|
2275
|
+
type: Input
|
|
2276
|
+
}], showBorder: [{
|
|
2277
|
+
type: Input
|
|
2278
|
+
}], isLucideIcon: [{
|
|
2279
|
+
type: Input
|
|
2280
|
+
}], iconColor: [{
|
|
2281
|
+
type: Input
|
|
2282
|
+
}], mask: [{
|
|
2283
|
+
type: Input
|
|
2284
|
+
}], control: [{
|
|
2285
|
+
type: Input
|
|
2286
|
+
}], tooltip: [{
|
|
2287
|
+
type: Input
|
|
2288
|
+
}], dataCy: [{
|
|
2289
|
+
type: Input
|
|
2290
|
+
}], textareaRows: [{
|
|
2291
|
+
type: Input
|
|
2292
|
+
}], decimalMarker: [{
|
|
2293
|
+
type: Input
|
|
2294
|
+
}], thousandSeparator: [{
|
|
2295
|
+
type: Input
|
|
2296
|
+
}], allowNegativeNumbers: [{
|
|
2297
|
+
type: Input
|
|
2298
|
+
}], separatorLimit: [{
|
|
2299
|
+
type: Input
|
|
2300
|
+
}], leadingIcon: [{
|
|
2301
|
+
type: Input
|
|
2302
|
+
}], trailingIcon: [{
|
|
2303
|
+
type: Input
|
|
2304
|
+
}], valueChange: [{
|
|
2305
|
+
type: Output
|
|
2306
|
+
}], searchClick: [{
|
|
2307
|
+
type: Output
|
|
2308
|
+
}], inputChange: [{
|
|
2309
|
+
type: Output
|
|
2310
|
+
}], controlName: [{
|
|
2311
|
+
type: Input
|
|
2312
|
+
}], isChecked: [{
|
|
2313
|
+
type: Input
|
|
2314
|
+
}], checkedTextPlaceholder: [{
|
|
2315
|
+
type: Input
|
|
2316
|
+
}], uncheckedTextPlaceholder: [{
|
|
2317
|
+
type: Input
|
|
2318
|
+
}], statusChanged: [{
|
|
2319
|
+
type: Output
|
|
2320
|
+
}], checkboxInput: [{
|
|
2321
|
+
type: ViewChild,
|
|
2322
|
+
args: ["checkbox"]
|
|
2323
|
+
}] } });
|
|
2324
|
+
|
|
1881
2325
|
class BaseModalService {
|
|
1882
2326
|
constructor() { }
|
|
1883
2327
|
toggleModalEvent = new EventEmitter();
|
|
@@ -2017,7 +2461,7 @@ class BaseDialogService {
|
|
|
2017
2461
|
generateComponentPortal() {
|
|
2018
2462
|
return BaseDialog;
|
|
2019
2463
|
}
|
|
2020
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseDialogService, deps: [{ token: i1$
|
|
2464
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseDialogService, deps: [{ token: i1$5.Overlay }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2021
2465
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseDialogService, providedIn: "root" });
|
|
2022
2466
|
}
|
|
2023
2467
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseDialogService, decorators: [{
|
|
@@ -2025,7 +2469,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
2025
2469
|
args: [{
|
|
2026
2470
|
providedIn: "root",
|
|
2027
2471
|
}]
|
|
2028
|
-
}], ctorParameters: () => [{ type: i1$
|
|
2472
|
+
}], ctorParameters: () => [{ type: i1$5.Overlay }] });
|
|
2029
2473
|
|
|
2030
2474
|
class BaseFilterTableService {
|
|
2031
2475
|
filterSubject = new Subject();
|
|
@@ -2447,7 +2891,7 @@ class BaseTable {
|
|
|
2447
2891
|
this.totalItems = this.dataSource.data.length;
|
|
2448
2892
|
}
|
|
2449
2893
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseTable, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2450
|
-
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" }] });
|
|
2894
|
+
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: i1$2.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$3.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" }] });
|
|
2451
2895
|
}
|
|
2452
2896
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseTable, decorators: [{
|
|
2453
2897
|
type: Component,
|
|
@@ -2910,7 +3354,7 @@ class BaseTablePaginated {
|
|
|
2910
3354
|
return this.tableConfig.columnData[column].buttons || [];
|
|
2911
3355
|
}
|
|
2912
3356
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseTablePaginated, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2913
|
-
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 });
|
|
3357
|
+
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: i1$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i1$3.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 });
|
|
2914
3358
|
}
|
|
2915
3359
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseTablePaginated, decorators: [{
|
|
2916
3360
|
type: Component,
|
|
@@ -2989,7 +3433,7 @@ class BaseAlertService {
|
|
|
2989
3433
|
generateComponentPortal() {
|
|
2990
3434
|
return BaseAlert;
|
|
2991
3435
|
}
|
|
2992
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseAlertService, deps: [{ token: i1$
|
|
3436
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseAlertService, deps: [{ token: i1$5.Overlay }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2993
3437
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseAlertService, providedIn: "root" });
|
|
2994
3438
|
}
|
|
2995
3439
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BaseAlertService, decorators: [{
|
|
@@ -2997,11 +3441,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
2997
3441
|
args: [{
|
|
2998
3442
|
providedIn: "root",
|
|
2999
3443
|
}]
|
|
3000
|
-
}], ctorParameters: () => [{ type: i1$
|
|
3444
|
+
}], ctorParameters: () => [{ type: i1$5.Overlay }] });
|
|
3001
3445
|
|
|
3002
3446
|
/**
|
|
3003
3447
|
* Generated bundle index. Do not edit.
|
|
3004
3448
|
*/
|
|
3005
3449
|
|
|
3006
|
-
export { BaseAlert, BaseAlertService, BaseDialog, BaseDialogService, BaseFilterTablePaginatedService, BaseFilterTableService, BaseModal, BaseModalService, BasePaginationService, BaseTable, BaseTablePaginated, BaseTableService, BaseTimeRange, CaoAutocompleteComponent, CaoBaseButtonComponent, CaoBaseIcon, CaoBaseInput, CaoDropDownComponent, CaoKpi, CaoTabGroup, CaoTabPanel, Footer, LinksButton, Paginator, StepComponent, StepperComponent, TablePaginatedService, TimePicker, getPtBrPaginatorIntlBasePaginated, getPtBrPaginatorIntlBaseTable };
|
|
3450
|
+
export { BaseAlert, BaseAlertService, BaseDialog, BaseDialogService, BaseFilterTablePaginatedService, BaseFilterTableService, BaseModal, BaseModalService, BasePaginationService, BaseTable, BaseTablePaginated, BaseTableService, BaseTimeRange, CaoAutocompleteComponent, CaoBaseButtonComponent, CaoBaseIcon, CaoBaseInput, CaoBaseToggleComponent, CaoCardComponent, CaoDropDownComponent, CaoError, CaoFormField, CaoHint, CaoKpi, CaoSkeletonComponent, CaoTabGroup, CaoTabPanel, DEFAULT_ERROR_STATE_MATCHER, ErrorStateMatcher, Footer, LinksButton, Paginator, ShowOnDirtyErrorStateMatcher, StepComponent, StepperComponent, TablePaginatedService, TimePicker, getPtBrPaginatorIntlBasePaginated, getPtBrPaginatorIntlBaseTable };
|
|
3007
3451
|
//# sourceMappingURL=ngx-opalbytes-components.mjs.map
|