Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/angular-material/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ module.exports = {
'@angular-eslint/component-class-suffix': 'off',
'@angular-eslint/directive-class-suffix': 'off',
'@angular-eslint/no-conflicting-lifecycle': 'warn',
// Starting with Angular 19, non-standalone components produce a lint error. Reduce to warning until we migrate.
'@angular-eslint/prefer-standalone': 'warn',
'@typescript-eslint/no-explicit-any': 'off',
// Base rule must be disabled to avoid incorrect errors
'no-unused-vars': 'off',
Expand Down
4 changes: 3 additions & 1 deletion packages/angular-material/example/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
THE SOFTWARE.
*/
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { JsonFormsModule } from '@jsonforms/angular';
import { ExampleDescription, getExamples } from '@jsonforms/examples';
import {
JsonFormsI18nState,
Expand Down Expand Up @@ -87,7 +89,7 @@ const itemTester: UISchemaTester = (_schema, schemaPath, _path) => {
[readonly]="readonly"
></jsonforms>
`,
standalone: false,
imports: [CommonModule, JsonFormsModule],
})
export class AppComponent {
readonly renderers = angularMaterialRenderers;
Expand Down
2 changes: 1 addition & 1 deletion packages/angular-material/example/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ import { AppComponent } from './app.component';
import { JsonFormsAngularMaterialModule } from '../../src/library';

@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
BrowserAnimationsModule,
JsonFormsAngularMaterialModule,
AppComponent,
],
bootstrap: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ import {
} from '@jsonforms/core';
import type { Observable } from 'rxjs';
import { map, startWith } from 'rxjs/operators';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatAutocompleteModule } from '@angular/material/autocomplete';

/**
* To use this component you will need to add your own tester:
Expand Down Expand Up @@ -110,7 +115,13 @@ import { map, startWith } from 'rxjs/operators';
`,
],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false,
imports: [
CommonModule,
ReactiveFormsModule,
MatFormFieldModule,
MatInputModule,
MatAutocompleteModule,
],
})
export class AutocompleteControlRenderer
extends JsonFormsControl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ import {
} from '@angular/core';
import { JsonFormsAngularService, JsonFormsControl } from '@jsonforms/angular';
import { isBooleanControl, RankedTester, rankWith } from '@jsonforms/core';
import { CommonModule } from '@angular/common';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatFormFieldModule } from '@angular/material/form-field';

@Component({
selector: 'BooleanControlRenderer',
Expand Down Expand Up @@ -65,7 +68,7 @@ import { isBooleanControl, RankedTester, rankWith } from '@jsonforms/core';
`,
],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false,
imports: [CommonModule, MatCheckboxModule, MatFormFieldModule],
})
export class BooleanControlRenderer extends JsonFormsControl {
constructor(
Expand Down
17 changes: 15 additions & 2 deletions packages/angular-material/src/library/controls/date.renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ import { JsonFormsAngularService, JsonFormsControl } from '@jsonforms/angular';
import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
import { MyFormat } from '../util/date-format';
import { DayJsDateAdapter } from '../util/dayjs-date-adapter';
import { MatDatepicker } from '@angular/material/datepicker';
import {
MatDatepicker,
MatDatepickerModule,
} from '@angular/material/datepicker';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';

@Component({
selector: 'DateControlRenderer',
Expand Down Expand Up @@ -105,7 +112,13 @@ import { MatDatepicker } from '@angular/material/datepicker';
useClass: MyFormat,
},
],
standalone: false,
imports: [
CommonModule,
ReactiveFormsModule,
MatFormFieldModule,
MatInputModule,
MatDatepickerModule,
],
})
export class DateControlRenderer extends JsonFormsControl {
focused = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ import {
StatePropsOfControl,
} from '@jsonforms/core';
import merge from 'lodash/merge';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';

@Component({
selector: 'NumberControlRenderer',
Expand Down Expand Up @@ -69,7 +73,12 @@ import merge from 'lodash/merge';
`,
],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false,
imports: [
CommonModule,
ReactiveFormsModule,
MatFormFieldModule,
MatInputModule,
],
})
export class NumberControlRenderer extends JsonFormsControl {
private readonly MAXIMUM_FRACTIONAL_DIGITS = 20;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ import {
} from '@angular/core';
import { JsonFormsAngularService, JsonFormsControl } from '@jsonforms/angular';
import { isRangeControl, RankedTester, rankWith } from '@jsonforms/core';
import { CommonModule } from '@angular/common';
import { MatSliderModule } from '@angular/material/slider';
import { MatFormFieldModule } from '@angular/material/form-field';

@Component({
selector: 'RangeControlRenderer',
Expand Down Expand Up @@ -69,7 +72,7 @@ import { isRangeControl, RankedTester, rankWith } from '@jsonforms/core';
`,
],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false,
imports: [CommonModule, MatSliderModule, MatFormFieldModule],
})
export class RangeControlRenderer extends JsonFormsControl {
min: number;
Expand Down
11 changes: 10 additions & 1 deletion packages/angular-material/src/library/controls/text.renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { JsonFormsAngularService, JsonFormsControl } from '@jsonforms/angular';
import { isStringControl, RankedTester, rankWith } from '@jsonforms/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';

@Component({
selector: 'TextControlRenderer',
Expand Down Expand Up @@ -58,7 +62,12 @@ import { isStringControl, RankedTester, rankWith } from '@jsonforms/core';
`,
],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false,
imports: [
CommonModule,
ReactiveFormsModule,
MatFormFieldModule,
MatInputModule,
],
})
export class TextControlRenderer extends JsonFormsControl {
focused = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { JsonFormsAngularService, JsonFormsControl } from '@jsonforms/angular';
import { isMultiLineControl, RankedTester, rankWith } from '@jsonforms/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';

@Component({
selector: 'TextAreaRenderer',
Expand Down Expand Up @@ -57,7 +61,12 @@ import { isMultiLineControl, RankedTester, rankWith } from '@jsonforms/core';
`,
],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false,
imports: [
CommonModule,
ReactiveFormsModule,
MatFormFieldModule,
MatInputModule,
],
})
export class TextAreaRenderer extends JsonFormsControl {
focused = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ import {
RankedTester,
rankWith,
} from '@jsonforms/core';
import { CommonModule } from '@angular/common';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { MatFormFieldModule } from '@angular/material/form-field';

@Component({
selector: 'ToggleControlRenderer',
Expand All @@ -55,7 +58,7 @@ import {
</div>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false,
imports: [CommonModule, MatSlideToggleModule, MatFormFieldModule],
})
export class ToggleControlRenderer extends JsonFormsControl {
constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,16 @@
THE SOFTWARE.
*/
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MatCardModule } from '@angular/material/card';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { MatBadgeModule } from '@angular/material/badge';
import { MatTooltipModule } from '@angular/material/tooltip';
import {
JsonFormsAngularService,
JsonFormsAbstractControl,
JsonFormsModule,
} from '@jsonforms/angular';
import {
arrayDefaultTranslations,
Expand Down Expand Up @@ -161,7 +168,15 @@ import {
`,
],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false,
imports: [
CommonModule,
JsonFormsModule,
MatCardModule,
MatButtonModule,
MatIconModule,
MatBadgeModule,
MatTooltipModule,
],
})
export class ArrayLayoutRenderer
extends JsonFormsAbstractControl<StatePropsOfArrayLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ import { Component, OnInit } from '@angular/core';
import {
JsonFormsAngularService,
JsonFormsBaseRenderer,
JsonFormsModule,
} from '@jsonforms/angular';
import { CommonModule } from '@angular/common';
import { MatTabsModule } from '@angular/material/tabs';

