Skip to content

Instantly share code, notes, and snippets.

@wroge
Last active June 2, 2020 09:51
Show Gist options
  • Select an option

  • Save wroge/7cabe0d7e4b5f09be75453950aadf860 to your computer and use it in GitHub Desktop.

Select an option

Save wroge/7cabe0d7e4b5f09be75453950aadf860 to your computer and use it in GitHub Desktop.
SurveyJS Cuelang Definition
#Schema: {
data?: {[string]: #Any}
allowCompleteAutomatic?: bool
calculatedValues?: [...#CalculatedValue]
checkErrorsMode?: "onNextPage" | "onValueChanged" | "onComplete"
clearInvisibleValues?: "none" | "onHidden" | "onComplete"
clearValueOnDisableItems?: bool
clientId?: string
commentPrefix?: string
completedBeforeHtml?: string | #LocaleString
completedHtml?: string | #LocaleString
completedHtmlOnCondition?: [...#HtmlConditionItem]
completeText?: string | #LocaleString
cookieName?: string
currentPage?: string
currentPageNo?: >=0
description?: string | #LocaleString
firstPageIsStarted?: bool
focusFirstQuestionAutomatic?: bool
focusOnFirstError?: bool
goNextPageAutomatic?: bool | "autogonext"
loadingHtml?: string | #LocaleString
locale?: #Locale
logo?: string
logoFit?: "contain" | "none" | "cover" | "fill"
logoHeight?: >=0
logoPosition?: "none" | "left" | "right" | "top" | "bottom"
logoWidth?: >=0
maxOthersLength?: >=0
maxTextLength?: >=0
maxTimeToFinish?: >=0
maxTimeToFinishPage?: >=0
mode?: "edit" | "display"
navigateToUrl?: string
navigateToUrlOnCondition?: [...#UrlConditionItem]
pageNextText?: string | #LocaleString
pagePrevText?: string | #LocaleString
pages?: [...#Page]
progressBarType?: "pages" | "questions" | "correctQuestions"
questionDescriptionLocation?: "underInput" | "underTitle"
questionErrorLocation?: "top" | "bottom"
questionsOnPageMode?: "singlePage" | "standard" | "questionPerPage"
questionsOrder?: "initial" | "random"
questionStartIndex?: string
questionTitleLocation?: "top" | "bottom" | "left"
questionTitlePattern?: "numRequireTitle" | "numTitleRequire" | "requireTitleNum" | "requireNumTitle" | "titleNumRequire" | "titleRequireNum"
requiredText?: string
sendResultOnPageNext?: bool
showCompletedPage?: bool
showInvisibleElements?: bool
showNavigationButtons?: "none" | "top" | "bottom" | "both"
showPageNumbers?: bool
showPageTitles?: bool
showPrevButton?: bool
showProgressBar?: "off" | "top" | "bottom" | "both"
showQuestionNumbers?: "on" | "onPage" | "off"
showTimerPanel?: "none" | "top" | "bottom"
showTimerPanelMode?: "all" | "page" | ""
showTitle?: bool
startText?: string | #LocaleString
storeOthersAsComment?: bool
textUpdateMode?: "onBlur" | "onTyping"
title?: string | #LocaleString
triggers?: [...#Trigger]
}
#Any: #Scalar | [...#Any] | {
[string]: #Any
}
#CalculatedValue: {
name: string
expression: #ExpressionString
includeIntoResult?: bool
}
#LocaleString: [#Locale]: string
#HtmlConditionItem: {
html: string
expression: #ExpressionString
}
#Locale: "default" | "ar" | "bg" | "ca" | "cz" | "da" | "de" | "en" | "es" | "fa" | "fi" | "fr" | "gr" | "he" | "hu" | "id" | "is" | "it" | "ja" | "ka" | "ko" | "lt" | "lv" | "nl" | "no" | "pl" | "pt" | "ro" | "ru" | "sv" | "tr" | "ua" | "zh-cn" | "zh-tw"
#UrlConditionItem: {
url: string
expression: #ExpressionString
}
#Page: {
maxTimeToFinish?: >=0
questionsOrder?: "default" | "initial" | "random"
navigationButtonsVisibility?: "inherit" | "show" | "hide"
#PanelModelBase
}
#Trigger: #SetValueTrigger | #CopyValueTrigger | #RunExpression
#Scalar: string | bool | number
#ExpressionString: string
#PanelModelBase: {
description?: string | #LocaleString
questionTitleLocation?: "default" | "top" | "bottom" | "left" | "hidden"
title?: string | #LocaleString
elements: [...#Element]
enableIf?: #ExpressionString
id?: string
isRequired?: bool
requiredErrorText?: string | #LocaleString
visible?: bool
visibleIf?: #ExpressionString
} | {
description?: string | #LocaleString
questionTitleLocation?: "default" | "top" | "bottom" | "left" | "hidden"
title?: string | #LocaleString
enableIf?: #ExpressionString
id?: string
isRequired?: bool
requiredErrorText?: string | #LocaleString
visible?: bool
visibleIf?: #ExpressionString
questions: [...#Question]
}
#SetValueTrigger: {
type: "setvalue"
setToName: string
setValue: #Any
}
#CopyValueTrigger: {
expression: #ExpressionString
type: "copyvalue"
setToName: string
fromName: string
}
#RunExpression: {
type: "runexpression"
runExpression: #ExpressionString
}
#Element: #MatrixDropdown | #Matrix | #MatrixDynamic | #Checkbox | #Radiogroup | #ImagePicker | #Dropdown | #Expression | #Text | #MultipleText | #PanelDynamic | #Panel | #Html | #Empty | #Comment | #File | #Rating | #Boolean
#Question: {
name: string
description?: string | #LocaleString
requiredText?: string
title?: string | #LocaleString
enableIf?: #ExpressionString
id?: string
isRequired?: bool
requiredErrorText?: string | #LocaleString
visible?: bool
visibleIf?: #ExpressionString
value?: #Any
comment?: string | #LocaleString
commentText?: string | #LocaleString
correctAnswer?: #Any
defaultValue?: #Any
descriptionLocation?: "default" | "underInput" | "underTitle"
fullTitle?: string | #LocaleString
hasComment?: bool
hideNumber?: bool
indent?: 0 | 1 | 2 | 3
renderWidth?: string
requiredIf?: #ExpressionString
rightIndent?: >=0
startWithNewLine?: bool
titleLocation?: "default" | "top" | "bottom" | "left" | "hidden"
useDisplayValuesInTitle?: bool
validators?: [...#Validator]
valueName?: string
width?: string
}
#MatrixDropdown: {
type: "matrixdropdown"
totalText?: string | #LocaleString
#MatrixDropdownBase
}
#Matrix: {
type: "matrix"
isAllRowRequired?: bool
rowsOrder?: "initial" | "random"
#QuestionMatrixBase
}
#MatrixDynamic: {
type: "matrixdynamic"
confirmDelete?: bool
keyName?: string
defaultRowValue?: #Scalar
defaultValueFromLastRow?: bool
rowCount?: uint8
minRowCount?: uint8
maxRowCount?: uint8
confirmDeleteText?: string | #LocaleString
keyDuplicationError?: string | #LocaleString
addRowText?: string | #LocaleString
addRowLocation?: "default" | "top" | "bottom" | "topBottom"
removeRowText?: string | #LocaleString
#MatrixDropdownBase
}
#Checkbox: {
type: "checkbox"
noneText?: string
selectAllText?: string | #LocaleString
hasSelectAll?: bool
hasNone?: bool
#QuestionCheckboxBase
}
#Radiogroup: {
type: "radiogroup"
showClearButton?: bool
#QuestionCheckboxBase
}
#ImagePicker: {
type: "imagepicker"
multiSelect?: bool
showLabel?: bool
imageHeight?: string
imageWidth?: string
imageFit?: "none" | "contain" | "cover" | "fill"
contentMode?: "image" | "video"
#QuestionCheckboxBase
}
#Dropdown: {
type: "dropdown"
showOptionsCaption?: bool
optionsCaption?: string
choicesMin?: uint8
choicesMax?: uint8
choicesStep?: uint8 | *1
#QuestionSelectBase
}
#Expression: {
expression?: #ExpressionString
type: "expression"
format?: string
maximumFractionDigits?: uint8
minimumFractionDigits?: uint8
displayStyle?: "none" | "decimal" | "currency" | "percent"
currency?: #Currency
useGrouping?: bool
#Question
}
#Text: {
type: "text"
inputType?: #InputType
max?: string
maxLength?: >=0
min?: string
placeHolder?: string
size?: uint8
step?: uint8
#Question
}
#MultipleText: {
type: "multipletext"
colCount?: 1 | 2 | 3 | 4 | 5
items?: [...#Text]
itemSize?: uint8
#Question
}
#PanelDynamic: {
showQuestionNumbers?: "off" | "onPanel" | "on"
type: "paneldynamic"
confirmDelete?: bool
keyName?: string
confirmDeleteText?: string | #LocaleString
keyDuplicationError?: string | #LocaleString
templateElements?: [...#Element]
templateTitle?: string | #LocaleString
templateDescription?: string | #LocaleString
panelPrevText?: string | #LocaleString
panelNextText?: string | #LocaleString
panelAddText?: string | #LocaleString
panelRemoveText?: string | #LocaleString
panelCount?: >=0
panelsState?: "default" | "collapsed" | "expanded" | "firstExpanded"
minPanelCount?: uint8
maxPanelCount?: uint8
allowAddPanel?: bool
allowRemovePanel?: bool
templateTitleLocation?: "default" | "top" | "bottom" | "left"
showRangeInProgress?: bool
renderMode?: "list" | "progressTop" | "progressBottom" | "progressTopBottom"
defaultPanelValue?: #Scalar
defaultValueFromLastPanel?: bool
#Question
}
#Panel: {
type: "panel"
indent?: 0 | 1 | 2 | 3
startWithNewLine?: bool
page?: #Page
state?: "default" | "collapsed" | "expanded"
innerIndent?: 0 | 1 | 2 | 3
#PanelModelBase
}
#Html: {
html?: string | #LocaleString
type: "html"
#Question
}
#Empty: {
type: "empty"
#Question
}
#Comment: {
type: "comment"
maxLength?: >=0
placeHolder?: string | #LocaleString
rows?: >=0
cols?: >=0
#Question
}
#File: {
type: "file"
imageHeight?: string
imageWidth?: string
showPreview?: bool
allowMultiple?: bool
acceptedTypes?: string
storeDataAsText?: bool
waitForUpload?: bool
allowImagesPreview?: bool
maxSize?: >=0
#Question
}
#Rating: {
type: "rating"
rateValues?: [...#Item | string]
rateMin?: uint8
rateMax?: uint8
rateStep?: uint8
minRateDescription?: string | #LocaleString
maxRateDescription?: string | #LocaleString
#Question
}
#Boolean: {
showTitle?: bool
type: "boolean"
defaultValue?: bool | "indeterminate"
label?: string | #LocaleString
valueTrue?: #Scalar
valueFalse?: #Scalar
#Question
}
#Validator: #NumericValidator | #TextValidator | #RegexValidator | #ExpressionValidator | #AnswerCountValidator
#MatrixDropdownBase: {
optionsCaption?: string
choices?: [...#Item | string]
columnLayout?: "horizontal" | "vertical"
cellType?: "dropdown" | "checkbox" | "radiogroup" | "text" | "comment" | "boolean" | "expression"
columnColCount?: 0 | 1 | 2 | 3 | 4
columnMinWidth?: string
horizontalScroll?: bool
#QuestionMatrixBase
}
#QuestionMatrixBase: {
rows?: [...#Item | string]
showHeader?: bool
rowsVisibleIf?: string
columnsVisibleIf?: string
columns?: [...#Item | string]
#Question
}
#QuestionCheckboxBase: {
colCount?: >=0
#QuestionSelectBase
}
#QuestionSelectBase: {
storeOthersAsComment?: "default" | bool
choices?: [...#Item | string]
choicesEnableIf?: #ExpressionString
choicesOrder?: "none" | "asc" | "desc" | "random"
choicesVisibleIf?: #ExpressionString
otherErrorText?: string | #LocaleString
otherPlaceHolder?: string | #LocaleString
otherText?: string | #LocaleString
#Question
}
#Currency: "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"
#InputType: "color" | "date" | "datetime" | "datetime-local" | "email" | "month" | "number" | "password" | "range" | "tel" | "text" | "time" | "url" | "week"
#Item: {
text?: string | #LocaleString
value: #Any
}
#NumericValidator: {
type: "numericvalidator"
minValue?: >=0
maxValue?: >=0
}
#TextValidator: {
type: "textvalidator"
maxLength?: uint8
minLength?: uint8
allowDigits?: bool
}
#RegexValidator: {
type: "regexvalidator"
regex?: string
}
#ExpressionValidator: {
expression?: #ExpressionString
type: "expressionvalidator"
}
#AnswerCountValidator: {
type: "answercountvalidator"
minCount?: uint8
maxCount?: uint8
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment