Skip to content

Commit 962f3dd

Browse files
use form options and formbuilder options types
1 parent 4c730e1 commit 962f3dd

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

projects/angular-formio/embed/src/builder.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, ElementRef, Input, ViewChild, Output, EventEmitter, AfterViewInit } from '@angular/core';
2-
import { FormBuilder } from '@formio/js';
2+
import {Form, FormBuilder, Webform} from '@formio/js';
33
import WebformBuilder from '@formio/js/lib/cjs/WebformBuilder';
44

55
@Component({
@@ -8,8 +8,8 @@ import WebformBuilder from '@formio/js/lib/cjs/WebformBuilder';
88
})
99
export class FormioBuilder implements AfterViewInit {
1010
@ViewChild('formio') element: ElementRef;
11-
@Input() form?: Object | null;
12-
@Input() options?: Object = {};
11+
@Input() form?: Form['options'] | null;
12+
@Input() options?: FormBuilder['options'] = {};
1313
@Output() change = new EventEmitter<any>();
1414
@Output() ready = new EventEmitter<any>();
1515
@Output() error = new EventEmitter<any>();
@@ -65,4 +65,4 @@ export class FormioBuilder implements AfterViewInit {
6565
this.ready.emit(this.instance);
6666
}).catch((err) => this.error.emit(err));
6767
}
68-
}
68+
}

projects/angular-formio/embed/src/formio.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { Component, ViewChild, ElementRef, Input, Output, EventEmitter, OnChanges, AfterViewInit } from '@angular/core';
2-
import { FormioCore as Formio, Webform } from '@formio/js';
3-
import { Form, Submission } from '@formio/core/types';
2+
import { FormioCore as Formio, Webform, Form } from '@formio/js';
3+
import { Form as formType, Submission } from '@formio/core/types';
44

55
@Component({
66
selector: 'formio',
77
template: '<div #formio></div>'
88
})
99
export class FormioComponent implements AfterViewInit {
1010
@Input() src?: string;
11-
@Input() form?: Form | null;
11+
@Input() form?: formType | null;
1212
@Input() submission?: Submission | null;
1313
@Input() url?: string;
14-
@Input() options?: Webform['options'] = {};
14+
@Input() options?: Form['options'] = {};
1515
@Output() ready = new EventEmitter<Webform>();
1616
@Output() submit = new EventEmitter<object>();
1717
@Output() error = new EventEmitter<any>();

projects/angular-formio/src/FormioBaseComponent.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { FormioAppConfig } from './formio.config';
55
import {AngularFormioOptions, FormioError, FormioForm, FormioRefreshValue} from './formio.common';
66
import { assign, get, isEmpty } from 'lodash';
77
import { CustomTagsService } from './custom-tags.service';
8-
import {Utils, Webform} from '@formio/js';
8+
import {Form, Utils, Webform} from '@formio/js';
99
import { AlertsPosition } from './types/alerts-position';
1010
const { Evaluator, fastCloneDeep } = Utils;
1111

@@ -18,7 +18,7 @@ export class FormioBaseComponent implements OnInit, OnChanges, OnDestroy {
1818
@Input() src?: string;
1919
@Input() url?: string;
2020
@Input() service?: FormioService;
21-
@Input() options?: Webform['options'] & AngularFormioOptions;
21+
@Input() options?: Form['options'] & AngularFormioOptions;
2222
@Input() noeval ? = Evaluator.noeval;
2323
@Input() formioOptions?: any;
2424
@Input() renderOptions?: any;
@@ -213,7 +213,7 @@ export class FormioBaseComponent implements OnInit, OnChanges, OnDestroy {
213213
}
214214

215215
const extraTags = this.customTags ? this.customTags.tags : [];
216-
const defaultOptions: Webform['options'] & AngularFormioOptions = {
216+
const defaultOptions: Form['options'] & AngularFormioOptions = {
217217
errors: {
218218
message: 'Please fix the following errors before submitting.'
219219
},

projects/angular-formio/src/components/formbuilder/formbuilder.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class FormBuilderComponent implements OnInit, OnChanges, OnDestroy {
3838
public componentAdding = false;
3939
private refreshSubscription: Subscription;
4040
@Input() form?: FormioForm;
41-
@Input() options?: object & AngularFormioOptions;
41+
@Input() options?: FormBuilder['options'] & AngularFormioOptions;
4242
@Input() formbuilder?: any;
4343
@Input() noeval ? = false;
4444
@Input() refresh?: Observable<void>;

0 commit comments

Comments
 (0)