survey-creator-core
Version:
Use SurveyJS Creator to create or edit JSON for SurveyJS Form Library.
53 lines (52 loc) • 3.04 kB
TypeScript
import { Base, ISurveyElement, ItemValue, JsonObjectProperty, SurveyElement, SurveyModel, PageModel } from "survey-core";
import { ISurveyCreatorOptions } from "./creator-settings";
export declare enum ObjType {
Unknown = "unknown",
Survey = "survey",
Page = "page",
Panel = "panel",
Question = "question",
Column = "column"
}
export declare class SurveyHelper {
static getNewElementName(el: ISurveyElement): string;
static getNewPageName(objs: Array<any>): string;
static isPageNameAutoGenerated(name: string): boolean;
static isPagePropertiesAreModified(page: PageModel): boolean;
static getNewQuestionName(objs: Array<any>): string;
static getNewPanelName(objs: Array<any>): string;
static generateNewName(name: string): string;
static getNewName(objs: Array<any>, baseName: string): string;
static isNameAutoGenerated(name: string, baseName: string): boolean;
static getObjectType(obj: any): ObjType;
static getObjectTypeStr(obj: any): string;
static getObjectName(obj: any, showObjectTitle?: boolean): string;
static getElements(element: any, includeHidden?: boolean): Array<any>;
static addElements(elements: Array<any>, isPanel: boolean, result: Array<any>): void;
static getAllElements(survey: SurveyModel, isPanel: boolean): Array<any>;
static isPropertyVisible(obj: any, prop: JsonObjectProperty, options?: ISurveyCreatorOptions, showMode?: string, parentObj?: any, parentProperty?: JsonObjectProperty): boolean;
static isNeedScrollIntoView(el: HTMLElement, scrollIfElementBiggerThanContainer?: boolean): undefined | "top" | "bottom";
static scrollIntoViewIfNeeded(el: HTMLElement, getOptions?: (overTop: boolean) => ScrollIntoViewOptions, scrollIfElementBiggerThanContainer?: boolean): void;
static getScrollableDiv(el: HTMLElement): HTMLElement;
static moveItemInArray(list: Array<any>, obj: any, newIndex: number): boolean;
static applyItemValueArray(dest: Array<ItemValue>, src: Array<ItemValue>): void;
static disableSelectingObj(obj: Base): void;
static enableSelectingObj(obj: Base): void;
static canSelectObj(obj: Base): boolean;
static warnNonSupported(name: string, newPropertyName?: string): void;
static warnText(text: string): void;
private static deleteConditionProperties;
private static deleteRandomProperties;
static updateQuestionJson(questionJson: any): void;
private static deleteConditionPropertiesFromArray;
static convertMatrixRowsToText(rows: any): string;
static convertItemValuesToText(items: ItemValue[]): string;
static convertTextToItemValues(text: string, properties: JsonObjectProperty[], className: string): ItemValue[];
static sortItems(items: Array<any>, propertyName?: string): void;
static getQuestionContextIndexInfo(name: string, prefix?: string): {
index: number;
name: string;
};
static isSupportCellEditor(type: string): boolean;
static getElementDeepLength(element: SurveyElement): number;
}