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
8 changes: 4 additions & 4 deletions projects/angular-formio/embed/src/builder.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, ElementRef, Input, ViewChild, Output, EventEmitter, AfterViewInit } from '@angular/core';
import { FormBuilder } from '@formio/js';
import {Form, FormBuilder, Webform} from '@formio/js';
import WebformBuilder from '@formio/js/lib/cjs/WebformBuilder';

@Component({
Expand All @@ -8,8 +8,8 @@ import WebformBuilder from '@formio/js/lib/cjs/WebformBuilder';
})
export class FormioBuilder implements AfterViewInit {
@ViewChild('formio') element: ElementRef;
@Input() form?: Object | null;
@Input() options?: Object = {};
@Input() form?: Form['options'] | null;
@Input() options?: FormBuilder['options'] = {};
@Output() change = new EventEmitter<any>();
@Output() ready = new EventEmitter<any>();
@Output() error = new EventEmitter<any>();
Expand Down Expand Up @@ -65,4 +65,4 @@ export class FormioBuilder implements AfterViewInit {
this.ready.emit(this.instance);
}).catch((err) => this.error.emit(err));
}
}
}
10 changes: 5 additions & 5 deletions projects/angular-formio/embed/src/formio.component.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { Component, ViewChild, ElementRef, Input, Output, EventEmitter, OnChanges, AfterViewInit } from '@angular/core';
import { FormioCore as Formio, Webform } from '@formio/js';
import { Form, Submission } from '@formio/core/types'
import { FormioCore as Formio, Webform, Form } from '@formio/js';
import { Form as formType, Submission } from '@formio/core/types';

@Component({
selector: 'formio',
template: '<div #formio></div>'
})
export class FormioComponent implements AfterViewInit {
@Input() src?: string;
@Input() form?: Form | null;
@Input() form?: formType | null;
@Input() submission?: Submission | null;
@Input() url?: string;
@Input() options?: Webform["options"] = {};
@Input() options?: Form['options'] = {};
@Output() ready = new EventEmitter<Webform>();
@Output() submit = new EventEmitter<object>();
@Output() error = new EventEmitter<any>();
Expand All @@ -33,4 +33,4 @@ export class FormioComponent implements AfterViewInit {
form.on('change', (event) => this.change.emit(event));
}).catch((err) => this.error.emit(err));
}
}
}
10 changes: 5 additions & 5 deletions projects/angular-formio/src/FormioBaseComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { Component, ElementRef, EventEmitter, Input, NgZone, OnChanges, OnDestro
import { FormioService } from './formio.service';
import { FormioAlerts } from './components/alerts/formio.alerts';
import { FormioAppConfig } from './formio.config';
import { FormioError, FormioForm, FormioOptions, FormioRefreshValue } from './formio.common';
import {AngularFormioOptions, FormioError, FormioForm, FormioRefreshValue} from './formio.common';
import { assign, get, isEmpty } from 'lodash';
import { CustomTagsService } from './custom-tags.service';
import { Utils } from '@formio/js';
import {Form, Utils, Webform} from '@formio/js';
import { AlertsPosition } from './types/alerts-position';
const { Evaluator, fastCloneDeep } = Utils;

Expand All @@ -18,7 +18,7 @@ export class FormioBaseComponent implements OnInit, OnChanges, OnDestroy {
@Input() src?: string;
@Input() url?: string;
@Input() service?: FormioService;
@Input() options?: FormioOptions;
@Input() options?: Form['options'] & AngularFormioOptions;
@Input() noeval ? = Evaluator.noeval;
@Input() formioOptions?: any;
@Input() renderOptions?: any;
Expand All @@ -34,7 +34,7 @@ export class FormioBaseComponent implements OnInit, OnChanges, OnDestroy {
@Input() hooks?: any = {};
@Input() renderer?: any;
@Input() watchSubmissionErrors ? = false;
@Input() dataTableActions? : any = []
@Input() dataTableActions?: any = [];
@Output() render = new EventEmitter<object>();
@Output() customEvent = new EventEmitter<object>();
@Output() fileUploadingStatus = new EventEmitter<string>();
Expand Down Expand Up @@ -213,7 +213,7 @@ export class FormioBaseComponent implements OnInit, OnChanges, OnDestroy {
}

const extraTags = this.customTags ? this.customTags.tags : [];
const defaultOptions: FormioOptions = {
const defaultOptions: Form['options'] & AngularFormioOptions = {
errors: {
message: 'Please fix the following errors before submitting.'
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import {
} from '@angular/core';
import { FormioAppConfig } from '../../formio.config';
import {
AngularFormioOptions,
FormioForm,
FormioOptions
} from '../../formio.common';
import { Formio, FormBuilder, Utils } from '@formio/js';
import { assign } from 'lodash';
Expand All @@ -38,7 +38,7 @@ export class FormBuilderComponent implements OnInit, OnChanges, OnDestroy {
public componentAdding = false;
private refreshSubscription: Subscription;
@Input() form?: FormioForm;
@Input() options?: FormioOptions;
@Input() options?: FormBuilder['options'] & AngularFormioOptions;
@Input() formbuilder?: any;
@Input() noeval ? = false;
@Input() refresh?: Observable<void>;
Expand Down
20 changes: 8 additions & 12 deletions projects/angular-formio/src/formio.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ export interface AccessSetting {
}

export interface FormioReport {
form: string,
roles: object,
access: object,
metadata: object,
data: object,
project: string,
form: string;
roles: object;
access: object;
metadata: object;
data: object;
project: string;
}

export interface FormioForm {
Expand All @@ -38,7 +38,7 @@ export interface FormioForm {
tags?: string[];
access?: AccessSetting[];
submissionAccess?: AccessSetting[];
report?: FormioReport
report?: FormioReport;
}

export interface ComponentInstance {
Expand Down Expand Up @@ -78,13 +78,9 @@ export interface FormioHookOptions {
beforeSubmit: FormioBeforeSubmit;
}

export interface FormioOptions {
export interface AngularFormioOptions {
errors?: ErrorsOptions;
alerts?: AlertsOptions;
alertsPosition?: AlertsPosition;
disableAlerts?: boolean;
i18n?: object;
fileService?: object;
hooks?: FormioHookOptions;
sanitizeConfig?: any;
}