UNPKG

@ajsf/material

Version:

Angular JSON Schema Form builder using Angular Material UI

829 lines (817 loc) 147 kB
import * as i0 from '@angular/core'; import { Component, ChangeDetectionStrategy, Input, Inject, Optional, Injectable, NgModule } from '@angular/core'; import * as i1 from '@ajsf/core'; import { hasOwn, buildTitleMap, isDefined, isArray, Framework, WidgetLibraryModule, JsonSchemaFormModule, JsonSchemaFormService, FrameworkLibraryService, WidgetLibraryService } from '@ajsf/core'; import * as i2 from '@angular/common'; import { CommonModule } from '@angular/common'; import * as i3 from '@angular/flex-layout/flex'; import * as i4 from '@angular/flex-layout/extended'; import * as i5 from '@angular/material/card'; import { MatCardModule } from '@angular/material/card'; import * as i6 from '@angular/material/expansion'; import { MatExpansionModule } from '@angular/material/expansion'; import * as i4$1 from '@angular/material/form-field'; import { MAT_FORM_FIELD_DEFAULT_OPTIONS, MatFormFieldModule } from '@angular/material/form-field'; import * as i3$1 from '@angular/material/button'; import { MatButtonModule } from '@angular/material/button'; import * as i4$2 from '@angular/material/icon'; import { MatIconModule } from '@angular/material/icon'; import * as i3$2 from '@angular/material/button-toggle'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; import * as i3$3 from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import * as i4$3 from '@angular/material/checkbox'; import { MatCheckboxModule } from '@angular/material/checkbox'; import * as i6$1 from '@angular/material/slide-toggle'; import { MatSlideToggleModule } from '@angular/material/slide-toggle'; import * as i4$4 from '@angular/material/datepicker'; import { MatDatepickerModule } from '@angular/material/datepicker'; import * as i5$1 from '@angular/material/input'; import { MatInputModule } from '@angular/material/input'; import cloneDeep from 'lodash/cloneDeep'; import * as i4$5 from '@angular/material/autocomplete'; import { MatAutocompleteModule } from '@angular/material/autocomplete'; import * as i4$6 from '@angular/material/core'; import { MatNativeDateModule } from '@angular/material/core'; import * as i5$2 from '@angular/material/radio'; import { MatRadioModule } from '@angular/material/radio'; import * as i6$2 from '@angular/material/select'; import { MatSelectModule } from '@angular/material/select'; import * as i5$3 from '@angular/material/slider'; import { MatSliderModule } from '@angular/material/slider'; import * as i3$4 from '@angular/material/tabs'; import { MatTabsModule } from '@angular/material/tabs'; import { FlexLayoutModule } from '@angular/flex-layout'; import { MatChipsModule } from '@angular/material/chips'; import { MatStepperModule } from '@angular/material/stepper'; import { MatTooltipModule } from '@angular/material/tooltip'; import { MatMenuModule } from '@angular/material/menu'; import { MatToolbarModule } from '@angular/material/toolbar'; import { MediaMarshaller } from '@angular/flex-layout/core'; class FlexLayoutRootComponent { constructor(jsf) { this.jsf = jsf; this.isFlexItem = false; } removeItem(item) { this.jsf.removeItem(item); } // Set attributes for flexbox child // (container attributes are set in flex-layout-section.component) getFlexAttribute(node, attribute) { const index = ['flex-grow', 'flex-shrink', 'flex-basis'].indexOf(attribute); return ((node.options || {}).flex || '').split(/\s+/)[index] || (node.options || {})[attribute] || ['1', '1', 'auto'][index]; } showWidget(layoutNode) { return this.jsf.evaluateCondition(layoutNode, this.dataIndex); } } FlexLayoutRootComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FlexLayoutRootComponent, deps: [{ token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); FlexLayoutRootComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: FlexLayoutRootComponent, selector: "flex-layout-root-widget", inputs: { dataIndex: "dataIndex", layoutIndex: "layoutIndex", layout: "layout", isFlexItem: "isFlexItem" }, ngImport: i0, template: ` <div *ngFor="let layoutNode of layout; let i = index" [class.form-flex-item]="isFlexItem" [style.flex-grow]="getFlexAttribute(layoutNode, 'flex-grow')" [style.flex-shrink]="getFlexAttribute(layoutNode, 'flex-shrink')" [style.flex-basis]="getFlexAttribute(layoutNode, 'flex-basis')" [style.align-self]="(layoutNode?.options || {})['align-self']" [style.order]="layoutNode?.options?.order" [fxFlex]="layoutNode?.options?.fxFlex" [fxFlexOrder]="layoutNode?.options?.fxFlexOrder" [fxFlexOffset]="layoutNode?.options?.fxFlexOffset" [fxFlexAlign]="layoutNode?.options?.fxFlexAlign"> <select-framework-widget *ngIf="showWidget(layoutNode)" [dataIndex]="layoutNode?.arrayItem ? (dataIndex || []).concat(i) : (dataIndex || [])" [layoutIndex]="(layoutIndex || []).concat(i)" [layoutNode]="layoutNode"></select-framework-widget> <div>`, isInline: true, dependencies: [{ 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: i3.DefaultFlexOrderDirective, selector: " [fxFlexOrder], [fxFlexOrder.xs], [fxFlexOrder.sm], [fxFlexOrder.md], [fxFlexOrder.lg], [fxFlexOrder.xl], [fxFlexOrder.lt-sm], [fxFlexOrder.lt-md], [fxFlexOrder.lt-lg], [fxFlexOrder.lt-xl], [fxFlexOrder.gt-xs], [fxFlexOrder.gt-sm], [fxFlexOrder.gt-md], [fxFlexOrder.gt-lg]", inputs: ["fxFlexOrder", "fxFlexOrder.xs", "fxFlexOrder.sm", "fxFlexOrder.md", "fxFlexOrder.lg", "fxFlexOrder.xl", "fxFlexOrder.lt-sm", "fxFlexOrder.lt-md", "fxFlexOrder.lt-lg", "fxFlexOrder.lt-xl", "fxFlexOrder.gt-xs", "fxFlexOrder.gt-sm", "fxFlexOrder.gt-md", "fxFlexOrder.gt-lg"] }, { kind: "directive", type: i3.DefaultFlexOffsetDirective, selector: " [fxFlexOffset], [fxFlexOffset.xs], [fxFlexOffset.sm], [fxFlexOffset.md], [fxFlexOffset.lg], [fxFlexOffset.xl], [fxFlexOffset.lt-sm], [fxFlexOffset.lt-md], [fxFlexOffset.lt-lg], [fxFlexOffset.lt-xl], [fxFlexOffset.gt-xs], [fxFlexOffset.gt-sm], [fxFlexOffset.gt-md], [fxFlexOffset.gt-lg]", inputs: ["fxFlexOffset", "fxFlexOffset.xs", "fxFlexOffset.sm", "fxFlexOffset.md", "fxFlexOffset.lg", "fxFlexOffset.xl", "fxFlexOffset.lt-sm", "fxFlexOffset.lt-md", "fxFlexOffset.lt-lg", "fxFlexOffset.lt-xl", "fxFlexOffset.gt-xs", "fxFlexOffset.gt-sm", "fxFlexOffset.gt-md", "fxFlexOffset.gt-lg"] }, { kind: "directive", type: i3.DefaultFlexAlignDirective, selector: " [fxFlexAlign], [fxFlexAlign.xs], [fxFlexAlign.sm], [fxFlexAlign.md], [fxFlexAlign.lg], [fxFlexAlign.xl], [fxFlexAlign.lt-sm], [fxFlexAlign.lt-md], [fxFlexAlign.lt-lg], [fxFlexAlign.lt-xl], [fxFlexAlign.gt-xs], [fxFlexAlign.gt-sm], [fxFlexAlign.gt-md], [fxFlexAlign.gt-lg]", inputs: ["fxFlexAlign", "fxFlexAlign.xs", "fxFlexAlign.sm", "fxFlexAlign.md", "fxFlexAlign.lg", "fxFlexAlign.xl", "fxFlexAlign.lt-sm", "fxFlexAlign.lt-md", "fxFlexAlign.lt-lg", "fxFlexAlign.lt-xl", "fxFlexAlign.gt-xs", "fxFlexAlign.gt-sm", "fxFlexAlign.gt-md", "fxFlexAlign.gt-lg"] }, { kind: "directive", type: i3.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: i1.SelectFrameworkComponent, selector: "select-framework-widget", inputs: ["layoutNode", "layoutIndex", "dataIndex"] }], changeDetection: i0.ChangeDetectionStrategy.Default }); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FlexLayoutRootComponent, decorators: [{ type: Component, args: [{ // tslint:disable-next-line:component-selector selector: 'flex-layout-root-widget', template: ` <div *ngFor="let layoutNode of layout; let i = index" [class.form-flex-item]="isFlexItem" [style.flex-grow]="getFlexAttribute(layoutNode, 'flex-grow')" [style.flex-shrink]="getFlexAttribute(layoutNode, 'flex-shrink')" [style.flex-basis]="getFlexAttribute(layoutNode, 'flex-basis')" [style.align-self]="(layoutNode?.options || {})['align-self']" [style.order]="layoutNode?.options?.order" [fxFlex]="layoutNode?.options?.fxFlex" [fxFlexOrder]="layoutNode?.options?.fxFlexOrder" [fxFlexOffset]="layoutNode?.options?.fxFlexOffset" [fxFlexAlign]="layoutNode?.options?.fxFlexAlign"> <select-framework-widget *ngIf="showWidget(layoutNode)" [dataIndex]="layoutNode?.arrayItem ? (dataIndex || []).concat(i) : (dataIndex || [])" [layoutIndex]="(layoutIndex || []).concat(i)" [layoutNode]="layoutNode"></select-framework-widget> <div>`, changeDetection: ChangeDetectionStrategy.Default, }] }], ctorParameters: function () { return [{ type: i1.JsonSchemaFormService }]; }, propDecorators: { dataIndex: [{ type: Input }], layoutIndex: [{ type: Input }], layout: [{ type: Input }], isFlexItem: [{ type: Input }] } }); class FlexLayoutSectionComponent { constructor(jsf) { this.jsf = jsf; this.controlDisabled = false; this.boundControl = false; this.expanded = true; this.containerType = 'div'; } get sectionTitle() { return this.options.notitle ? null : this.jsf.setItemTitle(this); } ngOnInit() { this.jsf.initializeControl(this); this.options = this.layoutNode.options || {}; this.expanded = typeof this.options.expanded === 'boolean' ? this.options.expanded : !this.options.expandable; switch (this.layoutNode.type) { case 'section': case 'array': case 'fieldset': case 'advancedfieldset': case 'authfieldset': case 'optionfieldset': case 'selectfieldset': this.containerType = 'fieldset'; break; case 'card': this.containerType = 'card'; break; case 'expansion-panel': this.containerType = 'expansion-panel'; break; default: // 'div', 'flex', 'tab', 'conditional', 'actions' this.containerType = 'div'; } } toggleExpanded() { if (this.options.expandable) { this.expanded = !this.expanded; } } // Set attributes for flexbox container // (child attributes are set in flex-layout-root.component) getFlexAttribute(attribute) { const flexActive = this.layoutNode.type === 'flex' || !!this.options.displayFlex || this.options.display === 'flex'; // if (attribute !== 'flex' && !flexActive) { return null; } switch (attribute) { case 'is-flex': return flexActive; case 'display': return flexActive ? 'flex' : 'initial'; case 'flex-direction': case 'flex-wrap': const index = ['flex-direction', 'flex-wrap'].indexOf(attribute); return (this.options['flex-flow'] || '').split(/\s+/)[index] || this.options[attribute] || ['column', 'nowrap'][index]; case 'justify-content': case 'align-items': case 'align-content': return this.options[attribute]; case 'layout': return (this.options.fxLayout || 'row') + this.options.fxLayoutWrap ? ' ' + this.options.fxLayoutWrap : ''; } } } FlexLayoutSectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FlexLayoutSectionComponent, deps: [{ token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); FlexLayoutSectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: FlexLayoutSectionComponent, selector: "flex-layout-section-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: ` <div *ngIf="containerType === 'div'" [class]="options?.htmlClass || ''" [class.expandable]="options?.expandable && !expanded" [class.expanded]="options?.expandable && expanded"> <label *ngIf="sectionTitle" [class]="'legend ' + (options?.labelHtmlClass || '')" [innerHTML]="sectionTitle" (click)="toggleExpanded()"></label> <flex-layout-root-widget *ngIf="expanded" [layout]="layoutNode.items" [dataIndex]="dataIndex" [layoutIndex]="layoutIndex" [isFlexItem]="getFlexAttribute('is-flex')" [class.form-flex-column]="getFlexAttribute('flex-direction') === 'column'" [class.form-flex-row]="getFlexAttribute('flex-direction') === 'row'" [style.display]="getFlexAttribute('display')" [style.flex-direction]="getFlexAttribute('flex-direction')" [style.flex-wrap]="getFlexAttribute('flex-wrap')" [style.justify-content]="getFlexAttribute('justify-content')" [style.align-items]="getFlexAttribute('align-items')" [style.align-content]="getFlexAttribute('align-content')" [fxLayout]="getFlexAttribute('layout')" [fxLayoutGap]="options?.fxLayoutGap" [fxLayoutAlign]="options?.fxLayoutAlign" [attr.fxFlexFill]="options?.fxLayoutAlign"></flex-layout-root-widget> <mat-error *ngIf="options?.showErrors && options?.errorMessage" [innerHTML]="options?.errorMessage"></mat-error> </div> <fieldset *ngIf="containerType === 'fieldset'" [class]="options?.htmlClass || ''" [class.expandable]="options?.expandable && !expanded" [class.expanded]="options?.expandable && expanded" [disabled]="options?.readonly"> <legend *ngIf="sectionTitle" [class]="'legend ' + (options?.labelHtmlClass || '')" [innerHTML]="sectionTitle" (click)="toggleExpanded()"></legend> <flex-layout-root-widget *ngIf="expanded" [layout]="layoutNode.items" [dataIndex]="dataIndex" [layoutIndex]="layoutIndex" [isFlexItem]="getFlexAttribute('is-flex')" [class.form-flex-column]="getFlexAttribute('flex-direction') === 'column'" [class.form-flex-row]="getFlexAttribute('flex-direction') === 'row'" [style.display]="getFlexAttribute('display')" [style.flex-direction]="getFlexAttribute('flex-direction')" [style.flex-wrap]="getFlexAttribute('flex-wrap')" [style.justify-content]="getFlexAttribute('justify-content')" [style.align-items]="getFlexAttribute('align-items')" [style.align-content]="getFlexAttribute('align-content')" [fxLayout]="getFlexAttribute('layout')" [fxLayoutGap]="options?.fxLayoutGap" [fxLayoutAlign]="options?.fxLayoutAlign" [attr.fxFlexFill]="options?.fxLayoutAlign"></flex-layout-root-widget> <mat-error *ngIf="options?.showErrors && options?.errorMessage" [innerHTML]="options?.errorMessage"></mat-error> </fieldset> <mat-card *ngIf="containerType === 'card'" [ngClass]="options?.htmlClass || ''" [class.expandable]="options?.expandable && !expanded" [class.expanded]="options?.expandable && expanded"> <mat-card-header *ngIf="sectionTitle"> <legend [class]="'legend ' + (options?.labelHtmlClass || '')" [innerHTML]="sectionTitle" (click)="toggleExpanded()"></legend> </mat-card-header> <mat-card-content *ngIf="expanded"> <fieldset [disabled]="options?.readonly"> <flex-layout-root-widget *ngIf="expanded" [layout]="layoutNode.items" [dataIndex]="dataIndex" [layoutIndex]="layoutIndex" [isFlexItem]="getFlexAttribute('is-flex')" [class.form-flex-column]="getFlexAttribute('flex-direction') === 'column'" [class.form-flex-row]="getFlexAttribute('flex-direction') === 'row'" [style.display]="getFlexAttribute('display')" [style.flex-direction]="getFlexAttribute('flex-direction')" [style.flex-wrap]="getFlexAttribute('flex-wrap')" [style.justify-content]="getFlexAttribute('justify-content')" [style.align-items]="getFlexAttribute('align-items')" [style.align-content]="getFlexAttribute('align-content')" [fxLayout]="getFlexAttribute('layout')" [fxLayoutGap]="options?.fxLayoutGap" [fxLayoutAlign]="options?.fxLayoutAlign" [attr.fxFlexFill]="options?.fxLayoutAlign"></flex-layout-root-widget> </fieldset> </mat-card-content> <mat-card-footer> <mat-error *ngIf="options?.showErrors && options?.errorMessage" [innerHTML]="options?.errorMessage"></mat-error> </mat-card-footer> </mat-card> <mat-expansion-panel *ngIf="containerType === 'expansion-panel'" [expanded]="expanded" [hideToggle]="!options?.expandable"> <mat-expansion-panel-header> <mat-panel-title> <legend *ngIf="sectionTitle" [class]="options?.labelHtmlClass" [innerHTML]="sectionTitle" (click)="toggleExpanded()"></legend> </mat-panel-title> </mat-expansion-panel-header> <fieldset [disabled]="options?.readonly"> <flex-layout-root-widget *ngIf="expanded" [layout]="layoutNode.items" [dataIndex]="dataIndex" [layoutIndex]="layoutIndex" [isFlexItem]="getFlexAttribute('is-flex')" [class.form-flex-column]="getFlexAttribute('flex-direction') === 'column'" [class.form-flex-row]="getFlexAttribute('flex-direction') === 'row'" [style.display]="getFlexAttribute('display')" [style.flex-direction]="getFlexAttribute('flex-direction')" [style.flex-wrap]="getFlexAttribute('flex-wrap')" [style.justify-content]="getFlexAttribute('justify-content')" [style.align-items]="getFlexAttribute('align-items')" [style.align-content]="getFlexAttribute('align-content')" [fxLayout]="getFlexAttribute('layout')" [fxLayoutGap]="options?.fxLayoutGap" [fxLayoutAlign]="options?.fxLayoutAlign" [attr.fxFlexFill]="options?.fxLayoutAlign"></flex-layout-root-widget> </fieldset> <mat-error *ngIf="options?.showErrors && options?.errorMessage" [innerHTML]="options?.errorMessage"></mat-error> </mat-expansion-panel>`, isInline: true, styles: ["fieldset{border:0;margin:0;padding:0}.legend{font-weight:700}.expandable>.legend:before{content:\"\\25b6\";padding-right:.3em}.expanded>.legend:before{content:\"\\25bc\";padding-right:.2em}\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: i3.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i3.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i3.FlexFillDirective, selector: "[fxFill], [fxFlexFill]" }, { 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: "component", type: i5.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { kind: "component", type: i5.MatCardHeader, selector: "mat-card-header" }, { kind: "directive", type: i5.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { kind: "directive", type: i5.MatCardFooter, selector: "mat-card-footer" }, { kind: "component", type: i6.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i6.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "directive", type: i6.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "directive", type: i4$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: FlexLayoutRootComponent, selector: "flex-layout-root-widget", inputs: ["dataIndex", "layoutIndex", "layout", "isFlexItem"] }] }); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: FlexLayoutSectionComponent, decorators: [{ type: Component, args: [{ selector: 'flex-layout-section-widget', template: ` <div *ngIf="containerType === 'div'" [class]="options?.htmlClass || ''" [class.expandable]="options?.expandable && !expanded" [class.expanded]="options?.expandable && expanded"> <label *ngIf="sectionTitle" [class]="'legend ' + (options?.labelHtmlClass || '')" [innerHTML]="sectionTitle" (click)="toggleExpanded()"></label> <flex-layout-root-widget *ngIf="expanded" [layout]="layoutNode.items" [dataIndex]="dataIndex" [layoutIndex]="layoutIndex" [isFlexItem]="getFlexAttribute('is-flex')" [class.form-flex-column]="getFlexAttribute('flex-direction') === 'column'" [class.form-flex-row]="getFlexAttribute('flex-direction') === 'row'" [style.display]="getFlexAttribute('display')" [style.flex-direction]="getFlexAttribute('flex-direction')" [style.flex-wrap]="getFlexAttribute('flex-wrap')" [style.justify-content]="getFlexAttribute('justify-content')" [style.align-items]="getFlexAttribute('align-items')" [style.align-content]="getFlexAttribute('align-content')" [fxLayout]="getFlexAttribute('layout')" [fxLayoutGap]="options?.fxLayoutGap" [fxLayoutAlign]="options?.fxLayoutAlign" [attr.fxFlexFill]="options?.fxLayoutAlign"></flex-layout-root-widget> <mat-error *ngIf="options?.showErrors && options?.errorMessage" [innerHTML]="options?.errorMessage"></mat-error> </div> <fieldset *ngIf="containerType === 'fieldset'" [class]="options?.htmlClass || ''" [class.expandable]="options?.expandable && !expanded" [class.expanded]="options?.expandable && expanded" [disabled]="options?.readonly"> <legend *ngIf="sectionTitle" [class]="'legend ' + (options?.labelHtmlClass || '')" [innerHTML]="sectionTitle" (click)="toggleExpanded()"></legend> <flex-layout-root-widget *ngIf="expanded" [layout]="layoutNode.items" [dataIndex]="dataIndex" [layoutIndex]="layoutIndex" [isFlexItem]="getFlexAttribute('is-flex')" [class.form-flex-column]="getFlexAttribute('flex-direction') === 'column'" [class.form-flex-row]="getFlexAttribute('flex-direction') === 'row'" [style.display]="getFlexAttribute('display')" [style.flex-direction]="getFlexAttribute('flex-direction')" [style.flex-wrap]="getFlexAttribute('flex-wrap')" [style.justify-content]="getFlexAttribute('justify-content')" [style.align-items]="getFlexAttribute('align-items')" [style.align-content]="getFlexAttribute('align-content')" [fxLayout]="getFlexAttribute('layout')" [fxLayoutGap]="options?.fxLayoutGap" [fxLayoutAlign]="options?.fxLayoutAlign" [attr.fxFlexFill]="options?.fxLayoutAlign"></flex-layout-root-widget> <mat-error *ngIf="options?.showErrors && options?.errorMessage" [innerHTML]="options?.errorMessage"></mat-error> </fieldset> <mat-card *ngIf="containerType === 'card'" [ngClass]="options?.htmlClass || ''" [class.expandable]="options?.expandable && !expanded" [class.expanded]="options?.expandable && expanded"> <mat-card-header *ngIf="sectionTitle"> <legend [class]="'legend ' + (options?.labelHtmlClass || '')" [innerHTML]="sectionTitle" (click)="toggleExpanded()"></legend> </mat-card-header> <mat-card-content *ngIf="expanded"> <fieldset [disabled]="options?.readonly"> <flex-layout-root-widget *ngIf="expanded" [layout]="layoutNode.items" [dataIndex]="dataIndex" [layoutIndex]="layoutIndex" [isFlexItem]="getFlexAttribute('is-flex')" [class.form-flex-column]="getFlexAttribute('flex-direction') === 'column'" [class.form-flex-row]="getFlexAttribute('flex-direction') === 'row'" [style.display]="getFlexAttribute('display')" [style.flex-direction]="getFlexAttribute('flex-direction')" [style.flex-wrap]="getFlexAttribute('flex-wrap')" [style.justify-content]="getFlexAttribute('justify-content')" [style.align-items]="getFlexAttribute('align-items')" [style.align-content]="getFlexAttribute('align-content')" [fxLayout]="getFlexAttribute('layout')" [fxLayoutGap]="options?.fxLayoutGap" [fxLayoutAlign]="options?.fxLayoutAlign" [attr.fxFlexFill]="options?.fxLayoutAlign"></flex-layout-root-widget> </fieldset> </mat-card-content> <mat-card-footer> <mat-error *ngIf="options?.showErrors && options?.errorMessage" [innerHTML]="options?.errorMessage"></mat-error> </mat-card-footer> </mat-card> <mat-expansion-panel *ngIf="containerType === 'expansion-panel'" [expanded]="expanded" [hideToggle]="!options?.expandable"> <mat-expansion-panel-header> <mat-panel-title> <legend *ngIf="sectionTitle" [class]="options?.labelHtmlClass" [innerHTML]="sectionTitle" (click)="toggleExpanded()"></legend> </mat-panel-title> </mat-expansion-panel-header> <fieldset [disabled]="options?.readonly"> <flex-layout-root-widget *ngIf="expanded" [layout]="layoutNode.items" [dataIndex]="dataIndex" [layoutIndex]="layoutIndex" [isFlexItem]="getFlexAttribute('is-flex')" [class.form-flex-column]="getFlexAttribute('flex-direction') === 'column'" [class.form-flex-row]="getFlexAttribute('flex-direction') === 'row'" [style.display]="getFlexAttribute('display')" [style.flex-direction]="getFlexAttribute('flex-direction')" [style.flex-wrap]="getFlexAttribute('flex-wrap')" [style.justify-content]="getFlexAttribute('justify-content')" [style.align-items]="getFlexAttribute('align-items')" [style.align-content]="getFlexAttribute('align-content')" [fxLayout]="getFlexAttribute('layout')" [fxLayoutGap]="options?.fxLayoutGap" [fxLayoutAlign]="options?.fxLayoutAlign" [attr.fxFlexFill]="options?.fxLayoutAlign"></flex-layout-root-widget> </fieldset> <mat-error *ngIf="options?.showErrors && options?.errorMessage" [innerHTML]="options?.errorMessage"></mat-error> </mat-expansion-panel>`, styles: ["fieldset{border:0;margin:0;padding:0}.legend{font-weight:700}.expandable>.legend:before{content:\"\\25b6\";padding-right:.3em}.expanded>.legend:before{content:\"\\25bc\";padding-right:.2em}\n"] }] }], ctorParameters: function () { return [{ type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{ type: Input }], layoutIndex: [{ type: Input }], dataIndex: [{ type: Input }] } }); class MaterialAddReferenceComponent { constructor(jsf) { this.jsf = jsf; } ngOnInit() { this.options = this.layoutNode.options || {}; } get showAddButton() { return !this.layoutNode.arrayItem || this.layoutIndex[this.layoutIndex.length - 1] < this.options.maxItems; } addItem(event) { event.preventDefault(); this.jsf.addItem(this); } get buttonText() { const parent = { dataIndex: this.dataIndex.slice(0, -1), layoutIndex: this.layoutIndex.slice(0, -1), layoutNode: this.jsf.getParentNode(this), }; return parent.layoutNode.add || this.jsf.setArrayItemTitle(parent, this.layoutNode, this.itemCount); } } MaterialAddReferenceComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialAddReferenceComponent, deps: [{ token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); MaterialAddReferenceComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialAddReferenceComponent, selector: "material-add-reference-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: ` <section [class]="options?.htmlClass || ''" align="end"> <button mat-raised-button *ngIf="showAddButton" [color]="options?.color || 'accent'" [disabled]="options?.readonly" (click)="addItem($event)"> <span *ngIf="options?.icon" [class]="options?.icon"></span> <span *ngIf="options?.title" [innerHTML]="buttonText"></span> </button> </section>`, isInline: true, dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$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"] }], changeDetection: i0.ChangeDetectionStrategy.Default }); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialAddReferenceComponent, decorators: [{ type: Component, args: [{ // tslint:disable-next-line:component-selector selector: 'material-add-reference-widget', template: ` <section [class]="options?.htmlClass || ''" align="end"> <button mat-raised-button *ngIf="showAddButton" [color]="options?.color || 'accent'" [disabled]="options?.readonly" (click)="addItem($event)"> <span *ngIf="options?.icon" [class]="options?.icon"></span> <span *ngIf="options?.title" [innerHTML]="buttonText"></span> </button> </section>`, changeDetection: ChangeDetectionStrategy.Default, }] }], ctorParameters: function () { return [{ type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{ type: Input }], layoutIndex: [{ type: Input }], dataIndex: [{ type: Input }] } }); class MaterialButtonComponent { constructor(jsf) { this.jsf = jsf; this.controlDisabled = false; this.boundControl = false; } ngOnInit() { this.options = this.layoutNode.options || {}; this.jsf.initializeControl(this); if (hasOwn(this.options, 'disabled')) { this.controlDisabled = this.options.disabled; } else if (this.jsf.formOptions.disableInvalidSubmit) { this.controlDisabled = !this.jsf.isValid; this.jsf.isValidChanges.subscribe(isValid => this.controlDisabled = !isValid); } } updateValue(event) { if (typeof this.options.onClick === 'function') { this.options.onClick(event); } else { this.jsf.updateValue(this, event.target.value); } } } MaterialButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialButtonComponent, deps: [{ token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); MaterialButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialButtonComponent, selector: "material-button-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: ` <div class="button-row" [class]="options?.htmlClass || ''"> <button mat-raised-button [attr.readonly]="options?.readonly ? 'readonly' : null" [attr.aria-describedby]="'control' + layoutNode?._id + 'Status'" [color]="options?.color || 'primary'" [disabled]="controlDisabled || options?.readonly" [id]="'control' + layoutNode?._id" [name]="controlName" [type]="layoutNode?.type" [value]="controlValue" (click)="updateValue($event)"> <mat-icon *ngIf="options?.icon" class="mat-24">{{options?.icon}}</mat-icon> <span *ngIf="options?.title" [innerHTML]="options?.title"></span> </button> </div>`, isInline: true, styles: ["button{margin-top:10px}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$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$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialButtonComponent, decorators: [{ type: Component, args: [{ selector: 'material-button-widget', template: ` <div class="button-row" [class]="options?.htmlClass || ''"> <button mat-raised-button [attr.readonly]="options?.readonly ? 'readonly' : null" [attr.aria-describedby]="'control' + layoutNode?._id + 'Status'" [color]="options?.color || 'primary'" [disabled]="controlDisabled || options?.readonly" [id]="'control' + layoutNode?._id" [name]="controlName" [type]="layoutNode?.type" [value]="controlValue" (click)="updateValue($event)"> <mat-icon *ngIf="options?.icon" class="mat-24">{{options?.icon}}</mat-icon> <span *ngIf="options?.title" [innerHTML]="options?.title"></span> </button> </div>`, styles: ["button{margin-top:10px}\n"] }] }], ctorParameters: function () { return [{ type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{ type: Input }], layoutIndex: [{ type: Input }], dataIndex: [{ type: Input }] } }); class MaterialButtonGroupComponent { constructor(jsf) { this.jsf = jsf; this.controlDisabled = false; this.boundControl = false; this.radiosList = []; this.vertical = false; } ngOnInit() { this.options = this.layoutNode.options || {}; this.radiosList = buildTitleMap(this.options.titleMap || this.options.enumNames, this.options.enum, true); this.jsf.initializeControl(this); } updateValue(value) { this.options.showErrors = true; this.jsf.updateValue(this, value); } } MaterialButtonGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialButtonGroupComponent, deps: [{ token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); MaterialButtonGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialButtonGroupComponent, selector: "material-button-group-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: ` <div> <div *ngIf="options?.title"> <label [attr.for]="'control' + layoutNode?._id" [class]="options?.labelHtmlClass || ''" [style.display]="options?.notitle ? 'none' : ''" [innerHTML]="options?.title"></label> </div> <mat-button-toggle-group [attr.aria-describedby]="'control' + layoutNode?._id + 'Status'" [attr.readonly]="options?.readonly ? 'readonly' : null" [attr.required]="options?.required" [disabled]="controlDisabled || options?.readonly" [name]="controlName" [value]="controlValue" [vertical]="!!options.vertical"> <mat-button-toggle *ngFor="let radioItem of radiosList" [id]="'control' + layoutNode?._id + '/' + radioItem?.name" [value]="radioItem?.value" (click)="updateValue(radioItem?.value)"> <span [innerHTML]="radioItem?.name"></span> </mat-button-toggle> </mat-button-toggle-group> <mat-error *ngIf="options?.showErrors && options?.errorMessage" [innerHTML]="options?.errorMessage"></mat-error> </div>`, isInline: true, styles: ["mat-error{font-size:75%}\n"], dependencies: [{ 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: i3$2.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i3$2.MatButtonToggle, selector: "mat-button-toggle", inputs: ["disableRipple", "aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "appearance", "checked", "disabled"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "directive", type: i4$1.MatError, selector: "mat-error", inputs: ["id"] }] }); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialButtonGroupComponent, decorators: [{ type: Component, args: [{ selector: 'material-button-group-widget', template: ` <div> <div *ngIf="options?.title"> <label [attr.for]="'control' + layoutNode?._id" [class]="options?.labelHtmlClass || ''" [style.display]="options?.notitle ? 'none' : ''" [innerHTML]="options?.title"></label> </div> <mat-button-toggle-group [attr.aria-describedby]="'control' + layoutNode?._id + 'Status'" [attr.readonly]="options?.readonly ? 'readonly' : null" [attr.required]="options?.required" [disabled]="controlDisabled || options?.readonly" [name]="controlName" [value]="controlValue" [vertical]="!!options.vertical"> <mat-button-toggle *ngFor="let radioItem of radiosList" [id]="'control' + layoutNode?._id + '/' + radioItem?.name" [value]="radioItem?.value" (click)="updateValue(radioItem?.value)"> <span [innerHTML]="radioItem?.name"></span> </mat-button-toggle> </mat-button-toggle-group> <mat-error *ngIf="options?.showErrors && options?.errorMessage" [innerHTML]="options?.errorMessage"></mat-error> </div>`, styles: ["mat-error{font-size:75%}\n"] }] }], ctorParameters: function () { return [{ type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{ type: Input }], layoutIndex: [{ type: Input }], dataIndex: [{ type: Input }] } }); class MaterialCheckboxComponent { constructor(jsf) { this.jsf = jsf; this.controlDisabled = false; this.boundControl = false; this.trueValue = true; this.falseValue = false; this.showSlideToggle = false; } ngOnInit() { this.options = this.layoutNode.options || {}; this.jsf.initializeControl(this, !this.options.readonly); if (this.controlValue === null || this.controlValue === undefined) { this.controlValue = false; this.jsf.updateValue(this, this.falseValue); } if (this.layoutNode.type === 'slide-toggle' || this.layoutNode.format === 'slide-toggle') { this.showSlideToggle = true; } } updateValue(event) { this.options.showErrors = true; this.jsf.updateValue(this, event.checked ? this.trueValue : this.falseValue); } get isChecked() { return this.jsf.getFormControlValue(this) === this.trueValue; } } MaterialCheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialCheckboxComponent, deps: [{ token: i1.JsonSchemaFormService }], target: i0.ɵɵFactoryTarget.Component }); MaterialCheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: MaterialCheckboxComponent, selector: "material-checkbox-widget", inputs: { layoutNode: "layoutNode", layoutIndex: "layoutIndex", dataIndex: "dataIndex" }, ngImport: i0, template: ` <mat-checkbox *ngIf="boundControl && !showSlideToggle" [formControl]="formControl" align="left" [color]="options?.color || 'primary'" [id]="'control' + layoutNode?._id" labelPosition="after" [name]="controlName" (blur)="options.showErrors = true"> <span *ngIf="options?.title" class="checkbox-name" [style.display]="options?.notitle ? 'none' : ''" [innerHTML]="options?.title"></span> </mat-checkbox> <mat-checkbox *ngIf="!boundControl && !showSlideToggle" align="left" [color]="options?.color || 'primary'" [disabled]="controlDisabled || options?.readonly" [id]="'control' + layoutNode?._id" labelPosition="after" [name]="controlName" [checked]="isChecked" (blur)="options.showErrors = true" (change)="updateValue($event)"> <span *ngIf="options?.title" class="checkbox-name" [style.display]="options?.notitle ? 'none' : ''" [innerHTML]="options?.title"></span> </mat-checkbox> <mat-slide-toggle *ngIf="boundControl && showSlideToggle" [formControl]="formControl" align="left" [color]="options?.color || 'primary'" [id]="'control' + layoutNode?._id" labelPosition="after" [name]="controlName" (blur)="options.showErrors = true"> <span *ngIf="options?.title" class="checkbox-name" [style.display]="options?.notitle ? 'none' : ''" [innerHTML]="options?.title"></span> </mat-slide-toggle> <mat-slide-toggle *ngIf="!boundControl && showSlideToggle" align="left" [color]="options?.color || 'primary'" [disabled]="controlDisabled || options?.readonly" [id]="'control' + layoutNode?._id" labelPosition="after" [name]="controlName" [checked]="isChecked" (blur)="options.showErrors = true" (change)="updateValue($event)"> <span *ngIf="options?.title" class="checkbox-name" [style.display]="options?.notitle ? 'none' : ''" [innerHTML]="options?.title"></span> </mat-slide-toggle> <mat-error *ngIf="options?.showErrors && options?.errorMessage" [innerHTML]="options?.errorMessage"></mat-error>`, isInline: true, styles: [".checkbox-name{white-space:nowrap}mat-error{font-size:75%}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i4$3.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i4$1.MatError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i6$1.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matSlideToggle"] }] }); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: MaterialCheckboxComponent, decorators: [{ type: Component, args: [{ selector: 'material-checkbox-widget', template: ` <mat-checkbox *ngIf="boundControl && !showSlideToggle" [formControl]="formControl" align="left" [color]="options?.color || 'primary'" [id]="'control' + layoutNode?._id" labelPosition="after" [name]="controlName" (blur)="options.showErrors = true"> <span *ngIf="options?.title" class="checkbox-name" [style.display]="options?.notitle ? 'none' : ''" [innerHTML]="options?.title"></span> </mat-checkbox> <mat-checkbox *ngIf="!boundControl && !showSlideToggle" align="left" [color]="options?.color || 'primary'" [disabled]="controlDisabled || options?.readonly" [id]="'control' + layoutNode?._id" labelPosition="after" [name]="controlName" [checked]="isChecked" (blur)="options.showErrors = true" (change)="updateValue($event)"> <span *ngIf="options?.title" class="checkbox-name" [style.display]="options?.notitle ? 'none' : ''" [innerHTML]="options?.title"></span> </mat-checkbox> <mat-slide-toggle *ngIf="boundControl && showSlideToggle" [formControl]="formControl" align="left" [color]="options?.color || 'primary'" [id]="'control' + layoutNode?._id" labelPosition="after" [name]="controlName" (blur)="options.showErrors = true"> <span *ngIf="options?.title" class="checkbox-name" [style.display]="options?.notitle ? 'none' : ''" [innerHTML]="options?.title"></span> </mat-slide-toggle> <mat-slide-toggle *ngIf="!boundControl && showSlideToggle" align="left" [color]="options?.color || 'primary'" [disabled]="controlDisabled || options?.readonly" [id]="'control' + layoutNode?._id" labelPosition="after" [name]="controlName" [checked]="isChecked" (blur)="options.showErrors = true" (change)="updateValue($event)"> <span *ngIf="options?.title" class="checkbox-name" [style.display]="options?.notitle ? 'none' : ''" [innerHTML]="options?.title"></span> </mat-slide-toggle> <mat-error *ngIf="options?.showErrors && options?.errorMessage" [innerHTML]="options?.errorMessage"></mat-error>`, styles: [".checkbox-name{white-space:nowrap}mat-error{font-size:75%}\n"] }] }], ctorParameters: function () { return [{ type: i1.JsonSchemaFormService }]; }, propDecorators: { layoutNode: [{ type: Input }], layoutIndex: [{ type: Input }],