Skip to content

Commit

Permalink
fixed angular builds
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasDev17 committed Apr 13, 2023
1 parent d972a51 commit c8a681e
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 6 deletions.
6 changes: 5 additions & 1 deletion packages/angular-material/example/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ const uiSchema = {
const defaultI18n: JsonFormsI18nState = {
locale: 'en-US'
};

const itemTester: UISchemaTester = (_schema, schemaPath, _path) => {
if (schemaPath === '#/properties/warehouseitems/items') {
return 10;
}
return -1;
};

@Component({
selector: 'app-root',
template: `
Expand Down Expand Up @@ -92,9 +94,11 @@ export class AppComponent {
readonly examples = getExamples();
selectedExample: ExampleDescription;
i18n: JsonFormsI18nState;
currentLocale: string = defaultI18n.locale;
private dateAdapter;
private readonly = false;
readonly = false;
data: any;
config: any = {};
uischemas: { tester: UISchemaTester; uischema: UISchemaElement; }[] = [
{ tester: itemTester, uischema: uiSchema }
];
Expand Down
10 changes: 6 additions & 4 deletions packages/angular-material/example/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,22 @@
THE SOFTWARE.
*/
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { AppComponent } from './app.component';
import { JsonFormsAngularMaterialModule } from '../../src/module';
import { JsonFormsModule } from '@jsonforms/angular';

@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
BrowserAnimationsModule,
JsonFormsAngularMaterialModule
JsonFormsAngularMaterialModule,
JsonFormsModule
],
bootstrap: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule {
}

export class AppModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ import { startWith } from 'rxjs/operators';
})
export class AutocompleteControlRenderer extends JsonFormsControl {
@Input() options: string[];

focused: boolean = false;
filteredOptions: Observable<string[]>;
shouldFilter: boolean;

Expand Down
2 changes: 2 additions & 0 deletions packages/angular-material/src/controls/date.renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ export class DateControlRenderer extends JsonFormsControl {
super(jsonformsService);
}

focused: boolean = false;

getEventValue = (event: any) => event.value.toISOString().substr(0, 10);
}

Expand Down
1 change: 1 addition & 0 deletions packages/angular-material/src/controls/number.renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export class NumberControlRenderer extends JsonFormsControl {
locale: string;
numberFormat: Intl.NumberFormat;
decimalSeparator: string;
focused: boolean = false;

constructor(jsonformsService: JsonFormsAngularService) {
super(jsonformsService);
Expand Down
1 change: 1 addition & 0 deletions packages/angular-material/src/controls/text.renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export class TextControlRenderer extends JsonFormsControl {
constructor(jsonformsService: JsonFormsAngularService) {
super(jsonformsService);
}
focused: boolean = false;
getEventValue = (event: any) => event.target.value || undefined;
getType = (): string => {
if (this.uischema.options && this.uischema.options.format) {
Expand Down
2 changes: 1 addition & 1 deletion packages/angular-material/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"target": "es5"
},
"exclude": ["node_modules"],
"files": ["./src/index.ts"],
"files": ["./src/index.ts", "./example/main.ts"],
"angularCompilerOptions": {
"strictMetadataEmit": true,
"generateCodeForLibraries": false,
Expand Down
2 changes: 2 additions & 0 deletions packages/angular-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"main": "./lib/index.js",
"dependencies": {
"@angular/platform-browser-dynamic": "^14.2.0 || ^15.0.0 || ^15.2.6",
"@angular/core": "^14.2.0 || ^15.0.0 || ^15.2.6",
"@angular/platform-browser": "^14.2.0 || ^15.0.0 || ^15.2.6",
"@jsonforms/angular": "^3.1.0-alpha.1",
"@jsonforms/core": "^3.1.0-alpha.1"
},
Expand Down

0 comments on commit c8a681e

Please sign in to comment.