mapa-library-ui 0.68.0 → 0.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/src/lib/components/datepicker/mapa-library-ui-src-lib-components-datepicker.mjs +5 -0
- package/esm2020/src/lib/components/datepicker/public-api.mjs +6 -0
- package/esm2020/src/lib/components/datepicker/src/datepicker.component.mjs +44 -0
- package/esm2020/src/lib/components/datepicker/src/datepicker.module.mjs +70 -0
- package/esm2020/src/lib/components/dropdown/lib/components/dropdown-tree/src/dropdown.component.mjs +55 -34
- package/esm2020/src/lib/components/dropdown-tree/lib/components/dropdown-tree/src/dropdown.component.mjs +55 -34
- package/esm2020/src/lib/components/empty/src/empty.component.mjs +3 -3
- package/fesm2015/mapa-library-ui-src-lib-components-datepicker.mjs +121 -0
- package/fesm2015/mapa-library-ui-src-lib-components-datepicker.mjs.map +1 -0
- package/fesm2015/mapa-library-ui-src-lib-components-dropdown-tree.mjs +50 -28
- package/fesm2015/mapa-library-ui-src-lib-components-dropdown-tree.mjs.map +1 -1
- package/fesm2015/mapa-library-ui-src-lib-components-dropdown.mjs +50 -28
- package/fesm2015/mapa-library-ui-src-lib-components-dropdown.mjs.map +1 -1
- package/fesm2015/mapa-library-ui-src-lib-components-empty.mjs +2 -2
- package/fesm2015/mapa-library-ui-src-lib-components-empty.mjs.map +1 -1
- package/fesm2020/mapa-library-ui-src-lib-components-datepicker.mjs +121 -0
- package/fesm2020/mapa-library-ui-src-lib-components-datepicker.mjs.map +1 -0
- package/fesm2020/mapa-library-ui-src-lib-components-dropdown-tree.mjs +48 -27
- package/fesm2020/mapa-library-ui-src-lib-components-dropdown-tree.mjs.map +1 -1
- package/fesm2020/mapa-library-ui-src-lib-components-dropdown.mjs +48 -27
- package/fesm2020/mapa-library-ui-src-lib-components-dropdown.mjs.map +1 -1
- package/fesm2020/mapa-library-ui-src-lib-components-empty.mjs +2 -2
- package/fesm2020/mapa-library-ui-src-lib-components-empty.mjs.map +1 -1
- package/mapa-library-ui-0.70.0.tgz +0 -0
- package/package.json +9 -1
- package/src/lib/components/datepicker/index.d.ts +5 -0
- package/src/lib/components/datepicker/public-api.d.ts +2 -0
- package/src/lib/components/datepicker/src/datepicker.component.d.ts +12 -0
- package/src/lib/components/datepicker/src/datepicker.module.d.ts +27 -0
- package/src/lib/components/dropdown/lib/components/dropdown-tree/src/dropdown.component.d.ts +11 -11
- package/src/lib/components/dropdown-tree/lib/components/dropdown-tree/src/dropdown.component.d.ts +11 -11
- package/mapa-library-ui-0.68.0.tgz +0 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, ViewEncapsulation, Input, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { UntypedFormGroup, UntypedFormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import moment from 'moment';
|
|
6
|
+
import * as i2 from 'ngx-mask';
|
|
7
|
+
import { NgxMaskDirective, NgxMaskPipe, provideNgxMask } from 'ngx-mask';
|
|
8
|
+
import * as i3 from '@angular/material/datepicker';
|
|
9
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
10
|
+
import * as i4 from '@angular/material/form-field';
|
|
11
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
12
|
+
import * as i5 from '@angular/material/input';
|
|
13
|
+
import { MatInputModule } from '@angular/material/input';
|
|
14
|
+
import * as i6 from '@angular/material/icon';
|
|
15
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
16
|
+
import { CommonModule } from '@angular/common';
|
|
17
|
+
import { MapaFormModule } from 'mapa-library-ui/src/lib/components/form';
|
|
18
|
+
import { MatNativeDateModule, MAT_DATE_FORMATS } from '@angular/material/core';
|
|
19
|
+
|
|
20
|
+
class DatepickerComponent {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.startDate = moment().subtract(60, "days").startOf("day").format("DD/MM/YYYY");
|
|
23
|
+
this.endDate = moment().endOf("day").format("DD/MM/YYYY");
|
|
24
|
+
this.formDatepicker = new UntypedFormGroup({
|
|
25
|
+
startDate: new UntypedFormControl(null),
|
|
26
|
+
endDate: new UntypedFormControl(null),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
onDateSelected() {
|
|
30
|
+
const form = this.formDatepicker.getRawValue();
|
|
31
|
+
if (form.startDate !== null && form.endDate !== null) {
|
|
32
|
+
this.formGroup.patchValue({
|
|
33
|
+
startDate: moment(form.startDate).format("DD/MM/YYYY") || undefined,
|
|
34
|
+
endDate: moment(form.endDate).format("DD/MM/YYYY") || undefined,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
cleanDatepicker() {
|
|
39
|
+
this.formGroup.patchValue({
|
|
40
|
+
startDate: moment().subtract(60, "days").startOf("day") || undefined,
|
|
41
|
+
endDate: moment().endOf("day") || undefined,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
DatepickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DatepickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
46
|
+
DatepickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DatepickerComponent, selector: "mapa-datepicker", inputs: { formGroup: "formGroup" }, ngImport: i0, template: "<section\n class=\"mapa__datepicker\"\n [formGroup]=\"formGroup\"\n>\n <mat-form-field appearance=\"standard\" class=\"mapa__datepicker--start-date\">\n <input\n matInput\n formControlName=\"startDate\"\n placeholder=\"Data inicial\"\n mask=\"00/00/0000\"\n />\n </mat-form-field>\n <div class=\"mapa__datepicker--divider\">\u2013</div>\n <mat-form-field appearance=\"standard\" class=\"mapa__datepicker--end-date\">\n <input\n matInput\n formControlName=\"endDate\"\n placeholder=\"Data final\"\n mask=\"00/00/0000\"\n />\n <mat-icon matSuffix (click)=\"cleanDatepicker()\">close</mat-icon>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker touchUi=\"true\" #picker></mat-date-range-picker>\n </mat-form-field>\n</section>\n<section class=\"mapa--hidden\">\n <mat-form-field [formGroup]=\"formDatepicker\">\n <mat-date-range-input [rangePicker]=\"picker\">\n <input\n matStartDate\n formControlName=\"startDate\"\n (ngModelChange)=\"onDateSelected()\"\n />\n <input\n matEndDate\n formControlName=\"endDate\"\n (ngModelChange)=\"onDateSelected()\"\n />\n </mat-date-range-input>\n </mat-form-field>\n</section>\n", styles: [".mat-form-field-type-mat-date-range-input .mat-form-field-appearance-outline{background-color:#fff}.mat-form-field-type-mat-date-range-input .mat-form-field-appearance-outline .mat-form-field-flex{height:44px!important}.mapa__datepicker{display:flex;align-items:center;justify-content:flex-start;border:2px solid #a7aaad;border-radius:8px;padding:8px 16px;height:44px;width:min-content}.mapa__datepicker--start-date,.mapa__datepicker--start-date .mat-input-element,.mapa__datepicker--start-date .mat-form-field-flex{width:90px!important}.mapa__datepicker--start-date .mat-form-field-underline{bottom:-4px;background-color:unset!important;width:94px}.mapa__datepicker--end-date,.mapa__datepicker--end-date .mat-input-element,.mapa__datepicker--end-date .mat-form-field-flex{min-width:130px!important}.mapa__datepicker--end-date .mat-form-field-underline{bottom:5px;background-color:unset!important;width:94px}.mapa__datepicker--divider{margin:0 8px}.mapa__datepicker .mat-form-field-suffix{display:flex;align-items:center}.mapa__datepicker .mat-form-field-flex{padding:unset!important;align-items:center!important}.mapa__datepicker .mat-form-field-infix{border-top:unset!important;min-height:unset!important}.mapa__datepicker .mat-form-field-wrapper{padding-bottom:unset!important}.mapa__datepicker .mat-form-field-subscript-wrapper,.mapa--hidden{display:none}\n"], dependencies: [{ 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.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2.NgxMaskDirective, selector: "input[mask], textarea[mask]", inputs: ["mask", "specialCharacters", "patterns", "prefix", "suffix", "thousandSeparator", "decimalMarker", "dropSpecialCharacters", "hiddenInput", "showMaskTyped", "placeHolderCharacter", "shownMaskExpression", "showTemplate", "clearIfNotMatch", "validation", "separatorLimit", "allowNegativeNumbers", "leadZeroDateTime", "leadZero", "triggerOnMaskChange", "apm", "inputTransformFn", "outputTransformFn", "keepCharacterPositions"], outputs: ["maskFilled"], exportAs: ["mask", "ngxMask"] }, { kind: "component", type: i3.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i3.MatDateRangeInput, selector: "mat-date-range-input", inputs: ["rangePicker", "required", "dateFilter", "min", "max", "disabled", "separator", "comparisonStart", "comparisonEnd"], exportAs: ["matDateRangeInput"] }, { kind: "directive", type: i3.MatStartDate, selector: "input[matStartDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { kind: "directive", type: i3.MatEndDate, selector: "input[matEndDate]", inputs: ["errorStateMatcher"], outputs: ["dateChange", "dateInput"] }, { kind: "component", type: i3.MatDateRangePicker, selector: "mat-date-range-picker", exportAs: ["matDateRangePicker"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DatepickerComponent, decorators: [{
|
|
48
|
+
type: Component,
|
|
49
|
+
args: [{ selector: "mapa-datepicker", encapsulation: ViewEncapsulation.None, template: "<section\n class=\"mapa__datepicker\"\n [formGroup]=\"formGroup\"\n>\n <mat-form-field appearance=\"standard\" class=\"mapa__datepicker--start-date\">\n <input\n matInput\n formControlName=\"startDate\"\n placeholder=\"Data inicial\"\n mask=\"00/00/0000\"\n />\n </mat-form-field>\n <div class=\"mapa__datepicker--divider\">\u2013</div>\n <mat-form-field appearance=\"standard\" class=\"mapa__datepicker--end-date\">\n <input\n matInput\n formControlName=\"endDate\"\n placeholder=\"Data final\"\n mask=\"00/00/0000\"\n />\n <mat-icon matSuffix (click)=\"cleanDatepicker()\">close</mat-icon>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker touchUi=\"true\" #picker></mat-date-range-picker>\n </mat-form-field>\n</section>\n<section class=\"mapa--hidden\">\n <mat-form-field [formGroup]=\"formDatepicker\">\n <mat-date-range-input [rangePicker]=\"picker\">\n <input\n matStartDate\n formControlName=\"startDate\"\n (ngModelChange)=\"onDateSelected()\"\n />\n <input\n matEndDate\n formControlName=\"endDate\"\n (ngModelChange)=\"onDateSelected()\"\n />\n </mat-date-range-input>\n </mat-form-field>\n</section>\n", styles: [".mat-form-field-type-mat-date-range-input .mat-form-field-appearance-outline{background-color:#fff}.mat-form-field-type-mat-date-range-input .mat-form-field-appearance-outline .mat-form-field-flex{height:44px!important}.mapa__datepicker{display:flex;align-items:center;justify-content:flex-start;border:2px solid #a7aaad;border-radius:8px;padding:8px 16px;height:44px;width:min-content}.mapa__datepicker--start-date,.mapa__datepicker--start-date .mat-input-element,.mapa__datepicker--start-date .mat-form-field-flex{width:90px!important}.mapa__datepicker--start-date .mat-form-field-underline{bottom:-4px;background-color:unset!important;width:94px}.mapa__datepicker--end-date,.mapa__datepicker--end-date .mat-input-element,.mapa__datepicker--end-date .mat-form-field-flex{min-width:130px!important}.mapa__datepicker--end-date .mat-form-field-underline{bottom:5px;background-color:unset!important;width:94px}.mapa__datepicker--divider{margin:0 8px}.mapa__datepicker .mat-form-field-suffix{display:flex;align-items:center}.mapa__datepicker .mat-form-field-flex{padding:unset!important;align-items:center!important}.mapa__datepicker .mat-form-field-infix{border-top:unset!important;min-height:unset!important}.mapa__datepicker .mat-form-field-wrapper{padding-bottom:unset!important}.mapa__datepicker .mat-form-field-subscript-wrapper,.mapa--hidden{display:none}\n"] }]
|
|
50
|
+
}], propDecorators: { formGroup: [{
|
|
51
|
+
type: Input
|
|
52
|
+
}] } });
|
|
53
|
+
|
|
54
|
+
const MAPA = [MapaFormModule];
|
|
55
|
+
const MATERIAL = [
|
|
56
|
+
MatNativeDateModule,
|
|
57
|
+
MatDatepickerModule,
|
|
58
|
+
MatInputModule,
|
|
59
|
+
MatFormFieldModule,
|
|
60
|
+
MatIconModule,
|
|
61
|
+
];
|
|
62
|
+
const MY_DATE_FORMATS = {
|
|
63
|
+
parse: {
|
|
64
|
+
dateInput: 'DD/MM/YYYY', // Format for parsing user input
|
|
65
|
+
},
|
|
66
|
+
display: {
|
|
67
|
+
dateInput: 'DD/MM/YYYY',
|
|
68
|
+
monthYearLabel: 'MMM YYYY',
|
|
69
|
+
dateA11yLabel: 'LL',
|
|
70
|
+
monthYearA11yLabel: 'MMMM YYYY', // Format for month/year accessibility labels
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
class MapaDatepickerModule {
|
|
74
|
+
}
|
|
75
|
+
MapaDatepickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MapaDatepickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
76
|
+
MapaDatepickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: MapaDatepickerModule, declarations: [DatepickerComponent], imports: [CommonModule,
|
|
77
|
+
FormsModule,
|
|
78
|
+
ReactiveFormsModule,
|
|
79
|
+
NgxMaskDirective,
|
|
80
|
+
NgxMaskPipe, MapaFormModule, MatNativeDateModule,
|
|
81
|
+
MatDatepickerModule,
|
|
82
|
+
MatInputModule,
|
|
83
|
+
MatFormFieldModule,
|
|
84
|
+
MatIconModule], exports: [DatepickerComponent] });
|
|
85
|
+
MapaDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MapaDatepickerModule, providers: [
|
|
86
|
+
provideNgxMask(),
|
|
87
|
+
{ provide: MAT_DATE_FORMATS, useValue: MY_DATE_FORMATS },
|
|
88
|
+
], imports: [CommonModule,
|
|
89
|
+
FormsModule,
|
|
90
|
+
ReactiveFormsModule, MAPA, MATERIAL] });
|
|
91
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MapaDatepickerModule, decorators: [{
|
|
92
|
+
type: NgModule,
|
|
93
|
+
args: [{
|
|
94
|
+
declarations: [DatepickerComponent],
|
|
95
|
+
exports: [DatepickerComponent],
|
|
96
|
+
imports: [
|
|
97
|
+
CommonModule,
|
|
98
|
+
FormsModule,
|
|
99
|
+
ReactiveFormsModule,
|
|
100
|
+
NgxMaskDirective,
|
|
101
|
+
NgxMaskPipe,
|
|
102
|
+
...MAPA,
|
|
103
|
+
...MATERIAL,
|
|
104
|
+
],
|
|
105
|
+
providers: [
|
|
106
|
+
provideNgxMask(),
|
|
107
|
+
{ provide: MAT_DATE_FORMATS, useValue: MY_DATE_FORMATS },
|
|
108
|
+
],
|
|
109
|
+
}]
|
|
110
|
+
}] });
|
|
111
|
+
|
|
112
|
+
/*
|
|
113
|
+
* Public API Surface of mapa-library-ui datepicker
|
|
114
|
+
*/
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Generated bundle index. Do not edit.
|
|
118
|
+
*/
|
|
119
|
+
|
|
120
|
+
export { DatepickerComponent, MY_DATE_FORMATS, MapaDatepickerModule };
|
|
121
|
+
//# sourceMappingURL=mapa-library-ui-src-lib-components-datepicker.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapa-library-ui-src-lib-components-datepicker.mjs","sources":["../../../projects/mapa-library-ui/src/lib/components/datepicker/src/datepicker.component.ts","../../../projects/mapa-library-ui/src/lib/components/datepicker/src/datepicker.component.html","../../../projects/mapa-library-ui/src/lib/components/datepicker/src/datepicker.module.ts","../../../projects/mapa-library-ui/src/lib/components/datepicker/public-api.ts","../../../projects/mapa-library-ui/src/lib/components/datepicker/mapa-library-ui-src-lib-components-datepicker.ts"],"sourcesContent":["import { Component, Input, ViewEncapsulation } from \"@angular/core\";\nimport {\n FormGroup,\n UntypedFormControl,\n UntypedFormGroup,\n} from \"@angular/forms\";\nimport moment from \"moment\";\n\n@Component({\n selector: \"mapa-datepicker\",\n templateUrl: \"./datepicker.component.html\",\n styleUrls: [\"./datepicker.component.scss\"],\n encapsulation: ViewEncapsulation.None,\n})\nexport class DatepickerComponent {\n @Input() formGroup!: FormGroup;\n\n startDate = moment().subtract(60, \"days\").startOf(\"day\").format(\"DD/MM/YYYY\");\n endDate = moment().endOf(\"day\").format(\"DD/MM/YYYY\");\n\n formDatepicker: UntypedFormGroup = new UntypedFormGroup({\n startDate: new UntypedFormControl(null),\n endDate: new UntypedFormControl(null),\n });\n\n onDateSelected() {\n const form = this.formDatepicker.getRawValue();\n if (form.startDate !== null && form.endDate !== null) {\n this.formGroup.patchValue({\n startDate: moment(form.startDate).format(\"DD/MM/YYYY\") || undefined,\n endDate: moment(form.endDate).format(\"DD/MM/YYYY\") || undefined,\n });\n }\n }\n\n cleanDatepicker() {\n this.formGroup.patchValue({\n startDate: moment().subtract(60, \"days\").startOf(\"day\") || undefined,\n endDate: moment().endOf(\"day\") || undefined,\n });\n }\n}\n","<section\n class=\"mapa__datepicker\"\n [formGroup]=\"formGroup\"\n>\n <mat-form-field appearance=\"standard\" class=\"mapa__datepicker--start-date\">\n <input\n matInput\n formControlName=\"startDate\"\n placeholder=\"Data inicial\"\n mask=\"00/00/0000\"\n />\n </mat-form-field>\n <div class=\"mapa__datepicker--divider\">–</div>\n <mat-form-field appearance=\"standard\" class=\"mapa__datepicker--end-date\">\n <input\n matInput\n formControlName=\"endDate\"\n placeholder=\"Data final\"\n mask=\"00/00/0000\"\n />\n <mat-icon matSuffix (click)=\"cleanDatepicker()\">close</mat-icon>\n <mat-datepicker-toggle matSuffix [for]=\"picker\"></mat-datepicker-toggle>\n <mat-date-range-picker touchUi=\"true\" #picker></mat-date-range-picker>\n </mat-form-field>\n</section>\n<section class=\"mapa--hidden\">\n <mat-form-field [formGroup]=\"formDatepicker\">\n <mat-date-range-input [rangePicker]=\"picker\">\n <input\n matStartDate\n formControlName=\"startDate\"\n (ngModelChange)=\"onDateSelected()\"\n />\n <input\n matEndDate\n formControlName=\"endDate\"\n (ngModelChange)=\"onDateSelected()\"\n />\n </mat-date-range-input>\n </mat-form-field>\n</section>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { DatepickerComponent } from './datepicker.component';\nimport { NgxMaskDirective, NgxMaskPipe, provideNgxMask } from 'ngx-mask';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { MatDatepickerModule } from '@angular/material/datepicker';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\nimport { MapaFormModule } from 'mapa-library-ui/src/lib/components/form';\nimport { MAT_DATE_FORMATS, MatNativeDateModule } from '@angular/material/core';\n\nconst MAPA = [MapaFormModule];\n\nconst MATERIAL = [\n MatNativeDateModule,\n MatDatepickerModule,\n MatInputModule,\n MatFormFieldModule,\n MatIconModule,\n];\n\nexport const MY_DATE_FORMATS = {\n parse: {\n dateInput: 'DD/MM/YYYY', // Format for parsing user input\n },\n display: {\n dateInput: 'DD/MM/YYYY', // Format for displaying in the input field\n monthYearLabel: 'MMM YYYY', // Format for the month/year label in the calendar\n dateA11yLabel: 'LL', // Format for accessibility labels\n monthYearA11yLabel: 'MMMM YYYY', // Format for month/year accessibility labels\n },\n};\n\n@NgModule({\n declarations: [DatepickerComponent],\n exports: [DatepickerComponent],\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n NgxMaskDirective,\n NgxMaskPipe,\n ...MAPA,\n ...MATERIAL,\n ],\n providers: [\n provideNgxMask(),\n { provide: MAT_DATE_FORMATS, useValue: MY_DATE_FORMATS },\n ],\n})\nexport class MapaDatepickerModule {}\n","/*\n * Public API Surface of mapa-library-ui datepicker\n */\n\nexport * from './src/datepicker.component';\nexport * from './src/datepicker.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;MAca,mBAAmB,CAAA;AANhC,IAAA,WAAA,GAAA;QASE,IAAS,CAAA,SAAA,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAC9E,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAErD,QAAA,IAAc,CAAA,cA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,EAAE;AACzD,qBAAA;iBACF,CAAA;;;AClDD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -411,7 +411,7 @@ class MapaDropdownTreeComponent {
|
|
|
411
411
|
/** A selected parent node to be inserted */
|
|
412
412
|
this.selectedParent = null;
|
|
413
413
|
/** The new item's name */
|
|
414
|
-
this.newItemName =
|
|
414
|
+
this.newItemName = '';
|
|
415
415
|
/** The selection for checklist */
|
|
416
416
|
this.checklistSelection = new SelectionModel(true);
|
|
417
417
|
/// Filtering
|
|
@@ -421,7 +421,7 @@ class MapaDropdownTreeComponent {
|
|
|
421
421
|
this.isExpandable = (node) => node.expandable;
|
|
422
422
|
this.getChildren = (node) => node.children;
|
|
423
423
|
this.hasChild = (_, _nodeData) => _nodeData.expandable;
|
|
424
|
-
this.hasNoContent = (_, _nodeData) => _nodeData.value ===
|
|
424
|
+
this.hasNoContent = (_, _nodeData) => _nodeData.value === '';
|
|
425
425
|
/**
|
|
426
426
|
* Transformer to convert nested node to flat node. Record the nodes in maps for later use.
|
|
427
427
|
*/
|
|
@@ -451,22 +451,39 @@ class MapaDropdownTreeComponent {
|
|
|
451
451
|
});
|
|
452
452
|
this.checklistSelection.changed.subscribe((selection) => {
|
|
453
453
|
var _a;
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
454
|
+
if (selection.source.selected.length > 0) {
|
|
455
|
+
(_a = this.formGroup.get(this.element.key)) === null || _a === void 0 ? void 0 : _a.patchValue(this.element.multiple
|
|
456
|
+
? selection.source.selected.map((checked) => {
|
|
457
|
+
return { value: checked.value, key: checked.key };
|
|
458
|
+
})
|
|
459
|
+
: {
|
|
460
|
+
value: selection.source.selected[0].value,
|
|
461
|
+
key: selection.source.selected[0].key,
|
|
462
|
+
}, { emitEvent: false });
|
|
463
|
+
}
|
|
457
464
|
});
|
|
458
465
|
(_a = this.formGroup.get(this.element.key)) === null || _a === void 0 ? void 0 : _a.valueChanges.subscribe((value) => {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
if (
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
466
|
+
var _a;
|
|
467
|
+
if (value) {
|
|
468
|
+
if (this.element.multiple) {
|
|
469
|
+
const allValuesKeys = this.element.multiple
|
|
470
|
+
? value.map((item) => item.key)
|
|
471
|
+
: [value.key];
|
|
472
|
+
this.treeControl.dataNodes.map((node) => {
|
|
473
|
+
if (allValuesKeys.includes(node.key)) {
|
|
474
|
+
if (this.element.multiple && node.level === 0) {
|
|
475
|
+
this.todoItemSelectionToggle(node);
|
|
476
|
+
}
|
|
477
|
+
else {
|
|
478
|
+
this.todoLeafItemSelectionToggle(node);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
});
|
|
468
482
|
}
|
|
469
|
-
|
|
483
|
+
else {
|
|
484
|
+
this.selectSingleItem((_a = this.treeControl.dataNodes) === null || _a === void 0 ? void 0 : _a.find((node) => node.key === value.key));
|
|
485
|
+
}
|
|
486
|
+
}
|
|
470
487
|
});
|
|
471
488
|
}
|
|
472
489
|
ngAfterViewInit() {
|
|
@@ -493,10 +510,15 @@ class MapaDropdownTreeComponent {
|
|
|
493
510
|
});
|
|
494
511
|
}
|
|
495
512
|
clearAll() {
|
|
496
|
-
var _a;
|
|
513
|
+
var _a, _b;
|
|
497
514
|
this.checklistSelection.clear();
|
|
498
|
-
|
|
499
|
-
|
|
515
|
+
if (this.element.multiple) {
|
|
516
|
+
(_a = this.formGroup.get(this.element.key)) === null || _a === void 0 ? void 0 : _a.patchValue([]);
|
|
517
|
+
this.toggleAllCheckbox.checked = false;
|
|
518
|
+
}
|
|
519
|
+
else {
|
|
520
|
+
(_b = this.formGroup.get(this.element.key)) === null || _b === void 0 ? void 0 : _b.patchValue(null);
|
|
521
|
+
}
|
|
500
522
|
}
|
|
501
523
|
onPanelChange() {
|
|
502
524
|
this.isMenuExpanded = !this.isMenuExpanded;
|
|
@@ -584,12 +606,12 @@ class MapaDropdownTreeComponent {
|
|
|
584
606
|
}
|
|
585
607
|
getSelectedItems() {
|
|
586
608
|
if (!this.checklistSelection.selected.length)
|
|
587
|
-
return this.element.placeholder ||
|
|
609
|
+
return this.element.placeholder || '';
|
|
588
610
|
return this.checklistSelection.selected
|
|
589
611
|
.map((s) => s.value)
|
|
590
|
-
.join(
|
|
612
|
+
.join(',')
|
|
591
613
|
.toString()
|
|
592
|
-
.replace(/\,/g,
|
|
614
|
+
.replace(/\,/g, ', ');
|
|
593
615
|
}
|
|
594
616
|
filterChanged(event) {
|
|
595
617
|
var _a;
|
|
@@ -599,15 +621,15 @@ class MapaDropdownTreeComponent {
|
|
|
599
621
|
}
|
|
600
622
|
clearSearchValue() {
|
|
601
623
|
var _a, _b;
|
|
602
|
-
(_b = (_a = this.element.search) === null || _a === void 0 ? void 0 : _a.formControl) === null || _b === void 0 ? void 0 : _b.setValue(
|
|
603
|
-
this._database.filter(
|
|
624
|
+
(_b = (_a = this.element.search) === null || _a === void 0 ? void 0 : _a.formControl) === null || _b === void 0 ? void 0 : _b.setValue('');
|
|
625
|
+
this._database.filter('');
|
|
604
626
|
}
|
|
605
627
|
selectSingleItem(node) {
|
|
606
628
|
var _a;
|
|
607
629
|
this.checklistSelection.clear();
|
|
608
630
|
this.checklistSelection.select(node);
|
|
609
631
|
(_a = this.formGroup
|
|
610
|
-
.get(this.element.key)) === null || _a === void 0 ? void 0 : _a.patchValue({ value: node.value, key: node.key });
|
|
632
|
+
.get(this.element.key)) === null || _a === void 0 ? void 0 : _a.patchValue({ value: node.value, key: node.key }, { emitEvent: false });
|
|
611
633
|
this.trigger.closeMenu();
|
|
612
634
|
}
|
|
613
635
|
hasValue() {
|
|
@@ -629,23 +651,23 @@ MapaDropdownTreeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0"
|
|
|
629
651
|
MapaDropdownTreeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: MapaDropdownTreeComponent, selector: "mapa-dropdown-tree", inputs: { formGroup: "formGroup", element: "element" }, viewQueries: [{ propertyName: "autocomplete", first: true, predicate: ["auto"], descendants: true }, { propertyName: "tree", first: true, predicate: ["tree"], descendants: true }, { propertyName: "trigger", first: true, predicate: MatMenuTrigger, descendants: true }, { propertyName: "toggleAllCheckbox", first: true, predicate: ["toggleAllCheckbox"], descendants: true }], ngImport: i0, template: "<form\n [formGroup]=\"formGroup\"\n *ngIf=\"formGroup && element\"\n class=\"mapa-dropdown-tree\"\n>\n <label *ngIf=\"element.label\" class=\"mapa-dropdown-tree__label\">\n {{ element.label }}\n </label>\n <button\n class=\"mapa-dropdown-tree__dropdown\"\n #menuOption=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"menu\"\n >\n <div class=\"mapa-dropdown-tree__dropdown--value\">\n {{ getSelectedItems() }}\n </div>\n\n <mat-icon *ngIf=\"hasValue()\" (click)=\"clearValue($event)\" matSuffix\n >close</mat-icon\n >\n <mat-icon>\n {{ menuOption.menuOpen ? 'keyboard_arrow_up' : 'keyboard_arrow_down' }}\n </mat-icon>\n </button>\n <mat-menu #menu=\"matMenu\">\n <div (click)=\"$event.stopPropagation()\">\n <div class=\"mapa-dropdown-tree__search\" *ngIf=\"element.search\">\n <mat-form-field appearance=\"outline\">\n <input\n matInput\n #searchInput\n [formControl]=\"element.search?.formControl!\"\n [placeholder]=\"element.search?.placeholder || ''\"\n (keydown)=\"$event.stopPropagation()\"\n (keyup)=\"filterChanged($event)\"\n />\n <mat-icon\n *ngIf=\"!!element.search?.formControl?.value && !element.search?.formControl?.disabled\"\n (click)=\"clearSearchValue()\"\n matSuffix\n >close</mat-icon\n >\n </mat-form-field>\n </div>\n <section [formGroup]=\"formGroup\">\n <label\n *ngIf=\"element.multiple === true\"\n class=\"mapa-dropdown-tree__toggle-all mapa-dropdown-tree__checkbox\"\n >\n <mat-checkbox\n #toggleAllCheckbox\n class=\"checklist-leaf-node\"\n (change)=\"toggleAll($event)\"\n [checked]=\"isAllNodeSelected()\"\n [indeterminate]=\"!isAllNodeSelected() && checklistSelection.hasValue()\"\n color=\"accent\"\n >Selecionar todos</mat-checkbox\n >\n </label>\n\n <mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\">\n <mat-tree-node\n *matTreeNodeDef=\"let node\"\n matTreeNodePadding\n matTreeNodePaddingIndent=\"13\"\n [class.mapa-dropdown-tree__checkbox--checked]=\"checklistSelection.isSelected(node)\"\n >\n <label class=\"mapa-dropdown-tree__checkbox\">\n <button mat-icon-button disabled></button>\n <!-- LEAF CHECKBOX -->\n <mat-checkbox\n *ngIf=\"element.multiple === true; else noCheckbox\"\n class=\"checklist-leaf-node\"\n [checked]=\"checklistSelection.isSelected(node)\"\n (change)=\"todoLeafItemSelectionToggle(node)\"\n color=\"accent\"\n >{{node.value}}</mat-checkbox\n >\n <ng-template #noCheckbox>\n <div (click)=\"selectSingleItem(node)\">\n {{node.value}}\n </div>\n </ng-template>\n </label>\n </mat-tree-node>\n\n <mat-tree-node\n *matTreeNodeDef=\"let node; when: hasChild\"\n matTreeNodePadding\n matTreeNodePaddingIndent=\"13\"\n [class.mapa-dropdown-tree__checkbox--checked]=\"checklistSelection.isSelected(node)\"\n >\n <label class=\"mapa-dropdown-tree__checkbox\">\n <!-- <button\n mat-icon-button\n matTreeNodeToggle\n [attr.aria-label]=\"'toggle ' + node.filename\"\n >\n <mat-icon class=\"mat-icon-rtl-mirror\">\n {{treeControl.isExpanded(node) ? 'expand_more' :\n 'chevron_right'}}\n </mat-icon>\n </button> -->\n <!-- [checked]=\"descendantsAllSelected(node)\" -->\n <!-- PARENT CHECKBOX -->\n <mat-checkbox\n *ngIf=\"element.multiple === true; else noCheckbox\"\n [checked]=\"checklistSelection.isSelected(node)\"\n [indeterminate]=\"descendantsPartiallySelected(node)\"\n (change)=\"todoItemSelectionToggle(node)\"\n color=\"accent\"\n >\n {{node.value}}</mat-checkbox\n >\n <ng-template #noCheckbox>\n <div (click)=\"selectSingleItem(node)\">\n {{node.value}}\n </div>\n </ng-template>\n </label>\n </mat-tree-node>\n </mat-tree>\n </section>\n <button\n *ngIf=\"element.multiple === true\"\n mat-button\n class=\"mapa-dropdown-tree__button\"\n color=\"primary\"\n (click)=\"clearAll()\"\n >\n Limpar todos\n </button>\n </div>\n </mat-menu>\n</form>\n", styles: [".mapa-dropdown-tree{min-width:235px;max-width:none;width:100%!important}.mapa-dropdown-tree .mat-select{font-family:Inter,sans-serif!important}.mapa-dropdown-tree__toggle-all .checklist-leaf-node{padding:16px 0}.mapa-dropdown-tree__label,.mapa-dropdown-tree__checkbox{display:block;font-style:normal;font-weight:400;line-height:16px;width:100%;padding:0 16px}.mapa-dropdown-tree__label div,.mapa-dropdown-tree__checkbox div{width:100%}.mapa-dropdown-tree__label--checked,.mapa-dropdown-tree__checkbox--checked{background:rgba(0,0,0,.12)}.mapa-dropdown-tree__checkbox{font-size:16px;padding:0 16px}.mapa-dropdown-tree__label{padding:0!important;font-size:12px!important;font-weight:600!important;margin-bottom:16px;text-transform:uppercase}.mapa-dropdown-tree__dropdown{display:flex;align-items:center;justify-content:flex-start;background-color:#fff;width:100%;border:2px solid #a7aaad;border-radius:8px;padding:10px 12px;margin-bottom:24px}.mapa-dropdown-tree__dropdown--value{flex-grow:1;font-family:Inter,sans-serif!important;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:300px}.mapa-dropdown-tree__button{background:#fff;border-top:1px solid #dcdcde!important;color:#ea561d;font-family:Inter,sans-serif;font-size:16px;font-style:normal;font-weight:500;line-height:28px;padding:9px;text-align:left!important;width:100%}.mapa-dropdown-tree__button .mat-button-wrapper{color:#ea561d!important;padding:4px 8px}.mapa-dropdown-tree__search{display:flex;align-items:center;justify-content:flex-start;background:#f6f7f7;width:100%;padding:10px 0 16px 16px!important}.mapa-dropdown-tree__search .mat-input-element{padding:4px 0}.mapa-dropdown-tree__search .mat-form-field{width:94%}.mapa-dropdown-tree__search .mat-form-field-wrapper{padding-bottom:unset!important}.mapa-dropdown-tree__search .mat-form-field-outline{background:white;border-radius:8px}.mapa-dropdown-tree__search .mat-form-field-appearance-outline .mat-form-field-infix{border-top:unset!important;padding:.7em 0 .5em}.mapa-dropdown-tree__clean{background:white;border-top:1px solid #dcdcde;bottom:0%;height:36px;position:absolute;width:100%;z-index:9999}.mapa-dropdown-tree__clean button{text-align:left;height:36px;width:100%}.mapa-dropdown-tree--highlight .mat-form-field-outline{border-radius:16px!important}.mapa-dropdown-tree--highlight .mat-form-field-outline .mat-form-field-outline-start,.mapa-dropdown-tree--highlight .mat-form-field-outline .mat-form-field-outline-end{border-width:2px!important;border-color:#eedb2a!important}.mapa-dropdown-tree--highlight .mat-form-field-outline .mat-form-field-outline-start{display:none!important}.mapa-dropdown-tree--highlight .mat-form-field-outline .mat-form-field-outline-end{border-radius:16px!important;border-left-style:solid!important}.mapa-dropdown-tree--soft-border .mat-form-field-outline .mat-form-field-outline-start,.mapa-dropdown-tree--soft-border .mat-form-field-outline .mat-form-field-outline-end{border-width:1px!important}.mapa-dropdown-tree--tag .mat-form-field-outline{border-radius:16px!important;height:42px!important}.mapa-dropdown-tree--tag .mat-form-field-outline .mat-form-field-outline-start,.mapa-dropdown-tree--tag .mat-form-field-outline .mat-form-field-outline-end{border-width:1px!important;border-color:#cdcdcd}.mapa-dropdown-tree--tag .mat-form-field-outline .mat-form-field-outline-start{display:none!important}.mapa-dropdown-tree--tag .mat-form-field-outline .mat-form-field-outline-end{border-radius:16px!important;border-left-style:solid!important}.mapa-dropdown-tree .mat-form-field-outline{background-color:#fff;border-radius:8px}.mapa-dropdown-tree .mat-form-field-outline .mat-form-field-outline-start,.mapa-dropdown-tree .mat-form-field-outline .mat-form-field-outline-end{border-width:2px}.mapa-dropdown-tree .mat-form-field-wrapper{padding-bottom:unset!important}.mapa-dropdown-tree .mat-form-field-flex{display:flex;align-items:center;height:48px}.mapa-dropdown-tree .mat-form-field-infix{border-top:unset!important;padding:unset!important;position:relative}.mapa-dropdown-tree .mat-select-trigger{min-width:50px;padding-top:.3em;height:unset!important}.mapa-dropdown-tree .mat-select-value-text{display:block;width:90%}.mapa-dropdown-tree .mat-select-arrow-wrapper{transform:none!important}.mapa-dropdown-tree .mat-select-arrow{border:unset}.mapa-dropdown-tree .mat-select-arrow:before,.mapa-dropdown-tree .mat-select-arrow:after{content:\"\";display:block;margin-top:-4px;position:absolute;right:10px;top:50%;width:0;border:solid black;border-width:0 2px 2px 0;padding:3px;transform:rotate(45deg);-webkit-transform:rotate(45deg)}.mapa-dropdown-tree [aria-expanded=true] .mat-select-arrow{margin:6px 0 0}.mapa-dropdown-tree [aria-expanded=true] .mat-select-arrow:before,.mapa-dropdown-tree [aria-expanded=true] .mat-select-arrow:after{transform:rotate(-135deg)!important;-webkit-transform:rotate(-135deg)!important}.mapa-overlay-dropdown-tree .mat-checkbox-label{color:#77838f!important;font-size:16px!important;font-style:normal;font-weight:400}.mapa-overlay-dropdown-tree .mat-menu-panel{width:100%;max-width:none!important;overflow:hidden}.mapa-overlay-dropdown-tree .mat-input-element{font-family:Inter,sans-serif;font-size:14px}.mapa-overlay-dropdown-tree .mat-menu-content{padding-bottom:unset!important;padding-top:unset!important}.mapa-overlay-dropdown-tree .mat-tree{display:flex;gap:8px;flex-direction:column;max-height:260px;padding-bottom:24px;overflow-y:auto}.mapa-overlay-dropdown-tree .mat-tree-node{color:#50575e!important}.mapa-overlay-dropdown-tree ul{padding-inline-start:20px!important;margin-block-start:0px!important;margin-block-end:0px!important;gap:8px}.mapa-overlay-dropdown-tree .tree-toggle,.mapa-overlay-dropdown-tree .mat-tree .mat-focus-indicator{display:none}.mapa-overlay-dropdown-tree .mat-tree .mat-tree-node{min-height:28px!important;padding:4px 0;flex:unset!important}.mapa-overlay-dropdown-tree .mat-tree .mat-tree-node:hover{background:rgba(0,0,0,.04)}.mapa-overlay-dropdown-tree .mat-select-tree-hide{display:block!important}.mapa-overlay-dropdown-tree .mat-autocomplete-panel .mat-option{padding:unset!important}.mapa-overlay-dropdown-tree .mat-select-panel{border-radius:8px;min-width:calc(100% + 24px)!important}.mapa-overlay-dropdown-tree .mat-select-panel .mat-option,.mapa-overlay-dropdown-tree .mat-select-panel .mat-option-text{font-family:Inter,sans-serif!important;font-size:16px;font-style:normal;font-weight:400;line-height:2em;height:2em;color:#50575e}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option{display:flex;padding:16px 8px!important;flex-direction:column;justify-content:center;align-items:center;gap:10px;align-self:stretch;background:#f6f7f7;height:unset!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option .mat-select-search-inside-mat-option{height:unset!important;line-height:unset!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option .mat-select-search-clear{top:-3px!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option .mat-select-search-inner{top:8px;border:2px solid #a7aaad;border-radius:8px!important;width:100%!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option .mat-select-search-toggle-all-checkbox{padding-left:8px!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option .mat-select-search-input{padding:8px 8px 8px 6px!important;height:unset!important;line-height:unset!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option .mat-select-search-input::placeholder{color:#c3c4c7!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search .mat-option-text{width:100%}.mapa-overlay-dropdown-tree .mat-pseudo-checkbox{color:#c3c4c7!important}.mapa-overlay-dropdown-tree .mat-checkbox-frame{border-color:#c3c4c7!important}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i4$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatSuffix, selector: "[matSuffix]" }, { kind: "directive", type: i7$1.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i8$1.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i8$1.MatTreeNodePadding, selector: "[matTreeNodePadding]", inputs: ["matTreeNodePadding", "matTreeNodePaddingIndent"] }, { kind: "component", type: i8$1.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i8$1.MatTreeNode, selector: "mat-tree-node", inputs: ["role", "disabled", "tabIndex"], exportAs: ["matTreeNode"] }, { kind: "component", type: i9.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i10.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "directive", type: i10.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
630
652
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MapaDropdownTreeComponent, decorators: [{
|
|
631
653
|
type: Component,
|
|
632
|
-
args: [{ selector: "mapa-dropdown-tree", encapsulation: ViewEncapsulation.None, template: "<form\n [formGroup]=\"formGroup\"\n *ngIf=\"formGroup && element\"\n class=\"mapa-dropdown-tree\"\n>\n <label *ngIf=\"element.label\" class=\"mapa-dropdown-tree__label\">\n {{ element.label }}\n </label>\n <button\n class=\"mapa-dropdown-tree__dropdown\"\n #menuOption=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"menu\"\n >\n <div class=\"mapa-dropdown-tree__dropdown--value\">\n {{ getSelectedItems() }}\n </div>\n\n <mat-icon *ngIf=\"hasValue()\" (click)=\"clearValue($event)\" matSuffix\n >close</mat-icon\n >\n <mat-icon>\n {{ menuOption.menuOpen ? 'keyboard_arrow_up' : 'keyboard_arrow_down' }}\n </mat-icon>\n </button>\n <mat-menu #menu=\"matMenu\">\n <div (click)=\"$event.stopPropagation()\">\n <div class=\"mapa-dropdown-tree__search\" *ngIf=\"element.search\">\n <mat-form-field appearance=\"outline\">\n <input\n matInput\n #searchInput\n [formControl]=\"element.search?.formControl!\"\n [placeholder]=\"element.search?.placeholder || ''\"\n (keydown)=\"$event.stopPropagation()\"\n (keyup)=\"filterChanged($event)\"\n />\n <mat-icon\n *ngIf=\"!!element.search?.formControl?.value && !element.search?.formControl?.disabled\"\n (click)=\"clearSearchValue()\"\n matSuffix\n >close</mat-icon\n >\n </mat-form-field>\n </div>\n <section [formGroup]=\"formGroup\">\n <label\n *ngIf=\"element.multiple === true\"\n class=\"mapa-dropdown-tree__toggle-all mapa-dropdown-tree__checkbox\"\n >\n <mat-checkbox\n #toggleAllCheckbox\n class=\"checklist-leaf-node\"\n (change)=\"toggleAll($event)\"\n [checked]=\"isAllNodeSelected()\"\n [indeterminate]=\"!isAllNodeSelected() && checklistSelection.hasValue()\"\n color=\"accent\"\n >Selecionar todos</mat-checkbox\n >\n </label>\n\n <mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\">\n <mat-tree-node\n *matTreeNodeDef=\"let node\"\n matTreeNodePadding\n matTreeNodePaddingIndent=\"13\"\n [class.mapa-dropdown-tree__checkbox--checked]=\"checklistSelection.isSelected(node)\"\n >\n <label class=\"mapa-dropdown-tree__checkbox\">\n <button mat-icon-button disabled></button>\n <!-- LEAF CHECKBOX -->\n <mat-checkbox\n *ngIf=\"element.multiple === true; else noCheckbox\"\n class=\"checklist-leaf-node\"\n [checked]=\"checklistSelection.isSelected(node)\"\n (change)=\"todoLeafItemSelectionToggle(node)\"\n color=\"accent\"\n >{{node.value}}</mat-checkbox\n >\n <ng-template #noCheckbox>\n <div (click)=\"selectSingleItem(node)\">\n {{node.value}}\n </div>\n </ng-template>\n </label>\n </mat-tree-node>\n\n <mat-tree-node\n *matTreeNodeDef=\"let node; when: hasChild\"\n matTreeNodePadding\n matTreeNodePaddingIndent=\"13\"\n [class.mapa-dropdown-tree__checkbox--checked]=\"checklistSelection.isSelected(node)\"\n >\n <label class=\"mapa-dropdown-tree__checkbox\">\n <!-- <button\n mat-icon-button\n matTreeNodeToggle\n [attr.aria-label]=\"'toggle ' + node.filename\"\n >\n <mat-icon class=\"mat-icon-rtl-mirror\">\n {{treeControl.isExpanded(node) ? 'expand_more' :\n 'chevron_right'}}\n </mat-icon>\n </button> -->\n <!-- [checked]=\"descendantsAllSelected(node)\" -->\n <!-- PARENT CHECKBOX -->\n <mat-checkbox\n *ngIf=\"element.multiple === true; else noCheckbox\"\n [checked]=\"checklistSelection.isSelected(node)\"\n [indeterminate]=\"descendantsPartiallySelected(node)\"\n (change)=\"todoItemSelectionToggle(node)\"\n color=\"accent\"\n >\n {{node.value}}</mat-checkbox\n >\n <ng-template #noCheckbox>\n <div (click)=\"selectSingleItem(node)\">\n {{node.value}}\n </div>\n </ng-template>\n </label>\n </mat-tree-node>\n </mat-tree>\n </section>\n <button\n *ngIf=\"element.multiple === true\"\n mat-button\n class=\"mapa-dropdown-tree__button\"\n color=\"primary\"\n (click)=\"clearAll()\"\n >\n Limpar todos\n </button>\n </div>\n </mat-menu>\n</form>\n", styles: [".mapa-dropdown-tree{min-width:235px;max-width:none;width:100%!important}.mapa-dropdown-tree .mat-select{font-family:Inter,sans-serif!important}.mapa-dropdown-tree__toggle-all .checklist-leaf-node{padding:16px 0}.mapa-dropdown-tree__label,.mapa-dropdown-tree__checkbox{display:block;font-style:normal;font-weight:400;line-height:16px;width:100%;padding:0 16px}.mapa-dropdown-tree__label div,.mapa-dropdown-tree__checkbox div{width:100%}.mapa-dropdown-tree__label--checked,.mapa-dropdown-tree__checkbox--checked{background:rgba(0,0,0,.12)}.mapa-dropdown-tree__checkbox{font-size:16px;padding:0 16px}.mapa-dropdown-tree__label{padding:0!important;font-size:12px!important;font-weight:600!important;margin-bottom:16px;text-transform:uppercase}.mapa-dropdown-tree__dropdown{display:flex;align-items:center;justify-content:flex-start;background-color:#fff;width:100%;border:2px solid #a7aaad;border-radius:8px;padding:10px 12px;margin-bottom:24px}.mapa-dropdown-tree__dropdown--value{flex-grow:1;font-family:Inter,sans-serif!important;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:300px}.mapa-dropdown-tree__button{background:#fff;border-top:1px solid #dcdcde!important;color:#ea561d;font-family:Inter,sans-serif;font-size:16px;font-style:normal;font-weight:500;line-height:28px;padding:9px;text-align:left!important;width:100%}.mapa-dropdown-tree__button .mat-button-wrapper{color:#ea561d!important;padding:4px 8px}.mapa-dropdown-tree__search{display:flex;align-items:center;justify-content:flex-start;background:#f6f7f7;width:100%;padding:10px 0 16px 16px!important}.mapa-dropdown-tree__search .mat-input-element{padding:4px 0}.mapa-dropdown-tree__search .mat-form-field{width:94%}.mapa-dropdown-tree__search .mat-form-field-wrapper{padding-bottom:unset!important}.mapa-dropdown-tree__search .mat-form-field-outline{background:white;border-radius:8px}.mapa-dropdown-tree__search .mat-form-field-appearance-outline .mat-form-field-infix{border-top:unset!important;padding:.7em 0 .5em}.mapa-dropdown-tree__clean{background:white;border-top:1px solid #dcdcde;bottom:0%;height:36px;position:absolute;width:100%;z-index:9999}.mapa-dropdown-tree__clean button{text-align:left;height:36px;width:100%}.mapa-dropdown-tree--highlight .mat-form-field-outline{border-radius:16px!important}.mapa-dropdown-tree--highlight .mat-form-field-outline .mat-form-field-outline-start,.mapa-dropdown-tree--highlight .mat-form-field-outline .mat-form-field-outline-end{border-width:2px!important;border-color:#eedb2a!important}.mapa-dropdown-tree--highlight .mat-form-field-outline .mat-form-field-outline-start{display:none!important}.mapa-dropdown-tree--highlight .mat-form-field-outline .mat-form-field-outline-end{border-radius:16px!important;border-left-style:solid!important}.mapa-dropdown-tree--soft-border .mat-form-field-outline .mat-form-field-outline-start,.mapa-dropdown-tree--soft-border .mat-form-field-outline .mat-form-field-outline-end{border-width:1px!important}.mapa-dropdown-tree--tag .mat-form-field-outline{border-radius:16px!important;height:42px!important}.mapa-dropdown-tree--tag .mat-form-field-outline .mat-form-field-outline-start,.mapa-dropdown-tree--tag .mat-form-field-outline .mat-form-field-outline-end{border-width:1px!important;border-color:#cdcdcd}.mapa-dropdown-tree--tag .mat-form-field-outline .mat-form-field-outline-start{display:none!important}.mapa-dropdown-tree--tag .mat-form-field-outline .mat-form-field-outline-end{border-radius:16px!important;border-left-style:solid!important}.mapa-dropdown-tree .mat-form-field-outline{background-color:#fff;border-radius:8px}.mapa-dropdown-tree .mat-form-field-outline .mat-form-field-outline-start,.mapa-dropdown-tree .mat-form-field-outline .mat-form-field-outline-end{border-width:2px}.mapa-dropdown-tree .mat-form-field-wrapper{padding-bottom:unset!important}.mapa-dropdown-tree .mat-form-field-flex{display:flex;align-items:center;height:48px}.mapa-dropdown-tree .mat-form-field-infix{border-top:unset!important;padding:unset!important;position:relative}.mapa-dropdown-tree .mat-select-trigger{min-width:50px;padding-top:.3em;height:unset!important}.mapa-dropdown-tree .mat-select-value-text{display:block;width:90%}.mapa-dropdown-tree .mat-select-arrow-wrapper{transform:none!important}.mapa-dropdown-tree .mat-select-arrow{border:unset}.mapa-dropdown-tree .mat-select-arrow:before,.mapa-dropdown-tree .mat-select-arrow:after{content:\"\";display:block;margin-top:-4px;position:absolute;right:10px;top:50%;width:0;border:solid black;border-width:0 2px 2px 0;padding:3px;transform:rotate(45deg);-webkit-transform:rotate(45deg)}.mapa-dropdown-tree [aria-expanded=true] .mat-select-arrow{margin:6px 0 0}.mapa-dropdown-tree [aria-expanded=true] .mat-select-arrow:before,.mapa-dropdown-tree [aria-expanded=true] .mat-select-arrow:after{transform:rotate(-135deg)!important;-webkit-transform:rotate(-135deg)!important}.mapa-overlay-dropdown-tree .mat-checkbox-label{color:#77838f!important;font-size:16px!important;font-style:normal;font-weight:400}.mapa-overlay-dropdown-tree .mat-menu-panel{width:100%;max-width:none!important;overflow:hidden}.mapa-overlay-dropdown-tree .mat-input-element{font-family:Inter,sans-serif;font-size:14px}.mapa-overlay-dropdown-tree .mat-menu-content{padding-bottom:unset!important;padding-top:unset!important}.mapa-overlay-dropdown-tree .mat-tree{display:flex;gap:8px;flex-direction:column;max-height:260px;padding-bottom:24px;overflow-y:auto}.mapa-overlay-dropdown-tree .mat-tree-node{color:#50575e!important}.mapa-overlay-dropdown-tree ul{padding-inline-start:20px!important;margin-block-start:0px!important;margin-block-end:0px!important;gap:8px}.mapa-overlay-dropdown-tree .tree-toggle,.mapa-overlay-dropdown-tree .mat-tree .mat-focus-indicator{display:none}.mapa-overlay-dropdown-tree .mat-tree .mat-tree-node{min-height:28px!important;padding:4px 0;flex:unset!important}.mapa-overlay-dropdown-tree .mat-tree .mat-tree-node:hover{background:rgba(0,0,0,.04)}.mapa-overlay-dropdown-tree .mat-select-tree-hide{display:block!important}.mapa-overlay-dropdown-tree .mat-autocomplete-panel .mat-option{padding:unset!important}.mapa-overlay-dropdown-tree .mat-select-panel{border-radius:8px;min-width:calc(100% + 24px)!important}.mapa-overlay-dropdown-tree .mat-select-panel .mat-option,.mapa-overlay-dropdown-tree .mat-select-panel .mat-option-text{font-family:Inter,sans-serif!important;font-size:16px;font-style:normal;font-weight:400;line-height:2em;height:2em;color:#50575e}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option{display:flex;padding:16px 8px!important;flex-direction:column;justify-content:center;align-items:center;gap:10px;align-self:stretch;background:#f6f7f7;height:unset!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option .mat-select-search-inside-mat-option{height:unset!important;line-height:unset!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option .mat-select-search-clear{top:-3px!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option .mat-select-search-inner{top:8px;border:2px solid #a7aaad;border-radius:8px!important;width:100%!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option .mat-select-search-toggle-all-checkbox{padding-left:8px!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option .mat-select-search-input{padding:8px 8px 8px 6px!important;height:unset!important;line-height:unset!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option .mat-select-search-input::placeholder{color:#c3c4c7!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search .mat-option-text{width:100%}.mapa-overlay-dropdown-tree .mat-pseudo-checkbox{color:#c3c4c7!important}.mapa-overlay-dropdown-tree .mat-checkbox-frame{border-color:#c3c4c7!important}\n"] }]
|
|
654
|
+
args: [{ selector: 'mapa-dropdown-tree', encapsulation: ViewEncapsulation.None, template: "<form\n [formGroup]=\"formGroup\"\n *ngIf=\"formGroup && element\"\n class=\"mapa-dropdown-tree\"\n>\n <label *ngIf=\"element.label\" class=\"mapa-dropdown-tree__label\">\n {{ element.label }}\n </label>\n <button\n class=\"mapa-dropdown-tree__dropdown\"\n #menuOption=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"menu\"\n >\n <div class=\"mapa-dropdown-tree__dropdown--value\">\n {{ getSelectedItems() }}\n </div>\n\n <mat-icon *ngIf=\"hasValue()\" (click)=\"clearValue($event)\" matSuffix\n >close</mat-icon\n >\n <mat-icon>\n {{ menuOption.menuOpen ? 'keyboard_arrow_up' : 'keyboard_arrow_down' }}\n </mat-icon>\n </button>\n <mat-menu #menu=\"matMenu\">\n <div (click)=\"$event.stopPropagation()\">\n <div class=\"mapa-dropdown-tree__search\" *ngIf=\"element.search\">\n <mat-form-field appearance=\"outline\">\n <input\n matInput\n #searchInput\n [formControl]=\"element.search?.formControl!\"\n [placeholder]=\"element.search?.placeholder || ''\"\n (keydown)=\"$event.stopPropagation()\"\n (keyup)=\"filterChanged($event)\"\n />\n <mat-icon\n *ngIf=\"!!element.search?.formControl?.value && !element.search?.formControl?.disabled\"\n (click)=\"clearSearchValue()\"\n matSuffix\n >close</mat-icon\n >\n </mat-form-field>\n </div>\n <section [formGroup]=\"formGroup\">\n <label\n *ngIf=\"element.multiple === true\"\n class=\"mapa-dropdown-tree__toggle-all mapa-dropdown-tree__checkbox\"\n >\n <mat-checkbox\n #toggleAllCheckbox\n class=\"checklist-leaf-node\"\n (change)=\"toggleAll($event)\"\n [checked]=\"isAllNodeSelected()\"\n [indeterminate]=\"!isAllNodeSelected() && checklistSelection.hasValue()\"\n color=\"accent\"\n >Selecionar todos</mat-checkbox\n >\n </label>\n\n <mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\">\n <mat-tree-node\n *matTreeNodeDef=\"let node\"\n matTreeNodePadding\n matTreeNodePaddingIndent=\"13\"\n [class.mapa-dropdown-tree__checkbox--checked]=\"checklistSelection.isSelected(node)\"\n >\n <label class=\"mapa-dropdown-tree__checkbox\">\n <button mat-icon-button disabled></button>\n <!-- LEAF CHECKBOX -->\n <mat-checkbox\n *ngIf=\"element.multiple === true; else noCheckbox\"\n class=\"checklist-leaf-node\"\n [checked]=\"checklistSelection.isSelected(node)\"\n (change)=\"todoLeafItemSelectionToggle(node)\"\n color=\"accent\"\n >{{node.value}}</mat-checkbox\n >\n <ng-template #noCheckbox>\n <div (click)=\"selectSingleItem(node)\">\n {{node.value}}\n </div>\n </ng-template>\n </label>\n </mat-tree-node>\n\n <mat-tree-node\n *matTreeNodeDef=\"let node; when: hasChild\"\n matTreeNodePadding\n matTreeNodePaddingIndent=\"13\"\n [class.mapa-dropdown-tree__checkbox--checked]=\"checklistSelection.isSelected(node)\"\n >\n <label class=\"mapa-dropdown-tree__checkbox\">\n <!-- <button\n mat-icon-button\n matTreeNodeToggle\n [attr.aria-label]=\"'toggle ' + node.filename\"\n >\n <mat-icon class=\"mat-icon-rtl-mirror\">\n {{treeControl.isExpanded(node) ? 'expand_more' :\n 'chevron_right'}}\n </mat-icon>\n </button> -->\n <!-- [checked]=\"descendantsAllSelected(node)\" -->\n <!-- PARENT CHECKBOX -->\n <mat-checkbox\n *ngIf=\"element.multiple === true; else noCheckbox\"\n [checked]=\"checklistSelection.isSelected(node)\"\n [indeterminate]=\"descendantsPartiallySelected(node)\"\n (change)=\"todoItemSelectionToggle(node)\"\n color=\"accent\"\n >\n {{node.value}}</mat-checkbox\n >\n <ng-template #noCheckbox>\n <div (click)=\"selectSingleItem(node)\">\n {{node.value}}\n </div>\n </ng-template>\n </label>\n </mat-tree-node>\n </mat-tree>\n </section>\n <button\n *ngIf=\"element.multiple === true\"\n mat-button\n class=\"mapa-dropdown-tree__button\"\n color=\"primary\"\n (click)=\"clearAll()\"\n >\n Limpar todos\n </button>\n </div>\n </mat-menu>\n</form>\n", styles: [".mapa-dropdown-tree{min-width:235px;max-width:none;width:100%!important}.mapa-dropdown-tree .mat-select{font-family:Inter,sans-serif!important}.mapa-dropdown-tree__toggle-all .checklist-leaf-node{padding:16px 0}.mapa-dropdown-tree__label,.mapa-dropdown-tree__checkbox{display:block;font-style:normal;font-weight:400;line-height:16px;width:100%;padding:0 16px}.mapa-dropdown-tree__label div,.mapa-dropdown-tree__checkbox div{width:100%}.mapa-dropdown-tree__label--checked,.mapa-dropdown-tree__checkbox--checked{background:rgba(0,0,0,.12)}.mapa-dropdown-tree__checkbox{font-size:16px;padding:0 16px}.mapa-dropdown-tree__label{padding:0!important;font-size:12px!important;font-weight:600!important;margin-bottom:16px;text-transform:uppercase}.mapa-dropdown-tree__dropdown{display:flex;align-items:center;justify-content:flex-start;background-color:#fff;width:100%;border:2px solid #a7aaad;border-radius:8px;padding:10px 12px;margin-bottom:24px}.mapa-dropdown-tree__dropdown--value{flex-grow:1;font-family:Inter,sans-serif!important;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:300px}.mapa-dropdown-tree__button{background:#fff;border-top:1px solid #dcdcde!important;color:#ea561d;font-family:Inter,sans-serif;font-size:16px;font-style:normal;font-weight:500;line-height:28px;padding:9px;text-align:left!important;width:100%}.mapa-dropdown-tree__button .mat-button-wrapper{color:#ea561d!important;padding:4px 8px}.mapa-dropdown-tree__search{display:flex;align-items:center;justify-content:flex-start;background:#f6f7f7;width:100%;padding:10px 0 16px 16px!important}.mapa-dropdown-tree__search .mat-input-element{padding:4px 0}.mapa-dropdown-tree__search .mat-form-field{width:94%}.mapa-dropdown-tree__search .mat-form-field-wrapper{padding-bottom:unset!important}.mapa-dropdown-tree__search .mat-form-field-outline{background:white;border-radius:8px}.mapa-dropdown-tree__search .mat-form-field-appearance-outline .mat-form-field-infix{border-top:unset!important;padding:.7em 0 .5em}.mapa-dropdown-tree__clean{background:white;border-top:1px solid #dcdcde;bottom:0%;height:36px;position:absolute;width:100%;z-index:9999}.mapa-dropdown-tree__clean button{text-align:left;height:36px;width:100%}.mapa-dropdown-tree--highlight .mat-form-field-outline{border-radius:16px!important}.mapa-dropdown-tree--highlight .mat-form-field-outline .mat-form-field-outline-start,.mapa-dropdown-tree--highlight .mat-form-field-outline .mat-form-field-outline-end{border-width:2px!important;border-color:#eedb2a!important}.mapa-dropdown-tree--highlight .mat-form-field-outline .mat-form-field-outline-start{display:none!important}.mapa-dropdown-tree--highlight .mat-form-field-outline .mat-form-field-outline-end{border-radius:16px!important;border-left-style:solid!important}.mapa-dropdown-tree--soft-border .mat-form-field-outline .mat-form-field-outline-start,.mapa-dropdown-tree--soft-border .mat-form-field-outline .mat-form-field-outline-end{border-width:1px!important}.mapa-dropdown-tree--tag .mat-form-field-outline{border-radius:16px!important;height:42px!important}.mapa-dropdown-tree--tag .mat-form-field-outline .mat-form-field-outline-start,.mapa-dropdown-tree--tag .mat-form-field-outline .mat-form-field-outline-end{border-width:1px!important;border-color:#cdcdcd}.mapa-dropdown-tree--tag .mat-form-field-outline .mat-form-field-outline-start{display:none!important}.mapa-dropdown-tree--tag .mat-form-field-outline .mat-form-field-outline-end{border-radius:16px!important;border-left-style:solid!important}.mapa-dropdown-tree .mat-form-field-outline{background-color:#fff;border-radius:8px}.mapa-dropdown-tree .mat-form-field-outline .mat-form-field-outline-start,.mapa-dropdown-tree .mat-form-field-outline .mat-form-field-outline-end{border-width:2px}.mapa-dropdown-tree .mat-form-field-wrapper{padding-bottom:unset!important}.mapa-dropdown-tree .mat-form-field-flex{display:flex;align-items:center;height:48px}.mapa-dropdown-tree .mat-form-field-infix{border-top:unset!important;padding:unset!important;position:relative}.mapa-dropdown-tree .mat-select-trigger{min-width:50px;padding-top:.3em;height:unset!important}.mapa-dropdown-tree .mat-select-value-text{display:block;width:90%}.mapa-dropdown-tree .mat-select-arrow-wrapper{transform:none!important}.mapa-dropdown-tree .mat-select-arrow{border:unset}.mapa-dropdown-tree .mat-select-arrow:before,.mapa-dropdown-tree .mat-select-arrow:after{content:\"\";display:block;margin-top:-4px;position:absolute;right:10px;top:50%;width:0;border:solid black;border-width:0 2px 2px 0;padding:3px;transform:rotate(45deg);-webkit-transform:rotate(45deg)}.mapa-dropdown-tree [aria-expanded=true] .mat-select-arrow{margin:6px 0 0}.mapa-dropdown-tree [aria-expanded=true] .mat-select-arrow:before,.mapa-dropdown-tree [aria-expanded=true] .mat-select-arrow:after{transform:rotate(-135deg)!important;-webkit-transform:rotate(-135deg)!important}.mapa-overlay-dropdown-tree .mat-checkbox-label{color:#77838f!important;font-size:16px!important;font-style:normal;font-weight:400}.mapa-overlay-dropdown-tree .mat-menu-panel{width:100%;max-width:none!important;overflow:hidden}.mapa-overlay-dropdown-tree .mat-input-element{font-family:Inter,sans-serif;font-size:14px}.mapa-overlay-dropdown-tree .mat-menu-content{padding-bottom:unset!important;padding-top:unset!important}.mapa-overlay-dropdown-tree .mat-tree{display:flex;gap:8px;flex-direction:column;max-height:260px;padding-bottom:24px;overflow-y:auto}.mapa-overlay-dropdown-tree .mat-tree-node{color:#50575e!important}.mapa-overlay-dropdown-tree ul{padding-inline-start:20px!important;margin-block-start:0px!important;margin-block-end:0px!important;gap:8px}.mapa-overlay-dropdown-tree .tree-toggle,.mapa-overlay-dropdown-tree .mat-tree .mat-focus-indicator{display:none}.mapa-overlay-dropdown-tree .mat-tree .mat-tree-node{min-height:28px!important;padding:4px 0;flex:unset!important}.mapa-overlay-dropdown-tree .mat-tree .mat-tree-node:hover{background:rgba(0,0,0,.04)}.mapa-overlay-dropdown-tree .mat-select-tree-hide{display:block!important}.mapa-overlay-dropdown-tree .mat-autocomplete-panel .mat-option{padding:unset!important}.mapa-overlay-dropdown-tree .mat-select-panel{border-radius:8px;min-width:calc(100% + 24px)!important}.mapa-overlay-dropdown-tree .mat-select-panel .mat-option,.mapa-overlay-dropdown-tree .mat-select-panel .mat-option-text{font-family:Inter,sans-serif!important;font-size:16px;font-style:normal;font-weight:400;line-height:2em;height:2em;color:#50575e}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option{display:flex;padding:16px 8px!important;flex-direction:column;justify-content:center;align-items:center;gap:10px;align-self:stretch;background:#f6f7f7;height:unset!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option .mat-select-search-inside-mat-option{height:unset!important;line-height:unset!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option .mat-select-search-clear{top:-3px!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option .mat-select-search-inner{top:8px;border:2px solid #a7aaad;border-radius:8px!important;width:100%!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option .mat-select-search-toggle-all-checkbox{padding-left:8px!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option .mat-select-search-input{padding:8px 8px 8px 6px!important;height:unset!important;line-height:unset!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search.mat-option .mat-select-search-input::placeholder{color:#c3c4c7!important}.mapa-overlay-dropdown-tree .mapa-dropdown__search .mat-option-text{width:100%}.mapa-overlay-dropdown-tree .mat-pseudo-checkbox{color:#c3c4c7!important}.mapa-overlay-dropdown-tree .mat-checkbox-frame{border-color:#c3c4c7!important}\n"] }]
|
|
633
655
|
}], ctorParameters: function () { return [{ type: ChecklistDatabase }]; }, propDecorators: { formGroup: [{
|
|
634
656
|
type: Input
|
|
635
657
|
}], element: [{
|
|
636
658
|
type: Input
|
|
637
659
|
}], autocomplete: [{
|
|
638
660
|
type: ViewChild,
|
|
639
|
-
args: [
|
|
661
|
+
args: ['auto']
|
|
640
662
|
}], tree: [{
|
|
641
663
|
type: ViewChild,
|
|
642
|
-
args: [
|
|
664
|
+
args: ['tree']
|
|
643
665
|
}], trigger: [{
|
|
644
666
|
type: ViewChild,
|
|
645
667
|
args: [MatMenuTrigger]
|
|
646
668
|
}], toggleAllCheckbox: [{
|
|
647
669
|
type: ViewChild,
|
|
648
|
-
args: [
|
|
670
|
+
args: ['toggleAllCheckbox']
|
|
649
671
|
}] } });
|
|
650
672
|
|
|
651
673
|
class MapaDropdownTreeModule {
|