@jsonforms/angular-material
Version:
Material Renderer Set for Angular module of JSON Forms
2,837 lines • 152 kB
JavaScript
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i2$1 from '@angular/forms';
import { ReactiveFormsModule } from '@angular/forms';
import * as i5$1 from '@angular/material/autocomplete';
import { MatAutocompleteModule } from '@angular/material/autocomplete';
import * as i4$1 from '@angular/material/button';
import { MatButtonModule } from '@angular/material/button';
import * as i6$1 from '@angular/material/badge';
import { MatBadgeModule } from '@angular/material/badge';
import * as i3$2 from '@angular/material/card';
import { MatCardModule } from '@angular/material/card';
import * as i2 from '@angular/material/checkbox';
import { MatCheckboxModule } from '@angular/material/checkbox';
import * as i5 from '@angular/material/datepicker';
import { MatDatepickerModule } from '@angular/material/datepicker';
import * as i3 from '@angular/material/form-field';
import { MatFormFieldModule } from '@angular/material/form-field';
import * as i6 from '@angular/material/tooltip';
import { MatTooltipModule } from '@angular/material/tooltip';
import * as i5$2 from '@angular/material/icon';
import { MatIconModule } from '@angular/material/icon';
import * as i4 from '@angular/material/input';
import { MatInputModule } from '@angular/material/input';
import * as i3$1 from '@angular/material/list';
import { MatListModule } from '@angular/material/list';
import { NativeDateAdapter, MAT_DATE_FORMATS, DateAdapter, MatNativeDateModule } from '@angular/material/core';
import { MatSelectModule } from '@angular/material/select';
import * as i2$5 from '@angular/material/sidenav';
import { MatSidenavModule } from '@angular/material/sidenav';
import * as i2$2 from '@angular/material/slider';
import { MatSliderModule } from '@angular/material/slider';
import * as i2$3 from '@angular/material/slide-toggle';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import * as i3$3 from '@angular/material/table';
import { MatTableModule } from '@angular/material/table';
import * as i3$4 from '@angular/material/tabs';
import { MatTabsModule } from '@angular/material/tabs';
import { MatToolbarModule } from '@angular/material/toolbar';
import * as i0 from '@angular/core';
import { inject, ChangeDetectorRef, ChangeDetectionStrategy, Component, Injectable, ViewEncapsulation, Input, Pipe, CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import * as i2$4 from '@jsonforms/angular';
import { JsonFormsControl, JsonFormsBaseRenderer, JsonFormsAngularService, JsonFormsModule, JsonFormsArrayControl, JsonFormsControlWithDetail, JsonFormsAbstractControl } from '@jsonforms/angular';
import { rankWith, isBooleanControl, defaultDateFormat, isDateControl, mapStateToOneOfEnumControlProps, Actions, composeWithUi, isOneOfEnumControl, mapStateToEnumControlProps, isEnumControl, isNumberControl, or, isIntegerControl, isRangeControl, isMultiLineControl, isStringControl, and, optionIs, mapStateToLabelProps, uiTypeIs, decode, mapDispatchToArrayControlProps, findUISchema, setReadonly, getFirstPrimitiveProp, createDefaultValue, mapStateToArrayControlProps, defaultJsonFormsI18nState, getArrayTranslations, arrayDefaultTranslations, Generate, isObjectControl, Paths, encode, deriveTypes, isObjectArrayControl, isPrimitiveArrayControl, mapStateToLayoutProps, isVisible, getAjv, getConfig, deriveLabelForUISchemaElement, categorizationHasCategory, mapStateToArrayLayoutProps, unsetReadonly, isObjectArrayWithNesting } from '@jsonforms/core';
import dayjs from 'dayjs';
import customParsing from 'dayjs/plugin/customParseFormat';
import { startWith, map } from 'rxjs/operators';
import merge from 'lodash/merge';
import some from 'lodash/some';
import get from 'lodash/get';
import isEmpty from 'lodash/isEmpty';
import startCase from 'lodash/startCase';
import cloneDeep from 'lodash/cloneDeep';
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
class BooleanControlRenderer extends JsonFormsControl {
changeDetectionRef = inject(ChangeDetectorRef);
isChecked = () => this.data || false;
getEventValue = (event) => event.checked;
mapAdditionalProps() {
if (!this.changeDetectionRef.destroyed) {
this.changeDetectionRef.markForCheck();
}
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: BooleanControlRenderer, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: BooleanControlRenderer, isStandalone: true, selector: "BooleanControlRenderer", usesInheritance: true, ngImport: i0, template: `
<div [ngStyle]="{ display: hidden ? 'none' : '' }" class="boolean-control">
<mat-checkbox
(change)="onChange($event)"
[checked]="isChecked()"
[disabled]="!isEnabled()"
[id]="id"
>
{{ label }}
</mat-checkbox>
<mat-hint class="mat-caption" *ngIf="shouldShowUnfocusedDescription()">{{
description
}}</mat-hint>
<mat-error class="mat-caption">{{ error }}</mat-error>
</div>
`, isInline: true, styles: [":host{display:flex;flex-direction:row}.boolean-control{flex:1 1 auto;display:flex;flex-direction:column;justify-content:center;height:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: BooleanControlRenderer, decorators: [{
type: Component,
args: [{ selector: 'BooleanControlRenderer', template: `
<div [ngStyle]="{ display: hidden ? 'none' : '' }" class="boolean-control">
<mat-checkbox
(change)="onChange($event)"
[checked]="isChecked()"
[disabled]="!isEnabled()"
[id]="id"
>
{{ label }}
</mat-checkbox>
<mat-hint class="mat-caption" *ngIf="shouldShowUnfocusedDescription()">{{
description
}}</mat-hint>
<mat-error class="mat-caption">{{ error }}</mat-error>
</div>
`, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, MatCheckboxModule, MatFormFieldModule], styles: [":host{display:flex;flex-direction:row}.boolean-control{flex:1 1 auto;display:flex;flex-direction:column;justify-content:center;height:100%}\n"] }]
}] });
const booleanControlTester = rankWith(2, isBooleanControl);
class MyFormat {
displayFormat = 'M/D/YYYY';
setDisplayFormat(displayFormat) {
this.displayFormat = displayFormat;
}
get display() {
return {
monthYearLabel: 'YYYY-MM',
dateA11yLabel: 'YYYY-MM-DD',
monthYearA11yLabel: 'YYYY-MM',
dateInput: this.displayFormat,
};
}
get parse() {
return {
dateInput: this.displayFormat,
};
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: MyFormat, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: MyFormat });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: MyFormat, decorators: [{
type: Injectable
}] });
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
// allows to parse date strings with custom format
dayjs.extend(customParsing);
/**
* date adapter for dayjs to parse and format dates
*/
class DayJsDateAdapter extends NativeDateAdapter {
saveFormat = defaultDateFormat;
setSaveFormat(format) {
this.saveFormat = format;
}
/**
* parses a given data prop string in the save-format into a date object
* @param value date string to be parsed
* @returns date object or null if parsing failed
*/
parseSaveFormat(value) {
return this.parse(value, this.saveFormat);
}
parse(value, format) {
if (!value) {
return null;
}
const date = dayjs(value, format);
if (date.isValid()) {
return date.toDate();
}
else {
return null;
}
}
toSaveFormat(value) {
if (!value) {
return undefined;
}
const date = dayjs(value);
if (date.isValid()) {
return date.format(this.saveFormat);
}
else {
return undefined;
}
}
/**
* transforms the date to a string representation for display
* @param date date to be formatted
* @param displayFormat format to be used for formatting the date e.g. YYYY-MM-DD
* @returns string representation of the date
*/
format(date, displayFormat) {
return dayjs(date).format(displayFormat);
}
deserialize(value) {
if (!value) {
return null;
}
const date = dayjs(value);
if (date.isValid()) {
return date.toDate();
}
else {
return null;
}
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: DayJsDateAdapter, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: DayJsDateAdapter });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: DayJsDateAdapter, decorators: [{
type: Injectable
}] });
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
class DateControlRenderer extends JsonFormsControl {
focused = false;
views = [];
startView = '';
panelClass = '';
dateFormat = inject(MAT_DATE_FORMATS);
dateAdapter = inject(DateAdapter);
getEventValue = (event) => {
const value = event.value ? event.value : event;
return this.dateAdapter.toSaveFormat(value);
};
mapToProps(state) {
const props = super.mapToProps(state);
const saveFormat = this.uischema?.options?.dateSaveFormat
? this.uischema.options.dateSaveFormat
: defaultDateFormat;
this.views = this.uischema?.options?.views
? this.uischema.options.views
: ['year', 'month', 'day'];
this.setViewProperties();
const dateFormat = this.uischema?.options?.dateFormat;
if (dateFormat) {
this.dateFormat.setDisplayFormat(dateFormat);
}
this.dateAdapter.setSaveFormat(saveFormat);
if (this.jsonFormsService.getLocale()) {
this.dateAdapter.setLocale(this.jsonFormsService.getLocale());
}
const date = this.dateAdapter.parseSaveFormat(props.data);
return { ...props, data: date };
}
yearSelected($event, datepicker) {
if (!this.views.includes('day') && !this.views.includes('month')) {
this.onChange($event);
datepicker.close();
}
}
monthSelected($event, datepicker) {
if (!this.views.includes('day')) {
this.onChange($event);
datepicker.close();
}
}
setViewProperties() {
if (!this.views.includes('day')) {
this.startView = 'multi-year';
this.panelClass = 'no-panel-navigation';
}
else {
this.startView = 'month';
}
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: DateControlRenderer, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: DateControlRenderer, isStandalone: true, selector: "DateControlRenderer", providers: [
{
provide: DateAdapter,
useClass: DayJsDateAdapter,
},
{
provide: MAT_DATE_FORMATS,
useClass: MyFormat,
},
], usesInheritance: true, ngImport: i0, template: `
<mat-form-field
class="date-control-renderer"
[ngStyle]="{ display: hidden ? 'none' : '' }"
>
<mat-label>{{ label }}</mat-label>
<input
matInput
(dateChange)="onChange($event)"
[id]="id"
[formControl]="form"
[matDatepicker]="datepicker"
(focus)="focused = true"
(focusout)="focused = false"
/>
<mat-datepicker-toggle
matSuffix
[for]="datepicker"
></mat-datepicker-toggle>
<mat-datepicker
#datepicker
(monthSelected)="monthSelected($event, datepicker)"
(yearSelected)="yearSelected($event, datepicker)"
[startView]="startView"
[panelClass]="panelClass"
></mat-datepicker>
<mat-hint *ngIf="shouldShowUnfocusedDescription() || focused">{{
description
}}</mat-hint>
<mat-error>{{ error }}</mat-error>
</mat-form-field>
`, isInline: true, styles: ["DateControlRenderer{display:flex;flex-direction:row}.date-control-renderer{flex:1 1 auto}.no-panel-navigation .mat-calendar-period-button{pointer-events:none}.no-panel-navigation .mat-calendar-arrow{display:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.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: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { 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: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i5.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i5.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i5.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: DateControlRenderer, decorators: [{
type: Component,
args: [{ selector: 'DateControlRenderer', template: `
<mat-form-field
class="date-control-renderer"
[ngStyle]="{ display: hidden ? 'none' : '' }"
>
<mat-label>{{ label }}</mat-label>
<input
matInput
(dateChange)="onChange($event)"
[id]="id"
[formControl]="form"
[matDatepicker]="datepicker"
(focus)="focused = true"
(focusout)="focused = false"
/>
<mat-datepicker-toggle
matSuffix
[for]="datepicker"
></mat-datepicker-toggle>
<mat-datepicker
#datepicker
(monthSelected)="monthSelected($event, datepicker)"
(yearSelected)="yearSelected($event, datepicker)"
[startView]="startView"
[panelClass]="panelClass"
></mat-datepicker>
<mat-hint *ngIf="shouldShowUnfocusedDescription() || focused">{{
description
}}</mat-hint>
<mat-error>{{ error }}</mat-error>
</mat-form-field>
`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
{
provide: DateAdapter,
useClass: DayJsDateAdapter,
},
{
provide: MAT_DATE_FORMATS,
useClass: MyFormat,
},
], imports: [
CommonModule,
ReactiveFormsModule,
MatFormFieldModule,
MatInputModule,
MatDatepickerModule,
], styles: ["DateControlRenderer{display:flex;flex-direction:row}.date-control-renderer{flex:1 1 auto}.no-panel-navigation .mat-calendar-period-button{pointer-events:none}.no-panel-navigation .mat-calendar-arrow{display:none}\n"] }]
}] });
const DateControlRendererTester = rankWith(2, isDateControl);
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
const template = `
<mat-form-field [ngStyle]="{ display: hidden ? 'none' : '' }">
<mat-label>{{ label }}</mat-label>
<input
matInput
type="text"
(change)="onChange($event)"
[id]="id"
[formControl]="form"
[matAutocomplete]="auto"
(keydown)="updateFilter($event)"
(focus)="focused = true"
(focusout)="focused = false"
/>
<mat-autocomplete
autoActiveFirstOption
#auto="matAutocomplete"
(optionSelected)="onSelect($event)"
[displayWith]="displayFn"
>
@for (option of filteredOptions | async; track option.value) {
<mat-option [value]="option">
{{ option.label }}
</mat-option>
}
</mat-autocomplete>
<mat-hint *ngIf="shouldShowUnfocusedDescription() || focused">{{
description
}}</mat-hint>
<mat-error>{{ error }}</mat-error>
</mat-form-field>
`;
const style = `
:host {
display: flex;
flex-direction: row;
}
mat-form-field {
flex: 1 1 auto;
}
`;
class OneOfEnumControlRenderer extends JsonFormsControl {
options;
valuesToTranslatedOptions;
filteredOptions;
shouldFilter;
focused = false;
mapToProps(state) {
return mapStateToOneOfEnumControlProps(state, this.getOwnProps());
}
getEventValue = (event) => event.target.value;
onChange(ev) {
const eventValue = this.getEventValue(ev);
const option = Array.from(this.valuesToTranslatedOptions?.values() ?? []).find((option) => option.label === eventValue);
if (!option) {
super.onChange(ev);
return;
}
this.jsonFormsService.updateCore(Actions.update(this.propsPath, () => option.value));
this.triggerValidation();
}
ngOnInit() {
super.ngOnInit();
this.shouldFilter = false;
this.filteredOptions = this.form.valueChanges.pipe(startWith(''), map((val) => this.filter(val)));
}
mapAdditionalProps(_props) {
this.valuesToTranslatedOptions = new Map((_props.options ?? []).map((option) => [option.value, option]));
}
updateFilter(event) {
// ENTER
if (event.keyCode === 13) {
this.shouldFilter = false;
}
else {
this.shouldFilter = true;
}
}
onSelect(ev) {
const path = composeWithUi(this.uischema, this.path);
this.shouldFilter = false;
const option = ev.option.value;
this.jsonFormsService.updateCore(Actions.update(path, () => option.value));
this.triggerValidation();
}
// use arrow function to bind "this" reference
displayFn = (option) => {
if (!option) {
return '';
}
if (typeof option === 'string') {
if (!this.valuesToTranslatedOptions) {
return option; // show raw value until translations are ready
}
// if no option matches, it is a manual input
return this.valuesToTranslatedOptions.get(option)?.label ?? option;
}
return option?.label ?? '';
};
filter(val) {
const options = Array.from(this.valuesToTranslatedOptions?.values() || []);
if (!val || !this.shouldFilter) {
return options;
}
const label = typeof val === 'string' ? val : val.label;
return options.filter((option) => option.label.toLowerCase().startsWith(label.toLowerCase()));
}
getOwnProps() {
return {
...super.getOwnProps(),
options: this.options,
};
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: OneOfEnumControlRenderer, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.24", type: OneOfEnumControlRenderer, isStandalone: true, selector: "OneOfEnumControlRenderer", inputs: { options: "options" }, usesInheritance: true, ngImport: i0, template: "\n <mat-form-field [ngStyle]=\"{ display: hidden ? 'none' : '' }\">\n <mat-label>{{ label }}</mat-label>\n <input\n matInput\n type=\"text\"\n (change)=\"onChange($event)\"\n [id]=\"id\"\n [formControl]=\"form\"\n [matAutocomplete]=\"auto\"\n (keydown)=\"updateFilter($event)\"\n (focus)=\"focused = true\"\n (focusout)=\"focused = false\"\n />\n <mat-autocomplete\n autoActiveFirstOption\n #auto=\"matAutocomplete\"\n (optionSelected)=\"onSelect($event)\"\n [displayWith]=\"displayFn\"\n >\n @for (option of filteredOptions | async; track option.value) {\n <mat-option [value]=\"option\">\n {{ option.label }}\n </mat-option>\n }\n </mat-autocomplete>\n <mat-hint *ngIf=\"shouldShowUnfocusedDescription() || focused\">{{\n description\n }}</mat-hint>\n <mat-error>{{ error }}</mat-error>\n </mat-form-field>\n", isInline: true, styles: [":host{display:flex;flex-direction:row}mat-form-field{flex:1 1 auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.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: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { 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: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i5$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i5$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i5$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: OneOfEnumControlRenderer, decorators: [{
type: Component,
args: [{ selector: 'OneOfEnumControlRenderer', template: template, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
CommonModule,
ReactiveFormsModule,
MatFormFieldModule,
MatInputModule,
MatAutocompleteModule,
], styles: [":host{display:flex;flex-direction:row}mat-form-field{flex:1 1 auto}\n"] }]
}], propDecorators: { options: [{
type: Input
}] } });
const oneOfEnumControlTester = rankWith(5, isOneOfEnumControl);
class EnumControlRenderer extends OneOfEnumControlRenderer {
// eslint-disable-next-line @angular-eslint/no-input-rename
set stringOptions(strOptions) {
this.options = strOptions.map((str) => {
return {
label: str,
value: str,
};
});
}
mapToProps(state) {
return mapStateToEnumControlProps(state, this.getOwnProps());
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: EnumControlRenderer, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.24", type: EnumControlRenderer, isStandalone: true, selector: "EnumControlRenderer, AutocompleteControlRenderer", inputs: { stringOptions: ["options", "stringOptions"] }, usesInheritance: true, ngImport: i0, template: "\n <mat-form-field [ngStyle]=\"{ display: hidden ? 'none' : '' }\">\n <mat-label>{{ label }}</mat-label>\n <input\n matInput\n type=\"text\"\n (change)=\"onChange($event)\"\n [id]=\"id\"\n [formControl]=\"form\"\n [matAutocomplete]=\"auto\"\n (keydown)=\"updateFilter($event)\"\n (focus)=\"focused = true\"\n (focusout)=\"focused = false\"\n />\n <mat-autocomplete\n autoActiveFirstOption\n #auto=\"matAutocomplete\"\n (optionSelected)=\"onSelect($event)\"\n [displayWith]=\"displayFn\"\n >\n @for (option of filteredOptions | async; track option.value) {\n <mat-option [value]=\"option\">\n {{ option.label }}\n </mat-option>\n }\n </mat-autocomplete>\n <mat-hint *ngIf=\"shouldShowUnfocusedDescription() || focused\">{{\n description\n }}</mat-hint>\n <mat-error>{{ error }}</mat-error>\n </mat-form-field>\n", isInline: true, styles: [":host{display:flex;flex-direction:row}mat-form-field{flex:1 1 auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.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: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { 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: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i5$1.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i5$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i5$1.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: EnumControlRenderer, decorators: [{
type: Component,
args: [{ selector: 'EnumControlRenderer, AutocompleteControlRenderer', template: template, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
CommonModule,
ReactiveFormsModule,
MatFormFieldModule,
MatInputModule,
MatAutocompleteModule,
], styles: [":host{display:flex;flex-direction:row}mat-form-field{flex:1 1 auto}\n"] }]
}], propDecorators: { stringOptions: [{
type: Input,
args: ['options']
}] } });
const enumControlTester = rankWith(2, isEnumControl);
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
class NumberControlRenderer extends JsonFormsControl {
MAXIMUM_FRACTIONAL_DIGITS = 20;
oldValue;
min;
max;
multipleOf;
locale;
numberFormat;
decimalSeparator;
focused = false;
onChange(ev) {
const data = this.oldValue
? ev.target.value.replace(this.oldValue, '')
: ev.target.value;
// ignore these
if (data === '.' ||
data === ',' ||
data === ' ' ||
// if the value is 0 and we already have a value then we ignore
(data === '0' &&
this.getValue() !== '' &&
// a 0 in the first place
((ev.target.selectionStart === 1 && ev.target.selectionEnd === 1) ||
// or in the last place as this doesn't change the value (when there is a separator)
(ev.target.selectionStart === ev.target.value.length &&
ev.target.selectionEnd === ev.target.value.length &&
ev.target.value.indexOf(this.decimalSeparator) !== -1)))) {
this.oldValue = ev.target.value;
return;
}
super.onChange(ev);
this.oldValue = this.getValue();
}
getEventValue = (event) => {
const cleanPattern = new RegExp(`[^-+0-9${this.decimalSeparator}]`, 'g');
const cleaned = event.target.value.replace(cleanPattern, '');
const normalized = cleaned.replace(this.decimalSeparator, '.');
if (normalized === '') {
return undefined;
}
// convert to number
const number = +normalized;
// if not a number just return the string
if (Number.isNaN(number)) {
return event.target.value;
}
return number;
};
getValue = () => {
if (this.data !== undefined && this.data !== null) {
if (typeof this.data === 'number') {
return this.numberFormat.format(this.data);
}
return this.data;
}
return '';
};
mapAdditionalProps(props) {
if (this.scopedSchema) {
const testerContext = {
rootSchema: this.rootSchema,
config: props.config,
};
const defaultStep = isNumberControl(this.uischema, this.rootSchema, testerContext)
? 0.1
: 1;
this.min = this.scopedSchema.minimum;
this.max = this.scopedSchema.maximum;
this.multipleOf = this.scopedSchema.multipleOf || defaultStep;
const appliedUiSchemaOptions = merge({}, props.config, this.uischema.options);
const currentLocale = this.jsonFormsService.getLocale();
if (this.locale === undefined || this.locale !== currentLocale) {
this.locale = currentLocale;
this.numberFormat = new Intl.NumberFormat(this.locale, {
useGrouping: appliedUiSchemaOptions.useGrouping,
maximumFractionDigits: this.MAXIMUM_FRACTIONAL_DIGITS,
});
this.determineDecimalSeparator();
this.oldValue = this.getValue();
}
this.form.setValue(this.getValue());
}
}
determineDecimalSeparator() {
const example = this.numberFormat.format(1.1);
this.decimalSeparator = example.charAt(1);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: NumberControlRenderer, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: NumberControlRenderer, isStandalone: true, selector: "NumberControlRenderer", usesInheritance: true, ngImport: i0, template: `
<mat-form-field [ngStyle]="{ display: hidden ? 'none' : '' }">
<mat-label>{{ label }}</mat-label>
<input
matInput
(input)="onChange($event)"
[value]="getValue()"
[id]="id"
[formControl]="form"
[min]="min"
[max]="max"
[step]="multipleOf"
(focus)="focused = true"
(focusout)="focused = false"
/>
<mat-hint *ngIf="shouldShowUnfocusedDescription() || focused">{{
description
}}</mat-hint>
<mat-error>{{ error }}</mat-error>
</mat-form-field>
`, isInline: true, styles: [":host{display:flex;flex-direction:row}mat-form-field{flex:1 1 auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.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: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { 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: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: NumberControlRenderer, decorators: [{
type: Component,
args: [{ selector: 'NumberControlRenderer', template: `
<mat-form-field [ngStyle]="{ display: hidden ? 'none' : '' }">
<mat-label>{{ label }}</mat-label>
<input
matInput
(input)="onChange($event)"
[value]="getValue()"
[id]="id"
[formControl]="form"
[min]="min"
[max]="max"
[step]="multipleOf"
(focus)="focused = true"
(focusout)="focused = false"
/>
<mat-hint *ngIf="shouldShowUnfocusedDescription() || focused">{{
description
}}</mat-hint>
<mat-error>{{ error }}</mat-error>
</mat-form-field>
`, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
CommonModule,
ReactiveFormsModule,
MatFormFieldModule,
MatInputModule,
], styles: [":host{display:flex;flex-direction:row}mat-form-field{flex:1 1 auto}\n"] }]
}] });
const NumberControlRendererTester = rankWith(2, or(isNumberControl, isIntegerControl));
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
class RangeControlRenderer extends JsonFormsControl {
min;
max;
multipleOf;
focused = false;
changeDetectorRef = inject(ChangeDetectorRef);
getEventValue = (event) => Number(event);
mapAdditionalProps() {
if (this.scopedSchema) {
this.min = this.scopedSchema.minimum;
this.max = this.scopedSchema.maximum;
this.multipleOf = this.scopedSchema.multipleOf || 1;
}
this.changeDetectorRef.markForCheck();
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: RangeControlRenderer, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: RangeControlRenderer, isStandalone: true, selector: "RangeControlRenderer", usesInheritance: true, ngImport: i0, template: `
<div [ngStyle]="{ display: hidden ? 'none' : '' }" class="range-control">
<label class="mat-caption" style="color:rgba(0,0,0,.54)">{{
label
}}</label>
<mat-slider
[disabled]="!isEnabled()"
[max]="max"
[min]="min"
[step]="multipleOf"
[discrete]="true"
[id]="id"
showTickMarks
#ngSlider
>
<input matSliderThumb (valueChange)="onChange($event)" />
</mat-slider>
<mat-hint class="mat-caption" *ngIf="shouldShowUnfocusedDescription()">{{
description
}}</mat-hint>
<mat-error class="mat-caption">{{ error }}</mat-error>
</div>
`, isInline: true, styles: [":host{display:flex;flex-direction:row}.range-control{flex:1 1 auto;display:flex;flex-direction:column}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatSliderModule }, { kind: "component", type: i2$2.MatSlider, selector: "mat-slider", inputs: ["disabled", "discrete", "showTickMarks", "min", "color", "disableRipple", "max", "step", "displayWith"], exportAs: ["matSlider"] }, { kind: "directive", type: i2$2.MatSliderThumb, selector: "input[matSliderThumb]", inputs: ["value"], outputs: ["valueChange", "dragStart", "dragEnd"], exportAs: ["matSliderThumb"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: RangeControlRenderer, decorators: [{
type: Component,
args: [{ selector: 'RangeControlRenderer', template: `
<div [ngStyle]="{ display: hidden ? 'none' : '' }" class="range-control">
<label class="mat-caption" style="color:rgba(0,0,0,.54)">{{
label
}}</label>
<mat-slider
[disabled]="!isEnabled()"
[max]="max"
[min]="min"
[step]="multipleOf"
[discrete]="true"
[id]="id"
showTickMarks
#ngSlider
>
<input matSliderThumb (valueChange)="onChange($event)" />
</mat-slider>
<mat-hint class="mat-caption" *ngIf="shouldShowUnfocusedDescription()">{{
description
}}</mat-hint>
<mat-error class="mat-caption">{{ error }}</mat-error>
</div>
`, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, MatSliderModule, MatFormFieldModule], styles: [":host{display:flex;flex-direction:row}.range-control{flex:1 1 auto;display:flex;flex-direction:column}\n"] }]
}] });
const RangeControlRendererTester = rankWith(4, isRangeControl);
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
class TextAreaRenderer extends JsonFormsControl {
focused = false;
getEventValue = (event) => event.target.value || undefined;
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: TextAreaRenderer, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: TextAreaRenderer, isStandalone: true, selector: "TextAreaRenderer", usesInheritance: true, ngImport: i0, template: `
<mat-form-field [ngStyle]="{ display: hidden ? 'none' : '' }">
<mat-label>{{ label }}</mat-label>
<textarea
matInput
(input)="onChange($event)"
[id]="id"
[formControl]="form"
(focus)="focused = true"
(focusout)="focused = false"
></textarea>
<mat-hint *ngIf="shouldShowUnfocusedDescription() || focused">{{
description
}}</mat-hint>
<mat-error>{{ error }}</mat-error>
</mat-form-field>
`, isInline: true, styles: [":host{display:flex;flex-direction:row}mat-form-field{flex:1 1 auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.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: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { 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: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: TextAreaRenderer, decorators: [{
type: Component,
args: [{ selector: 'TextAreaRenderer', template: `
<mat-form-field [ngStyle]="{ display: hidden ? 'none' : '' }">
<mat-label>{{ label }}</mat-label>
<textarea
matInput
(input)="onChange($event)"
[id]="id"
[formControl]="form"
(focus)="focused = true"
(focusout)="focused = false"
></textarea>
<mat-hint *ngIf="shouldShowUnfocusedDescription() || focused">{{
description
}}</mat-hint>
<mat-error>{{ error }}</mat-error>
</mat-form-field>
`, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
CommonModule,
ReactiveFormsModule,
MatFormFieldModule,
MatInputModule,
], styles: [":host{display:flex;flex-direction:row}mat-form-field{flex:1 1 auto}\n"] }]
}] });
const TextAreaRendererTester = rankWith(2, isMultiLineControl);
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
class TextControlRenderer extends JsonFormsControl {
focused = false;
getEventValue = (event) => event.target.value || undefined;
getType = () => {
if (this.uischema.options && this.uischema.options.format) {
return this.uischema.options.format;
}
if (this.scopedSchema && this.scopedSchema.format) {
switch (this.scopedSchema.format) {
case 'email':
return 'email';
case 'tel':
return 'tel';
default:
return 'text';
}
}
return 'text';
};
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: TextControlRenderer, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: TextControlRenderer, isStandalone: true, selector: "TextControlRenderer", usesInheritance: true, ngImport: i0, template: `
<mat-form-field [ngStyle]="{ display: hidden ? 'none' : '' }">
<mat-label>{{ label }}</mat-label>
<input
matInput
[type]="getType()"
(input)="onChange($event)"
[id]="id"
[formControl]="form"
(focus)="focused = true"
(focusout)="focused = false"
/>
<mat-hint *ngIf="shouldShowUnfocusedDescription() || focused">{{
description
}}</mat-hint>
<mat-error>{{ error }}</mat-error>
</mat-form-field>
`, isInline: true, styles: [":host{display:flex;flex-direction:row}mat-form-field{flex:1 1 auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2$1.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: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { 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: "ngmodule", type: MatInputModule }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: TextControlRenderer, decorators: [{
type: Component,
args: [{ selector: 'TextControlRenderer', template: `
<mat-form-field [ngStyle]="{ display: hidden ? 'none' : '' }">
<mat-label>{{ label }}</mat-label>
<input
matInput
[type]="getType()"
(input)="onChange($event)"
[id]="id"
[formControl]="form"
(focus)="focused = true"
(focusout)="focused = false"
/>
<mat-hint *ngIf="shouldShowUnfocusedDescription() || focused">{{
description
}}</mat-hint>
<mat-error>{{ error }}</mat-error>
</mat-form-field>
`, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
CommonModule,
ReactiveFormsModule,
MatFormFieldModule,
MatInputModule,
], styles: [":host{display:flex;flex-direction:row}mat-form-field{flex:1 1 auto}\n"] }]
}] });
const TextControlRendererTester = rankWith(1, isStringControl);
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
class ToggleControlRenderer extends JsonFormsControl {
changeDetectorRef = inject(ChangeDetectorRef);
isChecked = () => this.data || false;
getEventValue = (event) => event.checked;
mapAdditionalProps() {
this.changeDetectorRef.markForCheck();
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: ToggleControlRenderer, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: ToggleControlRenderer, isStandalone: true, selector: "ToggleControlRenderer", usesInheritance: true, ngImport: i0, template: `
<div [ngStyle]="{ display: hidden ? 'none' : '' }">
<mat-slide-toggle
(change)="onChange($event)"
[checked]="isChecked()"
[disabled]="!isEnabled()"
[id]="id"
>
{{ label }}
</mat-slide-toggle>
<mat-hint class="mat-caption" *ngIf="shouldShowUnfocusedDescription()">{{
description
}}</mat-hint>
<mat-error class="mat-caption">{{ error }}</mat-error>
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i2$3.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: ToggleControlRenderer, decorators: [{
type: Component,
args: [{
selector: 'ToggleControlRenderer',
template: `
<div [ngStyle]="{ display: hidden ? 'none' : '' }">
<mat-slide-toggle
(change)="onChange($event)"
[checked]="isChecked()"
[disabled]="!isEnabled()"
[id]="id"
>
{{ label }}
</mat-slide-toggle>
<mat-hint class="mat-caption" *ngIf="shouldShowUnfocusedDescription()">{{
description
}}</mat-hint>
<mat-error class="mat-caption">{{ error }}</mat-error>
</div>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [CommonModule, MatSlideToggleModule, MatFormFieldModule],
}]
}] });
const ToggleControlRendererTester = rankWith(3, and(isBooleanControl, optionIs('toggle', true)));
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
class LabelRenderer extends JsonFormsBaseRenderer {
label;
visible;
jsonFormsService = inject(JsonFormsAngularService);
ngOnInit() {
this.addSubscription(this.jsonFormsService.$state.subscribe({
next: (state) => {
const props = mapStateToLabelProps(state, this.getOwnProps());
this.visible = props.visible;
this.label = props.text;
},
}));
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: LabelRenderer, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: LabelRenderer, isStandalone: true, selector: "LabelRenderer", usesInheritance: true, ngImport: i0, template: ` <label class="mat-headline-6"> {{ label }} </label> `, isInline: true, styles: [":host{flex:1 1 auto}\n"] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: LabelRenderer, decorators: [{
type: Component,
args: [{ selector: 'LabelRenderer', template: ` <label class="mat-headline-6"> {{ label }} </label> `, styles: [":host{flex:1 1 auto}\n"] }]
}] });
const LabelRendererTester = rankWith(4, uiTypeIs('Label'));
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
class JsonFormsDetailComponent {
_item;
_schema;
initialized = false;
set item(item) {
if (item) {
this._item = item;
this.initialized = true;
}
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: JsonFormsDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: JsonFormsDetailComponent, isStandalone: true, selector: "jsonforms-detail", inputs: { item: "item" }, ngImport: i0, template: `
<div *ngIf="initialized">
<jsonforms-outlet [renderProps]="_item"></jsonforms-outlet>
</div>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: JsonFormsModule }, { kind: "directive", type: i2$4.JsonFormsOutlet, selector: "jsonforms-outlet", inputs: ["renderProps"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: JsonFormsDetailComponent, decorators: [{
type: Component,
args: [{
selector: 'jsonforms-detail',
template: `
<div *ngIf="initialized">
<jsonforms-outlet [renderProps]="_item"></jsonforms-outlet>
</div>
`,
imports: [CommonModule, JsonFormsModule],
}]
}], propDecorators: { item: [{
type: Input
}] } });
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
const keywords = ['#', 'properties', 'items'];
const removeSchemaKeywords = (path) => {
return decode(path
.split('/')
.filter((s) => !some(keywords, (key) => key === s))
.join('.'));
};
class MasterListComponent extends JsonFormsArrayControl {
masterItems;
selectedItem;
selectedItemIdx;
addItem;
removeItems;
highlightedIdx;
translations;
changeDetectorRef = inject(ChangeDetectorRef);
onListItemHover(idx) {
this.highlightedIdx = idx;
}
trackElement(_index, element) {
return element ? element.label : null;
}
ngOnInit() {
super.ngOnInit();
const dispatch = this.jsonFormsService.updateCore.bind(this.jsonFormsService);
const { addItem, removeItems } = mapDispatchToArrayControlProps(dispatch);
this.addItem = addItem;
this.removeItems = removeItems;
}
mapAdditionalProps(props) {
const { data, path, schema, uischema } = props;
const controlElement = uischema;
this.propsPath = props.path;
const detailUISchema = findUISchema(props.uischemas, schema, `${controlElement.scope}/items`, props.path, 'VerticalLayout', controlElement, props.rootSchema);
if (!this.isEnabled()) {
setReadonly(detailUISchema);
}
this.translations = props.translations;
const masterItems = (data || []).map((d, index) => {
const labelRefInstancePath = controlElement.options?.labelRef &&
removeSchemaKeywords(controlElement.options.labelRef);
const isPrimitive = d !== undefined && typeof d !== 'object';
const masterItem = {
label: isPrimitive
? d.toString()
: get(d, labelRefInstancePath ?? getFirstPrimitiveProp(schema)),
data: d,
path: `${path}.${index}`,
schema,
uischema: detailUISchema,
};
return masterItem;
});
this.masterItems = masterItems;
let newSelectedIdx = -1;
let newSelectedItem;
if (this.masterItems.length === 0) {
// unset select if no elements anymore
this.selectedItem = undefined;
this.selectedItemIdx = -1;
}
else if (this.selectedItemIdx >= this.masterItems.length) {
// the previous index is to high, reduce it to the maximal possible
newSelectedIdx = this.masterItems.length - 1;
newSelectedItem = this.masterItems[newSelectedIdx];
}
else if (this.selectedItemIdx !== -1 &&
this.selectedItemIdx < this.masterItems.length) {
newSelectedIdx = this.selectedItemIdx;
newSelectedItem = this.masterItems[this.selectedItemIdx];
}
if (newSelectedItem !== undefined &&
this.selectedItem !== undefined &&
(newSelectedItem.label === this.selectedItem.label ||
newSelectedItem.path === this.selectedItem.path)) {
// after checking that we are on the same path, set selection
this.selectedItem = newSelectedItem;
this.selectedItemIdx = newSelectedIdx;
}
else if (this.masterItems.length > 0) {
// pre-select 1st entry if the previous selected element as fallback
this.selectedItem = this.masterItems[0];
this.selectedItemIdx = 0;
}
this.changeDetectorRef.markForCheck();
}
onSelect(item, idx) {
this.selectedItem = item;
this.selectedItemIdx = idx;
}
onAddClick() {
this.addItem(this.propsPath, createDefaultValue(this.scopedSchema, this.rootSchema))();
}
onDeleteClick(item) {
this.removeItems(this.propsPath, [item])();
}
mapToProps(state) {
const props = mapStateToArrayControlProps(state, this.getOwnProps());
const t = state.jsonforms.i18n?.translate ?? defaultJsonFormsI18nState.translate;
const translations = getArrayTranslations(t, arrayDefaultTranslations, props.i18nKeyPrefix, props.label);
return { ...props, translations };
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: MasterListComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: MasterListComponent, isStandalone: true, selector: "jsonforms-list-with-detail-master", usesInheritance: true, ngImport: i0, template: `
<mat-sidenav-container
[ngStyle]="{ display: hidden ? 'none' : '' }"
autosize="true"
class="container"
>
<mat-sidenav mode="side" opened>
<mat-nav-list>
<mat-list-item *ngIf="masterItems.length === 0">{{
translations.noDataMessage
}}</mat-list-item>
<mat-list-item
*ngFor="
let item of masterItems;
let i = index;
trackBy: trackElement
"
[class.selected]="item === selectedItem"
(click)="onSelect(item, i)"
(mouseover)="onListItemHover(i)"
(mouseout)="onListItemHover(undefined)"
>
<a matLine>{{ item.label || 'No label set' }}</a>
<button
mat-icon-button
class="button item-button hide"
(click)="onDeleteClick(i)"
[ngClass]="{ show: highlightedIdx === i }"
*ngIf="isEnabled()"
>
<mat-icon mat-list-icon>delete</mat-icon>
</button>
</mat-list-item>
</mat-nav-list>
<button
mat-fab
color="primary"
class="add-button"
(click)="onAddClick()"
*ngIf="isEnabled()"
>
<mat-icon [attr.aria-label]="translations.addAriaLabel">add</mat-icon>
</button>
</mat-sidenav>
<mat-sidenav-content class="content">
<jsonforms-detail
*ngIf="selectedItem"
[item]="selectedItem"
></jsonforms-detail>
</mat-sidenav-content>
</mat-sidenav-container>
`, isInline: true, styles: ["mat-list-item.selected{background:#0000000a}.container{height:100vh}.content{padding:15px;background-color:#fff}.add-button{float:right;margin-top:.5em;margin-right:.25em}.button{float:right;margin-right:.25em}.item-button{position:absolute;top:0;right:0}.hide{display:none}.show{display:inline-block}mat-sidenav{width:20%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: MatSidenavModule }, { kind: "component", type: i2$5.MatSidenav, selector: "mat-sidenav", inputs: ["fixedInViewport", "fixedTopGap", "fixedBottomGap"], exportAs: ["matSidenav"] }, { kind: "component", type: i2$5.MatSidenavContainer, selector: "mat-sidenav-container", exportAs: ["matSidenavContainer"] }, { kind: "component", type: i2$5.MatSidenavContent, selector: "mat-sidenav-content" }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i3$1.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i3$1.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i4$1.MatFabButton, selector: "button[mat-fab], a[mat-fab], button[matFab], a[matFab]", inputs: ["extended"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: JsonFormsDetailComponent, selector: "jsonforms-detail", inputs: ["item"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: MasterListComponent, decorators: [{
type: Component,
args: [{ selector: 'jsonforms-list-with-detail-master', template: `
<mat-sidenav-container
[ngStyle]="{ display: hidden ? 'none' : '' }"
autosize="true"
class="container"
>
<mat-sidenav mode="side" opened>
<mat-nav-list>
<mat-list-item *ngIf="masterItems.length === 0">{{
translations.noDataMessage
}}</mat-list-item>
<mat-list-item
*ngFor="
let item of masterItems;
let i = index;
trackBy: trackElement
"
[class.selected]="item === selectedItem"
(click)="onSelect(item, i)"
(mouseover)="onListItemHover(i)"
(mouseout)="onListItemHover(undefined)"
>
<a matLine>{{ item.label || 'No label set' }}</a>
<button
mat-icon-button
class="button item-button hide"
(click)="onDeleteClick(i)"
[ngClass]="{ show: highlightedIdx === i }"
*ngIf="isEnabled()"
>
<mat-icon mat-list-icon>delete</mat-icon>
</button>
</mat-list-item>
</mat-nav-list>
<button
mat-fab
color="primary"
class="add-button"
(click)="onAddClick()"
*ngIf="isEnabled()"
>
<mat-icon [attr.aria-label]="translations.addAriaLabel">add</mat-icon>
</button>
</mat-sidenav>
<mat-sidenav-content class="content">
<jsonforms-detail
*ngIf="selectedItem"
[item]="selectedItem"
></jsonforms-detail>
</mat-sidenav-content>
</mat-sidenav-container>
`, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
CommonModule,
MatSidenavModule,
MatListModule,
MatButtonModule,
MatIconModule,
JsonFormsDetailComponent,
], styles: ["mat-list-item.selected{background:#0000000a}.container{height:100vh}.content{padding:15px;background-color:#fff}.add-button{float:right;margin-top:.5em;margin-right:.25em}.button{float:right;margin-right:.25em}.item-button{position:absolute;top:0;right:0}.hide{display:none}.show{display:inline-block}mat-sidenav{width:20%}\n"] }]
}] });
const masterDetailTester = rankWith(4, uiTypeIs('ListWithDetail'));
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
class ObjectControlRenderer extends JsonFormsControlWithDetail {
detailUiSchema;
mapAdditionalProps(props) {
this.detailUiSchema = findUISchema(props.uischemas, props.schema, props.uischema.scope, props.path, () => {
const newSchema = cloneDeep(props.schema);
// delete unsupported operators
delete newSchema.oneOf;
delete newSchema.anyOf;
delete newSchema.allOf;
return Generate.uiSchema(newSchema, 'Group', undefined, this.rootSchema);
}, props.uischema, props.rootSchema);
if (isEmpty(props.path)) {
this.detailUiSchema.type = 'VerticalLayout';
}
else {
this.detailUiSchema.label = startCase(props.path);
}
if (!this.isEnabled()) {
setReadonly(this.detailUiSchema);
}
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: ObjectControlRenderer, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: ObjectControlRenderer, isStandalone: true, selector: "ObjectRenderer", usesInheritance: true, ngImport: i0, template: `
<mat-card class="object-layout" appearance="outlined">
<jsonforms-outlet
[uischema]="detailUiSchema"
[schema]="scopedSchema"
[path]="propsPath"
>
</jsonforms-outlet>
</mat-card>
`, isInline: true, styles: [".object-layout{padding:16px}\n"], dependencies: [{ kind: "ngmodule", type: JsonFormsModule }, { kind: "directive", type: i2$4.JsonFormsOutlet, selector: "jsonforms-outlet", inputs: ["renderProps"] }, { kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i3$2.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: ObjectControlRenderer, decorators: [{
type: Component,
args: [{ selector: 'ObjectRenderer', template: `
<mat-card class="object-layout" appearance="outlined">
<jsonforms-outlet
[uischema]="detailUiSchema"
[schema]="scopedSchema"
[path]="propsPath"
>
</jsonforms-outlet>
</mat-card>
`, changeDetection: ChangeDetectionStrategy.OnPush, imports: [JsonFormsModule, MatCardModule], styles: [".object-layout{padding:16px}\n"] }]
}] });
const ObjectControlRendererTester = rankWith(2, isObjectControl);
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
const controlWithoutLabel = (scope) => ({
type: 'Control',
scope: scope,
label: false,
});
class GetProps {
transform(index, props) {
const rowPath = Paths.compose(props.path, `${index}`);
return {
schema: props.schema,
uischema: props.uischema,
path: rowPath,
};
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: GetProps, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.24", ngImport: i0, type: GetProps, isStandalone: true, name: "getProps" });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: GetProps, decorators: [{
type: Pipe,
args: [{ name: 'getProps' }]
}] });
class TableRenderer extends JsonFormsArrayControl {
detailUiSchema;
displayedColumns;
items;
columnsToIgnore = ['array', 'object'];
addItem;
moveItemUp;
moveItemDown;
removeItems;
translations = {};
trackElement(index, _element) {
return index ? index : null;
}
mapAdditionalProps(props) {
this.items = this.generateCells(props.schema, props.path);
this.displayedColumns = this.items.map((item) => item.property);
if (this.isEnabled()) {
this.displayedColumns.push('action');
}
this.translations = props.translations;
}
remove(index) {
this.removeItems(this.propsPath, [index])();
}
add() {
this.addItem(this.propsPath, createDefaultValue(this.scopedSchema, this.rootSchema))();
}
up(index) {
this.moveItemUp(this.propsPath, index)();
}
down(index) {
this.moveItemDown(this.propsPath, index)();
}
ngOnInit() {
super.ngOnInit();
const { addItem, removeItems, moveUp, moveDown } = mapDispatchToArrayControlProps(this.jsonFormsService.updateCore.bind(this.jsonFormsService));
this.addItem = addItem;
this.moveItemUp = moveUp;
this.moveItemDown = moveDown;
this.removeItems = removeItems;
}
generateCells = (schema, rowPath) => {
if (schema.type === 'object') {
return this.getValidColumnProps(schema).map((prop) => {
const encProp = encode(prop);
const uischema = controlWithoutLabel(`#/properties/${encProp}`);
if (!this.isEnabled()) {
setReadonly(uischema);
}
return {
property: prop,
header: startCase(prop),
props: {
schema: schema,
uischema,
path: rowPath,
},
};
});
}
// needed to correctly render input control for multi attributes
return [
{
property: 'DUMMY',
header: this.label,
props: {
schema: schema,
uischema: controlWithoutLabel(`#`),
path: rowPath,
},
},
];
};
getValidColumnProps = (scopedSchema) => {
if (scopedSchema.type === 'object') {
return Object.keys(scopedSchema.properties).filter((prop) => {
const types = deriveTypes(scopedSchema.properties[prop]);
if (types.length > 1) {
return false;
}
return this.columnsToIgnore.indexOf(types[0]) === -1;
});
}
// primitives
return [''];
};
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: TableRenderer, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: TableRenderer, isStandalone: true, selector: "TableRenderer", usesInheritance: true, ngImport: i0, template: `
<div class="table-container">
<table
mat-table
[dataSource]="data"
class="mat-elevation-z8"
[trackBy]="trackElement"
>
<ng-container matColumnDef="action" stickyEnd>
<tr>
<th
mat-header-cell
*matHeaderCellDef
[ngClass]="{ 'sort-column': uischema?.options?.showSortButtons }"
>
<button
mat-button
color="primary"
(click)="add()"
[disabled]="!isEnabled()"
[matTooltip]="translations.addTooltip"
>
<mat-icon>add</mat-icon>
</button>
</th>
</tr>
<tr>
<td
[ngClass]="{ 'sort-column': uischema?.options?.showSortButtons }"
mat-cell
*matCellDef="
let row;
let i = index;
let first = first;
let last = last
"
>
<button
*ngIf="uischema?.options?.showSortButtons"
class="item-up"
mat-icon-button
[disabled]="first"
(click)="up(i)"
[matTooltip]="translations.upAriaLabel"
matTooltipPosition="right"
>
<mat-icon>arrow_upward</mat-icon>
</button>
<button
*ngIf="uischema?.options?.showSortButtons"
class="item-down"
mat-icon-button
[disabled]="last"
(click)="down(i)"
[matTooltip]="translations.downAriaLabel"
matTooltipPosition="right"
>
<mat-icon>arrow_downward</mat-icon>
</button>
<button
mat-icon-button
color="warn"
(click)="remove(i)"
[disabled]="!isEnabled()"
matTooltipPosition="right"
[matTooltip]="translations.removeTooltip"
>
<mat-icon>delete</mat-icon>
</button>
</td>
</tr>
<tr></tr
></ng-container>
<ng-container
*ngFor="let item of items"
matColumnDef="{{ item.property }}"
>
<th mat-header-cell *matHeaderCellDef>{{ item.header }}</th>
<td mat-cell *matCellDef="let index = index">
<jsonforms-outlet
[renderProps]="index | getProps : item.props"
></jsonforms-outlet>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
</table>
</div>
`, isInline: true, styles: ["table{width:100%}\n", ".cdk-column-action{width:15%}\n", ".sort-column{min-width:12vw}\n", ".table-container{max-width:100%;overflow:auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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: "ngmodule", type: JsonFormsModule }, { kind: "directive", type: i2$4.JsonFormsOutlet, selector: "jsonforms-outlet", inputs: ["renderProps"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i3$3.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i3$3.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i3$3.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i3$3.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i3$3.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i3$3.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i3$3.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i3$3.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3$3.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i3$3.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i4$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: GetProps, name: "getProps" }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: TableRenderer, decorators: [{
type: Component,
args: [{ selector: 'TableRenderer', template: `
<div class="table-container">
<table
mat-table
[dataSource]="data"
class="mat-elevation-z8"
[trackBy]="trackElement"
>
<ng-container matColumnDef="action" stickyEnd>
<tr>
<th
mat-header-cell
*matHeaderCellDef
[ngClass]="{ 'sort-column': uischema?.options?.showSortButtons }"
>
<button
mat-button
color="primary"
(click)="add()"
[disabled]="!isEnabled()"
[matTooltip]="translations.addTooltip"
>
<mat-icon>add</mat-icon>
</button>
</th>
</tr>
<tr>
<td
[ngClass]="{ 'sort-column': uischema?.options?.showSortButtons }"
mat-cell
*matCellDef="
let row;
let i = index;
let first = first;
let last = last
"
>
<button
*ngIf="uischema?.options?.showSortButtons"
class="item-up"
mat-icon-button
[disabled]="first"
(click)="up(i)"
[matTooltip]="translations.upAriaLabel"
matTooltipPosition="right"
>
<mat-icon>arrow_upward</mat-icon>
</button>
<button
*ngIf="uischema?.options?.showSortButtons"
class="item-down"
mat-icon-button
[disabled]="last"
(click)="down(i)"
[matTooltip]="translations.downAriaLabel"
matTooltipPosition="right"
>
<mat-icon>arrow_downward</mat-icon>
</button>
<button
mat-icon-button
color="warn"
(click)="remove(i)"
[disabled]="!isEnabled()"
matTooltipPosition="right"
[matTooltip]="translations.removeTooltip"
>
<mat-icon>delete</mat-icon>
</button>
</td>
</tr>
<tr></tr
></ng-container>
<ng-container
*ngFor="let item of items"
matColumnDef="{{ item.property }}"
>
<th mat-header-cell *matHeaderCellDef>{{ item.header }}</th>
<td mat-cell *matCellDef="let index = index">
<jsonforms-outlet
[renderProps]="index | getProps : item.props"
></jsonforms-outlet>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
</table>
</div>
`, imports: [
CommonModule,
JsonFormsModule,
MatTableModule,
MatButtonModule,
MatIconModule,
MatTooltipModule,
GetProps,
], styles: ["table{width:100%}\n", ".cdk-column-action{width:15%}\n", ".sort-column{min-width:12vw}\n", ".table-container{max-width:100%;overflow:auto}\n"] }]
}] });
const TableRendererTester = rankWith(3, or(isObjectArrayControl, isPrimitiveArrayControl));
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
class CategorizationTabLayoutRenderer extends JsonFormsBaseRenderer {
hidden;
visibleCategories;
categoryLabels;
jsonFormsService = inject(JsonFormsAngularService);
ngOnInit() {
this.addSubscription(this.jsonFormsService.$state.subscribe({
next: (state) => {
const props = mapStateToLayoutProps(state, this.getOwnProps());
this.hidden = !props.visible;
this.visibleCategories = this.uischema.elements.filter((category) => isVisible(category, props.data, undefined, getAjv(state), getConfig(state)));
this.categoryLabels = this.visibleCategories.map((element) => deriveLabelForUISchemaElement(element, state.jsonforms.i18n?.translate ??
defaultJsonFormsI18nState.translate));
},
}));
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: CategorizationTabLayoutRenderer, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: CategorizationTabLayoutRenderer, isStandalone: true, selector: "jsonforms-categorization-layout", usesInheritance: true, ngImport: i0, template: `
<mat-tab-group
[ngStyle]="{ display: hidden ? 'none' : '' }"
dynamicHeight="true"
>
<mat-tab
*ngFor="let category of visibleCategories; let i = index"
[label]="categoryLabels[i]"
>
<div *ngFor="let element of category.elements">
<jsonforms-outlet
[uischema]="element"
[path]="path"
[schema]="schema"
></jsonforms-outlet>
</div>
</mat-tab>
</mat-tab-group>
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: JsonFormsModule }, { kind: "directive", type: i2$4.JsonFormsOutlet, selector: "jsonforms-outlet", inputs: ["renderProps"] }, { kind: "ngmodule", type: MatTabsModule }, { kind: "component", type: i3$4.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass", "id"], exportAs: ["matTab"] }, { kind: "component", type: i3$4.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "mat-align-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor", "aria-label", "aria-labelledby"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: CategorizationTabLayoutRenderer, decorators: [{
type: Component,
args: [{
selector: 'jsonforms-categorization-layout',
template: `
<mat-tab-group
[ngStyle]="{ display: hidden ? 'none' : '' }"
dynamicHeight="true"
>
<mat-tab
*ngFor="let category of visibleCategories; let i = index"
[label]="categoryLabels[i]"
>
<div *ngFor="let element of category.elements">
<jsonforms-outlet
[uischema]="element"
[path]="path"
[schema]="schema"
></jsonforms-outlet>
</div>
</mat-tab>
</mat-tab-group>
`,
imports: [CommonModule, JsonFormsModule, MatTabsModule],
}]
}] });
const categorizationTester = rankWith(2, and(uiTypeIs('Categorization'), categorizationHasCategory));
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
class LayoutRenderer extends JsonFormsBaseRenderer {
hidden;
label;
jsonFormsService = inject(JsonFormsAngularService);
changeDetectionRef = inject(ChangeDetectorRef);
ngOnInit() {
this.addSubscription(this.jsonFormsService.$state.subscribe({
next: (state) => {
const props = mapStateToLayoutProps(state, this.getOwnProps());
this.label = props.label;
this.hidden = !props.visible;
this.changeDetectionRef.markForCheck();
},
}));
}
trackElement(_index, renderProp) {
return renderProp
? renderProp.path + JSON.stringify(renderProp.uischema)
: null;
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: LayoutRenderer, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: LayoutRenderer, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: LayoutRenderer, decorators: [{
type: Component,
args: [{
template: '',
}]
}] });
class LayoutChildrenRenderPropsPipe {
transform(uischema, schema, path) {
const elements = (uischema.elements || []).map((el) => ({
uischema: el,
schema: schema,
path: path,
}));
return elements;
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: LayoutChildrenRenderPropsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.24", ngImport: i0, type: LayoutChildrenRenderPropsPipe, isStandalone: true, name: "layoutChildrenRenderProps" });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: LayoutChildrenRenderPropsPipe, decorators: [{
type: Pipe,
args: [{ name: 'layoutChildrenRenderProps' }]
}] });
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
class GroupLayoutRenderer extends LayoutRenderer {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: GroupLayoutRenderer, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: GroupLayoutRenderer, isStandalone: true, selector: "GroupLayoutRenderer", usesInheritance: true, ngImport: i0, template: `
<mat-card
[ngStyle]="{ display: hidden ? 'none' : '' }"
appearance="outlined"
class="group-layout"
>
<mat-card-title class="mat-headline-6">{{ label }}</mat-card-title>
<div
*ngFor="
let props of uischema | layoutChildrenRenderProps : schema : path;
trackBy: trackElement
"
>
<jsonforms-outlet [renderProps]="props"></jsonforms-outlet>
</div>
</mat-card>
`, isInline: true, styles: [".group-layout{display:flex;flex-direction:column;gap:16px;padding:16px}.group-layout>div{flex:1 1 auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: JsonFormsModule }, { kind: "directive", type: i2$4.JsonFormsOutlet, selector: "jsonforms-outlet", inputs: ["renderProps"] }, { kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i3$2.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3$2.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { kind: "pipe", type: LayoutChildrenRenderPropsPipe, name: "layoutChildrenRenderProps" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: GroupLayoutRenderer, decorators: [{
type: Component,
args: [{ selector: 'GroupLayoutRenderer', template: `
<mat-card
[ngStyle]="{ display: hidden ? 'none' : '' }"
appearance="outlined"
class="group-layout"
>
<mat-card-title class="mat-headline-6">{{ label }}</mat-card-title>
<div
*ngFor="
let props of uischema | layoutChildrenRenderProps : schema : path;
trackBy: trackElement
"
>
<jsonforms-outlet [renderProps]="props"></jsonforms-outlet>
</div>
</mat-card>
`, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
CommonModule,
JsonFormsModule,
LayoutChildrenRenderPropsPipe,
MatCardModule,
], styles: [".group-layout{display:flex;flex-direction:column;gap:16px;padding:16px}.group-layout>div{flex:1 1 auto}\n"] }]
}] });
const groupLayoutTester = rankWith(1, uiTypeIs('Group'));
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
class HorizontalLayoutRenderer extends LayoutRenderer {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: HorizontalLayoutRenderer, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: HorizontalLayoutRenderer, isStandalone: true, selector: "HorizontalLayoutRenderer", usesInheritance: true, ngImport: i0, template: `
<div
[ngStyle]="{ display: hidden ? 'none' : '' }"
class="horizontal-layout"
>
<div
*ngFor="
let props of uischema | layoutChildrenRenderProps : schema : path;
trackBy: trackElement
"
>
<jsonforms-outlet [renderProps]="props"></jsonforms-outlet>
</div>
</div>
`, isInline: true, styles: [".horizontal-layout{display:flex;gap:16px;flex-flow:row wrap;align-items:flex-start;place-content:flex-start center}.horizontal-layout>div{flex:1 1 auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: JsonFormsModule }, { kind: "directive", type: i2$4.JsonFormsOutlet, selector: "jsonforms-outlet", inputs: ["renderProps"] }, { kind: "pipe", type: LayoutChildrenRenderPropsPipe, name: "layoutChildrenRenderProps" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: HorizontalLayoutRenderer, decorators: [{
type: Component,
args: [{ selector: 'HorizontalLayoutRenderer', template: `
<div
[ngStyle]="{ display: hidden ? 'none' : '' }"
class="horizontal-layout"
>
<div
*ngFor="
let props of uischema | layoutChildrenRenderProps : schema : path;
trackBy: trackElement
"
>
<jsonforms-outlet [renderProps]="props"></jsonforms-outlet>
</div>
</div>
`, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, JsonFormsModule, LayoutChildrenRenderPropsPipe], styles: [".horizontal-layout{display:flex;gap:16px;flex-flow:row wrap;align-items:flex-start;place-content:flex-start center}.horizontal-layout>div{flex:1 1 auto}\n"] }]
}] });
const horizontalLayoutTester = rankWith(1, uiTypeIs('HorizontalLayout'));
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
class VerticalLayoutRenderer extends LayoutRenderer {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: VerticalLayoutRenderer, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: VerticalLayoutRenderer, isStandalone: true, selector: "VerticalLayoutRenderer", usesInheritance: true, ngImport: i0, template: `
<div [ngStyle]="{ display: hidden ? 'none' : '' }" class="vertical-layout">
<div
*ngFor="
let props of uischema | layoutChildrenRenderProps : schema : path;
trackBy: trackElement
"
>
<jsonforms-outlet [renderProps]="props"></jsonforms-outlet>
</div>
</div>
`, isInline: true, styles: [".vertical-layout{display:flex;flex-direction:column;gap:16px}.vertical-layout>div{flex:1 1 auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: JsonFormsModule }, { kind: "directive", type: i2$4.JsonFormsOutlet, selector: "jsonforms-outlet", inputs: ["renderProps"] }, { kind: "pipe", type: LayoutChildrenRenderPropsPipe, name: "layoutChildrenRenderProps" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: VerticalLayoutRenderer, decorators: [{
type: Component,
args: [{ selector: 'VerticalLayoutRenderer', template: `
<div [ngStyle]="{ display: hidden ? 'none' : '' }" class="vertical-layout">
<div
*ngFor="
let props of uischema | layoutChildrenRenderProps : schema : path;
trackBy: trackElement
"
>
<jsonforms-outlet [renderProps]="props"></jsonforms-outlet>
</div>
</div>
`, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, JsonFormsModule, LayoutChildrenRenderPropsPipe], styles: [".vertical-layout{display:flex;flex-direction:column;gap:16px}.vertical-layout>div{flex:1 1 auto}\n"] }]
}] });
const verticalLayoutTester = rankWith(1, uiTypeIs('VerticalLayout'));
/*
The MIT License
Copyright (c) 2017-2020 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
class ArrayLayoutRenderer extends JsonFormsAbstractControl {
noData;
translations = {};
addItem;
moveItemUp;
moveItemDown;
removeItems;
uischemas;
mapToProps(state) {
const props = mapStateToArrayLayoutProps(state, this.getOwnProps());
const t = state.jsonforms.i18n?.translate ?? defaultJsonFormsI18nState.translate;
const translations = getArrayTranslations(t, arrayDefaultTranslations, props.i18nKeyPrefix, props.label);
return { ...props, translations };
}
remove(index) {
this.removeItems(this.propsPath, [index])();
}
add() {
this.addItem(this.propsPath, createDefaultValue(this.scopedSchema, this.rootSchema))();
}
up(index) {
this.moveItemUp(this.propsPath, index)();
}
down(index) {
this.moveItemDown(this.propsPath, index)();
}
ngOnInit() {
super.ngOnInit();
const { addItem, removeItems, moveUp, moveDown } = mapDispatchToArrayControlProps(this.jsonFormsService.updateCore.bind(this.jsonFormsService));
this.addItem = addItem;
this.moveItemUp = moveUp;
this.moveItemDown = moveDown;
this.removeItems = removeItems;
}
mapAdditionalProps(props) {
this.noData = !props.data || props.data === 0;
this.uischemas = props.uischemas;
this.translations = props.translations;
}
getProps(index) {
const uischema = findUISchema(this.uischemas, this.scopedSchema, this.uischema.scope, this.propsPath, undefined, this.uischema, this.rootSchema);
if (this.isEnabled()) {
unsetReadonly(uischema);
}
else {
setReadonly(uischema);
}
return {
schema: this.scopedSchema,
path: Paths.compose(this.propsPath, `${index}`),
uischema,
};
}
trackByFn(index) {
return index;
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: ArrayLayoutRenderer, deps: null, target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.24", type: ArrayLayoutRenderer, isStandalone: true, selector: "app-array-layout-renderer", usesInheritance: true, ngImport: i0, template: `
<div [ngStyle]="{ display: hidden ? 'none' : '' }" class="array-layout">
<div class="array-layout-toolbar">
<h2 class="mat-h2 array-layout-title">{{ label }}</h2>
<span></span>
<mat-icon
*ngIf="this.error?.length"
color="warn"
matBadge="{{ this.error.split('\\n').length }}"
matBadgeColor="warn"
matTooltip="{{ this.error }}"
matTooltipClass="error-message-tooltip"
>
error_outline
</mat-icon>
<span></span>
<button
mat-button
matTooltip="{{ translations.addTooltip }}"
[disabled]="!isEnabled()"
(click)="add()"
attr.aria-label="{{ translations.addAriaLabel }}"
>
<mat-icon>add</mat-icon>
</button>
</div>
<p *ngIf="noData">{{ translations.noDataMessage }}</p>
<div
*ngFor="
let item of [].constructor(data);
let idx = index;
trackBy: trackByFn;
last as last;
first as first
"
>
<mat-card class="array-item" appearance="outlined">
<mat-card-content>
<jsonforms-outlet [renderProps]="getProps(idx)"></jsonforms-outlet>
</mat-card-content>
<mat-card-actions *ngIf="isEnabled()">
<button
*ngIf="uischema?.options?.showSortButtons"
class="item-up"
mat-button
[disabled]="first"
(click)="up(idx)"
attr.aria-label="{{ translations.upAriaLabel }}"
matTooltip="{{ translations.up }}"
matTooltipPosition="right"
>
<mat-icon>arrow_upward</mat-icon>
</button>
<button
*ngIf="uischema?.options?.showSortButtons"
class="item-down"
mat-button
[disabled]="last"
(click)="down(idx)"
attr.aria-label="{{ translations.downAriaLabel }}"
matTooltip="{{ translations.down }}"
matTooltipPosition="right"
>
<mat-icon>arrow_downward</mat-icon>
</button>
<button
mat-button
color="warn"
(click)="remove(idx)"
attr.aria-label="{{ translations.removeAriaLabel }}"
matTooltip="{{ translations.removeTooltip }}"
matTooltipPosition="right"
>
<mat-icon>delete</mat-icon>
</button>
</mat-card-actions>
</mat-card>
</div>
</div>
`, isInline: true, styles: [".array-layout{display:flex;flex-direction:column;gap:16px}.array-layout>*{flex:1 1 auto}.array-layout-toolbar{display:flex;align-items:center}.array-layout-title{margin:0}.array-layout-toolbar>span{flex:1 1 auto}.array-item{padding:16px}::ng-deep .error-message-tooltip{white-space:pre-line}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: JsonFormsModule }, { kind: "directive", type: i2$4.JsonFormsOutlet, selector: "jsonforms-outlet", inputs: ["renderProps"] }, { kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i3$2.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i3$2.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { kind: "directive", type: i3$2.MatCardContent, selector: "mat-card-content" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatBadgeModule }, { kind: "directive", type: i6$1.MatBadge, selector: "[matBadge]", inputs: ["matBadgeColor", "matBadgeOverlap", "matBadgeDisabled", "matBadgePosition", "matBadge", "matBadgeDescription", "matBadgeSize", "matBadgeHidden"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i6.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: ArrayLayoutRenderer, decorators: [{
type: Component,
args: [{ selector: 'app-array-layout-renderer', template: `
<div [ngStyle]="{ display: hidden ? 'none' : '' }" class="array-layout">
<div class="array-layout-toolbar">
<h2 class="mat-h2 array-layout-title">{{ label }}</h2>
<span></span>
<mat-icon
*ngIf="this.error?.length"
color="warn"
matBadge="{{ this.error.split('\\n').length }}"
matBadgeColor="warn"
matTooltip="{{ this.error }}"
matTooltipClass="error-message-tooltip"
>
error_outline
</mat-icon>
<span></span>
<button
mat-button
matTooltip="{{ translations.addTooltip }}"
[disabled]="!isEnabled()"
(click)="add()"
attr.aria-label="{{ translations.addAriaLabel }}"
>
<mat-icon>add</mat-icon>
</button>
</div>
<p *ngIf="noData">{{ translations.noDataMessage }}</p>
<div
*ngFor="
let item of [].constructor(data);
let idx = index;
trackBy: trackByFn;
last as last;
first as first
"
>
<mat-card class="array-item" appearance="outlined">
<mat-card-content>
<jsonforms-outlet [renderProps]="getProps(idx)"></jsonforms-outlet>
</mat-card-content>
<mat-card-actions *ngIf="isEnabled()">
<button
*ngIf="uischema?.options?.showSortButtons"
class="item-up"
mat-button
[disabled]="first"
(click)="up(idx)"
attr.aria-label="{{ translations.upAriaLabel }}"
matTooltip="{{ translations.up }}"
matTooltipPosition="right"
>
<mat-icon>arrow_upward</mat-icon>
</button>
<button
*ngIf="uischema?.options?.showSortButtons"
class="item-down"
mat-button
[disabled]="last"
(click)="down(idx)"
attr.aria-label="{{ translations.downAriaLabel }}"
matTooltip="{{ translations.down }}"
matTooltipPosition="right"
>
<mat-icon>arrow_downward</mat-icon>
</button>
<button
mat-button
color="warn"
(click)="remove(idx)"
attr.aria-label="{{ translations.removeAriaLabel }}"
matTooltip="{{ translations.removeTooltip }}"
matTooltipPosition="right"
>
<mat-icon>delete</mat-icon>
</button>
</mat-card-actions>
</mat-card>
</div>
</div>
`, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
CommonModule,
JsonFormsModule,
MatCardModule,
MatButtonModule,
MatIconModule,
MatBadgeModule,
MatTooltipModule,
], styles: [".array-layout{display:flex;flex-direction:column;gap:16px}.array-layout>*{flex:1 1 auto}.array-layout-toolbar{display:flex;align-items:center}.array-layout-title{margin:0}.array-layout-toolbar>span{flex:1 1 auto}.array-item{padding:16px}::ng-deep .error-message-tooltip{white-space:pre-line}\n"] }]
}] });
const ArrayLayoutRendererTester = rankWith(4, isObjectArrayWithNesting);
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
class JsonFormsAngularMaterialModule {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: JsonFormsAngularMaterialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.24", ngImport: i0, type: JsonFormsAngularMaterialModule, imports: [CommonModule,
JsonFormsModule,
MatFormFieldModule,
MatCheckboxModule,
MatInputModule,
MatSliderModule,
MatSlideToggleModule,
MatNativeDateModule,
MatDatepickerModule,
MatTabsModule,
MatSidenavModule,
MatListModule,
ReactiveFormsModule,
MatCardModule,
MatSelectModule,
MatButtonModule,
MatIconModule,
MatAutocompleteModule,
MatTableModule,
MatToolbarModule,
MatTooltipModule,
MatBadgeModule,
BooleanControlRenderer,
TextAreaRenderer,
TextControlRenderer,
NumberControlRenderer,
RangeControlRenderer,
DateControlRenderer,
ToggleControlRenderer,
VerticalLayoutRenderer,
HorizontalLayoutRenderer,
CategorizationTabLayoutRenderer,
GroupLayoutRenderer,
LabelRenderer,
MasterListComponent,
JsonFormsDetailComponent,
ObjectControlRenderer,
EnumControlRenderer,
OneOfEnumControlRenderer,
TableRenderer,
ArrayLayoutRenderer,
LayoutChildrenRenderPropsPipe,
GetProps], exports: [CommonModule,
JsonFormsModule,
MatFormFieldModule,
MatCheckboxModule,
MatInputModule,
MatSliderModule,
MatSlideToggleModule,
MatNativeDateModule,
MatDatepickerModule,
MatTabsModule,
MatSidenavModule,
MatListModule,
ReactiveFormsModule,
MatCardModule,
MatSelectModule,
MatButtonModule,
MatIconModule,
MatAutocompleteModule,
BooleanControlRenderer,
TextAreaRenderer,
TextControlRenderer,
NumberControlRenderer,
RangeControlRenderer,
DateControlRenderer,
ToggleControlRenderer,
VerticalLayoutRenderer,
HorizontalLayoutRenderer,
CategorizationTabLayoutRenderer,
GroupLayoutRenderer,
LabelRenderer,
MasterListComponent,
JsonFormsDetailComponent,
ObjectControlRenderer,
EnumControlRenderer,
OneOfEnumControlRenderer,
TableRenderer,
ArrayLayoutRenderer,
LayoutChildrenRenderPropsPipe,
GetProps] });
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: JsonFormsAngularMaterialModule, imports: [CommonModule,
JsonFormsModule,
MatFormFieldModule,
MatCheckboxModule,
MatInputModule,
MatSliderModule,
MatSlideToggleModule,
MatNativeDateModule,
MatDatepickerModule,
MatTabsModule,
MatSidenavModule,
MatListModule,
ReactiveFormsModule,
MatCardModule,
MatSelectModule,
MatButtonModule,
MatIconModule,
MatAutocompleteModule,
MatTableModule,
MatToolbarModule,
MatTooltipModule,
MatBadgeModule,
BooleanControlRenderer,
TextAreaRenderer,
TextControlRenderer,
NumberControlRenderer,
RangeControlRenderer,
DateControlRenderer,
ToggleControlRenderer,
VerticalLayoutRenderer,
HorizontalLayoutRenderer,
CategorizationTabLayoutRenderer,
GroupLayoutRenderer,
MasterListComponent,
JsonFormsDetailComponent,
ObjectControlRenderer,
EnumControlRenderer,
OneOfEnumControlRenderer,
TableRenderer,
ArrayLayoutRenderer, CommonModule,
JsonFormsModule,
MatFormFieldModule,
MatCheckboxModule,
MatInputModule,
MatSliderModule,
MatSlideToggleModule,
MatNativeDateModule,
MatDatepickerModule,
MatTabsModule,
MatSidenavModule,
MatListModule,
ReactiveFormsModule,
MatCardModule,
MatSelectModule,
MatButtonModule,
MatIconModule,
MatAutocompleteModule] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.24", ngImport: i0, type: JsonFormsAngularMaterialModule, decorators: [{
type: NgModule,
args: [{
imports: [
CommonModule,
JsonFormsModule,
MatFormFieldModule,
MatCheckboxModule,
MatInputModule,
MatSliderModule,
MatSlideToggleModule,
MatNativeDateModule,
MatDatepickerModule,
MatTabsModule,
MatSidenavModule,
MatListModule,
ReactiveFormsModule,
MatCardModule,
MatSelectModule,
MatButtonModule,
MatIconModule,
MatAutocompleteModule,
MatTableModule,
MatToolbarModule,
MatTooltipModule,
MatBadgeModule,
BooleanControlRenderer,
TextAreaRenderer,
TextControlRenderer,
NumberControlRenderer,
RangeControlRenderer,
DateControlRenderer,
ToggleControlRenderer,
VerticalLayoutRenderer,
HorizontalLayoutRenderer,
CategorizationTabLayoutRenderer,
GroupLayoutRenderer,
LabelRenderer,
MasterListComponent,
JsonFormsDetailComponent,
ObjectControlRenderer,
EnumControlRenderer,
OneOfEnumControlRenderer,
TableRenderer,
ArrayLayoutRenderer,
LayoutChildrenRenderPropsPipe,
GetProps,
],
exports: [
CommonModule,
JsonFormsModule,
MatFormFieldModule,
MatCheckboxModule,
MatInputModule,
MatSliderModule,
MatSlideToggleModule,
MatNativeDateModule,
MatDatepickerModule,
MatTabsModule,
MatSidenavModule,
MatListModule,
ReactiveFormsModule,
MatCardModule,
MatSelectModule,
MatButtonModule,
MatIconModule,
MatAutocompleteModule,
BooleanControlRenderer,
TextAreaRenderer,
TextControlRenderer,
NumberControlRenderer,
RangeControlRenderer,
DateControlRenderer,
ToggleControlRenderer,
VerticalLayoutRenderer,
HorizontalLayoutRenderer,
CategorizationTabLayoutRenderer,
GroupLayoutRenderer,
LabelRenderer,
MasterListComponent,
JsonFormsDetailComponent,
ObjectControlRenderer,
EnumControlRenderer,
OneOfEnumControlRenderer,
TableRenderer,
ArrayLayoutRenderer,
LayoutChildrenRenderPropsPipe,
GetProps,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
providers: [],
}]
}] });
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
const angularMaterialRenderers = [
// controls
{ tester: booleanControlTester, renderer: BooleanControlRenderer },
{ tester: TextControlRendererTester, renderer: TextControlRenderer },
{ tester: TextAreaRendererTester, renderer: TextAreaRenderer },
{ tester: NumberControlRendererTester, renderer: NumberControlRenderer },
{ tester: RangeControlRendererTester, renderer: RangeControlRenderer },
{ tester: DateControlRendererTester, renderer: DateControlRenderer },
{ tester: ToggleControlRendererTester, renderer: ToggleControlRenderer },
{ tester: enumControlTester, renderer: EnumControlRenderer },
{ tester: oneOfEnumControlTester, renderer: OneOfEnumControlRenderer },
{ tester: ObjectControlRendererTester, renderer: ObjectControlRenderer },
// layouts
{ tester: verticalLayoutTester, renderer: VerticalLayoutRenderer },
{ tester: groupLayoutTester, renderer: GroupLayoutRenderer },
{ tester: horizontalLayoutTester, renderer: HorizontalLayoutRenderer },
{ tester: categorizationTester, renderer: CategorizationTabLayoutRenderer },
{ tester: LabelRendererTester, renderer: LabelRenderer },
{ tester: ArrayLayoutRendererTester, renderer: ArrayLayoutRenderer },
// other
{ tester: masterDetailTester, renderer: MasterListComponent },
{ tester: TableRendererTester, renderer: TableRenderer },
];
/**
* Generated bundle index. Do not edit.
*/
export { ArrayLayoutRenderer, ArrayLayoutRendererTester, EnumControlRenderer as AutocompleteControlRenderer, BooleanControlRenderer, CategorizationTabLayoutRenderer, DateControlRenderer, DateControlRendererTester, EnumControlRenderer, GetProps, GroupLayoutRenderer, HorizontalLayoutRenderer, JsonFormsAngularMaterialModule, JsonFormsDetailComponent, LabelRenderer, LabelRendererTester, LayoutChildrenRenderPropsPipe, LayoutRenderer, MasterListComponent, NumberControlRenderer, NumberControlRendererTester, ObjectControlRenderer, ObjectControlRendererTester, OneOfEnumControlRenderer, RangeControlRenderer, RangeControlRendererTester, TableRenderer, TableRendererTester, TextAreaRenderer, TextAreaRendererTester, TextControlRenderer, TextControlRendererTester, ToggleControlRenderer, ToggleControlRendererTester, VerticalLayoutRenderer, angularMaterialRenderers, booleanControlTester, categorizationTester, controlWithoutLabel, enumControlTester, groupLayoutTester, horizontalLayoutTester, masterDetailTester, oneOfEnumControlTester, removeSchemaKeywords, verticalLayoutTester };
//# sourceMappingURL=jsonforms-angular-material.mjs.map