`. The `css` property applies classes to the `
`.
*
* To apply several classes, separate them with a space character: `"myclass1 myclass2"`.
*
* [View Demo](https://surveyjs.io/form-library/examples/add-custom-navigation-button/ (linkStyle))
* @see innerCss
*/
css?: string;
/**
* One or several CSS classes that you want to apply to the inner `
` element.
*
* In the markup, an action item is rendered as an `
` wrapped in a `
`. The `innerCss` property applies classes to the `
`.
*
* To apply several classes, separate them with a space character: `"myclass1 myclass2"`.
*
* [View Demo](https://surveyjs.io/form-library/examples/add-custom-navigation-button/ (linkStyle))
* @see css
*/
innerCss?: string;
/**
* The action item's data object. Use it to pass required data to a custom template or component.
*/
data?: any;
popupModel?: any;
needSeparator?: boolean;
/**
* Specifies whether the action item is active.
*
* Use this property as a flag to specify different action item appearances in different states.
* @see enabled
* @see visible
*/
active?: boolean;
pressed?: boolean;
/**
* Specifies the name of a template used to render the action item.
* @see component
*/
template?: string;
/**
* Specifies the name of a component used to render the action item.
*/
component?: string;
/**
* The action item's icon name.
* @see iconSize
*/
iconName?: string;
/**
* The action item's icon size in pixels.
* @see iconName
*/
iconSize?: number | string;
/**
* The action item's location in a matrix question's row.
*
* The following values are available:
*
* - `"start"` - The action item is located at the beginning of the row.
* - `"end"` - The action is located at the end of the row.
*/
location?: string;
/**
* Set this property to `true` if you want to disable keyboard navigation for the action item (sets the `tabIndex` attribute to -1).
*/
disableTabStop?: boolean;
/**
* Set this property to `true` if you want the item's `title` to be always visible.
* If you set it to `false`, the `title` hides when the screen space is limited, and the item displays only the icon.
* @see title
* @see iconName
*/
disableShrink?: boolean;
disableHide?: boolean;
mode?: actionModeType;
/**
* A number that specifies the action's position relative to other actions.
*
* [View Demo](https://surveyjs.io/form-library/examples/add-custom-navigation-button/ (linkStyle))
*/
visibleIndex?: number;
needSpace?: boolean;
ariaChecked?: boolean;
ariaExpanded?: boolean;
ariaRole?: string;
elementId?: string;
items?: Array
;
markerIconName?: string;
showPopup?: () => void;
hidePopup?: () => void;
}
export interface IActionDropdownPopupOptions extends IListModel, IPopupOptionsBase {
}
export function createDropdownActionModel(actionOptions: IAction, dropdownOptions: IActionDropdownPopupOptions, locOwner?: ILocalizableOwner): Action;
export function createDropdownActionModelAdvanced(actionOptions: IAction, listOptions: IListModel, popupOptions?: IPopupOptionsBase): Action;
export function createPopupModelWithListModel(listOptions: IListModel, popupOptions: IPopupOptionsBase): PopupModel;
export function getActionDropdownButtonTarget(container: HTMLElement): HTMLElement;
export abstract class BaseAction extends Base implements IAction {
items?: IAction[];
private static renderedId;
private static getNextRendredId;
private cssClassesValue;
private rendredIdValue;
private ownerValue;
tooltip: string;
showTitle: boolean;
innerCss: string;
active: boolean;
pressed: boolean;
data: any;
popupModel: any;
needSeparator: boolean;
template: string;
mode: actionModeType;
visibleIndex: number;
disableTabStop: boolean;
disableShrink: boolean;
disableHide: boolean;
needSpace: boolean;
ariaChecked: boolean;
ariaExpanded: boolean;
ariaRole: string;
id: string;
removePriority: number;
iconName: string;
iconSize: number | string;
markerIconName: string;
css?: string;
minDimension: number;
maxDimension: number;
get renderedId(): number;
get owner(): ILocalizableOwner;
set owner(val: ILocalizableOwner);
get visible(): boolean;
set visible(val: boolean);
get enabled(): boolean;
set enabled(val: boolean);
get component(): string;
set component(val: string);
get locTitle(): LocalizableString;
set locTitle(val: LocalizableString);
get title(): string;
set title(val: string);
set cssClasses(val: any);
get cssClasses(): any;
get isVisible(): boolean;
get disabled(): boolean;
get canShrink(): boolean;
get hasTitle(): boolean;
get hasSubItems(): boolean;
getActionBarItemTitleCss(): string;
getActionBarItemCss(): string;
getActionRootCss(): string;
getTooltip(): string;
getIsTrusted(args: any): boolean;
showPopup(): void;
hidePopup(): void;
isPressed: boolean;
isHovered: boolean;
private showPopupTimeout;
private hidePopupTimeout;
private clearPopupTimeouts;
showPopupDelayed(delay: number): void;
hidePopupDelayed(delay: number): void;
protected abstract getEnabled(): boolean;
protected abstract setEnabled(val: boolean): void;
protected abstract getVisible(): boolean;
protected abstract setVisible(val: boolean): void;
protected abstract getLocTitle(): LocalizableString;
protected abstract setLocTitle(val: LocalizableString): void;
protected abstract getTitle(): string;
protected abstract setTitle(val: string): void;
protected abstract getComponent(): string;
protected abstract setComponent(val: string): void;
}
export class Action extends BaseAction implements IAction, ILocalizableOwner {
private locTitleValue;
updateCallback: (isResetInitialized: boolean) => void;
innerItem: IAction;
private raiseUpdate;
constructor(innerItemData: IAction);
private createLocTitle;
setSubItems(options: IListModel): void;
location?: string;
id: string;
private _visible;
locTooltipName?: string;
private _enabled;
action: (context?: any, isUserAction?: boolean) => void;
onFocus: (isMouse: boolean, event: any) => void;
_component: string;
items: any;
_title: string;
protected getLocTitle(): LocalizableString;
protected setLocTitle(val: LocalizableString): void;
protected getTitle(): string;
protected setTitle(val: string): void;
get locTitleName(): string;
set locTitleName(val: string);
locStrsChanged(): void;
doAction(args: any): boolean;
private isMouseDown;
doMouseDown(args: any): void;
doFocus(args: any): void;
private locStrChangedInPopupModel;
private locTitleChanged;
private locTooltipChanged;
getLocale(): string;
getMarkdownHtml(text: string, name: string): string;
getProcessedText(text: string): string;
getRenderer(name: string): string;
getRendererContext(locStr: LocalizableString): any;
setVisible(val: boolean): void;
getVisible(): boolean;
enabledIf?: () => boolean;
setEnabled(val: boolean): void;
getEnabled(): boolean;
setComponent(val: string): void;
getComponent(): string;
dispose(): void;
}
export class ActionDropdownViewModel {
private item;
private popupModel;
private funcKey;
constructor(item: Action);
private setupPopupCallbacks;
private removePopupCallbacks;
dispose(): void;
}
}
declare module "packages/survey-core/src/utils/responsivity-manager" {
import { Action } from "packages/survey-core/src/actions/action";
import { AdaptiveActionContainer } from "packages/survey-core/src/actions/adaptive-container";
interface IDimensions {
scroll: number;
offset: number;
}
export class ResponsivityManager {
container: HTMLDivElement;
private model;
private itemsSelector;
private dotsItemSize;
private delayedUpdateFunction;
private resizeObserver;
private isInitialized;
protected minDimensionConst: number;
private separatorSize;
private separatorAddConst;
private paddingSizeConst;
private dotsSizeConst;
private dotsIconClass;
private iconClass;
protected recalcMinDimensionConst: boolean;
getComputedStyle: (elt: Element) => CSSStyleDeclaration;
constructor(container: HTMLDivElement, model: AdaptiveActionContainer, itemsSelector: string, dotsItemSize?: number, delayedUpdateFunction?: (callback: () => void) => void);
protected getDimensions(element: HTMLElement): IDimensions;
protected getAvailableSpace(): number;
protected calcItemSize(item: HTMLDivElement): number;
private calcMinDimension;
private calcItemsSizes;
protected calcActionDimensions(currentAction: Action, item: HTMLDivElement): void;
private get isContainerVisible();
private process;
dispose(): void;
}
export class VerticalResponsivityManager extends ResponsivityManager {
constructor(container: HTMLDivElement, model: AdaptiveActionContainer, itemsSelector: string, dotsItemSize?: number, minDimension?: number, delayedUpdateFunction?: (callback: () => void) => void);
protected getDimensions(): IDimensions;
protected getAvailableSpace(): number;
protected calcItemSize(item: HTMLDivElement): number;
protected calcActionDimensions(currentAction: Action, item: HTMLDivElement): void;
}
}
declare module "packages/survey-core/src/actions/adaptive-container" {
import { ListModel } from "packages/survey-core/src/list";
import { Action, actionModeType } from "packages/survey-core/src/actions/action";
import { ActionContainer } from "packages/survey-core/src/actions/container";
export class AdaptiveActionContainer extends ActionContainer {
dotsItem: Action;
private responsivityManager;
minVisibleItemsCount: number;
isResponsivenessDisabled: boolean;
private hideItemsGreaterN;
private getActionsToHide;
private getVisibleItemsCount;
private updateItemMode;
private static ContainerID;
constructor();
get hiddenItemsListModel(): ListModel;
protected onSet(): void;
protected onPush(item: T): void;
protected getRenderedActions(): Array;
protected raiseUpdate(isResetInitialized: boolean): void;
fit(dimension: number, dotsItemSize: number): void;
initResponsivityManager(container: HTMLDivElement, delayedUpdateFunction?: (callback: () => void) => void): void;
resetResponsivityManager(): void;
setActionsMode(mode: actionModeType): void;
dispose(): void;
}
}
declare module "packages/survey-core/src/survey-error" {
import { ISurveyErrorOwner } from "packages/survey-core/src/base-interfaces";
import { LocalizableString } from "packages/survey-core/src/localizablestring";
export class SurveyError {
text: string;
protected errorOwner: ISurveyErrorOwner;
private locTextValue;
visible: boolean;
constructor(text?: string, errorOwner?: ISurveyErrorOwner);
equals(error: SurveyError): boolean;
get locText(): LocalizableString;
getText(): string;
getErrorType(): string;
protected getDefaultText(): string;
protected getLocale(): string;
protected getLocalizationString(locStrName: string): string;
onUpdateErrorTextCallback: (error: SurveyError) => void;
updateText(): void;
}
}
declare module "packages/survey-core/src/defaultCss/defaultV2Css" {
export var surveyCss: any;
export var defaultV2Css: {
root: string;
rootProgress: string;
rootMobile: string;
rootAnimationDisabled: string;
rootReadOnly: string;
rootCompact: string;
rootFitToContainer: string;
rootWrapper: string;
rootWrapperFixed: string;
rootWrapperHasImage: string;
rootBackgroundImage: string;
container: string;
header: string;
bodyContainer: string;
body: string;
bodyWithTimer: string;
clockTimerRoot: string;
clockTimerRootTop: string;
clockTimerRootBottom: string;
clockTimerProgress: string;
clockTimerProgressAnimation: string;
clockTimerTextContainer: string;
clockTimerMinorText: string;
clockTimerMajorText: string;
bodyEmpty: string;
bodyLoading: string;
footer: string;
title: string;
description: string;
logo: string;
logoImage: string;
headerText: string;
headerClose: string;
navigationButton: string;
bodyNavigationButton: string;
completedPage: string;
completedBeforePage: string;
timerRoot: string;
navigation: {
complete: string;
prev: string;
next: string;
start: string;
preview: string;
edit: string;
};
panel: {
contentEnter: string;
contentLeave: string;
enter: string;
leave: string;
asPage: string;
number: string;
title: string;
titleExpandable: string;
titleExpandableSvg: string;
titleNumInline: string;
titleExpanded: string;
titleCollapsed: string;
titleDisabled: string;
titleOnExpand: string;
titleOnError: string;
titleBar: string;
description: string;
container: string;
withFrame: string;
content: string;
icon: string;
iconExpanded: string;
footer: string;
requiredText: string;
header: string;
collapsed: string;
expanded: string;
expandable: string;
expandableAnimating: string;
nested: string;
invisible: string;
navigationButton: string;
compact: string;
errorsContainer: string;
};
paneldynamic: {
mainRoot: string;
empty: string;
root: string;
iconRemove: string;
navigation: string;
title: string;
header: string;
headerTab: string;
button: string;
buttonRemove: string;
buttonAdd: string;
buttonPrev: string;
buttonPrevDisabled: string;
buttonNextDisabled: string;
buttonNext: string;
progressContainer: string;
progress: string;
progressBar: string;
nested: string;
progressText: string;
separator: string;
panelWrapper: string;
footer: string;
panelFooter: string;
footerButtonsContainer: string;
panelsContainer: string;
panelWrapperInRow: string;
panelWrapperEnter: string;
panelWrapperLeave: string;
panelWrapperList: string;
progressBtnIcon: string;
noEntriesPlaceholder: string;
compact: string;
tabsContainer: string;
tabsContainerWithHeader: string;
tabsRoot: string;
tabsLeft: string;
tabsRight: string;
tabsCenter: string;
tabs: {
item: string;
itemPressed: string;
itemAsIcon: string;
itemIcon: string;
itemTitle: string;
};
};
progress: string;
progressTop: string;
progressBottom: string;
progressBar: string;
progressText: string;
progressButtonsRoot: string;
progressButtonsNumbered: string;
progressButtonsFitSurveyWidth: string;
progressButtonsContainerCenter: string;
progressButtonsContainer: string;
progressButtonsConnector: string;
progressButtonsButton: string;
progressButtonsButtonBackground: string;
progressButtonsButtonContent: string;
progressButtonsHeader: string;
progressButtonsFooter: string;
progressButtonsImageButtonLeft: string;
progressButtonsImageButtonRight: string;
progressButtonsImageButtonHidden: string;
progressButtonsListContainer: string;
progressButtonsList: string;
progressButtonsListElementPassed: string;
progressButtonsListElementCurrent: string;
progressButtonsListElementNonClickable: string;
progressButtonsPageTitle: string;
progressButtonsPageDescription: string;
progressTextInBar: string;
page: {
root: string;
emptyHeaderRoot: string;
title: string;
description: string;
number: string;
errorsContainer: string;
};
pageTitle: string;
pageDescription: string;
row: string;
rowMultiple: string;
rowCompact: string;
rowEnter: string;
rowDelayedEnter: string;
rowLeave: string;
rowReplace: string;
pageRow: string;
question: {
contentEnter: string;
contentLeave: string;
enter: string;
leave: string;
mobile: string;
mainRoot: string;
flowRoot: string;
withFrame: string;
asCell: string;
answered: string;
header: string;
headerLeft: string;
headerTop: string;
headerBottom: string;
content: string;
contentSupportContainerQueries: string;
contentLeft: string;
titleNumInline: string;
titleLeftRoot: string;
titleTopRoot: string;
descriptionUnderInputRoot: string;
titleBottomRoot: string;
titleOnAnswer: string;
titleEmpty: string;
titleOnError: string;
title: string;
titleExpandable: string;
titleExpandableSvg: string;
titleExpanded: string;
titleCollapsed: string;
titleDisabled: string;
titleReadOnly: string;
titleBar: string;
requiredText: string;
number: string;
description: string;
descriptionUnderInput: string;
comment: string;
other: string;
required: string;
titleRequired: string;
indent: number;
footer: string;
commentArea: string;
formGroup: string;
hasError: string;
hasErrorTop: string;
hasErrorBottom: string;
collapsed: string;
expandable: string;
expandableAnimating: string;
expanded: string;
nested: string;
invisible: string;
composite: string;
disabled: string;
readOnly: string;
preview: string;
noPointerEventsMode: string;
errorsContainer: string;
errorsContainerTop: string;
errorsContainerBottom: string;
confirmDialog: string;
};
image: {
mainRoot: string;
root: string;
image: string;
adaptive: string;
noImage: string;
noImageSvgIconId: string;
withFrame: string;
};
html: {
mainRoot: string;
root: string;
withFrame: string;
nested: string;
};
error: {
root: string;
icon: string;
item: string;
locationTop: string;
locationBottom: string;
};
checkbox: {
root: string;
rootMobile: string;
rootRow: string;
rootMultiColumn: string;
item: string;
itemEnter: string;
itemLeave: string;
itemOnError: string;
itemSelectAll: string;
itemNone: string;
itemDisabled: string;
itemReadOnly: string;
itemPreview: string;
itemPreviewSvgIconId: string;
itemChecked: string;
itemHover: string;
itemInline: string;
label: string;
labelChecked: string;
itemControl: string;
itemDecorator: string;
itemSvgIconId: string;
controlLabel: string;
materialDecorator: string;
other: string;
column: string;
};
radiogroup: {
root: string;
rootMobile: string;
rootRow: string;
rootMultiColumn: string;
item: string;
itemOnError: string;
itemInline: string;
label: string;
labelChecked: string;
itemEnter: string;
itemLeave: string;
itemDisabled: string;
itemReadOnly: string;
itemPreview: string;
itemPreviewSvgIconId: string;
itemChecked: string;
itemHover: string;
itemControl: string;
itemDecorator: string;
controlLabel: string;
materialDecorator: string;
other: string;
clearButton: string;
column: string;
};
boolean: {
mainRoot: string;
root: string;
rootRadio: string;
item: string;
itemOnError: string;
control: string;
itemChecked: string;
itemExchanged: string;
itemIndeterminate: string;
itemDisabled: string;
itemReadOnly: string;
itemPreview: string;
itemHover: string;
label: string;
labelTrue: string;
labelFalse: string;
switch: string;
disabledLabel: string;
labelReadOnly: string;
labelPreview: string;
sliderText: string;
slider: string;
sliderGhost: string;
radioItem: string;
radioItemChecked: string;
radioItemDisabled: string;
radioItemReadOnly: string;
radioItemPreview: string;
itemPreviewSvgIconId: string;
radioLabel: string;
radioControlLabel: string;
radioFieldset: string;
itemRadioDecorator: string;
materialRadioDecorator: string;
itemRadioControl: string;
rootCheckbox: string;
checkboxItem: string;
checkboxLabel: string;
checkboxItemOnError: string;
checkboxItemIndeterminate: string;
checkboxItemChecked: string;
checkboxItemDecorator: string;
checkboxItemDisabled: string;
checkboxItemReadOnly: string;
checkboxItemPreview: string;
controlCheckbox: string;
checkboxMaterialDecorator: string;
checkboxControlLabel: string;
svgIconCheckedId: string;
};
text: {
root: string;
small: string;
controlDisabled: string;
controlReadOnly: string;
controlPreview: string;
constrolWithCharacterCounter: string;
characterCounterBig: string;
content: string;
remainingCharacterCounter: string;
onError: string;
};
multipletext: {
root: string;
rootMobile: string;
itemLabel: string;
itemLabelReadOnly: string;
itemLabelDisabled: string;
itemLabelPreview: string;
itemLabelOnError: string;
itemLabelAllowFocus: string;
itemLabelAnswered: string;
itemWithCharacterCounter: string;
item: string;
itemTitle: string;
content: string;
row: string;
cell: string;
cellError: string;
cellErrorTop: string;
cellErrorBottom: string;
};
dropdown: {
root: string;
popup: string;
small: string;
selectWrapper: string;
other: string;
onError: string;
label: string;
itemEnter: string;
itemLeave: string;
item: string;
itemDisabled: string;
itemChecked: string;
itemHover: string;
itemControl: string;
itemDecorator: string;
cleanButton: string;
cleanButtonSvg: string;
cleanButtonIconId: string;
chevronButton: string;
chevronButtonSvg: string;
chevronButtonIconId: string;
control: string;
controlInputFieldComponent: string;
controlValue: string;
controlDisabled: string;
controlReadOnly: string;
controlPreview: string;
controlEmpty: string;
controlLabel: string;
filterStringInput: string;
materialDecorator: string;
hintPrefix: string;
hintSuffix: string;
};
imagepicker: {
mainRoot: string;
root: string;
rootResponsive: string;
rootStatic: string;
rootColumn: string;
item: string;
itemOnError: string;
itemInline: string;
itemChecked: string;
itemDisabled: string;
itemReadOnly: string;
itemPreview: string;
itemHover: string;
label: string;
itemDecorator: string;
imageContainer: string;
itemControl: string;
image: string;
itemText: string;
other: string;
itemNoImage: string;
itemNoImageSvgIcon: string;
itemNoImageSvgIconId: string;
column: string;
checkedItemDecorator: string;
checkedItemSvgIcon: string;
checkedItemSvgIconId: string;
};
matrix: {
mainRoot: string;
tableWrapper: string;
root: string;
columnsAutoWidth: string;
noHeader: string;
rootVerticalAlignTop: string;
rootVerticalAlignMiddle: string;
rootAlternateRows: string;
rowError: string;
cell: string;
row: string;
rowDisabled: string;
rowReadOnly: string;
headerCell: string;
rowTextCell: string;
label: string;
itemOnError: string;
itemValue: string;
itemChecked: string;
itemDisabled: string;
itemReadOnly: string;
itemPreview: string;
itemPreviewSvgIconId: string;
itemHover: string;
materialDecorator: string;
itemDecorator: string;
cellText: string;
cellTextSelected: string;
cellTextDisabled: string;
cellResponsiveTitle: string;
compact: string;
};
matrixdropdown: {
mainRoot: string;
rootScroll: string;
root: string;
columnsAutoWidth: string;
noHeader: string;
hasFooter: string;
rootVerticalAlignTop: string;
rootVerticalAlignMiddle: string;
tableWrapper: string;
rootAlternateRows: string;
cell: string;
cellResponsiveTitle: string;
errorsCell: string;
errorsCellTop: string;
errorsCellBottom: string;
itemCell: string;
row: string;
rowDelayedEnter: string;
rowEnter: string;
rowLeave: string;
expandedRow: string;
rowHasPanel: string;
rowHasEndActions: string;
headerCell: string;
rowTextCell: string;
footerCell: string;
footerTotalCell: string;
columnTitleCell: string;
cellRequiredText: string;
detailButton: string;
detailButtonExpanded: string;
detailIcon: string;
detailIconExpanded: string;
detailIconId: string;
detailIconExpandedId: string;
detailPanelCell: string;
detailRowCell: string;
actionsCellPrefix: string;
actionsCell: string;
actionsCellDrag: string;
emptyCell: string;
verticalCell: string;
cellQuestionWrapper: string;
compact: string;
};
matrixdynamic: {
mainRoot: string;
rootScroll: string;
empty: string;
root: string;
columnsAutoWidth: string;
noHeader: string;
hasFooter: string;
tableWrapper: string;
rootAlternateRows: string;
content: string;
cell: string;
cellResponsiveTitle: string;
row: string;
rowDelayedEnter: string;
rowEnter: string;
rowLeave: string;
rowHasPanel: string;
rowHasEndActions: string;
expandedRow: string;
itemCell: string;
headerCell: string;
rowTextCell: string;
footerCell: string;
columnTitleCell: string;
cellRequiredText: string;
button: string;
detailRow: string;
detailButton: string;
detailButtonExpanded: string;
detailIcon: string;
detailIconExpanded: string;
detailIconId: string;
detailIconExpandedId: string;
detailPanelCell: string;
detailRowCell: string;
actionsCellPrefix: string;
actionsCell: string;
actionsCellDrag: string;
buttonAdd: string;
buttonRemove: string;
iconAdd: string;
iconRemove: string;
dragElementDecorator: string;
iconDragElement: string;
footer: string;
footerTotalCell: string;
emptyRowsSection: string;
iconDrag: string;
ghostRow: string;
draggedRow: string;
emptyCell: string;
verticalCell: string;
cellQuestionWrapper: string;
errorsCell: string;
errorsCellTop: string;
errorsCellBottom: string;
compact: string;
};
rating: {
rootDropdown: string;
root: string;
rootWrappable: string;
rootLabelsTop: string;
rootLabelsBottom: string;
rootLabelsDiagonal: string;
item: string;
itemOnError: string;
itemHover: string;
selected: string;
itemStar: string;
itemStarOnError: string;
itemStarHover: string;
itemStarSelected: string;
itemStarDisabled: string;
itemStarReadOnly: string;
itemStarPreview: string;
itemStarHighlighted: string;
itemStarUnhighlighted: string;
itemStarSmall: string;
itemSmiley: string;
itemSmileyOnError: string;
itemSmileyHover: string;
itemSmileySelected: string;
itemSmileyDisabled: string;
itemSmileyReadOnly: string;
itemSmileyPreview: string;
itemSmileyHighlighted: string;
itemSmileyScaleColored: string;
itemSmileyRateColored: string;
itemSmileySmall: string;
minText: string;
itemText: string;
maxText: string;
itemDisabled: string;
itemReadOnly: string;
itemPreview: string;
itemFixedSize: string;
control: string;
itemSmall: string;
selectWrapper: string;
controlValue: string;
controlDisabled: string;
controlReadOnly: string;
controlPreview: string;
controlEmpty: string;
filterStringInput: string;
chevronButton: string;
chevronButtonSvg: string;
chevronButtonIconId: string;
popup: string;
onError: string;
};
comment: {
root: string;
small: string;
controlDisabled: string;
controlReadOnly: string;
controlPreview: string;
content: string;
remainingCharacterCounter: string;
onError: string;
};
expression: string;
file: {
root: string;
rootDragging: string;
rootAnswered: string;
rootDisabled: string;
rootReadOnly: string;
rootPreview: string;
other: string;
placeholderInput: string;
previewItem: string;
fileSign: string;
fileList: string;
fileSignBottom: string;
dragArea: string;
dragAreaActive: string;
fileDecorator: string;
onError: string;
fileDecoratorDrag: string;
fileInput: string;
noFileChosen: string;
chooseFile: string;
chooseFileAsText: string;
chooseFileAsTextDisabled: string;
chooseFileAsIcon: string;
chooseFileIconId: string;
disabled: string;
controlDisabled: string;
removeButton: string;
removeButtonBottom: string;
removeButtonIconId: string;
removeFile: string;
removeFileSvg: string;
removeFileSvgIconId: string;
wrapper: string;
defaultImage: string;
defaultImageIconId: string;
leftIconId: string;
rightIconId: string;
removeFileButton: string;
dragAreaPlaceholder: string;
imageWrapper: string;
imageWrapperDefaultImage: string;
single: string;
singleImage: string;
mobile: string;
videoContainer: string;
contextButton: string;
video: string;
actionsContainer: string;
closeCameraButton: string;
changeCameraButton: string;
takePictureButton: string;
loadingIndicator: string;
page: string;
};
signaturepad: {
mainRoot: string;
root: string;
small: string;
controls: string;
placeholder: string;
canvas: string;
backgroundImage: string;
clearButton: string;
clearButtonIconId: string;
loadingIndicator: string;
};
saveData: {
root: string;
rootWithButtons: string;
info: string;
error: string;
success: string;
button: string;
shown: string;
};
window: {
root: string;
rootCollapsedMod: string;
rootFullScreenMode: string;
rootContent: string;
body: string;
header: {
root: string;
titleCollapsed: string;
buttonsContainer: string;
button: string;
buttonExpanded: string;
buttonCollapsed: string;
collapseButton: string;
closeButton: string;
fullScreenButton: string;
};
};
ranking: {
root: string;
rootMobileMod: string;
rootDragMod: string;
rootDisabled: string;
rootReadOnly: string;
rootPreview: string;
rootDesignMode: string;
rootDragHandleAreaIcon: string;
rootSelectToRankMod: string;
rootSelectToRankEmptyValueMod: string;
rootSelectToRankAlignVertical: string;
rootSelectToRankAlignHorizontal: string;
rootSelectToRankSwapAreas: string;
item: string;
itemContent: string;
itemIndex: string;
itemIndexEmptyMode: string;
itemDisabled: string;
itemReadOnly: string;
itemPreview: string;
controlLabel: string;
itemGhostNode: string;
itemIconContainer: string;
itemIcon: string;
itemIconHoverMod: string;
itemIconFocusMod: string;
itemGhostMod: string;
itemDragMod: string;
itemOnError: string;
container: string;
containerEmptyMode: string;
containerFromMode: string;
containerToMode: string;
containerPlaceholder: string;
containersDivider: string;
};
buttongroup: {
root: string;
item: string;
itemIcon: string;
itemDecorator: string;
itemCaption: string;
itemHover: string;
itemSelected: string;
itemDisabled: string;
itemControl: string;
};
list: {
root: string;
item: string;
itemBody: string;
itemSelected: string;
itemFocused: string;
itemHovered: string;
};
actionBar: {
root: string;
item: string;
defaultSizeMode: string;
smallSizeMode: string;
itemPressed: string;
itemAsIcon: string;
itemIcon: string;
itemTitle: string;
};
variables: {
mobileWidth: string;
themeMark: string;
};
tagbox: {
root: string;
popup: string;
small: string;
selectWrapper: string;
other: string;
onError: string;
label: string;
itemSvgIconId: string;
item: string;
itemDisabled: string;
itemChecked: string;
itemHover: string;
itemControl: string;
itemDecorator: string;
itemEnter: string;
itemLeave: string;
cleanButton: string;
cleanButtonSvg: string;
cleanButtonIconId: string;
cleanItemButton: string;
cleanItemButtonSvg: string;
cleanItemButtonIconId: string;
chevronButton: string;
chevronButtonSvg: string;
chevronButtonIconId: string;
control: string;
controlValue: string;
controlValueItems: string;
placeholderInput: string;
controlEditable: string;
controlDisabled: string;
controlReadOnly: string;
controlPreview: string;
controlEmpty: string;
controlLabel: string;
filterStringInput: string;
materialDecorator: string;
hint: string;
hintPrefix: string;
hintSuffix: string;
hintSuffixWrapper: string;
};
};
export const defaultV2ThemeName = "defaultV2";
}
declare module "packages/survey-core/src/trigger" {
import { HashTable } from "packages/survey-core/src/helpers";
import { Base } from "packages/survey-core/src/base";
import { ISurvey } from "packages/survey-core/src/base-interfaces";
/**
* A base class for all triggers.
* A trigger calls a method when the expression change the result: from false to true or from true to false.
* Please note, it runs only one changing the expression result.
*/
export class Trigger extends Base {
static idCounter: number;
static operatorsValue: HashTable;
static get operators(): HashTable;
private conditionRunner;
private idValue;
constructor();
get id(): number;
getType(): string;
toString(): string;
isGhost: boolean;
protected get isInternal(): boolean;
get operator(): string;
set operator(value: string);
get value(): any;
set value(val: any);
get name(): string;
set name(val: string);
get expression(): string;
set expression(val: string);
protected canBeExecuted(isOnNextPage: boolean): boolean;
protected canBeExecutedOnComplete(): boolean;
protected isExecutingOnNextPage: boolean;
protected isExecutingOnNavigation: boolean;
checkExpression(options: {
isOnNextPage: boolean;
isOnComplete: boolean;
isOnNavigation: boolean;
keys: any;
values: HashTable;
properties?: HashTable;
}): void;
protected canBeExecuteOnKeysChange(keys: any[]): boolean;
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 canBeExecuteOnKeysChange(keys: any[]): 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 canBeExecuteOnKeysChange(keys: any[]): boolean;
protected onSuccess(values: HashTable, properties: HashTable): void;
protected canSuccessOnEmptyExpression(): boolean;
protected getUsedVariables(): string[];
}
}
declare module "packages/survey-core/src/calculatedValue" {
import { HashTable } from "packages/survey-core/src/helpers";
import { Base } from "packages/survey-core/src/base";
import { ISurvey, ISurveyData } from "packages/survey-core/src/base-interfaces";
/**
* The calculated value is a way to define the variable in Survey Creator.
* It has two main properties: name and expression. Based on expression the value read-only property is automatically calculated.
* The name property should be unique though all calculated values.
* It uses survey.getVariable/seruvey.setVariable functions to get/set its value. The class do not store its value internally.
* You may set includeIntoResult property to true to store this calculated value into survey result.
*/
export class CalculatedValue extends Base {
private data;
private expressionIsRunning;
private expressionRunner;
constructor(name?: string, expression?: string);
setOwner(data: ISurveyData): void;
getType(): string;
getSurvey(live?: boolean): ISurvey;
get owner(): ISurveyData;
/**
* The calculated value name. It should be non empty and unique.
*/
get name(): string;
set name(val: string);
/**
* Set this property to true to include the non-empty calculated value into survey result, survey.data property.
*/
get includeIntoResult(): boolean;
set includeIntoResult(val: boolean);
/**
* The Expression that used to calculate the value. You may use standard operators like +, -, * and /, squares (). Here is the example of accessing the question value {questionname}.
* Example: "({quantity} * {price}) * (100 - {discount}) / 100"
*/
get expression(): string;
set expression(val: string);
locCalculation(): void;
unlocCalculation(): void;
private isCalculated;
resetCalculation(): void;
doCalculation(calculatedValues: Array, values: HashTable, properties: HashTable): void;
runExpression(values: HashTable, properties: HashTable): void;
get value(): any;
protected setValue(val: any): void;
private get canRunExpression();
private rerunExpression;
private runExpressionCore;
private runDependentExpressions;
private ensureExpression;
}
}
declare module "packages/survey-core/src/panel-layout-column" {
import { Base } from "packages/survey-core/src/base";
export class PanelLayoutColumnModel extends Base {
width: number;
effectiveWidth: number;
questionTitleWidth: string;
constructor(width?: number, questionTitleWidth?: string);
getType(): string;
isEmpty(): boolean;
}
}
declare module "packages/survey-core/src/textPreProcessor" {
import { Question } from "packages/survey-core/src/question";
import { PanelModel } from "packages/survey-core/src/panel";
import { ISurvey, ITextProcessor, ITextProcessorProp, ITextProcessorResult } from "packages/survey-core/src/base-interfaces";
export class TextPreProcessorItem {
start: number;
end: number;
}
export class TextPreProcessorValue {
name: string;
returnDisplayValue: boolean;
constructor(name: string, returnDisplayValue: boolean);
value: any;
isExists: boolean;
canProcess: boolean;
}
export class TextPreProcessor {
private _unObservableValues;
private get hasAllValuesOnLastRunValue();
private set hasAllValuesOnLastRunValue(value);
onProcess: (textValue: TextPreProcessorValue) => void;
process(text: string, returnDisplayValue?: boolean, doEncoding?: boolean, replaceUndefinedValues?: boolean): string;
processValue(name: string, returnDisplayValue: boolean): TextPreProcessorValue;
get hasAllValuesOnLastRun(): boolean;
processText(text: string, returnDisplayValue: boolean): string;
processTextEx(params: ITextProcessorProp): ITextProcessorResult;
private getItems;
private isValidItemName;
private getName;
}
export class QuestionTextProcessor implements ITextProcessor {
protected variableName: string;
private textPreProcessor;
constructor(variableName: string);
processValue(name: string, returnDisplayValue: boolean): TextPreProcessorValue;
protected get survey(): ISurvey;
protected get panel(): PanelModel;
protected getValues(): any;
protected getQuestionByName(name: string): Question;
protected getParentTextProcessor(): ITextProcessor;
protected onCustomProcessText(textValue: TextPreProcessorValue): boolean;
protected getQuestionDisplayText(question: Question): string;
private getProcessedTextValue;
processText(text: string, returnDisplayValue: boolean): string;
processTextEx(params: ITextProcessorProp): ITextProcessorResult;
private addTextPreProcessor;
}
}
declare module "packages/survey-core/src/error" {
import { SurveyError } from "packages/survey-core/src/survey-error";
import { ISurveyErrorOwner } from "packages/survey-core/src/base-interfaces";
export class AnswerRequiredError extends SurveyError {
text: string;
constructor(text?: string, errorOwner?: ISurveyErrorOwner);
getErrorType(): string;
protected getDefaultText(): string;
}
export class OneAnswerRequiredError extends SurveyError {
text: string;
constructor(text?: string, errorOwner?: ISurveyErrorOwner);
getErrorType(): string;
protected getDefaultText(): string;
}
export class RequreNumericError extends SurveyError {
text: string;
constructor(text?: string, errorOwner?: ISurveyErrorOwner);
getErrorType(): string;
protected getDefaultText(): string;
}
export class ExceedSizeError extends SurveyError {
private maxSize;
constructor(maxSize: number, errorOwner?: ISurveyErrorOwner);
getErrorType(): string;
getDefaultText(): string;
private getTextSize;
}
export class WebRequestError extends SurveyError {
status: string;
response: string;
constructor(status: string, response: string, errorOwner?: ISurveyErrorOwner);
getErrorType(): string;
protected getDefaultText(): string;
}
export class WebRequestEmptyError extends SurveyError {
text: string;
constructor(text: string, errorOwner?: ISurveyErrorOwner);
getErrorType(): string;
protected getDefaultText(): string;
}
export class OtherEmptyError extends SurveyError {
text: string;
constructor(text: string, errorOwner?: ISurveyErrorOwner);
getErrorType(): string;
protected getDefaultText(): string;
}
export class UploadingFileError extends SurveyError {
text: string;
constructor(text: string, errorOwner?: ISurveyErrorOwner);
getErrorType(): string;
protected getDefaultText(): string;
}
export class RequiredInAllRowsError extends SurveyError {
text: string;
constructor(text: string, errorOwner?: ISurveyErrorOwner);
getErrorType(): string;
protected getDefaultText(): string;
}
export class EachRowUniqueError extends SurveyError {
text: string;
constructor(text: string, errorOwner?: ISurveyErrorOwner);
getErrorType(): string;
protected getDefaultText(): string;
}
export class MinRowCountError extends SurveyError {
minRowCount: number;
constructor(minRowCount: number, errorOwner?: ISurveyErrorOwner);
getErrorType(): string;
protected getDefaultText(): string;
}
export class KeyDuplicationError extends SurveyError {
text: string;
constructor(text: string, errorOwner?: ISurveyErrorOwner);
getErrorType(): string;
protected getDefaultText(): string;
}
export class CustomError extends SurveyError {
text: string;
constructor(text: string, errorOwner?: ISurveyErrorOwner);
getErrorType(): string;
}
}
declare module "packages/survey-core/src/question_custom" {
import { Question, IConditionObject } from "packages/survey-core/src/question";
import { JsonObjectProperty } from "packages/survey-core/src/jsonobject";
import { Base } from "packages/survey-core/src/base";
import { ISurveyImpl, ISurveyData, ITextProcessor, IPanel, IElement, IQuestion, IProgressInfo } from "packages/survey-core/src/base-interfaces";
import { SurveyElement } from "packages/survey-core/src/survey-element";
import { PanelModel } from "packages/survey-core/src/panel";
import { PanelLayoutColumnModel } from "packages/survey-core/src/panel-layout-column";
import { HashTable } from "packages/survey-core/src/helpers";
import { ItemValue } from "packages/survey-core/src/itemvalue";
import { SurveyError } from "packages/survey-core/src/survey-error";
/**
* An interface used to create custom question types.
*
* Refer to the following articles for more information:
*
* - [Create Specialized Question Types](https://surveyjs.io/form-library/documentation/customize-question-types/create-specialized-question-types)
* - [Create Composite Question Types](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types)
*/
export interface ICustomQuestionTypeConfiguration {
/**
* A name used to identify a custom question type.
*
* @see title
*/
name: string;
/**
* A title used for this custom question type in the UI. When `title` is not specified, the `name` property value is used.
*
* @see name
*/
title?: string;
/**
* The name of an icon to use for the custom question type.
*
* [UI Icons](https://surveyjs.io/form-library/documentation/icons (linkStyle))
*/
iconName?: string;
internal?: boolean;
/**
* A function that is called when the custom question type is initialized. Use it to add, remove, or modify the type's properties (see [Override Base Question Properties](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types#override-base-question-properties)).
*/
onInit?(): void;
/**
* Specifies whether the custom question type is available in the Toolbox and the Add Question menu in Survey Creator.
*
* Default value: `true`
*
* Set this property to `false` if your custom question type is used only to customize Property Grid content and is not meant for a survey.
*/
showInToolbox?: boolean;
/**
* A default title for questions created with this question type. Survey authors can change the default title in the JSON object or in Survey Creator's Property Grid.
*
* You can specify the question title with a string value or with an object that defines different titles for different locales:
*
* ```js
* import { ComponentCollection } from "survey-core";
*
* ComponentCollection.Instance.add({
* // ...
* defaultQuestionTitle: "Default title"
* });
* // ===== OR =====
* ComponentCollection.Instance.add({
* // ...
* defaultQuestionTitle: {
* en: "Default title",
* de: "Standardtitel",
* fr: "Titre par défaut"
* }
* });
* ```
*/
defaultQuestionTitle?: any;
/**
* An array of property names to inherit from a base question or a Boolean value that specifies whether or not to inherit all properties.
*
* Default value: `false`
*
* When you create a [custom specialized question type](https://surveyjs.io/form-library/documentation/customize-question-types/create-specialized-question-types), you base it on another question type configured within the [`questionJSON`](#questionJSON) object. If the custom question type should inherit all properties from the base type, set the `inheritBaseProps` property to `true`. If you want to inherit only certain properties, set the `inheritBaseProps` property to an array of their names.
*
* [Create Specialized Question Types](https://surveyjs.io/form-library/documentation/customize-question-types/create-specialized-question-types (linkStyle))
*/
inheritBaseProps?: false | true | Array;
/**
* A function that is called when the custom question is created. Use it to access questions nested within a [composite question type](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types).
*
* Parameters:
*
* - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* The custom question.
*/
onCreated?(question: Question): void;
/**
* A function that is called when JSON schemas are loaded.
*
* Parameters:
*
* - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A custom question.
*/
onLoaded?(question: Question): void;
/**
* A function that is called after the entire question is rendered.
*
* Parameters:
*
* - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A custom question.
* - `htmlElement`: `any`\
* An HTML element that represents the custom question.
*/
onAfterRender?(question: Question, htmlElement: any): void;
/**
* A function that is called each time a question nested within a [composite question](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types) is rendered.
*
* Parameters:
*
* - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A composite question.
* - `element`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A nested question.
* - `htmlElement`: `any`\
* An HTML element that represents a nested question.
*/
onAfterRenderContentElement?(question: Question, element: Question, htmlElement: any): void;
/**
* A function that is called each time a question nested within a [composite question](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types) requires an update of its CSS classes.
*
* Parameters:
*
* - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A composite question.
* - `element`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A nested question.
* - `cssClasses`: `any`\
* An object with CSS classes applied to a nested question, for example, `{ root: "class1", button: "class2" }`. You can modify this object to apply custom CSS classes.
*/
onUpdateQuestionCssClasses?(question: Question, element: Question, cssClasses: any): void;
/**
* A function that is called when a custom question type property is changed. Use it to handle property changes.
*
* Parameters:
*
* - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A custom question.
* - `propertyName`: `string`\
* The name of the changed property.
* - `newValue`: `any`\
* A new value for the property.
*/
onPropertyChanged?(question: Question, propertyName: string, newValue: any): void;
/**
* A function that is called after the question value is changed in the UI.
*
* Parameters:
*
* - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A custom question.
* - `name`: `string`\
* The question's [name](https://surveyjs.io/Documentation/Library?id=Question#name).
* - `newValue`: `any`\
* A new value for the question.
*
* If you want to perform some actions when the value is changed in code as well as in the UI, implement the [`onValueSet`](https://surveyjs.io/form-library/documentation/api-reference/icustomquestiontypeconfiguration#onValueSet) function.
*/
onValueChanged?(question: Question, name: string, newValue: any): void;
/**
* A function that is called before a question value is changed in the UI.
*
* This function should return the value you want to save: `newValue`, a custom value, or `undefined` if you want to clear the question value.
*
* Parameters:
*
* - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A custom question.
* - `name`: `string`\
* The question's [name](https://surveyjs.io/Documentation/Library?id=Question#name).
* - `newValue`: `any`\
* A new value for the question.
*/
onValueChanging?(question: Question, name: string, newValue: any): any;
/**
* A function that is called when an [ItemValue](https://surveyjs.io/Documentation/Library?id=itemvalue) property is changed.
*
* Parameters:
*
* - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A custom question.
* - `options.obj`: [ItemValue](https://surveyjs.io/Documentation/Library?id=itemvalue)\
* An `ItemValue` object.
* - `options.propertyName`: `string`\
* The name of the property to which an array of `ItemValue` objects is assigned (for example, `"choices"` or `"rows"`).
* - `options.name`: `string`\
* The name of the changed property: `"text"` or `"value"`.
* - `options.newValue`: `any`\
* A new value for the property.
*/
onItemValuePropertyChanged?(question: Question, options: {
obj: ItemValue;
propertyName: string;
name: string;
newValue: any;
}): void;
/**
* A function that allows you to override the default `getDisplayValue()` implementation.
*/
getDisplayValue?: ((keyAsText: boolean, value: any) => any) | ((question: Question) => any);
/**
* JSON schemas of nested questions. Specify this property to create a [composite question type](https://surveyjs.io/form-library/documentation/customize-question-types/create-composite-question-types).
*/
elementsJSON?: any;
/**
* A function that allows you to create nested questions if you do not specify the `elementsJSON` property.
*
* @see elementsJSON
*/
createElements?: any;
/**
* A JSON schema for a built-in question type on which the custom question type is based.
*
* Refer to the [Create Specialized Question Types](https://surveyjs.io/form-library/documentation/customize-question-types/create-specialized-question-types) help topic for more information.
*/
questionJSON?: any;
/**
* A function that allows you to create a custom question if you do not specify the `questionJSON` property.
*
* @see questionJSON
*/
createQuestion?: any;
/**
* A function that allows you to display different error texts based on conditions.
* @param question A custom question. Use the `question.value` property to access the question's value.
* @returns An error text.
*/
getErrorText?: (question: Question) => string;
/**
* A function that is called after the question value is set.
*
* Parameters:
*
* - `question`: [Question](https://surveyjs.io/Documentation/Library?id=Question)\
* A custom question.
* - `newValue`: `any`\
* A new value for the question.
*
* Unlike the [`onValueChanged`](https://surveyjs.io/form-library/documentation/api-reference/icustomquestiontypeconfiguration#onValueChanged) function, which is called only when the question value is changed in the UI, `onValueSet` is called when the value is changed in code as well.
*
* [View Demo](https://surveyjs.io/survey-creator/examples/smart-search-input/ (linkStyle))
*/
onValueSet?: (question: Question, newValue: any) => void;
onSetQuestionValue?: (question: Question, newValue: any) => void;
valueToQuestion?: (val: any) => any;
valueFromQuestion?: (val: any) => any;
getValue?: (val: any) => any;
setValue?: (val: any) => any;
}
export class ComponentQuestionJSON {
name: string;
json: ICustomQuestionTypeConfiguration;
private dynamicProperties;
constructor(name: string, json: ICustomQuestionTypeConfiguration);
onInit(): void;
onCreated(question: Question): void;
onLoaded(question: Question): void;
onAfterRender(question: Question, htmlElement: any): void;
onAfterRenderContentElement(question: Question, element: Question, htmlElement: any): void;
onUpdateQuestionCssClasses(question: Question, element: Question, css: any): void;
onSetQuestionValue(question: Question, newValue: any): void;
onPropertyChanged(question: Question, propertyName: string, newValue: any): void;
onValueChanged(question: Question, name: string, newValue: any): void;
onValueChanging(question: Question, name: string, newValue: any): any;
onGetErrorText(question: Question): string;
onItemValuePropertyChanged(question: Question, item: ItemValue, propertyName: string, name: string, newValue: any): void;
getDisplayValue(keyAsText: boolean, value: any, question: Question): any;
get defaultQuestionTitle(): any;
setValueToQuestion(val: any): any;
getValueFromQuestion(val: any): any;
get isComposite(): boolean;
getDynamicProperties(): Array;
private calcDynamicProperties;
}
export class ComponentCollection {
static Instance: ComponentCollection;
private customQuestionValues;
onCreateComposite: (name: string, questionJSON: ComponentQuestionJSON) => QuestionCompositeModel;
onCreateCustom: (name: string, questionJSON: ComponentQuestionJSON) => QuestionCustomModel;
onAddingJson: (name: string, isComposite: boolean) => void;
add(json: ICustomQuestionTypeConfiguration): void;
remove(componentName: string): boolean;
get items(): Array;
getCustomQuestionByName(name: string): ComponentQuestionJSON;
private getCustomQuestionIndex;
private removeByIndex;
clear(includeInternal?: boolean): void;
createQuestion(name: string, questionJSON: ComponentQuestionJSON): Question;
protected createCompositeModel(name: string, questionJSON: ComponentQuestionJSON): QuestionCompositeModel;
protected createCustomModel(name: string, questionJSON: ComponentQuestionJSON): QuestionCustomModel;
}
export abstract class QuestionCustomModelBase extends Question implements ISurveyImpl, ISurveyData, IPanel {
customQuestion: ComponentQuestionJSON;
private locQuestionTitle;
constructor(name: string, customQuestion: ComponentQuestionJSON);
getType(): string;
locStrsChanged(): void;
localeChanged(): void;
protected getDefaultTitle(): string;
addUsedLocales(locales: Array): void;
needResponsiveWidth(): boolean;
protected createWrapper(): void;
protected onPropertyValueChanged(name: string, oldValue: any, newValue: any): void;
itemValuePropertyChanged(item: ItemValue, name: string, oldValue: any, newValue: any): void;
protected onFirstRenderingCore(): void;
onHidingContent(): void;
getProgressInfo(): IProgressInfo;
protected abstract getElement(): SurveyElement;
protected initElement(el: SurveyElement): void;
protected isSettingValOnLoading: boolean;
setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void;
onSurveyLoad(): void;
afterRenderQuestionElement(el: HTMLElement): void;
afterRenderCore(el: any): void;
protected onUpdateQuestionCssClasses(element: Question, css: any): void;
protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void;
protected setNewValue(newValue: any): void;
protected onCheckForErrors(errors: Array, isOnValueChanged: boolean, fireCallback: boolean): void;
getSurveyData(): ISurveyData;
getTextProcessor(): ITextProcessor;
getValue(name: string): any;
setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any;
protected getQuestionByName(name: string): IQuestion;
protected isValueChanging(name: string, newValue: any): boolean;
protected convertDataName(name: string): string;
protected convertDataValue(name: string, newValue: any): any;
getVariable(name: string): any;
setVariable(name: string, newValue: any): void;
getComment(name: string): string;
setComment(name: string, newValue: string, locNotification: any): any;
getAllValues(): any;
getFilteredValues(): any;
getFilteredProperties(): any;
findQuestionByName(name: string): IQuestion;
getEditingSurveyElement(): Base;
addElement(element: IElement, index: number): void;
removeElement(element: IElement): boolean;
getQuestionTitleLocation(): string;
getQuestionTitleWidth(): string;
getColumsForElement(el: IElement): Array;
updateColumns(): void;
getQuestionStartIndex(): string;
getChildrenLayoutType(): string;
elementWidthChanged(el: IElement): void;
get elements(): Array;
indexOf(el: IElement): number;
ensureRowsVisibility(): void;
validateContainerOnly(): void;
onQuestionValueChanged(el: IElement): void;
getQuestionErrorLocation(): string;
protected getContentDisplayValueCore(keyAsText: boolean, value: any, question: Question): any;
}
export class QuestionCustomModel extends QuestionCustomModelBase {
private questionWrapper;
private hasJSONTitle;
getTemplate(): string;
getDynamicProperties(): Array;
getDynamicType(): string;
getOriginalObj(): Base;
protected createWrapper(): void;
private getDynamicProperty;
protected getElement(): SurveyElement;
supportGoNextPageAutomatic(): boolean;
onAnyValueChanged(name: string, questionName: string): void;
protected getQuestionByName(name: string): IQuestion;
protected getDefaultTitle(): string;
setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any;
updateCommentFromSurvey(newValue: any): any;
get requireUpdateCommentValue(): boolean;
protected onSetData(): void;
hasErrors(fireCallback?: boolean, rec?: any): boolean;
focus(onError?: boolean): void;
afterRenderCore(el: any): void;
get contentQuestion(): Question;
protected createQuestion(): Question;
private checkCreatedQuestion;
onSurveyLoad(): void;
runCondition(values: HashTable, properties: HashTable): void;
protected convertDataName(name: string): string;
protected convertDataValue(name: string, newValue: any): any;
protected getContentQuestionValue(): any;
protected setContentQuestionValue(val: any): void;
protected canSetValueToSurvey(): boolean;
protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void;
onSurveyValueChanged(newValue: any): void;
protected getValueCore(): any;
private isSettingValueChanged;
protected setValueChangedDirectly(val: boolean): void;
private createDynamicProperties;
protected initElement(el: SurveyElement): void;
updateElementCss(reNew?: boolean): void;
setIsMobile(val: boolean): void;
protected updateElementCssCore(cssClasses: any): void;
protected getDisplayValueCore(keyAsText: boolean, value: any): any;
}
export class QuestionCompositeModel extends QuestionCustomModelBase {
customQuestion: ComponentQuestionJSON;
static ItemVariableName: string;
private panelWrapper;
private textProcessing;
constructor(name: string, customQuestion: ComponentQuestionJSON);
protected createWrapper(): void;
getTemplate(): string;
protected getElement(): SurveyElement;
protected getCssRoot(cssClasses: any): string;
get contentPanel(): PanelModel;
hasErrors(fireCallback?: boolean, rec?: any): boolean;
updateElementCss(reNew?: boolean): void;
dispose(): void;
private editingObjValue;
private onEditingObjPropertyChanged;
private updateEditingObj;
private unConnectEditingObj;
getEditingSurveyElement(): Base;
getTextProcessor(): ITextProcessor;
findQuestionByName(name: string): IQuestion;
protected clearValueIfInvisibleCore(reason: string): void;
onAnyValueChanged(name: string, questionName: string): void;
get hasSingleInput(): boolean;
get isContainer(): boolean;
protected createPanel(): PanelModel;
protected onReadOnlyChanged(): void;
updateValueFromSurvey(newValue: any, clearData?: boolean): void;
onSurveyLoad(): void;
private setIsContentElement;
setVisibleIndex(val: number): number;
runCondition(values: HashTable, properties: HashTable): void;
onSurveyValueChanged(newValue: any): void;
getValue(name: string): any;
protected getQuestionByName(name: string): IQuestion;
private settingNewValue;
setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any;
setComment(name: string, newValue: string, locNotification: any): any;
getComment(name: string): string;
private getCommentName;
private runPanelTriggers;
getFilteredValues(): any;
private updateValueCoreWithPanelValue;
private getContentPanelValue;
private getValueForContentPanel;
private setNewValueIntoQuestion;
addConditionObjectsByContext(objects: Array, context: any): void;
protected collectNestedQuestionsCore(questions: Question[], visibleOnly: boolean, includeItSelf: boolean): void;
protected convertDataValue(name: string, newValue: any): any;
protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void;
private setValuesIntoQuestions;
protected getDisplayValueCore(keyAsText: boolean, value: any): any;
private setAfterRenderCallbacks;
get ariaRole(): string;
setIsMobile(val: boolean): void;
}
}
declare module "packages/survey-core/src/questionfactory" {
import { Question } from "packages/survey-core/src/question";
import { IElement } from "packages/survey-core/src/base-interfaces";
export class QuestionFactory {
static Instance: QuestionFactory;
static get DefaultChoices(): string[];
static get DefaultColums(): string[];
static get DefaultRows(): string[];
static get DefaultMutlipleTextItems(): string[];
registerQuestion(questionType: string, questionCreator: (name: string) => Question, showInToolbox?: boolean): void;
registerCustomQuestion(questionType: string): void;
unregisterElement(elementType: string, removeFromSerializer?: boolean): void;
clear(): void;
getAllTypes(): Array;
createQuestion(questionType: string, name: string): Question;
}
export class ElementFactory {
static Instance: ElementFactory;
private creatorHash;
registerElement(elementType: string, elementCreator: (name: string) => IElement, showInToolbox?: boolean): void;
registerCustomQuestion: (questionType: string, showInToolbox?: boolean) => void;
clear(): void;
unregisterElement(elementType: string, removeFromSerializer?: boolean): void;
getAllToolboxTypes(): Array;
getAllTypes(): Array;
createElement(elementType: string, name: string): IElement;
private getAllTypesCore;
}
}
declare module "packages/survey-core/src/drag-drop-helper-v1" {
import { IElement, ISurveyElement } from "packages/survey-core/src/base-interfaces";
export class DragDropInfo {
source: IElement;
target: IElement;
nestedPanelDepth: number;
constructor(source: IElement, target: IElement, nestedPanelDepth?: number);
destination: ISurveyElement;
isBottom: boolean;
isEdge: boolean;
}
}
declare module "packages/survey-core/src/drag-drop-panel-helper-v1" {
import { IElement, ISurveyElement } from "packages/survey-core/src/base-interfaces";
import { DragDropInfo } from "packages/survey-core/src/drag-drop-helper-v1";
import { PanelModelBase, QuestionRowModel } from "packages/survey-core/src/panel";
export class DragDropPanelHelperV1 {
private panel;
constructor(panel: PanelModelBase);
dragDropAddTarget(dragDropInfo: DragDropInfo): void;
dragDropFindRow(findElement: ISurveyElement): QuestionRowModel;
dragDropMoveElement(src: IElement, target: IElement, targetIndex: number): void;
updateRowsOnElementAdded(element: IElement, index: number, dragDropInfo?: DragDropInfo, thisElement?: PanelModelBase): void;
private dragDropAddTargetToRow;
private dragDropAddTargetToEmptyPanel;
private dragDropAddTargetToExistingRow;
private dragDropAddTargetToNewRow;
private dragDropAddTargetToEmptyPanelCore;
}
}
declare module "packages/survey-core/src/panel" {
import { HashTable } from "packages/survey-core/src/helpers";
import { Base } from "packages/survey-core/src/base";
import { ISurveyImpl, IPage, IPanel, IConditionRunner, IElement, ISurveyElement, IQuestion, ISurveyErrorOwner, ITitleOwner, IProgressInfo, ISurvey, IFindElement } from "packages/survey-core/src/base-interfaces";
import { DragTypeOverMeEnum, SurveyElement } from "packages/survey-core/src/survey-element";
import { Question } from "packages/survey-core/src/question";
import { LocalizableString } from "packages/survey-core/src/localizablestring";
import { findScrollableParent } from "packages/survey-core/src/utils/utils";
import { SurveyError } from "packages/survey-core/src/survey-error";
import { IAction } from "packages/survey-core/src/actions/action";
import { ActionContainer } from "packages/survey-core/src/actions/container";
import { DragDropInfo } from "packages/survey-core/src/drag-drop-helper-v1";
import { AnimationGroup } from "packages/survey-core/src/utils/animation";
import { PanelLayoutColumnModel } from "packages/survey-core/src/panel-layout-column";
export class QuestionRowModel extends Base {
panel: PanelModelBase;
private static rowCounter;
private static getRowId;
protected _scrollableParent: any;
protected _updateVisibility: any;
private get allowRendering();
private lazyRenderingTimeout;
startLazyRendering(rowContainerDiv: HTMLElement, findScrollableContainer?: typeof findScrollableParent): void;
ensureVisibility(): void;
stopLazyRendering(): void;
private idValue;
constructor(panel: PanelModelBase);
private isLazyRenderingValue;
setIsLazyRendering(val: boolean): void;
isLazyRendering(): boolean;
get id(): string;
protected equalsCore(obj: Base): boolean;
get elements(): Array;
protected getIsAnimationAllowed(): boolean;
private getVisibleElementsAnimationOptions;
visibleElementsAnimation: AnimationGroup;
set visibleElements(val: Array);
get visibleElements(): Array;
onVisibleChangedCallback: () => void;
get visible(): boolean;
set visible(val: boolean);
get isNeedRender(): boolean;
set isNeedRender(val: boolean);
updateVisible(): void;
addElement(q: IElement): void;
get index(): number;
private setWidth;
private getRenderedCalcWidth;
private getElementWidth;
private getRenderedWidthFromWidth;
dragTypeOverMe: DragTypeOverMeEnum;
dispose(): void;
getRowCss(): string;
private rootElement?;
setRootElement(element?: HTMLElement): void;
getRootElement(): HTMLElement;
}
/**
* A base class for the [PanelModel](https://surveyjs.io/form-library/documentation/panelmodel) and [PageModel](https://surveyjs.io/form-library/documentation/pagemodel) classes.
*/
export class PanelModelBase extends SurveyElement implements IPanel, IConditionRunner, ISurveyErrorOwner, ITitleOwner {
private static panelCounter;
private static getPanelId;
private elementsValue;
private isQuestionsReady;
private questionsValue;
private _columns;
private _columnsReady;
gridLayoutColumns: Array;
addElementCallback: (element: IElement) => void;
removeElementCallback: (element: IElement) => void;
onGetQuestionTitleLocation: () => string;
private dragDropPanelHelper;
onAddRow(row: QuestionRowModel): void;
private getRowsAnimationOptions;
private rowsAnimation;
get visibleRows(): Array;
set visibleRows(val: Array);
onRemoveRow(row: QuestionRowModel): void;
onRowVisibleChanged(): void;
constructor(name?: string);
getType(): string;
setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void;
endLoadingFromJson(): void;
showTitle: boolean;
get hasTextInTitle(): boolean;
private resetHasTextInTitle;
get hasTitle(): boolean;
delete(doDispose?: boolean): void;
private deletePanel;
protected removeFromParent(): void;
protected canShowTitle(survey: ISurvey): boolean;
showDescription: boolean;
get _showDescription(): boolean;
localeChanged(): void;
locStrsChanged(): void;
getMarkdownHtml(text: string, name: string): string;
get locNavigationTitle(): LocalizableString;
get renderedNavigationTitle(): string;
/**
* Returns a character or text string that indicates a required panel/page.
* @see SurveyModel.requiredText
* @see isRequired
*/
get requiredText(): string;
protected get titlePattern(): string;
get isRequireTextOnStart(): boolean;
get isRequireTextBeforeTitle(): boolean;
get isRequireTextAfterTitle(): boolean;
/**
* Specifies a custom error message for a required panel/page.
* @see isRequired
* @see requiredIf
*/
get requiredErrorText(): string;
set requiredErrorText(val: string);
get locRequiredErrorText(): LocalizableString;
/**
* Specifies the sort order of questions in the panel/page.
*
* Possible values:
*
* - `"initial"` - Preserves the original order of questions.
* - `"random"` - Displays questions in random order.
* - `"default"` (default) - Inherits the setting from the Survey's `questionsOrder` property.
* @see SurveyModel.questionsOrder
* @see areQuestionsRandomized
*/
get questionsOrder(): string;
set questionsOrder(val: string);
private canRandomize;
protected isRandomizing: boolean;
randomizeElements(isRandom: boolean): boolean;
/**
* Returns `true` if elements in this panel/page are arranged in random order.
* @see questionsOrder
*/
get areQuestionsRandomized(): boolean;
/**
* Returns a survey element (panel or page) that contains this panel and allows you to move the panel to a different survey element.
*
* For `PageModel` objects, the `parent` property is `null`, except in the following cases:
*
* - `SurveyModel`'s [`questionsOnPageMode`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#questionsOnPageMode) is set to `"singlePage"`.
* - The page is included in a [preview of given answers](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#preview-page).
*
* In those cases, the survey creates an internal `PageModel` object to show all questions on one page, and the `parent` property contains this object.
*/
get parent(): PanelModelBase;
set parent(val: PanelModelBase);
get depth(): number;
/**
* A Boolean expression. If it evaluates to `false`, this panel/page becomes hidden.
*
* A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.
*
* Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).
* @see visible
* @see isVisible
*/
get visibleIf(): string;
set visibleIf(val: string);
protected calcCssClasses(css: any): any;
/**
* An auto-generated unique element identifier.
*/
get id(): string;
set id(val: string);
get isPanel(): boolean;
getPanel(): IPanel;
getLayoutType(): string;
isLayoutTypeSupported(layoutType: string): boolean;
/**
* An array of all questions within this panel/page. Includes questions within nested panels.
* @see elements
*/
get questions(): Array;
getQuestions(includeNested: boolean): Array;
protected getValidName(name: string): string;
/**
* Returns a question with a specified `name`. This method does not find questions within nested panels.
* @param name A question name.
*/
getQuestionByName(name: string): Question;
/**
* Returns a survey element with a specified `name`. This method can find survey elements within nested elements.
* @param name An element name.
*/
getElementByName(name: string): IElement;
getQuestionByValueName(valueName: string): Question;
getQuestionsByValueName(valueName: string): Array;
/**
* Returns a JSON object with question values nested in the panel/page.
* @see getDisplayValue
*/
getValue(): any;
collectValues(data: any, level: number): boolean;
/**
* Returns a JSON object with display texts that correspond to question values nested in the panel/page.
* @param keysAsText Pass `true` if not only values in the object should be display texts, but also keys. Default value: `false`.
* @see getValue
*/
getDisplayValue(keysAsText: boolean): any;
/**
* Returns a JSON object with comments left to questions within this panel/page. Question names are used as keys.
*/
getComments(): any;
/**
* Removes values that cannot be assigned to nested questions, for example, choices unlisted in the `choices` array.
*
* Call this method after you assign new question values in code to ensure that they are acceptable.
*
* > This method does not remove values for invisible questions and values that fail validation. Call the `validate()` method to validate newly assigned values.
*
* @see validate
*/
clearIncorrectValues(): void;
/**
* Empties the `errors` array for this panel/page and all its child elements (panels and questions).
* @see errors
*/
clearErrors(): void;
private markQuestionListDirty;
/**
* An array of all survey elements (questions or panels) within this panel/page. Does not include questions within nested panels.
* @see questions
*/
get elements(): Array;
getElementsInDesign(includeHidden?: boolean): Array;
/**
* Checks whether a given element belongs to this panel/page or nested panels.
* @param element A survey element to check.
*/
containsElement(element: IElement): boolean;
/**
* Makes the panel/page require an answer at least in one nested question. If a respondent leaves the panel/page without any answers, the survey displays a validation error.
* @see requiredIf
* @see [Data Validation](https://surveyjs.io/form-library/documentation/data-validation)
*/
get isRequired(): boolean;
set isRequired(val: boolean);
/**
* A Boolean expression. If it evaluates to `true`, this panel/page becomes required (at least one question in the panel/page should have an answer).
*
* A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.
*
* Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).
* @see isRequired
*/
get requiredIf(): string;
set requiredIf(val: string);
searchText(text: string, founded: Array): void;
hasErrors(fireCallback?: boolean, focusOnFirstError?: boolean, rec?: any): boolean;
/**
* Validates questions within this panel or page and returns `false` if the validation fails.
* @param fireCallback *(Optional)* Pass `false` if you do not want to show validation errors in the UI.
* @param focusOnFirstError *(Optional)* Pass `true` if you want to focus the first question with a validation error.
* @see [Data Validation](https://surveyjs.io/form-library/documentation/data-validation)
*/
validate(fireCallback?: boolean, focusOnFirstError?: boolean, rec?: any): boolean;
validateContainerOnly(): void;
onQuestionValueChanged(el: IElement): void;
private hasErrorsInPanels;
getErrorCustomText(text: string, error: SurveyError): string;
private hasRequiredError;
protected hasErrorsCore(rec: any): void;
protected getContainsErrors(): boolean;
updateElementVisibility(): void;
getFirstQuestionToFocus(withError?: boolean, ignoreCollapseState?: boolean): Question;
getFirstVisibleQuestion(): Question;
getFirstVisibleElement(): IElement;
/**
* Focuses the first question in this panel/page.
* @see focusFirstErrorQuestion
*/
focusFirstQuestion(): void;
/**
* Focuses the first question with a validation error in this panel/page.
* @see validate
* @see focusFirstQuestion
*/
focusFirstErrorQuestion(): void;
addQuestionsToList(list: Array, visibleOnly?: boolean, includingDesignTime?: boolean): void;
addPanelsIntoList(list: Array, visibleOnly?: boolean, includingDesignTime?: boolean): void;
private addElementsToList;
private addElementsToListCore;
private calcMaxRowColSpan;
private updateColumnWidth;
private onColumnPropertyValueChangedCallback;
updateColumns(): void;
updateRootStyle(): void;
updateCustomWidgets(): void;
/**
* Sets a title location relative to the input field for questions that belong to this panel/page.
*
* Use this property to override the `questionTitleLocation` property specified for the survey. You can also set the `titleLocation` property for individual questions.
*
* Possible values:
*
* - `"default"` (default) - Inherits the setting from the `questionTitleLocation` property specified for the survey.
* - `"top"` - Displays the title above the input field.
* - `"bottom"` - Displays the title below the input field.
* - `"left"` - Displays the title to the left of the input field.
* - `"hidden"` - Hides the question title.
*
* > Certain question types (Matrix, Multiple Text) do not support the `"left"` value. For them, the `"top"` value is used.
* @see SurveyModel.questionTitleLocation
*/
get questionTitleLocation(): string;
set questionTitleLocation(value: string);
getQuestionTitleLocation(): string;
availableQuestionTitleWidth(): boolean;
hasElementWithTitleLocationLeft(): boolean;
/**
* Sets consistent width for question titles in CSS values. Applies only when [`questionTitleLocation`](#questionTitleLocation) evaluates to `"left"`.
*
* Default value: `undefined`
*/
questionTitleWidth: string;
getQuestionTitleWidth(): string;
get columns(): Array;
protected generateColumns(): void;
updateGridColumns(): void;
getColumsForElement(el: IElement): Array;
protected getStartIndex(): string;
getQuestionStartIndex(): string;
getChildrenLayoutType(): string;
getProgressInfo(): IProgressInfo;
get root(): PanelModelBase;
protected childVisibilityChanged(): void;
protected canRenderFirstRows(): boolean;
private isLazyRenderInRow;
createRowAndSetLazy(index: number): QuestionRowModel;
createRow(): QuestionRowModel;
onSurveyLoad(): void;
protected onFirstRenderingCore(): void;
updateRows(): void;
get rows(): Array;
ensureRowsVisibility(): void;
protected onRowsChanged(): void;
private locCountRowUpdates;
private blockRowsUpdates;
private releaseRowsUpdates;
private updateRowsBeforeElementRemoved;
private updateRowsOnElementAdded;
private canFireAddRemoveNotifications;
protected onAddElement(element: IElement, index: number): void;
protected onRemoveElement(element: IElement): void;
protected unregisterElementPropertiesChanged(element: IElement): void;
private onRemoveElementNotifySurvey;
private onElementVisibilityChanged;
private onElementStartWithNewLineChanged;
private updateRowsVisibility;
canBuildRows(): boolean;
private buildRows;
protected getElementsForRows(): Array;
getDragDropInfo(): any;
private updateRowsOnElementRemoved;
updateRowsRemoveElementFromRow(element: IElement, row: QuestionRowModel): void;
getAllRows(): Array;
private findRowAndIndexByElement;
private forceRenderRow;
forceRenderElement(el: IElement, elementsRendered?: () => void, gap?: number): void;
forceRenderRows(rows: Array, elementsRendered?: () => void): void;
findRowByElement(el: IElement): QuestionRowModel;
elementWidthChanged(el: IElement): void;
get processedTitle(): string;
protected getRenderedTitle(str: string): string;
/**
* Gets or sets panel/page visibility.
*
* If you want to display or hide a survey element based on a condition, specify the `visibleIf` property. Refer to the following help topic for information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).
* @see visibleIf
* @see isVisible
*/
get visible(): boolean;
set visible(value: boolean);
onHidingContent(): void;
protected onVisibleChanged(): void;
protected notifyStateChanged(prevState: string): void;
/**
* Returns `true` if the panel/page is visible or the survey is currently in design mode.
*
* If you want to display or hide a question based on a condition, specify the `visibleIf` property. Refer to the following help topic for information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).
* @see visibleIf
* @see visible
*/
get isVisible(): boolean;
getIsContentVisible(exceptionQuestion?: IQuestion): boolean;
getIsPageVisible(exceptionQuestion?: IQuestion): boolean;
private lastVisibleIndex;
setVisibleIndex(index: number): number;
private updateVisibleIndexes;
private resetVisibleIndexes;
protected beforeSetVisibleIndex(index: number): number;
protected getPanelStartIndex(index: number): number;
protected isContinueNumbering(): boolean;
get isReadOnly(): boolean;
protected onReadOnlyChanged(): void;
updateElementCss(reNew?: boolean): void;
/**
* A Boolean expression. If it evaluates to `false`, this panel/page becomes read-only.
*
* A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.
*
* Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).
* @see readOnly
* @see isReadOnly
*/
get enableIf(): string;
set enableIf(val: string);
/**
* Adds a survey element (question or panel) to this panel/page. Returns `true` if the element was added successfully; `false` otherwise.
* @param element A survey element to add.
* @param index A desired index of this element in the `elements` array.
* @see addNewQuestion
* @see addNewPanel
*/
addElement(element: IElement, index?: number): boolean;
insertElement(element: IElement, dest?: IElement, location?: "bottom" | "top" | "left" | "right"): void;
insertElementAfter(element: IElement, after: IElement): void;
insertElementBefore(element: IElement, before: IElement): void;
protected canAddElement(element: IElement): boolean;
addQuestion(question: Question, index?: number): boolean;
addPanel(panel: PanelModel, index?: number): boolean;
/**
* Creates a new question of a given type and adds it to the `elements` array at a specified index.
*
* This method returns `null` if the question cannot be created or added to this panel/page; otherwise, the method returns the created question.
*
* @param questionType A [question type](https://surveyjs.io/form-library/documentation/question#getType).
* @param name A question name.
* @param index A desired index of the new question in the `elements` array.
* @see elements
* @see addElement
*/
addNewQuestion(questionType: string, name?: string, index?: number): Question;
/**
* Creates a new panel and adds it to the end of the `elements` array.
*
* This method returns `null` if the panel cannot be created or added to this panel/page; otherwise, the method returns the created panel.
* @param name A panel name.
* @see elementsup
* @see addElement
*/
addNewPanel(name?: string): PanelModel;
indexOf(element: IElement): number;
protected createNewPanel(name: string): PanelModel;
/**
* Deletes a survey element (question or panel) from this panel/page. Returns `true` if the element was deleted successfully; `false` otherwise.
* @param element A survey element to delete.
* @see elements
*/
removeElement(element: IElement): boolean;
removeQuestion(question: Question): void;
private isRunningConditions;
runCondition(values: HashTable, properties: HashTable): void;
onAnyValueChanged(name: string, questionName: string): void;
checkBindings(valueName: string, value: any): void;
dragDropAddTarget(dragDropInfo: DragDropInfo): void;
dragDropFindRow(findElement: ISurveyElement): QuestionRowModel;
dragDropMoveElement(src: IElement, target: IElement, targetIndex: number): void;
needResponsiveWidth(): boolean;
get hasDescriptionUnderTitle(): boolean;
get cssHeader(): string;
get cssDescription(): string;
/**
* Specifies the error message position for questions that belong to this page/panel.
*
* Use this property to override the [`questionErrorLocation`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#questionErrorLocation) property specified for the survey. You can also set the [`errorLocation`](https://surveyjs.io/form-library/documentation/question#errorLocation) property for individual questions.
*
* Possible values:
*
* - `"default"` (default) - Inherits the setting from the `questionErrorLocation` property specified for the survey.
* - `"top"` - Displays error messages above questions.
* - `"bottom"` - Displays error messages below questions.
*/
get questionErrorLocation(): string;
set questionErrorLocation(val: string);
getQuestionErrorLocation(): string;
getTitleOwner(): ITitleOwner;
get no(): string;
get cssTitleNumber(): string;
get cssRequiredText(): string;
get cssError(): string;
protected getCssError(cssClasses: any): string;
getSerializableColumnsValue(): Array;
afterRender(el: HTMLElement): void;
dispose(): void;
protected disposeElements(): void;
}
/**
* A class that describes the Panel container element.
*
* A panel can contain questions and other panels. Refer to the following help topic for an illustration: [Survey Structure](https://surveyjs.io/form-library/documentation/design-survey-create-a-simple-survey#survey-structure).
*
* [View Demo](https://surveyjs.io/form-library/examples/questiontype-panel/ (linkStyle))
*/
export class PanelModel extends PanelModelBase implements IElement {
constructor(name?: string);
getType(): string;
get contentId(): string;
getSurvey(live?: boolean): ISurvey;
get isPanel(): boolean;
/**
* Returns a page to which the panel belongs and allows you to move this panel to a different page.
* @see PanelModelBase.parent
*/
get page(): IPage;
set page(val: IPage);
protected removeFromParent(): void;
moveTo(container: IPanel, insertBefore?: any): boolean;
/**
* Returns the visible index of the panel in the survey. Commonly it is -1 and it doesn't show.
* You have to set showNumber to true to show index/numbering for the Panel
* @see showNumber
*/
get visibleIndex(): number;
/**
* Specifies whether to show the panel number in the title.
*
* Default value: `false`
* @see SurveyModel.showQuestionNumbers
* @see SurveyModel.questionTitlePattern
*/
get showNumber(): boolean;
set showNumber(val: boolean);
/**
* Gets or sets a value that specifies how the elements numbers inside panel are displayed.
*
* The following options are available:
*
* - `default` - display questions numbers as defined in parent panel or survey
* - `onpanel` - display questions numbers, start numbering from beginning of this page
* - `off` - turn off the numbering for questions titles
* @see showNumber
*/
get showQuestionNumbers(): string;
set showQuestionNumbers(value: string);
/**
* Specifies a number or letter used to start numbering of elements inside the panel.
*
* You can include desired prefixes and postfixes alongside the number or letter:
*
* ```js
* "questionStartIndex": "a.", // a., b., c., ...
* "questionStartIndex": "#3", // #3, #4, #5, ...
* "questionStartIndex": "(B)." // (B)., (C)., (D)., ...
* ```
* Default value: `"1."` (inherited from `SurveyModel`'s `questionStartIndex` property)
* @see SurveyModel.questionStartIndex
* @see showQuestionNumbers
*/
get questionStartIndex(): string;
set questionStartIndex(val: string);
getQuestionStartIndex(): string;
/**
* A question number or letter (depends on the `questionStartIndex` property).
*
* When the question number, title, or the entire question is invisible, this property returns an empty string.
* @see questionStartIndex
* @see showNumber
* @see visibleIf
*/
get no(): string;
private calcNo;
protected notifyStateChanged(prevState: string): void;
protected createLocTitleProperty(): LocalizableString;
protected beforeSetVisibleIndex(index: number): number;
protected getPanelStartIndex(index: number): number;
private hasParentInQuestionIndex;
protected isContinueNumbering(): boolean;
private notifySurveyOnVisibilityChanged;
protected getRenderedTitle(str: string): string;
/**
* Increases or decreases an indent of panel content from the left edge. Accepts positive integer values and 0.
*/
get innerIndent(): number;
set innerIndent(val: number);
/**
* Disable this property if you want to render the current panel on the same line or row with the previous question or panel.
*/
get startWithNewLine(): boolean;
set startWithNewLine(value: boolean);
get allowAdaptiveActions(): boolean;
set allowAdaptiveActions(val: boolean);
get innerPaddingLeft(): string;
set innerPaddingLeft(val: string);
protected calcPaddingLeft(): string;
protected calcPaddingRight(): string;
protected resetIndents(): void;
private getIndentSize;
clearOnDeletingContainer(): void;
get footerActions(): Array;
private footerToolbarValue;
onGetFooterActionsCallback: () => Array;
onGetFooterToolbarCssCallback: () => string;
getFooterToolbar(): ActionContainer;
get hasEditButton(): boolean;
cancelPreview(): void;
get cssTitle(): string;
protected getCssPanelTitle(): string;
getCssTitleExpandableSvg(): string;
get showErrorsAbovePanel(): boolean;
protected getCssError(cssClasses: any): string;
protected onVisibleChanged(): void;
needResponsiveWidth(): boolean;
focusIn(): void;
protected getHasFrameV2(): boolean;
protected getIsNested(): boolean;
get showPanelAsPage(): boolean;
private forcusFirstQuestionOnExpand;
expand(focusFirstQuestion?: boolean): void;
protected onElementExpanded(elementIsRendered: boolean): void;
protected getCssRoot(cssClasses: {
[index: string]: string;
}): string;
getContainerCss(): string;
afterRenderCore(element: HTMLElement): void;
}
}
declare module "packages/survey-core/src/utils/camera" {
export class Camera {
static mediaDevicesCallback: ((callback: (devices: Array) => void) => void) | undefined;
static clear(): void;
static setCameraList(list: Array): void;
private static cameraList;
private static cameraIndex;
private static cameraFacingMode;
private static canSwitchFacingMode;
hasCamera(callback: (res: boolean) => void): void;
getMediaConstraints(videoSize?: {
width?: number;
height?: number;
}): MediaStreamConstraints;
startVideo(videoElement: HTMLVideoElement, callback: (stream: MediaStream) => void, imageWidth?: number, imageHeight?: number): void;
getImageSize(videoEl: HTMLVideoElement): {
width: number;
height: number;
};
snap(videoElement: HTMLVideoElement, callback: BlobCallback): boolean;
private canFlipValue;
private updateCanFlipValue;
private onCanFlipChangedCallback?;
canFlip(onCanFlipChangedCallback?: (res: boolean) => void): boolean;
flip(): void;
private hasCameraCallback;
private setVideoInputs;
}
}
declare module "packages/survey-core/src/question_file" {
import { IPlainDataOptions } from "packages/survey-core/src/base-interfaces";
import { IQuestionPlainData, Question } from "packages/survey-core/src/question";
import { EventBase, Base } from "packages/survey-core/src/base";
import { SurveyError } from "packages/survey-core/src/survey-error";
import { ActionContainer } from "packages/survey-core/src/actions/container";
import { Action } from "packages/survey-core/src/actions/action";
import { Camera } from "packages/survey-core/src/utils/camera";
import { LocalizableString } from "packages/survey-core/src/localizablestring";
export function dataUrl2File(dataUrl: string, fileName: string, type: string): File;
/**
* A base class for question types that support file upload: `QuestionFileModel` and `QuestionSignaturePadModel`.
*/
export class QuestionFileModelBase extends Question {
isUploading: boolean;
currentState: string;
/**
* An event that is raised after the upload state has changed.
*
* Parameters:
*
* - `sender`: `SurveyModel`\
* A survey instance that raised the event.
* - `options.state`: `string`\
* The current upload state: `"empty"`, `"loading"`, `"loaded"`, or `"error"`.
*/
onUploadStateChanged: EventBase;
onStateChanged: EventBase;
protected stateChanged(state: string): void;
get showLoadingIndicator(): boolean;
/**
* Specifies whether to store file or signature content as text in `SurveyModel`'s [`data`](https://surveyjs.io/form-library/documentation/surveymodel#data) property.
*
* If you disable this property, implement `SurveyModel`'s [`onUploadFiles`](https://surveyjs.io/form-library/documentation/surveymodel#onUploadFiles) event handler to specify how to store file content.
*/
get storeDataAsText(): boolean;
set storeDataAsText(val: boolean);
/**
* Enable this property if you want to wait until files are uploaded to complete the survey.
*
* Default value: `false`
*/
get waitForUpload(): boolean;
set waitForUpload(val: boolean);
clearValue(keepComment?: boolean): void;
clearOnDeletingContainer(): void;
protected onCheckForErrors(errors: Array, isOnValueChanged: boolean, fireCallback: boolean): void;
protected uploadFiles(files: File[]): void;
protected loadPreview(newValue: any): void;
protected onChangeQuestionValue(newValue: any): void;
protected getIsQuestionReady(): boolean;
private isFileLoadingValue;
protected get isFileLoading(): boolean;
protected set isFileLoading(val: boolean);
}
export class QuestionFilePage extends Base {
private question;
private index;
private static pageCounter;
private static getId;
items: Array;
id: string;
constructor(question: QuestionFileModel, index: number);
get css(): string;
}
/**
* A class that describes the File Upload question type.
*
* [View Demo](https://surveyjs.io/form-library/examples/file-upload/ (linkStyle))
*/
export class QuestionFileModel extends QuestionFileModelBase {
isDragging: boolean;
previewValue: any[];
pages: QuestionFilePage[];
navigationDirection: "left" | "right" | "left-delete";
indexToShow: number;
pageSize: number;
containsMultiplyFiles: boolean;
allowCameraAccess: boolean;
/**
* Specifies the source of uploaded files.
*
* Possible values:
*
* - `"file"` (default) - Allows respondents to select a local file.
* - `"camera"` - Allows respondents to capture and upload a photo.
* - `"file-camera"` - Allows respondents to select a local file or capture a photo.
* @see filePlaceholder
* @see photoPlaceholder
* @see fileOrPhotoPlaceholder
*/
sourceType: string;
fileNavigator: ActionContainer;
protected prevFileAction: Action;
protected nextFileAction: Action;
protected fileIndexAction: Action;
closeCameraAction: Action;
takePictureAction: Action;
changeCameraAction: Action;
chooseFileAction: Action;
startCameraAction: Action;
cleanAction: Action;
actionsContainer: ActionContainer;
get supportFileNavigator(): boolean;
get fileNavigatorVisible(): boolean;
private get pagesCount();
get actionsContainerVisible(): boolean;
constructor(name: string);
get videoId(): string;
get hasVideoUI(): boolean;
get hasFileUI(): boolean;
private videoStream;
startVideo(): void;
private get videoHtmlElement();
private startVideoInCamera;
stopVideo(): void;
snapPicture(): void;
private canFlipCameraValue;
canFlipCamera(): boolean;
flipCamera(): void;
private closeVideoStream;
onHidingContent(): void;
protected updateElementCssCore(cssClasses: any): void;
private getFileIndexCaption;
private updateFileNavigator;
private updateRenderedPages;
private updatePages;
private prevPreviewLength;
private previewValueChanged;
getType(): string;
protected onChangeQuestionValue(newValue: any): void;
/**
* Disable this property only to implement a custom preview.
*
* [View Demo](https://surveyjs.io/form-library/examples/file-custom-preview/ (linkStyle))
* @see allowImagesPreview
*/
get showPreview(): boolean;
set showPreview(val: boolean);
/**
* Specifies whether users can upload multiple files.
*
* Default value: `false`
*/
get allowMultiple(): boolean;
set allowMultiple(val: boolean);
/**
* The image height.
*/
get imageHeight(): string;
set imageHeight(val: string);
/**
* The image width.
*/
get imageWidth(): string;
set imageWidth(val: string);
/**
* An [accept](https://www.w3schools.com/tags/att_input_accept.asp) attribute value for the underlying ` ` element.
*/
get acceptedTypes(): string;
set acceptedTypes(val: string);
/**
* Specifies whether to show a preview of image files.
*/
get allowImagesPreview(): boolean;
set allowImagesPreview(val: boolean);
/**
* Maximum allowed file size, measured in bytes.
*
* Default value: 0 (unlimited)
*/
get maxSize(): number;
set maxSize(val: number);
chooseFile(event: MouseEvent): void;
/**
* Specifies whether users should confirm file deletion.
*
* Default value: `false`
*/
get needConfirmRemoveFile(): boolean;
set needConfirmRemoveFile(val: boolean);
getConfirmRemoveMessage(fileName: string): string;
confirmRemoveMessage: string;
confirmRemoveAllMessage: string;
noFileChosenCaption: string;
chooseButtonCaption: string;
get takePhotoCaption(): string;
set takePhotoCaption(val: string);
get locTakePhotoCaption(): LocalizableString;
replaceButtonCaption: string;
removeFileCaption: string;
loadingFileTitle: string;
chooseFileTitle: string;
get clearButtonCaption(): string;
set clearButtonCaption(value: string);
get locClearButtonCaption(): LocalizableString;
/**
* A placeholder text displayed when the File Upload question doesn't contain any files or photos to upload. Applies only when [`sourceType`](#sourceType) value is `"file-camera"`.
* @see filePlaceholder
* @see photoPlaceholder
*/
fileOrPhotoPlaceholder: string;
/**
* A placeholder text displayed when the File Upload question doesn't contain any photos to upload. Applies only when the [`sourceType`](#sourceType) value is `"camera"`.
* @see filePlaceholder
* @see fileOrPhotoPlaceholder
*/
photoPlaceholder: string;
/**
* A placeholder text displayed when the File Upload question doesn't contain any files to upload. Applies only when the [`sourceType`](#sourceType) value is `"file"`.
* @see photoPlaceholder
* @see fileOrPhotoPlaceholder
*/
filePlaceholder: string;
locRenderedPlaceholderValue: LocalizableString;
get locRenderedPlaceholder(): LocalizableString;
get currentMode(): string;
get isPlayingVideo(): boolean;
private setIsPlayingVideo;
private updateCurrentMode;
private updateActionsVisibility;
get inputTitle(): string;
get chooseButtonText(): string;
clear(doneCallback?: () => void): void;
get renderCapture(): string;
get multipleRendered(): string;
get showChooseButton(): boolean;
get showFileDecorator(): boolean;
get showDragAreaPlaceholder(): boolean;
get allowShowPreview(): boolean;
get showPreviewContainer(): boolean;
get showRemoveButtonCore(): boolean;
get showRemoveButton(): boolean;
get showRemoveButtonBottom(): boolean;
defaultImage(data: any): boolean;
/**
* Removes a file with a specified name.
*/
removeFile(name: string): void;
protected removeFileByContent(content: any): void;
protected setValueFromResult(arg: any): void;
/**
* Loads multiple files into the question.
* @param files An array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects.
*/
loadFiles(files: File[]): void;
private cameraValue;
protected get camera(): Camera;
canPreviewImage(fileItem: any): boolean;
private prevLoadedPreviewValue;
protected loadPreview(newValue: any): void;
private allFilesOk;
private isFileImage;
getPlainData(options?: IPlainDataOptions): IQuestionPlainData;
getImageWrapperCss(data: any): string;
protected getActionsContainerCss(css: any): string;
getRemoveButtonCss(): string;
getChooseFileCss(): string;
getReadOnlyFileCss(): string;
get fileRootCss(): string;
getFileDecoratorCss(): string;
private onChange;
protected calcCssClasses(css: any): any;
onSurveyLoad(): void;
protected needResponsiveness(): boolean;
protected supportResponsiveness(): boolean;
protected getObservedElementSelector(): string;
private getFileListSelector;
private _renderedPages;
get renderedPages(): Array;
set renderedPages(val: Array);
private getPagesAnimationOptions;
private pagesAnimation;
private calcAvailableItemsCount;
private calculatedGapBetweenItems;
private calculatedItemWidth;
private _width;
triggerResponsiveness(hard?: boolean): void;
protected processResponsiveness(_: number, availableWidth: number): boolean;
private rootElement;
private canDragDrop;
afterRenderQuestionElement(el: HTMLElement): void;
beforeDestroyQuestionElement(el: HTMLElement): void;
private dragCounter;
onDragEnter: (event: any) => void;
onDragOver: (event: any) => boolean;
onDrop: (event: any) => void;
onDragLeave: (event: any) => void;
doChange: (event: any) => void;
doClean: () => void;
private clearFilesCore;
doRemoveFile(data: any, event: any): void;
private removeFileCore;
doDownloadFileFromContainer: (event: MouseEvent) => void;
doDownloadFile: (event: any, data: any) => void;
dispose(): void;
}
export class FileLoader {
private fileQuestion;
private callback;
constructor(fileQuestion: QuestionFileModelBase, callback: (status: string, files: any[]) => void);
loaded: any[];
load(files: Array): void;
dispose(): void;
}
}
declare module "packages/survey-core/src/choicesRestful" {
import { Base } from "packages/survey-core/src/base";
import { ITextProcessor, IQuestion, ISurvey } from "packages/survey-core/src/base-interfaces";
import { ItemValue } from "packages/survey-core/src/itemvalue";
import { SurveyError } from "packages/survey-core/src/survey-error";
/**
* Configures access to a RESTful service that returns choices for [Checkbox](https://surveyjs.io/Examples/Library?id=questiontype-checkbox), [Dropdown](https://surveyjs.io/Examples/Library?id=questiontype-dropdown), [Radiogroup](https://surveyjs.io/Examples/Library?id=questiontype-radiogroup), and other multiple-choice question types.
*
* Use the following properties to configure this object:
*
* ```js
* {
* url: "http://...", // A RESTful service's URL.
* valueName: "value", // Specifies which field contains choice values.
* titleName: "title", // Specifies which field contains display texts for choice values.
* imageLinkName: "imageUrl", // Specifies which field contains image URLs. Used in Image Picker questions.
* // Path to the array of choices. Specify `path` only if the array of choices is nested within the object returned by the service.
* // The following path separators are allowed: semicolon `;`, comma `,`.
* path: "myNestedArray"
* }
* ```
*
* Typically, you should assign this object to a question's [`choicesByUrl`](https://surveyjs.io/Documentation/Library?id=QuestionSelectBase#choicesByUrl) property. You can also specify additional application-wide settings using the [`settings.web`](https://surveyjs.io/form-library/documentation/api-reference/settings#web) object.
*/
export class ChoicesRestful extends Base {
private static cacheText;
private static noCacheText;
static get EncodeParameters(): boolean;
static set EncodeParameters(val: boolean);
static clearCache(): void;
private static itemsResult;
private static sendingSameRequests;
private static addSameRequest;
private static unregisterSameRequests;
static get onBeforeSendRequest(): (sender: ChoicesRestful, options: {
request: XMLHttpRequest;
}) => void;
static set onBeforeSendRequest(val: (sender: ChoicesRestful, options: {
request: XMLHttpRequest;
}) => void);
private static getCachedItemsResult;
private lastObjHash;
private isRunningValue;
protected processedUrl: string;
protected processedPath: string;
private isUsingCacheFromUrl;
onProcessedUrlCallback: (url: string, path: string) => void;
getResultCallback: (items: Array) => void;
beforeSendRequestCallback: () => void;
updateResultCallback: (items: Array, serverResult: any) => Array;
getItemValueCallback: (item: any) => any;
error: SurveyError;
owner: IQuestion;
createItemValue: (value: any) => ItemValue;
constructor();
getSurvey(live?: boolean): ISurvey;
run(textProcessor?: ITextProcessor): void;
get isUsingCache(): boolean;
get isRunning(): boolean;
protected getIsRunning(): boolean;
get isWaitingForParameters(): boolean;
protected useChangedItemsResults(): boolean;
private doEmptyResultCallback;
private processedText;
protected parseResponse(response: any): any;
protected sendRequest(): void;
getType(): string;
get isEmpty(): boolean;
getCustomPropertiesNames(): Array;
private getCustomPropertyName;
private getCustomProperties;
private getAllPropertiesNames;
setData(json: any): void;
getData(): any;
/**
* A RESTful service's URL.
*
* This property supports [dynamic URLs](https://surveyjs.io/Documentation/Library?id=design-survey-conditional-logic#dynamic-texts). For example, the URL below depends on the `region` question's value. When the value changes, the survey automatically loads a new dataset that corresponds to the selected region.
*
* ```js
* url: "https://surveyjs.io/api/CountriesExample?region={region}"
* ```
*
* [View Demo](https://surveyjs.io/Examples/Library/?id=questiontype-dropdownrestfull (linkStyle))
* @see path
* @see valueName
* @see titleName
*/
get url(): string;
set url(val: string);
/**
* Path to the array of choices. The following path separators are allowed: semicolon `;`, comma `,`.
*
* Specify this property only if the array of choices is nested within the object returned by the service. For example, the service returns the following object:
*
* ```js
* {
* countries: [ ... ],
* capitals: [ ... ]
* }
* ```
*
* To populate choices with values from the `countries` array, set the `path` property to `"countries"`. To use the `capitals` array, set this property to `"capitals"`.
* @see url
* @see valueName
* @see titleName
*/
get path(): string;
set path(val: string);
/**
* Specifies which property in the obtained data object contains choice values.
*
* [View Demo](https://surveyjs.io/Examples/Library/?id=questiontype-dropdownrestfull (linkStyle))
*
* @see url
* @see path
* @see titleName
*/
get valueName(): string;
set valueName(val: string);
/**
* Specifies which property in the obtained data object contains display texts for choices.
*
* @see url
* @see path
* @see valueName
*/
get titleName(): string;
set titleName(val: string);
/**
* Specifies which property in the obtained data object contains image URLs. Used only in [Image Picker](https://surveyjs.io/Examples/Library?id=questiontype-imagepicker) questions.
*
* @see url
* @see path
* @see valueName
*/
get imageLinkName(): string;
set imageLinkName(val: string);
/**
* Specifies whether the service is allowed to return an empty response or an empty array in a response.
*
* Default value: `false`
*/
get allowEmptyResponse(): boolean;
set allowEmptyResponse(val: boolean);
get attachOriginalItems(): boolean;
set attachOriginalItems(val: boolean);
get itemValueType(): string;
clear(): void;
protected beforeSendRequest(): void;
protected beforeLoadRequest(): void;
protected onLoad(result: any, loadingObjHash?: string): void;
protected callResultCallback(items: Array, loadingObjHash: string): void;
private setCustomProperties;
private getPropertyBinding;
private onError;
private getResultAfterPath;
private getPathes;
private getValue;
private setTitle;
private getImageLink;
private getValueCore;
private get objHash();
}
/**
* Obsolete, please use ChoicesRestful
*/
export class ChoicesRestfull extends ChoicesRestful {
static get EncodeParameters(): boolean;
static set EncodeParameters(val: boolean);
static clearCache(): void;
static get onBeforeSendRequest(): (sender: ChoicesRestful, options: {
request: XMLHttpRequest;
}) => void;
static set onBeforeSendRequest(val: (sender: ChoicesRestful, options: {
request: XMLHttpRequest;
}) => void);
}
}
declare module "packages/survey-core/src/utils/text-area" {
import { Question } from "packages/survey-core/src/question";
export interface ITextArea {
question: any;
id: () => string;
propertyNames: Array;
className: () => string;
isDisabledAttr: () => boolean;
isReadOnlyAttr?: () => boolean;
placeholder: () => string;
autoGrow: () => boolean;
maxLength: () => number;
rows: () => number;
cols?: () => number;
getTextValue?: () => any;
onTextAreaChange?: (event: any) => void;
onTextAreaInput?: (event: any) => void;
onTextAreaKeyDown?: (event: any) => void;
onTextAreaBlur?: (event: any) => void;
onTextAreaFocus?: (event: any) => void;
ariaRequired: () => "true" | "false";
ariaLabel: () => string;
ariaInvalid?: () => "true" | "false";
ariaLabelledBy?: () => string;
ariaDescribedBy?: () => string;
ariaErrormessage?: () => string;
}
export class TextAreaModel {
private options;
private element;
updateElement(): void;
private onPropertyChangedCallback;
constructor(options: ITextArea);
setElement(element: HTMLTextAreaElement | null): void;
resetElement(): void;
getTextValue(): string;
onTextAreaChange(event: any): void;
onTextAreaInput(event: any): void;
onTextAreaKeyDown(event: any): void;
onTextAreaBlur(event: any): void;
onTextAreaFocus(event: any): void;
get question(): Question;
get id(): string;
get placeholder(): string;
get className(): string;
get maxLength(): number;
get autoGrow(): boolean;
get rows(): number;
get cols(): number | undefined;
get isDisabledAttr(): boolean;
get isReadOnlyAttr(): boolean | undefined;
get ariaRequired(): "true" | "false";
get ariaLabel(): string;
get ariaInvalid(): "true" | "false";
get ariaLabelledBy(): string;
get ariaDescribedBy(): string;
get ariaErrormessage(): string;
dispose(): void;
}
}
declare module "packages/survey-core/src/question_baseselect" {
import { SurveyError } from "packages/survey-core/src/survey-error";
import { ISurveyImpl, ISurvey, ISurveyData, IPlainDataOptions } from "packages/survey-core/src/base-interfaces";
import { IQuestionPlainData, Question } from "packages/survey-core/src/question";
import { ItemValue } from "packages/survey-core/src/itemvalue";
import { ChoicesRestful } from "packages/survey-core/src/choicesRestful";
import { LocalizableString } from "packages/survey-core/src/localizablestring";
import { HashTable } from "packages/survey-core/src/helpers";
import { TextAreaModel } from "packages/survey-core/src/utils/text-area";
/**
* A base class for multiple-choice question types ([Checkboxes](https://surveyjs.io/form-library/documentation/questioncheckboxmodel), [Dropdown](https://surveyjs.io/form-library/documentation/questiondropdownmodel), [Radio Button Group](https://surveyjs.io/form-library/documentation/questionradiogroupmodel), etc.).
*/
export class QuestionSelectBase extends Question {
visibleChoicesChangedCallback: () => void;
loadedChoicesFromServerCallback: () => void;
renderedChoicesChangedCallback: () => void;
private otherTextAreaModelValue;
private filteredChoicesValue;
private conditionChoicesVisibleIfRunner;
private conditionChoicesEnableIfRunner;
private prevOtherValue;
private otherItemValue;
private choicesFromUrl;
private cachedValueForUrlRequests;
private isChoicesLoaded;
private enableOnLoadingChoices;
private noneItemValue;
private refuseItemValue;
private dontKnowItemValue;
private newItemValue;
private canShowOptionItemCallback;
private waitingGetChoiceDisplayValueResponse;
private get waitingChoicesByURL();
protected selectedItemValues: any;
constructor(name: string);
getType(): string;
dispose(): void;
get otherTextAreaModel(): TextAreaModel;
private getOtherTextAreaOptions;
protected resetDependedQuestion(): void;
get otherId(): string;
protected getCommentElementsId(): Array;
protected getItemValueType(): string;
createItemValue(value: any, text?: string): ItemValue;
hasErrors(fireCallback?: boolean, rec?: any): boolean;
get isUsingCarryForward(): boolean;
get carryForwardQuestionType(): string;
private setCarryForwardQuestionType;
get isUsingRestful(): boolean;
updateIsUsingRestful(): void;
supportGoNextPageError(): boolean;
isLayoutTypeSupported(layoutType: string): boolean;
localeChanged(): void;
locStrsChanged(): void;
private prevOtherErrorValue;
private updatePrevOtherErrorValue;
get otherValue(): string;
set otherValue(val: string);
protected get otherValueCore(): string;
protected set otherValueCore(val: string);
/**
* Returns the "Other" choice item. Use this property to change the item's `value` or `text`.
* @see showOtherItem
*/
get otherItem(): ItemValue;
/**
* Returns `true` if the "Other" choice item is selected.
* @see showOtherItem
*/
get isOtherSelected(): boolean;
get isNoneSelected(): boolean;
/**
* Specifies whether to display the "None" choice item.
*
* When users select the "None" item in multi-select questions, all other items become unselected.
* @see noneItem
* @see noneText
* @see [settings.noneItemValue](https://surveyjs.io/form-library/documentation/api-reference/settings#noneItemValue)
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
*/
get showNoneItem(): boolean;
set showNoneItem(val: boolean);
get hasNone(): boolean;
set hasNone(val: boolean);
/**
* Returns the "None" choice item. Use this property to change the item's `value` or `text`.
* @see showNoneItem
*/
get noneItem(): ItemValue;
/**
* Gets or sets a caption for the "None" choice item.
* @see showNoneItem
*/
get noneText(): string;
set noneText(val: string);
get locNoneText(): LocalizableString;
/**
* Specifies whether to display the "Refuse to answer" choice item.
*
* When users select the "Refuse to answer" item in multi-select questions, all other items become unselected.
* @see refuseItem
* @see refuseItemText
* @see [settings.refuseItemValue](https://surveyjs.io/form-library/documentation/api-reference/settings#refuseItemValue)
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
*/
get showRefuseItem(): boolean;
set showRefuseItem(val: boolean);
/**
* Returns the "Refuse to answer" choice item. Use this property to change the item's `value` or `text`.
* @see showRefuseItem
*/
get refuseItem(): ItemValue;
/**
* Gets or sets a caption for the "Refuse to answer" choice item.
* @see showRefuseItem
*/
get refuseText(): string;
set refuseText(val: string);
get locRefuseText(): LocalizableString;
/**
* Specifies whether to display the "Don't know" choice item.
*
* When users select the "Don't know" item in multi-select questions, all other items become unselected.
* @see dontKnowItem
* @see dontKnowItemText
* @see [settings.dontKnowItemValue](https://surveyjs.io/form-library/documentation/api-reference/settings#dontKnowItemValue)
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
*/
get showDontKnowItem(): boolean;
set showDontKnowItem(val: boolean);
/**
* Returns the "Don't know" choice item. Use this property to change the item's `value` or `text`.
* @see showDontKnowItem
*/
get dontKnowItem(): ItemValue;
/**
* Gets or sets a caption for the "Don't know" choice item.
* @see showDontKnowItem
*/
get dontKnowText(): string;
set dontKnowText(val: string);
get locDontKnowText(): LocalizableString;
private createDefaultItem;
/**
* A Boolean expression that is evaluated against each choice item. If the expression evaluates to `false`, the choice item becomes hidden.
*
* A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.
*
* Use the `{item}` placeholder to reference the current choice item in the expression.
*
* Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).
* @see visibleIf
* @see choicesEnableIf
*/
get choicesVisibleIf(): string;
set choicesVisibleIf(val: string);
/**
* A Boolean expression that is evaluated against each choice item. If the expression evaluates to `false`, the choice item becomes read-only.
*
* A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.
*
* Use the `{item}` placeholder to reference the current choice item in the expression.
*
* Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).
* @see enableIf
* @see choicesVisibleIf
*/
get choicesEnableIf(): string;
set choicesEnableIf(val: string);
surveyChoiceItemVisibilityChange(): void;
runCondition(values: HashTable, properties: HashTable): void;
protected isTextValue(): boolean;
private isSettingDefaultValue;
protected setDefaultValue(): void;
protected getIsMultipleValue(): boolean;
protected convertDefaultValue(val: any): any;
protected filterItems(): boolean;
protected runItemsCondition(values: HashTable, properties: HashTable): boolean;
protected runItemsEnableCondition(values: HashTable, properties: HashTable): any;
protected onAfterRunItemsEnableCondition(): void;
protected onEnableItemCallBack(item: ItemValue): boolean;
protected onSelectedItemValuesChangedHandler(newValue: any): void;
protected getItemIfChoicesNotContainThisValue(value: any, text?: string): any;
protected getSingleSelectedItem(): ItemValue;
protected onGetSingleSelectedItem(selectedItemByValue: ItemValue): void;
protected getMultipleSelectedItems(): Array;
private setConditionalChoicesRunner;
private setConditionalEnableChoicesRunner;
private canSurveyChangeItemVisibility;
private changeItemVisibility;
private runConditionsForItems;
protected getHasOther(val: any): boolean;
protected getIsItemValue(val: any, item: ItemValue): boolean;
get validatedValue(): any;
protected createRestful(): ChoicesRestful;
private setNewRestfulProperty;
get autoOtherMode(): boolean;
set autoOtherMode(val: boolean);
protected getQuestionComment(): string;
protected selectOtherValueFromComment(val: boolean): void;
private isSettingComment;
protected setQuestionComment(newValue: string): void;
private onUpdateCommentOnAutoOtherMode;
private setOtherValueInternally;
private getValueOnSettingOther;
clearValue(keepComment?: boolean): void;
updateCommentFromSurvey(newValue: any): any;
get renderedValue(): any;
set renderedValue(val: any);
private makeCommentEmpty;
protected setQuestionValue(newValue: any, updateIsAnswered?: boolean, updateComment?: boolean): void;
protected setValueCore(newValue: any): void;
protected setNewValue(newValue: any): void;
protected valueFromData(val: any): any;
protected rendredValueFromData(val: any): any;
protected rendredValueToData(val: any): any;
protected renderedValueFromDataCore(val: any): any;
protected rendredValueToDataCore(val: any): any;
protected needConvertRenderedOtherToDataValue(): boolean;
protected getIsQuestionReady(): boolean;
protected updateSelectedItemValues(): void;
private setCustomValuesIntoItems;
protected hasUnknownValue(val: any, includeOther?: boolean, isFilteredChoices?: boolean, checkEmptyValue?: boolean): boolean;
protected hasUnknownValueItem(val: any, includeOther?: boolean, isFilteredChoices?: boolean, checkEmptyValue?: boolean): boolean;
protected isValueDisabled(val: any): boolean;
endLoadingFromJson(): void;
clearIncorrectValuesCallback: () => void;
/**
* Configures access to a RESTful service that returns choice items. Refer to the [`ChoicesRestful`](https://surveyjs.io/form-library/documentation/choicesrestful) class description for more information. You can also specify additional application-wide settings using the [`settings.web`](https://surveyjs.io/form-library/documentation/api-reference/settings#web) object.
*
* [View Demo](https://surveyjs.io/form-library/examples/dropdown-menu-load-data-from-restful-service/ (linkStyle))
* @see choices
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
*/
get choicesByUrl(): ChoicesRestful;
set choicesByUrl(val: ChoicesRestful);
/**
* Gets or sets choice items. This property accepts an array of objects with the following structure:
*
* ```js
* {
* "value": any, // A unique value to be saved in the survey results.
* "text": String, // A display text. This property supports Markdown. When `text` is undefined, `value` is used.
* "imageLink": String // A link to the image or video that represents this choice value. Applies only to Image Picker questions.
* "customProperty": any // Any property that you find useful.
* }
* ```
*
* To enable Markdown support for the `text` property, implement Markdown-to-HTML conversion in the [`onTextMarkdown`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onTextMarkdown) event handler. For an example, refer to the following demo: [Convert Markdown to HTML with markdown-it](https://surveyjs.io/form-library/examples/edit-survey-questions-markdown/).
*
* If you add custom properties, refer to the following help topic to learn how to serialize them into JSON: [Add Custom Properties to Property Grid](https://surveyjs.io/survey-creator/documentation/property-grid#add-custom-properties-to-the-property-grid).
*
* If you need to specify only the `value` property, you can set the `choices` property to an array of primitive values, for example, `[ "item1", "item2", "item3" ]`. These values are both saved in survey results and used as display text.
* @see choicesByUrl
* @see choicesFromQuestion
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
*/
get choices(): Array;
set choices(newValue: Array);
/**
* Copies choice items from a specified question. Accepts a question name.
*
* If you specify this property, the `choices`, `choicesVisibleIf`, `choicesEnableIf`, and `choicesOrder` properties do not apply because their values are copied.
*
* In addition, you can specify the `choicesFromQuestionMode` property if you do not want to copy all choice items.
* @see choicesFromQuestionMode
* @see choices
*/
get choicesFromQuestion(): string;
set choicesFromQuestion(val: string);
private isLockVisibleChoices;
/**
* Specifies which choice items to copy from another question. Applies only when the `choicesFromQuestion` property is specified.
*
* Possible values:
*
* - `"all"` (default) - Copies all choice items.
* - `"selected"` - Copies only selected choice items.
* - `"unselected"` - Copies only unselected choice items.
*
* Use the `visibleChoices` property to access copied choice items.
* @see choicesFromQuestion
* @see visibleChoices
*/
get choicesFromQuestionMode(): string;
set choicesFromQuestionMode(val: string);
/**
* Specifies which matrix column or dynamic panel question supplies choice values. Use this property to construct choice items based on cell values in Dynamic Matrix and question values in Dynamic Panel.
*
* Each choice item consists of a value saved in survey results and a text displayed in the UI. To construct a choice item, assign the `name` of a Dynamic Matrix or Dynamic Panel to the [`choicesFromQuestion`](#choicesFromQuestion) property and specify which dynamic panel question or matrix column supplies values and which provides texts. Use the `choiceValuesFromQuestion` and [`choiceTextsFromQuestion`](#choiceTextsFromQuestion) properties for this purpose. If a choice text is empty, a choice value is used as a display text and saved in survey results.
*/
get choiceValuesFromQuestion(): string;
set choiceValuesFromQuestion(val: string);
/**
* Specifies which matrix column or dynamic panel question supplies choice texts. Use this property to construct choice items based on cell values in Dynamic Matrix and question values in Dynamic Panel.
*
* Each choice item consists of a value saved in survey results and a text displayed in the UI. To construct a choice item, assign the `name` of a Dynamic Matrix or Dynamic Panel to the [`choicesFromQuestion`](#choicesFromQuestion) property and specify which dynamic panel question or matrix column supplies values and which provides texts. Use the [`choiceValuesFromQuestion`](#choiceValuesFromQuestion) and `choiceTextsFromQuestion` properties for this purpose. If a choice text is empty, a choice value is used as a display text and saved in survey results.
*/
get choiceTextsFromQuestion(): string;
set choiceTextsFromQuestion(val: string);
/**
* Specifies whether to hide the question if no choice items are visible.
*
* This property is useful if you show or hide choice items at runtime based on a [condition](https://surveyjs.io/form-library/documentation/questionselectbase#choicesVisibleIf).
*/
get hideIfChoicesEmpty(): boolean;
set hideIfChoicesEmpty(val: boolean);
/**
* Specifies whether to keep values that cannot be assigned to this question, for example, choices unlisted in the `choices` array.
*
* > This property cannot be specified in the survey JSON schema. Use dot notation to specify it.
* @see clearIncorrectValues
*/
get keepIncorrectValues(): boolean;
set keepIncorrectValues(val: boolean);
get storeOthersAsComment(): any;
set storeOthersAsComment(val: any);
protected hasOtherChanged(): void;
/**
* Specifies the sort order of choice items.
*
* Possible values:
*
* - `"none"` (default) - Preserves the original order of choice items.
* - `"asc"`- Sorts choice items in ascending order.
* - `"desc"`- Sorts choice items in ascending order.
* - `"random"` - Displays choice items in random order.
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
*/
get choicesOrder(): string;
set choicesOrder(val: string);
/**
* Gets or sets a caption for the "Other" choice item.
* @see showOtherItem
*/
get otherText(): string;
set otherText(val: string);
get locOtherText(): LocalizableString;
/**
* Displays the "Select All", "None", and "Other" choices on individual rows.
* @see showNoneItem
* @see showOtherItem
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
*/
separateSpecialChoices: boolean;
/**
* A placeholder for the comment area. Applies when the `showOtherItem` or `showCommentArea` property is `true`.
* @see showOtherItem
* @see showCommentArea
*/
otherPlaceholder: string;
get otherPlaceHolder(): string;
set otherPlaceHolder(newValue: string);
/**
* Gets or sets an error message displayed when users select the "Other" choice item but leave the comment area empty.
* @see showOtherItem
*/
get otherErrorText(): string;
set otherErrorText(val: string);
get locOtherErrorText(): LocalizableString;
/**
* An array of visible choice items. Includes the "Select All", "Other", and "None" choice items if they are visible. Items are sorted according to the `choicesOrder` value.
* @see showNoneItem
* @see showOtherItem
* @see choicesOrder
* @see choices
* @see enabledChoices
*/
get visibleChoices(): Array;
/**
* An array of choice items with which users can interact. Includes the "Select All", "Other", and "None" choice items if they are not disabled. Items are sorted according to the `choicesOrder` value.
* @see showNoneItem
* @see showOtherItem
* @see choicesOrder
* @see choices
* @see visibleChoices
*/
get enabledChoices(): Array;
protected updateVisibleChoices(): void;
private calcVisibleChoices;
protected canUseFilteredChoices(): boolean;
setCanShowOptionItemCallback(func: (item: ItemValue) => boolean): void;
get newItem(): ItemValue;
protected addToVisibleChoices(items: Array, isAddAll: boolean): void;
protected addNewItemToVisibleChoices(items: Array, isAddAll: boolean): void;
protected addNonChoicesItems(dict: Array<{
index: number;
item: ItemValue;
}>, isAddAll: boolean): void;
protected addNonChoiceItem(dict: Array<{
index: number;
item: ItemValue;
}>, item: ItemValue, isAddAll: boolean, showItem: boolean, order: Array): void;
protected canShowOptionItem(item: ItemValue, isAddAll: boolean, hasItem: boolean): boolean;
isItemInList(item: ItemValue): boolean;
protected get isAddDefaultItems(): boolean;
getPlainData(options?: IPlainDataOptions): IQuestionPlainData;
protected getDisplayValueCore(keysAsText: boolean, value: any): any;
protected getDisplayValueEmpty(): string;
private getChoicesDisplayValue;
protected getDisplayArrayValue(keysAsText: boolean, value: any, onGetValueCallback?: (index: number) => any): string;
private getItemDisplayValue;
private getFilteredChoices;
private get activeChoices();
get isMessagePanelVisible(): boolean;
set isMessagePanelVisible(val: boolean);
private get isEmptyActiveChoicesInDesign();
getCarryForwardQuestion(data?: ISurveyData): Question;
protected getIsReadyDependsOn(): Array;
private getQuestionWithChoices;
private carryForwardQuestion;
private findCarryForwardQuestion;
private getQuestionWithChoicesCore;
private getQuestionWithArrayValue;
private getChoicesFromArrayQuestion;
private getValueKeyName;
private getChoicesFromSelectQuestion;
private copyChoiceItem;
protected get hasActiveChoices(): boolean;
protected isBuiltInChoice(item: ItemValue): boolean;
isNoneItem(item: ItemValue): boolean;
protected getNoneItems(): Array;
protected getChoices(): Array;
supportOther(): boolean;
supportNone(): boolean;
supportRefuse(): boolean;
supportDontKnow(): boolean;
protected isSupportProperty(propName: string): boolean;
protected onCheckForErrors(errors: Array, isOnValueChanged: boolean, fireCallback: boolean): void;
setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void;
protected setSurveyCore(value: ISurvey): void;
getStoreOthersAsComment(): boolean;
onSurveyLoad(): void;
onAnyValueChanged(name: string, questionName: string): void;
updateValueFromSurvey(newValue: any, clearData: boolean): void;
protected getCommentFromValue(newValue: any): string;
protected setOtherValueIntoValue(newValue: any): any;
onOtherValueInput(event: any): void;
onOtherValueChange(event: any): void;
private isRunningChoices;
private runChoicesByUrl;
private isFirstLoadChoicesFromUrl;
protected onBeforeSendRequest(): void;
protected onLoadChoicesFromUrl(array: Array): void;
private canAvoidSettChoicesFromUrl;
private setChoicesFromUrl;
private createCachedValueForUrlRequests;
private updateCachedValueForUrlRequests;
private isUpdatingChoicesDependedQuestions;
protected updateChoicesDependedQuestions(): void;
protected updateDependedQuestion(): void;
onSurveyValueChanged(newValue: any): void;
protected onVisibleChoicesChanged(): void;
protected isVisibleCore(): boolean;
private sortVisibleChoices;
private sortArray;
private randomizeArray;
private get hasChoicesUrl();
clearIncorrectValues(): void;
private canClearIncorrectValues;
protected hasValueToClearIncorrectValues(): boolean;
protected clearValueIfInvisibleCore(reason: string): void;
/**
* Returns `true` if a passed choice item is selected.
*
* To obtain a choice item to check, use the `noneItem` or `otherItem` property or the `choices` array.
* @param item A choice item.
* @see noneItem
* @see otherItem
* @see choices
*/
isItemSelected(item: ItemValue): boolean;
protected isItemSelectedCore(item: ItemValue): boolean;
private clearDisabledValues;
protected clearIncorrectValuesCore(): void;
protected canClearValueAnUnknown(val: any): boolean;
protected clearDisabledValuesCore(): void;
clearUnusedValues(): void;
getColumnClass(): string;
getItemIndex(item: any): number;
getItemClass(item: any): string;
protected getCurrentColCount(): number;
protected getItemClassCore(item: any, options: any): string;
getLabelClass(item: ItemValue): string;
getControlLabelClass(item: ItemValue): string;
_renderedChoices: Array;
onGetRenderedChoicesCallback?: (visibleChoices: Array) => Array;
private updateRenderedChoices;
private getRenderedChoicesAnimationOptions;
private renderedChoicesAnimation;
get renderedChoices(): Array;
set renderedChoices(val: Array);
private headItemsCount;
private footItemsCount;
get headItems(): ItemValue[];
get footItems(): ItemValue[];
get dataChoices(): ItemValue[];
get bodyItems(): ItemValue[];
get hasHeadItems(): boolean;
get hasFootItems(): boolean;
get columns(): any[];
getItemsColumnKey(itemsColumn: Array): string;
get hasColumns(): boolean;
get rowLayout(): boolean;
get blockedRow(): boolean;
choicesLoaded(): void;
getItemValueWrapperComponentName(item: ItemValue): string;
getItemValueWrapperComponentData(item: ItemValue): any;
ariaItemChecked(item: ItemValue): "true" | "false";
isOtherItem(item: ItemValue): boolean;
get itemSvgIcon(): string;
getSelectBaseRootCss(): string;
protected allowMobileInDesignMode(): boolean;
getAriaItemLabel(item: ItemValue): string;
getItemId(item: ItemValue): string;
get questionName(): string;
getItemEnabled(item: ItemValue): boolean;
private focusOtherComment;
onItemSelected(item: ItemValue): void;
protected getDefaultItemComponent(): string;
/**
* The name of a component used to render items.
*
* [View Dropdown Demo](https://surveyjs.io/form-library/examples/dropdown-box-with-custom-items/ (linkStyle))
*
* [View Ranking Demo](https://surveyjs.io/form-library/examples/ranking-with-custom-items/ (linkStyle))
*/
get itemComponent(): string;
set itemComponent(value: string);
}
/**
* A base class for multiple-selection question types that can display choice items in multiple columns ([Checkbox](https://surveyjs.io/form-library/documentation/questioncheckboxmodel), [Radiogroup](https://surveyjs.io/form-library/documentation/questionradiogroupmodel), [Image Picker](https://surveyjs.io/form-library/documentation/questionimagepickermodel)).
*/
export class QuestionCheckboxBase extends QuestionSelectBase {
colCountChangedCallback: () => void;
constructor(name: string);
/**
* Gets or sets the number of columns used to arrange choice items.
*
* Set this property to 0 if you want to display all items in one line. The default value depends on the available width.
* @see separateSpecialChoices
*/
get colCount(): number;
set colCount(value: number);
protected onParentChanged(): void;
protected onParentQuestionChanged(): void;
protected getSearchableItemValueKeys(keys: Array): void;
}
}
declare module "packages/survey-core/src/validator" {
import { Base } from "packages/survey-core/src/base";
import { ISurveyErrorOwner, ISurvey } from "packages/survey-core/src/base-interfaces";
import { SurveyError } from "packages/survey-core/src/survey-error";
import { LocalizableString } from "packages/survey-core/src/localizablestring";
export class ValidatorResult {
value: any;
error: SurveyError;
constructor(value: any, error?: SurveyError);
}
/**
* A base class for all classes that implement validators.
*
* [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))
*/
export class SurveyValidator extends Base {
errorOwner: ISurveyErrorOwner;
onAsyncCompleted: (result: ValidatorResult) => void;
constructor();
get isValidator(): boolean;
getSurvey(live?: boolean): ISurvey;
/**
* An error message to display when a value fails validation.
*/
get text(): string;
set text(value: string);
get isValidateAllValues(): boolean;
get locText(): LocalizableString;
protected getErrorText(name: string): string;
protected getDefaultErrorText(name: string): string;
validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult;
get isRunning(): boolean;
get isAsync(): boolean;
getLocale(): string;
getMarkdownHtml(text: string, name: string): string;
getRenderer(name: string): string;
getRendererContext(locStr: LocalizableString): any;
getProcessedText(text: string): string;
protected createCustomError(name: string): SurveyError;
toString(): string;
}
export interface IValidatorOwner {
getValidators(): Array;
validatedValue: any;
getValidatorTitle(): string;
getDataFilteredValues(): any;
getDataFilteredProperties(): any;
}
export class ValidatorRunner {
private asyncValidators;
onAsyncCompleted: (errors: Array) => void;
run(owner: IValidatorOwner): Array;
private prepareAsyncValidators;
}
/**
* A class that implements a validator for numeric values.
*
* [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))
*/
export class NumericValidator extends SurveyValidator {
constructor(minValue?: number, maxValue?: number);
getType(): string;
validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult;
protected getDefaultErrorText(name: string): string;
/**
* A minimum allowed numeric value.
*
* [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))
*/
get minValue(): number;
set minValue(val: number);
/**
* A maximum allowed numeric value.
*
* [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))
*/
get maxValue(): number;
set maxValue(val: number);
}
/**
* A class that implements a validator for text values.
*
* [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))
*/
export class TextValidator extends SurveyValidator {
constructor();
getType(): string;
validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult;
protected getDefaultErrorText(name: string): string;
/**
* The minimum length of a text value measured in characters.
*
* Default value: 0
*
* [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))
*/
get minLength(): number;
set minLength(val: number);
/**
* The maximum length of a text value measured in characters.
*
* Default value: 0 (unlimited)
*
* [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))
*/
get maxLength(): number;
set maxLength(val: number);
/**
* Specifies whether a text value can include numerical digits.
*
* Default value: `true`
*/
get allowDigits(): boolean;
set allowDigits(val: boolean);
}
/**
* A class that implements answer count validation in the question types that can have multiple values (for instance, [Checkboxes](https://surveyjs.io/form-library/documentation/api-reference/checkbox-question-model)).
*
* [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))
*/
export class AnswerCountValidator extends SurveyValidator {
constructor(minCount?: number, maxCount?: number);
getType(): string;
validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult;
protected getDefaultErrorText(name: string): string;
/**
* A minimum number of selected answers.
*
* [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))
*/
get minCount(): number;
set minCount(val: number);
/**
* A maximum number of selected answers.
*
* [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))
*/
get maxCount(): number;
set maxCount(val: number);
}
/**
* A class that implements validation using regular expressions.
*
* [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))
*/
export class RegexValidator extends SurveyValidator {
constructor(regex?: string);
getType(): string;
validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult;
private hasError;
/**
* A regular expression used to validate values.
*
* [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))
*/
get regex(): string;
set regex(val: string);
/**
* Specifies whether uppercase and lowercase letters must be treated as distinct or equivalent when validating values.
*
* Default value: `false` (uppercase and lowercase letters are treated as distinct)
*/
get caseInsensitive(): boolean;
set caseInsensitive(val: boolean);
get insensitive(): boolean;
set insensitive(val: boolean);
private createRegExp;
}
/**
* A class that implements a validator for e-mail addresses.
*
* [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))
*/
export class EmailValidator extends SurveyValidator {
private re;
constructor();
getType(): string;
validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult;
protected getDefaultErrorText(name: string): string;
}
/**
* A class that implements validation using [expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions).
*
* [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))
*/
export class ExpressionValidator extends SurveyValidator {
private conditionRunner;
private isRunningValue;
constructor(expression?: string);
getType(): string;
get isValidateAllValues(): boolean;
get isAsync(): boolean;
get isRunning(): boolean;
validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult;
protected generateError(res: boolean, value: any, name: string): ValidatorResult;
protected getDefaultErrorText(name: string): string;
private ensureConditionRunner;
/**
* A Boolean [expression](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions). If it evaluates to `false`, validation fails.
*
* [View Demo](https://surveyjs.io/form-library/examples/javascript-form-validation/ (linkStyle))
*/
get expression(): string;
set expression(val: string);
}
}
declare module "packages/survey-core/src/question_expression" {
import { HashTable } from "packages/survey-core/src/helpers";
import { Question } from "packages/survey-core/src/question";
import { LocalizableString } from "packages/survey-core/src/localizablestring";
/**
* A class that describes the Expression question type. It is a read-only question type that calculates a value based on a specified expression.
*
* [View Demo](https://surveyjs.io/form-library/examples/questiontype-expression/ (linkStyle))
*/
export class QuestionExpressionModel extends Question {
private expressionIsRunning;
private expressionRunner;
constructor(name: string);
getType(): string;
get hasInput(): boolean;
/**
* A string that formats a question value. Use `{0}` to reference the question value in the format string.
* @see displayStyle
*/
get format(): string;
set format(val: string);
get locFormat(): LocalizableString;
/**
* An expression used to calculate the question value.
*
* Refer to the following help topic for more information: [Expressions](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#expressions).
*/
get expression(): string;
set expression(val: string);
locCalculation(): void;
unlocCalculation(): void;
runCondition(values: HashTable, properties: HashTable): void;
protected canCollectErrors(): boolean;
hasRequiredError(): boolean;
private createRunner;
/**
* The maximum number of fraction digits. Applies only if the `displayStyle` property is not `"none"`. Accepts values in the range from -1 to 20, where -1 disables the property.
*
* Default value: -1
* @see displayStyle
* @see minimumFractionDigits
* @see precision
*/
get maximumFractionDigits(): number;
set maximumFractionDigits(val: number);
/**
* The minimum number of fraction digits. Applies only if the `displayStyle` property is not `"none"`. Accepts values in the range from -1 to 20, where -1 disables the property.
*
* Default value: -1
* @see displayStyle
* @see maximumFractionDigits
*/
get minimumFractionDigits(): number;
set minimumFractionDigits(val: number);
private runIfReadOnlyValue;
get runIfReadOnly(): boolean;
set runIfReadOnly(val: boolean);
get formatedValue(): string;
protected updateFormatedValue(): void;
protected onValueChanged(): void;
updateValueFromSurvey(newValue: any, clearData: boolean): void;
protected getDisplayValueCore(keysAsText: boolean, value: any): any;
/**
* Specifies a display style for the question value.
*
* Possible values:
*
* - `"decimal"`
* - `"currency"`
* - `"percent"`
* - `"date"`
* - `"none"` (default)
*
* If you use the `"currency"` display style, you can also set the `currency` property to specify a currency other than USD.
* @see currency
* @see minimumFractionDigits
* @see maximumFractionDigits
* @see format
*/
get displayStyle(): string;
set displayStyle(val: string);
/**
* A three-letter currency code. Applies only if the `displayStyle` property is set to `"currency"`.
*
* Default value: "USD".
* @see displayStyle
* @see minimumFractionDigits
* @see maximumFractionDigits
* @see format
*/
get currency(): string;
set currency(val: string);
/**
* Specifies whether to use grouping separators in number representation. Separators depend on the selected [locale](https://surveyjs.io/form-library/documentation/surveymodel#locale).
*
* Default value: `true`
*/
get useGrouping(): boolean;
set useGrouping(val: boolean);
/**
* Specifies how many decimal digits to keep in the expression value.
*
* Default value: -1 (unlimited)
* @see maximumFractionDigits
*/
get precision(): number;
set precision(val: number);
private roundValue;
protected getValueAsStr(val: any): string;
}
export function getCurrecyCodes(): Array;
}
declare module "packages/survey-core/src/question_matrixdropdowncolumn" {
import { Question } from "packages/survey-core/src/question";
import { Base, ArrayChanges } from "packages/survey-core/src/base";
import { ISurvey, IWrapperObject } from "packages/survey-core/src/base-interfaces";
import { ItemValue } from "packages/survey-core/src/itemvalue";
import { ILocalizableOwner, LocalizableString } from "packages/survey-core/src/localizablestring";
import { SurveyValidator } from "packages/survey-core/src/validator";
import { MatrixDropdownRowModelBase } from "packages/survey-core/src/question_matrixdropdownbase";
export interface IMatrixColumnOwner extends ILocalizableOwner {
getRequiredText(): string;
hasChoices(): boolean;
onColumnPropertyChanged(column: MatrixDropdownColumn, name: string, newValue: any): void;
onColumnItemValuePropertyChanged(column: MatrixDropdownColumn, propertyName: string, obj: ItemValue, name: string, newValue: any, oldValue: any): void;
onShowInMultipleColumnsChanged(column: MatrixDropdownColumn): void;
onColumnVisibilityChanged(column: MatrixDropdownColumn): void;
getCellType(): string;
getCustomCellType(column: MatrixDropdownColumn, row: MatrixDropdownRowModelBase, cellType: string): string;
onColumnCellTypeChanged(column: MatrixDropdownColumn): void;
getCellAriaLabel(rowTitle: string, columnTitle: string): string;
}
export var matrixDropdownColumnTypes: any;
/**
* An auxiliary class that describes a column in a [Multi-Select Matrix](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list) or [Dynamic Matrix](https://surveyjs.io/form-library/documentation/api-reference/dynamic-matrix-table-question-model).
*
* You can get an object of this class from the [`columns`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list#columns) array or by calling the [`getColumnByName()`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list#getColumnByName) method on a matrix instance.
*/
export class MatrixDropdownColumn extends Base implements ILocalizableOwner, IWrapperObject {
static getColumnTypes(): Array;
private templateQuestionValue;
private colOwnerValue;
private indexValue;
private _hasVisibleCell;
private _visiblechoices;
constructor(name: string, title?: string, colOwner?: IMatrixColumnOwner);
getOriginalObj(): Base;
getClassNameProperty(): string;
getSurvey(live?: boolean): ISurvey;
endLoadingFromJson(): void;
getDynamicPropertyName(): string;
getDynamicType(): string;
get colOwner(): IMatrixColumnOwner;
set colOwner(value: IMatrixColumnOwner);
locStrsChanged(): void;
addUsedLocales(locales: Array): void;
get index(): number;
setIndex(val: number): void;
getType(): string;
/**
* Specifies the type of column cells.
*
* Possible values:
*
* - [`"dropdown"`](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model)
* - [`"checkbox"`](https://surveyjs.io/form-library/documentation/api-reference/checkbox-question-model)
* - [`"radiogroup"`](https://surveyjs.io/form-library/documentation/api-reference/radio-button-question-model)
* - [`"tagbox"`](https://surveyjs.io/form-library/documentation/api-reference/dropdown-tag-box-model)
* - [`"text"`](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model)
* - [`"comment"`](https://surveyjs.io/form-library/documentation/api-reference/comment-field-model)
* - [`"boolean"`](https://surveyjs.io/form-library/documentation/api-reference/boolean-question-model)
* - [`"expression"`](https://surveyjs.io/form-library/documentation/api-reference/expression-model)
* - [`"rating"`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model)
* - `"default"` (default) - Inherits the input type from the [`cellType`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list#cellType) property specified for the parent matrix.
*
* The input types are based upon standalone question types. Depending on the selected input type, the matrix column can have additional configuration properties inherited from the corresponding question type. For instance, Dropdown, Checkboxes, Radio Button Group, and Tag Box columns can specify the [`choices`](https://surveyjs.io/form-library/documentation/api-reference/radio-button-question-model#choices) array, similar to the question types upon which they are based. Refer to the API Reference of these question types for a full list of available properties.
*
* [View Demo](https://surveyjs.io/form-library/examples/aggregate-data-within-form/ (linkStyle))
*/
get cellType(): string;
set cellType(val: string);
get templateQuestion(): Question;
get value(): string;
get isVisible(): boolean;
get isColumnVisible(): boolean;
/**
* Gets or sets column visibility.
*
* If you want to display or hide a column based on a condition, specify the [`visibleIf`](#visibleIf) property.
* @see isRequired
* @see readOnly
*/
get visible(): boolean;
set visible(val: boolean);
get hasVisibleCell(): boolean;
set hasVisibleCell(newVal: boolean);
isColumnsVisibleIf: boolean;
getVisibleMultipleChoices(): Array;
get getVisibleChoicesInCell(): Array;
setVisibleChoicesInCell(val: Array): void;
get isFilteredMultipleColumns(): boolean;
/**
* A column ID that is not visible to respondents.
*
* > Column IDs must be unique.
* @see title
*/
get name(): string;
set name(val: string);
/**
* A user-friendly column caption to display. If `title` is undefined, [`name`](#name) is displayed instead.
*/
get title(): string;
set title(val: string);
get locTitle(): LocalizableString;
get fullTitle(): string;
/**
* Marks the column as required. If a respondent skips any cell in a required column, the matrix displays a [validation error](#requiredErrorText).
*
* If you want to mark the column as required based on a condition, specify the [`requiredIf`](#requiredIf) property.
* @see visible
* @see readOnly
*/
get isRequired(): boolean;
set isRequired(val: boolean);
get isRenderedRequired(): boolean;
set isRenderedRequired(val: boolean);
updateIsRenderedRequired(val: boolean): void;
get requiredText(): string;
/**
* Specifies a custom error message for a required column.
* @see isRequired
*/
get requiredErrorText(): string;
set requiredErrorText(val: string);
get locRequiredErrorText(): LocalizableString;
/**
* Makes the column read-only.
*
* If you want to switch the column to the read-only state based on a condition, specify the [`enableIf`](#enableIf) property.
* @see visible
* @see isRequired
*/
get readOnly(): boolean;
set readOnly(val: boolean);
get hasOther(): boolean;
set hasOther(val: boolean);
/**
* A Boolean expression. If it evaluates to `false`, this column becomes hidden.
*
* Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).
* @see visible
*/
get visibleIf(): string;
set visibleIf(val: string);
/**
* A Boolean expression. If it evaluates to `false`, this column becomes read-only.
*
* Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).
* @see readOnly
*/
get enableIf(): string;
set enableIf(val: string);
/**
* A Boolean expression. If it evaluates to `true`, this column becomes required.
*
* Refer to the following help topic for more information: [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#conditional-visibility).
* @see isRequired
*/
get requiredIf(): string;
set requiredIf(val: string);
/**
* A Boolean expression. If it evaluates to `true`, all cells in this column are set to a value calculated using the [`defaultValueExpression`](#defaultValueExpression).
*
* [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle))
* @see setValueIf
*/
get resetValueIf(): string;
set resetValueIf(val: string);
/**
* An expression used to calculate the column's default value. This expression applies to all cells of this column until the cell value is specified by an end user or programmatically.
*
* [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle))
* @see setValueExpression
*/
get defaultValueExpression(): string;
set defaultValueExpression(val: string);
/**
* A Boolean expression. If it evaluates to `true`, all cells in this column are set to a value calculated using the [`setValueExpression`](#setValueExpression).
*
* [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle))
* @see resetValueIf
*/
get setValueIf(): string;
set setValueIf(val: string);
/**
* An expression used to calculate a value for all column cells.
*
* You can use `setValueExpression` as a standalone property or in conjunction with the [`setValueIf`](#setValueIf) expression, in which case the calculated cell value applies only when `setValueIf` evaluates to `true`.
*
* [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle))
* @see defaultValueExpression
* @see resetValueIf
*/
get setValueExpression(): string;
set setValueExpression(val: string);
/**
* Specifies whether a respondent is required to provide a unique response for each question within this column.
*
* Default value: `false`
*/
get isUnique(): boolean;
set isUnique(val: boolean);
/**
* Specifies whether to create an individual column for each choice option. Applies only to columns of `"checkbox"` or `"radiogroup"` [`cellType`](#cellType).
*/
get showInMultipleColumns(): boolean;
set showInMultipleColumns(val: boolean);
get isSupportMultipleColumns(): boolean;
get isShowInMultipleColumns(): boolean;
/**
* Column validators.
*
* [Data Validation](https://surveyjs.io/form-library/documentation/data-validation (linkStyle))
* @see isRequired
*/
get validators(): Array;
set validators(val: Array);
/**
* An aggregation method used to calculate the column total.
*
* Possible values:
*
* - `"none"` (default) - Disables total calculations.
* - `"sum"`
* - `"count"`
* - `"min"`
* - `"max"`
* - `"avg"`
*
* [View Demo](https://surveyjs.io/form-library/examples/aggregate-data-within-form/ (linkStyle))
* @see totalFormat
* @see totalDisplayStyle
*/
get totalType(): string;
set totalType(val: string);
/**
* An expression used to calculate total values. Overrides the [`totalType`](#totalType) property.
*
* [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle))
*/
get totalExpression(): string;
set totalExpression(val: string);
get hasTotal(): boolean;
/**
* A string pattern used to display column totals. To reference a total value within this pattern, use the `{0}` placeholder.
*
* [View Demo](https://surveyjs.io/form-library/examples/aggregate-data-within-form/ (linkStyle))
* @see totalType
* @see totalDisplayStyle
*/
get totalFormat(): string;
set totalFormat(val: string);
get locTotalFormat(): LocalizableString;
get cellHint(): string;
set cellHint(val: string);
get locCellHint(): LocalizableString;
get renderAs(): string;
set renderAs(val: string);
get totalMaximumFractionDigits(): number;
set totalMaximumFractionDigits(val: number);
get totalMinimumFractionDigits(): number;
set totalMinimumFractionDigits(val: number);
/**
* A format for calculated total values.
*
* Possible values:
*
* - `"none"` (default)
* - `"decimal"`
* - `"currency"`
* - `"percent"`
*
* [View Demo](https://surveyjs.io/form-library/examples/aggregate-data-within-form/ (linkStyle))
* @see totalType
* @see totalFormat
* @see totalCurrency
*/
get totalDisplayStyle(): string;
set totalDisplayStyle(val: string);
/**
* An alignment for calculated total values.
*
* Possible values:
*
* - `"left"`
* - `"center"`
* - `"right"`
* - `"auto"` (default) - Applies one of the values above based on the column's [cell type](#cellType).
*
* [View Demo](https://surveyjs.io/form-library/examples/aggregate-data-within-form/ (linkStyle))
* @see totalType
* @see totalFormat
* @see totalCurrency
* @see totalDisplayStyle
*/
get totalAlignment(): string;
set totalAlignment(val: string);
/**
* Specifies a currency used to display calculated total values. Applies only if [`totalDisplayStyle`](#totalDisplayStyle) is set to `"currency"`.
* @see totalType
*/
get totalCurrency(): string;
set totalCurrency(val: string);
/**
* Gets or sets minimum column width in CSS values. By default, the matrix calculates column widths to optimally fit the content of all columns.
* @see width
*/
get minWidth(): string;
set minWidth(val: string);
/**
* Gets or sets column width in CSS values. By default, the matrix calculates column widths to optimally fit the content of all columns.
* @see minWidth
*/
get width(): string;
set width(val: string);
/**
* Gets or sets the number of columns used to arrange choice options. Applies only to columns of `"checkbox"` or `"radiogroup"` [`cellType`](#cellType).
*
* Default value: -1 (inherits the actual value from the parent matrix's [`columnColCount`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list#columnColCount) property)
*/
get colCount(): number;
set colCount(val: number);
getLocale(): string;
getMarkdownHtml(text: string, name: string): string;
getRenderer(name: string): string;
getRendererContext(locStr: LocalizableString): any;
getProcessedText(text: string): string;
createCellQuestion(row: MatrixDropdownRowModelBase): Question;
startLoadingFromJson(json?: any): void;
updateCellQuestion(cellQuestion: Question, data: any, onUpdateJson?: (json: any) => any): void;
private callOnCellQuestionUpdate;
defaultCellTypeChanged(): void;
protected calcCellQuestionType(row: MatrixDropdownRowModelBase): string;
private getDefaultCellQuestionType;
protected updateTemplateQuestion(newCellType?: string, name?: string, title?: string): void;
protected createNewQuestion(cellType: string): Question;
private setParentQuestionToTemplate;
private previousChoicesId;
protected setQuestionProperties(question: Question, onUpdateJson?: (json: any) => any): void;
protected propertyValueChanged(name: string, oldValue: any, newValue: any, arrayChanges?: ArrayChanges, target?: Base): void;
private doItemValuePropertyChanged;
private doShowInMultipleColumnsChanged;
private doColumnVisibilityChanged;
private getProperties;
private removeProperties;
private addProperties;
}
}
declare module "packages/survey-core/src/dragdrop/engine" {
export interface IDragDropEngine {
dragInit(event: PointerEvent, draggedElement: any, parentElement: any, draggedElementNode: HTMLElement): void;
dragOver(event: PointerEvent): void;
drop(): void;
clear(): void;
}
}
declare module "packages/survey-core/src/utils/devices" {
export const IsMobile: boolean;
export var mouseInfo: {
readonly isTouch: boolean;
readonly hasTouchEvent: boolean;
hasMouse: boolean;
};
export let IsTouch: boolean;
export function _setIsTouch(val: boolean): void;
export type MatchMediaMethod = ((query: string) => {
matches: boolean;
} | null) | null;
export function detectMouseSupport(matchMedia: MatchMediaMethod): boolean;
}
declare module "packages/survey-core/src/dragdrop/dom-adapter" {
import { IDragDropEngine } from "packages/survey-core/src/dragdrop/engine";
export interface IDragDropDOMAdapter {
startDrag(event: PointerEvent, draggedElement: any, parentElement: any, draggedElementNode: HTMLElement, preventSaveTargetNode: boolean): void;
draggedElementShortcut: HTMLElement;
rootContainer: HTMLElement;
documentOrShadowRoot: Document | ShadowRoot;
rootElement?: HTMLElement;
}
export class DragDropDOMAdapter implements IDragDropDOMAdapter {
private dd;
private longTap;
private fitToContainer;
static PreventScrolling: boolean;
private timeoutID;
private startX;
private startY;
private currentX;
private currentY;
private savedTargetNode;
private savedTargetNodeParent;
private savedTargetNodeIndex;
private scrollIntervalId;
constructor(dd: IDragDropEngine, longTap?: boolean, fitToContainer?: boolean);
get documentOrShadowRoot(): Document | ShadowRoot;
get rootElement(): any;
private stopLongTapIfMoveEnough;
private get isMicroMovement();
private stopLongTap;
private startLongTapProcessing;
private handlePointerCancel;
private handleEscapeButton;
private onContextMenu;
private moveShortcutElement;
private getShortcutBottomCoordinate;
private getShortcutRightCoordinate;
protected requestAnimationFrame(callback: any): number;
protected scrollByDrag(scrollableParentNode: HTMLElement, clientY: number, clientX: number): void;
private doScroll;
private dragOver;
private clear;
private drop;
private doStartDrag;
private returnUserSelectBack;
draggedElementShortcut: any;
rootContainer: HTMLElement;
startDrag(event: PointerEvent, draggedElement: any, parentElement?: any, draggedElementNode?: HTMLElement, preventSaveTargetNode?: boolean): void;
private getNodeIndexInParent;
private insertNodeToParentAtIndex;
}
}
declare module "packages/survey-core/src/dragdrop/core" {
import { SurveyModel } from "packages/survey-core/src/survey";
import { EventBase } from "packages/survey-core/src/base";
import { IShortcutText, ISurvey } from "packages/survey-core/src/base-interfaces";
import { IDragDropEngine } from "packages/survey-core/src/dragdrop/engine";
import { IDragDropDOMAdapter } from "packages/survey-core/src/dragdrop/dom-adapter";
export abstract class DragDropCore implements IDragDropEngine {
private surveyValue?;
private creator?;
private _isBottom;
get isBottom(): boolean;
set isBottom(val: boolean);
onGhostPositionChanged: EventBase<{}>;
protected ghostPositionChanged(): void;
onDragStart: EventBase>;
onDragEnd: EventBase>;
onDragClear: EventBase>;
onBeforeDrop: EventBase, any>;
onAfterDrop: EventBase, any>;
draggedElement: any;
protected abstract get draggedElementType(): string;
protected parentElement: T;
dropTarget: any;
protected get dropTargetDataAttributeName(): string;
protected get survey(): SurveyModel;
prevDropTarget: any;
protected allowDropHere: boolean;
protected domAdapter: IDragDropDOMAdapter;
constructor(surveyValue?: ISurvey, creator?: any, longTap?: boolean, domAdapter?: IDragDropDOMAdapter);
startDrag(event: PointerEvent, draggedElement: any, parentElement?: any, draggedElementNode?: HTMLElement, preventSaveTargetNode?: boolean): void;
private getRootElement;
dragInit(event: PointerEvent, draggedElement: any, parentElement?: any, draggedElementNode?: HTMLElement): void;
protected onStartDrag(event?: PointerEvent): void;
protected isDropTargetDoesntChanged(newIsBottom: boolean): boolean;
protected getShortcutText(draggedElement: IShortcutText): string;
protected createDraggedElementShortcut(text: string, draggedElementNode?: HTMLElement, event?: PointerEvent): HTMLElement;
protected getDraggedElementClass(): string;
protected doDragOver(): void;
protected afterDragOver(dropTargetNode: HTMLElement): void;
protected abstract isDropTargetValid(dropTarget: any, dropTargetNode?: HTMLElement): boolean;
protected banDropHere: () => void;
protected doBanDropHere: () => void;
protected findDropTargetNodeFromPoint(clientX: number, clientY: number): HTMLElement;
protected getDataAttributeValueByNode(node: HTMLElement): string;
protected getDropTargetByNode(dropTargetNode: HTMLElement, event: PointerEvent): any;
private capitalizeFirstLetter;
protected abstract getDropTargetByDataAttributeValue(dataAttributeValue: string, dropTargetNode?: HTMLElement, event?: PointerEvent): any;
protected calculateVerticalMiddleOfHTMLElement(HTMLElement: HTMLElement): number;
protected calculateHorizontalMiddleOfHTMLElement(HTMLElement: HTMLElement): number;
protected calculateIsBottom(clientY: number, dropTargetNode?: HTMLElement): boolean;
protected findDropTargetNodeByDragOverNode(dragOverNode: HTMLElement): HTMLElement;
dragOver(event: PointerEvent): void;
protected abstract doDrop(): any;
drop(): void;
clear(): void;
}
}
declare module "packages/survey-core/src/dragdrop/matrix-rows" {
import { MatrixDropdownRowModelBase } from "packages/survey-core/src/question_matrixdropdownbase";
import { QuestionMatrixDynamicModel, MatrixDynamicRowModel } from "packages/survey-core/src/question_matrixdynamic";
import { DragDropCore } from "packages/survey-core/src/dragdrop/core";
export class DragDropMatrixRows extends DragDropCore {
protected get draggedElementType(): string;
protected restoreUserSelectValue: string;
protected onStartDrag(): void;
private get shortcutClass();
protected createDraggedElementShortcut(text: string, draggedElementNode: HTMLElement, event: PointerEvent): HTMLElement;
private fromIndex;
private toIndex;
protected getDropTargetByDataAttributeValue(dataAttributeValue: any): MatrixDropdownRowModelBase;
canInsertIntoThisRow(row: MatrixDynamicRowModel): boolean;
protected isDropTargetValid(dropTarget: any, dropTargetNode?: HTMLElement): boolean;
protected calculateIsBottom(clientY: number): boolean;
protected afterDragOver(dropTargetNode: HTMLElement): void;
protected doDrop: () => QuestionMatrixDynamicModel;
clear(): void;
}
}
declare module "packages/survey-core/src/question_matrixdropdownrendered" {
import { Question } from "packages/survey-core/src/question";
import { Base } from "packages/survey-core/src/base";
import { ItemValue } from "packages/survey-core/src/itemvalue";
import { LocalizableString } from "packages/survey-core/src/localizablestring";
import { PanelModel } from "packages/survey-core/src/panel";
import { IAction } from "packages/survey-core/src/actions/action";
import { MatrixDropdownColumn } from "packages/survey-core/src/question_matrixdropdowncolumn";
import { MatrixDropdownCell, MatrixDropdownRowModelBase, QuestionMatrixDropdownModelBase } from "packages/survey-core/src/question_matrixdropdownbase";
export class QuestionMatrixDropdownRenderedCell {
private static counter;
private idValue;
private itemValue;
minWidth: string;
width: string;
locTitle: LocalizableString;
cell: MatrixDropdownCell;
column: MatrixDropdownColumn;
row: MatrixDropdownRowModelBase;
question: Question;
isRemoveRow: boolean;
choiceIndex: number;
isOtherChoice: boolean;
matrix: QuestionMatrixDropdownModelBase;
isEmpty: boolean;
colSpans: number;
panel: PanelModel;
isShowHideDetail: boolean;
isActionsCell: boolean;
isErrorsCell: boolean;
isDragHandlerCell: boolean;
isDetailRowCell: boolean;
private classNameValue;
constructor();
get requiredText(): string;
get hasQuestion(): boolean;
get hasTitle(): boolean;
get hasPanel(): boolean;
get id(): string;
get item(): ItemValue;
set item(val: ItemValue);
get isChoice(): boolean;
get isItemChoice(): boolean;
get choiceValue(): any;
get isCheckbox(): boolean;
get isRadio(): boolean;
get isFirstChoice(): boolean;
set className(val: string);
get className(): string;
get cellQuestionWrapperClassName(): string;
get isVisible(): boolean;
get showResponsiveTitle(): boolean;
get responsiveTitleCss(): string;
get responsiveLocTitle(): LocalizableString;
get headers(): string;
getTitle(): string;
calculateFinalClassName(matrixCssClasses: any): string;
focusIn(): void;
}
export class QuestionMatrixDropdownRenderedRow extends Base {
cssClasses: any;
isDetailRow: boolean;
isGhostRow: boolean;
isAdditionalClasses: boolean;
visible: boolean;
onVisibilityChangedCallback: () => void;
hasEndActions: boolean;
row: MatrixDropdownRowModelBase;
isErrorsRow: boolean;
private static counter;
private idValue;
cells: Array;
constructor(cssClasses: any, isDetailRow?: boolean);
get id(): string;
get attributes(): {
"data-sv-drop-target-matrix-row"?: undefined;
} | {
"data-sv-drop-target-matrix-row": string;
};
get className(): string;
private rootElement;
setRootElement(val: HTMLTableRowElement): void;
getRootElement(): HTMLTableRowElement;
focusCell(cellIndex: number): void;
}
export class QuestionMatrixDropdownRenderedErrorRow extends QuestionMatrixDropdownRenderedRow {
isErrorsRow: boolean;
constructor(cssClasses: any);
get attributes(): {};
get className(): string;
onAfterCreated(): void;
}
export class QuestionMatrixDropdownRenderedTable extends Base {
matrix: QuestionMatrixDropdownModelBase;
private headerRowValue;
private footerRowValue;
private hasRemoveRowsValue;
private rowsActions;
private cssClasses;
rows: Array;
protected getIsAnimationAllowed(): boolean;
private getRenderedRowsAnimationOptions;
private _renderedRows;
updateRenderedRows(): void;
private renderedRowsAnimation;
get renderedRows(): Array;
set renderedRows(val: Array);
constructor(matrix: QuestionMatrixDropdownModelBase);
get showTable(): boolean;
get showHeader(): boolean;
get showAddRow(): boolean;
get showAddRowOnTop(): boolean;
get showAddRowOnBottom(): boolean;
get showFooter(): boolean;
get hasFooter(): boolean;
get hasRemoveRows(): boolean;
private isRequireResetValue;
isRequireReset(): boolean;
requireReset(): void;
get headerRow(): QuestionMatrixDropdownRenderedRow;
get footerRow(): QuestionMatrixDropdownRenderedRow;
get isRowsDragAndDrop(): boolean;
private get showCellErrorsTop();
private get showCellErrorsBottom();
protected build(): void;
updateShowTableAndAddRow(): void;
onAddedRow(row: MatrixDropdownRowModelBase, index: number): void;
private getRenderedRowIndexByIndex;
private getRenderedDataRowCount;
onRemovedRow(row: MatrixDropdownRowModelBase): void;
onDetailPanelChangeVisibility(row: MatrixDropdownRowModelBase, isShowing: boolean): void;
focusActionCell(row: MatrixDropdownRowModelBase, actionCellIndex: number): void;
private getRenderedRowIndex;
protected buildRowsActions(): void;
protected createRenderedRow(cssClasses: any, isDetailRow?: boolean): QuestionMatrixDropdownRenderedRow;
protected createErrorRenderedRow(cssClasses: any): QuestionMatrixDropdownRenderedErrorRow;
protected buildHeader(): void;
protected buildFooter(): void;
protected buildRows(): void;
private hasActionCellInRowsValues;
private hasActionCellInRows;
private hasActionsCellInLocaltion;
private canRemoveRow;
private buildHorizontalRows;
private addHorizontalRow;
private getRowDragCell;
private getActionsCellClassName;
private getRowActionsCell;
private getRowActions;
private buildRowActions;
private get showRemoveButtonAsIcon();
protected setDefaultRowActions(row: MatrixDropdownRowModelBase, actions: Array