UNPKG

survey-core

Version:

A framework-independent core of the SurveyJS Form Library that works with rendering packages. Use it to integrate dynamic, interactive JSON-based forms and surveys into your app, collect user responses, and send them to your own database.

1,727 lines (1,726 loc) 131 kB
{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "SurveyJS Library json schema", "type": "object", "properties": { "sjsVersion": { "type": "string" }, "pages": { "type": "array", "items": { "$href": "#page" } }, "fitToContainer": { "type": "boolean" }, "headerView": { "type": [ "boolean", "string" ], "enum": [ "basic", "advanced" ] }, "showBrandInfo": { "type": "boolean" }, "triggers": { "type": "array", "items": [ { "$href": "#visibletrigger" }, { "$href": "#completetrigger" }, { "$href": "#setvaluetrigger" }, { "$href": "#skiptrigger" }, { "$href": "#runexpressiontrigger" }, { "$href": "#copyvaluetrigger" } ] }, "calculatedValues": { "type": "array", "items": { "$href": "#calculatedvalue" } }, "surveyId": { "type": "string" }, "surveyPostId": { "type": "string" }, "cookieName": { "type": "string" }, "partialSendEnabled": { "type": "boolean" }, "sendResultOnPageNext": { "type": "boolean" }, "surveyShowDataSaving": { "type": "boolean" }, "autoFocusFirstQuestion": { "type": "boolean" }, "focusFirstQuestionAutomatic": { "type": "boolean" }, "autoFocusFirstError": { "type": "boolean" }, "focusOnFirstError": { "type": "boolean" }, "showNavigationButtons": { "type": [ "string", "numeric", "boolean" ] }, "navigationButtonsLocation": { "type": [ "string", "numeric", "boolean" ], "enum": [ "top", "bottom", "topBottom" ] }, "showPrevButton": { "type": "boolean" }, "showTOC": { "type": "boolean" }, "tocLocation": { "type": [ "boolean", "string" ], "enum": [ "left", "right" ] }, "showTitle": { "type": "boolean" }, "showPageTitles": { "type": "boolean" }, "showCompletePage": { "type": "boolean" }, "showCompletedPage": { "type": "boolean" }, "navigateToUrl": { "type": "string" }, "navigateToUrlOnCondition": { "type": "array", "items": { "$href": "#urlconditionitem" } }, "requiredMark": { "type": "string" }, "requiredText": { "type": "string" }, "questionStartIndex": { "type": "string" }, "storeOthersAsComment": { "type": "boolean" }, "maxTextLength": { "type": "number" }, "maxCommentLength": { "type": "number" }, "maxOthersLength": { "type": "number" }, "autoAdvanceEnabled": { "type": "boolean" }, "goNextPageAutomatic": { "type": "boolean" }, "autoAdvanceAllowComplete": { "type": "boolean" }, "allowCompleteSurveyAutomatic": { "type": "boolean" }, "checkErrorsMode": { "type": "string", "enum": [ "onNextPage", "onValueChanged", "onComplete" ] }, "validateVisitedEmptyFields": { "type": "boolean" }, "autoGrowComment": { "type": "boolean" }, "allowResizeComment": { "type": "boolean" }, "commentAreaRows": { "type": "number" }, "textUpdateMode": { "type": "string", "enum": [ "onBlur", "onTyping" ] }, "clearInvisibleValues": { "type": [ "string", "numeric", "boolean" ], "enum": [ "none", "onComplete", "onHidden", "onHiddenContainer" ] }, "locale": { "type": "string" }, "logo": { "type": "string" }, "logoWidth": { "type": [ "string", "numeric", "boolean" ] }, "logoHeight": { "type": [ "string", "numeric", "boolean" ] }, "logoPosition": { "type": "string", "enum": [ "none", "left", "right", "top", "bottom" ] }, "logoFit": { "type": "string", "enum": [ "none", "contain", "cover", "fill" ] }, "backgroundImage": { "type": "string" }, "backgroundImageFit": { "type": [ "boolean", "string" ], "enum": [ "auto", "contain", "cover" ] }, "backgroundImageAttachment": { "type": [ "boolean", "string" ], "enum": [ "scroll", "fixed" ] }, "backgroundOpacity": { "type": "number" }, "completedHtml": { "type": "string" }, "completedHtmlOnCondition": { "type": "array", "items": { "$href": "#htmlconditionitem" } }, "completedBeforeHtml": { "type": "string" }, "loadingHtml": { "type": "string" }, "startSurveyText": { "type": "string" }, "pagePrevText": { "type": "string" }, "pageNextText": { "type": "string" }, "completeText": { "type": "string" }, "previewText": { "type": "string" }, "editText": { "type": "string" }, "questionTitlePattern": { "type": "string" }, "questionTitleTemplate": { "type": "string" }, "showPageNumbers": { "type": "boolean" }, "showQuestionNumbers": { "type": [ "boolean", "string" ], "enum": [ "on", "onPage", "recursive", "off" ] }, "showProgressBar": { "type": "boolean" }, "progressBarLocation": { "type": "string", "enum": [ "auto", "aboveheader", "belowheader", "bottom", "topbottom" ] }, "progressBarType": { "type": "string", "enum": [ "pages", "questions", "requiredQuestions", "correctQuestions" ] }, "progressBarShowPageTitles": { "type": "boolean" }, "progressBarShowPageNumbers": { "type": "boolean" }, "progressBarInheritWidthFrom": { "type": [ "boolean", "string" ], "enum": [ "container", "survey" ] }, "questionTitleLocation": { "type": "string", "enum": [ "top", "bottom", "left" ] }, "questionErrorLocation": { "type": "string", "enum": [ "top", "bottom" ] }, "questionDescriptionLocation": { "type": "string", "enum": [ "underInput", "underTitle" ] }, "mode": { "type": "string" }, "readOnly": { "type": "boolean" }, "matrixDragHandleArea": { "type": "string", "enum": [ "entireItem", "icon" ] }, "questionOrder": { "type": "string", "enum": [ "initial", "random" ] }, "questionsOrder": { "type": "string", "enum": [ "initial", "random" ] }, "isSinglePage": { "type": "boolean" }, "questionsOnPageMode": { "type": "string", "enum": [ "standard", "singlePage", "questionPerPage", "inputPerPage" ] }, "firstPageIsStartPage": { "type": "boolean" }, "firstPageIsStarted": { "type": "boolean" }, "showPreviewBeforeComplete": { "type": [ "string", "numeric", "boolean" ] }, "previewMode": { "type": "string", "enum": [ "allQuestions", "answeredQuestions" ] }, "showTimerPanel": { "type": "string" }, "showTimer": { "type": "boolean" }, "timerLocation": { "type": "string", "enum": [ "top", "bottom" ] }, "timerInfoMode": { "type": "string", "enum": [ "page", "survey", "combined" ] }, "showTimerPanelMode": { "type": "string", "enum": [ "page", "survey", "combined" ] }, "gridLayoutEnabled": { "type": "boolean" }, "widthMode": { "type": "string", "enum": [ "auto", "static", "responsive" ] }, "width": { "type": "string" }, "timeLimit": { "type": "number" }, "maxTimeToFinish": { "type": "number" }, "timeLimitPerPage": { "type": "number" }, "maxTimeToFinishPage": { "type": "number" } }, "definitions": { "page": { "$id": "#page", "type": "object", "allOff": [ { "$ref": "#panel" }, { "properties": { "navigationTitle": { "type": "string" }, "navigationDescription": { "type": "string" }, "navigationButtonsVisibility": { "type": "string" }, "showNavigationButtons": { "type": [ "boolean", "string" ] }, "timeLimit": { "type": "number" }, "maxTimeToFinish": { "type": "number" }, "page": { "type": "IPage" }, "showNumber": { "type": "boolean" }, "showQuestionNumbers": { "type": "string", "enum": [ "default", "onpanel", "recursive", "off" ] }, "innerIndent": { "type": "number", "enum": [ 0, 1, 2, 3 ] }, "startWithNewLine": { "type": "boolean" } } } ] }, "panel": { "$id": "#panel", "type": "object", "allOff": [ { "$ref": "#panelbase" }, { "properties": { "page": { "type": "IPage" }, "showNumber": { "type": "boolean" }, "showQuestionNumbers": { "type": "string", "enum": [ "default", "onpanel", "recursive", "off" ] }, "innerIndent": { "type": "number", "enum": [ 0, 1, 2, 3 ] }, "startWithNewLine": { "type": "boolean" }, "allowAdaptiveActions": { "type": "boolean" } } } ] }, "panelbase": { "$id": "#panelbase", "type": "object", "properties": { "gridLayoutColumns": { "type": "array", "items": "PanelLayoutColumnModel" }, "questionOrder": { "type": "string", "enum": [ "default", "initial", "random" ] }, "questionsOrder": { "type": "string", "enum": [ "default", "initial", "random" ] }, "visibleIf": { "type": "string" }, "questions": { "type": "array", "items": [ { "$href": "#tagbox" }, { "$href": "#ranking" }, { "$href": "#imagepicker" }, { "$href": "#radiogroup" }, { "$href": "#buttongroup" }, { "$href": "#dropdown" }, { "$href": "#paneldynamic" }, { "$href": "#file" }, { "$href": "#signaturepad" }, { "$href": "#expression" }, { "$href": "#text" }, { "$href": "#comment" }, { "$href": "#multipletext" }, { "$href": "#matrixdynamic" }, { "$href": "#matrixdropdown" }, { "$href": "#matrix" }, { "$href": "#html" }, { "$href": "#image" }, { "$href": "#empty" }, { "$href": "#rating" }, { "$href": "#slider" }, { "$href": "#boolean" } ] }, "elements": { "type": "array", "items": [ { "$href": "#page" }, { "$href": "#flowpanel" }, { "$href": "#tagbox" }, { "$href": "#ranking" }, { "$href": "#imagepicker" }, { "$href": "#radiogroup" }, { "$href": "#buttongroup" }, { "$href": "#dropdown" }, { "$href": "#paneldynamic" }, { "$href": "#file" }, { "$href": "#signaturepad" }, { "$href": "#expression" }, { "$href": "#text" }, { "$href": "#comment" }, { "$href": "#multipletext" }, { "$href": "#matrixdynamic" }, { "$href": "#matrixdropdown" }, { "$href": "#matrix" }, { "$href": "#html" }, { "$href": "#image" }, { "$href": "#empty" }, { "$href": "#rating" }, { "$href": "#slider" }, { "$href": "#boolean" } ] }, "requiredIf": { "type": "string" }, "questionTitleLocation": { "type": "string", "enum": [ "default", "top", "bottom", "left", "hidden" ] }, "questionTitleWidth": { "type": "string" }, "visible": { "type": "boolean" }, "enableIf": { "type": "string" }, "questionErrorLocation": { "type": "string", "enum": [ "default", "top", "bottom" ] } } }, "question": { "$id": "#question", "type": "object", "properties": { "valueName": { "type": "string" }, "page": { "type": "IPage" }, "visible": { "type": "boolean" }, "useDisplayValuesInDynamicTexts": { "type": "boolean" }, "visibleIf": { "type": "string" }, "showNumber": { "type": "boolean" }, "hideNumber": { "type": "boolean" }, "titleLocation": { "type": "string", "enum": [ "default", "top", "bottom", "left", "hidden" ] }, "errorLocation": { "type": "string", "enum": [ "default", "top", "bottom" ] }, "descriptionLocation": { "type": "string", "enum": [ "default", "underInput", "underTitle" ] }, "requiredErrorText": { "type": "string" }, "commentText": { "type": "string" }, "commentPlaceholder": { "type": "string" }, "commentPlaceHolder": { "type": "string" }, "defaultDisplayValue": { "type": "string" }, "startWithNewLine": { "type": "boolean" }, "isRequired": { "type": "boolean" }, "requiredIf": { "type": "string" }, "showCommentArea": { "type": "boolean" }, "hasComment": { "type": "boolean" }, "enableIf": { "type": "string" }, "clearIfInvisible": { "type": "string", "enum": [ "default", "none", "onComplete", "onHidden", "onHiddenContainer" ] }, "defaultValue": { "type": [ "string", "numeric", "boolean" ] }, "defaultValueExpression": { "type": [ "string", "numeric", "boolean" ] }, "resetValueIf": { "type": "string" }, "setValueIf": { "type": "string" }, "setValueExpression": { "type": "string" }, "correctAnswer": { "type": [ "string", "numeric", "boolean" ] }, "validators": { "type": "array", "items": [ { "$href": "#numericvalidator" }, { "$href": "#textvalidator" }, { "$href": "#answercountvalidator" }, { "$href": "#regexvalidator" }, { "$href": "#emailvalidator" }, { "$href": "#expressionvalidator" } ] }, "renderAs": { "type": "string" } } }, "numericvalidator": { "$id": "#numericvalidator", "type": "object", "properties": { "minValue": { "type": "number" }, "maxValue": { "type": "number" } } }, "textvalidator": { "$id": "#textvalidator", "type": "object", "properties": { "minLength": { "type": "number" }, "maxLength": { "type": "number" }, "allowDigits": { "type": "boolean" } } }, "answercountvalidator": { "$id": "#answercountvalidator", "type": "object", "properties": { "minCount": { "type": "number" }, "maxCount": { "type": "number" } } }, "regexvalidator": { "$id": "#regexvalidator", "type": "object", "properties": { "regex": { "type": "string" }, "caseInsensitive": { "type": "boolean" }, "insensitive": { "type": "boolean" } } }, "expressionvalidator": { "$id": "#expressionvalidator", "type": "object", "properties": { "expression": { "type": "string" } } }, "selectbase": { "$id": "#selectbase", "type": "object", "allOff": [ { "$ref": "#question" }, { "properties": { "showNoneItem": { "type": "boolean" }, "hasNone": { "type": "boolean" }, "noneText": { "type": "string" }, "showRefuseItem": { "type": "boolean" }, "refuseText": { "type": "string" }, "showDontKnowItem": { "type": "boolean" }, "dontKnowText": { "type": "string" }, "choicesVisibleIf": { "type": "string" }, "choicesEnableIf": { "type": "string" }, "choicesByUrl": { "type": { "$href": "#choicesByUrl" } }, "choices": { "type": "array", "items": "any" }, "choicesFromQuestion": { "type": "string" }, "choicesFromQuestionMode": { "type": "string", "enum": [ "all", "selected", "unselected" ] }, "choiceValuesFromQuestion": { "type": "string" }, "choiceTextsFromQuestion": { "type": "string" }, "hideIfChoicesEmpty": { "type": "boolean" }, "storeOthersAsComment": { "type": [ "string", "numeric", "boolean" ], "enum": [ "default", true, false ] }, "choicesOrder": { "type": "string", "enum": [ "none", "asc", "desc", "random" ] }, "otherText": { "type": "string" }, "separateSpecialChoices": { "type": "boolean" }, "otherPlaceholder": { "type": "string" }, "otherPlaceHolder": { "type": "string" }, "otherErrorText": { "type": "string" }, "showOtherItem": { "type": "boolean" }, "hasOther": { "type": "boolean" } } } ] }, "choicesByUrl": { "$id": "#choicesByUrl", "type": "object", "properties": { "url": { "type": "string" }, "path": { "type": "string" }, "valueName": { "type": "string" }, "titleName": { "type": "string" }, "imageLinkName": { "type": "string" }, "allowEmptyResponse": { "type": "boolean" }, "attachOriginalItems": { "type": "boolean" }, "attachData": { "type": "boolean" } } }, "visibletrigger": { "$id": "#visibletrigger", "type": "object", "properties": { "pages": { "type": "array", "items": "string" }, "questions": { "type": "array", "items": "string" } } }, "setvaluetrigger": { "$id": "#setvaluetrigger", "type": "object", "properties": { "setToName": { "type": "string" }, "setValue": { "type": [ "string", "numeric", "boolean" ] }, "isVariable": { "type": "boolean" } } }, "skiptrigger": { "$id": "#skiptrigger", "type": "object", "properties": { "gotoName": { "type": "string" } } }, "runexpressiontrigger": { "$id": "#runexpressiontrigger", "type": "object", "properties": { "setToName": { "type": "string" }, "runExpression": { "type": "string" } } }, "copyvaluetrigger": { "$id": "#copyvaluetrigger", "type": "object", "properties": { "setToName": { "type": "string" }, "fromName": { "type": "string" }, "copyDisplayValue": { "type": "boolean" } } }, "calculatedvalue": { "$id": "#calculatedvalue", "type": "object", "properties": { "name": { "type": "string" }, "includeIntoResult": { "type": "boolean" }, "expression": { "type": "string" } } }, "expressionitem": { "$id": "#expressionitem", "type": "object", "properties": { "expression": { "type": "string" } } }, "htmlconditionitem": { "$id": "#htmlconditionitem", "type": "object", "allOff": [ { "$ref": "#expressionitem" }, { "properties": { "html": { "type": "string" } } } ] }, "urlconditionitem": { "$id": "#urlconditionitem", "type": "object", "allOff": [ { "$ref": "#expressionitem" }, { "properties": { "url": { "type": "string" } } } ] }, "matrixdropdowncolumn": { "$id": "#matrixdropdowncolumn", "type": "object", "properties": { "cellType": { "type": "string", "enum": [ "default", "dropdown", "checkbox", "radiogroup", "tagbox", "text", "comment", "boolean", "expression", "rating", "slider" ] }, "visible": { "type": "boolean" }, "name": { "type": "string" }, "title": { "type": "string" }, "defaultDisplayValue": { "type": "string" }, "isRequired": { "type": "boolean" }, "requiredErrorText": { "type": "string" }, "readOnly": { "type": "boolean" }, "visibleIf": { "type": "string" }, "enableIf": { "type": "string" }, "requiredIf": { "type": "string" }, "resetValueIf": { "type": "string" }, "setValueIf": { "type": "string" }, "setValueExpression": { "type": "string" }, "isUnique": { "type": "boolean" }, "showInMultipleColumns": { "type": "boolean" }, "validators": { "type": "array", "items": [ { "$href": "#numericvalidator" }, { "$href": "#textvalidator" }, { "$href": "#answercountvalidator" }, { "$href": "#regexvalidator" }, { "$href": "#emailvalidator" }, { "$href": "#expressionvalidator" } ] }, "totalType": { "type": "string", "enum": [ "none", "sum", "count", "min", "max", "avg" ] }, "totalExpression": { "type": "string" }, "totalFormat": { "type": "string" }, "cellHint": { "type": "string" }, "renderAs": { "type": "string" }, "totalMaximumFractionDigits": { "type": "number" }, "totalMinimumFractionDigits": { "type": "number" }, "totalDisplayStyle": { "type": "string", "enum": [ "none", "decimal", "currency", "percent" ] }, "totalAlignment": { "type": "string", "enum": [ "auto", "left", "center", "right" ] }, "totalCurrency": { "type": "string", "enum": [ "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XTS", "XUA", "XXX", "YER", "ZAR", "ZMW", "ZWL" ] }, "minWidth": { "type": "string" }, "width": { "type": "string" }, "colCount": { "type": "number", "enum": [ -1, 0, 1, 2, 3, 4 ] } } }, "masksettings": { "$id": "#masksettings", "type": "object", "properties": { "saveMaskedValue": { "type": "boolean" } } }, "patternmask": { "$id": "#patternmask", "type": "object", "allOff": [ { "$ref": "#masksettings" }, { "properties": { "pattern": { "type": "string" } } } ] }, "datetimemask": { "$id": "#datetimemask", "type": "object", "allOff": [ { "$ref": "#patternmask" }, { "properties": { "min": { "type": "string" }, "max": { "type": "string" } } } ] }, "numericmask": { "$id": "#numericmask", "type": "object", "allOff": [ { "$ref": "#masksettings" }, { "properties": { "allowNegativeValues": { "type": "boolean" }, "decimalSeparator": { "type": "string" }, "precision": { "type": "number" }, "thousandsSeparator": { "type": "string" }, "min": { "type": "number" }, "max": { "type": "number" } } } ] }, "currencymask": { "$id": "#currencymask", "type": "object", "allOff": [ { "$ref": "#numericmask" }, {