survey-react-ui 1.9.124 → 1.9.126
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/package.json
CHANGED
package/survey-react-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - Survey JavaScript library v1.9.
|
|
2
|
+
* surveyjs - Survey JavaScript library v1.9.126
|
|
3
3
|
* Copyright (c) 2015-2024 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
4
4
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
|
5
5
|
*/
|
|
@@ -420,6 +420,20 @@ var Base = /** @class */ (function () {
|
|
|
420
420
|
}
|
|
421
421
|
return _helpers__WEBPACK_IMPORTED_MODULE_1__["Helpers"].isValueEmpty(value);
|
|
422
422
|
};
|
|
423
|
+
Base.prototype.equals = function (obj) {
|
|
424
|
+
if (!obj)
|
|
425
|
+
return false;
|
|
426
|
+
if (this.isDisposed || obj.isDisposed)
|
|
427
|
+
return false;
|
|
428
|
+
if (this.getType() != obj.getType())
|
|
429
|
+
return false;
|
|
430
|
+
return this.equalsCore(obj);
|
|
431
|
+
};
|
|
432
|
+
Base.prototype.equalsCore = function (obj) {
|
|
433
|
+
if (this.name !== obj.name)
|
|
434
|
+
return false;
|
|
435
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_1__["Helpers"].isTwoValueEquals(this.toJSON(), obj.toJSON(), false, true, false);
|
|
436
|
+
};
|
|
423
437
|
Base.prototype.trimValue = function (value) {
|
|
424
438
|
if (!!value && (typeof value === "string" || value instanceof String))
|
|
425
439
|
return value.trim();
|
|
@@ -959,8 +973,8 @@ var Base = /** @class */ (function () {
|
|
|
959
973
|
Base.prototype.createCustomLocalizableObj = function (name) {
|
|
960
974
|
var locStr = this.getLocalizableString(name);
|
|
961
975
|
if (locStr)
|
|
962
|
-
return;
|
|
963
|
-
this.createLocalizableString(name, this, false, true);
|
|
976
|
+
return locStr;
|
|
977
|
+
return this.createLocalizableString(name, this, false, true);
|
|
964
978
|
};
|
|
965
979
|
Base.prototype.getLocale = function () {
|
|
966
980
|
var locOwner = this.getSurvey();
|
|
@@ -2606,7 +2620,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2606
2620
|
|
|
2607
2621
|
|
|
2608
2622
|
|
|
2609
|
-
Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.
|
|
2623
|
+
Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.126", "survey-react-ui");
|
|
2610
2624
|
|
|
2611
2625
|
|
|
2612
2626
|
/***/ }),
|
|
@@ -6941,21 +6955,11 @@ var Helpers = /** @class */ (function () {
|
|
|
6941
6955
|
return x == y;
|
|
6942
6956
|
if (!Helpers.isValueObject(x) || !Helpers.isValueObject(y))
|
|
6943
6957
|
return false;
|
|
6944
|
-
if (x["equals"])
|
|
6958
|
+
if (x["equals"] && y["equals"])
|
|
6945
6959
|
return x.equals(y);
|
|
6946
|
-
if (
|
|
6947
|
-
if (x.isDisposed || y.isDisposed)
|
|
6948
|
-
return false;
|
|
6949
|
-
if (x.getType() !== y.getType())
|
|
6950
|
-
return false;
|
|
6951
|
-
if (!!x.name && x.name !== y.name)
|
|
6952
|
-
return false;
|
|
6953
|
-
return this.isTwoValueEquals(x.toJSON(), y.toJSON(), ignoreOrder, caseSensitive, trimStrings);
|
|
6954
|
-
}
|
|
6955
|
-
if (Array.isArray(x) && Array.isArray(y))
|
|
6960
|
+
if (Array.isArray(x) && Array.isArray(y)) {
|
|
6956
6961
|
return Helpers.isArraysEqual(x, y, ignoreOrder, caseSensitive, trimStrings);
|
|
6957
|
-
|
|
6958
|
-
return x.equalsTo(y);
|
|
6962
|
+
}
|
|
6959
6963
|
for (var p in x) {
|
|
6960
6964
|
if (!x.hasOwnProperty(p))
|
|
6961
6965
|
continue;
|
|
@@ -7490,7 +7494,12 @@ var JsonObjectProperty = /** @class */ (function () {
|
|
|
7490
7494
|
return this.isRequiredValue;
|
|
7491
7495
|
},
|
|
7492
7496
|
set: function (val) {
|
|
7493
|
-
this.
|
|
7497
|
+
if (val !== this.isRequired) {
|
|
7498
|
+
this.isRequiredValue = val;
|
|
7499
|
+
if (!!this.classInfo) {
|
|
7500
|
+
this.classInfo.resetAllProperties();
|
|
7501
|
+
}
|
|
7502
|
+
}
|
|
7494
7503
|
},
|
|
7495
7504
|
enumerable: false,
|
|
7496
7505
|
configurable: true
|
|
@@ -7525,7 +7534,7 @@ var JsonObjectProperty = /** @class */ (function () {
|
|
|
7525
7534
|
JsonObjectProperty.prototype.getDefaultValue = function (obj) {
|
|
7526
7535
|
var result = !!this.defaultValueFunc ? this.defaultValueFunc(obj) : this.defaultValueValue;
|
|
7527
7536
|
if (!!JsonObjectProperty.getItemValuesDefaultValue &&
|
|
7528
|
-
|
|
7537
|
+
Serializer.isDescendantOf(this.className, "itemvalue")) {
|
|
7529
7538
|
result = JsonObjectProperty.getItemValuesDefaultValue(this.defaultValueValue || [], this.className);
|
|
7530
7539
|
}
|
|
7531
7540
|
return result;
|
|
@@ -7870,7 +7879,8 @@ var CustomPropertiesCollection = /** @class */ (function () {
|
|
|
7870
7879
|
if (prop.isLocalizable &&
|
|
7871
7880
|
prop.serializationProperty &&
|
|
7872
7881
|
obj.createCustomLocalizableObj) {
|
|
7873
|
-
obj.createCustomLocalizableObj(prop.name);
|
|
7882
|
+
var locStr = obj.createCustomLocalizableObj(prop.name);
|
|
7883
|
+
locStr.defaultValue = prop.defaultValue;
|
|
7874
7884
|
var locDesc = {
|
|
7875
7885
|
get: function () {
|
|
7876
7886
|
return obj.getLocalizableString(prop.name);
|
|
@@ -7879,7 +7889,7 @@ var CustomPropertiesCollection = /** @class */ (function () {
|
|
|
7879
7889
|
Object.defineProperty(obj, prop.serializationProperty, locDesc);
|
|
7880
7890
|
var desc = {
|
|
7881
7891
|
get: function () {
|
|
7882
|
-
return obj.getLocalizableStringText(prop.name
|
|
7892
|
+
return obj.getLocalizableStringText(prop.name);
|
|
7883
7893
|
},
|
|
7884
7894
|
set: function (v) {
|
|
7885
7895
|
obj.setLocalizableStringText(prop.name, v);
|
|
@@ -7891,7 +7901,7 @@ var CustomPropertiesCollection = /** @class */ (function () {
|
|
|
7891
7901
|
var defaultValue = prop.defaultValue;
|
|
7892
7902
|
var isArrayProp = prop.isArray || prop.type === "multiplevalues";
|
|
7893
7903
|
if (typeof obj.createNewArray === "function") {
|
|
7894
|
-
if (
|
|
7904
|
+
if (Serializer.isDescendantOf(prop.className, "itemvalue")) {
|
|
7895
7905
|
obj.createNewArray(prop.name, function (item) {
|
|
7896
7906
|
item.locOwner = obj;
|
|
7897
7907
|
item.ownerPropertyName = prop.name;
|
|
@@ -7982,8 +7992,20 @@ var JsonMetadataClass = /** @class */ (function () {
|
|
|
7982
7992
|
this.fillAllProperties();
|
|
7983
7993
|
return this.allProperties;
|
|
7984
7994
|
};
|
|
7995
|
+
JsonMetadataClass.prototype.getRequiredProperties = function () {
|
|
7996
|
+
if (!!this.requiredProperties)
|
|
7997
|
+
return this.requiredProperties;
|
|
7998
|
+
this.requiredProperties = [];
|
|
7999
|
+
var props = this.getAllProperties();
|
|
8000
|
+
for (var i = 0; i < props.length; i++) {
|
|
8001
|
+
if (props[i].isRequired)
|
|
8002
|
+
this.requiredProperties.push(props[i]);
|
|
8003
|
+
}
|
|
8004
|
+
return this.requiredProperties;
|
|
8005
|
+
};
|
|
7985
8006
|
JsonMetadataClass.prototype.resetAllProperties = function () {
|
|
7986
8007
|
this.allProperties = undefined;
|
|
8008
|
+
this.requiredProperties = undefined;
|
|
7987
8009
|
this.hashProperties = undefined;
|
|
7988
8010
|
var childClasses = Serializer.getChildrenClasses(this.name);
|
|
7989
8011
|
for (var i = 0; i < childClasses.length; i++) {
|
|
@@ -8253,6 +8275,7 @@ var JsonMetadata = /** @class */ (function () {
|
|
|
8253
8275
|
this.classes = {};
|
|
8254
8276
|
this.alternativeNames = {};
|
|
8255
8277
|
this.childrenClasses = {};
|
|
8278
|
+
this.dynamicPropsCache = {};
|
|
8256
8279
|
}
|
|
8257
8280
|
JsonMetadata.prototype.getObjPropertyValue = function (obj, name) {
|
|
8258
8281
|
if (this.isObjWrapper(obj)) {
|
|
@@ -8365,14 +8388,18 @@ var JsonMetadata = /** @class */ (function () {
|
|
|
8365
8388
|
if (dynamicType === void 0) { dynamicType = null; }
|
|
8366
8389
|
if (!obj || !obj.getType || (!obj.getDynamicType && !dynamicType))
|
|
8367
8390
|
return [];
|
|
8391
|
+
var objType = obj.getType();
|
|
8368
8392
|
var dType = !!dynamicType ? dynamicType : obj.getDynamicType();
|
|
8369
8393
|
if (!dType)
|
|
8370
8394
|
return [];
|
|
8395
|
+
var cacheType = dType + "-" + objType;
|
|
8396
|
+
if (this.dynamicPropsCache[cacheType])
|
|
8397
|
+
return this.dynamicPropsCache[cacheType];
|
|
8371
8398
|
var dynamicProps = this.getProperties(dType);
|
|
8372
8399
|
if (!dynamicProps || dynamicProps.length == 0)
|
|
8373
8400
|
return [];
|
|
8374
8401
|
var hash = {};
|
|
8375
|
-
var props = this.getProperties(
|
|
8402
|
+
var props = this.getProperties(objType);
|
|
8376
8403
|
for (var i = 0; i < props.length; i++) {
|
|
8377
8404
|
hash[props[i].name] = props[i];
|
|
8378
8405
|
}
|
|
@@ -8383,6 +8410,7 @@ var JsonMetadata = /** @class */ (function () {
|
|
|
8383
8410
|
res.push(dProp);
|
|
8384
8411
|
}
|
|
8385
8412
|
}
|
|
8413
|
+
this.dynamicPropsCache[cacheType] = res;
|
|
8386
8414
|
return res;
|
|
8387
8415
|
};
|
|
8388
8416
|
JsonMetadata.prototype.hasOriginalProperty = function (obj, propName) {
|
|
@@ -8492,12 +8520,13 @@ var JsonMetadata = /** @class */ (function () {
|
|
|
8492
8520
|
return result;
|
|
8493
8521
|
};
|
|
8494
8522
|
JsonMetadata.prototype.getRequiredProperties = function (name) {
|
|
8495
|
-
var
|
|
8523
|
+
var metaClass = this.findClass(name);
|
|
8524
|
+
if (!metaClass)
|
|
8525
|
+
return [];
|
|
8526
|
+
var props = metaClass.getRequiredProperties();
|
|
8496
8527
|
var res = [];
|
|
8497
|
-
for (var i = 0; i <
|
|
8498
|
-
|
|
8499
|
-
res.push(properties[i].name);
|
|
8500
|
-
}
|
|
8528
|
+
for (var i = 0; i < props.length; i++) {
|
|
8529
|
+
res.push(props[i].name);
|
|
8501
8530
|
}
|
|
8502
8531
|
return res;
|
|
8503
8532
|
};
|
|
@@ -8516,6 +8545,7 @@ var JsonMetadata = /** @class */ (function () {
|
|
|
8516
8545
|
return null;
|
|
8517
8546
|
var property = metaDataClass.createProperty(propertyInfo, true);
|
|
8518
8547
|
if (property) {
|
|
8548
|
+
this.clearDynamicPropsCache(metaDataClass);
|
|
8519
8549
|
metaDataClass.resetAllProperties();
|
|
8520
8550
|
}
|
|
8521
8551
|
return property;
|
|
@@ -8526,11 +8556,15 @@ var JsonMetadata = /** @class */ (function () {
|
|
|
8526
8556
|
return false;
|
|
8527
8557
|
var property = metaDataClass.find(propertyName);
|
|
8528
8558
|
if (property) {
|
|
8559
|
+
this.clearDynamicPropsCache(metaDataClass);
|
|
8529
8560
|
this.removePropertyFromClass(metaDataClass, property);
|
|
8530
8561
|
metaDataClass.resetAllProperties();
|
|
8531
8562
|
CustomPropertiesCollection.removeProperty(metaDataClass.name, propertyName);
|
|
8532
8563
|
}
|
|
8533
8564
|
};
|
|
8565
|
+
JsonMetadata.prototype.clearDynamicPropsCache = function (metaDataClass) {
|
|
8566
|
+
this.dynamicPropsCache = {};
|
|
8567
|
+
};
|
|
8534
8568
|
JsonMetadata.prototype.removePropertyFromClass = function (metaDataClass, property) {
|
|
8535
8569
|
var index = metaDataClass.properties.indexOf(property);
|
|
8536
8570
|
if (index < 0)
|
|
@@ -8757,7 +8791,7 @@ var JsonUnknownPropertyError = /** @class */ (function (_super) {
|
|
|
8757
8791
|
"' is unknown.") || this;
|
|
8758
8792
|
_this.propertyName = propertyName;
|
|
8759
8793
|
_this.className = className;
|
|
8760
|
-
var properties =
|
|
8794
|
+
var properties = Serializer.getProperties(className);
|
|
8761
8795
|
if (properties) {
|
|
8762
8796
|
_this.description = "The list of available properties are: ";
|
|
8763
8797
|
for (var i = 0; i < properties.length; i++) {
|
|
@@ -8780,7 +8814,7 @@ var JsonMissingTypeErrorBase = /** @class */ (function (_super) {
|
|
|
8780
8814
|
_this.type = type;
|
|
8781
8815
|
_this.message = message;
|
|
8782
8816
|
_this.description = "The following types are available: ";
|
|
8783
|
-
var types =
|
|
8817
|
+
var types = Serializer.getChildrenClasses(baseClassName, true);
|
|
8784
8818
|
for (var i = 0; i < types.length; i++) {
|
|
8785
8819
|
if (i > 0)
|
|
8786
8820
|
_this.description += ", ";
|
|
@@ -8886,9 +8920,9 @@ var JsonObject = /** @class */ (function () {
|
|
|
8886
8920
|
var needAddErrors = true;
|
|
8887
8921
|
if (obj.getType) {
|
|
8888
8922
|
objType = obj.getType();
|
|
8889
|
-
properties =
|
|
8923
|
+
properties = Serializer.getProperties(objType);
|
|
8890
8924
|
needAddErrors =
|
|
8891
|
-
!!objType && !
|
|
8925
|
+
!!objType && !Serializer.isDescendantOf(objType, "itemvalue");
|
|
8892
8926
|
}
|
|
8893
8927
|
if (!properties)
|
|
8894
8928
|
return;
|
|
@@ -8928,7 +8962,7 @@ var JsonObject = /** @class */ (function () {
|
|
|
8928
8962
|
if (property != null && !property.className) {
|
|
8929
8963
|
result[JsonObject.typePropertyName] = property.getObjType(obj.getType());
|
|
8930
8964
|
}
|
|
8931
|
-
this.propertiesToJson(obj,
|
|
8965
|
+
this.propertiesToJson(obj, Serializer.getProperties(obj.getType()), result, storeDefaults);
|
|
8932
8966
|
this.propertiesToJson(obj, this.getDynamicProperties(obj), result, storeDefaults);
|
|
8933
8967
|
return result;
|
|
8934
8968
|
};
|
|
@@ -9046,7 +9080,7 @@ var JsonObject = /** @class */ (function () {
|
|
|
9046
9080
|
var result = { newObj: null, error: null };
|
|
9047
9081
|
var className = this.getClassNameForNewObj(value, property);
|
|
9048
9082
|
result.newObj = className
|
|
9049
|
-
?
|
|
9083
|
+
? Serializer.createClass(className, value)
|
|
9050
9084
|
: null;
|
|
9051
9085
|
result.error = this.checkNewObjectOnErrors(result.newObj, value, property, className);
|
|
9052
9086
|
return result;
|
|
@@ -9088,16 +9122,18 @@ var JsonObject = /** @class */ (function () {
|
|
|
9088
9122
|
JsonObject.prototype.getRequiredError = function (obj, jsonValue) {
|
|
9089
9123
|
if (!obj.getType || typeof obj.getData === "function")
|
|
9090
9124
|
return null;
|
|
9091
|
-
var
|
|
9092
|
-
|
|
9093
|
-
|
|
9125
|
+
var metaClass = Serializer.findClass(obj.getType());
|
|
9126
|
+
if (!metaClass)
|
|
9127
|
+
return null;
|
|
9128
|
+
var props = metaClass.getRequiredProperties();
|
|
9129
|
+
if (!Array.isArray(props))
|
|
9094
9130
|
return null;
|
|
9095
|
-
for (var i = 0; i <
|
|
9096
|
-
var prop =
|
|
9097
|
-
if (!
|
|
9131
|
+
for (var i = 0; i < props.length; i++) {
|
|
9132
|
+
var prop = props[i];
|
|
9133
|
+
if (!_helpers__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isValueEmpty(prop.defaultValue))
|
|
9098
9134
|
continue;
|
|
9099
9135
|
if (!jsonValue[prop.name]) {
|
|
9100
|
-
return new JsonRequiredPropertyError(prop.name,
|
|
9136
|
+
return new JsonRequiredPropertyError(prop.name, obj.getType());
|
|
9101
9137
|
}
|
|
9102
9138
|
}
|
|
9103
9139
|
return null;
|
|
@@ -9313,7 +9349,7 @@ var LocalizableString = /** @class */ (function () {
|
|
|
9313
9349
|
}
|
|
9314
9350
|
}
|
|
9315
9351
|
if (!res)
|
|
9316
|
-
res = "";
|
|
9352
|
+
res = this.defaultValue || "";
|
|
9317
9353
|
return res;
|
|
9318
9354
|
},
|
|
9319
9355
|
enumerable: false,
|
|
@@ -9811,6 +9847,7 @@ var englishStrings = {
|
|
|
9811
9847
|
requiredError: "Response required.",
|
|
9812
9848
|
requiredErrorInPanel: "Response required: answer at least one question.",
|
|
9813
9849
|
requiredInAllRowsError: "Response required: answer questions in all rows.",
|
|
9850
|
+
eachRowUniqueError: "Each row must have a unique value.",
|
|
9814
9851
|
numericError: "The value should be numeric.",
|
|
9815
9852
|
minError: "The value should not be less than {0}",
|
|
9816
9853
|
maxError: "The value should not be greater than {0}",
|
|
@@ -11679,8 +11716,9 @@ var SurveyQuestionPanelDynamicAddButton = /** @class */ (function (_super) {
|
|
|
11679
11716
|
SurveyQuestionPanelDynamicAddButton.prototype.renderElement = function () {
|
|
11680
11717
|
if (!this.question.canAddPanel)
|
|
11681
11718
|
return null;
|
|
11719
|
+
var btnText = this.renderLocString(this.question.locPanelAddText);
|
|
11682
11720
|
return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", { type: "button", className: this.question.getAddButtonCss(), onClick: this.handleClick },
|
|
11683
|
-
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { className: this.question.cssClasses.buttonAddText },
|
|
11721
|
+
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { className: this.question.cssClasses.buttonAddText }, btnText)));
|
|
11684
11722
|
};
|
|
11685
11723
|
return SurveyQuestionPanelDynamicAddButton;
|
|
11686
11724
|
}(SurveyQuestionPanelDynamicAction));
|
|
@@ -11898,8 +11936,9 @@ var SurveyQuestionPanelDynamicRemoveButton = /** @class */ (function (_super) {
|
|
|
11898
11936
|
return _this;
|
|
11899
11937
|
}
|
|
11900
11938
|
SurveyQuestionPanelDynamicRemoveButton.prototype.renderElement = function () {
|
|
11939
|
+
var btnText = this.renderLocString(this.question.locPanelRemoveText);
|
|
11901
11940
|
return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", { className: this.question.getPanelRemoveButtonCss(), onClick: this.handleClick, type: "button" },
|
|
11902
|
-
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { className: this.question.cssClasses.buttonRemoveText },
|
|
11941
|
+
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { className: this.question.cssClasses.buttonRemoveText }, btnText),
|
|
11903
11942
|
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { className: this.question.cssClasses.iconRemove })));
|
|
11904
11943
|
};
|
|
11905
11944
|
return SurveyQuestionPanelDynamicRemoveButton;
|
|
@@ -14542,11 +14581,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14542
14581
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SurveyWindow", function() { return SurveyWindow; });
|
|
14543
14582
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
14544
14583
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
14545
|
-
/* harmony import */ var
|
|
14546
|
-
/* harmony import */ var
|
|
14547
|
-
/* harmony import */ var
|
|
14548
|
-
/* harmony import */ var
|
|
14549
|
-
/* harmony import */ var _components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/svg-icon/svg-icon */ "./src/react/components/svg-icon/svg-icon.tsx");
|
|
14584
|
+
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! survey-core */ "survey-core");
|
|
14585
|
+
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_1__);
|
|
14586
|
+
/* harmony import */ var _reactSurvey__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./reactSurvey */ "./src/react/reactSurvey.tsx");
|
|
14587
|
+
/* harmony import */ var _components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/svg-icon/svg-icon */ "./src/react/components/svg-icon/svg-icon.tsx");
|
|
14550
14588
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
14551
14589
|
var extendStatics = function (d, b) {
|
|
14552
14590
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -14566,7 +14604,6 @@ var __extends = (undefined && undefined.__extends) || (function () {
|
|
|
14566
14604
|
|
|
14567
14605
|
|
|
14568
14606
|
|
|
14569
|
-
|
|
14570
14607
|
var PopupSurvey = /** @class */ (function (_super) {
|
|
14571
14608
|
__extends(PopupSurvey, _super);
|
|
14572
14609
|
function PopupSurvey(props) {
|
|
@@ -14584,46 +14621,65 @@ var PopupSurvey = /** @class */ (function (_super) {
|
|
|
14584
14621
|
return _super.prototype.canRender.call(this) && this.popup.isShowing;
|
|
14585
14622
|
};
|
|
14586
14623
|
PopupSurvey.prototype.renderElement = function () {
|
|
14624
|
+
var _this = this;
|
|
14587
14625
|
var header = this.renderWindowHeader();
|
|
14588
|
-
var body = this.
|
|
14589
|
-
var style = {
|
|
14590
|
-
position: "fixed",
|
|
14591
|
-
bottom: 3,
|
|
14592
|
-
right: 10
|
|
14593
|
-
};
|
|
14626
|
+
var body = this.renderBody();
|
|
14627
|
+
var style = {};
|
|
14594
14628
|
if (!!this.popup.renderedWidth) {
|
|
14595
14629
|
style.width = this.popup.renderedWidth;
|
|
14596
14630
|
style.maxWidth = this.popup.renderedWidth;
|
|
14597
14631
|
}
|
|
14598
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.popup.cssRoot, style: style },
|
|
14599
|
-
|
|
14600
|
-
|
|
14632
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.popup.cssRoot, style: style, onScroll: function () { return _this.popup.onScroll(); } },
|
|
14633
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.popup.cssRootContent },
|
|
14634
|
+
header,
|
|
14635
|
+
body)));
|
|
14601
14636
|
};
|
|
14602
14637
|
PopupSurvey.prototype.renderWindowHeader = function () {
|
|
14603
|
-
var
|
|
14604
|
-
var
|
|
14605
|
-
var
|
|
14606
|
-
var
|
|
14607
|
-
|
|
14608
|
-
|
|
14609
|
-
|
|
14610
|
-
|
|
14611
|
-
|
|
14612
|
-
|
|
14613
|
-
|
|
14614
|
-
|
|
14615
|
-
|
|
14616
|
-
|
|
14638
|
+
var popup = this.popup;
|
|
14639
|
+
var headerCss = popup.cssHeaderRoot;
|
|
14640
|
+
var titleCollapsed = null;
|
|
14641
|
+
var expandCollapseIcon;
|
|
14642
|
+
var closeButton = null;
|
|
14643
|
+
if (popup.isCollapsed) {
|
|
14644
|
+
headerCss += " " + popup.cssRootCollapsedMod;
|
|
14645
|
+
titleCollapsed = this.renderTitleCollapsed(popup);
|
|
14646
|
+
expandCollapseIcon = this.renderExpandIcon();
|
|
14647
|
+
}
|
|
14648
|
+
else {
|
|
14649
|
+
expandCollapseIcon = this.renderCollapseIcon();
|
|
14650
|
+
}
|
|
14651
|
+
if (popup.allowClose) {
|
|
14652
|
+
closeButton = this.renderCloseButton(this.popup);
|
|
14653
|
+
}
|
|
14654
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: popup.cssHeaderRoot },
|
|
14655
|
+
titleCollapsed,
|
|
14656
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: popup.cssHeaderButtonsContainer },
|
|
14657
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: popup.cssHeaderCollapseButton, onClick: this.handleOnExpanded }, expandCollapseIcon),
|
|
14658
|
+
closeButton)));
|
|
14659
|
+
};
|
|
14660
|
+
PopupSurvey.prototype.renderTitleCollapsed = function (popup) {
|
|
14661
|
+
if (!popup.locTitle)
|
|
14662
|
+
return null;
|
|
14663
|
+
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: popup.cssHeaderTitleCollapsed }, popup.locTitle.renderedHtml);
|
|
14664
|
+
};
|
|
14665
|
+
PopupSurvey.prototype.renderExpandIcon = function () {
|
|
14666
|
+
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { iconName: "icon-restore_16x16", size: 16 });
|
|
14667
|
+
};
|
|
14668
|
+
PopupSurvey.prototype.renderCollapseIcon = function () {
|
|
14669
|
+
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { iconName: "icon-minimize_16x16", size: 16 });
|
|
14670
|
+
};
|
|
14671
|
+
PopupSurvey.prototype.renderCloseButton = function (popup) {
|
|
14672
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: popup.cssHeaderCloseButton, onClick: function () { popup.hide(); } },
|
|
14673
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { iconName: "icon-close_16x16", size: 16 })));
|
|
14617
14674
|
};
|
|
14618
14675
|
PopupSurvey.prototype.renderBody = function () {
|
|
14619
|
-
|
|
14620
|
-
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.popup.cssBody, onScroll: function () { return _this.popup.onScroll(); } }, this.doRender());
|
|
14676
|
+
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.popup.cssBody }, this.doRender());
|
|
14621
14677
|
};
|
|
14622
14678
|
PopupSurvey.prototype.createSurvey = function (newProps) {
|
|
14623
14679
|
if (!newProps)
|
|
14624
14680
|
newProps = {};
|
|
14625
14681
|
_super.prototype.createSurvey.call(this, newProps);
|
|
14626
|
-
this.popup = new
|
|
14682
|
+
this.popup = new survey_core__WEBPACK_IMPORTED_MODULE_1__["PopupSurveyModel"](null, this.survey);
|
|
14627
14683
|
if (newProps.closeOnCompleteTimeout) {
|
|
14628
14684
|
this.popup.closeOnCompleteTimeout = newProps.closeOnCompleteTimeout;
|
|
14629
14685
|
}
|
|
@@ -14633,7 +14689,7 @@ var PopupSurvey = /** @class */ (function (_super) {
|
|
|
14633
14689
|
this.popup.expand();
|
|
14634
14690
|
};
|
|
14635
14691
|
return PopupSurvey;
|
|
14636
|
-
}(
|
|
14692
|
+
}(_reactSurvey__WEBPACK_IMPORTED_MODULE_2__["Survey"]));
|
|
14637
14693
|
|
|
14638
14694
|
/**
|
|
14639
14695
|
* Obsolete. Please use PopupSurvey
|
|
@@ -15286,13 +15342,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15286
15342
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SurveyProgressToc", function() { return SurveyProgressToc; });
|
|
15287
15343
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
15288
15344
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
15289
|
-
/* harmony import */ var
|
|
15290
|
-
/* harmony import */ var
|
|
15291
|
-
/* harmony import */ var
|
|
15292
|
-
/* harmony import */ var
|
|
15293
|
-
/* harmony import */ var
|
|
15294
|
-
/* harmony import */ var _components_popup_popup__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/popup/popup */ "./src/react/components/popup/popup.tsx");
|
|
15295
|
-
/* harmony import */ var _components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/svg-icon/svg-icon */ "./src/react/components/svg-icon/svg-icon.tsx");
|
|
15345
|
+
/* harmony import */ var _reactSurveyNavigationBase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reactSurveyNavigationBase */ "./src/react/reactSurveyNavigationBase.tsx");
|
|
15346
|
+
/* harmony import */ var _element_factory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element-factory */ "./src/react/element-factory.tsx");
|
|
15347
|
+
/* harmony import */ var _components_list_list__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/list/list */ "./src/react/components/list/list.tsx");
|
|
15348
|
+
/* harmony import */ var _components_popup_popup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/popup/popup */ "./src/react/components/popup/popup.tsx");
|
|
15349
|
+
/* harmony import */ var _components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/svg-icon/svg-icon */ "./src/react/components/svg-icon/svg-icon.tsx");
|
|
15296
15350
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
15297
15351
|
var extendStatics = function (d, b) {
|
|
15298
15352
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -15314,29 +15368,28 @@ var __extends = (undefined && undefined.__extends) || (function () {
|
|
|
15314
15368
|
|
|
15315
15369
|
|
|
15316
15370
|
|
|
15317
|
-
|
|
15318
15371
|
var SurveyProgressToc = /** @class */ (function (_super) {
|
|
15319
15372
|
__extends(SurveyProgressToc, _super);
|
|
15320
15373
|
function SurveyProgressToc() {
|
|
15321
15374
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
15322
15375
|
}
|
|
15323
15376
|
SurveyProgressToc.prototype.render = function () {
|
|
15324
|
-
var tocModel =
|
|
15377
|
+
var tocModel = this.props.model;
|
|
15325
15378
|
var content;
|
|
15326
15379
|
if (tocModel.isMobile) {
|
|
15327
15380
|
content = react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { onClick: tocModel.togglePopup },
|
|
15328
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](
|
|
15329
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](
|
|
15381
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_5__["SvgIcon"], { iconName: tocModel.icon, size: 24 }),
|
|
15382
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_popup_popup__WEBPACK_IMPORTED_MODULE_4__["Popup"], { model: tocModel.popupModel }));
|
|
15330
15383
|
}
|
|
15331
15384
|
else {
|
|
15332
|
-
content = react__WEBPACK_IMPORTED_MODULE_0__["createElement"](
|
|
15385
|
+
content = react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_list_list__WEBPACK_IMPORTED_MODULE_3__["List"], { model: tocModel.listModel });
|
|
15333
15386
|
}
|
|
15334
15387
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: tocModel.containerCss }, content));
|
|
15335
15388
|
};
|
|
15336
15389
|
return SurveyProgressToc;
|
|
15337
|
-
}(
|
|
15390
|
+
}(_reactSurveyNavigationBase__WEBPACK_IMPORTED_MODULE_1__["SurveyNavigationBase"]));
|
|
15338
15391
|
|
|
15339
|
-
|
|
15392
|
+
_element_factory__WEBPACK_IMPORTED_MODULE_2__["ReactElementFactory"].Instance.registerElement("sv-navigation-toc", function (props) {
|
|
15340
15393
|
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyProgressToc, props);
|
|
15341
15394
|
});
|
|
15342
15395
|
|
|
@@ -17250,7 +17303,7 @@ var SurveyQuestionMatrix = /** @class */ (function (_super) {
|
|
|
17250
17303
|
for (var i = 0; i < visibleRows.length; i++) {
|
|
17251
17304
|
var row = visibleRows[i];
|
|
17252
17305
|
var key = "row-" + row.name + "-" + i;
|
|
17253
|
-
rows.push(react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyQuestionMatrixRow, { key: key, question: this.question, cssClasses: cssClasses,
|
|
17306
|
+
rows.push(react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyQuestionMatrixRow, { key: key, question: this.question, cssClasses: cssClasses, row: row, isFirst: i == 0 }));
|
|
17254
17307
|
}
|
|
17255
17308
|
var header = !this.question.showHeader ? null : (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("thead", null,
|
|
17256
17309
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("tr", null,
|
|
@@ -17271,6 +17324,11 @@ var SurveyQuestionMatrixRow = /** @class */ (function (_super) {
|
|
|
17271
17324
|
function SurveyQuestionMatrixRow(props) {
|
|
17272
17325
|
return _super.call(this, props) || this;
|
|
17273
17326
|
}
|
|
17327
|
+
SurveyQuestionMatrixRow.prototype.getStateElement = function () {
|
|
17328
|
+
if (!!this.row)
|
|
17329
|
+
return this.row.item;
|
|
17330
|
+
return _super.prototype.getStateElement.call(this);
|
|
17331
|
+
};
|
|
17274
17332
|
Object.defineProperty(SurveyQuestionMatrixRow.prototype, "question", {
|
|
17275
17333
|
get: function () {
|
|
17276
17334
|
return this.props.question;
|
|
@@ -17308,7 +17366,7 @@ var SurveyQuestionMatrixRow = /** @class */ (function (_super) {
|
|
|
17308
17366
|
style.minWidth = this.question.rowTitleWidth;
|
|
17309
17367
|
style.width = this.question.rowTitleWidth;
|
|
17310
17368
|
}
|
|
17311
|
-
rowsTD = react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("td", { style: style, className: this.
|
|
17369
|
+
rowsTD = react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("td", { style: style, className: this.row.rowTextClasses }, this.wrapCell({ row: this.row }, rowText, "row-header"));
|
|
17312
17370
|
}
|
|
17313
17371
|
var tds = this.generateTds();
|
|
17314
17372
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("tr", { className: this.row.rowClasses || undefined },
|
|
@@ -17326,9 +17384,7 @@ var SurveyQuestionMatrixRow = /** @class */ (function (_super) {
|
|
|
17326
17384
|
var key = "value" + i;
|
|
17327
17385
|
var itemClass = this_1.question.getItemClass(row, column);
|
|
17328
17386
|
if (this_1.question.hasCellText) {
|
|
17329
|
-
var getHandler =
|
|
17330
|
-
? function (column) { return function () { return _this.cellClick(row, column); }; }
|
|
17331
|
-
: null;
|
|
17387
|
+
var getHandler = function (column) { return function () { return _this.cellClick(row, column); }; };
|
|
17332
17388
|
td = (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("td", { key: key, className: itemClass, onClick: getHandler ? getHandler(column) : function () { } }, this_1.renderLocString(this_1.question.getCellDisplayLocText(row.name, column))));
|
|
17333
17389
|
}
|
|
17334
17390
|
else {
|
|
@@ -17338,7 +17394,6 @@ var SurveyQuestionMatrixRow = /** @class */ (function (_super) {
|
|
|
17338
17394
|
column: column,
|
|
17339
17395
|
columnIndex: i,
|
|
17340
17396
|
cssClasses: this_1.cssClasses,
|
|
17341
|
-
isDisplayMode: this_1.isDisplayMode,
|
|
17342
17397
|
cellChanged: function () { _this.cellClick(_this.row, column); }
|
|
17343
17398
|
});
|
|
17344
17399
|
td = (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("td", { key: key, "data-responsive-title": column.locText.renderedHtml, className: this_1.question.cssClasses.cell }, renderedCell));
|
|
@@ -17421,7 +17476,7 @@ var SurveyQuestionMatrixCell = /** @class */ (function (_super) {
|
|
|
17421
17476
|
mobileSpan));
|
|
17422
17477
|
};
|
|
17423
17478
|
SurveyQuestionMatrixCell.prototype.renderInput = function (inputId, isChecked) {
|
|
17424
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { id: inputId, type: "radio", className: this.cssClasses.itemValue, name: this.row.fullName, value: this.column.value, disabled: this.
|
|
17479
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { id: inputId, type: "radio", className: this.cssClasses.itemValue, name: this.row.fullName, value: this.column.value, disabled: this.row.isReadOnly, checked: isChecked, onChange: this.handleOnChange, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.getCellAriaLabel(this.row.locText.renderedHtml, this.column.locText.renderedHtml), "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-describedby": this.question.a11y_input_ariaDescribedBy }));
|
|
17425
17480
|
};
|
|
17426
17481
|
return SurveyQuestionMatrixCell;
|
|
17427
17482
|
}(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__["ReactSurveyElement"]));
|
|
@@ -19932,7 +19987,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
19932
19987
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "settings", function() { return settings; });
|
|
19933
19988
|
/* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/utils */ "./src/utils/utils.ts");
|
|
19934
19989
|
|
|
19935
|
-
var document = globalThis.document;
|
|
19990
|
+
var document = typeof globalThis !== "undefined" ? globalThis.document : undefined.document;
|
|
19936
19991
|
var defaultEnvironment = (!!document ? {
|
|
19937
19992
|
root: document,
|
|
19938
19993
|
_rootElement: document.body,
|
|
@@ -20110,12 +20165,12 @@ var settings = {
|
|
|
20110
20165
|
* import { ItemValue, settings } from "survey-core";
|
|
20111
20166
|
*
|
|
20112
20167
|
* // `itemValueSerializeAsObject` example
|
|
20113
|
-
* settings.
|
|
20168
|
+
* settings.serialization.itemValueSerializeAsObject = true;
|
|
20114
20169
|
* const item = new ItemValue(5);
|
|
20115
20170
|
* const itemString = item.toJSON(); // Produces { value: 5 } instead of 5
|
|
20116
20171
|
*
|
|
20117
20172
|
* // `itemValueSerializeDisplayText` example
|
|
20118
|
-
* settings.
|
|
20173
|
+
* settings.serialization.itemValueSerializeDisplayText = true;
|
|
20119
20174
|
* const item = new ItemValue("item1");
|
|
20120
20175
|
* const itemString = item.toJSON(); // Produces { value: "item1", text: "item1" } instead of "item1"
|
|
20121
20176
|
* ```
|
|
@@ -21082,7 +21137,7 @@ function scrollElementByChildId(id) {
|
|
|
21082
21137
|
return;
|
|
21083
21138
|
var scrollableEl = findScrollableParent(el);
|
|
21084
21139
|
if (!!scrollableEl) {
|
|
21085
|
-
scrollableEl.dispatchEvent(new CustomEvent("scroll"));
|
|
21140
|
+
setTimeout(function () { return scrollableEl.dispatchEvent(new CustomEvent("scroll")); }, 10);
|
|
21086
21141
|
}
|
|
21087
21142
|
}
|
|
21088
21143
|
function navigateToUrl(url) {
|