@Component({
selector: 'jsonforms-categorization-layout',
Expand All @@ -66,7 +69,7 @@ import {
</mat-tab>
</mat-tab-group>
`,
standalone: false,
imports: [CommonModule, JsonFormsModule, MatTabsModule],
})
export class CategorizationTabLayoutRenderer
extends JsonFormsBaseRenderer<Categorization>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ import {
Component,
} from '@angular/core';
import { GroupLayout, RankedTester, rankWith, uiTypeIs } from '@jsonforms/core';
import { LayoutRenderer } from './layout.renderer';
import { JsonFormsAngularService } from '@jsonforms/angular';
import {
LayoutRenderer,
LayoutChildrenRenderPropsPipe,
} from './layout.renderer';
import { JsonFormsAngularService, JsonFormsModule } from '@jsonforms/angular';
import { CommonModule } from '@angular/common';
import { MatCardModule } from '@angular/material/card';

@Component({
selector: 'GroupLayoutRenderer',
Expand Down Expand Up @@ -64,7 +69,12 @@ import { JsonFormsAngularService } from '@jsonforms/angular';
`,
],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false,
imports: [
CommonModule,
JsonFormsModule,
LayoutChildrenRenderPropsPipe,
MatCardModule,
],
})
export class GroupLayoutRenderer extends LayoutRenderer<GroupLayout> {
constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ import {
rankWith,
uiTypeIs,
} from '@jsonforms/core';
import { LayoutRenderer } from './layout.renderer';
import { JsonFormsAngularService } from '@jsonforms/angular';
import {
LayoutRenderer,
LayoutChildrenRenderPropsPipe,
} from './layout.renderer';
import { JsonFormsAngularService, JsonFormsModule } from '@jsonforms/angular';
import { CommonModule } from '@angular/common';

@Component({
selector: 'HorizontalLayoutRenderer',
Expand Down Expand Up @@ -68,7 +72,7 @@ import { JsonFormsAngularService } from '@jsonforms/angular';
`,
],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false,
imports: [CommonModule, JsonFormsModule, LayoutChildrenRenderPropsPipe],
})
export class HorizontalLayoutRenderer extends LayoutRenderer<HorizontalLayout> {
constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import {

@Component({
template: '',
standalone: false,
})
export class LayoutRenderer<T extends Layout>
extends JsonFormsBaseRenderer<T>
Expand Down Expand Up @@ -80,7 +79,7 @@ export class LayoutRenderer<T extends Layout>
}
}

@Pipe({ name: 'layoutChildrenRenderProps', standalone: false })
@Pipe({ name: 'layoutChildrenRenderProps' })
export class LayoutChildrenRenderPropsPipe implements PipeTransform {
transform(
uischema: Layout,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ import {
uiTypeIs,
VerticalLayout,
} from '@jsonforms/core';
import { LayoutRenderer } from './layout.renderer';
import { JsonFormsAngularService } from '@jsonforms/angular';
import {
LayoutRenderer,
LayoutChildrenRenderPropsPipe,
} from './layout.renderer';
import { JsonFormsAngularService, JsonFormsModule } from '@jsonforms/angular';
import { CommonModule } from '@angular/common';

@Component({
selector: 'VerticalLayoutRenderer',
Expand Down Expand Up @@ -63,7 +67,7 @@ import { JsonFormsAngularService } from '@jsonforms/angular';
`,
],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false,
imports: [CommonModule, JsonFormsModule, LayoutChildrenRenderPropsPipe],
})
export class VerticalLayoutRenderer extends LayoutRenderer<VerticalLayout> {
constructor(
Expand Down
Loading