@sgcloud-sgsistemas/angular-components 0.0.1
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.
|
@@ -0,0 +1,1245 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Input, Component, EventEmitter, Output, Directive, HostListener, inject, ElementRef, NgModule } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i2$1 from '@angular/material/icon';
|
|
6
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
7
|
+
import * as i1 from '@angular/forms';
|
|
8
|
+
import { FormsModule } from '@angular/forms';
|
|
9
|
+
import { Subject, debounceTime, BehaviorSubject } from 'rxjs';
|
|
10
|
+
import * as i4 from '@angular/material/divider';
|
|
11
|
+
import { MatDividerModule } from '@angular/material/divider';
|
|
12
|
+
import { map } from 'rxjs/operators';
|
|
13
|
+
|
|
14
|
+
class AcButton {
|
|
15
|
+
disabled = false;
|
|
16
|
+
title = '';
|
|
17
|
+
colorType = 'primary';
|
|
18
|
+
leftIcon = null;
|
|
19
|
+
rightIcon = null;
|
|
20
|
+
onClick = null;
|
|
21
|
+
isWhite = false;
|
|
22
|
+
isPrimary = false;
|
|
23
|
+
isSecondary = false;
|
|
24
|
+
isTertiary = false;
|
|
25
|
+
isNeutral = false;
|
|
26
|
+
isError = false;
|
|
27
|
+
isSuccess = false;
|
|
28
|
+
isWarning = false;
|
|
29
|
+
constructor() {
|
|
30
|
+
}
|
|
31
|
+
ngOnInit() {
|
|
32
|
+
this.defineColorType();
|
|
33
|
+
}
|
|
34
|
+
ngOnChanges(changes) {
|
|
35
|
+
if (changes['colorType'] && changes['colorType'].currentValue !== changes['colorType'].previousValue) {
|
|
36
|
+
this.defineColorType();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
actionClick() {
|
|
40
|
+
if (this.onClick) {
|
|
41
|
+
this.onClick();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
defineColorType() {
|
|
45
|
+
this.isWhite = this.colorType === 'white';
|
|
46
|
+
this.isPrimary = this.colorType === 'primary';
|
|
47
|
+
this.isSecondary = this.colorType === 'secondary';
|
|
48
|
+
this.isTertiary = this.colorType === 'tertiary';
|
|
49
|
+
this.isNeutral = this.colorType === 'neutral';
|
|
50
|
+
this.isError = this.colorType === 'error';
|
|
51
|
+
this.isSuccess = this.colorType === 'success';
|
|
52
|
+
this.isWarning = this.colorType === 'warning';
|
|
53
|
+
}
|
|
54
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
55
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: AcButton, isStandalone: true, selector: "ac-button", inputs: { disabled: "disabled", title: "title", colorType: "colorType", leftIcon: "leftIcon", rightIcon: "rightIcon", onClick: "onClick" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"ac-button\">\n <button \n class=\"ac-button-button\"\n [ngClass]=\"{\n 'white': isWhite,\n 'primary': isPrimary,\n 'secondary': isSecondary,\n 'tertiary': isTertiary,\n 'neutral': isNeutral,\n 'error': isError,\n 'success': isSuccess,\n 'warning': isWarning\n }\"\n (click)=\"actionClick()\" \n [disabled]=\"disabled\">\n\n <mat-icon *ngIf=\"leftIcon\" [fontIcon]=\"leftIcon\"></mat-icon>\n <label *ngIf=\"title\" class=\"ac-button-label\">{{title}}</label>\n <mat-icon *ngIf=\"rightIcon\" [fontIcon]=\"rightIcon\"></mat-icon>\n </button>\n</div>\n ", styles: [".ac-button{height:100%;width:100%;min-height:24px}.ac-button .ac-button-button{display:flex;align-items:center;justify-content:center;gap:8px;border:none;outline:none;border-radius:5px;min-width:50px;width:100%;height:100%;background:var(--primary-color, #0aaa18)}.ac-button .ac-button-button:hover{filter:saturate(85%);cursor:pointer}.ac-button .ac-button-button:focus,.ac-button .ac-button-button:active{filter:saturate(85%);cursor:pointer}.ac-button .ac-button-button[disabled]{filter:saturate(55%);pointer-events:none}.ac-button .ac-button-button[disabled].white .ac-button-label{color:#777}.ac-button .ac-button-button .ac-button-label{line-height:normal;font-weight:700;font-size:12px;color:#fff;height:auto}.ac-button .ac-button-button .ac-button-label:focus,.ac-button .ac-button-button .ac-button-label:hover,.ac-button .ac-button-button .ac-button-label:active{cursor:pointer}.ac-button .ac-button-button.white{background:#fff;border:1px solid rgb(191.25,191.25,191.25)}.ac-button .ac-button-button.white .ac-button-label{color:#000;font-weight:500}.ac-button .ac-button-button.primary{background:var(--primary-color, #0aaa18)}.ac-button .ac-button-button.secondary{background:var(--secondary-color, #007bff)}.ac-button .ac-button-button.tertiary{background:var(--tertiary-color, #c822fa)}.ac-button .ac-button-button.neutral{background:var(--neutral-color, #cccccc)}.ac-button .ac-button-button.error{background:var(--error-color, #ff0000)}.ac-button .ac-button-button.success{background:var(--success-color, #0aaa18)}.ac-button .ac-button-button.warning{background:var(--warning-color, #e9d200)}.ac-button .ac-button-button mat-icon{width:auto;height:auto;font-size:24px;color:#fff;display:flex;align-items:center;justify-content:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
56
|
+
}
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcButton, decorators: [{
|
|
58
|
+
type: Component,
|
|
59
|
+
args: [{ selector: 'ac-button', imports: [CommonModule, MatIconModule], template: "<div class=\"ac-button\">\n <button \n class=\"ac-button-button\"\n [ngClass]=\"{\n 'white': isWhite,\n 'primary': isPrimary,\n 'secondary': isSecondary,\n 'tertiary': isTertiary,\n 'neutral': isNeutral,\n 'error': isError,\n 'success': isSuccess,\n 'warning': isWarning\n }\"\n (click)=\"actionClick()\" \n [disabled]=\"disabled\">\n\n <mat-icon *ngIf=\"leftIcon\" [fontIcon]=\"leftIcon\"></mat-icon>\n <label *ngIf=\"title\" class=\"ac-button-label\">{{title}}</label>\n <mat-icon *ngIf=\"rightIcon\" [fontIcon]=\"rightIcon\"></mat-icon>\n </button>\n</div>\n ", styles: [".ac-button{height:100%;width:100%;min-height:24px}.ac-button .ac-button-button{display:flex;align-items:center;justify-content:center;gap:8px;border:none;outline:none;border-radius:5px;min-width:50px;width:100%;height:100%;background:var(--primary-color, #0aaa18)}.ac-button .ac-button-button:hover{filter:saturate(85%);cursor:pointer}.ac-button .ac-button-button:focus,.ac-button .ac-button-button:active{filter:saturate(85%);cursor:pointer}.ac-button .ac-button-button[disabled]{filter:saturate(55%);pointer-events:none}.ac-button .ac-button-button[disabled].white .ac-button-label{color:#777}.ac-button .ac-button-button .ac-button-label{line-height:normal;font-weight:700;font-size:12px;color:#fff;height:auto}.ac-button .ac-button-button .ac-button-label:focus,.ac-button .ac-button-button .ac-button-label:hover,.ac-button .ac-button-button .ac-button-label:active{cursor:pointer}.ac-button .ac-button-button.white{background:#fff;border:1px solid rgb(191.25,191.25,191.25)}.ac-button .ac-button-button.white .ac-button-label{color:#000;font-weight:500}.ac-button .ac-button-button.primary{background:var(--primary-color, #0aaa18)}.ac-button .ac-button-button.secondary{background:var(--secondary-color, #007bff)}.ac-button .ac-button-button.tertiary{background:var(--tertiary-color, #c822fa)}.ac-button .ac-button-button.neutral{background:var(--neutral-color, #cccccc)}.ac-button .ac-button-button.error{background:var(--error-color, #ff0000)}.ac-button .ac-button-button.success{background:var(--success-color, #0aaa18)}.ac-button .ac-button-button.warning{background:var(--warning-color, #e9d200)}.ac-button .ac-button-button mat-icon{width:auto;height:auto;font-size:24px;color:#fff;display:flex;align-items:center;justify-content:center}\n"] }]
|
|
60
|
+
}], ctorParameters: () => [], propDecorators: { disabled: [{
|
|
61
|
+
type: Input
|
|
62
|
+
}], title: [{
|
|
63
|
+
type: Input
|
|
64
|
+
}], colorType: [{
|
|
65
|
+
type: Input
|
|
66
|
+
}], leftIcon: [{
|
|
67
|
+
type: Input
|
|
68
|
+
}], rightIcon: [{
|
|
69
|
+
type: Input
|
|
70
|
+
}], onClick: [{
|
|
71
|
+
type: Input
|
|
72
|
+
}] } });
|
|
73
|
+
|
|
74
|
+
class AcSwitch {
|
|
75
|
+
model = false;
|
|
76
|
+
disabled = false;
|
|
77
|
+
title = '';
|
|
78
|
+
buildTitleSpace = false;
|
|
79
|
+
titleColor = null;
|
|
80
|
+
backgroundColor = 'gray';
|
|
81
|
+
checkedColor = 'green';
|
|
82
|
+
focusColor = 'yellow';
|
|
83
|
+
ballColor = 'white';
|
|
84
|
+
onToggle = null;
|
|
85
|
+
modelChange = new EventEmitter();
|
|
86
|
+
constructor() { }
|
|
87
|
+
ngOnInit() { }
|
|
88
|
+
onChange() {
|
|
89
|
+
this.modelChange.emit(this.model);
|
|
90
|
+
if (this.onToggle) {
|
|
91
|
+
this.onToggle();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcSwitch, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
95
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: AcSwitch, isStandalone: true, selector: "ac-switch", inputs: { model: "model", disabled: "disabled", title: "title", buildTitleSpace: "buildTitleSpace", titleColor: "titleColor", backgroundColor: "backgroundColor", checkedColor: "checkedColor", focusColor: "focusColor", ballColor: "ballColor", onToggle: "onToggle" }, outputs: { modelChange: "modelChange" }, ngImport: i0, template: "<div class=\"ac-switch\" \n [ngStyle]=\"{ \n '--switch-bg-color': backgroundColor,\n '--switch-checked-bg-color': checkedColor, \n '--switch-focus-color': focusColor,\n '--switch-ball-color': ballColor,\n '--title-color': titleColor\n }\">\n <label class=\"ac-label ac-switch-label\" *ngIf=\"buildTitleSpace || title\">{{title}}</label>\n <label class=\"ac-switch-comp\">\n <input\n class=\"ac-switch-input\" \n type=\"checkbox\" \n [checked]=\"model\"\n [(ngModel)]=\"model\"\n [disabled]=\"disabled\"\n (change)=\"onChange()\"\n >\n <span class=\"slider\"></span>\n </label>\n</div>\n", styles: [".ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}.ac-switch{display:flex;flex-direction:column;align-items:flex-start}.ac-switch .ac-switch-label{color:var(--title-color, var(--font-color, black))}.ac-switch .ac-switch-comp{position:relative;display:inline-block;width:30px;height:20px;-webkit-user-select:none;user-select:none}.ac-switch .ac-switch-comp input{opacity:0;width:0;height:0}.ac-switch .slider{position:absolute;cursor:pointer;inset:0;background-color:var(--switch-bg-color);transition:.4s;border-radius:20px}.ac-switch .slider:before{position:absolute;content:\"\";height:14px;width:14px;left:3px;bottom:3px;background-color:var(--switch-ball-color);transition:.15s;border-radius:50%}.ac-switch input:checked+.slider{background-color:var(--switch-checked-bg-color)}.ac-switch input:checked+.slider:before{transform:translate(10px)}.ac-switch input:focus+.slider{box-shadow:0 0 1px 1px var(--switch-focus-color)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
96
|
+
}
|
|
97
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcSwitch, decorators: [{
|
|
98
|
+
type: Component,
|
|
99
|
+
args: [{ selector: 'ac-switch', imports: [FormsModule, CommonModule], template: "<div class=\"ac-switch\" \n [ngStyle]=\"{ \n '--switch-bg-color': backgroundColor,\n '--switch-checked-bg-color': checkedColor, \n '--switch-focus-color': focusColor,\n '--switch-ball-color': ballColor,\n '--title-color': titleColor\n }\">\n <label class=\"ac-label ac-switch-label\" *ngIf=\"buildTitleSpace || title\">{{title}}</label>\n <label class=\"ac-switch-comp\">\n <input\n class=\"ac-switch-input\" \n type=\"checkbox\" \n [checked]=\"model\"\n [(ngModel)]=\"model\"\n [disabled]=\"disabled\"\n (change)=\"onChange()\"\n >\n <span class=\"slider\"></span>\n </label>\n</div>\n", styles: [".ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}.ac-switch{display:flex;flex-direction:column;align-items:flex-start}.ac-switch .ac-switch-label{color:var(--title-color, var(--font-color, black))}.ac-switch .ac-switch-comp{position:relative;display:inline-block;width:30px;height:20px;-webkit-user-select:none;user-select:none}.ac-switch .ac-switch-comp input{opacity:0;width:0;height:0}.ac-switch .slider{position:absolute;cursor:pointer;inset:0;background-color:var(--switch-bg-color);transition:.4s;border-radius:20px}.ac-switch .slider:before{position:absolute;content:\"\";height:14px;width:14px;left:3px;bottom:3px;background-color:var(--switch-ball-color);transition:.15s;border-radius:50%}.ac-switch input:checked+.slider{background-color:var(--switch-checked-bg-color)}.ac-switch input:checked+.slider:before{transform:translate(10px)}.ac-switch input:focus+.slider{box-shadow:0 0 1px 1px var(--switch-focus-color)}\n"] }]
|
|
100
|
+
}], ctorParameters: () => [], propDecorators: { model: [{
|
|
101
|
+
type: Input
|
|
102
|
+
}], disabled: [{
|
|
103
|
+
type: Input
|
|
104
|
+
}], title: [{
|
|
105
|
+
type: Input
|
|
106
|
+
}], buildTitleSpace: [{
|
|
107
|
+
type: Input
|
|
108
|
+
}], titleColor: [{
|
|
109
|
+
type: Input
|
|
110
|
+
}], backgroundColor: [{
|
|
111
|
+
type: Input
|
|
112
|
+
}], checkedColor: [{
|
|
113
|
+
type: Input
|
|
114
|
+
}], focusColor: [{
|
|
115
|
+
type: Input
|
|
116
|
+
}], ballColor: [{
|
|
117
|
+
type: Input
|
|
118
|
+
}], onToggle: [{
|
|
119
|
+
type: Input
|
|
120
|
+
}], modelChange: [{
|
|
121
|
+
type: Output
|
|
122
|
+
}] } });
|
|
123
|
+
|
|
124
|
+
class AcInput {
|
|
125
|
+
model = '';
|
|
126
|
+
disabled = false;
|
|
127
|
+
placeholder = '';
|
|
128
|
+
title = '';
|
|
129
|
+
buildTitleSpace = false;
|
|
130
|
+
debounce = 0;
|
|
131
|
+
onChangeModel = null;
|
|
132
|
+
modelChange = new EventEmitter();
|
|
133
|
+
inputSubject = new Subject();
|
|
134
|
+
constructor() { }
|
|
135
|
+
ngOnInit() {
|
|
136
|
+
this.inputSubject.pipe(debounceTime(this.debounce)).subscribe((value) => {
|
|
137
|
+
this.modelChange.emit(value);
|
|
138
|
+
if (this.onChangeModel) {
|
|
139
|
+
this.onChangeModel(value);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
onChange(value) {
|
|
144
|
+
this.inputSubject.next(value);
|
|
145
|
+
}
|
|
146
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
147
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.2", type: AcInput, isStandalone: true, inputs: { model: "model", disabled: "disabled", placeholder: "placeholder", title: "title", buildTitleSpace: "buildTitleSpace", debounce: "debounce", onChangeModel: "onChangeModel" }, outputs: { modelChange: "modelChange" }, ngImport: i0 });
|
|
148
|
+
}
|
|
149
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInput, decorators: [{
|
|
150
|
+
type: Directive
|
|
151
|
+
}], ctorParameters: () => [], propDecorators: { model: [{
|
|
152
|
+
type: Input
|
|
153
|
+
}], disabled: [{
|
|
154
|
+
type: Input
|
|
155
|
+
}], placeholder: [{
|
|
156
|
+
type: Input
|
|
157
|
+
}], title: [{
|
|
158
|
+
type: Input
|
|
159
|
+
}], buildTitleSpace: [{
|
|
160
|
+
type: Input
|
|
161
|
+
}], debounce: [{
|
|
162
|
+
type: Input
|
|
163
|
+
}], onChangeModel: [{
|
|
164
|
+
type: Input
|
|
165
|
+
}], modelChange: [{
|
|
166
|
+
type: Output
|
|
167
|
+
}] } });
|
|
168
|
+
|
|
169
|
+
class AcInputPassword extends AcInput {
|
|
170
|
+
showPassword = false;
|
|
171
|
+
constructor() {
|
|
172
|
+
super();
|
|
173
|
+
}
|
|
174
|
+
togglePasswordVisibility() {
|
|
175
|
+
this.showPassword = !this.showPassword;
|
|
176
|
+
}
|
|
177
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInputPassword, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
178
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: AcInputPassword, isStandalone: true, selector: "ac-input-password", usesInheritance: true, ngImport: i0, template: "<div class=\"ac-input-base ac-input-password\">\n <label class=\"ac-label\" *ngIf=\"buildTitleSpace || title\">{{title}}</label>\n <div class=\"ac-input-base-comp ac-input-password-comp\" [ngClass]=\"{ 'disabled': disabled }\">\n <input\n [type]=\"showPassword ? 'text' : 'password'\" \n [(ngModel)]=\"model\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"onChange($event)\"\n placeholder=\"{{placeholder}}\"\n >\n <button \n type=\"button\" \n class=\"toggle-password-visibility\"\n (click)=\"togglePasswordVisibility()\">\n <i class=\"material-icons\">{{ showPassword ? 'visibility_off' : 'visibility' }}</i>\n </button>\n </div>\n\n</div>\n", styles: [".ac-input-base{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin-top:2px;margin-bottom:2px}.ac-input-base .ac-input-base-comp.disabled{pointer-events:none;opacity:.9;background-color:color-mix(in srgb,var(--font-color, black) 8%,transparent)}.ac-input-base .ac-input-base-comp{position:relative;display:flex;align-items:center;width:100%;height:21px;transition:border-bottom-color .3s ease;border-radius:5px;border:1px solid rgb(191.25,191.25,191.25);box-sizing:border-box}.ac-input-base .ac-input-base-comp:focus-within{border-bottom:2px solid green}.ac-input-base .ac-input-base-comp>input{width:100%;padding:2px 5px;background:none;outline:none;position:relative;color:var(--font-color, black);font-size:14px;border:none}.ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}.ac-input-password .ac-input-password-comp .toggle-password-visibility{position:absolute;right:5px;top:50%;transform:translateY(-50%);background:none;border:none;cursor:pointer;color:var(--font-color, black);height:14px;display:flex;align-items:center;justify-content:center}.ac-input-password .ac-input-password-comp .toggle-password-visibility .material-icons{font-size:16px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
179
|
+
}
|
|
180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInputPassword, decorators: [{
|
|
181
|
+
type: Component,
|
|
182
|
+
args: [{ selector: 'ac-input-password', imports: [FormsModule, CommonModule], template: "<div class=\"ac-input-base ac-input-password\">\n <label class=\"ac-label\" *ngIf=\"buildTitleSpace || title\">{{title}}</label>\n <div class=\"ac-input-base-comp ac-input-password-comp\" [ngClass]=\"{ 'disabled': disabled }\">\n <input\n [type]=\"showPassword ? 'text' : 'password'\" \n [(ngModel)]=\"model\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"onChange($event)\"\n placeholder=\"{{placeholder}}\"\n >\n <button \n type=\"button\" \n class=\"toggle-password-visibility\"\n (click)=\"togglePasswordVisibility()\">\n <i class=\"material-icons\">{{ showPassword ? 'visibility_off' : 'visibility' }}</i>\n </button>\n </div>\n\n</div>\n", styles: [".ac-input-base{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin-top:2px;margin-bottom:2px}.ac-input-base .ac-input-base-comp.disabled{pointer-events:none;opacity:.9;background-color:color-mix(in srgb,var(--font-color, black) 8%,transparent)}.ac-input-base .ac-input-base-comp{position:relative;display:flex;align-items:center;width:100%;height:21px;transition:border-bottom-color .3s ease;border-radius:5px;border:1px solid rgb(191.25,191.25,191.25);box-sizing:border-box}.ac-input-base .ac-input-base-comp:focus-within{border-bottom:2px solid green}.ac-input-base .ac-input-base-comp>input{width:100%;padding:2px 5px;background:none;outline:none;position:relative;color:var(--font-color, black);font-size:14px;border:none}.ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}.ac-input-password .ac-input-password-comp .toggle-password-visibility{position:absolute;right:5px;top:50%;transform:translateY(-50%);background:none;border:none;cursor:pointer;color:var(--font-color, black);height:14px;display:flex;align-items:center;justify-content:center}.ac-input-password .ac-input-password-comp .toggle-password-visibility .material-icons{font-size:16px}\n"] }]
|
|
183
|
+
}], ctorParameters: () => [] });
|
|
184
|
+
|
|
185
|
+
class AcInputText extends AcInput {
|
|
186
|
+
constructor() {
|
|
187
|
+
super();
|
|
188
|
+
}
|
|
189
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInputText, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
190
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: AcInputText, isStandalone: true, selector: "ac-input-text", usesInheritance: true, ngImport: i0, template: "<div class=\"ac-input-base\">\n <label class=\"ac-label\" *ngIf=\"buildTitleSpace || title\">{{title}}</label>\n <div class=\"ac-input-base-comp\" [ngClass]=\"{ 'disabled': disabled }\">\n <input\n [type]=\"'text'\" \n [(ngModel)]=\"model\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"onChange($event)\"\n placeholder=\"{{placeholder}}\"\n >\n </div>\n</div>\n", styles: [".ac-input-base{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin-top:2px;margin-bottom:2px}.ac-input-base .ac-input-base-comp.disabled{pointer-events:none;opacity:.9;background-color:color-mix(in srgb,var(--font-color, black) 8%,transparent)}.ac-input-base .ac-input-base-comp{position:relative;display:flex;align-items:center;width:100%;height:21px;transition:border-bottom-color .3s ease;border-radius:5px;border:1px solid rgb(191.25,191.25,191.25);box-sizing:border-box}.ac-input-base .ac-input-base-comp:focus-within{border-bottom:2px solid green}.ac-input-base .ac-input-base-comp>input{width:100%;padding:2px 5px;background:none;outline:none;position:relative;color:var(--font-color, black);font-size:14px;border:none}.ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
191
|
+
}
|
|
192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInputText, decorators: [{
|
|
193
|
+
type: Component,
|
|
194
|
+
args: [{ selector: 'ac-input-text', imports: [FormsModule, CommonModule], template: "<div class=\"ac-input-base\">\n <label class=\"ac-label\" *ngIf=\"buildTitleSpace || title\">{{title}}</label>\n <div class=\"ac-input-base-comp\" [ngClass]=\"{ 'disabled': disabled }\">\n <input\n [type]=\"'text'\" \n [(ngModel)]=\"model\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"onChange($event)\"\n placeholder=\"{{placeholder}}\"\n >\n </div>\n</div>\n", styles: [".ac-input-base{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin-top:2px;margin-bottom:2px}.ac-input-base .ac-input-base-comp.disabled{pointer-events:none;opacity:.9;background-color:color-mix(in srgb,var(--font-color, black) 8%,transparent)}.ac-input-base .ac-input-base-comp{position:relative;display:flex;align-items:center;width:100%;height:21px;transition:border-bottom-color .3s ease;border-radius:5px;border:1px solid rgb(191.25,191.25,191.25);box-sizing:border-box}.ac-input-base .ac-input-base-comp:focus-within{border-bottom:2px solid green}.ac-input-base .ac-input-base-comp>input{width:100%;padding:2px 5px;background:none;outline:none;position:relative;color:var(--font-color, black);font-size:14px;border:none}.ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}\n"] }]
|
|
195
|
+
}], ctorParameters: () => [] });
|
|
196
|
+
|
|
197
|
+
class AcInputMaskNumber {
|
|
198
|
+
model = '';
|
|
199
|
+
disabled = false;
|
|
200
|
+
placeholder = '';
|
|
201
|
+
title = '';
|
|
202
|
+
buildTitleSpace = false;
|
|
203
|
+
debounce = 0;
|
|
204
|
+
onChangeModel = null;
|
|
205
|
+
modelChange = new EventEmitter();
|
|
206
|
+
inputSubject = new Subject();
|
|
207
|
+
formattedValue = '';
|
|
208
|
+
constructor() { }
|
|
209
|
+
ngOnInit() {
|
|
210
|
+
this.formattedValue = this.applyMask(this.model, false);
|
|
211
|
+
this.inputSubject.pipe(debounceTime(this.debounce)).subscribe((value) => {
|
|
212
|
+
this.modelChange.emit(value);
|
|
213
|
+
if (this.onChangeModel) {
|
|
214
|
+
this.onChangeModel(value);
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
ngOnChanges(changes) {
|
|
219
|
+
if (changes['model'] && changes['model'].currentValue !== changes['model'].previousValue) {
|
|
220
|
+
this.formattedValue = this.applyMask(this.model, false);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
onChange(value) {
|
|
224
|
+
setTimeout(() => {
|
|
225
|
+
this.formattedValue = this.applyMask(value, true);
|
|
226
|
+
this.inputSubject.next(this.formattedValue.replace(/\D/g, ''));
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInputMaskNumber, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
230
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.2", type: AcInputMaskNumber, isStandalone: true, inputs: { model: "model", disabled: "disabled", placeholder: "placeholder", title: "title", buildTitleSpace: "buildTitleSpace", debounce: "debounce", onChangeModel: "onChangeModel" }, outputs: { modelChange: "modelChange" }, usesOnChanges: true, ngImport: i0 });
|
|
231
|
+
}
|
|
232
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInputMaskNumber, decorators: [{
|
|
233
|
+
type: Directive
|
|
234
|
+
}], ctorParameters: () => [], propDecorators: { model: [{
|
|
235
|
+
type: Input
|
|
236
|
+
}], disabled: [{
|
|
237
|
+
type: Input
|
|
238
|
+
}], placeholder: [{
|
|
239
|
+
type: Input
|
|
240
|
+
}], title: [{
|
|
241
|
+
type: Input
|
|
242
|
+
}], buildTitleSpace: [{
|
|
243
|
+
type: Input
|
|
244
|
+
}], debounce: [{
|
|
245
|
+
type: Input
|
|
246
|
+
}], onChangeModel: [{
|
|
247
|
+
type: Input
|
|
248
|
+
}], modelChange: [{
|
|
249
|
+
type: Output
|
|
250
|
+
}] } });
|
|
251
|
+
|
|
252
|
+
class AcInputDocumentNumber extends AcInputMaskNumber {
|
|
253
|
+
documentType = '';
|
|
254
|
+
constructor() {
|
|
255
|
+
super();
|
|
256
|
+
}
|
|
257
|
+
applyMask(value, limitLength) {
|
|
258
|
+
value = (value || '').replace(/\D/g, '');
|
|
259
|
+
if (limitLength && this.documentType && this.documentType.toUpperCase() === 'CPF' && value.length > 11) {
|
|
260
|
+
value = value.substring(0, 11);
|
|
261
|
+
}
|
|
262
|
+
else if (limitLength && value.length > 14) {
|
|
263
|
+
value = value.substring(0, 14);
|
|
264
|
+
}
|
|
265
|
+
if (value.length == 11 && !(this.documentType && this.documentType.toUpperCase() === 'CNPJ')) {
|
|
266
|
+
value = value.replace(/(\d{3})(\d{3})(\d{3})(\d{2})$/, '$1.$2.$3-$4');
|
|
267
|
+
}
|
|
268
|
+
else if (value.length == 14 && !(this.documentType && this.documentType.toUpperCase() === 'CPF')) {
|
|
269
|
+
value = value.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})$/, '$1.$2.$3/$4-$5');
|
|
270
|
+
}
|
|
271
|
+
return value;
|
|
272
|
+
}
|
|
273
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInputDocumentNumber, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
274
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: AcInputDocumentNumber, isStandalone: true, selector: "ac-input-document-number", inputs: { documentType: "documentType" }, usesInheritance: true, ngImport: i0, template: "<div class=\"ac-input-base\">\n <label class=\"ac-label\" *ngIf=\"buildTitleSpace || title\">{{title}}</label>\n <div class=\"ac-input-base-comp\" [ngClass]=\"{ 'disabled': disabled }\">\n <input\n [type]=\"'text'\" \n [(ngModel)]=\"formattedValue\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"onChange($event)\"\n placeholder=\"{{placeholder}}\"\n >\n </div>\n</div>\n", styles: [".ac-input-base{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin-top:2px;margin-bottom:2px}.ac-input-base .ac-input-base-comp.disabled{pointer-events:none;opacity:.9;background-color:color-mix(in srgb,var(--font-color, black) 8%,transparent)}.ac-input-base .ac-input-base-comp{position:relative;display:flex;align-items:center;width:100%;height:21px;transition:border-bottom-color .3s ease;border-radius:5px;border:1px solid rgb(191.25,191.25,191.25);box-sizing:border-box}.ac-input-base .ac-input-base-comp:focus-within{border-bottom:2px solid green}.ac-input-base .ac-input-base-comp>input{width:100%;padding:2px 5px;background:none;outline:none;position:relative;color:var(--font-color, black);font-size:14px;border:none}.ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
275
|
+
}
|
|
276
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInputDocumentNumber, decorators: [{
|
|
277
|
+
type: Component,
|
|
278
|
+
args: [{ selector: 'ac-input-document-number', imports: [FormsModule, CommonModule], template: "<div class=\"ac-input-base\">\n <label class=\"ac-label\" *ngIf=\"buildTitleSpace || title\">{{title}}</label>\n <div class=\"ac-input-base-comp\" [ngClass]=\"{ 'disabled': disabled }\">\n <input\n [type]=\"'text'\" \n [(ngModel)]=\"formattedValue\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"onChange($event)\"\n placeholder=\"{{placeholder}}\"\n >\n </div>\n</div>\n", styles: [".ac-input-base{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin-top:2px;margin-bottom:2px}.ac-input-base .ac-input-base-comp.disabled{pointer-events:none;opacity:.9;background-color:color-mix(in srgb,var(--font-color, black) 8%,transparent)}.ac-input-base .ac-input-base-comp{position:relative;display:flex;align-items:center;width:100%;height:21px;transition:border-bottom-color .3s ease;border-radius:5px;border:1px solid rgb(191.25,191.25,191.25);box-sizing:border-box}.ac-input-base .ac-input-base-comp:focus-within{border-bottom:2px solid green}.ac-input-base .ac-input-base-comp>input{width:100%;padding:2px 5px;background:none;outline:none;position:relative;color:var(--font-color, black);font-size:14px;border:none}.ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}\n"] }]
|
|
279
|
+
}], ctorParameters: () => [], propDecorators: { documentType: [{
|
|
280
|
+
type: Input
|
|
281
|
+
}] } });
|
|
282
|
+
|
|
283
|
+
class AcInputPhoneNumber extends AcInputMaskNumber {
|
|
284
|
+
constructor() {
|
|
285
|
+
super();
|
|
286
|
+
}
|
|
287
|
+
applyMask(value, limitLength) {
|
|
288
|
+
value = (value || '').replace(/\D/g, '');
|
|
289
|
+
if (limitLength && value.length > 14) {
|
|
290
|
+
value = value.substring(0, 14);
|
|
291
|
+
}
|
|
292
|
+
if (value.length == 10) {
|
|
293
|
+
value = value.replace(/(\d{2})(\d{4})(\d{4})$/, '($1) $2-$3');
|
|
294
|
+
}
|
|
295
|
+
else if (value.length == 11) {
|
|
296
|
+
value = value.replace(/(\d{2})(\d{5})(\d{4})$/, '($1) $2-$3');
|
|
297
|
+
}
|
|
298
|
+
else if (value.length == 12) {
|
|
299
|
+
value = value.replace(/(\d{2})(\d{2})(\d{4})(\d{4})$/, '+$1 ($2) $3-$4');
|
|
300
|
+
}
|
|
301
|
+
else if (value.length == 13) {
|
|
302
|
+
value = value.replace(/(\d{2})(\d{2})(\d{5})(\d{4})$/, '+$1 ($2) $3-$4');
|
|
303
|
+
}
|
|
304
|
+
return value;
|
|
305
|
+
}
|
|
306
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInputPhoneNumber, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
307
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: AcInputPhoneNumber, isStandalone: true, selector: "ac-input-phone-number", usesInheritance: true, ngImport: i0, template: "<div class=\"ac-input-base\">\n <label class=\"ac-label\" *ngIf=\"buildTitleSpace || title\">{{title}}</label>\n <div class=\"ac-input-base-comp\" [ngClass]=\"{ 'disabled': disabled }\">\n <input\n [type]=\"'text'\" \n [(ngModel)]=\"formattedValue\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"onChange($event)\"\n placeholder=\"{{placeholder}}\"\n >\n </div>\n</div>\n", styles: [".ac-input-base{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin-top:2px;margin-bottom:2px}.ac-input-base .ac-input-base-comp.disabled{pointer-events:none;opacity:.9;background-color:color-mix(in srgb,var(--font-color, black) 8%,transparent)}.ac-input-base .ac-input-base-comp{position:relative;display:flex;align-items:center;width:100%;height:21px;transition:border-bottom-color .3s ease;border-radius:5px;border:1px solid rgb(191.25,191.25,191.25);box-sizing:border-box}.ac-input-base .ac-input-base-comp:focus-within{border-bottom:2px solid green}.ac-input-base .ac-input-base-comp>input{width:100%;padding:2px 5px;background:none;outline:none;position:relative;color:var(--font-color, black);font-size:14px;border:none}.ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
308
|
+
}
|
|
309
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInputPhoneNumber, decorators: [{
|
|
310
|
+
type: Component,
|
|
311
|
+
args: [{ selector: 'ac-input-phone-number', imports: [FormsModule, CommonModule], template: "<div class=\"ac-input-base\">\n <label class=\"ac-label\" *ngIf=\"buildTitleSpace || title\">{{title}}</label>\n <div class=\"ac-input-base-comp\" [ngClass]=\"{ 'disabled': disabled }\">\n <input\n [type]=\"'text'\" \n [(ngModel)]=\"formattedValue\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"onChange($event)\"\n placeholder=\"{{placeholder}}\"\n >\n </div>\n</div>\n", styles: [".ac-input-base{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin-top:2px;margin-bottom:2px}.ac-input-base .ac-input-base-comp.disabled{pointer-events:none;opacity:.9;background-color:color-mix(in srgb,var(--font-color, black) 8%,transparent)}.ac-input-base .ac-input-base-comp{position:relative;display:flex;align-items:center;width:100%;height:21px;transition:border-bottom-color .3s ease;border-radius:5px;border:1px solid rgb(191.25,191.25,191.25);box-sizing:border-box}.ac-input-base .ac-input-base-comp:focus-within{border-bottom:2px solid green}.ac-input-base .ac-input-base-comp>input{width:100%;padding:2px 5px;background:none;outline:none;position:relative;color:var(--font-color, black);font-size:14px;border:none}.ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}\n"] }]
|
|
312
|
+
}], ctorParameters: () => [] });
|
|
313
|
+
|
|
314
|
+
class AcInputDateTimeDefault {
|
|
315
|
+
model;
|
|
316
|
+
disabled = false;
|
|
317
|
+
title = '';
|
|
318
|
+
buildTitleSpace = false;
|
|
319
|
+
debounce = 0;
|
|
320
|
+
onChangeModel = null;
|
|
321
|
+
modelChange = new EventEmitter();
|
|
322
|
+
inputSubject = new Subject();
|
|
323
|
+
date = '';
|
|
324
|
+
time = '';
|
|
325
|
+
constructor() { }
|
|
326
|
+
ngOnInit() {
|
|
327
|
+
this.inputSubject.pipe(debounceTime(this.debounce)).subscribe((value) => {
|
|
328
|
+
this.modelChange.emit(value);
|
|
329
|
+
if (this.onChangeModel) {
|
|
330
|
+
this.onChangeModel(value);
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
this.applyMask();
|
|
334
|
+
}
|
|
335
|
+
applyMask() {
|
|
336
|
+
if (this.model) {
|
|
337
|
+
const dateObj = new Date(this.model);
|
|
338
|
+
this.date = this.formatDate(dateObj);
|
|
339
|
+
this.time = this.formatTime(dateObj);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
ngOnChanges(changes) {
|
|
343
|
+
if (changes['model'] && changes['model'].currentValue !== changes['model'].previousValue) {
|
|
344
|
+
this.applyMask();
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
onChangeDate(event) {
|
|
348
|
+
this.date = event;
|
|
349
|
+
this.updateNgModel();
|
|
350
|
+
}
|
|
351
|
+
onChangeTime(event) {
|
|
352
|
+
this.time = event;
|
|
353
|
+
this.updateNgModel();
|
|
354
|
+
}
|
|
355
|
+
updateNgModel() {
|
|
356
|
+
if (this.date && this.time) {
|
|
357
|
+
const combinedDateTime = new Date(`${this.date}T${this.time}`);
|
|
358
|
+
this.model = combinedDateTime;
|
|
359
|
+
this.inputSubject.next(this.model);
|
|
360
|
+
}
|
|
361
|
+
else if (this.date) {
|
|
362
|
+
const dateOnly = new Date(this.date);
|
|
363
|
+
this.model = dateOnly;
|
|
364
|
+
this.inputSubject.next(this.model);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
formatDate(date) {
|
|
368
|
+
const year = date.getFullYear();
|
|
369
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
370
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
371
|
+
return `${year}-${month}-${day}`;
|
|
372
|
+
}
|
|
373
|
+
formatTime(date) {
|
|
374
|
+
const hours = String(date.getHours()).padStart(2, '0');
|
|
375
|
+
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
376
|
+
const seconds = String(date.getSeconds()).padStart(2, '0');
|
|
377
|
+
return `${hours}:${minutes}:${seconds}`;
|
|
378
|
+
}
|
|
379
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInputDateTimeDefault, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
380
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0.2", type: AcInputDateTimeDefault, isStandalone: true, inputs: { model: "model", disabled: "disabled", title: "title", buildTitleSpace: "buildTitleSpace", debounce: "debounce", onChangeModel: "onChangeModel" }, outputs: { modelChange: "modelChange" }, usesOnChanges: true, ngImport: i0 });
|
|
381
|
+
}
|
|
382
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInputDateTimeDefault, decorators: [{
|
|
383
|
+
type: Directive
|
|
384
|
+
}], ctorParameters: () => [], propDecorators: { model: [{
|
|
385
|
+
type: Input
|
|
386
|
+
}], disabled: [{
|
|
387
|
+
type: Input
|
|
388
|
+
}], title: [{
|
|
389
|
+
type: Input
|
|
390
|
+
}], buildTitleSpace: [{
|
|
391
|
+
type: Input
|
|
392
|
+
}], debounce: [{
|
|
393
|
+
type: Input
|
|
394
|
+
}], onChangeModel: [{
|
|
395
|
+
type: Input
|
|
396
|
+
}], modelChange: [{
|
|
397
|
+
type: Output
|
|
398
|
+
}] } });
|
|
399
|
+
|
|
400
|
+
class AcInputDateTime extends AcInputDateTimeDefault {
|
|
401
|
+
constructor() {
|
|
402
|
+
super();
|
|
403
|
+
}
|
|
404
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInputDateTime, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
405
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: AcInputDateTime, isStandalone: true, selector: "ac-input-date-time", usesInheritance: true, ngImport: i0, template: "<div class=\"ac-input-base\">\n <label class=\"ac-label\" *ngIf=\"buildTitleSpace || title\">{{title}}</label>\n <div class=\"ac-input-base-comp\" [ngClass]=\"{ 'disabled': disabled }\">\n <input\n [type]=\"'date'\" \n [(ngModel)]=\"date\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"onChangeDate($event)\"\n >\n <input\n [type]=\"'time'\" \n [(ngModel)]=\"time\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"onChangeTime($event)\"\n >\n </div>\n</div>\n", styles: [".ac-input-base{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin-top:2px;margin-bottom:2px}.ac-input-base .ac-input-base-comp.disabled{pointer-events:none;opacity:.9;background-color:color-mix(in srgb,var(--font-color, black) 8%,transparent)}.ac-input-base .ac-input-base-comp{position:relative;display:flex;align-items:center;width:100%;height:21px;transition:border-bottom-color .3s ease;border-radius:5px;border:1px solid rgb(191.25,191.25,191.25);box-sizing:border-box}.ac-input-base .ac-input-base-comp:focus-within{border-bottom:2px solid green}.ac-input-base .ac-input-base-comp>input{width:100%;padding:2px 5px;background:none;outline:none;position:relative;color:var(--font-color, black);font-size:14px;border:none}.ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
406
|
+
}
|
|
407
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInputDateTime, decorators: [{
|
|
408
|
+
type: Component,
|
|
409
|
+
args: [{ selector: 'ac-input-date-time', imports: [FormsModule, CommonModule], template: "<div class=\"ac-input-base\">\n <label class=\"ac-label\" *ngIf=\"buildTitleSpace || title\">{{title}}</label>\n <div class=\"ac-input-base-comp\" [ngClass]=\"{ 'disabled': disabled }\">\n <input\n [type]=\"'date'\" \n [(ngModel)]=\"date\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"onChangeDate($event)\"\n >\n <input\n [type]=\"'time'\" \n [(ngModel)]=\"time\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"onChangeTime($event)\"\n >\n </div>\n</div>\n", styles: [".ac-input-base{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin-top:2px;margin-bottom:2px}.ac-input-base .ac-input-base-comp.disabled{pointer-events:none;opacity:.9;background-color:color-mix(in srgb,var(--font-color, black) 8%,transparent)}.ac-input-base .ac-input-base-comp{position:relative;display:flex;align-items:center;width:100%;height:21px;transition:border-bottom-color .3s ease;border-radius:5px;border:1px solid rgb(191.25,191.25,191.25);box-sizing:border-box}.ac-input-base .ac-input-base-comp:focus-within{border-bottom:2px solid green}.ac-input-base .ac-input-base-comp>input{width:100%;padding:2px 5px;background:none;outline:none;position:relative;color:var(--font-color, black);font-size:14px;border:none}.ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}\n"] }]
|
|
410
|
+
}], ctorParameters: () => [] });
|
|
411
|
+
|
|
412
|
+
class AcInputDate extends AcInputDateTimeDefault {
|
|
413
|
+
constructor() {
|
|
414
|
+
super();
|
|
415
|
+
}
|
|
416
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInputDate, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
417
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: AcInputDate, isStandalone: true, selector: "ac-input-date", usesInheritance: true, ngImport: i0, template: "<div class=\"ac-input-base\">\n <label class=\"ac-label\" *ngIf=\"buildTitleSpace || title\">{{title}}</label>\n <div class=\"ac-input-base-comp\" [ngClass]=\"{ 'disabled': disabled }\">\n <input\n [type]=\"'date'\" \n [(ngModel)]=\"date\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"onChangeDate($event)\"\n >\n </div>\n</div>\n", styles: [".ac-input-base{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin-top:2px;margin-bottom:2px}.ac-input-base .ac-input-base-comp.disabled{pointer-events:none;opacity:.9;background-color:color-mix(in srgb,var(--font-color, black) 8%,transparent)}.ac-input-base .ac-input-base-comp{position:relative;display:flex;align-items:center;width:100%;height:21px;transition:border-bottom-color .3s ease;border-radius:5px;border:1px solid rgb(191.25,191.25,191.25);box-sizing:border-box}.ac-input-base .ac-input-base-comp:focus-within{border-bottom:2px solid green}.ac-input-base .ac-input-base-comp>input{width:100%;padding:2px 5px;background:none;outline:none;position:relative;color:var(--font-color, black);font-size:14px;border:none}.ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
418
|
+
}
|
|
419
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInputDate, decorators: [{
|
|
420
|
+
type: Component,
|
|
421
|
+
args: [{ selector: 'ac-input-date', imports: [FormsModule, CommonModule], template: "<div class=\"ac-input-base\">\n <label class=\"ac-label\" *ngIf=\"buildTitleSpace || title\">{{title}}</label>\n <div class=\"ac-input-base-comp\" [ngClass]=\"{ 'disabled': disabled }\">\n <input\n [type]=\"'date'\" \n [(ngModel)]=\"date\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"onChangeDate($event)\"\n >\n </div>\n</div>\n", styles: [".ac-input-base{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin-top:2px;margin-bottom:2px}.ac-input-base .ac-input-base-comp.disabled{pointer-events:none;opacity:.9;background-color:color-mix(in srgb,var(--font-color, black) 8%,transparent)}.ac-input-base .ac-input-base-comp{position:relative;display:flex;align-items:center;width:100%;height:21px;transition:border-bottom-color .3s ease;border-radius:5px;border:1px solid rgb(191.25,191.25,191.25);box-sizing:border-box}.ac-input-base .ac-input-base-comp:focus-within{border-bottom:2px solid green}.ac-input-base .ac-input-base-comp>input{width:100%;padding:2px 5px;background:none;outline:none;position:relative;color:var(--font-color, black);font-size:14px;border:none}.ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}\n"] }]
|
|
422
|
+
}], ctorParameters: () => [] });
|
|
423
|
+
|
|
424
|
+
class AcInputTime extends AcInputDateTimeDefault {
|
|
425
|
+
constructor() {
|
|
426
|
+
super();
|
|
427
|
+
}
|
|
428
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInputTime, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
429
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: AcInputTime, isStandalone: true, selector: "ac-input-time", usesInheritance: true, ngImport: i0, template: "<div class=\"ac-input-base\">\n <label class=\"ac-label\" *ngIf=\"buildTitleSpace || title\">{{title}}</label>\n <div class=\"ac-input-base-comp\" [ngClass]=\"{ 'disabled': disabled }\">\n <input\n [type]=\"'time'\" \n [(ngModel)]=\"time\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"onChangeTime($event)\"\n >\n </div>\n</div>\n", styles: [".ac-input-base{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin-top:2px;margin-bottom:2px}.ac-input-base .ac-input-base-comp.disabled{pointer-events:none;opacity:.9;background-color:color-mix(in srgb,var(--font-color, black) 8%,transparent)}.ac-input-base .ac-input-base-comp{position:relative;display:flex;align-items:center;width:100%;height:21px;transition:border-bottom-color .3s ease;border-radius:5px;border:1px solid rgb(191.25,191.25,191.25);box-sizing:border-box}.ac-input-base .ac-input-base-comp:focus-within{border-bottom:2px solid green}.ac-input-base .ac-input-base-comp>input{width:100%;padding:2px 5px;background:none;outline:none;position:relative;color:var(--font-color, black);font-size:14px;border:none}.ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
430
|
+
}
|
|
431
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInputTime, decorators: [{
|
|
432
|
+
type: Component,
|
|
433
|
+
args: [{ selector: 'ac-input-time', imports: [FormsModule, CommonModule], template: "<div class=\"ac-input-base\">\n <label class=\"ac-label\" *ngIf=\"buildTitleSpace || title\">{{title}}</label>\n <div class=\"ac-input-base-comp\" [ngClass]=\"{ 'disabled': disabled }\">\n <input\n [type]=\"'time'\" \n [(ngModel)]=\"time\"\n [disabled]=\"disabled\"\n (ngModelChange)=\"onChangeTime($event)\"\n >\n </div>\n</div>\n", styles: [".ac-input-base{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin-top:2px;margin-bottom:2px}.ac-input-base .ac-input-base-comp.disabled{pointer-events:none;opacity:.9;background-color:color-mix(in srgb,var(--font-color, black) 8%,transparent)}.ac-input-base .ac-input-base-comp{position:relative;display:flex;align-items:center;width:100%;height:21px;transition:border-bottom-color .3s ease;border-radius:5px;border:1px solid rgb(191.25,191.25,191.25);box-sizing:border-box}.ac-input-base .ac-input-base-comp:focus-within{border-bottom:2px solid green}.ac-input-base .ac-input-base-comp>input{width:100%;padding:2px 5px;background:none;outline:none;position:relative;color:var(--font-color, black);font-size:14px;border:none}.ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}\n"] }]
|
|
434
|
+
}], ctorParameters: () => [] });
|
|
435
|
+
|
|
436
|
+
class AcInputFile {
|
|
437
|
+
model = '';
|
|
438
|
+
disabled = false;
|
|
439
|
+
title = '';
|
|
440
|
+
buildTitleSpace = false;
|
|
441
|
+
accept = '*';
|
|
442
|
+
index;
|
|
443
|
+
onSelectFile = new EventEmitter();
|
|
444
|
+
onUnselectFile = new EventEmitter();
|
|
445
|
+
selectedFileName = null;
|
|
446
|
+
fileInputId = `file-input-${this.uuid()}`;
|
|
447
|
+
constructor() { }
|
|
448
|
+
ngOnInit() { }
|
|
449
|
+
onFileChange(event) {
|
|
450
|
+
const input = event.target;
|
|
451
|
+
if (input.files && input.files.length > 0) {
|
|
452
|
+
this.selectedFileName = input.files[0].name;
|
|
453
|
+
this.onSelectFile.emit({ event, index: this.index });
|
|
454
|
+
}
|
|
455
|
+
else {
|
|
456
|
+
this.selectedFileName = null;
|
|
457
|
+
this.onUnselectFile.emit({ index: this.index });
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
triggerFileInput() {
|
|
461
|
+
const fileInput = document.querySelector(`.${this.fileInputId}`);
|
|
462
|
+
fileInput.click();
|
|
463
|
+
}
|
|
464
|
+
removeFile() {
|
|
465
|
+
this.selectedFileName = null;
|
|
466
|
+
const fileInput = document.querySelector(`.${this.fileInputId}`);
|
|
467
|
+
if (fileInput) {
|
|
468
|
+
fileInput.value = '';
|
|
469
|
+
}
|
|
470
|
+
this.onUnselectFile.emit({ index: this.index });
|
|
471
|
+
}
|
|
472
|
+
uuid() {
|
|
473
|
+
function s4() {
|
|
474
|
+
return Math.floor((1 + Math.random()) * 0x10000)
|
|
475
|
+
.toString(16)
|
|
476
|
+
.substring(1);
|
|
477
|
+
}
|
|
478
|
+
return (s4() + s4() + s4() + s4() + s4() + s4() + s4() + s4()).toUpperCase();
|
|
479
|
+
}
|
|
480
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInputFile, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
481
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: AcInputFile, isStandalone: true, selector: "ac-input-file", inputs: { model: "model", disabled: "disabled", title: "title", buildTitleSpace: "buildTitleSpace", accept: "accept", index: "index" }, outputs: { onSelectFile: "onSelectFile", onUnselectFile: "onUnselectFile" }, ngImport: i0, template: "<div class=\"ac-input-base ac-input-file\">\n <label class=\"ac-label\" *ngIf=\"buildTitleSpace || title\">{{title}}</label>\n <div class=\"ac-input-base-comp ac-input-file-comp\" [ngClass]=\"{ 'disabled': disabled }\">\n <input\n type=\"file\" \n (change)=\"onFileChange($event)\" \n [accept]=\"accept\"\n class=\"{{'hidden-input' + ' ' + fileInputId}}\"\n />\n <button type=\"button\" class=\"custom-file-button\" (click)=\"triggerFileInput()\">\n <mat-icon [fontIcon]=\"'attach_file'\"></mat-icon>\n </button>\n <span class=\"file-name\">{{ selectedFileName || 'Nenhum arquivo selecionado' }}</span>\n <mat-icon *ngIf=\"selectedFileName\" class=\"unselect-icon\" [fontIcon]=\"'close'\" (click)=\"removeFile()\"></mat-icon>\n </div>\n</div>", styles: [".ac-input-base{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin-top:2px;margin-bottom:2px}.ac-input-base .ac-input-base-comp.disabled{pointer-events:none;opacity:.9;background-color:color-mix(in srgb,var(--font-color, black) 8%,transparent)}.ac-input-base .ac-input-base-comp{position:relative;display:flex;align-items:center;width:100%;height:21px;transition:border-bottom-color .3s ease;border-radius:5px;border:1px solid rgb(191.25,191.25,191.25);box-sizing:border-box}.ac-input-base .ac-input-base-comp:focus-within{border-bottom:2px solid green}.ac-input-base .ac-input-base-comp>input{width:100%;padding:2px 5px;background:none;outline:none;position:relative;color:var(--font-color, black);font-size:14px;border:none}.ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}.ac-input-file-comp .hidden-input{display:none}.ac-input-file-comp .custom-file-button{margin-left:-1px;height:21px;background-color:var(--secondary-color, #0aaa18);color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:14px;transition:background-color .3s ease;display:flex;align-items:center}.ac-input-file-comp .custom-file-button:hover{filter:saturate(85%);cursor:pointer}.ac-input-file-comp .custom-file-button mat-icon{font-size:16px;color:#fff;display:flex;align-items:center;justify-content:center}.ac-input-file-comp .file-name{padding-left:5px;color:var(--font-color, black);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ac-input-file-comp .unselect-icon{margin-left:auto;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:16px;color:var(--font-color, black)}.ac-input-file-comp .unselect-icon:hover{filter:saturate(85%)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
482
|
+
}
|
|
483
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcInputFile, decorators: [{
|
|
484
|
+
type: Component,
|
|
485
|
+
args: [{ selector: 'ac-input-file', imports: [FormsModule, CommonModule, MatIconModule], template: "<div class=\"ac-input-base ac-input-file\">\n <label class=\"ac-label\" *ngIf=\"buildTitleSpace || title\">{{title}}</label>\n <div class=\"ac-input-base-comp ac-input-file-comp\" [ngClass]=\"{ 'disabled': disabled }\">\n <input\n type=\"file\" \n (change)=\"onFileChange($event)\" \n [accept]=\"accept\"\n class=\"{{'hidden-input' + ' ' + fileInputId}}\"\n />\n <button type=\"button\" class=\"custom-file-button\" (click)=\"triggerFileInput()\">\n <mat-icon [fontIcon]=\"'attach_file'\"></mat-icon>\n </button>\n <span class=\"file-name\">{{ selectedFileName || 'Nenhum arquivo selecionado' }}</span>\n <mat-icon *ngIf=\"selectedFileName\" class=\"unselect-icon\" [fontIcon]=\"'close'\" (click)=\"removeFile()\"></mat-icon>\n </div>\n</div>", styles: [".ac-input-base{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin-top:2px;margin-bottom:2px}.ac-input-base .ac-input-base-comp.disabled{pointer-events:none;opacity:.9;background-color:color-mix(in srgb,var(--font-color, black) 8%,transparent)}.ac-input-base .ac-input-base-comp{position:relative;display:flex;align-items:center;width:100%;height:21px;transition:border-bottom-color .3s ease;border-radius:5px;border:1px solid rgb(191.25,191.25,191.25);box-sizing:border-box}.ac-input-base .ac-input-base-comp:focus-within{border-bottom:2px solid green}.ac-input-base .ac-input-base-comp>input{width:100%;padding:2px 5px;background:none;outline:none;position:relative;color:var(--font-color, black);font-size:14px;border:none}.ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}.ac-input-file-comp .hidden-input{display:none}.ac-input-file-comp .custom-file-button{margin-left:-1px;height:21px;background-color:var(--secondary-color, #0aaa18);color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:14px;transition:background-color .3s ease;display:flex;align-items:center}.ac-input-file-comp .custom-file-button:hover{filter:saturate(85%);cursor:pointer}.ac-input-file-comp .custom-file-button mat-icon{font-size:16px;color:#fff;display:flex;align-items:center;justify-content:center}.ac-input-file-comp .file-name{padding-left:5px;color:var(--font-color, black);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ac-input-file-comp .unselect-icon{margin-left:auto;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:16px;color:var(--font-color, black)}.ac-input-file-comp .unselect-icon:hover{filter:saturate(85%)}\n"] }]
|
|
486
|
+
}], ctorParameters: () => [], propDecorators: { model: [{
|
|
487
|
+
type: Input
|
|
488
|
+
}], disabled: [{
|
|
489
|
+
type: Input
|
|
490
|
+
}], title: [{
|
|
491
|
+
type: Input
|
|
492
|
+
}], buildTitleSpace: [{
|
|
493
|
+
type: Input
|
|
494
|
+
}], accept: [{
|
|
495
|
+
type: Input
|
|
496
|
+
}], index: [{
|
|
497
|
+
type: Input
|
|
498
|
+
}], onSelectFile: [{
|
|
499
|
+
type: Output
|
|
500
|
+
}], onUnselectFile: [{
|
|
501
|
+
type: Output
|
|
502
|
+
}] } });
|
|
503
|
+
|
|
504
|
+
class AcActionLink {
|
|
505
|
+
disabled = false;
|
|
506
|
+
title = '';
|
|
507
|
+
onClick = null;
|
|
508
|
+
constructor() { }
|
|
509
|
+
ngOnInit() { }
|
|
510
|
+
actionClick() {
|
|
511
|
+
if (this.onClick) {
|
|
512
|
+
this.onClick();
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcActionLink, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
516
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: AcActionLink, isStandalone: true, selector: "ac-action-link", inputs: { disabled: "disabled", title: "title", onClick: "onClick" }, ngImport: i0, template: "<div class=\"ac-action-link\">\n <a class=\"ac-action-link-a\" (click)=\"actionClick()\" [class.disabled]=\"disabled\"> {{title}} </a>\n</div>", styles: [".ac-action-link .ac-action-link-a{color:#1976d2;cursor:pointer;text-decoration:underline;font-weight:500;transition:color .2s}.ac-action-link .ac-action-link-a.disabled{pointer-events:none;opacity:.8;cursor:not-allowed}.ac-action-link .ac-action-link-a:hover{color:#0d47a1}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: CommonModule }] });
|
|
517
|
+
}
|
|
518
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcActionLink, decorators: [{
|
|
519
|
+
type: Component,
|
|
520
|
+
args: [{ selector: 'ac-action-link', imports: [FormsModule, CommonModule], template: "<div class=\"ac-action-link\">\n <a class=\"ac-action-link-a\" (click)=\"actionClick()\" [class.disabled]=\"disabled\"> {{title}} </a>\n</div>", styles: [".ac-action-link .ac-action-link-a{color:#1976d2;cursor:pointer;text-decoration:underline;font-weight:500;transition:color .2s}.ac-action-link .ac-action-link-a.disabled{pointer-events:none;opacity:.8;cursor:not-allowed}.ac-action-link .ac-action-link-a:hover{color:#0d47a1}\n"] }]
|
|
521
|
+
}], ctorParameters: () => [], propDecorators: { disabled: [{
|
|
522
|
+
type: Input
|
|
523
|
+
}], title: [{
|
|
524
|
+
type: Input
|
|
525
|
+
}], onClick: [{
|
|
526
|
+
type: Input
|
|
527
|
+
}] } });
|
|
528
|
+
|
|
529
|
+
class AcSelect {
|
|
530
|
+
elementRef;
|
|
531
|
+
model = '';
|
|
532
|
+
index = null;
|
|
533
|
+
disabled = false;
|
|
534
|
+
title = '';
|
|
535
|
+
buildTitleSpace = false;
|
|
536
|
+
debounce = 0;
|
|
537
|
+
placeholder = '';
|
|
538
|
+
labelName = 'label';
|
|
539
|
+
valueName = 'value';
|
|
540
|
+
options = [];
|
|
541
|
+
searchOptions = null;
|
|
542
|
+
onChangeModel = null;
|
|
543
|
+
modelChange = new EventEmitter();
|
|
544
|
+
inputSubject = new Subject();
|
|
545
|
+
filteredOptions = [];
|
|
546
|
+
searchText = '';
|
|
547
|
+
itemSelected = null;
|
|
548
|
+
showList = false;
|
|
549
|
+
fakeFocusPosition = 0;
|
|
550
|
+
constructor(elementRef) {
|
|
551
|
+
this.elementRef = elementRef;
|
|
552
|
+
}
|
|
553
|
+
ngOnInit() {
|
|
554
|
+
this.filteredOptions = [...this.options];
|
|
555
|
+
this.inputSubject.pipe(debounceTime(this.debounce)).subscribe((value) => {
|
|
556
|
+
this.filterOptions(value);
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
ngOnChanges(changes) {
|
|
560
|
+
if (changes['model'] && changes['model'].currentValue !== changes['model'].previousValue) {
|
|
561
|
+
this.updateItemSelected();
|
|
562
|
+
}
|
|
563
|
+
if (changes['options'] && changes['options'].currentValue !== changes['options'].previousValue) {
|
|
564
|
+
this.filteredOptions = [...this.options];
|
|
565
|
+
this.fakeFocusPosition = 0;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
onChangeInputSearch(value) {
|
|
569
|
+
this.inputSubject.next(value);
|
|
570
|
+
}
|
|
571
|
+
async filterOptions(value) {
|
|
572
|
+
const searchLower = (value || '').toLowerCase();
|
|
573
|
+
if (this.searchOptions) {
|
|
574
|
+
const options = await this.searchOptions(searchLower);
|
|
575
|
+
this.options = options;
|
|
576
|
+
this.filteredOptions = options;
|
|
577
|
+
}
|
|
578
|
+
else {
|
|
579
|
+
this.filteredOptions = this.options.filter(option => option[this.labelName].toLowerCase().includes(searchLower));
|
|
580
|
+
}
|
|
581
|
+
this.fakeFocusPosition = 0;
|
|
582
|
+
this.updateFocusState();
|
|
583
|
+
}
|
|
584
|
+
updateItemSelected() {
|
|
585
|
+
if (!this.searchOptions) {
|
|
586
|
+
const selectedItem = this.filteredOptions.find(option => option[this.valueName] === this.model);
|
|
587
|
+
this.itemSelected = selectedItem || null;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
getItemSelectedLabel() {
|
|
591
|
+
if (this.itemSelected) {
|
|
592
|
+
return this.itemSelected[this.labelName];
|
|
593
|
+
}
|
|
594
|
+
return '';
|
|
595
|
+
}
|
|
596
|
+
onFocus() {
|
|
597
|
+
if (this.disabled) {
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
600
|
+
this.showList = true;
|
|
601
|
+
this.fakeFocusPosition = 0;
|
|
602
|
+
if (this.searchOptions) {
|
|
603
|
+
this.filterOptions(this.searchText);
|
|
604
|
+
}
|
|
605
|
+
else {
|
|
606
|
+
this.filteredOptions = [...this.options];
|
|
607
|
+
}
|
|
608
|
+
setTimeout(() => {
|
|
609
|
+
const searchInput = this.elementRef.nativeElement.querySelector('.ac-select-list input');
|
|
610
|
+
if (searchInput) {
|
|
611
|
+
searchInput.focus();
|
|
612
|
+
}
|
|
613
|
+
}, 0);
|
|
614
|
+
}
|
|
615
|
+
onBlur() {
|
|
616
|
+
this.showList = false;
|
|
617
|
+
this.searchText = '';
|
|
618
|
+
if (this.searchOptions) {
|
|
619
|
+
this.filteredOptions = [];
|
|
620
|
+
this.options = [];
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
getListPreview() {
|
|
624
|
+
return this.filteredOptions.map((item) => item[this.labelName]);
|
|
625
|
+
}
|
|
626
|
+
selectItem(index) {
|
|
627
|
+
const item = this.filteredOptions[index];
|
|
628
|
+
this.onBlur();
|
|
629
|
+
this.itemSelected = item;
|
|
630
|
+
this.model = item[this.valueName];
|
|
631
|
+
this.modelChange.emit(this.model);
|
|
632
|
+
if (this.onChangeModel) {
|
|
633
|
+
this.onChangeModel(this.model, this.index);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
removeItem() {
|
|
637
|
+
this.model = '';
|
|
638
|
+
this.itemSelected = null;
|
|
639
|
+
this.modelChange.emit(null);
|
|
640
|
+
if (this.onChangeModel) {
|
|
641
|
+
this.onChangeModel(null, this.index);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
onFocusOut(event) {
|
|
645
|
+
const relatedTarget = event.relatedTarget;
|
|
646
|
+
if (!this.elementRef.nativeElement.contains(relatedTarget)) {
|
|
647
|
+
this.onBlur();
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
keydownList(event) {
|
|
651
|
+
if (event.key === 'Tab') {
|
|
652
|
+
this.onBlur();
|
|
653
|
+
if (event.shiftKey) {
|
|
654
|
+
const focusableElements = Array.from(document.querySelectorAll('ac-select, button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));
|
|
655
|
+
const currentElement = this.elementRef.nativeElement.querySelector(`.ac-select-model-label`);
|
|
656
|
+
const currentIndex = focusableElements.indexOf(currentElement);
|
|
657
|
+
focusableElements[currentIndex - 2].focus();
|
|
658
|
+
}
|
|
659
|
+
else {
|
|
660
|
+
const focusableElements = Array.from(document.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));
|
|
661
|
+
const currentElement = this.elementRef.nativeElement.querySelector(`#item-${this.filteredOptions.length - 1}`)
|
|
662
|
+
|| this.elementRef.nativeElement.querySelector(`#input-search`);
|
|
663
|
+
const currentIndex = focusableElements.indexOf(currentElement);
|
|
664
|
+
if (currentIndex >= 0 && currentIndex < focusableElements.length - 1) {
|
|
665
|
+
focusableElements[currentIndex + 1].focus();
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
event.preventDefault();
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
else if (event.key === 'ArrowDown') {
|
|
672
|
+
this.fakeFocusPosition = Math.min(this.fakeFocusPosition + 1, this.filteredOptions.length - 1);
|
|
673
|
+
}
|
|
674
|
+
else if (event.key === 'ArrowUp') {
|
|
675
|
+
this.fakeFocusPosition = Math.max(this.fakeFocusPosition - 1, 0);
|
|
676
|
+
}
|
|
677
|
+
else if (event.key === 'Enter') {
|
|
678
|
+
this.selectItem(this.fakeFocusPosition);
|
|
679
|
+
}
|
|
680
|
+
this.updateFocusState();
|
|
681
|
+
}
|
|
682
|
+
updateFocusState() {
|
|
683
|
+
const items = this.elementRef.nativeElement.querySelectorAll('.ac-select-list-item');
|
|
684
|
+
items.forEach((item, idx) => {
|
|
685
|
+
if (idx === this.fakeFocusPosition) {
|
|
686
|
+
item.classList.add('focused');
|
|
687
|
+
}
|
|
688
|
+
else {
|
|
689
|
+
item.classList.remove('focused');
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
hasFocus(valueIdxFromList) {
|
|
694
|
+
return this.fakeFocusPosition === valueIdxFromList;
|
|
695
|
+
}
|
|
696
|
+
haveModel() {
|
|
697
|
+
return this.model !== undefined && this.model !== null;
|
|
698
|
+
}
|
|
699
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcSelect, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
700
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: AcSelect, isStandalone: true, selector: "ac-select", inputs: { model: "model", index: "index", disabled: "disabled", title: "title", buildTitleSpace: "buildTitleSpace", debounce: "debounce", placeholder: "placeholder", labelName: "labelName", valueName: "valueName", options: "options", searchOptions: "searchOptions", onChangeModel: "onChangeModel" }, outputs: { modelChange: "modelChange" }, host: { listeners: { "focusout": "onFocusOut($event)" } }, usesOnChanges: true, ngImport: i0, template: "<div class=\"ac-select\">\n <label class=\"ac-label\" *ngIf=\"buildTitleSpace || title\" (click)=\"onBlur()\">{{title}}</label>\n <div class=\"ac-select-comp\" [ngClass]=\"{ 'disabled': disabled }\">\n <div class=\"ac-select-input\">\n <div\n class=\"ac-select-model-label\"\n (focus)=\"onFocus()\"\n [attr.tabindex]=\"disabled ? -1 : 0\">\n <label *ngIf=\"!haveModel()\" [attr.title]=\"placeholder || 'Selecione uma op\u00E7\u00E3o'\" class=\"placeholder\">{{ placeholder || 'Selecione uma op\u00E7\u00E3o' }}</label>\n <label *ngIf=\"haveModel()\" [attr.title]=\"getItemSelectedLabel()\">{{getItemSelectedLabel()}}</label>\n </div>\n\n <mat-icon *ngIf=\"haveModel()\" fontIcon=\"close\" class=\"show-hide error-color\" (click)=\"removeItem()\">\n close\n </mat-icon>\n </div>\n\n <div tabindex=\"-1\" *ngIf=\"showList\" class=\"ac-select-list\">\n <input \n id=\"input-search\" \n type=\"text\" \n [(ngModel)]=\"searchText\" \n (ngModelChange)=\"onChangeInputSearch($event)\" \n (keydown)=\"keydownList($event)\"> \n <mat-divider></mat-divider>\n <div \n *ngFor=\"let listItem of getListPreview(); let idx = index\"\n id=\"item-{{idx}}\"\n class=\"ac-select-list-item\"\n [ngClass]=\"{focused: hasFocus(idx)}\"\n (keydown)=\"keydownList($event)\"\n (click)=\"selectItem(idx)\"\n [attr.tabindex]=\"0\">\n <div>\n <label>{{listItem}}</label>\n </div>\n </div>\n </div>\n </div>\n</div>\n", styles: [".ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}.ac-select{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin-top:2px;margin-bottom:2px}.ac-select .ac-select-comp.disabled{pointer-events:none;opacity:.9;background-color:color-mix(in srgb,var(--font-color, black) 8%,transparent)}.ac-select .ac-select-comp{position:relative;display:flex;align-items:center;width:100%;height:21px;transition:border-bottom-color .3s ease;border-radius:5px;border:1px solid rgb(191.25,191.25,191.25);box-sizing:border-box}.ac-select .ac-select-comp:focus-within{border-bottom:2px solid green}.ac-select .ac-select-comp .ac-select-input{width:100%;height:100%;display:flex;align-items:center;justify-content:space-between;position:relative;color:var(--font-color, black);cursor:pointer;border:none}.ac-select .ac-select-comp .ac-select-input .ac-select-model-label{line-height:normal;font-weight:400;color:var(--font-color, black);cursor:pointer;border:none;display:flex;align-items:center;width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:14px;padding-left:5px;box-sizing:border-box}.ac-select .ac-select-comp .ac-select-input .ac-select-model-label:focus{outline:none}.ac-select .ac-select-comp .ac-select-input .ac-select-model-label .placeholder{font-size:14px;font-weight:400;font-family:Arial,sans-serif;color:var(--placeholder-color, #303030)}.ac-select .ac-select-comp .ac-select-list{position:absolute;top:100%;left:0;width:100%;background-color:var(--background-color, #fafafa);border:1px solid rgb(191.25,191.25,191.25);border-radius:5px;box-shadow:0 4px 6px #0000001a;z-index:10}.ac-select .ac-select-comp .ac-select-list .ac-select-list-item{border:none;outline:none;padding:2px;min-height:20px;color:var(--font-color, black)}.ac-select .ac-select-comp .ac-select-list .ac-select-list-item.focused,.ac-select .ac-select-comp .ac-select-list .ac-select-list-item:focus,.ac-select .ac-select-comp .ac-select-list .ac-select-list-item:hover{background:#0000001a}.ac-select .ac-select-comp .ac-select-list>input{width:calc(100% - 10px);padding:2px 5px;outline:none;position:relative;color:var(--font-color, black);background-color:var(--background-color, #fafafa);font-size:14px;border:none}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatDividerModule }, { kind: "component", type: i4.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }] });
|
|
701
|
+
}
|
|
702
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcSelect, decorators: [{
|
|
703
|
+
type: Component,
|
|
704
|
+
args: [{ selector: 'ac-select', imports: [FormsModule, CommonModule, MatIconModule, MatDividerModule], template: "<div class=\"ac-select\">\n <label class=\"ac-label\" *ngIf=\"buildTitleSpace || title\" (click)=\"onBlur()\">{{title}}</label>\n <div class=\"ac-select-comp\" [ngClass]=\"{ 'disabled': disabled }\">\n <div class=\"ac-select-input\">\n <div\n class=\"ac-select-model-label\"\n (focus)=\"onFocus()\"\n [attr.tabindex]=\"disabled ? -1 : 0\">\n <label *ngIf=\"!haveModel()\" [attr.title]=\"placeholder || 'Selecione uma op\u00E7\u00E3o'\" class=\"placeholder\">{{ placeholder || 'Selecione uma op\u00E7\u00E3o' }}</label>\n <label *ngIf=\"haveModel()\" [attr.title]=\"getItemSelectedLabel()\">{{getItemSelectedLabel()}}</label>\n </div>\n\n <mat-icon *ngIf=\"haveModel()\" fontIcon=\"close\" class=\"show-hide error-color\" (click)=\"removeItem()\">\n close\n </mat-icon>\n </div>\n\n <div tabindex=\"-1\" *ngIf=\"showList\" class=\"ac-select-list\">\n <input \n id=\"input-search\" \n type=\"text\" \n [(ngModel)]=\"searchText\" \n (ngModelChange)=\"onChangeInputSearch($event)\" \n (keydown)=\"keydownList($event)\"> \n <mat-divider></mat-divider>\n <div \n *ngFor=\"let listItem of getListPreview(); let idx = index\"\n id=\"item-{{idx}}\"\n class=\"ac-select-list-item\"\n [ngClass]=\"{focused: hasFocus(idx)}\"\n (keydown)=\"keydownList($event)\"\n (click)=\"selectItem(idx)\"\n [attr.tabindex]=\"0\">\n <div>\n <label>{{listItem}}</label>\n </div>\n </div>\n </div>\n </div>\n</div>\n", styles: [".ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}.ac-select{display:flex;flex-direction:column;align-items:flex-start;width:100%;margin-top:2px;margin-bottom:2px}.ac-select .ac-select-comp.disabled{pointer-events:none;opacity:.9;background-color:color-mix(in srgb,var(--font-color, black) 8%,transparent)}.ac-select .ac-select-comp{position:relative;display:flex;align-items:center;width:100%;height:21px;transition:border-bottom-color .3s ease;border-radius:5px;border:1px solid rgb(191.25,191.25,191.25);box-sizing:border-box}.ac-select .ac-select-comp:focus-within{border-bottom:2px solid green}.ac-select .ac-select-comp .ac-select-input{width:100%;height:100%;display:flex;align-items:center;justify-content:space-between;position:relative;color:var(--font-color, black);cursor:pointer;border:none}.ac-select .ac-select-comp .ac-select-input .ac-select-model-label{line-height:normal;font-weight:400;color:var(--font-color, black);cursor:pointer;border:none;display:flex;align-items:center;width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:14px;padding-left:5px;box-sizing:border-box}.ac-select .ac-select-comp .ac-select-input .ac-select-model-label:focus{outline:none}.ac-select .ac-select-comp .ac-select-input .ac-select-model-label .placeholder{font-size:14px;font-weight:400;font-family:Arial,sans-serif;color:var(--placeholder-color, #303030)}.ac-select .ac-select-comp .ac-select-list{position:absolute;top:100%;left:0;width:100%;background-color:var(--background-color, #fafafa);border:1px solid rgb(191.25,191.25,191.25);border-radius:5px;box-shadow:0 4px 6px #0000001a;z-index:10}.ac-select .ac-select-comp .ac-select-list .ac-select-list-item{border:none;outline:none;padding:2px;min-height:20px;color:var(--font-color, black)}.ac-select .ac-select-comp .ac-select-list .ac-select-list-item.focused,.ac-select .ac-select-comp .ac-select-list .ac-select-list-item:focus,.ac-select .ac-select-comp .ac-select-list .ac-select-list-item:hover{background:#0000001a}.ac-select .ac-select-comp .ac-select-list>input{width:calc(100% - 10px);padding:2px 5px;outline:none;position:relative;color:var(--font-color, black);background-color:var(--background-color, #fafafa);font-size:14px;border:none}\n"] }]
|
|
705
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { model: [{
|
|
706
|
+
type: Input
|
|
707
|
+
}], index: [{
|
|
708
|
+
type: Input
|
|
709
|
+
}], disabled: [{
|
|
710
|
+
type: Input
|
|
711
|
+
}], title: [{
|
|
712
|
+
type: Input
|
|
713
|
+
}], buildTitleSpace: [{
|
|
714
|
+
type: Input
|
|
715
|
+
}], debounce: [{
|
|
716
|
+
type: Input
|
|
717
|
+
}], placeholder: [{
|
|
718
|
+
type: Input
|
|
719
|
+
}], labelName: [{
|
|
720
|
+
type: Input
|
|
721
|
+
}], valueName: [{
|
|
722
|
+
type: Input
|
|
723
|
+
}], options: [{
|
|
724
|
+
type: Input
|
|
725
|
+
}], searchOptions: [{
|
|
726
|
+
type: Input
|
|
727
|
+
}], onChangeModel: [{
|
|
728
|
+
type: Input
|
|
729
|
+
}], modelChange: [{
|
|
730
|
+
type: Output
|
|
731
|
+
}], onFocusOut: [{
|
|
732
|
+
type: HostListener,
|
|
733
|
+
args: ['focusout', ['$event']]
|
|
734
|
+
}] } });
|
|
735
|
+
|
|
736
|
+
class AcPagination {
|
|
737
|
+
totalItems = 0;
|
|
738
|
+
itemsPerPage = 10;
|
|
739
|
+
currentPage = 1;
|
|
740
|
+
pageChange = new EventEmitter();
|
|
741
|
+
totalPages = 0;
|
|
742
|
+
pages = [];
|
|
743
|
+
constructor() { }
|
|
744
|
+
ngOnInit() { }
|
|
745
|
+
ngOnChanges() {
|
|
746
|
+
this.calculatePages();
|
|
747
|
+
}
|
|
748
|
+
calculatePages() {
|
|
749
|
+
this.totalPages = Math.ceil(this.totalItems / this.itemsPerPage);
|
|
750
|
+
const maxVisiblePages = 5;
|
|
751
|
+
let startPage;
|
|
752
|
+
let endPage;
|
|
753
|
+
if (this.totalPages <= maxVisiblePages) {
|
|
754
|
+
startPage = 1;
|
|
755
|
+
endPage = this.totalPages;
|
|
756
|
+
}
|
|
757
|
+
else if (this.currentPage + 1 <= Math.ceil(maxVisiblePages / 2)) {
|
|
758
|
+
startPage = 1;
|
|
759
|
+
endPage = maxVisiblePages;
|
|
760
|
+
}
|
|
761
|
+
else if (this.currentPage + Math.floor(maxVisiblePages / 2) >= this.totalPages) {
|
|
762
|
+
startPage = this.totalPages - maxVisiblePages + 1;
|
|
763
|
+
endPage = this.totalPages;
|
|
764
|
+
}
|
|
765
|
+
else {
|
|
766
|
+
startPage = this.currentPage + 1 - Math.floor(maxVisiblePages / 2);
|
|
767
|
+
endPage = startPage + maxVisiblePages - 1;
|
|
768
|
+
}
|
|
769
|
+
this.pages = Array.from({ length: endPage - startPage + 1 }, (_, i) => startPage + i);
|
|
770
|
+
if (this.pages.length == 0) {
|
|
771
|
+
this.pages = [1];
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
goToPage(page) {
|
|
775
|
+
if (page >= 1 && page <= this.totalPages) {
|
|
776
|
+
this.currentPage = page - 1;
|
|
777
|
+
this.pageChange.emit(this.currentPage);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcPagination, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
781
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: AcPagination, isStandalone: true, selector: "ac-pagination", inputs: { totalItems: "totalItems", itemsPerPage: "itemsPerPage", currentPage: "currentPage" }, outputs: { pageChange: "pageChange" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"ac-pagination\">\n <ac-button\n class=\"page-button-back-after\"\n [title]=\"'Anterior'\"\n [colorType]=\"'white'\"\n [disabled]=\"currentPage === 0\"\n (click)=\"goToPage(currentPage)\">\n </ac-button>\n\n <ac-button\n class=\"page-button\"\n [title]=\"'1'\"\n [colorType]=\"'white'\"\n [disabled]=\"currentPage === 0\"\n (click)=\"goToPage(1)\"\n *ngIf=\"currentPage !== 0 && !pages.includes(1)\">\n </ac-button>\n\n <ac-button\n class=\"page-button\"\n [title]=\"'...'\"\n [colorType]=\"'white'\"\n [disabled]=\"true\"\n *ngIf=\"currentPage !== 0 && !pages.includes(1)\">\n </ac-button>\n\n <ac-button\n *ngFor=\"let page of pages\"\n class=\"page-button\"\n [title]=\"page\"\n [colorType]=\"(page === currentPage + 1) ? 'secondary' : 'white'\"\n [class.active]=\"page === currentPage + 1\"\n (click)=\"goToPage(page)\">\n </ac-button>\n\n <ac-button\n class=\"page-button\"\n [title]=\"'...'\"\n [colorType]=\"'white'\"\n [disabled]=\"true\"\n *ngIf=\"currentPage + 1 !== totalPages && !pages.includes(totalPages) && totalPages !== 0\">\n </ac-button>\n\n <ac-button\n class=\"page-button\"\n [title]=\"totalPages\"\n [colorType]=\"'white'\"\n [disabled]=\"currentPage + 1 === totalPages\"\n (click)=\"goToPage(totalPages)\"\n *ngIf=\"currentPage + 1 !== totalPages && !pages.includes(totalPages) && totalPages !== 0\">\n </ac-button>\n\n <ac-button\n class=\"page-button-back-after\"\n [title]=\"'Pr\u00F3ximo'\"\n [colorType]=\"'white'\"\n [disabled]=\"totalPages === 0 || (currentPage + 1 === totalPages)\"\n (click)=\"goToPage(currentPage + 2)\">\n </ac-button>\n</div>", styles: [".ac-pagination{display:flex;justify-content:center;align-items:center;gap:5px;margin-top:20px}.ac-pagination .page-button-back-after{width:80px;height:24px}.ac-pagination .page-button{width:auto;height:24px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: AcButton, selector: "ac-button", inputs: ["disabled", "title", "colorType", "leftIcon", "rightIcon", "onClick"] }] });
|
|
782
|
+
}
|
|
783
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcPagination, decorators: [{
|
|
784
|
+
type: Component,
|
|
785
|
+
args: [{ selector: 'ac-pagination', imports: [CommonModule, MatIconModule, AcButton], template: "<div class=\"ac-pagination\">\n <ac-button\n class=\"page-button-back-after\"\n [title]=\"'Anterior'\"\n [colorType]=\"'white'\"\n [disabled]=\"currentPage === 0\"\n (click)=\"goToPage(currentPage)\">\n </ac-button>\n\n <ac-button\n class=\"page-button\"\n [title]=\"'1'\"\n [colorType]=\"'white'\"\n [disabled]=\"currentPage === 0\"\n (click)=\"goToPage(1)\"\n *ngIf=\"currentPage !== 0 && !pages.includes(1)\">\n </ac-button>\n\n <ac-button\n class=\"page-button\"\n [title]=\"'...'\"\n [colorType]=\"'white'\"\n [disabled]=\"true\"\n *ngIf=\"currentPage !== 0 && !pages.includes(1)\">\n </ac-button>\n\n <ac-button\n *ngFor=\"let page of pages\"\n class=\"page-button\"\n [title]=\"page\"\n [colorType]=\"(page === currentPage + 1) ? 'secondary' : 'white'\"\n [class.active]=\"page === currentPage + 1\"\n (click)=\"goToPage(page)\">\n </ac-button>\n\n <ac-button\n class=\"page-button\"\n [title]=\"'...'\"\n [colorType]=\"'white'\"\n [disabled]=\"true\"\n *ngIf=\"currentPage + 1 !== totalPages && !pages.includes(totalPages) && totalPages !== 0\">\n </ac-button>\n\n <ac-button\n class=\"page-button\"\n [title]=\"totalPages\"\n [colorType]=\"'white'\"\n [disabled]=\"currentPage + 1 === totalPages\"\n (click)=\"goToPage(totalPages)\"\n *ngIf=\"currentPage + 1 !== totalPages && !pages.includes(totalPages) && totalPages !== 0\">\n </ac-button>\n\n <ac-button\n class=\"page-button-back-after\"\n [title]=\"'Pr\u00F3ximo'\"\n [colorType]=\"'white'\"\n [disabled]=\"totalPages === 0 || (currentPage + 1 === totalPages)\"\n (click)=\"goToPage(currentPage + 2)\">\n </ac-button>\n</div>", styles: [".ac-pagination{display:flex;justify-content:center;align-items:center;gap:5px;margin-top:20px}.ac-pagination .page-button-back-after{width:80px;height:24px}.ac-pagination .page-button{width:auto;height:24px}\n"] }]
|
|
786
|
+
}], ctorParameters: () => [], propDecorators: { totalItems: [{
|
|
787
|
+
type: Input
|
|
788
|
+
}], itemsPerPage: [{
|
|
789
|
+
type: Input
|
|
790
|
+
}], currentPage: [{
|
|
791
|
+
type: Input
|
|
792
|
+
}], pageChange: [{
|
|
793
|
+
type: Output
|
|
794
|
+
}] } });
|
|
795
|
+
|
|
796
|
+
class AcProgressBar {
|
|
797
|
+
color = 'white';
|
|
798
|
+
timer = 0;
|
|
799
|
+
transparentColor = 'white';
|
|
800
|
+
startTime = Date.now();
|
|
801
|
+
percent = 100;
|
|
802
|
+
ngOnInit() {
|
|
803
|
+
if (this.color.startsWith('rgba')) {
|
|
804
|
+
this.color = this.color.replace(/rgba\((\d+), (\d+), (\d+), [0-9.]+\)/, 'rgba($1, $2, $3, 1)');
|
|
805
|
+
}
|
|
806
|
+
this.transparentColor = this.getTransparentColor();
|
|
807
|
+
this.updateProgress();
|
|
808
|
+
}
|
|
809
|
+
getPercentage() {
|
|
810
|
+
return Math.min(100, Math.max(0, this.percent)).toFixed(0);
|
|
811
|
+
}
|
|
812
|
+
updateProgress() {
|
|
813
|
+
if (this.timer <= 0) {
|
|
814
|
+
console.warn('Timer must be greater than zero to update progress.');
|
|
815
|
+
return;
|
|
816
|
+
}
|
|
817
|
+
const now = Date.now();
|
|
818
|
+
const diff = now - this.startTime;
|
|
819
|
+
const percent = (diff / this.timer * 100);
|
|
820
|
+
this.percent = 100 - percent;
|
|
821
|
+
if (percent >= 100) {
|
|
822
|
+
this.percent = 0;
|
|
823
|
+
}
|
|
824
|
+
if (this.percent > 0) {
|
|
825
|
+
setTimeout(() => {
|
|
826
|
+
this.updateProgress();
|
|
827
|
+
}, 50);
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
getTransparentColor() {
|
|
831
|
+
if (this.color.startsWith('rgb(')) {
|
|
832
|
+
return this.color.replace('rgb', 'rgba').replace(')', ', 0.5)');
|
|
833
|
+
}
|
|
834
|
+
else if (this.color.startsWith('rgba(')) {
|
|
835
|
+
return this.color.replace(/rgba\((\d+), (\d+), (\d+), [0-9.]+\)/, 'rgba($1, $2, $3, 0.5)');
|
|
836
|
+
}
|
|
837
|
+
else if (/^[a-z]+$/i.test(this.color)) {
|
|
838
|
+
const tempElement = document.createElement('div');
|
|
839
|
+
tempElement.style.color = this.color;
|
|
840
|
+
document.body.appendChild(tempElement);
|
|
841
|
+
const rgb = window.getComputedStyle(tempElement).color;
|
|
842
|
+
document.body.removeChild(tempElement);
|
|
843
|
+
return rgb.replace('rgb', 'rgba').replace(')', ', 0.5)');
|
|
844
|
+
}
|
|
845
|
+
else if (this.color.startsWith('#')) {
|
|
846
|
+
const hex = this.color.replace('#', '');
|
|
847
|
+
const r = parseInt(hex.substring(0, 2), 16);
|
|
848
|
+
const g = parseInt(hex.substring(2, 4), 16);
|
|
849
|
+
const b = parseInt(hex.substring(4, 6), 16);
|
|
850
|
+
return `rgba(${r}, ${g}, ${b}, 0.5)`;
|
|
851
|
+
}
|
|
852
|
+
else {
|
|
853
|
+
return 'rgba(72, 255, 0, 0.5)';
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcProgressBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
857
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: AcProgressBar, isStandalone: true, selector: "ac-progress-bar", inputs: { color: "color", timer: "timer" }, ngImport: i0, template: "<div class=\"ac-progress-bar\" [ngStyle]=\"{'background-color': transparentColor}\">\n <div class=\"ac-progress-bar-progress\" [ngStyle]=\"{'width': getPercentage() + '%', 'background-color': color}\">\n </div>\n</div>", styles: [".ac-progress-bar{min-height:4px;border-radius:5px;position:relative}.ac-progress-bar .ac-progress-bar-progress{height:100%;border-radius:5px;position:absolute;top:0;left:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
858
|
+
}
|
|
859
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcProgressBar, decorators: [{
|
|
860
|
+
type: Component,
|
|
861
|
+
args: [{ selector: 'ac-progress-bar', imports: [CommonModule], template: "<div class=\"ac-progress-bar\" [ngStyle]=\"{'background-color': transparentColor}\">\n <div class=\"ac-progress-bar-progress\" [ngStyle]=\"{'width': getPercentage() + '%', 'background-color': color}\">\n </div>\n</div>", styles: [".ac-progress-bar{min-height:4px;border-radius:5px;position:relative}.ac-progress-bar .ac-progress-bar-progress{height:100%;border-radius:5px;position:absolute;top:0;left:0}\n"] }]
|
|
862
|
+
}], propDecorators: { color: [{
|
|
863
|
+
type: Input
|
|
864
|
+
}], timer: [{
|
|
865
|
+
type: Input
|
|
866
|
+
}] } });
|
|
867
|
+
|
|
868
|
+
class AcNotification {
|
|
869
|
+
static defaultTimer = 10000;
|
|
870
|
+
static notifications = new BehaviorSubject({
|
|
871
|
+
topCenter: [],
|
|
872
|
+
topLeft: [],
|
|
873
|
+
topRight: [],
|
|
874
|
+
bottomCenter: [],
|
|
875
|
+
bottomLeft: [],
|
|
876
|
+
bottomRight: [],
|
|
877
|
+
});
|
|
878
|
+
getNotifications(key) {
|
|
879
|
+
return AcNotification.notifications.pipe(map((notifications) => notifications[key] || []));
|
|
880
|
+
}
|
|
881
|
+
ngOnInit() { }
|
|
882
|
+
static notify(notification, vertical, horizontal) {
|
|
883
|
+
notification.id = notification.id || crypto.randomUUID();
|
|
884
|
+
notification.timer = notification.timer || this.defaultTimer;
|
|
885
|
+
notification.show = true;
|
|
886
|
+
const key = `${vertical}${this.strCapitalize(horizontal)}`;
|
|
887
|
+
const notifications = { ...this.notifications.value };
|
|
888
|
+
notifications[key].push(notification);
|
|
889
|
+
this.notifications.next(notifications);
|
|
890
|
+
this.scheduleHideNotification(notification, key);
|
|
891
|
+
}
|
|
892
|
+
static scheduleHideNotification(notification, key) {
|
|
893
|
+
setTimeout(() => {
|
|
894
|
+
notification.show = false;
|
|
895
|
+
setTimeout(() => {
|
|
896
|
+
const notifications = { ...this.notifications.value };
|
|
897
|
+
notifications[key] = notifications[key].filter((n) => n.id !== notification.id);
|
|
898
|
+
this.notifications.next(notifications);
|
|
899
|
+
}, 300);
|
|
900
|
+
}, notification.timer);
|
|
901
|
+
}
|
|
902
|
+
static strCapitalize(value) {
|
|
903
|
+
if (!value)
|
|
904
|
+
return '';
|
|
905
|
+
return value.charAt(0).toUpperCase() + value.slice(1);
|
|
906
|
+
}
|
|
907
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcNotification, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
908
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: AcNotification, isStandalone: true, selector: "ac-notification", ngImport: i0, template: "<div class=\"ac-notification\">\n <div class=\"ac-notification-top-center\">\n <div *ngFor=\"let item of getNotifications('topCenter') | async\" \n class=\"ac-notification-notification {{item.type}} top\"\n [ngClass]=\"{'hide': !item.show}\">\n {{item.message}}\n <ac-progress-bar [timer]=\"item.timer!\"></ac-progress-bar>\n </div>\n </div>\n <div class=\"ac-notification-top-left\">\n <div *ngFor=\"let item of getNotifications('topLeft') | async\" \n class=\"ac-notification-notification {{item.type}} top\"\n [ngClass]=\"{'hide': !item.show}\">\n {{item.message}}\n <ac-progress-bar [timer]=\"item.timer!\"></ac-progress-bar>\n </div>\n </div>\n <div class=\"ac-notification-top-right\">\n <div *ngFor=\"let item of getNotifications('topRight') | async\" \n class=\"ac-notification-notification {{item.type}} top\"\n [ngClass]=\"{'hide': !item.show}\">\n {{item.message}}\n <ac-progress-bar [timer]=\"item.timer!\"></ac-progress-bar>\n </div>\n </div>\n <div class=\"ac-notification-bottom-center\">\n <div *ngFor=\"let item of getNotifications('bottomCenter') | async\" \n class=\"ac-notification-notification {{item.type}} bottom\"\n [ngClass]=\"{'hide': !item.show}\">\n {{item.message}}\n <ac-progress-bar [timer]=\"item.timer!\"></ac-progress-bar>\n </div>\n </div>\n <div class=\"ac-notification-bottom-left\">\n <div *ngFor=\"let item of getNotifications('bottomLeft') | async\" \n class=\"ac-notification-notification {{item.type}} bottom\"\n [ngClass]=\"{'hide': !item.show}\">\n {{item.message}}\n <ac-progress-bar [timer]=\"item.timer!\"></ac-progress-bar>\n </div>\n </div>\n <div class=\"ac-notification-bottom-right\">\n <div *ngFor=\"let item of getNotifications('bottomRight') | async\" \n class=\"ac-notification-notification {{item.type}} bottom\"\n [ngClass]=\"{'hide': !item.show}\">\n {{item.message}}\n <ac-progress-bar [timer]=\"item.timer!\"></ac-progress-bar>\n </div>\n </div>\n</div>", styles: [".ac-notification{pointer-events:none;position:fixed;height:calc(100% - 50px);width:calc(100% - 40px);margin-left:20px;margin-right:20px;display:flex;z-index:99}.ac-notification .ac-notification-top-center{position:absolute;top:0;left:50%;transform:translate(-50%);width:100%;display:flex;flex-direction:column;align-items:center}.ac-notification .ac-notification-top-left{position:absolute;top:0;left:0;width:100%;display:flex;flex-direction:column;align-items:flex-start}.ac-notification .ac-notification-top-right{position:absolute;top:0;right:0;width:100%;display:flex;flex-direction:column;align-items:flex-end}.ac-notification .ac-notification-bottom-center{position:absolute;bottom:0;left:50%;transform:translate(-50%);width:100%;display:flex;flex-direction:column;align-items:center}.ac-notification .ac-notification-bottom-left{position:absolute;bottom:0;left:0;width:100%;display:flex;flex-direction:column;align-items:flex-start}.ac-notification .ac-notification-bottom-right{position:absolute;bottom:0;right:0;width:100%;display:flex;flex-direction:column;align-items:flex-end}.ac-notification .ac-notification-notification{pointer-events:all;background:#007bffd9;color:#fff;margin-top:10px;padding:7px 10px;border-radius:8px;box-shadow:0 4px 8px #0003;font-size:14px;font-weight:400;transition:transform .3s ease,opacity .3s ease}.ac-notification .ac-notification-notification.top{transform:translateY(0);opacity:1}.ac-notification .ac-notification-notification.top.hide{transform:translateY(-20px);opacity:0}.ac-notification .ac-notification-notification.bottom{transform:translateY(-20px);opacity:1}.ac-notification .ac-notification-notification.bottom.hide{transform:translateY(0);opacity:0}.ac-notification .ac-notification-notification.error{background:#ff0000d9}.ac-notification .ac-notification-notification.success{background:#009600d9}.ac-notification .ac-notification-notification.warning{background:#ff8c00d9}.ac-notification .ac-notification-notification.info{background:#007bffd9}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "component", type: AcProgressBar, selector: "ac-progress-bar", inputs: ["color", "timer"] }] });
|
|
909
|
+
}
|
|
910
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcNotification, decorators: [{
|
|
911
|
+
type: Component,
|
|
912
|
+
args: [{ selector: 'ac-notification', imports: [CommonModule, AcProgressBar], template: "<div class=\"ac-notification\">\n <div class=\"ac-notification-top-center\">\n <div *ngFor=\"let item of getNotifications('topCenter') | async\" \n class=\"ac-notification-notification {{item.type}} top\"\n [ngClass]=\"{'hide': !item.show}\">\n {{item.message}}\n <ac-progress-bar [timer]=\"item.timer!\"></ac-progress-bar>\n </div>\n </div>\n <div class=\"ac-notification-top-left\">\n <div *ngFor=\"let item of getNotifications('topLeft') | async\" \n class=\"ac-notification-notification {{item.type}} top\"\n [ngClass]=\"{'hide': !item.show}\">\n {{item.message}}\n <ac-progress-bar [timer]=\"item.timer!\"></ac-progress-bar>\n </div>\n </div>\n <div class=\"ac-notification-top-right\">\n <div *ngFor=\"let item of getNotifications('topRight') | async\" \n class=\"ac-notification-notification {{item.type}} top\"\n [ngClass]=\"{'hide': !item.show}\">\n {{item.message}}\n <ac-progress-bar [timer]=\"item.timer!\"></ac-progress-bar>\n </div>\n </div>\n <div class=\"ac-notification-bottom-center\">\n <div *ngFor=\"let item of getNotifications('bottomCenter') | async\" \n class=\"ac-notification-notification {{item.type}} bottom\"\n [ngClass]=\"{'hide': !item.show}\">\n {{item.message}}\n <ac-progress-bar [timer]=\"item.timer!\"></ac-progress-bar>\n </div>\n </div>\n <div class=\"ac-notification-bottom-left\">\n <div *ngFor=\"let item of getNotifications('bottomLeft') | async\" \n class=\"ac-notification-notification {{item.type}} bottom\"\n [ngClass]=\"{'hide': !item.show}\">\n {{item.message}}\n <ac-progress-bar [timer]=\"item.timer!\"></ac-progress-bar>\n </div>\n </div>\n <div class=\"ac-notification-bottom-right\">\n <div *ngFor=\"let item of getNotifications('bottomRight') | async\" \n class=\"ac-notification-notification {{item.type}} bottom\"\n [ngClass]=\"{'hide': !item.show}\">\n {{item.message}}\n <ac-progress-bar [timer]=\"item.timer!\"></ac-progress-bar>\n </div>\n </div>\n</div>", styles: [".ac-notification{pointer-events:none;position:fixed;height:calc(100% - 50px);width:calc(100% - 40px);margin-left:20px;margin-right:20px;display:flex;z-index:99}.ac-notification .ac-notification-top-center{position:absolute;top:0;left:50%;transform:translate(-50%);width:100%;display:flex;flex-direction:column;align-items:center}.ac-notification .ac-notification-top-left{position:absolute;top:0;left:0;width:100%;display:flex;flex-direction:column;align-items:flex-start}.ac-notification .ac-notification-top-right{position:absolute;top:0;right:0;width:100%;display:flex;flex-direction:column;align-items:flex-end}.ac-notification .ac-notification-bottom-center{position:absolute;bottom:0;left:50%;transform:translate(-50%);width:100%;display:flex;flex-direction:column;align-items:center}.ac-notification .ac-notification-bottom-left{position:absolute;bottom:0;left:0;width:100%;display:flex;flex-direction:column;align-items:flex-start}.ac-notification .ac-notification-bottom-right{position:absolute;bottom:0;right:0;width:100%;display:flex;flex-direction:column;align-items:flex-end}.ac-notification .ac-notification-notification{pointer-events:all;background:#007bffd9;color:#fff;margin-top:10px;padding:7px 10px;border-radius:8px;box-shadow:0 4px 8px #0003;font-size:14px;font-weight:400;transition:transform .3s ease,opacity .3s ease}.ac-notification .ac-notification-notification.top{transform:translateY(0);opacity:1}.ac-notification .ac-notification-notification.top.hide{transform:translateY(-20px);opacity:0}.ac-notification .ac-notification-notification.bottom{transform:translateY(-20px);opacity:1}.ac-notification .ac-notification-notification.bottom.hide{transform:translateY(0);opacity:0}.ac-notification .ac-notification-notification.error{background:#ff0000d9}.ac-notification .ac-notification-notification.success{background:#009600d9}.ac-notification .ac-notification-notification.warning{background:#ff8c00d9}.ac-notification .ac-notification-notification.info{background:#007bffd9}\n"] }]
|
|
913
|
+
}] });
|
|
914
|
+
|
|
915
|
+
class AcCheckBox {
|
|
916
|
+
model = false;
|
|
917
|
+
disabled = false;
|
|
918
|
+
title = '';
|
|
919
|
+
buildTitleSpace = false;
|
|
920
|
+
titleColor = 'white';
|
|
921
|
+
onToggle = null;
|
|
922
|
+
modelChange = new EventEmitter();
|
|
923
|
+
constructor() { }
|
|
924
|
+
ngOnInit() { }
|
|
925
|
+
onChange() {
|
|
926
|
+
this.modelChange.emit(this.model);
|
|
927
|
+
if (this.onToggle) {
|
|
928
|
+
this.onToggle();
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcCheckBox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
932
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: AcCheckBox, isStandalone: true, selector: "ac-checkbox", inputs: { model: "model", disabled: "disabled", title: "title", buildTitleSpace: "buildTitleSpace", titleColor: "titleColor", onToggle: "onToggle" }, outputs: { modelChange: "modelChange" }, ngImport: i0, template: "<div class=\"ac-checkbox\" [ngStyle]=\"{'--title-color': titleColor}\">\n <label class=\"ac-label\" *ngIf=\"buildTitleSpace || title\">{{title}}</label>\n <input\n class=\"ac-checkbox-input\" \n type=\"checkbox\" \n [checked]=\"model\"\n [(ngModel)]=\"model\"\n [disabled]=\"disabled\"\n (change)=\"onChange()\"\n >\n</div>\n", styles: [".ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}.ac-checkbox{display:flex;flex-direction:column;align-items:flex-start}.ac-checkbox .ac-checkbox-input{width:15px;height:15px;background-color:var(--switch-bg-color)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
933
|
+
}
|
|
934
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcCheckBox, decorators: [{
|
|
935
|
+
type: Component,
|
|
936
|
+
args: [{ selector: 'ac-checkbox', imports: [FormsModule, CommonModule], template: "<div class=\"ac-checkbox\" [ngStyle]=\"{'--title-color': titleColor}\">\n <label class=\"ac-label\" *ngIf=\"buildTitleSpace || title\">{{title}}</label>\n <input\n class=\"ac-checkbox-input\" \n type=\"checkbox\" \n [checked]=\"model\"\n [(ngModel)]=\"model\"\n [disabled]=\"disabled\"\n (change)=\"onChange()\"\n >\n</div>\n", styles: [".ac-label{width:100%;line-height:normal;font-weight:400;font-size:14px;padding-bottom:2px;height:auto;color:var(--font-color, black)}.ac-checkbox{display:flex;flex-direction:column;align-items:flex-start}.ac-checkbox .ac-checkbox-input{width:15px;height:15px;background-color:var(--switch-bg-color)}\n"] }]
|
|
937
|
+
}], ctorParameters: () => [], propDecorators: { model: [{
|
|
938
|
+
type: Input
|
|
939
|
+
}], disabled: [{
|
|
940
|
+
type: Input
|
|
941
|
+
}], title: [{
|
|
942
|
+
type: Input
|
|
943
|
+
}], buildTitleSpace: [{
|
|
944
|
+
type: Input
|
|
945
|
+
}], titleColor: [{
|
|
946
|
+
type: Input
|
|
947
|
+
}], onToggle: [{
|
|
948
|
+
type: Input
|
|
949
|
+
}], modelChange: [{
|
|
950
|
+
type: Output
|
|
951
|
+
}] } });
|
|
952
|
+
|
|
953
|
+
class AcSideMenu {
|
|
954
|
+
elementRef = inject((ElementRef));
|
|
955
|
+
previewIdx = -1;
|
|
956
|
+
showModulesNumber = 0;
|
|
957
|
+
showModules = false;
|
|
958
|
+
moduleClicked = 0;
|
|
959
|
+
modules = [];
|
|
960
|
+
routes = {
|
|
961
|
+
title: '',
|
|
962
|
+
icon: '',
|
|
963
|
+
modulesType: []
|
|
964
|
+
};
|
|
965
|
+
goTo = null;
|
|
966
|
+
forcedShowModules = false;
|
|
967
|
+
constructor() {
|
|
968
|
+
document.addEventListener('click', this.clickOutsideDetected);
|
|
969
|
+
this.elementRef.nativeElement.addEventListener('mouseenter', this.mouseEnterDetected);
|
|
970
|
+
this.elementRef.nativeElement.addEventListener('mouseleave', this.mouseLeaveDetected);
|
|
971
|
+
}
|
|
972
|
+
ngOnInit() {
|
|
973
|
+
setTimeout(() => {
|
|
974
|
+
//TODO: Manter histórico do localStorage
|
|
975
|
+
this.setModules();
|
|
976
|
+
}, 0);
|
|
977
|
+
}
|
|
978
|
+
ngOnDestroy() {
|
|
979
|
+
document.removeEventListener('click', this.clickOutsideDetected);
|
|
980
|
+
this.elementRef.nativeElement.removeEventListener('mouseenter', this.mouseEnterDetected);
|
|
981
|
+
this.elementRef.nativeElement.removeEventListener('mouseleave', this.mouseLeaveDetected);
|
|
982
|
+
}
|
|
983
|
+
setModules() {
|
|
984
|
+
this.modules = this.getModules();
|
|
985
|
+
}
|
|
986
|
+
getModules() {
|
|
987
|
+
return this.showModulesNumber
|
|
988
|
+
? [
|
|
989
|
+
{
|
|
990
|
+
title: this.routes.modulesType[this.showModulesNumber - 1].title,
|
|
991
|
+
icon: this.routes.modulesType[this.showModulesNumber - 1].icon,
|
|
992
|
+
path: '',
|
|
993
|
+
modules: []
|
|
994
|
+
},
|
|
995
|
+
...this.routes.modulesType[this.showModulesNumber - 1].modules
|
|
996
|
+
]
|
|
997
|
+
: [
|
|
998
|
+
{
|
|
999
|
+
title: this.routes.title,
|
|
1000
|
+
icon: this.routes.icon,
|
|
1001
|
+
path: '',
|
|
1002
|
+
modules: []
|
|
1003
|
+
},
|
|
1004
|
+
...this.routes.modulesType
|
|
1005
|
+
];
|
|
1006
|
+
}
|
|
1007
|
+
onModule(index, showModules) {
|
|
1008
|
+
if (this.showModulesNumber && index) {
|
|
1009
|
+
this.moduleClicked = index;
|
|
1010
|
+
return;
|
|
1011
|
+
}
|
|
1012
|
+
this.showModules = false;
|
|
1013
|
+
const forcedShowModulesDefault = this.forcedShowModules;
|
|
1014
|
+
this.forcedShowModules = false;
|
|
1015
|
+
this.showModulesNumber = index;
|
|
1016
|
+
this.setModules();
|
|
1017
|
+
setTimeout(() => {
|
|
1018
|
+
this.showModules = showModules;
|
|
1019
|
+
this.forcedShowModules = forcedShowModulesDefault;
|
|
1020
|
+
}, 0);
|
|
1021
|
+
}
|
|
1022
|
+
onSubModule(onSubModule) {
|
|
1023
|
+
setTimeout(() => {
|
|
1024
|
+
this.moduleClicked = 0;
|
|
1025
|
+
if (this.goTo) {
|
|
1026
|
+
this.goTo(onSubModule.path);
|
|
1027
|
+
}
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
mouseInSomeModule(index) {
|
|
1031
|
+
this.previewIdx = index;
|
|
1032
|
+
}
|
|
1033
|
+
clickOutsideDetected = (event) => {
|
|
1034
|
+
if (this.moduleClicked) {
|
|
1035
|
+
const target = event.target;
|
|
1036
|
+
const isClickInside = this.elementRef.nativeElement.contains(target);
|
|
1037
|
+
if (!isClickInside) {
|
|
1038
|
+
this.onBlur();
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
};
|
|
1042
|
+
mouseEnterDetected = () => {
|
|
1043
|
+
this.onFocus();
|
|
1044
|
+
};
|
|
1045
|
+
mouseLeaveDetected = () => {
|
|
1046
|
+
this.onMouseLeave();
|
|
1047
|
+
};
|
|
1048
|
+
onMouseLeave() {
|
|
1049
|
+
if (!this.moduleClicked) {
|
|
1050
|
+
this.resetFocus();
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
onBlur() {
|
|
1054
|
+
this.resetFocus();
|
|
1055
|
+
}
|
|
1056
|
+
onFocus() {
|
|
1057
|
+
this.showModules = true;
|
|
1058
|
+
}
|
|
1059
|
+
resetFocus() {
|
|
1060
|
+
this.showModules = false;
|
|
1061
|
+
this.previewIdx = -1;
|
|
1062
|
+
this.moduleClicked = 0;
|
|
1063
|
+
}
|
|
1064
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcSideMenu, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1065
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: AcSideMenu, isStandalone: true, selector: "ac-side-menu", inputs: { routes: "routes", goTo: "goTo", forcedShowModules: "forcedShowModules" }, ngImport: i0, template: "<div class=\"ac-side-menu\">\n <div \n *ngFor=\"let module of modules; let idx = index\"\n class=\"ac-side-menu-path\" \n [ngClass]=\"{'top-module': idx == 0, 'module-active': idx != 0 && moduleClicked == idx}\"\n [attr.gap]=\"(showModules || forcedShowModules) ? '': '0'\"\n (click)=\"onModule(idx, true)\"\n (mouseenter)=\"mouseInSomeModule(idx);\"\n > \n <mat-icon class=\"ac-side-menu-icon\" *ngIf=\"module.icon\" [fontIcon]=\"module.icon\"></mat-icon>\n <label [attr.hide]=\"!showModules && !forcedShowModules\" labelModule>{{module.title}}</label>\n\n <div\n class=\"ac-side-menu-module\"\n *ngIf=\"showModulesNumber && idx != 0\"\n [attr.hide]=\"idx != previewIdx\" >\n <div\n *ngFor=\"let subModule of module.modules; let subIdx = index\" \n class=\"ac-side-menu-submodule\"\n (click)=\"onSubModule(subModule);\">\n <mat-icon class=\"ac-side-menu-icon\" *ngIf=\"subModule.icon\" [fontIcon]=\"subModule.icon\"></mat-icon>\n <label>{{subModule.title}}</label>\n </div>\n </div>\n </div>\n</div>", styles: [".ac-side-menu{height:100%;color:#fff;background:linear-gradient(to bottom,var(--primary-color),var(--primary-color-dark));padding:5px}.ac-side-menu .ac-side-menu-path label[labelModule]{transition:opacity .3s ease-in-out,transform .3s ease-in-out}.ac-side-menu .ac-side-menu-path label[labelModule][hide=true]{opacity:0;transform:scale(.9)}.ac-side-menu .ac-side-menu-path label[labelModule][hide=false]{opacity:1;transform:scale(1)}.ac-side-menu .ac-side-menu-path{display:flex;align-items:center;flex-flow:row;padding-left:2px;padding-right:2px}.ac-side-menu .ac-side-menu-path.top-module{background-color:var(--secondary-color);border-radius:5px}.ac-side-menu .ac-side-menu-path.module-active{color:var(--secondary-color)}.ac-side-menu .ac-side-menu-path:hover:not(.top-module){color:var(--secondary-color)}.ac-side-menu .ac-side-menu-path .ac-side-menu-module{padding:3px 5px;border-radius:0 5px 5px 0;color:#fff;background:linear-gradient(to bottom,var(--primary-color),var(--primary-color-dark));max-width:none;z-index:3;position:absolute;top:0;right:-4.75px;transform:translate(100%);transition:padding .3s allow-discrete,width .3s allow-discrete}.ac-side-menu .ac-side-menu-path .ac-side-menu-module[hide=true]{padding:3px 0;width:0}.ac-side-menu .ac-side-menu-path .ac-side-menu-module .ac-side-menu-submodule{display:flex;align-items:center;flex-flow:row;overflow:hidden}.ac-side-menu .ac-side-menu-path .ac-side-menu-module .ac-side-menu-submodule:hover{color:var(--secondary-color)}.ac-side-menu .ac-side-menu-icon{font-size:20px;display:flex;align-items:center;justify-content:center}.ac-side-menu>div{position:relative;outline:none}.ac-side-menu>div label,.ac-side-menu>div mat-icon{overflow:hidden}.ac-side-menu>div>label{white-space:nowrap;transition:width .3s allow-discrete}.ac-side-menu>div>label[hide=true]{width:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
1066
|
+
}
|
|
1067
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcSideMenu, decorators: [{
|
|
1068
|
+
type: Component,
|
|
1069
|
+
args: [{ selector: 'ac-side-menu', standalone: true, imports: [
|
|
1070
|
+
CommonModule,
|
|
1071
|
+
MatIconModule
|
|
1072
|
+
], template: "<div class=\"ac-side-menu\">\n <div \n *ngFor=\"let module of modules; let idx = index\"\n class=\"ac-side-menu-path\" \n [ngClass]=\"{'top-module': idx == 0, 'module-active': idx != 0 && moduleClicked == idx}\"\n [attr.gap]=\"(showModules || forcedShowModules) ? '': '0'\"\n (click)=\"onModule(idx, true)\"\n (mouseenter)=\"mouseInSomeModule(idx);\"\n > \n <mat-icon class=\"ac-side-menu-icon\" *ngIf=\"module.icon\" [fontIcon]=\"module.icon\"></mat-icon>\n <label [attr.hide]=\"!showModules && !forcedShowModules\" labelModule>{{module.title}}</label>\n\n <div\n class=\"ac-side-menu-module\"\n *ngIf=\"showModulesNumber && idx != 0\"\n [attr.hide]=\"idx != previewIdx\" >\n <div\n *ngFor=\"let subModule of module.modules; let subIdx = index\" \n class=\"ac-side-menu-submodule\"\n (click)=\"onSubModule(subModule);\">\n <mat-icon class=\"ac-side-menu-icon\" *ngIf=\"subModule.icon\" [fontIcon]=\"subModule.icon\"></mat-icon>\n <label>{{subModule.title}}</label>\n </div>\n </div>\n </div>\n</div>", styles: [".ac-side-menu{height:100%;color:#fff;background:linear-gradient(to bottom,var(--primary-color),var(--primary-color-dark));padding:5px}.ac-side-menu .ac-side-menu-path label[labelModule]{transition:opacity .3s ease-in-out,transform .3s ease-in-out}.ac-side-menu .ac-side-menu-path label[labelModule][hide=true]{opacity:0;transform:scale(.9)}.ac-side-menu .ac-side-menu-path label[labelModule][hide=false]{opacity:1;transform:scale(1)}.ac-side-menu .ac-side-menu-path{display:flex;align-items:center;flex-flow:row;padding-left:2px;padding-right:2px}.ac-side-menu .ac-side-menu-path.top-module{background-color:var(--secondary-color);border-radius:5px}.ac-side-menu .ac-side-menu-path.module-active{color:var(--secondary-color)}.ac-side-menu .ac-side-menu-path:hover:not(.top-module){color:var(--secondary-color)}.ac-side-menu .ac-side-menu-path .ac-side-menu-module{padding:3px 5px;border-radius:0 5px 5px 0;color:#fff;background:linear-gradient(to bottom,var(--primary-color),var(--primary-color-dark));max-width:none;z-index:3;position:absolute;top:0;right:-4.75px;transform:translate(100%);transition:padding .3s allow-discrete,width .3s allow-discrete}.ac-side-menu .ac-side-menu-path .ac-side-menu-module[hide=true]{padding:3px 0;width:0}.ac-side-menu .ac-side-menu-path .ac-side-menu-module .ac-side-menu-submodule{display:flex;align-items:center;flex-flow:row;overflow:hidden}.ac-side-menu .ac-side-menu-path .ac-side-menu-module .ac-side-menu-submodule:hover{color:var(--secondary-color)}.ac-side-menu .ac-side-menu-icon{font-size:20px;display:flex;align-items:center;justify-content:center}.ac-side-menu>div{position:relative;outline:none}.ac-side-menu>div label,.ac-side-menu>div mat-icon{overflow:hidden}.ac-side-menu>div>label{white-space:nowrap;transition:width .3s allow-discrete}.ac-side-menu>div>label[hide=true]{width:0}\n"] }]
|
|
1073
|
+
}], ctorParameters: () => [], propDecorators: { routes: [{
|
|
1074
|
+
type: Input
|
|
1075
|
+
}], goTo: [{
|
|
1076
|
+
type: Input
|
|
1077
|
+
}], forcedShowModules: [{
|
|
1078
|
+
type: Input
|
|
1079
|
+
}] } });
|
|
1080
|
+
|
|
1081
|
+
class AcList {
|
|
1082
|
+
direction = {
|
|
1083
|
+
NONE: { icon: "unfold_more", next: "ASC" },
|
|
1084
|
+
ASC: { icon: "keyboard_arrow_up", next: "DESC" },
|
|
1085
|
+
DESC: { icon: "keyboard_arrow_down", next: "NONE" },
|
|
1086
|
+
};
|
|
1087
|
+
columns = [];
|
|
1088
|
+
list = [];
|
|
1089
|
+
rowTemplate;
|
|
1090
|
+
sortColumn = '';
|
|
1091
|
+
sortDirection = 'NONE';
|
|
1092
|
+
constructor() { }
|
|
1093
|
+
ngOnInit() { }
|
|
1094
|
+
ngOnChanges(changes) { }
|
|
1095
|
+
onSortDirection(colIndex) {
|
|
1096
|
+
this.sortDirection = this.direction[this.sortDirection].next;
|
|
1097
|
+
this.sortColumn = this.columns[colIndex].param;
|
|
1098
|
+
}
|
|
1099
|
+
getSortDirection(colIndex) {
|
|
1100
|
+
if (this.sortColumn === this.columns[colIndex].param) {
|
|
1101
|
+
return this.sortDirection;
|
|
1102
|
+
}
|
|
1103
|
+
return 'NONE';
|
|
1104
|
+
}
|
|
1105
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1106
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: AcList, isStandalone: true, selector: "ac-list", inputs: { columns: "columns", list: "list", rowTemplate: "rowTemplate", sortColumn: "sortColumn", sortDirection: "sortDirection" }, providers: [], usesOnChanges: true, ngImport: i0, template: "<div class=\"ac-list\">\n <table class=\"ac-list-table\">\n <thead class=\"ac-list-table-thead\">\n <tr class=\"ac-list-table-thead-tr\">\n <!-- <th *ngIf=\"selectMode != ''\" [width]=\"1\">\n <ac-checkbox \n *ngIf=\"selectMode == 'CHECKBOX'\"\n [(model)]=\"globalCheckbox!\"\n [onToggle]=\"selectAll\">\n </ac-checkbox>\n </th> -->\n <th class=\"ac-list-table-thead-tr-th\" \n attr.style=\"width:{{column.size}}px;\" \n *ngFor=\"let column of columns; let idx = index\"> \n <div class=\"ac-list-column-header\" \n *ngIf=\"!column.hide\">\n <div>\n {{column.label}}\n </div>\n <div *ngIf=\"column.sortable\">\n <mat-icon [fontIcon]=\"direction[getSortDirection(idx)]!.icon\"\n (click)=\"onSortDirection(idx)\"\n class=\"sort-icon\">\n </mat-icon>\n </div>\n </div>\n </th>\n </tr>\n </thead>\n <tbody class=\"ac-list-table-tbody\">\n <tr class=\"ac-list-table-tbody-tr\"\n *ngFor=\"let row of list; let idxRow = index;\"\n tabindex=\"0\"> \n <!-- <td *ngIf=\"selectMode != ''\">\n <ac-checkbox \n *ngIf=\"selectMode == 'CHECKBOX'\"\n [disabled]=\"disabled\"\n [(model)]=\"selectedValues[getRowId(idxRow)]!\"\n [onToggle]=\"onSelectedRow\">\n </ac-checkbox>\n </td> -->\n <td class=\"ac-list-table-tbody-tr-td\" \n *ngFor=\"let column of columns; let idxCol = index\"> \n <div class=\"ac-list-column-body\" \n *ngIf=\"!column.hide\" attr.style=\"width:{{column.size}}px;\">\n <div *ngIf=\"!rowTemplate\">\n {{row[column.param]}}\n </div>\n <ng-template *ngIf=\"rowTemplate\"\n [ngTemplateOutlet]=\"rowTemplate\"\n [ngTemplateOutletContext]=\"{\n row: row, \n idxRow: idxRow, \n column: column.param, \n idxCol: idxCol\n }\">\n </ng-template>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</div>", styles: [".ac-list{max-height:100%;overflow:auto}.ac-list .ac-list-table{max-height:100%;width:100%;border-collapse:separate;border-spacing:0;overflow:visible}.ac-list .ac-list-table .ac-list-table-thead .ac-list-table-thead-tr{background-color:var(--primary-color)}.ac-list .ac-list-table .ac-list-table-thead .ac-list-table-thead-tr .ac-list-table-thead-tr-th{font-weight:500;font-size:14px;color:#fff;padding-left:5px}.ac-list .ac-list-table .ac-list-table-thead .ac-list-table-thead-tr .ac-list-table-thead-tr-th:first-child{border-top-left-radius:5px;border-bottom-left-radius:5px}.ac-list .ac-list-table .ac-list-table-thead .ac-list-table-thead-tr .ac-list-table-thead-tr-th:last-child{padding-right:5px;border-top-right-radius:5px;border-bottom-right-radius:5px}.ac-list .ac-list-table .ac-list-table-thead .ac-list-table-thead-tr .ac-list-table-thead-tr-th .ac-list-column-header{display:flex;align-items:center;box-sizing:border-box;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.ac-list .ac-list-table .ac-list-table-thead .ac-list-table-thead-tr .ac-list-table-thead-tr-th .ac-list-column-header .sort-icon{font-size:20px;display:flex;align-items:center}.ac-list .ac-list-table .ac-list-table-tbody .ac-list-table-tbody-tr{outline:none}.ac-list .ac-list-table .ac-list-table-tbody .ac-list-table-tbody-tr:nth-child(2n){background:var(--list-item-even-background-color)}.ac-list .ac-list-table .ac-list-table-tbody .ac-list-table-tbody-tr:hover{background:var(--list-item-hover-background-color)}.ac-list .ac-list-table .ac-list-table-tbody .ac-list-table-tbody-tr:focus{background:var(--list-item-focus-background-color)}.ac-list .ac-list-table .ac-list-table-tbody .ac-list-table-tbody-tr .ac-list-table-tbody-tr-td{color:var(--font-color);padding-left:5px}.ac-list .ac-list-table .ac-list-table-tbody .ac-list-table-tbody-tr .ac-list-table-tbody-tr-td:last-child{padding-right:5px}.ac-list .ac-list-table .ac-list-table-tbody .ac-list-table-tbody-tr .ac-list-table-tbody-tr-td .ac-list-column-body{box-sizing:border-box;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type:
|
|
1107
|
+
// AcCheckBox,
|
|
1108
|
+
MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
1109
|
+
}
|
|
1110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: AcList, decorators: [{
|
|
1111
|
+
type: Component,
|
|
1112
|
+
args: [{ selector: 'ac-list', imports: [
|
|
1113
|
+
CommonModule,
|
|
1114
|
+
FormsModule,
|
|
1115
|
+
// AcCheckBox,
|
|
1116
|
+
MatIconModule
|
|
1117
|
+
], providers: [], template: "<div class=\"ac-list\">\n <table class=\"ac-list-table\">\n <thead class=\"ac-list-table-thead\">\n <tr class=\"ac-list-table-thead-tr\">\n <!-- <th *ngIf=\"selectMode != ''\" [width]=\"1\">\n <ac-checkbox \n *ngIf=\"selectMode == 'CHECKBOX'\"\n [(model)]=\"globalCheckbox!\"\n [onToggle]=\"selectAll\">\n </ac-checkbox>\n </th> -->\n <th class=\"ac-list-table-thead-tr-th\" \n attr.style=\"width:{{column.size}}px;\" \n *ngFor=\"let column of columns; let idx = index\"> \n <div class=\"ac-list-column-header\" \n *ngIf=\"!column.hide\">\n <div>\n {{column.label}}\n </div>\n <div *ngIf=\"column.sortable\">\n <mat-icon [fontIcon]=\"direction[getSortDirection(idx)]!.icon\"\n (click)=\"onSortDirection(idx)\"\n class=\"sort-icon\">\n </mat-icon>\n </div>\n </div>\n </th>\n </tr>\n </thead>\n <tbody class=\"ac-list-table-tbody\">\n <tr class=\"ac-list-table-tbody-tr\"\n *ngFor=\"let row of list; let idxRow = index;\"\n tabindex=\"0\"> \n <!-- <td *ngIf=\"selectMode != ''\">\n <ac-checkbox \n *ngIf=\"selectMode == 'CHECKBOX'\"\n [disabled]=\"disabled\"\n [(model)]=\"selectedValues[getRowId(idxRow)]!\"\n [onToggle]=\"onSelectedRow\">\n </ac-checkbox>\n </td> -->\n <td class=\"ac-list-table-tbody-tr-td\" \n *ngFor=\"let column of columns; let idxCol = index\"> \n <div class=\"ac-list-column-body\" \n *ngIf=\"!column.hide\" attr.style=\"width:{{column.size}}px;\">\n <div *ngIf=\"!rowTemplate\">\n {{row[column.param]}}\n </div>\n <ng-template *ngIf=\"rowTemplate\"\n [ngTemplateOutlet]=\"rowTemplate\"\n [ngTemplateOutletContext]=\"{\n row: row, \n idxRow: idxRow, \n column: column.param, \n idxCol: idxCol\n }\">\n </ng-template>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</div>", styles: [".ac-list{max-height:100%;overflow:auto}.ac-list .ac-list-table{max-height:100%;width:100%;border-collapse:separate;border-spacing:0;overflow:visible}.ac-list .ac-list-table .ac-list-table-thead .ac-list-table-thead-tr{background-color:var(--primary-color)}.ac-list .ac-list-table .ac-list-table-thead .ac-list-table-thead-tr .ac-list-table-thead-tr-th{font-weight:500;font-size:14px;color:#fff;padding-left:5px}.ac-list .ac-list-table .ac-list-table-thead .ac-list-table-thead-tr .ac-list-table-thead-tr-th:first-child{border-top-left-radius:5px;border-bottom-left-radius:5px}.ac-list .ac-list-table .ac-list-table-thead .ac-list-table-thead-tr .ac-list-table-thead-tr-th:last-child{padding-right:5px;border-top-right-radius:5px;border-bottom-right-radius:5px}.ac-list .ac-list-table .ac-list-table-thead .ac-list-table-thead-tr .ac-list-table-thead-tr-th .ac-list-column-header{display:flex;align-items:center;box-sizing:border-box;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.ac-list .ac-list-table .ac-list-table-thead .ac-list-table-thead-tr .ac-list-table-thead-tr-th .ac-list-column-header .sort-icon{font-size:20px;display:flex;align-items:center}.ac-list .ac-list-table .ac-list-table-tbody .ac-list-table-tbody-tr{outline:none}.ac-list .ac-list-table .ac-list-table-tbody .ac-list-table-tbody-tr:nth-child(2n){background:var(--list-item-even-background-color)}.ac-list .ac-list-table .ac-list-table-tbody .ac-list-table-tbody-tr:hover{background:var(--list-item-hover-background-color)}.ac-list .ac-list-table .ac-list-table-tbody .ac-list-table-tbody-tr:focus{background:var(--list-item-focus-background-color)}.ac-list .ac-list-table .ac-list-table-tbody .ac-list-table-tbody-tr .ac-list-table-tbody-tr-td{color:var(--font-color);padding-left:5px}.ac-list .ac-list-table .ac-list-table-tbody .ac-list-table-tbody-tr .ac-list-table-tbody-tr-td:last-child{padding-right:5px}.ac-list .ac-list-table .ac-list-table-tbody .ac-list-table-tbody-tr .ac-list-table-tbody-tr-td .ac-list-column-body{box-sizing:border-box;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}\n"] }]
|
|
1118
|
+
}], ctorParameters: () => [], propDecorators: { columns: [{
|
|
1119
|
+
type: Input
|
|
1120
|
+
}], list: [{
|
|
1121
|
+
type: Input
|
|
1122
|
+
}], rowTemplate: [{
|
|
1123
|
+
type: Input
|
|
1124
|
+
}], sortColumn: [{
|
|
1125
|
+
type: Input
|
|
1126
|
+
}], sortDirection: [{
|
|
1127
|
+
type: Input
|
|
1128
|
+
}] } });
|
|
1129
|
+
|
|
1130
|
+
class ComponentsModule {
|
|
1131
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: ComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1132
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.2", ngImport: i0, type: ComponentsModule, imports: [CommonModule,
|
|
1133
|
+
AcButton,
|
|
1134
|
+
AcSwitch,
|
|
1135
|
+
AcCheckBox,
|
|
1136
|
+
AcInputPassword,
|
|
1137
|
+
AcInputText,
|
|
1138
|
+
AcInputDocumentNumber,
|
|
1139
|
+
AcInputPhoneNumber,
|
|
1140
|
+
AcInputDateTime,
|
|
1141
|
+
AcInputDate,
|
|
1142
|
+
AcInputTime,
|
|
1143
|
+
AcInputFile,
|
|
1144
|
+
AcActionLink,
|
|
1145
|
+
AcSelect,
|
|
1146
|
+
AcPagination,
|
|
1147
|
+
AcNotification,
|
|
1148
|
+
AcProgressBar,
|
|
1149
|
+
AcSideMenu,
|
|
1150
|
+
AcList], exports: [AcButton,
|
|
1151
|
+
AcSwitch,
|
|
1152
|
+
AcCheckBox,
|
|
1153
|
+
AcInputPassword,
|
|
1154
|
+
AcInputText,
|
|
1155
|
+
AcInputDocumentNumber,
|
|
1156
|
+
AcInputPhoneNumber,
|
|
1157
|
+
AcInputDateTime,
|
|
1158
|
+
AcInputDate,
|
|
1159
|
+
AcInputTime,
|
|
1160
|
+
AcInputFile,
|
|
1161
|
+
AcActionLink,
|
|
1162
|
+
AcSelect,
|
|
1163
|
+
AcPagination,
|
|
1164
|
+
AcNotification,
|
|
1165
|
+
AcProgressBar,
|
|
1166
|
+
AcSideMenu,
|
|
1167
|
+
AcList] });
|
|
1168
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: ComponentsModule, imports: [CommonModule,
|
|
1169
|
+
AcButton,
|
|
1170
|
+
AcSwitch,
|
|
1171
|
+
AcCheckBox,
|
|
1172
|
+
AcInputPassword,
|
|
1173
|
+
AcInputText,
|
|
1174
|
+
AcInputDocumentNumber,
|
|
1175
|
+
AcInputPhoneNumber,
|
|
1176
|
+
AcInputDateTime,
|
|
1177
|
+
AcInputDate,
|
|
1178
|
+
AcInputTime,
|
|
1179
|
+
AcInputFile,
|
|
1180
|
+
AcActionLink,
|
|
1181
|
+
AcSelect,
|
|
1182
|
+
AcPagination,
|
|
1183
|
+
AcNotification,
|
|
1184
|
+
AcProgressBar,
|
|
1185
|
+
AcSideMenu,
|
|
1186
|
+
AcList] });
|
|
1187
|
+
}
|
|
1188
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: ComponentsModule, decorators: [{
|
|
1189
|
+
type: NgModule,
|
|
1190
|
+
args: [{
|
|
1191
|
+
declarations: [],
|
|
1192
|
+
imports: [
|
|
1193
|
+
CommonModule,
|
|
1194
|
+
AcButton,
|
|
1195
|
+
AcSwitch,
|
|
1196
|
+
AcCheckBox,
|
|
1197
|
+
AcInputPassword,
|
|
1198
|
+
AcInputText,
|
|
1199
|
+
AcInputDocumentNumber,
|
|
1200
|
+
AcInputPhoneNumber,
|
|
1201
|
+
AcInputDateTime,
|
|
1202
|
+
AcInputDate,
|
|
1203
|
+
AcInputTime,
|
|
1204
|
+
AcInputFile,
|
|
1205
|
+
AcActionLink,
|
|
1206
|
+
AcSelect,
|
|
1207
|
+
AcPagination,
|
|
1208
|
+
AcNotification,
|
|
1209
|
+
AcProgressBar,
|
|
1210
|
+
AcSideMenu,
|
|
1211
|
+
AcList
|
|
1212
|
+
],
|
|
1213
|
+
exports: [
|
|
1214
|
+
AcButton,
|
|
1215
|
+
AcSwitch,
|
|
1216
|
+
AcCheckBox,
|
|
1217
|
+
AcInputPassword,
|
|
1218
|
+
AcInputText,
|
|
1219
|
+
AcInputDocumentNumber,
|
|
1220
|
+
AcInputPhoneNumber,
|
|
1221
|
+
AcInputDateTime,
|
|
1222
|
+
AcInputDate,
|
|
1223
|
+
AcInputTime,
|
|
1224
|
+
AcInputFile,
|
|
1225
|
+
AcActionLink,
|
|
1226
|
+
AcSelect,
|
|
1227
|
+
AcPagination,
|
|
1228
|
+
AcNotification,
|
|
1229
|
+
AcProgressBar,
|
|
1230
|
+
AcSideMenu,
|
|
1231
|
+
AcList
|
|
1232
|
+
]
|
|
1233
|
+
}]
|
|
1234
|
+
}] });
|
|
1235
|
+
|
|
1236
|
+
/*
|
|
1237
|
+
* Public API Surface of components
|
|
1238
|
+
*/
|
|
1239
|
+
|
|
1240
|
+
/**
|
|
1241
|
+
* Generated bundle index. Do not edit.
|
|
1242
|
+
*/
|
|
1243
|
+
|
|
1244
|
+
export { AcActionLink, AcButton, AcCheckBox, AcInputDate, AcInputDateTime, AcInputDocumentNumber, AcInputFile, AcInputPassword, AcInputPhoneNumber, AcInputText, AcInputTime, AcList, AcNotification, AcPagination, AcProgressBar, AcSelect, AcSideMenu, AcSwitch, ComponentsModule };
|
|
1245
|
+
//# sourceMappingURL=sgcloud-sgsistemas-angular-components.mjs.map
|