survey-react 1.9.121 → 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 +5 -1
- package/defaultV2.css +126 -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 +666 -666
- package/survey.react.js +399 -243
- 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
|
*/
|
@@ -1891,7 +1891,7 @@ var Base = /** @class */ (function () {
|
|
1891
1891
|
* Returns `true` if a passed `value` is an empty string, array, or object or if it equals to `undefined` or `null`.
|
1892
1892
|
*
|
1893
1893
|
* @param value A value to be checked.
|
1894
|
-
* @param trimString (Optional) When this parameter is `true`, the method ignores whitespace characters at the beginning and end of a string value. Pass `false` to disable this functionality.
|
1894
|
+
* @param trimString *(Optional)* When this parameter is `true`, the method ignores whitespace characters at the beginning and end of a string value. Pass `false` to disable this functionality.
|
1895
1895
|
*/
|
1896
1896
|
Base.prototype.isValueEmpty = function (value, trimString) {
|
1897
1897
|
if (trimString === void 0) { trimString = true; }
|
@@ -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 () { };
|
@@ -2098,7 +2100,7 @@ var Base = /** @class */ (function () {
|
|
2098
2100
|
* If the property is not found or does not have a value, this method returns either `undefined`, `defaultValue` specified in the property configuration, or a value passed as the `defaultValue` parameter.
|
2099
2101
|
*
|
2100
2102
|
* @param name A property name.
|
2101
|
-
* @param defaultValue (Optional) A value to return if the property is not found or does not have a value.
|
2103
|
+
* @param defaultValue *(Optional)* A value to return if the property is not found or does not have a value.
|
2102
2104
|
*/
|
2103
2105
|
Base.prototype.getPropertyValue = function (name, defaultValue) {
|
2104
2106
|
if (defaultValue === void 0) { defaultValue = null; }
|
@@ -2369,7 +2371,7 @@ var Base = /** @class */ (function () {
|
|
2369
2371
|
* Registers a function to call when a property value changes.
|
2370
2372
|
* @param propertyNames An array of one or multiple property names.
|
2371
2373
|
* @param handler A function to call when one of the listed properties change.
|
2372
|
-
* @param key (Optional) A key that identifies the current registration. If a function for one of the properties is already registered with the same key, the function will be overwritten. You can also use the key to subsequently unregister handlers.
|
2374
|
+
* @param key *(Optional)* A key that identifies the current registration. If a function for one of the properties is already registered with the same key, the function will be overwritten. You can also use the key to subsequently unregister handlers.
|
2373
2375
|
* @see unregisterPropertyChangedHandlers
|
2374
2376
|
*/
|
2375
2377
|
Base.prototype.registerPropertyChangedHandlers = function (propertyNames, handler, key) {
|
@@ -2381,7 +2383,7 @@ var Base = /** @class */ (function () {
|
|
2381
2383
|
/**
|
2382
2384
|
* Unregisters value change event handlers for the specified properties.
|
2383
2385
|
* @param propertyNames An array of one or multiple property names.
|
2384
|
-
* @param key (Optional) A key of the registration that you want to cancel.
|
2386
|
+
* @param key *(Optional)* A key of the registration that you want to cancel.
|
2385
2387
|
* @see registerPropertyChangedHandlers
|
2386
2388
|
*/
|
2387
2389
|
Base.prototype.unregisterPropertyChangedHandlers = function (propertyNames, key) {
|
@@ -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
|
@@ -5821,6 +5838,9 @@ var defaultV2Css = {
|
|
5821
5838
|
rootDropdown: "sd-scrollable-container sd-scrollable-container--compact sd-selectbase",
|
5822
5839
|
root: "sd-scrollable-container sd-rating",
|
5823
5840
|
rootWrappable: "sd-scrollable-container sd-rating sd-rating--wrappable",
|
5841
|
+
rootLabelsTop: "sd-rating--labels-top",
|
5842
|
+
rootLabelsBottom: "sd-rating--labels-bottom",
|
5843
|
+
rootLabelsDiagonal: "sd-rating--labels-diagonal",
|
5824
5844
|
item: "sd-rating__item",
|
5825
5845
|
itemOnError: "sd-rating__item--error",
|
5826
5846
|
itemHover: "sd-rating__item--allowhover",
|
@@ -8488,7 +8508,7 @@ var DropdownMultiSelectListModel = /** @class */ (function (_super) {
|
|
8488
8508
|
if (!_onSelectionChanged) {
|
8489
8509
|
_onSelectionChanged = function (item, status) {
|
8490
8510
|
_this.resetFilterString();
|
8491
|
-
if (item.
|
8511
|
+
if (item.id === "selectall") {
|
8492
8512
|
_this.selectAllItems();
|
8493
8513
|
}
|
8494
8514
|
else if (status === "added" && item.value === _settings__WEBPACK_IMPORTED_MODULE_4__["settings"].noneItemValue) {
|
@@ -9423,8 +9443,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
9423
9443
|
//import "../../modern.scss";
|
9424
9444
|
var Version;
|
9425
9445
|
var ReleaseDate;
|
9426
|
-
Version = "" + "1.9.
|
9427
|
-
ReleaseDate = "" + "2023-12-
|
9446
|
+
Version = "" + "1.9.123";
|
9447
|
+
ReleaseDate = "" + "2023-12-26";
|
9428
9448
|
function checkLibraryVersion(ver, libraryName) {
|
9429
9449
|
if (Version != ver) {
|
9430
9450
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
@@ -16551,7 +16571,7 @@ var Cover = /** @class */ (function (_super) {
|
|
16551
16571
|
Cover.prototype.updateHeaderClasses = function () {
|
16552
16572
|
this.headerClasses = new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_2__["CssClassBuilder"]()
|
16553
16573
|
.append("sv-header")
|
16554
|
-
.append("sv-header__without-background", (this.backgroundColor === "
|
16574
|
+
.append("sv-header__without-background", (this.backgroundColor === "transparent") && !this.backgroundImage)
|
16555
16575
|
.append("sv-header__overlap", this.overlapEnabled)
|
16556
16576
|
.toString();
|
16557
16577
|
};
|
@@ -16670,6 +16690,13 @@ var Cover = /** @class */ (function (_super) {
|
|
16670
16690
|
this.actualHeight = this.calculateActualHeight(logoHeight, titleHeight, descriptionHeight);
|
16671
16691
|
}
|
16672
16692
|
};
|
16693
|
+
Object.defineProperty(Cover.prototype, "hasBackground", {
|
16694
|
+
get: function () {
|
16695
|
+
return !!this.backgroundImage || this.backgroundColor !== "transparent";
|
16696
|
+
},
|
16697
|
+
enumerable: false,
|
16698
|
+
configurable: true
|
16699
|
+
});
|
16673
16700
|
__decorate([
|
16674
16701
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: 0 })
|
16675
16702
|
], Cover.prototype, "actualHeight", void 0);
|
@@ -16927,7 +16954,7 @@ var Helpers = /** @class */ (function () {
|
|
16927
16954
|
if (x["equals"])
|
16928
16955
|
return x.equals(y);
|
16929
16956
|
if (!!x.toJSON && !!y.toJSON && !!x.getType && !!y.getType) {
|
16930
|
-
if (x.
|
16957
|
+
if (x.isDisposed || y.isDisposed)
|
16931
16958
|
return false;
|
16932
16959
|
if (x.getType() !== y.getType())
|
16933
16960
|
return false;
|
@@ -18335,7 +18362,7 @@ var ItemValue = /** @class */ (function (_super) {
|
|
18335
18362
|
};
|
18336
18363
|
Object.defineProperty(ItemValue.prototype, "visibleIf", {
|
18337
18364
|
get: function () {
|
18338
|
-
return this.
|
18365
|
+
return this.getPropertyValueWithoutDefault("visibleIf") || "";
|
18339
18366
|
},
|
18340
18367
|
set: function (val) {
|
18341
18368
|
this.setPropertyValue("visibleIf", val);
|
@@ -18345,7 +18372,7 @@ var ItemValue = /** @class */ (function (_super) {
|
|
18345
18372
|
});
|
18346
18373
|
Object.defineProperty(ItemValue.prototype, "enableIf", {
|
18347
18374
|
get: function () {
|
18348
|
-
return this.
|
18375
|
+
return this.getPropertyValueWithoutDefault("enableIf") || "";
|
18349
18376
|
},
|
18350
18377
|
set: function (val) {
|
18351
18378
|
this.setPropertyValue("enableIf", val);
|
@@ -18355,7 +18382,8 @@ var ItemValue = /** @class */ (function (_super) {
|
|
18355
18382
|
});
|
18356
18383
|
Object.defineProperty(ItemValue.prototype, "isVisible", {
|
18357
18384
|
get: function () {
|
18358
|
-
|
18385
|
+
var res = this.getPropertyValueWithoutDefault("isVisible");
|
18386
|
+
return res !== undefined ? res : true;
|
18359
18387
|
},
|
18360
18388
|
enumerable: false,
|
18361
18389
|
configurable: true
|
@@ -18365,7 +18393,8 @@ var ItemValue = /** @class */ (function (_super) {
|
|
18365
18393
|
};
|
18366
18394
|
Object.defineProperty(ItemValue.prototype, "isEnabled", {
|
18367
18395
|
get: function () {
|
18368
|
-
|
18396
|
+
var res = this.getPropertyValueWithoutDefault("isEnabled");
|
18397
|
+
return res !== undefined ? res : true;
|
18369
18398
|
},
|
18370
18399
|
enumerable: false,
|
18371
18400
|
configurable: true
|
@@ -18510,7 +18539,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("itemvalue", [
|
|
18510
18539
|
/*!***************************!*\
|
18511
18540
|
!*** ./src/jsonobject.ts ***!
|
18512
18541
|
\***************************/
|
18513
|
-
/*! 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 */
|
18514
18543
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
18515
18544
|
|
18516
18545
|
"use strict";
|
@@ -18528,6 +18557,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
18528
18557
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JsonIncorrectTypeError", function() { return JsonIncorrectTypeError; });
|
18529
18558
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JsonRequiredPropertyError", function() { return JsonRequiredPropertyError; });
|
18530
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; });
|
18531
18561
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JsonObject", function() { return JsonObject; });
|
18532
18562
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Serializer", function() { return Serializer; });
|
18533
18563
|
/* harmony import */ var _surveyStrings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./surveyStrings */ "./src/surveyStrings.ts");
|
@@ -18864,6 +18894,12 @@ var JsonObjectProperty = /** @class */ (function () {
|
|
18864
18894
|
}
|
18865
18895
|
}
|
18866
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
|
+
};
|
18867
18903
|
JsonObjectProperty.prototype.getObjType = function (objType) {
|
18868
18904
|
if (!this.classNamePart)
|
18869
18905
|
return objType;
|
@@ -19941,8 +19977,8 @@ var JsonMetadata = /** @class */ (function () {
|
|
19941
19977
|
};
|
19942
19978
|
JsonMetadata.prototype.getChemeRefName = function (className, isRoot) {
|
19943
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
|
19944
|
-
|
19945
|
-
|
19980
|
+
//Checked by https://www.jsonschemavalidator.net/
|
19981
|
+
return isRoot ? "#/definitions/" + className : className;
|
19946
19982
|
};
|
19947
19983
|
JsonMetadata.prototype.generateChemaClass = function (className, schemaDef, isRoot) {
|
19948
19984
|
if (!!schemaDef[className])
|
@@ -20097,6 +20133,17 @@ var JsonRequiredArrayPropertyError = /** @class */ (function (_super) {
|
|
20097
20133
|
return JsonRequiredArrayPropertyError;
|
20098
20134
|
}(JsonError));
|
20099
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
|
+
|
20100
20147
|
var JsonObject = /** @class */ (function () {
|
20101
20148
|
function JsonObject() {
|
20102
20149
|
this.errors = new Array();
|
@@ -20113,14 +20160,14 @@ var JsonObject = /** @class */ (function () {
|
|
20113
20160
|
if (storeDefaults === void 0) { storeDefaults = false; }
|
20114
20161
|
return this.toJsonObjectCore(obj, null, storeDefaults);
|
20115
20162
|
};
|
20116
|
-
JsonObject.prototype.toObject = function (jsonObj, obj) {
|
20117
|
-
this.toObjectCore(jsonObj, obj);
|
20163
|
+
JsonObject.prototype.toObject = function (jsonObj, obj, options) {
|
20164
|
+
this.toObjectCore(jsonObj, obj, options);
|
20118
20165
|
var error = this.getRequiredError(obj, jsonObj);
|
20119
20166
|
if (!!error) {
|
20120
20167
|
this.addNewError(error, jsonObj, obj);
|
20121
20168
|
}
|
20122
20169
|
};
|
20123
|
-
JsonObject.prototype.toObjectCore = function (jsonObj, obj) {
|
20170
|
+
JsonObject.prototype.toObjectCore = function (jsonObj, obj, options) {
|
20124
20171
|
if (!jsonObj)
|
20125
20172
|
return;
|
20126
20173
|
var properties = null;
|
@@ -20138,6 +20185,7 @@ var JsonObject = /** @class */ (function () {
|
|
20138
20185
|
obj.startLoadingFromJson(jsonObj);
|
20139
20186
|
}
|
20140
20187
|
properties = this.addDynamicProperties(obj, jsonObj, properties);
|
20188
|
+
this.options = options;
|
20141
20189
|
for (var key in jsonObj) {
|
20142
20190
|
if (key === JsonObject.typePropertyName)
|
20143
20191
|
continue;
|
@@ -20152,8 +20200,9 @@ var JsonObject = /** @class */ (function () {
|
|
20152
20200
|
}
|
20153
20201
|
continue;
|
20154
20202
|
}
|
20155
|
-
this.valueToObj(jsonObj[key], obj, property, jsonObj);
|
20203
|
+
this.valueToObj(jsonObj[key], obj, property, jsonObj, options);
|
20156
20204
|
}
|
20205
|
+
this.options = undefined;
|
20157
20206
|
if (obj.endLoadingFromJson) {
|
20158
20207
|
obj.endLoadingFromJson();
|
20159
20208
|
}
|
@@ -20226,7 +20275,7 @@ var JsonObject = /** @class */ (function () {
|
|
20226
20275
|
}
|
20227
20276
|
}
|
20228
20277
|
};
|
20229
|
-
JsonObject.prototype.valueToObj = function (value, obj, property, jsonObj) {
|
20278
|
+
JsonObject.prototype.valueToObj = function (value, obj, property, jsonObj, options) {
|
20230
20279
|
if (value === null || value === undefined)
|
20231
20280
|
return;
|
20232
20281
|
this.removePos(property, value);
|
@@ -20240,17 +20289,22 @@ var JsonObject = /** @class */ (function () {
|
|
20240
20289
|
this.addNewError(new JsonRequiredArrayPropertyError(propName, obj.getType()), !!jsonObj ? jsonObj : value, obj);
|
20241
20290
|
}
|
20242
20291
|
if (this.isValueArray(value)) {
|
20243
|
-
this.valueToArray(value, obj, property.name, property);
|
20292
|
+
this.valueToArray(value, obj, property.name, property, options);
|
20244
20293
|
return;
|
20245
20294
|
}
|
20246
20295
|
var newObj = this.createNewObj(value, property);
|
20247
20296
|
if (newObj.newObj) {
|
20248
|
-
this.toObjectCore(value, newObj.newObj);
|
20297
|
+
this.toObjectCore(value, newObj.newObj, options);
|
20249
20298
|
value = newObj.newObj;
|
20250
20299
|
}
|
20251
20300
|
if (!newObj.error) {
|
20252
20301
|
if (property != null) {
|
20253
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
|
+
}
|
20254
20308
|
}
|
20255
20309
|
else {
|
20256
20310
|
obj[property.name] = value;
|
@@ -20349,17 +20403,17 @@ var JsonObject = /** @class */ (function () {
|
|
20349
20403
|
error.at = posObj.start;
|
20350
20404
|
error.end = posObj.end;
|
20351
20405
|
};
|
20352
|
-
JsonObject.prototype.valueToArray = function (value, obj, key, property) {
|
20406
|
+
JsonObject.prototype.valueToArray = function (value, obj, key, property, options) {
|
20353
20407
|
if (obj[key] && !this.isValueArray(obj[key]))
|
20354
20408
|
return;
|
20355
20409
|
if (obj[key] && value.length > 0)
|
20356
20410
|
obj[key].splice(0, obj[key].length);
|
20357
20411
|
var valueRes = obj[key] ? obj[key] : [];
|
20358
|
-
this.addValuesIntoArray(value, valueRes, property);
|
20412
|
+
this.addValuesIntoArray(value, valueRes, property, options);
|
20359
20413
|
if (!obj[key])
|
20360
20414
|
obj[key] = valueRes;
|
20361
20415
|
};
|
20362
|
-
JsonObject.prototype.addValuesIntoArray = function (value, result, property) {
|
20416
|
+
JsonObject.prototype.addValuesIntoArray = function (value, result, property, options) {
|
20363
20417
|
for (var i = 0; i < value.length; i++) {
|
20364
20418
|
var newValue = this.createNewObj(value[i], property);
|
20365
20419
|
if (newValue.newObj) {
|
@@ -20370,7 +20424,7 @@ var JsonObject = /** @class */ (function () {
|
|
20370
20424
|
newValue.newObj.valueName = value[i].valueName.toString();
|
20371
20425
|
}
|
20372
20426
|
result.push(newValue.newObj);
|
20373
|
-
this.toObjectCore(value[i], newValue.newObj);
|
20427
|
+
this.toObjectCore(value[i], newValue.newObj, options);
|
20374
20428
|
}
|
20375
20429
|
else {
|
20376
20430
|
if (!newValue.error) {
|
@@ -21212,14 +21266,21 @@ var LocalizableString = /** @class */ (function () {
|
|
21212
21266
|
if (this.htmlValues[loc] !== undefined)
|
21213
21267
|
return !!this.htmlValues[loc];
|
21214
21268
|
var renderedText = this.calculatedText;
|
21215
|
-
if (!renderedText)
|
21269
|
+
if (!renderedText) {
|
21270
|
+
this.setHtmlValue(loc, "");
|
21216
21271
|
return false;
|
21217
|
-
|
21272
|
+
}
|
21273
|
+
if (!!this.getLocalizationName() && renderedText === this.getLocalizationStr()) {
|
21274
|
+
this.setHtmlValue(loc, "");
|
21218
21275
|
return false;
|
21276
|
+
}
|
21219
21277
|
var res = this.owner.getMarkdownHtml(renderedText, this.name);
|
21220
|
-
this.
|
21278
|
+
this.setHtmlValue(loc, res);
|
21221
21279
|
return !!res;
|
21222
21280
|
};
|
21281
|
+
LocalizableString.prototype.setHtmlValue = function (loc, val) {
|
21282
|
+
this.htmlValues[loc] = val;
|
21283
|
+
};
|
21223
21284
|
LocalizableString.prototype.getHtmlValue = function () {
|
21224
21285
|
var loc = this.locale;
|
21225
21286
|
if (!loc)
|
@@ -35939,9 +36000,9 @@ var Question = /** @class */ (function (_super) {
|
|
35939
36000
|
return false;
|
35940
36001
|
if (!!this.page && this.page.isStartPage)
|
35941
36002
|
return false;
|
35942
|
-
if (!this.survey
|
36003
|
+
if (!this.survey)
|
35943
36004
|
return true;
|
35944
|
-
return !this.survey.hasVisibleQuestionByValueName(this.
|
36005
|
+
return !this.survey.hasVisibleQuestionByValueName(this.getValueName());
|
35945
36006
|
};
|
35946
36007
|
Object.defineProperty(Question.prototype, "isParentVisible", {
|
35947
36008
|
/**
|
@@ -36770,6 +36831,9 @@ var Question = /** @class */ (function (_super) {
|
|
36770
36831
|
if (this.questionComment === newValue)
|
36771
36832
|
return;
|
36772
36833
|
this.questionComment = newValue;
|
36834
|
+
this.setCommentIntoData(newValue);
|
36835
|
+
};
|
36836
|
+
Question.prototype.setCommentIntoData = function (newValue) {
|
36773
36837
|
if (this.data != null) {
|
36774
36838
|
this.data.setComment(this.getValueName(), newValue, this.isSurveyInputTextUpdate ? "text" : false);
|
36775
36839
|
}
|
@@ -38153,7 +38217,16 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
38153
38217
|
if (this.getStoreOthersAsComment() && !this.autoOtherMode) {
|
38154
38218
|
this.prevOtherValue = this.otherValue;
|
38155
38219
|
}
|
38156
|
-
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;
|
38157
38230
|
}
|
38158
38231
|
};
|
38159
38232
|
QuestionSelectBase.prototype.setNewValue = function (newValue) {
|
@@ -38276,9 +38349,9 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
38276
38349
|
};
|
38277
38350
|
Object.defineProperty(QuestionSelectBase.prototype, "choicesByUrl", {
|
38278
38351
|
/**
|
38279
|
-
* 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.
|
38280
38353
|
*
|
38281
|
-
* [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))
|
38282
38355
|
* @see choices
|
38283
38356
|
* @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
|
38284
38357
|
*/
|
@@ -39565,21 +39638,6 @@ var QuestionCheckboxBase = /** @class */ (function (_super) {
|
|
39565
39638
|
enumerable: false,
|
39566
39639
|
configurable: true
|
39567
39640
|
});
|
39568
|
-
QuestionCheckboxBase.prototype.clickItemHandler = function (item, checked) {
|
39569
|
-
var newValue = [].concat(this.renderedValue || []);
|
39570
|
-
var index = newValue.indexOf(item.value);
|
39571
|
-
if (checked) {
|
39572
|
-
if (index < 0) {
|
39573
|
-
newValue.push(item.value);
|
39574
|
-
}
|
39575
|
-
}
|
39576
|
-
else {
|
39577
|
-
if (index > -1) {
|
39578
|
-
newValue.splice(index, 1);
|
39579
|
-
}
|
39580
|
-
}
|
39581
|
-
this.renderedValue = newValue;
|
39582
|
-
};
|
39583
39641
|
QuestionCheckboxBase.prototype.onParentChanged = function () {
|
39584
39642
|
_super.prototype.onParentChanged.call(this);
|
39585
39643
|
if (this.isFlowLayout) {
|
@@ -40413,9 +40471,10 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
|
|
40413
40471
|
__extends(QuestionCheckboxModel, _super);
|
40414
40472
|
function QuestionCheckboxModel(name) {
|
40415
40473
|
var _this = _super.call(this, name) || this;
|
40416
|
-
_this.selectAllItemValue = new _itemvalue__WEBPACK_IMPORTED_MODULE_4__["ItemValue"]("selectall");
|
40417
40474
|
_this.invisibleOldValues = {};
|
40418
40475
|
_this.isChangingValueOnClearIncorrect = false;
|
40476
|
+
_this.selectAllItemValue = new _itemvalue__WEBPACK_IMPORTED_MODULE_4__["ItemValue"]("");
|
40477
|
+
_this.selectAllItemValue.id = "selectall";
|
40419
40478
|
var selectAllItemText = _this.createLocalizableString("selectAllText", _this.selectAllItem, true, "selectAllItemText");
|
40420
40479
|
_this.selectAllItem.locOwner = _this;
|
40421
40480
|
_this.selectAllItem.setLocText(selectAllItemText);
|
@@ -40573,6 +40632,31 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
|
|
40573
40632
|
}
|
40574
40633
|
this.renderedValue = val;
|
40575
40634
|
};
|
40635
|
+
QuestionCheckboxModel.prototype.clickItemHandler = function (item, checked) {
|
40636
|
+
if (item === this.selectAllItem) {
|
40637
|
+
if (checked === true || checked === false) {
|
40638
|
+
this.isAllSelected = checked;
|
40639
|
+
}
|
40640
|
+
else {
|
40641
|
+
this.toggleSelectAll();
|
40642
|
+
}
|
40643
|
+
}
|
40644
|
+
else {
|
40645
|
+
var newValue = [].concat(this.renderedValue || []);
|
40646
|
+
var index = newValue.indexOf(item.value);
|
40647
|
+
if (checked) {
|
40648
|
+
if (index < 0) {
|
40649
|
+
newValue.push(item.value);
|
40650
|
+
}
|
40651
|
+
}
|
40652
|
+
else {
|
40653
|
+
if (index > -1) {
|
40654
|
+
newValue.splice(index, 1);
|
40655
|
+
}
|
40656
|
+
}
|
40657
|
+
this.renderedValue = newValue;
|
40658
|
+
}
|
40659
|
+
};
|
40576
40660
|
QuestionCheckboxModel.prototype.isItemSelectedCore = function (item) {
|
40577
40661
|
if (item === this.selectAllItem)
|
40578
40662
|
return this.isAllSelected;
|
@@ -41573,6 +41657,16 @@ var QuestionCustomModelBase = /** @class */ (function (_super) {
|
|
41573
41657
|
this.getElement().localeChanged();
|
41574
41658
|
}
|
41575
41659
|
};
|
41660
|
+
QuestionCustomModelBase.prototype.addUsedLocales = function (locales) {
|
41661
|
+
_super.prototype.addUsedLocales.call(this, locales);
|
41662
|
+
if (!!this.getElement()) {
|
41663
|
+
this.getElement().addUsedLocales(locales);
|
41664
|
+
}
|
41665
|
+
};
|
41666
|
+
QuestionCustomModelBase.prototype.needResponsiveWidth = function () {
|
41667
|
+
var el = this.getElement();
|
41668
|
+
return !!el ? el.needResponsiveWidth() : false;
|
41669
|
+
};
|
41576
41670
|
QuestionCustomModelBase.prototype.createWrapper = function () { };
|
41577
41671
|
QuestionCustomModelBase.prototype.onPropertyValueChanged = function (name, oldValue, newValue) {
|
41578
41672
|
_super.prototype.onPropertyValueChanged.call(this, name, oldValue, newValue);
|
@@ -43405,6 +43499,9 @@ function dataUrl2File(dataUrl, fileName, type) {
|
|
43405
43499
|
var buffer = new Uint8Array(str.split("").map(function (c) { return c.charCodeAt(0); })).buffer;
|
43406
43500
|
return new File([buffer], fileName, { type: type });
|
43407
43501
|
}
|
43502
|
+
/**
|
43503
|
+
* A base class for question types that support file upload: `QuestionFileModel` and `QuestionSignaturePadModel`.
|
43504
|
+
*/
|
43408
43505
|
var QuestionFileModelBase = /** @class */ (function (_super) {
|
43409
43506
|
__extends(QuestionFileModelBase, _super);
|
43410
43507
|
function QuestionFileModelBase() {
|
@@ -45490,10 +45587,8 @@ var QuestionImagePickerModel = /** @class */ (function (_super) {
|
|
45490
45587
|
*
|
45491
45588
|
* Possible values:
|
45492
45589
|
*
|
45493
|
-
* - `"image"` - Images in one of the following formats: JPEG, GIF, PNG, APNG, SVG, BMP, ICO.
|
45590
|
+
* - `"image"` (default) - Images in one of the following formats: JPEG, GIF, PNG, APNG, SVG, BMP, ICO.
|
45494
45591
|
* - `"video"` - Videos in one of the following formats: MP4, MOV, WMV, FLV, AVI, MKV.
|
45495
|
-
* - `"youtube"` - Links to YouTube videos.
|
45496
|
-
* - `"auto"` (default) - Selects one of the above based on the `imageLink` property value of each choice item.
|
45497
45592
|
*/
|
45498
45593
|
get: function () {
|
45499
45594
|
return this.getPropertyValue("contentMode");
|
@@ -46106,13 +46201,15 @@ var QuestionMatrixModel = /** @class */ (function (_super) {
|
|
46106
46201
|
var isChecked = row.value == column.value;
|
46107
46202
|
var isDisabled = this.isReadOnly;
|
46108
46203
|
var allowHover = !isChecked && !isDisabled;
|
46204
|
+
var hasCellText = this.hasCellText;
|
46205
|
+
var css = this.cssClasses;
|
46109
46206
|
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_11__["CssClassBuilder"]()
|
46110
|
-
.append(
|
46111
|
-
.append(
|
46112
|
-
.append(
|
46113
|
-
.append(
|
46114
|
-
.append(
|
46115
|
-
.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)
|
46116
46213
|
.toString();
|
46117
46214
|
};
|
46118
46215
|
Object.defineProperty(QuestionMatrixModel.prototype, "itemSvgIcon", {
|
@@ -47205,7 +47302,7 @@ var MatrixDropdownRowModelBase = /** @class */ (function () {
|
|
47205
47302
|
if (this.data.isValidateOnValueChanging && this.hasQuestonError(changedQuestion))
|
47206
47303
|
return;
|
47207
47304
|
var isDeleting = newColumnValue == null && !changedQuestion ||
|
47208
|
-
isComment && !newColumnValue && !!changedQuestion
|
47305
|
+
isComment && !newColumnValue && !!changedQuestion;
|
47209
47306
|
this.data.onRowChanged(this, changedName, newValue, isDeleting);
|
47210
47307
|
if (changedName) {
|
47211
47308
|
this.runTriggers(MatrixDropdownTotalRowModel.RowVariableName + "." + changedName, newValue);
|
@@ -47906,6 +48003,7 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
47906
48003
|
this.resetRenderedTable();
|
47907
48004
|
this.fireCallback(this.columnsChangedCallback);
|
47908
48005
|
};
|
48006
|
+
//For internal use
|
47909
48007
|
QuestionMatrixDropdownModelBase.prototype.resetRenderedTable = function () {
|
47910
48008
|
if (this.lockResetRenderedTable || this.isUpdateLocked)
|
47911
48009
|
return;
|
@@ -49373,16 +49471,17 @@ function onUpdateSelectBaseCellQuestion(cellQuestion, column, question, data) {
|
|
49373
49471
|
cellQuestion.choicesByUrl.run(data.getTextProcessor());
|
49374
49472
|
}
|
49375
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
|
+
}
|
49376
49480
|
var matrixDropdownColumnTypes = {
|
49377
49481
|
dropdown: {
|
49378
49482
|
onCellQuestionUpdate: function (cellQuestion, column, question, data) {
|
49379
|
-
|
49380
|
-
|
49381
|
-
cellQuestion.locPlaceholder.isEmpty &&
|
49382
|
-
!question.locPlaceholder.isEmpty) {
|
49383
|
-
cellQuestion.optionsCaption = question.optionsCaption;
|
49384
|
-
}
|
49385
|
-
},
|
49483
|
+
onUpdateSelectDropdownCellQuestion(cellQuestion, column, question, data);
|
49484
|
+
}
|
49386
49485
|
},
|
49387
49486
|
checkbox: {
|
49388
49487
|
onCellQuestionUpdate: function (cellQuestion, column, question, data) {
|
@@ -49398,7 +49497,11 @@ var matrixDropdownColumnTypes = {
|
|
49398
49497
|
column.colCount > -1 ? column.colCount : question.columnColCount;
|
49399
49498
|
},
|
49400
49499
|
},
|
49401
|
-
tagbox: {
|
49500
|
+
tagbox: {
|
49501
|
+
onCellQuestionUpdate: function (cellQuestion, column, question, data) {
|
49502
|
+
onUpdateSelectBaseCellQuestion(cellQuestion, column, question, data);
|
49503
|
+
}
|
49504
|
+
},
|
49402
49505
|
text: {},
|
49403
49506
|
comment: {},
|
49404
49507
|
boolean: {
|
@@ -50456,6 +50559,8 @@ var QuestionMatrixDropdownRenderedCell = /** @class */ (function () {
|
|
50456
50559
|
return "";
|
50457
50560
|
return this.cell.column.locCellHint.renderedHtml;
|
50458
50561
|
}
|
50562
|
+
if (this.hasQuestion && this.question.isVisible && this.question.title)
|
50563
|
+
return this.question.title;
|
50459
50564
|
return this.cell.column.title;
|
50460
50565
|
}
|
50461
50566
|
if (this.hasQuestion && this.question.isVisible) {
|
@@ -53168,7 +53273,7 @@ var QuestionMultipleTextModel = /** @class */ (function (_super) {
|
|
53168
53273
|
/**
|
53169
53274
|
* Adds a new input item.
|
53170
53275
|
* @param name An item name.
|
53171
|
-
* @param title (Optional) An item title.
|
53276
|
+
* @param title *(Optional)* An item title.
|
53172
53277
|
* @see items
|
53173
53278
|
*/
|
53174
53279
|
QuestionMultipleTextModel.prototype.addItem = function (name, title) {
|
@@ -54001,7 +54106,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
54001
54106
|
_this.registerPropertyChangedHandlers(["panelsState"], function () {
|
54002
54107
|
_this.setPanelsState();
|
54003
54108
|
});
|
54004
|
-
_this.registerPropertyChangedHandlers(["isMobile"], function () {
|
54109
|
+
_this.registerPropertyChangedHandlers(["isMobile", "newPanelPosition", "showRangeInProgress", "renderMode"], function () {
|
54005
54110
|
_this.updateFooterActions();
|
54006
54111
|
});
|
54007
54112
|
_this.registerPropertyChangedHandlers(["allowAddPanel"], function () { _this.updateNoEntriesTextDefaultLoc(); });
|
@@ -54356,7 +54461,8 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
54356
54461
|
if (this.isRenderModeList || this.useTemplatePanel)
|
54357
54462
|
return;
|
54358
54463
|
var curPanel = this.getPropertyValue("currentPanel");
|
54359
|
-
|
54464
|
+
var index = !!val ? this.visiblePanels.indexOf(val) : -1;
|
54465
|
+
if (!!val && index < 0 || val === curPanel)
|
54360
54466
|
return;
|
54361
54467
|
if (curPanel) {
|
54362
54468
|
curPanel.onHidingContent();
|
@@ -54365,6 +54471,13 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
54365
54471
|
this.updateFooterActions();
|
54366
54472
|
this.updateTabToolbarItemsPressedState();
|
54367
54473
|
this.fireCallback(this.currentIndexChangedCallback);
|
54474
|
+
if (index > -1 && this.survey) {
|
54475
|
+
var options = {
|
54476
|
+
panel: val,
|
54477
|
+
visiblePanelIndex: index
|
54478
|
+
};
|
54479
|
+
this.survey.dynamicPanelCurrentIndexChanged(this, options);
|
54480
|
+
}
|
54368
54481
|
},
|
54369
54482
|
enumerable: false,
|
54370
54483
|
configurable: true
|
@@ -54822,6 +54935,8 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
54822
54935
|
* Specifies whether users are allowed to add new panels.
|
54823
54936
|
*
|
54824
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"`.
|
54825
54940
|
* @see canAddPanel
|
54826
54941
|
* @see allowRemovePanel
|
54827
54942
|
*/
|
@@ -54834,6 +54949,26 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
54834
54949
|
enumerable: false,
|
54835
54950
|
configurable: true
|
54836
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
|
+
});
|
54837
54972
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "allowRemovePanel", {
|
54838
54973
|
/**
|
54839
54974
|
* Specifies whether users are allowed to delete panels.
|
@@ -54937,7 +55072,6 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
54937
55072
|
},
|
54938
55073
|
set: function (val) {
|
54939
55074
|
this.setPropertyValue("showRangeInProgress", val);
|
54940
|
-
this.updateFooterActions();
|
54941
55075
|
this.fireCallback(this.currentIndexChangedCallback);
|
54942
55076
|
},
|
54943
55077
|
enumerable: false,
|
@@ -54960,7 +55094,6 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
54960
55094
|
},
|
54961
55095
|
set: function (val) {
|
54962
55096
|
this.setPropertyValue("renderMode", val);
|
54963
|
-
this.updateFooterActions();
|
54964
55097
|
this.fireCallback(this.renderModeChangedCallback);
|
54965
55098
|
},
|
54966
55099
|
enumerable: false,
|
@@ -55043,7 +55176,8 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
55043
55176
|
get: function () {
|
55044
55177
|
if (this.isDesignMode)
|
55045
55178
|
return false;
|
55046
|
-
if (this.isDefaultV2Theme && !this.legacyNavigation && !this.isRenderModeList &&
|
55179
|
+
if (this.isDefaultV2Theme && !this.legacyNavigation && !this.isRenderModeList &&
|
55180
|
+
(this.currentIndex < this.visiblePanelCount - 1 && this.newPanelPosition !== "next")) {
|
55047
55181
|
return false;
|
55048
55182
|
}
|
55049
55183
|
return (this.allowAddPanel &&
|
@@ -55196,48 +55330,61 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
55196
55330
|
return newPanel;
|
55197
55331
|
};
|
55198
55332
|
/**
|
55199
|
-
*
|
55200
|
-
* @
|
55333
|
+
* Adds a new panel based on the [template](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#template).
|
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.
|
55201
55335
|
* @see panelCount
|
55202
55336
|
* @see panels
|
55203
|
-
* @see
|
55337
|
+
* @see allowAddPanel
|
55338
|
+
* @see newPanelPosition
|
55204
55339
|
*/
|
55205
|
-
QuestionPanelDynamicModel.prototype.addPanel = function () {
|
55206
|
-
this.
|
55340
|
+
QuestionPanelDynamicModel.prototype.addPanel = function (index) {
|
55341
|
+
var curIndex = this.currentIndex;
|
55342
|
+
if (index === undefined) {
|
55343
|
+
index = curIndex < 0 ? this.panelCount : curIndex + 1;
|
55344
|
+
}
|
55345
|
+
if (index < 0 || index > this.panelCount) {
|
55346
|
+
index = this.panelCount;
|
55347
|
+
}
|
55348
|
+
this.updateValueOnAddingPanel(curIndex < 0 ? this.panelCount - 1 : curIndex, index);
|
55207
55349
|
if (!this.isRenderModeList) {
|
55208
|
-
this.currentIndex =
|
55350
|
+
this.currentIndex = index;
|
55209
55351
|
}
|
55352
|
+
if (this.survey)
|
55353
|
+
this.survey.dynamicPanelAdded(this);
|
55354
|
+
return this.panels[index];
|
55355
|
+
};
|
55356
|
+
QuestionPanelDynamicModel.prototype.updateValueOnAddingPanel = function (prevIndex, index) {
|
55357
|
+
this.panelCount++;
|
55210
55358
|
var newValue = this.value;
|
55359
|
+
if (!Array.isArray(newValue) || newValue.length !== this.panelCount)
|
55360
|
+
return;
|
55211
55361
|
var hasModified = false;
|
55362
|
+
var lastIndex = this.panelCount - 1;
|
55363
|
+
if (index < lastIndex) {
|
55364
|
+
hasModified = true;
|
55365
|
+
var rec = newValue[lastIndex];
|
55366
|
+
newValue.splice(lastIndex, 1);
|
55367
|
+
newValue.splice(index, 0, rec);
|
55368
|
+
}
|
55212
55369
|
if (!this.isValueEmpty(this.defaultPanelValue)) {
|
55213
|
-
if (!!newValue &&
|
55214
|
-
Array.isArray(newValue) &&
|
55215
|
-
newValue.length == this.panelCount) {
|
55216
|
-
hasModified = true;
|
55217
|
-
this.copyValue(newValue[newValue.length - 1], this.defaultPanelValue);
|
55218
|
-
}
|
55219
|
-
}
|
55220
|
-
if (this.defaultValueFromLastPanel &&
|
55221
|
-
!!newValue &&
|
55222
|
-
Array.isArray(newValue) &&
|
55223
|
-
newValue.length > 1 &&
|
55224
|
-
newValue.length == this.panelCount) {
|
55225
55370
|
hasModified = true;
|
55226
|
-
this.copyValue(newValue[
|
55371
|
+
this.copyValue(newValue[index], this.defaultPanelValue);
|
55372
|
+
}
|
55373
|
+
if (this.defaultValueFromLastPanel && newValue.length > 1) {
|
55374
|
+
var fromIndex = prevIndex > -1 && prevIndex <= lastIndex ? prevIndex : lastIndex;
|
55375
|
+
hasModified = true;
|
55376
|
+
this.copyValue(newValue[index], newValue[fromIndex]);
|
55227
55377
|
}
|
55228
55378
|
if (hasModified) {
|
55229
55379
|
this.value = newValue;
|
55230
55380
|
}
|
55231
|
-
if (this.survey)
|
55232
|
-
this.survey.dynamicPanelAdded(this);
|
55233
|
-
return this.panels[this.panelCount - 1];
|
55234
55381
|
};
|
55235
55382
|
QuestionPanelDynamicModel.prototype.canLeaveCurrentPanel = function () {
|
55236
55383
|
return !(this.renderMode !== "list" && this.currentPanel && this.currentPanel.hasErrors(true, true));
|
55237
55384
|
};
|
55238
|
-
QuestionPanelDynamicModel.prototype.copyValue = function (
|
55239
|
-
for (var key in
|
55240
|
-
|
55385
|
+
QuestionPanelDynamicModel.prototype.copyValue = function (dest, src) {
|
55386
|
+
for (var key in src) {
|
55387
|
+
dest[key] = src[key];
|
55241
55388
|
}
|
55242
55389
|
};
|
55243
55390
|
/**
|
@@ -55253,13 +55400,23 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
55253
55400
|
var _this = this;
|
55254
55401
|
if (!this.canRemovePanel)
|
55255
55402
|
return;
|
55256
|
-
if (this.
|
55403
|
+
if (this.isRequireConfirmOnDelete(value)) {
|
55257
55404
|
Object(_utils_utils__WEBPACK_IMPORTED_MODULE_9__["confirmActionAsync"])(this.confirmDeleteText, function () { _this.removePanel(value); });
|
55258
55405
|
}
|
55259
55406
|
else {
|
55260
55407
|
this.removePanel(value);
|
55261
55408
|
}
|
55262
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
|
+
};
|
55263
55420
|
/**
|
55264
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.
|
55265
55422
|
* @see renderMode
|
@@ -55489,6 +55646,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
55489
55646
|
if (this.isReadOnly || !this.allowAddPanel) {
|
55490
55647
|
this.updateNoEntriesTextDefaultLoc();
|
55491
55648
|
}
|
55649
|
+
this.updateFooterActions();
|
55492
55650
|
_super.prototype.onSurveyLoad.call(this);
|
55493
55651
|
};
|
55494
55652
|
QuestionPanelDynamicModel.prototype.onFirstRendering = function () {
|
@@ -56313,6 +56471,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_5__["Serializer"].addClass("paneldynamic",
|
|
56313
56471
|
{ name: "noEntriesText:text", serializationProperty: "locNoEntriesText" },
|
56314
56472
|
{ name: "allowAddPanel:boolean", default: true },
|
56315
56473
|
{ name: "allowRemovePanel:boolean", default: true },
|
56474
|
+
{ name: "newPanelPosition", choices: ["next", "last"], default: "last", category: "layout" },
|
56316
56475
|
{
|
56317
56476
|
name: "panelCount:number",
|
56318
56477
|
isBindable: true,
|
@@ -57674,9 +57833,10 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
57674
57833
|
Object.defineProperty(QuestionRatingModel.prototype, "minRateDescription", {
|
57675
57834
|
/**
|
57676
57835
|
* Specifies a description for the minimum (first) rate value.
|
57836
|
+
* @see rateDescriptionLocation
|
57837
|
+
* @see displayRateDescriptionsAsExtremeItems
|
57677
57838
|
* @see rateValues
|
57678
57839
|
* @see rateMin
|
57679
|
-
* @see displayRateDescriptionsAsExtremeItems
|
57680
57840
|
*/
|
57681
57841
|
get: function () {
|
57682
57842
|
return this.getLocalizableStringText("minRateDescription");
|
@@ -57698,9 +57858,10 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
57698
57858
|
Object.defineProperty(QuestionRatingModel.prototype, "maxRateDescription", {
|
57699
57859
|
/**
|
57700
57860
|
* Specifies a description for the maximum (last) rate value.
|
57861
|
+
* @see rateDescriptionLocation
|
57862
|
+
* @see displayRateDescriptionsAsExtremeItems
|
57701
57863
|
* @see rateValues
|
57702
57864
|
* @see rateMax
|
57703
|
-
* @see displayRateDescriptionsAsExtremeItems
|
57704
57865
|
*/
|
57705
57866
|
get: function () {
|
57706
57867
|
return this.getLocalizableStringText("maxRateDescription");
|
@@ -57832,8 +57993,18 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
57832
57993
|
get: function () {
|
57833
57994
|
var baseClass = ((this.displayMode == "buttons" || (!!this.survey && this.survey.isDesignMode)) && this.cssClasses.rootWrappable) ?
|
57834
57995
|
this.cssClasses.rootWrappable : this.cssClasses.root;
|
57996
|
+
var rootClassModifier = "";
|
57997
|
+
if (this.hasMaxLabel || this.hasMinLabel) {
|
57998
|
+
if (this.rateDescriptionLocation == "top")
|
57999
|
+
rootClassModifier = this.cssClasses.rootLabelsTop;
|
58000
|
+
if (this.rateDescriptionLocation == "bottom")
|
58001
|
+
rootClassModifier = this.cssClasses.rootLabelsBottom;
|
58002
|
+
if (this.rateDescriptionLocation == "topBottom")
|
58003
|
+
rootClassModifier = this.cssClasses.rootLabelsDiagonal;
|
58004
|
+
}
|
57835
58005
|
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_6__["CssClassBuilder"]()
|
57836
58006
|
.append(baseClass)
|
58007
|
+
.append(rootClassModifier)
|
57837
58008
|
.append(this.cssClasses.itemSmall, this.itemSmallMode && this.rateType != "labels")
|
57838
58009
|
.toString();
|
57839
58010
|
},
|
@@ -58162,6 +58333,9 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
58162
58333
|
}
|
58163
58334
|
})
|
58164
58335
|
], QuestionRatingModel.prototype, "displayMode", void 0);
|
58336
|
+
__decorate([
|
58337
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
|
58338
|
+
], QuestionRatingModel.prototype, "rateDescriptionLocation", void 0);
|
58165
58339
|
__decorate([
|
58166
58340
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
|
58167
58341
|
], QuestionRatingModel.prototype, "rateType", void 0);
|
@@ -58291,6 +58465,12 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
|
|
58291
58465
|
return obj.rateType == "labels";
|
58292
58466
|
}
|
58293
58467
|
},
|
58468
|
+
{
|
58469
|
+
name: "rateDescriptionLocation",
|
58470
|
+
default: "leftRight",
|
58471
|
+
category: "layout",
|
58472
|
+
choices: ["leftRight", "top", "bottom", "topBottom"],
|
58473
|
+
},
|
58294
58474
|
{
|
58295
58475
|
name: "displayMode",
|
58296
58476
|
default: "auto",
|
@@ -58917,6 +59097,7 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
|
|
58917
59097
|
_this.onOpened = _this.addEvent();
|
58918
59098
|
_this.createLocalizableString("placeholder", _this, false, true);
|
58919
59099
|
_this.createLocalizableString("clearCaption", _this, false, true);
|
59100
|
+
_this.createLocalizableString("readOnlyText", _this, true);
|
58920
59101
|
_this.registerPropertyChangedHandlers(["value", "renderAs", "showOtherItem", "otherText", "placeholder", "choices", "visibleChoices"], function () {
|
58921
59102
|
_this.updateReadOnlyText();
|
58922
59103
|
});
|
@@ -58978,6 +59159,23 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
|
|
58978
59159
|
enumerable: false,
|
58979
59160
|
configurable: true
|
58980
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
|
+
});
|
58981
59179
|
QuestionTagboxModel.prototype.getType = function () {
|
58982
59180
|
return "tagbox";
|
58983
59181
|
};
|
@@ -59103,9 +59301,6 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
|
|
59103
59301
|
enumerable: false,
|
59104
59302
|
configurable: true
|
59105
59303
|
});
|
59106
|
-
__decorate([
|
59107
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: "" })
|
59108
|
-
], QuestionTagboxModel.prototype, "readOnlyText", void 0);
|
59109
59304
|
__decorate([
|
59110
59305
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
|
59111
59306
|
], QuestionTagboxModel.prototype, "allowClear", void 0);
|
@@ -63666,6 +63861,9 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
|
|
63666
63861
|
SurveyQuestionDropdownBase.prototype.getValueCore = function () {
|
63667
63862
|
return this.questionBase.renderedValue;
|
63668
63863
|
};
|
63864
|
+
SurveyQuestionDropdownBase.prototype.renderReadOnlyElement = function () {
|
63865
|
+
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null, this.question.readOnlyText);
|
63866
|
+
};
|
63669
63867
|
SurveyQuestionDropdownBase.prototype.renderSelect = function (cssClasses) {
|
63670
63868
|
var _a, _b;
|
63671
63869
|
var selectElement = null;
|
@@ -63675,7 +63873,7 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
|
|
63675
63873
|
// @ts-ignore
|
63676
63874
|
selectElement = react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), disabled: true },
|
63677
63875
|
text,
|
63678
|
-
|
63876
|
+
this.renderReadOnlyElement());
|
63679
63877
|
}
|
63680
63878
|
else {
|
63681
63879
|
if (!this.question["dropdownListModel"]) {
|
@@ -66531,9 +66729,6 @@ var SurveyQuestionCheckboxItem = /** @class */ (function (_super) {
|
|
66531
66729
|
_this.handleOnChange = function (event) {
|
66532
66730
|
_this.question.clickItemHandler(_this.item, event.target.checked);
|
66533
66731
|
};
|
66534
|
-
_this.selectAllChanged = function (event) {
|
66535
|
-
_this.question.toggleSelectAll();
|
66536
|
-
};
|
66537
66732
|
return _this;
|
66538
66733
|
}
|
66539
66734
|
SurveyQuestionCheckboxItem.prototype.getStateElement = function () {
|
@@ -66607,16 +66802,12 @@ var SurveyQuestionCheckboxItem = /** @class */ (function (_super) {
|
|
66607
66802
|
});
|
66608
66803
|
SurveyQuestionCheckboxItem.prototype.renderCheckbox = function (isChecked, otherItem) {
|
66609
66804
|
var id = this.question.getItemId(this.item);
|
66610
|
-
var text = !this.hideCaption ? this.renderLocString(this.item.locText) : "";
|
66611
66805
|
var itemClass = this.question.getItemClass(this.item);
|
66612
66806
|
var labelClass = this.question.getLabelClass(this.item);
|
66613
|
-
var onItemChanged = this.item == this.question.selectAllItem
|
66614
|
-
? this.selectAllChanged
|
66615
|
-
: this.handleOnChange;
|
66616
66807
|
var itemLabel = !this.hideCaption ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.cssClasses.controlLabel }, this.renderLocString(this.item.locText, this.textStyle)) : null;
|
66617
66808
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: itemClass, role: "presentation" },
|
66618
66809
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("label", { className: labelClass },
|
66619
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { className: this.cssClasses.itemControl, type: "checkbox", role: "option", name: this.question.name + this.item.
|
66810
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { className: this.cssClasses.itemControl, type: "checkbox", role: "option", name: this.question.name + this.item.id, value: this.item.value, id: id, style: this.inputStyle, disabled: !this.question.getItemEnabled(this.item), checked: isChecked, onChange: this.handleOnChange }),
|
66620
66811
|
this.cssClasses.materialDecorator ?
|
66621
66812
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.cssClasses.materialDecorator }, this.question.itemSvgIcon ?
|
66622
66813
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("svg", { className: this.cssClasses.itemDecorator },
|
@@ -67833,6 +68024,9 @@ var SurveyQuestionMatrixRow = /** @class */ (function (_super) {
|
|
67833
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))));
|
67834
68025
|
}
|
67835
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;
|
67836
68030
|
td = (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("td", { key: key, "data-responsive-title": column.locText.renderedHtml, className: this.question.cssClasses.cell },
|
67837
68031
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("label", { onMouseDown: this.handleOnMouseDown, className: itemClass },
|
67838
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 }),
|
@@ -67840,7 +68034,7 @@ var SurveyQuestionMatrixRow = /** @class */ (function (_super) {
|
|
67840
68034
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("svg", { className: this.cssClasses.itemDecorator },
|
67841
68035
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("use", { xlinkHref: this.question.itemSvgIcon })) :
|
67842
68036
|
null),
|
67843
|
-
|
68037
|
+
mobileSpan)));
|
67844
68038
|
}
|
67845
68039
|
tds.push(td);
|
67846
68040
|
}
|
@@ -69409,6 +69603,14 @@ var SurveyQuestionTagbox = /** @class */ (function (_super) {
|
|
69409
69603
|
select,
|
69410
69604
|
comment));
|
69411
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
|
+
};
|
69412
69614
|
return SurveyQuestionTagbox;
|
69413
69615
|
}(_dropdown_base__WEBPACK_IMPORTED_MODULE_2__["SurveyQuestionDropdownBase"]));
|
69414
69616
|
|
@@ -70437,14 +70639,8 @@ var settings = {
|
|
70437
70639
|
showEmptyTitles: true
|
70438
70640
|
},
|
70439
70641
|
//#region designMode section, Obsolete properties
|
70440
|
-
/**
|
70441
|
-
* This property is obsolete. Use the [`settings.designMode.showEmptyDescriptions`](https://surveyjs.io/form-library/documentation/api-reference/settings#designMode) property instead.
|
70442
|
-
*/
|
70443
70642
|
get allowShowEmptyDescriptionInDesignMode() { return this.designMode.showEmptyDescriptions; },
|
70444
70643
|
set allowShowEmptyDescriptionInDesignMode(val) { this.designMode.showEmptyDescriptions = val; },
|
70445
|
-
/**
|
70446
|
-
* This property is obsolete. Use the [`settings.designMode.showEmptyTitles`](https://surveyjs.io/form-library/documentation/api-reference/settings#designMode) property instead.
|
70447
|
-
*/
|
70448
70644
|
get allowShowEmptyTitleInDesignMode() { return this.designMode.showEmptyTitles; },
|
70449
70645
|
set allowShowEmptyTitleInDesignMode(val) { this.designMode.showEmptyTitles = val; },
|
70450
70646
|
//#endregion
|
@@ -70468,19 +70664,10 @@ var settings = {
|
|
70468
70664
|
defaultLocaleName: "default"
|
70469
70665
|
},
|
70470
70666
|
//#region localization section, obsolete properties
|
70471
|
-
/**
|
70472
|
-
* This property is obsolete. Use the [`settings.localization.useLocalTimeZone`](https://surveyjs.io/form-library/documentation/api-reference/settings#localization) property instead.
|
70473
|
-
*/
|
70474
70667
|
get useLocalTimeZone() { return this.localization.useLocalTimeZone; },
|
70475
70668
|
set useLocalTimeZone(val) { this.localization.useLocalTimeZone = val; },
|
70476
|
-
/**
|
70477
|
-
* This property is obsolete. Use the [`settings.localization.storeDuplicatedTranslations`](https://surveyjs.io/form-library/documentation/api-reference/settings#localization) property instead.
|
70478
|
-
*/
|
70479
70669
|
get storeDuplicatedTranslations() { return this.localization.storeDuplicatedTranslations; },
|
70480
70670
|
set storeDuplicatedTranslations(val) { this.localization.storeDuplicatedTranslations = val; },
|
70481
|
-
/**
|
70482
|
-
* This property is obsolete. Use the [`settings.localization.defaultLocaleName`](https://surveyjs.io/form-library/documentation/api-reference/settings#localization) property instead.
|
70483
|
-
*/
|
70484
70671
|
get defaultLocaleName() { return this.localization.defaultLocaleName; },
|
70485
70672
|
set defaultLocaleName(val) { this.localization.defaultLocaleName = val; },
|
70486
70673
|
//#endregion
|
@@ -70493,41 +70680,41 @@ var settings = {
|
|
70493
70680
|
* Specifies whether to encode URL parameters when you access a web service. Default value: `true`.
|
70494
70681
|
*
|
70495
70682
|
* - `cacheLoadedChoices`: `boolean`\
|
70496
|
-
* 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`.
|
70497
70684
|
*
|
70498
70685
|
* - `disableQuestionWhileLoadingChoices`: `boolean`\
|
70499
70686
|
* Disables a question while its choices are being loaded from a web service. Default value: `false`.
|
70500
70687
|
*
|
70501
70688
|
* - `surveyServiceUrl`: `string`\
|
70502
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
|
+
* ```
|
70503
70701
|
*/
|
70504
70702
|
web: {
|
70703
|
+
onBeforeRequestChoices: function (sender, options) { },
|
70505
70704
|
encodeUrlParams: true,
|
70506
70705
|
cacheLoadedChoices: true,
|
70507
70706
|
disableQuestionWhileLoadingChoices: false,
|
70508
70707
|
surveyServiceUrl: "https://api.surveyjs.io/public/v1/Survey"
|
70509
70708
|
},
|
70510
70709
|
//#region web section, obsolete properties
|
70511
|
-
/**
|
70512
|
-
* This property is obsolete. Use the [`settings.web.encodeUrlParams`](https://surveyjs.io/form-library/documentation/api-reference/settings#web) property instead.
|
70513
|
-
*/
|
70514
70710
|
get webserviceEncodeParameters() { return this.web.encodeUrlParams; },
|
70515
70711
|
set webserviceEncodeParameters(val) { this.web.encodeUrlParams = val; },
|
70516
|
-
/**
|
70517
|
-
* This property is obsolete. Use the [`settings.web.cacheLoadedChoices`](https://surveyjs.io/form-library/documentation/api-reference/settings#web) property instead.
|
70518
|
-
*/
|
70519
70712
|
get useCachingForChoicesRestful() { return this.web.cacheLoadedChoices; },
|
70520
70713
|
set useCachingForChoicesRestful(val) { this.web.cacheLoadedChoices = val; },
|
70521
70714
|
get useCachingForChoicesRestfull() { return this.web.cacheLoadedChoices; },
|
70522
70715
|
set useCachingForChoicesRestfull(val) { this.web.cacheLoadedChoices = val; },
|
70523
|
-
/**
|
70524
|
-
* This property is obsolete. Use the [`settings.web.disableQuestionWhileLoadingChoices`](https://surveyjs.io/form-library/documentation/api-reference/settings#web) property instead.
|
70525
|
-
*/
|
70526
70716
|
get disableOnGettingChoicesFromWeb() { return this.web.disableQuestionWhileLoadingChoices; },
|
70527
70717
|
set disableOnGettingChoicesFromWeb(val) { this.web.disableQuestionWhileLoadingChoices = val; },
|
70528
|
-
/**
|
70529
|
-
* This property is obsolete. Use the [`settings.web.surveyServiceUrl`](https://surveyjs.io/form-library/documentation/api-reference/settings#web) property instead.
|
70530
|
-
*/
|
70531
70718
|
get surveyServiceUrl() { return this.web.surveyServiceUrl; },
|
70532
70719
|
set surveyServiceUrl(val) { this.web.surveyServiceUrl = val; },
|
70533
70720
|
//#endregion
|
@@ -70553,19 +70740,10 @@ var settings = {
|
|
70553
70740
|
executeSkipOnValueChanged: true
|
70554
70741
|
},
|
70555
70742
|
//#region triggers section, Obsolete properties
|
70556
|
-
/**
|
70557
|
-
* This property is obsolete. Use the [`settings.triggers.executeCompleteOnValueChanged`](https://surveyjs.io/form-library/documentation/api-reference/settings#triggers) property instead.
|
70558
|
-
*/
|
70559
70743
|
get executeCompleteTriggerOnValueChanged() { return this.triggers.executeCompleteOnValueChanged; },
|
70560
70744
|
set executeCompleteTriggerOnValueChanged(val) { this.triggers.executeCompleteOnValueChanged = val; },
|
70561
|
-
/**
|
70562
|
-
* This property is obsolete. Use the [`settings.triggers.changeNavigationButtonsOnComplete`](https://surveyjs.io/form-library/documentation/api-reference/settings#triggers) property instead.
|
70563
|
-
*/
|
70564
70745
|
get changeNavigationButtonsOnCompleteTrigger() { return this.triggers.changeNavigationButtonsOnComplete; },
|
70565
70746
|
set changeNavigationButtonsOnCompleteTrigger(val) { this.triggers.changeNavigationButtonsOnComplete = val; },
|
70566
|
-
/**
|
70567
|
-
* This property is obsolete. Use the [`settings.triggers.executeSkipOnValueChanged`](https://surveyjs.io/form-library/documentation/api-reference/settings#triggers) property instead.
|
70568
|
-
*/
|
70569
70747
|
get executeSkipTriggerOnValueChanged() { return this.triggers.executeSkipOnValueChanged; },
|
70570
70748
|
set executeSkipTriggerOnValueChanged(val) { this.triggers.executeSkipOnValueChanged = val; },
|
70571
70749
|
//#endregion
|
@@ -70603,19 +70781,10 @@ var settings = {
|
|
70603
70781
|
localizableStringSerializeAsObject: false
|
70604
70782
|
},
|
70605
70783
|
//#region serialization section, Obsolete properties
|
70606
|
-
/**
|
70607
|
-
* This property is obsolete. Use the [`settings.serialization.itemValueSerializeAsObject`](https://surveyjs.io/form-library/documentation/api-reference/settings#serialization) property instead.
|
70608
|
-
*/
|
70609
70784
|
get itemValueAlwaysSerializeAsObject() { return this.serialization.itemValueSerializeAsObject; },
|
70610
70785
|
set itemValueAlwaysSerializeAsObject(val) { this.serialization.itemValueSerializeAsObject = val; },
|
70611
|
-
/**
|
70612
|
-
* This property is obsolete. Use the [`settings.serialization.itemValueSerializeDisplayText`](https://surveyjs.io/form-library/documentation/api-reference/settings#serialization) property instead.
|
70613
|
-
*/
|
70614
70786
|
get itemValueAlwaysSerializeText() { return this.serialization.itemValueSerializeDisplayText; },
|
70615
70787
|
set itemValueAlwaysSerializeText(val) { this.serialization.itemValueSerializeDisplayText = val; },
|
70616
|
-
/**
|
70617
|
-
* This property is obsolete. Use the [`settings.serialization.localizableStringSerializeAsObject`](https://surveyjs.io/form-library/documentation/api-reference/settings#serialization) property instead.
|
70618
|
-
*/
|
70619
70788
|
get serializeLocalizableStringAsObject() { return this.serialization.localizableStringSerializeAsObject; },
|
70620
70789
|
set serializeLocalizableStringAsObject(val) { this.serialization.localizableStringSerializeAsObject = val; },
|
70621
70790
|
//#endregion
|
@@ -70634,9 +70803,6 @@ var settings = {
|
|
70634
70803
|
firstBatchSize: 3
|
70635
70804
|
},
|
70636
70805
|
//#region lazyRender section, Obsolete properties
|
70637
|
-
/**
|
70638
|
-
* This property is obsolete. Use the [`settings.lazyRender.enabled`](https://surveyjs.io/form-library/documentation/api-reference/settings#lazyRender) property instead.
|
70639
|
-
*/
|
70640
70806
|
get lazyRowsRendering() { return this.lazyRender.enabled; },
|
70641
70807
|
set lazyRowsRendering(val) { this.lazyRender.enabled = val; },
|
70642
70808
|
get lazyRowsRenderingStartRow() { return this.lazyRender.firstBatchSize; },
|
@@ -70686,34 +70852,16 @@ var settings = {
|
|
70686
70852
|
rateSize: "small",
|
70687
70853
|
},
|
70688
70854
|
//#region matrix section, Obsolete properties
|
70689
|
-
/**
|
70690
|
-
* This property is obsolete. Use the [`settings.matrix.defaultRowName`](https://surveyjs.io/form-library/documentation/api-reference/settings#matrix) property instead.
|
70691
|
-
*/
|
70692
70855
|
get matrixDefaultRowName() { return this.matrix.defaultRowName; },
|
70693
70856
|
set matrixDefaultRowName(val) { this.matrix.defaultRowName = val; },
|
70694
|
-
/**
|
70695
|
-
* This property is obsolete. Use the [`settings.matrix.defaultCellType`](https://surveyjs.io/form-library/documentation/api-reference/settings#matrix) property instead.
|
70696
|
-
*/
|
70697
70857
|
get matrixDefaultCellType() { return this.matrix.defaultCellType; },
|
70698
70858
|
set matrixDefaultCellType(val) { this.matrix.defaultCellType = val; },
|
70699
|
-
/**
|
70700
|
-
* This property is obsolete. Use the [`settings.matrix.totalsSuffix`](https://surveyjs.io/form-library/documentation/api-reference/settings#matrix) property instead.
|
70701
|
-
*/
|
70702
70859
|
get matrixTotalValuePostFix() { return this.matrix.totalsSuffix; },
|
70703
70860
|
set matrixTotalValuePostFix(val) { this.matrix.totalsSuffix = val; },
|
70704
|
-
/**
|
70705
|
-
* This property is obsolete. Use the [`settings.matrix.maxRowCount`](https://surveyjs.io/form-library/documentation/api-reference/settings#matrix) property instead.
|
70706
|
-
*/
|
70707
70861
|
get matrixMaximumRowCount() { return this.matrix.maxRowCount; },
|
70708
70862
|
set matrixMaximumRowCount(val) { this.matrix.maxRowCount = val; },
|
70709
|
-
/**
|
70710
|
-
* This property is obsolete. Use the [`settings.matrix.maxRowCountInCondition`](https://surveyjs.io/form-library/documentation/api-reference/settings#matrix) property instead.
|
70711
|
-
*/
|
70712
70863
|
get matrixMaxRowCountInCondition() { return this.matrix.maxRowCountInCondition; },
|
70713
70864
|
set matrixMaxRowCountInCondition(val) { this.matrix.maxRowCountInCondition = val; },
|
70714
|
-
/**
|
70715
|
-
* This property is obsolete. Use the [`settings.matrix.renderRemoveAsIcon`](https://surveyjs.io/form-library/documentation/api-reference/settings#matrix) property instead.
|
70716
|
-
*/
|
70717
70865
|
get matrixRenderRemoveAsIcon() { return this.matrix.renderRemoveAsIcon; },
|
70718
70866
|
set matrixRenderRemoveAsIcon(val) { this.matrix.renderRemoveAsIcon = val; },
|
70719
70867
|
//#endregion
|
@@ -70735,14 +70883,8 @@ var settings = {
|
|
70735
70883
|
maxPanelCountInCondition: 1
|
70736
70884
|
},
|
70737
70885
|
//#region panel section, Obsolete properties
|
70738
|
-
/**
|
70739
|
-
* This property is obsolete. Use the [`settings.panel.maxPanelCountInCondition`](https://surveyjs.io/form-library/documentation/api-reference/settings#panel) property instead.
|
70740
|
-
*/
|
70741
70886
|
get panelDynamicMaxPanelCountInCondition() { return this.panel.maxPanelCountInCondition; },
|
70742
70887
|
set panelDynamicMaxPanelCountInCondition(val) { this.panel.maxPanelCountInCondition = val; },
|
70743
|
-
/**
|
70744
|
-
* This property is obsolete. Use the [`settings.panel.maxPanelCount`](https://surveyjs.io/form-library/documentation/api-reference/settings#panel) property instead.
|
70745
|
-
*/
|
70746
70888
|
get panelMaximumPanelCount() { return this.panel.maxPanelCount; },
|
70747
70889
|
set panelMaximumPanelCount(val) { this.panel.maxPanelCount = val; },
|
70748
70890
|
//#endregion
|
@@ -70763,14 +70905,8 @@ var settings = {
|
|
70763
70905
|
textRenderMode: "input"
|
70764
70906
|
},
|
70765
70907
|
//#region readOnly section, Obsolete properties
|
70766
|
-
/**
|
70767
|
-
* This property is obsolete. Use the [`settings.readOnly.commentRenderMode`](https://surveyjs.io/form-library/documentation/api-reference/settings#readOnly) property instead.
|
70768
|
-
*/
|
70769
70908
|
get readOnlyCommentRenderMode() { return this.readOnly.commentRenderMode; },
|
70770
70909
|
set readOnlyCommentRenderMode(val) { this.readOnly.commentRenderMode = val; },
|
70771
|
-
/**
|
70772
|
-
* This property is obsolete. Use the [`settings.readOnly.textRenderMode`](https://surveyjs.io/form-library/documentation/api-reference/settings#readOnly) property instead.
|
70773
|
-
*/
|
70774
70910
|
get readOnlyTextRenderMode() { return this.readOnly.textRenderMode; },
|
70775
70911
|
set readOnlyTextRenderMode(val) { this.readOnly.textRenderMode = val; },
|
70776
70912
|
//#endregion
|
@@ -70790,14 +70926,8 @@ var settings = {
|
|
70790
70926
|
includeQuestionsWithHiddenTitle: false
|
70791
70927
|
},
|
70792
70928
|
//#region numbering section, Obsolete properties
|
70793
|
-
/**
|
70794
|
-
* This property is obsolete. Use the [`settings.numbering.includeQuestionsWithHiddenTitle`](https://surveyjs.io/form-library/documentation/api-reference/settings#numbering) property instead.
|
70795
|
-
*/
|
70796
70929
|
get setQuestionVisibleIndexForHiddenTitle() { return this.numbering.includeQuestionsWithHiddenTitle; },
|
70797
70930
|
set setQuestionVisibleIndexForHiddenTitle(val) { this.numbering.includeQuestionsWithHiddenTitle = val; },
|
70798
|
-
/**
|
70799
|
-
* This property is obsolete. Use the [`settings.numbering.includeQuestionsWithHiddenNumber`](https://surveyjs.io/form-library/documentation/api-reference/settings#numbering) property instead.
|
70800
|
-
*/
|
70801
70931
|
get setQuestionVisibleIndexForHiddenNumber() { return this.numbering.includeQuestionsWithHiddenNumber; },
|
70802
70932
|
set setQuestionVisibleIndexForHiddenNumber(val) { this.numbering.includeQuestionsWithHiddenNumber = val; },
|
70803
70933
|
//#endregion
|
@@ -72195,6 +72325,16 @@ var SurveyElement = /** @class */ (function (_super) {
|
|
72195
72325
|
enumerable: false,
|
72196
72326
|
configurable: true
|
72197
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
|
+
});
|
72198
72338
|
SurveyElement.prototype.ensureCssClassesValue = function () {
|
72199
72339
|
if (!this.cssClassesValue) {
|
72200
72340
|
this.cssClassesValue = this.calcCssClasses(this.css);
|
@@ -72248,7 +72388,7 @@ var SurveyElement = /** @class */ (function (_super) {
|
|
72248
72388
|
SurveyElement.prototype.getIsLoadingFromJson = function () {
|
72249
72389
|
if (_super.prototype.getIsLoadingFromJson.call(this))
|
72250
72390
|
return true;
|
72251
|
-
return this.
|
72391
|
+
return this.surveyValue ? this.surveyValue.isLoadingFromJson : false;
|
72252
72392
|
};
|
72253
72393
|
Object.defineProperty(SurveyElement.prototype, "name", {
|
72254
72394
|
/**
|
@@ -72773,9 +72913,6 @@ var SurveyElement = /** @class */ (function (_super) {
|
|
72773
72913
|
__decorate([
|
72774
72914
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: false })
|
72775
72915
|
], SurveyElement.prototype, "isDragMe", void 0);
|
72776
|
-
__decorate([
|
72777
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
|
72778
|
-
], SurveyElement.prototype, "cssClassesValue", void 0);
|
72779
72916
|
__decorate([
|
72780
72917
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: false })
|
72781
72918
|
], SurveyElement.prototype, "hasVisibleErrors", void 0);
|
@@ -73545,6 +73682,10 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
73545
73682
|
* [View Demo](https://surveyjs.io/form-library/examples/tabbed-interface-for-duplicate-group-option/ (linkStyle))
|
73546
73683
|
*/
|
73547
73684
|
_this.onGetDynamicPanelTabTitle = _this.addEvent();
|
73685
|
+
/**
|
73686
|
+
* An event that is raised after the current panel is changed in a [Dynamic Panel](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/) question.
|
73687
|
+
*/
|
73688
|
+
_this.onDynamicPanelCurrentIndexChanged = _this.addEvent();
|
73548
73689
|
/**
|
73549
73690
|
* An event that is raised to define whether a question answer is correct. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey/create-a-quiz).
|
73550
73691
|
*/
|
@@ -74794,7 +74935,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
74794
74935
|
* [Survey Localization demo](https://surveyjs.io/form-library/examples/survey-localization/ (linkStyle))
|
74795
74936
|
*/
|
74796
74937
|
get: function () {
|
74797
|
-
return this.
|
74938
|
+
return this.getPropertyValueWithoutDefault("locale") || _surveyStrings__WEBPACK_IMPORTED_MODULE_8__["surveyLocalization"].currentLocale;
|
74798
74939
|
},
|
74799
74940
|
set: function (value) {
|
74800
74941
|
if (value === _surveyStrings__WEBPACK_IMPORTED_MODULE_8__["surveyLocalization"].defaultLocale && !_surveyStrings__WEBPACK_IMPORTED_MODULE_8__["surveyLocalization"].currentLocale) {
|
@@ -75195,6 +75336,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
75195
75336
|
if (newVal !== this._isCompact) {
|
75196
75337
|
this._isCompact = newVal;
|
75197
75338
|
this.updateElementCss();
|
75339
|
+
this.triggerResponsiveness(true);
|
75198
75340
|
}
|
75199
75341
|
},
|
75200
75342
|
enumerable: false,
|
@@ -75978,7 +76120,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
75978
76120
|
/**
|
75979
76121
|
* Merges a specified data object with the object from the [`data`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#data) property.
|
75980
76122
|
*
|
75981
|
-
* Refer to the following help topic for more information: [
|
76123
|
+
* Refer to the following help topic for more information: [Populate Form Fields | Multiple Question Values](https://surveyjs.io/form-library/documentation/design-survey/pre-populate-form-fields#multiple-question-values).
|
75982
76124
|
*
|
75983
76125
|
* @param data A data object to merge. It should have the following structure: `{ questionName: questionValue, ... }`
|
75984
76126
|
* @see setValue
|
@@ -77146,21 +77288,16 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
77146
77288
|
var visPages = this.visiblePages;
|
77147
77289
|
var firstErrorPage = null;
|
77148
77290
|
var res = true;
|
77291
|
+
var rec = { fireCallback: fireCallback, focuseOnFirstError: focusOnFirstError, firstErrorQuestion: null, result: false };
|
77149
77292
|
for (var i = 0; i < visPages.length; i++) {
|
77150
|
-
if (!visPages[i].validate(fireCallback,
|
77293
|
+
if (!visPages[i].validate(fireCallback, focusOnFirstError, rec)) {
|
77151
77294
|
if (!firstErrorPage)
|
77152
77295
|
firstErrorPage = visPages[i];
|
77153
77296
|
res = false;
|
77154
77297
|
}
|
77155
77298
|
}
|
77156
|
-
if (focusOnFirstError && !!firstErrorPage) {
|
77157
|
-
|
77158
|
-
for (var i_2 = 0; i_2 < questions.length; i_2++) {
|
77159
|
-
if (questions[i_2].errors.length > 0) {
|
77160
|
-
questions[i_2].focus(true);
|
77161
|
-
break;
|
77162
|
-
}
|
77163
|
-
}
|
77299
|
+
if (focusOnFirstError && !!firstErrorPage && !!rec.firstErrorQuestion) {
|
77300
|
+
rec.firstErrorQuestion.focus(true);
|
77164
77301
|
}
|
77165
77302
|
if (!res || !onAsyncValidation)
|
77166
77303
|
return res;
|
@@ -77538,6 +77675,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
77538
77675
|
};
|
77539
77676
|
SurveyModel.prototype.setupPagesForPageModes = function (isSinglePage) {
|
77540
77677
|
this.questionHashesClear();
|
77678
|
+
this.isCreatingPagesForPreview = true;
|
77541
77679
|
var startIndex = this.getPageStartIndex();
|
77542
77680
|
_super.prototype.startLoadingFromJson.call(this);
|
77543
77681
|
var newPages = this.createPagesForQuestionOnPageMode(isSinglePage, startIndex);
|
@@ -77552,6 +77690,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
77552
77690
|
}
|
77553
77691
|
this.doElementsOnLoad();
|
77554
77692
|
this.updateCurrentPage();
|
77693
|
+
this.isCreatingPagesForPreview = false;
|
77555
77694
|
};
|
77556
77695
|
SurveyModel.prototype.createPagesForQuestionOnPageMode = function (isSinglePage, startIndex) {
|
77557
77696
|
if (isSinglePage) {
|
@@ -78203,7 +78342,8 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
78203
78342
|
SurveyModel.prototype.afterRenderPage = function (htmlElement) {
|
78204
78343
|
var _this = this;
|
78205
78344
|
if (!this.isDesignMode && !this.focusingQuestionInfo) {
|
78206
|
-
|
78345
|
+
var doScroll_1 = !this.isFirstPageRendering;
|
78346
|
+
setTimeout(function () { return _this.scrollToTopOnPageChange(doScroll_1); }, 1);
|
78207
78347
|
}
|
78208
78348
|
this.focusQuestionInfo();
|
78209
78349
|
this.isFirstPageRendering = false;
|
@@ -78422,6 +78562,10 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
78422
78562
|
options.question = question;
|
78423
78563
|
this.onGetDynamicPanelTabTitle.fire(this, options);
|
78424
78564
|
};
|
78565
|
+
SurveyModel.prototype.dynamicPanelCurrentIndexChanged = function (question, options) {
|
78566
|
+
options.question = question;
|
78567
|
+
this.onDynamicPanelCurrentIndexChanged.fire(this, options);
|
78568
|
+
};
|
78425
78569
|
SurveyModel.prototype.dragAndDropAllow = function (options) {
|
78426
78570
|
this.onDragDropAllow.fire(this, options);
|
78427
78571
|
return options.allow;
|
@@ -78505,13 +78649,8 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
78505
78649
|
* question,
|
78506
78650
|
* question.name,
|
78507
78651
|
* question.value,
|
78508
|
-
* (
|
78509
|
-
*
|
78510
|
-
* // Handle success
|
78511
|
-
* }
|
78512
|
-
* if (status === "error") {
|
78513
|
-
* // Handle error
|
78514
|
-
* }
|
78652
|
+
* (data, errors) => {
|
78653
|
+
* // ...
|
78515
78654
|
* }
|
78516
78655
|
* );
|
78517
78656
|
* ```
|
@@ -78700,7 +78839,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
78700
78839
|
/**
|
78701
78840
|
* Returns a question with a specified [`name`](https://surveyjs.io/form-library/documentation/api-reference/question#name).
|
78702
78841
|
* @param name A question name
|
78703
|
-
* @param caseInsensitive (Optional) A Boolean value that specifies case sensitivity when searching for the question. Default value: `false` (uppercase and lowercase letters are treated as distinct).
|
78842
|
+
* @param caseInsensitive *(Optional)* A Boolean value that specifies case sensitivity when searching for the question. Default value: `false` (uppercase and lowercase letters are treated as distinct).
|
78704
78843
|
* @returns A question with a specified name.
|
78705
78844
|
* @see getAllQuestions
|
78706
78845
|
* @see getQuestionByValueName
|
@@ -78728,7 +78867,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
78728
78867
|
*
|
78729
78868
|
* > Since `valueName` does not have to be unique, multiple questions can have the same `valueName` value. In this case, the `getQuestionByValueName()` method returns the first such question. If you need to get all questions with the same `valueName`, call the `getQuestionsByValueName()` method.
|
78730
78869
|
* @param valueName A question's `valueName` property value.
|
78731
|
-
* @param caseInsensitive (Optional) A Boolean value that specifies case sensitivity when searching for the question. Default value: `false` (uppercase and lowercase letters are treated as distinct).
|
78870
|
+
* @param caseInsensitive *(Optional)* A Boolean value that specifies case sensitivity when searching for the question. Default value: `false` (uppercase and lowercase letters are treated as distinct).
|
78732
78871
|
* @returns A question with a specified `valueName`.
|
78733
78872
|
* @see getAllQuestions
|
78734
78873
|
* @see getQuestionByName
|
@@ -78741,7 +78880,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
78741
78880
|
/**
|
78742
78881
|
* Returns all questions with a specified [`valueName`](https://surveyjs.io/form-library/documentation/api-reference/question#valueName). If a question's `valueName` is undefined, its [`name`](https://surveyjs.io/form-library/documentation/api-reference/question#name) property is used.
|
78743
78882
|
* @param valueName A question's `valueName` property value.
|
78744
|
-
* @param caseInsensitive (Optional) A Boolean value that specifies case sensitivity when searching for the questions. Default value: `false` (uppercase and lowercase letters are treated as distinct).
|
78883
|
+
* @param caseInsensitive *(Optional)* A Boolean value that specifies case sensitivity when searching for the questions. Default value: `false` (uppercase and lowercase letters are treated as distinct).
|
78745
78884
|
* @returns An array of questions with a specified `valueName`.
|
78746
78885
|
* @see getAllQuestions
|
78747
78886
|
* @see getQuestionByName
|
@@ -78766,7 +78905,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
78766
78905
|
/**
|
78767
78906
|
* Returns an array of questions with specified [names](https://surveyjs.io/form-library/documentation/api-reference/question#name).
|
78768
78907
|
* @param names An array of question names.
|
78769
|
-
* @param caseInsensitive (Optional) A Boolean value that specifies case sensitivity when searching for the questions. Default value: `false` (uppercase and lowercase letters are treated as distinct).
|
78908
|
+
* @param caseInsensitive *(Optional)* A Boolean value that specifies case sensitivity when searching for the questions. Default value: `false` (uppercase and lowercase letters are treated as distinct).
|
78770
78909
|
* @returns An array of questions with specified names
|
78771
78910
|
* @see getAllQuestions
|
78772
78911
|
*/
|
@@ -78884,7 +79023,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
78884
79023
|
/**
|
78885
79024
|
* Returns a [panel](https://surveyjs.io/form-library/documentation/api-reference/panel-model) with a specified [`name`](https://surveyjs.io/form-library/documentation/api-reference/panel-model#name).
|
78886
79025
|
* @param name A panel name.
|
78887
|
-
* @param caseInsensitive (Optional) A Boolean value that specifies case sensitivity when searching for the panel. Default value: `false` (uppercase and lowercase letters are treated as distinct).
|
79026
|
+
* @param caseInsensitive *(Optional)* A Boolean value that specifies case sensitivity when searching for the panel. Default value: `false` (uppercase and lowercase letters are treated as distinct).
|
78888
79027
|
* @returns A panel with a specified name.
|
78889
79028
|
* @see getAllPanels
|
78890
79029
|
*/
|
@@ -79198,8 +79337,8 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
79198
79337
|
this.calculatedValues[i].doCalculation(this.calculatedValues, this.conditionValues, properties);
|
79199
79338
|
}
|
79200
79339
|
_super.prototype.runConditionCore.call(this, this.conditionValues, properties);
|
79201
|
-
for (var
|
79202
|
-
pages[
|
79340
|
+
for (var i_2 = 0; i_2 < pages.length; i_2++) {
|
79341
|
+
pages[i_2].runCondition(this.conditionValues, properties);
|
79203
79342
|
}
|
79204
79343
|
};
|
79205
79344
|
SurveyModel.prototype.runQuestionsTriggers = function (name, value) {
|
@@ -79371,13 +79510,13 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
79371
79510
|
page.num = isPageVisible ? page.visibleIndex + 1 : -1;
|
79372
79511
|
}
|
79373
79512
|
};
|
79374
|
-
SurveyModel.prototype.fromJSON = function (json) {
|
79513
|
+
SurveyModel.prototype.fromJSON = function (json, options) {
|
79375
79514
|
if (!json)
|
79376
79515
|
return;
|
79377
79516
|
this.questionHashesClear();
|
79378
79517
|
this.jsonErrors = null;
|
79379
79518
|
var jsonConverter = new _jsonobject__WEBPACK_IMPORTED_MODULE_1__["JsonObject"]();
|
79380
|
-
jsonConverter.toObject(json, this);
|
79519
|
+
jsonConverter.toObject(json, this, options);
|
79381
79520
|
if (jsonConverter.errors.length > 0) {
|
79382
79521
|
this.jsonErrors = jsonConverter.errors;
|
79383
79522
|
}
|
@@ -79716,6 +79855,8 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
79716
79855
|
SurveyModel.prototype.setValue = function (name, newQuestionValue, locNotification, allowNotifyValueChanged, questionName) {
|
79717
79856
|
if (locNotification === void 0) { locNotification = false; }
|
79718
79857
|
if (allowNotifyValueChanged === void 0) { allowNotifyValueChanged = true; }
|
79858
|
+
if (this.isCreatingPagesForPreview)
|
79859
|
+
return;
|
79719
79860
|
var newValue = newQuestionValue;
|
79720
79861
|
if (allowNotifyValueChanged) {
|
79721
79862
|
newValue = this.questionOnValueChanging(name, newQuestionValue);
|
@@ -80448,6 +80589,9 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
80448
80589
|
return this.getLocalizationFormatString(strName, surveySpent, surveyLimit);
|
80449
80590
|
};
|
80450
80591
|
SurveyModel.prototype.getDisplayClockTime = function (val) {
|
80592
|
+
if (val < 0) {
|
80593
|
+
val = 0;
|
80594
|
+
}
|
80451
80595
|
var min = Math.floor(val / 60);
|
80452
80596
|
var sec = val % 60;
|
80453
80597
|
var secStr = sec.toString();
|
@@ -80803,7 +80947,19 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
80803
80947
|
}
|
80804
80948
|
}
|
80805
80949
|
else if (this.state === "running" && isStrCiEqual(layoutElement.id, "progress-" + this.progressBarType)) {
|
80806
|
-
|
80950
|
+
var headerLayoutElement = this.layoutElements.filter(function (a) { return a.id === "advanced-header"; })[0];
|
80951
|
+
var advHeader = headerLayoutElement && headerLayoutElement.data;
|
80952
|
+
var isBelowHeader = !advHeader || advHeader.hasBackground;
|
80953
|
+
if (container === "header" && !isBelowHeader) {
|
80954
|
+
layoutElement.index = -150;
|
80955
|
+
if (this.isShowProgressBarOnTop && !this.isShowStartingPage) {
|
80956
|
+
containerLayoutElements.push(layoutElement);
|
80957
|
+
}
|
80958
|
+
}
|
80959
|
+
if (container === "center" && isBelowHeader) {
|
80960
|
+
if (!!layoutElement.index) {
|
80961
|
+
delete layoutElement.index;
|
80962
|
+
}
|
80807
80963
|
if (this.isShowProgressBarOnTop && !this.isShowStartingPage) {
|
80808
80964
|
containerLayoutElements.push(layoutElement);
|
80809
80965
|
}
|
@@ -81086,7 +81242,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("survey", [
|
|
81086
81242
|
onSetValue: function (obj, value, jsonConverter) {
|
81087
81243
|
obj.pages.splice(0, obj.pages.length);
|
81088
81244
|
var page = obj.addNewPage("");
|
81089
|
-
jsonConverter.toObject({ questions: value }, page);
|
81245
|
+
jsonConverter.toObject({ questions: value }, page, jsonConverter === null || jsonConverter === void 0 ? void 0 : jsonConverter.options);
|
81090
81246
|
},
|
81091
81247
|
},
|
81092
81248
|
{
|