UNPKG

@formio/angular

Version:

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.1.4.

238 lines (220 loc) 11.2 kB
import * as i0 from '@angular/core'; import { EventEmitter, TemplateRef, OnChanges, OnInit, AfterViewInit, ViewContainerRef, ComponentFactoryResolver, ChangeDetectorRef, OnDestroy, ElementRef, PipeTransform } from '@angular/core'; import * as i14 from '@formio/angular'; import { ComponentInstance, FormioPromiseService, FormioAlerts, FormioSubmission } from '@formio/angular'; import { Tooltip } from 'bootstrap'; import { ExtendedComponentSchema } from '@formio/deprecated-types'; import * as i12 from '@angular/common'; import * as i13 from '@angular/forms'; import * as i15 from '@angular/router'; import * as i16 from 'ngx-bootstrap/pagination'; declare enum GridFooterPositions { bottom = 0, top = 1, both = 2 } interface GridHeader { component?: ComponentInstance; key: string; sort?: SortType; label: string; renderCell?(cellValue: any, component?: ComponentInstance): string; } declare enum SortType { ASC = "asc", DESC = "desc" } declare class GridHeaderComponent { actionAllowed: any; sort: EventEmitter<GridHeader>; template: TemplateRef<any>; headers: Array<GridHeader>; constructor(); get numHeaders(): number; load(formio: FormioPromiseService, query?: any, columns?: Array<any>): Promise<any>; static ɵfac: i0.ɵɵFactoryDeclaration<GridHeaderComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<GridHeaderComponent, "ng-component", never, { "actionAllowed": { "alias": "actionAllowed"; "required": false; }; }, { "sort": "sort"; }, never, never, false, never>; } declare class GridService { rows: Array<any>; constructor(); setRows(rows: any): void; getFormsPerPage(): number; static ɵfac: i0.ɵɵFactoryDeclaration<GridService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<GridService>; } declare class GridBodyComponent { service: GridService; header: GridHeaderComponent; actionAllowed: any; rowSelect: EventEmitter<any>; rowAction: EventEmitter<any>; template: TemplateRef<any>; rows: Array<any>; loading: Boolean; firstItem: number; lastItem: number; skip: number; limit: number; total: number; constructor(service: GridService); load(formio: FormioPromiseService, query?: any): Promise<any>; onRowSelect(event: any, row: any): void; onRowAction(event: any, row: any, action: any): void; /** * Set the rows for this Grid body. * * @param query * @param items * @return any */ setRows(query: any, items: any): any[]; static ɵfac: i0.ɵɵFactoryDeclaration<GridBodyComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<GridBodyComponent, "ng-component", never, { "header": { "alias": "header"; "required": false; }; "actionAllowed": { "alias": "actionAllowed"; "required": false; }; }, { "rowSelect": "rowSelect"; "rowAction": "rowAction"; }, never, never, false, never>; } declare class GridFooterComponent { header: GridHeaderComponent; body: GridBodyComponent; createText: String; size: number; actionAllowed: any; pageChanged: EventEmitter<any>; createItem: EventEmitter<any>; template: TemplateRef<any>; footerPositions: typeof GridFooterPositions; constructor(); static ɵfac: i0.ɵɵFactoryDeclaration<GridFooterComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<GridFooterComponent, "ng-component", never, { "header": { "alias": "header"; "required": false; }; "body": { "alias": "body"; "required": false; }; "createText": { "alias": "createText"; "required": false; }; "size": { "alias": "size"; "required": false; }; "actionAllowed": { "alias": "actionAllowed"; "required": false; }; }, { "pageChanged": "pageChanged"; "createItem": "createItem"; }, never, never, false, never>; } interface GridColumn { label?: string; path: string; renderCell?(cellValue: any, component?: ComponentInstance): string; } declare class FormioGridComponent implements OnChanges, OnInit, AfterViewInit { alerts: FormioAlerts; private resolver; private ref; footerPosition: GridFooterPositions; src?: string; items?: Array<any>; onForm?: Promise<any>; query?: any; refresh?: EventEmitter<object>; columns?: Array<GridColumn>; gridType?: string; size?: number; components?: any; formio?: FormioPromiseService; label?: string; createText: String; isActionAllowed: any; select: EventEmitter<object>; rowSelect: EventEmitter<object>; rowAction: EventEmitter<object>; createItem: EventEmitter<any>; error: EventEmitter<any>; headerElement: ViewContainerRef; bodyElement: ViewContainerRef; footerElement: ViewContainerRef; page: number; isLoading: boolean; initialized: boolean; header: GridHeaderComponent; body: GridBodyComponent; footer: GridFooterComponent; footerPositions: typeof GridFooterPositions; constructor(alerts: FormioAlerts, resolver: ComponentFactoryResolver, ref: ChangeDetectorRef); createComponent(property: any, component: any): any; loadGrid(src?: string): void; ngOnInit(): void; ngOnChanges(changes: any): void; ngAfterViewInit(): void; actionAllowed(action: any): any; onError(error: any): void; refreshGrid(query?: any): any; setPage(num?: number): void; sortColumn(header: GridHeader): void; pageChanged(page: any): void; static ɵfac: i0.ɵɵFactoryDeclaration<FormioGridComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<FormioGridComponent, "formio-grid", never, { "footerPosition": { "alias": "footerPosition"; "required": false; }; "src": { "alias": "src"; "required": false; }; "items": { "alias": "items"; "required": false; }; "onForm": { "alias": "onForm"; "required": false; }; "query": { "alias": "query"; "required": false; }; "refresh": { "alias": "refresh"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "gridType": { "alias": "gridType"; "required": false; }; "size": { "alias": "size"; "required": false; }; "components": { "alias": "components"; "required": false; }; "formio": { "alias": "formio"; "required": false; }; "label": { "alias": "label"; "required": false; }; "createText": { "alias": "createText"; "required": false; }; "isActionAllowed": { "alias": "isActionAllowed"; "required": false; }; }, { "select": "select"; "rowSelect": "rowSelect"; "rowAction": "rowAction"; "createItem": "createItem"; "error": "error"; }, never, never, false, never>; } declare class FormGridHeaderComponent extends GridHeaderComponent { header: GridHeader; load(formio?: any): Promise<GridHeader[]>; get numHeaders(): number; static ɵfac: i0.ɵɵFactoryDeclaration<FormGridHeaderComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<FormGridHeaderComponent, "form-grid-header", never, {}, {}, never, never, false, never>; } declare class FormGridBodyComponent extends GridBodyComponent implements OnDestroy { createBtns: ElementRef[]; viewBtns: ElementRef[]; editBtns: ElementRef[]; permissionsBtns: ElementRef[]; deleteBtns: ElementRef[]; tooltips: Array<Tooltip>; load(formio: FormioPromiseService, query?: any): Promise<void>; attachTooltips(): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration<FormGridBodyComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<FormGridBodyComponent, "form-grid-body", never, {}, {}, never, never, false, never>; } declare class FormGridFooterComponent extends GridFooterComponent implements OnInit { constructor(); ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration<FormGridFooterComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<FormGridFooterComponent, "ng-component", never, {}, {}, never, never, false, never>; } declare class SubmissionGridHeaderComponent extends GridHeaderComponent { formComponents: Map<string, ExtendedComponentSchema>; load(formio: FormioPromiseService, query?: any, columns?: Array<GridColumn>): Promise<GridHeader[]>; setHeader(header: GridHeader): void; getHeaderForColumn(column: GridColumn, component?: ExtendedComponentSchema, sort?: SortType): { label: string; key: string; sort: SortType; component: ComponentInstance; renderCell: (cellValue: any, component?: ComponentInstance) => string; }; getHeaderForComponent(component: ExtendedComponentSchema, path: string, sort?: SortType): { label: string; key: string; sort: SortType; component: ComponentInstance; }; setComponentsHeaders(components: Map<string, ExtendedComponentSchema>, sort?: SortType): void; setComponents(components: any): void; static ɵfac: i0.ɵɵFactoryDeclaration<SubmissionGridHeaderComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<SubmissionGridHeaderComponent, "ng-component", never, {}, {}, never, never, false, never>; } declare class SubmissionGridBodyComponent extends GridBodyComponent { load(formio: FormioPromiseService, query?: any): Promise<any[]>; /** * Render the cell data. * * @param submission * @param header * @return any */ view(submission: FormioSubmission, header: GridHeader): string; static ɵfac: i0.ɵɵFactoryDeclaration<SubmissionGridBodyComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<SubmissionGridBodyComponent, "ng-component", never, {}, {}, never, never, false, never>; } declare class SubmissionGridFooterComponent extends GridFooterComponent implements OnInit { constructor(); ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration<SubmissionGridFooterComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<SubmissionGridFooterComponent, "ng-component", never, {}, {}, never, never, false, never>; } declare class TimeSince implements PipeTransform { transform(date: Date): string; static ɵfac: i0.ɵɵFactoryDeclaration<TimeSince, never>; static ɵpipe: i0.ɵɵPipeDeclaration<TimeSince, "timeSince", false>; } declare class FormioGrid { static ɵfac: i0.ɵɵFactoryDeclaration<FormioGrid, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<FormioGrid, [typeof FormioGridComponent, typeof FormGridHeaderComponent, typeof FormGridBodyComponent, typeof FormGridFooterComponent, typeof SubmissionGridHeaderComponent, typeof SubmissionGridBodyComponent, typeof SubmissionGridFooterComponent, typeof GridHeaderComponent, typeof GridBodyComponent, typeof GridFooterComponent, typeof TimeSince], [typeof i12.CommonModule, typeof i13.FormsModule, typeof i14.FormioModule, typeof i15.RouterModule, typeof i16.PaginationModule], [typeof FormioGridComponent]>; static ɵinj: i0.ɵɵInjectorDeclaration<FormioGrid>; } export { FormGridBodyComponent, FormGridFooterComponent, FormGridHeaderComponent, FormioGrid, FormioGridComponent, GridBodyComponent, GridFooterComponent, GridHeaderComponent, GridService, SubmissionGridBodyComponent, SubmissionGridFooterComponent, SubmissionGridHeaderComponent }; //# sourceMappingURL=index.d.ts.map