UNPKG

@netgrif/components

Version:

Netgrif Application Engine frontend Angular components

28 lines 8.79 kB
import { Component, Inject, Optional } from '@angular/core'; import { AbstractBooleanDefaultFieldComponent, DATA_FIELD_PORTAL_DATA, } from '@netgrif/components-core'; import * as i0 from "@angular/core"; import * as i1 from "@ngx-translate/core"; import * as i2 from "@angular/common"; import * as i3 from "@ngbracket/ngx-layout"; import * as i4 from "@ngbracket/ngx-layout/extended"; import * as i5 from "@angular/material/form-field"; import * as i6 from "@angular/material/slide-toggle"; import * as i7 from "@angular/forms"; import * as i8 from "../../required-label/required-label.component"; export class BooleanDefaultFieldComponent extends AbstractBooleanDefaultFieldComponent { constructor(_translate, dataFieldPortalData) { super(_translate, dataFieldPortalData); } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BooleanDefaultFieldComponent, deps: [{ token: i1.TranslateService }, { token: DATA_FIELD_PORTAL_DATA, optional: true }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: BooleanDefaultFieldComponent, selector: "nc-boolean-default-field", usesInheritance: true, ngImport: i0, template: "<div fxLayout=\"column\" class=\"min-height-62\">\n <mat-label class=\"netgrif-label\" [ngClass]=\"{'netgrif-label-disabled': formControlRef.disabled}\" *ngIf=\"!showLargeLayout.value && hasTitle()\">{{dataField.title}}\n <nc-required-label *ngIf=\"dataField.behavior.required\" [isIn]=\"true\"></nc-required-label>\n <br></mat-label>\n <mat-slide-toggle color=\"primary\" [formControl]=\"formControlRef\">\n {{createValueLabel()}}\n </mat-slide-toggle>\n <mat-hint [ngClass]=\"{'mat-hint-disabled': formControlRef.disabled}\" *ngIf=\"!dataField.isInvalid(formControlRef)\">{{dataField.description}}</mat-hint>\n <mat-error *ngIf=\"dataField.isInvalid(formControlRef)\">{{getErrorMessage()}}</mat-error>\n</div>\n", styles: ["mat-hint{display:block}.min-height-62{min-height:62px}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i4.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: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i5.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: i6.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "directive", type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i7.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i8.RequiredLabelComponent, selector: "nc-required-label", inputs: ["isIn"] }] }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BooleanDefaultFieldComponent, decorators: [{ type: Component, args: [{ selector: 'nc-boolean-default-field', template: "<div fxLayout=\"column\" class=\"min-height-62\">\n <mat-label class=\"netgrif-label\" [ngClass]=\"{'netgrif-label-disabled': formControlRef.disabled}\" *ngIf=\"!showLargeLayout.value && hasTitle()\">{{dataField.title}}\n <nc-required-label *ngIf=\"dataField.behavior.required\" [isIn]=\"true\"></nc-required-label>\n <br></mat-label>\n <mat-slide-toggle color=\"primary\" [formControl]=\"formControlRef\">\n {{createValueLabel()}}\n </mat-slide-toggle>\n <mat-hint [ngClass]=\"{'mat-hint-disabled': formControlRef.disabled}\" *ngIf=\"!dataField.isInvalid(formControlRef)\">{{dataField.description}}</mat-hint>\n <mat-error *ngIf=\"dataField.isInvalid(formControlRef)\">{{getErrorMessage()}}</mat-error>\n</div>\n", styles: ["mat-hint{display:block}.min-height-62{min-height:62px}\n"] }] }], ctorParameters: () => [{ type: i1.TranslateService }, { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DATA_FIELD_PORTAL_DATA] }] }] }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYm9vbGVhbi1kZWZhdWx0LWZpZWxkLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25ldGdyaWYtY29tcG9uZW50cy9zcmMvbGliL2RhdGEtZmllbGRzL2Jvb2xlYW4tZm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