declare module "packages/survey-core/src/global_variables_utils" { export class DomWindowHelper { static isAvailable(): boolean; static isFileReaderAvailable(): boolean; static getLocation(): Location; static getVisualViewport(): VisualViewport | null; static getInnerWidth(): number; static getInnerHeight(): number; static getDevicePixelRatio(): number; static getWindow(): Window; static hasOwn(propertyName: string): boolean; static getSelection(): Selection | null; static requestAnimationFrame(callback: FrameRequestCallback): number; static addEventListener(type: string, listener: (e?: any) => void): void; static removeEventListener(type: string, listener: (e?: any) => void): void; static matchMedia(mediaQueryString: string): { matches: boolean; } | null; } export class DomDocumentHelper { static isAvailable(): boolean; static getBody(): HTMLElement; static getDocumentElement(): HTMLElement; static getDocument(): Document; static getCookie(): string; static setCookie(newCookie: string): void; static activeElementBlur(): Document; static createElement(tagName: string): HTMLElement; static getComputedStyle(elt: Element): CSSStyleDeclaration; static addEventListener(type: string, listener: (e?: any) => void): void; static removeEventListener(type: string, listener: (e?: any) => void): void; } } declare module "packages/survey-core/src/helpers" { export interface HashTable { [key: string]: T; } export interface IEqualValuesParameters { ignoreOrder?: boolean; caseSensitive?: boolean; trimStrings?: boolean; doNotConvertNumbers?: boolean; } export function createDate(reason: string, val?: number | string | Date): Date; export class Helpers { /** * A static methods that returns true if a value undefined, null, empty string or empty array. * @param value */ static isValueEmpty(value: any): boolean; static isValueUndefined(value: any): boolean; static isArrayContainsEqual(x: any, y: any): boolean; static checkIfArraysEqual(x: any, y: any, params: IEqualValuesParameters): boolean; static isArraysEqual(x: any, y: any, ignoreOrder?: boolean, caseSensitive?: boolean, trimStrings?: boolean): boolean; static compareStrings(x: string, y: string): number; static checkIfValuesEqual(x: any, y: any, params: IEqualValuesParameters): boolean; static isTwoValueEquals(x: any, y: any, ignoreOrder?: boolean, caseSensitive?: boolean, trimStrings?: boolean): boolean; static randomizeArray(array: Array): Array; static getUnbindValue(value: any): any; static createCopy(obj: any): any; static createCopyWithPrefix(obj: any, prefix?: string): any; static isConvertibleToNumber(value: any): boolean; static isValueObject(val: any, excludeArray?: boolean): boolean; static isNumber(value: any): boolean; static getNumber(value: any): number; private static getNumberCore; private static isStringHasOperator; private static prepareStringToNumber; static getMaxLength(maxLength: number, surveyLength: number): any; static getRemainingCharacterCounterText(newValue: string | undefined, maxLength: number | null): string; static getNumberByIndex(index: number, startIndexStr: string, parentIndex?: number): string; static isCharNotLetterAndDigit(ch: string): boolean; static isCharDigit(ch: string): boolean; static isDigitsOnly(str: string): boolean; private static getNumberFromStr; private static countDecimals; static correctAfterPlusMinis(a: number, b: number, res: number): number; static sumAnyValues(a: any, b: any): any; static correctAfterMultiple(a: number, b: number, res: number): number; static convertArrayValueToObject(src: Array, propName: string, dest?: Array): Array; private static findObjByPropValue; static convertArrayObjectToValue(src: Array, propName: string): Array; static convertDateToString(date: Date): string; static convertDateTimeToString(date: Date): string; static convertValToQuestionVal(val: any, inputType?: string): any; static compareVerions(ver1: string, ver2: string): number; static isUrlYoutubeVideo(url: string): boolean; } } declare module "packages/survey-core/src/localization/english" { export var englishStrings: { pagePrevText: string; pageNextText: string; completeText: string; previewText: string; editText: string; startSurveyText: string; otherItemText: string; noneItemText: string; refuseItemText: string; dontKnowItemText: string; selectAllItemText: string; deselectAllItemText: string; progressText: string; indexText: string; panelDynamicProgressText: string; panelDynamicTabTextFormat: string; questionsProgressText: string; emptySurvey: string; completingSurvey: string; completingSurveyBefore: string; loadingSurvey: string; placeholder: string; ratingOptionsCaption: string; value: string; requiredError: string; requiredErrorInPanel: string; requiredInAllRowsError: string; eachRowUniqueError: string; numericError: string; minError: string; maxError: string; textNoDigitsAllow: string; textMinLength: string; textMaxLength: string; textMinMaxLength: string; minRowCountError: string; minSelectError: string; maxSelectError: string; numericMinMax: string; numericMin: string; numericMax: string; invalidEmail: string; invalidExpression: string; urlRequestError: string; urlGetChoicesError: string; exceedMaxSize: string; noUploadFilesHandler: string; otherRequiredError: string; uploadingFile: string; loadingFile: string; chooseFile: string; noFileChosen: string; filePlaceholder: string; confirmDelete: string; keyDuplicationError: string; addColumn: string; addRow: string; removeRow: string; emptyRowsText: string; addPanel: string; removePanel: string; showDetails: string; hideDetails: string; choices_Item: string; matrix_column: string; matrix_row: string; multipletext_itemname: string; savingData: string; savingDataError: string; savingDataSuccess: string; savingExceedSize: string; saveAgainButton: string; timerMin: string; timerSec: string; timerSpentAll: string; timerSpentPage: string; timerSpentSurvey: string; timerLimitAll: string; timerLimitPage: string; timerLimitSurvey: string; clearCaption: string; signaturePlaceHolder: string; signaturePlaceHolderReadOnly: string; chooseFileCaption: string; takePhotoCaption: string; photoPlaceholder: string; fileOrPhotoPlaceholder: string; replaceFileCaption: string; removeFileCaption: string; booleanCheckedLabel: string; booleanUncheckedLabel: string; confirmRemoveFile: string; confirmRemoveAllFiles: string; questionTitlePatternText: string; modalCancelButtonText: string; modalApplyButtonText: string; filterStringPlaceholder: string; emptyMessage: string; noEntriesText: string; noEntriesReadonlyText: string; tabTitlePlaceholder: string; more: string; tagboxDoneButtonCaption: string; selectToRankEmptyRankedAreaText: string; selectToRankEmptyUnrankedAreaText: string; ok: string; cancel: string; }; } declare module "packages/survey-core/src/surveyStrings" { export var surveyLocalization: { currentLocaleValue: string; defaultLocaleValue: string; locales: { [index: string]: any; }; localeNames: { [index: string]: any; }; localeNamesInEnglish: { [index: string]: any; }; localeDirections: { [index: string]: any; }; supportedLocales: any[]; useEnglishNames: boolean; showNamesInEnglish: boolean; setupLocale(localeConfig: { localeCode: string; strings: any; nativeName: string; englishName: string; rtl?: boolean; }): void; currentLocale: string; defaultLocale: string; getCorrectLocaleName(loc: string): string; getLocaleStrings(loc: string): any; getString: (strName: string, locale?: string) => any; getLocaleName(loc: string, inEnglish?: boolean): string; getLocales: (removeDefaultLoc?: boolean) => Array; onGetExternalString: (name: string, locale: string) => string; }; export function getLocaleString(strName: string, locale?: string): string; export function getLocaleStrings(locale: string): any; export function setupLocale(localeConfig: { localeCode: string; strings: any; nativeName: string; englishName: string; rtl?: boolean; }): void; export var surveyStrings: { pagePrevText: string; pageNextText: string; completeText: string; previewText: string; editText: string; startSurveyText: string; otherItemText: string; noneItemText: string; refuseItemText: string; dontKnowItemText: string; selectAllItemText: string; deselectAllItemText: string; progressText: string; indexText: string; panelDynamicProgressText: string; panelDynamicTabTextFormat: string; questionsProgressText: string; emptySurvey: string; completingSurvey: string; completingSurveyBefore: string; loadingSurvey: string; placeholder: string; ratingOptionsCaption: string; value: string; requiredError: string; requiredErrorInPanel: string; requiredInAllRowsError: string; eachRowUniqueError: string; numericError: string; minError: string; maxError: string; textNoDigitsAllow: string; textMinLength: string; textMaxLength: string; textMinMaxLength: string; minRowCountError: string; minSelectError: string; maxSelectError: string; numericMinMax: string; numericMin: string; numericMax: string; invalidEmail: string; invalidExpression: string; urlRequestError: string; urlGetChoicesError: string; exceedMaxSize: string; noUploadFilesHandler: string; otherRequiredError: string; uploadingFile: string; loadingFile: string; chooseFile: string; noFileChosen: string; filePlaceholder: string; confirmDelete: string; keyDuplicationError: string; addColumn: string; addRow: string; removeRow: string; emptyRowsText: string; addPanel: string; removePanel: string; showDetails: string; hideDetails: string; choices_Item: string; matrix_column: string; matrix_row: string; multipletext_itemname: string; savingData: string; savingDataError: string; savingDataSuccess: string; savingExceedSize: string; saveAgainButton: string; timerMin: string; timerSec: string; timerSpentAll: string; timerSpentPage: string; timerSpentSurvey: string; timerLimitAll: string; timerLimitPage: string; timerLimitSurvey: string; clearCaption: string; signaturePlaceHolder: string; signaturePlaceHolderReadOnly: string; chooseFileCaption: string; takePhotoCaption: string; photoPlaceholder: string; fileOrPhotoPlaceholder: string; replaceFileCaption: string; removeFileCaption: string; booleanCheckedLabel: string; booleanUncheckedLabel: string; confirmRemoveFile: string; confirmRemoveAllFiles: string; questionTitlePatternText: string; modalCancelButtonText: string; modalApplyButtonText: string; filterStringPlaceholder: string; emptyMessage: string; noEntriesText: string; noEntriesReadonlyText: string; tabTitlePlaceholder: string; more: string; tagboxDoneButtonCaption: string; selectToRankEmptyRankedAreaText: string; selectToRankEmptyUnrankedAreaText: string; ok: string; cancel: string; }; } declare module "packages/survey-core/src/conditionProcessValue" { import { HashTable } from "packages/survey-core/src/helpers"; export class ProcessValue { values: HashTable; properties: HashTable; asyncValues: HashTable; onCompleteAsyncFunc: (op: any) => void; constructor(); getFirstName(text: string, obj?: any): string; hasValue(text: string, values?: HashTable): boolean; getValue(text: string, values?: HashTable): any; setValue(obj: any, text: string, value: any): void; getValueInfo(valueInfo: any): void; isAnyKeyChanged(keys: any, usedNames: string[]): boolean; private getValueFromPath; private getValueCore; private getQuestionDirectly; private getValueFromSurvey; private getValueFromValues; private getNonNestedObject; private getObjInArray; private getFirstPropertyName; private getObjectValue; private getIntValue; } } declare module "packages/survey-core/src/console-warnings" { export class ConsoleWarnings { static disposedObjectChangedProperty(propName: string, objType: string): void; static inCorrectQuestionValue(questionName: string, val: any): void; static warn(text: string): void; static error(text: string): void; } } declare module "packages/survey-core/src/functionsfactory" { import { HashTable } from "packages/survey-core/src/helpers"; export class FunctionFactory { static Instance: FunctionFactory; private functionHash; private isAsyncHash; register(name: string, func: (params: any[], originalParams?: any[]) => any, isAsync?: boolean): void; unregister(name: string): void; hasFunction(name: string): boolean; isAsyncFunction(name: string): boolean; clear(): void; getAll(): Array; run(name: string, params: any[], properties: HashTable, originalParams: any[]): any; } export var registerFunction: (name: string, func: (params: any[], originalParams?: any[]) => any, isAsync?: boolean) => void; } declare module "packages/survey-core/src/expressions/expressions" { import { HashTable } from "packages/survey-core/src/helpers"; import { ProcessValue } from "packages/survey-core/src/conditionProcessValue"; export interface AsyncFunctionItem { operand?: FunctionOperand; parent?: AsyncFunctionItem; children?: Array; } export abstract class Operand { private static counter; private _id; get id(): number; toString(func?: (op: Operand) => string): string; abstract getType(): string; abstract evaluate(processValue?: ProcessValue): any; abstract setVariables(variables: Array): any; hasFunction(): boolean; hasAsyncFunction(): boolean; addToAsyncList(list: Array): void; addOperandsToList(list: Array): void; isEqual(op: Operand): boolean; protected abstract isContentEqual(op: Operand): boolean; protected areOperatorsEquals(op1: Operand, op2: Operand): boolean; protected addChildrenToList(list: Array): void; } export class BinaryOperand extends Operand { private operatorName; private left; private right; private consumer; private isArithmeticValue; constructor(operatorName: string, left?: any, right?: any, isArithmeticOp?: boolean); private get requireStrictCompare(); private getIsOperandRequireStrict; getType(): string; get isArithmetic(): boolean; get isConjunction(): boolean; get conjunction(): string; get operator(): string; get leftOperand(): any; get rightOperand(): any; protected isContentEqual(op: Operand): boolean; private evaluateParam; evaluate(processValue?: ProcessValue): any; toString(func?: (op: Operand) => string): string; setVariables(variables: Array): void; hasFunction(): boolean; protected addChildrenToList(list: Array): void; hasAsyncFunction(): boolean; addToAsyncList(list: Array): void; } export class UnaryOperand extends Operand { private expressionValue; private operatorName; private consumer; constructor(expressionValue: Operand, operatorName: string); get operator(): string; get expression(): Operand; getType(): string; toString(func?: (op: Operand) => string): string; private get isRigtOperator(); protected isContentEqual(op: Operand): boolean; hasFunction(): boolean; protected addChildrenToList(list: Array): void; hasAsyncFunction(): boolean; addToAsyncList(list: Array): void; evaluate(processValue?: ProcessValue): boolean; setVariables(variables: Array): void; } export class ArrayOperand extends Operand { values: Array; constructor(values: Array); getType(): string; toString(func?: (op: Operand) => string): string; evaluate(processValue?: ProcessValue): Array; setVariables(variables: Array): void; hasFunction(): boolean; protected addChildrenToList(list: Array): void; hasAsyncFunction(): boolean; addToAsyncList(list: Array): void; protected isContentEqual(op: Operand): boolean; } export class Const extends Operand { private value; constructor(value: any); getType(): string; toString(func?: (op: Operand) => string): string; get correctValue(): any; get requireStrictCompare(): boolean; evaluate(): any; setVariables(variables: Array): void; protected getCorrectValue(value: any): any; protected isContentEqual(op: Operand): boolean; private isQuote; } export class Variable extends Const { private variableName; static get DisableConversionChar(): string; static set DisableConversionChar(val: string); private valueInfo; private useValueAsItIs; constructor(variableName: string); get requireStrictCompare(): boolean; getType(): string; toString(func?: (op: Operand) => string): string; get variable(): string; evaluate(processValue?: ProcessValue): any; setVariables(variables: Array): void; protected getCorrectValue(value: any): any; protected isContentEqual(op: Operand): boolean; } export class FunctionOperand extends Operand { private originalValue; private parameters; constructor(originalValue: string, parameters: ArrayOperand); getType(): string; evaluate(processValue?: ProcessValue): any; private evaluateCore; toString(func?: (op: Operand) => string): string; setVariables(variables: Array): void; isReady(proccessValue: ProcessValue): boolean; private getAsynValue; hasFunction(): boolean; protected addChildrenToList(list: Array): void; hasAsyncFunction(): boolean; private isAsyncFunction; addToAsyncList(list: Array): void; protected isContentEqual(op: Operand): boolean; } export class OperandMaker { static throwInvalidOperatorError(op: string): void; static safeToString(operand: Operand, func: (op: Operand) => string): string; static toOperandString(value: string): string; static isBooleanValue(value: string): boolean; static countDecimals(value: number): number; static plusMinus(a: number, b: number, res: number): number; static unaryFunctions: HashTable; static binaryFunctions: HashTable; static isTwoValueEquals(x: any, y: any, ignoreOrder?: boolean): boolean; static operatorToString(operatorName: string): string; static convertValForDateCompare(val: any, second: any): any; static signs: HashTable; } } declare module "packages/survey-core/src/expressions/expressionParser" { export interface IFilePosition { offset: number; line: number; column: number; } export interface IFileRange { start: IFilePosition; end: IFilePosition; } export interface ILiteralExpectation { type: "literal"; text: string; ignoreCase: boolean; } export interface IClassParts extends Array { } export interface IClassExpectation { type: "class"; parts: IClassParts; inverted: boolean; ignoreCase: boolean; } export interface IAnyExpectation { type: "any"; } export interface IEndExpectation { type: "end"; } export interface IOtherExpectation { type: "other"; description: string; } export type Expectation = ILiteralExpectation | IClassExpectation | IAnyExpectation | IEndExpectation | IOtherExpectation; export class SyntaxError extends Error { static buildMessage(expected: Expectation[], found: string | null): string; message: string; expected: Expectation[]; found: string | null; location: IFileRange; name: string; constructor(message: string, expected: Expectation[], found: string | null, location: IFileRange); } export interface ICached { nextPos: number; result: any; } export interface IParseOptions { filename?: string; startRule?: string; tracer?: any; [key: string]: any; } export type ParseFunction = (input: string, options?: IParseOptions) => any; export const parse: ParseFunction; } declare module "packages/survey-core/src/conditionsParser" { import { Operand } from "packages/survey-core/src/expressions/expressions"; export class ConditionsParserError { at: number; code: string; constructor(at: number, code: string); } export class ConditionsParser { private conditionError; private patchExpression; createCondition(text: string): Operand; parseExpression(text: string): Operand; get error(): ConditionsParserError; } } declare module "packages/survey-core/src/conditions" { import { HashTable } from "packages/survey-core/src/helpers"; import { Operand } from "packages/survey-core/src/expressions/expressions"; /** * Base interface for expression execution */ export interface IExpresionExecutor { /** * This call back runs on executing expression if there is at least one async function */ onComplete: (res: any, id: number) => void; /** * The expression as string, property with get */ expression: string; /** * Returns true if the expression is valid and can be executed */ canRun(): boolean; /** * Run the expression. Returns the result of execution. * The result can be undefined if there is an asyn function. In this case result will be returned onComplete callback. * @param values has with values names and their results. Normally it is question names and their values * @param properties the list of properties that are available in functions. Commonly it is survey and question, if expression execuited in a question context */ run(values: HashTable, properties: HashTable, id: number): any; /** * Returns the list of variables that used in the expression. They defined as: {variableName} in default parser. */ getVariables(): Array; /** * Returns true if there is a function in the expression */ hasFunction(): boolean; /** * Returns true if there is an async function in the expression */ isAsync: boolean; } export class ExpressionExecutorRunner { private operand; private id; private onComplete; private processValue; private asyncFuncList; constructor(operand: Operand, id: number, onComplete: (res: any, id: number) => void, values: HashTable, properties: HashTable); run(isAsync: boolean): any; private getAsyncItemByOperand; private runAsyncItem; private runAsyncItemCore; private doAsyncFunctionReady; private isAsyncFuncReady; private isAsyncChildrenReady; private runValues; } export class ExpressionExecutor implements IExpresionExecutor { static createExpressionExecutor: (expression: string) => IExpresionExecutor; onComplete: (res: any, id: number) => void; private expressionValue; private operand; private parser; private isAsyncValue; private hasFunctionValue; constructor(expression: string); get expression(): string; private setExpression; getVariables(): Array; hasFunction(): boolean; get isAsync(): boolean; canRun(): boolean; run(values: HashTable, properties: HashTable, id: number): any; } export class ExpressionRunnerBase { private expressionExecutor; private variables; private containsFunc; private static IdRunnerCounter; onBeforeAsyncRun: (id: number) => void; onAfterAsyncRun: (id: number) => void; constructor(expression: string); get expression(): string; set expression(value: string); getVariables(): Array; hasFunction(): boolean; get isAsync(): boolean; canRun(): boolean; protected runCore(values: HashTable, properties?: HashTable): any; protected doOnComplete(res: any, id: number): void; } export class ConditionRunner extends ExpressionRunnerBase { onRunComplete: (result: boolean) => void; run(values: HashTable, properties?: HashTable): boolean; protected doOnComplete(res: any, id: number): void; } export class ExpressionRunner extends ExpressionRunnerBase { onRunComplete: (result: any) => void; run(values: HashTable, properties?: HashTable): any; protected doOnComplete(res: any, id: number): void; } } declare module "packages/survey-core/src/utils/cssClassBuilder" { export class CssClassBuilder { private classes; isEmpty(): boolean; append(value: string, condition?: boolean): CssClassBuilder; toString(): string; } } declare module "packages/survey-core/src/utils/taskmanager" { export interface IExecutable { id?: string; execute: () => void; isCompleted: boolean; dispose?: () => void; } export class Task implements IExecutable { private func; private isMultiple; private _isCompleted; constructor(func: () => void, isMultiple?: boolean); execute: () => void; discard(): void; get isCompleted(): boolean; } export class TaskManger { private interval; private static instance; private static tasks; private constructor(); static Instance(): TaskManger; private tick; static schedule(task: IExecutable): void; } export function debounce void>(func: T): { run: T; cancel: () => void; }; } declare module "packages/survey-core/src/utils/animation" { import { EventBase, Base } from "packages/survey-core/src/base"; export interface AnimationOptions { cssClass: string; onBeforeRunAnimation?: (element: HTMLElement) => void; onAfterRunAnimation?: (element: HTMLElement) => void; } export interface IAnimationConsumer = []> { getLeaveOptions?(...args: T): AnimationOptions; getEnterOptions?(...args: T): AnimationOptions; getAnimatedElement(...args: T): HTMLElement; isAnimationEnabled(): boolean; getRerenderEvent(): EventBase; } interface IGroupAnimationInfo { isReorderingRunning: boolean; isDeletingRunning: boolean; isAddingRunning: boolean; } interface IGroupAnimationCompareInfo { addedItems: Array; deletedItems: Array; reorderedItems: Array<{ item: T; movedForward: boolean; }>; mergedItems: Array; } export interface IAnimationGroupConsumer extends IAnimationConsumer<[T]> { getLeaveOptions?(item: T, info?: IGroupAnimationInfo): AnimationOptions; getEnterOptions?(item: T, info?: IGroupAnimationInfo): AnimationOptions; getReorderOptions?(item: T, movedForward: boolean, info?: IGroupAnimationInfo): AnimationOptions; getKey?: (item: T) => any; onCompareArrays?(options: IGroupAnimationCompareInfo): void; allowSyncRemovalAddition?: boolean; } export class AnimationUtils { private getMsFromRule; private reflow; private getAnimationsCount; private getAnimationDuration; private cancelQueue; private addCancelCallback; private removeCancelCallback; protected onAnimationEnd(element: HTMLElement, callback: (isCancel?: boolean) => void, options: AnimationOptions): void; protected afterAnimationRun(element: HTMLElement, options: AnimationOptions | AnimationOptions): void; protected beforeAnimationRun(element: HTMLElement, options: AnimationOptions | AnimationOptions): void; private getCssClasses; protected runAnimation(element: HTMLElement, options: AnimationOptions, callback: (isCancel?: boolean) => void): void; protected clearHtmlElement(element: HTMLElement, options: AnimationOptions): void; protected onNextRender(callback: (isCancel?: boolean) => void, isCancel?: boolean): void; cancel(): void; } export class AnimationPropertyUtils extends AnimationUtils { onEnter(options: IAnimationConsumer): void; onLeave(options: IAnimationConsumer, callback: () => void): void; } export class AnimationGroupUtils extends AnimationUtils { runGroupAnimation(options: IAnimationGroupConsumer, addedItems: Array, removedItems: Array, reorderedItems: Array<{ item: T; movedForward: boolean; }>, callback?: () => void): void; } export abstract class AnimationProperty = IAnimationConsumer> { protected animationOptions: S; protected update: (val: T, isTempUpdate?: boolean) => void; protected getCurrentValue: () => T; constructor(animationOptions: S, update: (val: T, isTempUpdate?: boolean) => void, getCurrentValue: () => T); protected animation: AnimationUtils; protected onNextRender(callback: () => void, onCancel?: () => void): void; protected abstract _sync(newValue: T): void; private _debouncedSync; sync(newValue: T): void; private cancelCallback; cancel(): void; cancelAnimations(): void; } export class AnimationBoolean extends AnimationProperty { protected animation: AnimationPropertyUtils; protected _sync(newValue: boolean): void; } export class AnimationGroup extends AnimationProperty, IAnimationGroupConsumer> { protected animation: AnimationGroupUtils; protected _sync(newValue: Array): void; } export class AnimationTab extends AnimationProperty, IAnimationGroupConsumer> { protected mergeValues?: (newValue: Array, oldValue: Array) => Array; protected animation: AnimationGroupUtils; constructor(animationOptions: IAnimationGroupConsumer, update: (val: Array, isTempUpdate?: boolean) => void, getCurrentValue: () => Array, mergeValues?: (newValue: Array, oldValue: Array) => Array); protected _sync(newValue: [T]): void; } } declare module "packages/survey-core/src/popup-view-model" { import { Base, EventBase } from "packages/survey-core/src/base"; import { PopupModel } from "packages/survey-core/src/popup"; import { CssClassBuilder } from "packages/survey-core/src/utils/cssClassBuilder"; import { ActionContainer } from "packages/survey-core/src/actions/container"; import { AnimationOptions, IAnimationConsumer } from "packages/survey-core/src/utils/animation"; export const FOCUS_INPUT_SELECTOR = "input:not(:disabled):not([readonly]):not([type=hidden]),select:not(:disabled):not([readonly]),textarea:not(:disabled):not([readonly]), button:not(:disabled):not([readonly]), [tabindex]:not([tabindex^=\"-\"])"; export class PopupBaseViewModel extends Base implements IAnimationConsumer { protected popupSelector: string; protected fixedPopupContainer: string; protected containerSelector: string; protected scrollingContentSelector: string; protected prevActiveElement: HTMLElement; protected footerToolbarValue: ActionContainer; top: string; left: string; height: string; width: string; minWidth: string; _isVisible: boolean; locale: string; private updateIsVisible; private updateBeforeShowing; private updateAfterHiding; private visibilityAnimation; getLeaveOptions(): AnimationOptions; getEnterOptions(): AnimationOptions; getAnimatedElement(): HTMLElement; isAnimationEnabled(): boolean; getRerenderEvent(): EventBase; private getAnimationContainer; get isVisible(): boolean; set isVisible(val: boolean); onVisibilityChanged: EventBase; get container(): HTMLElement; private containerElement; private createdContainer; getLocale(): string; protected hidePopup(): void; protected getStyleClass(): CssClassBuilder; protected getShowFooter(): boolean; protected getShowHeader(): boolean; protected getPopupHeaderTemplate(): string; protected createFooterActionBar(): void; protected resetDimensionsAndPositionStyleProperties(): void; protected onModelChanging(newModel: PopupModel): void; private onModelIsVisibleChangedCallback; private setupModel; private _model; get model(): PopupModel; set model(model: PopupModel); constructor(model: PopupModel); get title(): string; get contentComponentName(): string; get contentComponentData(): any; get isModal(): boolean; get isFocusedContent(): boolean; get isFocusedContainer(): boolean; get showFooter(): boolean; get showHeader(): boolean; get popupHeaderTemplate(): string; get isOverlay(): boolean; get styleClass(): string; get cancelButtonText(): string; get footerToolbar(): ActionContainer; onKeyDown(event: any): void; private trapFocus; switchFocus(): void; protected _isPositionSetValue: boolean; get isPositionSet(): boolean; updateOnShowing(): void; updateOnHiding(): void; private focusContainer; private focusFirstInput; clickOutside(event?: Event): void; cancel(): void; dispose(): void; initializePopupContainer(): void; setComponentElement(componentRoot: HTMLElement): void; resetComponentElement(): void; protected preventScrollOuside(event: any, deltaY: number): void; } } declare module "packages/survey-core/src/utils/utils" { import { PopupBaseViewModel } from "packages/survey-core/src/popup-view-model"; function compareVersions(a: any, b: any): number; function confirmAction(message: string): boolean; function confirmActionAsync(options: IConfirmDialogOptions): void; function detectIEBrowser(): boolean; function detectIEOrEdge(): boolean; function loadFileFromBase64(b64Data: string, fileName: string): void; function isMobile(): boolean; const isShadowDOM: (rootElement: Document | ShadowRoot | HTMLElement) => rootElement is ShadowRoot; const getElement: (element: HTMLElement | string) => HTMLElement; function isElementVisible(element: HTMLElement, threshold?: number): boolean; function findScrollableParent(element: HTMLElement): HTMLElement; function activateLazyRenderingChecks(id: string): void; function navigateToUrl(url: string): void; function wrapUrlForBackgroundImage(url: string): string; function isBase64URL(url: string): boolean; const renamedIcons: any; function getIconNameFromProxy(iconName: string): string; export function getNewIconName(iconName: string): string; export function getCustomNewIconNameIfExists(iconName: string): string; function createSvg(size: number | string, width: number, height: number, iconName: string, svgElem: any, title: string): void; export function getSafeUrl(url: string): string; export function unwrap(value: T | (() => T)): T; export function getRenderedSize(val: string | number): number; export function getRenderedStyleSize(val: string | number): string; export interface IAttachKey2clickOptions { processEsc?: boolean; disableTabStop?: boolean; __keyDownReceived?: boolean; } export function doKey2ClickBlur(evt: KeyboardEvent): void; export function doKey2ClickUp(evt: KeyboardEvent, options?: IAttachKey2clickOptions): void; export function doKey2ClickDown(evt: KeyboardEvent, options?: IAttachKey2clickOptions): void; function increaseHeightByContent(element: HTMLElement, getComputedStyle?: (elt: Element) => any): void; function getOriginalEvent(event: any): any; function preventDefaults(event: any): void; function classesToSelector(str: string): string; function getElementWidth(el: HTMLElement): number; function isContainerVisible(el: HTMLElement): boolean; function getFirstVisibleChild(el: HTMLElement): any; function findParentByClassNames(element: HTMLElement, classNames: Array): Element; export function sanitizeEditableContent(element: any, cleanLineBreaks?: boolean): void; function mergeValues(src: any, dest: any): void; function updateListCssValues(res: any, css: any): void; export class Logger { private _result; log(action: string): void; get result(): string; } export interface IConfirmDialogOptions { message?: string; funcOnYes?: () => void; funcOnNo?: () => void; applyTitle?: string; locale?: string; rootElement?: HTMLElement; cssClass?: string; } export function showConfirmDialog(message: string, callback: (res: boolean) => void, options?: IConfirmDialogOptions): boolean; export function configConfirmDialog(popupViewModel: PopupBaseViewModel): void; function chooseFiles(input: HTMLInputElement, callback: (files: File[]) => void): void; export function compareArrays(oldValue: Array, newValue: Array, getKey: (item: T) => any): { addedItems: Array; deletedItems: Array; reorderedItems: Array<{ item: T; movedForward: boolean; }>; mergedItems: Array; }; interface IVerticalDimensions { paddingTop: string; paddingBottom: string; marginTop: string; marginBottom: string; heightTo: string; borderTopWidth: string; borderBottomWidth: string; heightFrom: string; } export function getVerticalDimensions(el: HTMLElement): IVerticalDimensions; export function setPropertiesOnElementForAnimation(el: HTMLElement, styles: any, prefix?: string): void; export function prepareElementForVerticalAnimation(el: HTMLElement): void; export function cleanHtmlElementAfterAnimation(el: HTMLElement): void; export function floorTo2Decimals(number: number): number; export { mergeValues, updateListCssValues, getElementWidth, isContainerVisible, classesToSelector, compareVersions, confirmAction, confirmActionAsync, detectIEOrEdge, detectIEBrowser, loadFileFromBase64, isMobile, isShadowDOM, getElement, isElementVisible, findScrollableParent, activateLazyRenderingChecks, navigateToUrl, wrapUrlForBackgroundImage, createSvg, getIconNameFromProxy, increaseHeightByContent, getOriginalEvent, preventDefaults, findParentByClassNames, getFirstVisibleChild, chooseFiles, isBase64URL, renamedIcons }; } declare module "packages/survey-core/src/actions/container" { import { Base } from "packages/survey-core/src/base"; import { IAction, Action, BaseAction } from "packages/survey-core/src/actions/action"; import { ILocalizableOwner, LocalizableString } from "packages/survey-core/src/localizablestring"; export let defaultActionBarCss: { root: string; defaultSizeMode: string; smallSizeMode: string; item: string; itemWithTitle: string; itemAsIcon: string; itemActive: string; itemPressed: string; itemIcon: string; itemTitle: string; itemTitleWithIcon: string; }; export class ActionContainer extends Base implements ILocalizableOwner { getMarkdownHtml(text: string, name: string): string; getRenderer(name: string): string; getRendererContext(locStr: LocalizableString): any; getProcessedText(text: string): string; getLocale(): string; actions: Array; private cssClassesValue; protected getRenderedActions(): Array; updateCallback: (isResetInitialized: boolean) => void; containerCss: string; sizeMode: "default" | "small"; locOwner: ILocalizableOwner; isEmpty: boolean; locStrsChanged(): void; protected raiseUpdate(isResetInitialized: boolean): void; protected onSet(): void; protected onPush(item: T): void; protected onRemove(item: T): void; private setActionCssClasses; get hasActions(): boolean; get renderedActions(): Array; get visibleActions(): Array; getRootCss(): string; protected getDefaultCssClasses(): any; set cssClasses(val: any); get cssClasses(): any; private createAction; addAction(val: IAction, sortByVisibleIndex?: boolean): T; setItems(items: Array, sortByVisibleIndex?: boolean): void; private sortItems; private hasSetVisibleIndex; private compareByVisibleIndex; private isActionVisible; subItemsShowDelay: number; subItemsHideDelay: number; protected popupAfterShowCallback(itemValue: T): void; mouseOverHandler(itemValue: T): void; initResponsivityManager(container: HTMLDivElement, delayedUpdateFunction?: (callback: () => void) => void): void; resetResponsivityManager(): void; getActionById(id: string): T; dispose(): void; } } declare module "packages/survey-core/src/element-helper" { export class ElementHelper { static focusElement(element: Element): void; static visibility(node: Element): boolean; static getNextElementPreorder(element: Element): Element; static getNextElementPostorder(element: Element): Element; static hasHorizontalScroller(element: HTMLElement): boolean; static hasVerticalScroller(element: HTMLElement): boolean; } } declare module "packages/survey-core/src/list" { import { ActionContainer } from "packages/survey-core/src/actions/container"; import { Action, BaseAction, IAction } from "packages/survey-core/src/actions/action"; import { ILocalizableOwner } from "packages/survey-core/src/localizablestring"; export let defaultListCss: { root: string; item: string; searchClearButtonIcon: string; loadingIndicator: string; itemSelected: string; itemGroup: string; itemGroupSelected: string; itemWithIcon: string; itemDisabled: string; itemFocused: string; itemHovered: string; itemTextWrap: string; itemIcon: string; itemMarkerIcon: string; itemSeparator: string; itemBody: string; itemsContainer: string; itemsContainerFiltering: string; filter: string; filterIcon: string; filterInput: string; emptyContainer: string; emptyText: string; }; export interface IListModel { items: Array; onSelectionChanged?: (item: IAction, ...params: any[]) => void; allowSelection?: boolean; searchEnabled?: boolean; selectedItem?: IAction; elementId?: string; locOwner?: ILocalizableOwner; cssClasses?: any; onFilterStringChangedCallback?: (text: string) => void; onTextSearchCallback?: (item: IAction, textToSearch: string) => boolean; } export class ListModel extends ActionContainer { onSelectionChanged?: (item: T, ...params: any[]) => void; allowSelection?: boolean; elementId?: string; private listContainerHtmlElement; private loadingIndicatorValue; private onFilterStringChangedCallback; private onTextSearchCallback; searchEnabled: boolean; showFilter: boolean; forceShowFilter: boolean; isExpanded: boolean; selectedItem: IAction; focusedItem: T; filterString: string; hasVerticalScroller: boolean; isAllDataLoaded: boolean; showSearchClearButton: boolean; renderElements: boolean; textWrapEnabled: boolean; itemComponent: string; static INDENT: number; static MINELEMENTCOUNT: number; scrollHandler: (e?: any) => void; areSameItemsCallback: (item1: IAction, item2: IAction) => boolean; private hasText; isItemVisible(item: T): boolean; protected getRenderedActions(): Array; get visibleItems(): Array; private get shouldProcessFilter(); private onFilterStringChanged; private updateIsEmpty; private scrollToItem; constructor(items: Array | IListModel, onSelectionChanged?: (item: T, ...params: any[]) => void, allowSelection?: boolean, selectedItem?: IAction, elementId?: string); setOnFilterStringChangedCallback(callback: (text: string) => void): void; setOnTextSearchCallback(callback: (item: T, textToSearch: string) => boolean): void; setItems(items: Array, sortByVisibleIndex?: boolean): void; private updateActionsIds; setSearchEnabled(newValue: boolean): void; protected onSet(): void; protected getDefaultCssClasses(): { root: string; item: string; searchClearButtonIcon: string; loadingIndicator: string; itemSelected: string; itemGroup: string; itemGroupSelected: string; itemWithIcon: string; itemDisabled: string; itemFocused: string; itemHovered: string; itemTextWrap: string; itemIcon: string; itemMarkerIcon: string; itemSeparator: string; itemBody: string; itemsContainer: string; itemsContainerFiltering: string; filter: string; filterIcon: string; filterInput: string; emptyContainer: string; emptyText: string; }; onItemClick: (itemValue: T) => void; protected popupAfterShowCallback(itemValue: T): void; onItemHover: (itemValue: T) => void; onItemLeave(itemValue: T): void; isItemDisabled: (itemValue: T) => boolean; isItemSelected: (itemValue: T) => boolean; isItemFocused: (itemValue: T) => boolean; protected areSameItems(item1: IAction, item2: IAction): boolean; getListClass: () => string; getItemClass: (itemValue: T) => string; getItemStyle: (itemValue: any) => { "--sjs-list-item-level": number; }; get filterStringPlaceholder(): string; get emptyMessage(): string; get scrollableContainer(): HTMLElement; get loadingText(): string; get loadingIndicator(): T; goToItems(event: KeyboardEvent): void; onMouseMove(event: MouseEvent): void; onKeyDown(event: KeyboardEvent): void; onPointerDown(event: PointerEvent, item: any): void; refresh(): void; onClickSearchClearButton(event: any): void; resetFocusedItem(): void; focusFirstVisibleItem(): void; focusLastVisibleItem(): void; initFocusedItem(): void; focusNextVisibleItem(): void; focusPrevVisibleItem(): void; selectFocusedItem(): void; initListContainerHtmlElement(htmlElement: HTMLElement): void; onLastItemRended(item: T): void; scrollToFocusedItem(): void; scrollToSelectedItem(): void; addScrollEventListener(handler: (e?: any) => void): void; removeScrollEventListener(): void; dispose(): void; } } declare module "packages/survey-core/src/actions/action" { import { ILocalizableOwner, LocalizableString } from "packages/survey-core/src/localizablestring"; import { Base, ComputedUpdater } from "packages/survey-core/src/base"; import { IListModel } from "packages/survey-core/src/list"; import { IPopupOptionsBase, PopupModel } from "packages/survey-core/src/popup"; export type actionModeType = "large" | "small" | "popup" | "removed"; /** * An action item. * * Action items are used in the Toolbar, matrix rows, titles of pages, panels, questions, and other survey elements. * * [View Demo](https://surveyjs.io/form-library/examples/add-custom-navigation-button/ (linkStyle)) */ export interface IAction { /** * A unique action item identifier. * * [View Demo](https://surveyjs.io/form-library/examples/add-custom-navigation-button/ (linkStyle)) */ id?: string; /** * Specifies the action item's visibility. * @see enabled * @see active */ visible?: boolean | ComputedUpdater; /** * The action item's title. * * [View Demo](https://surveyjs.io/form-library/examples/add-custom-navigation-button/ (linkStyle)) * @see showTitle * @see disableShrink */ title?: string; locTitle?: LocalizableString; locTitleName?: string; /** * The action item's tooltip. */ tooltip?: string; locTooltipName?: string; /** * Specifies whether users can interact with the action item. * @see active * @see visible */ enabled?: boolean | ComputedUpdater; enabledIf?: () => boolean; /** * Specifies the visibility of the action item's title. * @see title * @see disableShrink */ showTitle?: boolean; /** * A function that is executed when users click the action item. * * [View Demo](https://surveyjs.io/form-library/examples/add-custom-navigation-button/ (linkStyle)) */ action?: (context?: any) => void; onFocus?: (isMouse: boolean, event: any) => void; /** * One or several CSS classes that you want to apply to the outer `
` element. * * In the markup, an action item is rendered as an `` wrapped in a `
`. The `css` property applies classes to the `
`. * * To apply several classes, separate them with a space character: `"myclass1 myclass2"`. * * [View Demo](https://surveyjs.io/form-library/examples/add-custom-navigation-button/ (linkStyle)) * @see innerCss */ css?: string; /** * One or several CSS classes that you want to apply to the inner `` element. * * In the markup, an action item is rendered as an `` wrapped in a `
`. The `innerCss` property applies classes to the ``. * * To apply several classes, separate them with a space character: `"myclass1 myclass2"`. * * [View Demo](https://surveyjs.io/form-library/examples/add-custom-navigation-button/ (linkStyle)) * @see css */ innerCss?: string; /** * The action item's data object. Use it to pass required data to a custom template or component. */ data?: any; popupModel?: any; needSeparator?: boolean; /** * Specifies whether the action item is active. * * Use this property as a flag to specify different action item appearances in different states. * @see enabled * @see visible */ active?: boolean; pressed?: boolean; /** * Specifies the name of a template used to render the action item. * @see component */ template?: string; /** * Specifies the name of a component used to render the action item. */ component?: string; /** * The action item's icon name. * @see iconSize */ iconName?: string; /** * The action item's icon size in pixels. * @see iconName */ iconSize?: number | string; /** * The action item's location in a matrix question's row. * * The following values are available: * * - `"start"` - The action item is located at the beginning of the row. * - `"end"` - The action is located at the end of the row. */ location?: string; /** * Set this property to `true` if you want to disable keyboard navigation for the action item (sets the `tabIndex` attribute to -1). */ disableTabStop?: boolean; /** * Set this property to `true` if you want the item's `title` to be always visible. * If you set it to `false`, the `title` hides when the screen space is limited, and the item displays only the icon. * @see title * @see iconName */ disableShrink?: boolean; disableHide?: boolean; mode?: actionModeType; /** * A number that specifies the action's position relative to other actions. * * [View Demo](https://surveyjs.io/form-library/examples/add-custom-navigation-button/ (linkStyle)) */ visibleIndex?: number; needSpace?: boolean; ariaChecked?: boolean; ariaExpanded?: boolean; ariaRole?: string; elementId?: string; items?: Array; markerIconName?: string; showPopup?: () => void; hidePopup?: () => void; } export interface IActionDropdownPopupOptions extends IListModel, IPopupOptionsBase { } export function createDropdownActionModel(actionOptions: IAction, dropdownOptions: IActionDropdownPopupOptions, locOwner?: ILocalizableOwner): Action; export function createDropdownActionModelAdvanced(actionOptions: IAction, listOptions: IListModel, popupOptions?: IPopupOptionsBase): Action; export function createPopupModelWithListModel(listOptions: IListModel, popupOptions: IPopupOptionsBase): PopupModel; export function getActionDropdownButtonTarget(container: HTMLElement): HTMLElement; export abstract class BaseAction extends Base implements IAction { items?: IAction[]; private static renderedId; private static getNextRendredId; private cssClassesValue; private rendredIdValue; private ownerValue; tooltip: string; showTitle: boolean; innerCss: string; active: boolean; pressed: boolean; data: any; popupModel: any; needSeparator: boolean; template: string; mode: actionModeType; visibleIndex: number; disableTabStop: boolean; disableShrink: boolean; disableHide: boolean; needSpace: boolean; ariaChecked: boolean; ariaExpanded: boolean; ariaRole: string; id: string; removePriority: number; iconName: string; iconSize: number | string; markerIconName: string; css?: string; minDimension: number; maxDimension: number; get renderedId(): number; get owner(): ILocalizableOwner; set owner(val: ILocalizableOwner); get visible(): boolean; set visible(val: boolean); get enabled(): boolean; set enabled(val: boolean); get component(): string; set component(val: string); get locTitle(): LocalizableString; set locTitle(val: LocalizableString); get title(): string; set title(val: string); set cssClasses(val: any); get cssClasses(): any; get isVisible(): boolean; get disabled(): boolean; get canShrink(): boolean; get hasTitle(): boolean; get hasSubItems(): boolean; getActionBarItemTitleCss(): string; getActionBarItemCss(): string; getActionRootCss(): string; getTooltip(): string; getIsTrusted(args: any): boolean; showPopup(): void; hidePopup(): void; isPressed: boolean; isHovered: boolean; private showPopupTimeout; private hidePopupTimeout; private clearPopupTimeouts; showPopupDelayed(delay: number): void; hidePopupDelayed(delay: number): void; protected abstract getEnabled(): boolean; protected abstract setEnabled(val: boolean): void; protected abstract getVisible(): boolean; protected abstract setVisible(val: boolean): void; protected abstract getLocTitle(): LocalizableString; protected abstract setLocTitle(val: LocalizableString): void; protected abstract getTitle(): string; protected abstract setTitle(val: string): void; protected abstract getComponent(): string; protected abstract setComponent(val: string): void; } export class Action extends BaseAction implements IAction, ILocalizableOwner { private locTitleValue; updateCallback: (isResetInitialized: boolean) => void; innerItem: IAction; private raiseUpdate; constructor(innerItemData: IAction); private createLocTitle; setSubItems(options: IListModel): void; location?: string; id: string; private _visible; locTooltipName?: string; private _enabled; action: (context?: any, isUserAction?: boolean) => void; onFocus: (isMouse: boolean, event: any) => void; _component: string; items: any; _title: string; protected getLocTitle(): LocalizableString; protected setLocTitle(val: LocalizableString): void; protected getTitle(): string; protected setTitle(val: string): void; get locTitleName(): string; set locTitleName(val: string); locStrsChanged(): void; doAction(args: any): boolean; private isMouseDown; doMouseDown(args: any): void; doFocus(args: any): void; private locStrChangedInPopupModel; private locTitleChanged; private locTooltipChanged; getLocale(): string; getMarkdownHtml(text: string, name: string): string; getProcessedText(text: string): string; getRenderer(name: string): string; getRendererContext(locStr: LocalizableString): any; setVisible(val: boolean): void; getVisible(): boolean; enabledIf?: () => boolean; setEnabled(val: boolean): void; getEnabled(): boolean; setComponent(val: string): void; getComponent(): string; dispose(): void; } export class ActionDropdownViewModel { private item; private popupModel; private funcKey; constructor(item: Action); private setupPopupCallbacks; private removePopupCallbacks; dispose(): void; } } declare module "packages/survey-core/src/utils/responsivity-manager" { import { Action } from "packages/survey-core/src/actions/action"; import { AdaptiveActionContainer } from "packages/survey-core/src/actions/adaptive-container"; interface IDimensions { scroll: number; offset: number; } export class ResponsivityManager { container: HTMLDivElement; private model; private itemsSelector; private dotsItemSize; private delayedUpdateFunction; private resizeObserver; private isInitialized; protected minDimensionConst: number; private separatorSize; private separatorAddConst; private paddingSizeConst; private dotsSizeConst; private dotsIconClass; private iconClass; protected recalcMinDimensionConst: boolean; getComputedStyle: (elt: Element) => CSSStyleDeclaration; constructor(container: HTMLDivElement, model: AdaptiveActionContainer, itemsSelector: string, dotsItemSize?: number, delayedUpdateFunction?: (callback: () => void) => void); protected getDimensions(element: HTMLElement): IDimensions; protected getAvailableSpace(): number; protected calcItemSize(item: HTMLDivElement): number; private calcMinDimension; private calcItemsSizes; protected calcActionDimensions(currentAction: Action, item: HTMLDivElement): void; private get isContainerVisible(); private process; dispose(): void; } export class VerticalResponsivityManager extends ResponsivityManager { constructor(container: HTMLDivElement, model: AdaptiveActionContainer, itemsSelector: string, dotsItemSize?: number, minDimension?: number, delayedUpdateFunction?: (callback: () => void) => void); protected getDimensions(): IDimensions; protected getAvailableSpace(): number; protected calcItemSize(item: HTMLDivElement): number; protected calcActionDimensions(currentAction: Action, item: HTMLDivElement): void; } } declare module "packages/survey-core/src/actions/adaptive-container" { import { ListModel } from "packages/survey-core/src/list"; import { Action, actionModeType } from "packages/survey-core/src/actions/action"; import { ActionContainer } from "packages/survey-core/src/actions/container"; export class AdaptiveActionContainer extends ActionContainer { dotsItem: Action; private responsivityManager; minVisibleItemsCount: number; isResponsivenessDisabled: boolean; private hideItemsGreaterN; private getActionsToHide; private getVisibleItemsCount; private updateItemMode; private static ContainerID; constructor(); get hiddenItemsListModel(): ListModel; protected onSet(): void; protected onPush(item: T): void; protected getRenderedActions(): Array; protected raiseUpdate(isResetInitialized: boolean): void; fit(dimension: number, dotsItemSize: number): void; initResponsivityManager(container: HTMLDivElement, delayedUpdateFunction?: (callback: () => void) => void): void; resetResponsivityManager(): void; setActionsMode(mode: actionModeType): void; dispose(): void; } } declare module "packages/survey-core/src/survey-error" { import { ISurveyErrorOwner } from "packages/survey-core/src/base-interfaces"; import { LocalizableString } from "packages/survey-core/src/localizablestring"; export class SurveyError { text: string; protected errorOwner: ISurveyErrorOwner; private locTextValue; visible: boolean; constructor(text?: string, errorOwner?: ISurveyErrorOwner); equals(error: SurveyError): boolean; get locText(): LocalizableString; getText(): string; getErrorType(): string; protected getDefaultText(): string; protected getLocale(): string; protected getLocalizationString(locStrName: string): string; onUpdateErrorTextCallback: (error: SurveyError) => void; updateText(): void; } } declare module "packages/survey-core/src/defaultCss/defaultV2Css" { export var surveyCss: any; export var defaultV2Css: { root: string; rootProgress: string; rootMobile: string; rootAnimationDisabled: string; rootReadOnly: string; rootCompact: string; rootFitToContainer: string; rootWrapper: string; rootWrapperFixed: string; rootWrapperHasImage: string; rootBackgroundImage: string; container: string; header: string; bodyContainer: string; body: string; bodyWithTimer: string; clockTimerRoot: string; clockTimerRootTop: string; clockTimerRootBottom: string; clockTimerProgress: string; clockTimerProgressAnimation: string; clockTimerTextContainer: string; clockTimerMinorText: string; clockTimerMajorText: string; bodyEmpty: string; bodyLoading: string; footer: string; title: string; description: string; logo: string; logoImage: string; headerText: string; headerClose: string; navigationButton: string; bodyNavigationButton: string; completedPage: string; completedBeforePage: string; timerRoot: string; navigation: { complete: string; prev: string; next: string; start: string; preview: string; edit: string; }; panel: { contentEnter: string; contentLeave: string; enter: string; leave: string; asPage: string; number: string; title: string; titleExpandable: string; titleExpandableSvg: string; titleNumInline: string; titleExpanded: string; titleCollapsed: string; titleDisabled: string; titleOnExpand: string; titleOnError: string; titleBar: string; description: string; container: string; withFrame: string; content: string; icon: string; iconExpanded: string; footer: string; requiredText: string; header: string; collapsed: string; expanded: string; expandable: string; expandableAnimating: string; nested: string; invisible: string; navigationButton: string; compact: string; errorsContainer: string; }; paneldynamic: { mainRoot: string; empty: string; root: string; iconRemove: string; navigation: string; title: string; header: string; headerTab: string; button: string; buttonRemove: string; buttonAdd: string; buttonPrev: string; buttonPrevDisabled: string; buttonNextDisabled: string; buttonNext: string; progressContainer: string; progress: string; progressBar: string; nested: string; progressText: string; separator: string; panelWrapper: string; footer: string; panelFooter: string; footerButtonsContainer: string; panelsContainer: string; panelWrapperInRow: string; panelWrapperEnter: string; panelWrapperLeave: string; panelWrapperList: string; progressBtnIcon: string; noEntriesPlaceholder: string; compact: string; tabsContainer: string; tabsContainerWithHeader: string; tabsRoot: string; tabsLeft: string; tabsRight: string; tabsCenter: string; tabs: { item: string; itemPressed: string; itemAsIcon: string; itemIcon: string; itemTitle: string; }; }; progress: string; progressTop: string; progressBottom: string; progressBar: string; progressText: string; progressButtonsRoot: string; progressButtonsNumbered: string; progressButtonsFitSurveyWidth: string; progressButtonsContainerCenter: string; progressButtonsContainer: string; progressButtonsConnector: string; progressButtonsButton: string; progressButtonsButtonBackground: string; progressButtonsButtonContent: string; progressButtonsHeader: string; progressButtonsFooter: string; progressButtonsImageButtonLeft: string; progressButtonsImageButtonRight: string; progressButtonsImageButtonHidden: string; progressButtonsListContainer: string; progressButtonsList: string; progressButtonsListElementPassed: string; progressButtonsListElementCurrent: string; progressButtonsListElementNonClickable: string; progressButtonsPageTitle: string; progressButtonsPageDescription: string; progressTextInBar: string; page: { root: string; emptyHeaderRoot: string; title: string; description: string; number: string; errorsContainer: string; }; pageTitle: string; pageDescription: string; row: string; rowMultiple: string; rowCompact: string; rowEnter: string; rowDelayedEnter: string; rowLeave: string; rowReplace: string; pageRow: string; question: { contentEnter: string; contentLeave: string; enter: string; leave: string; mobile: string; mainRoot: string; flowRoot: string; withFrame: string; asCell: string; answered: string; header: string; headerLeft: string; headerTop: string; headerBottom: string; content: string; contentSupportContainerQueries: string; contentLeft: string; titleNumInline: string; titleLeftRoot: string; titleTopRoot: string; descriptionUnderInputRoot: string; titleBottomRoot: string; titleOnAnswer: string; titleEmpty: string; titleOnError: string; title: string; titleExpandable: string; titleExpandableSvg: string; titleExpanded: string; titleCollapsed: string; titleDisabled: string; titleReadOnly: string; titleBar: string; requiredText: string; number: string; description: string; descriptionUnderInput: string; comment: string; other: string; required: string; titleRequired: string; indent: number; footer: string; commentArea: string; formGroup: string; hasError: string; hasErrorTop: string; hasErrorBottom: string; collapsed: string; expandable: string; expandableAnimating: string; expanded: string; nested: string; invisible: string; composite: string; disabled: string; readOnly: string; preview: string; noPointerEventsMode: string; errorsContainer: string; errorsContainerTop: string; errorsContainerBottom: string; confirmDialog: string; }; image: { mainRoot: string; root: string; image: string; adaptive: string; noImage: string; noImageSvgIconId: string; withFrame: string; }; html: { mainRoot: string; root: string; withFrame: string; nested: string; }; error: { root: string; icon: string; item: string; locationTop: string; locationBottom: string; }; checkbox: { root: string; rootMobile: string; rootRow: string; rootMultiColumn: string; item: string; itemEnter: string; itemLeave: string; itemOnError: string; itemSelectAll: string; itemNone: string; itemDisabled: string; itemReadOnly: string; itemPreview: string; itemPreviewSvgIconId: string; itemChecked: string; itemHover: string; itemInline: string; label: string; labelChecked: string; itemControl: string; itemDecorator: string; itemSvgIconId: string; controlLabel: string; materialDecorator: string; other: string; column: string; }; radiogroup: { root: string; rootMobile: string; rootRow: string; rootMultiColumn: string; item: string; itemOnError: string; itemInline: string; label: string; labelChecked: string; itemEnter: string; itemLeave: string; itemDisabled: string; itemReadOnly: string; itemPreview: string; itemPreviewSvgIconId: string; itemChecked: string; itemHover: string; itemControl: string; itemDecorator: string; controlLabel: string; materialDecorator: string; other: string; clearButton: string; column: string; }; boolean: { mainRoot: string; root: string; rootRadio: string; item: string; itemOnError: string; control: string; itemChecked: string; itemExchanged: string; itemIndeterminate: string; itemDisabled: string; itemReadOnly: string; itemPreview: string; itemHover: string; label: string; labelTrue: string; labelFalse: string; switch: string; disabledLabel: string; labelReadOnly: string; labelPreview: string; sliderText: string; slider: string; sliderGhost: string; radioItem: string; radioItemChecked: string; radioItemDisabled: string; radioItemReadOnly: string; radioItemPreview: string; itemPreviewSvgIconId: string; radioLabel: string; radioControlLabel: string; radioFieldset: string; itemRadioDecorator: string; materialRadioDecorator: string; itemRadioControl: string; rootCheckbox: string; checkboxItem: string; checkboxLabel: string; checkboxItemOnError: string; checkboxItemIndeterminate: string; checkboxItemChecked: string; checkboxItemDecorator: string; checkboxItemDisabled: string; checkboxItemReadOnly: string; checkboxItemPreview: string; controlCheckbox: string; checkboxMaterialDecorator: string; checkboxControlLabel: string; svgIconCheckedId: string; }; text: { root: string; small: string; controlDisabled: string; controlReadOnly: string; controlPreview: string; constrolWithCharacterCounter: string; characterCounterBig: string; content: string; remainingCharacterCounter: string; onError: string; }; multipletext: { root: string; rootMobile: string; itemLabel: string; itemLabelReadOnly: string; itemLabelDisabled: string; itemLabelPreview: string; itemLabelOnError: string; itemLabelAllowFocus: string; itemLabelAnswered: string; itemWithCharacterCounter: string; item: string; itemTitle: string; content: string; row: string; cell: string; cellError: string; cellErrorTop: string; cellErrorBottom: string; }; dropdown: { root: string; popup: string; small: string; selectWrapper: string; other: string; onError: string; label: string; itemEnter: string; itemLeave: string; item: string; itemDisabled: string; itemChecked: string; itemHover: string; itemControl: string; itemDecorator: string; cleanButton: string; cleanButtonSvg: string; cleanButtonIconId: string; chevronButton: string; chevronButtonSvg: string; chevronButtonIconId: string; control: string; controlInputFieldComponent: string; controlValue: string; controlDisabled: string; controlReadOnly: string; controlPreview: string; controlEmpty: string; controlLabel: string; filterStringInput: string; materialDecorator: string; hintPrefix: string; hintSuffix: string; }; imagepicker: { mainRoot: string; root: string; rootResponsive: string; rootStatic: string; rootColumn: string; item: string; itemOnError: string; itemInline: string; itemChecked: string; itemDisabled: string; itemReadOnly: string; itemPreview: string; itemHover: string; label: string; itemDecorator: string; imageContainer: string; itemControl: string; image: string; itemText: string; other: string; itemNoImage: string; itemNoImageSvgIcon: string; itemNoImageSvgIconId: string; column: string; checkedItemDecorator: string; checkedItemSvgIcon: string; checkedItemSvgIconId: string; }; matrix: { mainRoot: string; tableWrapper: string; root: string; columnsAutoWidth: string; noHeader: string; rootVerticalAlignTop: string; rootVerticalAlignMiddle: string; rootAlternateRows: string; rowError: string; cell: string; row: string; rowDisabled: string; rowReadOnly: string; headerCell: string; rowTextCell: string; label: string; itemOnError: string; itemValue: string; itemChecked: string; itemDisabled: string; itemReadOnly: string; itemPreview: string; itemPreviewSvgIconId: string; itemHover: string; materialDecorator: string; itemDecorator: string; cellText: string; cellTextSelected: string; cellTextDisabled: string; cellResponsiveTitle: string; compact: string; }; matrixdropdown: { mainRoot: string; rootScroll: string; root: string; columnsAutoWidth: string; noHeader: string; hasFooter: string; rootVerticalAlignTop: string; rootVerticalAlignMiddle: string; tableWrapper: string; rootAlternateRows: string; cell: string; cellResponsiveTitle: string; errorsCell: string; errorsCellTop: string; errorsCellBottom: string; itemCell: string; row: string; rowDelayedEnter: string; rowEnter: string; rowLeave: string; expandedRow: string; rowHasPanel: string; rowHasEndActions: string; headerCell: string; rowTextCell: string; footerCell: string; footerTotalCell: string; columnTitleCell: string; cellRequiredText: string; detailButton: string; detailButtonExpanded: string; detailIcon: string; detailIconExpanded: string; detailIconId: string; detailIconExpandedId: string; detailPanelCell: string; detailRowCell: string; actionsCellPrefix: string; actionsCell: string; actionsCellDrag: string; emptyCell: string; verticalCell: string; cellQuestionWrapper: string; compact: string; }; matrixdynamic: { mainRoot: string; rootScroll: string; empty: string; root: string; columnsAutoWidth: string; noHeader: string; hasFooter: string; tableWrapper: string; rootAlternateRows: string; content: string; cell: string; cellResponsiveTitle: string; row: string; rowDelayedEnter: string; rowEnter: string; rowLeave: string; rowHasPanel: string; rowHasEndActions: string; expandedRow: string; itemCell: string; headerCell: string; rowTextCell: string; footerCell: string; columnTitleCell: string; cellRequiredText: string; button: string; detailRow: string; detailButton: string; detailButtonExpanded: string; detailIcon: string; detailIconExpanded: string; detailIconId: string; detailIconExpandedId: string; detailPanelCell: string; detailRowCell: string; actionsCellPrefix: string; actionsCell: string; actionsCellDrag: string; buttonAdd: string; buttonRemove: string; iconAdd: string; iconRemove: string; dragElementDecorator: string; iconDragElement: string; footer: string; footerTotalCell: string; emptyRowsSection: string; iconDrag: string; ghostRow: string; draggedRow: string; emptyCell: string; verticalCell: string; cellQuestionWrapper: string; errorsCell: string; errorsCellTop: string; errorsCellBottom: string; compact: string; }; rating: { rootDropdown: string; root: string; rootWrappable: string; rootLabelsTop: string; rootLabelsBottom: string; rootLabelsDiagonal: string; item: string; itemOnError: string; itemHover: string; selected: string; itemStar: string; itemStarOnError: string; itemStarHover: string; itemStarSelected: string; itemStarDisabled: string; itemStarReadOnly: string; itemStarPreview: string; itemStarHighlighted: string; itemStarUnhighlighted: string; itemStarSmall: string; itemSmiley: string; itemSmileyOnError: string; itemSmileyHover: string; itemSmileySelected: string; itemSmileyDisabled: string; itemSmileyReadOnly: string; itemSmileyPreview: string; itemSmileyHighlighted: string; itemSmileyScaleColored: string; itemSmileyRateColored: string; itemSmileySmall: string; minText: string; itemText: string; maxText: string; itemDisabled: string; itemReadOnly: string; itemPreview: string; itemFixedSize: string; control: string; itemSmall: string; selectWrapper: string; controlValue: string; controlDisabled: string; controlReadOnly: string; controlPreview: string; controlEmpty: string; filterStringInput: string; chevronButton: string; chevronButtonSvg: string; chevronButtonIconId: string; popup: string; onError: string; }; comment: { root: string; small: string; controlDisabled: string; controlReadOnly: string; controlPreview: string; content: string; remainingCharacterCounter: string; onError: string; }; expression: string; file: { root: string; rootDragging: string; rootAnswered: string; rootDisabled: string; rootReadOnly: string; rootPreview: string; other: string; placeholderInput: string; previewItem: string; fileSign: string; fileList: string; fileSignBottom: string; dragArea: string; dragAreaActive: string; fileDecorator: string; onError: string; fileDecoratorDrag: string; fileInput: string; noFileChosen: string; chooseFile: string; chooseFileAsText: string; chooseFileAsTextDisabled: string; chooseFileAsIcon: string; chooseFileIconId: string; disabled: string; controlDisabled: string; removeButton: string; removeButtonBottom: string; removeButtonIconId: string; removeFile: string; removeFileSvg: string; removeFileSvgIconId: string; wrapper: string; defaultImage: string; defaultImageIconId: string; leftIconId: string; rightIconId: string; removeFileButton: string; dragAreaPlaceholder: string; imageWrapper: string; imageWrapperDefaultImage: string; single: string; singleImage: string; mobile: string; videoContainer: string; contextButton: string; video: string; actionsContainer: string; closeCameraButton: string; changeCameraButton: string; takePictureButton: string; loadingIndicator: string; page: string; }; signaturepad: { mainRoot: string; root: string; small: string; controls: string; placeholder: string; canvas: string; backgroundImage: string; clearButton: string; clearButtonIconId: string; loadingIndicator: string; }; saveData: { root: string; rootWithButtons: string; info: string; error: string; success: string; button: string; shown: string; }; window: { root: string; rootCollapsedMod: string; rootFullScreenMode: string; rootContent: string; body: string; header: { root: string; titleCollapsed: string; buttonsContainer: string; button: string; buttonExpanded: string; buttonCollapsed: string; collapseButton: string; closeButton: string; fullScreenButton: string; }; }; ranking: { root: string; rootMobileMod: string; rootDragMod: string; rootDisabled: string; rootReadOnly: string; rootPreview: string; rootDesignMode: string; rootDragHandleAreaIcon: string; rootSelectToRankMod: string; rootSelectToRankEmptyValueMod: string; rootSelectToRankAlignVertical: string; rootSelectToRankAlignHorizontal: string; rootSelectToRankSwapAreas: string; item: string; itemContent: string; itemIndex: string; itemIndexEmptyMode: string; itemDisabled: string; itemReadOnly: string; itemPreview: string; controlLabel: string; itemGhostNode: string; itemIconContainer: string; itemIcon: string; itemIconHoverMod: string; itemIconFocusMod: string; itemGhostMod: string; itemDragMod: string; itemOnError: string; container: string; containerEmptyMode: string; containerFromMode: string; containerToMode: string; containerPlaceholder: string; containersDivider: string; }; buttongroup: { root: string; item: string; itemIcon: string; itemDecorator: string; itemCaption: string; itemHover: string; itemSelected: string; itemDisabled: string; itemControl: string; }; list: { root: string; item: string; itemBody: string; itemSelected: string; itemFocused: string; itemHovered: string; }; actionBar: { root: string; item: string; defaultSizeMode: string; smallSizeMode: string; itemPressed: string; itemAsIcon: string; itemIcon: string; itemTitle: string; }; variables: { mobileWidth: string; themeMark: string; }; tagbox: { root: string; popup: string; small: string; selectWrapper: string; other: string; onError: string; label: string; itemSvgIconId: string; item: string; itemDisabled: string; itemChecked: string; itemHover: string; itemControl: string; itemDecorator: string; itemEnter: string; itemLeave: string; cleanButton: string; cleanButtonSvg: string; cleanButtonIconId: string; cleanItemButton: string; cleanItemButtonSvg: string; cleanItemButtonIconId: string; chevronButton: string; chevronButtonSvg: string; chevronButtonIconId: string; control: string; controlValue: string; controlValueItems: string; placeholderInput: string; controlEditable: string; controlDisabled: string; controlReadOnly: string; controlPreview: string; controlEmpty: string; controlLabel: string; filterStringInput: string; materialDecorator: string; hint: string; hintPrefix: string; hintSuffix: string; hintSuffixWrapper: string; }; }; export const defaultV2ThemeName = "defaultV2"; } declare module "packages/survey-core/src/trigger" { import { HashTable } from "packages/survey-core/src/helpers"; import { Base } from "packages/survey-core/src/base"; import { ISurvey } from "packages/survey-core/src/base-interfaces"; /** * A base class for all triggers. * A trigger calls a method when the expression change the result: from false to true or from true to false. * Please note, it runs only one changing the expression result. */ export class Trigger extends Base { static idCounter: number; static operatorsValue: HashTable; static get operators(): HashTable; private conditionRunner; private idValue; constructor(); get id(): number; getType(): string; toString(): string; isGhost: boolean; protected get isInternal(): boolean; get operator(): string; set operator(value: string); get value(): any; set value(val: any); get name(): string; set name(val: string); get expression(): string; set expression(val: string); protected canBeExecuted(isOnNextPage: boolean): boolean; protected canBeExecutedOnComplete(): boolean; protected isExecutingOnNextPage: boolean; protected isExecutingOnNavigation: boolean; checkExpression(options: { isOnNextPage: boolean; isOnComplete: boolean; isOnNavigation: boolean; keys: any; values: HashTable; properties?: HashTable; }): void; protected canSuccessOnEmptyExpression(): boolean; check(value: any): void; get requireValidQuestion(): boolean; private perform; private triggerResult; protected onSuccess(values: HashTable, properties: HashTable): void; protected onFailure(): void; protected onSuccessExecuted(): void; endLoadingFromJson(): void; private oldPropertiesChanged; private onExpressionChanged; buildExpression(): string; private isCheckRequired; protected getUsedVariables(): string[]; private createConditionRunner; private get isRequireValue(); } export interface ISurveyTriggerOwner { getObjects(pages: string[], questions: string[]): any[]; setCompleted(trigger: Trigger): void; canBeCompleted(trigger: Trigger, isCompleted: boolean): void; triggerExecuted(trigger: Trigger): void; setTriggerValue(name: string, value: any, isVariable: boolean): any; copyTriggerValue(name: string, fromName: string, copyDisplayValue: boolean): void; focusQuestion(name: string): boolean; } /** * It extends the Trigger base class and add properties required for SurveyJS classes. */ export class SurveyTrigger extends Trigger { protected ownerValue: ISurveyTriggerOwner; constructor(); get owner(): ISurveyTriggerOwner; setOwner(owner: ISurveyTriggerOwner): void; getSurvey(live?: boolean): ISurvey; protected isRealExecution(): boolean; protected onSuccessExecuted(): void; } /** * If expression returns true, it makes questions/pages visible. * Ohterwise it makes them invisible. */ export class SurveyTriggerVisible extends SurveyTrigger { pages: string[]; questions: string[]; constructor(); getType(): string; protected onSuccess(values: HashTable, properties: HashTable): void; protected onFailure(): void; private onTrigger; protected onItemSuccess(item: any): void; protected onItemFailure(item: any): void; } /** * If expression returns true, it completes the survey. */ export class SurveyTriggerComplete extends SurveyTrigger { constructor(); getType(): string; get requireValidQuestion(): boolean; protected isRealExecution(): boolean; protected onSuccess(values: HashTable, properties: HashTable): void; protected onFailure(): void; } /** * If expression returns true, the value from property **setValue** will be set to **setToName** */ export class SurveyTriggerSetValue extends SurveyTrigger { constructor(); getType(): string; protected canBeExecuted(isOnNextPage: boolean): boolean; protected onPropertyValueChanged(name: string, oldValue: any, newValue: any): void; get setToName(): string; set setToName(val: string); get setValue(): any; set setValue(val: any); get isVariable(): boolean; set isVariable(val: boolean); protected onSuccess(values: HashTable, properties: HashTable): void; } /** * If expression returns true, the survey go to question **gotoName** and focus it. */ export class SurveyTriggerSkip extends SurveyTrigger { constructor(); getType(): string; get requireValidQuestion(): boolean; get gotoName(): string; set gotoName(val: string); protected canBeExecuted(isOnNextPage: boolean): boolean; protected onSuccess(values: HashTable, properties: HashTable): void; } /** * If expression returns true, the **runExpression** will be run. If **setToName** property is not empty then the result of **runExpression** will be set to it. */ export class SurveyTriggerRunExpression extends SurveyTrigger { constructor(); getType(): string; get setToName(): string; set setToName(val: string); get runExpression(): string; set runExpression(val: string); protected canBeExecuted(isOnNextPage: boolean): boolean; protected onSuccess(values: HashTable, properties: HashTable): boolean; private onCompleteRunExpression; } /** * If expression returns true, the value from question **fromName** will be set into **setToName**. */ export class SurveyTriggerCopyValue extends SurveyTrigger { constructor(); protected canBeExecuted(isOnNextPage: boolean): boolean; get setToName(): string; set setToName(val: string); get fromName(): string; set fromName(val: string); get copyDisplayValue(): boolean; set copyDisplayValue(val: boolean); getType(): string; protected onSuccess(values: HashTable, properties: HashTable): void; protected canSuccessOnEmptyExpression(): boolean; protected getUsedVariables(): string[]; } } declare module "packages/survey-core/src/calculatedValue" { import { HashTable } from "packages/survey-core/src/helpers"; import { Base } from "packages/survey-core/src/base"; import { ISurvey, ISurveyData } from "packages/survey-core/src/base-interfaces"; /** * The calculated value is a way to define the variable in Survey Creator. * It has two main properties: name and expression. Based on expression the value read-only property is automatically calculated. * The name property should be unique though all calculated values. * It uses survey.getVariable/seruvey.setVariable functions to get/set its value. The class do not store its value internally. * You may set includeIntoResult property to true to store this calculated value into survey result. */ export class CalculatedValue extends Base { private data; private expressionIsRunning; private expressionRunner; constructor(name?: string, expression?: string); setOwner(data: ISurveyData): void; getType(): string; getSurvey(live?: boolean): ISurvey; get owner(): ISurveyData; /** * The calculated value name. It should be non empty and unique. */ get name(): string; set name(val: string); /** * Set this property to true to include the non-empty calculated value into survey result, survey.data property. */ get includeIntoResult(): boolean; set includeIntoResult(val: boolean); /** * The Expression that used to calculate the value. You may use standard operators like +, -, * and /, squares (). Here is the example of accessing the question value {questionname}. * Example: "({quantity} * {price}) * (100 - {discount}) / 100" */ get expression(): string; set expression(val: string); locCalculation(): void; unlocCalculation(): void; private isCalculated; resetCalculation(): void; doCalculation(calculatedValues: Array, values: HashTable, properties: HashTable): void; runExpression(values: HashTable, properties: HashTable): void; get value(): any; protected setValue(val: any): void; private get canRunExpression(); private rerunExpression; private runExpressionCore; private runDependentExpressions; private ensureExpression; } } declare module "packages/survey-core/src/panel-layout-column" { import { Base } from "packages/survey-core/src/base"; export class PanelLayoutColumnModel extends Base { width: number; effectiveWidth: number; questionTitleWidth: string; constructor(width?: number, questionTitleWidth?: string); getType(): string; isEmpty(): boolean; } } declare module "packages/survey-core/src/textPreProcessor" { import { Question } from "packages/survey-core/src/question"; import { PanelModel } from "packages/survey-core/src/panel"; import { ISurvey, ITextProcessor, ITextProcessorProp, ITextProcessorResult } from "packages/survey-core/src/base-interfaces"; export class TextPreProcessorItem { start: number; end: number; } export class TextPreProcessorValue { name: string; returnDisplayValue: boolean; constructor(name: string, returnDisplayValue: boolean); value: any; isExists: boolean; canProcess: boolean; } export class TextPreProcessor { private _unObservableValues; private get hasAllValuesOnLastRunValue(); private set hasAllValuesOnLastRunValue(value); onProcess: (textValue: TextPreProcessorValue) => void; process(text: string, returnDisplayValue?: boolean, doEncoding?: boolean, replaceUndefinedValues?: boolean): string; processValue(name: string, returnDisplayValue: boolean): TextPreProcessorValue; get hasAllValuesOnLastRun(): boolean; processText(text: string, returnDisplayValue: boolean): string; processTextEx(params: ITextProcessorProp): ITextProcessorResult; private getItems; private isValidItemName; private getName; } export class QuestionTextProcessor implements ITextProcessor { protected variableName: string; private textPreProcessor; constructor(variableName: string); processValue(name: string, returnDisplayValue: boolean): TextPreProcessorValue; protected get survey(): ISurvey; protected get panel(): PanelModel; protected getValues(): any; protected getQuestionByName(name: string): Question; protected getParentTextProcessor(): ITextProcessor; protected onCustomProcessText(textValue: TextPreProcessorValue): boolean; protected getQuestionDisplayText(question: Question): string; private getProcessedTextValue; processText(text: string, returnDisplayValue: boolean): string; processTextEx(params: ITextProcessorProp): ITextProcessorResult; private addTextPreProcessor; } } declare module "packages/survey-core/src/error" { import { SurveyError } from "packages/survey-core/src/survey-error"; import { ISurveyErrorOwner } from "packages/survey-core/src/base-interfaces"; export class AnswerRequiredError extends SurveyError { text: string; constructor(text?: string, errorOwner?: ISurveyErrorOwner); getErrorType(): string; protected getDefaultText(): string; } export class OneAnswerRequiredError extends SurveyError { text: string; constructor(text?: string, errorOwner?: ISurveyErrorOwner); getErrorType(): string; protected getDefaultText(): string; } export class RequreNumericError extends SurveyError { text: string; constructor(text?: string, errorOwner?: ISurveyErrorOwner); getErrorType(): string; protected getDefaultText(): string; } export class ExceedSizeError extends SurveyError { private maxSize; constructor(maxSize: number, errorOwner?: ISurveyErrorOwner); getErrorType(): string; getDefaultText(): string; private getTextSize; } export class WebRequestError extends SurveyError { status: string; response: string; constructor(status: string, response: string, errorOwner?: ISurveyErrorOwner); getErrorType(): string; protected getDefaultText(): string; } export class WebRequestEmptyError extends SurveyError { text: string; constructor(text: string, errorOwner?: ISurveyErrorOwner); getErrorType(): string; protected getDefaultText(): string; } export class OtherEmptyError extends SurveyError { text: string; constructor(text: string, errorOwner?: ISurveyErrorOwner); getErrorType(): string; protected getDefaultText(): string; } export class UploadingFileError extends SurveyError { text: string; constructor(text: string, errorOwner?: ISurveyErrorOwner); getErrorType(): string; protected getDefaultText(): string; } export class RequiredInAllRowsError extends SurveyError { text: string; constructor(text: string, errorOwner?: ISurveyErrorOwner); getErrorType(): string; protected getDefaultText(): string; } export class EachRowUniqueError extends SurveyError { text: string; constructor(text: string, errorOwner?: ISurveyErrorOwner); getErrorType(): string; protected getDefaultText(): string; } export class MinRowCountError extends SurveyError { minRowCount: number; constructor(minRowCount: number, errorOwner?: ISurveyErrorOwner); getErrorType(): string; protected getDefaultText(): string; } export class KeyDuplicationError extends SurveyError { text: string; constructor(text: string, errorOwner?: ISurveyErrorOwner); getErrorType(): string; protected getDefaultText(): string; } export class CustomError extends SurveyError { text: string; constructor(text: string, errorOwner?: ISurveyErrorOwner); getErrorType(): string; } } declare module "packages/survey-core/src/question_custom" { import { Question, IConditionObject } from "packages/survey-core/src/question"; import { JsonObjectProperty } from "packages/survey-core/src/jsonobject"; import { Base } from "packages/survey-core/src/base"; import { ISurveyImpl, ISurveyData, ITextProcessor, IPanel, IElement, IQuestion, IProgressInfo } from "packages/survey-core/src/base-interfaces"; import { SurveyElement } from "packages/survey-core/src/survey-element"; import { PanelModel } from "packages/survey-core/src/panel"; import { PanelLayoutColumnModel } from "packages/survey-core/src/panel-layout-column"; import { HashTable } from "packages/survey-core/src/helpers"; import { ItemValue } from "packages/survey-core/src/itemvalue"; import { SurveyError } from "packages/survey-core/src/survey-error"; /** * An interface used to create custom question types. * * Refer to the following articles for more information: * * - [Create Specialized Question Types](https://surveyjs.io/form-library/documentation/customize-question-types/create-specialized-question-types) * - [Create Composite Question Types](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types) */ export interface ICustomQuestionTypeConfiguration { /** * A name used to identify a custom question type. * * @see title */ name: string; /** * A title used for this custom question type in the UI. When `title` is not specified, the `name` property value is used. * * @see name */ title?: string; /** * The name of an icon to use for the custom question type. * * [UI Icons](https://surveyjs.io/form-library/documentation/icons (linkStyle)) */ iconName?: string; internal?: boolean; /** * A function that is called when the custom question type is initialized. Use it to add, remove, or modify the type's properties (see [Override Base Question Properties](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types#override-base-question-properties)). */ onInit?(): void; /** * Specifies whether the custom question type is available in the Toolbox and the Add Question menu in Survey Creator. * * Default value: `true` * * Set this property to `false` if your custom question type is used only to customize Property Grid content and is not meant for a survey. */ showInToolbox?: boolean; /** * A default title for questions created with this question type. Survey authors can change the default title in the JSON object or in Survey Creator's Property Grid. * * You can specify the question title with a string value or with an object that defines different titles for different locales: * * ```js * import { ComponentCollection } from "survey-core"; * * ComponentCollection.Instance.add({ * // ... * defaultQuestionTitle: "Default title" * }); * // ===== OR ===== * ComponentCollection.Instance.add({ * // ... * defaultQuestionTitle: { * en: "Default title", * de: "Standardtitel", * fr: "Titre par défaut" * } * }); * ``` */ defaultQuestionTitle?: any; /** * An array of property names to inherit from a base question or a Boolean value that specifies whether or not to inherit all properties. * * Default value: `false` * * When you create a [custom specialized question type](https://surveyjs.io/form-library/documentation/customize-question-types/create-specialized-question-types), you base it on another question type configured within the [`questionJSON`](#questionJSON) object. If the custom question type should inherit all properties from the base type, set the `inheritBaseProps` property to `true`. If you want to inherit only certain properties, set the `inheritBaseProps` property to an array of their names. * * [Create Specialized Question Types](https://surveyjs.io/form-library/documentation/customize-question-types/create-specialized-question-types (linkStyle)) */ inheritBaseProps?: false | true | Array; /** * A function that is called when the custom question is created. Use it to access questions nested within a [composite question type](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types). * * Parameters: * * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\ * The custom question. */ onCreated?(question: Question): void; /** * A function that is called when JSON schemas are loaded. * * Parameters: * * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\ * A custom question. */ onLoaded?(question: Question): void; /** * A function that is called after the entire question is rendered. * * Parameters: * * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\ * A custom question. * - `htmlElement`: `any`\ * An HTML element that represents the custom question. */ onAfterRender?(question: Question, htmlElement: any): void; /** * A function that is called each time a question nested within a [composite question](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types) is rendered. * * Parameters: * * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\ * A composite question. * - `element`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\ * A nested question. * - `htmlElement`: `any`\ * An HTML element that represents a nested question. */ onAfterRenderContentElement?(question: Question, element: Question, htmlElement: any): void; /** * A function that is called each time a question nested within a [composite question](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types) requires an update of its CSS classes. * * Parameters: * * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\ * A composite question. * - `element`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\ * A nested question. * - `cssClasses`: `any`\ * An object with CSS classes applied to a nested question, for example, `{ root: "class1", button: "class2" }`. You can modify this object to apply custom CSS classes. */ onUpdateQuestionCssClasses?(question: Question, element: Question, cssClasses: any): void; /** * A function that is called when a custom question type property is changed. Use it to handle property changes. * * Parameters: * * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\ * A custom question. * - `propertyName`: `string`\ * The name of the changed property. * - `newValue`: `any`\ * A new value for the property. */ onPropertyChanged?(question: Question, propertyName: string, newValue: any): void; /** * A function that is called after the question value is changed in the UI. * * Parameters: * * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\ * A custom question. * - `name`: `string`\ * The question's [name](https://surveyjs.io/Documentation/Library?id=Question#name). * - `newValue`: `any`\ * A new value for the question. * * If you want to perform some actions when the value is changed in code as well as in the UI, implement the [`onValueSet`](https://surveyjs.io/form-library/documentation/api-reference/icustomquestiontypeconfiguration#onValueSet) function. */ onValueChanged?(question: Question, name: string, newValue: any): void; /** * A function that is called before a question value is changed in the UI. * * This function should return the value you want to save: `newValue`, a custom value, or `undefined` if you want to clear the question value. * * Parameters: * * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\ * A custom question. * - `name`: `string`\ * The question's [name](https://surveyjs.io/Documentation/Library?id=Question#name). * - `newValue`: `any`\ * A new value for the question. */ onValueChanging?(question: Question, name: string, newValue: any): any; /** * A function that is called when an [ItemValue](https://surveyjs.io/Documentation/Library?id=itemvalue) property is changed. * * Parameters: * * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\ * A custom question. * - `options.obj`: [ItemValue](https://surveyjs.io/Documentation/Library?id=itemvalue)\ * An `ItemValue` object. * - `options.propertyName`: `string`\ * The name of the property to which an array of `ItemValue` objects is assigned (for example, `"choices"` or `"rows"`). * - `options.name`: `string`\ * The name of the changed property: `"text"` or `"value"`. * - `options.newValue`: `any`\ * A new value for the property. */ onItemValuePropertyChanged?(question: Question, options: { obj: ItemValue; propertyName: string; name: string; newValue: any; }): void; /** * A function that allows you to override the default `getDisplayValue()` implementation. */ getDisplayValue?: ((keyAsText: boolean, value: any) => any) | ((question: Question) => any); /** * JSON schemas of nested questions. Specify this property to create a [composite question type](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types). */ elementsJSON?: any; /** * A function that allows you to create nested questions if you do not specify the `elementsJSON` property. * * @see elementsJSON */ createElements?: any; /** * A JSON schema for a built-in question type on which the custom question type is based. * * Refer to the [Create Specialized Question Types](https://surveyjs.io/form-library/documentation/customize-question-types/create-specialized-question-types) help topic for more information. */ questionJSON?: any; /** * A function that allows you to create a custom question if you do not specify the `questionJSON` property. * * @see questionJSON */ createQuestion?: any; /** * A function that allows you to display different error texts based on conditions. * @param question A custom question. Use the `question.value` property to access the question's value. * @returns An error text. */ getErrorText?: (question: Question) => string; /** * A function that is called after the question value is set. * * Parameters: * * - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\ * A custom question. * - `newValue`: `any`\ * A new value for the question. * * Unlike the [`onValueChanged`](https://surveyjs.io/form-library/documentation/api-reference/icustomquestiontypeconfiguration#onValueChanged) function, which is called only when the question value is changed in the UI, `onValueSet` is called when the value is changed in code as well. * * [View Demo](https://surveyjs.io/survey-creator/examples/smart-search-input/ (linkStyle)) */ onValueSet?: (question: Question, newValue: any) => void; onSetQuestionValue?: (question: Question, newValue: any) => void; valueToQuestion?: (val: any) => any; valueFromQuestion?: (val: any) => any; getValue?: (val: any) => any; setValue?: (val: any) => any; } export class ComponentQuestionJSON { name: string; json: ICustomQuestionTypeConfiguration; private dynamicProperties; constructor(name: string, json: ICustomQuestionTypeConfiguration); onInit(): void; onCreated(question: Question): void; onLoaded(question: Question): void; onAfterRender(question: Question, htmlElement: any): void; onAfterRenderContentElement(question: Question, element: Question, htmlElement: any): void; onUpdateQuestionCssClasses(question: Question, element: Question, css: any): void; onSetQuestionValue(question: Question, newValue: any): void; onPropertyChanged(question: Question, propertyName: string, newValue: any): void; onValueChanged(question: Question, name: string, newValue: any): void; onValueChanging(question: Question, name: string, newValue: any): any; onGetErrorText(question: Question): string; onItemValuePropertyChanged(question: Question, item: ItemValue, propertyName: string, name: string, newValue: any): void; getDisplayValue(keyAsText: boolean, value: any, question: Question): any; get defaultQuestionTitle(): any; setValueToQuestion(val: any): any; getValueFromQuestion(val: any): any; get isComposite(): boolean; getDynamicProperties(): Array; private calcDynamicProperties; } export class ComponentCollection { static Instance: ComponentCollection; private customQuestionValues; onCreateComposite: (name: string, questionJSON: ComponentQuestionJSON) => QuestionCompositeModel; onCreateCustom: (name: string, questionJSON: ComponentQuestionJSON) => QuestionCustomModel; onAddingJson: (name: string, isComposite: boolean) => void; add(json: ICustomQuestionTypeConfiguration): void; remove(componentName: string): boolean; get items(): Array; getCustomQuestionByName(name: string): ComponentQuestionJSON; private getCustomQuestionIndex; private removeByIndex; clear(includeInternal?: boolean): void; createQuestion(name: string, questionJSON: ComponentQuestionJSON): Question; protected createCompositeModel(name: string, questionJSON: ComponentQuestionJSON): QuestionCompositeModel; protected createCustomModel(name: string, questionJSON: ComponentQuestionJSON): QuestionCustomModel; } export abstract class QuestionCustomModelBase extends Question implements ISurveyImpl, ISurveyData, IPanel { customQuestion: ComponentQuestionJSON; private locQuestionTitle; constructor(name: string, customQuestion: ComponentQuestionJSON); getType(): string; locStrsChanged(): void; localeChanged(): void; protected getDefaultTitle(): string; addUsedLocales(locales: Array): void; needResponsiveWidth(): boolean; protected createWrapper(): void; protected onPropertyValueChanged(name: string, oldValue: any, newValue: any): void; itemValuePropertyChanged(item: ItemValue, name: string, oldValue: any, newValue: any): void; protected onFirstRenderingCore(): void; onHidingContent(): void; getProgressInfo(): IProgressInfo; protected abstract getElement(): SurveyElement; protected initElement(el: SurveyElement): void; protected isSettingValOnLoading: boolean; setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void; onSurveyLoad(): void; afterRenderQuestionElement(el: HTMLElement): void; afterRenderCore(el: any): void; protected onUpdateQuestionCssClasses(element: Question, css: any): void; protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void; protected setNewValue(newValue: any): void; protected onCheckForErrors(errors: Array, isOnValueChanged: boolean, fireCallback: boolean): void; getSurveyData(): ISurveyData; getTextProcessor(): ITextProcessor; getValue(name: string): any; setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any; protected getQuestionByName(name: string): IQuestion; protected isValueChanging(name: string, newValue: any): boolean; protected convertDataName(name: string): string; protected convertDataValue(name: string, newValue: any): any; getVariable(name: string): any; setVariable(name: string, newValue: any): void; getComment(name: string): string; setComment(name: string, newValue: string, locNotification: any): any; getAllValues(): any; getFilteredValues(): any; getFilteredProperties(): any; findQuestionByName(name: string): IQuestion; getEditingSurveyElement(): Base; addElement(element: IElement, index: number): void; removeElement(element: IElement): boolean; getQuestionTitleLocation(): string; getQuestionTitleWidth(): string; getColumsForElement(el: IElement): Array; updateColumns(): void; getQuestionStartIndex(): string; getChildrenLayoutType(): string; elementWidthChanged(el: IElement): void; get elements(): Array; indexOf(el: IElement): number; ensureRowsVisibility(): void; validateContainerOnly(): void; onQuestionValueChanged(el: IElement): void; getQuestionErrorLocation(): string; protected getContentDisplayValueCore(keyAsText: boolean, value: any, question: Question): any; } export class QuestionCustomModel extends QuestionCustomModelBase { private questionWrapper; private hasJSONTitle; getTemplate(): string; getDynamicProperties(): Array; getDynamicType(): string; getOriginalObj(): Base; protected createWrapper(): void; private getDynamicProperty; protected getElement(): SurveyElement; onAnyValueChanged(name: string, questionName: string): void; protected getQuestionByName(name: string): IQuestion; protected getDefaultTitle(): string; setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any; updateCommentFromSurvey(newValue: any): any; get requireUpdateCommentValue(): boolean; protected onSetData(): void; hasErrors(fireCallback?: boolean, rec?: any): boolean; focus(onError?: boolean): void; afterRenderCore(el: any): void; get contentQuestion(): Question; protected createQuestion(): Question; private checkCreatedQuestion; onSurveyLoad(): void; runCondition(values: HashTable, properties: HashTable): void; protected convertDataName(name: string): string; protected convertDataValue(name: string, newValue: any): any; protected getContentQuestionValue(): any; protected setContentQuestionValue(val: any): void; protected canSetValueToSurvey(): boolean; protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void; onSurveyValueChanged(newValue: any): void; protected getValueCore(): any; private isSettingValueChanged; protected setValueChangedDirectly(val: boolean): void; private createDynamicProperties; protected initElement(el: SurveyElement): void; updateElementCss(reNew?: boolean): void; setIsMobile(val: boolean): void; protected updateElementCssCore(cssClasses: any): void; protected getDisplayValueCore(keyAsText: boolean, value: any): any; } export class QuestionCompositeModel extends QuestionCustomModelBase { customQuestion: ComponentQuestionJSON; static ItemVariableName: string; private panelWrapper; private textProcessing; constructor(name: string, customQuestion: ComponentQuestionJSON); protected createWrapper(): void; getTemplate(): string; protected getElement(): SurveyElement; protected getCssRoot(cssClasses: any): string; get contentPanel(): PanelModel; hasErrors(fireCallback?: boolean, rec?: any): boolean; updateElementCss(reNew?: boolean): void; dispose(): void; private editingObjValue; private onEditingObjPropertyChanged; private updateEditingObj; private unConnectEditingObj; getEditingSurveyElement(): Base; getTextProcessor(): ITextProcessor; findQuestionByName(name: string): IQuestion; protected clearValueIfInvisibleCore(reason: string): void; onAnyValueChanged(name: string, questionName: string): void; get hasSingleInput(): boolean; get isContainer(): boolean; protected createPanel(): PanelModel; protected onReadOnlyChanged(): void; updateValueFromSurvey(newValue: any, clearData?: boolean): void; onSurveyLoad(): void; private setIsContentElement; setVisibleIndex(val: number): number; runCondition(values: HashTable, properties: HashTable): void; onSurveyValueChanged(newValue: any): void; getValue(name: string): any; protected getQuestionByName(name: string): IQuestion; private settingNewValue; setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any; setComment(name: string, newValue: string, locNotification: any): any; getComment(name: string): string; private getCommentName; private runPanelTriggers; getFilteredValues(): any; private updateValueCoreWithPanelValue; private getContentPanelValue; private getValueForContentPanel; private setNewValueIntoQuestion; addConditionObjectsByContext(objects: Array, context: any): void; protected collectNestedQuestionsCore(questions: Question[], visibleOnly: boolean, includeItSelf: boolean): void; protected convertDataValue(name: string, newValue: any): any; protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void; private setValuesIntoQuestions; protected getDisplayValueCore(keyAsText: boolean, value: any): any; private setAfterRenderCallbacks; get ariaRole(): string; setIsMobile(val: boolean): void; } } declare module "packages/survey-core/src/questionfactory" { import { Question } from "packages/survey-core/src/question"; import { IElement } from "packages/survey-core/src/base-interfaces"; export class QuestionFactory { static Instance: QuestionFactory; static get DefaultChoices(): string[]; static get DefaultColums(): string[]; static get DefaultRows(): string[]; static get DefaultMutlipleTextItems(): string[]; registerQuestion(questionType: string, questionCreator: (name: string) => Question, showInToolbox?: boolean): void; registerCustomQuestion(questionType: string): void; unregisterElement(elementType: string, removeFromSerializer?: boolean): void; clear(): void; getAllTypes(): Array; createQuestion(questionType: string, name: string): Question; } export class ElementFactory { static Instance: ElementFactory; private creatorHash; registerElement(elementType: string, elementCreator: (name: string) => IElement, showInToolbox?: boolean): void; registerCustomQuestion: (questionType: string, showInToolbox?: boolean) => void; clear(): void; unregisterElement(elementType: string, removeFromSerializer?: boolean): void; getAllToolboxTypes(): Array; getAllTypes(): Array; createElement(elementType: string, name: string): IElement; private getAllTypesCore; } } declare module "packages/survey-core/src/drag-drop-helper-v1" { import { IElement, ISurveyElement } from "packages/survey-core/src/base-interfaces"; export class DragDropInfo { source: IElement; target: IElement; nestedPanelDepth: number; constructor(source: IElement, target: IElement, nestedPanelDepth?: number); destination: ISurveyElement; isBottom: boolean; isEdge: boolean; } } declare module "packages/survey-core/src/drag-drop-panel-helper-v1" { import { IElement, ISurveyElement } from "packages/survey-core/src/base-interfaces"; import { DragDropInfo } from "packages/survey-core/src/drag-drop-helper-v1"; import { PanelModelBase, QuestionRowModel } from "packages/survey-core/src/panel"; export class DragDropPanelHelperV1 { private panel; constructor(panel: PanelModelBase); dragDropAddTarget(dragDropInfo: DragDropInfo): void; dragDropFindRow(findElement: ISurveyElement): QuestionRowModel; dragDropMoveElement(src: IElement, target: IElement, targetIndex: number): void; updateRowsOnElementAdded(element: IElement, index: number, dragDropInfo?: DragDropInfo, thisElement?: PanelModelBase): void; private dragDropAddTargetToRow; private dragDropAddTargetToEmptyPanel; private dragDropAddTargetToExistingRow; private dragDropAddTargetToNewRow; private dragDropAddTargetToEmptyPanelCore; } } declare module "packages/survey-core/src/panel" { import { HashTable } from "packages/survey-core/src/helpers"; import { Base } from "packages/survey-core/src/base"; import { ISurveyImpl, IPage, IPanel, IConditionRunner, IElement, ISurveyElement, IQuestion, ISurveyErrorOwner, ITitleOwner, IProgressInfo, ISurvey, IFindElement } from "packages/survey-core/src/base-interfaces"; import { DragTypeOverMeEnum, SurveyElement } from "packages/survey-core/src/survey-element"; import { Question } from "packages/survey-core/src/question"; import { LocalizableString } from "packages/survey-core/src/localizablestring"; import { findScrollableParent } from "packages/survey-core/src/utils/utils"; import { SurveyError } from "packages/survey-core/src/survey-error"; import { IAction } from "packages/survey-core/src/actions/action"; import { ActionContainer } from "packages/survey-core/src/actions/container"; import { DragDropInfo } from "packages/survey-core/src/drag-drop-helper-v1"; import { AnimationGroup } from "packages/survey-core/src/utils/animation"; import { PanelLayoutColumnModel } from "packages/survey-core/src/panel-layout-column"; export class QuestionRowModel extends Base { panel: PanelModelBase; private static rowCounter; private static getRowId; protected _scrollableParent: any; protected _updateVisibility: any; private get allowRendering(); private lazyRenderingTimeout; startLazyRendering(rowContainerDiv: HTMLElement, findScrollableContainer?: typeof findScrollableParent): void; ensureVisibility(): void; stopLazyRendering(): void; private idValue; constructor(panel: PanelModelBase); private isLazyRenderingValue; setIsLazyRendering(val: boolean): void; isLazyRendering(): boolean; get id(): string; protected equalsCore(obj: Base): boolean; get elements(): Array; protected getIsAnimationAllowed(): boolean; private getVisibleElementsAnimationOptions; visibleElementsAnimation: AnimationGroup; set visibleElements(val: Array); get visibleElements(): Array; onVisibleChangedCallback: () => void; get visible(): boolean; set visible(val: boolean); get isNeedRender(): boolean; set isNeedRender(val: boolean); updateVisible(): void; addElement(q: IElement): void; get index(): number; private setWidth; private getRenderedCalcWidth; private getElementWidth; private getRenderedWidthFromWidth; dragTypeOverMe: DragTypeOverMeEnum; dispose(): void; getRowCss(): string; private rootElement?; setRootElement(element?: HTMLElement): void; getRootElement(): HTMLElement; } /** * A base class for the [PanelModel](https://surveyjs.io/form-library/documentation/panelmodel) and [PageModel](https://surveyjs.io/form-library/documentation/pagemodel) classes. */ export class PanelModelBase extends SurveyElement implements IPanel, IConditionRunner, ISurveyErrorOwner, ITitleOwner { private static panelCounter; private static getPanelId; private elementsValue; private isQuestionsReady; private questionsValue; private _columns; private _columnsReady; gridLayoutColumns: Array; addElementCallback: (element: IElement) => void; removeElementCallback: (element: IElement) => void; onGetQuestionTitleLocation: () => string; private dragDropPanelHelper; onAddRow(row: QuestionRowModel): void; private getRowsAnimationOptions; private rowsAnimation; get visibleRows(): Array; set visibleRows(val: Array); onRemoveRow(row: QuestionRowModel): void; onRowVisibleChanged(): void; constructor(name?: string); getType(): string; setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void; endLoadingFromJson(): void; showTitle: boolean; get hasTextInTitle(): boolean; private resetHasTextInTitle; get hasTitle(): boolean; delete(doDispose?: boolean): void; private deletePanel; protected removeFromParent(): void; protected canShowTitle(survey: ISurvey): boolean; showDescription: boolean; get _showDescription(): boolean; localeChanged(): void; locStrsChanged(): void; getMarkdownHtml(text: string, name: string): string; get locNavigationTitle(): LocalizableString; get renderedNavigationTitle(): string; /** * Returns a character or text string that indicates a required panel/page. * @see SurveyModel.requiredText * @see isRequired */ get requiredText(): string; protected get titlePattern(): string; get isRequireTextOnStart(): boolean; get isRequireTextBeforeTitle(): boolean; get isRequireTextAfterTitle(): boolean; /** * Specifies a custom error message for a required panel/page. * @see isRequired * @see requiredIf */ get requiredErrorText(): string; set requiredErrorText(val: string); get locRequiredErrorText(): LocalizableString; /** * Specifies the sort order of questions in the panel/page. * * Possible values: * * - `"initial"` - Preserves the original order of questions. * - `"random"` - Displays questions in random order. * - `"default"` (default) - Inherits the setting from the Survey's `questionsOrder` property. * @see SurveyModel.questionsOrder * @see areQuestionsRandomized */ get questionsOrder(): string; set questionsOrder(val: string); private canRandomize; protected isRandomizing: boolean; randomizeElements(isRandom: boolean): boolean; /** * Returns `true` if elements in this panel/page are arranged in random order. * @see questionsOrder */ get areQuestionsRandomized(): boolean; /** * Returns a survey element (panel or page) that contains this panel and allows you to move the panel to a different survey element. * * For `PageModel` objects, the `parent` property is `null`, except in the following cases: * * - `SurveyModel`'s [`questionsOnPageMode`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#questionsOnPageMode) is set to `"singlePage"`. * - The page is included in a [preview of given answers](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#preview-page). * * In those cases, the survey creates an internal `PageModel` object to show all questions on one page, and the `parent` property contains this object. */ get parent(): PanelModelBase; set parent(val: PanelModelBase); get depth(): number; /** * A Boolean expression. If it evaluates to `false`, this panel/page becomes hidden. * * A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it. * * Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility). * @see visible * @see isVisible */ get visibleIf(): string; set visibleIf(val: string); protected calcCssClasses(css: any): any; /** * An auto-generated unique element identifier. */ get id(): string; set id(val: string); get isPanel(): boolean; getPanel(): IPanel; getLayoutType(): string; isLayoutTypeSupported(layoutType: string): boolean; /** * An array of all questions within this panel/page. Includes questions within nested panels. * @see elements */ get questions(): Array; getQuestions(includeNested: boolean): Array; protected getValidName(name: string): string; /** * Returns a question with a specified `name`. This method does not find questions within nested panels. * @param name A question name. */ getQuestionByName(name: string): Question; /** * Returns a survey element with a specified `name`. This method can find survey elements within nested elements. * @param name An element name. */ getElementByName(name: string): IElement; getQuestionByValueName(valueName: string): Question; getQuestionsByValueName(valueName: string): Array; /** * Returns a JSON object with question values nested in the panel/page. * @see getDisplayValue */ getValue(): any; collectValues(data: any, level: number): boolean; /** * Returns a JSON object with display texts that correspond to question values nested in the panel/page. * @param keysAsText Pass `true` if not only values in the object should be display texts, but also keys. Default value: `false`. * @see getValue */ getDisplayValue(keysAsText: boolean): any; /** * Returns a JSON object with comments left to questions within this panel/page. Question names are used as keys. */ getComments(): any; /** * Removes values that cannot be assigned to nested questions, for example, choices unlisted in the `choices` array. * * Call this method after you assign new question values in code to ensure that they are acceptable. * * > This method does not remove values for invisible questions and values that fail validation. Call the `validate()` method to validate newly assigned values. * * @see validate */ clearIncorrectValues(): void; /** * Empties the `errors` array for this panel/page and all its child elements (panels and questions). * @see errors */ clearErrors(): void; private markQuestionListDirty; /** * An array of all survey elements (questions or panels) within this panel/page. Does not include questions within nested panels. * @see questions */ get elements(): Array; getElementsInDesign(includeHidden?: boolean): Array; /** * Checks whether a given element belongs to this panel/page or nested panels. * @param element A survey element to check. */ containsElement(element: IElement): boolean; /** * Makes the panel/page require an answer at least in one nested question. If a respondent leaves the panel/page without any answers, the survey displays a validation error. * @see requiredIf * @see [Data Validation](https://surveyjs.io/form-library/documentation/data-validation) */ get isRequired(): boolean; set isRequired(val: boolean); /** * A Boolean expression. If it evaluates to `true`, this panel/page becomes required (at least one question in the panel/page should have an answer). * * A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it. * * Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility). * @see isRequired */ get requiredIf(): string; set requiredIf(val: string); searchText(text: string, founded: Array): void; hasErrors(fireCallback?: boolean, focusOnFirstError?: boolean, rec?: any): boolean; /** * Validates questions within this panel or page and returns `false` if the validation fails. * @param fireCallback *(Optional)* Pass `false` if you do not want to show validation errors in the UI. * @param focusOnFirstError *(Optional)* Pass `true` if you want to focus the first question with a validation error. * @see [Data Validation](https://surveyjs.io/form-library/documentation/data-validation) */ validate(fireCallback?: boolean, focusOnFirstError?: boolean, rec?: any): boolean; validateContainerOnly(): void; onQuestionValueChanged(el: IElement): void; private hasErrorsInPanels; getErrorCustomText(text: string, error: SurveyError): string; private hasRequiredError; protected hasErrorsCore(rec: any): void; protected getContainsErrors(): boolean; updateElementVisibility(): void; getFirstQuestionToFocus(withError?: boolean, ignoreCollapseState?: boolean): Question; getFirstVisibleQuestion(): Question; getFirstVisibleElement(): IElement; /** * Focuses the first question in this panel/page. * @see focusFirstErrorQuestion */ focusFirstQuestion(): void; /** * Focuses the first question with a validation error in this panel/page. * @see validate * @see focusFirstQuestion */ focusFirstErrorQuestion(): void; addQuestionsToList(list: Array, visibleOnly?: boolean, includingDesignTime?: boolean): void; addPanelsIntoList(list: Array, visibleOnly?: boolean, includingDesignTime?: boolean): void; private addElementsToList; private addElementsToListCore; private calcMaxRowColSpan; private updateColumnWidth; private onColumnPropertyValueChangedCallback; updateColumns(): void; updateRootStyle(): void; updateCustomWidgets(): void; /** * Sets a title location relative to the input field for questions that belong to this panel/page. * * Use this property to override the `questionTitleLocation` property specified for the survey. You can also set the `titleLocation` property for individual questions. * * Possible values: * * - `"default"` (default) - Inherits the setting from the `questionTitleLocation` property specified for the survey. * - `"top"` - Displays the title above the input field. * - `"bottom"` - Displays the title below the input field. * - `"left"` - Displays the title to the left of the input field. * - `"hidden"` - Hides the question title. * * > Certain question types (Matrix, Multiple Text) do not support the `"left"` value. For them, the `"top"` value is used. * @see SurveyModel.questionTitleLocation */ get questionTitleLocation(): string; set questionTitleLocation(value: string); getQuestionTitleLocation(): string; availableQuestionTitleWidth(): boolean; hasElementWithTitleLocationLeft(): boolean; /** * Sets consistent width for question titles in CSS values. Applies only when [`questionTitleLocation`](#questionTitleLocation) evaluates to `"left"`. * * Default value: `undefined` */ questionTitleWidth: string; getQuestionTitleWidth(): string; get columns(): Array; protected generateColumns(): void; updateGridColumns(): void; getColumsForElement(el: IElement): Array; protected getStartIndex(): string; getQuestionStartIndex(): string; getChildrenLayoutType(): string; getProgressInfo(): IProgressInfo; get root(): PanelModelBase; protected childVisibilityChanged(): void; protected canRenderFirstRows(): boolean; private isLazyRenderInRow; createRowAndSetLazy(index: number): QuestionRowModel; createRow(): QuestionRowModel; onSurveyLoad(): void; protected onFirstRenderingCore(): void; updateRows(): void; get rows(): Array; ensureRowsVisibility(): void; protected onRowsChanged(): void; private locCountRowUpdates; private blockRowsUpdates; private releaseRowsUpdates; private updateRowsBeforeElementRemoved; private updateRowsOnElementAdded; private canFireAddRemoveNotifications; protected onAddElement(element: IElement, index: number): void; protected onRemoveElement(element: IElement): void; protected unregisterElementPropertiesChanged(element: IElement): void; private onRemoveElementNotifySurvey; private onElementVisibilityChanged; private onElementStartWithNewLineChanged; private updateRowsVisibility; canBuildRows(): boolean; private buildRows; protected getElementsForRows(): Array; getDragDropInfo(): any; private updateRowsOnElementRemoved; updateRowsRemoveElementFromRow(element: IElement, row: QuestionRowModel): void; getAllRows(): Array; private findRowAndIndexByElement; private forceRenderRow; forceRenderElement(el: IElement, elementsRendered?: () => void, gap?: number): void; forceRenderRows(rows: Array, elementsRendered?: () => void): void; findRowByElement(el: IElement): QuestionRowModel; elementWidthChanged(el: IElement): void; get processedTitle(): string; protected getRenderedTitle(str: string): string; /** * Gets or sets panel/page visibility. * * If you want to display or hide a survey element based on a condition, specify the `visibleIf` property. Refer to the following help topic for information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility). * @see visibleIf * @see isVisible */ get visible(): boolean; set visible(value: boolean); onHidingContent(): void; protected onVisibleChanged(): void; protected notifyStateChanged(prevState: string): void; /** * Returns `true` if the panel/page is visible or the survey is currently in design mode. * * If you want to display or hide a question based on a condition, specify the `visibleIf` property. Refer to the following help topic for information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility). * @see visibleIf * @see visible */ get isVisible(): boolean; getIsContentVisible(exceptionQuestion?: IQuestion): boolean; getIsPageVisible(exceptionQuestion?: IQuestion): boolean; private lastVisibleIndex; setVisibleIndex(index: number): number; private updateVisibleIndexes; private resetVisibleIndexes; protected beforeSetVisibleIndex(index: number): number; protected getPanelStartIndex(index: number): number; protected isContinueNumbering(): boolean; get isReadOnly(): boolean; protected onReadOnlyChanged(): void; updateElementCss(reNew?: boolean): void; /** * A Boolean expression. If it evaluates to `false`, this panel/page becomes read-only. * * A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it. * * Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility). * @see readOnly * @see isReadOnly */ get enableIf(): string; set enableIf(val: string); /** * Adds a survey element (question or panel) to this panel/page. Returns `true` if the element was added successfully; `false` otherwise. * @param element A survey element to add. * @param index A desired index of this element in the `elements` array. * @see addNewQuestion * @see addNewPanel */ addElement(element: IElement, index?: number): boolean; insertElement(element: IElement, dest?: IElement, location?: "bottom" | "top" | "left" | "right"): void; insertElementAfter(element: IElement, after: IElement): void; insertElementBefore(element: IElement, before: IElement): void; protected canAddElement(element: IElement): boolean; addQuestion(question: Question, index?: number): boolean; addPanel(panel: PanelModel, index?: number): boolean; /** * Creates a new question of a given type and adds it to the `elements` array at a specified index. * * This method returns `null` if the question cannot be created or added to this panel/page; otherwise, the method returns the created question. * * @param questionType A [question type](https://surveyjs.io/form-library/documentation/question#getType). * @param name A question name. * @param index A desired index of the new question in the `elements` array. * @see elements * @see addElement */ addNewQuestion(questionType: string, name?: string, index?: number): Question; /** * Creates a new panel and adds it to the end of the `elements` array. * * This method returns `null` if the panel cannot be created or added to this panel/page; otherwise, the method returns the created panel. * @param name A panel name. * @see elementsup * @see addElement */ addNewPanel(name?: string): PanelModel; indexOf(element: IElement): number; protected createNewPanel(name: string): PanelModel; /** * Deletes a survey element (question or panel) from this panel/page. Returns `true` if the element was deleted successfully; `false` otherwise. * @param element A survey element to delete. * @see elements */ removeElement(element: IElement): boolean; removeQuestion(question: Question): void; runCondition(values: HashTable, properties: HashTable): void; onAnyValueChanged(name: string, questionName: string): void; checkBindings(valueName: string, value: any): void; dragDropAddTarget(dragDropInfo: DragDropInfo): void; dragDropFindRow(findElement: ISurveyElement): QuestionRowModel; dragDropMoveElement(src: IElement, target: IElement, targetIndex: number): void; needResponsiveWidth(): boolean; get hasDescriptionUnderTitle(): boolean; get cssHeader(): string; get cssDescription(): string; /** * Specifies the error message position for questions that belong to this page/panel. * * Use this property to override the [`questionErrorLocation`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#questionErrorLocation) property specified for the survey. You can also set the [`errorLocation`](https://surveyjs.io/form-library/documentation/question#errorLocation) property for individual questions. * * Possible values: * * - `"default"` (default) - Inherits the setting from the `questionErrorLocation` property specified for the survey. * - `"top"` - Displays error messages above questions. * - `"bottom"` - Displays error messages below questions. */ get questionErrorLocation(): string; set questionErrorLocation(val: string); getQuestionErrorLocation(): string; getTitleOwner(): ITitleOwner; get no(): string; get cssTitleNumber(): string; get cssRequiredText(): string; get cssError(): string; protected getCssError(cssClasses: any): string; getSerializableColumnsValue(): Array; afterRender(el: HTMLElement): void; dispose(): void; protected disposeElements(): void; } /** * A class that describes the Panel container element. * * A panel can contain questions and other panels. Refer to the following help topic for an illustration: [Survey Structure](https://surveyjs.io/form-library/documentation/design-survey-create-a-simple-survey#survey-structure). * * [View Demo](https://surveyjs.io/form-library/examples/questiontype-panel/ (linkStyle)) */ export class PanelModel extends PanelModelBase implements IElement { constructor(name?: string); getType(): string; get contentId(): string; getSurvey(live?: boolean): ISurvey; get isPanel(): boolean; /** * Returns a page to which the panel belongs and allows you to move this panel to a different page. * @see PanelModelBase.parent */ get page(): IPage; set page(val: IPage); protected removeFromParent(): void; moveTo(container: IPanel, insertBefore?: any): boolean; /** * Returns the visible index of the panel in the survey. Commonly it is -1 and it doesn't show. * You have to set showNumber to true to show index/numbering for the Panel * @see showNumber */ get visibleIndex(): number; /** * Specifies whether to show the panel number in the title. * * Default value: `false` * @see SurveyModel.showQuestionNumbers * @see SurveyModel.questionTitlePattern */ get showNumber(): boolean; set showNumber(val: boolean); /** * Gets or sets a value that specifies how the elements numbers inside panel are displayed. * * The following options are available: * * - `default` - display questions numbers as defined in parent panel or survey * - `onpanel` - display questions numbers, start numbering from beginning of this page * - `off` - turn off the numbering for questions titles * @see showNumber */ get showQuestionNumbers(): string; set showQuestionNumbers(value: string); /** * Specifies a number or letter used to start numbering of elements inside the panel. * * You can include desired prefixes and postfixes alongside the number or letter: * * ```js * "questionStartIndex": "a.", // a., b., c., ... * "questionStartIndex": "#3", // #3, #4, #5, ... * "questionStartIndex": "(B)." // (B)., (C)., (D)., ... * ``` * Default value: `"1."` (inherited from `SurveyModel`'s `questionStartIndex` property) * @see SurveyModel.questionStartIndex * @see showQuestionNumbers */ get questionStartIndex(): string; set questionStartIndex(val: string); getQuestionStartIndex(): string; /** * A question number or letter (depends on the `questionStartIndex` property). * * When the question number, title, or the entire question is invisible, this property returns an empty string. * @see questionStartIndex * @see showNumber * @see visibleIf */ get no(): string; private calcNo; protected notifyStateChanged(prevState: string): void; protected createLocTitleProperty(): LocalizableString; protected beforeSetVisibleIndex(index: number): number; protected getPanelStartIndex(index: number): number; private hasParentInQuestionIndex; protected isContinueNumbering(): boolean; private notifySurveyOnVisibilityChanged; protected getRenderedTitle(str: string): string; /** * Increases or decreases an indent of panel content from the left edge. Accepts positive integer values and 0. */ get innerIndent(): number; set innerIndent(val: number); /** * Disable this property if you want to render the current panel on the same line or row with the previous question or panel. */ get startWithNewLine(): boolean; set startWithNewLine(value: boolean); get allowAdaptiveActions(): boolean; set allowAdaptiveActions(val: boolean); get innerPaddingLeft(): string; set innerPaddingLeft(val: string); protected calcPaddingLeft(): string; protected calcPaddingRight(): string; protected resetIndents(): void; private getIndentSize; clearOnDeletingContainer(): void; get footerActions(): Array; private footerToolbarValue; onGetFooterActionsCallback: () => Array; onGetFooterToolbarCssCallback: () => string; getFooterToolbar(): ActionContainer; get hasEditButton(): boolean; cancelPreview(): void; get cssTitle(): string; protected getCssPanelTitle(): string; getCssTitleExpandableSvg(): string; get showErrorsAbovePanel(): boolean; protected getCssError(cssClasses: any): string; protected onVisibleChanged(): void; needResponsiveWidth(): boolean; focusIn(): void; protected getHasFrameV2(): boolean; protected getIsNested(): boolean; get showPanelAsPage(): boolean; private forcusFirstQuestionOnExpand; expand(focusFirstQuestion?: boolean): void; protected onElementExpanded(elementIsRendered: boolean): void; protected getCssRoot(cssClasses: { [index: string]: string; }): string; getContainerCss(): string; afterRenderCore(element: HTMLElement): void; } } declare module "packages/survey-core/src/utils/camera" { export class Camera { static mediaDevicesCallback: ((callback: (devices: Array) => void) => void) | undefined; static clear(): void; static setCameraList(list: Array): void; private static cameraList; private static cameraIndex; private static cameraFacingMode; private static canSwitchFacingMode; hasCamera(callback: (res: boolean) => void): void; getMediaConstraints(videoSize?: { width?: number; height?: number; }): MediaStreamConstraints; startVideo(videoElement: HTMLVideoElement, callback: (stream: MediaStream) => void, imageWidth?: number, imageHeight?: number): void; getImageSize(videoEl: HTMLVideoElement): { width: number; height: number; }; snap(videoElement: HTMLVideoElement, callback: BlobCallback): boolean; private canFlipValue; private updateCanFlipValue; private onCanFlipChangedCallback?; canFlip(onCanFlipChangedCallback?: (res: boolean) => void): boolean; flip(): void; private hasCameraCallback; private setVideoInputs; } } declare module "packages/survey-core/src/question_file" { import { IPlainDataOptions } from "packages/survey-core/src/base-interfaces"; import { IQuestionPlainData, Question } from "packages/survey-core/src/question"; import { EventBase, Base } from "packages/survey-core/src/base"; import { SurveyError } from "packages/survey-core/src/survey-error"; import { ActionContainer } from "packages/survey-core/src/actions/container"; import { Action } from "packages/survey-core/src/actions/action"; import { Camera } from "packages/survey-core/src/utils/camera"; import { LocalizableString } from "packages/survey-core/src/localizablestring"; export function dataUrl2File(dataUrl: string, fileName: string, type: string): File; /** * A base class for question types that support file upload: `QuestionFileModel` and `QuestionSignaturePadModel`. */ export class QuestionFileModelBase extends Question { isUploading: boolean; currentState: string; /** * An event that is raised after the upload state has changed. * * Parameters: * * - `sender`: `SurveyModel`\ * A survey instance that raised the event. * - `options.state`: `string`\ * The current upload state: `"empty"`, `"loading"`, `"loaded"`, or `"error"`. */ onUploadStateChanged: EventBase; onStateChanged: EventBase; protected stateChanged(state: string): void; get showLoadingIndicator(): boolean; /** * Specifies whether to store file or signature content as text in `SurveyModel`'s [`data`](https://surveyjs.io/form-library/documentation/surveymodel#data) property. * * If you disable this property, implement `SurveyModel`'s [`onUploadFiles`](https://surveyjs.io/form-library/documentation/surveymodel#onUploadFiles) event handler to specify how to store file content. */ get storeDataAsText(): boolean; set storeDataAsText(val: boolean); /** * Enable this property if you want to wait until files are uploaded to complete the survey. * * Default value: `false` */ get waitForUpload(): boolean; set waitForUpload(val: boolean); clearValue(keepComment?: boolean): void; clearOnDeletingContainer(): void; protected onCheckForErrors(errors: Array, isOnValueChanged: boolean, fireCallback: boolean): void; protected uploadFiles(files: File[]): void; protected loadPreview(newValue: any): void; protected onChangeQuestionValue(newValue: any): void; protected getIsQuestionReady(): boolean; private isFileLoadingValue; protected get isFileLoading(): boolean; protected set isFileLoading(val: boolean); } export class QuestionFilePage extends Base { private question; private index; private static pageCounter; private static getId; items: Array; id: string; constructor(question: QuestionFileModel, index: number); get css(): string; } /** * A class that describes the File Upload question type. * * [View Demo](https://surveyjs.io/form-library/examples/file-upload/ (linkStyle)) */ export class QuestionFileModel extends QuestionFileModelBase { isDragging: boolean; previewValue: any[]; pages: QuestionFilePage[]; navigationDirection: "left" | "right" | "left-delete"; indexToShow: number; pageSize: number; containsMultiplyFiles: boolean; allowCameraAccess: boolean; /** * Specifies the source of uploaded files. * * Possible values: * * - `"file"` (default) - Allows respondents to select a local file. * - `"camera"` - Allows respondents to capture and upload a photo. * - `"file-camera"` - Allows respondents to select a local file or capture a photo. * @see filePlaceholder * @see photoPlaceholder * @see fileOrPhotoPlaceholder */ sourceType: string; fileNavigator: ActionContainer; protected prevFileAction: Action; protected nextFileAction: Action; protected fileIndexAction: Action; closeCameraAction: Action; takePictureAction: Action; changeCameraAction: Action; chooseFileAction: Action; startCameraAction: Action; cleanAction: Action; actionsContainer: ActionContainer; get supportFileNavigator(): boolean; get fileNavigatorVisible(): boolean; private get pagesCount(); get actionsContainerVisible(): boolean; constructor(name: string); get videoId(): string; get hasVideoUI(): boolean; get hasFileUI(): boolean; private videoStream; startVideo(): void; private get videoHtmlElement(); private startVideoInCamera; stopVideo(): void; snapPicture(): void; private canFlipCameraValue; canFlipCamera(): boolean; flipCamera(): void; private closeVideoStream; onHidingContent(): void; protected updateElementCssCore(cssClasses: any): void; private getFileIndexCaption; private updateFileNavigator; private updateRenderedPages; private updatePages; private prevPreviewLength; private previewValueChanged; getType(): string; protected onChangeQuestionValue(newValue: any): void; /** * Disable this property only to implement a custom preview. * * [View Demo](https://surveyjs.io/form-library/examples/file-custom-preview/ (linkStyle)) * @see allowImagesPreview */ get showPreview(): boolean; set showPreview(val: boolean); /** * Specifies whether users can upload multiple files. * * Default value: `false` */ get allowMultiple(): boolean; set allowMultiple(val: boolean); /** * The image height. */ get imageHeight(): string; set imageHeight(val: string); /** * The image width. */ get imageWidth(): string; set imageWidth(val: string); /** * An [accept](https://www.w3schools.com/tags/att_input_accept.asp) attribute value for the underlying `` element. */ get acceptedTypes(): string; set acceptedTypes(val: string); /** * Specifies whether to show a preview of image files. */ get allowImagesPreview(): boolean; set allowImagesPreview(val: boolean); /** * Maximum allowed file size, measured in bytes. * * Default value: 0 (unlimited) */ get maxSize(): number; set maxSize(val: number); chooseFile(event: MouseEvent): void; /** * Specifies whether users should confirm file deletion. * * Default value: `false` */ get needConfirmRemoveFile(): boolean; set needConfirmRemoveFile(val: boolean); getConfirmRemoveMessage(fileName: string): string; confirmRemoveMessage: string; confirmRemoveAllMessage: string; noFileChosenCaption: string; chooseButtonCaption: string; get takePhotoCaption(): string; set takePhotoCaption(val: string); get locTakePhotoCaption(): LocalizableString; replaceButtonCaption: string; removeFileCaption: string; loadingFileTitle: string; chooseFileTitle: string; get clearButtonCaption(): string; set clearButtonCaption(value: string); get locClearButtonCaption(): LocalizableString; /** * A placeholder text displayed when the File Upload question doesn't contain any files or photos to upload. Applies only when [`sourceType`](#sourceType) value is `"file-camera"`. * @see filePlaceholder * @see photoPlaceholder */ fileOrPhotoPlaceholder: string; /** * A placeholder text displayed when the File Upload question doesn't contain any photos to upload. Applies only when the [`sourceType`](#sourceType) value is `"camera"`. * @see filePlaceholder * @see fileOrPhotoPlaceholder */ photoPlaceholder: string; /** * A placeholder text displayed when the File Upload question doesn't contain any files to upload. Applies only when the [`sourceType`](#sourceType) value is `"file"`. * @see photoPlaceholder * @see fileOrPhotoPlaceholder */ filePlaceholder: string; locRenderedPlaceholderValue: LocalizableString; get locRenderedPlaceholder(): LocalizableString; get currentMode(): string; get isPlayingVideo(): boolean; private setIsPlayingVideo; private updateCurrentMode; private updateActionsVisibility; get inputTitle(): string; get chooseButtonText(): string; clear(doneCallback?: () => void): void; get renderCapture(): string; get multipleRendered(): string; get showChooseButton(): boolean; get showFileDecorator(): boolean; get showDragAreaPlaceholder(): boolean; get allowShowPreview(): boolean; get showPreviewContainer(): boolean; get showRemoveButtonCore(): boolean; get showRemoveButton(): boolean; get showRemoveButtonBottom(): boolean; defaultImage(data: any): boolean; /** * Removes a file with a specified name. */ removeFile(name: string): void; protected removeFileByContent(content: any): void; protected setValueFromResult(arg: any): void; /** * Loads multiple files into the question. * @param files An array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects. */ loadFiles(files: File[]): void; private cameraValue; protected get camera(): Camera; canPreviewImage(fileItem: any): boolean; private prevLoadedPreviewValue; protected loadPreview(newValue: any): void; private allFilesOk; private isFileImage; getPlainData(options?: IPlainDataOptions): IQuestionPlainData; getImageWrapperCss(data: any): string; protected getActionsContainerCss(css: any): string; getRemoveButtonCss(): string; getChooseFileCss(): string; getReadOnlyFileCss(): string; get fileRootCss(): string; getFileDecoratorCss(): string; private onChange; protected calcCssClasses(css: any): any; onSurveyLoad(): void; protected needResponsiveness(): boolean; protected supportResponsiveness(): boolean; protected getObservedElementSelector(): string; private getFileListSelector; private _renderedPages; get renderedPages(): Array; set renderedPages(val: Array); private getPagesAnimationOptions; private pagesAnimation; private calcAvailableItemsCount; private calculatedGapBetweenItems; private calculatedItemWidth; private _width; triggerResponsiveness(hard?: boolean): void; protected processResponsiveness(_: number, availableWidth: number): boolean; private rootElement; private canDragDrop; afterRenderQuestionElement(el: HTMLElement): void; beforeDestroyQuestionElement(el: HTMLElement): void; private dragCounter; onDragEnter: (event: any) => void; onDragOver: (event: any) => boolean; onDrop: (event: any) => void; onDragLeave: (event: any) => void; doChange: (event: any) => void; doClean: () => void; private clearFilesCore; doRemoveFile(data: any, event: any): void; private removeFileCore; doDownloadFileFromContainer: (event: MouseEvent) => void; doDownloadFile: (event: any, data: any) => void; dispose(): void; } export class FileLoader { private fileQuestion; private callback; constructor(fileQuestion: QuestionFileModelBase, callback: (status: string, files: any[]) => void); loaded: any[]; load(files: Array): void; dispose(): void; } } declare module "packages/survey-core/src/choicesRestful" { import { Base } from "packages/survey-core/src/base"; import { ITextProcessor, IQuestion, ISurvey } from "packages/survey-core/src/base-interfaces"; import { ItemValue } from "packages/survey-core/src/itemvalue"; import { SurveyError } from "packages/survey-core/src/survey-error"; /** * Configures access to a RESTful service that returns choices for [Checkbox](https://surveyjs.io/Examples/Library?id=questiontype-checkbox), [Dropdown](https://surveyjs.io/Examples/Library?id=questiontype-dropdown), [Radiogroup](https://surveyjs.io/Examples/Library?id=questiontype-radiogroup), and other multiple-choice question types. * * Use the following properties to configure this object: * * ```js * { * url: "http://...", // A RESTful service's URL. * valueName: "value", // Specifies which field contains choice values. * titleName: "title", // Specifies which field contains display texts for choice values. * imageLinkName: "imageUrl", // Specifies which field contains image URLs. Used in Image Picker questions. * // Path to the array of choices. Specify `path` only if the array of choices is nested within the object returned by the service. * // The following path separators are allowed: semicolon `;`, comma `,`. * path: "myNestedArray" * } * ``` * * Typically, you should assign this object to a question's [`choicesByUrl`](https://surveyjs.io/Documentation/Library?id=QuestionSelectBase#choicesByUrl) property. You can also specify additional application-wide settings using the [`settings.web`](https://surveyjs.io/form-library/documentation/api-reference/settings#web) object. */ export class ChoicesRestful extends Base { private static cacheText; private static noCacheText; static get EncodeParameters(): boolean; static set EncodeParameters(val: boolean); static clearCache(): void; private static itemsResult; private static sendingSameRequests; private static addSameRequest; private static unregisterSameRequests; static get onBeforeSendRequest(): (sender: ChoicesRestful, options: { request: XMLHttpRequest; }) => void; static set onBeforeSendRequest(val: (sender: ChoicesRestful, options: { request: XMLHttpRequest; }) => void); private static getCachedItemsResult; private lastObjHash; private isRunningValue; protected processedUrl: string; protected processedPath: string; private isUsingCacheFromUrl; onProcessedUrlCallback: (url: string, path: string) => void; getResultCallback: (items: Array) => void; beforeSendRequestCallback: () => void; updateResultCallback: (items: Array, serverResult: any) => Array; getItemValueCallback: (item: any) => any; error: SurveyError; owner: IQuestion; createItemValue: (value: any) => ItemValue; constructor(); getSurvey(live?: boolean): ISurvey; run(textProcessor?: ITextProcessor): void; get isUsingCache(): boolean; get isRunning(): boolean; protected getIsRunning(): boolean; get isWaitingForParameters(): boolean; protected useChangedItemsResults(): boolean; private doEmptyResultCallback; private processedText; protected parseResponse(response: any): any; protected sendRequest(): void; getType(): string; get isEmpty(): boolean; getCustomPropertiesNames(): Array; private getCustomPropertyName; private getCustomProperties; private getAllPropertiesNames; setData(json: any): void; getData(): any; /** * A RESTful service's URL. * * This property supports [dynamic URLs](https://surveyjs.io/Documentation/Library?id=design-survey-conditional-logic#dynamic-texts). For example, the URL below depends on the `region` question's value. When the value changes, the survey automatically loads a new dataset that corresponds to the selected region. * * ```js * url: "https://surveyjs.io/api/CountriesExample?region={region}" * ``` * * [View Demo](https://surveyjs.io/Examples/Library/?id=questiontype-dropdownrestfull (linkStyle)) * @see path * @see valueName * @see titleName */ get url(): string; set url(val: string); /** * Path to the array of choices. The following path separators are allowed: semicolon `;`, comma `,`. * * Specify this property only if the array of choices is nested within the object returned by the service. For example, the service returns the following object: * * ```js * { * countries: [ ... ], * capitals: [ ... ] * } * ``` * * To populate choices with values from the `countries` array, set the `path` property to `"countries"`. To use the `capitals` array, set this property to `"capitals"`. * @see url * @see valueName * @see titleName */ get path(): string; set path(val: string); /** * Specifies which property in the obtained data object contains choice values. * * [View Demo](https://surveyjs.io/Examples/Library/?id=questiontype-dropdownrestfull (linkStyle)) * * @see url * @see path * @see titleName */ get valueName(): string; set valueName(val: string); /** * Specifies which property in the obtained data object contains display texts for choices. * * @see url * @see path * @see valueName */ get titleName(): string; set titleName(val: string); /** * Specifies which property in the obtained data object contains image URLs. Used only in [Image Picker](https://surveyjs.io/Examples/Library?id=questiontype-imagepicker) questions. * * @see url * @see path * @see valueName */ get imageLinkName(): string; set imageLinkName(val: string); /** * Specifies whether the service is allowed to return an empty response or an empty array in a response. * * Default value: `false` */ get allowEmptyResponse(): boolean; set allowEmptyResponse(val: boolean); get attachOriginalItems(): boolean; set attachOriginalItems(val: boolean); get itemValueType(): string; clear(): void; protected beforeSendRequest(): void; protected beforeLoadRequest(): void; protected onLoad(result: any, loadingObjHash?: string): void; protected callResultCallback(items: Array, loadingObjHash: string): void; private setCustomProperties; private getPropertyBinding; private onError; private getResultAfterPath; private getPathes; private getValue; private setTitle; private getImageLink; private getValueCore; private get objHash(); } /** * Obsolete, please use ChoicesRestful */ export class ChoicesRestfull extends ChoicesRestful { static get EncodeParameters(): boolean; static set EncodeParameters(val: boolean); static clearCache(): void; static get onBeforeSendRequest(): (sender: ChoicesRestful, options: { request: XMLHttpRequest; }) => void; static set onBeforeSendRequest(val: (sender: ChoicesRestful, options: { request: XMLHttpRequest; }) => void); } } declare module "packages/survey-core/src/utils/text-area" { import { Question } from "packages/survey-core/src/question"; export interface ITextArea { question: any; id: () => string; propertyNames: Array; className: () => string; isDisabledAttr: () => boolean; isReadOnlyAttr?: () => boolean; placeholder: () => string; autoGrow: () => boolean; maxLength: () => number; rows: () => number; cols?: () => number; getTextValue?: () => any; onTextAreaChange?: (event: any) => void; onTextAreaInput?: (event: any) => void; onTextAreaKeyDown?: (event: any) => void; onTextAreaBlur?: (event: any) => void; onTextAreaFocus?: (event: any) => void; ariaRequired: () => "true" | "false"; ariaLabel: () => string; ariaInvalid?: () => "true" | "false"; ariaLabelledBy?: () => string; ariaDescribedBy?: () => string; ariaErrormessage?: () => string; } export class TextAreaModel { private options; private element; updateElement(): void; private onPropertyChangedCallback; constructor(options: ITextArea); setElement(element: HTMLTextAreaElement | null): void; resetElement(): void; getTextValue(): string; onTextAreaChange(event: any): void; onTextAreaInput(event: any): void; onTextAreaKeyDown(event: any): void; onTextAreaBlur(event: any): void; onTextAreaFocus(event: any): void; get question(): Question; get id(): string; get placeholder(): string; get className(): string; get maxLength(): number; get autoGrow(): boolean; get rows(): number; get cols(): number | undefined; get isDisabledAttr(): boolean; get isReadOnlyAttr(): boolean | undefined; get ariaRequired(): "true" | "false"; get ariaLabel(): string; get ariaInvalid(): "true" | "false"; get ariaLabelledBy(): string; get ariaDescribedBy(): string; get ariaErrormessage(): string; dispose(): void; } } declare module "packages/survey-core/src/question_baseselect" { import { SurveyError } from "packages/survey-core/src/survey-error"; import { ISurveyImpl, ISurvey, ISurveyData, IPlainDataOptions } from "packages/survey-core/src/base-interfaces"; import { IQuestionPlainData, Question } from "packages/survey-core/src/question"; import { ItemValue } from "packages/survey-core/src/itemvalue"; import { ChoicesRestful } from "packages/survey-core/src/choicesRestful"; import { LocalizableString } from "packages/survey-core/src/localizablestring"; import { HashTable } from "packages/survey-core/src/helpers"; import { TextAreaModel } from "packages/survey-core/src/utils/text-area"; /** * A base class for multiple-choice question types ([Checkboxes](https://surveyjs.io/form-library/documentation/questioncheckboxmodel), [Dropdown](https://surveyjs.io/form-library/documentation/questiondropdownmodel), [Radio Button Group](https://surveyjs.io/form-library/documentation/questionradiogroupmodel), etc.). */ export class QuestionSelectBase extends Question { visibleChoicesChangedCallback: () => void; loadedChoicesFromServerCallback: () => void; renderedChoicesChangedCallback: () => void; private otherTextAreaModelValue; private filteredChoicesValue; private conditionChoicesVisibleIfRunner; private conditionChoicesEnableIfRunner; private prevOtherValue; private otherItemValue; private choicesFromUrl; private cachedValueForUrlRequests; private isChoicesLoaded; private enableOnLoadingChoices; private noneItemValue; private refuseItemValue; private dontKnowItemValue; private newItemValue; private canShowOptionItemCallback; private waitingGetChoiceDisplayValueResponse; private get waitingChoicesByURL(); protected selectedItemValues: any; constructor(name: string); getType(): string; dispose(): void; get otherTextAreaModel(): TextAreaModel; private getOtherTextAreaOptions; protected resetDependedQuestion(): void; get otherId(): string; protected getCommentElementsId(): Array; protected getItemValueType(): string; createItemValue(value: any, text?: string): ItemValue; hasErrors(fireCallback?: boolean, rec?: any): boolean; get isUsingCarryForward(): boolean; get carryForwardQuestionType(): string; private setCarryForwardQuestionType; get isUsingRestful(): boolean; updateIsUsingRestful(): void; supportGoNextPageError(): boolean; isLayoutTypeSupported(layoutType: string): boolean; localeChanged(): void; locStrsChanged(): void; private prevOtherErrorValue; private updatePrevOtherErrorValue; get otherValue(): string; set otherValue(val: string); protected get otherValueCore(): string; protected set otherValueCore(val: string); /** * Returns the "Other" choice item. Use this property to change the item's `value` or `text`. * @see showOtherItem */ get otherItem(): ItemValue; /** * Returns `true` if the "Other" choice item is selected. * @see showOtherItem */ get isOtherSelected(): boolean; get isNoneSelected(): boolean; /** * Specifies whether to display the "None" choice item. * * When users select the "None" item in multi-select questions, all other items become unselected. * @see noneItem * @see noneText * @see [settings.noneItemValue](https://surveyjs.io/form-library/documentation/api-reference/settings#noneItemValue) * @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder) */ get showNoneItem(): boolean; set showNoneItem(val: boolean); get hasNone(): boolean; set hasNone(val: boolean); /** * Returns the "None" choice item. Use this property to change the item's `value` or `text`. * @see showNoneItem */ get noneItem(): ItemValue; /** * Gets or sets a caption for the "None" choice item. * @see showNoneItem */ get noneText(): string; set noneText(val: string); get locNoneText(): LocalizableString; /** * Specifies whether to display the "Refuse to answer" choice item. * * When users select the "Refuse to answer" item in multi-select questions, all other items become unselected. * @see refuseItem * @see refuseItemText * @see [settings.refuseItemValue](https://surveyjs.io/form-library/documentation/api-reference/settings#refuseItemValue) * @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder) */ get showRefuseItem(): boolean; set showRefuseItem(val: boolean); /** * Returns the "Refuse to answer" choice item. Use this property to change the item's `value` or `text`. * @see showRefuseItem */ get refuseItem(): ItemValue; /** * Gets or sets a caption for the "Refuse to answer" choice item. * @see showRefuseItem */ get refuseText(): string; set refuseText(val: string); get locRefuseText(): LocalizableString; /** * Specifies whether to display the "Don't know" choice item. * * When users select the "Don't know" item in multi-select questions, all other items become unselected. * @see dontKnowItem * @see dontKnowItemText * @see [settings.dontKnowItemValue](https://surveyjs.io/form-library/documentation/api-reference/settings#dontKnowItemValue) * @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder) */ get showDontKnowItem(): boolean; set showDontKnowItem(val: boolean); /** * Returns the "Don't know" choice item. Use this property to change the item's `value` or `text`. * @see showDontKnowItem */ get dontKnowItem(): ItemValue; /** * Gets or sets a caption for the "Don't know" choice item. * @see showDontKnowItem */ get dontKnowText(): string; set dontKnowText(val: string); get locDontKnowText(): LocalizableString; private createDefaultItem; /** * A Boolean expression that is evaluated against each choice item. If the expression evaluates to `false`, the choice item becomes hidden. * * A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it. * * Use the `{item}` placeholder to reference the current choice item in the expression. * * Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility). * @see visibleIf * @see choicesEnableIf */ get choicesVisibleIf(): string; set choicesVisibleIf(val: string); /** * A Boolean expression that is evaluated against each choice item. If the expression evaluates to `false`, the choice item becomes read-only. * * A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it. * * Use the `{item}` placeholder to reference the current choice item in the expression. * * Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility). * @see enableIf * @see choicesVisibleIf */ get choicesEnableIf(): string; set choicesEnableIf(val: string); surveyChoiceItemVisibilityChange(): void; runCondition(values: HashTable, properties: HashTable): void; protected isTextValue(): boolean; private isSettingDefaultValue; protected setDefaultValue(): void; protected getIsMultipleValue(): boolean; protected convertDefaultValue(val: any): any; protected filterItems(): boolean; protected runItemsCondition(values: HashTable, properties: HashTable): boolean; protected runItemsEnableCondition(values: HashTable, properties: HashTable): any; protected onAfterRunItemsEnableCondition(): void; protected onEnableItemCallBack(item: ItemValue): boolean; protected onSelectedItemValuesChangedHandler(newValue: any): void; protected getItemIfChoicesNotContainThisValue(value: any, text?: string): any; protected getSingleSelectedItem(): ItemValue; protected onGetSingleSelectedItem(selectedItemByValue: ItemValue): void; protected getMultipleSelectedItems(): Array; private setConditionalChoicesRunner; private setConditionalEnableChoicesRunner; private canSurveyChangeItemVisibility; private changeItemVisibility; private runConditionsForItems; protected getHasOther(val: any): boolean; protected getIsItemValue(val: any, item: ItemValue): boolean; get validatedValue(): any; protected createRestful(): ChoicesRestful; private setNewRestfulProperty; get autoOtherMode(): boolean; set autoOtherMode(val: boolean); protected getQuestionComment(): string; protected selectOtherValueFromComment(val: boolean): void; private isSettingComment; protected setQuestionComment(newValue: string): void; private onUpdateCommentOnAutoOtherMode; private setOtherValueInternally; private getValueOnSettingOther; clearValue(keepComment?: boolean): void; updateCommentFromSurvey(newValue: any): any; get renderedValue(): any; set renderedValue(val: any); private makeCommentEmpty; protected setQuestionValue(newValue: any, updateIsAnswered?: boolean, updateComment?: boolean): void; protected setValueCore(newValue: any): void; protected setNewValue(newValue: any): void; protected valueFromData(val: any): any; protected rendredValueFromData(val: any): any; protected rendredValueToData(val: any): any; protected renderedValueFromDataCore(val: any): any; protected rendredValueToDataCore(val: any): any; protected needConvertRenderedOtherToDataValue(): boolean; protected getIsQuestionReady(): boolean; protected updateSelectedItemValues(): void; private setCustomValuesIntoItems; protected hasUnknownValue(val: any, includeOther?: boolean, isFilteredChoices?: boolean, checkEmptyValue?: boolean): boolean; protected hasUnknownValueItem(val: any, includeOther?: boolean, isFilteredChoices?: boolean, checkEmptyValue?: boolean): boolean; protected isValueDisabled(val: any): boolean; endLoadingFromJson(): void; clearIncorrectValuesCallback: () => void; /** * Configures access to a RESTful service that returns choice items. Refer to the [`ChoicesRestful`](https://surveyjs.io/form-library/documentation/choicesrestful) class description for more information. You can also specify additional application-wide settings using the [`settings.web`](https://surveyjs.io/form-library/documentation/api-reference/settings#web) object. * * [View Demo](https://surveyjs.io/form-library/examples/dropdown-menu-load-data-from-restful-service/ (linkStyle)) * @see choices * @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder) */ get choicesByUrl(): ChoicesRestful; set choicesByUrl(val: ChoicesRestful); /** * Gets or sets choice items. This property accepts an array of objects with the following structure: * * ```js * { * "value": any, // A unique value to be saved in the survey results. * "text": String, // A display text. This property supports Markdown. When `text` is undefined, `value` is used. * "imageLink": String // A link to the image or video that represents this choice value. Applies only to Image Picker questions. * "customProperty": any // Any property that you find useful. * } * ``` * * To enable Markdown support for the `text` property, implement Markdown-to-HTML conversion in the [`onTextMarkdown`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onTextMarkdown) event handler. For an example, refer to the following demo: [Convert Markdown to HTML with markdown-it](https://surveyjs.io/form-library/examples/edit-survey-questions-markdown/). * * If you add custom properties, refer to the following help topic to learn how to serialize them into JSON: [Add Custom Properties to Property Grid](https://surveyjs.io/survey-creator/documentation/property-grid#add-custom-properties-to-the-property-grid). * * If you need to specify only the `value` property, you can set the `choices` property to an array of primitive values, for example, `[ "item1", "item2", "item3" ]`. These values are both saved in survey results and used as display text. * @see choicesByUrl * @see choicesFromQuestion * @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder) */ get choices(): Array; set choices(newValue: Array); /** * Copies choice items from a specified question. Accepts a question name. * * If you specify this property, the `choices`, `choicesVisibleIf`, `choicesEnableIf`, and `choicesOrder` properties do not apply because their values are copied. * * In addition, you can specify the `choicesFromQuestionMode` property if you do not want to copy all choice items. * @see choicesFromQuestionMode * @see choices */ get choicesFromQuestion(): string; set choicesFromQuestion(val: string); private isLockVisibleChoices; /** * Specifies which choice items to copy from another question. Applies only when the `choicesFromQuestion` property is specified. * * Possible values: * * - `"all"` (default) - Copies all choice items. * - `"selected"` - Copies only selected choice items. * - `"unselected"` - Copies only unselected choice items. * * Use the `visibleChoices` property to access copied choice items. * @see choicesFromQuestion * @see visibleChoices */ get choicesFromQuestionMode(): string; set choicesFromQuestionMode(val: string); /** * Specifies which matrix column or dynamic panel question supplies choice values. Use this property to construct choice items based on cell values in Dynamic Matrix and question values in Dynamic Panel. * * Each choice item consists of a value saved in survey results and a text displayed in the UI. To construct a choice item, assign the `name` of a Dynamic Matrix or Dynamic Panel to the [`choicesFromQuestion`](#choicesFromQuestion) property and specify which dynamic panel question or matrix column supplies values and which provides texts. Use the `choiceValuesFromQuestion` and [`choiceTextsFromQuestion`](#choiceTextsFromQuestion) properties for this purpose. If a choice text is empty, a choice value is used as a display text and saved in survey results. */ get choiceValuesFromQuestion(): string; set choiceValuesFromQuestion(val: string); /** * Specifies which matrix column or dynamic panel question supplies choice texts. Use this property to construct choice items based on cell values in Dynamic Matrix and question values in Dynamic Panel. * * Each choice item consists of a value saved in survey results and a text displayed in the UI. To construct a choice item, assign the `name` of a Dynamic Matrix or Dynamic Panel to the [`choicesFromQuestion`](#choicesFromQuestion) property and specify which dynamic panel question or matrix column supplies values and which provides texts. Use the [`choiceValuesFromQuestion`](#choiceValuesFromQuestion) and `choiceTextsFromQuestion` properties for this purpose. If a choice text is empty, a choice value is used as a display text and saved in survey results. */ get choiceTextsFromQuestion(): string; set choiceTextsFromQuestion(val: string); /** * Specifies whether to hide the question if no choice items are visible. * * This property is useful if you show or hide choice items at runtime based on a [condition](https://surveyjs.io/form-library/documentation/questionselectbase#choicesVisibleIf). */ get hideIfChoicesEmpty(): boolean; set hideIfChoicesEmpty(val: boolean); /** * Specifies whether to keep values that cannot be assigned to this question, for example, choices unlisted in the `choices` array. * * > This property cannot be specified in the survey JSON schema. Use dot notation to specify it. * @see clearIncorrectValues */ get keepIncorrectValues(): boolean; set keepIncorrectValues(val: boolean); get storeOthersAsComment(): any; set storeOthersAsComment(val: any); protected hasOtherChanged(): void; /** * Specifies the sort order of choice items. * * Possible values: * * - `"none"` (default) - Preserves the original order of choice items. * - `"asc"`- Sorts choice items in ascending order. * - `"desc"`- Sorts choice items in ascending order. * - `"random"` - Displays choice items in random order. * @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder) */ get choicesOrder(): string; set choicesOrder(val: string); /** * Gets or sets a caption for the "Other" choice item. * @see showOtherItem */ get otherText(): string; set otherText(val: string); get locOtherText(): LocalizableString; /** * Displays the "Select All", "None", and "Other" choices on individual rows. * @see showNoneItem * @see showOtherItem * @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder) */ separateSpecialChoices: boolean; /** * A placeholder for the comment area. Applies when the `showOtherItem` or `showCommentArea` property is `true`. * @see showOtherItem * @see showCommentArea */ otherPlaceholder: string; get otherPlaceHolder(): string; set otherPlaceHolder(newValue: string); /** * Gets or sets an error message displayed when users select the "Other" choice item but leave the comment area empty. * @see showOtherItem */ get otherErrorText(): string; set otherErrorText(val: string); get locOtherErrorText(): LocalizableString; /** * An array of visible choice items. Includes the "Select All", "Other", and "None" choice items if they are visible. Items are sorted according to the `choicesOrder` value. * @see showNoneItem * @see showOtherItem * @see choicesOrder * @see choices * @see enabledChoices */ get visibleChoices(): Array; /** * An array of choice items with which users can interact. Includes the "Select All", "Other", and "None" choice items if they are not disabled. Items are sorted according to the `choicesOrder` value. * @see showNoneItem * @see showOtherItem * @see choicesOrder * @see choices * @see visibleChoices */ get enabledChoices(): Array; protected updateVisibleChoices(): void; private calcVisibleChoices; protected canUseFilteredChoices(): boolean; setCanShowOptionItemCallback(func: (item: ItemValue) => boolean): void; get newItem(): ItemValue; protected addToVisibleChoices(items: Array, isAddAll: boolean): void; protected addNewItemToVisibleChoices(items: Array, isAddAll: boolean): void; protected addNonChoicesItems(dict: Array<{ index: number; item: ItemValue; }>, isAddAll: boolean): void; protected addNonChoiceItem(dict: Array<{ index: number; item: ItemValue; }>, item: ItemValue, isAddAll: boolean, showItem: boolean, order: Array): void; protected canShowOptionItem(item: ItemValue, isAddAll: boolean, hasItem: boolean): boolean; isItemInList(item: ItemValue): boolean; protected get isAddDefaultItems(): boolean; getPlainData(options?: IPlainDataOptions): IQuestionPlainData; protected getDisplayValueCore(keysAsText: boolean, value: any): any; protected getDisplayValueEmpty(): string; private getChoicesDisplayValue; protected getDisplayArrayValue(keysAsText: boolean, value: any, onGetValueCallback?: (index: number) => any): string; private getItemDisplayValue; private getFilteredChoices; private get activeChoices(); get isMessagePanelVisible(): boolean; set isMessagePanelVisible(val: boolean); private get isEmptyActiveChoicesInDesign(); getCarryForwardQuestion(data?: ISurveyData): Question; protected getIsReadyDependsOn(): Array; private getQuestionWithChoices; private carryForwardQuestion; private findCarryForwardQuestion; private getQuestionWithChoicesCore; private getQuestionWithArrayValue; private getChoicesFromArrayQuestion; private getValueKeyName; private getChoicesFromSelectQuestion; private copyChoiceItem; protected get hasActiveChoices(): boolean; protected isBuiltInChoice(item: ItemValue): boolean; isNoneItem(item: ItemValue): boolean; protected getNoneItems(): Array; protected getChoices(): Array; supportOther(): boolean; supportNone(): boolean; supportRefuse(): boolean; supportDontKnow(): boolean; protected isSupportProperty(propName: string): boolean; protected onCheckForErrors(errors: Array, isOnValueChanged: boolean, fireCallback: boolean): void; setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void; protected setSurveyCore(value: ISurvey): void; getStoreOthersAsComment(): boolean; onSurveyLoad(): void; onAnyValueChanged(name: string, questionName: string): void; updateValueFromSurvey(newValue: any, clearData: boolean): void; protected getCommentFromValue(newValue: any): string; protected setOtherValueIntoValue(newValue: any): any; onOtherValueInput(event: any): void; onOtherValueChange(event: any): void; private isRunningChoices; private runChoicesByUrl; private isFirstLoadChoicesFromUrl; protected onBeforeSendRequest(): void; protected onLoadChoicesFromUrl(array: Array): void; private canAvoidSettChoicesFromUrl; private setChoicesFromUrl; private createCachedValueForUrlRequests; private updateCachedValueForUrlRequests; private isUpdatingChoicesDependedQuestions; protected updateChoicesDependedQuestions(): void; protected updateDependedQuestion(): void; onSurveyValueChanged(newValue: any): void; protected onVisibleChoicesChanged(): void; protected isVisibleCore(): boolean; private sortVisibleChoices; private sortArray; private randomizeArray; private get hasChoicesUrl(); clearIncorrectValues(): void; private canClearIncorrectValues; protected hasValueToClearIncorrectValues(): boolean; protected clearValueIfInvisibleCore(reason: string): void; /** * Returns `true` if a passed choice item is selected. * * To obtain a choice item to check, use the `noneItem` or `otherItem` property or the `choices` array. * @param item A choice item. * @see noneItem * @see otherItem * @see choices */ isItemSelected(item: ItemValue): boolean; protected isItemSelectedCore(item: ItemValue): boolean; private clearDisabledValues; protected clearIncorrectValuesCore(): void; protected canClearValueAnUnknown(val: any): boolean; protected clearDisabledValuesCore(): void; clearUnusedValues(): void; getColumnClass(): string; getItemIndex(item: any): number; getItemClass(item: any): string; protected getCurrentColCount(): number; protected getItemClassCore(item: any, options: any): string; getLabelClass(item: ItemValue): string; getControlLabelClass(item: ItemValue): string; _renderedChoices: Array; onGetRenderedChoicesCallback?: (visibleChoices: Array) => Array; private updateRenderedChoices; private getRenderedChoicesAnimationOptions; private renderedChoicesAnimation; get renderedChoices(): Array; set renderedChoices(val: Array); private headItemsCount; private footItemsCount; get headItems(): ItemValue[]; get footItems(): ItemValue[]; get dataChoices(): ItemValue[]; get bodyItems(): ItemValue[]; get hasHeadItems(): boolean; get hasFootItems(): boolean; get columns(): any[]; getItemsColumnKey(itemsColumn: Array): string; get hasColumns(): boolean; get rowLayout(): boolean; get blockedRow(): boolean; choicesLoaded(): void; getItemValueWrapperComponentName(item: ItemValue): string; getItemValueWrapperComponentData(item: ItemValue): any; ariaItemChecked(item: ItemValue): "true" | "false"; isOtherItem(item: ItemValue): boolean; get itemSvgIcon(): string; getSelectBaseRootCss(): string; protected allowMobileInDesignMode(): boolean; getAriaItemLabel(item: ItemValue): string; getItemId(item: ItemValue): string; get questionName(): string; getItemEnabled(item: ItemValue): boolean; private focusOtherComment; private prevIsOtherSelected; protected onValueChanged(): void; protected getDefaultItemComponent(): string; /** * The name of a component used to render items. * * [View Dropdown Demo](https://surveyjs.io/form-library/examples/dropdown-box-with-custom-items/ (linkStyle)) * * [View Ranking Demo](https://surveyjs.io/form-library/examples/ranking-with-custom-items/ (linkStyle)) */ get itemComponent(): string; set itemComponent(value: string); } /** * A base class for multiple-selection question types that can display choice items in multiple columns ([Checkbox](https://surveyjs.io/form-library/documentation/questioncheckboxmodel), [Radiogroup](https://surveyjs.io/form-library/documentation/questionradiogroupmodel), [Image Picker](https://surveyjs.io/form-library/documentation/questionimagepickermodel)). */ export class QuestionCheckboxBase extends QuestionSelectBase { colCountChangedCallback: () => void; constructor(name: string); /** * Gets or sets the number of columns used to arrange choice items. * * Set this property to 0 if you want to display all items in one line. The default value depends on the available width. * @see separateSpecialChoices */ get colCount(): number; set colCount(value: number); protected onParentChanged(): void; protected onParentQuestionChanged(): void; protected getSearchableItemValueKeys(keys: Array): void; } } declare module "packages/survey-core/src/validator" { import { Base } from "packages/survey-core/src/base"; import { ISurveyErrorOwner, ISurvey } from "packages/survey-core/src/base-interfaces"; import { SurveyError } from "packages/survey-core/src/survey-error"; import { LocalizableString } from "packages/survey-core/src/localizablestring"; export class ValidatorResult { value: any; error: SurveyError; constructor(value: any, error?: SurveyError); } /** * A base class for all classes that implement validators. * * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle)) */ export class SurveyValidator extends Base { errorOwner: ISurveyErrorOwner; onAsyncCompleted: (result: ValidatorResult) => void; constructor(); get isValidator(): boolean; getSurvey(live?: boolean): ISurvey; /** * An error message to display when a value fails validation. */ get text(): string; set text(value: string); get isValidateAllValues(): boolean; get locText(): LocalizableString; protected getErrorText(name: string): string; protected getDefaultErrorText(name: string): string; validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult; get isRunning(): boolean; get isAsync(): boolean; getLocale(): string; getMarkdownHtml(text: string, name: string): string; getRenderer(name: string): string; getRendererContext(locStr: LocalizableString): any; getProcessedText(text: string): string; protected createCustomError(name: string): SurveyError; toString(): string; } export interface IValidatorOwner { getValidators(): Array; validatedValue: any; getValidatorTitle(): string; getDataFilteredValues(): any; getDataFilteredProperties(): any; } export class ValidatorRunner { private asyncValidators; onAsyncCompleted: (errors: Array) => void; run(owner: IValidatorOwner): Array; private prepareAsyncValidators; } /** * A class that implements a validator for numeric values. * * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle)) */ export class NumericValidator extends SurveyValidator { constructor(minValue?: number, maxValue?: number); getType(): string; validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult; protected getDefaultErrorText(name: string): string; /** * A minimum allowed numeric value. * * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle)) */ get minValue(): number; set minValue(val: number); /** * A maximum allowed numeric value. * * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle)) */ get maxValue(): number; set maxValue(val: number); } /** * A class that implements a validator for text values. * * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle)) */ export class TextValidator extends SurveyValidator { constructor(); getType(): string; validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult; protected getDefaultErrorText(name: string): string; /** * The minimum length of a text value measured in characters. * * Default value: 0 * * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle)) */ get minLength(): number; set minLength(val: number); /** * The maximum length of a text value measured in characters. * * Default value: 0 (unlimited) * * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle)) */ get maxLength(): number; set maxLength(val: number); /** * Specifies whether a text value can include numerical digits. * * Default value: `true` */ get allowDigits(): boolean; set allowDigits(val: boolean); } /** * A class that implements answer count validation in the question types that can have multiple values (for instance, [Checkboxes](https://surveyjs.io/form-library/documentation/api-reference/checkbox-question-model)). * * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle)) */ export class AnswerCountValidator extends SurveyValidator { constructor(minCount?: number, maxCount?: number); getType(): string; validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult; protected getDefaultErrorText(name: string): string; /** * A minimum number of selected answers. * * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle)) */ get minCount(): number; set minCount(val: number); /** * A maximum number of selected answers. * * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle)) */ get maxCount(): number; set maxCount(val: number); } /** * A class that implements validation using regular expressions. * * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle)) */ export class RegexValidator extends SurveyValidator { constructor(regex?: string); getType(): string; validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult; private hasError; /** * A regular expression used to validate values. * * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle)) */ get regex(): string; set regex(val: string); /** * Specifies whether uppercase and lowercase letters must be treated as distinct or equivalent when validating values. * * Default value: `false` (uppercase and lowercase letters are treated as distinct) */ get caseInsensitive(): boolean; set caseInsensitive(val: boolean); get insensitive(): boolean; set insensitive(val: boolean); private createRegExp; } /** * A class that implements a validator for e-mail addresses. * * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle)) */ export class EmailValidator extends SurveyValidator { private re; constructor(); getType(): string; validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult; protected getDefaultErrorText(name: string): string; } /** * A class that implements validation using [expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions). * * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle)) */ export class ExpressionValidator extends SurveyValidator { private conditionRunner; private isRunningValue; constructor(expression?: string); getType(): string; get isValidateAllValues(): boolean; get isAsync(): boolean; get isRunning(): boolean; validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult; protected generateError(res: boolean, value: any, name: string): ValidatorResult; protected getDefaultErrorText(name: string): string; private ensureConditionRunner; /** * A Boolean [expression](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions). If it evaluates to `false`, validation fails. * * [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle)) */ get expression(): string; set expression(val: string); } } declare module "packages/survey-core/src/question_expression" { import { HashTable } from "packages/survey-core/src/helpers"; import { Question } from "packages/survey-core/src/question"; import { LocalizableString } from "packages/survey-core/src/localizablestring"; /** * A class that describes the Expression question type. It is a read-only question type that calculates a value based on a specified expression. * * [View Demo](https://surveyjs.io/form-library/examples/questiontype-expression/ (linkStyle)) */ export class QuestionExpressionModel extends Question { private expressionIsRunning; private expressionRunner; constructor(name: string); getType(): string; get hasInput(): boolean; /** * A string that formats a question value. Use `{0}` to reference the question value in the format string. * @see displayStyle */ get format(): string; set format(val: string); get locFormat(): LocalizableString; /** * An expression used to calculate the question value. * * Refer to the following help topic for more information: [Expressions](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#expressions). */ get expression(): string; set expression(val: string); locCalculation(): void; unlocCalculation(): void; runCondition(values: HashTable, properties: HashTable): void; protected canCollectErrors(): boolean; hasRequiredError(): boolean; private createRunner; /** * The maximum number of fraction digits. Applies only if the `displayStyle` property is not `"none"`. Accepts values in the range from -1 to 20, where -1 disables the property. * * Default value: -1 * @see displayStyle * @see minimumFractionDigits * @see precision */ get maximumFractionDigits(): number; set maximumFractionDigits(val: number); /** * The minimum number of fraction digits. Applies only if the `displayStyle` property is not `"none"`. Accepts values in the range from -1 to 20, where -1 disables the property. * * Default value: -1 * @see displayStyle * @see maximumFractionDigits */ get minimumFractionDigits(): number; set minimumFractionDigits(val: number); private runIfReadOnlyValue; get runIfReadOnly(): boolean; set runIfReadOnly(val: boolean); get formatedValue(): string; protected updateFormatedValue(): void; protected onValueChanged(): void; updateValueFromSurvey(newValue: any, clearData: boolean): void; protected getDisplayValueCore(keysAsText: boolean, value: any): any; /** * Specifies a display style for the question value. * * Possible values: * * - `"decimal"` * - `"currency"` * - `"percent"` * - `"date"` * - `"none"` (default) * * If you use the `"currency"` display style, you can also set the `currency` property to specify a currency other than USD. * @see currency * @see minimumFractionDigits * @see maximumFractionDigits * @see format */ get displayStyle(): string; set displayStyle(val: string); /** * A three-letter currency code. Applies only if the `displayStyle` property is set to `"currency"`. * * Default value: "USD". * @see displayStyle * @see minimumFractionDigits * @see maximumFractionDigits * @see format */ get currency(): string; set currency(val: string); /** * Specifies whether to use grouping separators in number representation. Separators depend on the selected [locale](https://surveyjs.io/form-library/documentation/surveymodel#locale). * * Default value: `true` */ get useGrouping(): boolean; set useGrouping(val: boolean); /** * Specifies how many decimal digits to keep in the expression value. * * Default value: -1 (unlimited) * @see maximumFractionDigits */ get precision(): number; set precision(val: number); private roundValue; protected getValueAsStr(val: any): string; } export function getCurrecyCodes(): Array; } declare module "packages/survey-core/src/question_matrixdropdowncolumn" { import { Question } from "packages/survey-core/src/question"; import { Base, ArrayChanges } from "packages/survey-core/src/base"; import { ISurvey, IWrapperObject } from "packages/survey-core/src/base-interfaces"; import { ItemValue } from "packages/survey-core/src/itemvalue"; import { ILocalizableOwner, LocalizableString } from "packages/survey-core/src/localizablestring"; import { SurveyValidator } from "packages/survey-core/src/validator"; import { MatrixDropdownRowModelBase } from "packages/survey-core/src/question_matrixdropdownbase"; export interface IMatrixColumnOwner extends ILocalizableOwner { getRequiredText(): string; hasChoices(): boolean; onColumnPropertyChanged(column: MatrixDropdownColumn, name: string, newValue: any): void; onColumnItemValuePropertyChanged(column: MatrixDropdownColumn, propertyName: string, obj: ItemValue, name: string, newValue: any, oldValue: any): void; onShowInMultipleColumnsChanged(column: MatrixDropdownColumn): void; onColumnVisibilityChanged(column: MatrixDropdownColumn): void; getCellType(): string; getCustomCellType(column: MatrixDropdownColumn, row: MatrixDropdownRowModelBase, cellType: string): string; onColumnCellTypeChanged(column: MatrixDropdownColumn): void; getCellAriaLabel(rowTitle: string, columnTitle: string): string; } export var matrixDropdownColumnTypes: any; /** * An auxiliary class that describes a column in a [Multi-Select Matrix](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list) or [Dynamic Matrix](https://surveyjs.io/form-library/documentation/api-reference/dynamic-matrix-table-question-model). * * You can get an object of this class from the [`columns`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list#columns) array or by calling the [`getColumnByName()`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list#getColumnByName) method on a matrix instance. */ export class MatrixDropdownColumn extends Base implements ILocalizableOwner, IWrapperObject { static getColumnTypes(): Array; private templateQuestionValue; private colOwnerValue; private indexValue; private _hasVisibleCell; private _visiblechoices; constructor(name: string, title?: string, colOwner?: IMatrixColumnOwner); getOriginalObj(): Base; getClassNameProperty(): string; getSurvey(live?: boolean): ISurvey; endLoadingFromJson(): void; getDynamicPropertyName(): string; getDynamicType(): string; get colOwner(): IMatrixColumnOwner; set colOwner(value: IMatrixColumnOwner); locStrsChanged(): void; addUsedLocales(locales: Array): void; get index(): number; setIndex(val: number): void; getType(): string; /** * Specifies the type of column cells. * * Possible values: * * - [`"dropdown"`](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model) * - [`"checkbox"`](https://surveyjs.io/form-library/documentation/api-reference/checkbox-question-model) * - [`"radiogroup"`](https://surveyjs.io/form-library/documentation/api-reference/radio-button-question-model) * - [`"tagbox"`](https://surveyjs.io/form-library/documentation/api-reference/dropdown-tag-box-model) * - [`"text"`](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model) * - [`"comment"`](https://surveyjs.io/form-library/documentation/api-reference/comment-field-model) * - [`"boolean"`](https://surveyjs.io/form-library/documentation/api-reference/boolean-question-model) * - [`"expression"`](https://surveyjs.io/form-library/documentation/api-reference/expression-model) * - [`"rating"`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model) * - `"default"` (default) - Inherits the input type from the [`cellType`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list#cellType) property specified for the parent matrix. * * The input types are based upon standalone question types. Depending on the selected input type, the matrix column can have additional configuration properties inherited from the corresponding question type. For instance, Dropdown, Checkboxes, Radio Button Group, and Tag Box columns can specify the [`choices`](https://surveyjs.io/form-library/documentation/api-reference/radio-button-question-model#choices) array, similar to the question types upon which they are based. Refer to the API Reference of these question types for a full list of available properties. * * [View Demo](https://surveyjs.io/form-library/examples/aggregate-data-within-form/ (linkStyle)) */ get cellType(): string; set cellType(val: string); get templateQuestion(): Question; get value(): string; get isVisible(): boolean; get isColumnVisible(): boolean; /** * Gets or sets column visibility. * * If you want to display or hide a column based on a condition, specify the [`visibleIf`](#visibleIf) property. * @see isRequired * @see readOnly */ get visible(): boolean; set visible(val: boolean); get hasVisibleCell(): boolean; set hasVisibleCell(newVal: boolean); isColumnsVisibleIf: boolean; getVisibleMultipleChoices(): Array; get getVisibleChoicesInCell(): Array; setVisibleChoicesInCell(val: Array): void; get isFilteredMultipleColumns(): boolean; /** * A column ID that is not visible to respondents. * * > Column IDs must be unique. * @see title */ get name(): string; set name(val: string); /** * A user-friendly column caption to display. If `title` is undefined, [`name`](#name) is displayed instead. */ get title(): string; set title(val: string); get locTitle(): LocalizableString; get fullTitle(): string; /** * Marks the column as required. If a respondent skips any cell in a required column, the matrix displays a [validation error](#requiredErrorText). * * If you want to mark the column as required based on a condition, specify the [`requiredIf`](#requiredIf) property. * @see visible * @see readOnly */ get isRequired(): boolean; set isRequired(val: boolean); get isRenderedRequired(): boolean; set isRenderedRequired(val: boolean); updateIsRenderedRequired(val: boolean): void; get requiredText(): string; /** * Specifies a custom error message for a required column. * @see isRequired */ get requiredErrorText(): string; set requiredErrorText(val: string); get locRequiredErrorText(): LocalizableString; /** * Makes the column read-only. * * If you want to switch the column to the read-only state based on a condition, specify the [`enableIf`](#enableIf) property. * @see visible * @see isRequired */ get readOnly(): boolean; set readOnly(val: boolean); get hasOther(): boolean; set hasOther(val: boolean); /** * A Boolean expression. If it evaluates to `false`, this column becomes hidden. * * Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility). * @see visible */ get visibleIf(): string; set visibleIf(val: string); /** * A Boolean expression. If it evaluates to `false`, this column becomes read-only. * * Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility). * @see readOnly */ get enableIf(): string; set enableIf(val: string); /** * A Boolean expression. If it evaluates to `true`, this column becomes required. * * Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility). * @see isRequired */ get requiredIf(): string; set requiredIf(val: string); /** * A Boolean expression. If it evaluates to `true`, all cells in this column are set to a value calculated using the [`defaultValueExpression`](#defaultValueExpression). * * [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle)) * @see setValueIf */ get resetValueIf(): string; set resetValueIf(val: string); /** * An expression used to calculate the column's default value. This expression applies to all cells of this column until the cell value is specified by an end user or programmatically. * * [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle)) * @see setValueExpression */ get defaultValueExpression(): string; set defaultValueExpression(val: string); /** * A Boolean expression. If it evaluates to `true`, all cells in this column are set to a value calculated using the [`setValueExpression`](#setValueExpression). * * [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle)) * @see resetValueIf */ get setValueIf(): string; set setValueIf(val: string); /** * An expression used to calculate a value for all column cells. * * You can use `setValueExpression` as a standalone property or in conjunction with the [`setValueIf`](#setValueIf) expression, in which case the calculated cell value applies only when `setValueIf` evaluates to `true`. * * [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle)) * @see defaultValueExpression * @see resetValueIf */ get setValueExpression(): string; set setValueExpression(val: string); /** * Specifies whether a respondent is required to provide a unique response for each question within this column. * * Default value: `false` */ get isUnique(): boolean; set isUnique(val: boolean); /** * Specifies whether to create an individual column for each choice option. Applies only to columns of `"checkbox"` or `"radiogroup"` [`cellType`](#cellType). */ get showInMultipleColumns(): boolean; set showInMultipleColumns(val: boolean); get isSupportMultipleColumns(): boolean; get isShowInMultipleColumns(): boolean; /** * Column validators. * * [Data Validation](https://surveyjs.io/form-library/documentation/data-validation (linkStyle)) * @see isRequired */ get validators(): Array; set validators(val: Array); /** * An aggregation method used to calculate the column total. * * Possible values: * * - `"none"` (default) - Disables total calculations. * - `"sum"` * - `"count"` * - `"min"` * - `"max"` * - `"avg"` * * [View Demo](https://surveyjs.io/form-library/examples/aggregate-data-within-form/ (linkStyle)) * @see totalFormat * @see totalDisplayStyle */ get totalType(): string; set totalType(val: string); /** * An expression used to calculate total values. Overrides the [`totalType`](#totalType) property. * * [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle)) */ get totalExpression(): string; set totalExpression(val: string); get hasTotal(): boolean; /** * A string pattern used to display column totals. To reference a total value within this pattern, use the `{0}` placeholder. * * [View Demo](https://surveyjs.io/form-library/examples/aggregate-data-within-form/ (linkStyle)) * @see totalType * @see totalDisplayStyle */ get totalFormat(): string; set totalFormat(val: string); get locTotalFormat(): LocalizableString; get cellHint(): string; set cellHint(val: string); get locCellHint(): LocalizableString; get renderAs(): string; set renderAs(val: string); get totalMaximumFractionDigits(): number; set totalMaximumFractionDigits(val: number); get totalMinimumFractionDigits(): number; set totalMinimumFractionDigits(val: number); /** * A format for calculated total values. * * Possible values: * * - `"none"` (default) * - `"decimal"` * - `"currency"` * - `"percent"` * * [View Demo](https://surveyjs.io/form-library/examples/aggregate-data-within-form/ (linkStyle)) * @see totalType * @see totalFormat * @see totalCurrency */ get totalDisplayStyle(): string; set totalDisplayStyle(val: string); /** * An alignment for calculated total values. * * Possible values: * * - `"left"` * - `"center"` * - `"right"` * - `"auto"` (default) - Applies one of the values above based on the column's [cell type](#cellType). * * [View Demo](https://surveyjs.io/form-library/examples/aggregate-data-within-form/ (linkStyle)) * @see totalType * @see totalFormat * @see totalCurrency * @see totalDisplayStyle */ get totalAlignment(): string; set totalAlignment(val: string); /** * Specifies a currency used to display calculated total values. Applies only if [`totalDisplayStyle`](#totalDisplayStyle) is set to `"currency"`. * @see totalType */ get totalCurrency(): string; set totalCurrency(val: string); /** * Gets or sets minimum column width in CSS values. By default, the matrix calculates column widths to optimally fit the content of all columns. * @see width */ get minWidth(): string; set minWidth(val: string); /** * Gets or sets column width in CSS values. By default, the matrix calculates column widths to optimally fit the content of all columns. * @see minWidth */ get width(): string; set width(val: string); /** * Gets or sets the number of columns used to arrange choice options. Applies only to columns of `"checkbox"` or `"radiogroup"` [`cellType`](#cellType). * * Default value: -1 (inherits the actual value from the parent matrix's [`columnColCount`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list#columnColCount) property) */ get colCount(): number; set colCount(val: number); getLocale(): string; getMarkdownHtml(text: string, name: string): string; getRenderer(name: string): string; getRendererContext(locStr: LocalizableString): any; getProcessedText(text: string): string; createCellQuestion(row: MatrixDropdownRowModelBase): Question; startLoadingFromJson(json?: any): void; updateCellQuestion(cellQuestion: Question, data: any, onUpdateJson?: (json: any) => any): void; private callOnCellQuestionUpdate; defaultCellTypeChanged(): void; protected calcCellQuestionType(row: MatrixDropdownRowModelBase): string; private getDefaultCellQuestionType; protected updateTemplateQuestion(newCellType?: string, name?: string, title?: string): void; protected createNewQuestion(cellType: string): Question; private setParentQuestionToTemplate; private previousChoicesId; protected setQuestionProperties(question: Question, onUpdateJson?: (json: any) => any): void; protected propertyValueChanged(name: string, oldValue: any, newValue: any, arrayChanges?: ArrayChanges, target?: Base): void; private doItemValuePropertyChanged; private doShowInMultipleColumnsChanged; private doColumnVisibilityChanged; private getProperties; private removeProperties; private addProperties; } } declare module "packages/survey-core/src/dragdrop/engine" { export interface IDragDropEngine { dragInit(event: PointerEvent, draggedElement: any, parentElement: any, draggedElementNode: HTMLElement): void; dragOver(event: PointerEvent): void; drop(): void; clear(): void; } } declare module "packages/survey-core/src/utils/devices" { export const IsMobile: boolean; export var mouseInfo: { readonly isTouch: boolean; readonly hasTouchEvent: boolean; hasMouse: boolean; }; export let IsTouch: boolean; export function _setIsTouch(val: boolean): void; export type MatchMediaMethod = ((query: string) => { matches: boolean; } | null) | null; export function detectMouseSupport(matchMedia: MatchMediaMethod): boolean; } declare module "packages/survey-core/src/dragdrop/dom-adapter" { import { IDragDropEngine } from "packages/survey-core/src/dragdrop/engine"; export interface IDragDropDOMAdapter { startDrag(event: PointerEvent, draggedElement: any, parentElement: any, draggedElementNode: HTMLElement, preventSaveTargetNode: boolean): void; draggedElementShortcut: HTMLElement; rootContainer: HTMLElement; documentOrShadowRoot: Document | ShadowRoot; rootElement?: HTMLElement; } export class DragDropDOMAdapter implements IDragDropDOMAdapter { private dd; private longTap; private fitToContainer; static PreventScrolling: boolean; private timeoutID; private startX; private startY; private currentX; private currentY; private savedTargetNode; private savedTargetNodeParent; private savedTargetNodeIndex; private scrollIntervalId; constructor(dd: IDragDropEngine, longTap?: boolean, fitToContainer?: boolean); get documentOrShadowRoot(): Document | ShadowRoot; get rootElement(): any; private stopLongTapIfMoveEnough; private get isMicroMovement(); private stopLongTap; private startLongTapProcessing; private handlePointerCancel; private handleEscapeButton; private onContextMenu; private moveShortcutElement; private getShortcutBottomCoordinate; private getShortcutRightCoordinate; protected requestAnimationFrame(callback: any): number; protected scrollByDrag(scrollableParentNode: HTMLElement, clientY: number, clientX: number): void; private doScroll; private dragOver; private clear; private drop; private doStartDrag; private returnUserSelectBack; draggedElementShortcut: any; rootContainer: HTMLElement; startDrag(event: PointerEvent, draggedElement: any, parentElement?: any, draggedElementNode?: HTMLElement, preventSaveTargetNode?: boolean): void; private getNodeIndexInParent; private insertNodeToParentAtIndex; } } declare module "packages/survey-core/src/dragdrop/core" { import { SurveyModel } from "packages/survey-core/src/survey"; import { EventBase } from "packages/survey-core/src/base"; import { IShortcutText, ISurvey } from "packages/survey-core/src/base-interfaces"; import { IDragDropEngine } from "packages/survey-core/src/dragdrop/engine"; import { IDragDropDOMAdapter } from "packages/survey-core/src/dragdrop/dom-adapter"; export abstract class DragDropCore implements IDragDropEngine { private surveyValue?; private creator?; private _isBottom; get isBottom(): boolean; set isBottom(val: boolean); onGhostPositionChanged: EventBase<{}>; protected ghostPositionChanged(): void; onDragStart: EventBase>; onDragEnd: EventBase>; onDragClear: EventBase>; onBeforeDrop: EventBase, any>; onAfterDrop: EventBase, any>; draggedElement: any; protected abstract get draggedElementType(): string; protected parentElement: T; dropTarget: any; protected get dropTargetDataAttributeName(): string; protected get survey(): SurveyModel; prevDropTarget: any; protected allowDropHere: boolean; protected domAdapter: IDragDropDOMAdapter; constructor(surveyValue?: ISurvey, creator?: any, longTap?: boolean, domAdapter?: IDragDropDOMAdapter); startDrag(event: PointerEvent, draggedElement: any, parentElement?: any, draggedElementNode?: HTMLElement, preventSaveTargetNode?: boolean): void; private getRootElement; dragInit(event: PointerEvent, draggedElement: any, parentElement?: any, draggedElementNode?: HTMLElement): void; protected onStartDrag(event?: PointerEvent): void; protected isDropTargetDoesntChanged(newIsBottom: boolean): boolean; protected getShortcutText(draggedElement: IShortcutText): string; protected createDraggedElementShortcut(text: string, draggedElementNode?: HTMLElement, event?: PointerEvent): HTMLElement; protected getDraggedElementClass(): string; protected doDragOver(): void; protected afterDragOver(dropTargetNode: HTMLElement): void; protected abstract isDropTargetValid(dropTarget: any, dropTargetNode?: HTMLElement): boolean; protected banDropHere: () => void; protected doBanDropHere: () => void; protected findDropTargetNodeFromPoint(clientX: number, clientY: number): HTMLElement; protected getDataAttributeValueByNode(node: HTMLElement): string; protected getDropTargetByNode(dropTargetNode: HTMLElement, event: PointerEvent): any; private capitalizeFirstLetter; protected abstract getDropTargetByDataAttributeValue(dataAttributeValue: string, dropTargetNode?: HTMLElement, event?: PointerEvent): any; protected calculateVerticalMiddleOfHTMLElement(HTMLElement: HTMLElement): number; protected calculateHorizontalMiddleOfHTMLElement(HTMLElement: HTMLElement): number; protected calculateIsBottom(clientY: number, dropTargetNode?: HTMLElement): boolean; protected findDropTargetNodeByDragOverNode(dragOverNode: HTMLElement): HTMLElement; dragOver(event: PointerEvent): void; protected abstract doDrop(): any; drop(): void; clear(): void; } } declare module "packages/survey-core/src/dragdrop/matrix-rows" { import { MatrixDropdownRowModelBase } from "packages/survey-core/src/question_matrixdropdownbase"; import { QuestionMatrixDynamicModel, MatrixDynamicRowModel } from "packages/survey-core/src/question_matrixdynamic"; import { DragDropCore } from "packages/survey-core/src/dragdrop/core"; export class DragDropMatrixRows extends DragDropCore { protected get draggedElementType(): string; protected restoreUserSelectValue: string; protected onStartDrag(): void; private get shortcutClass(); protected createDraggedElementShortcut(text: string, draggedElementNode: HTMLElement, event: PointerEvent): HTMLElement; private fromIndex; private toIndex; protected getDropTargetByDataAttributeValue(dataAttributeValue: any): MatrixDropdownRowModelBase; canInsertIntoThisRow(row: MatrixDynamicRowModel): boolean; protected isDropTargetValid(dropTarget: any, dropTargetNode?: HTMLElement): boolean; protected calculateIsBottom(clientY: number): boolean; protected afterDragOver(dropTargetNode: HTMLElement): void; protected doDrop: () => QuestionMatrixDynamicModel; clear(): void; } } declare module "packages/survey-core/src/question_matrixdropdownrendered" { import { Question } from "packages/survey-core/src/question"; import { Base } from "packages/survey-core/src/base"; import { ItemValue } from "packages/survey-core/src/itemvalue"; import { LocalizableString } from "packages/survey-core/src/localizablestring"; import { PanelModel } from "packages/survey-core/src/panel"; import { IAction } from "packages/survey-core/src/actions/action"; import { MatrixDropdownColumn } from "packages/survey-core/src/question_matrixdropdowncolumn"; import { MatrixDropdownCell, MatrixDropdownRowModelBase, QuestionMatrixDropdownModelBase } from "packages/survey-core/src/question_matrixdropdownbase"; export class QuestionMatrixDropdownRenderedCell { private static counter; private idValue; private itemValue; minWidth: string; width: string; locTitle: LocalizableString; cell: MatrixDropdownCell; column: MatrixDropdownColumn; row: MatrixDropdownRowModelBase; question: Question; isRemoveRow: boolean; choiceIndex: number; isOtherChoice: boolean; matrix: QuestionMatrixDropdownModelBase; isEmpty: boolean; colSpans: number; panel: PanelModel; isShowHideDetail: boolean; isActionsCell: boolean; isErrorsCell: boolean; isDragHandlerCell: boolean; isDetailRowCell: boolean; private classNameValue; constructor(); get requiredText(): string; get hasQuestion(): boolean; get hasTitle(): boolean; get hasPanel(): boolean; get id(): string; get item(): ItemValue; set item(val: ItemValue); get isChoice(): boolean; get isItemChoice(): boolean; get choiceValue(): any; get isCheckbox(): boolean; get isRadio(): boolean; get isFirstChoice(): boolean; set className(val: string); get className(): string; get cellQuestionWrapperClassName(): string; get isVisible(): boolean; get showResponsiveTitle(): boolean; get responsiveTitleCss(): string; get responsiveLocTitle(): LocalizableString; get headers(): string; getTitle(): string; calculateFinalClassName(matrixCssClasses: any): string; focusIn(): void; } export class QuestionMatrixDropdownRenderedRow extends Base { cssClasses: any; isDetailRow: boolean; isGhostRow: boolean; isAdditionalClasses: boolean; visible: boolean; onVisibilityChangedCallback: () => void; hasEndActions: boolean; row: MatrixDropdownRowModelBase; isErrorsRow: boolean; private static counter; private idValue; cells: Array; constructor(cssClasses: any, isDetailRow?: boolean); get id(): string; get attributes(): { "data-sv-drop-target-matrix-row"?: undefined; } | { "data-sv-drop-target-matrix-row": string; }; get className(): string; private rootElement; setRootElement(val: HTMLTableRowElement): void; getRootElement(): HTMLTableRowElement; focusCell(cellIndex: number): void; } export class QuestionMatrixDropdownRenderedErrorRow extends QuestionMatrixDropdownRenderedRow { isErrorsRow: boolean; constructor(cssClasses: any); get attributes(): {}; get className(): string; onAfterCreated(): void; } export class QuestionMatrixDropdownRenderedTable extends Base { matrix: QuestionMatrixDropdownModelBase; private headerRowValue; private footerRowValue; private hasRemoveRowsValue; private rowsActions; private cssClasses; rows: Array; protected getIsAnimationAllowed(): boolean; private getRenderedRowsAnimationOptions; private _renderedRows; updateRenderedRows(): void; private renderedRowsAnimation; get renderedRows(): Array; set renderedRows(val: Array); constructor(matrix: QuestionMatrixDropdownModelBase); get showTable(): boolean; get showHeader(): boolean; get showAddRow(): boolean; get showAddRowOnTop(): boolean; get showAddRowOnBottom(): boolean; get showFooter(): boolean; get hasFooter(): boolean; get hasRemoveRows(): boolean; private isRequireResetValue; isRequireReset(): boolean; requireReset(): void; get headerRow(): QuestionMatrixDropdownRenderedRow; get footerRow(): QuestionMatrixDropdownRenderedRow; get isRowsDragAndDrop(): boolean; private get showCellErrorsTop(); private get showCellErrorsBottom(); protected build(): void; updateShowTableAndAddRow(): void; onAddedRow(row: MatrixDropdownRowModelBase, index: number): void; private getRenderedRowIndexByIndex; private getRenderedDataRowCount; onRemovedRow(row: MatrixDropdownRowModelBase): void; onDetailPanelChangeVisibility(row: MatrixDropdownRowModelBase, isShowing: boolean): void; focusActionCell(row: MatrixDropdownRowModelBase, actionCellIndex: number): void; private getRenderedRowIndex; protected buildRowsActions(): void; protected createRenderedRow(cssClasses: any, isDetailRow?: boolean): QuestionMatrixDropdownRenderedRow; protected createErrorRenderedRow(cssClasses: any): QuestionMatrixDropdownRenderedErrorRow; protected buildHeader(): void; protected buildFooter(): void; protected buildRows(): void; private hasActionCellInRowsValues; private hasActionCellInRows; private hasActionsCellInLocaltion; private canRemoveRow; private buildHorizontalRows; private addHorizontalRow; private getRowDragCell; private getActionsCellClassName; private getRowActionsCell; private getRowActions; private buildRowActions; private get showRemoveButtonAsIcon(); protected setDefaultRowActions(row: MatrixDropdownRowModelBase, actions: Array): void; private createErrorRow; private createHorizontalRow; private addRowActionsCell; private createDetailPanelRow; private buildVerticalRows; private createMutlipleVerticalRows; private createVerticalRow; private createEndVerticalActionRow; private createMutlipleEditCells; private setItemCellCssClasses; private createEditCell; private createErrorCell; private createMutlipleColumnsFooter; private createMutlipleColumnsHeader; private getMultipleColumnChoices; private setHeaderCellCssClasses; private createHeaderCell; private setHeaderCell; private setCellWidth; private createTextCell; private createEmptyCell; } } declare module "packages/survey-core/src/utils/dragOrClickHelper" { export class DragOrClickHelper { private dragHandler; private pointerDownEvent; private currentTarget; private startX; private startY; private currentX; private currentY; private itemModel; constructor(dragHandler: any); onPointerDown(pointerDownEvent: any, itemModel?: any): void; private onPointerUp; private tryToStartDrag; private get isMicroMovement(); private clearListeners; } } declare module "packages/survey-core/src/question_matrixdynamic" { import { QuestionMatrixDropdownModelBase, MatrixDropdownRowModelBase, IMatrixDropdownData } from "packages/survey-core/src/question_matrixdropdownbase"; import { SurveyError } from "packages/survey-core/src/survey-error"; import { DragDropMatrixRows } from "packages/survey-core/src/dragdrop/matrix-rows"; import { IShortcutText, ISurveyImpl, IProgressInfo } from "packages/survey-core/src/base-interfaces"; import { QuestionMatrixDropdownRenderedTable } from "packages/survey-core/src/question_matrixdropdownrendered"; export class MatrixDynamicRowModel extends MatrixDropdownRowModelBase implements IShortcutText { index: number; private dragOrClickHelper; constructor(index: number, data: IMatrixDropdownData, value: any); protected getRowIndex(): number; get rowName(): string; get dataName(): string; get text(): any; getAccessbilityText(): string; get shortcutText(): string; } /** * A class that describes the Dynamic Matrix question type. * * Dynamic Matrix allows respondents to add and delete matrix rows. You can use the [Dropdown](https://surveyjs.io/form-library/documentation/questiondropdownmodel), [Checkbox](https://surveyjs.io/form-library/documentation/questioncheckboxmodel), [Radiogroup](https://surveyjs.io/form-library/documentation/questionradiogroupmodel), [Text](https://surveyjs.io/form-library/documentation/questiontextmodel), and [Comment](https://surveyjs.io/form-library/documentation/questioncommentmodel) question types as cell editors. * * [View Demo](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/ (linkStyle)) */ export class QuestionMatrixDynamicModel extends QuestionMatrixDropdownModelBase implements IMatrixDropdownData { onGetValueForNewRowCallBack: (sender: QuestionMatrixDynamicModel) => any; private rowCounter; private initialRowCount; private setRowCountValueFromData; constructor(name: string); dragDropMatrixRows: DragDropMatrixRows; setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void; private draggedRow; private isBanStartDrag; isDragHandleAreaValid(node: HTMLElement): boolean; onPointerDown(pointerDownEvent: PointerEvent, row: MatrixDropdownRowModelBase): void; startDragMatrixRow: (event: PointerEvent, currentTarget: HTMLElement) => void; getType(): string; get isRowsDynamic(): boolean; /** * Specifies whether to display a confirmation dialog when a respondent wants to delete a row. * * Default value: `false` * @see confirmDeleteText */ get confirmDelete(): boolean; set confirmDelete(val: boolean); get isValueArray(): boolean; /** * Specifies a key column. Set this property to a column name, and the question will display `keyDuplicationError` if a user tries to enter a duplicate value in this column. * @see keyDuplicationError */ get keyName(): string; set keyName(val: string); /** * If it is not empty, then this value is set to every new row, including rows created initially, unless the defaultValue is not empty * @see defaultValue * @see defaultValueFromLastRow */ get defaultRowValue(): any; set defaultRowValue(val: any); /** * Specifies whether default values for a new row/column should be copied from the last row/column. * * If you also specify `defaultValue`, it will be merged with the copied values. * @see defaultValue */ get defaultValueFromLastRow(): boolean; set defaultValueFromLastRow(val: boolean); protected isDefaultValueEmpty(): boolean; protected valueFromData(val: any): any; protected isNewValueCorrect(val: any): boolean; protected setDefaultValue(): void; moveRowByIndex(fromIndex: number, toIndex: number): void; clearOnDrop(): void; initDataUI(): void; /** * The number of rows in the matrix. * @see minRowCount * @see maxRowCount */ get rowCount(): number; set rowCount(val: number); protected updateBindingProp(propName: string, value: any): void; protected updateProgressInfoByValues(res: IProgressInfo): void; private getValueForNewRow; /** * Specifies whether users can drag and drop matrix rows to reorder them. Applies only if [`transposeData`](#transposeData) is `false`. * * Default value: `false` */ get allowRowsDragAndDrop(): boolean; set allowRowsDragAndDrop(val: boolean); get isRowsDragAndDrop(): boolean; get lockedRowCount(): number; set lockedRowCount(val: number); get iconDragElement(): string; protected createRenderedTable(): QuestionMatrixDropdownRenderedTable; private get rowCountValue(); private set rowCountValue(value); /** * A minimum number of rows in the matrix. Users cannot delete rows if `rowCount` equals `minRowCount`. * * Default value: 0 * @see rowCount * @see maxRowCount * @see allowRemoveRows */ get minRowCount(): number; set minRowCount(val: number); private onMinRowCountChanged; /** * A maximum number of rows in the matrix. Users cannot add new rows if `rowCount` equals `maxRowCount`. * * Default value: 1000 (inherited from [`settings.matrix.maxRowCount`](https://surveyjs.io/form-library/documentation/settings#matrixMaximumRowCount)) * @see rowCount * @see minRowCount * @see allowAddRows */ get maxRowCount(): number; set maxRowCount(val: number); private onMaxRowCountChanged; /** * Specifies whether users are allowed to add new rows. * * Default value: `true` * @see canAddRow * @see allowRemoveRows */ get allowAddRows(): boolean; set allowAddRows(val: boolean); /** * Specifies whether users are allowed to delete rows. * * Default value: `true` * @see canRemoveRows * @see allowAddRows */ get allowRemoveRows(): boolean; set allowRemoveRows(val: boolean); /** * Indicates whether it is possible to add a new row. * * This property returns `true` when all of the following conditions apply: * * - Users are allowed to add new rows (`allowAddRows` is `true`). * - The question, its parent panel, or survey is not in read-only state. * - `rowCount` is less than `maxRowCount`. * @see allowAddRows * @see isReadOnly * @see rowCount * @see maxRowCount * @see canRemoveRows */ get canAddRow(): boolean; canRemoveRowsCallback: (allow: boolean) => boolean; /** * Indicates whether it is possible to delete rows. * * This property returns `true` when all of the following conditions apply: * * - Users are allowed to delete rows (`allowRemoveRows` is `true`). * - The question, its parent panel, or survey is not in read-only state. * - `rowCount` exceeds `minRowCount`. * @see allowRemoveRows * @see isReadOnly * @see rowCount * @see minRowCount * @see canAddRow */ get canRemoveRows(): boolean; canRemoveRow(row: MatrixDropdownRowModelBase): boolean; addRowUI(): void; private getQuestionToFocusOnAddingRow; /** * Creates and adds a new row to the matrix. * @param setFocus *(Optional)* Pass `true` to focus the cell in the first column. */ addRow(setFocus?: boolean): void; /** * Specifies whether to expand the detail section immediately when a respondent adds a new row. * @see detailPanelMode */ get detailPanelShowOnAdding(): boolean; set detailPanelShowOnAdding(val: boolean); protected hasRowsAsItems(): boolean; unbindValue(): void; protected isValueSurveyElement(val: any): boolean; private addRowCore; private getDefaultRowValue; focusAddBUtton(): void; getActionCellIndex(row: MatrixDropdownRowModelBase): number; removeRowUI(value: any): void; isRequireConfirmOnRowDelete(index: number): boolean; /** * Removes a matrix row with a specified index. * @param index A zero-based row index. * @param confirmDelete *(Optional)* A Boolean value that specifies whether to display a confirmation dialog. If you do not specify this parameter, the [`confirmDelete`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-matrix-table-question-model#confirmDelete) property value is used. */ removeRow(index: number, confirmDelete?: boolean, onRowRemoved?: () => void): void; private removeRowAsync; private removeRowCore; /** * A message displayed in a confirmation dialog that appears when a respondent wants to delete a row. * @see confirmDelete */ get confirmDeleteText(): string; set confirmDeleteText(val: string); get locConfirmDeleteText(): import("src/entries/core-wo-model").LocalizableString; /** * A caption for the Add Row button. * @see addRowLocation */ get addRowText(): string; set addRowText(val: string); get locAddRowText(): import("src/entries/core-wo-model").LocalizableString; private get defaultAddRowText(); /** * Specifies the location of the Add Row button. * * Possible values: * * - `"top"` - Displays the Add Row button at the top of the matrix. * - `"bottom"` - Displays the Add Row button at the bottom of the matrix. * - `"topBottom"` - Displays the Add Row button at the top and bottom of the matrix. * * Default value: `"top"` if [`transposeData`](#transposeData) is `true`; `"bottom"` if `transposeData` is `false` or the matrix is in compact mode. * @see addRowText */ get addRowLocation(): string; set addRowLocation(val: string); getAddRowLocation(): string; /** * Specifies whether to hide columns when the matrix does not contain any rows. If you enable this property, the matrix displays the `emptyRowsText` message and the Add Row button. * * Default value: `false` * @see emptyRowsText */ get hideColumnsIfEmpty(): boolean; set hideColumnsIfEmpty(val: boolean); getShowColumnsIfEmpty(): boolean; /** * Use this property to change the default value of remove row button text. */ get removeRowText(): string; set removeRowText(val: string); get locRemoveRowText(): import("src/entries/core-wo-model").LocalizableString; /** * A message displayed when the matrix does not contain any rows. Applies only if `hideColumnsIfEmpty` is enabled. * @see hideColumnsIfEmpty */ get emptyRowsText(): string; set emptyRowsText(val: string); get locEmptyRowsText(): import("src/entries/core-wo-model").LocalizableString; protected getDisplayValueCore(keysAsText: boolean, value: any): any; protected getConditionObjectRowName(index: number): string; protected getConditionObjectsRowIndeces(): Array; supportGoNextPageAutomatic(): boolean; get hasRowText(): boolean; protected onCheckForErrors(errors: Array, isOnValueChanged: boolean, fireCallback: boolean): void; private hasErrorInMinRows; protected getUniqueColumnsNames(): Array; protected generateRows(): Array; protected createMatrixRow(value: any): MatrixDynamicRowModel; private lastDeletedRow; private getInsertedDeletedIndex; private isEditingObjectValueChanged; updateValueFromSurvey(newValue: any, clearData?: boolean): void; protected getFilteredDataCore(): any; protected onBeforeValueChanged(val: any): void; protected createNewValue(): any; protected deleteRowValue(newValue: any, row: MatrixDropdownRowModelBase): any; private getRowValueByIndex; protected getRowValueCore(row: MatrixDropdownRowModelBase, questionValue: any, create?: boolean): any; getAddRowButtonCss(isEmptySection?: boolean): string; getRemoveRowButtonCss(): string; getRootCss(): string; } } declare module "packages/survey-core/src/themes" { import { HorizontalAlignment, VerticalAlignment } from "packages/survey-core/src/base-interfaces"; export type ImageFit = "auto" | "contain" | "cover"; export type ImageAttachment = "fixed" | "scroll"; /** * A theme configuration interface. * * `ITheme` objects are used to apply predefined themes or create custom themes. Refer to the following help topic for more information: * * [Themes & Styles](https://surveyjs.io/form-library/documentation/manage-default-themes-and-styles (linkStyle)) */ export interface ITheme { /** * A theme name. */ themeName?: string; /** * A color palette. * * Possible values: * * - `"light"` * - `"dark"` */ colorPalette?: string; /** * A Boolean value that specifies whether survey questions are displayed within panels (`false`) or without them (`true`). */ isPanelless?: boolean; /** * An image to display as survey background. This property accepts a hyperlink or a data URL. */ backgroundImage?: string; /** * A string value that specifies how to resize the [background image](#backgroundImage) to fit it into its container. * * Possible values: * * - `"auto"` * - `"contain"` * - `"cover"` * * Refer to the description of the [`background-size`](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size#values) CSS property values on MDN for detailed information on the possible values. */ backgroundImageFit?: ImageFit; /** * A string value that specifies whether the [background image](#backgroundImage) is fixed in its position or scrolled along with the survey. * * Possible values: * * - `"fixed"` * - `"scroll"` */ backgroundImageAttachment?: ImageAttachment; /** * A value from 0 to 1 that specifies how transparent the [background image](#backgroundImage) should be: 0 makes the image completely transparent, and 1 makes it opaque. */ backgroundOpacity?: number; /** * An object with [advanced survey header settings](https://surveyjs.io/form-library/documentation/api-reference/iheader). Applies when the [`headerView`](https://surveyjs.io/form-library/documentation/api-reference/itheme#headerView) property is set to `"advanced"`. */ header?: IHeader; /** * Specifies whether the survey header uses only basic appearance settings or applies advanced settings from the survey theme. * * Possible values: * * - `"basic"` (default)\ * A basic header view applies only the [`title`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#title), [`description`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#description), and logo-related properties ([`logo`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#logo), [`logoPosition`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#logoPosition), etc.). * * - `"advanced"`\ * An advanced header view applies the same properties as the basic view, plus [header settings](https://surveyjs.io/form-library/documentation/api-reference/iheader) from the [survey theme](https://surveyjs.io/form-library/documentation/api-reference/itheme#header). The advanced view features a more flexible header layout, a capability to specify a background image, and other settings that give a more professional look to the survey header. * * [View Demo](https://surveyjs.io/form-library/examples/brand-your-survey-header/ (linkStyle)) */ headerView?: "advanced" | "basic"; /** * An object with CSS variables. */ cssVariables?: { [index: string]: string; }; } /** * A survey header configuration interface. * * An `IHeader` object configures advanced survey header appearance settings. To apply them, you need to assign the object to the [`header`](https://surveyjs.io/form-library/documentation/api-reference/itheme#header) property of your theme configuration and set the [`headerView`](https://surveyjs.io/form-library/documentation/api-reference/itheme#headerView) property to `"advanced"`. */ export interface IHeader { /** * The height of the survey header in pixels. * * Default value: 256 */ height?: number; /** * The height of the survey header on smartphones, measured in pixels. * * Default value: 0 (the height is calculated automatically to accommodate the header's content). */ mobileHeight?: number; /** * A string value that specifies whether the header spans the width of the survey or that of the survey container. * * Possible values: * * - `"survey"`\ * The header width is the same as the survey width. * - `"container"` (default)\ * The header width is the same as the survey container width. * * @see [SurveyModel.width](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#width) * @see [SurveyModel.widthMode](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#widthMode) */ inheritWidthFrom?: "survey" | "container"; /** * The width of the header area that contains the survey [title](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#title) and [description](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#description), measured in pixels. * * Default value: 512 */ textAreaWidth?: number; /** * A Boolean value that specifies whether the header overlaps the survey content. * * Default value: `false` */ overlapEnabled?: boolean; /** * An image to display in the background of the header. Accepts a base64 or URL string value. */ backgroundImage?: string; /** * A value from 0 to 1 that specifies how transparent the [background image](#backgroundImage) should be: 0 makes the image completely transparent, and 1 makes it opaque. */ backgroundImageOpacity?: number; /** * A string value that specifies how to resize a [background image](#backgroundImage) to fit it into the header. * * Possible values: * * - `"cover"` (default)\ * Scales the image to the smallest possible size that fills the header. The image preserves its aspect ratio but can be cropped if the header's proportions differ from that of the element. * - `"fill"`\ * Stretches the image to fill the entire header. * - `"contain"`\ * Scales the image to the largest possible size without cropping or stretching it. * - `"tile"`\ * Tiles as many copies of the image as needed to fill the entire header. */ backgroundImageFit?: "cover" | "fill" | "contain" | "tile"; /** * A string value that specifies the logo position within the header in the horizontal direction. * * Possible values: * * - `"right"` (default) * - `"left"` * - `"center"` * * To specify a logo, set `SurveyModel`'s [`logo`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#logo) property. */ logoPositionX?: HorizontalAlignment; /** * A string value that specifies the logo position within the header in the vertical direction. * * Possible values: * * - `"top"` (default) * - `"bottom"` * - `"middle"` * * To specify a logo, set `SurveyModel`'s [`logo`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#logo) property. */ logoPositionY?: VerticalAlignment; /** * A string value that specifies the survey title position within the header in the horizontal direction. * * Possible values: * * - `"left"` (default) * - `"right"` * - `"center"` * * To specify a survey title, set `SurveyModel`'s [`title`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#title) property. */ titlePositionX?: HorizontalAlignment; /** * A string value that specifies the survey title position within the header in the vertical direction. * * Possible values: * * - `"bottom"` (default) * - `"top"` * - `"middle"` * * To specify a survey title, set `SurveyModel`'s [`title`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#title) property. */ titlePositionY?: VerticalAlignment; /** * A string value that specifies the survey description position within the header in the horizontal direction. * * Possible values: * * - `"left"` (default) * - `"right"` * - `"center"` * * To specify a survey description, set `SurveyModel`'s [`description`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#description) property. */ descriptionPositionX?: HorizontalAlignment; /** * A string value that specifies the survey description position within the header in the vertical direction. * * Possible values: * * - `"bottom"` (default) * - `"top"` * - `"middle"` * * To specify a survey description, set `SurveyModel`'s [`description`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#description) property. */ descriptionPositionY?: VerticalAlignment; } } declare module "packages/survey-core/src/question_paneldynamic" { import { HashTable } from "packages/survey-core/src/helpers"; import { IElement, IQuestion, IPanel, ISurveyData, ISurvey, ISurveyImpl, ITextProcessor, IProgressInfo, IPlainDataOptions } from "packages/survey-core/src/base-interfaces"; import { LocalizableString } from "packages/survey-core/src/localizablestring"; import { Base } from "packages/survey-core/src/base"; import { Question, IConditionObject, IQuestionPlainData } from "packages/survey-core/src/question"; import { PanelModel } from "packages/survey-core/src/panel"; import { SurveyError } from "packages/survey-core/src/survey-error"; import { ActionContainer } from "packages/survey-core/src/actions/container"; import { Action, IAction } from "packages/survey-core/src/actions/action"; import { AdaptiveActionContainer } from "packages/survey-core/src/actions/adaptive-container"; import { ITheme } from "packages/survey-core/src/themes"; import { AnimationProperty, IAnimationGroupConsumer } from "packages/survey-core/src/utils/animation"; export interface IQuestionPanelDynamicData { getItemIndex(item: ISurveyData): number; getVisibleItemIndex(item: ISurveyData): number; getPanelItemData(item: ISurveyData): any; setPanelItemData(item: ISurveyData, name: string, val: any): any; getSharedQuestionFromArray(name: string, panelIndex: number): Question; getSurvey(): ISurvey; getRootData(): ISurveyData; } interface IPanelDynamicTabbedMenuItem extends IAction { panelId: string; } class PanelDynamicTabbedMenuItem extends Action { panelId: string; constructor(innerItem: IPanelDynamicTabbedMenuItem); } export class QuestionPanelDynamicItem implements ISurveyData, ISurveyImpl { static ItemVariableName: string; static ParentItemVariableName: string; static IndexVariableName: string; static VisibleIndexVariableName: string; private panelValue; private data; private textPreProcessor; constructor(data: IQuestionPanelDynamicData, panel: PanelModel); get panel(): PanelModel; setSurveyImpl(): void; getValue(name: string): any; setValue(name: string, newValue: any): void; getVariable(name: string): any; setVariable(name: string, newValue: any): void; getComment(name: string): string; setComment(name: string, newValue: string, locNotification: any): void; findQuestionByName(name: string): IQuestion; getEditingSurveyElement(): Base; getAllValues(): any; getFilteredValues(): any; getFilteredProperties(): any; getSurveyData(): ISurveyData; getSurvey(): ISurvey; getTextProcessor(): ITextProcessor; } export class QuestionPanelDynamicTemplateSurveyImpl implements ISurveyImpl { data: IQuestionPanelDynamicData; constructor(data: IQuestionPanelDynamicData); getSurveyData(): ISurveyData; getSurvey(): ISurvey; getTextProcessor(): ITextProcessor; } /** * A class that describes the Dynamic Panel question type. * * Dynamic Panel allows respondents to add panels based on a panel template and delete them. Specify the [`templateElements`](https://surveyjs.io/form-library/documentation/questionpaneldynamicmodel#templateElements) property to configure panel template elements. * * [View Demo](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/ (linkStyle)) */ export class QuestionPanelDynamicModel extends Question implements IQuestionPanelDynamicData { private templateValue; private isValueChangingInternally; private changingValueQuestion; renderModeChangedCallback: () => void; panelCountChangedCallback: () => void; currentIndexChangedCallback: () => void; constructor(name: string); get isCompositeQuestion(): boolean; get hasSingleInput(): boolean; get isContainer(): boolean; getFirstQuestionToFocus(withError: boolean): Question; protected getFirstInputElementId(): string; setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void; private assignOnPropertyChangedToTemplate; private addOnPropertyChangedCallback; private onTemplateElementPropertyChanged; private get useTemplatePanel(); getType(): string; clearOnDeletingContainer(): void; get isAllowTitleLeft(): boolean; removeElement(element: IElement): boolean; /** * A `PanelModel` object used as a template to create dynamic panels. * @see PanelModel * @see templateElements * @see templateTitle * @see panels * @see panelCount */ get template(): PanelModel; getPanel(): IPanel; /** * An array of questions and panels included in a panel template. * @see template * @see panels * @see panelCount */ get templateElements(): Array; /** * A template for panel titles. * * The template can contain the following placeholders: * * - `{panelIndex}` - A panel index within the collection of all panels. Starts with 1. * - `{visiblePanelIndex}` - A panel index within the collection of visible panels. Starts with 1. * @see template * @see templateDescription * @see templateElements * @see panels * @see panelCount */ get templateTitle(): string; set templateTitle(newValue: string); get locTemplateTitle(): LocalizableString; /** * A template for tab titles. Applies when [`displayMode`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#displayMode) is `"tab"`. * * The template can contain the following placeholders: * * - `{panelIndex}` - A panel index within the collection of all panels. Starts with 1. * - `{visiblePanelIndex}` - A panel index within the collection of visible panels. Starts with 1. * * If you want to customize individual tab titles, handle `SurveyModel`'s [`onGetDynamicPanelTabTitle`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onGetDynamicPanelTabTitle) event. * * [View Demo](https://surveyjs.io/form-library/examples/tabbed-interface-for-duplicate-group-option/ (linkStyle)) * @see templateTitle * @see tabTitlePlaceholder * @see displayMode */ get templateTabTitle(): string; set templateTabTitle(newValue: string); get locTemplateTabTitle(): LocalizableString; /** * A placeholder for tab titles that applies when the [`templateTabTitle`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#templateTabTitle) expression doesn't produce a meaningful value. * * Default value: `"New Panel"` (taken from a [localization dictionary](https://github.com/surveyjs/survey-library/tree/01bd8abd0c574719956d4d579d48c8010cd389d4/packages/survey-core/src/localization)) */ get tabTitlePlaceholder(): string; set tabTitlePlaceholder(newValue: string); get locTabTitlePlaceholder(): LocalizableString; /** * A template for panel descriptions. * @see template * @see templateTitle * @see templateElements * @see panels * @see panelCount */ get templateDescription(): string; set templateDescription(newValue: string); get locTemplateDescription(): LocalizableString; /** * A Boolean expression that is evaluated against each panel. If the expression evaluates to `false`, the panel becomes hidden. * * A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it. * * Use the `{panel}` placeholder to reference the current panel in the expression. * * Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#conditional-visibility). * @see visibleIf * @see visiblePanels */ get templateVisibleIf(): string; set templateVisibleIf(val: string); protected get items(): Array; /** * An array of `PanelModel` objects created based on a panel template. * @see PanelModel * @see template * @see panelCount */ get panels(): Array; /** * An array of currently visible panels ([`PanelModel`](https://surveyjs.io/form-library/documentation/api-reference/panel-model) objects). * @see templateVisibleIf */ get visiblePanels(): Array; protected get panelsCore(): Array; protected get visiblePanelsCore(): Array; private onPanelAdded; private onPanelRemoved; private onPanelRemovedCore; /** * A zero-based index of the currently displayed panel. * * When `displayMode` is `"list"` or Dynamic Panel is empty (`panelCount` is 0), this property contains -1. * @see currentPanel * @see panels * @see panelCount * @see displayMode */ get currentIndex(): number; set currentIndex(val: number); /** * A `PanelModel` object that is the currently displayed panel. * * When `displayMode` is `"list"` or Dynamic Panel is empty (`panelCount` is 0), this property contains `null`. * @see currentIndex * @see panels * @see panelCount * @see displayMode */ get currentPanel(): PanelModel; set currentPanel(val: PanelModel); private _renderedPanels; private updateRenderedPanels; set renderedPanels(val: Array); get renderedPanels(): Array; private isPanelsAnimationRunning; private getPanelsAnimationOptions; private _panelsAnimations; private disablePanelsAnimations; private enablePanelsAnimations; private updatePanelsAnimation; get panelsAnimation(): AnimationProperty, IAnimationGroupConsumer>; onHidingContent(): void; /** * Specifies whether to display a confirmation dialog when a respondent wants to delete a panel. * @see confirmDeleteText */ get confirmDelete(): boolean; set confirmDelete(val: boolean); /** * Specifies a key question. Set this property to the name of a question used in the template, and Dynamic Panel will display `keyDuplicationError` if a user tries to enter a duplicate value in this question. * @see keyDuplicationError */ get keyName(): string; set keyName(val: string); /** * A message displayed in a confirmation dialog that appears when a respondent wants to delete a panel. * @see confirmDelete */ get confirmDeleteText(): string; set confirmDeleteText(val: string); get locConfirmDeleteText(): LocalizableString; /** * An error message displayed when users enter a duplicate value into a question that accepts only unique values (`isUnique` is set to `true` or `keyName` is specified). * * A default value for this property is taken from a [localization dictionary](https://github.com/surveyjs/survey-library/tree/01bd8abd0c574719956d4d579d48c8010cd389d4/packages/survey-core/src/localization). Refer to the following help topic for more information: [Localization & Globalization](https://surveyjs.io/form-library/documentation/localization). * @see keyName */ get keyDuplicationError(): string; set keyDuplicationError(val: string); get locKeyDuplicationError(): LocalizableString; /** * A caption for the Previous button. Applies only if `displayMode` is different from `"list"`. * @see displayMode * @see isPrevButtonVisible */ get panelPrevText(): string; set panelPrevText(val: string); get locPanelPrevText(): LocalizableString; /** * A caption for the Next button. Applies only if `displayMode` is different from `"list"`. * @see displayMode * @see isNextButtonVisible */ get panelNextText(): string; set panelNextText(val: string); get locPanelNextText(): LocalizableString; /** * A caption for the Add Panel button. */ get panelAddText(): string; set panelAddText(value: string); get locPanelAddText(): LocalizableString; /** * A caption for the Delete Panel button. * @see panelRemoveButtonLocation */ get panelRemoveText(): string; set panelRemoveText(val: string); get locPanelRemoveText(): LocalizableString; get isProgressTopShowing(): boolean; get isProgressBottomShowing(): boolean; /** * Indicates whether the Previous button is visible. * @see currentIndex * @see currentPanel * @see panelPrevText */ get isPrevButtonVisible(): boolean; get isPrevButtonShowing(): boolean; /** * Indicates whether the Next button is visible. * @see currentIndex * @see currentPanel * @see panelNextText */ get isNextButtonVisible(): boolean; get isNextButtonShowing(): boolean; get isRangeShowing(): boolean; getElementsInDesign(includeHidden?: boolean): Array; private isAddingNewPanels; private addingNewPanelsValue; private isNewPanelsValueChanged; private prepareValueForPanelCreating; private setValueAfterPanelsCreating; protected getValueCore(): any; protected setValueCore(newValue: any): void; setIsMobile(val: boolean): void; themeChanged(theme: ITheme): void; /** * The number of panels in Dynamic Panel. * @see minPanelCount * @see maxPanelCount */ get panelCount(): number; set panelCount(val: number); /** * Returns the number of visible panels in Dynamic Panel. * @see templateVisibleIf */ get visiblePanelCount(): number; /** * Specifies whether users can expand and collapse panels. Applies if `displayMode` is `"list"` and the `templateTitle` property is specified. * * Possible values: * * - `"default"` (default) - All panels are displayed in full and cannot be collapsed. * - `"expanded"` - All panels are displayed in full and can be collapsed in the UI. * - `"collapsed"` - All panels display only their titles and descriptions and can be expanded in the UI. * - `"firstExpanded"` - Only the first panel is displayed in full; other panels are collapsed and can be expanded in the UI. * @see displayMode * @see templateTitle */ get panelsState(): string; set panelsState(val: string); private setTemplatePanelSurveyImpl; private setPanelsSurveyImpl; private setPanelsState; private setValueBasedOnPanelCount; /** * A minimum number of panels in Dynamic Panel. Users cannot delete panels if `panelCount` equals `minPanelCount`. * * Default value: 0 * @see panelCount * @see maxPanelCount * @see allowRemovePanel */ get minPanelCount(): number; set minPanelCount(val: number); private onMinPanelCountChanged; /** * A maximum number of panels in Dynamic Panel. Users cannot add new panels if `panelCount` equals `maxPanelCount`. * * Default value: 100 (inherited from [`settings.panel.maxPanelCount`](https://surveyjs.io/form-library/documentation/settings#panelMaximumPanelCount)) * @see panelCount * @see minPanelCount * @see allowAddPanel */ get maxPanelCount(): number; set maxPanelCount(val: number); private onMaxPanelCountChanged; /** * Specifies whether users are allowed to add new panels. * * Default value: `true` * * By default, users add new panels to the end. If you want to let users insert a new panel after the current panel, set the [`newPanelPosition`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#newPanelPosition) property to `"next"`. * @see canAddPanel * @see allowRemovePanel */ get allowAddPanel(): boolean; set allowAddPanel(val: boolean); get addButtonId(): string; /** * Specifies the position of newly added panels. * * Possible values: * * - `"last"` (default) - New panels are added to the end. * - `"next"` - New panels are inserted after the current panel. * @see allowAddPanel * @see addPanel */ get newPanelPosition(): string; set newPanelPosition(val: string); /** * Specifies whether users are allowed to delete panels. * * Default value: `true` * @see canRemovePanel * @see allowAddPanel */ get allowRemovePanel(): boolean; set allowRemovePanel(val: boolean); /** * Gets or sets the location of question titles relative to their input fields. * * - `"default"` (default) - Inherits the setting from the Dynamic Panel's `titleLocation` property, which in turn inherits the [`questionTitleLocation`](https://surveyjs.io/form-library/documentation/surveymodel#questionTitleLocation) property value specified for the Dynamic Panel's container (page or survey). * - `"top"` - Displays question titles above input fields. * - `"bottom"` - Displays question titles below input fields. * - `"left"` - Displays question titles to the left of input fields. * - `"hidden"` - Hides question titles. * @see titleLocation */ get templateTitleLocation(): string; set templateTitleLocation(value: string); /** * Specifies the error message position. * * Possible values: * * - `"default"` (default) - Inherits the setting from the [`errorLocation`](#errorLocation) property. * - `"top"` - Displays error messages above questions. * - `"bottom"` - Displays error messages below questions. */ get templateErrorLocation(): string; set templateErrorLocation(value: string); /** * Use this property to show/hide the numbers in titles in questions inside a dynamic panel. * By default the value is "off". You may set it to "onPanel" and the first question inside a dynamic panel will start with 1 or "onSurvey" to include nested questions in dymamic panels into global survey question numbering. */ get showQuestionNumbers(): string; set showQuestionNumbers(val: string); protected notifySurveyOnChildrenVisibilityChanged(): boolean; /** * Specifies the location of the Delete Panel button relative to panel content. * * Possible values: * * - `"bottom"` (default) - Displays the Delete Panel button below panel content. * - `"right"` - Displays the Delete Panel button to the right of panel content. * @see panelRemoveText */ get panelRemoveButtonLocation(): string; set panelRemoveButtonLocation(val: string); /** * Obsolete. Use the [`showProgressBar`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#showProgressBar) property instead. * @deprecated */ get showRangeInProgress(): boolean; set showRangeInProgress(val: boolean); /** * Obsolete. Use the [`displayMode`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#displayMode) property instead. * @deprecated */ get renderMode(): string; set renderMode(val: string); private updatePanelView; /** * Specifies how to display panels. * * Possible values: * * - `"list"` (default) - Displays panels one under the other. [View Demo](https://surveyjs.io/form-library/examples/duplicate-group-of-fields-in-form/) * - `"carousel"` - Displays panels in a carousel. Users can switch between panels using navigation buttons. * - `"tab"` - Displays each panel within a tab. Use the [`templateTabTitle`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#templateTabTitle) to specify a template for tab titles. [View Demo](https://surveyjs.io/form-library/examples/tabbed-interface-for-duplicate-group-option/) * @see showProgressBar * @see progressBarLocation */ displayMode: "list" | "carousel" | "tab"; /** * Specifies whether to display the progress bar. Applies only if [`displayMode`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#displayMode) is `"carousel"`. * * Default value: `true` * @see progressBarLocation */ showProgressBar: true | false; /** * Specifies the alignment of the [progress bar](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#showProgressBar) relative to the currently displayed panel. Applies only if [`displayMode`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#displayMode) is `"carousel"`. * * Possible values: * * - `"top"` (default) - Displays the progress bar at the top of the current panel. * - `"bottom"` - Displays the progress bar at the bottom of the current panel. * - `"topBottom"` - Displays the progress bar at the top and bottom of the current panel. */ progressBarLocation: "top" | "bottom" | "topBottom"; get tabAlign(): "center" | "left" | "right"; set tabAlign(val: "center" | "left" | "right"); get isRenderModeList(): boolean; get isRenderModeTab(): boolean; setVisibleIndex(value: number): number; private setPanelVisibleIndex; /** * Indicates whether it is possible to add a new panel. * * This property returns `true` when all of the following conditions apply: * * - Users are allowed to add new panels (`allowAddPanel` is `true`). * - Dynamic Panel or its parent survey is not in read-only state. * - `panelCount` is less than `maxPanelCount`. * @see allowAddPanel * @see isReadOnly * @see panelCount * @see maxPanelCount * @see canRemovePanel */ get canAddPanel(): boolean; /** * Indicates whether it is possible to delete panels. * * This property returns `true` when all of the following conditions apply: * * - Users are allowed to delete panels (`allowRemovePanel` is `true`). * - Dynamic Panel or its parent survey is not in read-only state. * - `panelCount` exceeds `minPanelCount`. * @see allowRemovePanel * @see isReadOnly * @see panelCount * @see minPanelCount * @see canAddPanel */ get canRemovePanel(): boolean; protected rebuildPanels(): void; /** * If it is not empty, then this value is set to every new panel, including panels created initially, unless the defaultValue is not empty * @see defaultValue * @see defaultValueFromLastPanel */ get defaultPanelValue(): any; set defaultPanelValue(val: any); /** * Specifies whether default values for a new panel should be copied from the last panel. * * If you also specify `defaultValue`, it will be merged with the copied values. * @see defaultValue */ get defaultValueFromLastPanel(): boolean; set defaultValueFromLastPanel(val: boolean); protected isDefaultValueEmpty(): boolean; protected setDefaultValue(): void; get isValueArray(): boolean; isEmpty(): boolean; getProgressInfo(): IProgressInfo; private isRowEmpty; /** * Adds a new panel based on the [template](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#template). * * Unlike the [`addPanel()`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#addPanel) method, `addPanelUI()` performs additional actions: checks whether a new panel [can be added](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#canAddPanel), expands and focuses the new panel, and runs animated effects. * @see panelCount * @see panels */ addPanelUI(): PanelModel; private focusNewPanelCallback; private focusNewPanel; /** * Adds a new panel based on the [template](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#template). * @param index *(Optional)* An index at which to insert the new panel. `undefined` adds the panel to the end or inserts it after the current panel if [`displayMode`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#renderMode) is `"tab"`. A negative index (for instance, -1) adds the panel to the end in all cases, regardless of the `displayMode` value. * @see panelCount * @see panels * @see allowAddPanel * @see newPanelPosition */ addPanel(index?: number): PanelModel; private updateValueOnAddingPanel; private canLeaveCurrentPanel; private copyValue; /** * Deletes a panel from the [`panels`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#panels) array. * * Unlike the [`removePanel()`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#removePanel) method, `removePanelUI()` performs additional actions: checks whether the panel [can be removed](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#canRemovePanel) and displays a confirmation dialog (if the [`confirmDelete`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#confirmDelete) property is enabled). * @param value A `PanelModel` instance or zero-based panel index. * @see addPanelUI */ removePanelUI(value: any): void; getPanelRemoveButtonId(panel: PanelModel): string; isRequireConfirmOnDelete(val: any): boolean; /** * Switches Dynamic Panel to the next panel. Returns `true` in case of success, or `false` if `displayMode` is `"list"` or the current panel contains validation errors. * @see displayMode */ goToNextPanel(): boolean; /** * Switches Dynamic Panel to the previous panel. */ goToPrevPanel(): void; private removedPanelIndex; /** * Deletes a panel from the [`panels`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#panels) array. * @param value A `PanelModel` instance or zero-based panel index. * @see addPanel */ removePanel(value: any): void; private notifyOnPanelAddedRemoved; private getVisualPanelIndex; private getPanelVisibleIndexById; locStrsChanged(): void; clearIncorrectValues(): void; clearErrors(): void; getQuestionFromArray(name: string, index: number): IQuestion; private clearIncorrectValuesInPanel; private iscorrectValueWithPostPrefix; getSharedQuestionFromArray(name: string, panelIndex: number): Question; addConditionObjectsByContext(objects: Array, context: any): void; protected collectNestedQuestionsCore(questions: Question[], visibleOnly: boolean, includeItSelf: boolean): void; getConditionJson(operator?: string, path?: string): any; protected onReadOnlyChanged(): void; private updateNoEntriesTextDefaultLoc; onSurveyLoad(): void; private hasPanelBuildFirstTime; private isBuildingPanelsFirstTime; private buildPanelsFirstTime; private runTriggersOnBuildPanelsFirstTime; private get showAddPanelButton(); private get wasNotRenderedInSurvey(); private get canBuildPanels(); protected onFirstRenderingCore(): void; localeChanged(): void; runCondition(values: HashTable, properties: HashTable): void; runTriggers(name: string, value: any, keys?: any): void; private reRunCondition; protected runPanelsCondition(panels: PanelModel[], values: HashTable, properties: HashTable): void; private isValueChangedWithoutPanels; onAnyValueChanged(name: string, questionName: string): void; private hasKeysDuplicated; private updatePanelsContainsErrors; hasErrors(fireCallback?: boolean, rec?: any): boolean; protected getContainsErrors(): boolean; protected getIsAnswered(): boolean; protected clearValueOnHidding(isClearOnHidden: boolean): void; clearValueIfInvisible(reason?: string): void; private clearValueInPanelsIfInvisible; protected getIsRunningValidators(): boolean; getAllErrors(): Array; protected getDisplayValueCore(keysAsText: boolean, value: any): any; private getPanelDisplayValue; private hasErrorInPanels; private setOnCompleteAsyncInPanel; private isValueDuplicated; getPanelActions(panel: PanelModel): Array; protected createNewPanel(): PanelModel; protected createAndSetupNewPanelObject(): PanelModel; private getTemplateQuestionTitleLocation; getChildErrorLocation(child: Question): string; protected createNewPanelObject(): PanelModel; private settingPanelCountBasedOnValue; private setPanelCountBasedOnValue; setQuestionValue(newValue: any): void; onSurveyValueChanged(newValue: any): void; private isAllPanelsEmpty; private panelUpdateValueFromSurvey; private panelSurveyValueChanged; protected onSetData(): void; protected isNewValueCorrect(val: any): boolean; getItemIndex(item: ISurveyData): number; getVisibleItemIndex(item: ISurveyData): number; getPanelItemData(item: ISurveyData): any; private isSetPanelItemData; private static maxCheckCount; setPanelItemData(item: ISurveyData, name: string, val: any): void; getRootData(): ISurveyData; getPlainData(options?: IPlainDataOptions): IQuestionPlainData; updateElementCss(reNew?: boolean): void; get progressText(): string; get progress(): string; getRootCss(): string; get cssHeader(): string; getTabsContainerCss(): string; getPanelWrapperCss(panel: PanelModel): string; getPanelRemoveButtonCss(): string; getAddButtonCss(): string; getPrevButtonCss(): string; getNextButtonCss(): string; /** * A text displayed when Dynamic Panel contains no entries. */ get noEntriesText(): string; set noEntriesText(val: string); get locNoEntriesText(): LocalizableString; getShowNoEntriesPlaceholder(): boolean; needResponsiveWidth(): boolean; private tabbedMenuValue; get hasTabbedMenu(): boolean; get tabbedMenu(): AdaptiveActionContainer | null; private footerToolbarValue; get footerToolbar(): ActionContainer; legacyNavigation: boolean; private updateFooterActionsCallback; private updateFooterActions; private initFooterToolbar; private createTabByPanel; private getTabbedMenuCss; private updateTabToolbarItemsPressedState; private updateTabToolbar; private addTabFromToolbar; private removeTabFromToolbar; get showLegacyNavigation(): boolean; get showNavigation(): boolean; showSeparator(index: number): boolean; protected calcCssClasses(css: any): any; protected onMobileChanged(): void; } } declare module "packages/survey-core/src/question_signaturepad" { import { ITheme } from "packages/survey-core/src/themes"; import { QuestionFileModelBase } from "packages/survey-core/src/question_file"; /** * A class that describes the Signature question type. * * [View Demo](https://surveyjs.io/form-library/examples/signature-pad-widget-javascript/ (linkStyle)) */ export class QuestionSignaturePadModel extends QuestionFileModelBase { isDrawingValue: boolean; isReadyForUpload: boolean; private getPenColorFromTheme; private updateColors; protected getCssRoot(cssClasses: any): string; protected getFormat(): "" | "image/svg+xml" | "image/jpeg"; protected updateValue(): void; constructor(name: string); getType(): string; afterRenderQuestionElement(el: HTMLElement): void; beforeDestroyQuestionElement(el: HTMLElement): void; themeChanged(theme: ITheme): void; private canvas; private element; private scale; private valueIsUpdatingInternally; valueWasChangedFromLastUpload: boolean; private resizeCanvas; private scaleCanvas; private fromUrl; private fromDataUrl; private _loadedData; get loadedData(): string; protected loadPreview(newValue: any): void; protected onChangeQuestionValue(newValue: any): void; onSurveyLoad(): void; private updateValueHandler; initSignaturePad(el: HTMLElement): void; destroySignaturePad(el: HTMLElement): void; /** * Specifies the format in which to store the signature image. * * Possible values: * * - `"png"` (default) * - `"jpeg"` * - `"svg"` */ get dataFormat(): string; set dataFormat(val: string); /** * Specifies the width of the signature area. Accepts positive integer numbers. */ get signatureWidth(): number; set signatureWidth(val: number); /** * Specifies the height of the signature area. Accepts positive integer numbers. */ get signatureHeight(): number; set signatureHeight(val: number); /** * Specifies whether the signature area should be scaled to fit into the question width. * * Default value: `false` * * This property auto-scales the signature area to fill all available width within the question box while maintaining the default 3:2 aspect ratio. If you set [custom width](#signatureWidth) and [height](#signatureHeight) values, the setting will keep the aspect ratio of these dimensions. * * > The signature area is scaled only for display. The image saved in survey results will have dimensions specified by the [`signatureHeight`](#signatureHeight) and [`signatureWidth`](#signatureWidth) properties. */ signatureAutoScaleEnabled: boolean; /** * Speicifies the minimum width of pen strokes, measured in pixels. * * Default value: 0.5 */ penMinWidth: number; /** * Speicifies the maximum width of pen strokes, measured in pixels. * * Default value: 2.5 */ penMaxWidth: number; private get containerHeight(); private get containerWidth(); get renderedCanvasWidth(): string; get height(): number; set height(val: number); /** * Specifies whether to display a button that clears the signature area. * * Default value: `true` */ get allowClear(): boolean; set allowClear(val: boolean); get canShowClearButton(): boolean; /** * Specifies a color for the pen. * * This property accepts color values in the following formats: * * - Hexadecimal colors (`"#FF0000"`) * - RGB colors (`"rgb(255,0,0)"`) * - Color names (`"red"`) * @see backgroundColor */ get penColor(): string; set penColor(val: string); /** * Specifies a color for the signature area background. Ignored if [`backgroundImage`](#backgroundImage) is set. * * This property accepts color values in the following formats: * * - Hexadecimal colors (`"#FF0000"`) * - RGB colors (`"rgb(255,0,0)"`) * - Color names (`"red"`) * @see penColor */ get backgroundColor(): string; set backgroundColor(val: string); /** * An image to display in the background of the signature area. Accepts a base64 or URL string value. * @see backgroundColor */ get backgroundImage(): string; set backgroundImage(val: string); get clearButtonCaption(): string; /** * A Boolean value that specifies whether to show the placeholder text in the signature area. * * Default value: `true` * * Use the [`placeholder`](#placeholder) and [`placeholderReadOnly`](#placeholderReadOnly) properties to specify placeholder texts for the signature area in edit mode and in read-only or preview mode. */ showPlaceholder: boolean; get locRenderedPlaceholder(): any; nothingIsDrawn(): boolean; needShowPlaceholder(): boolean; /** * A placeholder text for the signature area. Applies when the [`showPlaceholder`](#showPlaceholder) property is `true`. */ placeholder: string; /** * A placeholder text for the signature area in read-only or preview mode. Applies when the [`showPlaceholder`](#showPlaceholder) property is `true`. */ placeholderReadOnly: string; protected onBlurCore(event: any): void; protected uploadResultItemToValue(r: any): any; protected setValueFromResult(arg: any): void; clearValue(keepComment?: boolean): void; endLoadingFromJson(): void; } } declare module "packages/survey-core/src/survey-events-api" { import { IAction } from "packages/survey-core/src/actions/action"; import { Base } from "packages/survey-core/src/base"; import { IElement, IPanel, ISurveyElement, IValueItemCustomPropValues } from "packages/survey-core/src/base-interfaces"; import { ItemValue } from "packages/survey-core/src/itemvalue"; import { PageModel } from "packages/survey-core/src/page"; import { PanelModel, PanelModelBase } from "packages/survey-core/src/panel"; import { PopupModel } from "packages/survey-core/src/popup"; import { Question } from "packages/survey-core/src/question"; import { QuestionFileModel } from "packages/survey-core/src/question_file"; import { MatrixDropdownCell, MatrixDropdownRowModelBase, QuestionMatrixDropdownModelBase } from "packages/survey-core/src/question_matrixdropdownbase"; import { MatrixDropdownColumn } from "packages/survey-core/src/question_matrixdropdowncolumn"; import { QuestionMatrixDynamicModel } from "packages/survey-core/src/question_matrixdynamic"; import { QuestionPanelDynamicModel } from "packages/survey-core/src/question_paneldynamic"; import { QuestionSignaturePadModel } from "packages/survey-core/src/question_signaturepad"; import { SurveyModel } from "packages/survey-core/src/survey"; import { SurveyError } from "packages/survey-core/src/survey-error"; import { Trigger } from "packages/survey-core/src/trigger"; export interface QuestionEventMixin { /** * A Question instance for which the event is raised. */ question: Question; } export interface FileQuestionEventMixin { /** * A File Upload or Signature Pad question instance for which the event is raised. */ question: QuestionFileModel | QuestionSignaturePadModel; } export interface PanelDynamicQuestionEventMixin { /** * A Dynamic Panel question instance for which the event is raised. */ question: QuestionPanelDynamicModel; } export interface MatrixDropdownQuestionEventMixin { /** * A Multi-Select Matrix question instance for which the event is raised. */ question: QuestionMatrixDropdownModelBase; } export interface MatrixDynamicQuestionEventMixin { /** * A Dynamic Matrix question instance for which the event is raised. */ question: QuestionMatrixDynamicModel; } export interface PanelEventMixin { /** * A Panel instance for which the event is raised. */ panel: PanelModel; } export interface PageEventMixin { /** * A Page instance for which the event is raised. */ page: PageModel; } export interface GetTitleActionsEventMixin { /** * An array of [actions](https://surveyjs.io/form-library/documentation/iaction) associated with the processed element. */ actions: Array; /** * Obsolete. Use `options.actions` instead. */ titleActions?: Array; } export interface GetActionsEventMixin { /** * An array of [actions](https://surveyjs.io/form-library/documentation/iaction). You can modify the entire array or individual actions within it. */ actions: Array; } export interface AfterRenderElementEventMixin { /** * A rendered HTML element. */ htmlElement: HTMLElement; } export interface UpdateElementCssClassesEventMixin { /** * An object with CSS classes applied to the element being rendered, for example, `{ root: "class1", button: "class2" }`. You can modify this object to apply custom CSS classes. */ cssClasses: any; } export interface ElementVisibleChangedEventMixin { /** * Indicates whether the element is visible now. */ visible: boolean; } export interface TriggerExecutedEvent { /** * A trigger that has been executed. */ trigger: Trigger; } export interface CompleteBaseEvent { /** * Returns `true` if survey completion is caused by a ["complete" trigger](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#complete). */ isCompleteOnTrigger: boolean; /** * A "complete" trigger that has been executed. This parameter has a value only if `options.isCompleteOnTrigger` is `true`. */ completeTrigger?: Trigger; } export interface CompletingEvent extends CompleteBaseEvent { /** * A Boolean property that you can set to `false` if you want to prevent survey completion. */ allow: boolean; /** * Obsolete. Use `options.allow` instead. */ allowComplete: boolean; } export interface CompleteEvent extends CompleteBaseEvent { /** * Call this method to hide the save operation messages. */ clearSaveMessages: (test?: string) => void; /** * Call this method to indicate that survey results are successfully saved. You can use the `text` parameter to display a custom message. */ showSaveSuccess: (text?: string) => void; /** * Call this method to indicate that an error occurred during the save operation. You can use the `text` parameter to display a custom error message. */ showSaveError: (text?: string) => void; /** * Call this method to indicate that the save operation is in progress. You can use the `text` parameter to display a custom message. */ showSaveInProgress: (text?: string) => void; /** * Obsolete. Use `options.showSaveInProgress` instead. */ showDataSaving: (text?: string) => void; /** * Obsolete. Use `options.showSaveError` instead. */ showDataSavingError: (text?: string) => void; /** * Obsolete. Use `options.showSaveSuccess` instead. */ showDataSavingSuccess: (text?: string) => void; /** * Obsolete. Use `options.clearSaveMessages` instead. */ showDataSavingClear: (text?: string) => void; } export interface ShowingPreviewEvent { /** * A Boolean property that you can set to `false` if you want to cancel the preview. */ allow: boolean; /** * Obsolete. Use `options.allow` instead. */ allowShowPreview: boolean; } export interface NavigateToUrlEvent { /** * A Boolean property that you can set to `false` if you want to cancel the navigation and show the [complete page](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#complete-page). */ allow: boolean; /** * A URL to which respondents should be navigated. You can modify this parameter's value. */ url: string; } export interface CurrentPageChangedEvent { /** * Returns `true` if the respondent is switching to the previous page. */ isPrevPage: boolean; /** * Returns `true` if the respondent is switching to the next page. */ isNextPage: boolean; /** * Returns `true` if the respondent is going backward, that is, `newCurrentPage` or `newCurrentQuestion` is earlier in the survey than `oldCurrentPage` or `oldCurrentQuestion`. */ isGoingBackward: boolean; /** * Returns `true` if the respondent is going forward along the survey. */ isGoingForward: boolean; /** * Returns `true` if the respondent is switching from the [preview page](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#preview-page). */ isAfterPreview: boolean; /** * The current page. */ newCurrentPage: PageModel; /** * A page that used to be current.\ * In [question-per-page mode](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#questionsOnPageMode), the `oldCurrentPage` and `newCurrentPage` parameters may contain the same `PageModel` instance. This is because the survey doesn't create artificial pages to display only one question per page. If both the previous and current questions belong to the same page in the survey JSON schema, they have the same parent `PageModel` instance. */ oldCurrentPage: PageModel; /** * The current question.\ * This parameter has a value only in [question-per-page mode](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#questionsOnPageMode). */ oldCurrentQuestion?: Question; /** * A question that used to be current.\ * This parameter has a value only in [question-per-page mode](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#questionsOnPageMode). */ newCurrentQuestion?: Question; } export interface CurrentPageChangingEvent extends CurrentPageChangedEvent { /** * A Boolean property that you can set to `false` if you do not want to switch the current page. */ allow: boolean; /** * Obsolete. Use `options.allow` instead. */ allowChanging: boolean; } export interface ValueChangeBaseEvent extends QuestionEventMixin { /** * The `name` of the question whose value is being changed. If you use the [`valueName`](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model#valueName) property, this parameter contains its value. */ name: string; /** * A value that indicates what caused the value change: an [expression](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions) evaluation or a run of a [trigger](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#conditional-survey-logic-triggers). If the value is changed for other reasons, this parameter is `undefined`. */ reason: "trigger" | "expression" | undefined; } export interface ValueChangedEvent extends ValueChangeBaseEvent { /** * A new value. */ value: any; } export interface ValueChangingEvent extends ValueChangeBaseEvent { /** * A new value. You can change it if required. */ value: any; /** * A previous value. */ oldValue: any; } export interface VariableChangedEvent { /** * A new value for the variable or calculated value. */ value: any; /** * The name of the variable or calculated value that has been changed. */ name: string; } export interface QuestionVisibleChangedEvent extends QuestionEventMixin, ElementVisibleChangedEventMixin { /** * The question's name. */ name: string; } export interface PageVisibleChangedEvent extends ElementVisibleChangedEventMixin, PageEventMixin { } export interface PanelVisibleChangedEvent extends ElementVisibleChangedEventMixin, PanelEventMixin { } export interface QuestionCreatedEvent extends QuestionEventMixin { } export interface ElementAddedEvent { /** * A page that nests the added element. */ page: PanelModelBase; /** * The parent container (panel or page). */ parent: PanelModelBase; /** * Obsolete. Use `options.page` instead. */ rootPanel: any; /** * Obsolete. Use `options.parent` instead. */ parentPanel: any; /** * The element's index within the parent container (panel or page). */ index: number; /** * The question's name. */ name: string; } export interface ElementRemovedEvent { /** * The element's name. */ name: string; } export interface QuestionAddedEvent extends QuestionEventMixin, ElementAddedEvent { } export interface QuestionRemovedEvent extends QuestionEventMixin, ElementRemovedEvent { } export interface PanelAddedEvent extends PanelEventMixin, ElementAddedEvent { } export interface PanelRemovedEvent extends PanelEventMixin, ElementRemovedEvent { } export interface PageAddedEvent extends PageEventMixin { } export interface ValidateQuestionEvent extends QuestionEventMixin { /** * An error message that you should specify if validation fails. */ error: string; /** * A question value being validated. */ value: any; /** * The question's name. */ name: string; } export interface SettingQuestionErrorsEvent extends QuestionEventMixin { /** * An array of errors. The array is empty if the validated question satisfies all validation rules. */ errors: Array; } export interface ServerValidateQuestionsEvent { /** * A method that you should call when a request to the server has completed. */ complete: () => void; /** * An object for your error messages. Set error messages as follows: `options.errors["questionName"] = "My error message"`. */ errors: { [index: string]: any; }; /** * Question values. You can get an individual question value as follows: `options.data["questionName"]`. */ data: { [index: string]: any; }; } export interface ValidatePanelEvent extends PanelEventMixin { /** * An error message that you should specify if validation fails. */ error: string; /** * The panel's name. */ name: string; } export interface ErrorCustomTextEvent { /** * A validation error type: `"required"`, `"requireoneanswer"`, `"requirenumeric"`, `"exceedsize"`, `"webrequest"`, `"webrequestempty"`, `"otherempty"`, `"uploadingfile"`, `"requiredinallrowserror"`, `"minrowcounterror"`, `"keyduplicationerror"`, or `"custom"` */ name: string; /** * A survey element to which the validation error belongs. */ obj: Question | PanelModel | SurveyModel; /** * A validation error. */ error: SurveyError; /** * An error message. You can assign a custom message to this parameter. */ text: string; } export interface ValidatedErrorsOnCurrentPageEvent extends PageEventMixin { /** * An array of questions with validation errors. */ questions: Array; /** * An array of validation errors. */ errors: Array; } export interface ProcessHtmlEvent { /** * HTML markup. You can modify this parameter's value. */ html: string; /** * Indicates a page, question, or message for which HTML content is intended: [`"completed"`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#completedHtml) | [`"completed-before"`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#completedBeforeHtml) | [`"loading"`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#loadingHtml) | [`"html-question"`](https://surveyjs.io/form-library/documentation/api-reference/add-custom-html-to-survey#html). */ reason: string; } export interface GetQuestionTitleEvent extends QuestionEventMixin { /** * A question title taken from the question's `title` or `name` property. You can change this parameter's value. */ title: string; } export interface GetTitleTagNameEvent { /** * A survey element (question, panel, page, or the survey itself) for which the event is raised. */ element: Base; /** * A heading used to render the title (`"h1"`-`"h6"`). You can change this parameter's value. */ tagName: string; } export interface GetQuestionNoEvent extends QuestionEventMixin { /** * Obsolete. Use `options.number` instead. */ no: string; } export interface GetQuestionNumberEvent extends GetQuestionNoEvent { /** * A question number that is calculated based upon the question's [`visibleIndex`](https://surveyjs.io/form-library/documentation/api-reference/question#visibleIndex) and survey's [`questionStartIndex`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#questionStartIndex) properties. You can change this parameter's value. */ number: string; } export interface GetPageNumberEvent extends PageEventMixin { /** * A page number. Note that this is a string value that contains not only the number itself but also the characters that separate the number from the page title: `"1. "`, `"2. "`, etc. You can change this parameter's value. */ number: string; } export interface GetPanelNumberEvent extends PanelEventMixin { /** * A panel number. Note that this is a string value that contains not only the number itself but also the characters that separate the number from the panel title: `"1. "`, `"2. "`, etc. You can change this parameter's value. */ number: string; } export interface GetProgressTextEvent { /** * The number of questions with input fields. [Image](https://surveyjs.io/form-library/examples/add-image-and-video-to-survey/), [HTML](https://surveyjs.io/form-library/examples/questiontype-html/), and [Expression](https://surveyjs.io/form-library/examples/questiontype-expression/) questions are not counted. */ questionCount: number; /** * The number of answered questions. */ answeredQuestionCount: number; /** * The number of questions marked as required. */ requiredQuestionCount: number; /** * The number of answered questions marked as required. */ requiredAnsweredQuestionCount: number; /** * Progress text rendered in the [progress bar](#showProgressBar). You can change this parameter's value. */ text: string; } export interface ProgressTextEvent extends GetProgressTextEvent { } export interface TextProcessingEvent { /** * The name of the property that contains the text to process. */ name: string; /** * A survey element (question, panel, page, or survey) in which the text will be rendered. */ element: Question | PanelModel | PageModel | SurveyModel; } export interface TextMarkdownEvent extends TextProcessingEvent { /** * A string with Markdown content. Convert this content to HTML and assign the result to the `options.html` parameter. */ text: string; /** * A property to which you should assign HTML content. */ html?: string; } export interface TextRenderAsEvent extends TextProcessingEvent { /** * a component name used for text rendering */ renderAs: string; } export interface SendResultEvent { /** * A server [response](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/response). */ response: any; request: any; /** * A Boolean value that indicates whether survey results have been saved successfully. */ success: boolean; } export interface GetResultEvent { /** * A server [response](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/response). */ response: any; /** * A Boolean value that indicates whether survey results have been retrieved successfully. */ success: boolean; /** * An object with the following structure: * * ```js * { * AnswersCount: Number, // A total number of posted answers to the question * QuestionResult: Object // All unique answers to the question and their number * } * ``` */ data: any; /** * An array of objects with the following structure: * * ```js * { * name: String, // A unique answer to the question * value: Number // The number of user responses with this answer * } * ``` */ dataList: Array; } export interface LoadFilesEvent extends FileQuestionEventMixin { /** * A File Upload question's name. */ name: string; } export interface UploadFilesEvent extends LoadFilesEvent { /** * A callback function that you should call when a file is uploaded successfully or when file upload fails. Pass an array of successfully uploaded files as the first argument. As the second argument, you can pass an array of error messages if file upload failed. */ callback: (data: any | Array, errors?: any | Array) => any; /** * An array of JavaScript File objects that represent files to upload. */ files: Array; } export interface OpenFileChooserEvent { /** * A file input HTML element. */ input: HTMLInputElement; /** * A question for which this event is raised. */ element: Base; /** * The type of the element passed as the `options.element` parameter.\ * Possible values: any value returned from the [`getType()`](https://surveyjs.io/form-library/documentation/api-reference/question#getType) method. */ elementType: String; /** * The name of the survey element property for which files are being selected. */ propertyName: String; /** * A choice item for which the event is raised. This parameter has a value only when the dialog window is opened to select images for an [Image Picker](https://surveyjs.io/form-library/documentation/api-reference/image-picker-question-model) question. */ item: ItemValue; /** * A callback function to which you should pass selected files. * @param files An array of selected files. */ callback: (files: Array) => void; } export interface DownloadFileEvent extends LoadFilesEvent { /** * A callback function that you should call when a file is downloaded successfully or when deletion fails. Pass `"success"` or `"error"` as the first argument to indicate the operation status. As the second argument, you can pass the downloaded file's data as a Base64 string if file download was successful or an error message if file download failed. */ callback: (status: string, data?: any) => any; /** * The File Upload question's [`value`](https://surveyjs.io/form-library/documentation/api-reference/file-model#value) that contains metadata about uploaded files. */ fileValue: any; /** * A file identifier (URL, file name, etc.) stored in survey results. */ content: any; } export interface ClearFilesEvent extends LoadFilesEvent { /** * A callback function that you should call when files are deleted successfully or when deletion fails. Pass `"success"` or `"error"` as the first argument to indicate the operation status. As the second argument, you can pass deleted files' data (`options.value`) if file deletion was successful or an error message if file deletion failed. */ callback: (status: string, data?: any) => any; /** * The name of a file to delete. When this parameter is `null`, all files should be deleted. */ fileName: string; /** * The File Upload question's [`value`](https://surveyjs.io/form-library/documentation/api-reference/file-model#value) that contains metadata about uploaded files. */ value: any; } export interface LoadChoicesFromServerEvent extends QuestionEventMixin { /** * A query result as it came from the server. */ serverResult: any; /** * An array of loaded choices. You can modify this array. */ choices: Array; } export interface ProcessTextValueEvent { /** * The name of the value being processed (the text in curly brackets). */ name: string; /** * The value being processed. You can change this parameter's value. */ value: any; isExists: boolean; canProcess: boolean; returnDisplayValue: boolean; } export interface UpdateQuestionCssClassesEvent extends QuestionEventMixin, UpdateElementCssClassesEventMixin { } export interface UpdatePanelCssClassesEvent extends PanelEventMixin, UpdateElementCssClassesEventMixin { } export interface UpdatePageCssClassesEvent extends PageEventMixin, UpdateElementCssClassesEventMixin { } export interface UpdateChoiceItemCssEvent extends QuestionEventMixin { /** * A choice item. To access its value and display text, use the `options.item.value` and `options.item.text` properties. */ item: ItemValue; /** * A string with CSS classes applied to the choice item. The CSS classes are separated by a space character. You can modify this string to apply custom CSS classes. */ css: string; } export interface AfterRenderSurveyEvent extends AfterRenderElementEventMixin { /** * Obsolete. Use the `sender` parameter instead. */ survey: SurveyModel; } export interface AfterRenderHeaderEvent extends AfterRenderElementEventMixin { } export interface AfterRenderPageEvent extends AfterRenderElementEventMixin, PageEventMixin { } export interface AfterRenderQuestionEvent extends QuestionEventMixin, AfterRenderElementEventMixin { } export interface AfterRenderQuestionInputEvent extends QuestionEventMixin, AfterRenderElementEventMixin { } export interface AfterRenderPanelEvent extends AfterRenderElementEventMixin, PanelEventMixin { } export interface FocusInQuestionEvent extends QuestionEventMixin { } export interface FocusInPanelEvent extends PanelEventMixin { } export interface ShowingChoiceItemEvent extends QuestionEventMixin { /** * A choice item. */ item: ItemValue; /** * A Boolean value that specifies item visibility. Set it to `false` to hide the item. */ visible: boolean; } export interface ChoicesLazyLoadEvent extends QuestionEventMixin { /** * A method that you should call to assign loaded items to the question. Item objects should be structured as specified in the [`choices`](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model#choices) property description. If their structure is different, [map their properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) to bring them to the required structure. */ setItems: (items: Array<{ "value": any; "text"?: String; "imageLink"?: string; "customProperty"?: any; } | string>, totalCount: number) => void; /** * A search string used to filter choices. */ filter: string; /** * The number of choice items to load. You can use the question's [`choicesLazyLoadPageSize`](https://surveyjs.io/form-library/documentation/questiondropdownmodel#choicesLazyLoadPageSize) property to change this number. */ take: number; /** * The number of choice items to skip. */ skip: number; } export interface ChoicesSearchEvent extends QuestionEventMixin { /** * A search string used to filter choice options. */ filter: string; /** * An array of all choice options. */ choices: Array; /** * A filtered array of choice options. Apply `options.filter` to the `options.choices` array and assign the result to this parameter. */ filteredChoices: Array; } export interface GetChoiceDisplayValueEvent extends QuestionEventMixin { /** * A method that you should call to assign display texts to the question. */ setItems: (displayValues: Array, ...customValues: Array) => void; /** * An array of one (in Dropdown) or more (in Tag Box) default values. */ values: Array; } export interface MatrixRowAddedEvent extends MatrixDynamicQuestionEventMixin { /** * An added matrix row. */ row: MatrixDropdownRowModelBase; } export interface MatrixBeforeRowAddedEvent extends MatrixDynamicQuestionEventMixin { /** * A Boolean property that you can set to `false` if you do not want to add the row. */ allow: boolean; /** * Obsolete. Use `options.allow` instead. */ canAddRow: boolean; } export interface MatrixRowRemovingEvent extends MatrixDynamicQuestionEventMixin { /** * A matrix row to be deleted. If you want to clear row data, set the `options.row.value` property to `undefined`. */ row: MatrixDropdownRowModelBase; /** * A zero-based index of the matrix row to be deleted. */ rowIndex: number; /** * A Boolean property that you can set to `false` if you want to cancel row deletion. */ allow: boolean; } export interface MatrixRowRemovedEvent extends MatrixDynamicQuestionEventMixin { /** * A deleted matrix row. */ row: MatrixDropdownRowModelBase; /** * A zero-based index of the deleted row. */ rowIndex: number; } export interface MatrixAllowRemoveRowEvent extends MatrixDynamicQuestionEventMixin { /** * A matrix row for which the event is raised. */ row: MatrixDropdownRowModelBase; /** * A zero-based row index. */ rowIndex: number; /** * A Boolean property that you can set to `false` if you want to hide the Remove button for this row. */ allow: boolean; } export interface MatrixDetailPanelVisibleChangedEvent extends MatrixDropdownQuestionEventMixin { /** * A matrix row to which the detail section belongs. */ row: MatrixDropdownRowModelBase; /** * A zero-based row index. */ rowIndex: number; /** * A [PanelModel](https://surveyjs.io/form-library/documentation/panelmodel) that represents the detail section. */ detailPanel: PanelModel; /** * Indicates whether the detail section is visible now. */ visible: boolean; } export interface MatrixCellCreatingBaseEvent extends MatrixDropdownQuestionEventMixin { /** * A [matrix column](https://surveyjs.io/form-library/documentation/api-reference/multi-select-matrix-column-values) to which the cell belongs. */ column: MatrixDropdownColumn; /** * The name of the matrix column to which the cell belongs. */ columnName: string; /** * A matrix row to which the cell belongs. */ row: MatrixDropdownRowModelBase; /** * The values of this matrix row.\ * To access a particular column's value, use the following code: `options.rowValue["columnName"]` */ rowValue: any; } export interface MatrixCellCreatingEvent extends MatrixCellCreatingBaseEvent { /** * The type of this matrix cell. You can change this property value to one of the values described in the [`cellType`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list#cellType) documentation. */ cellType: string; } export interface MatrixCellCreatedEvent extends MatrixCellCreatingBaseEvent { /** * A matrix cell for which the event is raised. */ cell: MatrixDropdownCell; /** * A Question instance within the matrix cell. You can use the properties and methods exposed by the instance to customize it. */ cellQuestion: Question; } export interface MatrixAfterCellRenderEvent extends QuestionEventMixin, AfterRenderElementEventMixin { /** * A matrix cell for which the event is raised. */ cell: MatrixDropdownCell; /** * A Question instance within the matrix cell. */ cellQuestion: Question; /** * A matrix row to which the cell belongs. */ row: MatrixDropdownRowModelBase; /** * A [matrix column](https://surveyjs.io/form-library/documentation/api-reference/multi-select-matrix-column-values) to which the cell belongs. */ column: MatrixDropdownColumn | MatrixDropdownCell; } export interface MatrixCellValueBaseEvent extends MatrixDropdownQuestionEventMixin { /** * A matrix row to which the cell belongs. */ row: MatrixDropdownRowModelBase; /** * A [matrix column](https://surveyjs.io/form-library/documentation/api-reference/multi-select-matrix-column-values) to which the cell belongs. */ column: MatrixDropdownColumn; /** * The name of a matrix column to which the cell belongs. */ columnName: string; /** * A Question instance within the matrix cell. You can use the properties and methods exposed by the instance to customize it. */ cellQuestion: Question; /** * A method that returns a Question instance within the matrix cell given a column name. */ getCellQuestion: (columnName: string) => Question; /** * A new cell value. */ value: any; } export interface MatrixCellValueChangedEvent extends MatrixCellValueBaseEvent { } export interface MatrixCellValueChangingEvent extends MatrixCellValueBaseEvent { /** * A previous cell value. */ oldValue: any; } export interface MatrixCellValidateEvent extends MatrixCellValueBaseEvent { /** * A field for your custom error message. Default value: `undefined`. */ error?: string; } export interface DynamicPanelModifiedEvent extends PanelDynamicQuestionEventMixin, PanelEventMixin { /** * The panel's index within Dynamic Panel. */ panelIndex: number; } export interface DynamicPanelRemovingEvent extends DynamicPanelModifiedEvent { /** * A Boolean property that you can set to `false` if you want to cancel panel deletion. */ allow: boolean; } export interface TimerPanelInfoTextEvent { /** * the timer panel info text */ text: string; } export interface DynamicPanelValueChangedEvent extends PanelDynamicQuestionEventMixin { /** * The panel's data object that includes all item values. */ panelData: { [index: string]: any; }; /** * The panel's index within Dynamic Panel. */ panelIndex: number; /** * The item's name. */ name: string; /** * A panel that nests the item with a changed value. */ panel: PanelModel; /** * The item's new value. */ value: any; } export interface DynamicPanelValueChangingEvent extends DynamicPanelValueChangedEvent { /** * The item's old value. */ oldValue: any; } export interface DynamicPanelItemValueChangedEvent extends DynamicPanelValueChangedEvent { } export interface DynamicPanelCurrentIndexChangedEvent extends PanelDynamicQuestionEventMixin { /** * A panel for which the event is raised. */ panel: PanelModel; /** * The panel's index in the [`visiblePanels`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#visiblePanels) array of the Dynamic Panel. */ visiblePanelIndex: number; } export interface DynamicPanelGetTabTitleEvent extends DynamicPanelCurrentIndexChangedEvent { /** * A tab title. You can change this parameter's value. */ title: string; } export interface IsAnswerCorrectEvent extends QuestionEventMixin { /** * A Boolean property that specifies whether the answer is correct (`true`) or incorrect (`false`). Use the `options.question.value` and `options.question.correctAnswer` properties to check the answer. */ result: boolean; /** * Obsolete. Use `options.correctAnswerCount` instead. */ correctAnswers?: number; /** * Obsolete. Use `options.incorrectAnswerCount` instead. */ incorrectAnswers?: number; } export interface CheckAnswerCorrectEvent extends IsAnswerCorrectEvent { /** * The number of correct answers in a matrix where each row is considered as one quiz question. */ correctAnswerCount: number; /** * The number of incorrect answers in a matrix where each row is considered as one quiz question. */ incorrectAnswerCount: number; } export interface DragDropAllowEvent { /** * A survey element being dragged. */ draggedElement: IElement; /** * A survey element from which `draggedElement` is being dragged. This parameter is `null` if `draggedElement` is being dragged from the [Toolbox](https://surveyjs.io/survey-creator/documentation/toolbox). */ fromElement: IPanel; /** * A survey element to which `draggedElement` is being dragged. */ toElement: IElement; /** * A survey element before which the target element will be placed. This parameter is `null` if the parent container (page or panel) has no elements or if the target element will be placed below all other elements within the container. */ insertBefore: IElement; /** * A survey element after which `draggedElement` will be placed. This parameter is `null` if the parent container (page or panel) has no elements or if `draggedElement` will be placed above all other elements within the container. */ insertAfter: IElement; /** * A parent container (page or panel) within which `draggedElement` will be placed. */ parent: ISurveyElement; /** * A Boolean property that you can set to `false` if you want to cancel the drag and drop operation. */ allow: boolean; allowDropNextToAnother?: boolean; /** * Obsolete. Use `options.draggedElement` instead. */ target: IElement; /** * Obsolete. Use `options.toElement` instead. */ source: IElement; } export interface ScrollingElementToTopEvent { /** * A survey element that will be scrolled to the top. */ element: ISurveyElement; /** * A unique element ID within the DOM. */ elementId: string; /** * Obsolete. Use `options.allow` instead. */ cancel?: boolean; /** * Obsolete. Use `options.element` instead. */ question?: Question; /** * Obsolete. Use `options.element` instead. */ page?: PageModel; } export interface ScrollToTopEvent extends ScrollingElementToTopEvent { /** * A Boolean property that you can set to `false` if you want to cancel the scroll operation. */ allow: boolean; } export interface GetQuestionTitleActionsEvent extends QuestionEventMixin, GetTitleActionsEventMixin { } export interface GetPanelTitleActionsEvent extends PanelEventMixin, GetTitleActionsEventMixin { } export interface GetPageTitleActionsEvent extends PageEventMixin, GetTitleActionsEventMixin { } export interface GetPanelFooterActionsEvent extends GetActionsEventMixin, PanelEventMixin { /** * A [Dynamic Panel](https://surveyjs.io/form-library/documentation/questionpaneldynamicmodel) to which the Panel belongs. This field is `undefined` if the Panel does not belong to any Dynamic Panel. */ question?: QuestionPanelDynamicModel; } export interface GetMatrixRowActionsEvent extends QuestionEventMixin, GetActionsEventMixin { /** * A matrix row for which the event is raised. */ row: MatrixDropdownRowModelBase; } export interface ElementContentVisibilityChangedEvent { /** * A survey element that was expanded or collapsed. */ element: ISurveyElement; } export interface GetQuestionDisplayValueEvent extends QuestionEventMixin { /** * A question's display text. You can assign a custom value to this parameter. */ displayValue: any; } export interface GetExpressionDisplayValueEvent extends GetQuestionDisplayValueEvent { /** * An expression value. */ value: any; } export interface MultipleTextItemAddedEvent extends QuestionEventMixin { /** * A new added item. */ item: any; } export interface MatrixColumnAddedEvent extends QuestionEventMixin { /** * An added matrix column. */ column: any; } export interface PopupVisibleChangedEvent extends QuestionEventMixin { /** * An object that describes the popup. */ popup: PopupModel; /** * Indicates whether the popup is visible now. */ visible: boolean; } export interface OpenDropdownMenuEvent extends QuestionEventMixin { /** * A question for which the event is raised. */ question: Question; /** * A device type. */ deviceType: "mobile" | "tablet" | "desktop"; /** * A Boolean value that indicates whether the current device supports touch gestures. */ hasTouchScreen: boolean; /** * The height of the device screen in pixels. */ screenHeight: number; /** * The width of the device screen in pixels. */ screenWidth: number; /** * A menu type to use for the question: a classic dropdown, a pop-up dialog, or an overlay window. You can modify this parameter's value. */ menuType: "dropdown" | "popup" | "overlay"; } export interface ElementWrapperComponentEventMixin { element: any; wrapperName: string; reason?: string; item?: ItemValue; } export interface ElementWrapperComponentNameEvent extends ElementWrapperComponentEventMixin { componentName: string; } export interface ElementWrapperComponentDataEvent extends ElementWrapperComponentEventMixin { data: any; } export interface ResizeEvent { /** * The current survey width in pixels. */ width: number; /** * The current survey height in pixels. */ height: number; } } declare module "packages/survey-core/src/drag-drop-page-helper-v1" { import { IElement, ISurveyElement } from "packages/survey-core/src/base-interfaces"; import { PageModel } from "packages/survey-core/src/page"; export class DragDropPageHelperV1 { private page; constructor(page: PageModel); private dragDropInfo; getDragDropInfo(): any; dragDropStart(src: IElement, target: IElement, nestedPanelDepth?: number): void; dragDropMoveTo(destination: ISurveyElement, isBottom?: boolean, isEdge?: boolean): boolean; private correctDragDropInfo; private dragDropAllowFromSurvey; dragDropFinish(isCancel?: boolean): IElement; private dragDropGetElementIndex; private dragDropCanDropTagert; private dragDropCanDropSource; private dragDropCanDropCore; private dragDropCanDropNotNext; private dragDropIsSameElement; } } declare module "packages/survey-core/src/page" { import { IPage, IPanel, IElement, ISurveyElement, ISurvey } from "packages/survey-core/src/base-interfaces"; import { PanelModel } from "packages/survey-core/src/panel"; import { LocalizableString } from "packages/survey-core/src/localizablestring"; /** * The `PageModel` object describes a survey page and contains properties and methods that allow you to control the page and access its elements (panels and questions). * * [View Demo](https://surveyjs.io/form-library/examples/nps-question/ (linkStyle)) */ export class PageModel extends PanelModel implements IPage { private hasShownValue; private dragDropPageHelper; isPageContainer: boolean; constructor(name?: string); getType(): string; toString(): string; get isPage(): boolean; get isPanel(): boolean; get showPanelAsPage(): boolean; get hasEditButton(): boolean; protected getElementsForRows(): Array; protected disposeElements(): void; protected onRemoveElement(element: IElement): void; getTemplate(): string; get no(): string; get cssTitleNumber(): string; getCssTitleExpandableSvg(): string; get cssRequiredText(): string; protected canShowPageNumber(): boolean; protected canShowTitle(survey: ISurvey): boolean; protected setTitleValue(val: string): void; /** * A caption displayed on a navigation button in the TOC or progress bar. Applies when [`showTOC`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#showTOC) is `true` or when the [progress bar is visible](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#showProgressBar), [`progressBarType`](https://surveyjs.io/form-library/documentation/surveymodel#progressBarType) is set to `"pages"`, and [`progressBarShowPageTitles`](https://surveyjs.io/form-library/documentation/surveymodel#progressBarShowPageTitles) is `true`. * * If navigation titles are unspecified, the navigation buttons display page [titles](https://surveyjs.io/form-library/documentation/api-reference/page-model#title) or [names](https://surveyjs.io/form-library/documentation/pagemodel#name). */ get navigationTitle(): string; set navigationTitle(val: string); /** * Explanatory text displayed under a navigation button in the progress bar. Applies when the [progress bar is visible](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#showProgressBar), `SurveyModel`'s [`progressBarType`](https://surveyjs.io/form-library/documentation/surveymodel#progressBarType) is set to `"pages"`, and [`progressBarShowPageTitles`](https://surveyjs.io/form-library/documentation/surveymodel#progressBarShowPageTitles) is `true`. */ get navigationDescription(): string; set navigationDescription(val: string); get locNavigationDescription(): LocalizableString; navigationLocStrChanged(): void; getMarkdownHtml(text: string, name: string): string; get passed(): boolean; set passed(val: boolean); protected removeFromParent(): void; /** * The visible index of the page. It has values from 0 to visible page count - 1. * @see SurveyModel.visiblePages * @see SurveyModel.pages */ get visibleIndex(): number; set visibleIndex(val: number); protected canRenderFirstRows(): boolean; /** * Returns `true` if this page is a start page. * * Refer to the following help topic for more information on how to configure a start page: [Start Page](https://surveyjs.io/form-library/documentation/design-survey-create-a-multi-page-survey#start-page). */ get isStartPage(): boolean; get isStarted(): boolean; protected calcCssClasses(css: any): any; protected getCssPanelTitle(): string; get cssRoot(): string; protected getCssError(cssClasses: any): string; num: number; /** * Set this property to "hide" to make "Prev", "Next" and "Complete" buttons are invisible for this page. Set this property to "show" to make these buttons visible, even if survey showNavigationButtons property is false. * @see SurveyMode.showNavigationButtons */ get navigationButtonsVisibility(): string; set navigationButtonsVisibility(val: string); /** * Returns `true` if this is the current page. * @see SurveyModel.currentPage */ get isActive(): boolean; /** * Returns `true` if the respondent has already seen this page during the current session. */ get wasShown(): boolean; get hasShown(): boolean; setWasShown(val: boolean): void; /** * Scrolls this page to the top. */ scrollToTop(): void; /** * A time period that a respondent has spent on this page so far; measured in seconds. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey-create-a-quiz). * @see timeLimit */ timeSpent: number; /** * Returns a list of all panels on this page. * @param visibleOnly A Boolean value that specifies whether to include only visible panels. * @param includingDesignTime For internal use. */ getAllPanels(visibleOnly?: boolean, includingDesignTime?: boolean): Array; getPanels(visibleOnly?: boolean, includingDesignTime?: boolean): Array; /** * A time period that a respondent has to complete this page; measured in seconds. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey-create-a-quiz). * * Default value: 0 (time is unlimited) * * Alternatively, you can use the `SurveyModel`'s [`timeLimitPerPage`](https://surveyjs.io/form-library/documentation/surveymodel#timeLimitPerPage) property to specify identical time periods for all survey pages. * @see timeSpent */ get timeLimit(): number; set timeLimit(val: number); /** * Obsolete. Use the [`timeLimit`](https://surveyjs.io/form-library/documentation/api-reference/page-model#timeLimit) property instead. * @deprecated */ get maxTimeToFinish(): number; set maxTimeToFinish(val: number); getMaxTimeToFinish(): number; protected onNumChanged(value: number): void; protected onVisibleChanged(): void; getDragDropInfo(): any; dragDropStart(src: IElement, target: IElement, nestedPanelDepth?: number): void; dragDropMoveTo(destination: ISurveyElement, isBottom?: boolean, isEdge?: boolean): boolean; dragDropFinish(isCancel?: boolean): IElement; ensureRowsVisibility(): void; private _isReadyForClean; get isReadyForClean(): boolean; set isReadyForClean(val: boolean); isReadyForCleanChangedCallback: () => void; enableOnElementRerenderedEvent(): void; disableOnElementRerenderedEvent(): void; } } declare module "packages/survey-core/src/dxSurveyService" { /** * The class contains methods to work with api.surveyjs.io service. */ export class dxSurveyService { locale: string; static get serviceUrl(): string; static set serviceUrl(val: string); loadSurvey(surveyId: string, onLoad: (success: boolean, result: string, response: any) => void): void; getSurveyJsonAndIsCompleted(surveyId: string, clientId: string, onLoad: (success: boolean, surveyJson: any, result: string, response: any) => void): void; canSendResult(result: JSON): boolean; get isSurveJSIOService(): boolean; sendResult(postId: string, result: JSON, onSendResult: (success: boolean, response: any, request?: any) => void, clientId?: string, isPartialCompleted?: boolean): void; protected sendResultCore(postId: string, result: JSON, onSendResult: (success: boolean, response: any, request?: any) => void, clientId?: string, isPartialCompleted?: boolean): void; sendFile(postId: string, file: File, onSendFile: (success: boolean, response: any) => void): void; getResult(resultId: string, name: string, onGetResult: (success: boolean, data: any, dataList: Array, response: any) => void): void; isCompleted(resultId: string, clientId: string, onIsCompleted: (success: boolean, result: string, response: any) => void): void; private get serviceUrl(); } } declare module "packages/survey-core/src/surveytimer" { import { EventBase } from "packages/survey-core/src/base"; export var surveyTimerFunctions: { setTimeout: (func: () => any) => number; clearTimeout: (timerId: number) => void; safeTimeOut: (func: () => any, delay: number) => number | any; now(): number; }; export interface SurveyTimerEvent { seconds: number; } export class SurveyTimer { private static instanceValue; static get instance(): SurveyTimer; private listenerCounter; private timerId; private prevTimeInMs; onTimerTick: EventBase; onTimer: EventBase; start(func?: (timer: SurveyTimer, options: SurveyTimerEvent) => void): void; stop(func?: (timer: SurveyTimer, options: SurveyTimerEvent) => any): void; doTimer(): void; } } declare module "packages/survey-core/src/surveyTimerModel" { import { ISurvey } from "packages/survey-core/src/base-interfaces"; import { Base, EventBase } from "packages/survey-core/src/base"; import { PageModel } from "packages/survey-core/src/page"; import { SurveyModel } from "packages/survey-core/src/survey"; export interface ISurveyTimerText { timerInfoText: string; timerInfo: { spent: number; limit?: number; }; timerClock: { majorText: string; minorText?: string; }; getCss(): any; isTimerPanelShowingOnBottom: boolean; isTimerPanelShowingOnTop: boolean; onCurrentPageChanged: EventBase; } export class SurveyTimerModel extends Base { onTimerTick: (page: PageModel) => void; private surveyValue; constructor(survey: ISurvey); text: string; progress: number; clockMajorText: string; clockMinorText: string; spent: number; get survey(): ISurveyTimerText; onCreating(): void; private timerFunc; start(): void; stop(): void; get isRunning(): boolean; private setIsRunning; private update; private doTimer; private updateProgress; private updateText; get showProgress(): boolean; get showTimerAsClock(): boolean; get rootCss(): string; getProgressCss(): string; get textContainerCss(): string; get minorTextCss(): string; get majorTextCss(): string; } } declare module "packages/survey-core/src/expressionItems" { import { Base } from "packages/survey-core/src/base"; import { ISurvey } from "packages/survey-core/src/base-interfaces"; import { ILocalizableOwner, LocalizableString } from "packages/survey-core/src/localizablestring"; /** * Base class for HtmlConditionItem and UrlConditionItem classes. */ export class ExpressionItem extends Base implements ILocalizableOwner { locOwner: ILocalizableOwner; constructor(expression?: string); getType(): string; runCondition(values: any, properties: any): boolean; /** * The expression property. If this expression returns true, then survey will use html property to show on complete page. */ get expression(): string; set expression(val: string); get locHtml(): LocalizableString; getLocale(): string; getMarkdownHtml(text: string, name: string): string; getRenderer(name: string): string; getRendererContext(locStr: LocalizableString): any; getProcessedText(text: string): string; getSurvey(isLive?: boolean): ISurvey; } /** * A class that contains expression and html propeties. It uses in survey.completedHtmlOnCondition array. * If the expression returns true then html of this item uses instead of survey.completedHtml property * @see SurveyModel.completedHtmlOnCondition * @see SurveyModel.completedHtml */ export class HtmlConditionItem extends ExpressionItem { constructor(expression?: string, html?: string); getType(): string; /** * The html that shows on completed ('Thank you') page. The expression should return true * @see expression */ get html(): string; set html(value: string); get locHtml(): LocalizableString; } /** * A class that contains expression and url propeties. It uses in survey.navigateToUrlOnCondition array. * If the expression returns true then url of this item uses instead of survey.navigateToUrl property * @see SurveyModel.navigateToUrl */ export class UrlConditionItem extends ExpressionItem { constructor(expression?: string, url?: string); getType(): string; /** * The url that survey navigates to on completing the survey. The expression should return true * @see expression */ get url(): string; set url(value: string); get locUrl(): LocalizableString; } } declare module "packages/survey-core/src/notifier" { import { Base } from "packages/survey-core/src/base"; import { ActionContainer } from "packages/survey-core/src/actions/container"; import { IAction } from "packages/survey-core/src/actions/action"; interface INotifierCssClasses { root: string; rootWithButtons: string; info: string; error: string; success: string; button: string; shown: string; } export class Notifier extends Base { private cssClasses; active: boolean; isDisplayed: boolean; message: string; css: string; timeout: number; timer: any; private actionsVisibility; actionBar: ActionContainer; showActions: boolean; constructor(cssClasses: INotifierCssClasses); getCssClass(type: string): string; updateActionsVisibility(type: string): void; notify(message: string, type?: string, waitUserAction?: boolean): void; addAction(action: IAction, notificationType: string): void; } } declare module "packages/survey-core/src/question_textbase" { import { Question } from "packages/survey-core/src/question"; import { CssClassBuilder } from "packages/survey-core/src/utils/cssClassBuilder"; import { LocalizableString } from "packages/survey-core/src/localizablestring"; import { Base } from "packages/survey-core/src/base"; export class CharacterCounter extends Base { remainingCharacterCounter: string; updateRemainingCharacterCounter(newValue: string, maxLength: number): void; } /** * A base class for the [Single-Line Input](https://surveyjs.io/form-library/documentation/questiontextmodel) and [Long Text](https://surveyjs.io/form-library/documentation/questioncommentmodel) question types. */ export class QuestionTextBase extends Question { constructor(name: string); protected isTextValue(): boolean; /** * The maximum text length measured in characters. Assign 0 if the length should be unlimited. * * Default value: -1 (inherits the actual value from the `SurveyModel`'s [`maxTextLength`](https://surveyjs.io/form-library/documentation/surveymodel#maxTextLength) property). */ get maxLength(): number; set maxLength(val: number); getMaxLength(): any; characterCounter: CharacterCounter; updateRemainingCharacterCounter(newValue: string): void; /** * A placeholder for the input field. */ placeholder: string; get placeHolder(): string; set placeHolder(val: string); get locPlaceHolder(): LocalizableString; getType(): string; isEmpty(): boolean; /** * Specifies when to update the question value. * * Possible values: * * - `"onBlur"` - Updates the value after the input field loses focus. * - `"onTyping"` - Updates the value on every key press. * - `"default"` (default) - Inherits the value from the `SurveyModel`'s [`textUpdateMode`](https://surveyjs.io/form-library/documentation/surveymodel#textUpdateMode) property. * * > Do not use the `"onTyping"` mode if your survey contains many expressions. Expressions are reevaluated each time a question value is changed. In `"onTyping"` mode, the question value changes frequently. This may cause performance degradation. */ get textUpdateMode(): string; set textUpdateMode(val: string); protected getIsInputTextUpdate(): boolean; get renderedPlaceholder(): string; protected onReadOnlyChanged(): void; localeChanged(): void; protected supportEmptyValidation(): boolean; protected resetRenderedPlaceholder(): void; protected hasPlaceholder(): boolean; protected setNewValue(newValue: any): void; protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void; protected convertToCorrectValue(val: any): any; protected getValueSeparator(): string; protected getControlCssClassBuilder(): CssClassBuilder; getControlClass(): string; get isNewA11yStructure(): boolean; onKeyDownPreprocess: (event: any) => void; } } declare module "packages/survey-core/src/mask/mask_utils" { export var numberDefinition: RegExp; export interface IMaskedInputResult { value: string; caretPosition: number; cancelPreventDefault?: boolean; } export interface ITextInputParams { prevValue: string; selectionStart: number; selectionEnd: number; insertedChars: string | null; inputDirection?: "forward" | "backward"; } export interface IInputMask { getMaskedValue(src: any): string; getUnmaskedValue(src: string): any; processInput(args: ITextInputParams): IMaskedInputResult; getTextAlignment(): "left" | "right" | "auto"; } export function getAvailableMaskTypeChoices(): string[]; } declare module "packages/survey-core/src/mask/mask_base" { import { Base } from "packages/survey-core/src/base"; import { ISurvey } from "packages/survey-core/src/base-interfaces"; import { IInputMask, IMaskedInputResult, ITextInputParams } from "packages/survey-core/src/mask/mask_utils"; /** * A base class for classes that implement input masks: * * - [`InputMaskNumeric`](https://surveyjs.io/form-library/documentation/inputmasknumeric) * - [`InputMaskCurrency`](https://surveyjs.io/form-library/documentation/inputmaskcurrency) * - [`InputMaskDateTime`](https://surveyjs.io/form-library/documentation/inputmaskdatetime) * - [`InputMaskPattern`](https://surveyjs.io/form-library/documentation/inputmaskpattern) */ export class InputMaskBase extends Base implements IInputMask { /** * Specifies whether to store the question value with an applied mask in survey results. * * Default value: `false` */ saveMaskedValue: boolean; owner: ISurvey; getSurvey(live?: boolean): ISurvey; getType(): string; setData(json: any): void; getData(): any; processInput(args: ITextInputParams): IMaskedInputResult; getUnmaskedValue(src: string): any; getMaskedValue(src: any): string; getTextAlignment(): "left" | "right" | "auto"; getTypeForExpressions(): string; } } declare module "packages/survey-core/src/mask/input_element_adapter" { import { InputMaskBase } from "packages/survey-core/src/mask/mask_base"; import { ITextInputParams } from "packages/survey-core/src/mask/mask_utils"; export class InputElementAdapter { private inputMaskInstance; private inputElement; private prevUnmaskedValue; private setInputValue; constructor(inputMaskInstance: InputMaskBase, inputElement: HTMLInputElement, value?: any); inputMaskInstancePropertyChangedHandler: (sender: any, options: any) => void; clickHandler: (event: any) => void; beforeInputHandler: (event: any) => void; changeHandler: (event: any) => void; createArgs(event: any): ITextInputParams; addInputEventListener(): void; removeInputEventListener(): void; dispose(): void; } } declare module "packages/survey-core/src/question_text" { import { LocalizableString, LocalizableStrings } from "packages/survey-core/src/localizablestring"; import { HashTable } from "packages/survey-core/src/helpers"; import { SurveyError } from "packages/survey-core/src/survey-error"; import { QuestionTextBase } from "packages/survey-core/src/question_textbase"; import { CssClassBuilder } from "packages/survey-core/src/utils/cssClassBuilder"; import { InputMaskBase } from "packages/survey-core/src/mask/mask_base"; import { IInputMask } from "packages/survey-core/src/mask/mask_utils"; /** * A class that describes the Single-Line Input question type. * * [View Demo](https://surveyjs.io/form-library/examples/questiontype-text/ (linkStyle)) */ export class QuestionTextModel extends QuestionTextBase { private locDataListValue; private minValueRunner; private maxValueRunner; private maskInputAdapter; private createMaskAdapter; private deleteMaskAdapter; private updateMaskAdapter; onSetMaskType(newValue: string): void; /** * Specifies the type of a mask applied to the input. * * Possible values: * * - `"none"` (default) * - `"numeric"` * - `"currency"` * - `"datetime"` * - `"pattern"` * * [View Demo](https://surveyjs.io/form-library/examples/masked-input-fields/ (linkStyle)) * @see maskSettings */ maskType: string; /** * Specifies text alignment within the input field. * * Possible values: * * - `"left"` - Aligns input text to the left side. * - `"right"` - Aligns input text to the right side. * - `"auto"` (default) - Applies right alignment if a [numeric or currency input mask](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model#maskType) is specified. Otherwise, applies left alignment. */ inputTextAlignment: "left" | "right" | "auto"; get maskTypeIsEmpty(): boolean; /** * An object with properties that configure the mask applied to the input. * * Available properties depend on the specified [`maskType`](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model#maskType) and belong to corresponding classes. Refer to the class APIs for a full list of properties: * * | `maskType` | Class | * | ---------- | ----- | * | `"numeric"` | [`InputMaskNumeric`](https://surveyjs.io/form-library/documentation/api-reference/inputmasknumeric) | * | `"currency"` | [`InputMaskCurrency`](https://surveyjs.io/form-library/documentation/api-reference/inputmaskcurrency) | * | `"datetime"` | [`InputMaskDateTime`](https://surveyjs.io/form-library/documentation/api-reference/inputmaskdatetime) | * | `"pattern"` | [`InputMaskPattern`](https://surveyjs.io/form-library/documentation/api-reference/inputmaskpattern) | * * [View Demo](https://surveyjs.io/form-library/examples/masked-input-fields/ (linkStyle)) */ get maskSettings(): InputMaskBase; set maskSettings(val: InputMaskBase); private setNewMaskSettingsProperty; protected createMaskSettings(): InputMaskBase; constructor(name: string); protected isTextValue(): boolean; getType(): string; onSurveyLoad(): void; /** * A value passed on to the [`type`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types) attribute of the underlying `` element. * * Default value: `"text"` */ get inputType(): string; set inputType(val: string); getMaxLength(): any; runCondition(values: HashTable, properties: HashTable): void; protected getDisplayValueCore(keysAsText: boolean, value: any): any; isLayoutTypeSupported(layoutType: string): boolean; /** * A value passed on to the [`size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/size) attribute of the underlying `` element. */ get size(): number; set size(val: number); get isTextInput(): boolean; get inputSize(): number; get renderedInputSize(): number; get inputWidth(): string; updateInputSize(): void; /** * A value passed on to the [`autocomplete`](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) attribute of the underlying `` element. */ get autocomplete(): string; set autocomplete(val: string); /** * A value passed on to the [`min`](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/min) attribute of the underlying `` element. * @see minValueExpression */ get min(): string; set min(val: string); /** * A value passed on to the [`max`](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/max) attribute of the underlying `` element. * @see maxValueExpression */ get max(): string; set max(val: string); /** * The minimum value specified as an expression. For example, `"minValueExpression": "today(-1)"` sets the minimum value to yesterday. * @see min */ get minValueExpression(): string; set minValueExpression(val: string); /** * The maximum value specified as an expression. For example, `"maxValueExpression": "today(1)"` sets the maximum value to tomorrow. * @see max */ get maxValueExpression(): string; set maxValueExpression(val: string); get renderedMin(): any; get renderedMax(): any; /** * An error message to display when the question value is less than the minimum accepted value. * @see min * @see minValueExpression */ get minErrorText(): string; set minErrorText(val: string); get locMinErrorText(): LocalizableString; /** * An error message to display when the question value exceeds the maximum accepted value. * @see max * @see maxValueExpression */ get maxErrorText(): string; set maxErrorText(val: string); get locMaxErrorText(): LocalizableString; /** * Returns `true` if the specified `inputType` supports the `min` and `max` properties. * @see inputType * @see min * @see max */ get isMinMaxType(): boolean; _inputValue: string; get maskInstance(): IInputMask; get inputValue(): string; set inputValue(val: string); getExpressionValue(val: any): any; protected convertToCorrectValue(val: any): any; protected onChangeQuestionValue(newValue: any): void; private updateInputValue; private hasToConvertToUTC; private createDate; protected valueForSurveyCore(val: any): any; protected valueFromDataCore(val: any): any; private dateValidationMessage; protected onCheckForErrors(errors: Array, isOnValueChanged: boolean, fireCallback: boolean): void; protected canSetValueToSurvey(): boolean; protected convertFuncValuetoQuestionValue(val: any): any; private getMinMaxErrorText; private get isValueLessMin(); private get isValueGreaterMax(); private get isDateInputType(); private isDateTimeLocaleType; private getCalculatedMinMax; private setRenderedMinMax; /** * A value passed on to the [`step`](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/step) attribute of the underlying `` element. */ get step(): string; set step(val: string); get renderedStep(): string; protected getIsInputTextUpdate(): boolean; supportGoNextPageAutomatic(): boolean; supportGoNextPageError(): boolean; /** * An array of predefined options from which users can select. This property configures an HTML [``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist) element and associates it with the underlying `input` element. */ get dataList(): Array; set dataList(val: Array); get locDataList(): LocalizableStrings; get dataListId(): string; protected setNewValue(newValue: any): void; protected correctValueType(newValue: any): any; protected hasPlaceholder(): boolean; protected getControlCssClassBuilder(): CssClassBuilder; isReadOnlyRenderDiv(): boolean; get inputStyle(): any; private updateTextAlign; private _isWaitingForEnter; private updateValueOnEvent; onCompositionUpdate: (event: any) => void; onKeyUp: (event: any) => void; private updateDateValidationMessage; readOnlyBlocker: (event: any) => boolean; onKeyDown: (event: any) => void; onChange: (event: any) => void; protected onBlurCore(event: any): void; protected onFocusCore(event: any): void; afterRenderQuestionElement(el: HTMLElement): void; beforeDestroyQuestionElement(el: HTMLElement): void; } export function isMinMaxType(obj: any): boolean; } declare module "packages/survey-core/src/question_multipletext" { import { Base } from "packages/survey-core/src/base"; import { ISurveyData, ISurveyImpl, ISurvey, IPanel, IElement, IQuestion, ITextProcessor, IProgressInfo } from "packages/survey-core/src/base-interfaces"; import { SurveyValidator, IValidatorOwner } from "packages/survey-core/src/validator"; import { Question, IConditionObject } from "packages/survey-core/src/question"; import { QuestionTextModel } from "packages/survey-core/src/question_text"; import { SurveyError } from "packages/survey-core/src/survey-error"; import { ILocalizableOwner, LocalizableString } from "packages/survey-core/src/localizablestring"; import { HashTable } from "packages/survey-core/src/helpers"; import { InputMaskBase } from "packages/survey-core/src/mask/mask_base"; import { PanelLayoutColumnModel } from "packages/survey-core/src/panel-layout-column"; export interface IMultipleTextData extends ILocalizableOwner, IPanel { getSurvey(): ISurvey; getTextProcessor(): ITextProcessor; getAllValues(): any; getMultipleTextValue(name: string): any; setMultipleTextValue(name: string, value: any): any; getItemDefaultValue(name: string): any; getIsRequiredText(): string; } export class MultipleTextEditorModel extends QuestionTextModel { get a11y_input_ariaLabel(): string; get a11y_input_ariaLabelledBy(): string; get a11y_input_ariaDescribedBy(): string; } /** * A class that describes an [item](https://surveyjs.io/form-library/documentation/api-reference/multiple-text-entry-question-model#items) in a Multiple Textboxes question. * * [View Demo](https://surveyjs.io/form-library/examples/multiple-text-box-question/ (linkStyle)) */ export class MultipleTextItemModel extends Base implements IValidatorOwner, ISurveyData, ISurveyImpl { private editorValue; private data; valueChangedCallback: (newValue: any) => void; constructor(name?: any, title?: string); getType(): string; get id(): string; getOriginalObj(): Base; /** * An item ID that is not visible to respondents. * * > Item IDs must be unique. * @see title */ get name(): string; set name(val: string); get question(): Question; get editor(): MultipleTextEditorModel; protected createEditor(name: string): MultipleTextEditorModel; addUsedLocales(locales: Array): void; localeChanged(): void; locStrsChanged(): void; setData(data: IMultipleTextData): void; focusIn: () => void; /** * Marks the item as required. If a respondent leaves this item empty, the question displays a [validation error](#requiredErrorText). */ get isRequired(): boolean; set isRequired(val: boolean); /** * A value passed on to the [`type`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types) attribute of the underlying `` element. * * Default value: `"text"` */ get inputType(): string; set inputType(val: string); /** * A user-friendly item label to display. If `title` is undefined, [`name`](https://surveyjs.io/form-library/documentation/api-reference/multipletextitemmodel#name) is displayed instead. */ get title(): string; set title(val: string); get locTitle(): LocalizableString; get fullTitle(): string; /** * The maximum text length measured in characters. Assign 0 if the length should be unlimited. * * Default value: -1 (inherits the actual value from the `SurveyModel`'s [`maxTextLength`](https://surveyjs.io/form-library/documentation/surveymodel#maxTextLength) property). */ get maxLength(): number; set maxLength(val: number); getMaxLength(): any; /** * A placeholder for the input field. */ get placeholder(): string; set placeholder(val: string); get locPlaceholder(): LocalizableString; get placeHolder(): string; set placeHolder(val: string); get locPlaceHolder(): LocalizableString; /** * Specifies a custom error message for a [required item](#isRequired). */ get requiredErrorText(): string; set requiredErrorText(val: string); get locRequiredErrorText(): LocalizableString; /** * A value passed on to the [`size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/size) attribute of the underlying `` element. * * If you want to set a uniform `size` for all text box items, use the [`itemSize`](https://surveyjs.io/form-library/documentation/api-reference/multiple-text-entry-question-model#itemSize) within the Multiple Textboxes configuration. */ get size(): number; set size(val: number); /** * An [expression](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions) used to calculate the default item value. * @see minValueExpression * @see maxValueExpression */ get defaultValueExpression(): string; set defaultValueExpression(val: string); /** * An [expression](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions) used to calculate the minimum item value. * @see maxValueExpression * @see defaultValueExpression */ get minValueExpression(): string; set minValueExpression(val: string); /** * An [expression](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions) used to calculate the maximum item value. * @see minValueExpression * @see defaultValueExpression */ get maxValueExpression(): string; set maxValueExpression(val: string); /** * Item validators. * * [Data Validation](https://surveyjs.io/form-library/documentation/data-validation (linkStyle)) */ get validators(): Array; set validators(val: Array); getValidators(): Array; /** * Specifies the type of a mask applied to the input. * * Possible values: * * - `"none"` (default) * - `"numeric"` * - `"currency"` * - `"datetime"` * - `"pattern"` * * [View Demo](https://surveyjs.io/form-library/examples/masked-input-fields/ (linkStyle)) * @see maskSettings */ get maskType(): string; set maskType(val: string); /** * An object with properties that configure the mask applied to the input. * * Available properties depend on the specified [`maskType`](#maskType) and belong to corresponding classes. Refer to the class APIs for a full list of properties: * * | `maskType` | Class | * | ---------- | ----- | * | `"numeric"` | [`InputMaskNumeric`](https://surveyjs.io/form-library/documentation/api-reference/inputmasknumeric) | * | `"currency"` | [`InputMaskCurrency`](https://surveyjs.io/form-library/documentation/api-reference/inputmaskcurrency) | * | `"datetime"` | [`InputMaskDateTime`](https://surveyjs.io/form-library/documentation/api-reference/inputmaskdatetime) | * | `"pattern"` | [`InputMaskPattern`](https://surveyjs.io/form-library/documentation/api-reference/inputmaskpattern) | * * [View Demo](https://surveyjs.io/form-library/examples/masked-input-fields/ (linkStyle)) */ get maskSettings(): InputMaskBase; set maskSettings(val: InputMaskBase); /** * Specifies text alignment within the input field. * * Possible values: * * - `"left"` - Aligns input text to the left side. * - `"right"` - Aligns input text to the right side. * - `"auto"` (default) - Applies right alignment if a [numeric or currency input mask](https://surveyjs.io/form-library/documentation/api-reference/multipletextitemmodel#maskType) is specified. Otherwise, applies left alignment. */ get inputTextAlignment(): "left" | "right" | "auto"; set inputTextAlignment(val: "left" | "right" | "auto"); /** * An item value. */ get value(): any; set value(value: any); isEmpty(): boolean; onValueChanged(newValue: any): void; getSurveyData(): ISurveyData; getSurvey(): ISurvey; getTextProcessor(): ITextProcessor; getValue(name: string): any; setValue(name: string, value: any): void; getVariable(name: string): any; setVariable(name: string, newValue: any): void; getComment(name: string): string; setComment(name: string, newValue: string): void; getAllValues(): any; getFilteredValues(): any; getFilteredProperties(): any; findQuestionByName(name: string): IQuestion; getEditingSurveyElement(): Base; getValidatorTitle(): string; get validatedValue(): any; set validatedValue(val: any); getDataFilteredValues(): any; getDataFilteredProperties(): any; } /** * A class that describes the Multiple Text question type. * * [View Demo](https://surveyjs.io/form-library/examples/questiontype-multipletext/ (linkStyle)) */ export class QuestionMultipleTextModel extends Question implements IMultipleTextData, IPanel { static addDefaultItems(question: QuestionMultipleTextModel): void; constructor(name: string); getType(): string; setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void; get isAllowTitleLeft(): boolean; get hasSingleInput(): boolean; get isContainer(): boolean; get id(): string; set id(val: string); onSurveyLoad(): void; setQuestionValue(newValue: any, updateIsAnswered?: boolean): void; onSurveyValueChanged(newValue: any): void; private updateItemsSize; private editorsOnSurveyLoad; private performForEveryEditor; /** * Gets or sets an array of [`MultipleTextItemModel`](https://surveyjs.io/form-library/documentation/api-reference/multipletextitemmodel) objects that represent input items. * * Each object in this array should have at least the following properties: * * ```js * { * "name": any, // A unique value used to identify an input item and save an item value to survey results. * "title": String // An item caption. When `title` is undefined, `name` is used. This property supports Markdown. * } * ``` * * To enable Markdown support for the `title` property, implement Markdown-to-HTML conversion in the [`onTextMarkdown`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onTextMarkdown) event handler. For an example, refer to the following demo: [Convert Markdown to HTML with markdown-it](https://surveyjs.io/form-library/examples/edit-survey-questions-markdown/). * @see itemTitleWidth * @see addItem */ get items(): Array; set items(val: Array); /** * Adds a new input item. * @param name An item name. * @param title *(Optional)* An item title. * @see items */ addItem(name: string, title?: string): MultipleTextItemModel; getItemByName(name: string): MultipleTextItemModel; getElementsInDesign(includeHidden?: boolean): Array; addConditionObjectsByContext(objects: Array, context: any): void; protected collectNestedQuestionsCore(questions: Question[], visibleOnly: boolean, includeItSelf: boolean): void; getConditionJson(operator?: string, path?: string): any; locStrsChanged(): void; localeChanged(): void; /** * Specifies the error message position relative to individual input fields. * * Possible values: * * - `"default"` (default) - Inherits the setting from the [`errorLocation`](#errorLocation) property. * - `"top"` - Displays error messages above input fields. * - `"bottom"` - Displays error messages below input fields. */ get itemErrorLocation(): string; set itemErrorLocation(val: string); getQuestionErrorLocation(): string; get showItemErrorOnTop(): boolean; get showItemErrorOnBottom(): boolean; getChildErrorLocation(child: Question): string; protected isNewValueCorrect(val: any): boolean; supportGoNextPageAutomatic(): boolean; /** * The number of columns used to arrange input items. Accepts the following values: 1, 2, 3, 4, 5. * * Default value: 1 */ get colCount(): number; set colCount(val: number); /** * A value passed on to the [`size`](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/size) attribute of the underlying `` elements. */ get itemSize(): number; set itemSize(val: number); /** * Specifies a uniform width for all text box titles. Accepts CSS values. * * Default value: `""` (the width of each title depends on the title length) * @see items * @see itemErrorLocation */ get itemTitleWidth(): string; set itemTitleWidth(val: string); rows: Array; protected onRowCreated(row: MutlipleTextRow): MutlipleTextRow; private calcVisibleRows; getRows(): Array; private isMultipleItemValueChanging; protected onValueChanged(): void; protected createTextItem(name: string, title: string): MultipleTextItemModel; protected onItemValueChanged(): void; runCondition(values: HashTable, properties: HashTable): void; protected getIsRunningValidators(): boolean; hasErrors(fireCallback?: boolean, rec?: any): boolean; getAllErrors(): Array; clearErrors(): void; protected getContainsErrors(): boolean; protected getIsAnswered(): boolean; getProgressInfo(): IProgressInfo; protected getDisplayValueCore(keysAsText: boolean, value: any): any; protected allowMobileInDesignMode(): boolean; getMultipleTextValue(name: string): any; setMultipleTextValue(name: string, value: any): void; getItemDefaultValue(name: string): any; getTextProcessor(): ITextProcessor; getAllValues(): any; getIsRequiredText(): string; addElement(element: IElement, index: number): void; removeElement(element: IElement): boolean; getQuestionTitleLocation(): string; getQuestionTitleWidth(): string; getColumsForElement(el: IElement): Array; updateColumns(): void; getQuestionStartIndex(): string; getChildrenLayoutType(): string; elementWidthChanged(el: IElement): void; get elements(): Array; indexOf(el: IElement): number; ensureRowsVisibility(): void; validateContainerOnly(): void; onQuestionValueChanged(el: IElement): void; getItemLabelCss(item: MultipleTextItemModel): string; getItemCss(): string; getItemTitleCss(): string; } export class MutlipleTextRow extends Base { isVisible: boolean; cells: Array; } export class MutlipleTextErrorRow extends MutlipleTextRow { onAfterCreated(): void; } export class MultipleTextCell { item: MultipleTextItemModel; protected question: QuestionMultipleTextModel; constructor(item: MultipleTextItemModel, question: QuestionMultipleTextModel); isErrorsCell: boolean; protected getClassName(): string; get className(): string; } export class MultipleTextErrorCell extends MultipleTextCell { isErrorsCell: boolean; protected getClassName(): string; } } declare module "packages/survey-core/src/header" { import { Base, ArrayChanges } from "packages/survey-core/src/base"; import { HorizontalAlignment, VerticalAlignment } from "packages/survey-core/src/base-interfaces"; import { SurveyModel } from "packages/survey-core/src/survey"; import { ITheme } from "packages/survey-core/src/themes"; export class CoverCell { private cover; private positionX; private positionY; static CLASSNAME: string; private calcRow; private calcColumn; private calcAlignItems; private calcAlignText; private calcJustifyContent; constructor(cover: Cover, positionX: HorizontalAlignment, positionY: VerticalAlignment); get survey(): SurveyModel; get css(): string; get style(): any; get contentStyle(): any; get showLogo(): boolean; get showTitle(): boolean; get showDescription(): boolean; get textAreaWidth(): string; } export class Cover extends Base { private _survey; private calcBackgroundSize; private updateHeaderClasses; private updateContentClasses; private updateBackgroundImageClasses; fromTheme(theme: ITheme): void; private init; constructor(); getType(): string; cells: CoverCell[]; actualHeight: number; height: number; mobileHeight: number; inheritWidthFrom: "survey" | "container"; textAreaWidth: number; textGlowEnabled: boolean; overlapEnabled: boolean; backgroundColor: string; titleColor: string; descriptionColor: string; backgroundImage: string; renderBackgroundImage: string; backgroundImageFit: "cover" | "fill" | "contain" | "tile"; backgroundImageOpacity: number; logoPositionX: HorizontalAlignment; logoPositionY: VerticalAlignment; titlePositionX: HorizontalAlignment; titlePositionY: VerticalAlignment; descriptionPositionX: HorizontalAlignment; descriptionPositionY: VerticalAlignment; logoStyle: { gridColumn: number; gridRow: number; }; titleStyle: { gridColumn: number; gridRow: number; }; descriptionStyle: { gridColumn: number; gridRow: number; }; headerClasses: string; contentClasses: string; maxWidth: string; backgroundImageClasses: string; get renderedHeight(): string; get renderedtextAreaWidth(): string; get survey(): SurveyModel; set survey(newValue: SurveyModel); get backgroundImageStyle(): { opacity: number; backgroundImage: string; backgroundSize: string; }; protected propertyValueChanged(name: string, oldValue: any, newValue: any, arrayChanges?: ArrayChanges, target?: Base): void; calculateActualHeight(logoHeight: number, titleHeight: number, descriptionHeight: number): number; processResponsiveness(width: number): void; get hasBackground(): boolean; } } declare module "packages/survey-core/src/surveyTaskManager" { import { Base } from "packages/survey-core/src/base"; class SurveyTaskModel { type: string; private timestamp; constructor(type: string); } export class SurveyTaskManagerModel extends Base { private taskList; constructor(); private onAllTasksCompleted; hasActiveTasks: boolean; runTask(type: string, func: (done: any) => void): SurveyTaskModel; waitAndExecute(action: any): void; private taskFinished; } } declare module "packages/survey-core/src/progress-buttons" { import { Base, EventBase } from "packages/survey-core/src/base"; import { PageModel } from "packages/survey-core/src/page"; import { SurveyModel } from "packages/survey-core/src/survey"; export class ProgressButtons extends Base { survey: SurveyModel; constructor(survey: SurveyModel); isListElementClickable(index: number | any): boolean; getRootCss(container?: string): string; getListElementCss(index: number | any): string; getScrollButtonCss(hasScroller: boolean, isLeftScroll: boolean): string; clickListElement(element: number | PageModel): void; isListContainerHasScroller(element: HTMLElement): boolean; isCanShowItemTitles(element: HTMLElement): boolean; clearConnectorsWidth(element: HTMLElement): void; adjustConnectors(element: HTMLElement): void; get isFitToSurveyWidth(): boolean; get progressWidth(): string; get showItemNumbers(): boolean; get showItemTitles(): boolean; getItemNumber(page: PageModel): string; get headerText(): string; get footerText(): string; onResize: EventBase; processResponsiveness(width: number): void; } export interface IProgressButtonsViewModel { container: string; onResize(canShowItemTitles: boolean): void; onUpdateScroller(hasScroller: boolean): void; onUpdateSettings(): void; } export class ProgressButtonsResponsivityManager { private model; private element; private viewModel; private criticalProperties; private timer; private prevWidth; private canShowItemTitles; constructor(model: ProgressButtons, element: HTMLElement, viewModel: IProgressButtonsViewModel); private forceUpdate; private processResponsiveness; dispose(): void; } } declare module "packages/survey-core/src/surveyToc" { import { Action } from "packages/survey-core/src/actions/action"; import { ListModel } from "packages/survey-core/src/list"; import { PanelModelBase } from "packages/survey-core/src/panel"; import { PopupModel } from "packages/survey-core/src/popup"; import { SurveyModel } from "packages/survey-core/src/survey"; export function tryFocusPage(survey: SurveyModel, panel: PanelModelBase): boolean; export function createTOCListModel(survey: SurveyModel, onAction?: () => void): ListModel; export function getTocRootCss(survey: SurveyModel, isMobile?: boolean): string; export class TOCModel { survey: SurveyModel; static RootStyle: string; static StickyPosition: boolean; constructor(survey: SurveyModel); private initStickyTOCSubscriptions; updateStickyTOCSize(rootElement: HTMLElement): void; get isMobile(): boolean; get containerCss(): string; listModel: ListModel; popupModel: PopupModel; icon: string; togglePopup: () => void; dispose(): void; } } declare module "packages/survey-core/src/survey" { import { JsonError } from "packages/survey-core/src/jsonobject"; import { Base, EventBase } from "packages/survey-core/src/base"; import { ISurvey, ISurveyData, ISurveyImpl, ITextProcessor, IQuestion, IPanel, IElement, IPage, ISurveyErrorOwner, ISurveyElement, IProgressInfo, IFindElement, ISurveyLayoutElement, IPlainDataOptions, LayoutElementContainer, IValueItemCustomPropValues, ILoadFromJSONOptions, IDropdownMenuOptions, ITextProcessorProp, ITextProcessorResult } from "packages/survey-core/src/base-interfaces"; import { SurveyElementCore } from "packages/survey-core/src/survey-element"; import { ISurveyTriggerOwner, SurveyTrigger, Trigger } from "packages/survey-core/src/trigger"; import { CalculatedValue } from "packages/survey-core/src/calculatedValue"; import { PageModel } from "packages/survey-core/src/page"; import { dxSurveyService } from "packages/survey-core/src/dxSurveyService"; import { LocalizableString } from "packages/survey-core/src/localizablestring"; import { SurveyTimerModel, ISurveyTimerText } from "packages/survey-core/src/surveyTimerModel"; import { IQuestionPlainData, Question } from "packages/survey-core/src/question"; import { QuestionSelectBase } from "packages/survey-core/src/question_baseselect"; import { ItemValue } from "packages/survey-core/src/itemvalue"; import { PanelModel, QuestionRowModel } from "packages/survey-core/src/panel"; import { HtmlConditionItem, UrlConditionItem } from "packages/survey-core/src/expressionItems"; import { SurveyError } from "packages/survey-core/src/survey-error"; import { IAction, Action } from "packages/survey-core/src/actions/action"; import { ActionContainer } from "packages/survey-core/src/actions/container"; import { QuestionPanelDynamicModel } from "packages/survey-core/src/question_paneldynamic"; import { Notifier } from "packages/survey-core/src/notifier"; import { TriggerExecutedEvent, CompletingEvent, CompleteEvent, ShowingPreviewEvent, NavigateToUrlEvent, CurrentPageChangingEvent, CurrentPageChangedEvent, ValueChangingEvent, ValueChangedEvent, VariableChangedEvent, QuestionVisibleChangedEvent, PageVisibleChangedEvent, PanelVisibleChangedEvent, QuestionCreatedEvent, QuestionAddedEvent, QuestionRemovedEvent, PanelAddedEvent, PanelRemovedEvent, PageAddedEvent, ValidateQuestionEvent, SettingQuestionErrorsEvent, ValidatePanelEvent, ErrorCustomTextEvent, ValidatedErrorsOnCurrentPageEvent, ProcessHtmlEvent, GetQuestionTitleEvent, GetTitleTagNameEvent, GetQuestionNumberEvent, GetPageNumberEvent, GetPanelNumberEvent, GetProgressTextEvent, TextMarkdownEvent, SendResultEvent, GetResultEvent, UploadFilesEvent, DownloadFileEvent, ClearFilesEvent, LoadChoicesFromServerEvent, ProcessTextValueEvent, UpdateQuestionCssClassesEvent, UpdatePanelCssClassesEvent, UpdatePageCssClassesEvent, UpdateChoiceItemCssEvent, AfterRenderSurveyEvent, AfterRenderPageEvent, AfterRenderQuestionEvent, AfterRenderQuestionInputEvent, AfterRenderPanelEvent, FocusInQuestionEvent, FocusInPanelEvent, ShowingChoiceItemEvent, ChoicesLazyLoadEvent, GetChoiceDisplayValueEvent, MatrixRowAddedEvent, MatrixBeforeRowAddedEvent, MatrixRowRemovingEvent, MatrixRowRemovedEvent, MatrixAllowRemoveRowEvent, MatrixDetailPanelVisibleChangedEvent, MatrixCellCreatingEvent, MatrixCellCreatedEvent, MatrixAfterCellRenderEvent, MatrixCellValueChangedEvent, MatrixCellValueChangingEvent, MatrixCellValidateEvent, DynamicPanelModifiedEvent, DynamicPanelRemovingEvent, DynamicPanelItemValueChangedEvent, DynamicPanelValueChangingEvent, DynamicPanelGetTabTitleEvent, DynamicPanelCurrentIndexChangedEvent, CheckAnswerCorrectEvent, DragDropAllowEvent, ScrollToTopEvent, GetQuestionTitleActionsEvent, GetPanelTitleActionsEvent, GetPageTitleActionsEvent, GetPanelFooterActionsEvent, GetMatrixRowActionsEvent, GetExpressionDisplayValueEvent, ServerValidateQuestionsEvent, MultipleTextItemAddedEvent, MatrixColumnAddedEvent, GetQuestionDisplayValueEvent, PopupVisibleChangedEvent, ChoicesSearchEvent, OpenFileChooserEvent, OpenDropdownMenuEvent, ResizeEvent, ProgressTextEvent, ScrollingElementToTopEvent, IsAnswerCorrectEvent } from "packages/survey-core/src/survey-events-api"; import { QuestionMatrixDropdownModelBase } from "packages/survey-core/src/question_matrixdropdownbase"; import { QuestionMatrixDynamicModel } from "packages/survey-core/src/question_matrixdynamic"; import { QuestionFileModel } from "packages/survey-core/src/question_file"; import { QuestionMultipleTextModel } from "packages/survey-core/src/question_multipletext"; import { ITheme, ImageFit, ImageAttachment } from "packages/survey-core/src/themes"; import { PopupModel } from "packages/survey-core/src/popup"; import { Cover } from "packages/survey-core/src/header"; import { QuestionSignaturePadModel } from "packages/survey-core/src/question_signaturepad"; /** * The `SurveyModel` object contains properties and methods that allow you to control the survey and access its elements. * * [View Demo](https://surveyjs.io/form-library/examples/nps-question/ (linkStyle)) */ export class SurveyModel extends SurveyElementCore implements ISurvey, ISurveyData, ISurveyImpl, ISurveyTriggerOwner, ISurveyErrorOwner, ISurveyTimerText { static readonly TemplateRendererComponentName: string; [index: string]: any; static platform: string; get platformName(): string; notifier: Notifier; rootElement: HTMLElement; /** * A suffix added to the name of the property that stores comments. * * Default value: "-Comment" * * Many question types allow respondents to leave comments. To enable this functionality, set a question's [`showCommentArea`](https://surveyjs.io/form-library/documentation/api-reference/checkbox-question-model#showCommentArea) property to `true`. Comment values are saved in a separate property. The property name is composed of the question `name` and `commentSuffix`. * * Respondents can also leave comments when they select "Other" in choice-based questions, such as Dropdown or Checkboxes. The property name for the comment value is composed according to the same rules. However, you can use the question `name` as a key to store the comment value instead. Disable the [`storeOthersAsComment`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#storeOthersAsComment) property in this case. * * [View Demo](https://surveyjs.io/form-library/examples/create-checkboxes-question-in-javascript/ (linkStyle)) */ get commentSuffix(): string; set commentSuffix(val: string); get commentPrefix(): string; set commentPrefix(val: string); private valuesHash; private variablesHash; private editingObjValue; private timerModelValue; private navigationBarValue; /** * An event that is raised after a [trigger](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#triggers) is executed. * * For information on event handler parameters, refer to descriptions within the interface. * * [Conditional Survey Logic (Triggers)](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#conditional-survey-logic-triggers (linkStyle)) * @see triggers * @see runTriggers */ onTriggerExecuted: EventBase; /** * An event that is raised before the survey is completed. Use this event to prevent survey completion. * @see onComplete * @see doComplete * @see allowCompleteSurveyAutomatic */ onCompleting: EventBase; /** * An event that is raised after the survey is completed. Use this event to send survey results to the server. * * For information on event handler parameters, refer to descriptions within the interface. * * For an example of how to use the methods described above, refer to the following help topic: [Store Survey Results in Your Own Database](https://surveyjs.io/form-library/documentation/handle-survey-results-store#store-survey-results-in-your-own-database). * * > Do not disable the [`showCompletedPage`](https://surveyjs.io/form-library/documentation/surveymodel#showCompletedPage) property if you call one of the `options.showSave...` methods. This is required because the UI that indicates data saving progress is integrated into the complete page. If you hide the complete page, the UI also becomes invisible. * @see onPartialSend * @see doComplete * @see allowCompleteSurveyAutomatic */ onComplete: EventBase; /** * An event that is raised before the survey displays a [preview of given answers](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#preview-page). Use this event to cancel the preview. * @see showPreviewBeforeComplete * @see showPreview * @see cancelPreview */ onShowingPreview: EventBase; /** * An event that is raised before the survey navigates to a specified URL. Use this event to change the URL or cancel the navigation. * @see navigateToUrl * @see navigateToUrlOnCondition */ onNavigateToUrl: EventBase; /** * An event that is raised when the survey [`state`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#state) changes to `"running"`. * @see firstPageIsStarted */ onStarted: EventBase; /** * An event that is raised to save incomplete survey results. Enable the [`sendResultOnPageNext`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#sendResultOnPageNext) property for this event to occur. * * For information on event handler parameters, refer to descriptions within the interface. * * Alternatively, you can handle the [`onCurrentPageChanged`](#onCurrentPageChanged) and [`onValueChanged`](#onValueChanged) events, as shown in the following demo: [Continue an Incomplete Survey](https://surveyjs.io/form-library/examples/survey-editprevious/). */ onPartialSend: EventBase; /** * An event that is raised before the current page is switched. * * @see currentPageNo * @see nextPage * @see prevPage **/ onCurrentPageChanging: EventBase; /** * An event that is raised after the current page is switched. * * @see currentPageNo * @see nextPage * @see prevPage */ onCurrentPageChanged: EventBase; /** * An event that is raised before a question value is changed. * @see setValue */ onValueChanging: EventBase; /** * An event that is raised after a question value is changed. * * For information on event handler parameters, refer to descriptions within the interface. * * To handle value changes in matrix cells or panels within a [Dynamic Panel](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model), use the [`onMatrixCellValueChanged`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onMatrixCellValueChanged) or [`onDynamicPanelValueChanged`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onDynamicPanelValueChanged) event. * @see setValue */ onValueChanged: EventBase; /** * An event that is raised after a [variable](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#variables) or [calculated value](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#calculated-values) is changed. * * @see setVariable * @see calculatedValues */ onVariableChanged: EventBase; /** * An event that is raised after question visibility is changed. * * For information on event handler parameters, refer to descriptions within the interface. * * Refer to the following help topic for information on how to implement conditional visibility: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#conditional-visibility). */ onQuestionVisibleChanged: EventBase; onVisibleChanged: EventBase; /** * An event that is raised after page visibility is changed. * * For information on event handler parameters, refer to descriptions within the interface. * * Refer to the following help topic for information on how to implement conditional visibility: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#conditional-visibility). */ onPageVisibleChanged: EventBase; /** * An event that is raised after panel visibility is changed. * * For information on event handler parameters, refer to descriptions within the interface. * * Refer to the following help topic for information on how to implement conditional visibility: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#conditional-visibility). */ onPanelVisibleChanged: EventBase; /** * An event that is raised when the survey creates any new object derived from [`Question`](https://surveyjs.io/form-library/documentation/api-reference/question). * * In a survey, complex elements ([Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/), [Multiple Text](https://surveyjs.io/form-library/examples/questiontype-multipletext/), and [Dynamic Panel](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/)) are composed of questions. Use this event to customize any question regardless of which survey element it belongs to. * * For information on event handler parameters, refer to descriptions within the interface. * * To use this event for questions loaded from JSON, create an empty survey model, add an event handler, and only then populate the model from the JSON object: * * ```js * import { Model } from "survey-core"; * * const surveyJson = { * // ... * }; * // Create an empty model * const survey = new Model(); * // Add an event handler * survey.onQuestionCreated.add((sender, options) => { * //... * }); * // Load the survey JSON schema * survey.fromJSON(surveyJson); * ``` * @see onQuestionAdded */ onQuestionCreated: EventBase; /** * An event that is raised when a new question is added to a panel or page. * * For information on event handler parameters, refer to descriptions within the interface. * * To use this event for questions loaded from JSON, create an empty survey model, add an event handler, and only then populate the model from the JSON object: * * ```js * import { Model } from "survey-core"; * * const surveyJson = { * // ... * }; * // Create an empty model * const survey = new Model(); * // Add an event handler * survey.onQuestionAdded.add((sender, options) => { * //... * }); * // Load the survey JSON schema * survey.fromJSON(surveyJson); * ``` * @see onQuestionCreated */ onQuestionAdded: EventBase; /** * An event that is raised after a question is deleted from the survey. */ onQuestionRemoved: EventBase; /** * An event that is raised when a new panel is added to a page. */ onPanelAdded: EventBase; /** * An event that is raised after a panel is deleted from the survey. */ onPanelRemoved: EventBase; /** * An event that is raised when a new page is added to the survey. * @see PanelModel */ onPageAdded: EventBase; /** * An event that is raised when a question value is being validated. Use this event to specify a custom error message. * * For information on event handler parameters, refer to descriptions within the interface. * * [View Demo](https://surveyjs.io/form-library/examples/add-custom-input-validation/ (linkStyle)) * @see onServerValidateQuestions * @see onValidatePanel * @see onMatrixCellValidate * @see onSettingQuestionErrors */ onValidateQuestion: EventBase; /** * An event that is raised before errors are assigned to a question. Use this event to add/remove/modify errors. * @see onValidateQuestion */ onSettingQuestionErrors: EventBase; /** * Use this event to validate data on your server. * * For information on event handler parameters, refer to descriptions within the interface. * * [View Demo](https://surveyjs.io/form-library/examples/javascript-server-side-form-validation/ (linkStyle)) * @see onValidateQuestion * @see onValidatePanel * @see isValidatingOnServer */ onServerValidateQuestions: EventBase; /** * An event that is raised when a panel is being validated. Use this event to specify a custom error message. * * For information on event handler parameters, refer to descriptions within the interface. * * [View Demo](https://surveyjs.io/form-library/examples/add-custom-input-validation/ (linkStyle)) * @see onValidateQuestion * @see onServerValidateQuestions */ onValidatePanel: EventBase; /** * An event that is raised to change default error messages. */ onErrorCustomText: EventBase; /** * An event that is raised when the [current page](#currentPage) is being validated. Handle this event to be notified of current page validation. */ onValidatedErrorsOnCurrentPage: EventBase; /** * An event that is raised when the survey processes HTML content. Handle this event to modify HTML content before displaying. * @see completedHtml * @see loadingHtml * @see QuestionHtmlModel.html */ onProcessHtml: EventBase; /** * Use this event to change a question's display text. */ onGetQuestionDisplayValue: EventBase; /** * An event that is raised before the survey displays a question title. Handle this event to modify question titles. * * For information on event handler parameters, refer to descriptions within the interface. * * If you want to modify question numbers, handle the [`onGetQuestionNumber`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onGetQuestionNumber) event. * @see requiredText */ onGetQuestionTitle: EventBase; /** * An event that is raised when the survey calculates heading levels (`

`, `

`, etc.) for a survey, page, panel, and question title. Handle this event to change the heading level of individual titles. * * For information on event handler parameters, refer to descriptions within the interface. * * If you want to specify heading levels for all titles, use the [`titleTags`](https://surveyjs.io/form-library/documentation/api-reference/settings#titleTags) object in [global settings](https://surveyjs.io/form-library/documentation/api-reference/settings). * * [View Demo](https://surveyjs.io/form-library/examples/survey-titletagnames/ (linkStyle)) * @see onGetQuestionTitle * @see onGetQuestionNumber */ onGetTitleTagName: EventBase; /** * An event that is raised before the survey calculates a question number. Handle this event to modify question numbers. * * For information on event handler parameters, refer to descriptions within the interface. * * If you want to hide question numbers, disable the [`showQuestionNumbers`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#showQuestionNumbers) property. * @see onGetQuestionTitle * @see questionStartIndex */ onGetQuestionNumber: EventBase; /** * Obsolete. Use the [`onGetQuestionNumber`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onGetQuestionNumber) event instead. * @deprecated */ onGetQuestionNo: EventBase; /** * An event that is raised before the survey calculates a panel number. Handle this event to modify panel numbers. * * This event is raised only for the panels with a [specified title](https://surveyjs.io/form-library/documentation/api-reference/panel-model#title) and [visible number](https://surveyjs.io/form-library/documentation/api-reference/panel-model#showNumber). */ onGetPanelNumber: EventBase; /** * An event that is raised before the survey calculates a page number. Handle this event to modify page numbers. * * This event is raised only if the [`showPageNumbers`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#showPageNumbers) property is enabled. * * For information on event handler parameters, refer to descriptions within the interface. * @see onGetQuestionTitle * @see questionStartIndex */ onGetPageNumber: EventBase; /** * An event that is raised before the survey displays progress text. Handle this event to change the progress text in code. * @see showProgressBar * @see progressBarType */ onGetProgressText: EventBase; /** * Obsolete. Use the [`onGetProgressText`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onGetProgressText) event instead. * @deprecated */ onProgressText: EventBase; /** * An event that is raised to convert Markdown content to HTML. * * For information on event handler parameters, refer to descriptions within the interface. * * [View Demo](https://surveyjs.io/form-library/examples/edit-survey-questions-markdown/ (linkStyle)) */ onTextMarkdown: EventBase; onTextRenderAs: EventBase; /** * An event that is raised after a request to save survey results on [SurveyJS Service](https://api.surveyjs.io/) has been completed. Use this event to find out if the results have been saved successfully. */ onSendResult: EventBase; /** * An event that is raised when the [`getResult(resultId, questionName)`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#getResult) method is called. Use this event to obtain answers to an individual question from [SurveyJS Service](https://api.surveyjs.io/). * @see getResult */ onGetResult: EventBase; /** * An event that is raised when a respondent opens a dialog window to select files. * @see chooseFiles */ onOpenFileChooser: EventBase; /** * An event that is raised when a File Upload or Signature Pad question starts to upload a file. Applies only if [`storeDataAsText`](https://surveyjs.io/form-library/documentation/api-reference/file-model#storeDataAsText) is `false`. Use this event to upload files to your server. * * For information on event handler parameters, refer to descriptions within the interface. * * [View Demo](https://surveyjs.io/form-library/examples/file-upload/ (linkStyle)) * @see uploadFiles * @see onDownloadFile * @see onClearFiles */ onUploadFiles: EventBase; /** * An event that is raised when a File Upload question starts to download a file. Use this event to implement file preview when your server stores only file names. * * For information on event handler parameters, refer to descriptions within the interface. * * [View Demo](https://surveyjs.io/form-library/examples/store-file-names-in-survey-results/ (linkStyle)) * @see downloadFile * @see onClearFiles * @see onUploadFiles */ onDownloadFile: EventBase; /** * An event that is raised when users clear files in a [File Upload](https://surveyjs.io/form-library/documentation/api-reference/file-model) question or clear signature in a [Signature Pad](https://surveyjs.io/form-library/documentation/api-reference/signature-pad-model) question. Use this event to delete files from your server. * * For information on event handler parameters, refer to descriptions within the interface. * * [View Demo](https://surveyjs.io/form-library/examples/file-delayed-upload/ (linkStyle)) * @see clearFiles * @see onDownloadFile * @see onUploadFiles */ onClearFiles: EventBase; /** * An event that is raised after choices are loaded from a server but before they are assigned to a choice-based question, such as [Dropdown](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model) or [Checkboxes](https://surveyjs.io/form-library/documentation/api-reference/checkbox-question-model). Handle this event if you need to modify the loaded choices. */ onLoadChoicesFromServer: EventBase; /** * An event that is raised after a survey JSON schema is loaded from the [SurveyJS Service](https://api.surveyjs.io). Use this event to modify the loaded schema. * @see surveyId * @see clientId * @see loadSurveyFromService */ onLoadedSurveyFromService: EventBase; /** * An event that is raised when the survey processes [dynamic texts](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#dynamic-texts) and any text in curly brackets. Use this event, for instance, to substitute parameters in a RESTful URL with real values when you [load choices by URL](https://surveyjs.io/form-library/documentation/api-reference/checkbox-question-model#choicesByUrl). */ onProcessTextValue: EventBase; /** * An event that is raised before rendering a question. Use it to override default question CSS classes. * * For information on event handler parameters, refer to descriptions within the interface. * * [View Demo](https://surveyjs.io/form-library/examples/customize-survey-with-css/ (linkStyle)) * @see css */ onUpdateQuestionCssClasses: EventBase; /** * An event that is raised before rendering a standalone panel and panels within [Dynamic Panel](https://surveyjs.io/form-library/examples/duplicate-group-of-fields-in-form/). Use it to override default panel CSS classes. * * For information on event handler parameters, refer to descriptions within the interface. * * [View Demo](https://surveyjs.io/form-library/examples/customize-survey-with-css/ (linkStyle)) * @see css */ onUpdatePanelCssClasses: EventBase; /** * An event that is raised before rendering a page. Use it to override default page CSS classes. * * For information on event handler parameters, refer to descriptions within the interface. * * [View Demo](https://surveyjs.io/form-library/examples/customize-survey-with-css/ (linkStyle)) * @see css */ onUpdatePageCssClasses: EventBase; /** * An event that is raised before rendering a choice item in Radio Button Group and Checkboxes questions. Use it to override default CSS classes applied to choice items. * * For information on event handler parameters, refer to descriptions within the interface. * * [View Demo](https://surveyjs.io/form-library/examples/customize-survey-with-css/ (linkStyle)) * @see css */ onUpdateChoiceItemCss: EventBase; /** * An event that is raised after the survey is rendered to the DOM. Use this event to modify survey markup. * * For information on event handler parameters, refer to descriptions within the interface. * * [View Demo](https://surveyjs.io/form-library/examples/survey-animation/ (linkStyle)) */ onAfterRenderSurvey: EventBase; onAfterRenderHeader: EventBase; /** * An event that is raised after a page is rendered to the DOM. Use it to modify page markup. * * For information on event handler parameters, refer to descriptions within the interface. * * [View Demo](https://surveyjs.io/form-library/examples/survey-afterrender/ (linkStyle)) */ onAfterRenderPage: EventBase; /** * An event that is raised after a question is rendered to the DOM. Use it to modify question markup. * * For information on event handler parameters, refer to descriptions within the interface. * * [View Demo](https://surveyjs.io/form-library/examples/survey-afterrender/ (linkStyle)) */ onAfterRenderQuestion: EventBase; /** * An event that is raised after a question with a single input field is rendered to the DOM. Use it to modify question markup. * * For information on event handler parameters, refer to descriptions within the interface. * * > This event is not raised for questions without input fields ([HTML](https://surveyjs.io/form-library/documentation/questionhtmlmodel), [Image](https://surveyjs.io/form-library/documentation/questionimagemodel)) or questions with multiple input fields ([Matrix](https://surveyjs.io/form-library/documentation/questionmatrixmodel), [Multiple Text](https://surveyjs.io/form-library/documentation/questionmultipletextmodel)). */ onAfterRenderQuestionInput: EventBase; /** * An event that is raised after a panel is rendered to the DOM. Use it to modify panel markup. * * For information on event handler parameters, refer to descriptions within the interface. * * > This event is raised for static [Panels](https://surveyjs.io/form-library/examples/set-properties-on-multiple-questions-using-panel/) as well as panels within a [Dynamic Panel](https://surveyjs.io/form-library/examples/duplicate-group-of-fields-in-form/). */ onAfterRenderPanel: EventBase; /** * An event that is raised when an element (input field, checkbox, radio button) within a question gets focus. * @see onFocusInPanel * @see focusFirstQuestionAutomatic * @see focusQuestion */ onFocusInQuestion: EventBase; /** * An event that is raised when an element within a panel gets focus. * @see onFocusInQuestion * @see focusFirstQuestionAutomatic * @see focusQuestion */ onFocusInPanel: EventBase; /** * An event that is raised before a [choice item](https://surveyjs.io/form-library/documentation/api-reference/questionselectbase#choices) is displayed. Use this event to change the visibility of individual choice items in [Checkboxes](https://surveyjs.io/form-library/documentation/api-reference/checkbox-question-model), [Dropdown](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model), [Radio Button Group](https://surveyjs.io/form-library/documentation/api-reference/radio-button-question-model), and other similar question types. */ onShowingChoiceItem: EventBase; /** * Use this event to load choice items in [Dropdown](https://surveyjs.io/form-library/documentation/questiondropdownmodel) and [Tag Box](https://surveyjs.io/form-library/documentation/questiontagboxmodel) questions on demand. * * This event is raised only for those questions that have the [`choicesLazyLoadEnabled`](https://surveyjs.io/form-library/documentation/questiondropdownmodel#choicesLazyLoadEnabled) property set to `true`. * * For information on event handler parameters, refer to descriptions within the interface. * * [View Demo](https://surveyjs.io/form-library/examples/lazy-loading-dropdown/ (linkStyle)) */ onChoicesLazyLoad: EventBase; /** * An event that is raised each time a search string in a [Dropdown](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model) or [Tag Box](https://surveyjs.io/form-library/documentation/api-reference/dropdown-tag-box-model) question changes. Use this event to implement custom filtering of choice options. * @see [QuestionDropdownModel.searchEnabled](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model#searchEnabled) * @see [QuestionDropdownModel.searchMode](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model#searchMode) */ onChoicesSearch: EventBase; /** * Use this event to load a display text for the [default choice item](https://surveyjs.io/form-library/documentation/questiondropdownmodel#defaultValue) in [Dropdown](https://surveyjs.io/form-library/documentation/questiondropdownmodel) and [Tag Box](https://surveyjs.io/form-library/documentation/questiontagboxmodel) questions. * * If you load choices from a server (use [`choicesByUrl`](https://surveyjs.io/form-library/documentation/questiondropdownmodel#choicesByUrl) or [`onChoicesLazyLoad`](https://surveyjs.io/form-library/documentation/surveymodel#onChoicesLazyLoad)), display texts become available only when data is loaded, which does not happen until a user opens the drop-down menu. However, a display text for a default choice item is required before that. In this case, you can load data individually for the default item within the `onGetChoiceDisplayValue` event handler. * * For information on event handler parameters, refer to descriptions within the interface. * * [View Demo](https://surveyjs.io/form-library/examples/lazy-loading-dropdown/ (linkStyle)) */ onGetChoiceDisplayValue: EventBase; /** * An event that is raised after a new row is added to a [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/). */ onMatrixRowAdded: EventBase; /** * An event that is raised before a new row is added to a [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/). */ onMatrixRowAdding: EventBase; /** * Obsolete. Use the [`onMatrixRowAdding`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onMatrixRowAdding) event instead. * @deprecated */ onMatrixBeforeRowAdded: EventBase; /** * An event that is raised before a row is deleted from a [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/). You can cancel row deletion and clear row data instead. * @see onMatrixRenderRemoveButton */ onMatrixRowRemoving: EventBase; /** * An event that is raised after a row is deleted from a [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/). * @see onMatrixRenderRemoveButton */ onMatrixRowRemoved: EventBase; /** * An event that is raised before rendering the Remove button in a row of a [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/). Use this event to hide the Remove button for individual matrix rows. * @see onMatrixRowRemoving * @see onMatrixRowRemoved */ onMatrixRenderRemoveButton: EventBase; /** * Obsolete. Use the [`onMatrixRenderRemoveButton`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onMatrixRenderRemoveButton) event instead. * @deprecated */ onMatrixAllowRemoveRow: EventBase; /** * An event that is raised after the visibility of an [expandable detail section](https://surveyjs.io/form-library/examples/add-expandable-details-section-under-matrix-rows/) is changed. This event can be raised for [Multi-Select](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list) and [Dynamic Matrix](https://surveyjs.io/form-library/documentation/api-reference/dynamic-matrix-table-question-model) questions. */ onMatrixDetailPanelVisibleChanged: EventBase; /** * An event that is raised before a cell in a [Multi-Select Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdropdown/) or [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/) is created. Use this event to change the type of individual matrix cells. * @see onAfterRenderMatrixCell */ onMatrixCellCreating: EventBase; /** * An event that is raised after a cell in a [Multi-Select Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdropdown/) or [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/) is created. * @see onAfterRenderMatrixCell */ onMatrixCellCreated: EventBase; /** * An event that is raised for every matrix cell after it is rendered to the DOM. * @see onMatrixCellCreated */ onAfterRenderMatrixCell: EventBase; /** * Obsolete. Use the [`onAfterRenderMatrixCell`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onAfterRenderMatrixCell) event instead. * @deprecated */ onMatrixAfterCellRender: EventBase; /** * An event that is raised after a cell value is changed in a [Multi-Select Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdropdown/) or [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/). * @see onMatrixRowAdding */ onMatrixCellValueChanged: EventBase; /** * An event that is raised before a cell value is changed in a [Multi-Select Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdropdown/) or [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/). Use this event to change the cell value. * @see onMatrixRowAdding */ onMatrixCellValueChanging: EventBase; /** * An event that is raised for [Multi-Select Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdropdown/) and [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/) questions when they validate a cell value. Use this event to display a custom error message based on a condition. * @see onMatrixRowAdding */ onMatrixCellValidate: EventBase; /** * An event that is raised after a new column is added to a [Multi-Select Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdropdown/) or [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/). */ onMatrixColumnAdded: EventBase; /** * An event that is raised on adding a new item in Multiple Text question. */ onMultipleTextItemAdded: EventBase; /** * An event that is raised after a new panel is added to a [Dynamic Panel](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/) question. */ onDynamicPanelAdded: EventBase; /** * An event that is raised after a panel is deleted from a [Dynamic Panel](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/) question. */ onDynamicPanelRemoved: EventBase; /** * An event that is raised before a panel is deleted from a [Dynamic Panel](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/) question. Use this event to cancel the deletion. */ onDynamicPanelRemoving: EventBase; /** * An event that is raised every second while the timer is running. * * Use the [`timeSpent`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#timeSpent) property to find out how many seconds have elapsed. * @see timeLimit * @see timeLimitPerPage * @see showTimer * @see timerLocation * @see startTimer */ onTimerTick: EventBase; /** * Obsolete. Use the [`onTimerTick`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onTimerTick) event instead. * @deprecated */ onTimer: EventBase; onTimerPanelInfoText: EventBase; /** * An event that is raised after a value is changed in a panel within a [Dynamic Panel](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/) question. */ onDynamicPanelValueChanged: EventBase; /** * @deprecated Use the [`onDynamicPanelValueChanged`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onDynamicPanelValueChanged) event instead. */ onDynamicPanelItemValueChanged: EventBase; /** * An event that is raised before a value is changed in a panel within a [Dynamic Panel](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/) question. */ onDynamicPanelValueChanging: EventBase; /** * An event that is raised before a [Dynamic Panel](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/) renders [tab titles](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#templateTabTitle). Use this event to change individual tab titles. * * For information on event handler parameters, refer to descriptions within the interface. * * [View Demo](https://surveyjs.io/form-library/examples/tabbed-interface-for-duplicate-group-option/ (linkStyle)) */ onGetDynamicPanelTabTitle: EventBase; /** * An event that is raised after the current panel is changed in a [Dynamic Panel](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/) question. */ onDynamicPanelCurrentIndexChanged: EventBase; /** * An event that is raised to define whether a question answer is correct. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey/create-a-quiz). */ onCheckAnswerCorrect: EventBase; /** * Obsolete. Use the [`onCheckAnswerCorrect`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onCheckAnswerCorrect) event instead. * @deprecated */ onIsAnswerCorrect: EventBase; /** * An event that is raised when users drag and drop survey elements while designing the survey in [Survey Creator](https://surveyjs.io/survey-creator/documentation/overview). Use this event to control drag and drop operations. * @see isDesignMode */ onDragDropAllow: EventBase; /** * An event this is raised before a survey element (usually page) is scrolled to the top. Use this event to cancel the scroll operation. */ onScrollToTop: EventBase; /** * Obsolete. Use the [`onScrollToTop`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onScrollToTop) event instead. * @deprecated */ onScrollingElementToTop: EventBase; onLocaleChangedEvent: EventBase; /** * An event that allows you to add, delete, or modify actions in a question title. * * For information on event handler parameters, refer to descriptions within the interface. * * [View Demo](https://surveyjs.io/form-library/examples/survey-titleactions/ (linkStyle)) * @see [IAction](https://surveyjs.io/form-library/documentation/api-reference/iaction) */ onGetQuestionTitleActions: EventBase; /** * An event that allows you to add, delete, or modify actions in a panel title. * @see [IAction](https://surveyjs.io/form-library/documentation/api-reference/iaction) */ onGetPanelTitleActions: EventBase; /** * An event that allows you to add, delete, or modify actions in a page title. * * For information on event handler parameters, refer to descriptions within the interface. * * [View Demo](https://surveyjs.io/form-library/examples/modify-titles-of-survey-elements/ (linkStyle)) * @see [IAction](https://surveyjs.io/form-library/documentation/api-reference/iaction) */ onGetPageTitleActions: EventBase; /** * An event that allows you to add, delete, or modify actions in the footer of a [Panel](https://surveyjs.io/form-library/documentation/panelmodel). This panel may belong to a [Dynamic Panel](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model) or be a standalone survey element. * @see [IAction](https://surveyjs.io/form-library/documentation/api-reference/iaction) */ onGetPanelFooterActions: EventBase; /** * An event that allows you to add, delete, or modify actions in rows of a [Dynamic Matrix](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/). * * For information on event handler parameters, refer to descriptions within the interface. * * [View Demo](https://surveyjs.io/form-library/examples/employee-information-form/ (linkStyle)) * @see [IAction](https://surveyjs.io/form-library/documentation/api-reference/iaction) */ onGetMatrixRowActions: EventBase; onElementContentVisibilityChanged: EventBase; /** * An event that is raised before an [Expression](https://surveyjs.io/form-library/documentation/api-reference/expression-model) question displays a value. Use this event to override the display value. */ onGetExpressionDisplayValue: EventBase; /** * An event that is raised after the visibility of a popup is changed. * * This event can be raised for [Single-](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model) and [Multi-Select Dropdown](https://surveyjs.io/form-library/documentation/api-reference/dropdown-tag-box-model) questions and [Rating Scale](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model) questions [rendered as drop-down menus](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#displayMode), and [Multi-Select Matrix](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list) questions that contain columns of the `"dropdown"` or `"tagbox"` [`cellType`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list#cellType). */ onPopupVisibleChanged: EventBase; /** * An event that is raised when users open a drop-down menu. * * This event can be raised for [Single-](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model) and [Multi-Select Dropdown](https://surveyjs.io/form-library/documentation/api-reference/dropdown-tag-box-model) questions, [Rating Scale](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model) questions [rendered as drop-down menus](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#displayMode), and [Multi-Select Matrix](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list) questions that contain columns of the `"dropdown"` or `"tagbox"` [`cellType`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list#cellType). Handle this event to change the drop-down menu type for specific questions or device types. */ onOpenDropdownMenu: EventBase; onElementWrapperComponentName: EventBase; onElementWrapperComponentData: EventBase; constructor(jsonObj?: any, renderedElement?: any); get sjsVersion(): string; set sjsVersion(val: string); processClosedPopup(question: IQuestion, popupModel: PopupModel): void; protected createTryAgainAction(): IAction; private createHtmlLocString; /** * A list of errors in a survey JSON schema. * @see ensureUniqueNames */ jsonErrors: Array; getType(): string; protected onPropertyValueChanged(name: string, oldValue: any, newValue: any): void; /** * Returns an array of all pages in the survey. * * To get an array of only visible pages, use the [`visiblePages`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#visiblePages) array. * @see PageModel */ get pages(): Array; renderCallback: () => void; render(element?: any): void; updateSurvey(newProps: any, oldProps?: any): void; getCss(): any; private cssValue; private updateCompletedPageCss; private updateCss; /** * Gets or sets an object in which keys are UI elements and values are CSS classes applied to them. * * [View Demo](https://surveyjs.io/form-library/examples/customize-survey-with-css/ (linkStyle)) */ get css(): any; set css(value: any); setCss(value: any, needMerge?: boolean): void; get cssTitle(): string; get cssNavigationComplete(): string; get cssNavigationPreview(): string; get cssNavigationEdit(): string; get cssNavigationPrev(): string; get cssNavigationStart(): string; get cssNavigationNext(): string; private get cssSurveyNavigationButton(); get bodyCss(): string; get bodyContainerCss(): string; completedCss: string; completedBeforeCss: string; loadingBodyCss: string; containerCss: string; fitToContainer: boolean; /** * Obsolete. Use the [`headerView`](https://surveyjs.io/form-library/documentation/api-reference/itheme#headerView) property within a theme instead. * @deprecated */ headerView: "advanced" | "basic"; protected insertAdvancedHeader(advHeader: Cover): void; /** * Specifies whether the [Complete page](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#complete-page) should display the [survey header](https://surveyjs.io/form-library/examples/brand-your-survey-header/). * * Possible values: * * - `true` - Displays the survey header on the Complete page. * - `false` - Hides the header when users reach the Complete page. * - `"auto"` (default) - Displays a header with the basic view, but hides a header with the advanced view (see the [`headerView`](https://surveyjs.io/form-library/documentation/api-reference/itheme#headerView) property description). * * > This property cannot be specified in the survey JSON schema. Use dot notation to specify it. */ showHeaderOnCompletePage: true | false | "auto"; private getNavigationCss; private lazyRenderingValue; showBrandInfo: boolean; enterKeyAction: "moveToNextEditor" | "loseFocus" | "default"; /** * Specifies whether to enable lazy rendering. * * In default mode, a survey renders the entire current page. With lazy rendering, the survey renders the page gradually as a user scrolls it. This helps reduce survey startup time and optimizes large surveys for low-end devices. * * Default value: `false` * * [View Demo](https://surveyjs.io/form-library/examples/survey-lazy/ (linkStyle)) * @see [settings.lazyRender](https://surveyjs.io/form-library/documentation/api-reference/settings#lazyRender) */ get lazyRendering(): boolean; set lazyRendering(val: boolean); get isLazyRendering(): boolean; lazyRenderingFirstBatchSizeValue: number; get lazyRenderingFirstBatchSize(): number; set lazyRenderingFirstBatchSize(val: number); protected _isLazyRenderingSuspended: boolean; get isLazyRenderingSuspended(): boolean; protected suspendLazyRendering(): void; protected releaseLazyRendering(): void; private updateLazyRenderingRowsOnRemovingElements; /** * A list of triggers in the survey. * * [Conditional Survey Logic (Triggers)](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#conditional-survey-logic-triggers (linkStyle)) * @see runTriggers * @see onTriggerExecuted */ get triggers(): Array; set triggers(val: Array); /** * An array of [calculated values](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#calculated-values). */ get calculatedValues(): Array; set calculatedValues(val: Array); /** * The identifier of a survey JSON schema to load from [SurveyJS Service](https://api.surveyjs.io). * * Refer to the following help topic for more information: [Store Survey Results in the SurveyJS Service](https://surveyjs.io/form-library/documentation/handle-survey-results-store#store-survey-results-in-the-surveyjs-service). * @see loadSurveyFromService * @see onLoadedSurveyFromService */ get surveyId(): string; set surveyId(val: string); /** * An identifier used to save survey results to [SurveyJS Service](https://api.surveyjs.io). * * Refer to the following help topic for more information: [Store Survey Results in the SurveyJS Service](https://surveyjs.io/form-library/documentation/handle-survey-results-store#store-survey-results-in-the-surveyjs-service). * @see onComplete * @see surveyShowDataSaving */ get surveyPostId(): string; set surveyPostId(val: string); /** * A user identifier (e-mail or other unique ID). * * If your application works with [SurveyJS Service](https://api.surveyjs.io), the ID ensures that users do not pass the same survey twice. On the second run, they will see the [Completed Before page](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#completedBeforeHtml). * @see cookieName */ get clientId(): string; set clientId(val: string); /** * A cookie name used to save information about survey completion. * * When this property has a value, the survey creates a cookie with the specified name on completion. This cookie helps ensure that users do not pass the same survey twice. On the second run, they will see the [Completed Before page](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#completedBeforeHtml). * @see clientId */ get cookieName(): string; set cookieName(val: string); /** * Specifies whether to save survey results when respondents switch between pages. Handle the [`onPartialSend`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onPartialSend) event to implement the save operation. * * Alternatively, you can handle the [`onCurrentPageChanged`](#onCurrentPageChanged) and [`onValueChanged`](#onValueChanged) events, as shown in the following demo: [Continue an Incomplete Survey](https://surveyjs.io/form-library/examples/survey-editprevious/). */ get sendResultOnPageNext(): boolean; set sendResultOnPageNext(val: boolean); /** * Specifies whether to show progress when the survey sends data to [SurveyJS Service](https://api.surveyjs.io). * * [View Demo](https://surveyjs.io/form-library/examples/save-survey-results-and-load-surveys-from-surveyjs-service/ (linkStyle)) * @see surveyPostId */ get surveyShowDataSaving(): boolean; set surveyShowDataSaving(val: boolean); /** * Specifies whether to focus the first question on the page on survey startup or when users switch between pages. * * Default value: `false` in v1.9.114 and later, `true` in earlier versions * @see focusOnFirstError * @see focusFirstQuestion * @see focusQuestion */ get focusFirstQuestionAutomatic(): boolean; set focusFirstQuestionAutomatic(val: boolean); /** * Specifies whether to focus the first question with a validation error on the current page. * * Default value: `true` * @see validate * @see focusFirstQuestionAutomatic */ get focusOnFirstError(): boolean; set focusOnFirstError(val: boolean); /** * Gets or sets the position of the Start, Next, Previous, and Complete navigation buttons and controls their visibility. * * Possible values: * * - `"bottom"` (default) - Displays the navigation buttons below survey content. * - `"top"` - Displays the navigation buttons above survey content. * - `"both"` - Displays the navigation buttons above and below survey content. * - `"none"` - Hides the navigation buttons. This setting may be useful if you [implement custom external navigation](https://surveyjs.io/form-library/examples/external-form-navigation-system/). * @see goNextPageAutomatic * @see showPrevButton * @see showCompleteButton */ get showNavigationButtons(): string | any; set showNavigationButtons(val: string | any); /** * Specifies whether to display the Previous button. Set this property to `false` if respondents should not move backward along the survey. * @see showNavigationButtons * @see showCompleteButton */ get showPrevButton(): boolean; set showPrevButton(val: boolean); /** * Specifies whether to display the Complete button. Set this property to `false` if respondents should not complete the survey. * @see showNavigationButtons * @see showPrevButton */ get showCompleteButton(): boolean; set showCompleteButton(val: boolean); /** * Gets or sets the visibility of the table of contents. * * Default value: `false` * * [View Demo](https://surveyjs.io/form-library/examples/toc-feature/ (linkStyle)) * @see tocLocation */ get showTOC(): boolean; set showTOC(val: boolean); /** * Gets or sets the position of the table of contents. Applies only when the table of contents is visible. * * Possible values: * * - `"left"` (default) * - `"right"` * * [View Demo](https://surveyjs.io/form-library/examples/toc-feature/ (linkStyle)) * @see showTOC */ get tocLocation(): "left" | "right"; set tocLocation(val: "left" | "right"); /** * Specifies whether to display the [survey title](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#title). * * [View Demo](https://surveyjs.io/form-library/examples/brand-your-survey-header/ (linkStyle)) * @see title */ get showTitle(): boolean; set showTitle(val: boolean); /** * Specifies whether to display [page titles](https://surveyjs.io/form-library/documentation/api-reference/page-model#title). */ get showPageTitles(): boolean; set showPageTitles(val: boolean); /** * Specifies whether to show the [complete page](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#complete-page). * @see onComplete * @see navigateToUrl */ get showCompletedPage(): boolean; set showCompletedPage(val: boolean); /** * A URL to which respondents should be navigated after survey completion. * @see onNavigateToUrl * @see navigateToUrlOnCondition */ get navigateToUrl(): string; set navigateToUrl(val: string); /** * An array of objects that allows you to navigate respondents to different URLs after survey completion. * * Each object should include the [`expression`](https://surveyjs.io/form-library/documentation/api-reference/urlconditionitem#url) and [`url`](https://surveyjs.io/form-library/documentation/api-reference/urlconditionitem#expression) properties. When `expression` evaluates to `true`, the survey navigates to the corresponding `url`. Refer to the following help topic for more information about expressions: [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions). * @see onNavigateToUrl * @see navigateToUrl */ get navigateToUrlOnCondition(): Array; set navigateToUrlOnCondition(val: Array); getNavigateToUrl(): string; private navigateTo; /** * Specifies one or multiple characters that designate required questions. * * Default value: `*` * * [View Demo](https://surveyjs.io/form-library/examples/modify-question-title/ (linkStyle)) */ get requiredText(): string; set requiredText(val: string); /** * Specifies whether to hide validation errors thrown by the Required validation in the UI. * * [Built-In Client-Side Validators](https://surveyjs.io/form-library/documentation/data-validation#built-in-client-side-validators (linkStyle)) * @see validationEnabled * @see validationAllowSwitchPages */ hideRequiredErrors: boolean; beforeSettingQuestionErrors(question: Question, errors: Array): void; beforeSettingPanelErrors(question: IPanel, errors: Array): void; private makeRequiredErrorsInvisible; /** * Specifies the initial number or letter from which to start question numbering. * * [Question Numbers](https://surveyjs.io/form-library/documentation/design-survey/configure-question-titles#question-numbers (linkStyle)) */ get questionStartIndex(): string; set questionStartIndex(val: string); /** * Specifies whether to store the "Other" option response in a separate property. * * Default value: `true` * * Respondents can leave comments when they select "Other" in choice-based questions, such as Dropdown or Checkboxes. Comment values are saved in a separate property. The property name is composed of the question `name` and [`commentSuffix`](#commentSuffix). However, you can use the question `name` as a key to store the comment value instead. Disable the `storeOthersAsComment` property in this case. * @see maxOthersLength */ get storeOthersAsComment(): boolean; set storeOthersAsComment(val: boolean); /** * Specifies the maximum text length in textual questions ([Single-Line Input](https://surveyjs.io/form-library/examples/text-entry-question/), [Long Text](https://surveyjs.io/form-library/examples/add-open-ended-question-to-a-form/), [Multiple Textboxes](https://surveyjs.io/form-library/examples/multiple-text-box-question/)), measured in characters. * * Default value: 0 (unlimited) * * You can override this setting for individual questions if you specify their [`maxLength`](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model#maxLength) property. * @see maxOthersLength */ get maxTextLength(): number; set maxTextLength(val: number); /** * Specifies the maximum text length for question comments. Applies to questions with the [`showCommentArea`](https://surveyjs.io/form-library/documentation/api-reference/question#showCommentArea) or [`showOtherItem`](https://surveyjs.io/form-library/documentation/api-reference/question#showOtherItem) property set to `true`. * * Default value: 0 (unlimited) * @see maxTextLength */ get maxOthersLength(): number; set maxOthersLength(val: number); /** * Specifies whether the survey switches to the next page automatically after a user answers all questions on the current page. * * Default value: `false` * * If you enable this property, the survey is also completed automatically. Set the [`allowCompleteSurveyAutomatic`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#allowCompleteSurveyAutomatic) property to `false` if you want to disable this behavior. * * > If any of the following questions is answered last, the survey does not switch to the next page: Checkboxes, Yes/No (Boolean) (rendered as Checkbox), Long Text, Signature, Image Picker (with Multi Select), File Upload, Single-Select Matrix (not all rows are answered), Dynamic Matrix, Dynamic Panel. * * [View Demo](https://surveyjs.io/form-library/examples/automatically-move-to-next-page-if-answer-selected/ (linkStyle)) * @see [`settings.autoAdvanceDelay`](https://surveyjs.io/form-library/documentation/api-reference/settings#autoAdvanceDelay) */ get goNextPageAutomatic(): boolean | "autogonext"; set goNextPageAutomatic(val: boolean | "autogonext"); /** * Specifies whether to complete the survey automatically after a user answers all questions on the last page. Applies only if the [`goNextPageAutomatic`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#goNextPageAutomatic) property is `true`. * * Default value: `true` * @see [`settings.autoAdvanceDelay`](https://surveyjs.io/form-library/documentation/api-reference/settings#autoAdvanceDelay) */ get allowCompleteSurveyAutomatic(): boolean; set allowCompleteSurveyAutomatic(val: boolean); /** * Specifies when the survey validates answers. * * Possible values: * * - `"onNextPage"` (default) - Triggers validation before the survey is switched to the next page or completed. * - `"onValueChanged"` - Triggers validation each time a question value is changed. * - `"onComplete"` - Triggers validation when a user clicks the Complete button. If previous pages contain errors, the survey switches to the page with the first error. * * > In SurveyJS Form Library v1.12.5 and earlier, the `"onValueChanged"` mode doesn't work with date input fields because of the way browsers process date values. In most browsers, the value is considered changed as soon as a user starts entering the date in a text input field. This means that a user may only enter the day without having the chance to enter the month and year before validation is triggered. For this reason, date input fields are validated before the survey is switched to the next page or completed. Starting with v1.12.6, `"onValueChanged"` works for date input fields as well as for input fields of other types. * * Refer to the following help topic for more information: [Data Validation](https://surveyjs.io/form-library/documentation/data-validation). * @see validationEnabled * @see validationAllowSwitchPages * @see validationAllowComplete * @see validate */ get checkErrorsMode(): string; set checkErrorsMode(val: string); /** * Specifies whether to trigger validation when a user focuses on an empty input field and then leaves it without making any changes. Applies only if [`checkErrorsMode`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#checkErrorsMode) is set to `"onValueChanged"`. * * Default value: `false` * * This property changes validation behavior for the following question types: * * - [Single-Line Input](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model) * - [Long Text](https://surveyjs.io/form-library/documentation/api-reference/comment-field-model) * - [Dropdown](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model) * @see validationEnabled * @see validationAllowSwitchPages * @see validationAllowComplete * @see validate */ get validateVisitedEmptyFields(): boolean; set validateVisitedEmptyFields(val: boolean); getValidateVisitedEmptyFields(): boolean; /** * Specifies whether to increase the height of [Long Text](https://surveyjs.io/form-library/examples/add-open-ended-question-to-a-form/) questions and other text areas to accommodate multi-line text content. * * Default value: `false` * * You can override this property for individual Long Text questions: [`autoGrow`](https://surveyjs.io/form-library/documentation/api-reference/comment-field-model#autoGrow). * @see allowResizeComment * @see commentAreaRows */ get autoGrowComment(): boolean; set autoGrowComment(val: boolean); /** * Specifies whether to display a resize handle for [Long Text](https://surveyjs.io/form-library/examples/add-open-ended-question-to-a-form/) questions and other text areas intended for multi-line text content. * * Default value: `true` * * You can override this property for individual Long Text questions: [`allowResize`](https://surveyjs.io/form-library/documentation/api-reference/comment-field-model#allowResize). * @see autoGrowComment * @see commentAreaRows */ get allowResizeComment(): boolean; set allowResizeComment(val: boolean); /** * Specifies the visible height of comment areas, measured in lines. Applies to the questions with the [`showCommentArea`](https://surveyjs.io/form-library/documentation/api-reference/question#showCommentArea) or [`showOtherItem`](https://surveyjs.io/form-library/documentation/api-reference/question#showOtherItem) property enabled. * * Default value: 2 * * The value of this property is passed on to the `rows` attribute of the underlying `