UNPKG

@netgrif/components

Version:

Netgrif Application Engine frontend Angular components

27 lines 9.19 kB
import { Component, Inject, Optional } from '@angular/core'; import { AbstractMultichoiceListFieldComponent, DATA_FIELD_PORTAL_DATA } from '@netgrif/components-core'; import * as i0 from "@angular/core"; import * as i1 from "@angular/common"; import * as i2 from "@ngbracket/ngx-layout/extended"; import * as i3 from "@angular/material/form-field"; import * as i4 from "@angular/material/list"; import * as i5 from "@angular/forms"; import * as i6 from "../../required-label/required-label.component"; import * as i7 from "@ngx-translate/core"; export class MultichoiceListFieldComponent extends AbstractMultichoiceListFieldComponent { constructor(dataFieldPortalData) { super(dataFieldPortalData); } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MultichoiceListFieldComponent, deps: [{ token: DATA_FIELD_PORTAL_DATA, optional: true }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: MultichoiceListFieldComponent, selector: "nc-multichoice-list-field", usesInheritance: true, ngImport: i0, template: "<mat-selection-list color=\"primary\"\n [formControl]=\"formControlRef\"\n [required]=\"dataField.behavior.required\">\n <mat-label class=\"netgrif-label\" [ngClass]=\"{'netgrif-label-disabled': formControlRef.disabled}\" *ngIf=\"!showLargeLayout.value\">{{dataField.title}}\n <nc-required-label *ngIf=\"dataField.behavior.required\" [isIn]=\"true\"></nc-required-label>\n <br></mat-label>\n <mat-list-option checkboxPosition=\"before\" *ngFor=\"let option of dataField.choices\" [value]=\"option.key\">\n {{option.value}}\n </mat-list-option>\n <mat-hint [ngClass]=\"{'mat-hint-disabled': formControlRef.disabled}\" *ngIf=\"dataField.description !== undefined && dataField.description !== '' && !dataField.isInvalid(formControlRef)\">{{dataField.description}}</mat-hint>\n <mat-error *ngIf=\"dataField.isInvalid(formControlRef)\">{{'dataField.validations.required' | translate}}</mat-error>\n</mat-selection-list>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: i4.MatSelectionList, selector: "mat-selection-list", inputs: ["color", "compareWith", "multiple", "hideSingleSelectionIndicator", "disabled"], outputs: ["selectionChange"], exportAs: ["matSelectionList"] }, { kind: "component", type: i4.MatListOption, selector: "mat-list-option", inputs: ["togglePosition", "checkboxPosition", "color", "value", "selected"], outputs: ["selectedChange"], exportAs: ["matListOption"] }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i5.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i6.RequiredLabelComponent, selector: "nc-required-label", inputs: ["isIn"] }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }] }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MultichoiceListFieldComponent, decorators: [{ type: Component, args: [{ selector: 'nc-multichoice-list-field', template: "<mat-selection-list color=\"primary\"\n [formControl]=\"formControlRef\"\n [required]=\"dataField.behavior.required\">\n <mat-label class=\"netgrif-label\" [ngClass]=\"{'netgrif-label-disabled': formControlRef.disabled}\" *ngIf=\"!showLargeLayout.value\">{{dataField.title}}\n <nc-required-label *ngIf=\"dataField.behavior.required\" [isIn]=\"true\"></nc-required-label>\n <br></mat-label>\n <mat-list-option checkboxPosition=\"before\" *ngFor=\"let option of dataField.choices\" [value]=\"option.key\">\n {{option.value}}\n </mat-list-option>\n <mat-hint [ngClass]=\"{'mat-hint-disabled': formControlRef.disabled}\" *ngIf=\"dataField.description !== undefined && dataField.description !== '' && !dataField.isInvalid(formControlRef)\">{{dataField.description}}</mat-hint>\n <mat-error *ngIf=\"dataField.isInvalid(formControlRef)\">{{'dataField.validations.required' | translate}}</mat-error>\n</mat-selection-list>\n" }] }], ctorParameters: () => [{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DATA_FIELD_PORTAL_DATA] }] }] }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibXVsdGljaG9pY2UtbGlzdC1maWVsZC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZXRncmlmLWNvbXBvbmVudHMvc3JjL2xpYi9kYXRhLWZpZWxkcy9tdWx0aWNob2ljZS1maWVsZC9tdWx0aWNob2ljZS1saXN0LWZpZWxkL211bHRpY2hvaWNlLWxpc3QtZmllbGQuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmV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