`.
*
* To apply several classes, separate them with a space character: `"myclass1 myclass2"`.
*
* [View Demo](/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 `
`. The `innerCss` property applies classes to the `
`.
*
* To apply several classes, separate them with a space character: `"myclass1 myclass2"`.
*
* [View Demo](/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;
/**
* 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](/form-library/examples/add-custom-navigation-button/ (linkStyle))
*/
visibleIndex?: number;
needSpace?: boolean;
ariaChecked?: boolean;
ariaExpanded?: boolean;
ariaRole?: string;
elementId?: string;
}
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, locOwner?: ILocalizableOwner): Action;
export abstract class BaseAction extends Base implements IAction {
private cssClassesValue;
tooltip: string;
showTitle: boolean;
innerCss: string;
active: boolean;
pressed: boolean;
data: any;
popupModel: any;
needSeparator: boolean;
template: string;
mode: actionModeType;
owner: ILocalizableOwner;
visibleIndex: number;
disableTabStop: boolean;
disableShrink: boolean;
disableHide: boolean;
needSpace: boolean;
ariaChecked: boolean;
ariaExpanded: boolean;
ariaRole: string;
id: string;
removePriority: number;
iconName: string;
iconSize: number;
css?: string;
minDimension: number;
maxDimension: number;
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;
getActionBarItemTitleCss(): string;
getActionBarItemCss(): string;
getActionRootCss(): string;
getTooltip(): string;
getIsTrusted(args: any): boolean;
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 {
innerItem: IAction;
private locTitleValue;
updateCallback: () => void;
private raiseUpdate;
constructor(innerItem: IAction);
private createLocTitle;
location?: string;
id: string;
private _visible;
locTooltipName?: string;
private _enabled;
action: (context?: any, isUserAction?: boolean) => 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;
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;
setEnabled(val: boolean): void;
getEnabled(): boolean;
setComponent(val: string): void;
getComponent(): string;
}
export class ActionDropdownViewModel {
private item;
private popupModel;
private funcKey;
constructor(item: Action);
private setupPopupCallbacks;
private removePopupCallbacks;
dispose(): void;
}
}
declare module "utils/responsivity-manager" {
import { Action } from "actions/action";
import { AdaptiveActionContainer } from "actions/adaptive-container";
interface IDimensions {
scroll: number;
offset: number;
}
export class ResponsivityManager {
protected container: HTMLDivElement;
private model;
private itemsSelector;
private dotsItemSize;
private resizeObserver;
private isInitialized;
protected minDimensionConst: number;
private separatorSize;
private separatorAddConst;
private paddingSizeConst;
private dotsSizeConst;
protected recalcMinDimensionConst: boolean;
getComputedStyle: (elt: Element) => CSSStyleDeclaration;
constructor(container: HTMLDivElement, model: AdaptiveActionContainer, itemsSelector: string, dotsItemSize?: number);
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);
protected getDimensions(): IDimensions;
protected getAvailableSpace(): number;
protected calcItemSize(item: HTMLDivElement): number;
protected calcActionDimensions(currentAction: Action, item: HTMLDivElement): void;
}
}
declare module "actions/adaptive-container" {
import { ListModel } from "list";
import { Action, actionModeType } from "actions/action";
import { ActionContainer } from "actions/container";
export class AdaptiveActionContainer
extends ActionContainer {
protected dotsItem: Action;
private responsivityManager;
minVisibleItemsCount: number;
isResponsivenessDisabled: boolean;
private hideItemsGreaterN;
private getVisibleItemsCount;
private updateItemMode;
private static ContainerID;
constructor();
get hiddenItemsListModel(): ListModel;
protected hiddenItemSelected(item: T): void;
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): void;
resetResponsivityManager(): void;
setActionsMode(mode: actionModeType): void;
dispose(): void;
}
}
declare module "survey-error" {
import { ISurveyErrorOwner } from "base-interfaces";
import { LocalizableString } from "localizablestring";
export class SurveyError {
text: string;
protected errorOwner: ISurveyErrorOwner;
private locTextValue;
visible: boolean;
constructor(text?: string, errorOwner?: ISurveyErrorOwner);
equalsTo(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 "defaultCss/defaultV2Css" {
export var surveyCss: any;
export var defaultV2Css: {
root: string;
rootMobile: string;
rootReadOnly: 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;
footer: string;
title: string;
description: string;
logo: string;
logoImage: string;
headerText: string;
headerClose: string;
navigationButton: string;
bodyNavigationButton: string;
completedPage: string;
timerRoot: string;
navigation: {
complete: string;
prev: string;
next: string;
start: string;
preview: string;
edit: string;
};
panel: {
asPage: string;
number: string;
title: string;
titleExpandable: 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;
nested: string;
invisible: string;
navigationButton: string;
compact: string;
};
paneldynamic: {
mainRoot: string;
empty: string;
root: 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;
progressText: string;
separator: string;
panelWrapper: string;
footer: string;
panelFooter: string;
footerButtonsContainer: string;
panelWrapperInRow: string;
progressBtnIcon: string;
noEntriesPlaceholder: string;
compact: string;
};
progress: string;
progressTop: string;
progressBottom: string;
progressBar: string;
progressText: string;
progressButtonsContainerCenter: string;
progressButtonsContainer: 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;
};
pageTitle: string;
pageDescription: string;
row: string;
rowMultiple: string;
rowCompact: string;
pageRow: string;
question: {
mainRoot: string;
flowRoot: string;
withFrame: string;
asCell: string;
answered: string;
header: string;
headerLeft: string;
headerTop: string;
headerBottom: string;
content: string;
contentLeft: string;
titleNumInline: string;
titleLeftRoot: string;
titleOnAnswer: string;
titleOnError: string;
title: string;
titleExpandable: string;
titleExpanded: string;
titleCollapsed: string;
titleDisabled: 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;
collapsed: string;
expanded: string;
nested: string;
invisible: string;
composite: string;
disabled: string;
};
image: {
mainRoot: string;
root: string;
image: string;
adaptive: string;
noImage: string;
noImageSvgIconId: string;
withFrame: string;
};
html: {
mainRoot: string;
root: string;
withFrame: string;
};
error: {
root: string;
icon: string;
item: string;
tooltip: string;
outsideQuestion: string;
aboveQuestion: string;
belowQuestion: string;
locationTop: string;
locationBottom: string;
};
checkbox: {
root: string;
rootRow: string;
rootMultiColumn: string;
item: string;
itemOnError: string;
itemSelectAll: string;
itemNone: string;
itemDisabled: 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;
rootRow: string;
rootMultiColumn: string;
item: string;
itemOnError: string;
itemInline: string;
label: string;
labelChecked: string;
itemDisabled: 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;
itemIndeterminate: string;
itemDisabled: string;
itemHover: string;
label: string;
switch: string;
disabledLabel: string;
sliderText: string;
slider: string;
sliderGhost: string;
radioItem: string;
radioItemChecked: 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;
controlCheckbox: string;
checkboxMaterialDecorator: string;
checkboxControlLabel: string;
svgIconCheckedId: string;
};
text: {
root: string;
small: string;
controlDisabled: string;
content: string;
remainingCharacterCounter: string;
onError: string;
};
multipletext: {
root: string;
itemLabel: string;
itemLabelOnError: string;
item: string;
itemTitle: string;
content: string;
row: string;
cell: string;
};
dropdown: {
root: string;
popup: string;
small: string;
selectWrapper: string;
other: string;
onError: string;
label: string;
item: string;
itemDisabled: string;
itemChecked: string;
itemHover: string;
itemControl: string;
itemDecorator: string;
cleanButton: string;
cleanButtonSvg: string;
cleanButtonIconId: string;
control: string;
controlInputFieldComponent: string;
controlValue: string;
controlDisabled: string;
controlEmpty: string;
controlLabel: string;
filterStringInput: string;
materialDecorator: string;
hintPrefix: string;
hintSuffix: string;
};
imagepicker: {
mainRoot: string;
root: string;
rootColumn: string;
item: string;
itemOnError: string;
itemInline: string;
itemChecked: string;
itemDisabled: 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;
rootVerticalAlignTop: string;
rootVerticalAlignMiddle: string;
rootAlternateRows: string;
rowError: string;
cell: string;
row: string;
headerCell: string;
rowTextCell: string;
label: string;
itemOnError: string;
itemValue: string;
itemChecked: string;
itemDisabled: string;
itemHover: string;
materialDecorator: string;
itemDecorator: string;
cellText: string;
cellTextSelected: string;
cellTextDisabled: string;
cellResponsiveTitle: string;
compact: string;
};
matrixdropdown: {
mainRoot: string;
rootScroll: string;
root: string;
rootVerticalAlignTop: string;
rootVerticalAlignMiddle: string;
tableWrapper: string;
rootAlternateRows: string;
cell: string;
itemCell: string;
row: string;
headerCell: string;
rowTextCell: string;
cellRequiredText: string;
detailButton: string;
detailButtonExpanded: string;
detailIcon: string;
detailIconExpanded: string;
detailIconId: string;
detailIconExpandedId: string;
actionsCell: string;
emptyCell: string;
verticalCell: string;
cellQuestionWrapper: string;
compact: string;
};
matrixdynamic: {
mainRoot: string;
rootScroll: string;
empty: string;
root: string;
tableWrapper: string;
content: string;
cell: string;
row: string;
itemCell: string;
headerCell: string;
rowTextCell: string;
cellRequiredText: string;
button: string;
detailRow: string;
detailButton: string;
detailButtonExpanded: string;
detailIcon: string;
detailIconExpanded: string;
detailIconId: string;
detailIconExpandedId: string;
detailPanelCell: string;
actionsCell: string;
buttonAdd: string;
buttonRemove: string;
iconAdd: string;
iconRemove: string;
dragElementDecorator: string;
iconDragElement: string;
footer: string;
emptyRowsSection: string;
iconDrag: string;
ghostRow: string;
emptyCell: string;
verticalCell: string;
cellQuestionWrapper: string;
compact: string;
};
rating: {
rootDropdown: string;
root: string;
rootWrappable: string;
item: string;
itemOnError: string;
itemHover: string;
selected: string;
itemStar: string;
itemStarOnError: string;
itemStarHover: string;
itemStarSelected: string;
itemStarDisabled: string;
itemStarHighlighted: string;
itemStarUnhighlighted: string;
itemStarSmall: string;
itemSmiley: string;
itemSmileyOnError: string;
itemSmileyHover: string;
itemSmileySelected: string;
itemSmileyDisabled: string;
itemSmileyHighlighted: string;
itemSmileyScaleColored: string;
itemSmileyRateColored: string;
itemSmileySmall: string;
minText: string;
itemText: string;
maxText: string;
itemDisabled: string;
itemFixedSize: string;
control: string;
itemSmall: string;
controlValue: string;
controlDisabled: string;
controlEmpty: string;
filterStringInput: string;
popup: string;
onError: string;
};
comment: {
root: string;
small: string;
controlDisabled: string;
content: string;
remainingCharacterCounter: string;
onError: string;
};
expression: string;
file: {
root: string;
other: string;
placeholderInput: string;
preview: 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;
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;
single: string;
singleImage: string;
mobile: string;
};
signaturepad: {
mainRoot: string;
root: string;
small: string;
controls: string;
placeholder: string;
clearButton: string;
clearButtonIconId: string;
};
saveData: {
root: string;
info: string;
error: string;
success: string;
button: string;
shown: string;
};
window: {
root: string;
body: string;
header: {
root: string;
title: string;
button: string;
buttonExpanded: string;
buttonCollapsed: string;
};
};
ranking: {
root: string;
rootMobileMod: string;
rootDragMod: string;
rootDisabled: string;
rootDesignMode: string;
rootDragHandleAreaIcon: string;
item: string;
itemContent: string;
itemIndex: string;
itemIndexEmptyMode: string;
controlLabel: string;
itemGhostNode: string;
itemIconContainer: string;
itemIcon: string;
itemIconHoverMod: string;
itemIconFocusMod: string;
itemGhostMod: string;
itemDragMod: string;
itemOnError: 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;
};
actionBar: {
root: string;
item: string;
defaultSizeMode: string;
smallSizeMode: string;
itemPressed: string;
itemAsIcon: string;
itemIcon: string;
itemTitle: string;
};
variables: {
mobileWidth: string;
imagepickerGapBetweenItems: string;
themeMark: string;
};
tagbox: {
root: string;
popup: string;
small: string;
selectWrapper: string;
other: string;
onError: string;
label: string;
item: string;
itemDisabled: string;
itemChecked: string;
itemHover: string;
itemControl: string;
itemDecorator: string;
cleanButton: string;
cleanButtonSvg: string;
cleanButtonIconId: string;
cleanItemButton: string;
cleanItemButtonSvg: string;
cleanItemButtonIconId: string;
control: string;
controlValue: string;
controlValueItems: string;
placeholderInput: string;
controlDisabled: string;
controlEmpty: string;
controlLabel: string;
filterStringInput: string;
materialDecorator: string;
hint: string;
hintPrefix: string;
hintSuffix: string;
hintSuffixWrapper: string;
};
};
export const defaultV2ThemeName = "defaultV2";
}
declare module "trigger" {
import { HashTable } from "helpers";
import { Base } from "base";
import { ISurvey } from "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 usedNames;
private hasFunction;
private idValue;
constructor();
get id(): number;
getType(): string;
toString(): string;
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;
checkExpression(isOnNextPage: boolean, isOnComplete: boolean, keys: any, values: HashTable, properties?: HashTable): void;
check(value: any): void;
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;
private buildUsedNames;
private get isRequireValue();
}
export interface ISurveyTriggerOwner {
getObjects(pages: string[], questions: string[]): any[];
setCompleted(): void;
canBeCompleted(trigger: Trigger, isCompleted: boolean): void;
triggerExecuted(trigger: Trigger): void;
setTriggerValue(name: string, value: any, isVariable: boolean): any;
copyTriggerValue(name: string, fromName: string): any;
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;
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 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 onSuccess(values: HashTable, properties: HashTable): void;
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);
getType(): string;
protected onSuccess(values: HashTable, properties: HashTable): void;
}
}
declare module "calculatedValue" {
import { HashTable } from "helpers";
import { Base } from "base";
import { ISurvey, ISurveyData } from "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 "questionfactory" {
import { Question } from "question";
import { IElement } from "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): 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): void;
registerCustomQuestion: (questionType: string) => void;
clear(): void;
unregisterElement(elementType: string, removeFromSerializer?: boolean): void;
getAllTypes(): Array;
createElement(elementType: string, name: string): IElement;
}
}
declare module "error" {
import { SurveyError } from "survey-error";
import { ISurveyErrorOwner } from "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 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 "drag-drop-helper-v1" {
import { IElement, ISurveyElement } from "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 "drag-drop-panel-helper-v1" {
import { IElement, ISurveyElement } from "base-interfaces";
import { DragDropInfo } from "drag-drop-helper-v1";
import { PanelModelBase, QuestionRowModel } from "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 "panel" {
import { HashTable } from "helpers";
import { Base } from "base";
import { ISurveyImpl, IPage, IPanel, IConditionRunner, IElement, ISurveyElement, IQuestion, ISurveyErrorOwner, ITitleOwner, IProgressInfo, ISurvey, IFindElement } from "base-interfaces";
import { DragTypeOverMeEnum, SurveyElement } from "survey-element";
import { Question } from "question";
import { LocalizableString } from "localizablestring";
import { findScrollableParent } from "utils/utils";
import { SurveyError } from "survey-error";
import { IAction } from "actions/action";
import { ActionContainer } from "actions/container";
import { DragDropInfo } from "drag-drop-helper-v1";
export class QuestionRowModel extends Base {
panel: PanelModelBase;
private static rowCounter;
private static getRowId;
protected _scrollableParent: any;
protected _updateVisibility: any;
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;
get elements(): Array;
get visibleElements(): Array;
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;
setElementMaxMinWidth(el: IElement): void;
private getRenderedCalcWidth;
private getElementWidth;
private getRenderedWidthFromWidth;
private calcVisible;
private needToUpdateVisibleElements;
dragTypeOverMe: DragTypeOverMeEnum;
dispose(): void;
getRowCss(): string;
}
/**
* 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;
addElementCallback: (element: IElement) => void;
removeElementCallback: (element: IElement) => void;
onGetQuestionTitleLocation: () => string;
private dragDropPanelHelper;
constructor(name?: string);
getType(): string;
setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void;
endLoadingFromJson(): void;
showTitle: boolean;
get hasTitle(): boolean;
protected canShowTitle(): boolean;
showDescription: boolean;
get _showDescription(): boolean;
localeChanged(): void;
locStrsChanged(): void;
/**
* 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): void;
/**
* 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 this question to a different survey element.
*
* This property is always `null` for the `PageModel` 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);
/**
* Returns `true` if the survey element is a panel.
* @see Base.getType
*/
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;
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;
/**
* 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;
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;
/**
* 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;
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;
protected getStartIndex(): string;
getQuestionStartIndex(): string;
getChildrenLayoutType(): string;
getProgressInfo(): IProgressInfo;
get root(): PanelModelBase;
protected childVisibilityChanged(): void;
createRowAndSetLazy(index: number): QuestionRowModel;
createRow(): QuestionRowModel;
onSurveyLoad(): void;
onFirstRendering(): void;
updateRows(): void;
get rows(): Array;
ensureRowsVisibility(): void;
protected onRowsChanged(): void;
protected onAddElement(element: IElement, index: number): void;
protected onRemoveElement(element: IElement): void;
private onElementVisibilityChanged;
private onElementStartWithNewLineChanged;
private updateRowsVisibility;
canBuildRows(): boolean;
private buildRows;
private isLazyRenderInRow;
protected canRenderFirstRows(): boolean;
getDragDropInfo(): any;
private updateRowsOnElementRemoved;
updateRowsRemoveElementFromRow(element: IElement, row: QuestionRowModel): 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);
protected onVisibleChanged(): 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;
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;
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 elements
* @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): 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;
get no(): string;
dispose(): 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;
onSurveyLoad(): void;
protected onSetData(): void;
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);
delete(): 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;
getTitleOwner(): ITitleOwner;
/**
* 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;
protected setNo(visibleIndex: number): void;
protected beforeSetVisibleIndex(index: number): number;
protected getPanelStartIndex(index: number): number;
protected isContinueNumbering(): boolean;
private notifySurveyOnVisibilityChanged;
protected hasErrorsCore(rec: any): void;
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);
private onIndentChanged;
private getIndentSize;
clearOnDeletingContainer(): void;
get footerActions(): Array;
private footerToolbarValue;
private footerToolbarCssValue;
set footerToolbarCss(val: string);
get footerToolbarCss(): string;
onGetFooterActionsCallback: () => Array;
getFooterToolbar(): ActionContainer;
get hasEditButton(): boolean;
cancelPreview(): void;
get cssTitle(): string;
get cssError(): string;
get showErrorsAbovePanel(): boolean;
protected getCssError(cssClasses: any): string;
protected onVisibleChanged(): void;
needResponsiveWidth(): boolean;
focusIn(): void;
protected getHasFrameV2(): boolean;
protected getIsNested(): boolean;
protected getCssRoot(cssClasses: {
[index: string]: string;
}): string;
getContainerCss(): string;
}
}
declare module "question_file" {
import { Question } from "question";
import { EventBase } from "base";
import { SurveyError } from "survey-error";
import { ActionContainer } from "actions/container";
import { Action } from "actions/action";
/**
* A class that describes the File question type.
*
* [View Demo](https://surveyjs.io/form-library/examples/questiontype-file/ (linkStyle))
*/
export class QuestionFileModel extends Question {
private isUploading;
isDragging: boolean;
/**
* 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;
previewValue: any[];
currentState: string;
indexToShow: number;
containsMultiplyFiles: boolean;
mobileFileNavigator: ActionContainer;
protected prevFileAction: Action;
protected nextFileAction: Action;
protected fileIndexAction: Action;
get mobileFileNavigatorVisible(): boolean;
constructor(name: string);
protected updateElementCssCore(cssClasses: any): void;
private getFileIndexCaption;
isPreviewVisible(index: number): boolean;
getType(): string;
clearOnDeletingContainer(): 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 store file 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);
/**
* 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);
/**
* 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;
clearButtonCaption: string;
removeFileCaption: string;
loadingFileTitle: string;
chooseFileTitle: string;
dragAreaPlaceholder: string;
get inputTitle(): string;
clear(doneCallback?: () => void): void;
get multipleRendered(): string;
get showRemoveButton(): any;
get showRemoveButtonBottom(): any;
defaultImage(data: any): boolean;
/**
* Removes a file with a specified name.
*/
removeFile(name: string): void;
protected removeFileByContent(content: 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;
canPreviewImage(fileItem: any): boolean;
protected loadPreview(newValue: any): void;
protected onCheckForErrors(errors: Array, isOnValueChanged: boolean): void;
protected stateChanged(state: string): void;
private allFilesOk;
private isFileImage;
getPlainData(options?: {
includeEmpty?: boolean;
calculations?: Array<{
propertyName: string;
}>;
}): import("question").IQuestionPlainData;
getChooseFileCss(): string;
getReadOnlyFileCss(): string;
get fileRootCss(): string;
getFileDecoratorCss(): string;
private onChange;
protected onChangeQuestionValue(newValue: any): void;
endLoadingFromJson(): void;
private rootElement;
afterRender(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: (event: any) => void;
doRemoveFile(data: any): void;
doDownloadFile: (event: any, data: any) => void;
}
export class FileLoader {
private fileQuestion;
private callback;
constructor(fileQuestion: QuestionFileModel, callback: (status: string, files: any[]) => void);
loaded: any[];
load(files: Array): void;
dispose(): void;
}
}
declare module "choicesRestful" {
import { Base } from "base";
import { ITextProcessor, IQuestion, ISurvey } from "base-interfaces";
import { ItemValue } from "itemvalue";
import { SurveyError } from "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.
*/
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 onBeforeSendRequest: (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;
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);
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 "question_baseselect" {
import { SurveyError } from "survey-error";
import { ISurveyImpl, ISurvey } from "base-interfaces";
import { Question } from "question";
import { ItemValue } from "itemvalue";
import { ChoicesRestful } from "choicesRestful";
import { LocalizableString } from "localizablestring";
import { HashTable } from "helpers";
/**
* A base class for multiple-choice question types ([Checkbox](https://surveyjs.io/form-library/documentation/questioncheckboxmodel), [Dropdown](https://surveyjs.io/form-library/documentation/questiondropdownmodel), [Radiogroup](https://surveyjs.io/form-library/documentation/questionradiogroupmodel), etc.).
*/
export class QuestionSelectBase extends Question {
visibleChoicesChangedCallback: () => void;
loadedChoicesFromServerCallback: () => void;
private filteredChoicesValue;
private conditionChoicesVisibleIfRunner;
private conditionChoicesEnableIfRunner;
private prevOtherValue;
private otherItemValue;
private choicesFromUrl;
private cachedValueForUrlRequests;
private isChoicesLoaded;
private enableOnLoadingChoices;
private dependedQuestions;
private noneItemValue;
private newItemValue;
private canShowOptionItemCallback;
private isUsingCarrayForward;
private waitingGetChoiceDisplayValueResponse;
protected selectedItemValues: any;
constructor(name: string);
getType(): string;
dispose(): void;
get otherId(): string;
protected getCommentElementsId(): Array;
protected getItemValueType(): string;
createItemValue(value: any, text?: string): ItemValue;
supportGoNextPageError(): boolean;
isLayoutTypeSupported(layoutType: string): boolean;
localeChanged(): void;
locStrsChanged(): void;
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
*/
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;
/**
* 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 getSingleSelectedItem(): ItemValue;
protected onGetSingleSelectedItem(selectedItemByValue: ItemValue): void;
private setConditionalChoicesRunner;
private setConditionalEnableChoicesRunner;
private canSurveyChangeItemVisibility;
changeItemVisisbility(): (item: ItemValue, val: boolean) => boolean;
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;
clearValue(): void;
updateCommentFromSurvey(newValue: any): any;
get renderedValue(): any;
set renderedValue(val: any);
protected setQuestionValue(newValue: any, updateIsAnswered?: boolean, updateComment?: boolean): 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 updateSelectedItemValues(): void;
protected updateSingleSelectedItemValues(): void;
protected updateMultipleSelectedItemValues(): void;
protected hasUnknownValue(val: any, includeOther?: boolean, isFilteredChoices?: boolean, checkEmptyValue?: boolean): boolean;
protected isValueDisabled(val: any): boolean;
/**
* If the clearIncorrectValuesCallback is set, it is used to clear incorrect values instead of default behaviour.
*/
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.
*
* [View Demo](https://surveyjs.io/form-library/examples/questiontype-dropdownrestfull/ (linkStyle))
* @see choices
*/
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 Showdown](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
*/
get choices(): Array;
set choices(newValue: Array);
/**
* Inherits 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 inherited.
*
* In addition, you can specify the `choicesFromQuestionMode` property if you do not want to inherit all choice items.
* @see choicesFromQuestionMode
* @see choices
*/
get choicesFromQuestion(): string;
set choicesFromQuestion(val: string);
private addIntoDependedQuestion;
private removeFromDependedQuestion;
/**
* Specifies which choice items to inherit from another question. Applies only when the `choicesFromQuestion` property is specified.
*
* Possible values:
*
* - `"all"` (default) - Inherits all choice items.
* - `"selected"` - Inherits only selected choice items.
* - `"unselected"` - Inherits only unselected choice items.
*
* Use the `visibleChoices` property to access inherited choice items.
* @see choicesFromQuestion
* @see visibleChoices
*/
get choicesFromQuestionMode(): string;
set choicesFromQuestionMode(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.
*/
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
*/
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);
/**
* Get 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 canShowOptionItem(item: ItemValue, isAddAll: boolean, hasItem: boolean): boolean;
isItemInList(item: ItemValue): boolean;
protected get isAddDefaultItems(): boolean;
getPlainData(options?: {
includeEmpty?: boolean;
includeQuestionTypes?: boolean;
calculations?: Array<{
propertyName: string;
}>;
}): import("question").IQuestionPlainData;
protected getDisplayValueCore(keysAsText: boolean, value: any): any;
protected getDisplayValueEmpty(): string;
protected getChoicesDisplayValue(items: ItemValue[], val: any): any;
protected getDisplayArrayValue(keysAsText: boolean, value: any, onGetValueCallback?: (index: number) => any): string;
private getFilteredChoices;
protected get activeChoices(): Array;
private getQuestionWithChoices;
private getChoicesFromQuestion;
private copyChoiceItem;
protected get hasActiveChoices(): boolean;
protected isHeadChoice(item: ItemValue, question: QuestionSelectBase): boolean;
protected isFootChoice(item: ItemValue, question: QuestionSelectBase): boolean;
protected isBuiltInChoice(item: ItemValue, question: QuestionSelectBase): boolean;
protected getChoices(): Array;
supportOther(): boolean;
supportNone(): boolean;
protected isSupportProperty(propName: string): boolean;
protected onCheckForErrors(errors: Array, isOnValueChanged: boolean): void;
setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void;
protected setSurveyCore(value: ISurvey): void;
getStoreOthersAsComment(): boolean;
onSurveyLoad(): void;
onAnyValueChanged(name: string): void;
updateValueFromSurvey(newValue: any): 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 createCachedValueForUrlRequests;
private updateCachedValueForUrlRequests;
private isUpdatingChoicesDependedQuestions;
protected updateChoicesDependedQuestions(): void;
onSurveyValueChanged(newValue: any): void;
protected onVisibleChoicesChanged(): void;
protected isVisibleCore(): boolean;
private sortVisibleChoices;
private sortArray;
private randomizeArray;
clearIncorrectValues(): void;
protected hasValueToClearIncorrectValues(): boolean;
protected clearValueIfInvisibleCore(): 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 canClearValueAnUnknow(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;
get headItems(): ItemValue[];
get footItems(): ItemValue[];
get dataChoices(): ItemValue[];
get bodyItems(): ItemValue[];
get hasHeadItems(): boolean;
get hasFootItems(): boolean;
get columns(): any[];
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;
getAriaItemLabel(item: ItemValue): string;
getItemId(item: ItemValue): string;
get questionName(): string;
getItemEnabled(item: ItemValue): any;
protected rootElement: HTMLElement;
afterRender(el: HTMLElement): void;
beforeDestroyQuestionElement(el: HTMLElement): void;
private focusOtherComment;
private prevIsOtherSelected;
protected onValueChanged(): void;
protected getDefaultItemComponent(): string;
/**
* The name of a component used to render items.
*/
get itemComponent(): string;
set itemComponent(value: string);
protected updateCssClasses(res: any, css: any): void;
protected calcCssClasses(css: any): any;
}
/**
* 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);
/**
* Get 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);
clickItemHandler(item: ItemValue, checked: boolean): void;
protected onParentChanged(): void;
protected onParentQuestionChanged(): void;
protected getSearchableItemValueKeys(keys: Array): void;
}
}
declare module "question_expression" {
import { HashTable } from "helpers";
import { Question } from "question";
import { LocalizableString } from "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;
protected hasRequiredError(): boolean;
/**
* 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
*/
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): 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);
protected getValueAsStr(val: any): string;
}
export function getCurrecyCodes(): Array;
}
declare module "question_matrixdropdowncolumn" {
import { Question } from "question";
import { Base } from "base";
import { ISurvey, IWrapperObject } from "base-interfaces";
import { ItemValue } from "itemvalue";
import { ILocalizableOwner, LocalizableString } from "localizablestring";
import { SurveyValidator } from "validator";
import { MatrixDropdownRowModelBase } from "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;
getCellType(): string;
getCustomCellType(column: MatrixDropdownColumn, row: MatrixDropdownRowModelBase, cellType: string): string;
onColumnCellTypeChanged(column: MatrixDropdownColumn): void;
}
export var matrixDropdownColumnTypes: {
dropdown: {
onCellQuestionUpdate: (cellQuestion: any, column: any, question: any, data: any) => void;
};
checkbox: {
onCellQuestionUpdate: (cellQuestion: any, column: any, question: any, data: any) => void;
};
radiogroup: {
onCellQuestionUpdate: (cellQuestion: any, column: any, question: any, data: any) => void;
};
tagbox: {};
text: {};
comment: {};
boolean: {
onCellQuestionUpdate: (cellQuestion: any, column: any, question: any, data: any) => void;
};
expression: {};
rating: {};
};
export class MatrixDropdownColumn extends Base implements ILocalizableOwner, IWrapperObject {
static getColumnTypes(): Array;
private templateQuestionValue;
private colOwnerValue;
private indexValue;
private _isVisible;
private _hasVisibleCell;
constructor(name: string, title?: string);
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;
get cellType(): string;
set cellType(val: string);
get templateQuestion(): Question;
get value(): string;
get isVisible(): boolean;
setIsVisible(newVal: boolean): void;
get hasVisibleCell(): boolean;
set hasVisibleCell(newVal: boolean);
get name(): string;
set name(val: string);
get title(): string;
set title(val: string);
get locTitle(): LocalizableString;
get fullTitle(): string;
get isRequired(): boolean;
set isRequired(val: boolean);
get isRenderedRequired(): boolean;
set isRenderedRequired(val: boolean);
updateIsRenderedRequired(val: boolean): void;
get requiredText(): string;
get requiredErrorText(): string;
set requiredErrorText(val: string);
get locRequiredErrorText(): LocalizableString;
get readOnly(): boolean;
set readOnly(val: boolean);
get hasOther(): boolean;
set hasOther(val: boolean);
get visibleIf(): string;
set visibleIf(val: string);
get enableIf(): string;
set enableIf(val: string);
get requiredIf(): string;
set requiredIf(val: string);
get isUnique(): boolean;
set isUnique(val: boolean);
get showInMultipleColumns(): boolean;
set showInMultipleColumns(val: boolean);
get isSupportMultipleColumns(): boolean;
get isShowInMultipleColumns(): boolean;
get validators(): Array;
set validators(val: Array);
get totalType(): string;
set totalType(val: string);
get totalExpression(): string;
set totalExpression(val: string);
get hasTotal(): boolean;
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);
get totalDisplayStyle(): string;
set totalDisplayStyle(val: string);
get totalCurrency(): string;
set totalCurrency(val: string);
get minWidth(): string;
set minWidth(val: string);
get width(): string;
set width(val: string);
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): 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): void;
private doItemValuePropertyChanged;
private doShowInMultipleColumnsChanged;
private getProperties;
private removeProperties;
private addProperties;
private addProperty;
}
}
declare module "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 "utils/devices" {
export const IsMobile: boolean;
export let IsTouch: boolean;
export function _setIsTouch(val: boolean): void;
}
declare module "dragdrop/dom-adapter" {
import { IDragDropEngine } from "dragdrop/engine";
export interface IDragDropDOMAdapter {
startDrag(event: PointerEvent, draggedElement: any, parentElement: any, draggedElementNode: HTMLElement, preventSaveTargetNode: boolean): void;
draggedElementShortcut: HTMLElement;
}
export class DragDropDOMAdapter implements IDragDropDOMAdapter {
private dd;
private longTap?;
static PreventScrolling: boolean;
private timeoutID;
private startX;
private startY;
private currentX;
private currentY;
private savedTargetNode;
private scrollIntervalId;
constructor(dd: IDragDropEngine, longTap?: boolean);
private stopLongTapIfMoveEnough;
private get isMicroMovement();
private stopLongTap;
private startLongTapProcessing;
private handlePointerCancel;
private handleEscapeButton;
private onContextMenu;
private moveShortcutElement;
private getShortcutBottomCoordinate;
private getShortcutRightCoordinate;
private doScroll;
private dragOver;
private clear;
private drop;
private doStartDrag;
draggedElementShortcut: any;
startDrag(event: PointerEvent, draggedElement: any, parentElement?: any, draggedElementNode?: HTMLElement, preventSaveTargetNode?: boolean): void;
}
}
declare module "dragdrop/core" {
import { SurveyModel } from "survey";
import { EventBase } from "base";
import { IShortcutText, ISurvey } from "base-interfaces";
import { IDragDropEngine } from "dragdrop/engine";
import { IDragDropDOMAdapter } from "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>;
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;
dragInit(event: PointerEvent, draggedElement: any, parentElement?: any, draggedElementNode?: HTMLElement): void;
protected onStartDrag(): 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 "dragdrop/matrix-rows" {
import { MatrixDropdownRowModelBase } from "question_matrixdropdownbase";
import { QuestionMatrixDynamicModel } from "question_matrixdynamic";
import { DragDropCore } from "dragdrop/core";
export class DragDropMatrixRows extends DragDropCore {
protected get draggedElementType(): string;
protected createDraggedElementShortcut(text: string, draggedElementNode: HTMLElement, event: PointerEvent): HTMLElement;
private fromIndex;
private toIndex;
protected getDropTargetByDataAttributeValue(dataAttributeValue: any): MatrixDropdownRowModelBase;
protected isDropTargetValid(dropTarget: any, dropTargetNode?: HTMLElement): boolean;
protected calculateIsBottom(clientY: number): boolean;
protected afterDragOver(dropTargetNode: HTMLElement): void;
protected doDrop: () => QuestionMatrixDynamicModel;
clear(): void;
}
}
declare module "question_matrixdropdownrendered" {
import { Question } from "question";
import { Base } from "base";
import { ItemValue } from "itemvalue";
import { LocalizableString } from "localizablestring";
import { PanelModel } from "panel";
import { IAction } from "actions/action";
import { MatrixDropdownColumn } from "question_matrixdropdowncolumn";
import { MatrixDropdownCell, MatrixDropdownRowModelBase, QuestionMatrixDropdownModelBase } from "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;
requiredText: string;
isEmpty: boolean;
colSpans: number;
panel: PanelModel;
isShowHideDetail: boolean;
isActionsCell: boolean;
isDragHandlerCell: boolean;
private classNameValue;
constructor();
get hasQuestion(): boolean;
get hasTitle(): boolean;
get hasPanel(): boolean;
get id(): number;
get showErrorOnTop(): boolean;
get showErrorOnBottom(): boolean;
private showErrorOnCore;
private getShowErrorLocation;
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 headers(): string;
getTitle(): string;
calculateFinalClassName(matrixCssClasses: any): string;
}
export class QuestionMatrixDropdownRenderedRow extends Base {
cssClasses: any;
isDetailRow: boolean;
isGhostRow: boolean;
isAdditionalClasses: boolean;
row: MatrixDropdownRowModelBase;
private static counter;
private idValue;
cells: Array;
constructor(cssClasses: any, isDetailRow?: boolean);
get id(): number;
get attributes(): {
"data-sv-drop-target-matrix-row"?: undefined;
} | {
"data-sv-drop-target-matrix-row": string;
};
get className(): string;
}
export class QuestionMatrixDropdownRenderedTable extends Base {
matrix: QuestionMatrixDropdownModelBase;
private headerRowValue;
private footerRowValue;
private hasRemoveRowsValue;
private rowsActions;
private cssClasses;
renderedRowsChangedCallback: () => void;
rows: Array;
constructor(matrix: QuestionMatrixDropdownModelBase);
get showTable(): boolean;
get showHeader(): boolean;
get showAddRowOnTop(): boolean;
get showAddRowOnBottom(): boolean;
get showFooter(): boolean;
get hasFooter(): boolean;
get hasRemoveRows(): boolean;
isRequireReset(): boolean;
get headerRow(): QuestionMatrixDropdownRenderedRow;
get footerRow(): QuestionMatrixDropdownRenderedRow;
get allowRowsDragAndDrop(): boolean;
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;
private getRenderedRowIndex;
protected buildRowsActions(): void;
protected createRenderedRow(cssClasses: any, isDetailRow?: boolean): QuestionMatrixDropdownRenderedRow;
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 createHorizontalRow;
private addRowActionsCell;
private createDetailPanelRow;
private buildVerticalRows;
private createMutlipleVerticalRows;
private createVerticalRow;
private createEndVerticalActionRow;
private createMutlipleEditCells;
private setItemCellCssClasses;
private createEditCell;
private createMutlipleColumnsFooter;
private createMutlipleColumnsHeader;
private getMultipleColumnChoices;
private setHeaderCellCssClasses;
private createHeaderCell;
private setHeaderCell;
private setHeaderCellWidth;
private setRequriedToHeaderCell;
private createRemoveRowCell;
private createTextCell;
private createEmptyCell;
}
}
declare module "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 "question_matrixdynamic" {
import { QuestionMatrixDropdownModelBase, MatrixDropdownRowModelBase, IMatrixDropdownData } from "question_matrixdropdownbase";
import { LocalizableString } from "localizablestring";
import { SurveyError } from "survey-error";
import { DragDropMatrixRows } from "dragdrop/matrix-rows";
import { IShortcutText, ISurveyImpl, IProgressInfo } from "base-interfaces";
import { QuestionMatrixDropdownRenderedTable } from "question_matrixdropdownrendered";
import { MatrixDropdownColumn } from "question_matrixdropdowncolumn";
export class MatrixDynamicRowModel extends MatrixDropdownRowModelBase implements IShortcutText {
index: number;
private dragOrClickHelper;
constructor(index: number, data: IMatrixDropdownData, value: any);
get rowName(): 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;
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);
/**
* 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 setDefaultValue(): void;
moveRowByIndex(fromIndex: number, toIndex: number): void;
clearOnDrop(): void;
/**
* The number of rows in the matrix.
* @see minRowCount
* @see maxRowCount
*/
get rowCount(): number;
set rowCount(val: number);
protected updateProgressInfoByValues(res: IProgressInfo): void;
private getValueForNewRow;
/**
* Specifies whether users can drag and drop matrix rows to reorder them.
*
* Default value: `false`
*/
get allowRowsDragAndDrop(): boolean;
set allowRowsDragAndDrop(val: boolean);
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);
/**
* A maximum number of rows in the matrix. Users cannot add new rows if `rowCount` equals `maxRowCount`.
*
* Default value: 1000 (inherited from [`settings.matrixMaximumRowCount`](https://surveyjs.io/form-library/documentation/settings#matrixMaximumRowCount))
* @see rowCount
* @see minRowCount
* @see allowAddRows
*/
get maxRowCount(): number;
set maxRowCount(val: number);
/**
* 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;
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): void;
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(): LocalizableString;
/**
* A caption for the Add Row button.
* @see addRowLocation
*/
get addRowText(): string;
set addRowText(val: string);
get locAddRowText(): 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 `columnLayout` is `vertical`; `"bottom"` if `columnLayout` is `"horizontal"` or the matrix is in compact mode.
* @see columnLayout
* @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(): 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(): 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): void;
private hasErrorInMinRows;
protected getUniqueColumns(): Array;
protected generateRows(): Array;
protected createMatrixRow(value: any): MatrixDynamicRowModel;
private lastDeletedRow;
private getInsertedDeletedIndex;
private isEditingObjectValueChanged;
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 "textPreProcessor" {
import { Question } from "question";
import { PanelModel } from "panel";
import { ISurvey, ITextProcessor } from "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): string;
processValue(name: string, returnDisplayValue: boolean): TextPreProcessorValue;
get hasAllValuesOnLastRun(): boolean;
private getItems;
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(text: string, returnDisplayValue: boolean): any;
private processTextCore;
}
}
declare module "question_paneldynamic" {
import { HashTable } from "helpers";
import { IElement, IQuestion, IPanel, ISurveyData, ISurvey, ISurveyImpl, ITextProcessor, IProgressInfo } from "base-interfaces";
import { LocalizableString } from "localizablestring";
import { Question, IConditionObject } from "question";
import { PanelModel } from "panel";
import { SurveyError } from "survey-error";
import { ActionContainer } from "actions/container";
import { IAction } from "actions/action";
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;
}
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;
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 hasSingleInput(): boolean;
getFirstQuestionToFocus(withError: boolean): Question;
setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void;
private assignOnPropertyChangedToTemplate;
private addOnPropertyChangedCallback;
private onTemplateElementPropertyChanged;
private get useTemplatePanel();
getType(): string;
get isCompositeQuestion(): boolean;
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 zero-based index of a panel in the [`panels`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#panels) array.
* - `{visiblePanelIndex}` - A zero-based index of a panel in the [`visiblePanels`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#visiblePanels) array.
* @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 [`renderMode`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#renderMode) is `"tab"`.
*
* The template can contain the following placeholders:
*
* - `{panelIndex}` - A zero-based index of a panel in the [`panels`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#panels) array.
* - `{visiblePanelIndex}` - A zero-based index of a panel in the [`visiblePanels`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#visiblePanels) array.
* @see templateTitle
* @see renderMode
*/
get templateTabTitle(): string;
set templateTabTitle(newValue: string);
get locTemplateTabTitle(): 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;
private onPanelAdded;
private onPanelRemoved;
private onPanelRemovedCore;
/**
* A zero-based index of the currently displayed panel.
*
* When `renderMode` is `"list"` or Dynamic Panel is empty (`panelCount` is 0), this property contains -1.
* @see currentPanel
* @see panels
* @see panelCount
* @see renderMode
*/
get currentIndex(): number;
set currentIndex(val: number);
/**
* A `PanelModel` object that is the currently displayed panel.
*
* When `renderMode` is `"list"` or Dynamic Panel is empty (`panelCount` is 0), this property contains `null`.
* @see currentIndex
* @see panels
* @see panelCount
* @see renderMode
*/
get currentPanel(): PanelModel;
set currentPanel(val: PanelModel);
/**
* 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/master/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 `renderMode` is different from `"list"`.
* @see renderMode
* @see isPrevButtonVisible
*/
get panelPrevText(): string;
set panelPrevText(val: string);
get locPanelPrevText(): LocalizableString;
/**
* A caption for the Next button. Applies only if `renderMode` is different from `"list"`.
* @see renderMode
* @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;
/**
* Returns true when the renderMode equals to "progressTop" or "progressTopBottom"
*/
get isProgressTopShowing(): boolean;
/**
* Returns true when the renderMode equals to "progressBottom" or "progressTopBottom"
*/
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;
/**
* Returns true when showRangeInProgress equals to true, renderMode doesn't equal to "list" and visiblePanelCount is >= 2.
*/
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;
protected setIsMobile(val: boolean): 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 `renderMode` 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 renderMode
* @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);
/**
* A maximum number of panels in Dynamic Panel. Users cannot add new panels if `panelCount` equals `maxPanelCount`.
*
* Default value: 100 (inherited from [`settings.panelMaximumPanelCount`](https://surveyjs.io/form-library/documentation/settings#panelMaximumPanelCount))
* @see panelCount
* @see minPanelCount
* @see allowAddPanel
*/
get maxPanelCount(): number;
set maxPanelCount(val: number);
/**
* Specifies whether users are allowed to add new panels.
*
* Default value: `true`
* @see canAddPanel
* @see allowRemovePanel
*/
get allowAddPanel(): boolean;
set allowAddPanel(val: boolean);
/**
* 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);
/**
* 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);
/**
* 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);
/**
* Shows the range from 1 to panelCount when renderMode doesn't equal to "list". Set to false to hide this element.
* @see panelCount
* @see renderMode
*/
get showRangeInProgress(): boolean;
set showRangeInProgress(val: boolean);
/**
* Specifies how to render panels.
*
* Possible values:
*
* - `"list"` - Renders panels one under the other. [View Demo](https://surveyjs.io/form-library/examples/how-to-use-expressions-in-dynamic-panel/)
* - `"progressTop"` - Renders each panel as a card and displays a progress bar at the top. [View Demo](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/)
* - `"progressBottom"` - Renders each panel panel as a card and displays a progress bar at the bottom.
* - `"progressTopBottom"` - Renders each panel as a card and displays a progress bar at the top and bottom.
* - `"tab"` - Renders 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.
*/
get renderMode(): string;
set renderMode(val: string);
get tabAlign(): "center" | "left" | "right";
set tabAlign(val: "center" | "left" | "right");
get isRenderModeList(): boolean;
get isRenderModeTab(): boolean;
get hasTitleOnLeftTop(): 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;
isEmpty(): boolean;
getProgressInfo(): IProgressInfo;
private isRowEmpty;
/**
* Add a new dynamic panel based on the template Panel. It checks if canAddPanel returns true and then calls addPanel method.
* If a renderMode is different from "list" and the current panel has erros, then
* @see template
* @see panelCount
* @see panels
* @see canAddPanel
*/
addPanelUI(): PanelModel;
/**
* Add a new dynamic panel based on the template Panel.
* @see template
* @see panelCount
* @see panels
* @see renderMode
*/
addPanel(): PanelModel;
private canLeaveCurrentPanel;
private copyValue;
/**
* Call removePanel function. Do nothing is canRemovePanel returns false. If confirmDelete set to true, it shows the confirmation dialog first.
* @param value a panel or panel index
* @see removePanel
* @see confirmDelete
* @see confirmDeleteText
* @see canRemovePanel
*
*/
removePanelUI(value: any): void;
/**
* Switches Dynamic Panel to the next panel. Returns `true` in case of success, or `false` if `renderMode` is `"list"` or the current panel contains validation errors.
* @see renderMode
*/
goToNextPanel(): boolean;
/**
* Switches Dynamic Panel to the previous panel.
*/
goToPrevPanel(): void;
/**
* Removes a dynamic panel from the panels array.
* @param value a panel or panel index
* @see panels
* @see template
*/
removePanel(value: any): void;
private getVisualPanelIndex;
private getPanelIndexById;
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;
getConditionJson(operator?: string, path?: string): any;
protected onReadOnlyChanged(): void;
private updateNoEntriesTextDefaultLoc;
onSurveyLoad(): void;
onFirstRendering(): void;
localeChanged(): void;
runCondition(values: HashTable, properties: HashTable): void;
private reRunCondition;
protected runPanelsCondition(values: HashTable, properties: HashTable): void;
onAnyValueChanged(name: string): void;
private hasKeysDuplicated;
private updatePanelsContainsErrors;
hasErrors(fireCallback?: boolean, rec?: any): boolean;
protected getContainsErrors(): boolean;
protected getIsAnswered(): boolean;
protected clearValueIfInvisibleCore(): void;
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;
protected createNewPanelObject(): PanelModel;
private settingPanelCountBasedOnValue;
private setPanelCountBasedOnValue;
setQuestionValue(newValue: any): void;
onSurveyValueChanged(newValue: any): void;
private isAllPanelsEmpty;
private panelUpdateValueFromSurvey;
private panelSurveyValueChanged;
private onReadyChangedCallback;
recalculateIsReadyValue(): void;
protected onSetData(): void;
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?: {
includeEmpty?: boolean;
calculations?: Array<{
propertyName: string;
}>;
}): import("question").IQuestionPlainData;
updateElementCss(reNew?: boolean): void;
get progressText(): string;
get progress(): string;
getRootCss(): string;
get cssHeader(): string;
getPanelWrapperCss(): string;
getPanelRemoveButtonCss(): string;
getAddButtonCss(): string;
getPrevButtonCss(): string;
getNextButtonCss(): string;
/**
* A text displayed when Dynamic Panel contains no entries. Applies only in the Default V2 theme.
*/
get noEntriesText(): string;
set noEntriesText(val: string);
get locNoEntriesText(): LocalizableString;
getShowNoEntriesPlaceholder(): boolean;
needResponsiveWidth(): boolean;
private additionalTitleToolbarValue;
protected getAdditionalTitleToolbar(): ActionContainer | null;
private footerToolbarValue;
get footerToolbar(): ActionContainer;
legacyNavigation: boolean;
private updateFooterActionsCallback;
private updateFooterActions;
private initFooterToolbar;
private createTabByPanel;
private getAdditionalTitleToolbarCss;
private updateTabToolbarItemsPressedState;
private updateTabToolbar;
private addTabFromToolbar;
private removeTabFromToolbar;
get showLegacyNavigation(): boolean;
get showNavigation(): boolean;
showSeparator(index: number): boolean;
}
}
declare module "survey-events-api" {
import { IAction } from "actions/action";
import { Base } from "base";
import { IElement, ISurveyElement } from "base-interfaces";
import { ItemValue } from "itemvalue";
import { PageModel } from "page";
import { PanelModel, PanelModelBase } from "panel";
import { Question } from "question";
import { QuestionFileModel } from "question_file";
import { MatrixDropdownCell, MatrixDropdownRowModelBase, QuestionMatrixDropdownModelBase } from "question_matrixdropdownbase";
import { MatrixDropdownColumn } from "question_matrixdropdowncolumn";
import { QuestionMatrixDynamicModel } from "question_matrixdynamic";
import { QuestionPanelDynamicModel } from "question_paneldynamic";
import { SurveyModel } from "survey";
import { SurveyError } from "survey-error";
import { Trigger } from "trigger";
export interface QuestionEventMixin {
/**
* A Question instance for which the event is raised.
*/
question: Question;
}
export interface FileQuestionEventMixin {
/**
* A File question instance for which the event is raised.
*/
question: QuestionFileModel;
}
export interface PanelDynamicQuestionEventMixin {
/**
* A Dynamic Panel question instance for which the event is raised.
*/
question: QuestionPanelDynamicModel;
}
export interface MatrixDropdownQuestionEventMixin {
/**
* A Multiple-Choice 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.
*/
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 {
/**
* The 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 the ["complete" trigger](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#complete).
*/
isCompleteOnTrigger: boolean;
}
export interface CompletingEvent extends CompleteBaseEvent {
/**
* Set this property to `false` if you want to prevent survey completion.
*/
allow: boolean;
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;
showDataSaving: (text?: string) => void;
showDataSavingError: (text?: string) => void;
showDataSavingSuccess: (text?: string) => void;
showDataSavingClear: (text?: string) => void;
}
export interface ShowingPreviewEvent {
/**
* Set this property to `false` if you want to cancel the preview.
*/
allow: boolean;
allowShowPreview: boolean;
}
export interface NavigateToUrlEvent {
/**
* Set this property 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` is earlier in the survey than `oldCurrentPage`.
*/
isGoingBackward: boolean;
/**
* Returns `true` if the respondent is going forward along the survey.
*/
isGoingForward: boolean;
/**
* The current page.
*/
newCurrentPage: PageModel;
/**
* A page that used to be current.
*/
oldCurrentPage: PageModel;
}
export interface CurrentPageChangingEvent extends CurrentPageChangedEvent {
/**
* Set this property to `false` if you do not want to switch the current page.
*/
allow: boolean;
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;
}
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;
rootPanel: any;
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 {
/**
* the error name. The following error names are available:
* required, requireoneanswer, requirenumeric, exceedsize, webrequest, webrequestempty, otherempty,
* uploadingfile, requiredinallrowserror, minrowcounterror, keyduplicationerror, custom
*/
name: string;
/**
* an instance of Question, Panel or Survey object to where error is located
*/
obj: Question | PanelModel | SurveyModel;
/**
* an instance of the `SurveyError` object
*/
error: SurveyError;
/**
* an error text
*/
text: string;
}
export interface ValidatedErrorsOnCurrentPageEvent extends PageEventMixin {
/**
* the list of questions that have errors
*/
questions: Array;
/**
* the list of 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 calculated question title, based on question `title`, `name`
*/
title: string;
}
export interface GetTitleTagNameEvent {
/**
* an element title tagName that are used to render a title. You can change it from the default value
*/
tagName: string;
/**
* an element (question, panel, page and survey) that SurveyJS is going to render
*/
element: Base;
}
export interface GetQuestionNoEvent extends QuestionEventMixin {
/**
* a calculated question no, based on question `visibleIndex`, survey `.questionStartIndex` properties. You can change it
*/
no: string;
}
export interface ProgressTextEvent {
/**
* a number of required questions that have input(s) and an user has answered
*/
requiredAnsweredQuestionCount: number;
/**
* a number of required questions that have input(s). We do not count html or expression questions
*/
requiredQuestionCount: number;
/**
* a number of questions that have input(s) and an user has answered
*/
answeredQuestionCount: number;
/**
* a number of questions that have input(s). We do not count html or expression questions
*/
questionCount: number;
/**
* a progress text, that SurveyJS will render in progress bar
*/
text: string;
}
export interface TextProcessingEvent {
/**
* a property name is going to be rendered
*/
name: string;
/**
* SurveyJS element (a question, panel, page, or survey) where the string is going to be rendered
*/
element: Question | PanelModel | PageModel | SurveyModel;
}
export interface TextMarkdownEvent extends TextProcessingEvent {
/**
* an HTML content. It is `null` by default. Use this property to specify the HTML content rendered instead of `options.text`
*/
html?: string;
/**
* a text that is going to be rendered
*/
text: string;
}
export interface TextRenderAsEvent extends TextProcessingEvent {
/**
* a component name used for text rendering
*/
renderAs: string;
}
export interface SendResultEvent {
/**
* a response from the service
*/
response: any;
request: any;
/**
* it is `true` if the results has been sent to the service successfully
*/
success: boolean;
}
export interface GetResultEvent {
/**
* the server response
*/
response: any;
/**
* an array of objects `{name, value}`, where `name` is a unique value/answer to the question and `value` is a number/count of such answers
*/
dataList: Array;
/**
* the object `{AnswersCount, QuestionResult : {} }`. `AnswersCount` is the number of posted survey results. `QuestionResult` is an object with all possible unique answers to the question and number of these answers
*/
data: any;
/**
* it is `true` if the results were got from the service successfully
*/
success: boolean;
}
export interface LoadFilesEvent extends FileQuestionEventMixin {
/**
* the question name
*/
name: string;
}
export interface UploadFilesEvent extends LoadFilesEvent {
/**
* a callback function to get the file upload status and the updloaded file content
*/
callback: (status: string, data?: any) => any;
/**
* the Javascript File objects array to upload
*/
files: Array;
}
export interface DownloadFileEvent extends LoadFilesEvent {
/**
* a callback function to get the file downloading status and the downloaded file content
*/
callback: (status: string, data?: any) => any;
/**
* single file question value
*/
fileValue: any;
/**
* the file content
*/
content: any;
}
export interface ClearFilesEvent extends LoadFilesEvent {
/**
* a callback function to get the operation status
*/
callback: (status: string, data?: any) => any;
/**
* a removed file's name, set it to `null` to clear all files
*/
fileName: string;
/**
* the question value
*/
value: any;
}
export interface LoadChoicesFromServerEvent extends QuestionEventMixin {
/**
* a result that comes from the server as it is
*/
serverResult: any;
/**
* the loaded choices. You can change the loaded choices to before they are assigned to question
*/
choices: Array;
}
export interface ProcessTextValueEvent {
/**
* the value of the processing text
*/
value: any;
/**
* a boolean value. Set it to `true` if you want to use the value and set it to `false` if you don't
*/
isExists: boolean;
canProcess: boolean;
/**
* the name of the processing value, for example, "state" in our example
*/
name: string;
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 string with css classes divided by space. You can change it
*/
css: string;
/**
* a choice item of ItemValue type. You can get value or text choice properties as options.item.value or options.choice.text
*/
item: ItemValue;
}
export interface AfterRenderSurveyEvent extends AfterRenderElementEventMixin {
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 Boolean value that specifies item visibility. Set it to `false` to hide the item.
*/
visible: boolean;
/**
* The choice item as specified in the [choices](https://surveyjs.io/Documentation/Library?id=QuestionSelectBase#choices) array.
*/
item: ItemValue;
}
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 GetChoiceDisplayValueEvent extends QuestionEventMixin {
/**
* A method that you should call to assign display texts to the question.
*/
setItems: (displayValues: Array) => void;
/**
* An array of one (in Dropdown) or more (in Tag Box) default values.
*/
values: Array;
}
export interface MatrixRowAddedEvent extends MatrixDynamicQuestionEventMixin {
/**
* a new added row
*/
row: any;
}
export interface MatrixBeforeRowAddedEvent extends MatrixDynamicQuestionEventMixin {
/**
* specifies whether a new row can be added
*/
canAddRow: boolean;
}
export interface MatrixRowRemovingEvent extends MatrixDynamicQuestionEventMixin {
/**
* a boolean property. Set it to `false` to disable the row removing
*/
allow: boolean;
/**
* a row object
*/
row: any;
/**
* a row index
*/
rowIndex: number;
}
export interface MatrixRowRemovedEvent extends MatrixDynamicQuestionEventMixin {
/**
* a removed row object
*/
row: any;
/**
* a removed row index
*/
rowIndex: number;
}
export interface MatrixAllowRemoveRowEvent extends MatrixDynamicQuestionEventMixin {
/**
* a boolean property. Set it to `false` to disable the row removing
*/
allow: boolean;
/**
* a row object
*/
row: any;
/**
* a row index
*/
rowIndex: number;
}
export interface MatrixCellCreatingBaseEvent extends MatrixDropdownQuestionEventMixin {
/**
* the matrix row object
*/
row: MatrixDropdownRowModelBase;
/**
* the matrix column name
*/
columnName: string;
/**
* the matrix column object
*/
column: MatrixDropdownColumn;
/**
* the value of the current row. To access a particular column's value within the current row, use: `options.rowValue["columnValue"]`
*/
rowValue: any;
}
export interface MatrixCellCreatingEvent extends MatrixCellCreatingBaseEvent {
/**
* the cell question type. You can change it
*/
cellType: string;
}
export interface MatrixCellCreatedEvent extends MatrixCellCreatingBaseEvent {
/**
* the question/editor in the cell. You may customize it, change it's properties, like choices or visible
*/
cellQuestion: Question;
/**
* the matrix cell
*/
cell: MatrixDropdownCell;
}
export interface MatrixAfterCellRenderEvent extends QuestionEventMixin, AfterRenderElementEventMixin {
/**
* the matrix row object
*/
row: MatrixDropdownRowModelBase;
/**
* the matrix column object
*/
column: MatrixDropdownColumn | MatrixDropdownCell;
/**
* the question/editor in the cell
*/
cellQuestion: Question;
/**
* the matrix cell
*/
cell: MatrixDropdownCell;
}
export interface MatrixCellValueBaseEvent extends MatrixDropdownQuestionEventMixin {
/**
* the function that returns the cell question by column name
*/
getCellQuestion: (columnName: string) => Question;
/**
* the matrix row object
*/
row: MatrixDropdownRowModelBase;
/**
* a new value
*/
value: any;
/**
* the matrix column name
*/
columnName: string;
}
export interface MatrixCellValueChangedEvent extends MatrixCellValueBaseEvent {
}
export interface MatrixCellValueChangingEvent extends MatrixCellValueBaseEvent {
/**
* the old value
*/
oldValue: any;
}
export interface MatrixCellValidateEvent extends MatrixCellValueBaseEvent {
/**
* an error string. It is empty by default
*/
error?: string;
}
export interface DynamicPanelModifiedEvent extends PanelDynamicQuestionEventMixin, PanelEventMixin {
/**
* The panel's index within Dynamic Panel.
*/
panelIndex: number;
}
export interface DynamicPanelRemovingEvent extends DynamicPanelModifiedEvent {
/**
* Set this property to `false` if you want to cancel the panel deletion.
*/
allow: boolean;
}
export interface TimerPanelInfoTextEvent {
/**
* the timer panel info text
*/
text: string;
}
export interface DynamicPanelItemValueChangedEvent 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 new value.
*/
value: any;
/**
* The item's name.
*/
name: string;
/**
* A panel that nests the item with a changed value.
*/
panel: PanelModel;
}
export interface IsAnswerCorrectEvent extends QuestionEventMixin {
/**
* you may change the default number of correct or incorrect answers in the question, for example for matrix, where each row is a quiz question
*/
correctAnswers: number;
incorrectAnswers: number;
/**
* returns `true`, if an answer is correct, or `false`, if the answer is not correct. Use questions' `value` and `correctAnswer` properties to return the correct value
*/
result: boolean;
}
export interface DragDropAllowEvent {
/**
* an element after the target element is dragging. It can be `null` if parent container (page or panel) is empty or dragging element to the first position within the parent container
*/
insertAfter: IElement;
/**
* an element before the target element is dragging. It can be `null` if parent container (page or panel) is empty or dragging an element after the last element in a container
*/
insertBefore: IElement;
/**
* a page or panel where target element is dragging
*/
parent: ISurveyElement;
/**
* a source element. It can be `null`, if it is a new element, dragging from toolbox
*/
source: IElement;
/**
* a target element that is dragged
*/
target: IElement;
/**
* set it to `false` to disable dragging
*/
allow: boolean;
}
export interface ScrollingElementToTopEvent {
/**
* an element that is going to be scrolled on top
*/
element: ISurveyElement;
/**
* a question that is going to be scrolled on top. It can be null if options.page is not null
*/
question?: Question;
/**
* a page that is going to be scrolled on top. It can be null if options.question is not null
*/
page?: PageModel;
/**
* set this property to true to cancel the default scrolling
*/
cancel: boolean;
/**
* the unique element DOM Id
*/
elementId: string;
}
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 fired
*/
row: any;
}
export interface ElementContentVisibilityChangedEvent {
/**
* Specifies which survey element content was collapsed or expanded
*/
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 {
/**
* The question value
*/
value: any;
}
export interface MultipleTextItemAddedEvent extends QuestionEventMixin {
/**
* A new added item.
*/
item: any;
}
export interface MatrixColumnAddedEvent extends QuestionEventMixin {
/**
* A new added column.
*/
column: any;
}
}
declare module "drag-drop-page-helper-v1" {
import { IElement, ISurveyElement } from "base-interfaces";
import { PageModel } from "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 "page" {
import { IPage, IPanel, IElement, ISurveyElement } from "base-interfaces";
import { PanelModelBase } from "panel";
import { LocalizableString } from "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 PanelModelBase implements IPage {
private hasShownValue;
private dragDropPageHelper;
constructor(name?: string);
getType(): string;
toString(): string;
get isPage(): boolean;
protected canShowPageNumber(): boolean;
protected canShowTitle(): boolean;
/**
* 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 [`showProgressBar`](https://surveyjs.io/form-library/documentation/surveymodel#showProgressBar) is `true` and [`progressBarType`](https://surveyjs.io/form-library/documentation/surveymodel#progressBarType) is `"buttons"`.
*
* 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);
get locNavigationTitle(): LocalizableString;
get navigationDescription(): string;
set navigationDescription(val: string);
get locNavigationDescription(): LocalizableString;
navigationLocStrChanged(): void;
get passed(): boolean;
set passed(val: boolean);
delete(): void;
onFirstRendering(): 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;
get cssTitle(): string;
get cssRoot(): 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 spent on this page; measured in seconds. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey-create-a-quiz).
* @see maxTimeToFinish
*/
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).
*
* A negative value or 0 sets an unlimited time period.
*
* Alternatively, you can use the `SurveyModel`'s [`maxTimeToFinishPage`](https://surveyjs.io/form-library/documentation/surveymodel#maxTimeToFinishPage) property to specify identical time periods for all survey pages.
* @see timeSpent
*/
get maxTimeToFinish(): number;
set maxTimeToFinish(val: 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;
}
}
declare module "dxSurveyService" {
/**
* The class contains methods to work with api.surveyjs.io service.
*/
export class dxSurveyService {
static get serviceUrl(): string;
static set serviceUrl(val: string);
constructor();
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;
sendResult(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;
}
}
declare module "stylesmanager" {
import { Logger } from "utils/utils";
export const modernThemeColors: {
[key: string]: string;
};
export const defaultThemeColors: {
[key: string]: string;
};
export const orangeThemeColors: {
[key: string]: string;
};
export const darkblueThemeColors: {
[key: string]: string;
};
export const darkroseThemeColors: {
[key: string]: string;
};
export const stoneThemeColors: {
[key: string]: string;
};
export const winterThemeColors: {
[key: string]: string;
};
export const winterstoneThemeColors: {
[key: string]: string;
};
export class StylesManager {
private static SurveyJSStylesSheetId;
static Logger: Logger;
static Styles: {
[key: string]: string;
};
static Media: {
[key: string]: {
media: string;
style: string;
};
};
static ThemeColors: {
[key: string]: {
[key: string]: string;
};
};
static ThemeCss: {
[key: string]: {
[key: string]: string;
};
};
static ThemeSelector: {
[key: string]: string;
};
static autoApplyTheme(): void;
static getAvailableThemes(): Array;
static getIncludedThemeCss(): Array;
static findSheet(styleSheetId: string): any;
static createSheet(styleSheetId: string): any;
static applyTheme(themeName?: string, themeSelector?: string): void;
static Enabled: boolean;
constructor();
static insertStylesRulesIntoDocument(): any;
}
}
declare module "surveytimer" {
import { Event } from "base";
export var surveyTimerFunctions: {
setTimeout: (func: () => any) => number;
clearTimeout: (timerId: number) => void;
};
export class SurveyTimer {
private static instanceValue;
static get instance(): SurveyTimer;
private listenerCounter;
private timerId;
onTimer: Event<() => any, SurveyTimer, any>;
start(func?: () => any): void;
stop(func?: () => any): void;
doTimer(): void;
}
}
declare module "surveyTimerModel" {
import { ISurvey } from "base-interfaces";
import { Base, EventBase } from "base";
import { PageModel } from "page";
import { SurveyModel } from "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 {
onTimer: (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 "expressionItems" {
import { Base } from "base";
import { ISurvey } from "base-interfaces";
import { ILocalizableOwner, LocalizableString } from "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 "notifier" {
import { Base } from "base";
import { ActionContainer } from "actions/container";
import { IAction } from "actions/action";
export class Notifier extends Base {
private cssClasses;
active: boolean;
isDisplayed: boolean;
message: string;
css: string;
timeout: number;
timer: any;
private actionsVisibility;
actionBar: ActionContainer;
constructor(cssClasses: {
root: string;
info: string;
error: string;
success: string;
button: string;
shown: string;
});
getCssClass(type: string): string;
updateActionsVisibility(type: string): void;
notify(message: string, type?: string, waitUserAction?: boolean): void;
addAction(action: IAction, notificationType: string): void;
}
}
declare module "question_textbase" {
import { Question } from "question";
import { LocalizableString } from "localizablestring";
import { Base } from "base";
export class CharacterCounter extends Base {
remainingCharacterCounter: string;
updateRemainingCharacterCounter(newValue: string, maxLength: number): void;
}
/**
* A base class for the [Text](https://surveyjs.io/form-library/documentation/questiontextmodel) and [Comment](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;
/**
* Gets or sets a value that 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);
get isSurveyInputTextUpdate(): boolean;
get renderedPlaceholder(): string;
protected setRenderedPlaceholder(val: string): void;
protected onReadOnlyChanged(): void;
onSurveyLoad(): void;
localeChanged(): void;
protected calcRenderedPlaceholder(): void;
protected hasPlaceHolder(): boolean;
protected setNewValue(newValue: any): void;
protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void;
getControlClass(): string;
get ariaRole(): string;
get ariaRequired(): any;
get ariaInvalid(): any;
get ariaLabel(): string;
get ariaLabelledBy(): string;
get ariaDescribedBy(): string;
get a11y_input_ariaRole(): string;
get a11y_input_ariaRequired(): "true" | "false";
get a11y_input_ariaInvalid(): "true" | "false";
get a11y_input_ariaLabel(): string;
get a11y_input_ariaLabelledBy(): string;
get a11y_input_ariaDescribedBy(): string;
}
}
declare module "question_text" {
import { LocalizableString, LocalizableStrings } from "localizablestring";
import { HashTable } from "helpers";
import { SurveyValidator } from "validator";
import { SurveyError } from "survey-error";
import { QuestionTextBase } from "question_textbase";
/**
* A class that describes the Text question type.
*
* [View Demo](https://surveyjs.io/form-library/examples/questiontype-text/ (linkStyle))
*/
export class QuestionTextModel extends QuestionTextBase {
private locDataListValue;
private minValueRunner;
private maxValueRunner;
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.
*/
get inputType(): string;
set inputType(val: string);
runCondition(values: HashTable, properties: HashTable): void;
getValidators(): Array;
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;
protected onCheckForErrors(errors: Array, isOnValueChanged: boolean): void;
protected canSetValueToSurvey(): boolean;
protected convertFuncValuetoQuestionValue(val: any): any;
private getMinMaxErrorText;
private get isValueLessMin();
private get isValueGreaterMax();
private get isDateInputType();
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;
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 canRunValidators(isOnValueChanged: boolean): boolean;
protected setNewValue(newValue: any): void;
protected correctValueType(newValue: any): any;
protected hasPlaceHolder(): boolean;
isReadOnlyRenderDiv(): boolean;
get inputStyle(): any;
private _isWaitingForEnter;
private updateValueOnEvent;
onCompositionUpdate: (event: any) => void;
onKeyUp: (event: any) => void;
onKeyDown: (event: any) => void;
onChange: (event: any) => void;
onBlur: (event: any) => void;
onFocus: (event: any) => void;
}
}
declare module "question_multipletext" {
import { Base } from "base";
import { ISurveyData, ISurveyImpl, ISurvey, IPanel, IElement, IQuestion, ITextProcessor, IProgressInfo } from "base-interfaces";
import { SurveyValidator, IValidatorOwner } from "validator";
import { Question, IConditionObject } from "question";
import { QuestionTextModel } from "question_text";
import { SurveyError } from "survey-error";
import { ILocalizableOwner, LocalizableString } from "localizablestring";
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;
}
/**
* A class that describes an item in a [Multiple Text](https://surveyjs.io/form-library/documentation/api-reference/multiple-text-entry-question-model) question.
*
* [View Demo](/form-library/examples/multiple-text-box-question/)
*/
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;
/**
* The item name.
*/
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;
/**
* Set this property to true, to make the item a required. If a user doesn't fill the item then a validation error will be generated.
*/
get isRequired(): boolean;
set isRequired(val: boolean);
/**
* Use this property to change the default input type.
*/
get inputType(): string;
set inputType(val: string);
/**
* Item title. If it is empty, the item name is rendered as title. This property supports markdown.
* @see name
*/
get title(): string;
set title(val: string);
get locTitle(): LocalizableString;
get fullTitle(): string;
/**
* The maximum text length. If it is -1, defaul value, then the survey maxTextLength property will be used.
* If it is 0, then the value is unlimited
* @see SurveyModel.maxTextLength
*/
get maxLength(): number;
set maxLength(val: number);
getMaxLength(): any;
/**
* The input place holder.
*/
get placeholder(): string;
set placeholder(val: string);
get locPlaceholder(): LocalizableString;
get placeHolder(): string;
set placeHolder(val: string);
get locPlaceHolder(): LocalizableString;
/**
* The custom text that will be shown on required error. Use this property, if you do not want to show the default text.
*/
get requiredErrorText(): string;
set requiredErrorText(val: string);
get locRequiredErrorText(): LocalizableString;
/**
* The input size.
*/
get size(): number;
set size(val: number);
/**
* The list of question validators.
*/
get validators(): Array;
set validators(val: Array);
getValidators(): Array;
/**
* The 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;
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;
colCountChangedCallback: () => void;
constructor(name: string);
getType(): string;
setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void;
get isAllowTitleLeft(): boolean;
get hasSingleInput(): 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` objects that represent input items.
*
* This property accepts an array of objects with the following structure:
*
* ```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 Showdown](https://surveyjs.io/form-library/examples/edit-survey-questions-markdown/).
* @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;
addConditionObjectsByContext(objects: Array, context: any): void;
getConditionJson(operator?: string, path?: string): any;
locStrsChanged(): void;
localeChanged(): void;
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);
getRows(): Array;
private isMultipleItemValueChanging;
protected onValueChanged(): void;
protected createTextItem(name: string, title: string): MultipleTextItemModel;
protected onItemValueChanged(): 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;
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;
getQuestionStartIndex(): string;
getChildrenLayoutType(): string;
elementWidthChanged(el: IElement): void;
get elements(): Array;
indexOf(el: IElement): number;
ensureRowsVisibility(): void;
getItemLabelCss(item: MultipleTextItemModel): string;
getItemCss(): string;
getItemTitleCss(): string;
protected getIsTooltipErrorInsideSupported(): boolean;
}
}
declare module "survey" {
import { JsonError } from "jsonobject";
import { Base, EventBase } from "base";
import { ISurvey, ISurveyData, ISurveyImpl, ITextProcessor, IQuestion, IPanel, IElement, IPage, ISurveyErrorOwner, ISurveyElement, IProgressInfo, IFindElement, ISurveyLayoutElement, LayoutElementContainer } from "base-interfaces";
import { SurveyElementCore } from "survey-element";
import { ISurveyTriggerOwner, SurveyTrigger, Trigger } from "trigger";
import { CalculatedValue } from "calculatedValue";
import { PageModel } from "page";
import { dxSurveyService } from "dxSurveyService";
import { LocalizableString } from "localizablestring";
import { SurveyTimerModel, ISurveyTimerText } from "surveyTimerModel";
import { IQuestionPlainData, Question } from "question";
import { QuestionSelectBase } from "question_baseselect";
import { ItemValue } from "itemvalue";
import { PanelModel, QuestionRowModel } from "panel";
import { HtmlConditionItem, UrlConditionItem } from "expressionItems";
import { SurveyError } from "survey-error";
import { IAction, Action } from "actions/action";
import { ActionContainer } from "actions/container";
import { QuestionPanelDynamicModel } from "question_paneldynamic";
import { Notifier } from "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, GetQuestionNoEvent, ProgressTextEvent, TextMarkdownEvent, TextRenderAsEvent, SendResultEvent, GetResultEvent, UploadFilesEvent, DownloadFileEvent, ClearFilesEvent, LoadChoicesFromServerEvent, ProcessTextValueEvent, UpdateQuestionCssClassesEvent, UpdatePanelCssClassesEvent, UpdatePageCssClassesEvent, UpdateChoiceItemCssEvent, AfterRenderSurveyEvent, AfterRenderHeaderEvent, AfterRenderPageEvent, AfterRenderQuestionEvent, AfterRenderQuestionInputEvent, AfterRenderPanelEvent, FocusInQuestionEvent, FocusInPanelEvent, ShowingChoiceItemEvent, ChoicesLazyLoadEvent, GetChoiceDisplayValueEvent, MatrixRowAddedEvent, MatrixBeforeRowAddedEvent, MatrixRowRemovingEvent, MatrixRowRemovedEvent, MatrixAllowRemoveRowEvent, MatrixCellCreatingEvent, MatrixCellCreatedEvent, MatrixAfterCellRenderEvent, MatrixCellValueChangedEvent, MatrixCellValueChangingEvent, MatrixCellValidateEvent, DynamicPanelModifiedEvent, DynamicPanelRemovingEvent, TimerPanelInfoTextEvent, DynamicPanelItemValueChangedEvent, IsAnswerCorrectEvent, DragDropAllowEvent, ScrollingElementToTopEvent, GetQuestionTitleActionsEvent, GetPanelTitleActionsEvent, GetPageTitleActionsEvent, GetPanelFooterActionsEvent, GetMatrixRowActionsEvent, ElementContentVisibilityChangedEvent, GetExpressionDisplayValueEvent, ServerValidateQuestionsEvent, MultipleTextItemAddedEvent, MatrixColumnAddedEvent, GetQuestionDisplayValueEvent } from "survey-events-api";
import { QuestionMatrixDropdownModelBase } from "question_matrixdropdownbase";
import { QuestionMatrixDynamicModel } from "question_matrixdynamic";
import { QuestionFileModel } from "question_file";
import { QuestionMultipleTextModel } from "question_multipletext";
/**
* 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;
static get cssType(): string;
static set cssType(value: string);
[index: string]: any;
private static stylesManager;
static platform: string;
get platformName(): string;
notifier: Notifier;
/**
* 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 a comment when they select "Other" in a single- or multi-select question, 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 textPreProcessor;
private timerModelValue;
private navigationBarValue;
/**
* An event that is raised after a trigger is executed.
*
* For information on event handler parameters, refer to descriptions within the interface.
*
* For more information about triggers, refer to the following help topic: [Conditional Survey Logic (Triggers)](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#conditional-survey-logic-triggers).
* @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;
/**
* Use this event 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.
*
* Refer to the following help topic for more information on the use case: [Continue an Incomplete Survey](https://surveyjs.io/form-library/documentation/handle-survey-results-continue-incomplete).
*/
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 [`onDynamicPanelItemValueChanged`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onDynamicPanelItemValueChanged) 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;
/**
* Obsolete. Please use onQuestionVisibleChanged event.
* @see onQuestionVisibleChanged
*/
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 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).
*/
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