survey-react 1.9.81 → 1.9.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/defaultV2.css +168 -137
- package/defaultV2.css.map +1 -1
- package/defaultV2.min.css +2 -2
- package/modern.css +63 -51
- package/modern.css.map +1 -1
- package/modern.min.css +2 -2
- package/package.json +1 -1
- package/survey.css +10 -6
- package/survey.css.map +1 -1
- package/survey.min.css +2 -2
- package/survey.react.d.ts +126 -104
- package/survey.react.js +329 -146
- package/survey.react.js.map +1 -1
- package/survey.react.min.js +3 -3
package/survey.react.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* surveyjs - Survey JavaScript library v1.9.
|
2
|
+
* surveyjs - Survey JavaScript library v1.9.82
|
3
3
|
* Copyright (c) 2015-2023 Devsoft Baltic OÜ - http://surveyjs.io/
|
4
4
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
5
5
|
*/
|
@@ -2859,6 +2859,8 @@ var Base = /** @class */ (function () {
|
|
2859
2859
|
this.localizableStrings = {};
|
2860
2860
|
}
|
2861
2861
|
this.localizableStrings[name] = locStr;
|
2862
|
+
var prop = this.getPropertyByName(name);
|
2863
|
+
locStr.disableLocalization = prop && prop.isLocalizable === false;
|
2862
2864
|
return locStr;
|
2863
2865
|
};
|
2864
2866
|
Base.prototype.getLocalizableString = function (name) {
|
@@ -5456,6 +5458,7 @@ var defaultStandardCss = {
|
|
5456
5458
|
rating: {
|
5457
5459
|
root: "sv_q_rating",
|
5458
5460
|
item: "sv_q_rating_item",
|
5461
|
+
itemFixedSize: "sv_q_rating_item_fixed",
|
5459
5462
|
selected: "active",
|
5460
5463
|
minText: "sv_q_rating_min_text",
|
5461
5464
|
itemText: "sv_q_rating_item_text",
|
@@ -6017,6 +6020,7 @@ var defaultV2Css = {
|
|
6017
6020
|
itemText: "sd-rating__item-text",
|
6018
6021
|
maxText: "sd-rating__item-text sd-rating__max-text",
|
6019
6022
|
itemDisabled: "sd-rating__item--disabled",
|
6023
|
+
itemFixedSize: "sd-rating__item--fixed-size",
|
6020
6024
|
control: "sd-input sd-dropdown",
|
6021
6025
|
controlValue: "sd-dropdown__value",
|
6022
6026
|
controlDisabled: "sd-input--disabled",
|
@@ -8175,6 +8179,9 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8175
8179
|
this.listModel.resetFocusedItem();
|
8176
8180
|
if (this.question.selectedItem && this.question.selectedItem.text.indexOf(newValue) >= 0) {
|
8177
8181
|
this.listModel.focusedItem = this.getAvailableItems().filter(function (item) { return item.id == _this.question.selectedItem.value; })[0];
|
8182
|
+
if (this.listModel.filterString) {
|
8183
|
+
this.listModel.actions.map(function (a) { return a.selectedValue = false; });
|
8184
|
+
}
|
8178
8185
|
return;
|
8179
8186
|
}
|
8180
8187
|
if (!this.listModel.focusedItem || !this.listModel.isItemVisible(this.listModel.focusedItem)) {
|
@@ -8189,6 +8196,7 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8189
8196
|
};
|
8190
8197
|
DropdownListModel.prototype.onHidePopup = function () {
|
8191
8198
|
this.resetFilterString();
|
8199
|
+
this.question.suggestedItem = null;
|
8192
8200
|
this.listModel.refresh();
|
8193
8201
|
};
|
8194
8202
|
DropdownListModel.prototype.getAvailableItems = function () {
|
@@ -8331,7 +8339,8 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8331
8339
|
});
|
8332
8340
|
Object.defineProperty(DropdownListModel.prototype, "showHintString", {
|
8333
8341
|
get: function () {
|
8334
|
-
return !!this.question.searchEnabled && this.hintStringLC && this.hintStringLC.indexOf(this.inputStringLC) >= 0
|
8342
|
+
return !!this.question.searchEnabled && this.hintStringLC && this.hintStringLC.indexOf(this.inputStringLC) >= 0 ||
|
8343
|
+
!this.question.searchEnabled && this.hintStringLC && !this.question.value;
|
8335
8344
|
},
|
8336
8345
|
enumerable: false,
|
8337
8346
|
configurable: true
|
@@ -8381,6 +8390,8 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8381
8390
|
};
|
8382
8391
|
DropdownListModel.prototype.onClick = function (event) {
|
8383
8392
|
this._popupModel.toggleVisibility();
|
8393
|
+
if (this._popupModel.isVisible && this.question.value && this.question instanceof _question_dropdown__WEBPACK_IMPORTED_MODULE_4__["QuestionDropdownModel"])
|
8394
|
+
this.changeSelectionWithKeyboard(false);
|
8384
8395
|
if (this.searchEnabled && !!event && !!event.target) {
|
8385
8396
|
var input = event.target.querySelector("input");
|
8386
8397
|
if (!!input) {
|
@@ -8403,14 +8414,20 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8403
8414
|
};
|
8404
8415
|
DropdownListModel.prototype.changeSelectionWithKeyboard = function (reverse) {
|
8405
8416
|
var _a;
|
8417
|
+
var focusedItem = this.listModel.focusedItem;
|
8406
8418
|
if (reverse) {
|
8407
8419
|
this.listModel.focusPrevVisibleItem();
|
8408
8420
|
}
|
8409
8421
|
else {
|
8410
8422
|
this.listModel.focusNextVisibleItem();
|
8411
8423
|
}
|
8424
|
+
if (this.question.value && focusedItem && this.question instanceof _question_dropdown__WEBPACK_IMPORTED_MODULE_4__["QuestionDropdownModel"]) {
|
8425
|
+
focusedItem.selectedValue = false;
|
8426
|
+
this.listModel.focusedItem.selectedValue = !this.listModel.filterString;
|
8427
|
+
this.question.suggestedItem = this.listModel.focusedItem;
|
8428
|
+
}
|
8412
8429
|
this.scrollToFocusedItem();
|
8413
|
-
if (this.question.value && this.question.searchEnabled && this.question instanceof _question_dropdown__WEBPACK_IMPORTED_MODULE_4__["QuestionDropdownModel"]) {
|
8430
|
+
if (this.question.value && !this.listModel.filterString && this.question.searchEnabled && this.question instanceof _question_dropdown__WEBPACK_IMPORTED_MODULE_4__["QuestionDropdownModel"]) {
|
8414
8431
|
this.applyInputString(this.listModel.focusedItem);
|
8415
8432
|
}
|
8416
8433
|
else {
|
@@ -9515,7 +9532,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
9515
9532
|
// import "../../main.scss";
|
9516
9533
|
//import "../../modern.scss";
|
9517
9534
|
var Version;
|
9518
|
-
Version = "" + "1.9.
|
9535
|
+
Version = "" + "1.9.82";
|
9519
9536
|
function checkLibraryVersion(ver, libraryName) {
|
9520
9537
|
if (Version != ver) {
|
9521
9538
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
@@ -20024,6 +20041,9 @@ var LocalizableString = /** @class */ (function () {
|
|
20024
20041
|
return res;
|
20025
20042
|
};
|
20026
20043
|
LocalizableString.prototype.setLocaleText = function (loc, value) {
|
20044
|
+
if (this.disableLocalization) {
|
20045
|
+
loc = _settings__WEBPACK_IMPORTED_MODULE_2__["settings"].defaultLocaleName;
|
20046
|
+
}
|
20027
20047
|
if (!this.storeDefaultText && value == this.getLocaleTextWithDefault(loc)) {
|
20028
20048
|
if (!!value || !!loc && loc !== this.defaultLoc)
|
20029
20049
|
return;
|
@@ -20031,7 +20051,7 @@ var LocalizableString = /** @class */ (function () {
|
|
20031
20051
|
var oldValue_1 = this.getValue(dl);
|
20032
20052
|
if (!!dl && !!oldValue_1) {
|
20033
20053
|
this.setValue(dl, value);
|
20034
|
-
this.fireStrChanged(
|
20054
|
+
this.fireStrChanged(dl, oldValue_1);
|
20035
20055
|
}
|
20036
20056
|
return;
|
20037
20057
|
}
|
@@ -20042,11 +20062,9 @@ var LocalizableString = /** @class */ (function () {
|
|
20042
20062
|
!this.getValue(loc) &&
|
20043
20063
|
value == this.getLocaleText(this.defaultLoc))
|
20044
20064
|
return;
|
20045
|
-
var curLoc = this.
|
20065
|
+
var curLoc = this.curLocale;
|
20046
20066
|
if (!loc)
|
20047
20067
|
loc = this.defaultLoc;
|
20048
|
-
if (!curLoc)
|
20049
|
-
curLoc = this.defaultLoc;
|
20050
20068
|
var oldValue = this.onStrChanged && loc === curLoc ? this.pureText : undefined;
|
20051
20069
|
delete this.htmlValues[loc];
|
20052
20070
|
if (!value) {
|
@@ -20066,8 +20084,15 @@ var LocalizableString = /** @class */ (function () {
|
|
20066
20084
|
}
|
20067
20085
|
}
|
20068
20086
|
}
|
20069
|
-
this.fireStrChanged(
|
20087
|
+
this.fireStrChanged(loc, oldValue);
|
20070
20088
|
};
|
20089
|
+
Object.defineProperty(LocalizableString.prototype, "curLocale", {
|
20090
|
+
get: function () {
|
20091
|
+
return !!this.locale ? this.locale : this.defaultLoc;
|
20092
|
+
},
|
20093
|
+
enumerable: false,
|
20094
|
+
configurable: true
|
20095
|
+
});
|
20071
20096
|
LocalizableString.prototype.canRemoveLocValue = function (loc, val) {
|
20072
20097
|
if (_settings__WEBPACK_IMPORTED_MODULE_2__["settings"].storeDuplicatedTranslations)
|
20073
20098
|
return false;
|
@@ -20084,9 +20109,12 @@ var LocalizableString = /** @class */ (function () {
|
|
20084
20109
|
return val == this.getLocaleText(this.defaultLoc);
|
20085
20110
|
}
|
20086
20111
|
};
|
20087
|
-
LocalizableString.prototype.fireStrChanged = function (
|
20112
|
+
LocalizableString.prototype.fireStrChanged = function (loc, oldValue) {
|
20088
20113
|
this.strChanged();
|
20089
|
-
if (
|
20114
|
+
if (!this.onStrChanged)
|
20115
|
+
return;
|
20116
|
+
var value = this.pureText;
|
20117
|
+
if (loc !== this.curLocale || oldValue !== value) {
|
20090
20118
|
this.onStrChanged(oldValue, value);
|
20091
20119
|
}
|
20092
20120
|
};
|
@@ -21871,12 +21899,12 @@ var germanSurveyStrings = {
|
|
21871
21899
|
confirmRemoveFile: "Sind Sie sicher, dass Sie diese Datei löschen möchten: {0}?",
|
21872
21900
|
confirmRemoveAllFiles: "Sind Sie sicher, dass Sie alle Dateien löschen möchten?",
|
21873
21901
|
questionTitlePatternText: "Fragentitel",
|
21874
|
-
modalCancelButtonText: "
|
21902
|
+
modalCancelButtonText: "Abbrechen",
|
21875
21903
|
modalApplyButtonText: "Anwenden",
|
21876
21904
|
filterStringPlaceholder: "Tippe um zu suchen...",
|
21877
|
-
|
21905
|
+
emptyMessage: "Es gibt noch keine Daten.",
|
21878
21906
|
noEntriesText: "Es gibt noch keine Einträge.\nKlicken Sie auf die Schaltfläche unten, um einen neuen Eintrag hinzuzufügen.",
|
21879
|
-
|
21907
|
+
more: "Mehr"
|
21880
21908
|
};
|
21881
21909
|
survey_core__WEBPACK_IMPORTED_MODULE_0__["surveyLocalization"].locales["de"] = germanSurveyStrings;
|
21882
21910
|
survey_core__WEBPACK_IMPORTED_MODULE_0__["surveyLocalization"].localeNames["de"] = "deutsch";
|
@@ -26356,7 +26384,7 @@ var PageModel = /** @class */ (function (_super) {
|
|
26356
26384
|
/**
|
26357
26385
|
* A caption displayed on a navigation button in the TOC or progress bar. Applies when [`showTOC`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#showTOC) is `true` or when [`showProgressBar`](https://surveyjs.io/form-library/documentation/surveymodel#showProgressBar) is `true` and [`progressBarType`](https://surveyjs.io/form-library/documentation/surveymodel#progressBarType) is `"buttons"`.
|
26358
26386
|
*
|
26359
|
-
* If
|
26387
|
+
* If navigation titles are unspecified, the navigation buttons display page [titles](https://surveyjs.io/form-library/documentation/api-reference/page-model#title) or [names](https://surveyjs.io/form-library/documentation/pagemodel#name).
|
26360
26388
|
*/
|
26361
26389
|
get: function () {
|
26362
26390
|
return this.getLocalizableStringText("navigationTitle");
|
@@ -30150,6 +30178,11 @@ var PopupDropdownViewModel = /** @class */ (function (_super) {
|
|
30150
30178
|
var visualViewport = window.visualViewport;
|
30151
30179
|
document.documentElement.style.setProperty("--sv-popup-overlay-height", visualViewport.height * visualViewport.scale + "px");
|
30152
30180
|
};
|
30181
|
+
_this.resizeWindowCallback = function () {
|
30182
|
+
if (!_this.isOverlay) {
|
30183
|
+
_this.updatePosition(true, false);
|
30184
|
+
}
|
30185
|
+
};
|
30153
30186
|
_this.clientY = 0;
|
30154
30187
|
_this.isTablet = false;
|
30155
30188
|
_this.touchStartEventCallback = function (event) {
|
@@ -30260,6 +30293,7 @@ var PopupDropdownViewModel = /** @class */ (function (_super) {
|
|
30260
30293
|
this.updatePosition(true, false);
|
30261
30294
|
}
|
30262
30295
|
this.switchFocus();
|
30296
|
+
window.addEventListener("resize", this.resizeWindowCallback);
|
30263
30297
|
if (this.shouldCreateResizeCallback) {
|
30264
30298
|
window.visualViewport.addEventListener("resize", this.resizeEventCallback);
|
30265
30299
|
if (this.container) {
|
@@ -30295,6 +30329,7 @@ var PopupDropdownViewModel = /** @class */ (function (_super) {
|
|
30295
30329
|
};
|
30296
30330
|
PopupDropdownViewModel.prototype.updateOnHiding = function () {
|
30297
30331
|
_super.prototype.updateOnHiding.call(this);
|
30332
|
+
window.removeEventListener("resize", this.resizeWindowCallback);
|
30298
30333
|
if (this.shouldCreateResizeCallback) {
|
30299
30334
|
window.visualViewport.removeEventListener("resize", this.resizeEventCallback);
|
30300
30335
|
if (this.container) {
|
@@ -31357,6 +31392,7 @@ var Question = /** @class */ (function (_super) {
|
|
31357
31392
|
Question.prototype.isReadOnlyRenderDiv = function () {
|
31358
31393
|
return this.isReadOnly && _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].readOnlyCommentRenderMode === "div";
|
31359
31394
|
};
|
31395
|
+
Question.prototype.setIsMobile = function (val) { };
|
31360
31396
|
Question.prototype.createLocTitleProperty = function () {
|
31361
31397
|
var _this = this;
|
31362
31398
|
var locTitleValue = _super.prototype.createLocTitleProperty.call(this);
|
@@ -33561,7 +33597,7 @@ var Question = /** @class */ (function (_super) {
|
|
33561
33597
|
*
|
33562
33598
|
* Call this method after you assign new question values in code to ensure that they are acceptable.
|
33563
33599
|
*
|
33564
|
-
* > This method does not remove values that
|
33600
|
+
* > This method does not remove values that fail validation. Call the `validate()` method to validate newly assigned values.
|
33565
33601
|
*
|
33566
33602
|
* @see validate
|
33567
33603
|
*/
|
@@ -33725,7 +33761,9 @@ var Question = /** @class */ (function (_super) {
|
|
33725
33761
|
};
|
33726
33762
|
Question.questionCounter = 100;
|
33727
33763
|
__decorate([
|
33728
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: false
|
33764
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: false, onSet: function (val, target) {
|
33765
|
+
target.setIsMobile(val);
|
33766
|
+
} })
|
33729
33767
|
], Question.prototype, "isMobile", void 0);
|
33730
33768
|
__decorate([
|
33731
33769
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ localizable: true })
|
@@ -37762,9 +37800,6 @@ var QuestionCustomModelBase = /** @class */ (function (_super) {
|
|
37762
37800
|
QuestionCustomModelBase.prototype.getSurveyData = function () {
|
37763
37801
|
return this;
|
37764
37802
|
};
|
37765
|
-
// getSurvey(): ISurvey {
|
37766
|
-
// return this.survey;
|
37767
|
-
// }
|
37768
37803
|
QuestionCustomModelBase.prototype.getTextProcessor = function () {
|
37769
37804
|
return this.textProcessor;
|
37770
37805
|
};
|
@@ -37898,6 +37933,12 @@ var QuestionCustomModel = /** @class */ (function (_super) {
|
|
37898
37933
|
return;
|
37899
37934
|
_super.prototype.setValue.call(this, name, newValue, locNotification, allowNotifyValueChanged);
|
37900
37935
|
};
|
37936
|
+
QuestionCustomModel.prototype.onSetData = function () {
|
37937
|
+
_super.prototype.onSetData.call(this);
|
37938
|
+
if (!!this.survey && !this.isEmpty()) {
|
37939
|
+
this.setValue(this.name, this.value, false, this.allowNotifyValueChanged);
|
37940
|
+
}
|
37941
|
+
};
|
37901
37942
|
QuestionCustomModel.prototype.hasErrors = function (fireCallback, rec) {
|
37902
37943
|
if (fireCallback === void 0) { fireCallback = true; }
|
37903
37944
|
if (rec === void 0) { rec = null; }
|
@@ -38565,7 +38606,7 @@ var QuestionDropdownModel = /** @class */ (function (_super) {
|
|
38565
38606
|
};
|
38566
38607
|
Object.defineProperty(QuestionDropdownModel.prototype, "selectedItemLocText", {
|
38567
38608
|
get: function () {
|
38568
|
-
var item = this.selectedItem;
|
38609
|
+
var item = this.suggestedItem || this.selectedItem;
|
38569
38610
|
return item === null || item === void 0 ? void 0 : item.locText;
|
38570
38611
|
},
|
38571
38612
|
enumerable: false,
|
@@ -38692,6 +38733,9 @@ var QuestionDropdownModel = /** @class */ (function (_super) {
|
|
38692
38733
|
__decorate([
|
38693
38734
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: 25 })
|
38694
38735
|
], QuestionDropdownModel.prototype, "choicesLazyLoadPageSize", void 0);
|
38736
|
+
__decorate([
|
38737
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
|
38738
|
+
], QuestionDropdownModel.prototype, "suggestedItem", void 0);
|
38695
38739
|
return QuestionDropdownModel;
|
38696
38740
|
}(_question_baseselect__WEBPACK_IMPORTED_MODULE_2__["QuestionSelectBase"]));
|
38697
38741
|
|
@@ -42190,7 +42234,7 @@ var MatrixDropdownTotalCell = /** @class */ (function (_super) {
|
|
42190
42234
|
if (!!this.column.totalExpression)
|
42191
42235
|
return this.column.totalExpression;
|
42192
42236
|
if (this.column.totalType == "none")
|
42193
|
-
return "";
|
42237
|
+
return "''";
|
42194
42238
|
var funName = this.column.totalType + "InArray";
|
42195
42239
|
if (!_functionsfactory__WEBPACK_IMPORTED_MODULE_8__["FunctionFactory"].Instance.hasFunction(funName))
|
42196
42240
|
return "";
|
@@ -44216,12 +44260,17 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
44216
44260
|
configurable: true
|
44217
44261
|
});
|
44218
44262
|
QuestionMatrixDropdownModelBase.prototype.onRowChanging = function (row, columnName, rowValue) {
|
44219
|
-
if (!this.survey)
|
44263
|
+
if (!this.survey && !this.cellValueChangingCallback)
|
44220
44264
|
return !!rowValue ? rowValue[columnName] : null;
|
44221
44265
|
var options = this.getOnCellValueChangedOptions(row, columnName, rowValue);
|
44222
44266
|
var oldRowValue = this.getRowValueCore(row, this.createNewValue(), true);
|
44223
44267
|
options.oldValue = !!oldRowValue ? oldRowValue[columnName] : null;
|
44224
|
-
this.
|
44268
|
+
if (!!this.cellValueChangingCallback) {
|
44269
|
+
options.value = this.cellValueChangingCallback(row, columnName, options.value, options.oldValue);
|
44270
|
+
}
|
44271
|
+
if (!!this.survey) {
|
44272
|
+
this.survey.matrixCellValueChanging(this, options);
|
44273
|
+
}
|
44225
44274
|
return options.value;
|
44226
44275
|
};
|
44227
44276
|
QuestionMatrixDropdownModelBase.prototype.onRowChanged = function (row, columnName, newRowValue, isDeletingValue) {
|
@@ -48935,6 +48984,13 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
48935
48984
|
_super.prototype.setValueCore.call(this, newValue);
|
48936
48985
|
}
|
48937
48986
|
};
|
48987
|
+
QuestionPanelDynamicModel.prototype.setIsMobile = function (val) {
|
48988
|
+
(this.panels || []).forEach(function (panel) { return panel.elements.forEach(function (element) {
|
48989
|
+
if (element instanceof _question__WEBPACK_IMPORTED_MODULE_3__["Question"]) {
|
48990
|
+
element.isMobile = val;
|
48991
|
+
}
|
48992
|
+
}); });
|
48993
|
+
};
|
48938
48994
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "panelCount", {
|
48939
48995
|
/**
|
48940
48996
|
* The number of panels in Dynamic Panel.
|
@@ -51107,8 +51163,13 @@ var RenderedRatingItem = /** @class */ (function (_super) {
|
|
51107
51163
|
var _this = _super.call(this) || this;
|
51108
51164
|
_this.itemValue = itemValue;
|
51109
51165
|
_this.locString = locString;
|
51166
|
+
_this.locText.onStringChanged.add(_this.onStringChangedCallback.bind(_this));
|
51167
|
+
_this.onStringChangedCallback();
|
51110
51168
|
return _this;
|
51111
51169
|
}
|
51170
|
+
RenderedRatingItem.prototype.onStringChangedCallback = function () {
|
51171
|
+
this.text = this.itemValue.text;
|
51172
|
+
};
|
51112
51173
|
Object.defineProperty(RenderedRatingItem.prototype, "value", {
|
51113
51174
|
get: function () {
|
51114
51175
|
return this.itemValue.getPropertyValue("value");
|
@@ -51123,16 +51184,12 @@ var RenderedRatingItem = /** @class */ (function (_super) {
|
|
51123
51184
|
enumerable: false,
|
51124
51185
|
configurable: true
|
51125
51186
|
});
|
51126
|
-
Object.defineProperty(RenderedRatingItem.prototype, "text", {
|
51127
|
-
get: function () {
|
51128
|
-
return this.itemValue.text;
|
51129
|
-
},
|
51130
|
-
enumerable: false,
|
51131
|
-
configurable: true
|
51132
|
-
});
|
51133
51187
|
__decorate([
|
51134
51188
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "" })
|
51135
51189
|
], RenderedRatingItem.prototype, "highlight", void 0);
|
51190
|
+
__decorate([
|
51191
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "" })
|
51192
|
+
], RenderedRatingItem.prototype, "text", void 0);
|
51136
51193
|
return RenderedRatingItem;
|
51137
51194
|
}(_base__WEBPACK_IMPORTED_MODULE_7__["Base"]));
|
51138
51195
|
|
@@ -51145,21 +51202,78 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51145
51202
|
__extends(QuestionRatingModel, _super);
|
51146
51203
|
function QuestionRatingModel(name) {
|
51147
51204
|
var _this = _super.call(this, name) || this;
|
51205
|
+
_this._syncPropertiesChanging = false;
|
51148
51206
|
_this.createItemValues("rateValues");
|
51149
51207
|
_this.createRenderedRateItems();
|
51150
51208
|
_this.createLocalizableString("ratingOptionsCaption", _this, false, true);
|
51151
|
-
_this.registerFunctionOnPropertiesValueChanged(["rateValues", "rateMin", "rateMax",
|
51209
|
+
_this.registerFunctionOnPropertiesValueChanged(["rateValues", "rateMin", "rateMax", "rateType",
|
51152
51210
|
"minRateDescription", "maxRateDescription", "rateStep", "displayRateDescriptionsAsExtremeItems"], function () { return _this.createRenderedRateItems(); });
|
51153
51211
|
_this.createLocalizableString("minRateDescription", _this, true);
|
51154
51212
|
_this.createLocalizableString("maxRateDescription", _this, true);
|
51213
|
+
_this.initPropertyDependencies();
|
51155
51214
|
return _this;
|
51156
51215
|
}
|
51216
|
+
QuestionRatingModel.prototype.startLoadingFromJson = function (jsonObj) {
|
51217
|
+
_super.prototype.startLoadingFromJson.call(this, jsonObj);
|
51218
|
+
this.jsonObj = jsonObj;
|
51219
|
+
};
|
51157
51220
|
QuestionRatingModel.prototype.endLoadingFromJson = function () {
|
51158
51221
|
_super.prototype.endLoadingFromJson.call(this);
|
51159
51222
|
this.hasMinRateDescription = !!this.minRateDescription;
|
51160
51223
|
this.hasMaxRateDescription = !!this.maxRateDescription;
|
51224
|
+
if (this.jsonObj.rateMin !== undefined && this.jsonObj.rateCount !== undefined && this.jsonObj.rateMax === undefined) {
|
51225
|
+
this.updateRateMax();
|
51226
|
+
}
|
51227
|
+
if (this.jsonObj.rateMax !== undefined && this.jsonObj.rateCount !== undefined && this.jsonObj.rateMin === undefined) {
|
51228
|
+
this.updateRateMin();
|
51229
|
+
}
|
51230
|
+
this.updateRateCount();
|
51161
51231
|
this.createRenderedRateItems();
|
51162
51232
|
};
|
51233
|
+
QuestionRatingModel.prototype.registerSychProperties = function (names, func) {
|
51234
|
+
var _this = this;
|
51235
|
+
this.registerFunctionOnPropertiesValueChanged(names, function () {
|
51236
|
+
if (!_this._syncPropertiesChanging) {
|
51237
|
+
_this._syncPropertiesChanging = true;
|
51238
|
+
func();
|
51239
|
+
_this._syncPropertiesChanging = false;
|
51240
|
+
}
|
51241
|
+
});
|
51242
|
+
};
|
51243
|
+
QuestionRatingModel.prototype.updateRateMax = function () {
|
51244
|
+
this.rateMax = this.rateMin + this.rateStep * (this.rateCount - 1);
|
51245
|
+
};
|
51246
|
+
QuestionRatingModel.prototype.updateRateMin = function () {
|
51247
|
+
this.rateMin = this.rateMax - this.rateStep * (this.rateCount - 1);
|
51248
|
+
};
|
51249
|
+
QuestionRatingModel.prototype.updateRateCount = function () {
|
51250
|
+
if (this.rateValues.length) {
|
51251
|
+
this.rateCount = this.rateValues.length;
|
51252
|
+
}
|
51253
|
+
else {
|
51254
|
+
this.rateCount = Math.trunc((this.rateMax - this.rateMin) / (this.rateStep || 1)) + 1;
|
51255
|
+
}
|
51256
|
+
};
|
51257
|
+
QuestionRatingModel.prototype.initPropertyDependencies = function () {
|
51258
|
+
var _this = this;
|
51259
|
+
this.registerSychProperties(["rateCount"], function () {
|
51260
|
+
if (_this.rateValues.length == 0) {
|
51261
|
+
_this.rateMax = _this.rateMin + _this.rateStep * (_this.rateCount - 1);
|
51262
|
+
}
|
51263
|
+
else {
|
51264
|
+
if (_this.rateCount < _this.rateValues.length) {
|
51265
|
+
_this.rateValues.splice(_this.rateCount, _this.rateValues.length - _this.rateCount);
|
51266
|
+
}
|
51267
|
+
else {
|
51268
|
+
for (var i = _this.rateValues.length; i < _this.rateCount; i++)
|
51269
|
+
_this.rateValues.push(new _itemvalue__WEBPACK_IMPORTED_MODULE_0__["ItemValue"](undefined));
|
51270
|
+
}
|
51271
|
+
}
|
51272
|
+
});
|
51273
|
+
this.registerSychProperties(["rateMin", "rateMax", "rateStep", "rateValues"], function () {
|
51274
|
+
_this.updateRateCount();
|
51275
|
+
});
|
51276
|
+
};
|
51163
51277
|
Object.defineProperty(QuestionRatingModel.prototype, "rateValues", {
|
51164
51278
|
/**
|
51165
51279
|
* A list of rate values.
|
@@ -51180,10 +51294,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51180
51294
|
*
|
51181
51295
|
* If you need to specify only the `value` property, you can set the `rateValues` property to an array of numbers, for example, `[ 3, 6, 10 ]`. These values are both saved in survey results and used as display text.
|
51182
51296
|
*
|
51183
|
-
* If you do not specify the `rateValues` property, rate values are generated automatically based upon the `rateMin
|
51184
|
-
* @see rateMin
|
51185
|
-
* @see rateMax
|
51186
|
-
* @see rateStep
|
51297
|
+
* If you do not specify the `rateValues` property, rate values are generated automatically based upon the [`rateMin`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateMin), [`rateMax`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateMax), [`rateStep`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateStep), and [`rateCount`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateCount) property values.
|
51187
51298
|
*/
|
51188
51299
|
get: function () {
|
51189
51300
|
return this.getPropertyValue("rateValues");
|
@@ -51197,12 +51308,12 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51197
51308
|
});
|
51198
51309
|
Object.defineProperty(QuestionRatingModel.prototype, "rateMin", {
|
51199
51310
|
/**
|
51200
|
-
* Specifies the first rate value in the generated sequence of rate values. Applies if the `rateValues` array is empty.
|
51311
|
+
* Specifies the first rate value in the generated sequence of rate values. Applies if the [`rateValues`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateValues) array is empty.
|
51201
51312
|
*
|
51202
51313
|
* Default value: 1
|
51203
|
-
* @see rateValues
|
51204
51314
|
* @see rateMax
|
51205
51315
|
* @see rateStep
|
51316
|
+
* @see rateCount
|
51206
51317
|
*/
|
51207
51318
|
get: function () {
|
51208
51319
|
return this.getPropertyValue("rateMin");
|
@@ -51215,12 +51326,12 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51215
51326
|
});
|
51216
51327
|
Object.defineProperty(QuestionRatingModel.prototype, "rateMax", {
|
51217
51328
|
/**
|
51218
|
-
* Specifies the last rate value in the generated sequence of rate values. Applies if the `rateValues` array is empty.
|
51329
|
+
* Specifies the last rate value in the generated sequence of rate values. Applies if the [`rateValues`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateValues) array is empty.
|
51219
51330
|
*
|
51220
51331
|
* Default value: 5
|
51221
|
-
* @see rateValues
|
51222
51332
|
* @see rateMin
|
51223
51333
|
* @see rateStep
|
51334
|
+
* @see rateCount
|
51224
51335
|
*/
|
51225
51336
|
get: function () {
|
51226
51337
|
return this.getPropertyValue("rateMax");
|
@@ -51233,12 +51344,12 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51233
51344
|
});
|
51234
51345
|
Object.defineProperty(QuestionRatingModel.prototype, "rateStep", {
|
51235
51346
|
/**
|
51236
|
-
* Specifies a step with which to generate rate values. Applies if the `rateValues` array is empty.
|
51347
|
+
* Specifies a step with which to generate rate values. Applies if the [`rateValues`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateValues) array is empty.
|
51237
51348
|
*
|
51238
51349
|
* Default value: 1
|
51239
|
-
* @see rateValues
|
51240
51350
|
* @see rateMin
|
51241
51351
|
* @see rateMax
|
51352
|
+
* @see rateCount
|
51242
51353
|
*/
|
51243
51354
|
get: function () {
|
51244
51355
|
return this.getPropertyValue("rateStep");
|
@@ -51285,6 +51396,8 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51285
51396
|
}
|
51286
51397
|
rateValues = res;
|
51287
51398
|
}
|
51399
|
+
if (this.rateType == "smileys" && rateValues.length > 10)
|
51400
|
+
rateValues = rateValues.slice(0, 10);
|
51288
51401
|
this.renderedRateItems = rateValues.map(function (v, i) {
|
51289
51402
|
if (_this.displayRateDescriptionsAsExtremeItems) {
|
51290
51403
|
if (i == 0)
|
@@ -51504,6 +51617,13 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51504
51617
|
itemHoverClass = this.cssClasses.itemSmileyHover;
|
51505
51618
|
itemitemOnErrorClass = this.cssClasses.itemSmileyOnError;
|
51506
51619
|
}
|
51620
|
+
var hasFixedSize = !this.isStar &&
|
51621
|
+
!this.isSmiley &&
|
51622
|
+
(!this.displayRateDescriptionsAsExtremeItems ||
|
51623
|
+
this.rateValues.length > 0 && item != this.rateValues[0] && item != this.rateValues[this.rateValues.length - 1] ||
|
51624
|
+
this.rateValues.length == 0 && item.value != this.rateMin && item.value != this.rateMax) &&
|
51625
|
+
item.locText.calculatedText.length <= 2 &&
|
51626
|
+
Number.isInteger(Number(item.locText.calculatedText));
|
51507
51627
|
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_6__["CssClassBuilder"]()
|
51508
51628
|
.append(itemClass)
|
51509
51629
|
.append(itemSelectedClass, isSelected)
|
@@ -51512,6 +51632,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51512
51632
|
.append(itemHighlightedClass, isHighlighted)
|
51513
51633
|
.append(itemUnhighlightedClass, isUnhighlighted)
|
51514
51634
|
.append(itemitemOnErrorClass, this.errors.length > 0)
|
51635
|
+
.append(this.cssClasses.itemFixedSize, hasFixedSize)
|
51515
51636
|
.toString();
|
51516
51637
|
};
|
51517
51638
|
//methods for mobile view
|
@@ -51628,6 +51749,9 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51628
51749
|
}
|
51629
51750
|
return classes;
|
51630
51751
|
};
|
51752
|
+
__decorate([
|
51753
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: 5 })
|
51754
|
+
], QuestionRatingModel.prototype, "rateCount", void 0);
|
51631
51755
|
__decorate([
|
51632
51756
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["propertyArray"])()
|
51633
51757
|
], QuestionRatingModel.prototype, "renderedRateItems", void 0);
|
@@ -51666,6 +51790,10 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51666
51790
|
|
51667
51791
|
_jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
|
51668
51792
|
{ name: "showCommentArea:switch", layout: "row", visible: true, category: "general" },
|
51793
|
+
{
|
51794
|
+
name: "rateCount:number",
|
51795
|
+
default: 5
|
51796
|
+
},
|
51669
51797
|
{
|
51670
51798
|
name: "rateValues:itemvalue[]",
|
51671
51799
|
baseValue: function () {
|
@@ -56202,7 +56330,7 @@ var TitleElement = /** @class */ (function (_super) {
|
|
56202
56330
|
};
|
56203
56331
|
}
|
56204
56332
|
var CustomTag = element.titleTagName;
|
56205
|
-
return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(CustomTag, { className: element.cssTitle, id: element.ariaTitleId, "aria-label": ariaLabel, tabIndex: element.titleTabIndex, "aria-expanded": element.titleAriaExpanded, role:
|
56333
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(CustomTag, { className: element.cssTitle, id: element.ariaTitleId, "aria-label": ariaLabel, tabIndex: element.titleTabIndex, "aria-expanded": element.titleAriaExpanded, role: element.titleAriaRole, onClick: onClick, onKeyUp: onKeyUp }, titleContent));
|
56206
56334
|
};
|
56207
56335
|
return TitleElement;
|
56208
56336
|
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component));
|
@@ -57850,8 +57978,14 @@ var Survey = /** @class */ (function (_super) {
|
|
57850
57978
|
}
|
57851
57979
|
var rootCss = this.survey.getRootCss();
|
57852
57980
|
var cssClasses = this.rootNodeClassName ? this.rootNodeClassName + " " + rootCss : rootCss;
|
57853
|
-
|
57854
|
-
|
57981
|
+
var rootStyle = {
|
57982
|
+
backgroundImage: this.survey.renderBackgroundImage
|
57983
|
+
};
|
57984
|
+
var formStyle = {
|
57985
|
+
backgroundColor: this.survey.renderBackgroundOpacity
|
57986
|
+
};
|
57987
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.rootNodeId, ref: this.rootRef, className: cssClasses, style: rootStyle },
|
57988
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("form", { onSubmit: onSubmit, style: formStyle },
|
57855
57989
|
customHeader,
|
57856
57990
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.css.container },
|
57857
57991
|
header,
|
@@ -57991,9 +58125,7 @@ var Survey = /** @class */ (function (_super) {
|
|
57991
58125
|
};
|
57992
58126
|
//ISurveyCreator
|
57993
58127
|
Survey.prototype.createQuestionElement = function (question) {
|
57994
|
-
return _reactquestion_factory__WEBPACK_IMPORTED_MODULE_6__["ReactQuestionFactory"].Instance.createQuestion(
|
57995
|
-
? question.getTemplate()
|
57996
|
-
: question.getComponentName(), {
|
58128
|
+
return _reactquestion_factory__WEBPACK_IMPORTED_MODULE_6__["ReactQuestionFactory"].Instance.createQuestion(question.isDefaultRendering() ? question.getTemplate() : question.getComponentName(), {
|
57997
58129
|
question: question,
|
57998
58130
|
isDisplayMode: question.isInputReadOnly,
|
57999
58131
|
creator: this,
|
@@ -63791,6 +63923,11 @@ var SurveyElementCore = /** @class */ (function (_super) {
|
|
63791
63923
|
enumerable: false,
|
63792
63924
|
configurable: true
|
63793
63925
|
});
|
63926
|
+
Object.defineProperty(SurveyElementCore.prototype, "titleAriaRole", {
|
63927
|
+
get: function () { return undefined; },
|
63928
|
+
enumerable: false,
|
63929
|
+
configurable: true
|
63930
|
+
});
|
63794
63931
|
Object.defineProperty(SurveyElementCore.prototype, "ariaLabel", {
|
63795
63932
|
get: function () {
|
63796
63933
|
return this.locTitle.renderedHtml;
|
@@ -64149,6 +64286,15 @@ var SurveyElement = /** @class */ (function (_super) {
|
|
64149
64286
|
enumerable: false,
|
64150
64287
|
configurable: true
|
64151
64288
|
});
|
64289
|
+
Object.defineProperty(SurveyElement.prototype, "titleAriaRole", {
|
64290
|
+
get: function () {
|
64291
|
+
if (this.isPage || this.state === "default")
|
64292
|
+
return undefined;
|
64293
|
+
return "button";
|
64294
|
+
},
|
64295
|
+
enumerable: false,
|
64296
|
+
configurable: true
|
64297
|
+
});
|
64152
64298
|
SurveyElement.prototype.setSurveyImpl = function (value, isLight) {
|
64153
64299
|
this.surveyImplValue = value;
|
64154
64300
|
if (!this.surveyImplValue) {
|
@@ -65337,7 +65483,6 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
65337
65483
|
* For information on event handler parameters, refer to descriptions within the interface.
|
65338
65484
|
*
|
65339
65485
|
* [View Demo](https://surveyjs.io/form-library/examples/file-delayed-upload/ (linkStyle))
|
65340
|
-
* @see clearFiles
|
65341
65486
|
* @see onDownloadFile
|
65342
65487
|
* @see onUploadFiles
|
65343
65488
|
*/
|
@@ -65676,6 +65821,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
65676
65821
|
_this.createHtmlLocString("completedBeforeHtml", "completingSurveyBefore", htmlCallBack);
|
65677
65822
|
_this.createHtmlLocString("loadingHtml", "loadingSurvey", htmlCallBack);
|
65678
65823
|
_this.createLocalizableString("logo", _this, false);
|
65824
|
+
_this.createLocalizableString("backgroundImage", _this, false);
|
65679
65825
|
_this.createLocalizableString("startSurveyText", _this, false, true);
|
65680
65826
|
_this.createLocalizableString("pagePrevText", _this, false, true);
|
65681
65827
|
_this.createLocalizableString("pageNextText", _this, false, true);
|
@@ -65726,6 +65872,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
65726
65872
|
_this.registerPropertyChangedHandlers(["isLoading", "isCompleted", "isCompletedBefore", "mode", "isStartedState", "currentPage"], function () { _this.updateState(); });
|
65727
65873
|
_this.registerPropertyChangedHandlers(["state", "currentPage", "showPreviewBeforeComplete"], function () { _this.onStateAndCurrentPageChanged(); });
|
65728
65874
|
_this.registerPropertyChangedHandlers(["logo", "logoPosition"], function () { _this.updateHasLogo(); });
|
65875
|
+
_this.registerPropertyChangedHandlers(["backgroundImage"], function () { _this.updateRenderBackgroundImage(); });
|
65729
65876
|
_this.onGetQuestionNo.onCallbacksChanged = function () {
|
65730
65877
|
_this.resetVisibleIndexes();
|
65731
65878
|
};
|
@@ -66117,7 +66264,9 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
66117
66264
|
});
|
66118
66265
|
Object.defineProperty(SurveyModel.prototype, "surveyId", {
|
66119
66266
|
/**
|
66120
|
-
*
|
66267
|
+
* The identifier of a survey JSON schema to load from the [SurveyJS Service](https://api.surveyjs.io).
|
66268
|
+
*
|
66269
|
+
* Refer to the following help topic for more information: [Store Survey Results in the SurveyJS Service](https://surveyjs.io/form-library/documentation/handle-survey-results-store#store-survey-results-in-the-surveyjs-service).
|
66121
66270
|
* @see loadSurveyFromService
|
66122
66271
|
* @see onLoadedSurveyFromService
|
66123
66272
|
*/
|
@@ -66132,7 +66281,9 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
66132
66281
|
});
|
66133
66282
|
Object.defineProperty(SurveyModel.prototype, "surveyPostId", {
|
66134
66283
|
/**
|
66135
|
-
*
|
66284
|
+
* An identifier used to save survey results to the [SurveyJS Service](https://api.surveyjs.io).
|
66285
|
+
*
|
66286
|
+
* Refer to the following help topic for more information: [Store Survey Results in the SurveyJS Service](https://surveyjs.io/form-library/documentation/handle-survey-results-store#store-survey-results-in-the-surveyjs-service).
|
66136
66287
|
* @see onComplete
|
66137
66288
|
* @see surveyShowDataSaving
|
66138
66289
|
*/
|
@@ -66147,9 +66298,10 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
66147
66298
|
});
|
66148
66299
|
Object.defineProperty(SurveyModel.prototype, "clientId", {
|
66149
66300
|
/**
|
66150
|
-
*
|
66151
|
-
*
|
66152
|
-
* On the second run,
|
66301
|
+
* A user identifier (e-mail or other unique ID).
|
66302
|
+
*
|
66303
|
+
* If your application works with the [SurveyJS Service](https://api.surveyjs.io), the ID ensures that users do not pass the same survey twice. On the second run, they will see the [Completed Before page](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#completedBeforeHtml).
|
66304
|
+
* @see cookieName
|
66153
66305
|
*/
|
66154
66306
|
get: function () {
|
66155
66307
|
return this.getPropertyValue("clientId", "");
|
@@ -66162,9 +66314,10 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
66162
66314
|
});
|
66163
66315
|
Object.defineProperty(SurveyModel.prototype, "cookieName", {
|
66164
66316
|
/**
|
66165
|
-
*
|
66166
|
-
*
|
66167
|
-
*
|
66317
|
+
* A cookie name used to save information about survey completion.
|
66318
|
+
*
|
66319
|
+
* When this property has a value, the survey creates a cookie with the specified name on completion. This cookie helps ensure that users do not pass the same survey twice. On the second run, they will see the [Completed Before page](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#completedBeforeHtml).
|
66320
|
+
* @see cliendId
|
66168
66321
|
*/
|
66169
66322
|
get: function () {
|
66170
66323
|
return this.getPropertyValue("cookieName", "");
|
@@ -66606,15 +66759,17 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
66606
66759
|
});
|
66607
66760
|
Object.defineProperty(SurveyModel.prototype, "clearInvisibleValues", {
|
66608
66761
|
/**
|
66609
|
-
*
|
66762
|
+
* Specifies when to remove values of invisible questions from [survey results](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#data).
|
66610
66763
|
*
|
66611
|
-
*
|
66764
|
+
* Possible values:
|
66612
66765
|
*
|
66613
|
-
* - `
|
66614
|
-
* - `onHidden` -
|
66615
|
-
* - `onHiddenContainer` -
|
66616
|
-
* - `
|
66617
|
-
*
|
66766
|
+
* - `"onComplete"` (default) - Clears invisible question values when the survey is complete.
|
66767
|
+
* - `"onHidden"` - Clears a question value when the question becomes invisible. If the question is invisible initially, its value is removed on survey completion.
|
66768
|
+
* - `"onHiddenContainer"` - Clears a question value when the question or its containter (page or panel) becomes invisible. If the question is invisible initially, its value is removed on survey completion.
|
66769
|
+
* - `"none"` - Keeps invisible values in survey results.
|
66770
|
+
* - `true` - Equivalent to `"onComplete"`.
|
66771
|
+
* - `false` - Equivalent to `"none"`.
|
66772
|
+
* @see [Conditional Visibility](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#conditional-visibility)
|
66618
66773
|
* @see onComplete
|
66619
66774
|
*/
|
66620
66775
|
get: function () {
|
@@ -66631,21 +66786,19 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
66631
66786
|
configurable: true
|
66632
66787
|
});
|
66633
66788
|
/**
|
66634
|
-
*
|
66635
|
-
*
|
66636
|
-
*
|
66637
|
-
*
|
66638
|
-
*
|
66639
|
-
* @
|
66640
|
-
* @see Page.clearIncorrectValues
|
66641
|
-
* @see Panel.clearIncorrectValues
|
66789
|
+
* Removes values that cannot be assigned to a question, for example, choices unlisted in the `choices` array.
|
66790
|
+
*
|
66791
|
+
* Call this method after you assign new question values in code to ensure that they are acceptable.
|
66792
|
+
*
|
66793
|
+
* > This method does not remove values that fail validation. Call the [`validate()`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#validate) method to validate newly assigned values.
|
66794
|
+
* @param removeNonExistingRootKeys Pass `true` to remove values that do not correspond to any question or [calculated value](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#calculated-values).
|
66642
66795
|
*/
|
66643
|
-
SurveyModel.prototype.clearIncorrectValues = function (
|
66644
|
-
if (
|
66796
|
+
SurveyModel.prototype.clearIncorrectValues = function (removeNonExistingRootKeys) {
|
66797
|
+
if (removeNonExistingRootKeys === void 0) { removeNonExistingRootKeys = false; }
|
66645
66798
|
for (var i = 0; i < this.pages.length; i++) {
|
66646
66799
|
this.pages[i].clearIncorrectValues();
|
66647
66800
|
}
|
66648
|
-
if (!
|
66801
|
+
if (!removeNonExistingRootKeys)
|
66649
66802
|
return;
|
66650
66803
|
var data = this.data;
|
66651
66804
|
var hasChanges = false;
|
@@ -66672,7 +66825,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
66672
66825
|
};
|
66673
66826
|
Object.defineProperty(SurveyModel.prototype, "keepIncorrectValues", {
|
66674
66827
|
/**
|
66675
|
-
* Specifies whether to keep values that cannot be assigned to questions, for example, choices unlisted in the choices array.
|
66828
|
+
* Specifies whether to keep values that cannot be assigned to questions, for example, choices unlisted in the `choices` array.
|
66676
66829
|
*
|
66677
66830
|
* > This property cannot be specified in the survey JSON schema. Use dot notation to specify it.
|
66678
66831
|
* @see clearIncorrectValues
|
@@ -67019,14 +67172,58 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
67019
67172
|
enumerable: false,
|
67020
67173
|
configurable: true
|
67021
67174
|
});
|
67175
|
+
Object.defineProperty(SurveyModel.prototype, "backgroundImage", {
|
67176
|
+
/**
|
67177
|
+
* Gets or sets a survey backgroundImage.
|
67178
|
+
*/
|
67179
|
+
get: function () {
|
67180
|
+
return this.getLocalizableStringText("backgroundImage");
|
67181
|
+
},
|
67182
|
+
set: function (value) {
|
67183
|
+
this.setLocalizableStringText("backgroundImage", value);
|
67184
|
+
},
|
67185
|
+
enumerable: false,
|
67186
|
+
configurable: true
|
67187
|
+
});
|
67188
|
+
Object.defineProperty(SurveyModel.prototype, "locBackgroundImage", {
|
67189
|
+
get: function () {
|
67190
|
+
return this.getLocalizableString("backgroundImage");
|
67191
|
+
},
|
67192
|
+
enumerable: false,
|
67193
|
+
configurable: true
|
67194
|
+
});
|
67195
|
+
SurveyModel.prototype.updateRenderBackgroundImage = function () {
|
67196
|
+
this.renderBackgroundImage = ["url(", this.getLocalizableString("backgroundImage").renderedHtml, ")"].join("");
|
67197
|
+
};
|
67198
|
+
Object.defineProperty(SurveyModel.prototype, "backgroundOpacity", {
|
67199
|
+
get: function () {
|
67200
|
+
return this.getPropertyValue("backgroundOpacity");
|
67201
|
+
},
|
67202
|
+
set: function (val) {
|
67203
|
+
this.setPropertyValue("backgroundOpacity", val);
|
67204
|
+
},
|
67205
|
+
enumerable: false,
|
67206
|
+
configurable: true
|
67207
|
+
});
|
67208
|
+
Object.defineProperty(SurveyModel.prototype, "renderBackgroundOpacity", {
|
67209
|
+
get: function () {
|
67210
|
+
var backgroundOpacityProperty = this.getPropertyByName("backgroundOpacity");
|
67211
|
+
if (backgroundOpacityProperty.isDefaultValue(this.backgroundOpacity)) {
|
67212
|
+
return "";
|
67213
|
+
}
|
67214
|
+
var alpha = 1 - this.backgroundOpacity;
|
67215
|
+
return ["rgba(255, 255, 255, ", alpha, ")"].join("");
|
67216
|
+
},
|
67217
|
+
enumerable: false,
|
67218
|
+
configurable: true
|
67219
|
+
});
|
67022
67220
|
Object.defineProperty(SurveyModel.prototype, "completedHtml", {
|
67023
67221
|
/**
|
67024
|
-
*
|
67222
|
+
* HTML content displayed on the [complete page](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#complete-page).
|
67223
|
+
*
|
67224
|
+
* [View Demo](https://surveyjs.io/form-library/examples/modify-survey-navigation-settings/ (linkStyle))
|
67025
67225
|
* @see showCompletedPage
|
67026
67226
|
* @see completedHtmlOnCondition
|
67027
|
-
* @see locale
|
67028
|
-
*
|
67029
|
-
* [View Demo](https://surveyjs.io/form-library/examples/survey-options/ (linkStyle))
|
67030
67227
|
*/
|
67031
67228
|
get: function () {
|
67032
67229
|
return this.getLocalizableStringText("completedHtml");
|
@@ -67046,9 +67243,11 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
67046
67243
|
});
|
67047
67244
|
Object.defineProperty(SurveyModel.prototype, "completedHtmlOnCondition", {
|
67048
67245
|
/**
|
67049
|
-
*
|
67050
|
-
*
|
67051
|
-
*
|
67246
|
+
* An array of objects that allows you to specify different HTML content for the [complete page](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#complete-page).
|
67247
|
+
*
|
67248
|
+
* Each object should include the [`expression`](https://surveyjs.io/form-library/documentation/api-reference/htmlconditionitem#expression) and [`html`](https://surveyjs.io/form-library/documentation/api-reference/htmlconditionitem#html) properties. When `expression` evaluates to `true`, the survey uses the corresponding HTML markup instead of [`completedHtml`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#completedHtml). Refer to the following help topic for more information about expressions: [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions).
|
67249
|
+
*
|
67250
|
+
* [View Demo](https://surveyjs.io/form-library/examples/nps-question/ (linkStyle))
|
67052
67251
|
*/
|
67053
67252
|
get: function () {
|
67054
67253
|
return this.getPropertyValue("completedHtmlOnCondition");
|
@@ -67109,9 +67308,10 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
67109
67308
|
};
|
67110
67309
|
Object.defineProperty(SurveyModel.prototype, "completedBeforeHtml", {
|
67111
67310
|
/**
|
67112
|
-
*
|
67311
|
+
* HTML content displayed to a user who has completed the survey before.
|
67113
67312
|
* @see clientId
|
67114
|
-
* @see
|
67313
|
+
* @see cookieName
|
67314
|
+
* @see processedCompletedBeforeHtml
|
67115
67315
|
*/
|
67116
67316
|
get: function () {
|
67117
67317
|
return this.getLocalizableStringText("completedBeforeHtml");
|
@@ -67131,9 +67331,9 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
67131
67331
|
});
|
67132
67332
|
Object.defineProperty(SurveyModel.prototype, "loadingHtml", {
|
67133
67333
|
/**
|
67134
|
-
*
|
67334
|
+
* HTML content displayed while a survey JSON schema is being loaded from the [SurveyJS Service](https://api.surveyjs.io).
|
67135
67335
|
* @see surveyId
|
67136
|
-
* @see
|
67336
|
+
* @see processedLoadingHtml
|
67137
67337
|
*/
|
67138
67338
|
get: function () {
|
67139
67339
|
return this.getLocalizableStringText("loadingHtml");
|
@@ -67152,10 +67352,6 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
67152
67352
|
configurable: true
|
67153
67353
|
});
|
67154
67354
|
Object.defineProperty(SurveyModel.prototype, "defaultLoadingHtml", {
|
67155
|
-
/**
|
67156
|
-
* Default value for loadingHtml property
|
67157
|
-
* @see loadingHtml
|
67158
|
-
*/
|
67159
67355
|
get: function () {
|
67160
67356
|
return "<h3>" + this.getLocalizationString("loadingSurvey") + "</h3>";
|
67161
67357
|
},
|
@@ -67992,8 +68188,9 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
67992
68188
|
};
|
67993
68189
|
Object.defineProperty(SurveyModel.prototype, "comments", {
|
67994
68190
|
/**
|
67995
|
-
*
|
67996
|
-
* @see
|
68191
|
+
* An object with all comment values.
|
68192
|
+
* @see Question.showCommentArea
|
68193
|
+
* @see storeOthersAsComment
|
67997
68194
|
*/
|
67998
68195
|
get: function () {
|
67999
68196
|
var result = {};
|
@@ -68454,14 +68651,9 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
68454
68651
|
page.updateCustomWidgets();
|
68455
68652
|
};
|
68456
68653
|
SurveyModel.prototype.currentPageChanging = function (newValue, oldValue) {
|
68457
|
-
var options =
|
68458
|
-
|
68459
|
-
|
68460
|
-
allowChanging: true,
|
68461
|
-
allow: true,
|
68462
|
-
isNextPage: this.isNextPage(newValue, oldValue),
|
68463
|
-
isPrevPage: this.isPrevPage(newValue, oldValue),
|
68464
|
-
};
|
68654
|
+
var options = this.createPageChangeEventOptions(newValue, oldValue);
|
68655
|
+
options.allow = true;
|
68656
|
+
options.allowChanging = true;
|
68465
68657
|
this.onCurrentPageChanging.fire(this, options);
|
68466
68658
|
var allow = options.allowChanging && options.allow;
|
68467
68659
|
if (allow) {
|
@@ -68470,26 +68662,22 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
68470
68662
|
return allow;
|
68471
68663
|
};
|
68472
68664
|
SurveyModel.prototype.currentPageChanged = function (newValue, oldValue) {
|
68473
|
-
var
|
68474
|
-
if (isNextPage) {
|
68665
|
+
var options = this.createPageChangeEventOptions(newValue, oldValue);
|
68666
|
+
if (options.isNextPage) {
|
68475
68667
|
oldValue.passed = true;
|
68476
68668
|
}
|
68477
|
-
this.onCurrentPageChanged.fire(this,
|
68669
|
+
this.onCurrentPageChanged.fire(this, options);
|
68670
|
+
};
|
68671
|
+
SurveyModel.prototype.createPageChangeEventOptions = function (newValue, oldValue) {
|
68672
|
+
var diff = !!newValue && !!oldValue ? newValue.visibleIndex - oldValue.visibleIndex : 0;
|
68673
|
+
return {
|
68478
68674
|
oldCurrentPage: oldValue,
|
68479
68675
|
newCurrentPage: newValue,
|
68480
|
-
isNextPage:
|
68481
|
-
isPrevPage:
|
68482
|
-
|
68483
|
-
|
68484
|
-
|
68485
|
-
if (!newValue || !oldValue)
|
68486
|
-
return false;
|
68487
|
-
return newValue.visibleIndex == oldValue.visibleIndex + 1;
|
68488
|
-
};
|
68489
|
-
SurveyModel.prototype.isPrevPage = function (newValue, oldValue) {
|
68490
|
-
if (!newValue || !oldValue)
|
68491
|
-
return false;
|
68492
|
-
return newValue.visibleIndex + 1 == oldValue.visibleIndex;
|
68676
|
+
isNextPage: diff === 1,
|
68677
|
+
isPrevPage: diff === -1,
|
68678
|
+
isGoingForward: diff > 0,
|
68679
|
+
isGoingBackward: diff < 0
|
68680
|
+
};
|
68493
68681
|
};
|
68494
68682
|
/**
|
68495
68683
|
* Returns the progress that a user made while going through the survey.
|
@@ -69034,11 +69222,11 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
69034
69222
|
return true;
|
69035
69223
|
};
|
69036
69224
|
/**
|
69037
|
-
* Completes the survey
|
69038
|
-
*
|
69225
|
+
* Completes the survey if it currently displays the last page and the page contains no validation errors. If both these conditions are met, this method returns `true`; otherwise, `false`.
|
69226
|
+
*
|
69227
|
+
* If you want to complete the survey regardless of the current page and validation errors, use the [`doComplete()`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#completeLastPage) event.
|
69039
69228
|
* @see isCurrentPageValid
|
69040
69229
|
* @see nextPage
|
69041
|
-
* @see doComplete
|
69042
69230
|
*/
|
69043
69231
|
SurveyModel.prototype.completeLastPage = function () {
|
69044
69232
|
var res = this.doCurrentPageComplete(true);
|
@@ -69444,26 +69632,19 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
69444
69632
|
/**
|
69445
69633
|
* Completes the survey.
|
69446
69634
|
*
|
69447
|
-
*
|
69635
|
+
* When you call this method, Form Library performs the following actions:
|
69448
69636
|
*
|
69449
|
-
*
|
69450
|
-
*
|
69451
|
-
*
|
69452
|
-
* -
|
69637
|
+
* 1. Saves a cookie if the [`cookieName`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#cookieName) property is set.
|
69638
|
+
* 1. Switches the survey [`state`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#state) to `"completed"`.
|
69639
|
+
* 1. Raises the [`onComplete`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onComplete) event.
|
69640
|
+
* 1. Navigates the user to a URL specified by the [`navigateToUrl`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#navigateToUrl) or [`navigateToUrlOnCondition`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#navigateToUrlOnCondition) property.
|
69641
|
+
* 1. Calls the [`sendResult()`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#sendResult) method if Form Library works with the [SurveyJS Service](https://api.surveyjs.io/).
|
69453
69642
|
*
|
69454
|
-
*
|
69455
|
-
*
|
69456
|
-
*
|
69457
|
-
*
|
69458
|
-
* @see completeLastPage
|
69459
|
-
* @see onCompleting
|
69460
|
-
* @see cookieName
|
69461
|
-
* @see state
|
69462
|
-
* @see onComplete
|
69643
|
+
* The `doComplete()` method completes the survey regardless of validation errors and the current page. If you need to ensure that survey results are valid and full, call the [`completeLastPage()`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#completeLastPage) method instead.
|
69644
|
+
*
|
69645
|
+
* @param isCompleteOnTrigger For internal use.
|
69646
|
+
* @returns `false` if survey completion is cancelled within the [`onCompleting`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onCompleting) event handler; otherwise, `true`.
|
69463
69647
|
* @see surveyPostId
|
69464
|
-
* @see completeLastPage
|
69465
|
-
* @see navigateToUrl
|
69466
|
-
* @see navigateToUrlOnCondition
|
69467
69648
|
*/
|
69468
69649
|
SurveyModel.prototype.doComplete = function (isCompleteOnTrigger) {
|
69469
69650
|
if (isCompleteOnTrigger === void 0) { isCompleteOnTrigger = false; }
|
@@ -70181,13 +70362,6 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
70181
70362
|
callback: callback,
|
70182
70363
|
});
|
70183
70364
|
};
|
70184
|
-
/**
|
70185
|
-
* Clears files from server.
|
70186
|
-
* @param question question
|
70187
|
-
* @param name question name
|
70188
|
-
* @param value file question value
|
70189
|
-
* @param callback call back function to get the status of the clearing operation
|
70190
|
-
*/
|
70191
70365
|
SurveyModel.prototype.clearFiles = function (question, name, value, fileName, callback) {
|
70192
70366
|
if (this.onClearFiles.isEmpty) {
|
70193
70367
|
!!callback && callback("success", value);
|
@@ -70946,6 +71120,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
70946
71120
|
this.isEndLoadingFromJson = null;
|
70947
71121
|
this.updateVisibleIndexes();
|
70948
71122
|
this.updateHasLogo();
|
71123
|
+
this.updateRenderBackgroundImage();
|
70949
71124
|
this.updateCurrentPage();
|
70950
71125
|
this.hasDescription = !!this.description;
|
70951
71126
|
this.setCalculatedWidthModeUpdater();
|
@@ -71423,8 +71598,11 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
71423
71598
|
};
|
71424
71599
|
Object.defineProperty(SurveyModel.prototype, "clearValueOnDisableItems", {
|
71425
71600
|
/**
|
71426
|
-
*
|
71427
|
-
*
|
71601
|
+
* Specifies whether to remove disabled choices from the value in [Dropdown](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model), [Checkboxes](https://surveyjs.io/form-library/documentation/api-reference/checkbox-question-model), and [Radio Button Group](https://surveyjs.io/form-library/documentation/api-reference/radio-button-question-model) questions.
|
71602
|
+
*
|
71603
|
+
* Default value: `false`
|
71604
|
+
*
|
71605
|
+
* > This property cannot be specified in the survey JSON schema. Use dot notation to specify it.
|
71428
71606
|
*/
|
71429
71607
|
get: function () {
|
71430
71608
|
return this.getPropertyValue("clearValueOnDisableItems", false);
|
@@ -72339,6 +72517,9 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
72339
72517
|
__decorate([
|
72340
72518
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
72341
72519
|
], SurveyModel.prototype, "_isMobile", void 0);
|
72520
|
+
__decorate([
|
72521
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
72522
|
+
], SurveyModel.prototype, "renderBackgroundImage", void 0);
|
72342
72523
|
__decorate([
|
72343
72524
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
72344
72525
|
], SurveyModel.prototype, "rootCss", void 0);
|
@@ -72584,6 +72765,8 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("survey", [
|
|
72584
72765
|
choices: ["auto", "static", "responsive"],
|
72585
72766
|
},
|
72586
72767
|
"width",
|
72768
|
+
{ name: "backgroundImage", serializationProperty: "locBackgroundImage", visible: false },
|
72769
|
+
{ name: "backgroundOpacity:number", minValue: 0, maxValue: 1, default: 1, visible: false },
|
72587
72770
|
{ name: "showBrandInfo:boolean", default: false, visible: false }
|
72588
72771
|
]);
|
72589
72772
|
|