@formio/angular
Version:
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.1.4.
354 lines (334 loc) • 15.4 kB
TypeScript
import * as i0 from '@angular/core';
import { InjectionToken, OnInit, OnChanges, OnDestroy, NgZone, EventEmitter, ElementRef, PipeTransform } from '@angular/core';
import { Formio, Form, FormBuilder } from '@formio/js';
export { Formio, Utils as FormioUtils } from '@formio/js';
import { ExtendedComponentSchema, ValidateOptions } from '@formio/deprecated-types';
export { ComponentSchema, ElementInfo, ExtendedComponentSchema } from '@formio/deprecated-types';
import { Observable } from 'rxjs';
import * as i8 from '@angular/common';
declare const FORMIO_CONFIG: InjectionToken<unknown>;
declare class FormioAppConfig {
[x: string]: any;
appUrl: string;
apiUrl: string;
icons?: string;
formOnly?: boolean;
formio?: Formio;
constructor(config?: {
apiUrl?: string;
baseUrl?: string;
appUrl?: string;
projectUrl?: string;
});
static ɵfac: i0.ɵɵFactoryDeclaration<FormioAppConfig, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<FormioAppConfig>;
}
declare enum AlertsPosition {
none = 0,
top = 1,
bottom = 2,
both = 3
}
interface ComponentOptions<T = any, V extends ValidateOptions = ValidateOptions> extends ExtendedComponentSchema<T> {
validate?: V;
}
interface FormioRefreshValue {
property?: string;
value?: object;
form?: object;
submission?: object;
}
interface AccessSetting {
type: string;
roles: string[];
}
interface FormioReport {
form: string;
roles: object;
access: object;
metadata: object;
data: object;
project: string;
}
interface FormioForm {
title?: string;
display?: string;
name?: string;
path?: string;
type?: string;
project?: string;
template?: string;
components?: ExtendedComponentSchema[];
tags?: string[];
access?: AccessSetting[];
submissionAccess?: AccessSetting[];
report?: FormioReport;
}
interface ComponentInstance {
component: ExtendedComponentSchema;
id: string;
type: string;
asString?(value: any): string;
getView(value: any): string;
}
interface AlertsOptions {
submitMessage: string;
}
interface ErrorsOptions {
message: string;
}
declare class FormioError {
message: string;
component: ExtendedComponentSchema;
silent?: boolean;
constructor(message: string, component: ExtendedComponentSchema, silent?: boolean);
}
type FormioSubmissionCallback = (error: FormioError, submission: object) => void;
type FormioBeforeSubmit = (submission: object, callback: FormioSubmissionCallback) => void;
interface FormioHookOptions {
beforeSubmit: FormioBeforeSubmit;
}
interface AngularFormioOptions {
errors?: ErrorsOptions;
alerts?: AlertsOptions;
alertsPosition?: AlertsPosition;
disableAlerts?: boolean;
}
declare class FormioService {
url: string;
options?: object;
formio: any;
constructor(url: string, options?: object);
requestWrapper(fn: any): any;
saveForm(form: FormioForm, options?: any): Observable<FormioForm>;
loadForm(query?: any, options?: any): Observable<FormioForm>;
loadForms(query: any, options?: any): Observable<FormioForm>;
loadSubmission(query?: any, options?: any): Observable<{}>;
userPermissions(user: any, form: any, submission: any): Observable<{}>;
deleteSubmission(data?: any, options?: any): Observable<{}>;
saveSubmission(submission: {}, options?: any): Observable<{}>;
loadSubmissions(query?: any, options?: any): Observable<{}>;
}
declare class FormioPromiseService {
url: string;
options?: object;
private formioService;
constructor(url: string, options?: object);
saveForm(form: FormioForm, options?: any): Promise<any>;
loadForm(query?: any, options?: any): Promise<any>;
loadSubmission(query?: any, options?: any): Promise<any>;
userPermissions(user: any, form: any, submission: any): Promise<any>;
deleteSubmission(data?: any, options?: any): Promise<any>;
loadForms(query: any, options?: any): Promise<any>;
saveSubmission(submission: {}, options?: any): Promise<any>;
loadSubmissions(query?: any, options?: any): Promise<any>;
}
declare function extendRouter(Class: any, config: any, ClassRoutes: any): any;
interface FormioAlert {
type: string;
message: string;
component?: any;
}
declare class FormioAlerts {
alerts: FormioAlert[];
setAlert(alert: FormioAlert): void;
addAlert(alert: FormioAlert): void;
setAlerts(alerts: FormioAlert[]): void;
}
declare class CustomTagsService {
tags: string[];
addCustomTag(tag: string): void;
static ɵfac: i0.ɵɵFactoryDeclaration<CustomTagsService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<CustomTagsService>;
}
declare class FormioBaseComponent implements OnInit, OnChanges, OnDestroy {
ngZone: NgZone;
config: FormioAppConfig;
customTags?: CustomTagsService;
form?: FormioForm;
submission?: any;
src?: string;
url?: string;
service?: FormioService;
options?: Form['options'] & AngularFormioOptions;
noeval?: boolean;
formioOptions?: any;
renderOptions?: any;
readOnly?: boolean;
viewOnly?: boolean;
hideLoading?: boolean;
hideComponents?: string[];
refresh?: EventEmitter<FormioRefreshValue>;
error?: EventEmitter<any>;
success?: EventEmitter<object>;
submitDone?: EventEmitter<object>;
language?: EventEmitter<string> | string;
hooks?: any;
renderer?: any;
watchSubmissionErrors?: boolean;
dataTableActions?: any;
render: EventEmitter<object>;
customEvent: EventEmitter<object>;
fileUploadingStatus: EventEmitter<string>;
submit: EventEmitter<object>;
prevPage: EventEmitter<object>;
nextPage: EventEmitter<object>;
beforeSubmit: EventEmitter<object>;
rowAdd: EventEmitter<any>;
rowAdded: EventEmitter<any>;
rowEdit: EventEmitter<any>;
rowEdited: EventEmitter<any>;
rowDelete: EventEmitter<any>;
rowClick: EventEmitter<any>;
rowSelectChange: EventEmitter<any>;
page: EventEmitter<any>;
changeItemsPerPage: EventEmitter<any>;
change: EventEmitter<object>;
invalid: EventEmitter<boolean>;
errorChange: EventEmitter<any>;
formLoad: EventEmitter<any>;
submissionLoad: EventEmitter<any>;
ready: EventEmitter<FormioBaseComponent>;
formioElement?: ElementRef<any>;
AlertsPosition: typeof AlertsPosition;
formio: any;
initialized: boolean;
alerts: FormioAlerts;
formioReady: Promise<any>;
private formioReadyResolve;
private submitting;
private submissionSuccess;
isLoading: boolean;
noAlerts: boolean;
label: string;
constructor(ngZone: NgZone, config: FormioAppConfig, customTags?: CustomTagsService);
getRenderer(): any;
getRendererOptions(): any;
createRenderer(): any;
setFormUrl(url: any): void;
setForm(form: FormioForm): any;
attachFormEvents(): void;
initialize(): void;
ngOnInit(): void;
setFormFromSrc(): void;
ngOnDestroy(): void;
onRefresh(refresh: FormioRefreshValue): void;
ngOnChanges(changes: any): void;
onPrevPage(data: any): void;
onNextPage(data: any): void;
onSubmit(submission: any, saved: boolean, noemit?: boolean): void;
onError(err: any): void;
focusOnComponet(key: any): void;
submitExecute(submission: object, saved?: boolean): void;
submitForm(submission: any, saved?: boolean): void;
onChange(value: any, flags: any, isModified: boolean): void;
static ɵfac: i0.ɵɵFactoryDeclaration<FormioBaseComponent, [null, { optional: true; }, { optional: true; }]>;
static ɵcmp: i0.ɵɵComponentDeclaration<FormioBaseComponent, "ng-component", never, { "form": { "alias": "form"; "required": false; }; "submission": { "alias": "submission"; "required": false; }; "src": { "alias": "src"; "required": false; }; "url": { "alias": "url"; "required": false; }; "service": { "alias": "service"; "required": false; }; "options": { "alias": "options"; "required": false; }; "noeval": { "alias": "noeval"; "required": false; }; "formioOptions": { "alias": "formioOptions"; "required": false; }; "renderOptions": { "alias": "renderOptions"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; }; "viewOnly": { "alias": "viewOnly"; "required": false; }; "hideLoading": { "alias": "hideLoading"; "required": false; }; "hideComponents": { "alias": "hideComponents"; "required": false; }; "refresh": { "alias": "refresh"; "required": false; }; "error": { "alias": "error"; "required": false; }; "success": { "alias": "success"; "required": false; }; "submitDone": { "alias": "submitDone"; "required": false; }; "language": { "alias": "language"; "required": false; }; "hooks": { "alias": "hooks"; "required": false; }; "renderer": { "alias": "renderer"; "required": false; }; "watchSubmissionErrors": { "alias": "watchSubmissionErrors"; "required": false; }; "dataTableActions": { "alias": "dataTableActions"; "required": false; }; }, { "render": "render"; "customEvent": "customEvent"; "fileUploadingStatus": "fileUploadingStatus"; "submit": "submit"; "prevPage": "prevPage"; "nextPage": "nextPage"; "beforeSubmit": "beforeSubmit"; "rowAdd": "rowAdd"; "rowAdded": "rowAdded"; "rowEdit": "rowEdit"; "rowEdited": "rowEdited"; "rowDelete": "rowDelete"; "rowClick": "rowClick"; "rowSelectChange": "rowSelectChange"; "page": "page"; "changeItemsPerPage": "changeItemsPerPage"; "change": "change"; "invalid": "invalid"; "errorChange": "errorChange"; "formLoad": "formLoad"; "submissionLoad": "submissionLoad"; "ready": "ready"; }, never, never, false, never>;
}
declare class FormioComponent extends FormioBaseComponent implements OnInit, OnChanges {
ngZone: NgZone;
config: FormioAppConfig;
customTags?: CustomTagsService;
constructor(ngZone: NgZone, config: FormioAppConfig, customTags?: CustomTagsService);
getRenderer(): any;
static ɵfac: i0.ɵɵFactoryDeclaration<FormioComponent, [null, { optional: true; }, { optional: true; }]>;
static ɵcmp: i0.ɵɵComponentDeclaration<FormioComponent, "formio", never, {}, {}, never, never, false, never>;
}
declare class FormBuilderComponent implements OnInit, OnChanges, OnDestroy {
private ngZone;
private config;
private customTags?;
ready: Promise<object>;
readyResolve: any;
formio: any;
builder: FormBuilder;
componentAdding: boolean;
private refreshSubscription;
form?: FormioForm;
options?: FormBuilder['options'] & AngularFormioOptions;
formbuilder?: any;
noeval?: boolean;
refresh?: Observable<void>;
rebuild?: Observable<object>;
change: EventEmitter<object>;
builderElement?: ElementRef<any>;
constructor(ngZone: NgZone, config: FormioAppConfig, customTags?: CustomTagsService);
ngOnInit(): void;
setInstance(instance: any): any;
setDisplay(display: String, prevDisplay?: string): void;
buildForm(form: any, prevForm?: any): any;
rebuildForm(form: any, options?: object): Promise<any>;
ngOnChanges(changes: any): void;
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<FormBuilderComponent, [null, { optional: true; }, { optional: true; }]>;
static ɵcmp: i0.ɵɵComponentDeclaration<FormBuilderComponent, "form-builder", never, { "form": { "alias": "form"; "required": false; }; "options": { "alias": "options"; "required": false; }; "formbuilder": { "alias": "formbuilder"; "required": false; }; "noeval": { "alias": "noeval"; "required": false; }; "refresh": { "alias": "refresh"; "required": false; }; "rebuild": { "alias": "rebuild"; "required": false; }; }, { "change": "change"; }, never, never, false, never>;
}
declare class FormioReportComponent extends FormioComponent implements OnInit, OnChanges {
report?: FormioReport;
projectEndpoint?: string;
fetchDataError: EventEmitter<any>;
formioElement?: ElementRef<any>;
isReportLoading: boolean;
setFormFromSrc(): void;
setFormUrl(url: any): void;
ngOnChanges(changes: any): void;
getRendererOptions(): any;
createRenderer(): any;
attachFormEvents(): void;
getRenderer(): any;
static ɵfac: i0.ɵɵFactoryDeclaration<FormioReportComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<FormioReportComponent, "formio-report", never, { "report": { "alias": "report"; "required": false; }; "projectEndpoint": { "alias": "projectEndpoint"; "required": false; }; }, { "fetchDataError": "fetchDataError"; }, never, never, false, never>;
}
declare class FormioLoaderComponent {
isLoading: boolean;
static ɵfac: i0.ɵɵFactoryDeclaration<FormioLoaderComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<FormioLoaderComponent, "formio-loader", never, { "isLoading": { "alias": "isLoading"; "required": false; }; }, {}, never, never, false, never>;
}
declare class FormioAlertsComponent implements OnInit {
alerts: FormioAlerts;
focusComponent: EventEmitter<object>;
ngOnInit(): void;
getComponent(event: any, alert: any): void;
static ɵfac: i0.ɵɵFactoryDeclaration<FormioAlertsComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<FormioAlertsComponent, "formio-alerts", never, { "alerts": { "alias": "alerts"; "required": false; }; }, { "focusComponent": "focusComponent"; }, never, never, false, never>;
}
declare class ParseHtmlContentPipe implements PipeTransform {
transform(content: any): string;
static ɵfac: i0.ɵɵFactoryDeclaration<ParseHtmlContentPipe, never>;
static ɵpipe: i0.ɵɵPipeDeclaration<ParseHtmlContentPipe, "parseHtmlContent", false>;
}
declare class FormioModule {
static ɵfac: i0.ɵɵFactoryDeclaration<FormioModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<FormioModule, [typeof FormioComponent, typeof FormioReportComponent, typeof FormioBaseComponent, typeof FormBuilderComponent, typeof FormioLoaderComponent, typeof FormioAlertsComponent, typeof ParseHtmlContentPipe], [typeof i8.CommonModule], [typeof FormioComponent, typeof FormioReportComponent, typeof FormBuilderComponent, typeof FormioLoaderComponent, typeof FormioAlertsComponent]>;
static ɵinj: i0.ɵɵInjectorDeclaration<FormioModule>;
}
interface FormioMetadata {
timezone?: string;
offset?: number;
origin?: string;
referrer?: string;
browserName?: string;
userAgent?: string;
pathName?: string;
onLine?: boolean;
}
interface FormioSubmission<T = any, stateType = FormioSubmissionState> {
_id?: string;
created?: string;
data?: T;
form?: string;
metadata?: FormioMetadata;
modified?: string;
owner?: string;
project?: string;
state?: stateType;
_fvid?: number;
_vid?: number;
}
declare enum FormioSubmissionState {
draft = "draft",
submitted = "submitted"
}
export { CustomTagsService, FORMIO_CONFIG, FormBuilderComponent, FormioAlerts, FormioAlertsComponent, FormioAppConfig, FormioBaseComponent, FormioComponent, FormioError, FormioLoaderComponent, FormioModule, FormioPromiseService, FormioReportComponent, FormioService, extendRouter };
export type { AccessSetting, AlertsOptions, AngularFormioOptions, ComponentInstance, ComponentOptions, ErrorsOptions, FormioAlert, FormioBeforeSubmit, FormioForm, FormioHookOptions, FormioRefreshValue, FormioReport, FormioSubmission, FormioSubmissionCallback };
//# sourceMappingURL=index.d.ts.map