survey-react 1.9.122 → 1.9.123
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/README.md +1 -1
- package/defaultV2.css +71 -26
- package/defaultV2.css.map +1 -1
- package/defaultV2.min.css +2 -2
- package/modern.css +1 -8
- package/modern.css.map +1 -1
- package/modern.min.css +2 -2
- package/package.json +1 -1
- package/survey.css +1 -1
- package/survey.css.map +1 -1
- package/survey.min.css +1 -1
- package/survey.react.d.ts +610 -633
- package/survey.react.js +232 -164
- 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.123
|
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
|
*/
|
@@ -2029,10 +2029,12 @@ var Base = /** @class */ (function () {
|
|
2029
2029
|
* The JSON object should contain only serializable properties of this SurveyJS object. Event handlers and properties that do not belong to the SurveyJS object are ignored.
|
2030
2030
|
*
|
2031
2031
|
* @param json A JSON object with properties that you want to apply to the current SurveyJS object.
|
2032
|
+
* @param options An object with configuration options.
|
2033
|
+
* @param {boolean} options.validatePropertyValues Pass `true` if you want to validate property values. Use the [`jsonErrors`](#jsonErrors) array to access validation errors.
|
2032
2034
|
* @see toJSON
|
2033
2035
|
*/
|
2034
|
-
Base.prototype.fromJSON = function (json) {
|
2035
|
-
new _jsonobject__WEBPACK_IMPORTED_MODULE_2__["JsonObject"]().toObject(json, this);
|
2036
|
+
Base.prototype.fromJSON = function (json, options) {
|
2037
|
+
new _jsonobject__WEBPACK_IMPORTED_MODULE_2__["JsonObject"]().toObject(json, this, options);
|
2036
2038
|
this.onSurveyLoad();
|
2037
2039
|
};
|
2038
2040
|
Base.prototype.onSurveyLoad = function () { };
|
@@ -3135,7 +3137,7 @@ var XmlParser = /** @class */ (function () {
|
|
3135
3137
|
* }
|
3136
3138
|
* ```
|
3137
3139
|
*
|
3138
|
-
* Typically, you should assign this object to a question's [`choicesByUrl`](https://surveyjs.io/Documentation/Library?id=QuestionSelectBase#choicesByUrl) property.
|
3140
|
+
* 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.
|
3139
3141
|
*/
|
3140
3142
|
var ChoicesRestful = /** @class */ (function (_super) {
|
3141
3143
|
__extends(ChoicesRestful, _super);
|
@@ -3193,6 +3195,16 @@ var ChoicesRestful = /** @class */ (function (_super) {
|
|
3193
3195
|
}
|
3194
3196
|
}
|
3195
3197
|
};
|
3198
|
+
Object.defineProperty(ChoicesRestful, "onBeforeSendRequest", {
|
3199
|
+
get: function () {
|
3200
|
+
return _settings__WEBPACK_IMPORTED_MODULE_4__["settings"].web.onBeforeRequestChoices;
|
3201
|
+
},
|
3202
|
+
set: function (val) {
|
3203
|
+
_settings__WEBPACK_IMPORTED_MODULE_4__["settings"].web.onBeforeRequestChoices = val;
|
3204
|
+
},
|
3205
|
+
enumerable: false,
|
3206
|
+
configurable: true
|
3207
|
+
});
|
3196
3208
|
ChoicesRestful.getCachedItemsResult = function (obj) {
|
3197
3209
|
var hash = obj.objHash;
|
3198
3210
|
var res = ChoicesRestful.itemsResult[hash];
|
@@ -3329,8 +3341,8 @@ var ChoicesRestful = /** @class */ (function (_super) {
|
|
3329
3341
|
}
|
3330
3342
|
};
|
3331
3343
|
var options = { request: xhr };
|
3332
|
-
if (!!
|
3333
|
-
|
3344
|
+
if (!!_settings__WEBPACK_IMPORTED_MODULE_4__["settings"].web.onBeforeRequestChoices) {
|
3345
|
+
_settings__WEBPACK_IMPORTED_MODULE_4__["settings"].web.onBeforeRequestChoices(this, options);
|
3334
3346
|
}
|
3335
3347
|
this.beforeSendRequest();
|
3336
3348
|
options.request.send();
|
@@ -3533,6 +3545,11 @@ var ChoicesRestful = /** @class */ (function (_super) {
|
|
3533
3545
|
configurable: true
|
3534
3546
|
});
|
3535
3547
|
Object.defineProperty(ChoicesRestful.prototype, "allowEmptyResponse", {
|
3548
|
+
/**
|
3549
|
+
* Specifies whether the service is allowed to return an empty response or an empty array in a response.
|
3550
|
+
*
|
3551
|
+
* Default value: `false`
|
3552
|
+
*/
|
3536
3553
|
get: function () {
|
3537
3554
|
return this.getPropertyValue("allowEmptyResponse");
|
3538
3555
|
},
|
@@ -3767,10 +3784,10 @@ var ChoicesRestfull = /** @class */ (function (_super) {
|
|
3767
3784
|
};
|
3768
3785
|
Object.defineProperty(ChoicesRestfull, "onBeforeSendRequest", {
|
3769
3786
|
get: function () {
|
3770
|
-
return
|
3787
|
+
return _settings__WEBPACK_IMPORTED_MODULE_4__["settings"].web.onBeforeRequestChoices;
|
3771
3788
|
},
|
3772
3789
|
set: function (val) {
|
3773
|
-
|
3790
|
+
_settings__WEBPACK_IMPORTED_MODULE_4__["settings"].web.onBeforeRequestChoices = val;
|
3774
3791
|
},
|
3775
3792
|
enumerable: false,
|
3776
3793
|
configurable: true
|
@@ -9426,8 +9443,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
9426
9443
|
//import "../../modern.scss";
|
9427
9444
|
var Version;
|
9428
9445
|
var ReleaseDate;
|
9429
|
-
Version = "" + "1.9.
|
9430
|
-
ReleaseDate = "" + "2023-12-
|
9446
|
+
Version = "" + "1.9.123";
|
9447
|
+
ReleaseDate = "" + "2023-12-26";
|
9431
9448
|
function checkLibraryVersion(ver, libraryName) {
|
9432
9449
|
if (Version != ver) {
|
9433
9450
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
@@ -16937,7 +16954,7 @@ var Helpers = /** @class */ (function () {
|
|
16937
16954
|
if (x["equals"])
|
16938
16955
|
return x.equals(y);
|
16939
16956
|
if (!!x.toJSON && !!y.toJSON && !!x.getType && !!y.getType) {
|
16940
|
-
if (x.
|
16957
|
+
if (x.isDisposed || y.isDisposed)
|
16941
16958
|
return false;
|
16942
16959
|
if (x.getType() !== y.getType())
|
16943
16960
|
return false;
|
@@ -18345,7 +18362,7 @@ var ItemValue = /** @class */ (function (_super) {
|
|
18345
18362
|
};
|
18346
18363
|
Object.defineProperty(ItemValue.prototype, "visibleIf", {
|
18347
18364
|
get: function () {
|
18348
|
-
return this.
|
18365
|
+
return this.getPropertyValueWithoutDefault("visibleIf") || "";
|
18349
18366
|
},
|
18350
18367
|
set: function (val) {
|
18351
18368
|
this.setPropertyValue("visibleIf", val);
|
@@ -18355,7 +18372,7 @@ var ItemValue = /** @class */ (function (_super) {
|
|
18355
18372
|
});
|
18356
18373
|
Object.defineProperty(ItemValue.prototype, "enableIf", {
|
18357
18374
|
get: function () {
|
18358
|
-
return this.
|
18375
|
+
return this.getPropertyValueWithoutDefault("enableIf") || "";
|
18359
18376
|
},
|
18360
18377
|
set: function (val) {
|
18361
18378
|
this.setPropertyValue("enableIf", val);
|
@@ -18365,7 +18382,8 @@ var ItemValue = /** @class */ (function (_super) {
|
|
18365
18382
|
});
|
18366
18383
|
Object.defineProperty(ItemValue.prototype, "isVisible", {
|
18367
18384
|
get: function () {
|
18368
|
-
|
18385
|
+
var res = this.getPropertyValueWithoutDefault("isVisible");
|
18386
|
+
return res !== undefined ? res : true;
|
18369
18387
|
},
|
18370
18388
|
enumerable: false,
|
18371
18389
|
configurable: true
|
@@ -18375,7 +18393,8 @@ var ItemValue = /** @class */ (function (_super) {
|
|
18375
18393
|
};
|
18376
18394
|
Object.defineProperty(ItemValue.prototype, "isEnabled", {
|
18377
18395
|
get: function () {
|
18378
|
-
|
18396
|
+
var res = this.getPropertyValueWithoutDefault("isEnabled");
|
18397
|
+
return res !== undefined ? res : true;
|
18379
18398
|
},
|
18380
18399
|
enumerable: false,
|
18381
18400
|
configurable: true
|
@@ -18520,7 +18539,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("itemvalue", [
|
|
18520
18539
|
/*!***************************!*\
|
18521
18540
|
!*** ./src/jsonobject.ts ***!
|
18522
18541
|
\***************************/
|
18523
|
-
/*! exports provided: property, propertyArray, JsonObjectProperty, CustomPropertiesCollection, JsonMetadataClass, JsonMetadata, JsonError, JsonUnknownPropertyError, JsonMissingTypeErrorBase, JsonMissingTypeError, JsonIncorrectTypeError, JsonRequiredPropertyError, JsonRequiredArrayPropertyError, JsonObject, Serializer */
|
18542
|
+
/*! exports provided: property, propertyArray, JsonObjectProperty, CustomPropertiesCollection, JsonMetadataClass, JsonMetadata, JsonError, JsonUnknownPropertyError, JsonMissingTypeErrorBase, JsonMissingTypeError, JsonIncorrectTypeError, JsonRequiredPropertyError, JsonRequiredArrayPropertyError, JsonIncorrectPropertyValueError, JsonObject, Serializer */
|
18524
18543
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
18525
18544
|
|
18526
18545
|
"use strict";
|
@@ -18538,6 +18557,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
18538
18557
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JsonIncorrectTypeError", function() { return JsonIncorrectTypeError; });
|
18539
18558
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JsonRequiredPropertyError", function() { return JsonRequiredPropertyError; });
|
18540
18559
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JsonRequiredArrayPropertyError", function() { return JsonRequiredArrayPropertyError; });
|
18560
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JsonIncorrectPropertyValueError", function() { return JsonIncorrectPropertyValueError; });
|
18541
18561
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JsonObject", function() { return JsonObject; });
|
18542
18562
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Serializer", function() { return Serializer; });
|
18543
18563
|
/* harmony import */ var _surveyStrings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./surveyStrings */ "./src/surveyStrings.ts");
|
@@ -18874,6 +18894,12 @@ var JsonObjectProperty = /** @class */ (function () {
|
|
18874
18894
|
}
|
18875
18895
|
}
|
18876
18896
|
};
|
18897
|
+
JsonObjectProperty.prototype.validateValue = function (value) {
|
18898
|
+
var choices = this.choices;
|
18899
|
+
if (!Array.isArray(choices) || choices.length === 0)
|
18900
|
+
return true;
|
18901
|
+
return choices.indexOf(value) > -1;
|
18902
|
+
};
|
18877
18903
|
JsonObjectProperty.prototype.getObjType = function (objType) {
|
18878
18904
|
if (!this.classNamePart)
|
18879
18905
|
return objType;
|
@@ -19951,8 +19977,8 @@ var JsonMetadata = /** @class */ (function () {
|
|
19951
19977
|
};
|
19952
19978
|
JsonMetadata.prototype.getChemeRefName = function (className, isRoot) {
|
19953
19979
|
//Fix for #6486, according to https://niem.github.io/json/reference/json-schema/references/#:~:text=In%20a%20JSON%20schema%2C%20a,%2C%20an%20in%2Dschema%20reference
|
19954
|
-
|
19955
|
-
|
19980
|
+
//Checked by https://www.jsonschemavalidator.net/
|
19981
|
+
return isRoot ? "#/definitions/" + className : className;
|
19956
19982
|
};
|
19957
19983
|
JsonMetadata.prototype.generateChemaClass = function (className, schemaDef, isRoot) {
|
19958
19984
|
if (!!schemaDef[className])
|
@@ -20107,6 +20133,17 @@ var JsonRequiredArrayPropertyError = /** @class */ (function (_super) {
|
|
20107
20133
|
return JsonRequiredArrayPropertyError;
|
20108
20134
|
}(JsonError));
|
20109
20135
|
|
20136
|
+
var JsonIncorrectPropertyValueError = /** @class */ (function (_super) {
|
20137
|
+
__extends(JsonIncorrectPropertyValueError, _super);
|
20138
|
+
function JsonIncorrectPropertyValueError(property, value) {
|
20139
|
+
var _this = _super.call(this, "incorrectvalue", "The property value: '" + value + "' is incorrect for property '" + property.name + "'.") || this;
|
20140
|
+
_this.property = property;
|
20141
|
+
_this.value = value;
|
20142
|
+
return _this;
|
20143
|
+
}
|
20144
|
+
return JsonIncorrectPropertyValueError;
|
20145
|
+
}(JsonError));
|
20146
|
+
|
20110
20147
|
var JsonObject = /** @class */ (function () {
|
20111
20148
|
function JsonObject() {
|
20112
20149
|
this.errors = new Array();
|
@@ -20123,14 +20160,14 @@ var JsonObject = /** @class */ (function () {
|
|
20123
20160
|
if (storeDefaults === void 0) { storeDefaults = false; }
|
20124
20161
|
return this.toJsonObjectCore(obj, null, storeDefaults);
|
20125
20162
|
};
|
20126
|
-
JsonObject.prototype.toObject = function (jsonObj, obj) {
|
20127
|
-
this.toObjectCore(jsonObj, obj);
|
20163
|
+
JsonObject.prototype.toObject = function (jsonObj, obj, options) {
|
20164
|
+
this.toObjectCore(jsonObj, obj, options);
|
20128
20165
|
var error = this.getRequiredError(obj, jsonObj);
|
20129
20166
|
if (!!error) {
|
20130
20167
|
this.addNewError(error, jsonObj, obj);
|
20131
20168
|
}
|
20132
20169
|
};
|
20133
|
-
JsonObject.prototype.toObjectCore = function (jsonObj, obj) {
|
20170
|
+
JsonObject.prototype.toObjectCore = function (jsonObj, obj, options) {
|
20134
20171
|
if (!jsonObj)
|
20135
20172
|
return;
|
20136
20173
|
var properties = null;
|
@@ -20148,6 +20185,7 @@ var JsonObject = /** @class */ (function () {
|
|
20148
20185
|
obj.startLoadingFromJson(jsonObj);
|
20149
20186
|
}
|
20150
20187
|
properties = this.addDynamicProperties(obj, jsonObj, properties);
|
20188
|
+
this.options = options;
|
20151
20189
|
for (var key in jsonObj) {
|
20152
20190
|
if (key === JsonObject.typePropertyName)
|
20153
20191
|
continue;
|
@@ -20162,8 +20200,9 @@ var JsonObject = /** @class */ (function () {
|
|
20162
20200
|
}
|
20163
20201
|
continue;
|
20164
20202
|
}
|
20165
|
-
this.valueToObj(jsonObj[key], obj, property, jsonObj);
|
20203
|
+
this.valueToObj(jsonObj[key], obj, property, jsonObj, options);
|
20166
20204
|
}
|
20205
|
+
this.options = undefined;
|
20167
20206
|
if (obj.endLoadingFromJson) {
|
20168
20207
|
obj.endLoadingFromJson();
|
20169
20208
|
}
|
@@ -20236,7 +20275,7 @@ var JsonObject = /** @class */ (function () {
|
|
20236
20275
|
}
|
20237
20276
|
}
|
20238
20277
|
};
|
20239
|
-
JsonObject.prototype.valueToObj = function (value, obj, property, jsonObj) {
|
20278
|
+
JsonObject.prototype.valueToObj = function (value, obj, property, jsonObj, options) {
|
20240
20279
|
if (value === null || value === undefined)
|
20241
20280
|
return;
|
20242
20281
|
this.removePos(property, value);
|
@@ -20250,17 +20289,22 @@ var JsonObject = /** @class */ (function () {
|
|
20250
20289
|
this.addNewError(new JsonRequiredArrayPropertyError(propName, obj.getType()), !!jsonObj ? jsonObj : value, obj);
|
20251
20290
|
}
|
20252
20291
|
if (this.isValueArray(value)) {
|
20253
|
-
this.valueToArray(value, obj, property.name, property);
|
20292
|
+
this.valueToArray(value, obj, property.name, property, options);
|
20254
20293
|
return;
|
20255
20294
|
}
|
20256
20295
|
var newObj = this.createNewObj(value, property);
|
20257
20296
|
if (newObj.newObj) {
|
20258
|
-
this.toObjectCore(value, newObj.newObj);
|
20297
|
+
this.toObjectCore(value, newObj.newObj, options);
|
20259
20298
|
value = newObj.newObj;
|
20260
20299
|
}
|
20261
20300
|
if (!newObj.error) {
|
20262
20301
|
if (property != null) {
|
20263
20302
|
property.setValue(obj, value, this);
|
20303
|
+
if (!!options && options.validatePropertyValues) {
|
20304
|
+
if (!property.validateValue(value)) {
|
20305
|
+
this.addNewError(new JsonIncorrectPropertyValueError(property, value), jsonObj, obj);
|
20306
|
+
}
|
20307
|
+
}
|
20264
20308
|
}
|
20265
20309
|
else {
|
20266
20310
|
obj[property.name] = value;
|
@@ -20359,17 +20403,17 @@ var JsonObject = /** @class */ (function () {
|
|
20359
20403
|
error.at = posObj.start;
|
20360
20404
|
error.end = posObj.end;
|
20361
20405
|
};
|
20362
|
-
JsonObject.prototype.valueToArray = function (value, obj, key, property) {
|
20406
|
+
JsonObject.prototype.valueToArray = function (value, obj, key, property, options) {
|
20363
20407
|
if (obj[key] && !this.isValueArray(obj[key]))
|
20364
20408
|
return;
|
20365
20409
|
if (obj[key] && value.length > 0)
|
20366
20410
|
obj[key].splice(0, obj[key].length);
|
20367
20411
|
var valueRes = obj[key] ? obj[key] : [];
|
20368
|
-
this.addValuesIntoArray(value, valueRes, property);
|
20412
|
+
this.addValuesIntoArray(value, valueRes, property, options);
|
20369
20413
|
if (!obj[key])
|
20370
20414
|
obj[key] = valueRes;
|
20371
20415
|
};
|
20372
|
-
JsonObject.prototype.addValuesIntoArray = function (value, result, property) {
|
20416
|
+
JsonObject.prototype.addValuesIntoArray = function (value, result, property, options) {
|
20373
20417
|
for (var i = 0; i < value.length; i++) {
|
20374
20418
|
var newValue = this.createNewObj(value[i], property);
|
20375
20419
|
if (newValue.newObj) {
|
@@ -20380,7 +20424,7 @@ var JsonObject = /** @class */ (function () {
|
|
20380
20424
|
newValue.newObj.valueName = value[i].valueName.toString();
|
20381
20425
|
}
|
20382
20426
|
result.push(newValue.newObj);
|
20383
|
-
this.toObjectCore(value[i], newValue.newObj);
|
20427
|
+
this.toObjectCore(value[i], newValue.newObj, options);
|
20384
20428
|
}
|
20385
20429
|
else {
|
20386
20430
|
if (!newValue.error) {
|
@@ -21222,14 +21266,21 @@ var LocalizableString = /** @class */ (function () {
|
|
21222
21266
|
if (this.htmlValues[loc] !== undefined)
|
21223
21267
|
return !!this.htmlValues[loc];
|
21224
21268
|
var renderedText = this.calculatedText;
|
21225
|
-
if (!renderedText)
|
21269
|
+
if (!renderedText) {
|
21270
|
+
this.setHtmlValue(loc, "");
|
21226
21271
|
return false;
|
21227
|
-
|
21272
|
+
}
|
21273
|
+
if (!!this.getLocalizationName() && renderedText === this.getLocalizationStr()) {
|
21274
|
+
this.setHtmlValue(loc, "");
|
21228
21275
|
return false;
|
21276
|
+
}
|
21229
21277
|
var res = this.owner.getMarkdownHtml(renderedText, this.name);
|
21230
|
-
this.
|
21278
|
+
this.setHtmlValue(loc, res);
|
21231
21279
|
return !!res;
|
21232
21280
|
};
|
21281
|
+
LocalizableString.prototype.setHtmlValue = function (loc, val) {
|
21282
|
+
this.htmlValues[loc] = val;
|
21283
|
+
};
|
21233
21284
|
LocalizableString.prototype.getHtmlValue = function () {
|
21234
21285
|
var loc = this.locale;
|
21235
21286
|
if (!loc)
|
@@ -36780,6 +36831,9 @@ var Question = /** @class */ (function (_super) {
|
|
36780
36831
|
if (this.questionComment === newValue)
|
36781
36832
|
return;
|
36782
36833
|
this.questionComment = newValue;
|
36834
|
+
this.setCommentIntoData(newValue);
|
36835
|
+
};
|
36836
|
+
Question.prototype.setCommentIntoData = function (newValue) {
|
36783
36837
|
if (this.data != null) {
|
36784
36838
|
this.data.setComment(this.getValueName(), newValue, this.isSurveyInputTextUpdate ? "text" : false);
|
36785
36839
|
}
|
@@ -38163,7 +38217,16 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
38163
38217
|
if (this.getStoreOthersAsComment() && !this.autoOtherMode) {
|
38164
38218
|
this.prevOtherValue = this.otherValue;
|
38165
38219
|
}
|
38166
|
-
this.
|
38220
|
+
this.makeCommentEmpty = true;
|
38221
|
+
this.otherValueCore = "";
|
38222
|
+
this.setPropertyValue("comment", "");
|
38223
|
+
}
|
38224
|
+
};
|
38225
|
+
QuestionSelectBase.prototype.setValueCore = function (newValue) {
|
38226
|
+
_super.prototype.setValueCore.call(this, newValue);
|
38227
|
+
if (this.makeCommentEmpty) {
|
38228
|
+
this.setCommentIntoData("");
|
38229
|
+
this.makeCommentEmpty = false;
|
38167
38230
|
}
|
38168
38231
|
};
|
38169
38232
|
QuestionSelectBase.prototype.setNewValue = function (newValue) {
|
@@ -38286,9 +38349,9 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
38286
38349
|
};
|
38287
38350
|
Object.defineProperty(QuestionSelectBase.prototype, "choicesByUrl", {
|
38288
38351
|
/**
|
38289
|
-
* 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.
|
38352
|
+
* 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.
|
38290
38353
|
*
|
38291
|
-
* [View Demo](https://surveyjs.io/form-library/examples/
|
38354
|
+
* [View Demo](https://surveyjs.io/form-library/examples/dropdown-menu-load-data-from-restful-service/ (linkStyle))
|
38292
38355
|
* @see choices
|
38293
38356
|
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
|
38294
38357
|
*/
|
@@ -46138,13 +46201,15 @@ var QuestionMatrixModel = /** @class */ (function (_super) {
|
|
46138
46201
|
var isChecked = row.value == column.value;
|
46139
46202
|
var isDisabled = this.isReadOnly;
|
46140
46203
|
var allowHover = !isChecked && !isDisabled;
|
46204
|
+
var hasCellText = this.hasCellText;
|
46205
|
+
var css = this.cssClasses;
|
46141
46206
|
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_11__["CssClassBuilder"]()
|
46142
|
-
.append(
|
46143
|
-
.append(
|
46144
|
-
.append(
|
46145
|
-
.append(
|
46146
|
-
.append(
|
46147
|
-
.append(
|
46207
|
+
.append(css.cell, hasCellText)
|
46208
|
+
.append(hasCellText ? css.cellText : css.label)
|
46209
|
+
.append(css.itemOnError, !hasCellText && this.hasCssError())
|
46210
|
+
.append(hasCellText ? css.cellTextSelected : css.itemChecked, isChecked)
|
46211
|
+
.append(hasCellText ? css.cellTextDisabled : css.itemDisabled, isDisabled)
|
46212
|
+
.append(css.itemHover, allowHover && !hasCellText)
|
46148
46213
|
.toString();
|
46149
46214
|
};
|
46150
46215
|
Object.defineProperty(QuestionMatrixModel.prototype, "itemSvgIcon", {
|
@@ -47237,7 +47302,7 @@ var MatrixDropdownRowModelBase = /** @class */ (function () {
|
|
47237
47302
|
if (this.data.isValidateOnValueChanging && this.hasQuestonError(changedQuestion))
|
47238
47303
|
return;
|
47239
47304
|
var isDeleting = newColumnValue == null && !changedQuestion ||
|
47240
|
-
isComment && !newColumnValue && !!changedQuestion
|
47305
|
+
isComment && !newColumnValue && !!changedQuestion;
|
47241
47306
|
this.data.onRowChanged(this, changedName, newValue, isDeleting);
|
47242
47307
|
if (changedName) {
|
47243
47308
|
this.runTriggers(MatrixDropdownTotalRowModel.RowVariableName + "." + changedName, newValue);
|
@@ -47938,6 +48003,7 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
47938
48003
|
this.resetRenderedTable();
|
47939
48004
|
this.fireCallback(this.columnsChangedCallback);
|
47940
48005
|
};
|
48006
|
+
//For internal use
|
47941
48007
|
QuestionMatrixDropdownModelBase.prototype.resetRenderedTable = function () {
|
47942
48008
|
if (this.lockResetRenderedTable || this.isUpdateLocked)
|
47943
48009
|
return;
|
@@ -49405,16 +49471,17 @@ function onUpdateSelectBaseCellQuestion(cellQuestion, column, question, data) {
|
|
49405
49471
|
cellQuestion.choicesByUrl.run(data.getTextProcessor());
|
49406
49472
|
}
|
49407
49473
|
}
|
49474
|
+
function onUpdateSelectDropdownCellQuestion(cellQuestion, column, question, data) {
|
49475
|
+
onUpdateSelectBaseCellQuestion(cellQuestion, column, question, data);
|
49476
|
+
if (!!cellQuestion.locPlaceholder && cellQuestion.locPlaceholder.isEmpty && !question.locPlaceholder.isEmpty) {
|
49477
|
+
cellQuestion.optionsCaption = question.optionsCaption;
|
49478
|
+
}
|
49479
|
+
}
|
49408
49480
|
var matrixDropdownColumnTypes = {
|
49409
49481
|
dropdown: {
|
49410
49482
|
onCellQuestionUpdate: function (cellQuestion, column, question, data) {
|
49411
|
-
|
49412
|
-
|
49413
|
-
cellQuestion.locPlaceholder.isEmpty &&
|
49414
|
-
!question.locPlaceholder.isEmpty) {
|
49415
|
-
cellQuestion.optionsCaption = question.optionsCaption;
|
49416
|
-
}
|
49417
|
-
},
|
49483
|
+
onUpdateSelectDropdownCellQuestion(cellQuestion, column, question, data);
|
49484
|
+
}
|
49418
49485
|
},
|
49419
49486
|
checkbox: {
|
49420
49487
|
onCellQuestionUpdate: function (cellQuestion, column, question, data) {
|
@@ -49430,7 +49497,11 @@ var matrixDropdownColumnTypes = {
|
|
49430
49497
|
column.colCount > -1 ? column.colCount : question.columnColCount;
|
49431
49498
|
},
|
49432
49499
|
},
|
49433
|
-
tagbox: {
|
49500
|
+
tagbox: {
|
49501
|
+
onCellQuestionUpdate: function (cellQuestion, column, question, data) {
|
49502
|
+
onUpdateSelectBaseCellQuestion(cellQuestion, column, question, data);
|
49503
|
+
}
|
49504
|
+
},
|
49434
49505
|
text: {},
|
49435
49506
|
comment: {},
|
49436
49507
|
boolean: {
|
@@ -50488,6 +50559,8 @@ var QuestionMatrixDropdownRenderedCell = /** @class */ (function () {
|
|
50488
50559
|
return "";
|
50489
50560
|
return this.cell.column.locCellHint.renderedHtml;
|
50490
50561
|
}
|
50562
|
+
if (this.hasQuestion && this.question.isVisible && this.question.title)
|
50563
|
+
return this.question.title;
|
50491
50564
|
return this.cell.column.title;
|
50492
50565
|
}
|
50493
50566
|
if (this.hasQuestion && this.question.isVisible) {
|
@@ -54033,7 +54106,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
54033
54106
|
_this.registerPropertyChangedHandlers(["panelsState"], function () {
|
54034
54107
|
_this.setPanelsState();
|
54035
54108
|
});
|
54036
|
-
_this.registerPropertyChangedHandlers(["isMobile"], function () {
|
54109
|
+
_this.registerPropertyChangedHandlers(["isMobile", "newPanelPosition", "showRangeInProgress", "renderMode"], function () {
|
54037
54110
|
_this.updateFooterActions();
|
54038
54111
|
});
|
54039
54112
|
_this.registerPropertyChangedHandlers(["allowAddPanel"], function () { _this.updateNoEntriesTextDefaultLoc(); });
|
@@ -54862,6 +54935,8 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
54862
54935
|
* Specifies whether users are allowed to add new panels.
|
54863
54936
|
*
|
54864
54937
|
* Default value: `true`
|
54938
|
+
*
|
54939
|
+
* By default, users add new panels to the end. If you want to let users insert a new panel after the current panel, set the [`newPanelPosition`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#newPanelPosition) property to `"next"`.
|
54865
54940
|
* @see canAddPanel
|
54866
54941
|
* @see allowRemovePanel
|
54867
54942
|
*/
|
@@ -54874,6 +54949,26 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
54874
54949
|
enumerable: false,
|
54875
54950
|
configurable: true
|
54876
54951
|
});
|
54952
|
+
Object.defineProperty(QuestionPanelDynamicModel.prototype, "newPanelPosition", {
|
54953
|
+
/**
|
54954
|
+
* Specifies the position of newly added panels.
|
54955
|
+
*
|
54956
|
+
* Possible values:
|
54957
|
+
*
|
54958
|
+
* - `"last"` (default) - New panels are added to the end.
|
54959
|
+
* - `"next"` - New panels are inserted after the current panel.
|
54960
|
+
* @see allowAddPanel
|
54961
|
+
* @see addPanel
|
54962
|
+
*/
|
54963
|
+
get: function () {
|
54964
|
+
return this.getPropertyValue("newPanelPosition");
|
54965
|
+
},
|
54966
|
+
set: function (val) {
|
54967
|
+
this.setPropertyValue("newPanelPosition", val);
|
54968
|
+
},
|
54969
|
+
enumerable: false,
|
54970
|
+
configurable: true
|
54971
|
+
});
|
54877
54972
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "allowRemovePanel", {
|
54878
54973
|
/**
|
54879
54974
|
* Specifies whether users are allowed to delete panels.
|
@@ -54977,7 +55072,6 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
54977
55072
|
},
|
54978
55073
|
set: function (val) {
|
54979
55074
|
this.setPropertyValue("showRangeInProgress", val);
|
54980
|
-
this.updateFooterActions();
|
54981
55075
|
this.fireCallback(this.currentIndexChangedCallback);
|
54982
55076
|
},
|
54983
55077
|
enumerable: false,
|
@@ -55000,7 +55094,6 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
55000
55094
|
},
|
55001
55095
|
set: function (val) {
|
55002
55096
|
this.setPropertyValue("renderMode", val);
|
55003
|
-
this.updateFooterActions();
|
55004
55097
|
this.fireCallback(this.renderModeChangedCallback);
|
55005
55098
|
},
|
55006
55099
|
enumerable: false,
|
@@ -55083,7 +55176,8 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
55083
55176
|
get: function () {
|
55084
55177
|
if (this.isDesignMode)
|
55085
55178
|
return false;
|
55086
|
-
if (this.isDefaultV2Theme && !this.legacyNavigation && !this.isRenderModeList &&
|
55179
|
+
if (this.isDefaultV2Theme && !this.legacyNavigation && !this.isRenderModeList &&
|
55180
|
+
(this.currentIndex < this.visiblePanelCount - 1 && this.newPanelPosition !== "next")) {
|
55087
55181
|
return false;
|
55088
55182
|
}
|
55089
55183
|
return (this.allowAddPanel &&
|
@@ -55240,6 +55334,8 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
55240
55334
|
* @param index *(Optional)* An index at which to insert the new panel. `undefined` adds the panel to the end or inserts it after the current panel if [`renderMode`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#renderMode) is `"tab"`. A negative index (for instance, -1) adds the panel to the end in all cases, regardless of the `renderMode` value.
|
55241
55335
|
* @see panelCount
|
55242
55336
|
* @see panels
|
55337
|
+
* @see allowAddPanel
|
55338
|
+
* @see newPanelPosition
|
55243
55339
|
*/
|
55244
55340
|
QuestionPanelDynamicModel.prototype.addPanel = function (index) {
|
55245
55341
|
var curIndex = this.currentIndex;
|
@@ -55304,13 +55400,23 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
55304
55400
|
var _this = this;
|
55305
55401
|
if (!this.canRemovePanel)
|
55306
55402
|
return;
|
55307
|
-
if (this.
|
55403
|
+
if (this.isRequireConfirmOnDelete(value)) {
|
55308
55404
|
Object(_utils_utils__WEBPACK_IMPORTED_MODULE_9__["confirmActionAsync"])(this.confirmDeleteText, function () { _this.removePanel(value); });
|
55309
55405
|
}
|
55310
55406
|
else {
|
55311
55407
|
this.removePanel(value);
|
55312
55408
|
}
|
55313
55409
|
};
|
55410
|
+
QuestionPanelDynamicModel.prototype.isRequireConfirmOnDelete = function (val) {
|
55411
|
+
if (!this.confirmDelete)
|
55412
|
+
return false;
|
55413
|
+
var index = this.getVisualPanelIndex(val);
|
55414
|
+
if (index < 0 || index >= this.visiblePanelCount)
|
55415
|
+
return false;
|
55416
|
+
var panelValue = this.visiblePanels[index].getValue();
|
55417
|
+
return !this.isValueEmpty(panelValue) &&
|
55418
|
+
(this.isValueEmpty(this.defaultPanelValue) || !this.isTwoValueEquals(panelValue, this.defaultPanelValue));
|
55419
|
+
};
|
55314
55420
|
/**
|
55315
55421
|
* Switches Dynamic Panel to the next panel. Returns `true` in case of success, or `false` if `renderMode` is `"list"` or the current panel contains validation errors.
|
55316
55422
|
* @see renderMode
|
@@ -55540,6 +55646,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
55540
55646
|
if (this.isReadOnly || !this.allowAddPanel) {
|
55541
55647
|
this.updateNoEntriesTextDefaultLoc();
|
55542
55648
|
}
|
55649
|
+
this.updateFooterActions();
|
55543
55650
|
_super.prototype.onSurveyLoad.call(this);
|
55544
55651
|
};
|
55545
55652
|
QuestionPanelDynamicModel.prototype.onFirstRendering = function () {
|
@@ -56364,6 +56471,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_5__["Serializer"].addClass("paneldynamic",
|
|
56364
56471
|
{ name: "noEntriesText:text", serializationProperty: "locNoEntriesText" },
|
56365
56472
|
{ name: "allowAddPanel:boolean", default: true },
|
56366
56473
|
{ name: "allowRemovePanel:boolean", default: true },
|
56474
|
+
{ name: "newPanelPosition", choices: ["next", "last"], default: "last", category: "layout" },
|
56367
56475
|
{
|
56368
56476
|
name: "panelCount:number",
|
56369
56477
|
isBindable: true,
|
@@ -58989,6 +59097,7 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
|
|
58989
59097
|
_this.onOpened = _this.addEvent();
|
58990
59098
|
_this.createLocalizableString("placeholder", _this, false, true);
|
58991
59099
|
_this.createLocalizableString("clearCaption", _this, false, true);
|
59100
|
+
_this.createLocalizableString("readOnlyText", _this, true);
|
58992
59101
|
_this.registerPropertyChangedHandlers(["value", "renderAs", "showOtherItem", "otherText", "placeholder", "choices", "visibleChoices"], function () {
|
58993
59102
|
_this.updateReadOnlyText();
|
58994
59103
|
});
|
@@ -59050,6 +59159,23 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
|
|
59050
59159
|
enumerable: false,
|
59051
59160
|
configurable: true
|
59052
59161
|
});
|
59162
|
+
Object.defineProperty(QuestionTagboxModel.prototype, "readOnlyText", {
|
59163
|
+
get: function () {
|
59164
|
+
return this.getLocalizableStringText("readOnlyText");
|
59165
|
+
},
|
59166
|
+
set: function (val) {
|
59167
|
+
this.setLocalizableStringText("readOnlyText", val);
|
59168
|
+
},
|
59169
|
+
enumerable: false,
|
59170
|
+
configurable: true
|
59171
|
+
});
|
59172
|
+
Object.defineProperty(QuestionTagboxModel.prototype, "locReadOnlyText", {
|
59173
|
+
get: function () {
|
59174
|
+
return this.getLocalizableString("readOnlyText");
|
59175
|
+
},
|
59176
|
+
enumerable: false,
|
59177
|
+
configurable: true
|
59178
|
+
});
|
59053
59179
|
QuestionTagboxModel.prototype.getType = function () {
|
59054
59180
|
return "tagbox";
|
59055
59181
|
};
|
@@ -59175,9 +59301,6 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
|
|
59175
59301
|
enumerable: false,
|
59176
59302
|
configurable: true
|
59177
59303
|
});
|
59178
|
-
__decorate([
|
59179
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: "" })
|
59180
|
-
], QuestionTagboxModel.prototype, "readOnlyText", void 0);
|
59181
59304
|
__decorate([
|
59182
59305
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
|
59183
59306
|
], QuestionTagboxModel.prototype, "allowClear", void 0);
|
@@ -63738,6 +63861,9 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
|
|
63738
63861
|
SurveyQuestionDropdownBase.prototype.getValueCore = function () {
|
63739
63862
|
return this.questionBase.renderedValue;
|
63740
63863
|
};
|
63864
|
+
SurveyQuestionDropdownBase.prototype.renderReadOnlyElement = function () {
|
63865
|
+
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null, this.question.readOnlyText);
|
63866
|
+
};
|
63741
63867
|
SurveyQuestionDropdownBase.prototype.renderSelect = function (cssClasses) {
|
63742
63868
|
var _a, _b;
|
63743
63869
|
var selectElement = null;
|
@@ -63747,7 +63873,7 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
|
|
63747
63873
|
// @ts-ignore
|
63748
63874
|
selectElement = react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), disabled: true },
|
63749
63875
|
text,
|
63750
|
-
|
63876
|
+
this.renderReadOnlyElement());
|
63751
63877
|
}
|
63752
63878
|
else {
|
63753
63879
|
if (!this.question["dropdownListModel"]) {
|
@@ -67898,6 +68024,9 @@ var SurveyQuestionMatrixRow = /** @class */ (function (_super) {
|
|
67898
68024
|
td = (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("td", { key: key, className: itemClass, onClick: getHandler ? getHandler(column) : function () { } }, this.renderLocString(this.question.getCellDisplayLocText(row.name, column))));
|
67899
68025
|
}
|
67900
68026
|
else {
|
68027
|
+
var mobileSpan = this.question.isMobile ?
|
68028
|
+
(react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.cssClasses.cellResponsiveTitle }, this.renderLocString(column.locText)))
|
68029
|
+
: undefined;
|
67901
68030
|
td = (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("td", { key: key, "data-responsive-title": column.locText.renderedHtml, className: this.question.cssClasses.cell },
|
67902
68031
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("label", { onMouseDown: this.handleOnMouseDown, className: itemClass },
|
67903
68032
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { id: inputId, type: "radio", className: this.cssClasses.itemValue, name: row.fullName, value: column.value, disabled: this.isDisplayMode, checked: isChecked, onChange: this.handleOnChange, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.getCellAriaLabel(row.locText.renderedHtml, column.locText.renderedHtml), "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-describedby": this.question.a11y_input_ariaDescribedBy }),
|
@@ -67905,7 +68034,7 @@ var SurveyQuestionMatrixRow = /** @class */ (function (_super) {
|
|
67905
68034
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("svg", { className: this.cssClasses.itemDecorator },
|
67906
68035
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("use", { xlinkHref: this.question.itemSvgIcon })) :
|
67907
68036
|
null),
|
67908
|
-
|
68037
|
+
mobileSpan)));
|
67909
68038
|
}
|
67910
68039
|
tds.push(td);
|
67911
68040
|
}
|
@@ -69474,6 +69603,14 @@ var SurveyQuestionTagbox = /** @class */ (function (_super) {
|
|
69474
69603
|
select,
|
69475
69604
|
comment));
|
69476
69605
|
};
|
69606
|
+
SurveyQuestionTagbox.prototype.renderReadOnlyElement = function () {
|
69607
|
+
if (this.question.locReadOnlyText) {
|
69608
|
+
return this.renderLocString(this.question.locReadOnlyText);
|
69609
|
+
}
|
69610
|
+
else {
|
69611
|
+
return null;
|
69612
|
+
}
|
69613
|
+
};
|
69477
69614
|
return SurveyQuestionTagbox;
|
69478
69615
|
}(_dropdown_base__WEBPACK_IMPORTED_MODULE_2__["SurveyQuestionDropdownBase"]));
|
69479
69616
|
|
@@ -70502,14 +70639,8 @@ var settings = {
|
|
70502
70639
|
showEmptyTitles: true
|
70503
70640
|
},
|
70504
70641
|
//#region designMode section, Obsolete properties
|
70505
|
-
/**
|
70506
|
-
* This property is obsolete. Use the [`settings.designMode.showEmptyDescriptions`](https://surveyjs.io/form-library/documentation/api-reference/settings#designMode) property instead.
|
70507
|
-
*/
|
70508
70642
|
get allowShowEmptyDescriptionInDesignMode() { return this.designMode.showEmptyDescriptions; },
|
70509
70643
|
set allowShowEmptyDescriptionInDesignMode(val) { this.designMode.showEmptyDescriptions = val; },
|
70510
|
-
/**
|
70511
|
-
* This property is obsolete. Use the [`settings.designMode.showEmptyTitles`](https://surveyjs.io/form-library/documentation/api-reference/settings#designMode) property instead.
|
70512
|
-
*/
|
70513
70644
|
get allowShowEmptyTitleInDesignMode() { return this.designMode.showEmptyTitles; },
|
70514
70645
|
set allowShowEmptyTitleInDesignMode(val) { this.designMode.showEmptyTitles = val; },
|
70515
70646
|
//#endregion
|
@@ -70533,19 +70664,10 @@ var settings = {
|
|
70533
70664
|
defaultLocaleName: "default"
|
70534
70665
|
},
|
70535
70666
|
//#region localization section, obsolete properties
|
70536
|
-
/**
|
70537
|
-
* This property is obsolete. Use the [`settings.localization.useLocalTimeZone`](https://surveyjs.io/form-library/documentation/api-reference/settings#localization) property instead.
|
70538
|
-
*/
|
70539
70667
|
get useLocalTimeZone() { return this.localization.useLocalTimeZone; },
|
70540
70668
|
set useLocalTimeZone(val) { this.localization.useLocalTimeZone = val; },
|
70541
|
-
/**
|
70542
|
-
* This property is obsolete. Use the [`settings.localization.storeDuplicatedTranslations`](https://surveyjs.io/form-library/documentation/api-reference/settings#localization) property instead.
|
70543
|
-
*/
|
70544
70669
|
get storeDuplicatedTranslations() { return this.localization.storeDuplicatedTranslations; },
|
70545
70670
|
set storeDuplicatedTranslations(val) { this.localization.storeDuplicatedTranslations = val; },
|
70546
|
-
/**
|
70547
|
-
* This property is obsolete. Use the [`settings.localization.defaultLocaleName`](https://surveyjs.io/form-library/documentation/api-reference/settings#localization) property instead.
|
70548
|
-
*/
|
70549
70671
|
get defaultLocaleName() { return this.localization.defaultLocaleName; },
|
70550
70672
|
set defaultLocaleName(val) { this.localization.defaultLocaleName = val; },
|
70551
70673
|
//#endregion
|
@@ -70558,41 +70680,41 @@ var settings = {
|
|
70558
70680
|
* Specifies whether to encode URL parameters when you access a web service. Default value: `true`.
|
70559
70681
|
*
|
70560
70682
|
* - `cacheLoadedChoices`: `boolean`\
|
70561
|
-
* Specifies whether to cache [choices](https://surveyjs.io/form-library/documentation/api-reference/
|
70683
|
+
* Specifies whether to cache [choices loaded from a web service](https://surveyjs.io/form-library/documentation/api-reference/questionselectbase#choicesByUrl). Default value: `true`.
|
70562
70684
|
*
|
70563
70685
|
* - `disableQuestionWhileLoadingChoices`: `boolean`\
|
70564
70686
|
* Disables a question while its choices are being loaded from a web service. Default value: `false`.
|
70565
70687
|
*
|
70566
70688
|
* - `surveyServiceUrl`: `string`\
|
70567
70689
|
* The URL of the SurveyJS Service API endpoint.
|
70690
|
+
*
|
70691
|
+
* - `onBeforeRequestChoices`: `(sender: ChoicesRestful, options: { request: XMLHttpRequest })`\
|
70692
|
+
* An event that is raised before a request for choices is send. Applies to questions with a specified [`choiceByUrl`](https://surveyjs.io/form-library/documentation/api-reference/questionselectbase#choicesByUrl) property. Use the `options.request` parameter to access and modify the `XMLHttpRequest` object. For instance, you can add authentication headers to it:
|
70693
|
+
*
|
70694
|
+
* ```js
|
70695
|
+
* import { settings } from "survey-core";
|
70696
|
+
*
|
70697
|
+
* settings.web.onBeforeSendRequest = (sender, options) => {
|
70698
|
+
* options.request.setRequestHeader('RequestVerificationToken', requestVerificationToken);
|
70699
|
+
* };
|
70700
|
+
* ```
|
70568
70701
|
*/
|
70569
70702
|
web: {
|
70703
|
+
onBeforeRequestChoices: function (sender, options) { },
|
70570
70704
|
encodeUrlParams: true,
|
70571
70705
|
cacheLoadedChoices: true,
|
70572
70706
|
disableQuestionWhileLoadingChoices: false,
|
70573
70707
|
surveyServiceUrl: "https://api.surveyjs.io/public/v1/Survey"
|
70574
70708
|
},
|
70575
70709
|
//#region web section, obsolete properties
|
70576
|
-
/**
|
70577
|
-
* This property is obsolete. Use the [`settings.web.encodeUrlParams`](https://surveyjs.io/form-library/documentation/api-reference/settings#web) property instead.
|
70578
|
-
*/
|
70579
70710
|
get webserviceEncodeParameters() { return this.web.encodeUrlParams; },
|
70580
70711
|
set webserviceEncodeParameters(val) { this.web.encodeUrlParams = val; },
|
70581
|
-
/**
|
70582
|
-
* This property is obsolete. Use the [`settings.web.cacheLoadedChoices`](https://surveyjs.io/form-library/documentation/api-reference/settings#web) property instead.
|
70583
|
-
*/
|
70584
70712
|
get useCachingForChoicesRestful() { return this.web.cacheLoadedChoices; },
|
70585
70713
|
set useCachingForChoicesRestful(val) { this.web.cacheLoadedChoices = val; },
|
70586
70714
|
get useCachingForChoicesRestfull() { return this.web.cacheLoadedChoices; },
|
70587
70715
|
set useCachingForChoicesRestfull(val) { this.web.cacheLoadedChoices = val; },
|
70588
|
-
/**
|
70589
|
-
* This property is obsolete. Use the [`settings.web.disableQuestionWhileLoadingChoices`](https://surveyjs.io/form-library/documentation/api-reference/settings#web) property instead.
|
70590
|
-
*/
|
70591
70716
|
get disableOnGettingChoicesFromWeb() { return this.web.disableQuestionWhileLoadingChoices; },
|
70592
70717
|
set disableOnGettingChoicesFromWeb(val) { this.web.disableQuestionWhileLoadingChoices = val; },
|
70593
|
-
/**
|
70594
|
-
* This property is obsolete. Use the [`settings.web.surveyServiceUrl`](https://surveyjs.io/form-library/documentation/api-reference/settings#web) property instead.
|
70595
|
-
*/
|
70596
70718
|
get surveyServiceUrl() { return this.web.surveyServiceUrl; },
|
70597
70719
|
set surveyServiceUrl(val) { this.web.surveyServiceUrl = val; },
|
70598
70720
|
//#endregion
|
@@ -70618,19 +70740,10 @@ var settings = {
|
|
70618
70740
|
executeSkipOnValueChanged: true
|
70619
70741
|
},
|
70620
70742
|
//#region triggers section, Obsolete properties
|
70621
|
-
/**
|
70622
|
-
* This property is obsolete. Use the [`settings.triggers.executeCompleteOnValueChanged`](https://surveyjs.io/form-library/documentation/api-reference/settings#triggers) property instead.
|
70623
|
-
*/
|
70624
70743
|
get executeCompleteTriggerOnValueChanged() { return this.triggers.executeCompleteOnValueChanged; },
|
70625
70744
|
set executeCompleteTriggerOnValueChanged(val) { this.triggers.executeCompleteOnValueChanged = val; },
|
70626
|
-
/**
|
70627
|
-
* This property is obsolete. Use the [`settings.triggers.changeNavigationButtonsOnComplete`](https://surveyjs.io/form-library/documentation/api-reference/settings#triggers) property instead.
|
70628
|
-
*/
|
70629
70745
|
get changeNavigationButtonsOnCompleteTrigger() { return this.triggers.changeNavigationButtonsOnComplete; },
|
70630
70746
|
set changeNavigationButtonsOnCompleteTrigger(val) { this.triggers.changeNavigationButtonsOnComplete = val; },
|
70631
|
-
/**
|
70632
|
-
* This property is obsolete. Use the [`settings.triggers.executeSkipOnValueChanged`](https://surveyjs.io/form-library/documentation/api-reference/settings#triggers) property instead.
|
70633
|
-
*/
|
70634
70747
|
get executeSkipTriggerOnValueChanged() { return this.triggers.executeSkipOnValueChanged; },
|
70635
70748
|
set executeSkipTriggerOnValueChanged(val) { this.triggers.executeSkipOnValueChanged = val; },
|
70636
70749
|
//#endregion
|
@@ -70668,19 +70781,10 @@ var settings = {
|
|
70668
70781
|
localizableStringSerializeAsObject: false
|
70669
70782
|
},
|
70670
70783
|
//#region serialization section, Obsolete properties
|
70671
|
-
/**
|
70672
|
-
* This property is obsolete. Use the [`settings.serialization.itemValueSerializeAsObject`](https://surveyjs.io/form-library/documentation/api-reference/settings#serialization) property instead.
|
70673
|
-
*/
|
70674
70784
|
get itemValueAlwaysSerializeAsObject() { return this.serialization.itemValueSerializeAsObject; },
|
70675
70785
|
set itemValueAlwaysSerializeAsObject(val) { this.serialization.itemValueSerializeAsObject = val; },
|
70676
|
-
/**
|
70677
|
-
* This property is obsolete. Use the [`settings.serialization.itemValueSerializeDisplayText`](https://surveyjs.io/form-library/documentation/api-reference/settings#serialization) property instead.
|
70678
|
-
*/
|
70679
70786
|
get itemValueAlwaysSerializeText() { return this.serialization.itemValueSerializeDisplayText; },
|
70680
70787
|
set itemValueAlwaysSerializeText(val) { this.serialization.itemValueSerializeDisplayText = val; },
|
70681
|
-
/**
|
70682
|
-
* This property is obsolete. Use the [`settings.serialization.localizableStringSerializeAsObject`](https://surveyjs.io/form-library/documentation/api-reference/settings#serialization) property instead.
|
70683
|
-
*/
|
70684
70788
|
get serializeLocalizableStringAsObject() { return this.serialization.localizableStringSerializeAsObject; },
|
70685
70789
|
set serializeLocalizableStringAsObject(val) { this.serialization.localizableStringSerializeAsObject = val; },
|
70686
70790
|
//#endregion
|
@@ -70699,9 +70803,6 @@ var settings = {
|
|
70699
70803
|
firstBatchSize: 3
|
70700
70804
|
},
|
70701
70805
|
//#region lazyRender section, Obsolete properties
|
70702
|
-
/**
|
70703
|
-
* This property is obsolete. Use the [`settings.lazyRender.enabled`](https://surveyjs.io/form-library/documentation/api-reference/settings#lazyRender) property instead.
|
70704
|
-
*/
|
70705
70806
|
get lazyRowsRendering() { return this.lazyRender.enabled; },
|
70706
70807
|
set lazyRowsRendering(val) { this.lazyRender.enabled = val; },
|
70707
70808
|
get lazyRowsRenderingStartRow() { return this.lazyRender.firstBatchSize; },
|
@@ -70751,34 +70852,16 @@ var settings = {
|
|
70751
70852
|
rateSize: "small",
|
70752
70853
|
},
|
70753
70854
|
//#region matrix section, Obsolete properties
|
70754
|
-
/**
|
70755
|
-
* This property is obsolete. Use the [`settings.matrix.defaultRowName`](https://surveyjs.io/form-library/documentation/api-reference/settings#matrix) property instead.
|
70756
|
-
*/
|
70757
70855
|
get matrixDefaultRowName() { return this.matrix.defaultRowName; },
|
70758
70856
|
set matrixDefaultRowName(val) { this.matrix.defaultRowName = val; },
|
70759
|
-
/**
|
70760
|
-
* This property is obsolete. Use the [`settings.matrix.defaultCellType`](https://surveyjs.io/form-library/documentation/api-reference/settings#matrix) property instead.
|
70761
|
-
*/
|
70762
70857
|
get matrixDefaultCellType() { return this.matrix.defaultCellType; },
|
70763
70858
|
set matrixDefaultCellType(val) { this.matrix.defaultCellType = val; },
|
70764
|
-
/**
|
70765
|
-
* This property is obsolete. Use the [`settings.matrix.totalsSuffix`](https://surveyjs.io/form-library/documentation/api-reference/settings#matrix) property instead.
|
70766
|
-
*/
|
70767
70859
|
get matrixTotalValuePostFix() { return this.matrix.totalsSuffix; },
|
70768
70860
|
set matrixTotalValuePostFix(val) { this.matrix.totalsSuffix = val; },
|
70769
|
-
/**
|
70770
|
-
* This property is obsolete. Use the [`settings.matrix.maxRowCount`](https://surveyjs.io/form-library/documentation/api-reference/settings#matrix) property instead.
|
70771
|
-
*/
|
70772
70861
|
get matrixMaximumRowCount() { return this.matrix.maxRowCount; },
|
70773
70862
|
set matrixMaximumRowCount(val) { this.matrix.maxRowCount = val; },
|
70774
|
-
/**
|
70775
|
-
* This property is obsolete. Use the [`settings.matrix.maxRowCountInCondition`](https://surveyjs.io/form-library/documentation/api-reference/settings#matrix) property instead.
|
70776
|
-
*/
|
70777
70863
|
get matrixMaxRowCountInCondition() { return this.matrix.maxRowCountInCondition; },
|
70778
70864
|
set matrixMaxRowCountInCondition(val) { this.matrix.maxRowCountInCondition = val; },
|
70779
|
-
/**
|
70780
|
-
* This property is obsolete. Use the [`settings.matrix.renderRemoveAsIcon`](https://surveyjs.io/form-library/documentation/api-reference/settings#matrix) property instead.
|
70781
|
-
*/
|
70782
70865
|
get matrixRenderRemoveAsIcon() { return this.matrix.renderRemoveAsIcon; },
|
70783
70866
|
set matrixRenderRemoveAsIcon(val) { this.matrix.renderRemoveAsIcon = val; },
|
70784
70867
|
//#endregion
|
@@ -70800,14 +70883,8 @@ var settings = {
|
|
70800
70883
|
maxPanelCountInCondition: 1
|
70801
70884
|
},
|
70802
70885
|
//#region panel section, Obsolete properties
|
70803
|
-
/**
|
70804
|
-
* This property is obsolete. Use the [`settings.panel.maxPanelCountInCondition`](https://surveyjs.io/form-library/documentation/api-reference/settings#panel) property instead.
|
70805
|
-
*/
|
70806
70886
|
get panelDynamicMaxPanelCountInCondition() { return this.panel.maxPanelCountInCondition; },
|
70807
70887
|
set panelDynamicMaxPanelCountInCondition(val) { this.panel.maxPanelCountInCondition = val; },
|
70808
|
-
/**
|
70809
|
-
* This property is obsolete. Use the [`settings.panel.maxPanelCount`](https://surveyjs.io/form-library/documentation/api-reference/settings#panel) property instead.
|
70810
|
-
*/
|
70811
70888
|
get panelMaximumPanelCount() { return this.panel.maxPanelCount; },
|
70812
70889
|
set panelMaximumPanelCount(val) { this.panel.maxPanelCount = val; },
|
70813
70890
|
//#endregion
|
@@ -70828,14 +70905,8 @@ var settings = {
|
|
70828
70905
|
textRenderMode: "input"
|
70829
70906
|
},
|
70830
70907
|
//#region readOnly section, Obsolete properties
|
70831
|
-
/**
|
70832
|
-
* This property is obsolete. Use the [`settings.readOnly.commentRenderMode`](https://surveyjs.io/form-library/documentation/api-reference/settings#readOnly) property instead.
|
70833
|
-
*/
|
70834
70908
|
get readOnlyCommentRenderMode() { return this.readOnly.commentRenderMode; },
|
70835
70909
|
set readOnlyCommentRenderMode(val) { this.readOnly.commentRenderMode = val; },
|
70836
|
-
/**
|
70837
|
-
* This property is obsolete. Use the [`settings.readOnly.textRenderMode`](https://surveyjs.io/form-library/documentation/api-reference/settings#readOnly) property instead.
|
70838
|
-
*/
|
70839
70910
|
get readOnlyTextRenderMode() { return this.readOnly.textRenderMode; },
|
70840
70911
|
set readOnlyTextRenderMode(val) { this.readOnly.textRenderMode = val; },
|
70841
70912
|
//#endregion
|
@@ -70855,14 +70926,8 @@ var settings = {
|
|
70855
70926
|
includeQuestionsWithHiddenTitle: false
|
70856
70927
|
},
|
70857
70928
|
//#region numbering section, Obsolete properties
|
70858
|
-
/**
|
70859
|
-
* This property is obsolete. Use the [`settings.numbering.includeQuestionsWithHiddenTitle`](https://surveyjs.io/form-library/documentation/api-reference/settings#numbering) property instead.
|
70860
|
-
*/
|
70861
70929
|
get setQuestionVisibleIndexForHiddenTitle() { return this.numbering.includeQuestionsWithHiddenTitle; },
|
70862
70930
|
set setQuestionVisibleIndexForHiddenTitle(val) { this.numbering.includeQuestionsWithHiddenTitle = val; },
|
70863
|
-
/**
|
70864
|
-
* This property is obsolete. Use the [`settings.numbering.includeQuestionsWithHiddenNumber`](https://surveyjs.io/form-library/documentation/api-reference/settings#numbering) property instead.
|
70865
|
-
*/
|
70866
70931
|
get setQuestionVisibleIndexForHiddenNumber() { return this.numbering.includeQuestionsWithHiddenNumber; },
|
70867
70932
|
set setQuestionVisibleIndexForHiddenNumber(val) { this.numbering.includeQuestionsWithHiddenNumber = val; },
|
70868
70933
|
//#endregion
|
@@ -72260,6 +72325,16 @@ var SurveyElement = /** @class */ (function (_super) {
|
|
72260
72325
|
enumerable: false,
|
72261
72326
|
configurable: true
|
72262
72327
|
});
|
72328
|
+
Object.defineProperty(SurveyElement.prototype, "cssClassesValue", {
|
72329
|
+
get: function () {
|
72330
|
+
return this.getPropertyValueWithoutDefault("cssClassesValue");
|
72331
|
+
},
|
72332
|
+
set: function (val) {
|
72333
|
+
this.setPropertyValue("cssClassesValue", val);
|
72334
|
+
},
|
72335
|
+
enumerable: false,
|
72336
|
+
configurable: true
|
72337
|
+
});
|
72263
72338
|
SurveyElement.prototype.ensureCssClassesValue = function () {
|
72264
72339
|
if (!this.cssClassesValue) {
|
72265
72340
|
this.cssClassesValue = this.calcCssClasses(this.css);
|
@@ -72313,7 +72388,7 @@ var SurveyElement = /** @class */ (function (_super) {
|
|
72313
72388
|
SurveyElement.prototype.getIsLoadingFromJson = function () {
|
72314
72389
|
if (_super.prototype.getIsLoadingFromJson.call(this))
|
72315
72390
|
return true;
|
72316
|
-
return this.
|
72391
|
+
return this.surveyValue ? this.surveyValue.isLoadingFromJson : false;
|
72317
72392
|
};
|
72318
72393
|
Object.defineProperty(SurveyElement.prototype, "name", {
|
72319
72394
|
/**
|
@@ -72838,9 +72913,6 @@ var SurveyElement = /** @class */ (function (_super) {
|
|
72838
72913
|
__decorate([
|
72839
72914
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: false })
|
72840
72915
|
], SurveyElement.prototype, "isDragMe", void 0);
|
72841
|
-
__decorate([
|
72842
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
|
72843
|
-
], SurveyElement.prototype, "cssClassesValue", void 0);
|
72844
72916
|
__decorate([
|
72845
72917
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: false })
|
72846
72918
|
], SurveyElement.prototype, "hasVisibleErrors", void 0);
|
@@ -74863,7 +74935,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
74863
74935
|
* [Survey Localization demo](https://surveyjs.io/form-library/examples/survey-localization/ (linkStyle))
|
74864
74936
|
*/
|
74865
74937
|
get: function () {
|
74866
|
-
return this.
|
74938
|
+
return this.getPropertyValueWithoutDefault("locale") || _surveyStrings__WEBPACK_IMPORTED_MODULE_8__["surveyLocalization"].currentLocale;
|
74867
74939
|
},
|
74868
74940
|
set: function (value) {
|
74869
74941
|
if (value === _surveyStrings__WEBPACK_IMPORTED_MODULE_8__["surveyLocalization"].defaultLocale && !_surveyStrings__WEBPACK_IMPORTED_MODULE_8__["surveyLocalization"].currentLocale) {
|
@@ -75264,6 +75336,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
75264
75336
|
if (newVal !== this._isCompact) {
|
75265
75337
|
this._isCompact = newVal;
|
75266
75338
|
this.updateElementCss();
|
75339
|
+
this.triggerResponsiveness(true);
|
75267
75340
|
}
|
75268
75341
|
},
|
75269
75342
|
enumerable: false,
|
@@ -77215,21 +77288,16 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
77215
77288
|
var visPages = this.visiblePages;
|
77216
77289
|
var firstErrorPage = null;
|
77217
77290
|
var res = true;
|
77291
|
+
var rec = { fireCallback: fireCallback, focuseOnFirstError: focusOnFirstError, firstErrorQuestion: null, result: false };
|
77218
77292
|
for (var i = 0; i < visPages.length; i++) {
|
77219
|
-
if (!visPages[i].validate(fireCallback,
|
77293
|
+
if (!visPages[i].validate(fireCallback, focusOnFirstError, rec)) {
|
77220
77294
|
if (!firstErrorPage)
|
77221
77295
|
firstErrorPage = visPages[i];
|
77222
77296
|
res = false;
|
77223
77297
|
}
|
77224
77298
|
}
|
77225
|
-
if (focusOnFirstError && !!firstErrorPage) {
|
77226
|
-
|
77227
|
-
for (var i_2 = 0; i_2 < questions.length; i_2++) {
|
77228
|
-
if (questions[i_2].errors.length > 0) {
|
77229
|
-
questions[i_2].focus(true);
|
77230
|
-
break;
|
77231
|
-
}
|
77232
|
-
}
|
77299
|
+
if (focusOnFirstError && !!firstErrorPage && !!rec.firstErrorQuestion) {
|
77300
|
+
rec.firstErrorQuestion.focus(true);
|
77233
77301
|
}
|
77234
77302
|
if (!res || !onAsyncValidation)
|
77235
77303
|
return res;
|
@@ -79269,8 +79337,8 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
79269
79337
|
this.calculatedValues[i].doCalculation(this.calculatedValues, this.conditionValues, properties);
|
79270
79338
|
}
|
79271
79339
|
_super.prototype.runConditionCore.call(this, this.conditionValues, properties);
|
79272
|
-
for (var
|
79273
|
-
pages[
|
79340
|
+
for (var i_2 = 0; i_2 < pages.length; i_2++) {
|
79341
|
+
pages[i_2].runCondition(this.conditionValues, properties);
|
79274
79342
|
}
|
79275
79343
|
};
|
79276
79344
|
SurveyModel.prototype.runQuestionsTriggers = function (name, value) {
|
@@ -79442,13 +79510,13 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
79442
79510
|
page.num = isPageVisible ? page.visibleIndex + 1 : -1;
|
79443
79511
|
}
|
79444
79512
|
};
|
79445
|
-
SurveyModel.prototype.fromJSON = function (json) {
|
79513
|
+
SurveyModel.prototype.fromJSON = function (json, options) {
|
79446
79514
|
if (!json)
|
79447
79515
|
return;
|
79448
79516
|
this.questionHashesClear();
|
79449
79517
|
this.jsonErrors = null;
|
79450
79518
|
var jsonConverter = new _jsonobject__WEBPACK_IMPORTED_MODULE_1__["JsonObject"]();
|
79451
|
-
jsonConverter.toObject(json, this);
|
79519
|
+
jsonConverter.toObject(json, this, options);
|
79452
79520
|
if (jsonConverter.errors.length > 0) {
|
79453
79521
|
this.jsonErrors = jsonConverter.errors;
|
79454
79522
|
}
|
@@ -81174,7 +81242,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("survey", [
|
|
81174
81242
|
onSetValue: function (obj, value, jsonConverter) {
|
81175
81243
|
obj.pages.splice(0, obj.pages.length);
|
81176
81244
|
var page = obj.addNewPage("");
|
81177
|
-
jsonConverter.toObject({ questions: value }, page);
|
81245
|
+
jsonConverter.toObject({ questions: value }, page, jsonConverter === null || jsonConverter === void 0 ? void 0 : jsonConverter.options);
|
81178
81246
|
},
|
81179
81247
|
},
|
81180
81248
|
{
|