`. The `css` property applies classes to the `
`.
*
* To apply several classes, separate them with a space character: `"myclass1 myclass2"`.
*
* [View Demo](https://surveyjs.io/form-library/examples/add-custom-navigation-button/ (linkStyle))
* @see innerCss
*/
css?: string;
/**
* One or several CSS classes that you want to apply to the inner `
` element.
*
* In the markup, an action item is rendered as an `
` wrapped in a `
`. The `innerCss` property applies classes to the `
`.
*
* To apply several classes, separate them with a space character: `"myclass1 myclass2"`.
*
* [View Demo](https://surveyjs.io/form-library/examples/add-custom-navigation-button/ (linkStyle))
* @see css
*/
innerCss?: string;
/**
* The action item's data object. Use it to pass required data to a custom template or component.
*/
data?: any;
popupModel?: any;
needSeparator?: boolean;
/**
* Specifies whether the action item is active.
*
* Use this property as a flag to specify different action item appearances in different states.
* @see enabled
* @see visible
*/
active?: boolean;
pressed?: boolean;
/**
* Specifies the name of a template used to render the action item.
* @see component
*/
template?: string;
/**
* Specifies the name of a component used to render the action item.
*/
component?: string;
/**
* The action item's icon name.
* @see iconSize
*/
iconName?: string;
/**
* The action item's icon size in pixels.
* @see iconName
*/
iconSize?: number | string;
/**
* The action item's location in a matrix question's row.
*
* The following values are available:
*
* - `"start"` - The action item is located at the beginning of the row.
* - `"end"` - The action is located at the end of the row.
*/
location?: string;
/**
* Set this property to `true` if you want to disable keyboard navigation for the action item (sets the `tabIndex` attribute to -1).
*/
disableTabStop?: boolean;
/**
* Set this property to `true` if you want the item's `title` to be always visible.
* If you set it to `false`, the `title` hides when the screen space is limited, and the item displays only the icon.
* @see title
* @see iconName
*/
disableShrink?: boolean;
disableHide?: boolean;
mode?: actionModeType;
/**
* A number that specifies the action's position relative to other actions.
*
* [View Demo](https://surveyjs.io/form-library/examples/add-custom-navigation-button/ (linkStyle))
*/
visibleIndex?: number;
needSpace?: boolean;
ariaChecked?: boolean;
ariaExpanded?: boolean;
ariaRole?: string;
elementId?: string;
items?: Array
;
markerIconName?: string;
markerIconSize?: number;
showPopup?: () => void;
hidePopup?: () => void;
}
export interface IActionDropdownPopupOptions extends IListModel, IPopupOptionsBase {
}
export function createDropdownActionModel(actionOptions: IAction, dropdownOptions: IActionDropdownPopupOptions, locOwner?: ILocalizableOwner): Action;
export function createDropdownActionModelAdvanced(actionOptions: IAction, listOptions: IListModel, popupOptions?: IPopupOptionsBase): Action;
export function createPopupModelWithListModel(listOptions: IListModel, popupOptions: IPopupOptionsBase): PopupModel;
export function getActionDropdownButtonTarget(container: HTMLElement): HTMLElement;
export abstract class BaseAction extends Base implements IAction {
items?: IAction[];
private static renderedId;
private static getNextRendredId;
private cssClassesValue;
private rendredIdValue;
private ownerValue;
tooltip: string;
showTitle: boolean;
innerCss: string;
active: boolean;
pressed: boolean;
data: any;
popupModel: any;
needSeparator: boolean;
template: string;
mode: actionModeType;
visibleIndex: number;
disableTabStop: boolean;
disableShrink: boolean;
disableHide: boolean;
needSpace: boolean;
ariaChecked: boolean;
ariaExpanded: boolean;
ariaRole: string;
id: string;
removePriority: number;
iconName: string;
iconSize: number;
markerIconName: string;
markerIconSize: number;
css?: string;
minDimension: number;
maxDimension: number;
get renderedId(): number;
get owner(): ILocalizableOwner;
set owner(val: ILocalizableOwner);
get visible(): boolean;
set visible(val: boolean);
get enabled(): boolean;
set enabled(val: boolean);
get component(): string;
set component(val: string);
get locTitle(): LocalizableString;
set locTitle(val: LocalizableString);
get title(): string;
set title(val: string);
set cssClasses(val: any);
get cssClasses(): any;
get isVisible(): boolean;
get disabled(): boolean;
get canShrink(): boolean;
get hasTitle(): boolean;
get hasSubItems(): boolean;
getActionBarItemTitleCss(): string;
getActionBarItemCss(): string;
getActionRootCss(): string;
getTooltip(): string;
getIsTrusted(args: any): boolean;
showPopup(): void;
hidePopup(): void;
isPressed: boolean;
isHovered: boolean;
private showPopupTimeout;
private hidePopupTimeout;
private clearPopupTimeouts;
showPopupDelayed(delay: number): void;
hidePopupDelayed(delay: number): void;
protected abstract getEnabled(): boolean;
protected abstract setEnabled(val: boolean): void;
protected abstract getVisible(): boolean;
protected abstract setVisible(val: boolean): void;
protected abstract getLocTitle(): LocalizableString;
protected abstract setLocTitle(val: LocalizableString): void;
protected abstract getTitle(): string;
protected abstract setTitle(val: string): void;
protected abstract getComponent(): string;
protected abstract setComponent(val: string): void;
}
export class Action extends BaseAction implements IAction, ILocalizableOwner {
innerItem: IAction;
private locTitleValue;
updateCallback: (isResetInitialized: boolean) => void;
private raiseUpdate;
constructor(innerItem: IAction);
private createLocTitle;
setSubItems(options: IListModel): void;
location?: string;
id: string;
private _visible;
locTooltipName?: string;
private _enabled;
action: (context?: any, isUserAction?: boolean) => void;
onFocus: (isMouse: boolean, event: any) => void;
_component: string;
items: any;
_title: string;
protected getLocTitle(): LocalizableString;
protected setLocTitle(val: LocalizableString): void;
protected getTitle(): string;
protected setTitle(val: string): void;
get locTitleName(): string;
set locTitleName(val: string);
locStrsChanged(): void;
doAction(args: any): boolean;
private isMouseDown;
doMouseDown(): void;
doFocus(args: any): void;
private locStrChangedInPopupModel;
private locTitleChanged;
private locTooltipChanged;
getLocale(): string;
getMarkdownHtml(text: string, name: string): string;
getProcessedText(text: string): string;
getRenderer(name: string): string;
getRendererContext(locStr: LocalizableString): any;
setVisible(val: boolean): void;
getVisible(): boolean;
enabledIf?: () => boolean;
setEnabled(val: boolean): void;
getEnabled(): boolean;
setComponent(val: string): void;
getComponent(): string;
dispose(): void;
}
export class ActionDropdownViewModel {
private item;
private popupModel;
private funcKey;
constructor(item: Action);
private setupPopupCallbacks;
private removePopupCallbacks;
dispose(): void;
}
}
declare module "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 delayedUpdateFunction?;
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, delayedUpdateFunction?: (callback: () => void) => void);
protected getDimensions(element: HTMLElement): IDimensions;
protected getAvailableSpace(): number;
protected calcItemSize(item: HTMLDivElement): number;
private calcMinDimension;
private getRenderedVisibleActionsCount;
private calcItemsSizes;
protected calcActionDimensions(currentAction: Action, item: HTMLDivElement): void;
private get isContainerVisible();
private process;
dispose(): void;
}
export class VerticalResponsivityManager extends ResponsivityManager {
constructor(container: HTMLDivElement, model: AdaptiveActionContainer, itemsSelector: string, dotsItemSize?: number, minDimension?: number, delayedUpdateFunction?: (callback: () => void) => void);
protected getDimensions(): IDimensions;
protected getAvailableSpace(): number;
protected calcItemSize(item: HTMLDivElement): number;
protected calcActionDimensions(currentAction: Action, item: HTMLDivElement): void;
}
}
declare module "actions/adaptive-container" {
import { ListModel } from "list";
import { Action, actionModeType } from "actions/action";
import { ActionContainer } from "actions/container";
export class AdaptiveActionContainer extends ActionContainer {
dotsItem: Action;
private responsivityManager;
minVisibleItemsCount: number;
isResponsivenessDisabled: boolean;
private hideItemsGreaterN;
private getActionsToHide;
private getVisibleItemsCount;
private updateItemMode;
private static ContainerID;
constructor();
get hiddenItemsListModel(): ListModel;
protected onSet(): void;
protected onPush(item: T): void;
protected getRenderedActions(): Array;
protected raiseUpdate(isResetInitialized: boolean): void;
fit(dimension: number, dotsItemSize: number): void;
initResponsivityManager(container: HTMLDivElement, delayedUpdateFunction?: (callback: () => void) => void): void;
resetResponsivityManager(): void;
setActionsMode(mode: actionModeType): void;
dispose(): void;
}
}
declare module "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);
equals(error: SurveyError): boolean;
get locText(): LocalizableString;
getText(): string;
getErrorType(): string;
protected getDefaultText(): string;
protected getLocale(): string;
protected getLocalizationString(locStrName: string): string;
onUpdateErrorTextCallback: (error: SurveyError) => void;
updateText(): void;
}
}
declare module "defaultCss/defaultV2Css" {
export var surveyCss: any;
export var defaultV2Css: {
root: string;
rootProgress: string;
rootMobile: string;
rootAnimationDisabled: string;
rootReadOnly: string;
rootCompact: string;
rootFitToContainer: string;
rootWrapper: string;
rootWrapperFixed: string;
rootWrapperHasImage: string;
rootBackgroundImage: string;
container: string;
header: string;
bodyContainer: string;
body: string;
bodyWithTimer: string;
clockTimerRoot: string;
clockTimerRootTop: string;
clockTimerRootBottom: string;
clockTimerProgress: string;
clockTimerProgressAnimation: string;
clockTimerTextContainer: string;
clockTimerMinorText: string;
clockTimerMajorText: string;
bodyEmpty: string;
bodyLoading: string;
footer: string;
title: string;
description: string;
logo: string;
logoImage: string;
headerText: string;
headerClose: string;
navigationButton: string;
bodyNavigationButton: string;
completedPage: string;
completedBeforePage: string;
timerRoot: string;
navigation: {
complete: string;
prev: string;
next: string;
start: string;
preview: string;
edit: string;
};
panel: {
contentFadeIn: string;
contentFadeOut: string;
fadeIn: string;
fadeOut: string;
asPage: string;
number: string;
title: string;
titleExpandable: string;
titleNumInline: string;
titleExpanded: string;
titleCollapsed: string;
titleDisabled: string;
titleHidden: string;
titleOnExpand: string;
titleOnError: string;
titleBar: string;
description: string;
container: string;
withFrame: string;
content: string;
icon: string;
iconExpanded: string;
footer: string;
requiredText: string;
header: string;
collapsed: string;
expanded: string;
expandable: string;
expandableAnimating: string;
nested: string;
invisible: string;
navigationButton: string;
compact: string;
errorsContainer: string;
};
paneldynamic: {
mainRoot: string;
empty: string;
root: string;
iconRemove: string;
navigation: string;
title: string;
header: string;
headerTab: string;
button: string;
buttonRemove: string;
buttonAdd: string;
buttonPrev: string;
buttonPrevDisabled: string;
buttonNextDisabled: string;
buttonNext: string;
progressContainer: string;
progress: string;
progressBar: string;
nested: string;
progressText: string;
separator: string;
panelWrapper: string;
footer: string;
panelFooter: string;
footerButtonsContainer: string;
panelsContainer: string;
panelWrapperInRow: string;
panelWrapperFadeIn: string;
panelWrapperFadeOut: string;
panelWrapperList: string;
progressBtnIcon: string;
noEntriesPlaceholder: string;
compact: string;
tabsRoot: string;
tabsLeft: string;
tabsRight: string;
tabsCenter: string;
tabs: {
item: string;
itemPressed: string;
itemAsIcon: string;
itemIcon: string;
itemTitle: string;
};
};
progress: string;
progressTop: string;
progressBottom: string;
progressBar: string;
progressText: string;
progressButtonsRoot: string;
progressButtonsNumbered: string;
progressButtonsFitSurveyWidth: string;
progressButtonsContainerCenter: string;
progressButtonsContainer: string;
progressButtonsConnector: string;
progressButtonsButton: string;
progressButtonsButtonBackground: string;
progressButtonsButtonContent: string;
progressButtonsHeader: string;
progressButtonsFooter: string;
progressButtonsImageButtonLeft: string;
progressButtonsImageButtonRight: string;
progressButtonsImageButtonHidden: string;
progressButtonsListContainer: string;
progressButtonsList: string;
progressButtonsListElementPassed: string;
progressButtonsListElementCurrent: string;
progressButtonsListElementNonClickable: string;
progressButtonsPageTitle: string;
progressButtonsPageDescription: string;
progressTextInBar: string;
page: {
root: string;
emptyHeaderRoot: string;
title: string;
description: string;
errorsContainer: string;
};
pageTitle: string;
pageDescription: string;
row: string;
rowMultiple: string;
rowCompact: string;
rowFadeIn: string;
rowDelayedFadeIn: string;
rowFadeOut: string;
pageRow: string;
question: {
contentFadeIn: string;
contentFadeOut: string;
fadeIn: string;
fadeOut: string;
mainRoot: string;
flowRoot: string;
withFrame: string;
asCell: string;
answered: string;
header: string;
headerLeft: string;
headerTop: string;
headerBottom: string;
content: string;
contentSupportContainerQueries: string;
contentLeft: string;
titleNumInline: string;
titleLeftRoot: string;
titleTopRoot: string;
descriptionUnderInputRoot: string;
titleBottomRoot: string;
titleOnAnswer: string;
titleEmpty: string;
titleOnError: string;
title: string;
titleExpandable: string;
titleExpanded: string;
titleCollapsed: string;
titleDisabled: string;
titleReadOnly: string;
titleBar: string;
requiredText: string;
number: string;
description: string;
descriptionUnderInput: string;
comment: string;
other: string;
required: string;
titleRequired: string;
indent: number;
footer: string;
commentArea: string;
formGroup: string;
hasError: string;
hasErrorTop: string;
hasErrorBottom: string;
collapsed: string;
expandable: string;
expandableAnimating: string;
expanded: string;
nested: string;
invisible: string;
composite: string;
disabled: string;
readOnly: string;
preview: string;
noPointerEventsMode: string;
errorsContainer: string;
errorsContainerTop: string;
errorsContainerBottom: string;
};
image: {
mainRoot: string;
root: string;
image: string;
adaptive: string;
noImage: string;
noImageSvgIconId: string;
withFrame: string;
};
html: {
mainRoot: string;
root: string;
withFrame: string;
nested: string;
};
error: {
root: string;
icon: string;
item: string;
locationTop: string;
locationBottom: string;
};
checkbox: {
root: string;
rootMobile: string;
rootRow: string;
rootMultiColumn: string;
item: string;
itemOnError: string;
itemSelectAll: string;
itemNone: string;
itemDisabled: string;
itemReadOnly: string;
itemPreview: string;
itemPreviewSvgIconId: string;
itemChecked: string;
itemHover: string;
itemInline: string;
label: string;
labelChecked: string;
itemControl: string;
itemDecorator: string;
itemSvgIconId: string;
controlLabel: string;
materialDecorator: string;
other: string;
column: string;
};
radiogroup: {
root: string;
rootMobile: string;
rootRow: string;
rootMultiColumn: string;
item: string;
itemOnError: string;
itemInline: string;
label: string;
labelChecked: string;
itemDisabled: string;
itemReadOnly: string;
itemPreview: string;
itemPreviewSvgIconId: string;
itemChecked: string;
itemHover: string;
itemControl: string;
itemDecorator: string;
controlLabel: string;
materialDecorator: string;
other: string;
clearButton: string;
column: string;
};
boolean: {
mainRoot: string;
root: string;
rootRadio: string;
item: string;
itemOnError: string;
control: string;
itemChecked: string;
itemExchanged: string;
itemIndeterminate: string;
itemDisabled: string;
itemReadOnly: string;
itemPreview: string;
itemHover: string;
label: string;
labelTrue: string;
labelFalse: string;
switch: string;
disabledLabel: string;
labelReadOnly: string;
labelPreview: string;
sliderText: string;
slider: string;
sliderGhost: string;
radioItem: string;
radioItemChecked: string;
radioItemDisabled: string;
radioItemReadOnly: string;
radioItemPreview: string;
itemPreviewSvgIconId: string;
radioLabel: string;
radioControlLabel: string;
radioFieldset: string;
itemRadioDecorator: string;
materialRadioDecorator: string;
itemRadioControl: string;
rootCheckbox: string;
checkboxItem: string;
checkboxLabel: string;
checkboxItemOnError: string;
checkboxItemIndeterminate: string;
checkboxItemChecked: string;
checkboxItemDecorator: string;
checkboxItemDisabled: string;
checkboxItemReadOnly: string;
checkboxItemPreview: string;
controlCheckbox: string;
checkboxMaterialDecorator: string;
checkboxControlLabel: string;
svgIconCheckedId: string;
};
text: {
root: string;
small: string;
controlDisabled: string;
controlReadOnly: string;
controlPreview: string;
constrolWithCharacterCounter: string;
characterCounterBig: string;
content: string;
remainingCharacterCounter: string;
onError: string;
};
multipletext: {
root: string;
rootMobile: string;
itemLabel: string;
itemLabelReadOnly: string;
itemLabelDisabled: string;
itemLabelPreview: string;
itemLabelOnError: string;
itemLabelAllowFocus: string;
itemLabelAnswered: string;
itemWithCharacterCounter: string;
item: string;
itemTitle: string;
content: string;
row: string;
cell: string;
cellError: string;
cellErrorTop: string;
cellErrorBottom: string;
};
dropdown: {
root: string;
popup: string;
small: string;
selectWrapper: string;
other: string;
onError: string;
label: string;
item: string;
itemDisabled: string;
itemChecked: string;
itemHover: string;
itemControl: string;
itemDecorator: string;
cleanButton: string;
cleanButtonSvg: string;
cleanButtonIconId: string;
chevronButton: string;
chevronButtonSvg: string;
chevronButtonIconId: string;
control: string;
controlInputFieldComponent: string;
controlValue: string;
controlDisabled: string;
controlReadOnly: string;
controlPreview: string;
controlEmpty: string;
controlLabel: string;
filterStringInput: string;
materialDecorator: string;
hintPrefix: string;
hintSuffix: string;
};
imagepicker: {
mainRoot: string;
root: string;
rootColumn: string;
item: string;
itemOnError: string;
itemInline: string;
itemChecked: string;
itemDisabled: string;
itemReadOnly: string;
itemPreview: string;
itemHover: string;
label: string;
itemDecorator: string;
imageContainer: string;
itemControl: string;
image: string;
itemText: string;
other: string;
itemNoImage: string;
itemNoImageSvgIcon: string;
itemNoImageSvgIconId: string;
column: string;
checkedItemDecorator: string;
checkedItemSvgIcon: string;
checkedItemSvgIconId: string;
};
matrix: {
mainRoot: string;
tableWrapper: string;
root: string;
columnsAutoWidth: string;
noHeader: string;
rootVerticalAlignTop: string;
rootVerticalAlignMiddle: string;
rootAlternateRows: string;
rowError: string;
cell: string;
row: string;
rowDisabled: string;
rowReadOnly: string;
headerCell: string;
rowTextCell: string;
label: string;
itemOnError: string;
itemValue: string;
itemChecked: string;
itemDisabled: string;
itemReadOnly: string;
itemPreview: string;
itemPreviewSvgIconId: string;
itemHover: string;
materialDecorator: string;
itemDecorator: string;
cellText: string;
cellTextSelected: string;
cellTextDisabled: string;
cellResponsiveTitle: string;
compact: string;
};
matrixdropdown: {
mainRoot: string;
rootScroll: string;
root: string;
columnsAutoWidth: string;
noHeader: string;
hasFooter: string;
rootVerticalAlignTop: string;
rootVerticalAlignMiddle: string;
tableWrapper: string;
rootAlternateRows: string;
cell: string;
cellResponsiveTitle: string;
errorsCell: string;
errorsCellTop: string;
errorsCellBottom: string;
itemCell: string;
row: string;
rowFadeIn: string;
rowFadeOut: string;
expandedRow: string;
rowHasPanel: string;
rowHasEndActions: string;
headerCell: string;
rowTextCell: string;
footerCell: string;
footerTotalCell: string;
columnTitleCell: string;
cellRequiredText: string;
detailButton: string;
detailButtonExpanded: string;
detailIcon: string;
detailIconExpanded: string;
detailIconId: string;
detailIconExpandedId: string;
detailPanelCell: string;
detailRowCell: string;
actionsCellPrefix: string;
actionsCell: string;
actionsCellDrag: string;
emptyCell: string;
verticalCell: string;
cellQuestionWrapper: string;
compact: string;
};
matrixdynamic: {
mainRoot: string;
rootScroll: string;
empty: string;
root: string;
columnsAutoWidth: string;
noHeader: string;
hasFooter: string;
tableWrapper: string;
rootAlternateRows: string;
content: string;
cell: string;
cellResponsiveTitle: string;
row: string;
rowFadeIn: string;
rowFadeOut: string;
rowHasPanel: string;
rowHasEndActions: string;
expandedRow: string;
itemCell: string;
headerCell: string;
rowTextCell: string;
footerCell: string;
columnTitleCell: string;
cellRequiredText: string;
button: string;
detailRow: string;
detailButton: string;
detailButtonExpanded: string;
detailIcon: string;
detailIconExpanded: string;
detailIconId: string;
detailIconExpandedId: string;
detailPanelCell: string;
detailRowCell: string;
actionsCellPrefix: string;
actionsCell: string;
actionsCellDrag: string;
buttonAdd: string;
buttonRemove: string;
iconAdd: string;
iconRemove: string;
dragElementDecorator: string;
iconDragElement: string;
footer: string;
footerTotalCell: string;
emptyRowsSection: string;
iconDrag: string;
ghostRow: string;
emptyCell: string;
verticalCell: string;
cellQuestionWrapper: string;
errorsCell: string;
errorsCellTop: string;
errorsCellBottom: string;
compact: string;
};
rating: {
rootDropdown: string;
root: string;
rootWrappable: string;
rootLabelsTop: string;
rootLabelsBottom: string;
rootLabelsDiagonal: string;
item: string;
itemOnError: string;
itemHover: string;
selected: string;
itemStar: string;
itemStarOnError: string;
itemStarHover: string;
itemStarSelected: string;
itemStarDisabled: string;
itemStarReadOnly: string;
itemStarPreview: string;
itemStarHighlighted: string;
itemStarUnhighlighted: string;
itemStarSmall: string;
itemSmiley: string;
itemSmileyOnError: string;
itemSmileyHover: string;
itemSmileySelected: string;
itemSmileyDisabled: string;
itemSmileyReadOnly: string;
itemSmileyPreview: string;
itemSmileyHighlighted: string;
itemSmileyScaleColored: string;
itemSmileyRateColored: string;
itemSmileySmall: string;
minText: string;
itemText: string;
maxText: string;
itemDisabled: string;
itemReadOnly: string;
itemPreview: string;
itemFixedSize: string;
control: string;
itemSmall: string;
selectWrapper: string;
controlValue: string;
controlDisabled: string;
controlReadOnly: string;
controlPreview: string;
controlEmpty: string;
filterStringInput: string;
chevronButton: string;
chevronButtonSvg: string;
chevronButtonIconId: string;
popup: string;
onError: string;
};
comment: {
root: string;
small: string;
controlDisabled: string;
controlReadOnly: string;
controlPreview: string;
content: string;
remainingCharacterCounter: string;
onError: string;
};
expression: string;
file: {
root: string;
rootDragging: string;
rootAnswered: string;
rootDisabled: string;
rootReadOnly: string;
rootPreview: string;
other: string;
placeholderInput: string;
previewItem: string;
fileSign: string;
fileList: string;
fileSignBottom: string;
dragArea: string;
dragAreaActive: string;
fileDecorator: string;
onError: string;
fileDecoratorDrag: string;
fileInput: string;
noFileChosen: string;
chooseFile: string;
chooseFileAsText: string;
chooseFileAsTextDisabled: string;
chooseFileAsIcon: string;
chooseFileIconId: string;
disabled: string;
controlDisabled: string;
removeButton: string;
removeButtonBottom: string;
removeButtonIconId: string;
removeFile: string;
removeFileSvg: string;
removeFileSvgIconId: string;
wrapper: string;
defaultImage: string;
defaultImageIconId: string;
leftIconId: string;
rightIconId: string;
removeFileButton: string;
dragAreaPlaceholder: string;
imageWrapper: string;
imageWrapperDefaultImage: string;
single: string;
singleImage: string;
mobile: string;
videoContainer: string;
contextButton: string;
video: string;
actionsContainer: string;
closeCameraButton: string;
changeCameraButton: string;
takePictureButton: string;
loadingIndicator: string;
};
signaturepad: {
mainRoot: string;
root: string;
small: string;
controls: string;
placeholder: string;
canvas: string;
backgroundImage: string;
clearButton: string;
clearButtonIconId: string;
loadingIndicator: string;
};
saveData: {
root: string;
rootWithButtons: string;
info: string;
error: string;
success: string;
button: string;
shown: string;
};
window: {
root: string;
rootCollapsedMod: string;
rootFullScreenMode: string;
rootContent: string;
body: string;
header: {
root: string;
titleCollapsed: string;
buttonsContainer: string;
button: string;
buttonExpanded: string;
buttonCollapsed: string;
collapseButton: string;
closeButton: string;
fullScreenButton: string;
};
};
ranking: {
root: string;
rootMobileMod: string;
rootDragMod: string;
rootDisabled: string;
rootReadOnly: string;
rootPreview: string;
rootDesignMode: string;
rootDragHandleAreaIcon: string;
rootSelectToRankMod: string;
rootSelectToRankEmptyValueMod: string;
rootSelectToRankAlignVertical: string;
rootSelectToRankAlignHorizontal: string;
item: string;
itemContent: string;
itemIndex: string;
itemIndexEmptyMode: string;
itemDisabled: string;
itemReadOnly: string;
itemPreview: string;
controlLabel: string;
itemGhostNode: string;
itemIconContainer: string;
itemIcon: string;
itemIconHoverMod: string;
itemIconFocusMod: string;
itemGhostMod: string;
itemDragMod: string;
itemOnError: string;
container: string;
containerEmptyMode: string;
containerFromMode: string;
containerToMode: string;
containerPlaceholder: string;
containersDivider: string;
};
buttongroup: {
root: string;
item: string;
itemIcon: string;
itemDecorator: string;
itemCaption: string;
itemHover: string;
itemSelected: string;
itemDisabled: string;
itemControl: string;
};
list: {
root: string;
item: string;
itemBody: string;
itemSelected: string;
itemFocused: string;
};
actionBar: {
root: string;
item: string;
defaultSizeMode: string;
smallSizeMode: string;
itemPressed: string;
itemAsIcon: string;
itemIcon: string;
itemTitle: string;
};
variables: {
mobileWidth: string;
themeMark: string;
};
tagbox: {
root: string;
popup: string;
small: string;
selectWrapper: string;
other: string;
onError: string;
label: string;
itemSvgIconId: string;
item: string;
itemDisabled: string;
itemChecked: string;
itemHover: string;
itemControl: string;
itemDecorator: string;
cleanButton: string;
cleanButtonSvg: string;
cleanButtonIconId: string;
cleanItemButton: string;
cleanItemButtonSvg: string;
cleanItemButtonIconId: string;
chevronButton: string;
chevronButtonSvg: string;
chevronButtonIconId: string;
control: string;
controlValue: string;
controlValueItems: string;
placeholderInput: string;
controlEditable: string;
controlDisabled: string;
controlReadOnly: string;
controlPreview: string;
controlEmpty: string;
controlLabel: string;
filterStringInput: string;
materialDecorator: string;
hint: string;
hintPrefix: string;
hintSuffix: string;
hintSuffixWrapper: string;
};
};
export const defaultV2ThemeName = "defaultV2";
}
declare module "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 idValue;
constructor();
get id(): number;
getType(): string;
toString(): string;
isGhost: boolean;
protected get isInternal(): boolean;
get operator(): string;
set operator(value: string);
get value(): any;
set value(val: any);
get name(): string;
set name(val: string);
get expression(): string;
set expression(val: string);
protected canBeExecuted(isOnNextPage: boolean): boolean;
protected canBeExecutedOnComplete(): boolean;
protected isExecutingOnNextPage: boolean;
checkExpression(isOnNextPage: boolean, isOnComplete: boolean, keys: any, values: HashTable, properties?: HashTable): void;
protected canSuccessOnEmptyExpression(): boolean;
check(value: any): void;
get requireValidQuestion(): boolean;
private perform;
private triggerResult;
protected onSuccess(values: HashTable, properties: HashTable): void;
protected onFailure(): void;
protected onSuccessExecuted(): void;
endLoadingFromJson(): void;
private oldPropertiesChanged;
private onExpressionChanged;
buildExpression(): string;
private isCheckRequired;
protected getUsedVariables(): string[];
private createConditionRunner;
private get isRequireValue();
}
export interface ISurveyTriggerOwner {
getObjects(pages: string[], questions: string[]): any[];
setCompleted(trigger: Trigger): void;
canBeCompleted(trigger: Trigger, isCompleted: boolean): void;
triggerExecuted(trigger: Trigger): void;
setTriggerValue(name: string, value: any, isVariable: boolean): any;
copyTriggerValue(name: string, fromName: string, copyDisplayValue: boolean): void;
focusQuestion(name: string): boolean;
}
/**
* It extends the Trigger base class and add properties required for SurveyJS classes.
*/
export class SurveyTrigger extends Trigger {
protected ownerValue: ISurveyTriggerOwner;
constructor();
get owner(): ISurveyTriggerOwner;
setOwner(owner: ISurveyTriggerOwner): void;
getSurvey(live?: boolean): ISurvey;
protected isRealExecution(): boolean;
protected onSuccessExecuted(): void;
}
/**
* If expression returns true, it makes questions/pages visible.
* Ohterwise it makes them invisible.
*/
export class SurveyTriggerVisible extends SurveyTrigger {
pages: string[];
questions: string[];
constructor();
getType(): string;
protected onSuccess(values: HashTable, properties: HashTable): void;
protected onFailure(): void;
private onTrigger;
protected onItemSuccess(item: any): void;
protected onItemFailure(item: any): void;
}
/**
* If expression returns true, it completes the survey.
*/
export class SurveyTriggerComplete extends SurveyTrigger {
constructor();
getType(): string;
get requireValidQuestion(): boolean;
protected isRealExecution(): boolean;
protected onSuccess(values: HashTable, properties: HashTable): void;
protected onFailure(): void;
}
/**
* If expression returns true, the value from property **setValue** will be set to **setToName**
*/
export class SurveyTriggerSetValue extends SurveyTrigger {
constructor();
getType(): string;
protected canBeExecuted(isOnNextPage: boolean): boolean;
protected onPropertyValueChanged(name: string, oldValue: any, newValue: any): void;
get setToName(): string;
set setToName(val: string);
get setValue(): any;
set setValue(val: any);
get isVariable(): boolean;
set isVariable(val: boolean);
protected onSuccess(values: HashTable, properties: HashTable): void;
}
/**
* If expression returns true, the survey go to question **gotoName** and focus it.
*/
export class SurveyTriggerSkip extends SurveyTrigger {
constructor();
getType(): string;
get requireValidQuestion(): boolean;
get gotoName(): string;
set gotoName(val: string);
protected canBeExecuted(isOnNextPage: boolean): boolean;
protected onSuccess(values: HashTable, properties: HashTable): void;
}
/**
* If expression returns true, the **runExpression** will be run. If **setToName** property is not empty then the result of **runExpression** will be set to it.
*/
export class SurveyTriggerRunExpression extends SurveyTrigger {
constructor();
getType(): string;
get setToName(): string;
set setToName(val: string);
get runExpression(): string;
set runExpression(val: string);
protected canBeExecuted(isOnNextPage: boolean): boolean;
protected onSuccess(values: HashTable, properties: HashTable): boolean;
private onCompleteRunExpression;
}
/**
* If expression returns true, the value from question **fromName** will be set into **setToName**.
*/
export class SurveyTriggerCopyValue extends SurveyTrigger {
constructor();
protected canBeExecuted(isOnNextPage: boolean): boolean;
get setToName(): string;
set setToName(val: string);
get fromName(): string;
set fromName(val: string);
get copyDisplayValue(): boolean;
set copyDisplayValue(val: boolean);
getType(): string;
protected onSuccess(values: HashTable, properties: HashTable): void;
protected canSuccessOnEmptyExpression(): boolean;
protected getUsedVariables(): string[];
}
}
declare module "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 "panel-layout-column" {
import { Base } from "base";
export class PanelLayoutColumnModel extends Base {
width: number;
effectiveWidth: number;
questionTitleWidth: string;
constructor(width?: number, questionTitleWidth?: string);
getType(): string;
isEmpty(): boolean;
}
}
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 "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 EachRowUniqueError extends SurveyError {
text: string;
constructor(text: string, errorOwner?: ISurveyErrorOwner);
getErrorType(): string;
protected getDefaultText(): string;
}
export class MinRowCountError extends SurveyError {
minRowCount: number;
constructor(minRowCount: number, errorOwner?: ISurveyErrorOwner);
getErrorType(): string;
protected getDefaultText(): string;
}
export class KeyDuplicationError extends SurveyError {
text: string;
constructor(text: string, errorOwner?: ISurveyErrorOwner);
getErrorType(): string;
protected getDefaultText(): string;
}
export class CustomError extends SurveyError {
text: string;
constructor(text: string, errorOwner?: ISurveyErrorOwner);
getErrorType(): string;
}
}
declare module "question_custom" {
import { Question, IConditionObject } from "question";
import { JsonObjectProperty } from "jsonobject";
import { Base } from "base";
import { ISurveyImpl, ISurveyData, ITextProcessor, IPanel, IElement, IQuestion, IProgressInfo } from "base-interfaces";
import { SurveyElement } from "survey-element";
import { PanelModel } from "panel";
import { PanelLayoutColumnModel } from "panel-layout-column";
import { HashTable } from "helpers";
import { ItemValue } from "itemvalue";
import { SurveyError } from "survey-error";
/**
* An interface used to create custom question types.
*
* Refer to the following articles for more information:
*
* - [Create Specialized Question Types](https://surveyjs.io/form-library/documentation/customize-question-types/create-specialized-question-types)
* - [Create Composite Question Types](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types)
*/
export interface ICustomQuestionTypeConfiguration {
/**
* A name used to identify a custom question type.
*
* @see title
*/
name: string;
/**
* A title used for this custom question type in the UI. When `title` is not specified, the `name` property value is used.
*
* @see name
*/
title?: string;
/**
* The name of an icon to use for the custom question type.
*
* [UI Icons](https://surveyjs.io/form-library/documentation/icons (linkStyle))
*/
iconName?: string;
internal?: boolean;
/**
* A function that is called when the custom question type is initialized. Use it to add, remove, or modify the type's properties (see [Override Base Question Properties](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types#override-base-question-properties)).
*/
onInit?(): void;
/**
* Specifies whether the custom question type is available in the Toolbox and the Add Question menu in Survey Creator.
*
* Default value: `true`
*
* Set this property to `false` if your custom question type is used only to customize Property Grid content and is not meant for a survey.
*/
showInToolbox?: boolean;
/**
* A default title for questions created with this question type. Survey authors can change the default title in the JSON object or in Survey Creator's Property Grid.
*
* You can specify the question title with a string value or with an object that defines different titles for different locales:
*
* ```js
* import { ComponentCollection } from "survey-core";
*
* ComponentCollection.Instance.add({
* // ...
* defaultQuestionTitle: "Default title"
* });
* // ===== OR =====
* ComponentCollection.Instance.add({
* // ...
* defaultQuestionTitle: {
* en: "Default title",
* de: "Standardtitel",
* fr: "Titre par défaut"
* }
* });
* ```
*/
defaultQuestionTitle?: any;
/**
* An array of property names to inherit from a base question or a Boolean value that specifies whether or not to inherit all properties.
*
* Default value: `false`
*
* When you create a [custom specialized question type](https://surveyjs.io/form-library/documentation/customize-question-types/create-specialized-question-types), you base it on another question type configured within the [`questionJSON`](#questionJSON) object. If the custom question type should inherit all properties from the base type, set the `inheritBaseProps` property to `true`. If you want to inherit only certain properties, set the `inheritBaseProps` property to an array of their names.
*
* [Create Specialized Question Types](https://surveyjs.io/form-library/documentation/customize-question-types/create-specialized-question-types (linkStyle))
*/
inheritBaseProps?: false | true | Array;
/**
* A function that is called when the custom question is created. Use it to access questions nested within a [composite question type](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types).
*
* Parameters:
*
* - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* The custom question.
*/
onCreated?(question: Question): void;
/**
* A function that is called when JSON schemas are loaded.
*
* Parameters:
*
* - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A custom question.
*/
onLoaded?(question: Question): void;
/**
* A function that is called after the entire question is rendered.
*
* Parameters:
*
* - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A custom question.
* - `htmlElement`: `any`\
* An HTML element that represents the custom question.
*/
onAfterRender?(question: Question, htmlElement: any): void;
/**
* A function that is called each time a question nested within a [composite question](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types) is rendered.
*
* Parameters:
*
* - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A composite question.
* - `element`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A nested question.
* - `htmlElement`: `any`\
* An HTML element that represents a nested question.
*/
onAfterRenderContentElement?(question: Question, element: Question, htmlElement: any): void;
/**
* A function that is called each time a question nested within a [composite question](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types) requires an update of its CSS classes.
*
* Parameters:
*
* - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A composite question.
* - `element`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A nested question.
* - `cssClasses`: `any`\
* An object with CSS classes applied to a nested question, for example, `{ root: "class1", button: "class2" }`. You can modify this object to apply custom CSS classes.
*/
onUpdateQuestionCssClasses?(question: Question, element: Question, cssClasses: any): void;
/**
* A function that is called when a custom question type property is changed. Use it to handle property changes.
*
* Parameters:
*
* - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A custom question.
* - `propertyName`: `string`\
* The name of the changed property.
* - `newValue`: `any`\
* A new value for the property.
*/
onPropertyChanged?(question: Question, propertyName: string, newValue: any): void;
/**
* A function that is called after the question value is changed in the UI.
*
* Parameters:
*
* - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A custom question.
* - `name`: `string`\
* The question's [name](https://surveyjs.io/Documentation/Library?id=Question#name).
* - `newValue`: `any`\
* A new value for the question.
*
* If you want to perform some actions when the value is changed in code as well as in the UI, implement the [`onValueSet`](https://surveyjs.io/form-library/documentation/api-reference/icustomquestiontypeconfiguration#onValueSet) function.
*/
onValueChanged?(question: Question, name: string, newValue: any): void;
/**
* A function that is called before a question value is changed in the UI.
*
* This function should return the value you want to save: `newValue`, a custom value, or `undefined` if you want to clear the question value.
*
* Parameters:
*
* - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A custom question.
* - `name`: `string`\
* The question's [name](https://surveyjs.io/Documentation/Library?id=Question#name).
* - `newValue`: `any`\
* A new value for the question.
*/
onValueChanging?(question: Question, name: string, newValue: any): any;
/**
* A function that is called when an [ItemValue](https://surveyjs.io/Documentation/Library?id=itemvalue) property is changed.
*
* Parameters:
*
* - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A custom question.
* - `options.obj`: [ItemValue](https://surveyjs.io/Documentation/Library?id=itemvalue)\
* An `ItemValue` object.
* - `options.propertyName`: `string`\
* The name of the property to which an array of `ItemValue` objects is assigned (for example, `"choices"` or `"rows"`).
* - `options.name`: `string`\
* The name of the changed property: `"text"` or `"value"`.
* - `options.newValue`: `any`\
* A new value for the property.
*/
onItemValuePropertyChanged?(question: Question, options: {
obj: ItemValue;
propertyName: string;
name: string;
newValue: any;
}): void;
/**
* A function that allows you to override the default `getDisplayValue()` implementation.
*/
getDisplayValue?: ((keyAsText: boolean, value: any) => any) | ((question: Question) => any);
/**
* JSON schemas of nested questions. Specify this property to create a [composite question type](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types).
*/
elementsJSON?: any;
/**
* A function that allows you to create nested questions if you do not specify the `elementsJSON` property.
*
* @see elementsJSON
*/
createElements?: any;
/**
* A JSON schema for a built-in question type on which the custom question type is based.
*
* Refer to the [Create Specialized Question Types](https://surveyjs.io/form-library/documentation/customize-question-types/create-specialized-question-types) help topic for more information.
*/
questionJSON?: any;
/**
* A function that allows you to create a custom question if you do not specify the `questionJSON` property.
*
* @see questionJSON
*/
createQuestion?: any;
/**
* A function that allows you to display different error texts based on conditions.
* @param question A custom question. Use the `question.value` property to access the question's value.
* @returns An error text.
*/
getErrorText?: (question: Question) => string;
/**
* A function that is called after the question value is set.
*
* Parameters:
*
* - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A custom question.
* - `newValue`: `any`\
* A new value for the question.
*
* Unlike the [`onValueChanged`](https://surveyjs.io/form-library/documentation/api-reference/icustomquestiontypeconfiguration#onValueChanged) function, which is called only when the question value is changed in the UI, `onValueSet` is called when the value is changed in code as well.
*
* [View Demo](https://surveyjs.io/survey-creator/examples/smart-search-input/ (linkStyle))
*/
onValueSet?: (question: Question, newValue: any) => void;
onSetQuestionValue?: (question: Question, newValue: any) => void;
valueToQuestion?: (val: any) => any;
valueFromQuestion?: (val: any) => any;
getValue?: (val: any) => any;
setValue?: (val: any) => any;
}
export class ComponentQuestionJSON {
name: string;
json: ICustomQuestionTypeConfiguration;
private dynamicProperties;
constructor(name: string, json: ICustomQuestionTypeConfiguration);
onInit(): void;
onCreated(question: Question): void;
onLoaded(question: Question): void;
onAfterRender(question: Question, htmlElement: any): void;
onAfterRenderContentElement(question: Question, element: Question, htmlElement: any): void;
onUpdateQuestionCssClasses(question: Question, element: Question, css: any): void;
onSetQuestionValue(question: Question, newValue: any): void;
onPropertyChanged(question: Question, propertyName: string, newValue: any): void;
onValueChanged(question: Question, name: string, newValue: any): void;
onValueChanging(question: Question, name: string, newValue: any): any;
onGetErrorText(question: Question): string;
onItemValuePropertyChanged(question: Question, item: ItemValue, propertyName: string, name: string, newValue: any): void;
getDisplayValue(keyAsText: boolean, value: any, question: Question): any;
get defaultQuestionTitle(): any;
setValueToQuestion(val: any): any;
getValueFromQuestion(val: any): any;
get isComposite(): boolean;
getDynamicProperties(): Array;
private calcDynamicProperties;
}
export class ComponentCollection {
static Instance: ComponentCollection;
private customQuestionValues;
onCreateComposite: (name: string, questionJSON: ComponentQuestionJSON) => QuestionCompositeModel;
onCreateCustom: (name: string, questionJSON: ComponentQuestionJSON) => QuestionCustomModel;
onAddingJson: (name: string, isComposite: boolean) => void;
add(json: ICustomQuestionTypeConfiguration): void;
remove(componentName: string): boolean;
get items(): Array;
getCustomQuestionByName(name: string): ComponentQuestionJSON;
private getCustomQuestionIndex;
private removeByIndex;
clear(includeInternal?: boolean): void;
createQuestion(name: string, questionJSON: ComponentQuestionJSON): Question;
protected createCompositeModel(name: string, questionJSON: ComponentQuestionJSON): QuestionCompositeModel;
protected createCustomModel(name: string, questionJSON: ComponentQuestionJSON): QuestionCustomModel;
}
export abstract class QuestionCustomModelBase extends Question implements ISurveyImpl, ISurveyData, IPanel {
customQuestion: ComponentQuestionJSON;
private locQuestionTitle;
constructor(name: string, customQuestion: ComponentQuestionJSON);
getType(): string;
locStrsChanged(): void;
localeChanged(): void;
protected getDefaultTitle(): string;
addUsedLocales(locales: Array): void;
needResponsiveWidth(): boolean;
protected createWrapper(): void;
protected onPropertyValueChanged(name: string, oldValue: any, newValue: any): void;
itemValuePropertyChanged(item: ItemValue, name: string, oldValue: any, newValue: any): void;
onFirstRendering(): void;
onHidingContent(): void;
getProgressInfo(): IProgressInfo;
protected abstract getElement(): SurveyElement;
protected initElement(el: SurveyElement): void;
protected isSettingValOnLoading: boolean;
setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void;
onSurveyLoad(): void;
afterRenderQuestionElement(el: HTMLElement): void;
afterRenderCore(el: any): void;
protected onUpdateQuestionCssClasses(element: Question, css: any): void;
protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void;
protected setNewValue(newValue: any): void;
protected onCheckForErrors(errors: Array, isOnValueChanged: boolean): void;
getSurveyData(): ISurveyData;
getTextProcessor(): ITextProcessor;
getValue(name: string): any;
setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any;
protected getQuestionByName(name: string): IQuestion;
protected isValueChanging(name: string, newValue: any): boolean;
protected convertDataName(name: string): string;
protected convertDataValue(name: string, newValue: any): any;
getVariable(name: string): any;
setVariable(name: string, newValue: any): void;
getComment(name: string): string;
setComment(name: string, newValue: string, locNotification: any): any;
getAllValues(): any;
getFilteredValues(): any;
getFilteredProperties(): any;
findQuestionByName(name: string): IQuestion;
getEditingSurveyElement(): Base;
addElement(element: IElement, index: number): void;
removeElement(element: IElement): boolean;
getQuestionTitleLocation(): string;
getQuestionTitleWidth(): string;
getColumsForElement(el: IElement): Array;
updateColumns(): void;
getQuestionStartIndex(): string;
getChildrenLayoutType(): string;
elementWidthChanged(el: IElement): void;
get elements(): Array;
indexOf(el: IElement): number;
ensureRowsVisibility(): void;
validateContainerOnly(): void;
onQuestionValueChanged(el: IElement): void;
getQuestionErrorLocation(): string;
protected getContentDisplayValueCore(keyAsText: boolean, value: any, question: Question): any;
}
export class QuestionCustomModel extends QuestionCustomModelBase {
private questionWrapper;
private hasJSONTitle;
getTemplate(): string;
getDynamicProperties(): Array;
getDynamicType(): string;
getOriginalObj(): Base;
protected createWrapper(): void;
private getDynamicProperty;
protected getElement(): SurveyElement;
onAnyValueChanged(name: string, questionName: string): void;
protected getQuestionByName(name: string): IQuestion;
protected getDefaultTitle(): string;
setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any;
protected onSetData(): void;
hasErrors(fireCallback?: boolean, rec?: any): boolean;
focus(onError?: boolean): void;
afterRenderCore(el: any): void;
get contentQuestion(): Question;
protected createQuestion(): Question;
private checkCreatedQuestion;
onSurveyLoad(): void;
runCondition(values: HashTable, properties: HashTable): void;
protected convertDataName(name: string): string;
protected convertDataValue(name: string, newValue: any): any;
protected getContentQuestionValue(): any;
protected setContentQuestionValue(val: any): void;
protected canSetValueToSurvey(): boolean;
protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void;
onSurveyValueChanged(newValue: any): void;
protected getValueCore(): any;
private isSettingValueChanged;
protected setValueChangedDirectly(val: boolean): void;
private createDynamicProperties;
protected initElement(el: SurveyElement): void;
updateElementCss(reNew?: boolean): void;
protected updateElementCssCore(cssClasses: any): void;
protected getDisplayValueCore(keyAsText: boolean, value: any): any;
}
export class QuestionCompositeModel extends QuestionCustomModelBase {
customQuestion: ComponentQuestionJSON;
static ItemVariableName: string;
private panelWrapper;
private textProcessing;
constructor(name: string, customQuestion: ComponentQuestionJSON);
protected createWrapper(): void;
getTemplate(): string;
protected getElement(): SurveyElement;
protected getCssRoot(cssClasses: any): string;
get contentPanel(): PanelModel;
hasErrors(fireCallback?: boolean, rec?: any): boolean;
updateElementCss(reNew?: boolean): void;
dispose(): void;
private editingObjValue;
private onEditingObjPropertyChanged;
private updateEditingObj;
private unConnectEditingObj;
getEditingSurveyElement(): Base;
getTextProcessor(): ITextProcessor;
findQuestionByName(name: string): IQuestion;
protected clearValueIfInvisibleCore(reason: string): void;
onAnyValueChanged(name: string, questionName: string): void;
get hasSingleInput(): boolean;
get isContainer(): boolean;
protected createPanel(): PanelModel;
protected onReadOnlyChanged(): void;
updateValueFromSurvey(newValue: any, clearData?: boolean): void;
onSurveyLoad(): void;
private setIsContentElement;
setVisibleIndex(val: number): number;
runCondition(values: HashTable, properties: HashTable): void;
onSurveyValueChanged(newValue: any): void;
getValue(name: string): any;
protected getQuestionByName(name: string): IQuestion;
private settingNewValue;
setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any;
private runPanelTriggers;
getFilteredValues(): any;
private updateValueCoreWithPanelValue;
private getContentPanelValue;
private getValueForContentPanel;
private setNewValueIntoQuestion;
addConditionObjectsByContext(objects: Array, context: any): void;
protected collectNestedQuestionsCore(questions: Question[], visibleOnly: boolean): void;
protected convertDataValue(name: string, newValue: any): any;
protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void;
private setValuesIntoQuestions;
protected getDisplayValueCore(keyAsText: boolean, value: any): any;
private setAfterRenderCallbacks;
}
}
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, showInToolbox?: boolean): void;
registerCustomQuestion(questionType: string): void;
unregisterElement(elementType: string, removeFromSerializer?: boolean): void;
clear(): void;
getAllTypes(): Array;
createQuestion(questionType: string, name: string): Question;
}
export class ElementFactory {
static Instance: ElementFactory;
private creatorHash;
registerElement(elementType: string, elementCreator: (name: string) => IElement, showInToolbox?: boolean): void;
registerCustomQuestion: (questionType: string, showInToolbox?: boolean) => void;
clear(): void;
unregisterElement(elementType: string, removeFromSerializer?: boolean): void;
getAllToolboxTypes(): Array;
getAllTypes(): Array;
createElement(elementType: string, name: string): IElement;
private getAllTypesCore;
}
}
declare module "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";
import { AnimationGroup } from "utils/animation";
import { PanelLayoutColumnModel } from "panel-layout-column";
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;
protected equalsCore(obj: Base): boolean;
get elements(): Array;
protected getIsAnimationAllowed(): boolean;
private getVisibleElementsAnimationOptions;
visibleElementsAnimation: AnimationGroup;
set visibleElements(val: Array);
get visibleElements(): Array;
onVisibleChangedCallback: () => void;
get visible(): boolean;
set visible(val: boolean);
get isNeedRender(): boolean;
set isNeedRender(val: boolean);
updateVisible(): void;
addElement(q: IElement): void;
get index(): number;
private setWidth;
private getRenderedCalcWidth;
private getElementWidth;
private getRenderedWidthFromWidth;
dragTypeOverMe: DragTypeOverMeEnum;
dispose(): void;
getRowCss(): string;
private rootElement?;
setRootElement(element?: HTMLElement): void;
getRootElement(): HTMLElement;
}
/**
* A base class for the [PanelModel](https://surveyjs.io/form-library/documentation/panelmodel) and [PageModel](https://surveyjs.io/form-library/documentation/pagemodel) classes.
*/
export class PanelModelBase extends SurveyElement implements IPanel, IConditionRunner, ISurveyErrorOwner, ITitleOwner {
private static panelCounter;
private static getPanelId;
private elementsValue;
private isQuestionsReady;
private questionsValue;
private _columns;
private _columnsReady;
layoutColumns: Array;
addElementCallback: (element: IElement) => void;
removeElementCallback: (element: IElement) => void;
onGetQuestionTitleLocation: () => string;
private dragDropPanelHelper;
onAddRow(row: QuestionRowModel): void;
private getRowsAnimationOptions;
private rowsAnimation;
get visibleRows(): Array;
set visibleRows(val: Array);
onRemoveRow(row: QuestionRowModel): void;
onRowVisibleChanged(): void;
constructor(name?: string);
getType(): string;
setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void;
endLoadingFromJson(): void;
showTitle: boolean;
get hasTitle(): boolean;
delete(doDispose?: boolean): void;
private deletePanel;
protected removeFromParent(): void;
protected canShowTitle(): boolean;
showDescription: boolean;
get _showDescription(): boolean;
localeChanged(): void;
locStrsChanged(): void;
getMarkdownHtml(text: string, name: string): string;
get locNavigationTitle(): LocalizableString;
get renderedNavigationTitle(): string;
/**
* Returns a character or text string that indicates a required panel/page.
* @see SurveyModel.requiredText
* @see isRequired
*/
get requiredText(): string;
protected get titlePattern(): string;
get isRequireTextOnStart(): boolean;
get isRequireTextBeforeTitle(): boolean;
get isRequireTextAfterTitle(): boolean;
/**
* Specifies a custom error message for a required panel/page.
* @see isRequired
* @see requiredIf
*/
get requiredErrorText(): string;
set requiredErrorText(val: string);
get locRequiredErrorText(): LocalizableString;
/**
* Specifies the sort order of questions in the panel/page.
*
* Possible values:
*
* - `"initial"` - Preserves the original order of questions.
* - `"random"` - Displays questions in random order.
* - `"default"` (default) - Inherits the setting from the Survey's `questionsOrder` property.
* @see SurveyModel.questionsOrder
* @see areQuestionsRandomized
*/
get questionsOrder(): string;
set questionsOrder(val: string);
private canRandomize;
protected isRandomizing: boolean;
randomizeElements(isRandom: boolean): 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;
getQuestions(includeNested: boolean): Array;
protected getValidName(name: string): string;
/**
* Returns a question with a specified `name`. This method does not find questions within nested panels.
* @param name A question name.
*/
getQuestionByName(name: string): Question;
/**
* Returns a survey element with a specified `name`. This method can find survey elements within nested elements.
* @param name An element name.
*/
getElementByName(name: string): IElement;
getQuestionByValueName(valueName: string): Question;
/**
* Returns a JSON object with question values nested in the panel/page.
* @see getDisplayValue
*/
getValue(): any;
collectValues(data: any, level: number): boolean;
/**
* Returns a JSON object with display texts that correspond to question values nested in the panel/page.
* @param keysAsText Pass `true` if not only values in the object should be display texts, but also keys. Default value: `false`.
* @see getValue
*/
getDisplayValue(keysAsText: boolean): any;
/**
* Returns a JSON object with comments left to questions within this panel/page. Question names are used as keys.
*/
getComments(): any;
/**
* Removes values that cannot be assigned to nested questions, for example, choices unlisted in the `choices` array.
*
* Call this method after you assign new question values in code to ensure that they are acceptable.
*
* > This method does not remove values for invisible questions and values that fail validation. Call the `validate()` method to validate newly assigned values.
*
* @see validate
*/
clearIncorrectValues(): void;
/**
* Empties the `errors` array for this panel/page and all its child elements (panels and questions).
* @see errors
*/
clearErrors(): void;
private markQuestionListDirty;
/**
* An array of all survey elements (questions or panels) within this panel/page. Does not include questions within nested panels.
* @see questions
*/
get elements(): Array;
getElementsInDesign(includeHidden?: boolean): Array;
/**
* Checks whether a given element belongs to this panel/page or nested panels.
* @param element A survey element to check.
*/
containsElement(element: IElement): boolean;
/**
* Makes the panel/page require an answer at least in one nested question. If a respondent leaves the panel/page without any answers, the survey displays a validation error.
* @see requiredIf
* @see [Data Validation](https://surveyjs.io/form-library/documentation/data-validation)
*/
get isRequired(): boolean;
set isRequired(val: boolean);
/**
* A Boolean expression. If it evaluates to `true`, this panel/page becomes required (at least one question in the panel/page should have an answer).
*
* A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.
*
* Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).
* @see isRequired
*/
get requiredIf(): string;
set requiredIf(val: string);
searchText(text: string, founded: Array): void;
hasErrors(fireCallback?: boolean, focusOnFirstError?: boolean, rec?: any): boolean;
/**
* Validates questions within this panel or page and returns `false` if the validation fails.
* @param fireCallback *(Optional)* Pass `false` if you do not want to show validation errors in the UI.
* @param focusOnFirstError *(Optional)* Pass `true` if you want to focus the first question with a validation error.
* @see [Data Validation](https://surveyjs.io/form-library/documentation/data-validation)
*/
validate(fireCallback?: boolean, focusOnFirstError?: boolean, rec?: any): boolean;
validateContainerOnly(): void;
onQuestionValueChanged(el: IElement): void;
private hasErrorsInPanels;
getErrorCustomText(text: string, error: SurveyError): string;
private hasRequiredError;
protected hasErrorsCore(rec: any): void;
protected getContainsErrors(): boolean;
updateElementVisibility(): void;
getFirstQuestionToFocus(withError?: boolean, ignoreCollapseState?: boolean): Question;
/**
* Focuses the first question in this panel/page.
* @see focusFirstErrorQuestion
*/
focusFirstQuestion(): void;
/**
* Focuses the first question with a validation error in this panel/page.
* @see validate
* @see focusFirstQuestion
*/
focusFirstErrorQuestion(): void;
addQuestionsToList(list: Array, visibleOnly?: boolean, includingDesignTime?: boolean): void;
addPanelsIntoList(list: Array, visibleOnly?: boolean, includingDesignTime?: boolean): void;
private addElementsToList;
private addElementsToListCore;
private calcMaxRowColSpan;
private updateColumnWidth;
private onColumnPropertyValueChangedCallback;
updateColumns(): void;
updateRootStyle(): void;
updateCustomWidgets(): void;
/**
* Sets a title location relative to the input field for questions that belong to this panel/page.
*
* Use this property to override the `questionTitleLocation` property specified for the survey. You can also set the `titleLocation` property for individual questions.
*
* Possible values:
*
* - `"default"` (default) - Inherits the setting from the `questionTitleLocation` property specified for the survey.
* - `"top"` - Displays the title above the input field.
* - `"bottom"` - Displays the title below the input field.
* - `"left"` - Displays the title to the left of the input field.
* - `"hidden"` - Hides the question title.
*
* > Certain question types (Matrix, Multiple Text) do not support the `"left"` value. For them, the `"top"` value is used.
* @see SurveyModel.questionTitleLocation
*/
get questionTitleLocation(): string;
set questionTitleLocation(value: string);
getQuestionTitleLocation(): string;
availableQuestionTitleWidth(): boolean;
hasElementWithTitleLocationLeft(): boolean;
/**
* Sets consistent width for question titles in CSS values. Applies only when [`questionTitleLocation`](#questionTitleLocation) evaluates to `"left"`.
*
* Default value: `undefined`
*/
questionTitleWidth: string;
getQuestionTitleWidth(): string;
get columns(): Array;
protected generateColumns(): void;
getColumsForElement(el: IElement): Array;
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;
private locCountRowUpdates;
private blockRowsUpdates;
private releaseRowsUpdates;
private updateRowsBeforeElementRemoved;
private updateRowsOnElementAdded;
protected onAddElement(element: IElement, index: number): void;
protected onRemoveElement(element: IElement): void;
private onRemoveElementNotifySurvey;
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);
onHidingContent(): void;
protected onVisibleChanged(): void;
protected notifyStateChanged(prevState: string): void;
/**
* Returns `true` if the panel/page is visible or the survey is currently in design mode.
*
* If you want to display or hide a question based on a condition, specify the `visibleIf` property. Refer to the following help topic for information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).
* @see visibleIf
* @see visible
*/
get isVisible(): boolean;
getIsContentVisible(exceptionQuestion?: IQuestion): boolean;
getIsPageVisible(exceptionQuestion?: IQuestion): boolean;
private lastVisibleIndex;
setVisibleIndex(index: number): number;
private updateVisibleIndexes;
private resetVisibleIndexes;
protected beforeSetVisibleIndex(index: number): number;
protected getPanelStartIndex(index: number): number;
protected isContinueNumbering(): boolean;
get isReadOnly(): boolean;
protected onReadOnlyChanged(): void;
updateElementCss(reNew?: boolean): void;
/**
* A Boolean expression. If it evaluates to `false`, this panel/page becomes read-only.
*
* A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.
*
* Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).
* @see readOnly
* @see isReadOnly
*/
get enableIf(): string;
set enableIf(val: string);
/**
* Adds a survey element (question or panel) to this panel/page. Returns `true` if the element was added successfully; `false` otherwise.
* @param element A survey element to add.
* @param index A desired index of this element in the `elements` array.
* @see addNewQuestion
* @see addNewPanel
*/
addElement(element: IElement, index?: number): boolean;
insertElement(element: IElement, dest?: IElement, location?: "bottom" | "top" | "left" | "right"): void;
insertElementAfter(element: IElement, after: IElement): void;
insertElementBefore(element: IElement, before: IElement): void;
protected canAddElement(element: IElement): boolean;
addQuestion(question: Question, index?: number): boolean;
addPanel(panel: PanelModel, index?: number): boolean;
/**
* Creates a new question of a given type and adds it to the `elements` array at a specified index.
*
* This method returns `null` if the question cannot be created or added to this panel/page; otherwise, the method returns the created question.
*
* @param questionType A [question type](https://surveyjs.io/form-library/documentation/question#getType).
* @param name A question name.
* @param index A desired index of the new question in the `elements` array.
* @see elements
* @see addElement
*/
addNewQuestion(questionType: string, name?: string, index?: number): Question;
/**
* Creates a new panel and adds it to the end of the `elements` array.
*
* This method returns `null` if the panel cannot be created or added to this panel/page; otherwise, the method returns the created panel.
* @param name A panel name.
* @see elementsup
* @see addElement
*/
addNewPanel(name?: string): PanelModel;
indexOf(element: IElement): number;
protected createNewPanel(name: string): PanelModel;
/**
* Deletes a survey element (question or panel) from this panel/page. Returns `true` if the element was deleted successfully; `false` otherwise.
* @param element A survey element to delete.
* @see elements
*/
removeElement(element: IElement): boolean;
removeQuestion(question: Question): void;
runCondition(values: HashTable, properties: HashTable): void;
onAnyValueChanged(name: string, questionName: string): void;
checkBindings(valueName: string, value: any): void;
dragDropAddTarget(dragDropInfo: DragDropInfo): void;
dragDropFindRow(findElement: ISurveyElement): QuestionRowModel;
dragDropMoveElement(src: IElement, target: IElement, targetIndex: number): void;
needResponsiveWidth(): boolean;
get hasDescriptionUnderTitle(): boolean;
get cssHeader(): string;
get cssDescription(): string;
/**
* Specifies the error message position for questions that belong to this page/panel.
*
* Use this property to override the [`questionErrorLocation`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#questionErrorLocation) property specified for the survey. You can also set the [`errorLocation`](https://surveyjs.io/form-library/documentation/question#errorLocation) property for individual questions.
*
* Possible values:
*
* - `"default"` (default) - Inherits the setting from the `questionErrorLocation` property specified for the survey.
* - `"top"` - Displays error messages above questions.
* - `"bottom"` - Displays error messages below questions.
*/
get questionErrorLocation(): string;
set questionErrorLocation(val: string);
getQuestionErrorLocation(): string;
get no(): string;
get cssError(): string;
protected getCssError(cssClasses: any): string;
getSerializableColumnsValue(): Array;
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;
get hasTextInTitle(): boolean;
private calcHasTextInTitle;
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);
protected removeFromParent(): void;
moveTo(container: IPanel, insertBefore?: any): boolean;
/**
* Returns the visible index of the panel in the survey. Commonly it is -1 and it doesn't show.
* You have to set showNumber to true to show index/numbering for the Panel
* @see showNumber
*/
get visibleIndex(): number;
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 notifyStateChanged(prevState: string): void;
protected createLocTitleProperty(): LocalizableString;
protected beforeSetVisibleIndex(index: number): number;
protected getPanelStartIndex(index: number): number;
protected isContinueNumbering(): boolean;
private notifySurveyOnVisibilityChanged;
protected getRenderedTitle(str: string): string;
/**
* Increases or decreases an indent of panel content from the left edge. Accepts positive integer values and 0.
*/
get innerIndent(): number;
set innerIndent(val: number);
/**
* Disable this property if you want to render the current panel on the same line or row with the previous question or panel.
*/
get startWithNewLine(): boolean;
set startWithNewLine(value: boolean);
get allowAdaptiveActions(): boolean;
set allowAdaptiveActions(val: boolean);
get innerPaddingLeft(): string;
set innerPaddingLeft(val: string);
private onIndentChanged;
private getIndentSize;
clearOnDeletingContainer(): void;
get footerActions(): Array;
private footerToolbarValue;
onGetFooterActionsCallback: () => Array;
onGetFooterToolbarCssCallback: () => string;
getFooterToolbar(): ActionContainer;
get hasEditButton(): boolean;
cancelPreview(): void;
get cssTitle(): string;
get showErrorsAbovePanel(): boolean;
protected getCssError(cssClasses: any): string;
protected onVisibleChanged(): void;
needResponsiveWidth(): boolean;
focusIn(): void;
protected getHasFrameV2(): boolean;
protected getIsNested(): boolean;
get showPanelAsPage(): boolean;
protected onElementExpanded(elementIsRendered: boolean): void;
protected getCssRoot(cssClasses: {
[index: string]: string;
}): string;
getContainerCss(): string;
}
}
declare module "utils/camera" {
export class Camera {
static mediaDevicesCallback: ((callback: (devices: Array) => void) => void) | undefined;
static clear(): void;
static setCameraList(list: Array): void;
private static cameraList;
private static cameraIndex;
private static cameraFacingMode;
private static canSwitchFacingMode;
hasCamera(callback: (res: boolean) => void): void;
getMediaConstraints(videoSize?: {
width?: number;
height?: number;
}): MediaStreamConstraints;
startVideo(videoElementId: string, callback: (stream: MediaStream) => void, imageWidth?: number, imageHeight?: number): void;
getImageSize(videoEl: HTMLVideoElement): {
width: number;
height: number;
};
snap(videoElementId: string, callback: BlobCallback): boolean;
private canFlipValue;
private updateCanFlipValue;
private onCanFlipChangedCallback?;
canFlip(onCanFlipChangedCallback?: (res: boolean) => void): boolean;
flip(): void;
private hasCameraCallback;
private setVideoInputs;
}
}
declare module "question_file" {
import { IPlainDataOptions } from "base-interfaces";
import { IQuestionPlainData, Question } from "question";
import { EventBase } from "base";
import { SurveyError } from "survey-error";
import { ActionContainer } from "actions/container";
import { Action } from "actions/action";
import { Camera } from "utils/camera";
import { LocalizableString } from "localizablestring";
export function dataUrl2File(dataUrl: string, fileName: string, type: string): File;
/**
* A base class for question types that support file upload: `QuestionFileModel` and `QuestionSignaturePadModel`.
*/
export class QuestionFileModelBase extends Question {
isUploading: boolean;
currentState: string;
/**
* An event that is raised after the upload state has changed.
*
* Parameters:
*
* - `sender`: `SurveyModel`\
* A survey instance that raised the event.
* - `options.state`: `string`\
* The current upload state: `"empty"`, `"loading"`, `"loaded"`, or `"error"`.
*/
onUploadStateChanged: EventBase;
onStateChanged: EventBase;
protected stateChanged(state: string): void;
get showLoadingIndicator(): boolean;
/**
* Specifies whether to store file or signature content as text in `SurveyModel`'s [`data`](https://surveyjs.io/form-library/documentation/surveymodel#data) property.
*
* If you disable this property, implement `SurveyModel`'s [`onUploadFiles`](https://surveyjs.io/form-library/documentation/surveymodel#onUploadFiles) event handler to specify how to store file content.
*/
get storeDataAsText(): boolean;
set storeDataAsText(val: boolean);
/**
* Enable this property if you want to wait until files are uploaded to complete the survey.
*
* Default value: `false`
*/
get waitForUpload(): boolean;
set waitForUpload(val: boolean);
clearValue(keepComment?: boolean): void;
clearOnDeletingContainer(): void;
protected onCheckForErrors(errors: Array, isOnValueChanged: boolean): void;
protected uploadFiles(files: File[]): void;
}
/**
* A class that describes the File Upload question type.
*
* [View Demo](https://surveyjs.io/form-library/examples/file-upload/ (linkStyle))
*/
export class QuestionFileModel extends QuestionFileModelBase {
isDragging: boolean;
previewValue: any[];
indexToShow: number;
pageSize: number;
containsMultiplyFiles: boolean;
allowCameraAccess: boolean;
/**
* Specifies the source of uploaded files.
*
* Possible values:
*
* - `"file"` (default) - Allows respondents to select a local file.
* - `"camera"` - Allows respondents to capture and upload a photo.
* - `"file-camera"` - Allows respondents to select a local file or capture a photo.
* @see filePlaceholder
* @see photoPlaceholder
* @see fileOrPhotoPlaceholder
*/
sourceType: string;
fileNavigator: ActionContainer;
protected prevFileAction: Action;
protected nextFileAction: Action;
protected fileIndexAction: Action;
closeCameraAction: Action;
takePictureAction: Action;
changeCameraAction: Action;
chooseFileAction: Action;
startCameraAction: Action;
cleanAction: Action;
actionsContainer: ActionContainer;
get fileNavigatorVisible(): boolean;
private get pagesCount();
get actionsContainerVisible(): boolean;
constructor(name: string);
get videoId(): string;
get hasVideoUI(): boolean;
get hasFileUI(): boolean;
private videoStream;
startVideo(): void;
private startVideoInCamera;
stopVideo(): void;
snapPicture(): void;
private canFlipCameraValue;
canFlipCamera(): boolean;
flipCamera(): void;
private closeVideoStream;
onHidingContent(): void;
protected updateElementCssCore(cssClasses: any): void;
private getFileIndexCaption;
private updateFileNavigator;
private prevPreviewLength;
private previewValueChanged;
isPreviewVisible(index: number): boolean;
getType(): string;
/**
* Disable this property only to implement a custom preview.
*
* [View Demo](https://surveyjs.io/form-library/examples/file-custom-preview/ (linkStyle))
* @see allowImagesPreview
*/
get showPreview(): boolean;
set showPreview(val: boolean);
/**
* Specifies whether users can upload multiple files.
*
* Default value: `false`
*/
get allowMultiple(): boolean;
set allowMultiple(val: boolean);
/**
* The image height.
*/
get imageHeight(): string;
set imageHeight(val: string);
/**
* The image width.
*/
get imageWidth(): string;
set imageWidth(val: string);
/**
* An [accept](https://www.w3schools.com/tags/att_input_accept.asp) attribute value for the underlying `` element.
*/
get acceptedTypes(): string;
set acceptedTypes(val: string);
/**
* Specifies whether to show a preview of image files.
*/
get allowImagesPreview(): boolean;
set allowImagesPreview(val: boolean);
/**
* Maximum allowed file size, measured in bytes.
*
* Default value: 0 (unlimited)
*/
get maxSize(): number;
set maxSize(val: number);
chooseFile(event: MouseEvent): void;
/**
* Specifies whether users should confirm file deletion.
*
* Default value: `false`
*/
get needConfirmRemoveFile(): boolean;
set needConfirmRemoveFile(val: boolean);
getConfirmRemoveMessage(fileName: string): string;
confirmRemoveMessage: string;
confirmRemoveAllMessage: string;
noFileChosenCaption: string;
chooseButtonCaption: string;
get takePhotoCaption(): string;
set takePhotoCaption(val: string);
get locTakePhotoCaption(): LocalizableString;
replaceButtonCaption: string;
removeFileCaption: string;
loadingFileTitle: string;
chooseFileTitle: string;
get clearButtonCaption(): string;
set clearButtonCaption(value: string);
get locClearButtonCaption(): LocalizableString;
/**
* A placeholder text displayed when the File Upload question doesn't contain any files or photos to upload. Applies only when [`sourceType`](#sourceType) value is `"file-camera"`.
* @see filePlaceholder
* @see photoPlaceholder
*/
fileOrPhotoPlaceholder: string;
/**
* A placeholder text displayed when the File Upload question doesn't contain any photos to upload. Applies only when the [`sourceType`](#sourceType) value is `"camera"`.
* @see filePlaceholder
* @see fileOrPhotoPlaceholder
*/
photoPlaceholder: string;
/**
* A placeholder text displayed when the File Upload question doesn't contain any files to upload. Applies only when the [`sourceType`](#sourceType) value is `"file"`.
* @see photoPlaceholder
* @see fileOrPhotoPlaceholder
*/
filePlaceholder: string;
locRenderedPlaceholderValue: LocalizableString;
get locRenderedPlaceholder(): LocalizableString;
get currentMode(): string;
get isPlayingVideo(): boolean;
private setIsPlayingVideo;
private updateCurrentMode;
private updateActionsVisibility;
get inputTitle(): string;
get chooseButtonText(): string;
clear(doneCallback?: () => void): void;
get renderCapture(): string;
get multipleRendered(): string;
get showChooseButton(): boolean;
get showFileDecorator(): boolean;
get allowShowPreview(): boolean;
get showPreviewContainer(): boolean;
get showRemoveButtonCore(): boolean;
get showRemoveButton(): boolean;
get showRemoveButtonBottom(): boolean;
defaultImage(data: any): boolean;
/**
* Removes a file with a specified name.
*/
removeFile(name: string): void;
protected removeFileByContent(content: any): void;
protected setValueFromResult(arg: any): void;
/**
* Loads multiple files into the question.
* @param files An array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects.
*/
loadFiles(files: File[]): void;
private cameraValue;
protected get camera(): Camera;
canPreviewImage(fileItem: any): boolean;
protected loadPreview(newValue: any): void;
private isFileLoadingValue;
protected get isFileLoading(): boolean;
protected set isFileLoading(val: boolean);
protected getIsQuestionReady(): boolean;
private allFilesOk;
private isFileImage;
getPlainData(options?: IPlainDataOptions): IQuestionPlainData;
getImageWrapperCss(data: any): string;
protected getActionsContainerCss(css: any): string;
getRemoveButtonCss(): string;
getChooseFileCss(): string;
getReadOnlyFileCss(): string;
get fileRootCss(): string;
getFileDecoratorCss(): string;
private onChange;
protected onChangeQuestionValue(newValue: any): void;
protected calcCssClasses(css: any): any;
onSurveyLoad(): void;
protected needResponsiveness(): boolean;
protected supportResponsiveness(): boolean;
protected getObservedElementSelector(): string;
private getFileListSelector;
private calcAvailableItemsCount;
private calculatedGapBetweenItems;
private calculatedItemWidth;
private _width;
triggerResponsiveness(hard?: boolean): void;
protected processResponsiveness(_: number, availableWidth: number): boolean;
private rootElement;
private canDragDrop;
afterRenderQuestionElement(el: HTMLElement): void;
beforeDestroyQuestionElement(el: HTMLElement): void;
private dragCounter;
onDragEnter: (event: any) => void;
onDragOver: (event: any) => boolean;
onDrop: (event: any) => void;
onDragLeave: (event: any) => void;
doChange: (event: any) => void;
doClean: () => void;
private clearFilesCore;
doRemoveFile(data: any, event: any): void;
private removeFileCore;
doDownloadFileFromContainer: (event: MouseEvent) => void;
doDownloadFile: (event: any, data: any) => void;
dispose(): void;
}
export class FileLoader {
private fileQuestion;
private callback;
constructor(fileQuestion: 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. You can also specify additional application-wide settings using the [`settings.web`](https://surveyjs.io/form-library/documentation/api-reference/settings#web) object.
*/
export class ChoicesRestful extends Base {
private static cacheText;
private static noCacheText;
static get EncodeParameters(): boolean;
static set EncodeParameters(val: boolean);
static clearCache(): void;
private static itemsResult;
private static sendingSameRequests;
private static addSameRequest;
private static unregisterSameRequests;
static get onBeforeSendRequest(): (sender: ChoicesRestful, options: {
request: XMLHttpRequest;
}) => void;
static set onBeforeSendRequest(val: (sender: ChoicesRestful, options: {
request: XMLHttpRequest;
}) => void);
private static getCachedItemsResult;
private lastObjHash;
private isRunningValue;
protected processedUrl: string;
protected processedPath: string;
private isUsingCacheFromUrl;
onProcessedUrlCallback: (url: string, path: string) => void;
getResultCallback: (items: Array) => void;
beforeSendRequestCallback: () => void;
updateResultCallback: (items: Array, serverResult: any) => Array;
getItemValueCallback: (item: any) => any;
error: SurveyError;
owner: IQuestion;
createItemValue: (value: any) => ItemValue;
constructor();
getSurvey(live?: boolean): ISurvey;
run(textProcessor?: ITextProcessor): void;
get isUsingCache(): boolean;
get isRunning(): boolean;
protected getIsRunning(): boolean;
get isWaitingForParameters(): boolean;
protected useChangedItemsResults(): boolean;
private doEmptyResultCallback;
private processedText;
protected parseResponse(response: any): any;
protected sendRequest(): void;
getType(): string;
get isEmpty(): boolean;
getCustomPropertiesNames(): Array;
private getCustomPropertyName;
private getCustomProperties;
setData(json: any): void;
getData(): any;
/**
* A RESTful service's URL.
*
* This property supports [dynamic URLs](https://surveyjs.io/Documentation/Library?id=design-survey-conditional-logic#dynamic-texts). For example, the URL below depends on the `region` question's value. When the value changes, the survey automatically loads a new dataset that corresponds to the selected region.
*
* ```js
* url: "https://surveyjs.io/api/CountriesExample?region={region}"
* ```
*
* [View Demo](https://surveyjs.io/Examples/Library/?id=questiontype-dropdownrestfull (linkStyle))
* @see path
* @see valueName
* @see titleName
*/
get url(): string;
set url(val: string);
/**
* Path to the array of choices. The following path separators are allowed: semicolon `;`, comma `,`.
*
* Specify this property only if the array of choices is nested within the object returned by the service. For example, the service returns the following object:
*
* ```js
* {
* countries: [ ... ],
* capitals: [ ... ]
* }
* ```
*
* To populate choices with values from the `countries` array, set the `path` property to `"countries"`. To use the `capitals` array, set this property to `"capitals"`.
* @see url
* @see valueName
* @see titleName
*/
get path(): string;
set path(val: string);
/**
* Specifies which property in the obtained data object contains choice values.
*
* [View Demo](https://surveyjs.io/Examples/Library/?id=questiontype-dropdownrestfull (linkStyle))
*
* @see url
* @see path
* @see titleName
*/
get valueName(): string;
set valueName(val: string);
/**
* Specifies which property in the obtained data object contains display texts for choices.
*
* @see url
* @see path
* @see valueName
*/
get titleName(): string;
set titleName(val: string);
/**
* Specifies which property in the obtained data object contains image URLs. Used only in [Image Picker](https://surveyjs.io/Examples/Library?id=questiontype-imagepicker) questions.
*
* @see url
* @see path
* @see valueName
*/
get imageLinkName(): string;
set imageLinkName(val: string);
/**
* Specifies whether the service is allowed to return an empty response or an empty array in a response.
*
* Default value: `false`
*/
get allowEmptyResponse(): boolean;
set allowEmptyResponse(val: boolean);
get attachOriginalItems(): boolean;
set attachOriginalItems(val: boolean);
get itemValueType(): string;
clear(): void;
protected beforeSendRequest(): void;
protected beforeLoadRequest(): void;
protected onLoad(result: any, loadingObjHash?: string): void;
protected callResultCallback(items: Array, loadingObjHash: string): void;
private setCustomProperties;
private getPropertyBinding;
private onError;
private getResultAfterPath;
private getPathes;
private getValue;
private setTitle;
private getImageLink;
private getValueCore;
private get objHash();
}
/**
* Obsolete, please use ChoicesRestful
*/
export class ChoicesRestfull extends ChoicesRestful {
static get EncodeParameters(): boolean;
static set EncodeParameters(val: boolean);
static clearCache(): void;
static get onBeforeSendRequest(): (sender: ChoicesRestful, options: {
request: XMLHttpRequest;
}) => void;
static set onBeforeSendRequest(val: (sender: ChoicesRestful, options: {
request: XMLHttpRequest;
}) => void);
}
}
declare module "question_baseselect" {
import { SurveyError } from "survey-error";
import { ISurveyImpl, ISurvey, ISurveyData, IPlainDataOptions } from "base-interfaces";
import { IQuestionPlainData, 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 ([Checkboxes](https://surveyjs.io/form-library/documentation/questioncheckboxmodel), [Dropdown](https://surveyjs.io/form-library/documentation/questiondropdownmodel), [Radio Button Group](https://surveyjs.io/form-library/documentation/questionradiogroupmodel), etc.).
*/
export class QuestionSelectBase extends Question {
visibleChoicesChangedCallback: () => void;
loadedChoicesFromServerCallback: () => void;
private filteredChoicesValue;
private conditionChoicesVisibleIfRunner;
private conditionChoicesEnableIfRunner;
private prevOtherValue;
private otherItemValue;
private choicesFromUrl;
private cachedValueForUrlRequests;
private isChoicesLoaded;
private enableOnLoadingChoices;
private noneItemValue;
private refuseItemValue;
private dontKnowItemValue;
private newItemValue;
private canShowOptionItemCallback;
private waitingGetChoiceDisplayValueResponse;
private get waitingChoicesByURL();
protected selectedItemValues: any;
constructor(name: string);
getType(): string;
dispose(): void;
protected resetDependedQuestion(): void;
get otherId(): string;
protected getCommentElementsId(): Array;
protected getItemValueType(): string;
createItemValue(value: any, text?: string): ItemValue;
get isUsingCarryForward(): boolean;
get carryForwardQuestionType(): string;
private setCarryForwardQuestionType;
get isUsingRestful(): boolean;
updateIsUsingRestful(): void;
supportGoNextPageError(): boolean;
isLayoutTypeSupported(layoutType: string): boolean;
localeChanged(): void;
locStrsChanged(): void;
private prevOtherErrorValue;
private updatePrevOtherErrorValue;
get otherValue(): string;
set otherValue(val: string);
protected get otherValueCore(): string;
protected set otherValueCore(val: string);
/**
* Returns the "Other" choice item. Use this property to change the item's `value` or `text`.
* @see showOtherItem
*/
get otherItem(): ItemValue;
/**
* Returns `true` if the "Other" choice item is selected.
* @see showOtherItem
*/
get isOtherSelected(): boolean;
get isNoneSelected(): boolean;
/**
* Specifies whether to display the "None" choice item.
*
* When users select the "None" item in multi-select questions, all other items become unselected.
* @see noneItem
* @see noneText
* @see [settings.noneItemValue](https://surveyjs.io/form-library/documentation/api-reference/settings#noneItemValue)
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
*/
get showNoneItem(): boolean;
set showNoneItem(val: boolean);
get hasNone(): boolean;
set hasNone(val: boolean);
/**
* Returns the "None" choice item. Use this property to change the item's `value` or `text`.
* @see showNoneItem
*/
get noneItem(): ItemValue;
/**
* Gets or sets a caption for the "None" choice item.
* @see showNoneItem
*/
get noneText(): string;
set noneText(val: string);
get locNoneText(): LocalizableString;
/**
* Specifies whether to display the "Refuse to answer" choice item.
*
* When users select the "Refuse to answer" item in multi-select questions, all other items become unselected.
* @see refuseItem
* @see refuseItemText
* @see [settings.refuseItemValue](https://surveyjs.io/form-library/documentation/api-reference/settings#refuseItemValue)
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
*/
get showRefuseItem(): boolean;
set showRefuseItem(val: boolean);
/**
* Returns the "Refuse to answer" choice item. Use this property to change the item's `value` or `text`.
* @see showRefuseItem
*/
get refuseItem(): ItemValue;
/**
* Gets or sets a caption for the "Refuse to answer" choice item.
* @see showRefuseItem
*/
get refuseText(): string;
set refuseText(val: string);
get locRefuseText(): LocalizableString;
/**
* Specifies whether to display the "Don't know" choice item.
*
* When users select the "Don't know" item in multi-select questions, all other items become unselected.
* @see dontKnowItem
* @see dontKnowItemText
* @see [settings.dontKnowItemValue](https://surveyjs.io/form-library/documentation/api-reference/settings#dontKnowItemValue)
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
*/
get showDontKnowItem(): boolean;
set showDontKnowItem(val: boolean);
/**
* Returns the "Don't know" choice item. Use this property to change the item's `value` or `text`.
* @see showDontKnowItem
*/
get dontKnowItem(): ItemValue;
/**
* Gets or sets a caption for the "Don't know" choice item.
* @see showDontKnowItem
*/
get dontKnowText(): string;
set dontKnowText(val: string);
get locDontKnowText(): LocalizableString;
private createDefaultItem;
/**
* A Boolean expression that is evaluated against each choice item. If the expression evaluates to `false`, the choice item becomes hidden.
*
* A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.
*
* Use the `{item}` placeholder to reference the current choice item in the expression.
*
* Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).
* @see visibleIf
* @see choicesEnableIf
*/
get choicesVisibleIf(): string;
set choicesVisibleIf(val: string);
/**
* A Boolean expression that is evaluated against each choice item. If the expression evaluates to `false`, the choice item becomes read-only.
*
* A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.
*
* Use the `{item}` placeholder to reference the current choice item in the expression.
*
* Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).
* @see enableIf
* @see choicesVisibleIf
*/
get choicesEnableIf(): string;
set choicesEnableIf(val: string);
surveyChoiceItemVisibilityChange(): void;
runCondition(values: HashTable, properties: HashTable): void;
protected isTextValue(): boolean;
private isSettingDefaultValue;
protected setDefaultValue(): void;
protected getIsMultipleValue(): boolean;
protected convertDefaultValue(val: any): any;
protected filterItems(): boolean;
protected runItemsCondition(values: HashTable, properties: HashTable): boolean;
protected runItemsEnableCondition(values: HashTable, properties: HashTable): any;
protected onAfterRunItemsEnableCondition(): void;
protected onEnableItemCallBack(item: ItemValue): boolean;
protected onSelectedItemValuesChangedHandler(newValue: any): void;
protected getItemIfChoicesNotContainThisValue(value: any, text?: string): any;
protected getSingleSelectedItem(): ItemValue;
protected onGetSingleSelectedItem(selectedItemByValue: ItemValue): void;
protected getMultipleSelectedItems(): Array;
private setConditionalChoicesRunner;
private setConditionalEnableChoicesRunner;
private canSurveyChangeItemVisibility;
private changeItemVisibility;
private runConditionsForItems;
protected getHasOther(val: any): boolean;
protected getIsItemValue(val: any, item: ItemValue): boolean;
get validatedValue(): any;
protected createRestful(): ChoicesRestful;
private setNewRestfulProperty;
get autoOtherMode(): boolean;
set autoOtherMode(val: boolean);
protected getQuestionComment(): string;
protected selectOtherValueFromComment(val: boolean): void;
private isSettingComment;
protected setQuestionComment(newValue: string): void;
private onUpdateCommentOnAutoOtherMode;
private setOtherValueInternally;
clearValue(keepComment?: boolean): void;
updateCommentFromSurvey(newValue: any): any;
get renderedValue(): any;
set renderedValue(val: any);
private makeCommentEmpty;
protected setQuestionValue(newValue: any, updateIsAnswered?: boolean, updateComment?: boolean): void;
protected setValueCore(newValue: any): void;
protected setNewValue(newValue: any): void;
protected valueFromData(val: any): any;
protected rendredValueFromData(val: any): any;
protected rendredValueToData(val: any): any;
protected renderedValueFromDataCore(val: any): any;
protected rendredValueToDataCore(val: any): any;
protected needConvertRenderedOtherToDataValue(): boolean;
protected getIsQuestionReady(): boolean;
protected updateSelectedItemValues(): void;
private setCustomValuesIntoItems;
protected hasUnknownValue(val: any, includeOther?: boolean, isFilteredChoices?: boolean, checkEmptyValue?: boolean): boolean;
protected hasUnknownValueItem(val: any, includeOther?: boolean, isFilteredChoices?: boolean, checkEmptyValue?: boolean): boolean;
protected isValueDisabled(val: any): boolean;
/**
* 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. You can also specify additional application-wide settings using the [`settings.web`](https://surveyjs.io/form-library/documentation/api-reference/settings#web) object.
*
* [View Demo](https://surveyjs.io/form-library/examples/dropdown-menu-load-data-from-restful-service/ (linkStyle))
* @see choices
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
*/
get choicesByUrl(): ChoicesRestful;
set choicesByUrl(val: ChoicesRestful);
/**
* Gets or sets choice items. This property accepts an array of objects with the following structure:
*
* ```js
* {
* "value": any, // A unique value to be saved in the survey results.
* "text": String, // A display text. This property supports Markdown. When `text` is undefined, `value` is used.
* "imageLink": String // A link to the image or video that represents this choice value. Applies only to Image Picker questions.
* "customProperty": any // Any property that you find useful.
* }
* ```
*
* To enable Markdown support for the `text` property, implement Markdown-to-HTML conversion in the [onTextMarkdown](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onTextMarkdown) event handler. For an example, refer to the following demo: [Convert Markdown to HTML with 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
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
*/
get choices(): Array;
set choices(newValue: Array);
/**
* Copies choice items from a specified question. Accepts a question name.
*
* If you specify this property, the `choices`, `choicesVisibleIf`, `choicesEnableIf`, and `choicesOrder` properties do not apply because their values are copied.
*
* In addition, you can specify the `choicesFromQuestionMode` property if you do not want to copy all choice items.
* @see choicesFromQuestionMode
* @see choices
*/
get choicesFromQuestion(): string;
set choicesFromQuestion(val: string);
private isLockVisibleChoices;
/**
* Specifies which choice items to copy from another question. Applies only when the `choicesFromQuestion` property is specified.
*
* Possible values:
*
* - `"all"` (default) - Copies all choice items.
* - `"selected"` - Copies only selected choice items.
* - `"unselected"` - Copies only unselected choice items.
*
* Use the `visibleChoices` property to access copied choice items.
* @see choicesFromQuestion
* @see visibleChoices
*/
get choicesFromQuestionMode(): string;
set choicesFromQuestionMode(val: string);
/**
* Specifies which matrix column or dynamic panel question supplies choice values. Use this property to construct choice items based on cell values in Dynamic Matrix and question values in Dynamic Panel.
*
* Each choice item consists of a value saved in survey results and a text displayed in the UI. To construct a choice item, assign the `name` of a Dynamic Matrix or Dynamic Panel to the [`choicesFromQuestion`](#choicesFromQuestion) property and specify which dynamic panel question or matrix column supplies values and which provides texts. Use the `choiceValuesFromQuestion` and [`choiceTextsFromQuestion`](#choiceTextsFromQuestion) properties for this purpose. If a choice text is empty, a choice value is used as a display text and saved in survey results.
*/
get choiceValuesFromQuestion(): string;
set choiceValuesFromQuestion(val: string);
/**
* Specifies which matrix column or dynamic panel question supplies choice texts. Use this property to construct choice items based on cell values in Dynamic Matrix and question values in Dynamic Panel.
*
* Each choice item consists of a value saved in survey results and a text displayed in the UI. To construct a choice item, assign the `name` of a Dynamic Matrix or Dynamic Panel to the [`choicesFromQuestion`](#choicesFromQuestion) property and specify which dynamic panel question or matrix column supplies values and which provides texts. Use the [`choiceValuesFromQuestion`](#choiceValuesFromQuestion) and `choiceTextsFromQuestion` properties for this purpose. If a choice text is empty, a choice value is used as a display text and saved in survey results.
*/
get choiceTextsFromQuestion(): string;
set choiceTextsFromQuestion(val: string);
/**
* Specifies whether to hide the question if no choice items are visible.
*
* This property is useful if you show or hide choice items at runtime based on a [condition](https://surveyjs.io/form-library/documentation/questionselectbase#choicesVisibleIf).
*/
get hideIfChoicesEmpty(): boolean;
set hideIfChoicesEmpty(val: boolean);
/**
* Specifies whether to keep values that cannot be assigned to this question, for example, choices unlisted in the `choices` array.
*
* > This property cannot be specified in the survey JSON schema. Use dot notation to specify it.
* @see clearIncorrectValues
*/
get keepIncorrectValues(): boolean;
set keepIncorrectValues(val: boolean);
get storeOthersAsComment(): any;
set storeOthersAsComment(val: any);
protected hasOtherChanged(): void;
/**
* Specifies the sort order of choice items.
*
* Possible values:
*
* - `"none"` (default) - Preserves the original order of choice items.
* - `"asc"`- Sorts choice items in ascending order.
* - `"desc"`- Sorts choice items in ascending order.
* - `"random"` - Displays choice items in random order.
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
*/
get choicesOrder(): string;
set choicesOrder(val: string);
/**
* Gets or sets a caption for the "Other" choice item.
* @see showOtherItem
*/
get otherText(): string;
set otherText(val: string);
get locOtherText(): LocalizableString;
/**
* Displays the "Select All", "None", and "Other" choices on individual rows.
* @see showNoneItem
* @see showOtherItem
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
*/
separateSpecialChoices: boolean;
/**
* A placeholder for the comment area. Applies when the `showOtherItem` or `showCommentArea` property is `true`.
* @see showOtherItem
* @see showCommentArea
*/
otherPlaceholder: string;
get otherPlaceHolder(): string;
set otherPlaceHolder(newValue: string);
/**
* Gets or sets an error message displayed when users select the "Other" choice item but leave the comment area empty.
* @see showOtherItem
*/
get otherErrorText(): string;
set otherErrorText(val: string);
get locOtherErrorText(): LocalizableString;
/**
* An array of visible choice items. Includes the "Select All", "Other", and "None" choice items if they are visible. Items are sorted according to the `choicesOrder` value.
* @see showNoneItem
* @see showOtherItem
* @see choicesOrder
* @see choices
* @see enabledChoices
*/
get visibleChoices(): Array;
/**
* An array of choice items with which users can interact. Includes the "Select All", "Other", and "None" choice items if they are not disabled. Items are sorted according to the `choicesOrder` value.
* @see showNoneItem
* @see showOtherItem
* @see choicesOrder
* @see choices
* @see visibleChoices
*/
get enabledChoices(): Array;
protected updateVisibleChoices(): void;
private calcVisibleChoices;
protected canUseFilteredChoices(): boolean;
setCanShowOptionItemCallback(func: (item: ItemValue) => boolean): void;
get newItem(): ItemValue;
protected addToVisibleChoices(items: Array, isAddAll: boolean): void;
protected addNewItemToVisibleChoices(items: Array, isAddAll: boolean): void;
protected addNonChoicesItems(dict: Array<{
index: number;
item: ItemValue;
}>, isAddAll: boolean): void;
protected addNonChoiceItem(dict: Array<{
index: number;
item: ItemValue;
}>, item: ItemValue, isAddAll: boolean, showItem: boolean, order: Array): void;
protected canShowOptionItem(item: ItemValue, isAddAll: boolean, hasItem: boolean): boolean;
isItemInList(item: ItemValue): boolean;
protected get isAddDefaultItems(): boolean;
getPlainData(options?: IPlainDataOptions): IQuestionPlainData;
protected getDisplayValueCore(keysAsText: boolean, value: any): any;
protected getDisplayValueEmpty(): string;
private getChoicesDisplayValue;
protected getDisplayArrayValue(keysAsText: boolean, value: any, onGetValueCallback?: (index: number) => any): string;
private getItemDisplayValue;
private getFilteredChoices;
protected get activeChoices(): Array;
get isMessagePanelVisible(): boolean;
set isMessagePanelVisible(val: boolean);
private get isEmptyActiveChoicesInDesign();
getCarryForwardQuestion(data?: ISurveyData): Question;
protected getIsReadyDependsOn(): Array;
private getQuestionWithChoices;
private carryForwardQuestion;
private findCarryForwardQuestion;
private getQuestionWithChoicesCore;
private getQuestionWithArrayValue;
private getChoicesFromArrayQuestion;
private getValueKeyName;
private getChoicesFromSelectQuestion;
private copyChoiceItem;
protected get hasActiveChoices(): boolean;
protected isBuiltInChoice(item: ItemValue): boolean;
isNoneItem(item: ItemValue): boolean;
protected getNoneItems(): Array;
protected getChoices(): Array;
supportOther(): boolean;
supportNone(): boolean;
supportRefuse(): boolean;
supportDontKnow(): boolean;
protected isSupportProperty(propName: string): boolean;
protected onCheckForErrors(errors: Array, isOnValueChanged: boolean): void;
setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void;
protected setSurveyCore(value: ISurvey): void;
getStoreOthersAsComment(): boolean;
onSurveyLoad(): void;
onAnyValueChanged(name: string, questionName: string): void;
updateValueFromSurvey(newValue: any, clearData: boolean): void;
protected getCommentFromValue(newValue: any): string;
protected setOtherValueIntoValue(newValue: any): any;
onOtherValueInput(event: any): void;
onOtherValueChange(event: any): void;
private isRunningChoices;
private runChoicesByUrl;
private isFirstLoadChoicesFromUrl;
protected onBeforeSendRequest(): void;
protected onLoadChoicesFromUrl(array: Array): void;
private canAvoidSettChoicesFromUrl;
private setChoicesFromUrl;
private createCachedValueForUrlRequests;
private updateCachedValueForUrlRequests;
private isUpdatingChoicesDependedQuestions;
protected updateChoicesDependedQuestions(): void;
protected updateDependedQuestion(): void;
onSurveyValueChanged(newValue: any): void;
protected onVisibleChoicesChanged(): void;
protected isVisibleCore(): boolean;
private sortVisibleChoices;
private sortArray;
private randomizeArray;
private get hasChoicesUrl();
clearIncorrectValues(): void;
private canClearIncorrectValues;
protected hasValueToClearIncorrectValues(): boolean;
protected clearValueIfInvisibleCore(reason: string): void;
/**
* Returns `true` if a passed choice item is selected.
*
* To obtain a choice item to check, use the `noneItem` or `otherItem` property or the `choices` array.
* @param item A choice item.
* @see noneItem
* @see otherItem
* @see choices
*/
isItemSelected(item: ItemValue): boolean;
protected isItemSelectedCore(item: ItemValue): boolean;
private clearDisabledValues;
protected clearIncorrectValuesCore(): void;
protected canClearValueAnUnknown(val: any): boolean;
protected clearDisabledValuesCore(): void;
clearUnusedValues(): void;
getColumnClass(): string;
getItemIndex(item: any): number;
getItemClass(item: any): string;
protected getCurrentColCount(): number;
protected getItemClassCore(item: any, options: any): string;
getLabelClass(item: ItemValue): string;
getControlLabelClass(item: ItemValue): string;
private headItemsCount;
private footItemsCount;
get headItems(): ItemValue[];
get footItems(): ItemValue[];
get dataChoices(): ItemValue[];
get bodyItems(): ItemValue[];
get hasHeadItems(): boolean;
get hasFootItems(): boolean;
get columns(): any[];
get hasColumns(): boolean;
get rowLayout(): boolean;
get blockedRow(): boolean;
choicesLoaded(): void;
getItemValueWrapperComponentName(item: ItemValue): string;
getItemValueWrapperComponentData(item: ItemValue): any;
ariaItemChecked(item: ItemValue): "true" | "false";
isOtherItem(item: ItemValue): boolean;
get itemSvgIcon(): string;
getSelectBaseRootCss(): string;
protected allowMobileInDesignMode(): boolean;
getAriaItemLabel(item: ItemValue): string;
getItemId(item: ItemValue): string;
get questionName(): string;
getItemEnabled(item: ItemValue): boolean;
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.
*
* [View Dropdown Demo](https://surveyjs.io/form-library/examples/dropdown-box-with-custom-items/ (linkStyle))
*
* [View Ranking Demo](https://surveyjs.io/form-library/examples/dropdown-box-with-custom-items/ (linkStyle))
*/
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);
/**
* Gets or sets the number of columns used to arrange choice items.
*
* Set this property to 0 if you want to display all items in one line. The default value depends on the available width.
* @see separateSpecialChoices
*/
get colCount(): number;
set colCount(value: number);
protected onParentChanged(): void;
protected onParentQuestionChanged(): void;
protected getSearchableItemValueKeys(keys: Array): void;
}
}
declare module "validator" {
import { Base } from "base";
import { ISurveyErrorOwner, ISurvey } from "base-interfaces";
import { SurveyError } from "survey-error";
import { LocalizableString } from "localizablestring";
export class ValidatorResult {
value: any;
error: SurveyError;
constructor(value: any, error?: SurveyError);
}
/**
* Base SurveyJS validator class.
*/
export class SurveyValidator extends Base {
errorOwner: ISurveyErrorOwner;
onAsyncCompleted: (result: ValidatorResult) => void;
constructor();
getSurvey(live?: boolean): ISurvey;
get text(): string;
set text(value: string);
get isValidateAllValues(): boolean;
get locText(): LocalizableString;
protected getErrorText(name: string): string;
protected getDefaultErrorText(name: string): string;
validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult;
get isRunning(): boolean;
get isAsync(): boolean;
getLocale(): string;
getMarkdownHtml(text: string, name: string): string;
getRenderer(name: string): string;
getRendererContext(locStr: LocalizableString): any;
getProcessedText(text: string): string;
protected createCustomError(name: string): SurveyError;
toString(): string;
}
export interface IValidatorOwner {
getValidators(): Array;
validatedValue: any;
getValidatorTitle(): string;
getDataFilteredValues(): any;
getDataFilteredProperties(): any;
}
export class ValidatorRunner {
private asyncValidators;
onAsyncCompleted: (errors: Array) => void;
run(owner: IValidatorOwner): Array;
private prepareAsyncValidators;
}
/**
* Validate numeric values.
*/
export class NumericValidator extends SurveyValidator {
constructor(minValue?: number, maxValue?: number);
getType(): string;
validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult;
protected getDefaultErrorText(name: string): string;
/**
* The minValue property.
*/
get minValue(): number;
set minValue(val: number);
/**
* The maxValue property.
*/
get maxValue(): number;
set maxValue(val: number);
}
/**
* Validate text values.
*/
export class TextValidator extends SurveyValidator {
constructor();
getType(): string;
validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult;
protected getDefaultErrorText(name: string): string;
/**
* The minLength property.
*/
get minLength(): number;
set minLength(val: number);
/**
* The maxLength property.
*/
get maxLength(): number;
set maxLength(val: number);
/**
* The allowDigits property.
*/
get allowDigits(): boolean;
set allowDigits(val: boolean);
}
/**
* Validates the number of answers.
*/
export class AnswerCountValidator extends SurveyValidator {
constructor(minCount?: number, maxCount?: number);
getType(): string;
validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult;
protected getDefaultErrorText(name: string): string;
/**
* The minCount property.
*/
get minCount(): number;
set minCount(val: number);
/**
* The maxCount property.
*/
get maxCount(): number;
set maxCount(val: number);
}
/**
* Use it to validate the text by regular expressions.
*
* [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))
*/
export class RegexValidator extends SurveyValidator {
constructor(regex?: string);
getType(): string;
validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult;
private hasError;
/**
* The regex property.
*/
get regex(): string;
set regex(val: string);
get insensitive(): boolean;
set insensitive(val: boolean);
private createRegExp;
}
/**
* Validate e-mail address in the text input
*/
export class EmailValidator extends SurveyValidator {
private re;
constructor();
getType(): string;
validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult;
protected getDefaultErrorText(name: string): string;
}
/**
* Show error if expression returns false
*/
export class ExpressionValidator extends SurveyValidator {
private conditionRunner;
private isRunningValue;
constructor(expression?: string);
getType(): string;
get isValidateAllValues(): boolean;
get isAsync(): boolean;
get isRunning(): boolean;
validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult;
protected generateError(res: boolean, value: any, name: string): ValidatorResult;
protected getDefaultErrorText(name: string): string;
protected ensureConditionRunner(): boolean;
/**
* The expression property.
*/
get expression(): string;
set expression(val: string);
}
}
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;
hasRequiredError(): boolean;
private createRunner;
/**
* The maximum number of fraction digits. Applies only if the `displayStyle` property is not `"none"`. Accepts values in the range from -1 to 20, where -1 disables the property.
*
* Default value: -1
* @see displayStyle
* @see minimumFractionDigits
* @see precision
*/
get maximumFractionDigits(): number;
set maximumFractionDigits(val: number);
/**
* The minimum number of fraction digits. Applies only if the `displayStyle` property is not `"none"`. Accepts values in the range from -1 to 20, where -1 disables the property.
*
* Default value: -1
* @see displayStyle
* @see maximumFractionDigits
*/
get minimumFractionDigits(): number;
set minimumFractionDigits(val: number);
private runIfReadOnlyValue;
get runIfReadOnly(): boolean;
set runIfReadOnly(val: boolean);
get formatedValue(): string;
protected updateFormatedValue(): void;
protected onValueChanged(): void;
updateValueFromSurvey(newValue: any, clearData: boolean): void;
protected getDisplayValueCore(keysAsText: boolean, value: any): any;
/**
* Specifies a display style for the question value.
*
* Possible values:
*
* - `"decimal"`
* - `"currency"`
* - `"percent"`
* - `"date"`
* - `"none"` (default)
*
* If you use the `"currency"` display style, you can also set the `currency` property to specify a currency other than USD.
* @see currency
* @see minimumFractionDigits
* @see maximumFractionDigits
* @see format
*/
get displayStyle(): string;
set displayStyle(val: string);
/**
* A three-letter currency code. Applies only if the `displayStyle` property is set to `"currency"`.
*
* Default value: "USD".
* @see displayStyle
* @see minimumFractionDigits
* @see maximumFractionDigits
* @see format
*/
get currency(): string;
set currency(val: string);
/**
* Specifies whether to use grouping separators in number representation. Separators depend on the selected [locale](https://surveyjs.io/form-library/documentation/surveymodel#locale).
*
* Default value: `true`
*/
get useGrouping(): boolean;
set useGrouping(val: boolean);
/**
* Specifies how many decimal digits to keep in the expression value.
*
* Default value: -1 (unlimited)
* @see maximumFractionDigits
*/
get precision(): number;
set precision(val: number);
private roundValue;
protected getValueAsStr(val: any): string;
}
export function getCurrecyCodes(): Array;
}
declare module "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;
onColumnVisibilityChanged(column: MatrixDropdownColumn): void;
getCellType(): string;
getCustomCellType(column: MatrixDropdownColumn, row: MatrixDropdownRowModelBase, cellType: string): string;
onColumnCellTypeChanged(column: MatrixDropdownColumn): void;
getCellAriaLabel(rowTitle: string, columnTitle: string): string;
}
export var matrixDropdownColumnTypes: any;
/**
* An auxiliary class that describes a column in a [Multi-Select Matrix](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list) or [Dynamic Matrix](https://surveyjs.io/form-library/documentation/api-reference/dynamic-matrix-table-question-model).
*
* You can get an object of this class from the [`columns`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list#columns) array or by calling the [`getColumnByName()`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list#getColumnByName) method on a matrix instance.
*/
export class MatrixDropdownColumn extends Base implements ILocalizableOwner, IWrapperObject {
static getColumnTypes(): Array;
private templateQuestionValue;
private colOwnerValue;
private indexValue;
private _hasVisibleCell;
private _visiblechoices;
constructor(name: string, title?: string);
getOriginalObj(): Base;
getClassNameProperty(): string;
getSurvey(live?: boolean): ISurvey;
endLoadingFromJson(): void;
getDynamicPropertyName(): string;
getDynamicType(): string;
get colOwner(): IMatrixColumnOwner;
set colOwner(value: IMatrixColumnOwner);
locStrsChanged(): void;
addUsedLocales(locales: Array): void;
get index(): number;
setIndex(val: number): void;
getType(): string;
/**
* Specifies the type of column cells.
*
* Possible values:
*
* - [`"dropdown"`](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model)
* - [`"checkbox"`](https://surveyjs.io/form-library/documentation/api-reference/checkbox-question-model)
* - [`"radiogroup"`](https://surveyjs.io/form-library/documentation/api-reference/radio-button-question-model)
* - [`"tagbox"`](https://surveyjs.io/form-library/documentation/api-reference/dropdown-tag-box-model)
* - [`"text"`](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model)
* - [`"comment"`](https://surveyjs.io/form-library/documentation/api-reference/comment-field-model)
* - [`"boolean"`](https://surveyjs.io/form-library/documentation/api-reference/boolean-question-model)
* - [`"expression"`](https://surveyjs.io/form-library/documentation/api-reference/expression-model)
* - [`"rating"`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model)
* - `"default"` (default) - Inherits the input type from the [`cellType`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list#cellType) property specified for the parent matrix.
*
* The input types are based upon standalone question types. Depending on the selected input type, the matrix column can have additional configuration properties inherited from the corresponding question type. For instance, Dropdown, Checkboxes, Radio Button Group, and Tag Box columns can specify the [`choices`](https://surveyjs.io/form-library/documentation/api-reference/radio-button-question-model#choices) array, similar to the question types upon which they are based. Refer to the API Reference of these question types for a full list of available properties.
*
* [View Demo](https://surveyjs.io/form-library/examples/aggregate-data-within-form/ (linkStyle))
*/
get cellType(): string;
set cellType(val: string);
get templateQuestion(): Question;
get value(): string;
get isVisible(): boolean;
get isColumnVisible(): boolean;
/**
* Gets or sets column visibility.
*
* If you want to display or hide a column based on a condition, specify the [`visibleIf`](#visibleIf) property.
* @see isRequired
* @see readOnly
*/
get visible(): boolean;
set visible(val: boolean);
get hasVisibleCell(): boolean;
set hasVisibleCell(newVal: boolean);
getVisibleMultipleChoices(): Array;
get getVisibleChoicesInCell(): Array;
setVisibleChoicesInCell(val: Array): void;
get isFilteredMultipleColumns(): boolean;
/**
* A column ID that is not visible to respondents.
*
* > Column IDs must be unique.
* @see title
*/
get name(): string;
set name(val: string);
/**
* A user-friendly column caption to display. If `title` is undefined, [`name`](#name) is displayed instead.
*/
get title(): string;
set title(val: string);
get locTitle(): LocalizableString;
get fullTitle(): string;
/**
* Marks the column as required. If a respondent skips any cell in a required column, the matrix displays a [validation error](#requiredErrorText).
*
* If you want to mark the column as required based on a condition, specify the [`requiredIf`](#requiredIf) property.
* @see visible
* @see readOnly
*/
get isRequired(): boolean;
set isRequired(val: boolean);
get isRenderedRequired(): boolean;
set isRenderedRequired(val: boolean);
updateIsRenderedRequired(val: boolean): void;
get requiredText(): string;
/**
* Specifies a custom error message for a required column.
* @see isRequired
*/
get requiredErrorText(): string;
set requiredErrorText(val: string);
get locRequiredErrorText(): LocalizableString;
/**
* Makes the column read-only.
*
* If you want to switch the column to the read-only state based on a condition, specify the [`enableIf`](#enableIf) property.
* @see visible
* @see isRequired
*/
get readOnly(): boolean;
set readOnly(val: boolean);
get hasOther(): boolean;
set hasOther(val: boolean);
/**
* A Boolean expression. If it evaluates to `false`, this column becomes hidden.
*
* Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).
* @see visible
*/
get visibleIf(): string;
set visibleIf(val: string);
/**
* A Boolean expression. If it evaluates to `false`, this column becomes read-only.
*
* Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).
* @see readOnly
*/
get enableIf(): string;
set enableIf(val: string);
/**
* A Boolean expression. If it evaluates to `true`, this column becomes required.
*
* Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).
* @see isRequired
*/
get requiredIf(): string;
set requiredIf(val: string);
/**
* A Boolean expression. If it evaluates to `true`, all cells in this column are set to a value calculated using the [`defaultValueExpression`](#defaultValueExpression).
*
* [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle))
* @see setValueIf
*/
get resetValueIf(): string;
set resetValueIf(val: string);
/**
* An expression used to calculate the column's default value. This expression applies to all cells of this column until the cell value is specified by an end user or programmatically.
*
* [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle))
* @see setValueExpression
*/
get defaultValueExpression(): string;
set defaultValueExpression(val: string);
/**
* A Boolean expression. If it evaluates to `true`, all cells in this column are set to a value calculated using the [`setValueExpression`](#setValueExpression).
*
* [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle))
* @see resetValueIf
*/
get setValueIf(): string;
set setValueIf(val: string);
/**
* An expression used to calculate a value for all column cells.
*
* You can use `setValueExpression` as a standalone property or in conjunction with the [`setValueIf`](#setValueIf) expression, in which case the calculated cell value applies only when `setValueIf` evaluates to `true`.
*
* [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle))
* @see defaultValueExpression
* @see resetValueIf
*/
get setValueExpression(): string;
set setValueExpression(val: string);
/**
* Specifies whether a respondent is required to provide a unique response for each question within this column.
*
* Default value: `false`
*/
get isUnique(): boolean;
set isUnique(val: boolean);
/**
* Specifies whether to create an individual column for each choice option. Applies only to columns of `"checkbox"` or `"radiogroup"` [`cellType`](#cellType).
*/
get showInMultipleColumns(): boolean;
set showInMultipleColumns(val: boolean);
get isSupportMultipleColumns(): boolean;
get isShowInMultipleColumns(): boolean;
/**
* Column validators.
*
* [Data Validation](https://surveyjs.io/form-library/documentation/data-validation (linkStyle))
* @see isRequired
*/
get validators(): Array;
set validators(val: Array);
/**
* An aggregation method used to calculate the column total.
*
* Possible values:
*
* - `"none"` (default) - Disables total calculations.
* - `"sum"`
* - `"count"`
* - `"min"`
* - `"max"`
* - `"avg"`
*
* [View Demo](https://surveyjs.io/form-library/examples/aggregate-data-within-form/ (linkStyle))
* @see totalFormat
* @see totalDisplayStyle
*/
get totalType(): string;
set totalType(val: string);
/**
* An expression used to calculate total values. Overrides the [`totalType`](#totalType) property.
*
* [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle))
*/
get totalExpression(): string;
set totalExpression(val: string);
get hasTotal(): boolean;
/**
* A string pattern used to display column totals. To reference a total value within this pattern, use the `{0}` placeholder.
*
* [View Demo](https://surveyjs.io/form-library/examples/aggregate-data-within-form/ (linkStyle))
* @see totalType
* @see totalDisplayStyle
*/
get totalFormat(): string;
set totalFormat(val: string);
get locTotalFormat(): LocalizableString;
get cellHint(): string;
set cellHint(val: string);
get locCellHint(): LocalizableString;
get renderAs(): string;
set renderAs(val: string);
get totalMaximumFractionDigits(): number;
set totalMaximumFractionDigits(val: number);
get totalMinimumFractionDigits(): number;
set totalMinimumFractionDigits(val: number);
/**
* A format for calculated total values.
*
* Possible values:
*
* - `"none"` (default)
* - `"decimal"`
* - `"currency"`
* - `"percent"`
*
* [View Demo](https://surveyjs.io/form-library/examples/aggregate-data-within-form/ (linkStyle))
* @see totalType
* @see totalFormat
* @see totalCurrency
*/
get totalDisplayStyle(): string;
set totalDisplayStyle(val: string);
/**
* An alignment for calculated total values.
*
* Possible values:
*
* - `"left"`
* - `"center"`
* - `"right"`
* - `"auto"` (default) - Applies one of the values above based on the column's [cell type](#cellType).
*
* [View Demo](https://surveyjs.io/form-library/examples/aggregate-data-within-form/ (linkStyle))
* @see totalType
* @see totalFormat
* @see totalCurrency
* @see totalDisplayStyle
*/
get totalAlignment(): string;
set totalAlignment(val: string);
/**
* Specifies a currency used to display calculated total values. Applies only if [`totalDisplayStyle`](#totalDisplayStyle) is set to `"currency"`.
* @see totalType
*/
get totalCurrency(): string;
set totalCurrency(val: string);
/**
* Gets or sets minimum column width in CSS values. By default, the matrix calculates column widths to optimally fit the content of all columns.
* @see width
*/
get minWidth(): string;
set minWidth(val: string);
/**
* Gets or sets column width in CSS values. By default, the matrix calculates column widths to optimally fit the content of all columns.
* @see minWidth
*/
get width(): string;
set width(val: string);
/**
* Gets or sets the number of columns used to arrange choice options. Applies only to columns of `"checkbox"` or `"radiogroup"` [`cellType`](#cellType).
*
* Default value: -1 (inherits the actual value from the parent matrix's [`columnColCount`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list#columnColCount) property)
*/
get colCount(): number;
set colCount(val: number);
getLocale(): string;
getMarkdownHtml(text: string, name: string): string;
getRenderer(name: string): string;
getRendererContext(locStr: LocalizableString): any;
getProcessedText(text: string): string;
createCellQuestion(row: MatrixDropdownRowModelBase): Question;
startLoadingFromJson(json?: any): void;
updateCellQuestion(cellQuestion: Question, data: any, onUpdateJson?: (json: any) => any): void;
private callOnCellQuestionUpdate;
defaultCellTypeChanged(): void;
protected calcCellQuestionType(row: MatrixDropdownRowModelBase): string;
private getDefaultCellQuestionType;
protected updateTemplateQuestion(newCellType?: string): 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 doColumnVisibilityChanged;
private getProperties;
private removeProperties;
private addProperties;
}
}
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 var mouseInfo: {
readonly isTouch: boolean;
readonly hasTouchEvent: boolean;
hasMouse: boolean;
};
export let IsTouch: boolean;
export function _setIsTouch(val: boolean): void;
export type MatchMediaMethod = ((query: string) => {
matches: boolean;
} | null) | null;
export function detectMouseSupport(matchMedia: MatchMediaMethod): boolean;
}
declare module "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;
rootContainer: HTMLElement;
documentOrShadowRoot: Document | ShadowRoot;
}
export class DragDropDOMAdapter implements IDragDropDOMAdapter {
private dd;
private longTap;
private fitToContainer;
static PreventScrolling: boolean;
private timeoutID;
private startX;
private startY;
private currentX;
private currentY;
private savedTargetNode;
private savedTargetNodeParent;
private savedTargetNodeIndex;
private scrollIntervalId;
constructor(dd: IDragDropEngine, longTap?: boolean, fitToContainer?: boolean);
get documentOrShadowRoot(): Document | ShadowRoot;
private get rootElement();
private stopLongTapIfMoveEnough;
private get isMicroMovement();
private stopLongTap;
private startLongTapProcessing;
private handlePointerCancel;
private handleEscapeButton;
private onContextMenu;
private moveShortcutElement;
private getShortcutBottomCoordinate;
private getShortcutRightCoordinate;
protected requestAnimationFrame(callback: any): number;
protected scrollByDrag(scrollableParentNode: HTMLElement, clientY: number, clientX: number): void;
private doScroll;
private dragOver;
private clear;
private drop;
private doStartDrag;
private returnUserSelectBack;
draggedElementShortcut: any;
rootContainer: HTMLElement;
startDrag(event: PointerEvent, draggedElement: any, parentElement?: any, draggedElementNode?: HTMLElement, preventSaveTargetNode?: boolean): void;
private getNodeIndexInParent;
private insertNodeToParentAtIndex;
}
}
declare module "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;
private getRootElement;
dragInit(event: PointerEvent, draggedElement: any, parentElement?: any, draggedElementNode?: HTMLElement): void;
protected onStartDrag(event?: PointerEvent): void;
protected isDropTargetDoesntChanged(newIsBottom: boolean): boolean;
protected getShortcutText(draggedElement: IShortcutText): string;
protected createDraggedElementShortcut(text: string, draggedElementNode?: HTMLElement, event?: PointerEvent): HTMLElement;
protected getDraggedElementClass(): string;
protected doDragOver(): void;
protected afterDragOver(dropTargetNode: HTMLElement): void;
protected abstract isDropTargetValid(dropTarget: any, dropTargetNode?: HTMLElement): boolean;
protected banDropHere: () => void;
protected doBanDropHere: () => void;
protected findDropTargetNodeFromPoint(clientX: number, clientY: number): HTMLElement;
protected getDataAttributeValueByNode(node: HTMLElement): string;
protected getDropTargetByNode(dropTargetNode: HTMLElement, event: PointerEvent): any;
private capitalizeFirstLetter;
protected abstract getDropTargetByDataAttributeValue(dataAttributeValue: string, dropTargetNode?: HTMLElement, event?: PointerEvent): any;
protected calculateVerticalMiddleOfHTMLElement(HTMLElement: HTMLElement): number;
protected calculateHorizontalMiddleOfHTMLElement(HTMLElement: HTMLElement): number;
protected calculateIsBottom(clientY: number, dropTargetNode?: HTMLElement): boolean;
protected findDropTargetNodeByDragOverNode(dragOverNode: HTMLElement): HTMLElement;
dragOver(event: PointerEvent): void;
protected abstract doDrop(): any;
drop(): void;
clear(): void;
}
}
declare module "dragdrop/matrix-rows" {
import { MatrixDropdownRowModelBase } from "question_matrixdropdownbase";
import { QuestionMatrixDynamicModel, MatrixDynamicRowModel } from "question_matrixdynamic";
import { DragDropCore } from "dragdrop/core";
export class DragDropMatrixRows extends DragDropCore {
protected get draggedElementType(): string;
protected restoreUserSelectValue: string;
protected onStartDrag(): void;
protected createDraggedElementShortcut(text: string, draggedElementNode: HTMLElement, event: PointerEvent): HTMLElement;
private fromIndex;
private toIndex;
protected getDropTargetByDataAttributeValue(dataAttributeValue: any): MatrixDropdownRowModelBase;
canInsertIntoThisRow(row: MatrixDynamicRowModel): boolean;
protected isDropTargetValid(dropTarget: any, dropTargetNode?: HTMLElement): boolean;
protected calculateIsBottom(clientY: number): boolean;
protected afterDragOver(dropTargetNode: HTMLElement): void;
protected doDrop: () => QuestionMatrixDynamicModel;
clear(): void;
}
}
declare module "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;
isEmpty: boolean;
colSpans: number;
panel: PanelModel;
isShowHideDetail: boolean;
isActionsCell: boolean;
isErrorsCell: boolean;
isDragHandlerCell: boolean;
isDetailRowCell: boolean;
private classNameValue;
constructor();
get requiredText(): string;
get hasQuestion(): boolean;
get hasTitle(): boolean;
get hasPanel(): boolean;
get id(): number;
get item(): ItemValue;
set item(val: ItemValue);
get isChoice(): boolean;
get isItemChoice(): boolean;
get choiceValue(): any;
get isCheckbox(): boolean;
get isRadio(): boolean;
get isFirstChoice(): boolean;
set className(val: string);
get className(): string;
get cellQuestionWrapperClassName(): string;
get showResponsiveTitle(): boolean;
get responsiveTitleCss(): string;
get responsiveLocTitle(): LocalizableString;
get headers(): string;
getTitle(): string;
calculateFinalClassName(matrixCssClasses: any): string;
focusIn(): void;
}
export class QuestionMatrixDropdownRenderedRow extends Base {
cssClasses: any;
isDetailRow: boolean;
isGhostRow: boolean;
isAdditionalClasses: boolean;
visible: boolean;
onVisibilityChangedCallback: () => void;
hasEndActions: boolean;
row: MatrixDropdownRowModelBase;
isErrorsRow: boolean;
private static counter;
private idValue;
cells: Array;
constructor(cssClasses: any, isDetailRow?: boolean);
get id(): number;
get attributes(): {
"data-sv-drop-target-matrix-row"?: undefined;
} | {
"data-sv-drop-target-matrix-row": string;
};
get className(): string;
private rootElement;
setRootElement(val: HTMLTableRowElement): void;
getRootElement(): HTMLTableRowElement;
}
export class QuestionMatrixDropdownRenderedErrorRow extends QuestionMatrixDropdownRenderedRow {
isErrorsRow: boolean;
constructor(cssClasses: any);
get attributes(): {};
get className(): string;
onAfterCreated(): void;
}
export class QuestionMatrixDropdownRenderedTable extends Base {
matrix: QuestionMatrixDropdownModelBase;
private headerRowValue;
private footerRowValue;
private hasRemoveRowsValue;
private rowsActions;
private cssClasses;
rows: Array;
protected getIsAnimationAllowed(): boolean;
private getRenderedRowsAnimationOptions;
private _renderedRows;
updateRenderedRows(): void;
private renderedRowsAnimation;
get renderedRows(): Array;
set renderedRows(val: Array);
constructor(matrix: QuestionMatrixDropdownModelBase);
get showTable(): boolean;
get showHeader(): boolean;
get showAddRow(): boolean;
get showAddRowOnTop(): boolean;
get showAddRowOnBottom(): boolean;
get showFooter(): boolean;
get hasFooter(): boolean;
get hasRemoveRows(): boolean;
isRequireReset(): boolean;
get headerRow(): QuestionMatrixDropdownRenderedRow;
get footerRow(): QuestionMatrixDropdownRenderedRow;
get isRowsDragAndDrop(): boolean;
private get showCellErrorsTop();
private get showCellErrorsBottom();
protected build(): void;
updateShowTableAndAddRow(): void;
onAddedRow(row: MatrixDropdownRowModelBase, index: number): void;
private getRenderedRowIndexByIndex;
private getRenderedDataRowCount;
onRemovedRow(row: MatrixDropdownRowModelBase): void;
onDetailPanelChangeVisibility(row: MatrixDropdownRowModelBase, isShowing: boolean): void;
private getRenderedRowIndex;
protected buildRowsActions(): void;
protected createRenderedRow(cssClasses: any, isDetailRow?: boolean): QuestionMatrixDropdownRenderedRow;
protected createErrorRenderedRow(cssClasses: any): QuestionMatrixDropdownRenderedErrorRow;
protected buildHeader(): void;
protected buildFooter(): void;
protected buildRows(): void;
private hasActionCellInRowsValues;
private hasActionCellInRows;
private hasActionsCellInLocaltion;
private canRemoveRow;
private buildHorizontalRows;
private addHorizontalRow;
private getRowDragCell;
private getActionsCellClassName;
private getRowActionsCell;
private getRowActions;
private buildRowActions;
private get showRemoveButtonAsIcon();
protected setDefaultRowActions(row: MatrixDropdownRowModelBase, actions: Array): void;
private createErrorRow;
private createHorizontalRow;
private addRowActionsCell;
private createDetailPanelRow;
private buildVerticalRows;
private createMutlipleVerticalRows;
private createVerticalRow;
private createEndVerticalActionRow;
private createMutlipleEditCells;
private setItemCellCssClasses;
private createEditCell;
private createErrorCell;
private createMutlipleColumnsFooter;
private createMutlipleColumnsHeader;
private getMultipleColumnChoices;
private setHeaderCellCssClasses;
private createHeaderCell;
private setHeaderCell;
private setHeaderCellWidth;
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 { SurveyError } from "survey-error";
import { DragDropMatrixRows } from "dragdrop/matrix-rows";
import { IShortcutText, ISurveyImpl, IProgressInfo } from "base-interfaces";
import { QuestionMatrixDropdownRenderedTable } from "question_matrixdropdownrendered";
export class MatrixDynamicRowModel extends MatrixDropdownRowModelBase implements IShortcutText {
index: number;
private dragOrClickHelper;
constructor(index: number, data: IMatrixDropdownData, value: any);
get rowName(): string;
get dataName(): string;
get text(): any;
getAccessbilityText(): string;
get shortcutText(): string;
}
/**
* A class that describes the Dynamic Matrix question type.
*
* Dynamic Matrix allows respondents to add and delete matrix rows. You can use the [Dropdown](https://surveyjs.io/form-library/documentation/questiondropdownmodel), [Checkbox](https://surveyjs.io/form-library/documentation/questioncheckboxmodel), [Radiogroup](https://surveyjs.io/form-library/documentation/questionradiogroupmodel), [Text](https://surveyjs.io/form-library/documentation/questiontextmodel), and [Comment](https://surveyjs.io/form-library/documentation/questioncommentmodel) question types as cell editors.
*
* [View Demo](https://surveyjs.io/form-library/examples/questiontype-matrixdynamic/ (linkStyle))
*/
export class QuestionMatrixDynamicModel extends QuestionMatrixDropdownModelBase implements IMatrixDropdownData {
onGetValueForNewRowCallBack: (sender: QuestionMatrixDynamicModel) => any;
private rowCounter;
private initialRowCount;
private setRowCountValueFromData;
constructor(name: string);
dragDropMatrixRows: DragDropMatrixRows;
setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void;
private draggedRow;
private isBanStartDrag;
isDragHandleAreaValid(node: HTMLElement): boolean;
onPointerDown(pointerDownEvent: PointerEvent, row: MatrixDropdownRowModelBase): void;
startDragMatrixRow: (event: PointerEvent, currentTarget: HTMLElement) => void;
getType(): string;
get isRowsDynamic(): boolean;
/**
* Specifies whether to display a confirmation dialog when a respondent wants to delete a row.
*
* Default value: `false`
* @see confirmDeleteText
*/
get confirmDelete(): boolean;
set confirmDelete(val: boolean);
get isValueArray(): boolean;
/**
* Specifies a key column. Set this property to a column name, and the question will display `keyDuplicationError` if a user tries to enter a duplicate value in this column.
* @see keyDuplicationError
*/
get keyName(): string;
set keyName(val: string);
/**
* If it is not empty, then this value is set to every new row, including rows created initially, unless the defaultValue is not empty
* @see defaultValue
* @see defaultValueFromLastRow
*/
get defaultRowValue(): any;
set defaultRowValue(val: any);
/**
* Specifies whether default values for a new row/column should be copied from the last row/column.
*
* If you also specify `defaultValue`, it will be merged with the copied values.
* @see defaultValue
*/
get defaultValueFromLastRow(): boolean;
set defaultValueFromLastRow(val: boolean);
protected isDefaultValueEmpty(): boolean;
protected valueFromData(val: any): any;
protected isNewValueCorrect(val: any): boolean;
protected setDefaultValue(): void;
moveRowByIndex(fromIndex: number, toIndex: number): void;
clearOnDrop(): void;
initDataUI(): void;
/**
* The number of rows in the matrix.
* @see minRowCount
* @see maxRowCount
*/
get rowCount(): number;
set rowCount(val: number);
protected updateProgressInfoByValues(res: IProgressInfo): void;
private getValueForNewRow;
/**
* Specifies whether users can drag and drop matrix rows to reorder them. Applies only if [`transposeData`](#transposeData) is `false`.
*
* Default value: `false`
*/
get allowRowsDragAndDrop(): boolean;
set allowRowsDragAndDrop(val: boolean);
get isRowsDragAndDrop(): boolean;
get lockedRowCount(): number;
set lockedRowCount(val: number);
get iconDragElement(): string;
protected createRenderedTable(): QuestionMatrixDropdownRenderedTable;
private get rowCountValue();
private set rowCountValue(value);
/**
* A minimum number of rows in the matrix. Users cannot delete rows if `rowCount` equals `minRowCount`.
*
* Default value: 0
* @see rowCount
* @see maxRowCount
* @see allowRemoveRows
*/
get minRowCount(): number;
set minRowCount(val: number);
/**
* A maximum number of rows in the matrix. Users cannot add new rows if `rowCount` equals `maxRowCount`.
*
* Default value: 1000 (inherited from [`settings.matrix.maxRowCount`](https://surveyjs.io/form-library/documentation/settings#matrixMaximumRowCount))
* @see rowCount
* @see minRowCount
* @see allowAddRows
*/
get maxRowCount(): number;
set maxRowCount(val: number);
/**
* 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 removeRowAsync;
private removeRowCore;
/**
* A message displayed in a confirmation dialog that appears when a respondent wants to delete a row.
* @see confirmDelete
*/
get confirmDeleteText(): string;
set confirmDeleteText(val: string);
get locConfirmDeleteText(): import("localizablestring").LocalizableString;
/**
* A caption for the Add Row button.
* @see addRowLocation
*/
get addRowText(): string;
set addRowText(val: string);
get locAddRowText(): import("localizablestring").LocalizableString;
private get defaultAddRowText();
/**
* Specifies the location of the Add Row button.
*
* Possible values:
*
* - `"top"` - Displays the Add Row button at the top of the matrix.
* - `"bottom"` - Displays the Add Row button at the bottom of the matrix.
* - `"topBottom"` - Displays the Add Row button at the top and bottom of the matrix.
*
* Default value: `"top"` if [`transposeData`](#transposeData) is `true`; `"bottom"` if `transposeData` is `false` or the matrix is in compact mode.
* @see addRowText
*/
get addRowLocation(): string;
set addRowLocation(val: string);
getAddRowLocation(): string;
/**
* Specifies whether to hide columns when the matrix does not contain any rows. If you enable this property, the matrix displays the `emptyRowsText` message and the Add Row button.
*
* Default value: `false`
* @see emptyRowsText
*/
get hideColumnsIfEmpty(): boolean;
set hideColumnsIfEmpty(val: boolean);
getShowColumnsIfEmpty(): boolean;
/**
* Use this property to change the default value of remove row button text.
*/
get removeRowText(): string;
set removeRowText(val: string);
get locRemoveRowText(): import("localizablestring").LocalizableString;
/**
* A message displayed when the matrix does not contain any rows. Applies only if `hideColumnsIfEmpty` is enabled.
* @see hideColumnsIfEmpty
*/
get emptyRowsText(): string;
set emptyRowsText(val: string);
get locEmptyRowsText(): import("localizablestring").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 getUniqueColumnsNames(): Array;
protected generateRows(): Array;
protected createMatrixRow(value: any): MatrixDynamicRowModel;
private lastDeletedRow;
private getInsertedDeletedIndex;
private isEditingObjectValueChanged;
updateValueFromSurvey(newValue: any, clearData?: boolean): void;
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 "themes" {
import { HorizontalAlignment, VerticalAlignment } from "base-interfaces";
export type ImageFit = "auto" | "contain" | "cover";
export type ImageAttachment = "fixed" | "scroll";
/**
* A theme configuration interface.
*
* `ITheme` objects are used to apply predefined themes or create custom themes. Refer to the following help topic for more information:
*
* [Themes & Styles](https://surveyjs.io/form-library/documentation/manage-default-themes-and-styles (linkStyle))
*/
export interface ITheme {
/**
* A theme name.
*/
themeName?: string;
/**
* A color palette.
*
* Possible values:
*
* - `"light"`
* - `"dark"`
*/
colorPalette?: string;
/**
* A Boolean value that specifies whether survey questions are displayed within panels (`false`) or without them (`true`).
*/
isPanelless?: boolean;
/**
* An image to display as survey background. This property accepts a hyperlink or a data URL.
*/
backgroundImage?: string;
/**
* A string value that specifies how to resize the [background image](#backgroundImage) to fit it into its container.
*
* Possible values:
*
* - `"auto"`
* - `"contain"`
* - `"cover"`
*
* Refer to the description of the [`background-size`](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size#values) CSS property values on MDN for detailed information on the possible values.
*/
backgroundImageFit?: ImageFit;
/**
* A string value that specifies whether the [background image](#backgroundImage) is fixed in its position or scrolled along with the survey.
*
* Possible values:
*
* - `"fixed"`
* - `"scroll"`
*/
backgroundImageAttachment?: ImageAttachment;
/**
* A value from 0 to 1 that specifies how transparent the [background image](#backgroundImage) should be: 0 makes the image completely transparent, and 1 makes it opaque.
*/
backgroundOpacity?: number;
/**
* An object with [advanced survey header settings](https://surveyjs.io/form-library/documentation/api-reference/iheader). Applies when the [`headerView`](https://surveyjs.io/form-library/documentation/api-reference/itheme#headerView) property is set to `"advanced"`.
*/
header?: IHeader;
/**
* Specifies whether the survey header uses only basic appearance settings or applies advanced settings from the survey theme.
*
* Possible values:
*
* - `"basic"` (default)\
* A basic header view applies only the [`title`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#title), [`description`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#description), and logo-related properties ([`logo`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#logo), [`logoPosition`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#logoPosition), etc.).
*
* - `"advanced"`\
* An advanced header view applies the same properties as the basic view, plus [header settings](https://surveyjs.io/form-library/documentation/api-reference/iheader) from the [survey theme](https://surveyjs.io/form-library/documentation/api-reference/itheme#header). The advanced view features a more flexible header layout, a capability to specify a background image, and other settings that give a more professional look to the survey header.
*
* [View Demo](https://surveyjs.io/form-library/examples/brand-your-survey-header/ (linkStyle))
*/
headerView?: "advanced" | "basic";
/**
* An object with CSS variables.
*/
cssVariables?: {
[index: string]: string;
};
}
/**
* A survey header configuration interface.
*
* An `IHeader` object configures advanced survey header appearance settings. To apply them, you need to assign the object to the [`header`](https://surveyjs.io/form-library/documentation/api-reference/itheme#header) property of your theme configuration and set the [`headerView`](https://surveyjs.io/form-library/documentation/api-reference/itheme#headerView) property to `"advanced"`.
*/
export interface IHeader {
/**
* The height of the survey header in pixels.
*
* Default value: 256
*/
height: number;
/**
* A string value that specifies whether the header spans the width of the survey or that of the survey container.
*
* Possible values:
*
* - `"survey"`\
* The header width is the same as the survey width.
* - `"container"` (default)\
* The header width is the same as the survey container width.
*
* @see [SurveyModel.width](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#width)
* @see [SurveyModel.widthMode](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#widthMode)
*/
inheritWidthFrom: "survey" | "container";
/**
* The width of the header area that contains the survey [title](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#title) and [description](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#description), measured in pixels.
*
* Default value: 512
*/
textAreaWidth: number;
/**
* A Boolean value that specifies whether the header overlaps the survey content.
*
* Default value: `false`
*/
overlapEnabled: boolean;
/**
* An image to display in the background of the header. Accepts a base64 or URL string value.
*/
backgroundImage: string;
/**
* A value from 0 to 1 that specifies how transparent the [background image](#backgroundImage) should be: 0 makes the image completely transparent, and 1 makes it opaque.
*/
backgroundImageOpacity: number;
/**
* A string value that specifies how to resize a [background image](#backgroundImage) to fit it into the header.
*
* Possible values:
*
* - `"cover"` (default)\
* Scales the image to the smallest possible size that fills the header. The image preserves its aspect ratio but can be cropped if the header's proportions differ from that of the element.
* - `"fill"`\
* Stretches the image to fill the entire header.
* - `"contain"`\
* Scales the image to the largest possible size without cropping or stretching it.
* - `"tile"`\
* Tiles as many copies of the image as needed to fill the entire header.
*/
backgroundImageFit: "cover" | "fill" | "contain" | "tile";
/**
* A string value that specifies the logo position within the header in the horizontal direction.
*
* Possible values:
*
* - `"right"` (default)
* - `"left"`
* - `"center"`
*
* To specify a logo, set `SurveyModel`'s [`logo`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#logo) property.
*/
logoPositionX: HorizontalAlignment;
/**
* A string value that specifies the logo position within the header in the vertical direction.
*
* Possible values:
*
* - `"top"` (default)
* - `"bottom"`
* - `"middle"`
*
* To specify a logo, set `SurveyModel`'s [`logo`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#logo) property.
*/
logoPositionY: VerticalAlignment;
/**
* A string value that specifies the survey title position within the header in the horizontal direction.
*
* Possible values:
*
* - `"left"` (default)
* - `"right"`
* - `"center"`
*
* To specify a survey title, set `SurveyModel`'s [`title`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#title) property.
*/
titlePositionX: HorizontalAlignment;
/**
* A string value that specifies the survey title position within the header in the vertical direction.
*
* Possible values:
*
* - `"bottom"` (default)
* - `"top"`
* - `"middle"`
*
* To specify a survey title, set `SurveyModel`'s [`title`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#title) property.
*/
titlePositionY: VerticalAlignment;
/**
* A string value that specifies the survey description position within the header in the horizontal direction.
*
* Possible values:
*
* - `"left"` (default)
* - `"right"`
* - `"center"`
*
* To specify a survey description, set `SurveyModel`'s [`description`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#description) property.
*/
descriptionPositionX: HorizontalAlignment;
/**
* A string value that specifies the survey description position within the header in the vertical direction.
*
* Possible values:
*
* - `"bottom"` (default)
* - `"top"`
* - `"middle"`
*
* To specify a survey description, set `SurveyModel`'s [`description`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#description) property.
*/
descriptionPositionY: VerticalAlignment;
}
}
declare module "question_paneldynamic" {
import { HashTable } from "helpers";
import { IElement, IQuestion, IPanel, ISurveyData, ISurvey, ISurveyImpl, ITextProcessor, IProgressInfo, IPlainDataOptions } from "base-interfaces";
import { LocalizableString } from "localizablestring";
import { Base } from "base";
import { Question, IConditionObject, IQuestionPlainData } from "question";
import { PanelModel } from "panel";
import { SurveyError } from "survey-error";
import { ActionContainer } from "actions/container";
import { IAction } from "actions/action";
import { AdaptiveActionContainer } from "actions/adaptive-container";
import { ITheme } from "themes";
import { AnimationProperty, IAnimationGroupConsumer } from "utils/animation";
export interface IQuestionPanelDynamicData {
getItemIndex(item: ISurveyData): number;
getVisibleItemIndex(item: ISurveyData): number;
getPanelItemData(item: ISurveyData): any;
setPanelItemData(item: ISurveyData, name: string, val: any): any;
getSharedQuestionFromArray(name: string, panelIndex: number): Question;
getSurvey(): ISurvey;
getRootData(): ISurveyData;
}
export class QuestionPanelDynamicItem implements ISurveyData, ISurveyImpl {
static ItemVariableName: string;
static ParentItemVariableName: string;
static IndexVariableName: string;
static VisibleIndexVariableName: string;
private panelValue;
private data;
private textPreProcessor;
constructor(data: IQuestionPanelDynamicData, panel: PanelModel);
get panel(): PanelModel;
setSurveyImpl(): void;
getValue(name: string): any;
setValue(name: string, newValue: any): void;
getVariable(name: string): any;
setVariable(name: string, newValue: any): void;
getComment(name: string): string;
setComment(name: string, newValue: string, locNotification: any): void;
findQuestionByName(name: string): IQuestion;
getEditingSurveyElement(): Base;
getAllValues(): any;
getFilteredValues(): any;
getFilteredProperties(): any;
getSurveyData(): ISurveyData;
getSurvey(): ISurvey;
getTextProcessor(): ITextProcessor;
}
export class QuestionPanelDynamicTemplateSurveyImpl implements ISurveyImpl {
data: IQuestionPanelDynamicData;
constructor(data: IQuestionPanelDynamicData);
getSurveyData(): ISurveyData;
getSurvey(): ISurvey;
getTextProcessor(): ITextProcessor;
}
/**
* A class that describes the Dynamic Panel question type.
*
* Dynamic Panel allows respondents to add panels based on a panel template and delete them. Specify the [`templateElements`](https://surveyjs.io/form-library/documentation/questionpaneldynamicmodel#templateElements) property to configure panel template elements.
*
* [View Demo](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/ (linkStyle))
*/
export class QuestionPanelDynamicModel extends Question implements IQuestionPanelDynamicData {
private templateValue;
private isValueChangingInternally;
private changingValueQuestion;
renderModeChangedCallback: () => void;
panelCountChangedCallback: () => void;
currentIndexChangedCallback: () => void;
constructor(name: string);
get isCompositeQuestion(): boolean;
get hasSingleInput(): boolean;
get isContainer(): boolean;
getFirstQuestionToFocus(withError: boolean): Question;
setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void;
private assignOnPropertyChangedToTemplate;
private addOnPropertyChangedCallback;
private onTemplateElementPropertyChanged;
private get useTemplatePanel();
getType(): string;
clearOnDeletingContainer(): void;
get isAllowTitleLeft(): boolean;
removeElement(element: IElement): boolean;
/**
* A `PanelModel` object used as a template to create dynamic panels.
* @see PanelModel
* @see templateElements
* @see templateTitle
* @see panels
* @see panelCount
*/
get template(): PanelModel;
getPanel(): IPanel;
/**
* An array of questions and panels included in a panel template.
* @see template
* @see panels
* @see panelCount
*/
get templateElements(): Array;
/**
* A template for panel titles.
*
* The template can contain the following placeholders:
*
* - `{panelIndex}` - A panel index within the collection of all panels. Starts with 1.
* - `{visiblePanelIndex}` - A panel index within the collection of visible panels. Starts with 1.
* @see template
* @see templateDescription
* @see templateElements
* @see panels
* @see panelCount
*/
get templateTitle(): string;
set templateTitle(newValue: string);
get locTemplateTitle(): LocalizableString;
/**
* A template for tab titles. Applies when [`renderMode`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#renderMode) is `"tab"`.
*
* The template can contain the following placeholders:
*
* - `{panelIndex}` - A panel index within the collection of all panels. Starts with 1.
* - `{visiblePanelIndex}` - A panel index within the collection of visible panels. Starts with 1.
*
* If you want to customize individual tab titles, handle `SurveyModel`'s [`onGetDynamicPanelTabTitle`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onGetDynamicPanelTabTitle) event.
*
* [View Demo](https://surveyjs.io/form-library/examples/tabbed-interface-for-duplicate-group-option/ (linkStyle))
* @see templateTitle
* @see tabTitlePlaceholder
* @see renderMode
*/
get templateTabTitle(): string;
set templateTabTitle(newValue: string);
get locTemplateTabTitle(): LocalizableString;
/**
* A placeholder for tab titles that applies when the [`templateTabTitle`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#templateTabTitle) expression doesn't produce a meaningful value.
*
* Default value: `"New Panel"` (taken from a [localization dictionary](https://github.com/surveyjs/survey-library/tree/master/src/localization))
*/
get tabTitlePlaceholder(): string;
set tabTitlePlaceholder(newValue: string);
get locTabTitlePlaceholder(): LocalizableString;
/**
* A template for panel descriptions.
* @see template
* @see templateTitle
* @see templateElements
* @see panels
* @see panelCount
*/
get templateDescription(): string;
set templateDescription(newValue: string);
get locTemplateDescription(): LocalizableString;
/**
* A Boolean expression that is evaluated against each panel. If the expression evaluates to `false`, the panel becomes hidden.
*
* A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.
*
* Use the `{panel}` placeholder to reference the current panel in the expression.
*
* Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#conditional-visibility).
* @see visibleIf
* @see visiblePanels
*/
get templateVisibleIf(): string;
set templateVisibleIf(val: string);
protected get items(): Array;
/**
* An array of `PanelModel` objects created based on a panel template.
* @see PanelModel
* @see template
* @see panelCount
*/
get panels(): Array;
/**
* An array of currently visible panels ([`PanelModel`](https://surveyjs.io/form-library/documentation/api-reference/panel-model) objects).
* @see templateVisibleIf
*/
get visiblePanels(): Array;
protected get panelsCore(): Array;
protected get visiblePanelsCore(): Array;
private onPanelAdded;
private onPanelRemoved;
private onPanelRemovedCore;
/**
* A zero-based index of the currently displayed panel.
*
* When `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);
private _renderedPanels;
private updateRenderedPanels;
set renderedPanels(val: Array);
get renderedPanels(): Array;
private isPanelsAnimationRunning;
private getPanelsAnimationOptions;
private _panelsAnimations;
private disablePanelsAnimations;
private enablePanelsAnimations;
private updatePanelsAnimation;
get panelsAnimation(): AnimationProperty, IAnimationGroupConsumer>;
onHidingContent(): void;
/**
* Specifies whether to display a confirmation dialog when a respondent wants to delete a panel.
* @see confirmDeleteText
*/
get confirmDelete(): boolean;
set confirmDelete(val: boolean);
/**
* Specifies a key question. Set this property to the name of a question used in the template, and Dynamic Panel will display `keyDuplicationError` if a user tries to enter a duplicate value in this question.
* @see keyDuplicationError
*/
get keyName(): string;
set keyName(val: string);
/**
* A message displayed in a confirmation dialog that appears when a respondent wants to delete a panel.
* @see confirmDelete
*/
get confirmDeleteText(): string;
set confirmDeleteText(val: string);
get locConfirmDeleteText(): LocalizableString;
/**
* An error message displayed when users enter a duplicate value into a question that accepts only unique values (`isUnique` is set to `true` or `keyName` is specified).
*
* A default value for this property is taken from a [localization dictionary](https://github.com/surveyjs/survey-library/tree/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;
setIsMobile(val: boolean): void;
themeChanged(theme: ITheme): void;
/**
* The number of panels in Dynamic Panel.
* @see minPanelCount
* @see maxPanelCount
*/
get panelCount(): number;
set panelCount(val: number);
/**
* Returns the number of visible panels in Dynamic Panel.
* @see templateVisibleIf
*/
get visiblePanelCount(): number;
/**
* Specifies whether users can expand and collapse panels. Applies if `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.panel.maxPanelCount`](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`
*
* By default, users add new panels to the end. If you want to let users insert a new panel after the current panel, set the [`newPanelPosition`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#newPanelPosition) property to `"next"`.
* @see canAddPanel
* @see allowRemovePanel
*/
get allowAddPanel(): boolean;
set allowAddPanel(val: boolean);
/**
* Specifies the position of newly added panels.
*
* Possible values:
*
* - `"last"` (default) - New panels are added to the end.
* - `"next"` - New panels are inserted after the current panel.
* @see allowAddPanel
* @see addPanel
*/
get newPanelPosition(): string;
set newPanelPosition(val: string);
/**
* Specifies whether users are allowed to delete panels.
*
* Default value: `true`
* @see canRemovePanel
* @see allowAddPanel
*/
get allowRemovePanel(): boolean;
set allowRemovePanel(val: boolean);
/**
* Gets or sets the location of question titles relative to their input fields.
*
* - `"default"` (default) - Inherits the setting from the Dynamic Panel's `titleLocation` property, which in turn inherits the [`questionTitleLocation`](https://surveyjs.io/form-library/documentation/surveymodel#questionTitleLocation) property value specified for the Dynamic Panel's container (page or survey).
* - `"top"` - Displays question titles above input fields.
* - `"bottom"` - Displays question titles below input fields.
* - `"left"` - Displays question titles to the left of input fields.
* - `"hidden"` - Hides question titles.
* @see titleLocation
*/
get templateTitleLocation(): string;
set templateTitleLocation(value: string);
/**
* Specifies the error message position.
*
* Possible values:
*
* - `"default"` (default) - Inherits the setting from the [`errorLocation`](#errorLocation) property.
* - `"top"` - Displays error messages above questions.
* - `"bottom"` - Displays error messages below questions.
*/
get templateErrorLocation(): string;
set templateErrorLocation(value: string);
/**
* Use this property to show/hide the numbers in titles in questions inside a dynamic panel.
* By default the value is "off". You may set it to "onPanel" and the first question inside a dynamic panel will start with 1 or "onSurvey" to include nested questions in dymamic panels into global survey question numbering.
*/
get showQuestionNumbers(): string;
set showQuestionNumbers(val: string);
protected notifySurveyOnChildrenVisibilityChanged(): boolean;
/**
* Specifies the location of the Delete Panel button relative to panel content.
*
* Possible values:
*
* - `"bottom"` (default) - Displays the Delete Panel button below panel content.
* - `"right"` - Displays the Delete Panel button to the right of panel content.
* @see panelRemoveText
*/
get panelRemoveButtonLocation(): string;
set panelRemoveButtonLocation(val: string);
/**
* 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"` (default) - 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. [View Demo](https://surveyjs.io/form-library/examples/tabbed-interface-for-duplicate-group-option/)
*/
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;
get isValueArray(): boolean;
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;
private focusNewPanelCallback;
private focusNewPanel;
/**
* Adds a new panel based on the [template](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#template).
* @param index *(Optional)* An index at which to insert the new panel. `undefined` adds the panel to the end or inserts it after the current panel if [`renderMode`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#renderMode) is `"tab"`. A negative index (for instance, -1) adds the panel to the end in all cases, regardless of the `renderMode` value.
* @see panelCount
* @see panels
* @see allowAddPanel
* @see newPanelPosition
*/
addPanel(index?: number): PanelModel;
private updateValueOnAddingPanel;
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;
isRequireConfirmOnDelete(val: any): boolean;
/**
* 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
*/
private removedPanelIndex;
removePanel(value: any): void;
private getVisualPanelIndex;
private getPanelVisibleIndexById;
locStrsChanged(): void;
clearIncorrectValues(): void;
clearErrors(): void;
getQuestionFromArray(name: string, index: number): IQuestion;
private clearIncorrectValuesInPanel;
private iscorrectValueWithPostPrefix;
getSharedQuestionFromArray(name: string, panelIndex: number): Question;
addConditionObjectsByContext(objects: Array, context: any): void;
protected collectNestedQuestionsCore(questions: Question[], visibleOnly: boolean): void;
getConditionJson(operator?: string, path?: string): any;
protected onReadOnlyChanged(): void;
private updateNoEntriesTextDefaultLoc;
onSurveyLoad(): void;
private hasPanelBuildFirstTime;
private isBuildingPanelsFirstTime;
private buildPanelsFirstTime;
private get wasNotRenderedInSurvey();
private get canBuildPanels();
onFirstRendering(): void;
localeChanged(): void;
runCondition(values: HashTable, properties: HashTable): void;
runTriggers(name: string, value: any): void;
private reRunCondition;
protected runPanelsCondition(panels: PanelModel[], values: HashTable, properties: HashTable): void;
onAnyValueChanged(name: string, questionName: string): void;
private hasKeysDuplicated;
private updatePanelsContainsErrors;
hasErrors(fireCallback?: boolean, rec?: any): boolean;
protected getContainsErrors(): boolean;
protected getIsAnswered(): boolean;
protected clearValueOnHidding(isClearOnHidden: boolean): void;
clearValueIfInvisible(reason?: string): void;
private clearValueInPanelsIfInvisible;
protected getIsRunningValidators(): boolean;
getAllErrors(): Array;
protected getDisplayValueCore(keysAsText: boolean, value: any): any;
private getPanelDisplayValue;
private hasErrorInPanels;
private setOnCompleteAsyncInPanel;
private isValueDuplicated;
getPanelActions(panel: PanelModel): Array;
protected createNewPanel(): PanelModel;
protected createAndSetupNewPanelObject(): PanelModel;
private getTemplateQuestionTitleLocation;
getChildErrorLocation(child: Question): string;
protected createNewPanelObject(): PanelModel;
private settingPanelCountBasedOnValue;
private setPanelCountBasedOnValue;
setQuestionValue(newValue: any): void;
onSurveyValueChanged(newValue: any): void;
private isAllPanelsEmpty;
private panelUpdateValueFromSurvey;
private panelSurveyValueChanged;
protected onSetData(): void;
protected isNewValueCorrect(val: any): boolean;
getItemIndex(item: ISurveyData): number;
getVisibleItemIndex(item: ISurveyData): number;
getPanelItemData(item: ISurveyData): any;
private isSetPanelItemData;
private static maxCheckCount;
setPanelItemData(item: ISurveyData, name: string, val: any): void;
getRootData(): ISurveyData;
getPlainData(options?: IPlainDataOptions): IQuestionPlainData;
updateElementCss(reNew?: boolean): void;
get progressText(): string;
get progress(): string;
getRootCss(): string;
get cssHeader(): string;
getPanelWrapperCss(panel: PanelModel): string;
getPanelRemoveButtonCss(): string;
getAddButtonCss(): string;
getPrevButtonCss(): string;
getNextButtonCss(): string;
/**
* A text displayed when Dynamic Panel contains no entries.
*/
get noEntriesText(): string;
set noEntriesText(val: string);
get locNoEntriesText(): LocalizableString;
getShowNoEntriesPlaceholder(): boolean;
needResponsiveWidth(): boolean;
private additionalTitleToolbarValue;
get hasAdditionalTitleToolbar(): boolean;
protected getAdditionalTitleToolbar(): AdaptiveActionContainer | 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;
protected calcCssClasses(css: any): any;
}
}
declare module "question_signaturepad" {
import { ITheme } from "themes";
import { QuestionFileModelBase } from "question_file";
/**
* A class that describes the Signature question type.
*
* [View Demo](https://surveyjs.io/form-library/examples/signature-pad-widget-javascript/ (linkStyle))
*/
export class QuestionSignaturePadModel extends QuestionFileModelBase {
isDrawingValue: boolean;
isReadyForUpload: boolean;
private getPenColorFromTheme;
private updateColors;
protected getCssRoot(cssClasses: any): string;
protected getFormat(): "" | "image/svg+xml" | "image/jpeg";
protected updateValue(): void;
constructor(name: string);
getType(): string;
afterRenderQuestionElement(el: HTMLElement): void;
beforeDestroyQuestionElement(el: HTMLElement): void;
themeChanged(theme: ITheme): void;
private canvas;
private element;
private scale;
private valueIsUpdatingInternally;
valueWasChangedFromLastUpload: boolean;
private resizeCanvas;
private scaleCanvas;
private fromDataUrl;
private fromUrl;
private refreshCanvas;
private updateValueHandler;
initSignaturePad(el: HTMLElement): void;
destroySignaturePad(el: HTMLElement): void;
/**
* Specifies the format in which to store the signature image.
*
* Possible values:
*
* - `"png"` (default)
* - `"jpeg"`
* - `"svg"`
*/
get dataFormat(): string;
set dataFormat(val: string);
/**
* Specifies the width of the signature area. Accepts positive integer numbers.
*/
get signatureWidth(): number;
set signatureWidth(val: number);
/**
* Specifies the height of the signature area. Accepts positive integer numbers.
*/
get signatureHeight(): number;
set signatureHeight(val: number);
/**
* Specifies whether the signature area should be scaled to fit into the question width.
*
* Default value: `false`
*
* This property auto-scales the signature area to fill all available width within the question box while maintaining the default 3:2 aspect ratio. If you set [custom width](#signatureWidth) and [height](#signatureHeight) values, the setting will keep the aspect ratio of these dimensions.
*
* > The signature area is scaled only for display. The image saved in survey results will have dimensions specified by the [`signatureHeight`](#signatureHeight) and [`signatureWidth`](#signatureWidth) properties.
*/
signatureAutoScaleEnabled: boolean;
/**
* Speicifies the minimum width of pen strokes, measured in pixels.
*
* Default value: 0.5
*/
penMinWidth: number;
/**
* Speicifies the maximum width of pen strokes, measured in pixels.
*
* Default value: 2.5
*/
penMaxWidth: number;
private get containerHeight();
private get containerWidth();
get renderedCanvasWidth(): string;
get height(): number;
set height(val: number);
/**
* Specifies whether to display a button that clears the signature area.
*
* Default value: `true`
*/
get allowClear(): boolean;
set allowClear(val: boolean);
get canShowClearButton(): boolean;
/**
* Specifies a color for the pen.
*
* This property accepts color values in the following formats:
*
* - Hexadecimal colors (`"#FF0000"`)
* - RGB colors (`"rgb(255,0,0)"`)
* - Color names (`"red"`)
* @see backgroundColor
*/
get penColor(): string;
set penColor(val: string);
/**
* Specifies a color for the signature area background. Ignored if [`backgroundImage`](#backgroundImage) is set.
*
* This property accepts color values in the following formats:
*
* - Hexadecimal colors (`"#FF0000"`)
* - RGB colors (`"rgb(255,0,0)"`)
* - Color names (`"red"`)
* @see penColor
*/
get backgroundColor(): string;
set backgroundColor(val: string);
/**
* An image to display in the background of the signature area. Accepts a base64 or URL string value.
* @see backgroundColor
*/
get backgroundImage(): string;
set backgroundImage(val: string);
get clearButtonCaption(): string;
/**
* A Boolean value that specifies whether to show the placeholder text in the signature area.
*
* Default value: `true`
*
* Use the [`placeholder`](#placeholder) and [`placeholderReadOnly`](#placeholderReadOnly) properties to specify placeholder texts for the signature area in edit mode and in read-only or preview mode.
*/
showPlaceholder: boolean;
get locRenderedPlaceholder(): any;
nothingIsDrawn(): boolean;
needShowPlaceholder(): boolean;
/**
* A placeholder text for the signature area. Applies when the [`showPlaceholder`](#showPlaceholder) property is `true`.
*/
placeholder: string;
/**
* A placeholder text for the signature area in read-only or preview mode. Applies when the [`showPlaceholder`](#showPlaceholder) property is `true`.
*/
placeholderReadOnly: string;
onBlur: (event: any) => void;
protected uploadResultItemToValue(r: any): any;
protected setValueFromResult(arg: any): void;
clearValue(keepComment?: boolean): void;
endLoadingFromJson(): void;
}
}
declare module "survey-events-api" {
import { IAction } from "actions/action";
import { Base } from "base";
import { IElement, IPanel, ISurveyElement, IValueItemCustomPropValues } from "base-interfaces";
import { ItemValue } from "itemvalue";
import { PageModel } from "page";
import { PanelModel, PanelModelBase } from "panel";
import { PopupModel } from "popup";
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 { QuestionSignaturePadModel } from "question_signaturepad";
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 Upload or Signature Pad question instance for which the event is raised.
*/
question: QuestionFileModel | QuestionSignaturePadModel;
}
export interface PanelDynamicQuestionEventMixin {
/**
* A Dynamic Panel question instance for which the event is raised.
*/
question: QuestionPanelDynamicModel;
}
export interface MatrixDropdownQuestionEventMixin {
/**
* A Multi-Select Matrix question instance for which the event is raised.
*/
question: QuestionMatrixDropdownModelBase;
}
export interface MatrixDynamicQuestionEventMixin {
/**
* A Dynamic Matrix question instance for which the event is raised.
*/
question: QuestionMatrixDynamicModel;
}
export interface PanelEventMixin {
/**
* A Panel instance for which the event is raised.
*/
panel: PanelModel;
}
export interface PageEventMixin {
/**
* A Page instance for which the event is raised.
*/
page: PageModel;
}
export interface GetTitleActionsEventMixin {
/**
* An array of [actions](https://surveyjs.io/form-library/documentation/iaction) associated with the processed element.
*/
titleActions: Array;
}
export interface GetActionsEventMixin {
/**
* An array of [actions](https://surveyjs.io/form-library/documentation/iaction). You can modify the entire array or individual actions within it.
*/
actions: Array;
}
export interface AfterRenderElementEventMixin {
/**
* A rendered HTML element.
*/
htmlElement: HTMLElement;
}
export interface UpdateElementCssClassesEventMixin {
/**
* An object with CSS classes applied to the element being rendered, for example, `{ root: "class1", button: "class2" }`. You can modify this object to apply custom CSS classes.
*/
cssClasses: any;
}
export interface ElementVisibleChangedEventMixin {
/**
* Indicates whether the element is visible now.
*/
visible: boolean;
}
export interface TriggerExecutedEvent {
/**
* A trigger that has been executed.
*/
trigger: Trigger;
}
export interface CompleteBaseEvent {
/**
* Returns `true` if survey completion is caused by a ["complete" trigger](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#complete).
*/
isCompleteOnTrigger: boolean;
/**
* A "complete" trigger that has been executed. This parameter has a value only if `options.isCompleteOnTrigger` is `true`.
*/
completeTrigger?: Trigger;
}
export interface CompletingEvent extends CompleteBaseEvent {
/**
* A Boolean property that you can set to `false` if you want to prevent survey completion.
*/
allow: boolean;
/**
* Obsolete. Use `options.allow` instead.
*/
allowComplete: boolean;
}
export interface CompleteEvent extends CompleteBaseEvent {
/**
* Call this method to hide the save operation messages.
*/
clearSaveMessages: (test?: string) => void;
/**
* Call this method to indicate that survey results are successfully saved. You can use the `text` parameter to display a custom message.
*/
showSaveSuccess: (text?: string) => void;
/**
* Call this method to indicate that an error occurred during the save operation. You can use the `text` parameter to display a custom error message.
*/
showSaveError: (text?: string) => void;
/**
* Call this method to indicate that the save operation is in progress. You can use the `text` parameter to display a custom message.
*/
showSaveInProgress: (text?: string) => void;
/**
* Obsolete. Use `options.showSaveInProgress` instead.
*/
showDataSaving: (text?: string) => void;
/**
* Obsolete. Use `options.showSaveError` instead.
*/
showDataSavingError: (text?: string) => void;
/**
* Obsolete. Use `options.showSaveSuccess` instead.
*/
showDataSavingSuccess: (text?: string) => void;
/**
* Obsolete. Use `options.clearSaveMessages` instead.
*/
showDataSavingClear: (text?: string) => void;
}
export interface ShowingPreviewEvent {
/**
* A Boolean property that you can set to `false` if you want to cancel the preview.
*/
allow: boolean;
/**
* Obsolete. Use `options.allow` instead.
*/
allowShowPreview: boolean;
}
export interface NavigateToUrlEvent {
/**
* A Boolean property that you can set to `false` if you want to cancel the navigation and show the [complete page](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#complete-page).
*/
allow: boolean;
/**
* A URL to which respondents should be navigated. You can modify this parameter's value.
*/
url: string;
}
export interface CurrentPageChangedEvent {
/**
* Returns `true` if the respondent is switching to the previous page.
*/
isPrevPage: boolean;
/**
* Returns `true` if the respondent is switching to the next page.
*/
isNextPage: boolean;
/**
* Returns `true` if the respondent is going backward, that is, `newCurrentPage` is earlier in the survey than `oldCurrentPage`.
*/
isGoingBackward: boolean;
/**
* Returns `true` if the respondent is going forward along the survey.
*/
isGoingForward: boolean;
/**
* Returns `true` if the respondent is switching from the [preview page](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#preview-page).
*/
isAfterPreview: boolean;
/**
* The current page.
*/
newCurrentPage: PageModel;
/**
* A page that used to be current.
*/
oldCurrentPage: PageModel;
}
export interface CurrentPageChangingEvent extends CurrentPageChangedEvent {
/**
* A Boolean property that you can set to `false` if you do not want to switch the current page.
*/
allow: boolean;
/**
* Obsolete. Use `options.allow` instead.
*/
allowChanging: boolean;
}
export interface ValueChangeBaseEvent extends QuestionEventMixin {
/**
* The `name` of the question whose value is being changed. If you use the [`valueName`](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model#valueName) property, this parameter contains its value.
*/
name: string;
}
export interface ValueChangedEvent extends ValueChangeBaseEvent {
/**
* A new value.
*/
value: any;
}
export interface ValueChangingEvent extends ValueChangeBaseEvent {
/**
* A new value. You can change it if required.
*/
value: any;
/**
* A previous value.
*/
oldValue: any;
}
export interface VariableChangedEvent {
/**
* A new value for the variable or calculated value.
*/
value: any;
/**
* The name of the variable or calculated value that has been changed.
*/
name: string;
}
export interface QuestionVisibleChangedEvent extends QuestionEventMixin, ElementVisibleChangedEventMixin {
/**
* The question's name.
*/
name: string;
}
export interface PageVisibleChangedEvent extends ElementVisibleChangedEventMixin, PageEventMixin {
}
export interface PanelVisibleChangedEvent extends ElementVisibleChangedEventMixin, PanelEventMixin {
}
export interface QuestionCreatedEvent extends QuestionEventMixin {
}
export interface ElementAddedEvent {
/**
* A page that nests the added element.
*/
page: PanelModelBase;
/**
* The parent container (panel or page).
*/
parent: PanelModelBase;
/**
* Obsolete. Use `options.page` instead.
*/
rootPanel: any;
/**
* Obsolete. Use `options.parent` instead.
*/
parentPanel: any;
/**
* The element's index within the parent container (panel or page).
*/
index: number;
/**
* The question's name.
*/
name: string;
}
export interface ElementRemovedEvent {
/**
* The element's name.
*/
name: string;
}
export interface QuestionAddedEvent extends QuestionEventMixin, ElementAddedEvent {
}
export interface QuestionRemovedEvent extends QuestionEventMixin, ElementRemovedEvent {
}
export interface PanelAddedEvent extends PanelEventMixin, ElementAddedEvent {
}
export interface PanelRemovedEvent extends PanelEventMixin, ElementRemovedEvent {
}
export interface PageAddedEvent extends PageEventMixin {
}
export interface ValidateQuestionEvent extends QuestionEventMixin {
/**
* An error message that you should specify if validation fails.
*/
error: string;
/**
* A question value being validated.
*/
value: any;
/**
* The question's name.
*/
name: string;
}
export interface SettingQuestionErrorsEvent extends QuestionEventMixin {
/**
* An array of errors. The array is empty if the validated question satisfies all validation rules.
*/
errors: Array;
}
export interface ServerValidateQuestionsEvent {
/**
* A method that you should call when a request to the server has completed.
*/
complete: () => void;
/**
* An object for your error messages. Set error messages as follows: `options.errors["questionName"] = "My error message"`.
*/
errors: {
[index: string]: any;
};
/**
* Question values. You can get an individual question value as follows: `options.data["questionName"]`.
*/
data: {
[index: string]: any;
};
}
export interface ValidatePanelEvent extends PanelEventMixin {
/**
* An error message that you should specify if validation fails.
*/
error: string;
/**
* The panel's name.
*/
name: string;
}
export interface ErrorCustomTextEvent {
/**
* A validation error type: `"required"`, `"requireoneanswer"`, `"requirenumeric"`, `"exceedsize"`, `"webrequest"`, `"webrequestempty"`, `"otherempty"`, `"uploadingfile"`, `"requiredinallrowserror"`, `"minrowcounterror"`, `"keyduplicationerror"`, or `"custom"`
*/
name: string;
/**
* A survey element to which the validation error belongs.
*/
obj: Question | PanelModel | SurveyModel;
/**
* A validation error.
*/
error: SurveyError;
/**
* An error message. You can assign a custom message to this parameter.
*/
text: string;
}
export interface ValidatedErrorsOnCurrentPageEvent extends PageEventMixin {
/**
* An array of questions with validation errors.
*/
questions: Array;
/**
* An array of validation errors.
*/
errors: Array