import { Type } from '@angular/core'; import { AbstractControlOptions, FormGroup } from '@angular/forms'; import { FieldType, IQuery, IAppState, ISessResp } from '../base'; import { Observable } from 'rxjs'; export declare enum ControlType { input = 0, text = 1, textArea = 2, psswdText = 3, select = 4, selectMultiple = 5, dropDown = 6, searchDropDown = 7, ddlCountries = 8, ddlIcons = 9, ddlNotifications = 10, radioButton = 11, dualRaido = 12, dualSwitch = 13, checkBox = 14, toggleSwitch = 15, ngToggle = 16, rangeInput = 17, dateSelector = 18, upload = 19, action = 20, status = 21 } /** * define where a field item can be applied * eg a field item can be applied on create form but * is not applicable for table generation */ export declare enum FieldFor { createForm = 0, tableDisplay = 1, editForm = 2, deleteForm = 3 } export interface ControlFor { name?: string; fieldFor: FieldFor; controlType: ControlType; } export interface FieldInfo { title: string; name: string; primaryField?: string; type?: FieldType; index?: boolean; dbName?: string; searchable?: boolean; fetchable?: boolean; savable?: boolean; updateable?: boolean; disabled?: boolean; show?: boolean; controls: ControlFor[]; ddlInfo?: DdlInfo; controlData?: any[]; formatt?: string; isNameField?: boolean; ActionType?: ActionType; Fn?: string; /** * formControlsConfig: * used by angular formBuilder to output the form group * the data also controlls form validation * - the type defined below is taken from angular input for form builder */ formControlsConfig?: { [key: string]: any; }; options?: AbstractControlOptions | null | undefined; } export interface DdlInfo { config?: any; header?: { title: { lable: string; cls: string; action: any; }; sideLink: { lable: string; cls: string; action: any; }; }; footer?: { label: string; icon: string; action: any; }; selData$: Observable; selValueField: string; selIndex: string; selPlaceholder?: string; ddlIconId?: string; searchInputId?: string; searchInputName?: string; selectedValue?: string; iconButtonId?: string; data: any; } export interface SelectData { value: string; text: string; } export interface EmittedDdlSelection { step: AWizardStep | null; controlName: string; } export interface DdlIconItem { cls: string; action?: any; numericLabel?: number; icon: { cls: string; }; text: string; id?: number; tags: string; } export interface DdlCtx { getFn$: Observable | null; selIndex: string; selValueField: string; controlName: string; fetchFields: string[]; step: AWizardStep | null; token: string | null; } export interface MultipleChoice { controllerName: string; selectedItem: OptionItem; controlTypes: ControlType; options: OptionItem[]; } export interface OptionItem { index: number; optControlId: string; value: string; selected: boolean; } export interface FaDbItem { attributes: { id: string; membership: { free: string[]; pro: string[]; }; styles: string[]; unicode: string; voted: boolean; }; id: string; links: { self: string; }; type: string; tags?: string; } export declare enum TRenderMode { pgInit = 0, pgPrev = 1, pgNext = 2 } export interface TRenderCtx { renderMode: TRenderMode; startPage: number; } export interface StatusField { value: string; class: string; } export interface TDS { fields: FieldInfo[]; data: any[]; } export interface Page { thisPage: number; displayPage: boolean | null; isActive: boolean; items: number[]; } export interface TPD { totalRows: number; totalPages: number | null; pageRows: number; maxPages: number; startPage: number; pages: Page[]; activePage: number; } export interface DsEmittData { sQuery: IQuery; ctx: number; tpData: TPD; } export interface FieldAlias { toReplace: string; replaceWith: string; } export declare const DEFAULT_TPD: TPD; /** * will require refinement * see NazTableService::hDdl(iClient: any) * menuName and menuGuid are freeks */ export interface DdlData { config?: { suppressScrollX: boolean; wheelSpeed: any; }; header?: { title: { lable: 'Notifications'; cls: ''; action: null; }; sideLink: { lable: 'View All'; cls: ''; action: null; }; }; footer?: { label: 'View All'; icon: ''; action: null; }; data?: any[]; menuName?: string; menuGuid?: string; navLocation?: string; actionType?: ActionType; fn?: string; } export declare const DEFAULT_DDL_DATA: DdlData; export declare enum ActionType { navigate = 0, execFn = 1 } export interface GuigTableCol { index: number; name: string; map?: string; tField?: string; dataType?: string; icon?: string; controlTytypepe: string; action?: string; editable?: boolean; disabled?: boolean; hide?: boolean; alt?: any[]; } export interface GuigTableConfig { columns: GuigTableCol[]; } export interface TabMeta { title: string; options: any; } export declare class TabItem { component: Type; data: TabMeta; constructor(component: Type, data: TabMeta); } export interface TabComponent { data: any; } export interface AWizardModel { name: string; steps: AWizardStep[]; } export interface AWizardStep { token: string; stepTitle: string; stepItems: { prevButtonId?: string; nextButtonId?: string; lastButtonId?: string; }; tabPaneId: string; cardTitle: string; cardTitleDesc: string; module: string; controller: string; fields: FieldInfo[]; formGroup: FormGroup | null; } export interface ValidationError { control: string; error: string; value: string; } export interface StepModel { token: string; stepTitle: string; stepItems: any; tabPaneId: string; cardTitle: string; cardTitleDesc: string; module: string; controller: string; formGroup: any; fields: FieldInfo[]; } /** * for use in base model * to contain common items * whether component is * create, list, edit, or delet */ export interface BaseModelCtx { create?: object; list?: object; edit?: object; delete?: object; } export declare class BaseModel { module: string; controller: string; token: string; jAppState: IAppState; sess: ISessResp; data: { title: string; subTitle: string; fields: FieldInfo[]; step: AWizardStep; wizardModel: AWizardModel; rowId: number; rowData: any; form: FormGroup; }; breadCrumbItems: Array<{}>; ctx: BaseModelCtx; controllerRoutes: { listRoute: string; editRoute: string; deleteRoute: string; createRoute: string; }; constructor(module: string, controller: string); init(module: string, controller: string): void; } export declare const EMAIL_PATTERN = "^[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$"; export declare const URL_PATTERN = "(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?";