@netgrif/components
Version:
Netgrif Application Engine frontend Angular components
27 lines • 8.99 kB
JavaScript
import { Component, Inject, Optional } from '@angular/core';
import { AbstractMultichoiceSelectFieldComponent, 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/core";
import * as i4 from "@angular/material/form-field";
import * as i5 from "@angular/material/select";
import * as i6 from "@angular/forms";
import * as i7 from "@ngx-translate/core";
export class MultichoiceSelectFieldComponent extends AbstractMultichoiceSelectFieldComponent {
constructor(dataFieldPortalData) {
super(dataFieldPortalData);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MultichoiceSelectFieldComponent, 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: MultichoiceSelectFieldComponent, selector: "nc-multichoice-select-field", usesInheritance: true, ngImport: i0, template: "<mat-form-field [appearance]=\"dataField.materialAppearance\" class=\"full-width\" color=\"primary\">\n <mat-label *ngIf=\"!showLargeLayout.value\">{{dataField.title}}</mat-label>\n <mat-select [placeholder]=\"dataField.placeholder\"\n [formControl]=\"formControlRef\"\n [required]=\"dataField.behavior.required\"\n multiple>\n <mat-option *ngFor=\"let option of dataField.choices\" [value]=\"option.key\">\n {{option.value}}\n </mat-option>\n </mat-select>\n <mat-hint [ngClass]=\"{'mat-hint-disabled': formControlRef.disabled}\">{{dataField.description}}</mat-hint>\n <mat-error *ngIf=\"dataField.isInvalid(formControlRef)\">{{'dataField.validations.required' | translate}}</mat-error>\n</mat-form-field>\n", styles: [".full-width{display:block;margin:0 auto;width:100%}\n"], 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: "component", type: i3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i6.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MultichoiceSelectFieldComponent, decorators: [{
type: Component,
args: [{ selector: 'nc-multichoice-select-field', template: "<mat-form-field [appearance]=\"dataField.materialAppearance\" class=\"full-width\" color=\"primary\">\n <mat-label *ngIf=\"!showLargeLayout.value\">{{dataField.title}}</mat-label>\n <mat-select [placeholder]=\"dataField.placeholder\"\n [formControl]=\"formControlRef\"\n [required]=\"dataField.behavior.required\"\n multiple>\n <mat-option *ngFor=\"let option of dataField.choices\" [value]=\"option.key\">\n {{option.value}}\n </mat-option>\n </mat-select>\n <mat-hint [ngClass]=\"{'mat-hint-disabled': formControlRef.disabled}\">{{dataField.description}}</mat-hint>\n <mat-error *ngIf=\"dataField.isInvalid(formControlRef)\">{{'dataField.validations.required' | translate}}</mat-error>\n</mat-form-field>\n", styles: [".full-width{display:block;margin:0 auto;width:100%}\n"] }]
}], ctorParameters: () => [{ type: undefined, decorators: [{
type: Optional
}, {
type: Inject,
args: [DATA_FIELD_PORTAL_DATA]
}] }] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibXVsdGljaG9pY2Utc2VsZWN0LWZpZWxkLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25ldGdyaWYtY29tcG9uZW50cy9zcmMvbGliL2RhdGEtZmllbGRzL211bHRpY2hvaWNlLWZpZWxkL211bHRpY2hvaWNlLXNlbGVjdC1maWVsZC9tdWx0aWNob2ljZS1zZWxlY3QtZmllbGQuY29tcG9uZW50LnRzIiwiLi4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