dynamicsmobile
Version:
Allows development of off-line mobile and web business apps over the Dynamics Mobile platform. More info on https://www.dynamicsmobile.com
129 lines (128 loc) • 5.57 kB
TypeScript
import 'jquery-ui';
import 'daterangepicker';
import 'daterangepicker/daterangepicker.css';
import { DmsControl, DmsControlHostView } from './dms-controls-controlbase';
import { UserInterfaceService } from '../../lib-core/userinterface-service';
import { ContextService } from '../../lib-core/context-service';
import { MetadataService } from '../../lib-core/metadata-service';
import * as ko from 'knockout';
import { DmsDataSourceControl } from './dms-control-datasource';
import './dms-control-lookup';
import { BusinessObjectBase } from '../../lib-core/business-object';
import './controls.css';
type BeforeLookUpHandlerArgs = {
appCode: string;
entityName: string;
filter: string;
sort: string;
expand: string;
entityObject: any;
lookUpPropName: string;
};
type FormOptions = {
id?: string;
mode?: 'create' | 'edit' | 'readonly';
entityViewName?: string;
dataSource?: DmsDataSourceControl;
doNotAppendToDom?: boolean;
parentGridId?: string;
dataSourceId?: string;
isFormCreatedByDmsGrid?: boolean;
beforeLookUp?: (event: BeforeLookUpHandlerArgs, searchString: string) => Promise<Array<any>>;
};
type ViewPropertyLookUp = {
name: string;
type: string;
lookup: {
entity: string;
appCode: string;
filter: string;
expand: string;
sort: string;
ui: {
list: {
placeholder: string;
label: string;
width: number;
searchFields: string;
fields: Record<string, {
label: string;
}>;
};
group: {
label: string;
fields: Record<string, {
label: string;
mapTo: string;
readonly: boolean;
}>;
};
};
};
};
export type EntityFieldChangeHandlerParams = {
record: BusinessObjectBase;
fieldName: string;
domElement: HTMLElement;
event: any;
refresh: Function;
fieldData: File;
};
export declare class DmsFormControl extends DmsControl {
controlId: string;
mode: string;
options: FormOptions;
entityViewName: any;
dataSourceId: string;
metadataService: MetadataService;
contextService: ContextService;
userInterfaceService: UserInterfaceService;
formDataMemberName: string;
constructor(controlId: string, hostingView: DmsControlHostView, options?: any);
show(view: any): Promise<void>;
static getEntityMetadata(dataSource: any): Promise<any>;
static getFunction(view: DmsControlHostView, funcName: string): Function;
private resetValidation;
private validateForm;
load(view: any, dynamicDatasource?: any): Promise<{
html: string;
saveFunction: Function;
}>;
static generateHtmlLookupControl(view: any, viewPropertyDefinition: ViewPropertyLookUp, options: FormOptions, formDataMemberObservableName: string, prop: any, controlColClass: string, entityMetadata: any): Promise<string>;
static generateUploadControl(view: any, formOptions: FormOptions, formDataMemberObservableName: string, prop: any, controlColClass: string): string;
save: () => Promise<void>;
initialize: (simpleInit: Function) => Promise<void>;
private initMultiselectControls;
static generateHtmlControlAttributes(formOptions: FormOptions, prop: any): {
maxLenAttr: string;
requiredAttr: string;
integerAttr: string;
numberAttr: string;
encodedRegEx: any;
patternAttr: string;
disabledAttr: string;
inputType: any;
};
static startHtmlAccordeon(controlId: string): string;
static startHtmlAccordeonCard(accordeonId: string, cardId: string, cardTitle: string, showByDefault: boolean): string;
static endHtmlAccordeonCard(): string;
static endHtmlAccordeon(): string;
static generateFormRowStart(): string;
static generateFormRowEnd(): string;
static generateFormControlLabel(formOptions: FormOptions, prop: {
label: string;
required: boolean;
name: string;
}): string;
static generateHtmlLabelControl(view: any, formOptions: FormOptions, formDataMemberObservableName: string, prop: any, controlColClass: string): string;
static generateHtmlInputControl(view: any, formOptions: FormOptions, formDataMemberObservableName: string, prop: any, controlColClass: string): string;
static generateHtmlTextAreaControl(view: any, formOptions: FormOptions, formDataMemberObservableName: string, prop: any, controlColClass: string): string;
static generateHtmlToggleControl(view: any, formOptions: FormOptions, formDataMemberObservableName: string, prop: any, controlColClass: string): string;
static generateHtmlMultiselectControl(view: any, formOptions: FormOptions, formDataMemberObservableName: string, prop: any, controlColClass: string): string;
static generateHtmlDateTimeControl(view: any, formOptions: FormOptions, formDataMemberObservableName: string, prop: any, controlColClass: string): string;
static generateHtmlRefPopupControl(view: any, formOptions: FormOptions, formDataMemberObservableName: string, prop: any, controlColClass: string): Promise<string>;
private static insertLookupDialogForProperty;
static triggerOnEntityFieldChange(event: any, dataSourceId: string, recordobservable: ko.Observable): boolean;
}
export declare function DmsFormFactory(hostingView: DmsControlHostView): Promise<DmsFormControl[]>;
export {};